From cef9cb22a5e2b9bca56074c5e627225ec0dd3d73 Mon Sep 17 00:00:00 2001 From: Yuxin Zhou Date: Wed, 20 Apr 2022 05:07:02 +0000 Subject: [PATCH] Release 6.1.11 --- common/inc/tx_api.h | 10 +- common/inc/tx_user_sample.h | 8 +- common/src/tx_event_flags_get.c | 16 +- common/src/tx_event_flags_set.c | 21 +- common/src/tx_initialize_kernel_enter.c | 17 +- common_smp/inc/tx_api.h | 10 +- common_smp/inc/tx_user_sample.h | 8 +- common_smp/src/tx_event_flags_get.c | 16 +- common_smp/src/tx_event_flags_set.c | 21 +- common_smp/src/tx_thread_system_suspend.c | 22 +- ports/c667x/ccs/inc/tx_port.h | 8 +- .../ac6/example_build/sample_threadx.c | 369 + .../example_build/sample_threadx/.cproject | 176 + .../ac6/example_build/sample_threadx/.project | 27 + .../sample_threadx/sample_threadx.c | 369 + .../sample_threadx/sample_threadx.launch | 188 + .../sample_threadx/sample_threadx.scat | 44 + .../example_build/sample_threadx/startup.S | 397 + .../sample_threadx/tx_initialize_low_level.S | 299 + .../cortex_a12/ac6/example_build/tx/.cproject | 146 + .../cortex_a12/ac6/example_build/tx/.project | 48 + ports/cortex_a12/ac6/inc/tx_port.h | 328 + .../ac6/src/tx_thread_context_restore.S | 222 + .../ac6/src/tx_thread_context_save.S | 172 + .../ac6/src/tx_thread_fiq_context_restore.S | 223 + .../ac6/src/tx_thread_fiq_context_save.S | 178 + .../ac6/src/tx_thread_fiq_nesting_end.S | 104 + .../ac6/src/tx_thread_fiq_nesting_start.S | 96 + .../ac6/src/tx_thread_interrupt_control.S | 104 + .../ac6/src/tx_thread_interrupt_disable.S | 101 + .../ac6/src/tx_thread_interrupt_restore.S | 93 + .../ac6/src/tx_thread_irq_nesting_end.S | 103 + .../ac6/src/tx_thread_irq_nesting_start.S | 96 + ports/cortex_a12/ac6/src/tx_thread_schedule.S | 230 + .../ac6/src/tx_thread_stack_build.S | 164 + .../ac6/src/tx_thread_system_return.S | 162 + .../ac6/src/tx_thread_vectored_context_save.S | 165 + ports/cortex_a12/ac6/src/tx_timer_interrupt.S | 231 + .../gnu/example_build/build_threadx.bat | 238 + .../example_build/build_threadx_sample.bat | 6 + ports/cortex_a12/gnu/example_build/crt0.S | 90 + ports/cortex_a12/gnu/example_build/reset.S | 64 + .../gnu/example_build/sample_threadx.c | 369 + .../gnu/example_build/sample_threadx.ld | 239 + .../example_build/tx_initialize_low_level.S | 305 + ports/cortex_a12/gnu/inc/tx_port.h | 328 + .../gnu/src/tx_thread_context_restore.S | 222 + .../gnu/src/tx_thread_context_save.S | 172 + .../gnu/src/tx_thread_fiq_context_restore.S | 223 + .../gnu/src/tx_thread_fiq_context_save.S | 178 + .../gnu/src/tx_thread_fiq_nesting_end.S | 104 + .../gnu/src/tx_thread_fiq_nesting_start.S | 96 + .../gnu/src/tx_thread_interrupt_control.S | 104 + .../gnu/src/tx_thread_interrupt_disable.S | 101 + .../gnu/src/tx_thread_interrupt_restore.S | 93 + .../gnu/src/tx_thread_irq_nesting_end.S | 103 + .../gnu/src/tx_thread_irq_nesting_start.S | 96 + ports/cortex_a12/gnu/src/tx_thread_schedule.S | 230 + .../gnu/src/tx_thread_stack_build.S | 164 + .../gnu/src/tx_thread_system_return.S | 162 + .../gnu/src/tx_thread_vectored_context_save.S | 165 + ports/cortex_a12/gnu/src/tx_timer_interrupt.S | 231 + .../ac6/example_build/sample_threadx.c | 369 + .../example_build/sample_threadx/.cproject | 92 +- .../ac6/example_build/sample_threadx/.project | 1 - .../sample_threadx/sample_threadx.c | 46 +- .../sample_threadx/sample_threadx.launch | 188 + .../sample_threadx/sample_threadx.scat | 47 +- .../example_build/sample_threadx/startup.S | 123 +- .../sample_threadx/tx_initialize_low_level.S | 506 +- .../cortex_a15/ac6/example_build/tx/.cproject | 74 +- ports/cortex_a15/ac6/inc/tx_port.h | 92 +- .../ac6/src/tx_thread_context_restore.S | 419 +- .../ac6/src/tx_thread_context_save.S | 327 +- .../ac6/src/tx_thread_fiq_context_restore.S | 425 +- .../ac6/src/tx_thread_fiq_context_save.S | 344 +- .../ac6/src/tx_thread_fiq_nesting_end.S | 194 +- .../ac6/src/tx_thread_fiq_nesting_start.S | 186 +- .../ac6/src/tx_thread_interrupt_control.S | 189 +- .../ac6/src/tx_thread_interrupt_disable.S | 178 +- .../ac6/src/tx_thread_interrupt_restore.S | 173 +- .../ac6/src/tx_thread_irq_nesting_end.S | 194 +- .../ac6/src/tx_thread_irq_nesting_start.S | 186 +- ports/cortex_a15/ac6/src/tx_thread_schedule.S | 373 +- .../ac6/src/tx_thread_stack_build.S | 302 +- .../ac6/src/tx_thread_system_return.S | 300 +- .../ac6/src/tx_thread_vectored_context_save.S | 309 +- ports/cortex_a15/ac6/src/tx_timer_interrupt.S | 464 +- .../example_build/build_threadx_sample.bat | 2 +- ports/cortex_a15/gnu/example_build/crt0.S | 20 +- ports/cortex_a15/gnu/example_build/reset.S | 98 +- .../gnu/example_build/sample_threadx.c | 46 +- .../example_build/tx_initialize_low_level.S | 506 +- ports/cortex_a15/gnu/inc/tx_port.h | 92 +- .../gnu/src/tx_thread_context_restore.S | 420 +- .../gnu/src/tx_thread_context_save.S | 330 +- .../gnu/src/tx_thread_fiq_context_restore.S | 424 +- .../gnu/src/tx_thread_fiq_context_save.S | 343 +- .../gnu/src/tx_thread_fiq_nesting_end.S | 194 +- .../gnu/src/tx_thread_fiq_nesting_start.S | 186 +- .../gnu/src/tx_thread_interrupt_control.S | 189 +- .../gnu/src/tx_thread_interrupt_disable.S | 178 +- .../gnu/src/tx_thread_interrupt_restore.S | 173 +- .../gnu/src/tx_thread_irq_nesting_end.S | 194 +- .../gnu/src/tx_thread_irq_nesting_start.S | 186 +- ports/cortex_a15/gnu/src/tx_thread_schedule.S | 374 +- .../gnu/src/tx_thread_stack_build.S | 302 +- .../gnu/src/tx_thread_system_return.S | 301 +- .../gnu/src/tx_thread_vectored_context_save.S | 308 +- ports/cortex_a15/gnu/src/tx_timer_interrupt.S | 464 +- .../ac6/example_build/sample_threadx.c | 369 + .../example_build/sample_threadx/.cproject | 176 + .../ac6/example_build/sample_threadx/.project | 27 + .../sample_threadx/sample_threadx.c | 369 + .../sample_threadx/sample_threadx.launch | 188 + .../sample_threadx/sample_threadx.scat | 44 + .../example_build/sample_threadx/startup.S | 397 + .../sample_threadx/tx_initialize_low_level.S | 299 + .../cortex_a17/ac6/example_build/tx/.cproject | 146 + .../cortex_a17/ac6/example_build/tx/.project | 48 + ports/cortex_a17/ac6/inc/tx_port.h | 328 + .../ac6/src/tx_thread_context_restore.S | 222 + .../ac6/src/tx_thread_context_save.S | 172 + .../ac6/src/tx_thread_fiq_context_restore.S | 223 + .../ac6/src/tx_thread_fiq_context_save.S | 178 + .../ac6/src/tx_thread_fiq_nesting_end.S | 104 + .../ac6/src/tx_thread_fiq_nesting_start.S | 96 + .../ac6/src/tx_thread_interrupt_control.S | 104 + .../ac6/src/tx_thread_interrupt_disable.S | 101 + .../ac6/src/tx_thread_interrupt_restore.S | 93 + .../ac6/src/tx_thread_irq_nesting_end.S | 103 + .../ac6/src/tx_thread_irq_nesting_start.S | 96 + ports/cortex_a17/ac6/src/tx_thread_schedule.S | 230 + .../ac6/src/tx_thread_stack_build.S | 164 + .../ac6/src/tx_thread_system_return.S | 162 + .../ac6/src/tx_thread_vectored_context_save.S | 165 + ports/cortex_a17/ac6/src/tx_timer_interrupt.S | 231 + .../gnu/example_build/build_threadx.bat | 238 + .../example_build/build_threadx_sample.bat | 6 + ports/cortex_a17/gnu/example_build/crt0.S | 90 + ports/cortex_a17/gnu/example_build/reset.S | 64 + .../gnu/example_build/sample_threadx.c | 369 + .../gnu/example_build/sample_threadx.ld | 239 + .../example_build/tx_initialize_low_level.S | 305 + ports/cortex_a17/gnu/inc/tx_port.h | 328 + .../gnu/src/tx_thread_context_restore.S | 222 + .../gnu/src/tx_thread_context_save.S | 172 + .../gnu/src/tx_thread_fiq_context_restore.S | 223 + .../gnu/src/tx_thread_fiq_context_save.S | 178 + .../gnu/src/tx_thread_fiq_nesting_end.S | 104 + .../gnu/src/tx_thread_fiq_nesting_start.S | 96 + .../gnu/src/tx_thread_interrupt_control.S | 104 + .../gnu/src/tx_thread_interrupt_disable.S | 101 + .../gnu/src/tx_thread_interrupt_restore.S | 93 + .../gnu/src/tx_thread_irq_nesting_end.S | 103 + .../gnu/src/tx_thread_irq_nesting_start.S | 96 + ports/cortex_a17/gnu/src/tx_thread_schedule.S | 230 + .../gnu/src/tx_thread_stack_build.S | 164 + .../gnu/src/tx_thread_system_return.S | 162 + .../gnu/src/tx_thread_vectored_context_save.S | 165 + ports/cortex_a17/gnu/src/tx_timer_interrupt.S | 231 + .../ac6/example_build/sample_threadx.c | 369 + .../example_build/sample_threadx/.cproject | 176 + .../ac6/example_build/sample_threadx/.project | 27 + .../sample_threadx/sample_threadx.c | 369 + .../sample_threadx/sample_threadx.launch | 188 + .../sample_threadx/sample_threadx.scat | 44 + .../example_build/sample_threadx/startup.S | 397 + .../sample_threadx/tx_initialize_low_level.S | 299 + .../cortex_a5/ac6/example_build/tx/.cproject | 146 + ports/cortex_a5/ac6/example_build/tx/.project | 48 + ports/cortex_a5/ac6/inc/tx_port.h | 328 + .../ac6/src/tx_thread_context_restore.S | 222 + .../ac6/src/tx_thread_context_save.S | 172 + .../ac6/src/tx_thread_fiq_context_restore.S | 223 + .../ac6/src/tx_thread_fiq_context_save.S | 178 + .../ac6/src/tx_thread_fiq_nesting_end.S | 104 + .../ac6/src/tx_thread_fiq_nesting_start.S | 96 + .../ac6/src/tx_thread_interrupt_control.S | 104 + .../ac6/src/tx_thread_interrupt_disable.S | 101 + .../ac6/src/tx_thread_interrupt_restore.S | 93 + .../ac6/src/tx_thread_irq_nesting_end.S | 103 + .../ac6/src/tx_thread_irq_nesting_start.S | 96 + ports/cortex_a5/ac6/src/tx_thread_schedule.S | 230 + .../cortex_a5/ac6/src/tx_thread_stack_build.S | 164 + .../ac6/src/tx_thread_system_return.S | 162 + .../ac6/src/tx_thread_vectored_context_save.S | 165 + ports/cortex_a5/ac6/src/tx_timer_interrupt.S | 231 + .../example_build/build_threadx_sample.bat | 2 +- ports/cortex_a5/gnu/example_build/crt0.S | 20 +- ports/cortex_a5/gnu/example_build/reset.S | 98 +- .../gnu/example_build/sample_threadx.c | 46 +- .../example_build/tx_initialize_low_level.S | 506 +- ports/cortex_a5/gnu/inc/tx_port.h | 92 +- .../gnu/src/tx_thread_context_restore.S | 420 +- .../gnu/src/tx_thread_context_save.S | 330 +- .../gnu/src/tx_thread_fiq_context_restore.S | 424 +- .../gnu/src/tx_thread_fiq_context_save.S | 343 +- .../gnu/src/tx_thread_fiq_nesting_end.S | 194 +- .../gnu/src/tx_thread_fiq_nesting_start.S | 186 +- .../gnu/src/tx_thread_interrupt_control.S | 189 +- .../gnu/src/tx_thread_interrupt_disable.S | 178 +- .../gnu/src/tx_thread_interrupt_restore.S | 173 +- .../gnu/src/tx_thread_irq_nesting_end.S | 194 +- .../gnu/src/tx_thread_irq_nesting_start.S | 186 +- ports/cortex_a5/gnu/src/tx_thread_schedule.S | 374 +- .../cortex_a5/gnu/src/tx_thread_stack_build.S | 302 +- .../gnu/src/tx_thread_system_return.S | 301 +- .../gnu/src/tx_thread_vectored_context_save.S | 308 +- ports/cortex_a5/gnu/src/tx_timer_interrupt.S | 464 +- .../ac6/example_build/sample_threadx.c | 369 + .../sample_threadx/sample_threadx.c | 46 +- .../sample_threadx/sample_threadx.launch | 188 + .../sample_threadx/sample_threadx.scat | 4 +- .../example_build/sample_threadx/startup.S | 62 +- .../sample_threadx/tx_initialize_low_level.S | 501 +- ports/cortex_a7/ac6/inc/tx_port.h | 92 +- .../ac6/src/tx_thread_context_restore.S | 419 +- .../ac6/src/tx_thread_context_save.S | 327 +- .../ac6/src/tx_thread_fiq_context_restore.S | 425 +- .../ac6/src/tx_thread_fiq_context_save.S | 344 +- .../ac6/src/tx_thread_fiq_nesting_end.S | 194 +- .../ac6/src/tx_thread_fiq_nesting_start.S | 186 +- .../ac6/src/tx_thread_interrupt_control.S | 189 +- .../ac6/src/tx_thread_interrupt_disable.S | 178 +- .../ac6/src/tx_thread_interrupt_restore.S | 173 +- .../ac6/src/tx_thread_irq_nesting_end.S | 194 +- .../ac6/src/tx_thread_irq_nesting_start.S | 186 +- ports/cortex_a7/ac6/src/tx_thread_schedule.S | 373 +- .../cortex_a7/ac6/src/tx_thread_stack_build.S | 302 +- .../ac6/src/tx_thread_system_return.S | 300 +- .../ac6/src/tx_thread_vectored_context_save.S | 309 +- ports/cortex_a7/ac6/src/tx_timer_interrupt.S | 464 +- .../example_build/build_threadx_sample.bat | 4 +- ports/cortex_a7/gnu/example_build/crt0.S | 20 +- ports/cortex_a7/gnu/example_build/reset.S | 98 +- .../gnu/example_build/sample_threadx.c | 46 +- .../example_build/tx_initialize_low_level.S | 506 +- ports/cortex_a7/gnu/inc/tx_port.h | 92 +- .../gnu/src/tx_thread_context_restore.S | 420 +- .../gnu/src/tx_thread_context_save.S | 330 +- .../gnu/src/tx_thread_fiq_context_restore.S | 424 +- .../gnu/src/tx_thread_fiq_context_save.S | 343 +- .../gnu/src/tx_thread_fiq_nesting_end.S | 194 +- .../gnu/src/tx_thread_fiq_nesting_start.S | 186 +- .../gnu/src/tx_thread_interrupt_control.S | 189 +- .../gnu/src/tx_thread_interrupt_disable.S | 178 +- .../gnu/src/tx_thread_interrupt_restore.S | 173 +- .../gnu/src/tx_thread_irq_nesting_end.S | 194 +- .../gnu/src/tx_thread_irq_nesting_start.S | 186 +- ports/cortex_a7/gnu/src/tx_thread_schedule.S | 374 +- .../cortex_a7/gnu/src/tx_thread_stack_build.S | 302 +- .../gnu/src/tx_thread_system_return.S | 301 +- .../gnu/src/tx_thread_vectored_context_save.S | 308 +- ports/cortex_a7/gnu/src/tx_timer_interrupt.S | 464 +- .../ac6/example_build/sample_threadx.c | 369 + .../example_build/sample_threadx/.cproject | 86 +- .../sample_threadx/sample_threadx.c | 46 +- .../sample_threadx/sample_threadx.launch | 188 + .../sample_threadx/sample_threadx.scat | 45 +- .../example_build/sample_threadx/startup.S | 190 +- .../sample_threadx/tx_initialize_low_level.S | 504 +- .../cortex_a8/ac6/example_build/tx/.cproject | 74 +- ports/cortex_a8/ac6/inc/tx_port.h | 92 +- .../ac6/src/tx_thread_context_restore.S | 419 +- .../ac6/src/tx_thread_context_save.S | 327 +- .../ac6/src/tx_thread_fiq_context_restore.S | 425 +- .../ac6/src/tx_thread_fiq_context_save.S | 344 +- .../ac6/src/tx_thread_fiq_nesting_end.S | 194 +- .../ac6/src/tx_thread_fiq_nesting_start.S | 186 +- .../ac6/src/tx_thread_interrupt_control.S | 189 +- .../ac6/src/tx_thread_interrupt_disable.S | 178 +- .../ac6/src/tx_thread_interrupt_restore.S | 173 +- .../ac6/src/tx_thread_irq_nesting_end.S | 194 +- .../ac6/src/tx_thread_irq_nesting_start.S | 186 +- ports/cortex_a8/ac6/src/tx_thread_schedule.S | 373 +- .../cortex_a8/ac6/src/tx_thread_stack_build.S | 302 +- .../ac6/src/tx_thread_system_return.S | 300 +- .../ac6/src/tx_thread_vectored_context_save.S | 309 +- ports/cortex_a8/ac6/src/tx_timer_interrupt.S | 464 +- .../example_build/build_threadx_sample.bat | 2 +- ports/cortex_a8/gnu/example_build/crt0.S | 20 +- ports/cortex_a8/gnu/example_build/reset.S | 98 +- .../gnu/example_build/sample_threadx.c | 46 +- .../example_build/tx_initialize_low_level.S | 506 +- ports/cortex_a8/gnu/inc/tx_port.h | 92 +- .../gnu/src/tx_thread_context_restore.S | 420 +- .../gnu/src/tx_thread_context_save.S | 330 +- .../gnu/src/tx_thread_fiq_context_restore.S | 424 +- .../gnu/src/tx_thread_fiq_context_save.S | 343 +- .../gnu/src/tx_thread_fiq_nesting_end.S | 194 +- .../gnu/src/tx_thread_fiq_nesting_start.S | 186 +- .../gnu/src/tx_thread_interrupt_control.S | 189 +- .../gnu/src/tx_thread_interrupt_disable.S | 178 +- .../gnu/src/tx_thread_interrupt_restore.S | 173 +- .../gnu/src/tx_thread_irq_nesting_end.S | 194 +- .../gnu/src/tx_thread_irq_nesting_start.S | 186 +- ports/cortex_a8/gnu/src/tx_thread_schedule.S | 374 +- .../cortex_a8/gnu/src/tx_thread_stack_build.S | 302 +- .../gnu/src/tx_thread_system_return.S | 301 +- .../gnu/src/tx_thread_vectored_context_save.S | 308 +- ports/cortex_a8/gnu/src/tx_timer_interrupt.S | 464 +- .../ac6/example_build/sample_threadx.c | 369 + .../example_build/sample_threadx/.cproject | 86 +- .../ac6/example_build/sample_threadx/.project | 1 - .../sample_threadx/sample_threadx.c | 46 +- .../sample_threadx/sample_threadx.launch | 188 + .../sample_threadx/sample_threadx.scat | 10 +- .../example_build/sample_threadx/startup.S | 98 +- .../sample_threadx/tx_initialize_low_level.S | 504 +- .../cortex_a9/ac6/example_build/tx/.cproject | 74 +- ports/cortex_a9/ac6/inc/tx_port.h | 92 +- .../ac6/src/tx_thread_context_restore.S | 419 +- .../ac6/src/tx_thread_context_save.S | 327 +- .../ac6/src/tx_thread_fiq_context_restore.S | 425 +- .../ac6/src/tx_thread_fiq_context_save.S | 344 +- .../ac6/src/tx_thread_fiq_nesting_end.S | 194 +- .../ac6/src/tx_thread_fiq_nesting_start.S | 186 +- .../ac6/src/tx_thread_interrupt_control.S | 189 +- .../ac6/src/tx_thread_interrupt_disable.S | 178 +- .../ac6/src/tx_thread_interrupt_restore.S | 173 +- .../ac6/src/tx_thread_irq_nesting_end.S | 194 +- .../ac6/src/tx_thread_irq_nesting_start.S | 186 +- ports/cortex_a9/ac6/src/tx_thread_schedule.S | 373 +- .../cortex_a9/ac6/src/tx_thread_stack_build.S | 302 +- .../ac6/src/tx_thread_system_return.S | 300 +- .../ac6/src/tx_thread_vectored_context_save.S | 309 +- ports/cortex_a9/ac6/src/tx_timer_interrupt.S | 464 +- .../example_build/build_threadx_sample.bat | 2 +- ports/cortex_a9/gnu/example_build/crt0.S | 20 +- ports/cortex_a9/gnu/example_build/reset.S | 98 +- .../gnu/example_build/sample_threadx.c | 46 +- .../example_build/tx_initialize_low_level.S | 506 +- ports/cortex_a9/gnu/inc/tx_port.h | 92 +- .../gnu/src/tx_thread_context_restore.S | 420 +- .../gnu/src/tx_thread_context_save.S | 330 +- .../gnu/src/tx_thread_fiq_context_restore.S | 424 +- .../gnu/src/tx_thread_fiq_context_save.S | 343 +- .../gnu/src/tx_thread_fiq_nesting_end.S | 194 +- .../gnu/src/tx_thread_fiq_nesting_start.S | 186 +- .../gnu/src/tx_thread_interrupt_control.S | 189 +- .../gnu/src/tx_thread_interrupt_disable.S | 178 +- .../gnu/src/tx_thread_interrupt_restore.S | 173 +- .../gnu/src/tx_thread_irq_nesting_end.S | 194 +- .../gnu/src/tx_thread_irq_nesting_start.S | 186 +- ports/cortex_a9/gnu/src/tx_thread_schedule.S | 374 +- .../cortex_a9/gnu/src/tx_thread_stack_build.S | 302 +- .../gnu/src/tx_thread_system_return.S | 301 +- .../gnu/src/tx_thread_vectored_context_save.S | 308 +- ports/cortex_a9/gnu/src/tx_timer_interrupt.S | 464 +- ports/cortex_m0/ac5/inc/tx_port.h | 13 +- ports/cortex_m0/ac6/inc/tx_port.h | 15 +- ports/cortex_m0/gnu/inc/tx_port.h | 21 +- ports/cortex_m0/iar/inc/tx_port.h | 17 +- ports/cortex_m0/keil/inc/tx_port.h | 17 +- ports/cortex_m23/ac6/inc/tx_port.h | 15 +- ports/cortex_m23/gnu/inc/tx_port.h | 16 +- ports/cortex_m23/iar/inc/tx_port.h | 15 +- ports/cortex_m3/ac5/inc/tx_port.h | 17 +- ports/cortex_m3/ac5/src/tx_thread_schedule.s | 43 +- ports/cortex_m3/ac6/inc/tx_port.h | 17 +- ports/cortex_m3/ac6/src/tx_misra.S | 1033 +++ ports/cortex_m3/ac6/src/tx_thread_schedule.S | 43 +- ports/cortex_m3/gnu/inc/tx_port.h | 17 +- ports/cortex_m3/gnu/src/tx_misra.S | 1033 +++ ports/cortex_m3/gnu/src/tx_thread_schedule.S | 42 +- ports/cortex_m3/iar/inc/tx_port.h | 17 +- ports/cortex_m3/iar/src/tx_thread_schedule.s | 43 +- ports/cortex_m3/keil/inc/tx_port.h | 17 +- ports/cortex_m33/ac6/inc/tx_port.h | 27 +- ports/cortex_m33/ac6/src/tx_thread_schedule.S | 41 +- ports/cortex_m33/gnu/inc/tx_port.h | 27 +- ports/cortex_m33/gnu/src/tx_thread_schedule.S | 41 +- ports/cortex_m33/iar/inc/tx_port.h | 27 +- ports/cortex_m33/iar/src/tx_thread_schedule.s | 41 +- ports/cortex_m4/ac5/inc/tx_port.h | 17 +- ports/cortex_m4/ac5/src/tx_thread_schedule.s | 43 +- ports/cortex_m4/ac6/inc/tx_port.h | 17 +- ports/cortex_m4/ac6/src/tx_misra.S | 1033 +++ ports/cortex_m4/ac6/src/tx_thread_schedule.S | 43 +- ports/cortex_m4/gnu/inc/tx_port.h | 17 +- ports/cortex_m4/gnu/src/tx_misra.S | 1033 +++ ports/cortex_m4/gnu/src/tx_thread_schedule.S | 42 +- ports/cortex_m4/iar/inc/tx_port.h | 17 +- ports/cortex_m4/iar/src/tx_thread_schedule.s | 43 +- ports/cortex_m4/keil/inc/tx_port.h | 17 +- ports/cortex_m7/ac5/inc/tx_port.h | 17 +- ports/cortex_m7/ac5/src/tx_thread_schedule.s | 43 +- ports/cortex_m7/ac6/inc/tx_port.h | 17 +- ports/cortex_m7/ac6/src/tx_misra.S | 1033 +++ ports/cortex_m7/ac6/src/tx_thread_schedule.S | 43 +- ports/cortex_m7/gnu/inc/tx_port.h | 17 +- ports/cortex_m7/gnu/src/tx_misra.S | 1033 +++ ports/cortex_m7/gnu/src/tx_thread_schedule.S | 42 +- ports/cortex_m7/iar/inc/tx_port.h | 17 +- ports/cortex_m7/iar/src/tx_thread_schedule.s | 43 +- ports/linux/gnu/inc/tx_port.h | 7 +- .../xtensa/xcc/src/tx_initialize_low_level.c | 9 +- ports/xtensa/xcc/src/tx_timer_interrupt.S | 7 +- ports/xtensa/xcc/src/xtensa_coproc_handler.S | 12 +- ports/xtensa/xcc/src/xtensa_init.c | 6 +- ports/xtensa/xcc/src/xtensa_vectors_xea3.S | 5 +- .../src/tx_thread_context_restore.S | 90 +- .../src/tx_thread_smp_protect.S | 313 +- .../src/tx_thread_smp_unprotect.S | 18 +- .../src/tx_thread_context_restore.S | 90 +- .../src/tx_thread_smp_protect.S | 313 +- .../src/tx_thread_smp_unprotect.S | 18 +- ports_module/cortex_m0+/ac6/inc/tx_port.h | 12 +- .../module_manager/src/tx_thread_schedule.S | 25 +- ports_module/cortex_m0+/gnu/inc/tx_port.h | 14 +- .../module_manager/src/tx_thread_schedule.S | 25 +- .../cortex_m0+/iar/example_build/startup.s | 6 +- ports_module/cortex_m0+/iar/inc/tx_port.h | 13 +- .../module_manager/src/tx_thread_schedule.S | 34 +- ports_module/cortex_m23/ac6/inc/tx_port.h | 50 +- .../module_manager/src/tx_thread_schedule.S | 22 +- ports_module/cortex_m23/gnu/inc/tx_port.h | 35 +- .../module_manager/src/tx_thread_schedule.S | 22 +- ports_module/cortex_m23/iar/inc/tx_port.h | 21 +- .../module_manager/src/tx_thread_schedule.s | 22 +- ports_module/cortex_m3/ac5/inc/tx_port.h | 15 +- .../module_manager/src/tx_thread_schedule.s | 73 +- ports_module/cortex_m3/ac6/inc/tx_port.h | 18 +- .../module_manager/src/tx_thread_schedule.S | 91 +- ports_module/cortex_m3/gnu/inc/tx_port.h | 20 +- .../module_manager/src/tx_thread_schedule.S | 75 +- ports_module/cortex_m3/iar/inc/tx_port.h | 15 +- .../module_manager/src/tx_thread_schedule.s | 74 +- ports_module/cortex_m33/ac6/inc/tx_port.h | 29 +- .../module_manager/src/tx_thread_schedule.S | 66 +- ports_module/cortex_m33/gnu/inc/tx_port.h | 29 +- .../module_manager/src/tx_thread_schedule.S | 66 +- ports_module/cortex_m33/iar/inc/tx_port.h | 29 +- .../module_manager/src/tx_thread_schedule.s | 68 +- ports_module/cortex_m4/ac5/inc/tx_port.h | 15 +- .../module_manager/src/tx_thread_schedule.s | 73 +- ports_module/cortex_m4/ac6/inc/tx_port.h | 18 +- .../module_manager/src/tx_thread_schedule.S | 91 +- ports_module/cortex_m4/gnu/inc/tx_port.h | 20 +- .../module_manager/src/tx_thread_schedule.S | 75 +- ports_module/cortex_m4/iar/inc/tx_port.h | 15 +- .../module_manager/src/tx_thread_schedule.s | 74 +- ports_module/cortex_m7/ac5/inc/tx_port.h | 15 +- .../module_manager/src/tx_thread_schedule.s | 73 +- ports_module/cortex_m7/ac6/inc/tx_port.h | 18 +- .../module_manager/src/tx_thread_schedule.S | 91 +- ports_module/cortex_m7/gnu/inc/tx_port.h | 20 +- .../module_manager/src/tx_thread_schedule.S | 75 +- .../libraries/libboard_samv7-ek/board.h | 763 -- .../libraries/libboard_samv7-ek/include/bmp.h | 119 - .../include/board_lowlevel.h | 47 - .../include/board_memories.h | 48 - .../libboard_samv7-ek/include/cs2100.h | 93 - .../libboard_samv7-ek/include/dbg_console.h | 53 - .../libboard_samv7-ek/include/frame_buffer.h | 83 - .../libboard_samv7-ek/include/gmacb_phy.h | 114 - .../libboard_samv7-ek/include/gmii.h | 116 - .../libboard_samv7-ek/include/ili9488.h | 107 - .../libboard_samv7-ek/include/ili9488_dma.h | 94 - .../libboard_samv7-ek/include/ili9488_ebi.h | 62 - .../include/ili9488_ebi_dma.h | 55 - .../libboard_samv7-ek/include/ili9488_reg.h | 131 - .../libboard_samv7-ek/include/ili9488_spi.h | 69 - .../include/ili9488_spi_dma.h | 56 - .../include/image_sensor_inf.h | 135 - .../libboard_samv7-ek/include/lcd_color.h | 109 - .../libboard_samv7-ek/include/lcd_draw.h | 186 - .../libboard_samv7-ek/include/lcd_font.h | 108 - .../libboard_samv7-ek/include/lcd_font10x14.h | 45 - .../include/lcd_gimp_image.h | 42 - .../libboard_samv7-ek/include/lcdd.h | 52 - .../libraries/libboard_samv7-ek/include/led.h | 72 - .../libboard_samv7-ek/include/math.h | 42 - .../libboard_samv7-ek/include/mcan_config.h | 126 - .../libboard_samv7-ek/include/rtc_calib.h | 49 - .../libboard_samv7-ek/include/s25fl1.h | 255 - .../libboard_samv7-ek/include/syscalls.h | 65 - .../libboard_samv7-ek/include/wm8904.h | 160 - .../libraries/libchip_samv7/chip.h | 124 - .../libraries/libchip_samv7/compiler.h | 442 - .../libraries/libchip_samv7/include/acc.h | 151 - .../libraries/libchip_samv7/include/adc.h | 178 - .../libraries/libchip_samv7/include/aes.h | 68 - .../libraries/libchip_samv7/include/afe_dma.h | 118 - .../libraries/libchip_samv7/include/afec.h | 187 - .../cmsis/CMSIS/Include/arm_common_tables.h | 136 - .../cmsis/CMSIS/Include/arm_const_structs.h | 79 - .../include/cmsis/CMSIS/Include/arm_math.h | 7556 ----------------- .../include/cmsis/CMSIS/Include/core_cm0.h | 740 -- .../cmsis/CMSIS/Include/core_cm0plus.h | 854 -- .../include/cmsis/CMSIS/Include/core_cm3.h | 1693 ---- .../include/cmsis/CMSIS/Include/core_cm4.h | 1858 ---- .../include/cmsis/CMSIS/Include/core_cm7.h | 2397 ------ .../include/cmsis/CMSIS/Include/core_cmFunc.h | 664 -- .../cmsis/CMSIS/Include/core_cmInstr.h | 916 -- .../include/cmsis/CMSIS/Include/core_cmSimd.h | 697 -- .../include/cmsis/CMSIS/Include/core_sc000.h | 864 -- .../include/cmsis/CMSIS/Include/core_sc300.h | 1675 ---- .../libraries/libchip_samv7/include/dac_dma.h | 151 - .../libraries/libchip_samv7/include/efc.h | 128 - .../libchip_samv7/include/exceptions.h | 52 - .../libraries/libchip_samv7/include/flashd.h | 91 - .../libraries/libchip_samv7/include/gmac.h | 338 - .../libraries/libchip_samv7/include/gmacd.h | 284 - .../libraries/libchip_samv7/include/hsmci.h | 154 - .../libraries/libchip_samv7/include/icm.h | 113 - .../libraries/libchip_samv7/include/isi.h | 204 - .../libchip_samv7/include/iso7816_4.h | 110 - .../libraries/libchip_samv7/include/mcan.h | 344 - .../libraries/libchip_samv7/include/mcid.h | 172 - .../libraries/libchip_samv7/include/mediaLB.h | 45 - .../libraries/libchip_samv7/include/mpu.h | 172 - .../libraries/libchip_samv7/include/pio.h | 218 - .../libchip_samv7/include/pio_capture.h | 79 - .../libraries/libchip_samv7/include/pio_it.h | 97 - .../libraries/libchip_samv7/include/pmc.h | 101 - .../libraries/libchip_samv7/include/pwmc.h | 135 - .../libraries/libchip_samv7/include/qspi.h | 236 - .../libchip_samv7/include/qspi_dma.h | 115 - .../libraries/libchip_samv7/include/rstc.h | 64 - .../libraries/libchip_samv7/include/rtc.h | 102 - .../libraries/libchip_samv7/include/rtt.h | 82 - .../include/samv7/component/component_acc.h | 128 - .../include/samv7/component/component_aes.h | 172 - .../include/samv7/component/component_afec.h | 483 -- .../samv7/component/component_chipid.h | 123 - .../include/samv7/component/component_dacc.h | 202 - .../include/samv7/component/component_efc.h | 118 - .../include/samv7/component/component_gmac.h | 832 -- .../include/samv7/component/component_gpbr.h | 53 - .../include/samv7/component/component_hsmci.h | 335 - .../include/samv7/component/component_icm.h | 192 - .../include/samv7/component/component_isi.h | 280 - .../samv7/component/component_matrix.h | 174 - .../include/samv7/component/component_mcan.h | 845 -- .../include/samv7/component/component_mlb.h | 192 - .../include/samv7/component/component_pio.h | 1785 ---- .../include/samv7/component/component_pmc.h | 721 -- .../include/samv7/component/component_pwm.h | 700 -- .../include/samv7/component/component_qspi.h | 223 - .../include/samv7/component/component_rstc.h | 79 - .../include/samv7/component/component_rswdt.h | 72 - .../include/samv7/component/component_rtc.h | 226 - .../include/samv7/component/component_rtt.h | 71 - .../samv7/component/component_sdramc.h | 173 - .../include/samv7/component/component_smc.h | 144 - .../include/samv7/component/component_spi.h | 161 - .../include/samv7/component/component_ssc.h | 280 - .../include/samv7/component/component_supc.h | 295 - .../include/samv7/component/component_tc.h | 346 - .../include/samv7/component/component_trng.h | 73 - .../include/samv7/component/component_twi.h | 165 - .../include/samv7/component/component_twihs.h | 250 - .../include/samv7/component/component_uart.h | 151 - .../samv7/component/component_uotghs.h | 1033 --- .../include/samv7/component/component_usart.h | 425 - .../include/samv7/component/component_usbhs.h | 960 --- .../include/samv7/component/component_utmi.h | 63 - .../include/samv7/component/component_wdt.h | 72 - .../include/samv7/component/component_xdmac.h | 619 -- .../include/samv7/instance/instance_acc.h | 56 - .../include/samv7/instance/instance_aes.h | 70 - .../include/samv7/instance/instance_afec0.h | 96 - .../include/samv7/instance/instance_afec1.h | 96 - .../include/samv7/instance/instance_chipid.h | 42 - .../include/samv7/instance/instance_dacc.h | 66 - .../include/samv7/instance/instance_efc.h | 50 - .../include/samv7/instance/instance_gmac.h | 370 - .../include/samv7/instance/instance_gpbr.h | 40 - .../include/samv7/instance/instance_hsmci.h | 78 - .../include/samv7/instance/instance_icm.h | 60 - .../include/samv7/instance/instance_isi.h | 88 - .../include/samv7/instance/instance_matrix.h | 90 - .../include/samv7/instance/instance_mcan0.h | 126 - .../include/samv7/instance/instance_mcan1.h | 126 - .../include/samv7/instance/instance_mlb.h | 74 - .../include/samv7/instance/instance_pioa.h | 162 - .../include/samv7/instance/instance_piob.h | 162 - .../include/samv7/instance/instance_pioc.h | 162 - .../include/samv7/instance/instance_piod.h | 162 - .../include/samv7/instance/instance_pioe.h | 162 - .../include/samv7/instance/instance_pmc.h | 110 - .../include/samv7/instance/instance_pwm0.h | 260 - .../include/samv7/instance/instance_pwm1.h | 260 - .../include/samv7/instance/instance_qspi.h | 70 - .../include/samv7/instance/instance_rstc.h | 44 - .../include/samv7/instance/instance_rswdt.h | 44 - .../include/samv7/instance/instance_rtc.h | 62 - .../include/samv7/instance/instance_rtt.h | 46 - .../include/samv7/instance/instance_sdramc.h | 64 - .../include/samv7/instance/instance_smc.h | 80 - .../include/samv7/instance/instance_spi0.h | 60 - .../include/samv7/instance/instance_spi1.h | 60 - .../include/samv7/instance/instance_ssc.h | 74 - .../include/samv7/instance/instance_supc.h | 50 - .../include/samv7/instance/instance_tc0.h | 132 - .../include/samv7/instance/instance_tc1.h | 132 - .../include/samv7/instance/instance_tc2.h | 132 - .../include/samv7/instance/instance_tc3.h | 132 - .../include/samv7/instance/instance_trng.h | 50 - .../include/samv7/instance/instance_twihs0.h | 70 - .../include/samv7/instance/instance_twihs1.h | 70 - .../include/samv7/instance/instance_twihs2.h | 70 - .../include/samv7/instance/instance_uart0.h | 60 - .../include/samv7/instance/instance_uart1.h | 60 - .../include/samv7/instance/instance_uart2.h | 60 - .../include/samv7/instance/instance_uart3.h | 60 - .../include/samv7/instance/instance_uart4.h | 60 - .../include/samv7/instance/instance_usart0.h | 94 - .../include/samv7/instance/instance_usart1.h | 94 - .../include/samv7/instance/instance_usart2.h | 94 - .../include/samv7/instance/instance_usbhs.h | 240 - .../include/samv7/instance/instance_utmi.h | 42 - .../include/samv7/instance/instance_wdt.h | 44 - .../include/samv7/instance/instance_xdmac.h | 744 -- .../include/samv7/pio/pio_samv71j19.h | 438 - .../include/samv7/pio/pio_samv71j20.h | 442 - .../include/samv7/pio/pio_samv71j21.h | 442 - .../include/samv7/pio/pio_samv71n19.h | 499 -- .../include/samv7/pio/pio_samv71n20.h | 495 -- .../include/samv7/pio/pio_samv71n21.h | 495 -- .../include/samv7/pio/pio_samv71q19.h | 672 -- .../include/samv7/pio/pio_samv71q20.h | 672 -- .../include/samv7/pio/pio_samv71q21.h | 672 -- .../libchip_samv7/include/samv7/samv71.h | 55 - .../libchip_samv7/include/samv7/samv71j19.h | 633 -- .../libchip_samv7/include/samv7/samv71j20.h | 640 -- .../libchip_samv7/include/samv7/samv71j21.h | 639 -- .../libchip_samv7/include/samv7/samv71n19.h | 646 -- .../libchip_samv7/include/samv7/samv71n20.h | 639 -- .../libchip_samv7/include/samv7/samv71n21.h | 639 -- .../libchip_samv7/include/samv7/samv71q19.h | 694 -- .../libchip_samv7/include/samv7/samv71q20.h | 693 -- .../libchip_samv7/include/samv7/samv71q21.h | 694 -- .../include/samv7/system_samv71.h | 73 - .../libraries/libchip_samv7/include/sdramc.h | 70 - .../libraries/libchip_samv7/include/smc.h | 174 - .../libraries/libchip_samv7/include/spi.h | 114 - .../libraries/libchip_samv7/include/spi_dma.h | 148 - .../libraries/libchip_samv7/include/ssc.h | 72 - .../libraries/libchip_samv7/include/supc.h | 75 - .../libraries/libchip_samv7/include/tc.h | 77 - .../libchip_samv7/include/timetick.h | 103 - .../libraries/libchip_samv7/include/trace.h | 230 - .../libraries/libchip_samv7/include/trng.h | 50 - .../libraries/libchip_samv7/include/twi.h | 114 - .../libraries/libchip_samv7/include/twid.h | 142 - .../libraries/libchip_samv7/include/uart.h | 69 - .../libchip_samv7/include/uart_dma.h | 139 - .../libraries/libchip_samv7/include/usart.h | 164 - .../libchip_samv7/include/usart_dma.h | 139 - .../libraries/libchip_samv7/include/usbhs.h | 1687 ---- .../libraries/libchip_samv7/include/video.h | 80 - .../libraries/libchip_samv7/include/wdt.h | 74 - .../include/xdma_hardware_interface.h | 58 - .../libraries/libchip_samv7/include/xdmac.h | 177 - .../libraries/libchip_samv7/include/xdmad.h | 260 - .../iar/example_build/libraries/libraries.a | Bin 2478926 -> 0 bytes .../example_build/libraries/utils/md5/md5.h | 91 - .../example_build/libraries/utils/utility.h | 111 - ports_module/cortex_m7/iar/inc/tx_port.h | 13 +- .../module_manager/src/tx_thread_schedule.s | 74 +- .../ac6/src/tx_thread_context_restore.S | 82 +- .../ac6/src/tx_thread_smp_protect.S | 311 +- .../ac6/src/tx_thread_smp_unprotect.S | 16 +- .../gnu/src/tx_thread_context_restore.S | 82 +- .../gnu/src/tx_thread_smp_protect.S | 311 +- .../gnu/src/tx_thread_smp_unprotect.S | 16 +- .../ac6/example_build/tx/.cproject | 2 +- .../ac6/src/tx_thread_context_restore.S | 82 +- .../ac6/src/tx_thread_smp_protect.S | 311 +- .../ac6/src/tx_thread_smp_unprotect.S | 14 +- .../gnu/src/tx_thread_context_restore.S | 82 +- .../gnu/src/tx_thread_smp_protect.S | 311 +- .../gnu/src/tx_thread_smp_unprotect.S | 14 +- .../example_build/sample_threadx/.cproject | 6 +- .../ac6/example_build/tx/.cproject | 8 +- .../ac6/src/tx_thread_context_restore.S | 82 +- .../ac6/src/tx_thread_smp_protect.S | 311 +- .../ac6/src/tx_thread_smp_unprotect.S | 14 +- .../gnu/example_build/tx/.cproject | 6 + .../gnu/src/tx_thread_context_restore.S | 82 +- .../gnu/src/tx_thread_smp_protect.S | 311 +- .../gnu/src/tx_thread_smp_unprotect.S | 14 +- .../example_build/sample_threadx/.cproject | 6 +- .../ac6/example_build/tx/.cproject | 8 +- .../ac6/src/tx_thread_context_restore.S | 82 +- .../ac6/src/tx_thread_smp_protect.S | 311 +- .../ac6/src/tx_thread_smp_unprotect.S | 14 +- .../gnu/example_build/tx/.cproject | 6 + .../gnu/src/tx_thread_context_restore.S | 82 +- .../gnu/src/tx_thread_smp_protect.S | 311 +- .../gnu/src/tx_thread_smp_unprotect.S | 14 +- .../example_build/sample_threadx/.cproject | 6 +- .../ac6/example_build/tx/.cproject | 8 +- .../ac6/src/tx_thread_context_restore.S | 82 +- .../ac6/src/tx_thread_smp_protect.S | 311 +- .../ac6/src/tx_thread_smp_unprotect.S | 14 +- .../gnu/example_build/tx/.cproject | 6 + .../gnu/src/tx_thread_context_restore.S | 82 +- .../gnu/src/tx_thread_smp_protect.S | 311 +- .../gnu/src/tx_thread_smp_unprotect.S | 14 +- .../ac6/src/tx_thread_context_restore.S | 86 +- .../ac6/src/tx_thread_smp_protect.S | 313 +- .../ac6/src/tx_thread_smp_unprotect.S | 18 +- .../gnu/src/tx_thread_context_restore.S | 86 +- .../gnu/src/tx_thread_smp_protect.S | 313 +- .../gnu/src/tx_thread_smp_unprotect.S | 16 +- .../iar/src/tx_thread_context_restore.S | 134 +- .../iar/src/tx_thread_smp_protect.S | 305 +- .../iar/src/tx_thread_smp_unprotect.S | 23 +- .../ac6/example_build/tx/.cproject | 6 +- .../ac6/src/tx_thread_context_restore.S | 82 +- .../ac6/src/tx_thread_smp_protect.S | 311 +- .../ac6/src/tx_thread_smp_unprotect.S | 14 +- .../gnu/example_build/tx/.cproject | 6 + .../gnu/src/tx_thread_context_restore.S | 82 +- .../gnu/src/tx_thread_smp_protect.S | 311 +- .../gnu/src/tx_thread_smp_unprotect.S | 14 +- .../ac6/example_build/tx/.cproject | 6 +- .../ac6/src/tx_thread_context_restore.S | 82 +- .../ac6/src/tx_thread_smp_protect.S | 311 +- .../ac6/src/tx_thread_smp_unprotect.S | 14 +- .../gnu/example_build/tx/.cproject | 6 + .../gnu/src/tx_thread_context_restore.S | 82 +- .../gnu/src/tx_thread_smp_protect.S | 311 +- .../gnu/src/tx_thread_smp_unprotect.S | 14 +- .../example_build/sample_threadx/.cproject | 6 +- .../ac6/example_build/tx/.cproject | 8 +- .../ac6/src/tx_thread_context_restore.S | 82 +- .../ac6/src/tx_thread_smp_protect.S | 311 +- .../ac6/src/tx_thread_smp_unprotect.S | 14 +- .../gnu/example_build/tx/.cproject | 6 + .../gnu/src/tx_thread_context_restore.S | 82 +- .../gnu/src/tx_thread_smp_protect.S | 311 +- .../gnu/src/tx_thread_smp_unprotect.S | 14 +- .../example_build/sample_threadx/.cproject | 6 +- .../ac6/example_build/tx/.cproject | 8 +- .../ac6/src/tx_thread_context_restore.S | 82 +- .../ac6/src/tx_thread_smp_protect.S | 311 +- .../ac6/src/tx_thread_smp_unprotect.S | 14 +- .../gnu/example_build/tx/.cproject | 6 + .../gnu/src/tx_thread_context_restore.S | 82 +- .../gnu/src/tx_thread_smp_protect.S | 311 +- .../gnu/src/tx_thread_smp_unprotect.S | 14 +- .../example_build/sample_threadx/.cproject | 6 +- .../ac6/example_build/tx/.cproject | 8 +- .../ac6/src/tx_thread_context_restore.S | 82 +- .../ac6/src/tx_thread_smp_protect.S | 311 +- .../ac6/src/tx_thread_smp_unprotect.S | 14 +- .../gnu/example_build/tx/.cproject | 6 + .../gnu/src/tx_thread_context_restore.S | 82 +- .../gnu/src/tx_thread_smp_protect.S | 311 +- .../gnu/src/tx_thread_smp_unprotect.S | 14 +- .../example_build/sample_threadx/.cproject | 6 +- .../ac6/example_build/tx/.cproject | 8 +- .../ac6/src/tx_thread_context_restore.S | 82 +- .../ac6/src/tx_thread_smp_protect.S | 311 +- .../ac6/src/tx_thread_smp_unprotect.S | 14 +- .../gnu/example_build/tx/.cproject | 6 + .../gnu/src/tx_thread_context_restore.S | 82 +- .../gnu/src/tx_thread_smp_protect.S | 311 +- .../gnu/src/tx_thread_smp_unprotect.S | 14 +- .../example_build/sample_threadx/.cproject | 6 +- .../ac6/example_build/tx/.cproject | 8 +- .../ac6/src/tx_thread_context_restore.S | 82 +- .../ac6/src/tx_thread_smp_protect.S | 311 +- .../ac6/src/tx_thread_smp_unprotect.S | 14 +- .../gnu/example_build/tx/.cproject | 6 + .../gnu/src/tx_thread_context_restore.S | 82 +- .../gnu/src/tx_thread_smp_protect.S | 311 +- .../gnu/src/tx_thread_smp_unprotect.S | 14 +- .../example_build/sample_threadx/.cproject | 6 +- .../ac6/example_build/tx/.cproject | 8 +- .../ac6/src/tx_thread_context_restore.S | 82 +- .../ac6/src/tx_thread_smp_protect.S | 311 +- .../ac6/src/tx_thread_smp_unprotect.S | 14 +- .../gnu/example_build/tx/.cproject | 6 + .../gnu/src/tx_thread_context_restore.S | 82 +- .../gnu/src/tx_thread_smp_protect.S | 311 +- .../gnu/src/tx_thread_smp_unprotect.S | 14 +- .../tx_execution_profile.c | 127 +- .../tx_execution_profile.h | 5 +- 784 files changed, 57616 insertions(+), 101103 deletions(-) create mode 100644 ports/cortex_a12/ac6/example_build/sample_threadx.c create mode 100644 ports/cortex_a12/ac6/example_build/sample_threadx/.cproject create mode 100644 ports/cortex_a12/ac6/example_build/sample_threadx/.project create mode 100644 ports/cortex_a12/ac6/example_build/sample_threadx/sample_threadx.c create mode 100644 ports/cortex_a12/ac6/example_build/sample_threadx/sample_threadx.launch create mode 100644 ports/cortex_a12/ac6/example_build/sample_threadx/sample_threadx.scat create mode 100644 ports/cortex_a12/ac6/example_build/sample_threadx/startup.S create mode 100644 ports/cortex_a12/ac6/example_build/sample_threadx/tx_initialize_low_level.S create mode 100644 ports/cortex_a12/ac6/example_build/tx/.cproject create mode 100644 ports/cortex_a12/ac6/example_build/tx/.project create mode 100644 ports/cortex_a12/ac6/inc/tx_port.h create mode 100644 ports/cortex_a12/ac6/src/tx_thread_context_restore.S create mode 100644 ports/cortex_a12/ac6/src/tx_thread_context_save.S create mode 100644 ports/cortex_a12/ac6/src/tx_thread_fiq_context_restore.S create mode 100644 ports/cortex_a12/ac6/src/tx_thread_fiq_context_save.S create mode 100644 ports/cortex_a12/ac6/src/tx_thread_fiq_nesting_end.S create mode 100644 ports/cortex_a12/ac6/src/tx_thread_fiq_nesting_start.S create mode 100644 ports/cortex_a12/ac6/src/tx_thread_interrupt_control.S create mode 100644 ports/cortex_a12/ac6/src/tx_thread_interrupt_disable.S create mode 100644 ports/cortex_a12/ac6/src/tx_thread_interrupt_restore.S create mode 100644 ports/cortex_a12/ac6/src/tx_thread_irq_nesting_end.S create mode 100644 ports/cortex_a12/ac6/src/tx_thread_irq_nesting_start.S create mode 100644 ports/cortex_a12/ac6/src/tx_thread_schedule.S create mode 100644 ports/cortex_a12/ac6/src/tx_thread_stack_build.S create mode 100644 ports/cortex_a12/ac6/src/tx_thread_system_return.S create mode 100644 ports/cortex_a12/ac6/src/tx_thread_vectored_context_save.S create mode 100644 ports/cortex_a12/ac6/src/tx_timer_interrupt.S create mode 100644 ports/cortex_a12/gnu/example_build/build_threadx.bat create mode 100644 ports/cortex_a12/gnu/example_build/build_threadx_sample.bat create mode 100644 ports/cortex_a12/gnu/example_build/crt0.S create mode 100644 ports/cortex_a12/gnu/example_build/reset.S create mode 100644 ports/cortex_a12/gnu/example_build/sample_threadx.c create mode 100644 ports/cortex_a12/gnu/example_build/sample_threadx.ld create mode 100644 ports/cortex_a12/gnu/example_build/tx_initialize_low_level.S create mode 100644 ports/cortex_a12/gnu/inc/tx_port.h create mode 100644 ports/cortex_a12/gnu/src/tx_thread_context_restore.S create mode 100644 ports/cortex_a12/gnu/src/tx_thread_context_save.S create mode 100644 ports/cortex_a12/gnu/src/tx_thread_fiq_context_restore.S create mode 100644 ports/cortex_a12/gnu/src/tx_thread_fiq_context_save.S create mode 100644 ports/cortex_a12/gnu/src/tx_thread_fiq_nesting_end.S create mode 100644 ports/cortex_a12/gnu/src/tx_thread_fiq_nesting_start.S create mode 100644 ports/cortex_a12/gnu/src/tx_thread_interrupt_control.S create mode 100644 ports/cortex_a12/gnu/src/tx_thread_interrupt_disable.S create mode 100644 ports/cortex_a12/gnu/src/tx_thread_interrupt_restore.S create mode 100644 ports/cortex_a12/gnu/src/tx_thread_irq_nesting_end.S create mode 100644 ports/cortex_a12/gnu/src/tx_thread_irq_nesting_start.S create mode 100644 ports/cortex_a12/gnu/src/tx_thread_schedule.S create mode 100644 ports/cortex_a12/gnu/src/tx_thread_stack_build.S create mode 100644 ports/cortex_a12/gnu/src/tx_thread_system_return.S create mode 100644 ports/cortex_a12/gnu/src/tx_thread_vectored_context_save.S create mode 100644 ports/cortex_a12/gnu/src/tx_timer_interrupt.S create mode 100644 ports/cortex_a15/ac6/example_build/sample_threadx.c create mode 100644 ports/cortex_a15/ac6/example_build/sample_threadx/sample_threadx.launch create mode 100644 ports/cortex_a17/ac6/example_build/sample_threadx.c create mode 100644 ports/cortex_a17/ac6/example_build/sample_threadx/.cproject create mode 100644 ports/cortex_a17/ac6/example_build/sample_threadx/.project create mode 100644 ports/cortex_a17/ac6/example_build/sample_threadx/sample_threadx.c create mode 100644 ports/cortex_a17/ac6/example_build/sample_threadx/sample_threadx.launch create mode 100644 ports/cortex_a17/ac6/example_build/sample_threadx/sample_threadx.scat create mode 100644 ports/cortex_a17/ac6/example_build/sample_threadx/startup.S create mode 100644 ports/cortex_a17/ac6/example_build/sample_threadx/tx_initialize_low_level.S create mode 100644 ports/cortex_a17/ac6/example_build/tx/.cproject create mode 100644 ports/cortex_a17/ac6/example_build/tx/.project create mode 100644 ports/cortex_a17/ac6/inc/tx_port.h create mode 100644 ports/cortex_a17/ac6/src/tx_thread_context_restore.S create mode 100644 ports/cortex_a17/ac6/src/tx_thread_context_save.S create mode 100644 ports/cortex_a17/ac6/src/tx_thread_fiq_context_restore.S create mode 100644 ports/cortex_a17/ac6/src/tx_thread_fiq_context_save.S create mode 100644 ports/cortex_a17/ac6/src/tx_thread_fiq_nesting_end.S create mode 100644 ports/cortex_a17/ac6/src/tx_thread_fiq_nesting_start.S create mode 100644 ports/cortex_a17/ac6/src/tx_thread_interrupt_control.S create mode 100644 ports/cortex_a17/ac6/src/tx_thread_interrupt_disable.S create mode 100644 ports/cortex_a17/ac6/src/tx_thread_interrupt_restore.S create mode 100644 ports/cortex_a17/ac6/src/tx_thread_irq_nesting_end.S create mode 100644 ports/cortex_a17/ac6/src/tx_thread_irq_nesting_start.S create mode 100644 ports/cortex_a17/ac6/src/tx_thread_schedule.S create mode 100644 ports/cortex_a17/ac6/src/tx_thread_stack_build.S create mode 100644 ports/cortex_a17/ac6/src/tx_thread_system_return.S create mode 100644 ports/cortex_a17/ac6/src/tx_thread_vectored_context_save.S create mode 100644 ports/cortex_a17/ac6/src/tx_timer_interrupt.S create mode 100644 ports/cortex_a17/gnu/example_build/build_threadx.bat create mode 100644 ports/cortex_a17/gnu/example_build/build_threadx_sample.bat create mode 100644 ports/cortex_a17/gnu/example_build/crt0.S create mode 100644 ports/cortex_a17/gnu/example_build/reset.S create mode 100644 ports/cortex_a17/gnu/example_build/sample_threadx.c create mode 100644 ports/cortex_a17/gnu/example_build/sample_threadx.ld create mode 100644 ports/cortex_a17/gnu/example_build/tx_initialize_low_level.S create mode 100644 ports/cortex_a17/gnu/inc/tx_port.h create mode 100644 ports/cortex_a17/gnu/src/tx_thread_context_restore.S create mode 100644 ports/cortex_a17/gnu/src/tx_thread_context_save.S create mode 100644 ports/cortex_a17/gnu/src/tx_thread_fiq_context_restore.S create mode 100644 ports/cortex_a17/gnu/src/tx_thread_fiq_context_save.S create mode 100644 ports/cortex_a17/gnu/src/tx_thread_fiq_nesting_end.S create mode 100644 ports/cortex_a17/gnu/src/tx_thread_fiq_nesting_start.S create mode 100644 ports/cortex_a17/gnu/src/tx_thread_interrupt_control.S create mode 100644 ports/cortex_a17/gnu/src/tx_thread_interrupt_disable.S create mode 100644 ports/cortex_a17/gnu/src/tx_thread_interrupt_restore.S create mode 100644 ports/cortex_a17/gnu/src/tx_thread_irq_nesting_end.S create mode 100644 ports/cortex_a17/gnu/src/tx_thread_irq_nesting_start.S create mode 100644 ports/cortex_a17/gnu/src/tx_thread_schedule.S create mode 100644 ports/cortex_a17/gnu/src/tx_thread_stack_build.S create mode 100644 ports/cortex_a17/gnu/src/tx_thread_system_return.S create mode 100644 ports/cortex_a17/gnu/src/tx_thread_vectored_context_save.S create mode 100644 ports/cortex_a17/gnu/src/tx_timer_interrupt.S create mode 100644 ports/cortex_a5/ac6/example_build/sample_threadx.c create mode 100644 ports/cortex_a5/ac6/example_build/sample_threadx/.cproject create mode 100644 ports/cortex_a5/ac6/example_build/sample_threadx/.project create mode 100644 ports/cortex_a5/ac6/example_build/sample_threadx/sample_threadx.c create mode 100644 ports/cortex_a5/ac6/example_build/sample_threadx/sample_threadx.launch create mode 100644 ports/cortex_a5/ac6/example_build/sample_threadx/sample_threadx.scat create mode 100644 ports/cortex_a5/ac6/example_build/sample_threadx/startup.S create mode 100644 ports/cortex_a5/ac6/example_build/sample_threadx/tx_initialize_low_level.S create mode 100644 ports/cortex_a5/ac6/example_build/tx/.cproject create mode 100644 ports/cortex_a5/ac6/example_build/tx/.project create mode 100644 ports/cortex_a5/ac6/inc/tx_port.h create mode 100644 ports/cortex_a5/ac6/src/tx_thread_context_restore.S create mode 100644 ports/cortex_a5/ac6/src/tx_thread_context_save.S create mode 100644 ports/cortex_a5/ac6/src/tx_thread_fiq_context_restore.S create mode 100644 ports/cortex_a5/ac6/src/tx_thread_fiq_context_save.S create mode 100644 ports/cortex_a5/ac6/src/tx_thread_fiq_nesting_end.S create mode 100644 ports/cortex_a5/ac6/src/tx_thread_fiq_nesting_start.S create mode 100644 ports/cortex_a5/ac6/src/tx_thread_interrupt_control.S create mode 100644 ports/cortex_a5/ac6/src/tx_thread_interrupt_disable.S create mode 100644 ports/cortex_a5/ac6/src/tx_thread_interrupt_restore.S create mode 100644 ports/cortex_a5/ac6/src/tx_thread_irq_nesting_end.S create mode 100644 ports/cortex_a5/ac6/src/tx_thread_irq_nesting_start.S create mode 100644 ports/cortex_a5/ac6/src/tx_thread_schedule.S create mode 100644 ports/cortex_a5/ac6/src/tx_thread_stack_build.S create mode 100644 ports/cortex_a5/ac6/src/tx_thread_system_return.S create mode 100644 ports/cortex_a5/ac6/src/tx_thread_vectored_context_save.S create mode 100644 ports/cortex_a5/ac6/src/tx_timer_interrupt.S create mode 100644 ports/cortex_a7/ac6/example_build/sample_threadx.c create mode 100644 ports/cortex_a7/ac6/example_build/sample_threadx/sample_threadx.launch create mode 100644 ports/cortex_a8/ac6/example_build/sample_threadx.c create mode 100644 ports/cortex_a8/ac6/example_build/sample_threadx/sample_threadx.launch create mode 100644 ports/cortex_a9/ac6/example_build/sample_threadx.c create mode 100644 ports/cortex_a9/ac6/example_build/sample_threadx/sample_threadx.launch create mode 100644 ports/cortex_m3/ac6/src/tx_misra.S create mode 100644 ports/cortex_m3/gnu/src/tx_misra.S create mode 100644 ports/cortex_m4/ac6/src/tx_misra.S create mode 100644 ports/cortex_m4/gnu/src/tx_misra.S create mode 100644 ports/cortex_m7/ac6/src/tx_misra.S create mode 100644 ports/cortex_m7/gnu/src/tx_misra.S delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/board.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/bmp.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/board_lowlevel.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/board_memories.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/cs2100.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/dbg_console.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/frame_buffer.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/gmacb_phy.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/gmii.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/ili9488.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/ili9488_dma.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/ili9488_ebi.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/ili9488_ebi_dma.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/ili9488_reg.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/ili9488_spi.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/ili9488_spi_dma.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/image_sensor_inf.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/lcd_color.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/lcd_draw.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/lcd_font.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/lcd_font10x14.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/lcd_gimp_image.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/lcdd.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/led.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/math.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/mcan_config.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/rtc_calib.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/s25fl1.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/syscalls.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/wm8904.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/chip.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/compiler.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/acc.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/adc.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/aes.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/afe_dma.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/afec.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/arm_common_tables.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/arm_const_structs.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/arm_math.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/core_cm0.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/core_cm0plus.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/core_cm3.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/core_cm4.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/core_cm7.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/core_cmFunc.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/core_cmInstr.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/core_cmSimd.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/core_sc000.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/core_sc300.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/dac_dma.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/efc.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/exceptions.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/flashd.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/gmac.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/gmacd.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/hsmci.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/icm.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/isi.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/iso7816_4.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/mcan.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/mcid.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/mediaLB.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/mpu.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/pio.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/pio_capture.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/pio_it.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/pmc.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/pwmc.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/qspi.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/qspi_dma.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/rstc.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/rtc.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/rtt.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_acc.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_aes.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_afec.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_chipid.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_dacc.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_efc.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_gmac.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_gpbr.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_hsmci.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_icm.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_isi.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_matrix.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_mcan.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_mlb.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_pio.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_pmc.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_pwm.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_qspi.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_rstc.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_rswdt.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_rtc.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_rtt.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_sdramc.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_smc.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_spi.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_ssc.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_supc.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_tc.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_trng.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_twi.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_twihs.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_uart.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_uotghs.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_usart.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_usbhs.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_utmi.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_wdt.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_xdmac.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_acc.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_aes.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_afec0.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_afec1.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_chipid.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_dacc.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_efc.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_gmac.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_gpbr.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_hsmci.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_icm.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_isi.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_matrix.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_mcan0.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_mcan1.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_mlb.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_pioa.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_piob.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_pioc.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_piod.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_pioe.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_pmc.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_pwm0.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_pwm1.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_qspi.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_rstc.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_rswdt.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_rtc.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_rtt.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_sdramc.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_smc.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_spi0.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_spi1.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_ssc.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_supc.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_tc0.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_tc1.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_tc2.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_tc3.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_trng.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_twihs0.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_twihs1.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_twihs2.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_uart0.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_uart1.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_uart2.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_uart3.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_uart4.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_usart0.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_usart1.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_usart2.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_usbhs.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_utmi.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_wdt.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_xdmac.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/pio/pio_samv71j19.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/pio/pio_samv71j20.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/pio/pio_samv71j21.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/pio/pio_samv71n19.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/pio/pio_samv71n20.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/pio/pio_samv71n21.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/pio/pio_samv71q19.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/pio/pio_samv71q20.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/pio/pio_samv71q21.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/samv71.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/samv71j19.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/samv71j20.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/samv71j21.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/samv71n19.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/samv71n20.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/samv71n21.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/samv71q19.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/samv71q20.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/samv71q21.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/system_samv71.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/sdramc.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/smc.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/spi.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/spi_dma.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/ssc.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/supc.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/tc.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/timetick.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/trace.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/trng.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/twi.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/twid.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/uart.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/uart_dma.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/usart.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/usart_dma.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/usbhs.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/video.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/wdt.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/xdma_hardware_interface.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/xdmac.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/xdmad.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/libraries.a delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/utils/md5/md5.h delete mode 100644 ports_module/cortex_m7/iar/example_build/libraries/utils/utility.h diff --git a/common/inc/tx_api.h b/common/inc/tx_api.h index 40ef7ef5..af384662 100644 --- a/common/inc/tx_api.h +++ b/common/inc/tx_api.h @@ -26,7 +26,7 @@ /* APPLICATION INTERFACE DEFINITION RELEASE */ /* */ /* tx_api.h PORTABLE C */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -82,6 +82,10 @@ /* add unused parameter macro, */ /* update patch number, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 Wenhui Xie Modified comment(s), */ +/* optimized the definition of */ +/* TX_TIMER_TICKS_PER_SECOND, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -118,7 +122,7 @@ extern "C" { #define AZURE_RTOS_THREADX #define THREADX_MAJOR_VERSION 6 #define THREADX_MINOR_VERSION 1 -#define THREADX_PATCH_VERSION 10 +#define THREADX_PATCH_VERSION 11 /* Define the following symbol for backward compatibility */ #define EL_PRODUCT_THREADX @@ -221,7 +225,7 @@ extern "C" { as a compilation option. */ #ifndef TX_TIMER_TICKS_PER_SECOND -#define TX_TIMER_TICKS_PER_SECOND ((ULONG) 100) +#define TX_TIMER_TICKS_PER_SECOND (100UL) #endif diff --git a/common/inc/tx_user_sample.h b/common/inc/tx_user_sample.h index e22babf4..d04d2dcb 100644 --- a/common/inc/tx_user_sample.h +++ b/common/inc/tx_user_sample.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_user.h PORTABLE C */ -/* 6.1.9 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -58,6 +58,10 @@ /* user-configurable symbol */ /* TX_TIMER_TICKS_PER_SECOND */ /* resulting in version 6.1.9 */ +/* 04-25-2022 Wenhui Xie Modified comment(s), */ +/* optimized the definition of */ +/* TX_TIMER_TICKS_PER_SECOND, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -116,7 +120,7 @@ Note: the actual hardware timer value may need to be changed (usually in tx_initialize_low_level). */ /* -#define TX_TIMER_TICKS_PER_SECOND ((ULONG) 100) +#define TX_TIMER_TICKS_PER_SECOND (100UL) */ /* Determine if there is a FileX pointer in the thread control block. diff --git a/common/src/tx_event_flags_get.c b/common/src/tx_event_flags_get.c index 1e79a4cd..aba42c6b 100644 --- a/common/src/tx_event_flags_get.c +++ b/common/src/tx_event_flags_get.c @@ -36,7 +36,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_event_flags_get PORTABLE C */ -/* 6.1 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -73,9 +73,12 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 05-19-2020 William E. Lamie Initial Version 6.0 */ -/* 09-30-2020 Yuxin Zhou Modified comment(s), */ +/* 05-19-2020 William E. Lamie Initial Version 6.0 */ +/* 09-30-2020 Yuxin Zhou Modified comment(s), */ /* resulting in version 6.1 */ +/* 04-25-2022 Scott Larson Modified comment(s), */ +/* handle 0 flags case, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ UINT _tx_event_flags_get(TX_EVENT_FLAGS_GROUP *group_ptr, ULONG requested_flags, @@ -276,11 +279,12 @@ UINT interrupted_set_request; if (wait_option != TX_NO_WAIT) { - /* Determine if the preempt disable flag is non-zero. */ - if (_tx_thread_preempt_disable != ((UINT) 0)) + /* Determine if the preempt disable flag is non-zero OR the requested events is 0. */ + if ((_tx_thread_preempt_disable != ((UINT) 0)) || (requested_flags == (UINT) 0)) { - /* Suspension is not allowed if the preempt disable flag is non-zero at this point, return error completion. */ + /* Suspension is not allowed if the preempt disable flag is non-zero at this point, + or if requested_flags is 0, return error completion. */ status = TX_NO_EVENTS; } else diff --git a/common/src/tx_event_flags_set.c b/common/src/tx_event_flags_set.c index 9228f4cd..da0ff553 100644 --- a/common/src/tx_event_flags_set.c +++ b/common/src/tx_event_flags_set.c @@ -36,7 +36,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_event_flags_set PORTABLE C */ -/* 6.1 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -72,9 +72,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 05-19-2020 William E. Lamie Initial Version 6.0 */ -/* 09-30-2020 Yuxin Zhou Modified comment(s), */ +/* 05-19-2020 William E. Lamie Initial Version 6.0 */ +/* 09-30-2020 Yuxin Zhou Modified comment(s), */ /* resulting in version 6.1 */ +/* 04-25-2022 William E. Lamie Modified comment(s), and */ +/* added corrected preemption */ +/* check logic, resulting in */ +/* version 6.1.11 */ /* */ /**************************************************************************/ UINT _tx_event_flags_set(TX_EVENT_FLAGS_GROUP *group_ptr, ULONG flags_to_set, UINT set_option) @@ -264,9 +268,6 @@ VOID (*events_set_notify)(struct TX_EVENT_FLAGS_GROUP_STRUCT *notify_ /* Yes, resume the thread and apply any event flag clearing. */ - /* Set the preempt check flag. */ - preempt_check = TX_TRUE; - /* Return the actual event flags that satisfied the request. */ suspend_info_ptr = TX_VOID_TO_ULONG_POINTER_CONVERT(thread_ptr -> tx_thread_additional_suspend_info); *suspend_info_ptr = current_event_flags; @@ -336,6 +337,11 @@ VOID (*events_set_notify)(struct TX_EVENT_FLAGS_GROUP_STRUCT *notify_ /* Disable preemption while we process the suspended list. */ _tx_thread_preempt_disable++; + /* Since we have temporarily disabled preemption globally, set the preempt + check flag to check for any preemption condition - including from + unrelated ISR processing. */ + preempt_check = TX_TRUE; + /* Loop to examine all of the suspended threads. */ do { @@ -419,9 +425,6 @@ VOID (*events_set_notify)(struct TX_EVENT_FLAGS_GROUP_STRUCT *notify_ /* Yes, this request can be handled now. */ - /* Set the preempt check flag. */ - preempt_check = TX_TRUE; - /* Determine if the thread is still suspended on the event flag group. If not, a wait abort must have been done from an ISR. */ if (thread_ptr -> tx_thread_state == TX_EVENT_FLAG) diff --git a/common/src/tx_initialize_kernel_enter.c b/common/src/tx_initialize_kernel_enter.c index c18cec37..12e77dc5 100644 --- a/common/src/tx_initialize_kernel_enter.c +++ b/common/src/tx_initialize_kernel_enter.c @@ -30,6 +30,9 @@ #include "tx_thread.h" #include "tx_timer.h" +#if defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE) +extern VOID _tx_execution_initialize(VOID); +#endif /* Define any port-specific scheduling data structures. */ @@ -46,7 +49,7 @@ TX_SAFETY_CRITICAL_EXCEPTION_HANDLER /* FUNCTION RELEASE */ /* */ /* _tx_initialize_kernel_enter PORTABLE C */ -/* 6.1 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -84,9 +87,12 @@ TX_SAFETY_CRITICAL_EXCEPTION_HANDLER /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 05-19-2020 William E. Lamie Initial Version 6.0 */ -/* 09-30-2020 Yuxin Zhou Modified comment(s), */ +/* 05-19-2020 William E. Lamie Initial Version 6.0 */ +/* 09-30-2020 Yuxin Zhou Modified comment(s), */ /* resulting in version 6.1 */ +/* 04-25-2022 Scott Larson Modified comment(s), */ +/* added EPK initialization, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ VOID _tx_initialize_kernel_enter(VOID) @@ -138,6 +144,11 @@ VOID _tx_initialize_kernel_enter(VOID) /* Call any port specific pre-scheduler processing. */ TX_PORT_SPECIFIC_PRE_SCHEDULER_INITIALIZATION +#if defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE) + /* Initialize Execution Profile Kit. */ + _tx_execution_initialize(); +#endif + /* Enter the scheduling loop to start executing threads! */ _tx_thread_schedule(); diff --git a/common_smp/inc/tx_api.h b/common_smp/inc/tx_api.h index 9591aee9..e17e0ff3 100644 --- a/common_smp/inc/tx_api.h +++ b/common_smp/inc/tx_api.h @@ -26,7 +26,7 @@ /* APPLICATION INTERFACE DEFINITION RELEASE */ /* */ /* tx_api.h PORTABLE SMP */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -71,6 +71,10 @@ /* add unused parameter macro, */ /* update patch number, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 Wenhui Xie Modified comment(s), */ +/* optimized the definition of */ +/* TX_TIMER_TICKS_PER_SECOND, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -123,7 +127,7 @@ extern "C" { #define AZURE_RTOS_THREADX #define THREADX_MAJOR_VERSION 6 #define THREADX_MINOR_VERSION 1 -#define THREADX_PATCH_VERSION 10 +#define THREADX_PATCH_VERSION 11 /* Define the following symbol for backward compatibility */ #define EL_PRODUCT_THREADX @@ -226,7 +230,7 @@ extern "C" { as a compilation option. */ #ifndef TX_TIMER_TICKS_PER_SECOND -#define TX_TIMER_TICKS_PER_SECOND ((ULONG) 100) +#define TX_TIMER_TICKS_PER_SECOND (100UL) #endif diff --git a/common_smp/inc/tx_user_sample.h b/common_smp/inc/tx_user_sample.h index e22babf4..d04d2dcb 100644 --- a/common_smp/inc/tx_user_sample.h +++ b/common_smp/inc/tx_user_sample.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_user.h PORTABLE C */ -/* 6.1.9 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -58,6 +58,10 @@ /* user-configurable symbol */ /* TX_TIMER_TICKS_PER_SECOND */ /* resulting in version 6.1.9 */ +/* 04-25-2022 Wenhui Xie Modified comment(s), */ +/* optimized the definition of */ +/* TX_TIMER_TICKS_PER_SECOND, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -116,7 +120,7 @@ Note: the actual hardware timer value may need to be changed (usually in tx_initialize_low_level). */ /* -#define TX_TIMER_TICKS_PER_SECOND ((ULONG) 100) +#define TX_TIMER_TICKS_PER_SECOND (100UL) */ /* Determine if there is a FileX pointer in the thread control block. diff --git a/common_smp/src/tx_event_flags_get.c b/common_smp/src/tx_event_flags_get.c index 1e79a4cd..aba42c6b 100644 --- a/common_smp/src/tx_event_flags_get.c +++ b/common_smp/src/tx_event_flags_get.c @@ -36,7 +36,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_event_flags_get PORTABLE C */ -/* 6.1 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -73,9 +73,12 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 05-19-2020 William E. Lamie Initial Version 6.0 */ -/* 09-30-2020 Yuxin Zhou Modified comment(s), */ +/* 05-19-2020 William E. Lamie Initial Version 6.0 */ +/* 09-30-2020 Yuxin Zhou Modified comment(s), */ /* resulting in version 6.1 */ +/* 04-25-2022 Scott Larson Modified comment(s), */ +/* handle 0 flags case, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ UINT _tx_event_flags_get(TX_EVENT_FLAGS_GROUP *group_ptr, ULONG requested_flags, @@ -276,11 +279,12 @@ UINT interrupted_set_request; if (wait_option != TX_NO_WAIT) { - /* Determine if the preempt disable flag is non-zero. */ - if (_tx_thread_preempt_disable != ((UINT) 0)) + /* Determine if the preempt disable flag is non-zero OR the requested events is 0. */ + if ((_tx_thread_preempt_disable != ((UINT) 0)) || (requested_flags == (UINT) 0)) { - /* Suspension is not allowed if the preempt disable flag is non-zero at this point, return error completion. */ + /* Suspension is not allowed if the preempt disable flag is non-zero at this point, + or if requested_flags is 0, return error completion. */ status = TX_NO_EVENTS; } else diff --git a/common_smp/src/tx_event_flags_set.c b/common_smp/src/tx_event_flags_set.c index 9228f4cd..da0ff553 100644 --- a/common_smp/src/tx_event_flags_set.c +++ b/common_smp/src/tx_event_flags_set.c @@ -36,7 +36,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_event_flags_set PORTABLE C */ -/* 6.1 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -72,9 +72,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 05-19-2020 William E. Lamie Initial Version 6.0 */ -/* 09-30-2020 Yuxin Zhou Modified comment(s), */ +/* 05-19-2020 William E. Lamie Initial Version 6.0 */ +/* 09-30-2020 Yuxin Zhou Modified comment(s), */ /* resulting in version 6.1 */ +/* 04-25-2022 William E. Lamie Modified comment(s), and */ +/* added corrected preemption */ +/* check logic, resulting in */ +/* version 6.1.11 */ /* */ /**************************************************************************/ UINT _tx_event_flags_set(TX_EVENT_FLAGS_GROUP *group_ptr, ULONG flags_to_set, UINT set_option) @@ -264,9 +268,6 @@ VOID (*events_set_notify)(struct TX_EVENT_FLAGS_GROUP_STRUCT *notify_ /* Yes, resume the thread and apply any event flag clearing. */ - /* Set the preempt check flag. */ - preempt_check = TX_TRUE; - /* Return the actual event flags that satisfied the request. */ suspend_info_ptr = TX_VOID_TO_ULONG_POINTER_CONVERT(thread_ptr -> tx_thread_additional_suspend_info); *suspend_info_ptr = current_event_flags; @@ -336,6 +337,11 @@ VOID (*events_set_notify)(struct TX_EVENT_FLAGS_GROUP_STRUCT *notify_ /* Disable preemption while we process the suspended list. */ _tx_thread_preempt_disable++; + /* Since we have temporarily disabled preemption globally, set the preempt + check flag to check for any preemption condition - including from + unrelated ISR processing. */ + preempt_check = TX_TRUE; + /* Loop to examine all of the suspended threads. */ do { @@ -419,9 +425,6 @@ VOID (*events_set_notify)(struct TX_EVENT_FLAGS_GROUP_STRUCT *notify_ /* Yes, this request can be handled now. */ - /* Set the preempt check flag. */ - preempt_check = TX_TRUE; - /* Determine if the thread is still suspended on the event flag group. If not, a wait abort must have been done from an ISR. */ if (thread_ptr -> tx_thread_state == TX_EVENT_FLAG) diff --git a/common_smp/src/tx_thread_system_suspend.c b/common_smp/src/tx_thread_system_suspend.c index 8838d98e..a76a00d4 100644 --- a/common_smp/src/tx_thread_system_suspend.c +++ b/common_smp/src/tx_thread_system_suspend.c @@ -38,7 +38,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_system_suspend PORTABLE SMP */ -/* 6.1 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -87,7 +87,10 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Scott Larson Modified comments and fixed */ +/* loop to find next thread, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ VOID _tx_thread_system_suspend(TX_THREAD *thread_ptr) @@ -667,9 +670,18 @@ UINT processing_complete; /* Calculate the possible complex path. */ complex_path_possible = possible_cores & available_cores; + /* Check if we need to loop to find the next highest priority thread. */ + if (next_priority == TX_MAX_PRIORITIES) + { + loop_finished = TX_TRUE; + } + else + { + loop_finished = TX_FALSE; + } + /* Loop to find the next highest priority ready thread that is allowed to run on this core. */ - loop_finished = TX_FALSE; - do + while (loop_finished == TX_FALSE) { /* Determine if there is a thread to examine. */ @@ -814,7 +826,7 @@ UINT processing_complete; } } } - } while (loop_finished == TX_FALSE); + } #ifdef TX_THREAD_SMP_INTER_CORE_INTERRUPT diff --git a/ports/c667x/ccs/inc/tx_port.h b/ports/c667x/ccs/inc/tx_port.h index 402304c6..0f56b180 100644 --- a/ports/c667x/ccs/inc/tx_port.h +++ b/ports/c667x/ccs/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h C667x/TI */ -/* 6.1.6 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -51,6 +51,10 @@ /* 04-02-2021 Bhupendra Naphade Modified comment(s),updated */ /* macro definition, */ /* resulting in version 6.1.6 */ +/* 04-25-2022 Wenhui Xie Modified comment(s), */ +/* optimized the definition of */ +/* TX_TIMER_TICKS_PER_SECOND, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -125,7 +129,7 @@ typedef unsigned short USHORT; #ifndef TX_TIMER_TICKS_PER_SECOND -#define TX_TIMER_TICKS_PER_SECOND ((ULONG) 100) +#define TX_TIMER_TICKS_PER_SECOND (100UL) #endif diff --git a/ports/cortex_a12/ac6/example_build/sample_threadx.c b/ports/cortex_a12/ac6/example_build/sample_threadx.c new file mode 100644 index 00000000..8c61de06 --- /dev/null +++ b/ports/cortex_a12/ac6/example_build/sample_threadx.c @@ -0,0 +1,369 @@ +/* This is a small demo of the high-performance ThreadX kernel. It includes examples of eight + threads of different priorities, using a message queue, semaphore, mutex, event flags group, + byte pool, and block pool. */ + +#include "tx_api.h" + +#define DEMO_STACK_SIZE 1024 +#define DEMO_BYTE_POOL_SIZE 9120 +#define DEMO_BLOCK_POOL_SIZE 100 +#define DEMO_QUEUE_SIZE 100 + + +/* Define the ThreadX object control blocks... */ + +TX_THREAD thread_0; +TX_THREAD thread_1; +TX_THREAD thread_2; +TX_THREAD thread_3; +TX_THREAD thread_4; +TX_THREAD thread_5; +TX_THREAD thread_6; +TX_THREAD thread_7; +TX_QUEUE queue_0; +TX_SEMAPHORE semaphore_0; +TX_MUTEX mutex_0; +TX_EVENT_FLAGS_GROUP event_flags_0; +TX_BYTE_POOL byte_pool_0; +TX_BLOCK_POOL block_pool_0; + + +/* Define the counters used in the demo application... */ + +ULONG thread_0_counter; +ULONG thread_1_counter; +ULONG thread_1_messages_sent; +ULONG thread_2_counter; +ULONG thread_2_messages_received; +ULONG thread_3_counter; +ULONG thread_4_counter; +ULONG thread_5_counter; +ULONG thread_6_counter; +ULONG thread_7_counter; + + +/* Define thread prototypes. */ + +void thread_0_entry(ULONG thread_input); +void thread_1_entry(ULONG thread_input); +void thread_2_entry(ULONG thread_input); +void thread_3_and_4_entry(ULONG thread_input); +void thread_5_entry(ULONG thread_input); +void thread_6_and_7_entry(ULONG thread_input); + + +/* Define main entry point. */ + +int main() +{ + + /* Enter the ThreadX kernel. */ + tx_kernel_enter(); +} + + +/* Define what the initial system looks like. */ + +void tx_application_define(void *first_unused_memory) +{ + +CHAR *pointer = TX_NULL; + + + /* Create a byte memory pool from which to allocate the thread stacks. */ + tx_byte_pool_create(&byte_pool_0, "byte pool 0", first_unused_memory, DEMO_BYTE_POOL_SIZE); + + /* Put system definition stuff in here, e.g. thread creates and other assorted + create information. */ + + /* Allocate the stack for thread 0. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 1, 1, TX_NO_TIME_SLICE, TX_AUTO_START); + + + /* Allocate the stack for thread 1. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create threads 1 and 2. These threads pass information through a ThreadX + message queue. It is also interesting to note that these threads have a time + slice. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, DEMO_STACK_SIZE, + 16, 16, 4, TX_AUTO_START); + + /* Allocate the stack for thread 2. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, DEMO_STACK_SIZE, + 16, 16, 4, TX_AUTO_START); + + /* Allocate the stack for thread 3. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create threads 3 and 4. These threads compete for a ThreadX counting semaphore. + An interesting thing here is that both threads share the same instruction area. */ + tx_thread_create(&thread_3, "thread 3", thread_3_and_4_entry, 3, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 4. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + tx_thread_create(&thread_4, "thread 4", thread_3_and_4_entry, 4, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 5. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create thread 5. This thread simply pends on an event flag which will be set + by thread_0. */ + tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 6. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create threads 6 and 7. These threads compete for a ThreadX mutex. */ + tx_thread_create(&thread_6, "thread 6", thread_6_and_7_entry, 6, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 7. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + tx_thread_create(&thread_7, "thread 7", thread_6_and_7_entry, 7, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the message queue. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_QUEUE_SIZE*sizeof(ULONG), TX_NO_WAIT); + + /* Create the message queue shared by threads 1 and 2. */ + tx_queue_create(&queue_0, "queue 0", TX_1_ULONG, pointer, DEMO_QUEUE_SIZE*sizeof(ULONG)); + + /* Create the semaphore used by threads 3 and 4. */ + tx_semaphore_create(&semaphore_0, "semaphore 0", 1); + + /* Create the event flags group used by threads 1 and 5. */ + tx_event_flags_create(&event_flags_0, "event flags 0"); + + /* Create the mutex used by thread 6 and 7 without priority inheritance. */ + tx_mutex_create(&mutex_0, "mutex 0", TX_NO_INHERIT); + + /* Allocate the memory for a small block pool. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_BLOCK_POOL_SIZE, TX_NO_WAIT); + + /* Create a block memory pool to allocate a message buffer from. */ + tx_block_pool_create(&block_pool_0, "block pool 0", sizeof(ULONG), pointer, DEMO_BLOCK_POOL_SIZE); + + /* Allocate a block and release the block memory. */ + tx_block_allocate(&block_pool_0, (VOID **) &pointer, TX_NO_WAIT); + + /* Release the block back to the pool. */ + tx_block_release(pointer); +} + + + +/* Define the test threads. */ + +void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + + /* This thread simply sits in while-forever-sleep loop. */ + while(1) + { + + /* Increment the thread counter. */ + thread_0_counter++; + + /* Sleep for 10 ticks. */ + tx_thread_sleep(10); + + /* Set event flag 0 to wakeup thread 5. */ + status = tx_event_flags_set(&event_flags_0, 0x1, TX_OR); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + } +} + + +void thread_1_entry(ULONG thread_input) +{ + +UINT status; + + + /* This thread simply sends messages to a queue shared by thread 2. */ + while(1) + { + + /* Increment the thread counter. */ + thread_1_counter++; + + /* Send message to queue 0. */ + status = tx_queue_send(&queue_0, &thread_1_messages_sent, TX_WAIT_FOREVER); + + /* Check completion status. */ + if (status != TX_SUCCESS) + break; + + /* Increment the message sent. */ + thread_1_messages_sent++; + } +} + + +void thread_2_entry(ULONG thread_input) +{ + +ULONG received_message; +UINT status; + + /* This thread retrieves messages placed on the queue by thread 1. */ + while(1) + { + + /* Increment the thread counter. */ + thread_2_counter++; + + /* Retrieve a message from the queue. */ + status = tx_queue_receive(&queue_0, &received_message, TX_WAIT_FOREVER); + + /* Check completion status and make sure the message is what we + expected. */ + if ((status != TX_SUCCESS) || (received_message != thread_2_messages_received)) + break; + + /* Otherwise, all is okay. Increment the received message count. */ + thread_2_messages_received++; + } +} + + +void thread_3_and_4_entry(ULONG thread_input) +{ + +UINT status; + + + /* This function is executed from thread 3 and thread 4. As the loop + below shows, these function compete for ownership of semaphore_0. */ + while(1) + { + + /* Increment the thread counter. */ + if (thread_input == 3) + thread_3_counter++; + else + thread_4_counter++; + + /* Get the semaphore with suspension. */ + status = tx_semaphore_get(&semaphore_0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Sleep for 2 ticks to hold the semaphore. */ + tx_thread_sleep(2); + + /* Release the semaphore. */ + status = tx_semaphore_put(&semaphore_0); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + } +} + + +void thread_5_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_flags; + + + /* This thread simply waits for an event in a forever loop. */ + while(1) + { + + /* Increment the thread counter. */ + thread_5_counter++; + + /* Wait for event flag 0. */ + status = tx_event_flags_get(&event_flags_0, 0x1, TX_OR_CLEAR, + &actual_flags, TX_WAIT_FOREVER); + + /* Check status. */ + if ((status != TX_SUCCESS) || (actual_flags != 0x1)) + break; + } +} + + +void thread_6_and_7_entry(ULONG thread_input) +{ + +UINT status; + + + /* This function is executed from thread 6 and thread 7. As the loop + below shows, these function compete for ownership of mutex_0. */ + while(1) + { + + /* Increment the thread counter. */ + if (thread_input == 6) + thread_6_counter++; + else + thread_7_counter++; + + /* Get the mutex with suspension. */ + status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Get the mutex again with suspension. This shows + that an owning thread may retrieve the mutex it + owns multiple times. */ + status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Sleep for 2 ticks to hold the mutex. */ + tx_thread_sleep(2); + + /* Release the mutex. */ + status = tx_mutex_put(&mutex_0); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Release the mutex again. This will actually + release ownership since it was obtained twice. */ + status = tx_mutex_put(&mutex_0); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + } +} diff --git a/ports/cortex_a12/ac6/example_build/sample_threadx/.cproject b/ports/cortex_a12/ac6/example_build/sample_threadx/.cproject new file mode 100644 index 00000000..e212b36d --- /dev/null +++ b/ports/cortex_a12/ac6/example_build/sample_threadx/.cproject @@ -0,0 +1,176 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ports/cortex_a12/ac6/example_build/sample_threadx/.project b/ports/cortex_a12/ac6/example_build/sample_threadx/.project new file mode 100644 index 00000000..ed4c0885 --- /dev/null +++ b/ports/cortex_a12/ac6/example_build/sample_threadx/.project @@ -0,0 +1,27 @@ + + + sample_threadx + + + tx + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + + diff --git a/ports/cortex_a12/ac6/example_build/sample_threadx/sample_threadx.c b/ports/cortex_a12/ac6/example_build/sample_threadx/sample_threadx.c new file mode 100644 index 00000000..8c61de06 --- /dev/null +++ b/ports/cortex_a12/ac6/example_build/sample_threadx/sample_threadx.c @@ -0,0 +1,369 @@ +/* This is a small demo of the high-performance ThreadX kernel. It includes examples of eight + threads of different priorities, using a message queue, semaphore, mutex, event flags group, + byte pool, and block pool. */ + +#include "tx_api.h" + +#define DEMO_STACK_SIZE 1024 +#define DEMO_BYTE_POOL_SIZE 9120 +#define DEMO_BLOCK_POOL_SIZE 100 +#define DEMO_QUEUE_SIZE 100 + + +/* Define the ThreadX object control blocks... */ + +TX_THREAD thread_0; +TX_THREAD thread_1; +TX_THREAD thread_2; +TX_THREAD thread_3; +TX_THREAD thread_4; +TX_THREAD thread_5; +TX_THREAD thread_6; +TX_THREAD thread_7; +TX_QUEUE queue_0; +TX_SEMAPHORE semaphore_0; +TX_MUTEX mutex_0; +TX_EVENT_FLAGS_GROUP event_flags_0; +TX_BYTE_POOL byte_pool_0; +TX_BLOCK_POOL block_pool_0; + + +/* Define the counters used in the demo application... */ + +ULONG thread_0_counter; +ULONG thread_1_counter; +ULONG thread_1_messages_sent; +ULONG thread_2_counter; +ULONG thread_2_messages_received; +ULONG thread_3_counter; +ULONG thread_4_counter; +ULONG thread_5_counter; +ULONG thread_6_counter; +ULONG thread_7_counter; + + +/* Define thread prototypes. */ + +void thread_0_entry(ULONG thread_input); +void thread_1_entry(ULONG thread_input); +void thread_2_entry(ULONG thread_input); +void thread_3_and_4_entry(ULONG thread_input); +void thread_5_entry(ULONG thread_input); +void thread_6_and_7_entry(ULONG thread_input); + + +/* Define main entry point. */ + +int main() +{ + + /* Enter the ThreadX kernel. */ + tx_kernel_enter(); +} + + +/* Define what the initial system looks like. */ + +void tx_application_define(void *first_unused_memory) +{ + +CHAR *pointer = TX_NULL; + + + /* Create a byte memory pool from which to allocate the thread stacks. */ + tx_byte_pool_create(&byte_pool_0, "byte pool 0", first_unused_memory, DEMO_BYTE_POOL_SIZE); + + /* Put system definition stuff in here, e.g. thread creates and other assorted + create information. */ + + /* Allocate the stack for thread 0. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 1, 1, TX_NO_TIME_SLICE, TX_AUTO_START); + + + /* Allocate the stack for thread 1. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create threads 1 and 2. These threads pass information through a ThreadX + message queue. It is also interesting to note that these threads have a time + slice. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, DEMO_STACK_SIZE, + 16, 16, 4, TX_AUTO_START); + + /* Allocate the stack for thread 2. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, DEMO_STACK_SIZE, + 16, 16, 4, TX_AUTO_START); + + /* Allocate the stack for thread 3. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create threads 3 and 4. These threads compete for a ThreadX counting semaphore. + An interesting thing here is that both threads share the same instruction area. */ + tx_thread_create(&thread_3, "thread 3", thread_3_and_4_entry, 3, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 4. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + tx_thread_create(&thread_4, "thread 4", thread_3_and_4_entry, 4, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 5. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create thread 5. This thread simply pends on an event flag which will be set + by thread_0. */ + tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 6. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create threads 6 and 7. These threads compete for a ThreadX mutex. */ + tx_thread_create(&thread_6, "thread 6", thread_6_and_7_entry, 6, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 7. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + tx_thread_create(&thread_7, "thread 7", thread_6_and_7_entry, 7, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the message queue. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_QUEUE_SIZE*sizeof(ULONG), TX_NO_WAIT); + + /* Create the message queue shared by threads 1 and 2. */ + tx_queue_create(&queue_0, "queue 0", TX_1_ULONG, pointer, DEMO_QUEUE_SIZE*sizeof(ULONG)); + + /* Create the semaphore used by threads 3 and 4. */ + tx_semaphore_create(&semaphore_0, "semaphore 0", 1); + + /* Create the event flags group used by threads 1 and 5. */ + tx_event_flags_create(&event_flags_0, "event flags 0"); + + /* Create the mutex used by thread 6 and 7 without priority inheritance. */ + tx_mutex_create(&mutex_0, "mutex 0", TX_NO_INHERIT); + + /* Allocate the memory for a small block pool. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_BLOCK_POOL_SIZE, TX_NO_WAIT); + + /* Create a block memory pool to allocate a message buffer from. */ + tx_block_pool_create(&block_pool_0, "block pool 0", sizeof(ULONG), pointer, DEMO_BLOCK_POOL_SIZE); + + /* Allocate a block and release the block memory. */ + tx_block_allocate(&block_pool_0, (VOID **) &pointer, TX_NO_WAIT); + + /* Release the block back to the pool. */ + tx_block_release(pointer); +} + + + +/* Define the test threads. */ + +void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + + /* This thread simply sits in while-forever-sleep loop. */ + while(1) + { + + /* Increment the thread counter. */ + thread_0_counter++; + + /* Sleep for 10 ticks. */ + tx_thread_sleep(10); + + /* Set event flag 0 to wakeup thread 5. */ + status = tx_event_flags_set(&event_flags_0, 0x1, TX_OR); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + } +} + + +void thread_1_entry(ULONG thread_input) +{ + +UINT status; + + + /* This thread simply sends messages to a queue shared by thread 2. */ + while(1) + { + + /* Increment the thread counter. */ + thread_1_counter++; + + /* Send message to queue 0. */ + status = tx_queue_send(&queue_0, &thread_1_messages_sent, TX_WAIT_FOREVER); + + /* Check completion status. */ + if (status != TX_SUCCESS) + break; + + /* Increment the message sent. */ + thread_1_messages_sent++; + } +} + + +void thread_2_entry(ULONG thread_input) +{ + +ULONG received_message; +UINT status; + + /* This thread retrieves messages placed on the queue by thread 1. */ + while(1) + { + + /* Increment the thread counter. */ + thread_2_counter++; + + /* Retrieve a message from the queue. */ + status = tx_queue_receive(&queue_0, &received_message, TX_WAIT_FOREVER); + + /* Check completion status and make sure the message is what we + expected. */ + if ((status != TX_SUCCESS) || (received_message != thread_2_messages_received)) + break; + + /* Otherwise, all is okay. Increment the received message count. */ + thread_2_messages_received++; + } +} + + +void thread_3_and_4_entry(ULONG thread_input) +{ + +UINT status; + + + /* This function is executed from thread 3 and thread 4. As the loop + below shows, these function compete for ownership of semaphore_0. */ + while(1) + { + + /* Increment the thread counter. */ + if (thread_input == 3) + thread_3_counter++; + else + thread_4_counter++; + + /* Get the semaphore with suspension. */ + status = tx_semaphore_get(&semaphore_0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Sleep for 2 ticks to hold the semaphore. */ + tx_thread_sleep(2); + + /* Release the semaphore. */ + status = tx_semaphore_put(&semaphore_0); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + } +} + + +void thread_5_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_flags; + + + /* This thread simply waits for an event in a forever loop. */ + while(1) + { + + /* Increment the thread counter. */ + thread_5_counter++; + + /* Wait for event flag 0. */ + status = tx_event_flags_get(&event_flags_0, 0x1, TX_OR_CLEAR, + &actual_flags, TX_WAIT_FOREVER); + + /* Check status. */ + if ((status != TX_SUCCESS) || (actual_flags != 0x1)) + break; + } +} + + +void thread_6_and_7_entry(ULONG thread_input) +{ + +UINT status; + + + /* This function is executed from thread 6 and thread 7. As the loop + below shows, these function compete for ownership of mutex_0. */ + while(1) + { + + /* Increment the thread counter. */ + if (thread_input == 6) + thread_6_counter++; + else + thread_7_counter++; + + /* Get the mutex with suspension. */ + status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Get the mutex again with suspension. This shows + that an owning thread may retrieve the mutex it + owns multiple times. */ + status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Sleep for 2 ticks to hold the mutex. */ + tx_thread_sleep(2); + + /* Release the mutex. */ + status = tx_mutex_put(&mutex_0); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Release the mutex again. This will actually + release ownership since it was obtained twice. */ + status = tx_mutex_put(&mutex_0); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + } +} diff --git a/ports/cortex_a12/ac6/example_build/sample_threadx/sample_threadx.launch b/ports/cortex_a12/ac6/example_build/sample_threadx/sample_threadx.launch new file mode 100644 index 00000000..1efaa3f2 --- /dev/null +++ b/ports/cortex_a12/ac6/example_build/sample_threadx/sample_threadx.launch @@ -0,0 +1,188 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ports/cortex_a12/ac6/example_build/sample_threadx/sample_threadx.scat b/ports/cortex_a12/ac6/example_build/sample_threadx/sample_threadx.scat new file mode 100644 index 00000000..d23881cd --- /dev/null +++ b/ports/cortex_a12/ac6/example_build/sample_threadx/sample_threadx.scat @@ -0,0 +1,44 @@ +;******************************************************* +; Copyright (c) 2011-2016 Arm Limited (or its affiliates). All rights reserved. +; Use, modification and redistribution of this file is subject to your possession of a +; valid End User License Agreement for the Arm Product of which these examples are part of +; and your compliance with all applicable terms and conditions of such licence agreement. +;******************************************************* + +; Scatter-file for ARMv7-A bare-metal example on Versatile Express + +; This scatter-file places application code, data, stack and heap at suitable addresses in the memory map. + + +SDRAM 0x80000000 0x20000000 +{ + VECTORS +0 + { + * (VECTORS, +FIRST) ; Vector table and other (assembler) startup code + * (InRoot$$Sections) ; All (library) code that must be in a root region + } + + RO_CODE +0 + { * (+RO-CODE) } ; Application RO code (.text) + + RO_DATA +0 + { * (+RO-DATA) } ; Application RO data (.constdata) + + RW_DATA +0 + { * (+RW) } ; Application RW data (.data) + + ZI_DATA +0 + { * (+ZI) } ; Application ZI data (.bss) + + ARM_LIB_HEAP 0x80040000 EMPTY 0x00040000 ; Application heap + { } + + ARM_LIB_STACK 0x80090000 EMPTY 0x00010000 ; Application (SVC mode) stack + { } + +; IRQ_STACK 0x800A0000 EMPTY -0x00010000 ; IRQ mode stack +; { } + + TTB 0x80100000 EMPTY 0x4000 ; Level-1 Translation Table for MMU + { } +} diff --git a/ports/cortex_a12/ac6/example_build/sample_threadx/startup.S b/ports/cortex_a12/ac6/example_build/sample_threadx/startup.S new file mode 100644 index 00000000..670fadb9 --- /dev/null +++ b/ports/cortex_a12/ac6/example_build/sample_threadx/startup.S @@ -0,0 +1,397 @@ +//---------------------------------------------------------------- +// ARMv7-A Embedded example - Startup Code +// +// Copyright (c) 2005-2018 Arm Limited (or its affiliates). All rights reserved. +// Use, modification and redistribution of this file is subject to your possession of a +// valid End User License Agreement for the Arm Product of which these examples are part of +// and your compliance with all applicable terms and conditions of such licence agreement. +//---------------------------------------------------------------- + +// Standard definitions of mode bits and interrupt (I & F) flags in PSRs + +#define Mode_USR 0x10 +#define Mode_FIQ 0x11 +#define Mode_IRQ 0x12 +#define Mode_SVC 0x13 +#define Mode_ABT 0x17 +#define Mode_UND 0x1B +#define Mode_SYS 0x1F + +#define I_Bit 0x80 // When I bit is set, IRQ is disabled +#define F_Bit 0x40 // When F bit is set, FIQ is disabled + + + .section VECTORS, "ax" + .align 3 + .cfi_sections .debug_frame // put stack frame info into .debug_frame instead of .eh_frame + + +//---------------------------------------------------------------- +// Entry point for the Reset handler +//---------------------------------------------------------------- + + .global Vectors + +//---------------------------------------------------------------- +// Exception Vector Table +//---------------------------------------------------------------- +// Note: LDR PC instructions are used here, though branch (B) instructions +// could also be used, unless the exception handlers are >32MB away. + +Vectors: + LDR PC, Reset_Addr + LDR PC, Undefined_Addr + LDR PC, SVC_Addr + LDR PC, Prefetch_Addr + LDR PC, Abort_Addr + LDR PC, Hypervisor_Addr + LDR PC, IRQ_Addr + LDR PC, FIQ_Addr + + + .balign 4 +Reset_Addr: + .word Reset_Handler +Undefined_Addr: + .word __tx_undefined +SVC_Addr: + .word __tx_swi_interrupt +Prefetch_Addr: + .word __tx_prefetch_handler +Abort_Addr: + .word __tx_abort_handler +Hypervisor_Addr: + .word __tx_reserved_handler +IRQ_Addr: + .word __tx_irq_handler +FIQ_Addr: + .word __tx_fiq_handler + + +//---------------------------------------------------------------- +// Exception Handlers +//---------------------------------------------------------------- + +Undefined_Handler: + B Undefined_Handler +SVC_Handler: + B SVC_Handler +Prefetch_Handler: + B Prefetch_Handler +Abort_Handler: + B Abort_Handler +Hypervisor_Handler: + B Hypervisor_Handler +IRQ_Handler: + B IRQ_Handler +FIQ_Handler: + B FIQ_Handler + + +//---------------------------------------------------------------- +// Reset Handler +//---------------------------------------------------------------- +Reset_Handler: + +//---------------------------------------------------------------- +// Disable caches and MMU in case they were left enabled from an earlier run +// This does not need to be done from a cold reset +//---------------------------------------------------------------- + + MRC p15, 0, r0, c1, c0, 0 // Read System Control Register + BIC r0, r0, #(0x1 << 12) // Clear I bit 12 to disable I Cache + BIC r0, r0, #(0x1 << 2) // Clear C bit 2 to disable D Cache + BIC r0, r0, #0x1 // Clear M bit 0 to disable MMU + BIC r0, r0, #(0x1 << 11) // Clear Z bit 11 to disable branch prediction + MCR p15, 0, r0, c1, c0, 0 // Write System Control Register + ISB + +// The MMU is enabled later, before calling main(). Caches are enabled inside main(), +// after the MMU has been enabled and scatterloading has been performed. + +//---------------------------------------------------------------- +// ACTLR.SMP bit must be set before the caches and MMU are enabled, +// or any cache and TLB maintenance operations are performed, even for single-core +//---------------------------------------------------------------- + MRC p15, 0, r0, c1, c0, 1 // Read ACTLR + ORR r0, r0, #(1 << 6) // Set ACTLR.SMP bit + MCR p15, 0, r0, c1, c0, 1 // Write ACTLR + ISB + +//---------------------------------------------------------------- +// Invalidate Data and Instruction TLBs and branch predictor +// This does not need to be done from a cold reset +//---------------------------------------------------------------- + + MOV r0,#0 + MCR p15, 0, r0, c8, c7, 0 // I-TLB and D-TLB invalidation + MCR p15, 0, r0, c7, c5, 6 // BPIALL - Invalidate entire branch predictor array + +//---------------------------------------------------------------- +// Initialize Supervisor Mode Stack +// Note stack must be 8 byte aligned. +//---------------------------------------------------------------- + + LDR SP, =Image$$ARM_LIB_STACK$$ZI$$Limit + +//---------------------------------------------------------------- +// Disable loop-buffer to fix errata on A15 r0p0 +//---------------------------------------------------------------- + MRC p15, 0, r0, c0, c0, 0 // Read main ID register MIDR + MOV r1, r0, lsr #4 // Extract Primary Part Number + LDR r2, =0xFFF + AND r1, r1, r2 + LDR r2, =0xC0F + CMP r1, r2 // Is this an A15? + BNE notA15r0p0 // Jump if not A15 + AND r5, r0, #0x00f00000 // Variant + AND r6, r0, #0x0000000f // Revision + ORRS r6, r6, r5 // Combine variant and revision + BNE notA15r0p0 // Jump if not r0p0 + MRC p15, 0, r0, c1, c0, 1 // Read Aux Ctrl Reg + ORR r0, r0, #(1 << 1) // Set bit 1 to Disable Loop Buffer + MCR p15, 0, r0, c1, c0, 1 // Write Aux Ctrl Reg + ISB +notA15r0p0: + +//---------------------------------------------------------------- +// Set Vector Base Address Register (VBAR) to point to this application's vector table +//---------------------------------------------------------------- + + LDR r0, =Vectors + MCR p15, 0, r0, c12, c0, 0 + +//---------------------------------------------------------------- +// Cache Invalidation code for ARMv7-A +// The caches, MMU and BTB do not need post-reset invalidation on Cortex-A7, +// but forcing a cache invalidation makes the code more portable to other CPUs (e.g. Cortex-A9) +//---------------------------------------------------------------- + + // Invalidate L1 Instruction Cache + + MRC p15, 1, r0, c0, c0, 1 // Read Cache Level ID Register (CLIDR) + TST r0, #0x3 // Harvard Cache? + MOV r0, #0 // SBZ + MCRNE p15, 0, r0, c7, c5, 0 // ICIALLU - Invalidate instruction cache and flush branch target cache + + // Invalidate Data/Unified Caches + + MRC p15, 1, r0, c0, c0, 1 // Read CLIDR + ANDS r3, r0, #0x07000000 // Extract coherency level + MOV r3, r3, LSR #23 // Total cache levels << 1 + BEQ Finished // If 0, no need to clean + + MOV r10, #0 // R10 holds current cache level << 1 +Loop1: + ADD r2, r10, r10, LSR #1 // R2 holds cache "Set" position + MOV r1, r0, LSR r2 // Bottom 3 bits are the Cache-type for this level + AND r1, r1, #7 // Isolate those lower 3 bits + CMP r1, #2 + BLT Skip // No cache or only instruction cache at this level + + MCR p15, 2, r10, c0, c0, 0 // Write the Cache Size selection register + ISB // ISB to sync the change to the CacheSizeID reg + MRC p15, 1, r1, c0, c0, 0 // Reads current Cache Size ID register + AND r2, r1, #7 // Extract the line length field + ADD r2, r2, #4 // Add 4 for the line length offset (log2 16 bytes) + LDR r4, =0x3FF + ANDS r4, r4, r1, LSR #3 // R4 is the max number on the way size (right aligned) + CLZ r5, r4 // R5 is the bit position of the way size increment + LDR r7, =0x7FFF + ANDS r7, r7, r1, LSR #13 // R7 is the max number of the index size (right aligned) + +Loop2: + MOV r9, r4 // R9 working copy of the max way size (right aligned) + +Loop3: + ORR r11, r10, r9, LSL r5 // Factor in the Way number and cache number into R11 + ORR r11, r11, r7, LSL r2 // Factor in the Set number + MCR p15, 0, r11, c7, c6, 2 // Invalidate by Set/Way + SUBS r9, r9, #1 // Decrement the Way number + BGE Loop3 + SUBS r7, r7, #1 // Decrement the Set number + BGE Loop2 +Skip: + ADD r10, r10, #2 // Increment the cache number + CMP r3, r10 + BGT Loop1 + +Finished: + + +//---------------------------------------------------------------- +// MMU Configuration +// Set translation table base +//---------------------------------------------------------------- + + // Two translation tables are supported, TTBR0 and TTBR1 + // Configure translation table base (TTB) control register cp15,c2 + // to a value of all zeros, indicates we are using TTB register 0. + + MOV r0,#0x0 + MCR p15, 0, r0, c2, c0, 2 + + // write the address of our page table base to TTB register 0 + LDR r0,=Image$$TTB$$ZI$$Base + + MOV r1, #0x08 // RGN=b01 (outer cacheable write-back cached, write allocate) + // S=0 (translation table walk to non-shared memory) + ORR r1,r1,#0x40 // IRGN=b01 (inner cacheability for the translation table walk is Write-back Write-allocate) + + ORR r0,r0,r1 + + MCR p15, 0, r0, c2, c0, 0 + + +//---------------------------------------------------------------- +// PAGE TABLE generation + +// Generate the page tables +// Build a flat translation table for the whole address space. +// ie: Create 4096 1MB sections from 0x000xxxxx to 0xFFFxxxxx + + +// 31 20 19 18 17 16 15 14 12 11 10 9 8 5 4 3 2 1 0 +// |section base address| 0 0 |nG| S |AP2| TEX | AP | P | Domain | XN | C B | 1 0| +// +// Bits[31:20] - Top 12 bits of VA is pointer into table +// nG[17]=0 - Non global, enables matching against ASID in the TLB when set. +// S[16]=0 - Indicates normal memory is shared when set. +// AP2[15]=0 +// AP[11:10]=11 - Configure for full read/write access in all modes +// TEX[14:12]=000 +// CB[3:2]= 00 - Set attributes to Strongly-ordered memory. +// (except for the code segment descriptor, see below) +// IMPP[9]=0 - Ignored +// Domain[5:8]=1111 - Set all pages to use domain 15 +// XN[4]=1 - Execute never on Strongly-ordered memory +// Bits[1:0]=10 - Indicate entry is a 1MB section +//---------------------------------------------------------------- + LDR r0,=Image$$TTB$$ZI$$Base + LDR r1,=0xfff // loop counter + LDR r2,=0b00000000000000000000110111100010 + + // r0 contains the address of the translation table base + // r1 is loop counter + // r2 is level1 descriptor (bits 19:0) + + // use loop counter to create 4096 individual table entries. + // this writes from address 'Image$$TTB$$ZI$$Base' + + // offset 0x3FFC down to offset 0x0 in word steps (4 bytes) + +init_ttb_1: + ORR r3, r2, r1, LSL#20 // R3 now contains full level1 descriptor to write + ORR r3, r3, #0b0000000010000 // Set XN bit + STR r3, [r0, r1, LSL#2] // Str table entry at TTB base + loopcount*4 + SUBS r1, r1, #1 // Decrement loop counter + BPL init_ttb_1 + + // In this example, the 1MB section based at '__code_start' is setup specially as cacheable (write back mode). + // TEX[14:12]=001 and CB[3:2]= 11, Outer and inner write back, write allocate normal memory. + LDR r1,=Image$$VECTORS$$Base // Base physical address of code segment + LSR r1, #20 // Shift right to align to 1MB boundaries + ORR r3, r2, r1, LSL#20 // Setup the initial level1 descriptor again + ORR r3, r3, #0b0000000001100 // Set CB bits + ORR r3, r3, #0b1000000000000 // Set TEX bit 12 + STR r3, [r0, r1, LSL#2] // str table entry + +//---------------------------------------------------------------- +// Setup domain control register - Enable all domains to client mode +//---------------------------------------------------------------- + + MRC p15, 0, r0, c3, c0, 0 // Read Domain Access Control Register + LDR r0, =0x55555555 // Initialize every domain entry to b01 (client) + MCR p15, 0, r0, c3, c0, 0 // Write Domain Access Control Register + +#if defined(__ARM_NEON) || defined(__ARM_FP) +//---------------------------------------------------------------- +// Enable access to NEON/VFP by enabling access to Coprocessors 10 and 11. +// Enables Full Access i.e. in both privileged and non privileged modes +//---------------------------------------------------------------- + + MRC p15, 0, r0, c1, c0, 2 // Read Coprocessor Access Control Register (CPACR) + ORR r0, r0, #(0xF << 20) // Enable access to CP 10 & 11 + MCR p15, 0, r0, c1, c0, 2 // Write Coprocessor Access Control Register (CPACR) + ISB + +//---------------------------------------------------------------- +// Switch on the VFP and NEON hardware +//---------------------------------------------------------------- + + MOV r0, #0x40000000 + VMSR FPEXC, r0 // Write FPEXC register, EN bit set +#endif + + +//---------------------------------------------------------------- +// Enable MMU and branch to __main +// Leaving the caches disabled until after scatter loading. +//---------------------------------------------------------------- + + LDR r12,=__main + + MRC p15, 0, r0, c1, c0, 0 // Read System Control Register + BIC r0, r0, #(0x1 << 12) // Clear I bit 12 to disable I Cache + BIC r0, r0, #(0x1 << 2) // Clear C bit 2 to disable D Cache + BIC r0, r0, #0x2 // Clear A bit 1 to disable strict alignment fault checking + ORR r0, r0, #0x1 // Set M bit 0 to enable MMU before scatter loading + MCR p15, 0, r0, c1, c0, 0 // Write System Control Register + ISB + +// Now the MMU is enabled, virtual to physical address translations will occur. This will affect the next +// instruction fetch. +// +// The two instructions currently in the pipeline will have been fetched before the MMU was enabled. +// The branch to __main is safe because the Virtual Address (VA) is the same as the Physical Address (PA) +// (flat mapping) of this code that enables the MMU and performs the branch + + BX r12 // Branch to __main C library entry point + + + +//---------------------------------------------------------------- +// Enable caches and branch prediction +// This code must be run from a privileged mode +//---------------------------------------------------------------- + + .section ENABLECACHES,"ax" + .align 3 + + .global enable_caches + .type enable_caches, "function" + .cfi_startproc +enable_caches: + +//---------------------------------------------------------------- +// Enable caches and branch prediction +//---------------------------------------------------------------- + + MRC p15, 0, r0, c1, c0, 0 // Read System Control Register + ORR r0, r0, #(0x1 << 12) // Set I bit 12 to enable I Cache + ORR r0, r0, #(0x1 << 2) // Set C bit 2 to enable D Cache + ORR r0, r0, #(0x1 << 11) // Set Z bit 11 to enable branch prediction + MCR p15, 0, r0, c1, c0, 0 // Write System Control Register + ISB + + MRC p15, 0, r0, c1, c0, 1 // Read Auxiliary Control Register + ORR r0, #2 // L2EN bit, enable L2 cache + ORR r0, r0, #(0x1 << 2) // Set DP bit 2 to enable L1 Dside prefetch + MCR p15, 0, r0, c1, c0, 1 // Write Auxiliary Control Register + ISB + + BX lr + .cfi_endproc + + .global disable_caches + .type disable_caches, "function" +disable_caches: + + MRC p15, 0, r0, c1, c0, 0 // Read System Control Register + BIC r0, r0, #(0x1 << 12) // Clear I bit 12 to disable I Cache + BIC r0, r0, #(0x1 << 2) // Clear C bit 2 to disable D Cache + MCR p15, 0, r0, c1, c0, 0 // Write System Control Register + ISB + + BX lr + + diff --git a/ports/cortex_a12/ac6/example_build/sample_threadx/tx_initialize_low_level.S b/ports/cortex_a12/ac6/example_build/sample_threadx/tx_initialize_low_level.S new file mode 100644 index 00000000..715958f0 --- /dev/null +++ b/ports/cortex_a12/ac6/example_build/sample_threadx/tx_initialize_low_level.S @@ -0,0 +1,299 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Initialize */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .arm + +SVC_MODE = 0xD3 // Disable IRQ/FIQ SVC mode +IRQ_MODE = 0xD2 // Disable IRQ/FIQ IRQ mode +FIQ_MODE = 0xD1 // Disable IRQ/FIQ FIQ mode +SYS_MODE = 0xDF // Disable IRQ/FIQ SYS mode +FIQ_STACK_SIZE = 512 // FIQ stack size +IRQ_STACK_SIZE = 1024 // IRQ stack size +SYS_STACK_SIZE = 1024 // System stack size + + .global _tx_thread_system_stack_ptr + .global _tx_initialize_unused_memory + .global _tx_thread_context_save + .global _tx_thread_context_restore + .global _tx_timer_interrupt + + + +/* Define the 16-bit Thumb mode veneer for _tx_initialize_low_level for + applications calling this function from to 16-bit Thumb mode. */ + + .text + .align 2 + .thumb + .global $_tx_initialize_low_level + .type $_tx_initialize_low_level,function +$_tx_initialize_low_level: + BX pc // Switch to 32-bit mode + NOP // + .arm + STMFD sp!, {lr} // Save return address + BL _tx_initialize_low_level // Call _tx_initialize_low_level function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_initialize_low_level ARMV7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for any low-level processor */ +/* initialization, including setting up interrupt vectors, setting */ +/* up a periodic timer interrupt source, saving the system stack */ +/* pointer for use in ISR processing later, and finding the first */ +/* available RAM memory address for tx_application_define. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_initialize_kernel_enter ThreadX entry function */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_initialize_low_level + .type _tx_initialize_low_level,function +_tx_initialize_low_level: + + /* We must be in SVC mode at this point! */ + + /* Setup various stack pointers. */ + + LDR r1, =Image$$ARM_LIB_STACK$$ZI$$Limit // Get pointer to stack area + +#ifdef TX_ENABLE_IRQ_NESTING + + /* Setup the system mode stack for nested interrupt support */ + + LDR r2, =SYS_STACK_SIZE // Pickup stack size + MOV r3, #SYS_MODE // Build SYS mode CPSR + MSR CPSR_c, r3 // Enter SYS mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup SYS stack pointer + SUB r1, r1, r2 // Calculate start of next stack +#endif + + LDR r2, =FIQ_STACK_SIZE // Pickup stack size + MOV r0, #FIQ_MODE // Build FIQ mode CPSR + MSR CPSR, r0 // Enter FIQ mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup FIQ stack pointer + SUB r1, r1, r2 // Calculate start of next stack + LDR r2, =IRQ_STACK_SIZE // Pickup IRQ stack size + MOV r0, #IRQ_MODE // Build IRQ mode CPSR + MSR CPSR, r0 // Enter IRQ mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup IRQ stack pointer + SUB r3, r1, r2 // Calculate end of IRQ stack + MOV r0, #SVC_MODE // Build SVC mode CPSR + MSR CPSR, r0 // Enter SVC mode + LDR r2, =Image$$ARM_LIB_STACK$$Base // Pickup stack bottom + CMP r3, r2 // Compare the current stack end with the bottom +_stack_error_loop: + BLT _stack_error_loop // If the IRQ stack exceeds the stack bottom, just sit here! + + LDR r2, =_tx_thread_system_stack_ptr // Pickup stack pointer + STR r1, [r2] // Save the system stack + + LDR r1, =Image$$ZI_DATA$$ZI$$Limit // Get end of non-initialized RAM area + LDR r2, =_tx_initialize_unused_memory // Pickup unused memory ptr address + ADD r1, r1, #8 // Increment to next free word + STR r1, [r2] // Save first free memory address + +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif + +/* Define shells for each of the interrupt vectors. */ + + .global __tx_undefined +__tx_undefined: + B __tx_undefined // Undefined handler + + .global __tx_swi_interrupt +__tx_swi_interrupt: + B __tx_swi_interrupt // Software interrupt handler + + .global __tx_prefetch_handler +__tx_prefetch_handler: + B __tx_prefetch_handler // Prefetch exception handler + + .global __tx_abort_handler +__tx_abort_handler: + B __tx_abort_handler // Abort exception handler + + .global __tx_reserved_handler +__tx_reserved_handler: + B __tx_reserved_handler // Reserved exception handler + + .global __tx_irq_processing_return + .type __tx_irq_processing_return,function + .global __tx_irq_handler +__tx_irq_handler: + + /* Jump to context save to save system context. */ + B _tx_thread_context_save +__tx_irq_processing_return: + + /* At this point execution is still in the IRQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. In + addition, IRQ interrupts may be re-enabled - with certain restrictions - + if nested IRQ interrupts are desired. Interrupts may be re-enabled over + small code sequences where lr is saved before enabling interrupts and + restored after interrupts are again disabled. */ + + /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start + from IRQ mode with interrupts disabled. This routine switches to the + system mode and returns with IRQ interrupts enabled. + + NOTE: It is very important to ensure all IRQ interrupts are cleared + prior to enabling nested IRQ interrupts. */ +#ifdef TX_ENABLE_IRQ_NESTING + BL _tx_thread_irq_nesting_start +#endif + + /* For debug purpose, execute the timer interrupt processing here. In + a real system, some kind of status indication would have to be checked + before the timer interrupt handler could be called. */ + + BL _tx_timer_interrupt // Timer interrupt handler + + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_context_restore. + This routine returns in processing in IRQ mode with interrupts disabled. */ +#ifdef TX_ENABLE_IRQ_NESTING + BL _tx_thread_irq_nesting_end +#endif + + /* Jump to context restore to restore system context. */ + B _tx_thread_context_restore + + + /* This is an example of a vectored IRQ handler. */ + + /* At this point execution is still in the IRQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. In + addition, IRQ interrupts may be re-enabled - with certain restrictions - + if nested IRQ interrupts are desired. Interrupts may be re-enabled over + small code sequences where lr is saved before enabling interrupts and + restored after interrupts are again disabled. */ + + + /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start + from IRQ mode with interrupts disabled. This routine switches to the + system mode and returns with IRQ interrupts enabled. + + NOTE: It is very important to ensure all IRQ interrupts are cleared + prior to enabling nested IRQ interrupts. */ + + /* Application IRQ handlers can be called here! */ + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_context_restore. + This routine returns in processing in IRQ mode with interrupts disabled. */ + + /* Jump to context restore to restore system context. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + .global __tx_fiq_handler + .global __tx_fiq_processing_return +__tx_fiq_handler: + + /* Jump to fiq context save to save system context. */ + B _tx_thread_fiq_context_save +__tx_fiq_processing_return: + + /* At this point execution is still in the FIQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. */ + + /* Interrupt nesting is allowed after calling _tx_thread_fiq_nesting_start + from FIQ mode with interrupts disabled. This routine switches to the + system mode and returns with FIQ interrupts enabled. + + NOTE: It is very important to ensure all FIQ interrupts are cleared + prior to enabling nested FIQ interrupts. */ +#ifdef TX_ENABLE_FIQ_NESTING + BL _tx_thread_fiq_nesting_start +#endif + + /* Application FIQ handlers can be called here! */ + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_fiq_context_restore. */ +#ifdef TX_ENABLE_FIQ_NESTING + BL _tx_thread_fiq_nesting_end +#endif + + /* Jump to fiq context restore to restore system context. */ + B _tx_thread_fiq_context_restore + + +#else + .global __tx_fiq_handler +__tx_fiq_handler: + B __tx_fiq_handler // FIQ interrupt handler +#endif + + +BUILD_OPTIONS: + .word _tx_build_options // Reference to bring in +VERSION_ID: + .word _tx_version_id // Reference to bring in + + diff --git a/ports/cortex_a12/ac6/example_build/tx/.cproject b/ports/cortex_a12/ac6/example_build/tx/.cproject new file mode 100644 index 00000000..c6b251b2 --- /dev/null +++ b/ports/cortex_a12/ac6/example_build/tx/.cproject @@ -0,0 +1,146 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ports/cortex_a12/ac6/example_build/tx/.project b/ports/cortex_a12/ac6/example_build/tx/.project new file mode 100644 index 00000000..863ca5cb --- /dev/null +++ b/ports/cortex_a12/ac6/example_build/tx/.project @@ -0,0 +1,48 @@ + + + tx + + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + + + + inc_generic + 2 + $%7BPARENT-5-PROJECT_LOC%7D/common/inc + + + inc_port + 2 + $%7BPARENT-2-PROJECT_LOC%7D/inc + + + src_generic + 2 + $%7BPARENT-5-PROJECT_LOC%7D/common/src + + + src_port + 2 + $%7BPARENT-2-PROJECT_LOC%7D/src + + + diff --git a/ports/cortex_a12/ac6/inc/tx_port.h b/ports/cortex_a12/ac6/inc/tx_port.h new file mode 100644 index 00000000..19463de1 --- /dev/null +++ b/ports/cortex_a12/ac6/inc/tx_port.h @@ -0,0 +1,328 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Port Specific */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* tx_port.h ARMv7-A */ +/* 6.1.11 */ +/* */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This file contains data type definitions that make the ThreadX */ +/* real-time kernel function identically on a variety of different */ +/* processor architectures. For example, the size or number of bits */ +/* in an "int" data type vary between microprocessor architectures and */ +/* even C compilers for the same microprocessor. ThreadX does not */ +/* directly use native C data types. Instead, ThreadX creates its */ +/* own special types that can be mapped to actual data types by this */ +/* file to guarantee consistency in the interface and functionality. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-02-2021 Bhupendra Naphade Modified comment(s),updated */ +/* macro definition, */ +/* resulting in version 6.1.6 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + +#ifndef TX_PORT_H +#define TX_PORT_H + + +/* Determine if the optional ThreadX user define file should be used. */ + +#ifdef TX_INCLUDE_USER_DEFINE_FILE + + +/* Yes, include the user defines in tx_user.h. The defines in this file may + alternately be defined on the command line. */ + +#include "tx_user.h" +#endif + + +/* Define compiler library include files. */ + +#include +#include + + +/* Define ThreadX basic types for this port. */ + +#define VOID void +typedef char CHAR; +typedef unsigned char UCHAR; +typedef int INT; +typedef unsigned int UINT; +typedef long LONG; +typedef unsigned long ULONG; +typedef short SHORT; +typedef unsigned short USHORT; + + +/* Define the priority levels for ThreadX. Legal values range + from 32 to 1024 and MUST be evenly divisible by 32. */ + +#ifndef TX_MAX_PRIORITIES +#define TX_MAX_PRIORITIES 32 +#endif + + +/* Define the minimum stack for a ThreadX thread on this processor. If the size supplied during + thread creation is less than this value, the thread create call will return an error. */ + +#ifndef TX_MINIMUM_STACK +#define TX_MINIMUM_STACK 200 /* Minimum stack size for this port */ +#endif + + +/* Define the system timer thread's default stack size and priority. These are only applicable + if TX_TIMER_PROCESS_IN_ISR is not defined. */ + +#ifndef TX_TIMER_THREAD_STACK_SIZE +#define TX_TIMER_THREAD_STACK_SIZE 1024 /* Default timer thread stack size */ +#endif + +#ifndef TX_TIMER_THREAD_PRIORITY +#define TX_TIMER_THREAD_PRIORITY 0 /* Default timer thread priority */ +#endif + + +/* Define various constants for the ThreadX ARM port. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT +#define TX_INT_DISABLE 0xC0 /* Disable IRQ & FIQ interrupts */ +#else +#define TX_INT_DISABLE 0x80 /* Disable IRQ interrupts */ +#endif +#define TX_INT_ENABLE 0x00 /* Enable IRQ interrupts */ + + +/* Define the clock source for trace event entry time stamp. The following two item are port specific. + For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock + source constants would be: + +#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_MASK 0x0000FFFFUL + +*/ + +#ifndef TX_TRACE_TIME_SOURCE +#define TX_TRACE_TIME_SOURCE ++_tx_trace_simulated_time +#endif +#ifndef TX_TRACE_TIME_MASK +#define TX_TRACE_TIME_MASK 0xFFFFFFFFUL +#endif + + +/* Define the port specific options for the _tx_build_options variable. This variable indicates + how the ThreadX library was built. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT +#define TX_FIQ_ENABLED 1 +#else +#define TX_FIQ_ENABLED 0 +#endif + +#ifdef TX_ENABLE_IRQ_NESTING +#define TX_IRQ_NESTING_ENABLED 2 +#else +#define TX_IRQ_NESTING_ENABLED 0 +#endif + +#ifdef TX_ENABLE_FIQ_NESTING +#define TX_FIQ_NESTING_ENABLED 4 +#else +#define TX_FIQ_NESTING_ENABLED 0 +#endif + +#define TX_PORT_SPECIFIC_BUILD_OPTIONS TX_FIQ_ENABLED | TX_IRQ_NESTING_ENABLED | TX_FIQ_NESTING_ENABLED + + +/* Define the in-line initialization constant so that modules with in-line + initialization capabilities can prevent their initialization from being + a function call. */ + +#define TX_INLINE_INITIALIZATION + + +/* Determine whether or not stack checking is enabled. By default, ThreadX stack checking is + disabled. When the following is defined, ThreadX thread stack checking is enabled. If stack + checking is enabled (TX_ENABLE_STACK_CHECKING is defined), the TX_DISABLE_STACK_FILLING + define is negated, thereby forcing the stack fill which is necessary for the stack checking + logic. */ + +#ifdef TX_ENABLE_STACK_CHECKING +#undef TX_DISABLE_STACK_FILLING +#endif + + +/* Define the TX_THREAD control block extensions for this port. The main reason + for the multiple macros is so that backward compatibility can be maintained with + existing ThreadX kernel awareness modules. */ + +#define TX_THREAD_EXTENSION_0 +#define TX_THREAD_EXTENSION_1 +#define TX_THREAD_EXTENSION_2 ULONG tx_thread_vfp_enable; +#define TX_THREAD_EXTENSION_3 + + +/* Define the port extensions of the remaining ThreadX objects. */ + +#define TX_BLOCK_POOL_EXTENSION +#define TX_BYTE_POOL_EXTENSION +#define TX_EVENT_FLAGS_GROUP_EXTENSION +#define TX_MUTEX_EXTENSION +#define TX_QUEUE_EXTENSION +#define TX_SEMAPHORE_EXTENSION +#define TX_TIMER_EXTENSION + + +/* Define the user extension field of the thread control block. Nothing + additional is needed for this port so it is defined as white space. */ + +#ifndef TX_THREAD_USER_EXTENSION +#define TX_THREAD_USER_EXTENSION +#endif + + +/* Define the macros for processing extensions in tx_thread_create, tx_thread_delete, + tx_thread_shell_entry, and tx_thread_terminate. */ + + +#define TX_THREAD_CREATE_EXTENSION(thread_ptr) +#define TX_THREAD_DELETE_EXTENSION(thread_ptr) +#define TX_THREAD_COMPLETED_EXTENSION(thread_ptr) +#define TX_THREAD_TERMINATED_EXTENSION(thread_ptr) + + +/* Define the ThreadX object creation extensions for the remaining objects. */ + +#define TX_BLOCK_POOL_CREATE_EXTENSION(pool_ptr) +#define TX_BYTE_POOL_CREATE_EXTENSION(pool_ptr) +#define TX_EVENT_FLAGS_GROUP_CREATE_EXTENSION(group_ptr) +#define TX_MUTEX_CREATE_EXTENSION(mutex_ptr) +#define TX_QUEUE_CREATE_EXTENSION(queue_ptr) +#define TX_SEMAPHORE_CREATE_EXTENSION(semaphore_ptr) +#define TX_TIMER_CREATE_EXTENSION(timer_ptr) + + +/* Define the ThreadX object deletion extensions for the remaining objects. */ + +#define TX_BLOCK_POOL_DELETE_EXTENSION(pool_ptr) +#define TX_BYTE_POOL_DELETE_EXTENSION(pool_ptr) +#define TX_EVENT_FLAGS_GROUP_DELETE_EXTENSION(group_ptr) +#define TX_MUTEX_DELETE_EXTENSION(mutex_ptr) +#define TX_QUEUE_DELETE_EXTENSION(queue_ptr) +#define TX_SEMAPHORE_DELETE_EXTENSION(semaphore_ptr) +#define TX_TIMER_DELETE_EXTENSION(timer_ptr) + + +/* Determine if the ARM architecture has the CLZ instruction. This is available on + architectures v5 and above. If available, redefine the macro for calculating the + lowest bit set. */ + +#if __TARGET_ARCH_ARM > 4 + +#ifndef __thumb__ + +#define TX_LOWEST_SET_BIT_CALCULATE(m, b) m = m & ((ULONG) (-((LONG) m))); \ + asm volatile (" CLZ %0,%1 ": "=r" (b) : "r" (m) ); \ + b = 31 - b; +#endif +#endif + + +/* Define ThreadX interrupt lockout and restore macros for protection on + access of critical kernel information. The restore interrupt macro must + restore the interrupt posture of the running thread prior to the value + present prior to the disable macro. In most cases, the save area macro + is used to define a local function save area for the disable and restore + macros. */ + +#ifdef __thumb__ + +unsigned int _tx_thread_interrupt_disable(void); +unsigned int _tx_thread_interrupt_restore(UINT old_posture); + + +#define TX_INTERRUPT_SAVE_AREA UINT interrupt_save; + +#define TX_DISABLE interrupt_save = _tx_thread_interrupt_disable(); +#define TX_RESTORE _tx_thread_interrupt_restore(interrupt_save); + +#else + +#define TX_INTERRUPT_SAVE_AREA UINT interrupt_save, tx_temp; + +#ifdef TX_ENABLE_FIQ_SUPPORT +#define TX_DISABLE asm volatile (" MRS %0,CPSR; CPSID if ": "=r" (interrupt_save) ); +#else +#define TX_DISABLE asm volatile (" MRS %0,CPSR; CPSID i ": "=r" (interrupt_save) ); +#endif + +#define TX_RESTORE asm volatile (" MSR CPSR_c,%0 "::"r" (interrupt_save) ); + +#endif + + +/* Define VFP extension for the ARMv7-A. Each is assumed to be called in the context of the executing + thread. */ + +void tx_thread_vfp_enable(void); +void tx_thread_vfp_disable(void); + + +/* Define the interrupt lockout macros for each ThreadX object. */ + +#define TX_BLOCK_POOL_DISABLE TX_DISABLE +#define TX_BYTE_POOL_DISABLE TX_DISABLE +#define TX_EVENT_FLAGS_GROUP_DISABLE TX_DISABLE +#define TX_MUTEX_DISABLE TX_DISABLE +#define TX_QUEUE_DISABLE TX_DISABLE +#define TX_SEMAPHORE_DISABLE TX_DISABLE + + +/* Define the version ID of ThreadX. This may be utilized by the application. */ + +#ifdef TX_THREAD_INIT +CHAR _tx_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX ARMv7-A Version 6.1.11 *"; +#else +extern CHAR _tx_version_id[]; +#endif + + +#endif + diff --git a/ports/cortex_a12/ac6/src/tx_thread_context_restore.S b/ports/cortex_a12/ac6/src/tx_thread_context_restore.S new file mode 100644 index 00000000..fae7e72d --- /dev/null +++ b/ports/cortex_a12/ac6/src/tx_thread_context_restore.S @@ -0,0 +1,222 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .arm + +#ifdef TX_ENABLE_FIQ_SUPPORT +SVC_MODE = 0xD3 // Disable IRQ/FIQ, SVC mode +IRQ_MODE = 0xD2 // Disable IRQ/FIQ, IRQ mode +#else +SVC_MODE = 0x93 // Disable IRQ, SVC mode +IRQ_MODE = 0x92 // Disable IRQ, IRQ mode +#endif + + .global _tx_thread_system_state + .global _tx_thread_current_ptr + .global _tx_thread_execute_ptr + .global _tx_timer_time_slice + .global _tx_thread_schedule + .global _tx_thread_preempt_disable + + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_restore + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_context_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function restores the interrupt context if it is processing a */ +/* nested interrupt. If not, it returns to the interrupt thread if no */ +/* preemption is necessary. Otherwise, if preemption is necessary or */ +/* if no thread was running, the function returns to the scheduler. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling routine */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs Interrupt Service Routines */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_context_restore + .type _tx_thread_context_restore,function +_tx_thread_context_restore: + + /* Lockout interrupts. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Disable IRQ and FIQ interrupts +#else + CPSID i // Disable IRQ interrupts +#endif + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR exit function to indicate an ISR is complete. */ + + BL _tx_execution_isr_exit // Call the ISR exit function +#endif + + /* Determine if interrupts are nested. */ + + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + SUB r2, r2, #1 // Decrement the counter + STR r2, [r3] // Store the counter + CMP r2, #0 // Was this the first interrupt? + BEQ __tx_thread_not_nested_restore // If so, not a nested restore + + /* Interrupts are nested. */ + + /* Just recover the saved registers and return to the point of + interrupt. */ + + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_not_nested_restore: + + /* Determine if a thread was interrupted and no preemption is required. */ + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup actual current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_restore // Yes, idle system was interrupted + + LDR r3, =_tx_thread_preempt_disable // Pickup preempt disable address + LDR r2, [r3] // Pickup actual preempt disable flag + CMP r2, #0 // Is it set? + BNE __tx_thread_no_preempt_restore // Yes, don't preempt this thread + LDR r3, =_tx_thread_execute_ptr // Pickup address of execute thread ptr + LDR r2, [r3] // Pickup actual execute thread pointer + CMP r0, r2 // Is the same thread highest priority? + BNE __tx_thread_preempt_restore // No, preemption needs to happen + + +__tx_thread_no_preempt_restore: + + /* Recover the saved context and return to the point of interrupt. */ + + /* Pickup the saved stack pointer. */ + + /* Recover the saved context and return to the point of interrupt. */ + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_preempt_restore: + + LDMIA sp!, {r3, r10, r12, lr} // Recover temporarily saved registers + MOV r1, lr // Save lr (point of interrupt) + MOV r2, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r2 // Enter SVC mode + STR r1, [sp, #-4]! // Save point of interrupt + STMDB sp!, {r4-r12, lr} // Save upper half of registers + MOV r4, r3 // Save SPSR in r4 + MOV r2, #IRQ_MODE // Build IRQ mode CPSR + MSR CPSR_c, r2 // Enter IRQ mode + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOV r5, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r5 // Enter SVC mode + STMDB sp!, {r0-r3} // Save r0-r3 on thread's stack + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer + +#ifdef TX_ENABLE_VFP_SUPPORT + LDR r2, [r0, #144] // Pickup the VFP enabled flag + CMP r2, #0 // Is the VFP enabled? + BEQ _tx_skip_irq_vfp_save // No, skip VFP IRQ save + VMRS r2, FPSCR // Pickup the FPSCR + STR r2, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D0-D15} // Save D0-D15 + +_tx_skip_irq_vfp_save: + +#endif + + MOV r3, #1 // Build interrupt stack type + STMDB sp!, {r3, r4} // Save interrupt stack type and SPSR + STR sp, [r0, #8] // Save stack pointer in thread control + // block + + /* Save the remaining time-slice and disable it. */ + LDR r3, =_tx_timer_time_slice // Pickup time-slice variable address + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it active? + BEQ __tx_thread_dont_save_ts // No, don't save it + STR r2, [r0, #24] // Save thread's time-slice + MOV r2, #0 // Clear value + STR r2, [r3] // Disable global time-slice flag + +__tx_thread_dont_save_ts: + + /* Clear the current task pointer. */ + MOV r0, #0 // NULL value + STR r0, [r1] // Clear current thread pointer + + /* Return to the scheduler. */ + B _tx_thread_schedule // Return to scheduler + +__tx_thread_idle_system_restore: + + /* Just return back to the scheduler! */ + MOV r0, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r0 // Enter SVC mode + B _tx_thread_schedule // Return to scheduler diff --git a/ports/cortex_a12/ac6/src/tx_thread_context_save.S b/ports/cortex_a12/ac6/src/tx_thread_context_save.S new file mode 100644 index 00000000..7ac48c2e --- /dev/null +++ b/ports/cortex_a12/ac6/src/tx_thread_context_save.S @@ -0,0 +1,172 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .global _tx_thread_system_state + .global _tx_thread_current_ptr + .global __tx_irq_processing_return + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_save + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_context_save + .type _tx_thread_context_save,function +_tx_thread_context_save: + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + + STMDB sp!, {r0-r3} // Save some working registers +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Disable FIQ interrupts +#endif + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + + /* Save the rest of the scratch registers on the stack and return to the + calling ISR. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, r10, r12, lr} // Store other registers + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + B __tx_irq_processing_return // Continue IRQ processing + +__tx_thread_not_nested_save: + + /* Otherwise, not nested, check to see if a thread was running. */ + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + + /* Save minimal context of interrupted thread. */ + + MRS r2, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r2, r10, r12, lr} // Store other registers + + MOV r10, #0 // Clear stack limit + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + B __tx_irq_processing_return // Continue IRQ processing + +__tx_thread_idle_system_save: + + /* Interrupt occurred in the scheduling loop. */ + + /* Not much to do here, just adjust the stack pointer, and return to IRQ + processing. */ + + MOV r10, #0 // Clear stack limit + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + ADD sp, sp, #16 // Recover saved registers + B __tx_irq_processing_return // Continue IRQ processing diff --git a/ports/cortex_a12/ac6/src/tx_thread_fiq_context_restore.S b/ports/cortex_a12/ac6/src/tx_thread_fiq_context_restore.S new file mode 100644 index 00000000..006be973 --- /dev/null +++ b/ports/cortex_a12/ac6/src/tx_thread_fiq_context_restore.S @@ -0,0 +1,223 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +SVC_MODE = 0xD3 // SVC mode +FIQ_MODE = 0xD1 // FIQ mode +MODE_MASK = 0x1F // Mode mask +THUMB_MASK = 0x20 // Thumb bit mask +IRQ_MODE_BITS = 0x12 // IRQ mode bits + + + .global _tx_thread_system_state + .global _tx_thread_current_ptr + .global _tx_thread_system_stack_ptr + .global _tx_thread_execute_ptr + .global _tx_timer_time_slice + .global _tx_thread_schedule + .global _tx_thread_preempt_disable + .global _tx_execution_isr_exit + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_restore + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_context_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function restores the fiq interrupt context when processing a */ +/* nested interrupt. If not, it returns to the interrupt thread if no */ +/* preemption is necessary. Otherwise, if preemption is necessary or */ +/* if no thread was running, the function returns to the scheduler. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling routine */ +/* */ +/* CALLED BY */ +/* */ +/* FIQ ISR Interrupt Service Routines */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_fiq_context_restore + .type _tx_thread_fiq_context_restore,function +_tx_thread_fiq_context_restore: + + /* Lockout interrupts. */ + + CPSID if // Disable IRQ and FIQ interrupts + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR exit function to indicate an ISR is complete. */ + + BL _tx_execution_isr_exit // Call the ISR exit function +#endif + + /* Determine if interrupts are nested. */ + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + SUB r2, r2, #1 // Decrement the counter + STR r2, [r3] // Store the counter + CMP r2, #0 // Was this the first interrupt? + BEQ __tx_thread_fiq_not_nested_restore // If so, not a nested restore + + /* Interrupts are nested. */ + + /* Just recover the saved registers and return to the point of + interrupt. */ + + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_fiq_not_nested_restore: + + /* Determine if a thread was interrupted and no preemption is required. */ + + LDR r1, [sp] // Pickup the saved SPSR + MOV r2, #MODE_MASK // Build mask to isolate the interrupted mode + AND r1, r1, r2 // Isolate mode bits + CMP r1, #IRQ_MODE_BITS // Was an interrupt taken in IRQ mode before we + // got to context save? */ + BEQ __tx_thread_fiq_no_preempt_restore // Yes, just go back to point of interrupt + + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup actual current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_fiq_idle_system_restore // Yes, idle system was interrupted + + LDR r3, =_tx_thread_preempt_disable // Pickup preempt disable address + LDR r2, [r3] // Pickup actual preempt disable flag + CMP r2, #0 // Is it set? + BNE __tx_thread_fiq_no_preempt_restore // Yes, don't preempt this thread + LDR r3, =_tx_thread_execute_ptr // Pickup address of execute thread ptr + LDR r2, [r3] // Pickup actual execute thread pointer + CMP r0, r2 // Is the same thread highest priority? + BNE __tx_thread_fiq_preempt_restore // No, preemption needs to happen + + +__tx_thread_fiq_no_preempt_restore: + + /* Restore interrupted thread or ISR. */ + /* Recover the saved context and return to the point of interrupt. */ + + LDMIA sp!, {r0, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_fiq_preempt_restore: + + LDMIA sp!, {r3, lr} // Recover temporarily saved registers + MOV r1, lr // Save lr (point of interrupt) + MOV r2, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r2 // Enter SVC mode + STR r1, [sp, #-4]! // Save point of interrupt + STMDB sp!, {r4-r12, lr} // Save upper half of registers + MOV r4, r3 // Save SPSR in r4 + MOV r2, #FIQ_MODE // Build FIQ mode CPSR + MSR CPSR_c, r2 // Reenter FIQ mode + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOV r5, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r5 // Enter SVC mode + STMDB sp!, {r0-r3} // Save r0-r3 on thread's stack + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer + +#ifdef TX_ENABLE_VFP_SUPPORT + LDR r2, [r0, #144] // Pickup the VFP enabled flag + CMP r2, #0 // Is the VFP enabled? + BEQ _tx_skip_fiq_vfp_save // No, skip VFP IRQ save + VMRS r2, FPSCR // Pickup the FPSCR + STR r2, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D0-D15} // Save D0-D15 +_tx_skip_fiq_vfp_save: +#endif + + MOV r3, #1 // Build interrupt stack type + STMDB sp!, {r3, r4} // Save interrupt stack type and SPSR + STR sp, [r0, #8] // Save stack pointer in thread control + // block */ + LDR r3, =_tx_timer_time_slice // Pickup time-slice variable address + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it active? + BEQ __tx_thread_fiq_dont_save_ts // No, don't save it + + STR r2, [r0, #24] // Save thread's time-slice + MOV r2, #0 // Clear value + STR r2, [r3] // Disable global time-slice flag + +__tx_thread_fiq_dont_save_ts: + + /* Clear the current task pointer. */ + + MOV r0, #0 // NULL value + STR r0, [r1] // Clear current thread pointer + + /* Return to the scheduler. */ + + B _tx_thread_schedule // Return to scheduler + +__tx_thread_fiq_idle_system_restore: + + /* Just return back to the scheduler! */ + + ADD sp, sp, #24 // Recover FIQ stack space + MOV r3, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r3 // Lockout interrupts + B _tx_thread_schedule // Return to scheduler + diff --git a/ports/cortex_a12/ac6/src/tx_thread_fiq_context_save.S b/ports/cortex_a12/ac6/src/tx_thread_fiq_context_save.S new file mode 100644 index 00000000..7db6a4c2 --- /dev/null +++ b/ports/cortex_a12/ac6/src/tx_thread_fiq_context_save.S @@ -0,0 +1,178 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .global _tx_thread_system_state + .global _tx_thread_current_ptr + .global __tx_fiq_processing_return + .global _tx_execution_isr_enter + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_save + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_fiq_context_save + .type _tx_thread_fiq_context_save,function +_tx_thread_fiq_context_save: + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + + STMDB sp!, {r0-r3} // Save some working registers + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_fiq_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + + /* Save the rest of the scratch registers on the stack and return to the + calling ISR. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, r10, r12, lr} // Store other registers + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + B __tx_fiq_processing_return // Continue FIQ processing +// +__tx_thread_fiq_not_nested_save: + + /* Otherwise, not nested, check to see if a thread was running. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_fiq_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + + /* Save minimal context of interrupted thread. */ + + MRS r2, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r2, lr} // Store other registers, Note that we don't + // need to save sl and ip since FIQ has + // copies of these registers. Nested + // interrupt processing does need to save + // these registers. + + MOV r10, #0 // Clear stack limit + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + B __tx_fiq_processing_return // Continue FIQ processing + +__tx_thread_fiq_idle_system_save: + + /* Interrupt occurred in the scheduling loop. */ + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + /* Not much to do here, save the current SPSR and LR for possible + use in IRQ interrupted in idle system conditions, and return to + FIQ interrupt processing. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, lr} // Store other registers that will get used + // or stripped off the stack in context + // restore + B __tx_fiq_processing_return // Continue FIQ processing diff --git a/ports/cortex_a12/ac6/src/tx_thread_fiq_nesting_end.S b/ports/cortex_a12/ac6/src/tx_thread_fiq_nesting_end.S new file mode 100644 index 00000000..b34d881e --- /dev/null +++ b/ports/cortex_a12/ac6/src/tx_thread_fiq_nesting_end.S @@ -0,0 +1,104 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +#ifdef TX_ENABLE_FIQ_SUPPORT +DISABLE_INTS = 0xC0 // Disable IRQ/FIQ interrupts +#else +DISABLE_INTS = 0x80 // Disable IRQ interrupts +#endif +MODE_MASK = 0x1F // Mode mask +FIQ_MODE_BITS = 0x11 // FIQ mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_end + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_nesting_end ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from FIQ mode after */ +/* _tx_thread_fiq_nesting_start has been called and switches the FIQ */ +/* processing from system mode back to FIQ mode prior to the ISR */ +/* calling _tx_thread_fiq_context_restore. Note that this function */ +/* assumes the system stack pointer is in the same position after */ +/* nesting start function was called. */ +/* */ +/* This function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with FIQ interrupts disabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_fiq_nesting_end + .type _tx_thread_fiq_nesting_end,function +_tx_thread_fiq_nesting_end: + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + ORR r0, r0, #DISABLE_INTS // Build disable interrupt value + MSR CPSR_c, r0 // Disable interrupts + LDMIA sp!, {r1, lr} // Pickup saved lr (and r1 throw-away for + // 8-byte alignment logic) + BIC r0, r0, #MODE_MASK // Clear mode bits + ORR r0, r0, #FIQ_MODE_BITS // Build IRQ mode CPSR + MSR CPSR_c, r0 // Reenter IRQ mode + +#ifdef __THUMB_INTERWORK + BX r3 // Return to caller +#else + MOV pc, r3 // Return to caller +#endif diff --git a/ports/cortex_a12/ac6/src/tx_thread_fiq_nesting_start.S b/ports/cortex_a12/ac6/src/tx_thread_fiq_nesting_start.S new file mode 100644 index 00000000..c9cd5a06 --- /dev/null +++ b/ports/cortex_a12/ac6/src/tx_thread_fiq_nesting_start.S @@ -0,0 +1,96 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +FIQ_DISABLE = 0x40 // FIQ disable bit +MODE_MASK = 0x1F // Mode mask +SYS_MODE_BITS = 0x1F // System mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_start + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_nesting_start ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from FIQ mode after */ +/* _tx_thread_fiq_context_save has been called and switches the FIQ */ +/* processing to the system mode so nested FIQ interrupt processing */ +/* is possible (system mode has its own "lr" register). Note that */ +/* this function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with FIQ interrupts enabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_fiq_nesting_start + .type _tx_thread_fiq_nesting_start,function +_tx_thread_fiq_nesting_start: + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + BIC r0, r0, #MODE_MASK // Clear the mode bits + ORR r0, r0, #SYS_MODE_BITS // Build system mode CPSR + MSR CPSR_c, r0 // Enter system mode + STMDB sp!, {r1, lr} // Push the system mode lr on the system mode stack + // and push r1 just to keep 8-byte alignment + BIC r0, r0, #FIQ_DISABLE // Build enable FIQ CPSR + MSR CPSR_c, r0 // Enter system mode +#ifdef __THUMB_INTERWORK + BX r3 // Return to caller +#else + MOV pc, r3 // Return to caller +#endif diff --git a/ports/cortex_a12/ac6/src/tx_thread_interrupt_control.S b/ports/cortex_a12/ac6/src/tx_thread_interrupt_control.S new file mode 100644 index 00000000..63b1609a --- /dev/null +++ b/ports/cortex_a12/ac6/src/tx_thread_interrupt_control.S @@ -0,0 +1,104 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +INT_MASK = 0x03F + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_control for + applications calling this function from to 16-bit Thumb mode. */ + + .text + .align 2 + .global $_tx_thread_interrupt_control +$_tx_thread_interrupt_control: + .thumb + BX pc // Switch to 32-bit mode + NOP // + .arm + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_control // Call _tx_thread_interrupt_control function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_control ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for changing the interrupt lockout */ +/* posture of the system. */ +/* */ +/* INPUT */ +/* */ +/* new_posture New interrupt lockout posture */ +/* */ +/* OUTPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_interrupt_control + .type _tx_thread_interrupt_control,function +_tx_thread_interrupt_control: + + /* Pickup current interrupt lockout posture. */ + + MRS r3, CPSR // Pickup current CPSR + MOV r2, #INT_MASK // Build interrupt mask + AND r1, r3, r2 // Clear interrupt lockout bits + ORR r1, r1, r0 // Or-in new interrupt lockout bits + + /* Apply the new interrupt posture. */ + + MSR CPSR_c, r1 // Setup new CPSR + BIC r0, r3, r2 // Return previous interrupt mask +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a12/ac6/src/tx_thread_interrupt_disable.S b/ports/cortex_a12/ac6/src/tx_thread_interrupt_disable.S new file mode 100644 index 00000000..13258808 --- /dev/null +++ b/ports/cortex_a12/ac6/src/tx_thread_interrupt_disable.S @@ -0,0 +1,101 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_disable for + applications calling this function from to 16-bit Thumb mode. */ + + .text + .align 2 + .global $_tx_thread_interrupt_disable +$_tx_thread_interrupt_disable: + .thumb + BX pc // Switch to 32-bit mode + NOP // + .arm + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_disable // Call _tx_thread_interrupt_disable function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_disable ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for disabling interrupts */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_interrupt_disable + .type _tx_thread_interrupt_disable,function +_tx_thread_interrupt_disable: + + /* Pickup current interrupt lockout posture. */ + + MRS r0, CPSR // Pickup current CPSR + + /* Mask interrupts. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Disable IRQ and FIQ +#else + CPSID i // Disable IRQ +#endif + +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a12/ac6/src/tx_thread_interrupt_restore.S b/ports/cortex_a12/ac6/src/tx_thread_interrupt_restore.S new file mode 100644 index 00000000..2d582511 --- /dev/null +++ b/ports/cortex_a12/ac6/src/tx_thread_interrupt_restore.S @@ -0,0 +1,93 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_restore for + applications calling this function from to 16-bit Thumb mode. */ + + .text + .align 2 + .global $_tx_thread_interrupt_restore +$_tx_thread_interrupt_restore: + .thumb + BX pc // Switch to 32-bit mode + NOP // + .arm + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_restore // Call _tx_thread_interrupt_restore function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for restoring interrupts to the state */ +/* returned by a previous _tx_thread_interrupt_disable call. */ +/* */ +/* INPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_interrupt_restore + .type _tx_thread_interrupt_restore,function +_tx_thread_interrupt_restore: + + /* Apply the new interrupt posture. */ + + MSR CPSR_c, r0 // Setup new CPSR +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a12/ac6/src/tx_thread_irq_nesting_end.S b/ports/cortex_a12/ac6/src/tx_thread_irq_nesting_end.S new file mode 100644 index 00000000..ec7e63c6 --- /dev/null +++ b/ports/cortex_a12/ac6/src/tx_thread_irq_nesting_end.S @@ -0,0 +1,103 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +#ifdef TX_ENABLE_FIQ_SUPPORT +DISABLE_INTS = 0xC0 // Disable IRQ/FIQ interrupts +#else +DISABLE_INTS = 0x80 // Disable IRQ interrupts +#endif +MODE_MASK = 0x1F // Mode mask +IRQ_MODE_BITS = 0x12 // IRQ mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_end + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_irq_nesting_end ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from IRQ mode after */ +/* _tx_thread_irq_nesting_start has been called and switches the IRQ */ +/* processing from system mode back to IRQ mode prior to the ISR */ +/* calling _tx_thread_context_restore. Note that this function */ +/* assumes the system stack pointer is in the same position after */ +/* nesting start function was called. */ +/* */ +/* This function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with IRQ interrupts disabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_irq_nesting_end + .type _tx_thread_irq_nesting_end,function +_tx_thread_irq_nesting_end: + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + ORR r0, r0, #DISABLE_INTS // Build disable interrupt value + MSR CPSR_c, r0 // Disable interrupts + LDMIA sp!, {r1, lr} // Pickup saved lr (and r1 throw-away for + // 8-byte alignment logic) + BIC r0, r0, #MODE_MASK // Clear mode bits + ORR r0, r0, #IRQ_MODE_BITS // Build IRQ mode CPSR + MSR CPSR_c, r0 // Reenter IRQ mode +#ifdef __THUMB_INTERWORK + BX r3 // Return to caller +#else + MOV pc, r3 // Return to caller +#endif diff --git a/ports/cortex_a12/ac6/src/tx_thread_irq_nesting_start.S b/ports/cortex_a12/ac6/src/tx_thread_irq_nesting_start.S new file mode 100644 index 00000000..c69976ed --- /dev/null +++ b/ports/cortex_a12/ac6/src/tx_thread_irq_nesting_start.S @@ -0,0 +1,96 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +IRQ_DISABLE = 0x80 // IRQ disable bit +MODE_MASK = 0x1F // Mode mask +SYS_MODE_BITS = 0x1F // System mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_start + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_irq_nesting_start ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from IRQ mode after */ +/* _tx_thread_context_save has been called and switches the IRQ */ +/* processing to the system mode so nested IRQ interrupt processing */ +/* is possible (system mode has its own "lr" register). Note that */ +/* this function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with IRQ interrupts enabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_irq_nesting_start + .type _tx_thread_irq_nesting_start,function +_tx_thread_irq_nesting_start: + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + BIC r0, r0, #MODE_MASK // Clear the mode bits + ORR r0, r0, #SYS_MODE_BITS // Build system mode CPSR + MSR CPSR_c, r0 // Enter system mode + STMDB sp!, {r1, lr} // Push the system mode lr on the system mode stack + // and push r1 just to keep 8-byte alignment + BIC r0, r0, #IRQ_DISABLE // Build enable IRQ CPSR + MSR CPSR_c, r0 // Enter system mode +#ifdef __THUMB_INTERWORK + BX r3 // Return to caller +#else + MOV pc, r3 // Return to caller +#endif diff --git a/ports/cortex_a12/ac6/src/tx_thread_schedule.S b/ports/cortex_a12/ac6/src/tx_thread_schedule.S new file mode 100644 index 00000000..8330e9df --- /dev/null +++ b/ports/cortex_a12/ac6/src/tx_thread_schedule.S @@ -0,0 +1,230 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .global _tx_thread_execute_ptr + .global _tx_thread_current_ptr + .global _tx_timer_time_slice + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_schedule for + applications calling this function from to 16-bit Thumb mode. */ + + .text + .align 2 + .global $_tx_thread_schedule + .type $_tx_thread_schedule,function +$_tx_thread_schedule: + .thumb + BX pc // Switch to 32-bit mode + NOP // + .arm + STMFD sp!, {lr} // Save return address + BL _tx_thread_schedule // Call _tx_thread_schedule function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_schedule ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function waits for a thread control block pointer to appear in */ +/* the _tx_thread_execute_ptr variable. Once a thread pointer appears */ +/* in the variable, the corresponding thread is resumed. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_initialize_kernel_enter ThreadX entry function */ +/* _tx_thread_system_return Return to system from thread */ +/* _tx_thread_context_restore Restore thread's context */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_schedule + .type _tx_thread_schedule,function +_tx_thread_schedule: + + /* Enable interrupts. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSIE if // Enable IRQ and FIQ interrupts +#else + CPSIE i // Enable IRQ interrupts +#endif + + /* Wait for a thread to execute. */ + LDR r1, =_tx_thread_execute_ptr // Address of thread execute ptr + +__tx_thread_schedule_loop: + + LDR r0, [r1] // Pickup next thread to execute + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_schedule_loop // If so, keep looking for a thread + /* Yes! We have a thread to execute. Lockout interrupts and + transfer control to it. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Disable IRQ and FIQ interrupts +#else + CPSID i // Disable IRQ interrupts +#endif + + /* Setup the current thread pointer. */ + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread + STR r0, [r1] // Setup current thread pointer + + /* Increment the run count for this thread. */ + + LDR r2, [r0, #4] // Pickup run counter + LDR r3, [r0, #24] // Pickup time-slice for this thread + ADD r2, r2, #1 // Increment thread run-counter + STR r2, [r0, #4] // Store the new run counter + + /* Setup time-slice, if present. */ + + LDR r2, =_tx_timer_time_slice // Pickup address of time-slice + // variable + LDR sp, [r0, #8] // Switch stack pointers + STR r3, [r2] // Setup time-slice + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the thread entry function to indicate the thread is executing. */ + + MOV r5, r0 // Save r0 + BL _tx_execution_thread_enter // Call the thread execution enter function + MOV r0, r5 // Restore r0 +#endif + + /* Determine if an interrupt frame or a synchronous task suspension frame + is present. */ + + LDMIA sp!, {r4, r5} // Pickup the stack type and saved CPSR + CMP r4, #0 // Check for synchronous context switch + BEQ _tx_solicited_return + MSR SPSR_cxsf, r5 // Setup SPSR for return +#ifdef TX_ENABLE_VFP_SUPPORT + LDR r1, [r0, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_interrupt_vfp_restore // No, skip VFP interrupt restore + VLDMIA sp!, {D0-D15} // Recover D0-D15 + VLDMIA sp!, {D16-D31} // Recover D16-D31 + LDR r4, [sp], #4 // Pickup FPSCR + VMSR FPSCR, r4 // Restore FPSCR +_tx_skip_interrupt_vfp_restore: +#endif + LDMIA sp!, {r0-r12, lr, pc}^ // Return to point of thread interrupt + +_tx_solicited_return: + +#ifdef TX_ENABLE_VFP_SUPPORT + LDR r1, [r0, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_solicited_vfp_restore // No, skip VFP solicited restore + VLDMIA sp!, {D8-D15} // Recover D8-D15 + VLDMIA sp!, {D16-D31} // Recover D16-D31 + LDR r4, [sp], #4 // Pickup FPSCR + VMSR FPSCR, r4 // Restore FPSCR +_tx_skip_solicited_vfp_restore: +#endif + MSR CPSR_cxsf, r5 // Recover CPSR + LDMIA sp!, {r4-r11, lr} // Return to thread synchronously +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif + +#ifdef TX_ENABLE_VFP_SUPPORT + + .global tx_thread_vfp_enable + .type tx_thread_vfp_enable,function +tx_thread_vfp_enable: + MRS r2, CPSR // Pickup the CPSR +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Enable IRQ and FIQ interrupts +#else + CPSID i // Enable IRQ interrupts +#endif + LDR r0, =_tx_thread_current_ptr // Build current thread pointer address + LDR r1, [r0] // Pickup current thread pointer + CMP r1, #0 // Check for NULL thread pointer + BEQ __tx_no_thread_to_enable // If NULL, skip VFP enable + MOV r0, #1 // Build enable value + STR r0, [r1, #144] // Set the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) +__tx_no_thread_to_enable: + MSR CPSR_cxsf, r2 // Recover CPSR + BX LR // Return to caller + + .global tx_thread_vfp_disable + .type tx_thread_vfp_disable,function +tx_thread_vfp_disable: + MRS r2, CPSR // Pickup the CPSR +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Enable IRQ and FIQ interrupts +#else + CPSID i // Enable IRQ interrupts +#endif + LDR r0, =_tx_thread_current_ptr // Build current thread pointer address + LDR r1, [r0] // Pickup current thread pointer + CMP r1, #0 // Check for NULL thread pointer + BEQ __tx_no_thread_to_disable // If NULL, skip VFP disable + MOV r0, #0 // Build disable value + STR r0, [r1, #144] // Clear the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) +__tx_no_thread_to_disable: + MSR CPSR_cxsf, r2 // Recover CPSR + BX LR // Return to caller + +#endif diff --git a/ports/cortex_a12/ac6/src/tx_thread_stack_build.S b/ports/cortex_a12/ac6/src/tx_thread_stack_build.S new file mode 100644 index 00000000..f413e673 --- /dev/null +++ b/ports/cortex_a12/ac6/src/tx_thread_stack_build.S @@ -0,0 +1,164 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .arm + +SVC_MODE = 0x13 // SVC mode +#ifdef TX_ENABLE_FIQ_SUPPORT +CPSR_MASK = 0xDF // Mask initial CPSR, IRQ & FIQ interrupts enabled +#else +CPSR_MASK = 0x9F // Mask initial CPSR, IRQ interrupts enabled +#endif + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_stack_build for + applications calling this function from to 16-bit Thumb mode. */ + + .text + .align 2 + .thumb + .global $_tx_thread_stack_build + .type $_tx_thread_stack_build,function +$_tx_thread_stack_build: + BX pc // Switch to 32-bit mode + NOP // + .arm + STMFD sp!, {lr} // Save return address + BL _tx_thread_stack_build // Call _tx_thread_stack_build function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_stack_build ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function builds a stack frame on the supplied thread's stack. */ +/* The stack frame results in a fake interrupt return to the supplied */ +/* function pointer. */ +/* */ +/* INPUT */ +/* */ +/* thread_ptr Pointer to thread control blk */ +/* function_ptr Pointer to return function */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_thread_create Create thread service */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_stack_build + .type _tx_thread_stack_build,function +_tx_thread_stack_build: + + + /* Build a fake interrupt frame. The form of the fake interrupt stack + on the ARMv7-A should look like the following after it is built: + + Stack Top: 1 Interrupt stack frame type + CPSR Initial value for CPSR + a1 (r0) Initial value for a1 + a2 (r1) Initial value for a2 + a3 (r2) Initial value for a3 + a4 (r3) Initial value for a4 + v1 (r4) Initial value for v1 + v2 (r5) Initial value for v2 + v3 (r6) Initial value for v3 + v4 (r7) Initial value for v4 + v5 (r8) Initial value for v5 + sb (r9) Initial value for sb + sl (r10) Initial value for sl + fp (r11) Initial value for fp + ip (r12) Initial value for ip + lr (r14) Initial value for lr + pc (r15) Initial value for + 0 For stack backtracing + + Stack Bottom: (higher memory address) */ + + LDR r2, [r0, #16] // Pickup end of stack area + BIC r2, r2, #7 // Ensure 8-byte alignment + SUB r2, r2, #76 // Allocate space for the stack frame + + /* Actually build the stack frame. */ + + MOV r3, #1 // Build interrupt stack type + STR r3, [r2, #0] // Store stack type + MOV r3, #0 // Build initial register value + STR r3, [r2, #8] // Store initial r0 + STR r3, [r2, #12] // Store initial r1 + STR r3, [r2, #16] // Store initial r2 + STR r3, [r2, #20] // Store initial r3 + STR r3, [r2, #24] // Store initial r4 + STR r3, [r2, #28] // Store initial r5 + STR r3, [r2, #32] // Store initial r6 + STR r3, [r2, #36] // Store initial r7 + STR r3, [r2, #40] // Store initial r8 + STR r3, [r2, #44] // Store initial r9 + LDR r3, [r0, #12] // Pickup stack starting address + STR r3, [r2, #48] // Store initial r10 (sl) + LDR r3,=_tx_thread_schedule // Pickup address of _tx_thread_schedule for GDB backtrace + STR r3, [r2, #60] // Store initial r14 (lr) + MOV r3, #0 // Build initial register value + STR r3, [r2, #52] // Store initial r11 + STR r3, [r2, #56] // Store initial r12 + STR r1, [r2, #64] // Store initial pc + STR r3, [r2, #68] // 0 for back-trace + MRS r1, CPSR // Pickup CPSR + BIC r1, r1, #CPSR_MASK // Mask mode bits of CPSR + ORR r3, r1, #SVC_MODE // Build CPSR, SVC mode, interrupts enabled + STR r3, [r2, #4] // Store initial CPSR + + /* Setup stack pointer. */ + + STR r2, [r0, #8] // Save stack pointer in thread's + // control block +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a12/ac6/src/tx_thread_system_return.S b/ports/cortex_a12/ac6/src/tx_thread_system_return.S new file mode 100644 index 00000000..cb7d62ce --- /dev/null +++ b/ports/cortex_a12/ac6/src/tx_thread_system_return.S @@ -0,0 +1,162 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .arm + + + .global _tx_thread_current_ptr + .global _tx_timer_time_slice + .global _tx_thread_schedule + + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_system_return for + applications calling this function from to 16-bit Thumb mode. */ + + .text + .align 2 + .global $_tx_thread_system_return + .type $_tx_thread_system_return,function +$_tx_thread_system_return: + .thumb + BX pc // Switch to 32-bit mode + NOP // + .arm + STMFD sp!, {lr} // Save return address + BL _tx_thread_system_return // Call _tx_thread_system_return function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_system_return ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is target processor specific. It is used to transfer */ +/* control from a thread back to the ThreadX system. Only a */ +/* minimal context is saved since the compiler assumes temp registers */ +/* are going to get slicked by a function call anyway. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling loop */ +/* */ +/* CALLED BY */ +/* */ +/* ThreadX components */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_system_return + .type _tx_thread_system_return,function +_tx_thread_system_return: + + /* Save minimal context on the stack. */ + + STMDB sp!, {r4-r11, lr} // Save minimal context + + LDR r4, =_tx_thread_current_ptr // Pickup address of current ptr + LDR r5, [r4] // Pickup current thread pointer + +#ifdef TX_ENABLE_VFP_SUPPORT + LDR r1, [r5, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_solicited_vfp_save // No, skip VFP solicited save + VMRS r1, FPSCR // Pickup the FPSCR + STR r1, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D8-D15} // Save D8-D15 +_tx_skip_solicited_vfp_save: +#endif + + MOV r0, #0 // Build a solicited stack type + MRS r1, CPSR // Pickup the CPSR + STMDB sp!, {r0-r1} // Save type and CPSR + + /* Lockout interrupts. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Disable IRQ and FIQ interrupts +#else + CPSID i // Disable IRQ interrupts +#endif + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the thread exit function to indicate the thread is no longer executing. */ + + BL _tx_execution_thread_exit // Call the thread exit function +#endif + MOV r3, r4 // Pickup address of current ptr + MOV r0, r5 // Pickup current thread pointer + LDR r2, =_tx_timer_time_slice // Pickup address of time slice + LDR r1, [r2] // Pickup current time slice + + /* Save current stack and switch to system stack. */ + + STR sp, [r0, #8] // Save thread stack pointer + + /* Determine if the time-slice is active. */ + + MOV r4, #0 // Build clear value + CMP r1, #0 // Is a time-slice active? + BEQ __tx_thread_dont_save_ts // No, don't save the time-slice + + /* Save time-slice for the thread and clear the current time-slice. */ + + STR r4, [r2] // Clear time-slice + STR r1, [r0, #24] // Save current time-slice + +__tx_thread_dont_save_ts: + + /* Clear the current thread pointer. */ + + STR r4, [r3] // Clear current thread pointer + B _tx_thread_schedule // Jump to scheduler! diff --git a/ports/cortex_a12/ac6/src/tx_thread_vectored_context_save.S b/ports/cortex_a12/ac6/src/tx_thread_vectored_context_save.S new file mode 100644 index 00000000..d846223f --- /dev/null +++ b/ports/cortex_a12/ac6/src/tx_thread_vectored_context_save.S @@ -0,0 +1,165 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .global _tx_thread_system_state + .global _tx_thread_current_ptr + .global _tx_execution_isr_enter + + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_vectored_context_save + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_vectored_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_vectored_context_save + .type _tx_thread_vectored_context_save,function +_tx_thread_vectored_context_save: + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Disable IRQ and FIQ interrupts +#endif + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3, #0] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3, #0] // Store it back in the variable + + /* Note: Minimal context of interrupted thread is already saved. */ + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + MOV pc, lr // Return to caller + +__tx_thread_not_nested_save: + + /* Otherwise, not nested, check to see if a thread was running. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3, #0] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1, #0] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + /* Note: Minimal context of interrupted thread is already saved. */ + + /* Save the current stack pointer in the thread's control block. */ + + MOV r10, #0 // Clear stack limit + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + MOV pc, lr // Return to caller + +__tx_thread_idle_system_save: + + /* Interrupt occurred in the scheduling loop. */ + + /* Not much to do here, just adjust the stack pointer, and return to IRQ + processing. */ + + MOV r10, #0 // Clear stack limit + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + ADD sp, sp, #32 // Recover saved registers + MOV pc, lr // Return to caller diff --git a/ports/cortex_a12/ac6/src/tx_timer_interrupt.S b/ports/cortex_a12/ac6/src/tx_timer_interrupt.S new file mode 100644 index 00000000..7337ed0c --- /dev/null +++ b/ports/cortex_a12/ac6/src/tx_timer_interrupt.S @@ -0,0 +1,231 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Timer */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .arm + + +/* Define Assembly language external references... */ + + .global _tx_timer_time_slice + .global _tx_timer_system_clock + .global _tx_timer_current_ptr + .global _tx_timer_list_start + .global _tx_timer_list_end + .global _tx_timer_expired_time_slice + .global _tx_timer_expired + .global _tx_thread_time_slice + + + +/* Define the 16-bit Thumb mode veneer for _tx_timer_interrupt for + applications calling this function from to 16-bit Thumb mode. */ + + .text + .align 2 + .thumb + .global $_tx_timer_interrupt + .type $_tx_timer_interrupt,function +$_tx_timer_interrupt: + BX pc // Switch to 32-bit mode + NOP // + .arm + STMFD sp!, {lr} // Save return address + BL _tx_timer_interrupt // Call _tx_timer_interrupt function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_timer_interrupt ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function processes the hardware timer interrupt. This */ +/* processing includes incrementing the system clock and checking for */ +/* time slice and/or timer expiration. If either is found, the */ +/* interrupt context save/restore functions are called along with the */ +/* expiration functions. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_time_slice Time slice interrupted thread */ +/* _tx_timer_expiration_process Timer expiration processing */ +/* */ +/* CALLED BY */ +/* */ +/* interrupt vector */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_timer_interrupt + .type _tx_timer_interrupt,function +_tx_timer_interrupt: + + /* Upon entry to this routine, it is assumed that context save has already + been called, and therefore the compiler scratch registers are available + for use. */ + + /* Increment the system clock. */ + + LDR r1, =_tx_timer_system_clock // Pickup address of system clock + LDR r0, [r1] // Pickup system clock + ADD r0, r0, #1 // Increment system clock + STR r0, [r1] // Store new system clock + + /* Test for time-slice expiration. */ + + LDR r3, =_tx_timer_time_slice // Pickup address of time-slice + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it non-active? + BEQ __tx_timer_no_time_slice // Yes, skip time-slice processing + + /* Decrement the time_slice. */ + + SUB r2, r2, #1 // Decrement the time-slice + STR r2, [r3] // Store new time-slice value + + /* Check for expiration. */ + + CMP r2, #0 // Has it expired? + BNE __tx_timer_no_time_slice // No, skip expiration processing + + /* Set the time-slice expired flag. */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of expired flag + MOV r0, #1 // Build expired value + STR r0, [r3] // Set time-slice expiration flag + +__tx_timer_no_time_slice: + + /* Test for timer expiration. */ + + LDR r1, =_tx_timer_current_ptr // Pickup current timer pointer address + LDR r0, [r1] // Pickup current timer + LDR r2, [r0] // Pickup timer list entry + CMP r2, #0 // Is there anything in the list? + BEQ __tx_timer_no_timer // No, just increment the timer + + /* Set expiration flag. */ + + LDR r3, =_tx_timer_expired // Pickup expiration flag address + MOV r2, #1 // Build expired value + STR r2, [r3] // Set expired flag + B __tx_timer_done // Finished timer processing + +__tx_timer_no_timer: + + /* No timer expired, increment the timer pointer. */ + ADD r0, r0, #4 // Move to next timer + + /* Check for wraparound. */ + + LDR r3, =_tx_timer_list_end // Pickup address of timer list end + LDR r2, [r3] // Pickup list end + CMP r0, r2 // Are we at list end? + BNE __tx_timer_skip_wrap // No, skip wraparound logic + + /* Wrap to beginning of list. */ + + LDR r3, =_tx_timer_list_start // Pickup address of timer list start + LDR r0, [r3] // Set current pointer to list start + +__tx_timer_skip_wrap: + + STR r0, [r1] // Store new current timer pointer + +__tx_timer_done: + + /* See if anything has expired. */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of expired flag + LDR r2, [r3] // Pickup time-slice expired flag + CMP r2, #0 // Did a time-slice expire? + BNE __tx_something_expired // If non-zero, time-slice expired + LDR r1, =_tx_timer_expired // Pickup address of other expired flag + LDR r0, [r1] // Pickup timer expired flag + CMP r0, #0 // Did a timer expire? + BEQ __tx_timer_nothing_expired // No, nothing expired + +__tx_something_expired: + + STMDB sp!, {r0, lr} // Save the lr register on the stack + // and save r0 just to keep 8-byte alignment + + /* Did a timer expire? */ + + LDR r1, =_tx_timer_expired // Pickup address of expired flag + LDR r0, [r1] // Pickup timer expired flag + CMP r0, #0 // Check for timer expiration + BEQ __tx_timer_dont_activate // If not set, skip timer activation + + /* Process timer expiration. */ + BL _tx_timer_expiration_process // Call the timer expiration handling routine + +__tx_timer_dont_activate: + + /* Did time slice expire? */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of time-slice expired + LDR r2, [r3] // Pickup the actual flag + CMP r2, #0 // See if the flag is set + BEQ __tx_timer_not_ts_expiration // No, skip time-slice processing + + /* Time slice interrupted thread. */ + + BL _tx_thread_time_slice // Call time-slice processing + +__tx_timer_not_ts_expiration: + + LDMIA sp!, {r0, lr} // Recover lr register (r0 is just there for + // the 8-byte stack alignment + +__tx_timer_nothing_expired: + +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a12/gnu/example_build/build_threadx.bat b/ports/cortex_a12/gnu/example_build/build_threadx.bat new file mode 100644 index 00000000..d3898b30 --- /dev/null +++ b/ports/cortex_a12/gnu/example_build/build_threadx.bat @@ -0,0 +1,238 @@ +del tx.a +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 tx_initialize_low_level.S +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 ../src/tx_thread_stack_build.S +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 ../src/tx_thread_schedule.S +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 ../src/tx_thread_system_return.S +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 ../src/tx_thread_context_save.S +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 ../src/tx_thread_context_restore.S +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 ../src/tx_thread_interrupt_control.S +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 ../src/tx_timer_interrupt.S +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 ../src/tx_thread_interrupt_disable.S +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 ../src/tx_thread_interrupt_restore.S +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 ../src/tx_thread_fiq_context_save.S +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 ../src/tx_thread_fiq_nesting_start.S +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 ../src/tx_thread_irq_nesting_start.S +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 ../src/tx_thread_irq_nesting_end.S +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 ../src/tx_thread_fiq_nesting_end.S +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 ../src/tx_thread_fiq_context_restore.S +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 ../src/tx_thread_vectored_context_save.S +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_block_allocate.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_block_pool_cleanup.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_block_pool_create.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_block_pool_delete.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_block_pool_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_block_pool_initialize.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_block_pool_performance_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_block_pool_performance_system_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_block_pool_prioritize.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_block_release.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_byte_allocate.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_byte_pool_cleanup.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_byte_pool_create.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_byte_pool_delete.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_byte_pool_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_byte_pool_initialize.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_byte_pool_performance_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_byte_pool_performance_system_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_byte_pool_prioritize.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_byte_pool_search.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_byte_release.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_event_flags_cleanup.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_event_flags_create.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_event_flags_delete.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_event_flags_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_event_flags_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_event_flags_initialize.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_event_flags_performance_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_event_flags_performance_system_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_event_flags_set.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_event_flags_set_notify.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_initialize_high_level.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_initialize_kernel_enter.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_initialize_kernel_setup.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_mutex_cleanup.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_mutex_create.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_mutex_delete.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_mutex_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_mutex_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_mutex_initialize.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_mutex_performance_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_mutex_performance_system_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_mutex_prioritize.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_mutex_priority_change.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_mutex_put.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_queue_cleanup.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_queue_create.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_queue_delete.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_queue_flush.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_queue_front_send.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_queue_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_queue_initialize.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_queue_performance_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_queue_performance_system_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_queue_prioritize.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_queue_receive.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_queue_send.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_queue_send_notify.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_semaphore_ceiling_put.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_semaphore_cleanup.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_semaphore_create.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_semaphore_delete.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_semaphore_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_semaphore_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_semaphore_initialize.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_semaphore_performance_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_semaphore_performance_system_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_semaphore_prioritize.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_semaphore_put.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_semaphore_put_notify.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_create.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_delete.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_entry_exit_notify.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_identify.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_initialize.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_performance_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_performance_system_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_preemption_change.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_priority_change.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_relinquish.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_reset.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_resume.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_shell_entry.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_sleep.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_stack_analyze.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_stack_error_handler.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_stack_error_notify.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_suspend.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_system_preempt_check.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_system_resume.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_system_suspend.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_terminate.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_time_slice.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_time_slice_change.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_timeout.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_wait_abort.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_time_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_time_set.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_timer_activate.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_timer_change.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_timer_create.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_timer_deactivate.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_timer_delete.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_timer_expiration_process.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_timer_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_timer_initialize.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_timer_performance_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_timer_performance_system_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_timer_system_activate.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_timer_system_deactivate.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_timer_thread_entry.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_trace_enable.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_trace_disable.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_trace_initialize.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_trace_interrupt_control.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_trace_isr_enter_insert.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_trace_isr_exit_insert.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_trace_object_register.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_trace_object_unregister.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_trace_user_event_insert.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_trace_buffer_full_notify.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_trace_event_filter.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/tx_trace_event_unfilter.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_block_allocate.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_block_pool_create.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_block_pool_delete.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_block_pool_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_block_pool_prioritize.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_block_release.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_byte_allocate.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_byte_pool_create.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_byte_pool_delete.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_byte_pool_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_byte_pool_prioritize.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_byte_release.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_event_flags_create.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_event_flags_delete.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_event_flags_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_event_flags_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_event_flags_set.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_event_flags_set_notify.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_mutex_create.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_mutex_delete.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_mutex_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_mutex_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_mutex_prioritize.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_mutex_put.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_queue_create.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_queue_delete.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_queue_flush.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_queue_front_send.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_queue_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_queue_prioritize.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_queue_receive.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_queue_send.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_queue_send_notify.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_semaphore_ceiling_put.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_semaphore_create.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_semaphore_delete.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_semaphore_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_semaphore_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_semaphore_prioritize.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_semaphore_put.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_semaphore_put_notify.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_thread_create.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_thread_delete.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_thread_entry_exit_notify.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_thread_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_thread_preemption_change.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_thread_priority_change.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_thread_relinquish.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_thread_reset.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_thread_resume.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_thread_suspend.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_thread_terminate.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_thread_time_slice_change.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_thread_wait_abort.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_timer_activate.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_timer_change.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_timer_create.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_timer_deactivate.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_timer_delete.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc ../../../../common/src/txe_timer_info_get.c +arm-none-eabi-ar -r tx.a tx_thread_stack_build.o tx_thread_schedule.o tx_thread_system_return.o tx_thread_context_save.o tx_thread_context_restore.o tx_timer_interrupt.o tx_thread_interrupt_control.o +arm-none-eabi-ar -r tx.a tx_thread_interrupt_disable.o tx_thread_interrupt_restore.o tx_thread_fiq_context_save.o tx_thread_fiq_nesting_start.o tx_thread_irq_nesting_start.o tx_thread_irq_nesting_end.o +arm-none-eabi-ar -r tx.a tx_thread_fiq_nesting_end.o tx_thread_fiq_context_restore.o tx_thread_vectored_context_save.o tx_initialize_low_level.o +arm-none-eabi-ar -r tx.a tx_block_allocate.o tx_block_pool_cleanup.o tx_block_pool_create.o tx_block_pool_delete.o tx_block_pool_info_get.o +arm-none-eabi-ar -r tx.a tx_block_pool_initialize.o tx_block_pool_performance_info_get.o tx_block_pool_performance_system_info_get.o tx_block_pool_prioritize.o +arm-none-eabi-ar -r tx.a tx_block_release.o tx_byte_allocate.o tx_byte_pool_cleanup.o tx_byte_pool_create.o tx_byte_pool_delete.o tx_byte_pool_info_get.o +arm-none-eabi-ar -r tx.a tx_byte_pool_initialize.o tx_byte_pool_performance_info_get.o tx_byte_pool_performance_system_info_get.o tx_byte_pool_prioritize.o +arm-none-eabi-ar -r tx.a tx_byte_pool_search.o tx_byte_release.o tx_event_flags_cleanup.o tx_event_flags_create.o tx_event_flags_delete.o tx_event_flags_get.o +arm-none-eabi-ar -r tx.a tx_event_flags_info_get.o tx_event_flags_initialize.o tx_event_flags_performance_info_get.o tx_event_flags_performance_system_info_get.o +arm-none-eabi-ar -r tx.a tx_event_flags_set.o tx_event_flags_set_notify.o tx_initialize_high_level.o tx_initialize_kernel_enter.o tx_initialize_kernel_setup.o +arm-none-eabi-ar -r tx.a tx_mutex_cleanup.o tx_mutex_create.o tx_mutex_delete.o tx_mutex_get.o tx_mutex_info_get.o tx_mutex_initialize.o tx_mutex_performance_info_get.o +arm-none-eabi-ar -r tx.a tx_mutex_performance_system_info_get.o tx_mutex_prioritize.o tx_mutex_priority_change.o tx_mutex_put.o tx_queue_cleanup.o tx_queue_create.o +arm-none-eabi-ar -r tx.a tx_queue_delete.o tx_queue_flush.o tx_queue_front_send.o tx_queue_info_get.o tx_queue_initialize.o tx_queue_performance_info_get.o +arm-none-eabi-ar -r tx.a tx_queue_performance_system_info_get.o tx_queue_prioritize.o tx_queue_receive.o tx_queue_send.o tx_queue_send_notify.o tx_semaphore_ceiling_put.o +arm-none-eabi-ar -r tx.a tx_semaphore_cleanup.o tx_semaphore_create.o tx_semaphore_delete.o tx_semaphore_get.o tx_semaphore_info_get.o tx_semaphore_initialize.o +arm-none-eabi-ar -r tx.a tx_semaphore_performance_info_get.o tx_semaphore_performance_system_info_get.o tx_semaphore_prioritize.o tx_semaphore_put.o tx_semaphore_put_notify.o +arm-none-eabi-ar -r tx.a tx_thread_create.o tx_thread_delete.o tx_thread_entry_exit_notify.o tx_thread_identify.o tx_thread_info_get.o tx_thread_initialize.o +arm-none-eabi-ar -r tx.a tx_thread_performance_info_get.o tx_thread_performance_system_info_get.o tx_thread_preemption_change.o tx_thread_priority_change.o tx_thread_relinquish.o +arm-none-eabi-ar -r tx.a tx_thread_reset.o tx_thread_resume.o tx_thread_shell_entry.o tx_thread_sleep.o tx_thread_stack_analyze.o tx_thread_stack_error_handler.o +arm-none-eabi-ar -r tx.a tx_thread_stack_error_notify.o tx_thread_suspend.o tx_thread_system_preempt_check.o tx_thread_system_resume.o tx_thread_system_suspend.o +arm-none-eabi-ar -r tx.a tx_thread_terminate.o tx_thread_time_slice.o tx_thread_time_slice_change.o tx_thread_timeout.o tx_thread_wait_abort.o tx_time_get.o +arm-none-eabi-ar -r tx.a tx_time_set.o tx_timer_activate.o tx_timer_change.o tx_timer_create.o tx_timer_deactivate.o tx_timer_delete.o tx_timer_expiration_process.o +arm-none-eabi-ar -r tx.a tx_timer_info_get.o tx_timer_initialize.o tx_timer_performance_info_get.o tx_timer_performance_system_info_get.o tx_timer_system_activate.o +arm-none-eabi-ar -r tx.a tx_timer_system_deactivate.o tx_timer_thread_entry.o tx_trace_enable.o tx_trace_disable.o tx_trace_initialize.o tx_trace_interrupt_control.o +arm-none-eabi-ar -r tx.a tx_trace_isr_enter_insert.o tx_trace_isr_exit_insert.o tx_trace_object_register.o tx_trace_object_unregister.o tx_trace_user_event_insert.o +arm-none-eabi-ar -r tx.a tx_trace_buffer_full_notify.o tx_trace_event_filter.o tx_trace_event_unfilter.o +arm-none-eabi-ar -r tx.a txe_block_allocate.o txe_block_pool_create.o txe_block_pool_delete.o txe_block_pool_info_get.o txe_block_pool_prioritize.o txe_block_release.o +arm-none-eabi-ar -r tx.a txe_byte_allocate.o txe_byte_pool_create.o txe_byte_pool_delete.o txe_byte_pool_info_get.o txe_byte_pool_prioritize.o txe_byte_release.o +arm-none-eabi-ar -r tx.a txe_event_flags_create.o txe_event_flags_delete.o txe_event_flags_get.o txe_event_flags_info_get.o txe_event_flags_set.o +arm-none-eabi-ar -r tx.a txe_event_flags_set_notify.o txe_mutex_create.o txe_mutex_delete.o txe_mutex_get.o txe_mutex_info_get.o txe_mutex_prioritize.o +arm-none-eabi-ar -r tx.a txe_mutex_put.o txe_queue_create.o txe_queue_delete.o txe_queue_flush.o txe_queue_front_send.o txe_queue_info_get.o txe_queue_prioritize.o +arm-none-eabi-ar -r tx.a txe_queue_receive.o txe_queue_send.o txe_queue_send_notify.o txe_semaphore_ceiling_put.o txe_semaphore_create.o txe_semaphore_delete.o +arm-none-eabi-ar -r tx.a txe_semaphore_get.o txe_semaphore_info_get.o txe_semaphore_prioritize.o txe_semaphore_put.o txe_semaphore_put_notify.o txe_thread_create.o +arm-none-eabi-ar -r tx.a txe_thread_delete.o txe_thread_entry_exit_notify.o txe_thread_info_get.o txe_thread_preemption_change.o txe_thread_priority_change.o +arm-none-eabi-ar -r tx.a txe_thread_relinquish.o txe_thread_reset.o txe_thread_resume.o txe_thread_suspend.o txe_thread_terminate.o txe_thread_time_slice_change.o +arm-none-eabi-ar -r tx.a txe_thread_wait_abort.o txe_timer_activate.o txe_timer_change.o txe_timer_create.o txe_timer_deactivate.o txe_timer_delete.o txe_timer_info_get.o diff --git a/ports/cortex_a12/gnu/example_build/build_threadx_sample.bat b/ports/cortex_a12/gnu/example_build/build_threadx_sample.bat new file mode 100644 index 00000000..d6716da1 --- /dev/null +++ b/ports/cortex_a12/gnu/example_build/build_threadx_sample.bat @@ -0,0 +1,6 @@ +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 reset.S +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 crt0.S +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 tx_initialize_low_level.S +arm-none-eabi-gcc -c -g -mcpu=cortex-a12 -I../../../../common/inc -I../inc sample_threadx.c +arm-none-eabi-gcc -g -mcpu=cortex-a12 -T sample_threadx.ld --specs=nosys.specs -o sample_threadx.out -Wl,-Map=sample_threadx.map tx_initialize_low_level.o sample_threadx.o tx.a + diff --git a/ports/cortex_a12/gnu/example_build/crt0.S b/ports/cortex_a12/gnu/example_build/crt0.S new file mode 100644 index 00000000..56b6c958 --- /dev/null +++ b/ports/cortex_a12/gnu/example_build/crt0.S @@ -0,0 +1,90 @@ + +/* .text is used instead of .section .text so it works with arm-aout too. */ + .text + .code 32 + .align 0 + + .global _mainCRTStartup + .global _start + .global start +start: +_start: +_mainCRTStartup: + +/* Start by setting up a stack */ + /* Set up the stack pointer to a fixed value */ + ldr r3, .LC0 + mov sp, r3 + /* Setup a default stack-limit in case the code has been + compiled with "-mapcs-stack-check". Hard-wiring this value + is not ideal, since there is currently no support for + checking that the heap and stack have not collided, or that + this default 64k is enough for the program being executed. + However, it ensures that this simple crt0 world will not + immediately cause an overflow event: */ + sub sl, sp, #64 << 10 /* Still assumes 256bytes below sl */ + mov a2, #0 /* Second arg: fill value */ + mov fp, a2 /* Null frame pointer */ + mov r7, a2 /* Null frame pointer for Thumb */ + + ldr a1, .LC1 /* First arg: start of memory block */ + ldr a3, .LC2 + sub a3, a3, a1 /* Third arg: length of block */ + + + + bl memset + mov r0, #0 /* no arguments */ + mov r1, #0 /* no argv either */ +#ifdef __USES_INITFINI__ + /* Some arm/elf targets use the .init and .fini sections + to create constructors and destructors, and for these + targets we need to call the _init function and arrange + for _fini to be called at program exit. */ + mov r4, r0 + mov r5, r1 +/* ldr r0, .Lfini */ + bl atexit +/* bl init */ + mov r0, r4 + mov r1, r5 +#endif + bl main + + bl exit /* Should not return. */ + + + /* For Thumb, constants must be after the code since only + positive offsets are supported for PC relative addresses. */ + + .align 0 +.LC0: +.LC1: + .word __bss_start__ +.LC2: + .word __bss_end__ +/* +#ifdef __USES_INITFINI__ +.Lfini: + .word _fini +#endif */ + /* Return ... */ +#ifdef __APCS_26__ + movs pc, lr +#else +#ifdef __THUMB_INTERWORK + bx lr +#else + mov pc, lr +#endif +#endif + + +/* Workspace for Angel calls. */ + .data +/* Data returned by monitor SWI. */ +.global __stack_base__ +HeapBase: .word 0 +HeapLimit: .word 0 +__stack_base__: .word 0 +StackLimit: .word 0 diff --git a/ports/cortex_a12/gnu/example_build/reset.S b/ports/cortex_a12/gnu/example_build/reset.S new file mode 100644 index 00000000..597e9d9a --- /dev/null +++ b/ports/cortex_a12/gnu/example_build/reset.S @@ -0,0 +1,64 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Initialize */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .arm + + .global _start + .global __tx_undefined + .global __tx_swi_interrupt + .global __tx_prefetch_handler + .global __tx_abort_handler + .global __tx_reserved_handler + .global __tx_irq_handler + .global __tx_fiq_handler + +/* Define the vector area. This should be located or copied to 0. */ + + .text + .global __vectors +__vectors: + + LDR pc, STARTUP // Reset goes to startup function + LDR pc, UNDEFINED // Undefined handler + LDR pc, SWI // Software interrupt handler + LDR pc, PREFETCH // Prefetch exception handler + LDR pc, ABORT // Abort exception handler + LDR pc, RESERVED // Reserved exception handler + LDR pc, IRQ // IRQ interrupt handler + LDR pc, FIQ // FIQ interrupt handler + +STARTUP: + .word _start // Reset goes to C startup function +UNDEFINED: + .word __tx_undefined // Undefined handler +SWI: + .word __tx_swi_interrupt // Software interrupt handler +PREFETCH: + .word __tx_prefetch_handler // Prefetch exception handler +ABORT: + .word __tx_abort_handler // Abort exception handler +RESERVED: + .word __tx_reserved_handler // Reserved exception handler +IRQ: + .word __tx_irq_handler // IRQ interrupt handler +FIQ: + .word __tx_fiq_handler // FIQ interrupt handler diff --git a/ports/cortex_a12/gnu/example_build/sample_threadx.c b/ports/cortex_a12/gnu/example_build/sample_threadx.c new file mode 100644 index 00000000..8c61de06 --- /dev/null +++ b/ports/cortex_a12/gnu/example_build/sample_threadx.c @@ -0,0 +1,369 @@ +/* This is a small demo of the high-performance ThreadX kernel. It includes examples of eight + threads of different priorities, using a message queue, semaphore, mutex, event flags group, + byte pool, and block pool. */ + +#include "tx_api.h" + +#define DEMO_STACK_SIZE 1024 +#define DEMO_BYTE_POOL_SIZE 9120 +#define DEMO_BLOCK_POOL_SIZE 100 +#define DEMO_QUEUE_SIZE 100 + + +/* Define the ThreadX object control blocks... */ + +TX_THREAD thread_0; +TX_THREAD thread_1; +TX_THREAD thread_2; +TX_THREAD thread_3; +TX_THREAD thread_4; +TX_THREAD thread_5; +TX_THREAD thread_6; +TX_THREAD thread_7; +TX_QUEUE queue_0; +TX_SEMAPHORE semaphore_0; +TX_MUTEX mutex_0; +TX_EVENT_FLAGS_GROUP event_flags_0; +TX_BYTE_POOL byte_pool_0; +TX_BLOCK_POOL block_pool_0; + + +/* Define the counters used in the demo application... */ + +ULONG thread_0_counter; +ULONG thread_1_counter; +ULONG thread_1_messages_sent; +ULONG thread_2_counter; +ULONG thread_2_messages_received; +ULONG thread_3_counter; +ULONG thread_4_counter; +ULONG thread_5_counter; +ULONG thread_6_counter; +ULONG thread_7_counter; + + +/* Define thread prototypes. */ + +void thread_0_entry(ULONG thread_input); +void thread_1_entry(ULONG thread_input); +void thread_2_entry(ULONG thread_input); +void thread_3_and_4_entry(ULONG thread_input); +void thread_5_entry(ULONG thread_input); +void thread_6_and_7_entry(ULONG thread_input); + + +/* Define main entry point. */ + +int main() +{ + + /* Enter the ThreadX kernel. */ + tx_kernel_enter(); +} + + +/* Define what the initial system looks like. */ + +void tx_application_define(void *first_unused_memory) +{ + +CHAR *pointer = TX_NULL; + + + /* Create a byte memory pool from which to allocate the thread stacks. */ + tx_byte_pool_create(&byte_pool_0, "byte pool 0", first_unused_memory, DEMO_BYTE_POOL_SIZE); + + /* Put system definition stuff in here, e.g. thread creates and other assorted + create information. */ + + /* Allocate the stack for thread 0. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 1, 1, TX_NO_TIME_SLICE, TX_AUTO_START); + + + /* Allocate the stack for thread 1. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create threads 1 and 2. These threads pass information through a ThreadX + message queue. It is also interesting to note that these threads have a time + slice. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, DEMO_STACK_SIZE, + 16, 16, 4, TX_AUTO_START); + + /* Allocate the stack for thread 2. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, DEMO_STACK_SIZE, + 16, 16, 4, TX_AUTO_START); + + /* Allocate the stack for thread 3. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create threads 3 and 4. These threads compete for a ThreadX counting semaphore. + An interesting thing here is that both threads share the same instruction area. */ + tx_thread_create(&thread_3, "thread 3", thread_3_and_4_entry, 3, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 4. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + tx_thread_create(&thread_4, "thread 4", thread_3_and_4_entry, 4, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 5. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create thread 5. This thread simply pends on an event flag which will be set + by thread_0. */ + tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 6. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create threads 6 and 7. These threads compete for a ThreadX mutex. */ + tx_thread_create(&thread_6, "thread 6", thread_6_and_7_entry, 6, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 7. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + tx_thread_create(&thread_7, "thread 7", thread_6_and_7_entry, 7, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the message queue. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_QUEUE_SIZE*sizeof(ULONG), TX_NO_WAIT); + + /* Create the message queue shared by threads 1 and 2. */ + tx_queue_create(&queue_0, "queue 0", TX_1_ULONG, pointer, DEMO_QUEUE_SIZE*sizeof(ULONG)); + + /* Create the semaphore used by threads 3 and 4. */ + tx_semaphore_create(&semaphore_0, "semaphore 0", 1); + + /* Create the event flags group used by threads 1 and 5. */ + tx_event_flags_create(&event_flags_0, "event flags 0"); + + /* Create the mutex used by thread 6 and 7 without priority inheritance. */ + tx_mutex_create(&mutex_0, "mutex 0", TX_NO_INHERIT); + + /* Allocate the memory for a small block pool. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_BLOCK_POOL_SIZE, TX_NO_WAIT); + + /* Create a block memory pool to allocate a message buffer from. */ + tx_block_pool_create(&block_pool_0, "block pool 0", sizeof(ULONG), pointer, DEMO_BLOCK_POOL_SIZE); + + /* Allocate a block and release the block memory. */ + tx_block_allocate(&block_pool_0, (VOID **) &pointer, TX_NO_WAIT); + + /* Release the block back to the pool. */ + tx_block_release(pointer); +} + + + +/* Define the test threads. */ + +void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + + /* This thread simply sits in while-forever-sleep loop. */ + while(1) + { + + /* Increment the thread counter. */ + thread_0_counter++; + + /* Sleep for 10 ticks. */ + tx_thread_sleep(10); + + /* Set event flag 0 to wakeup thread 5. */ + status = tx_event_flags_set(&event_flags_0, 0x1, TX_OR); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + } +} + + +void thread_1_entry(ULONG thread_input) +{ + +UINT status; + + + /* This thread simply sends messages to a queue shared by thread 2. */ + while(1) + { + + /* Increment the thread counter. */ + thread_1_counter++; + + /* Send message to queue 0. */ + status = tx_queue_send(&queue_0, &thread_1_messages_sent, TX_WAIT_FOREVER); + + /* Check completion status. */ + if (status != TX_SUCCESS) + break; + + /* Increment the message sent. */ + thread_1_messages_sent++; + } +} + + +void thread_2_entry(ULONG thread_input) +{ + +ULONG received_message; +UINT status; + + /* This thread retrieves messages placed on the queue by thread 1. */ + while(1) + { + + /* Increment the thread counter. */ + thread_2_counter++; + + /* Retrieve a message from the queue. */ + status = tx_queue_receive(&queue_0, &received_message, TX_WAIT_FOREVER); + + /* Check completion status and make sure the message is what we + expected. */ + if ((status != TX_SUCCESS) || (received_message != thread_2_messages_received)) + break; + + /* Otherwise, all is okay. Increment the received message count. */ + thread_2_messages_received++; + } +} + + +void thread_3_and_4_entry(ULONG thread_input) +{ + +UINT status; + + + /* This function is executed from thread 3 and thread 4. As the loop + below shows, these function compete for ownership of semaphore_0. */ + while(1) + { + + /* Increment the thread counter. */ + if (thread_input == 3) + thread_3_counter++; + else + thread_4_counter++; + + /* Get the semaphore with suspension. */ + status = tx_semaphore_get(&semaphore_0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Sleep for 2 ticks to hold the semaphore. */ + tx_thread_sleep(2); + + /* Release the semaphore. */ + status = tx_semaphore_put(&semaphore_0); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + } +} + + +void thread_5_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_flags; + + + /* This thread simply waits for an event in a forever loop. */ + while(1) + { + + /* Increment the thread counter. */ + thread_5_counter++; + + /* Wait for event flag 0. */ + status = tx_event_flags_get(&event_flags_0, 0x1, TX_OR_CLEAR, + &actual_flags, TX_WAIT_FOREVER); + + /* Check status. */ + if ((status != TX_SUCCESS) || (actual_flags != 0x1)) + break; + } +} + + +void thread_6_and_7_entry(ULONG thread_input) +{ + +UINT status; + + + /* This function is executed from thread 6 and thread 7. As the loop + below shows, these function compete for ownership of mutex_0. */ + while(1) + { + + /* Increment the thread counter. */ + if (thread_input == 6) + thread_6_counter++; + else + thread_7_counter++; + + /* Get the mutex with suspension. */ + status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Get the mutex again with suspension. This shows + that an owning thread may retrieve the mutex it + owns multiple times. */ + status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Sleep for 2 ticks to hold the mutex. */ + tx_thread_sleep(2); + + /* Release the mutex. */ + status = tx_mutex_put(&mutex_0); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Release the mutex again. This will actually + release ownership since it was obtained twice. */ + status = tx_mutex_put(&mutex_0); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + } +} diff --git a/ports/cortex_a12/gnu/example_build/sample_threadx.ld b/ports/cortex_a12/gnu/example_build/sample_threadx.ld new file mode 100644 index 00000000..3dea4e1c --- /dev/null +++ b/ports/cortex_a12/gnu/example_build/sample_threadx.ld @@ -0,0 +1,239 @@ +OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", + "elf32-littlearm") +OUTPUT_ARCH(arm) +/* ENTRY(_start) */ +/* Do we need any of these for elf? + __DYNAMIC = 0; */ +SECTIONS +{ + . = 0x00000000; + + .vectors : {reset.o(.text) } + + /* Read-only sections, merged into text segment: */ + . = 0x00001000; + .interp : { *(.interp) } + .hash : { *(.hash) } + .dynsym : { *(.dynsym) } + .dynstr : { *(.dynstr) } + .gnu.version : { *(.gnu.version) } + .gnu.version_d : { *(.gnu.version_d) } + .gnu.version_r : { *(.gnu.version_r) } + .rel.init : { *(.rel.init) } + .rela.init : { *(.rela.init) } + .rel.text : + { + *(.rel.text) + *(.rel.text.*) + *(.rel.gnu.linkonce.t*) + } + .rela.text : + { + *(.rela.text) + *(.rela.text.*) + *(.rela.gnu.linkonce.t*) + } + .rel.fini : { *(.rel.fini) } + .rela.fini : { *(.rela.fini) } + .rel.rodata : + { + *(.rel.rodata) + *(.rel.rodata.*) + *(.rel.gnu.linkonce.r*) + } + .rela.rodata : + { + *(.rela.rodata) + *(.rela.rodata.*) + *(.rela.gnu.linkonce.r*) + } + .rel.data : + { + *(.rel.data) + *(.rel.data.*) + *(.rel.gnu.linkonce.d*) + } + .rela.data : + { + *(.rela.data) + *(.rela.data.*) + *(.rela.gnu.linkonce.d*) + } + .rel.ctors : { *(.rel.ctors) } + .rela.ctors : { *(.rela.ctors) } + .rel.dtors : { *(.rel.dtors) } + .rela.dtors : { *(.rela.dtors) } + .rel.got : { *(.rel.got) } + .rela.got : { *(.rela.got) } + .rel.sdata : + { + *(.rel.sdata) + *(.rel.sdata.*) + *(.rel.gnu.linkonce.s*) + } + .rela.sdata : + { + *(.rela.sdata) + *(.rela.sdata.*) + *(.rela.gnu.linkonce.s*) + } + .rel.sbss : { *(.rel.sbss) } + .rela.sbss : { *(.rela.sbss) } + .rel.bss : { *(.rel.bss) } + .rela.bss : { *(.rela.bss) } + .rel.plt : { *(.rel.plt) } + .rela.plt : { *(.rela.plt) } + .plt : { *(.plt) } + .text : + { + *(.text) + *(.text.*) + *(.stub) + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + *(.gnu.linkonce.t*) + *(.glue_7t) *(.glue_7) + } =0 + .init : + { + KEEP (*(.init)) + } =0 + _etext = .; + PROVIDE (etext = .); + .fini : + { + KEEP (*(.fini)) + } =0 + .rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r*) } + .rodata1 : { *(.rodata1) } + .eh_frame_hdr : { *(.eh_frame_hdr) } + /* Adjust the address for the data segment. We want to adjust up to + the same address within the page on the next page up. */ + . = ALIGN(256) + (. & (256 - 1)); + .data : + { + *(.data) + *(.data.*) + *(.gnu.linkonce.d*) + SORT(CONSTRUCTORS) + } + .data1 : { *(.data1) } + .eh_frame : { KEEP (*(.eh_frame)) } + .gcc_except_table : { *(.gcc_except_table) } + .ctors : + { + /* gcc uses crtbegin.o to find the start of + the constructors, so we make sure it is + first. Because this is a wildcard, it + doesn't matter if the user does not + actually link against crtbegin.o; the + linker won't look for a file to match a + wildcard. The wildcard also means that it + doesn't matter which directory crtbegin.o + is in. */ + KEEP (*crtbegin.o(.ctors)) + /* We don't want to include the .ctor section from + from the crtend.o file until after the sorted ctors. + The .ctor section from the crtend file contains the + end of ctors marker and it must be last */ + KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*(.ctors)) + } + .dtors : + { + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*(.dtors)) + } + .jcr : { KEEP (*(.jcr)) } + .got : { *(.got.plt) *(.got) } + .dynamic : { *(.dynamic) } + /* We want the small data sections together, so single-instruction offsets + can access them all, and initialized data all before uninitialized, so + we can shorten the on-disk segment size. */ + .sdata : + { + *(.sdata) + *(.sdata.*) + *(.gnu.linkonce.s.*) + } + _edata = .; + PROVIDE (edata = .); + __bss_start = .; + __bss_start__ = .; + .sbss : + { + *(.dynsbss) + *(.sbss) + *(.sbss.*) + *(.scommon) + } + .bss : + { + *(.dynbss) + *(.bss) + *(.bss.*) + *(COMMON) + /* Align here to ensure that the .bss section occupies space up to + _end. Align after .bss to ensure correct alignment even if the + .bss section disappears because there are no input sections. */ + . = ALIGN(32 / 8); + } + . = ALIGN(32 / 8); + + _bss_end__ = . ; __bss_end__ = . ; + PROVIDE (end = .); + + .stack : + { + + _stack_bottom = ABSOLUTE(.) ; + + /* Allocate room for stack. This must be big enough for the IRQ, FIQ, and + SYS stack if nested interrupts are enabled. */ + . = ALIGN(8) ; + . += 4096 ; + _sp = . - 16 ; + _stack_top = ABSOLUTE(.) ; + } + + _end = .; __end__ = . ; + + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + + /* These must appear regardless of . */ +} diff --git a/ports/cortex_a12/gnu/example_build/tx_initialize_low_level.S b/ports/cortex_a12/gnu/example_build/tx_initialize_low_level.S new file mode 100644 index 00000000..7de5d3ce --- /dev/null +++ b/ports/cortex_a12/gnu/example_build/tx_initialize_low_level.S @@ -0,0 +1,305 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Initialize */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .arm + +SVC_MODE = 0xD3 // Disable IRQ/FIQ SVC mode +IRQ_MODE = 0xD2 // Disable IRQ/FIQ IRQ mode +FIQ_MODE = 0xD1 // Disable IRQ/FIQ FIQ mode +SYS_MODE = 0xDF // Disable IRQ/FIQ SYS mode +FIQ_STACK_SIZE = 512 // FIQ stack size +IRQ_STACK_SIZE = 1024 // IRQ stack size +SYS_STACK_SIZE = 1024 // System stack size + + .global _tx_thread_system_stack_ptr + .global _tx_initialize_unused_memory + .global _tx_thread_context_save + .global _tx_thread_context_restore + .global _tx_timer_interrupt + .global _end + .global _sp + .global _stack_bottom + + +/* Define the 16-bit Thumb mode veneer for _tx_initialize_low_level for + applications calling this function from to 16-bit Thumb mode. */ + + .text + .align 2 + .thumb + .global $_tx_initialize_low_level + .type $_tx_initialize_low_level,function +$_tx_initialize_low_level: + BX pc // Switch to 32-bit mode + NOP // + .arm + STMFD sp!, {lr} // Save return address + BL _tx_initialize_low_level // Call _tx_initialize_low_level function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_initialize_low_level ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for any low-level processor */ +/* initialization, including setting up interrupt vectors, setting */ +/* up a periodic timer interrupt source, saving the system stack */ +/* pointer for use in ISR processing later, and finding the first */ +/* available RAM memory address for tx_application_define. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_initialize_kernel_enter ThreadX entry function */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_initialize_low_level + .type _tx_initialize_low_level,function +_tx_initialize_low_level: + + /* We must be in SVC mode at this point! */ + + /* Setup various stack pointers. */ + + LDR r1, =_sp // Get pointer to stack area + +#ifdef TX_ENABLE_IRQ_NESTING + + /* Setup the system mode stack for nested interrupt support */ + + LDR r2, =SYS_STACK_SIZE // Pickup stack size + MOV r3, #SYS_MODE // Build SYS mode CPSR + MSR CPSR_c, r3 // Enter SYS mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup SYS stack pointer + SUB r1, r1, r2 // Calculate start of next stack +#endif + + LDR r2, =FIQ_STACK_SIZE // Pickup stack size + MOV r0, #FIQ_MODE // Build FIQ mode CPSR + MSR CPSR, r0 // Enter FIQ mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup FIQ stack pointer + SUB r1, r1, r2 // Calculate start of next stack + LDR r2, =IRQ_STACK_SIZE // Pickup IRQ stack size + MOV r0, #IRQ_MODE // Build IRQ mode CPSR + MSR CPSR, r0 // Enter IRQ mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup IRQ stack pointer + SUB r3, r1, r2 // Calculate end of IRQ stack + MOV r0, #SVC_MODE // Build SVC mode CPSR + MSR CPSR, r0 // Enter SVC mode + LDR r2, =_stack_bottom // Pickup stack bottom + CMP r3, r2 // Compare the current stack end with the bottom +_stack_error_loop: + BLT _stack_error_loop // If the IRQ stack exceeds the stack bottom, just sit here! + + LDR r2, =_tx_thread_system_stack_ptr // Pickup stack pointer + STR r1, [r2] // Save the system stack + + LDR r1, =_end // Get end of non-initialized RAM area + LDR r2, =_tx_initialize_unused_memory // Pickup unused memory ptr address + ADD r1, r1, #8 // Increment to next free word + STR r1, [r2] // Save first free memory address + +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif + +/* Define shells for each of the interrupt vectors. */ + + .global __tx_undefined +__tx_undefined: + B __tx_undefined // Undefined handler + + .global __tx_swi_interrupt +__tx_swi_interrupt: + B __tx_swi_interrupt // Software interrupt handler + + .global __tx_prefetch_handler +__tx_prefetch_handler: + B __tx_prefetch_handler // Prefetch exception handler + + .global __tx_abort_handler +__tx_abort_handler: + B __tx_abort_handler // Abort exception handler + + .global __tx_reserved_handler +__tx_reserved_handler: + B __tx_reserved_handler // Reserved exception handler + + .global __tx_irq_handler + .global __tx_irq_processing_return +__tx_irq_handler: + + /* Jump to context save to save system context. */ + B _tx_thread_context_save +__tx_irq_processing_return: +// + /* At this point execution is still in the IRQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. In + addition, IRQ interrupts may be re-enabled - with certain restrictions - + if nested IRQ interrupts are desired. Interrupts may be re-enabled over + small code sequences where lr is saved before enabling interrupts and + restored after interrupts are again disabled. */ + + /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start + from IRQ mode with interrupts disabled. This routine switches to the + system mode and returns with IRQ interrupts enabled. + + NOTE: It is very important to ensure all IRQ interrupts are cleared + prior to enabling nested IRQ interrupts. */ +#ifdef TX_ENABLE_IRQ_NESTING + BL _tx_thread_irq_nesting_start +#endif + + /* For debug purpose, execute the timer interrupt processing here. In + a real system, some kind of status indication would have to be checked + before the timer interrupt handler could be called. */ + + BL _tx_timer_interrupt // Timer interrupt handler + + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_context_restore. + This routine returns in processing in IRQ mode with interrupts disabled. */ +#ifdef TX_ENABLE_IRQ_NESTING + BL _tx_thread_irq_nesting_end +#endif + + /* Jump to context restore to restore system context. */ + B _tx_thread_context_restore + + + /* This is an example of a vectored IRQ handler. */ + + + + /* Save initial context and call context save to prepare for + vectored ISR execution. */ + + /* At this point execution is still in the IRQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. In + addition, IRQ interrupts may be re-enabled - with certain restrictions - + if nested IRQ interrupts are desired. Interrupts may be re-enabled over + small code sequences where lr is saved before enabling interrupts and + restored after interrupts are again disabled. */ + + + /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start + from IRQ mode with interrupts disabled. This routine switches to the + system mode and returns with IRQ interrupts enabled. + + NOTE: It is very important to ensure all IRQ interrupts are cleared + prior to enabling nested IRQ interrupts. */ + + /* Application IRQ handlers can be called here! */ + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_context_restore. + This routine returns in processing in IRQ mode with interrupts disabled. */ + + + +#ifdef TX_ENABLE_FIQ_SUPPORT + .global __tx_fiq_handler + .global __tx_fiq_processing_return +__tx_fiq_handler: + + /* Jump to fiq context save to save system context. */ + B _tx_thread_fiq_context_save +__tx_fiq_processing_return: + + /* At this point execution is still in the FIQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. */ + + /* Interrupt nesting is allowed after calling _tx_thread_fiq_nesting_start + from FIQ mode with interrupts disabled. This routine switches to the + system mode and returns with FIQ interrupts enabled. + + NOTE: It is very important to ensure all FIQ interrupts are cleared + prior to enabling nested FIQ interrupts. */ +#ifdef TX_ENABLE_FIQ_NESTING + BL _tx_thread_fiq_nesting_start +#endif + + /* Application FIQ handlers can be called here! */ + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_fiq_context_restore. */ +#ifdef TX_ENABLE_FIQ_NESTING + BL _tx_thread_fiq_nesting_end +#endif + + /* Jump to fiq context restore to restore system context. */ + B _tx_thread_fiq_context_restore + + +#else + .global __tx_fiq_handler +__tx_fiq_handler: + B __tx_fiq_handler // FIQ interrupt handler +#endif + + +BUILD_OPTIONS: + .word _tx_build_options // Reference to bring in +VERSION_ID: + .word _tx_version_id // Reference to bring in + + + diff --git a/ports/cortex_a12/gnu/inc/tx_port.h b/ports/cortex_a12/gnu/inc/tx_port.h new file mode 100644 index 00000000..19463de1 --- /dev/null +++ b/ports/cortex_a12/gnu/inc/tx_port.h @@ -0,0 +1,328 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Port Specific */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* tx_port.h ARMv7-A */ +/* 6.1.11 */ +/* */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This file contains data type definitions that make the ThreadX */ +/* real-time kernel function identically on a variety of different */ +/* processor architectures. For example, the size or number of bits */ +/* in an "int" data type vary between microprocessor architectures and */ +/* even C compilers for the same microprocessor. ThreadX does not */ +/* directly use native C data types. Instead, ThreadX creates its */ +/* own special types that can be mapped to actual data types by this */ +/* file to guarantee consistency in the interface and functionality. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-02-2021 Bhupendra Naphade Modified comment(s),updated */ +/* macro definition, */ +/* resulting in version 6.1.6 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + +#ifndef TX_PORT_H +#define TX_PORT_H + + +/* Determine if the optional ThreadX user define file should be used. */ + +#ifdef TX_INCLUDE_USER_DEFINE_FILE + + +/* Yes, include the user defines in tx_user.h. The defines in this file may + alternately be defined on the command line. */ + +#include "tx_user.h" +#endif + + +/* Define compiler library include files. */ + +#include +#include + + +/* Define ThreadX basic types for this port. */ + +#define VOID void +typedef char CHAR; +typedef unsigned char UCHAR; +typedef int INT; +typedef unsigned int UINT; +typedef long LONG; +typedef unsigned long ULONG; +typedef short SHORT; +typedef unsigned short USHORT; + + +/* Define the priority levels for ThreadX. Legal values range + from 32 to 1024 and MUST be evenly divisible by 32. */ + +#ifndef TX_MAX_PRIORITIES +#define TX_MAX_PRIORITIES 32 +#endif + + +/* Define the minimum stack for a ThreadX thread on this processor. If the size supplied during + thread creation is less than this value, the thread create call will return an error. */ + +#ifndef TX_MINIMUM_STACK +#define TX_MINIMUM_STACK 200 /* Minimum stack size for this port */ +#endif + + +/* Define the system timer thread's default stack size and priority. These are only applicable + if TX_TIMER_PROCESS_IN_ISR is not defined. */ + +#ifndef TX_TIMER_THREAD_STACK_SIZE +#define TX_TIMER_THREAD_STACK_SIZE 1024 /* Default timer thread stack size */ +#endif + +#ifndef TX_TIMER_THREAD_PRIORITY +#define TX_TIMER_THREAD_PRIORITY 0 /* Default timer thread priority */ +#endif + + +/* Define various constants for the ThreadX ARM port. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT +#define TX_INT_DISABLE 0xC0 /* Disable IRQ & FIQ interrupts */ +#else +#define TX_INT_DISABLE 0x80 /* Disable IRQ interrupts */ +#endif +#define TX_INT_ENABLE 0x00 /* Enable IRQ interrupts */ + + +/* Define the clock source for trace event entry time stamp. The following two item are port specific. + For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock + source constants would be: + +#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_MASK 0x0000FFFFUL + +*/ + +#ifndef TX_TRACE_TIME_SOURCE +#define TX_TRACE_TIME_SOURCE ++_tx_trace_simulated_time +#endif +#ifndef TX_TRACE_TIME_MASK +#define TX_TRACE_TIME_MASK 0xFFFFFFFFUL +#endif + + +/* Define the port specific options for the _tx_build_options variable. This variable indicates + how the ThreadX library was built. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT +#define TX_FIQ_ENABLED 1 +#else +#define TX_FIQ_ENABLED 0 +#endif + +#ifdef TX_ENABLE_IRQ_NESTING +#define TX_IRQ_NESTING_ENABLED 2 +#else +#define TX_IRQ_NESTING_ENABLED 0 +#endif + +#ifdef TX_ENABLE_FIQ_NESTING +#define TX_FIQ_NESTING_ENABLED 4 +#else +#define TX_FIQ_NESTING_ENABLED 0 +#endif + +#define TX_PORT_SPECIFIC_BUILD_OPTIONS TX_FIQ_ENABLED | TX_IRQ_NESTING_ENABLED | TX_FIQ_NESTING_ENABLED + + +/* Define the in-line initialization constant so that modules with in-line + initialization capabilities can prevent their initialization from being + a function call. */ + +#define TX_INLINE_INITIALIZATION + + +/* Determine whether or not stack checking is enabled. By default, ThreadX stack checking is + disabled. When the following is defined, ThreadX thread stack checking is enabled. If stack + checking is enabled (TX_ENABLE_STACK_CHECKING is defined), the TX_DISABLE_STACK_FILLING + define is negated, thereby forcing the stack fill which is necessary for the stack checking + logic. */ + +#ifdef TX_ENABLE_STACK_CHECKING +#undef TX_DISABLE_STACK_FILLING +#endif + + +/* Define the TX_THREAD control block extensions for this port. The main reason + for the multiple macros is so that backward compatibility can be maintained with + existing ThreadX kernel awareness modules. */ + +#define TX_THREAD_EXTENSION_0 +#define TX_THREAD_EXTENSION_1 +#define TX_THREAD_EXTENSION_2 ULONG tx_thread_vfp_enable; +#define TX_THREAD_EXTENSION_3 + + +/* Define the port extensions of the remaining ThreadX objects. */ + +#define TX_BLOCK_POOL_EXTENSION +#define TX_BYTE_POOL_EXTENSION +#define TX_EVENT_FLAGS_GROUP_EXTENSION +#define TX_MUTEX_EXTENSION +#define TX_QUEUE_EXTENSION +#define TX_SEMAPHORE_EXTENSION +#define TX_TIMER_EXTENSION + + +/* Define the user extension field of the thread control block. Nothing + additional is needed for this port so it is defined as white space. */ + +#ifndef TX_THREAD_USER_EXTENSION +#define TX_THREAD_USER_EXTENSION +#endif + + +/* Define the macros for processing extensions in tx_thread_create, tx_thread_delete, + tx_thread_shell_entry, and tx_thread_terminate. */ + + +#define TX_THREAD_CREATE_EXTENSION(thread_ptr) +#define TX_THREAD_DELETE_EXTENSION(thread_ptr) +#define TX_THREAD_COMPLETED_EXTENSION(thread_ptr) +#define TX_THREAD_TERMINATED_EXTENSION(thread_ptr) + + +/* Define the ThreadX object creation extensions for the remaining objects. */ + +#define TX_BLOCK_POOL_CREATE_EXTENSION(pool_ptr) +#define TX_BYTE_POOL_CREATE_EXTENSION(pool_ptr) +#define TX_EVENT_FLAGS_GROUP_CREATE_EXTENSION(group_ptr) +#define TX_MUTEX_CREATE_EXTENSION(mutex_ptr) +#define TX_QUEUE_CREATE_EXTENSION(queue_ptr) +#define TX_SEMAPHORE_CREATE_EXTENSION(semaphore_ptr) +#define TX_TIMER_CREATE_EXTENSION(timer_ptr) + + +/* Define the ThreadX object deletion extensions for the remaining objects. */ + +#define TX_BLOCK_POOL_DELETE_EXTENSION(pool_ptr) +#define TX_BYTE_POOL_DELETE_EXTENSION(pool_ptr) +#define TX_EVENT_FLAGS_GROUP_DELETE_EXTENSION(group_ptr) +#define TX_MUTEX_DELETE_EXTENSION(mutex_ptr) +#define TX_QUEUE_DELETE_EXTENSION(queue_ptr) +#define TX_SEMAPHORE_DELETE_EXTENSION(semaphore_ptr) +#define TX_TIMER_DELETE_EXTENSION(timer_ptr) + + +/* Determine if the ARM architecture has the CLZ instruction. This is available on + architectures v5 and above. If available, redefine the macro for calculating the + lowest bit set. */ + +#if __TARGET_ARCH_ARM > 4 + +#ifndef __thumb__ + +#define TX_LOWEST_SET_BIT_CALCULATE(m, b) m = m & ((ULONG) (-((LONG) m))); \ + asm volatile (" CLZ %0,%1 ": "=r" (b) : "r" (m) ); \ + b = 31 - b; +#endif +#endif + + +/* Define ThreadX interrupt lockout and restore macros for protection on + access of critical kernel information. The restore interrupt macro must + restore the interrupt posture of the running thread prior to the value + present prior to the disable macro. In most cases, the save area macro + is used to define a local function save area for the disable and restore + macros. */ + +#ifdef __thumb__ + +unsigned int _tx_thread_interrupt_disable(void); +unsigned int _tx_thread_interrupt_restore(UINT old_posture); + + +#define TX_INTERRUPT_SAVE_AREA UINT interrupt_save; + +#define TX_DISABLE interrupt_save = _tx_thread_interrupt_disable(); +#define TX_RESTORE _tx_thread_interrupt_restore(interrupt_save); + +#else + +#define TX_INTERRUPT_SAVE_AREA UINT interrupt_save, tx_temp; + +#ifdef TX_ENABLE_FIQ_SUPPORT +#define TX_DISABLE asm volatile (" MRS %0,CPSR; CPSID if ": "=r" (interrupt_save) ); +#else +#define TX_DISABLE asm volatile (" MRS %0,CPSR; CPSID i ": "=r" (interrupt_save) ); +#endif + +#define TX_RESTORE asm volatile (" MSR CPSR_c,%0 "::"r" (interrupt_save) ); + +#endif + + +/* Define VFP extension for the ARMv7-A. Each is assumed to be called in the context of the executing + thread. */ + +void tx_thread_vfp_enable(void); +void tx_thread_vfp_disable(void); + + +/* Define the interrupt lockout macros for each ThreadX object. */ + +#define TX_BLOCK_POOL_DISABLE TX_DISABLE +#define TX_BYTE_POOL_DISABLE TX_DISABLE +#define TX_EVENT_FLAGS_GROUP_DISABLE TX_DISABLE +#define TX_MUTEX_DISABLE TX_DISABLE +#define TX_QUEUE_DISABLE TX_DISABLE +#define TX_SEMAPHORE_DISABLE TX_DISABLE + + +/* Define the version ID of ThreadX. This may be utilized by the application. */ + +#ifdef TX_THREAD_INIT +CHAR _tx_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX ARMv7-A Version 6.1.11 *"; +#else +extern CHAR _tx_version_id[]; +#endif + + +#endif + diff --git a/ports/cortex_a12/gnu/src/tx_thread_context_restore.S b/ports/cortex_a12/gnu/src/tx_thread_context_restore.S new file mode 100644 index 00000000..fae7e72d --- /dev/null +++ b/ports/cortex_a12/gnu/src/tx_thread_context_restore.S @@ -0,0 +1,222 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .arm + +#ifdef TX_ENABLE_FIQ_SUPPORT +SVC_MODE = 0xD3 // Disable IRQ/FIQ, SVC mode +IRQ_MODE = 0xD2 // Disable IRQ/FIQ, IRQ mode +#else +SVC_MODE = 0x93 // Disable IRQ, SVC mode +IRQ_MODE = 0x92 // Disable IRQ, IRQ mode +#endif + + .global _tx_thread_system_state + .global _tx_thread_current_ptr + .global _tx_thread_execute_ptr + .global _tx_timer_time_slice + .global _tx_thread_schedule + .global _tx_thread_preempt_disable + + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_restore + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_context_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function restores the interrupt context if it is processing a */ +/* nested interrupt. If not, it returns to the interrupt thread if no */ +/* preemption is necessary. Otherwise, if preemption is necessary or */ +/* if no thread was running, the function returns to the scheduler. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling routine */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs Interrupt Service Routines */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_context_restore + .type _tx_thread_context_restore,function +_tx_thread_context_restore: + + /* Lockout interrupts. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Disable IRQ and FIQ interrupts +#else + CPSID i // Disable IRQ interrupts +#endif + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR exit function to indicate an ISR is complete. */ + + BL _tx_execution_isr_exit // Call the ISR exit function +#endif + + /* Determine if interrupts are nested. */ + + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + SUB r2, r2, #1 // Decrement the counter + STR r2, [r3] // Store the counter + CMP r2, #0 // Was this the first interrupt? + BEQ __tx_thread_not_nested_restore // If so, not a nested restore + + /* Interrupts are nested. */ + + /* Just recover the saved registers and return to the point of + interrupt. */ + + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_not_nested_restore: + + /* Determine if a thread was interrupted and no preemption is required. */ + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup actual current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_restore // Yes, idle system was interrupted + + LDR r3, =_tx_thread_preempt_disable // Pickup preempt disable address + LDR r2, [r3] // Pickup actual preempt disable flag + CMP r2, #0 // Is it set? + BNE __tx_thread_no_preempt_restore // Yes, don't preempt this thread + LDR r3, =_tx_thread_execute_ptr // Pickup address of execute thread ptr + LDR r2, [r3] // Pickup actual execute thread pointer + CMP r0, r2 // Is the same thread highest priority? + BNE __tx_thread_preempt_restore // No, preemption needs to happen + + +__tx_thread_no_preempt_restore: + + /* Recover the saved context and return to the point of interrupt. */ + + /* Pickup the saved stack pointer. */ + + /* Recover the saved context and return to the point of interrupt. */ + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_preempt_restore: + + LDMIA sp!, {r3, r10, r12, lr} // Recover temporarily saved registers + MOV r1, lr // Save lr (point of interrupt) + MOV r2, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r2 // Enter SVC mode + STR r1, [sp, #-4]! // Save point of interrupt + STMDB sp!, {r4-r12, lr} // Save upper half of registers + MOV r4, r3 // Save SPSR in r4 + MOV r2, #IRQ_MODE // Build IRQ mode CPSR + MSR CPSR_c, r2 // Enter IRQ mode + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOV r5, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r5 // Enter SVC mode + STMDB sp!, {r0-r3} // Save r0-r3 on thread's stack + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer + +#ifdef TX_ENABLE_VFP_SUPPORT + LDR r2, [r0, #144] // Pickup the VFP enabled flag + CMP r2, #0 // Is the VFP enabled? + BEQ _tx_skip_irq_vfp_save // No, skip VFP IRQ save + VMRS r2, FPSCR // Pickup the FPSCR + STR r2, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D0-D15} // Save D0-D15 + +_tx_skip_irq_vfp_save: + +#endif + + MOV r3, #1 // Build interrupt stack type + STMDB sp!, {r3, r4} // Save interrupt stack type and SPSR + STR sp, [r0, #8] // Save stack pointer in thread control + // block + + /* Save the remaining time-slice and disable it. */ + LDR r3, =_tx_timer_time_slice // Pickup time-slice variable address + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it active? + BEQ __tx_thread_dont_save_ts // No, don't save it + STR r2, [r0, #24] // Save thread's time-slice + MOV r2, #0 // Clear value + STR r2, [r3] // Disable global time-slice flag + +__tx_thread_dont_save_ts: + + /* Clear the current task pointer. */ + MOV r0, #0 // NULL value + STR r0, [r1] // Clear current thread pointer + + /* Return to the scheduler. */ + B _tx_thread_schedule // Return to scheduler + +__tx_thread_idle_system_restore: + + /* Just return back to the scheduler! */ + MOV r0, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r0 // Enter SVC mode + B _tx_thread_schedule // Return to scheduler diff --git a/ports/cortex_a12/gnu/src/tx_thread_context_save.S b/ports/cortex_a12/gnu/src/tx_thread_context_save.S new file mode 100644 index 00000000..7ac48c2e --- /dev/null +++ b/ports/cortex_a12/gnu/src/tx_thread_context_save.S @@ -0,0 +1,172 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .global _tx_thread_system_state + .global _tx_thread_current_ptr + .global __tx_irq_processing_return + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_save + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_context_save + .type _tx_thread_context_save,function +_tx_thread_context_save: + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + + STMDB sp!, {r0-r3} // Save some working registers +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Disable FIQ interrupts +#endif + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + + /* Save the rest of the scratch registers on the stack and return to the + calling ISR. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, r10, r12, lr} // Store other registers + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + B __tx_irq_processing_return // Continue IRQ processing + +__tx_thread_not_nested_save: + + /* Otherwise, not nested, check to see if a thread was running. */ + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + + /* Save minimal context of interrupted thread. */ + + MRS r2, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r2, r10, r12, lr} // Store other registers + + MOV r10, #0 // Clear stack limit + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + B __tx_irq_processing_return // Continue IRQ processing + +__tx_thread_idle_system_save: + + /* Interrupt occurred in the scheduling loop. */ + + /* Not much to do here, just adjust the stack pointer, and return to IRQ + processing. */ + + MOV r10, #0 // Clear stack limit + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + ADD sp, sp, #16 // Recover saved registers + B __tx_irq_processing_return // Continue IRQ processing diff --git a/ports/cortex_a12/gnu/src/tx_thread_fiq_context_restore.S b/ports/cortex_a12/gnu/src/tx_thread_fiq_context_restore.S new file mode 100644 index 00000000..006be973 --- /dev/null +++ b/ports/cortex_a12/gnu/src/tx_thread_fiq_context_restore.S @@ -0,0 +1,223 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +SVC_MODE = 0xD3 // SVC mode +FIQ_MODE = 0xD1 // FIQ mode +MODE_MASK = 0x1F // Mode mask +THUMB_MASK = 0x20 // Thumb bit mask +IRQ_MODE_BITS = 0x12 // IRQ mode bits + + + .global _tx_thread_system_state + .global _tx_thread_current_ptr + .global _tx_thread_system_stack_ptr + .global _tx_thread_execute_ptr + .global _tx_timer_time_slice + .global _tx_thread_schedule + .global _tx_thread_preempt_disable + .global _tx_execution_isr_exit + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_restore + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_context_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function restores the fiq interrupt context when processing a */ +/* nested interrupt. If not, it returns to the interrupt thread if no */ +/* preemption is necessary. Otherwise, if preemption is necessary or */ +/* if no thread was running, the function returns to the scheduler. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling routine */ +/* */ +/* CALLED BY */ +/* */ +/* FIQ ISR Interrupt Service Routines */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_fiq_context_restore + .type _tx_thread_fiq_context_restore,function +_tx_thread_fiq_context_restore: + + /* Lockout interrupts. */ + + CPSID if // Disable IRQ and FIQ interrupts + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR exit function to indicate an ISR is complete. */ + + BL _tx_execution_isr_exit // Call the ISR exit function +#endif + + /* Determine if interrupts are nested. */ + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + SUB r2, r2, #1 // Decrement the counter + STR r2, [r3] // Store the counter + CMP r2, #0 // Was this the first interrupt? + BEQ __tx_thread_fiq_not_nested_restore // If so, not a nested restore + + /* Interrupts are nested. */ + + /* Just recover the saved registers and return to the point of + interrupt. */ + + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_fiq_not_nested_restore: + + /* Determine if a thread was interrupted and no preemption is required. */ + + LDR r1, [sp] // Pickup the saved SPSR + MOV r2, #MODE_MASK // Build mask to isolate the interrupted mode + AND r1, r1, r2 // Isolate mode bits + CMP r1, #IRQ_MODE_BITS // Was an interrupt taken in IRQ mode before we + // got to context save? */ + BEQ __tx_thread_fiq_no_preempt_restore // Yes, just go back to point of interrupt + + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup actual current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_fiq_idle_system_restore // Yes, idle system was interrupted + + LDR r3, =_tx_thread_preempt_disable // Pickup preempt disable address + LDR r2, [r3] // Pickup actual preempt disable flag + CMP r2, #0 // Is it set? + BNE __tx_thread_fiq_no_preempt_restore // Yes, don't preempt this thread + LDR r3, =_tx_thread_execute_ptr // Pickup address of execute thread ptr + LDR r2, [r3] // Pickup actual execute thread pointer + CMP r0, r2 // Is the same thread highest priority? + BNE __tx_thread_fiq_preempt_restore // No, preemption needs to happen + + +__tx_thread_fiq_no_preempt_restore: + + /* Restore interrupted thread or ISR. */ + /* Recover the saved context and return to the point of interrupt. */ + + LDMIA sp!, {r0, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_fiq_preempt_restore: + + LDMIA sp!, {r3, lr} // Recover temporarily saved registers + MOV r1, lr // Save lr (point of interrupt) + MOV r2, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r2 // Enter SVC mode + STR r1, [sp, #-4]! // Save point of interrupt + STMDB sp!, {r4-r12, lr} // Save upper half of registers + MOV r4, r3 // Save SPSR in r4 + MOV r2, #FIQ_MODE // Build FIQ mode CPSR + MSR CPSR_c, r2 // Reenter FIQ mode + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOV r5, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r5 // Enter SVC mode + STMDB sp!, {r0-r3} // Save r0-r3 on thread's stack + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer + +#ifdef TX_ENABLE_VFP_SUPPORT + LDR r2, [r0, #144] // Pickup the VFP enabled flag + CMP r2, #0 // Is the VFP enabled? + BEQ _tx_skip_fiq_vfp_save // No, skip VFP IRQ save + VMRS r2, FPSCR // Pickup the FPSCR + STR r2, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D0-D15} // Save D0-D15 +_tx_skip_fiq_vfp_save: +#endif + + MOV r3, #1 // Build interrupt stack type + STMDB sp!, {r3, r4} // Save interrupt stack type and SPSR + STR sp, [r0, #8] // Save stack pointer in thread control + // block */ + LDR r3, =_tx_timer_time_slice // Pickup time-slice variable address + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it active? + BEQ __tx_thread_fiq_dont_save_ts // No, don't save it + + STR r2, [r0, #24] // Save thread's time-slice + MOV r2, #0 // Clear value + STR r2, [r3] // Disable global time-slice flag + +__tx_thread_fiq_dont_save_ts: + + /* Clear the current task pointer. */ + + MOV r0, #0 // NULL value + STR r0, [r1] // Clear current thread pointer + + /* Return to the scheduler. */ + + B _tx_thread_schedule // Return to scheduler + +__tx_thread_fiq_idle_system_restore: + + /* Just return back to the scheduler! */ + + ADD sp, sp, #24 // Recover FIQ stack space + MOV r3, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r3 // Lockout interrupts + B _tx_thread_schedule // Return to scheduler + diff --git a/ports/cortex_a12/gnu/src/tx_thread_fiq_context_save.S b/ports/cortex_a12/gnu/src/tx_thread_fiq_context_save.S new file mode 100644 index 00000000..7db6a4c2 --- /dev/null +++ b/ports/cortex_a12/gnu/src/tx_thread_fiq_context_save.S @@ -0,0 +1,178 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .global _tx_thread_system_state + .global _tx_thread_current_ptr + .global __tx_fiq_processing_return + .global _tx_execution_isr_enter + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_save + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_fiq_context_save + .type _tx_thread_fiq_context_save,function +_tx_thread_fiq_context_save: + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + + STMDB sp!, {r0-r3} // Save some working registers + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_fiq_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + + /* Save the rest of the scratch registers on the stack and return to the + calling ISR. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, r10, r12, lr} // Store other registers + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + B __tx_fiq_processing_return // Continue FIQ processing +// +__tx_thread_fiq_not_nested_save: + + /* Otherwise, not nested, check to see if a thread was running. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_fiq_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + + /* Save minimal context of interrupted thread. */ + + MRS r2, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r2, lr} // Store other registers, Note that we don't + // need to save sl and ip since FIQ has + // copies of these registers. Nested + // interrupt processing does need to save + // these registers. + + MOV r10, #0 // Clear stack limit + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + B __tx_fiq_processing_return // Continue FIQ processing + +__tx_thread_fiq_idle_system_save: + + /* Interrupt occurred in the scheduling loop. */ + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + /* Not much to do here, save the current SPSR and LR for possible + use in IRQ interrupted in idle system conditions, and return to + FIQ interrupt processing. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, lr} // Store other registers that will get used + // or stripped off the stack in context + // restore + B __tx_fiq_processing_return // Continue FIQ processing diff --git a/ports/cortex_a12/gnu/src/tx_thread_fiq_nesting_end.S b/ports/cortex_a12/gnu/src/tx_thread_fiq_nesting_end.S new file mode 100644 index 00000000..b34d881e --- /dev/null +++ b/ports/cortex_a12/gnu/src/tx_thread_fiq_nesting_end.S @@ -0,0 +1,104 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +#ifdef TX_ENABLE_FIQ_SUPPORT +DISABLE_INTS = 0xC0 // Disable IRQ/FIQ interrupts +#else +DISABLE_INTS = 0x80 // Disable IRQ interrupts +#endif +MODE_MASK = 0x1F // Mode mask +FIQ_MODE_BITS = 0x11 // FIQ mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_end + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_nesting_end ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from FIQ mode after */ +/* _tx_thread_fiq_nesting_start has been called and switches the FIQ */ +/* processing from system mode back to FIQ mode prior to the ISR */ +/* calling _tx_thread_fiq_context_restore. Note that this function */ +/* assumes the system stack pointer is in the same position after */ +/* nesting start function was called. */ +/* */ +/* This function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with FIQ interrupts disabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_fiq_nesting_end + .type _tx_thread_fiq_nesting_end,function +_tx_thread_fiq_nesting_end: + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + ORR r0, r0, #DISABLE_INTS // Build disable interrupt value + MSR CPSR_c, r0 // Disable interrupts + LDMIA sp!, {r1, lr} // Pickup saved lr (and r1 throw-away for + // 8-byte alignment logic) + BIC r0, r0, #MODE_MASK // Clear mode bits + ORR r0, r0, #FIQ_MODE_BITS // Build IRQ mode CPSR + MSR CPSR_c, r0 // Reenter IRQ mode + +#ifdef __THUMB_INTERWORK + BX r3 // Return to caller +#else + MOV pc, r3 // Return to caller +#endif diff --git a/ports/cortex_a12/gnu/src/tx_thread_fiq_nesting_start.S b/ports/cortex_a12/gnu/src/tx_thread_fiq_nesting_start.S new file mode 100644 index 00000000..c9cd5a06 --- /dev/null +++ b/ports/cortex_a12/gnu/src/tx_thread_fiq_nesting_start.S @@ -0,0 +1,96 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +FIQ_DISABLE = 0x40 // FIQ disable bit +MODE_MASK = 0x1F // Mode mask +SYS_MODE_BITS = 0x1F // System mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_start + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_nesting_start ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from FIQ mode after */ +/* _tx_thread_fiq_context_save has been called and switches the FIQ */ +/* processing to the system mode so nested FIQ interrupt processing */ +/* is possible (system mode has its own "lr" register). Note that */ +/* this function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with FIQ interrupts enabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_fiq_nesting_start + .type _tx_thread_fiq_nesting_start,function +_tx_thread_fiq_nesting_start: + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + BIC r0, r0, #MODE_MASK // Clear the mode bits + ORR r0, r0, #SYS_MODE_BITS // Build system mode CPSR + MSR CPSR_c, r0 // Enter system mode + STMDB sp!, {r1, lr} // Push the system mode lr on the system mode stack + // and push r1 just to keep 8-byte alignment + BIC r0, r0, #FIQ_DISABLE // Build enable FIQ CPSR + MSR CPSR_c, r0 // Enter system mode +#ifdef __THUMB_INTERWORK + BX r3 // Return to caller +#else + MOV pc, r3 // Return to caller +#endif diff --git a/ports/cortex_a12/gnu/src/tx_thread_interrupt_control.S b/ports/cortex_a12/gnu/src/tx_thread_interrupt_control.S new file mode 100644 index 00000000..63b1609a --- /dev/null +++ b/ports/cortex_a12/gnu/src/tx_thread_interrupt_control.S @@ -0,0 +1,104 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +INT_MASK = 0x03F + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_control for + applications calling this function from to 16-bit Thumb mode. */ + + .text + .align 2 + .global $_tx_thread_interrupt_control +$_tx_thread_interrupt_control: + .thumb + BX pc // Switch to 32-bit mode + NOP // + .arm + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_control // Call _tx_thread_interrupt_control function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_control ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for changing the interrupt lockout */ +/* posture of the system. */ +/* */ +/* INPUT */ +/* */ +/* new_posture New interrupt lockout posture */ +/* */ +/* OUTPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_interrupt_control + .type _tx_thread_interrupt_control,function +_tx_thread_interrupt_control: + + /* Pickup current interrupt lockout posture. */ + + MRS r3, CPSR // Pickup current CPSR + MOV r2, #INT_MASK // Build interrupt mask + AND r1, r3, r2 // Clear interrupt lockout bits + ORR r1, r1, r0 // Or-in new interrupt lockout bits + + /* Apply the new interrupt posture. */ + + MSR CPSR_c, r1 // Setup new CPSR + BIC r0, r3, r2 // Return previous interrupt mask +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a12/gnu/src/tx_thread_interrupt_disable.S b/ports/cortex_a12/gnu/src/tx_thread_interrupt_disable.S new file mode 100644 index 00000000..13258808 --- /dev/null +++ b/ports/cortex_a12/gnu/src/tx_thread_interrupt_disable.S @@ -0,0 +1,101 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_disable for + applications calling this function from to 16-bit Thumb mode. */ + + .text + .align 2 + .global $_tx_thread_interrupt_disable +$_tx_thread_interrupt_disable: + .thumb + BX pc // Switch to 32-bit mode + NOP // + .arm + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_disable // Call _tx_thread_interrupt_disable function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_disable ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for disabling interrupts */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_interrupt_disable + .type _tx_thread_interrupt_disable,function +_tx_thread_interrupt_disable: + + /* Pickup current interrupt lockout posture. */ + + MRS r0, CPSR // Pickup current CPSR + + /* Mask interrupts. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Disable IRQ and FIQ +#else + CPSID i // Disable IRQ +#endif + +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a12/gnu/src/tx_thread_interrupt_restore.S b/ports/cortex_a12/gnu/src/tx_thread_interrupt_restore.S new file mode 100644 index 00000000..2d582511 --- /dev/null +++ b/ports/cortex_a12/gnu/src/tx_thread_interrupt_restore.S @@ -0,0 +1,93 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_restore for + applications calling this function from to 16-bit Thumb mode. */ + + .text + .align 2 + .global $_tx_thread_interrupt_restore +$_tx_thread_interrupt_restore: + .thumb + BX pc // Switch to 32-bit mode + NOP // + .arm + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_restore // Call _tx_thread_interrupt_restore function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for restoring interrupts to the state */ +/* returned by a previous _tx_thread_interrupt_disable call. */ +/* */ +/* INPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_interrupt_restore + .type _tx_thread_interrupt_restore,function +_tx_thread_interrupt_restore: + + /* Apply the new interrupt posture. */ + + MSR CPSR_c, r0 // Setup new CPSR +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a12/gnu/src/tx_thread_irq_nesting_end.S b/ports/cortex_a12/gnu/src/tx_thread_irq_nesting_end.S new file mode 100644 index 00000000..ec7e63c6 --- /dev/null +++ b/ports/cortex_a12/gnu/src/tx_thread_irq_nesting_end.S @@ -0,0 +1,103 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +#ifdef TX_ENABLE_FIQ_SUPPORT +DISABLE_INTS = 0xC0 // Disable IRQ/FIQ interrupts +#else +DISABLE_INTS = 0x80 // Disable IRQ interrupts +#endif +MODE_MASK = 0x1F // Mode mask +IRQ_MODE_BITS = 0x12 // IRQ mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_end + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_irq_nesting_end ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from IRQ mode after */ +/* _tx_thread_irq_nesting_start has been called and switches the IRQ */ +/* processing from system mode back to IRQ mode prior to the ISR */ +/* calling _tx_thread_context_restore. Note that this function */ +/* assumes the system stack pointer is in the same position after */ +/* nesting start function was called. */ +/* */ +/* This function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with IRQ interrupts disabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_irq_nesting_end + .type _tx_thread_irq_nesting_end,function +_tx_thread_irq_nesting_end: + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + ORR r0, r0, #DISABLE_INTS // Build disable interrupt value + MSR CPSR_c, r0 // Disable interrupts + LDMIA sp!, {r1, lr} // Pickup saved lr (and r1 throw-away for + // 8-byte alignment logic) + BIC r0, r0, #MODE_MASK // Clear mode bits + ORR r0, r0, #IRQ_MODE_BITS // Build IRQ mode CPSR + MSR CPSR_c, r0 // Reenter IRQ mode +#ifdef __THUMB_INTERWORK + BX r3 // Return to caller +#else + MOV pc, r3 // Return to caller +#endif diff --git a/ports/cortex_a12/gnu/src/tx_thread_irq_nesting_start.S b/ports/cortex_a12/gnu/src/tx_thread_irq_nesting_start.S new file mode 100644 index 00000000..c69976ed --- /dev/null +++ b/ports/cortex_a12/gnu/src/tx_thread_irq_nesting_start.S @@ -0,0 +1,96 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +IRQ_DISABLE = 0x80 // IRQ disable bit +MODE_MASK = 0x1F // Mode mask +SYS_MODE_BITS = 0x1F // System mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_start + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_irq_nesting_start ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from IRQ mode after */ +/* _tx_thread_context_save has been called and switches the IRQ */ +/* processing to the system mode so nested IRQ interrupt processing */ +/* is possible (system mode has its own "lr" register). Note that */ +/* this function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with IRQ interrupts enabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_irq_nesting_start + .type _tx_thread_irq_nesting_start,function +_tx_thread_irq_nesting_start: + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + BIC r0, r0, #MODE_MASK // Clear the mode bits + ORR r0, r0, #SYS_MODE_BITS // Build system mode CPSR + MSR CPSR_c, r0 // Enter system mode + STMDB sp!, {r1, lr} // Push the system mode lr on the system mode stack + // and push r1 just to keep 8-byte alignment + BIC r0, r0, #IRQ_DISABLE // Build enable IRQ CPSR + MSR CPSR_c, r0 // Enter system mode +#ifdef __THUMB_INTERWORK + BX r3 // Return to caller +#else + MOV pc, r3 // Return to caller +#endif diff --git a/ports/cortex_a12/gnu/src/tx_thread_schedule.S b/ports/cortex_a12/gnu/src/tx_thread_schedule.S new file mode 100644 index 00000000..8330e9df --- /dev/null +++ b/ports/cortex_a12/gnu/src/tx_thread_schedule.S @@ -0,0 +1,230 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .global _tx_thread_execute_ptr + .global _tx_thread_current_ptr + .global _tx_timer_time_slice + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_schedule for + applications calling this function from to 16-bit Thumb mode. */ + + .text + .align 2 + .global $_tx_thread_schedule + .type $_tx_thread_schedule,function +$_tx_thread_schedule: + .thumb + BX pc // Switch to 32-bit mode + NOP // + .arm + STMFD sp!, {lr} // Save return address + BL _tx_thread_schedule // Call _tx_thread_schedule function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_schedule ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function waits for a thread control block pointer to appear in */ +/* the _tx_thread_execute_ptr variable. Once a thread pointer appears */ +/* in the variable, the corresponding thread is resumed. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_initialize_kernel_enter ThreadX entry function */ +/* _tx_thread_system_return Return to system from thread */ +/* _tx_thread_context_restore Restore thread's context */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_schedule + .type _tx_thread_schedule,function +_tx_thread_schedule: + + /* Enable interrupts. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSIE if // Enable IRQ and FIQ interrupts +#else + CPSIE i // Enable IRQ interrupts +#endif + + /* Wait for a thread to execute. */ + LDR r1, =_tx_thread_execute_ptr // Address of thread execute ptr + +__tx_thread_schedule_loop: + + LDR r0, [r1] // Pickup next thread to execute + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_schedule_loop // If so, keep looking for a thread + /* Yes! We have a thread to execute. Lockout interrupts and + transfer control to it. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Disable IRQ and FIQ interrupts +#else + CPSID i // Disable IRQ interrupts +#endif + + /* Setup the current thread pointer. */ + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread + STR r0, [r1] // Setup current thread pointer + + /* Increment the run count for this thread. */ + + LDR r2, [r0, #4] // Pickup run counter + LDR r3, [r0, #24] // Pickup time-slice for this thread + ADD r2, r2, #1 // Increment thread run-counter + STR r2, [r0, #4] // Store the new run counter + + /* Setup time-slice, if present. */ + + LDR r2, =_tx_timer_time_slice // Pickup address of time-slice + // variable + LDR sp, [r0, #8] // Switch stack pointers + STR r3, [r2] // Setup time-slice + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the thread entry function to indicate the thread is executing. */ + + MOV r5, r0 // Save r0 + BL _tx_execution_thread_enter // Call the thread execution enter function + MOV r0, r5 // Restore r0 +#endif + + /* Determine if an interrupt frame or a synchronous task suspension frame + is present. */ + + LDMIA sp!, {r4, r5} // Pickup the stack type and saved CPSR + CMP r4, #0 // Check for synchronous context switch + BEQ _tx_solicited_return + MSR SPSR_cxsf, r5 // Setup SPSR for return +#ifdef TX_ENABLE_VFP_SUPPORT + LDR r1, [r0, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_interrupt_vfp_restore // No, skip VFP interrupt restore + VLDMIA sp!, {D0-D15} // Recover D0-D15 + VLDMIA sp!, {D16-D31} // Recover D16-D31 + LDR r4, [sp], #4 // Pickup FPSCR + VMSR FPSCR, r4 // Restore FPSCR +_tx_skip_interrupt_vfp_restore: +#endif + LDMIA sp!, {r0-r12, lr, pc}^ // Return to point of thread interrupt + +_tx_solicited_return: + +#ifdef TX_ENABLE_VFP_SUPPORT + LDR r1, [r0, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_solicited_vfp_restore // No, skip VFP solicited restore + VLDMIA sp!, {D8-D15} // Recover D8-D15 + VLDMIA sp!, {D16-D31} // Recover D16-D31 + LDR r4, [sp], #4 // Pickup FPSCR + VMSR FPSCR, r4 // Restore FPSCR +_tx_skip_solicited_vfp_restore: +#endif + MSR CPSR_cxsf, r5 // Recover CPSR + LDMIA sp!, {r4-r11, lr} // Return to thread synchronously +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif + +#ifdef TX_ENABLE_VFP_SUPPORT + + .global tx_thread_vfp_enable + .type tx_thread_vfp_enable,function +tx_thread_vfp_enable: + MRS r2, CPSR // Pickup the CPSR +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Enable IRQ and FIQ interrupts +#else + CPSID i // Enable IRQ interrupts +#endif + LDR r0, =_tx_thread_current_ptr // Build current thread pointer address + LDR r1, [r0] // Pickup current thread pointer + CMP r1, #0 // Check for NULL thread pointer + BEQ __tx_no_thread_to_enable // If NULL, skip VFP enable + MOV r0, #1 // Build enable value + STR r0, [r1, #144] // Set the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) +__tx_no_thread_to_enable: + MSR CPSR_cxsf, r2 // Recover CPSR + BX LR // Return to caller + + .global tx_thread_vfp_disable + .type tx_thread_vfp_disable,function +tx_thread_vfp_disable: + MRS r2, CPSR // Pickup the CPSR +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Enable IRQ and FIQ interrupts +#else + CPSID i // Enable IRQ interrupts +#endif + LDR r0, =_tx_thread_current_ptr // Build current thread pointer address + LDR r1, [r0] // Pickup current thread pointer + CMP r1, #0 // Check for NULL thread pointer + BEQ __tx_no_thread_to_disable // If NULL, skip VFP disable + MOV r0, #0 // Build disable value + STR r0, [r1, #144] // Clear the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) +__tx_no_thread_to_disable: + MSR CPSR_cxsf, r2 // Recover CPSR + BX LR // Return to caller + +#endif diff --git a/ports/cortex_a12/gnu/src/tx_thread_stack_build.S b/ports/cortex_a12/gnu/src/tx_thread_stack_build.S new file mode 100644 index 00000000..f413e673 --- /dev/null +++ b/ports/cortex_a12/gnu/src/tx_thread_stack_build.S @@ -0,0 +1,164 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .arm + +SVC_MODE = 0x13 // SVC mode +#ifdef TX_ENABLE_FIQ_SUPPORT +CPSR_MASK = 0xDF // Mask initial CPSR, IRQ & FIQ interrupts enabled +#else +CPSR_MASK = 0x9F // Mask initial CPSR, IRQ interrupts enabled +#endif + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_stack_build for + applications calling this function from to 16-bit Thumb mode. */ + + .text + .align 2 + .thumb + .global $_tx_thread_stack_build + .type $_tx_thread_stack_build,function +$_tx_thread_stack_build: + BX pc // Switch to 32-bit mode + NOP // + .arm + STMFD sp!, {lr} // Save return address + BL _tx_thread_stack_build // Call _tx_thread_stack_build function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_stack_build ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function builds a stack frame on the supplied thread's stack. */ +/* The stack frame results in a fake interrupt return to the supplied */ +/* function pointer. */ +/* */ +/* INPUT */ +/* */ +/* thread_ptr Pointer to thread control blk */ +/* function_ptr Pointer to return function */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_thread_create Create thread service */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_stack_build + .type _tx_thread_stack_build,function +_tx_thread_stack_build: + + + /* Build a fake interrupt frame. The form of the fake interrupt stack + on the ARMv7-A should look like the following after it is built: + + Stack Top: 1 Interrupt stack frame type + CPSR Initial value for CPSR + a1 (r0) Initial value for a1 + a2 (r1) Initial value for a2 + a3 (r2) Initial value for a3 + a4 (r3) Initial value for a4 + v1 (r4) Initial value for v1 + v2 (r5) Initial value for v2 + v3 (r6) Initial value for v3 + v4 (r7) Initial value for v4 + v5 (r8) Initial value for v5 + sb (r9) Initial value for sb + sl (r10) Initial value for sl + fp (r11) Initial value for fp + ip (r12) Initial value for ip + lr (r14) Initial value for lr + pc (r15) Initial value for + 0 For stack backtracing + + Stack Bottom: (higher memory address) */ + + LDR r2, [r0, #16] // Pickup end of stack area + BIC r2, r2, #7 // Ensure 8-byte alignment + SUB r2, r2, #76 // Allocate space for the stack frame + + /* Actually build the stack frame. */ + + MOV r3, #1 // Build interrupt stack type + STR r3, [r2, #0] // Store stack type + MOV r3, #0 // Build initial register value + STR r3, [r2, #8] // Store initial r0 + STR r3, [r2, #12] // Store initial r1 + STR r3, [r2, #16] // Store initial r2 + STR r3, [r2, #20] // Store initial r3 + STR r3, [r2, #24] // Store initial r4 + STR r3, [r2, #28] // Store initial r5 + STR r3, [r2, #32] // Store initial r6 + STR r3, [r2, #36] // Store initial r7 + STR r3, [r2, #40] // Store initial r8 + STR r3, [r2, #44] // Store initial r9 + LDR r3, [r0, #12] // Pickup stack starting address + STR r3, [r2, #48] // Store initial r10 (sl) + LDR r3,=_tx_thread_schedule // Pickup address of _tx_thread_schedule for GDB backtrace + STR r3, [r2, #60] // Store initial r14 (lr) + MOV r3, #0 // Build initial register value + STR r3, [r2, #52] // Store initial r11 + STR r3, [r2, #56] // Store initial r12 + STR r1, [r2, #64] // Store initial pc + STR r3, [r2, #68] // 0 for back-trace + MRS r1, CPSR // Pickup CPSR + BIC r1, r1, #CPSR_MASK // Mask mode bits of CPSR + ORR r3, r1, #SVC_MODE // Build CPSR, SVC mode, interrupts enabled + STR r3, [r2, #4] // Store initial CPSR + + /* Setup stack pointer. */ + + STR r2, [r0, #8] // Save stack pointer in thread's + // control block +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a12/gnu/src/tx_thread_system_return.S b/ports/cortex_a12/gnu/src/tx_thread_system_return.S new file mode 100644 index 00000000..cb7d62ce --- /dev/null +++ b/ports/cortex_a12/gnu/src/tx_thread_system_return.S @@ -0,0 +1,162 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .arm + + + .global _tx_thread_current_ptr + .global _tx_timer_time_slice + .global _tx_thread_schedule + + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_system_return for + applications calling this function from to 16-bit Thumb mode. */ + + .text + .align 2 + .global $_tx_thread_system_return + .type $_tx_thread_system_return,function +$_tx_thread_system_return: + .thumb + BX pc // Switch to 32-bit mode + NOP // + .arm + STMFD sp!, {lr} // Save return address + BL _tx_thread_system_return // Call _tx_thread_system_return function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_system_return ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is target processor specific. It is used to transfer */ +/* control from a thread back to the ThreadX system. Only a */ +/* minimal context is saved since the compiler assumes temp registers */ +/* are going to get slicked by a function call anyway. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling loop */ +/* */ +/* CALLED BY */ +/* */ +/* ThreadX components */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_system_return + .type _tx_thread_system_return,function +_tx_thread_system_return: + + /* Save minimal context on the stack. */ + + STMDB sp!, {r4-r11, lr} // Save minimal context + + LDR r4, =_tx_thread_current_ptr // Pickup address of current ptr + LDR r5, [r4] // Pickup current thread pointer + +#ifdef TX_ENABLE_VFP_SUPPORT + LDR r1, [r5, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_solicited_vfp_save // No, skip VFP solicited save + VMRS r1, FPSCR // Pickup the FPSCR + STR r1, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D8-D15} // Save D8-D15 +_tx_skip_solicited_vfp_save: +#endif + + MOV r0, #0 // Build a solicited stack type + MRS r1, CPSR // Pickup the CPSR + STMDB sp!, {r0-r1} // Save type and CPSR + + /* Lockout interrupts. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Disable IRQ and FIQ interrupts +#else + CPSID i // Disable IRQ interrupts +#endif + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the thread exit function to indicate the thread is no longer executing. */ + + BL _tx_execution_thread_exit // Call the thread exit function +#endif + MOV r3, r4 // Pickup address of current ptr + MOV r0, r5 // Pickup current thread pointer + LDR r2, =_tx_timer_time_slice // Pickup address of time slice + LDR r1, [r2] // Pickup current time slice + + /* Save current stack and switch to system stack. */ + + STR sp, [r0, #8] // Save thread stack pointer + + /* Determine if the time-slice is active. */ + + MOV r4, #0 // Build clear value + CMP r1, #0 // Is a time-slice active? + BEQ __tx_thread_dont_save_ts // No, don't save the time-slice + + /* Save time-slice for the thread and clear the current time-slice. */ + + STR r4, [r2] // Clear time-slice + STR r1, [r0, #24] // Save current time-slice + +__tx_thread_dont_save_ts: + + /* Clear the current thread pointer. */ + + STR r4, [r3] // Clear current thread pointer + B _tx_thread_schedule // Jump to scheduler! diff --git a/ports/cortex_a12/gnu/src/tx_thread_vectored_context_save.S b/ports/cortex_a12/gnu/src/tx_thread_vectored_context_save.S new file mode 100644 index 00000000..d846223f --- /dev/null +++ b/ports/cortex_a12/gnu/src/tx_thread_vectored_context_save.S @@ -0,0 +1,165 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .global _tx_thread_system_state + .global _tx_thread_current_ptr + .global _tx_execution_isr_enter + + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_vectored_context_save + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_vectored_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_vectored_context_save + .type _tx_thread_vectored_context_save,function +_tx_thread_vectored_context_save: + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Disable IRQ and FIQ interrupts +#endif + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3, #0] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3, #0] // Store it back in the variable + + /* Note: Minimal context of interrupted thread is already saved. */ + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + MOV pc, lr // Return to caller + +__tx_thread_not_nested_save: + + /* Otherwise, not nested, check to see if a thread was running. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3, #0] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1, #0] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + /* Note: Minimal context of interrupted thread is already saved. */ + + /* Save the current stack pointer in the thread's control block. */ + + MOV r10, #0 // Clear stack limit + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + MOV pc, lr // Return to caller + +__tx_thread_idle_system_save: + + /* Interrupt occurred in the scheduling loop. */ + + /* Not much to do here, just adjust the stack pointer, and return to IRQ + processing. */ + + MOV r10, #0 // Clear stack limit + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + ADD sp, sp, #32 // Recover saved registers + MOV pc, lr // Return to caller diff --git a/ports/cortex_a12/gnu/src/tx_timer_interrupt.S b/ports/cortex_a12/gnu/src/tx_timer_interrupt.S new file mode 100644 index 00000000..7337ed0c --- /dev/null +++ b/ports/cortex_a12/gnu/src/tx_timer_interrupt.S @@ -0,0 +1,231 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Timer */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .arm + + +/* Define Assembly language external references... */ + + .global _tx_timer_time_slice + .global _tx_timer_system_clock + .global _tx_timer_current_ptr + .global _tx_timer_list_start + .global _tx_timer_list_end + .global _tx_timer_expired_time_slice + .global _tx_timer_expired + .global _tx_thread_time_slice + + + +/* Define the 16-bit Thumb mode veneer for _tx_timer_interrupt for + applications calling this function from to 16-bit Thumb mode. */ + + .text + .align 2 + .thumb + .global $_tx_timer_interrupt + .type $_tx_timer_interrupt,function +$_tx_timer_interrupt: + BX pc // Switch to 32-bit mode + NOP // + .arm + STMFD sp!, {lr} // Save return address + BL _tx_timer_interrupt // Call _tx_timer_interrupt function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_timer_interrupt ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function processes the hardware timer interrupt. This */ +/* processing includes incrementing the system clock and checking for */ +/* time slice and/or timer expiration. If either is found, the */ +/* interrupt context save/restore functions are called along with the */ +/* expiration functions. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_time_slice Time slice interrupted thread */ +/* _tx_timer_expiration_process Timer expiration processing */ +/* */ +/* CALLED BY */ +/* */ +/* interrupt vector */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_timer_interrupt + .type _tx_timer_interrupt,function +_tx_timer_interrupt: + + /* Upon entry to this routine, it is assumed that context save has already + been called, and therefore the compiler scratch registers are available + for use. */ + + /* Increment the system clock. */ + + LDR r1, =_tx_timer_system_clock // Pickup address of system clock + LDR r0, [r1] // Pickup system clock + ADD r0, r0, #1 // Increment system clock + STR r0, [r1] // Store new system clock + + /* Test for time-slice expiration. */ + + LDR r3, =_tx_timer_time_slice // Pickup address of time-slice + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it non-active? + BEQ __tx_timer_no_time_slice // Yes, skip time-slice processing + + /* Decrement the time_slice. */ + + SUB r2, r2, #1 // Decrement the time-slice + STR r2, [r3] // Store new time-slice value + + /* Check for expiration. */ + + CMP r2, #0 // Has it expired? + BNE __tx_timer_no_time_slice // No, skip expiration processing + + /* Set the time-slice expired flag. */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of expired flag + MOV r0, #1 // Build expired value + STR r0, [r3] // Set time-slice expiration flag + +__tx_timer_no_time_slice: + + /* Test for timer expiration. */ + + LDR r1, =_tx_timer_current_ptr // Pickup current timer pointer address + LDR r0, [r1] // Pickup current timer + LDR r2, [r0] // Pickup timer list entry + CMP r2, #0 // Is there anything in the list? + BEQ __tx_timer_no_timer // No, just increment the timer + + /* Set expiration flag. */ + + LDR r3, =_tx_timer_expired // Pickup expiration flag address + MOV r2, #1 // Build expired value + STR r2, [r3] // Set expired flag + B __tx_timer_done // Finished timer processing + +__tx_timer_no_timer: + + /* No timer expired, increment the timer pointer. */ + ADD r0, r0, #4 // Move to next timer + + /* Check for wraparound. */ + + LDR r3, =_tx_timer_list_end // Pickup address of timer list end + LDR r2, [r3] // Pickup list end + CMP r0, r2 // Are we at list end? + BNE __tx_timer_skip_wrap // No, skip wraparound logic + + /* Wrap to beginning of list. */ + + LDR r3, =_tx_timer_list_start // Pickup address of timer list start + LDR r0, [r3] // Set current pointer to list start + +__tx_timer_skip_wrap: + + STR r0, [r1] // Store new current timer pointer + +__tx_timer_done: + + /* See if anything has expired. */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of expired flag + LDR r2, [r3] // Pickup time-slice expired flag + CMP r2, #0 // Did a time-slice expire? + BNE __tx_something_expired // If non-zero, time-slice expired + LDR r1, =_tx_timer_expired // Pickup address of other expired flag + LDR r0, [r1] // Pickup timer expired flag + CMP r0, #0 // Did a timer expire? + BEQ __tx_timer_nothing_expired // No, nothing expired + +__tx_something_expired: + + STMDB sp!, {r0, lr} // Save the lr register on the stack + // and save r0 just to keep 8-byte alignment + + /* Did a timer expire? */ + + LDR r1, =_tx_timer_expired // Pickup address of expired flag + LDR r0, [r1] // Pickup timer expired flag + CMP r0, #0 // Check for timer expiration + BEQ __tx_timer_dont_activate // If not set, skip timer activation + + /* Process timer expiration. */ + BL _tx_timer_expiration_process // Call the timer expiration handling routine + +__tx_timer_dont_activate: + + /* Did time slice expire? */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of time-slice expired + LDR r2, [r3] // Pickup the actual flag + CMP r2, #0 // See if the flag is set + BEQ __tx_timer_not_ts_expiration // No, skip time-slice processing + + /* Time slice interrupted thread. */ + + BL _tx_thread_time_slice // Call time-slice processing + +__tx_timer_not_ts_expiration: + + LDMIA sp!, {r0, lr} // Recover lr register (r0 is just there for + // the 8-byte stack alignment + +__tx_timer_nothing_expired: + +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a15/ac6/example_build/sample_threadx.c b/ports/cortex_a15/ac6/example_build/sample_threadx.c new file mode 100644 index 00000000..8c61de06 --- /dev/null +++ b/ports/cortex_a15/ac6/example_build/sample_threadx.c @@ -0,0 +1,369 @@ +/* This is a small demo of the high-performance ThreadX kernel. It includes examples of eight + threads of different priorities, using a message queue, semaphore, mutex, event flags group, + byte pool, and block pool. */ + +#include "tx_api.h" + +#define DEMO_STACK_SIZE 1024 +#define DEMO_BYTE_POOL_SIZE 9120 +#define DEMO_BLOCK_POOL_SIZE 100 +#define DEMO_QUEUE_SIZE 100 + + +/* Define the ThreadX object control blocks... */ + +TX_THREAD thread_0; +TX_THREAD thread_1; +TX_THREAD thread_2; +TX_THREAD thread_3; +TX_THREAD thread_4; +TX_THREAD thread_5; +TX_THREAD thread_6; +TX_THREAD thread_7; +TX_QUEUE queue_0; +TX_SEMAPHORE semaphore_0; +TX_MUTEX mutex_0; +TX_EVENT_FLAGS_GROUP event_flags_0; +TX_BYTE_POOL byte_pool_0; +TX_BLOCK_POOL block_pool_0; + + +/* Define the counters used in the demo application... */ + +ULONG thread_0_counter; +ULONG thread_1_counter; +ULONG thread_1_messages_sent; +ULONG thread_2_counter; +ULONG thread_2_messages_received; +ULONG thread_3_counter; +ULONG thread_4_counter; +ULONG thread_5_counter; +ULONG thread_6_counter; +ULONG thread_7_counter; + + +/* Define thread prototypes. */ + +void thread_0_entry(ULONG thread_input); +void thread_1_entry(ULONG thread_input); +void thread_2_entry(ULONG thread_input); +void thread_3_and_4_entry(ULONG thread_input); +void thread_5_entry(ULONG thread_input); +void thread_6_and_7_entry(ULONG thread_input); + + +/* Define main entry point. */ + +int main() +{ + + /* Enter the ThreadX kernel. */ + tx_kernel_enter(); +} + + +/* Define what the initial system looks like. */ + +void tx_application_define(void *first_unused_memory) +{ + +CHAR *pointer = TX_NULL; + + + /* Create a byte memory pool from which to allocate the thread stacks. */ + tx_byte_pool_create(&byte_pool_0, "byte pool 0", first_unused_memory, DEMO_BYTE_POOL_SIZE); + + /* Put system definition stuff in here, e.g. thread creates and other assorted + create information. */ + + /* Allocate the stack for thread 0. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 1, 1, TX_NO_TIME_SLICE, TX_AUTO_START); + + + /* Allocate the stack for thread 1. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create threads 1 and 2. These threads pass information through a ThreadX + message queue. It is also interesting to note that these threads have a time + slice. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, DEMO_STACK_SIZE, + 16, 16, 4, TX_AUTO_START); + + /* Allocate the stack for thread 2. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, DEMO_STACK_SIZE, + 16, 16, 4, TX_AUTO_START); + + /* Allocate the stack for thread 3. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create threads 3 and 4. These threads compete for a ThreadX counting semaphore. + An interesting thing here is that both threads share the same instruction area. */ + tx_thread_create(&thread_3, "thread 3", thread_3_and_4_entry, 3, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 4. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + tx_thread_create(&thread_4, "thread 4", thread_3_and_4_entry, 4, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 5. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create thread 5. This thread simply pends on an event flag which will be set + by thread_0. */ + tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 6. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create threads 6 and 7. These threads compete for a ThreadX mutex. */ + tx_thread_create(&thread_6, "thread 6", thread_6_and_7_entry, 6, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 7. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + tx_thread_create(&thread_7, "thread 7", thread_6_and_7_entry, 7, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the message queue. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_QUEUE_SIZE*sizeof(ULONG), TX_NO_WAIT); + + /* Create the message queue shared by threads 1 and 2. */ + tx_queue_create(&queue_0, "queue 0", TX_1_ULONG, pointer, DEMO_QUEUE_SIZE*sizeof(ULONG)); + + /* Create the semaphore used by threads 3 and 4. */ + tx_semaphore_create(&semaphore_0, "semaphore 0", 1); + + /* Create the event flags group used by threads 1 and 5. */ + tx_event_flags_create(&event_flags_0, "event flags 0"); + + /* Create the mutex used by thread 6 and 7 without priority inheritance. */ + tx_mutex_create(&mutex_0, "mutex 0", TX_NO_INHERIT); + + /* Allocate the memory for a small block pool. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_BLOCK_POOL_SIZE, TX_NO_WAIT); + + /* Create a block memory pool to allocate a message buffer from. */ + tx_block_pool_create(&block_pool_0, "block pool 0", sizeof(ULONG), pointer, DEMO_BLOCK_POOL_SIZE); + + /* Allocate a block and release the block memory. */ + tx_block_allocate(&block_pool_0, (VOID **) &pointer, TX_NO_WAIT); + + /* Release the block back to the pool. */ + tx_block_release(pointer); +} + + + +/* Define the test threads. */ + +void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + + /* This thread simply sits in while-forever-sleep loop. */ + while(1) + { + + /* Increment the thread counter. */ + thread_0_counter++; + + /* Sleep for 10 ticks. */ + tx_thread_sleep(10); + + /* Set event flag 0 to wakeup thread 5. */ + status = tx_event_flags_set(&event_flags_0, 0x1, TX_OR); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + } +} + + +void thread_1_entry(ULONG thread_input) +{ + +UINT status; + + + /* This thread simply sends messages to a queue shared by thread 2. */ + while(1) + { + + /* Increment the thread counter. */ + thread_1_counter++; + + /* Send message to queue 0. */ + status = tx_queue_send(&queue_0, &thread_1_messages_sent, TX_WAIT_FOREVER); + + /* Check completion status. */ + if (status != TX_SUCCESS) + break; + + /* Increment the message sent. */ + thread_1_messages_sent++; + } +} + + +void thread_2_entry(ULONG thread_input) +{ + +ULONG received_message; +UINT status; + + /* This thread retrieves messages placed on the queue by thread 1. */ + while(1) + { + + /* Increment the thread counter. */ + thread_2_counter++; + + /* Retrieve a message from the queue. */ + status = tx_queue_receive(&queue_0, &received_message, TX_WAIT_FOREVER); + + /* Check completion status and make sure the message is what we + expected. */ + if ((status != TX_SUCCESS) || (received_message != thread_2_messages_received)) + break; + + /* Otherwise, all is okay. Increment the received message count. */ + thread_2_messages_received++; + } +} + + +void thread_3_and_4_entry(ULONG thread_input) +{ + +UINT status; + + + /* This function is executed from thread 3 and thread 4. As the loop + below shows, these function compete for ownership of semaphore_0. */ + while(1) + { + + /* Increment the thread counter. */ + if (thread_input == 3) + thread_3_counter++; + else + thread_4_counter++; + + /* Get the semaphore with suspension. */ + status = tx_semaphore_get(&semaphore_0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Sleep for 2 ticks to hold the semaphore. */ + tx_thread_sleep(2); + + /* Release the semaphore. */ + status = tx_semaphore_put(&semaphore_0); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + } +} + + +void thread_5_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_flags; + + + /* This thread simply waits for an event in a forever loop. */ + while(1) + { + + /* Increment the thread counter. */ + thread_5_counter++; + + /* Wait for event flag 0. */ + status = tx_event_flags_get(&event_flags_0, 0x1, TX_OR_CLEAR, + &actual_flags, TX_WAIT_FOREVER); + + /* Check status. */ + if ((status != TX_SUCCESS) || (actual_flags != 0x1)) + break; + } +} + + +void thread_6_and_7_entry(ULONG thread_input) +{ + +UINT status; + + + /* This function is executed from thread 6 and thread 7. As the loop + below shows, these function compete for ownership of mutex_0. */ + while(1) + { + + /* Increment the thread counter. */ + if (thread_input == 6) + thread_6_counter++; + else + thread_7_counter++; + + /* Get the mutex with suspension. */ + status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Get the mutex again with suspension. This shows + that an owning thread may retrieve the mutex it + owns multiple times. */ + status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Sleep for 2 ticks to hold the mutex. */ + tx_thread_sleep(2); + + /* Release the mutex. */ + status = tx_mutex_put(&mutex_0); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Release the mutex again. This will actually + release ownership since it was obtained twice. */ + status = tx_mutex_put(&mutex_0); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + } +} diff --git a/ports/cortex_a15/ac6/example_build/sample_threadx/.cproject b/ports/cortex_a15/ac6/example_build/sample_threadx/.cproject index b9c92970..9a96fceb 100644 --- a/ports/cortex_a15/ac6/example_build/sample_threadx/.cproject +++ b/ports/cortex_a15/ac6/example_build/sample_threadx/.cproject @@ -3,9 +3,9 @@ - + - + @@ -23,41 +23,37 @@ - + - + - + - + + + + + + @@ -137,7 +139,7 @@ - + @@ -168,5 +170,7 @@ + + diff --git a/ports/cortex_a15/ac6/example_build/sample_threadx/.project b/ports/cortex_a15/ac6/example_build/sample_threadx/.project index 2a6b3cb1..ed4c0885 100644 --- a/ports/cortex_a15/ac6/example_build/sample_threadx/.project +++ b/ports/cortex_a15/ac6/example_build/sample_threadx/.project @@ -20,7 +20,6 @@ - com.arm.debug.ds.nature org.eclipse.cdt.core.cnature org.eclipse.cdt.managedbuilder.core.managedBuildNature org.eclipse.cdt.managedbuilder.core.ScannerConfigNature diff --git a/ports/cortex_a15/ac6/example_build/sample_threadx/sample_threadx.c b/ports/cortex_a15/ac6/example_build/sample_threadx/sample_threadx.c index 418ec634..8c61de06 100644 --- a/ports/cortex_a15/ac6/example_build/sample_threadx/sample_threadx.c +++ b/ports/cortex_a15/ac6/example_build/sample_threadx/sample_threadx.c @@ -1,5 +1,5 @@ /* This is a small demo of the high-performance ThreadX kernel. It includes examples of eight - threads of different priorities, using a message queue, semaphore, mutex, event flags group, + threads of different priorities, using a message queue, semaphore, mutex, event flags group, byte pool, and block pool. */ #include "tx_api.h" @@ -80,42 +80,42 @@ CHAR *pointer = TX_NULL; tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); /* Create the main thread. */ - tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, 1, 1, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 1. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - /* Create threads 1 and 2. These threads pass information through a ThreadX + /* Create threads 1 and 2. These threads pass information through a ThreadX message queue. It is also interesting to note that these threads have a time slice. */ - tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, DEMO_STACK_SIZE, 16, 16, 4, TX_AUTO_START); /* Allocate the stack for thread 2. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, DEMO_STACK_SIZE, 16, 16, 4, TX_AUTO_START); /* Allocate the stack for thread 3. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - /* Create threads 3 and 4. These threads compete for a ThreadX counting semaphore. + /* Create threads 3 and 4. These threads compete for a ThreadX counting semaphore. An interesting thing here is that both threads share the same instruction area. */ - tx_thread_create(&thread_3, "thread 3", thread_3_and_4_entry, 3, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_3, "thread 3", thread_3_and_4_entry, 3, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 4. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - tx_thread_create(&thread_4, "thread 4", thread_3_and_4_entry, 4, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_4, "thread 4", thread_3_and_4_entry, 4, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 5. */ @@ -123,23 +123,23 @@ CHAR *pointer = TX_NULL; /* Create thread 5. This thread simply pends on an event flag which will be set by thread_0. */ - tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, + pointer, DEMO_STACK_SIZE, 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 6. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); /* Create threads 6 and 7. These threads compete for a ThreadX mutex. */ - tx_thread_create(&thread_6, "thread 6", thread_6_and_7_entry, 6, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_6, "thread 6", thread_6_and_7_entry, 6, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 7. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - tx_thread_create(&thread_7, "thread 7", thread_6_and_7_entry, 7, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_7, "thread 7", thread_6_and_7_entry, 7, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the message queue. */ @@ -242,11 +242,11 @@ UINT status; /* Retrieve a message from the queue. */ status = tx_queue_receive(&queue_0, &received_message, TX_WAIT_FOREVER); - /* Check completion status and make sure the message is what we + /* Check completion status and make sure the message is what we expected. */ if ((status != TX_SUCCESS) || (received_message != thread_2_messages_received)) break; - + /* Otherwise, all is okay. Increment the received message count. */ thread_2_messages_received++; } @@ -305,7 +305,7 @@ ULONG actual_flags; thread_5_counter++; /* Wait for event flag 0. */ - status = tx_event_flags_get(&event_flags_0, 0x1, TX_OR_CLEAR, + status = tx_event_flags_get(&event_flags_0, 0x1, TX_OR_CLEAR, &actual_flags, TX_WAIT_FOREVER); /* Check status. */ @@ -358,7 +358,7 @@ UINT status; if (status != TX_SUCCESS) break; - /* Release the mutex again. This will actually + /* Release the mutex again. This will actually release ownership since it was obtained twice. */ status = tx_mutex_put(&mutex_0); diff --git a/ports/cortex_a15/ac6/example_build/sample_threadx/sample_threadx.launch b/ports/cortex_a15/ac6/example_build/sample_threadx/sample_threadx.launch new file mode 100644 index 00000000..016eebe6 --- /dev/null +++ b/ports/cortex_a15/ac6/example_build/sample_threadx/sample_threadx.launch @@ -0,0 +1,188 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ports/cortex_a15/ac6/example_build/sample_threadx/sample_threadx.scat b/ports/cortex_a15/ac6/example_build/sample_threadx/sample_threadx.scat index 8e648890..d23881cd 100644 --- a/ports/cortex_a15/ac6/example_build/sample_threadx/sample_threadx.scat +++ b/ports/cortex_a15/ac6/example_build/sample_threadx/sample_threadx.scat @@ -1,47 +1,44 @@ -;************************************************** -; Copyright (c) 2011 Arm Limited (or its affiliates). All rights reserved. +;******************************************************* +; Copyright (c) 2011-2016 Arm Limited (or its affiliates). All rights reserved. ; Use, modification and redistribution of this file is subject to your possession of a ; valid End User License Agreement for the Arm Product of which these examples are part of ; and your compliance with all applicable terms and conditions of such licence agreement. -;************************************************** +;******************************************************* -; Scatter-file for bare-metal example on Versatile Express +; Scatter-file for ARMv7-A bare-metal example on Versatile Express -; This scatter-file places application code, data, stack and heap at suitable addresses in the Versatile Express Cortex-A15 Core memory map. - -; Versatile Express Cortex-A15 Core has SDRAM at 0x80000000, which this scatter-file uses. +; This scatter-file places application code, data, stack and heap at suitable addresses in the memory map. -SDRAM 0x80000000 +SDRAM 0x80000000 0x20000000 { VECTORS +0 { * (VECTORS, +FIRST) ; Vector table and other (assembler) startup code * (InRoot$$Sections) ; All (library) code that must be in a root region } - - RO_CODE +0 - { * (+RO-CODE) } ; Application RO code (.text) - RO_DATA +0 - { * (+RO-DATA) } ; Application RO data (.constdata) + RO_CODE +0 + { * (+RO-CODE) } ; Application RO code (.text) - RW_DATA +0 - { * (+RW) } ; Application RW data (.data) + RO_DATA +0 + { * (+RO-DATA) } ; Application RO data (.constdata) - ZI_DATA +0 - { * (+ZI) } ; Application ZI data (.bss) + RW_DATA +0 + { * (+RW) } ; Application RW data (.data) - ARM_LIB_HEAP 0x80040000 EMPTY 0x00040000 ; Application heap - { } + ZI_DATA +0 + { * (+ZI) } ; Application ZI data (.bss) - ARM_LIB_STACK 0x80090000 EMPTY -0x00010000 ; Application (SVC mode) stack - { } + ARM_LIB_HEAP 0x80040000 EMPTY 0x00040000 ; Application heap + { } - ;IRQ_STACK 0x800A0000 EMPTY -0x00010000 ; IRQ mode stack - ;{ } + ARM_LIB_STACK 0x80090000 EMPTY 0x00010000 ; Application (SVC mode) stack + { } - TTB 0x80100000 EMPTY 0x4000 ; Level-1 Translation Table for MMU - { } +; IRQ_STACK 0x800A0000 EMPTY -0x00010000 ; IRQ mode stack +; { } + TTB 0x80100000 EMPTY 0x4000 ; Level-1 Translation Table for MMU + { } } diff --git a/ports/cortex_a15/ac6/example_build/sample_threadx/startup.S b/ports/cortex_a15/ac6/example_build/sample_threadx/startup.S index 8bfa1982..670fadb9 100644 --- a/ports/cortex_a15/ac6/example_build/sample_threadx/startup.S +++ b/ports/cortex_a15/ac6/example_build/sample_threadx/startup.S @@ -1,31 +1,31 @@ //---------------------------------------------------------------- -// Cortex-A15 Embedded example - Startup Code +// ARMv7-A Embedded example - Startup Code // // Copyright (c) 2005-2018 Arm Limited (or its affiliates). All rights reserved. // Use, modification and redistribution of this file is subject to your possession of a -// valid End User License Agreement for the Arm Product of which these examples are part of +// valid End User License Agreement for the Arm Product of which these examples are part of // and your compliance with all applicable terms and conditions of such licence agreement. //---------------------------------------------------------------- - // Standard definitions of mode bits and interrupt (I & F) flags in PSRs -#define Mode_USR 0x10 -#define Mode_FIQ 0x11 -#define Mode_IRQ 0x12 -#define Mode_SVC 0x13 -#define Mode_ABT 0x17 -#define Mode_UND 0x1B -#define Mode_SYS 0x1F +#define Mode_USR 0x10 +#define Mode_FIQ 0x11 +#define Mode_IRQ 0x12 +#define Mode_SVC 0x13 +#define Mode_ABT 0x17 +#define Mode_UND 0x1B +#define Mode_SYS 0x1F -#define I_Bit 0x80 // When I bit is set, IRQ is disabled -#define F_Bit 0x40 // When F bit is set, FIQ is disabled +#define I_Bit 0x80 // When I bit is set, IRQ is disabled +#define F_Bit 0x40 // When F bit is set, FIQ is disabled .section VECTORS, "ax" .align 3 .cfi_sections .debug_frame // put stack frame info into .debug_frame instead of .eh_frame + //---------------------------------------------------------------- // Entry point for the Reset handler //---------------------------------------------------------------- @@ -48,29 +48,23 @@ Vectors: LDR PC, IRQ_Addr LDR PC, FIQ_Addr + .balign 4 Reset_Addr: .word Reset_Handler Undefined_Addr: - //.word Undefined_Handler .word __tx_undefined SVC_Addr: - //.word SVC_Handler .word __tx_swi_interrupt Prefetch_Addr: - //.word Prefetch_Handler .word __tx_prefetch_handler Abort_Addr: - //.word Abort_Handler .word __tx_abort_handler Hypervisor_Addr: - //.word Hypervisor_Handler .word __tx_reserved_handler IRQ_Addr: - //.word IRQ_Handler .word __tx_irq_handler FIQ_Addr: - //.word FIQ_Handler .word __tx_fiq_handler @@ -100,26 +94,24 @@ FIQ_Handler: Reset_Handler: //---------------------------------------------------------------- -// Disable caches, MMU and branch prediction in case they were left enabled from an earlier run +// Disable caches and MMU in case they were left enabled from an earlier run // This does not need to be done from a cold reset //---------------------------------------------------------------- - MRC p15, 0, r0, c1, c0, 0 // Read System Control Register - BIC r0, r0, #(0x1 << 12) // Clear I bit 12 to disable I Cache - BIC r0, r0, #(0x1 << 2) // Clear C bit 2 to disable D Cache - BIC r0, r0, #0x1 // Clear M bit 0 to disable MMU - BIC r0, r0, #(0x1 << 11) // Clear Z bit 11 to disable branch prediction - MCR p15, 0, r0, c1, c0, 0 // Write System Control Register - ISB + MRC p15, 0, r0, c1, c0, 0 // Read System Control Register + BIC r0, r0, #(0x1 << 12) // Clear I bit 12 to disable I Cache + BIC r0, r0, #(0x1 << 2) // Clear C bit 2 to disable D Cache + BIC r0, r0, #0x1 // Clear M bit 0 to disable MMU + BIC r0, r0, #(0x1 << 11) // Clear Z bit 11 to disable branch prediction + MCR p15, 0, r0, c1, c0, 0 // Write System Control Register + ISB -// The MMU is enabled later, before calling main(). Caches and branch prediction are enabled inside main(), +// The MMU is enabled later, before calling main(). Caches are enabled inside main(), // after the MMU has been enabled and scatterloading has been performed. //---------------------------------------------------------------- -// ACTLR.SMP bit must be set before the caches and MMU are enabled, -// or any cache and TLB maintenance operations are performed, even for "AMP" CPUs. -// In the Cortex-A15 processor, the L1 data cache and L2 cache are always coherent, -// for shared or non-shared data, regardless of the value of the SMP bit. +// ACTLR.SMP bit must be set before the caches and MMU are enabled, +// or any cache and TLB maintenance operations are performed, even for single-core //---------------------------------------------------------------- MRC p15, 0, r0, c1, c0, 1 // Read ACTLR ORR r0, r0, #(1 << 6) // Set ACTLR.SMP bit @@ -127,7 +119,7 @@ Reset_Handler: ISB //---------------------------------------------------------------- -// Invalidate Data and Instruction TLBs and branch predictor in case they were left enabled from an earlier run +// Invalidate Data and Instruction TLBs and branch predictor // This does not need to be done from a cold reset //---------------------------------------------------------------- @@ -170,8 +162,8 @@ notA15r0p0: MCR p15, 0, r0, c12, c0, 0 //---------------------------------------------------------------- -// Cache Invalidation code for Cortex-A15 -// NOTE: Neither Caches, nor MMU, nor BTB need post-reset invalidation on Cortex-A15, +// Cache Invalidation code for ARMv7-A +// The caches, MMU and BTB do not need post-reset invalidation on Cortex-A7, // but forcing a cache invalidation makes the code more portable to other CPUs (e.g. Cortex-A9) //---------------------------------------------------------------- @@ -190,7 +182,8 @@ notA15r0p0: BEQ Finished // If 0, no need to clean MOV r10, #0 // R10 holds current cache level << 1 -Loop1: ADD r2, r10, r10, LSR #1 // R2 holds cache "Set" position +Loop1: + ADD r2, r10, r10, LSR #1 // R2 holds cache "Set" position MOV r1, r0, LSR r2 // Bottom 3 bits are the Cache-type for this level AND r1, r1, #7 // Isolate those lower 3 bits CMP r1, #2 @@ -207,16 +200,19 @@ Loop1: ADD r2, r10, r10, LSR #1 // R2 holds cache "Set" position LDR r7, =0x7FFF ANDS r7, r7, r1, LSR #13 // R7 is the max number of the index size (right aligned) -Loop2: MOV r9, r4 // R9 working copy of the max way size (right aligned) +Loop2: + MOV r9, r4 // R9 working copy of the max way size (right aligned) -Loop3: ORR r11, r10, r9, LSL r5 // Factor in the Way number and cache number into R11 +Loop3: + ORR r11, r10, r9, LSL r5 // Factor in the Way number and cache number into R11 ORR r11, r11, r7, LSL r2 // Factor in the Set number MCR p15, 0, r11, c7, c6, 2 // Invalidate by Set/Way SUBS r9, r9, #1 // Decrement the Way number BGE Loop3 SUBS r7, r7, #1 // Decrement the Set number BGE Loop2 -Skip: ADD r10, r10, #2 // Increment the cache number +Skip: + ADD r10, r10, #2 // Increment the cache number CMP r3, r10 BGT Loop1 @@ -237,11 +233,13 @@ Finished: // write the address of our page table base to TTB register 0 LDR r0,=Image$$TTB$$ZI$$Base + MOV r1, #0x08 // RGN=b01 (outer cacheable write-back cached, write allocate) // S=0 (translation table walk to non-shared memory) ORR r1,r1,#0x40 // IRGN=b01 (inner cacheability for the translation table walk is Write-back Write-allocate) ORR r0,r0,r1 + MCR p15, 0, r0, c2, c0, 0 @@ -259,7 +257,7 @@ Finished: // Bits[31:20] - Top 12 bits of VA is pointer into table // nG[17]=0 - Non global, enables matching against ASID in the TLB when set. // S[16]=0 - Indicates normal memory is shared when set. -// AP2[15]=0 +// AP2[15]=0 // AP[11:10]=11 - Configure for full read/write access in all modes // TEX[14:12]=000 // CB[3:2]= 00 - Set attributes to Strongly-ordered memory. @@ -269,32 +267,32 @@ Finished: // XN[4]=1 - Execute never on Strongly-ordered memory // Bits[1:0]=10 - Indicate entry is a 1MB section //---------------------------------------------------------------- - LDR r0, =Image$$TTB$$ZI$$Base + LDR r0,=Image$$TTB$$ZI$$Base LDR r1,=0xfff // loop counter - LDR r2,=3554 + LDR r2,=0b00000000000000000000110111100010 // r0 contains the address of the translation table base // r1 is loop counter // r2 is level1 descriptor (bits 19:0) // use loop counter to create 4096 individual table entries. - // this writes from address 'Image$$TTB$$ZI$$Base' + + // this writes from address 'Image$$TTB$$ZI$$Base' + // offset 0x3FFC down to offset 0x0 in word steps (4 bytes) init_ttb_1: ORR r3, r2, r1, LSL#20 // R3 now contains full level1 descriptor to write - ORR r3, r3, #16 // Set XN bit + ORR r3, r3, #0b0000000010000 // Set XN bit STR r3, [r0, r1, LSL#2] // Str table entry at TTB base + loopcount*4 SUBS r1, r1, #1 // Decrement loop counter BPL init_ttb_1 - // In this example, the 1MB section based at 'Image$$VECTORS$$Base' is setup specially as cacheable (write back mode). + // In this example, the 1MB section based at '__code_start' is setup specially as cacheable (write back mode). // TEX[14:12]=001 and CB[3:2]= 11, Outer and inner write back, write allocate normal memory. - LDR r1, =Image$$VECTORS$$Base // Base physical address of code segment + LDR r1,=Image$$VECTORS$$Base // Base physical address of code segment LSR r1, #20 // Shift right to align to 1MB boundaries ORR r3, r2, r1, LSL#20 // Setup the initial level1 descriptor again - ORR r3, r3, #12 // Set CB bits - ORR r3, r3, #4096 // Set TEX bit 12 + ORR r3, r3, #0b0000000001100 // Set CB bits + ORR r3, r3, #0b1000000000000 // Set TEX bit 12 STR r3, [r0, r1, LSL#2] // str table entry //---------------------------------------------------------------- @@ -306,7 +304,6 @@ init_ttb_1: MCR p15, 0, r0, c3, c0, 0 // Write Domain Access Control Register #if defined(__ARM_NEON) || defined(__ARM_FP) - //---------------------------------------------------------------- // Enable access to NEON/VFP by enabling access to Coprocessors 10 and 11. // Enables Full Access i.e. in both privileged and non privileged modes @@ -325,15 +322,14 @@ init_ttb_1: VMSR FPEXC, r0 // Write FPEXC register, EN bit set #endif - + //---------------------------------------------------------------- // Enable MMU and branch to __main // Leaving the caches disabled until after scatter loading. //---------------------------------------------------------------- - LDR r12,=__main // Save this in register for possible long jump + LDR r12,=__main -#if 0 MRC p15, 0, r0, c1, c0, 0 // Read System Control Register BIC r0, r0, #(0x1 << 12) // Clear I bit 12 to disable I Cache BIC r0, r0, #(0x1 << 2) // Clear C bit 2 to disable D Cache @@ -341,7 +337,6 @@ init_ttb_1: ORR r0, r0, #0x1 // Set M bit 0 to enable MMU before scatter loading MCR p15, 0, r0, c1, c0, 0 // Write System Control Register ISB -#endif // Now the MMU is enabled, virtual to physical address translations will occur. This will affect the next // instruction fetch. @@ -350,7 +345,7 @@ init_ttb_1: // The branch to __main is safe because the Virtual Address (VA) is the same as the Physical Address (PA) // (flat mapping) of this code that enables the MMU and performs the branch - BX r12 // Branch to __main C library entry point + BX r12 // Branch to __main C library entry point @@ -378,7 +373,25 @@ enable_caches: MCR p15, 0, r0, c1, c0, 0 // Write System Control Register ISB - BX lr + MRC p15, 0, r0, c1, c0, 1 // Read Auxiliary Control Register + ORR r0, #2 // L2EN bit, enable L2 cache + ORR r0, r0, #(0x1 << 2) // Set DP bit 2 to enable L1 Dside prefetch + MCR p15, 0, r0, c1, c0, 1 // Write Auxiliary Control Register + ISB + BX lr .cfi_endproc + .global disable_caches + .type disable_caches, "function" +disable_caches: + + MRC p15, 0, r0, c1, c0, 0 // Read System Control Register + BIC r0, r0, #(0x1 << 12) // Clear I bit 12 to disable I Cache + BIC r0, r0, #(0x1 << 2) // Clear C bit 2 to disable D Cache + MCR p15, 0, r0, c1, c0, 0 // Write System Control Register + ISB + + BX lr + + diff --git a/ports/cortex_a15/ac6/example_build/sample_threadx/tx_initialize_low_level.S b/ports/cortex_a15/ac6/example_build/sample_threadx/tx_initialize_low_level.S index 7ea1cf8c..715958f0 100644 --- a/ports/cortex_a15/ac6/example_build/sample_threadx/tx_initialize_low_level.S +++ b/ports/cortex_a15/ac6/example_build/sample_threadx/tx_initialize_low_level.S @@ -1,345 +1,299 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Initialize */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_initialize.h" -@#include "tx_thread.h" -@#include "tx_timer.h" +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Initialize */ +/** */ +/**************************************************************************/ +/**************************************************************************/ .arm -SVC_MODE = 0xD3 @ Disable IRQ/FIQ SVC mode -IRQ_MODE = 0xD2 @ Disable IRQ/FIQ IRQ mode -FIQ_MODE = 0xD1 @ Disable IRQ/FIQ FIQ mode -SYS_MODE = 0xDF @ Disable IRQ/FIQ SYS mode -FIQ_STACK_SIZE = 512 @ FIQ stack size -IRQ_STACK_SIZE = 1024 @ IRQ stack size -SYS_STACK_SIZE = 1024 @ System stack size -@ -@ +SVC_MODE = 0xD3 // Disable IRQ/FIQ SVC mode +IRQ_MODE = 0xD2 // Disable IRQ/FIQ IRQ mode +FIQ_MODE = 0xD1 // Disable IRQ/FIQ FIQ mode +SYS_MODE = 0xDF // Disable IRQ/FIQ SYS mode +FIQ_STACK_SIZE = 512 // FIQ stack size +IRQ_STACK_SIZE = 1024 // IRQ stack size +SYS_STACK_SIZE = 1024 // System stack size + .global _tx_thread_system_stack_ptr .global _tx_initialize_unused_memory .global _tx_thread_context_save .global _tx_thread_context_restore .global _tx_timer_interrupt -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_initialize_low_level for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + + +/* Define the 16-bit Thumb mode veneer for _tx_initialize_low_level for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .thumb .global $_tx_initialize_low_level .type $_tx_initialize_low_level,function $_tx_initialize_low_level: - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_initialize_low_level @ Call _tx_initialize_low_level function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_initialize_low_level // Call _tx_initialize_low_level function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_initialize_low_level Cortex-A15/AC6 */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is responsible for any low-level processor */ -@/* initialization, including setting up interrupt vectors, setting */ -@/* up a periodic timer interrupt source, saving the system stack */ -@/* pointer for use in ISR processing later, and finding the first */ -@/* available RAM memory address for tx_application_define. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* _tx_initialize_kernel_enter ThreadX entry function */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_initialize_low_level(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_initialize_low_level ARMV7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for any low-level processor */ +/* initialization, including setting up interrupt vectors, setting */ +/* up a periodic timer interrupt source, saving the system stack */ +/* pointer for use in ISR processing later, and finding the first */ +/* available RAM memory address for tx_application_define. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_initialize_kernel_enter ThreadX entry function */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_initialize_low_level .type _tx_initialize_low_level,function _tx_initialize_low_level: -@ -@ /* We must be in SVC mode at this point! */ -@ -@ /* Setup various stack pointers. */ -@ - LDR r1, =Image$$ARM_LIB_STACK$$ZI$$Limit @ Get pointer to stack area -#ifdef TX_ENABLE_IRQ_NESTING -@ -@ /* Setup the system mode stack for nested interrupt support */ -@ - LDR r2, =SYS_STACK_SIZE @ Pickup stack size - MOV r3, #SYS_MODE @ Build SYS mode CPSR - MSR CPSR_c, r3 @ Enter SYS mode - SUB r1, r1, #1 @ Backup 1 byte - BIC r1, r1, #7 @ Ensure 8-byte alignment - MOV sp, r1 @ Setup SYS stack pointer - SUB r1, r1, r2 @ Calculate start of next stack + /* We must be in SVC mode at this point! */ + + /* Setup various stack pointers. */ + + LDR r1, =Image$$ARM_LIB_STACK$$ZI$$Limit // Get pointer to stack area + +#ifdef TX_ENABLE_IRQ_NESTING + + /* Setup the system mode stack for nested interrupt support */ + + LDR r2, =SYS_STACK_SIZE // Pickup stack size + MOV r3, #SYS_MODE // Build SYS mode CPSR + MSR CPSR_c, r3 // Enter SYS mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup SYS stack pointer + SUB r1, r1, r2 // Calculate start of next stack #endif - LDR r2, =FIQ_STACK_SIZE @ Pickup stack size - MOV r0, #FIQ_MODE @ Build FIQ mode CPSR - MSR CPSR, r0 @ Enter FIQ mode - SUB r1, r1, #1 @ Backup 1 byte - BIC r1, r1, #7 @ Ensure 8-byte alignment - MOV sp, r1 @ Setup FIQ stack pointer - SUB r1, r1, r2 @ Calculate start of next stack - LDR r2, =IRQ_STACK_SIZE @ Pickup IRQ stack size - MOV r0, #IRQ_MODE @ Build IRQ mode CPSR - MSR CPSR, r0 @ Enter IRQ mode - SUB r1, r1, #1 @ Backup 1 byte - BIC r1, r1, #7 @ Ensure 8-byte alignment - MOV sp, r1 @ Setup IRQ stack pointer - SUB r3, r1, r2 @ Calculate end of IRQ stack - MOV r0, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR, r0 @ Enter SVC mode - LDR r2, =Image$$ARM_LIB_STACK$$Base @ Pickup stack bottom - CMP r3, r2 @ Compare the current stack end with the bottom -_stack_error_loop: - BLT _stack_error_loop @ If the IRQ stack exceeds the stack bottom, just sit here! -@ -@ /* Save the system stack pointer. */ -@ _tx_thread_system_stack_ptr = (VOID_PTR) (sp); -@ - LDR r2, =_tx_thread_system_stack_ptr @ Pickup stack pointer - STR r1, [r2] @ Save the system stack -@ -@ /* Save the first available memory address. */ -@ _tx_initialize_unused_memory = (VOID_PTR) _end; -@ - LDR r1, =Image$$ZI_DATA$$ZI$$Limit @ Get end of non-initialized RAM area - LDR r2, =_tx_initialize_unused_memory @ Pickup unused memory ptr address - ADD r1, r1, #8 @ Increment to next free word - STR r1, [r2] @ Save first free memory address -@ -@ /* Setup Timer for periodic interrupts. */ -@ -@ /* Done, return to caller. */ -@ + LDR r2, =FIQ_STACK_SIZE // Pickup stack size + MOV r0, #FIQ_MODE // Build FIQ mode CPSR + MSR CPSR, r0 // Enter FIQ mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup FIQ stack pointer + SUB r1, r1, r2 // Calculate start of next stack + LDR r2, =IRQ_STACK_SIZE // Pickup IRQ stack size + MOV r0, #IRQ_MODE // Build IRQ mode CPSR + MSR CPSR, r0 // Enter IRQ mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup IRQ stack pointer + SUB r3, r1, r2 // Calculate end of IRQ stack + MOV r0, #SVC_MODE // Build SVC mode CPSR + MSR CPSR, r0 // Enter SVC mode + LDR r2, =Image$$ARM_LIB_STACK$$Base // Pickup stack bottom + CMP r3, r2 // Compare the current stack end with the bottom +_stack_error_loop: + BLT _stack_error_loop // If the IRQ stack exceeds the stack bottom, just sit here! + + LDR r2, =_tx_thread_system_stack_ptr // Pickup stack pointer + STR r1, [r2] // Save the system stack + + LDR r1, =Image$$ZI_DATA$$ZI$$Limit // Get end of non-initialized RAM area + LDR r2, =_tx_initialize_unused_memory // Pickup unused memory ptr address + ADD r1, r1, #8 // Increment to next free word + STR r1, [r2] // Save first free memory address + #ifdef __THUMB_INTERWORK - BX lr @ Return to caller + BX lr // Return to caller #else - MOV pc, lr @ Return to caller + MOV pc, lr // Return to caller #endif -@} -@ -@ -@/* Define shells for each of the interrupt vectors. */ -@ + +/* Define shells for each of the interrupt vectors. */ + .global __tx_undefined __tx_undefined: - B __tx_undefined @ Undefined handler -@ + B __tx_undefined // Undefined handler + .global __tx_swi_interrupt __tx_swi_interrupt: - B __tx_swi_interrupt @ Software interrupt handler -@ + B __tx_swi_interrupt // Software interrupt handler + .global __tx_prefetch_handler __tx_prefetch_handler: - B __tx_prefetch_handler @ Prefetch exception handler -@ + B __tx_prefetch_handler // Prefetch exception handler + .global __tx_abort_handler __tx_abort_handler: - B __tx_abort_handler @ Abort exception handler -@ + B __tx_abort_handler // Abort exception handler + .global __tx_reserved_handler __tx_reserved_handler: - B __tx_reserved_handler @ Reserved exception handler -@ - .global __tx_irq_processing_return + B __tx_reserved_handler // Reserved exception handler + + .global __tx_irq_processing_return .type __tx_irq_processing_return,function - .global __tx_irq_handler + .global __tx_irq_handler __tx_irq_handler: -@ -@ /* Jump to context save to save system context. */ + + /* Jump to context save to save system context. */ B _tx_thread_context_save __tx_irq_processing_return: -@ -@ /* At this point execution is still in the IRQ mode. The CPSR, point of -@ interrupt, and all C scratch registers are available for use. In -@ addition, IRQ interrupts may be re-enabled - with certain restrictions - -@ if nested IRQ interrupts are desired. Interrupts may be re-enabled over -@ small code sequences where lr is saved before enabling interrupts and -@ restored after interrupts are again disabled. */ -@ -@ /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start -@ from IRQ mode with interrupts disabled. This routine switches to the -@ system mode and returns with IRQ interrupts enabled. -@ -@ NOTE: It is very important to ensure all IRQ interrupts are cleared -@ prior to enabling nested IRQ interrupts. */ + + /* At this point execution is still in the IRQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. In + addition, IRQ interrupts may be re-enabled - with certain restrictions - + if nested IRQ interrupts are desired. Interrupts may be re-enabled over + small code sequences where lr is saved before enabling interrupts and + restored after interrupts are again disabled. */ + + /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start + from IRQ mode with interrupts disabled. This routine switches to the + system mode and returns with IRQ interrupts enabled. + + NOTE: It is very important to ensure all IRQ interrupts are cleared + prior to enabling nested IRQ interrupts. */ #ifdef TX_ENABLE_IRQ_NESTING BL _tx_thread_irq_nesting_start #endif -@ -@ /* For debug purpose, execute the timer interrupt processing here. In -@ a real system, some kind of status indication would have to be checked -@ before the timer interrupt handler could be called. */ -@ - BL _tx_timer_interrupt @ Timer interrupt handler -@ -@ -@ /* If interrupt nesting was started earlier, the end of interrupt nesting -@ service must be called before returning to _tx_thread_context_restore. -@ This routine returns in processing in IRQ mode with interrupts disabled. */ + + /* For debug purpose, execute the timer interrupt processing here. In + a real system, some kind of status indication would have to be checked + before the timer interrupt handler could be called. */ + + BL _tx_timer_interrupt // Timer interrupt handler + + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_context_restore. + This routine returns in processing in IRQ mode with interrupts disabled. */ #ifdef TX_ENABLE_IRQ_NESTING BL _tx_thread_irq_nesting_end #endif -@ -@ /* Jump to context restore to restore system context. */ + + /* Jump to context restore to restore system context. */ B _tx_thread_context_restore -@ -@ -@ /* This is an example of a vectored IRQ handler. */ -@ -@ .global __tx_example_vectored_irq_handler -@__tx_example_vectored_irq_handler: -@ -@ -@ /* Save initial context and call context save to prepare for -@ vectored ISR execution. */ -@ -@ STMDB sp!, {r0-r3} @ Save some scratch registers -@ MRS r0, SPSR @ Pickup saved SPSR -@ SUB lr, lr, #4 @ Adjust point of interrupt -@ STMDB sp!, {r0, r10, r12, lr} @ Store other scratch registers -@ BL _tx_thread_vectored_context_save @ Vectored context save -@ -@ /* At this point execution is still in the IRQ mode. The CPSR, point of -@ interrupt, and all C scratch registers are available for use. In -@ addition, IRQ interrupts may be re-enabled - with certain restrictions - -@ if nested IRQ interrupts are desired. Interrupts may be re-enabled over -@ small code sequences where lr is saved before enabling interrupts and -@ restored after interrupts are again disabled. */ -@ -@ -@ /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start -@ from IRQ mode with interrupts disabled. This routine switches to the -@ system mode and returns with IRQ interrupts enabled. -@ -@ NOTE: It is very important to ensure all IRQ interrupts are cleared -@ prior to enabling nested IRQ interrupts. */ -@#ifdef TX_ENABLE_IRQ_NESTING -@ BL _tx_thread_irq_nesting_start -@#endif -@ -@ /* Application IRQ handlers can be called here! */ -@ -@ /* If interrupt nesting was started earlier, the end of interrupt nesting -@ service must be called before returning to _tx_thread_context_restore. -@ This routine returns in processing in IRQ mode with interrupts disabled. */ -@#ifdef TX_ENABLE_IRQ_NESTING -@ BL _tx_thread_irq_nesting_end -@#endif -@ -@ /* Jump to context restore to restore system context. */ -@ B _tx_thread_context_restore -@ -@ + + + /* This is an example of a vectored IRQ handler. */ + + /* At this point execution is still in the IRQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. In + addition, IRQ interrupts may be re-enabled - with certain restrictions - + if nested IRQ interrupts are desired. Interrupts may be re-enabled over + small code sequences where lr is saved before enabling interrupts and + restored after interrupts are again disabled. */ + + + /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start + from IRQ mode with interrupts disabled. This routine switches to the + system mode and returns with IRQ interrupts enabled. + + NOTE: It is very important to ensure all IRQ interrupts are cleared + prior to enabling nested IRQ interrupts. */ + + /* Application IRQ handlers can be called here! */ + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_context_restore. + This routine returns in processing in IRQ mode with interrupts disabled. */ + + /* Jump to context restore to restore system context. */ + #ifdef TX_ENABLE_FIQ_SUPPORT .global __tx_fiq_handler .global __tx_fiq_processing_return __tx_fiq_handler: -@ -@ /* Jump to fiq context save to save system context. */ + + /* Jump to fiq context save to save system context. */ B _tx_thread_fiq_context_save __tx_fiq_processing_return: -@ -@ /* At this point execution is still in the FIQ mode. The CPSR, point of -@ interrupt, and all C scratch registers are available for use. */ -@ -@ /* Interrupt nesting is allowed after calling _tx_thread_fiq_nesting_start -@ from FIQ mode with interrupts disabled. This routine switches to the -@ system mode and returns with FIQ interrupts enabled. -@ -@ NOTE: It is very important to ensure all FIQ interrupts are cleared -@ prior to enabling nested FIQ interrupts. */ + + /* At this point execution is still in the FIQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. */ + + /* Interrupt nesting is allowed after calling _tx_thread_fiq_nesting_start + from FIQ mode with interrupts disabled. This routine switches to the + system mode and returns with FIQ interrupts enabled. + + NOTE: It is very important to ensure all FIQ interrupts are cleared + prior to enabling nested FIQ interrupts. */ #ifdef TX_ENABLE_FIQ_NESTING BL _tx_thread_fiq_nesting_start #endif -@ -@ /* Application FIQ handlers can be called here! */ -@ -@ /* If interrupt nesting was started earlier, the end of interrupt nesting -@ service must be called before returning to _tx_thread_fiq_context_restore. */ + + /* Application FIQ handlers can be called here! */ + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_fiq_context_restore. */ #ifdef TX_ENABLE_FIQ_NESTING BL _tx_thread_fiq_nesting_end #endif -@ -@ /* Jump to fiq context restore to restore system context. */ + + /* Jump to fiq context restore to restore system context. */ B _tx_thread_fiq_context_restore -@ -@ + + #else .global __tx_fiq_handler __tx_fiq_handler: - B __tx_fiq_handler @ FIQ interrupt handler + B __tx_fiq_handler // FIQ interrupt handler #endif -@ -@ + + BUILD_OPTIONS: - .word _tx_build_options @ Reference to bring in + .word _tx_build_options // Reference to bring in VERSION_ID: - .word _tx_version_id @ Reference to bring in - + .word _tx_version_id // Reference to bring in diff --git a/ports/cortex_a15/ac6/example_build/tx/.cproject b/ports/cortex_a15/ac6/example_build/tx/.cproject index 45b4676d..e8ca6dd7 100644 --- a/ports/cortex_a15/ac6/example_build/tx/.cproject +++ b/ports/cortex_a15/ac6/example_build/tx/.cproject @@ -3,9 +3,9 @@ - + - + @@ -23,37 +23,37 @@ - + - + - + - @@ -111,7 +111,7 @@ - + @@ -123,6 +123,10 @@ + + + + @@ -138,9 +142,5 @@ - - - - diff --git a/ports/cortex_a15/ac6/inc/tx_port.h b/ports/cortex_a15/ac6/inc/tx_port.h index 5485dfa2..19463de1 100644 --- a/ports/cortex_a15/ac6/inc/tx_port.h +++ b/ports/cortex_a15/ac6/inc/tx_port.h @@ -12,7 +12,7 @@ /**************************************************************************/ /**************************************************************************/ -/** */ +/** */ /** ThreadX Component */ /** */ /** Port Specific */ @@ -21,36 +21,38 @@ /**************************************************************************/ -/**************************************************************************/ -/* */ -/* PORT SPECIFIC C INFORMATION RELEASE */ -/* */ -/* tx_port.h Cortex-A15/AC6 */ -/* 6.1.6 */ +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* tx_port.h ARMv7-A */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ /* */ /* DESCRIPTION */ -/* */ -/* This file contains data type definitions that make the ThreadX */ -/* real-time kernel function identically on a variety of different */ -/* processor architectures. For example, the size or number of bits */ -/* in an "int" data type vary between microprocessor architectures and */ -/* even C compilers for the same microprocessor. ThreadX does not */ -/* directly use native C data types. Instead, ThreadX creates its */ -/* own special types that can be mapped to actual data types by this */ -/* file to guarantee consistency in the interface and functionality. */ -/* */ -/* RELEASE HISTORY */ -/* */ +/* */ +/* This file contains data type definitions that make the ThreadX */ +/* real-time kernel function identically on a variety of different */ +/* processor architectures. For example, the size or number of bits */ +/* in an "int" data type vary between microprocessor architectures and */ +/* even C compilers for the same microprocessor. ThreadX does not */ +/* directly use native C data types. Instead, ThreadX creates its */ +/* own special types that can be mapped to actual data types by this */ +/* file to guarantee consistency in the interface and functionality. */ +/* */ +/* RELEASE HISTORY */ +/* */ /* DATE NAME DESCRIPTION */ /* */ /* 09-30-2020 William E. Lamie Initial Version 6.1 */ /* 04-02-2021 Bhupendra Naphade Modified comment(s),updated */ /* macro definition, */ /* resulting in version 6.1.6 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -63,7 +65,7 @@ #ifdef TX_INCLUDE_USER_DEFINE_FILE -/* Yes, include the user defines in tx_user.h. The defines in this file may +/* Yes, include the user defines in tx_user.h. The defines in this file may alternately be defined on the command line. */ #include "tx_user.h" @@ -76,7 +78,7 @@ #include -/* Define ThreadX basic types for this port. */ +/* Define ThreadX basic types for this port. */ #define VOID void typedef char CHAR; @@ -112,12 +114,12 @@ typedef unsigned short USHORT; #define TX_TIMER_THREAD_STACK_SIZE 1024 /* Default timer thread stack size */ #endif -#ifndef TX_TIMER_THREAD_PRIORITY -#define TX_TIMER_THREAD_PRIORITY 0 /* Default timer thread priority */ +#ifndef TX_TIMER_THREAD_PRIORITY +#define TX_TIMER_THREAD_PRIORITY 0 /* Default timer thread priority */ #endif -/* Define various constants for the ThreadX ARM port. */ +/* Define various constants for the ThreadX ARM port. */ #ifdef TX_ENABLE_FIQ_SUPPORT #define TX_INT_DISABLE 0xC0 /* Disable IRQ & FIQ interrupts */ @@ -127,8 +129,8 @@ typedef unsigned short USHORT; #define TX_INT_ENABLE 0x00 /* Enable IRQ interrupts */ -/* Define the clock source for trace event entry time stamp. The following two item are port specific. - For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock +/* Define the clock source for trace event entry time stamp. The following two item are port specific. + For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: #define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) @@ -175,7 +177,7 @@ typedef unsigned short USHORT; #define TX_INLINE_INITIALIZATION -/* Determine whether or not stack checking is enabled. By default, ThreadX stack checking is +/* Determine whether or not stack checking is enabled. By default, ThreadX stack checking is disabled. When the following is defined, ThreadX thread stack checking is enabled. If stack checking is enabled (TX_ENABLE_STACK_CHECKING is defined), the TX_DISABLE_STACK_FILLING define is negated, thereby forcing the stack fill which is necessary for the stack checking @@ -187,13 +189,13 @@ typedef unsigned short USHORT; /* Define the TX_THREAD control block extensions for this port. The main reason - for the multiple macros is so that backward compatibility can be maintained with + for the multiple macros is so that backward compatibility can be maintained with existing ThreadX kernel awareness modules. */ -#define TX_THREAD_EXTENSION_0 -#define TX_THREAD_EXTENSION_1 +#define TX_THREAD_EXTENSION_0 +#define TX_THREAD_EXTENSION_1 #define TX_THREAD_EXTENSION_2 ULONG tx_thread_vfp_enable; -#define TX_THREAD_EXTENSION_3 +#define TX_THREAD_EXTENSION_3 /* Define the port extensions of the remaining ThreadX objects. */ @@ -207,11 +209,11 @@ typedef unsigned short USHORT; #define TX_TIMER_EXTENSION -/* Define the user extension field of the thread control block. Nothing +/* Define the user extension field of the thread control block. Nothing additional is needed for this port so it is defined as white space. */ #ifndef TX_THREAD_USER_EXTENSION -#define TX_THREAD_USER_EXTENSION +#define TX_THREAD_USER_EXTENSION #endif @@ -219,8 +221,8 @@ typedef unsigned short USHORT; tx_thread_shell_entry, and tx_thread_terminate. */ -#define TX_THREAD_CREATE_EXTENSION(thread_ptr) -#define TX_THREAD_DELETE_EXTENSION(thread_ptr) +#define TX_THREAD_CREATE_EXTENSION(thread_ptr) +#define TX_THREAD_DELETE_EXTENSION(thread_ptr) #define TX_THREAD_COMPLETED_EXTENSION(thread_ptr) #define TX_THREAD_TERMINATED_EXTENSION(thread_ptr) @@ -247,24 +249,24 @@ typedef unsigned short USHORT; #define TX_TIMER_DELETE_EXTENSION(timer_ptr) -/* Determine if the ARM architecture has the CLZ instruction. This is available on - architectures v5 and above. If available, redefine the macro for calculating the +/* Determine if the ARM architecture has the CLZ instruction. This is available on + architectures v5 and above. If available, redefine the macro for calculating the lowest bit set. */ - + #if __TARGET_ARCH_ARM > 4 #ifndef __thumb__ #define TX_LOWEST_SET_BIT_CALCULATE(m, b) m = m & ((ULONG) (-((LONG) m))); \ asm volatile (" CLZ %0,%1 ": "=r" (b) : "r" (m) ); \ - b = 31 - b; + b = 31 - b; #endif #endif -/* Define ThreadX interrupt lockout and restore macros for protection on - access of critical kernel information. The restore interrupt macro must - restore the interrupt posture of the running thread prior to the value +/* Define ThreadX interrupt lockout and restore macros for protection on + access of critical kernel information. The restore interrupt macro must + restore the interrupt posture of the running thread prior to the value present prior to the disable macro. In most cases, the save area macro is used to define a local function save area for the disable and restore macros. */ @@ -295,7 +297,7 @@ unsigned int _tx_thread_interrupt_restore(UINT old_posture); #endif -/* Define VFP extension for the Cortex-A15. Each is assumed to be called in the context of the executing +/* Define VFP extension for the ARMv7-A. Each is assumed to be called in the context of the executing thread. */ void tx_thread_vfp_enable(void); @@ -315,8 +317,8 @@ void tx_thread_vfp_disable(void); /* Define the version ID of ThreadX. This may be utilized by the application. */ #ifdef TX_THREAD_INIT -CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-A15/AC6 Version 6.1.9 *"; +CHAR _tx_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX ARMv7-A Version 6.1.11 *"; #else extern CHAR _tx_version_id[]; #endif diff --git a/ports/cortex_a15/ac6/src/tx_thread_context_restore.S b/ports/cortex_a15/ac6/src/tx_thread_context_restore.S index cbc1b316..fae7e72d 100644 --- a/ports/cortex_a15/ac6/src/tx_thread_context_restore.S +++ b/ports/cortex_a15/ac6/src/tx_thread_context_restore.S @@ -1,259 +1,222 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .arm #ifdef TX_ENABLE_FIQ_SUPPORT -SVC_MODE = 0xD3 @ Disable IRQ/FIQ, SVC mode -IRQ_MODE = 0xD2 @ Disable IRQ/FIQ, IRQ mode +SVC_MODE = 0xD3 // Disable IRQ/FIQ, SVC mode +IRQ_MODE = 0xD2 // Disable IRQ/FIQ, IRQ mode #else -SVC_MODE = 0x93 @ Disable IRQ, SVC mode -IRQ_MODE = 0x92 @ Disable IRQ, IRQ mode +SVC_MODE = 0x93 // Disable IRQ, SVC mode +IRQ_MODE = 0x92 // Disable IRQ, IRQ mode #endif -@ + .global _tx_thread_system_state .global _tx_thread_current_ptr .global _tx_thread_execute_ptr .global _tx_timer_time_slice .global _tx_thread_schedule .global _tx_thread_preempt_disable -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_restore -@ since it will never be called 16-bit mode. */ -@ + + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_restore + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_context_restore Cortex-A15/AC6 */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function restores the interrupt context if it is processing a */ -@/* nested interrupt. If not, it returns to the interrupt thread if no */ -@/* preemption is necessary. Otherwise, if preemption is necessary or */ -@/* if no thread was running, the function returns to the scheduler. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* _tx_thread_schedule Thread scheduling routine */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs Interrupt Service Routines */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_context_restore(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_context_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function restores the interrupt context if it is processing a */ +/* nested interrupt. If not, it returns to the interrupt thread if no */ +/* preemption is necessary. Otherwise, if preemption is necessary or */ +/* if no thread was running, the function returns to the scheduler. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling routine */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs Interrupt Service Routines */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_context_restore .type _tx_thread_context_restore,function _tx_thread_context_restore: -@ -@ /* Lockout interrupts. */ -@ + + /* Lockout interrupts. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ interrupts + CPSID if // Disable IRQ and FIQ interrupts #else - CPSID i @ Disable IRQ interrupts + CPSID i // Disable IRQ interrupts #endif #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR exit function to indicate an ISR is complete. */ -@ - BL _tx_execution_isr_exit @ Call the ISR exit function -#endif -@ -@ /* Determine if interrupts are nested. */ -@ if (--_tx_thread_system_state) -@ { -@ - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3] @ Pickup system state - SUB r2, r2, #1 @ Decrement the counter - STR r2, [r3] @ Store the counter - CMP r2, #0 @ Was this the first interrupt? - BEQ __tx_thread_not_nested_restore @ If so, not a nested restore -@ -@ /* Interrupts are nested. */ -@ -@ /* Just recover the saved registers and return to the point of -@ interrupt. */ -@ - LDMIA sp!, {r0, r10, r12, lr} @ Recover SPSR, POI, and scratch regs - MSR SPSR_cxsf, r0 @ Put SPSR back - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOVS pc, lr @ Return to point of interrupt -@ -@ } -__tx_thread_not_nested_restore: -@ -@ /* Determine if a thread was interrupted and no preemption is required. */ -@ else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr) -@ || (_tx_thread_preempt_disable)) -@ { -@ - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup actual current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_idle_system_restore @ Yes, idle system was interrupted -@ - LDR r3, =_tx_thread_preempt_disable @ Pickup preempt disable address - LDR r2, [r3] @ Pickup actual preempt disable flag - CMP r2, #0 @ Is it set? - BNE __tx_thread_no_preempt_restore @ Yes, don't preempt this thread - LDR r3, =_tx_thread_execute_ptr @ Pickup address of execute thread ptr - LDR r2, [r3] @ Pickup actual execute thread pointer - CMP r0, r2 @ Is the same thread highest priority? - BNE __tx_thread_preempt_restore @ No, preemption needs to happen -@ -@ -__tx_thread_no_preempt_restore: -@ -@ /* Restore interrupted thread or ISR. */ -@ -@ /* Pickup the saved stack pointer. */ -@ tmp_ptr = _tx_thread_current_ptr -> tx_thread_stack_ptr; -@ -@ /* Recover the saved context and return to the point of interrupt. */ -@ - LDMIA sp!, {r0, r10, r12, lr} @ Recover SPSR, POI, and scratch regs - MSR SPSR_cxsf, r0 @ Put SPSR back - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOVS pc, lr @ Return to point of interrupt -@ -@ } -@ else -@ { -__tx_thread_preempt_restore: -@ - LDMIA sp!, {r3, r10, r12, lr} @ Recover temporarily saved registers - MOV r1, lr @ Save lr (point of interrupt) - MOV r2, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r2 @ Enter SVC mode - STR r1, [sp, #-4]! @ Save point of interrupt - STMDB sp!, {r4-r12, lr} @ Save upper half of registers - MOV r4, r3 @ Save SPSR in r4 - MOV r2, #IRQ_MODE @ Build IRQ mode CPSR - MSR CPSR_c, r2 @ Enter IRQ mode - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOV r5, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r5 @ Enter SVC mode - STMDB sp!, {r0-r3} @ Save r0-r3 on thread's stack - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup current thread pointer + /* Call the ISR exit function to indicate an ISR is complete. */ + + BL _tx_execution_isr_exit // Call the ISR exit function +#endif + + /* Determine if interrupts are nested. */ + + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + SUB r2, r2, #1 // Decrement the counter + STR r2, [r3] // Store the counter + CMP r2, #0 // Was this the first interrupt? + BEQ __tx_thread_not_nested_restore // If so, not a nested restore + + /* Interrupts are nested. */ + + /* Just recover the saved registers and return to the point of + interrupt. */ + + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_not_nested_restore: + + /* Determine if a thread was interrupted and no preemption is required. */ + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup actual current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_restore // Yes, idle system was interrupted + + LDR r3, =_tx_thread_preempt_disable // Pickup preempt disable address + LDR r2, [r3] // Pickup actual preempt disable flag + CMP r2, #0 // Is it set? + BNE __tx_thread_no_preempt_restore // Yes, don't preempt this thread + LDR r3, =_tx_thread_execute_ptr // Pickup address of execute thread ptr + LDR r2, [r3] // Pickup actual execute thread pointer + CMP r0, r2 // Is the same thread highest priority? + BNE __tx_thread_preempt_restore // No, preemption needs to happen + + +__tx_thread_no_preempt_restore: + + /* Recover the saved context and return to the point of interrupt. */ + + /* Pickup the saved stack pointer. */ + + /* Recover the saved context and return to the point of interrupt. */ + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_preempt_restore: + + LDMIA sp!, {r3, r10, r12, lr} // Recover temporarily saved registers + MOV r1, lr // Save lr (point of interrupt) + MOV r2, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r2 // Enter SVC mode + STR r1, [sp, #-4]! // Save point of interrupt + STMDB sp!, {r4-r12, lr} // Save upper half of registers + MOV r4, r3 // Save SPSR in r4 + MOV r2, #IRQ_MODE // Build IRQ mode CPSR + MSR CPSR_c, r2 // Enter IRQ mode + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOV r5, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r5 // Enter SVC mode + STMDB sp!, {r0-r3} // Save r0-r3 on thread's stack + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer #ifdef TX_ENABLE_VFP_SUPPORT - LDR r2, [r0, #144] @ Pickup the VFP enabled flag - CMP r2, #0 @ Is the VFP enabled? - BEQ _tx_skip_irq_vfp_save @ No, skip VFP IRQ save - VMRS r2, FPSCR @ Pickup the FPSCR - STR r2, [sp, #-4]! @ Save FPSCR - VSTMDB sp!, {D16-D31} @ Save D16-D31 - VSTMDB sp!, {D0-D15} @ Save D0-D15 + LDR r2, [r0, #144] // Pickup the VFP enabled flag + CMP r2, #0 // Is the VFP enabled? + BEQ _tx_skip_irq_vfp_save // No, skip VFP IRQ save + VMRS r2, FPSCR // Pickup the FPSCR + STR r2, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D0-D15} // Save D0-D15 + _tx_skip_irq_vfp_save: + #endif - MOV r3, #1 @ Build interrupt stack type - STMDB sp!, {r3, r4} @ Save interrupt stack type and SPSR - STR sp, [r0, #8] @ Save stack pointer in thread control - @ block -@ -@ /* Save the remaining time-slice and disable it. */ -@ if (_tx_timer_time_slice) -@ { -@ - LDR r3, =_tx_timer_time_slice @ Pickup time-slice variable address - LDR r2, [r3] @ Pickup time-slice - CMP r2, #0 @ Is it active? - BEQ __tx_thread_dont_save_ts @ No, don't save it -@ -@ _tx_thread_current_ptr -> tx_thread_time_slice = _tx_timer_time_slice; -@ _tx_timer_time_slice = 0; -@ - STR r2, [r0, #24] @ Save thread's time-slice - MOV r2, #0 @ Clear value - STR r2, [r3] @ Disable global time-slice flag -@ -@ } + MOV r3, #1 // Build interrupt stack type + STMDB sp!, {r3, r4} // Save interrupt stack type and SPSR + STR sp, [r0, #8] // Save stack pointer in thread control + // block + + /* Save the remaining time-slice and disable it. */ + LDR r3, =_tx_timer_time_slice // Pickup time-slice variable address + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it active? + BEQ __tx_thread_dont_save_ts // No, don't save it + STR r2, [r0, #24] // Save thread's time-slice + MOV r2, #0 // Clear value + STR r2, [r3] // Disable global time-slice flag + __tx_thread_dont_save_ts: -@ -@ -@ /* Clear the current task pointer. */ -@ _tx_thread_current_ptr = TX_NULL; -@ - MOV r0, #0 @ NULL value - STR r0, [r1] @ Clear current thread pointer -@ -@ /* Return to the scheduler. */ -@ _tx_thread_schedule(); -@ - B _tx_thread_schedule @ Return to scheduler -@ } -@ + + /* Clear the current task pointer. */ + MOV r0, #0 // NULL value + STR r0, [r1] // Clear current thread pointer + + /* Return to the scheduler. */ + B _tx_thread_schedule // Return to scheduler + __tx_thread_idle_system_restore: -@ -@ /* Just return back to the scheduler! */ -@ - MOV r0, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r0 @ Enter SVC mode - B _tx_thread_schedule @ Return to scheduler -@} - - + /* Just return back to the scheduler! */ + MOV r0, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r0 // Enter SVC mode + B _tx_thread_schedule // Return to scheduler diff --git a/ports/cortex_a15/ac6/src/tx_thread_context_save.S b/ports/cortex_a15/ac6/src/tx_thread_context_save.S index 82f63954..7ac48c2e 100644 --- a/ports/cortex_a15/ac6/src/tx_thread_context_save.S +++ b/ports/cortex_a15/ac6/src/tx_thread_context_save.S @@ -1,205 +1,172 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .global _tx_thread_system_state .global _tx_thread_current_ptr .global __tx_irq_processing_return -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_save -@ since it will never be called 16-bit mode. */ -@ + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_save + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_context_save Cortex-A15/AC6 */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function saves the context of an executing thread in the */ -@/* beginning of interrupt processing. The function also ensures that */ -@/* the system stack is used upon return to the calling ISR. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_context_save(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_context_save .type _tx_thread_context_save,function _tx_thread_context_save: -@ -@ /* Upon entry to this routine, it is assumed that IRQ interrupts are locked -@ out, we are in IRQ mode, and all registers are intact. */ -@ -@ /* Check for a nested interrupt condition. */ -@ if (_tx_thread_system_state++) -@ { -@ - STMDB sp!, {r0-r3} @ Save some working registers + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + + STMDB sp!, {r0-r3} // Save some working registers #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable FIQ interrupts + CPSID if // Disable FIQ interrupts #endif - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3] @ Pickup system state - CMP r2, #0 @ Is this the first interrupt? - BEQ __tx_thread_not_nested_save @ Yes, not a nested context save -@ -@ /* Nested interrupt condition. */ -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3] @ Store it back in the variable -@ -@ /* Save the rest of the scratch registers on the stack and return to the -@ calling ISR. */ -@ - MRS r0, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r0, r10, r12, lr} @ Store other registers -@ -@ /* Return to the ISR. */ -@ - MOV r10, #0 @ Clear stack limit + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + + /* Save the rest of the scratch registers on the stack and return to the + calling ISR. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, r10, r12, lr} // Store other registers + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - B __tx_irq_processing_return @ Continue IRQ processing -@ + B __tx_irq_processing_return // Continue IRQ processing + __tx_thread_not_nested_save: -@ } -@ -@ /* Otherwise, not nested, check to see if a thread was running. */ -@ else if (_tx_thread_current_ptr) -@ { -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3] @ Store it back in the variable - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_idle_system_save @ If so, interrupt occurred in - @ scheduling loop - nothing needs saving! -@ -@ /* Save minimal context of interrupted thread. */ -@ - MRS r2, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r2, r10, r12, lr} @ Store other registers -@ -@ /* Save the current stack pointer in the thread's control block. */ -@ _tx_thread_current_ptr -> tx_thread_stack_ptr = sp; -@ -@ /* Switch to the system stack. */ -@ sp = _tx_thread_system_stack_ptr@ -@ - MOV r10, #0 @ Clear stack limit + + /* Otherwise, not nested, check to see if a thread was running. */ + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + + /* Save minimal context of interrupted thread. */ + + MRS r2, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r2, r10, r12, lr} // Store other registers + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - B __tx_irq_processing_return @ Continue IRQ processing -@ -@ } -@ else -@ { -@ + B __tx_irq_processing_return // Continue IRQ processing + __tx_thread_idle_system_save: -@ -@ /* Interrupt occurred in the scheduling loop. */ -@ -@ /* Not much to do here, just adjust the stack pointer, and return to IRQ -@ processing. */ -@ - MOV r10, #0 @ Clear stack limit + + /* Interrupt occurred in the scheduling loop. */ + + /* Not much to do here, just adjust the stack pointer, and return to IRQ + processing. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - ADD sp, sp, #16 @ Recover saved registers - B __tx_irq_processing_return @ Continue IRQ processing -@ -@ } -@} - - - + ADD sp, sp, #16 // Recover saved registers + B __tx_irq_processing_return // Continue IRQ processing diff --git a/ports/cortex_a15/ac6/src/tx_thread_fiq_context_restore.S b/ports/cortex_a15/ac6/src/tx_thread_fiq_context_restore.S index efa3ec3e..006be973 100644 --- a/ports/cortex_a15/ac6/src/tx_thread_fiq_context_restore.S +++ b/ports/cortex_a15/ac6/src/tx_thread_fiq_context_restore.S @@ -1,43 +1,32 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ -@ -SVC_MODE = 0xD3 @ SVC mode -FIQ_MODE = 0xD1 @ FIQ mode -MODE_MASK = 0x1F @ Mode mask -THUMB_MASK = 0x20 @ Thumb bit mask -IRQ_MODE_BITS = 0x12 @ IRQ mode bits -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +SVC_MODE = 0xD3 // SVC mode +FIQ_MODE = 0xD1 // FIQ mode +MODE_MASK = 0x1F // Mode mask +THUMB_MASK = 0x20 // Thumb bit mask +IRQ_MODE_BITS = 0x12 // IRQ mode bits + + .global _tx_thread_system_state .global _tx_thread_current_ptr .global _tx_thread_system_stack_ptr @@ -45,218 +34,190 @@ IRQ_MODE_BITS = 0x12 @ IRQ mode bits .global _tx_timer_time_slice .global _tx_thread_schedule .global _tx_thread_preempt_disable -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_restore -@ since it will never be called 16-bit mode. */ -@ + .global _tx_execution_isr_exit + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_restore + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_fiq_context_restore Cortex-A15/AC6 */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function restores the fiq interrupt context when processing a */ -@/* nested interrupt. If not, it returns to the interrupt thread if no */ -@/* preemption is necessary. Otherwise, if preemption is necessary or */ -@/* if no thread was running, the function returns to the scheduler. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* _tx_thread_schedule Thread scheduling routine */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* FIQ ISR Interrupt Service Routines */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_fiq_context_restore(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_context_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function restores the fiq interrupt context when processing a */ +/* nested interrupt. If not, it returns to the interrupt thread if no */ +/* preemption is necessary. Otherwise, if preemption is necessary or */ +/* if no thread was running, the function returns to the scheduler. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling routine */ +/* */ +/* CALLED BY */ +/* */ +/* FIQ ISR Interrupt Service Routines */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_fiq_context_restore .type _tx_thread_fiq_context_restore,function _tx_thread_fiq_context_restore: -@ -@ /* Lockout interrupts. */ -@ - CPSID if @ Disable IRQ and FIQ interrupts + + /* Lockout interrupts. */ + + CPSID if // Disable IRQ and FIQ interrupts #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR exit function to indicate an ISR is complete. */ -@ - BL _tx_execution_isr_exit @ Call the ISR exit function + + /* Call the ISR exit function to indicate an ISR is complete. */ + + BL _tx_execution_isr_exit // Call the ISR exit function #endif -@ -@ /* Determine if interrupts are nested. */ -@ if (--_tx_thread_system_state) -@ { -@ - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3] @ Pickup system state - SUB r2, r2, #1 @ Decrement the counter - STR r2, [r3] @ Store the counter - CMP r2, #0 @ Was this the first interrupt? - BEQ __tx_thread_fiq_not_nested_restore @ If so, not a nested restore -@ -@ /* Interrupts are nested. */ -@ -@ /* Just recover the saved registers and return to the point of -@ interrupt. */ -@ - LDMIA sp!, {r0, r10, r12, lr} @ Recover SPSR, POI, and scratch regs - MSR SPSR_cxsf, r0 @ Put SPSR back - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOVS pc, lr @ Return to point of interrupt -@ -@ } + + /* Determine if interrupts are nested. */ + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + SUB r2, r2, #1 // Decrement the counter + STR r2, [r3] // Store the counter + CMP r2, #0 // Was this the first interrupt? + BEQ __tx_thread_fiq_not_nested_restore // If so, not a nested restore + + /* Interrupts are nested. */ + + /* Just recover the saved registers and return to the point of + interrupt. */ + + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + __tx_thread_fiq_not_nested_restore: -@ -@ /* Determine if a thread was interrupted and no preemption is required. */ -@ else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr) -@ || (_tx_thread_preempt_disable)) -@ { -@ - LDR r1, [sp] @ Pickup the saved SPSR - MOV r2, #MODE_MASK @ Build mask to isolate the interrupted mode - AND r1, r1, r2 @ Isolate mode bits - CMP r1, #IRQ_MODE_BITS @ Was an interrupt taken in IRQ mode before we - @ got to context save? */ - BEQ __tx_thread_fiq_no_preempt_restore @ Yes, just go back to point of interrupt + + /* Determine if a thread was interrupted and no preemption is required. */ + + LDR r1, [sp] // Pickup the saved SPSR + MOV r2, #MODE_MASK // Build mask to isolate the interrupted mode + AND r1, r1, r2 // Isolate mode bits + CMP r1, #IRQ_MODE_BITS // Was an interrupt taken in IRQ mode before we + // got to context save? */ + BEQ __tx_thread_fiq_no_preempt_restore // Yes, just go back to point of interrupt - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup actual current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_fiq_idle_system_restore @ Yes, idle system was interrupted + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup actual current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_fiq_idle_system_restore // Yes, idle system was interrupted - LDR r3, =_tx_thread_preempt_disable @ Pickup preempt disable address - LDR r2, [r3] @ Pickup actual preempt disable flag - CMP r2, #0 @ Is it set? - BNE __tx_thread_fiq_no_preempt_restore @ Yes, don't preempt this thread - LDR r3, =_tx_thread_execute_ptr @ Pickup address of execute thread ptr - LDR r2, [r3] @ Pickup actual execute thread pointer - CMP r0, r2 @ Is the same thread highest priority? - BNE __tx_thread_fiq_preempt_restore @ No, preemption needs to happen + LDR r3, =_tx_thread_preempt_disable // Pickup preempt disable address + LDR r2, [r3] // Pickup actual preempt disable flag + CMP r2, #0 // Is it set? + BNE __tx_thread_fiq_no_preempt_restore // Yes, don't preempt this thread + LDR r3, =_tx_thread_execute_ptr // Pickup address of execute thread ptr + LDR r2, [r3] // Pickup actual execute thread pointer + CMP r0, r2 // Is the same thread highest priority? + BNE __tx_thread_fiq_preempt_restore // No, preemption needs to happen __tx_thread_fiq_no_preempt_restore: -@ -@ /* Restore interrupted thread or ISR. */ -@ -@ /* Pickup the saved stack pointer. */ -@ tmp_ptr = _tx_thread_current_ptr -> tx_thread_stack_ptr; -@ -@ /* Recover the saved context and return to the point of interrupt. */ -@ - LDMIA sp!, {r0, lr} @ Recover SPSR, POI, and scratch regs - MSR SPSR_cxsf, r0 @ Put SPSR back - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOVS pc, lr @ Return to point of interrupt -@ -@ } -@ else -@ { -__tx_thread_fiq_preempt_restore: -@ - LDMIA sp!, {r3, lr} @ Recover temporarily saved registers - MOV r1, lr @ Save lr (point of interrupt) - MOV r2, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r2 @ Enter SVC mode - STR r1, [sp, #-4]! @ Save point of interrupt - STMDB sp!, {r4-r12, lr} @ Save upper half of registers - MOV r4, r3 @ Save SPSR in r4 - MOV r2, #FIQ_MODE @ Build FIQ mode CPSR - MSR CPSR_c, r2 @ Reenter FIQ mode - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOV r5, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r5 @ Enter SVC mode - STMDB sp!, {r0-r3} @ Save r0-r3 on thread's stack - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup current thread pointer + /* Restore interrupted thread or ISR. */ + /* Recover the saved context and return to the point of interrupt. */ + + LDMIA sp!, {r0, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_fiq_preempt_restore: + + LDMIA sp!, {r3, lr} // Recover temporarily saved registers + MOV r1, lr // Save lr (point of interrupt) + MOV r2, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r2 // Enter SVC mode + STR r1, [sp, #-4]! // Save point of interrupt + STMDB sp!, {r4-r12, lr} // Save upper half of registers + MOV r4, r3 // Save SPSR in r4 + MOV r2, #FIQ_MODE // Build FIQ mode CPSR + MSR CPSR_c, r2 // Reenter FIQ mode + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOV r5, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r5 // Enter SVC mode + STMDB sp!, {r0-r3} // Save r0-r3 on thread's stack + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer #ifdef TX_ENABLE_VFP_SUPPORT - LDR r2, [r0, #144] @ Pickup the VFP enabled flag - CMP r2, #0 @ Is the VFP enabled? - BEQ _tx_skip_fiq_vfp_save @ No, skip VFP IRQ save - VMRS r2, FPSCR @ Pickup the FPSCR - STR r2, [sp, #-4]! @ Save FPSCR - VSTMDB sp!, {D16-D31} @ Save D16-D31 - VSTMDB sp!, {D0-D15} @ Save D0-D15 + LDR r2, [r0, #144] // Pickup the VFP enabled flag + CMP r2, #0 // Is the VFP enabled? + BEQ _tx_skip_fiq_vfp_save // No, skip VFP IRQ save + VMRS r2, FPSCR // Pickup the FPSCR + STR r2, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D0-D15} // Save D0-D15 _tx_skip_fiq_vfp_save: #endif - MOV r3, #1 @ Build interrupt stack type - STMDB sp!, {r3, r4} @ Save interrupt stack type and SPSR - STR sp, [r0, #8] @ Save stack pointer in thread control - @ block */ -@ -@ /* Save the remaining time-slice and disable it. */ -@ if (_tx_timer_time_slice) -@ { -@ - LDR r3, =_tx_timer_time_slice @ Pickup time-slice variable address - LDR r2, [r3] @ Pickup time-slice - CMP r2, #0 @ Is it active? - BEQ __tx_thread_fiq_dont_save_ts @ No, don't save it -@ -@ _tx_thread_current_ptr -> tx_thread_time_slice = _tx_timer_time_slice; -@ _tx_timer_time_slice = 0; -@ - STR r2, [r0, #24] @ Save thread's time-slice - MOV r2, #0 @ Clear value - STR r2, [r3] @ Disable global time-slice flag -@ -@ } -__tx_thread_fiq_dont_save_ts: -@ -@ -@ /* Clear the current task pointer. */ -@ _tx_thread_current_ptr = TX_NULL; -@ - MOV r0, #0 @ NULL value - STR r0, [r1] @ Clear current thread pointer -@ -@ /* Return to the scheduler. */ -@ _tx_thread_schedule(); -@ - B _tx_thread_schedule @ Return to scheduler -@ } -@ -__tx_thread_fiq_idle_system_restore: -@ -@ /* Just return back to the scheduler! */ -@ - ADD sp, sp, #24 @ Recover FIQ stack space - MOV r3, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r3 @ Lockout interrupts - B _tx_thread_schedule @ Return to scheduler -@ -@} + MOV r3, #1 // Build interrupt stack type + STMDB sp!, {r3, r4} // Save interrupt stack type and SPSR + STR sp, [r0, #8] // Save stack pointer in thread control + // block */ + LDR r3, =_tx_timer_time_slice // Pickup time-slice variable address + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it active? + BEQ __tx_thread_fiq_dont_save_ts // No, don't save it + + STR r2, [r0, #24] // Save thread's time-slice + MOV r2, #0 // Clear value + STR r2, [r3] // Disable global time-slice flag + +__tx_thread_fiq_dont_save_ts: + + /* Clear the current task pointer. */ + + MOV r0, #0 // NULL value + STR r0, [r1] // Clear current thread pointer + + /* Return to the scheduler. */ + + B _tx_thread_schedule // Return to scheduler + +__tx_thread_fiq_idle_system_restore: + + /* Just return back to the scheduler! */ + + ADD sp, sp, #24 // Recover FIQ stack space + MOV r3, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r3 // Lockout interrupts + B _tx_thread_schedule // Return to scheduler diff --git a/ports/cortex_a15/ac6/src/tx_thread_fiq_context_save.S b/ports/cortex_a15/ac6/src/tx_thread_fiq_context_save.S index b45748c0..7db6a4c2 100644 --- a/ports/cortex_a15/ac6/src/tx_thread_fiq_context_save.S +++ b/ports/cortex_a15/ac6/src/tx_thread_fiq_context_save.S @@ -1,206 +1,178 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .global _tx_thread_system_state .global _tx_thread_current_ptr .global __tx_fiq_processing_return -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_save -@ since it will never be called 16-bit mode. */ -@ + .global _tx_execution_isr_enter + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_save + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_fiq_context_save Cortex-A15/AC6 */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function saves the context of an executing thread in the */ -@/* beginning of interrupt processing. The function also ensures that */ -@/* the system stack is used upon return to the calling ISR. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@ VOID _tx_thread_fiq_context_save(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_fiq_context_save .type _tx_thread_fiq_context_save,function _tx_thread_fiq_context_save: -@ -@ /* Upon entry to this routine, it is assumed that IRQ interrupts are locked -@ out, we are in IRQ mode, and all registers are intact. */ -@ -@ /* Check for a nested interrupt condition. */ -@ if (_tx_thread_system_state++) -@ { -@ - STMDB sp!, {r0-r3} @ Save some working registers - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3] @ Pickup system state - CMP r2, #0 @ Is this the first interrupt? - BEQ __tx_thread_fiq_not_nested_save @ Yes, not a nested context save -@ -@ /* Nested interrupt condition. */ -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3] @ Store it back in the variable -@ -@ /* Save the rest of the scratch registers on the stack and return to the -@ calling ISR. */ -@ - MRS r0, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r0, r10, r12, lr} @ Store other registers -@ -@ /* Return to the ISR. */ -@ - MOV r10, #0 @ Clear stack limit + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + + STMDB sp!, {r0-r3} // Save some working registers + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_fiq_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + + /* Save the rest of the scratch registers on the stack and return to the + calling ISR. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, r10, r12, lr} // Store other registers + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - B __tx_fiq_processing_return @ Continue FIQ processing -@ + B __tx_fiq_processing_return // Continue FIQ processing +// __tx_thread_fiq_not_nested_save: -@ } -@ -@ /* Otherwise, not nested, check to see if a thread was running. */ -@ else if (_tx_thread_current_ptr) -@ { -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3] @ Store it back in the variable - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_fiq_idle_system_save @ If so, interrupt occurred in -@ @ scheduling loop - nothing needs saving! -@ -@ /* Save minimal context of interrupted thread. */ -@ - MRS r2, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r2, lr} @ Store other registers, Note that we don't -@ @ need to save sl and ip since FIQ has -@ @ copies of these registers. Nested -@ @ interrupt processing does need to save -@ @ these registers. -@ -@ /* Save the current stack pointer in the thread's control block. */ -@ _tx_thread_current_ptr -> tx_thread_stack_ptr = sp; -@ -@ /* Switch to the system stack. */ -@ sp = _tx_thread_system_stack_ptr; -@ - MOV r10, #0 @ Clear stack limit + + /* Otherwise, not nested, check to see if a thread was running. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_fiq_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + + /* Save minimal context of interrupted thread. */ + + MRS r2, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r2, lr} // Store other registers, Note that we don't + // need to save sl and ip since FIQ has + // copies of these registers. Nested + // interrupt processing does need to save + // these registers. + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - B __tx_fiq_processing_return @ Continue FIQ processing -@ -@ } -@ else -@ { -@ + B __tx_fiq_processing_return // Continue FIQ processing + __tx_thread_fiq_idle_system_save: -@ -@ /* Interrupt occurred in the scheduling loop. */ -@ -#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr -#endif -@ -@ /* Not much to do here, save the current SPSR and LR for possible -@ use in IRQ interrupted in idle system conditions, and return to -@ FIQ interrupt processing. */ -@ - MRS r0, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r0, lr} @ Store other registers that will get used -@ @ or stripped off the stack in context -@ @ restore - B __tx_fiq_processing_return @ Continue FIQ processing -@ -@ } -@} + /* Interrupt occurred in the scheduling loop. */ + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + /* Not much to do here, save the current SPSR and LR for possible + use in IRQ interrupted in idle system conditions, and return to + FIQ interrupt processing. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, lr} // Store other registers that will get used + // or stripped off the stack in context + // restore + B __tx_fiq_processing_return // Continue FIQ processing diff --git a/ports/cortex_a15/ac6/src/tx_thread_fiq_nesting_end.S b/ports/cortex_a15/ac6/src/tx_thread_fiq_nesting_end.S index 2cf49fc3..b34d881e 100644 --- a/ports/cortex_a15/ac6/src/tx_thread_fiq_nesting_end.S +++ b/ports/cortex_a15/ac6/src/tx_thread_fiq_nesting_end.S @@ -1,116 +1,104 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + #ifdef TX_ENABLE_FIQ_SUPPORT -DISABLE_INTS = 0xC0 @ Disable IRQ/FIQ interrupts +DISABLE_INTS = 0xC0 // Disable IRQ/FIQ interrupts #else -DISABLE_INTS = 0x80 @ Disable IRQ interrupts +DISABLE_INTS = 0x80 // Disable IRQ interrupts #endif -MODE_MASK = 0x1F @ Mode mask -FIQ_MODE_BITS = 0x11 @ FIQ mode bits -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_end -@ since it will never be called 16-bit mode. */ -@ +MODE_MASK = 0x1F // Mode mask +FIQ_MODE_BITS = 0x11 // FIQ mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_end + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_fiq_nesting_end Cortex-A15/AC6 */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is called by the application from FIQ mode after */ -@/* _tx_thread_fiq_nesting_start has been called and switches the FIQ */ -@/* processing from system mode back to FIQ mode prior to the ISR */ -@/* calling _tx_thread_fiq_context_restore. Note that this function */ -@/* assumes the system stack pointer is in the same position after */ -@/* nesting start function was called. */ -@/* */ -@/* This function assumes that the system mode stack pointer was setup */ -@/* during low-level initialization (tx_initialize_low_level.s). */ -@/* */ -@/* This function returns with FIQ interrupts disabled. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_fiq_nesting_end(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_nesting_end ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from FIQ mode after */ +/* _tx_thread_fiq_nesting_start has been called and switches the FIQ */ +/* processing from system mode back to FIQ mode prior to the ISR */ +/* calling _tx_thread_fiq_context_restore. Note that this function */ +/* assumes the system stack pointer is in the same position after */ +/* nesting start function was called. */ +/* */ +/* This function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with FIQ interrupts disabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_fiq_nesting_end .type _tx_thread_fiq_nesting_end,function _tx_thread_fiq_nesting_end: - MOV r3,lr @ Save ISR return address - MRS r0, CPSR @ Pickup the CPSR - ORR r0, r0, #DISABLE_INTS @ Build disable interrupt value - MSR CPSR_c, r0 @ Disable interrupts - LDMIA sp!, {r1, lr} @ Pickup saved lr (and r1 throw-away for - @ 8-byte alignment logic) - BIC r0, r0, #MODE_MASK @ Clear mode bits - ORR r0, r0, #FIQ_MODE_BITS @ Build IRQ mode CPSR - MSR CPSR_c, r0 @ Reenter IRQ mode + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + ORR r0, r0, #DISABLE_INTS // Build disable interrupt value + MSR CPSR_c, r0 // Disable interrupts + LDMIA sp!, {r1, lr} // Pickup saved lr (and r1 throw-away for + // 8-byte alignment logic) + BIC r0, r0, #MODE_MASK // Clear mode bits + ORR r0, r0, #FIQ_MODE_BITS // Build IRQ mode CPSR + MSR CPSR_c, r0 // Reenter IRQ mode #ifdef __THUMB_INTERWORK - BX r3 @ Return to caller + BX r3 // Return to caller #else - MOV pc, r3 @ Return to caller + MOV pc, r3 // Return to caller #endif -@} - diff --git a/ports/cortex_a15/ac6/src/tx_thread_fiq_nesting_start.S b/ports/cortex_a15/ac6/src/tx_thread_fiq_nesting_start.S index c26e173f..c9cd5a06 100644 --- a/ports/cortex_a15/ac6/src/tx_thread_fiq_nesting_start.S +++ b/ports/cortex_a15/ac6/src/tx_thread_fiq_nesting_start.S @@ -1,108 +1,96 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ -FIQ_DISABLE = 0x40 @ FIQ disable bit -MODE_MASK = 0x1F @ Mode mask -SYS_MODE_BITS = 0x1F @ System mode bits -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_start -@ since it will never be called 16-bit mode. */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +FIQ_DISABLE = 0x40 // FIQ disable bit +MODE_MASK = 0x1F // Mode mask +SYS_MODE_BITS = 0x1F // System mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_start + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_fiq_nesting_start Cortex-A15/AC6 */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is called by the application from FIQ mode after */ -@/* _tx_thread_fiq_context_save has been called and switches the FIQ */ -@/* processing to the system mode so nested FIQ interrupt processing */ -@/* is possible (system mode has its own "lr" register). Note that */ -@/* this function assumes that the system mode stack pointer was setup */ -@/* during low-level initialization (tx_initialize_low_level.s). */ -@/* */ -@/* This function returns with FIQ interrupts enabled. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_fiq_nesting_start(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_nesting_start ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from FIQ mode after */ +/* _tx_thread_fiq_context_save has been called and switches the FIQ */ +/* processing to the system mode so nested FIQ interrupt processing */ +/* is possible (system mode has its own "lr" register). Note that */ +/* this function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with FIQ interrupts enabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_fiq_nesting_start .type _tx_thread_fiq_nesting_start,function _tx_thread_fiq_nesting_start: - MOV r3,lr @ Save ISR return address - MRS r0, CPSR @ Pickup the CPSR - BIC r0, r0, #MODE_MASK @ Clear the mode bits - ORR r0, r0, #SYS_MODE_BITS @ Build system mode CPSR - MSR CPSR_c, r0 @ Enter system mode - STMDB sp!, {r1, lr} @ Push the system mode lr on the system mode stack - @ and push r1 just to keep 8-byte alignment - BIC r0, r0, #FIQ_DISABLE @ Build enable FIQ CPSR - MSR CPSR_c, r0 @ Enter system mode + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + BIC r0, r0, #MODE_MASK // Clear the mode bits + ORR r0, r0, #SYS_MODE_BITS // Build system mode CPSR + MSR CPSR_c, r0 // Enter system mode + STMDB sp!, {r1, lr} // Push the system mode lr on the system mode stack + // and push r1 just to keep 8-byte alignment + BIC r0, r0, #FIQ_DISABLE // Build enable FIQ CPSR + MSR CPSR_c, r0 // Enter system mode #ifdef __THUMB_INTERWORK - BX r3 @ Return to caller + BX r3 // Return to caller #else - MOV pc, r3 @ Return to caller + MOV pc, r3 // Return to caller #endif -@} - diff --git a/ports/cortex_a15/ac6/src/tx_thread_interrupt_control.S b/ports/cortex_a15/ac6/src/tx_thread_interrupt_control.S index 6e7b9dee..63b1609a 100644 --- a/ports/cortex_a15/ac6/src/tx_thread_interrupt_control.S +++ b/ports/cortex_a15/ac6/src/tx_thread_interrupt_control.S @@ -1,115 +1,104 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ INT_MASK = 0x03F -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_control for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_control for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_interrupt_control $_tx_thread_interrupt_control: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_interrupt_control @ Call _tx_thread_interrupt_control function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_control // Call _tx_thread_interrupt_control function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_interrupt_control Cortex-A15/AC6 */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is responsible for changing the interrupt lockout */ -@/* posture of the system. */ -@/* */ -@/* INPUT */ -@/* */ -@/* new_posture New interrupt lockout posture */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* old_posture Old interrupt lockout posture */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* Application Code */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@UINT _tx_thread_interrupt_control(UINT new_posture) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_control ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for changing the interrupt lockout */ +/* posture of the system. */ +/* */ +/* INPUT */ +/* */ +/* new_posture New interrupt lockout posture */ +/* */ +/* OUTPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_interrupt_control .type _tx_thread_interrupt_control,function _tx_thread_interrupt_control: -@ -@ /* Pickup current interrupt lockout posture. */ -@ - MRS r3, CPSR @ Pickup current CPSR - MOV r2, #INT_MASK @ Build interrupt mask - AND r1, r3, r2 @ Clear interrupt lockout bits - ORR r1, r1, r0 @ Or-in new interrupt lockout bits -@ -@ /* Apply the new interrupt posture. */ -@ - MSR CPSR_c, r1 @ Setup new CPSR - BIC r0, r3, r2 @ Return previous interrupt mask -#ifdef __THUMB_INTERWORK - BX lr @ Return to caller -#else - MOV pc, lr @ Return to caller -#endif -@} + /* Pickup current interrupt lockout posture. */ + + MRS r3, CPSR // Pickup current CPSR + MOV r2, #INT_MASK // Build interrupt mask + AND r1, r3, r2 // Clear interrupt lockout bits + ORR r1, r1, r0 // Or-in new interrupt lockout bits + + /* Apply the new interrupt posture. */ + + MSR CPSR_c, r1 // Setup new CPSR + BIC r0, r3, r2 // Return previous interrupt mask +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a15/ac6/src/tx_thread_interrupt_disable.S b/ports/cortex_a15/ac6/src/tx_thread_interrupt_disable.S index f0833f65..13258808 100644 --- a/ports/cortex_a15/ac6/src/tx_thread_interrupt_disable.S +++ b/ports/cortex_a15/ac6/src/tx_thread_interrupt_disable.S @@ -1,113 +1,101 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_disable for -@ applications calling this function from to 16-bit Thumb mode. */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_disable for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_interrupt_disable $_tx_thread_interrupt_disable: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_interrupt_disable @ Call _tx_thread_interrupt_disable function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_disable // Call _tx_thread_interrupt_disable function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_interrupt_disable Cortex-A15/AC6 */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is responsible for disabling interrupts */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* old_posture Old interrupt lockout posture */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* Application Code */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@UINT _tx_thread_interrupt_disable(void) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_disable ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for disabling interrupts */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_interrupt_disable .type _tx_thread_interrupt_disable,function _tx_thread_interrupt_disable: -@ -@ /* Pickup current interrupt lockout posture. */ -@ - MRS r0, CPSR @ Pickup current CPSR -@ -@ /* Mask interrupts. */ -@ + + /* Pickup current interrupt lockout posture. */ + + MRS r0, CPSR // Pickup current CPSR + + /* Mask interrupts. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ + CPSID if // Disable IRQ and FIQ #else - CPSID i @ Disable IRQ + CPSID i // Disable IRQ #endif #ifdef __THUMB_INTERWORK - BX lr @ Return to caller + BX lr // Return to caller #else - MOV pc, lr @ Return to caller + MOV pc, lr // Return to caller #endif -@} - - diff --git a/ports/cortex_a15/ac6/src/tx_thread_interrupt_restore.S b/ports/cortex_a15/ac6/src/tx_thread_interrupt_restore.S index 0f0a4b06..2d582511 100644 --- a/ports/cortex_a15/ac6/src/tx_thread_interrupt_restore.S +++ b/ports/cortex_a15/ac6/src/tx_thread_interrupt_restore.S @@ -1,104 +1,93 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_restore for -@ applications calling this function from to 16-bit Thumb mode. */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_restore for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_interrupt_restore $_tx_thread_interrupt_restore: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_interrupt_restore @ Call _tx_thread_interrupt_restore function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_restore // Call _tx_thread_interrupt_restore function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_interrupt_restore Cortex-A15/AC6 */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is responsible for restoring interrupts to the state */ -@/* returned by a previous _tx_thread_interrupt_disable call. */ -@/* */ -@/* INPUT */ -@/* */ -@/* old_posture Old interrupt lockout posture */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* Application Code */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@UINT _tx_thread_interrupt_restore(UINT old_posture) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for restoring interrupts to the state */ +/* returned by a previous _tx_thread_interrupt_disable call. */ +/* */ +/* INPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_interrupt_restore .type _tx_thread_interrupt_restore,function _tx_thread_interrupt_restore: -@ -@ /* Apply the new interrupt posture. */ -@ - MSR CPSR_c, r0 @ Setup new CPSR -#ifdef __THUMB_INTERWORK - BX lr @ Return to caller -#else - MOV pc, lr @ Return to caller -#endif -@} + /* Apply the new interrupt posture. */ + + MSR CPSR_c, r0 // Setup new CPSR +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a15/ac6/src/tx_thread_irq_nesting_end.S b/ports/cortex_a15/ac6/src/tx_thread_irq_nesting_end.S index 40a9c386..ec7e63c6 100644 --- a/ports/cortex_a15/ac6/src/tx_thread_irq_nesting_end.S +++ b/ports/cortex_a15/ac6/src/tx_thread_irq_nesting_end.S @@ -1,115 +1,103 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + #ifdef TX_ENABLE_FIQ_SUPPORT -DISABLE_INTS = 0xC0 @ Disable IRQ/FIQ interrupts +DISABLE_INTS = 0xC0 // Disable IRQ/FIQ interrupts #else -DISABLE_INTS = 0x80 @ Disable IRQ interrupts +DISABLE_INTS = 0x80 // Disable IRQ interrupts #endif -MODE_MASK = 0x1F @ Mode mask -IRQ_MODE_BITS = 0x12 @ IRQ mode bits -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_end -@ since it will never be called 16-bit mode. */ -@ +MODE_MASK = 0x1F // Mode mask +IRQ_MODE_BITS = 0x12 // IRQ mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_end + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_irq_nesting_end Cortex-A15/AC6 */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is called by the application from IRQ mode after */ -@/* _tx_thread_irq_nesting_start has been called and switches the IRQ */ -@/* processing from system mode back to IRQ mode prior to the ISR */ -@/* calling _tx_thread_context_restore. Note that this function */ -@/* assumes the system stack pointer is in the same position after */ -@/* nesting start function was called. */ -@/* */ -@/* This function assumes that the system mode stack pointer was setup */ -@/* during low-level initialization (tx_initialize_low_level.s). */ -@/* */ -@/* This function returns with IRQ interrupts disabled. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_irq_nesting_end(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_irq_nesting_end ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from IRQ mode after */ +/* _tx_thread_irq_nesting_start has been called and switches the IRQ */ +/* processing from system mode back to IRQ mode prior to the ISR */ +/* calling _tx_thread_context_restore. Note that this function */ +/* assumes the system stack pointer is in the same position after */ +/* nesting start function was called. */ +/* */ +/* This function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with IRQ interrupts disabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_irq_nesting_end .type _tx_thread_irq_nesting_end,function _tx_thread_irq_nesting_end: - MOV r3,lr @ Save ISR return address - MRS r0, CPSR @ Pickup the CPSR - ORR r0, r0, #DISABLE_INTS @ Build disable interrupt value - MSR CPSR_c, r0 @ Disable interrupts - LDMIA sp!, {r1, lr} @ Pickup saved lr (and r1 throw-away for - @ 8-byte alignment logic) - BIC r0, r0, #MODE_MASK @ Clear mode bits - ORR r0, r0, #IRQ_MODE_BITS @ Build IRQ mode CPSR - MSR CPSR_c, r0 @ Reenter IRQ mode + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + ORR r0, r0, #DISABLE_INTS // Build disable interrupt value + MSR CPSR_c, r0 // Disable interrupts + LDMIA sp!, {r1, lr} // Pickup saved lr (and r1 throw-away for + // 8-byte alignment logic) + BIC r0, r0, #MODE_MASK // Clear mode bits + ORR r0, r0, #IRQ_MODE_BITS // Build IRQ mode CPSR + MSR CPSR_c, r0 // Reenter IRQ mode #ifdef __THUMB_INTERWORK - BX r3 @ Return to caller + BX r3 // Return to caller #else - MOV pc, r3 @ Return to caller + MOV pc, r3 // Return to caller #endif -@} - diff --git a/ports/cortex_a15/ac6/src/tx_thread_irq_nesting_start.S b/ports/cortex_a15/ac6/src/tx_thread_irq_nesting_start.S index 9a6d4370..c69976ed 100644 --- a/ports/cortex_a15/ac6/src/tx_thread_irq_nesting_start.S +++ b/ports/cortex_a15/ac6/src/tx_thread_irq_nesting_start.S @@ -1,108 +1,96 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ -IRQ_DISABLE = 0x80 @ IRQ disable bit -MODE_MASK = 0x1F @ Mode mask -SYS_MODE_BITS = 0x1F @ System mode bits -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_start -@ since it will never be called 16-bit mode. */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +IRQ_DISABLE = 0x80 // IRQ disable bit +MODE_MASK = 0x1F // Mode mask +SYS_MODE_BITS = 0x1F // System mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_start + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_irq_nesting_start Cortex-A15/AC6 */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is called by the application from IRQ mode after */ -@/* _tx_thread_context_save has been called and switches the IRQ */ -@/* processing to the system mode so nested IRQ interrupt processing */ -@/* is possible (system mode has its own "lr" register). Note that */ -@/* this function assumes that the system mode stack pointer was setup */ -@/* during low-level initialization (tx_initialize_low_level.s). */ -@/* */ -@/* This function returns with IRQ interrupts enabled. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_irq_nesting_start(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_irq_nesting_start ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from IRQ mode after */ +/* _tx_thread_context_save has been called and switches the IRQ */ +/* processing to the system mode so nested IRQ interrupt processing */ +/* is possible (system mode has its own "lr" register). Note that */ +/* this function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with IRQ interrupts enabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_irq_nesting_start .type _tx_thread_irq_nesting_start,function _tx_thread_irq_nesting_start: - MOV r3,lr @ Save ISR return address - MRS r0, CPSR @ Pickup the CPSR - BIC r0, r0, #MODE_MASK @ Clear the mode bits - ORR r0, r0, #SYS_MODE_BITS @ Build system mode CPSR - MSR CPSR_c, r0 @ Enter system mode - STMDB sp!, {r1, lr} @ Push the system mode lr on the system mode stack - @ and push r1 just to keep 8-byte alignment - BIC r0, r0, #IRQ_DISABLE @ Build enable IRQ CPSR - MSR CPSR_c, r0 @ Enter system mode + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + BIC r0, r0, #MODE_MASK // Clear the mode bits + ORR r0, r0, #SYS_MODE_BITS // Build system mode CPSR + MSR CPSR_c, r0 // Enter system mode + STMDB sp!, {r1, lr} // Push the system mode lr on the system mode stack + // and push r1 just to keep 8-byte alignment + BIC r0, r0, #IRQ_DISABLE // Build enable IRQ CPSR + MSR CPSR_c, r0 // Enter system mode #ifdef __THUMB_INTERWORK - BX r3 @ Return to caller + BX r3 // Return to caller #else - MOV pc, r3 @ Return to caller + MOV pc, r3 // Return to caller #endif -@} - diff --git a/ports/cortex_a15/ac6/src/tx_thread_schedule.S b/ports/cortex_a15/ac6/src/tx_thread_schedule.S index 9fabd3b3..8330e9df 100644 --- a/ports/cortex_a15/ac6/src/tx_thread_schedule.S +++ b/ports/cortex_a15/ac6/src/tx_thread_schedule.S @@ -1,257 +1,230 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .global _tx_thread_execute_ptr .global _tx_thread_current_ptr .global _tx_timer_time_slice -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_schedule for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_schedule for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_schedule .type $_tx_thread_schedule,function $_tx_thread_schedule: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_schedule @ Call _tx_thread_schedule function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_schedule // Call _tx_thread_schedule function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_schedule Cortex-A15/AC6 */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function waits for a thread control block pointer to appear in */ -@/* the _tx_thread_execute_ptr variable. Once a thread pointer appears */ -@/* in the variable, the corresponding thread is resumed. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* _tx_initialize_kernel_enter ThreadX entry function */ -@/* _tx_thread_system_return Return to system from thread */ -@/* _tx_thread_context_restore Restore thread's context */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_schedule(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_schedule ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function waits for a thread control block pointer to appear in */ +/* the _tx_thread_execute_ptr variable. Once a thread pointer appears */ +/* in the variable, the corresponding thread is resumed. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_initialize_kernel_enter ThreadX entry function */ +/* _tx_thread_system_return Return to system from thread */ +/* _tx_thread_context_restore Restore thread's context */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_schedule .type _tx_thread_schedule,function _tx_thread_schedule: -@ -@ /* Enable interrupts. */ -@ + + /* Enable interrupts. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSIE if @ Enable IRQ and FIQ interrupts + CPSIE if // Enable IRQ and FIQ interrupts #else - CPSIE i @ Enable IRQ interrupts + CPSIE i // Enable IRQ interrupts #endif -@ -@ /* Wait for a thread to execute. */ -@ do -@ { - LDR r1, =_tx_thread_execute_ptr @ Address of thread execute ptr -@ + + /* Wait for a thread to execute. */ + LDR r1, =_tx_thread_execute_ptr // Address of thread execute ptr + __tx_thread_schedule_loop: -@ - LDR r0, [r1] @ Pickup next thread to execute - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_schedule_loop @ If so, keep looking for a thread -@ -@ } -@ while(_tx_thread_execute_ptr == TX_NULL); -@ -@ /* Yes! We have a thread to execute. Lockout interrupts and -@ transfer control to it. */ -@ + + LDR r0, [r1] // Pickup next thread to execute + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_schedule_loop // If so, keep looking for a thread + /* Yes! We have a thread to execute. Lockout interrupts and + transfer control to it. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ interrupts + CPSID if // Disable IRQ and FIQ interrupts #else - CPSID i @ Disable IRQ interrupts + CPSID i // Disable IRQ interrupts #endif -@ -@ /* Setup the current thread pointer. */ -@ _tx_thread_current_ptr = _tx_thread_execute_ptr; -@ - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread - STR r0, [r1] @ Setup current thread pointer -@ -@ /* Increment the run count for this thread. */ -@ _tx_thread_current_ptr -> tx_thread_run_count++; -@ - LDR r2, [r0, #4] @ Pickup run counter - LDR r3, [r0, #24] @ Pickup time-slice for this thread - ADD r2, r2, #1 @ Increment thread run-counter - STR r2, [r0, #4] @ Store the new run counter -@ -@ /* Setup time-slice, if present. */ -@ _tx_timer_time_slice = _tx_thread_current_ptr -> tx_thread_time_slice; -@ - LDR r2, =_tx_timer_time_slice @ Pickup address of time-slice - @ variable - LDR sp, [r0, #8] @ Switch stack pointers - STR r3, [r2] @ Setup time-slice -@ -@ /* Switch to the thread's stack. */ -@ sp = _tx_thread_execute_ptr -> tx_thread_stack_ptr; -@ + + /* Setup the current thread pointer. */ + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread + STR r0, [r1] // Setup current thread pointer + + /* Increment the run count for this thread. */ + + LDR r2, [r0, #4] // Pickup run counter + LDR r3, [r0, #24] // Pickup time-slice for this thread + ADD r2, r2, #1 // Increment thread run-counter + STR r2, [r0, #4] // Store the new run counter + + /* Setup time-slice, if present. */ + + LDR r2, =_tx_timer_time_slice // Pickup address of time-slice + // variable + LDR sp, [r0, #8] // Switch stack pointers + STR r3, [r2] // Setup time-slice + #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the thread entry function to indicate the thread is executing. */ -@ - MOV r5, r0 @ Save r0 - BL _tx_execution_thread_enter @ Call the thread execution enter function - MOV r0, r5 @ Restore r0 + + /* Call the thread entry function to indicate the thread is executing. */ + + MOV r5, r0 // Save r0 + BL _tx_execution_thread_enter // Call the thread execution enter function + MOV r0, r5 // Restore r0 #endif -@ -@ /* Determine if an interrupt frame or a synchronous task suspension frame -@ is present. */ -@ - LDMIA sp!, {r4, r5} @ Pickup the stack type and saved CPSR - CMP r4, #0 @ Check for synchronous context switch + + /* Determine if an interrupt frame or a synchronous task suspension frame + is present. */ + + LDMIA sp!, {r4, r5} // Pickup the stack type and saved CPSR + CMP r4, #0 // Check for synchronous context switch BEQ _tx_solicited_return - MSR SPSR_cxsf, r5 @ Setup SPSR for return + MSR SPSR_cxsf, r5 // Setup SPSR for return #ifdef TX_ENABLE_VFP_SUPPORT - LDR r1, [r0, #144] @ Pickup the VFP enabled flag - CMP r1, #0 @ Is the VFP enabled? - BEQ _tx_skip_interrupt_vfp_restore @ No, skip VFP interrupt restore - VLDMIA sp!, {D0-D15} @ Recover D0-D15 - VLDMIA sp!, {D16-D31} @ Recover D16-D31 - LDR r4, [sp], #4 @ Pickup FPSCR - VMSR FPSCR, r4 @ Restore FPSCR + LDR r1, [r0, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_interrupt_vfp_restore // No, skip VFP interrupt restore + VLDMIA sp!, {D0-D15} // Recover D0-D15 + VLDMIA sp!, {D16-D31} // Recover D16-D31 + LDR r4, [sp], #4 // Pickup FPSCR + VMSR FPSCR, r4 // Restore FPSCR _tx_skip_interrupt_vfp_restore: #endif - LDMIA sp!, {r0-r12, lr, pc}^ @ Return to point of thread interrupt + LDMIA sp!, {r0-r12, lr, pc}^ // Return to point of thread interrupt _tx_solicited_return: #ifdef TX_ENABLE_VFP_SUPPORT - LDR r1, [r0, #144] @ Pickup the VFP enabled flag - CMP r1, #0 @ Is the VFP enabled? - BEQ _tx_skip_solicited_vfp_restore @ No, skip VFP solicited restore - VLDMIA sp!, {D8-D15} @ Recover D8-D15 - VLDMIA sp!, {D16-D31} @ Recover D16-D31 - LDR r4, [sp], #4 @ Pickup FPSCR - VMSR FPSCR, r4 @ Restore FPSCR + LDR r1, [r0, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_solicited_vfp_restore // No, skip VFP solicited restore + VLDMIA sp!, {D8-D15} // Recover D8-D15 + VLDMIA sp!, {D16-D31} // Recover D16-D31 + LDR r4, [sp], #4 // Pickup FPSCR + VMSR FPSCR, r4 // Restore FPSCR _tx_skip_solicited_vfp_restore: #endif - MSR CPSR_cxsf, r5 @ Recover CPSR - LDMIA sp!, {r4-r11, lr} @ Return to thread synchronously + MSR CPSR_cxsf, r5 // Recover CPSR + LDMIA sp!, {r4-r11, lr} // Return to thread synchronously #ifdef __THUMB_INTERWORK - BX lr @ Return to caller + BX lr // Return to caller #else - MOV pc, lr @ Return to caller + MOV pc, lr // Return to caller #endif -@ -@} -@ #ifdef TX_ENABLE_VFP_SUPPORT .global tx_thread_vfp_enable .type tx_thread_vfp_enable,function tx_thread_vfp_enable: - MRS r2, CPSR @ Pickup the CPSR + MRS r2, CPSR // Pickup the CPSR #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Enable IRQ and FIQ interrupts + CPSID if // Enable IRQ and FIQ interrupts #else - CPSID i @ Enable IRQ interrupts + CPSID i // Enable IRQ interrupts #endif - LDR r0, =_tx_thread_current_ptr @ Build current thread pointer address - LDR r1, [r0] @ Pickup current thread pointer - CMP r1, #0 @ Check for NULL thread pointer - BEQ __tx_no_thread_to_enable @ If NULL, skip VFP enable - MOV r0, #1 @ Build enable value - STR r0, [r1, #144] @ Set the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) + LDR r0, =_tx_thread_current_ptr // Build current thread pointer address + LDR r1, [r0] // Pickup current thread pointer + CMP r1, #0 // Check for NULL thread pointer + BEQ __tx_no_thread_to_enable // If NULL, skip VFP enable + MOV r0, #1 // Build enable value + STR r0, [r1, #144] // Set the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) __tx_no_thread_to_enable: - MSR CPSR_cxsf, r2 @ Recover CPSR - BX LR @ Return to caller + MSR CPSR_cxsf, r2 // Recover CPSR + BX LR // Return to caller .global tx_thread_vfp_disable .type tx_thread_vfp_disable,function tx_thread_vfp_disable: - MRS r2, CPSR @ Pickup the CPSR + MRS r2, CPSR // Pickup the CPSR #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Enable IRQ and FIQ interrupts + CPSID if // Enable IRQ and FIQ interrupts #else - CPSID i @ Enable IRQ interrupts + CPSID i // Enable IRQ interrupts #endif - LDR r0, =_tx_thread_current_ptr @ Build current thread pointer address - LDR r1, [r0] @ Pickup current thread pointer - CMP r1, #0 @ Check for NULL thread pointer - BEQ __tx_no_thread_to_disable @ If NULL, skip VFP disable - MOV r0, #0 @ Build disable value - STR r0, [r1, #144] @ Clear the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) + LDR r0, =_tx_thread_current_ptr // Build current thread pointer address + LDR r1, [r0] // Pickup current thread pointer + CMP r1, #0 // Check for NULL thread pointer + BEQ __tx_no_thread_to_disable // If NULL, skip VFP disable + MOV r0, #0 // Build disable value + STR r0, [r1, #144] // Clear the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) __tx_no_thread_to_disable: - MSR CPSR_cxsf, r2 @ Recover CPSR - BX LR @ Return to caller + MSR CPSR_cxsf, r2 // Recover CPSR + BX LR // Return to caller #endif - diff --git a/ports/cortex_a15/ac6/src/tx_thread_stack_build.S b/ports/cortex_a15/ac6/src/tx_thread_stack_build.S index df648838..f413e673 100644 --- a/ports/cortex_a15/ac6/src/tx_thread_stack_build.S +++ b/ports/cortex_a15/ac6/src/tx_thread_stack_build.S @@ -1,178 +1,164 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ .arm -SVC_MODE = 0x13 @ SVC mode +SVC_MODE = 0x13 // SVC mode #ifdef TX_ENABLE_FIQ_SUPPORT -CPSR_MASK = 0xDF @ Mask initial CPSR, IRQ & FIQ interrupts enabled +CPSR_MASK = 0xDF // Mask initial CPSR, IRQ & FIQ interrupts enabled #else -CPSR_MASK = 0x9F @ Mask initial CPSR, IRQ interrupts enabled +CPSR_MASK = 0x9F // Mask initial CPSR, IRQ interrupts enabled #endif -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_stack_build for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_stack_build for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .thumb .global $_tx_thread_stack_build .type $_tx_thread_stack_build,function $_tx_thread_stack_build: - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_stack_build @ Call _tx_thread_stack_build function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_stack_build // Call _tx_thread_stack_build function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_stack_build Cortex-A15/AC6 */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function builds a stack frame on the supplied thread's stack. */ -@/* The stack frame results in a fake interrupt return to the supplied */ -@/* function pointer. */ -@/* */ -@/* INPUT */ -@/* */ -@/* thread_ptr Pointer to thread control blk */ -@/* function_ptr Pointer to return function */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* _tx_thread_create Create thread service */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_stack_build(TX_THREAD *thread_ptr, VOID (*function_ptr)(VOID)) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_stack_build ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function builds a stack frame on the supplied thread's stack. */ +/* The stack frame results in a fake interrupt return to the supplied */ +/* function pointer. */ +/* */ +/* INPUT */ +/* */ +/* thread_ptr Pointer to thread control blk */ +/* function_ptr Pointer to return function */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_thread_create Create thread service */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_stack_build .type _tx_thread_stack_build,function _tx_thread_stack_build: -@ -@ -@ /* Build a fake interrupt frame. The form of the fake interrupt stack -@ on the Cortex-A15 should look like the following after it is built: -@ -@ Stack Top: 1 Interrupt stack frame type -@ CPSR Initial value for CPSR -@ a1 (r0) Initial value for a1 -@ a2 (r1) Initial value for a2 -@ a3 (r2) Initial value for a3 -@ a4 (r3) Initial value for a4 -@ v1 (r4) Initial value for v1 -@ v2 (r5) Initial value for v2 -@ v3 (r6) Initial value for v3 -@ v4 (r7) Initial value for v4 -@ v5 (r8) Initial value for v5 -@ sb (r9) Initial value for sb -@ sl (r10) Initial value for sl -@ fp (r11) Initial value for fp -@ ip (r12) Initial value for ip -@ lr (r14) Initial value for lr -@ pc (r15) Initial value for pc -@ 0 For stack backtracing -@ -@ Stack Bottom: (higher memory address) */ -@ - LDR r2, [r0, #16] @ Pickup end of stack area - BIC r2, r2, #7 @ Ensure 8-byte alignment - SUB r2, r2, #76 @ Allocate space for the stack frame -@ -@ /* Actually build the stack frame. */ -@ - MOV r3, #1 @ Build interrupt stack type - STR r3, [r2, #0] @ Store stack type - MOV r3, #0 @ Build initial register value - STR r3, [r2, #8] @ Store initial r0 - STR r3, [r2, #12] @ Store initial r1 - STR r3, [r2, #16] @ Store initial r2 - STR r3, [r2, #20] @ Store initial r3 - STR r3, [r2, #24] @ Store initial r4 - STR r3, [r2, #28] @ Store initial r5 - STR r3, [r2, #32] @ Store initial r6 - STR r3, [r2, #36] @ Store initial r7 - STR r3, [r2, #40] @ Store initial r8 - STR r3, [r2, #44] @ Store initial r9 - LDR r3, [r0, #12] @ Pickup stack starting address - STR r3, [r2, #48] @ Store initial r10 (sl) - LDR r3,=_tx_thread_schedule @ Pickup address of _tx_thread_schedule for GDB backtrace - STR r3, [r2, #60] @ Store initial r14 (lr) - MOV r3, #0 @ Build initial register value - STR r3, [r2, #52] @ Store initial r11 - STR r3, [r2, #56] @ Store initial r12 - STR r1, [r2, #64] @ Store initial pc - STR r3, [r2, #68] @ 0 for back-trace - MRS r1, CPSR @ Pickup CPSR - BIC r1, r1, #CPSR_MASK @ Mask mode bits of CPSR - ORR r3, r1, #SVC_MODE @ Build CPSR, SVC mode, interrupts enabled - STR r3, [r2, #4] @ Store initial CPSR -@ -@ /* Setup stack pointer. */ -@ thread_ptr -> tx_thread_stack_ptr = r2; -@ - STR r2, [r0, #8] @ Save stack pointer in thread's - @ control block + + + /* Build a fake interrupt frame. The form of the fake interrupt stack + on the ARMv7-A should look like the following after it is built: + + Stack Top: 1 Interrupt stack frame type + CPSR Initial value for CPSR + a1 (r0) Initial value for a1 + a2 (r1) Initial value for a2 + a3 (r2) Initial value for a3 + a4 (r3) Initial value for a4 + v1 (r4) Initial value for v1 + v2 (r5) Initial value for v2 + v3 (r6) Initial value for v3 + v4 (r7) Initial value for v4 + v5 (r8) Initial value for v5 + sb (r9) Initial value for sb + sl (r10) Initial value for sl + fp (r11) Initial value for fp + ip (r12) Initial value for ip + lr (r14) Initial value for lr + pc (r15) Initial value for + 0 For stack backtracing + + Stack Bottom: (higher memory address) */ + + LDR r2, [r0, #16] // Pickup end of stack area + BIC r2, r2, #7 // Ensure 8-byte alignment + SUB r2, r2, #76 // Allocate space for the stack frame + + /* Actually build the stack frame. */ + + MOV r3, #1 // Build interrupt stack type + STR r3, [r2, #0] // Store stack type + MOV r3, #0 // Build initial register value + STR r3, [r2, #8] // Store initial r0 + STR r3, [r2, #12] // Store initial r1 + STR r3, [r2, #16] // Store initial r2 + STR r3, [r2, #20] // Store initial r3 + STR r3, [r2, #24] // Store initial r4 + STR r3, [r2, #28] // Store initial r5 + STR r3, [r2, #32] // Store initial r6 + STR r3, [r2, #36] // Store initial r7 + STR r3, [r2, #40] // Store initial r8 + STR r3, [r2, #44] // Store initial r9 + LDR r3, [r0, #12] // Pickup stack starting address + STR r3, [r2, #48] // Store initial r10 (sl) + LDR r3,=_tx_thread_schedule // Pickup address of _tx_thread_schedule for GDB backtrace + STR r3, [r2, #60] // Store initial r14 (lr) + MOV r3, #0 // Build initial register value + STR r3, [r2, #52] // Store initial r11 + STR r3, [r2, #56] // Store initial r12 + STR r1, [r2, #64] // Store initial pc + STR r3, [r2, #68] // 0 for back-trace + MRS r1, CPSR // Pickup CPSR + BIC r1, r1, #CPSR_MASK // Mask mode bits of CPSR + ORR r3, r1, #SVC_MODE // Build CPSR, SVC mode, interrupts enabled + STR r3, [r2, #4] // Store initial CPSR + + /* Setup stack pointer. */ + + STR r2, [r0, #8] // Save stack pointer in thread's + // control block #ifdef __THUMB_INTERWORK - BX lr @ Return to caller + BX lr // Return to caller #else - MOV pc, lr @ Return to caller + MOV pc, lr // Return to caller #endif -@} - - diff --git a/ports/cortex_a15/ac6/src/tx_thread_system_return.S b/ports/cortex_a15/ac6/src/tx_thread_system_return.S index 11b376a7..cb7d62ce 100644 --- a/ports/cortex_a15/ac6/src/tx_thread_system_return.S +++ b/ports/cortex_a15/ac6/src/tx_thread_system_return.S @@ -1,182 +1,162 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .arm -@ -@ + + .global _tx_thread_current_ptr .global _tx_timer_time_slice .global _tx_thread_schedule -@ -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_system_return for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_system_return for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_system_return .type $_tx_thread_system_return,function $_tx_thread_system_return: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_system_return @ Call _tx_thread_system_return function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_system_return // Call _tx_thread_system_return function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_system_return Cortex-A15/AC6 */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is target processor specific. It is used to transfer */ -@/* control from a thread back to the ThreadX system. Only a */ -@/* minimal context is saved since the compiler assumes temp registers */ -@/* are going to get slicked by a function call anyway. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* _tx_thread_schedule Thread scheduling loop */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ThreadX components */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_system_return(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_system_return ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is target processor specific. It is used to transfer */ +/* control from a thread back to the ThreadX system. Only a */ +/* minimal context is saved since the compiler assumes temp registers */ +/* are going to get slicked by a function call anyway. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling loop */ +/* */ +/* CALLED BY */ +/* */ +/* ThreadX components */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_system_return .type _tx_thread_system_return,function _tx_thread_system_return: -@ -@ /* Save minimal context on the stack. */ -@ - STMDB sp!, {r4-r11, lr} @ Save minimal context - LDR r4, =_tx_thread_current_ptr @ Pickup address of current ptr - LDR r5, [r4] @ Pickup current thread pointer - + /* Save minimal context on the stack. */ + + STMDB sp!, {r4-r11, lr} // Save minimal context + + LDR r4, =_tx_thread_current_ptr // Pickup address of current ptr + LDR r5, [r4] // Pickup current thread pointer + #ifdef TX_ENABLE_VFP_SUPPORT - LDR r1, [r5, #144] @ Pickup the VFP enabled flag - CMP r1, #0 @ Is the VFP enabled? - BEQ _tx_skip_solicited_vfp_save @ No, skip VFP solicited save - VMRS r1, FPSCR @ Pickup the FPSCR - STR r1, [sp, #-4]! @ Save FPSCR - VSTMDB sp!, {D16-D31} @ Save D16-D31 - VSTMDB sp!, {D8-D15} @ Save D8-D15 + LDR r1, [r5, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_solicited_vfp_save // No, skip VFP solicited save + VMRS r1, FPSCR // Pickup the FPSCR + STR r1, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D8-D15} // Save D8-D15 _tx_skip_solicited_vfp_save: #endif - MOV r0, #0 @ Build a solicited stack type - MRS r1, CPSR @ Pickup the CPSR - STMDB sp!, {r0-r1} @ Save type and CPSR -@ -@ /* Lockout interrupts. */ -@ -#ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ interrupts -#else - CPSID i @ Disable IRQ interrupts -#endif - -#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the thread exit function to indicate the thread is no longer executing. */ -@ - BL _tx_execution_thread_exit @ Call the thread exit function -#endif - MOV r3, r4 @ Pickup address of current ptr - MOV r0, r5 @ Pickup current thread pointer - LDR r2, =_tx_timer_time_slice @ Pickup address of time slice - LDR r1, [r2] @ Pickup current time slice -@ -@ /* Save current stack and switch to system stack. */ -@ _tx_thread_current_ptr -> tx_thread_stack_ptr = sp; -@ sp = _tx_thread_system_stack_ptr; -@ - STR sp, [r0, #8] @ Save thread stack pointer -@ -@ /* Determine if the time-slice is active. */ -@ if (_tx_timer_time_slice) -@ { -@ - MOV r4, #0 @ Build clear value - CMP r1, #0 @ Is a time-slice active? - BEQ __tx_thread_dont_save_ts @ No, don't save the time-slice -@ -@ /* Save time-slice for the thread and clear the current time-slice. */ -@ _tx_thread_current_ptr -> tx_thread_time_slice = _tx_timer_time_slice; -@ _tx_timer_time_slice = 0; -@ - STR r4, [r2] @ Clear time-slice - STR r1, [r0, #24] @ Save current time-slice -@ -@ } -__tx_thread_dont_save_ts: -@ -@ /* Clear the current thread pointer. */ -@ _tx_thread_current_ptr = TX_NULL; -@ - STR r4, [r3] @ Clear current thread pointer - B _tx_thread_schedule @ Jump to scheduler! -@ -@} + MOV r0, #0 // Build a solicited stack type + MRS r1, CPSR // Pickup the CPSR + STMDB sp!, {r0-r1} // Save type and CPSR + /* Lockout interrupts. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Disable IRQ and FIQ interrupts +#else + CPSID i // Disable IRQ interrupts +#endif + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the thread exit function to indicate the thread is no longer executing. */ + + BL _tx_execution_thread_exit // Call the thread exit function +#endif + MOV r3, r4 // Pickup address of current ptr + MOV r0, r5 // Pickup current thread pointer + LDR r2, =_tx_timer_time_slice // Pickup address of time slice + LDR r1, [r2] // Pickup current time slice + + /* Save current stack and switch to system stack. */ + + STR sp, [r0, #8] // Save thread stack pointer + + /* Determine if the time-slice is active. */ + + MOV r4, #0 // Build clear value + CMP r1, #0 // Is a time-slice active? + BEQ __tx_thread_dont_save_ts // No, don't save the time-slice + + /* Save time-slice for the thread and clear the current time-slice. */ + + STR r4, [r2] // Clear time-slice + STR r1, [r0, #24] // Save current time-slice + +__tx_thread_dont_save_ts: + + /* Clear the current thread pointer. */ + + STR r4, [r3] // Clear current thread pointer + B _tx_thread_schedule // Jump to scheduler! diff --git a/ports/cortex_a15/ac6/src/tx_thread_vectored_context_save.S b/ports/cortex_a15/ac6/src/tx_thread_vectored_context_save.S index 5981286c..d846223f 100644 --- a/ports/cortex_a15/ac6/src/tx_thread_vectored_context_save.S +++ b/ports/cortex_a15/ac6/src/tx_thread_vectored_context_save.S @@ -1,192 +1,165 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .global _tx_thread_system_state .global _tx_thread_current_ptr -@ -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_vectored_context_save -@ since it will never be called 16-bit mode. */ -@ + .global _tx_execution_isr_enter + + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_vectored_context_save + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_vectored_context_save Cortex-A15/AC6 */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function saves the context of an executing thread in the */ -@/* beginning of interrupt processing. The function also ensures that */ -@/* the system stack is used upon return to the calling ISR. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_vectored_context_save(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_vectored_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_vectored_context_save .type _tx_thread_vectored_context_save,function _tx_thread_vectored_context_save: -@ -@ /* Upon entry to this routine, it is assumed that IRQ interrupts are locked -@ out, we are in IRQ mode, and all registers are intact. */ -@ -@ /* Check for a nested interrupt condition. */ -@ if (_tx_thread_system_state++) -@ { -@ + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ interrupts + CPSID if // Disable IRQ and FIQ interrupts #endif - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3, #0] @ Pickup system state - CMP r2, #0 @ Is this the first interrupt? - BEQ __tx_thread_not_nested_save @ Yes, not a nested context save -@ -@ /* Nested interrupt condition. */ -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3, #0] @ Store it back in the variable -@ -@ /* Note: Minimal context of interrupted thread is already saved. */ -@ -@ /* Return to the ISR. */ -@ - MOV r10, #0 @ Clear stack limit + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3, #0] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3, #0] // Store it back in the variable + + /* Note: Minimal context of interrupted thread is already saved. */ + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - MOV pc, lr @ Return to caller -@ + MOV pc, lr // Return to caller + __tx_thread_not_nested_save: -@ } -@ -@ /* Otherwise, not nested, check to see if a thread was running. */ -@ else if (_tx_thread_current_ptr) -@ { -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3, #0] @ Store it back in the variable - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1, #0] @ Pickup current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_idle_system_save @ If so, interrupt occurred in - @ scheduling loop - nothing needs saving! -@ -@ /* Note: Minimal context of interrupted thread is already saved. */ -@ -@ /* Save the current stack pointer in the thread's control block. */ -@ _tx_thread_current_ptr -> tx_thread_stack_ptr = sp; -@ -@ /* Switch to the system stack. */ -@ sp = _tx_thread_system_stack_ptr; -@ - MOV r10, #0 @ Clear stack limit + + /* Otherwise, not nested, check to see if a thread was running. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3, #0] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1, #0] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + /* Note: Minimal context of interrupted thread is already saved. */ + + /* Save the current stack pointer in the thread's control block. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - MOV pc, lr @ Return to caller -@ -@ } -@ else -@ { -@ + MOV pc, lr // Return to caller + __tx_thread_idle_system_save: -@ -@ /* Interrupt occurred in the scheduling loop. */ -@ -@ /* Not much to do here, just adjust the stack pointer, and return to IRQ -@ processing. */ -@ - MOV r10, #0 @ Clear stack limit + + /* Interrupt occurred in the scheduling loop. */ + + /* Not much to do here, just adjust the stack pointer, and return to IRQ + processing. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - ADD sp, sp, #32 @ Recover saved registers - MOV pc, lr @ Return to caller -@ -@ } -@} - + ADD sp, sp, #32 // Recover saved registers + MOV pc, lr // Return to caller diff --git a/ports/cortex_a15/ac6/src/tx_timer_interrupt.S b/ports/cortex_a15/ac6/src/tx_timer_interrupt.S index 73285451..7337ed0c 100644 --- a/ports/cortex_a15/ac6/src/tx_timer_interrupt.S +++ b/ports/cortex_a15/ac6/src/tx_timer_interrupt.S @@ -1,40 +1,30 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Timer */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_timer.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Timer */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .arm -@ -@/* Define Assembly language external references... */ -@ + +/* Define Assembly language external references... */ + .global _tx_timer_time_slice .global _tx_timer_system_clock .global _tx_timer_current_ptr @@ -43,237 +33,199 @@ .global _tx_timer_expired_time_slice .global _tx_timer_expired .global _tx_thread_time_slice -@ -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_timer_interrupt for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + + + +/* Define the 16-bit Thumb mode veneer for _tx_timer_interrupt for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .thumb .global $_tx_timer_interrupt .type $_tx_timer_interrupt,function $_tx_timer_interrupt: - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_timer_interrupt @ Call _tx_timer_interrupt function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_timer_interrupt // Call _tx_timer_interrupt function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_timer_interrupt Cortex-A15/AC6 */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function processes the hardware timer interrupt. This */ -@/* processing includes incrementing the system clock and checking for */ -@/* time slice and/or timer expiration. If either is found, the */ -@/* interrupt context save/restore functions are called along with the */ -@/* expiration functions. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* _tx_thread_time_slice Time slice interrupted thread */ -@/* _tx_timer_expiration_process Timer expiration processing */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* interrupt vector */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_timer_interrupt(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_timer_interrupt ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function processes the hardware timer interrupt. This */ +/* processing includes incrementing the system clock and checking for */ +/* time slice and/or timer expiration. If either is found, the */ +/* interrupt context save/restore functions are called along with the */ +/* expiration functions. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_time_slice Time slice interrupted thread */ +/* _tx_timer_expiration_process Timer expiration processing */ +/* */ +/* CALLED BY */ +/* */ +/* interrupt vector */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_timer_interrupt .type _tx_timer_interrupt,function _tx_timer_interrupt: -@ -@ /* Upon entry to this routine, it is assumed that context save has already -@ been called, and therefore the compiler scratch registers are available -@ for use. */ -@ -@ /* Increment the system clock. */ -@ _tx_timer_system_clock++; -@ - LDR r1, =_tx_timer_system_clock @ Pickup address of system clock - LDR r0, [r1] @ Pickup system clock - ADD r0, r0, #1 @ Increment system clock - STR r0, [r1] @ Store new system clock -@ -@ /* Test for time-slice expiration. */ -@ if (_tx_timer_time_slice) -@ { -@ - LDR r3, =_tx_timer_time_slice @ Pickup address of time-slice - LDR r2, [r3] @ Pickup time-slice - CMP r2, #0 @ Is it non-active? - BEQ __tx_timer_no_time_slice @ Yes, skip time-slice processing -@ -@ /* Decrement the time_slice. */ -@ _tx_timer_time_slice--; -@ - SUB r2, r2, #1 @ Decrement the time-slice - STR r2, [r3] @ Store new time-slice value -@ -@ /* Check for expiration. */ -@ if (__tx_timer_time_slice == 0) -@ - CMP r2, #0 @ Has it expired? - BNE __tx_timer_no_time_slice @ No, skip expiration processing -@ -@ /* Set the time-slice expired flag. */ -@ _tx_timer_expired_time_slice = TX_TRUE; -@ - LDR r3, =_tx_timer_expired_time_slice @ Pickup address of expired flag - MOV r0, #1 @ Build expired value - STR r0, [r3] @ Set time-slice expiration flag -@ -@ } -@ -__tx_timer_no_time_slice: -@ -@ /* Test for timer expiration. */ -@ if (*_tx_timer_current_ptr) -@ { -@ - LDR r1, =_tx_timer_current_ptr @ Pickup current timer pointer address - LDR r0, [r1] @ Pickup current timer - LDR r2, [r0] @ Pickup timer list entry - CMP r2, #0 @ Is there anything in the list? - BEQ __tx_timer_no_timer @ No, just increment the timer -@ -@ /* Set expiration flag. */ -@ _tx_timer_expired = TX_TRUE; -@ - LDR r3, =_tx_timer_expired @ Pickup expiration flag address - MOV r2, #1 @ Build expired value - STR r2, [r3] @ Set expired flag - B __tx_timer_done @ Finished timer processing -@ -@ } -@ else -@ { -__tx_timer_no_timer: -@ -@ /* No timer expired, increment the timer pointer. */ -@ _tx_timer_current_ptr++; -@ - ADD r0, r0, #4 @ Move to next timer -@ -@ /* Check for wraparound. */ -@ if (_tx_timer_current_ptr == _tx_timer_list_end) -@ - LDR r3, =_tx_timer_list_end @ Pickup address of timer list end - LDR r2, [r3] @ Pickup list end - CMP r0, r2 @ Are we at list end? - BNE __tx_timer_skip_wrap @ No, skip wraparound logic -@ -@ /* Wrap to beginning of list. */ -@ _tx_timer_current_ptr = _tx_timer_list_start; -@ - LDR r3, =_tx_timer_list_start @ Pickup address of timer list start - LDR r0, [r3] @ Set current pointer to list start -@ -__tx_timer_skip_wrap: -@ - STR r0, [r1] @ Store new current timer pointer -@ } -@ -__tx_timer_done: -@ -@ -@ /* See if anything has expired. */ -@ if ((_tx_timer_expired_time_slice) || (_tx_timer_expired)) -@ { -@ - LDR r3, =_tx_timer_expired_time_slice @ Pickup address of expired flag - LDR r2, [r3] @ Pickup time-slice expired flag - CMP r2, #0 @ Did a time-slice expire? - BNE __tx_something_expired @ If non-zero, time-slice expired - LDR r1, =_tx_timer_expired @ Pickup address of other expired flag - LDR r0, [r1] @ Pickup timer expired flag - CMP r0, #0 @ Did a timer expire? - BEQ __tx_timer_nothing_expired @ No, nothing expired -@ -__tx_something_expired: -@ -@ - STMDB sp!, {r0, lr} @ Save the lr register on the stack - @ and save r0 just to keep 8-byte alignment -@ -@ /* Did a timer expire? */ -@ if (_tx_timer_expired) -@ { -@ - LDR r1, =_tx_timer_expired @ Pickup address of expired flag - LDR r0, [r1] @ Pickup timer expired flag - CMP r0, #0 @ Check for timer expiration - BEQ __tx_timer_dont_activate @ If not set, skip timer activation -@ -@ /* Process timer expiration. */ -@ _tx_timer_expiration_process(); -@ - BL _tx_timer_expiration_process @ Call the timer expiration handling routine -@ -@ } -__tx_timer_dont_activate: -@ -@ /* Did time slice expire? */ -@ if (_tx_timer_expired_time_slice) -@ { -@ - LDR r3, =_tx_timer_expired_time_slice @ Pickup address of time-slice expired - LDR r2, [r3] @ Pickup the actual flag - CMP r2, #0 @ See if the flag is set - BEQ __tx_timer_not_ts_expiration @ No, skip time-slice processing -@ -@ /* Time slice interrupted thread. */ -@ _tx_thread_time_slice(); -@ - BL _tx_thread_time_slice @ Call time-slice processing -@ -@ } -@ -__tx_timer_not_ts_expiration: -@ - LDMIA sp!, {r0, lr} @ Recover lr register (r0 is just there for - @ the 8-byte stack alignment -@ -@ } -@ -__tx_timer_nothing_expired: -@ -#ifdef __THUMB_INTERWORK - BX lr @ Return to caller -#else - MOV pc, lr @ Return to caller -#endif -@ -@} + /* Upon entry to this routine, it is assumed that context save has already + been called, and therefore the compiler scratch registers are available + for use. */ + + /* Increment the system clock. */ + + LDR r1, =_tx_timer_system_clock // Pickup address of system clock + LDR r0, [r1] // Pickup system clock + ADD r0, r0, #1 // Increment system clock + STR r0, [r1] // Store new system clock + + /* Test for time-slice expiration. */ + + LDR r3, =_tx_timer_time_slice // Pickup address of time-slice + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it non-active? + BEQ __tx_timer_no_time_slice // Yes, skip time-slice processing + + /* Decrement the time_slice. */ + + SUB r2, r2, #1 // Decrement the time-slice + STR r2, [r3] // Store new time-slice value + + /* Check for expiration. */ + + CMP r2, #0 // Has it expired? + BNE __tx_timer_no_time_slice // No, skip expiration processing + + /* Set the time-slice expired flag. */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of expired flag + MOV r0, #1 // Build expired value + STR r0, [r3] // Set time-slice expiration flag + +__tx_timer_no_time_slice: + + /* Test for timer expiration. */ + + LDR r1, =_tx_timer_current_ptr // Pickup current timer pointer address + LDR r0, [r1] // Pickup current timer + LDR r2, [r0] // Pickup timer list entry + CMP r2, #0 // Is there anything in the list? + BEQ __tx_timer_no_timer // No, just increment the timer + + /* Set expiration flag. */ + + LDR r3, =_tx_timer_expired // Pickup expiration flag address + MOV r2, #1 // Build expired value + STR r2, [r3] // Set expired flag + B __tx_timer_done // Finished timer processing + +__tx_timer_no_timer: + + /* No timer expired, increment the timer pointer. */ + ADD r0, r0, #4 // Move to next timer + + /* Check for wraparound. */ + + LDR r3, =_tx_timer_list_end // Pickup address of timer list end + LDR r2, [r3] // Pickup list end + CMP r0, r2 // Are we at list end? + BNE __tx_timer_skip_wrap // No, skip wraparound logic + + /* Wrap to beginning of list. */ + + LDR r3, =_tx_timer_list_start // Pickup address of timer list start + LDR r0, [r3] // Set current pointer to list start + +__tx_timer_skip_wrap: + + STR r0, [r1] // Store new current timer pointer + +__tx_timer_done: + + /* See if anything has expired. */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of expired flag + LDR r2, [r3] // Pickup time-slice expired flag + CMP r2, #0 // Did a time-slice expire? + BNE __tx_something_expired // If non-zero, time-slice expired + LDR r1, =_tx_timer_expired // Pickup address of other expired flag + LDR r0, [r1] // Pickup timer expired flag + CMP r0, #0 // Did a timer expire? + BEQ __tx_timer_nothing_expired // No, nothing expired + +__tx_something_expired: + + STMDB sp!, {r0, lr} // Save the lr register on the stack + // and save r0 just to keep 8-byte alignment + + /* Did a timer expire? */ + + LDR r1, =_tx_timer_expired // Pickup address of expired flag + LDR r0, [r1] // Pickup timer expired flag + CMP r0, #0 // Check for timer expiration + BEQ __tx_timer_dont_activate // If not set, skip timer activation + + /* Process timer expiration. */ + BL _tx_timer_expiration_process // Call the timer expiration handling routine + +__tx_timer_dont_activate: + + /* Did time slice expire? */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of time-slice expired + LDR r2, [r3] // Pickup the actual flag + CMP r2, #0 // See if the flag is set + BEQ __tx_timer_not_ts_expiration // No, skip time-slice processing + + /* Time slice interrupted thread. */ + + BL _tx_thread_time_slice // Call time-slice processing + +__tx_timer_not_ts_expiration: + + LDMIA sp!, {r0, lr} // Recover lr register (r0 is just there for + // the 8-byte stack alignment + +__tx_timer_nothing_expired: + +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a15/gnu/example_build/build_threadx_sample.bat b/ports/cortex_a15/gnu/example_build/build_threadx_sample.bat index af64fc3b..0d5617a1 100644 --- a/ports/cortex_a15/gnu/example_build/build_threadx_sample.bat +++ b/ports/cortex_a15/gnu/example_build/build_threadx_sample.bat @@ -2,5 +2,5 @@ arm-none-eabi-gcc -c -g -mcpu=cortex-a15 reset.S arm-none-eabi-gcc -c -g -mcpu=cortex-a15 crt0.S arm-none-eabi-gcc -c -g -mcpu=cortex-a15 tx_initialize_low_level.S arm-none-eabi-gcc -c -g -mcpu=cortex-a15 -I../../../../common/inc -I../inc sample_threadx.c -arm-none-eabi-ld -A cortex-a15 -T sample_threadx.ld reset.o crt0.o tx_initialize_low_level.o sample_threadx.o tx.a libc.a libgcc.a -o sample_threadx.out -M > sample_threadx.map +arm-none-eabi-gcc -g -mcpu=cortex-a15 -T sample_threadx.ld --specs=nosys.specs -o sample_threadx.out -Wl,-Map=sample_threadx.map tx_initialize_low_level.o sample_threadx.o tx.a diff --git a/ports/cortex_a15/gnu/example_build/crt0.S b/ports/cortex_a15/gnu/example_build/crt0.S index aa0f3239..56b6c958 100644 --- a/ports/cortex_a15/gnu/example_build/crt0.S +++ b/ports/cortex_a15/gnu/example_build/crt0.S @@ -26,13 +26,13 @@ _mainCRTStartup: mov a2, #0 /* Second arg: fill value */ mov fp, a2 /* Null frame pointer */ mov r7, a2 /* Null frame pointer for Thumb */ - - ldr a1, .LC1 /* First arg: start of memory block */ - ldr a3, .LC2 - sub a3, a3, a1 /* Third arg: length of block */ - - + ldr a1, .LC1 /* First arg: start of memory block */ + ldr a3, .LC2 + sub a3, a3, a1 /* Third arg: length of block */ + + + bl memset mov r0, #0 /* no arguments */ mov r1, #0 /* no argv either */ @@ -48,15 +48,15 @@ _mainCRTStartup: /* bl init */ mov r0, r4 mov r1, r5 -#endif +#endif bl main bl exit /* Should not return. */ - - /* For Thumb, constants must be after the code since only + + /* For Thumb, constants must be after the code since only positive offsets are supported for PC relative addresses. */ - + .align 0 .LC0: .LC1: diff --git a/ports/cortex_a15/gnu/example_build/reset.S b/ports/cortex_a15/gnu/example_build/reset.S index 856e31eb..597e9d9a 100644 --- a/ports/cortex_a15/gnu/example_build/reset.S +++ b/ports/cortex_a15/gnu/example_build/reset.S @@ -1,35 +1,24 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Initialize */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_initialize.h" -@#include "tx_thread.h" -@#include "tx_timer.h" +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Initialize */ +/** */ +/**************************************************************************/ +/**************************************************************************/ .arm @@ -41,36 +30,35 @@ .global __tx_reserved_handler .global __tx_irq_handler .global __tx_fiq_handler -@ -@ -@/* Define the vector area. This should be located or copied to 0. */ -@ + +/* Define the vector area. This should be located or copied to 0. */ + .text .global __vectors __vectors: - LDR pc, STARTUP @ Reset goes to startup function - LDR pc, UNDEFINED @ Undefined handler - LDR pc, SWI @ Software interrupt handler - LDR pc, PREFETCH @ Prefetch exception handler - LDR pc, ABORT @ Abort exception handler - LDR pc, RESERVED @ Reserved exception handler - LDR pc, IRQ @ IRQ interrupt handler - LDR pc, FIQ @ FIQ interrupt handler + LDR pc, STARTUP // Reset goes to startup function + LDR pc, UNDEFINED // Undefined handler + LDR pc, SWI // Software interrupt handler + LDR pc, PREFETCH // Prefetch exception handler + LDR pc, ABORT // Abort exception handler + LDR pc, RESERVED // Reserved exception handler + LDR pc, IRQ // IRQ interrupt handler + LDR pc, FIQ // FIQ interrupt handler STARTUP: - .word _start @ Reset goes to C startup function + .word _start // Reset goes to C startup function UNDEFINED: - .word __tx_undefined @ Undefined handler + .word __tx_undefined // Undefined handler SWI: - .word __tx_swi_interrupt @ Software interrupt handler + .word __tx_swi_interrupt // Software interrupt handler PREFETCH: - .word __tx_prefetch_handler @ Prefetch exception handler -ABORT: - .word __tx_abort_handler @ Abort exception handler -RESERVED: - .word __tx_reserved_handler @ Reserved exception handler -IRQ: - .word __tx_irq_handler @ IRQ interrupt handler + .word __tx_prefetch_handler // Prefetch exception handler +ABORT: + .word __tx_abort_handler // Abort exception handler +RESERVED: + .word __tx_reserved_handler // Reserved exception handler +IRQ: + .word __tx_irq_handler // IRQ interrupt handler FIQ: - .word __tx_fiq_handler @ FIQ interrupt handler + .word __tx_fiq_handler // FIQ interrupt handler diff --git a/ports/cortex_a15/gnu/example_build/sample_threadx.c b/ports/cortex_a15/gnu/example_build/sample_threadx.c index 418ec634..8c61de06 100644 --- a/ports/cortex_a15/gnu/example_build/sample_threadx.c +++ b/ports/cortex_a15/gnu/example_build/sample_threadx.c @@ -1,5 +1,5 @@ /* This is a small demo of the high-performance ThreadX kernel. It includes examples of eight - threads of different priorities, using a message queue, semaphore, mutex, event flags group, + threads of different priorities, using a message queue, semaphore, mutex, event flags group, byte pool, and block pool. */ #include "tx_api.h" @@ -80,42 +80,42 @@ CHAR *pointer = TX_NULL; tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); /* Create the main thread. */ - tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, 1, 1, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 1. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - /* Create threads 1 and 2. These threads pass information through a ThreadX + /* Create threads 1 and 2. These threads pass information through a ThreadX message queue. It is also interesting to note that these threads have a time slice. */ - tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, DEMO_STACK_SIZE, 16, 16, 4, TX_AUTO_START); /* Allocate the stack for thread 2. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, DEMO_STACK_SIZE, 16, 16, 4, TX_AUTO_START); /* Allocate the stack for thread 3. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - /* Create threads 3 and 4. These threads compete for a ThreadX counting semaphore. + /* Create threads 3 and 4. These threads compete for a ThreadX counting semaphore. An interesting thing here is that both threads share the same instruction area. */ - tx_thread_create(&thread_3, "thread 3", thread_3_and_4_entry, 3, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_3, "thread 3", thread_3_and_4_entry, 3, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 4. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - tx_thread_create(&thread_4, "thread 4", thread_3_and_4_entry, 4, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_4, "thread 4", thread_3_and_4_entry, 4, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 5. */ @@ -123,23 +123,23 @@ CHAR *pointer = TX_NULL; /* Create thread 5. This thread simply pends on an event flag which will be set by thread_0. */ - tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, + pointer, DEMO_STACK_SIZE, 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 6. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); /* Create threads 6 and 7. These threads compete for a ThreadX mutex. */ - tx_thread_create(&thread_6, "thread 6", thread_6_and_7_entry, 6, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_6, "thread 6", thread_6_and_7_entry, 6, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 7. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - tx_thread_create(&thread_7, "thread 7", thread_6_and_7_entry, 7, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_7, "thread 7", thread_6_and_7_entry, 7, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the message queue. */ @@ -242,11 +242,11 @@ UINT status; /* Retrieve a message from the queue. */ status = tx_queue_receive(&queue_0, &received_message, TX_WAIT_FOREVER); - /* Check completion status and make sure the message is what we + /* Check completion status and make sure the message is what we expected. */ if ((status != TX_SUCCESS) || (received_message != thread_2_messages_received)) break; - + /* Otherwise, all is okay. Increment the received message count. */ thread_2_messages_received++; } @@ -305,7 +305,7 @@ ULONG actual_flags; thread_5_counter++; /* Wait for event flag 0. */ - status = tx_event_flags_get(&event_flags_0, 0x1, TX_OR_CLEAR, + status = tx_event_flags_get(&event_flags_0, 0x1, TX_OR_CLEAR, &actual_flags, TX_WAIT_FOREVER); /* Check status. */ @@ -358,7 +358,7 @@ UINT status; if (status != TX_SUCCESS) break; - /* Release the mutex again. This will actually + /* Release the mutex again. This will actually release ownership since it was obtained twice. */ status = tx_mutex_put(&mutex_0); diff --git a/ports/cortex_a15/gnu/example_build/tx_initialize_low_level.S b/ports/cortex_a15/gnu/example_build/tx_initialize_low_level.S index bf53179c..7de5d3ce 100644 --- a/ports/cortex_a15/gnu/example_build/tx_initialize_low_level.S +++ b/ports/cortex_a15/gnu/example_build/tx_initialize_low_level.S @@ -1,47 +1,35 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Initialize */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_initialize.h" -@#include "tx_thread.h" -@#include "tx_timer.h" +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Initialize */ +/** */ +/**************************************************************************/ +/**************************************************************************/ .arm -SVC_MODE = 0xD3 @ Disable IRQ/FIQ SVC mode -IRQ_MODE = 0xD2 @ Disable IRQ/FIQ IRQ mode -FIQ_MODE = 0xD1 @ Disable IRQ/FIQ FIQ mode -SYS_MODE = 0xDF @ Disable IRQ/FIQ SYS mode -FIQ_STACK_SIZE = 512 @ FIQ stack size -IRQ_STACK_SIZE = 1024 @ IRQ stack size -SYS_STACK_SIZE = 1024 @ System stack size -@ -@ +SVC_MODE = 0xD3 // Disable IRQ/FIQ SVC mode +IRQ_MODE = 0xD2 // Disable IRQ/FIQ IRQ mode +FIQ_MODE = 0xD1 // Disable IRQ/FIQ FIQ mode +SYS_MODE = 0xDF // Disable IRQ/FIQ SYS mode +FIQ_STACK_SIZE = 512 // FIQ stack size +IRQ_STACK_SIZE = 1024 // IRQ stack size +SYS_STACK_SIZE = 1024 // System stack size + .global _tx_thread_system_stack_ptr .global _tx_initialize_unused_memory .global _tx_thread_context_save @@ -51,297 +39,267 @@ SYS_STACK_SIZE = 1024 @ System stack size .global _sp .global _stack_bottom -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_initialize_low_level for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + +/* Define the 16-bit Thumb mode veneer for _tx_initialize_low_level for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .thumb .global $_tx_initialize_low_level .type $_tx_initialize_low_level,function $_tx_initialize_low_level: - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_initialize_low_level @ Call _tx_initialize_low_level function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_initialize_low_level // Call _tx_initialize_low_level function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_initialize_low_level Cortex-A15/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is responsible for any low-level processor */ -@/* initialization, including setting up interrupt vectors, setting */ -@/* up a periodic timer interrupt source, saving the system stack */ -@/* pointer for use in ISR processing later, and finding the first */ -@/* available RAM memory address for tx_application_define. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* _tx_initialize_kernel_enter ThreadX entry function */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_initialize_low_level(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_initialize_low_level ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for any low-level processor */ +/* initialization, including setting up interrupt vectors, setting */ +/* up a periodic timer interrupt source, saving the system stack */ +/* pointer for use in ISR processing later, and finding the first */ +/* available RAM memory address for tx_application_define. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_initialize_kernel_enter ThreadX entry function */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_initialize_low_level .type _tx_initialize_low_level,function _tx_initialize_low_level: -@ -@ /* We must be in SVC mode at this point! */ -@ -@ /* Setup various stack pointers. */ -@ - LDR r1, =_sp @ Get pointer to stack area -#ifdef TX_ENABLE_IRQ_NESTING -@ -@ /* Setup the system mode stack for nested interrupt support */ -@ - LDR r2, =SYS_STACK_SIZE @ Pickup stack size - MOV r3, #SYS_MODE @ Build SYS mode CPSR - MSR CPSR_c, r3 @ Enter SYS mode - SUB r1, r1, #1 @ Backup 1 byte - BIC r1, r1, #7 @ Ensure 8-byte alignment - MOV sp, r1 @ Setup SYS stack pointer - SUB r1, r1, r2 @ Calculate start of next stack + /* We must be in SVC mode at this point! */ + + /* Setup various stack pointers. */ + + LDR r1, =_sp // Get pointer to stack area + +#ifdef TX_ENABLE_IRQ_NESTING + + /* Setup the system mode stack for nested interrupt support */ + + LDR r2, =SYS_STACK_SIZE // Pickup stack size + MOV r3, #SYS_MODE // Build SYS mode CPSR + MSR CPSR_c, r3 // Enter SYS mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup SYS stack pointer + SUB r1, r1, r2 // Calculate start of next stack #endif - LDR r2, =FIQ_STACK_SIZE @ Pickup stack size - MOV r0, #FIQ_MODE @ Build FIQ mode CPSR - MSR CPSR, r0 @ Enter FIQ mode - SUB r1, r1, #1 @ Backup 1 byte - BIC r1, r1, #7 @ Ensure 8-byte alignment - MOV sp, r1 @ Setup FIQ stack pointer - SUB r1, r1, r2 @ Calculate start of next stack - LDR r2, =IRQ_STACK_SIZE @ Pickup IRQ stack size - MOV r0, #IRQ_MODE @ Build IRQ mode CPSR - MSR CPSR, r0 @ Enter IRQ mode - SUB r1, r1, #1 @ Backup 1 byte - BIC r1, r1, #7 @ Ensure 8-byte alignment - MOV sp, r1 @ Setup IRQ stack pointer - SUB r3, r1, r2 @ Calculate end of IRQ stack - MOV r0, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR, r0 @ Enter SVC mode - LDR r2, =_stack_bottom @ Pickup stack bottom - CMP r3, r2 @ Compare the current stack end with the bottom -_stack_error_loop: - BLT _stack_error_loop @ If the IRQ stack exceeds the stack bottom, just sit here! -@ -@ /* Save the system stack pointer. */ -@ _tx_thread_system_stack_ptr = (VOID_PTR) (sp); -@ - LDR r2, =_tx_thread_system_stack_ptr @ Pickup stack pointer - STR r1, [r2] @ Save the system stack -@ -@ /* Save the first available memory address. */ -@ _tx_initialize_unused_memory = (VOID_PTR) _end; -@ - LDR r1, =_end @ Get end of non-initialized RAM area - LDR r2, =_tx_initialize_unused_memory @ Pickup unused memory ptr address - ADD r1, r1, #8 @ Increment to next free word - STR r1, [r2] @ Save first free memory address -@ -@ /* Setup Timer for periodic interrupts. */ -@ -@ /* Done, return to caller. */ -@ + LDR r2, =FIQ_STACK_SIZE // Pickup stack size + MOV r0, #FIQ_MODE // Build FIQ mode CPSR + MSR CPSR, r0 // Enter FIQ mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup FIQ stack pointer + SUB r1, r1, r2 // Calculate start of next stack + LDR r2, =IRQ_STACK_SIZE // Pickup IRQ stack size + MOV r0, #IRQ_MODE // Build IRQ mode CPSR + MSR CPSR, r0 // Enter IRQ mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup IRQ stack pointer + SUB r3, r1, r2 // Calculate end of IRQ stack + MOV r0, #SVC_MODE // Build SVC mode CPSR + MSR CPSR, r0 // Enter SVC mode + LDR r2, =_stack_bottom // Pickup stack bottom + CMP r3, r2 // Compare the current stack end with the bottom +_stack_error_loop: + BLT _stack_error_loop // If the IRQ stack exceeds the stack bottom, just sit here! + + LDR r2, =_tx_thread_system_stack_ptr // Pickup stack pointer + STR r1, [r2] // Save the system stack + + LDR r1, =_end // Get end of non-initialized RAM area + LDR r2, =_tx_initialize_unused_memory // Pickup unused memory ptr address + ADD r1, r1, #8 // Increment to next free word + STR r1, [r2] // Save first free memory address + #ifdef __THUMB_INTERWORK - BX lr @ Return to caller + BX lr // Return to caller #else - MOV pc, lr @ Return to caller + MOV pc, lr // Return to caller #endif -@} -@ -@ -@/* Define shells for each of the interrupt vectors. */ -@ + +/* Define shells for each of the interrupt vectors. */ + .global __tx_undefined __tx_undefined: - B __tx_undefined @ Undefined handler -@ + B __tx_undefined // Undefined handler + .global __tx_swi_interrupt __tx_swi_interrupt: - B __tx_swi_interrupt @ Software interrupt handler -@ + B __tx_swi_interrupt // Software interrupt handler + .global __tx_prefetch_handler __tx_prefetch_handler: - B __tx_prefetch_handler @ Prefetch exception handler -@ + B __tx_prefetch_handler // Prefetch exception handler + .global __tx_abort_handler __tx_abort_handler: - B __tx_abort_handler @ Abort exception handler -@ + B __tx_abort_handler // Abort exception handler + .global __tx_reserved_handler __tx_reserved_handler: - B __tx_reserved_handler @ Reserved exception handler -@ + B __tx_reserved_handler // Reserved exception handler + .global __tx_irq_handler - .global __tx_irq_processing_return + .global __tx_irq_processing_return __tx_irq_handler: -@ -@ /* Jump to context save to save system context. */ + + /* Jump to context save to save system context. */ B _tx_thread_context_save __tx_irq_processing_return: -@ -@ /* At this point execution is still in the IRQ mode. The CPSR, point of -@ interrupt, and all C scratch registers are available for use. In -@ addition, IRQ interrupts may be re-enabled - with certain restrictions - -@ if nested IRQ interrupts are desired. Interrupts may be re-enabled over -@ small code sequences where lr is saved before enabling interrupts and -@ restored after interrupts are again disabled. */ -@ -@ /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start -@ from IRQ mode with interrupts disabled. This routine switches to the -@ system mode and returns with IRQ interrupts enabled. -@ -@ NOTE: It is very important to ensure all IRQ interrupts are cleared -@ prior to enabling nested IRQ interrupts. */ +// + /* At this point execution is still in the IRQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. In + addition, IRQ interrupts may be re-enabled - with certain restrictions - + if nested IRQ interrupts are desired. Interrupts may be re-enabled over + small code sequences where lr is saved before enabling interrupts and + restored after interrupts are again disabled. */ + + /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start + from IRQ mode with interrupts disabled. This routine switches to the + system mode and returns with IRQ interrupts enabled. + + NOTE: It is very important to ensure all IRQ interrupts are cleared + prior to enabling nested IRQ interrupts. */ #ifdef TX_ENABLE_IRQ_NESTING BL _tx_thread_irq_nesting_start #endif -@ -@ /* For debug purpose, execute the timer interrupt processing here. In -@ a real system, some kind of status indication would have to be checked -@ before the timer interrupt handler could be called. */ -@ - BL _tx_timer_interrupt @ Timer interrupt handler -@ -@ -@ /* If interrupt nesting was started earlier, the end of interrupt nesting -@ service must be called before returning to _tx_thread_context_restore. -@ This routine returns in processing in IRQ mode with interrupts disabled. */ + + /* For debug purpose, execute the timer interrupt processing here. In + a real system, some kind of status indication would have to be checked + before the timer interrupt handler could be called. */ + + BL _tx_timer_interrupt // Timer interrupt handler + + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_context_restore. + This routine returns in processing in IRQ mode with interrupts disabled. */ #ifdef TX_ENABLE_IRQ_NESTING BL _tx_thread_irq_nesting_end #endif -@ -@ /* Jump to context restore to restore system context. */ + + /* Jump to context restore to restore system context. */ B _tx_thread_context_restore -@ -@ -@ /* This is an example of a vectored IRQ handler. */ -@ -@ .global __tx_example_vectored_irq_handler -@__tx_example_vectored_irq_handler: -@ -@ -@ /* Save initial context and call context save to prepare for -@ vectored ISR execution. */ -@ -@ STMDB sp!, {r0-r3} @ Save some scratch registers -@ MRS r0, SPSR @ Pickup saved SPSR -@ SUB lr, lr, #4 @ Adjust point of interrupt -@ STMDB sp!, {r0, r10, r12, lr} @ Store other scratch registers -@ BL _tx_thread_vectored_context_save @ Vectored context save -@ -@ /* At this point execution is still in the IRQ mode. The CPSR, point of -@ interrupt, and all C scratch registers are available for use. In -@ addition, IRQ interrupts may be re-enabled - with certain restrictions - -@ if nested IRQ interrupts are desired. Interrupts may be re-enabled over -@ small code sequences where lr is saved before enabling interrupts and -@ restored after interrupts are again disabled. */ -@ -@ -@ /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start -@ from IRQ mode with interrupts disabled. This routine switches to the -@ system mode and returns with IRQ interrupts enabled. -@ -@ NOTE: It is very important to ensure all IRQ interrupts are cleared -@ prior to enabling nested IRQ interrupts. */ -@#ifdef TX_ENABLE_IRQ_NESTING -@ BL _tx_thread_irq_nesting_start -@#endif -@ -@ /* Application IRQ handlers can be called here! */ -@ -@ /* If interrupt nesting was started earlier, the end of interrupt nesting -@ service must be called before returning to _tx_thread_context_restore. -@ This routine returns in processing in IRQ mode with interrupts disabled. */ -@#ifdef TX_ENABLE_IRQ_NESTING -@ BL _tx_thread_irq_nesting_end -@#endif -@ -@ /* Jump to context restore to restore system context. */ -@ B _tx_thread_context_restore -@ -@ + + + /* This is an example of a vectored IRQ handler. */ + + + + /* Save initial context and call context save to prepare for + vectored ISR execution. */ + + /* At this point execution is still in the IRQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. In + addition, IRQ interrupts may be re-enabled - with certain restrictions - + if nested IRQ interrupts are desired. Interrupts may be re-enabled over + small code sequences where lr is saved before enabling interrupts and + restored after interrupts are again disabled. */ + + + /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start + from IRQ mode with interrupts disabled. This routine switches to the + system mode and returns with IRQ interrupts enabled. + + NOTE: It is very important to ensure all IRQ interrupts are cleared + prior to enabling nested IRQ interrupts. */ + + /* Application IRQ handlers can be called here! */ + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_context_restore. + This routine returns in processing in IRQ mode with interrupts disabled. */ + + + #ifdef TX_ENABLE_FIQ_SUPPORT .global __tx_fiq_handler .global __tx_fiq_processing_return __tx_fiq_handler: -@ -@ /* Jump to fiq context save to save system context. */ + + /* Jump to fiq context save to save system context. */ B _tx_thread_fiq_context_save __tx_fiq_processing_return: -@ -@ /* At this point execution is still in the FIQ mode. The CPSR, point of -@ interrupt, and all C scratch registers are available for use. */ -@ -@ /* Interrupt nesting is allowed after calling _tx_thread_fiq_nesting_start -@ from FIQ mode with interrupts disabled. This routine switches to the -@ system mode and returns with FIQ interrupts enabled. -@ -@ NOTE: It is very important to ensure all FIQ interrupts are cleared -@ prior to enabling nested FIQ interrupts. */ + + /* At this point execution is still in the FIQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. */ + + /* Interrupt nesting is allowed after calling _tx_thread_fiq_nesting_start + from FIQ mode with interrupts disabled. This routine switches to the + system mode and returns with FIQ interrupts enabled. + + NOTE: It is very important to ensure all FIQ interrupts are cleared + prior to enabling nested FIQ interrupts. */ #ifdef TX_ENABLE_FIQ_NESTING BL _tx_thread_fiq_nesting_start #endif -@ -@ /* Application FIQ handlers can be called here! */ -@ -@ /* If interrupt nesting was started earlier, the end of interrupt nesting -@ service must be called before returning to _tx_thread_fiq_context_restore. */ + + /* Application FIQ handlers can be called here! */ + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_fiq_context_restore. */ #ifdef TX_ENABLE_FIQ_NESTING BL _tx_thread_fiq_nesting_end #endif -@ -@ /* Jump to fiq context restore to restore system context. */ + + /* Jump to fiq context restore to restore system context. */ B _tx_thread_fiq_context_restore -@ -@ + + #else .global __tx_fiq_handler __tx_fiq_handler: - B __tx_fiq_handler @ FIQ interrupt handler + B __tx_fiq_handler // FIQ interrupt handler #endif -@ -@ + + BUILD_OPTIONS: - .word _tx_build_options @ Reference to bring in + .word _tx_build_options // Reference to bring in VERSION_ID: - .word _tx_version_id @ Reference to bring in + .word _tx_version_id // Reference to bring in diff --git a/ports/cortex_a15/gnu/inc/tx_port.h b/ports/cortex_a15/gnu/inc/tx_port.h index edd17889..19463de1 100644 --- a/ports/cortex_a15/gnu/inc/tx_port.h +++ b/ports/cortex_a15/gnu/inc/tx_port.h @@ -12,7 +12,7 @@ /**************************************************************************/ /**************************************************************************/ -/** */ +/** */ /** ThreadX Component */ /** */ /** Port Specific */ @@ -21,36 +21,38 @@ /**************************************************************************/ -/**************************************************************************/ -/* */ -/* PORT SPECIFIC C INFORMATION RELEASE */ -/* */ -/* tx_port.h Cortex-A15/GNU */ -/* 6.1.6 */ +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* tx_port.h ARMv7-A */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ /* */ /* DESCRIPTION */ -/* */ -/* This file contains data type definitions that make the ThreadX */ -/* real-time kernel function identically on a variety of different */ -/* processor architectures. For example, the size or number of bits */ -/* in an "int" data type vary between microprocessor architectures and */ -/* even C compilers for the same microprocessor. ThreadX does not */ -/* directly use native C data types. Instead, ThreadX creates its */ -/* own special types that can be mapped to actual data types by this */ -/* file to guarantee consistency in the interface and functionality. */ -/* */ -/* RELEASE HISTORY */ -/* */ +/* */ +/* This file contains data type definitions that make the ThreadX */ +/* real-time kernel function identically on a variety of different */ +/* processor architectures. For example, the size or number of bits */ +/* in an "int" data type vary between microprocessor architectures and */ +/* even C compilers for the same microprocessor. ThreadX does not */ +/* directly use native C data types. Instead, ThreadX creates its */ +/* own special types that can be mapped to actual data types by this */ +/* file to guarantee consistency in the interface and functionality. */ +/* */ +/* RELEASE HISTORY */ +/* */ /* DATE NAME DESCRIPTION */ /* */ /* 09-30-2020 William E. Lamie Initial Version 6.1 */ /* 04-02-2021 Bhupendra Naphade Modified comment(s),updated */ /* macro definition, */ /* resulting in version 6.1.6 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -63,7 +65,7 @@ #ifdef TX_INCLUDE_USER_DEFINE_FILE -/* Yes, include the user defines in tx_user.h. The defines in this file may +/* Yes, include the user defines in tx_user.h. The defines in this file may alternately be defined on the command line. */ #include "tx_user.h" @@ -76,7 +78,7 @@ #include -/* Define ThreadX basic types for this port. */ +/* Define ThreadX basic types for this port. */ #define VOID void typedef char CHAR; @@ -112,12 +114,12 @@ typedef unsigned short USHORT; #define TX_TIMER_THREAD_STACK_SIZE 1024 /* Default timer thread stack size */ #endif -#ifndef TX_TIMER_THREAD_PRIORITY -#define TX_TIMER_THREAD_PRIORITY 0 /* Default timer thread priority */ +#ifndef TX_TIMER_THREAD_PRIORITY +#define TX_TIMER_THREAD_PRIORITY 0 /* Default timer thread priority */ #endif -/* Define various constants for the ThreadX ARM port. */ +/* Define various constants for the ThreadX ARM port. */ #ifdef TX_ENABLE_FIQ_SUPPORT #define TX_INT_DISABLE 0xC0 /* Disable IRQ & FIQ interrupts */ @@ -127,8 +129,8 @@ typedef unsigned short USHORT; #define TX_INT_ENABLE 0x00 /* Enable IRQ interrupts */ -/* Define the clock source for trace event entry time stamp. The following two item are port specific. - For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock +/* Define the clock source for trace event entry time stamp. The following two item are port specific. + For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: #define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) @@ -175,7 +177,7 @@ typedef unsigned short USHORT; #define TX_INLINE_INITIALIZATION -/* Determine whether or not stack checking is enabled. By default, ThreadX stack checking is +/* Determine whether or not stack checking is enabled. By default, ThreadX stack checking is disabled. When the following is defined, ThreadX thread stack checking is enabled. If stack checking is enabled (TX_ENABLE_STACK_CHECKING is defined), the TX_DISABLE_STACK_FILLING define is negated, thereby forcing the stack fill which is necessary for the stack checking @@ -187,13 +189,13 @@ typedef unsigned short USHORT; /* Define the TX_THREAD control block extensions for this port. The main reason - for the multiple macros is so that backward compatibility can be maintained with + for the multiple macros is so that backward compatibility can be maintained with existing ThreadX kernel awareness modules. */ -#define TX_THREAD_EXTENSION_0 -#define TX_THREAD_EXTENSION_1 +#define TX_THREAD_EXTENSION_0 +#define TX_THREAD_EXTENSION_1 #define TX_THREAD_EXTENSION_2 ULONG tx_thread_vfp_enable; -#define TX_THREAD_EXTENSION_3 +#define TX_THREAD_EXTENSION_3 /* Define the port extensions of the remaining ThreadX objects. */ @@ -207,11 +209,11 @@ typedef unsigned short USHORT; #define TX_TIMER_EXTENSION -/* Define the user extension field of the thread control block. Nothing +/* Define the user extension field of the thread control block. Nothing additional is needed for this port so it is defined as white space. */ #ifndef TX_THREAD_USER_EXTENSION -#define TX_THREAD_USER_EXTENSION +#define TX_THREAD_USER_EXTENSION #endif @@ -219,8 +221,8 @@ typedef unsigned short USHORT; tx_thread_shell_entry, and tx_thread_terminate. */ -#define TX_THREAD_CREATE_EXTENSION(thread_ptr) -#define TX_THREAD_DELETE_EXTENSION(thread_ptr) +#define TX_THREAD_CREATE_EXTENSION(thread_ptr) +#define TX_THREAD_DELETE_EXTENSION(thread_ptr) #define TX_THREAD_COMPLETED_EXTENSION(thread_ptr) #define TX_THREAD_TERMINATED_EXTENSION(thread_ptr) @@ -247,24 +249,24 @@ typedef unsigned short USHORT; #define TX_TIMER_DELETE_EXTENSION(timer_ptr) -/* Determine if the ARM architecture has the CLZ instruction. This is available on - architectures v5 and above. If available, redefine the macro for calculating the +/* Determine if the ARM architecture has the CLZ instruction. This is available on + architectures v5 and above. If available, redefine the macro for calculating the lowest bit set. */ - + #if __TARGET_ARCH_ARM > 4 #ifndef __thumb__ #define TX_LOWEST_SET_BIT_CALCULATE(m, b) m = m & ((ULONG) (-((LONG) m))); \ asm volatile (" CLZ %0,%1 ": "=r" (b) : "r" (m) ); \ - b = 31 - b; + b = 31 - b; #endif #endif -/* Define ThreadX interrupt lockout and restore macros for protection on - access of critical kernel information. The restore interrupt macro must - restore the interrupt posture of the running thread prior to the value +/* Define ThreadX interrupt lockout and restore macros for protection on + access of critical kernel information. The restore interrupt macro must + restore the interrupt posture of the running thread prior to the value present prior to the disable macro. In most cases, the save area macro is used to define a local function save area for the disable and restore macros. */ @@ -295,7 +297,7 @@ unsigned int _tx_thread_interrupt_restore(UINT old_posture); #endif -/* Define VFP extension for the Cortex-A15. Each is assumed to be called in the context of the executing +/* Define VFP extension for the ARMv7-A. Each is assumed to be called in the context of the executing thread. */ void tx_thread_vfp_enable(void); @@ -315,8 +317,8 @@ void tx_thread_vfp_disable(void); /* Define the version ID of ThreadX. This may be utilized by the application. */ #ifdef TX_THREAD_INIT -CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-A15/GNU Version 6.1.9 *"; +CHAR _tx_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX ARMv7-A Version 6.1.11 *"; #else extern CHAR _tx_version_id[]; #endif diff --git a/ports/cortex_a15/gnu/src/tx_thread_context_restore.S b/ports/cortex_a15/gnu/src/tx_thread_context_restore.S index 3bf26a20..fae7e72d 100644 --- a/ports/cortex_a15/gnu/src/tx_thread_context_restore.S +++ b/ports/cortex_a15/gnu/src/tx_thread_context_restore.S @@ -1,260 +1,222 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .arm #ifdef TX_ENABLE_FIQ_SUPPORT -SVC_MODE = 0xD3 @ Disable IRQ/FIQ, SVC mode -IRQ_MODE = 0xD2 @ Disable IRQ/FIQ, IRQ mode +SVC_MODE = 0xD3 // Disable IRQ/FIQ, SVC mode +IRQ_MODE = 0xD2 // Disable IRQ/FIQ, IRQ mode #else -SVC_MODE = 0x93 @ Disable IRQ, SVC mode -IRQ_MODE = 0x92 @ Disable IRQ, IRQ mode +SVC_MODE = 0x93 // Disable IRQ, SVC mode +IRQ_MODE = 0x92 // Disable IRQ, IRQ mode #endif -@ + .global _tx_thread_system_state .global _tx_thread_current_ptr .global _tx_thread_execute_ptr .global _tx_timer_time_slice .global _tx_thread_schedule .global _tx_thread_preempt_disable - .global _tx_execution_isr_exit -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_restore -@ since it will never be called 16-bit mode. */ -@ + + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_restore + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_context_restore Cortex-A15/GNU */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function restores the interrupt context if it is processing a */ -@/* nested interrupt. If not, it returns to the interrupt thread if no */ -@/* preemption is necessary. Otherwise, if preemption is necessary or */ -@/* if no thread was running, the function returns to the scheduler. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* _tx_thread_schedule Thread scheduling routine */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs Interrupt Service Routines */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_context_restore(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_context_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function restores the interrupt context if it is processing a */ +/* nested interrupt. If not, it returns to the interrupt thread if no */ +/* preemption is necessary. Otherwise, if preemption is necessary or */ +/* if no thread was running, the function returns to the scheduler. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling routine */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs Interrupt Service Routines */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_context_restore .type _tx_thread_context_restore,function _tx_thread_context_restore: -@ -@ /* Lockout interrupts. */ -@ + + /* Lockout interrupts. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ interrupts + CPSID if // Disable IRQ and FIQ interrupts #else - CPSID i @ Disable IRQ interrupts + CPSID i // Disable IRQ interrupts #endif #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR exit function to indicate an ISR is complete. */ -@ - BL _tx_execution_isr_exit @ Call the ISR exit function -#endif -@ -@ /* Determine if interrupts are nested. */ -@ if (--_tx_thread_system_state) -@ { -@ - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3] @ Pickup system state - SUB r2, r2, #1 @ Decrement the counter - STR r2, [r3] @ Store the counter - CMP r2, #0 @ Was this the first interrupt? - BEQ __tx_thread_not_nested_restore @ If so, not a nested restore -@ -@ /* Interrupts are nested. */ -@ -@ /* Just recover the saved registers and return to the point of -@ interrupt. */ -@ - LDMIA sp!, {r0, r10, r12, lr} @ Recover SPSR, POI, and scratch regs - MSR SPSR_cxsf, r0 @ Put SPSR back - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOVS pc, lr @ Return to point of interrupt -@ -@ } -__tx_thread_not_nested_restore: -@ -@ /* Determine if a thread was interrupted and no preemption is required. */ -@ else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr) -@ || (_tx_thread_preempt_disable)) -@ { -@ - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup actual current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_idle_system_restore @ Yes, idle system was interrupted -@ - LDR r3, =_tx_thread_preempt_disable @ Pickup preempt disable address - LDR r2, [r3] @ Pickup actual preempt disable flag - CMP r2, #0 @ Is it set? - BNE __tx_thread_no_preempt_restore @ Yes, don't preempt this thread - LDR r3, =_tx_thread_execute_ptr @ Pickup address of execute thread ptr - LDR r2, [r3] @ Pickup actual execute thread pointer - CMP r0, r2 @ Is the same thread highest priority? - BNE __tx_thread_preempt_restore @ No, preemption needs to happen -@ -@ -__tx_thread_no_preempt_restore: -@ -@ /* Restore interrupted thread or ISR. */ -@ -@ /* Pickup the saved stack pointer. */ -@ tmp_ptr = _tx_thread_current_ptr -> tx_thread_stack_ptr; -@ -@ /* Recover the saved context and return to the point of interrupt. */ -@ - LDMIA sp!, {r0, r10, r12, lr} @ Recover SPSR, POI, and scratch regs - MSR SPSR_cxsf, r0 @ Put SPSR back - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOVS pc, lr @ Return to point of interrupt -@ -@ } -@ else -@ { -__tx_thread_preempt_restore: -@ - LDMIA sp!, {r3, r10, r12, lr} @ Recover temporarily saved registers - MOV r1, lr @ Save lr (point of interrupt) - MOV r2, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r2 @ Enter SVC mode - STR r1, [sp, #-4]! @ Save point of interrupt - STMDB sp!, {r4-r12, lr} @ Save upper half of registers - MOV r4, r3 @ Save SPSR in r4 - MOV r2, #IRQ_MODE @ Build IRQ mode CPSR - MSR CPSR_c, r2 @ Enter IRQ mode - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOV r5, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r5 @ Enter SVC mode - STMDB sp!, {r0-r3} @ Save r0-r3 on thread's stack - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup current thread pointer + /* Call the ISR exit function to indicate an ISR is complete. */ + + BL _tx_execution_isr_exit // Call the ISR exit function +#endif + + /* Determine if interrupts are nested. */ + + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + SUB r2, r2, #1 // Decrement the counter + STR r2, [r3] // Store the counter + CMP r2, #0 // Was this the first interrupt? + BEQ __tx_thread_not_nested_restore // If so, not a nested restore + + /* Interrupts are nested. */ + + /* Just recover the saved registers and return to the point of + interrupt. */ + + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_not_nested_restore: + + /* Determine if a thread was interrupted and no preemption is required. */ + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup actual current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_restore // Yes, idle system was interrupted + + LDR r3, =_tx_thread_preempt_disable // Pickup preempt disable address + LDR r2, [r3] // Pickup actual preempt disable flag + CMP r2, #0 // Is it set? + BNE __tx_thread_no_preempt_restore // Yes, don't preempt this thread + LDR r3, =_tx_thread_execute_ptr // Pickup address of execute thread ptr + LDR r2, [r3] // Pickup actual execute thread pointer + CMP r0, r2 // Is the same thread highest priority? + BNE __tx_thread_preempt_restore // No, preemption needs to happen + + +__tx_thread_no_preempt_restore: + + /* Recover the saved context and return to the point of interrupt. */ + + /* Pickup the saved stack pointer. */ + + /* Recover the saved context and return to the point of interrupt. */ + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_preempt_restore: + + LDMIA sp!, {r3, r10, r12, lr} // Recover temporarily saved registers + MOV r1, lr // Save lr (point of interrupt) + MOV r2, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r2 // Enter SVC mode + STR r1, [sp, #-4]! // Save point of interrupt + STMDB sp!, {r4-r12, lr} // Save upper half of registers + MOV r4, r3 // Save SPSR in r4 + MOV r2, #IRQ_MODE // Build IRQ mode CPSR + MSR CPSR_c, r2 // Enter IRQ mode + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOV r5, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r5 // Enter SVC mode + STMDB sp!, {r0-r3} // Save r0-r3 on thread's stack + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer #ifdef TX_ENABLE_VFP_SUPPORT - LDR r2, [r0, #144] @ Pickup the VFP enabled flag - CMP r2, #0 @ Is the VFP enabled? - BEQ _tx_skip_irq_vfp_save @ No, skip VFP IRQ save - VMRS r2, FPSCR @ Pickup the FPSCR - STR r2, [sp, #-4]! @ Save FPSCR - VSTMDB sp!, {D16-D31} @ Save D16-D31 - VSTMDB sp!, {D0-D15} @ Save D0-D15 + LDR r2, [r0, #144] // Pickup the VFP enabled flag + CMP r2, #0 // Is the VFP enabled? + BEQ _tx_skip_irq_vfp_save // No, skip VFP IRQ save + VMRS r2, FPSCR // Pickup the FPSCR + STR r2, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D0-D15} // Save D0-D15 + _tx_skip_irq_vfp_save: + #endif - MOV r3, #1 @ Build interrupt stack type - STMDB sp!, {r3, r4} @ Save interrupt stack type and SPSR - STR sp, [r0, #8] @ Save stack pointer in thread control - @ block -@ -@ /* Save the remaining time-slice and disable it. */ -@ if (_tx_timer_time_slice) -@ { -@ - LDR r3, =_tx_timer_time_slice @ Pickup time-slice variable address - LDR r2, [r3] @ Pickup time-slice - CMP r2, #0 @ Is it active? - BEQ __tx_thread_dont_save_ts @ No, don't save it -@ -@ _tx_thread_current_ptr -> tx_thread_time_slice = _tx_timer_time_slice; -@ _tx_timer_time_slice = 0; -@ - STR r2, [r0, #24] @ Save thread's time-slice - MOV r2, #0 @ Clear value - STR r2, [r3] @ Disable global time-slice flag -@ -@ } + MOV r3, #1 // Build interrupt stack type + STMDB sp!, {r3, r4} // Save interrupt stack type and SPSR + STR sp, [r0, #8] // Save stack pointer in thread control + // block + + /* Save the remaining time-slice and disable it. */ + LDR r3, =_tx_timer_time_slice // Pickup time-slice variable address + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it active? + BEQ __tx_thread_dont_save_ts // No, don't save it + STR r2, [r0, #24] // Save thread's time-slice + MOV r2, #0 // Clear value + STR r2, [r3] // Disable global time-slice flag + __tx_thread_dont_save_ts: -@ -@ -@ /* Clear the current task pointer. */ -@ _tx_thread_current_ptr = TX_NULL; -@ - MOV r0, #0 @ NULL value - STR r0, [r1] @ Clear current thread pointer -@ -@ /* Return to the scheduler. */ -@ _tx_thread_schedule(); -@ - B _tx_thread_schedule @ Return to scheduler -@ } -@ + + /* Clear the current task pointer. */ + MOV r0, #0 // NULL value + STR r0, [r1] // Clear current thread pointer + + /* Return to the scheduler. */ + B _tx_thread_schedule // Return to scheduler + __tx_thread_idle_system_restore: -@ -@ /* Just return back to the scheduler! */ -@ - MOV r0, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r0 @ Enter SVC mode - B _tx_thread_schedule @ Return to scheduler -@} - - + /* Just return back to the scheduler! */ + MOV r0, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r0 // Enter SVC mode + B _tx_thread_schedule // Return to scheduler diff --git a/ports/cortex_a15/gnu/src/tx_thread_context_save.S b/ports/cortex_a15/gnu/src/tx_thread_context_save.S index 6f75ade7..7ac48c2e 100644 --- a/ports/cortex_a15/gnu/src/tx_thread_context_save.S +++ b/ports/cortex_a15/gnu/src/tx_thread_context_save.S @@ -1,206 +1,172 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .global _tx_thread_system_state .global _tx_thread_current_ptr - .global _tx_irq_processing_return - .global _tx_execution_isr_enter -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_save -@ since it will never be called 16-bit mode. */ -@ + .global __tx_irq_processing_return + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_save + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_context_save Cortex-A15/GNU */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function saves the context of an executing thread in the */ -@/* beginning of interrupt processing. The function also ensures that */ -@/* the system stack is used upon return to the calling ISR. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_context_save(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_context_save .type _tx_thread_context_save,function _tx_thread_context_save: -@ -@ /* Upon entry to this routine, it is assumed that IRQ interrupts are locked -@ out, we are in IRQ mode, and all registers are intact. */ -@ -@ /* Check for a nested interrupt condition. */ -@ if (_tx_thread_system_state++) -@ { -@ - STMDB sp!, {r0-r3} @ Save some working registers + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + + STMDB sp!, {r0-r3} // Save some working registers #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable FIQ interrupts + CPSID if // Disable FIQ interrupts #endif - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3] @ Pickup system state - CMP r2, #0 @ Is this the first interrupt? - BEQ __tx_thread_not_nested_save @ Yes, not a nested context save -@ -@ /* Nested interrupt condition. */ -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3] @ Store it back in the variable -@ -@ /* Save the rest of the scratch registers on the stack and return to the -@ calling ISR. */ -@ - MRS r0, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r0, r10, r12, lr} @ Store other registers -@ -@ /* Return to the ISR. */ -@ - MOV r10, #0 @ Clear stack limit + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + + /* Save the rest of the scratch registers on the stack and return to the + calling ISR. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, r10, r12, lr} // Store other registers + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - B __tx_irq_processing_return @ Continue IRQ processing -@ + B __tx_irq_processing_return // Continue IRQ processing + __tx_thread_not_nested_save: -@ } -@ -@ /* Otherwise, not nested, check to see if a thread was running. */ -@ else if (_tx_thread_current_ptr) -@ { -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3] @ Store it back in the variable - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_idle_system_save @ If so, interrupt occurred in - @ scheduling loop - nothing needs saving! -@ -@ /* Save minimal context of interrupted thread. */ -@ - MRS r2, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r2, r10, r12, lr} @ Store other registers -@ -@ /* Save the current stack pointer in the thread's control block. */ -@ _tx_thread_current_ptr -> tx_thread_stack_ptr = sp; -@ -@ /* Switch to the system stack. */ -@ sp = _tx_thread_system_stack_ptr@ -@ - MOV r10, #0 @ Clear stack limit + + /* Otherwise, not nested, check to see if a thread was running. */ + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + + /* Save minimal context of interrupted thread. */ + + MRS r2, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r2, r10, r12, lr} // Store other registers + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - B __tx_irq_processing_return @ Continue IRQ processing -@ -@ } -@ else -@ { -@ + B __tx_irq_processing_return // Continue IRQ processing + __tx_thread_idle_system_save: -@ -@ /* Interrupt occurred in the scheduling loop. */ -@ -@ /* Not much to do here, just adjust the stack pointer, and return to IRQ -@ processing. */ -@ - MOV r10, #0 @ Clear stack limit + + /* Interrupt occurred in the scheduling loop. */ + + /* Not much to do here, just adjust the stack pointer, and return to IRQ + processing. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - ADD sp, sp, #16 @ Recover saved registers - B __tx_irq_processing_return @ Continue IRQ processing -@ -@ } -@} - - - + ADD sp, sp, #16 // Recover saved registers + B __tx_irq_processing_return // Continue IRQ processing diff --git a/ports/cortex_a15/gnu/src/tx_thread_fiq_context_restore.S b/ports/cortex_a15/gnu/src/tx_thread_fiq_context_restore.S index 945d720a..006be973 100644 --- a/ports/cortex_a15/gnu/src/tx_thread_fiq_context_restore.S +++ b/ports/cortex_a15/gnu/src/tx_thread_fiq_context_restore.S @@ -1,43 +1,32 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ -@ -SVC_MODE = 0xD3 @ SVC mode -FIQ_MODE = 0xD1 @ FIQ mode -MODE_MASK = 0x1F @ Mode mask -THUMB_MASK = 0x20 @ Thumb bit mask -IRQ_MODE_BITS = 0x12 @ IRQ mode bits -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +SVC_MODE = 0xD3 // SVC mode +FIQ_MODE = 0xD1 // FIQ mode +MODE_MASK = 0x1F // Mode mask +THUMB_MASK = 0x20 // Thumb bit mask +IRQ_MODE_BITS = 0x12 // IRQ mode bits + + .global _tx_thread_system_state .global _tx_thread_current_ptr .global _tx_thread_system_stack_ptr @@ -46,218 +35,189 @@ IRQ_MODE_BITS = 0x12 @ IRQ mode bits .global _tx_thread_schedule .global _tx_thread_preempt_disable .global _tx_execution_isr_exit -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_restore -@ since it will never be called 16-bit mode. */ -@ + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_restore + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_fiq_context_restore Cortex-A15/GNU */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function restores the fiq interrupt context when processing a */ -@/* nested interrupt. If not, it returns to the interrupt thread if no */ -@/* preemption is necessary. Otherwise, if preemption is necessary or */ -@/* if no thread was running, the function returns to the scheduler. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* _tx_thread_schedule Thread scheduling routine */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* FIQ ISR Interrupt Service Routines */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_fiq_context_restore(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_context_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function restores the fiq interrupt context when processing a */ +/* nested interrupt. If not, it returns to the interrupt thread if no */ +/* preemption is necessary. Otherwise, if preemption is necessary or */ +/* if no thread was running, the function returns to the scheduler. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling routine */ +/* */ +/* CALLED BY */ +/* */ +/* FIQ ISR Interrupt Service Routines */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_fiq_context_restore .type _tx_thread_fiq_context_restore,function _tx_thread_fiq_context_restore: -@ -@ /* Lockout interrupts. */ -@ - CPSID if @ Disable IRQ and FIQ interrupts + + /* Lockout interrupts. */ + + CPSID if // Disable IRQ and FIQ interrupts #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR exit function to indicate an ISR is complete. */ -@ - BL _tx_execution_isr_exit @ Call the ISR exit function + + /* Call the ISR exit function to indicate an ISR is complete. */ + + BL _tx_execution_isr_exit // Call the ISR exit function #endif -@ -@ /* Determine if interrupts are nested. */ -@ if (--_tx_thread_system_state) -@ { -@ - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3] @ Pickup system state - SUB r2, r2, #1 @ Decrement the counter - STR r2, [r3] @ Store the counter - CMP r2, #0 @ Was this the first interrupt? - BEQ __tx_thread_fiq_not_nested_restore @ If so, not a nested restore -@ -@ /* Interrupts are nested. */ -@ -@ /* Just recover the saved registers and return to the point of -@ interrupt. */ -@ - LDMIA sp!, {r0, r10, r12, lr} @ Recover SPSR, POI, and scratch regs - MSR SPSR_cxsf, r0 @ Put SPSR back - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOVS pc, lr @ Return to point of interrupt -@ -@ } + + /* Determine if interrupts are nested. */ + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + SUB r2, r2, #1 // Decrement the counter + STR r2, [r3] // Store the counter + CMP r2, #0 // Was this the first interrupt? + BEQ __tx_thread_fiq_not_nested_restore // If so, not a nested restore + + /* Interrupts are nested. */ + + /* Just recover the saved registers and return to the point of + interrupt. */ + + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + __tx_thread_fiq_not_nested_restore: -@ -@ /* Determine if a thread was interrupted and no preemption is required. */ -@ else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr) -@ || (_tx_thread_preempt_disable)) -@ { -@ - LDR r1, [sp] @ Pickup the saved SPSR - MOV r2, #MODE_MASK @ Build mask to isolate the interrupted mode - AND r1, r1, r2 @ Isolate mode bits - CMP r1, #IRQ_MODE_BITS @ Was an interrupt taken in IRQ mode before we - @ got to context save? */ - BEQ __tx_thread_fiq_no_preempt_restore @ Yes, just go back to point of interrupt + + /* Determine if a thread was interrupted and no preemption is required. */ + + LDR r1, [sp] // Pickup the saved SPSR + MOV r2, #MODE_MASK // Build mask to isolate the interrupted mode + AND r1, r1, r2 // Isolate mode bits + CMP r1, #IRQ_MODE_BITS // Was an interrupt taken in IRQ mode before we + // got to context save? */ + BEQ __tx_thread_fiq_no_preempt_restore // Yes, just go back to point of interrupt - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup actual current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_fiq_idle_system_restore @ Yes, idle system was interrupted + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup actual current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_fiq_idle_system_restore // Yes, idle system was interrupted - LDR r3, =_tx_thread_preempt_disable @ Pickup preempt disable address - LDR r2, [r3] @ Pickup actual preempt disable flag - CMP r2, #0 @ Is it set? - BNE __tx_thread_fiq_no_preempt_restore @ Yes, don't preempt this thread - LDR r3, =_tx_thread_execute_ptr @ Pickup address of execute thread ptr - LDR r2, [r3] @ Pickup actual execute thread pointer - CMP r0, r2 @ Is the same thread highest priority? - BNE __tx_thread_fiq_preempt_restore @ No, preemption needs to happen + LDR r3, =_tx_thread_preempt_disable // Pickup preempt disable address + LDR r2, [r3] // Pickup actual preempt disable flag + CMP r2, #0 // Is it set? + BNE __tx_thread_fiq_no_preempt_restore // Yes, don't preempt this thread + LDR r3, =_tx_thread_execute_ptr // Pickup address of execute thread ptr + LDR r2, [r3] // Pickup actual execute thread pointer + CMP r0, r2 // Is the same thread highest priority? + BNE __tx_thread_fiq_preempt_restore // No, preemption needs to happen __tx_thread_fiq_no_preempt_restore: -@ -@ /* Restore interrupted thread or ISR. */ -@ -@ /* Pickup the saved stack pointer. */ -@ tmp_ptr = _tx_thread_current_ptr -> tx_thread_stack_ptr; -@ -@ /* Recover the saved context and return to the point of interrupt. */ -@ - LDMIA sp!, {r0, lr} @ Recover SPSR, POI, and scratch regs - MSR SPSR_cxsf, r0 @ Put SPSR back - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOVS pc, lr @ Return to point of interrupt -@ -@ } -@ else -@ { -__tx_thread_fiq_preempt_restore: -@ - LDMIA sp!, {r3, lr} @ Recover temporarily saved registers - MOV r1, lr @ Save lr (point of interrupt) - MOV r2, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r2 @ Enter SVC mode - STR r1, [sp, #-4]! @ Save point of interrupt - STMDB sp!, {r4-r12, lr} @ Save upper half of registers - MOV r4, r3 @ Save SPSR in r4 - MOV r2, #FIQ_MODE @ Build FIQ mode CPSR - MSR CPSR_c, r2 @ Reenter FIQ mode - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOV r5, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r5 @ Enter SVC mode - STMDB sp!, {r0-r3} @ Save r0-r3 on thread's stack - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup current thread pointer + /* Restore interrupted thread or ISR. */ + /* Recover the saved context and return to the point of interrupt. */ + + LDMIA sp!, {r0, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_fiq_preempt_restore: + + LDMIA sp!, {r3, lr} // Recover temporarily saved registers + MOV r1, lr // Save lr (point of interrupt) + MOV r2, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r2 // Enter SVC mode + STR r1, [sp, #-4]! // Save point of interrupt + STMDB sp!, {r4-r12, lr} // Save upper half of registers + MOV r4, r3 // Save SPSR in r4 + MOV r2, #FIQ_MODE // Build FIQ mode CPSR + MSR CPSR_c, r2 // Reenter FIQ mode + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOV r5, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r5 // Enter SVC mode + STMDB sp!, {r0-r3} // Save r0-r3 on thread's stack + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer #ifdef TX_ENABLE_VFP_SUPPORT - LDR r2, [r0, #144] @ Pickup the VFP enabled flag - CMP r2, #0 @ Is the VFP enabled? - BEQ _tx_skip_fiq_vfp_save @ No, skip VFP IRQ save - VMRS r2, FPSCR @ Pickup the FPSCR - STR r2, [sp, #-4]! @ Save FPSCR - VSTMDB sp!, {D16-D31} @ Save D16-D31 - VSTMDB sp!, {D0-D15} @ Save D0-D15 + LDR r2, [r0, #144] // Pickup the VFP enabled flag + CMP r2, #0 // Is the VFP enabled? + BEQ _tx_skip_fiq_vfp_save // No, skip VFP IRQ save + VMRS r2, FPSCR // Pickup the FPSCR + STR r2, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D0-D15} // Save D0-D15 _tx_skip_fiq_vfp_save: #endif - MOV r3, #1 @ Build interrupt stack type - STMDB sp!, {r3, r4} @ Save interrupt stack type and SPSR - STR sp, [r0, #8] @ Save stack pointer in thread control - @ block */ -@ -@ /* Save the remaining time-slice and disable it. */ -@ if (_tx_timer_time_slice) -@ { -@ - LDR r3, =_tx_timer_time_slice @ Pickup time-slice variable address - LDR r2, [r3] @ Pickup time-slice - CMP r2, #0 @ Is it active? - BEQ __tx_thread_fiq_dont_save_ts @ No, don't save it -@ -@ _tx_thread_current_ptr -> tx_thread_time_slice = _tx_timer_time_slice; -@ _tx_timer_time_slice = 0; -@ - STR r2, [r0, #24] @ Save thread's time-slice - MOV r2, #0 @ Clear value - STR r2, [r3] @ Disable global time-slice flag -@ -@ } -__tx_thread_fiq_dont_save_ts: -@ -@ -@ /* Clear the current task pointer. */ -@ _tx_thread_current_ptr = TX_NULL; -@ - MOV r0, #0 @ NULL value - STR r0, [r1] @ Clear current thread pointer -@ -@ /* Return to the scheduler. */ -@ _tx_thread_schedule(); -@ - B _tx_thread_schedule @ Return to scheduler -@ } -@ -__tx_thread_fiq_idle_system_restore: -@ -@ /* Just return back to the scheduler! */ -@ - ADD sp, sp, #24 @ Recover FIQ stack space - MOV r3, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r3 @ Lockout interrupts - B _tx_thread_schedule @ Return to scheduler -@ -@} + MOV r3, #1 // Build interrupt stack type + STMDB sp!, {r3, r4} // Save interrupt stack type and SPSR + STR sp, [r0, #8] // Save stack pointer in thread control + // block */ + LDR r3, =_tx_timer_time_slice // Pickup time-slice variable address + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it active? + BEQ __tx_thread_fiq_dont_save_ts // No, don't save it + + STR r2, [r0, #24] // Save thread's time-slice + MOV r2, #0 // Clear value + STR r2, [r3] // Disable global time-slice flag + +__tx_thread_fiq_dont_save_ts: + + /* Clear the current task pointer. */ + + MOV r0, #0 // NULL value + STR r0, [r1] // Clear current thread pointer + + /* Return to the scheduler. */ + + B _tx_thread_schedule // Return to scheduler + +__tx_thread_fiq_idle_system_restore: + + /* Just return back to the scheduler! */ + + ADD sp, sp, #24 // Recover FIQ stack space + MOV r3, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r3 // Lockout interrupts + B _tx_thread_schedule // Return to scheduler diff --git a/ports/cortex_a15/gnu/src/tx_thread_fiq_context_save.S b/ports/cortex_a15/gnu/src/tx_thread_fiq_context_save.S index f036bf85..7db6a4c2 100644 --- a/ports/cortex_a15/gnu/src/tx_thread_fiq_context_save.S +++ b/ports/cortex_a15/gnu/src/tx_thread_fiq_context_save.S @@ -1,207 +1,178 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .global _tx_thread_system_state .global _tx_thread_current_ptr .global __tx_fiq_processing_return .global _tx_execution_isr_enter -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_save -@ since it will never be called 16-bit mode. */ -@ + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_save + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_fiq_context_save Cortex-A15/GNU */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function saves the context of an executing thread in the */ -@/* beginning of interrupt processing. The function also ensures that */ -@/* the system stack is used upon return to the calling ISR. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@ VOID _tx_thread_fiq_context_save(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_fiq_context_save .type _tx_thread_fiq_context_save,function _tx_thread_fiq_context_save: -@ -@ /* Upon entry to this routine, it is assumed that IRQ interrupts are locked -@ out, we are in IRQ mode, and all registers are intact. */ -@ -@ /* Check for a nested interrupt condition. */ -@ if (_tx_thread_system_state++) -@ { -@ - STMDB sp!, {r0-r3} @ Save some working registers - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3] @ Pickup system state - CMP r2, #0 @ Is this the first interrupt? - BEQ __tx_thread_fiq_not_nested_save @ Yes, not a nested context save -@ -@ /* Nested interrupt condition. */ -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3] @ Store it back in the variable -@ -@ /* Save the rest of the scratch registers on the stack and return to the -@ calling ISR. */ -@ - MRS r0, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r0, r10, r12, lr} @ Store other registers -@ -@ /* Return to the ISR. */ -@ - MOV r10, #0 @ Clear stack limit + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + + STMDB sp!, {r0-r3} // Save some working registers + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_fiq_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + + /* Save the rest of the scratch registers on the stack and return to the + calling ISR. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, r10, r12, lr} // Store other registers + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - B __tx_fiq_processing_return @ Continue FIQ processing -@ + B __tx_fiq_processing_return // Continue FIQ processing +// __tx_thread_fiq_not_nested_save: -@ } -@ -@ /* Otherwise, not nested, check to see if a thread was running. */ -@ else if (_tx_thread_current_ptr) -@ { -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3] @ Store it back in the variable - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_fiq_idle_system_save @ If so, interrupt occurred in -@ @ scheduling loop - nothing needs saving! -@ -@ /* Save minimal context of interrupted thread. */ -@ - MRS r2, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r2, lr} @ Store other registers, Note that we don't -@ @ need to save sl and ip since FIQ has -@ @ copies of these registers. Nested -@ @ interrupt processing does need to save -@ @ these registers. -@ -@ /* Save the current stack pointer in the thread's control block. */ -@ _tx_thread_current_ptr -> tx_thread_stack_ptr = sp; -@ -@ /* Switch to the system stack. */ -@ sp = _tx_thread_system_stack_ptr; -@ - MOV r10, #0 @ Clear stack limit + + /* Otherwise, not nested, check to see if a thread was running. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_fiq_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + + /* Save minimal context of interrupted thread. */ + + MRS r2, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r2, lr} // Store other registers, Note that we don't + // need to save sl and ip since FIQ has + // copies of these registers. Nested + // interrupt processing does need to save + // these registers. + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - B __tx_fiq_processing_return @ Continue FIQ processing -@ -@ } -@ else -@ { -@ + B __tx_fiq_processing_return // Continue FIQ processing + __tx_thread_fiq_idle_system_save: -@ -@ /* Interrupt occurred in the scheduling loop. */ -@ -#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr -#endif -@ -@ /* Not much to do here, save the current SPSR and LR for possible -@ use in IRQ interrupted in idle system conditions, and return to -@ FIQ interrupt processing. */ -@ - MRS r0, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r0, lr} @ Store other registers that will get used -@ @ or stripped off the stack in context -@ @ restore - B __tx_fiq_processing_return @ Continue FIQ processing -@ -@ } -@} + /* Interrupt occurred in the scheduling loop. */ + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + /* Not much to do here, save the current SPSR and LR for possible + use in IRQ interrupted in idle system conditions, and return to + FIQ interrupt processing. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, lr} // Store other registers that will get used + // or stripped off the stack in context + // restore + B __tx_fiq_processing_return // Continue FIQ processing diff --git a/ports/cortex_a15/gnu/src/tx_thread_fiq_nesting_end.S b/ports/cortex_a15/gnu/src/tx_thread_fiq_nesting_end.S index 7ddb0f7f..b34d881e 100644 --- a/ports/cortex_a15/gnu/src/tx_thread_fiq_nesting_end.S +++ b/ports/cortex_a15/gnu/src/tx_thread_fiq_nesting_end.S @@ -1,116 +1,104 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + #ifdef TX_ENABLE_FIQ_SUPPORT -DISABLE_INTS = 0xC0 @ Disable IRQ/FIQ interrupts +DISABLE_INTS = 0xC0 // Disable IRQ/FIQ interrupts #else -DISABLE_INTS = 0x80 @ Disable IRQ interrupts +DISABLE_INTS = 0x80 // Disable IRQ interrupts #endif -MODE_MASK = 0x1F @ Mode mask -FIQ_MODE_BITS = 0x11 @ FIQ mode bits -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_end -@ since it will never be called 16-bit mode. */ -@ +MODE_MASK = 0x1F // Mode mask +FIQ_MODE_BITS = 0x11 // FIQ mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_end + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_fiq_nesting_end Cortex-A15/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is called by the application from FIQ mode after */ -@/* _tx_thread_fiq_nesting_start has been called and switches the FIQ */ -@/* processing from system mode back to FIQ mode prior to the ISR */ -@/* calling _tx_thread_fiq_context_restore. Note that this function */ -@/* assumes the system stack pointer is in the same position after */ -@/* nesting start function was called. */ -@/* */ -@/* This function assumes that the system mode stack pointer was setup */ -@/* during low-level initialization (tx_initialize_low_level.s). */ -@/* */ -@/* This function returns with FIQ interrupts disabled. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_fiq_nesting_end(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_nesting_end ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from FIQ mode after */ +/* _tx_thread_fiq_nesting_start has been called and switches the FIQ */ +/* processing from system mode back to FIQ mode prior to the ISR */ +/* calling _tx_thread_fiq_context_restore. Note that this function */ +/* assumes the system stack pointer is in the same position after */ +/* nesting start function was called. */ +/* */ +/* This function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with FIQ interrupts disabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_fiq_nesting_end .type _tx_thread_fiq_nesting_end,function _tx_thread_fiq_nesting_end: - MOV r3,lr @ Save ISR return address - MRS r0, CPSR @ Pickup the CPSR - ORR r0, r0, #DISABLE_INTS @ Build disable interrupt value - MSR CPSR_c, r0 @ Disable interrupts - LDMIA sp!, {r1, lr} @ Pickup saved lr (and r1 throw-away for - @ 8-byte alignment logic) - BIC r0, r0, #MODE_MASK @ Clear mode bits - ORR r0, r0, #FIQ_MODE_BITS @ Build IRQ mode CPSR - MSR CPSR_c, r0 @ Reenter IRQ mode + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + ORR r0, r0, #DISABLE_INTS // Build disable interrupt value + MSR CPSR_c, r0 // Disable interrupts + LDMIA sp!, {r1, lr} // Pickup saved lr (and r1 throw-away for + // 8-byte alignment logic) + BIC r0, r0, #MODE_MASK // Clear mode bits + ORR r0, r0, #FIQ_MODE_BITS // Build IRQ mode CPSR + MSR CPSR_c, r0 // Reenter IRQ mode #ifdef __THUMB_INTERWORK - BX r3 @ Return to caller + BX r3 // Return to caller #else - MOV pc, r3 @ Return to caller + MOV pc, r3 // Return to caller #endif -@} - diff --git a/ports/cortex_a15/gnu/src/tx_thread_fiq_nesting_start.S b/ports/cortex_a15/gnu/src/tx_thread_fiq_nesting_start.S index a2f0471e..c9cd5a06 100644 --- a/ports/cortex_a15/gnu/src/tx_thread_fiq_nesting_start.S +++ b/ports/cortex_a15/gnu/src/tx_thread_fiq_nesting_start.S @@ -1,108 +1,96 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ -FIQ_DISABLE = 0x40 @ FIQ disable bit -MODE_MASK = 0x1F @ Mode mask -SYS_MODE_BITS = 0x1F @ System mode bits -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_start -@ since it will never be called 16-bit mode. */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +FIQ_DISABLE = 0x40 // FIQ disable bit +MODE_MASK = 0x1F // Mode mask +SYS_MODE_BITS = 0x1F // System mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_start + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_fiq_nesting_start Cortex-A15/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is called by the application from FIQ mode after */ -@/* _tx_thread_fiq_context_save has been called and switches the FIQ */ -@/* processing to the system mode so nested FIQ interrupt processing */ -@/* is possible (system mode has its own "lr" register). Note that */ -@/* this function assumes that the system mode stack pointer was setup */ -@/* during low-level initialization (tx_initialize_low_level.s). */ -@/* */ -@/* This function returns with FIQ interrupts enabled. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_fiq_nesting_start(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_nesting_start ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from FIQ mode after */ +/* _tx_thread_fiq_context_save has been called and switches the FIQ */ +/* processing to the system mode so nested FIQ interrupt processing */ +/* is possible (system mode has its own "lr" register). Note that */ +/* this function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with FIQ interrupts enabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_fiq_nesting_start .type _tx_thread_fiq_nesting_start,function _tx_thread_fiq_nesting_start: - MOV r3,lr @ Save ISR return address - MRS r0, CPSR @ Pickup the CPSR - BIC r0, r0, #MODE_MASK @ Clear the mode bits - ORR r0, r0, #SYS_MODE_BITS @ Build system mode CPSR - MSR CPSR_c, r0 @ Enter system mode - STMDB sp!, {r1, lr} @ Push the system mode lr on the system mode stack - @ and push r1 just to keep 8-byte alignment - BIC r0, r0, #FIQ_DISABLE @ Build enable FIQ CPSR - MSR CPSR_c, r0 @ Enter system mode + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + BIC r0, r0, #MODE_MASK // Clear the mode bits + ORR r0, r0, #SYS_MODE_BITS // Build system mode CPSR + MSR CPSR_c, r0 // Enter system mode + STMDB sp!, {r1, lr} // Push the system mode lr on the system mode stack + // and push r1 just to keep 8-byte alignment + BIC r0, r0, #FIQ_DISABLE // Build enable FIQ CPSR + MSR CPSR_c, r0 // Enter system mode #ifdef __THUMB_INTERWORK - BX r3 @ Return to caller + BX r3 // Return to caller #else - MOV pc, r3 @ Return to caller + MOV pc, r3 // Return to caller #endif -@} - diff --git a/ports/cortex_a15/gnu/src/tx_thread_interrupt_control.S b/ports/cortex_a15/gnu/src/tx_thread_interrupt_control.S index bb919207..63b1609a 100644 --- a/ports/cortex_a15/gnu/src/tx_thread_interrupt_control.S +++ b/ports/cortex_a15/gnu/src/tx_thread_interrupt_control.S @@ -1,115 +1,104 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ INT_MASK = 0x03F -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_control for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_control for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_interrupt_control $_tx_thread_interrupt_control: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_interrupt_control @ Call _tx_thread_interrupt_control function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_control // Call _tx_thread_interrupt_control function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_interrupt_control Cortex-A15/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is responsible for changing the interrupt lockout */ -@/* posture of the system. */ -@/* */ -@/* INPUT */ -@/* */ -@/* new_posture New interrupt lockout posture */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* old_posture Old interrupt lockout posture */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* Application Code */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@UINT _tx_thread_interrupt_control(UINT new_posture) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_control ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for changing the interrupt lockout */ +/* posture of the system. */ +/* */ +/* INPUT */ +/* */ +/* new_posture New interrupt lockout posture */ +/* */ +/* OUTPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_interrupt_control .type _tx_thread_interrupt_control,function _tx_thread_interrupt_control: -@ -@ /* Pickup current interrupt lockout posture. */ -@ - MRS r3, CPSR @ Pickup current CPSR - MOV r2, #INT_MASK @ Build interrupt mask - AND r1, r3, r2 @ Clear interrupt lockout bits - ORR r1, r1, r0 @ Or-in new interrupt lockout bits -@ -@ /* Apply the new interrupt posture. */ -@ - MSR CPSR_c, r1 @ Setup new CPSR - BIC r0, r3, r2 @ Return previous interrupt mask -#ifdef __THUMB_INTERWORK - BX lr @ Return to caller -#else - MOV pc, lr @ Return to caller -#endif -@} + /* Pickup current interrupt lockout posture. */ + + MRS r3, CPSR // Pickup current CPSR + MOV r2, #INT_MASK // Build interrupt mask + AND r1, r3, r2 // Clear interrupt lockout bits + ORR r1, r1, r0 // Or-in new interrupt lockout bits + + /* Apply the new interrupt posture. */ + + MSR CPSR_c, r1 // Setup new CPSR + BIC r0, r3, r2 // Return previous interrupt mask +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a15/gnu/src/tx_thread_interrupt_disable.S b/ports/cortex_a15/gnu/src/tx_thread_interrupt_disable.S index 549423c5..13258808 100644 --- a/ports/cortex_a15/gnu/src/tx_thread_interrupt_disable.S +++ b/ports/cortex_a15/gnu/src/tx_thread_interrupt_disable.S @@ -1,113 +1,101 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_disable for -@ applications calling this function from to 16-bit Thumb mode. */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_disable for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_interrupt_disable $_tx_thread_interrupt_disable: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_interrupt_disable @ Call _tx_thread_interrupt_disable function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_disable // Call _tx_thread_interrupt_disable function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_interrupt_disable Cortex-A15/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is responsible for disabling interrupts */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* old_posture Old interrupt lockout posture */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* Application Code */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@UINT _tx_thread_interrupt_disable(void) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_disable ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for disabling interrupts */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_interrupt_disable .type _tx_thread_interrupt_disable,function _tx_thread_interrupt_disable: -@ -@ /* Pickup current interrupt lockout posture. */ -@ - MRS r0, CPSR @ Pickup current CPSR -@ -@ /* Mask interrupts. */ -@ + + /* Pickup current interrupt lockout posture. */ + + MRS r0, CPSR // Pickup current CPSR + + /* Mask interrupts. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ + CPSID if // Disable IRQ and FIQ #else - CPSID i @ Disable IRQ + CPSID i // Disable IRQ #endif #ifdef __THUMB_INTERWORK - BX lr @ Return to caller + BX lr // Return to caller #else - MOV pc, lr @ Return to caller + MOV pc, lr // Return to caller #endif -@} - - diff --git a/ports/cortex_a15/gnu/src/tx_thread_interrupt_restore.S b/ports/cortex_a15/gnu/src/tx_thread_interrupt_restore.S index 0f5a7b0a..2d582511 100644 --- a/ports/cortex_a15/gnu/src/tx_thread_interrupt_restore.S +++ b/ports/cortex_a15/gnu/src/tx_thread_interrupt_restore.S @@ -1,104 +1,93 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_restore for -@ applications calling this function from to 16-bit Thumb mode. */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_restore for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_interrupt_restore $_tx_thread_interrupt_restore: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_interrupt_restore @ Call _tx_thread_interrupt_restore function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_restore // Call _tx_thread_interrupt_restore function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_interrupt_restore Cortex-A15/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is responsible for restoring interrupts to the state */ -@/* returned by a previous _tx_thread_interrupt_disable call. */ -@/* */ -@/* INPUT */ -@/* */ -@/* old_posture Old interrupt lockout posture */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* Application Code */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@UINT _tx_thread_interrupt_restore(UINT old_posture) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for restoring interrupts to the state */ +/* returned by a previous _tx_thread_interrupt_disable call. */ +/* */ +/* INPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_interrupt_restore .type _tx_thread_interrupt_restore,function _tx_thread_interrupt_restore: -@ -@ /* Apply the new interrupt posture. */ -@ - MSR CPSR_c, r0 @ Setup new CPSR -#ifdef __THUMB_INTERWORK - BX lr @ Return to caller -#else - MOV pc, lr @ Return to caller -#endif -@} + /* Apply the new interrupt posture. */ + + MSR CPSR_c, r0 // Setup new CPSR +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a15/gnu/src/tx_thread_irq_nesting_end.S b/ports/cortex_a15/gnu/src/tx_thread_irq_nesting_end.S index 0ae02793..ec7e63c6 100644 --- a/ports/cortex_a15/gnu/src/tx_thread_irq_nesting_end.S +++ b/ports/cortex_a15/gnu/src/tx_thread_irq_nesting_end.S @@ -1,115 +1,103 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + #ifdef TX_ENABLE_FIQ_SUPPORT -DISABLE_INTS = 0xC0 @ Disable IRQ/FIQ interrupts +DISABLE_INTS = 0xC0 // Disable IRQ/FIQ interrupts #else -DISABLE_INTS = 0x80 @ Disable IRQ interrupts +DISABLE_INTS = 0x80 // Disable IRQ interrupts #endif -MODE_MASK = 0x1F @ Mode mask -IRQ_MODE_BITS = 0x12 @ IRQ mode bits -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_end -@ since it will never be called 16-bit mode. */ -@ +MODE_MASK = 0x1F // Mode mask +IRQ_MODE_BITS = 0x12 // IRQ mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_end + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_irq_nesting_end Cortex-A15/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is called by the application from IRQ mode after */ -@/* _tx_thread_irq_nesting_start has been called and switches the IRQ */ -@/* processing from system mode back to IRQ mode prior to the ISR */ -@/* calling _tx_thread_context_restore. Note that this function */ -@/* assumes the system stack pointer is in the same position after */ -@/* nesting start function was called. */ -@/* */ -@/* This function assumes that the system mode stack pointer was setup */ -@/* during low-level initialization (tx_initialize_low_level.s). */ -@/* */ -@/* This function returns with IRQ interrupts disabled. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_irq_nesting_end(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_irq_nesting_end ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from IRQ mode after */ +/* _tx_thread_irq_nesting_start has been called and switches the IRQ */ +/* processing from system mode back to IRQ mode prior to the ISR */ +/* calling _tx_thread_context_restore. Note that this function */ +/* assumes the system stack pointer is in the same position after */ +/* nesting start function was called. */ +/* */ +/* This function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with IRQ interrupts disabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_irq_nesting_end .type _tx_thread_irq_nesting_end,function _tx_thread_irq_nesting_end: - MOV r3,lr @ Save ISR return address - MRS r0, CPSR @ Pickup the CPSR - ORR r0, r0, #DISABLE_INTS @ Build disable interrupt value - MSR CPSR_c, r0 @ Disable interrupts - LDMIA sp!, {r1, lr} @ Pickup saved lr (and r1 throw-away for - @ 8-byte alignment logic) - BIC r0, r0, #MODE_MASK @ Clear mode bits - ORR r0, r0, #IRQ_MODE_BITS @ Build IRQ mode CPSR - MSR CPSR_c, r0 @ Reenter IRQ mode + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + ORR r0, r0, #DISABLE_INTS // Build disable interrupt value + MSR CPSR_c, r0 // Disable interrupts + LDMIA sp!, {r1, lr} // Pickup saved lr (and r1 throw-away for + // 8-byte alignment logic) + BIC r0, r0, #MODE_MASK // Clear mode bits + ORR r0, r0, #IRQ_MODE_BITS // Build IRQ mode CPSR + MSR CPSR_c, r0 // Reenter IRQ mode #ifdef __THUMB_INTERWORK - BX r3 @ Return to caller + BX r3 // Return to caller #else - MOV pc, r3 @ Return to caller + MOV pc, r3 // Return to caller #endif -@} - diff --git a/ports/cortex_a15/gnu/src/tx_thread_irq_nesting_start.S b/ports/cortex_a15/gnu/src/tx_thread_irq_nesting_start.S index 222d348f..c69976ed 100644 --- a/ports/cortex_a15/gnu/src/tx_thread_irq_nesting_start.S +++ b/ports/cortex_a15/gnu/src/tx_thread_irq_nesting_start.S @@ -1,108 +1,96 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ -IRQ_DISABLE = 0x80 @ IRQ disable bit -MODE_MASK = 0x1F @ Mode mask -SYS_MODE_BITS = 0x1F @ System mode bits -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_start -@ since it will never be called 16-bit mode. */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +IRQ_DISABLE = 0x80 // IRQ disable bit +MODE_MASK = 0x1F // Mode mask +SYS_MODE_BITS = 0x1F // System mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_start + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_irq_nesting_start Cortex-A15/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is called by the application from IRQ mode after */ -@/* _tx_thread_context_save has been called and switches the IRQ */ -@/* processing to the system mode so nested IRQ interrupt processing */ -@/* is possible (system mode has its own "lr" register). Note that */ -@/* this function assumes that the system mode stack pointer was setup */ -@/* during low-level initialization (tx_initialize_low_level.s). */ -@/* */ -@/* This function returns with IRQ interrupts enabled. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_irq_nesting_start(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_irq_nesting_start ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from IRQ mode after */ +/* _tx_thread_context_save has been called and switches the IRQ */ +/* processing to the system mode so nested IRQ interrupt processing */ +/* is possible (system mode has its own "lr" register). Note that */ +/* this function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with IRQ interrupts enabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_irq_nesting_start .type _tx_thread_irq_nesting_start,function _tx_thread_irq_nesting_start: - MOV r3,lr @ Save ISR return address - MRS r0, CPSR @ Pickup the CPSR - BIC r0, r0, #MODE_MASK @ Clear the mode bits - ORR r0, r0, #SYS_MODE_BITS @ Build system mode CPSR - MSR CPSR_c, r0 @ Enter system mode - STMDB sp!, {r1, lr} @ Push the system mode lr on the system mode stack - @ and push r1 just to keep 8-byte alignment - BIC r0, r0, #IRQ_DISABLE @ Build enable IRQ CPSR - MSR CPSR_c, r0 @ Enter system mode + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + BIC r0, r0, #MODE_MASK // Clear the mode bits + ORR r0, r0, #SYS_MODE_BITS // Build system mode CPSR + MSR CPSR_c, r0 // Enter system mode + STMDB sp!, {r1, lr} // Push the system mode lr on the system mode stack + // and push r1 just to keep 8-byte alignment + BIC r0, r0, #IRQ_DISABLE // Build enable IRQ CPSR + MSR CPSR_c, r0 // Enter system mode #ifdef __THUMB_INTERWORK - BX r3 @ Return to caller + BX r3 // Return to caller #else - MOV pc, r3 @ Return to caller + MOV pc, r3 // Return to caller #endif -@} - diff --git a/ports/cortex_a15/gnu/src/tx_thread_schedule.S b/ports/cortex_a15/gnu/src/tx_thread_schedule.S index 5e62803e..8330e9df 100644 --- a/ports/cortex_a15/gnu/src/tx_thread_schedule.S +++ b/ports/cortex_a15/gnu/src/tx_thread_schedule.S @@ -1,258 +1,230 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .global _tx_thread_execute_ptr .global _tx_thread_current_ptr .global _tx_timer_time_slice - .global _tx_execution_thread_enter -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_schedule for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_schedule for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_schedule .type $_tx_thread_schedule,function $_tx_thread_schedule: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_schedule @ Call _tx_thread_schedule function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_schedule // Call _tx_thread_schedule function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_schedule Cortex-A15/GNU */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function waits for a thread control block pointer to appear in */ -@/* the _tx_thread_execute_ptr variable. Once a thread pointer appears */ -@/* in the variable, the corresponding thread is resumed. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* _tx_initialize_kernel_enter ThreadX entry function */ -@/* _tx_thread_system_return Return to system from thread */ -@/* _tx_thread_context_restore Restore thread's context */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_schedule(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_schedule ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function waits for a thread control block pointer to appear in */ +/* the _tx_thread_execute_ptr variable. Once a thread pointer appears */ +/* in the variable, the corresponding thread is resumed. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_initialize_kernel_enter ThreadX entry function */ +/* _tx_thread_system_return Return to system from thread */ +/* _tx_thread_context_restore Restore thread's context */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_schedule .type _tx_thread_schedule,function _tx_thread_schedule: -@ -@ /* Enable interrupts. */ -@ + + /* Enable interrupts. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSIE if @ Enable IRQ and FIQ interrupts + CPSIE if // Enable IRQ and FIQ interrupts #else - CPSIE i @ Enable IRQ interrupts + CPSIE i // Enable IRQ interrupts #endif -@ -@ /* Wait for a thread to execute. */ -@ do -@ { - LDR r1, =_tx_thread_execute_ptr @ Address of thread execute ptr -@ + + /* Wait for a thread to execute. */ + LDR r1, =_tx_thread_execute_ptr // Address of thread execute ptr + __tx_thread_schedule_loop: -@ - LDR r0, [r1] @ Pickup next thread to execute - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_schedule_loop @ If so, keep looking for a thread -@ -@ } -@ while(_tx_thread_execute_ptr == TX_NULL); -@ -@ /* Yes! We have a thread to execute. Lockout interrupts and -@ transfer control to it. */ -@ + + LDR r0, [r1] // Pickup next thread to execute + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_schedule_loop // If so, keep looking for a thread + /* Yes! We have a thread to execute. Lockout interrupts and + transfer control to it. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ interrupts + CPSID if // Disable IRQ and FIQ interrupts #else - CPSID i @ Disable IRQ interrupts + CPSID i // Disable IRQ interrupts #endif -@ -@ /* Setup the current thread pointer. */ -@ _tx_thread_current_ptr = _tx_thread_execute_ptr; -@ - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread - STR r0, [r1] @ Setup current thread pointer -@ -@ /* Increment the run count for this thread. */ -@ _tx_thread_current_ptr -> tx_thread_run_count++; -@ - LDR r2, [r0, #4] @ Pickup run counter - LDR r3, [r0, #24] @ Pickup time-slice for this thread - ADD r2, r2, #1 @ Increment thread run-counter - STR r2, [r0, #4] @ Store the new run counter -@ -@ /* Setup time-slice, if present. */ -@ _tx_timer_time_slice = _tx_thread_current_ptr -> tx_thread_time_slice; -@ - LDR r2, =_tx_timer_time_slice @ Pickup address of time-slice - @ variable - LDR sp, [r0, #8] @ Switch stack pointers - STR r3, [r2] @ Setup time-slice -@ -@ /* Switch to the thread's stack. */ -@ sp = _tx_thread_execute_ptr -> tx_thread_stack_ptr; -@ + + /* Setup the current thread pointer. */ + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread + STR r0, [r1] // Setup current thread pointer + + /* Increment the run count for this thread. */ + + LDR r2, [r0, #4] // Pickup run counter + LDR r3, [r0, #24] // Pickup time-slice for this thread + ADD r2, r2, #1 // Increment thread run-counter + STR r2, [r0, #4] // Store the new run counter + + /* Setup time-slice, if present. */ + + LDR r2, =_tx_timer_time_slice // Pickup address of time-slice + // variable + LDR sp, [r0, #8] // Switch stack pointers + STR r3, [r2] // Setup time-slice + #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the thread entry function to indicate the thread is executing. */ -@ - MOV r5, r0 @ Save r0 - BL _tx_execution_thread_enter @ Call the thread execution enter function - MOV r0, r5 @ Restore r0 + + /* Call the thread entry function to indicate the thread is executing. */ + + MOV r5, r0 // Save r0 + BL _tx_execution_thread_enter // Call the thread execution enter function + MOV r0, r5 // Restore r0 #endif -@ -@ /* Determine if an interrupt frame or a synchronous task suspension frame -@ is present. */ -@ - LDMIA sp!, {r4, r5} @ Pickup the stack type and saved CPSR - CMP r4, #0 @ Check for synchronous context switch + + /* Determine if an interrupt frame or a synchronous task suspension frame + is present. */ + + LDMIA sp!, {r4, r5} // Pickup the stack type and saved CPSR + CMP r4, #0 // Check for synchronous context switch BEQ _tx_solicited_return - MSR SPSR_cxsf, r5 @ Setup SPSR for return + MSR SPSR_cxsf, r5 // Setup SPSR for return #ifdef TX_ENABLE_VFP_SUPPORT - LDR r1, [r0, #144] @ Pickup the VFP enabled flag - CMP r1, #0 @ Is the VFP enabled? - BEQ _tx_skip_interrupt_vfp_restore @ No, skip VFP interrupt restore - VLDMIA sp!, {D0-D15} @ Recover D0-D15 - VLDMIA sp!, {D16-D31} @ Recover D16-D31 - LDR r4, [sp], #4 @ Pickup FPSCR - VMSR FPSCR, r4 @ Restore FPSCR + LDR r1, [r0, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_interrupt_vfp_restore // No, skip VFP interrupt restore + VLDMIA sp!, {D0-D15} // Recover D0-D15 + VLDMIA sp!, {D16-D31} // Recover D16-D31 + LDR r4, [sp], #4 // Pickup FPSCR + VMSR FPSCR, r4 // Restore FPSCR _tx_skip_interrupt_vfp_restore: #endif - LDMIA sp!, {r0-r12, lr, pc}^ @ Return to point of thread interrupt + LDMIA sp!, {r0-r12, lr, pc}^ // Return to point of thread interrupt _tx_solicited_return: #ifdef TX_ENABLE_VFP_SUPPORT - LDR r1, [r0, #144] @ Pickup the VFP enabled flag - CMP r1, #0 @ Is the VFP enabled? - BEQ _tx_skip_solicited_vfp_restore @ No, skip VFP solicited restore - VLDMIA sp!, {D8-D15} @ Recover D8-D15 - VLDMIA sp!, {D16-D31} @ Recover D16-D31 - LDR r4, [sp], #4 @ Pickup FPSCR - VMSR FPSCR, r4 @ Restore FPSCR + LDR r1, [r0, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_solicited_vfp_restore // No, skip VFP solicited restore + VLDMIA sp!, {D8-D15} // Recover D8-D15 + VLDMIA sp!, {D16-D31} // Recover D16-D31 + LDR r4, [sp], #4 // Pickup FPSCR + VMSR FPSCR, r4 // Restore FPSCR _tx_skip_solicited_vfp_restore: #endif - MSR CPSR_cxsf, r5 @ Recover CPSR - LDMIA sp!, {r4-r11, lr} @ Return to thread synchronously + MSR CPSR_cxsf, r5 // Recover CPSR + LDMIA sp!, {r4-r11, lr} // Return to thread synchronously #ifdef __THUMB_INTERWORK - BX lr @ Return to caller + BX lr // Return to caller #else - MOV pc, lr @ Return to caller + MOV pc, lr // Return to caller #endif -@ -@} -@ #ifdef TX_ENABLE_VFP_SUPPORT .global tx_thread_vfp_enable .type tx_thread_vfp_enable,function tx_thread_vfp_enable: - MRS r2, CPSR @ Pickup the CPSR + MRS r2, CPSR // Pickup the CPSR #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Enable IRQ and FIQ interrupts + CPSID if // Enable IRQ and FIQ interrupts #else - CPSID i @ Enable IRQ interrupts + CPSID i // Enable IRQ interrupts #endif - LDR r0, =_tx_thread_current_ptr @ Build current thread pointer address - LDR r1, [r0] @ Pickup current thread pointer - CMP r1, #0 @ Check for NULL thread pointer - BEQ __tx_no_thread_to_enable @ If NULL, skip VFP enable - MOV r0, #1 @ Build enable value - STR r0, [r1, #144] @ Set the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) + LDR r0, =_tx_thread_current_ptr // Build current thread pointer address + LDR r1, [r0] // Pickup current thread pointer + CMP r1, #0 // Check for NULL thread pointer + BEQ __tx_no_thread_to_enable // If NULL, skip VFP enable + MOV r0, #1 // Build enable value + STR r0, [r1, #144] // Set the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) __tx_no_thread_to_enable: - MSR CPSR_cxsf, r2 @ Recover CPSR - BX LR @ Return to caller + MSR CPSR_cxsf, r2 // Recover CPSR + BX LR // Return to caller .global tx_thread_vfp_disable .type tx_thread_vfp_disable,function tx_thread_vfp_disable: - MRS r2, CPSR @ Pickup the CPSR + MRS r2, CPSR // Pickup the CPSR #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Enable IRQ and FIQ interrupts + CPSID if // Enable IRQ and FIQ interrupts #else - CPSID i @ Enable IRQ interrupts + CPSID i // Enable IRQ interrupts #endif - LDR r0, =_tx_thread_current_ptr @ Build current thread pointer address - LDR r1, [r0] @ Pickup current thread pointer - CMP r1, #0 @ Check for NULL thread pointer - BEQ __tx_no_thread_to_disable @ If NULL, skip VFP disable - MOV r0, #0 @ Build disable value - STR r0, [r1, #144] @ Clear the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) + LDR r0, =_tx_thread_current_ptr // Build current thread pointer address + LDR r1, [r0] // Pickup current thread pointer + CMP r1, #0 // Check for NULL thread pointer + BEQ __tx_no_thread_to_disable // If NULL, skip VFP disable + MOV r0, #0 // Build disable value + STR r0, [r1, #144] // Clear the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) __tx_no_thread_to_disable: - MSR CPSR_cxsf, r2 @ Recover CPSR - BX LR @ Return to caller + MSR CPSR_cxsf, r2 // Recover CPSR + BX LR // Return to caller #endif - diff --git a/ports/cortex_a15/gnu/src/tx_thread_stack_build.S b/ports/cortex_a15/gnu/src/tx_thread_stack_build.S index cad38249..f413e673 100644 --- a/ports/cortex_a15/gnu/src/tx_thread_stack_build.S +++ b/ports/cortex_a15/gnu/src/tx_thread_stack_build.S @@ -1,178 +1,164 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ .arm -SVC_MODE = 0x13 @ SVC mode +SVC_MODE = 0x13 // SVC mode #ifdef TX_ENABLE_FIQ_SUPPORT -CPSR_MASK = 0xDF @ Mask initial CPSR, IRQ & FIQ interrupts enabled +CPSR_MASK = 0xDF // Mask initial CPSR, IRQ & FIQ interrupts enabled #else -CPSR_MASK = 0x9F @ Mask initial CPSR, IRQ interrupts enabled +CPSR_MASK = 0x9F // Mask initial CPSR, IRQ interrupts enabled #endif -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_stack_build for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_stack_build for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .thumb .global $_tx_thread_stack_build .type $_tx_thread_stack_build,function $_tx_thread_stack_build: - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_stack_build @ Call _tx_thread_stack_build function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_stack_build // Call _tx_thread_stack_build function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_stack_build Cortex-A15/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function builds a stack frame on the supplied thread's stack. */ -@/* The stack frame results in a fake interrupt return to the supplied */ -@/* function pointer. */ -@/* */ -@/* INPUT */ -@/* */ -@/* thread_ptr Pointer to thread control blk */ -@/* function_ptr Pointer to return function */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* _tx_thread_create Create thread service */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_stack_build(TX_THREAD *thread_ptr, VOID (*function_ptr)(VOID)) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_stack_build ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function builds a stack frame on the supplied thread's stack. */ +/* The stack frame results in a fake interrupt return to the supplied */ +/* function pointer. */ +/* */ +/* INPUT */ +/* */ +/* thread_ptr Pointer to thread control blk */ +/* function_ptr Pointer to return function */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_thread_create Create thread service */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_stack_build .type _tx_thread_stack_build,function _tx_thread_stack_build: -@ -@ -@ /* Build a fake interrupt frame. The form of the fake interrupt stack -@ on the Cortex-A15 should look like the following after it is built: -@ -@ Stack Top: 1 Interrupt stack frame type -@ CPSR Initial value for CPSR -@ a1 (r0) Initial value for a1 -@ a2 (r1) Initial value for a2 -@ a3 (r2) Initial value for a3 -@ a4 (r3) Initial value for a4 -@ v1 (r4) Initial value for v1 -@ v2 (r5) Initial value for v2 -@ v3 (r6) Initial value for v3 -@ v4 (r7) Initial value for v4 -@ v5 (r8) Initial value for v5 -@ sb (r9) Initial value for sb -@ sl (r10) Initial value for sl -@ fp (r11) Initial value for fp -@ ip (r12) Initial value for ip -@ lr (r14) Initial value for lr -@ pc (r15) Initial value for pc -@ 0 For stack backtracing -@ -@ Stack Bottom: (higher memory address) */ -@ - LDR r2, [r0, #16] @ Pickup end of stack area - BIC r2, r2, #7 @ Ensure 8-byte alignment - SUB r2, r2, #76 @ Allocate space for the stack frame -@ -@ /* Actually build the stack frame. */ -@ - MOV r3, #1 @ Build interrupt stack type - STR r3, [r2, #0] @ Store stack type - MOV r3, #0 @ Build initial register value - STR r3, [r2, #8] @ Store initial r0 - STR r3, [r2, #12] @ Store initial r1 - STR r3, [r2, #16] @ Store initial r2 - STR r3, [r2, #20] @ Store initial r3 - STR r3, [r2, #24] @ Store initial r4 - STR r3, [r2, #28] @ Store initial r5 - STR r3, [r2, #32] @ Store initial r6 - STR r3, [r2, #36] @ Store initial r7 - STR r3, [r2, #40] @ Store initial r8 - STR r3, [r2, #44] @ Store initial r9 - LDR r3, [r0, #12] @ Pickup stack starting address - STR r3, [r2, #48] @ Store initial r10 (sl) - LDR r3,=_tx_thread_schedule @ Pickup address of _tx_thread_schedule for GDB backtrace - STR r3, [r2, #60] @ Store initial r14 (lr) - MOV r3, #0 @ Build initial register value - STR r3, [r2, #52] @ Store initial r11 - STR r3, [r2, #56] @ Store initial r12 - STR r1, [r2, #64] @ Store initial pc - STR r3, [r2, #68] @ 0 for back-trace - MRS r1, CPSR @ Pickup CPSR - BIC r1, r1, #CPSR_MASK @ Mask mode bits of CPSR - ORR r3, r1, #SVC_MODE @ Build CPSR, SVC mode, interrupts enabled - STR r3, [r2, #4] @ Store initial CPSR -@ -@ /* Setup stack pointer. */ -@ thread_ptr -> tx_thread_stack_ptr = r2; -@ - STR r2, [r0, #8] @ Save stack pointer in thread's - @ control block + + + /* Build a fake interrupt frame. The form of the fake interrupt stack + on the ARMv7-A should look like the following after it is built: + + Stack Top: 1 Interrupt stack frame type + CPSR Initial value for CPSR + a1 (r0) Initial value for a1 + a2 (r1) Initial value for a2 + a3 (r2) Initial value for a3 + a4 (r3) Initial value for a4 + v1 (r4) Initial value for v1 + v2 (r5) Initial value for v2 + v3 (r6) Initial value for v3 + v4 (r7) Initial value for v4 + v5 (r8) Initial value for v5 + sb (r9) Initial value for sb + sl (r10) Initial value for sl + fp (r11) Initial value for fp + ip (r12) Initial value for ip + lr (r14) Initial value for lr + pc (r15) Initial value for + 0 For stack backtracing + + Stack Bottom: (higher memory address) */ + + LDR r2, [r0, #16] // Pickup end of stack area + BIC r2, r2, #7 // Ensure 8-byte alignment + SUB r2, r2, #76 // Allocate space for the stack frame + + /* Actually build the stack frame. */ + + MOV r3, #1 // Build interrupt stack type + STR r3, [r2, #0] // Store stack type + MOV r3, #0 // Build initial register value + STR r3, [r2, #8] // Store initial r0 + STR r3, [r2, #12] // Store initial r1 + STR r3, [r2, #16] // Store initial r2 + STR r3, [r2, #20] // Store initial r3 + STR r3, [r2, #24] // Store initial r4 + STR r3, [r2, #28] // Store initial r5 + STR r3, [r2, #32] // Store initial r6 + STR r3, [r2, #36] // Store initial r7 + STR r3, [r2, #40] // Store initial r8 + STR r3, [r2, #44] // Store initial r9 + LDR r3, [r0, #12] // Pickup stack starting address + STR r3, [r2, #48] // Store initial r10 (sl) + LDR r3,=_tx_thread_schedule // Pickup address of _tx_thread_schedule for GDB backtrace + STR r3, [r2, #60] // Store initial r14 (lr) + MOV r3, #0 // Build initial register value + STR r3, [r2, #52] // Store initial r11 + STR r3, [r2, #56] // Store initial r12 + STR r1, [r2, #64] // Store initial pc + STR r3, [r2, #68] // 0 for back-trace + MRS r1, CPSR // Pickup CPSR + BIC r1, r1, #CPSR_MASK // Mask mode bits of CPSR + ORR r3, r1, #SVC_MODE // Build CPSR, SVC mode, interrupts enabled + STR r3, [r2, #4] // Store initial CPSR + + /* Setup stack pointer. */ + + STR r2, [r0, #8] // Save stack pointer in thread's + // control block #ifdef __THUMB_INTERWORK - BX lr @ Return to caller + BX lr // Return to caller #else - MOV pc, lr @ Return to caller + MOV pc, lr // Return to caller #endif -@} - - diff --git a/ports/cortex_a15/gnu/src/tx_thread_system_return.S b/ports/cortex_a15/gnu/src/tx_thread_system_return.S index 7161edca..cb7d62ce 100644 --- a/ports/cortex_a15/gnu/src/tx_thread_system_return.S +++ b/ports/cortex_a15/gnu/src/tx_thread_system_return.S @@ -1,183 +1,162 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .arm -@ -@ + + .global _tx_thread_current_ptr .global _tx_timer_time_slice .global _tx_thread_schedule - .global _tx_execution_thread_exit -@ -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_system_return for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_system_return for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_system_return .type $_tx_thread_system_return,function $_tx_thread_system_return: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_system_return @ Call _tx_thread_system_return function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_system_return // Call _tx_thread_system_return function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_system_return Cortex-A15/GNU */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is target processor specific. It is used to transfer */ -@/* control from a thread back to the ThreadX system. Only a */ -@/* minimal context is saved since the compiler assumes temp registers */ -@/* are going to get slicked by a function call anyway. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* _tx_thread_schedule Thread scheduling loop */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ThreadX components */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_system_return(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_system_return ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is target processor specific. It is used to transfer */ +/* control from a thread back to the ThreadX system. Only a */ +/* minimal context is saved since the compiler assumes temp registers */ +/* are going to get slicked by a function call anyway. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling loop */ +/* */ +/* CALLED BY */ +/* */ +/* ThreadX components */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_system_return .type _tx_thread_system_return,function _tx_thread_system_return: -@ -@ /* Save minimal context on the stack. */ -@ - STMDB sp!, {r4-r11, lr} @ Save minimal context - LDR r4, =_tx_thread_current_ptr @ Pickup address of current ptr - LDR r5, [r4] @ Pickup current thread pointer - + /* Save minimal context on the stack. */ + + STMDB sp!, {r4-r11, lr} // Save minimal context + + LDR r4, =_tx_thread_current_ptr // Pickup address of current ptr + LDR r5, [r4] // Pickup current thread pointer + #ifdef TX_ENABLE_VFP_SUPPORT - LDR r1, [r5, #144] @ Pickup the VFP enabled flag - CMP r1, #0 @ Is the VFP enabled? - BEQ _tx_skip_solicited_vfp_save @ No, skip VFP solicited save - VMRS r1, FPSCR @ Pickup the FPSCR - STR r1, [sp, #-4]! @ Save FPSCR - VSTMDB sp!, {D16-D31} @ Save D16-D31 - VSTMDB sp!, {D8-D15} @ Save D8-D15 + LDR r1, [r5, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_solicited_vfp_save // No, skip VFP solicited save + VMRS r1, FPSCR // Pickup the FPSCR + STR r1, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D8-D15} // Save D8-D15 _tx_skip_solicited_vfp_save: #endif - MOV r0, #0 @ Build a solicited stack type - MRS r1, CPSR @ Pickup the CPSR - STMDB sp!, {r0-r1} @ Save type and CPSR -@ -@ /* Lockout interrupts. */ -@ -#ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ interrupts -#else - CPSID i @ Disable IRQ interrupts -#endif - -#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the thread exit function to indicate the thread is no longer executing. */ -@ - BL _tx_execution_thread_exit @ Call the thread exit function -#endif - MOV r3, r4 @ Pickup address of current ptr - MOV r0, r5 @ Pickup current thread pointer - LDR r2, =_tx_timer_time_slice @ Pickup address of time slice - LDR r1, [r2] @ Pickup current time slice -@ -@ /* Save current stack and switch to system stack. */ -@ _tx_thread_current_ptr -> tx_thread_stack_ptr = sp; -@ sp = _tx_thread_system_stack_ptr; -@ - STR sp, [r0, #8] @ Save thread stack pointer -@ -@ /* Determine if the time-slice is active. */ -@ if (_tx_timer_time_slice) -@ { -@ - MOV r4, #0 @ Build clear value - CMP r1, #0 @ Is a time-slice active? - BEQ __tx_thread_dont_save_ts @ No, don't save the time-slice -@ -@ /* Save time-slice for the thread and clear the current time-slice. */ -@ _tx_thread_current_ptr -> tx_thread_time_slice = _tx_timer_time_slice; -@ _tx_timer_time_slice = 0; -@ - STR r4, [r2] @ Clear time-slice - STR r1, [r0, #24] @ Save current time-slice -@ -@ } -__tx_thread_dont_save_ts: -@ -@ /* Clear the current thread pointer. */ -@ _tx_thread_current_ptr = TX_NULL; -@ - STR r4, [r3] @ Clear current thread pointer - B _tx_thread_schedule @ Jump to scheduler! -@ -@} + MOV r0, #0 // Build a solicited stack type + MRS r1, CPSR // Pickup the CPSR + STMDB sp!, {r0-r1} // Save type and CPSR + /* Lockout interrupts. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Disable IRQ and FIQ interrupts +#else + CPSID i // Disable IRQ interrupts +#endif + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the thread exit function to indicate the thread is no longer executing. */ + + BL _tx_execution_thread_exit // Call the thread exit function +#endif + MOV r3, r4 // Pickup address of current ptr + MOV r0, r5 // Pickup current thread pointer + LDR r2, =_tx_timer_time_slice // Pickup address of time slice + LDR r1, [r2] // Pickup current time slice + + /* Save current stack and switch to system stack. */ + + STR sp, [r0, #8] // Save thread stack pointer + + /* Determine if the time-slice is active. */ + + MOV r4, #0 // Build clear value + CMP r1, #0 // Is a time-slice active? + BEQ __tx_thread_dont_save_ts // No, don't save the time-slice + + /* Save time-slice for the thread and clear the current time-slice. */ + + STR r4, [r2] // Clear time-slice + STR r1, [r0, #24] // Save current time-slice + +__tx_thread_dont_save_ts: + + /* Clear the current thread pointer. */ + + STR r4, [r3] // Clear current thread pointer + B _tx_thread_schedule // Jump to scheduler! diff --git a/ports/cortex_a15/gnu/src/tx_thread_vectored_context_save.S b/ports/cortex_a15/gnu/src/tx_thread_vectored_context_save.S index 4d4b1ce8..d846223f 100644 --- a/ports/cortex_a15/gnu/src/tx_thread_vectored_context_save.S +++ b/ports/cortex_a15/gnu/src/tx_thread_vectored_context_save.S @@ -1,193 +1,165 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .global _tx_thread_system_state .global _tx_thread_current_ptr .global _tx_execution_isr_enter -@ -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_vectored_context_save -@ since it will never be called 16-bit mode. */ -@ + + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_vectored_context_save + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_vectored_context_save Cortex-A15/GNU */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function saves the context of an executing thread in the */ -@/* beginning of interrupt processing. The function also ensures that */ -@/* the system stack is used upon return to the calling ISR. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_vectored_context_save(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_vectored_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_vectored_context_save .type _tx_thread_vectored_context_save,function _tx_thread_vectored_context_save: -@ -@ /* Upon entry to this routine, it is assumed that IRQ interrupts are locked -@ out, we are in IRQ mode, and all registers are intact. */ -@ -@ /* Check for a nested interrupt condition. */ -@ if (_tx_thread_system_state++) -@ { -@ + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ interrupts + CPSID if // Disable IRQ and FIQ interrupts #endif - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3, #0] @ Pickup system state - CMP r2, #0 @ Is this the first interrupt? - BEQ __tx_thread_not_nested_save @ Yes, not a nested context save -@ -@ /* Nested interrupt condition. */ -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3, #0] @ Store it back in the variable -@ -@ /* Note: Minimal context of interrupted thread is already saved. */ -@ -@ /* Return to the ISR. */ -@ - MOV r10, #0 @ Clear stack limit + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3, #0] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3, #0] // Store it back in the variable + + /* Note: Minimal context of interrupted thread is already saved. */ + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - MOV pc, lr @ Return to caller -@ + MOV pc, lr // Return to caller + __tx_thread_not_nested_save: -@ } -@ -@ /* Otherwise, not nested, check to see if a thread was running. */ -@ else if (_tx_thread_current_ptr) -@ { -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3, #0] @ Store it back in the variable - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1, #0] @ Pickup current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_idle_system_save @ If so, interrupt occurred in - @ scheduling loop - nothing needs saving! -@ -@ /* Note: Minimal context of interrupted thread is already saved. */ -@ -@ /* Save the current stack pointer in the thread's control block. */ -@ _tx_thread_current_ptr -> tx_thread_stack_ptr = sp; -@ -@ /* Switch to the system stack. */ -@ sp = _tx_thread_system_stack_ptr; -@ - MOV r10, #0 @ Clear stack limit + + /* Otherwise, not nested, check to see if a thread was running. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3, #0] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1, #0] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + /* Note: Minimal context of interrupted thread is already saved. */ + + /* Save the current stack pointer in the thread's control block. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - MOV pc, lr @ Return to caller -@ -@ } -@ else -@ { -@ + MOV pc, lr // Return to caller + __tx_thread_idle_system_save: -@ -@ /* Interrupt occurred in the scheduling loop. */ -@ -@ /* Not much to do here, just adjust the stack pointer, and return to IRQ -@ processing. */ -@ - MOV r10, #0 @ Clear stack limit + + /* Interrupt occurred in the scheduling loop. */ + + /* Not much to do here, just adjust the stack pointer, and return to IRQ + processing. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - ADD sp, sp, #32 @ Recover saved registers - MOV pc, lr @ Return to caller -@ -@ } -@} - + ADD sp, sp, #32 // Recover saved registers + MOV pc, lr // Return to caller diff --git a/ports/cortex_a15/gnu/src/tx_timer_interrupt.S b/ports/cortex_a15/gnu/src/tx_timer_interrupt.S index 2b2fc012..7337ed0c 100644 --- a/ports/cortex_a15/gnu/src/tx_timer_interrupt.S +++ b/ports/cortex_a15/gnu/src/tx_timer_interrupt.S @@ -1,40 +1,30 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Timer */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_timer.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Timer */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .arm -@ -@/* Define Assembly language external references... */ -@ + +/* Define Assembly language external references... */ + .global _tx_timer_time_slice .global _tx_timer_system_clock .global _tx_timer_current_ptr @@ -43,237 +33,199 @@ .global _tx_timer_expired_time_slice .global _tx_timer_expired .global _tx_thread_time_slice -@ -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_timer_interrupt for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + + + +/* Define the 16-bit Thumb mode veneer for _tx_timer_interrupt for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .thumb .global $_tx_timer_interrupt .type $_tx_timer_interrupt,function $_tx_timer_interrupt: - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_timer_interrupt @ Call _tx_timer_interrupt function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_timer_interrupt // Call _tx_timer_interrupt function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_timer_interrupt Cortex-A15/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function processes the hardware timer interrupt. This */ -@/* processing includes incrementing the system clock and checking for */ -@/* time slice and/or timer expiration. If either is found, the */ -@/* interrupt context save/restore functions are called along with the */ -@/* expiration functions. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* _tx_thread_time_slice Time slice interrupted thread */ -@/* _tx_timer_expiration_process Timer expiration processing */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* interrupt vector */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_timer_interrupt(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_timer_interrupt ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function processes the hardware timer interrupt. This */ +/* processing includes incrementing the system clock and checking for */ +/* time slice and/or timer expiration. If either is found, the */ +/* interrupt context save/restore functions are called along with the */ +/* expiration functions. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_time_slice Time slice interrupted thread */ +/* _tx_timer_expiration_process Timer expiration processing */ +/* */ +/* CALLED BY */ +/* */ +/* interrupt vector */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_timer_interrupt .type _tx_timer_interrupt,function _tx_timer_interrupt: -@ -@ /* Upon entry to this routine, it is assumed that context save has already -@ been called, and therefore the compiler scratch registers are available -@ for use. */ -@ -@ /* Increment the system clock. */ -@ _tx_timer_system_clock++; -@ - LDR r1, =_tx_timer_system_clock @ Pickup address of system clock - LDR r0, [r1] @ Pickup system clock - ADD r0, r0, #1 @ Increment system clock - STR r0, [r1] @ Store new system clock -@ -@ /* Test for time-slice expiration. */ -@ if (_tx_timer_time_slice) -@ { -@ - LDR r3, =_tx_timer_time_slice @ Pickup address of time-slice - LDR r2, [r3] @ Pickup time-slice - CMP r2, #0 @ Is it non-active? - BEQ __tx_timer_no_time_slice @ Yes, skip time-slice processing -@ -@ /* Decrement the time_slice. */ -@ _tx_timer_time_slice--; -@ - SUB r2, r2, #1 @ Decrement the time-slice - STR r2, [r3] @ Store new time-slice value -@ -@ /* Check for expiration. */ -@ if (__tx_timer_time_slice == 0) -@ - CMP r2, #0 @ Has it expired? - BNE __tx_timer_no_time_slice @ No, skip expiration processing -@ -@ /* Set the time-slice expired flag. */ -@ _tx_timer_expired_time_slice = TX_TRUE; -@ - LDR r3, =_tx_timer_expired_time_slice @ Pickup address of expired flag - MOV r0, #1 @ Build expired value - STR r0, [r3] @ Set time-slice expiration flag -@ -@ } -@ -__tx_timer_no_time_slice: -@ -@ /* Test for timer expiration. */ -@ if (*_tx_timer_current_ptr) -@ { -@ - LDR r1, =_tx_timer_current_ptr @ Pickup current timer pointer address - LDR r0, [r1] @ Pickup current timer - LDR r2, [r0] @ Pickup timer list entry - CMP r2, #0 @ Is there anything in the list? - BEQ __tx_timer_no_timer @ No, just increment the timer -@ -@ /* Set expiration flag. */ -@ _tx_timer_expired = TX_TRUE; -@ - LDR r3, =_tx_timer_expired @ Pickup expiration flag address - MOV r2, #1 @ Build expired value - STR r2, [r3] @ Set expired flag - B __tx_timer_done @ Finished timer processing -@ -@ } -@ else -@ { -__tx_timer_no_timer: -@ -@ /* No timer expired, increment the timer pointer. */ -@ _tx_timer_current_ptr++; -@ - ADD r0, r0, #4 @ Move to next timer -@ -@ /* Check for wraparound. */ -@ if (_tx_timer_current_ptr == _tx_timer_list_end) -@ - LDR r3, =_tx_timer_list_end @ Pickup address of timer list end - LDR r2, [r3] @ Pickup list end - CMP r0, r2 @ Are we at list end? - BNE __tx_timer_skip_wrap @ No, skip wraparound logic -@ -@ /* Wrap to beginning of list. */ -@ _tx_timer_current_ptr = _tx_timer_list_start; -@ - LDR r3, =_tx_timer_list_start @ Pickup address of timer list start - LDR r0, [r3] @ Set current pointer to list start -@ -__tx_timer_skip_wrap: -@ - STR r0, [r1] @ Store new current timer pointer -@ } -@ -__tx_timer_done: -@ -@ -@ /* See if anything has expired. */ -@ if ((_tx_timer_expired_time_slice) || (_tx_timer_expired)) -@ { -@ - LDR r3, =_tx_timer_expired_time_slice @ Pickup address of expired flag - LDR r2, [r3] @ Pickup time-slice expired flag - CMP r2, #0 @ Did a time-slice expire? - BNE __tx_something_expired @ If non-zero, time-slice expired - LDR r1, =_tx_timer_expired @ Pickup address of other expired flag - LDR r0, [r1] @ Pickup timer expired flag - CMP r0, #0 @ Did a timer expire? - BEQ __tx_timer_nothing_expired @ No, nothing expired -@ -__tx_something_expired: -@ -@ - STMDB sp!, {r0, lr} @ Save the lr register on the stack - @ and save r0 just to keep 8-byte alignment -@ -@ /* Did a timer expire? */ -@ if (_tx_timer_expired) -@ { -@ - LDR r1, =_tx_timer_expired @ Pickup address of expired flag - LDR r0, [r1] @ Pickup timer expired flag - CMP r0, #0 @ Check for timer expiration - BEQ __tx_timer_dont_activate @ If not set, skip timer activation -@ -@ /* Process timer expiration. */ -@ _tx_timer_expiration_process(); -@ - BL _tx_timer_expiration_process @ Call the timer expiration handling routine -@ -@ } -__tx_timer_dont_activate: -@ -@ /* Did time slice expire? */ -@ if (_tx_timer_expired_time_slice) -@ { -@ - LDR r3, =_tx_timer_expired_time_slice @ Pickup address of time-slice expired - LDR r2, [r3] @ Pickup the actual flag - CMP r2, #0 @ See if the flag is set - BEQ __tx_timer_not_ts_expiration @ No, skip time-slice processing -@ -@ /* Time slice interrupted thread. */ -@ _tx_thread_time_slice(); -@ - BL _tx_thread_time_slice @ Call time-slice processing -@ -@ } -@ -__tx_timer_not_ts_expiration: -@ - LDMIA sp!, {r0, lr} @ Recover lr register (r0 is just there for - @ the 8-byte stack alignment -@ -@ } -@ -__tx_timer_nothing_expired: -@ -#ifdef __THUMB_INTERWORK - BX lr @ Return to caller -#else - MOV pc, lr @ Return to caller -#endif -@ -@} + /* Upon entry to this routine, it is assumed that context save has already + been called, and therefore the compiler scratch registers are available + for use. */ + + /* Increment the system clock. */ + + LDR r1, =_tx_timer_system_clock // Pickup address of system clock + LDR r0, [r1] // Pickup system clock + ADD r0, r0, #1 // Increment system clock + STR r0, [r1] // Store new system clock + + /* Test for time-slice expiration. */ + + LDR r3, =_tx_timer_time_slice // Pickup address of time-slice + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it non-active? + BEQ __tx_timer_no_time_slice // Yes, skip time-slice processing + + /* Decrement the time_slice. */ + + SUB r2, r2, #1 // Decrement the time-slice + STR r2, [r3] // Store new time-slice value + + /* Check for expiration. */ + + CMP r2, #0 // Has it expired? + BNE __tx_timer_no_time_slice // No, skip expiration processing + + /* Set the time-slice expired flag. */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of expired flag + MOV r0, #1 // Build expired value + STR r0, [r3] // Set time-slice expiration flag + +__tx_timer_no_time_slice: + + /* Test for timer expiration. */ + + LDR r1, =_tx_timer_current_ptr // Pickup current timer pointer address + LDR r0, [r1] // Pickup current timer + LDR r2, [r0] // Pickup timer list entry + CMP r2, #0 // Is there anything in the list? + BEQ __tx_timer_no_timer // No, just increment the timer + + /* Set expiration flag. */ + + LDR r3, =_tx_timer_expired // Pickup expiration flag address + MOV r2, #1 // Build expired value + STR r2, [r3] // Set expired flag + B __tx_timer_done // Finished timer processing + +__tx_timer_no_timer: + + /* No timer expired, increment the timer pointer. */ + ADD r0, r0, #4 // Move to next timer + + /* Check for wraparound. */ + + LDR r3, =_tx_timer_list_end // Pickup address of timer list end + LDR r2, [r3] // Pickup list end + CMP r0, r2 // Are we at list end? + BNE __tx_timer_skip_wrap // No, skip wraparound logic + + /* Wrap to beginning of list. */ + + LDR r3, =_tx_timer_list_start // Pickup address of timer list start + LDR r0, [r3] // Set current pointer to list start + +__tx_timer_skip_wrap: + + STR r0, [r1] // Store new current timer pointer + +__tx_timer_done: + + /* See if anything has expired. */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of expired flag + LDR r2, [r3] // Pickup time-slice expired flag + CMP r2, #0 // Did a time-slice expire? + BNE __tx_something_expired // If non-zero, time-slice expired + LDR r1, =_tx_timer_expired // Pickup address of other expired flag + LDR r0, [r1] // Pickup timer expired flag + CMP r0, #0 // Did a timer expire? + BEQ __tx_timer_nothing_expired // No, nothing expired + +__tx_something_expired: + + STMDB sp!, {r0, lr} // Save the lr register on the stack + // and save r0 just to keep 8-byte alignment + + /* Did a timer expire? */ + + LDR r1, =_tx_timer_expired // Pickup address of expired flag + LDR r0, [r1] // Pickup timer expired flag + CMP r0, #0 // Check for timer expiration + BEQ __tx_timer_dont_activate // If not set, skip timer activation + + /* Process timer expiration. */ + BL _tx_timer_expiration_process // Call the timer expiration handling routine + +__tx_timer_dont_activate: + + /* Did time slice expire? */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of time-slice expired + LDR r2, [r3] // Pickup the actual flag + CMP r2, #0 // See if the flag is set + BEQ __tx_timer_not_ts_expiration // No, skip time-slice processing + + /* Time slice interrupted thread. */ + + BL _tx_thread_time_slice // Call time-slice processing + +__tx_timer_not_ts_expiration: + + LDMIA sp!, {r0, lr} // Recover lr register (r0 is just there for + // the 8-byte stack alignment + +__tx_timer_nothing_expired: + +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a17/ac6/example_build/sample_threadx.c b/ports/cortex_a17/ac6/example_build/sample_threadx.c new file mode 100644 index 00000000..8c61de06 --- /dev/null +++ b/ports/cortex_a17/ac6/example_build/sample_threadx.c @@ -0,0 +1,369 @@ +/* This is a small demo of the high-performance ThreadX kernel. It includes examples of eight + threads of different priorities, using a message queue, semaphore, mutex, event flags group, + byte pool, and block pool. */ + +#include "tx_api.h" + +#define DEMO_STACK_SIZE 1024 +#define DEMO_BYTE_POOL_SIZE 9120 +#define DEMO_BLOCK_POOL_SIZE 100 +#define DEMO_QUEUE_SIZE 100 + + +/* Define the ThreadX object control blocks... */ + +TX_THREAD thread_0; +TX_THREAD thread_1; +TX_THREAD thread_2; +TX_THREAD thread_3; +TX_THREAD thread_4; +TX_THREAD thread_5; +TX_THREAD thread_6; +TX_THREAD thread_7; +TX_QUEUE queue_0; +TX_SEMAPHORE semaphore_0; +TX_MUTEX mutex_0; +TX_EVENT_FLAGS_GROUP event_flags_0; +TX_BYTE_POOL byte_pool_0; +TX_BLOCK_POOL block_pool_0; + + +/* Define the counters used in the demo application... */ + +ULONG thread_0_counter; +ULONG thread_1_counter; +ULONG thread_1_messages_sent; +ULONG thread_2_counter; +ULONG thread_2_messages_received; +ULONG thread_3_counter; +ULONG thread_4_counter; +ULONG thread_5_counter; +ULONG thread_6_counter; +ULONG thread_7_counter; + + +/* Define thread prototypes. */ + +void thread_0_entry(ULONG thread_input); +void thread_1_entry(ULONG thread_input); +void thread_2_entry(ULONG thread_input); +void thread_3_and_4_entry(ULONG thread_input); +void thread_5_entry(ULONG thread_input); +void thread_6_and_7_entry(ULONG thread_input); + + +/* Define main entry point. */ + +int main() +{ + + /* Enter the ThreadX kernel. */ + tx_kernel_enter(); +} + + +/* Define what the initial system looks like. */ + +void tx_application_define(void *first_unused_memory) +{ + +CHAR *pointer = TX_NULL; + + + /* Create a byte memory pool from which to allocate the thread stacks. */ + tx_byte_pool_create(&byte_pool_0, "byte pool 0", first_unused_memory, DEMO_BYTE_POOL_SIZE); + + /* Put system definition stuff in here, e.g. thread creates and other assorted + create information. */ + + /* Allocate the stack for thread 0. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 1, 1, TX_NO_TIME_SLICE, TX_AUTO_START); + + + /* Allocate the stack for thread 1. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create threads 1 and 2. These threads pass information through a ThreadX + message queue. It is also interesting to note that these threads have a time + slice. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, DEMO_STACK_SIZE, + 16, 16, 4, TX_AUTO_START); + + /* Allocate the stack for thread 2. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, DEMO_STACK_SIZE, + 16, 16, 4, TX_AUTO_START); + + /* Allocate the stack for thread 3. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create threads 3 and 4. These threads compete for a ThreadX counting semaphore. + An interesting thing here is that both threads share the same instruction area. */ + tx_thread_create(&thread_3, "thread 3", thread_3_and_4_entry, 3, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 4. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + tx_thread_create(&thread_4, "thread 4", thread_3_and_4_entry, 4, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 5. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create thread 5. This thread simply pends on an event flag which will be set + by thread_0. */ + tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 6. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create threads 6 and 7. These threads compete for a ThreadX mutex. */ + tx_thread_create(&thread_6, "thread 6", thread_6_and_7_entry, 6, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 7. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + tx_thread_create(&thread_7, "thread 7", thread_6_and_7_entry, 7, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the message queue. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_QUEUE_SIZE*sizeof(ULONG), TX_NO_WAIT); + + /* Create the message queue shared by threads 1 and 2. */ + tx_queue_create(&queue_0, "queue 0", TX_1_ULONG, pointer, DEMO_QUEUE_SIZE*sizeof(ULONG)); + + /* Create the semaphore used by threads 3 and 4. */ + tx_semaphore_create(&semaphore_0, "semaphore 0", 1); + + /* Create the event flags group used by threads 1 and 5. */ + tx_event_flags_create(&event_flags_0, "event flags 0"); + + /* Create the mutex used by thread 6 and 7 without priority inheritance. */ + tx_mutex_create(&mutex_0, "mutex 0", TX_NO_INHERIT); + + /* Allocate the memory for a small block pool. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_BLOCK_POOL_SIZE, TX_NO_WAIT); + + /* Create a block memory pool to allocate a message buffer from. */ + tx_block_pool_create(&block_pool_0, "block pool 0", sizeof(ULONG), pointer, DEMO_BLOCK_POOL_SIZE); + + /* Allocate a block and release the block memory. */ + tx_block_allocate(&block_pool_0, (VOID **) &pointer, TX_NO_WAIT); + + /* Release the block back to the pool. */ + tx_block_release(pointer); +} + + + +/* Define the test threads. */ + +void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + + /* This thread simply sits in while-forever-sleep loop. */ + while(1) + { + + /* Increment the thread counter. */ + thread_0_counter++; + + /* Sleep for 10 ticks. */ + tx_thread_sleep(10); + + /* Set event flag 0 to wakeup thread 5. */ + status = tx_event_flags_set(&event_flags_0, 0x1, TX_OR); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + } +} + + +void thread_1_entry(ULONG thread_input) +{ + +UINT status; + + + /* This thread simply sends messages to a queue shared by thread 2. */ + while(1) + { + + /* Increment the thread counter. */ + thread_1_counter++; + + /* Send message to queue 0. */ + status = tx_queue_send(&queue_0, &thread_1_messages_sent, TX_WAIT_FOREVER); + + /* Check completion status. */ + if (status != TX_SUCCESS) + break; + + /* Increment the message sent. */ + thread_1_messages_sent++; + } +} + + +void thread_2_entry(ULONG thread_input) +{ + +ULONG received_message; +UINT status; + + /* This thread retrieves messages placed on the queue by thread 1. */ + while(1) + { + + /* Increment the thread counter. */ + thread_2_counter++; + + /* Retrieve a message from the queue. */ + status = tx_queue_receive(&queue_0, &received_message, TX_WAIT_FOREVER); + + /* Check completion status and make sure the message is what we + expected. */ + if ((status != TX_SUCCESS) || (received_message != thread_2_messages_received)) + break; + + /* Otherwise, all is okay. Increment the received message count. */ + thread_2_messages_received++; + } +} + + +void thread_3_and_4_entry(ULONG thread_input) +{ + +UINT status; + + + /* This function is executed from thread 3 and thread 4. As the loop + below shows, these function compete for ownership of semaphore_0. */ + while(1) + { + + /* Increment the thread counter. */ + if (thread_input == 3) + thread_3_counter++; + else + thread_4_counter++; + + /* Get the semaphore with suspension. */ + status = tx_semaphore_get(&semaphore_0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Sleep for 2 ticks to hold the semaphore. */ + tx_thread_sleep(2); + + /* Release the semaphore. */ + status = tx_semaphore_put(&semaphore_0); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + } +} + + +void thread_5_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_flags; + + + /* This thread simply waits for an event in a forever loop. */ + while(1) + { + + /* Increment the thread counter. */ + thread_5_counter++; + + /* Wait for event flag 0. */ + status = tx_event_flags_get(&event_flags_0, 0x1, TX_OR_CLEAR, + &actual_flags, TX_WAIT_FOREVER); + + /* Check status. */ + if ((status != TX_SUCCESS) || (actual_flags != 0x1)) + break; + } +} + + +void thread_6_and_7_entry(ULONG thread_input) +{ + +UINT status; + + + /* This function is executed from thread 6 and thread 7. As the loop + below shows, these function compete for ownership of mutex_0. */ + while(1) + { + + /* Increment the thread counter. */ + if (thread_input == 6) + thread_6_counter++; + else + thread_7_counter++; + + /* Get the mutex with suspension. */ + status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Get the mutex again with suspension. This shows + that an owning thread may retrieve the mutex it + owns multiple times. */ + status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Sleep for 2 ticks to hold the mutex. */ + tx_thread_sleep(2); + + /* Release the mutex. */ + status = tx_mutex_put(&mutex_0); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Release the mutex again. This will actually + release ownership since it was obtained twice. */ + status = tx_mutex_put(&mutex_0); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + } +} diff --git a/ports/cortex_a17/ac6/example_build/sample_threadx/.cproject b/ports/cortex_a17/ac6/example_build/sample_threadx/.cproject new file mode 100644 index 00000000..6eef9a7b --- /dev/null +++ b/ports/cortex_a17/ac6/example_build/sample_threadx/.cproject @@ -0,0 +1,176 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ports/cortex_a17/ac6/example_build/sample_threadx/.project b/ports/cortex_a17/ac6/example_build/sample_threadx/.project new file mode 100644 index 00000000..ed4c0885 --- /dev/null +++ b/ports/cortex_a17/ac6/example_build/sample_threadx/.project @@ -0,0 +1,27 @@ + + + sample_threadx + + + tx + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + + diff --git a/ports/cortex_a17/ac6/example_build/sample_threadx/sample_threadx.c b/ports/cortex_a17/ac6/example_build/sample_threadx/sample_threadx.c new file mode 100644 index 00000000..8c61de06 --- /dev/null +++ b/ports/cortex_a17/ac6/example_build/sample_threadx/sample_threadx.c @@ -0,0 +1,369 @@ +/* This is a small demo of the high-performance ThreadX kernel. It includes examples of eight + threads of different priorities, using a message queue, semaphore, mutex, event flags group, + byte pool, and block pool. */ + +#include "tx_api.h" + +#define DEMO_STACK_SIZE 1024 +#define DEMO_BYTE_POOL_SIZE 9120 +#define DEMO_BLOCK_POOL_SIZE 100 +#define DEMO_QUEUE_SIZE 100 + + +/* Define the ThreadX object control blocks... */ + +TX_THREAD thread_0; +TX_THREAD thread_1; +TX_THREAD thread_2; +TX_THREAD thread_3; +TX_THREAD thread_4; +TX_THREAD thread_5; +TX_THREAD thread_6; +TX_THREAD thread_7; +TX_QUEUE queue_0; +TX_SEMAPHORE semaphore_0; +TX_MUTEX mutex_0; +TX_EVENT_FLAGS_GROUP event_flags_0; +TX_BYTE_POOL byte_pool_0; +TX_BLOCK_POOL block_pool_0; + + +/* Define the counters used in the demo application... */ + +ULONG thread_0_counter; +ULONG thread_1_counter; +ULONG thread_1_messages_sent; +ULONG thread_2_counter; +ULONG thread_2_messages_received; +ULONG thread_3_counter; +ULONG thread_4_counter; +ULONG thread_5_counter; +ULONG thread_6_counter; +ULONG thread_7_counter; + + +/* Define thread prototypes. */ + +void thread_0_entry(ULONG thread_input); +void thread_1_entry(ULONG thread_input); +void thread_2_entry(ULONG thread_input); +void thread_3_and_4_entry(ULONG thread_input); +void thread_5_entry(ULONG thread_input); +void thread_6_and_7_entry(ULONG thread_input); + + +/* Define main entry point. */ + +int main() +{ + + /* Enter the ThreadX kernel. */ + tx_kernel_enter(); +} + + +/* Define what the initial system looks like. */ + +void tx_application_define(void *first_unused_memory) +{ + +CHAR *pointer = TX_NULL; + + + /* Create a byte memory pool from which to allocate the thread stacks. */ + tx_byte_pool_create(&byte_pool_0, "byte pool 0", first_unused_memory, DEMO_BYTE_POOL_SIZE); + + /* Put system definition stuff in here, e.g. thread creates and other assorted + create information. */ + + /* Allocate the stack for thread 0. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 1, 1, TX_NO_TIME_SLICE, TX_AUTO_START); + + + /* Allocate the stack for thread 1. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create threads 1 and 2. These threads pass information through a ThreadX + message queue. It is also interesting to note that these threads have a time + slice. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, DEMO_STACK_SIZE, + 16, 16, 4, TX_AUTO_START); + + /* Allocate the stack for thread 2. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, DEMO_STACK_SIZE, + 16, 16, 4, TX_AUTO_START); + + /* Allocate the stack for thread 3. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create threads 3 and 4. These threads compete for a ThreadX counting semaphore. + An interesting thing here is that both threads share the same instruction area. */ + tx_thread_create(&thread_3, "thread 3", thread_3_and_4_entry, 3, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 4. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + tx_thread_create(&thread_4, "thread 4", thread_3_and_4_entry, 4, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 5. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create thread 5. This thread simply pends on an event flag which will be set + by thread_0. */ + tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 6. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create threads 6 and 7. These threads compete for a ThreadX mutex. */ + tx_thread_create(&thread_6, "thread 6", thread_6_and_7_entry, 6, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 7. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + tx_thread_create(&thread_7, "thread 7", thread_6_and_7_entry, 7, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the message queue. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_QUEUE_SIZE*sizeof(ULONG), TX_NO_WAIT); + + /* Create the message queue shared by threads 1 and 2. */ + tx_queue_create(&queue_0, "queue 0", TX_1_ULONG, pointer, DEMO_QUEUE_SIZE*sizeof(ULONG)); + + /* Create the semaphore used by threads 3 and 4. */ + tx_semaphore_create(&semaphore_0, "semaphore 0", 1); + + /* Create the event flags group used by threads 1 and 5. */ + tx_event_flags_create(&event_flags_0, "event flags 0"); + + /* Create the mutex used by thread 6 and 7 without priority inheritance. */ + tx_mutex_create(&mutex_0, "mutex 0", TX_NO_INHERIT); + + /* Allocate the memory for a small block pool. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_BLOCK_POOL_SIZE, TX_NO_WAIT); + + /* Create a block memory pool to allocate a message buffer from. */ + tx_block_pool_create(&block_pool_0, "block pool 0", sizeof(ULONG), pointer, DEMO_BLOCK_POOL_SIZE); + + /* Allocate a block and release the block memory. */ + tx_block_allocate(&block_pool_0, (VOID **) &pointer, TX_NO_WAIT); + + /* Release the block back to the pool. */ + tx_block_release(pointer); +} + + + +/* Define the test threads. */ + +void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + + /* This thread simply sits in while-forever-sleep loop. */ + while(1) + { + + /* Increment the thread counter. */ + thread_0_counter++; + + /* Sleep for 10 ticks. */ + tx_thread_sleep(10); + + /* Set event flag 0 to wakeup thread 5. */ + status = tx_event_flags_set(&event_flags_0, 0x1, TX_OR); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + } +} + + +void thread_1_entry(ULONG thread_input) +{ + +UINT status; + + + /* This thread simply sends messages to a queue shared by thread 2. */ + while(1) + { + + /* Increment the thread counter. */ + thread_1_counter++; + + /* Send message to queue 0. */ + status = tx_queue_send(&queue_0, &thread_1_messages_sent, TX_WAIT_FOREVER); + + /* Check completion status. */ + if (status != TX_SUCCESS) + break; + + /* Increment the message sent. */ + thread_1_messages_sent++; + } +} + + +void thread_2_entry(ULONG thread_input) +{ + +ULONG received_message; +UINT status; + + /* This thread retrieves messages placed on the queue by thread 1. */ + while(1) + { + + /* Increment the thread counter. */ + thread_2_counter++; + + /* Retrieve a message from the queue. */ + status = tx_queue_receive(&queue_0, &received_message, TX_WAIT_FOREVER); + + /* Check completion status and make sure the message is what we + expected. */ + if ((status != TX_SUCCESS) || (received_message != thread_2_messages_received)) + break; + + /* Otherwise, all is okay. Increment the received message count. */ + thread_2_messages_received++; + } +} + + +void thread_3_and_4_entry(ULONG thread_input) +{ + +UINT status; + + + /* This function is executed from thread 3 and thread 4. As the loop + below shows, these function compete for ownership of semaphore_0. */ + while(1) + { + + /* Increment the thread counter. */ + if (thread_input == 3) + thread_3_counter++; + else + thread_4_counter++; + + /* Get the semaphore with suspension. */ + status = tx_semaphore_get(&semaphore_0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Sleep for 2 ticks to hold the semaphore. */ + tx_thread_sleep(2); + + /* Release the semaphore. */ + status = tx_semaphore_put(&semaphore_0); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + } +} + + +void thread_5_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_flags; + + + /* This thread simply waits for an event in a forever loop. */ + while(1) + { + + /* Increment the thread counter. */ + thread_5_counter++; + + /* Wait for event flag 0. */ + status = tx_event_flags_get(&event_flags_0, 0x1, TX_OR_CLEAR, + &actual_flags, TX_WAIT_FOREVER); + + /* Check status. */ + if ((status != TX_SUCCESS) || (actual_flags != 0x1)) + break; + } +} + + +void thread_6_and_7_entry(ULONG thread_input) +{ + +UINT status; + + + /* This function is executed from thread 6 and thread 7. As the loop + below shows, these function compete for ownership of mutex_0. */ + while(1) + { + + /* Increment the thread counter. */ + if (thread_input == 6) + thread_6_counter++; + else + thread_7_counter++; + + /* Get the mutex with suspension. */ + status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Get the mutex again with suspension. This shows + that an owning thread may retrieve the mutex it + owns multiple times. */ + status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Sleep for 2 ticks to hold the mutex. */ + tx_thread_sleep(2); + + /* Release the mutex. */ + status = tx_mutex_put(&mutex_0); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Release the mutex again. This will actually + release ownership since it was obtained twice. */ + status = tx_mutex_put(&mutex_0); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + } +} diff --git a/ports/cortex_a17/ac6/example_build/sample_threadx/sample_threadx.launch b/ports/cortex_a17/ac6/example_build/sample_threadx/sample_threadx.launch new file mode 100644 index 00000000..4e7e09b1 --- /dev/null +++ b/ports/cortex_a17/ac6/example_build/sample_threadx/sample_threadx.launch @@ -0,0 +1,188 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ports/cortex_a17/ac6/example_build/sample_threadx/sample_threadx.scat b/ports/cortex_a17/ac6/example_build/sample_threadx/sample_threadx.scat new file mode 100644 index 00000000..d23881cd --- /dev/null +++ b/ports/cortex_a17/ac6/example_build/sample_threadx/sample_threadx.scat @@ -0,0 +1,44 @@ +;******************************************************* +; Copyright (c) 2011-2016 Arm Limited (or its affiliates). All rights reserved. +; Use, modification and redistribution of this file is subject to your possession of a +; valid End User License Agreement for the Arm Product of which these examples are part of +; and your compliance with all applicable terms and conditions of such licence agreement. +;******************************************************* + +; Scatter-file for ARMv7-A bare-metal example on Versatile Express + +; This scatter-file places application code, data, stack and heap at suitable addresses in the memory map. + + +SDRAM 0x80000000 0x20000000 +{ + VECTORS +0 + { + * (VECTORS, +FIRST) ; Vector table and other (assembler) startup code + * (InRoot$$Sections) ; All (library) code that must be in a root region + } + + RO_CODE +0 + { * (+RO-CODE) } ; Application RO code (.text) + + RO_DATA +0 + { * (+RO-DATA) } ; Application RO data (.constdata) + + RW_DATA +0 + { * (+RW) } ; Application RW data (.data) + + ZI_DATA +0 + { * (+ZI) } ; Application ZI data (.bss) + + ARM_LIB_HEAP 0x80040000 EMPTY 0x00040000 ; Application heap + { } + + ARM_LIB_STACK 0x80090000 EMPTY 0x00010000 ; Application (SVC mode) stack + { } + +; IRQ_STACK 0x800A0000 EMPTY -0x00010000 ; IRQ mode stack +; { } + + TTB 0x80100000 EMPTY 0x4000 ; Level-1 Translation Table for MMU + { } +} diff --git a/ports/cortex_a17/ac6/example_build/sample_threadx/startup.S b/ports/cortex_a17/ac6/example_build/sample_threadx/startup.S new file mode 100644 index 00000000..670fadb9 --- /dev/null +++ b/ports/cortex_a17/ac6/example_build/sample_threadx/startup.S @@ -0,0 +1,397 @@ +//---------------------------------------------------------------- +// ARMv7-A Embedded example - Startup Code +// +// Copyright (c) 2005-2018 Arm Limited (or its affiliates). All rights reserved. +// Use, modification and redistribution of this file is subject to your possession of a +// valid End User License Agreement for the Arm Product of which these examples are part of +// and your compliance with all applicable terms and conditions of such licence agreement. +//---------------------------------------------------------------- + +// Standard definitions of mode bits and interrupt (I & F) flags in PSRs + +#define Mode_USR 0x10 +#define Mode_FIQ 0x11 +#define Mode_IRQ 0x12 +#define Mode_SVC 0x13 +#define Mode_ABT 0x17 +#define Mode_UND 0x1B +#define Mode_SYS 0x1F + +#define I_Bit 0x80 // When I bit is set, IRQ is disabled +#define F_Bit 0x40 // When F bit is set, FIQ is disabled + + + .section VECTORS, "ax" + .align 3 + .cfi_sections .debug_frame // put stack frame info into .debug_frame instead of .eh_frame + + +//---------------------------------------------------------------- +// Entry point for the Reset handler +//---------------------------------------------------------------- + + .global Vectors + +//---------------------------------------------------------------- +// Exception Vector Table +//---------------------------------------------------------------- +// Note: LDR PC instructions are used here, though branch (B) instructions +// could also be used, unless the exception handlers are >32MB away. + +Vectors: + LDR PC, Reset_Addr + LDR PC, Undefined_Addr + LDR PC, SVC_Addr + LDR PC, Prefetch_Addr + LDR PC, Abort_Addr + LDR PC, Hypervisor_Addr + LDR PC, IRQ_Addr + LDR PC, FIQ_Addr + + + .balign 4 +Reset_Addr: + .word Reset_Handler +Undefined_Addr: + .word __tx_undefined +SVC_Addr: + .word __tx_swi_interrupt +Prefetch_Addr: + .word __tx_prefetch_handler +Abort_Addr: + .word __tx_abort_handler +Hypervisor_Addr: + .word __tx_reserved_handler +IRQ_Addr: + .word __tx_irq_handler +FIQ_Addr: + .word __tx_fiq_handler + + +//---------------------------------------------------------------- +// Exception Handlers +//---------------------------------------------------------------- + +Undefined_Handler: + B Undefined_Handler +SVC_Handler: + B SVC_Handler +Prefetch_Handler: + B Prefetch_Handler +Abort_Handler: + B Abort_Handler +Hypervisor_Handler: + B Hypervisor_Handler +IRQ_Handler: + B IRQ_Handler +FIQ_Handler: + B FIQ_Handler + + +//---------------------------------------------------------------- +// Reset Handler +//---------------------------------------------------------------- +Reset_Handler: + +//---------------------------------------------------------------- +// Disable caches and MMU in case they were left enabled from an earlier run +// This does not need to be done from a cold reset +//---------------------------------------------------------------- + + MRC p15, 0, r0, c1, c0, 0 // Read System Control Register + BIC r0, r0, #(0x1 << 12) // Clear I bit 12 to disable I Cache + BIC r0, r0, #(0x1 << 2) // Clear C bit 2 to disable D Cache + BIC r0, r0, #0x1 // Clear M bit 0 to disable MMU + BIC r0, r0, #(0x1 << 11) // Clear Z bit 11 to disable branch prediction + MCR p15, 0, r0, c1, c0, 0 // Write System Control Register + ISB + +// The MMU is enabled later, before calling main(). Caches are enabled inside main(), +// after the MMU has been enabled and scatterloading has been performed. + +//---------------------------------------------------------------- +// ACTLR.SMP bit must be set before the caches and MMU are enabled, +// or any cache and TLB maintenance operations are performed, even for single-core +//---------------------------------------------------------------- + MRC p15, 0, r0, c1, c0, 1 // Read ACTLR + ORR r0, r0, #(1 << 6) // Set ACTLR.SMP bit + MCR p15, 0, r0, c1, c0, 1 // Write ACTLR + ISB + +//---------------------------------------------------------------- +// Invalidate Data and Instruction TLBs and branch predictor +// This does not need to be done from a cold reset +//---------------------------------------------------------------- + + MOV r0,#0 + MCR p15, 0, r0, c8, c7, 0 // I-TLB and D-TLB invalidation + MCR p15, 0, r0, c7, c5, 6 // BPIALL - Invalidate entire branch predictor array + +//---------------------------------------------------------------- +// Initialize Supervisor Mode Stack +// Note stack must be 8 byte aligned. +//---------------------------------------------------------------- + + LDR SP, =Image$$ARM_LIB_STACK$$ZI$$Limit + +//---------------------------------------------------------------- +// Disable loop-buffer to fix errata on A15 r0p0 +//---------------------------------------------------------------- + MRC p15, 0, r0, c0, c0, 0 // Read main ID register MIDR + MOV r1, r0, lsr #4 // Extract Primary Part Number + LDR r2, =0xFFF + AND r1, r1, r2 + LDR r2, =0xC0F + CMP r1, r2 // Is this an A15? + BNE notA15r0p0 // Jump if not A15 + AND r5, r0, #0x00f00000 // Variant + AND r6, r0, #0x0000000f // Revision + ORRS r6, r6, r5 // Combine variant and revision + BNE notA15r0p0 // Jump if not r0p0 + MRC p15, 0, r0, c1, c0, 1 // Read Aux Ctrl Reg + ORR r0, r0, #(1 << 1) // Set bit 1 to Disable Loop Buffer + MCR p15, 0, r0, c1, c0, 1 // Write Aux Ctrl Reg + ISB +notA15r0p0: + +//---------------------------------------------------------------- +// Set Vector Base Address Register (VBAR) to point to this application's vector table +//---------------------------------------------------------------- + + LDR r0, =Vectors + MCR p15, 0, r0, c12, c0, 0 + +//---------------------------------------------------------------- +// Cache Invalidation code for ARMv7-A +// The caches, MMU and BTB do not need post-reset invalidation on Cortex-A7, +// but forcing a cache invalidation makes the code more portable to other CPUs (e.g. Cortex-A9) +//---------------------------------------------------------------- + + // Invalidate L1 Instruction Cache + + MRC p15, 1, r0, c0, c0, 1 // Read Cache Level ID Register (CLIDR) + TST r0, #0x3 // Harvard Cache? + MOV r0, #0 // SBZ + MCRNE p15, 0, r0, c7, c5, 0 // ICIALLU - Invalidate instruction cache and flush branch target cache + + // Invalidate Data/Unified Caches + + MRC p15, 1, r0, c0, c0, 1 // Read CLIDR + ANDS r3, r0, #0x07000000 // Extract coherency level + MOV r3, r3, LSR #23 // Total cache levels << 1 + BEQ Finished // If 0, no need to clean + + MOV r10, #0 // R10 holds current cache level << 1 +Loop1: + ADD r2, r10, r10, LSR #1 // R2 holds cache "Set" position + MOV r1, r0, LSR r2 // Bottom 3 bits are the Cache-type for this level + AND r1, r1, #7 // Isolate those lower 3 bits + CMP r1, #2 + BLT Skip // No cache or only instruction cache at this level + + MCR p15, 2, r10, c0, c0, 0 // Write the Cache Size selection register + ISB // ISB to sync the change to the CacheSizeID reg + MRC p15, 1, r1, c0, c0, 0 // Reads current Cache Size ID register + AND r2, r1, #7 // Extract the line length field + ADD r2, r2, #4 // Add 4 for the line length offset (log2 16 bytes) + LDR r4, =0x3FF + ANDS r4, r4, r1, LSR #3 // R4 is the max number on the way size (right aligned) + CLZ r5, r4 // R5 is the bit position of the way size increment + LDR r7, =0x7FFF + ANDS r7, r7, r1, LSR #13 // R7 is the max number of the index size (right aligned) + +Loop2: + MOV r9, r4 // R9 working copy of the max way size (right aligned) + +Loop3: + ORR r11, r10, r9, LSL r5 // Factor in the Way number and cache number into R11 + ORR r11, r11, r7, LSL r2 // Factor in the Set number + MCR p15, 0, r11, c7, c6, 2 // Invalidate by Set/Way + SUBS r9, r9, #1 // Decrement the Way number + BGE Loop3 + SUBS r7, r7, #1 // Decrement the Set number + BGE Loop2 +Skip: + ADD r10, r10, #2 // Increment the cache number + CMP r3, r10 + BGT Loop1 + +Finished: + + +//---------------------------------------------------------------- +// MMU Configuration +// Set translation table base +//---------------------------------------------------------------- + + // Two translation tables are supported, TTBR0 and TTBR1 + // Configure translation table base (TTB) control register cp15,c2 + // to a value of all zeros, indicates we are using TTB register 0. + + MOV r0,#0x0 + MCR p15, 0, r0, c2, c0, 2 + + // write the address of our page table base to TTB register 0 + LDR r0,=Image$$TTB$$ZI$$Base + + MOV r1, #0x08 // RGN=b01 (outer cacheable write-back cached, write allocate) + // S=0 (translation table walk to non-shared memory) + ORR r1,r1,#0x40 // IRGN=b01 (inner cacheability for the translation table walk is Write-back Write-allocate) + + ORR r0,r0,r1 + + MCR p15, 0, r0, c2, c0, 0 + + +//---------------------------------------------------------------- +// PAGE TABLE generation + +// Generate the page tables +// Build a flat translation table for the whole address space. +// ie: Create 4096 1MB sections from 0x000xxxxx to 0xFFFxxxxx + + +// 31 20 19 18 17 16 15 14 12 11 10 9 8 5 4 3 2 1 0 +// |section base address| 0 0 |nG| S |AP2| TEX | AP | P | Domain | XN | C B | 1 0| +// +// Bits[31:20] - Top 12 bits of VA is pointer into table +// nG[17]=0 - Non global, enables matching against ASID in the TLB when set. +// S[16]=0 - Indicates normal memory is shared when set. +// AP2[15]=0 +// AP[11:10]=11 - Configure for full read/write access in all modes +// TEX[14:12]=000 +// CB[3:2]= 00 - Set attributes to Strongly-ordered memory. +// (except for the code segment descriptor, see below) +// IMPP[9]=0 - Ignored +// Domain[5:8]=1111 - Set all pages to use domain 15 +// XN[4]=1 - Execute never on Strongly-ordered memory +// Bits[1:0]=10 - Indicate entry is a 1MB section +//---------------------------------------------------------------- + LDR r0,=Image$$TTB$$ZI$$Base + LDR r1,=0xfff // loop counter + LDR r2,=0b00000000000000000000110111100010 + + // r0 contains the address of the translation table base + // r1 is loop counter + // r2 is level1 descriptor (bits 19:0) + + // use loop counter to create 4096 individual table entries. + // this writes from address 'Image$$TTB$$ZI$$Base' + + // offset 0x3FFC down to offset 0x0 in word steps (4 bytes) + +init_ttb_1: + ORR r3, r2, r1, LSL#20 // R3 now contains full level1 descriptor to write + ORR r3, r3, #0b0000000010000 // Set XN bit + STR r3, [r0, r1, LSL#2] // Str table entry at TTB base + loopcount*4 + SUBS r1, r1, #1 // Decrement loop counter + BPL init_ttb_1 + + // In this example, the 1MB section based at '__code_start' is setup specially as cacheable (write back mode). + // TEX[14:12]=001 and CB[3:2]= 11, Outer and inner write back, write allocate normal memory. + LDR r1,=Image$$VECTORS$$Base // Base physical address of code segment + LSR r1, #20 // Shift right to align to 1MB boundaries + ORR r3, r2, r1, LSL#20 // Setup the initial level1 descriptor again + ORR r3, r3, #0b0000000001100 // Set CB bits + ORR r3, r3, #0b1000000000000 // Set TEX bit 12 + STR r3, [r0, r1, LSL#2] // str table entry + +//---------------------------------------------------------------- +// Setup domain control register - Enable all domains to client mode +//---------------------------------------------------------------- + + MRC p15, 0, r0, c3, c0, 0 // Read Domain Access Control Register + LDR r0, =0x55555555 // Initialize every domain entry to b01 (client) + MCR p15, 0, r0, c3, c0, 0 // Write Domain Access Control Register + +#if defined(__ARM_NEON) || defined(__ARM_FP) +//---------------------------------------------------------------- +// Enable access to NEON/VFP by enabling access to Coprocessors 10 and 11. +// Enables Full Access i.e. in both privileged and non privileged modes +//---------------------------------------------------------------- + + MRC p15, 0, r0, c1, c0, 2 // Read Coprocessor Access Control Register (CPACR) + ORR r0, r0, #(0xF << 20) // Enable access to CP 10 & 11 + MCR p15, 0, r0, c1, c0, 2 // Write Coprocessor Access Control Register (CPACR) + ISB + +//---------------------------------------------------------------- +// Switch on the VFP and NEON hardware +//---------------------------------------------------------------- + + MOV r0, #0x40000000 + VMSR FPEXC, r0 // Write FPEXC register, EN bit set +#endif + + +//---------------------------------------------------------------- +// Enable MMU and branch to __main +// Leaving the caches disabled until after scatter loading. +//---------------------------------------------------------------- + + LDR r12,=__main + + MRC p15, 0, r0, c1, c0, 0 // Read System Control Register + BIC r0, r0, #(0x1 << 12) // Clear I bit 12 to disable I Cache + BIC r0, r0, #(0x1 << 2) // Clear C bit 2 to disable D Cache + BIC r0, r0, #0x2 // Clear A bit 1 to disable strict alignment fault checking + ORR r0, r0, #0x1 // Set M bit 0 to enable MMU before scatter loading + MCR p15, 0, r0, c1, c0, 0 // Write System Control Register + ISB + +// Now the MMU is enabled, virtual to physical address translations will occur. This will affect the next +// instruction fetch. +// +// The two instructions currently in the pipeline will have been fetched before the MMU was enabled. +// The branch to __main is safe because the Virtual Address (VA) is the same as the Physical Address (PA) +// (flat mapping) of this code that enables the MMU and performs the branch + + BX r12 // Branch to __main C library entry point + + + +//---------------------------------------------------------------- +// Enable caches and branch prediction +// This code must be run from a privileged mode +//---------------------------------------------------------------- + + .section ENABLECACHES,"ax" + .align 3 + + .global enable_caches + .type enable_caches, "function" + .cfi_startproc +enable_caches: + +//---------------------------------------------------------------- +// Enable caches and branch prediction +//---------------------------------------------------------------- + + MRC p15, 0, r0, c1, c0, 0 // Read System Control Register + ORR r0, r0, #(0x1 << 12) // Set I bit 12 to enable I Cache + ORR r0, r0, #(0x1 << 2) // Set C bit 2 to enable D Cache + ORR r0, r0, #(0x1 << 11) // Set Z bit 11 to enable branch prediction + MCR p15, 0, r0, c1, c0, 0 // Write System Control Register + ISB + + MRC p15, 0, r0, c1, c0, 1 // Read Auxiliary Control Register + ORR r0, #2 // L2EN bit, enable L2 cache + ORR r0, r0, #(0x1 << 2) // Set DP bit 2 to enable L1 Dside prefetch + MCR p15, 0, r0, c1, c0, 1 // Write Auxiliary Control Register + ISB + + BX lr + .cfi_endproc + + .global disable_caches + .type disable_caches, "function" +disable_caches: + + MRC p15, 0, r0, c1, c0, 0 // Read System Control Register + BIC r0, r0, #(0x1 << 12) // Clear I bit 12 to disable I Cache + BIC r0, r0, #(0x1 << 2) // Clear C bit 2 to disable D Cache + MCR p15, 0, r0, c1, c0, 0 // Write System Control Register + ISB + + BX lr + + diff --git a/ports/cortex_a17/ac6/example_build/sample_threadx/tx_initialize_low_level.S b/ports/cortex_a17/ac6/example_build/sample_threadx/tx_initialize_low_level.S new file mode 100644 index 00000000..715958f0 --- /dev/null +++ b/ports/cortex_a17/ac6/example_build/sample_threadx/tx_initialize_low_level.S @@ -0,0 +1,299 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Initialize */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .arm + +SVC_MODE = 0xD3 // Disable IRQ/FIQ SVC mode +IRQ_MODE = 0xD2 // Disable IRQ/FIQ IRQ mode +FIQ_MODE = 0xD1 // Disable IRQ/FIQ FIQ mode +SYS_MODE = 0xDF // Disable IRQ/FIQ SYS mode +FIQ_STACK_SIZE = 512 // FIQ stack size +IRQ_STACK_SIZE = 1024 // IRQ stack size +SYS_STACK_SIZE = 1024 // System stack size + + .global _tx_thread_system_stack_ptr + .global _tx_initialize_unused_memory + .global _tx_thread_context_save + .global _tx_thread_context_restore + .global _tx_timer_interrupt + + + +/* Define the 16-bit Thumb mode veneer for _tx_initialize_low_level for + applications calling this function from to 16-bit Thumb mode. */ + + .text + .align 2 + .thumb + .global $_tx_initialize_low_level + .type $_tx_initialize_low_level,function +$_tx_initialize_low_level: + BX pc // Switch to 32-bit mode + NOP // + .arm + STMFD sp!, {lr} // Save return address + BL _tx_initialize_low_level // Call _tx_initialize_low_level function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_initialize_low_level ARMV7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for any low-level processor */ +/* initialization, including setting up interrupt vectors, setting */ +/* up a periodic timer interrupt source, saving the system stack */ +/* pointer for use in ISR processing later, and finding the first */ +/* available RAM memory address for tx_application_define. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_initialize_kernel_enter ThreadX entry function */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_initialize_low_level + .type _tx_initialize_low_level,function +_tx_initialize_low_level: + + /* We must be in SVC mode at this point! */ + + /* Setup various stack pointers. */ + + LDR r1, =Image$$ARM_LIB_STACK$$ZI$$Limit // Get pointer to stack area + +#ifdef TX_ENABLE_IRQ_NESTING + + /* Setup the system mode stack for nested interrupt support */ + + LDR r2, =SYS_STACK_SIZE // Pickup stack size + MOV r3, #SYS_MODE // Build SYS mode CPSR + MSR CPSR_c, r3 // Enter SYS mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup SYS stack pointer + SUB r1, r1, r2 // Calculate start of next stack +#endif + + LDR r2, =FIQ_STACK_SIZE // Pickup stack size + MOV r0, #FIQ_MODE // Build FIQ mode CPSR + MSR CPSR, r0 // Enter FIQ mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup FIQ stack pointer + SUB r1, r1, r2 // Calculate start of next stack + LDR r2, =IRQ_STACK_SIZE // Pickup IRQ stack size + MOV r0, #IRQ_MODE // Build IRQ mode CPSR + MSR CPSR, r0 // Enter IRQ mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup IRQ stack pointer + SUB r3, r1, r2 // Calculate end of IRQ stack + MOV r0, #SVC_MODE // Build SVC mode CPSR + MSR CPSR, r0 // Enter SVC mode + LDR r2, =Image$$ARM_LIB_STACK$$Base // Pickup stack bottom + CMP r3, r2 // Compare the current stack end with the bottom +_stack_error_loop: + BLT _stack_error_loop // If the IRQ stack exceeds the stack bottom, just sit here! + + LDR r2, =_tx_thread_system_stack_ptr // Pickup stack pointer + STR r1, [r2] // Save the system stack + + LDR r1, =Image$$ZI_DATA$$ZI$$Limit // Get end of non-initialized RAM area + LDR r2, =_tx_initialize_unused_memory // Pickup unused memory ptr address + ADD r1, r1, #8 // Increment to next free word + STR r1, [r2] // Save first free memory address + +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif + +/* Define shells for each of the interrupt vectors. */ + + .global __tx_undefined +__tx_undefined: + B __tx_undefined // Undefined handler + + .global __tx_swi_interrupt +__tx_swi_interrupt: + B __tx_swi_interrupt // Software interrupt handler + + .global __tx_prefetch_handler +__tx_prefetch_handler: + B __tx_prefetch_handler // Prefetch exception handler + + .global __tx_abort_handler +__tx_abort_handler: + B __tx_abort_handler // Abort exception handler + + .global __tx_reserved_handler +__tx_reserved_handler: + B __tx_reserved_handler // Reserved exception handler + + .global __tx_irq_processing_return + .type __tx_irq_processing_return,function + .global __tx_irq_handler +__tx_irq_handler: + + /* Jump to context save to save system context. */ + B _tx_thread_context_save +__tx_irq_processing_return: + + /* At this point execution is still in the IRQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. In + addition, IRQ interrupts may be re-enabled - with certain restrictions - + if nested IRQ interrupts are desired. Interrupts may be re-enabled over + small code sequences where lr is saved before enabling interrupts and + restored after interrupts are again disabled. */ + + /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start + from IRQ mode with interrupts disabled. This routine switches to the + system mode and returns with IRQ interrupts enabled. + + NOTE: It is very important to ensure all IRQ interrupts are cleared + prior to enabling nested IRQ interrupts. */ +#ifdef TX_ENABLE_IRQ_NESTING + BL _tx_thread_irq_nesting_start +#endif + + /* For debug purpose, execute the timer interrupt processing here. In + a real system, some kind of status indication would have to be checked + before the timer interrupt handler could be called. */ + + BL _tx_timer_interrupt // Timer interrupt handler + + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_context_restore. + This routine returns in processing in IRQ mode with interrupts disabled. */ +#ifdef TX_ENABLE_IRQ_NESTING + BL _tx_thread_irq_nesting_end +#endif + + /* Jump to context restore to restore system context. */ + B _tx_thread_context_restore + + + /* This is an example of a vectored IRQ handler. */ + + /* At this point execution is still in the IRQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. In + addition, IRQ interrupts may be re-enabled - with certain restrictions - + if nested IRQ interrupts are desired. Interrupts may be re-enabled over + small code sequences where lr is saved before enabling interrupts and + restored after interrupts are again disabled. */ + + + /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start + from IRQ mode with interrupts disabled. This routine switches to the + system mode and returns with IRQ interrupts enabled. + + NOTE: It is very important to ensure all IRQ interrupts are cleared + prior to enabling nested IRQ interrupts. */ + + /* Application IRQ handlers can be called here! */ + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_context_restore. + This routine returns in processing in IRQ mode with interrupts disabled. */ + + /* Jump to context restore to restore system context. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + .global __tx_fiq_handler + .global __tx_fiq_processing_return +__tx_fiq_handler: + + /* Jump to fiq context save to save system context. */ + B _tx_thread_fiq_context_save +__tx_fiq_processing_return: + + /* At this point execution is still in the FIQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. */ + + /* Interrupt nesting is allowed after calling _tx_thread_fiq_nesting_start + from FIQ mode with interrupts disabled. This routine switches to the + system mode and returns with FIQ interrupts enabled. + + NOTE: It is very important to ensure all FIQ interrupts are cleared + prior to enabling nested FIQ interrupts. */ +#ifdef TX_ENABLE_FIQ_NESTING + BL _tx_thread_fiq_nesting_start +#endif + + /* Application FIQ handlers can be called here! */ + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_fiq_context_restore. */ +#ifdef TX_ENABLE_FIQ_NESTING + BL _tx_thread_fiq_nesting_end +#endif + + /* Jump to fiq context restore to restore system context. */ + B _tx_thread_fiq_context_restore + + +#else + .global __tx_fiq_handler +__tx_fiq_handler: + B __tx_fiq_handler // FIQ interrupt handler +#endif + + +BUILD_OPTIONS: + .word _tx_build_options // Reference to bring in +VERSION_ID: + .word _tx_version_id // Reference to bring in + + diff --git a/ports/cortex_a17/ac6/example_build/tx/.cproject b/ports/cortex_a17/ac6/example_build/tx/.cproject new file mode 100644 index 00000000..93fc2931 --- /dev/null +++ b/ports/cortex_a17/ac6/example_build/tx/.cproject @@ -0,0 +1,146 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ports/cortex_a17/ac6/example_build/tx/.project b/ports/cortex_a17/ac6/example_build/tx/.project new file mode 100644 index 00000000..863ca5cb --- /dev/null +++ b/ports/cortex_a17/ac6/example_build/tx/.project @@ -0,0 +1,48 @@ + + + tx + + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + + + + inc_generic + 2 + $%7BPARENT-5-PROJECT_LOC%7D/common/inc + + + inc_port + 2 + $%7BPARENT-2-PROJECT_LOC%7D/inc + + + src_generic + 2 + $%7BPARENT-5-PROJECT_LOC%7D/common/src + + + src_port + 2 + $%7BPARENT-2-PROJECT_LOC%7D/src + + + diff --git a/ports/cortex_a17/ac6/inc/tx_port.h b/ports/cortex_a17/ac6/inc/tx_port.h new file mode 100644 index 00000000..19463de1 --- /dev/null +++ b/ports/cortex_a17/ac6/inc/tx_port.h @@ -0,0 +1,328 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Port Specific */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* tx_port.h ARMv7-A */ +/* 6.1.11 */ +/* */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This file contains data type definitions that make the ThreadX */ +/* real-time kernel function identically on a variety of different */ +/* processor architectures. For example, the size or number of bits */ +/* in an "int" data type vary between microprocessor architectures and */ +/* even C compilers for the same microprocessor. ThreadX does not */ +/* directly use native C data types. Instead, ThreadX creates its */ +/* own special types that can be mapped to actual data types by this */ +/* file to guarantee consistency in the interface and functionality. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-02-2021 Bhupendra Naphade Modified comment(s),updated */ +/* macro definition, */ +/* resulting in version 6.1.6 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + +#ifndef TX_PORT_H +#define TX_PORT_H + + +/* Determine if the optional ThreadX user define file should be used. */ + +#ifdef TX_INCLUDE_USER_DEFINE_FILE + + +/* Yes, include the user defines in tx_user.h. The defines in this file may + alternately be defined on the command line. */ + +#include "tx_user.h" +#endif + + +/* Define compiler library include files. */ + +#include +#include + + +/* Define ThreadX basic types for this port. */ + +#define VOID void +typedef char CHAR; +typedef unsigned char UCHAR; +typedef int INT; +typedef unsigned int UINT; +typedef long LONG; +typedef unsigned long ULONG; +typedef short SHORT; +typedef unsigned short USHORT; + + +/* Define the priority levels for ThreadX. Legal values range + from 32 to 1024 and MUST be evenly divisible by 32. */ + +#ifndef TX_MAX_PRIORITIES +#define TX_MAX_PRIORITIES 32 +#endif + + +/* Define the minimum stack for a ThreadX thread on this processor. If the size supplied during + thread creation is less than this value, the thread create call will return an error. */ + +#ifndef TX_MINIMUM_STACK +#define TX_MINIMUM_STACK 200 /* Minimum stack size for this port */ +#endif + + +/* Define the system timer thread's default stack size and priority. These are only applicable + if TX_TIMER_PROCESS_IN_ISR is not defined. */ + +#ifndef TX_TIMER_THREAD_STACK_SIZE +#define TX_TIMER_THREAD_STACK_SIZE 1024 /* Default timer thread stack size */ +#endif + +#ifndef TX_TIMER_THREAD_PRIORITY +#define TX_TIMER_THREAD_PRIORITY 0 /* Default timer thread priority */ +#endif + + +/* Define various constants for the ThreadX ARM port. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT +#define TX_INT_DISABLE 0xC0 /* Disable IRQ & FIQ interrupts */ +#else +#define TX_INT_DISABLE 0x80 /* Disable IRQ interrupts */ +#endif +#define TX_INT_ENABLE 0x00 /* Enable IRQ interrupts */ + + +/* Define the clock source for trace event entry time stamp. The following two item are port specific. + For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock + source constants would be: + +#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_MASK 0x0000FFFFUL + +*/ + +#ifndef TX_TRACE_TIME_SOURCE +#define TX_TRACE_TIME_SOURCE ++_tx_trace_simulated_time +#endif +#ifndef TX_TRACE_TIME_MASK +#define TX_TRACE_TIME_MASK 0xFFFFFFFFUL +#endif + + +/* Define the port specific options for the _tx_build_options variable. This variable indicates + how the ThreadX library was built. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT +#define TX_FIQ_ENABLED 1 +#else +#define TX_FIQ_ENABLED 0 +#endif + +#ifdef TX_ENABLE_IRQ_NESTING +#define TX_IRQ_NESTING_ENABLED 2 +#else +#define TX_IRQ_NESTING_ENABLED 0 +#endif + +#ifdef TX_ENABLE_FIQ_NESTING +#define TX_FIQ_NESTING_ENABLED 4 +#else +#define TX_FIQ_NESTING_ENABLED 0 +#endif + +#define TX_PORT_SPECIFIC_BUILD_OPTIONS TX_FIQ_ENABLED | TX_IRQ_NESTING_ENABLED | TX_FIQ_NESTING_ENABLED + + +/* Define the in-line initialization constant so that modules with in-line + initialization capabilities can prevent their initialization from being + a function call. */ + +#define TX_INLINE_INITIALIZATION + + +/* Determine whether or not stack checking is enabled. By default, ThreadX stack checking is + disabled. When the following is defined, ThreadX thread stack checking is enabled. If stack + checking is enabled (TX_ENABLE_STACK_CHECKING is defined), the TX_DISABLE_STACK_FILLING + define is negated, thereby forcing the stack fill which is necessary for the stack checking + logic. */ + +#ifdef TX_ENABLE_STACK_CHECKING +#undef TX_DISABLE_STACK_FILLING +#endif + + +/* Define the TX_THREAD control block extensions for this port. The main reason + for the multiple macros is so that backward compatibility can be maintained with + existing ThreadX kernel awareness modules. */ + +#define TX_THREAD_EXTENSION_0 +#define TX_THREAD_EXTENSION_1 +#define TX_THREAD_EXTENSION_2 ULONG tx_thread_vfp_enable; +#define TX_THREAD_EXTENSION_3 + + +/* Define the port extensions of the remaining ThreadX objects. */ + +#define TX_BLOCK_POOL_EXTENSION +#define TX_BYTE_POOL_EXTENSION +#define TX_EVENT_FLAGS_GROUP_EXTENSION +#define TX_MUTEX_EXTENSION +#define TX_QUEUE_EXTENSION +#define TX_SEMAPHORE_EXTENSION +#define TX_TIMER_EXTENSION + + +/* Define the user extension field of the thread control block. Nothing + additional is needed for this port so it is defined as white space. */ + +#ifndef TX_THREAD_USER_EXTENSION +#define TX_THREAD_USER_EXTENSION +#endif + + +/* Define the macros for processing extensions in tx_thread_create, tx_thread_delete, + tx_thread_shell_entry, and tx_thread_terminate. */ + + +#define TX_THREAD_CREATE_EXTENSION(thread_ptr) +#define TX_THREAD_DELETE_EXTENSION(thread_ptr) +#define TX_THREAD_COMPLETED_EXTENSION(thread_ptr) +#define TX_THREAD_TERMINATED_EXTENSION(thread_ptr) + + +/* Define the ThreadX object creation extensions for the remaining objects. */ + +#define TX_BLOCK_POOL_CREATE_EXTENSION(pool_ptr) +#define TX_BYTE_POOL_CREATE_EXTENSION(pool_ptr) +#define TX_EVENT_FLAGS_GROUP_CREATE_EXTENSION(group_ptr) +#define TX_MUTEX_CREATE_EXTENSION(mutex_ptr) +#define TX_QUEUE_CREATE_EXTENSION(queue_ptr) +#define TX_SEMAPHORE_CREATE_EXTENSION(semaphore_ptr) +#define TX_TIMER_CREATE_EXTENSION(timer_ptr) + + +/* Define the ThreadX object deletion extensions for the remaining objects. */ + +#define TX_BLOCK_POOL_DELETE_EXTENSION(pool_ptr) +#define TX_BYTE_POOL_DELETE_EXTENSION(pool_ptr) +#define TX_EVENT_FLAGS_GROUP_DELETE_EXTENSION(group_ptr) +#define TX_MUTEX_DELETE_EXTENSION(mutex_ptr) +#define TX_QUEUE_DELETE_EXTENSION(queue_ptr) +#define TX_SEMAPHORE_DELETE_EXTENSION(semaphore_ptr) +#define TX_TIMER_DELETE_EXTENSION(timer_ptr) + + +/* Determine if the ARM architecture has the CLZ instruction. This is available on + architectures v5 and above. If available, redefine the macro for calculating the + lowest bit set. */ + +#if __TARGET_ARCH_ARM > 4 + +#ifndef __thumb__ + +#define TX_LOWEST_SET_BIT_CALCULATE(m, b) m = m & ((ULONG) (-((LONG) m))); \ + asm volatile (" CLZ %0,%1 ": "=r" (b) : "r" (m) ); \ + b = 31 - b; +#endif +#endif + + +/* Define ThreadX interrupt lockout and restore macros for protection on + access of critical kernel information. The restore interrupt macro must + restore the interrupt posture of the running thread prior to the value + present prior to the disable macro. In most cases, the save area macro + is used to define a local function save area for the disable and restore + macros. */ + +#ifdef __thumb__ + +unsigned int _tx_thread_interrupt_disable(void); +unsigned int _tx_thread_interrupt_restore(UINT old_posture); + + +#define TX_INTERRUPT_SAVE_AREA UINT interrupt_save; + +#define TX_DISABLE interrupt_save = _tx_thread_interrupt_disable(); +#define TX_RESTORE _tx_thread_interrupt_restore(interrupt_save); + +#else + +#define TX_INTERRUPT_SAVE_AREA UINT interrupt_save, tx_temp; + +#ifdef TX_ENABLE_FIQ_SUPPORT +#define TX_DISABLE asm volatile (" MRS %0,CPSR; CPSID if ": "=r" (interrupt_save) ); +#else +#define TX_DISABLE asm volatile (" MRS %0,CPSR; CPSID i ": "=r" (interrupt_save) ); +#endif + +#define TX_RESTORE asm volatile (" MSR CPSR_c,%0 "::"r" (interrupt_save) ); + +#endif + + +/* Define VFP extension for the ARMv7-A. Each is assumed to be called in the context of the executing + thread. */ + +void tx_thread_vfp_enable(void); +void tx_thread_vfp_disable(void); + + +/* Define the interrupt lockout macros for each ThreadX object. */ + +#define TX_BLOCK_POOL_DISABLE TX_DISABLE +#define TX_BYTE_POOL_DISABLE TX_DISABLE +#define TX_EVENT_FLAGS_GROUP_DISABLE TX_DISABLE +#define TX_MUTEX_DISABLE TX_DISABLE +#define TX_QUEUE_DISABLE TX_DISABLE +#define TX_SEMAPHORE_DISABLE TX_DISABLE + + +/* Define the version ID of ThreadX. This may be utilized by the application. */ + +#ifdef TX_THREAD_INIT +CHAR _tx_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX ARMv7-A Version 6.1.11 *"; +#else +extern CHAR _tx_version_id[]; +#endif + + +#endif + diff --git a/ports/cortex_a17/ac6/src/tx_thread_context_restore.S b/ports/cortex_a17/ac6/src/tx_thread_context_restore.S new file mode 100644 index 00000000..fae7e72d --- /dev/null +++ b/ports/cortex_a17/ac6/src/tx_thread_context_restore.S @@ -0,0 +1,222 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .arm + +#ifdef TX_ENABLE_FIQ_SUPPORT +SVC_MODE = 0xD3 // Disable IRQ/FIQ, SVC mode +IRQ_MODE = 0xD2 // Disable IRQ/FIQ, IRQ mode +#else +SVC_MODE = 0x93 // Disable IRQ, SVC mode +IRQ_MODE = 0x92 // Disable IRQ, IRQ mode +#endif + + .global _tx_thread_system_state + .global _tx_thread_current_ptr + .global _tx_thread_execute_ptr + .global _tx_timer_time_slice + .global _tx_thread_schedule + .global _tx_thread_preempt_disable + + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_restore + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_context_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function restores the interrupt context if it is processing a */ +/* nested interrupt. If not, it returns to the interrupt thread if no */ +/* preemption is necessary. Otherwise, if preemption is necessary or */ +/* if no thread was running, the function returns to the scheduler. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling routine */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs Interrupt Service Routines */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_context_restore + .type _tx_thread_context_restore,function +_tx_thread_context_restore: + + /* Lockout interrupts. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Disable IRQ and FIQ interrupts +#else + CPSID i // Disable IRQ interrupts +#endif + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR exit function to indicate an ISR is complete. */ + + BL _tx_execution_isr_exit // Call the ISR exit function +#endif + + /* Determine if interrupts are nested. */ + + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + SUB r2, r2, #1 // Decrement the counter + STR r2, [r3] // Store the counter + CMP r2, #0 // Was this the first interrupt? + BEQ __tx_thread_not_nested_restore // If so, not a nested restore + + /* Interrupts are nested. */ + + /* Just recover the saved registers and return to the point of + interrupt. */ + + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_not_nested_restore: + + /* Determine if a thread was interrupted and no preemption is required. */ + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup actual current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_restore // Yes, idle system was interrupted + + LDR r3, =_tx_thread_preempt_disable // Pickup preempt disable address + LDR r2, [r3] // Pickup actual preempt disable flag + CMP r2, #0 // Is it set? + BNE __tx_thread_no_preempt_restore // Yes, don't preempt this thread + LDR r3, =_tx_thread_execute_ptr // Pickup address of execute thread ptr + LDR r2, [r3] // Pickup actual execute thread pointer + CMP r0, r2 // Is the same thread highest priority? + BNE __tx_thread_preempt_restore // No, preemption needs to happen + + +__tx_thread_no_preempt_restore: + + /* Recover the saved context and return to the point of interrupt. */ + + /* Pickup the saved stack pointer. */ + + /* Recover the saved context and return to the point of interrupt. */ + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_preempt_restore: + + LDMIA sp!, {r3, r10, r12, lr} // Recover temporarily saved registers + MOV r1, lr // Save lr (point of interrupt) + MOV r2, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r2 // Enter SVC mode + STR r1, [sp, #-4]! // Save point of interrupt + STMDB sp!, {r4-r12, lr} // Save upper half of registers + MOV r4, r3 // Save SPSR in r4 + MOV r2, #IRQ_MODE // Build IRQ mode CPSR + MSR CPSR_c, r2 // Enter IRQ mode + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOV r5, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r5 // Enter SVC mode + STMDB sp!, {r0-r3} // Save r0-r3 on thread's stack + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer + +#ifdef TX_ENABLE_VFP_SUPPORT + LDR r2, [r0, #144] // Pickup the VFP enabled flag + CMP r2, #0 // Is the VFP enabled? + BEQ _tx_skip_irq_vfp_save // No, skip VFP IRQ save + VMRS r2, FPSCR // Pickup the FPSCR + STR r2, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D0-D15} // Save D0-D15 + +_tx_skip_irq_vfp_save: + +#endif + + MOV r3, #1 // Build interrupt stack type + STMDB sp!, {r3, r4} // Save interrupt stack type and SPSR + STR sp, [r0, #8] // Save stack pointer in thread control + // block + + /* Save the remaining time-slice and disable it. */ + LDR r3, =_tx_timer_time_slice // Pickup time-slice variable address + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it active? + BEQ __tx_thread_dont_save_ts // No, don't save it + STR r2, [r0, #24] // Save thread's time-slice + MOV r2, #0 // Clear value + STR r2, [r3] // Disable global time-slice flag + +__tx_thread_dont_save_ts: + + /* Clear the current task pointer. */ + MOV r0, #0 // NULL value + STR r0, [r1] // Clear current thread pointer + + /* Return to the scheduler. */ + B _tx_thread_schedule // Return to scheduler + +__tx_thread_idle_system_restore: + + /* Just return back to the scheduler! */ + MOV r0, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r0 // Enter SVC mode + B _tx_thread_schedule // Return to scheduler diff --git a/ports/cortex_a17/ac6/src/tx_thread_context_save.S b/ports/cortex_a17/ac6/src/tx_thread_context_save.S new file mode 100644 index 00000000..7ac48c2e --- /dev/null +++ b/ports/cortex_a17/ac6/src/tx_thread_context_save.S @@ -0,0 +1,172 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .global _tx_thread_system_state + .global _tx_thread_current_ptr + .global __tx_irq_processing_return + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_save + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_context_save + .type _tx_thread_context_save,function +_tx_thread_context_save: + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + + STMDB sp!, {r0-r3} // Save some working registers +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Disable FIQ interrupts +#endif + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + + /* Save the rest of the scratch registers on the stack and return to the + calling ISR. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, r10, r12, lr} // Store other registers + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + B __tx_irq_processing_return // Continue IRQ processing + +__tx_thread_not_nested_save: + + /* Otherwise, not nested, check to see if a thread was running. */ + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + + /* Save minimal context of interrupted thread. */ + + MRS r2, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r2, r10, r12, lr} // Store other registers + + MOV r10, #0 // Clear stack limit + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + B __tx_irq_processing_return // Continue IRQ processing + +__tx_thread_idle_system_save: + + /* Interrupt occurred in the scheduling loop. */ + + /* Not much to do here, just adjust the stack pointer, and return to IRQ + processing. */ + + MOV r10, #0 // Clear stack limit + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + ADD sp, sp, #16 // Recover saved registers + B __tx_irq_processing_return // Continue IRQ processing diff --git a/ports/cortex_a17/ac6/src/tx_thread_fiq_context_restore.S b/ports/cortex_a17/ac6/src/tx_thread_fiq_context_restore.S new file mode 100644 index 00000000..006be973 --- /dev/null +++ b/ports/cortex_a17/ac6/src/tx_thread_fiq_context_restore.S @@ -0,0 +1,223 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +SVC_MODE = 0xD3 // SVC mode +FIQ_MODE = 0xD1 // FIQ mode +MODE_MASK = 0x1F // Mode mask +THUMB_MASK = 0x20 // Thumb bit mask +IRQ_MODE_BITS = 0x12 // IRQ mode bits + + + .global _tx_thread_system_state + .global _tx_thread_current_ptr + .global _tx_thread_system_stack_ptr + .global _tx_thread_execute_ptr + .global _tx_timer_time_slice + .global _tx_thread_schedule + .global _tx_thread_preempt_disable + .global _tx_execution_isr_exit + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_restore + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_context_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function restores the fiq interrupt context when processing a */ +/* nested interrupt. If not, it returns to the interrupt thread if no */ +/* preemption is necessary. Otherwise, if preemption is necessary or */ +/* if no thread was running, the function returns to the scheduler. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling routine */ +/* */ +/* CALLED BY */ +/* */ +/* FIQ ISR Interrupt Service Routines */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_fiq_context_restore + .type _tx_thread_fiq_context_restore,function +_tx_thread_fiq_context_restore: + + /* Lockout interrupts. */ + + CPSID if // Disable IRQ and FIQ interrupts + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR exit function to indicate an ISR is complete. */ + + BL _tx_execution_isr_exit // Call the ISR exit function +#endif + + /* Determine if interrupts are nested. */ + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + SUB r2, r2, #1 // Decrement the counter + STR r2, [r3] // Store the counter + CMP r2, #0 // Was this the first interrupt? + BEQ __tx_thread_fiq_not_nested_restore // If so, not a nested restore + + /* Interrupts are nested. */ + + /* Just recover the saved registers and return to the point of + interrupt. */ + + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_fiq_not_nested_restore: + + /* Determine if a thread was interrupted and no preemption is required. */ + + LDR r1, [sp] // Pickup the saved SPSR + MOV r2, #MODE_MASK // Build mask to isolate the interrupted mode + AND r1, r1, r2 // Isolate mode bits + CMP r1, #IRQ_MODE_BITS // Was an interrupt taken in IRQ mode before we + // got to context save? */ + BEQ __tx_thread_fiq_no_preempt_restore // Yes, just go back to point of interrupt + + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup actual current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_fiq_idle_system_restore // Yes, idle system was interrupted + + LDR r3, =_tx_thread_preempt_disable // Pickup preempt disable address + LDR r2, [r3] // Pickup actual preempt disable flag + CMP r2, #0 // Is it set? + BNE __tx_thread_fiq_no_preempt_restore // Yes, don't preempt this thread + LDR r3, =_tx_thread_execute_ptr // Pickup address of execute thread ptr + LDR r2, [r3] // Pickup actual execute thread pointer + CMP r0, r2 // Is the same thread highest priority? + BNE __tx_thread_fiq_preempt_restore // No, preemption needs to happen + + +__tx_thread_fiq_no_preempt_restore: + + /* Restore interrupted thread or ISR. */ + /* Recover the saved context and return to the point of interrupt. */ + + LDMIA sp!, {r0, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_fiq_preempt_restore: + + LDMIA sp!, {r3, lr} // Recover temporarily saved registers + MOV r1, lr // Save lr (point of interrupt) + MOV r2, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r2 // Enter SVC mode + STR r1, [sp, #-4]! // Save point of interrupt + STMDB sp!, {r4-r12, lr} // Save upper half of registers + MOV r4, r3 // Save SPSR in r4 + MOV r2, #FIQ_MODE // Build FIQ mode CPSR + MSR CPSR_c, r2 // Reenter FIQ mode + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOV r5, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r5 // Enter SVC mode + STMDB sp!, {r0-r3} // Save r0-r3 on thread's stack + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer + +#ifdef TX_ENABLE_VFP_SUPPORT + LDR r2, [r0, #144] // Pickup the VFP enabled flag + CMP r2, #0 // Is the VFP enabled? + BEQ _tx_skip_fiq_vfp_save // No, skip VFP IRQ save + VMRS r2, FPSCR // Pickup the FPSCR + STR r2, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D0-D15} // Save D0-D15 +_tx_skip_fiq_vfp_save: +#endif + + MOV r3, #1 // Build interrupt stack type + STMDB sp!, {r3, r4} // Save interrupt stack type and SPSR + STR sp, [r0, #8] // Save stack pointer in thread control + // block */ + LDR r3, =_tx_timer_time_slice // Pickup time-slice variable address + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it active? + BEQ __tx_thread_fiq_dont_save_ts // No, don't save it + + STR r2, [r0, #24] // Save thread's time-slice + MOV r2, #0 // Clear value + STR r2, [r3] // Disable global time-slice flag + +__tx_thread_fiq_dont_save_ts: + + /* Clear the current task pointer. */ + + MOV r0, #0 // NULL value + STR r0, [r1] // Clear current thread pointer + + /* Return to the scheduler. */ + + B _tx_thread_schedule // Return to scheduler + +__tx_thread_fiq_idle_system_restore: + + /* Just return back to the scheduler! */ + + ADD sp, sp, #24 // Recover FIQ stack space + MOV r3, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r3 // Lockout interrupts + B _tx_thread_schedule // Return to scheduler + diff --git a/ports/cortex_a17/ac6/src/tx_thread_fiq_context_save.S b/ports/cortex_a17/ac6/src/tx_thread_fiq_context_save.S new file mode 100644 index 00000000..7db6a4c2 --- /dev/null +++ b/ports/cortex_a17/ac6/src/tx_thread_fiq_context_save.S @@ -0,0 +1,178 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .global _tx_thread_system_state + .global _tx_thread_current_ptr + .global __tx_fiq_processing_return + .global _tx_execution_isr_enter + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_save + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_fiq_context_save + .type _tx_thread_fiq_context_save,function +_tx_thread_fiq_context_save: + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + + STMDB sp!, {r0-r3} // Save some working registers + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_fiq_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + + /* Save the rest of the scratch registers on the stack and return to the + calling ISR. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, r10, r12, lr} // Store other registers + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + B __tx_fiq_processing_return // Continue FIQ processing +// +__tx_thread_fiq_not_nested_save: + + /* Otherwise, not nested, check to see if a thread was running. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_fiq_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + + /* Save minimal context of interrupted thread. */ + + MRS r2, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r2, lr} // Store other registers, Note that we don't + // need to save sl and ip since FIQ has + // copies of these registers. Nested + // interrupt processing does need to save + // these registers. + + MOV r10, #0 // Clear stack limit + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + B __tx_fiq_processing_return // Continue FIQ processing + +__tx_thread_fiq_idle_system_save: + + /* Interrupt occurred in the scheduling loop. */ + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + /* Not much to do here, save the current SPSR and LR for possible + use in IRQ interrupted in idle system conditions, and return to + FIQ interrupt processing. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, lr} // Store other registers that will get used + // or stripped off the stack in context + // restore + B __tx_fiq_processing_return // Continue FIQ processing diff --git a/ports/cortex_a17/ac6/src/tx_thread_fiq_nesting_end.S b/ports/cortex_a17/ac6/src/tx_thread_fiq_nesting_end.S new file mode 100644 index 00000000..b34d881e --- /dev/null +++ b/ports/cortex_a17/ac6/src/tx_thread_fiq_nesting_end.S @@ -0,0 +1,104 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +#ifdef TX_ENABLE_FIQ_SUPPORT +DISABLE_INTS = 0xC0 // Disable IRQ/FIQ interrupts +#else +DISABLE_INTS = 0x80 // Disable IRQ interrupts +#endif +MODE_MASK = 0x1F // Mode mask +FIQ_MODE_BITS = 0x11 // FIQ mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_end + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_nesting_end ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from FIQ mode after */ +/* _tx_thread_fiq_nesting_start has been called and switches the FIQ */ +/* processing from system mode back to FIQ mode prior to the ISR */ +/* calling _tx_thread_fiq_context_restore. Note that this function */ +/* assumes the system stack pointer is in the same position after */ +/* nesting start function was called. */ +/* */ +/* This function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with FIQ interrupts disabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_fiq_nesting_end + .type _tx_thread_fiq_nesting_end,function +_tx_thread_fiq_nesting_end: + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + ORR r0, r0, #DISABLE_INTS // Build disable interrupt value + MSR CPSR_c, r0 // Disable interrupts + LDMIA sp!, {r1, lr} // Pickup saved lr (and r1 throw-away for + // 8-byte alignment logic) + BIC r0, r0, #MODE_MASK // Clear mode bits + ORR r0, r0, #FIQ_MODE_BITS // Build IRQ mode CPSR + MSR CPSR_c, r0 // Reenter IRQ mode + +#ifdef __THUMB_INTERWORK + BX r3 // Return to caller +#else + MOV pc, r3 // Return to caller +#endif diff --git a/ports/cortex_a17/ac6/src/tx_thread_fiq_nesting_start.S b/ports/cortex_a17/ac6/src/tx_thread_fiq_nesting_start.S new file mode 100644 index 00000000..c9cd5a06 --- /dev/null +++ b/ports/cortex_a17/ac6/src/tx_thread_fiq_nesting_start.S @@ -0,0 +1,96 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +FIQ_DISABLE = 0x40 // FIQ disable bit +MODE_MASK = 0x1F // Mode mask +SYS_MODE_BITS = 0x1F // System mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_start + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_nesting_start ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from FIQ mode after */ +/* _tx_thread_fiq_context_save has been called and switches the FIQ */ +/* processing to the system mode so nested FIQ interrupt processing */ +/* is possible (system mode has its own "lr" register). Note that */ +/* this function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with FIQ interrupts enabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_fiq_nesting_start + .type _tx_thread_fiq_nesting_start,function +_tx_thread_fiq_nesting_start: + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + BIC r0, r0, #MODE_MASK // Clear the mode bits + ORR r0, r0, #SYS_MODE_BITS // Build system mode CPSR + MSR CPSR_c, r0 // Enter system mode + STMDB sp!, {r1, lr} // Push the system mode lr on the system mode stack + // and push r1 just to keep 8-byte alignment + BIC r0, r0, #FIQ_DISABLE // Build enable FIQ CPSR + MSR CPSR_c, r0 // Enter system mode +#ifdef __THUMB_INTERWORK + BX r3 // Return to caller +#else + MOV pc, r3 // Return to caller +#endif diff --git a/ports/cortex_a17/ac6/src/tx_thread_interrupt_control.S b/ports/cortex_a17/ac6/src/tx_thread_interrupt_control.S new file mode 100644 index 00000000..63b1609a --- /dev/null +++ b/ports/cortex_a17/ac6/src/tx_thread_interrupt_control.S @@ -0,0 +1,104 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +INT_MASK = 0x03F + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_control for + applications calling this function from to 16-bit Thumb mode. */ + + .text + .align 2 + .global $_tx_thread_interrupt_control +$_tx_thread_interrupt_control: + .thumb + BX pc // Switch to 32-bit mode + NOP // + .arm + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_control // Call _tx_thread_interrupt_control function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_control ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for changing the interrupt lockout */ +/* posture of the system. */ +/* */ +/* INPUT */ +/* */ +/* new_posture New interrupt lockout posture */ +/* */ +/* OUTPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_interrupt_control + .type _tx_thread_interrupt_control,function +_tx_thread_interrupt_control: + + /* Pickup current interrupt lockout posture. */ + + MRS r3, CPSR // Pickup current CPSR + MOV r2, #INT_MASK // Build interrupt mask + AND r1, r3, r2 // Clear interrupt lockout bits + ORR r1, r1, r0 // Or-in new interrupt lockout bits + + /* Apply the new interrupt posture. */ + + MSR CPSR_c, r1 // Setup new CPSR + BIC r0, r3, r2 // Return previous interrupt mask +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a17/ac6/src/tx_thread_interrupt_disable.S b/ports/cortex_a17/ac6/src/tx_thread_interrupt_disable.S new file mode 100644 index 00000000..13258808 --- /dev/null +++ b/ports/cortex_a17/ac6/src/tx_thread_interrupt_disable.S @@ -0,0 +1,101 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_disable for + applications calling this function from to 16-bit Thumb mode. */ + + .text + .align 2 + .global $_tx_thread_interrupt_disable +$_tx_thread_interrupt_disable: + .thumb + BX pc // Switch to 32-bit mode + NOP // + .arm + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_disable // Call _tx_thread_interrupt_disable function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_disable ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for disabling interrupts */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_interrupt_disable + .type _tx_thread_interrupt_disable,function +_tx_thread_interrupt_disable: + + /* Pickup current interrupt lockout posture. */ + + MRS r0, CPSR // Pickup current CPSR + + /* Mask interrupts. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Disable IRQ and FIQ +#else + CPSID i // Disable IRQ +#endif + +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a17/ac6/src/tx_thread_interrupt_restore.S b/ports/cortex_a17/ac6/src/tx_thread_interrupt_restore.S new file mode 100644 index 00000000..2d582511 --- /dev/null +++ b/ports/cortex_a17/ac6/src/tx_thread_interrupt_restore.S @@ -0,0 +1,93 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_restore for + applications calling this function from to 16-bit Thumb mode. */ + + .text + .align 2 + .global $_tx_thread_interrupt_restore +$_tx_thread_interrupt_restore: + .thumb + BX pc // Switch to 32-bit mode + NOP // + .arm + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_restore // Call _tx_thread_interrupt_restore function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for restoring interrupts to the state */ +/* returned by a previous _tx_thread_interrupt_disable call. */ +/* */ +/* INPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_interrupt_restore + .type _tx_thread_interrupt_restore,function +_tx_thread_interrupt_restore: + + /* Apply the new interrupt posture. */ + + MSR CPSR_c, r0 // Setup new CPSR +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a17/ac6/src/tx_thread_irq_nesting_end.S b/ports/cortex_a17/ac6/src/tx_thread_irq_nesting_end.S new file mode 100644 index 00000000..ec7e63c6 --- /dev/null +++ b/ports/cortex_a17/ac6/src/tx_thread_irq_nesting_end.S @@ -0,0 +1,103 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +#ifdef TX_ENABLE_FIQ_SUPPORT +DISABLE_INTS = 0xC0 // Disable IRQ/FIQ interrupts +#else +DISABLE_INTS = 0x80 // Disable IRQ interrupts +#endif +MODE_MASK = 0x1F // Mode mask +IRQ_MODE_BITS = 0x12 // IRQ mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_end + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_irq_nesting_end ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from IRQ mode after */ +/* _tx_thread_irq_nesting_start has been called and switches the IRQ */ +/* processing from system mode back to IRQ mode prior to the ISR */ +/* calling _tx_thread_context_restore. Note that this function */ +/* assumes the system stack pointer is in the same position after */ +/* nesting start function was called. */ +/* */ +/* This function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with IRQ interrupts disabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_irq_nesting_end + .type _tx_thread_irq_nesting_end,function +_tx_thread_irq_nesting_end: + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + ORR r0, r0, #DISABLE_INTS // Build disable interrupt value + MSR CPSR_c, r0 // Disable interrupts + LDMIA sp!, {r1, lr} // Pickup saved lr (and r1 throw-away for + // 8-byte alignment logic) + BIC r0, r0, #MODE_MASK // Clear mode bits + ORR r0, r0, #IRQ_MODE_BITS // Build IRQ mode CPSR + MSR CPSR_c, r0 // Reenter IRQ mode +#ifdef __THUMB_INTERWORK + BX r3 // Return to caller +#else + MOV pc, r3 // Return to caller +#endif diff --git a/ports/cortex_a17/ac6/src/tx_thread_irq_nesting_start.S b/ports/cortex_a17/ac6/src/tx_thread_irq_nesting_start.S new file mode 100644 index 00000000..c69976ed --- /dev/null +++ b/ports/cortex_a17/ac6/src/tx_thread_irq_nesting_start.S @@ -0,0 +1,96 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +IRQ_DISABLE = 0x80 // IRQ disable bit +MODE_MASK = 0x1F // Mode mask +SYS_MODE_BITS = 0x1F // System mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_start + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_irq_nesting_start ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from IRQ mode after */ +/* _tx_thread_context_save has been called and switches the IRQ */ +/* processing to the system mode so nested IRQ interrupt processing */ +/* is possible (system mode has its own "lr" register). Note that */ +/* this function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with IRQ interrupts enabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_irq_nesting_start + .type _tx_thread_irq_nesting_start,function +_tx_thread_irq_nesting_start: + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + BIC r0, r0, #MODE_MASK // Clear the mode bits + ORR r0, r0, #SYS_MODE_BITS // Build system mode CPSR + MSR CPSR_c, r0 // Enter system mode + STMDB sp!, {r1, lr} // Push the system mode lr on the system mode stack + // and push r1 just to keep 8-byte alignment + BIC r0, r0, #IRQ_DISABLE // Build enable IRQ CPSR + MSR CPSR_c, r0 // Enter system mode +#ifdef __THUMB_INTERWORK + BX r3 // Return to caller +#else + MOV pc, r3 // Return to caller +#endif diff --git a/ports/cortex_a17/ac6/src/tx_thread_schedule.S b/ports/cortex_a17/ac6/src/tx_thread_schedule.S new file mode 100644 index 00000000..8330e9df --- /dev/null +++ b/ports/cortex_a17/ac6/src/tx_thread_schedule.S @@ -0,0 +1,230 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .global _tx_thread_execute_ptr + .global _tx_thread_current_ptr + .global _tx_timer_time_slice + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_schedule for + applications calling this function from to 16-bit Thumb mode. */ + + .text + .align 2 + .global $_tx_thread_schedule + .type $_tx_thread_schedule,function +$_tx_thread_schedule: + .thumb + BX pc // Switch to 32-bit mode + NOP // + .arm + STMFD sp!, {lr} // Save return address + BL _tx_thread_schedule // Call _tx_thread_schedule function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_schedule ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function waits for a thread control block pointer to appear in */ +/* the _tx_thread_execute_ptr variable. Once a thread pointer appears */ +/* in the variable, the corresponding thread is resumed. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_initialize_kernel_enter ThreadX entry function */ +/* _tx_thread_system_return Return to system from thread */ +/* _tx_thread_context_restore Restore thread's context */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_schedule + .type _tx_thread_schedule,function +_tx_thread_schedule: + + /* Enable interrupts. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSIE if // Enable IRQ and FIQ interrupts +#else + CPSIE i // Enable IRQ interrupts +#endif + + /* Wait for a thread to execute. */ + LDR r1, =_tx_thread_execute_ptr // Address of thread execute ptr + +__tx_thread_schedule_loop: + + LDR r0, [r1] // Pickup next thread to execute + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_schedule_loop // If so, keep looking for a thread + /* Yes! We have a thread to execute. Lockout interrupts and + transfer control to it. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Disable IRQ and FIQ interrupts +#else + CPSID i // Disable IRQ interrupts +#endif + + /* Setup the current thread pointer. */ + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread + STR r0, [r1] // Setup current thread pointer + + /* Increment the run count for this thread. */ + + LDR r2, [r0, #4] // Pickup run counter + LDR r3, [r0, #24] // Pickup time-slice for this thread + ADD r2, r2, #1 // Increment thread run-counter + STR r2, [r0, #4] // Store the new run counter + + /* Setup time-slice, if present. */ + + LDR r2, =_tx_timer_time_slice // Pickup address of time-slice + // variable + LDR sp, [r0, #8] // Switch stack pointers + STR r3, [r2] // Setup time-slice + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the thread entry function to indicate the thread is executing. */ + + MOV r5, r0 // Save r0 + BL _tx_execution_thread_enter // Call the thread execution enter function + MOV r0, r5 // Restore r0 +#endif + + /* Determine if an interrupt frame or a synchronous task suspension frame + is present. */ + + LDMIA sp!, {r4, r5} // Pickup the stack type and saved CPSR + CMP r4, #0 // Check for synchronous context switch + BEQ _tx_solicited_return + MSR SPSR_cxsf, r5 // Setup SPSR for return +#ifdef TX_ENABLE_VFP_SUPPORT + LDR r1, [r0, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_interrupt_vfp_restore // No, skip VFP interrupt restore + VLDMIA sp!, {D0-D15} // Recover D0-D15 + VLDMIA sp!, {D16-D31} // Recover D16-D31 + LDR r4, [sp], #4 // Pickup FPSCR + VMSR FPSCR, r4 // Restore FPSCR +_tx_skip_interrupt_vfp_restore: +#endif + LDMIA sp!, {r0-r12, lr, pc}^ // Return to point of thread interrupt + +_tx_solicited_return: + +#ifdef TX_ENABLE_VFP_SUPPORT + LDR r1, [r0, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_solicited_vfp_restore // No, skip VFP solicited restore + VLDMIA sp!, {D8-D15} // Recover D8-D15 + VLDMIA sp!, {D16-D31} // Recover D16-D31 + LDR r4, [sp], #4 // Pickup FPSCR + VMSR FPSCR, r4 // Restore FPSCR +_tx_skip_solicited_vfp_restore: +#endif + MSR CPSR_cxsf, r5 // Recover CPSR + LDMIA sp!, {r4-r11, lr} // Return to thread synchronously +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif + +#ifdef TX_ENABLE_VFP_SUPPORT + + .global tx_thread_vfp_enable + .type tx_thread_vfp_enable,function +tx_thread_vfp_enable: + MRS r2, CPSR // Pickup the CPSR +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Enable IRQ and FIQ interrupts +#else + CPSID i // Enable IRQ interrupts +#endif + LDR r0, =_tx_thread_current_ptr // Build current thread pointer address + LDR r1, [r0] // Pickup current thread pointer + CMP r1, #0 // Check for NULL thread pointer + BEQ __tx_no_thread_to_enable // If NULL, skip VFP enable + MOV r0, #1 // Build enable value + STR r0, [r1, #144] // Set the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) +__tx_no_thread_to_enable: + MSR CPSR_cxsf, r2 // Recover CPSR + BX LR // Return to caller + + .global tx_thread_vfp_disable + .type tx_thread_vfp_disable,function +tx_thread_vfp_disable: + MRS r2, CPSR // Pickup the CPSR +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Enable IRQ and FIQ interrupts +#else + CPSID i // Enable IRQ interrupts +#endif + LDR r0, =_tx_thread_current_ptr // Build current thread pointer address + LDR r1, [r0] // Pickup current thread pointer + CMP r1, #0 // Check for NULL thread pointer + BEQ __tx_no_thread_to_disable // If NULL, skip VFP disable + MOV r0, #0 // Build disable value + STR r0, [r1, #144] // Clear the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) +__tx_no_thread_to_disable: + MSR CPSR_cxsf, r2 // Recover CPSR + BX LR // Return to caller + +#endif diff --git a/ports/cortex_a17/ac6/src/tx_thread_stack_build.S b/ports/cortex_a17/ac6/src/tx_thread_stack_build.S new file mode 100644 index 00000000..f413e673 --- /dev/null +++ b/ports/cortex_a17/ac6/src/tx_thread_stack_build.S @@ -0,0 +1,164 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .arm + +SVC_MODE = 0x13 // SVC mode +#ifdef TX_ENABLE_FIQ_SUPPORT +CPSR_MASK = 0xDF // Mask initial CPSR, IRQ & FIQ interrupts enabled +#else +CPSR_MASK = 0x9F // Mask initial CPSR, IRQ interrupts enabled +#endif + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_stack_build for + applications calling this function from to 16-bit Thumb mode. */ + + .text + .align 2 + .thumb + .global $_tx_thread_stack_build + .type $_tx_thread_stack_build,function +$_tx_thread_stack_build: + BX pc // Switch to 32-bit mode + NOP // + .arm + STMFD sp!, {lr} // Save return address + BL _tx_thread_stack_build // Call _tx_thread_stack_build function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_stack_build ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function builds a stack frame on the supplied thread's stack. */ +/* The stack frame results in a fake interrupt return to the supplied */ +/* function pointer. */ +/* */ +/* INPUT */ +/* */ +/* thread_ptr Pointer to thread control blk */ +/* function_ptr Pointer to return function */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_thread_create Create thread service */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_stack_build + .type _tx_thread_stack_build,function +_tx_thread_stack_build: + + + /* Build a fake interrupt frame. The form of the fake interrupt stack + on the ARMv7-A should look like the following after it is built: + + Stack Top: 1 Interrupt stack frame type + CPSR Initial value for CPSR + a1 (r0) Initial value for a1 + a2 (r1) Initial value for a2 + a3 (r2) Initial value for a3 + a4 (r3) Initial value for a4 + v1 (r4) Initial value for v1 + v2 (r5) Initial value for v2 + v3 (r6) Initial value for v3 + v4 (r7) Initial value for v4 + v5 (r8) Initial value for v5 + sb (r9) Initial value for sb + sl (r10) Initial value for sl + fp (r11) Initial value for fp + ip (r12) Initial value for ip + lr (r14) Initial value for lr + pc (r15) Initial value for + 0 For stack backtracing + + Stack Bottom: (higher memory address) */ + + LDR r2, [r0, #16] // Pickup end of stack area + BIC r2, r2, #7 // Ensure 8-byte alignment + SUB r2, r2, #76 // Allocate space for the stack frame + + /* Actually build the stack frame. */ + + MOV r3, #1 // Build interrupt stack type + STR r3, [r2, #0] // Store stack type + MOV r3, #0 // Build initial register value + STR r3, [r2, #8] // Store initial r0 + STR r3, [r2, #12] // Store initial r1 + STR r3, [r2, #16] // Store initial r2 + STR r3, [r2, #20] // Store initial r3 + STR r3, [r2, #24] // Store initial r4 + STR r3, [r2, #28] // Store initial r5 + STR r3, [r2, #32] // Store initial r6 + STR r3, [r2, #36] // Store initial r7 + STR r3, [r2, #40] // Store initial r8 + STR r3, [r2, #44] // Store initial r9 + LDR r3, [r0, #12] // Pickup stack starting address + STR r3, [r2, #48] // Store initial r10 (sl) + LDR r3,=_tx_thread_schedule // Pickup address of _tx_thread_schedule for GDB backtrace + STR r3, [r2, #60] // Store initial r14 (lr) + MOV r3, #0 // Build initial register value + STR r3, [r2, #52] // Store initial r11 + STR r3, [r2, #56] // Store initial r12 + STR r1, [r2, #64] // Store initial pc + STR r3, [r2, #68] // 0 for back-trace + MRS r1, CPSR // Pickup CPSR + BIC r1, r1, #CPSR_MASK // Mask mode bits of CPSR + ORR r3, r1, #SVC_MODE // Build CPSR, SVC mode, interrupts enabled + STR r3, [r2, #4] // Store initial CPSR + + /* Setup stack pointer. */ + + STR r2, [r0, #8] // Save stack pointer in thread's + // control block +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a17/ac6/src/tx_thread_system_return.S b/ports/cortex_a17/ac6/src/tx_thread_system_return.S new file mode 100644 index 00000000..cb7d62ce --- /dev/null +++ b/ports/cortex_a17/ac6/src/tx_thread_system_return.S @@ -0,0 +1,162 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .arm + + + .global _tx_thread_current_ptr + .global _tx_timer_time_slice + .global _tx_thread_schedule + + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_system_return for + applications calling this function from to 16-bit Thumb mode. */ + + .text + .align 2 + .global $_tx_thread_system_return + .type $_tx_thread_system_return,function +$_tx_thread_system_return: + .thumb + BX pc // Switch to 32-bit mode + NOP // + .arm + STMFD sp!, {lr} // Save return address + BL _tx_thread_system_return // Call _tx_thread_system_return function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_system_return ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is target processor specific. It is used to transfer */ +/* control from a thread back to the ThreadX system. Only a */ +/* minimal context is saved since the compiler assumes temp registers */ +/* are going to get slicked by a function call anyway. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling loop */ +/* */ +/* CALLED BY */ +/* */ +/* ThreadX components */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_system_return + .type _tx_thread_system_return,function +_tx_thread_system_return: + + /* Save minimal context on the stack. */ + + STMDB sp!, {r4-r11, lr} // Save minimal context + + LDR r4, =_tx_thread_current_ptr // Pickup address of current ptr + LDR r5, [r4] // Pickup current thread pointer + +#ifdef TX_ENABLE_VFP_SUPPORT + LDR r1, [r5, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_solicited_vfp_save // No, skip VFP solicited save + VMRS r1, FPSCR // Pickup the FPSCR + STR r1, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D8-D15} // Save D8-D15 +_tx_skip_solicited_vfp_save: +#endif + + MOV r0, #0 // Build a solicited stack type + MRS r1, CPSR // Pickup the CPSR + STMDB sp!, {r0-r1} // Save type and CPSR + + /* Lockout interrupts. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Disable IRQ and FIQ interrupts +#else + CPSID i // Disable IRQ interrupts +#endif + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the thread exit function to indicate the thread is no longer executing. */ + + BL _tx_execution_thread_exit // Call the thread exit function +#endif + MOV r3, r4 // Pickup address of current ptr + MOV r0, r5 // Pickup current thread pointer + LDR r2, =_tx_timer_time_slice // Pickup address of time slice + LDR r1, [r2] // Pickup current time slice + + /* Save current stack and switch to system stack. */ + + STR sp, [r0, #8] // Save thread stack pointer + + /* Determine if the time-slice is active. */ + + MOV r4, #0 // Build clear value + CMP r1, #0 // Is a time-slice active? + BEQ __tx_thread_dont_save_ts // No, don't save the time-slice + + /* Save time-slice for the thread and clear the current time-slice. */ + + STR r4, [r2] // Clear time-slice + STR r1, [r0, #24] // Save current time-slice + +__tx_thread_dont_save_ts: + + /* Clear the current thread pointer. */ + + STR r4, [r3] // Clear current thread pointer + B _tx_thread_schedule // Jump to scheduler! diff --git a/ports/cortex_a17/ac6/src/tx_thread_vectored_context_save.S b/ports/cortex_a17/ac6/src/tx_thread_vectored_context_save.S new file mode 100644 index 00000000..d846223f --- /dev/null +++ b/ports/cortex_a17/ac6/src/tx_thread_vectored_context_save.S @@ -0,0 +1,165 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .global _tx_thread_system_state + .global _tx_thread_current_ptr + .global _tx_execution_isr_enter + + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_vectored_context_save + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_vectored_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_vectored_context_save + .type _tx_thread_vectored_context_save,function +_tx_thread_vectored_context_save: + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Disable IRQ and FIQ interrupts +#endif + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3, #0] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3, #0] // Store it back in the variable + + /* Note: Minimal context of interrupted thread is already saved. */ + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + MOV pc, lr // Return to caller + +__tx_thread_not_nested_save: + + /* Otherwise, not nested, check to see if a thread was running. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3, #0] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1, #0] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + /* Note: Minimal context of interrupted thread is already saved. */ + + /* Save the current stack pointer in the thread's control block. */ + + MOV r10, #0 // Clear stack limit + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + MOV pc, lr // Return to caller + +__tx_thread_idle_system_save: + + /* Interrupt occurred in the scheduling loop. */ + + /* Not much to do here, just adjust the stack pointer, and return to IRQ + processing. */ + + MOV r10, #0 // Clear stack limit + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + ADD sp, sp, #32 // Recover saved registers + MOV pc, lr // Return to caller diff --git a/ports/cortex_a17/ac6/src/tx_timer_interrupt.S b/ports/cortex_a17/ac6/src/tx_timer_interrupt.S new file mode 100644 index 00000000..7337ed0c --- /dev/null +++ b/ports/cortex_a17/ac6/src/tx_timer_interrupt.S @@ -0,0 +1,231 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Timer */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .arm + + +/* Define Assembly language external references... */ + + .global _tx_timer_time_slice + .global _tx_timer_system_clock + .global _tx_timer_current_ptr + .global _tx_timer_list_start + .global _tx_timer_list_end + .global _tx_timer_expired_time_slice + .global _tx_timer_expired + .global _tx_thread_time_slice + + + +/* Define the 16-bit Thumb mode veneer for _tx_timer_interrupt for + applications calling this function from to 16-bit Thumb mode. */ + + .text + .align 2 + .thumb + .global $_tx_timer_interrupt + .type $_tx_timer_interrupt,function +$_tx_timer_interrupt: + BX pc // Switch to 32-bit mode + NOP // + .arm + STMFD sp!, {lr} // Save return address + BL _tx_timer_interrupt // Call _tx_timer_interrupt function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_timer_interrupt ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function processes the hardware timer interrupt. This */ +/* processing includes incrementing the system clock and checking for */ +/* time slice and/or timer expiration. If either is found, the */ +/* interrupt context save/restore functions are called along with the */ +/* expiration functions. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_time_slice Time slice interrupted thread */ +/* _tx_timer_expiration_process Timer expiration processing */ +/* */ +/* CALLED BY */ +/* */ +/* interrupt vector */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_timer_interrupt + .type _tx_timer_interrupt,function +_tx_timer_interrupt: + + /* Upon entry to this routine, it is assumed that context save has already + been called, and therefore the compiler scratch registers are available + for use. */ + + /* Increment the system clock. */ + + LDR r1, =_tx_timer_system_clock // Pickup address of system clock + LDR r0, [r1] // Pickup system clock + ADD r0, r0, #1 // Increment system clock + STR r0, [r1] // Store new system clock + + /* Test for time-slice expiration. */ + + LDR r3, =_tx_timer_time_slice // Pickup address of time-slice + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it non-active? + BEQ __tx_timer_no_time_slice // Yes, skip time-slice processing + + /* Decrement the time_slice. */ + + SUB r2, r2, #1 // Decrement the time-slice + STR r2, [r3] // Store new time-slice value + + /* Check for expiration. */ + + CMP r2, #0 // Has it expired? + BNE __tx_timer_no_time_slice // No, skip expiration processing + + /* Set the time-slice expired flag. */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of expired flag + MOV r0, #1 // Build expired value + STR r0, [r3] // Set time-slice expiration flag + +__tx_timer_no_time_slice: + + /* Test for timer expiration. */ + + LDR r1, =_tx_timer_current_ptr // Pickup current timer pointer address + LDR r0, [r1] // Pickup current timer + LDR r2, [r0] // Pickup timer list entry + CMP r2, #0 // Is there anything in the list? + BEQ __tx_timer_no_timer // No, just increment the timer + + /* Set expiration flag. */ + + LDR r3, =_tx_timer_expired // Pickup expiration flag address + MOV r2, #1 // Build expired value + STR r2, [r3] // Set expired flag + B __tx_timer_done // Finished timer processing + +__tx_timer_no_timer: + + /* No timer expired, increment the timer pointer. */ + ADD r0, r0, #4 // Move to next timer + + /* Check for wraparound. */ + + LDR r3, =_tx_timer_list_end // Pickup address of timer list end + LDR r2, [r3] // Pickup list end + CMP r0, r2 // Are we at list end? + BNE __tx_timer_skip_wrap // No, skip wraparound logic + + /* Wrap to beginning of list. */ + + LDR r3, =_tx_timer_list_start // Pickup address of timer list start + LDR r0, [r3] // Set current pointer to list start + +__tx_timer_skip_wrap: + + STR r0, [r1] // Store new current timer pointer + +__tx_timer_done: + + /* See if anything has expired. */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of expired flag + LDR r2, [r3] // Pickup time-slice expired flag + CMP r2, #0 // Did a time-slice expire? + BNE __tx_something_expired // If non-zero, time-slice expired + LDR r1, =_tx_timer_expired // Pickup address of other expired flag + LDR r0, [r1] // Pickup timer expired flag + CMP r0, #0 // Did a timer expire? + BEQ __tx_timer_nothing_expired // No, nothing expired + +__tx_something_expired: + + STMDB sp!, {r0, lr} // Save the lr register on the stack + // and save r0 just to keep 8-byte alignment + + /* Did a timer expire? */ + + LDR r1, =_tx_timer_expired // Pickup address of expired flag + LDR r0, [r1] // Pickup timer expired flag + CMP r0, #0 // Check for timer expiration + BEQ __tx_timer_dont_activate // If not set, skip timer activation + + /* Process timer expiration. */ + BL _tx_timer_expiration_process // Call the timer expiration handling routine + +__tx_timer_dont_activate: + + /* Did time slice expire? */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of time-slice expired + LDR r2, [r3] // Pickup the actual flag + CMP r2, #0 // See if the flag is set + BEQ __tx_timer_not_ts_expiration // No, skip time-slice processing + + /* Time slice interrupted thread. */ + + BL _tx_thread_time_slice // Call time-slice processing + +__tx_timer_not_ts_expiration: + + LDMIA sp!, {r0, lr} // Recover lr register (r0 is just there for + // the 8-byte stack alignment + +__tx_timer_nothing_expired: + +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a17/gnu/example_build/build_threadx.bat b/ports/cortex_a17/gnu/example_build/build_threadx.bat new file mode 100644 index 00000000..571df29e --- /dev/null +++ b/ports/cortex_a17/gnu/example_build/build_threadx.bat @@ -0,0 +1,238 @@ +del tx.a +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 tx_initialize_low_level.S +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 ../src/tx_thread_stack_build.S +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 ../src/tx_thread_schedule.S +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 ../src/tx_thread_system_return.S +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 ../src/tx_thread_context_save.S +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 ../src/tx_thread_context_restore.S +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 ../src/tx_thread_interrupt_control.S +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 ../src/tx_timer_interrupt.S +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 ../src/tx_thread_interrupt_disable.S +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 ../src/tx_thread_interrupt_restore.S +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 ../src/tx_thread_fiq_context_save.S +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 ../src/tx_thread_fiq_nesting_start.S +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 ../src/tx_thread_irq_nesting_start.S +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 ../src/tx_thread_irq_nesting_end.S +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 ../src/tx_thread_fiq_nesting_end.S +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 ../src/tx_thread_fiq_context_restore.S +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 ../src/tx_thread_vectored_context_save.S +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_block_allocate.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_block_pool_cleanup.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_block_pool_create.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_block_pool_delete.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_block_pool_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_block_pool_initialize.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_block_pool_performance_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_block_pool_performance_system_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_block_pool_prioritize.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_block_release.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_byte_allocate.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_byte_pool_cleanup.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_byte_pool_create.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_byte_pool_delete.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_byte_pool_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_byte_pool_initialize.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_byte_pool_performance_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_byte_pool_performance_system_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_byte_pool_prioritize.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_byte_pool_search.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_byte_release.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_event_flags_cleanup.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_event_flags_create.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_event_flags_delete.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_event_flags_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_event_flags_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_event_flags_initialize.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_event_flags_performance_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_event_flags_performance_system_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_event_flags_set.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_event_flags_set_notify.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_initialize_high_level.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_initialize_kernel_enter.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_initialize_kernel_setup.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_mutex_cleanup.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_mutex_create.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_mutex_delete.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_mutex_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_mutex_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_mutex_initialize.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_mutex_performance_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_mutex_performance_system_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_mutex_prioritize.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_mutex_priority_change.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_mutex_put.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_queue_cleanup.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_queue_create.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_queue_delete.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_queue_flush.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_queue_front_send.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_queue_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_queue_initialize.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_queue_performance_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_queue_performance_system_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_queue_prioritize.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_queue_receive.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_queue_send.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_queue_send_notify.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_semaphore_ceiling_put.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_semaphore_cleanup.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_semaphore_create.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_semaphore_delete.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_semaphore_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_semaphore_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_semaphore_initialize.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_semaphore_performance_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_semaphore_performance_system_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_semaphore_prioritize.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_semaphore_put.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_semaphore_put_notify.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_create.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_delete.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_entry_exit_notify.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_identify.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_initialize.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_performance_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_performance_system_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_preemption_change.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_priority_change.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_relinquish.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_reset.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_resume.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_shell_entry.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_sleep.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_stack_analyze.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_stack_error_handler.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_stack_error_notify.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_suspend.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_system_preempt_check.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_system_resume.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_system_suspend.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_terminate.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_time_slice.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_time_slice_change.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_timeout.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_thread_wait_abort.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_time_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_time_set.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_timer_activate.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_timer_change.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_timer_create.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_timer_deactivate.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_timer_delete.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_timer_expiration_process.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_timer_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_timer_initialize.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_timer_performance_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_timer_performance_system_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_timer_system_activate.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_timer_system_deactivate.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_timer_thread_entry.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_trace_enable.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_trace_disable.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_trace_initialize.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_trace_interrupt_control.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_trace_isr_enter_insert.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_trace_isr_exit_insert.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_trace_object_register.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_trace_object_unregister.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_trace_user_event_insert.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_trace_buffer_full_notify.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_trace_event_filter.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/tx_trace_event_unfilter.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_block_allocate.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_block_pool_create.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_block_pool_delete.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_block_pool_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_block_pool_prioritize.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_block_release.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_byte_allocate.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_byte_pool_create.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_byte_pool_delete.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_byte_pool_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_byte_pool_prioritize.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_byte_release.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_event_flags_create.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_event_flags_delete.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_event_flags_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_event_flags_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_event_flags_set.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_event_flags_set_notify.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_mutex_create.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_mutex_delete.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_mutex_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_mutex_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_mutex_prioritize.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_mutex_put.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_queue_create.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_queue_delete.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_queue_flush.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_queue_front_send.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_queue_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_queue_prioritize.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_queue_receive.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_queue_send.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_queue_send_notify.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_semaphore_ceiling_put.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_semaphore_create.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_semaphore_delete.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_semaphore_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_semaphore_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_semaphore_prioritize.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_semaphore_put.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_semaphore_put_notify.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_thread_create.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_thread_delete.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_thread_entry_exit_notify.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_thread_info_get.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_thread_preemption_change.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_thread_priority_change.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_thread_relinquish.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_thread_reset.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_thread_resume.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_thread_suspend.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_thread_terminate.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_thread_time_slice_change.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_thread_wait_abort.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_timer_activate.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_timer_change.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_timer_create.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_timer_deactivate.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_timer_delete.c +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc ../../../../common/src/txe_timer_info_get.c +arm-none-eabi-ar -r tx.a tx_thread_stack_build.o tx_thread_schedule.o tx_thread_system_return.o tx_thread_context_save.o tx_thread_context_restore.o tx_timer_interrupt.o tx_thread_interrupt_control.o +arm-none-eabi-ar -r tx.a tx_thread_interrupt_disable.o tx_thread_interrupt_restore.o tx_thread_fiq_context_save.o tx_thread_fiq_nesting_start.o tx_thread_irq_nesting_start.o tx_thread_irq_nesting_end.o +arm-none-eabi-ar -r tx.a tx_thread_fiq_nesting_end.o tx_thread_fiq_context_restore.o tx_thread_vectored_context_save.o tx_initialize_low_level.o +arm-none-eabi-ar -r tx.a tx_block_allocate.o tx_block_pool_cleanup.o tx_block_pool_create.o tx_block_pool_delete.o tx_block_pool_info_get.o +arm-none-eabi-ar -r tx.a tx_block_pool_initialize.o tx_block_pool_performance_info_get.o tx_block_pool_performance_system_info_get.o tx_block_pool_prioritize.o +arm-none-eabi-ar -r tx.a tx_block_release.o tx_byte_allocate.o tx_byte_pool_cleanup.o tx_byte_pool_create.o tx_byte_pool_delete.o tx_byte_pool_info_get.o +arm-none-eabi-ar -r tx.a tx_byte_pool_initialize.o tx_byte_pool_performance_info_get.o tx_byte_pool_performance_system_info_get.o tx_byte_pool_prioritize.o +arm-none-eabi-ar -r tx.a tx_byte_pool_search.o tx_byte_release.o tx_event_flags_cleanup.o tx_event_flags_create.o tx_event_flags_delete.o tx_event_flags_get.o +arm-none-eabi-ar -r tx.a tx_event_flags_info_get.o tx_event_flags_initialize.o tx_event_flags_performance_info_get.o tx_event_flags_performance_system_info_get.o +arm-none-eabi-ar -r tx.a tx_event_flags_set.o tx_event_flags_set_notify.o tx_initialize_high_level.o tx_initialize_kernel_enter.o tx_initialize_kernel_setup.o +arm-none-eabi-ar -r tx.a tx_mutex_cleanup.o tx_mutex_create.o tx_mutex_delete.o tx_mutex_get.o tx_mutex_info_get.o tx_mutex_initialize.o tx_mutex_performance_info_get.o +arm-none-eabi-ar -r tx.a tx_mutex_performance_system_info_get.o tx_mutex_prioritize.o tx_mutex_priority_change.o tx_mutex_put.o tx_queue_cleanup.o tx_queue_create.o +arm-none-eabi-ar -r tx.a tx_queue_delete.o tx_queue_flush.o tx_queue_front_send.o tx_queue_info_get.o tx_queue_initialize.o tx_queue_performance_info_get.o +arm-none-eabi-ar -r tx.a tx_queue_performance_system_info_get.o tx_queue_prioritize.o tx_queue_receive.o tx_queue_send.o tx_queue_send_notify.o tx_semaphore_ceiling_put.o +arm-none-eabi-ar -r tx.a tx_semaphore_cleanup.o tx_semaphore_create.o tx_semaphore_delete.o tx_semaphore_get.o tx_semaphore_info_get.o tx_semaphore_initialize.o +arm-none-eabi-ar -r tx.a tx_semaphore_performance_info_get.o tx_semaphore_performance_system_info_get.o tx_semaphore_prioritize.o tx_semaphore_put.o tx_semaphore_put_notify.o +arm-none-eabi-ar -r tx.a tx_thread_create.o tx_thread_delete.o tx_thread_entry_exit_notify.o tx_thread_identify.o tx_thread_info_get.o tx_thread_initialize.o +arm-none-eabi-ar -r tx.a tx_thread_performance_info_get.o tx_thread_performance_system_info_get.o tx_thread_preemption_change.o tx_thread_priority_change.o tx_thread_relinquish.o +arm-none-eabi-ar -r tx.a tx_thread_reset.o tx_thread_resume.o tx_thread_shell_entry.o tx_thread_sleep.o tx_thread_stack_analyze.o tx_thread_stack_error_handler.o +arm-none-eabi-ar -r tx.a tx_thread_stack_error_notify.o tx_thread_suspend.o tx_thread_system_preempt_check.o tx_thread_system_resume.o tx_thread_system_suspend.o +arm-none-eabi-ar -r tx.a tx_thread_terminate.o tx_thread_time_slice.o tx_thread_time_slice_change.o tx_thread_timeout.o tx_thread_wait_abort.o tx_time_get.o +arm-none-eabi-ar -r tx.a tx_time_set.o tx_timer_activate.o tx_timer_change.o tx_timer_create.o tx_timer_deactivate.o tx_timer_delete.o tx_timer_expiration_process.o +arm-none-eabi-ar -r tx.a tx_timer_info_get.o tx_timer_initialize.o tx_timer_performance_info_get.o tx_timer_performance_system_info_get.o tx_timer_system_activate.o +arm-none-eabi-ar -r tx.a tx_timer_system_deactivate.o tx_timer_thread_entry.o tx_trace_enable.o tx_trace_disable.o tx_trace_initialize.o tx_trace_interrupt_control.o +arm-none-eabi-ar -r tx.a tx_trace_isr_enter_insert.o tx_trace_isr_exit_insert.o tx_trace_object_register.o tx_trace_object_unregister.o tx_trace_user_event_insert.o +arm-none-eabi-ar -r tx.a tx_trace_buffer_full_notify.o tx_trace_event_filter.o tx_trace_event_unfilter.o +arm-none-eabi-ar -r tx.a txe_block_allocate.o txe_block_pool_create.o txe_block_pool_delete.o txe_block_pool_info_get.o txe_block_pool_prioritize.o txe_block_release.o +arm-none-eabi-ar -r tx.a txe_byte_allocate.o txe_byte_pool_create.o txe_byte_pool_delete.o txe_byte_pool_info_get.o txe_byte_pool_prioritize.o txe_byte_release.o +arm-none-eabi-ar -r tx.a txe_event_flags_create.o txe_event_flags_delete.o txe_event_flags_get.o txe_event_flags_info_get.o txe_event_flags_set.o +arm-none-eabi-ar -r tx.a txe_event_flags_set_notify.o txe_mutex_create.o txe_mutex_delete.o txe_mutex_get.o txe_mutex_info_get.o txe_mutex_prioritize.o +arm-none-eabi-ar -r tx.a txe_mutex_put.o txe_queue_create.o txe_queue_delete.o txe_queue_flush.o txe_queue_front_send.o txe_queue_info_get.o txe_queue_prioritize.o +arm-none-eabi-ar -r tx.a txe_queue_receive.o txe_queue_send.o txe_queue_send_notify.o txe_semaphore_ceiling_put.o txe_semaphore_create.o txe_semaphore_delete.o +arm-none-eabi-ar -r tx.a txe_semaphore_get.o txe_semaphore_info_get.o txe_semaphore_prioritize.o txe_semaphore_put.o txe_semaphore_put_notify.o txe_thread_create.o +arm-none-eabi-ar -r tx.a txe_thread_delete.o txe_thread_entry_exit_notify.o txe_thread_info_get.o txe_thread_preemption_change.o txe_thread_priority_change.o +arm-none-eabi-ar -r tx.a txe_thread_relinquish.o txe_thread_reset.o txe_thread_resume.o txe_thread_suspend.o txe_thread_terminate.o txe_thread_time_slice_change.o +arm-none-eabi-ar -r tx.a txe_thread_wait_abort.o txe_timer_activate.o txe_timer_change.o txe_timer_create.o txe_timer_deactivate.o txe_timer_delete.o txe_timer_info_get.o diff --git a/ports/cortex_a17/gnu/example_build/build_threadx_sample.bat b/ports/cortex_a17/gnu/example_build/build_threadx_sample.bat new file mode 100644 index 00000000..ce088835 --- /dev/null +++ b/ports/cortex_a17/gnu/example_build/build_threadx_sample.bat @@ -0,0 +1,6 @@ +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 reset.S +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 crt0.S +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 tx_initialize_low_level.S +arm-none-eabi-gcc -c -g -mcpu=cortex-a17 -I../../../../common/inc -I../inc sample_threadx.c +arm-none-eabi-gcc -g -mcpu=cortex-a17 -T sample_threadx.ld --specs=nosys.specs -o sample_threadx.out -Wl,-Map=sample_threadx.map tx_initialize_low_level.o sample_threadx.o tx.a + diff --git a/ports/cortex_a17/gnu/example_build/crt0.S b/ports/cortex_a17/gnu/example_build/crt0.S new file mode 100644 index 00000000..56b6c958 --- /dev/null +++ b/ports/cortex_a17/gnu/example_build/crt0.S @@ -0,0 +1,90 @@ + +/* .text is used instead of .section .text so it works with arm-aout too. */ + .text + .code 32 + .align 0 + + .global _mainCRTStartup + .global _start + .global start +start: +_start: +_mainCRTStartup: + +/* Start by setting up a stack */ + /* Set up the stack pointer to a fixed value */ + ldr r3, .LC0 + mov sp, r3 + /* Setup a default stack-limit in case the code has been + compiled with "-mapcs-stack-check". Hard-wiring this value + is not ideal, since there is currently no support for + checking that the heap and stack have not collided, or that + this default 64k is enough for the program being executed. + However, it ensures that this simple crt0 world will not + immediately cause an overflow event: */ + sub sl, sp, #64 << 10 /* Still assumes 256bytes below sl */ + mov a2, #0 /* Second arg: fill value */ + mov fp, a2 /* Null frame pointer */ + mov r7, a2 /* Null frame pointer for Thumb */ + + ldr a1, .LC1 /* First arg: start of memory block */ + ldr a3, .LC2 + sub a3, a3, a1 /* Third arg: length of block */ + + + + bl memset + mov r0, #0 /* no arguments */ + mov r1, #0 /* no argv either */ +#ifdef __USES_INITFINI__ + /* Some arm/elf targets use the .init and .fini sections + to create constructors and destructors, and for these + targets we need to call the _init function and arrange + for _fini to be called at program exit. */ + mov r4, r0 + mov r5, r1 +/* ldr r0, .Lfini */ + bl atexit +/* bl init */ + mov r0, r4 + mov r1, r5 +#endif + bl main + + bl exit /* Should not return. */ + + + /* For Thumb, constants must be after the code since only + positive offsets are supported for PC relative addresses. */ + + .align 0 +.LC0: +.LC1: + .word __bss_start__ +.LC2: + .word __bss_end__ +/* +#ifdef __USES_INITFINI__ +.Lfini: + .word _fini +#endif */ + /* Return ... */ +#ifdef __APCS_26__ + movs pc, lr +#else +#ifdef __THUMB_INTERWORK + bx lr +#else + mov pc, lr +#endif +#endif + + +/* Workspace for Angel calls. */ + .data +/* Data returned by monitor SWI. */ +.global __stack_base__ +HeapBase: .word 0 +HeapLimit: .word 0 +__stack_base__: .word 0 +StackLimit: .word 0 diff --git a/ports/cortex_a17/gnu/example_build/reset.S b/ports/cortex_a17/gnu/example_build/reset.S new file mode 100644 index 00000000..597e9d9a --- /dev/null +++ b/ports/cortex_a17/gnu/example_build/reset.S @@ -0,0 +1,64 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Initialize */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .arm + + .global _start + .global __tx_undefined + .global __tx_swi_interrupt + .global __tx_prefetch_handler + .global __tx_abort_handler + .global __tx_reserved_handler + .global __tx_irq_handler + .global __tx_fiq_handler + +/* Define the vector area. This should be located or copied to 0. */ + + .text + .global __vectors +__vectors: + + LDR pc, STARTUP // Reset goes to startup function + LDR pc, UNDEFINED // Undefined handler + LDR pc, SWI // Software interrupt handler + LDR pc, PREFETCH // Prefetch exception handler + LDR pc, ABORT // Abort exception handler + LDR pc, RESERVED // Reserved exception handler + LDR pc, IRQ // IRQ interrupt handler + LDR pc, FIQ // FIQ interrupt handler + +STARTUP: + .word _start // Reset goes to C startup function +UNDEFINED: + .word __tx_undefined // Undefined handler +SWI: + .word __tx_swi_interrupt // Software interrupt handler +PREFETCH: + .word __tx_prefetch_handler // Prefetch exception handler +ABORT: + .word __tx_abort_handler // Abort exception handler +RESERVED: + .word __tx_reserved_handler // Reserved exception handler +IRQ: + .word __tx_irq_handler // IRQ interrupt handler +FIQ: + .word __tx_fiq_handler // FIQ interrupt handler diff --git a/ports/cortex_a17/gnu/example_build/sample_threadx.c b/ports/cortex_a17/gnu/example_build/sample_threadx.c new file mode 100644 index 00000000..8c61de06 --- /dev/null +++ b/ports/cortex_a17/gnu/example_build/sample_threadx.c @@ -0,0 +1,369 @@ +/* This is a small demo of the high-performance ThreadX kernel. It includes examples of eight + threads of different priorities, using a message queue, semaphore, mutex, event flags group, + byte pool, and block pool. */ + +#include "tx_api.h" + +#define DEMO_STACK_SIZE 1024 +#define DEMO_BYTE_POOL_SIZE 9120 +#define DEMO_BLOCK_POOL_SIZE 100 +#define DEMO_QUEUE_SIZE 100 + + +/* Define the ThreadX object control blocks... */ + +TX_THREAD thread_0; +TX_THREAD thread_1; +TX_THREAD thread_2; +TX_THREAD thread_3; +TX_THREAD thread_4; +TX_THREAD thread_5; +TX_THREAD thread_6; +TX_THREAD thread_7; +TX_QUEUE queue_0; +TX_SEMAPHORE semaphore_0; +TX_MUTEX mutex_0; +TX_EVENT_FLAGS_GROUP event_flags_0; +TX_BYTE_POOL byte_pool_0; +TX_BLOCK_POOL block_pool_0; + + +/* Define the counters used in the demo application... */ + +ULONG thread_0_counter; +ULONG thread_1_counter; +ULONG thread_1_messages_sent; +ULONG thread_2_counter; +ULONG thread_2_messages_received; +ULONG thread_3_counter; +ULONG thread_4_counter; +ULONG thread_5_counter; +ULONG thread_6_counter; +ULONG thread_7_counter; + + +/* Define thread prototypes. */ + +void thread_0_entry(ULONG thread_input); +void thread_1_entry(ULONG thread_input); +void thread_2_entry(ULONG thread_input); +void thread_3_and_4_entry(ULONG thread_input); +void thread_5_entry(ULONG thread_input); +void thread_6_and_7_entry(ULONG thread_input); + + +/* Define main entry point. */ + +int main() +{ + + /* Enter the ThreadX kernel. */ + tx_kernel_enter(); +} + + +/* Define what the initial system looks like. */ + +void tx_application_define(void *first_unused_memory) +{ + +CHAR *pointer = TX_NULL; + + + /* Create a byte memory pool from which to allocate the thread stacks. */ + tx_byte_pool_create(&byte_pool_0, "byte pool 0", first_unused_memory, DEMO_BYTE_POOL_SIZE); + + /* Put system definition stuff in here, e.g. thread creates and other assorted + create information. */ + + /* Allocate the stack for thread 0. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 1, 1, TX_NO_TIME_SLICE, TX_AUTO_START); + + + /* Allocate the stack for thread 1. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create threads 1 and 2. These threads pass information through a ThreadX + message queue. It is also interesting to note that these threads have a time + slice. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, DEMO_STACK_SIZE, + 16, 16, 4, TX_AUTO_START); + + /* Allocate the stack for thread 2. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, DEMO_STACK_SIZE, + 16, 16, 4, TX_AUTO_START); + + /* Allocate the stack for thread 3. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create threads 3 and 4. These threads compete for a ThreadX counting semaphore. + An interesting thing here is that both threads share the same instruction area. */ + tx_thread_create(&thread_3, "thread 3", thread_3_and_4_entry, 3, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 4. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + tx_thread_create(&thread_4, "thread 4", thread_3_and_4_entry, 4, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 5. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create thread 5. This thread simply pends on an event flag which will be set + by thread_0. */ + tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 6. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create threads 6 and 7. These threads compete for a ThreadX mutex. */ + tx_thread_create(&thread_6, "thread 6", thread_6_and_7_entry, 6, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 7. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + tx_thread_create(&thread_7, "thread 7", thread_6_and_7_entry, 7, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the message queue. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_QUEUE_SIZE*sizeof(ULONG), TX_NO_WAIT); + + /* Create the message queue shared by threads 1 and 2. */ + tx_queue_create(&queue_0, "queue 0", TX_1_ULONG, pointer, DEMO_QUEUE_SIZE*sizeof(ULONG)); + + /* Create the semaphore used by threads 3 and 4. */ + tx_semaphore_create(&semaphore_0, "semaphore 0", 1); + + /* Create the event flags group used by threads 1 and 5. */ + tx_event_flags_create(&event_flags_0, "event flags 0"); + + /* Create the mutex used by thread 6 and 7 without priority inheritance. */ + tx_mutex_create(&mutex_0, "mutex 0", TX_NO_INHERIT); + + /* Allocate the memory for a small block pool. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_BLOCK_POOL_SIZE, TX_NO_WAIT); + + /* Create a block memory pool to allocate a message buffer from. */ + tx_block_pool_create(&block_pool_0, "block pool 0", sizeof(ULONG), pointer, DEMO_BLOCK_POOL_SIZE); + + /* Allocate a block and release the block memory. */ + tx_block_allocate(&block_pool_0, (VOID **) &pointer, TX_NO_WAIT); + + /* Release the block back to the pool. */ + tx_block_release(pointer); +} + + + +/* Define the test threads. */ + +void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + + /* This thread simply sits in while-forever-sleep loop. */ + while(1) + { + + /* Increment the thread counter. */ + thread_0_counter++; + + /* Sleep for 10 ticks. */ + tx_thread_sleep(10); + + /* Set event flag 0 to wakeup thread 5. */ + status = tx_event_flags_set(&event_flags_0, 0x1, TX_OR); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + } +} + + +void thread_1_entry(ULONG thread_input) +{ + +UINT status; + + + /* This thread simply sends messages to a queue shared by thread 2. */ + while(1) + { + + /* Increment the thread counter. */ + thread_1_counter++; + + /* Send message to queue 0. */ + status = tx_queue_send(&queue_0, &thread_1_messages_sent, TX_WAIT_FOREVER); + + /* Check completion status. */ + if (status != TX_SUCCESS) + break; + + /* Increment the message sent. */ + thread_1_messages_sent++; + } +} + + +void thread_2_entry(ULONG thread_input) +{ + +ULONG received_message; +UINT status; + + /* This thread retrieves messages placed on the queue by thread 1. */ + while(1) + { + + /* Increment the thread counter. */ + thread_2_counter++; + + /* Retrieve a message from the queue. */ + status = tx_queue_receive(&queue_0, &received_message, TX_WAIT_FOREVER); + + /* Check completion status and make sure the message is what we + expected. */ + if ((status != TX_SUCCESS) || (received_message != thread_2_messages_received)) + break; + + /* Otherwise, all is okay. Increment the received message count. */ + thread_2_messages_received++; + } +} + + +void thread_3_and_4_entry(ULONG thread_input) +{ + +UINT status; + + + /* This function is executed from thread 3 and thread 4. As the loop + below shows, these function compete for ownership of semaphore_0. */ + while(1) + { + + /* Increment the thread counter. */ + if (thread_input == 3) + thread_3_counter++; + else + thread_4_counter++; + + /* Get the semaphore with suspension. */ + status = tx_semaphore_get(&semaphore_0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Sleep for 2 ticks to hold the semaphore. */ + tx_thread_sleep(2); + + /* Release the semaphore. */ + status = tx_semaphore_put(&semaphore_0); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + } +} + + +void thread_5_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_flags; + + + /* This thread simply waits for an event in a forever loop. */ + while(1) + { + + /* Increment the thread counter. */ + thread_5_counter++; + + /* Wait for event flag 0. */ + status = tx_event_flags_get(&event_flags_0, 0x1, TX_OR_CLEAR, + &actual_flags, TX_WAIT_FOREVER); + + /* Check status. */ + if ((status != TX_SUCCESS) || (actual_flags != 0x1)) + break; + } +} + + +void thread_6_and_7_entry(ULONG thread_input) +{ + +UINT status; + + + /* This function is executed from thread 6 and thread 7. As the loop + below shows, these function compete for ownership of mutex_0. */ + while(1) + { + + /* Increment the thread counter. */ + if (thread_input == 6) + thread_6_counter++; + else + thread_7_counter++; + + /* Get the mutex with suspension. */ + status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Get the mutex again with suspension. This shows + that an owning thread may retrieve the mutex it + owns multiple times. */ + status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Sleep for 2 ticks to hold the mutex. */ + tx_thread_sleep(2); + + /* Release the mutex. */ + status = tx_mutex_put(&mutex_0); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Release the mutex again. This will actually + release ownership since it was obtained twice. */ + status = tx_mutex_put(&mutex_0); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + } +} diff --git a/ports/cortex_a17/gnu/example_build/sample_threadx.ld b/ports/cortex_a17/gnu/example_build/sample_threadx.ld new file mode 100644 index 00000000..3dea4e1c --- /dev/null +++ b/ports/cortex_a17/gnu/example_build/sample_threadx.ld @@ -0,0 +1,239 @@ +OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", + "elf32-littlearm") +OUTPUT_ARCH(arm) +/* ENTRY(_start) */ +/* Do we need any of these for elf? + __DYNAMIC = 0; */ +SECTIONS +{ + . = 0x00000000; + + .vectors : {reset.o(.text) } + + /* Read-only sections, merged into text segment: */ + . = 0x00001000; + .interp : { *(.interp) } + .hash : { *(.hash) } + .dynsym : { *(.dynsym) } + .dynstr : { *(.dynstr) } + .gnu.version : { *(.gnu.version) } + .gnu.version_d : { *(.gnu.version_d) } + .gnu.version_r : { *(.gnu.version_r) } + .rel.init : { *(.rel.init) } + .rela.init : { *(.rela.init) } + .rel.text : + { + *(.rel.text) + *(.rel.text.*) + *(.rel.gnu.linkonce.t*) + } + .rela.text : + { + *(.rela.text) + *(.rela.text.*) + *(.rela.gnu.linkonce.t*) + } + .rel.fini : { *(.rel.fini) } + .rela.fini : { *(.rela.fini) } + .rel.rodata : + { + *(.rel.rodata) + *(.rel.rodata.*) + *(.rel.gnu.linkonce.r*) + } + .rela.rodata : + { + *(.rela.rodata) + *(.rela.rodata.*) + *(.rela.gnu.linkonce.r*) + } + .rel.data : + { + *(.rel.data) + *(.rel.data.*) + *(.rel.gnu.linkonce.d*) + } + .rela.data : + { + *(.rela.data) + *(.rela.data.*) + *(.rela.gnu.linkonce.d*) + } + .rel.ctors : { *(.rel.ctors) } + .rela.ctors : { *(.rela.ctors) } + .rel.dtors : { *(.rel.dtors) } + .rela.dtors : { *(.rela.dtors) } + .rel.got : { *(.rel.got) } + .rela.got : { *(.rela.got) } + .rel.sdata : + { + *(.rel.sdata) + *(.rel.sdata.*) + *(.rel.gnu.linkonce.s*) + } + .rela.sdata : + { + *(.rela.sdata) + *(.rela.sdata.*) + *(.rela.gnu.linkonce.s*) + } + .rel.sbss : { *(.rel.sbss) } + .rela.sbss : { *(.rela.sbss) } + .rel.bss : { *(.rel.bss) } + .rela.bss : { *(.rela.bss) } + .rel.plt : { *(.rel.plt) } + .rela.plt : { *(.rela.plt) } + .plt : { *(.plt) } + .text : + { + *(.text) + *(.text.*) + *(.stub) + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + *(.gnu.linkonce.t*) + *(.glue_7t) *(.glue_7) + } =0 + .init : + { + KEEP (*(.init)) + } =0 + _etext = .; + PROVIDE (etext = .); + .fini : + { + KEEP (*(.fini)) + } =0 + .rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r*) } + .rodata1 : { *(.rodata1) } + .eh_frame_hdr : { *(.eh_frame_hdr) } + /* Adjust the address for the data segment. We want to adjust up to + the same address within the page on the next page up. */ + . = ALIGN(256) + (. & (256 - 1)); + .data : + { + *(.data) + *(.data.*) + *(.gnu.linkonce.d*) + SORT(CONSTRUCTORS) + } + .data1 : { *(.data1) } + .eh_frame : { KEEP (*(.eh_frame)) } + .gcc_except_table : { *(.gcc_except_table) } + .ctors : + { + /* gcc uses crtbegin.o to find the start of + the constructors, so we make sure it is + first. Because this is a wildcard, it + doesn't matter if the user does not + actually link against crtbegin.o; the + linker won't look for a file to match a + wildcard. The wildcard also means that it + doesn't matter which directory crtbegin.o + is in. */ + KEEP (*crtbegin.o(.ctors)) + /* We don't want to include the .ctor section from + from the crtend.o file until after the sorted ctors. + The .ctor section from the crtend file contains the + end of ctors marker and it must be last */ + KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*(.ctors)) + } + .dtors : + { + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*(.dtors)) + } + .jcr : { KEEP (*(.jcr)) } + .got : { *(.got.plt) *(.got) } + .dynamic : { *(.dynamic) } + /* We want the small data sections together, so single-instruction offsets + can access them all, and initialized data all before uninitialized, so + we can shorten the on-disk segment size. */ + .sdata : + { + *(.sdata) + *(.sdata.*) + *(.gnu.linkonce.s.*) + } + _edata = .; + PROVIDE (edata = .); + __bss_start = .; + __bss_start__ = .; + .sbss : + { + *(.dynsbss) + *(.sbss) + *(.sbss.*) + *(.scommon) + } + .bss : + { + *(.dynbss) + *(.bss) + *(.bss.*) + *(COMMON) + /* Align here to ensure that the .bss section occupies space up to + _end. Align after .bss to ensure correct alignment even if the + .bss section disappears because there are no input sections. */ + . = ALIGN(32 / 8); + } + . = ALIGN(32 / 8); + + _bss_end__ = . ; __bss_end__ = . ; + PROVIDE (end = .); + + .stack : + { + + _stack_bottom = ABSOLUTE(.) ; + + /* Allocate room for stack. This must be big enough for the IRQ, FIQ, and + SYS stack if nested interrupts are enabled. */ + . = ALIGN(8) ; + . += 4096 ; + _sp = . - 16 ; + _stack_top = ABSOLUTE(.) ; + } + + _end = .; __end__ = . ; + + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + + /* These must appear regardless of . */ +} diff --git a/ports/cortex_a17/gnu/example_build/tx_initialize_low_level.S b/ports/cortex_a17/gnu/example_build/tx_initialize_low_level.S new file mode 100644 index 00000000..7de5d3ce --- /dev/null +++ b/ports/cortex_a17/gnu/example_build/tx_initialize_low_level.S @@ -0,0 +1,305 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Initialize */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .arm + +SVC_MODE = 0xD3 // Disable IRQ/FIQ SVC mode +IRQ_MODE = 0xD2 // Disable IRQ/FIQ IRQ mode +FIQ_MODE = 0xD1 // Disable IRQ/FIQ FIQ mode +SYS_MODE = 0xDF // Disable IRQ/FIQ SYS mode +FIQ_STACK_SIZE = 512 // FIQ stack size +IRQ_STACK_SIZE = 1024 // IRQ stack size +SYS_STACK_SIZE = 1024 // System stack size + + .global _tx_thread_system_stack_ptr + .global _tx_initialize_unused_memory + .global _tx_thread_context_save + .global _tx_thread_context_restore + .global _tx_timer_interrupt + .global _end + .global _sp + .global _stack_bottom + + +/* Define the 16-bit Thumb mode veneer for _tx_initialize_low_level for + applications calling this function from to 16-bit Thumb mode. */ + + .text + .align 2 + .thumb + .global $_tx_initialize_low_level + .type $_tx_initialize_low_level,function +$_tx_initialize_low_level: + BX pc // Switch to 32-bit mode + NOP // + .arm + STMFD sp!, {lr} // Save return address + BL _tx_initialize_low_level // Call _tx_initialize_low_level function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_initialize_low_level ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for any low-level processor */ +/* initialization, including setting up interrupt vectors, setting */ +/* up a periodic timer interrupt source, saving the system stack */ +/* pointer for use in ISR processing later, and finding the first */ +/* available RAM memory address for tx_application_define. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_initialize_kernel_enter ThreadX entry function */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_initialize_low_level + .type _tx_initialize_low_level,function +_tx_initialize_low_level: + + /* We must be in SVC mode at this point! */ + + /* Setup various stack pointers. */ + + LDR r1, =_sp // Get pointer to stack area + +#ifdef TX_ENABLE_IRQ_NESTING + + /* Setup the system mode stack for nested interrupt support */ + + LDR r2, =SYS_STACK_SIZE // Pickup stack size + MOV r3, #SYS_MODE // Build SYS mode CPSR + MSR CPSR_c, r3 // Enter SYS mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup SYS stack pointer + SUB r1, r1, r2 // Calculate start of next stack +#endif + + LDR r2, =FIQ_STACK_SIZE // Pickup stack size + MOV r0, #FIQ_MODE // Build FIQ mode CPSR + MSR CPSR, r0 // Enter FIQ mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup FIQ stack pointer + SUB r1, r1, r2 // Calculate start of next stack + LDR r2, =IRQ_STACK_SIZE // Pickup IRQ stack size + MOV r0, #IRQ_MODE // Build IRQ mode CPSR + MSR CPSR, r0 // Enter IRQ mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup IRQ stack pointer + SUB r3, r1, r2 // Calculate end of IRQ stack + MOV r0, #SVC_MODE // Build SVC mode CPSR + MSR CPSR, r0 // Enter SVC mode + LDR r2, =_stack_bottom // Pickup stack bottom + CMP r3, r2 // Compare the current stack end with the bottom +_stack_error_loop: + BLT _stack_error_loop // If the IRQ stack exceeds the stack bottom, just sit here! + + LDR r2, =_tx_thread_system_stack_ptr // Pickup stack pointer + STR r1, [r2] // Save the system stack + + LDR r1, =_end // Get end of non-initialized RAM area + LDR r2, =_tx_initialize_unused_memory // Pickup unused memory ptr address + ADD r1, r1, #8 // Increment to next free word + STR r1, [r2] // Save first free memory address + +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif + +/* Define shells for each of the interrupt vectors. */ + + .global __tx_undefined +__tx_undefined: + B __tx_undefined // Undefined handler + + .global __tx_swi_interrupt +__tx_swi_interrupt: + B __tx_swi_interrupt // Software interrupt handler + + .global __tx_prefetch_handler +__tx_prefetch_handler: + B __tx_prefetch_handler // Prefetch exception handler + + .global __tx_abort_handler +__tx_abort_handler: + B __tx_abort_handler // Abort exception handler + + .global __tx_reserved_handler +__tx_reserved_handler: + B __tx_reserved_handler // Reserved exception handler + + .global __tx_irq_handler + .global __tx_irq_processing_return +__tx_irq_handler: + + /* Jump to context save to save system context. */ + B _tx_thread_context_save +__tx_irq_processing_return: +// + /* At this point execution is still in the IRQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. In + addition, IRQ interrupts may be re-enabled - with certain restrictions - + if nested IRQ interrupts are desired. Interrupts may be re-enabled over + small code sequences where lr is saved before enabling interrupts and + restored after interrupts are again disabled. */ + + /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start + from IRQ mode with interrupts disabled. This routine switches to the + system mode and returns with IRQ interrupts enabled. + + NOTE: It is very important to ensure all IRQ interrupts are cleared + prior to enabling nested IRQ interrupts. */ +#ifdef TX_ENABLE_IRQ_NESTING + BL _tx_thread_irq_nesting_start +#endif + + /* For debug purpose, execute the timer interrupt processing here. In + a real system, some kind of status indication would have to be checked + before the timer interrupt handler could be called. */ + + BL _tx_timer_interrupt // Timer interrupt handler + + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_context_restore. + This routine returns in processing in IRQ mode with interrupts disabled. */ +#ifdef TX_ENABLE_IRQ_NESTING + BL _tx_thread_irq_nesting_end +#endif + + /* Jump to context restore to restore system context. */ + B _tx_thread_context_restore + + + /* This is an example of a vectored IRQ handler. */ + + + + /* Save initial context and call context save to prepare for + vectored ISR execution. */ + + /* At this point execution is still in the IRQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. In + addition, IRQ interrupts may be re-enabled - with certain restrictions - + if nested IRQ interrupts are desired. Interrupts may be re-enabled over + small code sequences where lr is saved before enabling interrupts and + restored after interrupts are again disabled. */ + + + /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start + from IRQ mode with interrupts disabled. This routine switches to the + system mode and returns with IRQ interrupts enabled. + + NOTE: It is very important to ensure all IRQ interrupts are cleared + prior to enabling nested IRQ interrupts. */ + + /* Application IRQ handlers can be called here! */ + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_context_restore. + This routine returns in processing in IRQ mode with interrupts disabled. */ + + + +#ifdef TX_ENABLE_FIQ_SUPPORT + .global __tx_fiq_handler + .global __tx_fiq_processing_return +__tx_fiq_handler: + + /* Jump to fiq context save to save system context. */ + B _tx_thread_fiq_context_save +__tx_fiq_processing_return: + + /* At this point execution is still in the FIQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. */ + + /* Interrupt nesting is allowed after calling _tx_thread_fiq_nesting_start + from FIQ mode with interrupts disabled. This routine switches to the + system mode and returns with FIQ interrupts enabled. + + NOTE: It is very important to ensure all FIQ interrupts are cleared + prior to enabling nested FIQ interrupts. */ +#ifdef TX_ENABLE_FIQ_NESTING + BL _tx_thread_fiq_nesting_start +#endif + + /* Application FIQ handlers can be called here! */ + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_fiq_context_restore. */ +#ifdef TX_ENABLE_FIQ_NESTING + BL _tx_thread_fiq_nesting_end +#endif + + /* Jump to fiq context restore to restore system context. */ + B _tx_thread_fiq_context_restore + + +#else + .global __tx_fiq_handler +__tx_fiq_handler: + B __tx_fiq_handler // FIQ interrupt handler +#endif + + +BUILD_OPTIONS: + .word _tx_build_options // Reference to bring in +VERSION_ID: + .word _tx_version_id // Reference to bring in + + + diff --git a/ports/cortex_a17/gnu/inc/tx_port.h b/ports/cortex_a17/gnu/inc/tx_port.h new file mode 100644 index 00000000..19463de1 --- /dev/null +++ b/ports/cortex_a17/gnu/inc/tx_port.h @@ -0,0 +1,328 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Port Specific */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* tx_port.h ARMv7-A */ +/* 6.1.11 */ +/* */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This file contains data type definitions that make the ThreadX */ +/* real-time kernel function identically on a variety of different */ +/* processor architectures. For example, the size or number of bits */ +/* in an "int" data type vary between microprocessor architectures and */ +/* even C compilers for the same microprocessor. ThreadX does not */ +/* directly use native C data types. Instead, ThreadX creates its */ +/* own special types that can be mapped to actual data types by this */ +/* file to guarantee consistency in the interface and functionality. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-02-2021 Bhupendra Naphade Modified comment(s),updated */ +/* macro definition, */ +/* resulting in version 6.1.6 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + +#ifndef TX_PORT_H +#define TX_PORT_H + + +/* Determine if the optional ThreadX user define file should be used. */ + +#ifdef TX_INCLUDE_USER_DEFINE_FILE + + +/* Yes, include the user defines in tx_user.h. The defines in this file may + alternately be defined on the command line. */ + +#include "tx_user.h" +#endif + + +/* Define compiler library include files. */ + +#include +#include + + +/* Define ThreadX basic types for this port. */ + +#define VOID void +typedef char CHAR; +typedef unsigned char UCHAR; +typedef int INT; +typedef unsigned int UINT; +typedef long LONG; +typedef unsigned long ULONG; +typedef short SHORT; +typedef unsigned short USHORT; + + +/* Define the priority levels for ThreadX. Legal values range + from 32 to 1024 and MUST be evenly divisible by 32. */ + +#ifndef TX_MAX_PRIORITIES +#define TX_MAX_PRIORITIES 32 +#endif + + +/* Define the minimum stack for a ThreadX thread on this processor. If the size supplied during + thread creation is less than this value, the thread create call will return an error. */ + +#ifndef TX_MINIMUM_STACK +#define TX_MINIMUM_STACK 200 /* Minimum stack size for this port */ +#endif + + +/* Define the system timer thread's default stack size and priority. These are only applicable + if TX_TIMER_PROCESS_IN_ISR is not defined. */ + +#ifndef TX_TIMER_THREAD_STACK_SIZE +#define TX_TIMER_THREAD_STACK_SIZE 1024 /* Default timer thread stack size */ +#endif + +#ifndef TX_TIMER_THREAD_PRIORITY +#define TX_TIMER_THREAD_PRIORITY 0 /* Default timer thread priority */ +#endif + + +/* Define various constants for the ThreadX ARM port. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT +#define TX_INT_DISABLE 0xC0 /* Disable IRQ & FIQ interrupts */ +#else +#define TX_INT_DISABLE 0x80 /* Disable IRQ interrupts */ +#endif +#define TX_INT_ENABLE 0x00 /* Enable IRQ interrupts */ + + +/* Define the clock source for trace event entry time stamp. The following two item are port specific. + For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock + source constants would be: + +#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_MASK 0x0000FFFFUL + +*/ + +#ifndef TX_TRACE_TIME_SOURCE +#define TX_TRACE_TIME_SOURCE ++_tx_trace_simulated_time +#endif +#ifndef TX_TRACE_TIME_MASK +#define TX_TRACE_TIME_MASK 0xFFFFFFFFUL +#endif + + +/* Define the port specific options for the _tx_build_options variable. This variable indicates + how the ThreadX library was built. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT +#define TX_FIQ_ENABLED 1 +#else +#define TX_FIQ_ENABLED 0 +#endif + +#ifdef TX_ENABLE_IRQ_NESTING +#define TX_IRQ_NESTING_ENABLED 2 +#else +#define TX_IRQ_NESTING_ENABLED 0 +#endif + +#ifdef TX_ENABLE_FIQ_NESTING +#define TX_FIQ_NESTING_ENABLED 4 +#else +#define TX_FIQ_NESTING_ENABLED 0 +#endif + +#define TX_PORT_SPECIFIC_BUILD_OPTIONS TX_FIQ_ENABLED | TX_IRQ_NESTING_ENABLED | TX_FIQ_NESTING_ENABLED + + +/* Define the in-line initialization constant so that modules with in-line + initialization capabilities can prevent their initialization from being + a function call. */ + +#define TX_INLINE_INITIALIZATION + + +/* Determine whether or not stack checking is enabled. By default, ThreadX stack checking is + disabled. When the following is defined, ThreadX thread stack checking is enabled. If stack + checking is enabled (TX_ENABLE_STACK_CHECKING is defined), the TX_DISABLE_STACK_FILLING + define is negated, thereby forcing the stack fill which is necessary for the stack checking + logic. */ + +#ifdef TX_ENABLE_STACK_CHECKING +#undef TX_DISABLE_STACK_FILLING +#endif + + +/* Define the TX_THREAD control block extensions for this port. The main reason + for the multiple macros is so that backward compatibility can be maintained with + existing ThreadX kernel awareness modules. */ + +#define TX_THREAD_EXTENSION_0 +#define TX_THREAD_EXTENSION_1 +#define TX_THREAD_EXTENSION_2 ULONG tx_thread_vfp_enable; +#define TX_THREAD_EXTENSION_3 + + +/* Define the port extensions of the remaining ThreadX objects. */ + +#define TX_BLOCK_POOL_EXTENSION +#define TX_BYTE_POOL_EXTENSION +#define TX_EVENT_FLAGS_GROUP_EXTENSION +#define TX_MUTEX_EXTENSION +#define TX_QUEUE_EXTENSION +#define TX_SEMAPHORE_EXTENSION +#define TX_TIMER_EXTENSION + + +/* Define the user extension field of the thread control block. Nothing + additional is needed for this port so it is defined as white space. */ + +#ifndef TX_THREAD_USER_EXTENSION +#define TX_THREAD_USER_EXTENSION +#endif + + +/* Define the macros for processing extensions in tx_thread_create, tx_thread_delete, + tx_thread_shell_entry, and tx_thread_terminate. */ + + +#define TX_THREAD_CREATE_EXTENSION(thread_ptr) +#define TX_THREAD_DELETE_EXTENSION(thread_ptr) +#define TX_THREAD_COMPLETED_EXTENSION(thread_ptr) +#define TX_THREAD_TERMINATED_EXTENSION(thread_ptr) + + +/* Define the ThreadX object creation extensions for the remaining objects. */ + +#define TX_BLOCK_POOL_CREATE_EXTENSION(pool_ptr) +#define TX_BYTE_POOL_CREATE_EXTENSION(pool_ptr) +#define TX_EVENT_FLAGS_GROUP_CREATE_EXTENSION(group_ptr) +#define TX_MUTEX_CREATE_EXTENSION(mutex_ptr) +#define TX_QUEUE_CREATE_EXTENSION(queue_ptr) +#define TX_SEMAPHORE_CREATE_EXTENSION(semaphore_ptr) +#define TX_TIMER_CREATE_EXTENSION(timer_ptr) + + +/* Define the ThreadX object deletion extensions for the remaining objects. */ + +#define TX_BLOCK_POOL_DELETE_EXTENSION(pool_ptr) +#define TX_BYTE_POOL_DELETE_EXTENSION(pool_ptr) +#define TX_EVENT_FLAGS_GROUP_DELETE_EXTENSION(group_ptr) +#define TX_MUTEX_DELETE_EXTENSION(mutex_ptr) +#define TX_QUEUE_DELETE_EXTENSION(queue_ptr) +#define TX_SEMAPHORE_DELETE_EXTENSION(semaphore_ptr) +#define TX_TIMER_DELETE_EXTENSION(timer_ptr) + + +/* Determine if the ARM architecture has the CLZ instruction. This is available on + architectures v5 and above. If available, redefine the macro for calculating the + lowest bit set. */ + +#if __TARGET_ARCH_ARM > 4 + +#ifndef __thumb__ + +#define TX_LOWEST_SET_BIT_CALCULATE(m, b) m = m & ((ULONG) (-((LONG) m))); \ + asm volatile (" CLZ %0,%1 ": "=r" (b) : "r" (m) ); \ + b = 31 - b; +#endif +#endif + + +/* Define ThreadX interrupt lockout and restore macros for protection on + access of critical kernel information. The restore interrupt macro must + restore the interrupt posture of the running thread prior to the value + present prior to the disable macro. In most cases, the save area macro + is used to define a local function save area for the disable and restore + macros. */ + +#ifdef __thumb__ + +unsigned int _tx_thread_interrupt_disable(void); +unsigned int _tx_thread_interrupt_restore(UINT old_posture); + + +#define TX_INTERRUPT_SAVE_AREA UINT interrupt_save; + +#define TX_DISABLE interrupt_save = _tx_thread_interrupt_disable(); +#define TX_RESTORE _tx_thread_interrupt_restore(interrupt_save); + +#else + +#define TX_INTERRUPT_SAVE_AREA UINT interrupt_save, tx_temp; + +#ifdef TX_ENABLE_FIQ_SUPPORT +#define TX_DISABLE asm volatile (" MRS %0,CPSR; CPSID if ": "=r" (interrupt_save) ); +#else +#define TX_DISABLE asm volatile (" MRS %0,CPSR; CPSID i ": "=r" (interrupt_save) ); +#endif + +#define TX_RESTORE asm volatile (" MSR CPSR_c,%0 "::"r" (interrupt_save) ); + +#endif + + +/* Define VFP extension for the ARMv7-A. Each is assumed to be called in the context of the executing + thread. */ + +void tx_thread_vfp_enable(void); +void tx_thread_vfp_disable(void); + + +/* Define the interrupt lockout macros for each ThreadX object. */ + +#define TX_BLOCK_POOL_DISABLE TX_DISABLE +#define TX_BYTE_POOL_DISABLE TX_DISABLE +#define TX_EVENT_FLAGS_GROUP_DISABLE TX_DISABLE +#define TX_MUTEX_DISABLE TX_DISABLE +#define TX_QUEUE_DISABLE TX_DISABLE +#define TX_SEMAPHORE_DISABLE TX_DISABLE + + +/* Define the version ID of ThreadX. This may be utilized by the application. */ + +#ifdef TX_THREAD_INIT +CHAR _tx_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX ARMv7-A Version 6.1.11 *"; +#else +extern CHAR _tx_version_id[]; +#endif + + +#endif + diff --git a/ports/cortex_a17/gnu/src/tx_thread_context_restore.S b/ports/cortex_a17/gnu/src/tx_thread_context_restore.S new file mode 100644 index 00000000..fae7e72d --- /dev/null +++ b/ports/cortex_a17/gnu/src/tx_thread_context_restore.S @@ -0,0 +1,222 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .arm + +#ifdef TX_ENABLE_FIQ_SUPPORT +SVC_MODE = 0xD3 // Disable IRQ/FIQ, SVC mode +IRQ_MODE = 0xD2 // Disable IRQ/FIQ, IRQ mode +#else +SVC_MODE = 0x93 // Disable IRQ, SVC mode +IRQ_MODE = 0x92 // Disable IRQ, IRQ mode +#endif + + .global _tx_thread_system_state + .global _tx_thread_current_ptr + .global _tx_thread_execute_ptr + .global _tx_timer_time_slice + .global _tx_thread_schedule + .global _tx_thread_preempt_disable + + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_restore + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_context_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function restores the interrupt context if it is processing a */ +/* nested interrupt. If not, it returns to the interrupt thread if no */ +/* preemption is necessary. Otherwise, if preemption is necessary or */ +/* if no thread was running, the function returns to the scheduler. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling routine */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs Interrupt Service Routines */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_context_restore + .type _tx_thread_context_restore,function +_tx_thread_context_restore: + + /* Lockout interrupts. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Disable IRQ and FIQ interrupts +#else + CPSID i // Disable IRQ interrupts +#endif + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR exit function to indicate an ISR is complete. */ + + BL _tx_execution_isr_exit // Call the ISR exit function +#endif + + /* Determine if interrupts are nested. */ + + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + SUB r2, r2, #1 // Decrement the counter + STR r2, [r3] // Store the counter + CMP r2, #0 // Was this the first interrupt? + BEQ __tx_thread_not_nested_restore // If so, not a nested restore + + /* Interrupts are nested. */ + + /* Just recover the saved registers and return to the point of + interrupt. */ + + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_not_nested_restore: + + /* Determine if a thread was interrupted and no preemption is required. */ + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup actual current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_restore // Yes, idle system was interrupted + + LDR r3, =_tx_thread_preempt_disable // Pickup preempt disable address + LDR r2, [r3] // Pickup actual preempt disable flag + CMP r2, #0 // Is it set? + BNE __tx_thread_no_preempt_restore // Yes, don't preempt this thread + LDR r3, =_tx_thread_execute_ptr // Pickup address of execute thread ptr + LDR r2, [r3] // Pickup actual execute thread pointer + CMP r0, r2 // Is the same thread highest priority? + BNE __tx_thread_preempt_restore // No, preemption needs to happen + + +__tx_thread_no_preempt_restore: + + /* Recover the saved context and return to the point of interrupt. */ + + /* Pickup the saved stack pointer. */ + + /* Recover the saved context and return to the point of interrupt. */ + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_preempt_restore: + + LDMIA sp!, {r3, r10, r12, lr} // Recover temporarily saved registers + MOV r1, lr // Save lr (point of interrupt) + MOV r2, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r2 // Enter SVC mode + STR r1, [sp, #-4]! // Save point of interrupt + STMDB sp!, {r4-r12, lr} // Save upper half of registers + MOV r4, r3 // Save SPSR in r4 + MOV r2, #IRQ_MODE // Build IRQ mode CPSR + MSR CPSR_c, r2 // Enter IRQ mode + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOV r5, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r5 // Enter SVC mode + STMDB sp!, {r0-r3} // Save r0-r3 on thread's stack + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer + +#ifdef TX_ENABLE_VFP_SUPPORT + LDR r2, [r0, #144] // Pickup the VFP enabled flag + CMP r2, #0 // Is the VFP enabled? + BEQ _tx_skip_irq_vfp_save // No, skip VFP IRQ save + VMRS r2, FPSCR // Pickup the FPSCR + STR r2, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D0-D15} // Save D0-D15 + +_tx_skip_irq_vfp_save: + +#endif + + MOV r3, #1 // Build interrupt stack type + STMDB sp!, {r3, r4} // Save interrupt stack type and SPSR + STR sp, [r0, #8] // Save stack pointer in thread control + // block + + /* Save the remaining time-slice and disable it. */ + LDR r3, =_tx_timer_time_slice // Pickup time-slice variable address + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it active? + BEQ __tx_thread_dont_save_ts // No, don't save it + STR r2, [r0, #24] // Save thread's time-slice + MOV r2, #0 // Clear value + STR r2, [r3] // Disable global time-slice flag + +__tx_thread_dont_save_ts: + + /* Clear the current task pointer. */ + MOV r0, #0 // NULL value + STR r0, [r1] // Clear current thread pointer + + /* Return to the scheduler. */ + B _tx_thread_schedule // Return to scheduler + +__tx_thread_idle_system_restore: + + /* Just return back to the scheduler! */ + MOV r0, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r0 // Enter SVC mode + B _tx_thread_schedule // Return to scheduler diff --git a/ports/cortex_a17/gnu/src/tx_thread_context_save.S b/ports/cortex_a17/gnu/src/tx_thread_context_save.S new file mode 100644 index 00000000..7ac48c2e --- /dev/null +++ b/ports/cortex_a17/gnu/src/tx_thread_context_save.S @@ -0,0 +1,172 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .global _tx_thread_system_state + .global _tx_thread_current_ptr + .global __tx_irq_processing_return + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_save + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_context_save + .type _tx_thread_context_save,function +_tx_thread_context_save: + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + + STMDB sp!, {r0-r3} // Save some working registers +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Disable FIQ interrupts +#endif + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + + /* Save the rest of the scratch registers on the stack and return to the + calling ISR. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, r10, r12, lr} // Store other registers + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + B __tx_irq_processing_return // Continue IRQ processing + +__tx_thread_not_nested_save: + + /* Otherwise, not nested, check to see if a thread was running. */ + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + + /* Save minimal context of interrupted thread. */ + + MRS r2, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r2, r10, r12, lr} // Store other registers + + MOV r10, #0 // Clear stack limit + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + B __tx_irq_processing_return // Continue IRQ processing + +__tx_thread_idle_system_save: + + /* Interrupt occurred in the scheduling loop. */ + + /* Not much to do here, just adjust the stack pointer, and return to IRQ + processing. */ + + MOV r10, #0 // Clear stack limit + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + ADD sp, sp, #16 // Recover saved registers + B __tx_irq_processing_return // Continue IRQ processing diff --git a/ports/cortex_a17/gnu/src/tx_thread_fiq_context_restore.S b/ports/cortex_a17/gnu/src/tx_thread_fiq_context_restore.S new file mode 100644 index 00000000..006be973 --- /dev/null +++ b/ports/cortex_a17/gnu/src/tx_thread_fiq_context_restore.S @@ -0,0 +1,223 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +SVC_MODE = 0xD3 // SVC mode +FIQ_MODE = 0xD1 // FIQ mode +MODE_MASK = 0x1F // Mode mask +THUMB_MASK = 0x20 // Thumb bit mask +IRQ_MODE_BITS = 0x12 // IRQ mode bits + + + .global _tx_thread_system_state + .global _tx_thread_current_ptr + .global _tx_thread_system_stack_ptr + .global _tx_thread_execute_ptr + .global _tx_timer_time_slice + .global _tx_thread_schedule + .global _tx_thread_preempt_disable + .global _tx_execution_isr_exit + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_restore + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_context_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function restores the fiq interrupt context when processing a */ +/* nested interrupt. If not, it returns to the interrupt thread if no */ +/* preemption is necessary. Otherwise, if preemption is necessary or */ +/* if no thread was running, the function returns to the scheduler. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling routine */ +/* */ +/* CALLED BY */ +/* */ +/* FIQ ISR Interrupt Service Routines */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_fiq_context_restore + .type _tx_thread_fiq_context_restore,function +_tx_thread_fiq_context_restore: + + /* Lockout interrupts. */ + + CPSID if // Disable IRQ and FIQ interrupts + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR exit function to indicate an ISR is complete. */ + + BL _tx_execution_isr_exit // Call the ISR exit function +#endif + + /* Determine if interrupts are nested. */ + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + SUB r2, r2, #1 // Decrement the counter + STR r2, [r3] // Store the counter + CMP r2, #0 // Was this the first interrupt? + BEQ __tx_thread_fiq_not_nested_restore // If so, not a nested restore + + /* Interrupts are nested. */ + + /* Just recover the saved registers and return to the point of + interrupt. */ + + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_fiq_not_nested_restore: + + /* Determine if a thread was interrupted and no preemption is required. */ + + LDR r1, [sp] // Pickup the saved SPSR + MOV r2, #MODE_MASK // Build mask to isolate the interrupted mode + AND r1, r1, r2 // Isolate mode bits + CMP r1, #IRQ_MODE_BITS // Was an interrupt taken in IRQ mode before we + // got to context save? */ + BEQ __tx_thread_fiq_no_preempt_restore // Yes, just go back to point of interrupt + + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup actual current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_fiq_idle_system_restore // Yes, idle system was interrupted + + LDR r3, =_tx_thread_preempt_disable // Pickup preempt disable address + LDR r2, [r3] // Pickup actual preempt disable flag + CMP r2, #0 // Is it set? + BNE __tx_thread_fiq_no_preempt_restore // Yes, don't preempt this thread + LDR r3, =_tx_thread_execute_ptr // Pickup address of execute thread ptr + LDR r2, [r3] // Pickup actual execute thread pointer + CMP r0, r2 // Is the same thread highest priority? + BNE __tx_thread_fiq_preempt_restore // No, preemption needs to happen + + +__tx_thread_fiq_no_preempt_restore: + + /* Restore interrupted thread or ISR. */ + /* Recover the saved context and return to the point of interrupt. */ + + LDMIA sp!, {r0, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_fiq_preempt_restore: + + LDMIA sp!, {r3, lr} // Recover temporarily saved registers + MOV r1, lr // Save lr (point of interrupt) + MOV r2, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r2 // Enter SVC mode + STR r1, [sp, #-4]! // Save point of interrupt + STMDB sp!, {r4-r12, lr} // Save upper half of registers + MOV r4, r3 // Save SPSR in r4 + MOV r2, #FIQ_MODE // Build FIQ mode CPSR + MSR CPSR_c, r2 // Reenter FIQ mode + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOV r5, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r5 // Enter SVC mode + STMDB sp!, {r0-r3} // Save r0-r3 on thread's stack + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer + +#ifdef TX_ENABLE_VFP_SUPPORT + LDR r2, [r0, #144] // Pickup the VFP enabled flag + CMP r2, #0 // Is the VFP enabled? + BEQ _tx_skip_fiq_vfp_save // No, skip VFP IRQ save + VMRS r2, FPSCR // Pickup the FPSCR + STR r2, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D0-D15} // Save D0-D15 +_tx_skip_fiq_vfp_save: +#endif + + MOV r3, #1 // Build interrupt stack type + STMDB sp!, {r3, r4} // Save interrupt stack type and SPSR + STR sp, [r0, #8] // Save stack pointer in thread control + // block */ + LDR r3, =_tx_timer_time_slice // Pickup time-slice variable address + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it active? + BEQ __tx_thread_fiq_dont_save_ts // No, don't save it + + STR r2, [r0, #24] // Save thread's time-slice + MOV r2, #0 // Clear value + STR r2, [r3] // Disable global time-slice flag + +__tx_thread_fiq_dont_save_ts: + + /* Clear the current task pointer. */ + + MOV r0, #0 // NULL value + STR r0, [r1] // Clear current thread pointer + + /* Return to the scheduler. */ + + B _tx_thread_schedule // Return to scheduler + +__tx_thread_fiq_idle_system_restore: + + /* Just return back to the scheduler! */ + + ADD sp, sp, #24 // Recover FIQ stack space + MOV r3, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r3 // Lockout interrupts + B _tx_thread_schedule // Return to scheduler + diff --git a/ports/cortex_a17/gnu/src/tx_thread_fiq_context_save.S b/ports/cortex_a17/gnu/src/tx_thread_fiq_context_save.S new file mode 100644 index 00000000..7db6a4c2 --- /dev/null +++ b/ports/cortex_a17/gnu/src/tx_thread_fiq_context_save.S @@ -0,0 +1,178 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .global _tx_thread_system_state + .global _tx_thread_current_ptr + .global __tx_fiq_processing_return + .global _tx_execution_isr_enter + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_save + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_fiq_context_save + .type _tx_thread_fiq_context_save,function +_tx_thread_fiq_context_save: + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + + STMDB sp!, {r0-r3} // Save some working registers + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_fiq_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + + /* Save the rest of the scratch registers on the stack and return to the + calling ISR. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, r10, r12, lr} // Store other registers + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + B __tx_fiq_processing_return // Continue FIQ processing +// +__tx_thread_fiq_not_nested_save: + + /* Otherwise, not nested, check to see if a thread was running. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_fiq_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + + /* Save minimal context of interrupted thread. */ + + MRS r2, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r2, lr} // Store other registers, Note that we don't + // need to save sl and ip since FIQ has + // copies of these registers. Nested + // interrupt processing does need to save + // these registers. + + MOV r10, #0 // Clear stack limit + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + B __tx_fiq_processing_return // Continue FIQ processing + +__tx_thread_fiq_idle_system_save: + + /* Interrupt occurred in the scheduling loop. */ + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + /* Not much to do here, save the current SPSR and LR for possible + use in IRQ interrupted in idle system conditions, and return to + FIQ interrupt processing. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, lr} // Store other registers that will get used + // or stripped off the stack in context + // restore + B __tx_fiq_processing_return // Continue FIQ processing diff --git a/ports/cortex_a17/gnu/src/tx_thread_fiq_nesting_end.S b/ports/cortex_a17/gnu/src/tx_thread_fiq_nesting_end.S new file mode 100644 index 00000000..b34d881e --- /dev/null +++ b/ports/cortex_a17/gnu/src/tx_thread_fiq_nesting_end.S @@ -0,0 +1,104 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +#ifdef TX_ENABLE_FIQ_SUPPORT +DISABLE_INTS = 0xC0 // Disable IRQ/FIQ interrupts +#else +DISABLE_INTS = 0x80 // Disable IRQ interrupts +#endif +MODE_MASK = 0x1F // Mode mask +FIQ_MODE_BITS = 0x11 // FIQ mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_end + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_nesting_end ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from FIQ mode after */ +/* _tx_thread_fiq_nesting_start has been called and switches the FIQ */ +/* processing from system mode back to FIQ mode prior to the ISR */ +/* calling _tx_thread_fiq_context_restore. Note that this function */ +/* assumes the system stack pointer is in the same position after */ +/* nesting start function was called. */ +/* */ +/* This function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with FIQ interrupts disabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_fiq_nesting_end + .type _tx_thread_fiq_nesting_end,function +_tx_thread_fiq_nesting_end: + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + ORR r0, r0, #DISABLE_INTS // Build disable interrupt value + MSR CPSR_c, r0 // Disable interrupts + LDMIA sp!, {r1, lr} // Pickup saved lr (and r1 throw-away for + // 8-byte alignment logic) + BIC r0, r0, #MODE_MASK // Clear mode bits + ORR r0, r0, #FIQ_MODE_BITS // Build IRQ mode CPSR + MSR CPSR_c, r0 // Reenter IRQ mode + +#ifdef __THUMB_INTERWORK + BX r3 // Return to caller +#else + MOV pc, r3 // Return to caller +#endif diff --git a/ports/cortex_a17/gnu/src/tx_thread_fiq_nesting_start.S b/ports/cortex_a17/gnu/src/tx_thread_fiq_nesting_start.S new file mode 100644 index 00000000..c9cd5a06 --- /dev/null +++ b/ports/cortex_a17/gnu/src/tx_thread_fiq_nesting_start.S @@ -0,0 +1,96 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +FIQ_DISABLE = 0x40 // FIQ disable bit +MODE_MASK = 0x1F // Mode mask +SYS_MODE_BITS = 0x1F // System mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_start + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_nesting_start ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from FIQ mode after */ +/* _tx_thread_fiq_context_save has been called and switches the FIQ */ +/* processing to the system mode so nested FIQ interrupt processing */ +/* is possible (system mode has its own "lr" register). Note that */ +/* this function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with FIQ interrupts enabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_fiq_nesting_start + .type _tx_thread_fiq_nesting_start,function +_tx_thread_fiq_nesting_start: + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + BIC r0, r0, #MODE_MASK // Clear the mode bits + ORR r0, r0, #SYS_MODE_BITS // Build system mode CPSR + MSR CPSR_c, r0 // Enter system mode + STMDB sp!, {r1, lr} // Push the system mode lr on the system mode stack + // and push r1 just to keep 8-byte alignment + BIC r0, r0, #FIQ_DISABLE // Build enable FIQ CPSR + MSR CPSR_c, r0 // Enter system mode +#ifdef __THUMB_INTERWORK + BX r3 // Return to caller +#else + MOV pc, r3 // Return to caller +#endif diff --git a/ports/cortex_a17/gnu/src/tx_thread_interrupt_control.S b/ports/cortex_a17/gnu/src/tx_thread_interrupt_control.S new file mode 100644 index 00000000..63b1609a --- /dev/null +++ b/ports/cortex_a17/gnu/src/tx_thread_interrupt_control.S @@ -0,0 +1,104 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +INT_MASK = 0x03F + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_control for + applications calling this function from to 16-bit Thumb mode. */ + + .text + .align 2 + .global $_tx_thread_interrupt_control +$_tx_thread_interrupt_control: + .thumb + BX pc // Switch to 32-bit mode + NOP // + .arm + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_control // Call _tx_thread_interrupt_control function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_control ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for changing the interrupt lockout */ +/* posture of the system. */ +/* */ +/* INPUT */ +/* */ +/* new_posture New interrupt lockout posture */ +/* */ +/* OUTPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_interrupt_control + .type _tx_thread_interrupt_control,function +_tx_thread_interrupt_control: + + /* Pickup current interrupt lockout posture. */ + + MRS r3, CPSR // Pickup current CPSR + MOV r2, #INT_MASK // Build interrupt mask + AND r1, r3, r2 // Clear interrupt lockout bits + ORR r1, r1, r0 // Or-in new interrupt lockout bits + + /* Apply the new interrupt posture. */ + + MSR CPSR_c, r1 // Setup new CPSR + BIC r0, r3, r2 // Return previous interrupt mask +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a17/gnu/src/tx_thread_interrupt_disable.S b/ports/cortex_a17/gnu/src/tx_thread_interrupt_disable.S new file mode 100644 index 00000000..13258808 --- /dev/null +++ b/ports/cortex_a17/gnu/src/tx_thread_interrupt_disable.S @@ -0,0 +1,101 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_disable for + applications calling this function from to 16-bit Thumb mode. */ + + .text + .align 2 + .global $_tx_thread_interrupt_disable +$_tx_thread_interrupt_disable: + .thumb + BX pc // Switch to 32-bit mode + NOP // + .arm + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_disable // Call _tx_thread_interrupt_disable function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_disable ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for disabling interrupts */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_interrupt_disable + .type _tx_thread_interrupt_disable,function +_tx_thread_interrupt_disable: + + /* Pickup current interrupt lockout posture. */ + + MRS r0, CPSR // Pickup current CPSR + + /* Mask interrupts. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Disable IRQ and FIQ +#else + CPSID i // Disable IRQ +#endif + +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a17/gnu/src/tx_thread_interrupt_restore.S b/ports/cortex_a17/gnu/src/tx_thread_interrupt_restore.S new file mode 100644 index 00000000..2d582511 --- /dev/null +++ b/ports/cortex_a17/gnu/src/tx_thread_interrupt_restore.S @@ -0,0 +1,93 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_restore for + applications calling this function from to 16-bit Thumb mode. */ + + .text + .align 2 + .global $_tx_thread_interrupt_restore +$_tx_thread_interrupt_restore: + .thumb + BX pc // Switch to 32-bit mode + NOP // + .arm + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_restore // Call _tx_thread_interrupt_restore function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for restoring interrupts to the state */ +/* returned by a previous _tx_thread_interrupt_disable call. */ +/* */ +/* INPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_interrupt_restore + .type _tx_thread_interrupt_restore,function +_tx_thread_interrupt_restore: + + /* Apply the new interrupt posture. */ + + MSR CPSR_c, r0 // Setup new CPSR +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a17/gnu/src/tx_thread_irq_nesting_end.S b/ports/cortex_a17/gnu/src/tx_thread_irq_nesting_end.S new file mode 100644 index 00000000..ec7e63c6 --- /dev/null +++ b/ports/cortex_a17/gnu/src/tx_thread_irq_nesting_end.S @@ -0,0 +1,103 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +#ifdef TX_ENABLE_FIQ_SUPPORT +DISABLE_INTS = 0xC0 // Disable IRQ/FIQ interrupts +#else +DISABLE_INTS = 0x80 // Disable IRQ interrupts +#endif +MODE_MASK = 0x1F // Mode mask +IRQ_MODE_BITS = 0x12 // IRQ mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_end + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_irq_nesting_end ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from IRQ mode after */ +/* _tx_thread_irq_nesting_start has been called and switches the IRQ */ +/* processing from system mode back to IRQ mode prior to the ISR */ +/* calling _tx_thread_context_restore. Note that this function */ +/* assumes the system stack pointer is in the same position after */ +/* nesting start function was called. */ +/* */ +/* This function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with IRQ interrupts disabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_irq_nesting_end + .type _tx_thread_irq_nesting_end,function +_tx_thread_irq_nesting_end: + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + ORR r0, r0, #DISABLE_INTS // Build disable interrupt value + MSR CPSR_c, r0 // Disable interrupts + LDMIA sp!, {r1, lr} // Pickup saved lr (and r1 throw-away for + // 8-byte alignment logic) + BIC r0, r0, #MODE_MASK // Clear mode bits + ORR r0, r0, #IRQ_MODE_BITS // Build IRQ mode CPSR + MSR CPSR_c, r0 // Reenter IRQ mode +#ifdef __THUMB_INTERWORK + BX r3 // Return to caller +#else + MOV pc, r3 // Return to caller +#endif diff --git a/ports/cortex_a17/gnu/src/tx_thread_irq_nesting_start.S b/ports/cortex_a17/gnu/src/tx_thread_irq_nesting_start.S new file mode 100644 index 00000000..c69976ed --- /dev/null +++ b/ports/cortex_a17/gnu/src/tx_thread_irq_nesting_start.S @@ -0,0 +1,96 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +IRQ_DISABLE = 0x80 // IRQ disable bit +MODE_MASK = 0x1F // Mode mask +SYS_MODE_BITS = 0x1F // System mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_start + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_irq_nesting_start ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from IRQ mode after */ +/* _tx_thread_context_save has been called and switches the IRQ */ +/* processing to the system mode so nested IRQ interrupt processing */ +/* is possible (system mode has its own "lr" register). Note that */ +/* this function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with IRQ interrupts enabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_irq_nesting_start + .type _tx_thread_irq_nesting_start,function +_tx_thread_irq_nesting_start: + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + BIC r0, r0, #MODE_MASK // Clear the mode bits + ORR r0, r0, #SYS_MODE_BITS // Build system mode CPSR + MSR CPSR_c, r0 // Enter system mode + STMDB sp!, {r1, lr} // Push the system mode lr on the system mode stack + // and push r1 just to keep 8-byte alignment + BIC r0, r0, #IRQ_DISABLE // Build enable IRQ CPSR + MSR CPSR_c, r0 // Enter system mode +#ifdef __THUMB_INTERWORK + BX r3 // Return to caller +#else + MOV pc, r3 // Return to caller +#endif diff --git a/ports/cortex_a17/gnu/src/tx_thread_schedule.S b/ports/cortex_a17/gnu/src/tx_thread_schedule.S new file mode 100644 index 00000000..8330e9df --- /dev/null +++ b/ports/cortex_a17/gnu/src/tx_thread_schedule.S @@ -0,0 +1,230 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .global _tx_thread_execute_ptr + .global _tx_thread_current_ptr + .global _tx_timer_time_slice + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_schedule for + applications calling this function from to 16-bit Thumb mode. */ + + .text + .align 2 + .global $_tx_thread_schedule + .type $_tx_thread_schedule,function +$_tx_thread_schedule: + .thumb + BX pc // Switch to 32-bit mode + NOP // + .arm + STMFD sp!, {lr} // Save return address + BL _tx_thread_schedule // Call _tx_thread_schedule function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_schedule ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function waits for a thread control block pointer to appear in */ +/* the _tx_thread_execute_ptr variable. Once a thread pointer appears */ +/* in the variable, the corresponding thread is resumed. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_initialize_kernel_enter ThreadX entry function */ +/* _tx_thread_system_return Return to system from thread */ +/* _tx_thread_context_restore Restore thread's context */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_schedule + .type _tx_thread_schedule,function +_tx_thread_schedule: + + /* Enable interrupts. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSIE if // Enable IRQ and FIQ interrupts +#else + CPSIE i // Enable IRQ interrupts +#endif + + /* Wait for a thread to execute. */ + LDR r1, =_tx_thread_execute_ptr // Address of thread execute ptr + +__tx_thread_schedule_loop: + + LDR r0, [r1] // Pickup next thread to execute + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_schedule_loop // If so, keep looking for a thread + /* Yes! We have a thread to execute. Lockout interrupts and + transfer control to it. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Disable IRQ and FIQ interrupts +#else + CPSID i // Disable IRQ interrupts +#endif + + /* Setup the current thread pointer. */ + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread + STR r0, [r1] // Setup current thread pointer + + /* Increment the run count for this thread. */ + + LDR r2, [r0, #4] // Pickup run counter + LDR r3, [r0, #24] // Pickup time-slice for this thread + ADD r2, r2, #1 // Increment thread run-counter + STR r2, [r0, #4] // Store the new run counter + + /* Setup time-slice, if present. */ + + LDR r2, =_tx_timer_time_slice // Pickup address of time-slice + // variable + LDR sp, [r0, #8] // Switch stack pointers + STR r3, [r2] // Setup time-slice + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the thread entry function to indicate the thread is executing. */ + + MOV r5, r0 // Save r0 + BL _tx_execution_thread_enter // Call the thread execution enter function + MOV r0, r5 // Restore r0 +#endif + + /* Determine if an interrupt frame or a synchronous task suspension frame + is present. */ + + LDMIA sp!, {r4, r5} // Pickup the stack type and saved CPSR + CMP r4, #0 // Check for synchronous context switch + BEQ _tx_solicited_return + MSR SPSR_cxsf, r5 // Setup SPSR for return +#ifdef TX_ENABLE_VFP_SUPPORT + LDR r1, [r0, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_interrupt_vfp_restore // No, skip VFP interrupt restore + VLDMIA sp!, {D0-D15} // Recover D0-D15 + VLDMIA sp!, {D16-D31} // Recover D16-D31 + LDR r4, [sp], #4 // Pickup FPSCR + VMSR FPSCR, r4 // Restore FPSCR +_tx_skip_interrupt_vfp_restore: +#endif + LDMIA sp!, {r0-r12, lr, pc}^ // Return to point of thread interrupt + +_tx_solicited_return: + +#ifdef TX_ENABLE_VFP_SUPPORT + LDR r1, [r0, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_solicited_vfp_restore // No, skip VFP solicited restore + VLDMIA sp!, {D8-D15} // Recover D8-D15 + VLDMIA sp!, {D16-D31} // Recover D16-D31 + LDR r4, [sp], #4 // Pickup FPSCR + VMSR FPSCR, r4 // Restore FPSCR +_tx_skip_solicited_vfp_restore: +#endif + MSR CPSR_cxsf, r5 // Recover CPSR + LDMIA sp!, {r4-r11, lr} // Return to thread synchronously +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif + +#ifdef TX_ENABLE_VFP_SUPPORT + + .global tx_thread_vfp_enable + .type tx_thread_vfp_enable,function +tx_thread_vfp_enable: + MRS r2, CPSR // Pickup the CPSR +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Enable IRQ and FIQ interrupts +#else + CPSID i // Enable IRQ interrupts +#endif + LDR r0, =_tx_thread_current_ptr // Build current thread pointer address + LDR r1, [r0] // Pickup current thread pointer + CMP r1, #0 // Check for NULL thread pointer + BEQ __tx_no_thread_to_enable // If NULL, skip VFP enable + MOV r0, #1 // Build enable value + STR r0, [r1, #144] // Set the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) +__tx_no_thread_to_enable: + MSR CPSR_cxsf, r2 // Recover CPSR + BX LR // Return to caller + + .global tx_thread_vfp_disable + .type tx_thread_vfp_disable,function +tx_thread_vfp_disable: + MRS r2, CPSR // Pickup the CPSR +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Enable IRQ and FIQ interrupts +#else + CPSID i // Enable IRQ interrupts +#endif + LDR r0, =_tx_thread_current_ptr // Build current thread pointer address + LDR r1, [r0] // Pickup current thread pointer + CMP r1, #0 // Check for NULL thread pointer + BEQ __tx_no_thread_to_disable // If NULL, skip VFP disable + MOV r0, #0 // Build disable value + STR r0, [r1, #144] // Clear the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) +__tx_no_thread_to_disable: + MSR CPSR_cxsf, r2 // Recover CPSR + BX LR // Return to caller + +#endif diff --git a/ports/cortex_a17/gnu/src/tx_thread_stack_build.S b/ports/cortex_a17/gnu/src/tx_thread_stack_build.S new file mode 100644 index 00000000..f413e673 --- /dev/null +++ b/ports/cortex_a17/gnu/src/tx_thread_stack_build.S @@ -0,0 +1,164 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .arm + +SVC_MODE = 0x13 // SVC mode +#ifdef TX_ENABLE_FIQ_SUPPORT +CPSR_MASK = 0xDF // Mask initial CPSR, IRQ & FIQ interrupts enabled +#else +CPSR_MASK = 0x9F // Mask initial CPSR, IRQ interrupts enabled +#endif + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_stack_build for + applications calling this function from to 16-bit Thumb mode. */ + + .text + .align 2 + .thumb + .global $_tx_thread_stack_build + .type $_tx_thread_stack_build,function +$_tx_thread_stack_build: + BX pc // Switch to 32-bit mode + NOP // + .arm + STMFD sp!, {lr} // Save return address + BL _tx_thread_stack_build // Call _tx_thread_stack_build function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_stack_build ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function builds a stack frame on the supplied thread's stack. */ +/* The stack frame results in a fake interrupt return to the supplied */ +/* function pointer. */ +/* */ +/* INPUT */ +/* */ +/* thread_ptr Pointer to thread control blk */ +/* function_ptr Pointer to return function */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_thread_create Create thread service */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_stack_build + .type _tx_thread_stack_build,function +_tx_thread_stack_build: + + + /* Build a fake interrupt frame. The form of the fake interrupt stack + on the ARMv7-A should look like the following after it is built: + + Stack Top: 1 Interrupt stack frame type + CPSR Initial value for CPSR + a1 (r0) Initial value for a1 + a2 (r1) Initial value for a2 + a3 (r2) Initial value for a3 + a4 (r3) Initial value for a4 + v1 (r4) Initial value for v1 + v2 (r5) Initial value for v2 + v3 (r6) Initial value for v3 + v4 (r7) Initial value for v4 + v5 (r8) Initial value for v5 + sb (r9) Initial value for sb + sl (r10) Initial value for sl + fp (r11) Initial value for fp + ip (r12) Initial value for ip + lr (r14) Initial value for lr + pc (r15) Initial value for + 0 For stack backtracing + + Stack Bottom: (higher memory address) */ + + LDR r2, [r0, #16] // Pickup end of stack area + BIC r2, r2, #7 // Ensure 8-byte alignment + SUB r2, r2, #76 // Allocate space for the stack frame + + /* Actually build the stack frame. */ + + MOV r3, #1 // Build interrupt stack type + STR r3, [r2, #0] // Store stack type + MOV r3, #0 // Build initial register value + STR r3, [r2, #8] // Store initial r0 + STR r3, [r2, #12] // Store initial r1 + STR r3, [r2, #16] // Store initial r2 + STR r3, [r2, #20] // Store initial r3 + STR r3, [r2, #24] // Store initial r4 + STR r3, [r2, #28] // Store initial r5 + STR r3, [r2, #32] // Store initial r6 + STR r3, [r2, #36] // Store initial r7 + STR r3, [r2, #40] // Store initial r8 + STR r3, [r2, #44] // Store initial r9 + LDR r3, [r0, #12] // Pickup stack starting address + STR r3, [r2, #48] // Store initial r10 (sl) + LDR r3,=_tx_thread_schedule // Pickup address of _tx_thread_schedule for GDB backtrace + STR r3, [r2, #60] // Store initial r14 (lr) + MOV r3, #0 // Build initial register value + STR r3, [r2, #52] // Store initial r11 + STR r3, [r2, #56] // Store initial r12 + STR r1, [r2, #64] // Store initial pc + STR r3, [r2, #68] // 0 for back-trace + MRS r1, CPSR // Pickup CPSR + BIC r1, r1, #CPSR_MASK // Mask mode bits of CPSR + ORR r3, r1, #SVC_MODE // Build CPSR, SVC mode, interrupts enabled + STR r3, [r2, #4] // Store initial CPSR + + /* Setup stack pointer. */ + + STR r2, [r0, #8] // Save stack pointer in thread's + // control block +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a17/gnu/src/tx_thread_system_return.S b/ports/cortex_a17/gnu/src/tx_thread_system_return.S new file mode 100644 index 00000000..cb7d62ce --- /dev/null +++ b/ports/cortex_a17/gnu/src/tx_thread_system_return.S @@ -0,0 +1,162 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .arm + + + .global _tx_thread_current_ptr + .global _tx_timer_time_slice + .global _tx_thread_schedule + + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_system_return for + applications calling this function from to 16-bit Thumb mode. */ + + .text + .align 2 + .global $_tx_thread_system_return + .type $_tx_thread_system_return,function +$_tx_thread_system_return: + .thumb + BX pc // Switch to 32-bit mode + NOP // + .arm + STMFD sp!, {lr} // Save return address + BL _tx_thread_system_return // Call _tx_thread_system_return function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_system_return ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is target processor specific. It is used to transfer */ +/* control from a thread back to the ThreadX system. Only a */ +/* minimal context is saved since the compiler assumes temp registers */ +/* are going to get slicked by a function call anyway. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling loop */ +/* */ +/* CALLED BY */ +/* */ +/* ThreadX components */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_system_return + .type _tx_thread_system_return,function +_tx_thread_system_return: + + /* Save minimal context on the stack. */ + + STMDB sp!, {r4-r11, lr} // Save minimal context + + LDR r4, =_tx_thread_current_ptr // Pickup address of current ptr + LDR r5, [r4] // Pickup current thread pointer + +#ifdef TX_ENABLE_VFP_SUPPORT + LDR r1, [r5, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_solicited_vfp_save // No, skip VFP solicited save + VMRS r1, FPSCR // Pickup the FPSCR + STR r1, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D8-D15} // Save D8-D15 +_tx_skip_solicited_vfp_save: +#endif + + MOV r0, #0 // Build a solicited stack type + MRS r1, CPSR // Pickup the CPSR + STMDB sp!, {r0-r1} // Save type and CPSR + + /* Lockout interrupts. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Disable IRQ and FIQ interrupts +#else + CPSID i // Disable IRQ interrupts +#endif + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the thread exit function to indicate the thread is no longer executing. */ + + BL _tx_execution_thread_exit // Call the thread exit function +#endif + MOV r3, r4 // Pickup address of current ptr + MOV r0, r5 // Pickup current thread pointer + LDR r2, =_tx_timer_time_slice // Pickup address of time slice + LDR r1, [r2] // Pickup current time slice + + /* Save current stack and switch to system stack. */ + + STR sp, [r0, #8] // Save thread stack pointer + + /* Determine if the time-slice is active. */ + + MOV r4, #0 // Build clear value + CMP r1, #0 // Is a time-slice active? + BEQ __tx_thread_dont_save_ts // No, don't save the time-slice + + /* Save time-slice for the thread and clear the current time-slice. */ + + STR r4, [r2] // Clear time-slice + STR r1, [r0, #24] // Save current time-slice + +__tx_thread_dont_save_ts: + + /* Clear the current thread pointer. */ + + STR r4, [r3] // Clear current thread pointer + B _tx_thread_schedule // Jump to scheduler! diff --git a/ports/cortex_a17/gnu/src/tx_thread_vectored_context_save.S b/ports/cortex_a17/gnu/src/tx_thread_vectored_context_save.S new file mode 100644 index 00000000..d846223f --- /dev/null +++ b/ports/cortex_a17/gnu/src/tx_thread_vectored_context_save.S @@ -0,0 +1,165 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .global _tx_thread_system_state + .global _tx_thread_current_ptr + .global _tx_execution_isr_enter + + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_vectored_context_save + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_vectored_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_vectored_context_save + .type _tx_thread_vectored_context_save,function +_tx_thread_vectored_context_save: + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Disable IRQ and FIQ interrupts +#endif + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3, #0] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3, #0] // Store it back in the variable + + /* Note: Minimal context of interrupted thread is already saved. */ + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + MOV pc, lr // Return to caller + +__tx_thread_not_nested_save: + + /* Otherwise, not nested, check to see if a thread was running. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3, #0] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1, #0] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + /* Note: Minimal context of interrupted thread is already saved. */ + + /* Save the current stack pointer in the thread's control block. */ + + MOV r10, #0 // Clear stack limit + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + MOV pc, lr // Return to caller + +__tx_thread_idle_system_save: + + /* Interrupt occurred in the scheduling loop. */ + + /* Not much to do here, just adjust the stack pointer, and return to IRQ + processing. */ + + MOV r10, #0 // Clear stack limit + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + ADD sp, sp, #32 // Recover saved registers + MOV pc, lr // Return to caller diff --git a/ports/cortex_a17/gnu/src/tx_timer_interrupt.S b/ports/cortex_a17/gnu/src/tx_timer_interrupt.S new file mode 100644 index 00000000..7337ed0c --- /dev/null +++ b/ports/cortex_a17/gnu/src/tx_timer_interrupt.S @@ -0,0 +1,231 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Timer */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .arm + + +/* Define Assembly language external references... */ + + .global _tx_timer_time_slice + .global _tx_timer_system_clock + .global _tx_timer_current_ptr + .global _tx_timer_list_start + .global _tx_timer_list_end + .global _tx_timer_expired_time_slice + .global _tx_timer_expired + .global _tx_thread_time_slice + + + +/* Define the 16-bit Thumb mode veneer for _tx_timer_interrupt for + applications calling this function from to 16-bit Thumb mode. */ + + .text + .align 2 + .thumb + .global $_tx_timer_interrupt + .type $_tx_timer_interrupt,function +$_tx_timer_interrupt: + BX pc // Switch to 32-bit mode + NOP // + .arm + STMFD sp!, {lr} // Save return address + BL _tx_timer_interrupt // Call _tx_timer_interrupt function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_timer_interrupt ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function processes the hardware timer interrupt. This */ +/* processing includes incrementing the system clock and checking for */ +/* time slice and/or timer expiration. If either is found, the */ +/* interrupt context save/restore functions are called along with the */ +/* expiration functions. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_time_slice Time slice interrupted thread */ +/* _tx_timer_expiration_process Timer expiration processing */ +/* */ +/* CALLED BY */ +/* */ +/* interrupt vector */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_timer_interrupt + .type _tx_timer_interrupt,function +_tx_timer_interrupt: + + /* Upon entry to this routine, it is assumed that context save has already + been called, and therefore the compiler scratch registers are available + for use. */ + + /* Increment the system clock. */ + + LDR r1, =_tx_timer_system_clock // Pickup address of system clock + LDR r0, [r1] // Pickup system clock + ADD r0, r0, #1 // Increment system clock + STR r0, [r1] // Store new system clock + + /* Test for time-slice expiration. */ + + LDR r3, =_tx_timer_time_slice // Pickup address of time-slice + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it non-active? + BEQ __tx_timer_no_time_slice // Yes, skip time-slice processing + + /* Decrement the time_slice. */ + + SUB r2, r2, #1 // Decrement the time-slice + STR r2, [r3] // Store new time-slice value + + /* Check for expiration. */ + + CMP r2, #0 // Has it expired? + BNE __tx_timer_no_time_slice // No, skip expiration processing + + /* Set the time-slice expired flag. */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of expired flag + MOV r0, #1 // Build expired value + STR r0, [r3] // Set time-slice expiration flag + +__tx_timer_no_time_slice: + + /* Test for timer expiration. */ + + LDR r1, =_tx_timer_current_ptr // Pickup current timer pointer address + LDR r0, [r1] // Pickup current timer + LDR r2, [r0] // Pickup timer list entry + CMP r2, #0 // Is there anything in the list? + BEQ __tx_timer_no_timer // No, just increment the timer + + /* Set expiration flag. */ + + LDR r3, =_tx_timer_expired // Pickup expiration flag address + MOV r2, #1 // Build expired value + STR r2, [r3] // Set expired flag + B __tx_timer_done // Finished timer processing + +__tx_timer_no_timer: + + /* No timer expired, increment the timer pointer. */ + ADD r0, r0, #4 // Move to next timer + + /* Check for wraparound. */ + + LDR r3, =_tx_timer_list_end // Pickup address of timer list end + LDR r2, [r3] // Pickup list end + CMP r0, r2 // Are we at list end? + BNE __tx_timer_skip_wrap // No, skip wraparound logic + + /* Wrap to beginning of list. */ + + LDR r3, =_tx_timer_list_start // Pickup address of timer list start + LDR r0, [r3] // Set current pointer to list start + +__tx_timer_skip_wrap: + + STR r0, [r1] // Store new current timer pointer + +__tx_timer_done: + + /* See if anything has expired. */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of expired flag + LDR r2, [r3] // Pickup time-slice expired flag + CMP r2, #0 // Did a time-slice expire? + BNE __tx_something_expired // If non-zero, time-slice expired + LDR r1, =_tx_timer_expired // Pickup address of other expired flag + LDR r0, [r1] // Pickup timer expired flag + CMP r0, #0 // Did a timer expire? + BEQ __tx_timer_nothing_expired // No, nothing expired + +__tx_something_expired: + + STMDB sp!, {r0, lr} // Save the lr register on the stack + // and save r0 just to keep 8-byte alignment + + /* Did a timer expire? */ + + LDR r1, =_tx_timer_expired // Pickup address of expired flag + LDR r0, [r1] // Pickup timer expired flag + CMP r0, #0 // Check for timer expiration + BEQ __tx_timer_dont_activate // If not set, skip timer activation + + /* Process timer expiration. */ + BL _tx_timer_expiration_process // Call the timer expiration handling routine + +__tx_timer_dont_activate: + + /* Did time slice expire? */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of time-slice expired + LDR r2, [r3] // Pickup the actual flag + CMP r2, #0 // See if the flag is set + BEQ __tx_timer_not_ts_expiration // No, skip time-slice processing + + /* Time slice interrupted thread. */ + + BL _tx_thread_time_slice // Call time-slice processing + +__tx_timer_not_ts_expiration: + + LDMIA sp!, {r0, lr} // Recover lr register (r0 is just there for + // the 8-byte stack alignment + +__tx_timer_nothing_expired: + +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a5/ac6/example_build/sample_threadx.c b/ports/cortex_a5/ac6/example_build/sample_threadx.c new file mode 100644 index 00000000..8c61de06 --- /dev/null +++ b/ports/cortex_a5/ac6/example_build/sample_threadx.c @@ -0,0 +1,369 @@ +/* This is a small demo of the high-performance ThreadX kernel. It includes examples of eight + threads of different priorities, using a message queue, semaphore, mutex, event flags group, + byte pool, and block pool. */ + +#include "tx_api.h" + +#define DEMO_STACK_SIZE 1024 +#define DEMO_BYTE_POOL_SIZE 9120 +#define DEMO_BLOCK_POOL_SIZE 100 +#define DEMO_QUEUE_SIZE 100 + + +/* Define the ThreadX object control blocks... */ + +TX_THREAD thread_0; +TX_THREAD thread_1; +TX_THREAD thread_2; +TX_THREAD thread_3; +TX_THREAD thread_4; +TX_THREAD thread_5; +TX_THREAD thread_6; +TX_THREAD thread_7; +TX_QUEUE queue_0; +TX_SEMAPHORE semaphore_0; +TX_MUTEX mutex_0; +TX_EVENT_FLAGS_GROUP event_flags_0; +TX_BYTE_POOL byte_pool_0; +TX_BLOCK_POOL block_pool_0; + + +/* Define the counters used in the demo application... */ + +ULONG thread_0_counter; +ULONG thread_1_counter; +ULONG thread_1_messages_sent; +ULONG thread_2_counter; +ULONG thread_2_messages_received; +ULONG thread_3_counter; +ULONG thread_4_counter; +ULONG thread_5_counter; +ULONG thread_6_counter; +ULONG thread_7_counter; + + +/* Define thread prototypes. */ + +void thread_0_entry(ULONG thread_input); +void thread_1_entry(ULONG thread_input); +void thread_2_entry(ULONG thread_input); +void thread_3_and_4_entry(ULONG thread_input); +void thread_5_entry(ULONG thread_input); +void thread_6_and_7_entry(ULONG thread_input); + + +/* Define main entry point. */ + +int main() +{ + + /* Enter the ThreadX kernel. */ + tx_kernel_enter(); +} + + +/* Define what the initial system looks like. */ + +void tx_application_define(void *first_unused_memory) +{ + +CHAR *pointer = TX_NULL; + + + /* Create a byte memory pool from which to allocate the thread stacks. */ + tx_byte_pool_create(&byte_pool_0, "byte pool 0", first_unused_memory, DEMO_BYTE_POOL_SIZE); + + /* Put system definition stuff in here, e.g. thread creates and other assorted + create information. */ + + /* Allocate the stack for thread 0. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 1, 1, TX_NO_TIME_SLICE, TX_AUTO_START); + + + /* Allocate the stack for thread 1. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create threads 1 and 2. These threads pass information through a ThreadX + message queue. It is also interesting to note that these threads have a time + slice. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, DEMO_STACK_SIZE, + 16, 16, 4, TX_AUTO_START); + + /* Allocate the stack for thread 2. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, DEMO_STACK_SIZE, + 16, 16, 4, TX_AUTO_START); + + /* Allocate the stack for thread 3. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create threads 3 and 4. These threads compete for a ThreadX counting semaphore. + An interesting thing here is that both threads share the same instruction area. */ + tx_thread_create(&thread_3, "thread 3", thread_3_and_4_entry, 3, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 4. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + tx_thread_create(&thread_4, "thread 4", thread_3_and_4_entry, 4, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 5. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create thread 5. This thread simply pends on an event flag which will be set + by thread_0. */ + tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 6. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create threads 6 and 7. These threads compete for a ThreadX mutex. */ + tx_thread_create(&thread_6, "thread 6", thread_6_and_7_entry, 6, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 7. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + tx_thread_create(&thread_7, "thread 7", thread_6_and_7_entry, 7, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the message queue. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_QUEUE_SIZE*sizeof(ULONG), TX_NO_WAIT); + + /* Create the message queue shared by threads 1 and 2. */ + tx_queue_create(&queue_0, "queue 0", TX_1_ULONG, pointer, DEMO_QUEUE_SIZE*sizeof(ULONG)); + + /* Create the semaphore used by threads 3 and 4. */ + tx_semaphore_create(&semaphore_0, "semaphore 0", 1); + + /* Create the event flags group used by threads 1 and 5. */ + tx_event_flags_create(&event_flags_0, "event flags 0"); + + /* Create the mutex used by thread 6 and 7 without priority inheritance. */ + tx_mutex_create(&mutex_0, "mutex 0", TX_NO_INHERIT); + + /* Allocate the memory for a small block pool. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_BLOCK_POOL_SIZE, TX_NO_WAIT); + + /* Create a block memory pool to allocate a message buffer from. */ + tx_block_pool_create(&block_pool_0, "block pool 0", sizeof(ULONG), pointer, DEMO_BLOCK_POOL_SIZE); + + /* Allocate a block and release the block memory. */ + tx_block_allocate(&block_pool_0, (VOID **) &pointer, TX_NO_WAIT); + + /* Release the block back to the pool. */ + tx_block_release(pointer); +} + + + +/* Define the test threads. */ + +void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + + /* This thread simply sits in while-forever-sleep loop. */ + while(1) + { + + /* Increment the thread counter. */ + thread_0_counter++; + + /* Sleep for 10 ticks. */ + tx_thread_sleep(10); + + /* Set event flag 0 to wakeup thread 5. */ + status = tx_event_flags_set(&event_flags_0, 0x1, TX_OR); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + } +} + + +void thread_1_entry(ULONG thread_input) +{ + +UINT status; + + + /* This thread simply sends messages to a queue shared by thread 2. */ + while(1) + { + + /* Increment the thread counter. */ + thread_1_counter++; + + /* Send message to queue 0. */ + status = tx_queue_send(&queue_0, &thread_1_messages_sent, TX_WAIT_FOREVER); + + /* Check completion status. */ + if (status != TX_SUCCESS) + break; + + /* Increment the message sent. */ + thread_1_messages_sent++; + } +} + + +void thread_2_entry(ULONG thread_input) +{ + +ULONG received_message; +UINT status; + + /* This thread retrieves messages placed on the queue by thread 1. */ + while(1) + { + + /* Increment the thread counter. */ + thread_2_counter++; + + /* Retrieve a message from the queue. */ + status = tx_queue_receive(&queue_0, &received_message, TX_WAIT_FOREVER); + + /* Check completion status and make sure the message is what we + expected. */ + if ((status != TX_SUCCESS) || (received_message != thread_2_messages_received)) + break; + + /* Otherwise, all is okay. Increment the received message count. */ + thread_2_messages_received++; + } +} + + +void thread_3_and_4_entry(ULONG thread_input) +{ + +UINT status; + + + /* This function is executed from thread 3 and thread 4. As the loop + below shows, these function compete for ownership of semaphore_0. */ + while(1) + { + + /* Increment the thread counter. */ + if (thread_input == 3) + thread_3_counter++; + else + thread_4_counter++; + + /* Get the semaphore with suspension. */ + status = tx_semaphore_get(&semaphore_0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Sleep for 2 ticks to hold the semaphore. */ + tx_thread_sleep(2); + + /* Release the semaphore. */ + status = tx_semaphore_put(&semaphore_0); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + } +} + + +void thread_5_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_flags; + + + /* This thread simply waits for an event in a forever loop. */ + while(1) + { + + /* Increment the thread counter. */ + thread_5_counter++; + + /* Wait for event flag 0. */ + status = tx_event_flags_get(&event_flags_0, 0x1, TX_OR_CLEAR, + &actual_flags, TX_WAIT_FOREVER); + + /* Check status. */ + if ((status != TX_SUCCESS) || (actual_flags != 0x1)) + break; + } +} + + +void thread_6_and_7_entry(ULONG thread_input) +{ + +UINT status; + + + /* This function is executed from thread 6 and thread 7. As the loop + below shows, these function compete for ownership of mutex_0. */ + while(1) + { + + /* Increment the thread counter. */ + if (thread_input == 6) + thread_6_counter++; + else + thread_7_counter++; + + /* Get the mutex with suspension. */ + status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Get the mutex again with suspension. This shows + that an owning thread may retrieve the mutex it + owns multiple times. */ + status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Sleep for 2 ticks to hold the mutex. */ + tx_thread_sleep(2); + + /* Release the mutex. */ + status = tx_mutex_put(&mutex_0); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Release the mutex again. This will actually + release ownership since it was obtained twice. */ + status = tx_mutex_put(&mutex_0); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + } +} diff --git a/ports/cortex_a5/ac6/example_build/sample_threadx/.cproject b/ports/cortex_a5/ac6/example_build/sample_threadx/.cproject new file mode 100644 index 00000000..27463deb --- /dev/null +++ b/ports/cortex_a5/ac6/example_build/sample_threadx/.cproject @@ -0,0 +1,176 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ports/cortex_a5/ac6/example_build/sample_threadx/.project b/ports/cortex_a5/ac6/example_build/sample_threadx/.project new file mode 100644 index 00000000..ed4c0885 --- /dev/null +++ b/ports/cortex_a5/ac6/example_build/sample_threadx/.project @@ -0,0 +1,27 @@ + + + sample_threadx + + + tx + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + + diff --git a/ports/cortex_a5/ac6/example_build/sample_threadx/sample_threadx.c b/ports/cortex_a5/ac6/example_build/sample_threadx/sample_threadx.c new file mode 100644 index 00000000..8c61de06 --- /dev/null +++ b/ports/cortex_a5/ac6/example_build/sample_threadx/sample_threadx.c @@ -0,0 +1,369 @@ +/* This is a small demo of the high-performance ThreadX kernel. It includes examples of eight + threads of different priorities, using a message queue, semaphore, mutex, event flags group, + byte pool, and block pool. */ + +#include "tx_api.h" + +#define DEMO_STACK_SIZE 1024 +#define DEMO_BYTE_POOL_SIZE 9120 +#define DEMO_BLOCK_POOL_SIZE 100 +#define DEMO_QUEUE_SIZE 100 + + +/* Define the ThreadX object control blocks... */ + +TX_THREAD thread_0; +TX_THREAD thread_1; +TX_THREAD thread_2; +TX_THREAD thread_3; +TX_THREAD thread_4; +TX_THREAD thread_5; +TX_THREAD thread_6; +TX_THREAD thread_7; +TX_QUEUE queue_0; +TX_SEMAPHORE semaphore_0; +TX_MUTEX mutex_0; +TX_EVENT_FLAGS_GROUP event_flags_0; +TX_BYTE_POOL byte_pool_0; +TX_BLOCK_POOL block_pool_0; + + +/* Define the counters used in the demo application... */ + +ULONG thread_0_counter; +ULONG thread_1_counter; +ULONG thread_1_messages_sent; +ULONG thread_2_counter; +ULONG thread_2_messages_received; +ULONG thread_3_counter; +ULONG thread_4_counter; +ULONG thread_5_counter; +ULONG thread_6_counter; +ULONG thread_7_counter; + + +/* Define thread prototypes. */ + +void thread_0_entry(ULONG thread_input); +void thread_1_entry(ULONG thread_input); +void thread_2_entry(ULONG thread_input); +void thread_3_and_4_entry(ULONG thread_input); +void thread_5_entry(ULONG thread_input); +void thread_6_and_7_entry(ULONG thread_input); + + +/* Define main entry point. */ + +int main() +{ + + /* Enter the ThreadX kernel. */ + tx_kernel_enter(); +} + + +/* Define what the initial system looks like. */ + +void tx_application_define(void *first_unused_memory) +{ + +CHAR *pointer = TX_NULL; + + + /* Create a byte memory pool from which to allocate the thread stacks. */ + tx_byte_pool_create(&byte_pool_0, "byte pool 0", first_unused_memory, DEMO_BYTE_POOL_SIZE); + + /* Put system definition stuff in here, e.g. thread creates and other assorted + create information. */ + + /* Allocate the stack for thread 0. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 1, 1, TX_NO_TIME_SLICE, TX_AUTO_START); + + + /* Allocate the stack for thread 1. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create threads 1 and 2. These threads pass information through a ThreadX + message queue. It is also interesting to note that these threads have a time + slice. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, DEMO_STACK_SIZE, + 16, 16, 4, TX_AUTO_START); + + /* Allocate the stack for thread 2. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, DEMO_STACK_SIZE, + 16, 16, 4, TX_AUTO_START); + + /* Allocate the stack for thread 3. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create threads 3 and 4. These threads compete for a ThreadX counting semaphore. + An interesting thing here is that both threads share the same instruction area. */ + tx_thread_create(&thread_3, "thread 3", thread_3_and_4_entry, 3, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 4. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + tx_thread_create(&thread_4, "thread 4", thread_3_and_4_entry, 4, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 5. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create thread 5. This thread simply pends on an event flag which will be set + by thread_0. */ + tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 6. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create threads 6 and 7. These threads compete for a ThreadX mutex. */ + tx_thread_create(&thread_6, "thread 6", thread_6_and_7_entry, 6, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 7. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + tx_thread_create(&thread_7, "thread 7", thread_6_and_7_entry, 7, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the message queue. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_QUEUE_SIZE*sizeof(ULONG), TX_NO_WAIT); + + /* Create the message queue shared by threads 1 and 2. */ + tx_queue_create(&queue_0, "queue 0", TX_1_ULONG, pointer, DEMO_QUEUE_SIZE*sizeof(ULONG)); + + /* Create the semaphore used by threads 3 and 4. */ + tx_semaphore_create(&semaphore_0, "semaphore 0", 1); + + /* Create the event flags group used by threads 1 and 5. */ + tx_event_flags_create(&event_flags_0, "event flags 0"); + + /* Create the mutex used by thread 6 and 7 without priority inheritance. */ + tx_mutex_create(&mutex_0, "mutex 0", TX_NO_INHERIT); + + /* Allocate the memory for a small block pool. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_BLOCK_POOL_SIZE, TX_NO_WAIT); + + /* Create a block memory pool to allocate a message buffer from. */ + tx_block_pool_create(&block_pool_0, "block pool 0", sizeof(ULONG), pointer, DEMO_BLOCK_POOL_SIZE); + + /* Allocate a block and release the block memory. */ + tx_block_allocate(&block_pool_0, (VOID **) &pointer, TX_NO_WAIT); + + /* Release the block back to the pool. */ + tx_block_release(pointer); +} + + + +/* Define the test threads. */ + +void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + + /* This thread simply sits in while-forever-sleep loop. */ + while(1) + { + + /* Increment the thread counter. */ + thread_0_counter++; + + /* Sleep for 10 ticks. */ + tx_thread_sleep(10); + + /* Set event flag 0 to wakeup thread 5. */ + status = tx_event_flags_set(&event_flags_0, 0x1, TX_OR); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + } +} + + +void thread_1_entry(ULONG thread_input) +{ + +UINT status; + + + /* This thread simply sends messages to a queue shared by thread 2. */ + while(1) + { + + /* Increment the thread counter. */ + thread_1_counter++; + + /* Send message to queue 0. */ + status = tx_queue_send(&queue_0, &thread_1_messages_sent, TX_WAIT_FOREVER); + + /* Check completion status. */ + if (status != TX_SUCCESS) + break; + + /* Increment the message sent. */ + thread_1_messages_sent++; + } +} + + +void thread_2_entry(ULONG thread_input) +{ + +ULONG received_message; +UINT status; + + /* This thread retrieves messages placed on the queue by thread 1. */ + while(1) + { + + /* Increment the thread counter. */ + thread_2_counter++; + + /* Retrieve a message from the queue. */ + status = tx_queue_receive(&queue_0, &received_message, TX_WAIT_FOREVER); + + /* Check completion status and make sure the message is what we + expected. */ + if ((status != TX_SUCCESS) || (received_message != thread_2_messages_received)) + break; + + /* Otherwise, all is okay. Increment the received message count. */ + thread_2_messages_received++; + } +} + + +void thread_3_and_4_entry(ULONG thread_input) +{ + +UINT status; + + + /* This function is executed from thread 3 and thread 4. As the loop + below shows, these function compete for ownership of semaphore_0. */ + while(1) + { + + /* Increment the thread counter. */ + if (thread_input == 3) + thread_3_counter++; + else + thread_4_counter++; + + /* Get the semaphore with suspension. */ + status = tx_semaphore_get(&semaphore_0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Sleep for 2 ticks to hold the semaphore. */ + tx_thread_sleep(2); + + /* Release the semaphore. */ + status = tx_semaphore_put(&semaphore_0); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + } +} + + +void thread_5_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_flags; + + + /* This thread simply waits for an event in a forever loop. */ + while(1) + { + + /* Increment the thread counter. */ + thread_5_counter++; + + /* Wait for event flag 0. */ + status = tx_event_flags_get(&event_flags_0, 0x1, TX_OR_CLEAR, + &actual_flags, TX_WAIT_FOREVER); + + /* Check status. */ + if ((status != TX_SUCCESS) || (actual_flags != 0x1)) + break; + } +} + + +void thread_6_and_7_entry(ULONG thread_input) +{ + +UINT status; + + + /* This function is executed from thread 6 and thread 7. As the loop + below shows, these function compete for ownership of mutex_0. */ + while(1) + { + + /* Increment the thread counter. */ + if (thread_input == 6) + thread_6_counter++; + else + thread_7_counter++; + + /* Get the mutex with suspension. */ + status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Get the mutex again with suspension. This shows + that an owning thread may retrieve the mutex it + owns multiple times. */ + status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Sleep for 2 ticks to hold the mutex. */ + tx_thread_sleep(2); + + /* Release the mutex. */ + status = tx_mutex_put(&mutex_0); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Release the mutex again. This will actually + release ownership since it was obtained twice. */ + status = tx_mutex_put(&mutex_0); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + } +} diff --git a/ports/cortex_a5/ac6/example_build/sample_threadx/sample_threadx.launch b/ports/cortex_a5/ac6/example_build/sample_threadx/sample_threadx.launch new file mode 100644 index 00000000..efb12017 --- /dev/null +++ b/ports/cortex_a5/ac6/example_build/sample_threadx/sample_threadx.launch @@ -0,0 +1,188 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ports/cortex_a5/ac6/example_build/sample_threadx/sample_threadx.scat b/ports/cortex_a5/ac6/example_build/sample_threadx/sample_threadx.scat new file mode 100644 index 00000000..d23881cd --- /dev/null +++ b/ports/cortex_a5/ac6/example_build/sample_threadx/sample_threadx.scat @@ -0,0 +1,44 @@ +;******************************************************* +; Copyright (c) 2011-2016 Arm Limited (or its affiliates). All rights reserved. +; Use, modification and redistribution of this file is subject to your possession of a +; valid End User License Agreement for the Arm Product of which these examples are part of +; and your compliance with all applicable terms and conditions of such licence agreement. +;******************************************************* + +; Scatter-file for ARMv7-A bare-metal example on Versatile Express + +; This scatter-file places application code, data, stack and heap at suitable addresses in the memory map. + + +SDRAM 0x80000000 0x20000000 +{ + VECTORS +0 + { + * (VECTORS, +FIRST) ; Vector table and other (assembler) startup code + * (InRoot$$Sections) ; All (library) code that must be in a root region + } + + RO_CODE +0 + { * (+RO-CODE) } ; Application RO code (.text) + + RO_DATA +0 + { * (+RO-DATA) } ; Application RO data (.constdata) + + RW_DATA +0 + { * (+RW) } ; Application RW data (.data) + + ZI_DATA +0 + { * (+ZI) } ; Application ZI data (.bss) + + ARM_LIB_HEAP 0x80040000 EMPTY 0x00040000 ; Application heap + { } + + ARM_LIB_STACK 0x80090000 EMPTY 0x00010000 ; Application (SVC mode) stack + { } + +; IRQ_STACK 0x800A0000 EMPTY -0x00010000 ; IRQ mode stack +; { } + + TTB 0x80100000 EMPTY 0x4000 ; Level-1 Translation Table for MMU + { } +} diff --git a/ports/cortex_a5/ac6/example_build/sample_threadx/startup.S b/ports/cortex_a5/ac6/example_build/sample_threadx/startup.S new file mode 100644 index 00000000..670fadb9 --- /dev/null +++ b/ports/cortex_a5/ac6/example_build/sample_threadx/startup.S @@ -0,0 +1,397 @@ +//---------------------------------------------------------------- +// ARMv7-A Embedded example - Startup Code +// +// Copyright (c) 2005-2018 Arm Limited (or its affiliates). All rights reserved. +// Use, modification and redistribution of this file is subject to your possession of a +// valid End User License Agreement for the Arm Product of which these examples are part of +// and your compliance with all applicable terms and conditions of such licence agreement. +//---------------------------------------------------------------- + +// Standard definitions of mode bits and interrupt (I & F) flags in PSRs + +#define Mode_USR 0x10 +#define Mode_FIQ 0x11 +#define Mode_IRQ 0x12 +#define Mode_SVC 0x13 +#define Mode_ABT 0x17 +#define Mode_UND 0x1B +#define Mode_SYS 0x1F + +#define I_Bit 0x80 // When I bit is set, IRQ is disabled +#define F_Bit 0x40 // When F bit is set, FIQ is disabled + + + .section VECTORS, "ax" + .align 3 + .cfi_sections .debug_frame // put stack frame info into .debug_frame instead of .eh_frame + + +//---------------------------------------------------------------- +// Entry point for the Reset handler +//---------------------------------------------------------------- + + .global Vectors + +//---------------------------------------------------------------- +// Exception Vector Table +//---------------------------------------------------------------- +// Note: LDR PC instructions are used here, though branch (B) instructions +// could also be used, unless the exception handlers are >32MB away. + +Vectors: + LDR PC, Reset_Addr + LDR PC, Undefined_Addr + LDR PC, SVC_Addr + LDR PC, Prefetch_Addr + LDR PC, Abort_Addr + LDR PC, Hypervisor_Addr + LDR PC, IRQ_Addr + LDR PC, FIQ_Addr + + + .balign 4 +Reset_Addr: + .word Reset_Handler +Undefined_Addr: + .word __tx_undefined +SVC_Addr: + .word __tx_swi_interrupt +Prefetch_Addr: + .word __tx_prefetch_handler +Abort_Addr: + .word __tx_abort_handler +Hypervisor_Addr: + .word __tx_reserved_handler +IRQ_Addr: + .word __tx_irq_handler +FIQ_Addr: + .word __tx_fiq_handler + + +//---------------------------------------------------------------- +// Exception Handlers +//---------------------------------------------------------------- + +Undefined_Handler: + B Undefined_Handler +SVC_Handler: + B SVC_Handler +Prefetch_Handler: + B Prefetch_Handler +Abort_Handler: + B Abort_Handler +Hypervisor_Handler: + B Hypervisor_Handler +IRQ_Handler: + B IRQ_Handler +FIQ_Handler: + B FIQ_Handler + + +//---------------------------------------------------------------- +// Reset Handler +//---------------------------------------------------------------- +Reset_Handler: + +//---------------------------------------------------------------- +// Disable caches and MMU in case they were left enabled from an earlier run +// This does not need to be done from a cold reset +//---------------------------------------------------------------- + + MRC p15, 0, r0, c1, c0, 0 // Read System Control Register + BIC r0, r0, #(0x1 << 12) // Clear I bit 12 to disable I Cache + BIC r0, r0, #(0x1 << 2) // Clear C bit 2 to disable D Cache + BIC r0, r0, #0x1 // Clear M bit 0 to disable MMU + BIC r0, r0, #(0x1 << 11) // Clear Z bit 11 to disable branch prediction + MCR p15, 0, r0, c1, c0, 0 // Write System Control Register + ISB + +// The MMU is enabled later, before calling main(). Caches are enabled inside main(), +// after the MMU has been enabled and scatterloading has been performed. + +//---------------------------------------------------------------- +// ACTLR.SMP bit must be set before the caches and MMU are enabled, +// or any cache and TLB maintenance operations are performed, even for single-core +//---------------------------------------------------------------- + MRC p15, 0, r0, c1, c0, 1 // Read ACTLR + ORR r0, r0, #(1 << 6) // Set ACTLR.SMP bit + MCR p15, 0, r0, c1, c0, 1 // Write ACTLR + ISB + +//---------------------------------------------------------------- +// Invalidate Data and Instruction TLBs and branch predictor +// This does not need to be done from a cold reset +//---------------------------------------------------------------- + + MOV r0,#0 + MCR p15, 0, r0, c8, c7, 0 // I-TLB and D-TLB invalidation + MCR p15, 0, r0, c7, c5, 6 // BPIALL - Invalidate entire branch predictor array + +//---------------------------------------------------------------- +// Initialize Supervisor Mode Stack +// Note stack must be 8 byte aligned. +//---------------------------------------------------------------- + + LDR SP, =Image$$ARM_LIB_STACK$$ZI$$Limit + +//---------------------------------------------------------------- +// Disable loop-buffer to fix errata on A15 r0p0 +//---------------------------------------------------------------- + MRC p15, 0, r0, c0, c0, 0 // Read main ID register MIDR + MOV r1, r0, lsr #4 // Extract Primary Part Number + LDR r2, =0xFFF + AND r1, r1, r2 + LDR r2, =0xC0F + CMP r1, r2 // Is this an A15? + BNE notA15r0p0 // Jump if not A15 + AND r5, r0, #0x00f00000 // Variant + AND r6, r0, #0x0000000f // Revision + ORRS r6, r6, r5 // Combine variant and revision + BNE notA15r0p0 // Jump if not r0p0 + MRC p15, 0, r0, c1, c0, 1 // Read Aux Ctrl Reg + ORR r0, r0, #(1 << 1) // Set bit 1 to Disable Loop Buffer + MCR p15, 0, r0, c1, c0, 1 // Write Aux Ctrl Reg + ISB +notA15r0p0: + +//---------------------------------------------------------------- +// Set Vector Base Address Register (VBAR) to point to this application's vector table +//---------------------------------------------------------------- + + LDR r0, =Vectors + MCR p15, 0, r0, c12, c0, 0 + +//---------------------------------------------------------------- +// Cache Invalidation code for ARMv7-A +// The caches, MMU and BTB do not need post-reset invalidation on Cortex-A7, +// but forcing a cache invalidation makes the code more portable to other CPUs (e.g. Cortex-A9) +//---------------------------------------------------------------- + + // Invalidate L1 Instruction Cache + + MRC p15, 1, r0, c0, c0, 1 // Read Cache Level ID Register (CLIDR) + TST r0, #0x3 // Harvard Cache? + MOV r0, #0 // SBZ + MCRNE p15, 0, r0, c7, c5, 0 // ICIALLU - Invalidate instruction cache and flush branch target cache + + // Invalidate Data/Unified Caches + + MRC p15, 1, r0, c0, c0, 1 // Read CLIDR + ANDS r3, r0, #0x07000000 // Extract coherency level + MOV r3, r3, LSR #23 // Total cache levels << 1 + BEQ Finished // If 0, no need to clean + + MOV r10, #0 // R10 holds current cache level << 1 +Loop1: + ADD r2, r10, r10, LSR #1 // R2 holds cache "Set" position + MOV r1, r0, LSR r2 // Bottom 3 bits are the Cache-type for this level + AND r1, r1, #7 // Isolate those lower 3 bits + CMP r1, #2 + BLT Skip // No cache or only instruction cache at this level + + MCR p15, 2, r10, c0, c0, 0 // Write the Cache Size selection register + ISB // ISB to sync the change to the CacheSizeID reg + MRC p15, 1, r1, c0, c0, 0 // Reads current Cache Size ID register + AND r2, r1, #7 // Extract the line length field + ADD r2, r2, #4 // Add 4 for the line length offset (log2 16 bytes) + LDR r4, =0x3FF + ANDS r4, r4, r1, LSR #3 // R4 is the max number on the way size (right aligned) + CLZ r5, r4 // R5 is the bit position of the way size increment + LDR r7, =0x7FFF + ANDS r7, r7, r1, LSR #13 // R7 is the max number of the index size (right aligned) + +Loop2: + MOV r9, r4 // R9 working copy of the max way size (right aligned) + +Loop3: + ORR r11, r10, r9, LSL r5 // Factor in the Way number and cache number into R11 + ORR r11, r11, r7, LSL r2 // Factor in the Set number + MCR p15, 0, r11, c7, c6, 2 // Invalidate by Set/Way + SUBS r9, r9, #1 // Decrement the Way number + BGE Loop3 + SUBS r7, r7, #1 // Decrement the Set number + BGE Loop2 +Skip: + ADD r10, r10, #2 // Increment the cache number + CMP r3, r10 + BGT Loop1 + +Finished: + + +//---------------------------------------------------------------- +// MMU Configuration +// Set translation table base +//---------------------------------------------------------------- + + // Two translation tables are supported, TTBR0 and TTBR1 + // Configure translation table base (TTB) control register cp15,c2 + // to a value of all zeros, indicates we are using TTB register 0. + + MOV r0,#0x0 + MCR p15, 0, r0, c2, c0, 2 + + // write the address of our page table base to TTB register 0 + LDR r0,=Image$$TTB$$ZI$$Base + + MOV r1, #0x08 // RGN=b01 (outer cacheable write-back cached, write allocate) + // S=0 (translation table walk to non-shared memory) + ORR r1,r1,#0x40 // IRGN=b01 (inner cacheability for the translation table walk is Write-back Write-allocate) + + ORR r0,r0,r1 + + MCR p15, 0, r0, c2, c0, 0 + + +//---------------------------------------------------------------- +// PAGE TABLE generation + +// Generate the page tables +// Build a flat translation table for the whole address space. +// ie: Create 4096 1MB sections from 0x000xxxxx to 0xFFFxxxxx + + +// 31 20 19 18 17 16 15 14 12 11 10 9 8 5 4 3 2 1 0 +// |section base address| 0 0 |nG| S |AP2| TEX | AP | P | Domain | XN | C B | 1 0| +// +// Bits[31:20] - Top 12 bits of VA is pointer into table +// nG[17]=0 - Non global, enables matching against ASID in the TLB when set. +// S[16]=0 - Indicates normal memory is shared when set. +// AP2[15]=0 +// AP[11:10]=11 - Configure for full read/write access in all modes +// TEX[14:12]=000 +// CB[3:2]= 00 - Set attributes to Strongly-ordered memory. +// (except for the code segment descriptor, see below) +// IMPP[9]=0 - Ignored +// Domain[5:8]=1111 - Set all pages to use domain 15 +// XN[4]=1 - Execute never on Strongly-ordered memory +// Bits[1:0]=10 - Indicate entry is a 1MB section +//---------------------------------------------------------------- + LDR r0,=Image$$TTB$$ZI$$Base + LDR r1,=0xfff // loop counter + LDR r2,=0b00000000000000000000110111100010 + + // r0 contains the address of the translation table base + // r1 is loop counter + // r2 is level1 descriptor (bits 19:0) + + // use loop counter to create 4096 individual table entries. + // this writes from address 'Image$$TTB$$ZI$$Base' + + // offset 0x3FFC down to offset 0x0 in word steps (4 bytes) + +init_ttb_1: + ORR r3, r2, r1, LSL#20 // R3 now contains full level1 descriptor to write + ORR r3, r3, #0b0000000010000 // Set XN bit + STR r3, [r0, r1, LSL#2] // Str table entry at TTB base + loopcount*4 + SUBS r1, r1, #1 // Decrement loop counter + BPL init_ttb_1 + + // In this example, the 1MB section based at '__code_start' is setup specially as cacheable (write back mode). + // TEX[14:12]=001 and CB[3:2]= 11, Outer and inner write back, write allocate normal memory. + LDR r1,=Image$$VECTORS$$Base // Base physical address of code segment + LSR r1, #20 // Shift right to align to 1MB boundaries + ORR r3, r2, r1, LSL#20 // Setup the initial level1 descriptor again + ORR r3, r3, #0b0000000001100 // Set CB bits + ORR r3, r3, #0b1000000000000 // Set TEX bit 12 + STR r3, [r0, r1, LSL#2] // str table entry + +//---------------------------------------------------------------- +// Setup domain control register - Enable all domains to client mode +//---------------------------------------------------------------- + + MRC p15, 0, r0, c3, c0, 0 // Read Domain Access Control Register + LDR r0, =0x55555555 // Initialize every domain entry to b01 (client) + MCR p15, 0, r0, c3, c0, 0 // Write Domain Access Control Register + +#if defined(__ARM_NEON) || defined(__ARM_FP) +//---------------------------------------------------------------- +// Enable access to NEON/VFP by enabling access to Coprocessors 10 and 11. +// Enables Full Access i.e. in both privileged and non privileged modes +//---------------------------------------------------------------- + + MRC p15, 0, r0, c1, c0, 2 // Read Coprocessor Access Control Register (CPACR) + ORR r0, r0, #(0xF << 20) // Enable access to CP 10 & 11 + MCR p15, 0, r0, c1, c0, 2 // Write Coprocessor Access Control Register (CPACR) + ISB + +//---------------------------------------------------------------- +// Switch on the VFP and NEON hardware +//---------------------------------------------------------------- + + MOV r0, #0x40000000 + VMSR FPEXC, r0 // Write FPEXC register, EN bit set +#endif + + +//---------------------------------------------------------------- +// Enable MMU and branch to __main +// Leaving the caches disabled until after scatter loading. +//---------------------------------------------------------------- + + LDR r12,=__main + + MRC p15, 0, r0, c1, c0, 0 // Read System Control Register + BIC r0, r0, #(0x1 << 12) // Clear I bit 12 to disable I Cache + BIC r0, r0, #(0x1 << 2) // Clear C bit 2 to disable D Cache + BIC r0, r0, #0x2 // Clear A bit 1 to disable strict alignment fault checking + ORR r0, r0, #0x1 // Set M bit 0 to enable MMU before scatter loading + MCR p15, 0, r0, c1, c0, 0 // Write System Control Register + ISB + +// Now the MMU is enabled, virtual to physical address translations will occur. This will affect the next +// instruction fetch. +// +// The two instructions currently in the pipeline will have been fetched before the MMU was enabled. +// The branch to __main is safe because the Virtual Address (VA) is the same as the Physical Address (PA) +// (flat mapping) of this code that enables the MMU and performs the branch + + BX r12 // Branch to __main C library entry point + + + +//---------------------------------------------------------------- +// Enable caches and branch prediction +// This code must be run from a privileged mode +//---------------------------------------------------------------- + + .section ENABLECACHES,"ax" + .align 3 + + .global enable_caches + .type enable_caches, "function" + .cfi_startproc +enable_caches: + +//---------------------------------------------------------------- +// Enable caches and branch prediction +//---------------------------------------------------------------- + + MRC p15, 0, r0, c1, c0, 0 // Read System Control Register + ORR r0, r0, #(0x1 << 12) // Set I bit 12 to enable I Cache + ORR r0, r0, #(0x1 << 2) // Set C bit 2 to enable D Cache + ORR r0, r0, #(0x1 << 11) // Set Z bit 11 to enable branch prediction + MCR p15, 0, r0, c1, c0, 0 // Write System Control Register + ISB + + MRC p15, 0, r0, c1, c0, 1 // Read Auxiliary Control Register + ORR r0, #2 // L2EN bit, enable L2 cache + ORR r0, r0, #(0x1 << 2) // Set DP bit 2 to enable L1 Dside prefetch + MCR p15, 0, r0, c1, c0, 1 // Write Auxiliary Control Register + ISB + + BX lr + .cfi_endproc + + .global disable_caches + .type disable_caches, "function" +disable_caches: + + MRC p15, 0, r0, c1, c0, 0 // Read System Control Register + BIC r0, r0, #(0x1 << 12) // Clear I bit 12 to disable I Cache + BIC r0, r0, #(0x1 << 2) // Clear C bit 2 to disable D Cache + MCR p15, 0, r0, c1, c0, 0 // Write System Control Register + ISB + + BX lr + + diff --git a/ports/cortex_a5/ac6/example_build/sample_threadx/tx_initialize_low_level.S b/ports/cortex_a5/ac6/example_build/sample_threadx/tx_initialize_low_level.S new file mode 100644 index 00000000..715958f0 --- /dev/null +++ b/ports/cortex_a5/ac6/example_build/sample_threadx/tx_initialize_low_level.S @@ -0,0 +1,299 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Initialize */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .arm + +SVC_MODE = 0xD3 // Disable IRQ/FIQ SVC mode +IRQ_MODE = 0xD2 // Disable IRQ/FIQ IRQ mode +FIQ_MODE = 0xD1 // Disable IRQ/FIQ FIQ mode +SYS_MODE = 0xDF // Disable IRQ/FIQ SYS mode +FIQ_STACK_SIZE = 512 // FIQ stack size +IRQ_STACK_SIZE = 1024 // IRQ stack size +SYS_STACK_SIZE = 1024 // System stack size + + .global _tx_thread_system_stack_ptr + .global _tx_initialize_unused_memory + .global _tx_thread_context_save + .global _tx_thread_context_restore + .global _tx_timer_interrupt + + + +/* Define the 16-bit Thumb mode veneer for _tx_initialize_low_level for + applications calling this function from to 16-bit Thumb mode. */ + + .text + .align 2 + .thumb + .global $_tx_initialize_low_level + .type $_tx_initialize_low_level,function +$_tx_initialize_low_level: + BX pc // Switch to 32-bit mode + NOP // + .arm + STMFD sp!, {lr} // Save return address + BL _tx_initialize_low_level // Call _tx_initialize_low_level function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_initialize_low_level ARMV7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for any low-level processor */ +/* initialization, including setting up interrupt vectors, setting */ +/* up a periodic timer interrupt source, saving the system stack */ +/* pointer for use in ISR processing later, and finding the first */ +/* available RAM memory address for tx_application_define. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_initialize_kernel_enter ThreadX entry function */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_initialize_low_level + .type _tx_initialize_low_level,function +_tx_initialize_low_level: + + /* We must be in SVC mode at this point! */ + + /* Setup various stack pointers. */ + + LDR r1, =Image$$ARM_LIB_STACK$$ZI$$Limit // Get pointer to stack area + +#ifdef TX_ENABLE_IRQ_NESTING + + /* Setup the system mode stack for nested interrupt support */ + + LDR r2, =SYS_STACK_SIZE // Pickup stack size + MOV r3, #SYS_MODE // Build SYS mode CPSR + MSR CPSR_c, r3 // Enter SYS mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup SYS stack pointer + SUB r1, r1, r2 // Calculate start of next stack +#endif + + LDR r2, =FIQ_STACK_SIZE // Pickup stack size + MOV r0, #FIQ_MODE // Build FIQ mode CPSR + MSR CPSR, r0 // Enter FIQ mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup FIQ stack pointer + SUB r1, r1, r2 // Calculate start of next stack + LDR r2, =IRQ_STACK_SIZE // Pickup IRQ stack size + MOV r0, #IRQ_MODE // Build IRQ mode CPSR + MSR CPSR, r0 // Enter IRQ mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup IRQ stack pointer + SUB r3, r1, r2 // Calculate end of IRQ stack + MOV r0, #SVC_MODE // Build SVC mode CPSR + MSR CPSR, r0 // Enter SVC mode + LDR r2, =Image$$ARM_LIB_STACK$$Base // Pickup stack bottom + CMP r3, r2 // Compare the current stack end with the bottom +_stack_error_loop: + BLT _stack_error_loop // If the IRQ stack exceeds the stack bottom, just sit here! + + LDR r2, =_tx_thread_system_stack_ptr // Pickup stack pointer + STR r1, [r2] // Save the system stack + + LDR r1, =Image$$ZI_DATA$$ZI$$Limit // Get end of non-initialized RAM area + LDR r2, =_tx_initialize_unused_memory // Pickup unused memory ptr address + ADD r1, r1, #8 // Increment to next free word + STR r1, [r2] // Save first free memory address + +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif + +/* Define shells for each of the interrupt vectors. */ + + .global __tx_undefined +__tx_undefined: + B __tx_undefined // Undefined handler + + .global __tx_swi_interrupt +__tx_swi_interrupt: + B __tx_swi_interrupt // Software interrupt handler + + .global __tx_prefetch_handler +__tx_prefetch_handler: + B __tx_prefetch_handler // Prefetch exception handler + + .global __tx_abort_handler +__tx_abort_handler: + B __tx_abort_handler // Abort exception handler + + .global __tx_reserved_handler +__tx_reserved_handler: + B __tx_reserved_handler // Reserved exception handler + + .global __tx_irq_processing_return + .type __tx_irq_processing_return,function + .global __tx_irq_handler +__tx_irq_handler: + + /* Jump to context save to save system context. */ + B _tx_thread_context_save +__tx_irq_processing_return: + + /* At this point execution is still in the IRQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. In + addition, IRQ interrupts may be re-enabled - with certain restrictions - + if nested IRQ interrupts are desired. Interrupts may be re-enabled over + small code sequences where lr is saved before enabling interrupts and + restored after interrupts are again disabled. */ + + /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start + from IRQ mode with interrupts disabled. This routine switches to the + system mode and returns with IRQ interrupts enabled. + + NOTE: It is very important to ensure all IRQ interrupts are cleared + prior to enabling nested IRQ interrupts. */ +#ifdef TX_ENABLE_IRQ_NESTING + BL _tx_thread_irq_nesting_start +#endif + + /* For debug purpose, execute the timer interrupt processing here. In + a real system, some kind of status indication would have to be checked + before the timer interrupt handler could be called. */ + + BL _tx_timer_interrupt // Timer interrupt handler + + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_context_restore. + This routine returns in processing in IRQ mode with interrupts disabled. */ +#ifdef TX_ENABLE_IRQ_NESTING + BL _tx_thread_irq_nesting_end +#endif + + /* Jump to context restore to restore system context. */ + B _tx_thread_context_restore + + + /* This is an example of a vectored IRQ handler. */ + + /* At this point execution is still in the IRQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. In + addition, IRQ interrupts may be re-enabled - with certain restrictions - + if nested IRQ interrupts are desired. Interrupts may be re-enabled over + small code sequences where lr is saved before enabling interrupts and + restored after interrupts are again disabled. */ + + + /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start + from IRQ mode with interrupts disabled. This routine switches to the + system mode and returns with IRQ interrupts enabled. + + NOTE: It is very important to ensure all IRQ interrupts are cleared + prior to enabling nested IRQ interrupts. */ + + /* Application IRQ handlers can be called here! */ + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_context_restore. + This routine returns in processing in IRQ mode with interrupts disabled. */ + + /* Jump to context restore to restore system context. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + .global __tx_fiq_handler + .global __tx_fiq_processing_return +__tx_fiq_handler: + + /* Jump to fiq context save to save system context. */ + B _tx_thread_fiq_context_save +__tx_fiq_processing_return: + + /* At this point execution is still in the FIQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. */ + + /* Interrupt nesting is allowed after calling _tx_thread_fiq_nesting_start + from FIQ mode with interrupts disabled. This routine switches to the + system mode and returns with FIQ interrupts enabled. + + NOTE: It is very important to ensure all FIQ interrupts are cleared + prior to enabling nested FIQ interrupts. */ +#ifdef TX_ENABLE_FIQ_NESTING + BL _tx_thread_fiq_nesting_start +#endif + + /* Application FIQ handlers can be called here! */ + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_fiq_context_restore. */ +#ifdef TX_ENABLE_FIQ_NESTING + BL _tx_thread_fiq_nesting_end +#endif + + /* Jump to fiq context restore to restore system context. */ + B _tx_thread_fiq_context_restore + + +#else + .global __tx_fiq_handler +__tx_fiq_handler: + B __tx_fiq_handler // FIQ interrupt handler +#endif + + +BUILD_OPTIONS: + .word _tx_build_options // Reference to bring in +VERSION_ID: + .word _tx_version_id // Reference to bring in + + diff --git a/ports/cortex_a5/ac6/example_build/tx/.cproject b/ports/cortex_a5/ac6/example_build/tx/.cproject new file mode 100644 index 00000000..730528ae --- /dev/null +++ b/ports/cortex_a5/ac6/example_build/tx/.cproject @@ -0,0 +1,146 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ports/cortex_a5/ac6/example_build/tx/.project b/ports/cortex_a5/ac6/example_build/tx/.project new file mode 100644 index 00000000..863ca5cb --- /dev/null +++ b/ports/cortex_a5/ac6/example_build/tx/.project @@ -0,0 +1,48 @@ + + + tx + + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + + + + inc_generic + 2 + $%7BPARENT-5-PROJECT_LOC%7D/common/inc + + + inc_port + 2 + $%7BPARENT-2-PROJECT_LOC%7D/inc + + + src_generic + 2 + $%7BPARENT-5-PROJECT_LOC%7D/common/src + + + src_port + 2 + $%7BPARENT-2-PROJECT_LOC%7D/src + + + diff --git a/ports/cortex_a5/ac6/inc/tx_port.h b/ports/cortex_a5/ac6/inc/tx_port.h new file mode 100644 index 00000000..19463de1 --- /dev/null +++ b/ports/cortex_a5/ac6/inc/tx_port.h @@ -0,0 +1,328 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Port Specific */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* tx_port.h ARMv7-A */ +/* 6.1.11 */ +/* */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This file contains data type definitions that make the ThreadX */ +/* real-time kernel function identically on a variety of different */ +/* processor architectures. For example, the size or number of bits */ +/* in an "int" data type vary between microprocessor architectures and */ +/* even C compilers for the same microprocessor. ThreadX does not */ +/* directly use native C data types. Instead, ThreadX creates its */ +/* own special types that can be mapped to actual data types by this */ +/* file to guarantee consistency in the interface and functionality. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-02-2021 Bhupendra Naphade Modified comment(s),updated */ +/* macro definition, */ +/* resulting in version 6.1.6 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + +#ifndef TX_PORT_H +#define TX_PORT_H + + +/* Determine if the optional ThreadX user define file should be used. */ + +#ifdef TX_INCLUDE_USER_DEFINE_FILE + + +/* Yes, include the user defines in tx_user.h. The defines in this file may + alternately be defined on the command line. */ + +#include "tx_user.h" +#endif + + +/* Define compiler library include files. */ + +#include +#include + + +/* Define ThreadX basic types for this port. */ + +#define VOID void +typedef char CHAR; +typedef unsigned char UCHAR; +typedef int INT; +typedef unsigned int UINT; +typedef long LONG; +typedef unsigned long ULONG; +typedef short SHORT; +typedef unsigned short USHORT; + + +/* Define the priority levels for ThreadX. Legal values range + from 32 to 1024 and MUST be evenly divisible by 32. */ + +#ifndef TX_MAX_PRIORITIES +#define TX_MAX_PRIORITIES 32 +#endif + + +/* Define the minimum stack for a ThreadX thread on this processor. If the size supplied during + thread creation is less than this value, the thread create call will return an error. */ + +#ifndef TX_MINIMUM_STACK +#define TX_MINIMUM_STACK 200 /* Minimum stack size for this port */ +#endif + + +/* Define the system timer thread's default stack size and priority. These are only applicable + if TX_TIMER_PROCESS_IN_ISR is not defined. */ + +#ifndef TX_TIMER_THREAD_STACK_SIZE +#define TX_TIMER_THREAD_STACK_SIZE 1024 /* Default timer thread stack size */ +#endif + +#ifndef TX_TIMER_THREAD_PRIORITY +#define TX_TIMER_THREAD_PRIORITY 0 /* Default timer thread priority */ +#endif + + +/* Define various constants for the ThreadX ARM port. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT +#define TX_INT_DISABLE 0xC0 /* Disable IRQ & FIQ interrupts */ +#else +#define TX_INT_DISABLE 0x80 /* Disable IRQ interrupts */ +#endif +#define TX_INT_ENABLE 0x00 /* Enable IRQ interrupts */ + + +/* Define the clock source for trace event entry time stamp. The following two item are port specific. + For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock + source constants would be: + +#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_MASK 0x0000FFFFUL + +*/ + +#ifndef TX_TRACE_TIME_SOURCE +#define TX_TRACE_TIME_SOURCE ++_tx_trace_simulated_time +#endif +#ifndef TX_TRACE_TIME_MASK +#define TX_TRACE_TIME_MASK 0xFFFFFFFFUL +#endif + + +/* Define the port specific options for the _tx_build_options variable. This variable indicates + how the ThreadX library was built. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT +#define TX_FIQ_ENABLED 1 +#else +#define TX_FIQ_ENABLED 0 +#endif + +#ifdef TX_ENABLE_IRQ_NESTING +#define TX_IRQ_NESTING_ENABLED 2 +#else +#define TX_IRQ_NESTING_ENABLED 0 +#endif + +#ifdef TX_ENABLE_FIQ_NESTING +#define TX_FIQ_NESTING_ENABLED 4 +#else +#define TX_FIQ_NESTING_ENABLED 0 +#endif + +#define TX_PORT_SPECIFIC_BUILD_OPTIONS TX_FIQ_ENABLED | TX_IRQ_NESTING_ENABLED | TX_FIQ_NESTING_ENABLED + + +/* Define the in-line initialization constant so that modules with in-line + initialization capabilities can prevent their initialization from being + a function call. */ + +#define TX_INLINE_INITIALIZATION + + +/* Determine whether or not stack checking is enabled. By default, ThreadX stack checking is + disabled. When the following is defined, ThreadX thread stack checking is enabled. If stack + checking is enabled (TX_ENABLE_STACK_CHECKING is defined), the TX_DISABLE_STACK_FILLING + define is negated, thereby forcing the stack fill which is necessary for the stack checking + logic. */ + +#ifdef TX_ENABLE_STACK_CHECKING +#undef TX_DISABLE_STACK_FILLING +#endif + + +/* Define the TX_THREAD control block extensions for this port. The main reason + for the multiple macros is so that backward compatibility can be maintained with + existing ThreadX kernel awareness modules. */ + +#define TX_THREAD_EXTENSION_0 +#define TX_THREAD_EXTENSION_1 +#define TX_THREAD_EXTENSION_2 ULONG tx_thread_vfp_enable; +#define TX_THREAD_EXTENSION_3 + + +/* Define the port extensions of the remaining ThreadX objects. */ + +#define TX_BLOCK_POOL_EXTENSION +#define TX_BYTE_POOL_EXTENSION +#define TX_EVENT_FLAGS_GROUP_EXTENSION +#define TX_MUTEX_EXTENSION +#define TX_QUEUE_EXTENSION +#define TX_SEMAPHORE_EXTENSION +#define TX_TIMER_EXTENSION + + +/* Define the user extension field of the thread control block. Nothing + additional is needed for this port so it is defined as white space. */ + +#ifndef TX_THREAD_USER_EXTENSION +#define TX_THREAD_USER_EXTENSION +#endif + + +/* Define the macros for processing extensions in tx_thread_create, tx_thread_delete, + tx_thread_shell_entry, and tx_thread_terminate. */ + + +#define TX_THREAD_CREATE_EXTENSION(thread_ptr) +#define TX_THREAD_DELETE_EXTENSION(thread_ptr) +#define TX_THREAD_COMPLETED_EXTENSION(thread_ptr) +#define TX_THREAD_TERMINATED_EXTENSION(thread_ptr) + + +/* Define the ThreadX object creation extensions for the remaining objects. */ + +#define TX_BLOCK_POOL_CREATE_EXTENSION(pool_ptr) +#define TX_BYTE_POOL_CREATE_EXTENSION(pool_ptr) +#define TX_EVENT_FLAGS_GROUP_CREATE_EXTENSION(group_ptr) +#define TX_MUTEX_CREATE_EXTENSION(mutex_ptr) +#define TX_QUEUE_CREATE_EXTENSION(queue_ptr) +#define TX_SEMAPHORE_CREATE_EXTENSION(semaphore_ptr) +#define TX_TIMER_CREATE_EXTENSION(timer_ptr) + + +/* Define the ThreadX object deletion extensions for the remaining objects. */ + +#define TX_BLOCK_POOL_DELETE_EXTENSION(pool_ptr) +#define TX_BYTE_POOL_DELETE_EXTENSION(pool_ptr) +#define TX_EVENT_FLAGS_GROUP_DELETE_EXTENSION(group_ptr) +#define TX_MUTEX_DELETE_EXTENSION(mutex_ptr) +#define TX_QUEUE_DELETE_EXTENSION(queue_ptr) +#define TX_SEMAPHORE_DELETE_EXTENSION(semaphore_ptr) +#define TX_TIMER_DELETE_EXTENSION(timer_ptr) + + +/* Determine if the ARM architecture has the CLZ instruction. This is available on + architectures v5 and above. If available, redefine the macro for calculating the + lowest bit set. */ + +#if __TARGET_ARCH_ARM > 4 + +#ifndef __thumb__ + +#define TX_LOWEST_SET_BIT_CALCULATE(m, b) m = m & ((ULONG) (-((LONG) m))); \ + asm volatile (" CLZ %0,%1 ": "=r" (b) : "r" (m) ); \ + b = 31 - b; +#endif +#endif + + +/* Define ThreadX interrupt lockout and restore macros for protection on + access of critical kernel information. The restore interrupt macro must + restore the interrupt posture of the running thread prior to the value + present prior to the disable macro. In most cases, the save area macro + is used to define a local function save area for the disable and restore + macros. */ + +#ifdef __thumb__ + +unsigned int _tx_thread_interrupt_disable(void); +unsigned int _tx_thread_interrupt_restore(UINT old_posture); + + +#define TX_INTERRUPT_SAVE_AREA UINT interrupt_save; + +#define TX_DISABLE interrupt_save = _tx_thread_interrupt_disable(); +#define TX_RESTORE _tx_thread_interrupt_restore(interrupt_save); + +#else + +#define TX_INTERRUPT_SAVE_AREA UINT interrupt_save, tx_temp; + +#ifdef TX_ENABLE_FIQ_SUPPORT +#define TX_DISABLE asm volatile (" MRS %0,CPSR; CPSID if ": "=r" (interrupt_save) ); +#else +#define TX_DISABLE asm volatile (" MRS %0,CPSR; CPSID i ": "=r" (interrupt_save) ); +#endif + +#define TX_RESTORE asm volatile (" MSR CPSR_c,%0 "::"r" (interrupt_save) ); + +#endif + + +/* Define VFP extension for the ARMv7-A. Each is assumed to be called in the context of the executing + thread. */ + +void tx_thread_vfp_enable(void); +void tx_thread_vfp_disable(void); + + +/* Define the interrupt lockout macros for each ThreadX object. */ + +#define TX_BLOCK_POOL_DISABLE TX_DISABLE +#define TX_BYTE_POOL_DISABLE TX_DISABLE +#define TX_EVENT_FLAGS_GROUP_DISABLE TX_DISABLE +#define TX_MUTEX_DISABLE TX_DISABLE +#define TX_QUEUE_DISABLE TX_DISABLE +#define TX_SEMAPHORE_DISABLE TX_DISABLE + + +/* Define the version ID of ThreadX. This may be utilized by the application. */ + +#ifdef TX_THREAD_INIT +CHAR _tx_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX ARMv7-A Version 6.1.11 *"; +#else +extern CHAR _tx_version_id[]; +#endif + + +#endif + diff --git a/ports/cortex_a5/ac6/src/tx_thread_context_restore.S b/ports/cortex_a5/ac6/src/tx_thread_context_restore.S new file mode 100644 index 00000000..fae7e72d --- /dev/null +++ b/ports/cortex_a5/ac6/src/tx_thread_context_restore.S @@ -0,0 +1,222 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .arm + +#ifdef TX_ENABLE_FIQ_SUPPORT +SVC_MODE = 0xD3 // Disable IRQ/FIQ, SVC mode +IRQ_MODE = 0xD2 // Disable IRQ/FIQ, IRQ mode +#else +SVC_MODE = 0x93 // Disable IRQ, SVC mode +IRQ_MODE = 0x92 // Disable IRQ, IRQ mode +#endif + + .global _tx_thread_system_state + .global _tx_thread_current_ptr + .global _tx_thread_execute_ptr + .global _tx_timer_time_slice + .global _tx_thread_schedule + .global _tx_thread_preempt_disable + + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_restore + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_context_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function restores the interrupt context if it is processing a */ +/* nested interrupt. If not, it returns to the interrupt thread if no */ +/* preemption is necessary. Otherwise, if preemption is necessary or */ +/* if no thread was running, the function returns to the scheduler. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling routine */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs Interrupt Service Routines */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_context_restore + .type _tx_thread_context_restore,function +_tx_thread_context_restore: + + /* Lockout interrupts. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Disable IRQ and FIQ interrupts +#else + CPSID i // Disable IRQ interrupts +#endif + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR exit function to indicate an ISR is complete. */ + + BL _tx_execution_isr_exit // Call the ISR exit function +#endif + + /* Determine if interrupts are nested. */ + + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + SUB r2, r2, #1 // Decrement the counter + STR r2, [r3] // Store the counter + CMP r2, #0 // Was this the first interrupt? + BEQ __tx_thread_not_nested_restore // If so, not a nested restore + + /* Interrupts are nested. */ + + /* Just recover the saved registers and return to the point of + interrupt. */ + + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_not_nested_restore: + + /* Determine if a thread was interrupted and no preemption is required. */ + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup actual current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_restore // Yes, idle system was interrupted + + LDR r3, =_tx_thread_preempt_disable // Pickup preempt disable address + LDR r2, [r3] // Pickup actual preempt disable flag + CMP r2, #0 // Is it set? + BNE __tx_thread_no_preempt_restore // Yes, don't preempt this thread + LDR r3, =_tx_thread_execute_ptr // Pickup address of execute thread ptr + LDR r2, [r3] // Pickup actual execute thread pointer + CMP r0, r2 // Is the same thread highest priority? + BNE __tx_thread_preempt_restore // No, preemption needs to happen + + +__tx_thread_no_preempt_restore: + + /* Recover the saved context and return to the point of interrupt. */ + + /* Pickup the saved stack pointer. */ + + /* Recover the saved context and return to the point of interrupt. */ + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_preempt_restore: + + LDMIA sp!, {r3, r10, r12, lr} // Recover temporarily saved registers + MOV r1, lr // Save lr (point of interrupt) + MOV r2, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r2 // Enter SVC mode + STR r1, [sp, #-4]! // Save point of interrupt + STMDB sp!, {r4-r12, lr} // Save upper half of registers + MOV r4, r3 // Save SPSR in r4 + MOV r2, #IRQ_MODE // Build IRQ mode CPSR + MSR CPSR_c, r2 // Enter IRQ mode + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOV r5, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r5 // Enter SVC mode + STMDB sp!, {r0-r3} // Save r0-r3 on thread's stack + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer + +#ifdef TX_ENABLE_VFP_SUPPORT + LDR r2, [r0, #144] // Pickup the VFP enabled flag + CMP r2, #0 // Is the VFP enabled? + BEQ _tx_skip_irq_vfp_save // No, skip VFP IRQ save + VMRS r2, FPSCR // Pickup the FPSCR + STR r2, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D0-D15} // Save D0-D15 + +_tx_skip_irq_vfp_save: + +#endif + + MOV r3, #1 // Build interrupt stack type + STMDB sp!, {r3, r4} // Save interrupt stack type and SPSR + STR sp, [r0, #8] // Save stack pointer in thread control + // block + + /* Save the remaining time-slice and disable it. */ + LDR r3, =_tx_timer_time_slice // Pickup time-slice variable address + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it active? + BEQ __tx_thread_dont_save_ts // No, don't save it + STR r2, [r0, #24] // Save thread's time-slice + MOV r2, #0 // Clear value + STR r2, [r3] // Disable global time-slice flag + +__tx_thread_dont_save_ts: + + /* Clear the current task pointer. */ + MOV r0, #0 // NULL value + STR r0, [r1] // Clear current thread pointer + + /* Return to the scheduler. */ + B _tx_thread_schedule // Return to scheduler + +__tx_thread_idle_system_restore: + + /* Just return back to the scheduler! */ + MOV r0, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r0 // Enter SVC mode + B _tx_thread_schedule // Return to scheduler diff --git a/ports/cortex_a5/ac6/src/tx_thread_context_save.S b/ports/cortex_a5/ac6/src/tx_thread_context_save.S new file mode 100644 index 00000000..7ac48c2e --- /dev/null +++ b/ports/cortex_a5/ac6/src/tx_thread_context_save.S @@ -0,0 +1,172 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .global _tx_thread_system_state + .global _tx_thread_current_ptr + .global __tx_irq_processing_return + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_save + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_context_save + .type _tx_thread_context_save,function +_tx_thread_context_save: + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + + STMDB sp!, {r0-r3} // Save some working registers +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Disable FIQ interrupts +#endif + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + + /* Save the rest of the scratch registers on the stack and return to the + calling ISR. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, r10, r12, lr} // Store other registers + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + B __tx_irq_processing_return // Continue IRQ processing + +__tx_thread_not_nested_save: + + /* Otherwise, not nested, check to see if a thread was running. */ + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + + /* Save minimal context of interrupted thread. */ + + MRS r2, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r2, r10, r12, lr} // Store other registers + + MOV r10, #0 // Clear stack limit + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + B __tx_irq_processing_return // Continue IRQ processing + +__tx_thread_idle_system_save: + + /* Interrupt occurred in the scheduling loop. */ + + /* Not much to do here, just adjust the stack pointer, and return to IRQ + processing. */ + + MOV r10, #0 // Clear stack limit + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + ADD sp, sp, #16 // Recover saved registers + B __tx_irq_processing_return // Continue IRQ processing diff --git a/ports/cortex_a5/ac6/src/tx_thread_fiq_context_restore.S b/ports/cortex_a5/ac6/src/tx_thread_fiq_context_restore.S new file mode 100644 index 00000000..006be973 --- /dev/null +++ b/ports/cortex_a5/ac6/src/tx_thread_fiq_context_restore.S @@ -0,0 +1,223 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +SVC_MODE = 0xD3 // SVC mode +FIQ_MODE = 0xD1 // FIQ mode +MODE_MASK = 0x1F // Mode mask +THUMB_MASK = 0x20 // Thumb bit mask +IRQ_MODE_BITS = 0x12 // IRQ mode bits + + + .global _tx_thread_system_state + .global _tx_thread_current_ptr + .global _tx_thread_system_stack_ptr + .global _tx_thread_execute_ptr + .global _tx_timer_time_slice + .global _tx_thread_schedule + .global _tx_thread_preempt_disable + .global _tx_execution_isr_exit + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_restore + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_context_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function restores the fiq interrupt context when processing a */ +/* nested interrupt. If not, it returns to the interrupt thread if no */ +/* preemption is necessary. Otherwise, if preemption is necessary or */ +/* if no thread was running, the function returns to the scheduler. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling routine */ +/* */ +/* CALLED BY */ +/* */ +/* FIQ ISR Interrupt Service Routines */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_fiq_context_restore + .type _tx_thread_fiq_context_restore,function +_tx_thread_fiq_context_restore: + + /* Lockout interrupts. */ + + CPSID if // Disable IRQ and FIQ interrupts + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR exit function to indicate an ISR is complete. */ + + BL _tx_execution_isr_exit // Call the ISR exit function +#endif + + /* Determine if interrupts are nested. */ + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + SUB r2, r2, #1 // Decrement the counter + STR r2, [r3] // Store the counter + CMP r2, #0 // Was this the first interrupt? + BEQ __tx_thread_fiq_not_nested_restore // If so, not a nested restore + + /* Interrupts are nested. */ + + /* Just recover the saved registers and return to the point of + interrupt. */ + + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_fiq_not_nested_restore: + + /* Determine if a thread was interrupted and no preemption is required. */ + + LDR r1, [sp] // Pickup the saved SPSR + MOV r2, #MODE_MASK // Build mask to isolate the interrupted mode + AND r1, r1, r2 // Isolate mode bits + CMP r1, #IRQ_MODE_BITS // Was an interrupt taken in IRQ mode before we + // got to context save? */ + BEQ __tx_thread_fiq_no_preempt_restore // Yes, just go back to point of interrupt + + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup actual current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_fiq_idle_system_restore // Yes, idle system was interrupted + + LDR r3, =_tx_thread_preempt_disable // Pickup preempt disable address + LDR r2, [r3] // Pickup actual preempt disable flag + CMP r2, #0 // Is it set? + BNE __tx_thread_fiq_no_preempt_restore // Yes, don't preempt this thread + LDR r3, =_tx_thread_execute_ptr // Pickup address of execute thread ptr + LDR r2, [r3] // Pickup actual execute thread pointer + CMP r0, r2 // Is the same thread highest priority? + BNE __tx_thread_fiq_preempt_restore // No, preemption needs to happen + + +__tx_thread_fiq_no_preempt_restore: + + /* Restore interrupted thread or ISR. */ + /* Recover the saved context and return to the point of interrupt. */ + + LDMIA sp!, {r0, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_fiq_preempt_restore: + + LDMIA sp!, {r3, lr} // Recover temporarily saved registers + MOV r1, lr // Save lr (point of interrupt) + MOV r2, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r2 // Enter SVC mode + STR r1, [sp, #-4]! // Save point of interrupt + STMDB sp!, {r4-r12, lr} // Save upper half of registers + MOV r4, r3 // Save SPSR in r4 + MOV r2, #FIQ_MODE // Build FIQ mode CPSR + MSR CPSR_c, r2 // Reenter FIQ mode + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOV r5, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r5 // Enter SVC mode + STMDB sp!, {r0-r3} // Save r0-r3 on thread's stack + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer + +#ifdef TX_ENABLE_VFP_SUPPORT + LDR r2, [r0, #144] // Pickup the VFP enabled flag + CMP r2, #0 // Is the VFP enabled? + BEQ _tx_skip_fiq_vfp_save // No, skip VFP IRQ save + VMRS r2, FPSCR // Pickup the FPSCR + STR r2, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D0-D15} // Save D0-D15 +_tx_skip_fiq_vfp_save: +#endif + + MOV r3, #1 // Build interrupt stack type + STMDB sp!, {r3, r4} // Save interrupt stack type and SPSR + STR sp, [r0, #8] // Save stack pointer in thread control + // block */ + LDR r3, =_tx_timer_time_slice // Pickup time-slice variable address + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it active? + BEQ __tx_thread_fiq_dont_save_ts // No, don't save it + + STR r2, [r0, #24] // Save thread's time-slice + MOV r2, #0 // Clear value + STR r2, [r3] // Disable global time-slice flag + +__tx_thread_fiq_dont_save_ts: + + /* Clear the current task pointer. */ + + MOV r0, #0 // NULL value + STR r0, [r1] // Clear current thread pointer + + /* Return to the scheduler. */ + + B _tx_thread_schedule // Return to scheduler + +__tx_thread_fiq_idle_system_restore: + + /* Just return back to the scheduler! */ + + ADD sp, sp, #24 // Recover FIQ stack space + MOV r3, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r3 // Lockout interrupts + B _tx_thread_schedule // Return to scheduler + diff --git a/ports/cortex_a5/ac6/src/tx_thread_fiq_context_save.S b/ports/cortex_a5/ac6/src/tx_thread_fiq_context_save.S new file mode 100644 index 00000000..7db6a4c2 --- /dev/null +++ b/ports/cortex_a5/ac6/src/tx_thread_fiq_context_save.S @@ -0,0 +1,178 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .global _tx_thread_system_state + .global _tx_thread_current_ptr + .global __tx_fiq_processing_return + .global _tx_execution_isr_enter + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_save + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_fiq_context_save + .type _tx_thread_fiq_context_save,function +_tx_thread_fiq_context_save: + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + + STMDB sp!, {r0-r3} // Save some working registers + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_fiq_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + + /* Save the rest of the scratch registers on the stack and return to the + calling ISR. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, r10, r12, lr} // Store other registers + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + B __tx_fiq_processing_return // Continue FIQ processing +// +__tx_thread_fiq_not_nested_save: + + /* Otherwise, not nested, check to see if a thread was running. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_fiq_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + + /* Save minimal context of interrupted thread. */ + + MRS r2, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r2, lr} // Store other registers, Note that we don't + // need to save sl and ip since FIQ has + // copies of these registers. Nested + // interrupt processing does need to save + // these registers. + + MOV r10, #0 // Clear stack limit + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + B __tx_fiq_processing_return // Continue FIQ processing + +__tx_thread_fiq_idle_system_save: + + /* Interrupt occurred in the scheduling loop. */ + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + /* Not much to do here, save the current SPSR and LR for possible + use in IRQ interrupted in idle system conditions, and return to + FIQ interrupt processing. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, lr} // Store other registers that will get used + // or stripped off the stack in context + // restore + B __tx_fiq_processing_return // Continue FIQ processing diff --git a/ports/cortex_a5/ac6/src/tx_thread_fiq_nesting_end.S b/ports/cortex_a5/ac6/src/tx_thread_fiq_nesting_end.S new file mode 100644 index 00000000..b34d881e --- /dev/null +++ b/ports/cortex_a5/ac6/src/tx_thread_fiq_nesting_end.S @@ -0,0 +1,104 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +#ifdef TX_ENABLE_FIQ_SUPPORT +DISABLE_INTS = 0xC0 // Disable IRQ/FIQ interrupts +#else +DISABLE_INTS = 0x80 // Disable IRQ interrupts +#endif +MODE_MASK = 0x1F // Mode mask +FIQ_MODE_BITS = 0x11 // FIQ mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_end + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_nesting_end ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from FIQ mode after */ +/* _tx_thread_fiq_nesting_start has been called and switches the FIQ */ +/* processing from system mode back to FIQ mode prior to the ISR */ +/* calling _tx_thread_fiq_context_restore. Note that this function */ +/* assumes the system stack pointer is in the same position after */ +/* nesting start function was called. */ +/* */ +/* This function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with FIQ interrupts disabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_fiq_nesting_end + .type _tx_thread_fiq_nesting_end,function +_tx_thread_fiq_nesting_end: + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + ORR r0, r0, #DISABLE_INTS // Build disable interrupt value + MSR CPSR_c, r0 // Disable interrupts + LDMIA sp!, {r1, lr} // Pickup saved lr (and r1 throw-away for + // 8-byte alignment logic) + BIC r0, r0, #MODE_MASK // Clear mode bits + ORR r0, r0, #FIQ_MODE_BITS // Build IRQ mode CPSR + MSR CPSR_c, r0 // Reenter IRQ mode + +#ifdef __THUMB_INTERWORK + BX r3 // Return to caller +#else + MOV pc, r3 // Return to caller +#endif diff --git a/ports/cortex_a5/ac6/src/tx_thread_fiq_nesting_start.S b/ports/cortex_a5/ac6/src/tx_thread_fiq_nesting_start.S new file mode 100644 index 00000000..c9cd5a06 --- /dev/null +++ b/ports/cortex_a5/ac6/src/tx_thread_fiq_nesting_start.S @@ -0,0 +1,96 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +FIQ_DISABLE = 0x40 // FIQ disable bit +MODE_MASK = 0x1F // Mode mask +SYS_MODE_BITS = 0x1F // System mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_start + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_nesting_start ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from FIQ mode after */ +/* _tx_thread_fiq_context_save has been called and switches the FIQ */ +/* processing to the system mode so nested FIQ interrupt processing */ +/* is possible (system mode has its own "lr" register). Note that */ +/* this function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with FIQ interrupts enabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_fiq_nesting_start + .type _tx_thread_fiq_nesting_start,function +_tx_thread_fiq_nesting_start: + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + BIC r0, r0, #MODE_MASK // Clear the mode bits + ORR r0, r0, #SYS_MODE_BITS // Build system mode CPSR + MSR CPSR_c, r0 // Enter system mode + STMDB sp!, {r1, lr} // Push the system mode lr on the system mode stack + // and push r1 just to keep 8-byte alignment + BIC r0, r0, #FIQ_DISABLE // Build enable FIQ CPSR + MSR CPSR_c, r0 // Enter system mode +#ifdef __THUMB_INTERWORK + BX r3 // Return to caller +#else + MOV pc, r3 // Return to caller +#endif diff --git a/ports/cortex_a5/ac6/src/tx_thread_interrupt_control.S b/ports/cortex_a5/ac6/src/tx_thread_interrupt_control.S new file mode 100644 index 00000000..63b1609a --- /dev/null +++ b/ports/cortex_a5/ac6/src/tx_thread_interrupt_control.S @@ -0,0 +1,104 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +INT_MASK = 0x03F + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_control for + applications calling this function from to 16-bit Thumb mode. */ + + .text + .align 2 + .global $_tx_thread_interrupt_control +$_tx_thread_interrupt_control: + .thumb + BX pc // Switch to 32-bit mode + NOP // + .arm + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_control // Call _tx_thread_interrupt_control function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_control ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for changing the interrupt lockout */ +/* posture of the system. */ +/* */ +/* INPUT */ +/* */ +/* new_posture New interrupt lockout posture */ +/* */ +/* OUTPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_interrupt_control + .type _tx_thread_interrupt_control,function +_tx_thread_interrupt_control: + + /* Pickup current interrupt lockout posture. */ + + MRS r3, CPSR // Pickup current CPSR + MOV r2, #INT_MASK // Build interrupt mask + AND r1, r3, r2 // Clear interrupt lockout bits + ORR r1, r1, r0 // Or-in new interrupt lockout bits + + /* Apply the new interrupt posture. */ + + MSR CPSR_c, r1 // Setup new CPSR + BIC r0, r3, r2 // Return previous interrupt mask +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a5/ac6/src/tx_thread_interrupt_disable.S b/ports/cortex_a5/ac6/src/tx_thread_interrupt_disable.S new file mode 100644 index 00000000..13258808 --- /dev/null +++ b/ports/cortex_a5/ac6/src/tx_thread_interrupt_disable.S @@ -0,0 +1,101 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_disable for + applications calling this function from to 16-bit Thumb mode. */ + + .text + .align 2 + .global $_tx_thread_interrupt_disable +$_tx_thread_interrupt_disable: + .thumb + BX pc // Switch to 32-bit mode + NOP // + .arm + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_disable // Call _tx_thread_interrupt_disable function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_disable ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for disabling interrupts */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_interrupt_disable + .type _tx_thread_interrupt_disable,function +_tx_thread_interrupt_disable: + + /* Pickup current interrupt lockout posture. */ + + MRS r0, CPSR // Pickup current CPSR + + /* Mask interrupts. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Disable IRQ and FIQ +#else + CPSID i // Disable IRQ +#endif + +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a5/ac6/src/tx_thread_interrupt_restore.S b/ports/cortex_a5/ac6/src/tx_thread_interrupt_restore.S new file mode 100644 index 00000000..2d582511 --- /dev/null +++ b/ports/cortex_a5/ac6/src/tx_thread_interrupt_restore.S @@ -0,0 +1,93 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_restore for + applications calling this function from to 16-bit Thumb mode. */ + + .text + .align 2 + .global $_tx_thread_interrupt_restore +$_tx_thread_interrupt_restore: + .thumb + BX pc // Switch to 32-bit mode + NOP // + .arm + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_restore // Call _tx_thread_interrupt_restore function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for restoring interrupts to the state */ +/* returned by a previous _tx_thread_interrupt_disable call. */ +/* */ +/* INPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_interrupt_restore + .type _tx_thread_interrupt_restore,function +_tx_thread_interrupt_restore: + + /* Apply the new interrupt posture. */ + + MSR CPSR_c, r0 // Setup new CPSR +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a5/ac6/src/tx_thread_irq_nesting_end.S b/ports/cortex_a5/ac6/src/tx_thread_irq_nesting_end.S new file mode 100644 index 00000000..ec7e63c6 --- /dev/null +++ b/ports/cortex_a5/ac6/src/tx_thread_irq_nesting_end.S @@ -0,0 +1,103 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +#ifdef TX_ENABLE_FIQ_SUPPORT +DISABLE_INTS = 0xC0 // Disable IRQ/FIQ interrupts +#else +DISABLE_INTS = 0x80 // Disable IRQ interrupts +#endif +MODE_MASK = 0x1F // Mode mask +IRQ_MODE_BITS = 0x12 // IRQ mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_end + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_irq_nesting_end ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from IRQ mode after */ +/* _tx_thread_irq_nesting_start has been called and switches the IRQ */ +/* processing from system mode back to IRQ mode prior to the ISR */ +/* calling _tx_thread_context_restore. Note that this function */ +/* assumes the system stack pointer is in the same position after */ +/* nesting start function was called. */ +/* */ +/* This function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with IRQ interrupts disabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_irq_nesting_end + .type _tx_thread_irq_nesting_end,function +_tx_thread_irq_nesting_end: + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + ORR r0, r0, #DISABLE_INTS // Build disable interrupt value + MSR CPSR_c, r0 // Disable interrupts + LDMIA sp!, {r1, lr} // Pickup saved lr (and r1 throw-away for + // 8-byte alignment logic) + BIC r0, r0, #MODE_MASK // Clear mode bits + ORR r0, r0, #IRQ_MODE_BITS // Build IRQ mode CPSR + MSR CPSR_c, r0 // Reenter IRQ mode +#ifdef __THUMB_INTERWORK + BX r3 // Return to caller +#else + MOV pc, r3 // Return to caller +#endif diff --git a/ports/cortex_a5/ac6/src/tx_thread_irq_nesting_start.S b/ports/cortex_a5/ac6/src/tx_thread_irq_nesting_start.S new file mode 100644 index 00000000..c69976ed --- /dev/null +++ b/ports/cortex_a5/ac6/src/tx_thread_irq_nesting_start.S @@ -0,0 +1,96 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +IRQ_DISABLE = 0x80 // IRQ disable bit +MODE_MASK = 0x1F // Mode mask +SYS_MODE_BITS = 0x1F // System mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_start + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_irq_nesting_start ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from IRQ mode after */ +/* _tx_thread_context_save has been called and switches the IRQ */ +/* processing to the system mode so nested IRQ interrupt processing */ +/* is possible (system mode has its own "lr" register). Note that */ +/* this function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with IRQ interrupts enabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_irq_nesting_start + .type _tx_thread_irq_nesting_start,function +_tx_thread_irq_nesting_start: + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + BIC r0, r0, #MODE_MASK // Clear the mode bits + ORR r0, r0, #SYS_MODE_BITS // Build system mode CPSR + MSR CPSR_c, r0 // Enter system mode + STMDB sp!, {r1, lr} // Push the system mode lr on the system mode stack + // and push r1 just to keep 8-byte alignment + BIC r0, r0, #IRQ_DISABLE // Build enable IRQ CPSR + MSR CPSR_c, r0 // Enter system mode +#ifdef __THUMB_INTERWORK + BX r3 // Return to caller +#else + MOV pc, r3 // Return to caller +#endif diff --git a/ports/cortex_a5/ac6/src/tx_thread_schedule.S b/ports/cortex_a5/ac6/src/tx_thread_schedule.S new file mode 100644 index 00000000..8330e9df --- /dev/null +++ b/ports/cortex_a5/ac6/src/tx_thread_schedule.S @@ -0,0 +1,230 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .global _tx_thread_execute_ptr + .global _tx_thread_current_ptr + .global _tx_timer_time_slice + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_schedule for + applications calling this function from to 16-bit Thumb mode. */ + + .text + .align 2 + .global $_tx_thread_schedule + .type $_tx_thread_schedule,function +$_tx_thread_schedule: + .thumb + BX pc // Switch to 32-bit mode + NOP // + .arm + STMFD sp!, {lr} // Save return address + BL _tx_thread_schedule // Call _tx_thread_schedule function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_schedule ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function waits for a thread control block pointer to appear in */ +/* the _tx_thread_execute_ptr variable. Once a thread pointer appears */ +/* in the variable, the corresponding thread is resumed. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_initialize_kernel_enter ThreadX entry function */ +/* _tx_thread_system_return Return to system from thread */ +/* _tx_thread_context_restore Restore thread's context */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_schedule + .type _tx_thread_schedule,function +_tx_thread_schedule: + + /* Enable interrupts. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSIE if // Enable IRQ and FIQ interrupts +#else + CPSIE i // Enable IRQ interrupts +#endif + + /* Wait for a thread to execute. */ + LDR r1, =_tx_thread_execute_ptr // Address of thread execute ptr + +__tx_thread_schedule_loop: + + LDR r0, [r1] // Pickup next thread to execute + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_schedule_loop // If so, keep looking for a thread + /* Yes! We have a thread to execute. Lockout interrupts and + transfer control to it. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Disable IRQ and FIQ interrupts +#else + CPSID i // Disable IRQ interrupts +#endif + + /* Setup the current thread pointer. */ + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread + STR r0, [r1] // Setup current thread pointer + + /* Increment the run count for this thread. */ + + LDR r2, [r0, #4] // Pickup run counter + LDR r3, [r0, #24] // Pickup time-slice for this thread + ADD r2, r2, #1 // Increment thread run-counter + STR r2, [r0, #4] // Store the new run counter + + /* Setup time-slice, if present. */ + + LDR r2, =_tx_timer_time_slice // Pickup address of time-slice + // variable + LDR sp, [r0, #8] // Switch stack pointers + STR r3, [r2] // Setup time-slice + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the thread entry function to indicate the thread is executing. */ + + MOV r5, r0 // Save r0 + BL _tx_execution_thread_enter // Call the thread execution enter function + MOV r0, r5 // Restore r0 +#endif + + /* Determine if an interrupt frame or a synchronous task suspension frame + is present. */ + + LDMIA sp!, {r4, r5} // Pickup the stack type and saved CPSR + CMP r4, #0 // Check for synchronous context switch + BEQ _tx_solicited_return + MSR SPSR_cxsf, r5 // Setup SPSR for return +#ifdef TX_ENABLE_VFP_SUPPORT + LDR r1, [r0, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_interrupt_vfp_restore // No, skip VFP interrupt restore + VLDMIA sp!, {D0-D15} // Recover D0-D15 + VLDMIA sp!, {D16-D31} // Recover D16-D31 + LDR r4, [sp], #4 // Pickup FPSCR + VMSR FPSCR, r4 // Restore FPSCR +_tx_skip_interrupt_vfp_restore: +#endif + LDMIA sp!, {r0-r12, lr, pc}^ // Return to point of thread interrupt + +_tx_solicited_return: + +#ifdef TX_ENABLE_VFP_SUPPORT + LDR r1, [r0, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_solicited_vfp_restore // No, skip VFP solicited restore + VLDMIA sp!, {D8-D15} // Recover D8-D15 + VLDMIA sp!, {D16-D31} // Recover D16-D31 + LDR r4, [sp], #4 // Pickup FPSCR + VMSR FPSCR, r4 // Restore FPSCR +_tx_skip_solicited_vfp_restore: +#endif + MSR CPSR_cxsf, r5 // Recover CPSR + LDMIA sp!, {r4-r11, lr} // Return to thread synchronously +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif + +#ifdef TX_ENABLE_VFP_SUPPORT + + .global tx_thread_vfp_enable + .type tx_thread_vfp_enable,function +tx_thread_vfp_enable: + MRS r2, CPSR // Pickup the CPSR +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Enable IRQ and FIQ interrupts +#else + CPSID i // Enable IRQ interrupts +#endif + LDR r0, =_tx_thread_current_ptr // Build current thread pointer address + LDR r1, [r0] // Pickup current thread pointer + CMP r1, #0 // Check for NULL thread pointer + BEQ __tx_no_thread_to_enable // If NULL, skip VFP enable + MOV r0, #1 // Build enable value + STR r0, [r1, #144] // Set the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) +__tx_no_thread_to_enable: + MSR CPSR_cxsf, r2 // Recover CPSR + BX LR // Return to caller + + .global tx_thread_vfp_disable + .type tx_thread_vfp_disable,function +tx_thread_vfp_disable: + MRS r2, CPSR // Pickup the CPSR +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Enable IRQ and FIQ interrupts +#else + CPSID i // Enable IRQ interrupts +#endif + LDR r0, =_tx_thread_current_ptr // Build current thread pointer address + LDR r1, [r0] // Pickup current thread pointer + CMP r1, #0 // Check for NULL thread pointer + BEQ __tx_no_thread_to_disable // If NULL, skip VFP disable + MOV r0, #0 // Build disable value + STR r0, [r1, #144] // Clear the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) +__tx_no_thread_to_disable: + MSR CPSR_cxsf, r2 // Recover CPSR + BX LR // Return to caller + +#endif diff --git a/ports/cortex_a5/ac6/src/tx_thread_stack_build.S b/ports/cortex_a5/ac6/src/tx_thread_stack_build.S new file mode 100644 index 00000000..f413e673 --- /dev/null +++ b/ports/cortex_a5/ac6/src/tx_thread_stack_build.S @@ -0,0 +1,164 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .arm + +SVC_MODE = 0x13 // SVC mode +#ifdef TX_ENABLE_FIQ_SUPPORT +CPSR_MASK = 0xDF // Mask initial CPSR, IRQ & FIQ interrupts enabled +#else +CPSR_MASK = 0x9F // Mask initial CPSR, IRQ interrupts enabled +#endif + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_stack_build for + applications calling this function from to 16-bit Thumb mode. */ + + .text + .align 2 + .thumb + .global $_tx_thread_stack_build + .type $_tx_thread_stack_build,function +$_tx_thread_stack_build: + BX pc // Switch to 32-bit mode + NOP // + .arm + STMFD sp!, {lr} // Save return address + BL _tx_thread_stack_build // Call _tx_thread_stack_build function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_stack_build ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function builds a stack frame on the supplied thread's stack. */ +/* The stack frame results in a fake interrupt return to the supplied */ +/* function pointer. */ +/* */ +/* INPUT */ +/* */ +/* thread_ptr Pointer to thread control blk */ +/* function_ptr Pointer to return function */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_thread_create Create thread service */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_stack_build + .type _tx_thread_stack_build,function +_tx_thread_stack_build: + + + /* Build a fake interrupt frame. The form of the fake interrupt stack + on the ARMv7-A should look like the following after it is built: + + Stack Top: 1 Interrupt stack frame type + CPSR Initial value for CPSR + a1 (r0) Initial value for a1 + a2 (r1) Initial value for a2 + a3 (r2) Initial value for a3 + a4 (r3) Initial value for a4 + v1 (r4) Initial value for v1 + v2 (r5) Initial value for v2 + v3 (r6) Initial value for v3 + v4 (r7) Initial value for v4 + v5 (r8) Initial value for v5 + sb (r9) Initial value for sb + sl (r10) Initial value for sl + fp (r11) Initial value for fp + ip (r12) Initial value for ip + lr (r14) Initial value for lr + pc (r15) Initial value for + 0 For stack backtracing + + Stack Bottom: (higher memory address) */ + + LDR r2, [r0, #16] // Pickup end of stack area + BIC r2, r2, #7 // Ensure 8-byte alignment + SUB r2, r2, #76 // Allocate space for the stack frame + + /* Actually build the stack frame. */ + + MOV r3, #1 // Build interrupt stack type + STR r3, [r2, #0] // Store stack type + MOV r3, #0 // Build initial register value + STR r3, [r2, #8] // Store initial r0 + STR r3, [r2, #12] // Store initial r1 + STR r3, [r2, #16] // Store initial r2 + STR r3, [r2, #20] // Store initial r3 + STR r3, [r2, #24] // Store initial r4 + STR r3, [r2, #28] // Store initial r5 + STR r3, [r2, #32] // Store initial r6 + STR r3, [r2, #36] // Store initial r7 + STR r3, [r2, #40] // Store initial r8 + STR r3, [r2, #44] // Store initial r9 + LDR r3, [r0, #12] // Pickup stack starting address + STR r3, [r2, #48] // Store initial r10 (sl) + LDR r3,=_tx_thread_schedule // Pickup address of _tx_thread_schedule for GDB backtrace + STR r3, [r2, #60] // Store initial r14 (lr) + MOV r3, #0 // Build initial register value + STR r3, [r2, #52] // Store initial r11 + STR r3, [r2, #56] // Store initial r12 + STR r1, [r2, #64] // Store initial pc + STR r3, [r2, #68] // 0 for back-trace + MRS r1, CPSR // Pickup CPSR + BIC r1, r1, #CPSR_MASK // Mask mode bits of CPSR + ORR r3, r1, #SVC_MODE // Build CPSR, SVC mode, interrupts enabled + STR r3, [r2, #4] // Store initial CPSR + + /* Setup stack pointer. */ + + STR r2, [r0, #8] // Save stack pointer in thread's + // control block +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a5/ac6/src/tx_thread_system_return.S b/ports/cortex_a5/ac6/src/tx_thread_system_return.S new file mode 100644 index 00000000..cb7d62ce --- /dev/null +++ b/ports/cortex_a5/ac6/src/tx_thread_system_return.S @@ -0,0 +1,162 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .arm + + + .global _tx_thread_current_ptr + .global _tx_timer_time_slice + .global _tx_thread_schedule + + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_system_return for + applications calling this function from to 16-bit Thumb mode. */ + + .text + .align 2 + .global $_tx_thread_system_return + .type $_tx_thread_system_return,function +$_tx_thread_system_return: + .thumb + BX pc // Switch to 32-bit mode + NOP // + .arm + STMFD sp!, {lr} // Save return address + BL _tx_thread_system_return // Call _tx_thread_system_return function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_system_return ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is target processor specific. It is used to transfer */ +/* control from a thread back to the ThreadX system. Only a */ +/* minimal context is saved since the compiler assumes temp registers */ +/* are going to get slicked by a function call anyway. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling loop */ +/* */ +/* CALLED BY */ +/* */ +/* ThreadX components */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_system_return + .type _tx_thread_system_return,function +_tx_thread_system_return: + + /* Save minimal context on the stack. */ + + STMDB sp!, {r4-r11, lr} // Save minimal context + + LDR r4, =_tx_thread_current_ptr // Pickup address of current ptr + LDR r5, [r4] // Pickup current thread pointer + +#ifdef TX_ENABLE_VFP_SUPPORT + LDR r1, [r5, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_solicited_vfp_save // No, skip VFP solicited save + VMRS r1, FPSCR // Pickup the FPSCR + STR r1, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D8-D15} // Save D8-D15 +_tx_skip_solicited_vfp_save: +#endif + + MOV r0, #0 // Build a solicited stack type + MRS r1, CPSR // Pickup the CPSR + STMDB sp!, {r0-r1} // Save type and CPSR + + /* Lockout interrupts. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Disable IRQ and FIQ interrupts +#else + CPSID i // Disable IRQ interrupts +#endif + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the thread exit function to indicate the thread is no longer executing. */ + + BL _tx_execution_thread_exit // Call the thread exit function +#endif + MOV r3, r4 // Pickup address of current ptr + MOV r0, r5 // Pickup current thread pointer + LDR r2, =_tx_timer_time_slice // Pickup address of time slice + LDR r1, [r2] // Pickup current time slice + + /* Save current stack and switch to system stack. */ + + STR sp, [r0, #8] // Save thread stack pointer + + /* Determine if the time-slice is active. */ + + MOV r4, #0 // Build clear value + CMP r1, #0 // Is a time-slice active? + BEQ __tx_thread_dont_save_ts // No, don't save the time-slice + + /* Save time-slice for the thread and clear the current time-slice. */ + + STR r4, [r2] // Clear time-slice + STR r1, [r0, #24] // Save current time-slice + +__tx_thread_dont_save_ts: + + /* Clear the current thread pointer. */ + + STR r4, [r3] // Clear current thread pointer + B _tx_thread_schedule // Jump to scheduler! diff --git a/ports/cortex_a5/ac6/src/tx_thread_vectored_context_save.S b/ports/cortex_a5/ac6/src/tx_thread_vectored_context_save.S new file mode 100644 index 00000000..d846223f --- /dev/null +++ b/ports/cortex_a5/ac6/src/tx_thread_vectored_context_save.S @@ -0,0 +1,165 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .global _tx_thread_system_state + .global _tx_thread_current_ptr + .global _tx_execution_isr_enter + + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_vectored_context_save + since it will never be called 16-bit mode. */ + + .arm + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_vectored_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_thread_vectored_context_save + .type _tx_thread_vectored_context_save,function +_tx_thread_vectored_context_save: + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Disable IRQ and FIQ interrupts +#endif + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3, #0] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3, #0] // Store it back in the variable + + /* Note: Minimal context of interrupted thread is already saved. */ + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + MOV pc, lr // Return to caller + +__tx_thread_not_nested_save: + + /* Otherwise, not nested, check to see if a thread was running. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3, #0] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1, #0] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + /* Note: Minimal context of interrupted thread is already saved. */ + + /* Save the current stack pointer in the thread's control block. */ + + MOV r10, #0 // Clear stack limit + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + MOV pc, lr // Return to caller + +__tx_thread_idle_system_save: + + /* Interrupt occurred in the scheduling loop. */ + + /* Not much to do here, just adjust the stack pointer, and return to IRQ + processing. */ + + MOV r10, #0 // Clear stack limit + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + ADD sp, sp, #32 // Recover saved registers + MOV pc, lr // Return to caller diff --git a/ports/cortex_a5/ac6/src/tx_timer_interrupt.S b/ports/cortex_a5/ac6/src/tx_timer_interrupt.S new file mode 100644 index 00000000..7337ed0c --- /dev/null +++ b/ports/cortex_a5/ac6/src/tx_timer_interrupt.S @@ -0,0 +1,231 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Timer */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .arm + + +/* Define Assembly language external references... */ + + .global _tx_timer_time_slice + .global _tx_timer_system_clock + .global _tx_timer_current_ptr + .global _tx_timer_list_start + .global _tx_timer_list_end + .global _tx_timer_expired_time_slice + .global _tx_timer_expired + .global _tx_thread_time_slice + + + +/* Define the 16-bit Thumb mode veneer for _tx_timer_interrupt for + applications calling this function from to 16-bit Thumb mode. */ + + .text + .align 2 + .thumb + .global $_tx_timer_interrupt + .type $_tx_timer_interrupt,function +$_tx_timer_interrupt: + BX pc // Switch to 32-bit mode + NOP // + .arm + STMFD sp!, {lr} // Save return address + BL _tx_timer_interrupt // Call _tx_timer_interrupt function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + + .text + .align 2 +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_timer_interrupt ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function processes the hardware timer interrupt. This */ +/* processing includes incrementing the system clock and checking for */ +/* time slice and/or timer expiration. If either is found, the */ +/* interrupt context save/restore functions are called along with the */ +/* expiration functions. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_time_slice Time slice interrupted thread */ +/* _tx_timer_expiration_process Timer expiration processing */ +/* */ +/* CALLED BY */ +/* */ +/* interrupt vector */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ + .global _tx_timer_interrupt + .type _tx_timer_interrupt,function +_tx_timer_interrupt: + + /* Upon entry to this routine, it is assumed that context save has already + been called, and therefore the compiler scratch registers are available + for use. */ + + /* Increment the system clock. */ + + LDR r1, =_tx_timer_system_clock // Pickup address of system clock + LDR r0, [r1] // Pickup system clock + ADD r0, r0, #1 // Increment system clock + STR r0, [r1] // Store new system clock + + /* Test for time-slice expiration. */ + + LDR r3, =_tx_timer_time_slice // Pickup address of time-slice + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it non-active? + BEQ __tx_timer_no_time_slice // Yes, skip time-slice processing + + /* Decrement the time_slice. */ + + SUB r2, r2, #1 // Decrement the time-slice + STR r2, [r3] // Store new time-slice value + + /* Check for expiration. */ + + CMP r2, #0 // Has it expired? + BNE __tx_timer_no_time_slice // No, skip expiration processing + + /* Set the time-slice expired flag. */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of expired flag + MOV r0, #1 // Build expired value + STR r0, [r3] // Set time-slice expiration flag + +__tx_timer_no_time_slice: + + /* Test for timer expiration. */ + + LDR r1, =_tx_timer_current_ptr // Pickup current timer pointer address + LDR r0, [r1] // Pickup current timer + LDR r2, [r0] // Pickup timer list entry + CMP r2, #0 // Is there anything in the list? + BEQ __tx_timer_no_timer // No, just increment the timer + + /* Set expiration flag. */ + + LDR r3, =_tx_timer_expired // Pickup expiration flag address + MOV r2, #1 // Build expired value + STR r2, [r3] // Set expired flag + B __tx_timer_done // Finished timer processing + +__tx_timer_no_timer: + + /* No timer expired, increment the timer pointer. */ + ADD r0, r0, #4 // Move to next timer + + /* Check for wraparound. */ + + LDR r3, =_tx_timer_list_end // Pickup address of timer list end + LDR r2, [r3] // Pickup list end + CMP r0, r2 // Are we at list end? + BNE __tx_timer_skip_wrap // No, skip wraparound logic + + /* Wrap to beginning of list. */ + + LDR r3, =_tx_timer_list_start // Pickup address of timer list start + LDR r0, [r3] // Set current pointer to list start + +__tx_timer_skip_wrap: + + STR r0, [r1] // Store new current timer pointer + +__tx_timer_done: + + /* See if anything has expired. */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of expired flag + LDR r2, [r3] // Pickup time-slice expired flag + CMP r2, #0 // Did a time-slice expire? + BNE __tx_something_expired // If non-zero, time-slice expired + LDR r1, =_tx_timer_expired // Pickup address of other expired flag + LDR r0, [r1] // Pickup timer expired flag + CMP r0, #0 // Did a timer expire? + BEQ __tx_timer_nothing_expired // No, nothing expired + +__tx_something_expired: + + STMDB sp!, {r0, lr} // Save the lr register on the stack + // and save r0 just to keep 8-byte alignment + + /* Did a timer expire? */ + + LDR r1, =_tx_timer_expired // Pickup address of expired flag + LDR r0, [r1] // Pickup timer expired flag + CMP r0, #0 // Check for timer expiration + BEQ __tx_timer_dont_activate // If not set, skip timer activation + + /* Process timer expiration. */ + BL _tx_timer_expiration_process // Call the timer expiration handling routine + +__tx_timer_dont_activate: + + /* Did time slice expire? */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of time-slice expired + LDR r2, [r3] // Pickup the actual flag + CMP r2, #0 // See if the flag is set + BEQ __tx_timer_not_ts_expiration // No, skip time-slice processing + + /* Time slice interrupted thread. */ + + BL _tx_thread_time_slice // Call time-slice processing + +__tx_timer_not_ts_expiration: + + LDMIA sp!, {r0, lr} // Recover lr register (r0 is just there for + // the 8-byte stack alignment + +__tx_timer_nothing_expired: + +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a5/gnu/example_build/build_threadx_sample.bat b/ports/cortex_a5/gnu/example_build/build_threadx_sample.bat index 123a84c8..54aa192c 100644 --- a/ports/cortex_a5/gnu/example_build/build_threadx_sample.bat +++ b/ports/cortex_a5/gnu/example_build/build_threadx_sample.bat @@ -2,5 +2,5 @@ arm-none-eabi-gcc -c -g -mcpu=cortex-a5 reset.S arm-none-eabi-gcc -c -g -mcpu=cortex-a5 crt0.S arm-none-eabi-gcc -c -g -mcpu=cortex-a5 tx_initialize_low_level.S arm-none-eabi-gcc -c -g -mcpu=cortex-a5 -I../../../../common/inc -I../inc sample_threadx.c -arm-none-eabi-ld -A cortex-a5 -T sample_threadx.ld reset.o crt0.o tx_initialize_low_level.o sample_threadx.o tx.a libc.a libgcc.a -o sample_threadx.out -M > sample_threadx.map +arm-none-eabi-gcc -g -mcpu=cortex-a5 -T sample_threadx.ld --specs=nosys.specs -o sample_threadx.out -Wl,-Map=sample_threadx.map tx_initialize_low_level.o sample_threadx.o tx.a diff --git a/ports/cortex_a5/gnu/example_build/crt0.S b/ports/cortex_a5/gnu/example_build/crt0.S index aa0f3239..56b6c958 100644 --- a/ports/cortex_a5/gnu/example_build/crt0.S +++ b/ports/cortex_a5/gnu/example_build/crt0.S @@ -26,13 +26,13 @@ _mainCRTStartup: mov a2, #0 /* Second arg: fill value */ mov fp, a2 /* Null frame pointer */ mov r7, a2 /* Null frame pointer for Thumb */ - - ldr a1, .LC1 /* First arg: start of memory block */ - ldr a3, .LC2 - sub a3, a3, a1 /* Third arg: length of block */ - - + ldr a1, .LC1 /* First arg: start of memory block */ + ldr a3, .LC2 + sub a3, a3, a1 /* Third arg: length of block */ + + + bl memset mov r0, #0 /* no arguments */ mov r1, #0 /* no argv either */ @@ -48,15 +48,15 @@ _mainCRTStartup: /* bl init */ mov r0, r4 mov r1, r5 -#endif +#endif bl main bl exit /* Should not return. */ - - /* For Thumb, constants must be after the code since only + + /* For Thumb, constants must be after the code since only positive offsets are supported for PC relative addresses. */ - + .align 0 .LC0: .LC1: diff --git a/ports/cortex_a5/gnu/example_build/reset.S b/ports/cortex_a5/gnu/example_build/reset.S index 856e31eb..597e9d9a 100644 --- a/ports/cortex_a5/gnu/example_build/reset.S +++ b/ports/cortex_a5/gnu/example_build/reset.S @@ -1,35 +1,24 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Initialize */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_initialize.h" -@#include "tx_thread.h" -@#include "tx_timer.h" +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Initialize */ +/** */ +/**************************************************************************/ +/**************************************************************************/ .arm @@ -41,36 +30,35 @@ .global __tx_reserved_handler .global __tx_irq_handler .global __tx_fiq_handler -@ -@ -@/* Define the vector area. This should be located or copied to 0. */ -@ + +/* Define the vector area. This should be located or copied to 0. */ + .text .global __vectors __vectors: - LDR pc, STARTUP @ Reset goes to startup function - LDR pc, UNDEFINED @ Undefined handler - LDR pc, SWI @ Software interrupt handler - LDR pc, PREFETCH @ Prefetch exception handler - LDR pc, ABORT @ Abort exception handler - LDR pc, RESERVED @ Reserved exception handler - LDR pc, IRQ @ IRQ interrupt handler - LDR pc, FIQ @ FIQ interrupt handler + LDR pc, STARTUP // Reset goes to startup function + LDR pc, UNDEFINED // Undefined handler + LDR pc, SWI // Software interrupt handler + LDR pc, PREFETCH // Prefetch exception handler + LDR pc, ABORT // Abort exception handler + LDR pc, RESERVED // Reserved exception handler + LDR pc, IRQ // IRQ interrupt handler + LDR pc, FIQ // FIQ interrupt handler STARTUP: - .word _start @ Reset goes to C startup function + .word _start // Reset goes to C startup function UNDEFINED: - .word __tx_undefined @ Undefined handler + .word __tx_undefined // Undefined handler SWI: - .word __tx_swi_interrupt @ Software interrupt handler + .word __tx_swi_interrupt // Software interrupt handler PREFETCH: - .word __tx_prefetch_handler @ Prefetch exception handler -ABORT: - .word __tx_abort_handler @ Abort exception handler -RESERVED: - .word __tx_reserved_handler @ Reserved exception handler -IRQ: - .word __tx_irq_handler @ IRQ interrupt handler + .word __tx_prefetch_handler // Prefetch exception handler +ABORT: + .word __tx_abort_handler // Abort exception handler +RESERVED: + .word __tx_reserved_handler // Reserved exception handler +IRQ: + .word __tx_irq_handler // IRQ interrupt handler FIQ: - .word __tx_fiq_handler @ FIQ interrupt handler + .word __tx_fiq_handler // FIQ interrupt handler diff --git a/ports/cortex_a5/gnu/example_build/sample_threadx.c b/ports/cortex_a5/gnu/example_build/sample_threadx.c index 418ec634..8c61de06 100644 --- a/ports/cortex_a5/gnu/example_build/sample_threadx.c +++ b/ports/cortex_a5/gnu/example_build/sample_threadx.c @@ -1,5 +1,5 @@ /* This is a small demo of the high-performance ThreadX kernel. It includes examples of eight - threads of different priorities, using a message queue, semaphore, mutex, event flags group, + threads of different priorities, using a message queue, semaphore, mutex, event flags group, byte pool, and block pool. */ #include "tx_api.h" @@ -80,42 +80,42 @@ CHAR *pointer = TX_NULL; tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); /* Create the main thread. */ - tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, 1, 1, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 1. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - /* Create threads 1 and 2. These threads pass information through a ThreadX + /* Create threads 1 and 2. These threads pass information through a ThreadX message queue. It is also interesting to note that these threads have a time slice. */ - tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, DEMO_STACK_SIZE, 16, 16, 4, TX_AUTO_START); /* Allocate the stack for thread 2. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, DEMO_STACK_SIZE, 16, 16, 4, TX_AUTO_START); /* Allocate the stack for thread 3. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - /* Create threads 3 and 4. These threads compete for a ThreadX counting semaphore. + /* Create threads 3 and 4. These threads compete for a ThreadX counting semaphore. An interesting thing here is that both threads share the same instruction area. */ - tx_thread_create(&thread_3, "thread 3", thread_3_and_4_entry, 3, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_3, "thread 3", thread_3_and_4_entry, 3, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 4. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - tx_thread_create(&thread_4, "thread 4", thread_3_and_4_entry, 4, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_4, "thread 4", thread_3_and_4_entry, 4, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 5. */ @@ -123,23 +123,23 @@ CHAR *pointer = TX_NULL; /* Create thread 5. This thread simply pends on an event flag which will be set by thread_0. */ - tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, + pointer, DEMO_STACK_SIZE, 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 6. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); /* Create threads 6 and 7. These threads compete for a ThreadX mutex. */ - tx_thread_create(&thread_6, "thread 6", thread_6_and_7_entry, 6, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_6, "thread 6", thread_6_and_7_entry, 6, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 7. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - tx_thread_create(&thread_7, "thread 7", thread_6_and_7_entry, 7, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_7, "thread 7", thread_6_and_7_entry, 7, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the message queue. */ @@ -242,11 +242,11 @@ UINT status; /* Retrieve a message from the queue. */ status = tx_queue_receive(&queue_0, &received_message, TX_WAIT_FOREVER); - /* Check completion status and make sure the message is what we + /* Check completion status and make sure the message is what we expected. */ if ((status != TX_SUCCESS) || (received_message != thread_2_messages_received)) break; - + /* Otherwise, all is okay. Increment the received message count. */ thread_2_messages_received++; } @@ -305,7 +305,7 @@ ULONG actual_flags; thread_5_counter++; /* Wait for event flag 0. */ - status = tx_event_flags_get(&event_flags_0, 0x1, TX_OR_CLEAR, + status = tx_event_flags_get(&event_flags_0, 0x1, TX_OR_CLEAR, &actual_flags, TX_WAIT_FOREVER); /* Check status. */ @@ -358,7 +358,7 @@ UINT status; if (status != TX_SUCCESS) break; - /* Release the mutex again. This will actually + /* Release the mutex again. This will actually release ownership since it was obtained twice. */ status = tx_mutex_put(&mutex_0); diff --git a/ports/cortex_a5/gnu/example_build/tx_initialize_low_level.S b/ports/cortex_a5/gnu/example_build/tx_initialize_low_level.S index 1e7b0abb..7de5d3ce 100644 --- a/ports/cortex_a5/gnu/example_build/tx_initialize_low_level.S +++ b/ports/cortex_a5/gnu/example_build/tx_initialize_low_level.S @@ -1,47 +1,35 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Initialize */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_initialize.h" -@#include "tx_thread.h" -@#include "tx_timer.h" +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Initialize */ +/** */ +/**************************************************************************/ +/**************************************************************************/ .arm -SVC_MODE = 0xD3 @ Disable IRQ/FIQ SVC mode -IRQ_MODE = 0xD2 @ Disable IRQ/FIQ IRQ mode -FIQ_MODE = 0xD1 @ Disable IRQ/FIQ FIQ mode -SYS_MODE = 0xDF @ Disable IRQ/FIQ SYS mode -FIQ_STACK_SIZE = 512 @ FIQ stack size -IRQ_STACK_SIZE = 1024 @ IRQ stack size -SYS_STACK_SIZE = 1024 @ System stack size -@ -@ +SVC_MODE = 0xD3 // Disable IRQ/FIQ SVC mode +IRQ_MODE = 0xD2 // Disable IRQ/FIQ IRQ mode +FIQ_MODE = 0xD1 // Disable IRQ/FIQ FIQ mode +SYS_MODE = 0xDF // Disable IRQ/FIQ SYS mode +FIQ_STACK_SIZE = 512 // FIQ stack size +IRQ_STACK_SIZE = 1024 // IRQ stack size +SYS_STACK_SIZE = 1024 // System stack size + .global _tx_thread_system_stack_ptr .global _tx_initialize_unused_memory .global _tx_thread_context_save @@ -51,297 +39,267 @@ SYS_STACK_SIZE = 1024 @ System stack size .global _sp .global _stack_bottom -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_initialize_low_level for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + +/* Define the 16-bit Thumb mode veneer for _tx_initialize_low_level for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .thumb .global $_tx_initialize_low_level .type $_tx_initialize_low_level,function $_tx_initialize_low_level: - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_initialize_low_level @ Call _tx_initialize_low_level function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_initialize_low_level // Call _tx_initialize_low_level function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_initialize_low_level Cortex-A5/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is responsible for any low-level processor */ -@/* initialization, including setting up interrupt vectors, setting */ -@/* up a periodic timer interrupt source, saving the system stack */ -@/* pointer for use in ISR processing later, and finding the first */ -@/* available RAM memory address for tx_application_define. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* _tx_initialize_kernel_enter ThreadX entry function */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_initialize_low_level(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_initialize_low_level ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for any low-level processor */ +/* initialization, including setting up interrupt vectors, setting */ +/* up a periodic timer interrupt source, saving the system stack */ +/* pointer for use in ISR processing later, and finding the first */ +/* available RAM memory address for tx_application_define. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_initialize_kernel_enter ThreadX entry function */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_initialize_low_level .type _tx_initialize_low_level,function _tx_initialize_low_level: -@ -@ /* We must be in SVC mode at this point! */ -@ -@ /* Setup various stack pointers. */ -@ - LDR r1, =_sp @ Get pointer to stack area -#ifdef TX_ENABLE_IRQ_NESTING -@ -@ /* Setup the system mode stack for nested interrupt support */ -@ - LDR r2, =SYS_STACK_SIZE @ Pickup stack size - MOV r3, #SYS_MODE @ Build SYS mode CPSR - MSR CPSR_c, r3 @ Enter SYS mode - SUB r1, r1, #1 @ Backup 1 byte - BIC r1, r1, #7 @ Ensure 8-byte alignment - MOV sp, r1 @ Setup SYS stack pointer - SUB r1, r1, r2 @ Calculate start of next stack + /* We must be in SVC mode at this point! */ + + /* Setup various stack pointers. */ + + LDR r1, =_sp // Get pointer to stack area + +#ifdef TX_ENABLE_IRQ_NESTING + + /* Setup the system mode stack for nested interrupt support */ + + LDR r2, =SYS_STACK_SIZE // Pickup stack size + MOV r3, #SYS_MODE // Build SYS mode CPSR + MSR CPSR_c, r3 // Enter SYS mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup SYS stack pointer + SUB r1, r1, r2 // Calculate start of next stack #endif - LDR r2, =FIQ_STACK_SIZE @ Pickup stack size - MOV r0, #FIQ_MODE @ Build FIQ mode CPSR - MSR CPSR, r0 @ Enter FIQ mode - SUB r1, r1, #1 @ Backup 1 byte - BIC r1, r1, #7 @ Ensure 8-byte alignment - MOV sp, r1 @ Setup FIQ stack pointer - SUB r1, r1, r2 @ Calculate start of next stack - LDR r2, =IRQ_STACK_SIZE @ Pickup IRQ stack size - MOV r0, #IRQ_MODE @ Build IRQ mode CPSR - MSR CPSR, r0 @ Enter IRQ mode - SUB r1, r1, #1 @ Backup 1 byte - BIC r1, r1, #7 @ Ensure 8-byte alignment - MOV sp, r1 @ Setup IRQ stack pointer - SUB r3, r1, r2 @ Calculate end of IRQ stack - MOV r0, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR, r0 @ Enter SVC mode - LDR r2, =_stack_bottom @ Pickup stack bottom - CMP r3, r2 @ Compare the current stack end with the bottom -_stack_error_loop: - BLT _stack_error_loop @ If the IRQ stack exceeds the stack bottom, just sit here! -@ -@ /* Save the system stack pointer. */ -@ _tx_thread_system_stack_ptr = (VOID_PTR) (sp); -@ - LDR r2, =_tx_thread_system_stack_ptr @ Pickup stack pointer - STR r1, [r2] @ Save the system stack -@ -@ /* Save the first available memory address. */ -@ _tx_initialize_unused_memory = (VOID_PTR) _end; -@ - LDR r1, =_end @ Get end of non-initialized RAM area - LDR r2, =_tx_initialize_unused_memory @ Pickup unused memory ptr address - ADD r1, r1, #8 @ Increment to next free word - STR r1, [r2] @ Save first free memory address -@ -@ /* Setup Timer for periodic interrupts. */ -@ -@ /* Done, return to caller. */ -@ + LDR r2, =FIQ_STACK_SIZE // Pickup stack size + MOV r0, #FIQ_MODE // Build FIQ mode CPSR + MSR CPSR, r0 // Enter FIQ mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup FIQ stack pointer + SUB r1, r1, r2 // Calculate start of next stack + LDR r2, =IRQ_STACK_SIZE // Pickup IRQ stack size + MOV r0, #IRQ_MODE // Build IRQ mode CPSR + MSR CPSR, r0 // Enter IRQ mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup IRQ stack pointer + SUB r3, r1, r2 // Calculate end of IRQ stack + MOV r0, #SVC_MODE // Build SVC mode CPSR + MSR CPSR, r0 // Enter SVC mode + LDR r2, =_stack_bottom // Pickup stack bottom + CMP r3, r2 // Compare the current stack end with the bottom +_stack_error_loop: + BLT _stack_error_loop // If the IRQ stack exceeds the stack bottom, just sit here! + + LDR r2, =_tx_thread_system_stack_ptr // Pickup stack pointer + STR r1, [r2] // Save the system stack + + LDR r1, =_end // Get end of non-initialized RAM area + LDR r2, =_tx_initialize_unused_memory // Pickup unused memory ptr address + ADD r1, r1, #8 // Increment to next free word + STR r1, [r2] // Save first free memory address + #ifdef __THUMB_INTERWORK - BX lr @ Return to caller + BX lr // Return to caller #else - MOV pc, lr @ Return to caller + MOV pc, lr // Return to caller #endif -@} -@ -@ -@/* Define shells for each of the interrupt vectors. */ -@ + +/* Define shells for each of the interrupt vectors. */ + .global __tx_undefined __tx_undefined: - B __tx_undefined @ Undefined handler -@ + B __tx_undefined // Undefined handler + .global __tx_swi_interrupt __tx_swi_interrupt: - B __tx_swi_interrupt @ Software interrupt handler -@ + B __tx_swi_interrupt // Software interrupt handler + .global __tx_prefetch_handler __tx_prefetch_handler: - B __tx_prefetch_handler @ Prefetch exception handler -@ + B __tx_prefetch_handler // Prefetch exception handler + .global __tx_abort_handler __tx_abort_handler: - B __tx_abort_handler @ Abort exception handler -@ + B __tx_abort_handler // Abort exception handler + .global __tx_reserved_handler __tx_reserved_handler: - B __tx_reserved_handler @ Reserved exception handler -@ + B __tx_reserved_handler // Reserved exception handler + .global __tx_irq_handler - .global __tx_irq_processing_return + .global __tx_irq_processing_return __tx_irq_handler: -@ -@ /* Jump to context save to save system context. */ + + /* Jump to context save to save system context. */ B _tx_thread_context_save __tx_irq_processing_return: -@ -@ /* At this point execution is still in the IRQ mode. The CPSR, point of -@ interrupt, and all C scratch registers are available for use. In -@ addition, IRQ interrupts may be re-enabled - with certain restrictions - -@ if nested IRQ interrupts are desired. Interrupts may be re-enabled over -@ small code sequences where lr is saved before enabling interrupts and -@ restored after interrupts are again disabled. */ -@ -@ /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start -@ from IRQ mode with interrupts disabled. This routine switches to the -@ system mode and returns with IRQ interrupts enabled. -@ -@ NOTE: It is very important to ensure all IRQ interrupts are cleared -@ prior to enabling nested IRQ interrupts. */ +// + /* At this point execution is still in the IRQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. In + addition, IRQ interrupts may be re-enabled - with certain restrictions - + if nested IRQ interrupts are desired. Interrupts may be re-enabled over + small code sequences where lr is saved before enabling interrupts and + restored after interrupts are again disabled. */ + + /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start + from IRQ mode with interrupts disabled. This routine switches to the + system mode and returns with IRQ interrupts enabled. + + NOTE: It is very important to ensure all IRQ interrupts are cleared + prior to enabling nested IRQ interrupts. */ #ifdef TX_ENABLE_IRQ_NESTING BL _tx_thread_irq_nesting_start #endif -@ -@ /* For debug purpose, execute the timer interrupt processing here. In -@ a real system, some kind of status indication would have to be checked -@ before the timer interrupt handler could be called. */ -@ - BL _tx_timer_interrupt @ Timer interrupt handler -@ -@ -@ /* If interrupt nesting was started earlier, the end of interrupt nesting -@ service must be called before returning to _tx_thread_context_restore. -@ This routine returns in processing in IRQ mode with interrupts disabled. */ + + /* For debug purpose, execute the timer interrupt processing here. In + a real system, some kind of status indication would have to be checked + before the timer interrupt handler could be called. */ + + BL _tx_timer_interrupt // Timer interrupt handler + + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_context_restore. + This routine returns in processing in IRQ mode with interrupts disabled. */ #ifdef TX_ENABLE_IRQ_NESTING BL _tx_thread_irq_nesting_end #endif -@ -@ /* Jump to context restore to restore system context. */ + + /* Jump to context restore to restore system context. */ B _tx_thread_context_restore -@ -@ -@ /* This is an example of a vectored IRQ handler. */ -@ -@ .global __tx_example_vectored_irq_handler -@__tx_example_vectored_irq_handler: -@ -@ -@ /* Save initial context and call context save to prepare for -@ vectored ISR execution. */ -@ -@ STMDB sp!, {r0-r3} @ Save some scratch registers -@ MRS r0, SPSR @ Pickup saved SPSR -@ SUB lr, lr, #4 @ Adjust point of interrupt -@ STMDB sp!, {r0, r10, r12, lr} @ Store other scratch registers -@ BL _tx_thread_vectored_context_save @ Vectored context save -@ -@ /* At this point execution is still in the IRQ mode. The CPSR, point of -@ interrupt, and all C scratch registers are available for use. In -@ addition, IRQ interrupts may be re-enabled - with certain restrictions - -@ if nested IRQ interrupts are desired. Interrupts may be re-enabled over -@ small code sequences where lr is saved before enabling interrupts and -@ restored after interrupts are again disabled. */ -@ -@ -@ /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start -@ from IRQ mode with interrupts disabled. This routine switches to the -@ system mode and returns with IRQ interrupts enabled. -@ -@ NOTE: It is very important to ensure all IRQ interrupts are cleared -@ prior to enabling nested IRQ interrupts. */ -@#ifdef TX_ENABLE_IRQ_NESTING -@ BL _tx_thread_irq_nesting_start -@#endif -@ -@ /* Application IRQ handlers can be called here! */ -@ -@ /* If interrupt nesting was started earlier, the end of interrupt nesting -@ service must be called before returning to _tx_thread_context_restore. -@ This routine returns in processing in IRQ mode with interrupts disabled. */ -@#ifdef TX_ENABLE_IRQ_NESTING -@ BL _tx_thread_irq_nesting_end -@#endif -@ -@ /* Jump to context restore to restore system context. */ -@ B _tx_thread_context_restore -@ -@ + + + /* This is an example of a vectored IRQ handler. */ + + + + /* Save initial context and call context save to prepare for + vectored ISR execution. */ + + /* At this point execution is still in the IRQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. In + addition, IRQ interrupts may be re-enabled - with certain restrictions - + if nested IRQ interrupts are desired. Interrupts may be re-enabled over + small code sequences where lr is saved before enabling interrupts and + restored after interrupts are again disabled. */ + + + /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start + from IRQ mode with interrupts disabled. This routine switches to the + system mode and returns with IRQ interrupts enabled. + + NOTE: It is very important to ensure all IRQ interrupts are cleared + prior to enabling nested IRQ interrupts. */ + + /* Application IRQ handlers can be called here! */ + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_context_restore. + This routine returns in processing in IRQ mode with interrupts disabled. */ + + + #ifdef TX_ENABLE_FIQ_SUPPORT .global __tx_fiq_handler .global __tx_fiq_processing_return __tx_fiq_handler: -@ -@ /* Jump to fiq context save to save system context. */ + + /* Jump to fiq context save to save system context. */ B _tx_thread_fiq_context_save __tx_fiq_processing_return: -@ -@ /* At this point execution is still in the FIQ mode. The CPSR, point of -@ interrupt, and all C scratch registers are available for use. */ -@ -@ /* Interrupt nesting is allowed after calling _tx_thread_fiq_nesting_start -@ from FIQ mode with interrupts disabled. This routine switches to the -@ system mode and returns with FIQ interrupts enabled. -@ -@ NOTE: It is very important to ensure all FIQ interrupts are cleared -@ prior to enabling nested FIQ interrupts. */ + + /* At this point execution is still in the FIQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. */ + + /* Interrupt nesting is allowed after calling _tx_thread_fiq_nesting_start + from FIQ mode with interrupts disabled. This routine switches to the + system mode and returns with FIQ interrupts enabled. + + NOTE: It is very important to ensure all FIQ interrupts are cleared + prior to enabling nested FIQ interrupts. */ #ifdef TX_ENABLE_FIQ_NESTING BL _tx_thread_fiq_nesting_start #endif -@ -@ /* Application FIQ handlers can be called here! */ -@ -@ /* If interrupt nesting was started earlier, the end of interrupt nesting -@ service must be called before returning to _tx_thread_fiq_context_restore. */ + + /* Application FIQ handlers can be called here! */ + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_fiq_context_restore. */ #ifdef TX_ENABLE_FIQ_NESTING BL _tx_thread_fiq_nesting_end #endif -@ -@ /* Jump to fiq context restore to restore system context. */ + + /* Jump to fiq context restore to restore system context. */ B _tx_thread_fiq_context_restore -@ -@ + + #else .global __tx_fiq_handler __tx_fiq_handler: - B __tx_fiq_handler @ FIQ interrupt handler + B __tx_fiq_handler // FIQ interrupt handler #endif -@ -@ + + BUILD_OPTIONS: - .word _tx_build_options @ Reference to bring in + .word _tx_build_options // Reference to bring in VERSION_ID: - .word _tx_version_id @ Reference to bring in + .word _tx_version_id // Reference to bring in diff --git a/ports/cortex_a5/gnu/inc/tx_port.h b/ports/cortex_a5/gnu/inc/tx_port.h index b810f807..19463de1 100644 --- a/ports/cortex_a5/gnu/inc/tx_port.h +++ b/ports/cortex_a5/gnu/inc/tx_port.h @@ -12,7 +12,7 @@ /**************************************************************************/ /**************************************************************************/ -/** */ +/** */ /** ThreadX Component */ /** */ /** Port Specific */ @@ -21,36 +21,38 @@ /**************************************************************************/ -/**************************************************************************/ -/* */ -/* PORT SPECIFIC C INFORMATION RELEASE */ -/* */ -/* tx_port.h Cortex-A5/GNU */ -/* 6.1.6 */ +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* tx_port.h ARMv7-A */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ /* */ /* DESCRIPTION */ -/* */ -/* This file contains data type definitions that make the ThreadX */ -/* real-time kernel function identically on a variety of different */ -/* processor architectures. For example, the size or number of bits */ -/* in an "int" data type vary between microprocessor architectures and */ -/* even C compilers for the same microprocessor. ThreadX does not */ -/* directly use native C data types. Instead, ThreadX creates its */ -/* own special types that can be mapped to actual data types by this */ -/* file to guarantee consistency in the interface and functionality. */ -/* */ -/* RELEASE HISTORY */ -/* */ +/* */ +/* This file contains data type definitions that make the ThreadX */ +/* real-time kernel function identically on a variety of different */ +/* processor architectures. For example, the size or number of bits */ +/* in an "int" data type vary between microprocessor architectures and */ +/* even C compilers for the same microprocessor. ThreadX does not */ +/* directly use native C data types. Instead, ThreadX creates its */ +/* own special types that can be mapped to actual data types by this */ +/* file to guarantee consistency in the interface and functionality. */ +/* */ +/* RELEASE HISTORY */ +/* */ /* DATE NAME DESCRIPTION */ /* */ /* 09-30-2020 William E. Lamie Initial Version 6.1 */ /* 04-02-2021 Bhupendra Naphade Modified comment(s),updated */ /* macro definition, */ /* resulting in version 6.1.6 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -63,7 +65,7 @@ #ifdef TX_INCLUDE_USER_DEFINE_FILE -/* Yes, include the user defines in tx_user.h. The defines in this file may +/* Yes, include the user defines in tx_user.h. The defines in this file may alternately be defined on the command line. */ #include "tx_user.h" @@ -76,7 +78,7 @@ #include -/* Define ThreadX basic types for this port. */ +/* Define ThreadX basic types for this port. */ #define VOID void typedef char CHAR; @@ -112,12 +114,12 @@ typedef unsigned short USHORT; #define TX_TIMER_THREAD_STACK_SIZE 1024 /* Default timer thread stack size */ #endif -#ifndef TX_TIMER_THREAD_PRIORITY -#define TX_TIMER_THREAD_PRIORITY 0 /* Default timer thread priority */ +#ifndef TX_TIMER_THREAD_PRIORITY +#define TX_TIMER_THREAD_PRIORITY 0 /* Default timer thread priority */ #endif -/* Define various constants for the ThreadX ARM port. */ +/* Define various constants for the ThreadX ARM port. */ #ifdef TX_ENABLE_FIQ_SUPPORT #define TX_INT_DISABLE 0xC0 /* Disable IRQ & FIQ interrupts */ @@ -127,8 +129,8 @@ typedef unsigned short USHORT; #define TX_INT_ENABLE 0x00 /* Enable IRQ interrupts */ -/* Define the clock source for trace event entry time stamp. The following two item are port specific. - For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock +/* Define the clock source for trace event entry time stamp. The following two item are port specific. + For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: #define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) @@ -175,7 +177,7 @@ typedef unsigned short USHORT; #define TX_INLINE_INITIALIZATION -/* Determine whether or not stack checking is enabled. By default, ThreadX stack checking is +/* Determine whether or not stack checking is enabled. By default, ThreadX stack checking is disabled. When the following is defined, ThreadX thread stack checking is enabled. If stack checking is enabled (TX_ENABLE_STACK_CHECKING is defined), the TX_DISABLE_STACK_FILLING define is negated, thereby forcing the stack fill which is necessary for the stack checking @@ -187,13 +189,13 @@ typedef unsigned short USHORT; /* Define the TX_THREAD control block extensions for this port. The main reason - for the multiple macros is so that backward compatibility can be maintained with + for the multiple macros is so that backward compatibility can be maintained with existing ThreadX kernel awareness modules. */ -#define TX_THREAD_EXTENSION_0 -#define TX_THREAD_EXTENSION_1 +#define TX_THREAD_EXTENSION_0 +#define TX_THREAD_EXTENSION_1 #define TX_THREAD_EXTENSION_2 ULONG tx_thread_vfp_enable; -#define TX_THREAD_EXTENSION_3 +#define TX_THREAD_EXTENSION_3 /* Define the port extensions of the remaining ThreadX objects. */ @@ -207,11 +209,11 @@ typedef unsigned short USHORT; #define TX_TIMER_EXTENSION -/* Define the user extension field of the thread control block. Nothing +/* Define the user extension field of the thread control block. Nothing additional is needed for this port so it is defined as white space. */ #ifndef TX_THREAD_USER_EXTENSION -#define TX_THREAD_USER_EXTENSION +#define TX_THREAD_USER_EXTENSION #endif @@ -219,8 +221,8 @@ typedef unsigned short USHORT; tx_thread_shell_entry, and tx_thread_terminate. */ -#define TX_THREAD_CREATE_EXTENSION(thread_ptr) -#define TX_THREAD_DELETE_EXTENSION(thread_ptr) +#define TX_THREAD_CREATE_EXTENSION(thread_ptr) +#define TX_THREAD_DELETE_EXTENSION(thread_ptr) #define TX_THREAD_COMPLETED_EXTENSION(thread_ptr) #define TX_THREAD_TERMINATED_EXTENSION(thread_ptr) @@ -247,24 +249,24 @@ typedef unsigned short USHORT; #define TX_TIMER_DELETE_EXTENSION(timer_ptr) -/* Determine if the ARM architecture has the CLZ instruction. This is available on - architectures v5 and above. If available, redefine the macro for calculating the +/* Determine if the ARM architecture has the CLZ instruction. This is available on + architectures v5 and above. If available, redefine the macro for calculating the lowest bit set. */ - + #if __TARGET_ARCH_ARM > 4 #ifndef __thumb__ #define TX_LOWEST_SET_BIT_CALCULATE(m, b) m = m & ((ULONG) (-((LONG) m))); \ asm volatile (" CLZ %0,%1 ": "=r" (b) : "r" (m) ); \ - b = 31 - b; + b = 31 - b; #endif #endif -/* Define ThreadX interrupt lockout and restore macros for protection on - access of critical kernel information. The restore interrupt macro must - restore the interrupt posture of the running thread prior to the value +/* Define ThreadX interrupt lockout and restore macros for protection on + access of critical kernel information. The restore interrupt macro must + restore the interrupt posture of the running thread prior to the value present prior to the disable macro. In most cases, the save area macro is used to define a local function save area for the disable and restore macros. */ @@ -295,7 +297,7 @@ unsigned int _tx_thread_interrupt_restore(UINT old_posture); #endif -/* Define VFP extension for the Cortex-A5. Each is assumed to be called in the context of the executing +/* Define VFP extension for the ARMv7-A. Each is assumed to be called in the context of the executing thread. */ void tx_thread_vfp_enable(void); @@ -315,8 +317,8 @@ void tx_thread_vfp_disable(void); /* Define the version ID of ThreadX. This may be utilized by the application. */ #ifdef TX_THREAD_INIT -CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-A5/GNU Version 6.1.9 *"; +CHAR _tx_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX ARMv7-A Version 6.1.11 *"; #else extern CHAR _tx_version_id[]; #endif diff --git a/ports/cortex_a5/gnu/src/tx_thread_context_restore.S b/ports/cortex_a5/gnu/src/tx_thread_context_restore.S index 21887189..fae7e72d 100644 --- a/ports/cortex_a5/gnu/src/tx_thread_context_restore.S +++ b/ports/cortex_a5/gnu/src/tx_thread_context_restore.S @@ -1,260 +1,222 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .arm #ifdef TX_ENABLE_FIQ_SUPPORT -SVC_MODE = 0xD3 @ Disable IRQ/FIQ, SVC mode -IRQ_MODE = 0xD2 @ Disable IRQ/FIQ, IRQ mode +SVC_MODE = 0xD3 // Disable IRQ/FIQ, SVC mode +IRQ_MODE = 0xD2 // Disable IRQ/FIQ, IRQ mode #else -SVC_MODE = 0x93 @ Disable IRQ, SVC mode -IRQ_MODE = 0x92 @ Disable IRQ, IRQ mode +SVC_MODE = 0x93 // Disable IRQ, SVC mode +IRQ_MODE = 0x92 // Disable IRQ, IRQ mode #endif -@ + .global _tx_thread_system_state .global _tx_thread_current_ptr .global _tx_thread_execute_ptr .global _tx_timer_time_slice .global _tx_thread_schedule .global _tx_thread_preempt_disable - .global _tx_execution_isr_exit -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_restore -@ since it will never be called 16-bit mode. */ -@ + + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_restore + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_context_restore Cortex-A5/GNU */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function restores the interrupt context if it is processing a */ -@/* nested interrupt. If not, it returns to the interrupt thread if no */ -@/* preemption is necessary. Otherwise, if preemption is necessary or */ -@/* if no thread was running, the function returns to the scheduler. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* _tx_thread_schedule Thread scheduling routine */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs Interrupt Service Routines */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_context_restore(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_context_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function restores the interrupt context if it is processing a */ +/* nested interrupt. If not, it returns to the interrupt thread if no */ +/* preemption is necessary. Otherwise, if preemption is necessary or */ +/* if no thread was running, the function returns to the scheduler. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling routine */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs Interrupt Service Routines */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_context_restore .type _tx_thread_context_restore,function _tx_thread_context_restore: -@ -@ /* Lockout interrupts. */ -@ + + /* Lockout interrupts. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ interrupts + CPSID if // Disable IRQ and FIQ interrupts #else - CPSID i @ Disable IRQ interrupts + CPSID i // Disable IRQ interrupts #endif #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR exit function to indicate an ISR is complete. */ -@ - BL _tx_execution_isr_exit @ Call the ISR exit function -#endif -@ -@ /* Determine if interrupts are nested. */ -@ if (--_tx_thread_system_state) -@ { -@ - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3] @ Pickup system state - SUB r2, r2, #1 @ Decrement the counter - STR r2, [r3] @ Store the counter - CMP r2, #0 @ Was this the first interrupt? - BEQ __tx_thread_not_nested_restore @ If so, not a nested restore -@ -@ /* Interrupts are nested. */ -@ -@ /* Just recover the saved registers and return to the point of -@ interrupt. */ -@ - LDMIA sp!, {r0, r10, r12, lr} @ Recover SPSR, POI, and scratch regs - MSR SPSR_cxsf, r0 @ Put SPSR back - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOVS pc, lr @ Return to point of interrupt -@ -@ } -__tx_thread_not_nested_restore: -@ -@ /* Determine if a thread was interrupted and no preemption is required. */ -@ else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr) -@ || (_tx_thread_preempt_disable)) -@ { -@ - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup actual current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_idle_system_restore @ Yes, idle system was interrupted -@ - LDR r3, =_tx_thread_preempt_disable @ Pickup preempt disable address - LDR r2, [r3] @ Pickup actual preempt disable flag - CMP r2, #0 @ Is it set? - BNE __tx_thread_no_preempt_restore @ Yes, don't preempt this thread - LDR r3, =_tx_thread_execute_ptr @ Pickup address of execute thread ptr - LDR r2, [r3] @ Pickup actual execute thread pointer - CMP r0, r2 @ Is the same thread highest priority? - BNE __tx_thread_preempt_restore @ No, preemption needs to happen -@ -@ -__tx_thread_no_preempt_restore: -@ -@ /* Restore interrupted thread or ISR. */ -@ -@ /* Pickup the saved stack pointer. */ -@ tmp_ptr = _tx_thread_current_ptr -> tx_thread_stack_ptr; -@ -@ /* Recover the saved context and return to the point of interrupt. */ -@ - LDMIA sp!, {r0, r10, r12, lr} @ Recover SPSR, POI, and scratch regs - MSR SPSR_cxsf, r0 @ Put SPSR back - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOVS pc, lr @ Return to point of interrupt -@ -@ } -@ else -@ { -__tx_thread_preempt_restore: -@ - LDMIA sp!, {r3, r10, r12, lr} @ Recover temporarily saved registers - MOV r1, lr @ Save lr (point of interrupt) - MOV r2, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r2 @ Enter SVC mode - STR r1, [sp, #-4]! @ Save point of interrupt - STMDB sp!, {r4-r12, lr} @ Save upper half of registers - MOV r4, r3 @ Save SPSR in r4 - MOV r2, #IRQ_MODE @ Build IRQ mode CPSR - MSR CPSR_c, r2 @ Enter IRQ mode - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOV r5, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r5 @ Enter SVC mode - STMDB sp!, {r0-r3} @ Save r0-r3 on thread's stack - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup current thread pointer + /* Call the ISR exit function to indicate an ISR is complete. */ + + BL _tx_execution_isr_exit // Call the ISR exit function +#endif + + /* Determine if interrupts are nested. */ + + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + SUB r2, r2, #1 // Decrement the counter + STR r2, [r3] // Store the counter + CMP r2, #0 // Was this the first interrupt? + BEQ __tx_thread_not_nested_restore // If so, not a nested restore + + /* Interrupts are nested. */ + + /* Just recover the saved registers and return to the point of + interrupt. */ + + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_not_nested_restore: + + /* Determine if a thread was interrupted and no preemption is required. */ + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup actual current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_restore // Yes, idle system was interrupted + + LDR r3, =_tx_thread_preempt_disable // Pickup preempt disable address + LDR r2, [r3] // Pickup actual preempt disable flag + CMP r2, #0 // Is it set? + BNE __tx_thread_no_preempt_restore // Yes, don't preempt this thread + LDR r3, =_tx_thread_execute_ptr // Pickup address of execute thread ptr + LDR r2, [r3] // Pickup actual execute thread pointer + CMP r0, r2 // Is the same thread highest priority? + BNE __tx_thread_preempt_restore // No, preemption needs to happen + + +__tx_thread_no_preempt_restore: + + /* Recover the saved context and return to the point of interrupt. */ + + /* Pickup the saved stack pointer. */ + + /* Recover the saved context and return to the point of interrupt. */ + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_preempt_restore: + + LDMIA sp!, {r3, r10, r12, lr} // Recover temporarily saved registers + MOV r1, lr // Save lr (point of interrupt) + MOV r2, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r2 // Enter SVC mode + STR r1, [sp, #-4]! // Save point of interrupt + STMDB sp!, {r4-r12, lr} // Save upper half of registers + MOV r4, r3 // Save SPSR in r4 + MOV r2, #IRQ_MODE // Build IRQ mode CPSR + MSR CPSR_c, r2 // Enter IRQ mode + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOV r5, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r5 // Enter SVC mode + STMDB sp!, {r0-r3} // Save r0-r3 on thread's stack + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer #ifdef TX_ENABLE_VFP_SUPPORT - LDR r2, [r0, #144] @ Pickup the VFP enabled flag - CMP r2, #0 @ Is the VFP enabled? - BEQ _tx_skip_irq_vfp_save @ No, skip VFP IRQ save - VMRS r2, FPSCR @ Pickup the FPSCR - STR r2, [sp, #-4]! @ Save FPSCR - VSTMDB sp!, {D16-D31} @ Save D16-D31 - VSTMDB sp!, {D0-D15} @ Save D0-D15 + LDR r2, [r0, #144] // Pickup the VFP enabled flag + CMP r2, #0 // Is the VFP enabled? + BEQ _tx_skip_irq_vfp_save // No, skip VFP IRQ save + VMRS r2, FPSCR // Pickup the FPSCR + STR r2, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D0-D15} // Save D0-D15 + _tx_skip_irq_vfp_save: + #endif - MOV r3, #1 @ Build interrupt stack type - STMDB sp!, {r3, r4} @ Save interrupt stack type and SPSR - STR sp, [r0, #8] @ Save stack pointer in thread control - @ block -@ -@ /* Save the remaining time-slice and disable it. */ -@ if (_tx_timer_time_slice) -@ { -@ - LDR r3, =_tx_timer_time_slice @ Pickup time-slice variable address - LDR r2, [r3] @ Pickup time-slice - CMP r2, #0 @ Is it active? - BEQ __tx_thread_dont_save_ts @ No, don't save it -@ -@ _tx_thread_current_ptr -> tx_thread_time_slice = _tx_timer_time_slice; -@ _tx_timer_time_slice = 0; -@ - STR r2, [r0, #24] @ Save thread's time-slice - MOV r2, #0 @ Clear value - STR r2, [r3] @ Disable global time-slice flag -@ -@ } + MOV r3, #1 // Build interrupt stack type + STMDB sp!, {r3, r4} // Save interrupt stack type and SPSR + STR sp, [r0, #8] // Save stack pointer in thread control + // block + + /* Save the remaining time-slice and disable it. */ + LDR r3, =_tx_timer_time_slice // Pickup time-slice variable address + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it active? + BEQ __tx_thread_dont_save_ts // No, don't save it + STR r2, [r0, #24] // Save thread's time-slice + MOV r2, #0 // Clear value + STR r2, [r3] // Disable global time-slice flag + __tx_thread_dont_save_ts: -@ -@ -@ /* Clear the current task pointer. */ -@ _tx_thread_current_ptr = TX_NULL; -@ - MOV r0, #0 @ NULL value - STR r0, [r1] @ Clear current thread pointer -@ -@ /* Return to the scheduler. */ -@ _tx_thread_schedule(); -@ - B _tx_thread_schedule @ Return to scheduler -@ } -@ + + /* Clear the current task pointer. */ + MOV r0, #0 // NULL value + STR r0, [r1] // Clear current thread pointer + + /* Return to the scheduler. */ + B _tx_thread_schedule // Return to scheduler + __tx_thread_idle_system_restore: -@ -@ /* Just return back to the scheduler! */ -@ - MOV r0, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r0 @ Enter SVC mode - B _tx_thread_schedule @ Return to scheduler -@} - - + /* Just return back to the scheduler! */ + MOV r0, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r0 // Enter SVC mode + B _tx_thread_schedule // Return to scheduler diff --git a/ports/cortex_a5/gnu/src/tx_thread_context_save.S b/ports/cortex_a5/gnu/src/tx_thread_context_save.S index 9716f531..7ac48c2e 100644 --- a/ports/cortex_a5/gnu/src/tx_thread_context_save.S +++ b/ports/cortex_a5/gnu/src/tx_thread_context_save.S @@ -1,206 +1,172 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .global _tx_thread_system_state .global _tx_thread_current_ptr - .global _tx_irq_processing_return - .global _tx_execution_isr_enter -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_save -@ since it will never be called 16-bit mode. */ -@ + .global __tx_irq_processing_return + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_save + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_context_save Cortex-A5/GNU */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function saves the context of an executing thread in the */ -@/* beginning of interrupt processing. The function also ensures that */ -@/* the system stack is used upon return to the calling ISR. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_context_save(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_context_save .type _tx_thread_context_save,function _tx_thread_context_save: -@ -@ /* Upon entry to this routine, it is assumed that IRQ interrupts are locked -@ out, we are in IRQ mode, and all registers are intact. */ -@ -@ /* Check for a nested interrupt condition. */ -@ if (_tx_thread_system_state++) -@ { -@ - STMDB sp!, {r0-r3} @ Save some working registers + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + + STMDB sp!, {r0-r3} // Save some working registers #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable FIQ interrupts + CPSID if // Disable FIQ interrupts #endif - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3] @ Pickup system state - CMP r2, #0 @ Is this the first interrupt? - BEQ __tx_thread_not_nested_save @ Yes, not a nested context save -@ -@ /* Nested interrupt condition. */ -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3] @ Store it back in the variable -@ -@ /* Save the rest of the scratch registers on the stack and return to the -@ calling ISR. */ -@ - MRS r0, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r0, r10, r12, lr} @ Store other registers -@ -@ /* Return to the ISR. */ -@ - MOV r10, #0 @ Clear stack limit + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + + /* Save the rest of the scratch registers on the stack and return to the + calling ISR. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, r10, r12, lr} // Store other registers + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - B __tx_irq_processing_return @ Continue IRQ processing -@ + B __tx_irq_processing_return // Continue IRQ processing + __tx_thread_not_nested_save: -@ } -@ -@ /* Otherwise, not nested, check to see if a thread was running. */ -@ else if (_tx_thread_current_ptr) -@ { -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3] @ Store it back in the variable - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_idle_system_save @ If so, interrupt occurred in - @ scheduling loop - nothing needs saving! -@ -@ /* Save minimal context of interrupted thread. */ -@ - MRS r2, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r2, r10, r12, lr} @ Store other registers -@ -@ /* Save the current stack pointer in the thread's control block. */ -@ _tx_thread_current_ptr -> tx_thread_stack_ptr = sp; -@ -@ /* Switch to the system stack. */ -@ sp = _tx_thread_system_stack_ptr@ -@ - MOV r10, #0 @ Clear stack limit + + /* Otherwise, not nested, check to see if a thread was running. */ + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + + /* Save minimal context of interrupted thread. */ + + MRS r2, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r2, r10, r12, lr} // Store other registers + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - B __tx_irq_processing_return @ Continue IRQ processing -@ -@ } -@ else -@ { -@ + B __tx_irq_processing_return // Continue IRQ processing + __tx_thread_idle_system_save: -@ -@ /* Interrupt occurred in the scheduling loop. */ -@ -@ /* Not much to do here, just adjust the stack pointer, and return to IRQ -@ processing. */ -@ - MOV r10, #0 @ Clear stack limit + + /* Interrupt occurred in the scheduling loop. */ + + /* Not much to do here, just adjust the stack pointer, and return to IRQ + processing. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - ADD sp, sp, #16 @ Recover saved registers - B __tx_irq_processing_return @ Continue IRQ processing -@ -@ } -@} - - - + ADD sp, sp, #16 // Recover saved registers + B __tx_irq_processing_return // Continue IRQ processing diff --git a/ports/cortex_a5/gnu/src/tx_thread_fiq_context_restore.S b/ports/cortex_a5/gnu/src/tx_thread_fiq_context_restore.S index fed1fbda..006be973 100644 --- a/ports/cortex_a5/gnu/src/tx_thread_fiq_context_restore.S +++ b/ports/cortex_a5/gnu/src/tx_thread_fiq_context_restore.S @@ -1,43 +1,32 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ -@ -SVC_MODE = 0xD3 @ SVC mode -FIQ_MODE = 0xD1 @ FIQ mode -MODE_MASK = 0x1F @ Mode mask -THUMB_MASK = 0x20 @ Thumb bit mask -IRQ_MODE_BITS = 0x12 @ IRQ mode bits -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +SVC_MODE = 0xD3 // SVC mode +FIQ_MODE = 0xD1 // FIQ mode +MODE_MASK = 0x1F // Mode mask +THUMB_MASK = 0x20 // Thumb bit mask +IRQ_MODE_BITS = 0x12 // IRQ mode bits + + .global _tx_thread_system_state .global _tx_thread_current_ptr .global _tx_thread_system_stack_ptr @@ -46,218 +35,189 @@ IRQ_MODE_BITS = 0x12 @ IRQ mode bits .global _tx_thread_schedule .global _tx_thread_preempt_disable .global _tx_execution_isr_exit -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_restore -@ since it will never be called 16-bit mode. */ -@ + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_restore + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_fiq_context_restore Cortex-A5/GNU */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function restores the fiq interrupt context when processing a */ -@/* nested interrupt. If not, it returns to the interrupt thread if no */ -@/* preemption is necessary. Otherwise, if preemption is necessary or */ -@/* if no thread was running, the function returns to the scheduler. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* _tx_thread_schedule Thread scheduling routine */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* FIQ ISR Interrupt Service Routines */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_fiq_context_restore(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_context_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function restores the fiq interrupt context when processing a */ +/* nested interrupt. If not, it returns to the interrupt thread if no */ +/* preemption is necessary. Otherwise, if preemption is necessary or */ +/* if no thread was running, the function returns to the scheduler. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling routine */ +/* */ +/* CALLED BY */ +/* */ +/* FIQ ISR Interrupt Service Routines */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_fiq_context_restore .type _tx_thread_fiq_context_restore,function _tx_thread_fiq_context_restore: -@ -@ /* Lockout interrupts. */ -@ - CPSID if @ Disable IRQ and FIQ interrupts + + /* Lockout interrupts. */ + + CPSID if // Disable IRQ and FIQ interrupts #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR exit function to indicate an ISR is complete. */ -@ - BL _tx_execution_isr_exit @ Call the ISR exit function + + /* Call the ISR exit function to indicate an ISR is complete. */ + + BL _tx_execution_isr_exit // Call the ISR exit function #endif -@ -@ /* Determine if interrupts are nested. */ -@ if (--_tx_thread_system_state) -@ { -@ - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3] @ Pickup system state - SUB r2, r2, #1 @ Decrement the counter - STR r2, [r3] @ Store the counter - CMP r2, #0 @ Was this the first interrupt? - BEQ __tx_thread_fiq_not_nested_restore @ If so, not a nested restore -@ -@ /* Interrupts are nested. */ -@ -@ /* Just recover the saved registers and return to the point of -@ interrupt. */ -@ - LDMIA sp!, {r0, r10, r12, lr} @ Recover SPSR, POI, and scratch regs - MSR SPSR_cxsf, r0 @ Put SPSR back - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOVS pc, lr @ Return to point of interrupt -@ -@ } + + /* Determine if interrupts are nested. */ + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + SUB r2, r2, #1 // Decrement the counter + STR r2, [r3] // Store the counter + CMP r2, #0 // Was this the first interrupt? + BEQ __tx_thread_fiq_not_nested_restore // If so, not a nested restore + + /* Interrupts are nested. */ + + /* Just recover the saved registers and return to the point of + interrupt. */ + + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + __tx_thread_fiq_not_nested_restore: -@ -@ /* Determine if a thread was interrupted and no preemption is required. */ -@ else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr) -@ || (_tx_thread_preempt_disable)) -@ { -@ - LDR r1, [sp] @ Pickup the saved SPSR - MOV r2, #MODE_MASK @ Build mask to isolate the interrupted mode - AND r1, r1, r2 @ Isolate mode bits - CMP r1, #IRQ_MODE_BITS @ Was an interrupt taken in IRQ mode before we - @ got to context save? */ - BEQ __tx_thread_fiq_no_preempt_restore @ Yes, just go back to point of interrupt + + /* Determine if a thread was interrupted and no preemption is required. */ + + LDR r1, [sp] // Pickup the saved SPSR + MOV r2, #MODE_MASK // Build mask to isolate the interrupted mode + AND r1, r1, r2 // Isolate mode bits + CMP r1, #IRQ_MODE_BITS // Was an interrupt taken in IRQ mode before we + // got to context save? */ + BEQ __tx_thread_fiq_no_preempt_restore // Yes, just go back to point of interrupt - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup actual current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_fiq_idle_system_restore @ Yes, idle system was interrupted + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup actual current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_fiq_idle_system_restore // Yes, idle system was interrupted - LDR r3, =_tx_thread_preempt_disable @ Pickup preempt disable address - LDR r2, [r3] @ Pickup actual preempt disable flag - CMP r2, #0 @ Is it set? - BNE __tx_thread_fiq_no_preempt_restore @ Yes, don't preempt this thread - LDR r3, =_tx_thread_execute_ptr @ Pickup address of execute thread ptr - LDR r2, [r3] @ Pickup actual execute thread pointer - CMP r0, r2 @ Is the same thread highest priority? - BNE __tx_thread_fiq_preempt_restore @ No, preemption needs to happen + LDR r3, =_tx_thread_preempt_disable // Pickup preempt disable address + LDR r2, [r3] // Pickup actual preempt disable flag + CMP r2, #0 // Is it set? + BNE __tx_thread_fiq_no_preempt_restore // Yes, don't preempt this thread + LDR r3, =_tx_thread_execute_ptr // Pickup address of execute thread ptr + LDR r2, [r3] // Pickup actual execute thread pointer + CMP r0, r2 // Is the same thread highest priority? + BNE __tx_thread_fiq_preempt_restore // No, preemption needs to happen __tx_thread_fiq_no_preempt_restore: -@ -@ /* Restore interrupted thread or ISR. */ -@ -@ /* Pickup the saved stack pointer. */ -@ tmp_ptr = _tx_thread_current_ptr -> tx_thread_stack_ptr; -@ -@ /* Recover the saved context and return to the point of interrupt. */ -@ - LDMIA sp!, {r0, lr} @ Recover SPSR, POI, and scratch regs - MSR SPSR_cxsf, r0 @ Put SPSR back - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOVS pc, lr @ Return to point of interrupt -@ -@ } -@ else -@ { -__tx_thread_fiq_preempt_restore: -@ - LDMIA sp!, {r3, lr} @ Recover temporarily saved registers - MOV r1, lr @ Save lr (point of interrupt) - MOV r2, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r2 @ Enter SVC mode - STR r1, [sp, #-4]! @ Save point of interrupt - STMDB sp!, {r4-r12, lr} @ Save upper half of registers - MOV r4, r3 @ Save SPSR in r4 - MOV r2, #FIQ_MODE @ Build FIQ mode CPSR - MSR CPSR_c, r2 @ Reenter FIQ mode - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOV r5, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r5 @ Enter SVC mode - STMDB sp!, {r0-r3} @ Save r0-r3 on thread's stack - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup current thread pointer + /* Restore interrupted thread or ISR. */ + /* Recover the saved context and return to the point of interrupt. */ + + LDMIA sp!, {r0, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_fiq_preempt_restore: + + LDMIA sp!, {r3, lr} // Recover temporarily saved registers + MOV r1, lr // Save lr (point of interrupt) + MOV r2, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r2 // Enter SVC mode + STR r1, [sp, #-4]! // Save point of interrupt + STMDB sp!, {r4-r12, lr} // Save upper half of registers + MOV r4, r3 // Save SPSR in r4 + MOV r2, #FIQ_MODE // Build FIQ mode CPSR + MSR CPSR_c, r2 // Reenter FIQ mode + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOV r5, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r5 // Enter SVC mode + STMDB sp!, {r0-r3} // Save r0-r3 on thread's stack + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer #ifdef TX_ENABLE_VFP_SUPPORT - LDR r2, [r0, #144] @ Pickup the VFP enabled flag - CMP r2, #0 @ Is the VFP enabled? - BEQ _tx_skip_fiq_vfp_save @ No, skip VFP IRQ save - VMRS r2, FPSCR @ Pickup the FPSCR - STR r2, [sp, #-4]! @ Save FPSCR - VSTMDB sp!, {D16-D31} @ Save D16-D31 - VSTMDB sp!, {D0-D15} @ Save D0-D15 + LDR r2, [r0, #144] // Pickup the VFP enabled flag + CMP r2, #0 // Is the VFP enabled? + BEQ _tx_skip_fiq_vfp_save // No, skip VFP IRQ save + VMRS r2, FPSCR // Pickup the FPSCR + STR r2, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D0-D15} // Save D0-D15 _tx_skip_fiq_vfp_save: #endif - MOV r3, #1 @ Build interrupt stack type - STMDB sp!, {r3, r4} @ Save interrupt stack type and SPSR - STR sp, [r0, #8] @ Save stack pointer in thread control - @ block */ -@ -@ /* Save the remaining time-slice and disable it. */ -@ if (_tx_timer_time_slice) -@ { -@ - LDR r3, =_tx_timer_time_slice @ Pickup time-slice variable address - LDR r2, [r3] @ Pickup time-slice - CMP r2, #0 @ Is it active? - BEQ __tx_thread_fiq_dont_save_ts @ No, don't save it -@ -@ _tx_thread_current_ptr -> tx_thread_time_slice = _tx_timer_time_slice; -@ _tx_timer_time_slice = 0; -@ - STR r2, [r0, #24] @ Save thread's time-slice - MOV r2, #0 @ Clear value - STR r2, [r3] @ Disable global time-slice flag -@ -@ } -__tx_thread_fiq_dont_save_ts: -@ -@ -@ /* Clear the current task pointer. */ -@ _tx_thread_current_ptr = TX_NULL; -@ - MOV r0, #0 @ NULL value - STR r0, [r1] @ Clear current thread pointer -@ -@ /* Return to the scheduler. */ -@ _tx_thread_schedule(); -@ - B _tx_thread_schedule @ Return to scheduler -@ } -@ -__tx_thread_fiq_idle_system_restore: -@ -@ /* Just return back to the scheduler! */ -@ - ADD sp, sp, #24 @ Recover FIQ stack space - MOV r3, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r3 @ Lockout interrupts - B _tx_thread_schedule @ Return to scheduler -@ -@} + MOV r3, #1 // Build interrupt stack type + STMDB sp!, {r3, r4} // Save interrupt stack type and SPSR + STR sp, [r0, #8] // Save stack pointer in thread control + // block */ + LDR r3, =_tx_timer_time_slice // Pickup time-slice variable address + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it active? + BEQ __tx_thread_fiq_dont_save_ts // No, don't save it + + STR r2, [r0, #24] // Save thread's time-slice + MOV r2, #0 // Clear value + STR r2, [r3] // Disable global time-slice flag + +__tx_thread_fiq_dont_save_ts: + + /* Clear the current task pointer. */ + + MOV r0, #0 // NULL value + STR r0, [r1] // Clear current thread pointer + + /* Return to the scheduler. */ + + B _tx_thread_schedule // Return to scheduler + +__tx_thread_fiq_idle_system_restore: + + /* Just return back to the scheduler! */ + + ADD sp, sp, #24 // Recover FIQ stack space + MOV r3, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r3 // Lockout interrupts + B _tx_thread_schedule // Return to scheduler diff --git a/ports/cortex_a5/gnu/src/tx_thread_fiq_context_save.S b/ports/cortex_a5/gnu/src/tx_thread_fiq_context_save.S index a7977de0..7db6a4c2 100644 --- a/ports/cortex_a5/gnu/src/tx_thread_fiq_context_save.S +++ b/ports/cortex_a5/gnu/src/tx_thread_fiq_context_save.S @@ -1,207 +1,178 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .global _tx_thread_system_state .global _tx_thread_current_ptr .global __tx_fiq_processing_return .global _tx_execution_isr_enter -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_save -@ since it will never be called 16-bit mode. */ -@ + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_save + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_fiq_context_save Cortex-A5/GNU */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function saves the context of an executing thread in the */ -@/* beginning of interrupt processing. The function also ensures that */ -@/* the system stack is used upon return to the calling ISR. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@ VOID _tx_thread_fiq_context_save(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_fiq_context_save .type _tx_thread_fiq_context_save,function _tx_thread_fiq_context_save: -@ -@ /* Upon entry to this routine, it is assumed that IRQ interrupts are locked -@ out, we are in IRQ mode, and all registers are intact. */ -@ -@ /* Check for a nested interrupt condition. */ -@ if (_tx_thread_system_state++) -@ { -@ - STMDB sp!, {r0-r3} @ Save some working registers - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3] @ Pickup system state - CMP r2, #0 @ Is this the first interrupt? - BEQ __tx_thread_fiq_not_nested_save @ Yes, not a nested context save -@ -@ /* Nested interrupt condition. */ -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3] @ Store it back in the variable -@ -@ /* Save the rest of the scratch registers on the stack and return to the -@ calling ISR. */ -@ - MRS r0, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r0, r10, r12, lr} @ Store other registers -@ -@ /* Return to the ISR. */ -@ - MOV r10, #0 @ Clear stack limit + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + + STMDB sp!, {r0-r3} // Save some working registers + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_fiq_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + + /* Save the rest of the scratch registers on the stack and return to the + calling ISR. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, r10, r12, lr} // Store other registers + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - B __tx_fiq_processing_return @ Continue FIQ processing -@ + B __tx_fiq_processing_return // Continue FIQ processing +// __tx_thread_fiq_not_nested_save: -@ } -@ -@ /* Otherwise, not nested, check to see if a thread was running. */ -@ else if (_tx_thread_current_ptr) -@ { -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3] @ Store it back in the variable - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_fiq_idle_system_save @ If so, interrupt occurred in -@ @ scheduling loop - nothing needs saving! -@ -@ /* Save minimal context of interrupted thread. */ -@ - MRS r2, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r2, lr} @ Store other registers, Note that we don't -@ @ need to save sl and ip since FIQ has -@ @ copies of these registers. Nested -@ @ interrupt processing does need to save -@ @ these registers. -@ -@ /* Save the current stack pointer in the thread's control block. */ -@ _tx_thread_current_ptr -> tx_thread_stack_ptr = sp; -@ -@ /* Switch to the system stack. */ -@ sp = _tx_thread_system_stack_ptr; -@ - MOV r10, #0 @ Clear stack limit + + /* Otherwise, not nested, check to see if a thread was running. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_fiq_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + + /* Save minimal context of interrupted thread. */ + + MRS r2, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r2, lr} // Store other registers, Note that we don't + // need to save sl and ip since FIQ has + // copies of these registers. Nested + // interrupt processing does need to save + // these registers. + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - B __tx_fiq_processing_return @ Continue FIQ processing -@ -@ } -@ else -@ { -@ + B __tx_fiq_processing_return // Continue FIQ processing + __tx_thread_fiq_idle_system_save: -@ -@ /* Interrupt occurred in the scheduling loop. */ -@ -#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr -#endif -@ -@ /* Not much to do here, save the current SPSR and LR for possible -@ use in IRQ interrupted in idle system conditions, and return to -@ FIQ interrupt processing. */ -@ - MRS r0, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r0, lr} @ Store other registers that will get used -@ @ or stripped off the stack in context -@ @ restore - B __tx_fiq_processing_return @ Continue FIQ processing -@ -@ } -@} + /* Interrupt occurred in the scheduling loop. */ + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + /* Not much to do here, save the current SPSR and LR for possible + use in IRQ interrupted in idle system conditions, and return to + FIQ interrupt processing. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, lr} // Store other registers that will get used + // or stripped off the stack in context + // restore + B __tx_fiq_processing_return // Continue FIQ processing diff --git a/ports/cortex_a5/gnu/src/tx_thread_fiq_nesting_end.S b/ports/cortex_a5/gnu/src/tx_thread_fiq_nesting_end.S index 5a21397a..b34d881e 100644 --- a/ports/cortex_a5/gnu/src/tx_thread_fiq_nesting_end.S +++ b/ports/cortex_a5/gnu/src/tx_thread_fiq_nesting_end.S @@ -1,116 +1,104 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + #ifdef TX_ENABLE_FIQ_SUPPORT -DISABLE_INTS = 0xC0 @ Disable IRQ/FIQ interrupts +DISABLE_INTS = 0xC0 // Disable IRQ/FIQ interrupts #else -DISABLE_INTS = 0x80 @ Disable IRQ interrupts +DISABLE_INTS = 0x80 // Disable IRQ interrupts #endif -MODE_MASK = 0x1F @ Mode mask -FIQ_MODE_BITS = 0x11 @ FIQ mode bits -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_end -@ since it will never be called 16-bit mode. */ -@ +MODE_MASK = 0x1F // Mode mask +FIQ_MODE_BITS = 0x11 // FIQ mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_end + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_fiq_nesting_end Cortex-A5/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is called by the application from FIQ mode after */ -@/* _tx_thread_fiq_nesting_start has been called and switches the FIQ */ -@/* processing from system mode back to FIQ mode prior to the ISR */ -@/* calling _tx_thread_fiq_context_restore. Note that this function */ -@/* assumes the system stack pointer is in the same position after */ -@/* nesting start function was called. */ -@/* */ -@/* This function assumes that the system mode stack pointer was setup */ -@/* during low-level initialization (tx_initialize_low_level.s). */ -@/* */ -@/* This function returns with FIQ interrupts disabled. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_fiq_nesting_end(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_nesting_end ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from FIQ mode after */ +/* _tx_thread_fiq_nesting_start has been called and switches the FIQ */ +/* processing from system mode back to FIQ mode prior to the ISR */ +/* calling _tx_thread_fiq_context_restore. Note that this function */ +/* assumes the system stack pointer is in the same position after */ +/* nesting start function was called. */ +/* */ +/* This function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with FIQ interrupts disabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_fiq_nesting_end .type _tx_thread_fiq_nesting_end,function _tx_thread_fiq_nesting_end: - MOV r3,lr @ Save ISR return address - MRS r0, CPSR @ Pickup the CPSR - ORR r0, r0, #DISABLE_INTS @ Build disable interrupt value - MSR CPSR_c, r0 @ Disable interrupts - LDMIA sp!, {r1, lr} @ Pickup saved lr (and r1 throw-away for - @ 8-byte alignment logic) - BIC r0, r0, #MODE_MASK @ Clear mode bits - ORR r0, r0, #FIQ_MODE_BITS @ Build IRQ mode CPSR - MSR CPSR_c, r0 @ Reenter IRQ mode + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + ORR r0, r0, #DISABLE_INTS // Build disable interrupt value + MSR CPSR_c, r0 // Disable interrupts + LDMIA sp!, {r1, lr} // Pickup saved lr (and r1 throw-away for + // 8-byte alignment logic) + BIC r0, r0, #MODE_MASK // Clear mode bits + ORR r0, r0, #FIQ_MODE_BITS // Build IRQ mode CPSR + MSR CPSR_c, r0 // Reenter IRQ mode #ifdef __THUMB_INTERWORK - BX r3 @ Return to caller + BX r3 // Return to caller #else - MOV pc, r3 @ Return to caller + MOV pc, r3 // Return to caller #endif -@} - diff --git a/ports/cortex_a5/gnu/src/tx_thread_fiq_nesting_start.S b/ports/cortex_a5/gnu/src/tx_thread_fiq_nesting_start.S index 6afdc528..c9cd5a06 100644 --- a/ports/cortex_a5/gnu/src/tx_thread_fiq_nesting_start.S +++ b/ports/cortex_a5/gnu/src/tx_thread_fiq_nesting_start.S @@ -1,108 +1,96 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ -FIQ_DISABLE = 0x40 @ FIQ disable bit -MODE_MASK = 0x1F @ Mode mask -SYS_MODE_BITS = 0x1F @ System mode bits -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_start -@ since it will never be called 16-bit mode. */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +FIQ_DISABLE = 0x40 // FIQ disable bit +MODE_MASK = 0x1F // Mode mask +SYS_MODE_BITS = 0x1F // System mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_start + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_fiq_nesting_start Cortex-A5/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is called by the application from FIQ mode after */ -@/* _tx_thread_fiq_context_save has been called and switches the FIQ */ -@/* processing to the system mode so nested FIQ interrupt processing */ -@/* is possible (system mode has its own "lr" register). Note that */ -@/* this function assumes that the system mode stack pointer was setup */ -@/* during low-level initialization (tx_initialize_low_level.s). */ -@/* */ -@/* This function returns with FIQ interrupts enabled. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_fiq_nesting_start(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_nesting_start ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from FIQ mode after */ +/* _tx_thread_fiq_context_save has been called and switches the FIQ */ +/* processing to the system mode so nested FIQ interrupt processing */ +/* is possible (system mode has its own "lr" register). Note that */ +/* this function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with FIQ interrupts enabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_fiq_nesting_start .type _tx_thread_fiq_nesting_start,function _tx_thread_fiq_nesting_start: - MOV r3,lr @ Save ISR return address - MRS r0, CPSR @ Pickup the CPSR - BIC r0, r0, #MODE_MASK @ Clear the mode bits - ORR r0, r0, #SYS_MODE_BITS @ Build system mode CPSR - MSR CPSR_c, r0 @ Enter system mode - STMDB sp!, {r1, lr} @ Push the system mode lr on the system mode stack - @ and push r1 just to keep 8-byte alignment - BIC r0, r0, #FIQ_DISABLE @ Build enable FIQ CPSR - MSR CPSR_c, r0 @ Enter system mode + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + BIC r0, r0, #MODE_MASK // Clear the mode bits + ORR r0, r0, #SYS_MODE_BITS // Build system mode CPSR + MSR CPSR_c, r0 // Enter system mode + STMDB sp!, {r1, lr} // Push the system mode lr on the system mode stack + // and push r1 just to keep 8-byte alignment + BIC r0, r0, #FIQ_DISABLE // Build enable FIQ CPSR + MSR CPSR_c, r0 // Enter system mode #ifdef __THUMB_INTERWORK - BX r3 @ Return to caller + BX r3 // Return to caller #else - MOV pc, r3 @ Return to caller + MOV pc, r3 // Return to caller #endif -@} - diff --git a/ports/cortex_a5/gnu/src/tx_thread_interrupt_control.S b/ports/cortex_a5/gnu/src/tx_thread_interrupt_control.S index a56054c4..63b1609a 100644 --- a/ports/cortex_a5/gnu/src/tx_thread_interrupt_control.S +++ b/ports/cortex_a5/gnu/src/tx_thread_interrupt_control.S @@ -1,115 +1,104 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ INT_MASK = 0x03F -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_control for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_control for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_interrupt_control $_tx_thread_interrupt_control: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_interrupt_control @ Call _tx_thread_interrupt_control function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_control // Call _tx_thread_interrupt_control function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_interrupt_control Cortex-A5/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is responsible for changing the interrupt lockout */ -@/* posture of the system. */ -@/* */ -@/* INPUT */ -@/* */ -@/* new_posture New interrupt lockout posture */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* old_posture Old interrupt lockout posture */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* Application Code */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@UINT _tx_thread_interrupt_control(UINT new_posture) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_control ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for changing the interrupt lockout */ +/* posture of the system. */ +/* */ +/* INPUT */ +/* */ +/* new_posture New interrupt lockout posture */ +/* */ +/* OUTPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_interrupt_control .type _tx_thread_interrupt_control,function _tx_thread_interrupt_control: -@ -@ /* Pickup current interrupt lockout posture. */ -@ - MRS r3, CPSR @ Pickup current CPSR - MOV r2, #INT_MASK @ Build interrupt mask - AND r1, r3, r2 @ Clear interrupt lockout bits - ORR r1, r1, r0 @ Or-in new interrupt lockout bits -@ -@ /* Apply the new interrupt posture. */ -@ - MSR CPSR_c, r1 @ Setup new CPSR - BIC r0, r3, r2 @ Return previous interrupt mask -#ifdef __THUMB_INTERWORK - BX lr @ Return to caller -#else - MOV pc, lr @ Return to caller -#endif -@} + /* Pickup current interrupt lockout posture. */ + + MRS r3, CPSR // Pickup current CPSR + MOV r2, #INT_MASK // Build interrupt mask + AND r1, r3, r2 // Clear interrupt lockout bits + ORR r1, r1, r0 // Or-in new interrupt lockout bits + + /* Apply the new interrupt posture. */ + + MSR CPSR_c, r1 // Setup new CPSR + BIC r0, r3, r2 // Return previous interrupt mask +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a5/gnu/src/tx_thread_interrupt_disable.S b/ports/cortex_a5/gnu/src/tx_thread_interrupt_disable.S index 76693663..13258808 100644 --- a/ports/cortex_a5/gnu/src/tx_thread_interrupt_disable.S +++ b/ports/cortex_a5/gnu/src/tx_thread_interrupt_disable.S @@ -1,113 +1,101 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_disable for -@ applications calling this function from to 16-bit Thumb mode. */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_disable for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_interrupt_disable $_tx_thread_interrupt_disable: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_interrupt_disable @ Call _tx_thread_interrupt_disable function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_disable // Call _tx_thread_interrupt_disable function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_interrupt_disable Cortex-A5/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is responsible for disabling interrupts */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* old_posture Old interrupt lockout posture */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* Application Code */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@UINT _tx_thread_interrupt_disable(void) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_disable ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for disabling interrupts */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_interrupt_disable .type _tx_thread_interrupt_disable,function _tx_thread_interrupt_disable: -@ -@ /* Pickup current interrupt lockout posture. */ -@ - MRS r0, CPSR @ Pickup current CPSR -@ -@ /* Mask interrupts. */ -@ + + /* Pickup current interrupt lockout posture. */ + + MRS r0, CPSR // Pickup current CPSR + + /* Mask interrupts. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ + CPSID if // Disable IRQ and FIQ #else - CPSID i @ Disable IRQ + CPSID i // Disable IRQ #endif #ifdef __THUMB_INTERWORK - BX lr @ Return to caller + BX lr // Return to caller #else - MOV pc, lr @ Return to caller + MOV pc, lr // Return to caller #endif -@} - - diff --git a/ports/cortex_a5/gnu/src/tx_thread_interrupt_restore.S b/ports/cortex_a5/gnu/src/tx_thread_interrupt_restore.S index 043c6fd9..2d582511 100644 --- a/ports/cortex_a5/gnu/src/tx_thread_interrupt_restore.S +++ b/ports/cortex_a5/gnu/src/tx_thread_interrupt_restore.S @@ -1,104 +1,93 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_restore for -@ applications calling this function from to 16-bit Thumb mode. */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_restore for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_interrupt_restore $_tx_thread_interrupt_restore: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_interrupt_restore @ Call _tx_thread_interrupt_restore function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_restore // Call _tx_thread_interrupt_restore function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_interrupt_restore Cortex-A5/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is responsible for restoring interrupts to the state */ -@/* returned by a previous _tx_thread_interrupt_disable call. */ -@/* */ -@/* INPUT */ -@/* */ -@/* old_posture Old interrupt lockout posture */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* Application Code */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@UINT _tx_thread_interrupt_restore(UINT old_posture) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for restoring interrupts to the state */ +/* returned by a previous _tx_thread_interrupt_disable call. */ +/* */ +/* INPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_interrupt_restore .type _tx_thread_interrupt_restore,function _tx_thread_interrupt_restore: -@ -@ /* Apply the new interrupt posture. */ -@ - MSR CPSR_c, r0 @ Setup new CPSR -#ifdef __THUMB_INTERWORK - BX lr @ Return to caller -#else - MOV pc, lr @ Return to caller -#endif -@} + /* Apply the new interrupt posture. */ + + MSR CPSR_c, r0 // Setup new CPSR +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a5/gnu/src/tx_thread_irq_nesting_end.S b/ports/cortex_a5/gnu/src/tx_thread_irq_nesting_end.S index 2cd4f44a..ec7e63c6 100644 --- a/ports/cortex_a5/gnu/src/tx_thread_irq_nesting_end.S +++ b/ports/cortex_a5/gnu/src/tx_thread_irq_nesting_end.S @@ -1,115 +1,103 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + #ifdef TX_ENABLE_FIQ_SUPPORT -DISABLE_INTS = 0xC0 @ Disable IRQ/FIQ interrupts +DISABLE_INTS = 0xC0 // Disable IRQ/FIQ interrupts #else -DISABLE_INTS = 0x80 @ Disable IRQ interrupts +DISABLE_INTS = 0x80 // Disable IRQ interrupts #endif -MODE_MASK = 0x1F @ Mode mask -IRQ_MODE_BITS = 0x12 @ IRQ mode bits -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_end -@ since it will never be called 16-bit mode. */ -@ +MODE_MASK = 0x1F // Mode mask +IRQ_MODE_BITS = 0x12 // IRQ mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_end + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_irq_nesting_end Cortex-A5/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is called by the application from IRQ mode after */ -@/* _tx_thread_irq_nesting_start has been called and switches the IRQ */ -@/* processing from system mode back to IRQ mode prior to the ISR */ -@/* calling _tx_thread_context_restore. Note that this function */ -@/* assumes the system stack pointer is in the same position after */ -@/* nesting start function was called. */ -@/* */ -@/* This function assumes that the system mode stack pointer was setup */ -@/* during low-level initialization (tx_initialize_low_level.s). */ -@/* */ -@/* This function returns with IRQ interrupts disabled. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_irq_nesting_end(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_irq_nesting_end ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from IRQ mode after */ +/* _tx_thread_irq_nesting_start has been called and switches the IRQ */ +/* processing from system mode back to IRQ mode prior to the ISR */ +/* calling _tx_thread_context_restore. Note that this function */ +/* assumes the system stack pointer is in the same position after */ +/* nesting start function was called. */ +/* */ +/* This function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with IRQ interrupts disabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_irq_nesting_end .type _tx_thread_irq_nesting_end,function _tx_thread_irq_nesting_end: - MOV r3,lr @ Save ISR return address - MRS r0, CPSR @ Pickup the CPSR - ORR r0, r0, #DISABLE_INTS @ Build disable interrupt value - MSR CPSR_c, r0 @ Disable interrupts - LDMIA sp!, {r1, lr} @ Pickup saved lr (and r1 throw-away for - @ 8-byte alignment logic) - BIC r0, r0, #MODE_MASK @ Clear mode bits - ORR r0, r0, #IRQ_MODE_BITS @ Build IRQ mode CPSR - MSR CPSR_c, r0 @ Reenter IRQ mode + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + ORR r0, r0, #DISABLE_INTS // Build disable interrupt value + MSR CPSR_c, r0 // Disable interrupts + LDMIA sp!, {r1, lr} // Pickup saved lr (and r1 throw-away for + // 8-byte alignment logic) + BIC r0, r0, #MODE_MASK // Clear mode bits + ORR r0, r0, #IRQ_MODE_BITS // Build IRQ mode CPSR + MSR CPSR_c, r0 // Reenter IRQ mode #ifdef __THUMB_INTERWORK - BX r3 @ Return to caller + BX r3 // Return to caller #else - MOV pc, r3 @ Return to caller + MOV pc, r3 // Return to caller #endif -@} - diff --git a/ports/cortex_a5/gnu/src/tx_thread_irq_nesting_start.S b/ports/cortex_a5/gnu/src/tx_thread_irq_nesting_start.S index ff5ef319..c69976ed 100644 --- a/ports/cortex_a5/gnu/src/tx_thread_irq_nesting_start.S +++ b/ports/cortex_a5/gnu/src/tx_thread_irq_nesting_start.S @@ -1,108 +1,96 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ -IRQ_DISABLE = 0x80 @ IRQ disable bit -MODE_MASK = 0x1F @ Mode mask -SYS_MODE_BITS = 0x1F @ System mode bits -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_start -@ since it will never be called 16-bit mode. */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +IRQ_DISABLE = 0x80 // IRQ disable bit +MODE_MASK = 0x1F // Mode mask +SYS_MODE_BITS = 0x1F // System mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_start + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_irq_nesting_start Cortex-A5/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is called by the application from IRQ mode after */ -@/* _tx_thread_context_save has been called and switches the IRQ */ -@/* processing to the system mode so nested IRQ interrupt processing */ -@/* is possible (system mode has its own "lr" register). Note that */ -@/* this function assumes that the system mode stack pointer was setup */ -@/* during low-level initialization (tx_initialize_low_level.s). */ -@/* */ -@/* This function returns with IRQ interrupts enabled. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_irq_nesting_start(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_irq_nesting_start ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from IRQ mode after */ +/* _tx_thread_context_save has been called and switches the IRQ */ +/* processing to the system mode so nested IRQ interrupt processing */ +/* is possible (system mode has its own "lr" register). Note that */ +/* this function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with IRQ interrupts enabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_irq_nesting_start .type _tx_thread_irq_nesting_start,function _tx_thread_irq_nesting_start: - MOV r3,lr @ Save ISR return address - MRS r0, CPSR @ Pickup the CPSR - BIC r0, r0, #MODE_MASK @ Clear the mode bits - ORR r0, r0, #SYS_MODE_BITS @ Build system mode CPSR - MSR CPSR_c, r0 @ Enter system mode - STMDB sp!, {r1, lr} @ Push the system mode lr on the system mode stack - @ and push r1 just to keep 8-byte alignment - BIC r0, r0, #IRQ_DISABLE @ Build enable IRQ CPSR - MSR CPSR_c, r0 @ Enter system mode + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + BIC r0, r0, #MODE_MASK // Clear the mode bits + ORR r0, r0, #SYS_MODE_BITS // Build system mode CPSR + MSR CPSR_c, r0 // Enter system mode + STMDB sp!, {r1, lr} // Push the system mode lr on the system mode stack + // and push r1 just to keep 8-byte alignment + BIC r0, r0, #IRQ_DISABLE // Build enable IRQ CPSR + MSR CPSR_c, r0 // Enter system mode #ifdef __THUMB_INTERWORK - BX r3 @ Return to caller + BX r3 // Return to caller #else - MOV pc, r3 @ Return to caller + MOV pc, r3 // Return to caller #endif -@} - diff --git a/ports/cortex_a5/gnu/src/tx_thread_schedule.S b/ports/cortex_a5/gnu/src/tx_thread_schedule.S index 5336abb5..8330e9df 100644 --- a/ports/cortex_a5/gnu/src/tx_thread_schedule.S +++ b/ports/cortex_a5/gnu/src/tx_thread_schedule.S @@ -1,258 +1,230 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .global _tx_thread_execute_ptr .global _tx_thread_current_ptr .global _tx_timer_time_slice - .global _tx_execution_thread_enter -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_schedule for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_schedule for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_schedule .type $_tx_thread_schedule,function $_tx_thread_schedule: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_schedule @ Call _tx_thread_schedule function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_schedule // Call _tx_thread_schedule function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_schedule Cortex-A5/GNU */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function waits for a thread control block pointer to appear in */ -@/* the _tx_thread_execute_ptr variable. Once a thread pointer appears */ -@/* in the variable, the corresponding thread is resumed. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* _tx_initialize_kernel_enter ThreadX entry function */ -@/* _tx_thread_system_return Return to system from thread */ -@/* _tx_thread_context_restore Restore thread's context */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_schedule(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_schedule ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function waits for a thread control block pointer to appear in */ +/* the _tx_thread_execute_ptr variable. Once a thread pointer appears */ +/* in the variable, the corresponding thread is resumed. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_initialize_kernel_enter ThreadX entry function */ +/* _tx_thread_system_return Return to system from thread */ +/* _tx_thread_context_restore Restore thread's context */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_schedule .type _tx_thread_schedule,function _tx_thread_schedule: -@ -@ /* Enable interrupts. */ -@ + + /* Enable interrupts. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSIE if @ Enable IRQ and FIQ interrupts + CPSIE if // Enable IRQ and FIQ interrupts #else - CPSIE i @ Enable IRQ interrupts + CPSIE i // Enable IRQ interrupts #endif -@ -@ /* Wait for a thread to execute. */ -@ do -@ { - LDR r1, =_tx_thread_execute_ptr @ Address of thread execute ptr -@ + + /* Wait for a thread to execute. */ + LDR r1, =_tx_thread_execute_ptr // Address of thread execute ptr + __tx_thread_schedule_loop: -@ - LDR r0, [r1] @ Pickup next thread to execute - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_schedule_loop @ If so, keep looking for a thread -@ -@ } -@ while(_tx_thread_execute_ptr == TX_NULL); -@ -@ /* Yes! We have a thread to execute. Lockout interrupts and -@ transfer control to it. */ -@ + + LDR r0, [r1] // Pickup next thread to execute + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_schedule_loop // If so, keep looking for a thread + /* Yes! We have a thread to execute. Lockout interrupts and + transfer control to it. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ interrupts + CPSID if // Disable IRQ and FIQ interrupts #else - CPSID i @ Disable IRQ interrupts + CPSID i // Disable IRQ interrupts #endif -@ -@ /* Setup the current thread pointer. */ -@ _tx_thread_current_ptr = _tx_thread_execute_ptr; -@ - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread - STR r0, [r1] @ Setup current thread pointer -@ -@ /* Increment the run count for this thread. */ -@ _tx_thread_current_ptr -> tx_thread_run_count++; -@ - LDR r2, [r0, #4] @ Pickup run counter - LDR r3, [r0, #24] @ Pickup time-slice for this thread - ADD r2, r2, #1 @ Increment thread run-counter - STR r2, [r0, #4] @ Store the new run counter -@ -@ /* Setup time-slice, if present. */ -@ _tx_timer_time_slice = _tx_thread_current_ptr -> tx_thread_time_slice; -@ - LDR r2, =_tx_timer_time_slice @ Pickup address of time-slice - @ variable - LDR sp, [r0, #8] @ Switch stack pointers - STR r3, [r2] @ Setup time-slice -@ -@ /* Switch to the thread's stack. */ -@ sp = _tx_thread_execute_ptr -> tx_thread_stack_ptr; -@ + + /* Setup the current thread pointer. */ + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread + STR r0, [r1] // Setup current thread pointer + + /* Increment the run count for this thread. */ + + LDR r2, [r0, #4] // Pickup run counter + LDR r3, [r0, #24] // Pickup time-slice for this thread + ADD r2, r2, #1 // Increment thread run-counter + STR r2, [r0, #4] // Store the new run counter + + /* Setup time-slice, if present. */ + + LDR r2, =_tx_timer_time_slice // Pickup address of time-slice + // variable + LDR sp, [r0, #8] // Switch stack pointers + STR r3, [r2] // Setup time-slice + #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the thread entry function to indicate the thread is executing. */ -@ - MOV r5, r0 @ Save r0 - BL _tx_execution_thread_enter @ Call the thread execution enter function - MOV r0, r5 @ Restore r0 + + /* Call the thread entry function to indicate the thread is executing. */ + + MOV r5, r0 // Save r0 + BL _tx_execution_thread_enter // Call the thread execution enter function + MOV r0, r5 // Restore r0 #endif -@ -@ /* Determine if an interrupt frame or a synchronous task suspension frame -@ is present. */ -@ - LDMIA sp!, {r4, r5} @ Pickup the stack type and saved CPSR - CMP r4, #0 @ Check for synchronous context switch + + /* Determine if an interrupt frame or a synchronous task suspension frame + is present. */ + + LDMIA sp!, {r4, r5} // Pickup the stack type and saved CPSR + CMP r4, #0 // Check for synchronous context switch BEQ _tx_solicited_return - MSR SPSR_cxsf, r5 @ Setup SPSR for return + MSR SPSR_cxsf, r5 // Setup SPSR for return #ifdef TX_ENABLE_VFP_SUPPORT - LDR r1, [r0, #144] @ Pickup the VFP enabled flag - CMP r1, #0 @ Is the VFP enabled? - BEQ _tx_skip_interrupt_vfp_restore @ No, skip VFP interrupt restore - VLDMIA sp!, {D0-D15} @ Recover D0-D15 - VLDMIA sp!, {D16-D31} @ Recover D16-D31 - LDR r4, [sp], #4 @ Pickup FPSCR - VMSR FPSCR, r4 @ Restore FPSCR + LDR r1, [r0, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_interrupt_vfp_restore // No, skip VFP interrupt restore + VLDMIA sp!, {D0-D15} // Recover D0-D15 + VLDMIA sp!, {D16-D31} // Recover D16-D31 + LDR r4, [sp], #4 // Pickup FPSCR + VMSR FPSCR, r4 // Restore FPSCR _tx_skip_interrupt_vfp_restore: #endif - LDMIA sp!, {r0-r12, lr, pc}^ @ Return to point of thread interrupt + LDMIA sp!, {r0-r12, lr, pc}^ // Return to point of thread interrupt _tx_solicited_return: #ifdef TX_ENABLE_VFP_SUPPORT - LDR r1, [r0, #144] @ Pickup the VFP enabled flag - CMP r1, #0 @ Is the VFP enabled? - BEQ _tx_skip_solicited_vfp_restore @ No, skip VFP solicited restore - VLDMIA sp!, {D8-D15} @ Recover D8-D15 - VLDMIA sp!, {D16-D31} @ Recover D16-D31 - LDR r4, [sp], #4 @ Pickup FPSCR - VMSR FPSCR, r4 @ Restore FPSCR + LDR r1, [r0, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_solicited_vfp_restore // No, skip VFP solicited restore + VLDMIA sp!, {D8-D15} // Recover D8-D15 + VLDMIA sp!, {D16-D31} // Recover D16-D31 + LDR r4, [sp], #4 // Pickup FPSCR + VMSR FPSCR, r4 // Restore FPSCR _tx_skip_solicited_vfp_restore: #endif - MSR CPSR_cxsf, r5 @ Recover CPSR - LDMIA sp!, {r4-r11, lr} @ Return to thread synchronously + MSR CPSR_cxsf, r5 // Recover CPSR + LDMIA sp!, {r4-r11, lr} // Return to thread synchronously #ifdef __THUMB_INTERWORK - BX lr @ Return to caller + BX lr // Return to caller #else - MOV pc, lr @ Return to caller + MOV pc, lr // Return to caller #endif -@ -@} -@ #ifdef TX_ENABLE_VFP_SUPPORT .global tx_thread_vfp_enable .type tx_thread_vfp_enable,function tx_thread_vfp_enable: - MRS r2, CPSR @ Pickup the CPSR + MRS r2, CPSR // Pickup the CPSR #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Enable IRQ and FIQ interrupts + CPSID if // Enable IRQ and FIQ interrupts #else - CPSID i @ Enable IRQ interrupts + CPSID i // Enable IRQ interrupts #endif - LDR r0, =_tx_thread_current_ptr @ Build current thread pointer address - LDR r1, [r0] @ Pickup current thread pointer - CMP r1, #0 @ Check for NULL thread pointer - BEQ __tx_no_thread_to_enable @ If NULL, skip VFP enable - MOV r0, #1 @ Build enable value - STR r0, [r1, #144] @ Set the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) + LDR r0, =_tx_thread_current_ptr // Build current thread pointer address + LDR r1, [r0] // Pickup current thread pointer + CMP r1, #0 // Check for NULL thread pointer + BEQ __tx_no_thread_to_enable // If NULL, skip VFP enable + MOV r0, #1 // Build enable value + STR r0, [r1, #144] // Set the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) __tx_no_thread_to_enable: - MSR CPSR_cxsf, r2 @ Recover CPSR - BX LR @ Return to caller + MSR CPSR_cxsf, r2 // Recover CPSR + BX LR // Return to caller .global tx_thread_vfp_disable .type tx_thread_vfp_disable,function tx_thread_vfp_disable: - MRS r2, CPSR @ Pickup the CPSR + MRS r2, CPSR // Pickup the CPSR #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Enable IRQ and FIQ interrupts + CPSID if // Enable IRQ and FIQ interrupts #else - CPSID i @ Enable IRQ interrupts + CPSID i // Enable IRQ interrupts #endif - LDR r0, =_tx_thread_current_ptr @ Build current thread pointer address - LDR r1, [r0] @ Pickup current thread pointer - CMP r1, #0 @ Check for NULL thread pointer - BEQ __tx_no_thread_to_disable @ If NULL, skip VFP disable - MOV r0, #0 @ Build disable value - STR r0, [r1, #144] @ Clear the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) + LDR r0, =_tx_thread_current_ptr // Build current thread pointer address + LDR r1, [r0] // Pickup current thread pointer + CMP r1, #0 // Check for NULL thread pointer + BEQ __tx_no_thread_to_disable // If NULL, skip VFP disable + MOV r0, #0 // Build disable value + STR r0, [r1, #144] // Clear the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) __tx_no_thread_to_disable: - MSR CPSR_cxsf, r2 @ Recover CPSR - BX LR @ Return to caller + MSR CPSR_cxsf, r2 // Recover CPSR + BX LR // Return to caller #endif - diff --git a/ports/cortex_a5/gnu/src/tx_thread_stack_build.S b/ports/cortex_a5/gnu/src/tx_thread_stack_build.S index 8f09c7ae..f413e673 100644 --- a/ports/cortex_a5/gnu/src/tx_thread_stack_build.S +++ b/ports/cortex_a5/gnu/src/tx_thread_stack_build.S @@ -1,178 +1,164 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ .arm -SVC_MODE = 0x13 @ SVC mode +SVC_MODE = 0x13 // SVC mode #ifdef TX_ENABLE_FIQ_SUPPORT -CPSR_MASK = 0xDF @ Mask initial CPSR, IRQ & FIQ interrupts enabled +CPSR_MASK = 0xDF // Mask initial CPSR, IRQ & FIQ interrupts enabled #else -CPSR_MASK = 0x9F @ Mask initial CPSR, IRQ interrupts enabled +CPSR_MASK = 0x9F // Mask initial CPSR, IRQ interrupts enabled #endif -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_stack_build for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_stack_build for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .thumb .global $_tx_thread_stack_build .type $_tx_thread_stack_build,function $_tx_thread_stack_build: - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_stack_build @ Call _tx_thread_stack_build function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_stack_build // Call _tx_thread_stack_build function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_stack_build Cortex-A5/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function builds a stack frame on the supplied thread's stack. */ -@/* The stack frame results in a fake interrupt return to the supplied */ -@/* function pointer. */ -@/* */ -@/* INPUT */ -@/* */ -@/* thread_ptr Pointer to thread control blk */ -@/* function_ptr Pointer to return function */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* _tx_thread_create Create thread service */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_stack_build(TX_THREAD *thread_ptr, VOID (*function_ptr)(VOID)) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_stack_build ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function builds a stack frame on the supplied thread's stack. */ +/* The stack frame results in a fake interrupt return to the supplied */ +/* function pointer. */ +/* */ +/* INPUT */ +/* */ +/* thread_ptr Pointer to thread control blk */ +/* function_ptr Pointer to return function */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_thread_create Create thread service */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_stack_build .type _tx_thread_stack_build,function _tx_thread_stack_build: -@ -@ -@ /* Build a fake interrupt frame. The form of the fake interrupt stack -@ on the Cortex-A5 should look like the following after it is built: -@ -@ Stack Top: 1 Interrupt stack frame type -@ CPSR Initial value for CPSR -@ a1 (r0) Initial value for a1 -@ a2 (r1) Initial value for a2 -@ a3 (r2) Initial value for a3 -@ a4 (r3) Initial value for a4 -@ v1 (r4) Initial value for v1 -@ v2 (r5) Initial value for v2 -@ v3 (r6) Initial value for v3 -@ v4 (r7) Initial value for v4 -@ v5 (r8) Initial value for v5 -@ sb (r9) Initial value for sb -@ sl (r10) Initial value for sl -@ fp (r11) Initial value for fp -@ ip (r12) Initial value for ip -@ lr (r14) Initial value for lr -@ pc (r15) Initial value for pc -@ 0 For stack backtracing -@ -@ Stack Bottom: (higher memory address) */ -@ - LDR r2, [r0, #16] @ Pickup end of stack area - BIC r2, r2, #7 @ Ensure 8-byte alignment - SUB r2, r2, #76 @ Allocate space for the stack frame -@ -@ /* Actually build the stack frame. */ -@ - MOV r3, #1 @ Build interrupt stack type - STR r3, [r2, #0] @ Store stack type - MOV r3, #0 @ Build initial register value - STR r3, [r2, #8] @ Store initial r0 - STR r3, [r2, #12] @ Store initial r1 - STR r3, [r2, #16] @ Store initial r2 - STR r3, [r2, #20] @ Store initial r3 - STR r3, [r2, #24] @ Store initial r4 - STR r3, [r2, #28] @ Store initial r5 - STR r3, [r2, #32] @ Store initial r6 - STR r3, [r2, #36] @ Store initial r7 - STR r3, [r2, #40] @ Store initial r8 - STR r3, [r2, #44] @ Store initial r9 - LDR r3, [r0, #12] @ Pickup stack starting address - STR r3, [r2, #48] @ Store initial r10 (sl) - LDR r3,=_tx_thread_schedule @ Pickup address of _tx_thread_schedule for GDB backtrace - STR r3, [r2, #60] @ Store initial r14 (lr) - MOV r3, #0 @ Build initial register value - STR r3, [r2, #52] @ Store initial r11 - STR r3, [r2, #56] @ Store initial r12 - STR r1, [r2, #64] @ Store initial pc - STR r3, [r2, #68] @ 0 for back-trace - MRS r1, CPSR @ Pickup CPSR - BIC r1, r1, #CPSR_MASK @ Mask mode bits of CPSR - ORR r3, r1, #SVC_MODE @ Build CPSR, SVC mode, interrupts enabled - STR r3, [r2, #4] @ Store initial CPSR -@ -@ /* Setup stack pointer. */ -@ thread_ptr -> tx_thread_stack_ptr = r2; -@ - STR r2, [r0, #8] @ Save stack pointer in thread's - @ control block + + + /* Build a fake interrupt frame. The form of the fake interrupt stack + on the ARMv7-A should look like the following after it is built: + + Stack Top: 1 Interrupt stack frame type + CPSR Initial value for CPSR + a1 (r0) Initial value for a1 + a2 (r1) Initial value for a2 + a3 (r2) Initial value for a3 + a4 (r3) Initial value for a4 + v1 (r4) Initial value for v1 + v2 (r5) Initial value for v2 + v3 (r6) Initial value for v3 + v4 (r7) Initial value for v4 + v5 (r8) Initial value for v5 + sb (r9) Initial value for sb + sl (r10) Initial value for sl + fp (r11) Initial value for fp + ip (r12) Initial value for ip + lr (r14) Initial value for lr + pc (r15) Initial value for + 0 For stack backtracing + + Stack Bottom: (higher memory address) */ + + LDR r2, [r0, #16] // Pickup end of stack area + BIC r2, r2, #7 // Ensure 8-byte alignment + SUB r2, r2, #76 // Allocate space for the stack frame + + /* Actually build the stack frame. */ + + MOV r3, #1 // Build interrupt stack type + STR r3, [r2, #0] // Store stack type + MOV r3, #0 // Build initial register value + STR r3, [r2, #8] // Store initial r0 + STR r3, [r2, #12] // Store initial r1 + STR r3, [r2, #16] // Store initial r2 + STR r3, [r2, #20] // Store initial r3 + STR r3, [r2, #24] // Store initial r4 + STR r3, [r2, #28] // Store initial r5 + STR r3, [r2, #32] // Store initial r6 + STR r3, [r2, #36] // Store initial r7 + STR r3, [r2, #40] // Store initial r8 + STR r3, [r2, #44] // Store initial r9 + LDR r3, [r0, #12] // Pickup stack starting address + STR r3, [r2, #48] // Store initial r10 (sl) + LDR r3,=_tx_thread_schedule // Pickup address of _tx_thread_schedule for GDB backtrace + STR r3, [r2, #60] // Store initial r14 (lr) + MOV r3, #0 // Build initial register value + STR r3, [r2, #52] // Store initial r11 + STR r3, [r2, #56] // Store initial r12 + STR r1, [r2, #64] // Store initial pc + STR r3, [r2, #68] // 0 for back-trace + MRS r1, CPSR // Pickup CPSR + BIC r1, r1, #CPSR_MASK // Mask mode bits of CPSR + ORR r3, r1, #SVC_MODE // Build CPSR, SVC mode, interrupts enabled + STR r3, [r2, #4] // Store initial CPSR + + /* Setup stack pointer. */ + + STR r2, [r0, #8] // Save stack pointer in thread's + // control block #ifdef __THUMB_INTERWORK - BX lr @ Return to caller + BX lr // Return to caller #else - MOV pc, lr @ Return to caller + MOV pc, lr // Return to caller #endif -@} - - diff --git a/ports/cortex_a5/gnu/src/tx_thread_system_return.S b/ports/cortex_a5/gnu/src/tx_thread_system_return.S index 2ee8d99c..cb7d62ce 100644 --- a/ports/cortex_a5/gnu/src/tx_thread_system_return.S +++ b/ports/cortex_a5/gnu/src/tx_thread_system_return.S @@ -1,183 +1,162 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .arm -@ -@ + + .global _tx_thread_current_ptr .global _tx_timer_time_slice .global _tx_thread_schedule - .global _tx_execution_thread_exit -@ -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_system_return for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_system_return for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_system_return .type $_tx_thread_system_return,function $_tx_thread_system_return: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_system_return @ Call _tx_thread_system_return function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_system_return // Call _tx_thread_system_return function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_system_return Cortex-A5/GNU */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is target processor specific. It is used to transfer */ -@/* control from a thread back to the ThreadX system. Only a */ -@/* minimal context is saved since the compiler assumes temp registers */ -@/* are going to get slicked by a function call anyway. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* _tx_thread_schedule Thread scheduling loop */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ThreadX components */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_system_return(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_system_return ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is target processor specific. It is used to transfer */ +/* control from a thread back to the ThreadX system. Only a */ +/* minimal context is saved since the compiler assumes temp registers */ +/* are going to get slicked by a function call anyway. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling loop */ +/* */ +/* CALLED BY */ +/* */ +/* ThreadX components */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_system_return .type _tx_thread_system_return,function _tx_thread_system_return: -@ -@ /* Save minimal context on the stack. */ -@ - STMDB sp!, {r4-r11, lr} @ Save minimal context - LDR r4, =_tx_thread_current_ptr @ Pickup address of current ptr - LDR r5, [r4] @ Pickup current thread pointer - + /* Save minimal context on the stack. */ + + STMDB sp!, {r4-r11, lr} // Save minimal context + + LDR r4, =_tx_thread_current_ptr // Pickup address of current ptr + LDR r5, [r4] // Pickup current thread pointer + #ifdef TX_ENABLE_VFP_SUPPORT - LDR r1, [r5, #144] @ Pickup the VFP enabled flag - CMP r1, #0 @ Is the VFP enabled? - BEQ _tx_skip_solicited_vfp_save @ No, skip VFP solicited save - VMRS r1, FPSCR @ Pickup the FPSCR - STR r1, [sp, #-4]! @ Save FPSCR - VSTMDB sp!, {D16-D31} @ Save D16-D31 - VSTMDB sp!, {D8-D15} @ Save D8-D15 + LDR r1, [r5, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_solicited_vfp_save // No, skip VFP solicited save + VMRS r1, FPSCR // Pickup the FPSCR + STR r1, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D8-D15} // Save D8-D15 _tx_skip_solicited_vfp_save: #endif - MOV r0, #0 @ Build a solicited stack type - MRS r1, CPSR @ Pickup the CPSR - STMDB sp!, {r0-r1} @ Save type and CPSR -@ -@ /* Lockout interrupts. */ -@ -#ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ interrupts -#else - CPSID i @ Disable IRQ interrupts -#endif - -#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the thread exit function to indicate the thread is no longer executing. */ -@ - BL _tx_execution_thread_exit @ Call the thread exit function -#endif - MOV r3, r4 @ Pickup address of current ptr - MOV r0, r5 @ Pickup current thread pointer - LDR r2, =_tx_timer_time_slice @ Pickup address of time slice - LDR r1, [r2] @ Pickup current time slice -@ -@ /* Save current stack and switch to system stack. */ -@ _tx_thread_current_ptr -> tx_thread_stack_ptr = sp; -@ sp = _tx_thread_system_stack_ptr; -@ - STR sp, [r0, #8] @ Save thread stack pointer -@ -@ /* Determine if the time-slice is active. */ -@ if (_tx_timer_time_slice) -@ { -@ - MOV r4, #0 @ Build clear value - CMP r1, #0 @ Is a time-slice active? - BEQ __tx_thread_dont_save_ts @ No, don't save the time-slice -@ -@ /* Save time-slice for the thread and clear the current time-slice. */ -@ _tx_thread_current_ptr -> tx_thread_time_slice = _tx_timer_time_slice; -@ _tx_timer_time_slice = 0; -@ - STR r4, [r2] @ Clear time-slice - STR r1, [r0, #24] @ Save current time-slice -@ -@ } -__tx_thread_dont_save_ts: -@ -@ /* Clear the current thread pointer. */ -@ _tx_thread_current_ptr = TX_NULL; -@ - STR r4, [r3] @ Clear current thread pointer - B _tx_thread_schedule @ Jump to scheduler! -@ -@} + MOV r0, #0 // Build a solicited stack type + MRS r1, CPSR // Pickup the CPSR + STMDB sp!, {r0-r1} // Save type and CPSR + /* Lockout interrupts. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Disable IRQ and FIQ interrupts +#else + CPSID i // Disable IRQ interrupts +#endif + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the thread exit function to indicate the thread is no longer executing. */ + + BL _tx_execution_thread_exit // Call the thread exit function +#endif + MOV r3, r4 // Pickup address of current ptr + MOV r0, r5 // Pickup current thread pointer + LDR r2, =_tx_timer_time_slice // Pickup address of time slice + LDR r1, [r2] // Pickup current time slice + + /* Save current stack and switch to system stack. */ + + STR sp, [r0, #8] // Save thread stack pointer + + /* Determine if the time-slice is active. */ + + MOV r4, #0 // Build clear value + CMP r1, #0 // Is a time-slice active? + BEQ __tx_thread_dont_save_ts // No, don't save the time-slice + + /* Save time-slice for the thread and clear the current time-slice. */ + + STR r4, [r2] // Clear time-slice + STR r1, [r0, #24] // Save current time-slice + +__tx_thread_dont_save_ts: + + /* Clear the current thread pointer. */ + + STR r4, [r3] // Clear current thread pointer + B _tx_thread_schedule // Jump to scheduler! diff --git a/ports/cortex_a5/gnu/src/tx_thread_vectored_context_save.S b/ports/cortex_a5/gnu/src/tx_thread_vectored_context_save.S index c82c742d..d846223f 100644 --- a/ports/cortex_a5/gnu/src/tx_thread_vectored_context_save.S +++ b/ports/cortex_a5/gnu/src/tx_thread_vectored_context_save.S @@ -1,193 +1,165 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .global _tx_thread_system_state .global _tx_thread_current_ptr .global _tx_execution_isr_enter -@ -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_vectored_context_save -@ since it will never be called 16-bit mode. */ -@ + + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_vectored_context_save + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_vectored_context_save Cortex-A5/GNU */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function saves the context of an executing thread in the */ -@/* beginning of interrupt processing. The function also ensures that */ -@/* the system stack is used upon return to the calling ISR. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_vectored_context_save(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_vectored_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_vectored_context_save .type _tx_thread_vectored_context_save,function _tx_thread_vectored_context_save: -@ -@ /* Upon entry to this routine, it is assumed that IRQ interrupts are locked -@ out, we are in IRQ mode, and all registers are intact. */ -@ -@ /* Check for a nested interrupt condition. */ -@ if (_tx_thread_system_state++) -@ { -@ + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ interrupts + CPSID if // Disable IRQ and FIQ interrupts #endif - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3, #0] @ Pickup system state - CMP r2, #0 @ Is this the first interrupt? - BEQ __tx_thread_not_nested_save @ Yes, not a nested context save -@ -@ /* Nested interrupt condition. */ -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3, #0] @ Store it back in the variable -@ -@ /* Note: Minimal context of interrupted thread is already saved. */ -@ -@ /* Return to the ISR. */ -@ - MOV r10, #0 @ Clear stack limit + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3, #0] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3, #0] // Store it back in the variable + + /* Note: Minimal context of interrupted thread is already saved. */ + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - MOV pc, lr @ Return to caller -@ + MOV pc, lr // Return to caller + __tx_thread_not_nested_save: -@ } -@ -@ /* Otherwise, not nested, check to see if a thread was running. */ -@ else if (_tx_thread_current_ptr) -@ { -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3, #0] @ Store it back in the variable - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1, #0] @ Pickup current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_idle_system_save @ If so, interrupt occurred in - @ scheduling loop - nothing needs saving! -@ -@ /* Note: Minimal context of interrupted thread is already saved. */ -@ -@ /* Save the current stack pointer in the thread's control block. */ -@ _tx_thread_current_ptr -> tx_thread_stack_ptr = sp; -@ -@ /* Switch to the system stack. */ -@ sp = _tx_thread_system_stack_ptr; -@ - MOV r10, #0 @ Clear stack limit + + /* Otherwise, not nested, check to see if a thread was running. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3, #0] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1, #0] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + /* Note: Minimal context of interrupted thread is already saved. */ + + /* Save the current stack pointer in the thread's control block. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - MOV pc, lr @ Return to caller -@ -@ } -@ else -@ { -@ + MOV pc, lr // Return to caller + __tx_thread_idle_system_save: -@ -@ /* Interrupt occurred in the scheduling loop. */ -@ -@ /* Not much to do here, just adjust the stack pointer, and return to IRQ -@ processing. */ -@ - MOV r10, #0 @ Clear stack limit + + /* Interrupt occurred in the scheduling loop. */ + + /* Not much to do here, just adjust the stack pointer, and return to IRQ + processing. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - ADD sp, sp, #32 @ Recover saved registers - MOV pc, lr @ Return to caller -@ -@ } -@} - + ADD sp, sp, #32 // Recover saved registers + MOV pc, lr // Return to caller diff --git a/ports/cortex_a5/gnu/src/tx_timer_interrupt.S b/ports/cortex_a5/gnu/src/tx_timer_interrupt.S index 2f922527..7337ed0c 100644 --- a/ports/cortex_a5/gnu/src/tx_timer_interrupt.S +++ b/ports/cortex_a5/gnu/src/tx_timer_interrupt.S @@ -1,40 +1,30 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Timer */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_timer.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Timer */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .arm -@ -@/* Define Assembly language external references... */ -@ + +/* Define Assembly language external references... */ + .global _tx_timer_time_slice .global _tx_timer_system_clock .global _tx_timer_current_ptr @@ -43,237 +33,199 @@ .global _tx_timer_expired_time_slice .global _tx_timer_expired .global _tx_thread_time_slice -@ -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_timer_interrupt for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + + + +/* Define the 16-bit Thumb mode veneer for _tx_timer_interrupt for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .thumb .global $_tx_timer_interrupt .type $_tx_timer_interrupt,function $_tx_timer_interrupt: - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_timer_interrupt @ Call _tx_timer_interrupt function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_timer_interrupt // Call _tx_timer_interrupt function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_timer_interrupt Cortex-A5/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function processes the hardware timer interrupt. This */ -@/* processing includes incrementing the system clock and checking for */ -@/* time slice and/or timer expiration. If either is found, the */ -@/* interrupt context save/restore functions are called along with the */ -@/* expiration functions. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* _tx_thread_time_slice Time slice interrupted thread */ -@/* _tx_timer_expiration_process Timer expiration processing */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* interrupt vector */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_timer_interrupt(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_timer_interrupt ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function processes the hardware timer interrupt. This */ +/* processing includes incrementing the system clock and checking for */ +/* time slice and/or timer expiration. If either is found, the */ +/* interrupt context save/restore functions are called along with the */ +/* expiration functions. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_time_slice Time slice interrupted thread */ +/* _tx_timer_expiration_process Timer expiration processing */ +/* */ +/* CALLED BY */ +/* */ +/* interrupt vector */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_timer_interrupt .type _tx_timer_interrupt,function _tx_timer_interrupt: -@ -@ /* Upon entry to this routine, it is assumed that context save has already -@ been called, and therefore the compiler scratch registers are available -@ for use. */ -@ -@ /* Increment the system clock. */ -@ _tx_timer_system_clock++; -@ - LDR r1, =_tx_timer_system_clock @ Pickup address of system clock - LDR r0, [r1] @ Pickup system clock - ADD r0, r0, #1 @ Increment system clock - STR r0, [r1] @ Store new system clock -@ -@ /* Test for time-slice expiration. */ -@ if (_tx_timer_time_slice) -@ { -@ - LDR r3, =_tx_timer_time_slice @ Pickup address of time-slice - LDR r2, [r3] @ Pickup time-slice - CMP r2, #0 @ Is it non-active? - BEQ __tx_timer_no_time_slice @ Yes, skip time-slice processing -@ -@ /* Decrement the time_slice. */ -@ _tx_timer_time_slice--; -@ - SUB r2, r2, #1 @ Decrement the time-slice - STR r2, [r3] @ Store new time-slice value -@ -@ /* Check for expiration. */ -@ if (__tx_timer_time_slice == 0) -@ - CMP r2, #0 @ Has it expired? - BNE __tx_timer_no_time_slice @ No, skip expiration processing -@ -@ /* Set the time-slice expired flag. */ -@ _tx_timer_expired_time_slice = TX_TRUE; -@ - LDR r3, =_tx_timer_expired_time_slice @ Pickup address of expired flag - MOV r0, #1 @ Build expired value - STR r0, [r3] @ Set time-slice expiration flag -@ -@ } -@ -__tx_timer_no_time_slice: -@ -@ /* Test for timer expiration. */ -@ if (*_tx_timer_current_ptr) -@ { -@ - LDR r1, =_tx_timer_current_ptr @ Pickup current timer pointer address - LDR r0, [r1] @ Pickup current timer - LDR r2, [r0] @ Pickup timer list entry - CMP r2, #0 @ Is there anything in the list? - BEQ __tx_timer_no_timer @ No, just increment the timer -@ -@ /* Set expiration flag. */ -@ _tx_timer_expired = TX_TRUE; -@ - LDR r3, =_tx_timer_expired @ Pickup expiration flag address - MOV r2, #1 @ Build expired value - STR r2, [r3] @ Set expired flag - B __tx_timer_done @ Finished timer processing -@ -@ } -@ else -@ { -__tx_timer_no_timer: -@ -@ /* No timer expired, increment the timer pointer. */ -@ _tx_timer_current_ptr++; -@ - ADD r0, r0, #4 @ Move to next timer -@ -@ /* Check for wraparound. */ -@ if (_tx_timer_current_ptr == _tx_timer_list_end) -@ - LDR r3, =_tx_timer_list_end @ Pickup address of timer list end - LDR r2, [r3] @ Pickup list end - CMP r0, r2 @ Are we at list end? - BNE __tx_timer_skip_wrap @ No, skip wraparound logic -@ -@ /* Wrap to beginning of list. */ -@ _tx_timer_current_ptr = _tx_timer_list_start; -@ - LDR r3, =_tx_timer_list_start @ Pickup address of timer list start - LDR r0, [r3] @ Set current pointer to list start -@ -__tx_timer_skip_wrap: -@ - STR r0, [r1] @ Store new current timer pointer -@ } -@ -__tx_timer_done: -@ -@ -@ /* See if anything has expired. */ -@ if ((_tx_timer_expired_time_slice) || (_tx_timer_expired)) -@ { -@ - LDR r3, =_tx_timer_expired_time_slice @ Pickup address of expired flag - LDR r2, [r3] @ Pickup time-slice expired flag - CMP r2, #0 @ Did a time-slice expire? - BNE __tx_something_expired @ If non-zero, time-slice expired - LDR r1, =_tx_timer_expired @ Pickup address of other expired flag - LDR r0, [r1] @ Pickup timer expired flag - CMP r0, #0 @ Did a timer expire? - BEQ __tx_timer_nothing_expired @ No, nothing expired -@ -__tx_something_expired: -@ -@ - STMDB sp!, {r0, lr} @ Save the lr register on the stack - @ and save r0 just to keep 8-byte alignment -@ -@ /* Did a timer expire? */ -@ if (_tx_timer_expired) -@ { -@ - LDR r1, =_tx_timer_expired @ Pickup address of expired flag - LDR r0, [r1] @ Pickup timer expired flag - CMP r0, #0 @ Check for timer expiration - BEQ __tx_timer_dont_activate @ If not set, skip timer activation -@ -@ /* Process timer expiration. */ -@ _tx_timer_expiration_process(); -@ - BL _tx_timer_expiration_process @ Call the timer expiration handling routine -@ -@ } -__tx_timer_dont_activate: -@ -@ /* Did time slice expire? */ -@ if (_tx_timer_expired_time_slice) -@ { -@ - LDR r3, =_tx_timer_expired_time_slice @ Pickup address of time-slice expired - LDR r2, [r3] @ Pickup the actual flag - CMP r2, #0 @ See if the flag is set - BEQ __tx_timer_not_ts_expiration @ No, skip time-slice processing -@ -@ /* Time slice interrupted thread. */ -@ _tx_thread_time_slice(); -@ - BL _tx_thread_time_slice @ Call time-slice processing -@ -@ } -@ -__tx_timer_not_ts_expiration: -@ - LDMIA sp!, {r0, lr} @ Recover lr register (r0 is just there for - @ the 8-byte stack alignment -@ -@ } -@ -__tx_timer_nothing_expired: -@ -#ifdef __THUMB_INTERWORK - BX lr @ Return to caller -#else - MOV pc, lr @ Return to caller -#endif -@ -@} + /* Upon entry to this routine, it is assumed that context save has already + been called, and therefore the compiler scratch registers are available + for use. */ + + /* Increment the system clock. */ + + LDR r1, =_tx_timer_system_clock // Pickup address of system clock + LDR r0, [r1] // Pickup system clock + ADD r0, r0, #1 // Increment system clock + STR r0, [r1] // Store new system clock + + /* Test for time-slice expiration. */ + + LDR r3, =_tx_timer_time_slice // Pickup address of time-slice + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it non-active? + BEQ __tx_timer_no_time_slice // Yes, skip time-slice processing + + /* Decrement the time_slice. */ + + SUB r2, r2, #1 // Decrement the time-slice + STR r2, [r3] // Store new time-slice value + + /* Check for expiration. */ + + CMP r2, #0 // Has it expired? + BNE __tx_timer_no_time_slice // No, skip expiration processing + + /* Set the time-slice expired flag. */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of expired flag + MOV r0, #1 // Build expired value + STR r0, [r3] // Set time-slice expiration flag + +__tx_timer_no_time_slice: + + /* Test for timer expiration. */ + + LDR r1, =_tx_timer_current_ptr // Pickup current timer pointer address + LDR r0, [r1] // Pickup current timer + LDR r2, [r0] // Pickup timer list entry + CMP r2, #0 // Is there anything in the list? + BEQ __tx_timer_no_timer // No, just increment the timer + + /* Set expiration flag. */ + + LDR r3, =_tx_timer_expired // Pickup expiration flag address + MOV r2, #1 // Build expired value + STR r2, [r3] // Set expired flag + B __tx_timer_done // Finished timer processing + +__tx_timer_no_timer: + + /* No timer expired, increment the timer pointer. */ + ADD r0, r0, #4 // Move to next timer + + /* Check for wraparound. */ + + LDR r3, =_tx_timer_list_end // Pickup address of timer list end + LDR r2, [r3] // Pickup list end + CMP r0, r2 // Are we at list end? + BNE __tx_timer_skip_wrap // No, skip wraparound logic + + /* Wrap to beginning of list. */ + + LDR r3, =_tx_timer_list_start // Pickup address of timer list start + LDR r0, [r3] // Set current pointer to list start + +__tx_timer_skip_wrap: + + STR r0, [r1] // Store new current timer pointer + +__tx_timer_done: + + /* See if anything has expired. */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of expired flag + LDR r2, [r3] // Pickup time-slice expired flag + CMP r2, #0 // Did a time-slice expire? + BNE __tx_something_expired // If non-zero, time-slice expired + LDR r1, =_tx_timer_expired // Pickup address of other expired flag + LDR r0, [r1] // Pickup timer expired flag + CMP r0, #0 // Did a timer expire? + BEQ __tx_timer_nothing_expired // No, nothing expired + +__tx_something_expired: + + STMDB sp!, {r0, lr} // Save the lr register on the stack + // and save r0 just to keep 8-byte alignment + + /* Did a timer expire? */ + + LDR r1, =_tx_timer_expired // Pickup address of expired flag + LDR r0, [r1] // Pickup timer expired flag + CMP r0, #0 // Check for timer expiration + BEQ __tx_timer_dont_activate // If not set, skip timer activation + + /* Process timer expiration. */ + BL _tx_timer_expiration_process // Call the timer expiration handling routine + +__tx_timer_dont_activate: + + /* Did time slice expire? */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of time-slice expired + LDR r2, [r3] // Pickup the actual flag + CMP r2, #0 // See if the flag is set + BEQ __tx_timer_not_ts_expiration // No, skip time-slice processing + + /* Time slice interrupted thread. */ + + BL _tx_thread_time_slice // Call time-slice processing + +__tx_timer_not_ts_expiration: + + LDMIA sp!, {r0, lr} // Recover lr register (r0 is just there for + // the 8-byte stack alignment + +__tx_timer_nothing_expired: + +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a7/ac6/example_build/sample_threadx.c b/ports/cortex_a7/ac6/example_build/sample_threadx.c new file mode 100644 index 00000000..8c61de06 --- /dev/null +++ b/ports/cortex_a7/ac6/example_build/sample_threadx.c @@ -0,0 +1,369 @@ +/* This is a small demo of the high-performance ThreadX kernel. It includes examples of eight + threads of different priorities, using a message queue, semaphore, mutex, event flags group, + byte pool, and block pool. */ + +#include "tx_api.h" + +#define DEMO_STACK_SIZE 1024 +#define DEMO_BYTE_POOL_SIZE 9120 +#define DEMO_BLOCK_POOL_SIZE 100 +#define DEMO_QUEUE_SIZE 100 + + +/* Define the ThreadX object control blocks... */ + +TX_THREAD thread_0; +TX_THREAD thread_1; +TX_THREAD thread_2; +TX_THREAD thread_3; +TX_THREAD thread_4; +TX_THREAD thread_5; +TX_THREAD thread_6; +TX_THREAD thread_7; +TX_QUEUE queue_0; +TX_SEMAPHORE semaphore_0; +TX_MUTEX mutex_0; +TX_EVENT_FLAGS_GROUP event_flags_0; +TX_BYTE_POOL byte_pool_0; +TX_BLOCK_POOL block_pool_0; + + +/* Define the counters used in the demo application... */ + +ULONG thread_0_counter; +ULONG thread_1_counter; +ULONG thread_1_messages_sent; +ULONG thread_2_counter; +ULONG thread_2_messages_received; +ULONG thread_3_counter; +ULONG thread_4_counter; +ULONG thread_5_counter; +ULONG thread_6_counter; +ULONG thread_7_counter; + + +/* Define thread prototypes. */ + +void thread_0_entry(ULONG thread_input); +void thread_1_entry(ULONG thread_input); +void thread_2_entry(ULONG thread_input); +void thread_3_and_4_entry(ULONG thread_input); +void thread_5_entry(ULONG thread_input); +void thread_6_and_7_entry(ULONG thread_input); + + +/* Define main entry point. */ + +int main() +{ + + /* Enter the ThreadX kernel. */ + tx_kernel_enter(); +} + + +/* Define what the initial system looks like. */ + +void tx_application_define(void *first_unused_memory) +{ + +CHAR *pointer = TX_NULL; + + + /* Create a byte memory pool from which to allocate the thread stacks. */ + tx_byte_pool_create(&byte_pool_0, "byte pool 0", first_unused_memory, DEMO_BYTE_POOL_SIZE); + + /* Put system definition stuff in here, e.g. thread creates and other assorted + create information. */ + + /* Allocate the stack for thread 0. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 1, 1, TX_NO_TIME_SLICE, TX_AUTO_START); + + + /* Allocate the stack for thread 1. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create threads 1 and 2. These threads pass information through a ThreadX + message queue. It is also interesting to note that these threads have a time + slice. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, DEMO_STACK_SIZE, + 16, 16, 4, TX_AUTO_START); + + /* Allocate the stack for thread 2. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, DEMO_STACK_SIZE, + 16, 16, 4, TX_AUTO_START); + + /* Allocate the stack for thread 3. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create threads 3 and 4. These threads compete for a ThreadX counting semaphore. + An interesting thing here is that both threads share the same instruction area. */ + tx_thread_create(&thread_3, "thread 3", thread_3_and_4_entry, 3, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 4. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + tx_thread_create(&thread_4, "thread 4", thread_3_and_4_entry, 4, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 5. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create thread 5. This thread simply pends on an event flag which will be set + by thread_0. */ + tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 6. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create threads 6 and 7. These threads compete for a ThreadX mutex. */ + tx_thread_create(&thread_6, "thread 6", thread_6_and_7_entry, 6, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 7. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + tx_thread_create(&thread_7, "thread 7", thread_6_and_7_entry, 7, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the message queue. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_QUEUE_SIZE*sizeof(ULONG), TX_NO_WAIT); + + /* Create the message queue shared by threads 1 and 2. */ + tx_queue_create(&queue_0, "queue 0", TX_1_ULONG, pointer, DEMO_QUEUE_SIZE*sizeof(ULONG)); + + /* Create the semaphore used by threads 3 and 4. */ + tx_semaphore_create(&semaphore_0, "semaphore 0", 1); + + /* Create the event flags group used by threads 1 and 5. */ + tx_event_flags_create(&event_flags_0, "event flags 0"); + + /* Create the mutex used by thread 6 and 7 without priority inheritance. */ + tx_mutex_create(&mutex_0, "mutex 0", TX_NO_INHERIT); + + /* Allocate the memory for a small block pool. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_BLOCK_POOL_SIZE, TX_NO_WAIT); + + /* Create a block memory pool to allocate a message buffer from. */ + tx_block_pool_create(&block_pool_0, "block pool 0", sizeof(ULONG), pointer, DEMO_BLOCK_POOL_SIZE); + + /* Allocate a block and release the block memory. */ + tx_block_allocate(&block_pool_0, (VOID **) &pointer, TX_NO_WAIT); + + /* Release the block back to the pool. */ + tx_block_release(pointer); +} + + + +/* Define the test threads. */ + +void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + + /* This thread simply sits in while-forever-sleep loop. */ + while(1) + { + + /* Increment the thread counter. */ + thread_0_counter++; + + /* Sleep for 10 ticks. */ + tx_thread_sleep(10); + + /* Set event flag 0 to wakeup thread 5. */ + status = tx_event_flags_set(&event_flags_0, 0x1, TX_OR); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + } +} + + +void thread_1_entry(ULONG thread_input) +{ + +UINT status; + + + /* This thread simply sends messages to a queue shared by thread 2. */ + while(1) + { + + /* Increment the thread counter. */ + thread_1_counter++; + + /* Send message to queue 0. */ + status = tx_queue_send(&queue_0, &thread_1_messages_sent, TX_WAIT_FOREVER); + + /* Check completion status. */ + if (status != TX_SUCCESS) + break; + + /* Increment the message sent. */ + thread_1_messages_sent++; + } +} + + +void thread_2_entry(ULONG thread_input) +{ + +ULONG received_message; +UINT status; + + /* This thread retrieves messages placed on the queue by thread 1. */ + while(1) + { + + /* Increment the thread counter. */ + thread_2_counter++; + + /* Retrieve a message from the queue. */ + status = tx_queue_receive(&queue_0, &received_message, TX_WAIT_FOREVER); + + /* Check completion status and make sure the message is what we + expected. */ + if ((status != TX_SUCCESS) || (received_message != thread_2_messages_received)) + break; + + /* Otherwise, all is okay. Increment the received message count. */ + thread_2_messages_received++; + } +} + + +void thread_3_and_4_entry(ULONG thread_input) +{ + +UINT status; + + + /* This function is executed from thread 3 and thread 4. As the loop + below shows, these function compete for ownership of semaphore_0. */ + while(1) + { + + /* Increment the thread counter. */ + if (thread_input == 3) + thread_3_counter++; + else + thread_4_counter++; + + /* Get the semaphore with suspension. */ + status = tx_semaphore_get(&semaphore_0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Sleep for 2 ticks to hold the semaphore. */ + tx_thread_sleep(2); + + /* Release the semaphore. */ + status = tx_semaphore_put(&semaphore_0); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + } +} + + +void thread_5_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_flags; + + + /* This thread simply waits for an event in a forever loop. */ + while(1) + { + + /* Increment the thread counter. */ + thread_5_counter++; + + /* Wait for event flag 0. */ + status = tx_event_flags_get(&event_flags_0, 0x1, TX_OR_CLEAR, + &actual_flags, TX_WAIT_FOREVER); + + /* Check status. */ + if ((status != TX_SUCCESS) || (actual_flags != 0x1)) + break; + } +} + + +void thread_6_and_7_entry(ULONG thread_input) +{ + +UINT status; + + + /* This function is executed from thread 6 and thread 7. As the loop + below shows, these function compete for ownership of mutex_0. */ + while(1) + { + + /* Increment the thread counter. */ + if (thread_input == 6) + thread_6_counter++; + else + thread_7_counter++; + + /* Get the mutex with suspension. */ + status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Get the mutex again with suspension. This shows + that an owning thread may retrieve the mutex it + owns multiple times. */ + status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Sleep for 2 ticks to hold the mutex. */ + tx_thread_sleep(2); + + /* Release the mutex. */ + status = tx_mutex_put(&mutex_0); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Release the mutex again. This will actually + release ownership since it was obtained twice. */ + status = tx_mutex_put(&mutex_0); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + } +} diff --git a/ports/cortex_a7/ac6/example_build/sample_threadx/sample_threadx.c b/ports/cortex_a7/ac6/example_build/sample_threadx/sample_threadx.c index 418ec634..8c61de06 100644 --- a/ports/cortex_a7/ac6/example_build/sample_threadx/sample_threadx.c +++ b/ports/cortex_a7/ac6/example_build/sample_threadx/sample_threadx.c @@ -1,5 +1,5 @@ /* This is a small demo of the high-performance ThreadX kernel. It includes examples of eight - threads of different priorities, using a message queue, semaphore, mutex, event flags group, + threads of different priorities, using a message queue, semaphore, mutex, event flags group, byte pool, and block pool. */ #include "tx_api.h" @@ -80,42 +80,42 @@ CHAR *pointer = TX_NULL; tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); /* Create the main thread. */ - tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, 1, 1, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 1. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - /* Create threads 1 and 2. These threads pass information through a ThreadX + /* Create threads 1 and 2. These threads pass information through a ThreadX message queue. It is also interesting to note that these threads have a time slice. */ - tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, DEMO_STACK_SIZE, 16, 16, 4, TX_AUTO_START); /* Allocate the stack for thread 2. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, DEMO_STACK_SIZE, 16, 16, 4, TX_AUTO_START); /* Allocate the stack for thread 3. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - /* Create threads 3 and 4. These threads compete for a ThreadX counting semaphore. + /* Create threads 3 and 4. These threads compete for a ThreadX counting semaphore. An interesting thing here is that both threads share the same instruction area. */ - tx_thread_create(&thread_3, "thread 3", thread_3_and_4_entry, 3, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_3, "thread 3", thread_3_and_4_entry, 3, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 4. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - tx_thread_create(&thread_4, "thread 4", thread_3_and_4_entry, 4, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_4, "thread 4", thread_3_and_4_entry, 4, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 5. */ @@ -123,23 +123,23 @@ CHAR *pointer = TX_NULL; /* Create thread 5. This thread simply pends on an event flag which will be set by thread_0. */ - tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, + pointer, DEMO_STACK_SIZE, 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 6. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); /* Create threads 6 and 7. These threads compete for a ThreadX mutex. */ - tx_thread_create(&thread_6, "thread 6", thread_6_and_7_entry, 6, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_6, "thread 6", thread_6_and_7_entry, 6, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 7. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - tx_thread_create(&thread_7, "thread 7", thread_6_and_7_entry, 7, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_7, "thread 7", thread_6_and_7_entry, 7, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the message queue. */ @@ -242,11 +242,11 @@ UINT status; /* Retrieve a message from the queue. */ status = tx_queue_receive(&queue_0, &received_message, TX_WAIT_FOREVER); - /* Check completion status and make sure the message is what we + /* Check completion status and make sure the message is what we expected. */ if ((status != TX_SUCCESS) || (received_message != thread_2_messages_received)) break; - + /* Otherwise, all is okay. Increment the received message count. */ thread_2_messages_received++; } @@ -305,7 +305,7 @@ ULONG actual_flags; thread_5_counter++; /* Wait for event flag 0. */ - status = tx_event_flags_get(&event_flags_0, 0x1, TX_OR_CLEAR, + status = tx_event_flags_get(&event_flags_0, 0x1, TX_OR_CLEAR, &actual_flags, TX_WAIT_FOREVER); /* Check status. */ @@ -358,7 +358,7 @@ UINT status; if (status != TX_SUCCESS) break; - /* Release the mutex again. This will actually + /* Release the mutex again. This will actually release ownership since it was obtained twice. */ status = tx_mutex_put(&mutex_0); diff --git a/ports/cortex_a7/ac6/example_build/sample_threadx/sample_threadx.launch b/ports/cortex_a7/ac6/example_build/sample_threadx/sample_threadx.launch new file mode 100644 index 00000000..0bc5b11b --- /dev/null +++ b/ports/cortex_a7/ac6/example_build/sample_threadx/sample_threadx.launch @@ -0,0 +1,188 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ports/cortex_a7/ac6/example_build/sample_threadx/sample_threadx.scat b/ports/cortex_a7/ac6/example_build/sample_threadx/sample_threadx.scat index 82477876..d23881cd 100644 --- a/ports/cortex_a7/ac6/example_build/sample_threadx/sample_threadx.scat +++ b/ports/cortex_a7/ac6/example_build/sample_threadx/sample_threadx.scat @@ -5,12 +5,10 @@ ; and your compliance with all applicable terms and conditions of such licence agreement. ;******************************************************* -; Scatter-file for Cortex-A7 bare-metal example on Versatile Express +; Scatter-file for ARMv7-A bare-metal example on Versatile Express ; This scatter-file places application code, data, stack and heap at suitable addresses in the memory map. -; Versatile Express with Cortex-A7 has 1GB SDRAM at 0x60000000 to 0x9FFFFFFF, which this scatter-file uses. - SDRAM 0x80000000 0x20000000 { diff --git a/ports/cortex_a7/ac6/example_build/sample_threadx/startup.S b/ports/cortex_a7/ac6/example_build/sample_threadx/startup.S index 35be43cf..670fadb9 100644 --- a/ports/cortex_a7/ac6/example_build/sample_threadx/startup.S +++ b/ports/cortex_a7/ac6/example_build/sample_threadx/startup.S @@ -1,13 +1,12 @@ //---------------------------------------------------------------- -// Cortex-A7 Embedded example - Startup Code +// ARMv7-A Embedded example - Startup Code // // Copyright (c) 2005-2018 Arm Limited (or its affiliates). All rights reserved. // Use, modification and redistribution of this file is subject to your possession of a -// valid End User License Agreement for the Arm Product of which these examples are part of +// valid End User License Agreement for the Arm Product of which these examples are part of // and your compliance with all applicable terms and conditions of such licence agreement. //---------------------------------------------------------------- - // Standard definitions of mode bits and interrupt (I & F) flags in PSRs #define Mode_USR 0x10 @@ -26,7 +25,7 @@ .align 3 .cfi_sections .debug_frame // put stack frame info into .debug_frame instead of .eh_frame - + //---------------------------------------------------------------- // Entry point for the Reset handler //---------------------------------------------------------------- @@ -103,6 +102,7 @@ Reset_Handler: BIC r0, r0, #(0x1 << 12) // Clear I bit 12 to disable I Cache BIC r0, r0, #(0x1 << 2) // Clear C bit 2 to disable D Cache BIC r0, r0, #0x1 // Clear M bit 0 to disable MMU + BIC r0, r0, #(0x1 << 11) // Clear Z bit 11 to disable branch prediction MCR p15, 0, r0, c1, c0, 0 // Write System Control Register ISB @@ -134,6 +134,26 @@ Reset_Handler: LDR SP, =Image$$ARM_LIB_STACK$$ZI$$Limit +//---------------------------------------------------------------- +// Disable loop-buffer to fix errata on A15 r0p0 +//---------------------------------------------------------------- + MRC p15, 0, r0, c0, c0, 0 // Read main ID register MIDR + MOV r1, r0, lsr #4 // Extract Primary Part Number + LDR r2, =0xFFF + AND r1, r1, r2 + LDR r2, =0xC0F + CMP r1, r2 // Is this an A15? + BNE notA15r0p0 // Jump if not A15 + AND r5, r0, #0x00f00000 // Variant + AND r6, r0, #0x0000000f // Revision + ORRS r6, r6, r5 // Combine variant and revision + BNE notA15r0p0 // Jump if not r0p0 + MRC p15, 0, r0, c1, c0, 1 // Read Aux Ctrl Reg + ORR r0, r0, #(1 << 1) // Set bit 1 to Disable Loop Buffer + MCR p15, 0, r0, c1, c0, 1 // Write Aux Ctrl Reg + ISB +notA15r0p0: + //---------------------------------------------------------------- // Set Vector Base Address Register (VBAR) to point to this application's vector table //---------------------------------------------------------------- @@ -142,7 +162,7 @@ Reset_Handler: MCR p15, 0, r0, c12, c0, 0 //---------------------------------------------------------------- -// Cache Invalidation code for Cortex-A7 +// Cache Invalidation code for ARMv7-A // The caches, MMU and BTB do not need post-reset invalidation on Cortex-A7, // but forcing a cache invalidation makes the code more portable to other CPUs (e.g. Cortex-A9) //---------------------------------------------------------------- @@ -213,16 +233,18 @@ Finished: // write the address of our page table base to TTB register 0 LDR r0,=Image$$TTB$$ZI$$Base + MOV r1, #0x08 // RGN=b01 (outer cacheable write-back cached, write allocate) // S=0 (translation table walk to non-shared memory) ORR r1,r1,#0x40 // IRGN=b01 (inner cacheability for the translation table walk is Write-back Write-allocate) ORR r0,r0,r1 + MCR p15, 0, r0, c2, c0, 0 //---------------------------------------------------------------- -// PAGE TABLE generation +// PAGE TABLE generation // Generate the page tables // Build a flat translation table for the whole address space. @@ -235,7 +257,7 @@ Finished: // Bits[31:20] - Top 12 bits of VA is pointer into table // nG[17]=0 - Non global, enables matching against ASID in the TLB when set. // S[16]=0 - Indicates normal memory is shared when set. -// AP2[15]=0 +// AP2[15]=0 // AP[11:10]=11 - Configure for full read/write access in all modes // TEX[14:12]=000 // CB[3:2]= 00 - Set attributes to Strongly-ordered memory. @@ -254,7 +276,7 @@ Finished: // r2 is level1 descriptor (bits 19:0) // use loop counter to create 4096 individual table entries. - // this writes from address 'Image$$TTB$$ZI$$Base' + + // this writes from address 'Image$$TTB$$ZI$$Base' + // offset 0x3FFC down to offset 0x0 in word steps (4 bytes) init_ttb_1: @@ -328,7 +350,7 @@ init_ttb_1: //---------------------------------------------------------------- -// Enable caches +// Enable caches and branch prediction // This code must be run from a privileged mode //---------------------------------------------------------------- @@ -341,15 +363,35 @@ init_ttb_1: enable_caches: //---------------------------------------------------------------- -// Enable caches +// Enable caches and branch prediction //---------------------------------------------------------------- MRC p15, 0, r0, c1, c0, 0 // Read System Control Register ORR r0, r0, #(0x1 << 12) // Set I bit 12 to enable I Cache ORR r0, r0, #(0x1 << 2) // Set C bit 2 to enable D Cache + ORR r0, r0, #(0x1 << 11) // Set Z bit 11 to enable branch prediction MCR p15, 0, r0, c1, c0, 0 // Write System Control Register ISB + MRC p15, 0, r0, c1, c0, 1 // Read Auxiliary Control Register + ORR r0, #2 // L2EN bit, enable L2 cache + ORR r0, r0, #(0x1 << 2) // Set DP bit 2 to enable L1 Dside prefetch + MCR p15, 0, r0, c1, c0, 1 // Write Auxiliary Control Register + ISB + BX lr .cfi_endproc + .global disable_caches + .type disable_caches, "function" +disable_caches: + + MRC p15, 0, r0, c1, c0, 0 // Read System Control Register + BIC r0, r0, #(0x1 << 12) // Clear I bit 12 to disable I Cache + BIC r0, r0, #(0x1 << 2) // Clear C bit 2 to disable D Cache + MCR p15, 0, r0, c1, c0, 0 // Write System Control Register + ISB + + BX lr + + diff --git a/ports/cortex_a7/ac6/example_build/sample_threadx/tx_initialize_low_level.S b/ports/cortex_a7/ac6/example_build/sample_threadx/tx_initialize_low_level.S index 304e84f1..715958f0 100644 --- a/ports/cortex_a7/ac6/example_build/sample_threadx/tx_initialize_low_level.S +++ b/ports/cortex_a7/ac6/example_build/sample_threadx/tx_initialize_low_level.S @@ -1,344 +1,299 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Initialize */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_initialize.h" -@#include "tx_thread.h" -@#include "tx_timer.h" +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Initialize */ +/** */ +/**************************************************************************/ +/**************************************************************************/ .arm -SVC_MODE = 0xD3 @ Disable IRQ/FIQ SVC mode -IRQ_MODE = 0xD2 @ Disable IRQ/FIQ IRQ mode -FIQ_MODE = 0xD1 @ Disable IRQ/FIQ FIQ mode -SYS_MODE = 0xDF @ Disable IRQ/FIQ SYS mode -FIQ_STACK_SIZE = 512 @ FIQ stack size -IRQ_STACK_SIZE = 1024 @ IRQ stack size -SYS_STACK_SIZE = 1024 @ System stack size -@ -@ +SVC_MODE = 0xD3 // Disable IRQ/FIQ SVC mode +IRQ_MODE = 0xD2 // Disable IRQ/FIQ IRQ mode +FIQ_MODE = 0xD1 // Disable IRQ/FIQ FIQ mode +SYS_MODE = 0xDF // Disable IRQ/FIQ SYS mode +FIQ_STACK_SIZE = 512 // FIQ stack size +IRQ_STACK_SIZE = 1024 // IRQ stack size +SYS_STACK_SIZE = 1024 // System stack size + .global _tx_thread_system_stack_ptr .global _tx_initialize_unused_memory .global _tx_thread_context_save .global _tx_thread_context_restore .global _tx_timer_interrupt -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_initialize_low_level for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + + +/* Define the 16-bit Thumb mode veneer for _tx_initialize_low_level for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .thumb .global $_tx_initialize_low_level .type $_tx_initialize_low_level,function $_tx_initialize_low_level: - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_initialize_low_level @ Call _tx_initialize_low_level function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_initialize_low_level // Call _tx_initialize_low_level function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_initialize_low_level Cortex-A7/AC6 */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is responsible for any low-level processor */ -@/* initialization, including setting up interrupt vectors, setting */ -@/* up a periodic timer interrupt source, saving the system stack */ -@/* pointer for use in ISR processing later, and finding the first */ -@/* available RAM memory address for tx_application_define. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* _tx_initialize_kernel_enter ThreadX entry function */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_initialize_low_level(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_initialize_low_level ARMV7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for any low-level processor */ +/* initialization, including setting up interrupt vectors, setting */ +/* up a periodic timer interrupt source, saving the system stack */ +/* pointer for use in ISR processing later, and finding the first */ +/* available RAM memory address for tx_application_define. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_initialize_kernel_enter ThreadX entry function */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_initialize_low_level .type _tx_initialize_low_level,function _tx_initialize_low_level: -@ -@ /* We must be in SVC mode at this point! */ -@ -@ /* Setup various stack pointers. */ -@ - LDR r1, =Image$$ARM_LIB_STACK$$ZI$$Limit @ Get pointer to stack area -#ifdef TX_ENABLE_IRQ_NESTING -@ -@ /* Setup the system mode stack for nested interrupt support */ -@ - LDR r2, =SYS_STACK_SIZE @ Pickup stack size - MOV r3, #SYS_MODE @ Build SYS mode CPSR - MSR CPSR_c, r3 @ Enter SYS mode - SUB r1, r1, #1 @ Backup 1 byte - BIC r1, r1, #7 @ Ensure 8-byte alignment - MOV sp, r1 @ Setup SYS stack pointer - SUB r1, r1, r2 @ Calculate start of next stack + /* We must be in SVC mode at this point! */ + + /* Setup various stack pointers. */ + + LDR r1, =Image$$ARM_LIB_STACK$$ZI$$Limit // Get pointer to stack area + +#ifdef TX_ENABLE_IRQ_NESTING + + /* Setup the system mode stack for nested interrupt support */ + + LDR r2, =SYS_STACK_SIZE // Pickup stack size + MOV r3, #SYS_MODE // Build SYS mode CPSR + MSR CPSR_c, r3 // Enter SYS mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup SYS stack pointer + SUB r1, r1, r2 // Calculate start of next stack #endif - LDR r2, =FIQ_STACK_SIZE @ Pickup stack size - MOV r0, #FIQ_MODE @ Build FIQ mode CPSR - MSR CPSR, r0 @ Enter FIQ mode - SUB r1, r1, #1 @ Backup 1 byte - BIC r1, r1, #7 @ Ensure 8-byte alignment - MOV sp, r1 @ Setup FIQ stack pointer - SUB r1, r1, r2 @ Calculate start of next stack - LDR r2, =IRQ_STACK_SIZE @ Pickup IRQ stack size - MOV r0, #IRQ_MODE @ Build IRQ mode CPSR - MSR CPSR, r0 @ Enter IRQ mode - SUB r1, r1, #1 @ Backup 1 byte - BIC r1, r1, #7 @ Ensure 8-byte alignment - MOV sp, r1 @ Setup IRQ stack pointer - SUB r3, r1, r2 @ Calculate end of IRQ stack - MOV r0, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR, r0 @ Enter SVC mode - LDR r2, =Image$$ARM_LIB_STACK$$Base @ Pickup stack bottom - CMP r3, r2 @ Compare the current stack end with the bottom -_stack_error_loop: - BLT _stack_error_loop @ If the IRQ stack exceeds the stack bottom, just sit here! -@ -@ /* Save the system stack pointer. */ -@ _tx_thread_system_stack_ptr = (VOID_PTR) (sp); -@ - LDR r2, =_tx_thread_system_stack_ptr @ Pickup stack pointer - STR r1, [r2] @ Save the system stack -@ -@ /* Save the first available memory address. */ -@ _tx_initialize_unused_memory = (VOID_PTR) _end; -@ - LDR r1, =Image$$ZI_DATA$$ZI$$Limit @ Get end of non-initialized RAM area - LDR r2, =_tx_initialize_unused_memory @ Pickup unused memory ptr address - ADD r1, r1, #8 @ Increment to next free word - STR r1, [r2] @ Save first free memory address -@ -@ /* Setup Timer for periodic interrupts. */ -@ -@ /* Done, return to caller. */ -@ + LDR r2, =FIQ_STACK_SIZE // Pickup stack size + MOV r0, #FIQ_MODE // Build FIQ mode CPSR + MSR CPSR, r0 // Enter FIQ mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup FIQ stack pointer + SUB r1, r1, r2 // Calculate start of next stack + LDR r2, =IRQ_STACK_SIZE // Pickup IRQ stack size + MOV r0, #IRQ_MODE // Build IRQ mode CPSR + MSR CPSR, r0 // Enter IRQ mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup IRQ stack pointer + SUB r3, r1, r2 // Calculate end of IRQ stack + MOV r0, #SVC_MODE // Build SVC mode CPSR + MSR CPSR, r0 // Enter SVC mode + LDR r2, =Image$$ARM_LIB_STACK$$Base // Pickup stack bottom + CMP r3, r2 // Compare the current stack end with the bottom +_stack_error_loop: + BLT _stack_error_loop // If the IRQ stack exceeds the stack bottom, just sit here! + + LDR r2, =_tx_thread_system_stack_ptr // Pickup stack pointer + STR r1, [r2] // Save the system stack + + LDR r1, =Image$$ZI_DATA$$ZI$$Limit // Get end of non-initialized RAM area + LDR r2, =_tx_initialize_unused_memory // Pickup unused memory ptr address + ADD r1, r1, #8 // Increment to next free word + STR r1, [r2] // Save first free memory address + #ifdef __THUMB_INTERWORK - BX lr @ Return to caller + BX lr // Return to caller #else - MOV pc, lr @ Return to caller + MOV pc, lr // Return to caller #endif -@} -@ -@ -@/* Define shells for each of the interrupt vectors. */ -@ + +/* Define shells for each of the interrupt vectors. */ + .global __tx_undefined __tx_undefined: - B __tx_undefined @ Undefined handler -@ + B __tx_undefined // Undefined handler + .global __tx_swi_interrupt __tx_swi_interrupt: - B __tx_swi_interrupt @ Software interrupt handler -@ + B __tx_swi_interrupt // Software interrupt handler + .global __tx_prefetch_handler __tx_prefetch_handler: - B __tx_prefetch_handler @ Prefetch exception handler -@ + B __tx_prefetch_handler // Prefetch exception handler + .global __tx_abort_handler __tx_abort_handler: - B __tx_abort_handler @ Abort exception handler -@ + B __tx_abort_handler // Abort exception handler + .global __tx_reserved_handler __tx_reserved_handler: - B __tx_reserved_handler @ Reserved exception handler -@ + B __tx_reserved_handler // Reserved exception handler + .global __tx_irq_processing_return .type __tx_irq_processing_return,function .global __tx_irq_handler __tx_irq_handler: -@ -@ /* Jump to context save to save system context. */ + + /* Jump to context save to save system context. */ B _tx_thread_context_save __tx_irq_processing_return: -@ -@ /* At this point execution is still in the IRQ mode. The CPSR, point of -@ interrupt, and all C scratch registers are available for use. In -@ addition, IRQ interrupts may be re-enabled - with certain restrictions - -@ if nested IRQ interrupts are desired. Interrupts may be re-enabled over -@ small code sequences where lr is saved before enabling interrupts and -@ restored after interrupts are again disabled. */ -@ -@ /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start -@ from IRQ mode with interrupts disabled. This routine switches to the -@ system mode and returns with IRQ interrupts enabled. -@ -@ NOTE: It is very important to ensure all IRQ interrupts are cleared -@ prior to enabling nested IRQ interrupts. */ + + /* At this point execution is still in the IRQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. In + addition, IRQ interrupts may be re-enabled - with certain restrictions - + if nested IRQ interrupts are desired. Interrupts may be re-enabled over + small code sequences where lr is saved before enabling interrupts and + restored after interrupts are again disabled. */ + + /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start + from IRQ mode with interrupts disabled. This routine switches to the + system mode and returns with IRQ interrupts enabled. + + NOTE: It is very important to ensure all IRQ interrupts are cleared + prior to enabling nested IRQ interrupts. */ #ifdef TX_ENABLE_IRQ_NESTING BL _tx_thread_irq_nesting_start #endif -@ -@ /* For debug purpose, execute the timer interrupt processing here. In -@ a real system, some kind of status indication would have to be checked -@ before the timer interrupt handler could be called. */ -@ - BL _tx_timer_interrupt @ Timer interrupt handler -@ -@ -@ /* If interrupt nesting was started earlier, the end of interrupt nesting -@ service must be called before returning to _tx_thread_context_restore. -@ This routine returns in processing in IRQ mode with interrupts disabled. */ + + /* For debug purpose, execute the timer interrupt processing here. In + a real system, some kind of status indication would have to be checked + before the timer interrupt handler could be called. */ + + BL _tx_timer_interrupt // Timer interrupt handler + + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_context_restore. + This routine returns in processing in IRQ mode with interrupts disabled. */ #ifdef TX_ENABLE_IRQ_NESTING BL _tx_thread_irq_nesting_end #endif -@ -@ /* Jump to context restore to restore system context. */ + + /* Jump to context restore to restore system context. */ B _tx_thread_context_restore -@ -@ -@ /* This is an example of a vectored IRQ handler. */ -@ -@ .global __tx_example_vectored_irq_handler -@__tx_example_vectored_irq_handler: -@ -@ -@ /* Save initial context and call context save to prepare for -@ vectored ISR execution. */ -@ -@ STMDB sp!, {r0-r3} @ Save some scratch registers -@ MRS r0, SPSR @ Pickup saved SPSR -@ SUB lr, lr, #4 @ Adjust point of interrupt -@ STMDB sp!, {r0, r10, r12, lr} @ Store other scratch registers -@ BL _tx_thread_vectored_context_save @ Vectored context save -@ -@ /* At this point execution is still in the IRQ mode. The CPSR, point of -@ interrupt, and all C scratch registers are available for use. In -@ addition, IRQ interrupts may be re-enabled - with certain restrictions - -@ if nested IRQ interrupts are desired. Interrupts may be re-enabled over -@ small code sequences where lr is saved before enabling interrupts and -@ restored after interrupts are again disabled. */ -@ -@ -@ /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start -@ from IRQ mode with interrupts disabled. This routine switches to the -@ system mode and returns with IRQ interrupts enabled. -@ -@ NOTE: It is very important to ensure all IRQ interrupts are cleared -@ prior to enabling nested IRQ interrupts. */ -@#ifdef TX_ENABLE_IRQ_NESTING -@ BL _tx_thread_irq_nesting_start -@#endif -@ -@ /* Application IRQ handlers can be called here! */ -@ -@ /* If interrupt nesting was started earlier, the end of interrupt nesting -@ service must be called before returning to _tx_thread_context_restore. -@ This routine returns in processing in IRQ mode with interrupts disabled. */ -@#ifdef TX_ENABLE_IRQ_NESTING -@ BL _tx_thread_irq_nesting_end -@#endif -@ -@ /* Jump to context restore to restore system context. */ -@ B _tx_thread_context_restore -@ -@ + + + /* This is an example of a vectored IRQ handler. */ + + /* At this point execution is still in the IRQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. In + addition, IRQ interrupts may be re-enabled - with certain restrictions - + if nested IRQ interrupts are desired. Interrupts may be re-enabled over + small code sequences where lr is saved before enabling interrupts and + restored after interrupts are again disabled. */ + + + /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start + from IRQ mode with interrupts disabled. This routine switches to the + system mode and returns with IRQ interrupts enabled. + + NOTE: It is very important to ensure all IRQ interrupts are cleared + prior to enabling nested IRQ interrupts. */ + + /* Application IRQ handlers can be called here! */ + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_context_restore. + This routine returns in processing in IRQ mode with interrupts disabled. */ + + /* Jump to context restore to restore system context. */ + #ifdef TX_ENABLE_FIQ_SUPPORT .global __tx_fiq_handler .global __tx_fiq_processing_return __tx_fiq_handler: -@ -@ /* Jump to fiq context save to save system context. */ + + /* Jump to fiq context save to save system context. */ B _tx_thread_fiq_context_save __tx_fiq_processing_return: -@ -@ /* At this point execution is still in the FIQ mode. The CPSR, point of -@ interrupt, and all C scratch registers are available for use. */ -@ -@ /* Interrupt nesting is allowed after calling _tx_thread_fiq_nesting_start -@ from FIQ mode with interrupts disabled. This routine switches to the -@ system mode and returns with FIQ interrupts enabled. -@ -@ NOTE: It is very important to ensure all FIQ interrupts are cleared -@ prior to enabling nested FIQ interrupts. */ + + /* At this point execution is still in the FIQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. */ + + /* Interrupt nesting is allowed after calling _tx_thread_fiq_nesting_start + from FIQ mode with interrupts disabled. This routine switches to the + system mode and returns with FIQ interrupts enabled. + + NOTE: It is very important to ensure all FIQ interrupts are cleared + prior to enabling nested FIQ interrupts. */ #ifdef TX_ENABLE_FIQ_NESTING BL _tx_thread_fiq_nesting_start #endif -@ -@ /* Application FIQ handlers can be called here! */ -@ -@ /* If interrupt nesting was started earlier, the end of interrupt nesting -@ service must be called before returning to _tx_thread_fiq_context_restore. */ + + /* Application FIQ handlers can be called here! */ + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_fiq_context_restore. */ #ifdef TX_ENABLE_FIQ_NESTING BL _tx_thread_fiq_nesting_end #endif -@ -@ /* Jump to fiq context restore to restore system context. */ + + /* Jump to fiq context restore to restore system context. */ B _tx_thread_fiq_context_restore -@ -@ + + #else .global __tx_fiq_handler __tx_fiq_handler: - B __tx_fiq_handler @ FIQ interrupt handler + B __tx_fiq_handler // FIQ interrupt handler #endif -@ -@ + + BUILD_OPTIONS: - .word _tx_build_options @ Reference to bring in + .word _tx_build_options // Reference to bring in VERSION_ID: - .word _tx_version_id @ Reference to bring in + .word _tx_version_id // Reference to bring in diff --git a/ports/cortex_a7/ac6/inc/tx_port.h b/ports/cortex_a7/ac6/inc/tx_port.h index cc3cc987..19463de1 100644 --- a/ports/cortex_a7/ac6/inc/tx_port.h +++ b/ports/cortex_a7/ac6/inc/tx_port.h @@ -12,7 +12,7 @@ /**************************************************************************/ /**************************************************************************/ -/** */ +/** */ /** ThreadX Component */ /** */ /** Port Specific */ @@ -21,36 +21,38 @@ /**************************************************************************/ -/**************************************************************************/ -/* */ -/* PORT SPECIFIC C INFORMATION RELEASE */ -/* */ -/* tx_port.h Cortex-A7/AC6 */ -/* 6.1.6 */ +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* tx_port.h ARMv7-A */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ /* */ /* DESCRIPTION */ -/* */ -/* This file contains data type definitions that make the ThreadX */ -/* real-time kernel function identically on a variety of different */ -/* processor architectures. For example, the size or number of bits */ -/* in an "int" data type vary between microprocessor architectures and */ -/* even C compilers for the same microprocessor. ThreadX does not */ -/* directly use native C data types. Instead, ThreadX creates its */ -/* own special types that can be mapped to actual data types by this */ -/* file to guarantee consistency in the interface and functionality. */ -/* */ -/* RELEASE HISTORY */ -/* */ +/* */ +/* This file contains data type definitions that make the ThreadX */ +/* real-time kernel function identically on a variety of different */ +/* processor architectures. For example, the size or number of bits */ +/* in an "int" data type vary between microprocessor architectures and */ +/* even C compilers for the same microprocessor. ThreadX does not */ +/* directly use native C data types. Instead, ThreadX creates its */ +/* own special types that can be mapped to actual data types by this */ +/* file to guarantee consistency in the interface and functionality. */ +/* */ +/* RELEASE HISTORY */ +/* */ /* DATE NAME DESCRIPTION */ /* */ /* 09-30-2020 William E. Lamie Initial Version 6.1 */ /* 04-02-2021 Bhupendra Naphade Modified comment(s),updated */ /* macro definition, */ /* resulting in version 6.1.6 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -63,7 +65,7 @@ #ifdef TX_INCLUDE_USER_DEFINE_FILE -/* Yes, include the user defines in tx_user.h. The defines in this file may +/* Yes, include the user defines in tx_user.h. The defines in this file may alternately be defined on the command line. */ #include "tx_user.h" @@ -76,7 +78,7 @@ #include -/* Define ThreadX basic types for this port. */ +/* Define ThreadX basic types for this port. */ #define VOID void typedef char CHAR; @@ -112,12 +114,12 @@ typedef unsigned short USHORT; #define TX_TIMER_THREAD_STACK_SIZE 1024 /* Default timer thread stack size */ #endif -#ifndef TX_TIMER_THREAD_PRIORITY -#define TX_TIMER_THREAD_PRIORITY 0 /* Default timer thread priority */ +#ifndef TX_TIMER_THREAD_PRIORITY +#define TX_TIMER_THREAD_PRIORITY 0 /* Default timer thread priority */ #endif -/* Define various constants for the ThreadX ARM port. */ +/* Define various constants for the ThreadX ARM port. */ #ifdef TX_ENABLE_FIQ_SUPPORT #define TX_INT_DISABLE 0xC0 /* Disable IRQ & FIQ interrupts */ @@ -127,8 +129,8 @@ typedef unsigned short USHORT; #define TX_INT_ENABLE 0x00 /* Enable IRQ interrupts */ -/* Define the clock source for trace event entry time stamp. The following two item are port specific. - For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock +/* Define the clock source for trace event entry time stamp. The following two item are port specific. + For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: #define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) @@ -175,7 +177,7 @@ typedef unsigned short USHORT; #define TX_INLINE_INITIALIZATION -/* Determine whether or not stack checking is enabled. By default, ThreadX stack checking is +/* Determine whether or not stack checking is enabled. By default, ThreadX stack checking is disabled. When the following is defined, ThreadX thread stack checking is enabled. If stack checking is enabled (TX_ENABLE_STACK_CHECKING is defined), the TX_DISABLE_STACK_FILLING define is negated, thereby forcing the stack fill which is necessary for the stack checking @@ -187,13 +189,13 @@ typedef unsigned short USHORT; /* Define the TX_THREAD control block extensions for this port. The main reason - for the multiple macros is so that backward compatibility can be maintained with + for the multiple macros is so that backward compatibility can be maintained with existing ThreadX kernel awareness modules. */ -#define TX_THREAD_EXTENSION_0 -#define TX_THREAD_EXTENSION_1 +#define TX_THREAD_EXTENSION_0 +#define TX_THREAD_EXTENSION_1 #define TX_THREAD_EXTENSION_2 ULONG tx_thread_vfp_enable; -#define TX_THREAD_EXTENSION_3 +#define TX_THREAD_EXTENSION_3 /* Define the port extensions of the remaining ThreadX objects. */ @@ -207,11 +209,11 @@ typedef unsigned short USHORT; #define TX_TIMER_EXTENSION -/* Define the user extension field of the thread control block. Nothing +/* Define the user extension field of the thread control block. Nothing additional is needed for this port so it is defined as white space. */ #ifndef TX_THREAD_USER_EXTENSION -#define TX_THREAD_USER_EXTENSION +#define TX_THREAD_USER_EXTENSION #endif @@ -219,8 +221,8 @@ typedef unsigned short USHORT; tx_thread_shell_entry, and tx_thread_terminate. */ -#define TX_THREAD_CREATE_EXTENSION(thread_ptr) -#define TX_THREAD_DELETE_EXTENSION(thread_ptr) +#define TX_THREAD_CREATE_EXTENSION(thread_ptr) +#define TX_THREAD_DELETE_EXTENSION(thread_ptr) #define TX_THREAD_COMPLETED_EXTENSION(thread_ptr) #define TX_THREAD_TERMINATED_EXTENSION(thread_ptr) @@ -247,24 +249,24 @@ typedef unsigned short USHORT; #define TX_TIMER_DELETE_EXTENSION(timer_ptr) -/* Determine if the ARM architecture has the CLZ instruction. This is available on - architectures v5 and above. If available, redefine the macro for calculating the +/* Determine if the ARM architecture has the CLZ instruction. This is available on + architectures v5 and above. If available, redefine the macro for calculating the lowest bit set. */ - + #if __TARGET_ARCH_ARM > 4 #ifndef __thumb__ #define TX_LOWEST_SET_BIT_CALCULATE(m, b) m = m & ((ULONG) (-((LONG) m))); \ asm volatile (" CLZ %0,%1 ": "=r" (b) : "r" (m) ); \ - b = 31 - b; + b = 31 - b; #endif #endif -/* Define ThreadX interrupt lockout and restore macros for protection on - access of critical kernel information. The restore interrupt macro must - restore the interrupt posture of the running thread prior to the value +/* Define ThreadX interrupt lockout and restore macros for protection on + access of critical kernel information. The restore interrupt macro must + restore the interrupt posture of the running thread prior to the value present prior to the disable macro. In most cases, the save area macro is used to define a local function save area for the disable and restore macros. */ @@ -295,7 +297,7 @@ unsigned int _tx_thread_interrupt_restore(UINT old_posture); #endif -/* Define VFP extension for the Cortex-A7. Each is assumed to be called in the context of the executing +/* Define VFP extension for the ARMv7-A. Each is assumed to be called in the context of the executing thread. */ void tx_thread_vfp_enable(void); @@ -315,8 +317,8 @@ void tx_thread_vfp_disable(void); /* Define the version ID of ThreadX. This may be utilized by the application. */ #ifdef TX_THREAD_INIT -CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-A7/AC6 Version 6.1.9 *"; +CHAR _tx_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX ARMv7-A Version 6.1.11 *"; #else extern CHAR _tx_version_id[]; #endif diff --git a/ports/cortex_a7/ac6/src/tx_thread_context_restore.S b/ports/cortex_a7/ac6/src/tx_thread_context_restore.S index 744ecb0a..fae7e72d 100644 --- a/ports/cortex_a7/ac6/src/tx_thread_context_restore.S +++ b/ports/cortex_a7/ac6/src/tx_thread_context_restore.S @@ -1,259 +1,222 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .arm #ifdef TX_ENABLE_FIQ_SUPPORT -SVC_MODE = 0xD3 @ Disable IRQ/FIQ, SVC mode -IRQ_MODE = 0xD2 @ Disable IRQ/FIQ, IRQ mode +SVC_MODE = 0xD3 // Disable IRQ/FIQ, SVC mode +IRQ_MODE = 0xD2 // Disable IRQ/FIQ, IRQ mode #else -SVC_MODE = 0x93 @ Disable IRQ, SVC mode -IRQ_MODE = 0x92 @ Disable IRQ, IRQ mode +SVC_MODE = 0x93 // Disable IRQ, SVC mode +IRQ_MODE = 0x92 // Disable IRQ, IRQ mode #endif -@ + .global _tx_thread_system_state .global _tx_thread_current_ptr .global _tx_thread_execute_ptr .global _tx_timer_time_slice .global _tx_thread_schedule .global _tx_thread_preempt_disable -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_restore -@ since it will never be called 16-bit mode. */ -@ + + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_restore + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_context_restore Cortex-A7/AC6 */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function restores the interrupt context if it is processing a */ -@/* nested interrupt. If not, it returns to the interrupt thread if no */ -@/* preemption is necessary. Otherwise, if preemption is necessary or */ -@/* if no thread was running, the function returns to the scheduler. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* _tx_thread_schedule Thread scheduling routine */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs Interrupt Service Routines */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_context_restore(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_context_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function restores the interrupt context if it is processing a */ +/* nested interrupt. If not, it returns to the interrupt thread if no */ +/* preemption is necessary. Otherwise, if preemption is necessary or */ +/* if no thread was running, the function returns to the scheduler. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling routine */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs Interrupt Service Routines */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_context_restore .type _tx_thread_context_restore,function _tx_thread_context_restore: -@ -@ /* Lockout interrupts. */ -@ + + /* Lockout interrupts. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ interrupts + CPSID if // Disable IRQ and FIQ interrupts #else - CPSID i @ Disable IRQ interrupts + CPSID i // Disable IRQ interrupts #endif #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR exit function to indicate an ISR is complete. */ -@ - BL _tx_execution_isr_exit @ Call the ISR exit function -#endif -@ -@ /* Determine if interrupts are nested. */ -@ if (--_tx_thread_system_state) -@ { -@ - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3] @ Pickup system state - SUB r2, r2, #1 @ Decrement the counter - STR r2, [r3] @ Store the counter - CMP r2, #0 @ Was this the first interrupt? - BEQ __tx_thread_not_nested_restore @ If so, not a nested restore -@ -@ /* Interrupts are nested. */ -@ -@ /* Just recover the saved registers and return to the point of -@ interrupt. */ -@ - LDMIA sp!, {r0, r10, r12, lr} @ Recover SPSR, POI, and scratch regs - MSR SPSR_cxsf, r0 @ Put SPSR back - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOVS pc, lr @ Return to point of interrupt -@ -@ } -__tx_thread_not_nested_restore: -@ -@ /* Determine if a thread was interrupted and no preemption is required. */ -@ else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr) -@ || (_tx_thread_preempt_disable)) -@ { -@ - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup actual current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_idle_system_restore @ Yes, idle system was interrupted -@ - LDR r3, =_tx_thread_preempt_disable @ Pickup preempt disable address - LDR r2, [r3] @ Pickup actual preempt disable flag - CMP r2, #0 @ Is it set? - BNE __tx_thread_no_preempt_restore @ Yes, don't preempt this thread - LDR r3, =_tx_thread_execute_ptr @ Pickup address of execute thread ptr - LDR r2, [r3] @ Pickup actual execute thread pointer - CMP r0, r2 @ Is the same thread highest priority? - BNE __tx_thread_preempt_restore @ No, preemption needs to happen -@ -@ -__tx_thread_no_preempt_restore: -@ -@ /* Restore interrupted thread or ISR. */ -@ -@ /* Pickup the saved stack pointer. */ -@ tmp_ptr = _tx_thread_current_ptr -> tx_thread_stack_ptr; -@ -@ /* Recover the saved context and return to the point of interrupt. */ -@ - LDMIA sp!, {r0, r10, r12, lr} @ Recover SPSR, POI, and scratch regs - MSR SPSR_cxsf, r0 @ Put SPSR back - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOVS pc, lr @ Return to point of interrupt -@ -@ } -@ else -@ { -__tx_thread_preempt_restore: -@ - LDMIA sp!, {r3, r10, r12, lr} @ Recover temporarily saved registers - MOV r1, lr @ Save lr (point of interrupt) - MOV r2, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r2 @ Enter SVC mode - STR r1, [sp, #-4]! @ Save point of interrupt - STMDB sp!, {r4-r12, lr} @ Save upper half of registers - MOV r4, r3 @ Save SPSR in r4 - MOV r2, #IRQ_MODE @ Build IRQ mode CPSR - MSR CPSR_c, r2 @ Enter IRQ mode - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOV r5, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r5 @ Enter SVC mode - STMDB sp!, {r0-r3} @ Save r0-r3 on thread's stack - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup current thread pointer + /* Call the ISR exit function to indicate an ISR is complete. */ + + BL _tx_execution_isr_exit // Call the ISR exit function +#endif + + /* Determine if interrupts are nested. */ + + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + SUB r2, r2, #1 // Decrement the counter + STR r2, [r3] // Store the counter + CMP r2, #0 // Was this the first interrupt? + BEQ __tx_thread_not_nested_restore // If so, not a nested restore + + /* Interrupts are nested. */ + + /* Just recover the saved registers and return to the point of + interrupt. */ + + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_not_nested_restore: + + /* Determine if a thread was interrupted and no preemption is required. */ + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup actual current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_restore // Yes, idle system was interrupted + + LDR r3, =_tx_thread_preempt_disable // Pickup preempt disable address + LDR r2, [r3] // Pickup actual preempt disable flag + CMP r2, #0 // Is it set? + BNE __tx_thread_no_preempt_restore // Yes, don't preempt this thread + LDR r3, =_tx_thread_execute_ptr // Pickup address of execute thread ptr + LDR r2, [r3] // Pickup actual execute thread pointer + CMP r0, r2 // Is the same thread highest priority? + BNE __tx_thread_preempt_restore // No, preemption needs to happen + + +__tx_thread_no_preempt_restore: + + /* Recover the saved context and return to the point of interrupt. */ + + /* Pickup the saved stack pointer. */ + + /* Recover the saved context and return to the point of interrupt. */ + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_preempt_restore: + + LDMIA sp!, {r3, r10, r12, lr} // Recover temporarily saved registers + MOV r1, lr // Save lr (point of interrupt) + MOV r2, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r2 // Enter SVC mode + STR r1, [sp, #-4]! // Save point of interrupt + STMDB sp!, {r4-r12, lr} // Save upper half of registers + MOV r4, r3 // Save SPSR in r4 + MOV r2, #IRQ_MODE // Build IRQ mode CPSR + MSR CPSR_c, r2 // Enter IRQ mode + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOV r5, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r5 // Enter SVC mode + STMDB sp!, {r0-r3} // Save r0-r3 on thread's stack + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer #ifdef TX_ENABLE_VFP_SUPPORT - LDR r2, [r0, #144] @ Pickup the VFP enabled flag - CMP r2, #0 @ Is the VFP enabled? - BEQ _tx_skip_irq_vfp_save @ No, skip VFP IRQ save - VMRS r2, FPSCR @ Pickup the FPSCR - STR r2, [sp, #-4]! @ Save FPSCR - VSTMDB sp!, {D16-D31} @ Save D16-D31 - VSTMDB sp!, {D0-D15} @ Save D0-D15 + LDR r2, [r0, #144] // Pickup the VFP enabled flag + CMP r2, #0 // Is the VFP enabled? + BEQ _tx_skip_irq_vfp_save // No, skip VFP IRQ save + VMRS r2, FPSCR // Pickup the FPSCR + STR r2, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D0-D15} // Save D0-D15 + _tx_skip_irq_vfp_save: + #endif - MOV r3, #1 @ Build interrupt stack type - STMDB sp!, {r3, r4} @ Save interrupt stack type and SPSR - STR sp, [r0, #8] @ Save stack pointer in thread control - @ block -@ -@ /* Save the remaining time-slice and disable it. */ -@ if (_tx_timer_time_slice) -@ { -@ - LDR r3, =_tx_timer_time_slice @ Pickup time-slice variable address - LDR r2, [r3] @ Pickup time-slice - CMP r2, #0 @ Is it active? - BEQ __tx_thread_dont_save_ts @ No, don't save it -@ -@ _tx_thread_current_ptr -> tx_thread_time_slice = _tx_timer_time_slice; -@ _tx_timer_time_slice = 0; -@ - STR r2, [r0, #24] @ Save thread's time-slice - MOV r2, #0 @ Clear value - STR r2, [r3] @ Disable global time-slice flag -@ -@ } + MOV r3, #1 // Build interrupt stack type + STMDB sp!, {r3, r4} // Save interrupt stack type and SPSR + STR sp, [r0, #8] // Save stack pointer in thread control + // block + + /* Save the remaining time-slice and disable it. */ + LDR r3, =_tx_timer_time_slice // Pickup time-slice variable address + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it active? + BEQ __tx_thread_dont_save_ts // No, don't save it + STR r2, [r0, #24] // Save thread's time-slice + MOV r2, #0 // Clear value + STR r2, [r3] // Disable global time-slice flag + __tx_thread_dont_save_ts: -@ -@ -@ /* Clear the current task pointer. */ -@ _tx_thread_current_ptr = TX_NULL; -@ - MOV r0, #0 @ NULL value - STR r0, [r1] @ Clear current thread pointer -@ -@ /* Return to the scheduler. */ -@ _tx_thread_schedule(); -@ - B _tx_thread_schedule @ Return to scheduler -@ } -@ + + /* Clear the current task pointer. */ + MOV r0, #0 // NULL value + STR r0, [r1] // Clear current thread pointer + + /* Return to the scheduler. */ + B _tx_thread_schedule // Return to scheduler + __tx_thread_idle_system_restore: -@ -@ /* Just return back to the scheduler! */ -@ - MOV r0, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r0 @ Enter SVC mode - B _tx_thread_schedule @ Return to scheduler -@} - - + /* Just return back to the scheduler! */ + MOV r0, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r0 // Enter SVC mode + B _tx_thread_schedule // Return to scheduler diff --git a/ports/cortex_a7/ac6/src/tx_thread_context_save.S b/ports/cortex_a7/ac6/src/tx_thread_context_save.S index 8593e032..7ac48c2e 100644 --- a/ports/cortex_a7/ac6/src/tx_thread_context_save.S +++ b/ports/cortex_a7/ac6/src/tx_thread_context_save.S @@ -1,205 +1,172 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .global _tx_thread_system_state .global _tx_thread_current_ptr .global __tx_irq_processing_return -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_save -@ since it will never be called 16-bit mode. */ -@ + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_save + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_context_save Cortex-A7/AC6 */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function saves the context of an executing thread in the */ -@/* beginning of interrupt processing. The function also ensures that */ -@/* the system stack is used upon return to the calling ISR. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_context_save(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_context_save .type _tx_thread_context_save,function _tx_thread_context_save: -@ -@ /* Upon entry to this routine, it is assumed that IRQ interrupts are locked -@ out, we are in IRQ mode, and all registers are intact. */ -@ -@ /* Check for a nested interrupt condition. */ -@ if (_tx_thread_system_state++) -@ { -@ - STMDB sp!, {r0-r3} @ Save some working registers + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + + STMDB sp!, {r0-r3} // Save some working registers #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable FIQ interrupts + CPSID if // Disable FIQ interrupts #endif - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3] @ Pickup system state - CMP r2, #0 @ Is this the first interrupt? - BEQ __tx_thread_not_nested_save @ Yes, not a nested context save -@ -@ /* Nested interrupt condition. */ -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3] @ Store it back in the variable -@ -@ /* Save the rest of the scratch registers on the stack and return to the -@ calling ISR. */ -@ - MRS r0, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r0, r10, r12, lr} @ Store other registers -@ -@ /* Return to the ISR. */ -@ - MOV r10, #0 @ Clear stack limit + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + + /* Save the rest of the scratch registers on the stack and return to the + calling ISR. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, r10, r12, lr} // Store other registers + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - B __tx_irq_processing_return @ Continue IRQ processing -@ + B __tx_irq_processing_return // Continue IRQ processing + __tx_thread_not_nested_save: -@ } -@ -@ /* Otherwise, not nested, check to see if a thread was running. */ -@ else if (_tx_thread_current_ptr) -@ { -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3] @ Store it back in the variable - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_idle_system_save @ If so, interrupt occurred in - @ scheduling loop - nothing needs saving! -@ -@ /* Save minimal context of interrupted thread. */ -@ - MRS r2, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r2, r10, r12, lr} @ Store other registers -@ -@ /* Save the current stack pointer in the thread's control block. */ -@ _tx_thread_current_ptr -> tx_thread_stack_ptr = sp; -@ -@ /* Switch to the system stack. */ -@ sp = _tx_thread_system_stack_ptr@ -@ - MOV r10, #0 @ Clear stack limit + + /* Otherwise, not nested, check to see if a thread was running. */ + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + + /* Save minimal context of interrupted thread. */ + + MRS r2, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r2, r10, r12, lr} // Store other registers + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - B __tx_irq_processing_return @ Continue IRQ processing -@ -@ } -@ else -@ { -@ + B __tx_irq_processing_return // Continue IRQ processing + __tx_thread_idle_system_save: -@ -@ /* Interrupt occurred in the scheduling loop. */ -@ -@ /* Not much to do here, just adjust the stack pointer, and return to IRQ -@ processing. */ -@ - MOV r10, #0 @ Clear stack limit + + /* Interrupt occurred in the scheduling loop. */ + + /* Not much to do here, just adjust the stack pointer, and return to IRQ + processing. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - ADD sp, sp, #16 @ Recover saved registers - B __tx_irq_processing_return @ Continue IRQ processing -@ -@ } -@} - - - + ADD sp, sp, #16 // Recover saved registers + B __tx_irq_processing_return // Continue IRQ processing diff --git a/ports/cortex_a7/ac6/src/tx_thread_fiq_context_restore.S b/ports/cortex_a7/ac6/src/tx_thread_fiq_context_restore.S index 087e9e26..006be973 100644 --- a/ports/cortex_a7/ac6/src/tx_thread_fiq_context_restore.S +++ b/ports/cortex_a7/ac6/src/tx_thread_fiq_context_restore.S @@ -1,43 +1,32 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ -@ -SVC_MODE = 0xD3 @ SVC mode -FIQ_MODE = 0xD1 @ FIQ mode -MODE_MASK = 0x1F @ Mode mask -THUMB_MASK = 0x20 @ Thumb bit mask -IRQ_MODE_BITS = 0x12 @ IRQ mode bits -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +SVC_MODE = 0xD3 // SVC mode +FIQ_MODE = 0xD1 // FIQ mode +MODE_MASK = 0x1F // Mode mask +THUMB_MASK = 0x20 // Thumb bit mask +IRQ_MODE_BITS = 0x12 // IRQ mode bits + + .global _tx_thread_system_state .global _tx_thread_current_ptr .global _tx_thread_system_stack_ptr @@ -45,218 +34,190 @@ IRQ_MODE_BITS = 0x12 @ IRQ mode bits .global _tx_timer_time_slice .global _tx_thread_schedule .global _tx_thread_preempt_disable -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_restore -@ since it will never be called 16-bit mode. */ -@ + .global _tx_execution_isr_exit + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_restore + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_fiq_context_restore Cortex-A7/AC6 */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function restores the fiq interrupt context when processing a */ -@/* nested interrupt. If not, it returns to the interrupt thread if no */ -@/* preemption is necessary. Otherwise, if preemption is necessary or */ -@/* if no thread was running, the function returns to the scheduler. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* _tx_thread_schedule Thread scheduling routine */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* FIQ ISR Interrupt Service Routines */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_fiq_context_restore(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_context_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function restores the fiq interrupt context when processing a */ +/* nested interrupt. If not, it returns to the interrupt thread if no */ +/* preemption is necessary. Otherwise, if preemption is necessary or */ +/* if no thread was running, the function returns to the scheduler. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling routine */ +/* */ +/* CALLED BY */ +/* */ +/* FIQ ISR Interrupt Service Routines */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_fiq_context_restore .type _tx_thread_fiq_context_restore,function _tx_thread_fiq_context_restore: -@ -@ /* Lockout interrupts. */ -@ - CPSID if @ Disable IRQ and FIQ interrupts + + /* Lockout interrupts. */ + + CPSID if // Disable IRQ and FIQ interrupts #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR exit function to indicate an ISR is complete. */ -@ - BL _tx_execution_isr_exit @ Call the ISR exit function + + /* Call the ISR exit function to indicate an ISR is complete. */ + + BL _tx_execution_isr_exit // Call the ISR exit function #endif -@ -@ /* Determine if interrupts are nested. */ -@ if (--_tx_thread_system_state) -@ { -@ - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3] @ Pickup system state - SUB r2, r2, #1 @ Decrement the counter - STR r2, [r3] @ Store the counter - CMP r2, #0 @ Was this the first interrupt? - BEQ __tx_thread_fiq_not_nested_restore @ If so, not a nested restore -@ -@ /* Interrupts are nested. */ -@ -@ /* Just recover the saved registers and return to the point of -@ interrupt. */ -@ - LDMIA sp!, {r0, r10, r12, lr} @ Recover SPSR, POI, and scratch regs - MSR SPSR_cxsf, r0 @ Put SPSR back - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOVS pc, lr @ Return to point of interrupt -@ -@ } + + /* Determine if interrupts are nested. */ + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + SUB r2, r2, #1 // Decrement the counter + STR r2, [r3] // Store the counter + CMP r2, #0 // Was this the first interrupt? + BEQ __tx_thread_fiq_not_nested_restore // If so, not a nested restore + + /* Interrupts are nested. */ + + /* Just recover the saved registers and return to the point of + interrupt. */ + + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + __tx_thread_fiq_not_nested_restore: -@ -@ /* Determine if a thread was interrupted and no preemption is required. */ -@ else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr) -@ || (_tx_thread_preempt_disable)) -@ { -@ - LDR r1, [sp] @ Pickup the saved SPSR - MOV r2, #MODE_MASK @ Build mask to isolate the interrupted mode - AND r1, r1, r2 @ Isolate mode bits - CMP r1, #IRQ_MODE_BITS @ Was an interrupt taken in IRQ mode before we - @ got to context save? */ - BEQ __tx_thread_fiq_no_preempt_restore @ Yes, just go back to point of interrupt + + /* Determine if a thread was interrupted and no preemption is required. */ + + LDR r1, [sp] // Pickup the saved SPSR + MOV r2, #MODE_MASK // Build mask to isolate the interrupted mode + AND r1, r1, r2 // Isolate mode bits + CMP r1, #IRQ_MODE_BITS // Was an interrupt taken in IRQ mode before we + // got to context save? */ + BEQ __tx_thread_fiq_no_preempt_restore // Yes, just go back to point of interrupt - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup actual current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_fiq_idle_system_restore @ Yes, idle system was interrupted + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup actual current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_fiq_idle_system_restore // Yes, idle system was interrupted - LDR r3, =_tx_thread_preempt_disable @ Pickup preempt disable address - LDR r2, [r3] @ Pickup actual preempt disable flag - CMP r2, #0 @ Is it set? - BNE __tx_thread_fiq_no_preempt_restore @ Yes, don't preempt this thread - LDR r3, =_tx_thread_execute_ptr @ Pickup address of execute thread ptr - LDR r2, [r3] @ Pickup actual execute thread pointer - CMP r0, r2 @ Is the same thread highest priority? - BNE __tx_thread_fiq_preempt_restore @ No, preemption needs to happen + LDR r3, =_tx_thread_preempt_disable // Pickup preempt disable address + LDR r2, [r3] // Pickup actual preempt disable flag + CMP r2, #0 // Is it set? + BNE __tx_thread_fiq_no_preempt_restore // Yes, don't preempt this thread + LDR r3, =_tx_thread_execute_ptr // Pickup address of execute thread ptr + LDR r2, [r3] // Pickup actual execute thread pointer + CMP r0, r2 // Is the same thread highest priority? + BNE __tx_thread_fiq_preempt_restore // No, preemption needs to happen __tx_thread_fiq_no_preempt_restore: -@ -@ /* Restore interrupted thread or ISR. */ -@ -@ /* Pickup the saved stack pointer. */ -@ tmp_ptr = _tx_thread_current_ptr -> tx_thread_stack_ptr; -@ -@ /* Recover the saved context and return to the point of interrupt. */ -@ - LDMIA sp!, {r0, lr} @ Recover SPSR, POI, and scratch regs - MSR SPSR_cxsf, r0 @ Put SPSR back - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOVS pc, lr @ Return to point of interrupt -@ -@ } -@ else -@ { -__tx_thread_fiq_preempt_restore: -@ - LDMIA sp!, {r3, lr} @ Recover temporarily saved registers - MOV r1, lr @ Save lr (point of interrupt) - MOV r2, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r2 @ Enter SVC mode - STR r1, [sp, #-4]! @ Save point of interrupt - STMDB sp!, {r4-r12, lr} @ Save upper half of registers - MOV r4, r3 @ Save SPSR in r4 - MOV r2, #FIQ_MODE @ Build FIQ mode CPSR - MSR CPSR_c, r2 @ Reenter FIQ mode - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOV r5, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r5 @ Enter SVC mode - STMDB sp!, {r0-r3} @ Save r0-r3 on thread's stack - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup current thread pointer + /* Restore interrupted thread or ISR. */ + /* Recover the saved context and return to the point of interrupt. */ + + LDMIA sp!, {r0, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_fiq_preempt_restore: + + LDMIA sp!, {r3, lr} // Recover temporarily saved registers + MOV r1, lr // Save lr (point of interrupt) + MOV r2, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r2 // Enter SVC mode + STR r1, [sp, #-4]! // Save point of interrupt + STMDB sp!, {r4-r12, lr} // Save upper half of registers + MOV r4, r3 // Save SPSR in r4 + MOV r2, #FIQ_MODE // Build FIQ mode CPSR + MSR CPSR_c, r2 // Reenter FIQ mode + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOV r5, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r5 // Enter SVC mode + STMDB sp!, {r0-r3} // Save r0-r3 on thread's stack + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer #ifdef TX_ENABLE_VFP_SUPPORT - LDR r2, [r0, #144] @ Pickup the VFP enabled flag - CMP r2, #0 @ Is the VFP enabled? - BEQ _tx_skip_fiq_vfp_save @ No, skip VFP IRQ save - VMRS r2, FPSCR @ Pickup the FPSCR - STR r2, [sp, #-4]! @ Save FPSCR - VSTMDB sp!, {D16-D31} @ Save D16-D31 - VSTMDB sp!, {D0-D15} @ Save D0-D15 + LDR r2, [r0, #144] // Pickup the VFP enabled flag + CMP r2, #0 // Is the VFP enabled? + BEQ _tx_skip_fiq_vfp_save // No, skip VFP IRQ save + VMRS r2, FPSCR // Pickup the FPSCR + STR r2, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D0-D15} // Save D0-D15 _tx_skip_fiq_vfp_save: #endif - MOV r3, #1 @ Build interrupt stack type - STMDB sp!, {r3, r4} @ Save interrupt stack type and SPSR - STR sp, [r0, #8] @ Save stack pointer in thread control - @ block */ -@ -@ /* Save the remaining time-slice and disable it. */ -@ if (_tx_timer_time_slice) -@ { -@ - LDR r3, =_tx_timer_time_slice @ Pickup time-slice variable address - LDR r2, [r3] @ Pickup time-slice - CMP r2, #0 @ Is it active? - BEQ __tx_thread_fiq_dont_save_ts @ No, don't save it -@ -@ _tx_thread_current_ptr -> tx_thread_time_slice = _tx_timer_time_slice; -@ _tx_timer_time_slice = 0; -@ - STR r2, [r0, #24] @ Save thread's time-slice - MOV r2, #0 @ Clear value - STR r2, [r3] @ Disable global time-slice flag -@ -@ } -__tx_thread_fiq_dont_save_ts: -@ -@ -@ /* Clear the current task pointer. */ -@ _tx_thread_current_ptr = TX_NULL; -@ - MOV r0, #0 @ NULL value - STR r0, [r1] @ Clear current thread pointer -@ -@ /* Return to the scheduler. */ -@ _tx_thread_schedule(); -@ - B _tx_thread_schedule @ Return to scheduler -@ } -@ -__tx_thread_fiq_idle_system_restore: -@ -@ /* Just return back to the scheduler! */ -@ - ADD sp, sp, #24 @ Recover FIQ stack space - MOV r3, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r3 @ Lockout interrupts - B _tx_thread_schedule @ Return to scheduler -@ -@} + MOV r3, #1 // Build interrupt stack type + STMDB sp!, {r3, r4} // Save interrupt stack type and SPSR + STR sp, [r0, #8] // Save stack pointer in thread control + // block */ + LDR r3, =_tx_timer_time_slice // Pickup time-slice variable address + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it active? + BEQ __tx_thread_fiq_dont_save_ts // No, don't save it + + STR r2, [r0, #24] // Save thread's time-slice + MOV r2, #0 // Clear value + STR r2, [r3] // Disable global time-slice flag + +__tx_thread_fiq_dont_save_ts: + + /* Clear the current task pointer. */ + + MOV r0, #0 // NULL value + STR r0, [r1] // Clear current thread pointer + + /* Return to the scheduler. */ + + B _tx_thread_schedule // Return to scheduler + +__tx_thread_fiq_idle_system_restore: + + /* Just return back to the scheduler! */ + + ADD sp, sp, #24 // Recover FIQ stack space + MOV r3, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r3 // Lockout interrupts + B _tx_thread_schedule // Return to scheduler diff --git a/ports/cortex_a7/ac6/src/tx_thread_fiq_context_save.S b/ports/cortex_a7/ac6/src/tx_thread_fiq_context_save.S index 376fa33e..7db6a4c2 100644 --- a/ports/cortex_a7/ac6/src/tx_thread_fiq_context_save.S +++ b/ports/cortex_a7/ac6/src/tx_thread_fiq_context_save.S @@ -1,206 +1,178 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .global _tx_thread_system_state .global _tx_thread_current_ptr .global __tx_fiq_processing_return -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_save -@ since it will never be called 16-bit mode. */ -@ + .global _tx_execution_isr_enter + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_save + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_fiq_context_save Cortex-A7/AC6 */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function saves the context of an executing thread in the */ -@/* beginning of interrupt processing. The function also ensures that */ -@/* the system stack is used upon return to the calling ISR. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@ VOID _tx_thread_fiq_context_save(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_fiq_context_save .type _tx_thread_fiq_context_save,function _tx_thread_fiq_context_save: -@ -@ /* Upon entry to this routine, it is assumed that IRQ interrupts are locked -@ out, we are in IRQ mode, and all registers are intact. */ -@ -@ /* Check for a nested interrupt condition. */ -@ if (_tx_thread_system_state++) -@ { -@ - STMDB sp!, {r0-r3} @ Save some working registers - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3] @ Pickup system state - CMP r2, #0 @ Is this the first interrupt? - BEQ __tx_thread_fiq_not_nested_save @ Yes, not a nested context save -@ -@ /* Nested interrupt condition. */ -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3] @ Store it back in the variable -@ -@ /* Save the rest of the scratch registers on the stack and return to the -@ calling ISR. */ -@ - MRS r0, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r0, r10, r12, lr} @ Store other registers -@ -@ /* Return to the ISR. */ -@ - MOV r10, #0 @ Clear stack limit + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + + STMDB sp!, {r0-r3} // Save some working registers + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_fiq_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + + /* Save the rest of the scratch registers on the stack and return to the + calling ISR. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, r10, r12, lr} // Store other registers + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - B __tx_fiq_processing_return @ Continue FIQ processing -@ + B __tx_fiq_processing_return // Continue FIQ processing +// __tx_thread_fiq_not_nested_save: -@ } -@ -@ /* Otherwise, not nested, check to see if a thread was running. */ -@ else if (_tx_thread_current_ptr) -@ { -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3] @ Store it back in the variable - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_fiq_idle_system_save @ If so, interrupt occurred in -@ @ scheduling loop - nothing needs saving! -@ -@ /* Save minimal context of interrupted thread. */ -@ - MRS r2, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r2, lr} @ Store other registers, Note that we don't -@ @ need to save sl and ip since FIQ has -@ @ copies of these registers. Nested -@ @ interrupt processing does need to save -@ @ these registers. -@ -@ /* Save the current stack pointer in the thread's control block. */ -@ _tx_thread_current_ptr -> tx_thread_stack_ptr = sp; -@ -@ /* Switch to the system stack. */ -@ sp = _tx_thread_system_stack_ptr; -@ - MOV r10, #0 @ Clear stack limit + + /* Otherwise, not nested, check to see if a thread was running. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_fiq_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + + /* Save minimal context of interrupted thread. */ + + MRS r2, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r2, lr} // Store other registers, Note that we don't + // need to save sl and ip since FIQ has + // copies of these registers. Nested + // interrupt processing does need to save + // these registers. + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - B __tx_fiq_processing_return @ Continue FIQ processing -@ -@ } -@ else -@ { -@ + B __tx_fiq_processing_return // Continue FIQ processing + __tx_thread_fiq_idle_system_save: -@ -@ /* Interrupt occurred in the scheduling loop. */ -@ -#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr -#endif -@ -@ /* Not much to do here, save the current SPSR and LR for possible -@ use in IRQ interrupted in idle system conditions, and return to -@ FIQ interrupt processing. */ -@ - MRS r0, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r0, lr} @ Store other registers that will get used -@ @ or stripped off the stack in context -@ @ restore - B __tx_fiq_processing_return @ Continue FIQ processing -@ -@ } -@} + /* Interrupt occurred in the scheduling loop. */ + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + /* Not much to do here, save the current SPSR and LR for possible + use in IRQ interrupted in idle system conditions, and return to + FIQ interrupt processing. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, lr} // Store other registers that will get used + // or stripped off the stack in context + // restore + B __tx_fiq_processing_return // Continue FIQ processing diff --git a/ports/cortex_a7/ac6/src/tx_thread_fiq_nesting_end.S b/ports/cortex_a7/ac6/src/tx_thread_fiq_nesting_end.S index 505a4878..b34d881e 100644 --- a/ports/cortex_a7/ac6/src/tx_thread_fiq_nesting_end.S +++ b/ports/cortex_a7/ac6/src/tx_thread_fiq_nesting_end.S @@ -1,116 +1,104 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + #ifdef TX_ENABLE_FIQ_SUPPORT -DISABLE_INTS = 0xC0 @ Disable IRQ/FIQ interrupts +DISABLE_INTS = 0xC0 // Disable IRQ/FIQ interrupts #else -DISABLE_INTS = 0x80 @ Disable IRQ interrupts +DISABLE_INTS = 0x80 // Disable IRQ interrupts #endif -MODE_MASK = 0x1F @ Mode mask -FIQ_MODE_BITS = 0x11 @ FIQ mode bits -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_end -@ since it will never be called 16-bit mode. */ -@ +MODE_MASK = 0x1F // Mode mask +FIQ_MODE_BITS = 0x11 // FIQ mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_end + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_fiq_nesting_end Cortex-A7/AC6 */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is called by the application from FIQ mode after */ -@/* _tx_thread_fiq_nesting_start has been called and switches the FIQ */ -@/* processing from system mode back to FIQ mode prior to the ISR */ -@/* calling _tx_thread_fiq_context_restore. Note that this function */ -@/* assumes the system stack pointer is in the same position after */ -@/* nesting start function was called. */ -@/* */ -@/* This function assumes that the system mode stack pointer was setup */ -@/* during low-level initialization (tx_initialize_low_level.s). */ -@/* */ -@/* This function returns with FIQ interrupts disabled. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_fiq_nesting_end(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_nesting_end ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from FIQ mode after */ +/* _tx_thread_fiq_nesting_start has been called and switches the FIQ */ +/* processing from system mode back to FIQ mode prior to the ISR */ +/* calling _tx_thread_fiq_context_restore. Note that this function */ +/* assumes the system stack pointer is in the same position after */ +/* nesting start function was called. */ +/* */ +/* This function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with FIQ interrupts disabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_fiq_nesting_end .type _tx_thread_fiq_nesting_end,function _tx_thread_fiq_nesting_end: - MOV r3,lr @ Save ISR return address - MRS r0, CPSR @ Pickup the CPSR - ORR r0, r0, #DISABLE_INTS @ Build disable interrupt value - MSR CPSR_c, r0 @ Disable interrupts - LDMIA sp!, {r1, lr} @ Pickup saved lr (and r1 throw-away for - @ 8-byte alignment logic) - BIC r0, r0, #MODE_MASK @ Clear mode bits - ORR r0, r0, #FIQ_MODE_BITS @ Build IRQ mode CPSR - MSR CPSR_c, r0 @ Reenter IRQ mode + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + ORR r0, r0, #DISABLE_INTS // Build disable interrupt value + MSR CPSR_c, r0 // Disable interrupts + LDMIA sp!, {r1, lr} // Pickup saved lr (and r1 throw-away for + // 8-byte alignment logic) + BIC r0, r0, #MODE_MASK // Clear mode bits + ORR r0, r0, #FIQ_MODE_BITS // Build IRQ mode CPSR + MSR CPSR_c, r0 // Reenter IRQ mode #ifdef __THUMB_INTERWORK - BX r3 @ Return to caller + BX r3 // Return to caller #else - MOV pc, r3 @ Return to caller + MOV pc, r3 // Return to caller #endif -@} - diff --git a/ports/cortex_a7/ac6/src/tx_thread_fiq_nesting_start.S b/ports/cortex_a7/ac6/src/tx_thread_fiq_nesting_start.S index 43754d60..c9cd5a06 100644 --- a/ports/cortex_a7/ac6/src/tx_thread_fiq_nesting_start.S +++ b/ports/cortex_a7/ac6/src/tx_thread_fiq_nesting_start.S @@ -1,108 +1,96 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ -FIQ_DISABLE = 0x40 @ FIQ disable bit -MODE_MASK = 0x1F @ Mode mask -SYS_MODE_BITS = 0x1F @ System mode bits -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_start -@ since it will never be called 16-bit mode. */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +FIQ_DISABLE = 0x40 // FIQ disable bit +MODE_MASK = 0x1F // Mode mask +SYS_MODE_BITS = 0x1F // System mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_start + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_fiq_nesting_start Cortex-A7/AC6 */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is called by the application from FIQ mode after */ -@/* _tx_thread_fiq_context_save has been called and switches the FIQ */ -@/* processing to the system mode so nested FIQ interrupt processing */ -@/* is possible (system mode has its own "lr" register). Note that */ -@/* this function assumes that the system mode stack pointer was setup */ -@/* during low-level initialization (tx_initialize_low_level.s). */ -@/* */ -@/* This function returns with FIQ interrupts enabled. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_fiq_nesting_start(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_nesting_start ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from FIQ mode after */ +/* _tx_thread_fiq_context_save has been called and switches the FIQ */ +/* processing to the system mode so nested FIQ interrupt processing */ +/* is possible (system mode has its own "lr" register). Note that */ +/* this function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with FIQ interrupts enabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_fiq_nesting_start .type _tx_thread_fiq_nesting_start,function _tx_thread_fiq_nesting_start: - MOV r3,lr @ Save ISR return address - MRS r0, CPSR @ Pickup the CPSR - BIC r0, r0, #MODE_MASK @ Clear the mode bits - ORR r0, r0, #SYS_MODE_BITS @ Build system mode CPSR - MSR CPSR_c, r0 @ Enter system mode - STMDB sp!, {r1, lr} @ Push the system mode lr on the system mode stack - @ and push r1 just to keep 8-byte alignment - BIC r0, r0, #FIQ_DISABLE @ Build enable FIQ CPSR - MSR CPSR_c, r0 @ Enter system mode + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + BIC r0, r0, #MODE_MASK // Clear the mode bits + ORR r0, r0, #SYS_MODE_BITS // Build system mode CPSR + MSR CPSR_c, r0 // Enter system mode + STMDB sp!, {r1, lr} // Push the system mode lr on the system mode stack + // and push r1 just to keep 8-byte alignment + BIC r0, r0, #FIQ_DISABLE // Build enable FIQ CPSR + MSR CPSR_c, r0 // Enter system mode #ifdef __THUMB_INTERWORK - BX r3 @ Return to caller + BX r3 // Return to caller #else - MOV pc, r3 @ Return to caller + MOV pc, r3 // Return to caller #endif -@} - diff --git a/ports/cortex_a7/ac6/src/tx_thread_interrupt_control.S b/ports/cortex_a7/ac6/src/tx_thread_interrupt_control.S index 94d09fcd..63b1609a 100644 --- a/ports/cortex_a7/ac6/src/tx_thread_interrupt_control.S +++ b/ports/cortex_a7/ac6/src/tx_thread_interrupt_control.S @@ -1,115 +1,104 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ INT_MASK = 0x03F -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_control for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_control for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_interrupt_control $_tx_thread_interrupt_control: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_interrupt_control @ Call _tx_thread_interrupt_control function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_control // Call _tx_thread_interrupt_control function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_interrupt_control Cortex-A7/AC6 */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is responsible for changing the interrupt lockout */ -@/* posture of the system. */ -@/* */ -@/* INPUT */ -@/* */ -@/* new_posture New interrupt lockout posture */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* old_posture Old interrupt lockout posture */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* Application Code */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@UINT _tx_thread_interrupt_control(UINT new_posture) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_control ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for changing the interrupt lockout */ +/* posture of the system. */ +/* */ +/* INPUT */ +/* */ +/* new_posture New interrupt lockout posture */ +/* */ +/* OUTPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_interrupt_control .type _tx_thread_interrupt_control,function _tx_thread_interrupt_control: -@ -@ /* Pickup current interrupt lockout posture. */ -@ - MRS r3, CPSR @ Pickup current CPSR - MOV r2, #INT_MASK @ Build interrupt mask - AND r1, r3, r2 @ Clear interrupt lockout bits - ORR r1, r1, r0 @ Or-in new interrupt lockout bits -@ -@ /* Apply the new interrupt posture. */ -@ - MSR CPSR_c, r1 @ Setup new CPSR - BIC r0, r3, r2 @ Return previous interrupt mask -#ifdef __THUMB_INTERWORK - BX lr @ Return to caller -#else - MOV pc, lr @ Return to caller -#endif -@} + /* Pickup current interrupt lockout posture. */ + + MRS r3, CPSR // Pickup current CPSR + MOV r2, #INT_MASK // Build interrupt mask + AND r1, r3, r2 // Clear interrupt lockout bits + ORR r1, r1, r0 // Or-in new interrupt lockout bits + + /* Apply the new interrupt posture. */ + + MSR CPSR_c, r1 // Setup new CPSR + BIC r0, r3, r2 // Return previous interrupt mask +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a7/ac6/src/tx_thread_interrupt_disable.S b/ports/cortex_a7/ac6/src/tx_thread_interrupt_disable.S index bf82e314..13258808 100644 --- a/ports/cortex_a7/ac6/src/tx_thread_interrupt_disable.S +++ b/ports/cortex_a7/ac6/src/tx_thread_interrupt_disable.S @@ -1,113 +1,101 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_disable for -@ applications calling this function from to 16-bit Thumb mode. */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_disable for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_interrupt_disable $_tx_thread_interrupt_disable: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_interrupt_disable @ Call _tx_thread_interrupt_disable function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_disable // Call _tx_thread_interrupt_disable function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_interrupt_disable Cortex-A7/AC6 */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is responsible for disabling interrupts */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* old_posture Old interrupt lockout posture */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* Application Code */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@UINT _tx_thread_interrupt_disable(void) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_disable ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for disabling interrupts */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_interrupt_disable .type _tx_thread_interrupt_disable,function _tx_thread_interrupt_disable: -@ -@ /* Pickup current interrupt lockout posture. */ -@ - MRS r0, CPSR @ Pickup current CPSR -@ -@ /* Mask interrupts. */ -@ + + /* Pickup current interrupt lockout posture. */ + + MRS r0, CPSR // Pickup current CPSR + + /* Mask interrupts. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ + CPSID if // Disable IRQ and FIQ #else - CPSID i @ Disable IRQ + CPSID i // Disable IRQ #endif #ifdef __THUMB_INTERWORK - BX lr @ Return to caller + BX lr // Return to caller #else - MOV pc, lr @ Return to caller + MOV pc, lr // Return to caller #endif -@} - - diff --git a/ports/cortex_a7/ac6/src/tx_thread_interrupt_restore.S b/ports/cortex_a7/ac6/src/tx_thread_interrupt_restore.S index 2f402e34..2d582511 100644 --- a/ports/cortex_a7/ac6/src/tx_thread_interrupt_restore.S +++ b/ports/cortex_a7/ac6/src/tx_thread_interrupt_restore.S @@ -1,104 +1,93 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_restore for -@ applications calling this function from to 16-bit Thumb mode. */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_restore for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_interrupt_restore $_tx_thread_interrupt_restore: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_interrupt_restore @ Call _tx_thread_interrupt_restore function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_restore // Call _tx_thread_interrupt_restore function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_interrupt_restore Cortex-A7/AC6 */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is responsible for restoring interrupts to the state */ -@/* returned by a previous _tx_thread_interrupt_disable call. */ -@/* */ -@/* INPUT */ -@/* */ -@/* old_posture Old interrupt lockout posture */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* Application Code */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@UINT _tx_thread_interrupt_restore(UINT old_posture) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for restoring interrupts to the state */ +/* returned by a previous _tx_thread_interrupt_disable call. */ +/* */ +/* INPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_interrupt_restore .type _tx_thread_interrupt_restore,function _tx_thread_interrupt_restore: -@ -@ /* Apply the new interrupt posture. */ -@ - MSR CPSR_c, r0 @ Setup new CPSR -#ifdef __THUMB_INTERWORK - BX lr @ Return to caller -#else - MOV pc, lr @ Return to caller -#endif -@} + /* Apply the new interrupt posture. */ + + MSR CPSR_c, r0 // Setup new CPSR +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a7/ac6/src/tx_thread_irq_nesting_end.S b/ports/cortex_a7/ac6/src/tx_thread_irq_nesting_end.S index 0081073b..ec7e63c6 100644 --- a/ports/cortex_a7/ac6/src/tx_thread_irq_nesting_end.S +++ b/ports/cortex_a7/ac6/src/tx_thread_irq_nesting_end.S @@ -1,115 +1,103 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + #ifdef TX_ENABLE_FIQ_SUPPORT -DISABLE_INTS = 0xC0 @ Disable IRQ/FIQ interrupts +DISABLE_INTS = 0xC0 // Disable IRQ/FIQ interrupts #else -DISABLE_INTS = 0x80 @ Disable IRQ interrupts +DISABLE_INTS = 0x80 // Disable IRQ interrupts #endif -MODE_MASK = 0x1F @ Mode mask -IRQ_MODE_BITS = 0x12 @ IRQ mode bits -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_end -@ since it will never be called 16-bit mode. */ -@ +MODE_MASK = 0x1F // Mode mask +IRQ_MODE_BITS = 0x12 // IRQ mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_end + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_irq_nesting_end Cortex-A7/AC6 */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is called by the application from IRQ mode after */ -@/* _tx_thread_irq_nesting_start has been called and switches the IRQ */ -@/* processing from system mode back to IRQ mode prior to the ISR */ -@/* calling _tx_thread_context_restore. Note that this function */ -@/* assumes the system stack pointer is in the same position after */ -@/* nesting start function was called. */ -@/* */ -@/* This function assumes that the system mode stack pointer was setup */ -@/* during low-level initialization (tx_initialize_low_level.s). */ -@/* */ -@/* This function returns with IRQ interrupts disabled. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_irq_nesting_end(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_irq_nesting_end ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from IRQ mode after */ +/* _tx_thread_irq_nesting_start has been called and switches the IRQ */ +/* processing from system mode back to IRQ mode prior to the ISR */ +/* calling _tx_thread_context_restore. Note that this function */ +/* assumes the system stack pointer is in the same position after */ +/* nesting start function was called. */ +/* */ +/* This function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with IRQ interrupts disabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_irq_nesting_end .type _tx_thread_irq_nesting_end,function _tx_thread_irq_nesting_end: - MOV r3,lr @ Save ISR return address - MRS r0, CPSR @ Pickup the CPSR - ORR r0, r0, #DISABLE_INTS @ Build disable interrupt value - MSR CPSR_c, r0 @ Disable interrupts - LDMIA sp!, {r1, lr} @ Pickup saved lr (and r1 throw-away for - @ 8-byte alignment logic) - BIC r0, r0, #MODE_MASK @ Clear mode bits - ORR r0, r0, #IRQ_MODE_BITS @ Build IRQ mode CPSR - MSR CPSR_c, r0 @ Reenter IRQ mode + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + ORR r0, r0, #DISABLE_INTS // Build disable interrupt value + MSR CPSR_c, r0 // Disable interrupts + LDMIA sp!, {r1, lr} // Pickup saved lr (and r1 throw-away for + // 8-byte alignment logic) + BIC r0, r0, #MODE_MASK // Clear mode bits + ORR r0, r0, #IRQ_MODE_BITS // Build IRQ mode CPSR + MSR CPSR_c, r0 // Reenter IRQ mode #ifdef __THUMB_INTERWORK - BX r3 @ Return to caller + BX r3 // Return to caller #else - MOV pc, r3 @ Return to caller + MOV pc, r3 // Return to caller #endif -@} - diff --git a/ports/cortex_a7/ac6/src/tx_thread_irq_nesting_start.S b/ports/cortex_a7/ac6/src/tx_thread_irq_nesting_start.S index ef976b80..c69976ed 100644 --- a/ports/cortex_a7/ac6/src/tx_thread_irq_nesting_start.S +++ b/ports/cortex_a7/ac6/src/tx_thread_irq_nesting_start.S @@ -1,108 +1,96 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ -IRQ_DISABLE = 0x80 @ IRQ disable bit -MODE_MASK = 0x1F @ Mode mask -SYS_MODE_BITS = 0x1F @ System mode bits -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_start -@ since it will never be called 16-bit mode. */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +IRQ_DISABLE = 0x80 // IRQ disable bit +MODE_MASK = 0x1F // Mode mask +SYS_MODE_BITS = 0x1F // System mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_start + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_irq_nesting_start Cortex-A7/AC6 */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is called by the application from IRQ mode after */ -@/* _tx_thread_context_save has been called and switches the IRQ */ -@/* processing to the system mode so nested IRQ interrupt processing */ -@/* is possible (system mode has its own "lr" register). Note that */ -@/* this function assumes that the system mode stack pointer was setup */ -@/* during low-level initialization (tx_initialize_low_level.s). */ -@/* */ -@/* This function returns with IRQ interrupts enabled. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_irq_nesting_start(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_irq_nesting_start ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from IRQ mode after */ +/* _tx_thread_context_save has been called and switches the IRQ */ +/* processing to the system mode so nested IRQ interrupt processing */ +/* is possible (system mode has its own "lr" register). Note that */ +/* this function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with IRQ interrupts enabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_irq_nesting_start .type _tx_thread_irq_nesting_start,function _tx_thread_irq_nesting_start: - MOV r3,lr @ Save ISR return address - MRS r0, CPSR @ Pickup the CPSR - BIC r0, r0, #MODE_MASK @ Clear the mode bits - ORR r0, r0, #SYS_MODE_BITS @ Build system mode CPSR - MSR CPSR_c, r0 @ Enter system mode - STMDB sp!, {r1, lr} @ Push the system mode lr on the system mode stack - @ and push r1 just to keep 8-byte alignment - BIC r0, r0, #IRQ_DISABLE @ Build enable IRQ CPSR - MSR CPSR_c, r0 @ Enter system mode + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + BIC r0, r0, #MODE_MASK // Clear the mode bits + ORR r0, r0, #SYS_MODE_BITS // Build system mode CPSR + MSR CPSR_c, r0 // Enter system mode + STMDB sp!, {r1, lr} // Push the system mode lr on the system mode stack + // and push r1 just to keep 8-byte alignment + BIC r0, r0, #IRQ_DISABLE // Build enable IRQ CPSR + MSR CPSR_c, r0 // Enter system mode #ifdef __THUMB_INTERWORK - BX r3 @ Return to caller + BX r3 // Return to caller #else - MOV pc, r3 @ Return to caller + MOV pc, r3 // Return to caller #endif -@} - diff --git a/ports/cortex_a7/ac6/src/tx_thread_schedule.S b/ports/cortex_a7/ac6/src/tx_thread_schedule.S index 085ee47a..8330e9df 100644 --- a/ports/cortex_a7/ac6/src/tx_thread_schedule.S +++ b/ports/cortex_a7/ac6/src/tx_thread_schedule.S @@ -1,257 +1,230 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .global _tx_thread_execute_ptr .global _tx_thread_current_ptr .global _tx_timer_time_slice -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_schedule for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_schedule for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_schedule .type $_tx_thread_schedule,function $_tx_thread_schedule: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_schedule @ Call _tx_thread_schedule function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_schedule // Call _tx_thread_schedule function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_schedule Cortex-A7/AC6 */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function waits for a thread control block pointer to appear in */ -@/* the _tx_thread_execute_ptr variable. Once a thread pointer appears */ -@/* in the variable, the corresponding thread is resumed. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* _tx_initialize_kernel_enter ThreadX entry function */ -@/* _tx_thread_system_return Return to system from thread */ -@/* _tx_thread_context_restore Restore thread's context */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_schedule(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_schedule ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function waits for a thread control block pointer to appear in */ +/* the _tx_thread_execute_ptr variable. Once a thread pointer appears */ +/* in the variable, the corresponding thread is resumed. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_initialize_kernel_enter ThreadX entry function */ +/* _tx_thread_system_return Return to system from thread */ +/* _tx_thread_context_restore Restore thread's context */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_schedule .type _tx_thread_schedule,function _tx_thread_schedule: -@ -@ /* Enable interrupts. */ -@ + + /* Enable interrupts. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSIE if @ Enable IRQ and FIQ interrupts + CPSIE if // Enable IRQ and FIQ interrupts #else - CPSIE i @ Enable IRQ interrupts + CPSIE i // Enable IRQ interrupts #endif -@ -@ /* Wait for a thread to execute. */ -@ do -@ { - LDR r1, =_tx_thread_execute_ptr @ Address of thread execute ptr -@ + + /* Wait for a thread to execute. */ + LDR r1, =_tx_thread_execute_ptr // Address of thread execute ptr + __tx_thread_schedule_loop: -@ - LDR r0, [r1] @ Pickup next thread to execute - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_schedule_loop @ If so, keep looking for a thread -@ -@ } -@ while(_tx_thread_execute_ptr == TX_NULL); -@ -@ /* Yes! We have a thread to execute. Lockout interrupts and -@ transfer control to it. */ -@ + + LDR r0, [r1] // Pickup next thread to execute + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_schedule_loop // If so, keep looking for a thread + /* Yes! We have a thread to execute. Lockout interrupts and + transfer control to it. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ interrupts + CPSID if // Disable IRQ and FIQ interrupts #else - CPSID i @ Disable IRQ interrupts + CPSID i // Disable IRQ interrupts #endif -@ -@ /* Setup the current thread pointer. */ -@ _tx_thread_current_ptr = _tx_thread_execute_ptr; -@ - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread - STR r0, [r1] @ Setup current thread pointer -@ -@ /* Increment the run count for this thread. */ -@ _tx_thread_current_ptr -> tx_thread_run_count++; -@ - LDR r2, [r0, #4] @ Pickup run counter - LDR r3, [r0, #24] @ Pickup time-slice for this thread - ADD r2, r2, #1 @ Increment thread run-counter - STR r2, [r0, #4] @ Store the new run counter -@ -@ /* Setup time-slice, if present. */ -@ _tx_timer_time_slice = _tx_thread_current_ptr -> tx_thread_time_slice; -@ - LDR r2, =_tx_timer_time_slice @ Pickup address of time-slice - @ variable - LDR sp, [r0, #8] @ Switch stack pointers - STR r3, [r2] @ Setup time-slice -@ -@ /* Switch to the thread's stack. */ -@ sp = _tx_thread_execute_ptr -> tx_thread_stack_ptr; -@ + + /* Setup the current thread pointer. */ + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread + STR r0, [r1] // Setup current thread pointer + + /* Increment the run count for this thread. */ + + LDR r2, [r0, #4] // Pickup run counter + LDR r3, [r0, #24] // Pickup time-slice for this thread + ADD r2, r2, #1 // Increment thread run-counter + STR r2, [r0, #4] // Store the new run counter + + /* Setup time-slice, if present. */ + + LDR r2, =_tx_timer_time_slice // Pickup address of time-slice + // variable + LDR sp, [r0, #8] // Switch stack pointers + STR r3, [r2] // Setup time-slice + #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the thread entry function to indicate the thread is executing. */ -@ - MOV r5, r0 @ Save r0 - BL _tx_execution_thread_enter @ Call the thread execution enter function - MOV r0, r5 @ Restore r0 + + /* Call the thread entry function to indicate the thread is executing. */ + + MOV r5, r0 // Save r0 + BL _tx_execution_thread_enter // Call the thread execution enter function + MOV r0, r5 // Restore r0 #endif -@ -@ /* Determine if an interrupt frame or a synchronous task suspension frame -@ is present. */ -@ - LDMIA sp!, {r4, r5} @ Pickup the stack type and saved CPSR - CMP r4, #0 @ Check for synchronous context switch + + /* Determine if an interrupt frame or a synchronous task suspension frame + is present. */ + + LDMIA sp!, {r4, r5} // Pickup the stack type and saved CPSR + CMP r4, #0 // Check for synchronous context switch BEQ _tx_solicited_return - MSR SPSR_cxsf, r5 @ Setup SPSR for return + MSR SPSR_cxsf, r5 // Setup SPSR for return #ifdef TX_ENABLE_VFP_SUPPORT - LDR r1, [r0, #144] @ Pickup the VFP enabled flag - CMP r1, #0 @ Is the VFP enabled? - BEQ _tx_skip_interrupt_vfp_restore @ No, skip VFP interrupt restore - VLDMIA sp!, {D0-D15} @ Recover D0-D15 - VLDMIA sp!, {D16-D31} @ Recover D16-D31 - LDR r4, [sp], #4 @ Pickup FPSCR - VMSR FPSCR, r4 @ Restore FPSCR + LDR r1, [r0, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_interrupt_vfp_restore // No, skip VFP interrupt restore + VLDMIA sp!, {D0-D15} // Recover D0-D15 + VLDMIA sp!, {D16-D31} // Recover D16-D31 + LDR r4, [sp], #4 // Pickup FPSCR + VMSR FPSCR, r4 // Restore FPSCR _tx_skip_interrupt_vfp_restore: #endif - LDMIA sp!, {r0-r12, lr, pc}^ @ Return to point of thread interrupt + LDMIA sp!, {r0-r12, lr, pc}^ // Return to point of thread interrupt _tx_solicited_return: #ifdef TX_ENABLE_VFP_SUPPORT - LDR r1, [r0, #144] @ Pickup the VFP enabled flag - CMP r1, #0 @ Is the VFP enabled? - BEQ _tx_skip_solicited_vfp_restore @ No, skip VFP solicited restore - VLDMIA sp!, {D8-D15} @ Recover D8-D15 - VLDMIA sp!, {D16-D31} @ Recover D16-D31 - LDR r4, [sp], #4 @ Pickup FPSCR - VMSR FPSCR, r4 @ Restore FPSCR + LDR r1, [r0, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_solicited_vfp_restore // No, skip VFP solicited restore + VLDMIA sp!, {D8-D15} // Recover D8-D15 + VLDMIA sp!, {D16-D31} // Recover D16-D31 + LDR r4, [sp], #4 // Pickup FPSCR + VMSR FPSCR, r4 // Restore FPSCR _tx_skip_solicited_vfp_restore: #endif - MSR CPSR_cxsf, r5 @ Recover CPSR - LDMIA sp!, {r4-r11, lr} @ Return to thread synchronously + MSR CPSR_cxsf, r5 // Recover CPSR + LDMIA sp!, {r4-r11, lr} // Return to thread synchronously #ifdef __THUMB_INTERWORK - BX lr @ Return to caller + BX lr // Return to caller #else - MOV pc, lr @ Return to caller + MOV pc, lr // Return to caller #endif -@ -@} -@ #ifdef TX_ENABLE_VFP_SUPPORT .global tx_thread_vfp_enable .type tx_thread_vfp_enable,function tx_thread_vfp_enable: - MRS r2, CPSR @ Pickup the CPSR + MRS r2, CPSR // Pickup the CPSR #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Enable IRQ and FIQ interrupts + CPSID if // Enable IRQ and FIQ interrupts #else - CPSID i @ Enable IRQ interrupts + CPSID i // Enable IRQ interrupts #endif - LDR r0, =_tx_thread_current_ptr @ Build current thread pointer address - LDR r1, [r0] @ Pickup current thread pointer - CMP r1, #0 @ Check for NULL thread pointer - BEQ __tx_no_thread_to_enable @ If NULL, skip VFP enable - MOV r0, #1 @ Build enable value - STR r0, [r1, #144] @ Set the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) + LDR r0, =_tx_thread_current_ptr // Build current thread pointer address + LDR r1, [r0] // Pickup current thread pointer + CMP r1, #0 // Check for NULL thread pointer + BEQ __tx_no_thread_to_enable // If NULL, skip VFP enable + MOV r0, #1 // Build enable value + STR r0, [r1, #144] // Set the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) __tx_no_thread_to_enable: - MSR CPSR_cxsf, r2 @ Recover CPSR - BX LR @ Return to caller + MSR CPSR_cxsf, r2 // Recover CPSR + BX LR // Return to caller .global tx_thread_vfp_disable .type tx_thread_vfp_disable,function tx_thread_vfp_disable: - MRS r2, CPSR @ Pickup the CPSR + MRS r2, CPSR // Pickup the CPSR #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Enable IRQ and FIQ interrupts + CPSID if // Enable IRQ and FIQ interrupts #else - CPSID i @ Enable IRQ interrupts + CPSID i // Enable IRQ interrupts #endif - LDR r0, =_tx_thread_current_ptr @ Build current thread pointer address - LDR r1, [r0] @ Pickup current thread pointer - CMP r1, #0 @ Check for NULL thread pointer - BEQ __tx_no_thread_to_disable @ If NULL, skip VFP disable - MOV r0, #0 @ Build disable value - STR r0, [r1, #144] @ Clear the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) + LDR r0, =_tx_thread_current_ptr // Build current thread pointer address + LDR r1, [r0] // Pickup current thread pointer + CMP r1, #0 // Check for NULL thread pointer + BEQ __tx_no_thread_to_disable // If NULL, skip VFP disable + MOV r0, #0 // Build disable value + STR r0, [r1, #144] // Clear the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) __tx_no_thread_to_disable: - MSR CPSR_cxsf, r2 @ Recover CPSR - BX LR @ Return to caller + MSR CPSR_cxsf, r2 // Recover CPSR + BX LR // Return to caller #endif - diff --git a/ports/cortex_a7/ac6/src/tx_thread_stack_build.S b/ports/cortex_a7/ac6/src/tx_thread_stack_build.S index 8598428e..f413e673 100644 --- a/ports/cortex_a7/ac6/src/tx_thread_stack_build.S +++ b/ports/cortex_a7/ac6/src/tx_thread_stack_build.S @@ -1,178 +1,164 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ .arm -SVC_MODE = 0x13 @ SVC mode +SVC_MODE = 0x13 // SVC mode #ifdef TX_ENABLE_FIQ_SUPPORT -CPSR_MASK = 0xDF @ Mask initial CPSR, IRQ & FIQ interrupts enabled +CPSR_MASK = 0xDF // Mask initial CPSR, IRQ & FIQ interrupts enabled #else -CPSR_MASK = 0x9F @ Mask initial CPSR, IRQ interrupts enabled +CPSR_MASK = 0x9F // Mask initial CPSR, IRQ interrupts enabled #endif -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_stack_build for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_stack_build for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .thumb .global $_tx_thread_stack_build .type $_tx_thread_stack_build,function $_tx_thread_stack_build: - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_stack_build @ Call _tx_thread_stack_build function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_stack_build // Call _tx_thread_stack_build function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_stack_build Cortex-A7/AC6 */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function builds a stack frame on the supplied thread's stack. */ -@/* The stack frame results in a fake interrupt return to the supplied */ -@/* function pointer. */ -@/* */ -@/* INPUT */ -@/* */ -@/* thread_ptr Pointer to thread control blk */ -@/* function_ptr Pointer to return function */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* _tx_thread_create Create thread service */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_stack_build(TX_THREAD *thread_ptr, VOID (*function_ptr)(VOID)) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_stack_build ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function builds a stack frame on the supplied thread's stack. */ +/* The stack frame results in a fake interrupt return to the supplied */ +/* function pointer. */ +/* */ +/* INPUT */ +/* */ +/* thread_ptr Pointer to thread control blk */ +/* function_ptr Pointer to return function */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_thread_create Create thread service */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_stack_build .type _tx_thread_stack_build,function _tx_thread_stack_build: -@ -@ -@ /* Build a fake interrupt frame. The form of the fake interrupt stack -@ on the Cortex-A7 should look like the following after it is built: -@ -@ Stack Top: 1 Interrupt stack frame type -@ CPSR Initial value for CPSR -@ a1 (r0) Initial value for a1 -@ a2 (r1) Initial value for a2 -@ a3 (r2) Initial value for a3 -@ a4 (r3) Initial value for a4 -@ v1 (r4) Initial value for v1 -@ v2 (r5) Initial value for v2 -@ v3 (r6) Initial value for v3 -@ v4 (r7) Initial value for v4 -@ v5 (r8) Initial value for v5 -@ sb (r9) Initial value for sb -@ sl (r10) Initial value for sl -@ fp (r11) Initial value for fp -@ ip (r12) Initial value for ip -@ lr (r14) Initial value for lr -@ pc (r15) Initial value for pc -@ 0 For stack backtracing -@ -@ Stack Bottom: (higher memory address) */ -@ - LDR r2, [r0, #16] @ Pickup end of stack area - BIC r2, r2, #7 @ Ensure 8-byte alignment - SUB r2, r2, #76 @ Allocate space for the stack frame -@ -@ /* Actually build the stack frame. */ -@ - MOV r3, #1 @ Build interrupt stack type - STR r3, [r2, #0] @ Store stack type - MOV r3, #0 @ Build initial register value - STR r3, [r2, #8] @ Store initial r0 - STR r3, [r2, #12] @ Store initial r1 - STR r3, [r2, #16] @ Store initial r2 - STR r3, [r2, #20] @ Store initial r3 - STR r3, [r2, #24] @ Store initial r4 - STR r3, [r2, #28] @ Store initial r5 - STR r3, [r2, #32] @ Store initial r6 - STR r3, [r2, #36] @ Store initial r7 - STR r3, [r2, #40] @ Store initial r8 - STR r3, [r2, #44] @ Store initial r9 - LDR r3, [r0, #12] @ Pickup stack starting address - STR r3, [r2, #48] @ Store initial r10 (sl) - LDR r3,=_tx_thread_schedule @ Pickup address of _tx_thread_schedule for GDB backtrace - STR r3, [r2, #60] @ Store initial r14 (lr) - MOV r3, #0 @ Build initial register value - STR r3, [r2, #52] @ Store initial r11 - STR r3, [r2, #56] @ Store initial r12 - STR r1, [r2, #64] @ Store initial pc - STR r3, [r2, #68] @ 0 for back-trace - MRS r1, CPSR @ Pickup CPSR - BIC r1, r1, #CPSR_MASK @ Mask mode bits of CPSR - ORR r3, r1, #SVC_MODE @ Build CPSR, SVC mode, interrupts enabled - STR r3, [r2, #4] @ Store initial CPSR -@ -@ /* Setup stack pointer. */ -@ thread_ptr -> tx_thread_stack_ptr = r2; -@ - STR r2, [r0, #8] @ Save stack pointer in thread's - @ control block + + + /* Build a fake interrupt frame. The form of the fake interrupt stack + on the ARMv7-A should look like the following after it is built: + + Stack Top: 1 Interrupt stack frame type + CPSR Initial value for CPSR + a1 (r0) Initial value for a1 + a2 (r1) Initial value for a2 + a3 (r2) Initial value for a3 + a4 (r3) Initial value for a4 + v1 (r4) Initial value for v1 + v2 (r5) Initial value for v2 + v3 (r6) Initial value for v3 + v4 (r7) Initial value for v4 + v5 (r8) Initial value for v5 + sb (r9) Initial value for sb + sl (r10) Initial value for sl + fp (r11) Initial value for fp + ip (r12) Initial value for ip + lr (r14) Initial value for lr + pc (r15) Initial value for + 0 For stack backtracing + + Stack Bottom: (higher memory address) */ + + LDR r2, [r0, #16] // Pickup end of stack area + BIC r2, r2, #7 // Ensure 8-byte alignment + SUB r2, r2, #76 // Allocate space for the stack frame + + /* Actually build the stack frame. */ + + MOV r3, #1 // Build interrupt stack type + STR r3, [r2, #0] // Store stack type + MOV r3, #0 // Build initial register value + STR r3, [r2, #8] // Store initial r0 + STR r3, [r2, #12] // Store initial r1 + STR r3, [r2, #16] // Store initial r2 + STR r3, [r2, #20] // Store initial r3 + STR r3, [r2, #24] // Store initial r4 + STR r3, [r2, #28] // Store initial r5 + STR r3, [r2, #32] // Store initial r6 + STR r3, [r2, #36] // Store initial r7 + STR r3, [r2, #40] // Store initial r8 + STR r3, [r2, #44] // Store initial r9 + LDR r3, [r0, #12] // Pickup stack starting address + STR r3, [r2, #48] // Store initial r10 (sl) + LDR r3,=_tx_thread_schedule // Pickup address of _tx_thread_schedule for GDB backtrace + STR r3, [r2, #60] // Store initial r14 (lr) + MOV r3, #0 // Build initial register value + STR r3, [r2, #52] // Store initial r11 + STR r3, [r2, #56] // Store initial r12 + STR r1, [r2, #64] // Store initial pc + STR r3, [r2, #68] // 0 for back-trace + MRS r1, CPSR // Pickup CPSR + BIC r1, r1, #CPSR_MASK // Mask mode bits of CPSR + ORR r3, r1, #SVC_MODE // Build CPSR, SVC mode, interrupts enabled + STR r3, [r2, #4] // Store initial CPSR + + /* Setup stack pointer. */ + + STR r2, [r0, #8] // Save stack pointer in thread's + // control block #ifdef __THUMB_INTERWORK - BX lr @ Return to caller + BX lr // Return to caller #else - MOV pc, lr @ Return to caller + MOV pc, lr // Return to caller #endif -@} - - diff --git a/ports/cortex_a7/ac6/src/tx_thread_system_return.S b/ports/cortex_a7/ac6/src/tx_thread_system_return.S index 65b7ec45..cb7d62ce 100644 --- a/ports/cortex_a7/ac6/src/tx_thread_system_return.S +++ b/ports/cortex_a7/ac6/src/tx_thread_system_return.S @@ -1,182 +1,162 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .arm -@ -@ + + .global _tx_thread_current_ptr .global _tx_timer_time_slice .global _tx_thread_schedule -@ -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_system_return for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_system_return for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_system_return .type $_tx_thread_system_return,function $_tx_thread_system_return: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_system_return @ Call _tx_thread_system_return function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_system_return // Call _tx_thread_system_return function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_system_return Cortex-A7/AC6 */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is target processor specific. It is used to transfer */ -@/* control from a thread back to the ThreadX system. Only a */ -@/* minimal context is saved since the compiler assumes temp registers */ -@/* are going to get slicked by a function call anyway. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* _tx_thread_schedule Thread scheduling loop */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ThreadX components */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_system_return(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_system_return ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is target processor specific. It is used to transfer */ +/* control from a thread back to the ThreadX system. Only a */ +/* minimal context is saved since the compiler assumes temp registers */ +/* are going to get slicked by a function call anyway. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling loop */ +/* */ +/* CALLED BY */ +/* */ +/* ThreadX components */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_system_return .type _tx_thread_system_return,function _tx_thread_system_return: -@ -@ /* Save minimal context on the stack. */ -@ - STMDB sp!, {r4-r11, lr} @ Save minimal context - LDR r4, =_tx_thread_current_ptr @ Pickup address of current ptr - LDR r5, [r4] @ Pickup current thread pointer - + /* Save minimal context on the stack. */ + + STMDB sp!, {r4-r11, lr} // Save minimal context + + LDR r4, =_tx_thread_current_ptr // Pickup address of current ptr + LDR r5, [r4] // Pickup current thread pointer + #ifdef TX_ENABLE_VFP_SUPPORT - LDR r1, [r5, #144] @ Pickup the VFP enabled flag - CMP r1, #0 @ Is the VFP enabled? - BEQ _tx_skip_solicited_vfp_save @ No, skip VFP solicited save - VMRS r1, FPSCR @ Pickup the FPSCR - STR r1, [sp, #-4]! @ Save FPSCR - VSTMDB sp!, {D16-D31} @ Save D16-D31 - VSTMDB sp!, {D8-D15} @ Save D8-D15 + LDR r1, [r5, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_solicited_vfp_save // No, skip VFP solicited save + VMRS r1, FPSCR // Pickup the FPSCR + STR r1, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D8-D15} // Save D8-D15 _tx_skip_solicited_vfp_save: #endif - MOV r0, #0 @ Build a solicited stack type - MRS r1, CPSR @ Pickup the CPSR - STMDB sp!, {r0-r1} @ Save type and CPSR -@ -@ /* Lockout interrupts. */ -@ -#ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ interrupts -#else - CPSID i @ Disable IRQ interrupts -#endif - -#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the thread exit function to indicate the thread is no longer executing. */ -@ - BL _tx_execution_thread_exit @ Call the thread exit function -#endif - MOV r3, r4 @ Pickup address of current ptr - MOV r0, r5 @ Pickup current thread pointer - LDR r2, =_tx_timer_time_slice @ Pickup address of time slice - LDR r1, [r2] @ Pickup current time slice -@ -@ /* Save current stack and switch to system stack. */ -@ _tx_thread_current_ptr -> tx_thread_stack_ptr = sp; -@ sp = _tx_thread_system_stack_ptr; -@ - STR sp, [r0, #8] @ Save thread stack pointer -@ -@ /* Determine if the time-slice is active. */ -@ if (_tx_timer_time_slice) -@ { -@ - MOV r4, #0 @ Build clear value - CMP r1, #0 @ Is a time-slice active? - BEQ __tx_thread_dont_save_ts @ No, don't save the time-slice -@ -@ /* Save time-slice for the thread and clear the current time-slice. */ -@ _tx_thread_current_ptr -> tx_thread_time_slice = _tx_timer_time_slice; -@ _tx_timer_time_slice = 0; -@ - STR r4, [r2] @ Clear time-slice - STR r1, [r0, #24] @ Save current time-slice -@ -@ } -__tx_thread_dont_save_ts: -@ -@ /* Clear the current thread pointer. */ -@ _tx_thread_current_ptr = TX_NULL; -@ - STR r4, [r3] @ Clear current thread pointer - B _tx_thread_schedule @ Jump to scheduler! -@ -@} + MOV r0, #0 // Build a solicited stack type + MRS r1, CPSR // Pickup the CPSR + STMDB sp!, {r0-r1} // Save type and CPSR + /* Lockout interrupts. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Disable IRQ and FIQ interrupts +#else + CPSID i // Disable IRQ interrupts +#endif + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the thread exit function to indicate the thread is no longer executing. */ + + BL _tx_execution_thread_exit // Call the thread exit function +#endif + MOV r3, r4 // Pickup address of current ptr + MOV r0, r5 // Pickup current thread pointer + LDR r2, =_tx_timer_time_slice // Pickup address of time slice + LDR r1, [r2] // Pickup current time slice + + /* Save current stack and switch to system stack. */ + + STR sp, [r0, #8] // Save thread stack pointer + + /* Determine if the time-slice is active. */ + + MOV r4, #0 // Build clear value + CMP r1, #0 // Is a time-slice active? + BEQ __tx_thread_dont_save_ts // No, don't save the time-slice + + /* Save time-slice for the thread and clear the current time-slice. */ + + STR r4, [r2] // Clear time-slice + STR r1, [r0, #24] // Save current time-slice + +__tx_thread_dont_save_ts: + + /* Clear the current thread pointer. */ + + STR r4, [r3] // Clear current thread pointer + B _tx_thread_schedule // Jump to scheduler! diff --git a/ports/cortex_a7/ac6/src/tx_thread_vectored_context_save.S b/ports/cortex_a7/ac6/src/tx_thread_vectored_context_save.S index a7501c66..d846223f 100644 --- a/ports/cortex_a7/ac6/src/tx_thread_vectored_context_save.S +++ b/ports/cortex_a7/ac6/src/tx_thread_vectored_context_save.S @@ -1,192 +1,165 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .global _tx_thread_system_state .global _tx_thread_current_ptr -@ -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_vectored_context_save -@ since it will never be called 16-bit mode. */ -@ + .global _tx_execution_isr_enter + + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_vectored_context_save + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_vectored_context_save Cortex-A7/AC6 */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function saves the context of an executing thread in the */ -@/* beginning of interrupt processing. The function also ensures that */ -@/* the system stack is used upon return to the calling ISR. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_vectored_context_save(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_vectored_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_vectored_context_save .type _tx_thread_vectored_context_save,function _tx_thread_vectored_context_save: -@ -@ /* Upon entry to this routine, it is assumed that IRQ interrupts are locked -@ out, we are in IRQ mode, and all registers are intact. */ -@ -@ /* Check for a nested interrupt condition. */ -@ if (_tx_thread_system_state++) -@ { -@ + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ interrupts + CPSID if // Disable IRQ and FIQ interrupts #endif - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3, #0] @ Pickup system state - CMP r2, #0 @ Is this the first interrupt? - BEQ __tx_thread_not_nested_save @ Yes, not a nested context save -@ -@ /* Nested interrupt condition. */ -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3, #0] @ Store it back in the variable -@ -@ /* Note: Minimal context of interrupted thread is already saved. */ -@ -@ /* Return to the ISR. */ -@ - MOV r10, #0 @ Clear stack limit + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3, #0] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3, #0] // Store it back in the variable + + /* Note: Minimal context of interrupted thread is already saved. */ + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - MOV pc, lr @ Return to caller -@ + MOV pc, lr // Return to caller + __tx_thread_not_nested_save: -@ } -@ -@ /* Otherwise, not nested, check to see if a thread was running. */ -@ else if (_tx_thread_current_ptr) -@ { -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3, #0] @ Store it back in the variable - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1, #0] @ Pickup current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_idle_system_save @ If so, interrupt occurred in - @ scheduling loop - nothing needs saving! -@ -@ /* Note: Minimal context of interrupted thread is already saved. */ -@ -@ /* Save the current stack pointer in the thread's control block. */ -@ _tx_thread_current_ptr -> tx_thread_stack_ptr = sp; -@ -@ /* Switch to the system stack. */ -@ sp = _tx_thread_system_stack_ptr; -@ - MOV r10, #0 @ Clear stack limit + + /* Otherwise, not nested, check to see if a thread was running. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3, #0] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1, #0] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + /* Note: Minimal context of interrupted thread is already saved. */ + + /* Save the current stack pointer in the thread's control block. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - MOV pc, lr @ Return to caller -@ -@ } -@ else -@ { -@ + MOV pc, lr // Return to caller + __tx_thread_idle_system_save: -@ -@ /* Interrupt occurred in the scheduling loop. */ -@ -@ /* Not much to do here, just adjust the stack pointer, and return to IRQ -@ processing. */ -@ - MOV r10, #0 @ Clear stack limit + + /* Interrupt occurred in the scheduling loop. */ + + /* Not much to do here, just adjust the stack pointer, and return to IRQ + processing. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - ADD sp, sp, #32 @ Recover saved registers - MOV pc, lr @ Return to caller -@ -@ } -@} - + ADD sp, sp, #32 // Recover saved registers + MOV pc, lr // Return to caller diff --git a/ports/cortex_a7/ac6/src/tx_timer_interrupt.S b/ports/cortex_a7/ac6/src/tx_timer_interrupt.S index 907de9f8..7337ed0c 100644 --- a/ports/cortex_a7/ac6/src/tx_timer_interrupt.S +++ b/ports/cortex_a7/ac6/src/tx_timer_interrupt.S @@ -1,40 +1,30 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Timer */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_timer.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Timer */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .arm -@ -@/* Define Assembly language external references... */ -@ + +/* Define Assembly language external references... */ + .global _tx_timer_time_slice .global _tx_timer_system_clock .global _tx_timer_current_ptr @@ -43,237 +33,199 @@ .global _tx_timer_expired_time_slice .global _tx_timer_expired .global _tx_thread_time_slice -@ -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_timer_interrupt for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + + + +/* Define the 16-bit Thumb mode veneer for _tx_timer_interrupt for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .thumb .global $_tx_timer_interrupt .type $_tx_timer_interrupt,function $_tx_timer_interrupt: - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_timer_interrupt @ Call _tx_timer_interrupt function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_timer_interrupt // Call _tx_timer_interrupt function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_timer_interrupt Cortex-A7/AC6 */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function processes the hardware timer interrupt. This */ -@/* processing includes incrementing the system clock and checking for */ -@/* time slice and/or timer expiration. If either is found, the */ -@/* interrupt context save/restore functions are called along with the */ -@/* expiration functions. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* _tx_thread_time_slice Time slice interrupted thread */ -@/* _tx_timer_expiration_process Timer expiration processing */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* interrupt vector */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_timer_interrupt(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_timer_interrupt ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function processes the hardware timer interrupt. This */ +/* processing includes incrementing the system clock and checking for */ +/* time slice and/or timer expiration. If either is found, the */ +/* interrupt context save/restore functions are called along with the */ +/* expiration functions. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_time_slice Time slice interrupted thread */ +/* _tx_timer_expiration_process Timer expiration processing */ +/* */ +/* CALLED BY */ +/* */ +/* interrupt vector */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_timer_interrupt .type _tx_timer_interrupt,function _tx_timer_interrupt: -@ -@ /* Upon entry to this routine, it is assumed that context save has already -@ been called, and therefore the compiler scratch registers are available -@ for use. */ -@ -@ /* Increment the system clock. */ -@ _tx_timer_system_clock++; -@ - LDR r1, =_tx_timer_system_clock @ Pickup address of system clock - LDR r0, [r1] @ Pickup system clock - ADD r0, r0, #1 @ Increment system clock - STR r0, [r1] @ Store new system clock -@ -@ /* Test for time-slice expiration. */ -@ if (_tx_timer_time_slice) -@ { -@ - LDR r3, =_tx_timer_time_slice @ Pickup address of time-slice - LDR r2, [r3] @ Pickup time-slice - CMP r2, #0 @ Is it non-active? - BEQ __tx_timer_no_time_slice @ Yes, skip time-slice processing -@ -@ /* Decrement the time_slice. */ -@ _tx_timer_time_slice--; -@ - SUB r2, r2, #1 @ Decrement the time-slice - STR r2, [r3] @ Store new time-slice value -@ -@ /* Check for expiration. */ -@ if (__tx_timer_time_slice == 0) -@ - CMP r2, #0 @ Has it expired? - BNE __tx_timer_no_time_slice @ No, skip expiration processing -@ -@ /* Set the time-slice expired flag. */ -@ _tx_timer_expired_time_slice = TX_TRUE; -@ - LDR r3, =_tx_timer_expired_time_slice @ Pickup address of expired flag - MOV r0, #1 @ Build expired value - STR r0, [r3] @ Set time-slice expiration flag -@ -@ } -@ -__tx_timer_no_time_slice: -@ -@ /* Test for timer expiration. */ -@ if (*_tx_timer_current_ptr) -@ { -@ - LDR r1, =_tx_timer_current_ptr @ Pickup current timer pointer address - LDR r0, [r1] @ Pickup current timer - LDR r2, [r0] @ Pickup timer list entry - CMP r2, #0 @ Is there anything in the list? - BEQ __tx_timer_no_timer @ No, just increment the timer -@ -@ /* Set expiration flag. */ -@ _tx_timer_expired = TX_TRUE; -@ - LDR r3, =_tx_timer_expired @ Pickup expiration flag address - MOV r2, #1 @ Build expired value - STR r2, [r3] @ Set expired flag - B __tx_timer_done @ Finished timer processing -@ -@ } -@ else -@ { -__tx_timer_no_timer: -@ -@ /* No timer expired, increment the timer pointer. */ -@ _tx_timer_current_ptr++; -@ - ADD r0, r0, #4 @ Move to next timer -@ -@ /* Check for wraparound. */ -@ if (_tx_timer_current_ptr == _tx_timer_list_end) -@ - LDR r3, =_tx_timer_list_end @ Pickup address of timer list end - LDR r2, [r3] @ Pickup list end - CMP r0, r2 @ Are we at list end? - BNE __tx_timer_skip_wrap @ No, skip wraparound logic -@ -@ /* Wrap to beginning of list. */ -@ _tx_timer_current_ptr = _tx_timer_list_start; -@ - LDR r3, =_tx_timer_list_start @ Pickup address of timer list start - LDR r0, [r3] @ Set current pointer to list start -@ -__tx_timer_skip_wrap: -@ - STR r0, [r1] @ Store new current timer pointer -@ } -@ -__tx_timer_done: -@ -@ -@ /* See if anything has expired. */ -@ if ((_tx_timer_expired_time_slice) || (_tx_timer_expired)) -@ { -@ - LDR r3, =_tx_timer_expired_time_slice @ Pickup address of expired flag - LDR r2, [r3] @ Pickup time-slice expired flag - CMP r2, #0 @ Did a time-slice expire? - BNE __tx_something_expired @ If non-zero, time-slice expired - LDR r1, =_tx_timer_expired @ Pickup address of other expired flag - LDR r0, [r1] @ Pickup timer expired flag - CMP r0, #0 @ Did a timer expire? - BEQ __tx_timer_nothing_expired @ No, nothing expired -@ -__tx_something_expired: -@ -@ - STMDB sp!, {r0, lr} @ Save the lr register on the stack - @ and save r0 just to keep 8-byte alignment -@ -@ /* Did a timer expire? */ -@ if (_tx_timer_expired) -@ { -@ - LDR r1, =_tx_timer_expired @ Pickup address of expired flag - LDR r0, [r1] @ Pickup timer expired flag - CMP r0, #0 @ Check for timer expiration - BEQ __tx_timer_dont_activate @ If not set, skip timer activation -@ -@ /* Process timer expiration. */ -@ _tx_timer_expiration_process(); -@ - BL _tx_timer_expiration_process @ Call the timer expiration handling routine -@ -@ } -__tx_timer_dont_activate: -@ -@ /* Did time slice expire? */ -@ if (_tx_timer_expired_time_slice) -@ { -@ - LDR r3, =_tx_timer_expired_time_slice @ Pickup address of time-slice expired - LDR r2, [r3] @ Pickup the actual flag - CMP r2, #0 @ See if the flag is set - BEQ __tx_timer_not_ts_expiration @ No, skip time-slice processing -@ -@ /* Time slice interrupted thread. */ -@ _tx_thread_time_slice(); -@ - BL _tx_thread_time_slice @ Call time-slice processing -@ -@ } -@ -__tx_timer_not_ts_expiration: -@ - LDMIA sp!, {r0, lr} @ Recover lr register (r0 is just there for - @ the 8-byte stack alignment -@ -@ } -@ -__tx_timer_nothing_expired: -@ -#ifdef __THUMB_INTERWORK - BX lr @ Return to caller -#else - MOV pc, lr @ Return to caller -#endif -@ -@} + /* Upon entry to this routine, it is assumed that context save has already + been called, and therefore the compiler scratch registers are available + for use. */ + + /* Increment the system clock. */ + + LDR r1, =_tx_timer_system_clock // Pickup address of system clock + LDR r0, [r1] // Pickup system clock + ADD r0, r0, #1 // Increment system clock + STR r0, [r1] // Store new system clock + + /* Test for time-slice expiration. */ + + LDR r3, =_tx_timer_time_slice // Pickup address of time-slice + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it non-active? + BEQ __tx_timer_no_time_slice // Yes, skip time-slice processing + + /* Decrement the time_slice. */ + + SUB r2, r2, #1 // Decrement the time-slice + STR r2, [r3] // Store new time-slice value + + /* Check for expiration. */ + + CMP r2, #0 // Has it expired? + BNE __tx_timer_no_time_slice // No, skip expiration processing + + /* Set the time-slice expired flag. */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of expired flag + MOV r0, #1 // Build expired value + STR r0, [r3] // Set time-slice expiration flag + +__tx_timer_no_time_slice: + + /* Test for timer expiration. */ + + LDR r1, =_tx_timer_current_ptr // Pickup current timer pointer address + LDR r0, [r1] // Pickup current timer + LDR r2, [r0] // Pickup timer list entry + CMP r2, #0 // Is there anything in the list? + BEQ __tx_timer_no_timer // No, just increment the timer + + /* Set expiration flag. */ + + LDR r3, =_tx_timer_expired // Pickup expiration flag address + MOV r2, #1 // Build expired value + STR r2, [r3] // Set expired flag + B __tx_timer_done // Finished timer processing + +__tx_timer_no_timer: + + /* No timer expired, increment the timer pointer. */ + ADD r0, r0, #4 // Move to next timer + + /* Check for wraparound. */ + + LDR r3, =_tx_timer_list_end // Pickup address of timer list end + LDR r2, [r3] // Pickup list end + CMP r0, r2 // Are we at list end? + BNE __tx_timer_skip_wrap // No, skip wraparound logic + + /* Wrap to beginning of list. */ + + LDR r3, =_tx_timer_list_start // Pickup address of timer list start + LDR r0, [r3] // Set current pointer to list start + +__tx_timer_skip_wrap: + + STR r0, [r1] // Store new current timer pointer + +__tx_timer_done: + + /* See if anything has expired. */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of expired flag + LDR r2, [r3] // Pickup time-slice expired flag + CMP r2, #0 // Did a time-slice expire? + BNE __tx_something_expired // If non-zero, time-slice expired + LDR r1, =_tx_timer_expired // Pickup address of other expired flag + LDR r0, [r1] // Pickup timer expired flag + CMP r0, #0 // Did a timer expire? + BEQ __tx_timer_nothing_expired // No, nothing expired + +__tx_something_expired: + + STMDB sp!, {r0, lr} // Save the lr register on the stack + // and save r0 just to keep 8-byte alignment + + /* Did a timer expire? */ + + LDR r1, =_tx_timer_expired // Pickup address of expired flag + LDR r0, [r1] // Pickup timer expired flag + CMP r0, #0 // Check for timer expiration + BEQ __tx_timer_dont_activate // If not set, skip timer activation + + /* Process timer expiration. */ + BL _tx_timer_expiration_process // Call the timer expiration handling routine + +__tx_timer_dont_activate: + + /* Did time slice expire? */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of time-slice expired + LDR r2, [r3] // Pickup the actual flag + CMP r2, #0 // See if the flag is set + BEQ __tx_timer_not_ts_expiration // No, skip time-slice processing + + /* Time slice interrupted thread. */ + + BL _tx_thread_time_slice // Call time-slice processing + +__tx_timer_not_ts_expiration: + + LDMIA sp!, {r0, lr} // Recover lr register (r0 is just there for + // the 8-byte stack alignment + +__tx_timer_nothing_expired: + +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a7/gnu/example_build/build_threadx_sample.bat b/ports/cortex_a7/gnu/example_build/build_threadx_sample.bat index 561bab52..d0378cb8 100644 --- a/ports/cortex_a7/gnu/example_build/build_threadx_sample.bat +++ b/ports/cortex_a7/gnu/example_build/build_threadx_sample.bat @@ -2,5 +2,7 @@ arm-none-eabi-gcc -c -g -mcpu=cortex-a7 reset.S arm-none-eabi-gcc -c -g -mcpu=cortex-a7 crt0.S arm-none-eabi-gcc -c -g -mcpu=cortex-a7 tx_initialize_low_level.S arm-none-eabi-gcc -c -g -mcpu=cortex-a7 -I../../../../common/inc -I../inc sample_threadx.c -arm-none-eabi-ld -A cortex-a7 -T sample_threadx.ld reset.o crt0.o tx_initialize_low_level.o sample_threadx.o tx.a libc.a libgcc.a -o sample_threadx.out -M > sample_threadx.map +arm-none-eabi-gcc -g -mcpu=cortex-a7 -T sample_threadx.ld --specs=nosys.specs -o sample_threadx.out -Wl,-Map=sample_threadx.map tx_initialize_low_level.o sample_threadx.o tx.a + + diff --git a/ports/cortex_a7/gnu/example_build/crt0.S b/ports/cortex_a7/gnu/example_build/crt0.S index aa0f3239..56b6c958 100644 --- a/ports/cortex_a7/gnu/example_build/crt0.S +++ b/ports/cortex_a7/gnu/example_build/crt0.S @@ -26,13 +26,13 @@ _mainCRTStartup: mov a2, #0 /* Second arg: fill value */ mov fp, a2 /* Null frame pointer */ mov r7, a2 /* Null frame pointer for Thumb */ - - ldr a1, .LC1 /* First arg: start of memory block */ - ldr a3, .LC2 - sub a3, a3, a1 /* Third arg: length of block */ - - + ldr a1, .LC1 /* First arg: start of memory block */ + ldr a3, .LC2 + sub a3, a3, a1 /* Third arg: length of block */ + + + bl memset mov r0, #0 /* no arguments */ mov r1, #0 /* no argv either */ @@ -48,15 +48,15 @@ _mainCRTStartup: /* bl init */ mov r0, r4 mov r1, r5 -#endif +#endif bl main bl exit /* Should not return. */ - - /* For Thumb, constants must be after the code since only + + /* For Thumb, constants must be after the code since only positive offsets are supported for PC relative addresses. */ - + .align 0 .LC0: .LC1: diff --git a/ports/cortex_a7/gnu/example_build/reset.S b/ports/cortex_a7/gnu/example_build/reset.S index 856e31eb..597e9d9a 100644 --- a/ports/cortex_a7/gnu/example_build/reset.S +++ b/ports/cortex_a7/gnu/example_build/reset.S @@ -1,35 +1,24 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Initialize */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_initialize.h" -@#include "tx_thread.h" -@#include "tx_timer.h" +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Initialize */ +/** */ +/**************************************************************************/ +/**************************************************************************/ .arm @@ -41,36 +30,35 @@ .global __tx_reserved_handler .global __tx_irq_handler .global __tx_fiq_handler -@ -@ -@/* Define the vector area. This should be located or copied to 0. */ -@ + +/* Define the vector area. This should be located or copied to 0. */ + .text .global __vectors __vectors: - LDR pc, STARTUP @ Reset goes to startup function - LDR pc, UNDEFINED @ Undefined handler - LDR pc, SWI @ Software interrupt handler - LDR pc, PREFETCH @ Prefetch exception handler - LDR pc, ABORT @ Abort exception handler - LDR pc, RESERVED @ Reserved exception handler - LDR pc, IRQ @ IRQ interrupt handler - LDR pc, FIQ @ FIQ interrupt handler + LDR pc, STARTUP // Reset goes to startup function + LDR pc, UNDEFINED // Undefined handler + LDR pc, SWI // Software interrupt handler + LDR pc, PREFETCH // Prefetch exception handler + LDR pc, ABORT // Abort exception handler + LDR pc, RESERVED // Reserved exception handler + LDR pc, IRQ // IRQ interrupt handler + LDR pc, FIQ // FIQ interrupt handler STARTUP: - .word _start @ Reset goes to C startup function + .word _start // Reset goes to C startup function UNDEFINED: - .word __tx_undefined @ Undefined handler + .word __tx_undefined // Undefined handler SWI: - .word __tx_swi_interrupt @ Software interrupt handler + .word __tx_swi_interrupt // Software interrupt handler PREFETCH: - .word __tx_prefetch_handler @ Prefetch exception handler -ABORT: - .word __tx_abort_handler @ Abort exception handler -RESERVED: - .word __tx_reserved_handler @ Reserved exception handler -IRQ: - .word __tx_irq_handler @ IRQ interrupt handler + .word __tx_prefetch_handler // Prefetch exception handler +ABORT: + .word __tx_abort_handler // Abort exception handler +RESERVED: + .word __tx_reserved_handler // Reserved exception handler +IRQ: + .word __tx_irq_handler // IRQ interrupt handler FIQ: - .word __tx_fiq_handler @ FIQ interrupt handler + .word __tx_fiq_handler // FIQ interrupt handler diff --git a/ports/cortex_a7/gnu/example_build/sample_threadx.c b/ports/cortex_a7/gnu/example_build/sample_threadx.c index 418ec634..8c61de06 100644 --- a/ports/cortex_a7/gnu/example_build/sample_threadx.c +++ b/ports/cortex_a7/gnu/example_build/sample_threadx.c @@ -1,5 +1,5 @@ /* This is a small demo of the high-performance ThreadX kernel. It includes examples of eight - threads of different priorities, using a message queue, semaphore, mutex, event flags group, + threads of different priorities, using a message queue, semaphore, mutex, event flags group, byte pool, and block pool. */ #include "tx_api.h" @@ -80,42 +80,42 @@ CHAR *pointer = TX_NULL; tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); /* Create the main thread. */ - tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, 1, 1, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 1. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - /* Create threads 1 and 2. These threads pass information through a ThreadX + /* Create threads 1 and 2. These threads pass information through a ThreadX message queue. It is also interesting to note that these threads have a time slice. */ - tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, DEMO_STACK_SIZE, 16, 16, 4, TX_AUTO_START); /* Allocate the stack for thread 2. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, DEMO_STACK_SIZE, 16, 16, 4, TX_AUTO_START); /* Allocate the stack for thread 3. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - /* Create threads 3 and 4. These threads compete for a ThreadX counting semaphore. + /* Create threads 3 and 4. These threads compete for a ThreadX counting semaphore. An interesting thing here is that both threads share the same instruction area. */ - tx_thread_create(&thread_3, "thread 3", thread_3_and_4_entry, 3, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_3, "thread 3", thread_3_and_4_entry, 3, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 4. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - tx_thread_create(&thread_4, "thread 4", thread_3_and_4_entry, 4, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_4, "thread 4", thread_3_and_4_entry, 4, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 5. */ @@ -123,23 +123,23 @@ CHAR *pointer = TX_NULL; /* Create thread 5. This thread simply pends on an event flag which will be set by thread_0. */ - tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, + pointer, DEMO_STACK_SIZE, 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 6. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); /* Create threads 6 and 7. These threads compete for a ThreadX mutex. */ - tx_thread_create(&thread_6, "thread 6", thread_6_and_7_entry, 6, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_6, "thread 6", thread_6_and_7_entry, 6, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 7. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - tx_thread_create(&thread_7, "thread 7", thread_6_and_7_entry, 7, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_7, "thread 7", thread_6_and_7_entry, 7, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the message queue. */ @@ -242,11 +242,11 @@ UINT status; /* Retrieve a message from the queue. */ status = tx_queue_receive(&queue_0, &received_message, TX_WAIT_FOREVER); - /* Check completion status and make sure the message is what we + /* Check completion status and make sure the message is what we expected. */ if ((status != TX_SUCCESS) || (received_message != thread_2_messages_received)) break; - + /* Otherwise, all is okay. Increment the received message count. */ thread_2_messages_received++; } @@ -305,7 +305,7 @@ ULONG actual_flags; thread_5_counter++; /* Wait for event flag 0. */ - status = tx_event_flags_get(&event_flags_0, 0x1, TX_OR_CLEAR, + status = tx_event_flags_get(&event_flags_0, 0x1, TX_OR_CLEAR, &actual_flags, TX_WAIT_FOREVER); /* Check status. */ @@ -358,7 +358,7 @@ UINT status; if (status != TX_SUCCESS) break; - /* Release the mutex again. This will actually + /* Release the mutex again. This will actually release ownership since it was obtained twice. */ status = tx_mutex_put(&mutex_0); diff --git a/ports/cortex_a7/gnu/example_build/tx_initialize_low_level.S b/ports/cortex_a7/gnu/example_build/tx_initialize_low_level.S index 7d2ac9b7..7de5d3ce 100644 --- a/ports/cortex_a7/gnu/example_build/tx_initialize_low_level.S +++ b/ports/cortex_a7/gnu/example_build/tx_initialize_low_level.S @@ -1,47 +1,35 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Initialize */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_initialize.h" -@#include "tx_thread.h" -@#include "tx_timer.h" +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Initialize */ +/** */ +/**************************************************************************/ +/**************************************************************************/ .arm -SVC_MODE = 0xD3 @ Disable IRQ/FIQ SVC mode -IRQ_MODE = 0xD2 @ Disable IRQ/FIQ IRQ mode -FIQ_MODE = 0xD1 @ Disable IRQ/FIQ FIQ mode -SYS_MODE = 0xDF @ Disable IRQ/FIQ SYS mode -FIQ_STACK_SIZE = 512 @ FIQ stack size -IRQ_STACK_SIZE = 1024 @ IRQ stack size -SYS_STACK_SIZE = 1024 @ System stack size -@ -@ +SVC_MODE = 0xD3 // Disable IRQ/FIQ SVC mode +IRQ_MODE = 0xD2 // Disable IRQ/FIQ IRQ mode +FIQ_MODE = 0xD1 // Disable IRQ/FIQ FIQ mode +SYS_MODE = 0xDF // Disable IRQ/FIQ SYS mode +FIQ_STACK_SIZE = 512 // FIQ stack size +IRQ_STACK_SIZE = 1024 // IRQ stack size +SYS_STACK_SIZE = 1024 // System stack size + .global _tx_thread_system_stack_ptr .global _tx_initialize_unused_memory .global _tx_thread_context_save @@ -51,297 +39,267 @@ SYS_STACK_SIZE = 1024 @ System stack size .global _sp .global _stack_bottom -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_initialize_low_level for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + +/* Define the 16-bit Thumb mode veneer for _tx_initialize_low_level for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .thumb .global $_tx_initialize_low_level .type $_tx_initialize_low_level,function $_tx_initialize_low_level: - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_initialize_low_level @ Call _tx_initialize_low_level function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_initialize_low_level // Call _tx_initialize_low_level function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_initialize_low_level Cortex-A7/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is responsible for any low-level processor */ -@/* initialization, including setting up interrupt vectors, setting */ -@/* up a periodic timer interrupt source, saving the system stack */ -@/* pointer for use in ISR processing later, and finding the first */ -@/* available RAM memory address for tx_application_define. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* _tx_initialize_kernel_enter ThreadX entry function */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_initialize_low_level(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_initialize_low_level ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for any low-level processor */ +/* initialization, including setting up interrupt vectors, setting */ +/* up a periodic timer interrupt source, saving the system stack */ +/* pointer for use in ISR processing later, and finding the first */ +/* available RAM memory address for tx_application_define. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_initialize_kernel_enter ThreadX entry function */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_initialize_low_level .type _tx_initialize_low_level,function _tx_initialize_low_level: -@ -@ /* We must be in SVC mode at this point! */ -@ -@ /* Setup various stack pointers. */ -@ - LDR r1, =_sp @ Get pointer to stack area -#ifdef TX_ENABLE_IRQ_NESTING -@ -@ /* Setup the system mode stack for nested interrupt support */ -@ - LDR r2, =SYS_STACK_SIZE @ Pickup stack size - MOV r3, #SYS_MODE @ Build SYS mode CPSR - MSR CPSR_c, r3 @ Enter SYS mode - SUB r1, r1, #1 @ Backup 1 byte - BIC r1, r1, #7 @ Ensure 8-byte alignment - MOV sp, r1 @ Setup SYS stack pointer - SUB r1, r1, r2 @ Calculate start of next stack + /* We must be in SVC mode at this point! */ + + /* Setup various stack pointers. */ + + LDR r1, =_sp // Get pointer to stack area + +#ifdef TX_ENABLE_IRQ_NESTING + + /* Setup the system mode stack for nested interrupt support */ + + LDR r2, =SYS_STACK_SIZE // Pickup stack size + MOV r3, #SYS_MODE // Build SYS mode CPSR + MSR CPSR_c, r3 // Enter SYS mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup SYS stack pointer + SUB r1, r1, r2 // Calculate start of next stack #endif - LDR r2, =FIQ_STACK_SIZE @ Pickup stack size - MOV r0, #FIQ_MODE @ Build FIQ mode CPSR - MSR CPSR, r0 @ Enter FIQ mode - SUB r1, r1, #1 @ Backup 1 byte - BIC r1, r1, #7 @ Ensure 8-byte alignment - MOV sp, r1 @ Setup FIQ stack pointer - SUB r1, r1, r2 @ Calculate start of next stack - LDR r2, =IRQ_STACK_SIZE @ Pickup IRQ stack size - MOV r0, #IRQ_MODE @ Build IRQ mode CPSR - MSR CPSR, r0 @ Enter IRQ mode - SUB r1, r1, #1 @ Backup 1 byte - BIC r1, r1, #7 @ Ensure 8-byte alignment - MOV sp, r1 @ Setup IRQ stack pointer - SUB r3, r1, r2 @ Calculate end of IRQ stack - MOV r0, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR, r0 @ Enter SVC mode - LDR r2, =_stack_bottom @ Pickup stack bottom - CMP r3, r2 @ Compare the current stack end with the bottom -_stack_error_loop: - BLT _stack_error_loop @ If the IRQ stack exceeds the stack bottom, just sit here! -@ -@ /* Save the system stack pointer. */ -@ _tx_thread_system_stack_ptr = (VOID_PTR) (sp); -@ - LDR r2, =_tx_thread_system_stack_ptr @ Pickup stack pointer - STR r1, [r2] @ Save the system stack -@ -@ /* Save the first available memory address. */ -@ _tx_initialize_unused_memory = (VOID_PTR) _end; -@ - LDR r1, =_end @ Get end of non-initialized RAM area - LDR r2, =_tx_initialize_unused_memory @ Pickup unused memory ptr address - ADD r1, r1, #8 @ Increment to next free word - STR r1, [r2] @ Save first free memory address -@ -@ /* Setup Timer for periodic interrupts. */ -@ -@ /* Done, return to caller. */ -@ + LDR r2, =FIQ_STACK_SIZE // Pickup stack size + MOV r0, #FIQ_MODE // Build FIQ mode CPSR + MSR CPSR, r0 // Enter FIQ mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup FIQ stack pointer + SUB r1, r1, r2 // Calculate start of next stack + LDR r2, =IRQ_STACK_SIZE // Pickup IRQ stack size + MOV r0, #IRQ_MODE // Build IRQ mode CPSR + MSR CPSR, r0 // Enter IRQ mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup IRQ stack pointer + SUB r3, r1, r2 // Calculate end of IRQ stack + MOV r0, #SVC_MODE // Build SVC mode CPSR + MSR CPSR, r0 // Enter SVC mode + LDR r2, =_stack_bottom // Pickup stack bottom + CMP r3, r2 // Compare the current stack end with the bottom +_stack_error_loop: + BLT _stack_error_loop // If the IRQ stack exceeds the stack bottom, just sit here! + + LDR r2, =_tx_thread_system_stack_ptr // Pickup stack pointer + STR r1, [r2] // Save the system stack + + LDR r1, =_end // Get end of non-initialized RAM area + LDR r2, =_tx_initialize_unused_memory // Pickup unused memory ptr address + ADD r1, r1, #8 // Increment to next free word + STR r1, [r2] // Save first free memory address + #ifdef __THUMB_INTERWORK - BX lr @ Return to caller + BX lr // Return to caller #else - MOV pc, lr @ Return to caller + MOV pc, lr // Return to caller #endif -@} -@ -@ -@/* Define shells for each of the interrupt vectors. */ -@ + +/* Define shells for each of the interrupt vectors. */ + .global __tx_undefined __tx_undefined: - B __tx_undefined @ Undefined handler -@ + B __tx_undefined // Undefined handler + .global __tx_swi_interrupt __tx_swi_interrupt: - B __tx_swi_interrupt @ Software interrupt handler -@ + B __tx_swi_interrupt // Software interrupt handler + .global __tx_prefetch_handler __tx_prefetch_handler: - B __tx_prefetch_handler @ Prefetch exception handler -@ + B __tx_prefetch_handler // Prefetch exception handler + .global __tx_abort_handler __tx_abort_handler: - B __tx_abort_handler @ Abort exception handler -@ + B __tx_abort_handler // Abort exception handler + .global __tx_reserved_handler __tx_reserved_handler: - B __tx_reserved_handler @ Reserved exception handler -@ + B __tx_reserved_handler // Reserved exception handler + .global __tx_irq_handler - .global __tx_irq_processing_return + .global __tx_irq_processing_return __tx_irq_handler: -@ -@ /* Jump to context save to save system context. */ + + /* Jump to context save to save system context. */ B _tx_thread_context_save __tx_irq_processing_return: -@ -@ /* At this point execution is still in the IRQ mode. The CPSR, point of -@ interrupt, and all C scratch registers are available for use. In -@ addition, IRQ interrupts may be re-enabled - with certain restrictions - -@ if nested IRQ interrupts are desired. Interrupts may be re-enabled over -@ small code sequences where lr is saved before enabling interrupts and -@ restored after interrupts are again disabled. */ -@ -@ /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start -@ from IRQ mode with interrupts disabled. This routine switches to the -@ system mode and returns with IRQ interrupts enabled. -@ -@ NOTE: It is very important to ensure all IRQ interrupts are cleared -@ prior to enabling nested IRQ interrupts. */ +// + /* At this point execution is still in the IRQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. In + addition, IRQ interrupts may be re-enabled - with certain restrictions - + if nested IRQ interrupts are desired. Interrupts may be re-enabled over + small code sequences where lr is saved before enabling interrupts and + restored after interrupts are again disabled. */ + + /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start + from IRQ mode with interrupts disabled. This routine switches to the + system mode and returns with IRQ interrupts enabled. + + NOTE: It is very important to ensure all IRQ interrupts are cleared + prior to enabling nested IRQ interrupts. */ #ifdef TX_ENABLE_IRQ_NESTING BL _tx_thread_irq_nesting_start #endif -@ -@ /* For debug purpose, execute the timer interrupt processing here. In -@ a real system, some kind of status indication would have to be checked -@ before the timer interrupt handler could be called. */ -@ - BL _tx_timer_interrupt @ Timer interrupt handler -@ -@ -@ /* If interrupt nesting was started earlier, the end of interrupt nesting -@ service must be called before returning to _tx_thread_context_restore. -@ This routine returns in processing in IRQ mode with interrupts disabled. */ + + /* For debug purpose, execute the timer interrupt processing here. In + a real system, some kind of status indication would have to be checked + before the timer interrupt handler could be called. */ + + BL _tx_timer_interrupt // Timer interrupt handler + + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_context_restore. + This routine returns in processing in IRQ mode with interrupts disabled. */ #ifdef TX_ENABLE_IRQ_NESTING BL _tx_thread_irq_nesting_end #endif -@ -@ /* Jump to context restore to restore system context. */ + + /* Jump to context restore to restore system context. */ B _tx_thread_context_restore -@ -@ -@ /* This is an example of a vectored IRQ handler. */ -@ -@ .global __tx_example_vectored_irq_handler -@__tx_example_vectored_irq_handler: -@ -@ -@ /* Save initial context and call context save to prepare for -@ vectored ISR execution. */ -@ -@ STMDB sp!, {r0-r3} @ Save some scratch registers -@ MRS r0, SPSR @ Pickup saved SPSR -@ SUB lr, lr, #4 @ Adjust point of interrupt -@ STMDB sp!, {r0, r10, r12, lr} @ Store other scratch registers -@ BL _tx_thread_vectored_context_save @ Vectored context save -@ -@ /* At this point execution is still in the IRQ mode. The CPSR, point of -@ interrupt, and all C scratch registers are available for use. In -@ addition, IRQ interrupts may be re-enabled - with certain restrictions - -@ if nested IRQ interrupts are desired. Interrupts may be re-enabled over -@ small code sequences where lr is saved before enabling interrupts and -@ restored after interrupts are again disabled. */ -@ -@ -@ /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start -@ from IRQ mode with interrupts disabled. This routine switches to the -@ system mode and returns with IRQ interrupts enabled. -@ -@ NOTE: It is very important to ensure all IRQ interrupts are cleared -@ prior to enabling nested IRQ interrupts. */ -@#ifdef TX_ENABLE_IRQ_NESTING -@ BL _tx_thread_irq_nesting_start -@#endif -@ -@ /* Application IRQ handlers can be called here! */ -@ -@ /* If interrupt nesting was started earlier, the end of interrupt nesting -@ service must be called before returning to _tx_thread_context_restore. -@ This routine returns in processing in IRQ mode with interrupts disabled. */ -@#ifdef TX_ENABLE_IRQ_NESTING -@ BL _tx_thread_irq_nesting_end -@#endif -@ -@ /* Jump to context restore to restore system context. */ -@ B _tx_thread_context_restore -@ -@ + + + /* This is an example of a vectored IRQ handler. */ + + + + /* Save initial context and call context save to prepare for + vectored ISR execution. */ + + /* At this point execution is still in the IRQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. In + addition, IRQ interrupts may be re-enabled - with certain restrictions - + if nested IRQ interrupts are desired. Interrupts may be re-enabled over + small code sequences where lr is saved before enabling interrupts and + restored after interrupts are again disabled. */ + + + /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start + from IRQ mode with interrupts disabled. This routine switches to the + system mode and returns with IRQ interrupts enabled. + + NOTE: It is very important to ensure all IRQ interrupts are cleared + prior to enabling nested IRQ interrupts. */ + + /* Application IRQ handlers can be called here! */ + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_context_restore. + This routine returns in processing in IRQ mode with interrupts disabled. */ + + + #ifdef TX_ENABLE_FIQ_SUPPORT .global __tx_fiq_handler .global __tx_fiq_processing_return __tx_fiq_handler: -@ -@ /* Jump to fiq context save to save system context. */ + + /* Jump to fiq context save to save system context. */ B _tx_thread_fiq_context_save __tx_fiq_processing_return: -@ -@ /* At this point execution is still in the FIQ mode. The CPSR, point of -@ interrupt, and all C scratch registers are available for use. */ -@ -@ /* Interrupt nesting is allowed after calling _tx_thread_fiq_nesting_start -@ from FIQ mode with interrupts disabled. This routine switches to the -@ system mode and returns with FIQ interrupts enabled. -@ -@ NOTE: It is very important to ensure all FIQ interrupts are cleared -@ prior to enabling nested FIQ interrupts. */ + + /* At this point execution is still in the FIQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. */ + + /* Interrupt nesting is allowed after calling _tx_thread_fiq_nesting_start + from FIQ mode with interrupts disabled. This routine switches to the + system mode and returns with FIQ interrupts enabled. + + NOTE: It is very important to ensure all FIQ interrupts are cleared + prior to enabling nested FIQ interrupts. */ #ifdef TX_ENABLE_FIQ_NESTING BL _tx_thread_fiq_nesting_start #endif -@ -@ /* Application FIQ handlers can be called here! */ -@ -@ /* If interrupt nesting was started earlier, the end of interrupt nesting -@ service must be called before returning to _tx_thread_fiq_context_restore. */ + + /* Application FIQ handlers can be called here! */ + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_fiq_context_restore. */ #ifdef TX_ENABLE_FIQ_NESTING BL _tx_thread_fiq_nesting_end #endif -@ -@ /* Jump to fiq context restore to restore system context. */ + + /* Jump to fiq context restore to restore system context. */ B _tx_thread_fiq_context_restore -@ -@ + + #else .global __tx_fiq_handler __tx_fiq_handler: - B __tx_fiq_handler @ FIQ interrupt handler + B __tx_fiq_handler // FIQ interrupt handler #endif -@ -@ + + BUILD_OPTIONS: - .word _tx_build_options @ Reference to bring in + .word _tx_build_options // Reference to bring in VERSION_ID: - .word _tx_version_id @ Reference to bring in + .word _tx_version_id // Reference to bring in diff --git a/ports/cortex_a7/gnu/inc/tx_port.h b/ports/cortex_a7/gnu/inc/tx_port.h index b8c47dc6..19463de1 100644 --- a/ports/cortex_a7/gnu/inc/tx_port.h +++ b/ports/cortex_a7/gnu/inc/tx_port.h @@ -12,7 +12,7 @@ /**************************************************************************/ /**************************************************************************/ -/** */ +/** */ /** ThreadX Component */ /** */ /** Port Specific */ @@ -21,36 +21,38 @@ /**************************************************************************/ -/**************************************************************************/ -/* */ -/* PORT SPECIFIC C INFORMATION RELEASE */ -/* */ -/* tx_port.h Cortex-A7/GNU */ -/* 6.1.6 */ +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* tx_port.h ARMv7-A */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ /* */ /* DESCRIPTION */ -/* */ -/* This file contains data type definitions that make the ThreadX */ -/* real-time kernel function identically on a variety of different */ -/* processor architectures. For example, the size or number of bits */ -/* in an "int" data type vary between microprocessor architectures and */ -/* even C compilers for the same microprocessor. ThreadX does not */ -/* directly use native C data types. Instead, ThreadX creates its */ -/* own special types that can be mapped to actual data types by this */ -/* file to guarantee consistency in the interface and functionality. */ -/* */ -/* RELEASE HISTORY */ -/* */ +/* */ +/* This file contains data type definitions that make the ThreadX */ +/* real-time kernel function identically on a variety of different */ +/* processor architectures. For example, the size or number of bits */ +/* in an "int" data type vary between microprocessor architectures and */ +/* even C compilers for the same microprocessor. ThreadX does not */ +/* directly use native C data types. Instead, ThreadX creates its */ +/* own special types that can be mapped to actual data types by this */ +/* file to guarantee consistency in the interface and functionality. */ +/* */ +/* RELEASE HISTORY */ +/* */ /* DATE NAME DESCRIPTION */ /* */ /* 09-30-2020 William E. Lamie Initial Version 6.1 */ /* 04-02-2021 Bhupendra Naphade Modified comment(s),updated */ /* macro definition, */ /* resulting in version 6.1.6 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -63,7 +65,7 @@ #ifdef TX_INCLUDE_USER_DEFINE_FILE -/* Yes, include the user defines in tx_user.h. The defines in this file may +/* Yes, include the user defines in tx_user.h. The defines in this file may alternately be defined on the command line. */ #include "tx_user.h" @@ -76,7 +78,7 @@ #include -/* Define ThreadX basic types for this port. */ +/* Define ThreadX basic types for this port. */ #define VOID void typedef char CHAR; @@ -112,12 +114,12 @@ typedef unsigned short USHORT; #define TX_TIMER_THREAD_STACK_SIZE 1024 /* Default timer thread stack size */ #endif -#ifndef TX_TIMER_THREAD_PRIORITY -#define TX_TIMER_THREAD_PRIORITY 0 /* Default timer thread priority */ +#ifndef TX_TIMER_THREAD_PRIORITY +#define TX_TIMER_THREAD_PRIORITY 0 /* Default timer thread priority */ #endif -/* Define various constants for the ThreadX ARM port. */ +/* Define various constants for the ThreadX ARM port. */ #ifdef TX_ENABLE_FIQ_SUPPORT #define TX_INT_DISABLE 0xC0 /* Disable IRQ & FIQ interrupts */ @@ -127,8 +129,8 @@ typedef unsigned short USHORT; #define TX_INT_ENABLE 0x00 /* Enable IRQ interrupts */ -/* Define the clock source for trace event entry time stamp. The following two item are port specific. - For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock +/* Define the clock source for trace event entry time stamp. The following two item are port specific. + For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: #define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) @@ -175,7 +177,7 @@ typedef unsigned short USHORT; #define TX_INLINE_INITIALIZATION -/* Determine whether or not stack checking is enabled. By default, ThreadX stack checking is +/* Determine whether or not stack checking is enabled. By default, ThreadX stack checking is disabled. When the following is defined, ThreadX thread stack checking is enabled. If stack checking is enabled (TX_ENABLE_STACK_CHECKING is defined), the TX_DISABLE_STACK_FILLING define is negated, thereby forcing the stack fill which is necessary for the stack checking @@ -187,13 +189,13 @@ typedef unsigned short USHORT; /* Define the TX_THREAD control block extensions for this port. The main reason - for the multiple macros is so that backward compatibility can be maintained with + for the multiple macros is so that backward compatibility can be maintained with existing ThreadX kernel awareness modules. */ -#define TX_THREAD_EXTENSION_0 -#define TX_THREAD_EXTENSION_1 +#define TX_THREAD_EXTENSION_0 +#define TX_THREAD_EXTENSION_1 #define TX_THREAD_EXTENSION_2 ULONG tx_thread_vfp_enable; -#define TX_THREAD_EXTENSION_3 +#define TX_THREAD_EXTENSION_3 /* Define the port extensions of the remaining ThreadX objects. */ @@ -207,11 +209,11 @@ typedef unsigned short USHORT; #define TX_TIMER_EXTENSION -/* Define the user extension field of the thread control block. Nothing +/* Define the user extension field of the thread control block. Nothing additional is needed for this port so it is defined as white space. */ #ifndef TX_THREAD_USER_EXTENSION -#define TX_THREAD_USER_EXTENSION +#define TX_THREAD_USER_EXTENSION #endif @@ -219,8 +221,8 @@ typedef unsigned short USHORT; tx_thread_shell_entry, and tx_thread_terminate. */ -#define TX_THREAD_CREATE_EXTENSION(thread_ptr) -#define TX_THREAD_DELETE_EXTENSION(thread_ptr) +#define TX_THREAD_CREATE_EXTENSION(thread_ptr) +#define TX_THREAD_DELETE_EXTENSION(thread_ptr) #define TX_THREAD_COMPLETED_EXTENSION(thread_ptr) #define TX_THREAD_TERMINATED_EXTENSION(thread_ptr) @@ -247,24 +249,24 @@ typedef unsigned short USHORT; #define TX_TIMER_DELETE_EXTENSION(timer_ptr) -/* Determine if the ARM architecture has the CLZ instruction. This is available on - architectures v5 and above. If available, redefine the macro for calculating the +/* Determine if the ARM architecture has the CLZ instruction. This is available on + architectures v5 and above. If available, redefine the macro for calculating the lowest bit set. */ - + #if __TARGET_ARCH_ARM > 4 #ifndef __thumb__ #define TX_LOWEST_SET_BIT_CALCULATE(m, b) m = m & ((ULONG) (-((LONG) m))); \ asm volatile (" CLZ %0,%1 ": "=r" (b) : "r" (m) ); \ - b = 31 - b; + b = 31 - b; #endif #endif -/* Define ThreadX interrupt lockout and restore macros for protection on - access of critical kernel information. The restore interrupt macro must - restore the interrupt posture of the running thread prior to the value +/* Define ThreadX interrupt lockout and restore macros for protection on + access of critical kernel information. The restore interrupt macro must + restore the interrupt posture of the running thread prior to the value present prior to the disable macro. In most cases, the save area macro is used to define a local function save area for the disable and restore macros. */ @@ -295,7 +297,7 @@ unsigned int _tx_thread_interrupt_restore(UINT old_posture); #endif -/* Define VFP extension for the Cortex-A7. Each is assumed to be called in the context of the executing +/* Define VFP extension for the ARMv7-A. Each is assumed to be called in the context of the executing thread. */ void tx_thread_vfp_enable(void); @@ -315,8 +317,8 @@ void tx_thread_vfp_disable(void); /* Define the version ID of ThreadX. This may be utilized by the application. */ #ifdef TX_THREAD_INIT -CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-A7/GNU Version 6.1.9 *"; +CHAR _tx_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX ARMv7-A Version 6.1.11 *"; #else extern CHAR _tx_version_id[]; #endif diff --git a/ports/cortex_a7/gnu/src/tx_thread_context_restore.S b/ports/cortex_a7/gnu/src/tx_thread_context_restore.S index 5139d8ca..fae7e72d 100644 --- a/ports/cortex_a7/gnu/src/tx_thread_context_restore.S +++ b/ports/cortex_a7/gnu/src/tx_thread_context_restore.S @@ -1,260 +1,222 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .arm #ifdef TX_ENABLE_FIQ_SUPPORT -SVC_MODE = 0xD3 @ Disable IRQ/FIQ, SVC mode -IRQ_MODE = 0xD2 @ Disable IRQ/FIQ, IRQ mode +SVC_MODE = 0xD3 // Disable IRQ/FIQ, SVC mode +IRQ_MODE = 0xD2 // Disable IRQ/FIQ, IRQ mode #else -SVC_MODE = 0x93 @ Disable IRQ, SVC mode -IRQ_MODE = 0x92 @ Disable IRQ, IRQ mode +SVC_MODE = 0x93 // Disable IRQ, SVC mode +IRQ_MODE = 0x92 // Disable IRQ, IRQ mode #endif -@ + .global _tx_thread_system_state .global _tx_thread_current_ptr .global _tx_thread_execute_ptr .global _tx_timer_time_slice .global _tx_thread_schedule .global _tx_thread_preempt_disable - .global _tx_execution_isr_exit -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_restore -@ since it will never be called 16-bit mode. */ -@ + + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_restore + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_context_restore Cortex-A7/GNU */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function restores the interrupt context if it is processing a */ -@/* nested interrupt. If not, it returns to the interrupt thread if no */ -@/* preemption is necessary. Otherwise, if preemption is necessary or */ -@/* if no thread was running, the function returns to the scheduler. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* _tx_thread_schedule Thread scheduling routine */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs Interrupt Service Routines */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_context_restore(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_context_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function restores the interrupt context if it is processing a */ +/* nested interrupt. If not, it returns to the interrupt thread if no */ +/* preemption is necessary. Otherwise, if preemption is necessary or */ +/* if no thread was running, the function returns to the scheduler. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling routine */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs Interrupt Service Routines */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_context_restore .type _tx_thread_context_restore,function _tx_thread_context_restore: -@ -@ /* Lockout interrupts. */ -@ + + /* Lockout interrupts. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ interrupts + CPSID if // Disable IRQ and FIQ interrupts #else - CPSID i @ Disable IRQ interrupts + CPSID i // Disable IRQ interrupts #endif #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR exit function to indicate an ISR is complete. */ -@ - BL _tx_execution_isr_exit @ Call the ISR exit function -#endif -@ -@ /* Determine if interrupts are nested. */ -@ if (--_tx_thread_system_state) -@ { -@ - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3] @ Pickup system state - SUB r2, r2, #1 @ Decrement the counter - STR r2, [r3] @ Store the counter - CMP r2, #0 @ Was this the first interrupt? - BEQ __tx_thread_not_nested_restore @ If so, not a nested restore -@ -@ /* Interrupts are nested. */ -@ -@ /* Just recover the saved registers and return to the point of -@ interrupt. */ -@ - LDMIA sp!, {r0, r10, r12, lr} @ Recover SPSR, POI, and scratch regs - MSR SPSR_cxsf, r0 @ Put SPSR back - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOVS pc, lr @ Return to point of interrupt -@ -@ } -__tx_thread_not_nested_restore: -@ -@ /* Determine if a thread was interrupted and no preemption is required. */ -@ else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr) -@ || (_tx_thread_preempt_disable)) -@ { -@ - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup actual current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_idle_system_restore @ Yes, idle system was interrupted -@ - LDR r3, =_tx_thread_preempt_disable @ Pickup preempt disable address - LDR r2, [r3] @ Pickup actual preempt disable flag - CMP r2, #0 @ Is it set? - BNE __tx_thread_no_preempt_restore @ Yes, don't preempt this thread - LDR r3, =_tx_thread_execute_ptr @ Pickup address of execute thread ptr - LDR r2, [r3] @ Pickup actual execute thread pointer - CMP r0, r2 @ Is the same thread highest priority? - BNE __tx_thread_preempt_restore @ No, preemption needs to happen -@ -@ -__tx_thread_no_preempt_restore: -@ -@ /* Restore interrupted thread or ISR. */ -@ -@ /* Pickup the saved stack pointer. */ -@ tmp_ptr = _tx_thread_current_ptr -> tx_thread_stack_ptr; -@ -@ /* Recover the saved context and return to the point of interrupt. */ -@ - LDMIA sp!, {r0, r10, r12, lr} @ Recover SPSR, POI, and scratch regs - MSR SPSR_cxsf, r0 @ Put SPSR back - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOVS pc, lr @ Return to point of interrupt -@ -@ } -@ else -@ { -__tx_thread_preempt_restore: -@ - LDMIA sp!, {r3, r10, r12, lr} @ Recover temporarily saved registers - MOV r1, lr @ Save lr (point of interrupt) - MOV r2, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r2 @ Enter SVC mode - STR r1, [sp, #-4]! @ Save point of interrupt - STMDB sp!, {r4-r12, lr} @ Save upper half of registers - MOV r4, r3 @ Save SPSR in r4 - MOV r2, #IRQ_MODE @ Build IRQ mode CPSR - MSR CPSR_c, r2 @ Enter IRQ mode - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOV r5, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r5 @ Enter SVC mode - STMDB sp!, {r0-r3} @ Save r0-r3 on thread's stack - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup current thread pointer + /* Call the ISR exit function to indicate an ISR is complete. */ + + BL _tx_execution_isr_exit // Call the ISR exit function +#endif + + /* Determine if interrupts are nested. */ + + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + SUB r2, r2, #1 // Decrement the counter + STR r2, [r3] // Store the counter + CMP r2, #0 // Was this the first interrupt? + BEQ __tx_thread_not_nested_restore // If so, not a nested restore + + /* Interrupts are nested. */ + + /* Just recover the saved registers and return to the point of + interrupt. */ + + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_not_nested_restore: + + /* Determine if a thread was interrupted and no preemption is required. */ + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup actual current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_restore // Yes, idle system was interrupted + + LDR r3, =_tx_thread_preempt_disable // Pickup preempt disable address + LDR r2, [r3] // Pickup actual preempt disable flag + CMP r2, #0 // Is it set? + BNE __tx_thread_no_preempt_restore // Yes, don't preempt this thread + LDR r3, =_tx_thread_execute_ptr // Pickup address of execute thread ptr + LDR r2, [r3] // Pickup actual execute thread pointer + CMP r0, r2 // Is the same thread highest priority? + BNE __tx_thread_preempt_restore // No, preemption needs to happen + + +__tx_thread_no_preempt_restore: + + /* Recover the saved context and return to the point of interrupt. */ + + /* Pickup the saved stack pointer. */ + + /* Recover the saved context and return to the point of interrupt. */ + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_preempt_restore: + + LDMIA sp!, {r3, r10, r12, lr} // Recover temporarily saved registers + MOV r1, lr // Save lr (point of interrupt) + MOV r2, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r2 // Enter SVC mode + STR r1, [sp, #-4]! // Save point of interrupt + STMDB sp!, {r4-r12, lr} // Save upper half of registers + MOV r4, r3 // Save SPSR in r4 + MOV r2, #IRQ_MODE // Build IRQ mode CPSR + MSR CPSR_c, r2 // Enter IRQ mode + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOV r5, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r5 // Enter SVC mode + STMDB sp!, {r0-r3} // Save r0-r3 on thread's stack + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer #ifdef TX_ENABLE_VFP_SUPPORT - LDR r2, [r0, #144] @ Pickup the VFP enabled flag - CMP r2, #0 @ Is the VFP enabled? - BEQ _tx_skip_irq_vfp_save @ No, skip VFP IRQ save - VMRS r2, FPSCR @ Pickup the FPSCR - STR r2, [sp, #-4]! @ Save FPSCR - VSTMDB sp!, {D16-D31} @ Save D16-D31 - VSTMDB sp!, {D0-D15} @ Save D0-D15 + LDR r2, [r0, #144] // Pickup the VFP enabled flag + CMP r2, #0 // Is the VFP enabled? + BEQ _tx_skip_irq_vfp_save // No, skip VFP IRQ save + VMRS r2, FPSCR // Pickup the FPSCR + STR r2, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D0-D15} // Save D0-D15 + _tx_skip_irq_vfp_save: + #endif - MOV r3, #1 @ Build interrupt stack type - STMDB sp!, {r3, r4} @ Save interrupt stack type and SPSR - STR sp, [r0, #8] @ Save stack pointer in thread control - @ block -@ -@ /* Save the remaining time-slice and disable it. */ -@ if (_tx_timer_time_slice) -@ { -@ - LDR r3, =_tx_timer_time_slice @ Pickup time-slice variable address - LDR r2, [r3] @ Pickup time-slice - CMP r2, #0 @ Is it active? - BEQ __tx_thread_dont_save_ts @ No, don't save it -@ -@ _tx_thread_current_ptr -> tx_thread_time_slice = _tx_timer_time_slice; -@ _tx_timer_time_slice = 0; -@ - STR r2, [r0, #24] @ Save thread's time-slice - MOV r2, #0 @ Clear value - STR r2, [r3] @ Disable global time-slice flag -@ -@ } + MOV r3, #1 // Build interrupt stack type + STMDB sp!, {r3, r4} // Save interrupt stack type and SPSR + STR sp, [r0, #8] // Save stack pointer in thread control + // block + + /* Save the remaining time-slice and disable it. */ + LDR r3, =_tx_timer_time_slice // Pickup time-slice variable address + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it active? + BEQ __tx_thread_dont_save_ts // No, don't save it + STR r2, [r0, #24] // Save thread's time-slice + MOV r2, #0 // Clear value + STR r2, [r3] // Disable global time-slice flag + __tx_thread_dont_save_ts: -@ -@ -@ /* Clear the current task pointer. */ -@ _tx_thread_current_ptr = TX_NULL; -@ - MOV r0, #0 @ NULL value - STR r0, [r1] @ Clear current thread pointer -@ -@ /* Return to the scheduler. */ -@ _tx_thread_schedule(); -@ - B _tx_thread_schedule @ Return to scheduler -@ } -@ + + /* Clear the current task pointer. */ + MOV r0, #0 // NULL value + STR r0, [r1] // Clear current thread pointer + + /* Return to the scheduler. */ + B _tx_thread_schedule // Return to scheduler + __tx_thread_idle_system_restore: -@ -@ /* Just return back to the scheduler! */ -@ - MOV r0, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r0 @ Enter SVC mode - B _tx_thread_schedule @ Return to scheduler -@} - - + /* Just return back to the scheduler! */ + MOV r0, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r0 // Enter SVC mode + B _tx_thread_schedule // Return to scheduler diff --git a/ports/cortex_a7/gnu/src/tx_thread_context_save.S b/ports/cortex_a7/gnu/src/tx_thread_context_save.S index ef8ed6b9..7ac48c2e 100644 --- a/ports/cortex_a7/gnu/src/tx_thread_context_save.S +++ b/ports/cortex_a7/gnu/src/tx_thread_context_save.S @@ -1,206 +1,172 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .global _tx_thread_system_state .global _tx_thread_current_ptr - .global _tx_irq_processing_return - .global _tx_execution_isr_enter -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_save -@ since it will never be called 16-bit mode. */ -@ + .global __tx_irq_processing_return + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_save + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_context_save Cortex-A7/GNU */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function saves the context of an executing thread in the */ -@/* beginning of interrupt processing. The function also ensures that */ -@/* the system stack is used upon return to the calling ISR. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_context_save(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_context_save .type _tx_thread_context_save,function _tx_thread_context_save: -@ -@ /* Upon entry to this routine, it is assumed that IRQ interrupts are locked -@ out, we are in IRQ mode, and all registers are intact. */ -@ -@ /* Check for a nested interrupt condition. */ -@ if (_tx_thread_system_state++) -@ { -@ - STMDB sp!, {r0-r3} @ Save some working registers + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + + STMDB sp!, {r0-r3} // Save some working registers #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable FIQ interrupts + CPSID if // Disable FIQ interrupts #endif - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3] @ Pickup system state - CMP r2, #0 @ Is this the first interrupt? - BEQ __tx_thread_not_nested_save @ Yes, not a nested context save -@ -@ /* Nested interrupt condition. */ -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3] @ Store it back in the variable -@ -@ /* Save the rest of the scratch registers on the stack and return to the -@ calling ISR. */ -@ - MRS r0, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r0, r10, r12, lr} @ Store other registers -@ -@ /* Return to the ISR. */ -@ - MOV r10, #0 @ Clear stack limit + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + + /* Save the rest of the scratch registers on the stack and return to the + calling ISR. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, r10, r12, lr} // Store other registers + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - B __tx_irq_processing_return @ Continue IRQ processing -@ + B __tx_irq_processing_return // Continue IRQ processing + __tx_thread_not_nested_save: -@ } -@ -@ /* Otherwise, not nested, check to see if a thread was running. */ -@ else if (_tx_thread_current_ptr) -@ { -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3] @ Store it back in the variable - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_idle_system_save @ If so, interrupt occurred in - @ scheduling loop - nothing needs saving! -@ -@ /* Save minimal context of interrupted thread. */ -@ - MRS r2, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r2, r10, r12, lr} @ Store other registers -@ -@ /* Save the current stack pointer in the thread's control block. */ -@ _tx_thread_current_ptr -> tx_thread_stack_ptr = sp; -@ -@ /* Switch to the system stack. */ -@ sp = _tx_thread_system_stack_ptr@ -@ - MOV r10, #0 @ Clear stack limit + + /* Otherwise, not nested, check to see if a thread was running. */ + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + + /* Save minimal context of interrupted thread. */ + + MRS r2, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r2, r10, r12, lr} // Store other registers + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - B __tx_irq_processing_return @ Continue IRQ processing -@ -@ } -@ else -@ { -@ + B __tx_irq_processing_return // Continue IRQ processing + __tx_thread_idle_system_save: -@ -@ /* Interrupt occurred in the scheduling loop. */ -@ -@ /* Not much to do here, just adjust the stack pointer, and return to IRQ -@ processing. */ -@ - MOV r10, #0 @ Clear stack limit + + /* Interrupt occurred in the scheduling loop. */ + + /* Not much to do here, just adjust the stack pointer, and return to IRQ + processing. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - ADD sp, sp, #16 @ Recover saved registers - B __tx_irq_processing_return @ Continue IRQ processing -@ -@ } -@} - - - + ADD sp, sp, #16 // Recover saved registers + B __tx_irq_processing_return // Continue IRQ processing diff --git a/ports/cortex_a7/gnu/src/tx_thread_fiq_context_restore.S b/ports/cortex_a7/gnu/src/tx_thread_fiq_context_restore.S index a0544f05..006be973 100644 --- a/ports/cortex_a7/gnu/src/tx_thread_fiq_context_restore.S +++ b/ports/cortex_a7/gnu/src/tx_thread_fiq_context_restore.S @@ -1,43 +1,32 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ -@ -SVC_MODE = 0xD3 @ SVC mode -FIQ_MODE = 0xD1 @ FIQ mode -MODE_MASK = 0x1F @ Mode mask -THUMB_MASK = 0x20 @ Thumb bit mask -IRQ_MODE_BITS = 0x12 @ IRQ mode bits -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +SVC_MODE = 0xD3 // SVC mode +FIQ_MODE = 0xD1 // FIQ mode +MODE_MASK = 0x1F // Mode mask +THUMB_MASK = 0x20 // Thumb bit mask +IRQ_MODE_BITS = 0x12 // IRQ mode bits + + .global _tx_thread_system_state .global _tx_thread_current_ptr .global _tx_thread_system_stack_ptr @@ -46,218 +35,189 @@ IRQ_MODE_BITS = 0x12 @ IRQ mode bits .global _tx_thread_schedule .global _tx_thread_preempt_disable .global _tx_execution_isr_exit -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_restore -@ since it will never be called 16-bit mode. */ -@ + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_restore + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_fiq_context_restore Cortex-A7/GNU */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function restores the fiq interrupt context when processing a */ -@/* nested interrupt. If not, it returns to the interrupt thread if no */ -@/* preemption is necessary. Otherwise, if preemption is necessary or */ -@/* if no thread was running, the function returns to the scheduler. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* _tx_thread_schedule Thread scheduling routine */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* FIQ ISR Interrupt Service Routines */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_fiq_context_restore(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_context_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function restores the fiq interrupt context when processing a */ +/* nested interrupt. If not, it returns to the interrupt thread if no */ +/* preemption is necessary. Otherwise, if preemption is necessary or */ +/* if no thread was running, the function returns to the scheduler. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling routine */ +/* */ +/* CALLED BY */ +/* */ +/* FIQ ISR Interrupt Service Routines */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_fiq_context_restore .type _tx_thread_fiq_context_restore,function _tx_thread_fiq_context_restore: -@ -@ /* Lockout interrupts. */ -@ - CPSID if @ Disable IRQ and FIQ interrupts + + /* Lockout interrupts. */ + + CPSID if // Disable IRQ and FIQ interrupts #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR exit function to indicate an ISR is complete. */ -@ - BL _tx_execution_isr_exit @ Call the ISR exit function + + /* Call the ISR exit function to indicate an ISR is complete. */ + + BL _tx_execution_isr_exit // Call the ISR exit function #endif -@ -@ /* Determine if interrupts are nested. */ -@ if (--_tx_thread_system_state) -@ { -@ - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3] @ Pickup system state - SUB r2, r2, #1 @ Decrement the counter - STR r2, [r3] @ Store the counter - CMP r2, #0 @ Was this the first interrupt? - BEQ __tx_thread_fiq_not_nested_restore @ If so, not a nested restore -@ -@ /* Interrupts are nested. */ -@ -@ /* Just recover the saved registers and return to the point of -@ interrupt. */ -@ - LDMIA sp!, {r0, r10, r12, lr} @ Recover SPSR, POI, and scratch regs - MSR SPSR_cxsf, r0 @ Put SPSR back - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOVS pc, lr @ Return to point of interrupt -@ -@ } + + /* Determine if interrupts are nested. */ + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + SUB r2, r2, #1 // Decrement the counter + STR r2, [r3] // Store the counter + CMP r2, #0 // Was this the first interrupt? + BEQ __tx_thread_fiq_not_nested_restore // If so, not a nested restore + + /* Interrupts are nested. */ + + /* Just recover the saved registers and return to the point of + interrupt. */ + + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + __tx_thread_fiq_not_nested_restore: -@ -@ /* Determine if a thread was interrupted and no preemption is required. */ -@ else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr) -@ || (_tx_thread_preempt_disable)) -@ { -@ - LDR r1, [sp] @ Pickup the saved SPSR - MOV r2, #MODE_MASK @ Build mask to isolate the interrupted mode - AND r1, r1, r2 @ Isolate mode bits - CMP r1, #IRQ_MODE_BITS @ Was an interrupt taken in IRQ mode before we - @ got to context save? */ - BEQ __tx_thread_fiq_no_preempt_restore @ Yes, just go back to point of interrupt + + /* Determine if a thread was interrupted and no preemption is required. */ + + LDR r1, [sp] // Pickup the saved SPSR + MOV r2, #MODE_MASK // Build mask to isolate the interrupted mode + AND r1, r1, r2 // Isolate mode bits + CMP r1, #IRQ_MODE_BITS // Was an interrupt taken in IRQ mode before we + // got to context save? */ + BEQ __tx_thread_fiq_no_preempt_restore // Yes, just go back to point of interrupt - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup actual current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_fiq_idle_system_restore @ Yes, idle system was interrupted + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup actual current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_fiq_idle_system_restore // Yes, idle system was interrupted - LDR r3, =_tx_thread_preempt_disable @ Pickup preempt disable address - LDR r2, [r3] @ Pickup actual preempt disable flag - CMP r2, #0 @ Is it set? - BNE __tx_thread_fiq_no_preempt_restore @ Yes, don't preempt this thread - LDR r3, =_tx_thread_execute_ptr @ Pickup address of execute thread ptr - LDR r2, [r3] @ Pickup actual execute thread pointer - CMP r0, r2 @ Is the same thread highest priority? - BNE __tx_thread_fiq_preempt_restore @ No, preemption needs to happen + LDR r3, =_tx_thread_preempt_disable // Pickup preempt disable address + LDR r2, [r3] // Pickup actual preempt disable flag + CMP r2, #0 // Is it set? + BNE __tx_thread_fiq_no_preempt_restore // Yes, don't preempt this thread + LDR r3, =_tx_thread_execute_ptr // Pickup address of execute thread ptr + LDR r2, [r3] // Pickup actual execute thread pointer + CMP r0, r2 // Is the same thread highest priority? + BNE __tx_thread_fiq_preempt_restore // No, preemption needs to happen __tx_thread_fiq_no_preempt_restore: -@ -@ /* Restore interrupted thread or ISR. */ -@ -@ /* Pickup the saved stack pointer. */ -@ tmp_ptr = _tx_thread_current_ptr -> tx_thread_stack_ptr; -@ -@ /* Recover the saved context and return to the point of interrupt. */ -@ - LDMIA sp!, {r0, lr} @ Recover SPSR, POI, and scratch regs - MSR SPSR_cxsf, r0 @ Put SPSR back - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOVS pc, lr @ Return to point of interrupt -@ -@ } -@ else -@ { -__tx_thread_fiq_preempt_restore: -@ - LDMIA sp!, {r3, lr} @ Recover temporarily saved registers - MOV r1, lr @ Save lr (point of interrupt) - MOV r2, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r2 @ Enter SVC mode - STR r1, [sp, #-4]! @ Save point of interrupt - STMDB sp!, {r4-r12, lr} @ Save upper half of registers - MOV r4, r3 @ Save SPSR in r4 - MOV r2, #FIQ_MODE @ Build FIQ mode CPSR - MSR CPSR_c, r2 @ Reenter FIQ mode - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOV r5, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r5 @ Enter SVC mode - STMDB sp!, {r0-r3} @ Save r0-r3 on thread's stack - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup current thread pointer + /* Restore interrupted thread or ISR. */ + /* Recover the saved context and return to the point of interrupt. */ + + LDMIA sp!, {r0, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_fiq_preempt_restore: + + LDMIA sp!, {r3, lr} // Recover temporarily saved registers + MOV r1, lr // Save lr (point of interrupt) + MOV r2, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r2 // Enter SVC mode + STR r1, [sp, #-4]! // Save point of interrupt + STMDB sp!, {r4-r12, lr} // Save upper half of registers + MOV r4, r3 // Save SPSR in r4 + MOV r2, #FIQ_MODE // Build FIQ mode CPSR + MSR CPSR_c, r2 // Reenter FIQ mode + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOV r5, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r5 // Enter SVC mode + STMDB sp!, {r0-r3} // Save r0-r3 on thread's stack + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer #ifdef TX_ENABLE_VFP_SUPPORT - LDR r2, [r0, #144] @ Pickup the VFP enabled flag - CMP r2, #0 @ Is the VFP enabled? - BEQ _tx_skip_fiq_vfp_save @ No, skip VFP IRQ save - VMRS r2, FPSCR @ Pickup the FPSCR - STR r2, [sp, #-4]! @ Save FPSCR - VSTMDB sp!, {D16-D31} @ Save D16-D31 - VSTMDB sp!, {D0-D15} @ Save D0-D15 + LDR r2, [r0, #144] // Pickup the VFP enabled flag + CMP r2, #0 // Is the VFP enabled? + BEQ _tx_skip_fiq_vfp_save // No, skip VFP IRQ save + VMRS r2, FPSCR // Pickup the FPSCR + STR r2, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D0-D15} // Save D0-D15 _tx_skip_fiq_vfp_save: #endif - MOV r3, #1 @ Build interrupt stack type - STMDB sp!, {r3, r4} @ Save interrupt stack type and SPSR - STR sp, [r0, #8] @ Save stack pointer in thread control - @ block */ -@ -@ /* Save the remaining time-slice and disable it. */ -@ if (_tx_timer_time_slice) -@ { -@ - LDR r3, =_tx_timer_time_slice @ Pickup time-slice variable address - LDR r2, [r3] @ Pickup time-slice - CMP r2, #0 @ Is it active? - BEQ __tx_thread_fiq_dont_save_ts @ No, don't save it -@ -@ _tx_thread_current_ptr -> tx_thread_time_slice = _tx_timer_time_slice; -@ _tx_timer_time_slice = 0; -@ - STR r2, [r0, #24] @ Save thread's time-slice - MOV r2, #0 @ Clear value - STR r2, [r3] @ Disable global time-slice flag -@ -@ } -__tx_thread_fiq_dont_save_ts: -@ -@ -@ /* Clear the current task pointer. */ -@ _tx_thread_current_ptr = TX_NULL; -@ - MOV r0, #0 @ NULL value - STR r0, [r1] @ Clear current thread pointer -@ -@ /* Return to the scheduler. */ -@ _tx_thread_schedule(); -@ - B _tx_thread_schedule @ Return to scheduler -@ } -@ -__tx_thread_fiq_idle_system_restore: -@ -@ /* Just return back to the scheduler! */ -@ - ADD sp, sp, #24 @ Recover FIQ stack space - MOV r3, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r3 @ Lockout interrupts - B _tx_thread_schedule @ Return to scheduler -@ -@} + MOV r3, #1 // Build interrupt stack type + STMDB sp!, {r3, r4} // Save interrupt stack type and SPSR + STR sp, [r0, #8] // Save stack pointer in thread control + // block */ + LDR r3, =_tx_timer_time_slice // Pickup time-slice variable address + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it active? + BEQ __tx_thread_fiq_dont_save_ts // No, don't save it + + STR r2, [r0, #24] // Save thread's time-slice + MOV r2, #0 // Clear value + STR r2, [r3] // Disable global time-slice flag + +__tx_thread_fiq_dont_save_ts: + + /* Clear the current task pointer. */ + + MOV r0, #0 // NULL value + STR r0, [r1] // Clear current thread pointer + + /* Return to the scheduler. */ + + B _tx_thread_schedule // Return to scheduler + +__tx_thread_fiq_idle_system_restore: + + /* Just return back to the scheduler! */ + + ADD sp, sp, #24 // Recover FIQ stack space + MOV r3, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r3 // Lockout interrupts + B _tx_thread_schedule // Return to scheduler diff --git a/ports/cortex_a7/gnu/src/tx_thread_fiq_context_save.S b/ports/cortex_a7/gnu/src/tx_thread_fiq_context_save.S index e2d12b36..7db6a4c2 100644 --- a/ports/cortex_a7/gnu/src/tx_thread_fiq_context_save.S +++ b/ports/cortex_a7/gnu/src/tx_thread_fiq_context_save.S @@ -1,207 +1,178 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .global _tx_thread_system_state .global _tx_thread_current_ptr .global __tx_fiq_processing_return .global _tx_execution_isr_enter -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_save -@ since it will never be called 16-bit mode. */ -@ + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_save + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_fiq_context_save Cortex-A7/GNU */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function saves the context of an executing thread in the */ -@/* beginning of interrupt processing. The function also ensures that */ -@/* the system stack is used upon return to the calling ISR. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@ VOID _tx_thread_fiq_context_save(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_fiq_context_save .type _tx_thread_fiq_context_save,function _tx_thread_fiq_context_save: -@ -@ /* Upon entry to this routine, it is assumed that IRQ interrupts are locked -@ out, we are in IRQ mode, and all registers are intact. */ -@ -@ /* Check for a nested interrupt condition. */ -@ if (_tx_thread_system_state++) -@ { -@ - STMDB sp!, {r0-r3} @ Save some working registers - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3] @ Pickup system state - CMP r2, #0 @ Is this the first interrupt? - BEQ __tx_thread_fiq_not_nested_save @ Yes, not a nested context save -@ -@ /* Nested interrupt condition. */ -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3] @ Store it back in the variable -@ -@ /* Save the rest of the scratch registers on the stack and return to the -@ calling ISR. */ -@ - MRS r0, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r0, r10, r12, lr} @ Store other registers -@ -@ /* Return to the ISR. */ -@ - MOV r10, #0 @ Clear stack limit + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + + STMDB sp!, {r0-r3} // Save some working registers + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_fiq_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + + /* Save the rest of the scratch registers on the stack and return to the + calling ISR. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, r10, r12, lr} // Store other registers + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - B __tx_fiq_processing_return @ Continue FIQ processing -@ + B __tx_fiq_processing_return // Continue FIQ processing +// __tx_thread_fiq_not_nested_save: -@ } -@ -@ /* Otherwise, not nested, check to see if a thread was running. */ -@ else if (_tx_thread_current_ptr) -@ { -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3] @ Store it back in the variable - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_fiq_idle_system_save @ If so, interrupt occurred in -@ @ scheduling loop - nothing needs saving! -@ -@ /* Save minimal context of interrupted thread. */ -@ - MRS r2, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r2, lr} @ Store other registers, Note that we don't -@ @ need to save sl and ip since FIQ has -@ @ copies of these registers. Nested -@ @ interrupt processing does need to save -@ @ these registers. -@ -@ /* Save the current stack pointer in the thread's control block. */ -@ _tx_thread_current_ptr -> tx_thread_stack_ptr = sp; -@ -@ /* Switch to the system stack. */ -@ sp = _tx_thread_system_stack_ptr; -@ - MOV r10, #0 @ Clear stack limit + + /* Otherwise, not nested, check to see if a thread was running. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_fiq_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + + /* Save minimal context of interrupted thread. */ + + MRS r2, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r2, lr} // Store other registers, Note that we don't + // need to save sl and ip since FIQ has + // copies of these registers. Nested + // interrupt processing does need to save + // these registers. + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - B __tx_fiq_processing_return @ Continue FIQ processing -@ -@ } -@ else -@ { -@ + B __tx_fiq_processing_return // Continue FIQ processing + __tx_thread_fiq_idle_system_save: -@ -@ /* Interrupt occurred in the scheduling loop. */ -@ -#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr -#endif -@ -@ /* Not much to do here, save the current SPSR and LR for possible -@ use in IRQ interrupted in idle system conditions, and return to -@ FIQ interrupt processing. */ -@ - MRS r0, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r0, lr} @ Store other registers that will get used -@ @ or stripped off the stack in context -@ @ restore - B __tx_fiq_processing_return @ Continue FIQ processing -@ -@ } -@} + /* Interrupt occurred in the scheduling loop. */ + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + /* Not much to do here, save the current SPSR and LR for possible + use in IRQ interrupted in idle system conditions, and return to + FIQ interrupt processing. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, lr} // Store other registers that will get used + // or stripped off the stack in context + // restore + B __tx_fiq_processing_return // Continue FIQ processing diff --git a/ports/cortex_a7/gnu/src/tx_thread_fiq_nesting_end.S b/ports/cortex_a7/gnu/src/tx_thread_fiq_nesting_end.S index 2df342b3..b34d881e 100644 --- a/ports/cortex_a7/gnu/src/tx_thread_fiq_nesting_end.S +++ b/ports/cortex_a7/gnu/src/tx_thread_fiq_nesting_end.S @@ -1,116 +1,104 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + #ifdef TX_ENABLE_FIQ_SUPPORT -DISABLE_INTS = 0xC0 @ Disable IRQ/FIQ interrupts +DISABLE_INTS = 0xC0 // Disable IRQ/FIQ interrupts #else -DISABLE_INTS = 0x80 @ Disable IRQ interrupts +DISABLE_INTS = 0x80 // Disable IRQ interrupts #endif -MODE_MASK = 0x1F @ Mode mask -FIQ_MODE_BITS = 0x11 @ FIQ mode bits -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_end -@ since it will never be called 16-bit mode. */ -@ +MODE_MASK = 0x1F // Mode mask +FIQ_MODE_BITS = 0x11 // FIQ mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_end + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_fiq_nesting_end Cortex-A7/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is called by the application from FIQ mode after */ -@/* _tx_thread_fiq_nesting_start has been called and switches the FIQ */ -@/* processing from system mode back to FIQ mode prior to the ISR */ -@/* calling _tx_thread_fiq_context_restore. Note that this function */ -@/* assumes the system stack pointer is in the same position after */ -@/* nesting start function was called. */ -@/* */ -@/* This function assumes that the system mode stack pointer was setup */ -@/* during low-level initialization (tx_initialize_low_level.s). */ -@/* */ -@/* This function returns with FIQ interrupts disabled. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_fiq_nesting_end(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_nesting_end ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from FIQ mode after */ +/* _tx_thread_fiq_nesting_start has been called and switches the FIQ */ +/* processing from system mode back to FIQ mode prior to the ISR */ +/* calling _tx_thread_fiq_context_restore. Note that this function */ +/* assumes the system stack pointer is in the same position after */ +/* nesting start function was called. */ +/* */ +/* This function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with FIQ interrupts disabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_fiq_nesting_end .type _tx_thread_fiq_nesting_end,function _tx_thread_fiq_nesting_end: - MOV r3,lr @ Save ISR return address - MRS r0, CPSR @ Pickup the CPSR - ORR r0, r0, #DISABLE_INTS @ Build disable interrupt value - MSR CPSR_c, r0 @ Disable interrupts - LDMIA sp!, {r1, lr} @ Pickup saved lr (and r1 throw-away for - @ 8-byte alignment logic) - BIC r0, r0, #MODE_MASK @ Clear mode bits - ORR r0, r0, #FIQ_MODE_BITS @ Build IRQ mode CPSR - MSR CPSR_c, r0 @ Reenter IRQ mode + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + ORR r0, r0, #DISABLE_INTS // Build disable interrupt value + MSR CPSR_c, r0 // Disable interrupts + LDMIA sp!, {r1, lr} // Pickup saved lr (and r1 throw-away for + // 8-byte alignment logic) + BIC r0, r0, #MODE_MASK // Clear mode bits + ORR r0, r0, #FIQ_MODE_BITS // Build IRQ mode CPSR + MSR CPSR_c, r0 // Reenter IRQ mode #ifdef __THUMB_INTERWORK - BX r3 @ Return to caller + BX r3 // Return to caller #else - MOV pc, r3 @ Return to caller + MOV pc, r3 // Return to caller #endif -@} - diff --git a/ports/cortex_a7/gnu/src/tx_thread_fiq_nesting_start.S b/ports/cortex_a7/gnu/src/tx_thread_fiq_nesting_start.S index 1028d4cf..c9cd5a06 100644 --- a/ports/cortex_a7/gnu/src/tx_thread_fiq_nesting_start.S +++ b/ports/cortex_a7/gnu/src/tx_thread_fiq_nesting_start.S @@ -1,108 +1,96 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ -FIQ_DISABLE = 0x40 @ FIQ disable bit -MODE_MASK = 0x1F @ Mode mask -SYS_MODE_BITS = 0x1F @ System mode bits -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_start -@ since it will never be called 16-bit mode. */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +FIQ_DISABLE = 0x40 // FIQ disable bit +MODE_MASK = 0x1F // Mode mask +SYS_MODE_BITS = 0x1F // System mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_start + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_fiq_nesting_start Cortex-A7/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is called by the application from FIQ mode after */ -@/* _tx_thread_fiq_context_save has been called and switches the FIQ */ -@/* processing to the system mode so nested FIQ interrupt processing */ -@/* is possible (system mode has its own "lr" register). Note that */ -@/* this function assumes that the system mode stack pointer was setup */ -@/* during low-level initialization (tx_initialize_low_level.s). */ -@/* */ -@/* This function returns with FIQ interrupts enabled. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_fiq_nesting_start(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_nesting_start ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from FIQ mode after */ +/* _tx_thread_fiq_context_save has been called and switches the FIQ */ +/* processing to the system mode so nested FIQ interrupt processing */ +/* is possible (system mode has its own "lr" register). Note that */ +/* this function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with FIQ interrupts enabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_fiq_nesting_start .type _tx_thread_fiq_nesting_start,function _tx_thread_fiq_nesting_start: - MOV r3,lr @ Save ISR return address - MRS r0, CPSR @ Pickup the CPSR - BIC r0, r0, #MODE_MASK @ Clear the mode bits - ORR r0, r0, #SYS_MODE_BITS @ Build system mode CPSR - MSR CPSR_c, r0 @ Enter system mode - STMDB sp!, {r1, lr} @ Push the system mode lr on the system mode stack - @ and push r1 just to keep 8-byte alignment - BIC r0, r0, #FIQ_DISABLE @ Build enable FIQ CPSR - MSR CPSR_c, r0 @ Enter system mode + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + BIC r0, r0, #MODE_MASK // Clear the mode bits + ORR r0, r0, #SYS_MODE_BITS // Build system mode CPSR + MSR CPSR_c, r0 // Enter system mode + STMDB sp!, {r1, lr} // Push the system mode lr on the system mode stack + // and push r1 just to keep 8-byte alignment + BIC r0, r0, #FIQ_DISABLE // Build enable FIQ CPSR + MSR CPSR_c, r0 // Enter system mode #ifdef __THUMB_INTERWORK - BX r3 @ Return to caller + BX r3 // Return to caller #else - MOV pc, r3 @ Return to caller + MOV pc, r3 // Return to caller #endif -@} - diff --git a/ports/cortex_a7/gnu/src/tx_thread_interrupt_control.S b/ports/cortex_a7/gnu/src/tx_thread_interrupt_control.S index e3825784..63b1609a 100644 --- a/ports/cortex_a7/gnu/src/tx_thread_interrupt_control.S +++ b/ports/cortex_a7/gnu/src/tx_thread_interrupt_control.S @@ -1,115 +1,104 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ INT_MASK = 0x03F -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_control for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_control for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_interrupt_control $_tx_thread_interrupt_control: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_interrupt_control @ Call _tx_thread_interrupt_control function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_control // Call _tx_thread_interrupt_control function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_interrupt_control Cortex-A7/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is responsible for changing the interrupt lockout */ -@/* posture of the system. */ -@/* */ -@/* INPUT */ -@/* */ -@/* new_posture New interrupt lockout posture */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* old_posture Old interrupt lockout posture */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* Application Code */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@UINT _tx_thread_interrupt_control(UINT new_posture) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_control ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for changing the interrupt lockout */ +/* posture of the system. */ +/* */ +/* INPUT */ +/* */ +/* new_posture New interrupt lockout posture */ +/* */ +/* OUTPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_interrupt_control .type _tx_thread_interrupt_control,function _tx_thread_interrupt_control: -@ -@ /* Pickup current interrupt lockout posture. */ -@ - MRS r3, CPSR @ Pickup current CPSR - MOV r2, #INT_MASK @ Build interrupt mask - AND r1, r3, r2 @ Clear interrupt lockout bits - ORR r1, r1, r0 @ Or-in new interrupt lockout bits -@ -@ /* Apply the new interrupt posture. */ -@ - MSR CPSR_c, r1 @ Setup new CPSR - BIC r0, r3, r2 @ Return previous interrupt mask -#ifdef __THUMB_INTERWORK - BX lr @ Return to caller -#else - MOV pc, lr @ Return to caller -#endif -@} + /* Pickup current interrupt lockout posture. */ + + MRS r3, CPSR // Pickup current CPSR + MOV r2, #INT_MASK // Build interrupt mask + AND r1, r3, r2 // Clear interrupt lockout bits + ORR r1, r1, r0 // Or-in new interrupt lockout bits + + /* Apply the new interrupt posture. */ + + MSR CPSR_c, r1 // Setup new CPSR + BIC r0, r3, r2 // Return previous interrupt mask +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a7/gnu/src/tx_thread_interrupt_disable.S b/ports/cortex_a7/gnu/src/tx_thread_interrupt_disable.S index bb62310b..13258808 100644 --- a/ports/cortex_a7/gnu/src/tx_thread_interrupt_disable.S +++ b/ports/cortex_a7/gnu/src/tx_thread_interrupt_disable.S @@ -1,113 +1,101 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_disable for -@ applications calling this function from to 16-bit Thumb mode. */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_disable for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_interrupt_disable $_tx_thread_interrupt_disable: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_interrupt_disable @ Call _tx_thread_interrupt_disable function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_disable // Call _tx_thread_interrupt_disable function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_interrupt_disable Cortex-A7/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is responsible for disabling interrupts */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* old_posture Old interrupt lockout posture */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* Application Code */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@UINT _tx_thread_interrupt_disable(void) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_disable ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for disabling interrupts */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_interrupt_disable .type _tx_thread_interrupt_disable,function _tx_thread_interrupt_disable: -@ -@ /* Pickup current interrupt lockout posture. */ -@ - MRS r0, CPSR @ Pickup current CPSR -@ -@ /* Mask interrupts. */ -@ + + /* Pickup current interrupt lockout posture. */ + + MRS r0, CPSR // Pickup current CPSR + + /* Mask interrupts. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ + CPSID if // Disable IRQ and FIQ #else - CPSID i @ Disable IRQ + CPSID i // Disable IRQ #endif #ifdef __THUMB_INTERWORK - BX lr @ Return to caller + BX lr // Return to caller #else - MOV pc, lr @ Return to caller + MOV pc, lr // Return to caller #endif -@} - - diff --git a/ports/cortex_a7/gnu/src/tx_thread_interrupt_restore.S b/ports/cortex_a7/gnu/src/tx_thread_interrupt_restore.S index f914fc31..2d582511 100644 --- a/ports/cortex_a7/gnu/src/tx_thread_interrupt_restore.S +++ b/ports/cortex_a7/gnu/src/tx_thread_interrupt_restore.S @@ -1,104 +1,93 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_restore for -@ applications calling this function from to 16-bit Thumb mode. */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_restore for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_interrupt_restore $_tx_thread_interrupt_restore: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_interrupt_restore @ Call _tx_thread_interrupt_restore function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_restore // Call _tx_thread_interrupt_restore function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_interrupt_restore Cortex-A7/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is responsible for restoring interrupts to the state */ -@/* returned by a previous _tx_thread_interrupt_disable call. */ -@/* */ -@/* INPUT */ -@/* */ -@/* old_posture Old interrupt lockout posture */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* Application Code */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@UINT _tx_thread_interrupt_restore(UINT old_posture) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for restoring interrupts to the state */ +/* returned by a previous _tx_thread_interrupt_disable call. */ +/* */ +/* INPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_interrupt_restore .type _tx_thread_interrupt_restore,function _tx_thread_interrupt_restore: -@ -@ /* Apply the new interrupt posture. */ -@ - MSR CPSR_c, r0 @ Setup new CPSR -#ifdef __THUMB_INTERWORK - BX lr @ Return to caller -#else - MOV pc, lr @ Return to caller -#endif -@} + /* Apply the new interrupt posture. */ + + MSR CPSR_c, r0 // Setup new CPSR +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a7/gnu/src/tx_thread_irq_nesting_end.S b/ports/cortex_a7/gnu/src/tx_thread_irq_nesting_end.S index 61414de8..ec7e63c6 100644 --- a/ports/cortex_a7/gnu/src/tx_thread_irq_nesting_end.S +++ b/ports/cortex_a7/gnu/src/tx_thread_irq_nesting_end.S @@ -1,115 +1,103 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + #ifdef TX_ENABLE_FIQ_SUPPORT -DISABLE_INTS = 0xC0 @ Disable IRQ/FIQ interrupts +DISABLE_INTS = 0xC0 // Disable IRQ/FIQ interrupts #else -DISABLE_INTS = 0x80 @ Disable IRQ interrupts +DISABLE_INTS = 0x80 // Disable IRQ interrupts #endif -MODE_MASK = 0x1F @ Mode mask -IRQ_MODE_BITS = 0x12 @ IRQ mode bits -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_end -@ since it will never be called 16-bit mode. */ -@ +MODE_MASK = 0x1F // Mode mask +IRQ_MODE_BITS = 0x12 // IRQ mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_end + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_irq_nesting_end Cortex-A7/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is called by the application from IRQ mode after */ -@/* _tx_thread_irq_nesting_start has been called and switches the IRQ */ -@/* processing from system mode back to IRQ mode prior to the ISR */ -@/* calling _tx_thread_context_restore. Note that this function */ -@/* assumes the system stack pointer is in the same position after */ -@/* nesting start function was called. */ -@/* */ -@/* This function assumes that the system mode stack pointer was setup */ -@/* during low-level initialization (tx_initialize_low_level.s). */ -@/* */ -@/* This function returns with IRQ interrupts disabled. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_irq_nesting_end(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_irq_nesting_end ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from IRQ mode after */ +/* _tx_thread_irq_nesting_start has been called and switches the IRQ */ +/* processing from system mode back to IRQ mode prior to the ISR */ +/* calling _tx_thread_context_restore. Note that this function */ +/* assumes the system stack pointer is in the same position after */ +/* nesting start function was called. */ +/* */ +/* This function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with IRQ interrupts disabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_irq_nesting_end .type _tx_thread_irq_nesting_end,function _tx_thread_irq_nesting_end: - MOV r3,lr @ Save ISR return address - MRS r0, CPSR @ Pickup the CPSR - ORR r0, r0, #DISABLE_INTS @ Build disable interrupt value - MSR CPSR_c, r0 @ Disable interrupts - LDMIA sp!, {r1, lr} @ Pickup saved lr (and r1 throw-away for - @ 8-byte alignment logic) - BIC r0, r0, #MODE_MASK @ Clear mode bits - ORR r0, r0, #IRQ_MODE_BITS @ Build IRQ mode CPSR - MSR CPSR_c, r0 @ Reenter IRQ mode + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + ORR r0, r0, #DISABLE_INTS // Build disable interrupt value + MSR CPSR_c, r0 // Disable interrupts + LDMIA sp!, {r1, lr} // Pickup saved lr (and r1 throw-away for + // 8-byte alignment logic) + BIC r0, r0, #MODE_MASK // Clear mode bits + ORR r0, r0, #IRQ_MODE_BITS // Build IRQ mode CPSR + MSR CPSR_c, r0 // Reenter IRQ mode #ifdef __THUMB_INTERWORK - BX r3 @ Return to caller + BX r3 // Return to caller #else - MOV pc, r3 @ Return to caller + MOV pc, r3 // Return to caller #endif -@} - diff --git a/ports/cortex_a7/gnu/src/tx_thread_irq_nesting_start.S b/ports/cortex_a7/gnu/src/tx_thread_irq_nesting_start.S index 4d606250..c69976ed 100644 --- a/ports/cortex_a7/gnu/src/tx_thread_irq_nesting_start.S +++ b/ports/cortex_a7/gnu/src/tx_thread_irq_nesting_start.S @@ -1,108 +1,96 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ -IRQ_DISABLE = 0x80 @ IRQ disable bit -MODE_MASK = 0x1F @ Mode mask -SYS_MODE_BITS = 0x1F @ System mode bits -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_start -@ since it will never be called 16-bit mode. */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +IRQ_DISABLE = 0x80 // IRQ disable bit +MODE_MASK = 0x1F // Mode mask +SYS_MODE_BITS = 0x1F // System mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_start + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_irq_nesting_start Cortex-A7/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is called by the application from IRQ mode after */ -@/* _tx_thread_context_save has been called and switches the IRQ */ -@/* processing to the system mode so nested IRQ interrupt processing */ -@/* is possible (system mode has its own "lr" register). Note that */ -@/* this function assumes that the system mode stack pointer was setup */ -@/* during low-level initialization (tx_initialize_low_level.s). */ -@/* */ -@/* This function returns with IRQ interrupts enabled. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_irq_nesting_start(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_irq_nesting_start ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from IRQ mode after */ +/* _tx_thread_context_save has been called and switches the IRQ */ +/* processing to the system mode so nested IRQ interrupt processing */ +/* is possible (system mode has its own "lr" register). Note that */ +/* this function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with IRQ interrupts enabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_irq_nesting_start .type _tx_thread_irq_nesting_start,function _tx_thread_irq_nesting_start: - MOV r3,lr @ Save ISR return address - MRS r0, CPSR @ Pickup the CPSR - BIC r0, r0, #MODE_MASK @ Clear the mode bits - ORR r0, r0, #SYS_MODE_BITS @ Build system mode CPSR - MSR CPSR_c, r0 @ Enter system mode - STMDB sp!, {r1, lr} @ Push the system mode lr on the system mode stack - @ and push r1 just to keep 8-byte alignment - BIC r0, r0, #IRQ_DISABLE @ Build enable IRQ CPSR - MSR CPSR_c, r0 @ Enter system mode + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + BIC r0, r0, #MODE_MASK // Clear the mode bits + ORR r0, r0, #SYS_MODE_BITS // Build system mode CPSR + MSR CPSR_c, r0 // Enter system mode + STMDB sp!, {r1, lr} // Push the system mode lr on the system mode stack + // and push r1 just to keep 8-byte alignment + BIC r0, r0, #IRQ_DISABLE // Build enable IRQ CPSR + MSR CPSR_c, r0 // Enter system mode #ifdef __THUMB_INTERWORK - BX r3 @ Return to caller + BX r3 // Return to caller #else - MOV pc, r3 @ Return to caller + MOV pc, r3 // Return to caller #endif -@} - diff --git a/ports/cortex_a7/gnu/src/tx_thread_schedule.S b/ports/cortex_a7/gnu/src/tx_thread_schedule.S index c7e9c5c6..8330e9df 100644 --- a/ports/cortex_a7/gnu/src/tx_thread_schedule.S +++ b/ports/cortex_a7/gnu/src/tx_thread_schedule.S @@ -1,258 +1,230 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .global _tx_thread_execute_ptr .global _tx_thread_current_ptr .global _tx_timer_time_slice - .global _tx_execution_thread_enter -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_schedule for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_schedule for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_schedule .type $_tx_thread_schedule,function $_tx_thread_schedule: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_schedule @ Call _tx_thread_schedule function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_schedule // Call _tx_thread_schedule function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_schedule Cortex-A7/GNU */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function waits for a thread control block pointer to appear in */ -@/* the _tx_thread_execute_ptr variable. Once a thread pointer appears */ -@/* in the variable, the corresponding thread is resumed. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* _tx_initialize_kernel_enter ThreadX entry function */ -@/* _tx_thread_system_return Return to system from thread */ -@/* _tx_thread_context_restore Restore thread's context */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_schedule(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_schedule ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function waits for a thread control block pointer to appear in */ +/* the _tx_thread_execute_ptr variable. Once a thread pointer appears */ +/* in the variable, the corresponding thread is resumed. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_initialize_kernel_enter ThreadX entry function */ +/* _tx_thread_system_return Return to system from thread */ +/* _tx_thread_context_restore Restore thread's context */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_schedule .type _tx_thread_schedule,function _tx_thread_schedule: -@ -@ /* Enable interrupts. */ -@ + + /* Enable interrupts. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSIE if @ Enable IRQ and FIQ interrupts + CPSIE if // Enable IRQ and FIQ interrupts #else - CPSIE i @ Enable IRQ interrupts + CPSIE i // Enable IRQ interrupts #endif -@ -@ /* Wait for a thread to execute. */ -@ do -@ { - LDR r1, =_tx_thread_execute_ptr @ Address of thread execute ptr -@ + + /* Wait for a thread to execute. */ + LDR r1, =_tx_thread_execute_ptr // Address of thread execute ptr + __tx_thread_schedule_loop: -@ - LDR r0, [r1] @ Pickup next thread to execute - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_schedule_loop @ If so, keep looking for a thread -@ -@ } -@ while(_tx_thread_execute_ptr == TX_NULL); -@ -@ /* Yes! We have a thread to execute. Lockout interrupts and -@ transfer control to it. */ -@ + + LDR r0, [r1] // Pickup next thread to execute + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_schedule_loop // If so, keep looking for a thread + /* Yes! We have a thread to execute. Lockout interrupts and + transfer control to it. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ interrupts + CPSID if // Disable IRQ and FIQ interrupts #else - CPSID i @ Disable IRQ interrupts + CPSID i // Disable IRQ interrupts #endif -@ -@ /* Setup the current thread pointer. */ -@ _tx_thread_current_ptr = _tx_thread_execute_ptr; -@ - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread - STR r0, [r1] @ Setup current thread pointer -@ -@ /* Increment the run count for this thread. */ -@ _tx_thread_current_ptr -> tx_thread_run_count++; -@ - LDR r2, [r0, #4] @ Pickup run counter - LDR r3, [r0, #24] @ Pickup time-slice for this thread - ADD r2, r2, #1 @ Increment thread run-counter - STR r2, [r0, #4] @ Store the new run counter -@ -@ /* Setup time-slice, if present. */ -@ _tx_timer_time_slice = _tx_thread_current_ptr -> tx_thread_time_slice; -@ - LDR r2, =_tx_timer_time_slice @ Pickup address of time-slice - @ variable - LDR sp, [r0, #8] @ Switch stack pointers - STR r3, [r2] @ Setup time-slice -@ -@ /* Switch to the thread's stack. */ -@ sp = _tx_thread_execute_ptr -> tx_thread_stack_ptr; -@ + + /* Setup the current thread pointer. */ + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread + STR r0, [r1] // Setup current thread pointer + + /* Increment the run count for this thread. */ + + LDR r2, [r0, #4] // Pickup run counter + LDR r3, [r0, #24] // Pickup time-slice for this thread + ADD r2, r2, #1 // Increment thread run-counter + STR r2, [r0, #4] // Store the new run counter + + /* Setup time-slice, if present. */ + + LDR r2, =_tx_timer_time_slice // Pickup address of time-slice + // variable + LDR sp, [r0, #8] // Switch stack pointers + STR r3, [r2] // Setup time-slice + #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the thread entry function to indicate the thread is executing. */ -@ - MOV r5, r0 @ Save r0 - BL _tx_execution_thread_enter @ Call the thread execution enter function - MOV r0, r5 @ Restore r0 + + /* Call the thread entry function to indicate the thread is executing. */ + + MOV r5, r0 // Save r0 + BL _tx_execution_thread_enter // Call the thread execution enter function + MOV r0, r5 // Restore r0 #endif -@ -@ /* Determine if an interrupt frame or a synchronous task suspension frame -@ is present. */ -@ - LDMIA sp!, {r4, r5} @ Pickup the stack type and saved CPSR - CMP r4, #0 @ Check for synchronous context switch + + /* Determine if an interrupt frame or a synchronous task suspension frame + is present. */ + + LDMIA sp!, {r4, r5} // Pickup the stack type and saved CPSR + CMP r4, #0 // Check for synchronous context switch BEQ _tx_solicited_return - MSR SPSR_cxsf, r5 @ Setup SPSR for return + MSR SPSR_cxsf, r5 // Setup SPSR for return #ifdef TX_ENABLE_VFP_SUPPORT - LDR r1, [r0, #144] @ Pickup the VFP enabled flag - CMP r1, #0 @ Is the VFP enabled? - BEQ _tx_skip_interrupt_vfp_restore @ No, skip VFP interrupt restore - VLDMIA sp!, {D0-D15} @ Recover D0-D15 - VLDMIA sp!, {D16-D31} @ Recover D16-D31 - LDR r4, [sp], #4 @ Pickup FPSCR - VMSR FPSCR, r4 @ Restore FPSCR + LDR r1, [r0, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_interrupt_vfp_restore // No, skip VFP interrupt restore + VLDMIA sp!, {D0-D15} // Recover D0-D15 + VLDMIA sp!, {D16-D31} // Recover D16-D31 + LDR r4, [sp], #4 // Pickup FPSCR + VMSR FPSCR, r4 // Restore FPSCR _tx_skip_interrupt_vfp_restore: #endif - LDMIA sp!, {r0-r12, lr, pc}^ @ Return to point of thread interrupt + LDMIA sp!, {r0-r12, lr, pc}^ // Return to point of thread interrupt _tx_solicited_return: #ifdef TX_ENABLE_VFP_SUPPORT - LDR r1, [r0, #144] @ Pickup the VFP enabled flag - CMP r1, #0 @ Is the VFP enabled? - BEQ _tx_skip_solicited_vfp_restore @ No, skip VFP solicited restore - VLDMIA sp!, {D8-D15} @ Recover D8-D15 - VLDMIA sp!, {D16-D31} @ Recover D16-D31 - LDR r4, [sp], #4 @ Pickup FPSCR - VMSR FPSCR, r4 @ Restore FPSCR + LDR r1, [r0, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_solicited_vfp_restore // No, skip VFP solicited restore + VLDMIA sp!, {D8-D15} // Recover D8-D15 + VLDMIA sp!, {D16-D31} // Recover D16-D31 + LDR r4, [sp], #4 // Pickup FPSCR + VMSR FPSCR, r4 // Restore FPSCR _tx_skip_solicited_vfp_restore: #endif - MSR CPSR_cxsf, r5 @ Recover CPSR - LDMIA sp!, {r4-r11, lr} @ Return to thread synchronously + MSR CPSR_cxsf, r5 // Recover CPSR + LDMIA sp!, {r4-r11, lr} // Return to thread synchronously #ifdef __THUMB_INTERWORK - BX lr @ Return to caller + BX lr // Return to caller #else - MOV pc, lr @ Return to caller + MOV pc, lr // Return to caller #endif -@ -@} -@ #ifdef TX_ENABLE_VFP_SUPPORT .global tx_thread_vfp_enable .type tx_thread_vfp_enable,function tx_thread_vfp_enable: - MRS r2, CPSR @ Pickup the CPSR + MRS r2, CPSR // Pickup the CPSR #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Enable IRQ and FIQ interrupts + CPSID if // Enable IRQ and FIQ interrupts #else - CPSID i @ Enable IRQ interrupts + CPSID i // Enable IRQ interrupts #endif - LDR r0, =_tx_thread_current_ptr @ Build current thread pointer address - LDR r1, [r0] @ Pickup current thread pointer - CMP r1, #0 @ Check for NULL thread pointer - BEQ __tx_no_thread_to_enable @ If NULL, skip VFP enable - MOV r0, #1 @ Build enable value - STR r0, [r1, #144] @ Set the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) + LDR r0, =_tx_thread_current_ptr // Build current thread pointer address + LDR r1, [r0] // Pickup current thread pointer + CMP r1, #0 // Check for NULL thread pointer + BEQ __tx_no_thread_to_enable // If NULL, skip VFP enable + MOV r0, #1 // Build enable value + STR r0, [r1, #144] // Set the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) __tx_no_thread_to_enable: - MSR CPSR_cxsf, r2 @ Recover CPSR - BX LR @ Return to caller + MSR CPSR_cxsf, r2 // Recover CPSR + BX LR // Return to caller .global tx_thread_vfp_disable .type tx_thread_vfp_disable,function tx_thread_vfp_disable: - MRS r2, CPSR @ Pickup the CPSR + MRS r2, CPSR // Pickup the CPSR #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Enable IRQ and FIQ interrupts + CPSID if // Enable IRQ and FIQ interrupts #else - CPSID i @ Enable IRQ interrupts + CPSID i // Enable IRQ interrupts #endif - LDR r0, =_tx_thread_current_ptr @ Build current thread pointer address - LDR r1, [r0] @ Pickup current thread pointer - CMP r1, #0 @ Check for NULL thread pointer - BEQ __tx_no_thread_to_disable @ If NULL, skip VFP disable - MOV r0, #0 @ Build disable value - STR r0, [r1, #144] @ Clear the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) + LDR r0, =_tx_thread_current_ptr // Build current thread pointer address + LDR r1, [r0] // Pickup current thread pointer + CMP r1, #0 // Check for NULL thread pointer + BEQ __tx_no_thread_to_disable // If NULL, skip VFP disable + MOV r0, #0 // Build disable value + STR r0, [r1, #144] // Clear the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) __tx_no_thread_to_disable: - MSR CPSR_cxsf, r2 @ Recover CPSR - BX LR @ Return to caller + MSR CPSR_cxsf, r2 // Recover CPSR + BX LR // Return to caller #endif - diff --git a/ports/cortex_a7/gnu/src/tx_thread_stack_build.S b/ports/cortex_a7/gnu/src/tx_thread_stack_build.S index b4809307..f413e673 100644 --- a/ports/cortex_a7/gnu/src/tx_thread_stack_build.S +++ b/ports/cortex_a7/gnu/src/tx_thread_stack_build.S @@ -1,178 +1,164 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ .arm -SVC_MODE = 0x13 @ SVC mode +SVC_MODE = 0x13 // SVC mode #ifdef TX_ENABLE_FIQ_SUPPORT -CPSR_MASK = 0xDF @ Mask initial CPSR, IRQ & FIQ interrupts enabled +CPSR_MASK = 0xDF // Mask initial CPSR, IRQ & FIQ interrupts enabled #else -CPSR_MASK = 0x9F @ Mask initial CPSR, IRQ interrupts enabled +CPSR_MASK = 0x9F // Mask initial CPSR, IRQ interrupts enabled #endif -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_stack_build for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_stack_build for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .thumb .global $_tx_thread_stack_build .type $_tx_thread_stack_build,function $_tx_thread_stack_build: - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_stack_build @ Call _tx_thread_stack_build function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_stack_build // Call _tx_thread_stack_build function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_stack_build Cortex-A7/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function builds a stack frame on the supplied thread's stack. */ -@/* The stack frame results in a fake interrupt return to the supplied */ -@/* function pointer. */ -@/* */ -@/* INPUT */ -@/* */ -@/* thread_ptr Pointer to thread control blk */ -@/* function_ptr Pointer to return function */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* _tx_thread_create Create thread service */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_stack_build(TX_THREAD *thread_ptr, VOID (*function_ptr)(VOID)) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_stack_build ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function builds a stack frame on the supplied thread's stack. */ +/* The stack frame results in a fake interrupt return to the supplied */ +/* function pointer. */ +/* */ +/* INPUT */ +/* */ +/* thread_ptr Pointer to thread control blk */ +/* function_ptr Pointer to return function */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_thread_create Create thread service */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_stack_build .type _tx_thread_stack_build,function _tx_thread_stack_build: -@ -@ -@ /* Build a fake interrupt frame. The form of the fake interrupt stack -@ on the Cortex-A7 should look like the following after it is built: -@ -@ Stack Top: 1 Interrupt stack frame type -@ CPSR Initial value for CPSR -@ a1 (r0) Initial value for a1 -@ a2 (r1) Initial value for a2 -@ a3 (r2) Initial value for a3 -@ a4 (r3) Initial value for a4 -@ v1 (r4) Initial value for v1 -@ v2 (r5) Initial value for v2 -@ v3 (r6) Initial value for v3 -@ v4 (r7) Initial value for v4 -@ v5 (r8) Initial value for v5 -@ sb (r9) Initial value for sb -@ sl (r10) Initial value for sl -@ fp (r11) Initial value for fp -@ ip (r12) Initial value for ip -@ lr (r14) Initial value for lr -@ pc (r15) Initial value for pc -@ 0 For stack backtracing -@ -@ Stack Bottom: (higher memory address) */ -@ - LDR r2, [r0, #16] @ Pickup end of stack area - BIC r2, r2, #7 @ Ensure 8-byte alignment - SUB r2, r2, #76 @ Allocate space for the stack frame -@ -@ /* Actually build the stack frame. */ -@ - MOV r3, #1 @ Build interrupt stack type - STR r3, [r2, #0] @ Store stack type - MOV r3, #0 @ Build initial register value - STR r3, [r2, #8] @ Store initial r0 - STR r3, [r2, #12] @ Store initial r1 - STR r3, [r2, #16] @ Store initial r2 - STR r3, [r2, #20] @ Store initial r3 - STR r3, [r2, #24] @ Store initial r4 - STR r3, [r2, #28] @ Store initial r5 - STR r3, [r2, #32] @ Store initial r6 - STR r3, [r2, #36] @ Store initial r7 - STR r3, [r2, #40] @ Store initial r8 - STR r3, [r2, #44] @ Store initial r9 - LDR r3, [r0, #12] @ Pickup stack starting address - STR r3, [r2, #48] @ Store initial r10 (sl) - LDR r3,=_tx_thread_schedule @ Pickup address of _tx_thread_schedule for GDB backtrace - STR r3, [r2, #60] @ Store initial r14 (lr) - MOV r3, #0 @ Build initial register value - STR r3, [r2, #52] @ Store initial r11 - STR r3, [r2, #56] @ Store initial r12 - STR r1, [r2, #64] @ Store initial pc - STR r3, [r2, #68] @ 0 for back-trace - MRS r1, CPSR @ Pickup CPSR - BIC r1, r1, #CPSR_MASK @ Mask mode bits of CPSR - ORR r3, r1, #SVC_MODE @ Build CPSR, SVC mode, interrupts enabled - STR r3, [r2, #4] @ Store initial CPSR -@ -@ /* Setup stack pointer. */ -@ thread_ptr -> tx_thread_stack_ptr = r2; -@ - STR r2, [r0, #8] @ Save stack pointer in thread's - @ control block + + + /* Build a fake interrupt frame. The form of the fake interrupt stack + on the ARMv7-A should look like the following after it is built: + + Stack Top: 1 Interrupt stack frame type + CPSR Initial value for CPSR + a1 (r0) Initial value for a1 + a2 (r1) Initial value for a2 + a3 (r2) Initial value for a3 + a4 (r3) Initial value for a4 + v1 (r4) Initial value for v1 + v2 (r5) Initial value for v2 + v3 (r6) Initial value for v3 + v4 (r7) Initial value for v4 + v5 (r8) Initial value for v5 + sb (r9) Initial value for sb + sl (r10) Initial value for sl + fp (r11) Initial value for fp + ip (r12) Initial value for ip + lr (r14) Initial value for lr + pc (r15) Initial value for + 0 For stack backtracing + + Stack Bottom: (higher memory address) */ + + LDR r2, [r0, #16] // Pickup end of stack area + BIC r2, r2, #7 // Ensure 8-byte alignment + SUB r2, r2, #76 // Allocate space for the stack frame + + /* Actually build the stack frame. */ + + MOV r3, #1 // Build interrupt stack type + STR r3, [r2, #0] // Store stack type + MOV r3, #0 // Build initial register value + STR r3, [r2, #8] // Store initial r0 + STR r3, [r2, #12] // Store initial r1 + STR r3, [r2, #16] // Store initial r2 + STR r3, [r2, #20] // Store initial r3 + STR r3, [r2, #24] // Store initial r4 + STR r3, [r2, #28] // Store initial r5 + STR r3, [r2, #32] // Store initial r6 + STR r3, [r2, #36] // Store initial r7 + STR r3, [r2, #40] // Store initial r8 + STR r3, [r2, #44] // Store initial r9 + LDR r3, [r0, #12] // Pickup stack starting address + STR r3, [r2, #48] // Store initial r10 (sl) + LDR r3,=_tx_thread_schedule // Pickup address of _tx_thread_schedule for GDB backtrace + STR r3, [r2, #60] // Store initial r14 (lr) + MOV r3, #0 // Build initial register value + STR r3, [r2, #52] // Store initial r11 + STR r3, [r2, #56] // Store initial r12 + STR r1, [r2, #64] // Store initial pc + STR r3, [r2, #68] // 0 for back-trace + MRS r1, CPSR // Pickup CPSR + BIC r1, r1, #CPSR_MASK // Mask mode bits of CPSR + ORR r3, r1, #SVC_MODE // Build CPSR, SVC mode, interrupts enabled + STR r3, [r2, #4] // Store initial CPSR + + /* Setup stack pointer. */ + + STR r2, [r0, #8] // Save stack pointer in thread's + // control block #ifdef __THUMB_INTERWORK - BX lr @ Return to caller + BX lr // Return to caller #else - MOV pc, lr @ Return to caller + MOV pc, lr // Return to caller #endif -@} - - diff --git a/ports/cortex_a7/gnu/src/tx_thread_system_return.S b/ports/cortex_a7/gnu/src/tx_thread_system_return.S index 68ec35fa..cb7d62ce 100644 --- a/ports/cortex_a7/gnu/src/tx_thread_system_return.S +++ b/ports/cortex_a7/gnu/src/tx_thread_system_return.S @@ -1,183 +1,162 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .arm -@ -@ + + .global _tx_thread_current_ptr .global _tx_timer_time_slice .global _tx_thread_schedule - .global _tx_execution_thread_exit -@ -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_system_return for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_system_return for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_system_return .type $_tx_thread_system_return,function $_tx_thread_system_return: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_system_return @ Call _tx_thread_system_return function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_system_return // Call _tx_thread_system_return function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_system_return Cortex-A7/GNU */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is target processor specific. It is used to transfer */ -@/* control from a thread back to the ThreadX system. Only a */ -@/* minimal context is saved since the compiler assumes temp registers */ -@/* are going to get slicked by a function call anyway. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* _tx_thread_schedule Thread scheduling loop */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ThreadX components */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_system_return(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_system_return ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is target processor specific. It is used to transfer */ +/* control from a thread back to the ThreadX system. Only a */ +/* minimal context is saved since the compiler assumes temp registers */ +/* are going to get slicked by a function call anyway. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling loop */ +/* */ +/* CALLED BY */ +/* */ +/* ThreadX components */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_system_return .type _tx_thread_system_return,function _tx_thread_system_return: -@ -@ /* Save minimal context on the stack. */ -@ - STMDB sp!, {r4-r11, lr} @ Save minimal context - LDR r4, =_tx_thread_current_ptr @ Pickup address of current ptr - LDR r5, [r4] @ Pickup current thread pointer - + /* Save minimal context on the stack. */ + + STMDB sp!, {r4-r11, lr} // Save minimal context + + LDR r4, =_tx_thread_current_ptr // Pickup address of current ptr + LDR r5, [r4] // Pickup current thread pointer + #ifdef TX_ENABLE_VFP_SUPPORT - LDR r1, [r5, #144] @ Pickup the VFP enabled flag - CMP r1, #0 @ Is the VFP enabled? - BEQ _tx_skip_solicited_vfp_save @ No, skip VFP solicited save - VMRS r1, FPSCR @ Pickup the FPSCR - STR r1, [sp, #-4]! @ Save FPSCR - VSTMDB sp!, {D16-D31} @ Save D16-D31 - VSTMDB sp!, {D8-D15} @ Save D8-D15 + LDR r1, [r5, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_solicited_vfp_save // No, skip VFP solicited save + VMRS r1, FPSCR // Pickup the FPSCR + STR r1, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D8-D15} // Save D8-D15 _tx_skip_solicited_vfp_save: #endif - MOV r0, #0 @ Build a solicited stack type - MRS r1, CPSR @ Pickup the CPSR - STMDB sp!, {r0-r1} @ Save type and CPSR -@ -@ /* Lockout interrupts. */ -@ -#ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ interrupts -#else - CPSID i @ Disable IRQ interrupts -#endif - -#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the thread exit function to indicate the thread is no longer executing. */ -@ - BL _tx_execution_thread_exit @ Call the thread exit function -#endif - MOV r3, r4 @ Pickup address of current ptr - MOV r0, r5 @ Pickup current thread pointer - LDR r2, =_tx_timer_time_slice @ Pickup address of time slice - LDR r1, [r2] @ Pickup current time slice -@ -@ /* Save current stack and switch to system stack. */ -@ _tx_thread_current_ptr -> tx_thread_stack_ptr = sp; -@ sp = _tx_thread_system_stack_ptr; -@ - STR sp, [r0, #8] @ Save thread stack pointer -@ -@ /* Determine if the time-slice is active. */ -@ if (_tx_timer_time_slice) -@ { -@ - MOV r4, #0 @ Build clear value - CMP r1, #0 @ Is a time-slice active? - BEQ __tx_thread_dont_save_ts @ No, don't save the time-slice -@ -@ /* Save time-slice for the thread and clear the current time-slice. */ -@ _tx_thread_current_ptr -> tx_thread_time_slice = _tx_timer_time_slice; -@ _tx_timer_time_slice = 0; -@ - STR r4, [r2] @ Clear time-slice - STR r1, [r0, #24] @ Save current time-slice -@ -@ } -__tx_thread_dont_save_ts: -@ -@ /* Clear the current thread pointer. */ -@ _tx_thread_current_ptr = TX_NULL; -@ - STR r4, [r3] @ Clear current thread pointer - B _tx_thread_schedule @ Jump to scheduler! -@ -@} + MOV r0, #0 // Build a solicited stack type + MRS r1, CPSR // Pickup the CPSR + STMDB sp!, {r0-r1} // Save type and CPSR + /* Lockout interrupts. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Disable IRQ and FIQ interrupts +#else + CPSID i // Disable IRQ interrupts +#endif + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the thread exit function to indicate the thread is no longer executing. */ + + BL _tx_execution_thread_exit // Call the thread exit function +#endif + MOV r3, r4 // Pickup address of current ptr + MOV r0, r5 // Pickup current thread pointer + LDR r2, =_tx_timer_time_slice // Pickup address of time slice + LDR r1, [r2] // Pickup current time slice + + /* Save current stack and switch to system stack. */ + + STR sp, [r0, #8] // Save thread stack pointer + + /* Determine if the time-slice is active. */ + + MOV r4, #0 // Build clear value + CMP r1, #0 // Is a time-slice active? + BEQ __tx_thread_dont_save_ts // No, don't save the time-slice + + /* Save time-slice for the thread and clear the current time-slice. */ + + STR r4, [r2] // Clear time-slice + STR r1, [r0, #24] // Save current time-slice + +__tx_thread_dont_save_ts: + + /* Clear the current thread pointer. */ + + STR r4, [r3] // Clear current thread pointer + B _tx_thread_schedule // Jump to scheduler! diff --git a/ports/cortex_a7/gnu/src/tx_thread_vectored_context_save.S b/ports/cortex_a7/gnu/src/tx_thread_vectored_context_save.S index 7b39a4c4..d846223f 100644 --- a/ports/cortex_a7/gnu/src/tx_thread_vectored_context_save.S +++ b/ports/cortex_a7/gnu/src/tx_thread_vectored_context_save.S @@ -1,193 +1,165 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .global _tx_thread_system_state .global _tx_thread_current_ptr .global _tx_execution_isr_enter -@ -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_vectored_context_save -@ since it will never be called 16-bit mode. */ -@ + + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_vectored_context_save + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_vectored_context_save Cortex-A7/GNU */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function saves the context of an executing thread in the */ -@/* beginning of interrupt processing. The function also ensures that */ -@/* the system stack is used upon return to the calling ISR. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_vectored_context_save(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_vectored_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_vectored_context_save .type _tx_thread_vectored_context_save,function _tx_thread_vectored_context_save: -@ -@ /* Upon entry to this routine, it is assumed that IRQ interrupts are locked -@ out, we are in IRQ mode, and all registers are intact. */ -@ -@ /* Check for a nested interrupt condition. */ -@ if (_tx_thread_system_state++) -@ { -@ + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ interrupts + CPSID if // Disable IRQ and FIQ interrupts #endif - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3, #0] @ Pickup system state - CMP r2, #0 @ Is this the first interrupt? - BEQ __tx_thread_not_nested_save @ Yes, not a nested context save -@ -@ /* Nested interrupt condition. */ -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3, #0] @ Store it back in the variable -@ -@ /* Note: Minimal context of interrupted thread is already saved. */ -@ -@ /* Return to the ISR. */ -@ - MOV r10, #0 @ Clear stack limit + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3, #0] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3, #0] // Store it back in the variable + + /* Note: Minimal context of interrupted thread is already saved. */ + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - MOV pc, lr @ Return to caller -@ + MOV pc, lr // Return to caller + __tx_thread_not_nested_save: -@ } -@ -@ /* Otherwise, not nested, check to see if a thread was running. */ -@ else if (_tx_thread_current_ptr) -@ { -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3, #0] @ Store it back in the variable - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1, #0] @ Pickup current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_idle_system_save @ If so, interrupt occurred in - @ scheduling loop - nothing needs saving! -@ -@ /* Note: Minimal context of interrupted thread is already saved. */ -@ -@ /* Save the current stack pointer in the thread's control block. */ -@ _tx_thread_current_ptr -> tx_thread_stack_ptr = sp; -@ -@ /* Switch to the system stack. */ -@ sp = _tx_thread_system_stack_ptr; -@ - MOV r10, #0 @ Clear stack limit + + /* Otherwise, not nested, check to see if a thread was running. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3, #0] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1, #0] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + /* Note: Minimal context of interrupted thread is already saved. */ + + /* Save the current stack pointer in the thread's control block. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - MOV pc, lr @ Return to caller -@ -@ } -@ else -@ { -@ + MOV pc, lr // Return to caller + __tx_thread_idle_system_save: -@ -@ /* Interrupt occurred in the scheduling loop. */ -@ -@ /* Not much to do here, just adjust the stack pointer, and return to IRQ -@ processing. */ -@ - MOV r10, #0 @ Clear stack limit + + /* Interrupt occurred in the scheduling loop. */ + + /* Not much to do here, just adjust the stack pointer, and return to IRQ + processing. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - ADD sp, sp, #32 @ Recover saved registers - MOV pc, lr @ Return to caller -@ -@ } -@} - + ADD sp, sp, #32 // Recover saved registers + MOV pc, lr // Return to caller diff --git a/ports/cortex_a7/gnu/src/tx_timer_interrupt.S b/ports/cortex_a7/gnu/src/tx_timer_interrupt.S index 1b8f37df..7337ed0c 100644 --- a/ports/cortex_a7/gnu/src/tx_timer_interrupt.S +++ b/ports/cortex_a7/gnu/src/tx_timer_interrupt.S @@ -1,40 +1,30 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Timer */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_timer.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Timer */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .arm -@ -@/* Define Assembly language external references... */ -@ + +/* Define Assembly language external references... */ + .global _tx_timer_time_slice .global _tx_timer_system_clock .global _tx_timer_current_ptr @@ -43,237 +33,199 @@ .global _tx_timer_expired_time_slice .global _tx_timer_expired .global _tx_thread_time_slice -@ -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_timer_interrupt for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + + + +/* Define the 16-bit Thumb mode veneer for _tx_timer_interrupt for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .thumb .global $_tx_timer_interrupt .type $_tx_timer_interrupt,function $_tx_timer_interrupt: - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_timer_interrupt @ Call _tx_timer_interrupt function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_timer_interrupt // Call _tx_timer_interrupt function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_timer_interrupt Cortex-A7/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function processes the hardware timer interrupt. This */ -@/* processing includes incrementing the system clock and checking for */ -@/* time slice and/or timer expiration. If either is found, the */ -@/* interrupt context save/restore functions are called along with the */ -@/* expiration functions. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* _tx_thread_time_slice Time slice interrupted thread */ -@/* _tx_timer_expiration_process Timer expiration processing */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* interrupt vector */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_timer_interrupt(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_timer_interrupt ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function processes the hardware timer interrupt. This */ +/* processing includes incrementing the system clock and checking for */ +/* time slice and/or timer expiration. If either is found, the */ +/* interrupt context save/restore functions are called along with the */ +/* expiration functions. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_time_slice Time slice interrupted thread */ +/* _tx_timer_expiration_process Timer expiration processing */ +/* */ +/* CALLED BY */ +/* */ +/* interrupt vector */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_timer_interrupt .type _tx_timer_interrupt,function _tx_timer_interrupt: -@ -@ /* Upon entry to this routine, it is assumed that context save has already -@ been called, and therefore the compiler scratch registers are available -@ for use. */ -@ -@ /* Increment the system clock. */ -@ _tx_timer_system_clock++; -@ - LDR r1, =_tx_timer_system_clock @ Pickup address of system clock - LDR r0, [r1] @ Pickup system clock - ADD r0, r0, #1 @ Increment system clock - STR r0, [r1] @ Store new system clock -@ -@ /* Test for time-slice expiration. */ -@ if (_tx_timer_time_slice) -@ { -@ - LDR r3, =_tx_timer_time_slice @ Pickup address of time-slice - LDR r2, [r3] @ Pickup time-slice - CMP r2, #0 @ Is it non-active? - BEQ __tx_timer_no_time_slice @ Yes, skip time-slice processing -@ -@ /* Decrement the time_slice. */ -@ _tx_timer_time_slice--; -@ - SUB r2, r2, #1 @ Decrement the time-slice - STR r2, [r3] @ Store new time-slice value -@ -@ /* Check for expiration. */ -@ if (__tx_timer_time_slice == 0) -@ - CMP r2, #0 @ Has it expired? - BNE __tx_timer_no_time_slice @ No, skip expiration processing -@ -@ /* Set the time-slice expired flag. */ -@ _tx_timer_expired_time_slice = TX_TRUE; -@ - LDR r3, =_tx_timer_expired_time_slice @ Pickup address of expired flag - MOV r0, #1 @ Build expired value - STR r0, [r3] @ Set time-slice expiration flag -@ -@ } -@ -__tx_timer_no_time_slice: -@ -@ /* Test for timer expiration. */ -@ if (*_tx_timer_current_ptr) -@ { -@ - LDR r1, =_tx_timer_current_ptr @ Pickup current timer pointer address - LDR r0, [r1] @ Pickup current timer - LDR r2, [r0] @ Pickup timer list entry - CMP r2, #0 @ Is there anything in the list? - BEQ __tx_timer_no_timer @ No, just increment the timer -@ -@ /* Set expiration flag. */ -@ _tx_timer_expired = TX_TRUE; -@ - LDR r3, =_tx_timer_expired @ Pickup expiration flag address - MOV r2, #1 @ Build expired value - STR r2, [r3] @ Set expired flag - B __tx_timer_done @ Finished timer processing -@ -@ } -@ else -@ { -__tx_timer_no_timer: -@ -@ /* No timer expired, increment the timer pointer. */ -@ _tx_timer_current_ptr++; -@ - ADD r0, r0, #4 @ Move to next timer -@ -@ /* Check for wraparound. */ -@ if (_tx_timer_current_ptr == _tx_timer_list_end) -@ - LDR r3, =_tx_timer_list_end @ Pickup address of timer list end - LDR r2, [r3] @ Pickup list end - CMP r0, r2 @ Are we at list end? - BNE __tx_timer_skip_wrap @ No, skip wraparound logic -@ -@ /* Wrap to beginning of list. */ -@ _tx_timer_current_ptr = _tx_timer_list_start; -@ - LDR r3, =_tx_timer_list_start @ Pickup address of timer list start - LDR r0, [r3] @ Set current pointer to list start -@ -__tx_timer_skip_wrap: -@ - STR r0, [r1] @ Store new current timer pointer -@ } -@ -__tx_timer_done: -@ -@ -@ /* See if anything has expired. */ -@ if ((_tx_timer_expired_time_slice) || (_tx_timer_expired)) -@ { -@ - LDR r3, =_tx_timer_expired_time_slice @ Pickup address of expired flag - LDR r2, [r3] @ Pickup time-slice expired flag - CMP r2, #0 @ Did a time-slice expire? - BNE __tx_something_expired @ If non-zero, time-slice expired - LDR r1, =_tx_timer_expired @ Pickup address of other expired flag - LDR r0, [r1] @ Pickup timer expired flag - CMP r0, #0 @ Did a timer expire? - BEQ __tx_timer_nothing_expired @ No, nothing expired -@ -__tx_something_expired: -@ -@ - STMDB sp!, {r0, lr} @ Save the lr register on the stack - @ and save r0 just to keep 8-byte alignment -@ -@ /* Did a timer expire? */ -@ if (_tx_timer_expired) -@ { -@ - LDR r1, =_tx_timer_expired @ Pickup address of expired flag - LDR r0, [r1] @ Pickup timer expired flag - CMP r0, #0 @ Check for timer expiration - BEQ __tx_timer_dont_activate @ If not set, skip timer activation -@ -@ /* Process timer expiration. */ -@ _tx_timer_expiration_process(); -@ - BL _tx_timer_expiration_process @ Call the timer expiration handling routine -@ -@ } -__tx_timer_dont_activate: -@ -@ /* Did time slice expire? */ -@ if (_tx_timer_expired_time_slice) -@ { -@ - LDR r3, =_tx_timer_expired_time_slice @ Pickup address of time-slice expired - LDR r2, [r3] @ Pickup the actual flag - CMP r2, #0 @ See if the flag is set - BEQ __tx_timer_not_ts_expiration @ No, skip time-slice processing -@ -@ /* Time slice interrupted thread. */ -@ _tx_thread_time_slice(); -@ - BL _tx_thread_time_slice @ Call time-slice processing -@ -@ } -@ -__tx_timer_not_ts_expiration: -@ - LDMIA sp!, {r0, lr} @ Recover lr register (r0 is just there for - @ the 8-byte stack alignment -@ -@ } -@ -__tx_timer_nothing_expired: -@ -#ifdef __THUMB_INTERWORK - BX lr @ Return to caller -#else - MOV pc, lr @ Return to caller -#endif -@ -@} + /* Upon entry to this routine, it is assumed that context save has already + been called, and therefore the compiler scratch registers are available + for use. */ + + /* Increment the system clock. */ + + LDR r1, =_tx_timer_system_clock // Pickup address of system clock + LDR r0, [r1] // Pickup system clock + ADD r0, r0, #1 // Increment system clock + STR r0, [r1] // Store new system clock + + /* Test for time-slice expiration. */ + + LDR r3, =_tx_timer_time_slice // Pickup address of time-slice + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it non-active? + BEQ __tx_timer_no_time_slice // Yes, skip time-slice processing + + /* Decrement the time_slice. */ + + SUB r2, r2, #1 // Decrement the time-slice + STR r2, [r3] // Store new time-slice value + + /* Check for expiration. */ + + CMP r2, #0 // Has it expired? + BNE __tx_timer_no_time_slice // No, skip expiration processing + + /* Set the time-slice expired flag. */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of expired flag + MOV r0, #1 // Build expired value + STR r0, [r3] // Set time-slice expiration flag + +__tx_timer_no_time_slice: + + /* Test for timer expiration. */ + + LDR r1, =_tx_timer_current_ptr // Pickup current timer pointer address + LDR r0, [r1] // Pickup current timer + LDR r2, [r0] // Pickup timer list entry + CMP r2, #0 // Is there anything in the list? + BEQ __tx_timer_no_timer // No, just increment the timer + + /* Set expiration flag. */ + + LDR r3, =_tx_timer_expired // Pickup expiration flag address + MOV r2, #1 // Build expired value + STR r2, [r3] // Set expired flag + B __tx_timer_done // Finished timer processing + +__tx_timer_no_timer: + + /* No timer expired, increment the timer pointer. */ + ADD r0, r0, #4 // Move to next timer + + /* Check for wraparound. */ + + LDR r3, =_tx_timer_list_end // Pickup address of timer list end + LDR r2, [r3] // Pickup list end + CMP r0, r2 // Are we at list end? + BNE __tx_timer_skip_wrap // No, skip wraparound logic + + /* Wrap to beginning of list. */ + + LDR r3, =_tx_timer_list_start // Pickup address of timer list start + LDR r0, [r3] // Set current pointer to list start + +__tx_timer_skip_wrap: + + STR r0, [r1] // Store new current timer pointer + +__tx_timer_done: + + /* See if anything has expired. */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of expired flag + LDR r2, [r3] // Pickup time-slice expired flag + CMP r2, #0 // Did a time-slice expire? + BNE __tx_something_expired // If non-zero, time-slice expired + LDR r1, =_tx_timer_expired // Pickup address of other expired flag + LDR r0, [r1] // Pickup timer expired flag + CMP r0, #0 // Did a timer expire? + BEQ __tx_timer_nothing_expired // No, nothing expired + +__tx_something_expired: + + STMDB sp!, {r0, lr} // Save the lr register on the stack + // and save r0 just to keep 8-byte alignment + + /* Did a timer expire? */ + + LDR r1, =_tx_timer_expired // Pickup address of expired flag + LDR r0, [r1] // Pickup timer expired flag + CMP r0, #0 // Check for timer expiration + BEQ __tx_timer_dont_activate // If not set, skip timer activation + + /* Process timer expiration. */ + BL _tx_timer_expiration_process // Call the timer expiration handling routine + +__tx_timer_dont_activate: + + /* Did time slice expire? */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of time-slice expired + LDR r2, [r3] // Pickup the actual flag + CMP r2, #0 // See if the flag is set + BEQ __tx_timer_not_ts_expiration // No, skip time-slice processing + + /* Time slice interrupted thread. */ + + BL _tx_thread_time_slice // Call time-slice processing + +__tx_timer_not_ts_expiration: + + LDMIA sp!, {r0, lr} // Recover lr register (r0 is just there for + // the 8-byte stack alignment + +__tx_timer_nothing_expired: + +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a8/ac6/example_build/sample_threadx.c b/ports/cortex_a8/ac6/example_build/sample_threadx.c new file mode 100644 index 00000000..8c61de06 --- /dev/null +++ b/ports/cortex_a8/ac6/example_build/sample_threadx.c @@ -0,0 +1,369 @@ +/* This is a small demo of the high-performance ThreadX kernel. It includes examples of eight + threads of different priorities, using a message queue, semaphore, mutex, event flags group, + byte pool, and block pool. */ + +#include "tx_api.h" + +#define DEMO_STACK_SIZE 1024 +#define DEMO_BYTE_POOL_SIZE 9120 +#define DEMO_BLOCK_POOL_SIZE 100 +#define DEMO_QUEUE_SIZE 100 + + +/* Define the ThreadX object control blocks... */ + +TX_THREAD thread_0; +TX_THREAD thread_1; +TX_THREAD thread_2; +TX_THREAD thread_3; +TX_THREAD thread_4; +TX_THREAD thread_5; +TX_THREAD thread_6; +TX_THREAD thread_7; +TX_QUEUE queue_0; +TX_SEMAPHORE semaphore_0; +TX_MUTEX mutex_0; +TX_EVENT_FLAGS_GROUP event_flags_0; +TX_BYTE_POOL byte_pool_0; +TX_BLOCK_POOL block_pool_0; + + +/* Define the counters used in the demo application... */ + +ULONG thread_0_counter; +ULONG thread_1_counter; +ULONG thread_1_messages_sent; +ULONG thread_2_counter; +ULONG thread_2_messages_received; +ULONG thread_3_counter; +ULONG thread_4_counter; +ULONG thread_5_counter; +ULONG thread_6_counter; +ULONG thread_7_counter; + + +/* Define thread prototypes. */ + +void thread_0_entry(ULONG thread_input); +void thread_1_entry(ULONG thread_input); +void thread_2_entry(ULONG thread_input); +void thread_3_and_4_entry(ULONG thread_input); +void thread_5_entry(ULONG thread_input); +void thread_6_and_7_entry(ULONG thread_input); + + +/* Define main entry point. */ + +int main() +{ + + /* Enter the ThreadX kernel. */ + tx_kernel_enter(); +} + + +/* Define what the initial system looks like. */ + +void tx_application_define(void *first_unused_memory) +{ + +CHAR *pointer = TX_NULL; + + + /* Create a byte memory pool from which to allocate the thread stacks. */ + tx_byte_pool_create(&byte_pool_0, "byte pool 0", first_unused_memory, DEMO_BYTE_POOL_SIZE); + + /* Put system definition stuff in here, e.g. thread creates and other assorted + create information. */ + + /* Allocate the stack for thread 0. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 1, 1, TX_NO_TIME_SLICE, TX_AUTO_START); + + + /* Allocate the stack for thread 1. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create threads 1 and 2. These threads pass information through a ThreadX + message queue. It is also interesting to note that these threads have a time + slice. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, DEMO_STACK_SIZE, + 16, 16, 4, TX_AUTO_START); + + /* Allocate the stack for thread 2. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, DEMO_STACK_SIZE, + 16, 16, 4, TX_AUTO_START); + + /* Allocate the stack for thread 3. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create threads 3 and 4. These threads compete for a ThreadX counting semaphore. + An interesting thing here is that both threads share the same instruction area. */ + tx_thread_create(&thread_3, "thread 3", thread_3_and_4_entry, 3, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 4. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + tx_thread_create(&thread_4, "thread 4", thread_3_and_4_entry, 4, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 5. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create thread 5. This thread simply pends on an event flag which will be set + by thread_0. */ + tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 6. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create threads 6 and 7. These threads compete for a ThreadX mutex. */ + tx_thread_create(&thread_6, "thread 6", thread_6_and_7_entry, 6, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 7. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + tx_thread_create(&thread_7, "thread 7", thread_6_and_7_entry, 7, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the message queue. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_QUEUE_SIZE*sizeof(ULONG), TX_NO_WAIT); + + /* Create the message queue shared by threads 1 and 2. */ + tx_queue_create(&queue_0, "queue 0", TX_1_ULONG, pointer, DEMO_QUEUE_SIZE*sizeof(ULONG)); + + /* Create the semaphore used by threads 3 and 4. */ + tx_semaphore_create(&semaphore_0, "semaphore 0", 1); + + /* Create the event flags group used by threads 1 and 5. */ + tx_event_flags_create(&event_flags_0, "event flags 0"); + + /* Create the mutex used by thread 6 and 7 without priority inheritance. */ + tx_mutex_create(&mutex_0, "mutex 0", TX_NO_INHERIT); + + /* Allocate the memory for a small block pool. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_BLOCK_POOL_SIZE, TX_NO_WAIT); + + /* Create a block memory pool to allocate a message buffer from. */ + tx_block_pool_create(&block_pool_0, "block pool 0", sizeof(ULONG), pointer, DEMO_BLOCK_POOL_SIZE); + + /* Allocate a block and release the block memory. */ + tx_block_allocate(&block_pool_0, (VOID **) &pointer, TX_NO_WAIT); + + /* Release the block back to the pool. */ + tx_block_release(pointer); +} + + + +/* Define the test threads. */ + +void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + + /* This thread simply sits in while-forever-sleep loop. */ + while(1) + { + + /* Increment the thread counter. */ + thread_0_counter++; + + /* Sleep for 10 ticks. */ + tx_thread_sleep(10); + + /* Set event flag 0 to wakeup thread 5. */ + status = tx_event_flags_set(&event_flags_0, 0x1, TX_OR); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + } +} + + +void thread_1_entry(ULONG thread_input) +{ + +UINT status; + + + /* This thread simply sends messages to a queue shared by thread 2. */ + while(1) + { + + /* Increment the thread counter. */ + thread_1_counter++; + + /* Send message to queue 0. */ + status = tx_queue_send(&queue_0, &thread_1_messages_sent, TX_WAIT_FOREVER); + + /* Check completion status. */ + if (status != TX_SUCCESS) + break; + + /* Increment the message sent. */ + thread_1_messages_sent++; + } +} + + +void thread_2_entry(ULONG thread_input) +{ + +ULONG received_message; +UINT status; + + /* This thread retrieves messages placed on the queue by thread 1. */ + while(1) + { + + /* Increment the thread counter. */ + thread_2_counter++; + + /* Retrieve a message from the queue. */ + status = tx_queue_receive(&queue_0, &received_message, TX_WAIT_FOREVER); + + /* Check completion status and make sure the message is what we + expected. */ + if ((status != TX_SUCCESS) || (received_message != thread_2_messages_received)) + break; + + /* Otherwise, all is okay. Increment the received message count. */ + thread_2_messages_received++; + } +} + + +void thread_3_and_4_entry(ULONG thread_input) +{ + +UINT status; + + + /* This function is executed from thread 3 and thread 4. As the loop + below shows, these function compete for ownership of semaphore_0. */ + while(1) + { + + /* Increment the thread counter. */ + if (thread_input == 3) + thread_3_counter++; + else + thread_4_counter++; + + /* Get the semaphore with suspension. */ + status = tx_semaphore_get(&semaphore_0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Sleep for 2 ticks to hold the semaphore. */ + tx_thread_sleep(2); + + /* Release the semaphore. */ + status = tx_semaphore_put(&semaphore_0); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + } +} + + +void thread_5_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_flags; + + + /* This thread simply waits for an event in a forever loop. */ + while(1) + { + + /* Increment the thread counter. */ + thread_5_counter++; + + /* Wait for event flag 0. */ + status = tx_event_flags_get(&event_flags_0, 0x1, TX_OR_CLEAR, + &actual_flags, TX_WAIT_FOREVER); + + /* Check status. */ + if ((status != TX_SUCCESS) || (actual_flags != 0x1)) + break; + } +} + + +void thread_6_and_7_entry(ULONG thread_input) +{ + +UINT status; + + + /* This function is executed from thread 6 and thread 7. As the loop + below shows, these function compete for ownership of mutex_0. */ + while(1) + { + + /* Increment the thread counter. */ + if (thread_input == 6) + thread_6_counter++; + else + thread_7_counter++; + + /* Get the mutex with suspension. */ + status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Get the mutex again with suspension. This shows + that an owning thread may retrieve the mutex it + owns multiple times. */ + status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Sleep for 2 ticks to hold the mutex. */ + tx_thread_sleep(2); + + /* Release the mutex. */ + status = tx_mutex_put(&mutex_0); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Release the mutex again. This will actually + release ownership since it was obtained twice. */ + status = tx_mutex_put(&mutex_0); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + } +} diff --git a/ports/cortex_a8/ac6/example_build/sample_threadx/.cproject b/ports/cortex_a8/ac6/example_build/sample_threadx/.cproject index 2a6227b6..e039b0b0 100644 --- a/ports/cortex_a8/ac6/example_build/sample_threadx/.cproject +++ b/ports/cortex_a8/ac6/example_build/sample_threadx/.cproject @@ -3,9 +3,9 @@ - + - + @@ -23,37 +23,37 @@ - + - + - + - @@ -117,7 +119,7 @@ - + @@ -137,7 +139,7 @@ - + @@ -151,8 +153,6 @@ - - @@ -168,5 +168,9 @@ + + + + diff --git a/ports/cortex_a8/ac6/example_build/sample_threadx/sample_threadx.c b/ports/cortex_a8/ac6/example_build/sample_threadx/sample_threadx.c index 418ec634..8c61de06 100644 --- a/ports/cortex_a8/ac6/example_build/sample_threadx/sample_threadx.c +++ b/ports/cortex_a8/ac6/example_build/sample_threadx/sample_threadx.c @@ -1,5 +1,5 @@ /* This is a small demo of the high-performance ThreadX kernel. It includes examples of eight - threads of different priorities, using a message queue, semaphore, mutex, event flags group, + threads of different priorities, using a message queue, semaphore, mutex, event flags group, byte pool, and block pool. */ #include "tx_api.h" @@ -80,42 +80,42 @@ CHAR *pointer = TX_NULL; tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); /* Create the main thread. */ - tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, 1, 1, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 1. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - /* Create threads 1 and 2. These threads pass information through a ThreadX + /* Create threads 1 and 2. These threads pass information through a ThreadX message queue. It is also interesting to note that these threads have a time slice. */ - tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, DEMO_STACK_SIZE, 16, 16, 4, TX_AUTO_START); /* Allocate the stack for thread 2. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, DEMO_STACK_SIZE, 16, 16, 4, TX_AUTO_START); /* Allocate the stack for thread 3. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - /* Create threads 3 and 4. These threads compete for a ThreadX counting semaphore. + /* Create threads 3 and 4. These threads compete for a ThreadX counting semaphore. An interesting thing here is that both threads share the same instruction area. */ - tx_thread_create(&thread_3, "thread 3", thread_3_and_4_entry, 3, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_3, "thread 3", thread_3_and_4_entry, 3, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 4. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - tx_thread_create(&thread_4, "thread 4", thread_3_and_4_entry, 4, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_4, "thread 4", thread_3_and_4_entry, 4, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 5. */ @@ -123,23 +123,23 @@ CHAR *pointer = TX_NULL; /* Create thread 5. This thread simply pends on an event flag which will be set by thread_0. */ - tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, + pointer, DEMO_STACK_SIZE, 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 6. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); /* Create threads 6 and 7. These threads compete for a ThreadX mutex. */ - tx_thread_create(&thread_6, "thread 6", thread_6_and_7_entry, 6, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_6, "thread 6", thread_6_and_7_entry, 6, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 7. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - tx_thread_create(&thread_7, "thread 7", thread_6_and_7_entry, 7, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_7, "thread 7", thread_6_and_7_entry, 7, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the message queue. */ @@ -242,11 +242,11 @@ UINT status; /* Retrieve a message from the queue. */ status = tx_queue_receive(&queue_0, &received_message, TX_WAIT_FOREVER); - /* Check completion status and make sure the message is what we + /* Check completion status and make sure the message is what we expected. */ if ((status != TX_SUCCESS) || (received_message != thread_2_messages_received)) break; - + /* Otherwise, all is okay. Increment the received message count. */ thread_2_messages_received++; } @@ -305,7 +305,7 @@ ULONG actual_flags; thread_5_counter++; /* Wait for event flag 0. */ - status = tx_event_flags_get(&event_flags_0, 0x1, TX_OR_CLEAR, + status = tx_event_flags_get(&event_flags_0, 0x1, TX_OR_CLEAR, &actual_flags, TX_WAIT_FOREVER); /* Check status. */ @@ -358,7 +358,7 @@ UINT status; if (status != TX_SUCCESS) break; - /* Release the mutex again. This will actually + /* Release the mutex again. This will actually release ownership since it was obtained twice. */ status = tx_mutex_put(&mutex_0); diff --git a/ports/cortex_a8/ac6/example_build/sample_threadx/sample_threadx.launch b/ports/cortex_a8/ac6/example_build/sample_threadx/sample_threadx.launch new file mode 100644 index 00000000..ff3713c3 --- /dev/null +++ b/ports/cortex_a8/ac6/example_build/sample_threadx/sample_threadx.launch @@ -0,0 +1,188 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ports/cortex_a8/ac6/example_build/sample_threadx/sample_threadx.scat b/ports/cortex_a8/ac6/example_build/sample_threadx/sample_threadx.scat index 013e9f8f..d23881cd 100644 --- a/ports/cortex_a8/ac6/example_build/sample_threadx/sample_threadx.scat +++ b/ports/cortex_a8/ac6/example_build/sample_threadx/sample_threadx.scat @@ -1,41 +1,44 @@ ;******************************************************* -; Copyright (c) 2010-2011 Arm Limited (or its affiliates). All rights reserved. +; Copyright (c) 2011-2016 Arm Limited (or its affiliates). All rights reserved. ; Use, modification and redistribution of this file is subject to your possession of a ; valid End User License Agreement for the Arm Product of which these examples are part of ; and your compliance with all applicable terms and conditions of such licence agreement. ;******************************************************* -; Scatter-file for bare-metal example on BeagleBoard +; Scatter-file for ARMv7-A bare-metal example on Versatile Express ; This scatter-file places application code, data, stack and heap at suitable addresses in the memory map. -; BeagleBoard has 256MB DDR SDRAM in its POP device at 0x80000000 to 0x8FFFFFFF, which this scatter-file uses. -; Alternatively, OMAP3530 has 64KB internal SRAM, from 0x40200000 to 0x4020FFFF, which could be used for some regions instead. -SDRAM 0x80000000 0x10000000 +SDRAM 0x80000000 0x20000000 { - APP_CODE +0 + VECTORS +0 { * (VECTORS, +FIRST) ; Vector table and other (assembler) startup code - * (+RO-CODE) ; Application RO code (.text) - * (+RO-DATA) ; Application RO data (.constdata) - * (InRoot$$Sections) ; All library code that must be in a root region + * (InRoot$$Sections) ; All (library) code that must be in a root region } - APP_DATA +0 - { - * (+RW, +ZI) ; Application RW (.data) and ZI (.bss) data - } + RO_CODE +0 + { * (+RO-CODE) } ; Application RO code (.text) - ARM_LIB_HEAP 0x80040000 EMPTY 0x00040000 ; Application heap - { } + RO_DATA +0 + { * (+RO-DATA) } ; Application RO data (.constdata) - ARM_LIB_STACK 0x80090000 EMPTY 0x00010000 ; Application (SVC mode) stack - { } + RW_DATA +0 + { * (+RW) } ; Application RW data (.data) - ;IRQ_STACK 0x800A0000 EMPTY 0x00010000 ; IRQ mode stack - ;{ } + ZI_DATA +0 + { * (+ZI) } ; Application ZI data (.bss) - TTB 0x80100000 EMPTY 0x4000 ; Level-1 Translation Table for MMU - { } + ARM_LIB_HEAP 0x80040000 EMPTY 0x00040000 ; Application heap + { } + + ARM_LIB_STACK 0x80090000 EMPTY 0x00010000 ; Application (SVC mode) stack + { } + +; IRQ_STACK 0x800A0000 EMPTY -0x00010000 ; IRQ mode stack +; { } + + TTB 0x80100000 EMPTY 0x4000 ; Level-1 Translation Table for MMU + { } } diff --git a/ports/cortex_a8/ac6/example_build/sample_threadx/startup.S b/ports/cortex_a8/ac6/example_build/sample_threadx/startup.S index 376629d5..670fadb9 100644 --- a/ports/cortex_a8/ac6/example_build/sample_threadx/startup.S +++ b/ports/cortex_a8/ac6/example_build/sample_threadx/startup.S @@ -1,31 +1,31 @@ //---------------------------------------------------------------- -// Cortex-A8 Embedded example - Startup Code +// ARMv7-A Embedded example - Startup Code // // Copyright (c) 2005-2018 Arm Limited (or its affiliates). All rights reserved. // Use, modification and redistribution of this file is subject to your possession of a -// valid End User License Agreement for the Arm Product of which these examples are part of +// valid End User License Agreement for the Arm Product of which these examples are part of // and your compliance with all applicable terms and conditions of such licence agreement. //---------------------------------------------------------------- - // Standard definitions of mode bits and interrupt (I & F) flags in PSRs -#define Mode_USR 0x10 -#define Mode_FIQ 0x11 -#define Mode_IRQ 0x12 -#define Mode_SVC 0x13 -#define Mode_ABT 0x17 -#define Mode_UND 0x1B -#define Mode_SYS 0x1F +#define Mode_USR 0x10 +#define Mode_FIQ 0x11 +#define Mode_IRQ 0x12 +#define Mode_SVC 0x13 +#define Mode_ABT 0x17 +#define Mode_UND 0x1B +#define Mode_SYS 0x1F -#define I_Bit 0x80 // When I bit is set, IRQ is disabled -#define F_Bit 0x40 // When F bit is set, FIQ is disabled +#define I_Bit 0x80 // When I bit is set, IRQ is disabled +#define F_Bit 0x40 // When F bit is set, FIQ is disabled .section VECTORS, "ax" .align 3 .cfi_sections .debug_frame // put stack frame info into .debug_frame instead of .eh_frame + //---------------------------------------------------------------- // Entry point for the Reset handler //---------------------------------------------------------------- @@ -39,36 +39,32 @@ // could also be used, unless the exception handlers are >32MB away. Vectors: - LDR PC, Reset_Addr - LDR PC, Undefined_Addr - LDR PC, SVC_Addr - LDR PC, Prefetch_Addr - LDR PC, Abort_Addr - B . // Reserved vector - LDR PC, IRQ_Addr - LDR PC, FIQ_Addr + LDR PC, Reset_Addr + LDR PC, Undefined_Addr + LDR PC, SVC_Addr + LDR PC, Prefetch_Addr + LDR PC, Abort_Addr + LDR PC, Hypervisor_Addr + LDR PC, IRQ_Addr + LDR PC, FIQ_Addr .balign 4 Reset_Addr: .word Reset_Handler Undefined_Addr: - //.word Undefined_Handler .word __tx_undefined SVC_Addr: - //.word SVC_Handler .word __tx_swi_interrupt Prefetch_Addr: - //.word Prefetch_Handler .word __tx_prefetch_handler Abort_Addr: - //.word Abort_Handler .word __tx_abort_handler +Hypervisor_Addr: + .word __tx_reserved_handler IRQ_Addr: - //.word IRQ_Handler .word __tx_irq_handler FIQ_Addr: - //.word FIQ_Handler .word __tx_fiq_handler @@ -84,6 +80,8 @@ Prefetch_Handler: B Prefetch_Handler Abort_Handler: B Abort_Handler +Hypervisor_Handler: + B Hypervisor_Handler IRQ_Handler: B IRQ_Handler FIQ_Handler: @@ -96,7 +94,7 @@ FIQ_Handler: Reset_Handler: //---------------------------------------------------------------- -// Disable caches, MMU and branch prediction in case they were left enabled from an earlier run +// Disable caches and MMU in case they were left enabled from an earlier run // This does not need to be done from a cold reset //---------------------------------------------------------------- @@ -104,13 +102,31 @@ Reset_Handler: BIC r0, r0, #(0x1 << 12) // Clear I bit 12 to disable I Cache BIC r0, r0, #(0x1 << 2) // Clear C bit 2 to disable D Cache BIC r0, r0, #0x1 // Clear M bit 0 to disable MMU - BIC r0, r0, #(0x1 << 11) // Clear Z bit 11 to disable branch prediction + BIC r0, r0, #(0x1 << 11) // Clear Z bit 11 to disable branch prediction MCR p15, 0, r0, c1, c0, 0 // Write System Control Register ISB -// The MMU is enabled later, before calling main(). Caches and branch prediction are enabled inside main(), +// The MMU is enabled later, before calling main(). Caches are enabled inside main(), // after the MMU has been enabled and scatterloading has been performed. +//---------------------------------------------------------------- +// ACTLR.SMP bit must be set before the caches and MMU are enabled, +// or any cache and TLB maintenance operations are performed, even for single-core +//---------------------------------------------------------------- + MRC p15, 0, r0, c1, c0, 1 // Read ACTLR + ORR r0, r0, #(1 << 6) // Set ACTLR.SMP bit + MCR p15, 0, r0, c1, c0, 1 // Write ACTLR + ISB + +//---------------------------------------------------------------- +// Invalidate Data and Instruction TLBs and branch predictor +// This does not need to be done from a cold reset +//---------------------------------------------------------------- + + MOV r0,#0 + MCR p15, 0, r0, c8, c7, 0 // I-TLB and D-TLB invalidation + MCR p15, 0, r0, c7, c5, 6 // BPIALL - Invalidate entire branch predictor array + //---------------------------------------------------------------- // Initialize Supervisor Mode Stack // Note stack must be 8 byte aligned. @@ -119,13 +135,24 @@ Reset_Handler: LDR SP, =Image$$ARM_LIB_STACK$$ZI$$Limit //---------------------------------------------------------------- -// Invalidate Data and Instruction TLBs and branch predictor +// Disable loop-buffer to fix errata on A15 r0p0 //---------------------------------------------------------------- - - MOV r0,#0 - MCR p15, 0, r0, c8, c7, 0 // I-TLB and D-TLB invalidation - MCR p15, 0, r0, c7, c5, 6 // BPIALL - Invalidate entire branch predictor array - + MRC p15, 0, r0, c0, c0, 0 // Read main ID register MIDR + MOV r1, r0, lsr #4 // Extract Primary Part Number + LDR r2, =0xFFF + AND r1, r1, r2 + LDR r2, =0xC0F + CMP r1, r2 // Is this an A15? + BNE notA15r0p0 // Jump if not A15 + AND r5, r0, #0x00f00000 // Variant + AND r6, r0, #0x0000000f // Revision + ORRS r6, r6, r5 // Combine variant and revision + BNE notA15r0p0 // Jump if not r0p0 + MRC p15, 0, r0, c1, c0, 1 // Read Aux Ctrl Reg + ORR r0, r0, #(1 << 1) // Set bit 1 to Disable Loop Buffer + MCR p15, 0, r0, c1, c0, 1 // Write Aux Ctrl Reg + ISB +notA15r0p0: //---------------------------------------------------------------- // Set Vector Base Address Register (VBAR) to point to this application's vector table @@ -135,7 +162,9 @@ Reset_Handler: MCR p15, 0, r0, c12, c0, 0 //---------------------------------------------------------------- -// Cache Invalidation code for Cortex-A8 +// Cache Invalidation code for ARMv7-A +// The caches, MMU and BTB do not need post-reset invalidation on Cortex-A7, +// but forcing a cache invalidation makes the code more portable to other CPUs (e.g. Cortex-A9) //---------------------------------------------------------------- // Invalidate L1 Instruction Cache @@ -153,7 +182,8 @@ Reset_Handler: BEQ Finished // If 0, no need to clean MOV r10, #0 // R10 holds current cache level << 1 -Loop1: ADD r2, r10, r10, LSR #1 // R2 holds cache "Set" position +Loop1: + ADD r2, r10, r10, LSR #1 // R2 holds cache "Set" position MOV r1, r0, LSR r2 // Bottom 3 bits are the Cache-type for this level AND r1, r1, #7 // Isolate those lower 3 bits CMP r1, #2 @@ -170,20 +200,25 @@ Loop1: ADD r2, r10, r10, LSR #1 // R2 holds cache "Set" position LDR r7, =0x7FFF ANDS r7, r7, r1, LSR #13 // R7 is the max number of the index size (right aligned) -Loop2: MOV r9, r4 // R9 working copy of the max way size (right aligned) +Loop2: + MOV r9, r4 // R9 working copy of the max way size (right aligned) -Loop3: ORR r11, r10, r9, LSL r5 // Factor in the Way number and cache number into R11 +Loop3: + ORR r11, r10, r9, LSL r5 // Factor in the Way number and cache number into R11 ORR r11, r11, r7, LSL r2 // Factor in the Set number MCR p15, 0, r11, c7, c6, 2 // Invalidate by Set/Way SUBS r9, r9, #1 // Decrement the Way number BGE Loop3 SUBS r7, r7, #1 // Decrement the Set number BGE Loop2 -Skip: ADD r10, r10, #2 // Increment the cache number +Skip: + ADD r10, r10, #2 // Increment the cache number CMP r3, r10 BGT Loop1 Finished: + + //---------------------------------------------------------------- // MMU Configuration // Set translation table base @@ -196,12 +231,17 @@ Finished: MOV r0,#0x0 MCR p15, 0, r0, c2, c0, 2 - // write the address of our page table base to TTB register 0 - LDR r0,=Image$$TTB$$ZI$$Base + + MOV r1, #0x08 // RGN=b01 (outer cacheable write-back cached, write allocate) + // S=0 (translation table walk to non-shared memory) + ORR r1,r1,#0x40 // IRGN=b01 (inner cacheability for the translation table walk is Write-back Write-allocate) + + ORR r0,r0,r1 + MCR p15, 0, r0, c2, c0, 0 - //MSR TTBR0, r0 + //---------------------------------------------------------------- // PAGE TABLE generation @@ -227,50 +267,41 @@ Finished: // XN[4]=1 - Execute never on Strongly-ordered memory // Bits[1:0]=10 - Indicate entry is a 1MB section //---------------------------------------------------------------- - - LDR r1,=0xfff // Loop counter - LDR r2,=3554 + LDR r0,=Image$$TTB$$ZI$$Base + LDR r1,=0xfff // loop counter + LDR r2,=0b00000000000000000000110111100010 // r0 contains the address of the translation table base // r1 is loop counter // r2 is level1 descriptor (bits 19:0) - // Use loop counter to create 4096 individual table entries. - // This writes from address 'Image$$TTB$$ZI$$Base' + - // Offset 0x3FFC down to offset 0x0 in word steps (4 bytes) + // use loop counter to create 4096 individual table entries. + // this writes from address 'Image$$TTB$$ZI$$Base' + + // offset 0x3FFC down to offset 0x0 in word steps (4 bytes) init_ttb_1: ORR r3, r2, r1, LSL#20 // R3 now contains full level1 descriptor to write - ORR r3, r3, #16 // Set XN bit + ORR r3, r3, #0b0000000010000 // Set XN bit STR r3, [r0, r1, LSL#2] // Str table entry at TTB base + loopcount*4 SUBS r1, r1, #1 // Decrement loop counter BPL init_ttb_1 - // In this example, the 1MB section based at '||Image$$APP_CODE$$Base||' is setup specially as cacheable (write back mode). - // TEX[14:12]=000 and CB[3:2]= 11, Outer and inner write back, no Write-allocate normal memory. - - LDR r1,=Image$$APP_CODE$$Base // Base physical address of code segment + // In this example, the 1MB section based at '__code_start' is setup specially as cacheable (write back mode). + // TEX[14:12]=001 and CB[3:2]= 11, Outer and inner write back, write allocate normal memory. + LDR r1,=Image$$VECTORS$$Base // Base physical address of code segment LSR r1, #20 // Shift right to align to 1MB boundaries ORR r3, r2, r1, LSL#20 // Setup the initial level1 descriptor again - ORR r3, r3, #12 // Set CB bits + ORR r3, r3, #0b0000000001100 // Set CB bits + ORR r3, r3, #0b1000000000000 // Set TEX bit 12 STR r3, [r0, r1, LSL#2] // str table entry - + //---------------------------------------------------------------- // Setup domain control register - Enable all domains to client mode //---------------------------------------------------------------- - MRC p15, 0, r0, c3, c0, 0 // Read Domain Access Control Register - LDR r0, =0x55555555 // Initialize every domain entry to b01 (client) - MCR p15, 0, r0, c3, c0, 0 // Write Domain Access Control Register - -//---------------------------------------------------------------- -// Setup L2 Cache - L2 Cache Auxiliary Control -//---------------------------------------------------------------- - -//// Seems to undef on Beagle ? -//// MOV r0, #0 -//// MCR p15, 1, r0, c9, c0, 2 // Write L2 Auxilary Control Register - + MRC p15, 0, r0, c3, c0, 0 // Read Domain Access Control Register + LDR r0, =0x55555555 // Initialize every domain entry to b01 (client) + MCR p15, 0, r0, c3, c0, 0 // Write Domain Access Control Register #if defined(__ARM_NEON) || defined(__ARM_FP) //---------------------------------------------------------------- @@ -288,17 +319,16 @@ init_ttb_1: //---------------------------------------------------------------- MOV r0, #0x40000000 - VMSR FPEXC, r0 // Write FPEXC register, EN bit set + VMSR FPEXC, r0 // Write FPEXC register, EN bit set #endif //---------------------------------------------------------------- -// Enable MMU and Branch to __main +// Enable MMU and branch to __main // Leaving the caches disabled until after scatter loading. //---------------------------------------------------------------- - LDR r12,=__main // Save this in register for possible long jump - + LDR r12,=__main MRC p15, 0, r0, c1, c0, 0 // Read System Control Register BIC r0, r0, #(0x1 << 12) // Clear I bit 12 to disable I Cache @@ -308,15 +338,14 @@ init_ttb_1: MCR p15, 0, r0, c1, c0, 0 // Write System Control Register ISB - -// Now the MMU is enabled, virtual to physical address translations will occur. -// This will affect the next instruction fetches. +// Now the MMU is enabled, virtual to physical address translations will occur. This will affect the next +// instruction fetch. // // The two instructions currently in the pipeline will have been fetched before the MMU was enabled. // The branch to __main is safe because the Virtual Address (VA) is the same as the Physical Address (PA) // (flat mapping) of this code that enables the MMU and performs the branch - BX r12 // Branch to __main() C library entry point + BX r12 // Branch to __main C library entry point @@ -344,21 +373,15 @@ enable_caches: MCR p15, 0, r0, c1, c0, 0 // Write System Control Register ISB - -//---------------------------------------------------------------- -// Enable Cortex-A8 Level2 Unified Cache -//---------------------------------------------------------------- - MRC p15, 0, r0, c1, c0, 1 // Read Auxiliary Control Register ORR r0, #2 // L2EN bit, enable L2 cache + ORR r0, r0, #(0x1 << 2) // Set DP bit 2 to enable L1 Dside prefetch MCR p15, 0, r0, c1, c0, 1 // Write Auxiliary Control Register ISB BX lr - .cfi_endproc - .global disable_caches .type disable_caches, "function" disable_caches: @@ -371,3 +394,4 @@ disable_caches: BX lr + diff --git a/ports/cortex_a8/ac6/example_build/sample_threadx/tx_initialize_low_level.S b/ports/cortex_a8/ac6/example_build/sample_threadx/tx_initialize_low_level.S index aa4bee84..715958f0 100644 --- a/ports/cortex_a8/ac6/example_build/sample_threadx/tx_initialize_low_level.S +++ b/ports/cortex_a8/ac6/example_build/sample_threadx/tx_initialize_low_level.S @@ -1,345 +1,299 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Initialize */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_initialize.h" -@#include "tx_thread.h" -@#include "tx_timer.h" +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Initialize */ +/** */ +/**************************************************************************/ +/**************************************************************************/ .arm -SVC_MODE = 0xD3 @ Disable IRQ/FIQ SVC mode -IRQ_MODE = 0xD2 @ Disable IRQ/FIQ IRQ mode -FIQ_MODE = 0xD1 @ Disable IRQ/FIQ FIQ mode -SYS_MODE = 0xDF @ Disable IRQ/FIQ SYS mode -FIQ_STACK_SIZE = 512 @ FIQ stack size -IRQ_STACK_SIZE = 1024 @ IRQ stack size -SYS_STACK_SIZE = 1024 @ System stack size -@ -@ +SVC_MODE = 0xD3 // Disable IRQ/FIQ SVC mode +IRQ_MODE = 0xD2 // Disable IRQ/FIQ IRQ mode +FIQ_MODE = 0xD1 // Disable IRQ/FIQ FIQ mode +SYS_MODE = 0xDF // Disable IRQ/FIQ SYS mode +FIQ_STACK_SIZE = 512 // FIQ stack size +IRQ_STACK_SIZE = 1024 // IRQ stack size +SYS_STACK_SIZE = 1024 // System stack size + .global _tx_thread_system_stack_ptr .global _tx_initialize_unused_memory .global _tx_thread_context_save .global _tx_thread_context_restore .global _tx_timer_interrupt -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_initialize_low_level for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + + +/* Define the 16-bit Thumb mode veneer for _tx_initialize_low_level for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .thumb .global $_tx_initialize_low_level .type $_tx_initialize_low_level,function $_tx_initialize_low_level: - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_initialize_low_level @ Call _tx_initialize_low_level function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_initialize_low_level // Call _tx_initialize_low_level function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_initialize_low_level Cortex-A8/AC6 */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is responsible for any low-level processor */ -@/* initialization, including setting up interrupt vectors, setting */ -@/* up a periodic timer interrupt source, saving the system stack */ -@/* pointer for use in ISR processing later, and finding the first */ -@/* available RAM memory address for tx_application_define. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* _tx_initialize_kernel_enter ThreadX entry function */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_initialize_low_level(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_initialize_low_level ARMV7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for any low-level processor */ +/* initialization, including setting up interrupt vectors, setting */ +/* up a periodic timer interrupt source, saving the system stack */ +/* pointer for use in ISR processing later, and finding the first */ +/* available RAM memory address for tx_application_define. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_initialize_kernel_enter ThreadX entry function */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_initialize_low_level .type _tx_initialize_low_level,function _tx_initialize_low_level: -@ -@ /* We must be in SVC mode at this point! */ -@ -@ /* Setup various stack pointers. */ -@ - LDR r1, =Image$$ARM_LIB_STACK$$ZI$$Limit @ Get pointer to stack area -#ifdef TX_ENABLE_IRQ_NESTING -@ -@ /* Setup the system mode stack for nested interrupt support */ -@ - LDR r2, =SYS_STACK_SIZE @ Pickup stack size - MOV r3, #SYS_MODE @ Build SYS mode CPSR - MSR CPSR_c, r3 @ Enter SYS mode - SUB r1, r1, #1 @ Backup 1 byte - BIC r1, r1, #7 @ Ensure 8-byte alignment - MOV sp, r1 @ Setup SYS stack pointer - SUB r1, r1, r2 @ Calculate start of next stack + /* We must be in SVC mode at this point! */ + + /* Setup various stack pointers. */ + + LDR r1, =Image$$ARM_LIB_STACK$$ZI$$Limit // Get pointer to stack area + +#ifdef TX_ENABLE_IRQ_NESTING + + /* Setup the system mode stack for nested interrupt support */ + + LDR r2, =SYS_STACK_SIZE // Pickup stack size + MOV r3, #SYS_MODE // Build SYS mode CPSR + MSR CPSR_c, r3 // Enter SYS mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup SYS stack pointer + SUB r1, r1, r2 // Calculate start of next stack #endif - LDR r2, =FIQ_STACK_SIZE @ Pickup stack size - MOV r0, #FIQ_MODE @ Build FIQ mode CPSR - MSR CPSR, r0 @ Enter FIQ mode - SUB r1, r1, #1 @ Backup 1 byte - BIC r1, r1, #7 @ Ensure 8-byte alignment - MOV sp, r1 @ Setup FIQ stack pointer - SUB r1, r1, r2 @ Calculate start of next stack - LDR r2, =IRQ_STACK_SIZE @ Pickup IRQ stack size - MOV r0, #IRQ_MODE @ Build IRQ mode CPSR - MSR CPSR, r0 @ Enter IRQ mode - SUB r1, r1, #1 @ Backup 1 byte - BIC r1, r1, #7 @ Ensure 8-byte alignment - MOV sp, r1 @ Setup IRQ stack pointer - SUB r3, r1, r2 @ Calculate end of IRQ stack - MOV r0, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR, r0 @ Enter SVC mode - LDR r2, =Image$$ARM_LIB_STACK$$Base @ Pickup stack bottom - CMP r3, r2 @ Compare the current stack end with the bottom -_stack_error_loop: - BLT _stack_error_loop @ If the IRQ stack exceeds the stack bottom, just sit here! -@ -@ /* Save the system stack pointer. */ -@ _tx_thread_system_stack_ptr = (VOID_PTR) (sp); -@ - LDR r2, =_tx_thread_system_stack_ptr @ Pickup stack pointer - STR r1, [r2] @ Save the system stack -@ -@ /* Save the first available memory address. */ -@ _tx_initialize_unused_memory = (VOID_PTR) _end; -@ - LDR r1, =Image$$APP_DATA$$ZI$$Limit @ Get end of non-initialized RAM area - LDR r2, =_tx_initialize_unused_memory @ Pickup unused memory ptr address - ADD r1, r1, #8 @ Increment to next free word - STR r1, [r2] @ Save first free memory address -@ -@ /* Setup Timer for periodic interrupts. */ -@ -@ /* Done, return to caller. */ -@ + LDR r2, =FIQ_STACK_SIZE // Pickup stack size + MOV r0, #FIQ_MODE // Build FIQ mode CPSR + MSR CPSR, r0 // Enter FIQ mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup FIQ stack pointer + SUB r1, r1, r2 // Calculate start of next stack + LDR r2, =IRQ_STACK_SIZE // Pickup IRQ stack size + MOV r0, #IRQ_MODE // Build IRQ mode CPSR + MSR CPSR, r0 // Enter IRQ mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup IRQ stack pointer + SUB r3, r1, r2 // Calculate end of IRQ stack + MOV r0, #SVC_MODE // Build SVC mode CPSR + MSR CPSR, r0 // Enter SVC mode + LDR r2, =Image$$ARM_LIB_STACK$$Base // Pickup stack bottom + CMP r3, r2 // Compare the current stack end with the bottom +_stack_error_loop: + BLT _stack_error_loop // If the IRQ stack exceeds the stack bottom, just sit here! + + LDR r2, =_tx_thread_system_stack_ptr // Pickup stack pointer + STR r1, [r2] // Save the system stack + + LDR r1, =Image$$ZI_DATA$$ZI$$Limit // Get end of non-initialized RAM area + LDR r2, =_tx_initialize_unused_memory // Pickup unused memory ptr address + ADD r1, r1, #8 // Increment to next free word + STR r1, [r2] // Save first free memory address + #ifdef __THUMB_INTERWORK - BX lr @ Return to caller + BX lr // Return to caller #else - MOV pc, lr @ Return to caller + MOV pc, lr // Return to caller #endif -@} -@ -@ -@/* Define shells for each of the interrupt vectors. */ -@ + +/* Define shells for each of the interrupt vectors. */ + .global __tx_undefined __tx_undefined: - B __tx_undefined @ Undefined handler -@ + B __tx_undefined // Undefined handler + .global __tx_swi_interrupt __tx_swi_interrupt: - B __tx_swi_interrupt @ Software interrupt handler -@ + B __tx_swi_interrupt // Software interrupt handler + .global __tx_prefetch_handler __tx_prefetch_handler: - B __tx_prefetch_handler @ Prefetch exception handler -@ + B __tx_prefetch_handler // Prefetch exception handler + .global __tx_abort_handler __tx_abort_handler: - B __tx_abort_handler @ Abort exception handler -@ + B __tx_abort_handler // Abort exception handler + .global __tx_reserved_handler __tx_reserved_handler: - B __tx_reserved_handler @ Reserved exception handler -@ - .global __tx_irq_processing_return + B __tx_reserved_handler // Reserved exception handler + + .global __tx_irq_processing_return .type __tx_irq_processing_return,function .global __tx_irq_handler __tx_irq_handler: -@ -@ /* Jump to context save to save system context. */ + + /* Jump to context save to save system context. */ B _tx_thread_context_save __tx_irq_processing_return: -@ -@ /* At this point execution is still in the IRQ mode. The CPSR, point of -@ interrupt, and all C scratch registers are available for use. In -@ addition, IRQ interrupts may be re-enabled - with certain restrictions - -@ if nested IRQ interrupts are desired. Interrupts may be re-enabled over -@ small code sequences where lr is saved before enabling interrupts and -@ restored after interrupts are again disabled. */ -@ -@ /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start -@ from IRQ mode with interrupts disabled. This routine switches to the -@ system mode and returns with IRQ interrupts enabled. -@ -@ NOTE: It is very important to ensure all IRQ interrupts are cleared -@ prior to enabling nested IRQ interrupts. */ + + /* At this point execution is still in the IRQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. In + addition, IRQ interrupts may be re-enabled - with certain restrictions - + if nested IRQ interrupts are desired. Interrupts may be re-enabled over + small code sequences where lr is saved before enabling interrupts and + restored after interrupts are again disabled. */ + + /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start + from IRQ mode with interrupts disabled. This routine switches to the + system mode and returns with IRQ interrupts enabled. + + NOTE: It is very important to ensure all IRQ interrupts are cleared + prior to enabling nested IRQ interrupts. */ #ifdef TX_ENABLE_IRQ_NESTING BL _tx_thread_irq_nesting_start #endif -@ -@ /* For debug purpose, execute the timer interrupt processing here. In -@ a real system, some kind of status indication would have to be checked -@ before the timer interrupt handler could be called. */ -@ - BL _tx_timer_interrupt @ Timer interrupt handler -@ -@ -@ /* If interrupt nesting was started earlier, the end of interrupt nesting -@ service must be called before returning to _tx_thread_context_restore. -@ This routine returns in processing in IRQ mode with interrupts disabled. */ + + /* For debug purpose, execute the timer interrupt processing here. In + a real system, some kind of status indication would have to be checked + before the timer interrupt handler could be called. */ + + BL _tx_timer_interrupt // Timer interrupt handler + + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_context_restore. + This routine returns in processing in IRQ mode with interrupts disabled. */ #ifdef TX_ENABLE_IRQ_NESTING BL _tx_thread_irq_nesting_end #endif -@ -@ /* Jump to context restore to restore system context. */ + + /* Jump to context restore to restore system context. */ B _tx_thread_context_restore -@ -@ -@ /* This is an example of a vectored IRQ handler. */ -@ -@ .global __tx_example_vectored_irq_handler -@__tx_example_vectored_irq_handler: -@ -@ -@ /* Save initial context and call context save to prepare for -@ vectored ISR execution. */ -@ -@ STMDB sp!, {r0-r3} @ Save some scratch registers -@ MRS r0, SPSR @ Pickup saved SPSR -@ SUB lr, lr, #4 @ Adjust point of interrupt -@ STMDB sp!, {r0, r10, r12, lr} @ Store other scratch registers -@ BL _tx_thread_vectored_context_save @ Vectored context save -@ -@ /* At this point execution is still in the IRQ mode. The CPSR, point of -@ interrupt, and all C scratch registers are available for use. In -@ addition, IRQ interrupts may be re-enabled - with certain restrictions - -@ if nested IRQ interrupts are desired. Interrupts may be re-enabled over -@ small code sequences where lr is saved before enabling interrupts and -@ restored after interrupts are again disabled. */ -@ -@ -@ /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start -@ from IRQ mode with interrupts disabled. This routine switches to the -@ system mode and returns with IRQ interrupts enabled. -@ -@ NOTE: It is very important to ensure all IRQ interrupts are cleared -@ prior to enabling nested IRQ interrupts. */ -@#ifdef TX_ENABLE_IRQ_NESTING -@ BL _tx_thread_irq_nesting_start -@#endif -@ -@ /* Application IRQ handlers can be called here! */ -@ -@ /* If interrupt nesting was started earlier, the end of interrupt nesting -@ service must be called before returning to _tx_thread_context_restore. -@ This routine returns in processing in IRQ mode with interrupts disabled. */ -@#ifdef TX_ENABLE_IRQ_NESTING -@ BL _tx_thread_irq_nesting_end -@#endif -@ -@ /* Jump to context restore to restore system context. */ -@ B _tx_thread_context_restore -@ -@ + + + /* This is an example of a vectored IRQ handler. */ + + /* At this point execution is still in the IRQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. In + addition, IRQ interrupts may be re-enabled - with certain restrictions - + if nested IRQ interrupts are desired. Interrupts may be re-enabled over + small code sequences where lr is saved before enabling interrupts and + restored after interrupts are again disabled. */ + + + /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start + from IRQ mode with interrupts disabled. This routine switches to the + system mode and returns with IRQ interrupts enabled. + + NOTE: It is very important to ensure all IRQ interrupts are cleared + prior to enabling nested IRQ interrupts. */ + + /* Application IRQ handlers can be called here! */ + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_context_restore. + This routine returns in processing in IRQ mode with interrupts disabled. */ + + /* Jump to context restore to restore system context. */ + #ifdef TX_ENABLE_FIQ_SUPPORT .global __tx_fiq_handler .global __tx_fiq_processing_return __tx_fiq_handler: -@ -@ /* Jump to fiq context save to save system context. */ + + /* Jump to fiq context save to save system context. */ B _tx_thread_fiq_context_save __tx_fiq_processing_return: -@ -@ /* At this point execution is still in the FIQ mode. The CPSR, point of -@ interrupt, and all C scratch registers are available for use. */ -@ -@ /* Interrupt nesting is allowed after calling _tx_thread_fiq_nesting_start -@ from FIQ mode with interrupts disabled. This routine switches to the -@ system mode and returns with FIQ interrupts enabled. -@ -@ NOTE: It is very important to ensure all FIQ interrupts are cleared -@ prior to enabling nested FIQ interrupts. */ + + /* At this point execution is still in the FIQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. */ + + /* Interrupt nesting is allowed after calling _tx_thread_fiq_nesting_start + from FIQ mode with interrupts disabled. This routine switches to the + system mode and returns with FIQ interrupts enabled. + + NOTE: It is very important to ensure all FIQ interrupts are cleared + prior to enabling nested FIQ interrupts. */ #ifdef TX_ENABLE_FIQ_NESTING BL _tx_thread_fiq_nesting_start #endif -@ -@ /* Application FIQ handlers can be called here! */ -@ -@ /* If interrupt nesting was started earlier, the end of interrupt nesting -@ service must be called before returning to _tx_thread_fiq_context_restore. */ + + /* Application FIQ handlers can be called here! */ + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_fiq_context_restore. */ #ifdef TX_ENABLE_FIQ_NESTING BL _tx_thread_fiq_nesting_end #endif -@ -@ /* Jump to fiq context restore to restore system context. */ + + /* Jump to fiq context restore to restore system context. */ B _tx_thread_fiq_context_restore -@ -@ + + #else .global __tx_fiq_handler __tx_fiq_handler: - B __tx_fiq_handler @ FIQ interrupt handler + B __tx_fiq_handler // FIQ interrupt handler #endif -@ -@ + + BUILD_OPTIONS: - .word _tx_build_options @ Reference to bring in + .word _tx_build_options // Reference to bring in VERSION_ID: - .word _tx_version_id @ Reference to bring in - + .word _tx_version_id // Reference to bring in diff --git a/ports/cortex_a8/ac6/example_build/tx/.cproject b/ports/cortex_a8/ac6/example_build/tx/.cproject index 56b8532d..3d1f0818 100644 --- a/ports/cortex_a8/ac6/example_build/tx/.cproject +++ b/ports/cortex_a8/ac6/example_build/tx/.cproject @@ -3,9 +3,9 @@ - + - + @@ -23,37 +23,37 @@ - + - + - + - @@ -111,7 +111,7 @@ - + @@ -123,6 +123,10 @@ + + + + @@ -138,9 +142,5 @@ - - - - diff --git a/ports/cortex_a8/ac6/inc/tx_port.h b/ports/cortex_a8/ac6/inc/tx_port.h index 67055343..19463de1 100644 --- a/ports/cortex_a8/ac6/inc/tx_port.h +++ b/ports/cortex_a8/ac6/inc/tx_port.h @@ -12,7 +12,7 @@ /**************************************************************************/ /**************************************************************************/ -/** */ +/** */ /** ThreadX Component */ /** */ /** Port Specific */ @@ -21,36 +21,38 @@ /**************************************************************************/ -/**************************************************************************/ -/* */ -/* PORT SPECIFIC C INFORMATION RELEASE */ -/* */ -/* tx_port.h Cortex-A8/AC6 */ -/* 6.1.6 */ +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* tx_port.h ARMv7-A */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ /* */ /* DESCRIPTION */ -/* */ -/* This file contains data type definitions that make the ThreadX */ -/* real-time kernel function identically on a variety of different */ -/* processor architectures. For example, the size or number of bits */ -/* in an "int" data type vary between microprocessor architectures and */ -/* even C compilers for the same microprocessor. ThreadX does not */ -/* directly use native C data types. Instead, ThreadX creates its */ -/* own special types that can be mapped to actual data types by this */ -/* file to guarantee consistency in the interface and functionality. */ -/* */ -/* RELEASE HISTORY */ -/* */ +/* */ +/* This file contains data type definitions that make the ThreadX */ +/* real-time kernel function identically on a variety of different */ +/* processor architectures. For example, the size or number of bits */ +/* in an "int" data type vary between microprocessor architectures and */ +/* even C compilers for the same microprocessor. ThreadX does not */ +/* directly use native C data types. Instead, ThreadX creates its */ +/* own special types that can be mapped to actual data types by this */ +/* file to guarantee consistency in the interface and functionality. */ +/* */ +/* RELEASE HISTORY */ +/* */ /* DATE NAME DESCRIPTION */ /* */ /* 09-30-2020 William E. Lamie Initial Version 6.1 */ /* 04-02-2021 Bhupendra Naphade Modified comment(s),updated */ /* macro definition, */ /* resulting in version 6.1.6 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -63,7 +65,7 @@ #ifdef TX_INCLUDE_USER_DEFINE_FILE -/* Yes, include the user defines in tx_user.h. The defines in this file may +/* Yes, include the user defines in tx_user.h. The defines in this file may alternately be defined on the command line. */ #include "tx_user.h" @@ -76,7 +78,7 @@ #include -/* Define ThreadX basic types for this port. */ +/* Define ThreadX basic types for this port. */ #define VOID void typedef char CHAR; @@ -112,12 +114,12 @@ typedef unsigned short USHORT; #define TX_TIMER_THREAD_STACK_SIZE 1024 /* Default timer thread stack size */ #endif -#ifndef TX_TIMER_THREAD_PRIORITY -#define TX_TIMER_THREAD_PRIORITY 0 /* Default timer thread priority */ +#ifndef TX_TIMER_THREAD_PRIORITY +#define TX_TIMER_THREAD_PRIORITY 0 /* Default timer thread priority */ #endif -/* Define various constants for the ThreadX ARM port. */ +/* Define various constants for the ThreadX ARM port. */ #ifdef TX_ENABLE_FIQ_SUPPORT #define TX_INT_DISABLE 0xC0 /* Disable IRQ & FIQ interrupts */ @@ -127,8 +129,8 @@ typedef unsigned short USHORT; #define TX_INT_ENABLE 0x00 /* Enable IRQ interrupts */ -/* Define the clock source for trace event entry time stamp. The following two item are port specific. - For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock +/* Define the clock source for trace event entry time stamp. The following two item are port specific. + For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: #define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) @@ -175,7 +177,7 @@ typedef unsigned short USHORT; #define TX_INLINE_INITIALIZATION -/* Determine whether or not stack checking is enabled. By default, ThreadX stack checking is +/* Determine whether or not stack checking is enabled. By default, ThreadX stack checking is disabled. When the following is defined, ThreadX thread stack checking is enabled. If stack checking is enabled (TX_ENABLE_STACK_CHECKING is defined), the TX_DISABLE_STACK_FILLING define is negated, thereby forcing the stack fill which is necessary for the stack checking @@ -187,13 +189,13 @@ typedef unsigned short USHORT; /* Define the TX_THREAD control block extensions for this port. The main reason - for the multiple macros is so that backward compatibility can be maintained with + for the multiple macros is so that backward compatibility can be maintained with existing ThreadX kernel awareness modules. */ -#define TX_THREAD_EXTENSION_0 -#define TX_THREAD_EXTENSION_1 +#define TX_THREAD_EXTENSION_0 +#define TX_THREAD_EXTENSION_1 #define TX_THREAD_EXTENSION_2 ULONG tx_thread_vfp_enable; -#define TX_THREAD_EXTENSION_3 +#define TX_THREAD_EXTENSION_3 /* Define the port extensions of the remaining ThreadX objects. */ @@ -207,11 +209,11 @@ typedef unsigned short USHORT; #define TX_TIMER_EXTENSION -/* Define the user extension field of the thread control block. Nothing +/* Define the user extension field of the thread control block. Nothing additional is needed for this port so it is defined as white space. */ #ifndef TX_THREAD_USER_EXTENSION -#define TX_THREAD_USER_EXTENSION +#define TX_THREAD_USER_EXTENSION #endif @@ -219,8 +221,8 @@ typedef unsigned short USHORT; tx_thread_shell_entry, and tx_thread_terminate. */ -#define TX_THREAD_CREATE_EXTENSION(thread_ptr) -#define TX_THREAD_DELETE_EXTENSION(thread_ptr) +#define TX_THREAD_CREATE_EXTENSION(thread_ptr) +#define TX_THREAD_DELETE_EXTENSION(thread_ptr) #define TX_THREAD_COMPLETED_EXTENSION(thread_ptr) #define TX_THREAD_TERMINATED_EXTENSION(thread_ptr) @@ -247,24 +249,24 @@ typedef unsigned short USHORT; #define TX_TIMER_DELETE_EXTENSION(timer_ptr) -/* Determine if the ARM architecture has the CLZ instruction. This is available on - architectures v5 and above. If available, redefine the macro for calculating the +/* Determine if the ARM architecture has the CLZ instruction. This is available on + architectures v5 and above. If available, redefine the macro for calculating the lowest bit set. */ - + #if __TARGET_ARCH_ARM > 4 #ifndef __thumb__ #define TX_LOWEST_SET_BIT_CALCULATE(m, b) m = m & ((ULONG) (-((LONG) m))); \ asm volatile (" CLZ %0,%1 ": "=r" (b) : "r" (m) ); \ - b = 31 - b; + b = 31 - b; #endif #endif -/* Define ThreadX interrupt lockout and restore macros for protection on - access of critical kernel information. The restore interrupt macro must - restore the interrupt posture of the running thread prior to the value +/* Define ThreadX interrupt lockout and restore macros for protection on + access of critical kernel information. The restore interrupt macro must + restore the interrupt posture of the running thread prior to the value present prior to the disable macro. In most cases, the save area macro is used to define a local function save area for the disable and restore macros. */ @@ -295,7 +297,7 @@ unsigned int _tx_thread_interrupt_restore(UINT old_posture); #endif -/* Define VFP extension for the Cortex-A8. Each is assumed to be called in the context of the executing +/* Define VFP extension for the ARMv7-A. Each is assumed to be called in the context of the executing thread. */ void tx_thread_vfp_enable(void); @@ -315,8 +317,8 @@ void tx_thread_vfp_disable(void); /* Define the version ID of ThreadX. This may be utilized by the application. */ #ifdef TX_THREAD_INIT -CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-A8/AC6 Version 6.1.9 *"; +CHAR _tx_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX ARMv7-A Version 6.1.11 *"; #else extern CHAR _tx_version_id[]; #endif diff --git a/ports/cortex_a8/ac6/src/tx_thread_context_restore.S b/ports/cortex_a8/ac6/src/tx_thread_context_restore.S index ce46a277..fae7e72d 100644 --- a/ports/cortex_a8/ac6/src/tx_thread_context_restore.S +++ b/ports/cortex_a8/ac6/src/tx_thread_context_restore.S @@ -1,259 +1,222 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .arm #ifdef TX_ENABLE_FIQ_SUPPORT -SVC_MODE = 0xD3 @ Disable IRQ/FIQ, SVC mode -IRQ_MODE = 0xD2 @ Disable IRQ/FIQ, IRQ mode +SVC_MODE = 0xD3 // Disable IRQ/FIQ, SVC mode +IRQ_MODE = 0xD2 // Disable IRQ/FIQ, IRQ mode #else -SVC_MODE = 0x93 @ Disable IRQ, SVC mode -IRQ_MODE = 0x92 @ Disable IRQ, IRQ mode +SVC_MODE = 0x93 // Disable IRQ, SVC mode +IRQ_MODE = 0x92 // Disable IRQ, IRQ mode #endif -@ + .global _tx_thread_system_state .global _tx_thread_current_ptr .global _tx_thread_execute_ptr .global _tx_timer_time_slice .global _tx_thread_schedule .global _tx_thread_preempt_disable -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_restore -@ since it will never be called 16-bit mode. */ -@ + + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_restore + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_context_restore Cortex-A8/AC6 */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function restores the interrupt context if it is processing a */ -@/* nested interrupt. If not, it returns to the interrupt thread if no */ -@/* preemption is necessary. Otherwise, if preemption is necessary or */ -@/* if no thread was running, the function returns to the scheduler. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* _tx_thread_schedule Thread scheduling routine */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs Interrupt Service Routines */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_context_restore(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_context_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function restores the interrupt context if it is processing a */ +/* nested interrupt. If not, it returns to the interrupt thread if no */ +/* preemption is necessary. Otherwise, if preemption is necessary or */ +/* if no thread was running, the function returns to the scheduler. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling routine */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs Interrupt Service Routines */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_context_restore .type _tx_thread_context_restore,function _tx_thread_context_restore: -@ -@ /* Lockout interrupts. */ -@ + + /* Lockout interrupts. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ interrupts + CPSID if // Disable IRQ and FIQ interrupts #else - CPSID i @ Disable IRQ interrupts + CPSID i // Disable IRQ interrupts #endif #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR exit function to indicate an ISR is complete. */ -@ - BL _tx_execution_isr_exit @ Call the ISR exit function -#endif -@ -@ /* Determine if interrupts are nested. */ -@ if (--_tx_thread_system_state) -@ { -@ - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3] @ Pickup system state - SUB r2, r2, #1 @ Decrement the counter - STR r2, [r3] @ Store the counter - CMP r2, #0 @ Was this the first interrupt? - BEQ __tx_thread_not_nested_restore @ If so, not a nested restore -@ -@ /* Interrupts are nested. */ -@ -@ /* Just recover the saved registers and return to the point of -@ interrupt. */ -@ - LDMIA sp!, {r0, r10, r12, lr} @ Recover SPSR, POI, and scratch regs - MSR SPSR_cxsf, r0 @ Put SPSR back - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOVS pc, lr @ Return to point of interrupt -@ -@ } -__tx_thread_not_nested_restore: -@ -@ /* Determine if a thread was interrupted and no preemption is required. */ -@ else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr) -@ || (_tx_thread_preempt_disable)) -@ { -@ - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup actual current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_idle_system_restore @ Yes, idle system was interrupted -@ - LDR r3, =_tx_thread_preempt_disable @ Pickup preempt disable address - LDR r2, [r3] @ Pickup actual preempt disable flag - CMP r2, #0 @ Is it set? - BNE __tx_thread_no_preempt_restore @ Yes, don't preempt this thread - LDR r3, =_tx_thread_execute_ptr @ Pickup address of execute thread ptr - LDR r2, [r3] @ Pickup actual execute thread pointer - CMP r0, r2 @ Is the same thread highest priority? - BNE __tx_thread_preempt_restore @ No, preemption needs to happen -@ -@ -__tx_thread_no_preempt_restore: -@ -@ /* Restore interrupted thread or ISR. */ -@ -@ /* Pickup the saved stack pointer. */ -@ tmp_ptr = _tx_thread_current_ptr -> tx_thread_stack_ptr; -@ -@ /* Recover the saved context and return to the point of interrupt. */ -@ - LDMIA sp!, {r0, r10, r12, lr} @ Recover SPSR, POI, and scratch regs - MSR SPSR_cxsf, r0 @ Put SPSR back - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOVS pc, lr @ Return to point of interrupt -@ -@ } -@ else -@ { -__tx_thread_preempt_restore: -@ - LDMIA sp!, {r3, r10, r12, lr} @ Recover temporarily saved registers - MOV r1, lr @ Save lr (point of interrupt) - MOV r2, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r2 @ Enter SVC mode - STR r1, [sp, #-4]! @ Save point of interrupt - STMDB sp!, {r4-r12, lr} @ Save upper half of registers - MOV r4, r3 @ Save SPSR in r4 - MOV r2, #IRQ_MODE @ Build IRQ mode CPSR - MSR CPSR_c, r2 @ Enter IRQ mode - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOV r5, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r5 @ Enter SVC mode - STMDB sp!, {r0-r3} @ Save r0-r3 on thread's stack - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup current thread pointer + /* Call the ISR exit function to indicate an ISR is complete. */ + + BL _tx_execution_isr_exit // Call the ISR exit function +#endif + + /* Determine if interrupts are nested. */ + + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + SUB r2, r2, #1 // Decrement the counter + STR r2, [r3] // Store the counter + CMP r2, #0 // Was this the first interrupt? + BEQ __tx_thread_not_nested_restore // If so, not a nested restore + + /* Interrupts are nested. */ + + /* Just recover the saved registers and return to the point of + interrupt. */ + + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_not_nested_restore: + + /* Determine if a thread was interrupted and no preemption is required. */ + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup actual current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_restore // Yes, idle system was interrupted + + LDR r3, =_tx_thread_preempt_disable // Pickup preempt disable address + LDR r2, [r3] // Pickup actual preempt disable flag + CMP r2, #0 // Is it set? + BNE __tx_thread_no_preempt_restore // Yes, don't preempt this thread + LDR r3, =_tx_thread_execute_ptr // Pickup address of execute thread ptr + LDR r2, [r3] // Pickup actual execute thread pointer + CMP r0, r2 // Is the same thread highest priority? + BNE __tx_thread_preempt_restore // No, preemption needs to happen + + +__tx_thread_no_preempt_restore: + + /* Recover the saved context and return to the point of interrupt. */ + + /* Pickup the saved stack pointer. */ + + /* Recover the saved context and return to the point of interrupt. */ + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_preempt_restore: + + LDMIA sp!, {r3, r10, r12, lr} // Recover temporarily saved registers + MOV r1, lr // Save lr (point of interrupt) + MOV r2, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r2 // Enter SVC mode + STR r1, [sp, #-4]! // Save point of interrupt + STMDB sp!, {r4-r12, lr} // Save upper half of registers + MOV r4, r3 // Save SPSR in r4 + MOV r2, #IRQ_MODE // Build IRQ mode CPSR + MSR CPSR_c, r2 // Enter IRQ mode + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOV r5, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r5 // Enter SVC mode + STMDB sp!, {r0-r3} // Save r0-r3 on thread's stack + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer #ifdef TX_ENABLE_VFP_SUPPORT - LDR r2, [r0, #144] @ Pickup the VFP enabled flag - CMP r2, #0 @ Is the VFP enabled? - BEQ _tx_skip_irq_vfp_save @ No, skip VFP IRQ save - VMRS r2, FPSCR @ Pickup the FPSCR - STR r2, [sp, #-4]! @ Save FPSCR - VSTMDB sp!, {D16-D31} @ Save D16-D31 - VSTMDB sp!, {D0-D15} @ Save D0-D15 + LDR r2, [r0, #144] // Pickup the VFP enabled flag + CMP r2, #0 // Is the VFP enabled? + BEQ _tx_skip_irq_vfp_save // No, skip VFP IRQ save + VMRS r2, FPSCR // Pickup the FPSCR + STR r2, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D0-D15} // Save D0-D15 + _tx_skip_irq_vfp_save: + #endif - MOV r3, #1 @ Build interrupt stack type - STMDB sp!, {r3, r4} @ Save interrupt stack type and SPSR - STR sp, [r0, #8] @ Save stack pointer in thread control - @ block -@ -@ /* Save the remaining time-slice and disable it. */ -@ if (_tx_timer_time_slice) -@ { -@ - LDR r3, =_tx_timer_time_slice @ Pickup time-slice variable address - LDR r2, [r3] @ Pickup time-slice - CMP r2, #0 @ Is it active? - BEQ __tx_thread_dont_save_ts @ No, don't save it -@ -@ _tx_thread_current_ptr -> tx_thread_time_slice = _tx_timer_time_slice; -@ _tx_timer_time_slice = 0; -@ - STR r2, [r0, #24] @ Save thread's time-slice - MOV r2, #0 @ Clear value - STR r2, [r3] @ Disable global time-slice flag -@ -@ } + MOV r3, #1 // Build interrupt stack type + STMDB sp!, {r3, r4} // Save interrupt stack type and SPSR + STR sp, [r0, #8] // Save stack pointer in thread control + // block + + /* Save the remaining time-slice and disable it. */ + LDR r3, =_tx_timer_time_slice // Pickup time-slice variable address + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it active? + BEQ __tx_thread_dont_save_ts // No, don't save it + STR r2, [r0, #24] // Save thread's time-slice + MOV r2, #0 // Clear value + STR r2, [r3] // Disable global time-slice flag + __tx_thread_dont_save_ts: -@ -@ -@ /* Clear the current task pointer. */ -@ _tx_thread_current_ptr = TX_NULL; -@ - MOV r0, #0 @ NULL value - STR r0, [r1] @ Clear current thread pointer -@ -@ /* Return to the scheduler. */ -@ _tx_thread_schedule(); -@ - B _tx_thread_schedule @ Return to scheduler -@ } -@ + + /* Clear the current task pointer. */ + MOV r0, #0 // NULL value + STR r0, [r1] // Clear current thread pointer + + /* Return to the scheduler. */ + B _tx_thread_schedule // Return to scheduler + __tx_thread_idle_system_restore: -@ -@ /* Just return back to the scheduler! */ -@ - MOV r0, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r0 @ Enter SVC mode - B _tx_thread_schedule @ Return to scheduler -@} - - + /* Just return back to the scheduler! */ + MOV r0, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r0 // Enter SVC mode + B _tx_thread_schedule // Return to scheduler diff --git a/ports/cortex_a8/ac6/src/tx_thread_context_save.S b/ports/cortex_a8/ac6/src/tx_thread_context_save.S index 52408580..7ac48c2e 100644 --- a/ports/cortex_a8/ac6/src/tx_thread_context_save.S +++ b/ports/cortex_a8/ac6/src/tx_thread_context_save.S @@ -1,205 +1,172 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .global _tx_thread_system_state .global _tx_thread_current_ptr .global __tx_irq_processing_return -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_save -@ since it will never be called 16-bit mode. */ -@ + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_save + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_context_save Cortex-A8/AC6 */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function saves the context of an executing thread in the */ -@/* beginning of interrupt processing. The function also ensures that */ -@/* the system stack is used upon return to the calling ISR. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_context_save(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_context_save .type _tx_thread_context_save,function _tx_thread_context_save: -@ -@ /* Upon entry to this routine, it is assumed that IRQ interrupts are locked -@ out, we are in IRQ mode, and all registers are intact. */ -@ -@ /* Check for a nested interrupt condition. */ -@ if (_tx_thread_system_state++) -@ { -@ - STMDB sp!, {r0-r3} @ Save some working registers + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + + STMDB sp!, {r0-r3} // Save some working registers #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable FIQ interrupts + CPSID if // Disable FIQ interrupts #endif - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3] @ Pickup system state - CMP r2, #0 @ Is this the first interrupt? - BEQ __tx_thread_not_nested_save @ Yes, not a nested context save -@ -@ /* Nested interrupt condition. */ -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3] @ Store it back in the variable -@ -@ /* Save the rest of the scratch registers on the stack and return to the -@ calling ISR. */ -@ - MRS r0, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r0, r10, r12, lr} @ Store other registers -@ -@ /* Return to the ISR. */ -@ - MOV r10, #0 @ Clear stack limit + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + + /* Save the rest of the scratch registers on the stack and return to the + calling ISR. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, r10, r12, lr} // Store other registers + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - B __tx_irq_processing_return @ Continue IRQ processing -@ + B __tx_irq_processing_return // Continue IRQ processing + __tx_thread_not_nested_save: -@ } -@ -@ /* Otherwise, not nested, check to see if a thread was running. */ -@ else if (_tx_thread_current_ptr) -@ { -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3] @ Store it back in the variable - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_idle_system_save @ If so, interrupt occurred in - @ scheduling loop - nothing needs saving! -@ -@ /* Save minimal context of interrupted thread. */ -@ - MRS r2, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r2, r10, r12, lr} @ Store other registers -@ -@ /* Save the current stack pointer in the thread's control block. */ -@ _tx_thread_current_ptr -> tx_thread_stack_ptr = sp; -@ -@ /* Switch to the system stack. */ -@ sp = _tx_thread_system_stack_ptr@ -@ - MOV r10, #0 @ Clear stack limit + + /* Otherwise, not nested, check to see if a thread was running. */ + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + + /* Save minimal context of interrupted thread. */ + + MRS r2, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r2, r10, r12, lr} // Store other registers + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - B __tx_irq_processing_return @ Continue IRQ processing -@ -@ } -@ else -@ { -@ + B __tx_irq_processing_return // Continue IRQ processing + __tx_thread_idle_system_save: -@ -@ /* Interrupt occurred in the scheduling loop. */ -@ -@ /* Not much to do here, just adjust the stack pointer, and return to IRQ -@ processing. */ -@ - MOV r10, #0 @ Clear stack limit + + /* Interrupt occurred in the scheduling loop. */ + + /* Not much to do here, just adjust the stack pointer, and return to IRQ + processing. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - ADD sp, sp, #16 @ Recover saved registers - B __tx_irq_processing_return @ Continue IRQ processing -@ -@ } -@} - - - + ADD sp, sp, #16 // Recover saved registers + B __tx_irq_processing_return // Continue IRQ processing diff --git a/ports/cortex_a8/ac6/src/tx_thread_fiq_context_restore.S b/ports/cortex_a8/ac6/src/tx_thread_fiq_context_restore.S index c5d6abc8..006be973 100644 --- a/ports/cortex_a8/ac6/src/tx_thread_fiq_context_restore.S +++ b/ports/cortex_a8/ac6/src/tx_thread_fiq_context_restore.S @@ -1,43 +1,32 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ -@ -SVC_MODE = 0xD3 @ SVC mode -FIQ_MODE = 0xD1 @ FIQ mode -MODE_MASK = 0x1F @ Mode mask -THUMB_MASK = 0x20 @ Thumb bit mask -IRQ_MODE_BITS = 0x12 @ IRQ mode bits -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +SVC_MODE = 0xD3 // SVC mode +FIQ_MODE = 0xD1 // FIQ mode +MODE_MASK = 0x1F // Mode mask +THUMB_MASK = 0x20 // Thumb bit mask +IRQ_MODE_BITS = 0x12 // IRQ mode bits + + .global _tx_thread_system_state .global _tx_thread_current_ptr .global _tx_thread_system_stack_ptr @@ -45,218 +34,190 @@ IRQ_MODE_BITS = 0x12 @ IRQ mode bits .global _tx_timer_time_slice .global _tx_thread_schedule .global _tx_thread_preempt_disable -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_restore -@ since it will never be called 16-bit mode. */ -@ + .global _tx_execution_isr_exit + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_restore + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_fiq_context_restore Cortex-A8/AC6 */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function restores the fiq interrupt context when processing a */ -@/* nested interrupt. If not, it returns to the interrupt thread if no */ -@/* preemption is necessary. Otherwise, if preemption is necessary or */ -@/* if no thread was running, the function returns to the scheduler. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* _tx_thread_schedule Thread scheduling routine */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* FIQ ISR Interrupt Service Routines */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_fiq_context_restore(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_context_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function restores the fiq interrupt context when processing a */ +/* nested interrupt. If not, it returns to the interrupt thread if no */ +/* preemption is necessary. Otherwise, if preemption is necessary or */ +/* if no thread was running, the function returns to the scheduler. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling routine */ +/* */ +/* CALLED BY */ +/* */ +/* FIQ ISR Interrupt Service Routines */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_fiq_context_restore .type _tx_thread_fiq_context_restore,function _tx_thread_fiq_context_restore: -@ -@ /* Lockout interrupts. */ -@ - CPSID if @ Disable IRQ and FIQ interrupts + + /* Lockout interrupts. */ + + CPSID if // Disable IRQ and FIQ interrupts #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR exit function to indicate an ISR is complete. */ -@ - BL _tx_execution_isr_exit @ Call the ISR exit function + + /* Call the ISR exit function to indicate an ISR is complete. */ + + BL _tx_execution_isr_exit // Call the ISR exit function #endif -@ -@ /* Determine if interrupts are nested. */ -@ if (--_tx_thread_system_state) -@ { -@ - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3] @ Pickup system state - SUB r2, r2, #1 @ Decrement the counter - STR r2, [r3] @ Store the counter - CMP r2, #0 @ Was this the first interrupt? - BEQ __tx_thread_fiq_not_nested_restore @ If so, not a nested restore -@ -@ /* Interrupts are nested. */ -@ -@ /* Just recover the saved registers and return to the point of -@ interrupt. */ -@ - LDMIA sp!, {r0, r10, r12, lr} @ Recover SPSR, POI, and scratch regs - MSR SPSR_cxsf, r0 @ Put SPSR back - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOVS pc, lr @ Return to point of interrupt -@ -@ } + + /* Determine if interrupts are nested. */ + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + SUB r2, r2, #1 // Decrement the counter + STR r2, [r3] // Store the counter + CMP r2, #0 // Was this the first interrupt? + BEQ __tx_thread_fiq_not_nested_restore // If so, not a nested restore + + /* Interrupts are nested. */ + + /* Just recover the saved registers and return to the point of + interrupt. */ + + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + __tx_thread_fiq_not_nested_restore: -@ -@ /* Determine if a thread was interrupted and no preemption is required. */ -@ else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr) -@ || (_tx_thread_preempt_disable)) -@ { -@ - LDR r1, [sp] @ Pickup the saved SPSR - MOV r2, #MODE_MASK @ Build mask to isolate the interrupted mode - AND r1, r1, r2 @ Isolate mode bits - CMP r1, #IRQ_MODE_BITS @ Was an interrupt taken in IRQ mode before we - @ got to context save? */ - BEQ __tx_thread_fiq_no_preempt_restore @ Yes, just go back to point of interrupt + + /* Determine if a thread was interrupted and no preemption is required. */ + + LDR r1, [sp] // Pickup the saved SPSR + MOV r2, #MODE_MASK // Build mask to isolate the interrupted mode + AND r1, r1, r2 // Isolate mode bits + CMP r1, #IRQ_MODE_BITS // Was an interrupt taken in IRQ mode before we + // got to context save? */ + BEQ __tx_thread_fiq_no_preempt_restore // Yes, just go back to point of interrupt - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup actual current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_fiq_idle_system_restore @ Yes, idle system was interrupted + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup actual current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_fiq_idle_system_restore // Yes, idle system was interrupted - LDR r3, =_tx_thread_preempt_disable @ Pickup preempt disable address - LDR r2, [r3] @ Pickup actual preempt disable flag - CMP r2, #0 @ Is it set? - BNE __tx_thread_fiq_no_preempt_restore @ Yes, don't preempt this thread - LDR r3, =_tx_thread_execute_ptr @ Pickup address of execute thread ptr - LDR r2, [r3] @ Pickup actual execute thread pointer - CMP r0, r2 @ Is the same thread highest priority? - BNE __tx_thread_fiq_preempt_restore @ No, preemption needs to happen + LDR r3, =_tx_thread_preempt_disable // Pickup preempt disable address + LDR r2, [r3] // Pickup actual preempt disable flag + CMP r2, #0 // Is it set? + BNE __tx_thread_fiq_no_preempt_restore // Yes, don't preempt this thread + LDR r3, =_tx_thread_execute_ptr // Pickup address of execute thread ptr + LDR r2, [r3] // Pickup actual execute thread pointer + CMP r0, r2 // Is the same thread highest priority? + BNE __tx_thread_fiq_preempt_restore // No, preemption needs to happen __tx_thread_fiq_no_preempt_restore: -@ -@ /* Restore interrupted thread or ISR. */ -@ -@ /* Pickup the saved stack pointer. */ -@ tmp_ptr = _tx_thread_current_ptr -> tx_thread_stack_ptr; -@ -@ /* Recover the saved context and return to the point of interrupt. */ -@ - LDMIA sp!, {r0, lr} @ Recover SPSR, POI, and scratch regs - MSR SPSR_cxsf, r0 @ Put SPSR back - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOVS pc, lr @ Return to point of interrupt -@ -@ } -@ else -@ { -__tx_thread_fiq_preempt_restore: -@ - LDMIA sp!, {r3, lr} @ Recover temporarily saved registers - MOV r1, lr @ Save lr (point of interrupt) - MOV r2, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r2 @ Enter SVC mode - STR r1, [sp, #-4]! @ Save point of interrupt - STMDB sp!, {r4-r12, lr} @ Save upper half of registers - MOV r4, r3 @ Save SPSR in r4 - MOV r2, #FIQ_MODE @ Build FIQ mode CPSR - MSR CPSR_c, r2 @ Reenter FIQ mode - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOV r5, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r5 @ Enter SVC mode - STMDB sp!, {r0-r3} @ Save r0-r3 on thread's stack - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup current thread pointer + /* Restore interrupted thread or ISR. */ + /* Recover the saved context and return to the point of interrupt. */ + + LDMIA sp!, {r0, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_fiq_preempt_restore: + + LDMIA sp!, {r3, lr} // Recover temporarily saved registers + MOV r1, lr // Save lr (point of interrupt) + MOV r2, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r2 // Enter SVC mode + STR r1, [sp, #-4]! // Save point of interrupt + STMDB sp!, {r4-r12, lr} // Save upper half of registers + MOV r4, r3 // Save SPSR in r4 + MOV r2, #FIQ_MODE // Build FIQ mode CPSR + MSR CPSR_c, r2 // Reenter FIQ mode + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOV r5, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r5 // Enter SVC mode + STMDB sp!, {r0-r3} // Save r0-r3 on thread's stack + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer #ifdef TX_ENABLE_VFP_SUPPORT - LDR r2, [r0, #144] @ Pickup the VFP enabled flag - CMP r2, #0 @ Is the VFP enabled? - BEQ _tx_skip_fiq_vfp_save @ No, skip VFP IRQ save - VMRS r2, FPSCR @ Pickup the FPSCR - STR r2, [sp, #-4]! @ Save FPSCR - VSTMDB sp!, {D16-D31} @ Save D16-D31 - VSTMDB sp!, {D0-D15} @ Save D0-D15 + LDR r2, [r0, #144] // Pickup the VFP enabled flag + CMP r2, #0 // Is the VFP enabled? + BEQ _tx_skip_fiq_vfp_save // No, skip VFP IRQ save + VMRS r2, FPSCR // Pickup the FPSCR + STR r2, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D0-D15} // Save D0-D15 _tx_skip_fiq_vfp_save: #endif - MOV r3, #1 @ Build interrupt stack type - STMDB sp!, {r3, r4} @ Save interrupt stack type and SPSR - STR sp, [r0, #8] @ Save stack pointer in thread control - @ block */ -@ -@ /* Save the remaining time-slice and disable it. */ -@ if (_tx_timer_time_slice) -@ { -@ - LDR r3, =_tx_timer_time_slice @ Pickup time-slice variable address - LDR r2, [r3] @ Pickup time-slice - CMP r2, #0 @ Is it active? - BEQ __tx_thread_fiq_dont_save_ts @ No, don't save it -@ -@ _tx_thread_current_ptr -> tx_thread_time_slice = _tx_timer_time_slice; -@ _tx_timer_time_slice = 0; -@ - STR r2, [r0, #24] @ Save thread's time-slice - MOV r2, #0 @ Clear value - STR r2, [r3] @ Disable global time-slice flag -@ -@ } -__tx_thread_fiq_dont_save_ts: -@ -@ -@ /* Clear the current task pointer. */ -@ _tx_thread_current_ptr = TX_NULL; -@ - MOV r0, #0 @ NULL value - STR r0, [r1] @ Clear current thread pointer -@ -@ /* Return to the scheduler. */ -@ _tx_thread_schedule(); -@ - B _tx_thread_schedule @ Return to scheduler -@ } -@ -__tx_thread_fiq_idle_system_restore: -@ -@ /* Just return back to the scheduler! */ -@ - ADD sp, sp, #24 @ Recover FIQ stack space - MOV r3, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r3 @ Lockout interrupts - B _tx_thread_schedule @ Return to scheduler -@ -@} + MOV r3, #1 // Build interrupt stack type + STMDB sp!, {r3, r4} // Save interrupt stack type and SPSR + STR sp, [r0, #8] // Save stack pointer in thread control + // block */ + LDR r3, =_tx_timer_time_slice // Pickup time-slice variable address + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it active? + BEQ __tx_thread_fiq_dont_save_ts // No, don't save it + + STR r2, [r0, #24] // Save thread's time-slice + MOV r2, #0 // Clear value + STR r2, [r3] // Disable global time-slice flag + +__tx_thread_fiq_dont_save_ts: + + /* Clear the current task pointer. */ + + MOV r0, #0 // NULL value + STR r0, [r1] // Clear current thread pointer + + /* Return to the scheduler. */ + + B _tx_thread_schedule // Return to scheduler + +__tx_thread_fiq_idle_system_restore: + + /* Just return back to the scheduler! */ + + ADD sp, sp, #24 // Recover FIQ stack space + MOV r3, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r3 // Lockout interrupts + B _tx_thread_schedule // Return to scheduler diff --git a/ports/cortex_a8/ac6/src/tx_thread_fiq_context_save.S b/ports/cortex_a8/ac6/src/tx_thread_fiq_context_save.S index fa7cb043..7db6a4c2 100644 --- a/ports/cortex_a8/ac6/src/tx_thread_fiq_context_save.S +++ b/ports/cortex_a8/ac6/src/tx_thread_fiq_context_save.S @@ -1,206 +1,178 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .global _tx_thread_system_state .global _tx_thread_current_ptr .global __tx_fiq_processing_return -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_save -@ since it will never be called 16-bit mode. */ -@ + .global _tx_execution_isr_enter + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_save + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_fiq_context_save Cortex-A8/AC6 */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function saves the context of an executing thread in the */ -@/* beginning of interrupt processing. The function also ensures that */ -@/* the system stack is used upon return to the calling ISR. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@ VOID _tx_thread_fiq_context_save(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_fiq_context_save .type _tx_thread_fiq_context_save,function _tx_thread_fiq_context_save: -@ -@ /* Upon entry to this routine, it is assumed that IRQ interrupts are locked -@ out, we are in IRQ mode, and all registers are intact. */ -@ -@ /* Check for a nested interrupt condition. */ -@ if (_tx_thread_system_state++) -@ { -@ - STMDB sp!, {r0-r3} @ Save some working registers - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3] @ Pickup system state - CMP r2, #0 @ Is this the first interrupt? - BEQ __tx_thread_fiq_not_nested_save @ Yes, not a nested context save -@ -@ /* Nested interrupt condition. */ -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3] @ Store it back in the variable -@ -@ /* Save the rest of the scratch registers on the stack and return to the -@ calling ISR. */ -@ - MRS r0, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r0, r10, r12, lr} @ Store other registers -@ -@ /* Return to the ISR. */ -@ - MOV r10, #0 @ Clear stack limit + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + + STMDB sp!, {r0-r3} // Save some working registers + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_fiq_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + + /* Save the rest of the scratch registers on the stack and return to the + calling ISR. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, r10, r12, lr} // Store other registers + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - B __tx_fiq_processing_return @ Continue FIQ processing -@ + B __tx_fiq_processing_return // Continue FIQ processing +// __tx_thread_fiq_not_nested_save: -@ } -@ -@ /* Otherwise, not nested, check to see if a thread was running. */ -@ else if (_tx_thread_current_ptr) -@ { -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3] @ Store it back in the variable - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_fiq_idle_system_save @ If so, interrupt occurred in -@ @ scheduling loop - nothing needs saving! -@ -@ /* Save minimal context of interrupted thread. */ -@ - MRS r2, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r2, lr} @ Store other registers, Note that we don't -@ @ need to save sl and ip since FIQ has -@ @ copies of these registers. Nested -@ @ interrupt processing does need to save -@ @ these registers. -@ -@ /* Save the current stack pointer in the thread's control block. */ -@ _tx_thread_current_ptr -> tx_thread_stack_ptr = sp; -@ -@ /* Switch to the system stack. */ -@ sp = _tx_thread_system_stack_ptr; -@ - MOV r10, #0 @ Clear stack limit + + /* Otherwise, not nested, check to see if a thread was running. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_fiq_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + + /* Save minimal context of interrupted thread. */ + + MRS r2, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r2, lr} // Store other registers, Note that we don't + // need to save sl and ip since FIQ has + // copies of these registers. Nested + // interrupt processing does need to save + // these registers. + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - B __tx_fiq_processing_return @ Continue FIQ processing -@ -@ } -@ else -@ { -@ + B __tx_fiq_processing_return // Continue FIQ processing + __tx_thread_fiq_idle_system_save: -@ -@ /* Interrupt occurred in the scheduling loop. */ -@ -#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr -#endif -@ -@ /* Not much to do here, save the current SPSR and LR for possible -@ use in IRQ interrupted in idle system conditions, and return to -@ FIQ interrupt processing. */ -@ - MRS r0, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r0, lr} @ Store other registers that will get used -@ @ or stripped off the stack in context -@ @ restore - B __tx_fiq_processing_return @ Continue FIQ processing -@ -@ } -@} + /* Interrupt occurred in the scheduling loop. */ + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + /* Not much to do here, save the current SPSR and LR for possible + use in IRQ interrupted in idle system conditions, and return to + FIQ interrupt processing. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, lr} // Store other registers that will get used + // or stripped off the stack in context + // restore + B __tx_fiq_processing_return // Continue FIQ processing diff --git a/ports/cortex_a8/ac6/src/tx_thread_fiq_nesting_end.S b/ports/cortex_a8/ac6/src/tx_thread_fiq_nesting_end.S index 18375623..b34d881e 100644 --- a/ports/cortex_a8/ac6/src/tx_thread_fiq_nesting_end.S +++ b/ports/cortex_a8/ac6/src/tx_thread_fiq_nesting_end.S @@ -1,116 +1,104 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + #ifdef TX_ENABLE_FIQ_SUPPORT -DISABLE_INTS = 0xC0 @ Disable IRQ/FIQ interrupts +DISABLE_INTS = 0xC0 // Disable IRQ/FIQ interrupts #else -DISABLE_INTS = 0x80 @ Disable IRQ interrupts +DISABLE_INTS = 0x80 // Disable IRQ interrupts #endif -MODE_MASK = 0x1F @ Mode mask -FIQ_MODE_BITS = 0x11 @ FIQ mode bits -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_end -@ since it will never be called 16-bit mode. */ -@ +MODE_MASK = 0x1F // Mode mask +FIQ_MODE_BITS = 0x11 // FIQ mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_end + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_fiq_nesting_end Cortex-A8/AC6 */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is called by the application from FIQ mode after */ -@/* _tx_thread_fiq_nesting_start has been called and switches the FIQ */ -@/* processing from system mode back to FIQ mode prior to the ISR */ -@/* calling _tx_thread_fiq_context_restore. Note that this function */ -@/* assumes the system stack pointer is in the same position after */ -@/* nesting start function was called. */ -@/* */ -@/* This function assumes that the system mode stack pointer was setup */ -@/* during low-level initialization (tx_initialize_low_level.s). */ -@/* */ -@/* This function returns with FIQ interrupts disabled. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_fiq_nesting_end(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_nesting_end ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from FIQ mode after */ +/* _tx_thread_fiq_nesting_start has been called and switches the FIQ */ +/* processing from system mode back to FIQ mode prior to the ISR */ +/* calling _tx_thread_fiq_context_restore. Note that this function */ +/* assumes the system stack pointer is in the same position after */ +/* nesting start function was called. */ +/* */ +/* This function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with FIQ interrupts disabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_fiq_nesting_end .type _tx_thread_fiq_nesting_end,function _tx_thread_fiq_nesting_end: - MOV r3,lr @ Save ISR return address - MRS r0, CPSR @ Pickup the CPSR - ORR r0, r0, #DISABLE_INTS @ Build disable interrupt value - MSR CPSR_c, r0 @ Disable interrupts - LDMIA sp!, {r1, lr} @ Pickup saved lr (and r1 throw-away for - @ 8-byte alignment logic) - BIC r0, r0, #MODE_MASK @ Clear mode bits - ORR r0, r0, #FIQ_MODE_BITS @ Build IRQ mode CPSR - MSR CPSR_c, r0 @ Reenter IRQ mode + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + ORR r0, r0, #DISABLE_INTS // Build disable interrupt value + MSR CPSR_c, r0 // Disable interrupts + LDMIA sp!, {r1, lr} // Pickup saved lr (and r1 throw-away for + // 8-byte alignment logic) + BIC r0, r0, #MODE_MASK // Clear mode bits + ORR r0, r0, #FIQ_MODE_BITS // Build IRQ mode CPSR + MSR CPSR_c, r0 // Reenter IRQ mode #ifdef __THUMB_INTERWORK - BX r3 @ Return to caller + BX r3 // Return to caller #else - MOV pc, r3 @ Return to caller + MOV pc, r3 // Return to caller #endif -@} - diff --git a/ports/cortex_a8/ac6/src/tx_thread_fiq_nesting_start.S b/ports/cortex_a8/ac6/src/tx_thread_fiq_nesting_start.S index 54bc9312..c9cd5a06 100644 --- a/ports/cortex_a8/ac6/src/tx_thread_fiq_nesting_start.S +++ b/ports/cortex_a8/ac6/src/tx_thread_fiq_nesting_start.S @@ -1,108 +1,96 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ -FIQ_DISABLE = 0x40 @ FIQ disable bit -MODE_MASK = 0x1F @ Mode mask -SYS_MODE_BITS = 0x1F @ System mode bits -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_start -@ since it will never be called 16-bit mode. */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +FIQ_DISABLE = 0x40 // FIQ disable bit +MODE_MASK = 0x1F // Mode mask +SYS_MODE_BITS = 0x1F // System mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_start + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_fiq_nesting_start Cortex-A8/AC6 */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is called by the application from FIQ mode after */ -@/* _tx_thread_fiq_context_save has been called and switches the FIQ */ -@/* processing to the system mode so nested FIQ interrupt processing */ -@/* is possible (system mode has its own "lr" register). Note that */ -@/* this function assumes that the system mode stack pointer was setup */ -@/* during low-level initialization (tx_initialize_low_level.s). */ -@/* */ -@/* This function returns with FIQ interrupts enabled. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_fiq_nesting_start(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_nesting_start ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from FIQ mode after */ +/* _tx_thread_fiq_context_save has been called and switches the FIQ */ +/* processing to the system mode so nested FIQ interrupt processing */ +/* is possible (system mode has its own "lr" register). Note that */ +/* this function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with FIQ interrupts enabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_fiq_nesting_start .type _tx_thread_fiq_nesting_start,function _tx_thread_fiq_nesting_start: - MOV r3,lr @ Save ISR return address - MRS r0, CPSR @ Pickup the CPSR - BIC r0, r0, #MODE_MASK @ Clear the mode bits - ORR r0, r0, #SYS_MODE_BITS @ Build system mode CPSR - MSR CPSR_c, r0 @ Enter system mode - STMDB sp!, {r1, lr} @ Push the system mode lr on the system mode stack - @ and push r1 just to keep 8-byte alignment - BIC r0, r0, #FIQ_DISABLE @ Build enable FIQ CPSR - MSR CPSR_c, r0 @ Enter system mode + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + BIC r0, r0, #MODE_MASK // Clear the mode bits + ORR r0, r0, #SYS_MODE_BITS // Build system mode CPSR + MSR CPSR_c, r0 // Enter system mode + STMDB sp!, {r1, lr} // Push the system mode lr on the system mode stack + // and push r1 just to keep 8-byte alignment + BIC r0, r0, #FIQ_DISABLE // Build enable FIQ CPSR + MSR CPSR_c, r0 // Enter system mode #ifdef __THUMB_INTERWORK - BX r3 @ Return to caller + BX r3 // Return to caller #else - MOV pc, r3 @ Return to caller + MOV pc, r3 // Return to caller #endif -@} - diff --git a/ports/cortex_a8/ac6/src/tx_thread_interrupt_control.S b/ports/cortex_a8/ac6/src/tx_thread_interrupt_control.S index d6a6c3e3..63b1609a 100644 --- a/ports/cortex_a8/ac6/src/tx_thread_interrupt_control.S +++ b/ports/cortex_a8/ac6/src/tx_thread_interrupt_control.S @@ -1,115 +1,104 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ INT_MASK = 0x03F -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_control for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_control for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_interrupt_control $_tx_thread_interrupt_control: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_interrupt_control @ Call _tx_thread_interrupt_control function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_control // Call _tx_thread_interrupt_control function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_interrupt_control Cortex-A8/AC6 */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is responsible for changing the interrupt lockout */ -@/* posture of the system. */ -@/* */ -@/* INPUT */ -@/* */ -@/* new_posture New interrupt lockout posture */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* old_posture Old interrupt lockout posture */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* Application Code */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@UINT _tx_thread_interrupt_control(UINT new_posture) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_control ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for changing the interrupt lockout */ +/* posture of the system. */ +/* */ +/* INPUT */ +/* */ +/* new_posture New interrupt lockout posture */ +/* */ +/* OUTPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_interrupt_control .type _tx_thread_interrupt_control,function _tx_thread_interrupt_control: -@ -@ /* Pickup current interrupt lockout posture. */ -@ - MRS r3, CPSR @ Pickup current CPSR - MOV r2, #INT_MASK @ Build interrupt mask - AND r1, r3, r2 @ Clear interrupt lockout bits - ORR r1, r1, r0 @ Or-in new interrupt lockout bits -@ -@ /* Apply the new interrupt posture. */ -@ - MSR CPSR_c, r1 @ Setup new CPSR - BIC r0, r3, r2 @ Return previous interrupt mask -#ifdef __THUMB_INTERWORK - BX lr @ Return to caller -#else - MOV pc, lr @ Return to caller -#endif -@} + /* Pickup current interrupt lockout posture. */ + + MRS r3, CPSR // Pickup current CPSR + MOV r2, #INT_MASK // Build interrupt mask + AND r1, r3, r2 // Clear interrupt lockout bits + ORR r1, r1, r0 // Or-in new interrupt lockout bits + + /* Apply the new interrupt posture. */ + + MSR CPSR_c, r1 // Setup new CPSR + BIC r0, r3, r2 // Return previous interrupt mask +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a8/ac6/src/tx_thread_interrupt_disable.S b/ports/cortex_a8/ac6/src/tx_thread_interrupt_disable.S index 984ea3c5..13258808 100644 --- a/ports/cortex_a8/ac6/src/tx_thread_interrupt_disable.S +++ b/ports/cortex_a8/ac6/src/tx_thread_interrupt_disable.S @@ -1,113 +1,101 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_disable for -@ applications calling this function from to 16-bit Thumb mode. */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_disable for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_interrupt_disable $_tx_thread_interrupt_disable: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_interrupt_disable @ Call _tx_thread_interrupt_disable function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_disable // Call _tx_thread_interrupt_disable function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_interrupt_disable Cortex-A8/AC6 */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is responsible for disabling interrupts */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* old_posture Old interrupt lockout posture */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* Application Code */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@UINT _tx_thread_interrupt_disable(void) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_disable ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for disabling interrupts */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_interrupt_disable .type _tx_thread_interrupt_disable,function _tx_thread_interrupt_disable: -@ -@ /* Pickup current interrupt lockout posture. */ -@ - MRS r0, CPSR @ Pickup current CPSR -@ -@ /* Mask interrupts. */ -@ + + /* Pickup current interrupt lockout posture. */ + + MRS r0, CPSR // Pickup current CPSR + + /* Mask interrupts. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ + CPSID if // Disable IRQ and FIQ #else - CPSID i @ Disable IRQ + CPSID i // Disable IRQ #endif #ifdef __THUMB_INTERWORK - BX lr @ Return to caller + BX lr // Return to caller #else - MOV pc, lr @ Return to caller + MOV pc, lr // Return to caller #endif -@} - - diff --git a/ports/cortex_a8/ac6/src/tx_thread_interrupt_restore.S b/ports/cortex_a8/ac6/src/tx_thread_interrupt_restore.S index 563eaa2d..2d582511 100644 --- a/ports/cortex_a8/ac6/src/tx_thread_interrupt_restore.S +++ b/ports/cortex_a8/ac6/src/tx_thread_interrupt_restore.S @@ -1,104 +1,93 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_restore for -@ applications calling this function from to 16-bit Thumb mode. */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_restore for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_interrupt_restore $_tx_thread_interrupt_restore: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_interrupt_restore @ Call _tx_thread_interrupt_restore function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_restore // Call _tx_thread_interrupt_restore function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_interrupt_restore Cortex-A8/AC6 */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is responsible for restoring interrupts to the state */ -@/* returned by a previous _tx_thread_interrupt_disable call. */ -@/* */ -@/* INPUT */ -@/* */ -@/* old_posture Old interrupt lockout posture */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* Application Code */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@UINT _tx_thread_interrupt_restore(UINT old_posture) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for restoring interrupts to the state */ +/* returned by a previous _tx_thread_interrupt_disable call. */ +/* */ +/* INPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_interrupt_restore .type _tx_thread_interrupt_restore,function _tx_thread_interrupt_restore: -@ -@ /* Apply the new interrupt posture. */ -@ - MSR CPSR_c, r0 @ Setup new CPSR -#ifdef __THUMB_INTERWORK - BX lr @ Return to caller -#else - MOV pc, lr @ Return to caller -#endif -@} + /* Apply the new interrupt posture. */ + + MSR CPSR_c, r0 // Setup new CPSR +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a8/ac6/src/tx_thread_irq_nesting_end.S b/ports/cortex_a8/ac6/src/tx_thread_irq_nesting_end.S index 5e152c09..ec7e63c6 100644 --- a/ports/cortex_a8/ac6/src/tx_thread_irq_nesting_end.S +++ b/ports/cortex_a8/ac6/src/tx_thread_irq_nesting_end.S @@ -1,115 +1,103 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + #ifdef TX_ENABLE_FIQ_SUPPORT -DISABLE_INTS = 0xC0 @ Disable IRQ/FIQ interrupts +DISABLE_INTS = 0xC0 // Disable IRQ/FIQ interrupts #else -DISABLE_INTS = 0x80 @ Disable IRQ interrupts +DISABLE_INTS = 0x80 // Disable IRQ interrupts #endif -MODE_MASK = 0x1F @ Mode mask -IRQ_MODE_BITS = 0x12 @ IRQ mode bits -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_end -@ since it will never be called 16-bit mode. */ -@ +MODE_MASK = 0x1F // Mode mask +IRQ_MODE_BITS = 0x12 // IRQ mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_end + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_irq_nesting_end Cortex-A8/AC6 */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is called by the application from IRQ mode after */ -@/* _tx_thread_irq_nesting_start has been called and switches the IRQ */ -@/* processing from system mode back to IRQ mode prior to the ISR */ -@/* calling _tx_thread_context_restore. Note that this function */ -@/* assumes the system stack pointer is in the same position after */ -@/* nesting start function was called. */ -@/* */ -@/* This function assumes that the system mode stack pointer was setup */ -@/* during low-level initialization (tx_initialize_low_level.s). */ -@/* */ -@/* This function returns with IRQ interrupts disabled. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_irq_nesting_end(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_irq_nesting_end ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from IRQ mode after */ +/* _tx_thread_irq_nesting_start has been called and switches the IRQ */ +/* processing from system mode back to IRQ mode prior to the ISR */ +/* calling _tx_thread_context_restore. Note that this function */ +/* assumes the system stack pointer is in the same position after */ +/* nesting start function was called. */ +/* */ +/* This function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with IRQ interrupts disabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_irq_nesting_end .type _tx_thread_irq_nesting_end,function _tx_thread_irq_nesting_end: - MOV r3,lr @ Save ISR return address - MRS r0, CPSR @ Pickup the CPSR - ORR r0, r0, #DISABLE_INTS @ Build disable interrupt value - MSR CPSR_c, r0 @ Disable interrupts - LDMIA sp!, {r1, lr} @ Pickup saved lr (and r1 throw-away for - @ 8-byte alignment logic) - BIC r0, r0, #MODE_MASK @ Clear mode bits - ORR r0, r0, #IRQ_MODE_BITS @ Build IRQ mode CPSR - MSR CPSR_c, r0 @ Reenter IRQ mode + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + ORR r0, r0, #DISABLE_INTS // Build disable interrupt value + MSR CPSR_c, r0 // Disable interrupts + LDMIA sp!, {r1, lr} // Pickup saved lr (and r1 throw-away for + // 8-byte alignment logic) + BIC r0, r0, #MODE_MASK // Clear mode bits + ORR r0, r0, #IRQ_MODE_BITS // Build IRQ mode CPSR + MSR CPSR_c, r0 // Reenter IRQ mode #ifdef __THUMB_INTERWORK - BX r3 @ Return to caller + BX r3 // Return to caller #else - MOV pc, r3 @ Return to caller + MOV pc, r3 // Return to caller #endif -@} - diff --git a/ports/cortex_a8/ac6/src/tx_thread_irq_nesting_start.S b/ports/cortex_a8/ac6/src/tx_thread_irq_nesting_start.S index 27836bec..c69976ed 100644 --- a/ports/cortex_a8/ac6/src/tx_thread_irq_nesting_start.S +++ b/ports/cortex_a8/ac6/src/tx_thread_irq_nesting_start.S @@ -1,108 +1,96 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ -IRQ_DISABLE = 0x80 @ IRQ disable bit -MODE_MASK = 0x1F @ Mode mask -SYS_MODE_BITS = 0x1F @ System mode bits -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_start -@ since it will never be called 16-bit mode. */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +IRQ_DISABLE = 0x80 // IRQ disable bit +MODE_MASK = 0x1F // Mode mask +SYS_MODE_BITS = 0x1F // System mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_start + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_irq_nesting_start Cortex-A8/AC6 */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is called by the application from IRQ mode after */ -@/* _tx_thread_context_save has been called and switches the IRQ */ -@/* processing to the system mode so nested IRQ interrupt processing */ -@/* is possible (system mode has its own "lr" register). Note that */ -@/* this function assumes that the system mode stack pointer was setup */ -@/* during low-level initialization (tx_initialize_low_level.s). */ -@/* */ -@/* This function returns with IRQ interrupts enabled. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_irq_nesting_start(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_irq_nesting_start ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from IRQ mode after */ +/* _tx_thread_context_save has been called and switches the IRQ */ +/* processing to the system mode so nested IRQ interrupt processing */ +/* is possible (system mode has its own "lr" register). Note that */ +/* this function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with IRQ interrupts enabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_irq_nesting_start .type _tx_thread_irq_nesting_start,function _tx_thread_irq_nesting_start: - MOV r3,lr @ Save ISR return address - MRS r0, CPSR @ Pickup the CPSR - BIC r0, r0, #MODE_MASK @ Clear the mode bits - ORR r0, r0, #SYS_MODE_BITS @ Build system mode CPSR - MSR CPSR_c, r0 @ Enter system mode - STMDB sp!, {r1, lr} @ Push the system mode lr on the system mode stack - @ and push r1 just to keep 8-byte alignment - BIC r0, r0, #IRQ_DISABLE @ Build enable IRQ CPSR - MSR CPSR_c, r0 @ Enter system mode + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + BIC r0, r0, #MODE_MASK // Clear the mode bits + ORR r0, r0, #SYS_MODE_BITS // Build system mode CPSR + MSR CPSR_c, r0 // Enter system mode + STMDB sp!, {r1, lr} // Push the system mode lr on the system mode stack + // and push r1 just to keep 8-byte alignment + BIC r0, r0, #IRQ_DISABLE // Build enable IRQ CPSR + MSR CPSR_c, r0 // Enter system mode #ifdef __THUMB_INTERWORK - BX r3 @ Return to caller + BX r3 // Return to caller #else - MOV pc, r3 @ Return to caller + MOV pc, r3 // Return to caller #endif -@} - diff --git a/ports/cortex_a8/ac6/src/tx_thread_schedule.S b/ports/cortex_a8/ac6/src/tx_thread_schedule.S index 31e8bb67..8330e9df 100644 --- a/ports/cortex_a8/ac6/src/tx_thread_schedule.S +++ b/ports/cortex_a8/ac6/src/tx_thread_schedule.S @@ -1,257 +1,230 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .global _tx_thread_execute_ptr .global _tx_thread_current_ptr .global _tx_timer_time_slice -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_schedule for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_schedule for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_schedule .type $_tx_thread_schedule,function $_tx_thread_schedule: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_schedule @ Call _tx_thread_schedule function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_schedule // Call _tx_thread_schedule function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_schedule Cortex-A8/AC6 */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function waits for a thread control block pointer to appear in */ -@/* the _tx_thread_execute_ptr variable. Once a thread pointer appears */ -@/* in the variable, the corresponding thread is resumed. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* _tx_initialize_kernel_enter ThreadX entry function */ -@/* _tx_thread_system_return Return to system from thread */ -@/* _tx_thread_context_restore Restore thread's context */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_schedule(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_schedule ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function waits for a thread control block pointer to appear in */ +/* the _tx_thread_execute_ptr variable. Once a thread pointer appears */ +/* in the variable, the corresponding thread is resumed. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_initialize_kernel_enter ThreadX entry function */ +/* _tx_thread_system_return Return to system from thread */ +/* _tx_thread_context_restore Restore thread's context */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_schedule .type _tx_thread_schedule,function _tx_thread_schedule: -@ -@ /* Enable interrupts. */ -@ + + /* Enable interrupts. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSIE if @ Enable IRQ and FIQ interrupts + CPSIE if // Enable IRQ and FIQ interrupts #else - CPSIE i @ Enable IRQ interrupts + CPSIE i // Enable IRQ interrupts #endif -@ -@ /* Wait for a thread to execute. */ -@ do -@ { - LDR r1, =_tx_thread_execute_ptr @ Address of thread execute ptr -@ + + /* Wait for a thread to execute. */ + LDR r1, =_tx_thread_execute_ptr // Address of thread execute ptr + __tx_thread_schedule_loop: -@ - LDR r0, [r1] @ Pickup next thread to execute - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_schedule_loop @ If so, keep looking for a thread -@ -@ } -@ while(_tx_thread_execute_ptr == TX_NULL); -@ -@ /* Yes! We have a thread to execute. Lockout interrupts and -@ transfer control to it. */ -@ + + LDR r0, [r1] // Pickup next thread to execute + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_schedule_loop // If so, keep looking for a thread + /* Yes! We have a thread to execute. Lockout interrupts and + transfer control to it. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ interrupts + CPSID if // Disable IRQ and FIQ interrupts #else - CPSID i @ Disable IRQ interrupts + CPSID i // Disable IRQ interrupts #endif -@ -@ /* Setup the current thread pointer. */ -@ _tx_thread_current_ptr = _tx_thread_execute_ptr; -@ - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread - STR r0, [r1] @ Setup current thread pointer -@ -@ /* Increment the run count for this thread. */ -@ _tx_thread_current_ptr -> tx_thread_run_count++; -@ - LDR r2, [r0, #4] @ Pickup run counter - LDR r3, [r0, #24] @ Pickup time-slice for this thread - ADD r2, r2, #1 @ Increment thread run-counter - STR r2, [r0, #4] @ Store the new run counter -@ -@ /* Setup time-slice, if present. */ -@ _tx_timer_time_slice = _tx_thread_current_ptr -> tx_thread_time_slice; -@ - LDR r2, =_tx_timer_time_slice @ Pickup address of time-slice - @ variable - LDR sp, [r0, #8] @ Switch stack pointers - STR r3, [r2] @ Setup time-slice -@ -@ /* Switch to the thread's stack. */ -@ sp = _tx_thread_execute_ptr -> tx_thread_stack_ptr; -@ + + /* Setup the current thread pointer. */ + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread + STR r0, [r1] // Setup current thread pointer + + /* Increment the run count for this thread. */ + + LDR r2, [r0, #4] // Pickup run counter + LDR r3, [r0, #24] // Pickup time-slice for this thread + ADD r2, r2, #1 // Increment thread run-counter + STR r2, [r0, #4] // Store the new run counter + + /* Setup time-slice, if present. */ + + LDR r2, =_tx_timer_time_slice // Pickup address of time-slice + // variable + LDR sp, [r0, #8] // Switch stack pointers + STR r3, [r2] // Setup time-slice + #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the thread entry function to indicate the thread is executing. */ -@ - MOV r5, r0 @ Save r0 - BL _tx_execution_thread_enter @ Call the thread execution enter function - MOV r0, r5 @ Restore r0 + + /* Call the thread entry function to indicate the thread is executing. */ + + MOV r5, r0 // Save r0 + BL _tx_execution_thread_enter // Call the thread execution enter function + MOV r0, r5 // Restore r0 #endif -@ -@ /* Determine if an interrupt frame or a synchronous task suspension frame -@ is present. */ -@ - LDMIA sp!, {r4, r5} @ Pickup the stack type and saved CPSR - CMP r4, #0 @ Check for synchronous context switch + + /* Determine if an interrupt frame or a synchronous task suspension frame + is present. */ + + LDMIA sp!, {r4, r5} // Pickup the stack type and saved CPSR + CMP r4, #0 // Check for synchronous context switch BEQ _tx_solicited_return - MSR SPSR_cxsf, r5 @ Setup SPSR for return + MSR SPSR_cxsf, r5 // Setup SPSR for return #ifdef TX_ENABLE_VFP_SUPPORT - LDR r1, [r0, #144] @ Pickup the VFP enabled flag - CMP r1, #0 @ Is the VFP enabled? - BEQ _tx_skip_interrupt_vfp_restore @ No, skip VFP interrupt restore - VLDMIA sp!, {D0-D15} @ Recover D0-D15 - VLDMIA sp!, {D16-D31} @ Recover D16-D31 - LDR r4, [sp], #4 @ Pickup FPSCR - VMSR FPSCR, r4 @ Restore FPSCR + LDR r1, [r0, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_interrupt_vfp_restore // No, skip VFP interrupt restore + VLDMIA sp!, {D0-D15} // Recover D0-D15 + VLDMIA sp!, {D16-D31} // Recover D16-D31 + LDR r4, [sp], #4 // Pickup FPSCR + VMSR FPSCR, r4 // Restore FPSCR _tx_skip_interrupt_vfp_restore: #endif - LDMIA sp!, {r0-r12, lr, pc}^ @ Return to point of thread interrupt + LDMIA sp!, {r0-r12, lr, pc}^ // Return to point of thread interrupt _tx_solicited_return: #ifdef TX_ENABLE_VFP_SUPPORT - LDR r1, [r0, #144] @ Pickup the VFP enabled flag - CMP r1, #0 @ Is the VFP enabled? - BEQ _tx_skip_solicited_vfp_restore @ No, skip VFP solicited restore - VLDMIA sp!, {D8-D15} @ Recover D8-D15 - VLDMIA sp!, {D16-D31} @ Recover D16-D31 - LDR r4, [sp], #4 @ Pickup FPSCR - VMSR FPSCR, r4 @ Restore FPSCR + LDR r1, [r0, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_solicited_vfp_restore // No, skip VFP solicited restore + VLDMIA sp!, {D8-D15} // Recover D8-D15 + VLDMIA sp!, {D16-D31} // Recover D16-D31 + LDR r4, [sp], #4 // Pickup FPSCR + VMSR FPSCR, r4 // Restore FPSCR _tx_skip_solicited_vfp_restore: #endif - MSR CPSR_cxsf, r5 @ Recover CPSR - LDMIA sp!, {r4-r11, lr} @ Return to thread synchronously + MSR CPSR_cxsf, r5 // Recover CPSR + LDMIA sp!, {r4-r11, lr} // Return to thread synchronously #ifdef __THUMB_INTERWORK - BX lr @ Return to caller + BX lr // Return to caller #else - MOV pc, lr @ Return to caller + MOV pc, lr // Return to caller #endif -@ -@} -@ #ifdef TX_ENABLE_VFP_SUPPORT .global tx_thread_vfp_enable .type tx_thread_vfp_enable,function tx_thread_vfp_enable: - MRS r2, CPSR @ Pickup the CPSR + MRS r2, CPSR // Pickup the CPSR #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Enable IRQ and FIQ interrupts + CPSID if // Enable IRQ and FIQ interrupts #else - CPSID i @ Enable IRQ interrupts + CPSID i // Enable IRQ interrupts #endif - LDR r0, =_tx_thread_current_ptr @ Build current thread pointer address - LDR r1, [r0] @ Pickup current thread pointer - CMP r1, #0 @ Check for NULL thread pointer - BEQ __tx_no_thread_to_enable @ If NULL, skip VFP enable - MOV r0, #1 @ Build enable value - STR r0, [r1, #144] @ Set the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) + LDR r0, =_tx_thread_current_ptr // Build current thread pointer address + LDR r1, [r0] // Pickup current thread pointer + CMP r1, #0 // Check for NULL thread pointer + BEQ __tx_no_thread_to_enable // If NULL, skip VFP enable + MOV r0, #1 // Build enable value + STR r0, [r1, #144] // Set the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) __tx_no_thread_to_enable: - MSR CPSR_cxsf, r2 @ Recover CPSR - BX LR @ Return to caller + MSR CPSR_cxsf, r2 // Recover CPSR + BX LR // Return to caller .global tx_thread_vfp_disable .type tx_thread_vfp_disable,function tx_thread_vfp_disable: - MRS r2, CPSR @ Pickup the CPSR + MRS r2, CPSR // Pickup the CPSR #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Enable IRQ and FIQ interrupts + CPSID if // Enable IRQ and FIQ interrupts #else - CPSID i @ Enable IRQ interrupts + CPSID i // Enable IRQ interrupts #endif - LDR r0, =_tx_thread_current_ptr @ Build current thread pointer address - LDR r1, [r0] @ Pickup current thread pointer - CMP r1, #0 @ Check for NULL thread pointer - BEQ __tx_no_thread_to_disable @ If NULL, skip VFP disable - MOV r0, #0 @ Build disable value - STR r0, [r1, #144] @ Clear the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) + LDR r0, =_tx_thread_current_ptr // Build current thread pointer address + LDR r1, [r0] // Pickup current thread pointer + CMP r1, #0 // Check for NULL thread pointer + BEQ __tx_no_thread_to_disable // If NULL, skip VFP disable + MOV r0, #0 // Build disable value + STR r0, [r1, #144] // Clear the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) __tx_no_thread_to_disable: - MSR CPSR_cxsf, r2 @ Recover CPSR - BX LR @ Return to caller + MSR CPSR_cxsf, r2 // Recover CPSR + BX LR // Return to caller #endif - diff --git a/ports/cortex_a8/ac6/src/tx_thread_stack_build.S b/ports/cortex_a8/ac6/src/tx_thread_stack_build.S index 506a0e3d..f413e673 100644 --- a/ports/cortex_a8/ac6/src/tx_thread_stack_build.S +++ b/ports/cortex_a8/ac6/src/tx_thread_stack_build.S @@ -1,178 +1,164 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ .arm -SVC_MODE = 0x13 @ SVC mode +SVC_MODE = 0x13 // SVC mode #ifdef TX_ENABLE_FIQ_SUPPORT -CPSR_MASK = 0xDF @ Mask initial CPSR, IRQ & FIQ interrupts enabled +CPSR_MASK = 0xDF // Mask initial CPSR, IRQ & FIQ interrupts enabled #else -CPSR_MASK = 0x9F @ Mask initial CPSR, IRQ interrupts enabled +CPSR_MASK = 0x9F // Mask initial CPSR, IRQ interrupts enabled #endif -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_stack_build for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_stack_build for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .thumb .global $_tx_thread_stack_build .type $_tx_thread_stack_build,function $_tx_thread_stack_build: - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_stack_build @ Call _tx_thread_stack_build function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_stack_build // Call _tx_thread_stack_build function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_stack_build Cortex-A8/AC6 */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function builds a stack frame on the supplied thread's stack. */ -@/* The stack frame results in a fake interrupt return to the supplied */ -@/* function pointer. */ -@/* */ -@/* INPUT */ -@/* */ -@/* thread_ptr Pointer to thread control blk */ -@/* function_ptr Pointer to return function */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* _tx_thread_create Create thread service */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_stack_build(TX_THREAD *thread_ptr, VOID (*function_ptr)(VOID)) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_stack_build ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function builds a stack frame on the supplied thread's stack. */ +/* The stack frame results in a fake interrupt return to the supplied */ +/* function pointer. */ +/* */ +/* INPUT */ +/* */ +/* thread_ptr Pointer to thread control blk */ +/* function_ptr Pointer to return function */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_thread_create Create thread service */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_stack_build .type _tx_thread_stack_build,function _tx_thread_stack_build: -@ -@ -@ /* Build a fake interrupt frame. The form of the fake interrupt stack -@ on the Cortex-A8 should look like the following after it is built: -@ -@ Stack Top: 1 Interrupt stack frame type -@ CPSR Initial value for CPSR -@ a1 (r0) Initial value for a1 -@ a2 (r1) Initial value for a2 -@ a3 (r2) Initial value for a3 -@ a4 (r3) Initial value for a4 -@ v1 (r4) Initial value for v1 -@ v2 (r5) Initial value for v2 -@ v3 (r6) Initial value for v3 -@ v4 (r7) Initial value for v4 -@ v5 (r8) Initial value for v5 -@ sb (r9) Initial value for sb -@ sl (r10) Initial value for sl -@ fp (r11) Initial value for fp -@ ip (r12) Initial value for ip -@ lr (r14) Initial value for lr -@ pc (r15) Initial value for pc -@ 0 For stack backtracing -@ -@ Stack Bottom: (higher memory address) */ -@ - LDR r2, [r0, #16] @ Pickup end of stack area - BIC r2, r2, #7 @ Ensure 8-byte alignment - SUB r2, r2, #76 @ Allocate space for the stack frame -@ -@ /* Actually build the stack frame. */ -@ - MOV r3, #1 @ Build interrupt stack type - STR r3, [r2, #0] @ Store stack type - MOV r3, #0 @ Build initial register value - STR r3, [r2, #8] @ Store initial r0 - STR r3, [r2, #12] @ Store initial r1 - STR r3, [r2, #16] @ Store initial r2 - STR r3, [r2, #20] @ Store initial r3 - STR r3, [r2, #24] @ Store initial r4 - STR r3, [r2, #28] @ Store initial r5 - STR r3, [r2, #32] @ Store initial r6 - STR r3, [r2, #36] @ Store initial r7 - STR r3, [r2, #40] @ Store initial r8 - STR r3, [r2, #44] @ Store initial r9 - LDR r3, [r0, #12] @ Pickup stack starting address - STR r3, [r2, #48] @ Store initial r10 (sl) - LDR r3,=_tx_thread_schedule @ Pickup address of _tx_thread_schedule for GDB backtrace - STR r3, [r2, #60] @ Store initial r14 (lr) - MOV r3, #0 @ Build initial register value - STR r3, [r2, #52] @ Store initial r11 - STR r3, [r2, #56] @ Store initial r12 - STR r1, [r2, #64] @ Store initial pc - STR r3, [r2, #68] @ 0 for back-trace - MRS r1, CPSR @ Pickup CPSR - BIC r1, r1, #CPSR_MASK @ Mask mode bits of CPSR - ORR r3, r1, #SVC_MODE @ Build CPSR, SVC mode, interrupts enabled - STR r3, [r2, #4] @ Store initial CPSR -@ -@ /* Setup stack pointer. */ -@ thread_ptr -> tx_thread_stack_ptr = r2; -@ - STR r2, [r0, #8] @ Save stack pointer in thread's - @ control block + + + /* Build a fake interrupt frame. The form of the fake interrupt stack + on the ARMv7-A should look like the following after it is built: + + Stack Top: 1 Interrupt stack frame type + CPSR Initial value for CPSR + a1 (r0) Initial value for a1 + a2 (r1) Initial value for a2 + a3 (r2) Initial value for a3 + a4 (r3) Initial value for a4 + v1 (r4) Initial value for v1 + v2 (r5) Initial value for v2 + v3 (r6) Initial value for v3 + v4 (r7) Initial value for v4 + v5 (r8) Initial value for v5 + sb (r9) Initial value for sb + sl (r10) Initial value for sl + fp (r11) Initial value for fp + ip (r12) Initial value for ip + lr (r14) Initial value for lr + pc (r15) Initial value for + 0 For stack backtracing + + Stack Bottom: (higher memory address) */ + + LDR r2, [r0, #16] // Pickup end of stack area + BIC r2, r2, #7 // Ensure 8-byte alignment + SUB r2, r2, #76 // Allocate space for the stack frame + + /* Actually build the stack frame. */ + + MOV r3, #1 // Build interrupt stack type + STR r3, [r2, #0] // Store stack type + MOV r3, #0 // Build initial register value + STR r3, [r2, #8] // Store initial r0 + STR r3, [r2, #12] // Store initial r1 + STR r3, [r2, #16] // Store initial r2 + STR r3, [r2, #20] // Store initial r3 + STR r3, [r2, #24] // Store initial r4 + STR r3, [r2, #28] // Store initial r5 + STR r3, [r2, #32] // Store initial r6 + STR r3, [r2, #36] // Store initial r7 + STR r3, [r2, #40] // Store initial r8 + STR r3, [r2, #44] // Store initial r9 + LDR r3, [r0, #12] // Pickup stack starting address + STR r3, [r2, #48] // Store initial r10 (sl) + LDR r3,=_tx_thread_schedule // Pickup address of _tx_thread_schedule for GDB backtrace + STR r3, [r2, #60] // Store initial r14 (lr) + MOV r3, #0 // Build initial register value + STR r3, [r2, #52] // Store initial r11 + STR r3, [r2, #56] // Store initial r12 + STR r1, [r2, #64] // Store initial pc + STR r3, [r2, #68] // 0 for back-trace + MRS r1, CPSR // Pickup CPSR + BIC r1, r1, #CPSR_MASK // Mask mode bits of CPSR + ORR r3, r1, #SVC_MODE // Build CPSR, SVC mode, interrupts enabled + STR r3, [r2, #4] // Store initial CPSR + + /* Setup stack pointer. */ + + STR r2, [r0, #8] // Save stack pointer in thread's + // control block #ifdef __THUMB_INTERWORK - BX lr @ Return to caller + BX lr // Return to caller #else - MOV pc, lr @ Return to caller + MOV pc, lr // Return to caller #endif -@} - - diff --git a/ports/cortex_a8/ac6/src/tx_thread_system_return.S b/ports/cortex_a8/ac6/src/tx_thread_system_return.S index 4c925246..cb7d62ce 100644 --- a/ports/cortex_a8/ac6/src/tx_thread_system_return.S +++ b/ports/cortex_a8/ac6/src/tx_thread_system_return.S @@ -1,182 +1,162 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .arm -@ -@ + + .global _tx_thread_current_ptr .global _tx_timer_time_slice .global _tx_thread_schedule -@ -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_system_return for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_system_return for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_system_return .type $_tx_thread_system_return,function $_tx_thread_system_return: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_system_return @ Call _tx_thread_system_return function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_system_return // Call _tx_thread_system_return function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_system_return Cortex-A8/AC6 */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is target processor specific. It is used to transfer */ -@/* control from a thread back to the ThreadX system. Only a */ -@/* minimal context is saved since the compiler assumes temp registers */ -@/* are going to get slicked by a function call anyway. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* _tx_thread_schedule Thread scheduling loop */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ThreadX components */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_system_return(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_system_return ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is target processor specific. It is used to transfer */ +/* control from a thread back to the ThreadX system. Only a */ +/* minimal context is saved since the compiler assumes temp registers */ +/* are going to get slicked by a function call anyway. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling loop */ +/* */ +/* CALLED BY */ +/* */ +/* ThreadX components */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_system_return .type _tx_thread_system_return,function _tx_thread_system_return: -@ -@ /* Save minimal context on the stack. */ -@ - STMDB sp!, {r4-r11, lr} @ Save minimal context - LDR r4, =_tx_thread_current_ptr @ Pickup address of current ptr - LDR r5, [r4] @ Pickup current thread pointer - + /* Save minimal context on the stack. */ + + STMDB sp!, {r4-r11, lr} // Save minimal context + + LDR r4, =_tx_thread_current_ptr // Pickup address of current ptr + LDR r5, [r4] // Pickup current thread pointer + #ifdef TX_ENABLE_VFP_SUPPORT - LDR r1, [r5, #144] @ Pickup the VFP enabled flag - CMP r1, #0 @ Is the VFP enabled? - BEQ _tx_skip_solicited_vfp_save @ No, skip VFP solicited save - VMRS r1, FPSCR @ Pickup the FPSCR - STR r1, [sp, #-4]! @ Save FPSCR - VSTMDB sp!, {D16-D31} @ Save D16-D31 - VSTMDB sp!, {D8-D15} @ Save D8-D15 + LDR r1, [r5, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_solicited_vfp_save // No, skip VFP solicited save + VMRS r1, FPSCR // Pickup the FPSCR + STR r1, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D8-D15} // Save D8-D15 _tx_skip_solicited_vfp_save: #endif - MOV r0, #0 @ Build a solicited stack type - MRS r1, CPSR @ Pickup the CPSR - STMDB sp!, {r0-r1} @ Save type and CPSR -@ -@ /* Lockout interrupts. */ -@ -#ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ interrupts -#else - CPSID i @ Disable IRQ interrupts -#endif - -#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the thread exit function to indicate the thread is no longer executing. */ -@ - BL _tx_execution_thread_exit @ Call the thread exit function -#endif - MOV r3, r4 @ Pickup address of current ptr - MOV r0, r5 @ Pickup current thread pointer - LDR r2, =_tx_timer_time_slice @ Pickup address of time slice - LDR r1, [r2] @ Pickup current time slice -@ -@ /* Save current stack and switch to system stack. */ -@ _tx_thread_current_ptr -> tx_thread_stack_ptr = sp; -@ sp = _tx_thread_system_stack_ptr; -@ - STR sp, [r0, #8] @ Save thread stack pointer -@ -@ /* Determine if the time-slice is active. */ -@ if (_tx_timer_time_slice) -@ { -@ - MOV r4, #0 @ Build clear value - CMP r1, #0 @ Is a time-slice active? - BEQ __tx_thread_dont_save_ts @ No, don't save the time-slice -@ -@ /* Save time-slice for the thread and clear the current time-slice. */ -@ _tx_thread_current_ptr -> tx_thread_time_slice = _tx_timer_time_slice; -@ _tx_timer_time_slice = 0; -@ - STR r4, [r2] @ Clear time-slice - STR r1, [r0, #24] @ Save current time-slice -@ -@ } -__tx_thread_dont_save_ts: -@ -@ /* Clear the current thread pointer. */ -@ _tx_thread_current_ptr = TX_NULL; -@ - STR r4, [r3] @ Clear current thread pointer - B _tx_thread_schedule @ Jump to scheduler! -@ -@} + MOV r0, #0 // Build a solicited stack type + MRS r1, CPSR // Pickup the CPSR + STMDB sp!, {r0-r1} // Save type and CPSR + /* Lockout interrupts. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Disable IRQ and FIQ interrupts +#else + CPSID i // Disable IRQ interrupts +#endif + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the thread exit function to indicate the thread is no longer executing. */ + + BL _tx_execution_thread_exit // Call the thread exit function +#endif + MOV r3, r4 // Pickup address of current ptr + MOV r0, r5 // Pickup current thread pointer + LDR r2, =_tx_timer_time_slice // Pickup address of time slice + LDR r1, [r2] // Pickup current time slice + + /* Save current stack and switch to system stack. */ + + STR sp, [r0, #8] // Save thread stack pointer + + /* Determine if the time-slice is active. */ + + MOV r4, #0 // Build clear value + CMP r1, #0 // Is a time-slice active? + BEQ __tx_thread_dont_save_ts // No, don't save the time-slice + + /* Save time-slice for the thread and clear the current time-slice. */ + + STR r4, [r2] // Clear time-slice + STR r1, [r0, #24] // Save current time-slice + +__tx_thread_dont_save_ts: + + /* Clear the current thread pointer. */ + + STR r4, [r3] // Clear current thread pointer + B _tx_thread_schedule // Jump to scheduler! diff --git a/ports/cortex_a8/ac6/src/tx_thread_vectored_context_save.S b/ports/cortex_a8/ac6/src/tx_thread_vectored_context_save.S index a149643b..d846223f 100644 --- a/ports/cortex_a8/ac6/src/tx_thread_vectored_context_save.S +++ b/ports/cortex_a8/ac6/src/tx_thread_vectored_context_save.S @@ -1,192 +1,165 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .global _tx_thread_system_state .global _tx_thread_current_ptr -@ -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_vectored_context_save -@ since it will never be called 16-bit mode. */ -@ + .global _tx_execution_isr_enter + + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_vectored_context_save + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_vectored_context_save Cortex-A8/AC6 */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function saves the context of an executing thread in the */ -@/* beginning of interrupt processing. The function also ensures that */ -@/* the system stack is used upon return to the calling ISR. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_vectored_context_save(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_vectored_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_vectored_context_save .type _tx_thread_vectored_context_save,function _tx_thread_vectored_context_save: -@ -@ /* Upon entry to this routine, it is assumed that IRQ interrupts are locked -@ out, we are in IRQ mode, and all registers are intact. */ -@ -@ /* Check for a nested interrupt condition. */ -@ if (_tx_thread_system_state++) -@ { -@ + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ interrupts + CPSID if // Disable IRQ and FIQ interrupts #endif - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3, #0] @ Pickup system state - CMP r2, #0 @ Is this the first interrupt? - BEQ __tx_thread_not_nested_save @ Yes, not a nested context save -@ -@ /* Nested interrupt condition. */ -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3, #0] @ Store it back in the variable -@ -@ /* Note: Minimal context of interrupted thread is already saved. */ -@ -@ /* Return to the ISR. */ -@ - MOV r10, #0 @ Clear stack limit + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3, #0] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3, #0] // Store it back in the variable + + /* Note: Minimal context of interrupted thread is already saved. */ + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - MOV pc, lr @ Return to caller -@ + MOV pc, lr // Return to caller + __tx_thread_not_nested_save: -@ } -@ -@ /* Otherwise, not nested, check to see if a thread was running. */ -@ else if (_tx_thread_current_ptr) -@ { -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3, #0] @ Store it back in the variable - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1, #0] @ Pickup current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_idle_system_save @ If so, interrupt occurred in - @ scheduling loop - nothing needs saving! -@ -@ /* Note: Minimal context of interrupted thread is already saved. */ -@ -@ /* Save the current stack pointer in the thread's control block. */ -@ _tx_thread_current_ptr -> tx_thread_stack_ptr = sp; -@ -@ /* Switch to the system stack. */ -@ sp = _tx_thread_system_stack_ptr; -@ - MOV r10, #0 @ Clear stack limit + + /* Otherwise, not nested, check to see if a thread was running. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3, #0] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1, #0] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + /* Note: Minimal context of interrupted thread is already saved. */ + + /* Save the current stack pointer in the thread's control block. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - MOV pc, lr @ Return to caller -@ -@ } -@ else -@ { -@ + MOV pc, lr // Return to caller + __tx_thread_idle_system_save: -@ -@ /* Interrupt occurred in the scheduling loop. */ -@ -@ /* Not much to do here, just adjust the stack pointer, and return to IRQ -@ processing. */ -@ - MOV r10, #0 @ Clear stack limit + + /* Interrupt occurred in the scheduling loop. */ + + /* Not much to do here, just adjust the stack pointer, and return to IRQ + processing. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - ADD sp, sp, #32 @ Recover saved registers - MOV pc, lr @ Return to caller -@ -@ } -@} - + ADD sp, sp, #32 // Recover saved registers + MOV pc, lr // Return to caller diff --git a/ports/cortex_a8/ac6/src/tx_timer_interrupt.S b/ports/cortex_a8/ac6/src/tx_timer_interrupt.S index 9529953d..7337ed0c 100644 --- a/ports/cortex_a8/ac6/src/tx_timer_interrupt.S +++ b/ports/cortex_a8/ac6/src/tx_timer_interrupt.S @@ -1,40 +1,30 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Timer */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_timer.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Timer */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .arm -@ -@/* Define Assembly language external references... */ -@ + +/* Define Assembly language external references... */ + .global _tx_timer_time_slice .global _tx_timer_system_clock .global _tx_timer_current_ptr @@ -43,237 +33,199 @@ .global _tx_timer_expired_time_slice .global _tx_timer_expired .global _tx_thread_time_slice -@ -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_timer_interrupt for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + + + +/* Define the 16-bit Thumb mode veneer for _tx_timer_interrupt for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .thumb .global $_tx_timer_interrupt .type $_tx_timer_interrupt,function $_tx_timer_interrupt: - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_timer_interrupt @ Call _tx_timer_interrupt function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_timer_interrupt // Call _tx_timer_interrupt function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_timer_interrupt Cortex-A8/AC6 */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function processes the hardware timer interrupt. This */ -@/* processing includes incrementing the system clock and checking for */ -@/* time slice and/or timer expiration. If either is found, the */ -@/* interrupt context save/restore functions are called along with the */ -@/* expiration functions. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* _tx_thread_time_slice Time slice interrupted thread */ -@/* _tx_timer_expiration_process Timer expiration processing */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* interrupt vector */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_timer_interrupt(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_timer_interrupt ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function processes the hardware timer interrupt. This */ +/* processing includes incrementing the system clock and checking for */ +/* time slice and/or timer expiration. If either is found, the */ +/* interrupt context save/restore functions are called along with the */ +/* expiration functions. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_time_slice Time slice interrupted thread */ +/* _tx_timer_expiration_process Timer expiration processing */ +/* */ +/* CALLED BY */ +/* */ +/* interrupt vector */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_timer_interrupt .type _tx_timer_interrupt,function _tx_timer_interrupt: -@ -@ /* Upon entry to this routine, it is assumed that context save has already -@ been called, and therefore the compiler scratch registers are available -@ for use. */ -@ -@ /* Increment the system clock. */ -@ _tx_timer_system_clock++; -@ - LDR r1, =_tx_timer_system_clock @ Pickup address of system clock - LDR r0, [r1] @ Pickup system clock - ADD r0, r0, #1 @ Increment system clock - STR r0, [r1] @ Store new system clock -@ -@ /* Test for time-slice expiration. */ -@ if (_tx_timer_time_slice) -@ { -@ - LDR r3, =_tx_timer_time_slice @ Pickup address of time-slice - LDR r2, [r3] @ Pickup time-slice - CMP r2, #0 @ Is it non-active? - BEQ __tx_timer_no_time_slice @ Yes, skip time-slice processing -@ -@ /* Decrement the time_slice. */ -@ _tx_timer_time_slice--; -@ - SUB r2, r2, #1 @ Decrement the time-slice - STR r2, [r3] @ Store new time-slice value -@ -@ /* Check for expiration. */ -@ if (__tx_timer_time_slice == 0) -@ - CMP r2, #0 @ Has it expired? - BNE __tx_timer_no_time_slice @ No, skip expiration processing -@ -@ /* Set the time-slice expired flag. */ -@ _tx_timer_expired_time_slice = TX_TRUE; -@ - LDR r3, =_tx_timer_expired_time_slice @ Pickup address of expired flag - MOV r0, #1 @ Build expired value - STR r0, [r3] @ Set time-slice expiration flag -@ -@ } -@ -__tx_timer_no_time_slice: -@ -@ /* Test for timer expiration. */ -@ if (*_tx_timer_current_ptr) -@ { -@ - LDR r1, =_tx_timer_current_ptr @ Pickup current timer pointer address - LDR r0, [r1] @ Pickup current timer - LDR r2, [r0] @ Pickup timer list entry - CMP r2, #0 @ Is there anything in the list? - BEQ __tx_timer_no_timer @ No, just increment the timer -@ -@ /* Set expiration flag. */ -@ _tx_timer_expired = TX_TRUE; -@ - LDR r3, =_tx_timer_expired @ Pickup expiration flag address - MOV r2, #1 @ Build expired value - STR r2, [r3] @ Set expired flag - B __tx_timer_done @ Finished timer processing -@ -@ } -@ else -@ { -__tx_timer_no_timer: -@ -@ /* No timer expired, increment the timer pointer. */ -@ _tx_timer_current_ptr++; -@ - ADD r0, r0, #4 @ Move to next timer -@ -@ /* Check for wraparound. */ -@ if (_tx_timer_current_ptr == _tx_timer_list_end) -@ - LDR r3, =_tx_timer_list_end @ Pickup address of timer list end - LDR r2, [r3] @ Pickup list end - CMP r0, r2 @ Are we at list end? - BNE __tx_timer_skip_wrap @ No, skip wraparound logic -@ -@ /* Wrap to beginning of list. */ -@ _tx_timer_current_ptr = _tx_timer_list_start; -@ - LDR r3, =_tx_timer_list_start @ Pickup address of timer list start - LDR r0, [r3] @ Set current pointer to list start -@ -__tx_timer_skip_wrap: -@ - STR r0, [r1] @ Store new current timer pointer -@ } -@ -__tx_timer_done: -@ -@ -@ /* See if anything has expired. */ -@ if ((_tx_timer_expired_time_slice) || (_tx_timer_expired)) -@ { -@ - LDR r3, =_tx_timer_expired_time_slice @ Pickup address of expired flag - LDR r2, [r3] @ Pickup time-slice expired flag - CMP r2, #0 @ Did a time-slice expire? - BNE __tx_something_expired @ If non-zero, time-slice expired - LDR r1, =_tx_timer_expired @ Pickup address of other expired flag - LDR r0, [r1] @ Pickup timer expired flag - CMP r0, #0 @ Did a timer expire? - BEQ __tx_timer_nothing_expired @ No, nothing expired -@ -__tx_something_expired: -@ -@ - STMDB sp!, {r0, lr} @ Save the lr register on the stack - @ and save r0 just to keep 8-byte alignment -@ -@ /* Did a timer expire? */ -@ if (_tx_timer_expired) -@ { -@ - LDR r1, =_tx_timer_expired @ Pickup address of expired flag - LDR r0, [r1] @ Pickup timer expired flag - CMP r0, #0 @ Check for timer expiration - BEQ __tx_timer_dont_activate @ If not set, skip timer activation -@ -@ /* Process timer expiration. */ -@ _tx_timer_expiration_process(); -@ - BL _tx_timer_expiration_process @ Call the timer expiration handling routine -@ -@ } -__tx_timer_dont_activate: -@ -@ /* Did time slice expire? */ -@ if (_tx_timer_expired_time_slice) -@ { -@ - LDR r3, =_tx_timer_expired_time_slice @ Pickup address of time-slice expired - LDR r2, [r3] @ Pickup the actual flag - CMP r2, #0 @ See if the flag is set - BEQ __tx_timer_not_ts_expiration @ No, skip time-slice processing -@ -@ /* Time slice interrupted thread. */ -@ _tx_thread_time_slice(); -@ - BL _tx_thread_time_slice @ Call time-slice processing -@ -@ } -@ -__tx_timer_not_ts_expiration: -@ - LDMIA sp!, {r0, lr} @ Recover lr register (r0 is just there for - @ the 8-byte stack alignment -@ -@ } -@ -__tx_timer_nothing_expired: -@ -#ifdef __THUMB_INTERWORK - BX lr @ Return to caller -#else - MOV pc, lr @ Return to caller -#endif -@ -@} + /* Upon entry to this routine, it is assumed that context save has already + been called, and therefore the compiler scratch registers are available + for use. */ + + /* Increment the system clock. */ + + LDR r1, =_tx_timer_system_clock // Pickup address of system clock + LDR r0, [r1] // Pickup system clock + ADD r0, r0, #1 // Increment system clock + STR r0, [r1] // Store new system clock + + /* Test for time-slice expiration. */ + + LDR r3, =_tx_timer_time_slice // Pickup address of time-slice + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it non-active? + BEQ __tx_timer_no_time_slice // Yes, skip time-slice processing + + /* Decrement the time_slice. */ + + SUB r2, r2, #1 // Decrement the time-slice + STR r2, [r3] // Store new time-slice value + + /* Check for expiration. */ + + CMP r2, #0 // Has it expired? + BNE __tx_timer_no_time_slice // No, skip expiration processing + + /* Set the time-slice expired flag. */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of expired flag + MOV r0, #1 // Build expired value + STR r0, [r3] // Set time-slice expiration flag + +__tx_timer_no_time_slice: + + /* Test for timer expiration. */ + + LDR r1, =_tx_timer_current_ptr // Pickup current timer pointer address + LDR r0, [r1] // Pickup current timer + LDR r2, [r0] // Pickup timer list entry + CMP r2, #0 // Is there anything in the list? + BEQ __tx_timer_no_timer // No, just increment the timer + + /* Set expiration flag. */ + + LDR r3, =_tx_timer_expired // Pickup expiration flag address + MOV r2, #1 // Build expired value + STR r2, [r3] // Set expired flag + B __tx_timer_done // Finished timer processing + +__tx_timer_no_timer: + + /* No timer expired, increment the timer pointer. */ + ADD r0, r0, #4 // Move to next timer + + /* Check for wraparound. */ + + LDR r3, =_tx_timer_list_end // Pickup address of timer list end + LDR r2, [r3] // Pickup list end + CMP r0, r2 // Are we at list end? + BNE __tx_timer_skip_wrap // No, skip wraparound logic + + /* Wrap to beginning of list. */ + + LDR r3, =_tx_timer_list_start // Pickup address of timer list start + LDR r0, [r3] // Set current pointer to list start + +__tx_timer_skip_wrap: + + STR r0, [r1] // Store new current timer pointer + +__tx_timer_done: + + /* See if anything has expired. */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of expired flag + LDR r2, [r3] // Pickup time-slice expired flag + CMP r2, #0 // Did a time-slice expire? + BNE __tx_something_expired // If non-zero, time-slice expired + LDR r1, =_tx_timer_expired // Pickup address of other expired flag + LDR r0, [r1] // Pickup timer expired flag + CMP r0, #0 // Did a timer expire? + BEQ __tx_timer_nothing_expired // No, nothing expired + +__tx_something_expired: + + STMDB sp!, {r0, lr} // Save the lr register on the stack + // and save r0 just to keep 8-byte alignment + + /* Did a timer expire? */ + + LDR r1, =_tx_timer_expired // Pickup address of expired flag + LDR r0, [r1] // Pickup timer expired flag + CMP r0, #0 // Check for timer expiration + BEQ __tx_timer_dont_activate // If not set, skip timer activation + + /* Process timer expiration. */ + BL _tx_timer_expiration_process // Call the timer expiration handling routine + +__tx_timer_dont_activate: + + /* Did time slice expire? */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of time-slice expired + LDR r2, [r3] // Pickup the actual flag + CMP r2, #0 // See if the flag is set + BEQ __tx_timer_not_ts_expiration // No, skip time-slice processing + + /* Time slice interrupted thread. */ + + BL _tx_thread_time_slice // Call time-slice processing + +__tx_timer_not_ts_expiration: + + LDMIA sp!, {r0, lr} // Recover lr register (r0 is just there for + // the 8-byte stack alignment + +__tx_timer_nothing_expired: + +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a8/gnu/example_build/build_threadx_sample.bat b/ports/cortex_a8/gnu/example_build/build_threadx_sample.bat index aa8c8006..725aeda9 100644 --- a/ports/cortex_a8/gnu/example_build/build_threadx_sample.bat +++ b/ports/cortex_a8/gnu/example_build/build_threadx_sample.bat @@ -2,5 +2,5 @@ arm-none-eabi-gcc -c -g -mcpu=cortex-a8 reset.S arm-none-eabi-gcc -c -g -mcpu=cortex-a8 crt0.S arm-none-eabi-gcc -c -g -mcpu=cortex-a8 tx_initialize_low_level.S arm-none-eabi-gcc -c -g -mcpu=cortex-a8 -I../../../../common/inc -I../inc sample_threadx.c -arm-none-eabi-ld -A cortex-a8 -T sample_threadx.ld reset.o crt0.o tx_initialize_low_level.o sample_threadx.o tx.a libc.a libgcc.a -o sample_threadx.out -M > sample_threadx.map +arm-none-eabi-gcc -g -mcpu=cortex-a8 -T sample_threadx.ld --specs=nosys.specs -o sample_threadx.out -Wl,-Map=sample_threadx.map tx_initialize_low_level.o sample_threadx.o tx.a diff --git a/ports/cortex_a8/gnu/example_build/crt0.S b/ports/cortex_a8/gnu/example_build/crt0.S index aa0f3239..56b6c958 100644 --- a/ports/cortex_a8/gnu/example_build/crt0.S +++ b/ports/cortex_a8/gnu/example_build/crt0.S @@ -26,13 +26,13 @@ _mainCRTStartup: mov a2, #0 /* Second arg: fill value */ mov fp, a2 /* Null frame pointer */ mov r7, a2 /* Null frame pointer for Thumb */ - - ldr a1, .LC1 /* First arg: start of memory block */ - ldr a3, .LC2 - sub a3, a3, a1 /* Third arg: length of block */ - - + ldr a1, .LC1 /* First arg: start of memory block */ + ldr a3, .LC2 + sub a3, a3, a1 /* Third arg: length of block */ + + + bl memset mov r0, #0 /* no arguments */ mov r1, #0 /* no argv either */ @@ -48,15 +48,15 @@ _mainCRTStartup: /* bl init */ mov r0, r4 mov r1, r5 -#endif +#endif bl main bl exit /* Should not return. */ - - /* For Thumb, constants must be after the code since only + + /* For Thumb, constants must be after the code since only positive offsets are supported for PC relative addresses. */ - + .align 0 .LC0: .LC1: diff --git a/ports/cortex_a8/gnu/example_build/reset.S b/ports/cortex_a8/gnu/example_build/reset.S index 856e31eb..597e9d9a 100644 --- a/ports/cortex_a8/gnu/example_build/reset.S +++ b/ports/cortex_a8/gnu/example_build/reset.S @@ -1,35 +1,24 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Initialize */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_initialize.h" -@#include "tx_thread.h" -@#include "tx_timer.h" +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Initialize */ +/** */ +/**************************************************************************/ +/**************************************************************************/ .arm @@ -41,36 +30,35 @@ .global __tx_reserved_handler .global __tx_irq_handler .global __tx_fiq_handler -@ -@ -@/* Define the vector area. This should be located or copied to 0. */ -@ + +/* Define the vector area. This should be located or copied to 0. */ + .text .global __vectors __vectors: - LDR pc, STARTUP @ Reset goes to startup function - LDR pc, UNDEFINED @ Undefined handler - LDR pc, SWI @ Software interrupt handler - LDR pc, PREFETCH @ Prefetch exception handler - LDR pc, ABORT @ Abort exception handler - LDR pc, RESERVED @ Reserved exception handler - LDR pc, IRQ @ IRQ interrupt handler - LDR pc, FIQ @ FIQ interrupt handler + LDR pc, STARTUP // Reset goes to startup function + LDR pc, UNDEFINED // Undefined handler + LDR pc, SWI // Software interrupt handler + LDR pc, PREFETCH // Prefetch exception handler + LDR pc, ABORT // Abort exception handler + LDR pc, RESERVED // Reserved exception handler + LDR pc, IRQ // IRQ interrupt handler + LDR pc, FIQ // FIQ interrupt handler STARTUP: - .word _start @ Reset goes to C startup function + .word _start // Reset goes to C startup function UNDEFINED: - .word __tx_undefined @ Undefined handler + .word __tx_undefined // Undefined handler SWI: - .word __tx_swi_interrupt @ Software interrupt handler + .word __tx_swi_interrupt // Software interrupt handler PREFETCH: - .word __tx_prefetch_handler @ Prefetch exception handler -ABORT: - .word __tx_abort_handler @ Abort exception handler -RESERVED: - .word __tx_reserved_handler @ Reserved exception handler -IRQ: - .word __tx_irq_handler @ IRQ interrupt handler + .word __tx_prefetch_handler // Prefetch exception handler +ABORT: + .word __tx_abort_handler // Abort exception handler +RESERVED: + .word __tx_reserved_handler // Reserved exception handler +IRQ: + .word __tx_irq_handler // IRQ interrupt handler FIQ: - .word __tx_fiq_handler @ FIQ interrupt handler + .word __tx_fiq_handler // FIQ interrupt handler diff --git a/ports/cortex_a8/gnu/example_build/sample_threadx.c b/ports/cortex_a8/gnu/example_build/sample_threadx.c index 418ec634..8c61de06 100644 --- a/ports/cortex_a8/gnu/example_build/sample_threadx.c +++ b/ports/cortex_a8/gnu/example_build/sample_threadx.c @@ -1,5 +1,5 @@ /* This is a small demo of the high-performance ThreadX kernel. It includes examples of eight - threads of different priorities, using a message queue, semaphore, mutex, event flags group, + threads of different priorities, using a message queue, semaphore, mutex, event flags group, byte pool, and block pool. */ #include "tx_api.h" @@ -80,42 +80,42 @@ CHAR *pointer = TX_NULL; tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); /* Create the main thread. */ - tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, 1, 1, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 1. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - /* Create threads 1 and 2. These threads pass information through a ThreadX + /* Create threads 1 and 2. These threads pass information through a ThreadX message queue. It is also interesting to note that these threads have a time slice. */ - tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, DEMO_STACK_SIZE, 16, 16, 4, TX_AUTO_START); /* Allocate the stack for thread 2. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, DEMO_STACK_SIZE, 16, 16, 4, TX_AUTO_START); /* Allocate the stack for thread 3. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - /* Create threads 3 and 4. These threads compete for a ThreadX counting semaphore. + /* Create threads 3 and 4. These threads compete for a ThreadX counting semaphore. An interesting thing here is that both threads share the same instruction area. */ - tx_thread_create(&thread_3, "thread 3", thread_3_and_4_entry, 3, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_3, "thread 3", thread_3_and_4_entry, 3, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 4. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - tx_thread_create(&thread_4, "thread 4", thread_3_and_4_entry, 4, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_4, "thread 4", thread_3_and_4_entry, 4, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 5. */ @@ -123,23 +123,23 @@ CHAR *pointer = TX_NULL; /* Create thread 5. This thread simply pends on an event flag which will be set by thread_0. */ - tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, + pointer, DEMO_STACK_SIZE, 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 6. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); /* Create threads 6 and 7. These threads compete for a ThreadX mutex. */ - tx_thread_create(&thread_6, "thread 6", thread_6_and_7_entry, 6, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_6, "thread 6", thread_6_and_7_entry, 6, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 7. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - tx_thread_create(&thread_7, "thread 7", thread_6_and_7_entry, 7, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_7, "thread 7", thread_6_and_7_entry, 7, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the message queue. */ @@ -242,11 +242,11 @@ UINT status; /* Retrieve a message from the queue. */ status = tx_queue_receive(&queue_0, &received_message, TX_WAIT_FOREVER); - /* Check completion status and make sure the message is what we + /* Check completion status and make sure the message is what we expected. */ if ((status != TX_SUCCESS) || (received_message != thread_2_messages_received)) break; - + /* Otherwise, all is okay. Increment the received message count. */ thread_2_messages_received++; } @@ -305,7 +305,7 @@ ULONG actual_flags; thread_5_counter++; /* Wait for event flag 0. */ - status = tx_event_flags_get(&event_flags_0, 0x1, TX_OR_CLEAR, + status = tx_event_flags_get(&event_flags_0, 0x1, TX_OR_CLEAR, &actual_flags, TX_WAIT_FOREVER); /* Check status. */ @@ -358,7 +358,7 @@ UINT status; if (status != TX_SUCCESS) break; - /* Release the mutex again. This will actually + /* Release the mutex again. This will actually release ownership since it was obtained twice. */ status = tx_mutex_put(&mutex_0); diff --git a/ports/cortex_a8/gnu/example_build/tx_initialize_low_level.S b/ports/cortex_a8/gnu/example_build/tx_initialize_low_level.S index 82bf7825..7de5d3ce 100644 --- a/ports/cortex_a8/gnu/example_build/tx_initialize_low_level.S +++ b/ports/cortex_a8/gnu/example_build/tx_initialize_low_level.S @@ -1,47 +1,35 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Initialize */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_initialize.h" -@#include "tx_thread.h" -@#include "tx_timer.h" +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Initialize */ +/** */ +/**************************************************************************/ +/**************************************************************************/ .arm -SVC_MODE = 0xD3 @ Disable IRQ/FIQ SVC mode -IRQ_MODE = 0xD2 @ Disable IRQ/FIQ IRQ mode -FIQ_MODE = 0xD1 @ Disable IRQ/FIQ FIQ mode -SYS_MODE = 0xDF @ Disable IRQ/FIQ SYS mode -FIQ_STACK_SIZE = 512 @ FIQ stack size -IRQ_STACK_SIZE = 1024 @ IRQ stack size -SYS_STACK_SIZE = 1024 @ System stack size -@ -@ +SVC_MODE = 0xD3 // Disable IRQ/FIQ SVC mode +IRQ_MODE = 0xD2 // Disable IRQ/FIQ IRQ mode +FIQ_MODE = 0xD1 // Disable IRQ/FIQ FIQ mode +SYS_MODE = 0xDF // Disable IRQ/FIQ SYS mode +FIQ_STACK_SIZE = 512 // FIQ stack size +IRQ_STACK_SIZE = 1024 // IRQ stack size +SYS_STACK_SIZE = 1024 // System stack size + .global _tx_thread_system_stack_ptr .global _tx_initialize_unused_memory .global _tx_thread_context_save @@ -51,297 +39,267 @@ SYS_STACK_SIZE = 1024 @ System stack size .global _sp .global _stack_bottom -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_initialize_low_level for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + +/* Define the 16-bit Thumb mode veneer for _tx_initialize_low_level for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .thumb .global $_tx_initialize_low_level .type $_tx_initialize_low_level,function $_tx_initialize_low_level: - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_initialize_low_level @ Call _tx_initialize_low_level function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_initialize_low_level // Call _tx_initialize_low_level function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_initialize_low_level Cortex-A8/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is responsible for any low-level processor */ -@/* initialization, including setting up interrupt vectors, setting */ -@/* up a periodic timer interrupt source, saving the system stack */ -@/* pointer for use in ISR processing later, and finding the first */ -@/* available RAM memory address for tx_application_define. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* _tx_initialize_kernel_enter ThreadX entry function */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_initialize_low_level(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_initialize_low_level ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for any low-level processor */ +/* initialization, including setting up interrupt vectors, setting */ +/* up a periodic timer interrupt source, saving the system stack */ +/* pointer for use in ISR processing later, and finding the first */ +/* available RAM memory address for tx_application_define. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_initialize_kernel_enter ThreadX entry function */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_initialize_low_level .type _tx_initialize_low_level,function _tx_initialize_low_level: -@ -@ /* We must be in SVC mode at this point! */ -@ -@ /* Setup various stack pointers. */ -@ - LDR r1, =_sp @ Get pointer to stack area -#ifdef TX_ENABLE_IRQ_NESTING -@ -@ /* Setup the system mode stack for nested interrupt support */ -@ - LDR r2, =SYS_STACK_SIZE @ Pickup stack size - MOV r3, #SYS_MODE @ Build SYS mode CPSR - MSR CPSR_c, r3 @ Enter SYS mode - SUB r1, r1, #1 @ Backup 1 byte - BIC r1, r1, #7 @ Ensure 8-byte alignment - MOV sp, r1 @ Setup SYS stack pointer - SUB r1, r1, r2 @ Calculate start of next stack + /* We must be in SVC mode at this point! */ + + /* Setup various stack pointers. */ + + LDR r1, =_sp // Get pointer to stack area + +#ifdef TX_ENABLE_IRQ_NESTING + + /* Setup the system mode stack for nested interrupt support */ + + LDR r2, =SYS_STACK_SIZE // Pickup stack size + MOV r3, #SYS_MODE // Build SYS mode CPSR + MSR CPSR_c, r3 // Enter SYS mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup SYS stack pointer + SUB r1, r1, r2 // Calculate start of next stack #endif - LDR r2, =FIQ_STACK_SIZE @ Pickup stack size - MOV r0, #FIQ_MODE @ Build FIQ mode CPSR - MSR CPSR, r0 @ Enter FIQ mode - SUB r1, r1, #1 @ Backup 1 byte - BIC r1, r1, #7 @ Ensure 8-byte alignment - MOV sp, r1 @ Setup FIQ stack pointer - SUB r1, r1, r2 @ Calculate start of next stack - LDR r2, =IRQ_STACK_SIZE @ Pickup IRQ stack size - MOV r0, #IRQ_MODE @ Build IRQ mode CPSR - MSR CPSR, r0 @ Enter IRQ mode - SUB r1, r1, #1 @ Backup 1 byte - BIC r1, r1, #7 @ Ensure 8-byte alignment - MOV sp, r1 @ Setup IRQ stack pointer - SUB r3, r1, r2 @ Calculate end of IRQ stack - MOV r0, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR, r0 @ Enter SVC mode - LDR r2, =_stack_bottom @ Pickup stack bottom - CMP r3, r2 @ Compare the current stack end with the bottom -_stack_error_loop: - BLT _stack_error_loop @ If the IRQ stack exceeds the stack bottom, just sit here! -@ -@ /* Save the system stack pointer. */ -@ _tx_thread_system_stack_ptr = (VOID_PTR) (sp); -@ - LDR r2, =_tx_thread_system_stack_ptr @ Pickup stack pointer - STR r1, [r2] @ Save the system stack -@ -@ /* Save the first available memory address. */ -@ _tx_initialize_unused_memory = (VOID_PTR) _end; -@ - LDR r1, =_end @ Get end of non-initialized RAM area - LDR r2, =_tx_initialize_unused_memory @ Pickup unused memory ptr address - ADD r1, r1, #8 @ Increment to next free word - STR r1, [r2] @ Save first free memory address -@ -@ /* Setup Timer for periodic interrupts. */ -@ -@ /* Done, return to caller. */ -@ + LDR r2, =FIQ_STACK_SIZE // Pickup stack size + MOV r0, #FIQ_MODE // Build FIQ mode CPSR + MSR CPSR, r0 // Enter FIQ mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup FIQ stack pointer + SUB r1, r1, r2 // Calculate start of next stack + LDR r2, =IRQ_STACK_SIZE // Pickup IRQ stack size + MOV r0, #IRQ_MODE // Build IRQ mode CPSR + MSR CPSR, r0 // Enter IRQ mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup IRQ stack pointer + SUB r3, r1, r2 // Calculate end of IRQ stack + MOV r0, #SVC_MODE // Build SVC mode CPSR + MSR CPSR, r0 // Enter SVC mode + LDR r2, =_stack_bottom // Pickup stack bottom + CMP r3, r2 // Compare the current stack end with the bottom +_stack_error_loop: + BLT _stack_error_loop // If the IRQ stack exceeds the stack bottom, just sit here! + + LDR r2, =_tx_thread_system_stack_ptr // Pickup stack pointer + STR r1, [r2] // Save the system stack + + LDR r1, =_end // Get end of non-initialized RAM area + LDR r2, =_tx_initialize_unused_memory // Pickup unused memory ptr address + ADD r1, r1, #8 // Increment to next free word + STR r1, [r2] // Save first free memory address + #ifdef __THUMB_INTERWORK - BX lr @ Return to caller + BX lr // Return to caller #else - MOV pc, lr @ Return to caller + MOV pc, lr // Return to caller #endif -@} -@ -@ -@/* Define shells for each of the interrupt vectors. */ -@ + +/* Define shells for each of the interrupt vectors. */ + .global __tx_undefined __tx_undefined: - B __tx_undefined @ Undefined handler -@ + B __tx_undefined // Undefined handler + .global __tx_swi_interrupt __tx_swi_interrupt: - B __tx_swi_interrupt @ Software interrupt handler -@ + B __tx_swi_interrupt // Software interrupt handler + .global __tx_prefetch_handler __tx_prefetch_handler: - B __tx_prefetch_handler @ Prefetch exception handler -@ + B __tx_prefetch_handler // Prefetch exception handler + .global __tx_abort_handler __tx_abort_handler: - B __tx_abort_handler @ Abort exception handler -@ + B __tx_abort_handler // Abort exception handler + .global __tx_reserved_handler __tx_reserved_handler: - B __tx_reserved_handler @ Reserved exception handler -@ + B __tx_reserved_handler // Reserved exception handler + .global __tx_irq_handler - .global __tx_irq_processing_return + .global __tx_irq_processing_return __tx_irq_handler: -@ -@ /* Jump to context save to save system context. */ + + /* Jump to context save to save system context. */ B _tx_thread_context_save __tx_irq_processing_return: -@ -@ /* At this point execution is still in the IRQ mode. The CPSR, point of -@ interrupt, and all C scratch registers are available for use. In -@ addition, IRQ interrupts may be re-enabled - with certain restrictions - -@ if nested IRQ interrupts are desired. Interrupts may be re-enabled over -@ small code sequences where lr is saved before enabling interrupts and -@ restored after interrupts are again disabled. */ -@ -@ /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start -@ from IRQ mode with interrupts disabled. This routine switches to the -@ system mode and returns with IRQ interrupts enabled. -@ -@ NOTE: It is very important to ensure all IRQ interrupts are cleared -@ prior to enabling nested IRQ interrupts. */ +// + /* At this point execution is still in the IRQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. In + addition, IRQ interrupts may be re-enabled - with certain restrictions - + if nested IRQ interrupts are desired. Interrupts may be re-enabled over + small code sequences where lr is saved before enabling interrupts and + restored after interrupts are again disabled. */ + + /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start + from IRQ mode with interrupts disabled. This routine switches to the + system mode and returns with IRQ interrupts enabled. + + NOTE: It is very important to ensure all IRQ interrupts are cleared + prior to enabling nested IRQ interrupts. */ #ifdef TX_ENABLE_IRQ_NESTING BL _tx_thread_irq_nesting_start #endif -@ -@ /* For debug purpose, execute the timer interrupt processing here. In -@ a real system, some kind of status indication would have to be checked -@ before the timer interrupt handler could be called. */ -@ - BL _tx_timer_interrupt @ Timer interrupt handler -@ -@ -@ /* If interrupt nesting was started earlier, the end of interrupt nesting -@ service must be called before returning to _tx_thread_context_restore. -@ This routine returns in processing in IRQ mode with interrupts disabled. */ + + /* For debug purpose, execute the timer interrupt processing here. In + a real system, some kind of status indication would have to be checked + before the timer interrupt handler could be called. */ + + BL _tx_timer_interrupt // Timer interrupt handler + + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_context_restore. + This routine returns in processing in IRQ mode with interrupts disabled. */ #ifdef TX_ENABLE_IRQ_NESTING BL _tx_thread_irq_nesting_end #endif -@ -@ /* Jump to context restore to restore system context. */ + + /* Jump to context restore to restore system context. */ B _tx_thread_context_restore -@ -@ -@ /* This is an example of a vectored IRQ handler. */ -@ -@ .global __tx_example_vectored_irq_handler -@__tx_example_vectored_irq_handler: -@ -@ -@ /* Save initial context and call context save to prepare for -@ vectored ISR execution. */ -@ -@ STMDB sp!, {r0-r3} @ Save some scratch registers -@ MRS r0, SPSR @ Pickup saved SPSR -@ SUB lr, lr, #4 @ Adjust point of interrupt -@ STMDB sp!, {r0, r10, r12, lr} @ Store other scratch registers -@ BL _tx_thread_vectored_context_save @ Vectored context save -@ -@ /* At this point execution is still in the IRQ mode. The CPSR, point of -@ interrupt, and all C scratch registers are available for use. In -@ addition, IRQ interrupts may be re-enabled - with certain restrictions - -@ if nested IRQ interrupts are desired. Interrupts may be re-enabled over -@ small code sequences where lr is saved before enabling interrupts and -@ restored after interrupts are again disabled. */ -@ -@ -@ /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start -@ from IRQ mode with interrupts disabled. This routine switches to the -@ system mode and returns with IRQ interrupts enabled. -@ -@ NOTE: It is very important to ensure all IRQ interrupts are cleared -@ prior to enabling nested IRQ interrupts. */ -@#ifdef TX_ENABLE_IRQ_NESTING -@ BL _tx_thread_irq_nesting_start -@#endif -@ -@ /* Application IRQ handlers can be called here! */ -@ -@ /* If interrupt nesting was started earlier, the end of interrupt nesting -@ service must be called before returning to _tx_thread_context_restore. -@ This routine returns in processing in IRQ mode with interrupts disabled. */ -@#ifdef TX_ENABLE_IRQ_NESTING -@ BL _tx_thread_irq_nesting_end -@#endif -@ -@ /* Jump to context restore to restore system context. */ -@ B _tx_thread_context_restore -@ -@ + + + /* This is an example of a vectored IRQ handler. */ + + + + /* Save initial context and call context save to prepare for + vectored ISR execution. */ + + /* At this point execution is still in the IRQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. In + addition, IRQ interrupts may be re-enabled - with certain restrictions - + if nested IRQ interrupts are desired. Interrupts may be re-enabled over + small code sequences where lr is saved before enabling interrupts and + restored after interrupts are again disabled. */ + + + /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start + from IRQ mode with interrupts disabled. This routine switches to the + system mode and returns with IRQ interrupts enabled. + + NOTE: It is very important to ensure all IRQ interrupts are cleared + prior to enabling nested IRQ interrupts. */ + + /* Application IRQ handlers can be called here! */ + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_context_restore. + This routine returns in processing in IRQ mode with interrupts disabled. */ + + + #ifdef TX_ENABLE_FIQ_SUPPORT .global __tx_fiq_handler .global __tx_fiq_processing_return __tx_fiq_handler: -@ -@ /* Jump to fiq context save to save system context. */ + + /* Jump to fiq context save to save system context. */ B _tx_thread_fiq_context_save __tx_fiq_processing_return: -@ -@ /* At this point execution is still in the FIQ mode. The CPSR, point of -@ interrupt, and all C scratch registers are available for use. */ -@ -@ /* Interrupt nesting is allowed after calling _tx_thread_fiq_nesting_start -@ from FIQ mode with interrupts disabled. This routine switches to the -@ system mode and returns with FIQ interrupts enabled. -@ -@ NOTE: It is very important to ensure all FIQ interrupts are cleared -@ prior to enabling nested FIQ interrupts. */ + + /* At this point execution is still in the FIQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. */ + + /* Interrupt nesting is allowed after calling _tx_thread_fiq_nesting_start + from FIQ mode with interrupts disabled. This routine switches to the + system mode and returns with FIQ interrupts enabled. + + NOTE: It is very important to ensure all FIQ interrupts are cleared + prior to enabling nested FIQ interrupts. */ #ifdef TX_ENABLE_FIQ_NESTING BL _tx_thread_fiq_nesting_start #endif -@ -@ /* Application FIQ handlers can be called here! */ -@ -@ /* If interrupt nesting was started earlier, the end of interrupt nesting -@ service must be called before returning to _tx_thread_fiq_context_restore. */ + + /* Application FIQ handlers can be called here! */ + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_fiq_context_restore. */ #ifdef TX_ENABLE_FIQ_NESTING BL _tx_thread_fiq_nesting_end #endif -@ -@ /* Jump to fiq context restore to restore system context. */ + + /* Jump to fiq context restore to restore system context. */ B _tx_thread_fiq_context_restore -@ -@ + + #else .global __tx_fiq_handler __tx_fiq_handler: - B __tx_fiq_handler @ FIQ interrupt handler + B __tx_fiq_handler // FIQ interrupt handler #endif -@ -@ + + BUILD_OPTIONS: - .word _tx_build_options @ Reference to bring in + .word _tx_build_options // Reference to bring in VERSION_ID: - .word _tx_version_id @ Reference to bring in + .word _tx_version_id // Reference to bring in diff --git a/ports/cortex_a8/gnu/inc/tx_port.h b/ports/cortex_a8/gnu/inc/tx_port.h index d721109b..19463de1 100644 --- a/ports/cortex_a8/gnu/inc/tx_port.h +++ b/ports/cortex_a8/gnu/inc/tx_port.h @@ -12,7 +12,7 @@ /**************************************************************************/ /**************************************************************************/ -/** */ +/** */ /** ThreadX Component */ /** */ /** Port Specific */ @@ -21,36 +21,38 @@ /**************************************************************************/ -/**************************************************************************/ -/* */ -/* PORT SPECIFIC C INFORMATION RELEASE */ -/* */ -/* tx_port.h Cortex-A8/GNU */ -/* 6.1.6 */ +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* tx_port.h ARMv7-A */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ /* */ /* DESCRIPTION */ -/* */ -/* This file contains data type definitions that make the ThreadX */ -/* real-time kernel function identically on a variety of different */ -/* processor architectures. For example, the size or number of bits */ -/* in an "int" data type vary between microprocessor architectures and */ -/* even C compilers for the same microprocessor. ThreadX does not */ -/* directly use native C data types. Instead, ThreadX creates its */ -/* own special types that can be mapped to actual data types by this */ -/* file to guarantee consistency in the interface and functionality. */ -/* */ -/* RELEASE HISTORY */ -/* */ +/* */ +/* This file contains data type definitions that make the ThreadX */ +/* real-time kernel function identically on a variety of different */ +/* processor architectures. For example, the size or number of bits */ +/* in an "int" data type vary between microprocessor architectures and */ +/* even C compilers for the same microprocessor. ThreadX does not */ +/* directly use native C data types. Instead, ThreadX creates its */ +/* own special types that can be mapped to actual data types by this */ +/* file to guarantee consistency in the interface and functionality. */ +/* */ +/* RELEASE HISTORY */ +/* */ /* DATE NAME DESCRIPTION */ /* */ /* 09-30-2020 William E. Lamie Initial Version 6.1 */ /* 04-02-2021 Bhupendra Naphade Modified comment(s),updated */ /* macro definition, */ /* resulting in version 6.1.6 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -63,7 +65,7 @@ #ifdef TX_INCLUDE_USER_DEFINE_FILE -/* Yes, include the user defines in tx_user.h. The defines in this file may +/* Yes, include the user defines in tx_user.h. The defines in this file may alternately be defined on the command line. */ #include "tx_user.h" @@ -76,7 +78,7 @@ #include -/* Define ThreadX basic types for this port. */ +/* Define ThreadX basic types for this port. */ #define VOID void typedef char CHAR; @@ -112,12 +114,12 @@ typedef unsigned short USHORT; #define TX_TIMER_THREAD_STACK_SIZE 1024 /* Default timer thread stack size */ #endif -#ifndef TX_TIMER_THREAD_PRIORITY -#define TX_TIMER_THREAD_PRIORITY 0 /* Default timer thread priority */ +#ifndef TX_TIMER_THREAD_PRIORITY +#define TX_TIMER_THREAD_PRIORITY 0 /* Default timer thread priority */ #endif -/* Define various constants for the ThreadX ARM port. */ +/* Define various constants for the ThreadX ARM port. */ #ifdef TX_ENABLE_FIQ_SUPPORT #define TX_INT_DISABLE 0xC0 /* Disable IRQ & FIQ interrupts */ @@ -127,8 +129,8 @@ typedef unsigned short USHORT; #define TX_INT_ENABLE 0x00 /* Enable IRQ interrupts */ -/* Define the clock source for trace event entry time stamp. The following two item are port specific. - For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock +/* Define the clock source for trace event entry time stamp. The following two item are port specific. + For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: #define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) @@ -175,7 +177,7 @@ typedef unsigned short USHORT; #define TX_INLINE_INITIALIZATION -/* Determine whether or not stack checking is enabled. By default, ThreadX stack checking is +/* Determine whether or not stack checking is enabled. By default, ThreadX stack checking is disabled. When the following is defined, ThreadX thread stack checking is enabled. If stack checking is enabled (TX_ENABLE_STACK_CHECKING is defined), the TX_DISABLE_STACK_FILLING define is negated, thereby forcing the stack fill which is necessary for the stack checking @@ -187,13 +189,13 @@ typedef unsigned short USHORT; /* Define the TX_THREAD control block extensions for this port. The main reason - for the multiple macros is so that backward compatibility can be maintained with + for the multiple macros is so that backward compatibility can be maintained with existing ThreadX kernel awareness modules. */ -#define TX_THREAD_EXTENSION_0 -#define TX_THREAD_EXTENSION_1 +#define TX_THREAD_EXTENSION_0 +#define TX_THREAD_EXTENSION_1 #define TX_THREAD_EXTENSION_2 ULONG tx_thread_vfp_enable; -#define TX_THREAD_EXTENSION_3 +#define TX_THREAD_EXTENSION_3 /* Define the port extensions of the remaining ThreadX objects. */ @@ -207,11 +209,11 @@ typedef unsigned short USHORT; #define TX_TIMER_EXTENSION -/* Define the user extension field of the thread control block. Nothing +/* Define the user extension field of the thread control block. Nothing additional is needed for this port so it is defined as white space. */ #ifndef TX_THREAD_USER_EXTENSION -#define TX_THREAD_USER_EXTENSION +#define TX_THREAD_USER_EXTENSION #endif @@ -219,8 +221,8 @@ typedef unsigned short USHORT; tx_thread_shell_entry, and tx_thread_terminate. */ -#define TX_THREAD_CREATE_EXTENSION(thread_ptr) -#define TX_THREAD_DELETE_EXTENSION(thread_ptr) +#define TX_THREAD_CREATE_EXTENSION(thread_ptr) +#define TX_THREAD_DELETE_EXTENSION(thread_ptr) #define TX_THREAD_COMPLETED_EXTENSION(thread_ptr) #define TX_THREAD_TERMINATED_EXTENSION(thread_ptr) @@ -247,24 +249,24 @@ typedef unsigned short USHORT; #define TX_TIMER_DELETE_EXTENSION(timer_ptr) -/* Determine if the ARM architecture has the CLZ instruction. This is available on - architectures v5 and above. If available, redefine the macro for calculating the +/* Determine if the ARM architecture has the CLZ instruction. This is available on + architectures v5 and above. If available, redefine the macro for calculating the lowest bit set. */ - + #if __TARGET_ARCH_ARM > 4 #ifndef __thumb__ #define TX_LOWEST_SET_BIT_CALCULATE(m, b) m = m & ((ULONG) (-((LONG) m))); \ asm volatile (" CLZ %0,%1 ": "=r" (b) : "r" (m) ); \ - b = 31 - b; + b = 31 - b; #endif #endif -/* Define ThreadX interrupt lockout and restore macros for protection on - access of critical kernel information. The restore interrupt macro must - restore the interrupt posture of the running thread prior to the value +/* Define ThreadX interrupt lockout and restore macros for protection on + access of critical kernel information. The restore interrupt macro must + restore the interrupt posture of the running thread prior to the value present prior to the disable macro. In most cases, the save area macro is used to define a local function save area for the disable and restore macros. */ @@ -295,7 +297,7 @@ unsigned int _tx_thread_interrupt_restore(UINT old_posture); #endif -/* Define VFP extension for the Cortex-A8. Each is assumed to be called in the context of the executing +/* Define VFP extension for the ARMv7-A. Each is assumed to be called in the context of the executing thread. */ void tx_thread_vfp_enable(void); @@ -315,8 +317,8 @@ void tx_thread_vfp_disable(void); /* Define the version ID of ThreadX. This may be utilized by the application. */ #ifdef TX_THREAD_INIT -CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-A8/GNU Version 6.1.9 *"; +CHAR _tx_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX ARMv7-A Version 6.1.11 *"; #else extern CHAR _tx_version_id[]; #endif diff --git a/ports/cortex_a8/gnu/src/tx_thread_context_restore.S b/ports/cortex_a8/gnu/src/tx_thread_context_restore.S index 685844fc..fae7e72d 100644 --- a/ports/cortex_a8/gnu/src/tx_thread_context_restore.S +++ b/ports/cortex_a8/gnu/src/tx_thread_context_restore.S @@ -1,260 +1,222 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .arm #ifdef TX_ENABLE_FIQ_SUPPORT -SVC_MODE = 0xD3 @ Disable IRQ/FIQ, SVC mode -IRQ_MODE = 0xD2 @ Disable IRQ/FIQ, IRQ mode +SVC_MODE = 0xD3 // Disable IRQ/FIQ, SVC mode +IRQ_MODE = 0xD2 // Disable IRQ/FIQ, IRQ mode #else -SVC_MODE = 0x93 @ Disable IRQ, SVC mode -IRQ_MODE = 0x92 @ Disable IRQ, IRQ mode +SVC_MODE = 0x93 // Disable IRQ, SVC mode +IRQ_MODE = 0x92 // Disable IRQ, IRQ mode #endif -@ + .global _tx_thread_system_state .global _tx_thread_current_ptr .global _tx_thread_execute_ptr .global _tx_timer_time_slice .global _tx_thread_schedule .global _tx_thread_preempt_disable - .global _tx_execution_isr_exit -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_restore -@ since it will never be called 16-bit mode. */ -@ + + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_restore + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_context_restore Cortex-A8/GNU */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function restores the interrupt context if it is processing a */ -@/* nested interrupt. If not, it returns to the interrupt thread if no */ -@/* preemption is necessary. Otherwise, if preemption is necessary or */ -@/* if no thread was running, the function returns to the scheduler. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* _tx_thread_schedule Thread scheduling routine */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs Interrupt Service Routines */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_context_restore(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_context_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function restores the interrupt context if it is processing a */ +/* nested interrupt. If not, it returns to the interrupt thread if no */ +/* preemption is necessary. Otherwise, if preemption is necessary or */ +/* if no thread was running, the function returns to the scheduler. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling routine */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs Interrupt Service Routines */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_context_restore .type _tx_thread_context_restore,function _tx_thread_context_restore: -@ -@ /* Lockout interrupts. */ -@ + + /* Lockout interrupts. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ interrupts + CPSID if // Disable IRQ and FIQ interrupts #else - CPSID i @ Disable IRQ interrupts + CPSID i // Disable IRQ interrupts #endif #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR exit function to indicate an ISR is complete. */ -@ - BL _tx_execution_isr_exit @ Call the ISR exit function -#endif -@ -@ /* Determine if interrupts are nested. */ -@ if (--_tx_thread_system_state) -@ { -@ - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3] @ Pickup system state - SUB r2, r2, #1 @ Decrement the counter - STR r2, [r3] @ Store the counter - CMP r2, #0 @ Was this the first interrupt? - BEQ __tx_thread_not_nested_restore @ If so, not a nested restore -@ -@ /* Interrupts are nested. */ -@ -@ /* Just recover the saved registers and return to the point of -@ interrupt. */ -@ - LDMIA sp!, {r0, r10, r12, lr} @ Recover SPSR, POI, and scratch regs - MSR SPSR_cxsf, r0 @ Put SPSR back - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOVS pc, lr @ Return to point of interrupt -@ -@ } -__tx_thread_not_nested_restore: -@ -@ /* Determine if a thread was interrupted and no preemption is required. */ -@ else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr) -@ || (_tx_thread_preempt_disable)) -@ { -@ - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup actual current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_idle_system_restore @ Yes, idle system was interrupted -@ - LDR r3, =_tx_thread_preempt_disable @ Pickup preempt disable address - LDR r2, [r3] @ Pickup actual preempt disable flag - CMP r2, #0 @ Is it set? - BNE __tx_thread_no_preempt_restore @ Yes, don't preempt this thread - LDR r3, =_tx_thread_execute_ptr @ Pickup address of execute thread ptr - LDR r2, [r3] @ Pickup actual execute thread pointer - CMP r0, r2 @ Is the same thread highest priority? - BNE __tx_thread_preempt_restore @ No, preemption needs to happen -@ -@ -__tx_thread_no_preempt_restore: -@ -@ /* Restore interrupted thread or ISR. */ -@ -@ /* Pickup the saved stack pointer. */ -@ tmp_ptr = _tx_thread_current_ptr -> tx_thread_stack_ptr; -@ -@ /* Recover the saved context and return to the point of interrupt. */ -@ - LDMIA sp!, {r0, r10, r12, lr} @ Recover SPSR, POI, and scratch regs - MSR SPSR_cxsf, r0 @ Put SPSR back - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOVS pc, lr @ Return to point of interrupt -@ -@ } -@ else -@ { -__tx_thread_preempt_restore: -@ - LDMIA sp!, {r3, r10, r12, lr} @ Recover temporarily saved registers - MOV r1, lr @ Save lr (point of interrupt) - MOV r2, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r2 @ Enter SVC mode - STR r1, [sp, #-4]! @ Save point of interrupt - STMDB sp!, {r4-r12, lr} @ Save upper half of registers - MOV r4, r3 @ Save SPSR in r4 - MOV r2, #IRQ_MODE @ Build IRQ mode CPSR - MSR CPSR_c, r2 @ Enter IRQ mode - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOV r5, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r5 @ Enter SVC mode - STMDB sp!, {r0-r3} @ Save r0-r3 on thread's stack - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup current thread pointer + /* Call the ISR exit function to indicate an ISR is complete. */ + + BL _tx_execution_isr_exit // Call the ISR exit function +#endif + + /* Determine if interrupts are nested. */ + + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + SUB r2, r2, #1 // Decrement the counter + STR r2, [r3] // Store the counter + CMP r2, #0 // Was this the first interrupt? + BEQ __tx_thread_not_nested_restore // If so, not a nested restore + + /* Interrupts are nested. */ + + /* Just recover the saved registers and return to the point of + interrupt. */ + + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_not_nested_restore: + + /* Determine if a thread was interrupted and no preemption is required. */ + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup actual current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_restore // Yes, idle system was interrupted + + LDR r3, =_tx_thread_preempt_disable // Pickup preempt disable address + LDR r2, [r3] // Pickup actual preempt disable flag + CMP r2, #0 // Is it set? + BNE __tx_thread_no_preempt_restore // Yes, don't preempt this thread + LDR r3, =_tx_thread_execute_ptr // Pickup address of execute thread ptr + LDR r2, [r3] // Pickup actual execute thread pointer + CMP r0, r2 // Is the same thread highest priority? + BNE __tx_thread_preempt_restore // No, preemption needs to happen + + +__tx_thread_no_preempt_restore: + + /* Recover the saved context and return to the point of interrupt. */ + + /* Pickup the saved stack pointer. */ + + /* Recover the saved context and return to the point of interrupt. */ + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_preempt_restore: + + LDMIA sp!, {r3, r10, r12, lr} // Recover temporarily saved registers + MOV r1, lr // Save lr (point of interrupt) + MOV r2, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r2 // Enter SVC mode + STR r1, [sp, #-4]! // Save point of interrupt + STMDB sp!, {r4-r12, lr} // Save upper half of registers + MOV r4, r3 // Save SPSR in r4 + MOV r2, #IRQ_MODE // Build IRQ mode CPSR + MSR CPSR_c, r2 // Enter IRQ mode + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOV r5, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r5 // Enter SVC mode + STMDB sp!, {r0-r3} // Save r0-r3 on thread's stack + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer #ifdef TX_ENABLE_VFP_SUPPORT - LDR r2, [r0, #144] @ Pickup the VFP enabled flag - CMP r2, #0 @ Is the VFP enabled? - BEQ _tx_skip_irq_vfp_save @ No, skip VFP IRQ save - VMRS r2, FPSCR @ Pickup the FPSCR - STR r2, [sp, #-4]! @ Save FPSCR - VSTMDB sp!, {D16-D31} @ Save D16-D31 - VSTMDB sp!, {D0-D15} @ Save D0-D15 + LDR r2, [r0, #144] // Pickup the VFP enabled flag + CMP r2, #0 // Is the VFP enabled? + BEQ _tx_skip_irq_vfp_save // No, skip VFP IRQ save + VMRS r2, FPSCR // Pickup the FPSCR + STR r2, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D0-D15} // Save D0-D15 + _tx_skip_irq_vfp_save: + #endif - MOV r3, #1 @ Build interrupt stack type - STMDB sp!, {r3, r4} @ Save interrupt stack type and SPSR - STR sp, [r0, #8] @ Save stack pointer in thread control - @ block -@ -@ /* Save the remaining time-slice and disable it. */ -@ if (_tx_timer_time_slice) -@ { -@ - LDR r3, =_tx_timer_time_slice @ Pickup time-slice variable address - LDR r2, [r3] @ Pickup time-slice - CMP r2, #0 @ Is it active? - BEQ __tx_thread_dont_save_ts @ No, don't save it -@ -@ _tx_thread_current_ptr -> tx_thread_time_slice = _tx_timer_time_slice; -@ _tx_timer_time_slice = 0; -@ - STR r2, [r0, #24] @ Save thread's time-slice - MOV r2, #0 @ Clear value - STR r2, [r3] @ Disable global time-slice flag -@ -@ } + MOV r3, #1 // Build interrupt stack type + STMDB sp!, {r3, r4} // Save interrupt stack type and SPSR + STR sp, [r0, #8] // Save stack pointer in thread control + // block + + /* Save the remaining time-slice and disable it. */ + LDR r3, =_tx_timer_time_slice // Pickup time-slice variable address + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it active? + BEQ __tx_thread_dont_save_ts // No, don't save it + STR r2, [r0, #24] // Save thread's time-slice + MOV r2, #0 // Clear value + STR r2, [r3] // Disable global time-slice flag + __tx_thread_dont_save_ts: -@ -@ -@ /* Clear the current task pointer. */ -@ _tx_thread_current_ptr = TX_NULL; -@ - MOV r0, #0 @ NULL value - STR r0, [r1] @ Clear current thread pointer -@ -@ /* Return to the scheduler. */ -@ _tx_thread_schedule(); -@ - B _tx_thread_schedule @ Return to scheduler -@ } -@ + + /* Clear the current task pointer. */ + MOV r0, #0 // NULL value + STR r0, [r1] // Clear current thread pointer + + /* Return to the scheduler. */ + B _tx_thread_schedule // Return to scheduler + __tx_thread_idle_system_restore: -@ -@ /* Just return back to the scheduler! */ -@ - MOV r0, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r0 @ Enter SVC mode - B _tx_thread_schedule @ Return to scheduler -@} - - + /* Just return back to the scheduler! */ + MOV r0, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r0 // Enter SVC mode + B _tx_thread_schedule // Return to scheduler diff --git a/ports/cortex_a8/gnu/src/tx_thread_context_save.S b/ports/cortex_a8/gnu/src/tx_thread_context_save.S index ed2232e9..7ac48c2e 100644 --- a/ports/cortex_a8/gnu/src/tx_thread_context_save.S +++ b/ports/cortex_a8/gnu/src/tx_thread_context_save.S @@ -1,206 +1,172 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .global _tx_thread_system_state .global _tx_thread_current_ptr - .global _tx_irq_processing_return - .global _tx_execution_isr_enter -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_save -@ since it will never be called 16-bit mode. */ -@ + .global __tx_irq_processing_return + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_save + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_context_save Cortex-A8/GNU */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function saves the context of an executing thread in the */ -@/* beginning of interrupt processing. The function also ensures that */ -@/* the system stack is used upon return to the calling ISR. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_context_save(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_context_save .type _tx_thread_context_save,function _tx_thread_context_save: -@ -@ /* Upon entry to this routine, it is assumed that IRQ interrupts are locked -@ out, we are in IRQ mode, and all registers are intact. */ -@ -@ /* Check for a nested interrupt condition. */ -@ if (_tx_thread_system_state++) -@ { -@ - STMDB sp!, {r0-r3} @ Save some working registers + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + + STMDB sp!, {r0-r3} // Save some working registers #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable FIQ interrupts + CPSID if // Disable FIQ interrupts #endif - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3] @ Pickup system state - CMP r2, #0 @ Is this the first interrupt? - BEQ __tx_thread_not_nested_save @ Yes, not a nested context save -@ -@ /* Nested interrupt condition. */ -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3] @ Store it back in the variable -@ -@ /* Save the rest of the scratch registers on the stack and return to the -@ calling ISR. */ -@ - MRS r0, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r0, r10, r12, lr} @ Store other registers -@ -@ /* Return to the ISR. */ -@ - MOV r10, #0 @ Clear stack limit + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + + /* Save the rest of the scratch registers on the stack and return to the + calling ISR. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, r10, r12, lr} // Store other registers + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - B __tx_irq_processing_return @ Continue IRQ processing -@ + B __tx_irq_processing_return // Continue IRQ processing + __tx_thread_not_nested_save: -@ } -@ -@ /* Otherwise, not nested, check to see if a thread was running. */ -@ else if (_tx_thread_current_ptr) -@ { -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3] @ Store it back in the variable - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_idle_system_save @ If so, interrupt occurred in - @ scheduling loop - nothing needs saving! -@ -@ /* Save minimal context of interrupted thread. */ -@ - MRS r2, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r2, r10, r12, lr} @ Store other registers -@ -@ /* Save the current stack pointer in the thread's control block. */ -@ _tx_thread_current_ptr -> tx_thread_stack_ptr = sp; -@ -@ /* Switch to the system stack. */ -@ sp = _tx_thread_system_stack_ptr@ -@ - MOV r10, #0 @ Clear stack limit + + /* Otherwise, not nested, check to see if a thread was running. */ + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + + /* Save minimal context of interrupted thread. */ + + MRS r2, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r2, r10, r12, lr} // Store other registers + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - B __tx_irq_processing_return @ Continue IRQ processing -@ -@ } -@ else -@ { -@ + B __tx_irq_processing_return // Continue IRQ processing + __tx_thread_idle_system_save: -@ -@ /* Interrupt occurred in the scheduling loop. */ -@ -@ /* Not much to do here, just adjust the stack pointer, and return to IRQ -@ processing. */ -@ - MOV r10, #0 @ Clear stack limit + + /* Interrupt occurred in the scheduling loop. */ + + /* Not much to do here, just adjust the stack pointer, and return to IRQ + processing. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - ADD sp, sp, #16 @ Recover saved registers - B __tx_irq_processing_return @ Continue IRQ processing -@ -@ } -@} - - - + ADD sp, sp, #16 // Recover saved registers + B __tx_irq_processing_return // Continue IRQ processing diff --git a/ports/cortex_a8/gnu/src/tx_thread_fiq_context_restore.S b/ports/cortex_a8/gnu/src/tx_thread_fiq_context_restore.S index 87488b7e..006be973 100644 --- a/ports/cortex_a8/gnu/src/tx_thread_fiq_context_restore.S +++ b/ports/cortex_a8/gnu/src/tx_thread_fiq_context_restore.S @@ -1,43 +1,32 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ -@ -SVC_MODE = 0xD3 @ SVC mode -FIQ_MODE = 0xD1 @ FIQ mode -MODE_MASK = 0x1F @ Mode mask -THUMB_MASK = 0x20 @ Thumb bit mask -IRQ_MODE_BITS = 0x12 @ IRQ mode bits -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +SVC_MODE = 0xD3 // SVC mode +FIQ_MODE = 0xD1 // FIQ mode +MODE_MASK = 0x1F // Mode mask +THUMB_MASK = 0x20 // Thumb bit mask +IRQ_MODE_BITS = 0x12 // IRQ mode bits + + .global _tx_thread_system_state .global _tx_thread_current_ptr .global _tx_thread_system_stack_ptr @@ -46,218 +35,189 @@ IRQ_MODE_BITS = 0x12 @ IRQ mode bits .global _tx_thread_schedule .global _tx_thread_preempt_disable .global _tx_execution_isr_exit -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_restore -@ since it will never be called 16-bit mode. */ -@ + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_restore + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_fiq_context_restore Cortex-A8/GNU */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function restores the fiq interrupt context when processing a */ -@/* nested interrupt. If not, it returns to the interrupt thread if no */ -@/* preemption is necessary. Otherwise, if preemption is necessary or */ -@/* if no thread was running, the function returns to the scheduler. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* _tx_thread_schedule Thread scheduling routine */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* FIQ ISR Interrupt Service Routines */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_fiq_context_restore(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_context_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function restores the fiq interrupt context when processing a */ +/* nested interrupt. If not, it returns to the interrupt thread if no */ +/* preemption is necessary. Otherwise, if preemption is necessary or */ +/* if no thread was running, the function returns to the scheduler. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling routine */ +/* */ +/* CALLED BY */ +/* */ +/* FIQ ISR Interrupt Service Routines */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_fiq_context_restore .type _tx_thread_fiq_context_restore,function _tx_thread_fiq_context_restore: -@ -@ /* Lockout interrupts. */ -@ - CPSID if @ Disable IRQ and FIQ interrupts + + /* Lockout interrupts. */ + + CPSID if // Disable IRQ and FIQ interrupts #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR exit function to indicate an ISR is complete. */ -@ - BL _tx_execution_isr_exit @ Call the ISR exit function + + /* Call the ISR exit function to indicate an ISR is complete. */ + + BL _tx_execution_isr_exit // Call the ISR exit function #endif -@ -@ /* Determine if interrupts are nested. */ -@ if (--_tx_thread_system_state) -@ { -@ - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3] @ Pickup system state - SUB r2, r2, #1 @ Decrement the counter - STR r2, [r3] @ Store the counter - CMP r2, #0 @ Was this the first interrupt? - BEQ __tx_thread_fiq_not_nested_restore @ If so, not a nested restore -@ -@ /* Interrupts are nested. */ -@ -@ /* Just recover the saved registers and return to the point of -@ interrupt. */ -@ - LDMIA sp!, {r0, r10, r12, lr} @ Recover SPSR, POI, and scratch regs - MSR SPSR_cxsf, r0 @ Put SPSR back - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOVS pc, lr @ Return to point of interrupt -@ -@ } + + /* Determine if interrupts are nested. */ + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + SUB r2, r2, #1 // Decrement the counter + STR r2, [r3] // Store the counter + CMP r2, #0 // Was this the first interrupt? + BEQ __tx_thread_fiq_not_nested_restore // If so, not a nested restore + + /* Interrupts are nested. */ + + /* Just recover the saved registers and return to the point of + interrupt. */ + + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + __tx_thread_fiq_not_nested_restore: -@ -@ /* Determine if a thread was interrupted and no preemption is required. */ -@ else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr) -@ || (_tx_thread_preempt_disable)) -@ { -@ - LDR r1, [sp] @ Pickup the saved SPSR - MOV r2, #MODE_MASK @ Build mask to isolate the interrupted mode - AND r1, r1, r2 @ Isolate mode bits - CMP r1, #IRQ_MODE_BITS @ Was an interrupt taken in IRQ mode before we - @ got to context save? */ - BEQ __tx_thread_fiq_no_preempt_restore @ Yes, just go back to point of interrupt + + /* Determine if a thread was interrupted and no preemption is required. */ + + LDR r1, [sp] // Pickup the saved SPSR + MOV r2, #MODE_MASK // Build mask to isolate the interrupted mode + AND r1, r1, r2 // Isolate mode bits + CMP r1, #IRQ_MODE_BITS // Was an interrupt taken in IRQ mode before we + // got to context save? */ + BEQ __tx_thread_fiq_no_preempt_restore // Yes, just go back to point of interrupt - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup actual current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_fiq_idle_system_restore @ Yes, idle system was interrupted + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup actual current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_fiq_idle_system_restore // Yes, idle system was interrupted - LDR r3, =_tx_thread_preempt_disable @ Pickup preempt disable address - LDR r2, [r3] @ Pickup actual preempt disable flag - CMP r2, #0 @ Is it set? - BNE __tx_thread_fiq_no_preempt_restore @ Yes, don't preempt this thread - LDR r3, =_tx_thread_execute_ptr @ Pickup address of execute thread ptr - LDR r2, [r3] @ Pickup actual execute thread pointer - CMP r0, r2 @ Is the same thread highest priority? - BNE __tx_thread_fiq_preempt_restore @ No, preemption needs to happen + LDR r3, =_tx_thread_preempt_disable // Pickup preempt disable address + LDR r2, [r3] // Pickup actual preempt disable flag + CMP r2, #0 // Is it set? + BNE __tx_thread_fiq_no_preempt_restore // Yes, don't preempt this thread + LDR r3, =_tx_thread_execute_ptr // Pickup address of execute thread ptr + LDR r2, [r3] // Pickup actual execute thread pointer + CMP r0, r2 // Is the same thread highest priority? + BNE __tx_thread_fiq_preempt_restore // No, preemption needs to happen __tx_thread_fiq_no_preempt_restore: -@ -@ /* Restore interrupted thread or ISR. */ -@ -@ /* Pickup the saved stack pointer. */ -@ tmp_ptr = _tx_thread_current_ptr -> tx_thread_stack_ptr; -@ -@ /* Recover the saved context and return to the point of interrupt. */ -@ - LDMIA sp!, {r0, lr} @ Recover SPSR, POI, and scratch regs - MSR SPSR_cxsf, r0 @ Put SPSR back - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOVS pc, lr @ Return to point of interrupt -@ -@ } -@ else -@ { -__tx_thread_fiq_preempt_restore: -@ - LDMIA sp!, {r3, lr} @ Recover temporarily saved registers - MOV r1, lr @ Save lr (point of interrupt) - MOV r2, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r2 @ Enter SVC mode - STR r1, [sp, #-4]! @ Save point of interrupt - STMDB sp!, {r4-r12, lr} @ Save upper half of registers - MOV r4, r3 @ Save SPSR in r4 - MOV r2, #FIQ_MODE @ Build FIQ mode CPSR - MSR CPSR_c, r2 @ Reenter FIQ mode - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOV r5, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r5 @ Enter SVC mode - STMDB sp!, {r0-r3} @ Save r0-r3 on thread's stack - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup current thread pointer + /* Restore interrupted thread or ISR. */ + /* Recover the saved context and return to the point of interrupt. */ + + LDMIA sp!, {r0, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_fiq_preempt_restore: + + LDMIA sp!, {r3, lr} // Recover temporarily saved registers + MOV r1, lr // Save lr (point of interrupt) + MOV r2, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r2 // Enter SVC mode + STR r1, [sp, #-4]! // Save point of interrupt + STMDB sp!, {r4-r12, lr} // Save upper half of registers + MOV r4, r3 // Save SPSR in r4 + MOV r2, #FIQ_MODE // Build FIQ mode CPSR + MSR CPSR_c, r2 // Reenter FIQ mode + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOV r5, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r5 // Enter SVC mode + STMDB sp!, {r0-r3} // Save r0-r3 on thread's stack + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer #ifdef TX_ENABLE_VFP_SUPPORT - LDR r2, [r0, #144] @ Pickup the VFP enabled flag - CMP r2, #0 @ Is the VFP enabled? - BEQ _tx_skip_fiq_vfp_save @ No, skip VFP IRQ save - VMRS r2, FPSCR @ Pickup the FPSCR - STR r2, [sp, #-4]! @ Save FPSCR - VSTMDB sp!, {D16-D31} @ Save D16-D31 - VSTMDB sp!, {D0-D15} @ Save D0-D15 + LDR r2, [r0, #144] // Pickup the VFP enabled flag + CMP r2, #0 // Is the VFP enabled? + BEQ _tx_skip_fiq_vfp_save // No, skip VFP IRQ save + VMRS r2, FPSCR // Pickup the FPSCR + STR r2, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D0-D15} // Save D0-D15 _tx_skip_fiq_vfp_save: #endif - MOV r3, #1 @ Build interrupt stack type - STMDB sp!, {r3, r4} @ Save interrupt stack type and SPSR - STR sp, [r0, #8] @ Save stack pointer in thread control - @ block */ -@ -@ /* Save the remaining time-slice and disable it. */ -@ if (_tx_timer_time_slice) -@ { -@ - LDR r3, =_tx_timer_time_slice @ Pickup time-slice variable address - LDR r2, [r3] @ Pickup time-slice - CMP r2, #0 @ Is it active? - BEQ __tx_thread_fiq_dont_save_ts @ No, don't save it -@ -@ _tx_thread_current_ptr -> tx_thread_time_slice = _tx_timer_time_slice; -@ _tx_timer_time_slice = 0; -@ - STR r2, [r0, #24] @ Save thread's time-slice - MOV r2, #0 @ Clear value - STR r2, [r3] @ Disable global time-slice flag -@ -@ } -__tx_thread_fiq_dont_save_ts: -@ -@ -@ /* Clear the current task pointer. */ -@ _tx_thread_current_ptr = TX_NULL; -@ - MOV r0, #0 @ NULL value - STR r0, [r1] @ Clear current thread pointer -@ -@ /* Return to the scheduler. */ -@ _tx_thread_schedule(); -@ - B _tx_thread_schedule @ Return to scheduler -@ } -@ -__tx_thread_fiq_idle_system_restore: -@ -@ /* Just return back to the scheduler! */ -@ - ADD sp, sp, #24 @ Recover FIQ stack space - MOV r3, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r3 @ Lockout interrupts - B _tx_thread_schedule @ Return to scheduler -@ -@} + MOV r3, #1 // Build interrupt stack type + STMDB sp!, {r3, r4} // Save interrupt stack type and SPSR + STR sp, [r0, #8] // Save stack pointer in thread control + // block */ + LDR r3, =_tx_timer_time_slice // Pickup time-slice variable address + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it active? + BEQ __tx_thread_fiq_dont_save_ts // No, don't save it + + STR r2, [r0, #24] // Save thread's time-slice + MOV r2, #0 // Clear value + STR r2, [r3] // Disable global time-slice flag + +__tx_thread_fiq_dont_save_ts: + + /* Clear the current task pointer. */ + + MOV r0, #0 // NULL value + STR r0, [r1] // Clear current thread pointer + + /* Return to the scheduler. */ + + B _tx_thread_schedule // Return to scheduler + +__tx_thread_fiq_idle_system_restore: + + /* Just return back to the scheduler! */ + + ADD sp, sp, #24 // Recover FIQ stack space + MOV r3, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r3 // Lockout interrupts + B _tx_thread_schedule // Return to scheduler diff --git a/ports/cortex_a8/gnu/src/tx_thread_fiq_context_save.S b/ports/cortex_a8/gnu/src/tx_thread_fiq_context_save.S index a0820138..7db6a4c2 100644 --- a/ports/cortex_a8/gnu/src/tx_thread_fiq_context_save.S +++ b/ports/cortex_a8/gnu/src/tx_thread_fiq_context_save.S @@ -1,207 +1,178 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .global _tx_thread_system_state .global _tx_thread_current_ptr .global __tx_fiq_processing_return .global _tx_execution_isr_enter -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_save -@ since it will never be called 16-bit mode. */ -@ + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_save + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_fiq_context_save Cortex-A8/GNU */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function saves the context of an executing thread in the */ -@/* beginning of interrupt processing. The function also ensures that */ -@/* the system stack is used upon return to the calling ISR. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@ VOID _tx_thread_fiq_context_save(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_fiq_context_save .type _tx_thread_fiq_context_save,function _tx_thread_fiq_context_save: -@ -@ /* Upon entry to this routine, it is assumed that IRQ interrupts are locked -@ out, we are in IRQ mode, and all registers are intact. */ -@ -@ /* Check for a nested interrupt condition. */ -@ if (_tx_thread_system_state++) -@ { -@ - STMDB sp!, {r0-r3} @ Save some working registers - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3] @ Pickup system state - CMP r2, #0 @ Is this the first interrupt? - BEQ __tx_thread_fiq_not_nested_save @ Yes, not a nested context save -@ -@ /* Nested interrupt condition. */ -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3] @ Store it back in the variable -@ -@ /* Save the rest of the scratch registers on the stack and return to the -@ calling ISR. */ -@ - MRS r0, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r0, r10, r12, lr} @ Store other registers -@ -@ /* Return to the ISR. */ -@ - MOV r10, #0 @ Clear stack limit + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + + STMDB sp!, {r0-r3} // Save some working registers + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_fiq_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + + /* Save the rest of the scratch registers on the stack and return to the + calling ISR. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, r10, r12, lr} // Store other registers + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - B __tx_fiq_processing_return @ Continue FIQ processing -@ + B __tx_fiq_processing_return // Continue FIQ processing +// __tx_thread_fiq_not_nested_save: -@ } -@ -@ /* Otherwise, not nested, check to see if a thread was running. */ -@ else if (_tx_thread_current_ptr) -@ { -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3] @ Store it back in the variable - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_fiq_idle_system_save @ If so, interrupt occurred in -@ @ scheduling loop - nothing needs saving! -@ -@ /* Save minimal context of interrupted thread. */ -@ - MRS r2, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r2, lr} @ Store other registers, Note that we don't -@ @ need to save sl and ip since FIQ has -@ @ copies of these registers. Nested -@ @ interrupt processing does need to save -@ @ these registers. -@ -@ /* Save the current stack pointer in the thread's control block. */ -@ _tx_thread_current_ptr -> tx_thread_stack_ptr = sp; -@ -@ /* Switch to the system stack. */ -@ sp = _tx_thread_system_stack_ptr; -@ - MOV r10, #0 @ Clear stack limit + + /* Otherwise, not nested, check to see if a thread was running. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_fiq_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + + /* Save minimal context of interrupted thread. */ + + MRS r2, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r2, lr} // Store other registers, Note that we don't + // need to save sl and ip since FIQ has + // copies of these registers. Nested + // interrupt processing does need to save + // these registers. + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - B __tx_fiq_processing_return @ Continue FIQ processing -@ -@ } -@ else -@ { -@ + B __tx_fiq_processing_return // Continue FIQ processing + __tx_thread_fiq_idle_system_save: -@ -@ /* Interrupt occurred in the scheduling loop. */ -@ -#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr -#endif -@ -@ /* Not much to do here, save the current SPSR and LR for possible -@ use in IRQ interrupted in idle system conditions, and return to -@ FIQ interrupt processing. */ -@ - MRS r0, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r0, lr} @ Store other registers that will get used -@ @ or stripped off the stack in context -@ @ restore - B __tx_fiq_processing_return @ Continue FIQ processing -@ -@ } -@} + /* Interrupt occurred in the scheduling loop. */ + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + /* Not much to do here, save the current SPSR and LR for possible + use in IRQ interrupted in idle system conditions, and return to + FIQ interrupt processing. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, lr} // Store other registers that will get used + // or stripped off the stack in context + // restore + B __tx_fiq_processing_return // Continue FIQ processing diff --git a/ports/cortex_a8/gnu/src/tx_thread_fiq_nesting_end.S b/ports/cortex_a8/gnu/src/tx_thread_fiq_nesting_end.S index 5667d51c..b34d881e 100644 --- a/ports/cortex_a8/gnu/src/tx_thread_fiq_nesting_end.S +++ b/ports/cortex_a8/gnu/src/tx_thread_fiq_nesting_end.S @@ -1,116 +1,104 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + #ifdef TX_ENABLE_FIQ_SUPPORT -DISABLE_INTS = 0xC0 @ Disable IRQ/FIQ interrupts +DISABLE_INTS = 0xC0 // Disable IRQ/FIQ interrupts #else -DISABLE_INTS = 0x80 @ Disable IRQ interrupts +DISABLE_INTS = 0x80 // Disable IRQ interrupts #endif -MODE_MASK = 0x1F @ Mode mask -FIQ_MODE_BITS = 0x11 @ FIQ mode bits -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_end -@ since it will never be called 16-bit mode. */ -@ +MODE_MASK = 0x1F // Mode mask +FIQ_MODE_BITS = 0x11 // FIQ mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_end + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_fiq_nesting_end Cortex-A8/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is called by the application from FIQ mode after */ -@/* _tx_thread_fiq_nesting_start has been called and switches the FIQ */ -@/* processing from system mode back to FIQ mode prior to the ISR */ -@/* calling _tx_thread_fiq_context_restore. Note that this function */ -@/* assumes the system stack pointer is in the same position after */ -@/* nesting start function was called. */ -@/* */ -@/* This function assumes that the system mode stack pointer was setup */ -@/* during low-level initialization (tx_initialize_low_level.s). */ -@/* */ -@/* This function returns with FIQ interrupts disabled. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_fiq_nesting_end(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_nesting_end ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from FIQ mode after */ +/* _tx_thread_fiq_nesting_start has been called and switches the FIQ */ +/* processing from system mode back to FIQ mode prior to the ISR */ +/* calling _tx_thread_fiq_context_restore. Note that this function */ +/* assumes the system stack pointer is in the same position after */ +/* nesting start function was called. */ +/* */ +/* This function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with FIQ interrupts disabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_fiq_nesting_end .type _tx_thread_fiq_nesting_end,function _tx_thread_fiq_nesting_end: - MOV r3,lr @ Save ISR return address - MRS r0, CPSR @ Pickup the CPSR - ORR r0, r0, #DISABLE_INTS @ Build disable interrupt value - MSR CPSR_c, r0 @ Disable interrupts - LDMIA sp!, {r1, lr} @ Pickup saved lr (and r1 throw-away for - @ 8-byte alignment logic) - BIC r0, r0, #MODE_MASK @ Clear mode bits - ORR r0, r0, #FIQ_MODE_BITS @ Build IRQ mode CPSR - MSR CPSR_c, r0 @ Reenter IRQ mode + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + ORR r0, r0, #DISABLE_INTS // Build disable interrupt value + MSR CPSR_c, r0 // Disable interrupts + LDMIA sp!, {r1, lr} // Pickup saved lr (and r1 throw-away for + // 8-byte alignment logic) + BIC r0, r0, #MODE_MASK // Clear mode bits + ORR r0, r0, #FIQ_MODE_BITS // Build IRQ mode CPSR + MSR CPSR_c, r0 // Reenter IRQ mode #ifdef __THUMB_INTERWORK - BX r3 @ Return to caller + BX r3 // Return to caller #else - MOV pc, r3 @ Return to caller + MOV pc, r3 // Return to caller #endif -@} - diff --git a/ports/cortex_a8/gnu/src/tx_thread_fiq_nesting_start.S b/ports/cortex_a8/gnu/src/tx_thread_fiq_nesting_start.S index ddda6089..c9cd5a06 100644 --- a/ports/cortex_a8/gnu/src/tx_thread_fiq_nesting_start.S +++ b/ports/cortex_a8/gnu/src/tx_thread_fiq_nesting_start.S @@ -1,108 +1,96 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ -FIQ_DISABLE = 0x40 @ FIQ disable bit -MODE_MASK = 0x1F @ Mode mask -SYS_MODE_BITS = 0x1F @ System mode bits -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_start -@ since it will never be called 16-bit mode. */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +FIQ_DISABLE = 0x40 // FIQ disable bit +MODE_MASK = 0x1F // Mode mask +SYS_MODE_BITS = 0x1F // System mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_start + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_fiq_nesting_start Cortex-A8/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is called by the application from FIQ mode after */ -@/* _tx_thread_fiq_context_save has been called and switches the FIQ */ -@/* processing to the system mode so nested FIQ interrupt processing */ -@/* is possible (system mode has its own "lr" register). Note that */ -@/* this function assumes that the system mode stack pointer was setup */ -@/* during low-level initialization (tx_initialize_low_level.s). */ -@/* */ -@/* This function returns with FIQ interrupts enabled. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_fiq_nesting_start(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_nesting_start ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from FIQ mode after */ +/* _tx_thread_fiq_context_save has been called and switches the FIQ */ +/* processing to the system mode so nested FIQ interrupt processing */ +/* is possible (system mode has its own "lr" register). Note that */ +/* this function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with FIQ interrupts enabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_fiq_nesting_start .type _tx_thread_fiq_nesting_start,function _tx_thread_fiq_nesting_start: - MOV r3,lr @ Save ISR return address - MRS r0, CPSR @ Pickup the CPSR - BIC r0, r0, #MODE_MASK @ Clear the mode bits - ORR r0, r0, #SYS_MODE_BITS @ Build system mode CPSR - MSR CPSR_c, r0 @ Enter system mode - STMDB sp!, {r1, lr} @ Push the system mode lr on the system mode stack - @ and push r1 just to keep 8-byte alignment - BIC r0, r0, #FIQ_DISABLE @ Build enable FIQ CPSR - MSR CPSR_c, r0 @ Enter system mode + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + BIC r0, r0, #MODE_MASK // Clear the mode bits + ORR r0, r0, #SYS_MODE_BITS // Build system mode CPSR + MSR CPSR_c, r0 // Enter system mode + STMDB sp!, {r1, lr} // Push the system mode lr on the system mode stack + // and push r1 just to keep 8-byte alignment + BIC r0, r0, #FIQ_DISABLE // Build enable FIQ CPSR + MSR CPSR_c, r0 // Enter system mode #ifdef __THUMB_INTERWORK - BX r3 @ Return to caller + BX r3 // Return to caller #else - MOV pc, r3 @ Return to caller + MOV pc, r3 // Return to caller #endif -@} - diff --git a/ports/cortex_a8/gnu/src/tx_thread_interrupt_control.S b/ports/cortex_a8/gnu/src/tx_thread_interrupt_control.S index 7f3c0f78..63b1609a 100644 --- a/ports/cortex_a8/gnu/src/tx_thread_interrupt_control.S +++ b/ports/cortex_a8/gnu/src/tx_thread_interrupt_control.S @@ -1,115 +1,104 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ INT_MASK = 0x03F -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_control for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_control for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_interrupt_control $_tx_thread_interrupt_control: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_interrupt_control @ Call _tx_thread_interrupt_control function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_control // Call _tx_thread_interrupt_control function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_interrupt_control Cortex-A8/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is responsible for changing the interrupt lockout */ -@/* posture of the system. */ -@/* */ -@/* INPUT */ -@/* */ -@/* new_posture New interrupt lockout posture */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* old_posture Old interrupt lockout posture */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* Application Code */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@UINT _tx_thread_interrupt_control(UINT new_posture) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_control ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for changing the interrupt lockout */ +/* posture of the system. */ +/* */ +/* INPUT */ +/* */ +/* new_posture New interrupt lockout posture */ +/* */ +/* OUTPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_interrupt_control .type _tx_thread_interrupt_control,function _tx_thread_interrupt_control: -@ -@ /* Pickup current interrupt lockout posture. */ -@ - MRS r3, CPSR @ Pickup current CPSR - MOV r2, #INT_MASK @ Build interrupt mask - AND r1, r3, r2 @ Clear interrupt lockout bits - ORR r1, r1, r0 @ Or-in new interrupt lockout bits -@ -@ /* Apply the new interrupt posture. */ -@ - MSR CPSR_c, r1 @ Setup new CPSR - BIC r0, r3, r2 @ Return previous interrupt mask -#ifdef __THUMB_INTERWORK - BX lr @ Return to caller -#else - MOV pc, lr @ Return to caller -#endif -@} + /* Pickup current interrupt lockout posture. */ + + MRS r3, CPSR // Pickup current CPSR + MOV r2, #INT_MASK // Build interrupt mask + AND r1, r3, r2 // Clear interrupt lockout bits + ORR r1, r1, r0 // Or-in new interrupt lockout bits + + /* Apply the new interrupt posture. */ + + MSR CPSR_c, r1 // Setup new CPSR + BIC r0, r3, r2 // Return previous interrupt mask +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a8/gnu/src/tx_thread_interrupt_disable.S b/ports/cortex_a8/gnu/src/tx_thread_interrupt_disable.S index 3bce811f..13258808 100644 --- a/ports/cortex_a8/gnu/src/tx_thread_interrupt_disable.S +++ b/ports/cortex_a8/gnu/src/tx_thread_interrupt_disable.S @@ -1,113 +1,101 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_disable for -@ applications calling this function from to 16-bit Thumb mode. */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_disable for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_interrupt_disable $_tx_thread_interrupt_disable: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_interrupt_disable @ Call _tx_thread_interrupt_disable function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_disable // Call _tx_thread_interrupt_disable function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_interrupt_disable Cortex-A8/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is responsible for disabling interrupts */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* old_posture Old interrupt lockout posture */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* Application Code */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@UINT _tx_thread_interrupt_disable(void) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_disable ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for disabling interrupts */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_interrupt_disable .type _tx_thread_interrupt_disable,function _tx_thread_interrupt_disable: -@ -@ /* Pickup current interrupt lockout posture. */ -@ - MRS r0, CPSR @ Pickup current CPSR -@ -@ /* Mask interrupts. */ -@ + + /* Pickup current interrupt lockout posture. */ + + MRS r0, CPSR // Pickup current CPSR + + /* Mask interrupts. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ + CPSID if // Disable IRQ and FIQ #else - CPSID i @ Disable IRQ + CPSID i // Disable IRQ #endif #ifdef __THUMB_INTERWORK - BX lr @ Return to caller + BX lr // Return to caller #else - MOV pc, lr @ Return to caller + MOV pc, lr // Return to caller #endif -@} - - diff --git a/ports/cortex_a8/gnu/src/tx_thread_interrupt_restore.S b/ports/cortex_a8/gnu/src/tx_thread_interrupt_restore.S index 4efdfb75..2d582511 100644 --- a/ports/cortex_a8/gnu/src/tx_thread_interrupt_restore.S +++ b/ports/cortex_a8/gnu/src/tx_thread_interrupt_restore.S @@ -1,104 +1,93 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_restore for -@ applications calling this function from to 16-bit Thumb mode. */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_restore for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_interrupt_restore $_tx_thread_interrupt_restore: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_interrupt_restore @ Call _tx_thread_interrupt_restore function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_restore // Call _tx_thread_interrupt_restore function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_interrupt_restore Cortex-A8/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is responsible for restoring interrupts to the state */ -@/* returned by a previous _tx_thread_interrupt_disable call. */ -@/* */ -@/* INPUT */ -@/* */ -@/* old_posture Old interrupt lockout posture */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* Application Code */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@UINT _tx_thread_interrupt_restore(UINT old_posture) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for restoring interrupts to the state */ +/* returned by a previous _tx_thread_interrupt_disable call. */ +/* */ +/* INPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_interrupt_restore .type _tx_thread_interrupt_restore,function _tx_thread_interrupt_restore: -@ -@ /* Apply the new interrupt posture. */ -@ - MSR CPSR_c, r0 @ Setup new CPSR -#ifdef __THUMB_INTERWORK - BX lr @ Return to caller -#else - MOV pc, lr @ Return to caller -#endif -@} + /* Apply the new interrupt posture. */ + + MSR CPSR_c, r0 // Setup new CPSR +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a8/gnu/src/tx_thread_irq_nesting_end.S b/ports/cortex_a8/gnu/src/tx_thread_irq_nesting_end.S index 473348d7..ec7e63c6 100644 --- a/ports/cortex_a8/gnu/src/tx_thread_irq_nesting_end.S +++ b/ports/cortex_a8/gnu/src/tx_thread_irq_nesting_end.S @@ -1,115 +1,103 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + #ifdef TX_ENABLE_FIQ_SUPPORT -DISABLE_INTS = 0xC0 @ Disable IRQ/FIQ interrupts +DISABLE_INTS = 0xC0 // Disable IRQ/FIQ interrupts #else -DISABLE_INTS = 0x80 @ Disable IRQ interrupts +DISABLE_INTS = 0x80 // Disable IRQ interrupts #endif -MODE_MASK = 0x1F @ Mode mask -IRQ_MODE_BITS = 0x12 @ IRQ mode bits -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_end -@ since it will never be called 16-bit mode. */ -@ +MODE_MASK = 0x1F // Mode mask +IRQ_MODE_BITS = 0x12 // IRQ mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_end + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_irq_nesting_end Cortex-A8/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is called by the application from IRQ mode after */ -@/* _tx_thread_irq_nesting_start has been called and switches the IRQ */ -@/* processing from system mode back to IRQ mode prior to the ISR */ -@/* calling _tx_thread_context_restore. Note that this function */ -@/* assumes the system stack pointer is in the same position after */ -@/* nesting start function was called. */ -@/* */ -@/* This function assumes that the system mode stack pointer was setup */ -@/* during low-level initialization (tx_initialize_low_level.s). */ -@/* */ -@/* This function returns with IRQ interrupts disabled. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_irq_nesting_end(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_irq_nesting_end ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from IRQ mode after */ +/* _tx_thread_irq_nesting_start has been called and switches the IRQ */ +/* processing from system mode back to IRQ mode prior to the ISR */ +/* calling _tx_thread_context_restore. Note that this function */ +/* assumes the system stack pointer is in the same position after */ +/* nesting start function was called. */ +/* */ +/* This function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with IRQ interrupts disabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_irq_nesting_end .type _tx_thread_irq_nesting_end,function _tx_thread_irq_nesting_end: - MOV r3,lr @ Save ISR return address - MRS r0, CPSR @ Pickup the CPSR - ORR r0, r0, #DISABLE_INTS @ Build disable interrupt value - MSR CPSR_c, r0 @ Disable interrupts - LDMIA sp!, {r1, lr} @ Pickup saved lr (and r1 throw-away for - @ 8-byte alignment logic) - BIC r0, r0, #MODE_MASK @ Clear mode bits - ORR r0, r0, #IRQ_MODE_BITS @ Build IRQ mode CPSR - MSR CPSR_c, r0 @ Reenter IRQ mode + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + ORR r0, r0, #DISABLE_INTS // Build disable interrupt value + MSR CPSR_c, r0 // Disable interrupts + LDMIA sp!, {r1, lr} // Pickup saved lr (and r1 throw-away for + // 8-byte alignment logic) + BIC r0, r0, #MODE_MASK // Clear mode bits + ORR r0, r0, #IRQ_MODE_BITS // Build IRQ mode CPSR + MSR CPSR_c, r0 // Reenter IRQ mode #ifdef __THUMB_INTERWORK - BX r3 @ Return to caller + BX r3 // Return to caller #else - MOV pc, r3 @ Return to caller + MOV pc, r3 // Return to caller #endif -@} - diff --git a/ports/cortex_a8/gnu/src/tx_thread_irq_nesting_start.S b/ports/cortex_a8/gnu/src/tx_thread_irq_nesting_start.S index 766e83d3..c69976ed 100644 --- a/ports/cortex_a8/gnu/src/tx_thread_irq_nesting_start.S +++ b/ports/cortex_a8/gnu/src/tx_thread_irq_nesting_start.S @@ -1,108 +1,96 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ -IRQ_DISABLE = 0x80 @ IRQ disable bit -MODE_MASK = 0x1F @ Mode mask -SYS_MODE_BITS = 0x1F @ System mode bits -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_start -@ since it will never be called 16-bit mode. */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +IRQ_DISABLE = 0x80 // IRQ disable bit +MODE_MASK = 0x1F // Mode mask +SYS_MODE_BITS = 0x1F // System mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_start + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_irq_nesting_start Cortex-A8/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is called by the application from IRQ mode after */ -@/* _tx_thread_context_save has been called and switches the IRQ */ -@/* processing to the system mode so nested IRQ interrupt processing */ -@/* is possible (system mode has its own "lr" register). Note that */ -@/* this function assumes that the system mode stack pointer was setup */ -@/* during low-level initialization (tx_initialize_low_level.s). */ -@/* */ -@/* This function returns with IRQ interrupts enabled. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_irq_nesting_start(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_irq_nesting_start ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from IRQ mode after */ +/* _tx_thread_context_save has been called and switches the IRQ */ +/* processing to the system mode so nested IRQ interrupt processing */ +/* is possible (system mode has its own "lr" register). Note that */ +/* this function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with IRQ interrupts enabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_irq_nesting_start .type _tx_thread_irq_nesting_start,function _tx_thread_irq_nesting_start: - MOV r3,lr @ Save ISR return address - MRS r0, CPSR @ Pickup the CPSR - BIC r0, r0, #MODE_MASK @ Clear the mode bits - ORR r0, r0, #SYS_MODE_BITS @ Build system mode CPSR - MSR CPSR_c, r0 @ Enter system mode - STMDB sp!, {r1, lr} @ Push the system mode lr on the system mode stack - @ and push r1 just to keep 8-byte alignment - BIC r0, r0, #IRQ_DISABLE @ Build enable IRQ CPSR - MSR CPSR_c, r0 @ Enter system mode + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + BIC r0, r0, #MODE_MASK // Clear the mode bits + ORR r0, r0, #SYS_MODE_BITS // Build system mode CPSR + MSR CPSR_c, r0 // Enter system mode + STMDB sp!, {r1, lr} // Push the system mode lr on the system mode stack + // and push r1 just to keep 8-byte alignment + BIC r0, r0, #IRQ_DISABLE // Build enable IRQ CPSR + MSR CPSR_c, r0 // Enter system mode #ifdef __THUMB_INTERWORK - BX r3 @ Return to caller + BX r3 // Return to caller #else - MOV pc, r3 @ Return to caller + MOV pc, r3 // Return to caller #endif -@} - diff --git a/ports/cortex_a8/gnu/src/tx_thread_schedule.S b/ports/cortex_a8/gnu/src/tx_thread_schedule.S index 642e1989..8330e9df 100644 --- a/ports/cortex_a8/gnu/src/tx_thread_schedule.S +++ b/ports/cortex_a8/gnu/src/tx_thread_schedule.S @@ -1,258 +1,230 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .global _tx_thread_execute_ptr .global _tx_thread_current_ptr .global _tx_timer_time_slice - .global _tx_execution_thread_enter -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_schedule for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_schedule for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_schedule .type $_tx_thread_schedule,function $_tx_thread_schedule: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_schedule @ Call _tx_thread_schedule function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_schedule // Call _tx_thread_schedule function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_schedule Cortex-A8/GNU */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function waits for a thread control block pointer to appear in */ -@/* the _tx_thread_execute_ptr variable. Once a thread pointer appears */ -@/* in the variable, the corresponding thread is resumed. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* _tx_initialize_kernel_enter ThreadX entry function */ -@/* _tx_thread_system_return Return to system from thread */ -@/* _tx_thread_context_restore Restore thread's context */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_schedule(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_schedule ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function waits for a thread control block pointer to appear in */ +/* the _tx_thread_execute_ptr variable. Once a thread pointer appears */ +/* in the variable, the corresponding thread is resumed. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_initialize_kernel_enter ThreadX entry function */ +/* _tx_thread_system_return Return to system from thread */ +/* _tx_thread_context_restore Restore thread's context */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_schedule .type _tx_thread_schedule,function _tx_thread_schedule: -@ -@ /* Enable interrupts. */ -@ + + /* Enable interrupts. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSIE if @ Enable IRQ and FIQ interrupts + CPSIE if // Enable IRQ and FIQ interrupts #else - CPSIE i @ Enable IRQ interrupts + CPSIE i // Enable IRQ interrupts #endif -@ -@ /* Wait for a thread to execute. */ -@ do -@ { - LDR r1, =_tx_thread_execute_ptr @ Address of thread execute ptr -@ + + /* Wait for a thread to execute. */ + LDR r1, =_tx_thread_execute_ptr // Address of thread execute ptr + __tx_thread_schedule_loop: -@ - LDR r0, [r1] @ Pickup next thread to execute - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_schedule_loop @ If so, keep looking for a thread -@ -@ } -@ while(_tx_thread_execute_ptr == TX_NULL); -@ -@ /* Yes! We have a thread to execute. Lockout interrupts and -@ transfer control to it. */ -@ + + LDR r0, [r1] // Pickup next thread to execute + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_schedule_loop // If so, keep looking for a thread + /* Yes! We have a thread to execute. Lockout interrupts and + transfer control to it. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ interrupts + CPSID if // Disable IRQ and FIQ interrupts #else - CPSID i @ Disable IRQ interrupts + CPSID i // Disable IRQ interrupts #endif -@ -@ /* Setup the current thread pointer. */ -@ _tx_thread_current_ptr = _tx_thread_execute_ptr; -@ - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread - STR r0, [r1] @ Setup current thread pointer -@ -@ /* Increment the run count for this thread. */ -@ _tx_thread_current_ptr -> tx_thread_run_count++; -@ - LDR r2, [r0, #4] @ Pickup run counter - LDR r3, [r0, #24] @ Pickup time-slice for this thread - ADD r2, r2, #1 @ Increment thread run-counter - STR r2, [r0, #4] @ Store the new run counter -@ -@ /* Setup time-slice, if present. */ -@ _tx_timer_time_slice = _tx_thread_current_ptr -> tx_thread_time_slice; -@ - LDR r2, =_tx_timer_time_slice @ Pickup address of time-slice - @ variable - LDR sp, [r0, #8] @ Switch stack pointers - STR r3, [r2] @ Setup time-slice -@ -@ /* Switch to the thread's stack. */ -@ sp = _tx_thread_execute_ptr -> tx_thread_stack_ptr; -@ + + /* Setup the current thread pointer. */ + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread + STR r0, [r1] // Setup current thread pointer + + /* Increment the run count for this thread. */ + + LDR r2, [r0, #4] // Pickup run counter + LDR r3, [r0, #24] // Pickup time-slice for this thread + ADD r2, r2, #1 // Increment thread run-counter + STR r2, [r0, #4] // Store the new run counter + + /* Setup time-slice, if present. */ + + LDR r2, =_tx_timer_time_slice // Pickup address of time-slice + // variable + LDR sp, [r0, #8] // Switch stack pointers + STR r3, [r2] // Setup time-slice + #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the thread entry function to indicate the thread is executing. */ -@ - MOV r5, r0 @ Save r0 - BL _tx_execution_thread_enter @ Call the thread execution enter function - MOV r0, r5 @ Restore r0 + + /* Call the thread entry function to indicate the thread is executing. */ + + MOV r5, r0 // Save r0 + BL _tx_execution_thread_enter // Call the thread execution enter function + MOV r0, r5 // Restore r0 #endif -@ -@ /* Determine if an interrupt frame or a synchronous task suspension frame -@ is present. */ -@ - LDMIA sp!, {r4, r5} @ Pickup the stack type and saved CPSR - CMP r4, #0 @ Check for synchronous context switch + + /* Determine if an interrupt frame or a synchronous task suspension frame + is present. */ + + LDMIA sp!, {r4, r5} // Pickup the stack type and saved CPSR + CMP r4, #0 // Check for synchronous context switch BEQ _tx_solicited_return - MSR SPSR_cxsf, r5 @ Setup SPSR for return + MSR SPSR_cxsf, r5 // Setup SPSR for return #ifdef TX_ENABLE_VFP_SUPPORT - LDR r1, [r0, #144] @ Pickup the VFP enabled flag - CMP r1, #0 @ Is the VFP enabled? - BEQ _tx_skip_interrupt_vfp_restore @ No, skip VFP interrupt restore - VLDMIA sp!, {D0-D15} @ Recover D0-D15 - VLDMIA sp!, {D16-D31} @ Recover D16-D31 - LDR r4, [sp], #4 @ Pickup FPSCR - VMSR FPSCR, r4 @ Restore FPSCR + LDR r1, [r0, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_interrupt_vfp_restore // No, skip VFP interrupt restore + VLDMIA sp!, {D0-D15} // Recover D0-D15 + VLDMIA sp!, {D16-D31} // Recover D16-D31 + LDR r4, [sp], #4 // Pickup FPSCR + VMSR FPSCR, r4 // Restore FPSCR _tx_skip_interrupt_vfp_restore: #endif - LDMIA sp!, {r0-r12, lr, pc}^ @ Return to point of thread interrupt + LDMIA sp!, {r0-r12, lr, pc}^ // Return to point of thread interrupt _tx_solicited_return: #ifdef TX_ENABLE_VFP_SUPPORT - LDR r1, [r0, #144] @ Pickup the VFP enabled flag - CMP r1, #0 @ Is the VFP enabled? - BEQ _tx_skip_solicited_vfp_restore @ No, skip VFP solicited restore - VLDMIA sp!, {D8-D15} @ Recover D8-D15 - VLDMIA sp!, {D16-D31} @ Recover D16-D31 - LDR r4, [sp], #4 @ Pickup FPSCR - VMSR FPSCR, r4 @ Restore FPSCR + LDR r1, [r0, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_solicited_vfp_restore // No, skip VFP solicited restore + VLDMIA sp!, {D8-D15} // Recover D8-D15 + VLDMIA sp!, {D16-D31} // Recover D16-D31 + LDR r4, [sp], #4 // Pickup FPSCR + VMSR FPSCR, r4 // Restore FPSCR _tx_skip_solicited_vfp_restore: #endif - MSR CPSR_cxsf, r5 @ Recover CPSR - LDMIA sp!, {r4-r11, lr} @ Return to thread synchronously + MSR CPSR_cxsf, r5 // Recover CPSR + LDMIA sp!, {r4-r11, lr} // Return to thread synchronously #ifdef __THUMB_INTERWORK - BX lr @ Return to caller + BX lr // Return to caller #else - MOV pc, lr @ Return to caller + MOV pc, lr // Return to caller #endif -@ -@} -@ #ifdef TX_ENABLE_VFP_SUPPORT .global tx_thread_vfp_enable .type tx_thread_vfp_enable,function tx_thread_vfp_enable: - MRS r2, CPSR @ Pickup the CPSR + MRS r2, CPSR // Pickup the CPSR #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Enable IRQ and FIQ interrupts + CPSID if // Enable IRQ and FIQ interrupts #else - CPSID i @ Enable IRQ interrupts + CPSID i // Enable IRQ interrupts #endif - LDR r0, =_tx_thread_current_ptr @ Build current thread pointer address - LDR r1, [r0] @ Pickup current thread pointer - CMP r1, #0 @ Check for NULL thread pointer - BEQ __tx_no_thread_to_enable @ If NULL, skip VFP enable - MOV r0, #1 @ Build enable value - STR r0, [r1, #144] @ Set the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) + LDR r0, =_tx_thread_current_ptr // Build current thread pointer address + LDR r1, [r0] // Pickup current thread pointer + CMP r1, #0 // Check for NULL thread pointer + BEQ __tx_no_thread_to_enable // If NULL, skip VFP enable + MOV r0, #1 // Build enable value + STR r0, [r1, #144] // Set the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) __tx_no_thread_to_enable: - MSR CPSR_cxsf, r2 @ Recover CPSR - BX LR @ Return to caller + MSR CPSR_cxsf, r2 // Recover CPSR + BX LR // Return to caller .global tx_thread_vfp_disable .type tx_thread_vfp_disable,function tx_thread_vfp_disable: - MRS r2, CPSR @ Pickup the CPSR + MRS r2, CPSR // Pickup the CPSR #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Enable IRQ and FIQ interrupts + CPSID if // Enable IRQ and FIQ interrupts #else - CPSID i @ Enable IRQ interrupts + CPSID i // Enable IRQ interrupts #endif - LDR r0, =_tx_thread_current_ptr @ Build current thread pointer address - LDR r1, [r0] @ Pickup current thread pointer - CMP r1, #0 @ Check for NULL thread pointer - BEQ __tx_no_thread_to_disable @ If NULL, skip VFP disable - MOV r0, #0 @ Build disable value - STR r0, [r1, #144] @ Clear the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) + LDR r0, =_tx_thread_current_ptr // Build current thread pointer address + LDR r1, [r0] // Pickup current thread pointer + CMP r1, #0 // Check for NULL thread pointer + BEQ __tx_no_thread_to_disable // If NULL, skip VFP disable + MOV r0, #0 // Build disable value + STR r0, [r1, #144] // Clear the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) __tx_no_thread_to_disable: - MSR CPSR_cxsf, r2 @ Recover CPSR - BX LR @ Return to caller + MSR CPSR_cxsf, r2 // Recover CPSR + BX LR // Return to caller #endif - diff --git a/ports/cortex_a8/gnu/src/tx_thread_stack_build.S b/ports/cortex_a8/gnu/src/tx_thread_stack_build.S index 3946d652..f413e673 100644 --- a/ports/cortex_a8/gnu/src/tx_thread_stack_build.S +++ b/ports/cortex_a8/gnu/src/tx_thread_stack_build.S @@ -1,178 +1,164 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ .arm -SVC_MODE = 0x13 @ SVC mode +SVC_MODE = 0x13 // SVC mode #ifdef TX_ENABLE_FIQ_SUPPORT -CPSR_MASK = 0xDF @ Mask initial CPSR, IRQ & FIQ interrupts enabled +CPSR_MASK = 0xDF // Mask initial CPSR, IRQ & FIQ interrupts enabled #else -CPSR_MASK = 0x9F @ Mask initial CPSR, IRQ interrupts enabled +CPSR_MASK = 0x9F // Mask initial CPSR, IRQ interrupts enabled #endif -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_stack_build for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_stack_build for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .thumb .global $_tx_thread_stack_build .type $_tx_thread_stack_build,function $_tx_thread_stack_build: - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_stack_build @ Call _tx_thread_stack_build function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_stack_build // Call _tx_thread_stack_build function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_stack_build Cortex-A8/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function builds a stack frame on the supplied thread's stack. */ -@/* The stack frame results in a fake interrupt return to the supplied */ -@/* function pointer. */ -@/* */ -@/* INPUT */ -@/* */ -@/* thread_ptr Pointer to thread control blk */ -@/* function_ptr Pointer to return function */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* _tx_thread_create Create thread service */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_stack_build(TX_THREAD *thread_ptr, VOID (*function_ptr)(VOID)) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_stack_build ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function builds a stack frame on the supplied thread's stack. */ +/* The stack frame results in a fake interrupt return to the supplied */ +/* function pointer. */ +/* */ +/* INPUT */ +/* */ +/* thread_ptr Pointer to thread control blk */ +/* function_ptr Pointer to return function */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_thread_create Create thread service */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_stack_build .type _tx_thread_stack_build,function _tx_thread_stack_build: -@ -@ -@ /* Build a fake interrupt frame. The form of the fake interrupt stack -@ on the Cortex-A8 should look like the following after it is built: -@ -@ Stack Top: 1 Interrupt stack frame type -@ CPSR Initial value for CPSR -@ a1 (r0) Initial value for a1 -@ a2 (r1) Initial value for a2 -@ a3 (r2) Initial value for a3 -@ a4 (r3) Initial value for a4 -@ v1 (r4) Initial value for v1 -@ v2 (r5) Initial value for v2 -@ v3 (r6) Initial value for v3 -@ v4 (r7) Initial value for v4 -@ v5 (r8) Initial value for v5 -@ sb (r9) Initial value for sb -@ sl (r10) Initial value for sl -@ fp (r11) Initial value for fp -@ ip (r12) Initial value for ip -@ lr (r14) Initial value for lr -@ pc (r15) Initial value for pc -@ 0 For stack backtracing -@ -@ Stack Bottom: (higher memory address) */ -@ - LDR r2, [r0, #16] @ Pickup end of stack area - BIC r2, r2, #7 @ Ensure 8-byte alignment - SUB r2, r2, #76 @ Allocate space for the stack frame -@ -@ /* Actually build the stack frame. */ -@ - MOV r3, #1 @ Build interrupt stack type - STR r3, [r2, #0] @ Store stack type - MOV r3, #0 @ Build initial register value - STR r3, [r2, #8] @ Store initial r0 - STR r3, [r2, #12] @ Store initial r1 - STR r3, [r2, #16] @ Store initial r2 - STR r3, [r2, #20] @ Store initial r3 - STR r3, [r2, #24] @ Store initial r4 - STR r3, [r2, #28] @ Store initial r5 - STR r3, [r2, #32] @ Store initial r6 - STR r3, [r2, #36] @ Store initial r7 - STR r3, [r2, #40] @ Store initial r8 - STR r3, [r2, #44] @ Store initial r9 - LDR r3, [r0, #12] @ Pickup stack starting address - STR r3, [r2, #48] @ Store initial r10 (sl) - LDR r3,=_tx_thread_schedule @ Pickup address of _tx_thread_schedule for GDB backtrace - STR r3, [r2, #60] @ Store initial r14 (lr) - MOV r3, #0 @ Build initial register value - STR r3, [r2, #52] @ Store initial r11 - STR r3, [r2, #56] @ Store initial r12 - STR r1, [r2, #64] @ Store initial pc - STR r3, [r2, #68] @ 0 for back-trace - MRS r1, CPSR @ Pickup CPSR - BIC r1, r1, #CPSR_MASK @ Mask mode bits of CPSR - ORR r3, r1, #SVC_MODE @ Build CPSR, SVC mode, interrupts enabled - STR r3, [r2, #4] @ Store initial CPSR -@ -@ /* Setup stack pointer. */ -@ thread_ptr -> tx_thread_stack_ptr = r2; -@ - STR r2, [r0, #8] @ Save stack pointer in thread's - @ control block + + + /* Build a fake interrupt frame. The form of the fake interrupt stack + on the ARMv7-A should look like the following after it is built: + + Stack Top: 1 Interrupt stack frame type + CPSR Initial value for CPSR + a1 (r0) Initial value for a1 + a2 (r1) Initial value for a2 + a3 (r2) Initial value for a3 + a4 (r3) Initial value for a4 + v1 (r4) Initial value for v1 + v2 (r5) Initial value for v2 + v3 (r6) Initial value for v3 + v4 (r7) Initial value for v4 + v5 (r8) Initial value for v5 + sb (r9) Initial value for sb + sl (r10) Initial value for sl + fp (r11) Initial value for fp + ip (r12) Initial value for ip + lr (r14) Initial value for lr + pc (r15) Initial value for + 0 For stack backtracing + + Stack Bottom: (higher memory address) */ + + LDR r2, [r0, #16] // Pickup end of stack area + BIC r2, r2, #7 // Ensure 8-byte alignment + SUB r2, r2, #76 // Allocate space for the stack frame + + /* Actually build the stack frame. */ + + MOV r3, #1 // Build interrupt stack type + STR r3, [r2, #0] // Store stack type + MOV r3, #0 // Build initial register value + STR r3, [r2, #8] // Store initial r0 + STR r3, [r2, #12] // Store initial r1 + STR r3, [r2, #16] // Store initial r2 + STR r3, [r2, #20] // Store initial r3 + STR r3, [r2, #24] // Store initial r4 + STR r3, [r2, #28] // Store initial r5 + STR r3, [r2, #32] // Store initial r6 + STR r3, [r2, #36] // Store initial r7 + STR r3, [r2, #40] // Store initial r8 + STR r3, [r2, #44] // Store initial r9 + LDR r3, [r0, #12] // Pickup stack starting address + STR r3, [r2, #48] // Store initial r10 (sl) + LDR r3,=_tx_thread_schedule // Pickup address of _tx_thread_schedule for GDB backtrace + STR r3, [r2, #60] // Store initial r14 (lr) + MOV r3, #0 // Build initial register value + STR r3, [r2, #52] // Store initial r11 + STR r3, [r2, #56] // Store initial r12 + STR r1, [r2, #64] // Store initial pc + STR r3, [r2, #68] // 0 for back-trace + MRS r1, CPSR // Pickup CPSR + BIC r1, r1, #CPSR_MASK // Mask mode bits of CPSR + ORR r3, r1, #SVC_MODE // Build CPSR, SVC mode, interrupts enabled + STR r3, [r2, #4] // Store initial CPSR + + /* Setup stack pointer. */ + + STR r2, [r0, #8] // Save stack pointer in thread's + // control block #ifdef __THUMB_INTERWORK - BX lr @ Return to caller + BX lr // Return to caller #else - MOV pc, lr @ Return to caller + MOV pc, lr // Return to caller #endif -@} - - diff --git a/ports/cortex_a8/gnu/src/tx_thread_system_return.S b/ports/cortex_a8/gnu/src/tx_thread_system_return.S index 05fe5793..cb7d62ce 100644 --- a/ports/cortex_a8/gnu/src/tx_thread_system_return.S +++ b/ports/cortex_a8/gnu/src/tx_thread_system_return.S @@ -1,183 +1,162 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .arm -@ -@ + + .global _tx_thread_current_ptr .global _tx_timer_time_slice .global _tx_thread_schedule - .global _tx_execution_thread_exit -@ -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_system_return for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_system_return for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_system_return .type $_tx_thread_system_return,function $_tx_thread_system_return: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_system_return @ Call _tx_thread_system_return function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_system_return // Call _tx_thread_system_return function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_system_return Cortex-A8/GNU */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is target processor specific. It is used to transfer */ -@/* control from a thread back to the ThreadX system. Only a */ -@/* minimal context is saved since the compiler assumes temp registers */ -@/* are going to get slicked by a function call anyway. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* _tx_thread_schedule Thread scheduling loop */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ThreadX components */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_system_return(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_system_return ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is target processor specific. It is used to transfer */ +/* control from a thread back to the ThreadX system. Only a */ +/* minimal context is saved since the compiler assumes temp registers */ +/* are going to get slicked by a function call anyway. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling loop */ +/* */ +/* CALLED BY */ +/* */ +/* ThreadX components */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_system_return .type _tx_thread_system_return,function _tx_thread_system_return: -@ -@ /* Save minimal context on the stack. */ -@ - STMDB sp!, {r4-r11, lr} @ Save minimal context - LDR r4, =_tx_thread_current_ptr @ Pickup address of current ptr - LDR r5, [r4] @ Pickup current thread pointer - + /* Save minimal context on the stack. */ + + STMDB sp!, {r4-r11, lr} // Save minimal context + + LDR r4, =_tx_thread_current_ptr // Pickup address of current ptr + LDR r5, [r4] // Pickup current thread pointer + #ifdef TX_ENABLE_VFP_SUPPORT - LDR r1, [r5, #144] @ Pickup the VFP enabled flag - CMP r1, #0 @ Is the VFP enabled? - BEQ _tx_skip_solicited_vfp_save @ No, skip VFP solicited save - VMRS r1, FPSCR @ Pickup the FPSCR - STR r1, [sp, #-4]! @ Save FPSCR - VSTMDB sp!, {D16-D31} @ Save D16-D31 - VSTMDB sp!, {D8-D15} @ Save D8-D15 + LDR r1, [r5, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_solicited_vfp_save // No, skip VFP solicited save + VMRS r1, FPSCR // Pickup the FPSCR + STR r1, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D8-D15} // Save D8-D15 _tx_skip_solicited_vfp_save: #endif - MOV r0, #0 @ Build a solicited stack type - MRS r1, CPSR @ Pickup the CPSR - STMDB sp!, {r0-r1} @ Save type and CPSR -@ -@ /* Lockout interrupts. */ -@ -#ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ interrupts -#else - CPSID i @ Disable IRQ interrupts -#endif - -#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the thread exit function to indicate the thread is no longer executing. */ -@ - BL _tx_execution_thread_exit @ Call the thread exit function -#endif - MOV r3, r4 @ Pickup address of current ptr - MOV r0, r5 @ Pickup current thread pointer - LDR r2, =_tx_timer_time_slice @ Pickup address of time slice - LDR r1, [r2] @ Pickup current time slice -@ -@ /* Save current stack and switch to system stack. */ -@ _tx_thread_current_ptr -> tx_thread_stack_ptr = sp; -@ sp = _tx_thread_system_stack_ptr; -@ - STR sp, [r0, #8] @ Save thread stack pointer -@ -@ /* Determine if the time-slice is active. */ -@ if (_tx_timer_time_slice) -@ { -@ - MOV r4, #0 @ Build clear value - CMP r1, #0 @ Is a time-slice active? - BEQ __tx_thread_dont_save_ts @ No, don't save the time-slice -@ -@ /* Save time-slice for the thread and clear the current time-slice. */ -@ _tx_thread_current_ptr -> tx_thread_time_slice = _tx_timer_time_slice; -@ _tx_timer_time_slice = 0; -@ - STR r4, [r2] @ Clear time-slice - STR r1, [r0, #24] @ Save current time-slice -@ -@ } -__tx_thread_dont_save_ts: -@ -@ /* Clear the current thread pointer. */ -@ _tx_thread_current_ptr = TX_NULL; -@ - STR r4, [r3] @ Clear current thread pointer - B _tx_thread_schedule @ Jump to scheduler! -@ -@} + MOV r0, #0 // Build a solicited stack type + MRS r1, CPSR // Pickup the CPSR + STMDB sp!, {r0-r1} // Save type and CPSR + /* Lockout interrupts. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Disable IRQ and FIQ interrupts +#else + CPSID i // Disable IRQ interrupts +#endif + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the thread exit function to indicate the thread is no longer executing. */ + + BL _tx_execution_thread_exit // Call the thread exit function +#endif + MOV r3, r4 // Pickup address of current ptr + MOV r0, r5 // Pickup current thread pointer + LDR r2, =_tx_timer_time_slice // Pickup address of time slice + LDR r1, [r2] // Pickup current time slice + + /* Save current stack and switch to system stack. */ + + STR sp, [r0, #8] // Save thread stack pointer + + /* Determine if the time-slice is active. */ + + MOV r4, #0 // Build clear value + CMP r1, #0 // Is a time-slice active? + BEQ __tx_thread_dont_save_ts // No, don't save the time-slice + + /* Save time-slice for the thread and clear the current time-slice. */ + + STR r4, [r2] // Clear time-slice + STR r1, [r0, #24] // Save current time-slice + +__tx_thread_dont_save_ts: + + /* Clear the current thread pointer. */ + + STR r4, [r3] // Clear current thread pointer + B _tx_thread_schedule // Jump to scheduler! diff --git a/ports/cortex_a8/gnu/src/tx_thread_vectored_context_save.S b/ports/cortex_a8/gnu/src/tx_thread_vectored_context_save.S index a11ac4b4..d846223f 100644 --- a/ports/cortex_a8/gnu/src/tx_thread_vectored_context_save.S +++ b/ports/cortex_a8/gnu/src/tx_thread_vectored_context_save.S @@ -1,193 +1,165 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .global _tx_thread_system_state .global _tx_thread_current_ptr .global _tx_execution_isr_enter -@ -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_vectored_context_save -@ since it will never be called 16-bit mode. */ -@ + + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_vectored_context_save + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_vectored_context_save Cortex-A8/GNU */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function saves the context of an executing thread in the */ -@/* beginning of interrupt processing. The function also ensures that */ -@/* the system stack is used upon return to the calling ISR. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_vectored_context_save(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_vectored_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_vectored_context_save .type _tx_thread_vectored_context_save,function _tx_thread_vectored_context_save: -@ -@ /* Upon entry to this routine, it is assumed that IRQ interrupts are locked -@ out, we are in IRQ mode, and all registers are intact. */ -@ -@ /* Check for a nested interrupt condition. */ -@ if (_tx_thread_system_state++) -@ { -@ + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ interrupts + CPSID if // Disable IRQ and FIQ interrupts #endif - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3, #0] @ Pickup system state - CMP r2, #0 @ Is this the first interrupt? - BEQ __tx_thread_not_nested_save @ Yes, not a nested context save -@ -@ /* Nested interrupt condition. */ -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3, #0] @ Store it back in the variable -@ -@ /* Note: Minimal context of interrupted thread is already saved. */ -@ -@ /* Return to the ISR. */ -@ - MOV r10, #0 @ Clear stack limit + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3, #0] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3, #0] // Store it back in the variable + + /* Note: Minimal context of interrupted thread is already saved. */ + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - MOV pc, lr @ Return to caller -@ + MOV pc, lr // Return to caller + __tx_thread_not_nested_save: -@ } -@ -@ /* Otherwise, not nested, check to see if a thread was running. */ -@ else if (_tx_thread_current_ptr) -@ { -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3, #0] @ Store it back in the variable - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1, #0] @ Pickup current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_idle_system_save @ If so, interrupt occurred in - @ scheduling loop - nothing needs saving! -@ -@ /* Note: Minimal context of interrupted thread is already saved. */ -@ -@ /* Save the current stack pointer in the thread's control block. */ -@ _tx_thread_current_ptr -> tx_thread_stack_ptr = sp; -@ -@ /* Switch to the system stack. */ -@ sp = _tx_thread_system_stack_ptr; -@ - MOV r10, #0 @ Clear stack limit + + /* Otherwise, not nested, check to see if a thread was running. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3, #0] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1, #0] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + /* Note: Minimal context of interrupted thread is already saved. */ + + /* Save the current stack pointer in the thread's control block. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - MOV pc, lr @ Return to caller -@ -@ } -@ else -@ { -@ + MOV pc, lr // Return to caller + __tx_thread_idle_system_save: -@ -@ /* Interrupt occurred in the scheduling loop. */ -@ -@ /* Not much to do here, just adjust the stack pointer, and return to IRQ -@ processing. */ -@ - MOV r10, #0 @ Clear stack limit + + /* Interrupt occurred in the scheduling loop. */ + + /* Not much to do here, just adjust the stack pointer, and return to IRQ + processing. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - ADD sp, sp, #32 @ Recover saved registers - MOV pc, lr @ Return to caller -@ -@ } -@} - + ADD sp, sp, #32 // Recover saved registers + MOV pc, lr // Return to caller diff --git a/ports/cortex_a8/gnu/src/tx_timer_interrupt.S b/ports/cortex_a8/gnu/src/tx_timer_interrupt.S index 2f8ffccf..7337ed0c 100644 --- a/ports/cortex_a8/gnu/src/tx_timer_interrupt.S +++ b/ports/cortex_a8/gnu/src/tx_timer_interrupt.S @@ -1,40 +1,30 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Timer */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_timer.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Timer */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .arm -@ -@/* Define Assembly language external references... */ -@ + +/* Define Assembly language external references... */ + .global _tx_timer_time_slice .global _tx_timer_system_clock .global _tx_timer_current_ptr @@ -43,237 +33,199 @@ .global _tx_timer_expired_time_slice .global _tx_timer_expired .global _tx_thread_time_slice -@ -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_timer_interrupt for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + + + +/* Define the 16-bit Thumb mode veneer for _tx_timer_interrupt for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .thumb .global $_tx_timer_interrupt .type $_tx_timer_interrupt,function $_tx_timer_interrupt: - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_timer_interrupt @ Call _tx_timer_interrupt function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_timer_interrupt // Call _tx_timer_interrupt function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_timer_interrupt Cortex-A8/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function processes the hardware timer interrupt. This */ -@/* processing includes incrementing the system clock and checking for */ -@/* time slice and/or timer expiration. If either is found, the */ -@/* interrupt context save/restore functions are called along with the */ -@/* expiration functions. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* _tx_thread_time_slice Time slice interrupted thread */ -@/* _tx_timer_expiration_process Timer expiration processing */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* interrupt vector */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_timer_interrupt(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_timer_interrupt ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function processes the hardware timer interrupt. This */ +/* processing includes incrementing the system clock and checking for */ +/* time slice and/or timer expiration. If either is found, the */ +/* interrupt context save/restore functions are called along with the */ +/* expiration functions. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_time_slice Time slice interrupted thread */ +/* _tx_timer_expiration_process Timer expiration processing */ +/* */ +/* CALLED BY */ +/* */ +/* interrupt vector */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_timer_interrupt .type _tx_timer_interrupt,function _tx_timer_interrupt: -@ -@ /* Upon entry to this routine, it is assumed that context save has already -@ been called, and therefore the compiler scratch registers are available -@ for use. */ -@ -@ /* Increment the system clock. */ -@ _tx_timer_system_clock++; -@ - LDR r1, =_tx_timer_system_clock @ Pickup address of system clock - LDR r0, [r1] @ Pickup system clock - ADD r0, r0, #1 @ Increment system clock - STR r0, [r1] @ Store new system clock -@ -@ /* Test for time-slice expiration. */ -@ if (_tx_timer_time_slice) -@ { -@ - LDR r3, =_tx_timer_time_slice @ Pickup address of time-slice - LDR r2, [r3] @ Pickup time-slice - CMP r2, #0 @ Is it non-active? - BEQ __tx_timer_no_time_slice @ Yes, skip time-slice processing -@ -@ /* Decrement the time_slice. */ -@ _tx_timer_time_slice--; -@ - SUB r2, r2, #1 @ Decrement the time-slice - STR r2, [r3] @ Store new time-slice value -@ -@ /* Check for expiration. */ -@ if (__tx_timer_time_slice == 0) -@ - CMP r2, #0 @ Has it expired? - BNE __tx_timer_no_time_slice @ No, skip expiration processing -@ -@ /* Set the time-slice expired flag. */ -@ _tx_timer_expired_time_slice = TX_TRUE; -@ - LDR r3, =_tx_timer_expired_time_slice @ Pickup address of expired flag - MOV r0, #1 @ Build expired value - STR r0, [r3] @ Set time-slice expiration flag -@ -@ } -@ -__tx_timer_no_time_slice: -@ -@ /* Test for timer expiration. */ -@ if (*_tx_timer_current_ptr) -@ { -@ - LDR r1, =_tx_timer_current_ptr @ Pickup current timer pointer address - LDR r0, [r1] @ Pickup current timer - LDR r2, [r0] @ Pickup timer list entry - CMP r2, #0 @ Is there anything in the list? - BEQ __tx_timer_no_timer @ No, just increment the timer -@ -@ /* Set expiration flag. */ -@ _tx_timer_expired = TX_TRUE; -@ - LDR r3, =_tx_timer_expired @ Pickup expiration flag address - MOV r2, #1 @ Build expired value - STR r2, [r3] @ Set expired flag - B __tx_timer_done @ Finished timer processing -@ -@ } -@ else -@ { -__tx_timer_no_timer: -@ -@ /* No timer expired, increment the timer pointer. */ -@ _tx_timer_current_ptr++; -@ - ADD r0, r0, #4 @ Move to next timer -@ -@ /* Check for wraparound. */ -@ if (_tx_timer_current_ptr == _tx_timer_list_end) -@ - LDR r3, =_tx_timer_list_end @ Pickup address of timer list end - LDR r2, [r3] @ Pickup list end - CMP r0, r2 @ Are we at list end? - BNE __tx_timer_skip_wrap @ No, skip wraparound logic -@ -@ /* Wrap to beginning of list. */ -@ _tx_timer_current_ptr = _tx_timer_list_start; -@ - LDR r3, =_tx_timer_list_start @ Pickup address of timer list start - LDR r0, [r3] @ Set current pointer to list start -@ -__tx_timer_skip_wrap: -@ - STR r0, [r1] @ Store new current timer pointer -@ } -@ -__tx_timer_done: -@ -@ -@ /* See if anything has expired. */ -@ if ((_tx_timer_expired_time_slice) || (_tx_timer_expired)) -@ { -@ - LDR r3, =_tx_timer_expired_time_slice @ Pickup address of expired flag - LDR r2, [r3] @ Pickup time-slice expired flag - CMP r2, #0 @ Did a time-slice expire? - BNE __tx_something_expired @ If non-zero, time-slice expired - LDR r1, =_tx_timer_expired @ Pickup address of other expired flag - LDR r0, [r1] @ Pickup timer expired flag - CMP r0, #0 @ Did a timer expire? - BEQ __tx_timer_nothing_expired @ No, nothing expired -@ -__tx_something_expired: -@ -@ - STMDB sp!, {r0, lr} @ Save the lr register on the stack - @ and save r0 just to keep 8-byte alignment -@ -@ /* Did a timer expire? */ -@ if (_tx_timer_expired) -@ { -@ - LDR r1, =_tx_timer_expired @ Pickup address of expired flag - LDR r0, [r1] @ Pickup timer expired flag - CMP r0, #0 @ Check for timer expiration - BEQ __tx_timer_dont_activate @ If not set, skip timer activation -@ -@ /* Process timer expiration. */ -@ _tx_timer_expiration_process(); -@ - BL _tx_timer_expiration_process @ Call the timer expiration handling routine -@ -@ } -__tx_timer_dont_activate: -@ -@ /* Did time slice expire? */ -@ if (_tx_timer_expired_time_slice) -@ { -@ - LDR r3, =_tx_timer_expired_time_slice @ Pickup address of time-slice expired - LDR r2, [r3] @ Pickup the actual flag - CMP r2, #0 @ See if the flag is set - BEQ __tx_timer_not_ts_expiration @ No, skip time-slice processing -@ -@ /* Time slice interrupted thread. */ -@ _tx_thread_time_slice(); -@ - BL _tx_thread_time_slice @ Call time-slice processing -@ -@ } -@ -__tx_timer_not_ts_expiration: -@ - LDMIA sp!, {r0, lr} @ Recover lr register (r0 is just there for - @ the 8-byte stack alignment -@ -@ } -@ -__tx_timer_nothing_expired: -@ -#ifdef __THUMB_INTERWORK - BX lr @ Return to caller -#else - MOV pc, lr @ Return to caller -#endif -@ -@} + /* Upon entry to this routine, it is assumed that context save has already + been called, and therefore the compiler scratch registers are available + for use. */ + + /* Increment the system clock. */ + + LDR r1, =_tx_timer_system_clock // Pickup address of system clock + LDR r0, [r1] // Pickup system clock + ADD r0, r0, #1 // Increment system clock + STR r0, [r1] // Store new system clock + + /* Test for time-slice expiration. */ + + LDR r3, =_tx_timer_time_slice // Pickup address of time-slice + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it non-active? + BEQ __tx_timer_no_time_slice // Yes, skip time-slice processing + + /* Decrement the time_slice. */ + + SUB r2, r2, #1 // Decrement the time-slice + STR r2, [r3] // Store new time-slice value + + /* Check for expiration. */ + + CMP r2, #0 // Has it expired? + BNE __tx_timer_no_time_slice // No, skip expiration processing + + /* Set the time-slice expired flag. */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of expired flag + MOV r0, #1 // Build expired value + STR r0, [r3] // Set time-slice expiration flag + +__tx_timer_no_time_slice: + + /* Test for timer expiration. */ + + LDR r1, =_tx_timer_current_ptr // Pickup current timer pointer address + LDR r0, [r1] // Pickup current timer + LDR r2, [r0] // Pickup timer list entry + CMP r2, #0 // Is there anything in the list? + BEQ __tx_timer_no_timer // No, just increment the timer + + /* Set expiration flag. */ + + LDR r3, =_tx_timer_expired // Pickup expiration flag address + MOV r2, #1 // Build expired value + STR r2, [r3] // Set expired flag + B __tx_timer_done // Finished timer processing + +__tx_timer_no_timer: + + /* No timer expired, increment the timer pointer. */ + ADD r0, r0, #4 // Move to next timer + + /* Check for wraparound. */ + + LDR r3, =_tx_timer_list_end // Pickup address of timer list end + LDR r2, [r3] // Pickup list end + CMP r0, r2 // Are we at list end? + BNE __tx_timer_skip_wrap // No, skip wraparound logic + + /* Wrap to beginning of list. */ + + LDR r3, =_tx_timer_list_start // Pickup address of timer list start + LDR r0, [r3] // Set current pointer to list start + +__tx_timer_skip_wrap: + + STR r0, [r1] // Store new current timer pointer + +__tx_timer_done: + + /* See if anything has expired. */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of expired flag + LDR r2, [r3] // Pickup time-slice expired flag + CMP r2, #0 // Did a time-slice expire? + BNE __tx_something_expired // If non-zero, time-slice expired + LDR r1, =_tx_timer_expired // Pickup address of other expired flag + LDR r0, [r1] // Pickup timer expired flag + CMP r0, #0 // Did a timer expire? + BEQ __tx_timer_nothing_expired // No, nothing expired + +__tx_something_expired: + + STMDB sp!, {r0, lr} // Save the lr register on the stack + // and save r0 just to keep 8-byte alignment + + /* Did a timer expire? */ + + LDR r1, =_tx_timer_expired // Pickup address of expired flag + LDR r0, [r1] // Pickup timer expired flag + CMP r0, #0 // Check for timer expiration + BEQ __tx_timer_dont_activate // If not set, skip timer activation + + /* Process timer expiration. */ + BL _tx_timer_expiration_process // Call the timer expiration handling routine + +__tx_timer_dont_activate: + + /* Did time slice expire? */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of time-slice expired + LDR r2, [r3] // Pickup the actual flag + CMP r2, #0 // See if the flag is set + BEQ __tx_timer_not_ts_expiration // No, skip time-slice processing + + /* Time slice interrupted thread. */ + + BL _tx_thread_time_slice // Call time-slice processing + +__tx_timer_not_ts_expiration: + + LDMIA sp!, {r0, lr} // Recover lr register (r0 is just there for + // the 8-byte stack alignment + +__tx_timer_nothing_expired: + +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a9/ac6/example_build/sample_threadx.c b/ports/cortex_a9/ac6/example_build/sample_threadx.c new file mode 100644 index 00000000..8c61de06 --- /dev/null +++ b/ports/cortex_a9/ac6/example_build/sample_threadx.c @@ -0,0 +1,369 @@ +/* This is a small demo of the high-performance ThreadX kernel. It includes examples of eight + threads of different priorities, using a message queue, semaphore, mutex, event flags group, + byte pool, and block pool. */ + +#include "tx_api.h" + +#define DEMO_STACK_SIZE 1024 +#define DEMO_BYTE_POOL_SIZE 9120 +#define DEMO_BLOCK_POOL_SIZE 100 +#define DEMO_QUEUE_SIZE 100 + + +/* Define the ThreadX object control blocks... */ + +TX_THREAD thread_0; +TX_THREAD thread_1; +TX_THREAD thread_2; +TX_THREAD thread_3; +TX_THREAD thread_4; +TX_THREAD thread_5; +TX_THREAD thread_6; +TX_THREAD thread_7; +TX_QUEUE queue_0; +TX_SEMAPHORE semaphore_0; +TX_MUTEX mutex_0; +TX_EVENT_FLAGS_GROUP event_flags_0; +TX_BYTE_POOL byte_pool_0; +TX_BLOCK_POOL block_pool_0; + + +/* Define the counters used in the demo application... */ + +ULONG thread_0_counter; +ULONG thread_1_counter; +ULONG thread_1_messages_sent; +ULONG thread_2_counter; +ULONG thread_2_messages_received; +ULONG thread_3_counter; +ULONG thread_4_counter; +ULONG thread_5_counter; +ULONG thread_6_counter; +ULONG thread_7_counter; + + +/* Define thread prototypes. */ + +void thread_0_entry(ULONG thread_input); +void thread_1_entry(ULONG thread_input); +void thread_2_entry(ULONG thread_input); +void thread_3_and_4_entry(ULONG thread_input); +void thread_5_entry(ULONG thread_input); +void thread_6_and_7_entry(ULONG thread_input); + + +/* Define main entry point. */ + +int main() +{ + + /* Enter the ThreadX kernel. */ + tx_kernel_enter(); +} + + +/* Define what the initial system looks like. */ + +void tx_application_define(void *first_unused_memory) +{ + +CHAR *pointer = TX_NULL; + + + /* Create a byte memory pool from which to allocate the thread stacks. */ + tx_byte_pool_create(&byte_pool_0, "byte pool 0", first_unused_memory, DEMO_BYTE_POOL_SIZE); + + /* Put system definition stuff in here, e.g. thread creates and other assorted + create information. */ + + /* Allocate the stack for thread 0. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create the main thread. */ + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, + 1, 1, TX_NO_TIME_SLICE, TX_AUTO_START); + + + /* Allocate the stack for thread 1. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create threads 1 and 2. These threads pass information through a ThreadX + message queue. It is also interesting to note that these threads have a time + slice. */ + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, DEMO_STACK_SIZE, + 16, 16, 4, TX_AUTO_START); + + /* Allocate the stack for thread 2. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, DEMO_STACK_SIZE, + 16, 16, 4, TX_AUTO_START); + + /* Allocate the stack for thread 3. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create threads 3 and 4. These threads compete for a ThreadX counting semaphore. + An interesting thing here is that both threads share the same instruction area. */ + tx_thread_create(&thread_3, "thread 3", thread_3_and_4_entry, 3, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 4. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + tx_thread_create(&thread_4, "thread 4", thread_3_and_4_entry, 4, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 5. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create thread 5. This thread simply pends on an event flag which will be set + by thread_0. */ + tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, + pointer, DEMO_STACK_SIZE, + 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 6. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + /* Create threads 6 and 7. These threads compete for a ThreadX mutex. */ + tx_thread_create(&thread_6, "thread 6", thread_6_and_7_entry, 6, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the stack for thread 7. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); + + tx_thread_create(&thread_7, "thread 7", thread_6_and_7_entry, 7, + pointer, DEMO_STACK_SIZE, + 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); + + /* Allocate the message queue. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_QUEUE_SIZE*sizeof(ULONG), TX_NO_WAIT); + + /* Create the message queue shared by threads 1 and 2. */ + tx_queue_create(&queue_0, "queue 0", TX_1_ULONG, pointer, DEMO_QUEUE_SIZE*sizeof(ULONG)); + + /* Create the semaphore used by threads 3 and 4. */ + tx_semaphore_create(&semaphore_0, "semaphore 0", 1); + + /* Create the event flags group used by threads 1 and 5. */ + tx_event_flags_create(&event_flags_0, "event flags 0"); + + /* Create the mutex used by thread 6 and 7 without priority inheritance. */ + tx_mutex_create(&mutex_0, "mutex 0", TX_NO_INHERIT); + + /* Allocate the memory for a small block pool. */ + tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_BLOCK_POOL_SIZE, TX_NO_WAIT); + + /* Create a block memory pool to allocate a message buffer from. */ + tx_block_pool_create(&block_pool_0, "block pool 0", sizeof(ULONG), pointer, DEMO_BLOCK_POOL_SIZE); + + /* Allocate a block and release the block memory. */ + tx_block_allocate(&block_pool_0, (VOID **) &pointer, TX_NO_WAIT); + + /* Release the block back to the pool. */ + tx_block_release(pointer); +} + + + +/* Define the test threads. */ + +void thread_0_entry(ULONG thread_input) +{ + +UINT status; + + + /* This thread simply sits in while-forever-sleep loop. */ + while(1) + { + + /* Increment the thread counter. */ + thread_0_counter++; + + /* Sleep for 10 ticks. */ + tx_thread_sleep(10); + + /* Set event flag 0 to wakeup thread 5. */ + status = tx_event_flags_set(&event_flags_0, 0x1, TX_OR); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + } +} + + +void thread_1_entry(ULONG thread_input) +{ + +UINT status; + + + /* This thread simply sends messages to a queue shared by thread 2. */ + while(1) + { + + /* Increment the thread counter. */ + thread_1_counter++; + + /* Send message to queue 0. */ + status = tx_queue_send(&queue_0, &thread_1_messages_sent, TX_WAIT_FOREVER); + + /* Check completion status. */ + if (status != TX_SUCCESS) + break; + + /* Increment the message sent. */ + thread_1_messages_sent++; + } +} + + +void thread_2_entry(ULONG thread_input) +{ + +ULONG received_message; +UINT status; + + /* This thread retrieves messages placed on the queue by thread 1. */ + while(1) + { + + /* Increment the thread counter. */ + thread_2_counter++; + + /* Retrieve a message from the queue. */ + status = tx_queue_receive(&queue_0, &received_message, TX_WAIT_FOREVER); + + /* Check completion status and make sure the message is what we + expected. */ + if ((status != TX_SUCCESS) || (received_message != thread_2_messages_received)) + break; + + /* Otherwise, all is okay. Increment the received message count. */ + thread_2_messages_received++; + } +} + + +void thread_3_and_4_entry(ULONG thread_input) +{ + +UINT status; + + + /* This function is executed from thread 3 and thread 4. As the loop + below shows, these function compete for ownership of semaphore_0. */ + while(1) + { + + /* Increment the thread counter. */ + if (thread_input == 3) + thread_3_counter++; + else + thread_4_counter++; + + /* Get the semaphore with suspension. */ + status = tx_semaphore_get(&semaphore_0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Sleep for 2 ticks to hold the semaphore. */ + tx_thread_sleep(2); + + /* Release the semaphore. */ + status = tx_semaphore_put(&semaphore_0); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + } +} + + +void thread_5_entry(ULONG thread_input) +{ + +UINT status; +ULONG actual_flags; + + + /* This thread simply waits for an event in a forever loop. */ + while(1) + { + + /* Increment the thread counter. */ + thread_5_counter++; + + /* Wait for event flag 0. */ + status = tx_event_flags_get(&event_flags_0, 0x1, TX_OR_CLEAR, + &actual_flags, TX_WAIT_FOREVER); + + /* Check status. */ + if ((status != TX_SUCCESS) || (actual_flags != 0x1)) + break; + } +} + + +void thread_6_and_7_entry(ULONG thread_input) +{ + +UINT status; + + + /* This function is executed from thread 6 and thread 7. As the loop + below shows, these function compete for ownership of mutex_0. */ + while(1) + { + + /* Increment the thread counter. */ + if (thread_input == 6) + thread_6_counter++; + else + thread_7_counter++; + + /* Get the mutex with suspension. */ + status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Get the mutex again with suspension. This shows + that an owning thread may retrieve the mutex it + owns multiple times. */ + status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Sleep for 2 ticks to hold the mutex. */ + tx_thread_sleep(2); + + /* Release the mutex. */ + status = tx_mutex_put(&mutex_0); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + + /* Release the mutex again. This will actually + release ownership since it was obtained twice. */ + status = tx_mutex_put(&mutex_0); + + /* Check status. */ + if (status != TX_SUCCESS) + break; + } +} diff --git a/ports/cortex_a9/ac6/example_build/sample_threadx/.cproject b/ports/cortex_a9/ac6/example_build/sample_threadx/.cproject index da15bba5..72d51c5b 100644 --- a/ports/cortex_a9/ac6/example_build/sample_threadx/.cproject +++ b/ports/cortex_a9/ac6/example_build/sample_threadx/.cproject @@ -3,9 +3,9 @@ - + - + @@ -23,37 +23,37 @@ - + - + - + - @@ -115,7 +119,7 @@ - + @@ -135,7 +139,7 @@ - + @@ -149,8 +153,6 @@ - - @@ -166,5 +168,9 @@ + + + + diff --git a/ports/cortex_a9/ac6/example_build/sample_threadx/.project b/ports/cortex_a9/ac6/example_build/sample_threadx/.project index 2a6b3cb1..ed4c0885 100644 --- a/ports/cortex_a9/ac6/example_build/sample_threadx/.project +++ b/ports/cortex_a9/ac6/example_build/sample_threadx/.project @@ -20,7 +20,6 @@ - com.arm.debug.ds.nature org.eclipse.cdt.core.cnature org.eclipse.cdt.managedbuilder.core.managedBuildNature org.eclipse.cdt.managedbuilder.core.ScannerConfigNature diff --git a/ports/cortex_a9/ac6/example_build/sample_threadx/sample_threadx.c b/ports/cortex_a9/ac6/example_build/sample_threadx/sample_threadx.c index 418ec634..8c61de06 100644 --- a/ports/cortex_a9/ac6/example_build/sample_threadx/sample_threadx.c +++ b/ports/cortex_a9/ac6/example_build/sample_threadx/sample_threadx.c @@ -1,5 +1,5 @@ /* This is a small demo of the high-performance ThreadX kernel. It includes examples of eight - threads of different priorities, using a message queue, semaphore, mutex, event flags group, + threads of different priorities, using a message queue, semaphore, mutex, event flags group, byte pool, and block pool. */ #include "tx_api.h" @@ -80,42 +80,42 @@ CHAR *pointer = TX_NULL; tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); /* Create the main thread. */ - tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, 1, 1, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 1. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - /* Create threads 1 and 2. These threads pass information through a ThreadX + /* Create threads 1 and 2. These threads pass information through a ThreadX message queue. It is also interesting to note that these threads have a time slice. */ - tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, DEMO_STACK_SIZE, 16, 16, 4, TX_AUTO_START); /* Allocate the stack for thread 2. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, DEMO_STACK_SIZE, 16, 16, 4, TX_AUTO_START); /* Allocate the stack for thread 3. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - /* Create threads 3 and 4. These threads compete for a ThreadX counting semaphore. + /* Create threads 3 and 4. These threads compete for a ThreadX counting semaphore. An interesting thing here is that both threads share the same instruction area. */ - tx_thread_create(&thread_3, "thread 3", thread_3_and_4_entry, 3, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_3, "thread 3", thread_3_and_4_entry, 3, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 4. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - tx_thread_create(&thread_4, "thread 4", thread_3_and_4_entry, 4, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_4, "thread 4", thread_3_and_4_entry, 4, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 5. */ @@ -123,23 +123,23 @@ CHAR *pointer = TX_NULL; /* Create thread 5. This thread simply pends on an event flag which will be set by thread_0. */ - tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, + pointer, DEMO_STACK_SIZE, 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 6. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); /* Create threads 6 and 7. These threads compete for a ThreadX mutex. */ - tx_thread_create(&thread_6, "thread 6", thread_6_and_7_entry, 6, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_6, "thread 6", thread_6_and_7_entry, 6, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 7. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - tx_thread_create(&thread_7, "thread 7", thread_6_and_7_entry, 7, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_7, "thread 7", thread_6_and_7_entry, 7, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the message queue. */ @@ -242,11 +242,11 @@ UINT status; /* Retrieve a message from the queue. */ status = tx_queue_receive(&queue_0, &received_message, TX_WAIT_FOREVER); - /* Check completion status and make sure the message is what we + /* Check completion status and make sure the message is what we expected. */ if ((status != TX_SUCCESS) || (received_message != thread_2_messages_received)) break; - + /* Otherwise, all is okay. Increment the received message count. */ thread_2_messages_received++; } @@ -305,7 +305,7 @@ ULONG actual_flags; thread_5_counter++; /* Wait for event flag 0. */ - status = tx_event_flags_get(&event_flags_0, 0x1, TX_OR_CLEAR, + status = tx_event_flags_get(&event_flags_0, 0x1, TX_OR_CLEAR, &actual_flags, TX_WAIT_FOREVER); /* Check status. */ @@ -358,7 +358,7 @@ UINT status; if (status != TX_SUCCESS) break; - /* Release the mutex again. This will actually + /* Release the mutex again. This will actually release ownership since it was obtained twice. */ status = tx_mutex_put(&mutex_0); diff --git a/ports/cortex_a9/ac6/example_build/sample_threadx/sample_threadx.launch b/ports/cortex_a9/ac6/example_build/sample_threadx/sample_threadx.launch new file mode 100644 index 00000000..d4805aef --- /dev/null +++ b/ports/cortex_a9/ac6/example_build/sample_threadx/sample_threadx.launch @@ -0,0 +1,188 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ports/cortex_a9/ac6/example_build/sample_threadx/sample_threadx.scat b/ports/cortex_a9/ac6/example_build/sample_threadx/sample_threadx.scat index 71410dbc..d23881cd 100644 --- a/ports/cortex_a9/ac6/example_build/sample_threadx/sample_threadx.scat +++ b/ports/cortex_a9/ac6/example_build/sample_threadx/sample_threadx.scat @@ -5,12 +5,10 @@ ; and your compliance with all applicable terms and conditions of such licence agreement. ;******************************************************* -; Scatter-file for Cortex-A9 bare-metal example on Versatile Express +; Scatter-file for ARMv7-A bare-metal example on Versatile Express ; This scatter-file places application code, data, stack and heap at suitable addresses in the memory map. -; Versatile Express with Cortex-A9 has 1GB SDRAM at 0x60000000 to 0x9FFFFFFF, which this scatter-file uses. - SDRAM 0x80000000 0x20000000 { @@ -35,11 +33,11 @@ SDRAM 0x80000000 0x20000000 ARM_LIB_HEAP 0x80040000 EMPTY 0x00040000 ; Application heap { } - ARM_LIB_STACK 0x80090000 EMPTY 0x00010000 ; Application (SVC mode) stack + ARM_LIB_STACK 0x80090000 EMPTY 0x00010000 ; Application (SVC mode) stack { } - ;IRQ_STACK 0x800A0000 EMPTY -0x00010000 ; IRQ mode stack - ;{ } +; IRQ_STACK 0x800A0000 EMPTY -0x00010000 ; IRQ mode stack +; { } TTB 0x80100000 EMPTY 0x4000 ; Level-1 Translation Table for MMU { } diff --git a/ports/cortex_a9/ac6/example_build/sample_threadx/startup.S b/ports/cortex_a9/ac6/example_build/sample_threadx/startup.S index 76ad6539..670fadb9 100644 --- a/ports/cortex_a9/ac6/example_build/sample_threadx/startup.S +++ b/ports/cortex_a9/ac6/example_build/sample_threadx/startup.S @@ -1,13 +1,12 @@ //---------------------------------------------------------------- -// Cortex-A9 Embedded example - Startup Code +// ARMv7-A Embedded example - Startup Code // // Copyright (c) 2005-2018 Arm Limited (or its affiliates). All rights reserved. // Use, modification and redistribution of this file is subject to your possession of a -// valid End User License Agreement for the Arm Product of which these examples are part of +// valid End User License Agreement for the Arm Product of which these examples are part of // and your compliance with all applicable terms and conditions of such licence agreement. //---------------------------------------------------------------- - // Standard definitions of mode bits and interrupt (I & F) flags in PSRs #define Mode_USR 0x10 @@ -26,7 +25,7 @@ .align 3 .cfi_sections .debug_frame // put stack frame info into .debug_frame instead of .eh_frame - + //---------------------------------------------------------------- // Entry point for the Reset handler //---------------------------------------------------------------- @@ -45,7 +44,7 @@ Vectors: LDR PC, SVC_Addr LDR PC, Prefetch_Addr LDR PC, Abort_Addr - B . // Reserved vector + LDR PC, Hypervisor_Addr LDR PC, IRQ_Addr LDR PC, FIQ_Addr @@ -54,22 +53,18 @@ Vectors: Reset_Addr: .word Reset_Handler Undefined_Addr: - //.word Undefined_Handler .word __tx_undefined SVC_Addr: - //.word SVC_Handler .word __tx_swi_interrupt Prefetch_Addr: - //.word Prefetch_Handler .word __tx_prefetch_handler Abort_Addr: - //.word Abort_Handler .word __tx_abort_handler +Hypervisor_Addr: + .word __tx_reserved_handler IRQ_Addr: - //.word IRQ_Handler .word __tx_irq_handler FIQ_Addr: - //.word FIQ_Handler .word __tx_fiq_handler @@ -85,21 +80,21 @@ Prefetch_Handler: B Prefetch_Handler Abort_Handler: B Abort_Handler +Hypervisor_Handler: + B Hypervisor_Handler IRQ_Handler: B IRQ_Handler FIQ_Handler: B FIQ_Handler - - //---------------------------------------------------------------- // Reset Handler //---------------------------------------------------------------- Reset_Handler: //---------------------------------------------------------------- -// Disable caches, MMU and branch prediction in case they were left enabled from an earlier run +// Disable caches and MMU in case they were left enabled from an earlier run // This does not need to be done from a cold reset //---------------------------------------------------------------- @@ -107,13 +102,31 @@ Reset_Handler: BIC r0, r0, #(0x1 << 12) // Clear I bit 12 to disable I Cache BIC r0, r0, #(0x1 << 2) // Clear C bit 2 to disable D Cache BIC r0, r0, #0x1 // Clear M bit 0 to disable MMU - BIC r0, r0, #(0x1 << 11) // Clear Z bit 11 to disable branch prediction + BIC r0, r0, #(0x1 << 11) // Clear Z bit 11 to disable branch prediction MCR p15, 0, r0, c1, c0, 0 // Write System Control Register ISB -// The MMU is enabled later, before calling main(). Caches and branch prediction are enabled inside main(), +// The MMU is enabled later, before calling main(). Caches are enabled inside main(), // after the MMU has been enabled and scatterloading has been performed. +//---------------------------------------------------------------- +// ACTLR.SMP bit must be set before the caches and MMU are enabled, +// or any cache and TLB maintenance operations are performed, even for single-core +//---------------------------------------------------------------- + MRC p15, 0, r0, c1, c0, 1 // Read ACTLR + ORR r0, r0, #(1 << 6) // Set ACTLR.SMP bit + MCR p15, 0, r0, c1, c0, 1 // Write ACTLR + ISB + +//---------------------------------------------------------------- +// Invalidate Data and Instruction TLBs and branch predictor +// This does not need to be done from a cold reset +//---------------------------------------------------------------- + + MOV r0,#0 + MCR p15, 0, r0, c8, c7, 0 // I-TLB and D-TLB invalidation + MCR p15, 0, r0, c7, c5, 6 // BPIALL - Invalidate entire branch predictor array + //---------------------------------------------------------------- // Initialize Supervisor Mode Stack // Note stack must be 8 byte aligned. @@ -122,12 +135,24 @@ Reset_Handler: LDR SP, =Image$$ARM_LIB_STACK$$ZI$$Limit //---------------------------------------------------------------- -// Invalidate Data and Instruction TLBs and branch predictor +// Disable loop-buffer to fix errata on A15 r0p0 //---------------------------------------------------------------- - - MOV r0,#0 - MCR p15, 0, r0, c8, c7, 0 // I-TLB and D-TLB invalidation - MCR p15, 0, r0, c7, c5, 6 // BPIALL - Invalidate entire branch predictor array + MRC p15, 0, r0, c0, c0, 0 // Read main ID register MIDR + MOV r1, r0, lsr #4 // Extract Primary Part Number + LDR r2, =0xFFF + AND r1, r1, r2 + LDR r2, =0xC0F + CMP r1, r2 // Is this an A15? + BNE notA15r0p0 // Jump if not A15 + AND r5, r0, #0x00f00000 // Variant + AND r6, r0, #0x0000000f // Revision + ORRS r6, r6, r5 // Combine variant and revision + BNE notA15r0p0 // Jump if not r0p0 + MRC p15, 0, r0, c1, c0, 1 // Read Aux Ctrl Reg + ORR r0, r0, #(1 << 1) // Set bit 1 to Disable Loop Buffer + MCR p15, 0, r0, c1, c0, 1 // Write Aux Ctrl Reg + ISB +notA15r0p0: //---------------------------------------------------------------- // Set Vector Base Address Register (VBAR) to point to this application's vector table @@ -137,7 +162,9 @@ Reset_Handler: MCR p15, 0, r0, c12, c0, 0 //---------------------------------------------------------------- -// Cache Invalidation code for Cortex-A9 +// Cache Invalidation code for ARMv7-A +// The caches, MMU and BTB do not need post-reset invalidation on Cortex-A7, +// but forcing a cache invalidation makes the code more portable to other CPUs (e.g. Cortex-A9) //---------------------------------------------------------------- // Invalidate L1 Instruction Cache @@ -206,16 +233,18 @@ Finished: // write the address of our page table base to TTB register 0 LDR r0,=Image$$TTB$$ZI$$Base + MOV r1, #0x08 // RGN=b01 (outer cacheable write-back cached, write allocate) // S=0 (translation table walk to non-shared memory) ORR r1,r1,#0x40 // IRGN=b01 (inner cacheability for the translation table walk is Write-back Write-allocate) ORR r0,r0,r1 + MCR p15, 0, r0, c2, c0, 0 //---------------------------------------------------------------- -// PAGE TABLE generation +// PAGE TABLE generation // Generate the page tables // Build a flat translation table for the whole address space. @@ -228,7 +257,7 @@ Finished: // Bits[31:20] - Top 12 bits of VA is pointer into table // nG[17]=0 - Non global, enables matching against ASID in the TLB when set. // S[16]=0 - Indicates normal memory is shared when set. -// AP2[15]=0 +// AP2[15]=0 // AP[11:10]=11 - Configure for full read/write access in all modes // TEX[14:12]=000 // CB[3:2]= 00 - Set attributes to Strongly-ordered memory. @@ -247,7 +276,7 @@ Finished: // r2 is level1 descriptor (bits 19:0) // use loop counter to create 4096 individual table entries. - // this writes from address 'Image$$TTB$$ZI$$Base' + + // this writes from address 'Image$$TTB$$ZI$$Base' + // offset 0x3FFC down to offset 0x0 in word steps (4 bytes) init_ttb_1: @@ -344,12 +373,8 @@ enable_caches: MCR p15, 0, r0, c1, c0, 0 // Write System Control Register ISB - -//---------------------------------------------------------------- -// Enable L1 D-side prefetch (A9 specific) -//---------------------------------------------------------------- - MRC p15, 0, r0, c1, c0, 1 // Read Auxiliary Control Register + ORR r0, #2 // L2EN bit, enable L2 cache ORR r0, r0, #(0x1 << 2) // Set DP bit 2 to enable L1 Dside prefetch MCR p15, 0, r0, c1, c0, 1 // Write Auxiliary Control Register ISB @@ -357,3 +382,16 @@ enable_caches: BX lr .cfi_endproc + .global disable_caches + .type disable_caches, "function" +disable_caches: + + MRC p15, 0, r0, c1, c0, 0 // Read System Control Register + BIC r0, r0, #(0x1 << 12) // Clear I bit 12 to disable I Cache + BIC r0, r0, #(0x1 << 2) // Clear C bit 2 to disable D Cache + MCR p15, 0, r0, c1, c0, 0 // Write System Control Register + ISB + + BX lr + + diff --git a/ports/cortex_a9/ac6/example_build/sample_threadx/tx_initialize_low_level.S b/ports/cortex_a9/ac6/example_build/sample_threadx/tx_initialize_low_level.S index e3907d1e..715958f0 100644 --- a/ports/cortex_a9/ac6/example_build/sample_threadx/tx_initialize_low_level.S +++ b/ports/cortex_a9/ac6/example_build/sample_threadx/tx_initialize_low_level.S @@ -1,345 +1,299 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Initialize */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_initialize.h" -@#include "tx_thread.h" -@#include "tx_timer.h" +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Initialize */ +/** */ +/**************************************************************************/ +/**************************************************************************/ .arm -SVC_MODE = 0xD3 @ Disable IRQ/FIQ SVC mode -IRQ_MODE = 0xD2 @ Disable IRQ/FIQ IRQ mode -FIQ_MODE = 0xD1 @ Disable IRQ/FIQ FIQ mode -SYS_MODE = 0xDF @ Disable IRQ/FIQ SYS mode -FIQ_STACK_SIZE = 512 @ FIQ stack size -IRQ_STACK_SIZE = 1024 @ IRQ stack size -SYS_STACK_SIZE = 1024 @ System stack size -@ -@ +SVC_MODE = 0xD3 // Disable IRQ/FIQ SVC mode +IRQ_MODE = 0xD2 // Disable IRQ/FIQ IRQ mode +FIQ_MODE = 0xD1 // Disable IRQ/FIQ FIQ mode +SYS_MODE = 0xDF // Disable IRQ/FIQ SYS mode +FIQ_STACK_SIZE = 512 // FIQ stack size +IRQ_STACK_SIZE = 1024 // IRQ stack size +SYS_STACK_SIZE = 1024 // System stack size + .global _tx_thread_system_stack_ptr .global _tx_initialize_unused_memory .global _tx_thread_context_save .global _tx_thread_context_restore .global _tx_timer_interrupt -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_initialize_low_level for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + + +/* Define the 16-bit Thumb mode veneer for _tx_initialize_low_level for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .thumb .global $_tx_initialize_low_level .type $_tx_initialize_low_level,function $_tx_initialize_low_level: - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_initialize_low_level @ Call _tx_initialize_low_level function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_initialize_low_level // Call _tx_initialize_low_level function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_initialize_low_level Cortex-A9/AC6 */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is responsible for any low-level processor */ -@/* initialization, including setting up interrupt vectors, setting */ -@/* up a periodic timer interrupt source, saving the system stack */ -@/* pointer for use in ISR processing later, and finding the first */ -@/* available RAM memory address for tx_application_define. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* _tx_initialize_kernel_enter ThreadX entry function */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_initialize_low_level(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_initialize_low_level ARMV7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for any low-level processor */ +/* initialization, including setting up interrupt vectors, setting */ +/* up a periodic timer interrupt source, saving the system stack */ +/* pointer for use in ISR processing later, and finding the first */ +/* available RAM memory address for tx_application_define. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_initialize_kernel_enter ThreadX entry function */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_initialize_low_level .type _tx_initialize_low_level,function _tx_initialize_low_level: -@ -@ /* We must be in SVC mode at this point! */ -@ -@ /* Setup various stack pointers. */ -@ - LDR r1, =Image$$ARM_LIB_STACK$$ZI$$Limit @ Get pointer to stack area -#ifdef TX_ENABLE_IRQ_NESTING -@ -@ /* Setup the system mode stack for nested interrupt support */ -@ - LDR r2, =SYS_STACK_SIZE @ Pickup stack size - MOV r3, #SYS_MODE @ Build SYS mode CPSR - MSR CPSR_c, r3 @ Enter SYS mode - SUB r1, r1, #1 @ Backup 1 byte - BIC r1, r1, #7 @ Ensure 8-byte alignment - MOV sp, r1 @ Setup SYS stack pointer - SUB r1, r1, r2 @ Calculate start of next stack + /* We must be in SVC mode at this point! */ + + /* Setup various stack pointers. */ + + LDR r1, =Image$$ARM_LIB_STACK$$ZI$$Limit // Get pointer to stack area + +#ifdef TX_ENABLE_IRQ_NESTING + + /* Setup the system mode stack for nested interrupt support */ + + LDR r2, =SYS_STACK_SIZE // Pickup stack size + MOV r3, #SYS_MODE // Build SYS mode CPSR + MSR CPSR_c, r3 // Enter SYS mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup SYS stack pointer + SUB r1, r1, r2 // Calculate start of next stack #endif - LDR r2, =FIQ_STACK_SIZE @ Pickup stack size - MOV r0, #FIQ_MODE @ Build FIQ mode CPSR - MSR CPSR, r0 @ Enter FIQ mode - SUB r1, r1, #1 @ Backup 1 byte - BIC r1, r1, #7 @ Ensure 8-byte alignment - MOV sp, r1 @ Setup FIQ stack pointer - SUB r1, r1, r2 @ Calculate start of next stack - LDR r2, =IRQ_STACK_SIZE @ Pickup IRQ stack size - MOV r0, #IRQ_MODE @ Build IRQ mode CPSR - MSR CPSR, r0 @ Enter IRQ mode - SUB r1, r1, #1 @ Backup 1 byte - BIC r1, r1, #7 @ Ensure 8-byte alignment - MOV sp, r1 @ Setup IRQ stack pointer - SUB r3, r1, r2 @ Calculate end of IRQ stack - MOV r0, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR, r0 @ Enter SVC mode - LDR r2, =Image$$ARM_LIB_STACK$$Base @ Pickup stack bottom - CMP r3, r2 @ Compare the current stack end with the bottom -_stack_error_loop: - BLT _stack_error_loop @ If the IRQ stack exceeds the stack bottom, just sit here! -@ -@ /* Save the system stack pointer. */ -@ _tx_thread_system_stack_ptr = (VOID_PTR) (sp); -@ - LDR r2, =_tx_thread_system_stack_ptr @ Pickup stack pointer - STR r1, [r2] @ Save the system stack -@ -@ /* Save the first available memory address. */ -@ _tx_initialize_unused_memory = (VOID_PTR) _end; -@ - LDR r1, =Image$$ZI_DATA$$ZI$$Limit @ Get end of non-initialized RAM area - LDR r2, =_tx_initialize_unused_memory @ Pickup unused memory ptr address - ADD r1, r1, #8 @ Increment to next free word - STR r1, [r2] @ Save first free memory address -@ -@ /* Setup Timer for periodic interrupts. */ -@ -@ /* Done, return to caller. */ -@ + LDR r2, =FIQ_STACK_SIZE // Pickup stack size + MOV r0, #FIQ_MODE // Build FIQ mode CPSR + MSR CPSR, r0 // Enter FIQ mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup FIQ stack pointer + SUB r1, r1, r2 // Calculate start of next stack + LDR r2, =IRQ_STACK_SIZE // Pickup IRQ stack size + MOV r0, #IRQ_MODE // Build IRQ mode CPSR + MSR CPSR, r0 // Enter IRQ mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup IRQ stack pointer + SUB r3, r1, r2 // Calculate end of IRQ stack + MOV r0, #SVC_MODE // Build SVC mode CPSR + MSR CPSR, r0 // Enter SVC mode + LDR r2, =Image$$ARM_LIB_STACK$$Base // Pickup stack bottom + CMP r3, r2 // Compare the current stack end with the bottom +_stack_error_loop: + BLT _stack_error_loop // If the IRQ stack exceeds the stack bottom, just sit here! + + LDR r2, =_tx_thread_system_stack_ptr // Pickup stack pointer + STR r1, [r2] // Save the system stack + + LDR r1, =Image$$ZI_DATA$$ZI$$Limit // Get end of non-initialized RAM area + LDR r2, =_tx_initialize_unused_memory // Pickup unused memory ptr address + ADD r1, r1, #8 // Increment to next free word + STR r1, [r2] // Save first free memory address + #ifdef __THUMB_INTERWORK - BX lr @ Return to caller + BX lr // Return to caller #else - MOV pc, lr @ Return to caller + MOV pc, lr // Return to caller #endif -@} -@ -@ -@/* Define shells for each of the interrupt vectors. */ -@ + +/* Define shells for each of the interrupt vectors. */ + .global __tx_undefined __tx_undefined: - B __tx_undefined @ Undefined handler -@ + B __tx_undefined // Undefined handler + .global __tx_swi_interrupt __tx_swi_interrupt: - B __tx_swi_interrupt @ Software interrupt handler -@ + B __tx_swi_interrupt // Software interrupt handler + .global __tx_prefetch_handler __tx_prefetch_handler: - B __tx_prefetch_handler @ Prefetch exception handler -@ + B __tx_prefetch_handler // Prefetch exception handler + .global __tx_abort_handler __tx_abort_handler: - B __tx_abort_handler @ Abort exception handler -@ + B __tx_abort_handler // Abort exception handler + .global __tx_reserved_handler __tx_reserved_handler: - B __tx_reserved_handler @ Reserved exception handler -@ - .global __tx_irq_processing_return + B __tx_reserved_handler // Reserved exception handler + + .global __tx_irq_processing_return .type __tx_irq_processing_return,function .global __tx_irq_handler __tx_irq_handler: -@ -@ /* Jump to context save to save system context. */ + + /* Jump to context save to save system context. */ B _tx_thread_context_save __tx_irq_processing_return: -@ -@ /* At this point execution is still in the IRQ mode. The CPSR, point of -@ interrupt, and all C scratch registers are available for use. In -@ addition, IRQ interrupts may be re-enabled - with certain restrictions - -@ if nested IRQ interrupts are desired. Interrupts may be re-enabled over -@ small code sequences where lr is saved before enabling interrupts and -@ restored after interrupts are again disabled. */ -@ -@ /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start -@ from IRQ mode with interrupts disabled. This routine switches to the -@ system mode and returns with IRQ interrupts enabled. -@ -@ NOTE: It is very important to ensure all IRQ interrupts are cleared -@ prior to enabling nested IRQ interrupts. */ + + /* At this point execution is still in the IRQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. In + addition, IRQ interrupts may be re-enabled - with certain restrictions - + if nested IRQ interrupts are desired. Interrupts may be re-enabled over + small code sequences where lr is saved before enabling interrupts and + restored after interrupts are again disabled. */ + + /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start + from IRQ mode with interrupts disabled. This routine switches to the + system mode and returns with IRQ interrupts enabled. + + NOTE: It is very important to ensure all IRQ interrupts are cleared + prior to enabling nested IRQ interrupts. */ #ifdef TX_ENABLE_IRQ_NESTING BL _tx_thread_irq_nesting_start #endif -@ -@ /* For debug purpose, execute the timer interrupt processing here. In -@ a real system, some kind of status indication would have to be checked -@ before the timer interrupt handler could be called. */ -@ - BL _tx_timer_interrupt @ Timer interrupt handler -@ -@ -@ /* If interrupt nesting was started earlier, the end of interrupt nesting -@ service must be called before returning to _tx_thread_context_restore. -@ This routine returns in processing in IRQ mode with interrupts disabled. */ + + /* For debug purpose, execute the timer interrupt processing here. In + a real system, some kind of status indication would have to be checked + before the timer interrupt handler could be called. */ + + BL _tx_timer_interrupt // Timer interrupt handler + + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_context_restore. + This routine returns in processing in IRQ mode with interrupts disabled. */ #ifdef TX_ENABLE_IRQ_NESTING BL _tx_thread_irq_nesting_end #endif -@ -@ /* Jump to context restore to restore system context. */ + + /* Jump to context restore to restore system context. */ B _tx_thread_context_restore -@ -@ -@ /* This is an example of a vectored IRQ handler. */ -@ -@ .global __tx_example_vectored_irq_handler -@__tx_example_vectored_irq_handler: -@ -@ -@ /* Save initial context and call context save to prepare for -@ vectored ISR execution. */ -@ -@ STMDB sp!, {r0-r3} @ Save some scratch registers -@ MRS r0, SPSR @ Pickup saved SPSR -@ SUB lr, lr, #4 @ Adjust point of interrupt -@ STMDB sp!, {r0, r10, r12, lr} @ Store other scratch registers -@ BL _tx_thread_vectored_context_save @ Vectored context save -@ -@ /* At this point execution is still in the IRQ mode. The CPSR, point of -@ interrupt, and all C scratch registers are available for use. In -@ addition, IRQ interrupts may be re-enabled - with certain restrictions - -@ if nested IRQ interrupts are desired. Interrupts may be re-enabled over -@ small code sequences where lr is saved before enabling interrupts and -@ restored after interrupts are again disabled. */ -@ -@ -@ /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start -@ from IRQ mode with interrupts disabled. This routine switches to the -@ system mode and returns with IRQ interrupts enabled. -@ -@ NOTE: It is very important to ensure all IRQ interrupts are cleared -@ prior to enabling nested IRQ interrupts. */ -@#ifdef TX_ENABLE_IRQ_NESTING -@ BL _tx_thread_irq_nesting_start -@#endif -@ -@ /* Application IRQ handlers can be called here! */ -@ -@ /* If interrupt nesting was started earlier, the end of interrupt nesting -@ service must be called before returning to _tx_thread_context_restore. -@ This routine returns in processing in IRQ mode with interrupts disabled. */ -@#ifdef TX_ENABLE_IRQ_NESTING -@ BL _tx_thread_irq_nesting_end -@#endif -@ -@ /* Jump to context restore to restore system context. */ -@ B _tx_thread_context_restore -@ -@ + + + /* This is an example of a vectored IRQ handler. */ + + /* At this point execution is still in the IRQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. In + addition, IRQ interrupts may be re-enabled - with certain restrictions - + if nested IRQ interrupts are desired. Interrupts may be re-enabled over + small code sequences where lr is saved before enabling interrupts and + restored after interrupts are again disabled. */ + + + /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start + from IRQ mode with interrupts disabled. This routine switches to the + system mode and returns with IRQ interrupts enabled. + + NOTE: It is very important to ensure all IRQ interrupts are cleared + prior to enabling nested IRQ interrupts. */ + + /* Application IRQ handlers can be called here! */ + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_context_restore. + This routine returns in processing in IRQ mode with interrupts disabled. */ + + /* Jump to context restore to restore system context. */ + #ifdef TX_ENABLE_FIQ_SUPPORT .global __tx_fiq_handler .global __tx_fiq_processing_return __tx_fiq_handler: -@ -@ /* Jump to fiq context save to save system context. */ + + /* Jump to fiq context save to save system context. */ B _tx_thread_fiq_context_save __tx_fiq_processing_return: -@ -@ /* At this point execution is still in the FIQ mode. The CPSR, point of -@ interrupt, and all C scratch registers are available for use. */ -@ -@ /* Interrupt nesting is allowed after calling _tx_thread_fiq_nesting_start -@ from FIQ mode with interrupts disabled. This routine switches to the -@ system mode and returns with FIQ interrupts enabled. -@ -@ NOTE: It is very important to ensure all FIQ interrupts are cleared -@ prior to enabling nested FIQ interrupts. */ + + /* At this point execution is still in the FIQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. */ + + /* Interrupt nesting is allowed after calling _tx_thread_fiq_nesting_start + from FIQ mode with interrupts disabled. This routine switches to the + system mode and returns with FIQ interrupts enabled. + + NOTE: It is very important to ensure all FIQ interrupts are cleared + prior to enabling nested FIQ interrupts. */ #ifdef TX_ENABLE_FIQ_NESTING BL _tx_thread_fiq_nesting_start #endif -@ -@ /* Application FIQ handlers can be called here! */ -@ -@ /* If interrupt nesting was started earlier, the end of interrupt nesting -@ service must be called before returning to _tx_thread_fiq_context_restore. */ + + /* Application FIQ handlers can be called here! */ + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_fiq_context_restore. */ #ifdef TX_ENABLE_FIQ_NESTING BL _tx_thread_fiq_nesting_end #endif -@ -@ /* Jump to fiq context restore to restore system context. */ + + /* Jump to fiq context restore to restore system context. */ B _tx_thread_fiq_context_restore -@ -@ + + #else .global __tx_fiq_handler __tx_fiq_handler: - B __tx_fiq_handler @ FIQ interrupt handler + B __tx_fiq_handler // FIQ interrupt handler #endif -@ -@ + + BUILD_OPTIONS: - .word _tx_build_options @ Reference to bring in + .word _tx_build_options // Reference to bring in VERSION_ID: - .word _tx_version_id @ Reference to bring in - + .word _tx_version_id // Reference to bring in diff --git a/ports/cortex_a9/ac6/example_build/tx/.cproject b/ports/cortex_a9/ac6/example_build/tx/.cproject index 40ccf832..52a6e44b 100644 --- a/ports/cortex_a9/ac6/example_build/tx/.cproject +++ b/ports/cortex_a9/ac6/example_build/tx/.cproject @@ -3,9 +3,9 @@ - + - + @@ -23,37 +23,37 @@ - + - + - + - @@ -111,7 +111,7 @@ - + @@ -123,6 +123,10 @@ + + + + @@ -138,9 +142,5 @@ - - - - diff --git a/ports/cortex_a9/ac6/inc/tx_port.h b/ports/cortex_a9/ac6/inc/tx_port.h index e685bc6f..19463de1 100644 --- a/ports/cortex_a9/ac6/inc/tx_port.h +++ b/ports/cortex_a9/ac6/inc/tx_port.h @@ -12,7 +12,7 @@ /**************************************************************************/ /**************************************************************************/ -/** */ +/** */ /** ThreadX Component */ /** */ /** Port Specific */ @@ -21,36 +21,38 @@ /**************************************************************************/ -/**************************************************************************/ -/* */ -/* PORT SPECIFIC C INFORMATION RELEASE */ -/* */ -/* tx_port.h Cortex-A9/AC6 */ -/* 6.1.6 */ +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* tx_port.h ARMv7-A */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ /* */ /* DESCRIPTION */ -/* */ -/* This file contains data type definitions that make the ThreadX */ -/* real-time kernel function identically on a variety of different */ -/* processor architectures. For example, the size or number of bits */ -/* in an "int" data type vary between microprocessor architectures and */ -/* even C compilers for the same microprocessor. ThreadX does not */ -/* directly use native C data types. Instead, ThreadX creates its */ -/* own special types that can be mapped to actual data types by this */ -/* file to guarantee consistency in the interface and functionality. */ -/* */ -/* RELEASE HISTORY */ -/* */ +/* */ +/* This file contains data type definitions that make the ThreadX */ +/* real-time kernel function identically on a variety of different */ +/* processor architectures. For example, the size or number of bits */ +/* in an "int" data type vary between microprocessor architectures and */ +/* even C compilers for the same microprocessor. ThreadX does not */ +/* directly use native C data types. Instead, ThreadX creates its */ +/* own special types that can be mapped to actual data types by this */ +/* file to guarantee consistency in the interface and functionality. */ +/* */ +/* RELEASE HISTORY */ +/* */ /* DATE NAME DESCRIPTION */ /* */ /* 09-30-2020 William E. Lamie Initial Version 6.1 */ /* 04-02-2021 Bhupendra Naphade Modified comment(s),updated */ /* macro definition, */ /* resulting in version 6.1.6 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -63,7 +65,7 @@ #ifdef TX_INCLUDE_USER_DEFINE_FILE -/* Yes, include the user defines in tx_user.h. The defines in this file may +/* Yes, include the user defines in tx_user.h. The defines in this file may alternately be defined on the command line. */ #include "tx_user.h" @@ -76,7 +78,7 @@ #include -/* Define ThreadX basic types for this port. */ +/* Define ThreadX basic types for this port. */ #define VOID void typedef char CHAR; @@ -112,12 +114,12 @@ typedef unsigned short USHORT; #define TX_TIMER_THREAD_STACK_SIZE 1024 /* Default timer thread stack size */ #endif -#ifndef TX_TIMER_THREAD_PRIORITY -#define TX_TIMER_THREAD_PRIORITY 0 /* Default timer thread priority */ +#ifndef TX_TIMER_THREAD_PRIORITY +#define TX_TIMER_THREAD_PRIORITY 0 /* Default timer thread priority */ #endif -/* Define various constants for the ThreadX ARM port. */ +/* Define various constants for the ThreadX ARM port. */ #ifdef TX_ENABLE_FIQ_SUPPORT #define TX_INT_DISABLE 0xC0 /* Disable IRQ & FIQ interrupts */ @@ -127,8 +129,8 @@ typedef unsigned short USHORT; #define TX_INT_ENABLE 0x00 /* Enable IRQ interrupts */ -/* Define the clock source for trace event entry time stamp. The following two item are port specific. - For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock +/* Define the clock source for trace event entry time stamp. The following two item are port specific. + For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: #define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) @@ -175,7 +177,7 @@ typedef unsigned short USHORT; #define TX_INLINE_INITIALIZATION -/* Determine whether or not stack checking is enabled. By default, ThreadX stack checking is +/* Determine whether or not stack checking is enabled. By default, ThreadX stack checking is disabled. When the following is defined, ThreadX thread stack checking is enabled. If stack checking is enabled (TX_ENABLE_STACK_CHECKING is defined), the TX_DISABLE_STACK_FILLING define is negated, thereby forcing the stack fill which is necessary for the stack checking @@ -187,13 +189,13 @@ typedef unsigned short USHORT; /* Define the TX_THREAD control block extensions for this port. The main reason - for the multiple macros is so that backward compatibility can be maintained with + for the multiple macros is so that backward compatibility can be maintained with existing ThreadX kernel awareness modules. */ -#define TX_THREAD_EXTENSION_0 -#define TX_THREAD_EXTENSION_1 +#define TX_THREAD_EXTENSION_0 +#define TX_THREAD_EXTENSION_1 #define TX_THREAD_EXTENSION_2 ULONG tx_thread_vfp_enable; -#define TX_THREAD_EXTENSION_3 +#define TX_THREAD_EXTENSION_3 /* Define the port extensions of the remaining ThreadX objects. */ @@ -207,11 +209,11 @@ typedef unsigned short USHORT; #define TX_TIMER_EXTENSION -/* Define the user extension field of the thread control block. Nothing +/* Define the user extension field of the thread control block. Nothing additional is needed for this port so it is defined as white space. */ #ifndef TX_THREAD_USER_EXTENSION -#define TX_THREAD_USER_EXTENSION +#define TX_THREAD_USER_EXTENSION #endif @@ -219,8 +221,8 @@ typedef unsigned short USHORT; tx_thread_shell_entry, and tx_thread_terminate. */ -#define TX_THREAD_CREATE_EXTENSION(thread_ptr) -#define TX_THREAD_DELETE_EXTENSION(thread_ptr) +#define TX_THREAD_CREATE_EXTENSION(thread_ptr) +#define TX_THREAD_DELETE_EXTENSION(thread_ptr) #define TX_THREAD_COMPLETED_EXTENSION(thread_ptr) #define TX_THREAD_TERMINATED_EXTENSION(thread_ptr) @@ -247,24 +249,24 @@ typedef unsigned short USHORT; #define TX_TIMER_DELETE_EXTENSION(timer_ptr) -/* Determine if the ARM architecture has the CLZ instruction. This is available on - architectures v5 and above. If available, redefine the macro for calculating the +/* Determine if the ARM architecture has the CLZ instruction. This is available on + architectures v5 and above. If available, redefine the macro for calculating the lowest bit set. */ - + #if __TARGET_ARCH_ARM > 4 #ifndef __thumb__ #define TX_LOWEST_SET_BIT_CALCULATE(m, b) m = m & ((ULONG) (-((LONG) m))); \ asm volatile (" CLZ %0,%1 ": "=r" (b) : "r" (m) ); \ - b = 31 - b; + b = 31 - b; #endif #endif -/* Define ThreadX interrupt lockout and restore macros for protection on - access of critical kernel information. The restore interrupt macro must - restore the interrupt posture of the running thread prior to the value +/* Define ThreadX interrupt lockout and restore macros for protection on + access of critical kernel information. The restore interrupt macro must + restore the interrupt posture of the running thread prior to the value present prior to the disable macro. In most cases, the save area macro is used to define a local function save area for the disable and restore macros. */ @@ -295,7 +297,7 @@ unsigned int _tx_thread_interrupt_restore(UINT old_posture); #endif -/* Define VFP extension for the Cortex-A9. Each is assumed to be called in the context of the executing +/* Define VFP extension for the ARMv7-A. Each is assumed to be called in the context of the executing thread. */ void tx_thread_vfp_enable(void); @@ -315,8 +317,8 @@ void tx_thread_vfp_disable(void); /* Define the version ID of ThreadX. This may be utilized by the application. */ #ifdef TX_THREAD_INIT -CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-A9/AC6 Version 6.1.9 *"; +CHAR _tx_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX ARMv7-A Version 6.1.11 *"; #else extern CHAR _tx_version_id[]; #endif diff --git a/ports/cortex_a9/ac6/src/tx_thread_context_restore.S b/ports/cortex_a9/ac6/src/tx_thread_context_restore.S index 1385cff1..fae7e72d 100644 --- a/ports/cortex_a9/ac6/src/tx_thread_context_restore.S +++ b/ports/cortex_a9/ac6/src/tx_thread_context_restore.S @@ -1,259 +1,222 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .arm #ifdef TX_ENABLE_FIQ_SUPPORT -SVC_MODE = 0xD3 @ Disable IRQ/FIQ, SVC mode -IRQ_MODE = 0xD2 @ Disable IRQ/FIQ, IRQ mode +SVC_MODE = 0xD3 // Disable IRQ/FIQ, SVC mode +IRQ_MODE = 0xD2 // Disable IRQ/FIQ, IRQ mode #else -SVC_MODE = 0x93 @ Disable IRQ, SVC mode -IRQ_MODE = 0x92 @ Disable IRQ, IRQ mode +SVC_MODE = 0x93 // Disable IRQ, SVC mode +IRQ_MODE = 0x92 // Disable IRQ, IRQ mode #endif -@ + .global _tx_thread_system_state .global _tx_thread_current_ptr .global _tx_thread_execute_ptr .global _tx_timer_time_slice .global _tx_thread_schedule .global _tx_thread_preempt_disable -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_restore -@ since it will never be called 16-bit mode. */ -@ + + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_restore + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_context_restore Cortex-A9/AC6 */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function restores the interrupt context if it is processing a */ -@/* nested interrupt. If not, it returns to the interrupt thread if no */ -@/* preemption is necessary. Otherwise, if preemption is necessary or */ -@/* if no thread was running, the function returns to the scheduler. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* _tx_thread_schedule Thread scheduling routine */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs Interrupt Service Routines */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_context_restore(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_context_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function restores the interrupt context if it is processing a */ +/* nested interrupt. If not, it returns to the interrupt thread if no */ +/* preemption is necessary. Otherwise, if preemption is necessary or */ +/* if no thread was running, the function returns to the scheduler. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling routine */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs Interrupt Service Routines */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_context_restore .type _tx_thread_context_restore,function _tx_thread_context_restore: -@ -@ /* Lockout interrupts. */ -@ + + /* Lockout interrupts. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ interrupts + CPSID if // Disable IRQ and FIQ interrupts #else - CPSID i @ Disable IRQ interrupts + CPSID i // Disable IRQ interrupts #endif #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR exit function to indicate an ISR is complete. */ -@ - BL _tx_execution_isr_exit @ Call the ISR exit function -#endif -@ -@ /* Determine if interrupts are nested. */ -@ if (--_tx_thread_system_state) -@ { -@ - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3] @ Pickup system state - SUB r2, r2, #1 @ Decrement the counter - STR r2, [r3] @ Store the counter - CMP r2, #0 @ Was this the first interrupt? - BEQ __tx_thread_not_nested_restore @ If so, not a nested restore -@ -@ /* Interrupts are nested. */ -@ -@ /* Just recover the saved registers and return to the point of -@ interrupt. */ -@ - LDMIA sp!, {r0, r10, r12, lr} @ Recover SPSR, POI, and scratch regs - MSR SPSR_cxsf, r0 @ Put SPSR back - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOVS pc, lr @ Return to point of interrupt -@ -@ } -__tx_thread_not_nested_restore: -@ -@ /* Determine if a thread was interrupted and no preemption is required. */ -@ else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr) -@ || (_tx_thread_preempt_disable)) -@ { -@ - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup actual current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_idle_system_restore @ Yes, idle system was interrupted -@ - LDR r3, =_tx_thread_preempt_disable @ Pickup preempt disable address - LDR r2, [r3] @ Pickup actual preempt disable flag - CMP r2, #0 @ Is it set? - BNE __tx_thread_no_preempt_restore @ Yes, don't preempt this thread - LDR r3, =_tx_thread_execute_ptr @ Pickup address of execute thread ptr - LDR r2, [r3] @ Pickup actual execute thread pointer - CMP r0, r2 @ Is the same thread highest priority? - BNE __tx_thread_preempt_restore @ No, preemption needs to happen -@ -@ -__tx_thread_no_preempt_restore: -@ -@ /* Restore interrupted thread or ISR. */ -@ -@ /* Pickup the saved stack pointer. */ -@ tmp_ptr = _tx_thread_current_ptr -> tx_thread_stack_ptr; -@ -@ /* Recover the saved context and return to the point of interrupt. */ -@ - LDMIA sp!, {r0, r10, r12, lr} @ Recover SPSR, POI, and scratch regs - MSR SPSR_cxsf, r0 @ Put SPSR back - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOVS pc, lr @ Return to point of interrupt -@ -@ } -@ else -@ { -__tx_thread_preempt_restore: -@ - LDMIA sp!, {r3, r10, r12, lr} @ Recover temporarily saved registers - MOV r1, lr @ Save lr (point of interrupt) - MOV r2, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r2 @ Enter SVC mode - STR r1, [sp, #-4]! @ Save point of interrupt - STMDB sp!, {r4-r12, lr} @ Save upper half of registers - MOV r4, r3 @ Save SPSR in r4 - MOV r2, #IRQ_MODE @ Build IRQ mode CPSR - MSR CPSR_c, r2 @ Enter IRQ mode - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOV r5, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r5 @ Enter SVC mode - STMDB sp!, {r0-r3} @ Save r0-r3 on thread's stack - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup current thread pointer + /* Call the ISR exit function to indicate an ISR is complete. */ + + BL _tx_execution_isr_exit // Call the ISR exit function +#endif + + /* Determine if interrupts are nested. */ + + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + SUB r2, r2, #1 // Decrement the counter + STR r2, [r3] // Store the counter + CMP r2, #0 // Was this the first interrupt? + BEQ __tx_thread_not_nested_restore // If so, not a nested restore + + /* Interrupts are nested. */ + + /* Just recover the saved registers and return to the point of + interrupt. */ + + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_not_nested_restore: + + /* Determine if a thread was interrupted and no preemption is required. */ + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup actual current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_restore // Yes, idle system was interrupted + + LDR r3, =_tx_thread_preempt_disable // Pickup preempt disable address + LDR r2, [r3] // Pickup actual preempt disable flag + CMP r2, #0 // Is it set? + BNE __tx_thread_no_preempt_restore // Yes, don't preempt this thread + LDR r3, =_tx_thread_execute_ptr // Pickup address of execute thread ptr + LDR r2, [r3] // Pickup actual execute thread pointer + CMP r0, r2 // Is the same thread highest priority? + BNE __tx_thread_preempt_restore // No, preemption needs to happen + + +__tx_thread_no_preempt_restore: + + /* Recover the saved context and return to the point of interrupt. */ + + /* Pickup the saved stack pointer. */ + + /* Recover the saved context and return to the point of interrupt. */ + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_preempt_restore: + + LDMIA sp!, {r3, r10, r12, lr} // Recover temporarily saved registers + MOV r1, lr // Save lr (point of interrupt) + MOV r2, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r2 // Enter SVC mode + STR r1, [sp, #-4]! // Save point of interrupt + STMDB sp!, {r4-r12, lr} // Save upper half of registers + MOV r4, r3 // Save SPSR in r4 + MOV r2, #IRQ_MODE // Build IRQ mode CPSR + MSR CPSR_c, r2 // Enter IRQ mode + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOV r5, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r5 // Enter SVC mode + STMDB sp!, {r0-r3} // Save r0-r3 on thread's stack + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer #ifdef TX_ENABLE_VFP_SUPPORT - LDR r2, [r0, #144] @ Pickup the VFP enabled flag - CMP r2, #0 @ Is the VFP enabled? - BEQ _tx_skip_irq_vfp_save @ No, skip VFP IRQ save - VMRS r2, FPSCR @ Pickup the FPSCR - STR r2, [sp, #-4]! @ Save FPSCR - VSTMDB sp!, {D16-D31} @ Save D16-D31 - VSTMDB sp!, {D0-D15} @ Save D0-D15 + LDR r2, [r0, #144] // Pickup the VFP enabled flag + CMP r2, #0 // Is the VFP enabled? + BEQ _tx_skip_irq_vfp_save // No, skip VFP IRQ save + VMRS r2, FPSCR // Pickup the FPSCR + STR r2, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D0-D15} // Save D0-D15 + _tx_skip_irq_vfp_save: + #endif - MOV r3, #1 @ Build interrupt stack type - STMDB sp!, {r3, r4} @ Save interrupt stack type and SPSR - STR sp, [r0, #8] @ Save stack pointer in thread control - @ block -@ -@ /* Save the remaining time-slice and disable it. */ -@ if (_tx_timer_time_slice) -@ { -@ - LDR r3, =_tx_timer_time_slice @ Pickup time-slice variable address - LDR r2, [r3] @ Pickup time-slice - CMP r2, #0 @ Is it active? - BEQ __tx_thread_dont_save_ts @ No, don't save it -@ -@ _tx_thread_current_ptr -> tx_thread_time_slice = _tx_timer_time_slice; -@ _tx_timer_time_slice = 0; -@ - STR r2, [r0, #24] @ Save thread's time-slice - MOV r2, #0 @ Clear value - STR r2, [r3] @ Disable global time-slice flag -@ -@ } + MOV r3, #1 // Build interrupt stack type + STMDB sp!, {r3, r4} // Save interrupt stack type and SPSR + STR sp, [r0, #8] // Save stack pointer in thread control + // block + + /* Save the remaining time-slice and disable it. */ + LDR r3, =_tx_timer_time_slice // Pickup time-slice variable address + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it active? + BEQ __tx_thread_dont_save_ts // No, don't save it + STR r2, [r0, #24] // Save thread's time-slice + MOV r2, #0 // Clear value + STR r2, [r3] // Disable global time-slice flag + __tx_thread_dont_save_ts: -@ -@ -@ /* Clear the current task pointer. */ -@ _tx_thread_current_ptr = TX_NULL; -@ - MOV r0, #0 @ NULL value - STR r0, [r1] @ Clear current thread pointer -@ -@ /* Return to the scheduler. */ -@ _tx_thread_schedule(); -@ - B _tx_thread_schedule @ Return to scheduler -@ } -@ + + /* Clear the current task pointer. */ + MOV r0, #0 // NULL value + STR r0, [r1] // Clear current thread pointer + + /* Return to the scheduler. */ + B _tx_thread_schedule // Return to scheduler + __tx_thread_idle_system_restore: -@ -@ /* Just return back to the scheduler! */ -@ - MOV r0, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r0 @ Enter SVC mode - B _tx_thread_schedule @ Return to scheduler -@} - - + /* Just return back to the scheduler! */ + MOV r0, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r0 // Enter SVC mode + B _tx_thread_schedule // Return to scheduler diff --git a/ports/cortex_a9/ac6/src/tx_thread_context_save.S b/ports/cortex_a9/ac6/src/tx_thread_context_save.S index a04cf555..7ac48c2e 100644 --- a/ports/cortex_a9/ac6/src/tx_thread_context_save.S +++ b/ports/cortex_a9/ac6/src/tx_thread_context_save.S @@ -1,205 +1,172 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .global _tx_thread_system_state .global _tx_thread_current_ptr .global __tx_irq_processing_return -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_save -@ since it will never be called 16-bit mode. */ -@ + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_save + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_context_save Cortex-A9/AC6 */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function saves the context of an executing thread in the */ -@/* beginning of interrupt processing. The function also ensures that */ -@/* the system stack is used upon return to the calling ISR. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_context_save(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_context_save .type _tx_thread_context_save,function _tx_thread_context_save: -@ -@ /* Upon entry to this routine, it is assumed that IRQ interrupts are locked -@ out, we are in IRQ mode, and all registers are intact. */ -@ -@ /* Check for a nested interrupt condition. */ -@ if (_tx_thread_system_state++) -@ { -@ - STMDB sp!, {r0-r3} @ Save some working registers + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + + STMDB sp!, {r0-r3} // Save some working registers #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable FIQ interrupts + CPSID if // Disable FIQ interrupts #endif - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3] @ Pickup system state - CMP r2, #0 @ Is this the first interrupt? - BEQ __tx_thread_not_nested_save @ Yes, not a nested context save -@ -@ /* Nested interrupt condition. */ -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3] @ Store it back in the variable -@ -@ /* Save the rest of the scratch registers on the stack and return to the -@ calling ISR. */ -@ - MRS r0, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r0, r10, r12, lr} @ Store other registers -@ -@ /* Return to the ISR. */ -@ - MOV r10, #0 @ Clear stack limit + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + + /* Save the rest of the scratch registers on the stack and return to the + calling ISR. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, r10, r12, lr} // Store other registers + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - B __tx_irq_processing_return @ Continue IRQ processing -@ + B __tx_irq_processing_return // Continue IRQ processing + __tx_thread_not_nested_save: -@ } -@ -@ /* Otherwise, not nested, check to see if a thread was running. */ -@ else if (_tx_thread_current_ptr) -@ { -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3] @ Store it back in the variable - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_idle_system_save @ If so, interrupt occurred in - @ scheduling loop - nothing needs saving! -@ -@ /* Save minimal context of interrupted thread. */ -@ - MRS r2, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r2, r10, r12, lr} @ Store other registers -@ -@ /* Save the current stack pointer in the thread's control block. */ -@ _tx_thread_current_ptr -> tx_thread_stack_ptr = sp; -@ -@ /* Switch to the system stack. */ -@ sp = _tx_thread_system_stack_ptr@ -@ - MOV r10, #0 @ Clear stack limit + + /* Otherwise, not nested, check to see if a thread was running. */ + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + + /* Save minimal context of interrupted thread. */ + + MRS r2, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r2, r10, r12, lr} // Store other registers + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - B __tx_irq_processing_return @ Continue IRQ processing -@ -@ } -@ else -@ { -@ + B __tx_irq_processing_return // Continue IRQ processing + __tx_thread_idle_system_save: -@ -@ /* Interrupt occurred in the scheduling loop. */ -@ -@ /* Not much to do here, just adjust the stack pointer, and return to IRQ -@ processing. */ -@ - MOV r10, #0 @ Clear stack limit + + /* Interrupt occurred in the scheduling loop. */ + + /* Not much to do here, just adjust the stack pointer, and return to IRQ + processing. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - ADD sp, sp, #16 @ Recover saved registers - B __tx_irq_processing_return @ Continue IRQ processing -@ -@ } -@} - - - + ADD sp, sp, #16 // Recover saved registers + B __tx_irq_processing_return // Continue IRQ processing diff --git a/ports/cortex_a9/ac6/src/tx_thread_fiq_context_restore.S b/ports/cortex_a9/ac6/src/tx_thread_fiq_context_restore.S index 00191310..006be973 100644 --- a/ports/cortex_a9/ac6/src/tx_thread_fiq_context_restore.S +++ b/ports/cortex_a9/ac6/src/tx_thread_fiq_context_restore.S @@ -1,43 +1,32 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ -@ -SVC_MODE = 0xD3 @ SVC mode -FIQ_MODE = 0xD1 @ FIQ mode -MODE_MASK = 0x1F @ Mode mask -THUMB_MASK = 0x20 @ Thumb bit mask -IRQ_MODE_BITS = 0x12 @ IRQ mode bits -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +SVC_MODE = 0xD3 // SVC mode +FIQ_MODE = 0xD1 // FIQ mode +MODE_MASK = 0x1F // Mode mask +THUMB_MASK = 0x20 // Thumb bit mask +IRQ_MODE_BITS = 0x12 // IRQ mode bits + + .global _tx_thread_system_state .global _tx_thread_current_ptr .global _tx_thread_system_stack_ptr @@ -45,218 +34,190 @@ IRQ_MODE_BITS = 0x12 @ IRQ mode bits .global _tx_timer_time_slice .global _tx_thread_schedule .global _tx_thread_preempt_disable -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_restore -@ since it will never be called 16-bit mode. */ -@ + .global _tx_execution_isr_exit + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_restore + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_fiq_context_restore Cortex-A9/AC6 */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function restores the fiq interrupt context when processing a */ -@/* nested interrupt. If not, it returns to the interrupt thread if no */ -@/* preemption is necessary. Otherwise, if preemption is necessary or */ -@/* if no thread was running, the function returns to the scheduler. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* _tx_thread_schedule Thread scheduling routine */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* FIQ ISR Interrupt Service Routines */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_fiq_context_restore(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_context_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function restores the fiq interrupt context when processing a */ +/* nested interrupt. If not, it returns to the interrupt thread if no */ +/* preemption is necessary. Otherwise, if preemption is necessary or */ +/* if no thread was running, the function returns to the scheduler. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling routine */ +/* */ +/* CALLED BY */ +/* */ +/* FIQ ISR Interrupt Service Routines */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_fiq_context_restore .type _tx_thread_fiq_context_restore,function _tx_thread_fiq_context_restore: -@ -@ /* Lockout interrupts. */ -@ - CPSID if @ Disable IRQ and FIQ interrupts + + /* Lockout interrupts. */ + + CPSID if // Disable IRQ and FIQ interrupts #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR exit function to indicate an ISR is complete. */ -@ - BL _tx_execution_isr_exit @ Call the ISR exit function + + /* Call the ISR exit function to indicate an ISR is complete. */ + + BL _tx_execution_isr_exit // Call the ISR exit function #endif -@ -@ /* Determine if interrupts are nested. */ -@ if (--_tx_thread_system_state) -@ { -@ - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3] @ Pickup system state - SUB r2, r2, #1 @ Decrement the counter - STR r2, [r3] @ Store the counter - CMP r2, #0 @ Was this the first interrupt? - BEQ __tx_thread_fiq_not_nested_restore @ If so, not a nested restore -@ -@ /* Interrupts are nested. */ -@ -@ /* Just recover the saved registers and return to the point of -@ interrupt. */ -@ - LDMIA sp!, {r0, r10, r12, lr} @ Recover SPSR, POI, and scratch regs - MSR SPSR_cxsf, r0 @ Put SPSR back - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOVS pc, lr @ Return to point of interrupt -@ -@ } + + /* Determine if interrupts are nested. */ + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + SUB r2, r2, #1 // Decrement the counter + STR r2, [r3] // Store the counter + CMP r2, #0 // Was this the first interrupt? + BEQ __tx_thread_fiq_not_nested_restore // If so, not a nested restore + + /* Interrupts are nested. */ + + /* Just recover the saved registers and return to the point of + interrupt. */ + + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + __tx_thread_fiq_not_nested_restore: -@ -@ /* Determine if a thread was interrupted and no preemption is required. */ -@ else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr) -@ || (_tx_thread_preempt_disable)) -@ { -@ - LDR r1, [sp] @ Pickup the saved SPSR - MOV r2, #MODE_MASK @ Build mask to isolate the interrupted mode - AND r1, r1, r2 @ Isolate mode bits - CMP r1, #IRQ_MODE_BITS @ Was an interrupt taken in IRQ mode before we - @ got to context save? */ - BEQ __tx_thread_fiq_no_preempt_restore @ Yes, just go back to point of interrupt + + /* Determine if a thread was interrupted and no preemption is required. */ + + LDR r1, [sp] // Pickup the saved SPSR + MOV r2, #MODE_MASK // Build mask to isolate the interrupted mode + AND r1, r1, r2 // Isolate mode bits + CMP r1, #IRQ_MODE_BITS // Was an interrupt taken in IRQ mode before we + // got to context save? */ + BEQ __tx_thread_fiq_no_preempt_restore // Yes, just go back to point of interrupt - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup actual current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_fiq_idle_system_restore @ Yes, idle system was interrupted + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup actual current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_fiq_idle_system_restore // Yes, idle system was interrupted - LDR r3, =_tx_thread_preempt_disable @ Pickup preempt disable address - LDR r2, [r3] @ Pickup actual preempt disable flag - CMP r2, #0 @ Is it set? - BNE __tx_thread_fiq_no_preempt_restore @ Yes, don't preempt this thread - LDR r3, =_tx_thread_execute_ptr @ Pickup address of execute thread ptr - LDR r2, [r3] @ Pickup actual execute thread pointer - CMP r0, r2 @ Is the same thread highest priority? - BNE __tx_thread_fiq_preempt_restore @ No, preemption needs to happen + LDR r3, =_tx_thread_preempt_disable // Pickup preempt disable address + LDR r2, [r3] // Pickup actual preempt disable flag + CMP r2, #0 // Is it set? + BNE __tx_thread_fiq_no_preempt_restore // Yes, don't preempt this thread + LDR r3, =_tx_thread_execute_ptr // Pickup address of execute thread ptr + LDR r2, [r3] // Pickup actual execute thread pointer + CMP r0, r2 // Is the same thread highest priority? + BNE __tx_thread_fiq_preempt_restore // No, preemption needs to happen __tx_thread_fiq_no_preempt_restore: -@ -@ /* Restore interrupted thread or ISR. */ -@ -@ /* Pickup the saved stack pointer. */ -@ tmp_ptr = _tx_thread_current_ptr -> tx_thread_stack_ptr; -@ -@ /* Recover the saved context and return to the point of interrupt. */ -@ - LDMIA sp!, {r0, lr} @ Recover SPSR, POI, and scratch regs - MSR SPSR_cxsf, r0 @ Put SPSR back - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOVS pc, lr @ Return to point of interrupt -@ -@ } -@ else -@ { -__tx_thread_fiq_preempt_restore: -@ - LDMIA sp!, {r3, lr} @ Recover temporarily saved registers - MOV r1, lr @ Save lr (point of interrupt) - MOV r2, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r2 @ Enter SVC mode - STR r1, [sp, #-4]! @ Save point of interrupt - STMDB sp!, {r4-r12, lr} @ Save upper half of registers - MOV r4, r3 @ Save SPSR in r4 - MOV r2, #FIQ_MODE @ Build FIQ mode CPSR - MSR CPSR_c, r2 @ Reenter FIQ mode - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOV r5, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r5 @ Enter SVC mode - STMDB sp!, {r0-r3} @ Save r0-r3 on thread's stack - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup current thread pointer + /* Restore interrupted thread or ISR. */ + /* Recover the saved context and return to the point of interrupt. */ + + LDMIA sp!, {r0, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_fiq_preempt_restore: + + LDMIA sp!, {r3, lr} // Recover temporarily saved registers + MOV r1, lr // Save lr (point of interrupt) + MOV r2, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r2 // Enter SVC mode + STR r1, [sp, #-4]! // Save point of interrupt + STMDB sp!, {r4-r12, lr} // Save upper half of registers + MOV r4, r3 // Save SPSR in r4 + MOV r2, #FIQ_MODE // Build FIQ mode CPSR + MSR CPSR_c, r2 // Reenter FIQ mode + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOV r5, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r5 // Enter SVC mode + STMDB sp!, {r0-r3} // Save r0-r3 on thread's stack + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer #ifdef TX_ENABLE_VFP_SUPPORT - LDR r2, [r0, #144] @ Pickup the VFP enabled flag - CMP r2, #0 @ Is the VFP enabled? - BEQ _tx_skip_fiq_vfp_save @ No, skip VFP IRQ save - VMRS r2, FPSCR @ Pickup the FPSCR - STR r2, [sp, #-4]! @ Save FPSCR - VSTMDB sp!, {D16-D31} @ Save D16-D31 - VSTMDB sp!, {D0-D15} @ Save D0-D15 + LDR r2, [r0, #144] // Pickup the VFP enabled flag + CMP r2, #0 // Is the VFP enabled? + BEQ _tx_skip_fiq_vfp_save // No, skip VFP IRQ save + VMRS r2, FPSCR // Pickup the FPSCR + STR r2, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D0-D15} // Save D0-D15 _tx_skip_fiq_vfp_save: #endif - MOV r3, #1 @ Build interrupt stack type - STMDB sp!, {r3, r4} @ Save interrupt stack type and SPSR - STR sp, [r0, #8] @ Save stack pointer in thread control - @ block */ -@ -@ /* Save the remaining time-slice and disable it. */ -@ if (_tx_timer_time_slice) -@ { -@ - LDR r3, =_tx_timer_time_slice @ Pickup time-slice variable address - LDR r2, [r3] @ Pickup time-slice - CMP r2, #0 @ Is it active? - BEQ __tx_thread_fiq_dont_save_ts @ No, don't save it -@ -@ _tx_thread_current_ptr -> tx_thread_time_slice = _tx_timer_time_slice; -@ _tx_timer_time_slice = 0; -@ - STR r2, [r0, #24] @ Save thread's time-slice - MOV r2, #0 @ Clear value - STR r2, [r3] @ Disable global time-slice flag -@ -@ } -__tx_thread_fiq_dont_save_ts: -@ -@ -@ /* Clear the current task pointer. */ -@ _tx_thread_current_ptr = TX_NULL; -@ - MOV r0, #0 @ NULL value - STR r0, [r1] @ Clear current thread pointer -@ -@ /* Return to the scheduler. */ -@ _tx_thread_schedule(); -@ - B _tx_thread_schedule @ Return to scheduler -@ } -@ -__tx_thread_fiq_idle_system_restore: -@ -@ /* Just return back to the scheduler! */ -@ - ADD sp, sp, #24 @ Recover FIQ stack space - MOV r3, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r3 @ Lockout interrupts - B _tx_thread_schedule @ Return to scheduler -@ -@} + MOV r3, #1 // Build interrupt stack type + STMDB sp!, {r3, r4} // Save interrupt stack type and SPSR + STR sp, [r0, #8] // Save stack pointer in thread control + // block */ + LDR r3, =_tx_timer_time_slice // Pickup time-slice variable address + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it active? + BEQ __tx_thread_fiq_dont_save_ts // No, don't save it + + STR r2, [r0, #24] // Save thread's time-slice + MOV r2, #0 // Clear value + STR r2, [r3] // Disable global time-slice flag + +__tx_thread_fiq_dont_save_ts: + + /* Clear the current task pointer. */ + + MOV r0, #0 // NULL value + STR r0, [r1] // Clear current thread pointer + + /* Return to the scheduler. */ + + B _tx_thread_schedule // Return to scheduler + +__tx_thread_fiq_idle_system_restore: + + /* Just return back to the scheduler! */ + + ADD sp, sp, #24 // Recover FIQ stack space + MOV r3, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r3 // Lockout interrupts + B _tx_thread_schedule // Return to scheduler diff --git a/ports/cortex_a9/ac6/src/tx_thread_fiq_context_save.S b/ports/cortex_a9/ac6/src/tx_thread_fiq_context_save.S index dc980ac6..7db6a4c2 100644 --- a/ports/cortex_a9/ac6/src/tx_thread_fiq_context_save.S +++ b/ports/cortex_a9/ac6/src/tx_thread_fiq_context_save.S @@ -1,206 +1,178 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .global _tx_thread_system_state .global _tx_thread_current_ptr .global __tx_fiq_processing_return -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_save -@ since it will never be called 16-bit mode. */ -@ + .global _tx_execution_isr_enter + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_save + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_fiq_context_save Cortex-A9/AC6 */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function saves the context of an executing thread in the */ -@/* beginning of interrupt processing. The function also ensures that */ -@/* the system stack is used upon return to the calling ISR. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@ VOID _tx_thread_fiq_context_save(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_fiq_context_save .type _tx_thread_fiq_context_save,function _tx_thread_fiq_context_save: -@ -@ /* Upon entry to this routine, it is assumed that IRQ interrupts are locked -@ out, we are in IRQ mode, and all registers are intact. */ -@ -@ /* Check for a nested interrupt condition. */ -@ if (_tx_thread_system_state++) -@ { -@ - STMDB sp!, {r0-r3} @ Save some working registers - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3] @ Pickup system state - CMP r2, #0 @ Is this the first interrupt? - BEQ __tx_thread_fiq_not_nested_save @ Yes, not a nested context save -@ -@ /* Nested interrupt condition. */ -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3] @ Store it back in the variable -@ -@ /* Save the rest of the scratch registers on the stack and return to the -@ calling ISR. */ -@ - MRS r0, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r0, r10, r12, lr} @ Store other registers -@ -@ /* Return to the ISR. */ -@ - MOV r10, #0 @ Clear stack limit + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + + STMDB sp!, {r0-r3} // Save some working registers + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_fiq_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + + /* Save the rest of the scratch registers on the stack and return to the + calling ISR. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, r10, r12, lr} // Store other registers + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - B __tx_fiq_processing_return @ Continue FIQ processing -@ + B __tx_fiq_processing_return // Continue FIQ processing +// __tx_thread_fiq_not_nested_save: -@ } -@ -@ /* Otherwise, not nested, check to see if a thread was running. */ -@ else if (_tx_thread_current_ptr) -@ { -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3] @ Store it back in the variable - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_fiq_idle_system_save @ If so, interrupt occurred in -@ @ scheduling loop - nothing needs saving! -@ -@ /* Save minimal context of interrupted thread. */ -@ - MRS r2, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r2, lr} @ Store other registers, Note that we don't -@ @ need to save sl and ip since FIQ has -@ @ copies of these registers. Nested -@ @ interrupt processing does need to save -@ @ these registers. -@ -@ /* Save the current stack pointer in the thread's control block. */ -@ _tx_thread_current_ptr -> tx_thread_stack_ptr = sp; -@ -@ /* Switch to the system stack. */ -@ sp = _tx_thread_system_stack_ptr; -@ - MOV r10, #0 @ Clear stack limit + + /* Otherwise, not nested, check to see if a thread was running. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_fiq_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + + /* Save minimal context of interrupted thread. */ + + MRS r2, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r2, lr} // Store other registers, Note that we don't + // need to save sl and ip since FIQ has + // copies of these registers. Nested + // interrupt processing does need to save + // these registers. + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - B __tx_fiq_processing_return @ Continue FIQ processing -@ -@ } -@ else -@ { -@ + B __tx_fiq_processing_return // Continue FIQ processing + __tx_thread_fiq_idle_system_save: -@ -@ /* Interrupt occurred in the scheduling loop. */ -@ -#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr -#endif -@ -@ /* Not much to do here, save the current SPSR and LR for possible -@ use in IRQ interrupted in idle system conditions, and return to -@ FIQ interrupt processing. */ -@ - MRS r0, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r0, lr} @ Store other registers that will get used -@ @ or stripped off the stack in context -@ @ restore - B __tx_fiq_processing_return @ Continue FIQ processing -@ -@ } -@} + /* Interrupt occurred in the scheduling loop. */ + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + /* Not much to do here, save the current SPSR and LR for possible + use in IRQ interrupted in idle system conditions, and return to + FIQ interrupt processing. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, lr} // Store other registers that will get used + // or stripped off the stack in context + // restore + B __tx_fiq_processing_return // Continue FIQ processing diff --git a/ports/cortex_a9/ac6/src/tx_thread_fiq_nesting_end.S b/ports/cortex_a9/ac6/src/tx_thread_fiq_nesting_end.S index ecf2db8e..b34d881e 100644 --- a/ports/cortex_a9/ac6/src/tx_thread_fiq_nesting_end.S +++ b/ports/cortex_a9/ac6/src/tx_thread_fiq_nesting_end.S @@ -1,116 +1,104 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + #ifdef TX_ENABLE_FIQ_SUPPORT -DISABLE_INTS = 0xC0 @ Disable IRQ/FIQ interrupts +DISABLE_INTS = 0xC0 // Disable IRQ/FIQ interrupts #else -DISABLE_INTS = 0x80 @ Disable IRQ interrupts +DISABLE_INTS = 0x80 // Disable IRQ interrupts #endif -MODE_MASK = 0x1F @ Mode mask -FIQ_MODE_BITS = 0x11 @ FIQ mode bits -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_end -@ since it will never be called 16-bit mode. */ -@ +MODE_MASK = 0x1F // Mode mask +FIQ_MODE_BITS = 0x11 // FIQ mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_end + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_fiq_nesting_end Cortex-A9/AC6 */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is called by the application from FIQ mode after */ -@/* _tx_thread_fiq_nesting_start has been called and switches the FIQ */ -@/* processing from system mode back to FIQ mode prior to the ISR */ -@/* calling _tx_thread_fiq_context_restore. Note that this function */ -@/* assumes the system stack pointer is in the same position after */ -@/* nesting start function was called. */ -@/* */ -@/* This function assumes that the system mode stack pointer was setup */ -@/* during low-level initialization (tx_initialize_low_level.s). */ -@/* */ -@/* This function returns with FIQ interrupts disabled. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_fiq_nesting_end(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_nesting_end ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from FIQ mode after */ +/* _tx_thread_fiq_nesting_start has been called and switches the FIQ */ +/* processing from system mode back to FIQ mode prior to the ISR */ +/* calling _tx_thread_fiq_context_restore. Note that this function */ +/* assumes the system stack pointer is in the same position after */ +/* nesting start function was called. */ +/* */ +/* This function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with FIQ interrupts disabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_fiq_nesting_end .type _tx_thread_fiq_nesting_end,function _tx_thread_fiq_nesting_end: - MOV r3,lr @ Save ISR return address - MRS r0, CPSR @ Pickup the CPSR - ORR r0, r0, #DISABLE_INTS @ Build disable interrupt value - MSR CPSR_c, r0 @ Disable interrupts - LDMIA sp!, {r1, lr} @ Pickup saved lr (and r1 throw-away for - @ 8-byte alignment logic) - BIC r0, r0, #MODE_MASK @ Clear mode bits - ORR r0, r0, #FIQ_MODE_BITS @ Build IRQ mode CPSR - MSR CPSR_c, r0 @ Reenter IRQ mode + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + ORR r0, r0, #DISABLE_INTS // Build disable interrupt value + MSR CPSR_c, r0 // Disable interrupts + LDMIA sp!, {r1, lr} // Pickup saved lr (and r1 throw-away for + // 8-byte alignment logic) + BIC r0, r0, #MODE_MASK // Clear mode bits + ORR r0, r0, #FIQ_MODE_BITS // Build IRQ mode CPSR + MSR CPSR_c, r0 // Reenter IRQ mode #ifdef __THUMB_INTERWORK - BX r3 @ Return to caller + BX r3 // Return to caller #else - MOV pc, r3 @ Return to caller + MOV pc, r3 // Return to caller #endif -@} - diff --git a/ports/cortex_a9/ac6/src/tx_thread_fiq_nesting_start.S b/ports/cortex_a9/ac6/src/tx_thread_fiq_nesting_start.S index f042af5d..c9cd5a06 100644 --- a/ports/cortex_a9/ac6/src/tx_thread_fiq_nesting_start.S +++ b/ports/cortex_a9/ac6/src/tx_thread_fiq_nesting_start.S @@ -1,108 +1,96 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ -FIQ_DISABLE = 0x40 @ FIQ disable bit -MODE_MASK = 0x1F @ Mode mask -SYS_MODE_BITS = 0x1F @ System mode bits -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_start -@ since it will never be called 16-bit mode. */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +FIQ_DISABLE = 0x40 // FIQ disable bit +MODE_MASK = 0x1F // Mode mask +SYS_MODE_BITS = 0x1F // System mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_start + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_fiq_nesting_start Cortex-A9/AC6 */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is called by the application from FIQ mode after */ -@/* _tx_thread_fiq_context_save has been called and switches the FIQ */ -@/* processing to the system mode so nested FIQ interrupt processing */ -@/* is possible (system mode has its own "lr" register). Note that */ -@/* this function assumes that the system mode stack pointer was setup */ -@/* during low-level initialization (tx_initialize_low_level.s). */ -@/* */ -@/* This function returns with FIQ interrupts enabled. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_fiq_nesting_start(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_nesting_start ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from FIQ mode after */ +/* _tx_thread_fiq_context_save has been called and switches the FIQ */ +/* processing to the system mode so nested FIQ interrupt processing */ +/* is possible (system mode has its own "lr" register). Note that */ +/* this function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with FIQ interrupts enabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_fiq_nesting_start .type _tx_thread_fiq_nesting_start,function _tx_thread_fiq_nesting_start: - MOV r3,lr @ Save ISR return address - MRS r0, CPSR @ Pickup the CPSR - BIC r0, r0, #MODE_MASK @ Clear the mode bits - ORR r0, r0, #SYS_MODE_BITS @ Build system mode CPSR - MSR CPSR_c, r0 @ Enter system mode - STMDB sp!, {r1, lr} @ Push the system mode lr on the system mode stack - @ and push r1 just to keep 8-byte alignment - BIC r0, r0, #FIQ_DISABLE @ Build enable FIQ CPSR - MSR CPSR_c, r0 @ Enter system mode + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + BIC r0, r0, #MODE_MASK // Clear the mode bits + ORR r0, r0, #SYS_MODE_BITS // Build system mode CPSR + MSR CPSR_c, r0 // Enter system mode + STMDB sp!, {r1, lr} // Push the system mode lr on the system mode stack + // and push r1 just to keep 8-byte alignment + BIC r0, r0, #FIQ_DISABLE // Build enable FIQ CPSR + MSR CPSR_c, r0 // Enter system mode #ifdef __THUMB_INTERWORK - BX r3 @ Return to caller + BX r3 // Return to caller #else - MOV pc, r3 @ Return to caller + MOV pc, r3 // Return to caller #endif -@} - diff --git a/ports/cortex_a9/ac6/src/tx_thread_interrupt_control.S b/ports/cortex_a9/ac6/src/tx_thread_interrupt_control.S index a6ac989c..63b1609a 100644 --- a/ports/cortex_a9/ac6/src/tx_thread_interrupt_control.S +++ b/ports/cortex_a9/ac6/src/tx_thread_interrupt_control.S @@ -1,115 +1,104 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ INT_MASK = 0x03F -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_control for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_control for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_interrupt_control $_tx_thread_interrupt_control: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_interrupt_control @ Call _tx_thread_interrupt_control function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_control // Call _tx_thread_interrupt_control function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_interrupt_control Cortex-A9/AC6 */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is responsible for changing the interrupt lockout */ -@/* posture of the system. */ -@/* */ -@/* INPUT */ -@/* */ -@/* new_posture New interrupt lockout posture */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* old_posture Old interrupt lockout posture */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* Application Code */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@UINT _tx_thread_interrupt_control(UINT new_posture) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_control ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for changing the interrupt lockout */ +/* posture of the system. */ +/* */ +/* INPUT */ +/* */ +/* new_posture New interrupt lockout posture */ +/* */ +/* OUTPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_interrupt_control .type _tx_thread_interrupt_control,function _tx_thread_interrupt_control: -@ -@ /* Pickup current interrupt lockout posture. */ -@ - MRS r3, CPSR @ Pickup current CPSR - MOV r2, #INT_MASK @ Build interrupt mask - AND r1, r3, r2 @ Clear interrupt lockout bits - ORR r1, r1, r0 @ Or-in new interrupt lockout bits -@ -@ /* Apply the new interrupt posture. */ -@ - MSR CPSR_c, r1 @ Setup new CPSR - BIC r0, r3, r2 @ Return previous interrupt mask -#ifdef __THUMB_INTERWORK - BX lr @ Return to caller -#else - MOV pc, lr @ Return to caller -#endif -@} + /* Pickup current interrupt lockout posture. */ + + MRS r3, CPSR // Pickup current CPSR + MOV r2, #INT_MASK // Build interrupt mask + AND r1, r3, r2 // Clear interrupt lockout bits + ORR r1, r1, r0 // Or-in new interrupt lockout bits + + /* Apply the new interrupt posture. */ + + MSR CPSR_c, r1 // Setup new CPSR + BIC r0, r3, r2 // Return previous interrupt mask +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a9/ac6/src/tx_thread_interrupt_disable.S b/ports/cortex_a9/ac6/src/tx_thread_interrupt_disable.S index 2b0f0840..13258808 100644 --- a/ports/cortex_a9/ac6/src/tx_thread_interrupt_disable.S +++ b/ports/cortex_a9/ac6/src/tx_thread_interrupt_disable.S @@ -1,113 +1,101 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_disable for -@ applications calling this function from to 16-bit Thumb mode. */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_disable for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_interrupt_disable $_tx_thread_interrupt_disable: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_interrupt_disable @ Call _tx_thread_interrupt_disable function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_disable // Call _tx_thread_interrupt_disable function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_interrupt_disable Cortex-A9/AC6 */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is responsible for disabling interrupts */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* old_posture Old interrupt lockout posture */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* Application Code */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@UINT _tx_thread_interrupt_disable(void) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_disable ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for disabling interrupts */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_interrupt_disable .type _tx_thread_interrupt_disable,function _tx_thread_interrupt_disable: -@ -@ /* Pickup current interrupt lockout posture. */ -@ - MRS r0, CPSR @ Pickup current CPSR -@ -@ /* Mask interrupts. */ -@ + + /* Pickup current interrupt lockout posture. */ + + MRS r0, CPSR // Pickup current CPSR + + /* Mask interrupts. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ + CPSID if // Disable IRQ and FIQ #else - CPSID i @ Disable IRQ + CPSID i // Disable IRQ #endif #ifdef __THUMB_INTERWORK - BX lr @ Return to caller + BX lr // Return to caller #else - MOV pc, lr @ Return to caller + MOV pc, lr // Return to caller #endif -@} - - diff --git a/ports/cortex_a9/ac6/src/tx_thread_interrupt_restore.S b/ports/cortex_a9/ac6/src/tx_thread_interrupt_restore.S index 3793925d..2d582511 100644 --- a/ports/cortex_a9/ac6/src/tx_thread_interrupt_restore.S +++ b/ports/cortex_a9/ac6/src/tx_thread_interrupt_restore.S @@ -1,104 +1,93 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_restore for -@ applications calling this function from to 16-bit Thumb mode. */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_restore for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_interrupt_restore $_tx_thread_interrupt_restore: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_interrupt_restore @ Call _tx_thread_interrupt_restore function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_restore // Call _tx_thread_interrupt_restore function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_interrupt_restore Cortex-A9/AC6 */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is responsible for restoring interrupts to the state */ -@/* returned by a previous _tx_thread_interrupt_disable call. */ -@/* */ -@/* INPUT */ -@/* */ -@/* old_posture Old interrupt lockout posture */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* Application Code */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@UINT _tx_thread_interrupt_restore(UINT old_posture) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for restoring interrupts to the state */ +/* returned by a previous _tx_thread_interrupt_disable call. */ +/* */ +/* INPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_interrupt_restore .type _tx_thread_interrupt_restore,function _tx_thread_interrupt_restore: -@ -@ /* Apply the new interrupt posture. */ -@ - MSR CPSR_c, r0 @ Setup new CPSR -#ifdef __THUMB_INTERWORK - BX lr @ Return to caller -#else - MOV pc, lr @ Return to caller -#endif -@} + /* Apply the new interrupt posture. */ + + MSR CPSR_c, r0 // Setup new CPSR +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a9/ac6/src/tx_thread_irq_nesting_end.S b/ports/cortex_a9/ac6/src/tx_thread_irq_nesting_end.S index b66fa3ca..ec7e63c6 100644 --- a/ports/cortex_a9/ac6/src/tx_thread_irq_nesting_end.S +++ b/ports/cortex_a9/ac6/src/tx_thread_irq_nesting_end.S @@ -1,115 +1,103 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + #ifdef TX_ENABLE_FIQ_SUPPORT -DISABLE_INTS = 0xC0 @ Disable IRQ/FIQ interrupts +DISABLE_INTS = 0xC0 // Disable IRQ/FIQ interrupts #else -DISABLE_INTS = 0x80 @ Disable IRQ interrupts +DISABLE_INTS = 0x80 // Disable IRQ interrupts #endif -MODE_MASK = 0x1F @ Mode mask -IRQ_MODE_BITS = 0x12 @ IRQ mode bits -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_end -@ since it will never be called 16-bit mode. */ -@ +MODE_MASK = 0x1F // Mode mask +IRQ_MODE_BITS = 0x12 // IRQ mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_end + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_irq_nesting_end Cortex-A9/AC6 */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is called by the application from IRQ mode after */ -@/* _tx_thread_irq_nesting_start has been called and switches the IRQ */ -@/* processing from system mode back to IRQ mode prior to the ISR */ -@/* calling _tx_thread_context_restore. Note that this function */ -@/* assumes the system stack pointer is in the same position after */ -@/* nesting start function was called. */ -@/* */ -@/* This function assumes that the system mode stack pointer was setup */ -@/* during low-level initialization (tx_initialize_low_level.s). */ -@/* */ -@/* This function returns with IRQ interrupts disabled. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_irq_nesting_end(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_irq_nesting_end ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from IRQ mode after */ +/* _tx_thread_irq_nesting_start has been called and switches the IRQ */ +/* processing from system mode back to IRQ mode prior to the ISR */ +/* calling _tx_thread_context_restore. Note that this function */ +/* assumes the system stack pointer is in the same position after */ +/* nesting start function was called. */ +/* */ +/* This function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with IRQ interrupts disabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_irq_nesting_end .type _tx_thread_irq_nesting_end,function _tx_thread_irq_nesting_end: - MOV r3,lr @ Save ISR return address - MRS r0, CPSR @ Pickup the CPSR - ORR r0, r0, #DISABLE_INTS @ Build disable interrupt value - MSR CPSR_c, r0 @ Disable interrupts - LDMIA sp!, {r1, lr} @ Pickup saved lr (and r1 throw-away for - @ 8-byte alignment logic) - BIC r0, r0, #MODE_MASK @ Clear mode bits - ORR r0, r0, #IRQ_MODE_BITS @ Build IRQ mode CPSR - MSR CPSR_c, r0 @ Reenter IRQ mode + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + ORR r0, r0, #DISABLE_INTS // Build disable interrupt value + MSR CPSR_c, r0 // Disable interrupts + LDMIA sp!, {r1, lr} // Pickup saved lr (and r1 throw-away for + // 8-byte alignment logic) + BIC r0, r0, #MODE_MASK // Clear mode bits + ORR r0, r0, #IRQ_MODE_BITS // Build IRQ mode CPSR + MSR CPSR_c, r0 // Reenter IRQ mode #ifdef __THUMB_INTERWORK - BX r3 @ Return to caller + BX r3 // Return to caller #else - MOV pc, r3 @ Return to caller + MOV pc, r3 // Return to caller #endif -@} - diff --git a/ports/cortex_a9/ac6/src/tx_thread_irq_nesting_start.S b/ports/cortex_a9/ac6/src/tx_thread_irq_nesting_start.S index e864d867..c69976ed 100644 --- a/ports/cortex_a9/ac6/src/tx_thread_irq_nesting_start.S +++ b/ports/cortex_a9/ac6/src/tx_thread_irq_nesting_start.S @@ -1,108 +1,96 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ -IRQ_DISABLE = 0x80 @ IRQ disable bit -MODE_MASK = 0x1F @ Mode mask -SYS_MODE_BITS = 0x1F @ System mode bits -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_start -@ since it will never be called 16-bit mode. */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +IRQ_DISABLE = 0x80 // IRQ disable bit +MODE_MASK = 0x1F // Mode mask +SYS_MODE_BITS = 0x1F // System mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_start + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_irq_nesting_start Cortex-A9/AC6 */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is called by the application from IRQ mode after */ -@/* _tx_thread_context_save has been called and switches the IRQ */ -@/* processing to the system mode so nested IRQ interrupt processing */ -@/* is possible (system mode has its own "lr" register). Note that */ -@/* this function assumes that the system mode stack pointer was setup */ -@/* during low-level initialization (tx_initialize_low_level.s). */ -@/* */ -@/* This function returns with IRQ interrupts enabled. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_irq_nesting_start(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_irq_nesting_start ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from IRQ mode after */ +/* _tx_thread_context_save has been called and switches the IRQ */ +/* processing to the system mode so nested IRQ interrupt processing */ +/* is possible (system mode has its own "lr" register). Note that */ +/* this function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with IRQ interrupts enabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_irq_nesting_start .type _tx_thread_irq_nesting_start,function _tx_thread_irq_nesting_start: - MOV r3,lr @ Save ISR return address - MRS r0, CPSR @ Pickup the CPSR - BIC r0, r0, #MODE_MASK @ Clear the mode bits - ORR r0, r0, #SYS_MODE_BITS @ Build system mode CPSR - MSR CPSR_c, r0 @ Enter system mode - STMDB sp!, {r1, lr} @ Push the system mode lr on the system mode stack - @ and push r1 just to keep 8-byte alignment - BIC r0, r0, #IRQ_DISABLE @ Build enable IRQ CPSR - MSR CPSR_c, r0 @ Enter system mode + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + BIC r0, r0, #MODE_MASK // Clear the mode bits + ORR r0, r0, #SYS_MODE_BITS // Build system mode CPSR + MSR CPSR_c, r0 // Enter system mode + STMDB sp!, {r1, lr} // Push the system mode lr on the system mode stack + // and push r1 just to keep 8-byte alignment + BIC r0, r0, #IRQ_DISABLE // Build enable IRQ CPSR + MSR CPSR_c, r0 // Enter system mode #ifdef __THUMB_INTERWORK - BX r3 @ Return to caller + BX r3 // Return to caller #else - MOV pc, r3 @ Return to caller + MOV pc, r3 // Return to caller #endif -@} - diff --git a/ports/cortex_a9/ac6/src/tx_thread_schedule.S b/ports/cortex_a9/ac6/src/tx_thread_schedule.S index 680ff082..8330e9df 100644 --- a/ports/cortex_a9/ac6/src/tx_thread_schedule.S +++ b/ports/cortex_a9/ac6/src/tx_thread_schedule.S @@ -1,257 +1,230 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .global _tx_thread_execute_ptr .global _tx_thread_current_ptr .global _tx_timer_time_slice -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_schedule for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_schedule for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_schedule .type $_tx_thread_schedule,function $_tx_thread_schedule: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_schedule @ Call _tx_thread_schedule function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_schedule // Call _tx_thread_schedule function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_schedule Cortex-A9/AC6 */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function waits for a thread control block pointer to appear in */ -@/* the _tx_thread_execute_ptr variable. Once a thread pointer appears */ -@/* in the variable, the corresponding thread is resumed. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* _tx_initialize_kernel_enter ThreadX entry function */ -@/* _tx_thread_system_return Return to system from thread */ -@/* _tx_thread_context_restore Restore thread's context */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_schedule(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_schedule ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function waits for a thread control block pointer to appear in */ +/* the _tx_thread_execute_ptr variable. Once a thread pointer appears */ +/* in the variable, the corresponding thread is resumed. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_initialize_kernel_enter ThreadX entry function */ +/* _tx_thread_system_return Return to system from thread */ +/* _tx_thread_context_restore Restore thread's context */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_schedule .type _tx_thread_schedule,function _tx_thread_schedule: -@ -@ /* Enable interrupts. */ -@ + + /* Enable interrupts. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSIE if @ Enable IRQ and FIQ interrupts + CPSIE if // Enable IRQ and FIQ interrupts #else - CPSIE i @ Enable IRQ interrupts + CPSIE i // Enable IRQ interrupts #endif -@ -@ /* Wait for a thread to execute. */ -@ do -@ { - LDR r1, =_tx_thread_execute_ptr @ Address of thread execute ptr -@ + + /* Wait for a thread to execute. */ + LDR r1, =_tx_thread_execute_ptr // Address of thread execute ptr + __tx_thread_schedule_loop: -@ - LDR r0, [r1] @ Pickup next thread to execute - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_schedule_loop @ If so, keep looking for a thread -@ -@ } -@ while(_tx_thread_execute_ptr == TX_NULL); -@ -@ /* Yes! We have a thread to execute. Lockout interrupts and -@ transfer control to it. */ -@ + + LDR r0, [r1] // Pickup next thread to execute + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_schedule_loop // If so, keep looking for a thread + /* Yes! We have a thread to execute. Lockout interrupts and + transfer control to it. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ interrupts + CPSID if // Disable IRQ and FIQ interrupts #else - CPSID i @ Disable IRQ interrupts + CPSID i // Disable IRQ interrupts #endif -@ -@ /* Setup the current thread pointer. */ -@ _tx_thread_current_ptr = _tx_thread_execute_ptr; -@ - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread - STR r0, [r1] @ Setup current thread pointer -@ -@ /* Increment the run count for this thread. */ -@ _tx_thread_current_ptr -> tx_thread_run_count++; -@ - LDR r2, [r0, #4] @ Pickup run counter - LDR r3, [r0, #24] @ Pickup time-slice for this thread - ADD r2, r2, #1 @ Increment thread run-counter - STR r2, [r0, #4] @ Store the new run counter -@ -@ /* Setup time-slice, if present. */ -@ _tx_timer_time_slice = _tx_thread_current_ptr -> tx_thread_time_slice; -@ - LDR r2, =_tx_timer_time_slice @ Pickup address of time-slice - @ variable - LDR sp, [r0, #8] @ Switch stack pointers - STR r3, [r2] @ Setup time-slice -@ -@ /* Switch to the thread's stack. */ -@ sp = _tx_thread_execute_ptr -> tx_thread_stack_ptr; -@ + + /* Setup the current thread pointer. */ + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread + STR r0, [r1] // Setup current thread pointer + + /* Increment the run count for this thread. */ + + LDR r2, [r0, #4] // Pickup run counter + LDR r3, [r0, #24] // Pickup time-slice for this thread + ADD r2, r2, #1 // Increment thread run-counter + STR r2, [r0, #4] // Store the new run counter + + /* Setup time-slice, if present. */ + + LDR r2, =_tx_timer_time_slice // Pickup address of time-slice + // variable + LDR sp, [r0, #8] // Switch stack pointers + STR r3, [r2] // Setup time-slice + #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the thread entry function to indicate the thread is executing. */ -@ - MOV r5, r0 @ Save r0 - BL _tx_execution_thread_enter @ Call the thread execution enter function - MOV r0, r5 @ Restore r0 + + /* Call the thread entry function to indicate the thread is executing. */ + + MOV r5, r0 // Save r0 + BL _tx_execution_thread_enter // Call the thread execution enter function + MOV r0, r5 // Restore r0 #endif -@ -@ /* Determine if an interrupt frame or a synchronous task suspension frame -@ is present. */ -@ - LDMIA sp!, {r4, r5} @ Pickup the stack type and saved CPSR - CMP r4, #0 @ Check for synchronous context switch + + /* Determine if an interrupt frame or a synchronous task suspension frame + is present. */ + + LDMIA sp!, {r4, r5} // Pickup the stack type and saved CPSR + CMP r4, #0 // Check for synchronous context switch BEQ _tx_solicited_return - MSR SPSR_cxsf, r5 @ Setup SPSR for return + MSR SPSR_cxsf, r5 // Setup SPSR for return #ifdef TX_ENABLE_VFP_SUPPORT - LDR r1, [r0, #144] @ Pickup the VFP enabled flag - CMP r1, #0 @ Is the VFP enabled? - BEQ _tx_skip_interrupt_vfp_restore @ No, skip VFP interrupt restore - VLDMIA sp!, {D0-D15} @ Recover D0-D15 - VLDMIA sp!, {D16-D31} @ Recover D16-D31 - LDR r4, [sp], #4 @ Pickup FPSCR - VMSR FPSCR, r4 @ Restore FPSCR + LDR r1, [r0, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_interrupt_vfp_restore // No, skip VFP interrupt restore + VLDMIA sp!, {D0-D15} // Recover D0-D15 + VLDMIA sp!, {D16-D31} // Recover D16-D31 + LDR r4, [sp], #4 // Pickup FPSCR + VMSR FPSCR, r4 // Restore FPSCR _tx_skip_interrupt_vfp_restore: #endif - LDMIA sp!, {r0-r12, lr, pc}^ @ Return to point of thread interrupt + LDMIA sp!, {r0-r12, lr, pc}^ // Return to point of thread interrupt _tx_solicited_return: #ifdef TX_ENABLE_VFP_SUPPORT - LDR r1, [r0, #144] @ Pickup the VFP enabled flag - CMP r1, #0 @ Is the VFP enabled? - BEQ _tx_skip_solicited_vfp_restore @ No, skip VFP solicited restore - VLDMIA sp!, {D8-D15} @ Recover D8-D15 - VLDMIA sp!, {D16-D31} @ Recover D16-D31 - LDR r4, [sp], #4 @ Pickup FPSCR - VMSR FPSCR, r4 @ Restore FPSCR + LDR r1, [r0, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_solicited_vfp_restore // No, skip VFP solicited restore + VLDMIA sp!, {D8-D15} // Recover D8-D15 + VLDMIA sp!, {D16-D31} // Recover D16-D31 + LDR r4, [sp], #4 // Pickup FPSCR + VMSR FPSCR, r4 // Restore FPSCR _tx_skip_solicited_vfp_restore: #endif - MSR CPSR_cxsf, r5 @ Recover CPSR - LDMIA sp!, {r4-r11, lr} @ Return to thread synchronously + MSR CPSR_cxsf, r5 // Recover CPSR + LDMIA sp!, {r4-r11, lr} // Return to thread synchronously #ifdef __THUMB_INTERWORK - BX lr @ Return to caller + BX lr // Return to caller #else - MOV pc, lr @ Return to caller + MOV pc, lr // Return to caller #endif -@ -@} -@ #ifdef TX_ENABLE_VFP_SUPPORT .global tx_thread_vfp_enable .type tx_thread_vfp_enable,function tx_thread_vfp_enable: - MRS r2, CPSR @ Pickup the CPSR + MRS r2, CPSR // Pickup the CPSR #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Enable IRQ and FIQ interrupts + CPSID if // Enable IRQ and FIQ interrupts #else - CPSID i @ Enable IRQ interrupts + CPSID i // Enable IRQ interrupts #endif - LDR r0, =_tx_thread_current_ptr @ Build current thread pointer address - LDR r1, [r0] @ Pickup current thread pointer - CMP r1, #0 @ Check for NULL thread pointer - BEQ __tx_no_thread_to_enable @ If NULL, skip VFP enable - MOV r0, #1 @ Build enable value - STR r0, [r1, #144] @ Set the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) + LDR r0, =_tx_thread_current_ptr // Build current thread pointer address + LDR r1, [r0] // Pickup current thread pointer + CMP r1, #0 // Check for NULL thread pointer + BEQ __tx_no_thread_to_enable // If NULL, skip VFP enable + MOV r0, #1 // Build enable value + STR r0, [r1, #144] // Set the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) __tx_no_thread_to_enable: - MSR CPSR_cxsf, r2 @ Recover CPSR - BX LR @ Return to caller + MSR CPSR_cxsf, r2 // Recover CPSR + BX LR // Return to caller .global tx_thread_vfp_disable .type tx_thread_vfp_disable,function tx_thread_vfp_disable: - MRS r2, CPSR @ Pickup the CPSR + MRS r2, CPSR // Pickup the CPSR #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Enable IRQ and FIQ interrupts + CPSID if // Enable IRQ and FIQ interrupts #else - CPSID i @ Enable IRQ interrupts + CPSID i // Enable IRQ interrupts #endif - LDR r0, =_tx_thread_current_ptr @ Build current thread pointer address - LDR r1, [r0] @ Pickup current thread pointer - CMP r1, #0 @ Check for NULL thread pointer - BEQ __tx_no_thread_to_disable @ If NULL, skip VFP disable - MOV r0, #0 @ Build disable value - STR r0, [r1, #144] @ Clear the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) + LDR r0, =_tx_thread_current_ptr // Build current thread pointer address + LDR r1, [r0] // Pickup current thread pointer + CMP r1, #0 // Check for NULL thread pointer + BEQ __tx_no_thread_to_disable // If NULL, skip VFP disable + MOV r0, #0 // Build disable value + STR r0, [r1, #144] // Clear the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) __tx_no_thread_to_disable: - MSR CPSR_cxsf, r2 @ Recover CPSR - BX LR @ Return to caller + MSR CPSR_cxsf, r2 // Recover CPSR + BX LR // Return to caller #endif - diff --git a/ports/cortex_a9/ac6/src/tx_thread_stack_build.S b/ports/cortex_a9/ac6/src/tx_thread_stack_build.S index 3adf5080..f413e673 100644 --- a/ports/cortex_a9/ac6/src/tx_thread_stack_build.S +++ b/ports/cortex_a9/ac6/src/tx_thread_stack_build.S @@ -1,178 +1,164 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ .arm -SVC_MODE = 0x13 @ SVC mode +SVC_MODE = 0x13 // SVC mode #ifdef TX_ENABLE_FIQ_SUPPORT -CPSR_MASK = 0xDF @ Mask initial CPSR, IRQ & FIQ interrupts enabled +CPSR_MASK = 0xDF // Mask initial CPSR, IRQ & FIQ interrupts enabled #else -CPSR_MASK = 0x9F @ Mask initial CPSR, IRQ interrupts enabled +CPSR_MASK = 0x9F // Mask initial CPSR, IRQ interrupts enabled #endif -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_stack_build for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_stack_build for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .thumb .global $_tx_thread_stack_build .type $_tx_thread_stack_build,function $_tx_thread_stack_build: - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_stack_build @ Call _tx_thread_stack_build function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_stack_build // Call _tx_thread_stack_build function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_stack_build Cortex-A9/AC6 */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function builds a stack frame on the supplied thread's stack. */ -@/* The stack frame results in a fake interrupt return to the supplied */ -@/* function pointer. */ -@/* */ -@/* INPUT */ -@/* */ -@/* thread_ptr Pointer to thread control blk */ -@/* function_ptr Pointer to return function */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* _tx_thread_create Create thread service */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_stack_build(TX_THREAD *thread_ptr, VOID (*function_ptr)(VOID)) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_stack_build ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function builds a stack frame on the supplied thread's stack. */ +/* The stack frame results in a fake interrupt return to the supplied */ +/* function pointer. */ +/* */ +/* INPUT */ +/* */ +/* thread_ptr Pointer to thread control blk */ +/* function_ptr Pointer to return function */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_thread_create Create thread service */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_stack_build .type _tx_thread_stack_build,function _tx_thread_stack_build: -@ -@ -@ /* Build a fake interrupt frame. The form of the fake interrupt stack -@ on the Cortex-A9 should look like the following after it is built: -@ -@ Stack Top: 1 Interrupt stack frame type -@ CPSR Initial value for CPSR -@ a1 (r0) Initial value for a1 -@ a2 (r1) Initial value for a2 -@ a3 (r2) Initial value for a3 -@ a4 (r3) Initial value for a4 -@ v1 (r4) Initial value for v1 -@ v2 (r5) Initial value for v2 -@ v3 (r6) Initial value for v3 -@ v4 (r7) Initial value for v4 -@ v5 (r8) Initial value for v5 -@ sb (r9) Initial value for sb -@ sl (r10) Initial value for sl -@ fp (r11) Initial value for fp -@ ip (r12) Initial value for ip -@ lr (r14) Initial value for lr -@ pc (r15) Initial value for pc -@ 0 For stack backtracing -@ -@ Stack Bottom: (higher memory address) */ -@ - LDR r2, [r0, #16] @ Pickup end of stack area - BIC r2, r2, #7 @ Ensure 8-byte alignment - SUB r2, r2, #76 @ Allocate space for the stack frame -@ -@ /* Actually build the stack frame. */ -@ - MOV r3, #1 @ Build interrupt stack type - STR r3, [r2, #0] @ Store stack type - MOV r3, #0 @ Build initial register value - STR r3, [r2, #8] @ Store initial r0 - STR r3, [r2, #12] @ Store initial r1 - STR r3, [r2, #16] @ Store initial r2 - STR r3, [r2, #20] @ Store initial r3 - STR r3, [r2, #24] @ Store initial r4 - STR r3, [r2, #28] @ Store initial r5 - STR r3, [r2, #32] @ Store initial r6 - STR r3, [r2, #36] @ Store initial r7 - STR r3, [r2, #40] @ Store initial r8 - STR r3, [r2, #44] @ Store initial r9 - LDR r3, [r0, #12] @ Pickup stack starting address - STR r3, [r2, #48] @ Store initial r10 (sl) - LDR r3,=_tx_thread_schedule @ Pickup address of _tx_thread_schedule for GDB backtrace - STR r3, [r2, #60] @ Store initial r14 (lr) - MOV r3, #0 @ Build initial register value - STR r3, [r2, #52] @ Store initial r11 - STR r3, [r2, #56] @ Store initial r12 - STR r1, [r2, #64] @ Store initial pc - STR r3, [r2, #68] @ 0 for back-trace - MRS r1, CPSR @ Pickup CPSR - BIC r1, r1, #CPSR_MASK @ Mask mode bits of CPSR - ORR r3, r1, #SVC_MODE @ Build CPSR, SVC mode, interrupts enabled - STR r3, [r2, #4] @ Store initial CPSR -@ -@ /* Setup stack pointer. */ -@ thread_ptr -> tx_thread_stack_ptr = r2; -@ - STR r2, [r0, #8] @ Save stack pointer in thread's - @ control block + + + /* Build a fake interrupt frame. The form of the fake interrupt stack + on the ARMv7-A should look like the following after it is built: + + Stack Top: 1 Interrupt stack frame type + CPSR Initial value for CPSR + a1 (r0) Initial value for a1 + a2 (r1) Initial value for a2 + a3 (r2) Initial value for a3 + a4 (r3) Initial value for a4 + v1 (r4) Initial value for v1 + v2 (r5) Initial value for v2 + v3 (r6) Initial value for v3 + v4 (r7) Initial value for v4 + v5 (r8) Initial value for v5 + sb (r9) Initial value for sb + sl (r10) Initial value for sl + fp (r11) Initial value for fp + ip (r12) Initial value for ip + lr (r14) Initial value for lr + pc (r15) Initial value for + 0 For stack backtracing + + Stack Bottom: (higher memory address) */ + + LDR r2, [r0, #16] // Pickup end of stack area + BIC r2, r2, #7 // Ensure 8-byte alignment + SUB r2, r2, #76 // Allocate space for the stack frame + + /* Actually build the stack frame. */ + + MOV r3, #1 // Build interrupt stack type + STR r3, [r2, #0] // Store stack type + MOV r3, #0 // Build initial register value + STR r3, [r2, #8] // Store initial r0 + STR r3, [r2, #12] // Store initial r1 + STR r3, [r2, #16] // Store initial r2 + STR r3, [r2, #20] // Store initial r3 + STR r3, [r2, #24] // Store initial r4 + STR r3, [r2, #28] // Store initial r5 + STR r3, [r2, #32] // Store initial r6 + STR r3, [r2, #36] // Store initial r7 + STR r3, [r2, #40] // Store initial r8 + STR r3, [r2, #44] // Store initial r9 + LDR r3, [r0, #12] // Pickup stack starting address + STR r3, [r2, #48] // Store initial r10 (sl) + LDR r3,=_tx_thread_schedule // Pickup address of _tx_thread_schedule for GDB backtrace + STR r3, [r2, #60] // Store initial r14 (lr) + MOV r3, #0 // Build initial register value + STR r3, [r2, #52] // Store initial r11 + STR r3, [r2, #56] // Store initial r12 + STR r1, [r2, #64] // Store initial pc + STR r3, [r2, #68] // 0 for back-trace + MRS r1, CPSR // Pickup CPSR + BIC r1, r1, #CPSR_MASK // Mask mode bits of CPSR + ORR r3, r1, #SVC_MODE // Build CPSR, SVC mode, interrupts enabled + STR r3, [r2, #4] // Store initial CPSR + + /* Setup stack pointer. */ + + STR r2, [r0, #8] // Save stack pointer in thread's + // control block #ifdef __THUMB_INTERWORK - BX lr @ Return to caller + BX lr // Return to caller #else - MOV pc, lr @ Return to caller + MOV pc, lr // Return to caller #endif -@} - - diff --git a/ports/cortex_a9/ac6/src/tx_thread_system_return.S b/ports/cortex_a9/ac6/src/tx_thread_system_return.S index 92669799..cb7d62ce 100644 --- a/ports/cortex_a9/ac6/src/tx_thread_system_return.S +++ b/ports/cortex_a9/ac6/src/tx_thread_system_return.S @@ -1,182 +1,162 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .arm -@ -@ + + .global _tx_thread_current_ptr .global _tx_timer_time_slice .global _tx_thread_schedule -@ -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_system_return for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_system_return for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_system_return .type $_tx_thread_system_return,function $_tx_thread_system_return: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_system_return @ Call _tx_thread_system_return function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_system_return // Call _tx_thread_system_return function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_system_return Cortex-A9/AC6 */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is target processor specific. It is used to transfer */ -@/* control from a thread back to the ThreadX system. Only a */ -@/* minimal context is saved since the compiler assumes temp registers */ -@/* are going to get slicked by a function call anyway. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* _tx_thread_schedule Thread scheduling loop */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ThreadX components */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_system_return(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_system_return ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is target processor specific. It is used to transfer */ +/* control from a thread back to the ThreadX system. Only a */ +/* minimal context is saved since the compiler assumes temp registers */ +/* are going to get slicked by a function call anyway. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling loop */ +/* */ +/* CALLED BY */ +/* */ +/* ThreadX components */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_system_return .type _tx_thread_system_return,function _tx_thread_system_return: -@ -@ /* Save minimal context on the stack. */ -@ - STMDB sp!, {r4-r11, lr} @ Save minimal context - LDR r4, =_tx_thread_current_ptr @ Pickup address of current ptr - LDR r5, [r4] @ Pickup current thread pointer - + /* Save minimal context on the stack. */ + + STMDB sp!, {r4-r11, lr} // Save minimal context + + LDR r4, =_tx_thread_current_ptr // Pickup address of current ptr + LDR r5, [r4] // Pickup current thread pointer + #ifdef TX_ENABLE_VFP_SUPPORT - LDR r1, [r5, #144] @ Pickup the VFP enabled flag - CMP r1, #0 @ Is the VFP enabled? - BEQ _tx_skip_solicited_vfp_save @ No, skip VFP solicited save - VMRS r1, FPSCR @ Pickup the FPSCR - STR r1, [sp, #-4]! @ Save FPSCR - VSTMDB sp!, {D16-D31} @ Save D16-D31 - VSTMDB sp!, {D8-D15} @ Save D8-D15 + LDR r1, [r5, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_solicited_vfp_save // No, skip VFP solicited save + VMRS r1, FPSCR // Pickup the FPSCR + STR r1, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D8-D15} // Save D8-D15 _tx_skip_solicited_vfp_save: #endif - MOV r0, #0 @ Build a solicited stack type - MRS r1, CPSR @ Pickup the CPSR - STMDB sp!, {r0-r1} @ Save type and CPSR -@ -@ /* Lockout interrupts. */ -@ -#ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ interrupts -#else - CPSID i @ Disable IRQ interrupts -#endif - -#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the thread exit function to indicate the thread is no longer executing. */ -@ - BL _tx_execution_thread_exit @ Call the thread exit function -#endif - MOV r3, r4 @ Pickup address of current ptr - MOV r0, r5 @ Pickup current thread pointer - LDR r2, =_tx_timer_time_slice @ Pickup address of time slice - LDR r1, [r2] @ Pickup current time slice -@ -@ /* Save current stack and switch to system stack. */ -@ _tx_thread_current_ptr -> tx_thread_stack_ptr = sp; -@ sp = _tx_thread_system_stack_ptr; -@ - STR sp, [r0, #8] @ Save thread stack pointer -@ -@ /* Determine if the time-slice is active. */ -@ if (_tx_timer_time_slice) -@ { -@ - MOV r4, #0 @ Build clear value - CMP r1, #0 @ Is a time-slice active? - BEQ __tx_thread_dont_save_ts @ No, don't save the time-slice -@ -@ /* Save time-slice for the thread and clear the current time-slice. */ -@ _tx_thread_current_ptr -> tx_thread_time_slice = _tx_timer_time_slice; -@ _tx_timer_time_slice = 0; -@ - STR r4, [r2] @ Clear time-slice - STR r1, [r0, #24] @ Save current time-slice -@ -@ } -__tx_thread_dont_save_ts: -@ -@ /* Clear the current thread pointer. */ -@ _tx_thread_current_ptr = TX_NULL; -@ - STR r4, [r3] @ Clear current thread pointer - B _tx_thread_schedule @ Jump to scheduler! -@ -@} + MOV r0, #0 // Build a solicited stack type + MRS r1, CPSR // Pickup the CPSR + STMDB sp!, {r0-r1} // Save type and CPSR + /* Lockout interrupts. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Disable IRQ and FIQ interrupts +#else + CPSID i // Disable IRQ interrupts +#endif + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the thread exit function to indicate the thread is no longer executing. */ + + BL _tx_execution_thread_exit // Call the thread exit function +#endif + MOV r3, r4 // Pickup address of current ptr + MOV r0, r5 // Pickup current thread pointer + LDR r2, =_tx_timer_time_slice // Pickup address of time slice + LDR r1, [r2] // Pickup current time slice + + /* Save current stack and switch to system stack. */ + + STR sp, [r0, #8] // Save thread stack pointer + + /* Determine if the time-slice is active. */ + + MOV r4, #0 // Build clear value + CMP r1, #0 // Is a time-slice active? + BEQ __tx_thread_dont_save_ts // No, don't save the time-slice + + /* Save time-slice for the thread and clear the current time-slice. */ + + STR r4, [r2] // Clear time-slice + STR r1, [r0, #24] // Save current time-slice + +__tx_thread_dont_save_ts: + + /* Clear the current thread pointer. */ + + STR r4, [r3] // Clear current thread pointer + B _tx_thread_schedule // Jump to scheduler! diff --git a/ports/cortex_a9/ac6/src/tx_thread_vectored_context_save.S b/ports/cortex_a9/ac6/src/tx_thread_vectored_context_save.S index a7e25a32..d846223f 100644 --- a/ports/cortex_a9/ac6/src/tx_thread_vectored_context_save.S +++ b/ports/cortex_a9/ac6/src/tx_thread_vectored_context_save.S @@ -1,192 +1,165 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .global _tx_thread_system_state .global _tx_thread_current_ptr -@ -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_vectored_context_save -@ since it will never be called 16-bit mode. */ -@ + .global _tx_execution_isr_enter + + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_vectored_context_save + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_vectored_context_save Cortex-A9/AC6 */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function saves the context of an executing thread in the */ -@/* beginning of interrupt processing. The function also ensures that */ -@/* the system stack is used upon return to the calling ISR. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_vectored_context_save(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_vectored_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_vectored_context_save .type _tx_thread_vectored_context_save,function _tx_thread_vectored_context_save: -@ -@ /* Upon entry to this routine, it is assumed that IRQ interrupts are locked -@ out, we are in IRQ mode, and all registers are intact. */ -@ -@ /* Check for a nested interrupt condition. */ -@ if (_tx_thread_system_state++) -@ { -@ + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ interrupts + CPSID if // Disable IRQ and FIQ interrupts #endif - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3, #0] @ Pickup system state - CMP r2, #0 @ Is this the first interrupt? - BEQ __tx_thread_not_nested_save @ Yes, not a nested context save -@ -@ /* Nested interrupt condition. */ -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3, #0] @ Store it back in the variable -@ -@ /* Note: Minimal context of interrupted thread is already saved. */ -@ -@ /* Return to the ISR. */ -@ - MOV r10, #0 @ Clear stack limit + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3, #0] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3, #0] // Store it back in the variable + + /* Note: Minimal context of interrupted thread is already saved. */ + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - MOV pc, lr @ Return to caller -@ + MOV pc, lr // Return to caller + __tx_thread_not_nested_save: -@ } -@ -@ /* Otherwise, not nested, check to see if a thread was running. */ -@ else if (_tx_thread_current_ptr) -@ { -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3, #0] @ Store it back in the variable - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1, #0] @ Pickup current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_idle_system_save @ If so, interrupt occurred in - @ scheduling loop - nothing needs saving! -@ -@ /* Note: Minimal context of interrupted thread is already saved. */ -@ -@ /* Save the current stack pointer in the thread's control block. */ -@ _tx_thread_current_ptr -> tx_thread_stack_ptr = sp; -@ -@ /* Switch to the system stack. */ -@ sp = _tx_thread_system_stack_ptr; -@ - MOV r10, #0 @ Clear stack limit + + /* Otherwise, not nested, check to see if a thread was running. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3, #0] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1, #0] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + /* Note: Minimal context of interrupted thread is already saved. */ + + /* Save the current stack pointer in the thread's control block. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - MOV pc, lr @ Return to caller -@ -@ } -@ else -@ { -@ + MOV pc, lr // Return to caller + __tx_thread_idle_system_save: -@ -@ /* Interrupt occurred in the scheduling loop. */ -@ -@ /* Not much to do here, just adjust the stack pointer, and return to IRQ -@ processing. */ -@ - MOV r10, #0 @ Clear stack limit + + /* Interrupt occurred in the scheduling loop. */ + + /* Not much to do here, just adjust the stack pointer, and return to IRQ + processing. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - ADD sp, sp, #32 @ Recover saved registers - MOV pc, lr @ Return to caller -@ -@ } -@} - + ADD sp, sp, #32 // Recover saved registers + MOV pc, lr // Return to caller diff --git a/ports/cortex_a9/ac6/src/tx_timer_interrupt.S b/ports/cortex_a9/ac6/src/tx_timer_interrupt.S index fa28e728..7337ed0c 100644 --- a/ports/cortex_a9/ac6/src/tx_timer_interrupt.S +++ b/ports/cortex_a9/ac6/src/tx_timer_interrupt.S @@ -1,40 +1,30 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Timer */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_timer.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Timer */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .arm -@ -@/* Define Assembly language external references... */ -@ + +/* Define Assembly language external references... */ + .global _tx_timer_time_slice .global _tx_timer_system_clock .global _tx_timer_current_ptr @@ -43,237 +33,199 @@ .global _tx_timer_expired_time_slice .global _tx_timer_expired .global _tx_thread_time_slice -@ -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_timer_interrupt for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + + + +/* Define the 16-bit Thumb mode veneer for _tx_timer_interrupt for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .thumb .global $_tx_timer_interrupt .type $_tx_timer_interrupt,function $_tx_timer_interrupt: - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_timer_interrupt @ Call _tx_timer_interrupt function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_timer_interrupt // Call _tx_timer_interrupt function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_timer_interrupt Cortex-A9/AC6 */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function processes the hardware timer interrupt. This */ -@/* processing includes incrementing the system clock and checking for */ -@/* time slice and/or timer expiration. If either is found, the */ -@/* interrupt context save/restore functions are called along with the */ -@/* expiration functions. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* _tx_thread_time_slice Time slice interrupted thread */ -@/* _tx_timer_expiration_process Timer expiration processing */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* interrupt vector */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_timer_interrupt(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_timer_interrupt ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function processes the hardware timer interrupt. This */ +/* processing includes incrementing the system clock and checking for */ +/* time slice and/or timer expiration. If either is found, the */ +/* interrupt context save/restore functions are called along with the */ +/* expiration functions. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_time_slice Time slice interrupted thread */ +/* _tx_timer_expiration_process Timer expiration processing */ +/* */ +/* CALLED BY */ +/* */ +/* interrupt vector */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_timer_interrupt .type _tx_timer_interrupt,function _tx_timer_interrupt: -@ -@ /* Upon entry to this routine, it is assumed that context save has already -@ been called, and therefore the compiler scratch registers are available -@ for use. */ -@ -@ /* Increment the system clock. */ -@ _tx_timer_system_clock++; -@ - LDR r1, =_tx_timer_system_clock @ Pickup address of system clock - LDR r0, [r1] @ Pickup system clock - ADD r0, r0, #1 @ Increment system clock - STR r0, [r1] @ Store new system clock -@ -@ /* Test for time-slice expiration. */ -@ if (_tx_timer_time_slice) -@ { -@ - LDR r3, =_tx_timer_time_slice @ Pickup address of time-slice - LDR r2, [r3] @ Pickup time-slice - CMP r2, #0 @ Is it non-active? - BEQ __tx_timer_no_time_slice @ Yes, skip time-slice processing -@ -@ /* Decrement the time_slice. */ -@ _tx_timer_time_slice--; -@ - SUB r2, r2, #1 @ Decrement the time-slice - STR r2, [r3] @ Store new time-slice value -@ -@ /* Check for expiration. */ -@ if (__tx_timer_time_slice == 0) -@ - CMP r2, #0 @ Has it expired? - BNE __tx_timer_no_time_slice @ No, skip expiration processing -@ -@ /* Set the time-slice expired flag. */ -@ _tx_timer_expired_time_slice = TX_TRUE; -@ - LDR r3, =_tx_timer_expired_time_slice @ Pickup address of expired flag - MOV r0, #1 @ Build expired value - STR r0, [r3] @ Set time-slice expiration flag -@ -@ } -@ -__tx_timer_no_time_slice: -@ -@ /* Test for timer expiration. */ -@ if (*_tx_timer_current_ptr) -@ { -@ - LDR r1, =_tx_timer_current_ptr @ Pickup current timer pointer address - LDR r0, [r1] @ Pickup current timer - LDR r2, [r0] @ Pickup timer list entry - CMP r2, #0 @ Is there anything in the list? - BEQ __tx_timer_no_timer @ No, just increment the timer -@ -@ /* Set expiration flag. */ -@ _tx_timer_expired = TX_TRUE; -@ - LDR r3, =_tx_timer_expired @ Pickup expiration flag address - MOV r2, #1 @ Build expired value - STR r2, [r3] @ Set expired flag - B __tx_timer_done @ Finished timer processing -@ -@ } -@ else -@ { -__tx_timer_no_timer: -@ -@ /* No timer expired, increment the timer pointer. */ -@ _tx_timer_current_ptr++; -@ - ADD r0, r0, #4 @ Move to next timer -@ -@ /* Check for wraparound. */ -@ if (_tx_timer_current_ptr == _tx_timer_list_end) -@ - LDR r3, =_tx_timer_list_end @ Pickup address of timer list end - LDR r2, [r3] @ Pickup list end - CMP r0, r2 @ Are we at list end? - BNE __tx_timer_skip_wrap @ No, skip wraparound logic -@ -@ /* Wrap to beginning of list. */ -@ _tx_timer_current_ptr = _tx_timer_list_start; -@ - LDR r3, =_tx_timer_list_start @ Pickup address of timer list start - LDR r0, [r3] @ Set current pointer to list start -@ -__tx_timer_skip_wrap: -@ - STR r0, [r1] @ Store new current timer pointer -@ } -@ -__tx_timer_done: -@ -@ -@ /* See if anything has expired. */ -@ if ((_tx_timer_expired_time_slice) || (_tx_timer_expired)) -@ { -@ - LDR r3, =_tx_timer_expired_time_slice @ Pickup address of expired flag - LDR r2, [r3] @ Pickup time-slice expired flag - CMP r2, #0 @ Did a time-slice expire? - BNE __tx_something_expired @ If non-zero, time-slice expired - LDR r1, =_tx_timer_expired @ Pickup address of other expired flag - LDR r0, [r1] @ Pickup timer expired flag - CMP r0, #0 @ Did a timer expire? - BEQ __tx_timer_nothing_expired @ No, nothing expired -@ -__tx_something_expired: -@ -@ - STMDB sp!, {r0, lr} @ Save the lr register on the stack - @ and save r0 just to keep 8-byte alignment -@ -@ /* Did a timer expire? */ -@ if (_tx_timer_expired) -@ { -@ - LDR r1, =_tx_timer_expired @ Pickup address of expired flag - LDR r0, [r1] @ Pickup timer expired flag - CMP r0, #0 @ Check for timer expiration - BEQ __tx_timer_dont_activate @ If not set, skip timer activation -@ -@ /* Process timer expiration. */ -@ _tx_timer_expiration_process(); -@ - BL _tx_timer_expiration_process @ Call the timer expiration handling routine -@ -@ } -__tx_timer_dont_activate: -@ -@ /* Did time slice expire? */ -@ if (_tx_timer_expired_time_slice) -@ { -@ - LDR r3, =_tx_timer_expired_time_slice @ Pickup address of time-slice expired - LDR r2, [r3] @ Pickup the actual flag - CMP r2, #0 @ See if the flag is set - BEQ __tx_timer_not_ts_expiration @ No, skip time-slice processing -@ -@ /* Time slice interrupted thread. */ -@ _tx_thread_time_slice(); -@ - BL _tx_thread_time_slice @ Call time-slice processing -@ -@ } -@ -__tx_timer_not_ts_expiration: -@ - LDMIA sp!, {r0, lr} @ Recover lr register (r0 is just there for - @ the 8-byte stack alignment -@ -@ } -@ -__tx_timer_nothing_expired: -@ -#ifdef __THUMB_INTERWORK - BX lr @ Return to caller -#else - MOV pc, lr @ Return to caller -#endif -@ -@} + /* Upon entry to this routine, it is assumed that context save has already + been called, and therefore the compiler scratch registers are available + for use. */ + + /* Increment the system clock. */ + + LDR r1, =_tx_timer_system_clock // Pickup address of system clock + LDR r0, [r1] // Pickup system clock + ADD r0, r0, #1 // Increment system clock + STR r0, [r1] // Store new system clock + + /* Test for time-slice expiration. */ + + LDR r3, =_tx_timer_time_slice // Pickup address of time-slice + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it non-active? + BEQ __tx_timer_no_time_slice // Yes, skip time-slice processing + + /* Decrement the time_slice. */ + + SUB r2, r2, #1 // Decrement the time-slice + STR r2, [r3] // Store new time-slice value + + /* Check for expiration. */ + + CMP r2, #0 // Has it expired? + BNE __tx_timer_no_time_slice // No, skip expiration processing + + /* Set the time-slice expired flag. */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of expired flag + MOV r0, #1 // Build expired value + STR r0, [r3] // Set time-slice expiration flag + +__tx_timer_no_time_slice: + + /* Test for timer expiration. */ + + LDR r1, =_tx_timer_current_ptr // Pickup current timer pointer address + LDR r0, [r1] // Pickup current timer + LDR r2, [r0] // Pickup timer list entry + CMP r2, #0 // Is there anything in the list? + BEQ __tx_timer_no_timer // No, just increment the timer + + /* Set expiration flag. */ + + LDR r3, =_tx_timer_expired // Pickup expiration flag address + MOV r2, #1 // Build expired value + STR r2, [r3] // Set expired flag + B __tx_timer_done // Finished timer processing + +__tx_timer_no_timer: + + /* No timer expired, increment the timer pointer. */ + ADD r0, r0, #4 // Move to next timer + + /* Check for wraparound. */ + + LDR r3, =_tx_timer_list_end // Pickup address of timer list end + LDR r2, [r3] // Pickup list end + CMP r0, r2 // Are we at list end? + BNE __tx_timer_skip_wrap // No, skip wraparound logic + + /* Wrap to beginning of list. */ + + LDR r3, =_tx_timer_list_start // Pickup address of timer list start + LDR r0, [r3] // Set current pointer to list start + +__tx_timer_skip_wrap: + + STR r0, [r1] // Store new current timer pointer + +__tx_timer_done: + + /* See if anything has expired. */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of expired flag + LDR r2, [r3] // Pickup time-slice expired flag + CMP r2, #0 // Did a time-slice expire? + BNE __tx_something_expired // If non-zero, time-slice expired + LDR r1, =_tx_timer_expired // Pickup address of other expired flag + LDR r0, [r1] // Pickup timer expired flag + CMP r0, #0 // Did a timer expire? + BEQ __tx_timer_nothing_expired // No, nothing expired + +__tx_something_expired: + + STMDB sp!, {r0, lr} // Save the lr register on the stack + // and save r0 just to keep 8-byte alignment + + /* Did a timer expire? */ + + LDR r1, =_tx_timer_expired // Pickup address of expired flag + LDR r0, [r1] // Pickup timer expired flag + CMP r0, #0 // Check for timer expiration + BEQ __tx_timer_dont_activate // If not set, skip timer activation + + /* Process timer expiration. */ + BL _tx_timer_expiration_process // Call the timer expiration handling routine + +__tx_timer_dont_activate: + + /* Did time slice expire? */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of time-slice expired + LDR r2, [r3] // Pickup the actual flag + CMP r2, #0 // See if the flag is set + BEQ __tx_timer_not_ts_expiration // No, skip time-slice processing + + /* Time slice interrupted thread. */ + + BL _tx_thread_time_slice // Call time-slice processing + +__tx_timer_not_ts_expiration: + + LDMIA sp!, {r0, lr} // Recover lr register (r0 is just there for + // the 8-byte stack alignment + +__tx_timer_nothing_expired: + +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a9/gnu/example_build/build_threadx_sample.bat b/ports/cortex_a9/gnu/example_build/build_threadx_sample.bat index e6ddefad..1a558630 100644 --- a/ports/cortex_a9/gnu/example_build/build_threadx_sample.bat +++ b/ports/cortex_a9/gnu/example_build/build_threadx_sample.bat @@ -2,5 +2,5 @@ arm-none-eabi-gcc -c -g -mcpu=cortex-a9 reset.S arm-none-eabi-gcc -c -g -mcpu=cortex-a9 crt0.S arm-none-eabi-gcc -c -g -mcpu=cortex-a9 tx_initialize_low_level.S arm-none-eabi-gcc -c -g -mcpu=cortex-a9 -I../../../../common/inc -I../inc sample_threadx.c -arm-none-eabi-ld -A cortex-a9 -T sample_threadx.ld reset.o crt0.o tx_initialize_low_level.o sample_threadx.o tx.a libc.a libgcc.a -o sample_threadx.out -M > sample_threadx.map +arm-none-eabi-gcc -g -mcpu=cortex-a8 -T sample_threadx.ld --specs=nosys.specs -o sample_threadx.out -Wl,-Map=sample_threadx.map tx_initialize_low_level.o sample_threadx.o tx.a diff --git a/ports/cortex_a9/gnu/example_build/crt0.S b/ports/cortex_a9/gnu/example_build/crt0.S index aa0f3239..56b6c958 100644 --- a/ports/cortex_a9/gnu/example_build/crt0.S +++ b/ports/cortex_a9/gnu/example_build/crt0.S @@ -26,13 +26,13 @@ _mainCRTStartup: mov a2, #0 /* Second arg: fill value */ mov fp, a2 /* Null frame pointer */ mov r7, a2 /* Null frame pointer for Thumb */ - - ldr a1, .LC1 /* First arg: start of memory block */ - ldr a3, .LC2 - sub a3, a3, a1 /* Third arg: length of block */ - - + ldr a1, .LC1 /* First arg: start of memory block */ + ldr a3, .LC2 + sub a3, a3, a1 /* Third arg: length of block */ + + + bl memset mov r0, #0 /* no arguments */ mov r1, #0 /* no argv either */ @@ -48,15 +48,15 @@ _mainCRTStartup: /* bl init */ mov r0, r4 mov r1, r5 -#endif +#endif bl main bl exit /* Should not return. */ - - /* For Thumb, constants must be after the code since only + + /* For Thumb, constants must be after the code since only positive offsets are supported for PC relative addresses. */ - + .align 0 .LC0: .LC1: diff --git a/ports/cortex_a9/gnu/example_build/reset.S b/ports/cortex_a9/gnu/example_build/reset.S index 856e31eb..597e9d9a 100644 --- a/ports/cortex_a9/gnu/example_build/reset.S +++ b/ports/cortex_a9/gnu/example_build/reset.S @@ -1,35 +1,24 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Initialize */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_initialize.h" -@#include "tx_thread.h" -@#include "tx_timer.h" +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Initialize */ +/** */ +/**************************************************************************/ +/**************************************************************************/ .arm @@ -41,36 +30,35 @@ .global __tx_reserved_handler .global __tx_irq_handler .global __tx_fiq_handler -@ -@ -@/* Define the vector area. This should be located or copied to 0. */ -@ + +/* Define the vector area. This should be located or copied to 0. */ + .text .global __vectors __vectors: - LDR pc, STARTUP @ Reset goes to startup function - LDR pc, UNDEFINED @ Undefined handler - LDR pc, SWI @ Software interrupt handler - LDR pc, PREFETCH @ Prefetch exception handler - LDR pc, ABORT @ Abort exception handler - LDR pc, RESERVED @ Reserved exception handler - LDR pc, IRQ @ IRQ interrupt handler - LDR pc, FIQ @ FIQ interrupt handler + LDR pc, STARTUP // Reset goes to startup function + LDR pc, UNDEFINED // Undefined handler + LDR pc, SWI // Software interrupt handler + LDR pc, PREFETCH // Prefetch exception handler + LDR pc, ABORT // Abort exception handler + LDR pc, RESERVED // Reserved exception handler + LDR pc, IRQ // IRQ interrupt handler + LDR pc, FIQ // FIQ interrupt handler STARTUP: - .word _start @ Reset goes to C startup function + .word _start // Reset goes to C startup function UNDEFINED: - .word __tx_undefined @ Undefined handler + .word __tx_undefined // Undefined handler SWI: - .word __tx_swi_interrupt @ Software interrupt handler + .word __tx_swi_interrupt // Software interrupt handler PREFETCH: - .word __tx_prefetch_handler @ Prefetch exception handler -ABORT: - .word __tx_abort_handler @ Abort exception handler -RESERVED: - .word __tx_reserved_handler @ Reserved exception handler -IRQ: - .word __tx_irq_handler @ IRQ interrupt handler + .word __tx_prefetch_handler // Prefetch exception handler +ABORT: + .word __tx_abort_handler // Abort exception handler +RESERVED: + .word __tx_reserved_handler // Reserved exception handler +IRQ: + .word __tx_irq_handler // IRQ interrupt handler FIQ: - .word __tx_fiq_handler @ FIQ interrupt handler + .word __tx_fiq_handler // FIQ interrupt handler diff --git a/ports/cortex_a9/gnu/example_build/sample_threadx.c b/ports/cortex_a9/gnu/example_build/sample_threadx.c index 418ec634..8c61de06 100644 --- a/ports/cortex_a9/gnu/example_build/sample_threadx.c +++ b/ports/cortex_a9/gnu/example_build/sample_threadx.c @@ -1,5 +1,5 @@ /* This is a small demo of the high-performance ThreadX kernel. It includes examples of eight - threads of different priorities, using a message queue, semaphore, mutex, event flags group, + threads of different priorities, using a message queue, semaphore, mutex, event flags group, byte pool, and block pool. */ #include "tx_api.h" @@ -80,42 +80,42 @@ CHAR *pointer = TX_NULL; tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); /* Create the main thread. */ - tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, 1, 1, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 1. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - /* Create threads 1 and 2. These threads pass information through a ThreadX + /* Create threads 1 and 2. These threads pass information through a ThreadX message queue. It is also interesting to note that these threads have a time slice. */ - tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1, + pointer, DEMO_STACK_SIZE, 16, 16, 4, TX_AUTO_START); /* Allocate the stack for thread 2. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2, + pointer, DEMO_STACK_SIZE, 16, 16, 4, TX_AUTO_START); /* Allocate the stack for thread 3. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - /* Create threads 3 and 4. These threads compete for a ThreadX counting semaphore. + /* Create threads 3 and 4. These threads compete for a ThreadX counting semaphore. An interesting thing here is that both threads share the same instruction area. */ - tx_thread_create(&thread_3, "thread 3", thread_3_and_4_entry, 3, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_3, "thread 3", thread_3_and_4_entry, 3, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 4. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - tx_thread_create(&thread_4, "thread 4", thread_3_and_4_entry, 4, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_4, "thread 4", thread_3_and_4_entry, 4, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 5. */ @@ -123,23 +123,23 @@ CHAR *pointer = TX_NULL; /* Create thread 5. This thread simply pends on an event flag which will be set by thread_0. */ - tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5, + pointer, DEMO_STACK_SIZE, 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 6. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); /* Create threads 6 and 7. These threads compete for a ThreadX mutex. */ - tx_thread_create(&thread_6, "thread 6", thread_6_and_7_entry, 6, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_6, "thread 6", thread_6_and_7_entry, 6, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 7. */ tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - tx_thread_create(&thread_7, "thread 7", thread_6_and_7_entry, 7, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&thread_7, "thread 7", thread_6_and_7_entry, 7, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the message queue. */ @@ -242,11 +242,11 @@ UINT status; /* Retrieve a message from the queue. */ status = tx_queue_receive(&queue_0, &received_message, TX_WAIT_FOREVER); - /* Check completion status and make sure the message is what we + /* Check completion status and make sure the message is what we expected. */ if ((status != TX_SUCCESS) || (received_message != thread_2_messages_received)) break; - + /* Otherwise, all is okay. Increment the received message count. */ thread_2_messages_received++; } @@ -305,7 +305,7 @@ ULONG actual_flags; thread_5_counter++; /* Wait for event flag 0. */ - status = tx_event_flags_get(&event_flags_0, 0x1, TX_OR_CLEAR, + status = tx_event_flags_get(&event_flags_0, 0x1, TX_OR_CLEAR, &actual_flags, TX_WAIT_FOREVER); /* Check status. */ @@ -358,7 +358,7 @@ UINT status; if (status != TX_SUCCESS) break; - /* Release the mutex again. This will actually + /* Release the mutex again. This will actually release ownership since it was obtained twice. */ status = tx_mutex_put(&mutex_0); diff --git a/ports/cortex_a9/gnu/example_build/tx_initialize_low_level.S b/ports/cortex_a9/gnu/example_build/tx_initialize_low_level.S index 2e274666..7de5d3ce 100644 --- a/ports/cortex_a9/gnu/example_build/tx_initialize_low_level.S +++ b/ports/cortex_a9/gnu/example_build/tx_initialize_low_level.S @@ -1,47 +1,35 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Initialize */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_initialize.h" -@#include "tx_thread.h" -@#include "tx_timer.h" +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Initialize */ +/** */ +/**************************************************************************/ +/**************************************************************************/ .arm -SVC_MODE = 0xD3 @ Disable IRQ/FIQ SVC mode -IRQ_MODE = 0xD2 @ Disable IRQ/FIQ IRQ mode -FIQ_MODE = 0xD1 @ Disable IRQ/FIQ FIQ mode -SYS_MODE = 0xDF @ Disable IRQ/FIQ SYS mode -FIQ_STACK_SIZE = 512 @ FIQ stack size -IRQ_STACK_SIZE = 1024 @ IRQ stack size -SYS_STACK_SIZE = 1024 @ System stack size -@ -@ +SVC_MODE = 0xD3 // Disable IRQ/FIQ SVC mode +IRQ_MODE = 0xD2 // Disable IRQ/FIQ IRQ mode +FIQ_MODE = 0xD1 // Disable IRQ/FIQ FIQ mode +SYS_MODE = 0xDF // Disable IRQ/FIQ SYS mode +FIQ_STACK_SIZE = 512 // FIQ stack size +IRQ_STACK_SIZE = 1024 // IRQ stack size +SYS_STACK_SIZE = 1024 // System stack size + .global _tx_thread_system_stack_ptr .global _tx_initialize_unused_memory .global _tx_thread_context_save @@ -51,297 +39,267 @@ SYS_STACK_SIZE = 1024 @ System stack size .global _sp .global _stack_bottom -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_initialize_low_level for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + +/* Define the 16-bit Thumb mode veneer for _tx_initialize_low_level for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .thumb .global $_tx_initialize_low_level .type $_tx_initialize_low_level,function $_tx_initialize_low_level: - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_initialize_low_level @ Call _tx_initialize_low_level function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_initialize_low_level // Call _tx_initialize_low_level function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_initialize_low_level Cortex-A9/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is responsible for any low-level processor */ -@/* initialization, including setting up interrupt vectors, setting */ -@/* up a periodic timer interrupt source, saving the system stack */ -@/* pointer for use in ISR processing later, and finding the first */ -@/* available RAM memory address for tx_application_define. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* _tx_initialize_kernel_enter ThreadX entry function */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_initialize_low_level(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_initialize_low_level ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for any low-level processor */ +/* initialization, including setting up interrupt vectors, setting */ +/* up a periodic timer interrupt source, saving the system stack */ +/* pointer for use in ISR processing later, and finding the first */ +/* available RAM memory address for tx_application_define. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_initialize_kernel_enter ThreadX entry function */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_initialize_low_level .type _tx_initialize_low_level,function _tx_initialize_low_level: -@ -@ /* We must be in SVC mode at this point! */ -@ -@ /* Setup various stack pointers. */ -@ - LDR r1, =_sp @ Get pointer to stack area -#ifdef TX_ENABLE_IRQ_NESTING -@ -@ /* Setup the system mode stack for nested interrupt support */ -@ - LDR r2, =SYS_STACK_SIZE @ Pickup stack size - MOV r3, #SYS_MODE @ Build SYS mode CPSR - MSR CPSR_c, r3 @ Enter SYS mode - SUB r1, r1, #1 @ Backup 1 byte - BIC r1, r1, #7 @ Ensure 8-byte alignment - MOV sp, r1 @ Setup SYS stack pointer - SUB r1, r1, r2 @ Calculate start of next stack + /* We must be in SVC mode at this point! */ + + /* Setup various stack pointers. */ + + LDR r1, =_sp // Get pointer to stack area + +#ifdef TX_ENABLE_IRQ_NESTING + + /* Setup the system mode stack for nested interrupt support */ + + LDR r2, =SYS_STACK_SIZE // Pickup stack size + MOV r3, #SYS_MODE // Build SYS mode CPSR + MSR CPSR_c, r3 // Enter SYS mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup SYS stack pointer + SUB r1, r1, r2 // Calculate start of next stack #endif - LDR r2, =FIQ_STACK_SIZE @ Pickup stack size - MOV r0, #FIQ_MODE @ Build FIQ mode CPSR - MSR CPSR, r0 @ Enter FIQ mode - SUB r1, r1, #1 @ Backup 1 byte - BIC r1, r1, #7 @ Ensure 8-byte alignment - MOV sp, r1 @ Setup FIQ stack pointer - SUB r1, r1, r2 @ Calculate start of next stack - LDR r2, =IRQ_STACK_SIZE @ Pickup IRQ stack size - MOV r0, #IRQ_MODE @ Build IRQ mode CPSR - MSR CPSR, r0 @ Enter IRQ mode - SUB r1, r1, #1 @ Backup 1 byte - BIC r1, r1, #7 @ Ensure 8-byte alignment - MOV sp, r1 @ Setup IRQ stack pointer - SUB r3, r1, r2 @ Calculate end of IRQ stack - MOV r0, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR, r0 @ Enter SVC mode - LDR r2, =_stack_bottom @ Pickup stack bottom - CMP r3, r2 @ Compare the current stack end with the bottom -_stack_error_loop: - BLT _stack_error_loop @ If the IRQ stack exceeds the stack bottom, just sit here! -@ -@ /* Save the system stack pointer. */ -@ _tx_thread_system_stack_ptr = (VOID_PTR) (sp); -@ - LDR r2, =_tx_thread_system_stack_ptr @ Pickup stack pointer - STR r1, [r2] @ Save the system stack -@ -@ /* Save the first available memory address. */ -@ _tx_initialize_unused_memory = (VOID_PTR) _end; -@ - LDR r1, =_end @ Get end of non-initialized RAM area - LDR r2, =_tx_initialize_unused_memory @ Pickup unused memory ptr address - ADD r1, r1, #8 @ Increment to next free word - STR r1, [r2] @ Save first free memory address -@ -@ /* Setup Timer for periodic interrupts. */ -@ -@ /* Done, return to caller. */ -@ + LDR r2, =FIQ_STACK_SIZE // Pickup stack size + MOV r0, #FIQ_MODE // Build FIQ mode CPSR + MSR CPSR, r0 // Enter FIQ mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup FIQ stack pointer + SUB r1, r1, r2 // Calculate start of next stack + LDR r2, =IRQ_STACK_SIZE // Pickup IRQ stack size + MOV r0, #IRQ_MODE // Build IRQ mode CPSR + MSR CPSR, r0 // Enter IRQ mode + SUB r1, r1, #1 // Backup 1 byte + BIC r1, r1, #7 // Ensure 8-byte alignment + MOV sp, r1 // Setup IRQ stack pointer + SUB r3, r1, r2 // Calculate end of IRQ stack + MOV r0, #SVC_MODE // Build SVC mode CPSR + MSR CPSR, r0 // Enter SVC mode + LDR r2, =_stack_bottom // Pickup stack bottom + CMP r3, r2 // Compare the current stack end with the bottom +_stack_error_loop: + BLT _stack_error_loop // If the IRQ stack exceeds the stack bottom, just sit here! + + LDR r2, =_tx_thread_system_stack_ptr // Pickup stack pointer + STR r1, [r2] // Save the system stack + + LDR r1, =_end // Get end of non-initialized RAM area + LDR r2, =_tx_initialize_unused_memory // Pickup unused memory ptr address + ADD r1, r1, #8 // Increment to next free word + STR r1, [r2] // Save first free memory address + #ifdef __THUMB_INTERWORK - BX lr @ Return to caller + BX lr // Return to caller #else - MOV pc, lr @ Return to caller + MOV pc, lr // Return to caller #endif -@} -@ -@ -@/* Define shells for each of the interrupt vectors. */ -@ + +/* Define shells for each of the interrupt vectors. */ + .global __tx_undefined __tx_undefined: - B __tx_undefined @ Undefined handler -@ + B __tx_undefined // Undefined handler + .global __tx_swi_interrupt __tx_swi_interrupt: - B __tx_swi_interrupt @ Software interrupt handler -@ + B __tx_swi_interrupt // Software interrupt handler + .global __tx_prefetch_handler __tx_prefetch_handler: - B __tx_prefetch_handler @ Prefetch exception handler -@ + B __tx_prefetch_handler // Prefetch exception handler + .global __tx_abort_handler __tx_abort_handler: - B __tx_abort_handler @ Abort exception handler -@ + B __tx_abort_handler // Abort exception handler + .global __tx_reserved_handler __tx_reserved_handler: - B __tx_reserved_handler @ Reserved exception handler -@ + B __tx_reserved_handler // Reserved exception handler + .global __tx_irq_handler - .global __tx_irq_processing_return + .global __tx_irq_processing_return __tx_irq_handler: -@ -@ /* Jump to context save to save system context. */ + + /* Jump to context save to save system context. */ B _tx_thread_context_save __tx_irq_processing_return: -@ -@ /* At this point execution is still in the IRQ mode. The CPSR, point of -@ interrupt, and all C scratch registers are available for use. In -@ addition, IRQ interrupts may be re-enabled - with certain restrictions - -@ if nested IRQ interrupts are desired. Interrupts may be re-enabled over -@ small code sequences where lr is saved before enabling interrupts and -@ restored after interrupts are again disabled. */ -@ -@ /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start -@ from IRQ mode with interrupts disabled. This routine switches to the -@ system mode and returns with IRQ interrupts enabled. -@ -@ NOTE: It is very important to ensure all IRQ interrupts are cleared -@ prior to enabling nested IRQ interrupts. */ +// + /* At this point execution is still in the IRQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. In + addition, IRQ interrupts may be re-enabled - with certain restrictions - + if nested IRQ interrupts are desired. Interrupts may be re-enabled over + small code sequences where lr is saved before enabling interrupts and + restored after interrupts are again disabled. */ + + /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start + from IRQ mode with interrupts disabled. This routine switches to the + system mode and returns with IRQ interrupts enabled. + + NOTE: It is very important to ensure all IRQ interrupts are cleared + prior to enabling nested IRQ interrupts. */ #ifdef TX_ENABLE_IRQ_NESTING BL _tx_thread_irq_nesting_start #endif -@ -@ /* For debug purpose, execute the timer interrupt processing here. In -@ a real system, some kind of status indication would have to be checked -@ before the timer interrupt handler could be called. */ -@ - BL _tx_timer_interrupt @ Timer interrupt handler -@ -@ -@ /* If interrupt nesting was started earlier, the end of interrupt nesting -@ service must be called before returning to _tx_thread_context_restore. -@ This routine returns in processing in IRQ mode with interrupts disabled. */ + + /* For debug purpose, execute the timer interrupt processing here. In + a real system, some kind of status indication would have to be checked + before the timer interrupt handler could be called. */ + + BL _tx_timer_interrupt // Timer interrupt handler + + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_context_restore. + This routine returns in processing in IRQ mode with interrupts disabled. */ #ifdef TX_ENABLE_IRQ_NESTING BL _tx_thread_irq_nesting_end #endif -@ -@ /* Jump to context restore to restore system context. */ + + /* Jump to context restore to restore system context. */ B _tx_thread_context_restore -@ -@ -@ /* This is an example of a vectored IRQ handler. */ -@ -@ .global __tx_example_vectored_irq_handler -@__tx_example_vectored_irq_handler: -@ -@ -@ /* Save initial context and call context save to prepare for -@ vectored ISR execution. */ -@ -@ STMDB sp!, {r0-r3} @ Save some scratch registers -@ MRS r0, SPSR @ Pickup saved SPSR -@ SUB lr, lr, #4 @ Adjust point of interrupt -@ STMDB sp!, {r0, r10, r12, lr} @ Store other scratch registers -@ BL _tx_thread_vectored_context_save @ Vectored context save -@ -@ /* At this point execution is still in the IRQ mode. The CPSR, point of -@ interrupt, and all C scratch registers are available for use. In -@ addition, IRQ interrupts may be re-enabled - with certain restrictions - -@ if nested IRQ interrupts are desired. Interrupts may be re-enabled over -@ small code sequences where lr is saved before enabling interrupts and -@ restored after interrupts are again disabled. */ -@ -@ -@ /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start -@ from IRQ mode with interrupts disabled. This routine switches to the -@ system mode and returns with IRQ interrupts enabled. -@ -@ NOTE: It is very important to ensure all IRQ interrupts are cleared -@ prior to enabling nested IRQ interrupts. */ -@#ifdef TX_ENABLE_IRQ_NESTING -@ BL _tx_thread_irq_nesting_start -@#endif -@ -@ /* Application IRQ handlers can be called here! */ -@ -@ /* If interrupt nesting was started earlier, the end of interrupt nesting -@ service must be called before returning to _tx_thread_context_restore. -@ This routine returns in processing in IRQ mode with interrupts disabled. */ -@#ifdef TX_ENABLE_IRQ_NESTING -@ BL _tx_thread_irq_nesting_end -@#endif -@ -@ /* Jump to context restore to restore system context. */ -@ B _tx_thread_context_restore -@ -@ + + + /* This is an example of a vectored IRQ handler. */ + + + + /* Save initial context and call context save to prepare for + vectored ISR execution. */ + + /* At this point execution is still in the IRQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. In + addition, IRQ interrupts may be re-enabled - with certain restrictions - + if nested IRQ interrupts are desired. Interrupts may be re-enabled over + small code sequences where lr is saved before enabling interrupts and + restored after interrupts are again disabled. */ + + + /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start + from IRQ mode with interrupts disabled. This routine switches to the + system mode and returns with IRQ interrupts enabled. + + NOTE: It is very important to ensure all IRQ interrupts are cleared + prior to enabling nested IRQ interrupts. */ + + /* Application IRQ handlers can be called here! */ + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_context_restore. + This routine returns in processing in IRQ mode with interrupts disabled. */ + + + #ifdef TX_ENABLE_FIQ_SUPPORT .global __tx_fiq_handler .global __tx_fiq_processing_return __tx_fiq_handler: -@ -@ /* Jump to fiq context save to save system context. */ + + /* Jump to fiq context save to save system context. */ B _tx_thread_fiq_context_save __tx_fiq_processing_return: -@ -@ /* At this point execution is still in the FIQ mode. The CPSR, point of -@ interrupt, and all C scratch registers are available for use. */ -@ -@ /* Interrupt nesting is allowed after calling _tx_thread_fiq_nesting_start -@ from FIQ mode with interrupts disabled. This routine switches to the -@ system mode and returns with FIQ interrupts enabled. -@ -@ NOTE: It is very important to ensure all FIQ interrupts are cleared -@ prior to enabling nested FIQ interrupts. */ + + /* At this point execution is still in the FIQ mode. The CPSR, point of + interrupt, and all C scratch registers are available for use. */ + + /* Interrupt nesting is allowed after calling _tx_thread_fiq_nesting_start + from FIQ mode with interrupts disabled. This routine switches to the + system mode and returns with FIQ interrupts enabled. + + NOTE: It is very important to ensure all FIQ interrupts are cleared + prior to enabling nested FIQ interrupts. */ #ifdef TX_ENABLE_FIQ_NESTING BL _tx_thread_fiq_nesting_start #endif -@ -@ /* Application FIQ handlers can be called here! */ -@ -@ /* If interrupt nesting was started earlier, the end of interrupt nesting -@ service must be called before returning to _tx_thread_fiq_context_restore. */ + + /* Application FIQ handlers can be called here! */ + + /* If interrupt nesting was started earlier, the end of interrupt nesting + service must be called before returning to _tx_thread_fiq_context_restore. */ #ifdef TX_ENABLE_FIQ_NESTING BL _tx_thread_fiq_nesting_end #endif -@ -@ /* Jump to fiq context restore to restore system context. */ + + /* Jump to fiq context restore to restore system context. */ B _tx_thread_fiq_context_restore -@ -@ + + #else .global __tx_fiq_handler __tx_fiq_handler: - B __tx_fiq_handler @ FIQ interrupt handler + B __tx_fiq_handler // FIQ interrupt handler #endif -@ -@ + + BUILD_OPTIONS: - .word _tx_build_options @ Reference to bring in + .word _tx_build_options // Reference to bring in VERSION_ID: - .word _tx_version_id @ Reference to bring in + .word _tx_version_id // Reference to bring in diff --git a/ports/cortex_a9/gnu/inc/tx_port.h b/ports/cortex_a9/gnu/inc/tx_port.h index 51f6fd2a..19463de1 100644 --- a/ports/cortex_a9/gnu/inc/tx_port.h +++ b/ports/cortex_a9/gnu/inc/tx_port.h @@ -12,7 +12,7 @@ /**************************************************************************/ /**************************************************************************/ -/** */ +/** */ /** ThreadX Component */ /** */ /** Port Specific */ @@ -21,36 +21,38 @@ /**************************************************************************/ -/**************************************************************************/ -/* */ -/* PORT SPECIFIC C INFORMATION RELEASE */ -/* */ -/* tx_port.h Cortex-A9/GNU */ -/* 6.1.6 */ +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* tx_port.h ARMv7-A */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ /* */ /* DESCRIPTION */ -/* */ -/* This file contains data type definitions that make the ThreadX */ -/* real-time kernel function identically on a variety of different */ -/* processor architectures. For example, the size or number of bits */ -/* in an "int" data type vary between microprocessor architectures and */ -/* even C compilers for the same microprocessor. ThreadX does not */ -/* directly use native C data types. Instead, ThreadX creates its */ -/* own special types that can be mapped to actual data types by this */ -/* file to guarantee consistency in the interface and functionality. */ -/* */ -/* RELEASE HISTORY */ -/* */ +/* */ +/* This file contains data type definitions that make the ThreadX */ +/* real-time kernel function identically on a variety of different */ +/* processor architectures. For example, the size or number of bits */ +/* in an "int" data type vary between microprocessor architectures and */ +/* even C compilers for the same microprocessor. ThreadX does not */ +/* directly use native C data types. Instead, ThreadX creates its */ +/* own special types that can be mapped to actual data types by this */ +/* file to guarantee consistency in the interface and functionality. */ +/* */ +/* RELEASE HISTORY */ +/* */ /* DATE NAME DESCRIPTION */ /* */ /* 09-30-2020 William E. Lamie Initial Version 6.1 */ /* 04-02-2021 Bhupendra Naphade Modified comment(s),updated */ /* macro definition, */ /* resulting in version 6.1.6 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -63,7 +65,7 @@ #ifdef TX_INCLUDE_USER_DEFINE_FILE -/* Yes, include the user defines in tx_user.h. The defines in this file may +/* Yes, include the user defines in tx_user.h. The defines in this file may alternately be defined on the command line. */ #include "tx_user.h" @@ -76,7 +78,7 @@ #include -/* Define ThreadX basic types for this port. */ +/* Define ThreadX basic types for this port. */ #define VOID void typedef char CHAR; @@ -112,12 +114,12 @@ typedef unsigned short USHORT; #define TX_TIMER_THREAD_STACK_SIZE 1024 /* Default timer thread stack size */ #endif -#ifndef TX_TIMER_THREAD_PRIORITY -#define TX_TIMER_THREAD_PRIORITY 0 /* Default timer thread priority */ +#ifndef TX_TIMER_THREAD_PRIORITY +#define TX_TIMER_THREAD_PRIORITY 0 /* Default timer thread priority */ #endif -/* Define various constants for the ThreadX ARM port. */ +/* Define various constants for the ThreadX ARM port. */ #ifdef TX_ENABLE_FIQ_SUPPORT #define TX_INT_DISABLE 0xC0 /* Disable IRQ & FIQ interrupts */ @@ -127,8 +129,8 @@ typedef unsigned short USHORT; #define TX_INT_ENABLE 0x00 /* Enable IRQ interrupts */ -/* Define the clock source for trace event entry time stamp. The following two item are port specific. - For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock +/* Define the clock source for trace event entry time stamp. The following two item are port specific. + For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: #define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) @@ -175,7 +177,7 @@ typedef unsigned short USHORT; #define TX_INLINE_INITIALIZATION -/* Determine whether or not stack checking is enabled. By default, ThreadX stack checking is +/* Determine whether or not stack checking is enabled. By default, ThreadX stack checking is disabled. When the following is defined, ThreadX thread stack checking is enabled. If stack checking is enabled (TX_ENABLE_STACK_CHECKING is defined), the TX_DISABLE_STACK_FILLING define is negated, thereby forcing the stack fill which is necessary for the stack checking @@ -187,13 +189,13 @@ typedef unsigned short USHORT; /* Define the TX_THREAD control block extensions for this port. The main reason - for the multiple macros is so that backward compatibility can be maintained with + for the multiple macros is so that backward compatibility can be maintained with existing ThreadX kernel awareness modules. */ -#define TX_THREAD_EXTENSION_0 -#define TX_THREAD_EXTENSION_1 +#define TX_THREAD_EXTENSION_0 +#define TX_THREAD_EXTENSION_1 #define TX_THREAD_EXTENSION_2 ULONG tx_thread_vfp_enable; -#define TX_THREAD_EXTENSION_3 +#define TX_THREAD_EXTENSION_3 /* Define the port extensions of the remaining ThreadX objects. */ @@ -207,11 +209,11 @@ typedef unsigned short USHORT; #define TX_TIMER_EXTENSION -/* Define the user extension field of the thread control block. Nothing +/* Define the user extension field of the thread control block. Nothing additional is needed for this port so it is defined as white space. */ #ifndef TX_THREAD_USER_EXTENSION -#define TX_THREAD_USER_EXTENSION +#define TX_THREAD_USER_EXTENSION #endif @@ -219,8 +221,8 @@ typedef unsigned short USHORT; tx_thread_shell_entry, and tx_thread_terminate. */ -#define TX_THREAD_CREATE_EXTENSION(thread_ptr) -#define TX_THREAD_DELETE_EXTENSION(thread_ptr) +#define TX_THREAD_CREATE_EXTENSION(thread_ptr) +#define TX_THREAD_DELETE_EXTENSION(thread_ptr) #define TX_THREAD_COMPLETED_EXTENSION(thread_ptr) #define TX_THREAD_TERMINATED_EXTENSION(thread_ptr) @@ -247,24 +249,24 @@ typedef unsigned short USHORT; #define TX_TIMER_DELETE_EXTENSION(timer_ptr) -/* Determine if the ARM architecture has the CLZ instruction. This is available on - architectures v5 and above. If available, redefine the macro for calculating the +/* Determine if the ARM architecture has the CLZ instruction. This is available on + architectures v5 and above. If available, redefine the macro for calculating the lowest bit set. */ - + #if __TARGET_ARCH_ARM > 4 #ifndef __thumb__ #define TX_LOWEST_SET_BIT_CALCULATE(m, b) m = m & ((ULONG) (-((LONG) m))); \ asm volatile (" CLZ %0,%1 ": "=r" (b) : "r" (m) ); \ - b = 31 - b; + b = 31 - b; #endif #endif -/* Define ThreadX interrupt lockout and restore macros for protection on - access of critical kernel information. The restore interrupt macro must - restore the interrupt posture of the running thread prior to the value +/* Define ThreadX interrupt lockout and restore macros for protection on + access of critical kernel information. The restore interrupt macro must + restore the interrupt posture of the running thread prior to the value present prior to the disable macro. In most cases, the save area macro is used to define a local function save area for the disable and restore macros. */ @@ -295,7 +297,7 @@ unsigned int _tx_thread_interrupt_restore(UINT old_posture); #endif -/* Define VFP extension for the Cortex-A9. Each is assumed to be called in the context of the executing +/* Define VFP extension for the ARMv7-A. Each is assumed to be called in the context of the executing thread. */ void tx_thread_vfp_enable(void); @@ -315,8 +317,8 @@ void tx_thread_vfp_disable(void); /* Define the version ID of ThreadX. This may be utilized by the application. */ #ifdef TX_THREAD_INIT -CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-A9/GNU Version 6.1.9 *"; +CHAR _tx_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX ARMv7-A Version 6.1.11 *"; #else extern CHAR _tx_version_id[]; #endif diff --git a/ports/cortex_a9/gnu/src/tx_thread_context_restore.S b/ports/cortex_a9/gnu/src/tx_thread_context_restore.S index c3ef49a4..fae7e72d 100644 --- a/ports/cortex_a9/gnu/src/tx_thread_context_restore.S +++ b/ports/cortex_a9/gnu/src/tx_thread_context_restore.S @@ -1,260 +1,222 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .arm #ifdef TX_ENABLE_FIQ_SUPPORT -SVC_MODE = 0xD3 @ Disable IRQ/FIQ, SVC mode -IRQ_MODE = 0xD2 @ Disable IRQ/FIQ, IRQ mode +SVC_MODE = 0xD3 // Disable IRQ/FIQ, SVC mode +IRQ_MODE = 0xD2 // Disable IRQ/FIQ, IRQ mode #else -SVC_MODE = 0x93 @ Disable IRQ, SVC mode -IRQ_MODE = 0x92 @ Disable IRQ, IRQ mode +SVC_MODE = 0x93 // Disable IRQ, SVC mode +IRQ_MODE = 0x92 // Disable IRQ, IRQ mode #endif -@ + .global _tx_thread_system_state .global _tx_thread_current_ptr .global _tx_thread_execute_ptr .global _tx_timer_time_slice .global _tx_thread_schedule .global _tx_thread_preempt_disable - .global _tx_execution_isr_exit -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_restore -@ since it will never be called 16-bit mode. */ -@ + + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_restore + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_context_restore Cortex-A9/GNU */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function restores the interrupt context if it is processing a */ -@/* nested interrupt. If not, it returns to the interrupt thread if no */ -@/* preemption is necessary. Otherwise, if preemption is necessary or */ -@/* if no thread was running, the function returns to the scheduler. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* _tx_thread_schedule Thread scheduling routine */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs Interrupt Service Routines */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_context_restore(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_context_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function restores the interrupt context if it is processing a */ +/* nested interrupt. If not, it returns to the interrupt thread if no */ +/* preemption is necessary. Otherwise, if preemption is necessary or */ +/* if no thread was running, the function returns to the scheduler. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling routine */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs Interrupt Service Routines */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_context_restore .type _tx_thread_context_restore,function _tx_thread_context_restore: -@ -@ /* Lockout interrupts. */ -@ + + /* Lockout interrupts. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ interrupts + CPSID if // Disable IRQ and FIQ interrupts #else - CPSID i @ Disable IRQ interrupts + CPSID i // Disable IRQ interrupts #endif #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR exit function to indicate an ISR is complete. */ -@ - BL _tx_execution_isr_exit @ Call the ISR exit function -#endif -@ -@ /* Determine if interrupts are nested. */ -@ if (--_tx_thread_system_state) -@ { -@ - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3] @ Pickup system state - SUB r2, r2, #1 @ Decrement the counter - STR r2, [r3] @ Store the counter - CMP r2, #0 @ Was this the first interrupt? - BEQ __tx_thread_not_nested_restore @ If so, not a nested restore -@ -@ /* Interrupts are nested. */ -@ -@ /* Just recover the saved registers and return to the point of -@ interrupt. */ -@ - LDMIA sp!, {r0, r10, r12, lr} @ Recover SPSR, POI, and scratch regs - MSR SPSR_cxsf, r0 @ Put SPSR back - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOVS pc, lr @ Return to point of interrupt -@ -@ } -__tx_thread_not_nested_restore: -@ -@ /* Determine if a thread was interrupted and no preemption is required. */ -@ else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr) -@ || (_tx_thread_preempt_disable)) -@ { -@ - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup actual current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_idle_system_restore @ Yes, idle system was interrupted -@ - LDR r3, =_tx_thread_preempt_disable @ Pickup preempt disable address - LDR r2, [r3] @ Pickup actual preempt disable flag - CMP r2, #0 @ Is it set? - BNE __tx_thread_no_preempt_restore @ Yes, don't preempt this thread - LDR r3, =_tx_thread_execute_ptr @ Pickup address of execute thread ptr - LDR r2, [r3] @ Pickup actual execute thread pointer - CMP r0, r2 @ Is the same thread highest priority? - BNE __tx_thread_preempt_restore @ No, preemption needs to happen -@ -@ -__tx_thread_no_preempt_restore: -@ -@ /* Restore interrupted thread or ISR. */ -@ -@ /* Pickup the saved stack pointer. */ -@ tmp_ptr = _tx_thread_current_ptr -> tx_thread_stack_ptr; -@ -@ /* Recover the saved context and return to the point of interrupt. */ -@ - LDMIA sp!, {r0, r10, r12, lr} @ Recover SPSR, POI, and scratch regs - MSR SPSR_cxsf, r0 @ Put SPSR back - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOVS pc, lr @ Return to point of interrupt -@ -@ } -@ else -@ { -__tx_thread_preempt_restore: -@ - LDMIA sp!, {r3, r10, r12, lr} @ Recover temporarily saved registers - MOV r1, lr @ Save lr (point of interrupt) - MOV r2, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r2 @ Enter SVC mode - STR r1, [sp, #-4]! @ Save point of interrupt - STMDB sp!, {r4-r12, lr} @ Save upper half of registers - MOV r4, r3 @ Save SPSR in r4 - MOV r2, #IRQ_MODE @ Build IRQ mode CPSR - MSR CPSR_c, r2 @ Enter IRQ mode - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOV r5, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r5 @ Enter SVC mode - STMDB sp!, {r0-r3} @ Save r0-r3 on thread's stack - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup current thread pointer + /* Call the ISR exit function to indicate an ISR is complete. */ + + BL _tx_execution_isr_exit // Call the ISR exit function +#endif + + /* Determine if interrupts are nested. */ + + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + SUB r2, r2, #1 // Decrement the counter + STR r2, [r3] // Store the counter + CMP r2, #0 // Was this the first interrupt? + BEQ __tx_thread_not_nested_restore // If so, not a nested restore + + /* Interrupts are nested. */ + + /* Just recover the saved registers and return to the point of + interrupt. */ + + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_not_nested_restore: + + /* Determine if a thread was interrupted and no preemption is required. */ + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup actual current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_restore // Yes, idle system was interrupted + + LDR r3, =_tx_thread_preempt_disable // Pickup preempt disable address + LDR r2, [r3] // Pickup actual preempt disable flag + CMP r2, #0 // Is it set? + BNE __tx_thread_no_preempt_restore // Yes, don't preempt this thread + LDR r3, =_tx_thread_execute_ptr // Pickup address of execute thread ptr + LDR r2, [r3] // Pickup actual execute thread pointer + CMP r0, r2 // Is the same thread highest priority? + BNE __tx_thread_preempt_restore // No, preemption needs to happen + + +__tx_thread_no_preempt_restore: + + /* Recover the saved context and return to the point of interrupt. */ + + /* Pickup the saved stack pointer. */ + + /* Recover the saved context and return to the point of interrupt. */ + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_preempt_restore: + + LDMIA sp!, {r3, r10, r12, lr} // Recover temporarily saved registers + MOV r1, lr // Save lr (point of interrupt) + MOV r2, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r2 // Enter SVC mode + STR r1, [sp, #-4]! // Save point of interrupt + STMDB sp!, {r4-r12, lr} // Save upper half of registers + MOV r4, r3 // Save SPSR in r4 + MOV r2, #IRQ_MODE // Build IRQ mode CPSR + MSR CPSR_c, r2 // Enter IRQ mode + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOV r5, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r5 // Enter SVC mode + STMDB sp!, {r0-r3} // Save r0-r3 on thread's stack + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer #ifdef TX_ENABLE_VFP_SUPPORT - LDR r2, [r0, #144] @ Pickup the VFP enabled flag - CMP r2, #0 @ Is the VFP enabled? - BEQ _tx_skip_irq_vfp_save @ No, skip VFP IRQ save - VMRS r2, FPSCR @ Pickup the FPSCR - STR r2, [sp, #-4]! @ Save FPSCR - VSTMDB sp!, {D16-D31} @ Save D16-D31 - VSTMDB sp!, {D0-D15} @ Save D0-D15 + LDR r2, [r0, #144] // Pickup the VFP enabled flag + CMP r2, #0 // Is the VFP enabled? + BEQ _tx_skip_irq_vfp_save // No, skip VFP IRQ save + VMRS r2, FPSCR // Pickup the FPSCR + STR r2, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D0-D15} // Save D0-D15 + _tx_skip_irq_vfp_save: + #endif - MOV r3, #1 @ Build interrupt stack type - STMDB sp!, {r3, r4} @ Save interrupt stack type and SPSR - STR sp, [r0, #8] @ Save stack pointer in thread control - @ block -@ -@ /* Save the remaining time-slice and disable it. */ -@ if (_tx_timer_time_slice) -@ { -@ - LDR r3, =_tx_timer_time_slice @ Pickup time-slice variable address - LDR r2, [r3] @ Pickup time-slice - CMP r2, #0 @ Is it active? - BEQ __tx_thread_dont_save_ts @ No, don't save it -@ -@ _tx_thread_current_ptr -> tx_thread_time_slice = _tx_timer_time_slice; -@ _tx_timer_time_slice = 0; -@ - STR r2, [r0, #24] @ Save thread's time-slice - MOV r2, #0 @ Clear value - STR r2, [r3] @ Disable global time-slice flag -@ -@ } + MOV r3, #1 // Build interrupt stack type + STMDB sp!, {r3, r4} // Save interrupt stack type and SPSR + STR sp, [r0, #8] // Save stack pointer in thread control + // block + + /* Save the remaining time-slice and disable it. */ + LDR r3, =_tx_timer_time_slice // Pickup time-slice variable address + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it active? + BEQ __tx_thread_dont_save_ts // No, don't save it + STR r2, [r0, #24] // Save thread's time-slice + MOV r2, #0 // Clear value + STR r2, [r3] // Disable global time-slice flag + __tx_thread_dont_save_ts: -@ -@ -@ /* Clear the current task pointer. */ -@ _tx_thread_current_ptr = TX_NULL; -@ - MOV r0, #0 @ NULL value - STR r0, [r1] @ Clear current thread pointer -@ -@ /* Return to the scheduler. */ -@ _tx_thread_schedule(); -@ - B _tx_thread_schedule @ Return to scheduler -@ } -@ + + /* Clear the current task pointer. */ + MOV r0, #0 // NULL value + STR r0, [r1] // Clear current thread pointer + + /* Return to the scheduler. */ + B _tx_thread_schedule // Return to scheduler + __tx_thread_idle_system_restore: -@ -@ /* Just return back to the scheduler! */ -@ - MOV r0, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r0 @ Enter SVC mode - B _tx_thread_schedule @ Return to scheduler -@} - - + /* Just return back to the scheduler! */ + MOV r0, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r0 // Enter SVC mode + B _tx_thread_schedule // Return to scheduler diff --git a/ports/cortex_a9/gnu/src/tx_thread_context_save.S b/ports/cortex_a9/gnu/src/tx_thread_context_save.S index 9dfdd92f..7ac48c2e 100644 --- a/ports/cortex_a9/gnu/src/tx_thread_context_save.S +++ b/ports/cortex_a9/gnu/src/tx_thread_context_save.S @@ -1,206 +1,172 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .global _tx_thread_system_state .global _tx_thread_current_ptr - .global _tx_irq_processing_return - .global _tx_execution_isr_enter -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_save -@ since it will never be called 16-bit mode. */ -@ + .global __tx_irq_processing_return + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_context_save + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_context_save Cortex-A9/GNU */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function saves the context of an executing thread in the */ -@/* beginning of interrupt processing. The function also ensures that */ -@/* the system stack is used upon return to the calling ISR. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_context_save(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_context_save .type _tx_thread_context_save,function _tx_thread_context_save: -@ -@ /* Upon entry to this routine, it is assumed that IRQ interrupts are locked -@ out, we are in IRQ mode, and all registers are intact. */ -@ -@ /* Check for a nested interrupt condition. */ -@ if (_tx_thread_system_state++) -@ { -@ - STMDB sp!, {r0-r3} @ Save some working registers + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + + STMDB sp!, {r0-r3} // Save some working registers #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable FIQ interrupts + CPSID if // Disable FIQ interrupts #endif - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3] @ Pickup system state - CMP r2, #0 @ Is this the first interrupt? - BEQ __tx_thread_not_nested_save @ Yes, not a nested context save -@ -@ /* Nested interrupt condition. */ -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3] @ Store it back in the variable -@ -@ /* Save the rest of the scratch registers on the stack and return to the -@ calling ISR. */ -@ - MRS r0, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r0, r10, r12, lr} @ Store other registers -@ -@ /* Return to the ISR. */ -@ - MOV r10, #0 @ Clear stack limit + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + + /* Save the rest of the scratch registers on the stack and return to the + calling ISR. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, r10, r12, lr} // Store other registers + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - B __tx_irq_processing_return @ Continue IRQ processing -@ + B __tx_irq_processing_return // Continue IRQ processing + __tx_thread_not_nested_save: -@ } -@ -@ /* Otherwise, not nested, check to see if a thread was running. */ -@ else if (_tx_thread_current_ptr) -@ { -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3] @ Store it back in the variable - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_idle_system_save @ If so, interrupt occurred in - @ scheduling loop - nothing needs saving! -@ -@ /* Save minimal context of interrupted thread. */ -@ - MRS r2, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r2, r10, r12, lr} @ Store other registers -@ -@ /* Save the current stack pointer in the thread's control block. */ -@ _tx_thread_current_ptr -> tx_thread_stack_ptr = sp; -@ -@ /* Switch to the system stack. */ -@ sp = _tx_thread_system_stack_ptr@ -@ - MOV r10, #0 @ Clear stack limit + + /* Otherwise, not nested, check to see if a thread was running. */ + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + + /* Save minimal context of interrupted thread. */ + + MRS r2, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r2, r10, r12, lr} // Store other registers + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - B __tx_irq_processing_return @ Continue IRQ processing -@ -@ } -@ else -@ { -@ + B __tx_irq_processing_return // Continue IRQ processing + __tx_thread_idle_system_save: -@ -@ /* Interrupt occurred in the scheduling loop. */ -@ -@ /* Not much to do here, just adjust the stack pointer, and return to IRQ -@ processing. */ -@ - MOV r10, #0 @ Clear stack limit + + /* Interrupt occurred in the scheduling loop. */ + + /* Not much to do here, just adjust the stack pointer, and return to IRQ + processing. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - ADD sp, sp, #16 @ Recover saved registers - B __tx_irq_processing_return @ Continue IRQ processing -@ -@ } -@} - - - + ADD sp, sp, #16 // Recover saved registers + B __tx_irq_processing_return // Continue IRQ processing diff --git a/ports/cortex_a9/gnu/src/tx_thread_fiq_context_restore.S b/ports/cortex_a9/gnu/src/tx_thread_fiq_context_restore.S index fd32c934..006be973 100644 --- a/ports/cortex_a9/gnu/src/tx_thread_fiq_context_restore.S +++ b/ports/cortex_a9/gnu/src/tx_thread_fiq_context_restore.S @@ -1,43 +1,32 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ -@ -SVC_MODE = 0xD3 @ SVC mode -FIQ_MODE = 0xD1 @ FIQ mode -MODE_MASK = 0x1F @ Mode mask -THUMB_MASK = 0x20 @ Thumb bit mask -IRQ_MODE_BITS = 0x12 @ IRQ mode bits -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +SVC_MODE = 0xD3 // SVC mode +FIQ_MODE = 0xD1 // FIQ mode +MODE_MASK = 0x1F // Mode mask +THUMB_MASK = 0x20 // Thumb bit mask +IRQ_MODE_BITS = 0x12 // IRQ mode bits + + .global _tx_thread_system_state .global _tx_thread_current_ptr .global _tx_thread_system_stack_ptr @@ -46,218 +35,189 @@ IRQ_MODE_BITS = 0x12 @ IRQ mode bits .global _tx_thread_schedule .global _tx_thread_preempt_disable .global _tx_execution_isr_exit -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_restore -@ since it will never be called 16-bit mode. */ -@ + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_restore + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_fiq_context_restore Cortex-A9/GNU */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function restores the fiq interrupt context when processing a */ -@/* nested interrupt. If not, it returns to the interrupt thread if no */ -@/* preemption is necessary. Otherwise, if preemption is necessary or */ -@/* if no thread was running, the function returns to the scheduler. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* _tx_thread_schedule Thread scheduling routine */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* FIQ ISR Interrupt Service Routines */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_fiq_context_restore(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_context_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function restores the fiq interrupt context when processing a */ +/* nested interrupt. If not, it returns to the interrupt thread if no */ +/* preemption is necessary. Otherwise, if preemption is necessary or */ +/* if no thread was running, the function returns to the scheduler. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling routine */ +/* */ +/* CALLED BY */ +/* */ +/* FIQ ISR Interrupt Service Routines */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_fiq_context_restore .type _tx_thread_fiq_context_restore,function _tx_thread_fiq_context_restore: -@ -@ /* Lockout interrupts. */ -@ - CPSID if @ Disable IRQ and FIQ interrupts + + /* Lockout interrupts. */ + + CPSID if // Disable IRQ and FIQ interrupts #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR exit function to indicate an ISR is complete. */ -@ - BL _tx_execution_isr_exit @ Call the ISR exit function + + /* Call the ISR exit function to indicate an ISR is complete. */ + + BL _tx_execution_isr_exit // Call the ISR exit function #endif -@ -@ /* Determine if interrupts are nested. */ -@ if (--_tx_thread_system_state) -@ { -@ - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3] @ Pickup system state - SUB r2, r2, #1 @ Decrement the counter - STR r2, [r3] @ Store the counter - CMP r2, #0 @ Was this the first interrupt? - BEQ __tx_thread_fiq_not_nested_restore @ If so, not a nested restore -@ -@ /* Interrupts are nested. */ -@ -@ /* Just recover the saved registers and return to the point of -@ interrupt. */ -@ - LDMIA sp!, {r0, r10, r12, lr} @ Recover SPSR, POI, and scratch regs - MSR SPSR_cxsf, r0 @ Put SPSR back - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOVS pc, lr @ Return to point of interrupt -@ -@ } + + /* Determine if interrupts are nested. */ + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + SUB r2, r2, #1 // Decrement the counter + STR r2, [r3] // Store the counter + CMP r2, #0 // Was this the first interrupt? + BEQ __tx_thread_fiq_not_nested_restore // If so, not a nested restore + + /* Interrupts are nested. */ + + /* Just recover the saved registers and return to the point of + interrupt. */ + + LDMIA sp!, {r0, r10, r12, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + __tx_thread_fiq_not_nested_restore: -@ -@ /* Determine if a thread was interrupted and no preemption is required. */ -@ else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr) -@ || (_tx_thread_preempt_disable)) -@ { -@ - LDR r1, [sp] @ Pickup the saved SPSR - MOV r2, #MODE_MASK @ Build mask to isolate the interrupted mode - AND r1, r1, r2 @ Isolate mode bits - CMP r1, #IRQ_MODE_BITS @ Was an interrupt taken in IRQ mode before we - @ got to context save? */ - BEQ __tx_thread_fiq_no_preempt_restore @ Yes, just go back to point of interrupt + + /* Determine if a thread was interrupted and no preemption is required. */ + + LDR r1, [sp] // Pickup the saved SPSR + MOV r2, #MODE_MASK // Build mask to isolate the interrupted mode + AND r1, r1, r2 // Isolate mode bits + CMP r1, #IRQ_MODE_BITS // Was an interrupt taken in IRQ mode before we + // got to context save? */ + BEQ __tx_thread_fiq_no_preempt_restore // Yes, just go back to point of interrupt - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup actual current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_fiq_idle_system_restore @ Yes, idle system was interrupted + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup actual current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_fiq_idle_system_restore // Yes, idle system was interrupted - LDR r3, =_tx_thread_preempt_disable @ Pickup preempt disable address - LDR r2, [r3] @ Pickup actual preempt disable flag - CMP r2, #0 @ Is it set? - BNE __tx_thread_fiq_no_preempt_restore @ Yes, don't preempt this thread - LDR r3, =_tx_thread_execute_ptr @ Pickup address of execute thread ptr - LDR r2, [r3] @ Pickup actual execute thread pointer - CMP r0, r2 @ Is the same thread highest priority? - BNE __tx_thread_fiq_preempt_restore @ No, preemption needs to happen + LDR r3, =_tx_thread_preempt_disable // Pickup preempt disable address + LDR r2, [r3] // Pickup actual preempt disable flag + CMP r2, #0 // Is it set? + BNE __tx_thread_fiq_no_preempt_restore // Yes, don't preempt this thread + LDR r3, =_tx_thread_execute_ptr // Pickup address of execute thread ptr + LDR r2, [r3] // Pickup actual execute thread pointer + CMP r0, r2 // Is the same thread highest priority? + BNE __tx_thread_fiq_preempt_restore // No, preemption needs to happen __tx_thread_fiq_no_preempt_restore: -@ -@ /* Restore interrupted thread or ISR. */ -@ -@ /* Pickup the saved stack pointer. */ -@ tmp_ptr = _tx_thread_current_ptr -> tx_thread_stack_ptr; -@ -@ /* Recover the saved context and return to the point of interrupt. */ -@ - LDMIA sp!, {r0, lr} @ Recover SPSR, POI, and scratch regs - MSR SPSR_cxsf, r0 @ Put SPSR back - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOVS pc, lr @ Return to point of interrupt -@ -@ } -@ else -@ { -__tx_thread_fiq_preempt_restore: -@ - LDMIA sp!, {r3, lr} @ Recover temporarily saved registers - MOV r1, lr @ Save lr (point of interrupt) - MOV r2, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r2 @ Enter SVC mode - STR r1, [sp, #-4]! @ Save point of interrupt - STMDB sp!, {r4-r12, lr} @ Save upper half of registers - MOV r4, r3 @ Save SPSR in r4 - MOV r2, #FIQ_MODE @ Build FIQ mode CPSR - MSR CPSR_c, r2 @ Reenter FIQ mode - LDMIA sp!, {r0-r3} @ Recover r0-r3 - MOV r5, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r5 @ Enter SVC mode - STMDB sp!, {r0-r3} @ Save r0-r3 on thread's stack - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup current thread pointer + /* Restore interrupted thread or ISR. */ + /* Recover the saved context and return to the point of interrupt. */ + + LDMIA sp!, {r0, lr} // Recover SPSR, POI, and scratch regs + MSR SPSR_cxsf, r0 // Put SPSR back + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOVS pc, lr // Return to point of interrupt + +__tx_thread_fiq_preempt_restore: + + LDMIA sp!, {r3, lr} // Recover temporarily saved registers + MOV r1, lr // Save lr (point of interrupt) + MOV r2, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r2 // Enter SVC mode + STR r1, [sp, #-4]! // Save point of interrupt + STMDB sp!, {r4-r12, lr} // Save upper half of registers + MOV r4, r3 // Save SPSR in r4 + MOV r2, #FIQ_MODE // Build FIQ mode CPSR + MSR CPSR_c, r2 // Reenter FIQ mode + LDMIA sp!, {r0-r3} // Recover r0-r3 + MOV r5, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r5 // Enter SVC mode + STMDB sp!, {r0-r3} // Save r0-r3 on thread's stack + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer #ifdef TX_ENABLE_VFP_SUPPORT - LDR r2, [r0, #144] @ Pickup the VFP enabled flag - CMP r2, #0 @ Is the VFP enabled? - BEQ _tx_skip_fiq_vfp_save @ No, skip VFP IRQ save - VMRS r2, FPSCR @ Pickup the FPSCR - STR r2, [sp, #-4]! @ Save FPSCR - VSTMDB sp!, {D16-D31} @ Save D16-D31 - VSTMDB sp!, {D0-D15} @ Save D0-D15 + LDR r2, [r0, #144] // Pickup the VFP enabled flag + CMP r2, #0 // Is the VFP enabled? + BEQ _tx_skip_fiq_vfp_save // No, skip VFP IRQ save + VMRS r2, FPSCR // Pickup the FPSCR + STR r2, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D0-D15} // Save D0-D15 _tx_skip_fiq_vfp_save: #endif - MOV r3, #1 @ Build interrupt stack type - STMDB sp!, {r3, r4} @ Save interrupt stack type and SPSR - STR sp, [r0, #8] @ Save stack pointer in thread control - @ block */ -@ -@ /* Save the remaining time-slice and disable it. */ -@ if (_tx_timer_time_slice) -@ { -@ - LDR r3, =_tx_timer_time_slice @ Pickup time-slice variable address - LDR r2, [r3] @ Pickup time-slice - CMP r2, #0 @ Is it active? - BEQ __tx_thread_fiq_dont_save_ts @ No, don't save it -@ -@ _tx_thread_current_ptr -> tx_thread_time_slice = _tx_timer_time_slice; -@ _tx_timer_time_slice = 0; -@ - STR r2, [r0, #24] @ Save thread's time-slice - MOV r2, #0 @ Clear value - STR r2, [r3] @ Disable global time-slice flag -@ -@ } -__tx_thread_fiq_dont_save_ts: -@ -@ -@ /* Clear the current task pointer. */ -@ _tx_thread_current_ptr = TX_NULL; -@ - MOV r0, #0 @ NULL value - STR r0, [r1] @ Clear current thread pointer -@ -@ /* Return to the scheduler. */ -@ _tx_thread_schedule(); -@ - B _tx_thread_schedule @ Return to scheduler -@ } -@ -__tx_thread_fiq_idle_system_restore: -@ -@ /* Just return back to the scheduler! */ -@ - ADD sp, sp, #24 @ Recover FIQ stack space - MOV r3, #SVC_MODE @ Build SVC mode CPSR - MSR CPSR_c, r3 @ Lockout interrupts - B _tx_thread_schedule @ Return to scheduler -@ -@} + MOV r3, #1 // Build interrupt stack type + STMDB sp!, {r3, r4} // Save interrupt stack type and SPSR + STR sp, [r0, #8] // Save stack pointer in thread control + // block */ + LDR r3, =_tx_timer_time_slice // Pickup time-slice variable address + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it active? + BEQ __tx_thread_fiq_dont_save_ts // No, don't save it + + STR r2, [r0, #24] // Save thread's time-slice + MOV r2, #0 // Clear value + STR r2, [r3] // Disable global time-slice flag + +__tx_thread_fiq_dont_save_ts: + + /* Clear the current task pointer. */ + + MOV r0, #0 // NULL value + STR r0, [r1] // Clear current thread pointer + + /* Return to the scheduler. */ + + B _tx_thread_schedule // Return to scheduler + +__tx_thread_fiq_idle_system_restore: + + /* Just return back to the scheduler! */ + + ADD sp, sp, #24 // Recover FIQ stack space + MOV r3, #SVC_MODE // Build SVC mode CPSR + MSR CPSR_c, r3 // Lockout interrupts + B _tx_thread_schedule // Return to scheduler diff --git a/ports/cortex_a9/gnu/src/tx_thread_fiq_context_save.S b/ports/cortex_a9/gnu/src/tx_thread_fiq_context_save.S index e863339d..7db6a4c2 100644 --- a/ports/cortex_a9/gnu/src/tx_thread_fiq_context_save.S +++ b/ports/cortex_a9/gnu/src/tx_thread_fiq_context_save.S @@ -1,207 +1,178 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .global _tx_thread_system_state .global _tx_thread_current_ptr .global __tx_fiq_processing_return .global _tx_execution_isr_enter -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_save -@ since it will never be called 16-bit mode. */ -@ + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_context_save + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_fiq_context_save Cortex-A9/GNU */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function saves the context of an executing thread in the */ -@/* beginning of interrupt processing. The function also ensures that */ -@/* the system stack is used upon return to the calling ISR. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@ VOID _tx_thread_fiq_context_save(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_fiq_context_save .type _tx_thread_fiq_context_save,function _tx_thread_fiq_context_save: -@ -@ /* Upon entry to this routine, it is assumed that IRQ interrupts are locked -@ out, we are in IRQ mode, and all registers are intact. */ -@ -@ /* Check for a nested interrupt condition. */ -@ if (_tx_thread_system_state++) -@ { -@ - STMDB sp!, {r0-r3} @ Save some working registers - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3] @ Pickup system state - CMP r2, #0 @ Is this the first interrupt? - BEQ __tx_thread_fiq_not_nested_save @ Yes, not a nested context save -@ -@ /* Nested interrupt condition. */ -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3] @ Store it back in the variable -@ -@ /* Save the rest of the scratch registers on the stack and return to the -@ calling ISR. */ -@ - MRS r0, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r0, r10, r12, lr} @ Store other registers -@ -@ /* Return to the ISR. */ -@ - MOV r10, #0 @ Clear stack limit + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + + STMDB sp!, {r0-r3} // Save some working registers + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_fiq_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + + /* Save the rest of the scratch registers on the stack and return to the + calling ISR. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, r10, r12, lr} // Store other registers + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - B __tx_fiq_processing_return @ Continue FIQ processing -@ + B __tx_fiq_processing_return // Continue FIQ processing +// __tx_thread_fiq_not_nested_save: -@ } -@ -@ /* Otherwise, not nested, check to see if a thread was running. */ -@ else if (_tx_thread_current_ptr) -@ { -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3] @ Store it back in the variable - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1] @ Pickup current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_fiq_idle_system_save @ If so, interrupt occurred in -@ @ scheduling loop - nothing needs saving! -@ -@ /* Save minimal context of interrupted thread. */ -@ - MRS r2, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r2, lr} @ Store other registers, Note that we don't -@ @ need to save sl and ip since FIQ has -@ @ copies of these registers. Nested -@ @ interrupt processing does need to save -@ @ these registers. -@ -@ /* Save the current stack pointer in the thread's control block. */ -@ _tx_thread_current_ptr -> tx_thread_stack_ptr = sp; -@ -@ /* Switch to the system stack. */ -@ sp = _tx_thread_system_stack_ptr; -@ - MOV r10, #0 @ Clear stack limit + + /* Otherwise, not nested, check to see if a thread was running. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_fiq_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + + /* Save minimal context of interrupted thread. */ + + MRS r2, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r2, lr} // Store other registers, Note that we don't + // need to save sl and ip since FIQ has + // copies of these registers. Nested + // interrupt processing does need to save + // these registers. + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - B __tx_fiq_processing_return @ Continue FIQ processing -@ -@ } -@ else -@ { -@ + B __tx_fiq_processing_return // Continue FIQ processing + __tx_thread_fiq_idle_system_save: -@ -@ /* Interrupt occurred in the scheduling loop. */ -@ -#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr -#endif -@ -@ /* Not much to do here, save the current SPSR and LR for possible -@ use in IRQ interrupted in idle system conditions, and return to -@ FIQ interrupt processing. */ -@ - MRS r0, SPSR @ Pickup saved SPSR - SUB lr, lr, #4 @ Adjust point of interrupt - STMDB sp!, {r0, lr} @ Store other registers that will get used -@ @ or stripped off the stack in context -@ @ restore - B __tx_fiq_processing_return @ Continue FIQ processing -@ -@ } -@} + /* Interrupt occurred in the scheduling loop. */ + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr +#endif + + /* Not much to do here, save the current SPSR and LR for possible + use in IRQ interrupted in idle system conditions, and return to + FIQ interrupt processing. */ + + MRS r0, SPSR // Pickup saved SPSR + SUB lr, lr, #4 // Adjust point of interrupt + STMDB sp!, {r0, lr} // Store other registers that will get used + // or stripped off the stack in context + // restore + B __tx_fiq_processing_return // Continue FIQ processing diff --git a/ports/cortex_a9/gnu/src/tx_thread_fiq_nesting_end.S b/ports/cortex_a9/gnu/src/tx_thread_fiq_nesting_end.S index db32cf5b..b34d881e 100644 --- a/ports/cortex_a9/gnu/src/tx_thread_fiq_nesting_end.S +++ b/ports/cortex_a9/gnu/src/tx_thread_fiq_nesting_end.S @@ -1,116 +1,104 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + #ifdef TX_ENABLE_FIQ_SUPPORT -DISABLE_INTS = 0xC0 @ Disable IRQ/FIQ interrupts +DISABLE_INTS = 0xC0 // Disable IRQ/FIQ interrupts #else -DISABLE_INTS = 0x80 @ Disable IRQ interrupts +DISABLE_INTS = 0x80 // Disable IRQ interrupts #endif -MODE_MASK = 0x1F @ Mode mask -FIQ_MODE_BITS = 0x11 @ FIQ mode bits -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_end -@ since it will never be called 16-bit mode. */ -@ +MODE_MASK = 0x1F // Mode mask +FIQ_MODE_BITS = 0x11 // FIQ mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_end + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_fiq_nesting_end Cortex-A9/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is called by the application from FIQ mode after */ -@/* _tx_thread_fiq_nesting_start has been called and switches the FIQ */ -@/* processing from system mode back to FIQ mode prior to the ISR */ -@/* calling _tx_thread_fiq_context_restore. Note that this function */ -@/* assumes the system stack pointer is in the same position after */ -@/* nesting start function was called. */ -@/* */ -@/* This function assumes that the system mode stack pointer was setup */ -@/* during low-level initialization (tx_initialize_low_level.s). */ -@/* */ -@/* This function returns with FIQ interrupts disabled. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_fiq_nesting_end(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_nesting_end ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from FIQ mode after */ +/* _tx_thread_fiq_nesting_start has been called and switches the FIQ */ +/* processing from system mode back to FIQ mode prior to the ISR */ +/* calling _tx_thread_fiq_context_restore. Note that this function */ +/* assumes the system stack pointer is in the same position after */ +/* nesting start function was called. */ +/* */ +/* This function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with FIQ interrupts disabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_fiq_nesting_end .type _tx_thread_fiq_nesting_end,function _tx_thread_fiq_nesting_end: - MOV r3,lr @ Save ISR return address - MRS r0, CPSR @ Pickup the CPSR - ORR r0, r0, #DISABLE_INTS @ Build disable interrupt value - MSR CPSR_c, r0 @ Disable interrupts - LDMIA sp!, {r1, lr} @ Pickup saved lr (and r1 throw-away for - @ 8-byte alignment logic) - BIC r0, r0, #MODE_MASK @ Clear mode bits - ORR r0, r0, #FIQ_MODE_BITS @ Build IRQ mode CPSR - MSR CPSR_c, r0 @ Reenter IRQ mode + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + ORR r0, r0, #DISABLE_INTS // Build disable interrupt value + MSR CPSR_c, r0 // Disable interrupts + LDMIA sp!, {r1, lr} // Pickup saved lr (and r1 throw-away for + // 8-byte alignment logic) + BIC r0, r0, #MODE_MASK // Clear mode bits + ORR r0, r0, #FIQ_MODE_BITS // Build IRQ mode CPSR + MSR CPSR_c, r0 // Reenter IRQ mode #ifdef __THUMB_INTERWORK - BX r3 @ Return to caller + BX r3 // Return to caller #else - MOV pc, r3 @ Return to caller + MOV pc, r3 // Return to caller #endif -@} - diff --git a/ports/cortex_a9/gnu/src/tx_thread_fiq_nesting_start.S b/ports/cortex_a9/gnu/src/tx_thread_fiq_nesting_start.S index 6cb88686..c9cd5a06 100644 --- a/ports/cortex_a9/gnu/src/tx_thread_fiq_nesting_start.S +++ b/ports/cortex_a9/gnu/src/tx_thread_fiq_nesting_start.S @@ -1,108 +1,96 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ -FIQ_DISABLE = 0x40 @ FIQ disable bit -MODE_MASK = 0x1F @ Mode mask -SYS_MODE_BITS = 0x1F @ System mode bits -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_start -@ since it will never be called 16-bit mode. */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +FIQ_DISABLE = 0x40 // FIQ disable bit +MODE_MASK = 0x1F // Mode mask +SYS_MODE_BITS = 0x1F // System mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_fiq_nesting_start + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_fiq_nesting_start Cortex-A9/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is called by the application from FIQ mode after */ -@/* _tx_thread_fiq_context_save has been called and switches the FIQ */ -@/* processing to the system mode so nested FIQ interrupt processing */ -@/* is possible (system mode has its own "lr" register). Note that */ -@/* this function assumes that the system mode stack pointer was setup */ -@/* during low-level initialization (tx_initialize_low_level.s). */ -@/* */ -@/* This function returns with FIQ interrupts enabled. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_fiq_nesting_start(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_fiq_nesting_start ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from FIQ mode after */ +/* _tx_thread_fiq_context_save has been called and switches the FIQ */ +/* processing to the system mode so nested FIQ interrupt processing */ +/* is possible (system mode has its own "lr" register). Note that */ +/* this function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with FIQ interrupts enabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_fiq_nesting_start .type _tx_thread_fiq_nesting_start,function _tx_thread_fiq_nesting_start: - MOV r3,lr @ Save ISR return address - MRS r0, CPSR @ Pickup the CPSR - BIC r0, r0, #MODE_MASK @ Clear the mode bits - ORR r0, r0, #SYS_MODE_BITS @ Build system mode CPSR - MSR CPSR_c, r0 @ Enter system mode - STMDB sp!, {r1, lr} @ Push the system mode lr on the system mode stack - @ and push r1 just to keep 8-byte alignment - BIC r0, r0, #FIQ_DISABLE @ Build enable FIQ CPSR - MSR CPSR_c, r0 @ Enter system mode + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + BIC r0, r0, #MODE_MASK // Clear the mode bits + ORR r0, r0, #SYS_MODE_BITS // Build system mode CPSR + MSR CPSR_c, r0 // Enter system mode + STMDB sp!, {r1, lr} // Push the system mode lr on the system mode stack + // and push r1 just to keep 8-byte alignment + BIC r0, r0, #FIQ_DISABLE // Build enable FIQ CPSR + MSR CPSR_c, r0 // Enter system mode #ifdef __THUMB_INTERWORK - BX r3 @ Return to caller + BX r3 // Return to caller #else - MOV pc, r3 @ Return to caller + MOV pc, r3 // Return to caller #endif -@} - diff --git a/ports/cortex_a9/gnu/src/tx_thread_interrupt_control.S b/ports/cortex_a9/gnu/src/tx_thread_interrupt_control.S index ac645d47..63b1609a 100644 --- a/ports/cortex_a9/gnu/src/tx_thread_interrupt_control.S +++ b/ports/cortex_a9/gnu/src/tx_thread_interrupt_control.S @@ -1,115 +1,104 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ INT_MASK = 0x03F -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_control for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_control for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_interrupt_control $_tx_thread_interrupt_control: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_interrupt_control @ Call _tx_thread_interrupt_control function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_control // Call _tx_thread_interrupt_control function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_interrupt_control Cortex-A9/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is responsible for changing the interrupt lockout */ -@/* posture of the system. */ -@/* */ -@/* INPUT */ -@/* */ -@/* new_posture New interrupt lockout posture */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* old_posture Old interrupt lockout posture */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* Application Code */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@UINT _tx_thread_interrupt_control(UINT new_posture) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_control ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for changing the interrupt lockout */ +/* posture of the system. */ +/* */ +/* INPUT */ +/* */ +/* new_posture New interrupt lockout posture */ +/* */ +/* OUTPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_interrupt_control .type _tx_thread_interrupt_control,function _tx_thread_interrupt_control: -@ -@ /* Pickup current interrupt lockout posture. */ -@ - MRS r3, CPSR @ Pickup current CPSR - MOV r2, #INT_MASK @ Build interrupt mask - AND r1, r3, r2 @ Clear interrupt lockout bits - ORR r1, r1, r0 @ Or-in new interrupt lockout bits -@ -@ /* Apply the new interrupt posture. */ -@ - MSR CPSR_c, r1 @ Setup new CPSR - BIC r0, r3, r2 @ Return previous interrupt mask -#ifdef __THUMB_INTERWORK - BX lr @ Return to caller -#else - MOV pc, lr @ Return to caller -#endif -@} + /* Pickup current interrupt lockout posture. */ + + MRS r3, CPSR // Pickup current CPSR + MOV r2, #INT_MASK // Build interrupt mask + AND r1, r3, r2 // Clear interrupt lockout bits + ORR r1, r1, r0 // Or-in new interrupt lockout bits + + /* Apply the new interrupt posture. */ + + MSR CPSR_c, r1 // Setup new CPSR + BIC r0, r3, r2 // Return previous interrupt mask +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a9/gnu/src/tx_thread_interrupt_disable.S b/ports/cortex_a9/gnu/src/tx_thread_interrupt_disable.S index b7fa0185..13258808 100644 --- a/ports/cortex_a9/gnu/src/tx_thread_interrupt_disable.S +++ b/ports/cortex_a9/gnu/src/tx_thread_interrupt_disable.S @@ -1,113 +1,101 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_disable for -@ applications calling this function from to 16-bit Thumb mode. */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_disable for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_interrupt_disable $_tx_thread_interrupt_disable: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_interrupt_disable @ Call _tx_thread_interrupt_disable function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_disable // Call _tx_thread_interrupt_disable function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_interrupt_disable Cortex-A9/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is responsible for disabling interrupts */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* old_posture Old interrupt lockout posture */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* Application Code */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@UINT _tx_thread_interrupt_disable(void) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_disable ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for disabling interrupts */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_interrupt_disable .type _tx_thread_interrupt_disable,function _tx_thread_interrupt_disable: -@ -@ /* Pickup current interrupt lockout posture. */ -@ - MRS r0, CPSR @ Pickup current CPSR -@ -@ /* Mask interrupts. */ -@ + + /* Pickup current interrupt lockout posture. */ + + MRS r0, CPSR // Pickup current CPSR + + /* Mask interrupts. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ + CPSID if // Disable IRQ and FIQ #else - CPSID i @ Disable IRQ + CPSID i // Disable IRQ #endif #ifdef __THUMB_INTERWORK - BX lr @ Return to caller + BX lr // Return to caller #else - MOV pc, lr @ Return to caller + MOV pc, lr // Return to caller #endif -@} - - diff --git a/ports/cortex_a9/gnu/src/tx_thread_interrupt_restore.S b/ports/cortex_a9/gnu/src/tx_thread_interrupt_restore.S index e88e6090..2d582511 100644 --- a/ports/cortex_a9/gnu/src/tx_thread_interrupt_restore.S +++ b/ports/cortex_a9/gnu/src/tx_thread_interrupt_restore.S @@ -1,104 +1,93 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_restore for -@ applications calling this function from to 16-bit Thumb mode. */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_restore for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_interrupt_restore $_tx_thread_interrupt_restore: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_interrupt_restore @ Call _tx_thread_interrupt_restore function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_interrupt_restore // Call _tx_thread_interrupt_restore function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_interrupt_restore Cortex-A9/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is responsible for restoring interrupts to the state */ -@/* returned by a previous _tx_thread_interrupt_disable call. */ -@/* */ -@/* INPUT */ -@/* */ -@/* old_posture Old interrupt lockout posture */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* Application Code */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@UINT _tx_thread_interrupt_restore(UINT old_posture) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_restore ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is responsible for restoring interrupts to the state */ +/* returned by a previous _tx_thread_interrupt_disable call. */ +/* */ +/* INPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_interrupt_restore .type _tx_thread_interrupt_restore,function _tx_thread_interrupt_restore: -@ -@ /* Apply the new interrupt posture. */ -@ - MSR CPSR_c, r0 @ Setup new CPSR -#ifdef __THUMB_INTERWORK - BX lr @ Return to caller -#else - MOV pc, lr @ Return to caller -#endif -@} + /* Apply the new interrupt posture. */ + + MSR CPSR_c, r0 // Setup new CPSR +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_a9/gnu/src/tx_thread_irq_nesting_end.S b/ports/cortex_a9/gnu/src/tx_thread_irq_nesting_end.S index 30e601cb..ec7e63c6 100644 --- a/ports/cortex_a9/gnu/src/tx_thread_irq_nesting_end.S +++ b/ports/cortex_a9/gnu/src/tx_thread_irq_nesting_end.S @@ -1,115 +1,103 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + #ifdef TX_ENABLE_FIQ_SUPPORT -DISABLE_INTS = 0xC0 @ Disable IRQ/FIQ interrupts +DISABLE_INTS = 0xC0 // Disable IRQ/FIQ interrupts #else -DISABLE_INTS = 0x80 @ Disable IRQ interrupts +DISABLE_INTS = 0x80 // Disable IRQ interrupts #endif -MODE_MASK = 0x1F @ Mode mask -IRQ_MODE_BITS = 0x12 @ IRQ mode bits -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_end -@ since it will never be called 16-bit mode. */ -@ +MODE_MASK = 0x1F // Mode mask +IRQ_MODE_BITS = 0x12 // IRQ mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_end + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_irq_nesting_end Cortex-A9/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is called by the application from IRQ mode after */ -@/* _tx_thread_irq_nesting_start has been called and switches the IRQ */ -@/* processing from system mode back to IRQ mode prior to the ISR */ -@/* calling _tx_thread_context_restore. Note that this function */ -@/* assumes the system stack pointer is in the same position after */ -@/* nesting start function was called. */ -@/* */ -@/* This function assumes that the system mode stack pointer was setup */ -@/* during low-level initialization (tx_initialize_low_level.s). */ -@/* */ -@/* This function returns with IRQ interrupts disabled. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_irq_nesting_end(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_irq_nesting_end ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from IRQ mode after */ +/* _tx_thread_irq_nesting_start has been called and switches the IRQ */ +/* processing from system mode back to IRQ mode prior to the ISR */ +/* calling _tx_thread_context_restore. Note that this function */ +/* assumes the system stack pointer is in the same position after */ +/* nesting start function was called. */ +/* */ +/* This function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with IRQ interrupts disabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_irq_nesting_end .type _tx_thread_irq_nesting_end,function _tx_thread_irq_nesting_end: - MOV r3,lr @ Save ISR return address - MRS r0, CPSR @ Pickup the CPSR - ORR r0, r0, #DISABLE_INTS @ Build disable interrupt value - MSR CPSR_c, r0 @ Disable interrupts - LDMIA sp!, {r1, lr} @ Pickup saved lr (and r1 throw-away for - @ 8-byte alignment logic) - BIC r0, r0, #MODE_MASK @ Clear mode bits - ORR r0, r0, #IRQ_MODE_BITS @ Build IRQ mode CPSR - MSR CPSR_c, r0 @ Reenter IRQ mode + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + ORR r0, r0, #DISABLE_INTS // Build disable interrupt value + MSR CPSR_c, r0 // Disable interrupts + LDMIA sp!, {r1, lr} // Pickup saved lr (and r1 throw-away for + // 8-byte alignment logic) + BIC r0, r0, #MODE_MASK // Clear mode bits + ORR r0, r0, #IRQ_MODE_BITS // Build IRQ mode CPSR + MSR CPSR_c, r0 // Reenter IRQ mode #ifdef __THUMB_INTERWORK - BX r3 @ Return to caller + BX r3 // Return to caller #else - MOV pc, r3 @ Return to caller + MOV pc, r3 // Return to caller #endif -@} - diff --git a/ports/cortex_a9/gnu/src/tx_thread_irq_nesting_start.S b/ports/cortex_a9/gnu/src/tx_thread_irq_nesting_start.S index a13f73cb..c69976ed 100644 --- a/ports/cortex_a9/gnu/src/tx_thread_irq_nesting_start.S +++ b/ports/cortex_a9/gnu/src/tx_thread_irq_nesting_start.S @@ -1,108 +1,96 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ -IRQ_DISABLE = 0x80 @ IRQ disable bit -MODE_MASK = 0x1F @ Mode mask -SYS_MODE_BITS = 0x1F @ System mode bits -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_start -@ since it will never be called 16-bit mode. */ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +IRQ_DISABLE = 0x80 // IRQ disable bit +MODE_MASK = 0x1F // Mode mask +SYS_MODE_BITS = 0x1F // System mode bits + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_irq_nesting_start + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_irq_nesting_start Cortex-A9/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is called by the application from IRQ mode after */ -@/* _tx_thread_context_save has been called and switches the IRQ */ -@/* processing to the system mode so nested IRQ interrupt processing */ -@/* is possible (system mode has its own "lr" register). Note that */ -@/* this function assumes that the system mode stack pointer was setup */ -@/* during low-level initialization (tx_initialize_low_level.s). */ -@/* */ -@/* This function returns with IRQ interrupts enabled. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_irq_nesting_start(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_irq_nesting_start ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called by the application from IRQ mode after */ +/* _tx_thread_context_save has been called and switches the IRQ */ +/* processing to the system mode so nested IRQ interrupt processing */ +/* is possible (system mode has its own "lr" register). Note that */ +/* this function assumes that the system mode stack pointer was setup */ +/* during low-level initialization (tx_initialize_low_level.s). */ +/* */ +/* This function returns with IRQ interrupts enabled. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_irq_nesting_start .type _tx_thread_irq_nesting_start,function _tx_thread_irq_nesting_start: - MOV r3,lr @ Save ISR return address - MRS r0, CPSR @ Pickup the CPSR - BIC r0, r0, #MODE_MASK @ Clear the mode bits - ORR r0, r0, #SYS_MODE_BITS @ Build system mode CPSR - MSR CPSR_c, r0 @ Enter system mode - STMDB sp!, {r1, lr} @ Push the system mode lr on the system mode stack - @ and push r1 just to keep 8-byte alignment - BIC r0, r0, #IRQ_DISABLE @ Build enable IRQ CPSR - MSR CPSR_c, r0 @ Enter system mode + MOV r3,lr // Save ISR return address + MRS r0, CPSR // Pickup the CPSR + BIC r0, r0, #MODE_MASK // Clear the mode bits + ORR r0, r0, #SYS_MODE_BITS // Build system mode CPSR + MSR CPSR_c, r0 // Enter system mode + STMDB sp!, {r1, lr} // Push the system mode lr on the system mode stack + // and push r1 just to keep 8-byte alignment + BIC r0, r0, #IRQ_DISABLE // Build enable IRQ CPSR + MSR CPSR_c, r0 // Enter system mode #ifdef __THUMB_INTERWORK - BX r3 @ Return to caller + BX r3 // Return to caller #else - MOV pc, r3 @ Return to caller + MOV pc, r3 // Return to caller #endif -@} - diff --git a/ports/cortex_a9/gnu/src/tx_thread_schedule.S b/ports/cortex_a9/gnu/src/tx_thread_schedule.S index 2d3db2b5..8330e9df 100644 --- a/ports/cortex_a9/gnu/src/tx_thread_schedule.S +++ b/ports/cortex_a9/gnu/src/tx_thread_schedule.S @@ -1,258 +1,230 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .global _tx_thread_execute_ptr .global _tx_thread_current_ptr .global _tx_timer_time_slice - .global _tx_execution_thread_enter -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_schedule for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_schedule for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_schedule .type $_tx_thread_schedule,function $_tx_thread_schedule: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_schedule @ Call _tx_thread_schedule function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_schedule // Call _tx_thread_schedule function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_schedule Cortex-A9/GNU */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function waits for a thread control block pointer to appear in */ -@/* the _tx_thread_execute_ptr variable. Once a thread pointer appears */ -@/* in the variable, the corresponding thread is resumed. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* _tx_initialize_kernel_enter ThreadX entry function */ -@/* _tx_thread_system_return Return to system from thread */ -@/* _tx_thread_context_restore Restore thread's context */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_schedule(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_schedule ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function waits for a thread control block pointer to appear in */ +/* the _tx_thread_execute_ptr variable. Once a thread pointer appears */ +/* in the variable, the corresponding thread is resumed. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_initialize_kernel_enter ThreadX entry function */ +/* _tx_thread_system_return Return to system from thread */ +/* _tx_thread_context_restore Restore thread's context */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_schedule .type _tx_thread_schedule,function _tx_thread_schedule: -@ -@ /* Enable interrupts. */ -@ + + /* Enable interrupts. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSIE if @ Enable IRQ and FIQ interrupts + CPSIE if // Enable IRQ and FIQ interrupts #else - CPSIE i @ Enable IRQ interrupts + CPSIE i // Enable IRQ interrupts #endif -@ -@ /* Wait for a thread to execute. */ -@ do -@ { - LDR r1, =_tx_thread_execute_ptr @ Address of thread execute ptr -@ + + /* Wait for a thread to execute. */ + LDR r1, =_tx_thread_execute_ptr // Address of thread execute ptr + __tx_thread_schedule_loop: -@ - LDR r0, [r1] @ Pickup next thread to execute - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_schedule_loop @ If so, keep looking for a thread -@ -@ } -@ while(_tx_thread_execute_ptr == TX_NULL); -@ -@ /* Yes! We have a thread to execute. Lockout interrupts and -@ transfer control to it. */ -@ + + LDR r0, [r1] // Pickup next thread to execute + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_schedule_loop // If so, keep looking for a thread + /* Yes! We have a thread to execute. Lockout interrupts and + transfer control to it. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ interrupts + CPSID if // Disable IRQ and FIQ interrupts #else - CPSID i @ Disable IRQ interrupts + CPSID i // Disable IRQ interrupts #endif -@ -@ /* Setup the current thread pointer. */ -@ _tx_thread_current_ptr = _tx_thread_execute_ptr; -@ - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread - STR r0, [r1] @ Setup current thread pointer -@ -@ /* Increment the run count for this thread. */ -@ _tx_thread_current_ptr -> tx_thread_run_count++; -@ - LDR r2, [r0, #4] @ Pickup run counter - LDR r3, [r0, #24] @ Pickup time-slice for this thread - ADD r2, r2, #1 @ Increment thread run-counter - STR r2, [r0, #4] @ Store the new run counter -@ -@ /* Setup time-slice, if present. */ -@ _tx_timer_time_slice = _tx_thread_current_ptr -> tx_thread_time_slice; -@ - LDR r2, =_tx_timer_time_slice @ Pickup address of time-slice - @ variable - LDR sp, [r0, #8] @ Switch stack pointers - STR r3, [r2] @ Setup time-slice -@ -@ /* Switch to the thread's stack. */ -@ sp = _tx_thread_execute_ptr -> tx_thread_stack_ptr; -@ + + /* Setup the current thread pointer. */ + + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread + STR r0, [r1] // Setup current thread pointer + + /* Increment the run count for this thread. */ + + LDR r2, [r0, #4] // Pickup run counter + LDR r3, [r0, #24] // Pickup time-slice for this thread + ADD r2, r2, #1 // Increment thread run-counter + STR r2, [r0, #4] // Store the new run counter + + /* Setup time-slice, if present. */ + + LDR r2, =_tx_timer_time_slice // Pickup address of time-slice + // variable + LDR sp, [r0, #8] // Switch stack pointers + STR r3, [r2] // Setup time-slice + #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the thread entry function to indicate the thread is executing. */ -@ - MOV r5, r0 @ Save r0 - BL _tx_execution_thread_enter @ Call the thread execution enter function - MOV r0, r5 @ Restore r0 + + /* Call the thread entry function to indicate the thread is executing. */ + + MOV r5, r0 // Save r0 + BL _tx_execution_thread_enter // Call the thread execution enter function + MOV r0, r5 // Restore r0 #endif -@ -@ /* Determine if an interrupt frame or a synchronous task suspension frame -@ is present. */ -@ - LDMIA sp!, {r4, r5} @ Pickup the stack type and saved CPSR - CMP r4, #0 @ Check for synchronous context switch + + /* Determine if an interrupt frame or a synchronous task suspension frame + is present. */ + + LDMIA sp!, {r4, r5} // Pickup the stack type and saved CPSR + CMP r4, #0 // Check for synchronous context switch BEQ _tx_solicited_return - MSR SPSR_cxsf, r5 @ Setup SPSR for return + MSR SPSR_cxsf, r5 // Setup SPSR for return #ifdef TX_ENABLE_VFP_SUPPORT - LDR r1, [r0, #144] @ Pickup the VFP enabled flag - CMP r1, #0 @ Is the VFP enabled? - BEQ _tx_skip_interrupt_vfp_restore @ No, skip VFP interrupt restore - VLDMIA sp!, {D0-D15} @ Recover D0-D15 - VLDMIA sp!, {D16-D31} @ Recover D16-D31 - LDR r4, [sp], #4 @ Pickup FPSCR - VMSR FPSCR, r4 @ Restore FPSCR + LDR r1, [r0, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_interrupt_vfp_restore // No, skip VFP interrupt restore + VLDMIA sp!, {D0-D15} // Recover D0-D15 + VLDMIA sp!, {D16-D31} // Recover D16-D31 + LDR r4, [sp], #4 // Pickup FPSCR + VMSR FPSCR, r4 // Restore FPSCR _tx_skip_interrupt_vfp_restore: #endif - LDMIA sp!, {r0-r12, lr, pc}^ @ Return to point of thread interrupt + LDMIA sp!, {r0-r12, lr, pc}^ // Return to point of thread interrupt _tx_solicited_return: #ifdef TX_ENABLE_VFP_SUPPORT - LDR r1, [r0, #144] @ Pickup the VFP enabled flag - CMP r1, #0 @ Is the VFP enabled? - BEQ _tx_skip_solicited_vfp_restore @ No, skip VFP solicited restore - VLDMIA sp!, {D8-D15} @ Recover D8-D15 - VLDMIA sp!, {D16-D31} @ Recover D16-D31 - LDR r4, [sp], #4 @ Pickup FPSCR - VMSR FPSCR, r4 @ Restore FPSCR + LDR r1, [r0, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_solicited_vfp_restore // No, skip VFP solicited restore + VLDMIA sp!, {D8-D15} // Recover D8-D15 + VLDMIA sp!, {D16-D31} // Recover D16-D31 + LDR r4, [sp], #4 // Pickup FPSCR + VMSR FPSCR, r4 // Restore FPSCR _tx_skip_solicited_vfp_restore: #endif - MSR CPSR_cxsf, r5 @ Recover CPSR - LDMIA sp!, {r4-r11, lr} @ Return to thread synchronously + MSR CPSR_cxsf, r5 // Recover CPSR + LDMIA sp!, {r4-r11, lr} // Return to thread synchronously #ifdef __THUMB_INTERWORK - BX lr @ Return to caller + BX lr // Return to caller #else - MOV pc, lr @ Return to caller + MOV pc, lr // Return to caller #endif -@ -@} -@ #ifdef TX_ENABLE_VFP_SUPPORT .global tx_thread_vfp_enable .type tx_thread_vfp_enable,function tx_thread_vfp_enable: - MRS r2, CPSR @ Pickup the CPSR + MRS r2, CPSR // Pickup the CPSR #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Enable IRQ and FIQ interrupts + CPSID if // Enable IRQ and FIQ interrupts #else - CPSID i @ Enable IRQ interrupts + CPSID i // Enable IRQ interrupts #endif - LDR r0, =_tx_thread_current_ptr @ Build current thread pointer address - LDR r1, [r0] @ Pickup current thread pointer - CMP r1, #0 @ Check for NULL thread pointer - BEQ __tx_no_thread_to_enable @ If NULL, skip VFP enable - MOV r0, #1 @ Build enable value - STR r0, [r1, #144] @ Set the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) + LDR r0, =_tx_thread_current_ptr // Build current thread pointer address + LDR r1, [r0] // Pickup current thread pointer + CMP r1, #0 // Check for NULL thread pointer + BEQ __tx_no_thread_to_enable // If NULL, skip VFP enable + MOV r0, #1 // Build enable value + STR r0, [r1, #144] // Set the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) __tx_no_thread_to_enable: - MSR CPSR_cxsf, r2 @ Recover CPSR - BX LR @ Return to caller + MSR CPSR_cxsf, r2 // Recover CPSR + BX LR // Return to caller .global tx_thread_vfp_disable .type tx_thread_vfp_disable,function tx_thread_vfp_disable: - MRS r2, CPSR @ Pickup the CPSR + MRS r2, CPSR // Pickup the CPSR #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Enable IRQ and FIQ interrupts + CPSID if // Enable IRQ and FIQ interrupts #else - CPSID i @ Enable IRQ interrupts + CPSID i // Enable IRQ interrupts #endif - LDR r0, =_tx_thread_current_ptr @ Build current thread pointer address - LDR r1, [r0] @ Pickup current thread pointer - CMP r1, #0 @ Check for NULL thread pointer - BEQ __tx_no_thread_to_disable @ If NULL, skip VFP disable - MOV r0, #0 @ Build disable value - STR r0, [r1, #144] @ Clear the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) + LDR r0, =_tx_thread_current_ptr // Build current thread pointer address + LDR r1, [r0] // Pickup current thread pointer + CMP r1, #0 // Check for NULL thread pointer + BEQ __tx_no_thread_to_disable // If NULL, skip VFP disable + MOV r0, #0 // Build disable value + STR r0, [r1, #144] // Clear the VFP enable flag (tx_thread_vfp_enable field in TX_THREAD) __tx_no_thread_to_disable: - MSR CPSR_cxsf, r2 @ Recover CPSR - BX LR @ Return to caller + MSR CPSR_cxsf, r2 // Recover CPSR + BX LR // Return to caller #endif - diff --git a/ports/cortex_a9/gnu/src/tx_thread_stack_build.S b/ports/cortex_a9/gnu/src/tx_thread_stack_build.S index 5bb2c09f..f413e673 100644 --- a/ports/cortex_a9/gnu/src/tx_thread_stack_build.S +++ b/ports/cortex_a9/gnu/src/tx_thread_stack_build.S @@ -1,178 +1,164 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ .arm -SVC_MODE = 0x13 @ SVC mode +SVC_MODE = 0x13 // SVC mode #ifdef TX_ENABLE_FIQ_SUPPORT -CPSR_MASK = 0xDF @ Mask initial CPSR, IRQ & FIQ interrupts enabled +CPSR_MASK = 0xDF // Mask initial CPSR, IRQ & FIQ interrupts enabled #else -CPSR_MASK = 0x9F @ Mask initial CPSR, IRQ interrupts enabled +CPSR_MASK = 0x9F // Mask initial CPSR, IRQ interrupts enabled #endif -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_stack_build for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_stack_build for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .thumb .global $_tx_thread_stack_build .type $_tx_thread_stack_build,function $_tx_thread_stack_build: - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_stack_build @ Call _tx_thread_stack_build function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_stack_build // Call _tx_thread_stack_build function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_stack_build Cortex-A9/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function builds a stack frame on the supplied thread's stack. */ -@/* The stack frame results in a fake interrupt return to the supplied */ -@/* function pointer. */ -@/* */ -@/* INPUT */ -@/* */ -@/* thread_ptr Pointer to thread control blk */ -@/* function_ptr Pointer to return function */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* _tx_thread_create Create thread service */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_stack_build(TX_THREAD *thread_ptr, VOID (*function_ptr)(VOID)) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_stack_build ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function builds a stack frame on the supplied thread's stack. */ +/* The stack frame results in a fake interrupt return to the supplied */ +/* function pointer. */ +/* */ +/* INPUT */ +/* */ +/* thread_ptr Pointer to thread control blk */ +/* function_ptr Pointer to return function */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* _tx_thread_create Create thread service */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_stack_build .type _tx_thread_stack_build,function _tx_thread_stack_build: -@ -@ -@ /* Build a fake interrupt frame. The form of the fake interrupt stack -@ on the Cortex-A9 should look like the following after it is built: -@ -@ Stack Top: 1 Interrupt stack frame type -@ CPSR Initial value for CPSR -@ a1 (r0) Initial value for a1 -@ a2 (r1) Initial value for a2 -@ a3 (r2) Initial value for a3 -@ a4 (r3) Initial value for a4 -@ v1 (r4) Initial value for v1 -@ v2 (r5) Initial value for v2 -@ v3 (r6) Initial value for v3 -@ v4 (r7) Initial value for v4 -@ v5 (r8) Initial value for v5 -@ sb (r9) Initial value for sb -@ sl (r10) Initial value for sl -@ fp (r11) Initial value for fp -@ ip (r12) Initial value for ip -@ lr (r14) Initial value for lr -@ pc (r15) Initial value for pc -@ 0 For stack backtracing -@ -@ Stack Bottom: (higher memory address) */ -@ - LDR r2, [r0, #16] @ Pickup end of stack area - BIC r2, r2, #7 @ Ensure 8-byte alignment - SUB r2, r2, #76 @ Allocate space for the stack frame -@ -@ /* Actually build the stack frame. */ -@ - MOV r3, #1 @ Build interrupt stack type - STR r3, [r2, #0] @ Store stack type - MOV r3, #0 @ Build initial register value - STR r3, [r2, #8] @ Store initial r0 - STR r3, [r2, #12] @ Store initial r1 - STR r3, [r2, #16] @ Store initial r2 - STR r3, [r2, #20] @ Store initial r3 - STR r3, [r2, #24] @ Store initial r4 - STR r3, [r2, #28] @ Store initial r5 - STR r3, [r2, #32] @ Store initial r6 - STR r3, [r2, #36] @ Store initial r7 - STR r3, [r2, #40] @ Store initial r8 - STR r3, [r2, #44] @ Store initial r9 - LDR r3, [r0, #12] @ Pickup stack starting address - STR r3, [r2, #48] @ Store initial r10 (sl) - LDR r3,=_tx_thread_schedule @ Pickup address of _tx_thread_schedule for GDB backtrace - STR r3, [r2, #60] @ Store initial r14 (lr) - MOV r3, #0 @ Build initial register value - STR r3, [r2, #52] @ Store initial r11 - STR r3, [r2, #56] @ Store initial r12 - STR r1, [r2, #64] @ Store initial pc - STR r3, [r2, #68] @ 0 for back-trace - MRS r1, CPSR @ Pickup CPSR - BIC r1, r1, #CPSR_MASK @ Mask mode bits of CPSR - ORR r3, r1, #SVC_MODE @ Build CPSR, SVC mode, interrupts enabled - STR r3, [r2, #4] @ Store initial CPSR -@ -@ /* Setup stack pointer. */ -@ thread_ptr -> tx_thread_stack_ptr = r2; -@ - STR r2, [r0, #8] @ Save stack pointer in thread's - @ control block + + + /* Build a fake interrupt frame. The form of the fake interrupt stack + on the ARMv7-A should look like the following after it is built: + + Stack Top: 1 Interrupt stack frame type + CPSR Initial value for CPSR + a1 (r0) Initial value for a1 + a2 (r1) Initial value for a2 + a3 (r2) Initial value for a3 + a4 (r3) Initial value for a4 + v1 (r4) Initial value for v1 + v2 (r5) Initial value for v2 + v3 (r6) Initial value for v3 + v4 (r7) Initial value for v4 + v5 (r8) Initial value for v5 + sb (r9) Initial value for sb + sl (r10) Initial value for sl + fp (r11) Initial value for fp + ip (r12) Initial value for ip + lr (r14) Initial value for lr + pc (r15) Initial value for + 0 For stack backtracing + + Stack Bottom: (higher memory address) */ + + LDR r2, [r0, #16] // Pickup end of stack area + BIC r2, r2, #7 // Ensure 8-byte alignment + SUB r2, r2, #76 // Allocate space for the stack frame + + /* Actually build the stack frame. */ + + MOV r3, #1 // Build interrupt stack type + STR r3, [r2, #0] // Store stack type + MOV r3, #0 // Build initial register value + STR r3, [r2, #8] // Store initial r0 + STR r3, [r2, #12] // Store initial r1 + STR r3, [r2, #16] // Store initial r2 + STR r3, [r2, #20] // Store initial r3 + STR r3, [r2, #24] // Store initial r4 + STR r3, [r2, #28] // Store initial r5 + STR r3, [r2, #32] // Store initial r6 + STR r3, [r2, #36] // Store initial r7 + STR r3, [r2, #40] // Store initial r8 + STR r3, [r2, #44] // Store initial r9 + LDR r3, [r0, #12] // Pickup stack starting address + STR r3, [r2, #48] // Store initial r10 (sl) + LDR r3,=_tx_thread_schedule // Pickup address of _tx_thread_schedule for GDB backtrace + STR r3, [r2, #60] // Store initial r14 (lr) + MOV r3, #0 // Build initial register value + STR r3, [r2, #52] // Store initial r11 + STR r3, [r2, #56] // Store initial r12 + STR r1, [r2, #64] // Store initial pc + STR r3, [r2, #68] // 0 for back-trace + MRS r1, CPSR // Pickup CPSR + BIC r1, r1, #CPSR_MASK // Mask mode bits of CPSR + ORR r3, r1, #SVC_MODE // Build CPSR, SVC mode, interrupts enabled + STR r3, [r2, #4] // Store initial CPSR + + /* Setup stack pointer. */ + + STR r2, [r0, #8] // Save stack pointer in thread's + // control block #ifdef __THUMB_INTERWORK - BX lr @ Return to caller + BX lr // Return to caller #else - MOV pc, lr @ Return to caller + MOV pc, lr // Return to caller #endif -@} - - diff --git a/ports/cortex_a9/gnu/src/tx_thread_system_return.S b/ports/cortex_a9/gnu/src/tx_thread_system_return.S index f495d445..cb7d62ce 100644 --- a/ports/cortex_a9/gnu/src/tx_thread_system_return.S +++ b/ports/cortex_a9/gnu/src/tx_thread_system_return.S @@ -1,183 +1,162 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@#include "tx_timer.h" -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .arm -@ -@ + + .global _tx_thread_current_ptr .global _tx_timer_time_slice .global _tx_thread_schedule - .global _tx_execution_thread_exit -@ -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_thread_system_return for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + + + +/* Define the 16-bit Thumb mode veneer for _tx_thread_system_return for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .global $_tx_thread_system_return .type $_tx_thread_system_return,function $_tx_thread_system_return: .thumb - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_thread_system_return @ Call _tx_thread_system_return function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_thread_system_return // Call _tx_thread_system_return function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_system_return Cortex-A9/GNU */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function is target processor specific. It is used to transfer */ -@/* control from a thread back to the ThreadX system. Only a */ -@/* minimal context is saved since the compiler assumes temp registers */ -@/* are going to get slicked by a function call anyway. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* _tx_thread_schedule Thread scheduling loop */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ThreadX components */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_system_return(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_system_return ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is target processor specific. It is used to transfer */ +/* control from a thread back to the ThreadX system. Only a */ +/* minimal context is saved since the compiler assumes temp registers */ +/* are going to get slicked by a function call anyway. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_schedule Thread scheduling loop */ +/* */ +/* CALLED BY */ +/* */ +/* ThreadX components */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_system_return .type _tx_thread_system_return,function _tx_thread_system_return: -@ -@ /* Save minimal context on the stack. */ -@ - STMDB sp!, {r4-r11, lr} @ Save minimal context - LDR r4, =_tx_thread_current_ptr @ Pickup address of current ptr - LDR r5, [r4] @ Pickup current thread pointer - + /* Save minimal context on the stack. */ + + STMDB sp!, {r4-r11, lr} // Save minimal context + + LDR r4, =_tx_thread_current_ptr // Pickup address of current ptr + LDR r5, [r4] // Pickup current thread pointer + #ifdef TX_ENABLE_VFP_SUPPORT - LDR r1, [r5, #144] @ Pickup the VFP enabled flag - CMP r1, #0 @ Is the VFP enabled? - BEQ _tx_skip_solicited_vfp_save @ No, skip VFP solicited save - VMRS r1, FPSCR @ Pickup the FPSCR - STR r1, [sp, #-4]! @ Save FPSCR - VSTMDB sp!, {D16-D31} @ Save D16-D31 - VSTMDB sp!, {D8-D15} @ Save D8-D15 + LDR r1, [r5, #144] // Pickup the VFP enabled flag + CMP r1, #0 // Is the VFP enabled? + BEQ _tx_skip_solicited_vfp_save // No, skip VFP solicited save + VMRS r1, FPSCR // Pickup the FPSCR + STR r1, [sp, #-4]! // Save FPSCR + VSTMDB sp!, {D16-D31} // Save D16-D31 + VSTMDB sp!, {D8-D15} // Save D8-D15 _tx_skip_solicited_vfp_save: #endif - MOV r0, #0 @ Build a solicited stack type - MRS r1, CPSR @ Pickup the CPSR - STMDB sp!, {r0-r1} @ Save type and CPSR -@ -@ /* Lockout interrupts. */ -@ -#ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ interrupts -#else - CPSID i @ Disable IRQ interrupts -#endif - -#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the thread exit function to indicate the thread is no longer executing. */ -@ - BL _tx_execution_thread_exit @ Call the thread exit function -#endif - MOV r3, r4 @ Pickup address of current ptr - MOV r0, r5 @ Pickup current thread pointer - LDR r2, =_tx_timer_time_slice @ Pickup address of time slice - LDR r1, [r2] @ Pickup current time slice -@ -@ /* Save current stack and switch to system stack. */ -@ _tx_thread_current_ptr -> tx_thread_stack_ptr = sp; -@ sp = _tx_thread_system_stack_ptr; -@ - STR sp, [r0, #8] @ Save thread stack pointer -@ -@ /* Determine if the time-slice is active. */ -@ if (_tx_timer_time_slice) -@ { -@ - MOV r4, #0 @ Build clear value - CMP r1, #0 @ Is a time-slice active? - BEQ __tx_thread_dont_save_ts @ No, don't save the time-slice -@ -@ /* Save time-slice for the thread and clear the current time-slice. */ -@ _tx_thread_current_ptr -> tx_thread_time_slice = _tx_timer_time_slice; -@ _tx_timer_time_slice = 0; -@ - STR r4, [r2] @ Clear time-slice - STR r1, [r0, #24] @ Save current time-slice -@ -@ } -__tx_thread_dont_save_ts: -@ -@ /* Clear the current thread pointer. */ -@ _tx_thread_current_ptr = TX_NULL; -@ - STR r4, [r3] @ Clear current thread pointer - B _tx_thread_schedule @ Jump to scheduler! -@ -@} + MOV r0, #0 // Build a solicited stack type + MRS r1, CPSR // Pickup the CPSR + STMDB sp!, {r0-r1} // Save type and CPSR + /* Lockout interrupts. */ + +#ifdef TX_ENABLE_FIQ_SUPPORT + CPSID if // Disable IRQ and FIQ interrupts +#else + CPSID i // Disable IRQ interrupts +#endif + +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) + + /* Call the thread exit function to indicate the thread is no longer executing. */ + + BL _tx_execution_thread_exit // Call the thread exit function +#endif + MOV r3, r4 // Pickup address of current ptr + MOV r0, r5 // Pickup current thread pointer + LDR r2, =_tx_timer_time_slice // Pickup address of time slice + LDR r1, [r2] // Pickup current time slice + + /* Save current stack and switch to system stack. */ + + STR sp, [r0, #8] // Save thread stack pointer + + /* Determine if the time-slice is active. */ + + MOV r4, #0 // Build clear value + CMP r1, #0 // Is a time-slice active? + BEQ __tx_thread_dont_save_ts // No, don't save the time-slice + + /* Save time-slice for the thread and clear the current time-slice. */ + + STR r4, [r2] // Clear time-slice + STR r1, [r0, #24] // Save current time-slice + +__tx_thread_dont_save_ts: + + /* Clear the current thread pointer. */ + + STR r4, [r3] // Clear current thread pointer + B _tx_thread_schedule // Jump to scheduler! diff --git a/ports/cortex_a9/gnu/src/tx_thread_vectored_context_save.S b/ports/cortex_a9/gnu/src/tx_thread_vectored_context_save.S index f3b7c7a8..d846223f 100644 --- a/ports/cortex_a9/gnu/src/tx_thread_vectored_context_save.S +++ b/ports/cortex_a9/gnu/src/tx_thread_vectored_context_save.S @@ -1,193 +1,165 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Thread */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Thread */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .global _tx_thread_system_state .global _tx_thread_current_ptr .global _tx_execution_isr_enter -@ -@ -@ -@/* No 16-bit Thumb mode veneer code is needed for _tx_thread_vectored_context_save -@ since it will never be called 16-bit mode. */ -@ + + + +/* No 16-bit Thumb mode veneer code is needed for _tx_thread_vectored_context_save + since it will never be called 16-bit mode. */ + .arm .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_thread_vectored_context_save Cortex-A9/GNU */ -@/* 6.1.9 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function saves the context of an executing thread in the */ -@/* beginning of interrupt processing. The function also ensures that */ -@/* the system stack is used upon return to the calling ISR. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* None */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* ISRs */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* 10-15-2021 William E. Lamie Modified comment(s), added */ -@/* execution profile support, */ -@/* resulting in version 6.1.9 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_thread_vectored_context_save(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_vectored_context_save ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function saves the context of an executing thread in the */ +/* beginning of interrupt processing. The function also ensures that */ +/* the system stack is used upon return to the calling ISR. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* ISRs */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 William E. Lamie Modified comment(s), added */ +/* execution profile support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_thread_vectored_context_save .type _tx_thread_vectored_context_save,function _tx_thread_vectored_context_save: -@ -@ /* Upon entry to this routine, it is assumed that IRQ interrupts are locked -@ out, we are in IRQ mode, and all registers are intact. */ -@ -@ /* Check for a nested interrupt condition. */ -@ if (_tx_thread_system_state++) -@ { -@ + + /* Upon entry to this routine, it is assumed that IRQ interrupts are locked + out, we are in IRQ mode, and all registers are intact. */ + + /* Check for a nested interrupt condition. */ + #ifdef TX_ENABLE_FIQ_SUPPORT - CPSID if @ Disable IRQ and FIQ interrupts + CPSID if // Disable IRQ and FIQ interrupts #endif - LDR r3, =_tx_thread_system_state @ Pickup address of system state variable - LDR r2, [r3, #0] @ Pickup system state - CMP r2, #0 @ Is this the first interrupt? - BEQ __tx_thread_not_nested_save @ Yes, not a nested context save -@ -@ /* Nested interrupt condition. */ -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3, #0] @ Store it back in the variable -@ -@ /* Note: Minimal context of interrupted thread is already saved. */ -@ -@ /* Return to the ISR. */ -@ - MOV r10, #0 @ Clear stack limit + LDR r3, =_tx_thread_system_state // Pickup address of system state variable + LDR r2, [r3, #0] // Pickup system state + CMP r2, #0 // Is this the first interrupt? + BEQ __tx_thread_not_nested_save // Yes, not a nested context save + + /* Nested interrupt condition. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3, #0] // Store it back in the variable + + /* Note: Minimal context of interrupted thread is already saved. */ + + /* Return to the ISR. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - MOV pc, lr @ Return to caller -@ + MOV pc, lr // Return to caller + __tx_thread_not_nested_save: -@ } -@ -@ /* Otherwise, not nested, check to see if a thread was running. */ -@ else if (_tx_thread_current_ptr) -@ { -@ - ADD r2, r2, #1 @ Increment the interrupt counter - STR r2, [r3, #0] @ Store it back in the variable - LDR r1, =_tx_thread_current_ptr @ Pickup address of current thread ptr - LDR r0, [r1, #0] @ Pickup current thread pointer - CMP r0, #0 @ Is it NULL? - BEQ __tx_thread_idle_system_save @ If so, interrupt occurred in - @ scheduling loop - nothing needs saving! -@ -@ /* Note: Minimal context of interrupted thread is already saved. */ -@ -@ /* Save the current stack pointer in the thread's control block. */ -@ _tx_thread_current_ptr -> tx_thread_stack_ptr = sp; -@ -@ /* Switch to the system stack. */ -@ sp = _tx_thread_system_stack_ptr; -@ - MOV r10, #0 @ Clear stack limit + + /* Otherwise, not nested, check to see if a thread was running. */ + + ADD r2, r2, #1 // Increment the interrupt counter + STR r2, [r3, #0] // Store it back in the variable + LDR r1, =_tx_thread_current_ptr // Pickup address of current thread ptr + LDR r0, [r1, #0] // Pickup current thread pointer + CMP r0, #0 // Is it NULL? + BEQ __tx_thread_idle_system_save // If so, interrupt occurred in + // scheduling loop - nothing needs saving! + /* Note: Minimal context of interrupted thread is already saved. */ + + /* Save the current stack pointer in the thread's control block. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - MOV pc, lr @ Return to caller -@ -@ } -@ else -@ { -@ + MOV pc, lr // Return to caller + __tx_thread_idle_system_save: -@ -@ /* Interrupt occurred in the scheduling loop. */ -@ -@ /* Not much to do here, just adjust the stack pointer, and return to IRQ -@ processing. */ -@ - MOV r10, #0 @ Clear stack limit + + /* Interrupt occurred in the scheduling loop. */ + + /* Not much to do here, just adjust the stack pointer, and return to IRQ + processing. */ + + MOV r10, #0 // Clear stack limit #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) -@ -@ /* Call the ISR enter function to indicate an ISR is executing. */ -@ - PUSH {lr} @ Save ISR lr - BL _tx_execution_isr_enter @ Call the ISR enter function - POP {lr} @ Recover ISR lr + + /* Call the ISR enter function to indicate an ISR is executing. */ + + PUSH {lr} // Save ISR lr + BL _tx_execution_isr_enter // Call the ISR enter function + POP {lr} // Recover ISR lr #endif - ADD sp, sp, #32 @ Recover saved registers - MOV pc, lr @ Return to caller -@ -@ } -@} - + ADD sp, sp, #32 // Recover saved registers + MOV pc, lr // Return to caller diff --git a/ports/cortex_a9/gnu/src/tx_timer_interrupt.S b/ports/cortex_a9/gnu/src/tx_timer_interrupt.S index 92365206..7337ed0c 100644 --- a/ports/cortex_a9/gnu/src/tx_timer_interrupt.S +++ b/ports/cortex_a9/gnu/src/tx_timer_interrupt.S @@ -1,40 +1,30 @@ -@/**************************************************************************/ -@/* */ -@/* Copyright (c) Microsoft Corporation. All rights reserved. */ -@/* */ -@/* This software is licensed under the Microsoft Software License */ -@/* Terms for Microsoft Azure RTOS. Full text of the license can be */ -@/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ -@/* and in the root directory of this software. */ -@/* */ -@/**************************************************************************/ -@ -@ -@/**************************************************************************/ -@/**************************************************************************/ -@/** */ -@/** ThreadX Component */ -@/** */ -@/** Timer */ -@/** */ -@/**************************************************************************/ -@/**************************************************************************/ -@ -@#define TX_SOURCE_CODE -@ -@ -@/* Include necessary system files. */ -@ -@#include "tx_api.h" -@#include "tx_timer.h" -@#include "tx_thread.h" -@ -@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** Timer */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + .arm -@ -@/* Define Assembly language external references... */ -@ + +/* Define Assembly language external references... */ + .global _tx_timer_time_slice .global _tx_timer_system_clock .global _tx_timer_current_ptr @@ -43,237 +33,199 @@ .global _tx_timer_expired_time_slice .global _tx_timer_expired .global _tx_thread_time_slice -@ -@ -@ -@/* Define the 16-bit Thumb mode veneer for _tx_timer_interrupt for -@ applications calling this function from to 16-bit Thumb mode. */ -@ + + + +/* Define the 16-bit Thumb mode veneer for _tx_timer_interrupt for + applications calling this function from to 16-bit Thumb mode. */ + .text .align 2 .thumb .global $_tx_timer_interrupt .type $_tx_timer_interrupt,function $_tx_timer_interrupt: - BX pc @ Switch to 32-bit mode - NOP @ + BX pc // Switch to 32-bit mode + NOP // .arm - STMFD sp!, {lr} @ Save return address - BL _tx_timer_interrupt @ Call _tx_timer_interrupt function - LDMFD sp!, {lr} @ Recover saved return address - BX lr @ Return to 16-bit caller -@ -@ + STMFD sp!, {lr} // Save return address + BL _tx_timer_interrupt // Call _tx_timer_interrupt function + LDMFD sp!, {lr} // Recover saved return address + BX lr // Return to 16-bit caller + + .text .align 2 -@/**************************************************************************/ -@/* */ -@/* FUNCTION RELEASE */ -@/* */ -@/* _tx_timer_interrupt Cortex-A9/GNU */ -@/* 6.1 */ -@/* AUTHOR */ -@/* */ -@/* William E. Lamie, Microsoft Corporation */ -@/* */ -@/* DESCRIPTION */ -@/* */ -@/* This function processes the hardware timer interrupt. This */ -@/* processing includes incrementing the system clock and checking for */ -@/* time slice and/or timer expiration. If either is found, the */ -@/* interrupt context save/restore functions are called along with the */ -@/* expiration functions. */ -@/* */ -@/* INPUT */ -@/* */ -@/* None */ -@/* */ -@/* OUTPUT */ -@/* */ -@/* None */ -@/* */ -@/* CALLS */ -@/* */ -@/* _tx_thread_time_slice Time slice interrupted thread */ -@/* _tx_timer_expiration_process Timer expiration processing */ -@/* */ -@/* CALLED BY */ -@/* */ -@/* interrupt vector */ -@/* */ -@/* RELEASE HISTORY */ -@/* */ -@/* DATE NAME DESCRIPTION */ -@/* */ -@/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -@/* */ -@/**************************************************************************/ -@VOID _tx_timer_interrupt(VOID) -@{ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_timer_interrupt ARMv7-A */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* William E. Lamie, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function processes the hardware timer interrupt. This */ +/* processing includes incrementing the system clock and checking for */ +/* time slice and/or timer expiration. If either is found, the */ +/* interrupt context save/restore functions are called along with the */ +/* expiration functions. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _tx_thread_time_slice Time slice interrupted thread */ +/* _tx_timer_expiration_process Timer expiration processing */ +/* */ +/* CALLED BY */ +/* */ +/* interrupt vector */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-25-2022 Zhen Kong Updated comments, */ +/* resulting in version 6.1.11 */ +/* */ +/**************************************************************************/ .global _tx_timer_interrupt .type _tx_timer_interrupt,function _tx_timer_interrupt: -@ -@ /* Upon entry to this routine, it is assumed that context save has already -@ been called, and therefore the compiler scratch registers are available -@ for use. */ -@ -@ /* Increment the system clock. */ -@ _tx_timer_system_clock++; -@ - LDR r1, =_tx_timer_system_clock @ Pickup address of system clock - LDR r0, [r1] @ Pickup system clock - ADD r0, r0, #1 @ Increment system clock - STR r0, [r1] @ Store new system clock -@ -@ /* Test for time-slice expiration. */ -@ if (_tx_timer_time_slice) -@ { -@ - LDR r3, =_tx_timer_time_slice @ Pickup address of time-slice - LDR r2, [r3] @ Pickup time-slice - CMP r2, #0 @ Is it non-active? - BEQ __tx_timer_no_time_slice @ Yes, skip time-slice processing -@ -@ /* Decrement the time_slice. */ -@ _tx_timer_time_slice--; -@ - SUB r2, r2, #1 @ Decrement the time-slice - STR r2, [r3] @ Store new time-slice value -@ -@ /* Check for expiration. */ -@ if (__tx_timer_time_slice == 0) -@ - CMP r2, #0 @ Has it expired? - BNE __tx_timer_no_time_slice @ No, skip expiration processing -@ -@ /* Set the time-slice expired flag. */ -@ _tx_timer_expired_time_slice = TX_TRUE; -@ - LDR r3, =_tx_timer_expired_time_slice @ Pickup address of expired flag - MOV r0, #1 @ Build expired value - STR r0, [r3] @ Set time-slice expiration flag -@ -@ } -@ -__tx_timer_no_time_slice: -@ -@ /* Test for timer expiration. */ -@ if (*_tx_timer_current_ptr) -@ { -@ - LDR r1, =_tx_timer_current_ptr @ Pickup current timer pointer address - LDR r0, [r1] @ Pickup current timer - LDR r2, [r0] @ Pickup timer list entry - CMP r2, #0 @ Is there anything in the list? - BEQ __tx_timer_no_timer @ No, just increment the timer -@ -@ /* Set expiration flag. */ -@ _tx_timer_expired = TX_TRUE; -@ - LDR r3, =_tx_timer_expired @ Pickup expiration flag address - MOV r2, #1 @ Build expired value - STR r2, [r3] @ Set expired flag - B __tx_timer_done @ Finished timer processing -@ -@ } -@ else -@ { -__tx_timer_no_timer: -@ -@ /* No timer expired, increment the timer pointer. */ -@ _tx_timer_current_ptr++; -@ - ADD r0, r0, #4 @ Move to next timer -@ -@ /* Check for wraparound. */ -@ if (_tx_timer_current_ptr == _tx_timer_list_end) -@ - LDR r3, =_tx_timer_list_end @ Pickup address of timer list end - LDR r2, [r3] @ Pickup list end - CMP r0, r2 @ Are we at list end? - BNE __tx_timer_skip_wrap @ No, skip wraparound logic -@ -@ /* Wrap to beginning of list. */ -@ _tx_timer_current_ptr = _tx_timer_list_start; -@ - LDR r3, =_tx_timer_list_start @ Pickup address of timer list start - LDR r0, [r3] @ Set current pointer to list start -@ -__tx_timer_skip_wrap: -@ - STR r0, [r1] @ Store new current timer pointer -@ } -@ -__tx_timer_done: -@ -@ -@ /* See if anything has expired. */ -@ if ((_tx_timer_expired_time_slice) || (_tx_timer_expired)) -@ { -@ - LDR r3, =_tx_timer_expired_time_slice @ Pickup address of expired flag - LDR r2, [r3] @ Pickup time-slice expired flag - CMP r2, #0 @ Did a time-slice expire? - BNE __tx_something_expired @ If non-zero, time-slice expired - LDR r1, =_tx_timer_expired @ Pickup address of other expired flag - LDR r0, [r1] @ Pickup timer expired flag - CMP r0, #0 @ Did a timer expire? - BEQ __tx_timer_nothing_expired @ No, nothing expired -@ -__tx_something_expired: -@ -@ - STMDB sp!, {r0, lr} @ Save the lr register on the stack - @ and save r0 just to keep 8-byte alignment -@ -@ /* Did a timer expire? */ -@ if (_tx_timer_expired) -@ { -@ - LDR r1, =_tx_timer_expired @ Pickup address of expired flag - LDR r0, [r1] @ Pickup timer expired flag - CMP r0, #0 @ Check for timer expiration - BEQ __tx_timer_dont_activate @ If not set, skip timer activation -@ -@ /* Process timer expiration. */ -@ _tx_timer_expiration_process(); -@ - BL _tx_timer_expiration_process @ Call the timer expiration handling routine -@ -@ } -__tx_timer_dont_activate: -@ -@ /* Did time slice expire? */ -@ if (_tx_timer_expired_time_slice) -@ { -@ - LDR r3, =_tx_timer_expired_time_slice @ Pickup address of time-slice expired - LDR r2, [r3] @ Pickup the actual flag - CMP r2, #0 @ See if the flag is set - BEQ __tx_timer_not_ts_expiration @ No, skip time-slice processing -@ -@ /* Time slice interrupted thread. */ -@ _tx_thread_time_slice(); -@ - BL _tx_thread_time_slice @ Call time-slice processing -@ -@ } -@ -__tx_timer_not_ts_expiration: -@ - LDMIA sp!, {r0, lr} @ Recover lr register (r0 is just there for - @ the 8-byte stack alignment -@ -@ } -@ -__tx_timer_nothing_expired: -@ -#ifdef __THUMB_INTERWORK - BX lr @ Return to caller -#else - MOV pc, lr @ Return to caller -#endif -@ -@} + /* Upon entry to this routine, it is assumed that context save has already + been called, and therefore the compiler scratch registers are available + for use. */ + + /* Increment the system clock. */ + + LDR r1, =_tx_timer_system_clock // Pickup address of system clock + LDR r0, [r1] // Pickup system clock + ADD r0, r0, #1 // Increment system clock + STR r0, [r1] // Store new system clock + + /* Test for time-slice expiration. */ + + LDR r3, =_tx_timer_time_slice // Pickup address of time-slice + LDR r2, [r3] // Pickup time-slice + CMP r2, #0 // Is it non-active? + BEQ __tx_timer_no_time_slice // Yes, skip time-slice processing + + /* Decrement the time_slice. */ + + SUB r2, r2, #1 // Decrement the time-slice + STR r2, [r3] // Store new time-slice value + + /* Check for expiration. */ + + CMP r2, #0 // Has it expired? + BNE __tx_timer_no_time_slice // No, skip expiration processing + + /* Set the time-slice expired flag. */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of expired flag + MOV r0, #1 // Build expired value + STR r0, [r3] // Set time-slice expiration flag + +__tx_timer_no_time_slice: + + /* Test for timer expiration. */ + + LDR r1, =_tx_timer_current_ptr // Pickup current timer pointer address + LDR r0, [r1] // Pickup current timer + LDR r2, [r0] // Pickup timer list entry + CMP r2, #0 // Is there anything in the list? + BEQ __tx_timer_no_timer // No, just increment the timer + + /* Set expiration flag. */ + + LDR r3, =_tx_timer_expired // Pickup expiration flag address + MOV r2, #1 // Build expired value + STR r2, [r3] // Set expired flag + B __tx_timer_done // Finished timer processing + +__tx_timer_no_timer: + + /* No timer expired, increment the timer pointer. */ + ADD r0, r0, #4 // Move to next timer + + /* Check for wraparound. */ + + LDR r3, =_tx_timer_list_end // Pickup address of timer list end + LDR r2, [r3] // Pickup list end + CMP r0, r2 // Are we at list end? + BNE __tx_timer_skip_wrap // No, skip wraparound logic + + /* Wrap to beginning of list. */ + + LDR r3, =_tx_timer_list_start // Pickup address of timer list start + LDR r0, [r3] // Set current pointer to list start + +__tx_timer_skip_wrap: + + STR r0, [r1] // Store new current timer pointer + +__tx_timer_done: + + /* See if anything has expired. */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of expired flag + LDR r2, [r3] // Pickup time-slice expired flag + CMP r2, #0 // Did a time-slice expire? + BNE __tx_something_expired // If non-zero, time-slice expired + LDR r1, =_tx_timer_expired // Pickup address of other expired flag + LDR r0, [r1] // Pickup timer expired flag + CMP r0, #0 // Did a timer expire? + BEQ __tx_timer_nothing_expired // No, nothing expired + +__tx_something_expired: + + STMDB sp!, {r0, lr} // Save the lr register on the stack + // and save r0 just to keep 8-byte alignment + + /* Did a timer expire? */ + + LDR r1, =_tx_timer_expired // Pickup address of expired flag + LDR r0, [r1] // Pickup timer expired flag + CMP r0, #0 // Check for timer expiration + BEQ __tx_timer_dont_activate // If not set, skip timer activation + + /* Process timer expiration. */ + BL _tx_timer_expiration_process // Call the timer expiration handling routine + +__tx_timer_dont_activate: + + /* Did time slice expire? */ + + LDR r3, =_tx_timer_expired_time_slice // Pickup address of time-slice expired + LDR r2, [r3] // Pickup the actual flag + CMP r2, #0 // See if the flag is set + BEQ __tx_timer_not_ts_expiration // No, skip time-slice processing + + /* Time slice interrupted thread. */ + + BL _tx_thread_time_slice // Call time-slice processing + +__tx_timer_not_ts_expiration: + + LDMIA sp!, {r0, lr} // Recover lr register (r0 is just there for + // the 8-byte stack alignment + +__tx_timer_nothing_expired: + +#ifdef __THUMB_INTERWORK + BX lr // Return to caller +#else + MOV pc, lr // Return to caller +#endif diff --git a/ports/cortex_m0/ac5/inc/tx_port.h b/ports/cortex_m0/ac5/inc/tx_port.h index 048999e4..7dfaa192 100644 --- a/ports/cortex_m0/ac5/inc/tx_port.h +++ b/ports/cortex_m0/ac5/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M0/AC5 */ -/* 6.1.6 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -51,6 +51,9 @@ /* 04-02-2021 Bhupendra Naphade Modified comment(s),updated */ /* macro definition, */ /* resulting in version 6.1.6 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -126,14 +129,14 @@ typedef unsigned short USHORT; For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_MISRA_ENABLE #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #else ULONG _tx_misra_time_stamp_get(VOID); @@ -304,7 +307,7 @@ unsigned int was_masked; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (_ipsr == 0) { was_masked = __disable_irq(); @@ -321,7 +324,7 @@ unsigned int was_masked; #ifdef TX_THREAD_INIT CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M0/AC5 Version 6.1.9 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M0/AC5 Version 6.1.11 *"; #else #ifdef TX_MISRA_ENABLE extern CHAR _tx_version_id[100]; diff --git a/ports/cortex_m0/ac6/inc/tx_port.h b/ports/cortex_m0/ac6/inc/tx_port.h index c96e16ed..7492d49c 100644 --- a/ports/cortex_m0/ac6/inc/tx_port.h +++ b/ports/cortex_m0/ac6/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M0/AC6 */ -/* 6.1.6 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -51,6 +51,9 @@ /* 04-02-2021 Bhupendra Naphade Modified comment(s),updated */ /* macro definition, */ /* resulting in version 6.1.6 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -143,19 +146,20 @@ typedef unsigned short USHORT; For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_MISRA_ENABLE #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #else ULONG _tx_misra_time_stamp_get(VOID); #define TX_TRACE_TIME_SOURCE _tx_misra_time_stamp_get() #endif + #ifndef TX_TRACE_TIME_MASK #define TX_TRACE_TIME_MASK 0xFFFFFFFFUL #endif @@ -328,7 +332,8 @@ __attribute__( ( always_inline ) ) static inline void _tx_thread_system_return_i { unsigned int interrupt_save; - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + /* Set PendSV to invoke ThreadX scheduler. */ + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (__get_ipsr_value() == 0) { interrupt_save = __get_primask_value(); @@ -362,7 +367,7 @@ unsigned int interrupt_save; #ifdef TX_THREAD_INIT CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M0/AC6 Version 6.1.9 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M0/AC6 Version 6.1.11 *"; #else extern CHAR _tx_version_id[]; #endif diff --git a/ports/cortex_m0/gnu/inc/tx_port.h b/ports/cortex_m0/gnu/inc/tx_port.h index cc17069d..c5e2c447 100644 --- a/ports/cortex_m0/gnu/inc/tx_port.h +++ b/ports/cortex_m0/gnu/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M0/GNU */ -/* 6.1.6 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -47,12 +47,15 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 05-19-2020 William E. Lamie Initial Version 6.0 */ -/* 09-30-2020 William E. Lamie Modified comment(s), */ +/* 05-19-2020 William E. Lamie Initial Version 6.0 */ +/* 09-30-2020 William E. Lamie Modified comment(s), */ /* resulting in version 6.1 */ -/* 04-02-2021 Bhupendra Naphade Modified comment(s),updated */ +/* 04-02-2021 Bhupendra Naphade Modified comment(s),updated */ /* macro definition, */ /* resulting in version 6.1.6 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -145,19 +148,20 @@ typedef unsigned short USHORT; For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_MISRA_ENABLE #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #else ULONG _tx_misra_time_stamp_get(VOID); #define TX_TRACE_TIME_SOURCE _tx_misra_time_stamp_get() #endif + #ifndef TX_TRACE_TIME_MASK #define TX_TRACE_TIME_MASK 0xFFFFFFFFUL #endif @@ -330,7 +334,8 @@ __attribute__( ( always_inline ) ) static inline void _tx_thread_system_return_i { unsigned int interrupt_save; - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + /* Set PendSV to invoke ThreadX scheduler. */ + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (__get_ipsr_value() == 0) { interrupt_save = __get_primask_value(); @@ -364,7 +369,7 @@ unsigned int interrupt_save; #ifdef TX_THREAD_INIT CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M0/GNU Version 6.1.9 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M0/GNU Version 6.1.11 *"; #else extern CHAR _tx_version_id[]; #endif diff --git a/ports/cortex_m0/iar/inc/tx_port.h b/ports/cortex_m0/iar/inc/tx_port.h index 534fd8c1..d78f7e74 100644 --- a/ports/cortex_m0/iar/inc/tx_port.h +++ b/ports/cortex_m0/iar/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M0/IAR */ -/* 6.1.6 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -47,10 +47,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 04-02-2021 Bhupendra Naphade Modified comment(s),updated */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-02-2021 Bhupendra Naphade Modified comment(s),updated */ /* macro definition, */ /* resulting in version 6.1.6 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -130,14 +133,14 @@ typedef unsigned short USHORT; For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_MISRA_ENABLE #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #else ULONG _tx_misra_time_stamp_get(VOID); @@ -321,7 +324,7 @@ static void _tx_thread_system_return_inline(void) __istate_t interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (__get_IPSR() == 0) { interrupt_save = __get_interrupt_state(); @@ -347,7 +350,7 @@ __istate_t interrupt_save; #ifdef TX_THREAD_INIT CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M0/IAR Version 6.1.9 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M0/IAR Version 6.1.11 *"; #else #ifdef TX_MISRA_ENABLE extern CHAR _tx_version_id[100]; diff --git a/ports/cortex_m0/keil/inc/tx_port.h b/ports/cortex_m0/keil/inc/tx_port.h index 504edd41..8f0699ab 100644 --- a/ports/cortex_m0/keil/inc/tx_port.h +++ b/ports/cortex_m0/keil/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M0/AC5 */ -/* 6.1.6 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -47,10 +47,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 04-02-2021 Bhupendra Naphade Modified comment(s),updated */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 04-02-2021 Bhupendra Naphade Modified comment(s),updated */ /* macro definition, */ /* resulting in version 6.1.6 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -126,14 +129,14 @@ typedef unsigned short USHORT; For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_MISRA_ENABLE #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #else ULONG _tx_misra_time_stamp_get(VOID); @@ -304,7 +307,7 @@ unsigned int was_masked; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (_ipsr == 0) { was_masked = __disable_irq(); @@ -321,7 +324,7 @@ unsigned int was_masked; #ifdef TX_THREAD_INIT CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M0/AC5 Version 6.1.9 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M0/AC5 Version 6.1.11 *"; #else #ifdef TX_MISRA_ENABLE extern CHAR _tx_version_id[100]; diff --git a/ports/cortex_m23/ac6/inc/tx_port.h b/ports/cortex_m23/ac6/inc/tx_port.h index 51010daf..ccde44e9 100644 --- a/ports/cortex_m23/ac6/inc/tx_port.h +++ b/ports/cortex_m23/ac6/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M23/AC6 */ -/* 6.1.9 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -56,9 +56,12 @@ /* conditional compilation */ /* for ARMv8-M (Cortex M23/33) */ /* resulting in version 6.1.7 */ -/* 10-15-2021 Scott Larson Modified comment(s), improved */ +/* 10-15-2021 Scott Larson Modified comment(s), improved */ /* stack check error handling, */ /* resulting in version 6.1.9 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -175,14 +178,14 @@ UINT _tx_thread_secure_stack_free(struct TX_THREAD_STRUCT *tx_thread); For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_MISRA_ENABLE #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #else ULONG _tx_misra_time_stamp_get(VOID); @@ -392,7 +395,7 @@ unsigned int was_masked; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (_get_ipsr() == 0) { was_masked = __disable_irq(); @@ -408,7 +411,7 @@ unsigned int was_masked; #ifdef TX_THREAD_INIT CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M23/AC6 Version 6.1.9 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M23/AC6 Version 6.1.11 *"; #else #ifdef TX_MISRA_ENABLE extern CHAR _tx_version_id[100]; diff --git a/ports/cortex_m23/gnu/inc/tx_port.h b/ports/cortex_m23/gnu/inc/tx_port.h index 6c3b424f..db5935cb 100644 --- a/ports/cortex_m23/gnu/inc/tx_port.h +++ b/ports/cortex_m23/gnu/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M23/GNU */ -/* 6.1.9 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -57,9 +57,12 @@ /* conditional compilation */ /* for ARMv8-M (Cortex M23/33) */ /* resulting in version 6.1.7 */ -/* 10-15-2021 Scott Larson Modified comment(s), improved */ +/* 10-15-2021 Scott Larson Modified comment(s), improved */ /* stack check error handling, */ /* resulting in version 6.1.9 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -175,14 +178,14 @@ UINT _tx_thread_secure_stack_free(struct TX_THREAD_STRUCT *tx_thread); For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_MISRA_ENABLE #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #else ULONG _tx_misra_time_stamp_get(VOID); @@ -405,7 +408,8 @@ __attribute__( ( always_inline ) ) static inline void _tx_thread_system_return_i { unsigned int interrupt_save; - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + /* Set PendSV to invoke ThreadX scheduler. */ + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (_get_ipsr() == 0) { interrupt_save = __get_primask_value(); @@ -439,7 +443,7 @@ unsigned int interrupt_save; #ifdef TX_THREAD_INIT CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M23/GNU Version 6.1.9 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M23/GNU Version 6.1.11 *"; #else #ifdef TX_MISRA_ENABLE extern CHAR _tx_version_id[100]; diff --git a/ports/cortex_m23/iar/inc/tx_port.h b/ports/cortex_m23/iar/inc/tx_port.h index 602e73e9..73a54080 100644 --- a/ports/cortex_m23/iar/inc/tx_port.h +++ b/ports/cortex_m23/iar/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M23/IAR */ -/* 6.1.9 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -55,9 +55,12 @@ /* conditional compilation */ /* for ARMv8-M (Cortex M23/33) */ /* resulting in version 6.1.7 */ -/* 10-15-2021 Scott Larson Modified comment(s), improved */ +/* 10-15-2021 Scott Larson Modified comment(s), improved */ /* stack check error handling, */ /* resulting in version 6.1.9 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -178,14 +181,14 @@ UINT _tx_thread_secure_stack_free(struct TX_THREAD_STRUCT *tx_thread); For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_MISRA_ENABLE #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #else ULONG _tx_misra_time_stamp_get(VOID); @@ -414,7 +417,7 @@ static void _tx_thread_system_return_inline(void) __istate_t interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (__get_IPSR() == 0) { interrupt_save = __get_interrupt_state(); @@ -430,7 +433,7 @@ __istate_t interrupt_save; #ifdef TX_THREAD_INIT CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M23/IAR Version 6.1.9 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M23/IAR Version 6.1.11 *"; #else #ifdef TX_MISRA_ENABLE extern CHAR _tx_version_id[100]; diff --git a/ports/cortex_m3/ac5/inc/tx_port.h b/ports/cortex_m3/ac5/inc/tx_port.h index 6e75da84..e29c80c8 100644 --- a/ports/cortex_m3/ac5/inc/tx_port.h +++ b/ports/cortex_m3/ac5/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M3/AC5 */ -/* 6.1.10 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -56,6 +56,9 @@ /* violation, */ /* fixed predefined macro, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -154,14 +157,14 @@ typedef unsigned short USHORT; For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_MISRA_ENABLE #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #else ULONG _tx_misra_time_stamp_get(VOID); @@ -378,7 +381,7 @@ void _tx_vfp_access(void); else \ { \ ULONG _tx_fpccr; \ - _tx_fpccr = *((ULONG *) 0xE000EF34); \ + _tx_fpccr = *((volatile ULONG *) 0xE000EF34); \ _tx_fpccr = _tx_fpccr & ((ULONG) 0x01); \ if (_tx_fpccr == ((ULONG) 0x01)) \ { \ @@ -582,7 +585,7 @@ __attribute__( ( always_inline ) ) static inline void _tx_thread_system_return_i unsigned int interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (__get_ipsr_value() == 0) { interrupt_save = __get_interrupt_posture(); @@ -651,7 +654,7 @@ static void _tx_thread_system_return_inline(void) unsigned int interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (_ipsr == 0) { #ifdef TX_PORT_USE_BASEPRI @@ -704,7 +707,7 @@ void tx_thread_fpu_disable(void); #ifdef TX_THREAD_INIT CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M3/AC5 Version 6.1.9 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M3/AC5 Version 6.1.11 *"; #else #ifdef TX_MISRA_ENABLE extern CHAR _tx_version_id[100]; diff --git a/ports/cortex_m3/ac5/src/tx_thread_schedule.s b/ports/cortex_m3/ac5/src/tx_thread_schedule.s index f2b1d103..7646d41d 100644 --- a/ports/cortex_m3/ac5/src/tx_thread_schedule.s +++ b/ports/cortex_m3/ac5/src/tx_thread_schedule.s @@ -37,7 +37,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_schedule Cortex-M3/AC5 */ -/* 6.1.7 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* Scott Larson, Microsoft Corporation */ @@ -64,13 +64,14 @@ /* */ /* _tx_initialize_kernel_enter ThreadX entry function */ /* _tx_thread_system_return Return to system from thread */ -/* _tx_thread_context_restore Restore thread's context */ /* */ /* RELEASE HISTORY */ /* */ /* DATE NAME DESCRIPTION */ /* */ /* 06-02-2021 Scott Larson Initial Version 6.1.7 */ +/* 04-25-2022 Scott Larson Added BASEPRI support, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_schedule(VOID) @@ -126,12 +127,22 @@ __tx_ts_handler #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) /* Call the thread exit function to indicate the thread is no longer executing. */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ PUSH {r0, lr} // Save LR (and r0 just for alignment) BL _tx_execution_thread_exit // Call the thread exit function POP {r0, lr} // Recover LR +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts -#endif +#endif /* TX_PORT_USE_BASEPRI */ +#endif /* EXECUTION PROFILE */ LDR r0, =_tx_thread_current_ptr // Build current thread pointer address LDR r2, =_tx_thread_execute_ptr // Build execute thread pointer address @@ -176,14 +187,24 @@ __tx_ts_new /* Now we are looking for a new thread to execute! */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Is there another thread ready to execute? CBZ r1, __tx_ts_wait // No, skip to the wait processing /* Yes, another thread is ready for else, make the current thread the new thread. */ STR r1, [r0] // Setup the current thread pointer to the new thread +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif /* Increment the thread run count. */ @@ -227,7 +248,12 @@ _skip_vfp_restore are disabled to allow use of WFI for waiting for a thread to arrive. */ __tx_ts_wait +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Pickup the next thread to execute pointer STR r1, [r0] // Store it in the current pointer CBNZ r1, __tx_ts_ready // If non-NULL, a new thread is ready! @@ -250,7 +276,12 @@ __tx_ts_wait POP {r0-r3} #endif +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_wait // Loop to continue waiting /* At this point, we have a new thread ready to go. Clear any newly pended PendSV - since we are @@ -262,8 +293,12 @@ __tx_ts_ready STR r7, [r8, #0xD04] // Clear any PendSV /* Re-enable interrupts and restore new thread. */ - +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_restore // Restore the thread // } diff --git a/ports/cortex_m3/ac6/inc/tx_port.h b/ports/cortex_m3/ac6/inc/tx_port.h index eb4cb176..eedf0164 100644 --- a/ports/cortex_m3/ac6/inc/tx_port.h +++ b/ports/cortex_m3/ac6/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M3/AC6 */ -/* 6.1.10 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -56,6 +56,9 @@ /* violation, */ /* fixed predefined macro, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -154,14 +157,14 @@ typedef unsigned short USHORT; For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_MISRA_ENABLE #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #else ULONG _tx_misra_time_stamp_get(VOID); @@ -378,7 +381,7 @@ void _tx_vfp_access(void); else \ { \ ULONG _tx_fpccr; \ - _tx_fpccr = *((ULONG *) 0xE000EF34); \ + _tx_fpccr = *((volatile ULONG *) 0xE000EF34); \ _tx_fpccr = _tx_fpccr & ((ULONG) 0x01); \ if (_tx_fpccr == ((ULONG) 0x01)) \ { \ @@ -582,7 +585,7 @@ __attribute__( ( always_inline ) ) static inline void _tx_thread_system_return_i unsigned int interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (__get_ipsr_value() == 0) { interrupt_save = __get_interrupt_posture(); @@ -651,7 +654,7 @@ static void _tx_thread_system_return_inline(void) unsigned int interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (_ipsr == 0) { #ifdef TX_PORT_USE_BASEPRI @@ -704,7 +707,7 @@ void tx_thread_fpu_disable(void); #ifdef TX_THREAD_INIT CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M3/AC6 Version 6.1.9 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M3/AC6 Version 6.1.11 *"; #else #ifdef TX_MISRA_ENABLE extern CHAR _tx_version_id[100]; diff --git a/ports/cortex_m3/ac6/src/tx_misra.S b/ports/cortex_m3/ac6/src/tx_misra.S new file mode 100644 index 00000000..b03fdcd0 --- /dev/null +++ b/ports/cortex_m3/ac6/src/tx_misra.S @@ -0,0 +1,1033 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** ThreadX MISRA Compliance */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + #define SHT_PROGBITS 0x1 + + .global __aeabi_memset + .global _tx_thread_current_ptr + .global _tx_thread_interrupt_disable + .global _tx_thread_interrupt_restore + .global _tx_thread_stack_analyze + .global _tx_thread_stack_error_handler + .global _tx_thread_system_state +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_trace_buffer_current_ptr + .global _tx_trace_buffer_end_ptr + .global _tx_trace_buffer_start_ptr + .global _tx_trace_event_enable_bits + .global _tx_trace_full_notify_function + .global _tx_trace_header_ptr +#endif + + .global _tx_misra_always_true + .global _tx_misra_block_pool_to_uchar_pointer_convert + .global _tx_misra_byte_pool_to_uchar_pointer_convert + .global _tx_misra_char_to_uchar_pointer_convert + .global _tx_misra_const_char_to_char_pointer_convert +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_misra_entry_to_uchar_pointer_convert +#endif + .global _tx_misra_indirect_void_to_uchar_pointer_convert + .global _tx_misra_memset + .global _tx_misra_message_copy +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_misra_object_to_uchar_pointer_convert +#endif + .global _tx_misra_pointer_to_ulong_convert + .global _tx_misra_status_get + .global _tx_misra_thread_stack_check +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_misra_time_stamp_get +#endif + .global _tx_misra_timer_indirect_to_void_pointer_convert + .global _tx_misra_timer_pointer_add + .global _tx_misra_timer_pointer_dif +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_misra_trace_event_insert +#endif + .global _tx_misra_uchar_pointer_add + .global _tx_misra_uchar_pointer_dif + .global _tx_misra_uchar_pointer_sub + .global _tx_misra_uchar_to_align_type_pointer_convert + .global _tx_misra_uchar_to_block_pool_pointer_convert +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_misra_uchar_to_entry_pointer_convert + .global _tx_misra_uchar_to_header_pointer_convert +#endif + .global _tx_misra_uchar_to_indirect_byte_pool_pointer_convert + .global _tx_misra_uchar_to_indirect_uchar_pointer_convert +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_misra_uchar_to_object_pointer_convert +#endif + .global _tx_misra_uchar_to_void_pointer_convert + .global _tx_misra_ulong_pointer_add + .global _tx_misra_ulong_pointer_dif + .global _tx_misra_ulong_pointer_sub + .global _tx_misra_ulong_to_pointer_convert + .global _tx_misra_ulong_to_thread_pointer_convert + .global _tx_misra_user_timer_pointer_get + .global _tx_misra_void_to_block_pool_pointer_convert + .global _tx_misra_void_to_byte_pool_pointer_convert + .global _tx_misra_void_to_event_flags_pointer_convert + .global _tx_misra_void_to_indirect_uchar_pointer_convert + .global _tx_misra_void_to_mutex_pointer_convert + .global _tx_misra_void_to_queue_pointer_convert + .global _tx_misra_void_to_semaphore_pointer_convert + .global _tx_misra_void_to_thread_pointer_convert + .global _tx_misra_void_to_uchar_pointer_convert + .global _tx_misra_void_to_ulong_pointer_convert + .global _tx_misra_ipsr_get + .global _tx_misra_control_get + .global _tx_misra_control_set +#ifdef __ARM_FP + .global _tx_misra_fpccr_get + .global _tx_misra_vfp_touch +#endif + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID _tx_misra_memset(VOID *ptr, UINT value, UINT size); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .align 4 + .syntax unified + .thumb_func +_tx_misra_memset: + PUSH {R4,LR} + MOVS R4,R0 + MOVS R0,R2 + MOVS R2,R1 + MOVS R1,R0 + MOVS R0,R4 + BL __aeabi_memset + POP {R4,PC} // return + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** UCHAR *_tx_misra_uchar_pointer_add(UCHAR *ptr, ULONG amount); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_pointer_add: + ADD R0,R0,R1 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** UCHAR *_tx_misra_uchar_pointer_sub(UCHAR *ptr, ULONG amount); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_pointer_sub: + RSBS R1,R1,#+0 + ADD R0,R0,R1 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG _tx_misra_uchar_pointer_dif(UCHAR *ptr1, UCHAR *ptr2); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_pointer_dif: + SUBS R0,R0,R1 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG _tx_misra_pointer_to_ulong_convert(VOID *ptr); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_pointer_to_ulong_convert: + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG *_tx_misra_ulong_pointer_add(ULONG *ptr, ULONG amount); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_ulong_pointer_add: + ADD R0,R0,R1, LSL #+2 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG *_tx_misra_ulong_pointer_sub(ULONG *ptr, ULONG amount); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_ulong_pointer_sub: + MVNS R2,#+3 + MULS R1,R2,R1 + ADD R0,R0,R1 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG _tx_misra_ulong_pointer_dif(ULONG *ptr1, ULONG *ptr2); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_ulong_pointer_dif: + SUBS R0,R0,R1 + ASRS R0,R0,#+2 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID *_tx_misra_ulong_to_pointer_convert(ULONG input); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_ulong_to_pointer_convert: + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID _tx_misra_message_copy(ULONG **source, ULONG **destination, */ +/** UINT size); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_message_copy: + PUSH {R4,R5} + LDR R3,[R0, #+0] + LDR R4,[R1, #+0] + LDR R5,[R3, #+0] + STR R5,[R4, #+0] + ADDS R4,R4,#+4 + ADDS R3,R3,#+4 + CMP R2,#+2 + BCC.N _tx_misra_message_copy_0 + SUBS R2,R2,#+1 + B.N _tx_misra_message_copy_1 +_tx_misra_message_copy_2: + LDR R5,[R3, #+0] + STR R5,[R4, #+0] + ADDS R4,R4,#+4 + ADDS R3,R3,#+4 + SUBS R2,R2,#+1 +_tx_misra_message_copy_1: + CMP R2,#+0 + BNE.N _tx_misra_message_copy_2 +_tx_misra_message_copy_0: + STR R3,[R0, #+0] + STR R4,[R1, #+0] + POP {R4,R5} + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG _tx_misra_timer_pointer_dif(TX_TIMER_INTERNAL **ptr1, */ +/** TX_TIMER_INTERNAL **ptr2); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_timer_pointer_dif: + SUBS R0,R0,R1 + ASRS R0,R0,#+2 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** TX_TIMER_INTERNAL **_tx_misra_timer_pointer_add(TX_TIMER_INTERNAL */ +/** **ptr1, ULONG size); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_timer_pointer_add: + ADD R0,R0,R1, LSL #+2 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID _tx_misra_user_timer_pointer_get(TX_TIMER_INTERNAL */ +/** *internal_timer, TX_TIMER **user_timer); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_user_timer_pointer_get: + ADDS R2,R0,#+8 + SUBS R2,R2,R0 + RSBS R2,R2,#+0 + ADD R0,R0,R2 + STR R0,[R1, #+0] + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID _tx_misra_thread_stack_check(TX_THREAD *thread_ptr, */ +/** VOID **highest_stack); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_thread_stack_check: + PUSH {R3-R5,LR} + MOVS R4,R0 + MOVS R5,R1 + BL _tx_thread_interrupt_disable + CMP R4,#+0 + BEQ.N _tx_misra_thread_stack_check_0 + LDR R1,[R4, #+0] + LDR R2,=0x54485244 + CMP R1,R2 + BNE.N _tx_misra_thread_stack_check_0 + LDR R1,[R4, #+8] + LDR R2,[R5, #+0] + CMP R1,R2 + BCS.N _tx_misra_thread_stack_check_1 + LDR R1,[R4, #+8] + STR R1,[R5, #+0] +_tx_misra_thread_stack_check_1: + LDR R1,[R4, #+12] + LDR R1,[R1, #+0] + CMP R1,#-269488145 + BNE.N _tx_misra_thread_stack_check_2 + LDR R1,[R4, #+16] + LDR R1,[R1, #+1] + CMP R1,#-269488145 + BNE.N _tx_misra_thread_stack_check_2 + LDR R1,[R5, #+0] + LDR R2,[R4, #+12] + CMP R1,R2 + BCS.N _tx_misra_thread_stack_check_3 +_tx_misra_thread_stack_check_2: + BL _tx_thread_interrupt_restore + MOVS R0,R4 + BL _tx_thread_stack_error_handler + BL _tx_thread_interrupt_disable +_tx_misra_thread_stack_check_3: + LDR R1,[R5, #+0] + LDR R1,[R1, #-4] + CMP R1,#-269488145 + BEQ.N _tx_misra_thread_stack_check_0 + BL _tx_thread_interrupt_restore + MOVS R0,R4 + BL _tx_thread_stack_analyze + BL _tx_thread_interrupt_disable +_tx_misra_thread_stack_check_0: + BL _tx_thread_interrupt_restore + POP {R0,R4,R5,PC} // return + +#ifdef TX_ENABLE_EVENT_TRACE + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID _tx_misra_trace_event_insert(ULONG event_id, */ +/** VOID *info_field_1, ULONG info_field_2, ULONG info_field_3, */ +/** ULONG info_field_4, ULONG filter, ULONG time_stamp); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_trace_event_insert: + PUSH {R3-R7,LR} + LDR.N R4,DataTable2_1 + LDR R4,[R4, #+0] + CMP R4,#+0 + BEQ.N _tx_misra_trace_event_insert_0 + LDR.N R5,DataTable2_2 + LDR R5,[R5, #+0] + LDR R6,[SP, #+28] + TST R5,R6 + BEQ.N _tx_misra_trace_event_insert_0 + LDR.N R5,DataTable2_3 + LDR R5,[R5, #+0] + LDR.N R6,DataTable2_4 + LDR R6,[R6, #+0] + CMP R5,#+0 + BNE.N _tx_misra_trace_event_insert_1 + LDR R5,[R6, #+44] + LDR R7,[R6, #+60] + LSLS R7,R7,#+16 + ORRS R7,R7,#0x80000000 + ORRS R5,R7,R5 + B.N _tx_misra_trace_event_insert_2 +_tx_misra_trace_event_insert_1: + CMP R5,#-252645136 + BCS.N _tx_misra_trace_event_insert_3 + MOVS R5,R6 + MOVS R6,#-1 + B.N _tx_misra_trace_event_insert_2 +_tx_misra_trace_event_insert_3: + MOVS R6,#-252645136 + MOVS R5,#+0 +_tx_misra_trace_event_insert_2: + STR R6,[R4, #+0] + STR R5,[R4, #+4] + STR R0,[R4, #+8] + LDR R0,[SP, #+32] + STR R0,[R4, #+12] + STR R1,[R4, #+16] + STR R2,[R4, #+20] + STR R3,[R4, #+24] + LDR R0,[SP, #+24] + STR R0,[R4, #+28] + ADDS R4,R4,#+32 + LDR.N R0,DataTable2_5 + LDR R0,[R0, #+0] + CMP R4,R0 + BCC.N _tx_misra_trace_event_insert_4 + LDR.N R0,DataTable2_6 + LDR R4,[R0, #+0] + LDR.N R0,DataTable2_1 + STR R4,[R0, #+0] + LDR.N R0,DataTable2_7 + LDR R0,[R0, #+0] + STR R4,[R0, #+32] + LDR.N R0,DataTable2_8 + LDR R0,[R0, #+0] + CMP R0,#+0 + BEQ.N _tx_misra_trace_event_insert_0 + LDR.N R0,DataTable2_7 + LDR R0,[R0, #+0] + LDR.N R1,DataTable2_8 + LDR R1,[R1, #+0] + BLX R1 + B.N _tx_misra_trace_event_insert_0 +_tx_misra_trace_event_insert_4: + LDR.N R0,DataTable2_1 + STR R4,[R0, #+0] + LDR.N R0,DataTable2_7 + LDR R0,[R0, #+0] + STR R4,[R0, #+32] +_tx_misra_trace_event_insert_0: + POP {R0,R4-R7,PC} // return + + + .data +DataTable2_1: + .word _tx_trace_buffer_current_ptr + + .data +DataTable2_2: + .word _tx_trace_event_enable_bits + + .data +DataTable2_5: + .word _tx_trace_buffer_end_ptr + + .data +DataTable2_6: + .word _tx_trace_buffer_start_ptr + + .data +DataTable2_7: + .word _tx_trace_header_ptr + + .data +DataTable2_8: + .word _tx_trace_full_notify_function + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG _tx_misra_time_stamp_get(VOID); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_time_stamp_get: + MOVS R0,#+0 + BX LR // return + +#endif + + .data +DataTable2_3: + .word _tx_thread_system_state + + .data +DataTable2_4: + .word _tx_thread_current_ptr + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** UINT _tx_misra_always_true(void); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_always_true: + MOVS R0,#+1 + BX LR // return + + +/******************************************************************************************/ +/******************************************************************************************/ +/** */ +/** UCHAR **_tx_misra_indirect_void_to_uchar_pointer_convert(VOID **return_ptr); */ +/** */ +/******************************************************************************************/ +/******************************************************************************************/ + + .text + .thumb_func +_tx_misra_indirect_void_to_uchar_pointer_convert: + BX LR // return + + +/***************************************************************************************/ +/***************************************************************************************/ +/** */ +/** UCHAR **_tx_misra_uchar_to_indirect_uchar_pointer_convert(UCHAR *pointer); */ +/** */ +/***************************************************************************************/ +/***************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_indirect_uchar_pointer_convert: + BX LR // return + + +/***********************************************************************************/ +/***********************************************************************************/ +/** */ +/** UCHAR *_tx_misra_block_pool_to_uchar_pointer_convert(TX_BLOCK_POOL *pool); */ +/** */ +/***********************************************************************************/ +/***********************************************************************************/ + + .text + .thumb_func +_tx_misra_block_pool_to_uchar_pointer_convert: + BX LR // return + + +/******************************************************************************************/ +/******************************************************************************************/ +/** */ +/** TX_BLOCK_POOL *_tx_misra_void_to_block_pool_pointer_convert(VOID *pointer); */ +/** */ +/******************************************************************************************/ +/******************************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_block_pool_pointer_convert: + BX LR // return + + +/*****************************************************************************/ +/*****************************************************************************/ +/** */ +/** UCHAR *_tx_misra_void_to_uchar_pointer_convert(VOID *pointer); */ +/** */ +/*****************************************************************************/ +/*****************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_uchar_pointer_convert: + BX LR // return + + +/************************************************************************************/ +/************************************************************************************/ +/** */ +/** TX_BLOCK_POOL *_tx_misra_uchar_to_block_pool_pointer_convert(UCHAR *pointer); */ +/** */ +/************************************************************************************/ +/************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_block_pool_pointer_convert: + BX LR // return + + +/**************************************************************************************/ +/**************************************************************************************/ +/** */ +/** UCHAR **_tx_misra_void_to_indirect_uchar_pointer_convert(VOID *pointer); */ +/** */ +/**************************************************************************************/ +/**************************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_indirect_uchar_pointer_convert: + BX LR // return + + +/*****************************************************************************************/ +/*****************************************************************************************/ +/** */ +/** TX_BYTE_POOL *_tx_misra_void_to_byte_pool_pointer_convert(VOID *pointer); */ +/** */ +/*****************************************************************************************/ +/*****************************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_byte_pool_pointer_convert: + BX LR // return + + +/***************************************************************************************/ +/***************************************************************************************/ +/** */ +/** UCHAR *_tx_misra_byte_pool_to_uchar_pointer_convert(TX_BYTE_POOL *pool); */ +/** */ +/***************************************************************************************/ +/***************************************************************************************/ + + .text + .thumb_func +_tx_misra_byte_pool_to_uchar_pointer_convert: + BX LR // return + + +/*****************************************************************************************/ +/*****************************************************************************************/ +/** */ +/** ALIGN_TYPE *_tx_misra_uchar_to_align_type_pointer_convert(UCHAR *pointer); */ +/** */ +/*****************************************************************************************/ +/*****************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_align_type_pointer_convert: + BX LR // return + + +/****************************************************************************************************/ +/****************************************************************************************************/ +/** */ +/** TX_BYTE_POOL **_tx_misra_uchar_to_indirect_byte_pool_pointer_convert(UCHAR *pointer); */ +/** */ +/****************************************************************************************************/ +/****************************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_indirect_byte_pool_pointer_convert: + BX LR // return + + +/**************************************************************************************************/ +/**************************************************************************************************/ +/** */ +/** TX_EVENT_FLAGS_GROUP *_tx_misra_void_to_event_flags_pointer_convert(VOID *pointer); */ +/** */ +/**************************************************************************************************/ +/**************************************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_event_flags_pointer_convert: + BX LR // return + + +/*****************************************************************************/ +/*****************************************************************************/ +/** */ +/** ULONG *_tx_misra_void_to_ulong_pointer_convert(VOID *pointer); */ +/** */ +/*****************************************************************************/ +/*****************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_ulong_pointer_convert: + BX LR // return + + +/********************************************************************************/ +/********************************************************************************/ +/** */ +/** TX_MUTEX *_tx_misra_void_to_mutex_pointer_convert(VOID *pointer); */ +/** */ +/********************************************************************************/ +/********************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_mutex_pointer_convert: + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** UINT _tx_misra_status_get(UINT status); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_status_get: + MOVS R0,#+0 + BX LR // return + + +/********************************************************************************/ +/********************************************************************************/ +/** */ +/** TX_QUEUE *_tx_misra_void_to_queue_pointer_convert(VOID *pointer); */ +/** */ +/********************************************************************************/ +/********************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_queue_pointer_convert: + BX LR // return + + +/****************************************************************************************/ +/****************************************************************************************/ +/** */ +/** TX_SEMAPHORE *_tx_misra_void_to_semaphore_pointer_convert(VOID *pointer); */ +/** */ +/****************************************************************************************/ +/****************************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_semaphore_pointer_convert: + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID *_tx_misra_uchar_to_void_pointer_convert(UCHAR *pointer); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_void_pointer_convert: + BX LR // return + + +/*********************************************************************************/ +/*********************************************************************************/ +/** */ +/** TX_THREAD *_tx_misra_ulong_to_thread_pointer_convert(ULONG value); */ +/** */ +/*********************************************************************************/ +/*********************************************************************************/ + + .text + .thumb_func +_tx_misra_ulong_to_thread_pointer_convert: + BX LR // return + + +/***************************************************************************************************/ +/***************************************************************************************************/ +/** */ +/** VOID *_tx_misra_timer_indirect_to_void_pointer_convert(TX_TIMER_INTERNAL **pointer); */ +/** */ +/***************************************************************************************************/ +/***************************************************************************************************/ + + .text + .thumb_func +_tx_misra_timer_indirect_to_void_pointer_convert: + BX LR // return + + +/***************************************************************************************/ +/***************************************************************************************/ +/** */ +/** CHAR *_tx_misra_const_char_to_char_pointer_convert(const char *pointer); */ +/** */ +/***************************************************************************************/ +/***************************************************************************************/ + + .text + .thumb_func +_tx_misra_const_char_to_char_pointer_convert: + BX LR // return + + +/**********************************************************************************/ +/**********************************************************************************/ +/** */ +/** TX_THREAD *_tx_misra_void_to_thread_pointer_convert(void *pointer); */ +/** */ +/**********************************************************************************/ +/**********************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_thread_pointer_convert: + BX LR // return + + +#ifdef TX_ENABLE_EVENT_TRACE + +/************************************************************************************************/ +/************************************************************************************************/ +/** */ +/** UCHAR *_tx_misra_object_to_uchar_pointer_convert(TX_TRACE_OBJECT_ENTRY *pointer); */ +/** */ +/************************************************************************************************/ +/************************************************************************************************/ + + .text + .thumb_func +_tx_misra_object_to_uchar_pointer_convert: + BX LR // return + + +/************************************************************************************************/ +/************************************************************************************************/ +/** */ +/** TX_TRACE_OBJECT_ENTRY *_tx_misra_uchar_to_object_pointer_convert(UCHAR *pointer); */ +/** */ +/************************************************************************************************/ +/************************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_object_pointer_convert: + BX LR // return + + +/******************************************************************************************/ +/******************************************************************************************/ +/** */ +/** TX_TRACE_HEADER *_tx_misra_uchar_to_header_pointer_convert(UCHAR *pointer); */ +/** */ +/******************************************************************************************/ +/******************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_header_pointer_convert: + BX LR // return + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** TX_TRACE_BUFFER_ENTRY *_tx_misra_uchar_to_entry_pointer_convert(UCHAR *pointer); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_entry_pointer_convert: + BX LR // return + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** UCHAR *_tx_misra_entry_to_uchar_pointer_convert(TX_TRACE_BUFFER_ENTRY *pointer); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_entry_to_uchar_pointer_convert: + BX LR // return +#endif + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** UCHAR *_tx_misra_char_to_uchar_pointer_convert(CHAR *pointer); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_char_to_uchar_pointer_convert: + BX LR // return + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** ULONG _tx_misra_ipsr_get(void); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_ipsr_get: + MRS R0, IPSR + BX LR // return + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** ULONG _tx_misra_control_get(void); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_control_get: + MRS R0, CONTROL + BX LR // return + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** void _tx_misra_control_set(ULONG value); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_control_set: + MSR CONTROL, R0 + BX LR // return + + +#ifdef __ARM_FP + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** ULONG _tx_misra_fpccr_get(void); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_fpccr_get: + LDR r0, =0xE000EF34 // Build FPCCR address + LDR r0, [r0] // Load FPCCR value + BX LR // return + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** void _tx_misra_vfp_touch(void); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_vfp_touch: + vmov.f32 s0, s0 + BX LR // return + +#endif + + + .data + .word 0 diff --git a/ports/cortex_m3/ac6/src/tx_thread_schedule.S b/ports/cortex_m3/ac6/src/tx_thread_schedule.S index 7f43ef4e..2dd3922d 100644 --- a/ports/cortex_m3/ac6/src/tx_thread_schedule.S +++ b/ports/cortex_m3/ac6/src/tx_thread_schedule.S @@ -39,7 +39,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_schedule Cortex-M3/AC6 */ -/* 6.1.7 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* Scott Larson, Microsoft Corporation */ @@ -66,13 +66,14 @@ /* */ /* _tx_initialize_kernel_enter ThreadX entry function */ /* _tx_thread_system_return Return to system from thread */ -/* _tx_thread_context_restore Restore thread's context */ /* */ /* RELEASE HISTORY */ /* */ /* DATE NAME DESCRIPTION */ /* */ /* 06-02-2021 Scott Larson Initial Version 6.1.7 */ +/* 04-25-2022 Scott Larson Added BASEPRI support, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_schedule(VOID) @@ -132,12 +133,22 @@ __tx_ts_handler: #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) /* Call the thread exit function to indicate the thread is no longer executing. */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ PUSH {r0, lr} // Save LR (and r0 just for alignment) BL _tx_execution_thread_exit // Call the thread exit function POP {r0, lr} // Recover LR +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts -#endif +#endif /* TX_PORT_USE_BASEPRI */ +#endif /* EXECUTION PROFILE */ LDR r0, =_tx_thread_current_ptr // Build current thread pointer address LDR r2, =_tx_thread_execute_ptr // Build execute thread pointer address @@ -182,14 +193,24 @@ __tx_ts_new: /* Now we are looking for a new thread to execute! */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Is there another thread ready to execute? CBZ r1, __tx_ts_wait // No, skip to the wait processing /* Yes, another thread is ready for else, make the current thread the new thread. */ STR r1, [r0] // Setup the current thread pointer to the new thread +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif /* Increment the thread run count. */ @@ -233,7 +254,12 @@ _skip_vfp_restore: are disabled to allow use of WFI for waiting for a thread to arrive. */ __tx_ts_wait: +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Pickup the next thread to execute pointer STR r1, [r0] // Store it in the current pointer CBNZ r1, __tx_ts_ready // If non-NULL, a new thread is ready! @@ -256,7 +282,12 @@ __tx_ts_wait: POP {r0-r3} #endif +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_wait // Loop to continue waiting /* At this point, we have a new thread ready to go. Clear any newly pended PendSV - since we are @@ -268,8 +299,12 @@ __tx_ts_ready: STR r7, [r8, #0xD04] // Clear any PendSV /* Re-enable interrupts and restore new thread. */ - +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_restore // Restore the thread // } diff --git a/ports/cortex_m3/gnu/inc/tx_port.h b/ports/cortex_m3/gnu/inc/tx_port.h index af6bade2..54a16b80 100644 --- a/ports/cortex_m3/gnu/inc/tx_port.h +++ b/ports/cortex_m3/gnu/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M3/GNU */ -/* 6.1.10 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -56,6 +56,9 @@ /* violation, */ /* fixed predefined macro, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -154,14 +157,14 @@ typedef unsigned short USHORT; For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_MISRA_ENABLE #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #else ULONG _tx_misra_time_stamp_get(VOID); @@ -378,7 +381,7 @@ void _tx_vfp_access(void); else \ { \ ULONG _tx_fpccr; \ - _tx_fpccr = *((ULONG *) 0xE000EF34); \ + _tx_fpccr = *((volatile ULONG *) 0xE000EF34); \ _tx_fpccr = _tx_fpccr & ((ULONG) 0x01); \ if (_tx_fpccr == ((ULONG) 0x01)) \ { \ @@ -582,7 +585,7 @@ __attribute__( ( always_inline ) ) static inline void _tx_thread_system_return_i unsigned int interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (__get_ipsr_value() == 0) { interrupt_save = __get_interrupt_posture(); @@ -651,7 +654,7 @@ static void _tx_thread_system_return_inline(void) unsigned int interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (_ipsr == 0) { #ifdef TX_PORT_USE_BASEPRI @@ -704,7 +707,7 @@ void tx_thread_fpu_disable(void); #ifdef TX_THREAD_INIT CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M3/GNU Version 6.1.9 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M3/GNU Version 6.1.11 *"; #else #ifdef TX_MISRA_ENABLE extern CHAR _tx_version_id[100]; diff --git a/ports/cortex_m3/gnu/src/tx_misra.S b/ports/cortex_m3/gnu/src/tx_misra.S new file mode 100644 index 00000000..b03fdcd0 --- /dev/null +++ b/ports/cortex_m3/gnu/src/tx_misra.S @@ -0,0 +1,1033 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** ThreadX MISRA Compliance */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + #define SHT_PROGBITS 0x1 + + .global __aeabi_memset + .global _tx_thread_current_ptr + .global _tx_thread_interrupt_disable + .global _tx_thread_interrupt_restore + .global _tx_thread_stack_analyze + .global _tx_thread_stack_error_handler + .global _tx_thread_system_state +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_trace_buffer_current_ptr + .global _tx_trace_buffer_end_ptr + .global _tx_trace_buffer_start_ptr + .global _tx_trace_event_enable_bits + .global _tx_trace_full_notify_function + .global _tx_trace_header_ptr +#endif + + .global _tx_misra_always_true + .global _tx_misra_block_pool_to_uchar_pointer_convert + .global _tx_misra_byte_pool_to_uchar_pointer_convert + .global _tx_misra_char_to_uchar_pointer_convert + .global _tx_misra_const_char_to_char_pointer_convert +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_misra_entry_to_uchar_pointer_convert +#endif + .global _tx_misra_indirect_void_to_uchar_pointer_convert + .global _tx_misra_memset + .global _tx_misra_message_copy +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_misra_object_to_uchar_pointer_convert +#endif + .global _tx_misra_pointer_to_ulong_convert + .global _tx_misra_status_get + .global _tx_misra_thread_stack_check +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_misra_time_stamp_get +#endif + .global _tx_misra_timer_indirect_to_void_pointer_convert + .global _tx_misra_timer_pointer_add + .global _tx_misra_timer_pointer_dif +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_misra_trace_event_insert +#endif + .global _tx_misra_uchar_pointer_add + .global _tx_misra_uchar_pointer_dif + .global _tx_misra_uchar_pointer_sub + .global _tx_misra_uchar_to_align_type_pointer_convert + .global _tx_misra_uchar_to_block_pool_pointer_convert +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_misra_uchar_to_entry_pointer_convert + .global _tx_misra_uchar_to_header_pointer_convert +#endif + .global _tx_misra_uchar_to_indirect_byte_pool_pointer_convert + .global _tx_misra_uchar_to_indirect_uchar_pointer_convert +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_misra_uchar_to_object_pointer_convert +#endif + .global _tx_misra_uchar_to_void_pointer_convert + .global _tx_misra_ulong_pointer_add + .global _tx_misra_ulong_pointer_dif + .global _tx_misra_ulong_pointer_sub + .global _tx_misra_ulong_to_pointer_convert + .global _tx_misra_ulong_to_thread_pointer_convert + .global _tx_misra_user_timer_pointer_get + .global _tx_misra_void_to_block_pool_pointer_convert + .global _tx_misra_void_to_byte_pool_pointer_convert + .global _tx_misra_void_to_event_flags_pointer_convert + .global _tx_misra_void_to_indirect_uchar_pointer_convert + .global _tx_misra_void_to_mutex_pointer_convert + .global _tx_misra_void_to_queue_pointer_convert + .global _tx_misra_void_to_semaphore_pointer_convert + .global _tx_misra_void_to_thread_pointer_convert + .global _tx_misra_void_to_uchar_pointer_convert + .global _tx_misra_void_to_ulong_pointer_convert + .global _tx_misra_ipsr_get + .global _tx_misra_control_get + .global _tx_misra_control_set +#ifdef __ARM_FP + .global _tx_misra_fpccr_get + .global _tx_misra_vfp_touch +#endif + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID _tx_misra_memset(VOID *ptr, UINT value, UINT size); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .align 4 + .syntax unified + .thumb_func +_tx_misra_memset: + PUSH {R4,LR} + MOVS R4,R0 + MOVS R0,R2 + MOVS R2,R1 + MOVS R1,R0 + MOVS R0,R4 + BL __aeabi_memset + POP {R4,PC} // return + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** UCHAR *_tx_misra_uchar_pointer_add(UCHAR *ptr, ULONG amount); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_pointer_add: + ADD R0,R0,R1 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** UCHAR *_tx_misra_uchar_pointer_sub(UCHAR *ptr, ULONG amount); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_pointer_sub: + RSBS R1,R1,#+0 + ADD R0,R0,R1 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG _tx_misra_uchar_pointer_dif(UCHAR *ptr1, UCHAR *ptr2); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_pointer_dif: + SUBS R0,R0,R1 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG _tx_misra_pointer_to_ulong_convert(VOID *ptr); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_pointer_to_ulong_convert: + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG *_tx_misra_ulong_pointer_add(ULONG *ptr, ULONG amount); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_ulong_pointer_add: + ADD R0,R0,R1, LSL #+2 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG *_tx_misra_ulong_pointer_sub(ULONG *ptr, ULONG amount); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_ulong_pointer_sub: + MVNS R2,#+3 + MULS R1,R2,R1 + ADD R0,R0,R1 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG _tx_misra_ulong_pointer_dif(ULONG *ptr1, ULONG *ptr2); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_ulong_pointer_dif: + SUBS R0,R0,R1 + ASRS R0,R0,#+2 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID *_tx_misra_ulong_to_pointer_convert(ULONG input); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_ulong_to_pointer_convert: + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID _tx_misra_message_copy(ULONG **source, ULONG **destination, */ +/** UINT size); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_message_copy: + PUSH {R4,R5} + LDR R3,[R0, #+0] + LDR R4,[R1, #+0] + LDR R5,[R3, #+0] + STR R5,[R4, #+0] + ADDS R4,R4,#+4 + ADDS R3,R3,#+4 + CMP R2,#+2 + BCC.N _tx_misra_message_copy_0 + SUBS R2,R2,#+1 + B.N _tx_misra_message_copy_1 +_tx_misra_message_copy_2: + LDR R5,[R3, #+0] + STR R5,[R4, #+0] + ADDS R4,R4,#+4 + ADDS R3,R3,#+4 + SUBS R2,R2,#+1 +_tx_misra_message_copy_1: + CMP R2,#+0 + BNE.N _tx_misra_message_copy_2 +_tx_misra_message_copy_0: + STR R3,[R0, #+0] + STR R4,[R1, #+0] + POP {R4,R5} + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG _tx_misra_timer_pointer_dif(TX_TIMER_INTERNAL **ptr1, */ +/** TX_TIMER_INTERNAL **ptr2); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_timer_pointer_dif: + SUBS R0,R0,R1 + ASRS R0,R0,#+2 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** TX_TIMER_INTERNAL **_tx_misra_timer_pointer_add(TX_TIMER_INTERNAL */ +/** **ptr1, ULONG size); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_timer_pointer_add: + ADD R0,R0,R1, LSL #+2 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID _tx_misra_user_timer_pointer_get(TX_TIMER_INTERNAL */ +/** *internal_timer, TX_TIMER **user_timer); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_user_timer_pointer_get: + ADDS R2,R0,#+8 + SUBS R2,R2,R0 + RSBS R2,R2,#+0 + ADD R0,R0,R2 + STR R0,[R1, #+0] + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID _tx_misra_thread_stack_check(TX_THREAD *thread_ptr, */ +/** VOID **highest_stack); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_thread_stack_check: + PUSH {R3-R5,LR} + MOVS R4,R0 + MOVS R5,R1 + BL _tx_thread_interrupt_disable + CMP R4,#+0 + BEQ.N _tx_misra_thread_stack_check_0 + LDR R1,[R4, #+0] + LDR R2,=0x54485244 + CMP R1,R2 + BNE.N _tx_misra_thread_stack_check_0 + LDR R1,[R4, #+8] + LDR R2,[R5, #+0] + CMP R1,R2 + BCS.N _tx_misra_thread_stack_check_1 + LDR R1,[R4, #+8] + STR R1,[R5, #+0] +_tx_misra_thread_stack_check_1: + LDR R1,[R4, #+12] + LDR R1,[R1, #+0] + CMP R1,#-269488145 + BNE.N _tx_misra_thread_stack_check_2 + LDR R1,[R4, #+16] + LDR R1,[R1, #+1] + CMP R1,#-269488145 + BNE.N _tx_misra_thread_stack_check_2 + LDR R1,[R5, #+0] + LDR R2,[R4, #+12] + CMP R1,R2 + BCS.N _tx_misra_thread_stack_check_3 +_tx_misra_thread_stack_check_2: + BL _tx_thread_interrupt_restore + MOVS R0,R4 + BL _tx_thread_stack_error_handler + BL _tx_thread_interrupt_disable +_tx_misra_thread_stack_check_3: + LDR R1,[R5, #+0] + LDR R1,[R1, #-4] + CMP R1,#-269488145 + BEQ.N _tx_misra_thread_stack_check_0 + BL _tx_thread_interrupt_restore + MOVS R0,R4 + BL _tx_thread_stack_analyze + BL _tx_thread_interrupt_disable +_tx_misra_thread_stack_check_0: + BL _tx_thread_interrupt_restore + POP {R0,R4,R5,PC} // return + +#ifdef TX_ENABLE_EVENT_TRACE + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID _tx_misra_trace_event_insert(ULONG event_id, */ +/** VOID *info_field_1, ULONG info_field_2, ULONG info_field_3, */ +/** ULONG info_field_4, ULONG filter, ULONG time_stamp); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_trace_event_insert: + PUSH {R3-R7,LR} + LDR.N R4,DataTable2_1 + LDR R4,[R4, #+0] + CMP R4,#+0 + BEQ.N _tx_misra_trace_event_insert_0 + LDR.N R5,DataTable2_2 + LDR R5,[R5, #+0] + LDR R6,[SP, #+28] + TST R5,R6 + BEQ.N _tx_misra_trace_event_insert_0 + LDR.N R5,DataTable2_3 + LDR R5,[R5, #+0] + LDR.N R6,DataTable2_4 + LDR R6,[R6, #+0] + CMP R5,#+0 + BNE.N _tx_misra_trace_event_insert_1 + LDR R5,[R6, #+44] + LDR R7,[R6, #+60] + LSLS R7,R7,#+16 + ORRS R7,R7,#0x80000000 + ORRS R5,R7,R5 + B.N _tx_misra_trace_event_insert_2 +_tx_misra_trace_event_insert_1: + CMP R5,#-252645136 + BCS.N _tx_misra_trace_event_insert_3 + MOVS R5,R6 + MOVS R6,#-1 + B.N _tx_misra_trace_event_insert_2 +_tx_misra_trace_event_insert_3: + MOVS R6,#-252645136 + MOVS R5,#+0 +_tx_misra_trace_event_insert_2: + STR R6,[R4, #+0] + STR R5,[R4, #+4] + STR R0,[R4, #+8] + LDR R0,[SP, #+32] + STR R0,[R4, #+12] + STR R1,[R4, #+16] + STR R2,[R4, #+20] + STR R3,[R4, #+24] + LDR R0,[SP, #+24] + STR R0,[R4, #+28] + ADDS R4,R4,#+32 + LDR.N R0,DataTable2_5 + LDR R0,[R0, #+0] + CMP R4,R0 + BCC.N _tx_misra_trace_event_insert_4 + LDR.N R0,DataTable2_6 + LDR R4,[R0, #+0] + LDR.N R0,DataTable2_1 + STR R4,[R0, #+0] + LDR.N R0,DataTable2_7 + LDR R0,[R0, #+0] + STR R4,[R0, #+32] + LDR.N R0,DataTable2_8 + LDR R0,[R0, #+0] + CMP R0,#+0 + BEQ.N _tx_misra_trace_event_insert_0 + LDR.N R0,DataTable2_7 + LDR R0,[R0, #+0] + LDR.N R1,DataTable2_8 + LDR R1,[R1, #+0] + BLX R1 + B.N _tx_misra_trace_event_insert_0 +_tx_misra_trace_event_insert_4: + LDR.N R0,DataTable2_1 + STR R4,[R0, #+0] + LDR.N R0,DataTable2_7 + LDR R0,[R0, #+0] + STR R4,[R0, #+32] +_tx_misra_trace_event_insert_0: + POP {R0,R4-R7,PC} // return + + + .data +DataTable2_1: + .word _tx_trace_buffer_current_ptr + + .data +DataTable2_2: + .word _tx_trace_event_enable_bits + + .data +DataTable2_5: + .word _tx_trace_buffer_end_ptr + + .data +DataTable2_6: + .word _tx_trace_buffer_start_ptr + + .data +DataTable2_7: + .word _tx_trace_header_ptr + + .data +DataTable2_8: + .word _tx_trace_full_notify_function + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG _tx_misra_time_stamp_get(VOID); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_time_stamp_get: + MOVS R0,#+0 + BX LR // return + +#endif + + .data +DataTable2_3: + .word _tx_thread_system_state + + .data +DataTable2_4: + .word _tx_thread_current_ptr + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** UINT _tx_misra_always_true(void); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_always_true: + MOVS R0,#+1 + BX LR // return + + +/******************************************************************************************/ +/******************************************************************************************/ +/** */ +/** UCHAR **_tx_misra_indirect_void_to_uchar_pointer_convert(VOID **return_ptr); */ +/** */ +/******************************************************************************************/ +/******************************************************************************************/ + + .text + .thumb_func +_tx_misra_indirect_void_to_uchar_pointer_convert: + BX LR // return + + +/***************************************************************************************/ +/***************************************************************************************/ +/** */ +/** UCHAR **_tx_misra_uchar_to_indirect_uchar_pointer_convert(UCHAR *pointer); */ +/** */ +/***************************************************************************************/ +/***************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_indirect_uchar_pointer_convert: + BX LR // return + + +/***********************************************************************************/ +/***********************************************************************************/ +/** */ +/** UCHAR *_tx_misra_block_pool_to_uchar_pointer_convert(TX_BLOCK_POOL *pool); */ +/** */ +/***********************************************************************************/ +/***********************************************************************************/ + + .text + .thumb_func +_tx_misra_block_pool_to_uchar_pointer_convert: + BX LR // return + + +/******************************************************************************************/ +/******************************************************************************************/ +/** */ +/** TX_BLOCK_POOL *_tx_misra_void_to_block_pool_pointer_convert(VOID *pointer); */ +/** */ +/******************************************************************************************/ +/******************************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_block_pool_pointer_convert: + BX LR // return + + +/*****************************************************************************/ +/*****************************************************************************/ +/** */ +/** UCHAR *_tx_misra_void_to_uchar_pointer_convert(VOID *pointer); */ +/** */ +/*****************************************************************************/ +/*****************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_uchar_pointer_convert: + BX LR // return + + +/************************************************************************************/ +/************************************************************************************/ +/** */ +/** TX_BLOCK_POOL *_tx_misra_uchar_to_block_pool_pointer_convert(UCHAR *pointer); */ +/** */ +/************************************************************************************/ +/************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_block_pool_pointer_convert: + BX LR // return + + +/**************************************************************************************/ +/**************************************************************************************/ +/** */ +/** UCHAR **_tx_misra_void_to_indirect_uchar_pointer_convert(VOID *pointer); */ +/** */ +/**************************************************************************************/ +/**************************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_indirect_uchar_pointer_convert: + BX LR // return + + +/*****************************************************************************************/ +/*****************************************************************************************/ +/** */ +/** TX_BYTE_POOL *_tx_misra_void_to_byte_pool_pointer_convert(VOID *pointer); */ +/** */ +/*****************************************************************************************/ +/*****************************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_byte_pool_pointer_convert: + BX LR // return + + +/***************************************************************************************/ +/***************************************************************************************/ +/** */ +/** UCHAR *_tx_misra_byte_pool_to_uchar_pointer_convert(TX_BYTE_POOL *pool); */ +/** */ +/***************************************************************************************/ +/***************************************************************************************/ + + .text + .thumb_func +_tx_misra_byte_pool_to_uchar_pointer_convert: + BX LR // return + + +/*****************************************************************************************/ +/*****************************************************************************************/ +/** */ +/** ALIGN_TYPE *_tx_misra_uchar_to_align_type_pointer_convert(UCHAR *pointer); */ +/** */ +/*****************************************************************************************/ +/*****************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_align_type_pointer_convert: + BX LR // return + + +/****************************************************************************************************/ +/****************************************************************************************************/ +/** */ +/** TX_BYTE_POOL **_tx_misra_uchar_to_indirect_byte_pool_pointer_convert(UCHAR *pointer); */ +/** */ +/****************************************************************************************************/ +/****************************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_indirect_byte_pool_pointer_convert: + BX LR // return + + +/**************************************************************************************************/ +/**************************************************************************************************/ +/** */ +/** TX_EVENT_FLAGS_GROUP *_tx_misra_void_to_event_flags_pointer_convert(VOID *pointer); */ +/** */ +/**************************************************************************************************/ +/**************************************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_event_flags_pointer_convert: + BX LR // return + + +/*****************************************************************************/ +/*****************************************************************************/ +/** */ +/** ULONG *_tx_misra_void_to_ulong_pointer_convert(VOID *pointer); */ +/** */ +/*****************************************************************************/ +/*****************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_ulong_pointer_convert: + BX LR // return + + +/********************************************************************************/ +/********************************************************************************/ +/** */ +/** TX_MUTEX *_tx_misra_void_to_mutex_pointer_convert(VOID *pointer); */ +/** */ +/********************************************************************************/ +/********************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_mutex_pointer_convert: + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** UINT _tx_misra_status_get(UINT status); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_status_get: + MOVS R0,#+0 + BX LR // return + + +/********************************************************************************/ +/********************************************************************************/ +/** */ +/** TX_QUEUE *_tx_misra_void_to_queue_pointer_convert(VOID *pointer); */ +/** */ +/********************************************************************************/ +/********************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_queue_pointer_convert: + BX LR // return + + +/****************************************************************************************/ +/****************************************************************************************/ +/** */ +/** TX_SEMAPHORE *_tx_misra_void_to_semaphore_pointer_convert(VOID *pointer); */ +/** */ +/****************************************************************************************/ +/****************************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_semaphore_pointer_convert: + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID *_tx_misra_uchar_to_void_pointer_convert(UCHAR *pointer); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_void_pointer_convert: + BX LR // return + + +/*********************************************************************************/ +/*********************************************************************************/ +/** */ +/** TX_THREAD *_tx_misra_ulong_to_thread_pointer_convert(ULONG value); */ +/** */ +/*********************************************************************************/ +/*********************************************************************************/ + + .text + .thumb_func +_tx_misra_ulong_to_thread_pointer_convert: + BX LR // return + + +/***************************************************************************************************/ +/***************************************************************************************************/ +/** */ +/** VOID *_tx_misra_timer_indirect_to_void_pointer_convert(TX_TIMER_INTERNAL **pointer); */ +/** */ +/***************************************************************************************************/ +/***************************************************************************************************/ + + .text + .thumb_func +_tx_misra_timer_indirect_to_void_pointer_convert: + BX LR // return + + +/***************************************************************************************/ +/***************************************************************************************/ +/** */ +/** CHAR *_tx_misra_const_char_to_char_pointer_convert(const char *pointer); */ +/** */ +/***************************************************************************************/ +/***************************************************************************************/ + + .text + .thumb_func +_tx_misra_const_char_to_char_pointer_convert: + BX LR // return + + +/**********************************************************************************/ +/**********************************************************************************/ +/** */ +/** TX_THREAD *_tx_misra_void_to_thread_pointer_convert(void *pointer); */ +/** */ +/**********************************************************************************/ +/**********************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_thread_pointer_convert: + BX LR // return + + +#ifdef TX_ENABLE_EVENT_TRACE + +/************************************************************************************************/ +/************************************************************************************************/ +/** */ +/** UCHAR *_tx_misra_object_to_uchar_pointer_convert(TX_TRACE_OBJECT_ENTRY *pointer); */ +/** */ +/************************************************************************************************/ +/************************************************************************************************/ + + .text + .thumb_func +_tx_misra_object_to_uchar_pointer_convert: + BX LR // return + + +/************************************************************************************************/ +/************************************************************************************************/ +/** */ +/** TX_TRACE_OBJECT_ENTRY *_tx_misra_uchar_to_object_pointer_convert(UCHAR *pointer); */ +/** */ +/************************************************************************************************/ +/************************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_object_pointer_convert: + BX LR // return + + +/******************************************************************************************/ +/******************************************************************************************/ +/** */ +/** TX_TRACE_HEADER *_tx_misra_uchar_to_header_pointer_convert(UCHAR *pointer); */ +/** */ +/******************************************************************************************/ +/******************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_header_pointer_convert: + BX LR // return + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** TX_TRACE_BUFFER_ENTRY *_tx_misra_uchar_to_entry_pointer_convert(UCHAR *pointer); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_entry_pointer_convert: + BX LR // return + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** UCHAR *_tx_misra_entry_to_uchar_pointer_convert(TX_TRACE_BUFFER_ENTRY *pointer); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_entry_to_uchar_pointer_convert: + BX LR // return +#endif + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** UCHAR *_tx_misra_char_to_uchar_pointer_convert(CHAR *pointer); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_char_to_uchar_pointer_convert: + BX LR // return + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** ULONG _tx_misra_ipsr_get(void); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_ipsr_get: + MRS R0, IPSR + BX LR // return + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** ULONG _tx_misra_control_get(void); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_control_get: + MRS R0, CONTROL + BX LR // return + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** void _tx_misra_control_set(ULONG value); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_control_set: + MSR CONTROL, R0 + BX LR // return + + +#ifdef __ARM_FP + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** ULONG _tx_misra_fpccr_get(void); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_fpccr_get: + LDR r0, =0xE000EF34 // Build FPCCR address + LDR r0, [r0] // Load FPCCR value + BX LR // return + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** void _tx_misra_vfp_touch(void); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_vfp_touch: + vmov.f32 s0, s0 + BX LR // return + +#endif + + + .data + .word 0 diff --git a/ports/cortex_m3/gnu/src/tx_thread_schedule.S b/ports/cortex_m3/gnu/src/tx_thread_schedule.S index e5b425fb..5c1f4767 100644 --- a/ports/cortex_m3/gnu/src/tx_thread_schedule.S +++ b/ports/cortex_m3/gnu/src/tx_thread_schedule.S @@ -37,7 +37,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_schedule Cortex-M3/GNU */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* Scott Larson, Microsoft Corporation */ @@ -72,6 +72,8 @@ /* 06-02-2021 Scott Larson Initial Version 6.1.7 */ /* 01-31-2022 Scott Larson Fixed predefined macro name, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 Scott Larson Added BASEPRI support, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_schedule(VOID) @@ -131,12 +133,22 @@ __tx_ts_handler: #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) /* Call the thread exit function to indicate the thread is no longer executing. */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ PUSH {r0, lr} // Save LR (and r0 just for alignment) BL _tx_execution_thread_exit // Call the thread exit function POP {r0, lr} // Recover LR +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts -#endif +#endif /* TX_PORT_USE_BASEPRI */ +#endif /* EXECUTION PROFILE */ LDR r0, =_tx_thread_current_ptr // Build current thread pointer address LDR r2, =_tx_thread_execute_ptr // Build execute thread pointer address @@ -181,14 +193,24 @@ __tx_ts_new: /* Now we are looking for a new thread to execute! */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Is there another thread ready to execute? CBZ r1, __tx_ts_wait // No, skip to the wait processing /* Yes, another thread is ready for else, make the current thread the new thread. */ STR r1, [r0] // Setup the current thread pointer to the new thread +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif /* Increment the thread run count. */ @@ -232,7 +254,12 @@ _skip_vfp_restore: are disabled to allow use of WFI for waiting for a thread to arrive. */ __tx_ts_wait: +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Pickup the next thread to execute pointer STR r1, [r0] // Store it in the current pointer CBNZ r1, __tx_ts_ready // If non-NULL, a new thread is ready! @@ -255,7 +282,12 @@ __tx_ts_wait: POP {r0-r3} #endif +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_wait // Loop to continue waiting /* At this point, we have a new thread ready to go. Clear any newly pended PendSV - since we are @@ -267,8 +299,12 @@ __tx_ts_ready: STR r7, [r8, #0xD04] // Clear any PendSV /* Re-enable interrupts and restore new thread. */ - +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_restore // Restore the thread // } diff --git a/ports/cortex_m3/iar/inc/tx_port.h b/ports/cortex_m3/iar/inc/tx_port.h index 33b8a2bb..77c52fba 100644 --- a/ports/cortex_m3/iar/inc/tx_port.h +++ b/ports/cortex_m3/iar/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M3/IAR */ -/* 6.1.10 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -56,6 +56,9 @@ /* violation, */ /* fixed predefined macro, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -154,14 +157,14 @@ typedef unsigned short USHORT; For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_MISRA_ENABLE #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #else ULONG _tx_misra_time_stamp_get(VOID); @@ -378,7 +381,7 @@ void _tx_vfp_access(void); else \ { \ ULONG _tx_fpccr; \ - _tx_fpccr = *((ULONG *) 0xE000EF34); \ + _tx_fpccr = *((volatile ULONG *) 0xE000EF34); \ _tx_fpccr = _tx_fpccr & ((ULONG) 0x01); \ if (_tx_fpccr == ((ULONG) 0x01)) \ { \ @@ -582,7 +585,7 @@ __attribute__( ( always_inline ) ) static inline void _tx_thread_system_return_i unsigned int interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (__get_ipsr_value() == 0) { interrupt_save = __get_interrupt_posture(); @@ -651,7 +654,7 @@ static void _tx_thread_system_return_inline(void) unsigned int interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (_ipsr == 0) { #ifdef TX_PORT_USE_BASEPRI @@ -704,7 +707,7 @@ void tx_thread_fpu_disable(void); #ifdef TX_THREAD_INIT CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M3/IAR Version 6.1.9 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M3/IAR Version 6.1.11 *"; #else #ifdef TX_MISRA_ENABLE extern CHAR _tx_version_id[100]; diff --git a/ports/cortex_m3/iar/src/tx_thread_schedule.s b/ports/cortex_m3/iar/src/tx_thread_schedule.s index 6584a90a..a40434c2 100644 --- a/ports/cortex_m3/iar/src/tx_thread_schedule.s +++ b/ports/cortex_m3/iar/src/tx_thread_schedule.s @@ -37,7 +37,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_schedule Cortex-M3/IAR */ -/* 6.1.7 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* Scott Larson, Microsoft Corporation */ @@ -64,13 +64,14 @@ /* */ /* _tx_initialize_kernel_enter ThreadX entry function */ /* _tx_thread_system_return Return to system from thread */ -/* _tx_thread_context_restore Restore thread's context */ /* */ /* RELEASE HISTORY */ /* */ /* DATE NAME DESCRIPTION */ /* */ /* 06-02-2021 Scott Larson Initial Version 6.1.7 */ +/* 04-25-2022 Scott Larson Added BASEPRI support, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_schedule(VOID) @@ -126,12 +127,22 @@ __tx_ts_handler: #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) /* Call the thread exit function to indicate the thread is no longer executing. */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ PUSH {r0, lr} // Save LR (and r0 just for alignment) BL _tx_execution_thread_exit // Call the thread exit function POP {r0, lr} // Recover LR +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts -#endif +#endif /* TX_PORT_USE_BASEPRI */ +#endif /* EXECUTION PROFILE */ LDR r0, =_tx_thread_current_ptr // Build current thread pointer address LDR r2, =_tx_thread_execute_ptr // Build execute thread pointer address @@ -176,14 +187,24 @@ __tx_ts_new: /* Now we are looking for a new thread to execute! */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Is there another thread ready to execute? CBZ r1, __tx_ts_wait // No, skip to the wait processing /* Yes, another thread is ready for else, make the current thread the new thread. */ STR r1, [r0] // Setup the current thread pointer to the new thread +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif /* Increment the thread run count. */ @@ -227,7 +248,12 @@ _skip_vfp_restore: are disabled to allow use of WFI for waiting for a thread to arrive. */ __tx_ts_wait: +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Pickup the next thread to execute pointer STR r1, [r0] // Store it in the current pointer CBNZ r1, __tx_ts_ready // If non-NULL, a new thread is ready! @@ -250,7 +276,12 @@ __tx_ts_wait: POP {r0-r3} #endif +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_wait // Loop to continue waiting /* At this point, we have a new thread ready to go. Clear any newly pended PendSV - since we are @@ -262,8 +293,12 @@ __tx_ts_ready: STR r7, [r8, #0xD04] // Clear any PendSV /* Re-enable interrupts and restore new thread. */ - +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_restore // Restore the thread // } diff --git a/ports/cortex_m3/keil/inc/tx_port.h b/ports/cortex_m3/keil/inc/tx_port.h index 369f912b..d12b1ad9 100644 --- a/ports/cortex_m3/keil/inc/tx_port.h +++ b/ports/cortex_m3/keil/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M3/Keil */ -/* 6.1.10 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -56,6 +56,9 @@ /* violation, */ /* fixed predefined macro, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -154,14 +157,14 @@ typedef unsigned short USHORT; For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_MISRA_ENABLE #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #else ULONG _tx_misra_time_stamp_get(VOID); @@ -378,7 +381,7 @@ void _tx_vfp_access(void); else \ { \ ULONG _tx_fpccr; \ - _tx_fpccr = *((ULONG *) 0xE000EF34); \ + _tx_fpccr = *((volatile ULONG *) 0xE000EF34); \ _tx_fpccr = _tx_fpccr & ((ULONG) 0x01); \ if (_tx_fpccr == ((ULONG) 0x01)) \ { \ @@ -582,7 +585,7 @@ __attribute__( ( always_inline ) ) static inline void _tx_thread_system_return_i unsigned int interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (__get_ipsr_value() == 0) { interrupt_save = __get_interrupt_posture(); @@ -651,7 +654,7 @@ static void _tx_thread_system_return_inline(void) unsigned int interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (_ipsr == 0) { #ifdef TX_PORT_USE_BASEPRI @@ -704,7 +707,7 @@ void tx_thread_fpu_disable(void); #ifdef TX_THREAD_INIT CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M3/Keil Version 6.1.9 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M3/Keil Version 6.1.11 *"; #else #ifdef TX_MISRA_ENABLE extern CHAR _tx_version_id[100]; diff --git a/ports/cortex_m33/ac6/inc/tx_port.h b/ports/cortex_m33/ac6/inc/tx_port.h index 26620c2c..aaa02995 100644 --- a/ports/cortex_m33/ac6/inc/tx_port.h +++ b/ports/cortex_m33/ac6/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M33 */ -/* 6.1.10 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -68,6 +68,9 @@ /* this file across compilers, */ /* fixed predefined macro, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -196,14 +199,14 @@ UINT _tx_thread_secure_stack_free(struct TX_THREAD_STRUCT *tx_thread); For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_MISRA_ENABLE #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #else ULONG _tx_misra_time_stamp_get(VOID); @@ -371,9 +374,9 @@ __attribute__( ( always_inline ) ) static inline void _tx_control_set(ULONG cont #define TX_THREAD_COMPLETED_EXTENSION(thread_ptr) { \ ULONG _tx_vfp_state; \ - _tx_vfp_state = _tx_control_get(); \ + _tx_vfp_state = _tx_control_get(); \ _tx_vfp_state = _tx_vfp_state & ~((ULONG) 0x4); \ - _tx_control_set(_tx_vfp_state); \ + _tx_control_set(_tx_vfp_state); \ } #else @@ -398,26 +401,26 @@ __attribute__( ( always_inline ) ) static inline void _tx_control_set(ULONG cont if ((_tx_system_state == ((ULONG) 0)) && ((thread_ptr) == _tx_thread_current_ptr)) \ { \ ULONG _tx_vfp_state; \ - _tx_vfp_state = _tx_control_get(); \ + _tx_vfp_state = _tx_control_get(); \ _tx_vfp_state = _tx_vfp_state & ~((ULONG) 0x4); \ - _tx_control_set(_tx_vfp_state); \ + _tx_control_set(_tx_vfp_state); \ } \ else \ { \ ULONG _tx_fpccr; \ - _tx_fpccr = *((ULONG *) 0xE000EF34); \ + _tx_fpccr = *((volatile ULONG *) 0xE000EF34); \ _tx_fpccr = _tx_fpccr & ((ULONG) 0x01); \ if (_tx_fpccr == ((ULONG) 0x01)) \ { \ ULONG _tx_vfp_state; \ - _tx_vfp_state = _tx_control_get(); \ + _tx_vfp_state = _tx_control_get(); \ _tx_vfp_state = _tx_vfp_state & ((ULONG) 0x4); \ TX_VFP_TOUCH(); \ if (_tx_vfp_state == ((ULONG) 0)) \ { \ - _tx_vfp_state = _tx_control_get(); \ + _tx_vfp_state = _tx_control_get(); \ _tx_vfp_state = _tx_vfp_state & ~((ULONG) 0x4); \ - _tx_control_set(_tx_vfp_state); \ + _tx_control_set(_tx_vfp_state); \ } \ } \ } \ @@ -599,7 +602,7 @@ __attribute__( ( always_inline ) ) static inline void _tx_thread_system_return_i UINT interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (_tx_ipsr_get() == 0) { interrupt_save = __get_interrupt_posture(); diff --git a/ports/cortex_m33/ac6/src/tx_thread_schedule.S b/ports/cortex_m33/ac6/src/tx_thread_schedule.S index 9ca58e90..34ca023f 100644 --- a/ports/cortex_m33/ac6/src/tx_thread_schedule.S +++ b/ports/cortex_m33/ac6/src/tx_thread_schedule.S @@ -30,7 +30,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_schedule Cortex-M33/AC6 */ -/* 6.1.6 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* Scott Larson, Microsoft Corporation */ @@ -69,6 +69,8 @@ /* 06-02-2021 Scott Larson Added secure stack initialize */ /* in SVC handler, */ /* resulting in version 6.1.7 */ +/* 04-25-2022 Scott Larson Added BASEPRI support, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_schedule(VOID) @@ -128,12 +130,22 @@ __tx_ts_handler: #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) /* Call the thread exit function to indicate the thread is no longer executing. */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ PUSH {r0, lr} // Save LR (and r0 just for alignment) BL _tx_execution_thread_exit // Call the thread exit function POP {r0, lr} // Recover LR +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts -#endif +#endif /* TX_PORT_USE_BASEPRI */ +#endif /* EXECUTION PROFILE */ LDR r0, =_tx_thread_current_ptr // Build current thread pointer address LDR r2, =_tx_thread_execute_ptr // Build execute thread pointer address @@ -189,14 +201,24 @@ __tx_ts_new: /* Now we are looking for a new thread to execute! */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Is there another thread ready to execute? CBZ r1, __tx_ts_wait // No, skip to the wait processing /* Yes, another thread is ready for else, make the current thread the new thread. */ STR r1, [r0] // Setup the current thread pointer to the new thread +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif /* Increment the thread run count. */ @@ -250,7 +272,12 @@ _skip_vfp_restore: are disabled to allow use of WFI for waiting for a thread to arrive. */ __tx_ts_wait: +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Pickup the next thread to execute pointer STR r1, [r0] // Store it in the current pointer CBNZ r1, __tx_ts_ready // If non-NULL, a new thread is ready! @@ -273,7 +300,12 @@ __tx_ts_wait: POP {r0-r3} #endif +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_wait // Loop to continue waiting /* At this point, we have a new thread ready to go. Clear any newly pended PendSV - since we are @@ -284,7 +316,12 @@ __tx_ts_ready: STR r7, [r8, #0xD04] // Clear any PendSV /* Re-enable interrupts and restore new thread. */ +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_restore // Restore the thread // } diff --git a/ports/cortex_m33/gnu/inc/tx_port.h b/ports/cortex_m33/gnu/inc/tx_port.h index 26620c2c..aaa02995 100644 --- a/ports/cortex_m33/gnu/inc/tx_port.h +++ b/ports/cortex_m33/gnu/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M33 */ -/* 6.1.10 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -68,6 +68,9 @@ /* this file across compilers, */ /* fixed predefined macro, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -196,14 +199,14 @@ UINT _tx_thread_secure_stack_free(struct TX_THREAD_STRUCT *tx_thread); For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_MISRA_ENABLE #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #else ULONG _tx_misra_time_stamp_get(VOID); @@ -371,9 +374,9 @@ __attribute__( ( always_inline ) ) static inline void _tx_control_set(ULONG cont #define TX_THREAD_COMPLETED_EXTENSION(thread_ptr) { \ ULONG _tx_vfp_state; \ - _tx_vfp_state = _tx_control_get(); \ + _tx_vfp_state = _tx_control_get(); \ _tx_vfp_state = _tx_vfp_state & ~((ULONG) 0x4); \ - _tx_control_set(_tx_vfp_state); \ + _tx_control_set(_tx_vfp_state); \ } #else @@ -398,26 +401,26 @@ __attribute__( ( always_inline ) ) static inline void _tx_control_set(ULONG cont if ((_tx_system_state == ((ULONG) 0)) && ((thread_ptr) == _tx_thread_current_ptr)) \ { \ ULONG _tx_vfp_state; \ - _tx_vfp_state = _tx_control_get(); \ + _tx_vfp_state = _tx_control_get(); \ _tx_vfp_state = _tx_vfp_state & ~((ULONG) 0x4); \ - _tx_control_set(_tx_vfp_state); \ + _tx_control_set(_tx_vfp_state); \ } \ else \ { \ ULONG _tx_fpccr; \ - _tx_fpccr = *((ULONG *) 0xE000EF34); \ + _tx_fpccr = *((volatile ULONG *) 0xE000EF34); \ _tx_fpccr = _tx_fpccr & ((ULONG) 0x01); \ if (_tx_fpccr == ((ULONG) 0x01)) \ { \ ULONG _tx_vfp_state; \ - _tx_vfp_state = _tx_control_get(); \ + _tx_vfp_state = _tx_control_get(); \ _tx_vfp_state = _tx_vfp_state & ((ULONG) 0x4); \ TX_VFP_TOUCH(); \ if (_tx_vfp_state == ((ULONG) 0)) \ { \ - _tx_vfp_state = _tx_control_get(); \ + _tx_vfp_state = _tx_control_get(); \ _tx_vfp_state = _tx_vfp_state & ~((ULONG) 0x4); \ - _tx_control_set(_tx_vfp_state); \ + _tx_control_set(_tx_vfp_state); \ } \ } \ } \ @@ -599,7 +602,7 @@ __attribute__( ( always_inline ) ) static inline void _tx_thread_system_return_i UINT interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (_tx_ipsr_get() == 0) { interrupt_save = __get_interrupt_posture(); diff --git a/ports/cortex_m33/gnu/src/tx_thread_schedule.S b/ports/cortex_m33/gnu/src/tx_thread_schedule.S index caf48c51..f3c382dd 100644 --- a/ports/cortex_m33/gnu/src/tx_thread_schedule.S +++ b/ports/cortex_m33/gnu/src/tx_thread_schedule.S @@ -26,7 +26,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_schedule Cortex-M33/GNU */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* Scott Larson, Microsoft Corporation */ @@ -67,6 +67,8 @@ /* resulting in version 6.1.7 */ /* 01-31-2022 Scott Larson Fixed predefined macro name, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 Scott Larson Added BASEPRI support, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_schedule(VOID) @@ -126,12 +128,22 @@ __tx_ts_handler: #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) /* Call the thread exit function to indicate the thread is no longer executing. */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ PUSH {r0, lr} // Save LR (and r0 just for alignment) BL _tx_execution_thread_exit // Call the thread exit function POP {r0, lr} // Recover LR +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts -#endif +#endif /* TX_PORT_USE_BASEPRI */ +#endif /* EXECUTION PROFILE */ LDR r0, =_tx_thread_current_ptr // Build current thread pointer address LDR r2, =_tx_thread_execute_ptr // Build execute thread pointer address @@ -187,14 +199,24 @@ __tx_ts_new: /* Now we are looking for a new thread to execute! */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Is there another thread ready to execute? CBZ r1, __tx_ts_wait // No, skip to the wait processing /* Yes, another thread is ready for else, make the current thread the new thread. */ STR r1, [r0] // Setup the current thread pointer to the new thread +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif /* Increment the thread run count. */ @@ -248,7 +270,12 @@ _skip_vfp_restore: are disabled to allow use of WFI for waiting for a thread to arrive. */ __tx_ts_wait: +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Pickup the next thread to execute pointer STR r1, [r0] // Store it in the current pointer CBNZ r1, __tx_ts_ready // If non-NULL, a new thread is ready! @@ -271,7 +298,12 @@ __tx_ts_wait: POP {r0-r3} #endif +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_wait // Loop to continue waiting /* At this point, we have a new thread ready to go. Clear any newly pended PendSV - since we are @@ -282,7 +314,12 @@ __tx_ts_ready: STR r7, [r8, #0xD04] // Clear any PendSV /* Re-enable interrupts and restore new thread. */ +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_restore // Restore the thread // } diff --git a/ports/cortex_m33/iar/inc/tx_port.h b/ports/cortex_m33/iar/inc/tx_port.h index 26620c2c..aaa02995 100644 --- a/ports/cortex_m33/iar/inc/tx_port.h +++ b/ports/cortex_m33/iar/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M33 */ -/* 6.1.10 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -68,6 +68,9 @@ /* this file across compilers, */ /* fixed predefined macro, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -196,14 +199,14 @@ UINT _tx_thread_secure_stack_free(struct TX_THREAD_STRUCT *tx_thread); For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_MISRA_ENABLE #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #else ULONG _tx_misra_time_stamp_get(VOID); @@ -371,9 +374,9 @@ __attribute__( ( always_inline ) ) static inline void _tx_control_set(ULONG cont #define TX_THREAD_COMPLETED_EXTENSION(thread_ptr) { \ ULONG _tx_vfp_state; \ - _tx_vfp_state = _tx_control_get(); \ + _tx_vfp_state = _tx_control_get(); \ _tx_vfp_state = _tx_vfp_state & ~((ULONG) 0x4); \ - _tx_control_set(_tx_vfp_state); \ + _tx_control_set(_tx_vfp_state); \ } #else @@ -398,26 +401,26 @@ __attribute__( ( always_inline ) ) static inline void _tx_control_set(ULONG cont if ((_tx_system_state == ((ULONG) 0)) && ((thread_ptr) == _tx_thread_current_ptr)) \ { \ ULONG _tx_vfp_state; \ - _tx_vfp_state = _tx_control_get(); \ + _tx_vfp_state = _tx_control_get(); \ _tx_vfp_state = _tx_vfp_state & ~((ULONG) 0x4); \ - _tx_control_set(_tx_vfp_state); \ + _tx_control_set(_tx_vfp_state); \ } \ else \ { \ ULONG _tx_fpccr; \ - _tx_fpccr = *((ULONG *) 0xE000EF34); \ + _tx_fpccr = *((volatile ULONG *) 0xE000EF34); \ _tx_fpccr = _tx_fpccr & ((ULONG) 0x01); \ if (_tx_fpccr == ((ULONG) 0x01)) \ { \ ULONG _tx_vfp_state; \ - _tx_vfp_state = _tx_control_get(); \ + _tx_vfp_state = _tx_control_get(); \ _tx_vfp_state = _tx_vfp_state & ((ULONG) 0x4); \ TX_VFP_TOUCH(); \ if (_tx_vfp_state == ((ULONG) 0)) \ { \ - _tx_vfp_state = _tx_control_get(); \ + _tx_vfp_state = _tx_control_get(); \ _tx_vfp_state = _tx_vfp_state & ~((ULONG) 0x4); \ - _tx_control_set(_tx_vfp_state); \ + _tx_control_set(_tx_vfp_state); \ } \ } \ } \ @@ -599,7 +602,7 @@ __attribute__( ( always_inline ) ) static inline void _tx_thread_system_return_i UINT interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (_tx_ipsr_get() == 0) { interrupt_save = __get_interrupt_posture(); diff --git a/ports/cortex_m33/iar/src/tx_thread_schedule.s b/ports/cortex_m33/iar/src/tx_thread_schedule.s index 003f8114..b7430415 100644 --- a/ports/cortex_m33/iar/src/tx_thread_schedule.s +++ b/ports/cortex_m33/iar/src/tx_thread_schedule.s @@ -43,7 +43,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_schedule Cortex-M33/IAR */ -/* 6.1.7 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* Scott Larson, Microsoft Corporation */ @@ -82,6 +82,8 @@ /* 06-02-2021 Scott Larson Added secure stack initialize */ /* in SVC handler, */ /* resulting in version 6.1.7 */ +/* 04-25-2022 Scott Larson Added BASEPRI support, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_schedule(VOID) @@ -128,12 +130,22 @@ __tx_ts_handler: #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) /* Call the thread exit function to indicate the thread is no longer executing. */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ PUSH {r0, lr} // Save LR (and r0 just for alignment) BL _tx_execution_thread_exit // Call the thread exit function POP {r0, lr} // Recover LR +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts -#endif +#endif /* TX_PORT_USE_BASEPRI */ +#endif /* EXECUTION PROFILE */ LDR r0, =_tx_thread_current_ptr // Build current thread pointer address LDR r2, =_tx_thread_execute_ptr // Build execute thread pointer address @@ -189,14 +201,24 @@ __tx_ts_new: /* Now we are looking for a new thread to execute! */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Is there another thread ready to execute? CBZ r1, __tx_ts_wait // No, skip to the wait processing /* Yes, another thread is ready for else, make the current thread the new thread. */ STR r1, [r0] // Setup the current thread pointer to the new thread +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif /* Increment the thread run count. */ @@ -250,7 +272,12 @@ _skip_vfp_restore: are disabled to allow use of WFI for waiting for a thread to arrive. */ __tx_ts_wait: +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Pickup the next thread to execute pointer STR r1, [r0] // Store it in the current pointer CBNZ r1, __tx_ts_ready // If non-NULL, a new thread is ready! @@ -273,7 +300,12 @@ __tx_ts_wait: POP {r0-r3} #endif +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_wait // Loop to continue waiting /* At this point, we have a new thread ready to go. Clear any newly pended PendSV - since we are @@ -284,7 +316,12 @@ __tx_ts_ready: STR r7, [r8, #0xD04] // Clear any PendSV /* Re-enable interrupts and restore new thread. */ +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_restore // Restore the thread // } diff --git a/ports/cortex_m4/ac5/inc/tx_port.h b/ports/cortex_m4/ac5/inc/tx_port.h index 0a08d098..7967a951 100644 --- a/ports/cortex_m4/ac5/inc/tx_port.h +++ b/ports/cortex_m4/ac5/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M4/AC5 */ -/* 6.1.10 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -56,6 +56,9 @@ /* violation, */ /* fixed predefined macro, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -154,14 +157,14 @@ typedef unsigned short USHORT; For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_MISRA_ENABLE #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #else ULONG _tx_misra_time_stamp_get(VOID); @@ -378,7 +381,7 @@ void _tx_vfp_access(void); else \ { \ ULONG _tx_fpccr; \ - _tx_fpccr = *((ULONG *) 0xE000EF34); \ + _tx_fpccr = *((volatile ULONG *) 0xE000EF34); \ _tx_fpccr = _tx_fpccr & ((ULONG) 0x01); \ if (_tx_fpccr == ((ULONG) 0x01)) \ { \ @@ -582,7 +585,7 @@ __attribute__( ( always_inline ) ) static inline void _tx_thread_system_return_i unsigned int interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (__get_ipsr_value() == 0) { interrupt_save = __get_interrupt_posture(); @@ -651,7 +654,7 @@ static void _tx_thread_system_return_inline(void) unsigned int interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (_ipsr == 0) { #ifdef TX_PORT_USE_BASEPRI @@ -704,7 +707,7 @@ void tx_thread_fpu_disable(void); #ifdef TX_THREAD_INIT CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M4/AC5 Version 6.1.9 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M4/AC5 Version 6.1.11 *"; #else #ifdef TX_MISRA_ENABLE extern CHAR _tx_version_id[100]; diff --git a/ports/cortex_m4/ac5/src/tx_thread_schedule.s b/ports/cortex_m4/ac5/src/tx_thread_schedule.s index e497ee29..122460e2 100644 --- a/ports/cortex_m4/ac5/src/tx_thread_schedule.s +++ b/ports/cortex_m4/ac5/src/tx_thread_schedule.s @@ -37,7 +37,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_schedule Cortex-M4/AC5 */ -/* 6.1.7 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* Scott Larson, Microsoft Corporation */ @@ -64,13 +64,14 @@ /* */ /* _tx_initialize_kernel_enter ThreadX entry function */ /* _tx_thread_system_return Return to system from thread */ -/* _tx_thread_context_restore Restore thread's context */ /* */ /* RELEASE HISTORY */ /* */ /* DATE NAME DESCRIPTION */ /* */ /* 06-02-2021 Scott Larson Initial Version 6.1.7 */ +/* 04-25-2022 Scott Larson Added BASEPRI support, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_schedule(VOID) @@ -126,12 +127,22 @@ __tx_ts_handler #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) /* Call the thread exit function to indicate the thread is no longer executing. */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ PUSH {r0, lr} // Save LR (and r0 just for alignment) BL _tx_execution_thread_exit // Call the thread exit function POP {r0, lr} // Recover LR +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts -#endif +#endif /* TX_PORT_USE_BASEPRI */ +#endif /* EXECUTION PROFILE */ LDR r0, =_tx_thread_current_ptr // Build current thread pointer address LDR r2, =_tx_thread_execute_ptr // Build execute thread pointer address @@ -176,14 +187,24 @@ __tx_ts_new /* Now we are looking for a new thread to execute! */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Is there another thread ready to execute? CBZ r1, __tx_ts_wait // No, skip to the wait processing /* Yes, another thread is ready for else, make the current thread the new thread. */ STR r1, [r0] // Setup the current thread pointer to the new thread +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif /* Increment the thread run count. */ @@ -227,7 +248,12 @@ _skip_vfp_restore are disabled to allow use of WFI for waiting for a thread to arrive. */ __tx_ts_wait +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Pickup the next thread to execute pointer STR r1, [r0] // Store it in the current pointer CBNZ r1, __tx_ts_ready // If non-NULL, a new thread is ready! @@ -250,7 +276,12 @@ __tx_ts_wait POP {r0-r3} #endif +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_wait // Loop to continue waiting /* At this point, we have a new thread ready to go. Clear any newly pended PendSV - since we are @@ -262,8 +293,12 @@ __tx_ts_ready STR r7, [r8, #0xD04] // Clear any PendSV /* Re-enable interrupts and restore new thread. */ - +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_restore // Restore the thread // } diff --git a/ports/cortex_m4/ac6/inc/tx_port.h b/ports/cortex_m4/ac6/inc/tx_port.h index 51947682..e0f408ab 100644 --- a/ports/cortex_m4/ac6/inc/tx_port.h +++ b/ports/cortex_m4/ac6/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M4/AC6 */ -/* 6.1.10 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -56,6 +56,9 @@ /* violation, */ /* fixed predefined macro, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -154,14 +157,14 @@ typedef unsigned short USHORT; For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_MISRA_ENABLE #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #else ULONG _tx_misra_time_stamp_get(VOID); @@ -378,7 +381,7 @@ void _tx_vfp_access(void); else \ { \ ULONG _tx_fpccr; \ - _tx_fpccr = *((ULONG *) 0xE000EF34); \ + _tx_fpccr = *((volatile ULONG *) 0xE000EF34); \ _tx_fpccr = _tx_fpccr & ((ULONG) 0x01); \ if (_tx_fpccr == ((ULONG) 0x01)) \ { \ @@ -582,7 +585,7 @@ __attribute__( ( always_inline ) ) static inline void _tx_thread_system_return_i unsigned int interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (__get_ipsr_value() == 0) { interrupt_save = __get_interrupt_posture(); @@ -651,7 +654,7 @@ static void _tx_thread_system_return_inline(void) unsigned int interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (_ipsr == 0) { #ifdef TX_PORT_USE_BASEPRI @@ -704,7 +707,7 @@ void tx_thread_fpu_disable(void); #ifdef TX_THREAD_INIT CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M4/AC6 Version 6.1.9 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M4/AC6 Version 6.1.11 *"; #else #ifdef TX_MISRA_ENABLE extern CHAR _tx_version_id[100]; diff --git a/ports/cortex_m4/ac6/src/tx_misra.S b/ports/cortex_m4/ac6/src/tx_misra.S new file mode 100644 index 00000000..b03fdcd0 --- /dev/null +++ b/ports/cortex_m4/ac6/src/tx_misra.S @@ -0,0 +1,1033 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** ThreadX MISRA Compliance */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + #define SHT_PROGBITS 0x1 + + .global __aeabi_memset + .global _tx_thread_current_ptr + .global _tx_thread_interrupt_disable + .global _tx_thread_interrupt_restore + .global _tx_thread_stack_analyze + .global _tx_thread_stack_error_handler + .global _tx_thread_system_state +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_trace_buffer_current_ptr + .global _tx_trace_buffer_end_ptr + .global _tx_trace_buffer_start_ptr + .global _tx_trace_event_enable_bits + .global _tx_trace_full_notify_function + .global _tx_trace_header_ptr +#endif + + .global _tx_misra_always_true + .global _tx_misra_block_pool_to_uchar_pointer_convert + .global _tx_misra_byte_pool_to_uchar_pointer_convert + .global _tx_misra_char_to_uchar_pointer_convert + .global _tx_misra_const_char_to_char_pointer_convert +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_misra_entry_to_uchar_pointer_convert +#endif + .global _tx_misra_indirect_void_to_uchar_pointer_convert + .global _tx_misra_memset + .global _tx_misra_message_copy +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_misra_object_to_uchar_pointer_convert +#endif + .global _tx_misra_pointer_to_ulong_convert + .global _tx_misra_status_get + .global _tx_misra_thread_stack_check +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_misra_time_stamp_get +#endif + .global _tx_misra_timer_indirect_to_void_pointer_convert + .global _tx_misra_timer_pointer_add + .global _tx_misra_timer_pointer_dif +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_misra_trace_event_insert +#endif + .global _tx_misra_uchar_pointer_add + .global _tx_misra_uchar_pointer_dif + .global _tx_misra_uchar_pointer_sub + .global _tx_misra_uchar_to_align_type_pointer_convert + .global _tx_misra_uchar_to_block_pool_pointer_convert +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_misra_uchar_to_entry_pointer_convert + .global _tx_misra_uchar_to_header_pointer_convert +#endif + .global _tx_misra_uchar_to_indirect_byte_pool_pointer_convert + .global _tx_misra_uchar_to_indirect_uchar_pointer_convert +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_misra_uchar_to_object_pointer_convert +#endif + .global _tx_misra_uchar_to_void_pointer_convert + .global _tx_misra_ulong_pointer_add + .global _tx_misra_ulong_pointer_dif + .global _tx_misra_ulong_pointer_sub + .global _tx_misra_ulong_to_pointer_convert + .global _tx_misra_ulong_to_thread_pointer_convert + .global _tx_misra_user_timer_pointer_get + .global _tx_misra_void_to_block_pool_pointer_convert + .global _tx_misra_void_to_byte_pool_pointer_convert + .global _tx_misra_void_to_event_flags_pointer_convert + .global _tx_misra_void_to_indirect_uchar_pointer_convert + .global _tx_misra_void_to_mutex_pointer_convert + .global _tx_misra_void_to_queue_pointer_convert + .global _tx_misra_void_to_semaphore_pointer_convert + .global _tx_misra_void_to_thread_pointer_convert + .global _tx_misra_void_to_uchar_pointer_convert + .global _tx_misra_void_to_ulong_pointer_convert + .global _tx_misra_ipsr_get + .global _tx_misra_control_get + .global _tx_misra_control_set +#ifdef __ARM_FP + .global _tx_misra_fpccr_get + .global _tx_misra_vfp_touch +#endif + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID _tx_misra_memset(VOID *ptr, UINT value, UINT size); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .align 4 + .syntax unified + .thumb_func +_tx_misra_memset: + PUSH {R4,LR} + MOVS R4,R0 + MOVS R0,R2 + MOVS R2,R1 + MOVS R1,R0 + MOVS R0,R4 + BL __aeabi_memset + POP {R4,PC} // return + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** UCHAR *_tx_misra_uchar_pointer_add(UCHAR *ptr, ULONG amount); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_pointer_add: + ADD R0,R0,R1 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** UCHAR *_tx_misra_uchar_pointer_sub(UCHAR *ptr, ULONG amount); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_pointer_sub: + RSBS R1,R1,#+0 + ADD R0,R0,R1 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG _tx_misra_uchar_pointer_dif(UCHAR *ptr1, UCHAR *ptr2); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_pointer_dif: + SUBS R0,R0,R1 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG _tx_misra_pointer_to_ulong_convert(VOID *ptr); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_pointer_to_ulong_convert: + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG *_tx_misra_ulong_pointer_add(ULONG *ptr, ULONG amount); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_ulong_pointer_add: + ADD R0,R0,R1, LSL #+2 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG *_tx_misra_ulong_pointer_sub(ULONG *ptr, ULONG amount); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_ulong_pointer_sub: + MVNS R2,#+3 + MULS R1,R2,R1 + ADD R0,R0,R1 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG _tx_misra_ulong_pointer_dif(ULONG *ptr1, ULONG *ptr2); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_ulong_pointer_dif: + SUBS R0,R0,R1 + ASRS R0,R0,#+2 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID *_tx_misra_ulong_to_pointer_convert(ULONG input); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_ulong_to_pointer_convert: + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID _tx_misra_message_copy(ULONG **source, ULONG **destination, */ +/** UINT size); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_message_copy: + PUSH {R4,R5} + LDR R3,[R0, #+0] + LDR R4,[R1, #+0] + LDR R5,[R3, #+0] + STR R5,[R4, #+0] + ADDS R4,R4,#+4 + ADDS R3,R3,#+4 + CMP R2,#+2 + BCC.N _tx_misra_message_copy_0 + SUBS R2,R2,#+1 + B.N _tx_misra_message_copy_1 +_tx_misra_message_copy_2: + LDR R5,[R3, #+0] + STR R5,[R4, #+0] + ADDS R4,R4,#+4 + ADDS R3,R3,#+4 + SUBS R2,R2,#+1 +_tx_misra_message_copy_1: + CMP R2,#+0 + BNE.N _tx_misra_message_copy_2 +_tx_misra_message_copy_0: + STR R3,[R0, #+0] + STR R4,[R1, #+0] + POP {R4,R5} + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG _tx_misra_timer_pointer_dif(TX_TIMER_INTERNAL **ptr1, */ +/** TX_TIMER_INTERNAL **ptr2); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_timer_pointer_dif: + SUBS R0,R0,R1 + ASRS R0,R0,#+2 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** TX_TIMER_INTERNAL **_tx_misra_timer_pointer_add(TX_TIMER_INTERNAL */ +/** **ptr1, ULONG size); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_timer_pointer_add: + ADD R0,R0,R1, LSL #+2 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID _tx_misra_user_timer_pointer_get(TX_TIMER_INTERNAL */ +/** *internal_timer, TX_TIMER **user_timer); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_user_timer_pointer_get: + ADDS R2,R0,#+8 + SUBS R2,R2,R0 + RSBS R2,R2,#+0 + ADD R0,R0,R2 + STR R0,[R1, #+0] + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID _tx_misra_thread_stack_check(TX_THREAD *thread_ptr, */ +/** VOID **highest_stack); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_thread_stack_check: + PUSH {R3-R5,LR} + MOVS R4,R0 + MOVS R5,R1 + BL _tx_thread_interrupt_disable + CMP R4,#+0 + BEQ.N _tx_misra_thread_stack_check_0 + LDR R1,[R4, #+0] + LDR R2,=0x54485244 + CMP R1,R2 + BNE.N _tx_misra_thread_stack_check_0 + LDR R1,[R4, #+8] + LDR R2,[R5, #+0] + CMP R1,R2 + BCS.N _tx_misra_thread_stack_check_1 + LDR R1,[R4, #+8] + STR R1,[R5, #+0] +_tx_misra_thread_stack_check_1: + LDR R1,[R4, #+12] + LDR R1,[R1, #+0] + CMP R1,#-269488145 + BNE.N _tx_misra_thread_stack_check_2 + LDR R1,[R4, #+16] + LDR R1,[R1, #+1] + CMP R1,#-269488145 + BNE.N _tx_misra_thread_stack_check_2 + LDR R1,[R5, #+0] + LDR R2,[R4, #+12] + CMP R1,R2 + BCS.N _tx_misra_thread_stack_check_3 +_tx_misra_thread_stack_check_2: + BL _tx_thread_interrupt_restore + MOVS R0,R4 + BL _tx_thread_stack_error_handler + BL _tx_thread_interrupt_disable +_tx_misra_thread_stack_check_3: + LDR R1,[R5, #+0] + LDR R1,[R1, #-4] + CMP R1,#-269488145 + BEQ.N _tx_misra_thread_stack_check_0 + BL _tx_thread_interrupt_restore + MOVS R0,R4 + BL _tx_thread_stack_analyze + BL _tx_thread_interrupt_disable +_tx_misra_thread_stack_check_0: + BL _tx_thread_interrupt_restore + POP {R0,R4,R5,PC} // return + +#ifdef TX_ENABLE_EVENT_TRACE + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID _tx_misra_trace_event_insert(ULONG event_id, */ +/** VOID *info_field_1, ULONG info_field_2, ULONG info_field_3, */ +/** ULONG info_field_4, ULONG filter, ULONG time_stamp); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_trace_event_insert: + PUSH {R3-R7,LR} + LDR.N R4,DataTable2_1 + LDR R4,[R4, #+0] + CMP R4,#+0 + BEQ.N _tx_misra_trace_event_insert_0 + LDR.N R5,DataTable2_2 + LDR R5,[R5, #+0] + LDR R6,[SP, #+28] + TST R5,R6 + BEQ.N _tx_misra_trace_event_insert_0 + LDR.N R5,DataTable2_3 + LDR R5,[R5, #+0] + LDR.N R6,DataTable2_4 + LDR R6,[R6, #+0] + CMP R5,#+0 + BNE.N _tx_misra_trace_event_insert_1 + LDR R5,[R6, #+44] + LDR R7,[R6, #+60] + LSLS R7,R7,#+16 + ORRS R7,R7,#0x80000000 + ORRS R5,R7,R5 + B.N _tx_misra_trace_event_insert_2 +_tx_misra_trace_event_insert_1: + CMP R5,#-252645136 + BCS.N _tx_misra_trace_event_insert_3 + MOVS R5,R6 + MOVS R6,#-1 + B.N _tx_misra_trace_event_insert_2 +_tx_misra_trace_event_insert_3: + MOVS R6,#-252645136 + MOVS R5,#+0 +_tx_misra_trace_event_insert_2: + STR R6,[R4, #+0] + STR R5,[R4, #+4] + STR R0,[R4, #+8] + LDR R0,[SP, #+32] + STR R0,[R4, #+12] + STR R1,[R4, #+16] + STR R2,[R4, #+20] + STR R3,[R4, #+24] + LDR R0,[SP, #+24] + STR R0,[R4, #+28] + ADDS R4,R4,#+32 + LDR.N R0,DataTable2_5 + LDR R0,[R0, #+0] + CMP R4,R0 + BCC.N _tx_misra_trace_event_insert_4 + LDR.N R0,DataTable2_6 + LDR R4,[R0, #+0] + LDR.N R0,DataTable2_1 + STR R4,[R0, #+0] + LDR.N R0,DataTable2_7 + LDR R0,[R0, #+0] + STR R4,[R0, #+32] + LDR.N R0,DataTable2_8 + LDR R0,[R0, #+0] + CMP R0,#+0 + BEQ.N _tx_misra_trace_event_insert_0 + LDR.N R0,DataTable2_7 + LDR R0,[R0, #+0] + LDR.N R1,DataTable2_8 + LDR R1,[R1, #+0] + BLX R1 + B.N _tx_misra_trace_event_insert_0 +_tx_misra_trace_event_insert_4: + LDR.N R0,DataTable2_1 + STR R4,[R0, #+0] + LDR.N R0,DataTable2_7 + LDR R0,[R0, #+0] + STR R4,[R0, #+32] +_tx_misra_trace_event_insert_0: + POP {R0,R4-R7,PC} // return + + + .data +DataTable2_1: + .word _tx_trace_buffer_current_ptr + + .data +DataTable2_2: + .word _tx_trace_event_enable_bits + + .data +DataTable2_5: + .word _tx_trace_buffer_end_ptr + + .data +DataTable2_6: + .word _tx_trace_buffer_start_ptr + + .data +DataTable2_7: + .word _tx_trace_header_ptr + + .data +DataTable2_8: + .word _tx_trace_full_notify_function + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG _tx_misra_time_stamp_get(VOID); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_time_stamp_get: + MOVS R0,#+0 + BX LR // return + +#endif + + .data +DataTable2_3: + .word _tx_thread_system_state + + .data +DataTable2_4: + .word _tx_thread_current_ptr + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** UINT _tx_misra_always_true(void); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_always_true: + MOVS R0,#+1 + BX LR // return + + +/******************************************************************************************/ +/******************************************************************************************/ +/** */ +/** UCHAR **_tx_misra_indirect_void_to_uchar_pointer_convert(VOID **return_ptr); */ +/** */ +/******************************************************************************************/ +/******************************************************************************************/ + + .text + .thumb_func +_tx_misra_indirect_void_to_uchar_pointer_convert: + BX LR // return + + +/***************************************************************************************/ +/***************************************************************************************/ +/** */ +/** UCHAR **_tx_misra_uchar_to_indirect_uchar_pointer_convert(UCHAR *pointer); */ +/** */ +/***************************************************************************************/ +/***************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_indirect_uchar_pointer_convert: + BX LR // return + + +/***********************************************************************************/ +/***********************************************************************************/ +/** */ +/** UCHAR *_tx_misra_block_pool_to_uchar_pointer_convert(TX_BLOCK_POOL *pool); */ +/** */ +/***********************************************************************************/ +/***********************************************************************************/ + + .text + .thumb_func +_tx_misra_block_pool_to_uchar_pointer_convert: + BX LR // return + + +/******************************************************************************************/ +/******************************************************************************************/ +/** */ +/** TX_BLOCK_POOL *_tx_misra_void_to_block_pool_pointer_convert(VOID *pointer); */ +/** */ +/******************************************************************************************/ +/******************************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_block_pool_pointer_convert: + BX LR // return + + +/*****************************************************************************/ +/*****************************************************************************/ +/** */ +/** UCHAR *_tx_misra_void_to_uchar_pointer_convert(VOID *pointer); */ +/** */ +/*****************************************************************************/ +/*****************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_uchar_pointer_convert: + BX LR // return + + +/************************************************************************************/ +/************************************************************************************/ +/** */ +/** TX_BLOCK_POOL *_tx_misra_uchar_to_block_pool_pointer_convert(UCHAR *pointer); */ +/** */ +/************************************************************************************/ +/************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_block_pool_pointer_convert: + BX LR // return + + +/**************************************************************************************/ +/**************************************************************************************/ +/** */ +/** UCHAR **_tx_misra_void_to_indirect_uchar_pointer_convert(VOID *pointer); */ +/** */ +/**************************************************************************************/ +/**************************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_indirect_uchar_pointer_convert: + BX LR // return + + +/*****************************************************************************************/ +/*****************************************************************************************/ +/** */ +/** TX_BYTE_POOL *_tx_misra_void_to_byte_pool_pointer_convert(VOID *pointer); */ +/** */ +/*****************************************************************************************/ +/*****************************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_byte_pool_pointer_convert: + BX LR // return + + +/***************************************************************************************/ +/***************************************************************************************/ +/** */ +/** UCHAR *_tx_misra_byte_pool_to_uchar_pointer_convert(TX_BYTE_POOL *pool); */ +/** */ +/***************************************************************************************/ +/***************************************************************************************/ + + .text + .thumb_func +_tx_misra_byte_pool_to_uchar_pointer_convert: + BX LR // return + + +/*****************************************************************************************/ +/*****************************************************************************************/ +/** */ +/** ALIGN_TYPE *_tx_misra_uchar_to_align_type_pointer_convert(UCHAR *pointer); */ +/** */ +/*****************************************************************************************/ +/*****************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_align_type_pointer_convert: + BX LR // return + + +/****************************************************************************************************/ +/****************************************************************************************************/ +/** */ +/** TX_BYTE_POOL **_tx_misra_uchar_to_indirect_byte_pool_pointer_convert(UCHAR *pointer); */ +/** */ +/****************************************************************************************************/ +/****************************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_indirect_byte_pool_pointer_convert: + BX LR // return + + +/**************************************************************************************************/ +/**************************************************************************************************/ +/** */ +/** TX_EVENT_FLAGS_GROUP *_tx_misra_void_to_event_flags_pointer_convert(VOID *pointer); */ +/** */ +/**************************************************************************************************/ +/**************************************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_event_flags_pointer_convert: + BX LR // return + + +/*****************************************************************************/ +/*****************************************************************************/ +/** */ +/** ULONG *_tx_misra_void_to_ulong_pointer_convert(VOID *pointer); */ +/** */ +/*****************************************************************************/ +/*****************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_ulong_pointer_convert: + BX LR // return + + +/********************************************************************************/ +/********************************************************************************/ +/** */ +/** TX_MUTEX *_tx_misra_void_to_mutex_pointer_convert(VOID *pointer); */ +/** */ +/********************************************************************************/ +/********************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_mutex_pointer_convert: + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** UINT _tx_misra_status_get(UINT status); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_status_get: + MOVS R0,#+0 + BX LR // return + + +/********************************************************************************/ +/********************************************************************************/ +/** */ +/** TX_QUEUE *_tx_misra_void_to_queue_pointer_convert(VOID *pointer); */ +/** */ +/********************************************************************************/ +/********************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_queue_pointer_convert: + BX LR // return + + +/****************************************************************************************/ +/****************************************************************************************/ +/** */ +/** TX_SEMAPHORE *_tx_misra_void_to_semaphore_pointer_convert(VOID *pointer); */ +/** */ +/****************************************************************************************/ +/****************************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_semaphore_pointer_convert: + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID *_tx_misra_uchar_to_void_pointer_convert(UCHAR *pointer); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_void_pointer_convert: + BX LR // return + + +/*********************************************************************************/ +/*********************************************************************************/ +/** */ +/** TX_THREAD *_tx_misra_ulong_to_thread_pointer_convert(ULONG value); */ +/** */ +/*********************************************************************************/ +/*********************************************************************************/ + + .text + .thumb_func +_tx_misra_ulong_to_thread_pointer_convert: + BX LR // return + + +/***************************************************************************************************/ +/***************************************************************************************************/ +/** */ +/** VOID *_tx_misra_timer_indirect_to_void_pointer_convert(TX_TIMER_INTERNAL **pointer); */ +/** */ +/***************************************************************************************************/ +/***************************************************************************************************/ + + .text + .thumb_func +_tx_misra_timer_indirect_to_void_pointer_convert: + BX LR // return + + +/***************************************************************************************/ +/***************************************************************************************/ +/** */ +/** CHAR *_tx_misra_const_char_to_char_pointer_convert(const char *pointer); */ +/** */ +/***************************************************************************************/ +/***************************************************************************************/ + + .text + .thumb_func +_tx_misra_const_char_to_char_pointer_convert: + BX LR // return + + +/**********************************************************************************/ +/**********************************************************************************/ +/** */ +/** TX_THREAD *_tx_misra_void_to_thread_pointer_convert(void *pointer); */ +/** */ +/**********************************************************************************/ +/**********************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_thread_pointer_convert: + BX LR // return + + +#ifdef TX_ENABLE_EVENT_TRACE + +/************************************************************************************************/ +/************************************************************************************************/ +/** */ +/** UCHAR *_tx_misra_object_to_uchar_pointer_convert(TX_TRACE_OBJECT_ENTRY *pointer); */ +/** */ +/************************************************************************************************/ +/************************************************************************************************/ + + .text + .thumb_func +_tx_misra_object_to_uchar_pointer_convert: + BX LR // return + + +/************************************************************************************************/ +/************************************************************************************************/ +/** */ +/** TX_TRACE_OBJECT_ENTRY *_tx_misra_uchar_to_object_pointer_convert(UCHAR *pointer); */ +/** */ +/************************************************************************************************/ +/************************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_object_pointer_convert: + BX LR // return + + +/******************************************************************************************/ +/******************************************************************************************/ +/** */ +/** TX_TRACE_HEADER *_tx_misra_uchar_to_header_pointer_convert(UCHAR *pointer); */ +/** */ +/******************************************************************************************/ +/******************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_header_pointer_convert: + BX LR // return + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** TX_TRACE_BUFFER_ENTRY *_tx_misra_uchar_to_entry_pointer_convert(UCHAR *pointer); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_entry_pointer_convert: + BX LR // return + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** UCHAR *_tx_misra_entry_to_uchar_pointer_convert(TX_TRACE_BUFFER_ENTRY *pointer); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_entry_to_uchar_pointer_convert: + BX LR // return +#endif + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** UCHAR *_tx_misra_char_to_uchar_pointer_convert(CHAR *pointer); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_char_to_uchar_pointer_convert: + BX LR // return + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** ULONG _tx_misra_ipsr_get(void); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_ipsr_get: + MRS R0, IPSR + BX LR // return + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** ULONG _tx_misra_control_get(void); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_control_get: + MRS R0, CONTROL + BX LR // return + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** void _tx_misra_control_set(ULONG value); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_control_set: + MSR CONTROL, R0 + BX LR // return + + +#ifdef __ARM_FP + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** ULONG _tx_misra_fpccr_get(void); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_fpccr_get: + LDR r0, =0xE000EF34 // Build FPCCR address + LDR r0, [r0] // Load FPCCR value + BX LR // return + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** void _tx_misra_vfp_touch(void); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_vfp_touch: + vmov.f32 s0, s0 + BX LR // return + +#endif + + + .data + .word 0 diff --git a/ports/cortex_m4/ac6/src/tx_thread_schedule.S b/ports/cortex_m4/ac6/src/tx_thread_schedule.S index d2e748af..9bae029f 100644 --- a/ports/cortex_m4/ac6/src/tx_thread_schedule.S +++ b/ports/cortex_m4/ac6/src/tx_thread_schedule.S @@ -39,7 +39,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_schedule Cortex-M4/AC6 */ -/* 6.1.7 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* Scott Larson, Microsoft Corporation */ @@ -66,13 +66,14 @@ /* */ /* _tx_initialize_kernel_enter ThreadX entry function */ /* _tx_thread_system_return Return to system from thread */ -/* _tx_thread_context_restore Restore thread's context */ /* */ /* RELEASE HISTORY */ /* */ /* DATE NAME DESCRIPTION */ /* */ /* 06-02-2021 Scott Larson Initial Version 6.1.7 */ +/* 04-25-2022 Scott Larson Added BASEPRI support, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_schedule(VOID) @@ -132,12 +133,22 @@ __tx_ts_handler: #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) /* Call the thread exit function to indicate the thread is no longer executing. */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ PUSH {r0, lr} // Save LR (and r0 just for alignment) BL _tx_execution_thread_exit // Call the thread exit function POP {r0, lr} // Recover LR +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts -#endif +#endif /* TX_PORT_USE_BASEPRI */ +#endif /* EXECUTION PROFILE */ LDR r0, =_tx_thread_current_ptr // Build current thread pointer address LDR r2, =_tx_thread_execute_ptr // Build execute thread pointer address @@ -182,14 +193,24 @@ __tx_ts_new: /* Now we are looking for a new thread to execute! */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Is there another thread ready to execute? CBZ r1, __tx_ts_wait // No, skip to the wait processing /* Yes, another thread is ready for else, make the current thread the new thread. */ STR r1, [r0] // Setup the current thread pointer to the new thread +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif /* Increment the thread run count. */ @@ -233,7 +254,12 @@ _skip_vfp_restore: are disabled to allow use of WFI for waiting for a thread to arrive. */ __tx_ts_wait: +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Pickup the next thread to execute pointer STR r1, [r0] // Store it in the current pointer CBNZ r1, __tx_ts_ready // If non-NULL, a new thread is ready! @@ -256,7 +282,12 @@ __tx_ts_wait: POP {r0-r3} #endif +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_wait // Loop to continue waiting /* At this point, we have a new thread ready to go. Clear any newly pended PendSV - since we are @@ -268,8 +299,12 @@ __tx_ts_ready: STR r7, [r8, #0xD04] // Clear any PendSV /* Re-enable interrupts and restore new thread. */ - +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_restore // Restore the thread // } diff --git a/ports/cortex_m4/gnu/inc/tx_port.h b/ports/cortex_m4/gnu/inc/tx_port.h index 80237531..f1e25ab3 100644 --- a/ports/cortex_m4/gnu/inc/tx_port.h +++ b/ports/cortex_m4/gnu/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M4/GNU */ -/* 6.1.10 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -56,6 +56,9 @@ /* violation, */ /* fixed predefined macro, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -154,14 +157,14 @@ typedef unsigned short USHORT; For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_MISRA_ENABLE #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #else ULONG _tx_misra_time_stamp_get(VOID); @@ -378,7 +381,7 @@ void _tx_vfp_access(void); else \ { \ ULONG _tx_fpccr; \ - _tx_fpccr = *((ULONG *) 0xE000EF34); \ + _tx_fpccr = *((volatile ULONG *) 0xE000EF34); \ _tx_fpccr = _tx_fpccr & ((ULONG) 0x01); \ if (_tx_fpccr == ((ULONG) 0x01)) \ { \ @@ -582,7 +585,7 @@ __attribute__( ( always_inline ) ) static inline void _tx_thread_system_return_i unsigned int interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (__get_ipsr_value() == 0) { interrupt_save = __get_interrupt_posture(); @@ -651,7 +654,7 @@ static void _tx_thread_system_return_inline(void) unsigned int interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (_ipsr == 0) { #ifdef TX_PORT_USE_BASEPRI @@ -704,7 +707,7 @@ void tx_thread_fpu_disable(void); #ifdef TX_THREAD_INIT CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M4/GNU Version 6.1.9 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M4/GNU Version 6.1.11 *"; #else #ifdef TX_MISRA_ENABLE extern CHAR _tx_version_id[100]; diff --git a/ports/cortex_m4/gnu/src/tx_misra.S b/ports/cortex_m4/gnu/src/tx_misra.S new file mode 100644 index 00000000..b03fdcd0 --- /dev/null +++ b/ports/cortex_m4/gnu/src/tx_misra.S @@ -0,0 +1,1033 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** ThreadX MISRA Compliance */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + #define SHT_PROGBITS 0x1 + + .global __aeabi_memset + .global _tx_thread_current_ptr + .global _tx_thread_interrupt_disable + .global _tx_thread_interrupt_restore + .global _tx_thread_stack_analyze + .global _tx_thread_stack_error_handler + .global _tx_thread_system_state +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_trace_buffer_current_ptr + .global _tx_trace_buffer_end_ptr + .global _tx_trace_buffer_start_ptr + .global _tx_trace_event_enable_bits + .global _tx_trace_full_notify_function + .global _tx_trace_header_ptr +#endif + + .global _tx_misra_always_true + .global _tx_misra_block_pool_to_uchar_pointer_convert + .global _tx_misra_byte_pool_to_uchar_pointer_convert + .global _tx_misra_char_to_uchar_pointer_convert + .global _tx_misra_const_char_to_char_pointer_convert +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_misra_entry_to_uchar_pointer_convert +#endif + .global _tx_misra_indirect_void_to_uchar_pointer_convert + .global _tx_misra_memset + .global _tx_misra_message_copy +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_misra_object_to_uchar_pointer_convert +#endif + .global _tx_misra_pointer_to_ulong_convert + .global _tx_misra_status_get + .global _tx_misra_thread_stack_check +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_misra_time_stamp_get +#endif + .global _tx_misra_timer_indirect_to_void_pointer_convert + .global _tx_misra_timer_pointer_add + .global _tx_misra_timer_pointer_dif +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_misra_trace_event_insert +#endif + .global _tx_misra_uchar_pointer_add + .global _tx_misra_uchar_pointer_dif + .global _tx_misra_uchar_pointer_sub + .global _tx_misra_uchar_to_align_type_pointer_convert + .global _tx_misra_uchar_to_block_pool_pointer_convert +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_misra_uchar_to_entry_pointer_convert + .global _tx_misra_uchar_to_header_pointer_convert +#endif + .global _tx_misra_uchar_to_indirect_byte_pool_pointer_convert + .global _tx_misra_uchar_to_indirect_uchar_pointer_convert +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_misra_uchar_to_object_pointer_convert +#endif + .global _tx_misra_uchar_to_void_pointer_convert + .global _tx_misra_ulong_pointer_add + .global _tx_misra_ulong_pointer_dif + .global _tx_misra_ulong_pointer_sub + .global _tx_misra_ulong_to_pointer_convert + .global _tx_misra_ulong_to_thread_pointer_convert + .global _tx_misra_user_timer_pointer_get + .global _tx_misra_void_to_block_pool_pointer_convert + .global _tx_misra_void_to_byte_pool_pointer_convert + .global _tx_misra_void_to_event_flags_pointer_convert + .global _tx_misra_void_to_indirect_uchar_pointer_convert + .global _tx_misra_void_to_mutex_pointer_convert + .global _tx_misra_void_to_queue_pointer_convert + .global _tx_misra_void_to_semaphore_pointer_convert + .global _tx_misra_void_to_thread_pointer_convert + .global _tx_misra_void_to_uchar_pointer_convert + .global _tx_misra_void_to_ulong_pointer_convert + .global _tx_misra_ipsr_get + .global _tx_misra_control_get + .global _tx_misra_control_set +#ifdef __ARM_FP + .global _tx_misra_fpccr_get + .global _tx_misra_vfp_touch +#endif + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID _tx_misra_memset(VOID *ptr, UINT value, UINT size); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .align 4 + .syntax unified + .thumb_func +_tx_misra_memset: + PUSH {R4,LR} + MOVS R4,R0 + MOVS R0,R2 + MOVS R2,R1 + MOVS R1,R0 + MOVS R0,R4 + BL __aeabi_memset + POP {R4,PC} // return + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** UCHAR *_tx_misra_uchar_pointer_add(UCHAR *ptr, ULONG amount); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_pointer_add: + ADD R0,R0,R1 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** UCHAR *_tx_misra_uchar_pointer_sub(UCHAR *ptr, ULONG amount); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_pointer_sub: + RSBS R1,R1,#+0 + ADD R0,R0,R1 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG _tx_misra_uchar_pointer_dif(UCHAR *ptr1, UCHAR *ptr2); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_pointer_dif: + SUBS R0,R0,R1 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG _tx_misra_pointer_to_ulong_convert(VOID *ptr); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_pointer_to_ulong_convert: + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG *_tx_misra_ulong_pointer_add(ULONG *ptr, ULONG amount); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_ulong_pointer_add: + ADD R0,R0,R1, LSL #+2 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG *_tx_misra_ulong_pointer_sub(ULONG *ptr, ULONG amount); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_ulong_pointer_sub: + MVNS R2,#+3 + MULS R1,R2,R1 + ADD R0,R0,R1 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG _tx_misra_ulong_pointer_dif(ULONG *ptr1, ULONG *ptr2); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_ulong_pointer_dif: + SUBS R0,R0,R1 + ASRS R0,R0,#+2 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID *_tx_misra_ulong_to_pointer_convert(ULONG input); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_ulong_to_pointer_convert: + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID _tx_misra_message_copy(ULONG **source, ULONG **destination, */ +/** UINT size); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_message_copy: + PUSH {R4,R5} + LDR R3,[R0, #+0] + LDR R4,[R1, #+0] + LDR R5,[R3, #+0] + STR R5,[R4, #+0] + ADDS R4,R4,#+4 + ADDS R3,R3,#+4 + CMP R2,#+2 + BCC.N _tx_misra_message_copy_0 + SUBS R2,R2,#+1 + B.N _tx_misra_message_copy_1 +_tx_misra_message_copy_2: + LDR R5,[R3, #+0] + STR R5,[R4, #+0] + ADDS R4,R4,#+4 + ADDS R3,R3,#+4 + SUBS R2,R2,#+1 +_tx_misra_message_copy_1: + CMP R2,#+0 + BNE.N _tx_misra_message_copy_2 +_tx_misra_message_copy_0: + STR R3,[R0, #+0] + STR R4,[R1, #+0] + POP {R4,R5} + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG _tx_misra_timer_pointer_dif(TX_TIMER_INTERNAL **ptr1, */ +/** TX_TIMER_INTERNAL **ptr2); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_timer_pointer_dif: + SUBS R0,R0,R1 + ASRS R0,R0,#+2 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** TX_TIMER_INTERNAL **_tx_misra_timer_pointer_add(TX_TIMER_INTERNAL */ +/** **ptr1, ULONG size); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_timer_pointer_add: + ADD R0,R0,R1, LSL #+2 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID _tx_misra_user_timer_pointer_get(TX_TIMER_INTERNAL */ +/** *internal_timer, TX_TIMER **user_timer); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_user_timer_pointer_get: + ADDS R2,R0,#+8 + SUBS R2,R2,R0 + RSBS R2,R2,#+0 + ADD R0,R0,R2 + STR R0,[R1, #+0] + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID _tx_misra_thread_stack_check(TX_THREAD *thread_ptr, */ +/** VOID **highest_stack); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_thread_stack_check: + PUSH {R3-R5,LR} + MOVS R4,R0 + MOVS R5,R1 + BL _tx_thread_interrupt_disable + CMP R4,#+0 + BEQ.N _tx_misra_thread_stack_check_0 + LDR R1,[R4, #+0] + LDR R2,=0x54485244 + CMP R1,R2 + BNE.N _tx_misra_thread_stack_check_0 + LDR R1,[R4, #+8] + LDR R2,[R5, #+0] + CMP R1,R2 + BCS.N _tx_misra_thread_stack_check_1 + LDR R1,[R4, #+8] + STR R1,[R5, #+0] +_tx_misra_thread_stack_check_1: + LDR R1,[R4, #+12] + LDR R1,[R1, #+0] + CMP R1,#-269488145 + BNE.N _tx_misra_thread_stack_check_2 + LDR R1,[R4, #+16] + LDR R1,[R1, #+1] + CMP R1,#-269488145 + BNE.N _tx_misra_thread_stack_check_2 + LDR R1,[R5, #+0] + LDR R2,[R4, #+12] + CMP R1,R2 + BCS.N _tx_misra_thread_stack_check_3 +_tx_misra_thread_stack_check_2: + BL _tx_thread_interrupt_restore + MOVS R0,R4 + BL _tx_thread_stack_error_handler + BL _tx_thread_interrupt_disable +_tx_misra_thread_stack_check_3: + LDR R1,[R5, #+0] + LDR R1,[R1, #-4] + CMP R1,#-269488145 + BEQ.N _tx_misra_thread_stack_check_0 + BL _tx_thread_interrupt_restore + MOVS R0,R4 + BL _tx_thread_stack_analyze + BL _tx_thread_interrupt_disable +_tx_misra_thread_stack_check_0: + BL _tx_thread_interrupt_restore + POP {R0,R4,R5,PC} // return + +#ifdef TX_ENABLE_EVENT_TRACE + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID _tx_misra_trace_event_insert(ULONG event_id, */ +/** VOID *info_field_1, ULONG info_field_2, ULONG info_field_3, */ +/** ULONG info_field_4, ULONG filter, ULONG time_stamp); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_trace_event_insert: + PUSH {R3-R7,LR} + LDR.N R4,DataTable2_1 + LDR R4,[R4, #+0] + CMP R4,#+0 + BEQ.N _tx_misra_trace_event_insert_0 + LDR.N R5,DataTable2_2 + LDR R5,[R5, #+0] + LDR R6,[SP, #+28] + TST R5,R6 + BEQ.N _tx_misra_trace_event_insert_0 + LDR.N R5,DataTable2_3 + LDR R5,[R5, #+0] + LDR.N R6,DataTable2_4 + LDR R6,[R6, #+0] + CMP R5,#+0 + BNE.N _tx_misra_trace_event_insert_1 + LDR R5,[R6, #+44] + LDR R7,[R6, #+60] + LSLS R7,R7,#+16 + ORRS R7,R7,#0x80000000 + ORRS R5,R7,R5 + B.N _tx_misra_trace_event_insert_2 +_tx_misra_trace_event_insert_1: + CMP R5,#-252645136 + BCS.N _tx_misra_trace_event_insert_3 + MOVS R5,R6 + MOVS R6,#-1 + B.N _tx_misra_trace_event_insert_2 +_tx_misra_trace_event_insert_3: + MOVS R6,#-252645136 + MOVS R5,#+0 +_tx_misra_trace_event_insert_2: + STR R6,[R4, #+0] + STR R5,[R4, #+4] + STR R0,[R4, #+8] + LDR R0,[SP, #+32] + STR R0,[R4, #+12] + STR R1,[R4, #+16] + STR R2,[R4, #+20] + STR R3,[R4, #+24] + LDR R0,[SP, #+24] + STR R0,[R4, #+28] + ADDS R4,R4,#+32 + LDR.N R0,DataTable2_5 + LDR R0,[R0, #+0] + CMP R4,R0 + BCC.N _tx_misra_trace_event_insert_4 + LDR.N R0,DataTable2_6 + LDR R4,[R0, #+0] + LDR.N R0,DataTable2_1 + STR R4,[R0, #+0] + LDR.N R0,DataTable2_7 + LDR R0,[R0, #+0] + STR R4,[R0, #+32] + LDR.N R0,DataTable2_8 + LDR R0,[R0, #+0] + CMP R0,#+0 + BEQ.N _tx_misra_trace_event_insert_0 + LDR.N R0,DataTable2_7 + LDR R0,[R0, #+0] + LDR.N R1,DataTable2_8 + LDR R1,[R1, #+0] + BLX R1 + B.N _tx_misra_trace_event_insert_0 +_tx_misra_trace_event_insert_4: + LDR.N R0,DataTable2_1 + STR R4,[R0, #+0] + LDR.N R0,DataTable2_7 + LDR R0,[R0, #+0] + STR R4,[R0, #+32] +_tx_misra_trace_event_insert_0: + POP {R0,R4-R7,PC} // return + + + .data +DataTable2_1: + .word _tx_trace_buffer_current_ptr + + .data +DataTable2_2: + .word _tx_trace_event_enable_bits + + .data +DataTable2_5: + .word _tx_trace_buffer_end_ptr + + .data +DataTable2_6: + .word _tx_trace_buffer_start_ptr + + .data +DataTable2_7: + .word _tx_trace_header_ptr + + .data +DataTable2_8: + .word _tx_trace_full_notify_function + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG _tx_misra_time_stamp_get(VOID); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_time_stamp_get: + MOVS R0,#+0 + BX LR // return + +#endif + + .data +DataTable2_3: + .word _tx_thread_system_state + + .data +DataTable2_4: + .word _tx_thread_current_ptr + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** UINT _tx_misra_always_true(void); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_always_true: + MOVS R0,#+1 + BX LR // return + + +/******************************************************************************************/ +/******************************************************************************************/ +/** */ +/** UCHAR **_tx_misra_indirect_void_to_uchar_pointer_convert(VOID **return_ptr); */ +/** */ +/******************************************************************************************/ +/******************************************************************************************/ + + .text + .thumb_func +_tx_misra_indirect_void_to_uchar_pointer_convert: + BX LR // return + + +/***************************************************************************************/ +/***************************************************************************************/ +/** */ +/** UCHAR **_tx_misra_uchar_to_indirect_uchar_pointer_convert(UCHAR *pointer); */ +/** */ +/***************************************************************************************/ +/***************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_indirect_uchar_pointer_convert: + BX LR // return + + +/***********************************************************************************/ +/***********************************************************************************/ +/** */ +/** UCHAR *_tx_misra_block_pool_to_uchar_pointer_convert(TX_BLOCK_POOL *pool); */ +/** */ +/***********************************************************************************/ +/***********************************************************************************/ + + .text + .thumb_func +_tx_misra_block_pool_to_uchar_pointer_convert: + BX LR // return + + +/******************************************************************************************/ +/******************************************************************************************/ +/** */ +/** TX_BLOCK_POOL *_tx_misra_void_to_block_pool_pointer_convert(VOID *pointer); */ +/** */ +/******************************************************************************************/ +/******************************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_block_pool_pointer_convert: + BX LR // return + + +/*****************************************************************************/ +/*****************************************************************************/ +/** */ +/** UCHAR *_tx_misra_void_to_uchar_pointer_convert(VOID *pointer); */ +/** */ +/*****************************************************************************/ +/*****************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_uchar_pointer_convert: + BX LR // return + + +/************************************************************************************/ +/************************************************************************************/ +/** */ +/** TX_BLOCK_POOL *_tx_misra_uchar_to_block_pool_pointer_convert(UCHAR *pointer); */ +/** */ +/************************************************************************************/ +/************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_block_pool_pointer_convert: + BX LR // return + + +/**************************************************************************************/ +/**************************************************************************************/ +/** */ +/** UCHAR **_tx_misra_void_to_indirect_uchar_pointer_convert(VOID *pointer); */ +/** */ +/**************************************************************************************/ +/**************************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_indirect_uchar_pointer_convert: + BX LR // return + + +/*****************************************************************************************/ +/*****************************************************************************************/ +/** */ +/** TX_BYTE_POOL *_tx_misra_void_to_byte_pool_pointer_convert(VOID *pointer); */ +/** */ +/*****************************************************************************************/ +/*****************************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_byte_pool_pointer_convert: + BX LR // return + + +/***************************************************************************************/ +/***************************************************************************************/ +/** */ +/** UCHAR *_tx_misra_byte_pool_to_uchar_pointer_convert(TX_BYTE_POOL *pool); */ +/** */ +/***************************************************************************************/ +/***************************************************************************************/ + + .text + .thumb_func +_tx_misra_byte_pool_to_uchar_pointer_convert: + BX LR // return + + +/*****************************************************************************************/ +/*****************************************************************************************/ +/** */ +/** ALIGN_TYPE *_tx_misra_uchar_to_align_type_pointer_convert(UCHAR *pointer); */ +/** */ +/*****************************************************************************************/ +/*****************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_align_type_pointer_convert: + BX LR // return + + +/****************************************************************************************************/ +/****************************************************************************************************/ +/** */ +/** TX_BYTE_POOL **_tx_misra_uchar_to_indirect_byte_pool_pointer_convert(UCHAR *pointer); */ +/** */ +/****************************************************************************************************/ +/****************************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_indirect_byte_pool_pointer_convert: + BX LR // return + + +/**************************************************************************************************/ +/**************************************************************************************************/ +/** */ +/** TX_EVENT_FLAGS_GROUP *_tx_misra_void_to_event_flags_pointer_convert(VOID *pointer); */ +/** */ +/**************************************************************************************************/ +/**************************************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_event_flags_pointer_convert: + BX LR // return + + +/*****************************************************************************/ +/*****************************************************************************/ +/** */ +/** ULONG *_tx_misra_void_to_ulong_pointer_convert(VOID *pointer); */ +/** */ +/*****************************************************************************/ +/*****************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_ulong_pointer_convert: + BX LR // return + + +/********************************************************************************/ +/********************************************************************************/ +/** */ +/** TX_MUTEX *_tx_misra_void_to_mutex_pointer_convert(VOID *pointer); */ +/** */ +/********************************************************************************/ +/********************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_mutex_pointer_convert: + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** UINT _tx_misra_status_get(UINT status); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_status_get: + MOVS R0,#+0 + BX LR // return + + +/********************************************************************************/ +/********************************************************************************/ +/** */ +/** TX_QUEUE *_tx_misra_void_to_queue_pointer_convert(VOID *pointer); */ +/** */ +/********************************************************************************/ +/********************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_queue_pointer_convert: + BX LR // return + + +/****************************************************************************************/ +/****************************************************************************************/ +/** */ +/** TX_SEMAPHORE *_tx_misra_void_to_semaphore_pointer_convert(VOID *pointer); */ +/** */ +/****************************************************************************************/ +/****************************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_semaphore_pointer_convert: + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID *_tx_misra_uchar_to_void_pointer_convert(UCHAR *pointer); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_void_pointer_convert: + BX LR // return + + +/*********************************************************************************/ +/*********************************************************************************/ +/** */ +/** TX_THREAD *_tx_misra_ulong_to_thread_pointer_convert(ULONG value); */ +/** */ +/*********************************************************************************/ +/*********************************************************************************/ + + .text + .thumb_func +_tx_misra_ulong_to_thread_pointer_convert: + BX LR // return + + +/***************************************************************************************************/ +/***************************************************************************************************/ +/** */ +/** VOID *_tx_misra_timer_indirect_to_void_pointer_convert(TX_TIMER_INTERNAL **pointer); */ +/** */ +/***************************************************************************************************/ +/***************************************************************************************************/ + + .text + .thumb_func +_tx_misra_timer_indirect_to_void_pointer_convert: + BX LR // return + + +/***************************************************************************************/ +/***************************************************************************************/ +/** */ +/** CHAR *_tx_misra_const_char_to_char_pointer_convert(const char *pointer); */ +/** */ +/***************************************************************************************/ +/***************************************************************************************/ + + .text + .thumb_func +_tx_misra_const_char_to_char_pointer_convert: + BX LR // return + + +/**********************************************************************************/ +/**********************************************************************************/ +/** */ +/** TX_THREAD *_tx_misra_void_to_thread_pointer_convert(void *pointer); */ +/** */ +/**********************************************************************************/ +/**********************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_thread_pointer_convert: + BX LR // return + + +#ifdef TX_ENABLE_EVENT_TRACE + +/************************************************************************************************/ +/************************************************************************************************/ +/** */ +/** UCHAR *_tx_misra_object_to_uchar_pointer_convert(TX_TRACE_OBJECT_ENTRY *pointer); */ +/** */ +/************************************************************************************************/ +/************************************************************************************************/ + + .text + .thumb_func +_tx_misra_object_to_uchar_pointer_convert: + BX LR // return + + +/************************************************************************************************/ +/************************************************************************************************/ +/** */ +/** TX_TRACE_OBJECT_ENTRY *_tx_misra_uchar_to_object_pointer_convert(UCHAR *pointer); */ +/** */ +/************************************************************************************************/ +/************************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_object_pointer_convert: + BX LR // return + + +/******************************************************************************************/ +/******************************************************************************************/ +/** */ +/** TX_TRACE_HEADER *_tx_misra_uchar_to_header_pointer_convert(UCHAR *pointer); */ +/** */ +/******************************************************************************************/ +/******************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_header_pointer_convert: + BX LR // return + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** TX_TRACE_BUFFER_ENTRY *_tx_misra_uchar_to_entry_pointer_convert(UCHAR *pointer); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_entry_pointer_convert: + BX LR // return + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** UCHAR *_tx_misra_entry_to_uchar_pointer_convert(TX_TRACE_BUFFER_ENTRY *pointer); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_entry_to_uchar_pointer_convert: + BX LR // return +#endif + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** UCHAR *_tx_misra_char_to_uchar_pointer_convert(CHAR *pointer); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_char_to_uchar_pointer_convert: + BX LR // return + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** ULONG _tx_misra_ipsr_get(void); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_ipsr_get: + MRS R0, IPSR + BX LR // return + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** ULONG _tx_misra_control_get(void); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_control_get: + MRS R0, CONTROL + BX LR // return + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** void _tx_misra_control_set(ULONG value); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_control_set: + MSR CONTROL, R0 + BX LR // return + + +#ifdef __ARM_FP + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** ULONG _tx_misra_fpccr_get(void); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_fpccr_get: + LDR r0, =0xE000EF34 // Build FPCCR address + LDR r0, [r0] // Load FPCCR value + BX LR // return + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** void _tx_misra_vfp_touch(void); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_vfp_touch: + vmov.f32 s0, s0 + BX LR // return + +#endif + + + .data + .word 0 diff --git a/ports/cortex_m4/gnu/src/tx_thread_schedule.S b/ports/cortex_m4/gnu/src/tx_thread_schedule.S index 63e5c01f..77e63398 100644 --- a/ports/cortex_m4/gnu/src/tx_thread_schedule.S +++ b/ports/cortex_m4/gnu/src/tx_thread_schedule.S @@ -37,7 +37,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_schedule Cortex-M4/GNU */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* Scott Larson, Microsoft Corporation */ @@ -72,6 +72,8 @@ /* 06-02-2021 Scott Larson Initial Version 6.1.7 */ /* 01-31-2022 Scott Larson Fixed predefined macro name, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 Scott Larson Added BASEPRI support, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_schedule(VOID) @@ -131,12 +133,22 @@ __tx_ts_handler: #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) /* Call the thread exit function to indicate the thread is no longer executing. */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ PUSH {r0, lr} // Save LR (and r0 just for alignment) BL _tx_execution_thread_exit // Call the thread exit function POP {r0, lr} // Recover LR +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts -#endif +#endif /* TX_PORT_USE_BASEPRI */ +#endif /* EXECUTION PROFILE */ LDR r0, =_tx_thread_current_ptr // Build current thread pointer address LDR r2, =_tx_thread_execute_ptr // Build execute thread pointer address @@ -181,14 +193,24 @@ __tx_ts_new: /* Now we are looking for a new thread to execute! */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Is there another thread ready to execute? CBZ r1, __tx_ts_wait // No, skip to the wait processing /* Yes, another thread is ready for else, make the current thread the new thread. */ STR r1, [r0] // Setup the current thread pointer to the new thread +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif /* Increment the thread run count. */ @@ -232,7 +254,12 @@ _skip_vfp_restore: are disabled to allow use of WFI for waiting for a thread to arrive. */ __tx_ts_wait: +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Pickup the next thread to execute pointer STR r1, [r0] // Store it in the current pointer CBNZ r1, __tx_ts_ready // If non-NULL, a new thread is ready! @@ -255,7 +282,12 @@ __tx_ts_wait: POP {r0-r3} #endif +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_wait // Loop to continue waiting /* At this point, we have a new thread ready to go. Clear any newly pended PendSV - since we are @@ -267,8 +299,12 @@ __tx_ts_ready: STR r7, [r8, #0xD04] // Clear any PendSV /* Re-enable interrupts and restore new thread. */ - +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_restore // Restore the thread // } diff --git a/ports/cortex_m4/iar/inc/tx_port.h b/ports/cortex_m4/iar/inc/tx_port.h index 67b7fa60..b27fa00f 100644 --- a/ports/cortex_m4/iar/inc/tx_port.h +++ b/ports/cortex_m4/iar/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M4/IAR */ -/* 6.1.10 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -56,6 +56,9 @@ /* violation, */ /* fixed predefined macro, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -154,14 +157,14 @@ typedef unsigned short USHORT; For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_MISRA_ENABLE #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #else ULONG _tx_misra_time_stamp_get(VOID); @@ -378,7 +381,7 @@ void _tx_vfp_access(void); else \ { \ ULONG _tx_fpccr; \ - _tx_fpccr = *((ULONG *) 0xE000EF34); \ + _tx_fpccr = *((volatile ULONG *) 0xE000EF34); \ _tx_fpccr = _tx_fpccr & ((ULONG) 0x01); \ if (_tx_fpccr == ((ULONG) 0x01)) \ { \ @@ -582,7 +585,7 @@ __attribute__( ( always_inline ) ) static inline void _tx_thread_system_return_i unsigned int interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (__get_ipsr_value() == 0) { interrupt_save = __get_interrupt_posture(); @@ -651,7 +654,7 @@ static void _tx_thread_system_return_inline(void) unsigned int interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (_ipsr == 0) { #ifdef TX_PORT_USE_BASEPRI @@ -704,7 +707,7 @@ void tx_thread_fpu_disable(void); #ifdef TX_THREAD_INIT CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M4/IAR Version 6.1.9 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M4/IAR Version 6.1.11 *"; #else #ifdef TX_MISRA_ENABLE extern CHAR _tx_version_id[100]; diff --git a/ports/cortex_m4/iar/src/tx_thread_schedule.s b/ports/cortex_m4/iar/src/tx_thread_schedule.s index 927fb3d5..2d1b0298 100644 --- a/ports/cortex_m4/iar/src/tx_thread_schedule.s +++ b/ports/cortex_m4/iar/src/tx_thread_schedule.s @@ -37,7 +37,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_schedule Cortex-M4/IAR */ -/* 6.1.7 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* Scott Larson, Microsoft Corporation */ @@ -64,13 +64,14 @@ /* */ /* _tx_initialize_kernel_enter ThreadX entry function */ /* _tx_thread_system_return Return to system from thread */ -/* _tx_thread_context_restore Restore thread's context */ /* */ /* RELEASE HISTORY */ /* */ /* DATE NAME DESCRIPTION */ /* */ /* 06-02-2021 Scott Larson Initial Version 6.1.7 */ +/* 04-25-2022 Scott Larson Added BASEPRI support, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_schedule(VOID) @@ -126,12 +127,22 @@ __tx_ts_handler: #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) /* Call the thread exit function to indicate the thread is no longer executing. */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ PUSH {r0, lr} // Save LR (and r0 just for alignment) BL _tx_execution_thread_exit // Call the thread exit function POP {r0, lr} // Recover LR +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts -#endif +#endif /* TX_PORT_USE_BASEPRI */ +#endif /* EXECUTION PROFILE */ LDR r0, =_tx_thread_current_ptr // Build current thread pointer address LDR r2, =_tx_thread_execute_ptr // Build execute thread pointer address @@ -176,14 +187,24 @@ __tx_ts_new: /* Now we are looking for a new thread to execute! */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Is there another thread ready to execute? CBZ r1, __tx_ts_wait // No, skip to the wait processing /* Yes, another thread is ready for else, make the current thread the new thread. */ STR r1, [r0] // Setup the current thread pointer to the new thread +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif /* Increment the thread run count. */ @@ -227,7 +248,12 @@ _skip_vfp_restore: are disabled to allow use of WFI for waiting for a thread to arrive. */ __tx_ts_wait: +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Pickup the next thread to execute pointer STR r1, [r0] // Store it in the current pointer CBNZ r1, __tx_ts_ready // If non-NULL, a new thread is ready! @@ -250,7 +276,12 @@ __tx_ts_wait: POP {r0-r3} #endif +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_wait // Loop to continue waiting /* At this point, we have a new thread ready to go. Clear any newly pended PendSV - since we are @@ -262,8 +293,12 @@ __tx_ts_ready: STR r7, [r8, #0xD04] // Clear any PendSV /* Re-enable interrupts and restore new thread. */ - +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_restore // Restore the thread // } diff --git a/ports/cortex_m4/keil/inc/tx_port.h b/ports/cortex_m4/keil/inc/tx_port.h index 8c6f8c8c..199c876a 100644 --- a/ports/cortex_m4/keil/inc/tx_port.h +++ b/ports/cortex_m4/keil/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M4/Keil */ -/* 6.1.10 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -56,6 +56,9 @@ /* violation, */ /* fixed predefined macro, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -154,14 +157,14 @@ typedef unsigned short USHORT; For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_MISRA_ENABLE #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #else ULONG _tx_misra_time_stamp_get(VOID); @@ -378,7 +381,7 @@ void _tx_vfp_access(void); else \ { \ ULONG _tx_fpccr; \ - _tx_fpccr = *((ULONG *) 0xE000EF34); \ + _tx_fpccr = *((volatile ULONG *) 0xE000EF34); \ _tx_fpccr = _tx_fpccr & ((ULONG) 0x01); \ if (_tx_fpccr == ((ULONG) 0x01)) \ { \ @@ -582,7 +585,7 @@ __attribute__( ( always_inline ) ) static inline void _tx_thread_system_return_i unsigned int interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (__get_ipsr_value() == 0) { interrupt_save = __get_interrupt_posture(); @@ -651,7 +654,7 @@ static void _tx_thread_system_return_inline(void) unsigned int interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (_ipsr == 0) { #ifdef TX_PORT_USE_BASEPRI @@ -704,7 +707,7 @@ void tx_thread_fpu_disable(void); #ifdef TX_THREAD_INIT CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M4/Keil Version 6.1.9 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M4/Keil Version 6.1.11 *"; #else #ifdef TX_MISRA_ENABLE extern CHAR _tx_version_id[100]; diff --git a/ports/cortex_m7/ac5/inc/tx_port.h b/ports/cortex_m7/ac5/inc/tx_port.h index 391fd743..a0e3d194 100644 --- a/ports/cortex_m7/ac5/inc/tx_port.h +++ b/ports/cortex_m7/ac5/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M7/AC5 */ -/* 6.1.10 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -56,6 +56,9 @@ /* violation, */ /* fixed predefined macro, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -154,14 +157,14 @@ typedef unsigned short USHORT; For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_MISRA_ENABLE #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #else ULONG _tx_misra_time_stamp_get(VOID); @@ -378,7 +381,7 @@ void _tx_vfp_access(void); else \ { \ ULONG _tx_fpccr; \ - _tx_fpccr = *((ULONG *) 0xE000EF34); \ + _tx_fpccr = *((volatile ULONG *) 0xE000EF34); \ _tx_fpccr = _tx_fpccr & ((ULONG) 0x01); \ if (_tx_fpccr == ((ULONG) 0x01)) \ { \ @@ -582,7 +585,7 @@ __attribute__( ( always_inline ) ) static inline void _tx_thread_system_return_i unsigned int interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (__get_ipsr_value() == 0) { interrupt_save = __get_interrupt_posture(); @@ -651,7 +654,7 @@ static void _tx_thread_system_return_inline(void) unsigned int interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (_ipsr == 0) { #ifdef TX_PORT_USE_BASEPRI @@ -704,7 +707,7 @@ void tx_thread_fpu_disable(void); #ifdef TX_THREAD_INIT CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M7/AC5 Version 6.1.9 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M7/AC5 Version 6.1.11 *"; #else #ifdef TX_MISRA_ENABLE extern CHAR _tx_version_id[100]; diff --git a/ports/cortex_m7/ac5/src/tx_thread_schedule.s b/ports/cortex_m7/ac5/src/tx_thread_schedule.s index a09eadd2..7c9dc566 100644 --- a/ports/cortex_m7/ac5/src/tx_thread_schedule.s +++ b/ports/cortex_m7/ac5/src/tx_thread_schedule.s @@ -37,7 +37,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_schedule Cortex-M7/AC5 */ -/* 6.1.7 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* Scott Larson, Microsoft Corporation */ @@ -64,13 +64,14 @@ /* */ /* _tx_initialize_kernel_enter ThreadX entry function */ /* _tx_thread_system_return Return to system from thread */ -/* _tx_thread_context_restore Restore thread's context */ /* */ /* RELEASE HISTORY */ /* */ /* DATE NAME DESCRIPTION */ /* */ /* 06-02-2021 Scott Larson Initial Version 6.1.7 */ +/* 04-25-2022 Scott Larson Added BASEPRI support, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_schedule(VOID) @@ -126,12 +127,22 @@ __tx_ts_handler #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) /* Call the thread exit function to indicate the thread is no longer executing. */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ PUSH {r0, lr} // Save LR (and r0 just for alignment) BL _tx_execution_thread_exit // Call the thread exit function POP {r0, lr} // Recover LR +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts -#endif +#endif /* TX_PORT_USE_BASEPRI */ +#endif /* EXECUTION PROFILE */ LDR r0, =_tx_thread_current_ptr // Build current thread pointer address LDR r2, =_tx_thread_execute_ptr // Build execute thread pointer address @@ -176,14 +187,24 @@ __tx_ts_new /* Now we are looking for a new thread to execute! */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Is there another thread ready to execute? CBZ r1, __tx_ts_wait // No, skip to the wait processing /* Yes, another thread is ready for else, make the current thread the new thread. */ STR r1, [r0] // Setup the current thread pointer to the new thread +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif /* Increment the thread run count. */ @@ -227,7 +248,12 @@ _skip_vfp_restore are disabled to allow use of WFI for waiting for a thread to arrive. */ __tx_ts_wait +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Pickup the next thread to execute pointer STR r1, [r0] // Store it in the current pointer CBNZ r1, __tx_ts_ready // If non-NULL, a new thread is ready! @@ -250,7 +276,12 @@ __tx_ts_wait POP {r0-r3} #endif +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_wait // Loop to continue waiting /* At this point, we have a new thread ready to go. Clear any newly pended PendSV - since we are @@ -262,8 +293,12 @@ __tx_ts_ready STR r7, [r8, #0xD04] // Clear any PendSV /* Re-enable interrupts and restore new thread. */ - +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_restore // Restore the thread // } diff --git a/ports/cortex_m7/ac6/inc/tx_port.h b/ports/cortex_m7/ac6/inc/tx_port.h index 904a12b3..cfd833fa 100644 --- a/ports/cortex_m7/ac6/inc/tx_port.h +++ b/ports/cortex_m7/ac6/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M7/AC6 */ -/* 6.1.10 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -56,6 +56,9 @@ /* violation, */ /* fixed predefined macro, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -154,14 +157,14 @@ typedef unsigned short USHORT; For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_MISRA_ENABLE #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #else ULONG _tx_misra_time_stamp_get(VOID); @@ -378,7 +381,7 @@ void _tx_vfp_access(void); else \ { \ ULONG _tx_fpccr; \ - _tx_fpccr = *((ULONG *) 0xE000EF34); \ + _tx_fpccr = *((volatile ULONG *) 0xE000EF34); \ _tx_fpccr = _tx_fpccr & ((ULONG) 0x01); \ if (_tx_fpccr == ((ULONG) 0x01)) \ { \ @@ -582,7 +585,7 @@ __attribute__( ( always_inline ) ) static inline void _tx_thread_system_return_i unsigned int interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (__get_ipsr_value() == 0) { interrupt_save = __get_interrupt_posture(); @@ -651,7 +654,7 @@ static void _tx_thread_system_return_inline(void) unsigned int interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (_ipsr == 0) { #ifdef TX_PORT_USE_BASEPRI @@ -704,7 +707,7 @@ void tx_thread_fpu_disable(void); #ifdef TX_THREAD_INIT CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M7/AC6 Version 6.1.9 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M7/AC6 Version 6.1.11 *"; #else #ifdef TX_MISRA_ENABLE extern CHAR _tx_version_id[100]; diff --git a/ports/cortex_m7/ac6/src/tx_misra.S b/ports/cortex_m7/ac6/src/tx_misra.S new file mode 100644 index 00000000..b03fdcd0 --- /dev/null +++ b/ports/cortex_m7/ac6/src/tx_misra.S @@ -0,0 +1,1033 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** ThreadX MISRA Compliance */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + #define SHT_PROGBITS 0x1 + + .global __aeabi_memset + .global _tx_thread_current_ptr + .global _tx_thread_interrupt_disable + .global _tx_thread_interrupt_restore + .global _tx_thread_stack_analyze + .global _tx_thread_stack_error_handler + .global _tx_thread_system_state +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_trace_buffer_current_ptr + .global _tx_trace_buffer_end_ptr + .global _tx_trace_buffer_start_ptr + .global _tx_trace_event_enable_bits + .global _tx_trace_full_notify_function + .global _tx_trace_header_ptr +#endif + + .global _tx_misra_always_true + .global _tx_misra_block_pool_to_uchar_pointer_convert + .global _tx_misra_byte_pool_to_uchar_pointer_convert + .global _tx_misra_char_to_uchar_pointer_convert + .global _tx_misra_const_char_to_char_pointer_convert +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_misra_entry_to_uchar_pointer_convert +#endif + .global _tx_misra_indirect_void_to_uchar_pointer_convert + .global _tx_misra_memset + .global _tx_misra_message_copy +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_misra_object_to_uchar_pointer_convert +#endif + .global _tx_misra_pointer_to_ulong_convert + .global _tx_misra_status_get + .global _tx_misra_thread_stack_check +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_misra_time_stamp_get +#endif + .global _tx_misra_timer_indirect_to_void_pointer_convert + .global _tx_misra_timer_pointer_add + .global _tx_misra_timer_pointer_dif +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_misra_trace_event_insert +#endif + .global _tx_misra_uchar_pointer_add + .global _tx_misra_uchar_pointer_dif + .global _tx_misra_uchar_pointer_sub + .global _tx_misra_uchar_to_align_type_pointer_convert + .global _tx_misra_uchar_to_block_pool_pointer_convert +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_misra_uchar_to_entry_pointer_convert + .global _tx_misra_uchar_to_header_pointer_convert +#endif + .global _tx_misra_uchar_to_indirect_byte_pool_pointer_convert + .global _tx_misra_uchar_to_indirect_uchar_pointer_convert +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_misra_uchar_to_object_pointer_convert +#endif + .global _tx_misra_uchar_to_void_pointer_convert + .global _tx_misra_ulong_pointer_add + .global _tx_misra_ulong_pointer_dif + .global _tx_misra_ulong_pointer_sub + .global _tx_misra_ulong_to_pointer_convert + .global _tx_misra_ulong_to_thread_pointer_convert + .global _tx_misra_user_timer_pointer_get + .global _tx_misra_void_to_block_pool_pointer_convert + .global _tx_misra_void_to_byte_pool_pointer_convert + .global _tx_misra_void_to_event_flags_pointer_convert + .global _tx_misra_void_to_indirect_uchar_pointer_convert + .global _tx_misra_void_to_mutex_pointer_convert + .global _tx_misra_void_to_queue_pointer_convert + .global _tx_misra_void_to_semaphore_pointer_convert + .global _tx_misra_void_to_thread_pointer_convert + .global _tx_misra_void_to_uchar_pointer_convert + .global _tx_misra_void_to_ulong_pointer_convert + .global _tx_misra_ipsr_get + .global _tx_misra_control_get + .global _tx_misra_control_set +#ifdef __ARM_FP + .global _tx_misra_fpccr_get + .global _tx_misra_vfp_touch +#endif + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID _tx_misra_memset(VOID *ptr, UINT value, UINT size); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .align 4 + .syntax unified + .thumb_func +_tx_misra_memset: + PUSH {R4,LR} + MOVS R4,R0 + MOVS R0,R2 + MOVS R2,R1 + MOVS R1,R0 + MOVS R0,R4 + BL __aeabi_memset + POP {R4,PC} // return + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** UCHAR *_tx_misra_uchar_pointer_add(UCHAR *ptr, ULONG amount); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_pointer_add: + ADD R0,R0,R1 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** UCHAR *_tx_misra_uchar_pointer_sub(UCHAR *ptr, ULONG amount); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_pointer_sub: + RSBS R1,R1,#+0 + ADD R0,R0,R1 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG _tx_misra_uchar_pointer_dif(UCHAR *ptr1, UCHAR *ptr2); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_pointer_dif: + SUBS R0,R0,R1 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG _tx_misra_pointer_to_ulong_convert(VOID *ptr); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_pointer_to_ulong_convert: + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG *_tx_misra_ulong_pointer_add(ULONG *ptr, ULONG amount); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_ulong_pointer_add: + ADD R0,R0,R1, LSL #+2 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG *_tx_misra_ulong_pointer_sub(ULONG *ptr, ULONG amount); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_ulong_pointer_sub: + MVNS R2,#+3 + MULS R1,R2,R1 + ADD R0,R0,R1 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG _tx_misra_ulong_pointer_dif(ULONG *ptr1, ULONG *ptr2); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_ulong_pointer_dif: + SUBS R0,R0,R1 + ASRS R0,R0,#+2 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID *_tx_misra_ulong_to_pointer_convert(ULONG input); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_ulong_to_pointer_convert: + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID _tx_misra_message_copy(ULONG **source, ULONG **destination, */ +/** UINT size); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_message_copy: + PUSH {R4,R5} + LDR R3,[R0, #+0] + LDR R4,[R1, #+0] + LDR R5,[R3, #+0] + STR R5,[R4, #+0] + ADDS R4,R4,#+4 + ADDS R3,R3,#+4 + CMP R2,#+2 + BCC.N _tx_misra_message_copy_0 + SUBS R2,R2,#+1 + B.N _tx_misra_message_copy_1 +_tx_misra_message_copy_2: + LDR R5,[R3, #+0] + STR R5,[R4, #+0] + ADDS R4,R4,#+4 + ADDS R3,R3,#+4 + SUBS R2,R2,#+1 +_tx_misra_message_copy_1: + CMP R2,#+0 + BNE.N _tx_misra_message_copy_2 +_tx_misra_message_copy_0: + STR R3,[R0, #+0] + STR R4,[R1, #+0] + POP {R4,R5} + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG _tx_misra_timer_pointer_dif(TX_TIMER_INTERNAL **ptr1, */ +/** TX_TIMER_INTERNAL **ptr2); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_timer_pointer_dif: + SUBS R0,R0,R1 + ASRS R0,R0,#+2 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** TX_TIMER_INTERNAL **_tx_misra_timer_pointer_add(TX_TIMER_INTERNAL */ +/** **ptr1, ULONG size); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_timer_pointer_add: + ADD R0,R0,R1, LSL #+2 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID _tx_misra_user_timer_pointer_get(TX_TIMER_INTERNAL */ +/** *internal_timer, TX_TIMER **user_timer); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_user_timer_pointer_get: + ADDS R2,R0,#+8 + SUBS R2,R2,R0 + RSBS R2,R2,#+0 + ADD R0,R0,R2 + STR R0,[R1, #+0] + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID _tx_misra_thread_stack_check(TX_THREAD *thread_ptr, */ +/** VOID **highest_stack); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_thread_stack_check: + PUSH {R3-R5,LR} + MOVS R4,R0 + MOVS R5,R1 + BL _tx_thread_interrupt_disable + CMP R4,#+0 + BEQ.N _tx_misra_thread_stack_check_0 + LDR R1,[R4, #+0] + LDR R2,=0x54485244 + CMP R1,R2 + BNE.N _tx_misra_thread_stack_check_0 + LDR R1,[R4, #+8] + LDR R2,[R5, #+0] + CMP R1,R2 + BCS.N _tx_misra_thread_stack_check_1 + LDR R1,[R4, #+8] + STR R1,[R5, #+0] +_tx_misra_thread_stack_check_1: + LDR R1,[R4, #+12] + LDR R1,[R1, #+0] + CMP R1,#-269488145 + BNE.N _tx_misra_thread_stack_check_2 + LDR R1,[R4, #+16] + LDR R1,[R1, #+1] + CMP R1,#-269488145 + BNE.N _tx_misra_thread_stack_check_2 + LDR R1,[R5, #+0] + LDR R2,[R4, #+12] + CMP R1,R2 + BCS.N _tx_misra_thread_stack_check_3 +_tx_misra_thread_stack_check_2: + BL _tx_thread_interrupt_restore + MOVS R0,R4 + BL _tx_thread_stack_error_handler + BL _tx_thread_interrupt_disable +_tx_misra_thread_stack_check_3: + LDR R1,[R5, #+0] + LDR R1,[R1, #-4] + CMP R1,#-269488145 + BEQ.N _tx_misra_thread_stack_check_0 + BL _tx_thread_interrupt_restore + MOVS R0,R4 + BL _tx_thread_stack_analyze + BL _tx_thread_interrupt_disable +_tx_misra_thread_stack_check_0: + BL _tx_thread_interrupt_restore + POP {R0,R4,R5,PC} // return + +#ifdef TX_ENABLE_EVENT_TRACE + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID _tx_misra_trace_event_insert(ULONG event_id, */ +/** VOID *info_field_1, ULONG info_field_2, ULONG info_field_3, */ +/** ULONG info_field_4, ULONG filter, ULONG time_stamp); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_trace_event_insert: + PUSH {R3-R7,LR} + LDR.N R4,DataTable2_1 + LDR R4,[R4, #+0] + CMP R4,#+0 + BEQ.N _tx_misra_trace_event_insert_0 + LDR.N R5,DataTable2_2 + LDR R5,[R5, #+0] + LDR R6,[SP, #+28] + TST R5,R6 + BEQ.N _tx_misra_trace_event_insert_0 + LDR.N R5,DataTable2_3 + LDR R5,[R5, #+0] + LDR.N R6,DataTable2_4 + LDR R6,[R6, #+0] + CMP R5,#+0 + BNE.N _tx_misra_trace_event_insert_1 + LDR R5,[R6, #+44] + LDR R7,[R6, #+60] + LSLS R7,R7,#+16 + ORRS R7,R7,#0x80000000 + ORRS R5,R7,R5 + B.N _tx_misra_trace_event_insert_2 +_tx_misra_trace_event_insert_1: + CMP R5,#-252645136 + BCS.N _tx_misra_trace_event_insert_3 + MOVS R5,R6 + MOVS R6,#-1 + B.N _tx_misra_trace_event_insert_2 +_tx_misra_trace_event_insert_3: + MOVS R6,#-252645136 + MOVS R5,#+0 +_tx_misra_trace_event_insert_2: + STR R6,[R4, #+0] + STR R5,[R4, #+4] + STR R0,[R4, #+8] + LDR R0,[SP, #+32] + STR R0,[R4, #+12] + STR R1,[R4, #+16] + STR R2,[R4, #+20] + STR R3,[R4, #+24] + LDR R0,[SP, #+24] + STR R0,[R4, #+28] + ADDS R4,R4,#+32 + LDR.N R0,DataTable2_5 + LDR R0,[R0, #+0] + CMP R4,R0 + BCC.N _tx_misra_trace_event_insert_4 + LDR.N R0,DataTable2_6 + LDR R4,[R0, #+0] + LDR.N R0,DataTable2_1 + STR R4,[R0, #+0] + LDR.N R0,DataTable2_7 + LDR R0,[R0, #+0] + STR R4,[R0, #+32] + LDR.N R0,DataTable2_8 + LDR R0,[R0, #+0] + CMP R0,#+0 + BEQ.N _tx_misra_trace_event_insert_0 + LDR.N R0,DataTable2_7 + LDR R0,[R0, #+0] + LDR.N R1,DataTable2_8 + LDR R1,[R1, #+0] + BLX R1 + B.N _tx_misra_trace_event_insert_0 +_tx_misra_trace_event_insert_4: + LDR.N R0,DataTable2_1 + STR R4,[R0, #+0] + LDR.N R0,DataTable2_7 + LDR R0,[R0, #+0] + STR R4,[R0, #+32] +_tx_misra_trace_event_insert_0: + POP {R0,R4-R7,PC} // return + + + .data +DataTable2_1: + .word _tx_trace_buffer_current_ptr + + .data +DataTable2_2: + .word _tx_trace_event_enable_bits + + .data +DataTable2_5: + .word _tx_trace_buffer_end_ptr + + .data +DataTable2_6: + .word _tx_trace_buffer_start_ptr + + .data +DataTable2_7: + .word _tx_trace_header_ptr + + .data +DataTable2_8: + .word _tx_trace_full_notify_function + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG _tx_misra_time_stamp_get(VOID); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_time_stamp_get: + MOVS R0,#+0 + BX LR // return + +#endif + + .data +DataTable2_3: + .word _tx_thread_system_state + + .data +DataTable2_4: + .word _tx_thread_current_ptr + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** UINT _tx_misra_always_true(void); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_always_true: + MOVS R0,#+1 + BX LR // return + + +/******************************************************************************************/ +/******************************************************************************************/ +/** */ +/** UCHAR **_tx_misra_indirect_void_to_uchar_pointer_convert(VOID **return_ptr); */ +/** */ +/******************************************************************************************/ +/******************************************************************************************/ + + .text + .thumb_func +_tx_misra_indirect_void_to_uchar_pointer_convert: + BX LR // return + + +/***************************************************************************************/ +/***************************************************************************************/ +/** */ +/** UCHAR **_tx_misra_uchar_to_indirect_uchar_pointer_convert(UCHAR *pointer); */ +/** */ +/***************************************************************************************/ +/***************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_indirect_uchar_pointer_convert: + BX LR // return + + +/***********************************************************************************/ +/***********************************************************************************/ +/** */ +/** UCHAR *_tx_misra_block_pool_to_uchar_pointer_convert(TX_BLOCK_POOL *pool); */ +/** */ +/***********************************************************************************/ +/***********************************************************************************/ + + .text + .thumb_func +_tx_misra_block_pool_to_uchar_pointer_convert: + BX LR // return + + +/******************************************************************************************/ +/******************************************************************************************/ +/** */ +/** TX_BLOCK_POOL *_tx_misra_void_to_block_pool_pointer_convert(VOID *pointer); */ +/** */ +/******************************************************************************************/ +/******************************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_block_pool_pointer_convert: + BX LR // return + + +/*****************************************************************************/ +/*****************************************************************************/ +/** */ +/** UCHAR *_tx_misra_void_to_uchar_pointer_convert(VOID *pointer); */ +/** */ +/*****************************************************************************/ +/*****************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_uchar_pointer_convert: + BX LR // return + + +/************************************************************************************/ +/************************************************************************************/ +/** */ +/** TX_BLOCK_POOL *_tx_misra_uchar_to_block_pool_pointer_convert(UCHAR *pointer); */ +/** */ +/************************************************************************************/ +/************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_block_pool_pointer_convert: + BX LR // return + + +/**************************************************************************************/ +/**************************************************************************************/ +/** */ +/** UCHAR **_tx_misra_void_to_indirect_uchar_pointer_convert(VOID *pointer); */ +/** */ +/**************************************************************************************/ +/**************************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_indirect_uchar_pointer_convert: + BX LR // return + + +/*****************************************************************************************/ +/*****************************************************************************************/ +/** */ +/** TX_BYTE_POOL *_tx_misra_void_to_byte_pool_pointer_convert(VOID *pointer); */ +/** */ +/*****************************************************************************************/ +/*****************************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_byte_pool_pointer_convert: + BX LR // return + + +/***************************************************************************************/ +/***************************************************************************************/ +/** */ +/** UCHAR *_tx_misra_byte_pool_to_uchar_pointer_convert(TX_BYTE_POOL *pool); */ +/** */ +/***************************************************************************************/ +/***************************************************************************************/ + + .text + .thumb_func +_tx_misra_byte_pool_to_uchar_pointer_convert: + BX LR // return + + +/*****************************************************************************************/ +/*****************************************************************************************/ +/** */ +/** ALIGN_TYPE *_tx_misra_uchar_to_align_type_pointer_convert(UCHAR *pointer); */ +/** */ +/*****************************************************************************************/ +/*****************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_align_type_pointer_convert: + BX LR // return + + +/****************************************************************************************************/ +/****************************************************************************************************/ +/** */ +/** TX_BYTE_POOL **_tx_misra_uchar_to_indirect_byte_pool_pointer_convert(UCHAR *pointer); */ +/** */ +/****************************************************************************************************/ +/****************************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_indirect_byte_pool_pointer_convert: + BX LR // return + + +/**************************************************************************************************/ +/**************************************************************************************************/ +/** */ +/** TX_EVENT_FLAGS_GROUP *_tx_misra_void_to_event_flags_pointer_convert(VOID *pointer); */ +/** */ +/**************************************************************************************************/ +/**************************************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_event_flags_pointer_convert: + BX LR // return + + +/*****************************************************************************/ +/*****************************************************************************/ +/** */ +/** ULONG *_tx_misra_void_to_ulong_pointer_convert(VOID *pointer); */ +/** */ +/*****************************************************************************/ +/*****************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_ulong_pointer_convert: + BX LR // return + + +/********************************************************************************/ +/********************************************************************************/ +/** */ +/** TX_MUTEX *_tx_misra_void_to_mutex_pointer_convert(VOID *pointer); */ +/** */ +/********************************************************************************/ +/********************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_mutex_pointer_convert: + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** UINT _tx_misra_status_get(UINT status); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_status_get: + MOVS R0,#+0 + BX LR // return + + +/********************************************************************************/ +/********************************************************************************/ +/** */ +/** TX_QUEUE *_tx_misra_void_to_queue_pointer_convert(VOID *pointer); */ +/** */ +/********************************************************************************/ +/********************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_queue_pointer_convert: + BX LR // return + + +/****************************************************************************************/ +/****************************************************************************************/ +/** */ +/** TX_SEMAPHORE *_tx_misra_void_to_semaphore_pointer_convert(VOID *pointer); */ +/** */ +/****************************************************************************************/ +/****************************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_semaphore_pointer_convert: + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID *_tx_misra_uchar_to_void_pointer_convert(UCHAR *pointer); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_void_pointer_convert: + BX LR // return + + +/*********************************************************************************/ +/*********************************************************************************/ +/** */ +/** TX_THREAD *_tx_misra_ulong_to_thread_pointer_convert(ULONG value); */ +/** */ +/*********************************************************************************/ +/*********************************************************************************/ + + .text + .thumb_func +_tx_misra_ulong_to_thread_pointer_convert: + BX LR // return + + +/***************************************************************************************************/ +/***************************************************************************************************/ +/** */ +/** VOID *_tx_misra_timer_indirect_to_void_pointer_convert(TX_TIMER_INTERNAL **pointer); */ +/** */ +/***************************************************************************************************/ +/***************************************************************************************************/ + + .text + .thumb_func +_tx_misra_timer_indirect_to_void_pointer_convert: + BX LR // return + + +/***************************************************************************************/ +/***************************************************************************************/ +/** */ +/** CHAR *_tx_misra_const_char_to_char_pointer_convert(const char *pointer); */ +/** */ +/***************************************************************************************/ +/***************************************************************************************/ + + .text + .thumb_func +_tx_misra_const_char_to_char_pointer_convert: + BX LR // return + + +/**********************************************************************************/ +/**********************************************************************************/ +/** */ +/** TX_THREAD *_tx_misra_void_to_thread_pointer_convert(void *pointer); */ +/** */ +/**********************************************************************************/ +/**********************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_thread_pointer_convert: + BX LR // return + + +#ifdef TX_ENABLE_EVENT_TRACE + +/************************************************************************************************/ +/************************************************************************************************/ +/** */ +/** UCHAR *_tx_misra_object_to_uchar_pointer_convert(TX_TRACE_OBJECT_ENTRY *pointer); */ +/** */ +/************************************************************************************************/ +/************************************************************************************************/ + + .text + .thumb_func +_tx_misra_object_to_uchar_pointer_convert: + BX LR // return + + +/************************************************************************************************/ +/************************************************************************************************/ +/** */ +/** TX_TRACE_OBJECT_ENTRY *_tx_misra_uchar_to_object_pointer_convert(UCHAR *pointer); */ +/** */ +/************************************************************************************************/ +/************************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_object_pointer_convert: + BX LR // return + + +/******************************************************************************************/ +/******************************************************************************************/ +/** */ +/** TX_TRACE_HEADER *_tx_misra_uchar_to_header_pointer_convert(UCHAR *pointer); */ +/** */ +/******************************************************************************************/ +/******************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_header_pointer_convert: + BX LR // return + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** TX_TRACE_BUFFER_ENTRY *_tx_misra_uchar_to_entry_pointer_convert(UCHAR *pointer); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_entry_pointer_convert: + BX LR // return + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** UCHAR *_tx_misra_entry_to_uchar_pointer_convert(TX_TRACE_BUFFER_ENTRY *pointer); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_entry_to_uchar_pointer_convert: + BX LR // return +#endif + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** UCHAR *_tx_misra_char_to_uchar_pointer_convert(CHAR *pointer); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_char_to_uchar_pointer_convert: + BX LR // return + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** ULONG _tx_misra_ipsr_get(void); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_ipsr_get: + MRS R0, IPSR + BX LR // return + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** ULONG _tx_misra_control_get(void); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_control_get: + MRS R0, CONTROL + BX LR // return + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** void _tx_misra_control_set(ULONG value); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_control_set: + MSR CONTROL, R0 + BX LR // return + + +#ifdef __ARM_FP + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** ULONG _tx_misra_fpccr_get(void); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_fpccr_get: + LDR r0, =0xE000EF34 // Build FPCCR address + LDR r0, [r0] // Load FPCCR value + BX LR // return + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** void _tx_misra_vfp_touch(void); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_vfp_touch: + vmov.f32 s0, s0 + BX LR // return + +#endif + + + .data + .word 0 diff --git a/ports/cortex_m7/ac6/src/tx_thread_schedule.S b/ports/cortex_m7/ac6/src/tx_thread_schedule.S index b8ca4f1b..e4a34ac8 100644 --- a/ports/cortex_m7/ac6/src/tx_thread_schedule.S +++ b/ports/cortex_m7/ac6/src/tx_thread_schedule.S @@ -39,7 +39,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_schedule Cortex-M7/AC6 */ -/* 6.1.7 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* Scott Larson, Microsoft Corporation */ @@ -66,13 +66,14 @@ /* */ /* _tx_initialize_kernel_enter ThreadX entry function */ /* _tx_thread_system_return Return to system from thread */ -/* _tx_thread_context_restore Restore thread's context */ /* */ /* RELEASE HISTORY */ /* */ /* DATE NAME DESCRIPTION */ /* */ /* 06-02-2021 Scott Larson Initial Version 6.1.7 */ +/* 04-25-2022 Scott Larson Added BASEPRI support, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_schedule(VOID) @@ -132,12 +133,22 @@ __tx_ts_handler: #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) /* Call the thread exit function to indicate the thread is no longer executing. */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ PUSH {r0, lr} // Save LR (and r0 just for alignment) BL _tx_execution_thread_exit // Call the thread exit function POP {r0, lr} // Recover LR +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts -#endif +#endif /* TX_PORT_USE_BASEPRI */ +#endif /* EXECUTION PROFILE */ LDR r0, =_tx_thread_current_ptr // Build current thread pointer address LDR r2, =_tx_thread_execute_ptr // Build execute thread pointer address @@ -182,14 +193,24 @@ __tx_ts_new: /* Now we are looking for a new thread to execute! */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Is there another thread ready to execute? CBZ r1, __tx_ts_wait // No, skip to the wait processing /* Yes, another thread is ready for else, make the current thread the new thread. */ STR r1, [r0] // Setup the current thread pointer to the new thread +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif /* Increment the thread run count. */ @@ -233,7 +254,12 @@ _skip_vfp_restore: are disabled to allow use of WFI for waiting for a thread to arrive. */ __tx_ts_wait: +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Pickup the next thread to execute pointer STR r1, [r0] // Store it in the current pointer CBNZ r1, __tx_ts_ready // If non-NULL, a new thread is ready! @@ -256,7 +282,12 @@ __tx_ts_wait: POP {r0-r3} #endif +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_wait // Loop to continue waiting /* At this point, we have a new thread ready to go. Clear any newly pended PendSV - since we are @@ -268,8 +299,12 @@ __tx_ts_ready: STR r7, [r8, #0xD04] // Clear any PendSV /* Re-enable interrupts and restore new thread. */ - +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_restore // Restore the thread // } diff --git a/ports/cortex_m7/gnu/inc/tx_port.h b/ports/cortex_m7/gnu/inc/tx_port.h index 1c351bb8..9a88b1d8 100644 --- a/ports/cortex_m7/gnu/inc/tx_port.h +++ b/ports/cortex_m7/gnu/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M7/GNU */ -/* 6.1.10 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -56,6 +56,9 @@ /* violation, */ /* fixed predefined macro, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -154,14 +157,14 @@ typedef unsigned short USHORT; For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_MISRA_ENABLE #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #else ULONG _tx_misra_time_stamp_get(VOID); @@ -378,7 +381,7 @@ void _tx_vfp_access(void); else \ { \ ULONG _tx_fpccr; \ - _tx_fpccr = *((ULONG *) 0xE000EF34); \ + _tx_fpccr = *((volatile ULONG *) 0xE000EF34); \ _tx_fpccr = _tx_fpccr & ((ULONG) 0x01); \ if (_tx_fpccr == ((ULONG) 0x01)) \ { \ @@ -582,7 +585,7 @@ __attribute__( ( always_inline ) ) static inline void _tx_thread_system_return_i unsigned int interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (__get_ipsr_value() == 0) { interrupt_save = __get_interrupt_posture(); @@ -651,7 +654,7 @@ static void _tx_thread_system_return_inline(void) unsigned int interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (_ipsr == 0) { #ifdef TX_PORT_USE_BASEPRI @@ -704,7 +707,7 @@ void tx_thread_fpu_disable(void); #ifdef TX_THREAD_INIT CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M7/GNU Version 6.1.9 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M7/GNU Version 6.1.11 *"; #else #ifdef TX_MISRA_ENABLE extern CHAR _tx_version_id[100]; diff --git a/ports/cortex_m7/gnu/src/tx_misra.S b/ports/cortex_m7/gnu/src/tx_misra.S new file mode 100644 index 00000000..b03fdcd0 --- /dev/null +++ b/ports/cortex_m7/gnu/src/tx_misra.S @@ -0,0 +1,1033 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ThreadX Component */ +/** */ +/** ThreadX MISRA Compliance */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + #define SHT_PROGBITS 0x1 + + .global __aeabi_memset + .global _tx_thread_current_ptr + .global _tx_thread_interrupt_disable + .global _tx_thread_interrupt_restore + .global _tx_thread_stack_analyze + .global _tx_thread_stack_error_handler + .global _tx_thread_system_state +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_trace_buffer_current_ptr + .global _tx_trace_buffer_end_ptr + .global _tx_trace_buffer_start_ptr + .global _tx_trace_event_enable_bits + .global _tx_trace_full_notify_function + .global _tx_trace_header_ptr +#endif + + .global _tx_misra_always_true + .global _tx_misra_block_pool_to_uchar_pointer_convert + .global _tx_misra_byte_pool_to_uchar_pointer_convert + .global _tx_misra_char_to_uchar_pointer_convert + .global _tx_misra_const_char_to_char_pointer_convert +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_misra_entry_to_uchar_pointer_convert +#endif + .global _tx_misra_indirect_void_to_uchar_pointer_convert + .global _tx_misra_memset + .global _tx_misra_message_copy +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_misra_object_to_uchar_pointer_convert +#endif + .global _tx_misra_pointer_to_ulong_convert + .global _tx_misra_status_get + .global _tx_misra_thread_stack_check +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_misra_time_stamp_get +#endif + .global _tx_misra_timer_indirect_to_void_pointer_convert + .global _tx_misra_timer_pointer_add + .global _tx_misra_timer_pointer_dif +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_misra_trace_event_insert +#endif + .global _tx_misra_uchar_pointer_add + .global _tx_misra_uchar_pointer_dif + .global _tx_misra_uchar_pointer_sub + .global _tx_misra_uchar_to_align_type_pointer_convert + .global _tx_misra_uchar_to_block_pool_pointer_convert +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_misra_uchar_to_entry_pointer_convert + .global _tx_misra_uchar_to_header_pointer_convert +#endif + .global _tx_misra_uchar_to_indirect_byte_pool_pointer_convert + .global _tx_misra_uchar_to_indirect_uchar_pointer_convert +#ifdef TX_ENABLE_EVENT_TRACE + .global _tx_misra_uchar_to_object_pointer_convert +#endif + .global _tx_misra_uchar_to_void_pointer_convert + .global _tx_misra_ulong_pointer_add + .global _tx_misra_ulong_pointer_dif + .global _tx_misra_ulong_pointer_sub + .global _tx_misra_ulong_to_pointer_convert + .global _tx_misra_ulong_to_thread_pointer_convert + .global _tx_misra_user_timer_pointer_get + .global _tx_misra_void_to_block_pool_pointer_convert + .global _tx_misra_void_to_byte_pool_pointer_convert + .global _tx_misra_void_to_event_flags_pointer_convert + .global _tx_misra_void_to_indirect_uchar_pointer_convert + .global _tx_misra_void_to_mutex_pointer_convert + .global _tx_misra_void_to_queue_pointer_convert + .global _tx_misra_void_to_semaphore_pointer_convert + .global _tx_misra_void_to_thread_pointer_convert + .global _tx_misra_void_to_uchar_pointer_convert + .global _tx_misra_void_to_ulong_pointer_convert + .global _tx_misra_ipsr_get + .global _tx_misra_control_get + .global _tx_misra_control_set +#ifdef __ARM_FP + .global _tx_misra_fpccr_get + .global _tx_misra_vfp_touch +#endif + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID _tx_misra_memset(VOID *ptr, UINT value, UINT size); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .align 4 + .syntax unified + .thumb_func +_tx_misra_memset: + PUSH {R4,LR} + MOVS R4,R0 + MOVS R0,R2 + MOVS R2,R1 + MOVS R1,R0 + MOVS R0,R4 + BL __aeabi_memset + POP {R4,PC} // return + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** UCHAR *_tx_misra_uchar_pointer_add(UCHAR *ptr, ULONG amount); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_pointer_add: + ADD R0,R0,R1 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** UCHAR *_tx_misra_uchar_pointer_sub(UCHAR *ptr, ULONG amount); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_pointer_sub: + RSBS R1,R1,#+0 + ADD R0,R0,R1 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG _tx_misra_uchar_pointer_dif(UCHAR *ptr1, UCHAR *ptr2); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_pointer_dif: + SUBS R0,R0,R1 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG _tx_misra_pointer_to_ulong_convert(VOID *ptr); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_pointer_to_ulong_convert: + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG *_tx_misra_ulong_pointer_add(ULONG *ptr, ULONG amount); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_ulong_pointer_add: + ADD R0,R0,R1, LSL #+2 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG *_tx_misra_ulong_pointer_sub(ULONG *ptr, ULONG amount); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_ulong_pointer_sub: + MVNS R2,#+3 + MULS R1,R2,R1 + ADD R0,R0,R1 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG _tx_misra_ulong_pointer_dif(ULONG *ptr1, ULONG *ptr2); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_ulong_pointer_dif: + SUBS R0,R0,R1 + ASRS R0,R0,#+2 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID *_tx_misra_ulong_to_pointer_convert(ULONG input); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_ulong_to_pointer_convert: + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID _tx_misra_message_copy(ULONG **source, ULONG **destination, */ +/** UINT size); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_message_copy: + PUSH {R4,R5} + LDR R3,[R0, #+0] + LDR R4,[R1, #+0] + LDR R5,[R3, #+0] + STR R5,[R4, #+0] + ADDS R4,R4,#+4 + ADDS R3,R3,#+4 + CMP R2,#+2 + BCC.N _tx_misra_message_copy_0 + SUBS R2,R2,#+1 + B.N _tx_misra_message_copy_1 +_tx_misra_message_copy_2: + LDR R5,[R3, #+0] + STR R5,[R4, #+0] + ADDS R4,R4,#+4 + ADDS R3,R3,#+4 + SUBS R2,R2,#+1 +_tx_misra_message_copy_1: + CMP R2,#+0 + BNE.N _tx_misra_message_copy_2 +_tx_misra_message_copy_0: + STR R3,[R0, #+0] + STR R4,[R1, #+0] + POP {R4,R5} + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG _tx_misra_timer_pointer_dif(TX_TIMER_INTERNAL **ptr1, */ +/** TX_TIMER_INTERNAL **ptr2); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_timer_pointer_dif: + SUBS R0,R0,R1 + ASRS R0,R0,#+2 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** TX_TIMER_INTERNAL **_tx_misra_timer_pointer_add(TX_TIMER_INTERNAL */ +/** **ptr1, ULONG size); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_timer_pointer_add: + ADD R0,R0,R1, LSL #+2 + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID _tx_misra_user_timer_pointer_get(TX_TIMER_INTERNAL */ +/** *internal_timer, TX_TIMER **user_timer); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_user_timer_pointer_get: + ADDS R2,R0,#+8 + SUBS R2,R2,R0 + RSBS R2,R2,#+0 + ADD R0,R0,R2 + STR R0,[R1, #+0] + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID _tx_misra_thread_stack_check(TX_THREAD *thread_ptr, */ +/** VOID **highest_stack); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_thread_stack_check: + PUSH {R3-R5,LR} + MOVS R4,R0 + MOVS R5,R1 + BL _tx_thread_interrupt_disable + CMP R4,#+0 + BEQ.N _tx_misra_thread_stack_check_0 + LDR R1,[R4, #+0] + LDR R2,=0x54485244 + CMP R1,R2 + BNE.N _tx_misra_thread_stack_check_0 + LDR R1,[R4, #+8] + LDR R2,[R5, #+0] + CMP R1,R2 + BCS.N _tx_misra_thread_stack_check_1 + LDR R1,[R4, #+8] + STR R1,[R5, #+0] +_tx_misra_thread_stack_check_1: + LDR R1,[R4, #+12] + LDR R1,[R1, #+0] + CMP R1,#-269488145 + BNE.N _tx_misra_thread_stack_check_2 + LDR R1,[R4, #+16] + LDR R1,[R1, #+1] + CMP R1,#-269488145 + BNE.N _tx_misra_thread_stack_check_2 + LDR R1,[R5, #+0] + LDR R2,[R4, #+12] + CMP R1,R2 + BCS.N _tx_misra_thread_stack_check_3 +_tx_misra_thread_stack_check_2: + BL _tx_thread_interrupt_restore + MOVS R0,R4 + BL _tx_thread_stack_error_handler + BL _tx_thread_interrupt_disable +_tx_misra_thread_stack_check_3: + LDR R1,[R5, #+0] + LDR R1,[R1, #-4] + CMP R1,#-269488145 + BEQ.N _tx_misra_thread_stack_check_0 + BL _tx_thread_interrupt_restore + MOVS R0,R4 + BL _tx_thread_stack_analyze + BL _tx_thread_interrupt_disable +_tx_misra_thread_stack_check_0: + BL _tx_thread_interrupt_restore + POP {R0,R4,R5,PC} // return + +#ifdef TX_ENABLE_EVENT_TRACE + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID _tx_misra_trace_event_insert(ULONG event_id, */ +/** VOID *info_field_1, ULONG info_field_2, ULONG info_field_3, */ +/** ULONG info_field_4, ULONG filter, ULONG time_stamp); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_trace_event_insert: + PUSH {R3-R7,LR} + LDR.N R4,DataTable2_1 + LDR R4,[R4, #+0] + CMP R4,#+0 + BEQ.N _tx_misra_trace_event_insert_0 + LDR.N R5,DataTable2_2 + LDR R5,[R5, #+0] + LDR R6,[SP, #+28] + TST R5,R6 + BEQ.N _tx_misra_trace_event_insert_0 + LDR.N R5,DataTable2_3 + LDR R5,[R5, #+0] + LDR.N R6,DataTable2_4 + LDR R6,[R6, #+0] + CMP R5,#+0 + BNE.N _tx_misra_trace_event_insert_1 + LDR R5,[R6, #+44] + LDR R7,[R6, #+60] + LSLS R7,R7,#+16 + ORRS R7,R7,#0x80000000 + ORRS R5,R7,R5 + B.N _tx_misra_trace_event_insert_2 +_tx_misra_trace_event_insert_1: + CMP R5,#-252645136 + BCS.N _tx_misra_trace_event_insert_3 + MOVS R5,R6 + MOVS R6,#-1 + B.N _tx_misra_trace_event_insert_2 +_tx_misra_trace_event_insert_3: + MOVS R6,#-252645136 + MOVS R5,#+0 +_tx_misra_trace_event_insert_2: + STR R6,[R4, #+0] + STR R5,[R4, #+4] + STR R0,[R4, #+8] + LDR R0,[SP, #+32] + STR R0,[R4, #+12] + STR R1,[R4, #+16] + STR R2,[R4, #+20] + STR R3,[R4, #+24] + LDR R0,[SP, #+24] + STR R0,[R4, #+28] + ADDS R4,R4,#+32 + LDR.N R0,DataTable2_5 + LDR R0,[R0, #+0] + CMP R4,R0 + BCC.N _tx_misra_trace_event_insert_4 + LDR.N R0,DataTable2_6 + LDR R4,[R0, #+0] + LDR.N R0,DataTable2_1 + STR R4,[R0, #+0] + LDR.N R0,DataTable2_7 + LDR R0,[R0, #+0] + STR R4,[R0, #+32] + LDR.N R0,DataTable2_8 + LDR R0,[R0, #+0] + CMP R0,#+0 + BEQ.N _tx_misra_trace_event_insert_0 + LDR.N R0,DataTable2_7 + LDR R0,[R0, #+0] + LDR.N R1,DataTable2_8 + LDR R1,[R1, #+0] + BLX R1 + B.N _tx_misra_trace_event_insert_0 +_tx_misra_trace_event_insert_4: + LDR.N R0,DataTable2_1 + STR R4,[R0, #+0] + LDR.N R0,DataTable2_7 + LDR R0,[R0, #+0] + STR R4,[R0, #+32] +_tx_misra_trace_event_insert_0: + POP {R0,R4-R7,PC} // return + + + .data +DataTable2_1: + .word _tx_trace_buffer_current_ptr + + .data +DataTable2_2: + .word _tx_trace_event_enable_bits + + .data +DataTable2_5: + .word _tx_trace_buffer_end_ptr + + .data +DataTable2_6: + .word _tx_trace_buffer_start_ptr + + .data +DataTable2_7: + .word _tx_trace_header_ptr + + .data +DataTable2_8: + .word _tx_trace_full_notify_function + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** ULONG _tx_misra_time_stamp_get(VOID); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_time_stamp_get: + MOVS R0,#+0 + BX LR // return + +#endif + + .data +DataTable2_3: + .word _tx_thread_system_state + + .data +DataTable2_4: + .word _tx_thread_current_ptr + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** UINT _tx_misra_always_true(void); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_always_true: + MOVS R0,#+1 + BX LR // return + + +/******************************************************************************************/ +/******************************************************************************************/ +/** */ +/** UCHAR **_tx_misra_indirect_void_to_uchar_pointer_convert(VOID **return_ptr); */ +/** */ +/******************************************************************************************/ +/******************************************************************************************/ + + .text + .thumb_func +_tx_misra_indirect_void_to_uchar_pointer_convert: + BX LR // return + + +/***************************************************************************************/ +/***************************************************************************************/ +/** */ +/** UCHAR **_tx_misra_uchar_to_indirect_uchar_pointer_convert(UCHAR *pointer); */ +/** */ +/***************************************************************************************/ +/***************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_indirect_uchar_pointer_convert: + BX LR // return + + +/***********************************************************************************/ +/***********************************************************************************/ +/** */ +/** UCHAR *_tx_misra_block_pool_to_uchar_pointer_convert(TX_BLOCK_POOL *pool); */ +/** */ +/***********************************************************************************/ +/***********************************************************************************/ + + .text + .thumb_func +_tx_misra_block_pool_to_uchar_pointer_convert: + BX LR // return + + +/******************************************************************************************/ +/******************************************************************************************/ +/** */ +/** TX_BLOCK_POOL *_tx_misra_void_to_block_pool_pointer_convert(VOID *pointer); */ +/** */ +/******************************************************************************************/ +/******************************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_block_pool_pointer_convert: + BX LR // return + + +/*****************************************************************************/ +/*****************************************************************************/ +/** */ +/** UCHAR *_tx_misra_void_to_uchar_pointer_convert(VOID *pointer); */ +/** */ +/*****************************************************************************/ +/*****************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_uchar_pointer_convert: + BX LR // return + + +/************************************************************************************/ +/************************************************************************************/ +/** */ +/** TX_BLOCK_POOL *_tx_misra_uchar_to_block_pool_pointer_convert(UCHAR *pointer); */ +/** */ +/************************************************************************************/ +/************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_block_pool_pointer_convert: + BX LR // return + + +/**************************************************************************************/ +/**************************************************************************************/ +/** */ +/** UCHAR **_tx_misra_void_to_indirect_uchar_pointer_convert(VOID *pointer); */ +/** */ +/**************************************************************************************/ +/**************************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_indirect_uchar_pointer_convert: + BX LR // return + + +/*****************************************************************************************/ +/*****************************************************************************************/ +/** */ +/** TX_BYTE_POOL *_tx_misra_void_to_byte_pool_pointer_convert(VOID *pointer); */ +/** */ +/*****************************************************************************************/ +/*****************************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_byte_pool_pointer_convert: + BX LR // return + + +/***************************************************************************************/ +/***************************************************************************************/ +/** */ +/** UCHAR *_tx_misra_byte_pool_to_uchar_pointer_convert(TX_BYTE_POOL *pool); */ +/** */ +/***************************************************************************************/ +/***************************************************************************************/ + + .text + .thumb_func +_tx_misra_byte_pool_to_uchar_pointer_convert: + BX LR // return + + +/*****************************************************************************************/ +/*****************************************************************************************/ +/** */ +/** ALIGN_TYPE *_tx_misra_uchar_to_align_type_pointer_convert(UCHAR *pointer); */ +/** */ +/*****************************************************************************************/ +/*****************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_align_type_pointer_convert: + BX LR // return + + +/****************************************************************************************************/ +/****************************************************************************************************/ +/** */ +/** TX_BYTE_POOL **_tx_misra_uchar_to_indirect_byte_pool_pointer_convert(UCHAR *pointer); */ +/** */ +/****************************************************************************************************/ +/****************************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_indirect_byte_pool_pointer_convert: + BX LR // return + + +/**************************************************************************************************/ +/**************************************************************************************************/ +/** */ +/** TX_EVENT_FLAGS_GROUP *_tx_misra_void_to_event_flags_pointer_convert(VOID *pointer); */ +/** */ +/**************************************************************************************************/ +/**************************************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_event_flags_pointer_convert: + BX LR // return + + +/*****************************************************************************/ +/*****************************************************************************/ +/** */ +/** ULONG *_tx_misra_void_to_ulong_pointer_convert(VOID *pointer); */ +/** */ +/*****************************************************************************/ +/*****************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_ulong_pointer_convert: + BX LR // return + + +/********************************************************************************/ +/********************************************************************************/ +/** */ +/** TX_MUTEX *_tx_misra_void_to_mutex_pointer_convert(VOID *pointer); */ +/** */ +/********************************************************************************/ +/********************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_mutex_pointer_convert: + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** UINT _tx_misra_status_get(UINT status); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_status_get: + MOVS R0,#+0 + BX LR // return + + +/********************************************************************************/ +/********************************************************************************/ +/** */ +/** TX_QUEUE *_tx_misra_void_to_queue_pointer_convert(VOID *pointer); */ +/** */ +/********************************************************************************/ +/********************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_queue_pointer_convert: + BX LR // return + + +/****************************************************************************************/ +/****************************************************************************************/ +/** */ +/** TX_SEMAPHORE *_tx_misra_void_to_semaphore_pointer_convert(VOID *pointer); */ +/** */ +/****************************************************************************************/ +/****************************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_semaphore_pointer_convert: + BX LR // return + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** VOID *_tx_misra_uchar_to_void_pointer_convert(UCHAR *pointer); */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_void_pointer_convert: + BX LR // return + + +/*********************************************************************************/ +/*********************************************************************************/ +/** */ +/** TX_THREAD *_tx_misra_ulong_to_thread_pointer_convert(ULONG value); */ +/** */ +/*********************************************************************************/ +/*********************************************************************************/ + + .text + .thumb_func +_tx_misra_ulong_to_thread_pointer_convert: + BX LR // return + + +/***************************************************************************************************/ +/***************************************************************************************************/ +/** */ +/** VOID *_tx_misra_timer_indirect_to_void_pointer_convert(TX_TIMER_INTERNAL **pointer); */ +/** */ +/***************************************************************************************************/ +/***************************************************************************************************/ + + .text + .thumb_func +_tx_misra_timer_indirect_to_void_pointer_convert: + BX LR // return + + +/***************************************************************************************/ +/***************************************************************************************/ +/** */ +/** CHAR *_tx_misra_const_char_to_char_pointer_convert(const char *pointer); */ +/** */ +/***************************************************************************************/ +/***************************************************************************************/ + + .text + .thumb_func +_tx_misra_const_char_to_char_pointer_convert: + BX LR // return + + +/**********************************************************************************/ +/**********************************************************************************/ +/** */ +/** TX_THREAD *_tx_misra_void_to_thread_pointer_convert(void *pointer); */ +/** */ +/**********************************************************************************/ +/**********************************************************************************/ + + .text + .thumb_func +_tx_misra_void_to_thread_pointer_convert: + BX LR // return + + +#ifdef TX_ENABLE_EVENT_TRACE + +/************************************************************************************************/ +/************************************************************************************************/ +/** */ +/** UCHAR *_tx_misra_object_to_uchar_pointer_convert(TX_TRACE_OBJECT_ENTRY *pointer); */ +/** */ +/************************************************************************************************/ +/************************************************************************************************/ + + .text + .thumb_func +_tx_misra_object_to_uchar_pointer_convert: + BX LR // return + + +/************************************************************************************************/ +/************************************************************************************************/ +/** */ +/** TX_TRACE_OBJECT_ENTRY *_tx_misra_uchar_to_object_pointer_convert(UCHAR *pointer); */ +/** */ +/************************************************************************************************/ +/************************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_object_pointer_convert: + BX LR // return + + +/******************************************************************************************/ +/******************************************************************************************/ +/** */ +/** TX_TRACE_HEADER *_tx_misra_uchar_to_header_pointer_convert(UCHAR *pointer); */ +/** */ +/******************************************************************************************/ +/******************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_header_pointer_convert: + BX LR // return + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** TX_TRACE_BUFFER_ENTRY *_tx_misra_uchar_to_entry_pointer_convert(UCHAR *pointer); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_uchar_to_entry_pointer_convert: + BX LR // return + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** UCHAR *_tx_misra_entry_to_uchar_pointer_convert(TX_TRACE_BUFFER_ENTRY *pointer); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_entry_to_uchar_pointer_convert: + BX LR // return +#endif + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** UCHAR *_tx_misra_char_to_uchar_pointer_convert(CHAR *pointer); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_char_to_uchar_pointer_convert: + BX LR // return + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** ULONG _tx_misra_ipsr_get(void); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_ipsr_get: + MRS R0, IPSR + BX LR // return + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** ULONG _tx_misra_control_get(void); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_control_get: + MRS R0, CONTROL + BX LR // return + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** void _tx_misra_control_set(ULONG value); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_control_set: + MSR CONTROL, R0 + BX LR // return + + +#ifdef __ARM_FP + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** ULONG _tx_misra_fpccr_get(void); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_fpccr_get: + LDR r0, =0xE000EF34 // Build FPCCR address + LDR r0, [r0] // Load FPCCR value + BX LR // return + + +/***********************************************************************************************/ +/***********************************************************************************************/ +/** */ +/** void _tx_misra_vfp_touch(void); */ +/** */ +/***********************************************************************************************/ +/***********************************************************************************************/ + + .text + .thumb_func +_tx_misra_vfp_touch: + vmov.f32 s0, s0 + BX LR // return + +#endif + + + .data + .word 0 diff --git a/ports/cortex_m7/gnu/src/tx_thread_schedule.S b/ports/cortex_m7/gnu/src/tx_thread_schedule.S index f75bff29..12343ad4 100644 --- a/ports/cortex_m7/gnu/src/tx_thread_schedule.S +++ b/ports/cortex_m7/gnu/src/tx_thread_schedule.S @@ -37,7 +37,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_schedule Cortex-M7/GNU */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* Scott Larson, Microsoft Corporation */ @@ -72,6 +72,8 @@ /* 06-02-2021 Scott Larson Initial Version 6.1.7 */ /* 01-31-2022 Scott Larson Fixed predefined macro name, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 Scott Larson Added BASEPRI support, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_schedule(VOID) @@ -131,12 +133,22 @@ __tx_ts_handler: #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) /* Call the thread exit function to indicate the thread is no longer executing. */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ PUSH {r0, lr} // Save LR (and r0 just for alignment) BL _tx_execution_thread_exit // Call the thread exit function POP {r0, lr} // Recover LR +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts -#endif +#endif /* TX_PORT_USE_BASEPRI */ +#endif /* EXECUTION PROFILE */ LDR r0, =_tx_thread_current_ptr // Build current thread pointer address LDR r2, =_tx_thread_execute_ptr // Build execute thread pointer address @@ -181,14 +193,24 @@ __tx_ts_new: /* Now we are looking for a new thread to execute! */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Is there another thread ready to execute? CBZ r1, __tx_ts_wait // No, skip to the wait processing /* Yes, another thread is ready for else, make the current thread the new thread. */ STR r1, [r0] // Setup the current thread pointer to the new thread +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif /* Increment the thread run count. */ @@ -232,7 +254,12 @@ _skip_vfp_restore: are disabled to allow use of WFI for waiting for a thread to arrive. */ __tx_ts_wait: +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Pickup the next thread to execute pointer STR r1, [r0] // Store it in the current pointer CBNZ r1, __tx_ts_ready // If non-NULL, a new thread is ready! @@ -255,7 +282,12 @@ __tx_ts_wait: POP {r0-r3} #endif +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_wait // Loop to continue waiting /* At this point, we have a new thread ready to go. Clear any newly pended PendSV - since we are @@ -267,8 +299,12 @@ __tx_ts_ready: STR r7, [r8, #0xD04] // Clear any PendSV /* Re-enable interrupts and restore new thread. */ - +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_restore // Restore the thread // } diff --git a/ports/cortex_m7/iar/inc/tx_port.h b/ports/cortex_m7/iar/inc/tx_port.h index f5a144cd..f11ff9a9 100644 --- a/ports/cortex_m7/iar/inc/tx_port.h +++ b/ports/cortex_m7/iar/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M7/IAR */ -/* 6.1.10 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -56,6 +56,9 @@ /* violation, */ /* fixed predefined macro, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -154,14 +157,14 @@ typedef unsigned short USHORT; For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_MISRA_ENABLE #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #else ULONG _tx_misra_time_stamp_get(VOID); @@ -378,7 +381,7 @@ void _tx_vfp_access(void); else \ { \ ULONG _tx_fpccr; \ - _tx_fpccr = *((ULONG *) 0xE000EF34); \ + _tx_fpccr = *((volatile ULONG *) 0xE000EF34); \ _tx_fpccr = _tx_fpccr & ((ULONG) 0x01); \ if (_tx_fpccr == ((ULONG) 0x01)) \ { \ @@ -582,7 +585,7 @@ __attribute__( ( always_inline ) ) static inline void _tx_thread_system_return_i unsigned int interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (__get_ipsr_value() == 0) { interrupt_save = __get_interrupt_posture(); @@ -651,7 +654,7 @@ static void _tx_thread_system_return_inline(void) unsigned int interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (_ipsr == 0) { #ifdef TX_PORT_USE_BASEPRI @@ -704,7 +707,7 @@ void tx_thread_fpu_disable(void); #ifdef TX_THREAD_INIT CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M7/IAR Version 6.1.9 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M7/IAR Version 6.1.11 *"; #else #ifdef TX_MISRA_ENABLE extern CHAR _tx_version_id[100]; diff --git a/ports/cortex_m7/iar/src/tx_thread_schedule.s b/ports/cortex_m7/iar/src/tx_thread_schedule.s index 65893cb8..954c36fc 100644 --- a/ports/cortex_m7/iar/src/tx_thread_schedule.s +++ b/ports/cortex_m7/iar/src/tx_thread_schedule.s @@ -37,7 +37,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_schedule Cortex-M7/IAR */ -/* 6.1.7 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* Scott Larson, Microsoft Corporation */ @@ -64,13 +64,14 @@ /* */ /* _tx_initialize_kernel_enter ThreadX entry function */ /* _tx_thread_system_return Return to system from thread */ -/* _tx_thread_context_restore Restore thread's context */ /* */ /* RELEASE HISTORY */ /* */ /* DATE NAME DESCRIPTION */ /* */ /* 06-02-2021 Scott Larson Initial Version 6.1.7 */ +/* 04-25-2022 Scott Larson Added BASEPRI support, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_schedule(VOID) @@ -126,12 +127,22 @@ __tx_ts_handler: #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) /* Call the thread exit function to indicate the thread is no longer executing. */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ PUSH {r0, lr} // Save LR (and r0 just for alignment) BL _tx_execution_thread_exit // Call the thread exit function POP {r0, lr} // Recover LR +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts -#endif +#endif /* TX_PORT_USE_BASEPRI */ +#endif /* EXECUTION PROFILE */ LDR r0, =_tx_thread_current_ptr // Build current thread pointer address LDR r2, =_tx_thread_execute_ptr // Build execute thread pointer address @@ -176,14 +187,24 @@ __tx_ts_new: /* Now we are looking for a new thread to execute! */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Is there another thread ready to execute? CBZ r1, __tx_ts_wait // No, skip to the wait processing /* Yes, another thread is ready for else, make the current thread the new thread. */ STR r1, [r0] // Setup the current thread pointer to the new thread +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif /* Increment the thread run count. */ @@ -227,7 +248,12 @@ _skip_vfp_restore: are disabled to allow use of WFI for waiting for a thread to arrive. */ __tx_ts_wait: +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Pickup the next thread to execute pointer STR r1, [r0] // Store it in the current pointer CBNZ r1, __tx_ts_ready // If non-NULL, a new thread is ready! @@ -250,7 +276,12 @@ __tx_ts_wait: POP {r0-r3} #endif +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_wait // Loop to continue waiting /* At this point, we have a new thread ready to go. Clear any newly pended PendSV - since we are @@ -262,8 +293,12 @@ __tx_ts_ready: STR r7, [r8, #0xD04] // Clear any PendSV /* Re-enable interrupts and restore new thread. */ - +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_restore // Restore the thread // } diff --git a/ports/linux/gnu/inc/tx_port.h b/ports/linux/gnu/inc/tx_port.h index 2202dbda..024b12bd 100644 --- a/ports/linux/gnu/inc/tx_port.h +++ b/ports/linux/gnu/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Linux/GNU */ -/* 6.1.9 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -51,6 +51,9 @@ /* 10-15-2021 William E. Lamie Modified comment(s), added */ /* symbol ULONG64_DEFINED, */ /* resulting in version 6.1.9 */ +/* 04-25-2022 William E. Lamie Modified comment(s), removed */ +/* useless definition, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -566,8 +569,6 @@ void _tx_linux_thread_init(); #define TX_LINUX_MEMORY_SIZE 64000 #endif -#define TX_TIMER_TICKS_PER_SECOND 100UL - /* Define priorities of pthreads. */ #define TX_LINUX_PRIORITY_SCHEDULE (3) diff --git a/ports/xtensa/xcc/src/tx_initialize_low_level.c b/ports/xtensa/xcc/src/tx_initialize_low_level.c index d7082db0..eebae217 100644 --- a/ports/xtensa/xcc/src/tx_initialize_low_level.c +++ b/ports/xtensa/xcc/src/tx_initialize_low_level.c @@ -52,7 +52,10 @@ int32_t xt_timer_intnum = -1; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 12-31-2020 Cadence Design Systems Initial Version 6.1.3 */ +/* 12-31-2020 Cadence Design Systems Initial Version 6.1.3 */ +/* 04-25-2022 Scott Larson Modified comments and updated */ +/* function names, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ VOID _tx_initialize_low_level(VOID) @@ -154,14 +157,14 @@ VOID _tx_initialize_low_level(VOID) /* Compute tick divisor if clock freq is not compile-time constant. */ #ifndef XT_CLOCK_FREQ - _xt_tick_divisor_init(); + xt_tick_divisor_init(); #endif /* Set up the periodic tick timer (assume enough time to complete init). */ #ifdef XT_CLOCK_FREQ XT_WSR_CCOMPARE(XT_RSR_CCOUNT() + XT_TICK_DIVISOR); #else - XT_WSR_CCOMPARE(XT_RSR_CCOUNT() + _xt_tick_divisor); + XT_WSR_CCOMPARE(XT_RSR_CCOUNT() + xt_tick_divisor); #endif #if XCHAL_HAVE_XEA3 diff --git a/ports/xtensa/xcc/src/tx_timer_interrupt.S b/ports/xtensa/xcc/src/tx_timer_interrupt.S index 6fcc5d36..2953f996 100644 --- a/ports/xtensa/xcc/src/tx_timer_interrupt.S +++ b/ports/xtensa/xcc/src/tx_timer_interrupt.S @@ -64,7 +64,10 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 12-31-2020 Cadence Design Systems Initial Version 6.1.3 */ +/* 12-31-2020 Cadence Design Systems Initial Version 6.1.3 */ +/* 04-25-2022 Scott Larson Modified comments and updated */ +/* function name, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -128,7 +131,7 @@ _tx_timer_interrupt: #ifdef XT_CLOCK_FREQ movi a2, XT_TICK_DIVISOR /* a2 = comparator increment */ #else - movi a3, _xt_tick_divisor + movi a3, xt_tick_divisor l32i a2, a3, 0 /* a2 = comparator increment */ #endif rsr a3, XT_CCOMPARE /* a3 = old comparator value */ diff --git a/ports/xtensa/xcc/src/xtensa_coproc_handler.S b/ports/xtensa/xcc/src/xtensa_coproc_handler.S index ee55e471..33de2070 100644 --- a/ports/xtensa/xcc/src/xtensa_coproc_handler.S +++ b/ports/xtensa/xcc/src/xtensa_coproc_handler.S @@ -461,8 +461,10 @@ _xt_coproc_restorecs: //----------------------------------------------------------------------------- // For XEA3, coprocessor exceptions come here. This is a wrapper function that -// calls _xt_coproc_handler() to do the actual work. Since the handler can be -// interrupted make sure that no context switch occurs. +// calls _xt_coproc_handler() to do the actual work. We don't want the handler +// to be interrupted because that might cause a round-robin switch and leave +// coprocessor context in a confused state. So interrupts are disabled before +// calling the handler. They will be re-enabled on return from exception. //----------------------------------------------------------------------------- .text @@ -474,9 +476,9 @@ _xt_coproc_exc: #ifdef __XTENSA_CALL0_ABI__ addi a1, a1, -16 // reserve 16 bytes on stack s32i a0, a1, 0 // save return address - s32i a2, a1, 4 // save a2 s32i a15, a1, 8 // must save a15 (see dispatch) - l32i a2, a1, 4 + movi a3, PS_DI_MASK + xps a3, a3 // Set PS.DI, disable interrupts l32i a3, a2, XT_STK_EXCCAUSE // a3 <- exccause extui a2, a3, 8, 4 // a2 <- CP index call0 _xt_coproc_handler @@ -487,6 +489,8 @@ _xt_coproc_exc: #else entry a1, 48 // reserve 16 bytes on stack s32i a0, a1, 0 // save return address + movi a3, PS_DI_MASK + xps a3, a3 // Set PS.DI, disable interrupts l32i a3, a2, XT_STK_EXCCAUSE // a3 <- exccause extui a2, a3, 8, 4 // a2 <- CP index call0 _xt_coproc_handler diff --git a/ports/xtensa/xcc/src/xtensa_init.c b/ports/xtensa/xcc/src/xtensa_init.c index 0359028c..298ca28d 100644 --- a/ports/xtensa/xcc/src/xtensa_init.c +++ b/ports/xtensa/xcc/src/xtensa_init.c @@ -46,17 +46,17 @@ #ifdef XT_RTOS_TIMER_INT #ifndef XT_CLOCK_FREQ -uint32_t _xt_tick_divisor = 0; /* cached number of cycles per tick */ +uint32_t xt_tick_divisor = 0; /* cached number of cycles per tick */ /* Compute and initialize at run-time the tick divisor (the number of processor clock cycles in an RTOS tick, used to set the tick timer). Called when the processor clock frequency is not known at compile-time. */ -void _xt_tick_divisor_init(void) +void xt_tick_divisor_init(void) { #ifdef XT_BOARD - _xt_tick_divisor = xtbsp_clock_freq_hz() / XT_TICK_PER_SEC; + xt_tick_divisor = xtbsp_clock_freq_hz() / XT_TICK_PER_SEC; #else #error "No way to obtain processor clock frequency" #endif /* XT_BOARD */ diff --git a/ports/xtensa/xcc/src/xtensa_vectors_xea3.S b/ports/xtensa/xcc/src/xtensa_vectors_xea3.S index 5596a75c..9a25dcee 100644 --- a/ports/xtensa/xcc/src/xtensa_vectors_xea3.S +++ b/ports/xtensa/xcc/src/xtensa_vectors_xea3.S @@ -77,9 +77,6 @@ // The entry point vectors are common for call0 and windowed configurations. //----------------------------------------------------------------------------- - .extern _DoubleExceptionHandler - .extern _xtos_exc_dispatch - .section .DispatchVector.text, "ax" #if XCHAL_HAVE_VECBASE .align 64 // 64-byte alignment needed when vecbase @@ -105,7 +102,7 @@ _Reserved1: .weak _DoubleExceptionVector _DoubleExceptionVector: - j _DoubleExceptionHandler + j _DoubleExceptionHandler // Externally defined .org 9 // Reserved .local _Reserved2 diff --git a/ports_module/cortex_a35_smp/ac6/module_manager/src/tx_thread_context_restore.S b/ports_module/cortex_a35_smp/ac6/module_manager/src/tx_thread_context_restore.S index 56f748f9..19791662 100644 --- a/ports_module/cortex_a35_smp/ac6/module_manager/src/tx_thread_context_restore.S +++ b/ports_module/cortex_a35_smp/ac6/module_manager/src/tx_thread_context_restore.S @@ -21,9 +21,6 @@ /**************************************************************************/ -/* Include macros for modifying the wait list. */ -#include "tx_thread_smp_protection_wait_list_macros.h" - .text .align 3 /**************************************************************************/ @@ -31,7 +28,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_context_restore Cortex-A35-SMP/AC6 */ -/* 6.1.3 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* Andres Mlinar, Microsoft Corporation */ @@ -63,7 +60,10 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 12-31-2020 Andres Mlinar Initial Version 6.1.3 */ +/* 12-31-2020 Andres Mlinar Initial Version 6.1.3 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_context_restore(VOID) @@ -76,7 +76,7 @@ _tx_thread_context_restore: MSR DAIFSet, 0x3 // Lockout interrupts -#ifdef TX_ENABLE_EXECUTION_CHANGE_NOTIFY +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) /* Call the ISR exit function to indicate an ISR is complete. */ @@ -101,13 +101,13 @@ _tx_thread_context_restore: LDR x3, =_tx_thread_system_state // Pickup address of system state var LDR w2, [x3, x8, LSL #2] // Pickup system state SUB w2, w2, #1 // Decrement the counter - STR w2, [x3, x8, LSL #2] // Store the counter + STR w2, [x3, x8, LSL #2] // Store the counter CMP w2, #0 // Was this the first interrupt? BEQ __tx_thread_not_nested_restore // If so, not a nested restore /* Interrupts are nested. */ - /* Just recover the saved registers and return to the point of + /* Just recover the saved registers and return to the point of interrupt. */ LDP x4, x5, [sp], #16 // Pickup saved SPSR/DAIF and ELR_EL @@ -151,7 +151,7 @@ __tx_thread_not_nested_restore: LDR x3, =_tx_thread_execute_ptr // Pickup address of execute thread ptr LDR x2, [x3, x8, LSL #3] // Pickup actual execute thread pointer CMP x0, x2 // Is the same thread highest priority? - BEQ __tx_thread_no_preempt_restore // Same thread in the execute list, + BEQ __tx_thread_no_preempt_restore // Same thread in the execute list, // no preemption needs to happen LDR x3, =_tx_thread_smp_protection // Build address to protection structure LDR w3, [x3, #4] // Pickup the owning core @@ -206,74 +206,6 @@ __tx_thread_no_preempt_restore: // { __tx_thread_preempt_restore: - /* Was the thread being preempted waiting for the lock? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] != 0) - // { - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - CMP w3, #0 - BEQ _nobody_waiting_for_lock // Is the core waiting for the lock? - - /* Do we not have the lock? This means the ISR never got the inter-core lock. */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_owned != this_core) - // { - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w8, w3 // Compare our core to the owning core - BEQ _this_core_has_lock // Do we have the lock? - - /* We don't have the lock. This core should be in the list. Remove it. */ - // _tx_thread_smp_protect_wait_list_remove(this_core); - - _tx_thread_smp_protect_wait_list_remove // Call macro to remove core from the list - B _nobody_waiting_for_lock // Leave - - // } - // else - // { - /* We have the lock. This means the ISR got the inter-core lock, but - never released it because it saw that there was someone waiting. - Note this core is not in the list. */ - -_this_core_has_lock: - - /* We're no longer waiting. Note that this should be zero since this happens during thread preemption. */ - // _tx_thread_smp_protect_wait_counts[core]--; - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - SUB w3, w3, #1 // Decrement waiting value. Should be zero now - STR w3, [x2, x8, LSL #2] // Store new waiting value - - /* Now release the inter-core lock. */ - - /* Set protected core as invalid. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_core = 0xFFFFFFFF; - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - MOV w3, #0xFFFFFFFF // Build invalid value - STR w3, [x2, #4] // Mark the protected core as invalid - DMB ISH // Ensure that accesses to shared resource have completed - - /* Release protection. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 0; - - MOV w3, #0 // Build release protection value - STR w3, [x2, #0] // Release the protection - DSB ISH // To ensure update of the protection occurs before other CPUs awake - - /* Wake up waiting processors. Note interrupts are already enabled. */ - -#ifdef TX_ENABLE_WFE - SEV // Send event to other CPUs -#endif - - // } - // } - -_nobody_waiting_for_lock: LDR x4, [x0, #8] // Switch to thread stack pointer MOV sp, x4 // @@ -328,8 +260,8 @@ _skip_fp_save: CMP w2, #0 // Is it active? BEQ __tx_thread_dont_save_ts // No, don't save it - /* _tx_thread_current_ptr -> tx_thread_time_slice = _tx_timer_time_slice; - _tx_timer_time_slice = 0; */ + // _tx_thread_current_ptr -> tx_thread_time_slice = _tx_timer_time_slice; + // _tx_timer_time_slice = 0; STR w2, [x0, #36] // Save thread's time-slice MOV w2, #0 // Clear value diff --git a/ports_module/cortex_a35_smp/ac6/module_manager/src/tx_thread_smp_protect.S b/ports_module/cortex_a35_smp/ac6/module_manager/src/tx_thread_smp_protect.S index 92c1702b..078d0320 100644 --- a/ports_module/cortex_a35_smp/ac6/module_manager/src/tx_thread_smp_protect.S +++ b/ports_module/cortex_a35_smp/ac6/module_manager/src/tx_thread_smp_protect.S @@ -32,7 +32,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_smp_protect Cortex-A35-SMP/AC6 */ -/* 6.1.9 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -63,11 +63,14 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 10-15-2021 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ -/* improved SMP code, */ -/* resulting in version 6.1.9 */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ +/* improved SMP code, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_protect @@ -81,293 +84,49 @@ _tx_thread_smp_protect: /* Pickup the CPU ID. */ - MRS x1, MPIDR_EL1 // Pickup the core ID + MRS x2, MPIDR_EL1 // Pickup the core ID #ifdef TX_ARMV8_2 #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID + UBFX x7, x2, #16, #8 // Isolate cluster ID #endif - UBFX x1, x1, #8, #8 // Isolate core ID + UBFX x2, x2, #8, #8 // Isolate core ID #else #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID + UBFX x7, x2, #8, #8 // Isolate cluster ID #endif - UBFX x1, x1, #0, #8 // Isolate core ID + UBFX x2, x2, #0, #8 // Isolate core ID #endif #if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID + ADDS x2, x2, x7, LSL #2 // Calculate CPU ID #endif - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR x2, =_tx_thread_smp_protection // Build address to protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w1, w3 // Is it not this core? - BNE _protection_not_owned // No, the protection is not already owned - - /* We already have protection. */ - - /* Increment the protection count. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_count++; - - LDR w3, [x2, #8] // Pickup ownership count - ADD w3, w3, #1 // Increment ownership count - STR w3, [x2, #8] // Store ownership count - DMB ISH - - B _return - -_protection_not_owned: - - /* Is the lock available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Is the list empty? */ - // if (_tx_thread_smp_protect_wait_list_head == _tx_thread_smp_protect_wait_list_tail) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head - LDR w3, [x3] - LDR x4, =_tx_thread_smp_protect_wait_list_tail - LDR w4, [x4] - CMP w3, w4 - BNE _list_not_empty - - /* Try to get the lock. */ - // if (write_exclusive(&_tx_thread_smp_protection.tx_thread_smp_protect_in_force, 1) == SUCCESS) - // { - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - - /* We got the lock! */ - // _tx_thread_smp_protect_lock_got(); - - DMB ISH // Ensure write to protection finishes - _tx_thread_smp_protect_lock_got // Call the lock got function - - B _return - -_list_not_empty: - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _start_waiting - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _return - -_start_waiting: - - /* For one reason or another, we didn't get the lock. */ - - /* Increment wait count. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value - - /* Have we not added ourselves to the list yet? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 1) - // { - - CMP w4, #1 - BNE _already_in_list0 // Is this core already waiting? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - // } - -_already_in_list0: - - /* Restore interrupts. */ + LDR x1, =_tx_thread_smp_protection // Build address to protection structure + LDR w3, [x1, #4] // Pickup the owning core + CMP w3, w2 // Is it this core? + BEQ _owned // Yes, the protection is already owned + LDAXR w4, [x1, #0] // Pickup the protection flag + CBZ w4, _get_protection // Yes, get the protection MSR DAIF, x0 // Restore interrupts ISB // #ifdef TX_ENABLE_WFE WFE // Go into standby #endif + B _tx_thread_smp_protect // On waking, restart the protection attempt - /* We do this until we have the lock. */ - // while (1) - // { - -_try_to_get_lock: - - /* Disable interrupts so we don't get preempted. */ - - MRS x0, DAIF // Pickup current interrupt posture - MSR DAIFSet, 0x3 // Lockout interrupts - - /* Pickup the CPU ID. */ - - MRS x1, MPIDR_EL1 // Pickup the core ID -#ifdef TX_ARMV8_2 -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #8, #8 // Isolate core ID -#else -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #0, #8 // Isolate core ID -#endif -#if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID -#endif - - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR w3, [x2, #4] // Pickup the owning core - CMP w3, w1 // Is it this core? - BEQ _got_lock_after_waiting // Yes, the protection is already owned. This means - // an ISR preempted us and got protection - - // } - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _did_not_get_lock - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _did_not_get_lock // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _did_not_get_lock // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _got_lock_after_waiting - -_did_not_get_lock: - - /* For one reason or another, we didn't get the lock. */ - - /* Were we removed from the list? This can happen if we're a thread - and we got preempted. */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 0) - // { - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - CMP w4, #0 - BNE _already_in_list1 // Is this core already in the list? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - /* Our waiting count was also reset when we were preempted. Increment it again. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - // } - -_already_in_list1: - - /* Restore interrupts and try again. */ - +_get_protection: + MOV x4, #1 // Build lock value + STXR w5, w4, [x1] // Attempt to get the protection + CBZ w5, _got_protection // Did it succeed? w5 = 0 means success! MSR DAIF, x0 // Restore interrupts - ISB // -#ifdef TX_ENABLE_WFE - WFE // Go into standby -#endif - B _try_to_get_lock // On waking, restart the protection attempt - -_got_lock_after_waiting: - - /* We're no longer waiting. */ - // _tx_thread_smp_protect_wait_counts[this_core]--; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load waiting list - LDR w4, [x3, x1, LSL #2] // Load current wait value - SUB w4, w4, #1 // Decrement wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - /* Restore registers and return. */ - -_return: - + B _tx_thread_smp_protect // Restart the protection attempt + +_got_protection: + DMB ISH // + STR w2, [x1, #4] // Save owning core +_owned: + LDR w5, [x1, #8] // Pickup ownership count + ADD w5, w5, #1 // Increment ownership count + STR w5, [x1, #8] // Store ownership count + DMB ISH // RET diff --git a/ports_module/cortex_a35_smp/ac6/module_manager/src/tx_thread_smp_unprotect.S b/ports_module/cortex_a35_smp/ac6/module_manager/src/tx_thread_smp_unprotect.S index ff8df7db..ea1287ef 100644 --- a/ports_module/cortex_a35_smp/ac6/module_manager/src/tx_thread_smp_unprotect.S +++ b/ports_module/cortex_a35_smp/ac6/module_manager/src/tx_thread_smp_unprotect.S @@ -28,7 +28,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_smp_unprotect Cortex-A35-SMP/AC6 */ -/* 6.1.9 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -60,10 +60,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 10-15-2021 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ -/* resulting in version 6.1.9 */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_unprotect @@ -105,11 +108,6 @@ _tx_thread_smp_unprotect: CMP w3, #0 // Is the preempt disable flag set? BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protect_wait_counts // Build build address of wait counts - LDR w3, [x2, x1, LSL #2] // Pickup wait list value - CMP w3, #0 // Are any entities on this core waiting? - BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protection // Build address of protection structure MOV w3, #0xFFFFFFFF // Build invalid value STR w3, [x2, #4] // Mark the protected core as invalid diff --git a/ports_module/cortex_a35_smp/gnu/module_manager/src/tx_thread_context_restore.S b/ports_module/cortex_a35_smp/gnu/module_manager/src/tx_thread_context_restore.S index 886df701..94a31b94 100644 --- a/ports_module/cortex_a35_smp/gnu/module_manager/src/tx_thread_context_restore.S +++ b/ports_module/cortex_a35_smp/gnu/module_manager/src/tx_thread_context_restore.S @@ -21,9 +21,6 @@ /**************************************************************************/ -/* Include macros for modifying the wait list. */ -#include "tx_thread_smp_protection_wait_list_macros.h" - .text .align 3 /**************************************************************************/ @@ -31,7 +28,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_context_restore Cortex-A35-SMP/GNU */ -/* 6.1.3 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* Andres Mlinar, Microsoft Corporation */ @@ -63,7 +60,10 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 12-31-2020 Andres Mlinar Initial Version 6.1.3 */ +/* 12-31-2020 Andres Mlinar Initial Version 6.1.3 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_context_restore(VOID) @@ -76,7 +76,7 @@ _tx_thread_context_restore: MSR DAIFSet, 0x3 // Lockout interrupts -#ifdef TX_ENABLE_EXECUTION_CHANGE_NOTIFY +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) /* Call the ISR exit function to indicate an ISR is complete. */ @@ -101,13 +101,13 @@ _tx_thread_context_restore: LDR x3, =_tx_thread_system_state // Pickup address of system state var LDR w2, [x3, x8, LSL #2] // Pickup system state SUB w2, w2, #1 // Decrement the counter - STR w2, [x3, x8, LSL #2] // Store the counter + STR w2, [x3, x8, LSL #2] // Store the counter CMP w2, #0 // Was this the first interrupt? BEQ __tx_thread_not_nested_restore // If so, not a nested restore /* Interrupts are nested. */ - /* Just recover the saved registers and return to the point of + /* Just recover the saved registers and return to the point of interrupt. */ LDP x4, x5, [sp], #16 // Pickup saved SPSR/DAIF and ELR_EL @@ -151,7 +151,7 @@ __tx_thread_not_nested_restore: LDR x3, =_tx_thread_execute_ptr // Pickup address of execute thread ptr LDR x2, [x3, x8, LSL #3] // Pickup actual execute thread pointer CMP x0, x2 // Is the same thread highest priority? - BEQ __tx_thread_no_preempt_restore // Same thread in the execute list, + BEQ __tx_thread_no_preempt_restore // Same thread in the execute list, // no preemption needs to happen LDR x3, =_tx_thread_smp_protection // Build address to protection structure LDR w3, [x3, #4] // Pickup the owning core @@ -206,74 +206,6 @@ __tx_thread_no_preempt_restore: // { __tx_thread_preempt_restore: - /* Was the thread being preempted waiting for the lock? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] != 0) - // { - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - CMP w3, #0 - BEQ _nobody_waiting_for_lock // Is the core waiting for the lock? - - /* Do we not have the lock? This means the ISR never got the inter-core lock. */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_owned != this_core) - // { - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w8, w3 // Compare our core to the owning core - BEQ _this_core_has_lock // Do we have the lock? - - /* We don't have the lock. This core should be in the list. Remove it. */ - // _tx_thread_smp_protect_wait_list_remove(this_core); - - _tx_thread_smp_protect_wait_list_remove // Call macro to remove core from the list - B _nobody_waiting_for_lock // Leave - - // } - // else - // { - /* We have the lock. This means the ISR got the inter-core lock, but - never released it because it saw that there was someone waiting. - Note this core is not in the list. */ - -_this_core_has_lock: - - /* We're no longer waiting. Note that this should be zero since this happens during thread preemption. */ - // _tx_thread_smp_protect_wait_counts[core]--; - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - SUB w3, w3, #1 // Decrement waiting value. Should be zero now - STR w3, [x2, x8, LSL #2] // Store new waiting value - - /* Now release the inter-core lock. */ - - /* Set protected core as invalid. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_core = 0xFFFFFFFF; - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - MOV w3, #0xFFFFFFFF // Build invalid value - STR w3, [x2, #4] // Mark the protected core as invalid - DMB ISH // Ensure that accesses to shared resource have completed - - /* Release protection. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 0; - - MOV w3, #0 // Build release protection value - STR w3, [x2, #0] // Release the protection - DSB ISH // To ensure update of the protection occurs before other CPUs awake - - /* Wake up waiting processors. Note interrupts are already enabled. */ - -#ifdef TX_ENABLE_WFE - SEV // Send event to other CPUs -#endif - - // } - // } - -_nobody_waiting_for_lock: LDR x4, [x0, #8] // Switch to thread stack pointer MOV sp, x4 // @@ -328,8 +260,8 @@ _skip_fp_save: CMP w2, #0 // Is it active? BEQ __tx_thread_dont_save_ts // No, don't save it - /* _tx_thread_current_ptr -> tx_thread_time_slice = _tx_timer_time_slice; - _tx_timer_time_slice = 0; */ + // _tx_thread_current_ptr -> tx_thread_time_slice = _tx_timer_time_slice; + // _tx_timer_time_slice = 0; STR w2, [x0, #36] // Save thread's time-slice MOV w2, #0 // Clear value diff --git a/ports_module/cortex_a35_smp/gnu/module_manager/src/tx_thread_smp_protect.S b/ports_module/cortex_a35_smp/gnu/module_manager/src/tx_thread_smp_protect.S index 59bf4ff4..5b800e71 100644 --- a/ports_module/cortex_a35_smp/gnu/module_manager/src/tx_thread_smp_protect.S +++ b/ports_module/cortex_a35_smp/gnu/module_manager/src/tx_thread_smp_protect.S @@ -32,7 +32,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_smp_protect Cortex-A35-SMP/GCC */ -/* 6.1.9 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -63,11 +63,14 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 10-15-2021 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ -/* improved SMP code, */ -/* resulting in version 6.1.9 */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ +/* improved SMP code, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_protect @@ -81,293 +84,49 @@ _tx_thread_smp_protect: /* Pickup the CPU ID. */ - MRS x1, MPIDR_EL1 // Pickup the core ID + MRS x2, MPIDR_EL1 // Pickup the core ID #ifdef TX_ARMV8_2 #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID + UBFX x7, x2, #16, #8 // Isolate cluster ID #endif - UBFX x1, x1, #8, #8 // Isolate core ID + UBFX x2, x2, #8, #8 // Isolate core ID #else #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID + UBFX x7, x2, #8, #8 // Isolate cluster ID #endif - UBFX x1, x1, #0, #8 // Isolate core ID + UBFX x2, x2, #0, #8 // Isolate core ID #endif #if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID + ADDS x2, x2, x7, LSL #2 // Calculate CPU ID #endif - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR x2, =_tx_thread_smp_protection // Build address to protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w1, w3 // Is it not this core? - BNE _protection_not_owned // No, the protection is not already owned - - /* We already have protection. */ - - /* Increment the protection count. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_count++; - - LDR w3, [x2, #8] // Pickup ownership count - ADD w3, w3, #1 // Increment ownership count - STR w3, [x2, #8] // Store ownership count - DMB ISH - - B _return - -_protection_not_owned: - - /* Is the lock available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Is the list empty? */ - // if (_tx_thread_smp_protect_wait_list_head == _tx_thread_smp_protect_wait_list_tail) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head - LDR w3, [x3] - LDR x4, =_tx_thread_smp_protect_wait_list_tail - LDR w4, [x4] - CMP w3, w4 - BNE _list_not_empty - - /* Try to get the lock. */ - // if (write_exclusive(&_tx_thread_smp_protection.tx_thread_smp_protect_in_force, 1) == SUCCESS) - // { - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - - /* We got the lock! */ - // _tx_thread_smp_protect_lock_got(); - - DMB ISH // Ensure write to protection finishes - _tx_thread_smp_protect_lock_got // Call the lock got function - - B _return - -_list_not_empty: - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _start_waiting - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _return - -_start_waiting: - - /* For one reason or another, we didn't get the lock. */ - - /* Increment wait count. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value - - /* Have we not added ourselves to the list yet? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 1) - // { - - CMP w4, #1 - BNE _already_in_list0 // Is this core already waiting? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - // } - -_already_in_list0: - - /* Restore interrupts. */ + LDR x1, =_tx_thread_smp_protection // Build address to protection structure + LDR w3, [x1, #4] // Pickup the owning core + CMP w3, w2 // Is it this core? + BEQ _owned // Yes, the protection is already owned + LDAXR w4, [x1, #0] // Pickup the protection flag + CBZ w4, _get_protection // Yes, get the protection MSR DAIF, x0 // Restore interrupts ISB // #ifdef TX_ENABLE_WFE WFE // Go into standby #endif + B _tx_thread_smp_protect // On waking, restart the protection attempt - /* We do this until we have the lock. */ - // while (1) - // { - -_try_to_get_lock: - - /* Disable interrupts so we don't get preempted. */ - - MRS x0, DAIF // Pickup current interrupt posture - MSR DAIFSet, 0x3 // Lockout interrupts - - /* Pickup the CPU ID. */ - - MRS x1, MPIDR_EL1 // Pickup the core ID -#ifdef TX_ARMV8_2 -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #8, #8 // Isolate core ID -#else -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #0, #8 // Isolate core ID -#endif -#if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID -#endif - - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR w3, [x2, #4] // Pickup the owning core - CMP w3, w1 // Is it this core? - BEQ _got_lock_after_waiting // Yes, the protection is already owned. This means - // an ISR preempted us and got protection - - // } - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _did_not_get_lock - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _did_not_get_lock // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _did_not_get_lock // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _got_lock_after_waiting - -_did_not_get_lock: - - /* For one reason or another, we didn't get the lock. */ - - /* Were we removed from the list? This can happen if we're a thread - and we got preempted. */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 0) - // { - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - CMP w4, #0 - BNE _already_in_list1 // Is this core already in the list? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - /* Our waiting count was also reset when we were preempted. Increment it again. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - // } - -_already_in_list1: - - /* Restore interrupts and try again. */ - +_get_protection: + MOV x4, #1 // Build lock value + STXR w5, w4, [x1] // Attempt to get the protection + CBZ w5, _got_protection // Did it succeed? w5 = 0 means success! MSR DAIF, x0 // Restore interrupts - ISB // -#ifdef TX_ENABLE_WFE - WFE // Go into standby -#endif - B _try_to_get_lock // On waking, restart the protection attempt - -_got_lock_after_waiting: - - /* We're no longer waiting. */ - // _tx_thread_smp_protect_wait_counts[this_core]--; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load waiting list - LDR w4, [x3, x1, LSL #2] // Load current wait value - SUB w4, w4, #1 // Decrement wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - /* Restore registers and return. */ - -_return: - + B _tx_thread_smp_protect // Restart the protection attempt + +_got_protection: + DMB ISH // + STR w2, [x1, #4] // Save owning core +_owned: + LDR w5, [x1, #8] // Pickup ownership count + ADD w5, w5, #1 // Increment ownership count + STR w5, [x1, #8] // Store ownership count + DMB ISH // RET diff --git a/ports_module/cortex_a35_smp/gnu/module_manager/src/tx_thread_smp_unprotect.S b/ports_module/cortex_a35_smp/gnu/module_manager/src/tx_thread_smp_unprotect.S index c53075ae..0e96fc3b 100644 --- a/ports_module/cortex_a35_smp/gnu/module_manager/src/tx_thread_smp_unprotect.S +++ b/ports_module/cortex_a35_smp/gnu/module_manager/src/tx_thread_smp_unprotect.S @@ -28,7 +28,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_smp_unprotect Cortex-A35-SMP/GCC */ -/* 6.1.9 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -60,10 +60,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 10-15-2021 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ -/* resulting in version 6.1.9 */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_unprotect @@ -105,11 +108,6 @@ _tx_thread_smp_unprotect: CMP w3, #0 // Is the preempt disable flag set? BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protect_wait_counts // Build build address of wait counts - LDR w3, [x2, x1, LSL #2] // Pickup wait list value - CMP w3, #0 // Are any entities on this core waiting? - BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protection // Build address of protection structure MOV w3, #0xFFFFFFFF // Build invalid value STR w3, [x2, #4] // Mark the protected core as invalid diff --git a/ports_module/cortex_m0+/ac6/inc/tx_port.h b/ports_module/cortex_m0+/ac6/inc/tx_port.h index 3ebd67b4..200367a3 100644 --- a/ports_module/cortex_m0+/ac6/inc/tx_port.h +++ b/ports_module/cortex_m0+/ac6/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M0+/AC6 */ -/* 6.1.10 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -48,6 +48,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 01-31-2022 Scott Larson Initial Version 6.1.10 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -123,13 +126,13 @@ typedef unsigned short USHORT; For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #ifndef TX_TRACE_TIME_MASK #define TX_TRACE_TIME_MASK 0xFFFFFFFFUL @@ -473,7 +476,8 @@ __attribute__( ( always_inline ) ) static inline void _tx_thread_system_return_i { unsigned int interrupt_save; - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + /* Set PendSV to invoke ThreadX scheduler. */ + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (__get_ipsr_value() == 0) { interrupt_save = __get_primask_value(); diff --git a/ports_module/cortex_m0+/ac6/module_manager/src/tx_thread_schedule.S b/ports_module/cortex_m0+/ac6/module_manager/src/tx_thread_schedule.S index f76fa5f0..8ccb9f7a 100644 --- a/ports_module/cortex_m0+/ac6/module_manager/src/tx_thread_schedule.S +++ b/ports_module/cortex_m0+/ac6/module_manager/src/tx_thread_schedule.S @@ -30,7 +30,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_schedule Cortex-M0+/AC6 */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* Scott Larson, Microsoft Corporation */ @@ -63,6 +63,8 @@ /* DATE NAME DESCRIPTION */ /* */ /* 01-31-2022 Scott Larson Initial Version 6.1.10 */ +/* 04-25-2022 Scott Larson Optimized MPU configuration, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_schedule(VOID) @@ -338,14 +340,23 @@ __tx_ts_restore: CMP r0, #0 BEQ skip_mpu_setup // Is this thread owned by a module? No, skip MPU setup MOV r8, r1 // Copy thread ptr - LDR r1, [r0, #0x64] // Pickup MPU register[0] - CMP r1, #0 + MOVS r6, #0x8C + LDR r2, [r0, r6] // Pickup MPU region 5 address + CMP r2, #0 BEQ skip_mpu_setup // Is protection required for this module? No, skip MPU setup - LDR r1, =0xE000ED9C // Build address of MPU base register + + // Is the MPU already set up for this module? + MOVS r1, #5 // Select region 5 from MPU + LDR r3, =0xE000ED98 // MPU_RNR register address + STR r1, [r3] // Set region to 5 + LDR r1, =0xE000ED9C // MPU_RBAR register address + LDR r3, [r1] // Load address stored in MPU region 5 + MOVS r6, #0x10 + BICS r2, r2, r6 // Clear VALID bit + CMP r2, r3 // Is module already loaded? + BEQ _tx_enable_mpu // Yes - skip MPU reconfiguration // Initialize loop to configure MPU registers - // Order doesn't matter, so txm_module_instance_mpu_registers[0] - // will be in region 7 and txm_module_instance_mpu_registers[7] will be in region 0. MOVS r3, #0x64 // Index of MPU register settings in thread control block ADD r0, r0, r3 // Build address of MPU register start in thread control block MOVS r5, #0 // Select region 0 @@ -359,7 +370,7 @@ _tx_mpu_loop: ADDS r5, r5, #1 // Increment to next region CMP r5, #8 // Check if all regions have been set BNE _tx_mpu_loop - +_tx_enable_mpu: LDR r0, =0xE000ED94 // Build MPU control reg address MOVS r1, #5 // Build enable value with background region enabled STR r1, [r0] // Enable MPU diff --git a/ports_module/cortex_m0+/gnu/inc/tx_port.h b/ports_module/cortex_m0+/gnu/inc/tx_port.h index 06089b0f..286fb913 100644 --- a/ports_module/cortex_m0+/gnu/inc/tx_port.h +++ b/ports_module/cortex_m0+/gnu/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M0+/GNU */ -/* 6.1.10 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -48,6 +48,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 01-31-2022 Scott Larson Initial Version 6.1.10 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -138,13 +141,13 @@ typedef unsigned short USHORT; For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #ifndef TX_TRACE_TIME_MASK #define TX_TRACE_TIME_MASK 0xFFFFFFFFUL @@ -305,7 +308,7 @@ __attribute__( ( always_inline ) ) static inline void __set_control(ULONG contro else \ { \ ULONG _tx_fpccr; \ - _tx_fpccr = *((ULONG *) 0xE000EF34); \ + _tx_fpccr = *((volatile ULONG *) 0xE000EF34); \ _tx_fpccr = _tx_fpccr & ((ULONG) 0x01); \ if (_tx_fpccr == ((ULONG) 0x01)) \ { \ @@ -487,7 +490,8 @@ __attribute__( ( always_inline ) ) static inline void _tx_thread_system_return_i { unsigned int interrupt_save; - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + /* Set PendSV to invoke ThreadX scheduler. */ + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (__get_ipsr_value() == 0) { interrupt_save = __get_primask_value(); diff --git a/ports_module/cortex_m0+/gnu/module_manager/src/tx_thread_schedule.S b/ports_module/cortex_m0+/gnu/module_manager/src/tx_thread_schedule.S index 42c3e8d9..f1f5872b 100644 --- a/ports_module/cortex_m0+/gnu/module_manager/src/tx_thread_schedule.S +++ b/ports_module/cortex_m0+/gnu/module_manager/src/tx_thread_schedule.S @@ -30,7 +30,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_schedule Cortex-M0+/GNU */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* Scott Larson, Microsoft Corporation */ @@ -63,6 +63,8 @@ /* DATE NAME DESCRIPTION */ /* */ /* 01-31-2022 Scott Larson Initial Version 6.1.10 */ +/* 04-25-2022 Scott Larson Optimized MPU configuration, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_schedule(VOID) @@ -338,14 +340,23 @@ __tx_ts_restore: CMP r0, #0 BEQ skip_mpu_setup // Is this thread owned by a module? No, skip MPU setup MOV r8, r1 // Copy thread ptr - LDR r1, [r0, #0x64] // Pickup MPU register[0] - CMP r1, #0 + MOVS r6, #0x8C + LDR r2, [r0, r6] // Pickup MPU region 5 address + CMP r2, #0 BEQ skip_mpu_setup // Is protection required for this module? No, skip MPU setup - LDR r1, =0xE000ED9C // Build address of MPU base register + + // Is the MPU already set up for this module? + MOVS r1, #5 // Select region 5 from MPU + LDR r3, =0xE000ED98 // MPU_RNR register address + STR r1, [r3] // Set region to 5 + LDR r1, =0xE000ED9C // MPU_RBAR register address + LDR r3, [r1] // Load address stored in MPU region 5 + MOVS r6, #0x10 + BICS r2, r2, r6 // Clear VALID bit + CMP r2, r3 // Is module already loaded? + BEQ _tx_enable_mpu // Yes - skip MPU reconfiguration // Initialize loop to configure MPU registers - // Order doesn't matter, so txm_module_instance_mpu_registers[0] - // will be in region 7 and txm_module_instance_mpu_registers[7] will be in region 0. MOVS r3, #0x64 // Index of MPU register settings in thread control block ADD r0, r0, r3 // Build address of MPU register start in thread control block MOVS r5, #0 // Select region 0 @@ -359,7 +370,7 @@ _tx_mpu_loop: ADDS r5, r5, #1 // Increment to next region CMP r5, #8 // Check if all regions have been set BNE _tx_mpu_loop - +_tx_enable_mpu: LDR r0, =0xE000ED94 // Build MPU control reg address MOVS r1, #5 // Build enable value with background region enabled STR r1, [r0] // Enable MPU diff --git a/ports_module/cortex_m0+/iar/example_build/startup.s b/ports_module/cortex_m0+/iar/example_build/startup.s index bbe8142b..06de32fb 100644 --- a/ports_module/cortex_m0+/iar/example_build/startup.s +++ b/ports_module/cortex_m0+/iar/example_build/startup.s @@ -58,9 +58,9 @@ __vector_table DC32 NMI_Handler ; NMI DC32 HardFault_Handler ; HardFault - DC32 MemManage_Handler ; MemManage - DC32 0 ; BusFault - DC32 0 ; UsageFault + DC32 HardFault_Handler ; MemManage + DC32 HardFault_Handler ; BusFault + DC32 HardFault_Handler ; UsageFault DC32 0 ; 7 DC32 0 ; 8 DC32 0 ; 9 diff --git a/ports_module/cortex_m0+/iar/inc/tx_port.h b/ports_module/cortex_m0+/iar/inc/tx_port.h index d2554f9c..41f06ec5 100644 --- a/ports_module/cortex_m0+/iar/inc/tx_port.h +++ b/ports_module/cortex_m0+/iar/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M0+/IAR */ -/* 6.1.10 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -48,6 +48,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 01-31-2022 Scott Larson Initial Version 6.1.10 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -142,14 +145,14 @@ typedef unsigned short USHORT; For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_MISRA_ENABLE #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #else ULONG _tx_misra_time_stamp_get(VOID); @@ -361,7 +364,7 @@ __attribute__( ( always_inline ) ) static inline void __set_control(ULONG contro else \ { \ ULONG _tx_fpccr; \ - _tx_fpccr = *((ULONG *) 0xE000EF34); \ + _tx_fpccr = *((volatile ULONG *) 0xE000EF34); \ _tx_fpccr = _tx_fpccr & ((ULONG) 0x01); \ if (_tx_fpccr == ((ULONG) 0x01)) \ { \ @@ -532,7 +535,7 @@ static void _tx_thread_system_return_inline(void) __istate_t interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (__get_IPSR() == 0) { interrupt_save = __get_interrupt_state(); diff --git a/ports_module/cortex_m0+/iar/module_manager/src/tx_thread_schedule.S b/ports_module/cortex_m0+/iar/module_manager/src/tx_thread_schedule.S index c75596df..bc498210 100644 --- a/ports_module/cortex_m0+/iar/module_manager/src/tx_thread_schedule.S +++ b/ports_module/cortex_m0+/iar/module_manager/src/tx_thread_schedule.S @@ -36,7 +36,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_schedule Cortex-M0+/IAR */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* Scott Larson, Microsoft Corporation */ @@ -69,6 +69,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 01-31-2022 Scott Larson Initial Version 6.1.10 */ +/* 04-25-2022 Scott Larson Optimized MPU configuration, */ +/* change handler name, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_schedule(VOID) @@ -103,12 +106,8 @@ __tx_wait_here: /* Memory Exception Handler. */ - PUBLIC MemManage_Handler - PUBLIC BusFault_Handler - PUBLIC UsageFault_Handler -MemManage_Handler: -BusFault_Handler: -UsageFault_Handler: + PUBLIC HardFault_Handler +HardFault_Handler: CPSID i // Disable interrupts @@ -326,14 +325,23 @@ __tx_ts_restore: CMP r0, #0 BEQ skip_mpu_setup // Is this thread owned by a module? No, skip MPU setup MOV r8, r1 // Copy thread ptr - LDR r1, [r0, #0x64] // Pickup MPU register[0] - CMP r1, #0 + MOVS r6, #0x8C + LDR r2, [r0, r6] // Pickup MPU region 5 address + CMP r2, #0 BEQ skip_mpu_setup // Is protection required for this module? No, skip MPU setup - LDR r1, =0xE000ED9C // Build address of MPU base register + + // Is the MPU already set up for this module? + MOVS r1, #5 // Select region 5 from MPU + LDR r3, =0xE000ED98 // MPU_RNR register address + STR r1, [r3] // Set region to 5 + LDR r1, =0xE000ED9C // MPU_RBAR register address + LDR r3, [r1] // Load address stored in MPU region 5 + MOVS r6, #0x10 + BICS r2, r2, r6 // Clear VALID bit + CMP r2, r3 // Is module already loaded? + BEQ _tx_enable_mpu // Yes - skip MPU reconfiguration // Initialize loop to configure MPU registers - // Order doesn't matter, so txm_module_instance_mpu_registers[0] - // will be in region 7 and txm_module_instance_mpu_registers[7] will be in region 0. MOVS r3, #0x64 // Index of MPU register settings in thread control block ADD r0, r0, r3 // Build address of MPU register start in thread control block MOVS r5, #0 // Select region 0 @@ -347,7 +355,7 @@ _tx_mpu_loop: ADDS r5, r5, #1 // Increment to next region CMP r5, #8 // Check if all regions have been set BNE _tx_mpu_loop - +_tx_enable_mpu: LDR r0, =0xE000ED94 // Build MPU control reg address MOVS r1, #5 // Build enable value with background region enabled STR r1, [r0] // Enable MPU diff --git a/ports_module/cortex_m23/ac6/inc/tx_port.h b/ports_module/cortex_m23/ac6/inc/tx_port.h index cf82d164..b3c3d99b 100644 --- a/ports_module/cortex_m23/ac6/inc/tx_port.h +++ b/ports_module/cortex_m23/ac6/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M23/AC6 */ -/* 6.1.6 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -48,6 +48,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 04-02-2021 Scott Larson Initial Version 6.1.6 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -163,7 +166,7 @@ UINT _tx_thread_secure_stack_free(struct TX_THREAD_STRUCT *tx_thread); #define TX_TIMER_THREAD_STACK_SIZE 1024 /* Default timer thread stack size */ #endif -#ifndef TX_TIMER_THREAD_PRIORITY +#ifndef TX_TIMER_THREAD_PRIORITY #define TX_TIMER_THREAD_PRIORITY 0 /* Default timer thread priority */ #endif @@ -175,17 +178,17 @@ UINT _tx_thread_secure_stack_free(struct TX_THREAD_STRUCT *tx_thread); /* Define the clock source for trace event entry time stamp. The following two item are port specific. - For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock + For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_MISRA_ENABLE #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #else ULONG _tx_misra_time_stamp_get(VOID); @@ -214,7 +217,7 @@ ULONG _tx_misra_time_stamp_get(VOID); #endif -/* Determine whether or not stack checking is enabled. By default, ThreadX stack checking is +/* Determine whether or not stack checking is enabled. By default, ThreadX stack checking is disabled. When the following is defined, ThreadX thread stack checking is enabled. If stack checking is enabled (TX_ENABLE_STACK_CHECKING is defined), the TX_DISABLE_STACK_FILLING define is negated, thereby forcing the stack fill which is necessary for the stack checking @@ -228,7 +231,7 @@ ULONG _tx_misra_time_stamp_get(VOID); /* Define the TX_THREAD control block extensions for this port. The main reason - for the multiple macros is so that backward compatibility can be maintained with + for the multiple macros is so that backward compatibility can be maintained with existing ThreadX kernel awareness modules. */ #define TX_THREAD_EXTENSION_0 @@ -284,7 +287,7 @@ ULONG _tx_misra_time_stamp_get(VOID); VOID (*tx_timer_module_expiration_function)(ULONG id); -/* Define the user extension field of the thread control block. Nothing +/* Define the user extension field of the thread control block. Nothing additional is needed for this port so it is defined as white space. */ #ifndef TX_THREAD_USER_EXTENSION @@ -362,9 +365,9 @@ static void _set_control(unsigned int _control) #define TX_THREAD_COMPLETED_EXTENSION(thread_ptr) { \ ULONG _tx_vfp_state; \ - _tx_vfp_state = _get_control(); \ + _tx_vfp_state = _get_control(); \ _tx_vfp_state = _tx_vfp_state & ~((ULONG) 0x4); \ - _set_control(_tx_vfp_state);; \ + _set_control(_tx_vfp_state);; \ } #else @@ -392,26 +395,26 @@ void _tx_vfp_access(void); if ((_tx_system_state == ((ULONG) 0)) && ((thread_ptr) == _tx_thread_current_ptr)) \ { \ ULONG _tx_vfp_state; \ - _tx_vfp_state = _get_control(); \ + _tx_vfp_state = _get_control(); \ _tx_vfp_state = _tx_vfp_state & ~((ULONG) 0x4); \ - _set_control(_tx_vfp_state); \ + _set_control(_tx_vfp_state); \ } \ else \ { \ ULONG _tx_fpccr; \ - _tx_fpccr = *((ULONG *) 0xE000EF34); \ + _tx_fpccr = *((volatile ULONG *) 0xE000EF34); \ _tx_fpccr = _tx_fpccr & ((ULONG) 0x01); \ if (_tx_fpccr == ((ULONG) 0x01)) \ { \ ULONG _tx_vfp_state; \ - _tx_vfp_state = _get_control(); \ + _tx_vfp_state = _get_control(); \ _tx_vfp_state = _tx_vfp_state & ((ULONG) 0x4); \ _tx_vfp_access(); \ if (_tx_vfp_state == ((ULONG) 0)) \ { \ - _tx_vfp_state = _get_control(); \ + _tx_vfp_state = _get_control(); \ _tx_vfp_state = _tx_vfp_state & ~((ULONG) 0x4); \ - _set_control(_tx_vfp_state); \ + _set_control(_tx_vfp_state); \ } \ } \ } \ @@ -481,7 +484,7 @@ void _tx_vfp_access(void); /* Define the get system state macro. */ - + #ifndef TX_THREAD_GET_SYSTEM_STATE #ifndef TX_MISRA_ENABLE #define TX_THREAD_GET_SYSTEM_STATE() (_tx_thread_system_state | _get_ipsr()) @@ -507,15 +510,12 @@ extern void _tx_thread_secure_stack_initialize(void); #define TX_INITIALIZE_KERNEL_ENTER_EXTENSION _tx_thread_secure_stack_initialize(); #endif -/* Define the macro to ensure _tx_thread_preempt_disable is set early in initialization in order to +/* Define the macro to ensure _tx_thread_preempt_disable is set early in initialization in order to prevent early scheduling on Cortex-M parts. */ - + #define TX_PORT_SPECIFIC_POST_INITIALIZATION _tx_thread_preempt_disable++; -/* Determine if the ARM architecture has the CLZ instruction. This is available on - architectures v5 and above. If available, redefine the macro for calculating the - lowest bit set. */ #ifndef TX_DISABLE_INLINE @@ -557,7 +557,7 @@ unsigned int was_masked; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (_get_ipsr() == 0) { was_masked = __disable_irq(); @@ -572,8 +572,8 @@ unsigned int was_masked; /* Define the version ID of ThreadX. This may be utilized by the application. */ #ifdef TX_THREAD_INIT -CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M23/AC6 Version 6.1.9 *"; +CHAR _tx_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M23/AC6 Version 6.1.11 *"; #else #ifdef TX_MISRA_ENABLE extern CHAR _tx_version_id[100]; diff --git a/ports_module/cortex_m23/ac6/module_manager/src/tx_thread_schedule.S b/ports_module/cortex_m23/ac6/module_manager/src/tx_thread_schedule.S index 67fe291e..09d4658f 100644 --- a/ports_module/cortex_m23/ac6/module_manager/src/tx_thread_schedule.S +++ b/ports_module/cortex_m23/ac6/module_manager/src/tx_thread_schedule.S @@ -30,7 +30,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_schedule Cortex-M23/AC6 */ -/* 6.1.6 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* Scott Larson, Microsoft Corporation */ @@ -63,6 +63,8 @@ /* DATE NAME DESCRIPTION */ /* */ /* 04-02-2021 Scott Larson Initial Version 6.1.6 */ +/* 04-25-2022 Scott Larson Optimized MPU configuration, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_schedule(VOID) @@ -373,12 +375,20 @@ _skip_secure_restore: LDR r0, [r1, r2] // Pickup the module instance pointer CBZ r0, skip_mpu_setup // Is this thread owned by a module? No, skip MPU setup MOV r8, r1 // Copy thread ptr - LDR r1, [r0, #0x64] // Pickup MPU register[0] - CBZ r1, skip_mpu_setup // Is protection required for this module? No, skip MPU setup + MOVS r2, #0x74 // Index of MPU data region + LDR r2, [r0, r2] // Pickup MPU data region address + CBZ r2, skip_mpu_setup // Is protection required for this module? No, skip MPU setup + + // Is the MPU already set up for this module? + MOVS r1, #2 // Select MPU region 2 + LDR r3, =0xE000ED98 // MPU_RNR register address + STR r1, [r3] // Set region to 2 + LDR r1, =0xE000ED9C // MPU_RBAR register address + LDR r3, [r1] // Load address stored in MPU region 2 + CMP r2, r3 // Is module already loaded? + BEQ _tx_enable_mpu // Yes - skip MPU reconfiguration // Initialize loop to configure MPU registers - // Order doesn't matter, so txm_module_instance_mpu_registers[0] - // will be in region 7 and txm_module_instance_mpu_registers[7] will be in region 0. MOVS r3, #0x64 // Index of MPU register settings in thread control block ADD r0, r0, r3 // Build address of MPU register start in thread control block MOVS r5, #0 // Select region 0 @@ -392,7 +402,7 @@ _tx_mpu_loop: ADDS r5, r5, #1 // Increment to next region CMP r5, #8 // Check if all regions have been set BNE _tx_mpu_loop - +_tx_enable_mpu: LDR r0, =0xE000ED94 // Build MPU control reg address MOVS r1, #5 // Build enable value with background region enabled STR r1, [r0] // Enable MPU diff --git a/ports_module/cortex_m23/gnu/inc/tx_port.h b/ports_module/cortex_m23/gnu/inc/tx_port.h index eca300d7..42486b17 100644 --- a/ports_module/cortex_m23/gnu/inc/tx_port.h +++ b/ports_module/cortex_m23/gnu/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M23/GNU */ -/* 6.1.7 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -58,6 +58,9 @@ /* added symbol to enable */ /* stack error handler, */ /* resulting in version 6.1.7 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -172,7 +175,7 @@ UINT _tx_thread_secure_stack_free(struct TX_THREAD_STRUCT *tx_thread); #define TX_TIMER_THREAD_STACK_SIZE 1024 /* Default timer thread stack size */ #endif -#ifndef TX_TIMER_THREAD_PRIORITY +#ifndef TX_TIMER_THREAD_PRIORITY #define TX_TIMER_THREAD_PRIORITY 0 /* Default timer thread priority */ #endif @@ -184,17 +187,17 @@ UINT _tx_thread_secure_stack_free(struct TX_THREAD_STRUCT *tx_thread); /* Define the clock source for trace event entry time stamp. The following two item are port specific. - For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock + For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_MISRA_ENABLE #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #else ULONG _tx_misra_time_stamp_get(VOID); @@ -223,7 +226,7 @@ ULONG _tx_misra_time_stamp_get(VOID); #endif -/* Determine whether or not stack checking is enabled. By default, ThreadX stack checking is +/* Determine whether or not stack checking is enabled. By default, ThreadX stack checking is disabled. When the following is defined, ThreadX thread stack checking is enabled. If stack checking is enabled (TX_ENABLE_STACK_CHECKING is defined), the TX_DISABLE_STACK_FILLING define is negated, thereby forcing the stack fill which is necessary for the stack checking @@ -237,7 +240,7 @@ ULONG _tx_misra_time_stamp_get(VOID); /* Define the TX_THREAD control block extensions for this port. The main reason - for the multiple macros is so that backward compatibility can be maintained with + for the multiple macros is so that backward compatibility can be maintained with existing ThreadX kernel awareness modules. */ #define TX_THREAD_EXTENSION_0 @@ -293,7 +296,7 @@ ULONG _tx_misra_time_stamp_get(VOID); VOID (*tx_timer_module_expiration_function)(ULONG id); -/* Define the user extension field of the thread control block. Nothing +/* Define the user extension field of the thread control block. Nothing additional is needed for this port so it is defined as white space. */ #ifndef TX_THREAD_USER_EXTENSION @@ -359,7 +362,7 @@ inline static unsigned int _get_ipsr(void) /* Define the get system state macro. */ - + #ifndef TX_THREAD_GET_SYSTEM_STATE #ifndef TX_MISRA_ENABLE #define TX_THREAD_GET_SYSTEM_STATE() (_tx_thread_system_state | _get_ipsr()) @@ -385,15 +388,12 @@ extern void _tx_thread_secure_stack_initialize(void); #define TX_INITIALIZE_KERNEL_ENTER_EXTENSION _tx_thread_secure_stack_initialize(); #endif -/* Define the macro to ensure _tx_thread_preempt_disable is set early in initialization in order to +/* Define the macro to ensure _tx_thread_preempt_disable is set early in initialization in order to prevent early scheduling on Cortex-M parts. */ - + #define TX_PORT_SPECIFIC_POST_INITIALIZATION _tx_thread_preempt_disable++; -/* Determine if the ARM architecture has the CLZ instruction. This is available on - architectures v5 and above. If available, redefine the macro for calculating the - lowest bit set. */ #ifndef TX_DISABLE_INLINE @@ -449,7 +449,8 @@ __attribute__( ( always_inline ) ) static inline void _tx_thread_system_return_i { unsigned int interrupt_save; - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + /* Set PendSV to invoke ThreadX scheduler. */ + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (_get_ipsr() == 0) { interrupt_save = __get_primask_value(); @@ -482,8 +483,8 @@ unsigned int interrupt_save; /* Define the version ID of ThreadX. This may be utilized by the application. */ #ifdef TX_THREAD_INIT -CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M23/GNU Version 6.1.9 *"; +CHAR _tx_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M23/GNU Version 6.1.11 *"; #else #ifdef TX_MISRA_ENABLE extern CHAR _tx_version_id[100]; diff --git a/ports_module/cortex_m23/gnu/module_manager/src/tx_thread_schedule.S b/ports_module/cortex_m23/gnu/module_manager/src/tx_thread_schedule.S index c60919ff..7b640e6f 100644 --- a/ports_module/cortex_m23/gnu/module_manager/src/tx_thread_schedule.S +++ b/ports_module/cortex_m23/gnu/module_manager/src/tx_thread_schedule.S @@ -26,7 +26,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_schedule Cortex-M23/GNU */ -/* 6.1.6 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* Scott Larson, Microsoft Corporation */ @@ -59,6 +59,8 @@ /* DATE NAME DESCRIPTION */ /* */ /* 04-02-2021 Scott Larson Initial Version 6.1.6 */ +/* 04-25-2022 Scott Larson Optimized MPU configuration, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_schedule(VOID) @@ -369,12 +371,20 @@ _skip_secure_restore: LDR r0, [r1, r2] // Pickup the module instance pointer CBZ r0, skip_mpu_setup // Is this thread owned by a module? No, skip MPU setup MOV r8, r1 // Copy thread ptr - LDR r1, [r0, #0x64] // Pickup MPU register[0] - CBZ r1, skip_mpu_setup // Is protection required for this module? No, skip MPU setup + MOVS r2, #0x74 // Index of MPU data region + LDR r2, [r0, r2] // Pickup MPU data region address + CBZ r2, skip_mpu_setup // Is protection required for this module? No, skip MPU setup + + // Is the MPU already set up for this module? + MOVS r1, #2 // Select MPU region 2 + LDR r3, =0xE000ED98 // MPU_RNR register address + STR r1, [r3] // Set region to 2 + LDR r1, =0xE000ED9C // MPU_RBAR register address + LDR r3, [r1] // Load address stored in MPU region 2 + CMP r2, r3 // Is module already loaded? + BEQ _tx_enable_mpu // Yes - skip MPU reconfiguration // Initialize loop to configure MPU registers - // Order doesn't matter, so txm_module_instance_mpu_registers[0] - // will be in region 7 and txm_module_instance_mpu_registers[7] will be in region 0. MOVS r3, #0x64 // Index of MPU register settings in thread control block ADD r0, r0, r3 // Build address of MPU register start in thread control block MOVS r5, #0 // Select region 0 @@ -388,7 +398,7 @@ _tx_mpu_loop: ADDS r5, r5, #1 // Increment to next region CMP r5, #8 // Check if all regions have been set BNE _tx_mpu_loop - +_tx_enable_mpu: LDR r0, =0xE000ED94 // Build MPU control reg address MOVS r1, #5 // Build enable value with background region enabled STR r1, [r0] // Enable MPU diff --git a/ports_module/cortex_m23/iar/inc/tx_port.h b/ports_module/cortex_m23/iar/inc/tx_port.h index 29a4b245..418ffa05 100644 --- a/ports_module/cortex_m23/iar/inc/tx_port.h +++ b/ports_module/cortex_m23/iar/inc/tx_port.h @@ -25,8 +25,8 @@ /* */ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ -/* tx_port.h ARMv8-M */ -/* 6.1.6 */ +/* tx_port.h Cortex-M23/IAR */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -48,6 +48,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 04-02-2021 Scott Larson Initial Version 6.1.6 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -179,7 +182,7 @@ UINT _tx_thread_secure_stack_free(struct TX_THREAD_STRUCT *tx_thread); #endif -/* Define various constants for the ThreadX Cortex-M port. */ +/* Define various constants for the ThreadX Cortex-M23 port. */ #define TX_INT_DISABLE 1 /* Disable interrupts */ #define TX_INT_ENABLE 0 /* Enable interrupts */ @@ -189,14 +192,14 @@ UINT _tx_thread_secure_stack_free(struct TX_THREAD_STRUCT *tx_thread); For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_MISRA_ENABLE #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #else ULONG _tx_misra_time_stamp_get(VOID); @@ -464,7 +467,7 @@ __attribute__( ( always_inline ) ) static inline void __set_CONTROL(ULONG contro else \ { \ ULONG _tx_fpccr; \ - _tx_fpccr = *((ULONG *) 0xE000EF34); \ + _tx_fpccr = *((volatile ULONG *) 0xE000EF34); \ _tx_fpccr = _tx_fpccr & ((ULONG) 0x01); \ if (_tx_fpccr == ((ULONG) 0x01)) \ { \ @@ -644,7 +647,7 @@ __attribute__( ( always_inline ) ) static inline void _tx_thread_system_return_i unsigned int interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (__get_IPSR() == 0) { interrupt_save = __get_primask_value(); @@ -665,7 +668,7 @@ static void _tx_thread_system_return_inline(void) __istate_t interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (__get_IPSR() == 0) { interrupt_save = __get_interrupt_state(); @@ -701,7 +704,7 @@ VOID _tx_thread_interrupt_restore(UIN #ifdef TX_THREAD_INIT CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Modules ARMv8-M Version 6.1.9 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M23/IAR Version 6.1.11 *"; #else #ifdef TX_MISRA_ENABLE extern CHAR _tx_version_id[100]; diff --git a/ports_module/cortex_m23/iar/module_manager/src/tx_thread_schedule.s b/ports_module/cortex_m23/iar/module_manager/src/tx_thread_schedule.s index e523070f..9e6d58bb 100644 --- a/ports_module/cortex_m23/iar/module_manager/src/tx_thread_schedule.s +++ b/ports_module/cortex_m23/iar/module_manager/src/tx_thread_schedule.s @@ -42,7 +42,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_schedule Cortex-M23/IAR */ -/* 6.1.6 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* Scott Larson, Microsoft Corporation */ @@ -75,6 +75,8 @@ /* DATE NAME DESCRIPTION */ /* */ /* 04-02-2021 Scott Larson Initial Version 6.1.6 */ +/* 04-25-2022 Scott Larson Optimized MPU configuration, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_schedule(VOID) @@ -370,12 +372,20 @@ _skip_secure_restore: LDR r0, [r1, r2] // Pickup the module instance pointer CBZ r0, skip_mpu_setup // Is this thread owned by a module? No, skip MPU setup MOV r8, r1 // Copy thread ptr - LDR r1, [r0, #0x64] // Pickup MPU register[0] - CBZ r1, skip_mpu_setup // Is protection required for this module? No, skip MPU setup + MOVS r2, #0x74 // Index of MPU data region + LDR r2, [r0, r2] // Pickup MPU data region address + CBZ r2, skip_mpu_setup // Is protection required for this module? No, skip MPU setup + + // Is the MPU already set up for this module? + MOVS r1, #2 // Select MPU region 2 + LDR r3, =0xE000ED98 // MPU_RNR register address + STR r1, [r3] // Set region to 2 + LDR r1, =0xE000ED9C // MPU_RBAR register address + LDR r3, [r1] // Load address stored in MPU region 2 + CMP r2, r3 // Is module already loaded? + BEQ _tx_enable_mpu // Yes - skip MPU reconfiguration // Initialize loop to configure MPU registers - // Order doesn't matter, so txm_module_instance_mpu_registers[0] - // will be in region 7 and txm_module_instance_mpu_registers[7] will be in region 0. MOVS r3, #0x64 // Index of MPU register settings in thread control block ADD r0, r0, r3 // Build address of MPU register start in thread control block MOVS r5, #0 // Select region 0 @@ -389,7 +399,7 @@ _tx_mpu_loop: ADDS r5, r5, #1 // Increment to next region CMP r5, #8 // Check if all regions have been set BNE _tx_mpu_loop - +_tx_enable_mpu: LDR r0, =0xE000ED94 // Build MPU control reg address MOVS r1, #5 // Build enable value with background region enabled STR r1, [r0] // Enable MPU diff --git a/ports_module/cortex_m3/ac5/inc/tx_port.h b/ports_module/cortex_m3/ac5/inc/tx_port.h index a693d09e..0374d55e 100644 --- a/ports_module/cortex_m3/ac5/inc/tx_port.h +++ b/ports_module/cortex_m3/ac5/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M3/AC5 */ -/* 6.1.9 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -48,6 +48,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 10-15-2021 Scott Larson Initial Version 6.1.9 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -123,13 +126,13 @@ typedef unsigned short USHORT; For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #ifndef TX_TRACE_TIME_MASK #define TX_TRACE_TIME_MASK 0xFFFFFFFFUL @@ -282,7 +285,7 @@ void _tx_vfp_access(void); else \ { \ ULONG _tx_fpccr; \ - _tx_fpccr = *((ULONG *) 0xE000EF34); \ + _tx_fpccr = *((volatile ULONG *) 0xE000EF34); \ _tx_fpccr = _tx_fpccr & ((ULONG) 0x01); \ if (_tx_fpccr == ((ULONG) 0x01)) \ { \ @@ -435,7 +438,7 @@ unsigned int was_masked; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (_ipsr == 0) { was_masked = __disable_irq(); @@ -458,7 +461,7 @@ void tx_thread_fpu_disable(void); #ifdef TX_THREAD_INIT CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M3/AC5 Version 6.1.9 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M3/AC5 Version 6.1.11 *"; #else #ifdef TX_MISRA_ENABLE extern CHAR _tx_version_id[100]; diff --git a/ports_module/cortex_m3/ac5/module_manager/src/tx_thread_schedule.s b/ports_module/cortex_m3/ac5/module_manager/src/tx_thread_schedule.s index 1048802a..6f0f91df 100644 --- a/ports_module/cortex_m3/ac5/module_manager/src/tx_thread_schedule.s +++ b/ports_module/cortex_m3/ac5/module_manager/src/tx_thread_schedule.s @@ -40,7 +40,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_schedule Cortex-M3/AC5 */ -/* 6.1.9 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* Scott Larson, Microsoft Corporation */ @@ -67,13 +67,15 @@ /* */ /* _tx_initialize_kernel_enter ThreadX entry function */ /* _tx_thread_system_return Return to system from thread */ -/* _tx_thread_context_restore Restore thread's context */ /* */ /* RELEASE HISTORY */ /* */ /* DATE NAME DESCRIPTION */ /* */ /* 10-15-2021 Scott Larson Initial Version 6.1.9 */ +/* 04-25-2022 Scott Larson Optimized MPU configuration, */ +/* added BASEPRI support, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_schedule(VOID) @@ -125,7 +127,12 @@ __tx_wait_here EXPORT MemManage_Handler MemManage_Handler +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ /* Now pickup and store all the fault related information. */ @@ -208,7 +215,12 @@ MemManage_Handler LDR r1, =0x10000000 // Set PENDSVSET bit STR r1, [r0] // Store ICSR DSB // Wait for memory access to complete +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts +#endif MOV lr, #0xFFFFFFFD // Load exception return code BX lr // Return from exception @@ -226,12 +238,22 @@ __tx_ts_handler #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) /* Call the thread exit function to indicate the thread is no longer executing. */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ PUSH {r0, lr} // Save LR (and r0 just for alignment) BL _tx_execution_thread_exit // Call the thread exit function POP {r0, lr} // Recover LR +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts -#endif +#endif /* TX_PORT_USE_BASEPRI */ +#endif /* EXECUTION PROFILE */ LDR r0, =_tx_thread_current_ptr // Build current thread pointer address LDR r2, =_tx_thread_execute_ptr // Build execute thread pointer address @@ -276,7 +298,12 @@ __tx_ts_new /* Now we are looking for a new thread to execute! */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Is there another thread ready to execute? CBNZ r1, __tx_ts_restore // Yes, schedule it @@ -285,7 +312,12 @@ __tx_ts_new are disabled to allow use of WFI for waiting for a thread to arrive. */ __tx_ts_wait +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Pickup the next thread to execute pointer CBNZ r1, __tx_ts_ready // If non-NULL, a new thread is ready! #ifdef TX_ENABLE_WFI @@ -293,7 +325,12 @@ __tx_ts_wait WFI // Wait for interrupt ISB // Ensure pipeline is flushed #endif +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_wait // Loop to continue waiting /* At this point, we have a new thread ready to go. Clear any newly pended PendSV - since we are @@ -310,7 +347,12 @@ __tx_ts_restore and enable interrupts. */ STR r1, [r0] // Setup the current thread pointer to the new thread +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif /* Increment the thread run count. */ @@ -346,27 +388,34 @@ __tx_ts_restore STR r3, [r0] // Disable MPU LDR r0, [r1, #0x90] // Pickup the module instance pointer CBZ r0, skip_mpu_setup // Is this thread owned by a module? No, skip MPU setup - LDR r1, [r0, #0x64] // Pickup MPU register[0] - CBZ r1, skip_mpu_setup // Is protection required for this module? No, skip MPU setup - LDR r1, =0xE000ED9C // Build address of MPU base register + + LDR r2, [r0, #0x8C] // Pickup MPU region 5 address + CBZ r2, skip_mpu_setup // Is protection required for this module? No, skip MPU setup + + // Is the MPU already set up for this module? + MOV r1, #5 // Select region 5 from MPU + LDR r3, =0xE000ED98 // MPU_RNR register address + STR r1, [r3] // Set region to 5 + LDR r1, =0xE000ED9C // MPU_RBAR register address + LDR r3, [r1] // Load address stored in MPU region 5 + BIC r2, r2, #0x10 // Clear VALID bit + CMP r2, r3 // Is module already loaded? + BEQ _tx_enable_mpu // Yes - skip MPU reconfiguration // Use alias registers to quickly load MPU ADD r0, r0, #100 // Build address of MPU register start in thread control block -#ifdef TXM_MODULE_MANAGER_16_MPU + LDM r0!,{r2-r9} // Load MPU regions 0-3 STM r1,{r2-r9} // Store MPU regions 0-3 LDM r0!,{r2-r9} // Load MPU regions 4-7 STM r1,{r2-r9} // Store MPU regions 4-7 +#ifdef TXM_MODULE_MANAGER_16_MPU LDM r0!,{r2-r9} // Load MPU regions 8-11 STM r1,{r2-r9} // Store MPU regions 8-11 LDM r0,{r2-r9} // Load MPU regions 12-15 STM r1,{r2-r9} // Store MPU regions 12-15 -#else - LDM r0!,{r2-r9} // Load first four MPU regions - STM r1,{r2-r9} // Store first four MPU regions - LDM r0,{r2-r9} // Load second four MPU regions - STM r1,{r2-r9} // Store second four MPU regions #endif +_tx_enable_mpu LDR r0, =0xE000ED94 // Build MPU control reg address MOV r1, #5 // Build enable value with background region enabled STR r1, [r0] // Enable MPU diff --git a/ports_module/cortex_m3/ac6/inc/tx_port.h b/ports_module/cortex_m3/ac6/inc/tx_port.h index 6f4ebb5b..cd4ce994 100644 --- a/ports_module/cortex_m3/ac6/inc/tx_port.h +++ b/ports_module/cortex_m3/ac6/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M3/AC6 */ -/* 6.1.9 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -48,6 +48,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 10-15-2021 Scott Larson Initial Version 6.1.9 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -123,13 +126,13 @@ typedef unsigned short USHORT; For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #ifndef TX_TRACE_TIME_MASK #define TX_TRACE_TIME_MASK 0xFFFFFFFFUL @@ -291,7 +294,7 @@ __attribute__( ( always_inline ) ) static inline void __set_control(ULONG contro else \ { \ ULONG _tx_fpccr; \ - _tx_fpccr = *((ULONG *) 0xE000EF34); \ + _tx_fpccr = *((volatile ULONG *) 0xE000EF34); \ _tx_fpccr = _tx_fpccr & ((ULONG) 0x01); \ if (_tx_fpccr == ((ULONG) 0x01)) \ { \ @@ -467,7 +470,8 @@ __attribute__( ( always_inline ) ) static inline void _tx_thread_system_return_i { unsigned int interrupt_save; - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + /* Set PendSV to invoke ThreadX scheduler. */ + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (__get_ipsr_value() == 0) { interrupt_save = __get_primask_value(); @@ -497,7 +501,7 @@ unsigned int interrupt_save; #endif -/* Define FPU extension for the Cortex-M7. Each is assumed to be called in the context of the executing +/* Define FPU extension for the Cortex-M3. Each is assumed to be called in the context of the executing thread. These are no longer needed, but are preserved for backward compatibility only. */ void tx_thread_fpu_enable(void); @@ -508,7 +512,7 @@ void tx_thread_fpu_disable(void); #ifdef TX_THREAD_INIT CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M3/AC6 Version 6.1.9 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M3/AC6 Version 6.1.11 *"; #else extern CHAR _tx_version_id[]; #endif diff --git a/ports_module/cortex_m3/ac6/module_manager/src/tx_thread_schedule.S b/ports_module/cortex_m3/ac6/module_manager/src/tx_thread_schedule.S index 081e5c35..4cf1df38 100644 --- a/ports_module/cortex_m3/ac6/module_manager/src/tx_thread_schedule.S +++ b/ports_module/cortex_m3/ac6/module_manager/src/tx_thread_schedule.S @@ -42,7 +42,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_schedule Cortex-M3/AC6 */ -/* 6.1.9 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* Scott Larson, Microsoft Corporation */ @@ -69,13 +69,15 @@ /* */ /* _tx_initialize_kernel_enter ThreadX entry function */ /* _tx_thread_system_return Return to system from thread */ -/* _tx_thread_context_restore Restore thread's context */ /* */ /* RELEASE HISTORY */ /* */ /* DATE NAME DESCRIPTION */ /* */ /* 10-15-2021 Scott Larson Initial Version 6.1.9 */ +/* 04-25-2022 Scott Larson Optimized MPU configuration, */ +/* added BASEPRI support, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_schedule(VOID) @@ -135,7 +137,12 @@ BusFault_Handler: .thumb_func UsageFault_Handler: +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ /* Now pickup and store all the fault related information. */ @@ -197,7 +204,7 @@ UsageFault_Handler: LDR r0, =0xE000EF34 // Cleanup FPU context: Load FPCCR address LDR r1, [r0] // Load FPCCR BIC r1, r1, #1 // Clear the lazy preservation active bit - STR r1, [r0] // Store the value + STR r1, [r0] // Save FPCCR #endif BL _txm_module_manager_memory_fault_handler // Call memory manager fault handler @@ -218,7 +225,12 @@ UsageFault_Handler: LDR r1, =0x10000000 // Set PENDSVSET bit STR r1, [r0] // Store ICSR DSB // Wait for memory access to complete +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts +#endif MOV lr, #0xFFFFFFFD // Load exception return code BX lr // Return from exception @@ -239,12 +251,22 @@ __tx_ts_handler: #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) /* Call the thread exit function to indicate the thread is no longer executing. */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ PUSH {r0, lr} // Save LR (and r0 just for alignment) BL _tx_execution_thread_exit // Call the thread exit function POP {r0, lr} // Recover LR +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts -#endif +#endif /* TX_PORT_USE_BASEPRI */ +#endif /* EXECUTION PROFILE */ LDR r0, =_tx_thread_current_ptr // Build current thread pointer address LDR r2, =_tx_thread_execute_ptr // Build execute thread pointer address @@ -289,7 +311,12 @@ __tx_ts_new: /* Now we are looking for a new thread to execute! */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Is there another thread ready to execute? CBNZ r1, __tx_ts_restore // Yes, schedule it @@ -298,7 +325,12 @@ __tx_ts_new: are disabled to allow use of WFI for waiting for a thread to arrive. */ __tx_ts_wait: +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Pickup the next thread to execute pointer CBNZ r1, __tx_ts_ready // If non-NULL, a new thread is ready! #ifdef TX_ENABLE_WFI @@ -306,7 +338,12 @@ __tx_ts_wait: WFI // Wait for interrupt ISB // Ensure pipeline is flushed #endif +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_wait // Loop to continue waiting /* At this point, we have a new thread ready to go. Clear any newly pended PendSV - since we are @@ -323,7 +360,12 @@ __tx_ts_restore: and enable interrupts. */ STR r1, [r0] // Setup the current thread pointer to the new thread +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif /* Increment the thread run count. */ @@ -359,27 +401,34 @@ __tx_ts_restore: STR r3, [r0] // Disable MPU LDR r0, [r1, #0x90] // Pickup the module instance pointer CBZ r0, skip_mpu_setup // Is this thread owned by a module? No, skip MPU setup - LDR r1, [r0, #0x64] // Pickup MPU register[0] - CBZ r1, skip_mpu_setup // Is protection required for this module? No, skip MPU setup - LDR r1, =0xE000ED9C // Build address of MPU base register + + LDR r2, [r0, #0x8C] // Pickup MPU region 5 address + CBZ r2, skip_mpu_setup // Is protection required for this module? No, skip MPU setup + + // Is the MPU already set up for this module? + MOV r1, #5 // Select region 5 from MPU + LDR r3, =0xE000ED98 // MPU_RNR register address + STR r1, [r3] // Set region to 5 + LDR r1, =0xE000ED9C // MPU_RBAR register address + LDR r3, [r1] // Load address stored in MPU region 5 + BIC r2, r2, #0x10 // Clear VALID bit + CMP r2, r3 // Is module already loaded? + BEQ _tx_enable_mpu // Yes - skip MPU reconfiguration // Use alias registers to quickly load MPU ADD r0, r0, #100 // Build address of MPU register start in thread control block -#ifdef TXM_MODULE_MANAGER_16_MPU + LDM r0!,{r2-r9} // Load MPU regions 0-3 STM r1,{r2-r9} // Store MPU regions 0-3 LDM r0!,{r2-r9} // Load MPU regions 4-7 STM r1,{r2-r9} // Store MPU regions 4-7 +#ifdef TXM_MODULE_MANAGER_16_MPU LDM r0!,{r2-r9} // Load MPU regions 8-11 STM r1,{r2-r9} // Store MPU regions 8-11 LDM r0,{r2-r9} // Load MPU regions 12-15 STM r1,{r2-r9} // Store MPU regions 12-15 -#else - LDM r0!,{r2-r9} // Load first four MPU regions - STM r1,{r2-r9} // Store first four MPU regions - LDM r0,{r2-r9} // Load second four MPU regions - STM r1,{r2-r9} // Store second four MPU regions #endif +_tx_enable_mpu: LDR r0, =0xE000ED94 // Build MPU control reg address MOV r1, #5 // Build enable value with background region enabled STR r1, [r0] // Enable MPU @@ -538,14 +587,14 @@ _tx_no_lazy_clear: #endif /* Copy kernel hardware stack to module thread stack. */ - LDM r3!, {r1-r2} - STM r0!, {r1-r2} - LDM r3!, {r1-r2} - STM r0!, {r1-r2} - LDM r3!, {r1-r2} - STM r0!, {r1-r2} - LDM r3!, {r1-r2} - STM r0!, {r1-r2} + LDM r3!, {r1-r2} // Get r0, r1 from kernel stack + STM r0!, {r1-r2} // Insert r0, r1 into thread stack + LDM r3!, {r1-r2} // Get r2, r3 from kernel stack + STM r0!, {r1-r2} // Insert r2, r3 into thread stack + LDM r3!, {r1-r2} // Get r12, lr from kernel stack + STM r0!, {r1-r2} // Insert r12, lr into thread stack + LDM r3!, {r1-r2} // Get pc, xpsr from kernel stack + STM r0!, {r1-r2} // Insert pc, xpsr into thread stack SUB r0, r0, #32 // Subtract 32 to get back to top of stack MSR PSP, r0 // Set thread stack pointer diff --git a/ports_module/cortex_m3/gnu/inc/tx_port.h b/ports_module/cortex_m3/gnu/inc/tx_port.h index a3f91e24..b4197c96 100644 --- a/ports_module/cortex_m3/gnu/inc/tx_port.h +++ b/ports_module/cortex_m3/gnu/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M3/GNU */ -/* 6.1.9 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -48,6 +48,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 10-15-2021 Scott Larson Initial Version 6.1.9 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -123,13 +126,13 @@ typedef unsigned short USHORT; For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #ifndef TX_TRACE_TIME_MASK #define TX_TRACE_TIME_MASK 0xFFFFFFFFUL @@ -291,7 +294,7 @@ __attribute__( ( always_inline ) ) static inline void __set_control(ULONG contro else \ { \ ULONG _tx_fpccr; \ - _tx_fpccr = *((ULONG *) 0xE000EF34); \ + _tx_fpccr = *((volatile ULONG *) 0xE000EF34); \ _tx_fpccr = _tx_fpccr & ((ULONG) 0x01); \ if (_tx_fpccr == ((ULONG) 0x01)) \ { \ @@ -461,7 +464,8 @@ __attribute__( ( always_inline ) ) static inline void _tx_thread_system_return_i { unsigned int interrupt_save; - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + /* Set PendSV to invoke ThreadX scheduler. */ + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (__get_ipsr_value() == 0) { interrupt_save = __get_primask_value(); @@ -491,8 +495,8 @@ unsigned int interrupt_save; #endif -/* Define FPU extension for the Cortex-M7. Each is assumed to be called in the context of the executing - thread. This is for legacy only, and not needed any longer. */ +/* Define FPU extension for the Cortex-M3. Each is assumed to be called in the context of the executing + thread. These are no longer needed, but are preserved for backward compatibility only. */ void tx_thread_fpu_enable(void); void tx_thread_fpu_disable(void); @@ -502,7 +506,7 @@ void tx_thread_fpu_disable(void); #ifdef TX_THREAD_INIT CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M3/GNU Version 6.1.9 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M3/GNU Version 6.1.11 *"; #else extern CHAR _tx_version_id[]; #endif diff --git a/ports_module/cortex_m3/gnu/module_manager/src/tx_thread_schedule.S b/ports_module/cortex_m3/gnu/module_manager/src/tx_thread_schedule.S index b19b6cc8..e5d101b5 100644 --- a/ports_module/cortex_m3/gnu/module_manager/src/tx_thread_schedule.S +++ b/ports_module/cortex_m3/gnu/module_manager/src/tx_thread_schedule.S @@ -40,7 +40,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_schedule Cortex-M3/GNU */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* Scott Larson, Microsoft Corporation */ @@ -67,7 +67,6 @@ /* */ /* _tx_initialize_kernel_enter ThreadX entry function */ /* _tx_thread_system_return Return to system from thread */ -/* _tx_thread_context_restore Restore thread's context */ /* */ /* RELEASE HISTORY */ /* */ @@ -76,6 +75,9 @@ /* 10-15-2021 Scott Larson Initial Version 6.1.9 */ /* 01-31-2022 Scott Larson Fixed predefined macro name, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 Scott Larson Optimized MPU configuration, */ +/* added BASEPRI support, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_schedule(VOID) @@ -135,7 +137,12 @@ BusFault_Handler: .thumb_func UsageFault_Handler: +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ /* Now pickup and store all the fault related information. */ @@ -197,7 +204,7 @@ UsageFault_Handler: LDR r0, =0xE000EF34 // Cleanup FPU context: Load FPCCR address LDR r1, [r0] // Load FPCCR BIC r1, r1, #1 // Clear the lazy preservation active bit - STR r1, [r0] // Store the value + STR r1, [r0] // Save FPCCR #endif BL _txm_module_manager_memory_fault_handler // Call memory manager fault handler @@ -218,7 +225,12 @@ UsageFault_Handler: LDR r1, =0x10000000 // Set PENDSVSET bit STR r1, [r0] // Store ICSR DSB // Wait for memory access to complete +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts +#endif MOV lr, #0xFFFFFFFD // Load exception return code BX lr // Return from exception @@ -239,12 +251,22 @@ __tx_ts_handler: #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) /* Call the thread exit function to indicate the thread is no longer executing. */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ PUSH {r0, lr} // Save LR (and r0 just for alignment) BL _tx_execution_thread_exit // Call the thread exit function POP {r0, lr} // Recover LR +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts -#endif +#endif /* TX_PORT_USE_BASEPRI */ +#endif /* EXECUTION PROFILE */ LDR r0, =_tx_thread_current_ptr // Build current thread pointer address LDR r2, =_tx_thread_execute_ptr // Build execute thread pointer address @@ -289,7 +311,12 @@ __tx_ts_new: /* Now we are looking for a new thread to execute! */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Is there another thread ready to execute? CBNZ r1, __tx_ts_restore // Yes, schedule it @@ -298,7 +325,12 @@ __tx_ts_new: are disabled to allow use of WFI for waiting for a thread to arrive. */ __tx_ts_wait: +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Pickup the next thread to execute pointer CBNZ r1, __tx_ts_ready // If non-NULL, a new thread is ready! #ifdef TX_ENABLE_WFI @@ -306,7 +338,12 @@ __tx_ts_wait: WFI // Wait for interrupt ISB // Ensure pipeline is flushed #endif +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_wait // Loop to continue waiting /* At this point, we have a new thread ready to go. Clear any newly pended PendSV - since we are @@ -323,7 +360,12 @@ __tx_ts_restore: and enable interrupts. */ STR r1, [r0] // Setup the current thread pointer to the new thread +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif /* Increment the thread run count. */ @@ -359,27 +401,34 @@ __tx_ts_restore: STR r3, [r0] // Disable MPU LDR r0, [r1, #0x90] // Pickup the module instance pointer CBZ r0, skip_mpu_setup // Is this thread owned by a module? No, skip MPU setup - LDR r1, [r0, #0x64] // Pickup MPU register[0] - CBZ r1, skip_mpu_setup // Is protection required for this module? No, skip MPU setup - LDR r1, =0xE000ED9C // Build address of MPU base register + + LDR r2, [r0, #0x8C] // Pickup MPU region 5 address + CBZ r2, skip_mpu_setup // Is protection required for this module? No, skip MPU setup + + // Is the MPU already set up for this module? + MOV r1, #5 // Select region 5 from MPU + LDR r3, =0xE000ED98 // MPU_RNR register address + STR r1, [r3] // Set region to 5 + LDR r1, =0xE000ED9C // MPU_RBAR register address + LDR r3, [r1] // Load address stored in MPU region 5 + BIC r2, r2, #0x10 // Clear VALID bit + CMP r2, r3 // Is module already loaded? + BEQ _tx_enable_mpu // Yes - skip MPU reconfiguration // Use alias registers to quickly load MPU ADD r0, r0, #100 // Build address of MPU register start in thread control block -#ifdef TXM_MODULE_MANAGER_16_MPU + LDM r0!,{r2-r9} // Load MPU regions 0-3 STM r1,{r2-r9} // Store MPU regions 0-3 LDM r0!,{r2-r9} // Load MPU regions 4-7 STM r1,{r2-r9} // Store MPU regions 4-7 +#ifdef TXM_MODULE_MANAGER_16_MPU LDM r0!,{r2-r9} // Load MPU regions 8-11 STM r1,{r2-r9} // Store MPU regions 8-11 LDM r0,{r2-r9} // Load MPU regions 12-15 STM r1,{r2-r9} // Store MPU regions 12-15 -#else - LDM r0!,{r2-r9} // Load first four MPU regions - STM r1,{r2-r9} // Store first four MPU regions - LDM r0,{r2-r9} // Load second four MPU regions - STM r1,{r2-r9} // Store second four MPU regions #endif +_tx_enable_mpu: LDR r0, =0xE000ED94 // Build MPU control reg address MOV r1, #5 // Build enable value with background region enabled STR r1, [r0] // Enable MPU diff --git a/ports_module/cortex_m3/iar/inc/tx_port.h b/ports_module/cortex_m3/iar/inc/tx_port.h index c9c13b3c..6ed2c186 100644 --- a/ports_module/cortex_m3/iar/inc/tx_port.h +++ b/ports_module/cortex_m3/iar/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M3/IAR */ -/* 6.1.9 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -48,6 +48,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 10-15-2021 Scott Larson Initial Version 6.1.9 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -127,14 +130,14 @@ typedef unsigned short USHORT; For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_MISRA_ENABLE #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #else ULONG _tx_misra_time_stamp_get(VOID); @@ -325,7 +328,7 @@ void _tx_misra_vfp_touch(void); else \ { \ ULONG _tx_fpccr; \ - _tx_fpccr = *((ULONG *) 0xE000EF34); \ + _tx_fpccr = *((volatile ULONG *) 0xE000EF34); \ _tx_fpccr = _tx_fpccr & ((ULONG) 0x01); \ if (_tx_fpccr == ((ULONG) 0x01)) \ { \ @@ -476,7 +479,7 @@ static void _tx_thread_system_return_inline(void) __istate_t interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (__get_IPSR() == 0) { interrupt_save = __get_interrupt_state(); @@ -488,7 +491,7 @@ __istate_t interrupt_save; #endif -/* Define FPU extension for the Cortex-M7. Each is assumed to be called in the context of the executing +/* Define FPU extension for the Cortex-M3. Each is assumed to be called in the context of the executing thread. These are no longer needed, but are preserved for backward compatibility only. */ void tx_thread_fpu_enable(void); diff --git a/ports_module/cortex_m3/iar/module_manager/src/tx_thread_schedule.s b/ports_module/cortex_m3/iar/module_manager/src/tx_thread_schedule.s index d6bd477c..6326b800 100644 --- a/ports_module/cortex_m3/iar/module_manager/src/tx_thread_schedule.s +++ b/ports_module/cortex_m3/iar/module_manager/src/tx_thread_schedule.s @@ -36,7 +36,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_schedule Cortex-M3/IAR */ -/* 6.1.9 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* Scott Larson, Microsoft Corporation */ @@ -63,13 +63,15 @@ /* */ /* _tx_initialize_kernel_enter ThreadX entry function */ /* _tx_thread_system_return Return to system from thread */ -/* _tx_thread_context_restore Restore thread's context */ /* */ /* RELEASE HISTORY */ /* */ /* DATE NAME DESCRIPTION */ /* */ /* 10-15-2021 Scott Larson Initial Version 6.1.9 */ +/* 04-25-2022 Scott Larson Optimized MPU configuration, */ +/* added BASEPRI support, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_schedule(VOID) @@ -125,8 +127,12 @@ __tx_wait_here: MemManage_Handler: BusFault_Handler: UsageFault_Handler: - +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ /* Now pickup and store all the fault related information. */ @@ -209,7 +215,12 @@ UsageFault_Handler: LDR r1, =0x10000000 // Set PENDSVSET bit STR r1, [r0] // Store ICSR DSB // Wait for memory access to complete +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts +#endif MOV lr, #0xFFFFFFFD // Load exception return code BX lr // Return from exception @@ -227,12 +238,22 @@ __tx_ts_handler: #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) /* Call the thread exit function to indicate the thread is no longer executing. */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ PUSH {r0, lr} // Save LR (and r0 just for alignment) BL _tx_execution_thread_exit // Call the thread exit function POP {r0, lr} // Recover LR +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts -#endif +#endif /* TX_PORT_USE_BASEPRI */ +#endif /* EXECUTION PROFILE */ LDR r0, =_tx_thread_current_ptr // Build current thread pointer address LDR r2, =_tx_thread_execute_ptr // Build execute thread pointer address @@ -277,7 +298,12 @@ __tx_ts_new: /* Now we are looking for a new thread to execute! */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Is there another thread ready to execute? CBNZ r1, __tx_ts_restore // Yes, schedule it @@ -286,7 +312,12 @@ __tx_ts_new: are disabled to allow use of WFI for waiting for a thread to arrive. */ __tx_ts_wait: +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Pickup the next thread to execute pointer CBNZ r1, __tx_ts_ready // If non-NULL, a new thread is ready! #ifdef TX_ENABLE_WFI @@ -294,7 +325,12 @@ __tx_ts_wait: WFI // Wait for interrupt ISB // Ensure pipeline is flushed #endif +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_wait // Loop to continue waiting /* At this point, we have a new thread ready to go. Clear any newly pended PendSV - since we are @@ -311,7 +347,12 @@ __tx_ts_restore: and enable interrupts. */ STR r1, [r0] // Setup the current thread pointer to the new thread +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif /* Increment the thread run count. */ @@ -347,27 +388,34 @@ __tx_ts_restore: STR r3, [r0] // Disable MPU LDR r0, [r1, #0x90] // Pickup the module instance pointer CBZ r0, skip_mpu_setup // Is this thread owned by a module? No, skip MPU setup - LDR r1, [r0, #0x64] // Pickup MPU register[0] - CBZ r1, skip_mpu_setup // Is protection required for this module? No, skip MPU setup - LDR r1, =0xE000ED9C // Build address of MPU base register + + LDR r2, [r0, #0x8C] // Pickup MPU region 5 address + CBZ r2, skip_mpu_setup // Is protection required for this module? No, skip MPU setup + + // Is the MPU already set up for this module? + MOV r1, #5 // Select region 5 from MPU + LDR r3, =0xE000ED98 // MPU_RNR register address + STR r1, [r3] // Set region to 5 + LDR r1, =0xE000ED9C // MPU_RBAR register address + LDR r3, [r1] // Load address stored in MPU region 5 + BIC r2, r2, #0x10 // Clear VALID bit + CMP r2, r3 // Is module already loaded? + BEQ _tx_enable_mpu // Yes - skip MPU reconfiguration // Use alias registers to quickly load MPU ADD r0, r0, #100 // Build address of MPU register start in thread control block -#ifdef TXM_MODULE_MANAGER_16_MPU + LDM r0!,{r2-r9} // Load MPU regions 0-3 STM r1,{r2-r9} // Store MPU regions 0-3 LDM r0!,{r2-r9} // Load MPU regions 4-7 STM r1,{r2-r9} // Store MPU regions 4-7 +#ifdef TXM_MODULE_MANAGER_16_MPU LDM r0!,{r2-r9} // Load MPU regions 8-11 STM r1,{r2-r9} // Store MPU regions 8-11 LDM r0,{r2-r9} // Load MPU regions 12-15 STM r1,{r2-r9} // Store MPU regions 12-15 -#else - LDM r0!,{r2-r9} // Load first four MPU regions - STM r1,{r2-r9} // Store first four MPU regions - LDM r0,{r2-r9} // Load second four MPU regions - STM r1,{r2-r9} // Store second four MPU regions #endif +_tx_enable_mpu: LDR r0, =0xE000ED94 // Build MPU control reg address MOV r1, #5 // Build enable value with background region enabled STR r1, [r0] // Enable MPU diff --git a/ports_module/cortex_m33/ac6/inc/tx_port.h b/ports_module/cortex_m33/ac6/inc/tx_port.h index eb4a7f5f..e3547602 100644 --- a/ports_module/cortex_m33/ac6/inc/tx_port.h +++ b/ports_module/cortex_m33/ac6/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M33 */ -/* 6.1.10 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -61,13 +61,16 @@ /* added symbol to enable */ /* stack error handler, */ /* resulting in version 6.1.7 */ -/* 10-15-2021 Scott Larson Modified comment(s), improved */ +/* 10-15-2021 Scott Larson Modified comment(s), improved */ /* stack check error handling, */ /* resulting in version 6.1.9 */ /* 01-31-2022 Scott Larson Modified comment(s), unified */ /* this file across compilers, */ /* fixed predefined macro, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -196,14 +199,14 @@ UINT _tx_thread_secure_stack_free(struct TX_THREAD_STRUCT *tx_thread); For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_MISRA_ENABLE #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #else ULONG _tx_misra_time_stamp_get(VOID); @@ -429,9 +432,9 @@ __attribute__( ( always_inline ) ) static inline void _tx_control_set(ULONG cont #define TX_THREAD_COMPLETED_EXTENSION(thread_ptr) { \ ULONG _tx_vfp_state; \ - _tx_vfp_state = _tx_control_get(); \ + _tx_vfp_state = _tx_control_get(); \ _tx_vfp_state = _tx_vfp_state & ~((ULONG) 0x4); \ - _tx_control_set(_tx_vfp_state); \ + _tx_control_set(_tx_vfp_state); \ } #else @@ -456,26 +459,26 @@ __attribute__( ( always_inline ) ) static inline void _tx_control_set(ULONG cont if ((_tx_system_state == ((ULONG) 0)) && ((thread_ptr) == _tx_thread_current_ptr)) \ { \ ULONG _tx_vfp_state; \ - _tx_vfp_state = _tx_control_get(); \ + _tx_vfp_state = _tx_control_get(); \ _tx_vfp_state = _tx_vfp_state & ~((ULONG) 0x4); \ - _tx_control_set(_tx_vfp_state); \ + _tx_control_set(_tx_vfp_state); \ } \ else \ { \ ULONG _tx_fpccr; \ - _tx_fpccr = *((ULONG *) 0xE000EF34); \ + _tx_fpccr = *((volatile ULONG *) 0xE000EF34); \ _tx_fpccr = _tx_fpccr & ((ULONG) 0x01); \ if (_tx_fpccr == ((ULONG) 0x01)) \ { \ ULONG _tx_vfp_state; \ - _tx_vfp_state = _tx_control_get(); \ + _tx_vfp_state = _tx_control_get(); \ _tx_vfp_state = _tx_vfp_state & ((ULONG) 0x4); \ TX_VFP_TOUCH(); \ if (_tx_vfp_state == ((ULONG) 0)) \ { \ - _tx_vfp_state = _tx_control_get(); \ + _tx_vfp_state = _tx_control_get(); \ _tx_vfp_state = _tx_vfp_state & ~((ULONG) 0x4); \ - _tx_control_set(_tx_vfp_state); \ + _tx_control_set(_tx_vfp_state); \ } \ } \ } \ @@ -657,7 +660,7 @@ __attribute__( ( always_inline ) ) static inline void _tx_thread_system_return_i UINT interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (_tx_ipsr_get() == 0) { interrupt_save = __get_interrupt_posture(); diff --git a/ports_module/cortex_m33/ac6/module_manager/src/tx_thread_schedule.S b/ports_module/cortex_m33/ac6/module_manager/src/tx_thread_schedule.S index 8ef9e2cb..c196f75a 100644 --- a/ports_module/cortex_m33/ac6/module_manager/src/tx_thread_schedule.S +++ b/ports_module/cortex_m33/ac6/module_manager/src/tx_thread_schedule.S @@ -29,8 +29,8 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _tx_thread_schedule Cortex-M33/MPU/AC6 */ -/* 6.1.7 */ +/* _tx_thread_schedule Cortex-M33/AC6 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* Scott Larson, Microsoft Corporation */ @@ -69,6 +69,9 @@ /* 06-02-2021 Scott Larson Fixed extended stack handling */ /* when calling kernel APIs, */ /* resulting in version 6.1.7 */ +/* 04-25-2022 Scott Larson Optimized MPU configuration, */ +/* added BASEPRI support, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_schedule(VOID) @@ -128,7 +131,12 @@ MemManage_Handler: .thumb_func BusFault_Handler: +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ /* Now pickup and store all the fault related information. */ @@ -195,7 +203,7 @@ BusFault_Handler: BL _txm_module_manager_memory_fault_handler // Call memory manager fault handler -#ifdef TX_ENABLE_EXECUTION_CHANGE_NOTIFY +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) /* Call the thread exit function to indicate the thread is no longer executing. */ CPSID i // Disable interrupts BL _tx_execution_thread_exit // Call the thread exit function @@ -211,7 +219,12 @@ BusFault_Handler: LDR r1, =0x10000000 // Set PENDSVSET bit STR r1, [r0] // Store ICSR DSB // Wait for memory access to complete +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts +#endif #ifdef TX_SINGLE_MODE_SECURE LDR lr, =0xFFFFFFFD // Exception return to secure #else @@ -235,12 +248,22 @@ __tx_ts_handler: #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) /* Call the thread exit function to indicate the thread is no longer executing. */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ PUSH {r0, lr} // Save LR (and r0 just for alignment) BL _tx_execution_thread_exit // Call the thread exit function POP {r0, lr} // Recover LR +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts -#endif +#endif /* TX_PORT_USE_BASEPRI */ +#endif /* EXECUTION PROFILE */ LDR r0, =_tx_thread_current_ptr // Build current thread pointer address LDR r2, =_tx_thread_execute_ptr // Build execute thread pointer address @@ -296,7 +319,12 @@ __tx_ts_new: /* Now we are looking for a new thread to execute! */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Is there another thread ready to execute? CBNZ r1, __tx_ts_restore // Yes, schedule it @@ -305,7 +333,12 @@ __tx_ts_new: are disabled to allow use of WFI for waiting for a thread to arrive. */ __tx_ts_wait: +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Pickup the next thread to execute pointer CBNZ r1, __tx_ts_ready // If non-NULL, a new thread is ready! #ifdef TX_ENABLE_WFI @@ -313,7 +346,12 @@ __tx_ts_wait: WFI // Wait for interrupt ISB // Ensure pipeline is flushed #endif +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_wait // Loop to continue waiting /* At this point, we have a new thread ready to go. Clear any newly pended PendSV - since we are @@ -330,7 +368,12 @@ __tx_ts_restore: and enable interrupts. */ STR r1, [r0] // Setup the current thread pointer to the new thread +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif /* Increment the thread run count. */ @@ -378,9 +421,17 @@ _skip_secure_restore: STR r3, [r0] // Disable MPU LDR r0, [r1, #0x90] // Pickup the module instance pointer CBZ r0, skip_mpu_setup // Is this thread owned by a module? No, skip MPU setup - LDR r1, [r0, #0x64] // Pickup MPU register[0] - CBZ r1, skip_mpu_setup // Is protection required for this module? No, skip MPU setup - LDR r1, =0xE000ED9C // Build address of MPU base register + LDR r2, [r0, #0x74] // Pickup MPU address of data region + CBZ r2, skip_mpu_setup // Is protection required for this module? No, skip MPU setup + + // Is the MPU already set up for this module? + MOV r1, #2 // Select MPU region 2 + LDR r3, =0xE000ED98 // MPU_RNR register address + STR r1, [r3] // Set region to 2 + LDR r1, =0xE000ED9C // MPU_RBAR register address + LDR r3, [r1] // Load address stored in MPU region 2 + CMP r2, r3 // Is module already loaded? + BEQ _tx_enable_mpu // Yes - skip MPU reconfiguration // Use alias registers to quickly load MPU LDR r2, =0xE000ED98 // Get region register @@ -393,6 +444,7 @@ _skip_secure_restore: STR r2, [r3] // Set region to 4 LDM r0, {r2-r9} // Load second four MPU regions STM r1, {r2-r9} // Store second four MPU regions +_tx_enable_mpu: LDR r0, =0xE000ED94 // Build MPU control reg address MOV r1, #5 // Build enable value with background region enabled STR r1, [r0] // Enable MPU diff --git a/ports_module/cortex_m33/gnu/inc/tx_port.h b/ports_module/cortex_m33/gnu/inc/tx_port.h index eb4a7f5f..e3547602 100644 --- a/ports_module/cortex_m33/gnu/inc/tx_port.h +++ b/ports_module/cortex_m33/gnu/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M33 */ -/* 6.1.10 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -61,13 +61,16 @@ /* added symbol to enable */ /* stack error handler, */ /* resulting in version 6.1.7 */ -/* 10-15-2021 Scott Larson Modified comment(s), improved */ +/* 10-15-2021 Scott Larson Modified comment(s), improved */ /* stack check error handling, */ /* resulting in version 6.1.9 */ /* 01-31-2022 Scott Larson Modified comment(s), unified */ /* this file across compilers, */ /* fixed predefined macro, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -196,14 +199,14 @@ UINT _tx_thread_secure_stack_free(struct TX_THREAD_STRUCT *tx_thread); For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_MISRA_ENABLE #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #else ULONG _tx_misra_time_stamp_get(VOID); @@ -429,9 +432,9 @@ __attribute__( ( always_inline ) ) static inline void _tx_control_set(ULONG cont #define TX_THREAD_COMPLETED_EXTENSION(thread_ptr) { \ ULONG _tx_vfp_state; \ - _tx_vfp_state = _tx_control_get(); \ + _tx_vfp_state = _tx_control_get(); \ _tx_vfp_state = _tx_vfp_state & ~((ULONG) 0x4); \ - _tx_control_set(_tx_vfp_state); \ + _tx_control_set(_tx_vfp_state); \ } #else @@ -456,26 +459,26 @@ __attribute__( ( always_inline ) ) static inline void _tx_control_set(ULONG cont if ((_tx_system_state == ((ULONG) 0)) && ((thread_ptr) == _tx_thread_current_ptr)) \ { \ ULONG _tx_vfp_state; \ - _tx_vfp_state = _tx_control_get(); \ + _tx_vfp_state = _tx_control_get(); \ _tx_vfp_state = _tx_vfp_state & ~((ULONG) 0x4); \ - _tx_control_set(_tx_vfp_state); \ + _tx_control_set(_tx_vfp_state); \ } \ else \ { \ ULONG _tx_fpccr; \ - _tx_fpccr = *((ULONG *) 0xE000EF34); \ + _tx_fpccr = *((volatile ULONG *) 0xE000EF34); \ _tx_fpccr = _tx_fpccr & ((ULONG) 0x01); \ if (_tx_fpccr == ((ULONG) 0x01)) \ { \ ULONG _tx_vfp_state; \ - _tx_vfp_state = _tx_control_get(); \ + _tx_vfp_state = _tx_control_get(); \ _tx_vfp_state = _tx_vfp_state & ((ULONG) 0x4); \ TX_VFP_TOUCH(); \ if (_tx_vfp_state == ((ULONG) 0)) \ { \ - _tx_vfp_state = _tx_control_get(); \ + _tx_vfp_state = _tx_control_get(); \ _tx_vfp_state = _tx_vfp_state & ~((ULONG) 0x4); \ - _tx_control_set(_tx_vfp_state); \ + _tx_control_set(_tx_vfp_state); \ } \ } \ } \ @@ -657,7 +660,7 @@ __attribute__( ( always_inline ) ) static inline void _tx_thread_system_return_i UINT interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (_tx_ipsr_get() == 0) { interrupt_save = __get_interrupt_posture(); diff --git a/ports_module/cortex_m33/gnu/module_manager/src/tx_thread_schedule.S b/ports_module/cortex_m33/gnu/module_manager/src/tx_thread_schedule.S index 034f8b17..ff454e9c 100644 --- a/ports_module/cortex_m33/gnu/module_manager/src/tx_thread_schedule.S +++ b/ports_module/cortex_m33/gnu/module_manager/src/tx_thread_schedule.S @@ -28,8 +28,8 @@ /* */ /* FUNCTION RELEASE */ /* */ -/* _tx_thread_schedule Cortex-M33/MPU/GNU */ -/* 6.1.10 */ +/* _tx_thread_schedule Cortex-M33/GNU */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* Scott Larson, Microsoft Corporation */ @@ -70,6 +70,9 @@ /* resulting in version 6.1.7 */ /* 01-31-2022 Scott Larson Fixed predefined macro name, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 Scott Larson Optimized MPU configuration, */ +/* added BASEPRI support, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_schedule(VOID) @@ -129,7 +132,12 @@ MemManage_Handler: .thumb_func BusFault_Handler: +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ /* Now pickup and store all the fault related information. */ @@ -196,7 +204,7 @@ BusFault_Handler: BL _txm_module_manager_memory_fault_handler // Call memory manager fault handler -#ifdef TX_ENABLE_EXECUTION_CHANGE_NOTIFY +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) /* Call the thread exit function to indicate the thread is no longer executing. */ CPSID i // Disable interrupts BL _tx_execution_thread_exit // Call the thread exit function @@ -212,7 +220,12 @@ BusFault_Handler: LDR r1, =0x10000000 // Set PENDSVSET bit STR r1, [r0] // Store ICSR DSB // Wait for memory access to complete +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts +#endif #ifdef TX_SINGLE_MODE_SECURE LDR lr, =0xFFFFFFFD // Exception return to secure #else @@ -236,12 +249,22 @@ __tx_ts_handler: #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) /* Call the thread exit function to indicate the thread is no longer executing. */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ PUSH {r0, lr} // Save LR (and r0 just for alignment) BL _tx_execution_thread_exit // Call the thread exit function POP {r0, lr} // Recover LR +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts -#endif +#endif /* TX_PORT_USE_BASEPRI */ +#endif /* EXECUTION PROFILE */ LDR r0, =_tx_thread_current_ptr // Build current thread pointer address LDR r2, =_tx_thread_execute_ptr // Build execute thread pointer address @@ -297,7 +320,12 @@ __tx_ts_new: /* Now we are looking for a new thread to execute! */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Is there another thread ready to execute? CBNZ r1, __tx_ts_restore // Yes, schedule it @@ -306,7 +334,12 @@ __tx_ts_new: are disabled to allow use of WFI for waiting for a thread to arrive. */ __tx_ts_wait: +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Pickup the next thread to execute pointer CBNZ r1, __tx_ts_ready // If non-NULL, a new thread is ready! #ifdef TX_ENABLE_WFI @@ -314,7 +347,12 @@ __tx_ts_wait: WFI // Wait for interrupt ISB // Ensure pipeline is flushed #endif +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_wait // Loop to continue waiting /* At this point, we have a new thread ready to go. Clear any newly pended PendSV - since we are @@ -331,7 +369,12 @@ __tx_ts_restore: and enable interrupts. */ STR r1, [r0] // Setup the current thread pointer to the new thread +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif /* Increment the thread run count. */ @@ -379,9 +422,17 @@ _skip_secure_restore: STR r3, [r0] // Disable MPU LDR r0, [r1, #0x90] // Pickup the module instance pointer CBZ r0, skip_mpu_setup // Is this thread owned by a module? No, skip MPU setup - LDR r1, [r0, #0x64] // Pickup MPU register[0] - CBZ r1, skip_mpu_setup // Is protection required for this module? No, skip MPU setup - LDR r1, =0xE000ED9C // Build address of MPU base register + LDR r2, [r0, #0x74] // Pickup MPU address of data region + CBZ r2, skip_mpu_setup // Is protection required for this module? No, skip MPU setup + + // Is the MPU already set up for this module? + MOV r1, #2 // Select MPU region 2 + LDR r3, =0xE000ED98 // MPU_RNR register address + STR r1, [r3] // Set region to 2 + LDR r1, =0xE000ED9C // MPU_RBAR register address + LDR r3, [r1] // Load address stored in MPU region 2 + CMP r2, r3 // Is module already loaded? + BEQ _tx_enable_mpu // Yes - skip MPU reconfiguration // Use alias registers to quickly load MPU LDR r2, =0xE000ED98 // Get region register @@ -394,6 +445,7 @@ _skip_secure_restore: STR r2, [r3] // Set region to 4 LDM r0, {r2-r9} // Load second four MPU regions STM r1, {r2-r9} // Store second four MPU regions +_tx_enable_mpu: LDR r0, =0xE000ED94 // Build MPU control reg address MOV r1, #5 // Build enable value with background region enabled STR r1, [r0] // Enable MPU diff --git a/ports_module/cortex_m33/iar/inc/tx_port.h b/ports_module/cortex_m33/iar/inc/tx_port.h index eb4a7f5f..e3547602 100644 --- a/ports_module/cortex_m33/iar/inc/tx_port.h +++ b/ports_module/cortex_m33/iar/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M33 */ -/* 6.1.10 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -61,13 +61,16 @@ /* added symbol to enable */ /* stack error handler, */ /* resulting in version 6.1.7 */ -/* 10-15-2021 Scott Larson Modified comment(s), improved */ +/* 10-15-2021 Scott Larson Modified comment(s), improved */ /* stack check error handling, */ /* resulting in version 6.1.9 */ /* 01-31-2022 Scott Larson Modified comment(s), unified */ /* this file across compilers, */ /* fixed predefined macro, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -196,14 +199,14 @@ UINT _tx_thread_secure_stack_free(struct TX_THREAD_STRUCT *tx_thread); For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_MISRA_ENABLE #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #else ULONG _tx_misra_time_stamp_get(VOID); @@ -429,9 +432,9 @@ __attribute__( ( always_inline ) ) static inline void _tx_control_set(ULONG cont #define TX_THREAD_COMPLETED_EXTENSION(thread_ptr) { \ ULONG _tx_vfp_state; \ - _tx_vfp_state = _tx_control_get(); \ + _tx_vfp_state = _tx_control_get(); \ _tx_vfp_state = _tx_vfp_state & ~((ULONG) 0x4); \ - _tx_control_set(_tx_vfp_state); \ + _tx_control_set(_tx_vfp_state); \ } #else @@ -456,26 +459,26 @@ __attribute__( ( always_inline ) ) static inline void _tx_control_set(ULONG cont if ((_tx_system_state == ((ULONG) 0)) && ((thread_ptr) == _tx_thread_current_ptr)) \ { \ ULONG _tx_vfp_state; \ - _tx_vfp_state = _tx_control_get(); \ + _tx_vfp_state = _tx_control_get(); \ _tx_vfp_state = _tx_vfp_state & ~((ULONG) 0x4); \ - _tx_control_set(_tx_vfp_state); \ + _tx_control_set(_tx_vfp_state); \ } \ else \ { \ ULONG _tx_fpccr; \ - _tx_fpccr = *((ULONG *) 0xE000EF34); \ + _tx_fpccr = *((volatile ULONG *) 0xE000EF34); \ _tx_fpccr = _tx_fpccr & ((ULONG) 0x01); \ if (_tx_fpccr == ((ULONG) 0x01)) \ { \ ULONG _tx_vfp_state; \ - _tx_vfp_state = _tx_control_get(); \ + _tx_vfp_state = _tx_control_get(); \ _tx_vfp_state = _tx_vfp_state & ((ULONG) 0x4); \ TX_VFP_TOUCH(); \ if (_tx_vfp_state == ((ULONG) 0)) \ { \ - _tx_vfp_state = _tx_control_get(); \ + _tx_vfp_state = _tx_control_get(); \ _tx_vfp_state = _tx_vfp_state & ~((ULONG) 0x4); \ - _tx_control_set(_tx_vfp_state); \ + _tx_control_set(_tx_vfp_state); \ } \ } \ } \ @@ -657,7 +660,7 @@ __attribute__( ( always_inline ) ) static inline void _tx_thread_system_return_i UINT interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (_tx_ipsr_get() == 0) { interrupt_save = __get_interrupt_posture(); diff --git a/ports_module/cortex_m33/iar/module_manager/src/tx_thread_schedule.s b/ports_module/cortex_m33/iar/module_manager/src/tx_thread_schedule.s index a584c2b7..e4d4bfd3 100644 --- a/ports_module/cortex_m33/iar/module_manager/src/tx_thread_schedule.s +++ b/ports_module/cortex_m33/iar/module_manager/src/tx_thread_schedule.s @@ -42,7 +42,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_schedule Cortex-M33/IAR */ -/* 6.1.8 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* Scott Larson, Microsoft Corporation */ @@ -81,6 +81,9 @@ /* 06-02-2021 Scott Larson Fixed extended stack handling */ /* when calling kernel APIs, */ /* resulting in version 6.1.7 */ +/* 04-25-2022 Scott Larson Optimized MPU configuration, */ +/* added BASEPRI support, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_schedule(VOID) @@ -132,7 +135,12 @@ __tx_wait_here: MemManage_Handler: BusFault_Handler: +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ /* Now pickup and store all the fault related information. */ @@ -199,7 +207,7 @@ BusFault_Handler: BL _txm_module_manager_memory_fault_handler // Call memory manager fault handler -#ifdef TX_ENABLE_EXECUTION_CHANGE_NOTIFY +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) /* Call the thread exit function to indicate the thread is no longer executing. */ CPSID i // Disable interrupts BL _tx_execution_thread_exit // Call the thread exit function @@ -215,7 +223,12 @@ BusFault_Handler: LDR r1, =0x10000000 // Set PENDSVSET bit STR r1, [r0] // Store ICSR DSB // Wait for memory access to complete +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts +#endif #ifdef TX_SINGLE_MODE_SECURE LDR lr, =0xFFFFFFFD // Exception return to secure #else @@ -232,12 +245,22 @@ __tx_ts_handler: #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) /* Call the thread exit function to indicate the thread is no longer executing. */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ PUSH {r0, lr} // Save LR (and r0 just for alignment) BL _tx_execution_thread_exit // Call the thread exit function POP {r0, lr} // Recover LR +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts -#endif +#endif /* TX_PORT_USE_BASEPRI */ +#endif /* EXECUTION PROFILE */ LDR r0, =_tx_thread_current_ptr // Build current thread pointer address LDR r2, =_tx_thread_execute_ptr // Build execute thread pointer address @@ -293,7 +316,12 @@ __tx_ts_new: /* Now we are looking for a new thread to execute! */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Is there another thread ready to execute? CBNZ r1, __tx_ts_restore // Yes, schedule it @@ -302,7 +330,12 @@ __tx_ts_new: are disabled to allow use of WFI for waiting for a thread to arrive. */ __tx_ts_wait: +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Pickup the next thread to execute pointer CBNZ r1, __tx_ts_ready // If non-NULL, a new thread is ready! #ifdef TX_ENABLE_WFI @@ -310,7 +343,12 @@ __tx_ts_wait: WFI // Wait for interrupt ISB // Ensure pipeline is flushed #endif +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_wait // Loop to continue waiting /* At this point, we have a new thread ready to go. Clear any newly pended PendSV - since we are @@ -327,7 +365,12 @@ __tx_ts_restore: and enable interrupts. */ STR r1, [r0] // Setup the current thread pointer to the new thread +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif /* Increment the thread run count. */ @@ -375,9 +418,17 @@ _skip_secure_restore: STR r3, [r0] // Disable MPU LDR r0, [r1, #0x90] // Pickup the module instance pointer CBZ r0, skip_mpu_setup // Is this thread owned by a module? No, skip MPU setup - LDR r1, [r0, #0x64] // Pickup MPU register[0] - CBZ r1, skip_mpu_setup // Is protection required for this module? No, skip MPU setup - LDR r1, =0xE000ED9C // Build address of MPU base register + LDR r2, [r0, #0x74] // Pickup MPU address of data region + CBZ r2, skip_mpu_setup // Is protection required for this module? No, skip MPU setup + + // Is the MPU already set up for this module? + MOV r1, #2 // Select MPU region 2 + LDR r3, =0xE000ED98 // MPU_RNR register address + STR r1, [r3] // Set region to 2 + LDR r1, =0xE000ED9C // MPU_RBAR register address + LDR r3, [r1] // Load address stored in MPU region 2 + CMP r2, r3 // Is module already loaded? + BEQ _tx_enable_mpu // Yes - skip MPU reconfiguration // Use alias registers to quickly load MPU LDR r2, =0xE000ED98 // Get region register @@ -390,6 +441,7 @@ _skip_secure_restore: STR r2, [r3] // Set region to 4 LDM r0, {r2-r9} // Load second four MPU regions STM r1, {r2-r9} // Store second four MPU regions +_tx_enable_mpu: LDR r0, =0xE000ED94 // Build MPU control reg address MOV r1, #5 // Build enable value with background region enabled STR r1, [r0] // Enable MPU @@ -412,8 +464,8 @@ _skip_vfp_restore: SVC_Handler: TST lr, #0x04 // Determine return stack from EXC_RETURN bit 2 ITE EQ - MRSEQ r0, MSP // Get MSP - MRSNE r0, PSP // Get PSP + MRSEQ r0, MSP // Get MSP if return stack is MSP + MRSNE r0, PSP // Get PSP if return stack is PSP LDR r1, [r0,#24] // Load saved PC from stack LDRB r2, [r1,#-2] // Load SVC number diff --git a/ports_module/cortex_m4/ac5/inc/tx_port.h b/ports_module/cortex_m4/ac5/inc/tx_port.h index 78434fb6..3aba89f0 100644 --- a/ports_module/cortex_m4/ac5/inc/tx_port.h +++ b/ports_module/cortex_m4/ac5/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M4/AC5 */ -/* 6.1.9 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -48,6 +48,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 10-15-2021 Scott Larson Initial Version 6.1.9 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -123,13 +126,13 @@ typedef unsigned short USHORT; For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #ifndef TX_TRACE_TIME_MASK #define TX_TRACE_TIME_MASK 0xFFFFFFFFUL @@ -282,7 +285,7 @@ void _tx_vfp_access(void); else \ { \ ULONG _tx_fpccr; \ - _tx_fpccr = *((ULONG *) 0xE000EF34); \ + _tx_fpccr = *((volatile ULONG *) 0xE000EF34); \ _tx_fpccr = _tx_fpccr & ((ULONG) 0x01); \ if (_tx_fpccr == ((ULONG) 0x01)) \ { \ @@ -435,7 +438,7 @@ unsigned int was_masked; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (_ipsr == 0) { was_masked = __disable_irq(); @@ -458,7 +461,7 @@ void tx_thread_fpu_disable(void); #ifdef TX_THREAD_INIT CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M4/AC5 Version 6.1.9 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M4/AC5 Version 6.1.11 *"; #else #ifdef TX_MISRA_ENABLE extern CHAR _tx_version_id[100]; diff --git a/ports_module/cortex_m4/ac5/module_manager/src/tx_thread_schedule.s b/ports_module/cortex_m4/ac5/module_manager/src/tx_thread_schedule.s index bd2f6f25..11943fcf 100644 --- a/ports_module/cortex_m4/ac5/module_manager/src/tx_thread_schedule.s +++ b/ports_module/cortex_m4/ac5/module_manager/src/tx_thread_schedule.s @@ -40,7 +40,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_schedule Cortex-M4/AC5 */ -/* 6.1.9 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* Scott Larson, Microsoft Corporation */ @@ -67,13 +67,15 @@ /* */ /* _tx_initialize_kernel_enter ThreadX entry function */ /* _tx_thread_system_return Return to system from thread */ -/* _tx_thread_context_restore Restore thread's context */ /* */ /* RELEASE HISTORY */ /* */ /* DATE NAME DESCRIPTION */ /* */ /* 10-15-2021 Scott Larson Initial Version 6.1.9 */ +/* 04-25-2022 Scott Larson Optimized MPU configuration, */ +/* added BASEPRI support, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_schedule(VOID) @@ -125,7 +127,12 @@ __tx_wait_here EXPORT MemManage_Handler MemManage_Handler +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ /* Now pickup and store all the fault related information. */ @@ -208,7 +215,12 @@ MemManage_Handler LDR r1, =0x10000000 // Set PENDSVSET bit STR r1, [r0] // Store ICSR DSB // Wait for memory access to complete +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts +#endif MOV lr, #0xFFFFFFFD // Load exception return code BX lr // Return from exception @@ -226,12 +238,22 @@ __tx_ts_handler #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) /* Call the thread exit function to indicate the thread is no longer executing. */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ PUSH {r0, lr} // Save LR (and r0 just for alignment) BL _tx_execution_thread_exit // Call the thread exit function POP {r0, lr} // Recover LR +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts -#endif +#endif /* TX_PORT_USE_BASEPRI */ +#endif /* EXECUTION PROFILE */ LDR r0, =_tx_thread_current_ptr // Build current thread pointer address LDR r2, =_tx_thread_execute_ptr // Build execute thread pointer address @@ -276,7 +298,12 @@ __tx_ts_new /* Now we are looking for a new thread to execute! */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Is there another thread ready to execute? CBNZ r1, __tx_ts_restore // Yes, schedule it @@ -285,7 +312,12 @@ __tx_ts_new are disabled to allow use of WFI for waiting for a thread to arrive. */ __tx_ts_wait +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Pickup the next thread to execute pointer CBNZ r1, __tx_ts_ready // If non-NULL, a new thread is ready! #ifdef TX_ENABLE_WFI @@ -293,7 +325,12 @@ __tx_ts_wait WFI // Wait for interrupt ISB // Ensure pipeline is flushed #endif +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_wait // Loop to continue waiting /* At this point, we have a new thread ready to go. Clear any newly pended PendSV - since we are @@ -310,7 +347,12 @@ __tx_ts_restore and enable interrupts. */ STR r1, [r0] // Setup the current thread pointer to the new thread +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif /* Increment the thread run count. */ @@ -346,27 +388,34 @@ __tx_ts_restore STR r3, [r0] // Disable MPU LDR r0, [r1, #0x90] // Pickup the module instance pointer CBZ r0, skip_mpu_setup // Is this thread owned by a module? No, skip MPU setup - LDR r1, [r0, #0x64] // Pickup MPU register[0] - CBZ r1, skip_mpu_setup // Is protection required for this module? No, skip MPU setup - LDR r1, =0xE000ED9C // Build address of MPU base register + + LDR r2, [r0, #0x8C] // Pickup MPU region 5 address + CBZ r2, skip_mpu_setup // Is protection required for this module? No, skip MPU setup + + // Is the MPU already set up for this module? + MOV r1, #5 // Select region 5 from MPU + LDR r3, =0xE000ED98 // MPU_RNR register address + STR r1, [r3] // Set region to 5 + LDR r1, =0xE000ED9C // MPU_RBAR register address + LDR r3, [r1] // Load address stored in MPU region 5 + BIC r2, r2, #0x10 // Clear VALID bit + CMP r2, r3 // Is module already loaded? + BEQ _tx_enable_mpu // Yes - skip MPU reconfiguration // Use alias registers to quickly load MPU ADD r0, r0, #100 // Build address of MPU register start in thread control block -#ifdef TXM_MODULE_MANAGER_16_MPU + LDM r0!,{r2-r9} // Load MPU regions 0-3 STM r1,{r2-r9} // Store MPU regions 0-3 LDM r0!,{r2-r9} // Load MPU regions 4-7 STM r1,{r2-r9} // Store MPU regions 4-7 +#ifdef TXM_MODULE_MANAGER_16_MPU LDM r0!,{r2-r9} // Load MPU regions 8-11 STM r1,{r2-r9} // Store MPU regions 8-11 LDM r0,{r2-r9} // Load MPU regions 12-15 STM r1,{r2-r9} // Store MPU regions 12-15 -#else - LDM r0!,{r2-r9} // Load first four MPU regions - STM r1,{r2-r9} // Store first four MPU regions - LDM r0,{r2-r9} // Load second four MPU regions - STM r1,{r2-r9} // Store second four MPU regions #endif +_tx_enable_mpu LDR r0, =0xE000ED94 // Build MPU control reg address MOV r1, #5 // Build enable value with background region enabled STR r1, [r0] // Enable MPU diff --git a/ports_module/cortex_m4/ac6/inc/tx_port.h b/ports_module/cortex_m4/ac6/inc/tx_port.h index c4333fc6..5e0f6a91 100644 --- a/ports_module/cortex_m4/ac6/inc/tx_port.h +++ b/ports_module/cortex_m4/ac6/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M4/AC6 */ -/* 6.1.9 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -48,6 +48,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 10-15-2021 Scott Larson Initial Version 6.1.9 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -123,13 +126,13 @@ typedef unsigned short USHORT; For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #ifndef TX_TRACE_TIME_MASK #define TX_TRACE_TIME_MASK 0xFFFFFFFFUL @@ -291,7 +294,7 @@ __attribute__( ( always_inline ) ) static inline void __set_control(ULONG contro else \ { \ ULONG _tx_fpccr; \ - _tx_fpccr = *((ULONG *) 0xE000EF34); \ + _tx_fpccr = *((volatile ULONG *) 0xE000EF34); \ _tx_fpccr = _tx_fpccr & ((ULONG) 0x01); \ if (_tx_fpccr == ((ULONG) 0x01)) \ { \ @@ -467,7 +470,8 @@ __attribute__( ( always_inline ) ) static inline void _tx_thread_system_return_i { unsigned int interrupt_save; - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + /* Set PendSV to invoke ThreadX scheduler. */ + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (__get_ipsr_value() == 0) { interrupt_save = __get_primask_value(); @@ -497,7 +501,7 @@ unsigned int interrupt_save; #endif -/* Define FPU extension for the Cortex-M7. Each is assumed to be called in the context of the executing +/* Define FPU extension for the Cortex-M4. Each is assumed to be called in the context of the executing thread. These are no longer needed, but are preserved for backward compatibility only. */ void tx_thread_fpu_enable(void); @@ -508,7 +512,7 @@ void tx_thread_fpu_disable(void); #ifdef TX_THREAD_INIT CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M4/AC6 Version 6.1.9 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M4/AC6 Version 6.1.11 *"; #else extern CHAR _tx_version_id[]; #endif diff --git a/ports_module/cortex_m4/ac6/module_manager/src/tx_thread_schedule.S b/ports_module/cortex_m4/ac6/module_manager/src/tx_thread_schedule.S index 724ed802..d56fa398 100644 --- a/ports_module/cortex_m4/ac6/module_manager/src/tx_thread_schedule.S +++ b/ports_module/cortex_m4/ac6/module_manager/src/tx_thread_schedule.S @@ -42,7 +42,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_schedule Cortex-M4/AC6 */ -/* 6.1.9 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* Scott Larson, Microsoft Corporation */ @@ -69,13 +69,15 @@ /* */ /* _tx_initialize_kernel_enter ThreadX entry function */ /* _tx_thread_system_return Return to system from thread */ -/* _tx_thread_context_restore Restore thread's context */ /* */ /* RELEASE HISTORY */ /* */ /* DATE NAME DESCRIPTION */ /* */ /* 10-15-2021 Scott Larson Initial Version 6.1.9 */ +/* 04-25-2022 Scott Larson Optimized MPU configuration, */ +/* added BASEPRI support, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_schedule(VOID) @@ -135,7 +137,12 @@ BusFault_Handler: .thumb_func UsageFault_Handler: +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ /* Now pickup and store all the fault related information. */ @@ -197,7 +204,7 @@ UsageFault_Handler: LDR r0, =0xE000EF34 // Cleanup FPU context: Load FPCCR address LDR r1, [r0] // Load FPCCR BIC r1, r1, #1 // Clear the lazy preservation active bit - STR r1, [r0] // Store the value + STR r1, [r0] // Save FPCCR #endif BL _txm_module_manager_memory_fault_handler // Call memory manager fault handler @@ -218,7 +225,12 @@ UsageFault_Handler: LDR r1, =0x10000000 // Set PENDSVSET bit STR r1, [r0] // Store ICSR DSB // Wait for memory access to complete +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts +#endif MOV lr, #0xFFFFFFFD // Load exception return code BX lr // Return from exception @@ -239,12 +251,22 @@ __tx_ts_handler: #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) /* Call the thread exit function to indicate the thread is no longer executing. */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ PUSH {r0, lr} // Save LR (and r0 just for alignment) BL _tx_execution_thread_exit // Call the thread exit function POP {r0, lr} // Recover LR +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts -#endif +#endif /* TX_PORT_USE_BASEPRI */ +#endif /* EXECUTION PROFILE */ LDR r0, =_tx_thread_current_ptr // Build current thread pointer address LDR r2, =_tx_thread_execute_ptr // Build execute thread pointer address @@ -289,7 +311,12 @@ __tx_ts_new: /* Now we are looking for a new thread to execute! */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Is there another thread ready to execute? CBNZ r1, __tx_ts_restore // Yes, schedule it @@ -298,7 +325,12 @@ __tx_ts_new: are disabled to allow use of WFI for waiting for a thread to arrive. */ __tx_ts_wait: +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Pickup the next thread to execute pointer CBNZ r1, __tx_ts_ready // If non-NULL, a new thread is ready! #ifdef TX_ENABLE_WFI @@ -306,7 +338,12 @@ __tx_ts_wait: WFI // Wait for interrupt ISB // Ensure pipeline is flushed #endif +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_wait // Loop to continue waiting /* At this point, we have a new thread ready to go. Clear any newly pended PendSV - since we are @@ -323,7 +360,12 @@ __tx_ts_restore: and enable interrupts. */ STR r1, [r0] // Setup the current thread pointer to the new thread +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif /* Increment the thread run count. */ @@ -359,27 +401,34 @@ __tx_ts_restore: STR r3, [r0] // Disable MPU LDR r0, [r1, #0x90] // Pickup the module instance pointer CBZ r0, skip_mpu_setup // Is this thread owned by a module? No, skip MPU setup - LDR r1, [r0, #0x64] // Pickup MPU register[0] - CBZ r1, skip_mpu_setup // Is protection required for this module? No, skip MPU setup - LDR r1, =0xE000ED9C // Build address of MPU base register + + LDR r2, [r0, #0x8C] // Pickup MPU region 5 address + CBZ r2, skip_mpu_setup // Is protection required for this module? No, skip MPU setup + + // Is the MPU already set up for this module? + MOV r1, #5 // Select region 5 from MPU + LDR r3, =0xE000ED98 // MPU_RNR register address + STR r1, [r3] // Set region to 5 + LDR r1, =0xE000ED9C // MPU_RBAR register address + LDR r3, [r1] // Load address stored in MPU region 5 + BIC r2, r2, #0x10 // Clear VALID bit + CMP r2, r3 // Is module already loaded? + BEQ _tx_enable_mpu // Yes - skip MPU reconfiguration // Use alias registers to quickly load MPU ADD r0, r0, #100 // Build address of MPU register start in thread control block -#ifdef TXM_MODULE_MANAGER_16_MPU + LDM r0!,{r2-r9} // Load MPU regions 0-3 STM r1,{r2-r9} // Store MPU regions 0-3 LDM r0!,{r2-r9} // Load MPU regions 4-7 STM r1,{r2-r9} // Store MPU regions 4-7 +#ifdef TXM_MODULE_MANAGER_16_MPU LDM r0!,{r2-r9} // Load MPU regions 8-11 STM r1,{r2-r9} // Store MPU regions 8-11 LDM r0,{r2-r9} // Load MPU regions 12-15 STM r1,{r2-r9} // Store MPU regions 12-15 -#else - LDM r0!,{r2-r9} // Load first four MPU regions - STM r1,{r2-r9} // Store first four MPU regions - LDM r0,{r2-r9} // Load second four MPU regions - STM r1,{r2-r9} // Store second four MPU regions #endif +_tx_enable_mpu: LDR r0, =0xE000ED94 // Build MPU control reg address MOV r1, #5 // Build enable value with background region enabled STR r1, [r0] // Enable MPU @@ -538,14 +587,14 @@ _tx_no_lazy_clear: #endif /* Copy kernel hardware stack to module thread stack. */ - LDM r3!, {r1-r2} - STM r0!, {r1-r2} - LDM r3!, {r1-r2} - STM r0!, {r1-r2} - LDM r3!, {r1-r2} - STM r0!, {r1-r2} - LDM r3!, {r1-r2} - STM r0!, {r1-r2} + LDM r3!, {r1-r2} // Get r0, r1 from kernel stack + STM r0!, {r1-r2} // Insert r0, r1 into thread stack + LDM r3!, {r1-r2} // Get r2, r3 from kernel stack + STM r0!, {r1-r2} // Insert r2, r3 into thread stack + LDM r3!, {r1-r2} // Get r12, lr from kernel stack + STM r0!, {r1-r2} // Insert r12, lr into thread stack + LDM r3!, {r1-r2} // Get pc, xpsr from kernel stack + STM r0!, {r1-r2} // Insert pc, xpsr into thread stack SUB r0, r0, #32 // Subtract 32 to get back to top of stack MSR PSP, r0 // Set thread stack pointer diff --git a/ports_module/cortex_m4/gnu/inc/tx_port.h b/ports_module/cortex_m4/gnu/inc/tx_port.h index 986d5051..ed3f0984 100644 --- a/ports_module/cortex_m4/gnu/inc/tx_port.h +++ b/ports_module/cortex_m4/gnu/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M4/GNU */ -/* 6.1.9 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -48,6 +48,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 10-15-2021 Scott Larson Initial Version 6.1.9 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -123,13 +126,13 @@ typedef unsigned short USHORT; For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #ifndef TX_TRACE_TIME_MASK #define TX_TRACE_TIME_MASK 0xFFFFFFFFUL @@ -291,7 +294,7 @@ __attribute__( ( always_inline ) ) static inline void __set_control(ULONG contro else \ { \ ULONG _tx_fpccr; \ - _tx_fpccr = *((ULONG *) 0xE000EF34); \ + _tx_fpccr = *((volatile ULONG *) 0xE000EF34); \ _tx_fpccr = _tx_fpccr & ((ULONG) 0x01); \ if (_tx_fpccr == ((ULONG) 0x01)) \ { \ @@ -461,7 +464,8 @@ __attribute__( ( always_inline ) ) static inline void _tx_thread_system_return_i { unsigned int interrupt_save; - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + /* Set PendSV to invoke ThreadX scheduler. */ + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (__get_ipsr_value() == 0) { interrupt_save = __get_primask_value(); @@ -491,8 +495,8 @@ unsigned int interrupt_save; #endif -/* Define FPU extension for the Cortex-M7. Each is assumed to be called in the context of the executing - thread. This is for legacy only, and not needed any longer. */ +/* Define FPU extension for the Cortex-M4. Each is assumed to be called in the context of the executing + thread. These are no longer needed, but are preserved for backward compatibility only. */ void tx_thread_fpu_enable(void); void tx_thread_fpu_disable(void); @@ -502,7 +506,7 @@ void tx_thread_fpu_disable(void); #ifdef TX_THREAD_INIT CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M4/GNU Version 6.1.9 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M4/GNU Version 6.1.11 *"; #else extern CHAR _tx_version_id[]; #endif diff --git a/ports_module/cortex_m4/gnu/module_manager/src/tx_thread_schedule.S b/ports_module/cortex_m4/gnu/module_manager/src/tx_thread_schedule.S index 1377997e..948b153c 100644 --- a/ports_module/cortex_m4/gnu/module_manager/src/tx_thread_schedule.S +++ b/ports_module/cortex_m4/gnu/module_manager/src/tx_thread_schedule.S @@ -40,7 +40,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_schedule Cortex-M4/GNU */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* Scott Larson, Microsoft Corporation */ @@ -67,7 +67,6 @@ /* */ /* _tx_initialize_kernel_enter ThreadX entry function */ /* _tx_thread_system_return Return to system from thread */ -/* _tx_thread_context_restore Restore thread's context */ /* */ /* RELEASE HISTORY */ /* */ @@ -76,6 +75,9 @@ /* 10-15-2021 Scott Larson Initial Version 6.1.9 */ /* 01-31-2022 Scott Larson Fixed predefined macro name, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 Scott Larson Optimized MPU configuration, */ +/* added BASEPRI support, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_schedule(VOID) @@ -135,7 +137,12 @@ BusFault_Handler: .thumb_func UsageFault_Handler: +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ /* Now pickup and store all the fault related information. */ @@ -197,7 +204,7 @@ UsageFault_Handler: LDR r0, =0xE000EF34 // Cleanup FPU context: Load FPCCR address LDR r1, [r0] // Load FPCCR BIC r1, r1, #1 // Clear the lazy preservation active bit - STR r1, [r0] // Store the value + STR r1, [r0] // Save FPCCR #endif BL _txm_module_manager_memory_fault_handler // Call memory manager fault handler @@ -218,7 +225,12 @@ UsageFault_Handler: LDR r1, =0x10000000 // Set PENDSVSET bit STR r1, [r0] // Store ICSR DSB // Wait for memory access to complete +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts +#endif MOV lr, #0xFFFFFFFD // Load exception return code BX lr // Return from exception @@ -239,12 +251,22 @@ __tx_ts_handler: #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) /* Call the thread exit function to indicate the thread is no longer executing. */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ PUSH {r0, lr} // Save LR (and r0 just for alignment) BL _tx_execution_thread_exit // Call the thread exit function POP {r0, lr} // Recover LR +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts -#endif +#endif /* TX_PORT_USE_BASEPRI */ +#endif /* EXECUTION PROFILE */ LDR r0, =_tx_thread_current_ptr // Build current thread pointer address LDR r2, =_tx_thread_execute_ptr // Build execute thread pointer address @@ -289,7 +311,12 @@ __tx_ts_new: /* Now we are looking for a new thread to execute! */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Is there another thread ready to execute? CBNZ r1, __tx_ts_restore // Yes, schedule it @@ -298,7 +325,12 @@ __tx_ts_new: are disabled to allow use of WFI for waiting for a thread to arrive. */ __tx_ts_wait: +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Pickup the next thread to execute pointer CBNZ r1, __tx_ts_ready // If non-NULL, a new thread is ready! #ifdef TX_ENABLE_WFI @@ -306,7 +338,12 @@ __tx_ts_wait: WFI // Wait for interrupt ISB // Ensure pipeline is flushed #endif +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_wait // Loop to continue waiting /* At this point, we have a new thread ready to go. Clear any newly pended PendSV - since we are @@ -323,7 +360,12 @@ __tx_ts_restore: and enable interrupts. */ STR r1, [r0] // Setup the current thread pointer to the new thread +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif /* Increment the thread run count. */ @@ -359,27 +401,34 @@ __tx_ts_restore: STR r3, [r0] // Disable MPU LDR r0, [r1, #0x90] // Pickup the module instance pointer CBZ r0, skip_mpu_setup // Is this thread owned by a module? No, skip MPU setup - LDR r1, [r0, #0x64] // Pickup MPU register[0] - CBZ r1, skip_mpu_setup // Is protection required for this module? No, skip MPU setup - LDR r1, =0xE000ED9C // Build address of MPU base register + + LDR r2, [r0, #0x8C] // Pickup MPU region 5 address + CBZ r2, skip_mpu_setup // Is protection required for this module? No, skip MPU setup + + // Is the MPU already set up for this module? + MOV r1, #5 // Select region 5 from MPU + LDR r3, =0xE000ED98 // MPU_RNR register address + STR r1, [r3] // Set region to 5 + LDR r1, =0xE000ED9C // MPU_RBAR register address + LDR r3, [r1] // Load address stored in MPU region 5 + BIC r2, r2, #0x10 // Clear VALID bit + CMP r2, r3 // Is module already loaded? + BEQ _tx_enable_mpu // Yes - skip MPU reconfiguration // Use alias registers to quickly load MPU ADD r0, r0, #100 // Build address of MPU register start in thread control block -#ifdef TXM_MODULE_MANAGER_16_MPU + LDM r0!,{r2-r9} // Load MPU regions 0-3 STM r1,{r2-r9} // Store MPU regions 0-3 LDM r0!,{r2-r9} // Load MPU regions 4-7 STM r1,{r2-r9} // Store MPU regions 4-7 +#ifdef TXM_MODULE_MANAGER_16_MPU LDM r0!,{r2-r9} // Load MPU regions 8-11 STM r1,{r2-r9} // Store MPU regions 8-11 LDM r0,{r2-r9} // Load MPU regions 12-15 STM r1,{r2-r9} // Store MPU regions 12-15 -#else - LDM r0!,{r2-r9} // Load first four MPU regions - STM r1,{r2-r9} // Store first four MPU regions - LDM r0,{r2-r9} // Load second four MPU regions - STM r1,{r2-r9} // Store second four MPU regions #endif +_tx_enable_mpu: LDR r0, =0xE000ED94 // Build MPU control reg address MOV r1, #5 // Build enable value with background region enabled STR r1, [r0] // Enable MPU diff --git a/ports_module/cortex_m4/iar/inc/tx_port.h b/ports_module/cortex_m4/iar/inc/tx_port.h index 2ade11b9..2f620957 100644 --- a/ports_module/cortex_m4/iar/inc/tx_port.h +++ b/ports_module/cortex_m4/iar/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M4/IAR */ -/* 6.1.9 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -48,6 +48,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 10-15-2021 Scott Larson Initial Version 6.1.9 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -127,14 +130,14 @@ typedef unsigned short USHORT; For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_MISRA_ENABLE #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #else ULONG _tx_misra_time_stamp_get(VOID); @@ -325,7 +328,7 @@ void _tx_misra_vfp_touch(void); else \ { \ ULONG _tx_fpccr; \ - _tx_fpccr = *((ULONG *) 0xE000EF34); \ + _tx_fpccr = *((volatile ULONG *) 0xE000EF34); \ _tx_fpccr = _tx_fpccr & ((ULONG) 0x01); \ if (_tx_fpccr == ((ULONG) 0x01)) \ { \ @@ -476,7 +479,7 @@ static void _tx_thread_system_return_inline(void) __istate_t interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (__get_IPSR() == 0) { interrupt_save = __get_interrupt_state(); @@ -488,7 +491,7 @@ __istate_t interrupt_save; #endif -/* Define FPU extension for the Cortex-M7. Each is assumed to be called in the context of the executing +/* Define FPU extension for the Cortex-M4. Each is assumed to be called in the context of the executing thread. These are no longer needed, but are preserved for backward compatibility only. */ void tx_thread_fpu_enable(void); diff --git a/ports_module/cortex_m4/iar/module_manager/src/tx_thread_schedule.s b/ports_module/cortex_m4/iar/module_manager/src/tx_thread_schedule.s index 56da6a11..92840961 100644 --- a/ports_module/cortex_m4/iar/module_manager/src/tx_thread_schedule.s +++ b/ports_module/cortex_m4/iar/module_manager/src/tx_thread_schedule.s @@ -36,7 +36,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_schedule Cortex-M4/IAR */ -/* 6.1.9 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* Scott Larson, Microsoft Corporation */ @@ -63,13 +63,15 @@ /* */ /* _tx_initialize_kernel_enter ThreadX entry function */ /* _tx_thread_system_return Return to system from thread */ -/* _tx_thread_context_restore Restore thread's context */ /* */ /* RELEASE HISTORY */ /* */ /* DATE NAME DESCRIPTION */ /* */ /* 10-15-2021 Scott Larson Initial Version 6.1.9 */ +/* 04-25-2022 Scott Larson Optimized MPU configuration, */ +/* added BASEPRI support, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_schedule(VOID) @@ -125,8 +127,12 @@ __tx_wait_here: MemManage_Handler: BusFault_Handler: UsageFault_Handler: - +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ /* Now pickup and store all the fault related information. */ @@ -209,7 +215,12 @@ UsageFault_Handler: LDR r1, =0x10000000 // Set PENDSVSET bit STR r1, [r0] // Store ICSR DSB // Wait for memory access to complete +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts +#endif MOV lr, #0xFFFFFFFD // Load exception return code BX lr // Return from exception @@ -227,12 +238,22 @@ __tx_ts_handler: #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) /* Call the thread exit function to indicate the thread is no longer executing. */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ PUSH {r0, lr} // Save LR (and r0 just for alignment) BL _tx_execution_thread_exit // Call the thread exit function POP {r0, lr} // Recover LR +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts -#endif +#endif /* TX_PORT_USE_BASEPRI */ +#endif /* EXECUTION PROFILE */ LDR r0, =_tx_thread_current_ptr // Build current thread pointer address LDR r2, =_tx_thread_execute_ptr // Build execute thread pointer address @@ -277,7 +298,12 @@ __tx_ts_new: /* Now we are looking for a new thread to execute! */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Is there another thread ready to execute? CBNZ r1, __tx_ts_restore // Yes, schedule it @@ -286,7 +312,12 @@ __tx_ts_new: are disabled to allow use of WFI for waiting for a thread to arrive. */ __tx_ts_wait: +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Pickup the next thread to execute pointer CBNZ r1, __tx_ts_ready // If non-NULL, a new thread is ready! #ifdef TX_ENABLE_WFI @@ -294,7 +325,12 @@ __tx_ts_wait: WFI // Wait for interrupt ISB // Ensure pipeline is flushed #endif +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_wait // Loop to continue waiting /* At this point, we have a new thread ready to go. Clear any newly pended PendSV - since we are @@ -311,7 +347,12 @@ __tx_ts_restore: and enable interrupts. */ STR r1, [r0] // Setup the current thread pointer to the new thread +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif /* Increment the thread run count. */ @@ -347,27 +388,34 @@ __tx_ts_restore: STR r3, [r0] // Disable MPU LDR r0, [r1, #0x90] // Pickup the module instance pointer CBZ r0, skip_mpu_setup // Is this thread owned by a module? No, skip MPU setup - LDR r1, [r0, #0x64] // Pickup MPU register[0] - CBZ r1, skip_mpu_setup // Is protection required for this module? No, skip MPU setup - LDR r1, =0xE000ED9C // Build address of MPU base register + + LDR r2, [r0, #0x8C] // Pickup MPU region 5 address + CBZ r2, skip_mpu_setup // Is protection required for this module? No, skip MPU setup + + // Is the MPU already set up for this module? + MOV r1, #5 // Select region 5 from MPU + LDR r3, =0xE000ED98 // MPU_RNR register address + STR r1, [r3] // Set region to 5 + LDR r1, =0xE000ED9C // MPU_RBAR register address + LDR r3, [r1] // Load address stored in MPU region 5 + BIC r2, r2, #0x10 // Clear VALID bit + CMP r2, r3 // Is module already loaded? + BEQ _tx_enable_mpu // Yes - skip MPU reconfiguration // Use alias registers to quickly load MPU ADD r0, r0, #100 // Build address of MPU register start in thread control block -#ifdef TXM_MODULE_MANAGER_16_MPU + LDM r0!,{r2-r9} // Load MPU regions 0-3 STM r1,{r2-r9} // Store MPU regions 0-3 LDM r0!,{r2-r9} // Load MPU regions 4-7 STM r1,{r2-r9} // Store MPU regions 4-7 +#ifdef TXM_MODULE_MANAGER_16_MPU LDM r0!,{r2-r9} // Load MPU regions 8-11 STM r1,{r2-r9} // Store MPU regions 8-11 LDM r0,{r2-r9} // Load MPU regions 12-15 STM r1,{r2-r9} // Store MPU regions 12-15 -#else - LDM r0!,{r2-r9} // Load first four MPU regions - STM r1,{r2-r9} // Store first four MPU regions - LDM r0,{r2-r9} // Load second four MPU regions - STM r1,{r2-r9} // Store second four MPU regions #endif +_tx_enable_mpu: LDR r0, =0xE000ED94 // Build MPU control reg address MOV r1, #5 // Build enable value with background region enabled STR r1, [r0] // Enable MPU diff --git a/ports_module/cortex_m7/ac5/inc/tx_port.h b/ports_module/cortex_m7/ac5/inc/tx_port.h index ff5a57e3..9aca7f4b 100644 --- a/ports_module/cortex_m7/ac5/inc/tx_port.h +++ b/ports_module/cortex_m7/ac5/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M7/AC5 */ -/* 6.1.9 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -48,6 +48,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 10-15-2021 Scott Larson Initial Version 6.1.9 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -123,13 +126,13 @@ typedef unsigned short USHORT; For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #ifndef TX_TRACE_TIME_MASK #define TX_TRACE_TIME_MASK 0xFFFFFFFFUL @@ -282,7 +285,7 @@ void _tx_vfp_access(void); else \ { \ ULONG _tx_fpccr; \ - _tx_fpccr = *((ULONG *) 0xE000EF34); \ + _tx_fpccr = *((volatile ULONG *) 0xE000EF34); \ _tx_fpccr = _tx_fpccr & ((ULONG) 0x01); \ if (_tx_fpccr == ((ULONG) 0x01)) \ { \ @@ -435,7 +438,7 @@ unsigned int was_masked; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (_ipsr == 0) { was_masked = __disable_irq(); @@ -458,7 +461,7 @@ void tx_thread_fpu_disable(void); #ifdef TX_THREAD_INIT CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M7/AC5 Version 6.1.9 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M7/AC5 Version 6.1.11 *"; #else #ifdef TX_MISRA_ENABLE extern CHAR _tx_version_id[100]; diff --git a/ports_module/cortex_m7/ac5/module_manager/src/tx_thread_schedule.s b/ports_module/cortex_m7/ac5/module_manager/src/tx_thread_schedule.s index 016cdcae..150f9818 100644 --- a/ports_module/cortex_m7/ac5/module_manager/src/tx_thread_schedule.s +++ b/ports_module/cortex_m7/ac5/module_manager/src/tx_thread_schedule.s @@ -40,7 +40,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_schedule Cortex-M7/AC5 */ -/* 6.1.9 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* Scott Larson, Microsoft Corporation */ @@ -67,13 +67,15 @@ /* */ /* _tx_initialize_kernel_enter ThreadX entry function */ /* _tx_thread_system_return Return to system from thread */ -/* _tx_thread_context_restore Restore thread's context */ /* */ /* RELEASE HISTORY */ /* */ /* DATE NAME DESCRIPTION */ /* */ /* 10-15-2021 Scott Larson Initial Version 6.1.9 */ +/* 04-25-2022 Scott Larson Optimized MPU configuration, */ +/* added BASEPRI support, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_schedule(VOID) @@ -125,7 +127,12 @@ __tx_wait_here EXPORT MemManage_Handler MemManage_Handler +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ /* Now pickup and store all the fault related information. */ @@ -208,7 +215,12 @@ MemManage_Handler LDR r1, =0x10000000 // Set PENDSVSET bit STR r1, [r0] // Store ICSR DSB // Wait for memory access to complete +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts +#endif MOV lr, #0xFFFFFFFD // Load exception return code BX lr // Return from exception @@ -226,12 +238,22 @@ __tx_ts_handler #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) /* Call the thread exit function to indicate the thread is no longer executing. */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ PUSH {r0, lr} // Save LR (and r0 just for alignment) BL _tx_execution_thread_exit // Call the thread exit function POP {r0, lr} // Recover LR +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts -#endif +#endif /* TX_PORT_USE_BASEPRI */ +#endif /* EXECUTION PROFILE */ LDR r0, =_tx_thread_current_ptr // Build current thread pointer address LDR r2, =_tx_thread_execute_ptr // Build execute thread pointer address @@ -276,7 +298,12 @@ __tx_ts_new /* Now we are looking for a new thread to execute! */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Is there another thread ready to execute? CBNZ r1, __tx_ts_restore // Yes, schedule it @@ -285,7 +312,12 @@ __tx_ts_new are disabled to allow use of WFI for waiting for a thread to arrive. */ __tx_ts_wait +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Pickup the next thread to execute pointer CBNZ r1, __tx_ts_ready // If non-NULL, a new thread is ready! #ifdef TX_ENABLE_WFI @@ -293,7 +325,12 @@ __tx_ts_wait WFI // Wait for interrupt ISB // Ensure pipeline is flushed #endif +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_wait // Loop to continue waiting /* At this point, we have a new thread ready to go. Clear any newly pended PendSV - since we are @@ -310,7 +347,12 @@ __tx_ts_restore and enable interrupts. */ STR r1, [r0] // Setup the current thread pointer to the new thread +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif /* Increment the thread run count. */ @@ -346,27 +388,34 @@ __tx_ts_restore STR r3, [r0] // Disable MPU LDR r0, [r1, #0x90] // Pickup the module instance pointer CBZ r0, skip_mpu_setup // Is this thread owned by a module? No, skip MPU setup - LDR r1, [r0, #0x64] // Pickup MPU register[0] - CBZ r1, skip_mpu_setup // Is protection required for this module? No, skip MPU setup - LDR r1, =0xE000ED9C // Build address of MPU base register + + LDR r2, [r0, #0x8C] // Pickup MPU region 5 address + CBZ r2, skip_mpu_setup // Is protection required for this module? No, skip MPU setup + + // Is the MPU already set up for this module? + MOV r1, #5 // Select region 5 from MPU + LDR r3, =0xE000ED98 // MPU_RNR register address + STR r1, [r3] // Set region to 5 + LDR r1, =0xE000ED9C // MPU_RBAR register address + LDR r3, [r1] // Load address stored in MPU region 5 + BIC r2, r2, #0x10 // Clear VALID bit + CMP r2, r3 // Is module already loaded? + BEQ _tx_enable_mpu // Yes - skip MPU reconfiguration // Use alias registers to quickly load MPU ADD r0, r0, #100 // Build address of MPU register start in thread control block -#ifdef TXM_MODULE_MANAGER_16_MPU + LDM r0!,{r2-r9} // Load MPU regions 0-3 STM r1,{r2-r9} // Store MPU regions 0-3 LDM r0!,{r2-r9} // Load MPU regions 4-7 STM r1,{r2-r9} // Store MPU regions 4-7 +#ifdef TXM_MODULE_MANAGER_16_MPU LDM r0!,{r2-r9} // Load MPU regions 8-11 STM r1,{r2-r9} // Store MPU regions 8-11 LDM r0,{r2-r9} // Load MPU regions 12-15 STM r1,{r2-r9} // Store MPU regions 12-15 -#else - LDM r0!,{r2-r9} // Load first four MPU regions - STM r1,{r2-r9} // Store first four MPU regions - LDM r0,{r2-r9} // Load second four MPU regions - STM r1,{r2-r9} // Store second four MPU regions #endif +_tx_enable_mpu LDR r0, =0xE000ED94 // Build MPU control reg address MOV r1, #5 // Build enable value with background region enabled STR r1, [r0] // Enable MPU diff --git a/ports_module/cortex_m7/ac6/inc/tx_port.h b/ports_module/cortex_m7/ac6/inc/tx_port.h index c5f6fdd5..56f2531f 100644 --- a/ports_module/cortex_m7/ac6/inc/tx_port.h +++ b/ports_module/cortex_m7/ac6/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M7/AC6 */ -/* 6.1.9 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -48,6 +48,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 10-15-2021 Scott Larson Initial Version 6.1.9 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -123,13 +126,13 @@ typedef unsigned short USHORT; For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #ifndef TX_TRACE_TIME_MASK #define TX_TRACE_TIME_MASK 0xFFFFFFFFUL @@ -291,7 +294,7 @@ __attribute__( ( always_inline ) ) static inline void __set_control(ULONG contro else \ { \ ULONG _tx_fpccr; \ - _tx_fpccr = *((ULONG *) 0xE000EF34); \ + _tx_fpccr = *((volatile ULONG *) 0xE000EF34); \ _tx_fpccr = _tx_fpccr & ((ULONG) 0x01); \ if (_tx_fpccr == ((ULONG) 0x01)) \ { \ @@ -467,7 +470,8 @@ __attribute__( ( always_inline ) ) static inline void _tx_thread_system_return_i { unsigned int interrupt_save; - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + /* Set PendSV to invoke ThreadX scheduler. */ + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (__get_ipsr_value() == 0) { interrupt_save = __get_primask_value(); @@ -497,7 +501,7 @@ unsigned int interrupt_save; #endif -/* Define FPU extension for the Cortex-M7. Each is assumed to be called in the context of the executing +/* Define FPU extension for the Cortex-M7. Each is assumed to be called in the context of the executing thread. These are no longer needed, but are preserved for backward compatibility only. */ void tx_thread_fpu_enable(void); @@ -508,7 +512,7 @@ void tx_thread_fpu_disable(void); #ifdef TX_THREAD_INIT CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M7/AC6 Version 6.1.9 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M7/AC6 Version 6.1.11 *"; #else extern CHAR _tx_version_id[]; #endif diff --git a/ports_module/cortex_m7/ac6/module_manager/src/tx_thread_schedule.S b/ports_module/cortex_m7/ac6/module_manager/src/tx_thread_schedule.S index 106d7e5e..c6b66e54 100644 --- a/ports_module/cortex_m7/ac6/module_manager/src/tx_thread_schedule.S +++ b/ports_module/cortex_m7/ac6/module_manager/src/tx_thread_schedule.S @@ -42,7 +42,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_schedule Cortex-M7/AC6 */ -/* 6.1.9 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* Scott Larson, Microsoft Corporation */ @@ -69,13 +69,15 @@ /* */ /* _tx_initialize_kernel_enter ThreadX entry function */ /* _tx_thread_system_return Return to system from thread */ -/* _tx_thread_context_restore Restore thread's context */ /* */ /* RELEASE HISTORY */ /* */ /* DATE NAME DESCRIPTION */ /* */ /* 10-15-2021 Scott Larson Initial Version 6.1.9 */ +/* 04-25-2022 Scott Larson Optimized MPU configuration, */ +/* added BASEPRI support, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_schedule(VOID) @@ -135,7 +137,12 @@ BusFault_Handler: .thumb_func UsageFault_Handler: +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ /* Now pickup and store all the fault related information. */ @@ -197,7 +204,7 @@ UsageFault_Handler: LDR r0, =0xE000EF34 // Cleanup FPU context: Load FPCCR address LDR r1, [r0] // Load FPCCR BIC r1, r1, #1 // Clear the lazy preservation active bit - STR r1, [r0] // Store the value + STR r1, [r0] // Save FPCCR #endif BL _txm_module_manager_memory_fault_handler // Call memory manager fault handler @@ -218,7 +225,12 @@ UsageFault_Handler: LDR r1, =0x10000000 // Set PENDSVSET bit STR r1, [r0] // Store ICSR DSB // Wait for memory access to complete +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts +#endif MOV lr, #0xFFFFFFFD // Load exception return code BX lr // Return from exception @@ -239,12 +251,22 @@ __tx_ts_handler: #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) /* Call the thread exit function to indicate the thread is no longer executing. */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ PUSH {r0, lr} // Save LR (and r0 just for alignment) BL _tx_execution_thread_exit // Call the thread exit function POP {r0, lr} // Recover LR +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts -#endif +#endif /* TX_PORT_USE_BASEPRI */ +#endif /* EXECUTION PROFILE */ LDR r0, =_tx_thread_current_ptr // Build current thread pointer address LDR r2, =_tx_thread_execute_ptr // Build execute thread pointer address @@ -289,7 +311,12 @@ __tx_ts_new: /* Now we are looking for a new thread to execute! */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Is there another thread ready to execute? CBNZ r1, __tx_ts_restore // Yes, schedule it @@ -298,7 +325,12 @@ __tx_ts_new: are disabled to allow use of WFI for waiting for a thread to arrive. */ __tx_ts_wait: +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Pickup the next thread to execute pointer CBNZ r1, __tx_ts_ready // If non-NULL, a new thread is ready! #ifdef TX_ENABLE_WFI @@ -306,7 +338,12 @@ __tx_ts_wait: WFI // Wait for interrupt ISB // Ensure pipeline is flushed #endif +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_wait // Loop to continue waiting /* At this point, we have a new thread ready to go. Clear any newly pended PendSV - since we are @@ -323,7 +360,12 @@ __tx_ts_restore: and enable interrupts. */ STR r1, [r0] // Setup the current thread pointer to the new thread +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif /* Increment the thread run count. */ @@ -359,27 +401,34 @@ __tx_ts_restore: STR r3, [r0] // Disable MPU LDR r0, [r1, #0x90] // Pickup the module instance pointer CBZ r0, skip_mpu_setup // Is this thread owned by a module? No, skip MPU setup - LDR r1, [r0, #0x64] // Pickup MPU register[0] - CBZ r1, skip_mpu_setup // Is protection required for this module? No, skip MPU setup - LDR r1, =0xE000ED9C // Build address of MPU base register + + LDR r2, [r0, #0x8C] // Pickup MPU region 5 address + CBZ r2, skip_mpu_setup // Is protection required for this module? No, skip MPU setup + + // Is the MPU already set up for this module? + MOV r1, #5 // Select region 5 from MPU + LDR r3, =0xE000ED98 // MPU_RNR register address + STR r1, [r3] // Set region to 5 + LDR r1, =0xE000ED9C // MPU_RBAR register address + LDR r3, [r1] // Load address stored in MPU region 5 + BIC r2, r2, #0x10 // Clear VALID bit + CMP r2, r3 // Is module already loaded? + BEQ _tx_enable_mpu // Yes - skip MPU reconfiguration // Use alias registers to quickly load MPU ADD r0, r0, #100 // Build address of MPU register start in thread control block -#ifdef TXM_MODULE_MANAGER_16_MPU + LDM r0!,{r2-r9} // Load MPU regions 0-3 STM r1,{r2-r9} // Store MPU regions 0-3 LDM r0!,{r2-r9} // Load MPU regions 4-7 STM r1,{r2-r9} // Store MPU regions 4-7 +#ifdef TXM_MODULE_MANAGER_16_MPU LDM r0!,{r2-r9} // Load MPU regions 8-11 STM r1,{r2-r9} // Store MPU regions 8-11 LDM r0,{r2-r9} // Load MPU regions 12-15 STM r1,{r2-r9} // Store MPU regions 12-15 -#else - LDM r0!,{r2-r9} // Load first four MPU regions - STM r1,{r2-r9} // Store first four MPU regions - LDM r0,{r2-r9} // Load second four MPU regions - STM r1,{r2-r9} // Store second four MPU regions #endif +_tx_enable_mpu: LDR r0, =0xE000ED94 // Build MPU control reg address MOV r1, #5 // Build enable value with background region enabled STR r1, [r0] // Enable MPU @@ -538,14 +587,14 @@ _tx_no_lazy_clear: #endif /* Copy kernel hardware stack to module thread stack. */ - LDM r3!, {r1-r2} - STM r0!, {r1-r2} - LDM r3!, {r1-r2} - STM r0!, {r1-r2} - LDM r3!, {r1-r2} - STM r0!, {r1-r2} - LDM r3!, {r1-r2} - STM r0!, {r1-r2} + LDM r3!, {r1-r2} // Get r0, r1 from kernel stack + STM r0!, {r1-r2} // Insert r0, r1 into thread stack + LDM r3!, {r1-r2} // Get r2, r3 from kernel stack + STM r0!, {r1-r2} // Insert r2, r3 into thread stack + LDM r3!, {r1-r2} // Get r12, lr from kernel stack + STM r0!, {r1-r2} // Insert r12, lr into thread stack + LDM r3!, {r1-r2} // Get pc, xpsr from kernel stack + STM r0!, {r1-r2} // Insert pc, xpsr into thread stack SUB r0, r0, #32 // Subtract 32 to get back to top of stack MSR PSP, r0 // Set thread stack pointer diff --git a/ports_module/cortex_m7/gnu/inc/tx_port.h b/ports_module/cortex_m7/gnu/inc/tx_port.h index b4e27ddf..0d9feee7 100644 --- a/ports_module/cortex_m7/gnu/inc/tx_port.h +++ b/ports_module/cortex_m7/gnu/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M7/GNU */ -/* 6.1.9 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -48,6 +48,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 10-15-2021 Scott Larson Initial Version 6.1.9 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -123,13 +126,13 @@ typedef unsigned short USHORT; For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #ifndef TX_TRACE_TIME_MASK #define TX_TRACE_TIME_MASK 0xFFFFFFFFUL @@ -291,7 +294,7 @@ __attribute__( ( always_inline ) ) static inline void __set_control(ULONG contro else \ { \ ULONG _tx_fpccr; \ - _tx_fpccr = *((ULONG *) 0xE000EF34); \ + _tx_fpccr = *((volatile ULONG *) 0xE000EF34); \ _tx_fpccr = _tx_fpccr & ((ULONG) 0x01); \ if (_tx_fpccr == ((ULONG) 0x01)) \ { \ @@ -461,7 +464,8 @@ __attribute__( ( always_inline ) ) static inline void _tx_thread_system_return_i { unsigned int interrupt_save; - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + /* Set PendSV to invoke ThreadX scheduler. */ + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (__get_ipsr_value() == 0) { interrupt_save = __get_primask_value(); @@ -491,8 +495,8 @@ unsigned int interrupt_save; #endif -/* Define FPU extension for the Cortex-M7. Each is assumed to be called in the context of the executing - thread. This is for legacy only, and not needed any longer. */ +/* Define FPU extension for the Cortex-M7. Each is assumed to be called in the context of the executing + thread. These are no longer needed, but are preserved for backward compatibility only. */ void tx_thread_fpu_enable(void); void tx_thread_fpu_disable(void); @@ -502,7 +506,7 @@ void tx_thread_fpu_disable(void); #ifdef TX_THREAD_INIT CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M7/GNU Version 6.1.9 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX Cortex-M7/GNU Version 6.1.11 *"; #else extern CHAR _tx_version_id[]; #endif diff --git a/ports_module/cortex_m7/gnu/module_manager/src/tx_thread_schedule.S b/ports_module/cortex_m7/gnu/module_manager/src/tx_thread_schedule.S index 2f472d6d..e3401782 100644 --- a/ports_module/cortex_m7/gnu/module_manager/src/tx_thread_schedule.S +++ b/ports_module/cortex_m7/gnu/module_manager/src/tx_thread_schedule.S @@ -40,7 +40,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_schedule Cortex-M7/GNU */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* Scott Larson, Microsoft Corporation */ @@ -67,7 +67,6 @@ /* */ /* _tx_initialize_kernel_enter ThreadX entry function */ /* _tx_thread_system_return Return to system from thread */ -/* _tx_thread_context_restore Restore thread's context */ /* */ /* RELEASE HISTORY */ /* */ @@ -76,6 +75,9 @@ /* 10-15-2021 Scott Larson Initial Version 6.1.9 */ /* 01-31-2022 Scott Larson Fixed predefined macro name, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 Scott Larson Optimized MPU configuration, */ +/* added BASEPRI support, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_schedule(VOID) @@ -135,7 +137,12 @@ BusFault_Handler: .thumb_func UsageFault_Handler: +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ /* Now pickup and store all the fault related information. */ @@ -197,7 +204,7 @@ UsageFault_Handler: LDR r0, =0xE000EF34 // Cleanup FPU context: Load FPCCR address LDR r1, [r0] // Load FPCCR BIC r1, r1, #1 // Clear the lazy preservation active bit - STR r1, [r0] // Store the value + STR r1, [r0] // Save FPCCR #endif BL _txm_module_manager_memory_fault_handler // Call memory manager fault handler @@ -218,7 +225,12 @@ UsageFault_Handler: LDR r1, =0x10000000 // Set PENDSVSET bit STR r1, [r0] // Store ICSR DSB // Wait for memory access to complete +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts +#endif MOV lr, #0xFFFFFFFD // Load exception return code BX lr // Return from exception @@ -239,12 +251,22 @@ __tx_ts_handler: #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) /* Call the thread exit function to indicate the thread is no longer executing. */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ PUSH {r0, lr} // Save LR (and r0 just for alignment) BL _tx_execution_thread_exit // Call the thread exit function POP {r0, lr} // Recover LR +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts -#endif +#endif /* TX_PORT_USE_BASEPRI */ +#endif /* EXECUTION PROFILE */ LDR r0, =_tx_thread_current_ptr // Build current thread pointer address LDR r2, =_tx_thread_execute_ptr // Build execute thread pointer address @@ -289,7 +311,12 @@ __tx_ts_new: /* Now we are looking for a new thread to execute! */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Is there another thread ready to execute? CBNZ r1, __tx_ts_restore // Yes, schedule it @@ -298,7 +325,12 @@ __tx_ts_new: are disabled to allow use of WFI for waiting for a thread to arrive. */ __tx_ts_wait: +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Pickup the next thread to execute pointer CBNZ r1, __tx_ts_ready // If non-NULL, a new thread is ready! #ifdef TX_ENABLE_WFI @@ -306,7 +338,12 @@ __tx_ts_wait: WFI // Wait for interrupt ISB // Ensure pipeline is flushed #endif +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_wait // Loop to continue waiting /* At this point, we have a new thread ready to go. Clear any newly pended PendSV - since we are @@ -323,7 +360,12 @@ __tx_ts_restore: and enable interrupts. */ STR r1, [r0] // Setup the current thread pointer to the new thread +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif /* Increment the thread run count. */ @@ -359,27 +401,34 @@ __tx_ts_restore: STR r3, [r0] // Disable MPU LDR r0, [r1, #0x90] // Pickup the module instance pointer CBZ r0, skip_mpu_setup // Is this thread owned by a module? No, skip MPU setup - LDR r1, [r0, #0x64] // Pickup MPU register[0] - CBZ r1, skip_mpu_setup // Is protection required for this module? No, skip MPU setup - LDR r1, =0xE000ED9C // Build address of MPU base register + + LDR r2, [r0, #0x8C] // Pickup MPU region 5 address + CBZ r2, skip_mpu_setup // Is protection required for this module? No, skip MPU setup + + // Is the MPU already set up for this module? + MOV r1, #5 // Select region 5 from MPU + LDR r3, =0xE000ED98 // MPU_RNR register address + STR r1, [r3] // Set region to 5 + LDR r1, =0xE000ED9C // MPU_RBAR register address + LDR r3, [r1] // Load address stored in MPU region 5 + BIC r2, r2, #0x10 // Clear VALID bit + CMP r2, r3 // Is module already loaded? + BEQ _tx_enable_mpu // Yes - skip MPU reconfiguration // Use alias registers to quickly load MPU ADD r0, r0, #100 // Build address of MPU register start in thread control block -#ifdef TXM_MODULE_MANAGER_16_MPU + LDM r0!,{r2-r9} // Load MPU regions 0-3 STM r1,{r2-r9} // Store MPU regions 0-3 LDM r0!,{r2-r9} // Load MPU regions 4-7 STM r1,{r2-r9} // Store MPU regions 4-7 +#ifdef TXM_MODULE_MANAGER_16_MPU LDM r0!,{r2-r9} // Load MPU regions 8-11 STM r1,{r2-r9} // Store MPU regions 8-11 LDM r0,{r2-r9} // Load MPU regions 12-15 STM r1,{r2-r9} // Store MPU regions 12-15 -#else - LDM r0!,{r2-r9} // Load first four MPU regions - STM r1,{r2-r9} // Store first four MPU regions - LDM r0,{r2-r9} // Load second four MPU regions - STM r1,{r2-r9} // Store second four MPU regions #endif +_tx_enable_mpu: LDR r0, =0xE000ED94 // Build MPU control reg address MOV r1, #5 // Build enable value with background region enabled STR r1, [r0] // Enable MPU diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/board.h b/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/board.h deleted file mode 100644 index e30a775d..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/board.h +++ /dev/null @@ -1,763 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2014, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \page samv7_Xplained_ultra_board_desc SAM V71 Xplained Ultra - Board - * Description - * - * \section Purpose - * - * This file is dedicated to describe the SAM V71 Xplained Ultra board. - * - * \section Contents - * - * - For SAM V71 Xplained Ultra board information, see - * \subpage samv7_Xplained_ultra_board_info. - * - For operating frequency information, see \subpage samv7_Xplained_ultra_opfreq. - * - For using portable PIO definitions, see \subpage samv7_Xplained_ultra_piodef. - * - For using GMAC PIO definitions, see \subpage samv7_Xplained_ultra_gmac. - * - For using ISI definitions, see \subpage samv7_Xplained_ultra_isi. - * - For on-board memories, see \subpage samv7_Xplained_ultra_mem. - * - Several USB definitions are included here, - * see \subpage samv7_Xplained_ultra_usb. - * - For External components, see \subpage samv7_Xplained_ultra_extcomp. - * - For Individual chip definition, see \subpage samv7_Xplained_ultra_chipdef. - * - * To get more software details and the full list of parameters related to the - * SAM V71 Xplained Ultra board configuration, please have a look at the source - * file: - * \ref board.h\n - * - * \section Usage - * - * - The code for booting the board is provided by board_cstartup_xxx.c and - * board_lowlevel.c. - * - For using board PIOs, board characteristics (clock, etc.) and external - * components, see board.h. - * - For manipulating memories, see board_memories.h. - * - * This file can be used as a template and modified to fit a custom board, with - * specific PIOs usage or memory connections. - */ - -/** - * \file board.h - * - * Definition of SAM V71 Xplained Ultra board characteristics, PIOs and - * external components interface. - */ - -#ifndef _BOARD_H_ -#define _BOARD_H_ - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ - -#include "chip.h" - -#include "include/board_lowlevel.h" -#include "include/board_memories.h" -#include "include/led.h" -#include "include/gmii.h" -#include "include/gmacb_phy.h" -#include "include/dbg_console.h" -#include "include/bmp.h" -#include "include/lcdd.h" -#include "include/ili9488.h" -#include "include/ili9488_reg.h" -#include "include/ili9488_spi.h" -#include "include/ili9488_ebi.h" -#include "include/ili9488_dma.h" -#include "include/ili9488_spi_dma.h" -#include "include/ili9488_ebi_dma.h" -#include "include/frame_buffer.h" -#include "include/lcd_color.h" -#include "include/lcd_draw.h" -#include "include/lcd_font10x14.h" -#include "include/lcd_font.h" -#include "include/lcd_gimp_image.h" -#include "include/rtc_calib.h" -#include "include/wm8904.h" -#include "include/cs2100.h" -#include "include/s25fl1.h" -#include "include/image_sensor_inf.h" -#include "include/iso7816_4.h" - -#if defined ( __GNUC__ ) -#include "include/syscalls.h" -#endif -/*---------------------------------------------------------------------------- - * Definitions - *----------------------------------------------------------------------------*/ - -/*----------------------------------------------------------------------------*/ -/** - * \page samv7_Xplained_ultra_board_info "SAM V71 Xplained Ultra - Board informations" - * This page lists several definition related to the board description. - * - * \section Definitions - * - \ref BOARD_NAME - */ - -/** Name of the board */ -#define BOARD_NAME "SAM V71 Xplained Ultra" -#define NO_PUSHBUTTON -/*----------------------------------------------------------------------------*/ -/** - * \page samv7_Xplained_ultra_opfreq "SAM V71 Xplained Ultra - Operating frequencies" - * This page lists several definition related to the board operating frequency - * (when using the initialization done by board_lowlevel.c). - * - * \section Definitions - * - \ref BOARD_MAINOSC - * - \ref BOARD_MCK - */ - -/** Frequency of the board main oscillator */ -#define BOARD_MAINOSC 12000000 - -/** Master clock frequency (when using board_lowlevel.c) */ - -#ifdef MCK_123MHZ -#define BOARD_MCK 123000000 -#else -#define BOARD_MCK 150000000 -#endif - -#if (BOARD_MCK==132000000 ) - -#define PLL_MUL 0x16 -#define PLL_DIV 0x01 - -#else // 300MHz(PCK) and 150MHz(MCK) by default - -#define PLL_MUL 0x19 -#define PLL_DIV 0x01 - -#endif - -/*----------------------------------------------------------------------------*/ -/** - * \page samv7_Xplained_ultra_piodef "SAM V71 Xplained Ultra - PIO definitions" - * This pages lists all the PIOs definitions contained in board.h. The constants - * are named using the following convention: PIN_* for a constant which defines - * a single Pin instance (but may include several PIOs sharing the same - * controller), and PINS_* for a list of Pin instances. - * - * UART0 - * - \ref PINS_UART0 - * - * UART4 - * - \ref PINS_UART4 - * - * LEDs - * - \ref PIN_LED_0 - * - \ref PIN_LED_1 - * - \ref PINS_LEDS - * - * Push buttons - * - \ref PIN_PUSHBUTTON_0 - * - \ref PIN_PUSHBUTTON_1 - * - \ref PINS_PUSHBUTTONS - * - \ref PUSHBUTTON_BP0 - * - \ref PUSHBUTTON_BP1 - * - * PWMC - * - \ref PIN_PWMC_PWMH0 - * - \ref PIN_PWMC_PWMH1 - * - \ref PIN_PWM_LED0 - * - \ref PIN_PWM_LED1 - * - \ref CHANNEL_PWM_LED0 - * - \ref CHANNEL_PWM_LED1 - * - * SPI - * - \ref PIN_SPI_MISO - * - \ref PIN_SPI_MOSI - * - \ref PIN_SPI_SPCK - * - \ref PINS_SPI - * - * PCK0 - * - \ref PIN_PCK0 - * - \ref PIN_PCK1 - * - \ref PIN_PCK2 - * - * PIO PARALLEL CAPTURE - * - \ref PIN_PIODCEN1 - * - \ref PIN_PIODCEN2 - * - * TWI - * - \ref TWI_V3XX - * - \ref PIN_TWI_TWD0 - * - \ref PIN_TWI_TWCK0 - * - \ref PINS_TWI0 - * - \ref PIN_TWI_TWD1 - * - \ref PIN_TWI_TWCK1 - * - \ref PINS_TWI1 - * - * USART0 - * - \ref PIN_USART0_RXD - * - \ref PIN_USART0_TXD - * - \ref PIN_USART0_CTS - * - \ref PIN_USART0_RTS - * - \ref PIN_USART0_SCK - * - * USART1 - * - \ref PIN_USART1_RXD - * - \ref PIN_USART1_TXD - * - \ref PIN_USART1_CTS - * - \ref PIN_USART1_RTS - * - \ref PIN_USART1_SCK - * - * USART2 - * - \ref PIN_USART2_RXD - * - \ref PIN_USART2_TXD - * - \ref PIN_USART2_CTS - * - \ref PIN_USART2_RTS - * - \ref PIN_USART2_SCK - * - * SSC - * - \ref PIN_SSC_TD - * - \ref PIN_SSC_TK - * - \ref PIN_SSC_TF - * - \ref PIN_SSC_RD - * - \ref PIN_SSC_RK - * - \ref PIN_SSC_RF - * - \ref PIN_SSC_TD - * - \ref PINS_SSC_CODEC - * - * MCAN - * - \ref PIN_MCAN0_TXD - * - \ref PIN_MCAN0_RXD - * - \ref PIN_MCAN1_TXD - * - \ref PIN_MCAN1_RXD - */ - -/** SSC pin Transmitter Data (TD) */ -#define PIN_SSC_TD {PIO_PD26B_TD, PIOD, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT} -/** SSC pin Transmitter Clock (TK) */ -#define PIN_SSC_TK {PIO_PB1D_TK, PIOB, ID_PIOB, PIO_PERIPH_D, PIO_DEFAULT} -/** SSC pin Transmitter FrameSync (TF) */ -#define PIN_SSC_TF {PIO_PB0D_TF, PIOB, ID_PIOB, PIO_PERIPH_D, PIO_DEFAULT} -/** SSC pin RD */ -#define PIN_SSC_RD {PIO_PA10C_RD, PIOA, ID_PIOA, PIO_PERIPH_C, PIO_DEFAULT} -/** SSC pin RK */ -#define PIN_SSC_RK {PIO_PA22A_RK, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT} -/** SSC pin RF */ -#define PIN_SSC_RF {PIO_PD24B_RF, PIOD, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT} - -/** SSC pins definition for codec. */ -#define PINS_SSC_CODEC \ - {PIN_SSC_TD, PIN_SSC_TK, PIN_SSC_TF, PIN_SSC_RD, PIN_SSC_RK, PIN_SSC_RF} - -/** UART pins (UTXD0 and URXD0) definitions, PA9,10. */ -#define PINS_UART0 \ - {PIO_PA9A_URXD0 | PIO_PA10A_UTXD0, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT} -/** UART pins (UTXD4 and URXD4) definitions, PD19,18. */ -#define PINS_UART4 \ - {PIO_PD18C_URXD4 | PIO_PD19C_UTXD4, PIOD, ID_PIOD, PIO_PERIPH_C, PIO_DEFAULT} - -/* LED pins definitions */ -#define LED_YELLOW0 0 -#define LED_YELLOW1 1 - -/** LED #0 pin definition (YELLOW). */ -#define PIN_LED_0 {PIO_PA23, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} -/** LED #0 pin definition (YELLOW). */ -#define PIN_LED_1 {PIO_PC9, PIOC, ID_PIOC, PIO_OUTPUT_1, PIO_DEFAULT} - -/** List of all LEDs definitions. */ -#define PINS_LEDS {PIN_LED_0, PIN_LED_1} - -/** - * Push button #0 definition. - * Attributes = pull-up + debounce + interrupt on rising edge. - */ -#define PIN_PUSHBUTTON_0 \ - {PIO_PA9, PIOA, ID_PIOA, PIO_INPUT, PIO_PULLUP | PIO_DEBOUNCE | PIO_IT_FALL_EDGE} -/** - * Push button #1 definition. - * Attributes = pull-up + debounce + interrupt on rising edge. - */ -#define PIN_PUSHBUTTON_1 \ - {PIO_PB12, PIOB, ID_PIOB, PIO_INPUT, PIO_PULLUP | PIO_DEBOUNCE | PIO_IT_FALL_EDGE} - -/** List of all push button definitions. */ -#define PINS_PUSHBUTTONS {PIN_PUSHBUTTON_0, PIN_PUSHBUTTON_1} - -/** Push button #0 index. */ -#define PUSHBUTTON_BP0 0 -/** Push button #1 index. */ -#define PUSHBUTTON_BP1 1 - -/** PWMC PWM0 pin definition: Output High. */ -#define PIN_PWMC_PWMH0 {PIO_PD20A_PWMH0, PIOD, ID_PIOD, PIO_PERIPH_A, PIO_DEFAULT} -/** PWMC PWM1 pin definition: Output High. */ -#define PIN_PWMC_PWMH1 {PIO_PD21A_PWMH1, PIOD, ID_PIOD, PIO_PERIPH_A, PIO_DEFAULT} -/** PWM pins definition for LED0 */ -#define PIN_PWM_LED0 PIN_PWMC_PWMH0 -/** PWM pins definition for LED1 */ -#define PIN_PWM_LED1 PIN_PWMC_PWMH1 -/** PWM channel for LED0 */ -#define CHANNEL_PWM_LED0 0 -/** PWM channel for LED1 */ -#define CHANNEL_PWM_LED1 1 - -/** SPI MISO pin definition. */ -#define PIN_SPI_MISO {PIO_PD20B_SPI0_MISO, PIOD, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT} -/** SPI MOSI pin definition. */ -#define PIN_SPI_MOSI {PIO_PD21B_SPI0_MOSI, PIOD, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT} -/** SPI SPCK pin definition. */ -#define PIN_SPI_SPCK {PIO_PD22B_SPI0_SPCK, PIOD, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT} -/** SPI chip select pin definition. */ -#define PIN_SPI_NPCS0 {PIO_PB2D_SPI0_NPCS0, PIOB, ID_PIOB, PIO_PERIPH_D, PIO_DEFAULT} -#define PIN_SPI_NPCS1 {PIO_PD25B_SPI0_NPCS1, PIOD, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT} -#define PIN_SPI_NPCS3 {PIO_PD27B_SPI0_NPCS3, PIOD, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT} - -/** List of SPI pin definitions (MISO, MOSI & SPCK). */ -#define PINS_SPI PIN_SPI_MISO, PIN_SPI_MOSI, PIN_SPI_SPCK - -/** PCK0 */ -#define PIN_PCK0 {PIO_PB13B_PCK0, PIOB, ID_PIOB, PIO_PERIPH_B, PIO_DEFAULT} -/** PCK1 */ -#define PIN_PCK1 {PIO_PA17B_PCK1, PIOB, ID_PIOB, PIO_PERIPH_B, PIO_DEFAULT} -/** PCK2 */ -#define PIN_PCK2 {PIO_PA18B_PCK2, PIOA, ID_PIOA, PIO_PERIPH_B, PIO_DEFAULT} - - -/** PIO PARALLEL CAPTURE */ -/** Parallel Capture Mode Data Enable1 */ -#define PIN_PIODCEN1 PIO_PA15 -/** Parallel Capture Mode Data Enable2 */ -#define PIN_PIODCEN2 PIO_PA16 - -/** TWI version 3.xx */ -#define TWI_V3XX -/** TWI0 data pin */ -#define PIN_TWI_TWD0 {PIO_PA3A_TWD0, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT} -/** TWI0 clock pin */ -#define PIN_TWI_TWCK0 {PIO_PA4A_TWCK0, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT} -/** TWI0 pins */ -#define PINS_TWI0 {PIN_TWI_TWD0, PIN_TWI_TWCK0} - -/** TWI1 data pin */ -#define PIN_TWI_TWD1 {PIO_PB4A_TWD1, PIOB, ID_PIOB, PIO_PERIPH_A, PIO_DEFAULT} -/** TWI1 clock pin */ -#define PIN_TWI_TWCK1 {PIO_PB5A_TWCK1, PIOB, ID_PIOB, PIO_PERIPH_A,PIO_DEFAULT} -/** TWI1 pins */ -#define PINS_TWI1 {PIN_TWI_TWD1, PIN_TWI_TWCK1} - -/** USART0 pin RX */ -#define PIN_USART0_RXD {PIO_PB0C_RXD0, PIOB, ID_PIOB, PIO_PERIPH_C, PIO_DEFAULT} -/** USART0 pin TX */ -#define PIN_USART0_TXD {PIO_PB1C_TXD0, PIOB, ID_PIOB, PIO_PERIPH_C, PIO_DEFAULT} -/** USART0 pin CTS */ -#define PIN_USART0_CTS {PIO_PB2C_CTS0, PIOB, ID_PIOB, PIO_PERIPH_C, PIO_DEFAULT} -/** USART0 pin RTS */ -#define PIN_USART0_RTS {PIO_PB3C_RTS0, PIOB, ID_PIOB, PIO_PERIPH_C, PIO_DEFAULT} -/** USART0 pin SCK */ -#define PIN_USART0_SCK {PIO_PB13C_SCK0, PIOB, ID_PIOB, PIO_PERIPH_C,PIO_DEFAULT} - -/** USART1 pin RX */ -#define PIN_USART1_RXD {PIO_PA21A_RXD1, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT} -/** USART1 pin TX */ -#define PIN_USART1_TXD {PIO_PB4D_TXD1, PIOB, ID_PIOB, PIO_PERIPH_D, PIO_DEFAULT} -/** USART1 pin CTS */ -#define PIN_USART1_CTS {PIO_PA25A_CTS1, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT} -/** USART1 pin RTS */ -#define PIN_USART1_RTS {PIO_PA24A_RTS1, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT} -/** USART1 pin ENABLE */ -#define PIN_USART1_EN {PIO_PA23A_SCK1, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT} -/** USART1 pin SCK */ -#define PIN_USART1_SCK {PIO_PA23A_SCK1, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT} - -/** USART2 pin RX */ -#define PIN_USART2_RXD {PIO_PD15B_RXD2, PIOD, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT} -/** USART2 pin TX */ -#define PIN_USART2_TXD {PIO_PD16B_TXD2, PIOD, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT} -/** USART2 pin CTS */ -#define PIN_USART2_CTS {PIO_PD19B_CTS2, PIOD, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT} -/** USART2 pin RTS */ -#define PIN_USART2_RTS {PIO_PD18B_RTS2, PIOD, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT} -/** USART2 pin SCK */ -#define PIN_USART2_SCK {PIO_PD17B_SCK2, PIOD, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT} - -/*Pins for USART0 as 7816 mode*/ -/** PIN used for reset the smartcard */ -#define PIN_ISO7816_RSTMC {PIO_PB2C_CTS0, PIOB, ID_PIOB, PIO_OUTPUT_0, PIO_DEFAULT} -/** Pins used for connect the smartcard */ -#define PINS_ISO7816 PIN_USART0_TXD, PIN_USART0_SCK,PIN_ISO7816_RSTMC - -/** MCAN0 pin Transmit Data (TXD) */ -#define PIN_MCAN0_TXD {PIO_PB2A_CANTX0, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT} -/** MCAN0 pin Receive Data (RXD) */ -#define PIN_MCAN0_RXD {PIO_PB3A_CANRX0, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT} - -/** MCAN1 pin Transmit Data (TXD) */ -#define PIN_MCAN1_TXD {PIO_PC14C_CANTX1, PIOC, ID_PIOC, PIO_PERIPH_C, PIO_DEFAULT} -/** MCAN1 pin Receive Data (RXD) */ -#define PIN_MCAN1_RXD {PIO_PC12C_CANRX1, PIOC, ID_PIOC, PIO_PERIPH_C, PIO_DEFAULT} - -/*----------------------------------------------------------------------------*/ -/** - * \page samv7_Xplained_ultra_gmac "SAM V71 Xplained Ultra - GMAC" - * \section GMAC - * - \ref BOARD_GMAC_PHY_ADDR - * - \ref BOARD_GMAC_PHY_COMP_KSZ8061RNB - * - \ref BOARD_GMAC_MODE_RMII - * - \ref BOARD_GMAC_PINS - * - \ref BOARD_GMAC_RESET_PIN - * - */ -/** PHY address */ -#define BOARD_GMAC_PHY_ADDR 1 -/** PHY Component */ -#define BOARD_GMAC_PHY_COMP_KSZ8061RNB 1 -/** Board GMAC power control - ALWAYS ON */ -#define BOARD_GMAC_POWER_ALWAYS_ON -/** Board GMAC work mode - RMII/MII ( 1 / 0 ) */ -#define BOARD_GMAC_MODE_RMII 1 - -/** The PIN list of PIO for GMAC */ -#define BOARD_GMAC_PINS \ - { (PIO_PD0A_GTXCK | PIO_PD1A_GTXEN | PIO_PD2A_GTX0 | PIO_PD3A_GTX1 \ - | PIO_PD4A_GRXDV | PIO_PD5A_GRX0 | PIO_PD6A_GRX1 | PIO_PD7A_GRXER \ - | PIO_PD8A_GMDC | PIO_PD9A_GMDIO ),PIOD, ID_PIOD, PIO_PERIPH_A, PIO_DEFAULT}, \ - {PIO_PC30, PIOC, ID_PIOC, PIO_INPUT, PIO_PULLUP},\ - {PIO_PA29, PIOA, ID_PIOA, PIO_INPUT, PIO_DEFAULT} - -/** The PIN list of PIO for GMAC */ -#define BOARD_GMAC_RESET_PIN {PIO_PC10, PIOC, ID_PIOC, PIO_OUTPUT_1, PIO_PULLUP} - -/** The runtime pin configure list for GMAC */ -#define BOARD_GMAC_RUN_PINS BOARD_GMAC_PINS - - -/*----------------------------------------------------------------------------*/ -/** - * \page samv7_Xplained_ultra_isi "SAM V71 Xplained Ultra - ISI" - * This page lists all the IO definitions connected to ISI module. - * ISI - * - \ref PIN_ISI_D0 - * - \ref PIN_ISI_D1 - * - \ref PIN_ISI_D2 - * - \ref PIN_ISI_D3 - * - \ref PIN_ISI_D4 - * - \ref PIN_ISI_D5 - * - \ref PIN_ISI_D6 - * - \ref PIN_ISI_D7 - * - \ref PIN_ISI_D8 - * - \ref PIN_ISI_D9 - * - \ref BOARD_ISI_VSYNC - * - \ref BOARD_ISI_HSYNC - * - \ref BOARD_ISI_PCK - * - \ref BOARD_ISI_PINS - * - */ -#define PIN_ISI_D0 {PIO_PD22D_ISI_D0, PIOD, ID_PIOD, PIO_PERIPH_D, PIO_PULLUP} -#define PIN_ISI_D1 {PIO_PD21D_ISI_D1, PIOD, ID_PIOD, PIO_PERIPH_D, PIO_PULLUP} -#define PIN_ISI_D2 {PIO_PB3D_ISI_D2, PIOB, ID_PIOB, PIO_PERIPH_D, PIO_PULLUP} -#define PIN_ISI_D3 {PIO_PA9B_ISI_D3, PIOA, ID_PIOA, PIO_PERIPH_B, PIO_PULLUP} -#define PIN_ISI_D4 {PIO_PA5B_ISI_D4, PIOA, ID_PIOA, PIO_PERIPH_B, PIO_PULLUP} -#define PIN_ISI_D5 {PIO_PD11D_ISI_D5, PIOD, ID_PIOD, PIO_PERIPH_D, PIO_PULLUP} -#define PIN_ISI_D6 {PIO_PD12D_ISI_D6, PIOD, ID_PIOD, PIO_PERIPH_D, PIO_PULLUP} -#define PIN_ISI_D7 {PIO_PA27D_ISI_D7, PIOA, ID_PIOA, PIO_PERIPH_D, PIO_PULLUP} -#define PIN_ISI_D8 {PIO_PD27D_ISI_D8, PIOD, ID_PIOD, PIO_PERIPH_D, PIO_PULLUP} -#define PIN_ISI_D9 {PIO_PD28D_ISI_D9, PIOD, ID_PIOD, PIO_PERIPH_D, PIO_PULLUP} - -#define BOARD_ISI_VSYNC {PIO_PD25D_ISI_VSYNC, PIOD, ID_PIOD, PIO_PERIPH_D, PIO_DEFAULT} -#define BOARD_ISI_HSYNC {PIO_PD24D_ISI_HSYNC, PIOD, ID_PIOD, PIO_PERIPH_D, PIO_DEFAULT} -#define BOARD_ISI_PCK {PIO_PA24D_ISI_PCK, PIOA, ID_PIOA, PIO_PERIPH_D, PIO_DEFAULT} - -#define BOARD_ISI_PCK0 { PIO_PA6B_PCK0, PIOA, ID_PIOA, PIO_PERIPH_B, PIO_DEFAULT } -#define BOARD_ISI_RST { 1 << 13, PIOB, ID_PIOB, PIO_OUTPUT_1, PIO_DEFAULT } -#define BOARD_ISI_PWD { 1 << 19, PIOC, ID_PIOC, PIO_OUTPUT_1, PIO_DEFAULT } - -#define BOARD_ISI_PINS \ - PIN_ISI_D0, PIN_ISI_D1, PIN_ISI_D2,PIN_ISI_D3,PIN_ISI_D4, PIN_ISI_D5,\ - PIN_ISI_D6,PIN_ISI_D7,PIN_ISI_D8, PIN_ISI_D9,BOARD_ISI_VSYNC ,\ - BOARD_ISI_HSYNC ,BOARD_ISI_PCK, BOARD_ISI_RST, BOARD_ISI_PWD,BOARD_ISI_PCK0 - -/*----------------------------------------------------------------------------*/ -/** - * \page samv7_Xplained_ultra_usb "SAM V71 Xplained Ultra - USB device" - * - * \section Definitions - * - \ref BOARD_USB_BMATTRIBUTES - * - * \section vBus - * - \ref PIN_USB_VBUS - * - */ - -/** - * USB attributes configuration descriptor (bus or self powered, - * remote wakeup) - */ -#define BOARD_USB_BMATTRIBUTES USBConfigurationDescriptor_SELFPOWERED_NORWAKEUP - -/** USB VBus monitoring pin definition. */ -#define PIN_USB_VBUS {PIO_PC16, PIOC, ID_PIOC, PIO_INPUT, PIO_DEFAULT} - - -/*----------------------------------------------------------------------------*/ -/** - * \page samv7_Xplained_ultra_extcomp "SAM V71 Xplained Ultra - External components" - * This page lists the definitions related to external on-board components - * located in the board.h file for the SAM V71 Xplained Ultra board. - * - * LCD - */ -/** Indicates board has an ILI9325 external component to manage LCD. */ -#define BOARD_LCD_ILI9488 -//#define BOARD_LCD_SPI_EXT1 -#define BOARD_LCD_SPI_EXT2 - -/** SPI pin definition for LCD */ -#if defined (BOARD_LCD_SPI_EXT1) -/** SPI MISO pin definition. */ -#define LCD_SPI_MISO {PIO_PD20B_SPI0_MISO, PIOD, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT} -/** SPI MOSI pin definition. */ -#define LCD_SPI_MOSI {PIO_PD21B_SPI0_MOSI, PIOD, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT} -/** SPI SPCK pin definition. */ -#define LCD_SPI_SPCK {PIO_PD22B_SPI0_SPCK, PIOD, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT} -/** SPI chip select pin definition. */ -#define LCD_SPI_NPCS {PIO_PD27B_SPI0_NPCS3, PIOD, ID_PIOD, PIO_PERIPH_B,PIO_DEFAULT} - -/** SPI chip select pin definition. */ -#define LCD_SPI_NPCS {PIO_PD25B_SPI0_NPCS1, PIOD, ID_PIOD, PIO_PERIPH_B,PIO_DEFAULT} - -/** LCD pins definition. */ -#define BOARD_SPI_LCD_PINS {LCD_SPI_MISO, LCD_SPI_MOSI, LCD_SPI_SPCK, LCD_SPI_NPCS} - -/** Back-light pin definition. */ - -#define BOARD_SPI_LCD_BACKLIGHT_PIN \ - {PIO_PA0A_PWMC0_PWMH0, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT} - -/** PWMC PWM0 pin definition: Output Low. */ -#define LCD_SPI_PIN_RESET {PIO_PD28, PIOD, ID_PIOD, PIO_OUTPUT_1, PIO_DEFAULT} - -/** PWM channel for LED0 */ -#define CHANNEL_PWM_LCD 0 - -#endif -/*ENDIF BOARD_LCD_SPI_EXT1 */ - -#if defined (BOARD_LCD_SPI_EXT2) - /** SPI MISO pin definition. */ -#define LCD_SPI_MISO {PIO_PD20B_SPI0_MISO, PIOD, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT} -/** SPI MOSI pin definition. */ -#define LCD_SPI_MOSI {PIO_PD21B_SPI0_MOSI, PIOD, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT} -/** SPI SPCK pin definition. */ -#define LCD_SPI_SPCK {PIO_PD22B_SPI0_SPCK, PIOD, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT} -/** SPI chip select pin definition. */ -#define LCD_SPI_NPCS {PIO_PD27B_SPI0_NPCS3, PIOD, ID_PIOD, PIO_PERIPH_B,PIO_DEFAULT} - -/** LCD pins definition. */ -#define BOARD_SPI_LCD_PINS {LCD_SPI_MISO, LCD_SPI_MOSI, LCD_SPI_SPCK, LCD_SPI_NPCS} - -/** Back-light pin definition. */ - -#define BOARD_SPI_LCD_PIN_BACKLIGHT \ - {PIO_PC19B_PWMC0_PWMH2, PIOC, ID_PIOC, PIO_OUTPUT_1, PIO_DEFAULT} - -/** PWMC PWM0 pin definition: Output Low. */ -#define LCD_SPI_PIN_RESET {PIO_PA24, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} - -/** LCD command/data select pin */ -#define BOARD_SPI_LCD_PIN_CDS {PIO_PA6, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} - -/** PWM channel for LED0 */ -#define CHANNEL_PWM_LCD 2 - -#endif -/*ENDIF BOARD_LCD_SPI_EXT2 */ - -/** SMC pin definition for LCD */ -/** LCD data pin */ -#define PIN_EBI_LCD_DATAL {0xFF, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP} -#define PIN_EBI_LCD_DATAH_0 {0x3F, PIOE, ID_PIOE, PIO_PERIPH_A, PIO_PULLUP} -#define PIN_EBI_LCD_DATAH_1 {PIO_PA15A_D14|PIO_PA16A_D15, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_PULLUP} -/** LCD WE pin */ -#define PIN_EBI_LCD_NWE {PIO_PC8A_NWE, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP} -/** LCD RD pin */ -#define PIN_EBI_LCD_NRD {PIO_PC11A_NRD, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP} -/* LCD CS pin (NCS3) */ -#define PIN_EBI_LCD_CS {PIO_PD19A_NCS3, PIOD, ID_PIOD, PIO_PERIPH_A, PIO_PULLUP} -/** LCD command/data select pin */ -#define BOARD_EBI_LCD_PIN_CDS {PIO_PC30, PIOC, ID_PIOC, PIO_OUTPUT_1, PIO_DEFAULT} -/** Back-light pin definition. */ -#define BOARD_EBI_LCD_PIN_BACKLIGHT {PIO_PC9B_TIOB7, PIOC, ID_PIOC, PIO_PERIPH_B, PIO_DEFAULT} -/** LCD reset pin */ -#define LCD_EBI_PIN_RESET {PIO_PC13, PIOC, ID_PIOC, PIO_OUTPUT_1, PIO_DEFAULT} - -/** LCD pins definition. */ -#define BOARD_EBI_LCD_PINS \ - {PIN_EBI_LCD_DATAL, PIN_EBI_LCD_DATAH_0, PIN_EBI_LCD_DATAH_1, \ - PIN_EBI_LCD_NWE,PIN_EBI_LCD_NRD,PIN_EBI_LCD_CS} - - -/** Display width in pixels. */ -#define BOARD_LCD_WIDTH 320 -/** Display height in pixels. */ -#define BOARD_LCD_HEIGHT 480 - - -/*----------------------------------------------------------------------------*/ -/** - * \page samv7_Xplained_ultra_mem "SAM V71 Xplained Ultra - Memories" - * This page lists definitions related to internal & external on-board memories. - * \section SDRAM - * - \ref PIN_SDRAM_D0_7 - * - \ref PIN_SDRAM_D8_13 - * - \ref PIN_SDRAM_D14_15 - * - \ref PIN_SDRAM_A0_9 - * - \ref PIN_SDRAM_SDA10 - * - \ref PIN_SDRAM_CAS - * - \ref PIN_SDRAM_RAS - * - \ref PIN_SDRAM_SDCKE - * - \ref PIN_SDRAM_SDCK - * - \ref PIN_SDRAM_SDSC - * - \ref PIN_SDRAM_NBS0 - * - \ref PIN_SDRAM_NBS1 - * - \ref PIN_SDRAM_SDWE - * - \ref PIN_SDRAM_BA0 - * - * \section SDMMC - * - \ref BOARD_MCI_PIN_CD - * - \ref BOARD_MCI_PIN_CK - * - \ref BOARD_MCI_PINS_SLOTA - * - \ref BOARD_SD_PINS - * - * \section QSPI - * - \ref PINS_QSPI_IO - * - \ref PINS_QSPI_IO3 - * - \ref PINS_QSPI - */ - -/** List of all SDRAM pin definitions. */ -#define BOARD_SDRAM_SIZE (2*1024*1024) -#define PIN_SDRAM_D0_7 {0x000000FF, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_DEFAULT} -#define PIN_SDRAM_D8_13 {0x0000003F, PIOE, ID_PIOE, PIO_PERIPH_A, PIO_DEFAULT} -#define PIN_SDRAM_D14_15 {0x00018000, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT} -#define PIN_SDRAM_A0_9 {0x3FF00000, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_DEFAULT} -#define PIN_SDRAM_SDA10 {0x00002000, PIOD, ID_PIOD, PIO_PERIPH_C, PIO_DEFAULT} - -#define PIN_SDRAM_CAS {0x00020000, PIOD, ID_PIOD, PIO_PERIPH_C, PIO_DEFAULT} -#define PIN_SDRAM_RAS {0x00010000, PIOD, ID_PIOD, PIO_PERIPH_C, PIO_DEFAULT} -#define PIN_SDRAM_SDCKE {0x00004000, PIOD, ID_PIOD, PIO_PERIPH_C, PIO_DEFAULT} -#define PIN_SDRAM_SDCK {0x00800000, PIOD, ID_PIOD, PIO_PERIPH_C, PIO_DEFAULT} -#define PIN_SDRAM_SDSC {0x00008000, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_DEFAULT} -#define PIN_SDRAM_NBS0 {0x00040000, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_DEFAULT} -#define PIN_SDRAM_NBS1 {0x00008000, PIOD, ID_PIOD, PIO_PERIPH_C, PIO_DEFAULT} -#define PIN_SDRAM_SDWE {0x20000000, PIOD, ID_PIOD, PIO_PERIPH_C, PIO_DEFAULT} -#define PIN_SDRAM_BA0 {0x00100000, PIOA, ID_PIOA, PIO_PERIPH_C, PIO_DEFAULT} - -#define BOARD_SDRAM_PINS PIN_SDRAM_D0_7, PIN_SDRAM_D8_13 , PIN_SDRAM_D14_15,\ - PIN_SDRAM_A0_9, PIN_SDRAM_SDA10, PIN_SDRAM_BA0, \ - PIN_SDRAM_CAS, PIN_SDRAM_RAS, PIN_SDRAM_SDCKE,PIN_SDRAM_SDCK,\ - PIN_SDRAM_SDSC,PIN_SDRAM_NBS0 ,PIN_SDRAM_NBS1,PIN_SDRAM_SDWE - - -/** List of all MCI pin definitions. */ - -/** MCI0 Card detect pin definition. (PE5) */ -#define BOARD_MCI_PIN_CD {PIO_PD18, PIOD, ID_PIOD, PIO_INPUT, PIO_PULLUP} -/** MCI0 Clock . */ -#define BOARD_MCI_PIN_CK {PIO_PA25D_MCCK, PIOA, ID_PIOA, PIO_PERIPH_D, PIO_DEFAULT} - -/** MCI0 Solt A IO pins definition. (PC4-PC13) */ -#define BOARD_MCI_PINS_SLOTA \ - {(PIO_PA30C_MCDA0 | PIO_PA31C_MCDA1 | PIO_PA26C_MCDA2 | PIO_PA27C_MCDA3 | PIO_PA28C_MCCDA),\ - PIOA, ID_PIOA, PIO_PERIPH_C, PIO_DEFAULT} - -/** MCI pins that shall be configured to access the SD card. */ -#define BOARD_SD_PINS {BOARD_MCI_PINS_SLOTA, BOARD_MCI_PIN_CK} -/** MCI Card Detect pin. */ -#define BOARD_SD_PIN_CD BOARD_MCI_PIN_CD - /** Total number of MCI interface */ -#define BOARD_NUM_MCI 1 - -/** List of all SQPI pin definitions. */ -#define PINS_QSPI_IO \ - {(PIO_PA11A_QCS | PIO_PA13A_QIO0 | PIO_PA12A_QIO1 | PIO_PA17A_QIO2 | PIO_PA14A_QSCK),\ - PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT} -#define PINS_QSPI_IO3 {PIO_PD31A_QIO3, PIOD, ID_PIOD, PIO_PERIPH_A, PIO_DEFAULT} -#define PINS_QSPI {PINS_QSPI_IO, PINS_QSPI_IO3} - -/*----------------------------------------------------------------------------*/ -/** - * \page samv7_Xplained_ultra_chipdef "SAM V71 Xplained Ultra - Individual chip definition" - * This page lists the definitions related to different chip's definition - * - * \section USART - * - \ref BOARD_PIN_USART_RXD - * - \ref BOARD_PIN_USART_TXD - * - \ref BOARD_PIN_USART_CTS - * - \ref BOARD_PIN_USART_RTS - * - \ref BOARD_PIN_USART_EN - * - \ref BOARD_USART_BASE - * - \ref BOARD_ID_USART - */ - -/** Rtc */ -#define BOARD_RTC_ID ID_RTC - -/** TWI ID for QTouch application to use */ -#define BOARD_ID_TWI_AT42 ID_TWI0 -/** TWI Base for QTouch application to use */ -#define BOARD_BASE_TWI_AT42 TWI0 -/** TWI pins for QTouch application to use */ -#define BOARD_PINS_TWI_AT42 PINS_TWI0 - -/** USART RX pin for application */ -#define BOARD_PIN_USART_RXD PIN_USART1_RXD -/** USART TX pin for application */ -#define BOARD_PIN_USART_TXD PIN_USART1_TXD -/** USART CTS pin for application */ -#define BOARD_PIN_USART_CTS PIN_USART1_CTS -/** USART RTS pin for application */ -#define BOARD_PIN_USART_RTS PIN_USART1_RTS -/** USART ENABLE pin for application */ -#define BOARD_PIN_USART_EN PIN_USART1_EN -/** USART Base for application */ -#define BOARD_USART_BASE USART1 -/** USART ID for application */ -#define BOARD_ID_USART ID_USART1 - - - -/*----------------------------------------------------------------------------*/ - /* - * USB pins - */ -#define PINS_VBUS_EN {PIO_PC16, PIOC, ID_PIOC, PIO_OUTPUT_1, PIO_DEFAULT} -#endif /* #ifndef _BOARD_H_ */ - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/bmp.h b/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/bmp.h deleted file mode 100644 index 19659115..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/bmp.h +++ /dev/null @@ -1,119 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * \section Purpose - * - * Utility for BMP - * - */ - -#ifndef BMP_H -#define BMP_H - -/** BMP magic number ('BM'). */ -#define BMP_TYPE 0x4D42 - -/** headerSize must be set to 40 */ -#define BITMAPINFOHEADER 40 - -/*------------------------------------------------------------------------------ - * Exported types - *------------------------------------------------------------------------------*/ - -#pragma pack( 1 ) - -/** BMP (Windows) Header Format */ -typedef struct _BMPHeader{ - /* signature, must be 4D42 hex */ - uint16_t type; - /* size of BMP file in bytes (unreliable) */ - uint32_t fileSize; - /* reserved, must be zero */ - uint16_t reserved1; - /* reserved, must be zero */ - uint16_t reserved2; - /* offset to start of image data in bytes */ - uint32_t offset; - /* size of BITMAPINFOHEADER structure, must be 40 */ - uint32_t headerSize; - /* image width in pixels */ - uint32_t width; - /* image height in pixels */ - uint32_t height; - /* number of planes in the image, must be 1 */ - uint16_t planes; - /* number of bits per pixel (1, 4, 8, 16, 24, 32) */ - uint16_t bits; - /* compression type (0=none, 1=RLE-8, 2=RLE-4) */ - uint32_t compression; - /* size of image data in bytes (including padding) */ - uint32_t imageSize; - /* horizontal resolution in pixels per meter (unreliable) */ - uint32_t xresolution; - /* vertical resolution in pixels per meter (unreliable) */ - uint32_t yresolution; - /* number of colors in image, or zero */ - uint32_t ncolours; - /* number of important colors, or zero */ - uint32_t importantcolours; - } BMPHeader; - -#pragma pack() - -/*------------------------------------------------------------------------------ - * Exported functions - *------------------------------------------------------------------------------*/ -extern uint8_t BMP_IsValid(void *file); -extern uint32_t BMP_GetFileSize(void *file); - -extern uint8_t BMP_Decode( - void *file, - uint8_t *buffer, - uint32_t width, - uint32_t height, - uint8_t bpp ); - -extern void WriteBMPheader( - uint32_t *pAddressHeader, - uint32_t bmpHSize, - uint32_t bmpVSize, - uint8_t nbByte_Pixels ); - -extern void BMP_displayHeader(uint32_t* pAddressHeader); -extern void RGB565toBGR555( - uint8_t *fileSource, - uint8_t *fileDestination, - uint32_t width, - uint32_t height, - uint8_t bpp ); - -#endif //#ifndef BMP_H - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/board_lowlevel.h b/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/board_lowlevel.h deleted file mode 100644 index 836b3696..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/board_lowlevel.h +++ /dev/null @@ -1,47 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2012, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * Interface for the low-level initialization function. - * - */ - -#ifndef BOARD_LOWLEVEL_H -#define BOARD_LOWLEVEL_H - -/*---------------------------------------------------------------------------- - * Exported functions - *----------------------------------------------------------------------------*/ -extern void LowLevelInit( void ); -extern void _SetupMemoryRegion( void ); - -#endif /* BOARD_LOWLEVEL_H */ - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/board_memories.h b/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/board_memories.h deleted file mode 100644 index 04260ab4..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/board_memories.h +++ /dev/null @@ -1,48 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2012, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * Interface for memories configuration on board. - * - */ - -#ifndef BOARD_MEMORIES_H -#define BOARD_MEMORIES_H - -/*---------------------------------------------------------------------------- - * Exported functions - *----------------------------------------------------------------------------*/ - -extern void BOARD_ConfigureSdram( void ); -extern uint32_t BOARD_SdramValidation(uint32_t baseAddr, uint32_t size); - -#endif /* #ifndef BOARD_MEMORIES_H */ - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/cs2100.h b/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/cs2100.h deleted file mode 100644 index 6baf57ae..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/cs2100.h +++ /dev/null @@ -1,93 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2012, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * Implementation WM8904 driver. - * - */ - -#ifndef CS2100_H -#define CS2100_H - -#include "board.h" - -/*---------------------------------------------------------------------------- - * Definitions - *----------------------------------------------------------------------------*/ - -#define CS2100_SLAVE_ADDRESS 0x4E - -/** ID and Rev register*/ -#define CS2100_REG_ID 0x01 - -/** VMID control 0 register*/ -#define CS2100_REG_CTRL 0x02 - -/** MIC Bias control 0 register*/ -#define CS2100_REG_DEV_CFG1 0x03 - -/** Bias control 1 register*/ -#define CS2100_REG_CFG 0x05 - -/** Power management control 0 register*/ -#define CS2100_REG_32_BIT_RATIO_1 0x06 -/** Power management control 0 register*/ -#define CS2100_REG_32_BIT_RATIO_2 0x07 -/** Power management control 0 register*/ -#define CS2100_REG_32_BIT_RATIO_3 0x08 -/** Power management control 0 register*/ -#define CS2100_REG_32_BIT_RATIO_4 0x09 -/** Power management control 2 register*/ -#define CS2100_REG_FUNC_CFG1 0x16 -/** Power management control 3 register*/ -#define CS2100_REG_FUNC_CFG2 0x17 -/** Power management control 3 register*/ -#define CS2100_REG_FUNC_CFG3 0x1E - -/*---------------------------------------------------------------------------- - * Exported functions - *----------------------------------------------------------------------------*/ - -extern uint16_t CS2100_Read( - Twid *pTwid, - uint32_t device, - uint32_t regAddr); - -extern void CS2100_Write( - Twid *pTwid, - uint32_t device, - uint32_t regAddr, - uint16_t data); - -extern uint8_t CS2100_Init(Twid *pTwid, uint32_t device, uint32_t PCK); -#endif // CS2100_H - - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/dbg_console.h b/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/dbg_console.h deleted file mode 100644 index af6e651b..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/dbg_console.h +++ /dev/null @@ -1,53 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2012, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * Include function prototype for the UART console. - */ - -#ifndef _DBG_CONSOLE_ -#define _DBG_CONSOLE_ - -#include - -extern void DBG_Configure( uint32_t dwBaudrate, uint32_t dwMasterClock ) ; -extern void DBG_PutChar( uint8_t uc ) ; -extern uint32_t DBG_GetChar( void ) ; -extern uint32_t DBG_IsRxReady( void ) ; - - -extern void DBG_DumpFrame( uint8_t* pucFrame, uint32_t dwSize ) ; -extern void DBG_DumpMemory( uint8_t* pucBuffer, uint32_t dwSize, uint32_t dwAddress ) ; -extern uint32_t DBG_GetInteger( int32_t* pdwValue ) ; -extern uint32_t DBG_GetIntegerMinMax( int32_t* pdwValue, int32_t dwMin, int32_t dwMax ) ; -extern uint32_t DBG_GetHexa32( uint32_t* pdwValue ) ; - -#endif /* _DBG_CONSOLE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/frame_buffer.h b/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/frame_buffer.h deleted file mode 100644 index 7afe0488..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/frame_buffer.h +++ /dev/null @@ -1,83 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * Interface of frame buffer driver. - * - */ - -#ifndef _FRAME_BUFFER_ -#define _FRAME_BUFFER_ - -/*---------------------------------------------------------------------------- - * Exported functions - *----------------------------------------------------------------------------*/ - -extern void FB_SetFrameBuffer( - LcdColor_t *pBuffer, - uint8_t ucWidth, - uint8_t ucHeight); - -extern void FB_SetColor(uint32_t color); - -extern uint32_t FB_DrawLine ( - uint32_t dwX1, - uint32_t dwY1, - uint32_t dwX2, - uint32_t dwY2 ); - -extern uint32_t FB_DrawPixel( uint32_t x, uint32_t y ); -extern uint32_t FB_DrawCircle( uint32_t x, uint32_t y, uint32_t r ); -extern uint32_t FB_DrawFilledCircle( - uint32_t dwX, - uint32_t dwY, - uint32_t dwRadius); - -extern uint32_t FB_DrawRectangle( - uint32_t dwX1, - uint32_t dwY1, - uint32_t dwX2, - uint32_t dwY2 ); - -extern uint32_t FB_DrawFilledRectangle( - uint32_t dwX1, - uint32_t dwY1, - uint32_t dwX2, - uint32_t dwY2 ); - -extern uint32_t FB_DrawPicture( - uint32_t dwX1, - uint32_t dwY1, - uint32_t dwX2, - uint32_t dwY2, - const void *pBuffer ); - -#endif /* #ifndef _FRAME_BUFFER_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/gmacb_phy.h b/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/gmacb_phy.h deleted file mode 100644 index 568cc55a..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/gmacb_phy.h +++ /dev/null @@ -1,114 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2012, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** \file */ - -/** \addtogroup gmacb_module Ethernet GMACB Driver - *@{ - * Implement GEMAC PHY driver, that initialize the PHY to prepare for - * Ethernet transfer. - * - * \section Usage - * -# EMAC related pins and Driver should be initialized at first. - * -# Initialize GMACB Driver instance by invoking GMACB_Init(). - * -# Initialize PHY connected via GMACB_InitPhy(), PHY address is - * automatically adjusted by attempt to read. - * -# Perform PHY auto negotiate through GMACB_AutoNegotiate(), so - * connection established. - * - * - * Related files:\n - * \ref gmacb.h\n - * \ref gmacb.c\n - * \ref gmii.h.\n - * - */ -/**@}*/ - -#ifndef _GMACB_PHY_H -#define _GMACB_PHY_H - - -/*--------------------------------------------------------------------------- - * Headers - *---------------------------------------------------------------------------*/ - -#include "board.h" - -/*--------------------------------------------------------------------------- - * Definitions - *---------------------------------------------------------------------------*/ - -/** The reset length setting for external reset configuration */ -#define GMACB_RESET_LENGTH 0xD - -/*--------------------------------------------------------------------------- - * Types - *---------------------------------------------------------------------------*/ - - -/** The DM9161 instance */ -typedef struct _GMacb { - /**< Driver */ - sGmacd *pGmacd; - /** The retry & timeout settings */ - uint32_t retryMax; - /** PHY address ( pre-defined by pins on reset ) */ - uint8_t phyAddress; - } GMacb; - -/*--------------------------------------------------------------------------- - * Exported functions - *---------------------------------------------------------------------------*/ -extern void GMACB_SetupTimeout(GMacb *pMacb, uint32_t toMax); - -extern void GMACB_Init(GMacb *pMacb, sGmacd *pGmacd, uint8_t phyAddress); - -extern uint8_t GMACB_InitPhy( - GMacb *pMacb, - uint32_t mck, - const Pin *pResetPins, - uint32_t nbResetPins, - const Pin *pEmacPins, - uint32_t nbEmacPins); - -extern uint8_t GMACB_AutoNegotiate(GMacb *pMacb); - -extern uint8_t GMACB_GetLinkSpeed(GMacb *pMacb, uint8_t applySettings); - -extern uint8_t GMACB_Send(GMacb *pMacb, void *pBuffer, uint32_t size); - -extern uint32_t GMACB_Poll(GMacb *pMacb, uint8_t *pBuffer, uint32_t size); - -extern void GMACB_DumpRegisters(GMacb *pMacb); - -extern uint8_t GMACB_ResetPhy(GMacb *pMacb); - -#endif // #ifndef _GMACB_H - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/gmii.h b/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/gmii.h deleted file mode 100644 index bb1a667d..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/gmii.h +++ /dev/null @@ -1,116 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -#ifndef _GMII_DEFINE_H -#define _GMII_DEFINE_H - - -/*--------------------------------------------------------------------------- - * Definitions - *---------------------------------------------------------------------------*/ - -//IEEE defined Registers -#define GMII_BMCR 0x0 // Basic Mode Control Register -#define GMII_BMSR 0x1 // Basic Mode Status Register -#define GMII_PHYID1R 0x2 // PHY Identifier Register 1 -#define GMII_PHYID2R 0x3 // PHY Identifier Register 2 -#define GMII_ANAR 0x4 // Auto_Negotiation Advertisement Register -#define GMII_ANLPAR 0x5 // Auto_negotiation Link Partner Ability Register -#define GMII_ANER 0x6 // Auto-negotiation Expansion Register -#define GMII_ANNPR 0x7 // Auto-negotiation Next Page Register -#define GMII_ANLPNPAR 0x8 // Auto_negotiation Link Partner Next Page Ability Register -#define GMII_AFEC0R 0x11 // AFE Control 0 Register -#define GMII_AFEC3R 0x14 // AFE Control 3 Register -#define GMII_RXERCR 0x15 // RXER Counter Register -#define GMII_OMSSR 0x17 // Operation Mode Strap Status Register -#define GMII_ECR 0x18 // Expanded Control Register -#define GMII_ICSR 0x1B // Interrupt Control/Status Register -#define GMII_FC 0x1C // Function Control -#define GMII_LCSR 0x1D // LinkMD® Control/Status Register -#define GMII_PC1R 0x1E // PHY Control 1 Register -#define GMII_PC2R 0x1F // PHY Control 2 Register - -// PHY ID Identifier Register -#define GMII_LSB_MASK 0x0U -// definitions: MII_PHYID1 -#define GMII_OUI_MSB 0x0022 -// definitions: MII_PHYID2 -#define GMII_OUI_LSB 0x1572 // KSZ8061 PHY Id2 - -// Basic Mode Control Register (BMCR) -// Bit definitions: MII_BMCR -#define GMII_RESET (1 << 15) // 1= Software Reset; 0=Normal Operation -#define GMII_LOOPBACK (1 << 14) // 1=loopback Enabled; 0=Normal Operation -#define GMII_SPEED_SELECT_LSB (1 << 13) // 1,0=1000Mbps 0,1=100Mbps; 0,0=10Mbps -#define GMII_AUTONEG (1 << 12) // Auto-negotiation Enable -#define GMII_POWER_DOWN (1 << 11) // 1=Power down 0=Normal operation -#define GMII_ISOLATE (1 << 10) // 1 = Isolates 0 = Normal operation -#define GMII_RESTART_AUTONEG (1 << 9) // 1 = Restart auto-negotiation 0 = Normal operation -#define GMII_DUPLEX_MODE (1 << 8) // 1 = Full duplex operation 0 = Normal operation -// Reserved 7 // Read as 0, ignore on write -#define GMII_SPEED_SELECT_MSB (1 << 6) // -// Reserved 5 to 0 // Read as 0, ignore on write - - -// Basic Mode Status Register (BMSR) -// Bit definitions: MII_BMSR -#define GMII_100BASE_T4 (1 << 15) // 100BASE-T4 Capable -#define GMII_100BASE_TX_FD (1 << 14) // 100BASE-TX Full Duplex Capable -#define GMII_100BASE_T4_HD (1 << 13) // 100BASE-TX Half Duplex Capable -#define GMII_10BASE_T_FD (1 << 12) // 10BASE-T Full Duplex Capable -#define GMII_10BASE_T_HD (1 << 11) // 10BASE-T Half Duplex Capable -// Reserved 10 to 9 // Read as 0, ignore on write -#define GMII_EXTEND_STATUS (1 << 8) // 1 = Extend Status Information In Reg 15 -// Reserved 7 -#define GMII_MF_PREAMB_SUPPR (1 << 6) // MII Frame Preamble Suppression -#define GMII_AUTONEG_COMP (1 << 5) // Auto-negotiation Complete -#define GMII_REMOTE_FAULT (1 << 4) // Remote Fault -#define GMII_AUTONEG_ABILITY (1 << 3) // Auto Configuration Ability -#define GMII_LINK_STATUS (1 << 2) // Link Status -#define GMII_JABBER_DETECT (1 << 1) // Jabber Detect -#define GMII_EXTEND_CAPAB (1 << 0) // Extended Capability - -// Auto-negotiation Advertisement Register (ANAR) -// Auto-negotiation Link Partner Ability Register (ANLPAR) -// Bit definitions: MII_ANAR, MII_ANLPAR -#define GMII_NP (1 << 15) // Next page Indication -// Reserved 7 -#define GMII_RF (1 << 13) // Remote Fault -// Reserved 12 // Write as 0, ignore on read -#define GMII_PAUSE_MASK (3 << 11) // 0,0 = No Pause 1,0 = Asymmetric Pause(link partner) - // 0,1 = Symmetric Pause 1,1 = Symmetric&Asymmetric Pause(local device) -#define GMII_T4 (1 << 9) // 100BASE-T4 Support -#define GMII_TX_FDX (1 << 8) // 100BASE-TX Full Duplex Support -#define GMII_TX_HDX (1 << 7) // 100BASE-TX Support -#define GMII_10_FDX (1 << 6) // 10BASE-T Full Duplex Support -#define GMII_10_HDX (1 << 5) // 10BASE-T Support -// Selector 4 to 0 // Protocol Selection Bits -#define GMII_AN_IEEE_802_3 0x00001 - -#endif // #ifndef _MII_DEFINE_H diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/ili9488.h b/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/ili9488.h deleted file mode 100644 index 581c5129..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/ili9488.h +++ /dev/null @@ -1,107 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2014, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * Interface of ILI9488 driver. - * - */ - -#ifndef _ILI9488_H_ -#define _ILI9488_H_ - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ - -#include "board.h" - -#include - - -/*---------------------------------------------------------------------------- - * Definitions - *----------------------------------------------------------------------------*/ - -#define ILI9488_SPIMODE 0 -#define ILI9488_EBIMODE 1 - -/* ILI9325 ID code */ -#define ILI9488_DEVICE_CODE 0x9488 - -#define ILI9488_LCD_WIDTH 320 -#define ILI9488_LCD_HEIGHT 480 -#define ILI9488_SELF_TEST_OK 0xC0 - -/* EBI chip select for LCD */ -#define SMC_EBI_LCD_CS 3 - -/*---------------------------------------------------------------------------- - * Types - *----------------------------------------------------------------------------*/ -typedef enum{ - AccessInst = 0, - AccessRead, - AccessWrite -}AccessIli_t; - -typedef union _union_type -{ - uint32_t value; - struct{ - uint8_t byte_8; - uint8_t byte_l6; - uint8_t byte_24; - uint8_t byte_32; - }byte; - struct{ - uint16_t half_word_l; - uint16_t half_word_h; - }half_word; - }union_type; -typedef volatile uint8_t REG8; - -typedef uint32_t LcdColor_t; - -/*---------------------------------------------------------------------------- - * Marcos - *----------------------------------------------------------------------------*/ -/* Pixel cache used to speed up communication */ -#define LCD_DATA_CACHE_SIZE BOARD_LCD_WIDTH - -/*---------------------------------------------------------------------------- - * Function Marcos - *----------------------------------------------------------------------------*/ -#define get_0b_to_8b(x) (((union_type*)&(x))->byte.byte_8) -#define get_8b_to_16b(x) (((union_type*)&(x))->byte.byte_l6) -#define get_16b_to_24b(x) (((union_type*)&(x))->byte.byte_24) -#define get_24b_to_32b(x) (((union_type*)&(x))->byte.byte_32) - -#endif /* #ifndef ILI9488 */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/ili9488_dma.h b/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/ili9488_dma.h deleted file mode 100644 index 5c91539a..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/ili9488_dma.h +++ /dev/null @@ -1,94 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * Interface of ILI9488 driver. - * - */ - -#ifndef _ILI9488_DMA_H_ -#define _ILI9488_DMA_H_ - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ - -#include "board.h" -#include - -/*------------------------------------------------------------------------------ - * Definitions - *----------------------------------------------------------------------------*/ -/** An unspecified error has occurred.*/ -#define ILI9488_ERROR_DMA_ALLOCATE_CHANNEL 1 -#define ILI9488_ERROR_DMA_CONFIGURE 2 -#define ILI9488_ERROR_DMA_TRANSFER 3 -#define ILI9488_ERROR_DMA_SIZE 4 - -#define ILI9488_SPI SPI0 -#define ILI9488_SPI_ID ID_SPI0 - -/* EBI BASE ADDRESS for SMC LCD */ -#define ILI9488_BASE_ADDRESS 0x63000000 - -/*------------------------------------------------------------------------------ - * Types - *----------------------------------------------------------------------------*/ - -typedef struct _ILI9488_dma -{ - /** Pointer to DMA driver */ - sXdmad *xdmaD; - /** ili9488 Tx channel */ - uint32_t ili9488DmaTxChannel; - /** ili9488 Rx channel */ - uint32_t ili9488DmaRxChannel; - /** ili9488 Tx/Rx configure descriptor */ - sXdmadCfg xdmadRxCfg,xdmadTxCfg; - /** ili9488 dma interrupt */ - uint32_t xdmaInt; - /** Pointer to SPI Hardware registers */ - Spi* pSpiHw ; - /** SPI Id as defined in the product datasheet */ - uint8_t spiId ; -}sIli9488Dma; - -typedef struct _ILI9488_ctl -{ - /** ili9488 Command/Data mode */ - volatile uint32_t cmdOrDataFlag; - /** ili9488 Rx done */ - volatile uint32_t rxDoneFlag; - /** ili9488 Tx done */ - volatile uint32_t txDoneFlag; -}sIli9488DmaCtl; - -#endif /* #ifndef ILI9488_DMA */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/ili9488_ebi.h b/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/ili9488_ebi.h deleted file mode 100644 index 6539751e..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/ili9488_ebi.h +++ /dev/null @@ -1,62 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2014, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * Interface of ILI9488 driver. - * - */ - -#ifndef _ILI9488_EBI_H_ -#define _ILI9488_EBI_H_ - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ - -#include "board.h" - -#include - -/*---------------------------------------------------------------------------- - * Exported functions - *----------------------------------------------------------------------------*/ -extern uint32_t ILI9488_EbiReadChipId (void); -extern uint32_t ILI9488_EbiInitialize( sXdmad * dmad ); -extern void ILI9488_EbiSetPixelFormat(uint16_t format); -extern void ILI9488_EbiSetCursor(uint16_t x, uint16_t y); -extern void ILI9488_EbiSetWindow( - uint16_t dwX, uint16_t dwY, uint16_t dwWidth, uint16_t dwHeight ); -extern void ILI9488_EbiSetFullWindow(void); -extern void ILI9488_EbiOn(void ); -extern void ILI9488_EbiOff(void ); -extern void ILI9488_EbiSetDisplayLandscape( uint8_t dwRGB, uint8_t LandscaprMode ); - -#endif /* #ifndef ILI9488_EBI */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/ili9488_ebi_dma.h b/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/ili9488_ebi_dma.h deleted file mode 100644 index efe45e8c..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/ili9488_ebi_dma.h +++ /dev/null @@ -1,55 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * Interface of ILI9488 driver. - * - */ - -#ifndef _ILI9488_EBI_DMA_H_ -#define _ILI9488_EBI_DMA_H_ - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ - -#include "board.h" -#include - -/*---------------------------------------------------------------------------- - * Exported functions - *----------------------------------------------------------------------------*/ -extern uint8_t ILI9488_EbiInitializeWithDma(sXdmad * dmad); -extern uint8_t ILI9488_EbiDmaTxTransfer( uint16_t *pTxBuffer, uint32_t wTxSize); -extern uint8_t ILI9488_EbiDmaRxTransfer( uint32_t *pRxBuffer,uint32_t wRxSize); -extern uint8_t ILI9488_EbiSendCommand(uint16_t Instr, uint16_t *pTxData, - uint32_t *pRxData, AccessIli_t ReadWrite, uint32_t size); -#endif /* #ifndef ILI9488_EBI_DMA */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/ili9488_reg.h b/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/ili9488_reg.h deleted file mode 100644 index 523ed4b0..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/ili9488_reg.h +++ /dev/null @@ -1,131 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -#ifndef ILI9488_REG_H_INCLUDED -#define ILI9488_REG_H_INCLUDED - -/* Level 1 Commands (from the display Datasheet) */ -#define ILI9488_CMD_NOP 0x00 -#define ILI9488_CMD_SOFTWARE_RESET 0x01 -#define ILI9488_CMD_READ_DISP_ID 0x04 -#define ILI9488_CMD_READ_ERROR_DSI 0x05 -#define ILI9488_CMD_READ_DISP_STATUS 0x09 -#define ILI9488_CMD_READ_DISP_POWER_MODE 0x0A -#define ILI9488_CMD_READ_DISP_MADCTRL 0x0B -#define ILI9488_CMD_READ_DISP_PIXEL_FORMAT 0x0C -#define ILI9488_CMD_READ_DISP_IMAGE_MODE 0x0D -#define ILI9488_CMD_READ_DISP_SIGNAL_MODE 0x0E -#define ILI9488_CMD_READ_DISP_SELF_DIAGNOSTIC 0x0F -#define ILI9488_CMD_ENTER_SLEEP_MODE 0x10 -#define ILI9488_CMD_SLEEP_OUT 0x11 -#define ILI9488_CMD_PARTIAL_MODE_ON 0x12 -#define ILI9488_CMD_NORMAL_DISP_MODE_ON 0x13 -#define ILI9488_CMD_DISP_INVERSION_OFF 0x20 -#define ILI9488_CMD_DISP_INVERSION_ON 0x21 -#define ILI9488_CMD_PIXEL_OFF 0x22 -#define ILI9488_CMD_PIXEL_ON 0x23 -#define ILI9488_CMD_DISPLAY_OFF 0x28 -#define ILI9488_CMD_DISPLAY_ON 0x29 -#define ILI9488_CMD_COLUMN_ADDRESS_SET 0x2A -#define ILI9488_CMD_PAGE_ADDRESS_SET 0x2B -#define ILI9488_CMD_MEMORY_WRITE 0x2C -#define ILI9488_CMD_MEMORY_READ 0x2E -#define ILI9488_CMD_PARTIAL_AREA 0x30 -#define ILI9488_CMD_VERT_SCROLL_DEFINITION 0x33 -#define ILI9488_CMD_TEARING_EFFECT_LINE_OFF 0x34 -#define ILI9488_CMD_TEARING_EFFECT_LINE_ON 0x35 -#define ILI9488_CMD_MEMORY_ACCESS_CONTROL 0x36 -#define ILI9488_CMD_VERT_SCROLL_START_ADDRESS 0x37 -#define ILI9488_CMD_IDLE_MODE_OFF 0x38 -#define ILI9488_CMD_IDLE_MODE_ON 0x39 -#define ILI9488_CMD_COLMOD_PIXEL_FORMAT_SET 0x3A -#define ILI9488_CMD_WRITE_MEMORY_CONTINUE 0x3C -#define ILI9488_CMD_READ_MEMORY_CONTINUE 0x3E -#define ILI9488_CMD_SET_TEAR_SCANLINE 0x44 -#define ILI9488_CMD_GET_SCANLINE 0x45 -#define ILI9488_CMD_WRITE_DISPLAY_BRIGHTNESS 0x51 -#define ILI9488_CMD_READ_DISPLAY_BRIGHTNESS 0x52 -#define ILI9488_CMD_WRITE_CTRL_DISPLAY 0x53 -#define ILI9488_CMD_READ_CTRL_DISPLAY 0x54 -#define ILI9488_CMD_WRITE_CONTENT_ADAPT_BRIGHTNESS 0x55 -#define ILI9488_CMD_READ_CONTENT_ADAPT_BRIGHTNESS 0x56 -#define ILI9488_CMD_WRITE_MIN_CAB_LEVEL 0x5E -#define ILI9488_CMD_READ_MIN_CAB_LEVEL 0x5F -#define ILI9488_CMD_READ_ABC_SELF_DIAG_RES 0x68 -#define ILI9488_CMD_READ_ID1 0xDA -#define ILI9488_CMD_READ_ID2 0xDB -#define ILI9488_CMD_READ_ID3 0xDC - -/* Level 2 Commands (from the display Datasheet) */ -#define ILI9488_CMD_INTERFACE_MODE_CONTROL 0xB0 -#define ILI9488_CMD_FRAME_RATE_CONTROL_NORMAL 0xB1 -#define ILI9488_CMD_FRAME_RATE_CONTROL_IDLE_8COLOR 0xB2 -#define ILI9488_CMD_FRAME_RATE_CONTROL_PARTIAL 0xB3 -#define ILI9488_CMD_DISPLAY_INVERSION_CONTROL 0xB4 -#define ILI9488_CMD_BLANKING_PORCH_CONTROL 0xB5 -#define ILI9488_CMD_DISPLAY_FUNCTION_CONTROL 0xB6 -#define ILI9488_CMD_ENTRY_MODE_SET 0xB7 -#define ILI9488_CMD_BACKLIGHT_CONTROL_1 0xB9 -#define ILI9488_CMD_BACKLIGHT_CONTROL_2 0xBA -#define ILI9488_CMD_HS_LANES_CONTROL 0xBE -#define ILI9488_CMD_POWER_CONTROL_1 0xC0 -#define ILI9488_CMD_POWER_CONTROL_2 0xC1 -#define ILI9488_CMD_POWER_CONTROL_NORMAL_3 0xC2 -#define ILI9488_CMD_POWER_CONTROL_IDEL_4 0xC3 -#define ILI9488_CMD_POWER_CONTROL_PARTIAL_5 0xC4 -#define ILI9488_CMD_VCOM_CONTROL_1 0xC5 -#define ILI9488_CMD_CABC_CONTROL_1 0xC6 -#define ILI9488_CMD_CABC_CONTROL_2 0xC8 -#define ILI9488_CMD_CABC_CONTROL_3 0xC9 -#define ILI9488_CMD_CABC_CONTROL_4 0xCA -#define ILI9488_CMD_CABC_CONTROL_5 0xCB -#define ILI9488_CMD_CABC_CONTROL_6 0xCC -#define ILI9488_CMD_CABC_CONTROL_7 0xCD -#define ILI9488_CMD_CABC_CONTROL_8 0xCE -#define ILI9488_CMD_CABC_CONTROL_9 0xCF -#define ILI9488_CMD_NVMEM_WRITE 0xD0 -#define ILI9488_CMD_NVMEM_PROTECTION_KEY 0xD1 -#define ILI9488_CMD_NVMEM_STATUS_READ 0xD2 -#define ILI9488_CMD_READ_ID4 0xD3 -#define ILI9488_CMD_ADJUST_CONTROL_1 0xD7 -#define ILI9488_CMD_READ_ID_VERSION 0xD8 -#define ILI9488_CMD_POSITIVE_GAMMA_CORRECTION 0xE0 -#define ILI9488_CMD_NEGATIVE_GAMMA_CORRECTION 0xE1 -#define ILI9488_CMD_DIGITAL_GAMMA_CONTROL_1 0xE2 -#define ILI9488_CMD_DIGITAL_GAMMA_CONTROL_2 0xE3 -#define ILI9488_CMD_SET_IMAGE_FUNCTION 0xE9 -#define ILI9488_CMD_ADJUST_CONTROL_2 0xF2 -#define ILI9488_CMD_ADJUST_CONTROL_3 0xF7 -#define ILI9488_CMD_ADJUST_CONTROL_4 0xF8 -#define ILI9488_CMD_ADJUST_CONTROL_5 0xF9 -#define ILI9488_CMD_SPI_READ_SETTINGS 0xFB -#define ILI9488_CMD_ADJUST_CONTROL_6 0xFC -#define ILI9488_CMD_ADJUST_CONTROL_7 0xFF - -#endif /* ILI9488_REGS_H_INCLUDED */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/ili9488_spi.h b/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/ili9488_spi.h deleted file mode 100644 index 3f9ed815..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/ili9488_spi.h +++ /dev/null @@ -1,69 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2014, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * Interface of ILI9488 driver. - * - */ - -#ifndef _ILI9488_SPI_H_ -#define _ILI9488_SPI_H_ - -/*------------------------------------------------------------------------------ - * Headers - *----------------------------------------------------------------------------*/ - -#include "board.h" - -/*------------------------------------------------------------------------------ - * Exported functions - *----------------------------------------------------------------------------*/ -extern uint32_t ILI9488_SpiReadChipId (void); -extern uint32_t ILI9488_SpiInitialize( sXdmad * dmad ); -extern void ILI9488_SpiSetPixelFormat(uint8_t format); -extern void ILI9488_SpiNop(void); -extern void ILI9488_SpiWriteMemory(const uint8_t *pBuf, uint32_t size); -extern void ILI9488_SpiReadMemory( const uint8_t *pBuf, uint32_t size); -extern void ILI9488_SpiSetCursor(uint16_t x, uint16_t y); -extern void ILI9488_SpiSetWindow( - uint16_t dwX, - uint16_t dwY, - uint16_t dwWidth, - uint16_t dwHeight ); - -extern void ILI9488_SpiSetFullWindow(void); -extern void ILI9488_SpiOn(void ); -extern void ILI9488_SpiOff(void ); -extern void ILI9488_SpiSetDisplayLandscape( - uint8_t dwRGB, uint8_t LandscaprMode ); -extern void ILI9488_SetPixelColor(uint32_t x, uint32_t y, uint32_t color); - -#endif /* #ifndef ILI9488_SPI */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/ili9488_spi_dma.h b/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/ili9488_spi_dma.h deleted file mode 100644 index 9d37f78c..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/ili9488_spi_dma.h +++ /dev/null @@ -1,56 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * Interface of ILI9488 DMA driver. - * - */ - -#ifndef _ILI9488_SPI_DMA_H_ -#define _ILI9488_SPI_DMA_H_ - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ - -#include "board.h" -#include - -/*---------------------------------------------------------------------------- - * Exported functions - *----------------------------------------------------------------------------*/ -extern uint8_t ILI9488_SpiInitializeWithDma(sXdmad * dmad); -extern uint8_t ILI9488_SpiDmaTxTransfer( uint8_t *pTxBuffer, uint32_t wTxSize); -extern uint8_t ILI9488_SpiDmaRxTransfer( uint32_t *pRxBuffer,uint32_t wRxSize); -extern uint8_t ILI9488_SpiSendCommand(uint8_t Instr, uint8_t* pTxData, - uint32_t* pRxData, AccessIli_t ReadWrite, uint32_t size); - -#endif /* #ifndef ILI9488_SPI_DMA */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/image_sensor_inf.h b/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/image_sensor_inf.h deleted file mode 100644 index c84b5b93..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/image_sensor_inf.h +++ /dev/null @@ -1,135 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2013, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ -#include "board.h" - - -/*--------------------------------------------------------------------------- - * Definition - *---------------------------------------------------------------------------*/ -#define SENDOR_SUPPORTED_OUTPUTS 7 - -/** terminating list entry for register in configuration file */ -#define SENSOR_REG_TERM 0xFF -/** terminating list entry for value in configuration file */ -#define SENSOR_VAL_TERM 0xFF - -/*---------------------------------------------------------------------------- - * Types - *----------------------------------------------------------------------------*/ - -/** Sensor type */ -typedef enum _sensorType { - SENSOR_COMS = 0, - SENSOR_CCD -}sensorType_t; - -/** Sensor status or return code */ -typedef enum _sensorStatus { - SENSOR_OK = 0, /**< Operation is successful */ - SENSOR_TWI_ERROR, - SENSOR_ID_ERROR, - SENSOR_RESOLUTION_NOT_SUPPORTED -} sendorStatus_t; - -/** Sensor TWI mode */ -typedef enum _sensorTwiMode { - SENSOR_TWI_REG_BYTE_DATA_BYTE = 0, - SENSOR_TWI_REG_2BYTE_DATA_BYTE, - SENSOR_TWI_REG_BYTE_DATA_2BYTE -} sensorTwiMode_t; - -/** Sensor resolution */ -typedef enum _sensorResolution { - QVGA = 0, - VGA, - SVGA, - XGA, - WXGA, - UVGA -} sensorOutputResolution_t; - -/** Sensor output format */ -typedef enum _sensorOutputFormat { - RAW_BAYER_12_BIT = 0, - RAW_BAYER_10_BIT, - YUV_422_8_BIT, - YUV_422_10_BIT, - MONO_12_BIT -} sensorOutputFormat_t; - -/** define a structure for sensor register initialization values */ -typedef struct _sensor_reg { - uint16_t reg; /* Register to be written */ - uint16_t val; /* value to be written */ -}sensorReg_t; - -typedef struct _sensor_output { - uint8_t type ; /** Index 0: normal, 1: AF setting*/ - sensorOutputResolution_t output_resolution; /** sensor output resolution */ - sensorOutputFormat_t output_format; /** sensor output format */ - uint8_t supported; /** supported for current output_resolution*/ - uint32_t output_width; /** output width */ - uint32_t output_height; /** output height */ - const sensorReg_t *output_setting; /** sensor registers setting */ -}sensorOutput_t; - -/** define a structure for sensor profile */ -typedef struct _sensor_profile { - sensorType_t cmos_ccd; /** Sensor type for CMOS sensor or CCD */ - sensorTwiMode_t twi_inf_mode; /** TWI interface mode */ - uint32_t twi_slave_addr; /** TWI slave address */ - uint16_t pid_high_reg; /** Register address for product ID high byte */ - uint16_t pid_low_reg; /** Register address for product ID low byte*/ - uint16_t pid_high; /** product ID high byte */ - uint16_t pid_low; /** product ID low byte */ - uint16_t version_mask; /** version mask */ - const sensorOutput_t *outputConf[SENDOR_SUPPORTED_OUTPUTS]; /** sensor settings */ -}sensorProfile_t; - -/*---------------------------------------------------------------------------- - * Exported functions - *----------------------------------------------------------------------------*/ -extern sendorStatus_t sensor_twi_write_regs(Twid * pTwid, - const sensorReg_t * pReglist); - -extern sendorStatus_t sensor_twi_read_regs(Twid * pTwid, - const sensorReg_t * pReglist); - -extern sendorStatus_t sensor_setup(Twid * pTwid, - const sensorProfile_t *sensor_profile, - sensorOutputResolution_t resolution); - -extern sendorStatus_t sensor_get_output(sensorOutputFormat_t *format, - uint32_t *width, - uint32_t* height, - sensorOutputResolution_t resolution); diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/lcd_color.h b/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/lcd_color.h deleted file mode 100644 index 5fc21d13..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/lcd_color.h +++ /dev/null @@ -1,109 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -#ifndef COLOR_H -#define COLOR_H - -/** - * \file - * - * RGB 24-bits color table definition. - * - */ - -/* - * RGB 24 Bpp - * RGB 888 - * R7R6R5R4 R3R2R1R0 G7G6G5G4 G3G2G1G0 B7B6B5B4 B3B2B1B0 - */ - -#define COLOR_BLACK 0x000000 -#define COLOR_WHITE 0xFFFFFF - -#define COLOR_BLUE 0x0000FF -#define COLOR_GREEN 0x00FF00 -#define COLOR_RED 0xFF0000 - -#define COLOR_NAVY 0x000080 -#define COLOR_DARKBLUE 0x00008B -#define COLOR_DARKGREEN 0x006400 -#define COLOR_DARKCYAN 0x008B8B -#define COLOR_CYAN 0x00FFFF -#define COLOR_TURQUOISE 0x40E0D0 -#define COLOR_INDIGO 0x4B0082 -#define COLOR_DARKRED 0x800000 -#define COLOR_OLIVE 0x808000 -#define COLOR_GRAY 0x808080 -#define COLOR_SKYBLUE 0x87CEEB -#define COLOR_BLUEVIOLET 0x8A2BE2 -#define COLOR_LIGHTGREEN 0x90EE90 -#define COLOR_DARKVIOLET 0x9400D3 -#define COLOR_YELLOWGREEN 0x9ACD32 -#define COLOR_BROWN 0xA52A2A -#define COLOR_DARKGRAY 0xA9A9A9 -#define COLOR_SIENNA 0xA0522D -#define COLOR_LIGHTBLUE 0xADD8E6 -#define COLOR_GREENYELLOW 0xADFF2F -#define COLOR_SILVER 0xC0C0C0 -#define COLOR_LIGHTGREY 0xD3D3D3 -#define COLOR_LIGHTCYAN 0xE0FFFF -#define COLOR_VIOLET 0xEE82EE -#define COLOR_AZUR 0xF0FFFF -#define COLOR_BEIGE 0xF5F5DC -#define COLOR_MAGENTA 0xFF00FF -#define COLOR_TOMATO 0xFF6347 -#define COLOR_GOLD 0xFFD700 -#define COLOR_ORANGE 0xFFA500 -#define COLOR_SNOW 0xFFFAFA -#define COLOR_YELLOW 0xFFFF00 - -#define BLACK 0x0000 -#define BLUE 0x001F -#define RED 0xF800 -#define GREEN 0x07E0 -#define WHITE 0xFFFF - -/* level is in [0; 31]*/ -#define BLUE_LEV( level) ( (level)&BLUE ) -#define GREEN_LEV(level) ( (((level)*2)<<5)&GREEN ) -#define RED_LEV( level) ( ((level)<<(5+6))&RED ) -#define GRAY_LEV( level) ( BLUE_LEV(level) | GREEN_LEV(level) | RED_LEV(level)) - -#define RGB_24_TO_RGB565(RGB) \ - (((RGB >>19)<<11) | (((RGB & 0x00FC00) >>5)) | (RGB & 0x00001F)) -#define RGB_24_TO_18BIT(RGB) \ - (((RGB >>16)&0xFC) | (((RGB & 0x00FF00) >>10) << 10) | (RGB & 0x0000FC)<<16) -#define RGB_16_TO_18BIT(RGB) \ - (((((RGB >>11)*63)/31)<<18) | (RGB & 0x00FC00) | (((RGB & 0x00001F)*63)/31)) -#define BGR_TO_RGB_18BIT(RGB) \ - (RGB & 0xFF0000) | ((RGB & 0x00FF00) >> 8 ) | ( (RGB & 0x0000FC) >> 16 )) -#define BGR_16_TO_18BITRGB(RGB) BGR_TO_RGB_18BIT(RGB_16_TO_18BIT(RGB)) - - -#endif /* #define COLOR_H */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/lcd_draw.h b/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/lcd_draw.h deleted file mode 100644 index 21f7fa91..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/lcd_draw.h +++ /dev/null @@ -1,186 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - - /** - * \file - * - * Interface for draw function on LCD. - * - */ - -#ifndef DRAW_H -#define DRAW_H - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ -#include "board.h" -#include -#include "lcd_gimp_image.h" - -/*---------------------------------------------------------------------------- - * Definitions - *----------------------------------------------------------------------------*/ - -/** Horizontal direction line definition */ -#define DIRECTION_HLINE 0 -/** Vertical direction line definition */ -#define DIRECTION_VLINE 1 - -typedef struct _rect{ - uint32_t x; - uint32_t y; - uint32_t width; - uint32_t height; -}rect; - -COMPILER_PACK_SET(1) -typedef struct _rgb{ - uint8_t b; - uint8_t g; - uint8_t r; -}sBGR; -COMPILER_PACK_RESET() - -/*---------------------------------------------------------------------------- - * Exported functions - *----------------------------------------------------------------------------*/ -extern void LCDD_SetUpdateWindowSize(rect rc); - -extern void LCDD_UpdateWindow(void); - -extern void LCDD_UpdatePartialWindow( uint8_t* pbuf, uint32_t size); - -extern void LCDD_DrawRectangleWithFill( - uint16_t* pbuf, - uint32_t dwX, - uint32_t dwY, - uint32_t dwWidth, - uint32_t dwHeight, - uint32_t dwColor); - -extern uint32_t LCDD_DrawCircle( - uint16_t* pbuf, - uint32_t x, - uint32_t y, - uint32_t r, - uint32_t color); - -extern uint32_t LCD_DrawFilledCircle( - uint16_t* pbuf, - uint32_t dwX, - uint32_t dwY, - uint32_t dwRadius, - uint32_t color); - -extern void LCDD_DrawString( - uint16_t* pbuf, - uint32_t x, - uint32_t y, - const uint8_t *pString, - uint32_t color ); - -extern void LCDD_GetStringSize( - const uint8_t *pString, - uint32_t *pWidth, - uint32_t *pHeight ); - -extern void LCDD_BitBlt( - uint16_t* pbuf, - uint32_t dst_x, - uint32_t dst_y, - uint32_t dst_w, - uint32_t dst_h, - const LcdColor_t *src, - uint32_t src_x, - uint32_t src_y, - uint32_t src_w, - uint32_t src_h); - -extern void LCDD_BitBltAlphaBlend(uint16_t* pbuf, - uint32_t dst_x, - uint32_t dst_y, - uint32_t dst_w, - uint32_t dst_h, - const LcdColor_t *src, - uint32_t src_x, - uint32_t src_y, - uint32_t src_w, - uint32_t src_h, - uint32_t alpha); -extern void LCDD_DrawImage( - uint16_t* pbuf, - uint32_t dwX, - uint32_t dwY, - const LcdColor_t *pImage, - uint32_t dwWidth, - uint32_t dwHeight ); - -extern void LCDD_DrawPixel( - uint16_t* pbuf, - uint32_t x, - uint32_t y, - uint32_t color ); - -extern void LCDD_DrawLine( - uint16_t* pbuf, - uint32_t dwX1, - uint32_t dwY1, - uint32_t dwX2, - uint32_t dwY2, - uint32_t color); - -extern uint32_t LCDD_DrawLineBresenham( - uint16_t* pbuf, - uint32_t dwX1, - uint32_t dwY1, - uint32_t dwX2, - uint32_t dwY2, - uint32_t color); - -extern void LCDD_DrawRectangle( - uint16_t* pbuf, - uint32_t x, - uint32_t y, - uint32_t width, - uint32_t height, - uint32_t color); - -extern void LCDD_SetCavasBuffer( - void* pBuffer, - uint32_t wBufferSize); - -extern void LCDD_DrawStraightLine( - uint16_t* pbuf, - uint32_t dwX1, - uint32_t dwY1, - uint32_t dwX2, - uint32_t dwY2 , - uint32_t color ); -#endif /* #ifndef DRAW_H */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/lcd_font.h b/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/lcd_font.h deleted file mode 100644 index 4d2c4796..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/lcd_font.h +++ /dev/null @@ -1,108 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * Interface for draw font on LCD. - * - */ - -/** - * - * \section Purpose - * - * The font.h files declares a font structure and a LCDD_DrawChar function - * that must be implemented by a font definition file to be used with the - * LCDD_DrawString method of draw.h. - * - * The font10x14.c implements the necessary variable and function for a 10x14 - * font. - * - * \section Usage - * - * -# Declare a gFont global variable with the necessary Font information. - * -# Implement an LCDD_DrawChar function which displays the specified - * character on the LCD. - * -# Use the LCDD_DrawString method defined in draw.h to display a complete - * string. - */ - -#ifndef _LCD_FONT_ -#define _LCD_FONT_ - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ - -#include - -/*---------------------------------------------------------------------------- - * Types - *----------------------------------------------------------------------------*/ - - -/** \brief Describes the font (width, height, supported characters, etc.) used by - * the LCD driver draw API. - */ -typedef struct _Font { - /* Font width in pixels. */ - uint8_t width; - /* Font height in pixels. */ - uint8_t height; -} Font; - -/*---------------------------------------------------------------------------- - * Variables - *----------------------------------------------------------------------------*/ - -/** Global variable describing the font being instanced. */ -extern const Font gFont; - -/*---------------------------------------------------------------------------- - * Exported functions - *----------------------------------------------------------------------------*/ - -extern void LCDD_DrawChar( - uint16_t* pCanvasBuffer, - uint32_t x, - uint32_t y, - uint8_t c, - uint32_t color ); - -extern void LCD_DrawString( - uint16_t* pCanvasBuffer, - uint32_t dwX, - uint32_t dwY, - const uint8_t *pString, - uint32_t color ); - - -#endif /* #ifndef LCD_FONT_ */ - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/lcd_font10x14.h b/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/lcd_font10x14.h deleted file mode 100644 index 050da6f2..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/lcd_font10x14.h +++ /dev/null @@ -1,45 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - - /** - * \file - * - * Font 10x14 table definition. - * - */ - -#ifndef _LCD_FONT_10x14_ -#define _LCD_FONT_10x14_ - -#include - -/** Char set of font 10x14 */ -extern const uint8_t pCharset10x14[]; - -#endif /* #ifdef _LCD_FONT_10x14_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/lcd_gimp_image.h b/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/lcd_gimp_image.h deleted file mode 100644 index 2a975159..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/lcd_gimp_image.h +++ /dev/null @@ -1,42 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -#ifndef _GIMP_IMAGE_ -#define _GIMP_IMAGE_ - -#include - -typedef struct _SGIMPImage{ - uint32_t dwWidth; - uint32_t dwHeight; - uint32_t dwBytes_per_pixel; /* 3:RGB, 4:RGBA */ - uint8_t* pucPixel_data ; -} SGIMPImage ; - -#endif // _GIMP_IMAGE_ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/lcdd.h b/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/lcdd.h deleted file mode 100644 index 59d5e6f0..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/lcdd.h +++ /dev/null @@ -1,52 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * Interface for LCD driver. - * - */ - -#ifndef LCDD_H -#define LCDD_H - -/*---------------------------------------------------------------------------- - * Exported functions - *----------------------------------------------------------------------------*/ - -extern void LCDD_Initialize(uint8_t lcdMode, sXdmad * dmad, uint8_t cRotate); - -extern void LCDD_On(void); - -extern void LCDD_Off(void); - -extern void LCDD_SetBacklight (uint32_t step); - -#endif /* #ifndef LCDD_H */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/led.h b/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/led.h deleted file mode 100644 index 9f0b6abf..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/led.h +++ /dev/null @@ -1,72 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * \section Purpose - * - * Small set of functions for simple and portable LED usage. - * - * \section Usage - * - * -# Configure one or more LEDs using LED_Configure and - * LED_ConfigureAll. - * -# Set, clear and toggle LEDs using LED_Set, LED_Clear and - * LED_Toggle. - * - * LEDs are numbered starting from 0; the number of LEDs depend on the - * board being used. All the functions defined here will compile properly - * regardless of whether the LED is defined or not; they will simply - * return 0 when a LED which does not exist is given as an argument. - * Also, these functions take into account how each LED is connected on to - * board; thus, \ref LED_Set might change the level on the corresponding pin - * to 0 or 1, but it will always light the LED on; same thing for the other - * methods. - */ - -#ifndef _LED_ -#define _LED_ - -#include - -/*---------------------------------------------------------------------------- - * Exported functions - *----------------------------------------------------------------------------*/ - -extern uint32_t LED_Configure( uint32_t dwLed ); - -extern uint32_t LED_Set( uint32_t dwLed ); - -extern uint32_t LED_Clear( uint32_t dwLed ); - -extern uint32_t LED_Toggle( uint32_t dwLed ); - -#endif /* #ifndef LED_H */ - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/math.h b/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/math.h deleted file mode 100644 index 0bb602d7..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/math.h +++ /dev/null @@ -1,42 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2012, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -#ifndef _MATH_ -#define _MATH_ - -/*------------------------------------------------------------------------------ - * Exported functions - *------------------------------------------------------------------------------*/ - -extern uint32_t min( uint32_t dwA, uint32_t dwB ); -extern uint32_t absv( int32_t lValue ); -extern uint32_t power( uint32_t dwX, uint32_t dwY ); - -#endif /* #ifndef _MATH_ */ - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/mcan_config.h b/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/mcan_config.h deleted file mode 100644 index a40cea49..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/mcan_config.h +++ /dev/null @@ -1,126 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * \section Purpose - * - * Interface for configuring and using Timer Counter (TC) peripherals. - * - * \section Usage - * -# Optionally, use TC_FindMckDivisor() to let the program find the best - * TCCLKS field value automatically. - * -# Configure a Timer Counter in the desired mode using TC_Configure(). - * -# Start or stop the timer clock using TC_Start() and TC_Stop(). - */ - -#ifndef _MCAN_CONFIG_ -#define _MCAN_CONFIG_ - -/*------------------------------------------------------------------------------ - * Headers - *------------------------------------------------------------------------------*/ - - -/*------------------------------------------------------------------------------ - * Global functions - *------------------------------------------------------------------------------*/ - -#ifdef __cplusplus - extern "C" { -#endif - -/* Programmable Clock Source for Baud Rate is Common To Both MCAN Controllers */ -#define MCAN_PROG_CLK_PRESCALER 1 /* /1 to /256 */ -// select one of the following for the programmable clock source -//#define MCAN_PROG_CLK_SELECT PMC_PCK_CSS_SLOW_CLK -//#define MCAN_PROG_CLK_SELECT PMC_PCK_CSS_MAIN_CLK -//#define MCAN_PROG_CLK_SELECT PMC_PCK_CSS_PLLA_CLK -//#define MCAN_PROG_CLK_SELECT PMC_PCK_CSS_UPLL_CLK -#define MCAN_PROG_CLK_SELECT PMC_PCK_CSS_MCK -#define MCAN_PROG_CLK_FREQ_HZ \ - ( (float) 150000000 / (float) MCAN_PROG_CLK_PRESCALER ) - -#define MCAN0_BIT_RATE_BPS 500000 -#define MCAN0_PROP_SEG 2 -#define MCAN0_PHASE_SEG1 11 -#define MCAN0_PHASE_SEG2 11 -#define MCAN0_SYNC_JUMP 4 - -#define MCAN0_FAST_BIT_RATE_BPS 2000000 -#define MCAN0_FAST_PROP_SEG 2 -#define MCAN0_FAST_PHASE_SEG1 4 -#define MCAN0_FAST_PHASE_SEG2 4 -#define MCAN0_FAST_SYNC_JUMP 2 - -#define MCAN0_NMBR_STD_FLTS 8 /* 128 max filters */ -#define MCAN0_NMBR_EXT_FLTS 8 /* 64 max filters */ -#define MCAN0_NMBR_RX_FIFO0_ELMTS 0 /* # of elements, 64 elements max */ -#define MCAN0_NMBR_RX_FIFO1_ELMTS 0 /* # of elements, 64 elements max */ -#define MCAN0_NMBR_RX_DED_BUF_ELMTS 16 /* # of elements, 64 elements max */ -#define MCAN0_NMBR_TX_EVT_FIFO_ELMTS 0 /* # of elements, 32 elements max */ -#define MCAN0_NMBR_TX_DED_BUF_ELMTS 4 /* # of elements, 32 elements max */ -#define MCAN0_NMBR_TX_FIFO_Q_ELMTS 0 /* # of elements, 32 elements max */ -#define MCAN0_RX_FIFO0_ELMT_SZ 8 /* 8, 12, 16, 20, 24, 32, 48, 64 bytes */ -#define MCAN0_RX_FIFO1_ELMT_SZ 8 /* 8, 12, 16, 20, 24, 32, 48, 64 bytes */ -#define MCAN0_RX_BUF_ELMT_SZ 8 /* 8, 12, 16, 20, 24, 32, 48, 64 bytes */ -#define MCAN0_TX_BUF_ELMT_SZ 8 /* 8, 12, 16, 20, 24, 32, 48, 64 bytes */ - -#define MCAN1_BIT_RATE_BPS 500000 -#define MCAN1_PROP_SEG 2 -#define MCAN1_PHASE_SEG1 11 -#define MCAN1_PHASE_SEG2 11 -#define MCAN1_SYNC_JUMP 4 - -#define MCAN1_FAST_BIT_RATE_BPS 2000000 -#define MCAN1_FAST_PROP_SEG 2 -#define MCAN1_FAST_PHASE_SEG1 4 -#define MCAN1_FAST_PHASE_SEG2 4 -#define MCAN1_FAST_SYNC_JUMP 2 - -#define MCAN1_NMBR_STD_FLTS 8 /* 128 max filters */ -#define MCAN1_NMBR_EXT_FLTS 8 /* 64 max filters */ -#define MCAN1_NMBR_RX_FIFO0_ELMTS 12 /* # of elements, 64 elements max */ -#define MCAN1_NMBR_RX_FIFO1_ELMTS 0 /* # of elements, 64 elements max */ -#define MCAN1_NMBR_RX_DED_BUF_ELMTS 4 /* # of elements, 64 elements max */ -#define MCAN1_NMBR_TX_EVT_FIFO_ELMTS 0 /* # of elements, 32 elements max */ -#define MCAN1_NMBR_TX_DED_BUF_ELMTS 4 /* # of elements, 32 elements max */ -#define MCAN1_NMBR_TX_FIFO_Q_ELMTS 4 /* # of elements, 32 elements max */ -#define MCAN1_RX_FIFO0_ELMT_SZ 8 /* 8, 12, 16, 20, 24, 32, 48, 64 bytes */ -#define MCAN1_RX_FIFO1_ELMT_SZ 8 /* 8, 12, 16, 20, 24, 32, 48, 64 bytes */ -#define MCAN1_RX_BUF_ELMT_SZ 64 /* 8, 12, 16, 20, 24, 32, 48, 64 bytes */ -#define MCAN1_TX_BUF_ELMT_SZ 32 /* 8, 12, 16, 20, 24, 32, 48, 64 bytes */ - -#ifdef __cplusplus -} -#endif - -#endif /* #ifndef _MCAN_CONFIG_ */ - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/rtc_calib.h b/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/rtc_calib.h deleted file mode 100644 index 7d4e1253..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/rtc_calib.h +++ /dev/null @@ -1,49 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2014, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * Interface for Real Time Clock calibration (RTC) . - * - */ - -/** RTC crystal **/ - - -typedef struct{ - int8_t Tempr; - int16_t PPM; - uint8_t NEGPPM; - uint8_t HIGHPPM; - uint16_t CORRECTION; - }RTC_PPMLookup; - - -extern void RTC_ClockCalibration( Rtc* pRtc, int32_t CurrentTempr); diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/s25fl1.h b/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/s25fl1.h deleted file mode 100644 index 36b0590b..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/s25fl1.h +++ /dev/null @@ -1,255 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2013, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * Interface for the S25fl1 Serial Flash driver. - * - */ - -#ifndef S25FL1_H -#define S25FL1_H -#define USE_QSPI_DMA -/*---------------------------------------------------------------------------- - * Macros - *----------------------------------------------------------------------------*/ - -#define Size(pAt25) ((pAt25)->pDesc->size) -#define PageSize(pAt25) ((pAt25)->pDesc->pageSize) -#define BlockSize(pAt25) ((pAt25)->pDesc->blockSize) -#define Name(pAt25) ((pAt25)->pDesc->name) -#define ManId(pAt25) (((pAt25)->pDesc->jedecId) & 0xFF) -#define PageNumber(pAt25) (Size(pAt25) / PageSize(pAt25)) -#define BlockNumber(pAt25) (Size(pAt25) / BlockSize(pAt25)) -#define PagePerBlock(pAt25) (BlockSize(pAt25) / PageSize(pAt25)) -#define BlockEraseCmd(pAt25) ((pAt25)->pDesc->blockEraseCmd) - -/*---------------------------------------------------------------------------- - * Local definitions - *----------------------------------------------------------------------------*/ - -/** Device is protected, operation cannot be carried out. */ -#define ERROR_PROTECTED 1 -/** Device is busy executing a command. */ -#define ERROR_BUSY 2 -/** There was a problem while trying to program page data. */ -#define ERROR_PROGRAM 3 -/** There was an SPI communication error. */ -#define ERROR_SPI 4 - -/** Device ready/busy status bit. */ -#define STATUS_RDYBSY (1 << 0) -/** Device is ready. */ -#define STATUS_RDYBSY_READY (0 << 0) -/** Device is busy with internal operations. */ -#define STATUS_RDYBSY_BUSY (1 << 0) -/** Write enable latch status bit. */ -#define STATUS_WEL (1 << 1) -/** Device is not write enabled. */ -#define STATUS_WEL_DISABLED (0 << 1) -/** Device is write enabled. */ -#define STATUS_WEL_ENABLED (1 << 1) -/** Software protection status bit-field. */ -#define STATUS_SWP (3 << 2) -/** All sectors are software protected. */ -#define STATUS_SWP_PROTALL (3 << 2) -/** Some sectors are software protected. */ -#define STATUS_SWP_PROTSOME (1 << 2) -/** No sector is software protected. */ -#define STATUS_SWP_PROTNONE (0 << 2) -/** Write protect pin status bit. */ -#define STATUS_WPP (1 << 4) -/** Write protect signal is not asserted. */ -#define STATUS_WPP_NOTASSERTED (0 << 4) -/** Write protect signal is asserted. */ -#define STATUS_WPP_ASSERTED (1 << 4) -/** Erase/program error bit. */ -#define STATUS_EPE (1 << 5) -/** Erase or program operation was successful. */ -#define STATUS_EPE_SUCCESS (0 << 5) -/** Erase or program error detected. */ -#define STATUS_EPE_ERROR (1 << 5) -/** Sector protection registers locked bit. */ -#define STATUS_SPRL (1 << 7) -/** Sector protection registers are unlocked. */ -#define STATUS_SPRL_UNLOCKED (0 << 7) -/** Sector protection registers are locked. */ -#define STATUS_SPRL_LOCKED (1 << 7) - -/** Quad enable bit */ -#define STATUS_QUAD_ENABLE (1 << 1) - /** Quad enable bit */ -#define STATUS_WRAP_ENABLE (0 << 4) - - /** Latency control bits */ -#define STATUS_LATENCY_CTRL (0xF << 0) - -#define STATUS_WRAP_BYTE (1 << 5) - -#define BLOCK_PROTECT_Msk (7 << 2) - -#define TOP_BTM_PROTECT_Msk (1 << 5) - -#define SEC_PROTECT_Msk (1 << 6) - -#define CHIP_PROTECT_Msk (0x1F << 2) - -/** Read array command code. */ -#define READ_ARRAY 0x0B -/** Read array (low frequency) command code. */ -#define READ_ARRAY_LF 0x03 -/** Fast Read array command code. */ -#define READ_ARRAY_DUAL 0x3B -/** Fast Read array command code. */ -#define READ_ARRAY_QUAD 0x6B -/** Fast Read array command code. */ -#define READ_ARRAY_DUAL_IO 0xBB -/** Fast Read array command code. */ -#define READ_ARRAY_QUAD_IO 0xEB -/** Block erase command code (4K block). */ -#define BLOCK_ERASE_4K 0x20 -/** Block erase command code (32K block). */ -#define BLOCK_ERASE_32K 0x52 -/** Block erase command code (64K block). */ -#define BLOCK_ERASE_64K 0xD8 -/** Chip erase command code 1. */ -#define CHIP_ERASE_1 0x60 -/** Chip erase command code 2. */ -#define CHIP_ERASE_2 0xC7 -/** Byte/page program command code. */ -#define BYTE_PAGE_PROGRAM 0x02 -/** Sequential program mode command code 1. */ -#define SEQUENTIAL_PROGRAM_1 0xAD -/** Sequential program mode command code 2. */ -#define SEQUENTIAL_PROGRAM_2 0xAF -/** Write enable command code. */ -#define WRITE_ENABLE 0x06 -/** Write disable command code. */ -#define WRITE_DISABLE 0x04 -/** Protect sector command code. */ -#define PROTECT_SECTOR 0x36 -/** Unprotected sector command code. */ -#define UNPROTECT_SECTOR 0x39 -/** Read sector protection registers command code. */ -#define READ_SECTOR_PROT 0x3C -/** Read status register command code. */ -#define READ_STATUS_1 0x05 - /** Read status register command code. */ -#define READ_STATUS_2 0x35 - /** Read status register command code. */ -#define READ_STATUS_3 0x33 -/** Write status register command code. */ -#define WRITE_STATUS 0x01 -/** Read manufacturer and device ID command code. */ -#define READ_JEDEC_ID 0x9F -/** Deep power-down command code. */ -#define DEEP_PDOWN 0xB9 -/** Resume from deep power-down command code. */ -#define RES_DEEP_PDOWN 0xAB -/** Resume from deep power-down command code. */ -#define SOFT_RESET_ENABLE 0x66 -/** Resume from deep power-down command code. */ -#define SOFT_RESET 0x99 -/** Resume from deep power-down command code. */ -#define WRAP_ENABLE 0x77 -/** Continuous Read Mode Reset command code. */ -#define CONT_MODE_RESET 0xFF - -/** SPI Flash Manufacturer JEDEC ID */ -#define ATMEL_SPI_FLASH 0x1F -#define ST_SPI_FLASH 0x20 -#define WINBOND_SPI_FLASH 0xEF -#define MACRONIX_SPI_FLASH 0xC2 -#define SST_SPI_FLASH 0xBF - -/*---------------------------------------------------------------------------- - * Exported functions - *----------------------------------------------------------------------------*/ - -uint32_t S25FL1D_ReadJedecId(void); - -void S25FL1D_InitFlashInterface(uint8_t Mode); - -void S25FL1D_SoftReset(void); - -void S25FL1D_ContReadModeReset(void); -unsigned char S25FL1D_Unprotect(void); - -unsigned char S25FL1D_Protect(uint32_t StartAddr, uint32_t Size); - -void S25FL1D_QuadMode(uint8_t Enable); - -void S25FL1D_EnableWrap(uint8_t ByetAlign); - -void S25FL1D_SetReadLatencyControl(uint8_t Latency); - -unsigned char S25FL1D_EraseChip(void); - -unsigned char S25FL1D_EraseSector( unsigned int address); - -unsigned char S25FL1D_Erase64KBlock( unsigned int address); - -unsigned char S25FL1D_Write( - uint32_t *pData, - uint32_t size, - uint32_t address, - uint8_t Secure); - -extern unsigned char S25FL1D_Read( - uint32_t *pData, - uint32_t size, - uint32_t address); - -extern unsigned char S25FL1D_ReadDual( - uint32_t *pData, - uint32_t size, - uint32_t address); - -extern unsigned char S25FL1D_ReadQuad( - uint32_t *pData, - uint32_t size, - uint32_t address); - -extern unsigned char S25FL1D_ReadDualIO( - uint32_t *pData, - uint32_t size, - uint32_t address, - uint8_t ContMode, - uint8_t Secure); - -extern unsigned char S25FL1D_ReadQuadIO( - uint32_t *pData, - uint32_t size, - uint32_t address, - uint8_t ContMode, - uint8_t Secure); - -#endif // #ifndef S25FL1_H - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/syscalls.h b/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/syscalls.h deleted file mode 100644 index c6c1deaf..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/syscalls.h +++ /dev/null @@ -1,65 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2013, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file syscalls.h - * - * Implementation of newlib syscall. - * - */ - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ - - -#include -#include -#include -#include - -/*---------------------------------------------------------------------------- - * Exported functions - *----------------------------------------------------------------------------*/ - -extern caddr_t _sbrk ( int incr ); - -extern int link( char *old, char *new ); - -extern int _close( int file ); - -extern int _fstat( int file, struct stat *st ); - -extern int _isatty( int file ); - -extern int _lseek( int file, int ptr, int dir ); - -extern int _read(int file, char *ptr, int len); - -extern int _write( int file, char *ptr, int len ); diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/wm8904.h b/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/wm8904.h deleted file mode 100644 index 5f40d572..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libboard_samv7-ek/include/wm8904.h +++ /dev/null @@ -1,160 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2012, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * Implementation WM8904 driver. - * - */ - -#ifndef WM8904_H -#define WM8904_H - -#include "board.h" - -/*---------------------------------------------------------------------------- - * Definitions - *----------------------------------------------------------------------------*/ -#define WM8904_CSB_STATE (0x0 << 0) - -/** Slave address */ -#define WM8904_SLAVE_ADDRESS 0x1a | WM8904_CSB_STATE -#define CS2100_SLAVE_ADDRESS 0x4E - - -/** Reset register*/ -#define WM8904_REG_RESET 0x00 - -/** Bias control 0 register*/ -#define WM8904_REG_BIAS_CTRL0 0x04 - -/** VMID control 0 register*/ -#define WM8904_REG_VMID_CTRL0 0x05 - -/** MIC Bias control 0 register*/ -#define WM8904_REG_MICBIAS_CTRL0 0x06 - -/** Bias control 1 register*/ -#define WM8904_REG_BIAS_CTRL1 0x07 - -/** Power management control 0 register*/ -#define WM8904_REG_POWER_MANG0 0x0C -/** Power management control 2 register*/ -#define WM8904_REG_POWER_MANG2 0x0E -/** Power management control 3 register*/ -#define WM8904_REG_POWER_MANG3 0x0F -/** Power management control 6 register*/ -#define WM8904_REG_POWER_MANG6 0x12 - -/** Clock rate0 register*/ -#define WM8904_REG_CLOCK_RATE0 0x14 -/** Clock rate1 register*/ -#define WM8904_REG_CLOCK_RATE1 0x15 - -/** Clock rate2 register*/ -#define WM8904_REG_CLOCK_RATE2 0x16 - -/** Audio interface0 register*/ -#define WM8904_REG_AUD_INF0 0x18 - -/** Audio interface1 register*/ -#define WM8904_REG_AUD_INF1 0x19 -/** Audio interface2 register*/ -#define WM8904_REG_AUD_INF2 0x1A -/** Audio interface3 register*/ -#define WM8904_REG_AUD_INF3 0x1B - -/** ADC digital 0 register*/ -#define WM8904_REG_ADC_DIG0 0x20 -/** ADC digital 1 register*/ -#define WM8904_REG_ADC_DIG1 0x21 - -/** Analogue left input 0 register*/ -#define WM8904_REG_ANALOGUE_LIN0 0x2C -/** Analogue right input 0 register*/ -#define WM8904_REG_ANALOGUE_RIN0 0x2D - -/** Analogue left input 1 register*/ -#define WM8904_REG_ANALOGUE_LIN1 0x2E -/** Analogue right input 1 register*/ -#define WM8904_REG_ANALOGUE_RIN1 0x2F - -/** Analogue left output 1 register*/ -#define WM8904_REG_ANALOGUE_LOUT1 0x39 -/** Analogue right output 1 register*/ -#define WM8904_REG_ANALOGUE_ROUT1 0x3A - -/** Analogue left output 2 register*/ -#define WM8904_REG_ANALOGUE_LOUT2 0x3B -/** Analogue right output 2 register*/ -#define WM8904_REG_ANALOGUE_ROUT2 0x3C - -/** Analogue output 12 ZC register*/ -#define WM8904_REG_ANALOGUE_OUT12ZC 0x3D - -/** DC servo 0 register*/ -#define WM8904_REG_DC_SERVO0 0x43 - -/** Analogue HP 0 register*/ -#define WM8904_REG_ANALOGUE_HP0 0x5A - -/** Charge pump 0 register*/ -#define WM8904_REG_CHARGE_PUMP0 0x62 - -/** Class W 0 register*/ -#define WM8904_REG_CLASS0 0x68 - -/** FLL control 1 register*/ -#define WM8904_REG_FLL_CRTL1 0x74 -/** FLL control 2 register*/ -#define WM8904_REG_FLL_CRTL2 0x75 -/** FLL control 3 register*/ -#define WM8904_REG_FLL_CRTL3 0x76 -/** FLL control 4 register*/ -#define WM8904_REG_FLL_CRTL4 0x77 -/** FLL control 5 register*/ -#define WM8904_REG_FLL_CRTL5 0x78 - -/** DUMMY register*/ -#define WM8904_REG_END 0xFF - -/*---------------------------------------------------------------------------- - * Exported functions - *----------------------------------------------------------------------------*/ - -extern uint16_t WM8904_Read(Twid *pTwid, uint32_t device, uint32_t regAddr); -extern void WM8904_Write(Twid *pTwid, uint32_t device, uint32_t regAddr, - uint16_t data); -extern uint8_t WM8904_Init(Twid *pTwid, uint32_t device, uint32_t PCK); -extern uint8_t WM8904_VolumeSet(Twid *pTwid, uint32_t device, uint16_t value); -extern void WM8904_IN2R_IN1L(Twid *pTwid, uint32_t device); -#endif // WM8904_H - - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/chip.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/chip.h deleted file mode 100644 index 0aef4dc6..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/chip.h +++ /dev/null @@ -1,124 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2014, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -#ifndef SAMS7_CHIP_H -#define SAMS7_CHIP_H - -#include "compiler.h" - - -/************************************************* - * Memory type and its attribute - *************************************************/ -#define SHAREABLE 1 -#define NON_SHAREABLE 0 - /********************************************************************************************************************************************************************* - * Memory Type Definition Memory TEX attribute C attribute B attribute S attribute - **********************************************************************************************************************************************************************/ - -#define STRONGLY_ORDERED_SHAREABLE_TYPE (( 0x00 << MPU_RASR_TEX_Pos ) | ( DISABLE << MPU_RASR_C_Pos ) | ( DISABLE << MPU_RASR_B_Pos )) // DO not care // -#define SHAREABLE_DEVICE_TYPE (( 0x00 << MPU_RASR_TEX_Pos ) | ( DISABLE << MPU_RASR_C_Pos ) | ( ENABLE << MPU_RASR_B_Pos )) // DO not care // -#define INNER_OUTER_NORMAL_WT_NWA_TYPE(x) (( 0x00 << MPU_RASR_TEX_Pos ) | ( ENABLE << MPU_RASR_C_Pos ) | ( DISABLE << MPU_RASR_B_Pos ) | ( x << MPU_RASR_S_Pos )) -#define INNER_OUTER_NORMAL_WB_NWA_TYPE(x) (( 0x00 << MPU_RASR_TEX_Pos ) | ( ENABLE << MPU_RASR_C_Pos ) | ( ENABLE << MPU_RASR_B_Pos ) | ( x << MPU_RASR_S_Pos )) -#define INNER_OUTER_NORMAL_NOCACHE_TYPE(x) (( 0x01 << MPU_RASR_TEX_Pos ) | ( DISABLE << MPU_RASR_C_Pos ) | ( DISABLE << MPU_RASR_B_Pos ) | ( x << MPU_RASR_S_Pos )) -#define INNER_OUTER_NORMAL_WB_RWA_TYPE(x) (( 0x01 << MPU_RASR_TEX_Pos ) | ( ENABLE << MPU_RASR_C_Pos ) | ( ENABLE << MPU_RASR_B_Pos ) | ( x << MPU_RASR_S_Pos )) -#define NON_SHAREABLE_DEVICE_TYPE (( 0x02 << MPU_RASR_TEX_Pos ) | ( DISABLE << MPU_RASR_C_Pos ) | ( DISABLE << MPU_RASR_B_Pos )) // DO not care // - - /* Normal memory attributes with outer capability rules to Non_Cacable */ - -#define INNER_NORMAL_NOCACHE_TYPE(x) (( 0x04 << MPU_RASR_TEX_Pos ) | ( DISABLE << MPU_RASR_C_Pos ) | ( DISABLE << MPU_RASR_B_Pos ) | ( x << MPU_RASR_S_Pos )) -#define INNER_NORMAL_WB_RWA_TYPE(x) (( 0x04 << MPU_RASR_TEX_Pos ) | ( DISABLE << MPU_RASR_C_Pos ) | ( ENABLE << MPU_RASR_B_Pos ) | ( x << MPU_RASR_S_Pos )) -#define INNER_NORMAL_WT_NWA_TYPE(x) (( 0x04 << MPU_RASR_TEX_Pos ) | ( ENABLE << MPU_RASR_C_Pos ) | ( DISABLE << MPU_RASR_B_Pos ) | ( x << MPU_RASR_S_Pos )) -#define INNER_NORMAL_WB_NWA_TYPE(x) (( 0x04 << MPU_RASR_TEX_Pos ) | ( ENABLE << MPU_RASR_C_Pos ) | ( ENABLE << MPU_RASR_B_Pos ) | ( x << MPU_RASR_S_Pos )) - -/* SCB Interrupt Control State Register Definitions */ -#ifndef SCB_VTOR_TBLBASE_Pos -#define SCB_VTOR_TBLBASE_Pos 29 /*!< SCB VTOR: TBLBASE Position */ -#define SCB_VTOR_TBLBASE_Msk (1UL << SCB_VTOR_TBLBASE_Pos) /*!< SCB VTOR: TBLBASE Mask */ -#endif - - -/* - * Peripherals - */ -#include "include/acc.h" -#include "include/aes.h" -#include "include/afec.h" -#include "include/efc.h" -#include "include/pio.h" -#include "include/pio_it.h" -#include "include/efc.h" -#include "include/rstc.h" -#include "include/mpu.h" -#include "include/gmac.h" -#include "include/gmacd.h" -#include "include/video.h" -#include "include/icm.h" -#include "include/isi.h" -#include "include/exceptions.h" -#include "include/pio_capture.h" -#include "include/rtc.h" -#include "include/rtt.h" -#include "include/tc.h" -#include "include/timetick.h" -#include "include/twi.h" -#include "include/flashd.h" -#include "include/pmc.h" -#include "include/pwmc.h" -#include "include/mcan.h" -#include "include/supc.h" -#include "include/usart.h" -#include "include/uart.h" -#include "include/isi.h" -#include "include/hsmci.h" -#include "include/ssc.h" -#include "include/twi.h" -#include "include/trng.h" -#include "include/wdt.h" -#include "include/spi.h" -#include "include/qspi.h" -#include "include/trace.h" -#include "include/xdmac.h" -#include "include/xdma_hardware_interface.h" -#include "include/xdmad.h" -#include "include/mcid.h" -#include "include/twid.h" -#include "include/spi_dma.h" -#include "include/qspi_dma.h" -#include "include/uart_dma.h" -#include "include/usart_dma.h" -#include "include/twid.h" -#include "include/afe_dma.h" -#include "include/dac_dma.h" -#include "include/usbhs.h" - -#define ENABLE_PERIPHERAL(dwId) PMC_EnablePeripheral( dwId ) -#define DISABLE_PERIPHERAL(dwId) PMC_DisablePeripheral( dwId ) - -#endif /* SAMS7_CHIP_H */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/compiler.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/compiler.h deleted file mode 100644 index 53c0d625..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/compiler.h +++ /dev/null @@ -1,442 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -#ifndef _COMPILER_H_ -#define _COMPILER_H_ - -/* - * Peripherals registers definitions - */ -#include "include/samv7/samv71.h" - - -//_____ D E C L A R A T I O N S ____________________________________________ - -#ifndef __ASSEMBLY__ - -#include -#include -#include -#include - -/* Define WEAK attribute */ -#if defined ( __CC_ARM ) - #define WEAK __attribute__ ((weak)) -#elif defined ( __ICCARM__ ) - #define WEAK __weak -#elif defined ( __GNUC__ ) - #define WEAK __attribute__ ((weak)) -#endif - -/* Define Compiler name of tool chains */ -#if defined ( __CC_ARM ) - #define COMPILER_NAME "KEIL" -#elif defined ( __ICCARM__ ) - #define COMPILER_NAME "IAR" -#elif defined ( __GNUC__ ) - #define COMPILER_NAME "GCC" -#endif - -/* Define NO_INIT attribute */ -#if defined ( __CC_ARM ) - #define NO_INIT -#elif defined ( __ICCARM__ ) - #define NO_INIT __no_init -#elif defined ( __GNUC__ ) - #define NO_INIT -#endif - - -/* Define memory sync for tool chains */ -#if defined ( __CC_ARM ) - #define memory_sync() __dsb(15);__isb(15); -#elif defined ( __ICCARM__ ) - #define memory_sync() __DSB();__ISB(); -#elif defined ( __GNUC__ ) - #define memory_sync() __DSB();__ISB(); -#endif - -/* Define memory barrier for tool chains */ -#if defined ( __CC_ARM ) - #define memory_barrier() __dmb(15); -#elif defined ( __ICCARM__ ) - #define memory_barrier() __DMB(); -#elif defined ( __GNUC__ ) - #define memory_barrier() __DMB(); -#endif - -/*! \name Token Paste - * - * Paste N preprocessing tokens together, these tokens being allowed to be \#defined. - * - * May be used only within macros with the tokens passed as arguments if the tokens are \#defined. - * - * For example, writing TPASTE2(U, WIDTH) within a macro \#defined by - * UTYPE(WIDTH) and invoked as UTYPE(UL_WIDTH) with UL_WIDTH \#defined as 32 is - * equivalent to writing U32. - */ -//! @{ -#define TPASTE2( a, b) a##b -#define TPASTE3( a, b, c) a##b##c -//! @} - -/*! \name Absolute Token Paste - * - * Paste N preprocessing tokens together, these tokens being allowed to be \#defined. - * - * No restriction of use if the tokens are \#defined. - * - * For example, writing ATPASTE2(U, UL_WIDTH) anywhere with UL_WIDTH \#defined - * as 32 is equivalent to writing U32. - */ -//! @{ -#define ATPASTE2( a, b) TPASTE2( a, b) -#define ATPASTE3( a, b, c) TPASTE3( a, b, c) -//! @} - - -/** - * \brief Emit the compiler pragma \a arg. - * - * \param arg The pragma directive as it would appear after \e \#pragma - * (i.e. not stringified). - */ -#define COMPILER_PRAGMA(arg) _Pragma(#arg) - -/** - * \def COMPILER_PACK_SET(alignment) - * \brief Set maximum alignment for subsequent structure and union - * definitions to \a alignment. - */ -#define COMPILER_PACK_SET(alignment) COMPILER_PRAGMA(pack(alignment)) - -/** - * \def COMPILER_PACK_RESET() - * \brief Set default alignment for subsequent structure and union - * definitions. - */ -#define COMPILER_PACK_RESET() COMPILER_PRAGMA(pack()) - -/** - * \brief Set user-defined section. - * Place a data object or a function in a user-defined section. - */ -#if defined ( __CC_ARM ) - #define COMPILER_SECTION(a) __attribute__((__section__(a))) -#elif defined ( __ICCARM__ ) - #define COMPILER_SECTION(a) COMPILER_PRAGMA(location = a) -#elif defined ( __GNUC__ ) - #define COMPILER_SECTION(a) __attribute__((__section__(a))) -#endif - -/** - * \brief Set aligned boundary. - */ -#if defined ( __CC_ARM ) - #define COMPILER_ALIGNED(a) __attribute__((__aligned__(a))) -#elif defined ( __ICCARM__ ) - #define COMPILER_ALIGNED(a) COMPILER_PRAGMA(data_alignment = a) -#elif defined ( __GNUC__ ) - #define COMPILER_ALIGNED(a) __attribute__((__aligned__(a))) -#endif - -/** - * \brief Set word-aligned boundary. - */ - -#if defined ( __CC_ARM ) - #define COMPILER_WORD_ALIGNED __attribute__((__aligned__(4))) -#elif defined ( __ICCARM__ ) - #define COMPILER_WORD_ALIGNED COMPILER_PRAGMA(data_alignment = 4) -#elif defined ( __GNUC__ ) - #define COMPILER_WORD_ALIGNED __attribute__((__aligned__(4))) -#endif - - - -/*! \name Mathematics - * - * The same considerations as for clz and ctz apply here but GCC does not - * provide built-in functions to access the assembly instructions abs, min and - * max and it does not produce them by itself in most cases, so two sets of - * macros are defined here: - * - Abs, Min and Max to apply to constant expressions (values known at - * compile time); - * - abs, min and max to apply to non-constant expressions (values unknown at - * compile time), abs is found in stdlib.h. - */ -//! @{ - -/*! \brief Takes the absolute value of \a a. - * - * \param a Input value. - * - * \return Absolute value of \a a. - * - * \note More optimized if only used with values known at compile time. - */ -#define Abs(a) (((a) < 0 ) ? -(a) : (a)) - -/*! \brief Takes the minimal value of \a a and \a b. - * - * \param a Input value. - * \param b Input value. - * - * \return Minimal value of \a a and \a b. - * - * \note More optimized if only used with values known at compile time. - */ -#define Min(a, b) (((a) < (b)) ? (a) : (b)) - -/*! \brief Takes the maximal value of \a a and \a b. - * - * \param a Input value. - * \param b Input value. - * - * \return Maximal value of \a a and \a b. - * - * \note More optimized if only used with values known at compile time. - */ -#define Max(a, b) (((a) > (b)) ? (a) : (b)) - -// abs() is already defined by stdlib.h - -/*! \brief Takes the minimal value of \a a and \a b. - * - * \param a Input value. - * \param b Input value. - * - * \return Minimal value of \a a and \a b. - * - * \note More optimized if only used with values unknown at compile time. - */ -#define min(a, b) Min(a, b) - -/*! \brief Takes the maximal value of \a a and \a b. - * - * \param a Input value. - * \param b Input value. - * - * \return Maximal value of \a a and \a b. - * - * \note More optimized if only used with values unknown at compile time. - */ -#define max(a, b) Max(a, b) - -//! @} - -#define be32_to_cpu(x) __REV(x) -#define cpu_to_be32(x) __REV(x) -#define BE32_TO_CPU(x) __REV(x) -#define CPU_TO_BE32(x) __REV(x) - -/** - * \def UNUSED - * \brief Marking \a v as a unused parameter or value. - */ -#define UNUSED(v) (void)(v) - -/** - * \weakgroup interrupt_group - * - * @{ - */ - -/** - * \name Interrupt Service Routine definition - * - * @{ - */ - -/** - * \brief Initialize interrupt vectors - * - * For NVIC the interrupt vectors are put in vector table. So nothing - * to do to initialize them, except defined the vector function with - * right name. - * - * This must be called prior to \ref irq_register_handler. - */ -# define irq_initialize_vectors() \ - do { \ - } while(0) - -/** - * \brief Register handler for interrupt - * - * For NVIC the interrupt vectors are put in vector table. So nothing - * to do to register them, except defined the vector function with - * right name. - * - * Usage: - * \code - irq_initialize_vectors(); - irq_register_handler(foo_irq_handler); -\endcode - * - * \note The function \a func must be defined with the \ref ISR macro. - * \note The functions prototypes can be found in the device exception header - * files (exceptions.h). - */ -# define irq_register_handler(int_num, int_prio) \ - NVIC_ClearPendingIRQ( (IRQn_Type)int_num); \ - NVIC_SetPriority( (IRQn_Type)int_num, int_prio); \ - NVIC_EnableIRQ( (IRQn_Type)int_num); \ - -//@} - - -# define cpu_irq_enable() \ - do { \ - /*g_interrupt_enabled = true; */ \ - __DMB(); \ - __enable_irq(); \ - } while (0) -# define cpu_irq_disable() \ - do { \ - __disable_irq(); \ - __DMB(); \ - /*g_interrupt_enabled = false; */ \ - } while (0) - -typedef uint32_t irqflags_t; - -#if !defined(__DOXYGEN__) -extern volatile bool g_interrupt_enabled; -#endif - -#define cpu_irq_is_enabled() (__get_PRIMASK() == 0) - -static volatile uint32_t cpu_irq_critical_section_counter; -static volatile bool cpu_irq_prev_interrupt_state; - -static inline irqflags_t cpu_irq_save(void) -{ - irqflags_t flags = cpu_irq_is_enabled(); - cpu_irq_disable(); - return flags; -} - -static inline bool cpu_irq_is_enabled_flags(irqflags_t flags) -{ - return (flags); -} - -static inline void cpu_irq_restore(irqflags_t flags) -{ - if (cpu_irq_is_enabled_flags(flags)) - cpu_irq_enable(); -} -/* -void cpu_irq_enter_critical(void); -void cpu_irq_leave_critical(void);*/ - -/** - * \weakgroup interrupt_deprecated_group - * @{ - */ - -#define Enable_global_interrupt() cpu_irq_enable() -#define Disable_global_interrupt() cpu_irq_disable() -#define Is_global_interrupt_enabled() cpu_irq_is_enabled() - - -//_____ M A C R O S ________________________________________________________ - -/*! \name Usual Constants - */ -//! @{ -#define DISABLE 0 -#define ENABLE 1 -#define DISABLED 0 -#define ENABLED 1 -#define OFF 0 -#define ON 1 -#define FALSE 0 -#define TRUE 1 -#ifndef __cplusplus -#if !defined(__bool_true_false_are_defined) -#define false FALSE -#define true TRUE -#endif -#endif -#define KO 0 -#define OK 1 -#define PASS 0 -#define FAIL 1 -#define LOW 0 -#define HIGH 1 -#define CLR 0 -#define SET 1 -//! @} - -/*! \brief Counts the trailing zero bits of the given value considered as a 32-bit integer. - * - * \param u Value of which to count the trailing zero bits. - * - * \return The count of trailing zero bits in \a u. - */ -#define ctz(u) ((u) & (1ul << 0) ? 0 : \ - (u) & (1ul << 1) ? 1 : \ - (u) & (1ul << 2) ? 2 : \ - (u) & (1ul << 3) ? 3 : \ - (u) & (1ul << 4) ? 4 : \ - (u) & (1ul << 5) ? 5 : \ - (u) & (1ul << 6) ? 6 : \ - (u) & (1ul << 7) ? 7 : \ - (u) & (1ul << 8) ? 8 : \ - (u) & (1ul << 9) ? 9 : \ - (u) & (1ul << 10) ? 10 : \ - (u) & (1ul << 11) ? 11 : \ - (u) & (1ul << 12) ? 12 : \ - (u) & (1ul << 13) ? 13 : \ - (u) & (1ul << 14) ? 14 : \ - (u) & (1ul << 15) ? 15 : \ - (u) & (1ul << 16) ? 16 : \ - (u) & (1ul << 17) ? 17 : \ - (u) & (1ul << 18) ? 18 : \ - (u) & (1ul << 19) ? 19 : \ - (u) & (1ul << 20) ? 20 : \ - (u) & (1ul << 21) ? 21 : \ - (u) & (1ul << 22) ? 22 : \ - (u) & (1ul << 23) ? 23 : \ - (u) & (1ul << 24) ? 24 : \ - (u) & (1ul << 25) ? 25 : \ - (u) & (1ul << 26) ? 26 : \ - (u) & (1ul << 27) ? 27 : \ - (u) & (1ul << 28) ? 28 : \ - (u) & (1ul << 29) ? 29 : \ - (u) & (1ul << 30) ? 30 : \ - (u) & (1ul << 31) ? 31 : \ - 32) - -#endif // __ASSEMBLY__ - -#endif // _COMPILER_H_ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/acc.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/acc.h deleted file mode 100644 index 73c945a7..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/acc.h +++ /dev/null @@ -1,151 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * \section Purpose - * - * Interface for configuration the Analog-to-Digital Converter (ACC) peripheral. - * - * \section Usage - * - * -# Configurate the pins for ACC - * -# Initialize the ACC with ACC_Initialize(). - * -# Select the active channel using ACC_EnableChannel() - * -# Start the conversion with ACC_StartConversion() - * -# Wait the end of the conversion by polling status with ACC_GetStatus() - * -# Finally, get the converted data using ACC_GetConvertedData() - * - */ -#ifndef _ACC_ -#define _ACC_ - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ -#include "chip.h" - -#include -#include - -/*------------------------------------------------------------------------------ - * Definitions - *------------------------------------------------------------------------------*/ -#define ACC_SELPLUS_AD12B0 0 -#define ACC_SELPLUS_AD12B1 1 -#define ACC_SELPLUS_AD12B2 2 -#define ACC_SELPLUS_AD12B3 3 -#define ACC_SELPLUS_AD12B4 4 -#define ACC_SELPLUS_AD12B5 5 -#define ACC_SELPLUS_AD12B6 6 -#define ACC_SELPLUS_AD12B7 7 -#define ACC_SELMINUS_TS 0 -#define ACC_SELMINUS_ADVREF 1 -#define ACC_SELMINUS_DAC0 2 -#define ACC_SELMINUS_DAC1 3 -#define ACC_SELMINUS_AD12B0 4 -#define ACC_SELMINUS_AD12B1 5 -#define ACC_SELMINUS_AD12B2 6 -#define ACC_SELMINUS_AD12B3 7 - -#ifdef __cplusplus - extern "C" { -#endif - -/*------------------------------------------------------------------------------ - * Macros function of register access - *------------------------------------------------------------------------------*/ -#define ACC_CfgModeReg(pAcc, mode) { \ - (pAcc)->ACC_MR = (mode);\ - } - -#define ACC_GetModeReg( pAcc ) ((pAcc)->ACC_MR) - -#define ACC_StartConversion( pAcc ) ((pAcc)->ACC_CR = ACC_CR_START) - -#define ACC_SoftReset( pAcc ) ((pAcc)->ACC_CR = ACC_CR_SWRST) - -#define ACC_EnableChannel( pAcc, dwChannel ) {\ - assert( dwChannel < 16 ) ;\ - (pAcc)->ACC_CHER = (1 << (dwChannel));\ - } - -#define ACC_DisableChannel( pAcc, dwChannel ) {\ - assert( dwChannel < 16 ) ;\ - (pAcc)->ACC_CHDR = (1 << (dwChannel));\ - } - -#define ACC_EnableIt( pAcc, dwMode ) {\ - assert( ((dwMode)&0xFFF00000)== 0 ) ;\ - (pAcc)->ACC_IER = (dwMode);\ - } - -#define ACC_DisableIt( pAcc, dwMode ) {\ - assert( ((dwMode)&0xFFF00000)== 0 ) ;\ - (pAcc)->ACC_IDR = (dwMode);\ - } - -#define ACC_EnableDataReadyIt( pAcc ) ((pAcc)->ACC_IER = AT91C_ACC_DRDY) - -#define ACC_GetStatus( pAcc ) ((pAcc)->ACC_ISR) - -#define ACC_GetChannelStatus( pAcc ) ((pAcc)->ACC_CHSR) - -#define ACC_GetInterruptMaskStatus( pAcc ) ((pAcc)->ACC_IMR) - -#define ACC_GetLastConvertedData( pAcc ) ((pAcc)->ACC_LCDR) - -#define ACC_CfgAnalogCtrlReg( pAcc, dwMode ) {\ - assert( ((dwMode) & 0xFFFCFF3C) == 0 ) ;\ - (pAcc)->ACC_ACR = (dwMode);\ - } - -#define ACC_CfgExtModeReg( pAcc, extmode ) {\ - assert( ((extmode) & 0xFF00FFFE) == 0 ) ;\ - (pAcc)->ACC_EMR = (extmode);\ - } - -#define ACC_GetAnalogCtrlReg( pAcc ) ((pAcc)->ACC_ACR) - -/*------------------------------------------------------------------------------ - * Exported functions - *------------------------------------------------------------------------------*/ -extern void ACC_Configure( Acc *pAcc, uint8_t idAcc, uint8_t ucSelplus, - uint8_t ucSelminus, uint16_t wAc_en, uint16_t wEdge, uint16_t wInvert ) ; - -extern void ACC_SetComparisonPair( Acc *pAcc, uint8_t ucSelplus, uint8_t ucSelminus ) ; - -extern uint32_t ACC_GetComparisonResult( Acc* pAcc, uint32_t dwStatus ) ; - -#ifdef __cplusplus -} -#endif - -#endif /* #ifndef _ACC_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/adc.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/adc.h deleted file mode 100644 index d919742a..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/adc.h +++ /dev/null @@ -1,178 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * \section Purpose - * - * Interface for configuration the Analog-to-Digital Converter (ADC) peripheral. - * - * \section Usage - * - * -# Configurate the pins for ADC. - * -# Initialize the ADC with ADC_Initialize(). - * -# Set ADC clock and timing with ADC_SetClock() and ADC_SetTiming(). - * -# Select the active channel using ADC_EnableChannel(). - * -# Start the conversion with ADC_StartConversion(). - * -# Wait the end of the conversion by polling status with ADC_GetStatus(). - * -# Finally, get the converted data using ADC_GetConvertedData() or - * ADC_GetLastConvertedData(). - * -*/ -#ifndef _ADC_ -#define _ADC_ - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ -#include -#include - -/*------------------------------------------------------------------------------ - * Definitions - *------------------------------------------------------------------------------*/ - -/* Max. ADC Clock Frequency (Hz) */ -#define ADC_CLOCK_MAX 20000000 - -/* Max. normal ADC startup time (us) */ -#define ADC_STARTUP_NORMAL_MAX 40 -/* Max. fast ADC startup time (us) */ -#define ADC_STARTUP_FAST_MAX 12 - -/* Definitions for ADC channels */ -#define ADC_CHANNEL_0 0 -#define ADC_CHANNEL_1 1 -#define ADC_CHANNEL_2 2 -#define ADC_CHANNEL_3 3 -#define ADC_CHANNEL_4 4 -#define ADC_CHANNEL_5 5 -#define ADC_CHANNEL_6 6 -#define ADC_CHANNEL_7 7 -#define ADC_CHANNEL_8 8 -#define ADC_CHANNEL_9 9 -#define ADC_CHANNEL_10 10 -#define ADC_CHANNEL_11 11 -#define ADC_CHANNEL_12 12 -#define ADC_CHANNEL_13 13 -#define ADC_CHANNEL_14 14 -#define ADC_CHANNEL_15 15 - -#ifdef __cplusplus - extern "C" { -#endif - -/*------------------------------------------------------------------------------ - * Macros function of register access - *------------------------------------------------------------------------------*/ - -#define ADC_GetModeReg( pAdc ) ((pAdc)->ADC_MR) - -#define ADC_StartConversion( pAdc ) ((pAdc)->ADC_CR = ADC_CR_START) - -#define ADC_SetCalibMode(pAdc) ((pAdc)->ADC_CR |= ADC_CR_AUTOCAL) - -#define ADC_EnableChannel( pAdc, dwChannel ) {\ - (pAdc)->ADC_CHER = (1 << (dwChannel));\ - } - -#define ADC_DisableChannel(pAdc, dwChannel) {\ - (pAdc)->ADC_CHDR = (1 << (dwChannel));\ - } - -#define ADC_EnableIt(pAdc, dwMode) {\ - (pAdc)->ADC_IER = (dwMode);\ - } - -#define ADC_DisableIt(pAdc, dwMode) {\ - (pAdc)->ADC_IDR = (dwMode);\ - } - -#define ADC_SetChannelGain(pAdc,dwMode) {\ - (pAdc)->ADC_CGR = dwMode;\ - } - -#define ADC_SetChannelOffset(pAdc,dwMode) {\ - (pAdc)->ADC_COR = dwMode;\ - } - -#define ADC_EnableDataReadyIt(pAdc) ((pAdc)->ADC_IER = ADC_IER_DRDY) - -#define ADC_GetStatus(pAdc) ((pAdc)->ADC_ISR) - -#define ADC_GetCompareMode(pAdc) (((pAdc)->ADC_EMR)& (ADC_EMR_CMPMODE_Msk)) - -#define ADC_GetChannelStatus(pAdc) ((pAdc)->ADC_CHSR) - -#define ADC_GetInterruptMaskStatus(pAdc) ((pAdc)->ADC_IMR) - -#define ADC_GetLastConvertedData(pAdc) ((pAdc)->ADC_LCDR) - -/*------------------------------------------------------------------------------ - * Exported functions - *------------------------------------------------------------------------------*/ -extern void ADC_Initialize( Adc* pAdc, uint32_t dwId ); -extern uint32_t ADC_SetClock( Adc* pAdc, uint32_t dwPres, uint32_t dwMck ); -extern void ADC_SetTiming( Adc* pAdc, uint32_t dwStartup, uint32_t dwTracking, - uint32_t dwSettling ); -extern void ADC_SetTrigger( Adc* pAdc, uint32_t dwTrgSel ); -extern void ADC_SetTriggerMode(Adc *pAdc, uint32_t dwMode); -extern void ADC_SetLowResolution( Adc* pAdc, uint32_t bEnDis ); -extern void ADC_SetSleepMode( Adc *pAdc, uint8_t bEnDis ); -extern void ADC_SetFastWakeup( Adc *pAdc, uint8_t bEnDis ); -extern void ADC_SetSequenceMode( Adc *pAdc, uint8_t bEnDis ); -extern void ADC_SetSequence( Adc *pAdc, uint32_t dwSEQ1, uint32_t dwSEQ2 ); -extern void ADC_SetSequenceByList( Adc *pAdc, uint8_t ucChList[], uint8_t ucNumCh ); -extern void ADC_SetAnalogChange( Adc *pAdc, uint8_t bEnDis ); -extern void ADC_SetTagEnable( Adc *pAdc, uint8_t bEnDis ); -extern void ADC_SetCompareChannel( Adc* pAdc, uint32_t dwChannel ) ; -extern void ADC_SetCompareMode( Adc* pAdc, uint32_t dwMode ) ; -extern void ADC_SetComparisonWindow( Adc* pAdc, uint32_t dwHi_Lo ) ; -extern uint8_t ADC_CheckConfiguration( Adc* pAdc, uint32_t dwMcK ) ; -extern uint32_t ADC_GetConvertedData( Adc* pAdc, uint32_t dwChannel ) ; -extern void ADC_SetTsAverage(Adc* pADC, uint32_t dwAvg2Conv); -extern uint32_t ADC_GetTsXPosition(Adc *pADC); -extern uint32_t ADC_GetTsYPosition(Adc *pADC); -extern uint32_t ADC_GetTsPressure(Adc *pADC); -extern void ADC_SetTsDebounce(Adc *pADC, uint32_t dwTime); -extern void ADC_SetTsPenDetect(Adc* pADC, uint8_t bEnDis); -extern void ADC_SetStartupTime( Adc *pAdc, uint32_t dwUs ); -extern void ADC_SetTrackingTime( Adc *pAdc, uint32_t dwNs ); -extern void ADC_SetTriggerPeriod(Adc *pAdc, uint32_t dwPeriod); -extern void ADC_SetTsMode(Adc* pADC, uint32_t dwMode); -extern void ADC_TsCalibration( Adc *pAdc ); - - -#ifdef __cplusplus -} -#endif - -#endif /* #ifndef _ADC_ */ - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/aes.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/aes.h deleted file mode 100644 index d028b3ee..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/aes.h +++ /dev/null @@ -1,68 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2013, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -#ifndef _AES_ -#define _AES_ - -/*------------------------------------------------------------------------------ - * Headers - *----------------------------------------------------------------------------*/ - -#include "chip.h" - - -/*----------------------------------------------------------------------------*/ -/* Definition */ -/*----------------------------------------------------------------------------*/ -#define AES_MR_CIPHER_ENCRYPT 1 -#define AES_MR_CIPHER_DECRYPT 0 -/*----------------------------------------------------------------------------*/ -/* Exported functions */ -/*----------------------------------------------------------------------------*/ - -extern void AES_Start(void); -extern void AES_SoftReset(void); -extern void AES_Recount(void); -extern void AES_Configure(uint32_t mode); -extern void AES_EnableIt(uint32_t sources); -extern void AES_DisableIt(uint32_t sources); -extern uint32_t AES_GetStatus(void); -extern void AES_WriteKey(const uint32_t *pKey, uint32_t keyLength); -extern void AES_SetInput(uint32_t *data); -extern void AES_GetOutput(uint32_t *data); -extern void AES_SetVector(const uint32_t *pVector); -extern void AES_SetAadLen(uint32_t len); -extern void AES_SetDataLen(uint32_t len); -extern void AES_SetGcmHash(uint32_t * hash); -extern void AES_GetGcmTag(uint32_t * tag); -extern void AES_GetGcmCounter(uint32_t * counter); -extern void AES_GetGcmH(uint32_t *h); - - -#endif /* #ifndef _AES_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/afe_dma.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/afe_dma.h deleted file mode 100644 index d769900c..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/afe_dma.h +++ /dev/null @@ -1,118 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2014, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * \section Purpose - * - * Interface for configuration the Analog-to-Digital Converter (AFEC) peripheral. - * - * \section Usage - * - * -# Configurate the pins for AFEC. - * -# Initialize the AFEC with AFEC_Initialize(). - * -# Set AFEC clock and timing with AFEC_SetClock() and AFEC_SetTiming(). - * -# Select the active channel using AFEC_EnableChannel(). - * -# Start the conversion with AFEC_StartConversion(). - * -# Wait the end of the conversion by polling status with AFEC_GetStatus(). - * -# Finally, get the converted data using AFEC_GetConvertedData() or - * AFEC_GetLastConvertedData(). - * -*/ -#ifndef _AFE_DMA_ -#define _AFE_DMA_ - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ - -#include "chip.h" - - -/*---------------------------------------------------------------------------- - * Types - *----------------------------------------------------------------------------*/ - -/** AFE transfer complete callback. */ -typedef void (*AfeCallback)( uint8_t, void* ) ; - -/** \brief Spi Transfer Request prepared by the application upper layer. - * - * This structure is sent to the AFE_SendCommand function to start the transfer. - * At the end of the transfer, the callback is invoked by the interrupt handler. - */ -typedef struct -{ - /** Pointer to the Rx data. */ - uint32_t *pRxBuff; - /** Rx size in bytes. */ - uint16_t RxSize; - /** Callback function invoked at the end of transfer. */ - AfeCallback callback; - /** Callback arguments. */ - void *pArgument; -} AfeCmd ; - - -/** Constant structure associated with AFE port. This structure prevents - client applications to have access in the same time. */ -typedef struct -{ - /** Pointer to AFE Hardware registers */ - Afec* pAfeHw ; - /** Current SpiCommand being processed */ - AfeCmd *pCurrentCommand ; - /** Pointer to DMA driver */ - sXdmad* pXdmad; - /** AFEC Id as defined in the product datasheet */ - uint8_t afeId ; - /** Mutual exclusion semaphore. */ - volatile int8_t semaphore ; -} AfeDma; - - -/*------------------------------------------------------------------------------ - * Definitions - *----------------------------------------------------------------------------*/ -#define AFE_OK 0 -#define AFE_ERROR 1 -#define AFE_ERROR_LOCK 2 -/*------------------------------------------------------------------------------ - * Exported functions - *----------------------------------------------------------------------------*/ -extern uint32_t Afe_ConfigureDma( AfeDma *pAfed , - Afec *pAfeHw , - uint8_t AfeId, - sXdmad *pXdmad ); -extern uint32_t Afe_SendData( AfeDma *pAfed, AfeCmd *pCommand); - - -#endif /* #ifndef _AFE_DMA_ */ - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/afec.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/afec.h deleted file mode 100644 index ee9a1646..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/afec.h +++ /dev/null @@ -1,187 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2014, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * \section Purpose - * - * Interface for configuration the Analog-to-Digital Converter (AFEC) peripheral. - * - * \section Usage - * - * -# Configurate the pins for AFEC. - * -# Initialize the AFEC with AFEC_Initialize(). - * -# Set AFEC clock and timing with AFEC_SetClock() and AFEC_SetTiming(). - * -# Select the active channel using AFEC_EnableChannel(). - * -# Start the conversion with AFEC_StartConversion(). - * -# Wait the end of the conversion by polling status with AFEC_GetStatus(). - * -# Finally, get the converted data using AFEC_GetConvertedData() or - * AFEC_GetLastConvertedData(). - * -*/ -#ifndef _AFEC_ -#define _AFEC_ - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ -#include -#include - -/*------------------------------------------------------------------------------ - * Definitions - *------------------------------------------------------------------------------*/ - -/* -------- AFEC_MR : (AFEC Offset: 0x04) AFEC Mode Register -------- */ -#define AFEC_MR_SETTLING_Pos 20 -#define AFEC_MR_SETTLING_Msk (0x3u << AFEC_MR_SETTLING_Pos) -/**< \brief (AFEC_MR) Trigger Selection */ -#define AFEC_MR_SETTLING_AST3 (0x0u << 20) -/**< \brief (AFEC_MR) ADC_SETTLING_AST3 3 periods of AFEClock */ -#define AFEC_MR_SETTLING_AST5 (0x1u << 20) -/**< \brief (AFEC_MR) ADC_SETTLING_AST5 5 periods of AFEClock */ -#define AFEC_MR_SETTLING_AST9 (0x2u << 20) -/**< \brief (AFEC_MR) ADC_SETTLING_AST9 9 periods of AFEClock*/ -#define AFEC_MR_SETTLING_AST17 (0x3u << 20) -/**< \brief (AFEC_MR) ADC_SETTLING_AST17 17 periods of AFEClock*/ - -/***************************** Single Trigger Mode ****************************/ -#define AFEC_EMR_STM_Pos 25 -#define AFEC_EMR_STM_Msk (0x1u << AFEC_EMR_STM_Pos) -/**< \brief (AFEC_EMR) Single Trigger Mode */ -#define AFEC_EMR_STM_MULTI_TRIG (0x0u << 25) -/**< \brief (AFEC_EMR) Single Trigger Mode: Multiple triggers are required to - get an averaged result. */ -#define AFEC_EMR_STM_SINGLE_TRIG (0x1u << 25) -/**< \brief (AFEC_EMR) Single Trigger Mode: Only a Single Trigger is required - to get an averaged value. */ - -/***************************** TAG of the AFEC_LDCR Register ******************/ -#define AFEC_EMR_TAG_Pos 24 -#define AFEC_EMR_TAG_Msk (0x1u << AFEC_EMR_TAG_Pos) -/**< \brief (AFEC_EMR) TAG of the AFEC_LDCR Register */ -#define AFEC_EMR_TAG_CHNB_ZERO (0x0u << 24) -/**< \brief (AFEC_EMR) TAG of the AFEC_LDCR Register: Sets CHNB to zero -in AFEC_LDCR. */ -#define AFEC_EMR_TAG_APPENDS (0x1u << 24) -/**< \brief (AFEC_EMR) TAG of the AFEC_LDCR Register: Appends the channel -number to the conversion result in AFEC_LDCR register. */ - -/***************************** Compare All Channels ******************/ -#define AFEC_EMR_CMPALL_Pos 9 -#define AFEC_EMR_CMPALL_Msk (0x1u << AFEC_EMR_TAG_Pos) -/**< \brief (AFEC_EMR) Compare All Channels */ -#define AFEC_EMR_CMPALL_ONE_CHANNEL_COMP (0x0u << 9) -/**< \brief (AFEC_EMR) Compare All Channels: Only channel indicated in -CMPSEL field is compared. */ -#define AFEC_EMR_CMPALL_ALL_CHANNELS_COMP (0x1u << 9) -/**< \brief (AFEC_EMR) Compare All Channels: All channels are compared. */ - -#define AFEC_ACR_PGA0_ON (0x1u << 2) -#define AFEC_ACR_PGA1_ON (0x1u << 3) - -#ifdef __cplusplus - extern "C" { -#endif - -/*------------------------------------------------------------------------------ - * Macros function of register access - *------------------------------------------------------------------------------*/ - -#define AFEC_GetModeReg( pAFEC ) ((pAFEC)->AFEC_MR) -#define AFEC_SetModeReg( pAFEC, mode ) ((pAFEC)->AFEC_MR = mode) - -#define AFEC_GetExtModeReg( pAFEC ) ((pAFEC)->AFEC_EMR) -#define AFEC_SetExtModeReg( pAFEC, mode ) ((pAFEC)->AFEC_EMR = mode) - -#define AFEC_StartConversion( pAFEC ) ((pAFEC)->AFEC_CR = AFEC_CR_START) - -#define AFEC_EnableChannel( pAFEC, dwChannel ) {\ - (pAFEC)->AFEC_CHER = (1 << (dwChannel));\ - } - -#define AFEC_DisableChannel(pAFEC, dwChannel) {\ - (pAFEC)->AFEC_CHDR = (1 << (dwChannel));\ - } - -#define AFEC_EnableIt(pAFEC, dwMode) {\ - (pAFEC)->AFEC_IER = (dwMode);\ - } - -#define AFEC_DisableIt(pAFEC, dwMode) {\ - (pAFEC)->AFEC_IDR = (dwMode);\ - } - -#define AFEC_SetChannelGain(pAFEC,dwMode) {\ - (pAFEC)->AFEC_CGR = dwMode;\ - } - -#define AFEC_EnableDataReadyIt(pAFEC) ((pAFEC)->AFEC_IER = AFEC_IER_DRDY) - -#define AFEC_GetStatus(pAFEC) ((pAFEC)->AFEC_ISR) - -#define AFEC_GetCompareMode(pAFEC) (((pAFEC)->AFEC_EMR)& (AFEC_EMR_CMPMODE_Msk)) - -#define AFEC_GetChannelStatus(pAFEC) ((pAFEC)->AFEC_CHSR) - -#define AFEC_GetInterruptMaskStatus(pAFEC) ((pAFEC)->AFEC_IMR) - -#define AFEC_GetLastConvertedData(pAFEC) ((pAFEC)->AFEC_LCDR) - -/*------------------------------------------------------------------------------ - * Exported functions - *------------------------------------------------------------------------------*/ -extern void AFEC_Initialize( Afec* pAFEC, uint32_t dwId ); -extern uint32_t AFEC_SetClock( Afec* pAFEC, uint32_t dwPres, uint32_t dwMck ); -extern void AFEC_SetTiming( Afec* pAFEC, uint32_t dwStartup, uint32_t dwTracking, - uint32_t dwSettling ); -extern void AFEC_SetTrigger( Afec* pAFEC, uint32_t dwTrgSel ); -extern void AFEC_SetAnalogChange( Afec* pAFE, uint8_t bEnDis ); -extern void AFEC_SetSleepMode( Afec* pAFEC, uint8_t bEnDis ); -extern void AFEC_SetFastWakeup( Afec* pAFEC, uint8_t bEnDis ); -extern void AFEC_SetSequenceMode( Afec* pAFEC, uint8_t bEnDis ); -extern void AFEC_SetSequence( Afec* pAFEC, uint32_t dwSEQ1, uint32_t dwSEQ2 ); -extern void AFEC_SetSequenceByList( Afec* pAFEC, uint8_t ucChList[], uint8_t ucNumCh ); -extern void AFEC_SetTagEnable( Afec* pAFEC, uint8_t bEnDis ); -extern void AFEC_SetCompareChannel( Afec* pAFEC, uint32_t dwChannel ) ; -extern void AFEC_SetCompareMode( Afec* pAFEC, uint32_t dwMode ) ; -extern void AFEC_SetComparisonWindow( Afec* pAFEC, uint32_t dwHi_Lo ) ; -extern uint8_t AFEC_CheckConfiguration( Afec* pAFEC, uint32_t dwMcK ) ; -extern uint32_t AFEC_GetConvertedData( Afec* pAFEC, uint32_t dwChannel ) ; -extern void AFEC_SetStartupTime( Afec* pAFEC, uint32_t dwUs ); -extern void AFEC_SetTrackingTime( Afec* pAFEC, uint32_t dwNs ); -extern void AFEC_SetAnalogOffset( Afec *pAFE, uint32_t dwChannel,uint32_t aoffset ); -extern void AFEC_SetAnalogControl( Afec *pAFE, uint32_t control); -#ifdef __cplusplus -} -#endif - -#endif /* #ifndef _AFEC_ */ - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/arm_common_tables.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/arm_common_tables.h deleted file mode 100644 index 039cc3d6..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/arm_common_tables.h +++ /dev/null @@ -1,136 +0,0 @@ -/* ---------------------------------------------------------------------- -* Copyright (C) 2010-2014 ARM Limited. All rights reserved. -* -* $Date: 19. March 2015 -* $Revision: V.1.4.5 -* -* Project: CMSIS DSP Library -* Title: arm_common_tables.h -* -* Description: This file has extern declaration for common tables like Bitreverse, reciprocal etc which are used across different functions -* -* Target Processor: Cortex-M4/Cortex-M3 -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* - Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* - Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in -* the documentation and/or other materials provided with the -* distribution. -* - Neither the name of ARM LIMITED nor the names of its contributors -* may be used to endorse or promote products derived from this -* software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -* -------------------------------------------------------------------- */ - -#ifndef _ARM_COMMON_TABLES_H -#define _ARM_COMMON_TABLES_H - -#include "arm_math.h" - -extern const uint16_t armBitRevTable[1024]; -extern const q15_t armRecipTableQ15[64]; -extern const q31_t armRecipTableQ31[64]; -//extern const q31_t realCoefAQ31[1024]; -//extern const q31_t realCoefBQ31[1024]; -extern const float32_t twiddleCoef_16[32]; -extern const float32_t twiddleCoef_32[64]; -extern const float32_t twiddleCoef_64[128]; -extern const float32_t twiddleCoef_128[256]; -extern const float32_t twiddleCoef_256[512]; -extern const float32_t twiddleCoef_512[1024]; -extern const float32_t twiddleCoef_1024[2048]; -extern const float32_t twiddleCoef_2048[4096]; -extern const float32_t twiddleCoef_4096[8192]; -#define twiddleCoef twiddleCoef_4096 -extern const q31_t twiddleCoef_16_q31[24]; -extern const q31_t twiddleCoef_32_q31[48]; -extern const q31_t twiddleCoef_64_q31[96]; -extern const q31_t twiddleCoef_128_q31[192]; -extern const q31_t twiddleCoef_256_q31[384]; -extern const q31_t twiddleCoef_512_q31[768]; -extern const q31_t twiddleCoef_1024_q31[1536]; -extern const q31_t twiddleCoef_2048_q31[3072]; -extern const q31_t twiddleCoef_4096_q31[6144]; -extern const q15_t twiddleCoef_16_q15[24]; -extern const q15_t twiddleCoef_32_q15[48]; -extern const q15_t twiddleCoef_64_q15[96]; -extern const q15_t twiddleCoef_128_q15[192]; -extern const q15_t twiddleCoef_256_q15[384]; -extern const q15_t twiddleCoef_512_q15[768]; -extern const q15_t twiddleCoef_1024_q15[1536]; -extern const q15_t twiddleCoef_2048_q15[3072]; -extern const q15_t twiddleCoef_4096_q15[6144]; -extern const float32_t twiddleCoef_rfft_32[32]; -extern const float32_t twiddleCoef_rfft_64[64]; -extern const float32_t twiddleCoef_rfft_128[128]; -extern const float32_t twiddleCoef_rfft_256[256]; -extern const float32_t twiddleCoef_rfft_512[512]; -extern const float32_t twiddleCoef_rfft_1024[1024]; -extern const float32_t twiddleCoef_rfft_2048[2048]; -extern const float32_t twiddleCoef_rfft_4096[4096]; - - -/* floating-point bit reversal tables */ -#define ARMBITREVINDEXTABLE__16_TABLE_LENGTH ((uint16_t)20 ) -#define ARMBITREVINDEXTABLE__32_TABLE_LENGTH ((uint16_t)48 ) -#define ARMBITREVINDEXTABLE__64_TABLE_LENGTH ((uint16_t)56 ) -#define ARMBITREVINDEXTABLE_128_TABLE_LENGTH ((uint16_t)208 ) -#define ARMBITREVINDEXTABLE_256_TABLE_LENGTH ((uint16_t)440 ) -#define ARMBITREVINDEXTABLE_512_TABLE_LENGTH ((uint16_t)448 ) -#define ARMBITREVINDEXTABLE1024_TABLE_LENGTH ((uint16_t)1800) -#define ARMBITREVINDEXTABLE2048_TABLE_LENGTH ((uint16_t)3808) -#define ARMBITREVINDEXTABLE4096_TABLE_LENGTH ((uint16_t)4032) - -extern const uint16_t armBitRevIndexTable16[ARMBITREVINDEXTABLE__16_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable32[ARMBITREVINDEXTABLE__32_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable64[ARMBITREVINDEXTABLE__64_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable128[ARMBITREVINDEXTABLE_128_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable256[ARMBITREVINDEXTABLE_256_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable512[ARMBITREVINDEXTABLE_512_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable1024[ARMBITREVINDEXTABLE1024_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable2048[ARMBITREVINDEXTABLE2048_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable4096[ARMBITREVINDEXTABLE4096_TABLE_LENGTH]; - -/* fixed-point bit reversal tables */ -#define ARMBITREVINDEXTABLE_FIXED___16_TABLE_LENGTH ((uint16_t)12 ) -#define ARMBITREVINDEXTABLE_FIXED___32_TABLE_LENGTH ((uint16_t)24 ) -#define ARMBITREVINDEXTABLE_FIXED___64_TABLE_LENGTH ((uint16_t)56 ) -#define ARMBITREVINDEXTABLE_FIXED__128_TABLE_LENGTH ((uint16_t)112 ) -#define ARMBITREVINDEXTABLE_FIXED__256_TABLE_LENGTH ((uint16_t)240 ) -#define ARMBITREVINDEXTABLE_FIXED__512_TABLE_LENGTH ((uint16_t)480 ) -#define ARMBITREVINDEXTABLE_FIXED_1024_TABLE_LENGTH ((uint16_t)992 ) -#define ARMBITREVINDEXTABLE_FIXED_2048_TABLE_LENGTH ((uint16_t)1984) -#define ARMBITREVINDEXTABLE_FIXED_4096_TABLE_LENGTH ((uint16_t)4032) - -extern const uint16_t armBitRevIndexTable_fixed_16[ARMBITREVINDEXTABLE_FIXED___16_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_32[ARMBITREVINDEXTABLE_FIXED___32_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_64[ARMBITREVINDEXTABLE_FIXED___64_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_128[ARMBITREVINDEXTABLE_FIXED__128_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_256[ARMBITREVINDEXTABLE_FIXED__256_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_512[ARMBITREVINDEXTABLE_FIXED__512_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_1024[ARMBITREVINDEXTABLE_FIXED_1024_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_2048[ARMBITREVINDEXTABLE_FIXED_2048_TABLE_LENGTH]; -extern const uint16_t armBitRevIndexTable_fixed_4096[ARMBITREVINDEXTABLE_FIXED_4096_TABLE_LENGTH]; - -/* Tables for Fast Math Sine and Cosine */ -extern const float32_t sinTable_f32[FAST_MATH_TABLE_SIZE + 1]; -extern const q31_t sinTable_q31[FAST_MATH_TABLE_SIZE + 1]; -extern const q15_t sinTable_q15[FAST_MATH_TABLE_SIZE + 1]; - -#endif /* ARM_COMMON_TABLES_H */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/arm_const_structs.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/arm_const_structs.h deleted file mode 100644 index 726d06eb..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/arm_const_structs.h +++ /dev/null @@ -1,79 +0,0 @@ -/* ---------------------------------------------------------------------- -* Copyright (C) 2010-2014 ARM Limited. All rights reserved. -* -* $Date: 19. March 2015 -* $Revision: V.1.4.5 -* -* Project: CMSIS DSP Library -* Title: arm_const_structs.h -* -* Description: This file has constant structs that are initialized for -* user convenience. For example, some can be given as -* arguments to the arm_cfft_f32() function. -* -* Target Processor: Cortex-M4/Cortex-M3 -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* - Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* - Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in -* the documentation and/or other materials provided with the -* distribution. -* - Neither the name of ARM LIMITED nor the names of its contributors -* may be used to endorse or promote products derived from this -* software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -* -------------------------------------------------------------------- */ - -#ifndef _ARM_CONST_STRUCTS_H -#define _ARM_CONST_STRUCTS_H - -#include "arm_math.h" -#include "arm_common_tables.h" - - extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len16; - extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len32; - extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len64; - extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len128; - extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len256; - extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len512; - extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len1024; - extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len2048; - extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len4096; - - extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len16; - extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len32; - extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len64; - extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len128; - extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len256; - extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len512; - extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len1024; - extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len2048; - extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len4096; - - extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len16; - extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len32; - extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len64; - extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len128; - extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len256; - extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len512; - extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len1024; - extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len2048; - extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len4096; - -#endif diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/arm_math.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/arm_math.h deleted file mode 100644 index e4b2f62e..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/arm_math.h +++ /dev/null @@ -1,7556 +0,0 @@ -/* ---------------------------------------------------------------------- -* Copyright (C) 2010-2015 ARM Limited. All rights reserved. -* -* $Date: 19. March 2015 -* $Revision: V.1.4.5 -* -* Project: CMSIS DSP Library -* Title: arm_math.h -* -* Description: Public header file for CMSIS DSP Library -* -* Target Processor: Cortex-M7/Cortex-M4/Cortex-M3/Cortex-M0 -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* - Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* - Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in -* the documentation and/or other materials provided with the -* distribution. -* - Neither the name of ARM LIMITED nor the names of its contributors -* may be used to endorse or promote products derived from this -* software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. - * -------------------------------------------------------------------- */ - -/** - \mainpage CMSIS DSP Software Library - * - * Introduction - * ------------ - * - * This user manual describes the CMSIS DSP software library, - * a suite of common signal processing functions for use on Cortex-M processor based devices. - * - * The library is divided into a number of functions each covering a specific category: - * - Basic math functions - * - Fast math functions - * - Complex math functions - * - Filters - * - Matrix functions - * - Transforms - * - Motor control functions - * - Statistical functions - * - Support functions - * - Interpolation functions - * - * The library has separate functions for operating on 8-bit integers, 16-bit integers, - * 32-bit integer and 32-bit floating-point values. - * - * Using the Library - * ------------ - * - * The library installer contains prebuilt versions of the libraries in the Lib folder. - * - arm_cortexM7lfdp_math.lib (Little endian and Double Precision Floating Point Unit on Cortex-M7) - * - arm_cortexM7bfdp_math.lib (Big endian and Double Precision Floating Point Unit on Cortex-M7) - * - arm_cortexM7lfsp_math.lib (Little endian and Single Precision Floating Point Unit on Cortex-M7) - * - arm_cortexM7bfsp_math.lib (Big endian and Single Precision Floating Point Unit on Cortex-M7) - * - arm_cortexM7l_math.lib (Little endian on Cortex-M7) - * - arm_cortexM7b_math.lib (Big endian on Cortex-M7) - * - arm_cortexM4lf_math.lib (Little endian and Floating Point Unit on Cortex-M4) - * - arm_cortexM4bf_math.lib (Big endian and Floating Point Unit on Cortex-M4) - * - arm_cortexM4l_math.lib (Little endian on Cortex-M4) - * - arm_cortexM4b_math.lib (Big endian on Cortex-M4) - * - arm_cortexM3l_math.lib (Little endian on Cortex-M3) - * - arm_cortexM3b_math.lib (Big endian on Cortex-M3) - * - arm_cortexM0l_math.lib (Little endian on Cortex-M0 / CortexM0+) - * - arm_cortexM0b_math.lib (Big endian on Cortex-M0 / CortexM0+) - * - * The library functions are declared in the public file arm_math.h which is placed in the Include folder. - * Simply include this file and link the appropriate library in the application and begin calling the library functions. The Library supports single - * public header file arm_math.h for Cortex-M7/M4/M3/M0/M0+ with little endian and big endian. Same header file will be used for floating point unit(FPU) variants. - * Define the appropriate pre processor MACRO ARM_MATH_CM7 or ARM_MATH_CM4 or ARM_MATH_CM3 or - * ARM_MATH_CM0 or ARM_MATH_CM0PLUS depending on the target processor in the application. - * - * Examples - * -------- - * - * The library ships with a number of examples which demonstrate how to use the library functions. - * - * Toolchain Support - * ------------ - * - * The library has been developed and tested with MDK-ARM version 5.14.0.0 - * The library is being tested in GCC and IAR toolchains and updates on this activity will be made available shortly. - * - * Building the Library - * ------------ - * - * The library installer contains a project file to re build libraries on MDK-ARM Tool chain in the CMSIS\\DSP_Lib\\Source\\ARM folder. - * - arm_cortexM_math.uvprojx - * - * - * The libraries can be built by opening the arm_cortexM_math.uvprojx project in MDK-ARM, selecting a specific target, and defining the optional pre processor MACROs detailed above. - * - * Pre-processor Macros - * ------------ - * - * Each library project have differant pre-processor macros. - * - * - UNALIGNED_SUPPORT_DISABLE: - * - * Define macro UNALIGNED_SUPPORT_DISABLE, If the silicon does not support unaligned memory access - * - * - ARM_MATH_BIG_ENDIAN: - * - * Define macro ARM_MATH_BIG_ENDIAN to build the library for big endian targets. By default library builds for little endian targets. - * - * - ARM_MATH_MATRIX_CHECK: - * - * Define macro ARM_MATH_MATRIX_CHECK for checking on the input and output sizes of matrices - * - * - ARM_MATH_ROUNDING: - * - * Define macro ARM_MATH_ROUNDING for rounding on support functions - * - * - ARM_MATH_CMx: - * - * Define macro ARM_MATH_CM4 for building the library on Cortex-M4 target, ARM_MATH_CM3 for building library on Cortex-M3 target - * and ARM_MATH_CM0 for building library on Cortex-M0 target, ARM_MATH_CM0PLUS for building library on Cortex-M0+ target, and - * ARM_MATH_CM7 for building the library on cortex-M7. - * - * - __FPU_PRESENT: - * - * Initialize macro __FPU_PRESENT = 1 when building on FPU supported Targets. Enable this macro for M4bf and M4lf libraries - * - *
- * CMSIS-DSP in ARM::CMSIS Pack - * ----------------------------- - * - * The following files relevant to CMSIS-DSP are present in the ARM::CMSIS Pack directories: - * |File/Folder |Content | - * |------------------------------|------------------------------------------------------------------------| - * |\b CMSIS\\Documentation\\DSP | This documentation | - * |\b CMSIS\\DSP_Lib | Software license agreement (license.txt) | - * |\b CMSIS\\DSP_Lib\\Examples | Example projects demonstrating the usage of the library functions | - * |\b CMSIS\\DSP_Lib\\Source | Source files for rebuilding the library | - * - *
- * Revision History of CMSIS-DSP - * ------------ - * Please refer to \ref ChangeLog_pg. - * - * Copyright Notice - * ------------ - * - * Copyright (C) 2010-2015 ARM Limited. All rights reserved. - */ - - -/** - * @defgroup groupMath Basic Math Functions - */ - -/** - * @defgroup groupFastMath Fast Math Functions - * This set of functions provides a fast approximation to sine, cosine, and square root. - * As compared to most of the other functions in the CMSIS math library, the fast math functions - * operate on individual values and not arrays. - * There are separate functions for Q15, Q31, and floating-point data. - * - */ - -/** - * @defgroup groupCmplxMath Complex Math Functions - * This set of functions operates on complex data vectors. - * The data in the complex arrays is stored in an interleaved fashion - * (real, imag, real, imag, ...). - * In the API functions, the number of samples in a complex array refers - * to the number of complex values; the array contains twice this number of - * real values. - */ - -/** - * @defgroup groupFilters Filtering Functions - */ - -/** - * @defgroup groupMatrix Matrix Functions - * - * This set of functions provides basic matrix math operations. - * The functions operate on matrix data structures. For example, - * the type - * definition for the floating-point matrix structure is shown - * below: - *
- *     typedef struct
- *     {
- *       uint16_t numRows;     // number of rows of the matrix.
- *       uint16_t numCols;     // number of columns of the matrix.
- *       float32_t *pData;     // points to the data of the matrix.
- *     } arm_matrix_instance_f32;
- * 
- * There are similar definitions for Q15 and Q31 data types. - * - * The structure specifies the size of the matrix and then points to - * an array of data. The array is of size numRows X numCols - * and the values are arranged in row order. That is, the - * matrix element (i, j) is stored at: - *
- *     pData[i*numCols + j]
- * 
- * - * \par Init Functions - * There is an associated initialization function for each type of matrix - * data structure. - * The initialization function sets the values of the internal structure fields. - * Refer to the function arm_mat_init_f32(), arm_mat_init_q31() - * and arm_mat_init_q15() for floating-point, Q31 and Q15 types, respectively. - * - * \par - * Use of the initialization function is optional. However, if initialization function is used - * then the instance structure cannot be placed into a const data section. - * To place the instance structure in a const data - * section, manually initialize the data structure. For example: - *
- * arm_matrix_instance_f32 S = {nRows, nColumns, pData};
- * arm_matrix_instance_q31 S = {nRows, nColumns, pData};
- * arm_matrix_instance_q15 S = {nRows, nColumns, pData};
- * 
- * where nRows specifies the number of rows, nColumns - * specifies the number of columns, and pData points to the - * data array. - * - * \par Size Checking - * By default all of the matrix functions perform size checking on the input and - * output matrices. For example, the matrix addition function verifies that the - * two input matrices and the output matrix all have the same number of rows and - * columns. If the size check fails the functions return: - *
- *     ARM_MATH_SIZE_MISMATCH
- * 
- * Otherwise the functions return - *
- *     ARM_MATH_SUCCESS
- * 
- * There is some overhead associated with this matrix size checking. - * The matrix size checking is enabled via the \#define - *
- *     ARM_MATH_MATRIX_CHECK
- * 
- * within the library project settings. By default this macro is defined - * and size checking is enabled. By changing the project settings and - * undefining this macro size checking is eliminated and the functions - * run a bit faster. With size checking disabled the functions always - * return ARM_MATH_SUCCESS. - */ - -/** - * @defgroup groupTransforms Transform Functions - */ - -/** - * @defgroup groupController Controller Functions - */ - -/** - * @defgroup groupStats Statistics Functions - */ -/** - * @defgroup groupSupport Support Functions - */ - -/** - * @defgroup groupInterpolation Interpolation Functions - * These functions perform 1- and 2-dimensional interpolation of data. - * Linear interpolation is used for 1-dimensional data and - * bilinear interpolation is used for 2-dimensional data. - */ - -/** - * @defgroup groupExamples Examples - */ -#ifndef _ARM_MATH_H -#define _ARM_MATH_H - -#define __CMSIS_GENERIC /* disable NVIC and Systick functions */ - -#if defined(ARM_MATH_CM7) - #include "core_cm7.h" -#elif defined (ARM_MATH_CM4) - #include "core_cm4.h" -#elif defined (ARM_MATH_CM3) - #include "core_cm3.h" -#elif defined (ARM_MATH_CM0) - #include "core_cm0.h" -#define ARM_MATH_CM0_FAMILY - #elif defined (ARM_MATH_CM0PLUS) -#include "core_cm0plus.h" - #define ARM_MATH_CM0_FAMILY -#else - #error "Define according the used Cortex core ARM_MATH_CM7, ARM_MATH_CM4, ARM_MATH_CM3, ARM_MATH_CM0PLUS or ARM_MATH_CM0" -#endif - -#undef __CMSIS_GENERIC /* enable NVIC and Systick functions */ -#include "string.h" -#include "math.h" -#ifdef __cplusplus -extern "C" -{ -#endif - - - /** - * @brief Macros required for reciprocal calculation in Normalized LMS - */ - -#define DELTA_Q31 (0x100) -#define DELTA_Q15 0x5 -#define INDEX_MASK 0x0000003F -#ifndef PI -#define PI 3.14159265358979f -#endif - - /** - * @brief Macros required for SINE and COSINE Fast math approximations - */ - -#define FAST_MATH_TABLE_SIZE 512 -#define FAST_MATH_Q31_SHIFT (32 - 10) -#define FAST_MATH_Q15_SHIFT (16 - 10) -#define CONTROLLER_Q31_SHIFT (32 - 9) -#define TABLE_SIZE 256 -#define TABLE_SPACING_Q31 0x400000 -#define TABLE_SPACING_Q15 0x80 - - /** - * @brief Macros required for SINE and COSINE Controller functions - */ - /* 1.31(q31) Fixed value of 2/360 */ - /* -1 to +1 is divided into 360 values so total spacing is (2/360) */ -#define INPUT_SPACING 0xB60B61 - - /** - * @brief Macro for Unaligned Support - */ -#ifndef UNALIGNED_SUPPORT_DISABLE - #define ALIGN4 -#else - #if defined (__GNUC__) - #define ALIGN4 __attribute__((aligned(4))) - #else - #define ALIGN4 __align(4) - #endif -#endif /* #ifndef UNALIGNED_SUPPORT_DISABLE */ - - /** - * @brief Error status returned by some functions in the library. - */ - - typedef enum - { - ARM_MATH_SUCCESS = 0, /**< No error */ - ARM_MATH_ARGUMENT_ERROR = -1, /**< One or more arguments are incorrect */ - ARM_MATH_LENGTH_ERROR = -2, /**< Length of data buffer is incorrect */ - ARM_MATH_SIZE_MISMATCH = -3, /**< Size of matrices is not compatible with the operation. */ - ARM_MATH_NANINF = -4, /**< Not-a-number (NaN) or infinity is generated */ - ARM_MATH_SINGULAR = -5, /**< Generated by matrix inversion if the input matrix is singular and cannot be inverted. */ - ARM_MATH_TEST_FAILURE = -6 /**< Test Failed */ - } arm_status; - - /** - * @brief 8-bit fractional data type in 1.7 format. - */ - typedef int8_t q7_t; - - /** - * @brief 16-bit fractional data type in 1.15 format. - */ - typedef int16_t q15_t; - - /** - * @brief 32-bit fractional data type in 1.31 format. - */ - typedef int32_t q31_t; - - /** - * @brief 64-bit fractional data type in 1.63 format. - */ - typedef int64_t q63_t; - - /** - * @brief 32-bit floating-point type definition. - */ - typedef float float32_t; - - /** - * @brief 64-bit floating-point type definition. - */ - typedef double float64_t; - - /** - * @brief definition to read/write two 16 bit values. - */ -#if defined __CC_ARM - #define __SIMD32_TYPE int32_t __packed - #define CMSIS_UNUSED __attribute__((unused)) -#elif defined __ICCARM__ - #define __SIMD32_TYPE int32_t __packed - #define CMSIS_UNUSED -#elif defined __GNUC__ - #define __SIMD32_TYPE int32_t - #define CMSIS_UNUSED __attribute__((unused)) -#elif defined __CSMC__ /* Cosmic */ - #define __SIMD32_TYPE int32_t - #define CMSIS_UNUSED -#elif defined __TASKING__ - #define __SIMD32_TYPE __unaligned int32_t - #define CMSIS_UNUSED -#else - #error Unknown compiler -#endif - -#define __SIMD32(addr) (*(__SIMD32_TYPE **) & (addr)) -#define __SIMD32_CONST(addr) ((__SIMD32_TYPE *)(addr)) - -#define _SIMD32_OFFSET(addr) (*(__SIMD32_TYPE *) (addr)) - -#define __SIMD64(addr) (*(int64_t **) & (addr)) - -#if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) - /** - * @brief definition to pack two 16 bit values. - */ -#define __PKHBT(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0x0000FFFF) | \ - (((int32_t)(ARG2) << ARG3) & (int32_t)0xFFFF0000) ) -#define __PKHTB(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0xFFFF0000) | \ - (((int32_t)(ARG2) >> ARG3) & (int32_t)0x0000FFFF) ) - -#endif - - - /** - * @brief definition to pack four 8 bit values. - */ -#ifndef ARM_MATH_BIG_ENDIAN - -#define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v0) << 0) & (int32_t)0x000000FF) | \ - (((int32_t)(v1) << 8) & (int32_t)0x0000FF00) | \ - (((int32_t)(v2) << 16) & (int32_t)0x00FF0000) | \ - (((int32_t)(v3) << 24) & (int32_t)0xFF000000) ) -#else - -#define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v3) << 0) & (int32_t)0x000000FF) | \ - (((int32_t)(v2) << 8) & (int32_t)0x0000FF00) | \ - (((int32_t)(v1) << 16) & (int32_t)0x00FF0000) | \ - (((int32_t)(v0) << 24) & (int32_t)0xFF000000) ) - -#endif - - - /** - * @brief Clips Q63 to Q31 values. - */ - static __INLINE q31_t clip_q63_to_q31( - q63_t x) - { - return ((q31_t) (x >> 32) != ((q31_t) x >> 31)) ? - ((0x7FFFFFFF ^ ((q31_t) (x >> 63)))) : (q31_t) x; - } - - /** - * @brief Clips Q63 to Q15 values. - */ - static __INLINE q15_t clip_q63_to_q15( - q63_t x) - { - return ((q31_t) (x >> 32) != ((q31_t) x >> 31)) ? - ((0x7FFF ^ ((q15_t) (x >> 63)))) : (q15_t) (x >> 15); - } - - /** - * @brief Clips Q31 to Q7 values. - */ - static __INLINE q7_t clip_q31_to_q7( - q31_t x) - { - return ((q31_t) (x >> 24) != ((q31_t) x >> 23)) ? - ((0x7F ^ ((q7_t) (x >> 31)))) : (q7_t) x; - } - - /** - * @brief Clips Q31 to Q15 values. - */ - static __INLINE q15_t clip_q31_to_q15( - q31_t x) - { - return ((q31_t) (x >> 16) != ((q31_t) x >> 15)) ? - ((0x7FFF ^ ((q15_t) (x >> 31)))) : (q15_t) x; - } - - /** - * @brief Multiplies 32 X 64 and returns 32 bit result in 2.30 format. - */ - - static __INLINE q63_t mult32x64( - q63_t x, - q31_t y) - { - return ((((q63_t) (x & 0x00000000FFFFFFFF) * y) >> 32) + - (((q63_t) (x >> 32) * y))); - } - - -//#if defined (ARM_MATH_CM0_FAMILY) && defined ( __CC_ARM ) -//#define __CLZ __clz -//#endif - -//note: function can be removed when all toolchain support __CLZ for Cortex-M0 -#if defined (ARM_MATH_CM0_FAMILY) && ((defined (__ICCARM__)) ) - - static __INLINE uint32_t __CLZ( - q31_t data); - - - static __INLINE uint32_t __CLZ( - q31_t data) - { - uint32_t count = 0; - uint32_t mask = 0x80000000; - - while((data & mask) == 0) - { - count += 1u; - mask = mask >> 1u; - } - - return (count); - - } - -#endif - - /** - * @brief Function to Calculates 1/in (reciprocal) value of Q31 Data type. - */ - - static __INLINE uint32_t arm_recip_q31( - q31_t in, - q31_t * dst, - q31_t * pRecipTable) - { - - uint32_t out, tempVal; - uint32_t index, i; - uint32_t signBits; - - if(in > 0) - { - signBits = __CLZ(in) - 1; - } - else - { - signBits = __CLZ(-in) - 1; - } - - /* Convert input sample to 1.31 format */ - in = in << signBits; - - /* calculation of index for initial approximated Val */ - index = (uint32_t) (in >> 24u); - index = (index & INDEX_MASK); - - /* 1.31 with exp 1 */ - out = pRecipTable[index]; - - /* calculation of reciprocal value */ - /* running approximation for two iterations */ - for (i = 0u; i < 2u; i++) - { - tempVal = (q31_t) (((q63_t) in * out) >> 31u); - tempVal = 0x7FFFFFFF - tempVal; - /* 1.31 with exp 1 */ - //out = (q31_t) (((q63_t) out * tempVal) >> 30u); - out = (q31_t) clip_q63_to_q31(((q63_t) out * tempVal) >> 30u); - } - - /* write output */ - *dst = out; - - /* return num of signbits of out = 1/in value */ - return (signBits + 1u); - - } - - /** - * @brief Function to Calculates 1/in (reciprocal) value of Q15 Data type. - */ - static __INLINE uint32_t arm_recip_q15( - q15_t in, - q15_t * dst, - q15_t * pRecipTable) - { - - uint32_t out = 0, tempVal = 0; - uint32_t index = 0, i = 0; - uint32_t signBits = 0; - - if(in > 0) - { - signBits = __CLZ(in) - 17; - } - else - { - signBits = __CLZ(-in) - 17; - } - - /* Convert input sample to 1.15 format */ - in = in << signBits; - - /* calculation of index for initial approximated Val */ - index = in >> 8; - index = (index & INDEX_MASK); - - /* 1.15 with exp 1 */ - out = pRecipTable[index]; - - /* calculation of reciprocal value */ - /* running approximation for two iterations */ - for (i = 0; i < 2; i++) - { - tempVal = (q15_t) (((q31_t) in * out) >> 15); - tempVal = 0x7FFF - tempVal; - /* 1.15 with exp 1 */ - out = (q15_t) (((q31_t) out * tempVal) >> 14); - } - - /* write output */ - *dst = out; - - /* return num of signbits of out = 1/in value */ - return (signBits + 1); - - } - - - /* - * @brief C custom defined intrinisic function for only M0 processors - */ -#if defined(ARM_MATH_CM0_FAMILY) - - static __INLINE q31_t __SSAT( - q31_t x, - uint32_t y) - { - int32_t posMax, negMin; - uint32_t i; - - posMax = 1; - for (i = 0; i < (y - 1); i++) - { - posMax = posMax * 2; - } - - if(x > 0) - { - posMax = (posMax - 1); - - if(x > posMax) - { - x = posMax; - } - } - else - { - negMin = -posMax; - - if(x < negMin) - { - x = negMin; - } - } - return (x); - - - } - -#endif /* end of ARM_MATH_CM0_FAMILY */ - - - - /* - * @brief C custom defined intrinsic function for M3 and M0 processors - */ -#if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) - - /* - * @brief C custom defined QADD8 for M3 and M0 processors - */ - static __INLINE q31_t __QADD8( - q31_t x, - q31_t y) - { - - q31_t sum; - q7_t r, s, t, u; - - r = (q7_t) x; - s = (q7_t) y; - - r = __SSAT((q31_t) (r + s), 8); - s = __SSAT(((q31_t) (((x << 16) >> 24) + ((y << 16) >> 24))), 8); - t = __SSAT(((q31_t) (((x << 8) >> 24) + ((y << 8) >> 24))), 8); - u = __SSAT(((q31_t) ((x >> 24) + (y >> 24))), 8); - - sum = - (((q31_t) u << 24) & 0xFF000000) | (((q31_t) t << 16) & 0x00FF0000) | - (((q31_t) s << 8) & 0x0000FF00) | (r & 0x000000FF); - - return sum; - - } - - /* - * @brief C custom defined QSUB8 for M3 and M0 processors - */ - static __INLINE q31_t __QSUB8( - q31_t x, - q31_t y) - { - - q31_t sum; - q31_t r, s, t, u; - - r = (q7_t) x; - s = (q7_t) y; - - r = __SSAT((r - s), 8); - s = __SSAT(((q31_t) (((x << 16) >> 24) - ((y << 16) >> 24))), 8) << 8; - t = __SSAT(((q31_t) (((x << 8) >> 24) - ((y << 8) >> 24))), 8) << 16; - u = __SSAT(((q31_t) ((x >> 24) - (y >> 24))), 8) << 24; - - sum = - (u & 0xFF000000) | (t & 0x00FF0000) | (s & 0x0000FF00) | (r & - 0x000000FF); - - return sum; - } - - /* - * @brief C custom defined QADD16 for M3 and M0 processors - */ - - /* - * @brief C custom defined QADD16 for M3 and M0 processors - */ - static __INLINE q31_t __QADD16( - q31_t x, - q31_t y) - { - - q31_t sum; - q31_t r, s; - - r = (q15_t) x; - s = (q15_t) y; - - r = __SSAT(r + s, 16); - s = __SSAT(((q31_t) ((x >> 16) + (y >> 16))), 16) << 16; - - sum = (s & 0xFFFF0000) | (r & 0x0000FFFF); - - return sum; - - } - - /* - * @brief C custom defined SHADD16 for M3 and M0 processors - */ - static __INLINE q31_t __SHADD16( - q31_t x, - q31_t y) - { - - q31_t sum; - q31_t r, s; - - r = (q15_t) x; - s = (q15_t) y; - - r = ((r >> 1) + (s >> 1)); - s = ((q31_t) ((x >> 17) + (y >> 17))) << 16; - - sum = (s & 0xFFFF0000) | (r & 0x0000FFFF); - - return sum; - - } - - /* - * @brief C custom defined QSUB16 for M3 and M0 processors - */ - static __INLINE q31_t __QSUB16( - q31_t x, - q31_t y) - { - - q31_t sum; - q31_t r, s; - - r = (q15_t) x; - s = (q15_t) y; - - r = __SSAT(r - s, 16); - s = __SSAT(((q31_t) ((x >> 16) - (y >> 16))), 16) << 16; - - sum = (s & 0xFFFF0000) | (r & 0x0000FFFF); - - return sum; - } - - /* - * @brief C custom defined SHSUB16 for M3 and M0 processors - */ - static __INLINE q31_t __SHSUB16( - q31_t x, - q31_t y) - { - - q31_t diff; - q31_t r, s; - - r = (q15_t) x; - s = (q15_t) y; - - r = ((r >> 1) - (s >> 1)); - s = (((x >> 17) - (y >> 17)) << 16); - - diff = (s & 0xFFFF0000) | (r & 0x0000FFFF); - - return diff; - } - - /* - * @brief C custom defined QASX for M3 and M0 processors - */ - static __INLINE q31_t __QASX( - q31_t x, - q31_t y) - { - - q31_t sum = 0; - - sum = - ((sum + - clip_q31_to_q15((q31_t) ((q15_t) (x >> 16) + (q15_t) y))) << 16) + - clip_q31_to_q15((q31_t) ((q15_t) x - (q15_t) (y >> 16))); - - return sum; - } - - /* - * @brief C custom defined SHASX for M3 and M0 processors - */ - static __INLINE q31_t __SHASX( - q31_t x, - q31_t y) - { - - q31_t sum; - q31_t r, s; - - r = (q15_t) x; - s = (q15_t) y; - - r = ((r >> 1) - (y >> 17)); - s = (((x >> 17) + (s >> 1)) << 16); - - sum = (s & 0xFFFF0000) | (r & 0x0000FFFF); - - return sum; - } - - - /* - * @brief C custom defined QSAX for M3 and M0 processors - */ - static __INLINE q31_t __QSAX( - q31_t x, - q31_t y) - { - - q31_t sum = 0; - - sum = - ((sum + - clip_q31_to_q15((q31_t) ((q15_t) (x >> 16) - (q15_t) y))) << 16) + - clip_q31_to_q15((q31_t) ((q15_t) x + (q15_t) (y >> 16))); - - return sum; - } - - /* - * @brief C custom defined SHSAX for M3 and M0 processors - */ - static __INLINE q31_t __SHSAX( - q31_t x, - q31_t y) - { - - q31_t sum; - q31_t r, s; - - r = (q15_t) x; - s = (q15_t) y; - - r = ((r >> 1) + (y >> 17)); - s = (((x >> 17) - (s >> 1)) << 16); - - sum = (s & 0xFFFF0000) | (r & 0x0000FFFF); - - return sum; - } - - /* - * @brief C custom defined SMUSDX for M3 and M0 processors - */ - static __INLINE q31_t __SMUSDX( - q31_t x, - q31_t y) - { - - return ((q31_t) (((q15_t) x * (q15_t) (y >> 16)) - - ((q15_t) (x >> 16) * (q15_t) y))); - } - - /* - * @brief C custom defined SMUADX for M3 and M0 processors - */ - static __INLINE q31_t __SMUADX( - q31_t x, - q31_t y) - { - - return ((q31_t) (((q15_t) x * (q15_t) (y >> 16)) + - ((q15_t) (x >> 16) * (q15_t) y))); - } - - /* - * @brief C custom defined QADD for M3 and M0 processors - */ - static __INLINE q31_t __QADD( - q31_t x, - q31_t y) - { - return clip_q63_to_q31((q63_t) x + y); - } - - /* - * @brief C custom defined QSUB for M3 and M0 processors - */ - static __INLINE q31_t __QSUB( - q31_t x, - q31_t y) - { - return clip_q63_to_q31((q63_t) x - y); - } - - /* - * @brief C custom defined SMLAD for M3 and M0 processors - */ - static __INLINE q31_t __SMLAD( - q31_t x, - q31_t y, - q31_t sum) - { - - return (sum + ((q15_t) (x >> 16) * (q15_t) (y >> 16)) + - ((q15_t) x * (q15_t) y)); - } - - /* - * @brief C custom defined SMLADX for M3 and M0 processors - */ - static __INLINE q31_t __SMLADX( - q31_t x, - q31_t y, - q31_t sum) - { - - return (sum + ((q15_t) (x >> 16) * (q15_t) (y)) + - ((q15_t) x * (q15_t) (y >> 16))); - } - - /* - * @brief C custom defined SMLSDX for M3 and M0 processors - */ - static __INLINE q31_t __SMLSDX( - q31_t x, - q31_t y, - q31_t sum) - { - - return (sum - ((q15_t) (x >> 16) * (q15_t) (y)) + - ((q15_t) x * (q15_t) (y >> 16))); - } - - /* - * @brief C custom defined SMLALD for M3 and M0 processors - */ - static __INLINE q63_t __SMLALD( - q31_t x, - q31_t y, - q63_t sum) - { - - return (sum + ((q15_t) (x >> 16) * (q15_t) (y >> 16)) + - ((q15_t) x * (q15_t) y)); - } - - /* - * @brief C custom defined SMLALDX for M3 and M0 processors - */ - static __INLINE q63_t __SMLALDX( - q31_t x, - q31_t y, - q63_t sum) - { - - return (sum + ((q15_t) (x >> 16) * (q15_t) y)) + - ((q15_t) x * (q15_t) (y >> 16)); - } - - /* - * @brief C custom defined SMUAD for M3 and M0 processors - */ - static __INLINE q31_t __SMUAD( - q31_t x, - q31_t y) - { - - return (((x >> 16) * (y >> 16)) + - (((x << 16) >> 16) * ((y << 16) >> 16))); - } - - /* - * @brief C custom defined SMUSD for M3 and M0 processors - */ - static __INLINE q31_t __SMUSD( - q31_t x, - q31_t y) - { - - return (-((x >> 16) * (y >> 16)) + - (((x << 16) >> 16) * ((y << 16) >> 16))); - } - - - /* - * @brief C custom defined SXTB16 for M3 and M0 processors - */ - static __INLINE q31_t __SXTB16( - q31_t x) - { - - return ((((x << 24) >> 24) & 0x0000FFFF) | - (((x << 8) >> 8) & 0xFFFF0000)); - } - - -#endif /* defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) */ - - - /** - * @brief Instance structure for the Q7 FIR filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of filter coefficients in the filter. */ - q7_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - } arm_fir_instance_q7; - - /** - * @brief Instance structure for the Q15 FIR filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of filter coefficients in the filter. */ - q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - } arm_fir_instance_q15; - - /** - * @brief Instance structure for the Q31 FIR filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of filter coefficients in the filter. */ - q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - } arm_fir_instance_q31; - - /** - * @brief Instance structure for the floating-point FIR filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of filter coefficients in the filter. */ - float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - } arm_fir_instance_f32; - - - /** - * @brief Processing function for the Q7 FIR filter. - * @param[in] *S points to an instance of the Q7 FIR filter structure. - * @param[in] *pSrc points to the block of input data. - * @param[out] *pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - * @return none. - */ - void arm_fir_q7( - const arm_fir_instance_q7 * S, - q7_t * pSrc, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q7 FIR filter. - * @param[in,out] *S points to an instance of the Q7 FIR structure. - * @param[in] numTaps Number of filter coefficients in the filter. - * @param[in] *pCoeffs points to the filter coefficients. - * @param[in] *pState points to the state buffer. - * @param[in] blockSize number of samples that are processed. - * @return none - */ - void arm_fir_init_q7( - arm_fir_instance_q7 * S, - uint16_t numTaps, - q7_t * pCoeffs, - q7_t * pState, - uint32_t blockSize); - - - /** - * @brief Processing function for the Q15 FIR filter. - * @param[in] *S points to an instance of the Q15 FIR structure. - * @param[in] *pSrc points to the block of input data. - * @param[out] *pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - * @return none. - */ - void arm_fir_q15( - const arm_fir_instance_q15 * S, - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - /** - * @brief Processing function for the fast Q15 FIR filter for Cortex-M3 and Cortex-M4. - * @param[in] *S points to an instance of the Q15 FIR filter structure. - * @param[in] *pSrc points to the block of input data. - * @param[out] *pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - * @return none. - */ - void arm_fir_fast_q15( - const arm_fir_instance_q15 * S, - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - /** - * @brief Initialization function for the Q15 FIR filter. - * @param[in,out] *S points to an instance of the Q15 FIR filter structure. - * @param[in] numTaps Number of filter coefficients in the filter. Must be even and greater than or equal to 4. - * @param[in] *pCoeffs points to the filter coefficients. - * @param[in] *pState points to the state buffer. - * @param[in] blockSize number of samples that are processed at a time. - * @return The function returns ARM_MATH_SUCCESS if initialization was successful or ARM_MATH_ARGUMENT_ERROR if - * numTaps is not a supported value. - */ - - arm_status arm_fir_init_q15( - arm_fir_instance_q15 * S, - uint16_t numTaps, - q15_t * pCoeffs, - q15_t * pState, - uint32_t blockSize); - - /** - * @brief Processing function for the Q31 FIR filter. - * @param[in] *S points to an instance of the Q31 FIR filter structure. - * @param[in] *pSrc points to the block of input data. - * @param[out] *pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - * @return none. - */ - void arm_fir_q31( - const arm_fir_instance_q31 * S, - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - /** - * @brief Processing function for the fast Q31 FIR filter for Cortex-M3 and Cortex-M4. - * @param[in] *S points to an instance of the Q31 FIR structure. - * @param[in] *pSrc points to the block of input data. - * @param[out] *pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - * @return none. - */ - void arm_fir_fast_q31( - const arm_fir_instance_q31 * S, - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - /** - * @brief Initialization function for the Q31 FIR filter. - * @param[in,out] *S points to an instance of the Q31 FIR structure. - * @param[in] numTaps Number of filter coefficients in the filter. - * @param[in] *pCoeffs points to the filter coefficients. - * @param[in] *pState points to the state buffer. - * @param[in] blockSize number of samples that are processed at a time. - * @return none. - */ - void arm_fir_init_q31( - arm_fir_instance_q31 * S, - uint16_t numTaps, - q31_t * pCoeffs, - q31_t * pState, - uint32_t blockSize); - - /** - * @brief Processing function for the floating-point FIR filter. - * @param[in] *S points to an instance of the floating-point FIR structure. - * @param[in] *pSrc points to the block of input data. - * @param[out] *pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - * @return none. - */ - void arm_fir_f32( - const arm_fir_instance_f32 * S, - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - /** - * @brief Initialization function for the floating-point FIR filter. - * @param[in,out] *S points to an instance of the floating-point FIR filter structure. - * @param[in] numTaps Number of filter coefficients in the filter. - * @param[in] *pCoeffs points to the filter coefficients. - * @param[in] *pState points to the state buffer. - * @param[in] blockSize number of samples that are processed at a time. - * @return none. - */ - void arm_fir_init_f32( - arm_fir_instance_f32 * S, - uint16_t numTaps, - float32_t * pCoeffs, - float32_t * pState, - uint32_t blockSize); - - - /** - * @brief Instance structure for the Q15 Biquad cascade filter. - */ - typedef struct - { - int8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - q15_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */ - q15_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */ - int8_t postShift; /**< Additional shift, in bits, applied to each output sample. */ - - } arm_biquad_casd_df1_inst_q15; - - - /** - * @brief Instance structure for the Q31 Biquad cascade filter. - */ - typedef struct - { - uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - q31_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */ - q31_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */ - uint8_t postShift; /**< Additional shift, in bits, applied to each output sample. */ - - } arm_biquad_casd_df1_inst_q31; - - /** - * @brief Instance structure for the floating-point Biquad cascade filter. - */ - typedef struct - { - uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - float32_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */ - float32_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */ - - - } arm_biquad_casd_df1_inst_f32; - - - - /** - * @brief Processing function for the Q15 Biquad cascade filter. - * @param[in] *S points to an instance of the Q15 Biquad cascade structure. - * @param[in] *pSrc points to the block of input data. - * @param[out] *pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - * @return none. - */ - - void arm_biquad_cascade_df1_q15( - const arm_biquad_casd_df1_inst_q15 * S, - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - /** - * @brief Initialization function for the Q15 Biquad cascade filter. - * @param[in,out] *S points to an instance of the Q15 Biquad cascade structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] *pCoeffs points to the filter coefficients. - * @param[in] *pState points to the state buffer. - * @param[in] postShift Shift to be applied to the output. Varies according to the coefficients format - * @return none - */ - - void arm_biquad_cascade_df1_init_q15( - arm_biquad_casd_df1_inst_q15 * S, - uint8_t numStages, - q15_t * pCoeffs, - q15_t * pState, - int8_t postShift); - - - /** - * @brief Fast but less precise processing function for the Q15 Biquad cascade filter for Cortex-M3 and Cortex-M4. - * @param[in] *S points to an instance of the Q15 Biquad cascade structure. - * @param[in] *pSrc points to the block of input data. - * @param[out] *pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - * @return none. - */ - - void arm_biquad_cascade_df1_fast_q15( - const arm_biquad_casd_df1_inst_q15 * S, - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Processing function for the Q31 Biquad cascade filter - * @param[in] *S points to an instance of the Q31 Biquad cascade structure. - * @param[in] *pSrc points to the block of input data. - * @param[out] *pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - * @return none. - */ - - void arm_biquad_cascade_df1_q31( - const arm_biquad_casd_df1_inst_q31 * S, - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - /** - * @brief Fast but less precise processing function for the Q31 Biquad cascade filter for Cortex-M3 and Cortex-M4. - * @param[in] *S points to an instance of the Q31 Biquad cascade structure. - * @param[in] *pSrc points to the block of input data. - * @param[out] *pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - * @return none. - */ - - void arm_biquad_cascade_df1_fast_q31( - const arm_biquad_casd_df1_inst_q31 * S, - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - /** - * @brief Initialization function for the Q31 Biquad cascade filter. - * @param[in,out] *S points to an instance of the Q31 Biquad cascade structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] *pCoeffs points to the filter coefficients. - * @param[in] *pState points to the state buffer. - * @param[in] postShift Shift to be applied to the output. Varies according to the coefficients format - * @return none - */ - - void arm_biquad_cascade_df1_init_q31( - arm_biquad_casd_df1_inst_q31 * S, - uint8_t numStages, - q31_t * pCoeffs, - q31_t * pState, - int8_t postShift); - - /** - * @brief Processing function for the floating-point Biquad cascade filter. - * @param[in] *S points to an instance of the floating-point Biquad cascade structure. - * @param[in] *pSrc points to the block of input data. - * @param[out] *pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - * @return none. - */ - - void arm_biquad_cascade_df1_f32( - const arm_biquad_casd_df1_inst_f32 * S, - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - /** - * @brief Initialization function for the floating-point Biquad cascade filter. - * @param[in,out] *S points to an instance of the floating-point Biquad cascade structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] *pCoeffs points to the filter coefficients. - * @param[in] *pState points to the state buffer. - * @return none - */ - - void arm_biquad_cascade_df1_init_f32( - arm_biquad_casd_df1_inst_f32 * S, - uint8_t numStages, - float32_t * pCoeffs, - float32_t * pState); - - - /** - * @brief Instance structure for the floating-point matrix structure. - */ - - typedef struct - { - uint16_t numRows; /**< number of rows of the matrix. */ - uint16_t numCols; /**< number of columns of the matrix. */ - float32_t *pData; /**< points to the data of the matrix. */ - } arm_matrix_instance_f32; - - - /** - * @brief Instance structure for the floating-point matrix structure. - */ - - typedef struct - { - uint16_t numRows; /**< number of rows of the matrix. */ - uint16_t numCols; /**< number of columns of the matrix. */ - float64_t *pData; /**< points to the data of the matrix. */ - } arm_matrix_instance_f64; - - /** - * @brief Instance structure for the Q15 matrix structure. - */ - - typedef struct - { - uint16_t numRows; /**< number of rows of the matrix. */ - uint16_t numCols; /**< number of columns of the matrix. */ - q15_t *pData; /**< points to the data of the matrix. */ - - } arm_matrix_instance_q15; - - /** - * @brief Instance structure for the Q31 matrix structure. - */ - - typedef struct - { - uint16_t numRows; /**< number of rows of the matrix. */ - uint16_t numCols; /**< number of columns of the matrix. */ - q31_t *pData; /**< points to the data of the matrix. */ - - } arm_matrix_instance_q31; - - - - /** - * @brief Floating-point matrix addition. - * @param[in] *pSrcA points to the first input matrix structure - * @param[in] *pSrcB points to the second input matrix structure - * @param[out] *pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - - arm_status arm_mat_add_f32( - const arm_matrix_instance_f32 * pSrcA, - const arm_matrix_instance_f32 * pSrcB, - arm_matrix_instance_f32 * pDst); - - /** - * @brief Q15 matrix addition. - * @param[in] *pSrcA points to the first input matrix structure - * @param[in] *pSrcB points to the second input matrix structure - * @param[out] *pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - - arm_status arm_mat_add_q15( - const arm_matrix_instance_q15 * pSrcA, - const arm_matrix_instance_q15 * pSrcB, - arm_matrix_instance_q15 * pDst); - - /** - * @brief Q31 matrix addition. - * @param[in] *pSrcA points to the first input matrix structure - * @param[in] *pSrcB points to the second input matrix structure - * @param[out] *pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - - arm_status arm_mat_add_q31( - const arm_matrix_instance_q31 * pSrcA, - const arm_matrix_instance_q31 * pSrcB, - arm_matrix_instance_q31 * pDst); - - /** - * @brief Floating-point, complex, matrix multiplication. - * @param[in] *pSrcA points to the first input matrix structure - * @param[in] *pSrcB points to the second input matrix structure - * @param[out] *pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - - arm_status arm_mat_cmplx_mult_f32( - const arm_matrix_instance_f32 * pSrcA, - const arm_matrix_instance_f32 * pSrcB, - arm_matrix_instance_f32 * pDst); - - /** - * @brief Q15, complex, matrix multiplication. - * @param[in] *pSrcA points to the first input matrix structure - * @param[in] *pSrcB points to the second input matrix structure - * @param[out] *pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - - arm_status arm_mat_cmplx_mult_q15( - const arm_matrix_instance_q15 * pSrcA, - const arm_matrix_instance_q15 * pSrcB, - arm_matrix_instance_q15 * pDst, - q15_t * pScratch); - - /** - * @brief Q31, complex, matrix multiplication. - * @param[in] *pSrcA points to the first input matrix structure - * @param[in] *pSrcB points to the second input matrix structure - * @param[out] *pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - - arm_status arm_mat_cmplx_mult_q31( - const arm_matrix_instance_q31 * pSrcA, - const arm_matrix_instance_q31 * pSrcB, - arm_matrix_instance_q31 * pDst); - - - /** - * @brief Floating-point matrix transpose. - * @param[in] *pSrc points to the input matrix - * @param[out] *pDst points to the output matrix - * @return The function returns either ARM_MATH_SIZE_MISMATCH - * or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - - arm_status arm_mat_trans_f32( - const arm_matrix_instance_f32 * pSrc, - arm_matrix_instance_f32 * pDst); - - - /** - * @brief Q15 matrix transpose. - * @param[in] *pSrc points to the input matrix - * @param[out] *pDst points to the output matrix - * @return The function returns either ARM_MATH_SIZE_MISMATCH - * or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - - arm_status arm_mat_trans_q15( - const arm_matrix_instance_q15 * pSrc, - arm_matrix_instance_q15 * pDst); - - /** - * @brief Q31 matrix transpose. - * @param[in] *pSrc points to the input matrix - * @param[out] *pDst points to the output matrix - * @return The function returns either ARM_MATH_SIZE_MISMATCH - * or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - - arm_status arm_mat_trans_q31( - const arm_matrix_instance_q31 * pSrc, - arm_matrix_instance_q31 * pDst); - - - /** - * @brief Floating-point matrix multiplication - * @param[in] *pSrcA points to the first input matrix structure - * @param[in] *pSrcB points to the second input matrix structure - * @param[out] *pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - - arm_status arm_mat_mult_f32( - const arm_matrix_instance_f32 * pSrcA, - const arm_matrix_instance_f32 * pSrcB, - arm_matrix_instance_f32 * pDst); - - /** - * @brief Q15 matrix multiplication - * @param[in] *pSrcA points to the first input matrix structure - * @param[in] *pSrcB points to the second input matrix structure - * @param[out] *pDst points to output matrix structure - * @param[in] *pState points to the array for storing intermediate results - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - - arm_status arm_mat_mult_q15( - const arm_matrix_instance_q15 * pSrcA, - const arm_matrix_instance_q15 * pSrcB, - arm_matrix_instance_q15 * pDst, - q15_t * pState); - - /** - * @brief Q15 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4 - * @param[in] *pSrcA points to the first input matrix structure - * @param[in] *pSrcB points to the second input matrix structure - * @param[out] *pDst points to output matrix structure - * @param[in] *pState points to the array for storing intermediate results - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - - arm_status arm_mat_mult_fast_q15( - const arm_matrix_instance_q15 * pSrcA, - const arm_matrix_instance_q15 * pSrcB, - arm_matrix_instance_q15 * pDst, - q15_t * pState); - - /** - * @brief Q31 matrix multiplication - * @param[in] *pSrcA points to the first input matrix structure - * @param[in] *pSrcB points to the second input matrix structure - * @param[out] *pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - - arm_status arm_mat_mult_q31( - const arm_matrix_instance_q31 * pSrcA, - const arm_matrix_instance_q31 * pSrcB, - arm_matrix_instance_q31 * pDst); - - /** - * @brief Q31 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4 - * @param[in] *pSrcA points to the first input matrix structure - * @param[in] *pSrcB points to the second input matrix structure - * @param[out] *pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - - arm_status arm_mat_mult_fast_q31( - const arm_matrix_instance_q31 * pSrcA, - const arm_matrix_instance_q31 * pSrcB, - arm_matrix_instance_q31 * pDst); - - - /** - * @brief Floating-point matrix subtraction - * @param[in] *pSrcA points to the first input matrix structure - * @param[in] *pSrcB points to the second input matrix structure - * @param[out] *pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - - arm_status arm_mat_sub_f32( - const arm_matrix_instance_f32 * pSrcA, - const arm_matrix_instance_f32 * pSrcB, - arm_matrix_instance_f32 * pDst); - - /** - * @brief Q15 matrix subtraction - * @param[in] *pSrcA points to the first input matrix structure - * @param[in] *pSrcB points to the second input matrix structure - * @param[out] *pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - - arm_status arm_mat_sub_q15( - const arm_matrix_instance_q15 * pSrcA, - const arm_matrix_instance_q15 * pSrcB, - arm_matrix_instance_q15 * pDst); - - /** - * @brief Q31 matrix subtraction - * @param[in] *pSrcA points to the first input matrix structure - * @param[in] *pSrcB points to the second input matrix structure - * @param[out] *pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - - arm_status arm_mat_sub_q31( - const arm_matrix_instance_q31 * pSrcA, - const arm_matrix_instance_q31 * pSrcB, - arm_matrix_instance_q31 * pDst); - - /** - * @brief Floating-point matrix scaling. - * @param[in] *pSrc points to the input matrix - * @param[in] scale scale factor - * @param[out] *pDst points to the output matrix - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - - arm_status arm_mat_scale_f32( - const arm_matrix_instance_f32 * pSrc, - float32_t scale, - arm_matrix_instance_f32 * pDst); - - /** - * @brief Q15 matrix scaling. - * @param[in] *pSrc points to input matrix - * @param[in] scaleFract fractional portion of the scale factor - * @param[in] shift number of bits to shift the result by - * @param[out] *pDst points to output matrix - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - - arm_status arm_mat_scale_q15( - const arm_matrix_instance_q15 * pSrc, - q15_t scaleFract, - int32_t shift, - arm_matrix_instance_q15 * pDst); - - /** - * @brief Q31 matrix scaling. - * @param[in] *pSrc points to input matrix - * @param[in] scaleFract fractional portion of the scale factor - * @param[in] shift number of bits to shift the result by - * @param[out] *pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - - arm_status arm_mat_scale_q31( - const arm_matrix_instance_q31 * pSrc, - q31_t scaleFract, - int32_t shift, - arm_matrix_instance_q31 * pDst); - - - /** - * @brief Q31 matrix initialization. - * @param[in,out] *S points to an instance of the floating-point matrix structure. - * @param[in] nRows number of rows in the matrix. - * @param[in] nColumns number of columns in the matrix. - * @param[in] *pData points to the matrix data array. - * @return none - */ - - void arm_mat_init_q31( - arm_matrix_instance_q31 * S, - uint16_t nRows, - uint16_t nColumns, - q31_t * pData); - - /** - * @brief Q15 matrix initialization. - * @param[in,out] *S points to an instance of the floating-point matrix structure. - * @param[in] nRows number of rows in the matrix. - * @param[in] nColumns number of columns in the matrix. - * @param[in] *pData points to the matrix data array. - * @return none - */ - - void arm_mat_init_q15( - arm_matrix_instance_q15 * S, - uint16_t nRows, - uint16_t nColumns, - q15_t * pData); - - /** - * @brief Floating-point matrix initialization. - * @param[in,out] *S points to an instance of the floating-point matrix structure. - * @param[in] nRows number of rows in the matrix. - * @param[in] nColumns number of columns in the matrix. - * @param[in] *pData points to the matrix data array. - * @return none - */ - - void arm_mat_init_f32( - arm_matrix_instance_f32 * S, - uint16_t nRows, - uint16_t nColumns, - float32_t * pData); - - - - /** - * @brief Instance structure for the Q15 PID Control. - */ - typedef struct - { - q15_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */ -#ifdef ARM_MATH_CM0_FAMILY - q15_t A1; - q15_t A2; -#else - q31_t A1; /**< The derived gain A1 = -Kp - 2Kd | Kd.*/ -#endif - q15_t state[3]; /**< The state array of length 3. */ - q15_t Kp; /**< The proportional gain. */ - q15_t Ki; /**< The integral gain. */ - q15_t Kd; /**< The derivative gain. */ - } arm_pid_instance_q15; - - /** - * @brief Instance structure for the Q31 PID Control. - */ - typedef struct - { - q31_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */ - q31_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */ - q31_t A2; /**< The derived gain, A2 = Kd . */ - q31_t state[3]; /**< The state array of length 3. */ - q31_t Kp; /**< The proportional gain. */ - q31_t Ki; /**< The integral gain. */ - q31_t Kd; /**< The derivative gain. */ - - } arm_pid_instance_q31; - - /** - * @brief Instance structure for the floating-point PID Control. - */ - typedef struct - { - float32_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */ - float32_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */ - float32_t A2; /**< The derived gain, A2 = Kd . */ - float32_t state[3]; /**< The state array of length 3. */ - float32_t Kp; /**< The proportional gain. */ - float32_t Ki; /**< The integral gain. */ - float32_t Kd; /**< The derivative gain. */ - } arm_pid_instance_f32; - - - - /** - * @brief Initialization function for the floating-point PID Control. - * @param[in,out] *S points to an instance of the PID structure. - * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state. - * @return none. - */ - void arm_pid_init_f32( - arm_pid_instance_f32 * S, - int32_t resetStateFlag); - - /** - * @brief Reset function for the floating-point PID Control. - * @param[in,out] *S is an instance of the floating-point PID Control structure - * @return none - */ - void arm_pid_reset_f32( - arm_pid_instance_f32 * S); - - - /** - * @brief Initialization function for the Q31 PID Control. - * @param[in,out] *S points to an instance of the Q15 PID structure. - * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state. - * @return none. - */ - void arm_pid_init_q31( - arm_pid_instance_q31 * S, - int32_t resetStateFlag); - - - /** - * @brief Reset function for the Q31 PID Control. - * @param[in,out] *S points to an instance of the Q31 PID Control structure - * @return none - */ - - void arm_pid_reset_q31( - arm_pid_instance_q31 * S); - - /** - * @brief Initialization function for the Q15 PID Control. - * @param[in,out] *S points to an instance of the Q15 PID structure. - * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state. - * @return none. - */ - void arm_pid_init_q15( - arm_pid_instance_q15 * S, - int32_t resetStateFlag); - - /** - * @brief Reset function for the Q15 PID Control. - * @param[in,out] *S points to an instance of the q15 PID Control structure - * @return none - */ - void arm_pid_reset_q15( - arm_pid_instance_q15 * S); - - - /** - * @brief Instance structure for the floating-point Linear Interpolate function. - */ - typedef struct - { - uint32_t nValues; /**< nValues */ - float32_t x1; /**< x1 */ - float32_t xSpacing; /**< xSpacing */ - float32_t *pYData; /**< pointer to the table of Y values */ - } arm_linear_interp_instance_f32; - - /** - * @brief Instance structure for the floating-point bilinear interpolation function. - */ - - typedef struct - { - uint16_t numRows; /**< number of rows in the data table. */ - uint16_t numCols; /**< number of columns in the data table. */ - float32_t *pData; /**< points to the data table. */ - } arm_bilinear_interp_instance_f32; - - /** - * @brief Instance structure for the Q31 bilinear interpolation function. - */ - - typedef struct - { - uint16_t numRows; /**< number of rows in the data table. */ - uint16_t numCols; /**< number of columns in the data table. */ - q31_t *pData; /**< points to the data table. */ - } arm_bilinear_interp_instance_q31; - - /** - * @brief Instance structure for the Q15 bilinear interpolation function. - */ - - typedef struct - { - uint16_t numRows; /**< number of rows in the data table. */ - uint16_t numCols; /**< number of columns in the data table. */ - q15_t *pData; /**< points to the data table. */ - } arm_bilinear_interp_instance_q15; - - /** - * @brief Instance structure for the Q15 bilinear interpolation function. - */ - - typedef struct - { - uint16_t numRows; /**< number of rows in the data table. */ - uint16_t numCols; /**< number of columns in the data table. */ - q7_t *pData; /**< points to the data table. */ - } arm_bilinear_interp_instance_q7; - - - /** - * @brief Q7 vector multiplication. - * @param[in] *pSrcA points to the first input vector - * @param[in] *pSrcB points to the second input vector - * @param[out] *pDst points to the output vector - * @param[in] blockSize number of samples in each vector - * @return none. - */ - - void arm_mult_q7( - q7_t * pSrcA, - q7_t * pSrcB, - q7_t * pDst, - uint32_t blockSize); - - /** - * @brief Q15 vector multiplication. - * @param[in] *pSrcA points to the first input vector - * @param[in] *pSrcB points to the second input vector - * @param[out] *pDst points to the output vector - * @param[in] blockSize number of samples in each vector - * @return none. - */ - - void arm_mult_q15( - q15_t * pSrcA, - q15_t * pSrcB, - q15_t * pDst, - uint32_t blockSize); - - /** - * @brief Q31 vector multiplication. - * @param[in] *pSrcA points to the first input vector - * @param[in] *pSrcB points to the second input vector - * @param[out] *pDst points to the output vector - * @param[in] blockSize number of samples in each vector - * @return none. - */ - - void arm_mult_q31( - q31_t * pSrcA, - q31_t * pSrcB, - q31_t * pDst, - uint32_t blockSize); - - /** - * @brief Floating-point vector multiplication. - * @param[in] *pSrcA points to the first input vector - * @param[in] *pSrcB points to the second input vector - * @param[out] *pDst points to the output vector - * @param[in] blockSize number of samples in each vector - * @return none. - */ - - void arm_mult_f32( - float32_t * pSrcA, - float32_t * pSrcB, - float32_t * pDst, - uint32_t blockSize); - - - - - - - /** - * @brief Instance structure for the Q15 CFFT/CIFFT function. - */ - - typedef struct - { - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - q15_t *pTwiddle; /**< points to the Sin twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ - } arm_cfft_radix2_instance_q15; - -/* Deprecated */ - arm_status arm_cfft_radix2_init_q15( - arm_cfft_radix2_instance_q15 * S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/* Deprecated */ - void arm_cfft_radix2_q15( - const arm_cfft_radix2_instance_q15 * S, - q15_t * pSrc); - - - - /** - * @brief Instance structure for the Q15 CFFT/CIFFT function. - */ - - typedef struct - { - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - q15_t *pTwiddle; /**< points to the twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ - } arm_cfft_radix4_instance_q15; - -/* Deprecated */ - arm_status arm_cfft_radix4_init_q15( - arm_cfft_radix4_instance_q15 * S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/* Deprecated */ - void arm_cfft_radix4_q15( - const arm_cfft_radix4_instance_q15 * S, - q15_t * pSrc); - - /** - * @brief Instance structure for the Radix-2 Q31 CFFT/CIFFT function. - */ - - typedef struct - { - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - q31_t *pTwiddle; /**< points to the Twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ - } arm_cfft_radix2_instance_q31; - -/* Deprecated */ - arm_status arm_cfft_radix2_init_q31( - arm_cfft_radix2_instance_q31 * S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/* Deprecated */ - void arm_cfft_radix2_q31( - const arm_cfft_radix2_instance_q31 * S, - q31_t * pSrc); - - /** - * @brief Instance structure for the Q31 CFFT/CIFFT function. - */ - - typedef struct - { - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - q31_t *pTwiddle; /**< points to the twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ - } arm_cfft_radix4_instance_q31; - -/* Deprecated */ - void arm_cfft_radix4_q31( - const arm_cfft_radix4_instance_q31 * S, - q31_t * pSrc); - -/* Deprecated */ - arm_status arm_cfft_radix4_init_q31( - arm_cfft_radix4_instance_q31 * S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - - /** - * @brief Instance structure for the floating-point CFFT/CIFFT function. - */ - - typedef struct - { - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - float32_t *pTwiddle; /**< points to the Twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ - float32_t onebyfftLen; /**< value of 1/fftLen. */ - } arm_cfft_radix2_instance_f32; - -/* Deprecated */ - arm_status arm_cfft_radix2_init_f32( - arm_cfft_radix2_instance_f32 * S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/* Deprecated */ - void arm_cfft_radix2_f32( - const arm_cfft_radix2_instance_f32 * S, - float32_t * pSrc); - - /** - * @brief Instance structure for the floating-point CFFT/CIFFT function. - */ - - typedef struct - { - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - float32_t *pTwiddle; /**< points to the Twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ - float32_t onebyfftLen; /**< value of 1/fftLen. */ - } arm_cfft_radix4_instance_f32; - -/* Deprecated */ - arm_status arm_cfft_radix4_init_f32( - arm_cfft_radix4_instance_f32 * S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/* Deprecated */ - void arm_cfft_radix4_f32( - const arm_cfft_radix4_instance_f32 * S, - float32_t * pSrc); - - /** - * @brief Instance structure for the fixed-point CFFT/CIFFT function. - */ - - typedef struct - { - uint16_t fftLen; /**< length of the FFT. */ - const q15_t *pTwiddle; /**< points to the Twiddle factor table. */ - const uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t bitRevLength; /**< bit reversal table length. */ - } arm_cfft_instance_q15; - -void arm_cfft_q15( - const arm_cfft_instance_q15 * S, - q15_t * p1, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - - /** - * @brief Instance structure for the fixed-point CFFT/CIFFT function. - */ - - typedef struct - { - uint16_t fftLen; /**< length of the FFT. */ - const q31_t *pTwiddle; /**< points to the Twiddle factor table. */ - const uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t bitRevLength; /**< bit reversal table length. */ - } arm_cfft_instance_q31; - -void arm_cfft_q31( - const arm_cfft_instance_q31 * S, - q31_t * p1, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - - /** - * @brief Instance structure for the floating-point CFFT/CIFFT function. - */ - - typedef struct - { - uint16_t fftLen; /**< length of the FFT. */ - const float32_t *pTwiddle; /**< points to the Twiddle factor table. */ - const uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t bitRevLength; /**< bit reversal table length. */ - } arm_cfft_instance_f32; - - void arm_cfft_f32( - const arm_cfft_instance_f32 * S, - float32_t * p1, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - - /** - * @brief Instance structure for the Q15 RFFT/RIFFT function. - */ - - typedef struct - { - uint32_t fftLenReal; /**< length of the real FFT. */ - uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */ - uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */ - uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - q15_t *pTwiddleAReal; /**< points to the real twiddle factor table. */ - q15_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */ - const arm_cfft_instance_q15 *pCfft; /**< points to the complex FFT instance. */ - } arm_rfft_instance_q15; - - arm_status arm_rfft_init_q15( - arm_rfft_instance_q15 * S, - uint32_t fftLenReal, - uint32_t ifftFlagR, - uint32_t bitReverseFlag); - - void arm_rfft_q15( - const arm_rfft_instance_q15 * S, - q15_t * pSrc, - q15_t * pDst); - - /** - * @brief Instance structure for the Q31 RFFT/RIFFT function. - */ - - typedef struct - { - uint32_t fftLenReal; /**< length of the real FFT. */ - uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */ - uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */ - uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - q31_t *pTwiddleAReal; /**< points to the real twiddle factor table. */ - q31_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */ - const arm_cfft_instance_q31 *pCfft; /**< points to the complex FFT instance. */ - } arm_rfft_instance_q31; - - arm_status arm_rfft_init_q31( - arm_rfft_instance_q31 * S, - uint32_t fftLenReal, - uint32_t ifftFlagR, - uint32_t bitReverseFlag); - - void arm_rfft_q31( - const arm_rfft_instance_q31 * S, - q31_t * pSrc, - q31_t * pDst); - - /** - * @brief Instance structure for the floating-point RFFT/RIFFT function. - */ - - typedef struct - { - uint32_t fftLenReal; /**< length of the real FFT. */ - uint16_t fftLenBy2; /**< length of the complex FFT. */ - uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */ - uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */ - uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - float32_t *pTwiddleAReal; /**< points to the real twiddle factor table. */ - float32_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */ - arm_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */ - } arm_rfft_instance_f32; - - arm_status arm_rfft_init_f32( - arm_rfft_instance_f32 * S, - arm_cfft_radix4_instance_f32 * S_CFFT, - uint32_t fftLenReal, - uint32_t ifftFlagR, - uint32_t bitReverseFlag); - - void arm_rfft_f32( - const arm_rfft_instance_f32 * S, - float32_t * pSrc, - float32_t * pDst); - - /** - * @brief Instance structure for the floating-point RFFT/RIFFT function. - */ - -typedef struct - { - arm_cfft_instance_f32 Sint; /**< Internal CFFT structure. */ - uint16_t fftLenRFFT; /**< length of the real sequence */ - float32_t * pTwiddleRFFT; /**< Twiddle factors real stage */ - } arm_rfft_fast_instance_f32 ; - -arm_status arm_rfft_fast_init_f32 ( - arm_rfft_fast_instance_f32 * S, - uint16_t fftLen); - -void arm_rfft_fast_f32( - arm_rfft_fast_instance_f32 * S, - float32_t * p, float32_t * pOut, - uint8_t ifftFlag); - - /** - * @brief Instance structure for the floating-point DCT4/IDCT4 function. - */ - - typedef struct - { - uint16_t N; /**< length of the DCT4. */ - uint16_t Nby2; /**< half of the length of the DCT4. */ - float32_t normalize; /**< normalizing factor. */ - float32_t *pTwiddle; /**< points to the twiddle factor table. */ - float32_t *pCosFactor; /**< points to the cosFactor table. */ - arm_rfft_instance_f32 *pRfft; /**< points to the real FFT instance. */ - arm_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */ - } arm_dct4_instance_f32; - - /** - * @brief Initialization function for the floating-point DCT4/IDCT4. - * @param[in,out] *S points to an instance of floating-point DCT4/IDCT4 structure. - * @param[in] *S_RFFT points to an instance of floating-point RFFT/RIFFT structure. - * @param[in] *S_CFFT points to an instance of floating-point CFFT/CIFFT structure. - * @param[in] N length of the DCT4. - * @param[in] Nby2 half of the length of the DCT4. - * @param[in] normalize normalizing factor. - * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if fftLenReal is not a supported transform length. - */ - - arm_status arm_dct4_init_f32( - arm_dct4_instance_f32 * S, - arm_rfft_instance_f32 * S_RFFT, - arm_cfft_radix4_instance_f32 * S_CFFT, - uint16_t N, - uint16_t Nby2, - float32_t normalize); - - /** - * @brief Processing function for the floating-point DCT4/IDCT4. - * @param[in] *S points to an instance of the floating-point DCT4/IDCT4 structure. - * @param[in] *pState points to state buffer. - * @param[in,out] *pInlineBuffer points to the in-place input and output buffer. - * @return none. - */ - - void arm_dct4_f32( - const arm_dct4_instance_f32 * S, - float32_t * pState, - float32_t * pInlineBuffer); - - /** - * @brief Instance structure for the Q31 DCT4/IDCT4 function. - */ - - typedef struct - { - uint16_t N; /**< length of the DCT4. */ - uint16_t Nby2; /**< half of the length of the DCT4. */ - q31_t normalize; /**< normalizing factor. */ - q31_t *pTwiddle; /**< points to the twiddle factor table. */ - q31_t *pCosFactor; /**< points to the cosFactor table. */ - arm_rfft_instance_q31 *pRfft; /**< points to the real FFT instance. */ - arm_cfft_radix4_instance_q31 *pCfft; /**< points to the complex FFT instance. */ - } arm_dct4_instance_q31; - - /** - * @brief Initialization function for the Q31 DCT4/IDCT4. - * @param[in,out] *S points to an instance of Q31 DCT4/IDCT4 structure. - * @param[in] *S_RFFT points to an instance of Q31 RFFT/RIFFT structure - * @param[in] *S_CFFT points to an instance of Q31 CFFT/CIFFT structure - * @param[in] N length of the DCT4. - * @param[in] Nby2 half of the length of the DCT4. - * @param[in] normalize normalizing factor. - * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if N is not a supported transform length. - */ - - arm_status arm_dct4_init_q31( - arm_dct4_instance_q31 * S, - arm_rfft_instance_q31 * S_RFFT, - arm_cfft_radix4_instance_q31 * S_CFFT, - uint16_t N, - uint16_t Nby2, - q31_t normalize); - - /** - * @brief Processing function for the Q31 DCT4/IDCT4. - * @param[in] *S points to an instance of the Q31 DCT4 structure. - * @param[in] *pState points to state buffer. - * @param[in,out] *pInlineBuffer points to the in-place input and output buffer. - * @return none. - */ - - void arm_dct4_q31( - const arm_dct4_instance_q31 * S, - q31_t * pState, - q31_t * pInlineBuffer); - - /** - * @brief Instance structure for the Q15 DCT4/IDCT4 function. - */ - - typedef struct - { - uint16_t N; /**< length of the DCT4. */ - uint16_t Nby2; /**< half of the length of the DCT4. */ - q15_t normalize; /**< normalizing factor. */ - q15_t *pTwiddle; /**< points to the twiddle factor table. */ - q15_t *pCosFactor; /**< points to the cosFactor table. */ - arm_rfft_instance_q15 *pRfft; /**< points to the real FFT instance. */ - arm_cfft_radix4_instance_q15 *pCfft; /**< points to the complex FFT instance. */ - } arm_dct4_instance_q15; - - /** - * @brief Initialization function for the Q15 DCT4/IDCT4. - * @param[in,out] *S points to an instance of Q15 DCT4/IDCT4 structure. - * @param[in] *S_RFFT points to an instance of Q15 RFFT/RIFFT structure. - * @param[in] *S_CFFT points to an instance of Q15 CFFT/CIFFT structure. - * @param[in] N length of the DCT4. - * @param[in] Nby2 half of the length of the DCT4. - * @param[in] normalize normalizing factor. - * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if N is not a supported transform length. - */ - - arm_status arm_dct4_init_q15( - arm_dct4_instance_q15 * S, - arm_rfft_instance_q15 * S_RFFT, - arm_cfft_radix4_instance_q15 * S_CFFT, - uint16_t N, - uint16_t Nby2, - q15_t normalize); - - /** - * @brief Processing function for the Q15 DCT4/IDCT4. - * @param[in] *S points to an instance of the Q15 DCT4 structure. - * @param[in] *pState points to state buffer. - * @param[in,out] *pInlineBuffer points to the in-place input and output buffer. - * @return none. - */ - - void arm_dct4_q15( - const arm_dct4_instance_q15 * S, - q15_t * pState, - q15_t * pInlineBuffer); - - /** - * @brief Floating-point vector addition. - * @param[in] *pSrcA points to the first input vector - * @param[in] *pSrcB points to the second input vector - * @param[out] *pDst points to the output vector - * @param[in] blockSize number of samples in each vector - * @return none. - */ - - void arm_add_f32( - float32_t * pSrcA, - float32_t * pSrcB, - float32_t * pDst, - uint32_t blockSize); - - /** - * @brief Q7 vector addition. - * @param[in] *pSrcA points to the first input vector - * @param[in] *pSrcB points to the second input vector - * @param[out] *pDst points to the output vector - * @param[in] blockSize number of samples in each vector - * @return none. - */ - - void arm_add_q7( - q7_t * pSrcA, - q7_t * pSrcB, - q7_t * pDst, - uint32_t blockSize); - - /** - * @brief Q15 vector addition. - * @param[in] *pSrcA points to the first input vector - * @param[in] *pSrcB points to the second input vector - * @param[out] *pDst points to the output vector - * @param[in] blockSize number of samples in each vector - * @return none. - */ - - void arm_add_q15( - q15_t * pSrcA, - q15_t * pSrcB, - q15_t * pDst, - uint32_t blockSize); - - /** - * @brief Q31 vector addition. - * @param[in] *pSrcA points to the first input vector - * @param[in] *pSrcB points to the second input vector - * @param[out] *pDst points to the output vector - * @param[in] blockSize number of samples in each vector - * @return none. - */ - - void arm_add_q31( - q31_t * pSrcA, - q31_t * pSrcB, - q31_t * pDst, - uint32_t blockSize); - - /** - * @brief Floating-point vector subtraction. - * @param[in] *pSrcA points to the first input vector - * @param[in] *pSrcB points to the second input vector - * @param[out] *pDst points to the output vector - * @param[in] blockSize number of samples in each vector - * @return none. - */ - - void arm_sub_f32( - float32_t * pSrcA, - float32_t * pSrcB, - float32_t * pDst, - uint32_t blockSize); - - /** - * @brief Q7 vector subtraction. - * @param[in] *pSrcA points to the first input vector - * @param[in] *pSrcB points to the second input vector - * @param[out] *pDst points to the output vector - * @param[in] blockSize number of samples in each vector - * @return none. - */ - - void arm_sub_q7( - q7_t * pSrcA, - q7_t * pSrcB, - q7_t * pDst, - uint32_t blockSize); - - /** - * @brief Q15 vector subtraction. - * @param[in] *pSrcA points to the first input vector - * @param[in] *pSrcB points to the second input vector - * @param[out] *pDst points to the output vector - * @param[in] blockSize number of samples in each vector - * @return none. - */ - - void arm_sub_q15( - q15_t * pSrcA, - q15_t * pSrcB, - q15_t * pDst, - uint32_t blockSize); - - /** - * @brief Q31 vector subtraction. - * @param[in] *pSrcA points to the first input vector - * @param[in] *pSrcB points to the second input vector - * @param[out] *pDst points to the output vector - * @param[in] blockSize number of samples in each vector - * @return none. - */ - - void arm_sub_q31( - q31_t * pSrcA, - q31_t * pSrcB, - q31_t * pDst, - uint32_t blockSize); - - /** - * @brief Multiplies a floating-point vector by a scalar. - * @param[in] *pSrc points to the input vector - * @param[in] scale scale factor to be applied - * @param[out] *pDst points to the output vector - * @param[in] blockSize number of samples in the vector - * @return none. - */ - - void arm_scale_f32( - float32_t * pSrc, - float32_t scale, - float32_t * pDst, - uint32_t blockSize); - - /** - * @brief Multiplies a Q7 vector by a scalar. - * @param[in] *pSrc points to the input vector - * @param[in] scaleFract fractional portion of the scale value - * @param[in] shift number of bits to shift the result by - * @param[out] *pDst points to the output vector - * @param[in] blockSize number of samples in the vector - * @return none. - */ - - void arm_scale_q7( - q7_t * pSrc, - q7_t scaleFract, - int8_t shift, - q7_t * pDst, - uint32_t blockSize); - - /** - * @brief Multiplies a Q15 vector by a scalar. - * @param[in] *pSrc points to the input vector - * @param[in] scaleFract fractional portion of the scale value - * @param[in] shift number of bits to shift the result by - * @param[out] *pDst points to the output vector - * @param[in] blockSize number of samples in the vector - * @return none. - */ - - void arm_scale_q15( - q15_t * pSrc, - q15_t scaleFract, - int8_t shift, - q15_t * pDst, - uint32_t blockSize); - - /** - * @brief Multiplies a Q31 vector by a scalar. - * @param[in] *pSrc points to the input vector - * @param[in] scaleFract fractional portion of the scale value - * @param[in] shift number of bits to shift the result by - * @param[out] *pDst points to the output vector - * @param[in] blockSize number of samples in the vector - * @return none. - */ - - void arm_scale_q31( - q31_t * pSrc, - q31_t scaleFract, - int8_t shift, - q31_t * pDst, - uint32_t blockSize); - - /** - * @brief Q7 vector absolute value. - * @param[in] *pSrc points to the input buffer - * @param[out] *pDst points to the output buffer - * @param[in] blockSize number of samples in each vector - * @return none. - */ - - void arm_abs_q7( - q7_t * pSrc, - q7_t * pDst, - uint32_t blockSize); - - /** - * @brief Floating-point vector absolute value. - * @param[in] *pSrc points to the input buffer - * @param[out] *pDst points to the output buffer - * @param[in] blockSize number of samples in each vector - * @return none. - */ - - void arm_abs_f32( - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - /** - * @brief Q15 vector absolute value. - * @param[in] *pSrc points to the input buffer - * @param[out] *pDst points to the output buffer - * @param[in] blockSize number of samples in each vector - * @return none. - */ - - void arm_abs_q15( - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - /** - * @brief Q31 vector absolute value. - * @param[in] *pSrc points to the input buffer - * @param[out] *pDst points to the output buffer - * @param[in] blockSize number of samples in each vector - * @return none. - */ - - void arm_abs_q31( - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - /** - * @brief Dot product of floating-point vectors. - * @param[in] *pSrcA points to the first input vector - * @param[in] *pSrcB points to the second input vector - * @param[in] blockSize number of samples in each vector - * @param[out] *result output result returned here - * @return none. - */ - - void arm_dot_prod_f32( - float32_t * pSrcA, - float32_t * pSrcB, - uint32_t blockSize, - float32_t * result); - - /** - * @brief Dot product of Q7 vectors. - * @param[in] *pSrcA points to the first input vector - * @param[in] *pSrcB points to the second input vector - * @param[in] blockSize number of samples in each vector - * @param[out] *result output result returned here - * @return none. - */ - - void arm_dot_prod_q7( - q7_t * pSrcA, - q7_t * pSrcB, - uint32_t blockSize, - q31_t * result); - - /** - * @brief Dot product of Q15 vectors. - * @param[in] *pSrcA points to the first input vector - * @param[in] *pSrcB points to the second input vector - * @param[in] blockSize number of samples in each vector - * @param[out] *result output result returned here - * @return none. - */ - - void arm_dot_prod_q15( - q15_t * pSrcA, - q15_t * pSrcB, - uint32_t blockSize, - q63_t * result); - - /** - * @brief Dot product of Q31 vectors. - * @param[in] *pSrcA points to the first input vector - * @param[in] *pSrcB points to the second input vector - * @param[in] blockSize number of samples in each vector - * @param[out] *result output result returned here - * @return none. - */ - - void arm_dot_prod_q31( - q31_t * pSrcA, - q31_t * pSrcB, - uint32_t blockSize, - q63_t * result); - - /** - * @brief Shifts the elements of a Q7 vector a specified number of bits. - * @param[in] *pSrc points to the input vector - * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right. - * @param[out] *pDst points to the output vector - * @param[in] blockSize number of samples in the vector - * @return none. - */ - - void arm_shift_q7( - q7_t * pSrc, - int8_t shiftBits, - q7_t * pDst, - uint32_t blockSize); - - /** - * @brief Shifts the elements of a Q15 vector a specified number of bits. - * @param[in] *pSrc points to the input vector - * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right. - * @param[out] *pDst points to the output vector - * @param[in] blockSize number of samples in the vector - * @return none. - */ - - void arm_shift_q15( - q15_t * pSrc, - int8_t shiftBits, - q15_t * pDst, - uint32_t blockSize); - - /** - * @brief Shifts the elements of a Q31 vector a specified number of bits. - * @param[in] *pSrc points to the input vector - * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right. - * @param[out] *pDst points to the output vector - * @param[in] blockSize number of samples in the vector - * @return none. - */ - - void arm_shift_q31( - q31_t * pSrc, - int8_t shiftBits, - q31_t * pDst, - uint32_t blockSize); - - /** - * @brief Adds a constant offset to a floating-point vector. - * @param[in] *pSrc points to the input vector - * @param[in] offset is the offset to be added - * @param[out] *pDst points to the output vector - * @param[in] blockSize number of samples in the vector - * @return none. - */ - - void arm_offset_f32( - float32_t * pSrc, - float32_t offset, - float32_t * pDst, - uint32_t blockSize); - - /** - * @brief Adds a constant offset to a Q7 vector. - * @param[in] *pSrc points to the input vector - * @param[in] offset is the offset to be added - * @param[out] *pDst points to the output vector - * @param[in] blockSize number of samples in the vector - * @return none. - */ - - void arm_offset_q7( - q7_t * pSrc, - q7_t offset, - q7_t * pDst, - uint32_t blockSize); - - /** - * @brief Adds a constant offset to a Q15 vector. - * @param[in] *pSrc points to the input vector - * @param[in] offset is the offset to be added - * @param[out] *pDst points to the output vector - * @param[in] blockSize number of samples in the vector - * @return none. - */ - - void arm_offset_q15( - q15_t * pSrc, - q15_t offset, - q15_t * pDst, - uint32_t blockSize); - - /** - * @brief Adds a constant offset to a Q31 vector. - * @param[in] *pSrc points to the input vector - * @param[in] offset is the offset to be added - * @param[out] *pDst points to the output vector - * @param[in] blockSize number of samples in the vector - * @return none. - */ - - void arm_offset_q31( - q31_t * pSrc, - q31_t offset, - q31_t * pDst, - uint32_t blockSize); - - /** - * @brief Negates the elements of a floating-point vector. - * @param[in] *pSrc points to the input vector - * @param[out] *pDst points to the output vector - * @param[in] blockSize number of samples in the vector - * @return none. - */ - - void arm_negate_f32( - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - /** - * @brief Negates the elements of a Q7 vector. - * @param[in] *pSrc points to the input vector - * @param[out] *pDst points to the output vector - * @param[in] blockSize number of samples in the vector - * @return none. - */ - - void arm_negate_q7( - q7_t * pSrc, - q7_t * pDst, - uint32_t blockSize); - - /** - * @brief Negates the elements of a Q15 vector. - * @param[in] *pSrc points to the input vector - * @param[out] *pDst points to the output vector - * @param[in] blockSize number of samples in the vector - * @return none. - */ - - void arm_negate_q15( - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - /** - * @brief Negates the elements of a Q31 vector. - * @param[in] *pSrc points to the input vector - * @param[out] *pDst points to the output vector - * @param[in] blockSize number of samples in the vector - * @return none. - */ - - void arm_negate_q31( - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - /** - * @brief Copies the elements of a floating-point vector. - * @param[in] *pSrc input pointer - * @param[out] *pDst output pointer - * @param[in] blockSize number of samples to process - * @return none. - */ - void arm_copy_f32( - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - /** - * @brief Copies the elements of a Q7 vector. - * @param[in] *pSrc input pointer - * @param[out] *pDst output pointer - * @param[in] blockSize number of samples to process - * @return none. - */ - void arm_copy_q7( - q7_t * pSrc, - q7_t * pDst, - uint32_t blockSize); - - /** - * @brief Copies the elements of a Q15 vector. - * @param[in] *pSrc input pointer - * @param[out] *pDst output pointer - * @param[in] blockSize number of samples to process - * @return none. - */ - void arm_copy_q15( - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - /** - * @brief Copies the elements of a Q31 vector. - * @param[in] *pSrc input pointer - * @param[out] *pDst output pointer - * @param[in] blockSize number of samples to process - * @return none. - */ - void arm_copy_q31( - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - /** - * @brief Fills a constant value into a floating-point vector. - * @param[in] value input value to be filled - * @param[out] *pDst output pointer - * @param[in] blockSize number of samples to process - * @return none. - */ - void arm_fill_f32( - float32_t value, - float32_t * pDst, - uint32_t blockSize); - - /** - * @brief Fills a constant value into a Q7 vector. - * @param[in] value input value to be filled - * @param[out] *pDst output pointer - * @param[in] blockSize number of samples to process - * @return none. - */ - void arm_fill_q7( - q7_t value, - q7_t * pDst, - uint32_t blockSize); - - /** - * @brief Fills a constant value into a Q15 vector. - * @param[in] value input value to be filled - * @param[out] *pDst output pointer - * @param[in] blockSize number of samples to process - * @return none. - */ - void arm_fill_q15( - q15_t value, - q15_t * pDst, - uint32_t blockSize); - - /** - * @brief Fills a constant value into a Q31 vector. - * @param[in] value input value to be filled - * @param[out] *pDst output pointer - * @param[in] blockSize number of samples to process - * @return none. - */ - void arm_fill_q31( - q31_t value, - q31_t * pDst, - uint32_t blockSize); - -/** - * @brief Convolution of floating-point sequences. - * @param[in] *pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] *pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] *pDst points to the location where the output result is written. Length srcALen+srcBLen-1. - * @return none. - */ - - void arm_conv_f32( - float32_t * pSrcA, - uint32_t srcALen, - float32_t * pSrcB, - uint32_t srcBLen, - float32_t * pDst); - - - /** - * @brief Convolution of Q15 sequences. - * @param[in] *pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] *pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1. - * @param[in] *pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] *pScratch2 points to scratch buffer of size min(srcALen, srcBLen). - * @return none. - */ - - - void arm_conv_opt_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst, - q15_t * pScratch1, - q15_t * pScratch2); - - -/** - * @brief Convolution of Q15 sequences. - * @param[in] *pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] *pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] *pDst points to the location where the output result is written. Length srcALen+srcBLen-1. - * @return none. - */ - - void arm_conv_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst); - - /** - * @brief Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] *pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] *pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1. - * @return none. - */ - - void arm_conv_fast_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst); - - /** - * @brief Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] *pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] *pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1. - * @param[in] *pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] *pScratch2 points to scratch buffer of size min(srcALen, srcBLen). - * @return none. - */ - - void arm_conv_fast_opt_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst, - q15_t * pScratch1, - q15_t * pScratch2); - - - - /** - * @brief Convolution of Q31 sequences. - * @param[in] *pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] *pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1. - * @return none. - */ - - void arm_conv_q31( - q31_t * pSrcA, - uint32_t srcALen, - q31_t * pSrcB, - uint32_t srcBLen, - q31_t * pDst); - - /** - * @brief Convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] *pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] *pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1. - * @return none. - */ - - void arm_conv_fast_q31( - q31_t * pSrcA, - uint32_t srcALen, - q31_t * pSrcB, - uint32_t srcBLen, - q31_t * pDst); - - - /** - * @brief Convolution of Q7 sequences. - * @param[in] *pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] *pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1. - * @param[in] *pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] *pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen). - * @return none. - */ - - void arm_conv_opt_q7( - q7_t * pSrcA, - uint32_t srcALen, - q7_t * pSrcB, - uint32_t srcBLen, - q7_t * pDst, - q15_t * pScratch1, - q15_t * pScratch2); - - - - /** - * @brief Convolution of Q7 sequences. - * @param[in] *pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] *pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] *pDst points to the block of output data Length srcALen+srcBLen-1. - * @return none. - */ - - void arm_conv_q7( - q7_t * pSrcA, - uint32_t srcALen, - q7_t * pSrcB, - uint32_t srcBLen, - q7_t * pDst); - - - /** - * @brief Partial convolution of floating-point sequences. - * @param[in] *pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] *pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] *pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ - - arm_status arm_conv_partial_f32( - float32_t * pSrcA, - uint32_t srcALen, - float32_t * pSrcB, - uint32_t srcBLen, - float32_t * pDst, - uint32_t firstIndex, - uint32_t numPoints); - - /** - * @brief Partial convolution of Q15 sequences. - * @param[in] *pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] *pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] *pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @param[in] * pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] * pScratch2 points to scratch buffer of size min(srcALen, srcBLen). - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ - - arm_status arm_conv_partial_opt_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst, - uint32_t firstIndex, - uint32_t numPoints, - q15_t * pScratch1, - q15_t * pScratch2); - - -/** - * @brief Partial convolution of Q15 sequences. - * @param[in] *pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] *pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] *pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ - - arm_status arm_conv_partial_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst, - uint32_t firstIndex, - uint32_t numPoints); - - /** - * @brief Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] *pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] *pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] *pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ - - arm_status arm_conv_partial_fast_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst, - uint32_t firstIndex, - uint32_t numPoints); - - - /** - * @brief Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] *pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] *pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] *pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @param[in] * pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] * pScratch2 points to scratch buffer of size min(srcALen, srcBLen). - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ - - arm_status arm_conv_partial_fast_opt_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst, - uint32_t firstIndex, - uint32_t numPoints, - q15_t * pScratch1, - q15_t * pScratch2); - - - /** - * @brief Partial convolution of Q31 sequences. - * @param[in] *pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] *pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] *pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ - - arm_status arm_conv_partial_q31( - q31_t * pSrcA, - uint32_t srcALen, - q31_t * pSrcB, - uint32_t srcBLen, - q31_t * pDst, - uint32_t firstIndex, - uint32_t numPoints); - - - /** - * @brief Partial convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] *pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] *pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] *pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ - - arm_status arm_conv_partial_fast_q31( - q31_t * pSrcA, - uint32_t srcALen, - q31_t * pSrcB, - uint32_t srcBLen, - q31_t * pDst, - uint32_t firstIndex, - uint32_t numPoints); - - - /** - * @brief Partial convolution of Q7 sequences - * @param[in] *pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] *pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] *pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @param[in] *pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] *pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen). - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ - - arm_status arm_conv_partial_opt_q7( - q7_t * pSrcA, - uint32_t srcALen, - q7_t * pSrcB, - uint32_t srcBLen, - q7_t * pDst, - uint32_t firstIndex, - uint32_t numPoints, - q15_t * pScratch1, - q15_t * pScratch2); - - -/** - * @brief Partial convolution of Q7 sequences. - * @param[in] *pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] *pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] *pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. - */ - - arm_status arm_conv_partial_q7( - q7_t * pSrcA, - uint32_t srcALen, - q7_t * pSrcB, - uint32_t srcBLen, - q7_t * pDst, - uint32_t firstIndex, - uint32_t numPoints); - - - - /** - * @brief Instance structure for the Q15 FIR decimator. - */ - - typedef struct - { - uint8_t M; /**< decimation factor. */ - uint16_t numTaps; /**< number of coefficients in the filter. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - } arm_fir_decimate_instance_q15; - - /** - * @brief Instance structure for the Q31 FIR decimator. - */ - - typedef struct - { - uint8_t M; /**< decimation factor. */ - uint16_t numTaps; /**< number of coefficients in the filter. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - - } arm_fir_decimate_instance_q31; - - /** - * @brief Instance structure for the floating-point FIR decimator. - */ - - typedef struct - { - uint8_t M; /**< decimation factor. */ - uint16_t numTaps; /**< number of coefficients in the filter. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - - } arm_fir_decimate_instance_f32; - - - - /** - * @brief Processing function for the floating-point FIR decimator. - * @param[in] *S points to an instance of the floating-point FIR decimator structure. - * @param[in] *pSrc points to the block of input data. - * @param[out] *pDst points to the block of output data - * @param[in] blockSize number of input samples to process per call. - * @return none - */ - - void arm_fir_decimate_f32( - const arm_fir_decimate_instance_f32 * S, - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the floating-point FIR decimator. - * @param[in,out] *S points to an instance of the floating-point FIR decimator structure. - * @param[in] numTaps number of coefficients in the filter. - * @param[in] M decimation factor. - * @param[in] *pCoeffs points to the filter coefficients. - * @param[in] *pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * blockSize is not a multiple of M. - */ - - arm_status arm_fir_decimate_init_f32( - arm_fir_decimate_instance_f32 * S, - uint16_t numTaps, - uint8_t M, - float32_t * pCoeffs, - float32_t * pState, - uint32_t blockSize); - - /** - * @brief Processing function for the Q15 FIR decimator. - * @param[in] *S points to an instance of the Q15 FIR decimator structure. - * @param[in] *pSrc points to the block of input data. - * @param[out] *pDst points to the block of output data - * @param[in] blockSize number of input samples to process per call. - * @return none - */ - - void arm_fir_decimate_q15( - const arm_fir_decimate_instance_q15 * S, - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - /** - * @brief Processing function for the Q15 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4. - * @param[in] *S points to an instance of the Q15 FIR decimator structure. - * @param[in] *pSrc points to the block of input data. - * @param[out] *pDst points to the block of output data - * @param[in] blockSize number of input samples to process per call. - * @return none - */ - - void arm_fir_decimate_fast_q15( - const arm_fir_decimate_instance_q15 * S, - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - - /** - * @brief Initialization function for the Q15 FIR decimator. - * @param[in,out] *S points to an instance of the Q15 FIR decimator structure. - * @param[in] numTaps number of coefficients in the filter. - * @param[in] M decimation factor. - * @param[in] *pCoeffs points to the filter coefficients. - * @param[in] *pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * blockSize is not a multiple of M. - */ - - arm_status arm_fir_decimate_init_q15( - arm_fir_decimate_instance_q15 * S, - uint16_t numTaps, - uint8_t M, - q15_t * pCoeffs, - q15_t * pState, - uint32_t blockSize); - - /** - * @brief Processing function for the Q31 FIR decimator. - * @param[in] *S points to an instance of the Q31 FIR decimator structure. - * @param[in] *pSrc points to the block of input data. - * @param[out] *pDst points to the block of output data - * @param[in] blockSize number of input samples to process per call. - * @return none - */ - - void arm_fir_decimate_q31( - const arm_fir_decimate_instance_q31 * S, - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - /** - * @brief Processing function for the Q31 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4. - * @param[in] *S points to an instance of the Q31 FIR decimator structure. - * @param[in] *pSrc points to the block of input data. - * @param[out] *pDst points to the block of output data - * @param[in] blockSize number of input samples to process per call. - * @return none - */ - - void arm_fir_decimate_fast_q31( - arm_fir_decimate_instance_q31 * S, - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q31 FIR decimator. - * @param[in,out] *S points to an instance of the Q31 FIR decimator structure. - * @param[in] numTaps number of coefficients in the filter. - * @param[in] M decimation factor. - * @param[in] *pCoeffs points to the filter coefficients. - * @param[in] *pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * blockSize is not a multiple of M. - */ - - arm_status arm_fir_decimate_init_q31( - arm_fir_decimate_instance_q31 * S, - uint16_t numTaps, - uint8_t M, - q31_t * pCoeffs, - q31_t * pState, - uint32_t blockSize); - - - - /** - * @brief Instance structure for the Q15 FIR interpolator. - */ - - typedef struct - { - uint8_t L; /**< upsample factor. */ - uint16_t phaseLength; /**< length of each polyphase filter component. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */ - q15_t *pState; /**< points to the state variable array. The array is of length blockSize+phaseLength-1. */ - } arm_fir_interpolate_instance_q15; - - /** - * @brief Instance structure for the Q31 FIR interpolator. - */ - - typedef struct - { - uint8_t L; /**< upsample factor. */ - uint16_t phaseLength; /**< length of each polyphase filter component. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */ - q31_t *pState; /**< points to the state variable array. The array is of length blockSize+phaseLength-1. */ - } arm_fir_interpolate_instance_q31; - - /** - * @brief Instance structure for the floating-point FIR interpolator. - */ - - typedef struct - { - uint8_t L; /**< upsample factor. */ - uint16_t phaseLength; /**< length of each polyphase filter component. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */ - float32_t *pState; /**< points to the state variable array. The array is of length phaseLength+numTaps-1. */ - } arm_fir_interpolate_instance_f32; - - - /** - * @brief Processing function for the Q15 FIR interpolator. - * @param[in] *S points to an instance of the Q15 FIR interpolator structure. - * @param[in] *pSrc points to the block of input data. - * @param[out] *pDst points to the block of output data. - * @param[in] blockSize number of input samples to process per call. - * @return none. - */ - - void arm_fir_interpolate_q15( - const arm_fir_interpolate_instance_q15 * S, - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q15 FIR interpolator. - * @param[in,out] *S points to an instance of the Q15 FIR interpolator structure. - * @param[in] L upsample factor. - * @param[in] numTaps number of filter coefficients in the filter. - * @param[in] *pCoeffs points to the filter coefficient buffer. - * @param[in] *pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * the filter length numTaps is not a multiple of the interpolation factor L. - */ - - arm_status arm_fir_interpolate_init_q15( - arm_fir_interpolate_instance_q15 * S, - uint8_t L, - uint16_t numTaps, - q15_t * pCoeffs, - q15_t * pState, - uint32_t blockSize); - - /** - * @brief Processing function for the Q31 FIR interpolator. - * @param[in] *S points to an instance of the Q15 FIR interpolator structure. - * @param[in] *pSrc points to the block of input data. - * @param[out] *pDst points to the block of output data. - * @param[in] blockSize number of input samples to process per call. - * @return none. - */ - - void arm_fir_interpolate_q31( - const arm_fir_interpolate_instance_q31 * S, - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - /** - * @brief Initialization function for the Q31 FIR interpolator. - * @param[in,out] *S points to an instance of the Q31 FIR interpolator structure. - * @param[in] L upsample factor. - * @param[in] numTaps number of filter coefficients in the filter. - * @param[in] *pCoeffs points to the filter coefficient buffer. - * @param[in] *pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * the filter length numTaps is not a multiple of the interpolation factor L. - */ - - arm_status arm_fir_interpolate_init_q31( - arm_fir_interpolate_instance_q31 * S, - uint8_t L, - uint16_t numTaps, - q31_t * pCoeffs, - q31_t * pState, - uint32_t blockSize); - - - /** - * @brief Processing function for the floating-point FIR interpolator. - * @param[in] *S points to an instance of the floating-point FIR interpolator structure. - * @param[in] *pSrc points to the block of input data. - * @param[out] *pDst points to the block of output data. - * @param[in] blockSize number of input samples to process per call. - * @return none. - */ - - void arm_fir_interpolate_f32( - const arm_fir_interpolate_instance_f32 * S, - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - /** - * @brief Initialization function for the floating-point FIR interpolator. - * @param[in,out] *S points to an instance of the floating-point FIR interpolator structure. - * @param[in] L upsample factor. - * @param[in] numTaps number of filter coefficients in the filter. - * @param[in] *pCoeffs points to the filter coefficient buffer. - * @param[in] *pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * the filter length numTaps is not a multiple of the interpolation factor L. - */ - - arm_status arm_fir_interpolate_init_f32( - arm_fir_interpolate_instance_f32 * S, - uint8_t L, - uint16_t numTaps, - float32_t * pCoeffs, - float32_t * pState, - uint32_t blockSize); - - /** - * @brief Instance structure for the high precision Q31 Biquad cascade filter. - */ - - typedef struct - { - uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - q63_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */ - q31_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ - uint8_t postShift; /**< additional shift, in bits, applied to each output sample. */ - - } arm_biquad_cas_df1_32x64_ins_q31; - - - /** - * @param[in] *S points to an instance of the high precision Q31 Biquad cascade filter structure. - * @param[in] *pSrc points to the block of input data. - * @param[out] *pDst points to the block of output data - * @param[in] blockSize number of samples to process. - * @return none. - */ - - void arm_biquad_cas_df1_32x64_q31( - const arm_biquad_cas_df1_32x64_ins_q31 * S, - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @param[in,out] *S points to an instance of the high precision Q31 Biquad cascade filter structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] *pCoeffs points to the filter coefficients. - * @param[in] *pState points to the state buffer. - * @param[in] postShift shift to be applied to the output. Varies according to the coefficients format - * @return none - */ - - void arm_biquad_cas_df1_32x64_init_q31( - arm_biquad_cas_df1_32x64_ins_q31 * S, - uint8_t numStages, - q31_t * pCoeffs, - q63_t * pState, - uint8_t postShift); - - - - /** - * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter. - */ - - typedef struct - { - uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - float32_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */ - float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ - } arm_biquad_cascade_df2T_instance_f32; - - - - /** - * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter. - */ - - typedef struct - { - uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - float32_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */ - float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ - } arm_biquad_cascade_stereo_df2T_instance_f32; - - - - /** - * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter. - */ - - typedef struct - { - uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - float64_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */ - float64_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ - } arm_biquad_cascade_df2T_instance_f64; - - - /** - * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. - * @param[in] *S points to an instance of the filter data structure. - * @param[in] *pSrc points to the block of input data. - * @param[out] *pDst points to the block of output data - * @param[in] blockSize number of samples to process. - * @return none. - */ - - void arm_biquad_cascade_df2T_f32( - const arm_biquad_cascade_df2T_instance_f32 * S, - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. 2 channels - * @param[in] *S points to an instance of the filter data structure. - * @param[in] *pSrc points to the block of input data. - * @param[out] *pDst points to the block of output data - * @param[in] blockSize number of samples to process. - * @return none. - */ - - void arm_biquad_cascade_stereo_df2T_f32( - const arm_biquad_cascade_stereo_df2T_instance_f32 * S, - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - /** - * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. - * @param[in] *S points to an instance of the filter data structure. - * @param[in] *pSrc points to the block of input data. - * @param[out] *pDst points to the block of output data - * @param[in] blockSize number of samples to process. - * @return none. - */ - - void arm_biquad_cascade_df2T_f64( - const arm_biquad_cascade_df2T_instance_f64 * S, - float64_t * pSrc, - float64_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter. - * @param[in,out] *S points to an instance of the filter data structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] *pCoeffs points to the filter coefficients. - * @param[in] *pState points to the state buffer. - * @return none - */ - - void arm_biquad_cascade_df2T_init_f32( - arm_biquad_cascade_df2T_instance_f32 * S, - uint8_t numStages, - float32_t * pCoeffs, - float32_t * pState); - - - /** - * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter. - * @param[in,out] *S points to an instance of the filter data structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] *pCoeffs points to the filter coefficients. - * @param[in] *pState points to the state buffer. - * @return none - */ - - void arm_biquad_cascade_stereo_df2T_init_f32( - arm_biquad_cascade_stereo_df2T_instance_f32 * S, - uint8_t numStages, - float32_t * pCoeffs, - float32_t * pState); - - - /** - * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter. - * @param[in,out] *S points to an instance of the filter data structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] *pCoeffs points to the filter coefficients. - * @param[in] *pState points to the state buffer. - * @return none - */ - - void arm_biquad_cascade_df2T_init_f64( - arm_biquad_cascade_df2T_instance_f64 * S, - uint8_t numStages, - float64_t * pCoeffs, - float64_t * pState); - - - - /** - * @brief Instance structure for the Q15 FIR lattice filter. - */ - - typedef struct - { - uint16_t numStages; /**< number of filter stages. */ - q15_t *pState; /**< points to the state variable array. The array is of length numStages. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */ - } arm_fir_lattice_instance_q15; - - /** - * @brief Instance structure for the Q31 FIR lattice filter. - */ - - typedef struct - { - uint16_t numStages; /**< number of filter stages. */ - q31_t *pState; /**< points to the state variable array. The array is of length numStages. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */ - } arm_fir_lattice_instance_q31; - - /** - * @brief Instance structure for the floating-point FIR lattice filter. - */ - - typedef struct - { - uint16_t numStages; /**< number of filter stages. */ - float32_t *pState; /**< points to the state variable array. The array is of length numStages. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */ - } arm_fir_lattice_instance_f32; - - /** - * @brief Initialization function for the Q15 FIR lattice filter. - * @param[in] *S points to an instance of the Q15 FIR lattice structure. - * @param[in] numStages number of filter stages. - * @param[in] *pCoeffs points to the coefficient buffer. The array is of length numStages. - * @param[in] *pState points to the state buffer. The array is of length numStages. - * @return none. - */ - - void arm_fir_lattice_init_q15( - arm_fir_lattice_instance_q15 * S, - uint16_t numStages, - q15_t * pCoeffs, - q15_t * pState); - - - /** - * @brief Processing function for the Q15 FIR lattice filter. - * @param[in] *S points to an instance of the Q15 FIR lattice structure. - * @param[in] *pSrc points to the block of input data. - * @param[out] *pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - * @return none. - */ - void arm_fir_lattice_q15( - const arm_fir_lattice_instance_q15 * S, - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - /** - * @brief Initialization function for the Q31 FIR lattice filter. - * @param[in] *S points to an instance of the Q31 FIR lattice structure. - * @param[in] numStages number of filter stages. - * @param[in] *pCoeffs points to the coefficient buffer. The array is of length numStages. - * @param[in] *pState points to the state buffer. The array is of length numStages. - * @return none. - */ - - void arm_fir_lattice_init_q31( - arm_fir_lattice_instance_q31 * S, - uint16_t numStages, - q31_t * pCoeffs, - q31_t * pState); - - - /** - * @brief Processing function for the Q31 FIR lattice filter. - * @param[in] *S points to an instance of the Q31 FIR lattice structure. - * @param[in] *pSrc points to the block of input data. - * @param[out] *pDst points to the block of output data - * @param[in] blockSize number of samples to process. - * @return none. - */ - - void arm_fir_lattice_q31( - const arm_fir_lattice_instance_q31 * S, - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - -/** - * @brief Initialization function for the floating-point FIR lattice filter. - * @param[in] *S points to an instance of the floating-point FIR lattice structure. - * @param[in] numStages number of filter stages. - * @param[in] *pCoeffs points to the coefficient buffer. The array is of length numStages. - * @param[in] *pState points to the state buffer. The array is of length numStages. - * @return none. - */ - - void arm_fir_lattice_init_f32( - arm_fir_lattice_instance_f32 * S, - uint16_t numStages, - float32_t * pCoeffs, - float32_t * pState); - - /** - * @brief Processing function for the floating-point FIR lattice filter. - * @param[in] *S points to an instance of the floating-point FIR lattice structure. - * @param[in] *pSrc points to the block of input data. - * @param[out] *pDst points to the block of output data - * @param[in] blockSize number of samples to process. - * @return none. - */ - - void arm_fir_lattice_f32( - const arm_fir_lattice_instance_f32 * S, - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - /** - * @brief Instance structure for the Q15 IIR lattice filter. - */ - typedef struct - { - uint16_t numStages; /**< number of stages in the filter. */ - q15_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */ - q15_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */ - q15_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */ - } arm_iir_lattice_instance_q15; - - /** - * @brief Instance structure for the Q31 IIR lattice filter. - */ - typedef struct - { - uint16_t numStages; /**< number of stages in the filter. */ - q31_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */ - q31_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */ - q31_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */ - } arm_iir_lattice_instance_q31; - - /** - * @brief Instance structure for the floating-point IIR lattice filter. - */ - typedef struct - { - uint16_t numStages; /**< number of stages in the filter. */ - float32_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */ - float32_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */ - float32_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */ - } arm_iir_lattice_instance_f32; - - /** - * @brief Processing function for the floating-point IIR lattice filter. - * @param[in] *S points to an instance of the floating-point IIR lattice structure. - * @param[in] *pSrc points to the block of input data. - * @param[out] *pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - * @return none. - */ - - void arm_iir_lattice_f32( - const arm_iir_lattice_instance_f32 * S, - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - /** - * @brief Initialization function for the floating-point IIR lattice filter. - * @param[in] *S points to an instance of the floating-point IIR lattice structure. - * @param[in] numStages number of stages in the filter. - * @param[in] *pkCoeffs points to the reflection coefficient buffer. The array is of length numStages. - * @param[in] *pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1. - * @param[in] *pState points to the state buffer. The array is of length numStages+blockSize-1. - * @param[in] blockSize number of samples to process. - * @return none. - */ - - void arm_iir_lattice_init_f32( - arm_iir_lattice_instance_f32 * S, - uint16_t numStages, - float32_t * pkCoeffs, - float32_t * pvCoeffs, - float32_t * pState, - uint32_t blockSize); - - - /** - * @brief Processing function for the Q31 IIR lattice filter. - * @param[in] *S points to an instance of the Q31 IIR lattice structure. - * @param[in] *pSrc points to the block of input data. - * @param[out] *pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - * @return none. - */ - - void arm_iir_lattice_q31( - const arm_iir_lattice_instance_q31 * S, - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q31 IIR lattice filter. - * @param[in] *S points to an instance of the Q31 IIR lattice structure. - * @param[in] numStages number of stages in the filter. - * @param[in] *pkCoeffs points to the reflection coefficient buffer. The array is of length numStages. - * @param[in] *pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1. - * @param[in] *pState points to the state buffer. The array is of length numStages+blockSize. - * @param[in] blockSize number of samples to process. - * @return none. - */ - - void arm_iir_lattice_init_q31( - arm_iir_lattice_instance_q31 * S, - uint16_t numStages, - q31_t * pkCoeffs, - q31_t * pvCoeffs, - q31_t * pState, - uint32_t blockSize); - - - /** - * @brief Processing function for the Q15 IIR lattice filter. - * @param[in] *S points to an instance of the Q15 IIR lattice structure. - * @param[in] *pSrc points to the block of input data. - * @param[out] *pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - * @return none. - */ - - void arm_iir_lattice_q15( - const arm_iir_lattice_instance_q15 * S, - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q15 IIR lattice filter. - * @param[in] *S points to an instance of the fixed-point Q15 IIR lattice structure. - * @param[in] numStages number of stages in the filter. - * @param[in] *pkCoeffs points to reflection coefficient buffer. The array is of length numStages. - * @param[in] *pvCoeffs points to ladder coefficient buffer. The array is of length numStages+1. - * @param[in] *pState points to state buffer. The array is of length numStages+blockSize. - * @param[in] blockSize number of samples to process per call. - * @return none. - */ - - void arm_iir_lattice_init_q15( - arm_iir_lattice_instance_q15 * S, - uint16_t numStages, - q15_t * pkCoeffs, - q15_t * pvCoeffs, - q15_t * pState, - uint32_t blockSize); - - /** - * @brief Instance structure for the floating-point LMS filter. - */ - - typedef struct - { - uint16_t numTaps; /**< number of coefficients in the filter. */ - float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - float32_t mu; /**< step size that controls filter coefficient updates. */ - } arm_lms_instance_f32; - - /** - * @brief Processing function for floating-point LMS filter. - * @param[in] *S points to an instance of the floating-point LMS filter structure. - * @param[in] *pSrc points to the block of input data. - * @param[in] *pRef points to the block of reference data. - * @param[out] *pOut points to the block of output data. - * @param[out] *pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - * @return none. - */ - - void arm_lms_f32( - const arm_lms_instance_f32 * S, - float32_t * pSrc, - float32_t * pRef, - float32_t * pOut, - float32_t * pErr, - uint32_t blockSize); - - /** - * @brief Initialization function for floating-point LMS filter. - * @param[in] *S points to an instance of the floating-point LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] *pCoeffs points to the coefficient buffer. - * @param[in] *pState points to state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - * @return none. - */ - - void arm_lms_init_f32( - arm_lms_instance_f32 * S, - uint16_t numTaps, - float32_t * pCoeffs, - float32_t * pState, - float32_t mu, - uint32_t blockSize); - - /** - * @brief Instance structure for the Q15 LMS filter. - */ - - typedef struct - { - uint16_t numTaps; /**< number of coefficients in the filter. */ - q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - q15_t mu; /**< step size that controls filter coefficient updates. */ - uint32_t postShift; /**< bit shift applied to coefficients. */ - } arm_lms_instance_q15; - - - /** - * @brief Initialization function for the Q15 LMS filter. - * @param[in] *S points to an instance of the Q15 LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] *pCoeffs points to the coefficient buffer. - * @param[in] *pState points to the state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - * @param[in] postShift bit shift applied to coefficients. - * @return none. - */ - - void arm_lms_init_q15( - arm_lms_instance_q15 * S, - uint16_t numTaps, - q15_t * pCoeffs, - q15_t * pState, - q15_t mu, - uint32_t blockSize, - uint32_t postShift); - - /** - * @brief Processing function for Q15 LMS filter. - * @param[in] *S points to an instance of the Q15 LMS filter structure. - * @param[in] *pSrc points to the block of input data. - * @param[in] *pRef points to the block of reference data. - * @param[out] *pOut points to the block of output data. - * @param[out] *pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - * @return none. - */ - - void arm_lms_q15( - const arm_lms_instance_q15 * S, - q15_t * pSrc, - q15_t * pRef, - q15_t * pOut, - q15_t * pErr, - uint32_t blockSize); - - - /** - * @brief Instance structure for the Q31 LMS filter. - */ - - typedef struct - { - uint16_t numTaps; /**< number of coefficients in the filter. */ - q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - q31_t mu; /**< step size that controls filter coefficient updates. */ - uint32_t postShift; /**< bit shift applied to coefficients. */ - - } arm_lms_instance_q31; - - /** - * @brief Processing function for Q31 LMS filter. - * @param[in] *S points to an instance of the Q15 LMS filter structure. - * @param[in] *pSrc points to the block of input data. - * @param[in] *pRef points to the block of reference data. - * @param[out] *pOut points to the block of output data. - * @param[out] *pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - * @return none. - */ - - void arm_lms_q31( - const arm_lms_instance_q31 * S, - q31_t * pSrc, - q31_t * pRef, - q31_t * pOut, - q31_t * pErr, - uint32_t blockSize); - - /** - * @brief Initialization function for Q31 LMS filter. - * @param[in] *S points to an instance of the Q31 LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] *pCoeffs points to coefficient buffer. - * @param[in] *pState points to state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - * @param[in] postShift bit shift applied to coefficients. - * @return none. - */ - - void arm_lms_init_q31( - arm_lms_instance_q31 * S, - uint16_t numTaps, - q31_t * pCoeffs, - q31_t * pState, - q31_t mu, - uint32_t blockSize, - uint32_t postShift); - - /** - * @brief Instance structure for the floating-point normalized LMS filter. - */ - - typedef struct - { - uint16_t numTaps; /**< number of coefficients in the filter. */ - float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - float32_t mu; /**< step size that control filter coefficient updates. */ - float32_t energy; /**< saves previous frame energy. */ - float32_t x0; /**< saves previous input sample. */ - } arm_lms_norm_instance_f32; - - /** - * @brief Processing function for floating-point normalized LMS filter. - * @param[in] *S points to an instance of the floating-point normalized LMS filter structure. - * @param[in] *pSrc points to the block of input data. - * @param[in] *pRef points to the block of reference data. - * @param[out] *pOut points to the block of output data. - * @param[out] *pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - * @return none. - */ - - void arm_lms_norm_f32( - arm_lms_norm_instance_f32 * S, - float32_t * pSrc, - float32_t * pRef, - float32_t * pOut, - float32_t * pErr, - uint32_t blockSize); - - /** - * @brief Initialization function for floating-point normalized LMS filter. - * @param[in] *S points to an instance of the floating-point LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] *pCoeffs points to coefficient buffer. - * @param[in] *pState points to state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - * @return none. - */ - - void arm_lms_norm_init_f32( - arm_lms_norm_instance_f32 * S, - uint16_t numTaps, - float32_t * pCoeffs, - float32_t * pState, - float32_t mu, - uint32_t blockSize); - - - /** - * @brief Instance structure for the Q31 normalized LMS filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of coefficients in the filter. */ - q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - q31_t mu; /**< step size that controls filter coefficient updates. */ - uint8_t postShift; /**< bit shift applied to coefficients. */ - q31_t *recipTable; /**< points to the reciprocal initial value table. */ - q31_t energy; /**< saves previous frame energy. */ - q31_t x0; /**< saves previous input sample. */ - } arm_lms_norm_instance_q31; - - /** - * @brief Processing function for Q31 normalized LMS filter. - * @param[in] *S points to an instance of the Q31 normalized LMS filter structure. - * @param[in] *pSrc points to the block of input data. - * @param[in] *pRef points to the block of reference data. - * @param[out] *pOut points to the block of output data. - * @param[out] *pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - * @return none. - */ - - void arm_lms_norm_q31( - arm_lms_norm_instance_q31 * S, - q31_t * pSrc, - q31_t * pRef, - q31_t * pOut, - q31_t * pErr, - uint32_t blockSize); - - /** - * @brief Initialization function for Q31 normalized LMS filter. - * @param[in] *S points to an instance of the Q31 normalized LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] *pCoeffs points to coefficient buffer. - * @param[in] *pState points to state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - * @param[in] postShift bit shift applied to coefficients. - * @return none. - */ - - void arm_lms_norm_init_q31( - arm_lms_norm_instance_q31 * S, - uint16_t numTaps, - q31_t * pCoeffs, - q31_t * pState, - q31_t mu, - uint32_t blockSize, - uint8_t postShift); - - /** - * @brief Instance structure for the Q15 normalized LMS filter. - */ - - typedef struct - { - uint16_t numTaps; /**< Number of coefficients in the filter. */ - q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - q15_t mu; /**< step size that controls filter coefficient updates. */ - uint8_t postShift; /**< bit shift applied to coefficients. */ - q15_t *recipTable; /**< Points to the reciprocal initial value table. */ - q15_t energy; /**< saves previous frame energy. */ - q15_t x0; /**< saves previous input sample. */ - } arm_lms_norm_instance_q15; - - /** - * @brief Processing function for Q15 normalized LMS filter. - * @param[in] *S points to an instance of the Q15 normalized LMS filter structure. - * @param[in] *pSrc points to the block of input data. - * @param[in] *pRef points to the block of reference data. - * @param[out] *pOut points to the block of output data. - * @param[out] *pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - * @return none. - */ - - void arm_lms_norm_q15( - arm_lms_norm_instance_q15 * S, - q15_t * pSrc, - q15_t * pRef, - q15_t * pOut, - q15_t * pErr, - uint32_t blockSize); - - - /** - * @brief Initialization function for Q15 normalized LMS filter. - * @param[in] *S points to an instance of the Q15 normalized LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] *pCoeffs points to coefficient buffer. - * @param[in] *pState points to state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - * @param[in] postShift bit shift applied to coefficients. - * @return none. - */ - - void arm_lms_norm_init_q15( - arm_lms_norm_instance_q15 * S, - uint16_t numTaps, - q15_t * pCoeffs, - q15_t * pState, - q15_t mu, - uint32_t blockSize, - uint8_t postShift); - - /** - * @brief Correlation of floating-point sequences. - * @param[in] *pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] *pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - * @return none. - */ - - void arm_correlate_f32( - float32_t * pSrcA, - uint32_t srcALen, - float32_t * pSrcB, - uint32_t srcBLen, - float32_t * pDst); - - - /** - * @brief Correlation of Q15 sequences - * @param[in] *pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] *pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - * @param[in] *pScratch points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @return none. - */ - void arm_correlate_opt_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst, - q15_t * pScratch); - - - /** - * @brief Correlation of Q15 sequences. - * @param[in] *pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] *pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - * @return none. - */ - - void arm_correlate_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst); - - /** - * @brief Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4. - * @param[in] *pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] *pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - * @return none. - */ - - void arm_correlate_fast_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst); - - - - /** - * @brief Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4. - * @param[in] *pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] *pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - * @param[in] *pScratch points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @return none. - */ - - void arm_correlate_fast_opt_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst, - q15_t * pScratch); - - /** - * @brief Correlation of Q31 sequences. - * @param[in] *pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] *pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - * @return none. - */ - - void arm_correlate_q31( - q31_t * pSrcA, - uint32_t srcALen, - q31_t * pSrcB, - uint32_t srcBLen, - q31_t * pDst); - - /** - * @brief Correlation of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] *pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] *pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - * @return none. - */ - - void arm_correlate_fast_q31( - q31_t * pSrcA, - uint32_t srcALen, - q31_t * pSrcB, - uint32_t srcBLen, - q31_t * pDst); - - - - /** - * @brief Correlation of Q7 sequences. - * @param[in] *pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] *pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - * @param[in] *pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] *pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen). - * @return none. - */ - - void arm_correlate_opt_q7( - q7_t * pSrcA, - uint32_t srcALen, - q7_t * pSrcB, - uint32_t srcBLen, - q7_t * pDst, - q15_t * pScratch1, - q15_t * pScratch2); - - - /** - * @brief Correlation of Q7 sequences. - * @param[in] *pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] *pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] *pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - * @return none. - */ - - void arm_correlate_q7( - q7_t * pSrcA, - uint32_t srcALen, - q7_t * pSrcB, - uint32_t srcBLen, - q7_t * pDst); - - - /** - * @brief Instance structure for the floating-point sparse FIR filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of coefficients in the filter. */ - uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ - float32_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ - int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ - } arm_fir_sparse_instance_f32; - - /** - * @brief Instance structure for the Q31 sparse FIR filter. - */ - - typedef struct - { - uint16_t numTaps; /**< number of coefficients in the filter. */ - uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ - q31_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ - int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ - } arm_fir_sparse_instance_q31; - - /** - * @brief Instance structure for the Q15 sparse FIR filter. - */ - - typedef struct - { - uint16_t numTaps; /**< number of coefficients in the filter. */ - uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ - q15_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ - int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ - } arm_fir_sparse_instance_q15; - - /** - * @brief Instance structure for the Q7 sparse FIR filter. - */ - - typedef struct - { - uint16_t numTaps; /**< number of coefficients in the filter. */ - uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ - q7_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ - q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ - int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ - } arm_fir_sparse_instance_q7; - - /** - * @brief Processing function for the floating-point sparse FIR filter. - * @param[in] *S points to an instance of the floating-point sparse FIR structure. - * @param[in] *pSrc points to the block of input data. - * @param[out] *pDst points to the block of output data - * @param[in] *pScratchIn points to a temporary buffer of size blockSize. - * @param[in] blockSize number of input samples to process per call. - * @return none. - */ - - void arm_fir_sparse_f32( - arm_fir_sparse_instance_f32 * S, - float32_t * pSrc, - float32_t * pDst, - float32_t * pScratchIn, - uint32_t blockSize); - - /** - * @brief Initialization function for the floating-point sparse FIR filter. - * @param[in,out] *S points to an instance of the floating-point sparse FIR structure. - * @param[in] numTaps number of nonzero coefficients in the filter. - * @param[in] *pCoeffs points to the array of filter coefficients. - * @param[in] *pState points to the state buffer. - * @param[in] *pTapDelay points to the array of offset times. - * @param[in] maxDelay maximum offset time supported. - * @param[in] blockSize number of samples that will be processed per block. - * @return none - */ - - void arm_fir_sparse_init_f32( - arm_fir_sparse_instance_f32 * S, - uint16_t numTaps, - float32_t * pCoeffs, - float32_t * pState, - int32_t * pTapDelay, - uint16_t maxDelay, - uint32_t blockSize); - - /** - * @brief Processing function for the Q31 sparse FIR filter. - * @param[in] *S points to an instance of the Q31 sparse FIR structure. - * @param[in] *pSrc points to the block of input data. - * @param[out] *pDst points to the block of output data - * @param[in] *pScratchIn points to a temporary buffer of size blockSize. - * @param[in] blockSize number of input samples to process per call. - * @return none. - */ - - void arm_fir_sparse_q31( - arm_fir_sparse_instance_q31 * S, - q31_t * pSrc, - q31_t * pDst, - q31_t * pScratchIn, - uint32_t blockSize); - - /** - * @brief Initialization function for the Q31 sparse FIR filter. - * @param[in,out] *S points to an instance of the Q31 sparse FIR structure. - * @param[in] numTaps number of nonzero coefficients in the filter. - * @param[in] *pCoeffs points to the array of filter coefficients. - * @param[in] *pState points to the state buffer. - * @param[in] *pTapDelay points to the array of offset times. - * @param[in] maxDelay maximum offset time supported. - * @param[in] blockSize number of samples that will be processed per block. - * @return none - */ - - void arm_fir_sparse_init_q31( - arm_fir_sparse_instance_q31 * S, - uint16_t numTaps, - q31_t * pCoeffs, - q31_t * pState, - int32_t * pTapDelay, - uint16_t maxDelay, - uint32_t blockSize); - - /** - * @brief Processing function for the Q15 sparse FIR filter. - * @param[in] *S points to an instance of the Q15 sparse FIR structure. - * @param[in] *pSrc points to the block of input data. - * @param[out] *pDst points to the block of output data - * @param[in] *pScratchIn points to a temporary buffer of size blockSize. - * @param[in] *pScratchOut points to a temporary buffer of size blockSize. - * @param[in] blockSize number of input samples to process per call. - * @return none. - */ - - void arm_fir_sparse_q15( - arm_fir_sparse_instance_q15 * S, - q15_t * pSrc, - q15_t * pDst, - q15_t * pScratchIn, - q31_t * pScratchOut, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q15 sparse FIR filter. - * @param[in,out] *S points to an instance of the Q15 sparse FIR structure. - * @param[in] numTaps number of nonzero coefficients in the filter. - * @param[in] *pCoeffs points to the array of filter coefficients. - * @param[in] *pState points to the state buffer. - * @param[in] *pTapDelay points to the array of offset times. - * @param[in] maxDelay maximum offset time supported. - * @param[in] blockSize number of samples that will be processed per block. - * @return none - */ - - void arm_fir_sparse_init_q15( - arm_fir_sparse_instance_q15 * S, - uint16_t numTaps, - q15_t * pCoeffs, - q15_t * pState, - int32_t * pTapDelay, - uint16_t maxDelay, - uint32_t blockSize); - - /** - * @brief Processing function for the Q7 sparse FIR filter. - * @param[in] *S points to an instance of the Q7 sparse FIR structure. - * @param[in] *pSrc points to the block of input data. - * @param[out] *pDst points to the block of output data - * @param[in] *pScratchIn points to a temporary buffer of size blockSize. - * @param[in] *pScratchOut points to a temporary buffer of size blockSize. - * @param[in] blockSize number of input samples to process per call. - * @return none. - */ - - void arm_fir_sparse_q7( - arm_fir_sparse_instance_q7 * S, - q7_t * pSrc, - q7_t * pDst, - q7_t * pScratchIn, - q31_t * pScratchOut, - uint32_t blockSize); - - /** - * @brief Initialization function for the Q7 sparse FIR filter. - * @param[in,out] *S points to an instance of the Q7 sparse FIR structure. - * @param[in] numTaps number of nonzero coefficients in the filter. - * @param[in] *pCoeffs points to the array of filter coefficients. - * @param[in] *pState points to the state buffer. - * @param[in] *pTapDelay points to the array of offset times. - * @param[in] maxDelay maximum offset time supported. - * @param[in] blockSize number of samples that will be processed per block. - * @return none - */ - - void arm_fir_sparse_init_q7( - arm_fir_sparse_instance_q7 * S, - uint16_t numTaps, - q7_t * pCoeffs, - q7_t * pState, - int32_t * pTapDelay, - uint16_t maxDelay, - uint32_t blockSize); - - - /* - * @brief Floating-point sin_cos function. - * @param[in] theta input value in degrees - * @param[out] *pSinVal points to the processed sine output. - * @param[out] *pCosVal points to the processed cos output. - * @return none. - */ - - void arm_sin_cos_f32( - float32_t theta, - float32_t * pSinVal, - float32_t * pCcosVal); - - /* - * @brief Q31 sin_cos function. - * @param[in] theta scaled input value in degrees - * @param[out] *pSinVal points to the processed sine output. - * @param[out] *pCosVal points to the processed cosine output. - * @return none. - */ - - void arm_sin_cos_q31( - q31_t theta, - q31_t * pSinVal, - q31_t * pCosVal); - - - /** - * @brief Floating-point complex conjugate. - * @param[in] *pSrc points to the input vector - * @param[out] *pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - * @return none. - */ - - void arm_cmplx_conj_f32( - float32_t * pSrc, - float32_t * pDst, - uint32_t numSamples); - - /** - * @brief Q31 complex conjugate. - * @param[in] *pSrc points to the input vector - * @param[out] *pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - * @return none. - */ - - void arm_cmplx_conj_q31( - q31_t * pSrc, - q31_t * pDst, - uint32_t numSamples); - - /** - * @brief Q15 complex conjugate. - * @param[in] *pSrc points to the input vector - * @param[out] *pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - * @return none. - */ - - void arm_cmplx_conj_q15( - q15_t * pSrc, - q15_t * pDst, - uint32_t numSamples); - - - - /** - * @brief Floating-point complex magnitude squared - * @param[in] *pSrc points to the complex input vector - * @param[out] *pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - * @return none. - */ - - void arm_cmplx_mag_squared_f32( - float32_t * pSrc, - float32_t * pDst, - uint32_t numSamples); - - /** - * @brief Q31 complex magnitude squared - * @param[in] *pSrc points to the complex input vector - * @param[out] *pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - * @return none. - */ - - void arm_cmplx_mag_squared_q31( - q31_t * pSrc, - q31_t * pDst, - uint32_t numSamples); - - /** - * @brief Q15 complex magnitude squared - * @param[in] *pSrc points to the complex input vector - * @param[out] *pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - * @return none. - */ - - void arm_cmplx_mag_squared_q15( - q15_t * pSrc, - q15_t * pDst, - uint32_t numSamples); - - - /** - * @ingroup groupController - */ - - /** - * @defgroup PID PID Motor Control - * - * A Proportional Integral Derivative (PID) controller is a generic feedback control - * loop mechanism widely used in industrial control systems. - * A PID controller is the most commonly used type of feedback controller. - * - * This set of functions implements (PID) controllers - * for Q15, Q31, and floating-point data types. The functions operate on a single sample - * of data and each call to the function returns a single processed value. - * S points to an instance of the PID control data structure. in - * is the input sample value. The functions return the output value. - * - * \par Algorithm: - *
-   *    y[n] = y[n-1] + A0 * x[n] + A1 * x[n-1] + A2 * x[n-2]
-   *    A0 = Kp + Ki + Kd
-   *    A1 = (-Kp ) - (2 * Kd )
-   *    A2 = Kd  
- * - * \par - * where \c Kp is proportional constant, \c Ki is Integral constant and \c Kd is Derivative constant - * - * \par - * \image html PID.gif "Proportional Integral Derivative Controller" - * - * \par - * The PID controller calculates an "error" value as the difference between - * the measured output and the reference input. - * The controller attempts to minimize the error by adjusting the process control inputs. - * The proportional value determines the reaction to the current error, - * the integral value determines the reaction based on the sum of recent errors, - * and the derivative value determines the reaction based on the rate at which the error has been changing. - * - * \par Instance Structure - * The Gains A0, A1, A2 and state variables for a PID controller are stored together in an instance data structure. - * A separate instance structure must be defined for each PID Controller. - * There are separate instance structure declarations for each of the 3 supported data types. - * - * \par Reset Functions - * There is also an associated reset function for each data type which clears the state array. - * - * \par Initialization Functions - * There is also an associated initialization function for each data type. - * The initialization function performs the following operations: - * - Initializes the Gains A0, A1, A2 from Kp,Ki, Kd gains. - * - Zeros out the values in the state buffer. - * - * \par - * Instance structure cannot be placed into a const data section and it is recommended to use the initialization function. - * - * \par Fixed-Point Behavior - * Care must be taken when using the fixed-point versions of the PID Controller functions. - * In particular, the overflow and saturation behavior of the accumulator used in each function must be considered. - * Refer to the function specific documentation below for usage guidelines. - */ - - /** - * @addtogroup PID - * @{ - */ - - /** - * @brief Process function for the floating-point PID Control. - * @param[in,out] *S is an instance of the floating-point PID Control structure - * @param[in] in input sample to process - * @return out processed output sample. - */ - - - static __INLINE float32_t arm_pid_f32( - arm_pid_instance_f32 * S, - float32_t in) - { - float32_t out; - - /* y[n] = y[n-1] + A0 * x[n] + A1 * x[n-1] + A2 * x[n-2] */ - out = (S->A0 * in) + - (S->A1 * S->state[0]) + (S->A2 * S->state[1]) + (S->state[2]); - - /* Update state */ - S->state[1] = S->state[0]; - S->state[0] = in; - S->state[2] = out; - - /* return to application */ - return (out); - - } - - /** - * @brief Process function for the Q31 PID Control. - * @param[in,out] *S points to an instance of the Q31 PID Control structure - * @param[in] in input sample to process - * @return out processed output sample. - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using an internal 64-bit accumulator. - * The accumulator has a 2.62 format and maintains full precision of the intermediate multiplication results but provides only a single guard bit. - * Thus, if the accumulator result overflows it wraps around rather than clip. - * In order to avoid overflows completely the input signal must be scaled down by 2 bits as there are four additions. - * After all multiply-accumulates are performed, the 2.62 accumulator is truncated to 1.32 format and then saturated to 1.31 format. - */ - - static __INLINE q31_t arm_pid_q31( - arm_pid_instance_q31 * S, - q31_t in) - { - q63_t acc; - q31_t out; - - /* acc = A0 * x[n] */ - acc = (q63_t) S->A0 * in; - - /* acc += A1 * x[n-1] */ - acc += (q63_t) S->A1 * S->state[0]; - - /* acc += A2 * x[n-2] */ - acc += (q63_t) S->A2 * S->state[1]; - - /* convert output to 1.31 format to add y[n-1] */ - out = (q31_t) (acc >> 31u); - - /* out += y[n-1] */ - out += S->state[2]; - - /* Update state */ - S->state[1] = S->state[0]; - S->state[0] = in; - S->state[2] = out; - - /* return to application */ - return (out); - - } - - /** - * @brief Process function for the Q15 PID Control. - * @param[in,out] *S points to an instance of the Q15 PID Control structure - * @param[in] in input sample to process - * @return out processed output sample. - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using a 64-bit internal accumulator. - * Both Gains and state variables are represented in 1.15 format and multiplications yield a 2.30 result. - * The 2.30 intermediate results are accumulated in a 64-bit accumulator in 34.30 format. - * There is no risk of internal overflow with this approach and the full precision of intermediate multiplications is preserved. - * After all additions have been performed, the accumulator is truncated to 34.15 format by discarding low 15 bits. - * Lastly, the accumulator is saturated to yield a result in 1.15 format. - */ - - static __INLINE q15_t arm_pid_q15( - arm_pid_instance_q15 * S, - q15_t in) - { - q63_t acc; - q15_t out; - -#ifndef ARM_MATH_CM0_FAMILY - __SIMD32_TYPE *vstate; - - /* Implementation of PID controller */ - - /* acc = A0 * x[n] */ - acc = (q31_t) __SMUAD(S->A0, in); - - /* acc += A1 * x[n-1] + A2 * x[n-2] */ - vstate = __SIMD32_CONST(S->state); - acc = __SMLALD(S->A1, (q31_t) *vstate, acc); - -#else - /* acc = A0 * x[n] */ - acc = ((q31_t) S->A0) * in; - - /* acc += A1 * x[n-1] + A2 * x[n-2] */ - acc += (q31_t) S->A1 * S->state[0]; - acc += (q31_t) S->A2 * S->state[1]; - -#endif - - /* acc += y[n-1] */ - acc += (q31_t) S->state[2] << 15; - - /* saturate the output */ - out = (q15_t) (__SSAT((acc >> 15), 16)); - - /* Update state */ - S->state[1] = S->state[0]; - S->state[0] = in; - S->state[2] = out; - - /* return to application */ - return (out); - - } - - /** - * @} end of PID group - */ - - - /** - * @brief Floating-point matrix inverse. - * @param[in] *src points to the instance of the input floating-point matrix structure. - * @param[out] *dst points to the instance of the output floating-point matrix structure. - * @return The function returns ARM_MATH_SIZE_MISMATCH, if the dimensions do not match. - * If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status ARM_MATH_SINGULAR. - */ - - arm_status arm_mat_inverse_f32( - const arm_matrix_instance_f32 * src, - arm_matrix_instance_f32 * dst); - - - /** - * @brief Floating-point matrix inverse. - * @param[in] *src points to the instance of the input floating-point matrix structure. - * @param[out] *dst points to the instance of the output floating-point matrix structure. - * @return The function returns ARM_MATH_SIZE_MISMATCH, if the dimensions do not match. - * If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status ARM_MATH_SINGULAR. - */ - - arm_status arm_mat_inverse_f64( - const arm_matrix_instance_f64 * src, - arm_matrix_instance_f64 * dst); - - - - /** - * @ingroup groupController - */ - - - /** - * @defgroup clarke Vector Clarke Transform - * Forward Clarke transform converts the instantaneous stator phases into a two-coordinate time invariant vector. - * Generally the Clarke transform uses three-phase currents Ia, Ib and Ic to calculate currents - * in the two-phase orthogonal stator axis Ialpha and Ibeta. - * When Ialpha is superposed with Ia as shown in the figure below - * \image html clarke.gif Stator current space vector and its components in (a,b). - * and Ia + Ib + Ic = 0, in this condition Ialpha and Ibeta - * can be calculated using only Ia and Ib. - * - * The function operates on a single sample of data and each call to the function returns the processed output. - * The library provides separate functions for Q31 and floating-point data types. - * \par Algorithm - * \image html clarkeFormula.gif - * where Ia and Ib are the instantaneous stator phases and - * pIalpha and pIbeta are the two coordinates of time invariant vector. - * \par Fixed-Point Behavior - * Care must be taken when using the Q31 version of the Clarke transform. - * In particular, the overflow and saturation behavior of the accumulator used must be considered. - * Refer to the function specific documentation below for usage guidelines. - */ - - /** - * @addtogroup clarke - * @{ - */ - - /** - * - * @brief Floating-point Clarke transform - * @param[in] Ia input three-phase coordinate a - * @param[in] Ib input three-phase coordinate b - * @param[out] *pIalpha points to output two-phase orthogonal vector axis alpha - * @param[out] *pIbeta points to output two-phase orthogonal vector axis beta - * @return none. - */ - - static __INLINE void arm_clarke_f32( - float32_t Ia, - float32_t Ib, - float32_t * pIalpha, - float32_t * pIbeta) - { - /* Calculate pIalpha using the equation, pIalpha = Ia */ - *pIalpha = Ia; - - /* Calculate pIbeta using the equation, pIbeta = (1/sqrt(3)) * Ia + (2/sqrt(3)) * Ib */ - *pIbeta = - ((float32_t) 0.57735026919 * Ia + (float32_t) 1.15470053838 * Ib); - - } - - /** - * @brief Clarke transform for Q31 version - * @param[in] Ia input three-phase coordinate a - * @param[in] Ib input three-phase coordinate b - * @param[out] *pIalpha points to output two-phase orthogonal vector axis alpha - * @param[out] *pIbeta points to output two-phase orthogonal vector axis beta - * @return none. - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using an internal 32-bit accumulator. - * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. - * There is saturation on the addition, hence there is no risk of overflow. - */ - - static __INLINE void arm_clarke_q31( - q31_t Ia, - q31_t Ib, - q31_t * pIalpha, - q31_t * pIbeta) - { - q31_t product1, product2; /* Temporary variables used to store intermediate results */ - - /* Calculating pIalpha from Ia by equation pIalpha = Ia */ - *pIalpha = Ia; - - /* Intermediate product is calculated by (1/(sqrt(3)) * Ia) */ - product1 = (q31_t) (((q63_t) Ia * 0x24F34E8B) >> 30); - - /* Intermediate product is calculated by (2/sqrt(3) * Ib) */ - product2 = (q31_t) (((q63_t) Ib * 0x49E69D16) >> 30); - - /* pIbeta is calculated by adding the intermediate products */ - *pIbeta = __QADD(product1, product2); - } - - /** - * @} end of clarke group - */ - - /** - * @brief Converts the elements of the Q7 vector to Q31 vector. - * @param[in] *pSrc input pointer - * @param[out] *pDst output pointer - * @param[in] blockSize number of samples to process - * @return none. - */ - void arm_q7_to_q31( - q7_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - - - /** - * @ingroup groupController - */ - - /** - * @defgroup inv_clarke Vector Inverse Clarke Transform - * Inverse Clarke transform converts the two-coordinate time invariant vector into instantaneous stator phases. - * - * The function operates on a single sample of data and each call to the function returns the processed output. - * The library provides separate functions for Q31 and floating-point data types. - * \par Algorithm - * \image html clarkeInvFormula.gif - * where pIa and pIb are the instantaneous stator phases and - * Ialpha and Ibeta are the two coordinates of time invariant vector. - * \par Fixed-Point Behavior - * Care must be taken when using the Q31 version of the Clarke transform. - * In particular, the overflow and saturation behavior of the accumulator used must be considered. - * Refer to the function specific documentation below for usage guidelines. - */ - - /** - * @addtogroup inv_clarke - * @{ - */ - - /** - * @brief Floating-point Inverse Clarke transform - * @param[in] Ialpha input two-phase orthogonal vector axis alpha - * @param[in] Ibeta input two-phase orthogonal vector axis beta - * @param[out] *pIa points to output three-phase coordinate a - * @param[out] *pIb points to output three-phase coordinate b - * @return none. - */ - - - static __INLINE void arm_inv_clarke_f32( - float32_t Ialpha, - float32_t Ibeta, - float32_t * pIa, - float32_t * pIb) - { - /* Calculating pIa from Ialpha by equation pIa = Ialpha */ - *pIa = Ialpha; - - /* Calculating pIb from Ialpha and Ibeta by equation pIb = -(1/2) * Ialpha + (sqrt(3)/2) * Ibeta */ - *pIb = -0.5 * Ialpha + (float32_t) 0.8660254039 *Ibeta; - - } - - /** - * @brief Inverse Clarke transform for Q31 version - * @param[in] Ialpha input two-phase orthogonal vector axis alpha - * @param[in] Ibeta input two-phase orthogonal vector axis beta - * @param[out] *pIa points to output three-phase coordinate a - * @param[out] *pIb points to output three-phase coordinate b - * @return none. - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using an internal 32-bit accumulator. - * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. - * There is saturation on the subtraction, hence there is no risk of overflow. - */ - - static __INLINE void arm_inv_clarke_q31( - q31_t Ialpha, - q31_t Ibeta, - q31_t * pIa, - q31_t * pIb) - { - q31_t product1, product2; /* Temporary variables used to store intermediate results */ - - /* Calculating pIa from Ialpha by equation pIa = Ialpha */ - *pIa = Ialpha; - - /* Intermediate product is calculated by (1/(2*sqrt(3)) * Ia) */ - product1 = (q31_t) (((q63_t) (Ialpha) * (0x40000000)) >> 31); - - /* Intermediate product is calculated by (1/sqrt(3) * pIb) */ - product2 = (q31_t) (((q63_t) (Ibeta) * (0x6ED9EBA1)) >> 31); - - /* pIb is calculated by subtracting the products */ - *pIb = __QSUB(product2, product1); - - } - - /** - * @} end of inv_clarke group - */ - - /** - * @brief Converts the elements of the Q7 vector to Q15 vector. - * @param[in] *pSrc input pointer - * @param[out] *pDst output pointer - * @param[in] blockSize number of samples to process - * @return none. - */ - void arm_q7_to_q15( - q7_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - - /** - * @ingroup groupController - */ - - /** - * @defgroup park Vector Park Transform - * - * Forward Park transform converts the input two-coordinate vector to flux and torque components. - * The Park transform can be used to realize the transformation of the Ialpha and the Ibeta currents - * from the stationary to the moving reference frame and control the spatial relationship between - * the stator vector current and rotor flux vector. - * If we consider the d axis aligned with the rotor flux, the diagram below shows the - * current vector and the relationship from the two reference frames: - * \image html park.gif "Stator current space vector and its component in (a,b) and in the d,q rotating reference frame" - * - * The function operates on a single sample of data and each call to the function returns the processed output. - * The library provides separate functions for Q31 and floating-point data types. - * \par Algorithm - * \image html parkFormula.gif - * where Ialpha and Ibeta are the stator vector components, - * pId and pIq are rotor vector components and cosVal and sinVal are the - * cosine and sine values of theta (rotor flux position). - * \par Fixed-Point Behavior - * Care must be taken when using the Q31 version of the Park transform. - * In particular, the overflow and saturation behavior of the accumulator used must be considered. - * Refer to the function specific documentation below for usage guidelines. - */ - - /** - * @addtogroup park - * @{ - */ - - /** - * @brief Floating-point Park transform - * @param[in] Ialpha input two-phase vector coordinate alpha - * @param[in] Ibeta input two-phase vector coordinate beta - * @param[out] *pId points to output rotor reference frame d - * @param[out] *pIq points to output rotor reference frame q - * @param[in] sinVal sine value of rotation angle theta - * @param[in] cosVal cosine value of rotation angle theta - * @return none. - * - * The function implements the forward Park transform. - * - */ - - static __INLINE void arm_park_f32( - float32_t Ialpha, - float32_t Ibeta, - float32_t * pId, - float32_t * pIq, - float32_t sinVal, - float32_t cosVal) - { - /* Calculate pId using the equation, pId = Ialpha * cosVal + Ibeta * sinVal */ - *pId = Ialpha * cosVal + Ibeta * sinVal; - - /* Calculate pIq using the equation, pIq = - Ialpha * sinVal + Ibeta * cosVal */ - *pIq = -Ialpha * sinVal + Ibeta * cosVal; - - } - - /** - * @brief Park transform for Q31 version - * @param[in] Ialpha input two-phase vector coordinate alpha - * @param[in] Ibeta input two-phase vector coordinate beta - * @param[out] *pId points to output rotor reference frame d - * @param[out] *pIq points to output rotor reference frame q - * @param[in] sinVal sine value of rotation angle theta - * @param[in] cosVal cosine value of rotation angle theta - * @return none. - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using an internal 32-bit accumulator. - * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. - * There is saturation on the addition and subtraction, hence there is no risk of overflow. - */ - - - static __INLINE void arm_park_q31( - q31_t Ialpha, - q31_t Ibeta, - q31_t * pId, - q31_t * pIq, - q31_t sinVal, - q31_t cosVal) - { - q31_t product1, product2; /* Temporary variables used to store intermediate results */ - q31_t product3, product4; /* Temporary variables used to store intermediate results */ - - /* Intermediate product is calculated by (Ialpha * cosVal) */ - product1 = (q31_t) (((q63_t) (Ialpha) * (cosVal)) >> 31); - - /* Intermediate product is calculated by (Ibeta * sinVal) */ - product2 = (q31_t) (((q63_t) (Ibeta) * (sinVal)) >> 31); - - - /* Intermediate product is calculated by (Ialpha * sinVal) */ - product3 = (q31_t) (((q63_t) (Ialpha) * (sinVal)) >> 31); - - /* Intermediate product is calculated by (Ibeta * cosVal) */ - product4 = (q31_t) (((q63_t) (Ibeta) * (cosVal)) >> 31); - - /* Calculate pId by adding the two intermediate products 1 and 2 */ - *pId = __QADD(product1, product2); - - /* Calculate pIq by subtracting the two intermediate products 3 from 4 */ - *pIq = __QSUB(product4, product3); - } - - /** - * @} end of park group - */ - - /** - * @brief Converts the elements of the Q7 vector to floating-point vector. - * @param[in] *pSrc is input pointer - * @param[out] *pDst is output pointer - * @param[in] blockSize is the number of samples to process - * @return none. - */ - void arm_q7_to_float( - q7_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @ingroup groupController - */ - - /** - * @defgroup inv_park Vector Inverse Park transform - * Inverse Park transform converts the input flux and torque components to two-coordinate vector. - * - * The function operates on a single sample of data and each call to the function returns the processed output. - * The library provides separate functions for Q31 and floating-point data types. - * \par Algorithm - * \image html parkInvFormula.gif - * where pIalpha and pIbeta are the stator vector components, - * Id and Iq are rotor vector components and cosVal and sinVal are the - * cosine and sine values of theta (rotor flux position). - * \par Fixed-Point Behavior - * Care must be taken when using the Q31 version of the Park transform. - * In particular, the overflow and saturation behavior of the accumulator used must be considered. - * Refer to the function specific documentation below for usage guidelines. - */ - - /** - * @addtogroup inv_park - * @{ - */ - - /** - * @brief Floating-point Inverse Park transform - * @param[in] Id input coordinate of rotor reference frame d - * @param[in] Iq input coordinate of rotor reference frame q - * @param[out] *pIalpha points to output two-phase orthogonal vector axis alpha - * @param[out] *pIbeta points to output two-phase orthogonal vector axis beta - * @param[in] sinVal sine value of rotation angle theta - * @param[in] cosVal cosine value of rotation angle theta - * @return none. - */ - - static __INLINE void arm_inv_park_f32( - float32_t Id, - float32_t Iq, - float32_t * pIalpha, - float32_t * pIbeta, - float32_t sinVal, - float32_t cosVal) - { - /* Calculate pIalpha using the equation, pIalpha = Id * cosVal - Iq * sinVal */ - *pIalpha = Id * cosVal - Iq * sinVal; - - /* Calculate pIbeta using the equation, pIbeta = Id * sinVal + Iq * cosVal */ - *pIbeta = Id * sinVal + Iq * cosVal; - - } - - - /** - * @brief Inverse Park transform for Q31 version - * @param[in] Id input coordinate of rotor reference frame d - * @param[in] Iq input coordinate of rotor reference frame q - * @param[out] *pIalpha points to output two-phase orthogonal vector axis alpha - * @param[out] *pIbeta points to output two-phase orthogonal vector axis beta - * @param[in] sinVal sine value of rotation angle theta - * @param[in] cosVal cosine value of rotation angle theta - * @return none. - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using an internal 32-bit accumulator. - * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. - * There is saturation on the addition, hence there is no risk of overflow. - */ - - - static __INLINE void arm_inv_park_q31( - q31_t Id, - q31_t Iq, - q31_t * pIalpha, - q31_t * pIbeta, - q31_t sinVal, - q31_t cosVal) - { - q31_t product1, product2; /* Temporary variables used to store intermediate results */ - q31_t product3, product4; /* Temporary variables used to store intermediate results */ - - /* Intermediate product is calculated by (Id * cosVal) */ - product1 = (q31_t) (((q63_t) (Id) * (cosVal)) >> 31); - - /* Intermediate product is calculated by (Iq * sinVal) */ - product2 = (q31_t) (((q63_t) (Iq) * (sinVal)) >> 31); - - - /* Intermediate product is calculated by (Id * sinVal) */ - product3 = (q31_t) (((q63_t) (Id) * (sinVal)) >> 31); - - /* Intermediate product is calculated by (Iq * cosVal) */ - product4 = (q31_t) (((q63_t) (Iq) * (cosVal)) >> 31); - - /* Calculate pIalpha by using the two intermediate products 1 and 2 */ - *pIalpha = __QSUB(product1, product2); - - /* Calculate pIbeta by using the two intermediate products 3 and 4 */ - *pIbeta = __QADD(product4, product3); - - } - - /** - * @} end of Inverse park group - */ - - - /** - * @brief Converts the elements of the Q31 vector to floating-point vector. - * @param[in] *pSrc is input pointer - * @param[out] *pDst is output pointer - * @param[in] blockSize is the number of samples to process - * @return none. - */ - void arm_q31_to_float( - q31_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - /** - * @ingroup groupInterpolation - */ - - /** - * @defgroup LinearInterpolate Linear Interpolation - * - * Linear interpolation is a method of curve fitting using linear polynomials. - * Linear interpolation works by effectively drawing a straight line between two neighboring samples and returning the appropriate point along that line - * - * \par - * \image html LinearInterp.gif "Linear interpolation" - * - * \par - * A Linear Interpolate function calculates an output value(y), for the input(x) - * using linear interpolation of the input values x0, x1( nearest input values) and the output values y0 and y1(nearest output values) - * - * \par Algorithm: - *
-   *       y = y0 + (x - x0) * ((y1 - y0)/(x1-x0))
-   *       where x0, x1 are nearest values of input x
-   *             y0, y1 are nearest values to output y
-   * 
- * - * \par - * This set of functions implements Linear interpolation process - * for Q7, Q15, Q31, and floating-point data types. The functions operate on a single - * sample of data and each call to the function returns a single processed value. - * S points to an instance of the Linear Interpolate function data structure. - * x is the input sample value. The functions returns the output value. - * - * \par - * if x is outside of the table boundary, Linear interpolation returns first value of the table - * if x is below input range and returns last value of table if x is above range. - */ - - /** - * @addtogroup LinearInterpolate - * @{ - */ - - /** - * @brief Process function for the floating-point Linear Interpolation Function. - * @param[in,out] *S is an instance of the floating-point Linear Interpolation structure - * @param[in] x input sample to process - * @return y processed output sample. - * - */ - - static __INLINE float32_t arm_linear_interp_f32( - arm_linear_interp_instance_f32 * S, - float32_t x) - { - - float32_t y; - float32_t x0, x1; /* Nearest input values */ - float32_t y0, y1; /* Nearest output values */ - float32_t xSpacing = S->xSpacing; /* spacing between input values */ - int32_t i; /* Index variable */ - float32_t *pYData = S->pYData; /* pointer to output table */ - - /* Calculation of index */ - i = (int32_t) ((x - S->x1) / xSpacing); - - if(i < 0) - { - /* Iniatilize output for below specified range as least output value of table */ - y = pYData[0]; - } - else if((uint32_t)i >= S->nValues) - { - /* Iniatilize output for above specified range as last output value of table */ - y = pYData[S->nValues - 1]; - } - else - { - /* Calculation of nearest input values */ - x0 = S->x1 + i * xSpacing; - x1 = S->x1 + (i + 1) * xSpacing; - - /* Read of nearest output values */ - y0 = pYData[i]; - y1 = pYData[i + 1]; - - /* Calculation of output */ - y = y0 + (x - x0) * ((y1 - y0) / (x1 - x0)); - - } - - /* returns output value */ - return (y); - } - - /** - * - * @brief Process function for the Q31 Linear Interpolation Function. - * @param[in] *pYData pointer to Q31 Linear Interpolation table - * @param[in] x input sample to process - * @param[in] nValues number of table values - * @return y processed output sample. - * - * \par - * Input sample x is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. - * This function can support maximum of table size 2^12. - * - */ - - - static __INLINE q31_t arm_linear_interp_q31( - q31_t * pYData, - q31_t x, - uint32_t nValues) - { - q31_t y; /* output */ - q31_t y0, y1; /* Nearest output values */ - q31_t fract; /* fractional part */ - int32_t index; /* Index to read nearest output values */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - index = ((x & 0xFFF00000) >> 20); - - if(index >= (int32_t)(nValues - 1)) - { - return (pYData[nValues - 1]); - } - else if(index < 0) - { - return (pYData[0]); - } - else - { - - /* 20 bits for the fractional part */ - /* shift left by 11 to keep fract in 1.31 format */ - fract = (x & 0x000FFFFF) << 11; - - /* Read two nearest output values from the index in 1.31(q31) format */ - y0 = pYData[index]; - y1 = pYData[index + 1u]; - - /* Calculation of y0 * (1-fract) and y is in 2.30 format */ - y = ((q31_t) ((q63_t) y0 * (0x7FFFFFFF - fract) >> 32)); - - /* Calculation of y0 * (1-fract) + y1 *fract and y is in 2.30 format */ - y += ((q31_t) (((q63_t) y1 * fract) >> 32)); - - /* Convert y to 1.31 format */ - return (y << 1u); - - } - - } - - /** - * - * @brief Process function for the Q15 Linear Interpolation Function. - * @param[in] *pYData pointer to Q15 Linear Interpolation table - * @param[in] x input sample to process - * @param[in] nValues number of table values - * @return y processed output sample. - * - * \par - * Input sample x is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. - * This function can support maximum of table size 2^12. - * - */ - - - static __INLINE q15_t arm_linear_interp_q15( - q15_t * pYData, - q31_t x, - uint32_t nValues) - { - q63_t y; /* output */ - q15_t y0, y1; /* Nearest output values */ - q31_t fract; /* fractional part */ - int32_t index; /* Index to read nearest output values */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - index = ((x & 0xFFF00000) >> 20u); - - if(index >= (int32_t)(nValues - 1)) - { - return (pYData[nValues - 1]); - } - else if(index < 0) - { - return (pYData[0]); - } - else - { - /* 20 bits for the fractional part */ - /* fract is in 12.20 format */ - fract = (x & 0x000FFFFF); - - /* Read two nearest output values from the index */ - y0 = pYData[index]; - y1 = pYData[index + 1u]; - - /* Calculation of y0 * (1-fract) and y is in 13.35 format */ - y = ((q63_t) y0 * (0xFFFFF - fract)); - - /* Calculation of (y0 * (1-fract) + y1 * fract) and y is in 13.35 format */ - y += ((q63_t) y1 * (fract)); - - /* convert y to 1.15 format */ - return (y >> 20); - } - - - } - - /** - * - * @brief Process function for the Q7 Linear Interpolation Function. - * @param[in] *pYData pointer to Q7 Linear Interpolation table - * @param[in] x input sample to process - * @param[in] nValues number of table values - * @return y processed output sample. - * - * \par - * Input sample x is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. - * This function can support maximum of table size 2^12. - */ - - - static __INLINE q7_t arm_linear_interp_q7( - q7_t * pYData, - q31_t x, - uint32_t nValues) - { - q31_t y; /* output */ - q7_t y0, y1; /* Nearest output values */ - q31_t fract; /* fractional part */ - uint32_t index; /* Index to read nearest output values */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - if (x < 0) - { - return (pYData[0]); - } - index = (x >> 20) & 0xfff; - - - if(index >= (nValues - 1)) - { - return (pYData[nValues - 1]); - } - else - { - - /* 20 bits for the fractional part */ - /* fract is in 12.20 format */ - fract = (x & 0x000FFFFF); - - /* Read two nearest output values from the index and are in 1.7(q7) format */ - y0 = pYData[index]; - y1 = pYData[index + 1u]; - - /* Calculation of y0 * (1-fract ) and y is in 13.27(q27) format */ - y = ((y0 * (0xFFFFF - fract))); - - /* Calculation of y1 * fract + y0 * (1-fract) and y is in 13.27(q27) format */ - y += (y1 * fract); - - /* convert y to 1.7(q7) format */ - return (y >> 20u); - - } - - } - /** - * @} end of LinearInterpolate group - */ - - /** - * @brief Fast approximation to the trigonometric sine function for floating-point data. - * @param[in] x input value in radians. - * @return sin(x). - */ - - float32_t arm_sin_f32( - float32_t x); - - /** - * @brief Fast approximation to the trigonometric sine function for Q31 data. - * @param[in] x Scaled input value in radians. - * @return sin(x). - */ - - q31_t arm_sin_q31( - q31_t x); - - /** - * @brief Fast approximation to the trigonometric sine function for Q15 data. - * @param[in] x Scaled input value in radians. - * @return sin(x). - */ - - q15_t arm_sin_q15( - q15_t x); - - /** - * @brief Fast approximation to the trigonometric cosine function for floating-point data. - * @param[in] x input value in radians. - * @return cos(x). - */ - - float32_t arm_cos_f32( - float32_t x); - - /** - * @brief Fast approximation to the trigonometric cosine function for Q31 data. - * @param[in] x Scaled input value in radians. - * @return cos(x). - */ - - q31_t arm_cos_q31( - q31_t x); - - /** - * @brief Fast approximation to the trigonometric cosine function for Q15 data. - * @param[in] x Scaled input value in radians. - * @return cos(x). - */ - - q15_t arm_cos_q15( - q15_t x); - - - /** - * @ingroup groupFastMath - */ - - - /** - * @defgroup SQRT Square Root - * - * Computes the square root of a number. - * There are separate functions for Q15, Q31, and floating-point data types. - * The square root function is computed using the Newton-Raphson algorithm. - * This is an iterative algorithm of the form: - *
-   *      x1 = x0 - f(x0)/f'(x0)
-   * 
- * where x1 is the current estimate, - * x0 is the previous estimate, and - * f'(x0) is the derivative of f() evaluated at x0. - * For the square root function, the algorithm reduces to: - *
-   *     x0 = in/2                         [initial guess]
-   *     x1 = 1/2 * ( x0 + in / x0)        [each iteration]
-   * 
- */ - - - /** - * @addtogroup SQRT - * @{ - */ - - /** - * @brief Floating-point square root function. - * @param[in] in input value. - * @param[out] *pOut square root of input value. - * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if - * in is negative value and returns zero output for negative values. - */ - - static __INLINE arm_status arm_sqrt_f32( - float32_t in, - float32_t * pOut) - { - if(in >= 0.0f) - { - -// #if __FPU_USED -#if (__FPU_USED == 1) && defined ( __CC_ARM ) - *pOut = __sqrtf(in); -#else - *pOut = sqrtf(in); -#endif - - return (ARM_MATH_SUCCESS); - } - else - { - *pOut = 0.0f; - return (ARM_MATH_ARGUMENT_ERROR); - } - - } - - - /** - * @brief Q31 square root function. - * @param[in] in input value. The range of the input value is [0 +1) or 0x00000000 to 0x7FFFFFFF. - * @param[out] *pOut square root of input value. - * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if - * in is negative value and returns zero output for negative values. - */ - arm_status arm_sqrt_q31( - q31_t in, - q31_t * pOut); - - /** - * @brief Q15 square root function. - * @param[in] in input value. The range of the input value is [0 +1) or 0x0000 to 0x7FFF. - * @param[out] *pOut square root of input value. - * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if - * in is negative value and returns zero output for negative values. - */ - arm_status arm_sqrt_q15( - q15_t in, - q15_t * pOut); - - /** - * @} end of SQRT group - */ - - - - - - - /** - * @brief floating-point Circular write function. - */ - - static __INLINE void arm_circularWrite_f32( - int32_t * circBuffer, - int32_t L, - uint16_t * writeOffset, - int32_t bufferInc, - const int32_t * src, - int32_t srcInc, - uint32_t blockSize) - { - uint32_t i = 0u; - int32_t wOffset; - - /* Copy the value of Index pointer that points - * to the current location where the input samples to be copied */ - wOffset = *writeOffset; - - /* Loop over the blockSize */ - i = blockSize; - - while(i > 0u) - { - /* copy the input sample to the circular buffer */ - circBuffer[wOffset] = *src; - - /* Update the input pointer */ - src += srcInc; - - /* Circularly update wOffset. Watch out for positive and negative value */ - wOffset += bufferInc; - if(wOffset >= L) - wOffset -= L; - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *writeOffset = wOffset; - } - - - - /** - * @brief floating-point Circular Read function. - */ - static __INLINE void arm_circularRead_f32( - int32_t * circBuffer, - int32_t L, - int32_t * readOffset, - int32_t bufferInc, - int32_t * dst, - int32_t * dst_base, - int32_t dst_length, - int32_t dstInc, - uint32_t blockSize) - { - uint32_t i = 0u; - int32_t rOffset, dst_end; - - /* Copy the value of Index pointer that points - * to the current location from where the input samples to be read */ - rOffset = *readOffset; - dst_end = (int32_t) (dst_base + dst_length); - - /* Loop over the blockSize */ - i = blockSize; - - while(i > 0u) - { - /* copy the sample from the circular buffer to the destination buffer */ - *dst = circBuffer[rOffset]; - - /* Update the input pointer */ - dst += dstInc; - - if(dst == (int32_t *) dst_end) - { - dst = dst_base; - } - - /* Circularly update rOffset. Watch out for positive and negative value */ - rOffset += bufferInc; - - if(rOffset >= L) - { - rOffset -= L; - } - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *readOffset = rOffset; - } - - /** - * @brief Q15 Circular write function. - */ - - static __INLINE void arm_circularWrite_q15( - q15_t * circBuffer, - int32_t L, - uint16_t * writeOffset, - int32_t bufferInc, - const q15_t * src, - int32_t srcInc, - uint32_t blockSize) - { - uint32_t i = 0u; - int32_t wOffset; - - /* Copy the value of Index pointer that points - * to the current location where the input samples to be copied */ - wOffset = *writeOffset; - - /* Loop over the blockSize */ - i = blockSize; - - while(i > 0u) - { - /* copy the input sample to the circular buffer */ - circBuffer[wOffset] = *src; - - /* Update the input pointer */ - src += srcInc; - - /* Circularly update wOffset. Watch out for positive and negative value */ - wOffset += bufferInc; - if(wOffset >= L) - wOffset -= L; - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *writeOffset = wOffset; - } - - - - /** - * @brief Q15 Circular Read function. - */ - static __INLINE void arm_circularRead_q15( - q15_t * circBuffer, - int32_t L, - int32_t * readOffset, - int32_t bufferInc, - q15_t * dst, - q15_t * dst_base, - int32_t dst_length, - int32_t dstInc, - uint32_t blockSize) - { - uint32_t i = 0; - int32_t rOffset, dst_end; - - /* Copy the value of Index pointer that points - * to the current location from where the input samples to be read */ - rOffset = *readOffset; - - dst_end = (int32_t) (dst_base + dst_length); - - /* Loop over the blockSize */ - i = blockSize; - - while(i > 0u) - { - /* copy the sample from the circular buffer to the destination buffer */ - *dst = circBuffer[rOffset]; - - /* Update the input pointer */ - dst += dstInc; - - if(dst == (q15_t *) dst_end) - { - dst = dst_base; - } - - /* Circularly update wOffset. Watch out for positive and negative value */ - rOffset += bufferInc; - - if(rOffset >= L) - { - rOffset -= L; - } - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *readOffset = rOffset; - } - - - /** - * @brief Q7 Circular write function. - */ - - static __INLINE void arm_circularWrite_q7( - q7_t * circBuffer, - int32_t L, - uint16_t * writeOffset, - int32_t bufferInc, - const q7_t * src, - int32_t srcInc, - uint32_t blockSize) - { - uint32_t i = 0u; - int32_t wOffset; - - /* Copy the value of Index pointer that points - * to the current location where the input samples to be copied */ - wOffset = *writeOffset; - - /* Loop over the blockSize */ - i = blockSize; - - while(i > 0u) - { - /* copy the input sample to the circular buffer */ - circBuffer[wOffset] = *src; - - /* Update the input pointer */ - src += srcInc; - - /* Circularly update wOffset. Watch out for positive and negative value */ - wOffset += bufferInc; - if(wOffset >= L) - wOffset -= L; - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *writeOffset = wOffset; - } - - - - /** - * @brief Q7 Circular Read function. - */ - static __INLINE void arm_circularRead_q7( - q7_t * circBuffer, - int32_t L, - int32_t * readOffset, - int32_t bufferInc, - q7_t * dst, - q7_t * dst_base, - int32_t dst_length, - int32_t dstInc, - uint32_t blockSize) - { - uint32_t i = 0; - int32_t rOffset, dst_end; - - /* Copy the value of Index pointer that points - * to the current location from where the input samples to be read */ - rOffset = *readOffset; - - dst_end = (int32_t) (dst_base + dst_length); - - /* Loop over the blockSize */ - i = blockSize; - - while(i > 0u) - { - /* copy the sample from the circular buffer to the destination buffer */ - *dst = circBuffer[rOffset]; - - /* Update the input pointer */ - dst += dstInc; - - if(dst == (q7_t *) dst_end) - { - dst = dst_base; - } - - /* Circularly update rOffset. Watch out for positive and negative value */ - rOffset += bufferInc; - - if(rOffset >= L) - { - rOffset -= L; - } - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *readOffset = rOffset; - } - - - /** - * @brief Sum of the squares of the elements of a Q31 vector. - * @param[in] *pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] *pResult is output value. - * @return none. - */ - - void arm_power_q31( - q31_t * pSrc, - uint32_t blockSize, - q63_t * pResult); - - /** - * @brief Sum of the squares of the elements of a floating-point vector. - * @param[in] *pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] *pResult is output value. - * @return none. - */ - - void arm_power_f32( - float32_t * pSrc, - uint32_t blockSize, - float32_t * pResult); - - /** - * @brief Sum of the squares of the elements of a Q15 vector. - * @param[in] *pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] *pResult is output value. - * @return none. - */ - - void arm_power_q15( - q15_t * pSrc, - uint32_t blockSize, - q63_t * pResult); - - /** - * @brief Sum of the squares of the elements of a Q7 vector. - * @param[in] *pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] *pResult is output value. - * @return none. - */ - - void arm_power_q7( - q7_t * pSrc, - uint32_t blockSize, - q31_t * pResult); - - /** - * @brief Mean value of a Q7 vector. - * @param[in] *pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] *pResult is output value. - * @return none. - */ - - void arm_mean_q7( - q7_t * pSrc, - uint32_t blockSize, - q7_t * pResult); - - /** - * @brief Mean value of a Q15 vector. - * @param[in] *pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] *pResult is output value. - * @return none. - */ - void arm_mean_q15( - q15_t * pSrc, - uint32_t blockSize, - q15_t * pResult); - - /** - * @brief Mean value of a Q31 vector. - * @param[in] *pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] *pResult is output value. - * @return none. - */ - void arm_mean_q31( - q31_t * pSrc, - uint32_t blockSize, - q31_t * pResult); - - /** - * @brief Mean value of a floating-point vector. - * @param[in] *pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] *pResult is output value. - * @return none. - */ - void arm_mean_f32( - float32_t * pSrc, - uint32_t blockSize, - float32_t * pResult); - - /** - * @brief Variance of the elements of a floating-point vector. - * @param[in] *pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] *pResult is output value. - * @return none. - */ - - void arm_var_f32( - float32_t * pSrc, - uint32_t blockSize, - float32_t * pResult); - - /** - * @brief Variance of the elements of a Q31 vector. - * @param[in] *pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] *pResult is output value. - * @return none. - */ - - void arm_var_q31( - q31_t * pSrc, - uint32_t blockSize, - q31_t * pResult); - - /** - * @brief Variance of the elements of a Q15 vector. - * @param[in] *pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] *pResult is output value. - * @return none. - */ - - void arm_var_q15( - q15_t * pSrc, - uint32_t blockSize, - q15_t * pResult); - - /** - * @brief Root Mean Square of the elements of a floating-point vector. - * @param[in] *pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] *pResult is output value. - * @return none. - */ - - void arm_rms_f32( - float32_t * pSrc, - uint32_t blockSize, - float32_t * pResult); - - /** - * @brief Root Mean Square of the elements of a Q31 vector. - * @param[in] *pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] *pResult is output value. - * @return none. - */ - - void arm_rms_q31( - q31_t * pSrc, - uint32_t blockSize, - q31_t * pResult); - - /** - * @brief Root Mean Square of the elements of a Q15 vector. - * @param[in] *pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] *pResult is output value. - * @return none. - */ - - void arm_rms_q15( - q15_t * pSrc, - uint32_t blockSize, - q15_t * pResult); - - /** - * @brief Standard deviation of the elements of a floating-point vector. - * @param[in] *pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] *pResult is output value. - * @return none. - */ - - void arm_std_f32( - float32_t * pSrc, - uint32_t blockSize, - float32_t * pResult); - - /** - * @brief Standard deviation of the elements of a Q31 vector. - * @param[in] *pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] *pResult is output value. - * @return none. - */ - - void arm_std_q31( - q31_t * pSrc, - uint32_t blockSize, - q31_t * pResult); - - /** - * @brief Standard deviation of the elements of a Q15 vector. - * @param[in] *pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] *pResult is output value. - * @return none. - */ - - void arm_std_q15( - q15_t * pSrc, - uint32_t blockSize, - q15_t * pResult); - - /** - * @brief Floating-point complex magnitude - * @param[in] *pSrc points to the complex input vector - * @param[out] *pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - * @return none. - */ - - void arm_cmplx_mag_f32( - float32_t * pSrc, - float32_t * pDst, - uint32_t numSamples); - - /** - * @brief Q31 complex magnitude - * @param[in] *pSrc points to the complex input vector - * @param[out] *pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - * @return none. - */ - - void arm_cmplx_mag_q31( - q31_t * pSrc, - q31_t * pDst, - uint32_t numSamples); - - /** - * @brief Q15 complex magnitude - * @param[in] *pSrc points to the complex input vector - * @param[out] *pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - * @return none. - */ - - void arm_cmplx_mag_q15( - q15_t * pSrc, - q15_t * pDst, - uint32_t numSamples); - - /** - * @brief Q15 complex dot product - * @param[in] *pSrcA points to the first input vector - * @param[in] *pSrcB points to the second input vector - * @param[in] numSamples number of complex samples in each vector - * @param[out] *realResult real part of the result returned here - * @param[out] *imagResult imaginary part of the result returned here - * @return none. - */ - - void arm_cmplx_dot_prod_q15( - q15_t * pSrcA, - q15_t * pSrcB, - uint32_t numSamples, - q31_t * realResult, - q31_t * imagResult); - - /** - * @brief Q31 complex dot product - * @param[in] *pSrcA points to the first input vector - * @param[in] *pSrcB points to the second input vector - * @param[in] numSamples number of complex samples in each vector - * @param[out] *realResult real part of the result returned here - * @param[out] *imagResult imaginary part of the result returned here - * @return none. - */ - - void arm_cmplx_dot_prod_q31( - q31_t * pSrcA, - q31_t * pSrcB, - uint32_t numSamples, - q63_t * realResult, - q63_t * imagResult); - - /** - * @brief Floating-point complex dot product - * @param[in] *pSrcA points to the first input vector - * @param[in] *pSrcB points to the second input vector - * @param[in] numSamples number of complex samples in each vector - * @param[out] *realResult real part of the result returned here - * @param[out] *imagResult imaginary part of the result returned here - * @return none. - */ - - void arm_cmplx_dot_prod_f32( - float32_t * pSrcA, - float32_t * pSrcB, - uint32_t numSamples, - float32_t * realResult, - float32_t * imagResult); - - /** - * @brief Q15 complex-by-real multiplication - * @param[in] *pSrcCmplx points to the complex input vector - * @param[in] *pSrcReal points to the real input vector - * @param[out] *pCmplxDst points to the complex output vector - * @param[in] numSamples number of samples in each vector - * @return none. - */ - - void arm_cmplx_mult_real_q15( - q15_t * pSrcCmplx, - q15_t * pSrcReal, - q15_t * pCmplxDst, - uint32_t numSamples); - - /** - * @brief Q31 complex-by-real multiplication - * @param[in] *pSrcCmplx points to the complex input vector - * @param[in] *pSrcReal points to the real input vector - * @param[out] *pCmplxDst points to the complex output vector - * @param[in] numSamples number of samples in each vector - * @return none. - */ - - void arm_cmplx_mult_real_q31( - q31_t * pSrcCmplx, - q31_t * pSrcReal, - q31_t * pCmplxDst, - uint32_t numSamples); - - /** - * @brief Floating-point complex-by-real multiplication - * @param[in] *pSrcCmplx points to the complex input vector - * @param[in] *pSrcReal points to the real input vector - * @param[out] *pCmplxDst points to the complex output vector - * @param[in] numSamples number of samples in each vector - * @return none. - */ - - void arm_cmplx_mult_real_f32( - float32_t * pSrcCmplx, - float32_t * pSrcReal, - float32_t * pCmplxDst, - uint32_t numSamples); - - /** - * @brief Minimum value of a Q7 vector. - * @param[in] *pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] *result is output pointer - * @param[in] index is the array index of the minimum value in the input buffer. - * @return none. - */ - - void arm_min_q7( - q7_t * pSrc, - uint32_t blockSize, - q7_t * result, - uint32_t * index); - - /** - * @brief Minimum value of a Q15 vector. - * @param[in] *pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] *pResult is output pointer - * @param[in] *pIndex is the array index of the minimum value in the input buffer. - * @return none. - */ - - void arm_min_q15( - q15_t * pSrc, - uint32_t blockSize, - q15_t * pResult, - uint32_t * pIndex); - - /** - * @brief Minimum value of a Q31 vector. - * @param[in] *pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] *pResult is output pointer - * @param[out] *pIndex is the array index of the minimum value in the input buffer. - * @return none. - */ - void arm_min_q31( - q31_t * pSrc, - uint32_t blockSize, - q31_t * pResult, - uint32_t * pIndex); - - /** - * @brief Minimum value of a floating-point vector. - * @param[in] *pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] *pResult is output pointer - * @param[out] *pIndex is the array index of the minimum value in the input buffer. - * @return none. - */ - - void arm_min_f32( - float32_t * pSrc, - uint32_t blockSize, - float32_t * pResult, - uint32_t * pIndex); - -/** - * @brief Maximum value of a Q7 vector. - * @param[in] *pSrc points to the input buffer - * @param[in] blockSize length of the input vector - * @param[out] *pResult maximum value returned here - * @param[out] *pIndex index of maximum value returned here - * @return none. - */ - - void arm_max_q7( - q7_t * pSrc, - uint32_t blockSize, - q7_t * pResult, - uint32_t * pIndex); - -/** - * @brief Maximum value of a Q15 vector. - * @param[in] *pSrc points to the input buffer - * @param[in] blockSize length of the input vector - * @param[out] *pResult maximum value returned here - * @param[out] *pIndex index of maximum value returned here - * @return none. - */ - - void arm_max_q15( - q15_t * pSrc, - uint32_t blockSize, - q15_t * pResult, - uint32_t * pIndex); - -/** - * @brief Maximum value of a Q31 vector. - * @param[in] *pSrc points to the input buffer - * @param[in] blockSize length of the input vector - * @param[out] *pResult maximum value returned here - * @param[out] *pIndex index of maximum value returned here - * @return none. - */ - - void arm_max_q31( - q31_t * pSrc, - uint32_t blockSize, - q31_t * pResult, - uint32_t * pIndex); - -/** - * @brief Maximum value of a floating-point vector. - * @param[in] *pSrc points to the input buffer - * @param[in] blockSize length of the input vector - * @param[out] *pResult maximum value returned here - * @param[out] *pIndex index of maximum value returned here - * @return none. - */ - - void arm_max_f32( - float32_t * pSrc, - uint32_t blockSize, - float32_t * pResult, - uint32_t * pIndex); - - /** - * @brief Q15 complex-by-complex multiplication - * @param[in] *pSrcA points to the first input vector - * @param[in] *pSrcB points to the second input vector - * @param[out] *pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - * @return none. - */ - - void arm_cmplx_mult_cmplx_q15( - q15_t * pSrcA, - q15_t * pSrcB, - q15_t * pDst, - uint32_t numSamples); - - /** - * @brief Q31 complex-by-complex multiplication - * @param[in] *pSrcA points to the first input vector - * @param[in] *pSrcB points to the second input vector - * @param[out] *pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - * @return none. - */ - - void arm_cmplx_mult_cmplx_q31( - q31_t * pSrcA, - q31_t * pSrcB, - q31_t * pDst, - uint32_t numSamples); - - /** - * @brief Floating-point complex-by-complex multiplication - * @param[in] *pSrcA points to the first input vector - * @param[in] *pSrcB points to the second input vector - * @param[out] *pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - * @return none. - */ - - void arm_cmplx_mult_cmplx_f32( - float32_t * pSrcA, - float32_t * pSrcB, - float32_t * pDst, - uint32_t numSamples); - - /** - * @brief Converts the elements of the floating-point vector to Q31 vector. - * @param[in] *pSrc points to the floating-point input vector - * @param[out] *pDst points to the Q31 output vector - * @param[in] blockSize length of the input vector - * @return none. - */ - void arm_float_to_q31( - float32_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - /** - * @brief Converts the elements of the floating-point vector to Q15 vector. - * @param[in] *pSrc points to the floating-point input vector - * @param[out] *pDst points to the Q15 output vector - * @param[in] blockSize length of the input vector - * @return none - */ - void arm_float_to_q15( - float32_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - /** - * @brief Converts the elements of the floating-point vector to Q7 vector. - * @param[in] *pSrc points to the floating-point input vector - * @param[out] *pDst points to the Q7 output vector - * @param[in] blockSize length of the input vector - * @return none - */ - void arm_float_to_q7( - float32_t * pSrc, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Converts the elements of the Q31 vector to Q15 vector. - * @param[in] *pSrc is input pointer - * @param[out] *pDst is output pointer - * @param[in] blockSize is the number of samples to process - * @return none. - */ - void arm_q31_to_q15( - q31_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - /** - * @brief Converts the elements of the Q31 vector to Q7 vector. - * @param[in] *pSrc is input pointer - * @param[out] *pDst is output pointer - * @param[in] blockSize is the number of samples to process - * @return none. - */ - void arm_q31_to_q7( - q31_t * pSrc, - q7_t * pDst, - uint32_t blockSize); - - /** - * @brief Converts the elements of the Q15 vector to floating-point vector. - * @param[in] *pSrc is input pointer - * @param[out] *pDst is output pointer - * @param[in] blockSize is the number of samples to process - * @return none. - */ - void arm_q15_to_float( - q15_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Converts the elements of the Q15 vector to Q31 vector. - * @param[in] *pSrc is input pointer - * @param[out] *pDst is output pointer - * @param[in] blockSize is the number of samples to process - * @return none. - */ - void arm_q15_to_q31( - q15_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Converts the elements of the Q15 vector to Q7 vector. - * @param[in] *pSrc is input pointer - * @param[out] *pDst is output pointer - * @param[in] blockSize is the number of samples to process - * @return none. - */ - void arm_q15_to_q7( - q15_t * pSrc, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @ingroup groupInterpolation - */ - - /** - * @defgroup BilinearInterpolate Bilinear Interpolation - * - * Bilinear interpolation is an extension of linear interpolation applied to a two dimensional grid. - * The underlying function f(x, y) is sampled on a regular grid and the interpolation process - * determines values between the grid points. - * Bilinear interpolation is equivalent to two step linear interpolation, first in the x-dimension and then in the y-dimension. - * Bilinear interpolation is often used in image processing to rescale images. - * The CMSIS DSP library provides bilinear interpolation functions for Q7, Q15, Q31, and floating-point data types. - * - * Algorithm - * \par - * The instance structure used by the bilinear interpolation functions describes a two dimensional data table. - * For floating-point, the instance structure is defined as: - *
-   *   typedef struct
-   *   {
-   *     uint16_t numRows;
-   *     uint16_t numCols;
-   *     float32_t *pData;
-   * } arm_bilinear_interp_instance_f32;
-   * 
- * - * \par - * where numRows specifies the number of rows in the table; - * numCols specifies the number of columns in the table; - * and pData points to an array of size numRows*numCols values. - * The data table pTable is organized in row order and the supplied data values fall on integer indexes. - * That is, table element (x,y) is located at pTable[x + y*numCols] where x and y are integers. - * - * \par - * Let (x, y) specify the desired interpolation point. Then define: - *
-   *     XF = floor(x)
-   *     YF = floor(y)
-   * 
- * \par - * The interpolated output point is computed as: - *
-   *  f(x, y) = f(XF, YF) * (1-(x-XF)) * (1-(y-YF))
-   *           + f(XF+1, YF) * (x-XF)*(1-(y-YF))
-   *           + f(XF, YF+1) * (1-(x-XF))*(y-YF)
-   *           + f(XF+1, YF+1) * (x-XF)*(y-YF)
-   * 
- * Note that the coordinates (x, y) contain integer and fractional components. - * The integer components specify which portion of the table to use while the - * fractional components control the interpolation processor. - * - * \par - * if (x,y) are outside of the table boundary, Bilinear interpolation returns zero output. - */ - - /** - * @addtogroup BilinearInterpolate - * @{ - */ - - /** - * - * @brief Floating-point bilinear interpolation. - * @param[in,out] *S points to an instance of the interpolation structure. - * @param[in] X interpolation coordinate. - * @param[in] Y interpolation coordinate. - * @return out interpolated value. - */ - - - static __INLINE float32_t arm_bilinear_interp_f32( - const arm_bilinear_interp_instance_f32 * S, - float32_t X, - float32_t Y) - { - float32_t out; - float32_t f00, f01, f10, f11; - float32_t *pData = S->pData; - int32_t xIndex, yIndex, index; - float32_t xdiff, ydiff; - float32_t b1, b2, b3, b4; - - xIndex = (int32_t) X; - yIndex = (int32_t) Y; - - /* Care taken for table outside boundary */ - /* Returns zero output when values are outside table boundary */ - if(xIndex < 0 || xIndex > (S->numRows - 1) || yIndex < 0 - || yIndex > (S->numCols - 1)) - { - return (0); - } - - /* Calculation of index for two nearest points in X-direction */ - index = (xIndex - 1) + (yIndex - 1) * S->numCols; - - - /* Read two nearest points in X-direction */ - f00 = pData[index]; - f01 = pData[index + 1]; - - /* Calculation of index for two nearest points in Y-direction */ - index = (xIndex - 1) + (yIndex) * S->numCols; - - - /* Read two nearest points in Y-direction */ - f10 = pData[index]; - f11 = pData[index + 1]; - - /* Calculation of intermediate values */ - b1 = f00; - b2 = f01 - f00; - b3 = f10 - f00; - b4 = f00 - f01 - f10 + f11; - - /* Calculation of fractional part in X */ - xdiff = X - xIndex; - - /* Calculation of fractional part in Y */ - ydiff = Y - yIndex; - - /* Calculation of bi-linear interpolated output */ - out = b1 + b2 * xdiff + b3 * ydiff + b4 * xdiff * ydiff; - - /* return to application */ - return (out); - - } - - /** - * - * @brief Q31 bilinear interpolation. - * @param[in,out] *S points to an instance of the interpolation structure. - * @param[in] X interpolation coordinate in 12.20 format. - * @param[in] Y interpolation coordinate in 12.20 format. - * @return out interpolated value. - */ - - static __INLINE q31_t arm_bilinear_interp_q31( - arm_bilinear_interp_instance_q31 * S, - q31_t X, - q31_t Y) - { - q31_t out; /* Temporary output */ - q31_t acc = 0; /* output */ - q31_t xfract, yfract; /* X, Y fractional parts */ - q31_t x1, x2, y1, y2; /* Nearest output values */ - int32_t rI, cI; /* Row and column indices */ - q31_t *pYData = S->pData; /* pointer to output table values */ - uint32_t nCols = S->numCols; /* num of rows */ - - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - rI = ((X & 0xFFF00000) >> 20u); - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - cI = ((Y & 0xFFF00000) >> 20u); - - /* Care taken for table outside boundary */ - /* Returns zero output when values are outside table boundary */ - if(rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1)) - { - return (0); - } - - /* 20 bits for the fractional part */ - /* shift left xfract by 11 to keep 1.31 format */ - xfract = (X & 0x000FFFFF) << 11u; - - /* Read two nearest output values from the index */ - x1 = pYData[(rI) + nCols * (cI)]; - x2 = pYData[(rI) + nCols * (cI) + 1u]; - - /* 20 bits for the fractional part */ - /* shift left yfract by 11 to keep 1.31 format */ - yfract = (Y & 0x000FFFFF) << 11u; - - /* Read two nearest output values from the index */ - y1 = pYData[(rI) + nCols * (cI + 1)]; - y2 = pYData[(rI) + nCols * (cI + 1) + 1u]; - - /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 3.29(q29) format */ - out = ((q31_t) (((q63_t) x1 * (0x7FFFFFFF - xfract)) >> 32)); - acc = ((q31_t) (((q63_t) out * (0x7FFFFFFF - yfract)) >> 32)); - - /* x2 * (xfract) * (1-yfract) in 3.29(q29) and adding to acc */ - out = ((q31_t) ((q63_t) x2 * (0x7FFFFFFF - yfract) >> 32)); - acc += ((q31_t) ((q63_t) out * (xfract) >> 32)); - - /* y1 * (1 - xfract) * (yfract) in 3.29(q29) and adding to acc */ - out = ((q31_t) ((q63_t) y1 * (0x7FFFFFFF - xfract) >> 32)); - acc += ((q31_t) ((q63_t) out * (yfract) >> 32)); - - /* y2 * (xfract) * (yfract) in 3.29(q29) and adding to acc */ - out = ((q31_t) ((q63_t) y2 * (xfract) >> 32)); - acc += ((q31_t) ((q63_t) out * (yfract) >> 32)); - - /* Convert acc to 1.31(q31) format */ - return (acc << 2u); - - } - - /** - * @brief Q15 bilinear interpolation. - * @param[in,out] *S points to an instance of the interpolation structure. - * @param[in] X interpolation coordinate in 12.20 format. - * @param[in] Y interpolation coordinate in 12.20 format. - * @return out interpolated value. - */ - - static __INLINE q15_t arm_bilinear_interp_q15( - arm_bilinear_interp_instance_q15 * S, - q31_t X, - q31_t Y) - { - q63_t acc = 0; /* output */ - q31_t out; /* Temporary output */ - q15_t x1, x2, y1, y2; /* Nearest output values */ - q31_t xfract, yfract; /* X, Y fractional parts */ - int32_t rI, cI; /* Row and column indices */ - q15_t *pYData = S->pData; /* pointer to output table values */ - uint32_t nCols = S->numCols; /* num of rows */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - rI = ((X & 0xFFF00000) >> 20); - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - cI = ((Y & 0xFFF00000) >> 20); - - /* Care taken for table outside boundary */ - /* Returns zero output when values are outside table boundary */ - if(rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1)) - { - return (0); - } - - /* 20 bits for the fractional part */ - /* xfract should be in 12.20 format */ - xfract = (X & 0x000FFFFF); - - /* Read two nearest output values from the index */ - x1 = pYData[(rI) + nCols * (cI)]; - x2 = pYData[(rI) + nCols * (cI) + 1u]; - - - /* 20 bits for the fractional part */ - /* yfract should be in 12.20 format */ - yfract = (Y & 0x000FFFFF); - - /* Read two nearest output values from the index */ - y1 = pYData[(rI) + nCols * (cI + 1)]; - y2 = pYData[(rI) + nCols * (cI + 1) + 1u]; - - /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 13.51 format */ - - /* x1 is in 1.15(q15), xfract in 12.20 format and out is in 13.35 format */ - /* convert 13.35 to 13.31 by right shifting and out is in 1.31 */ - out = (q31_t) (((q63_t) x1 * (0xFFFFF - xfract)) >> 4u); - acc = ((q63_t) out * (0xFFFFF - yfract)); - - /* x2 * (xfract) * (1-yfract) in 1.51 and adding to acc */ - out = (q31_t) (((q63_t) x2 * (0xFFFFF - yfract)) >> 4u); - acc += ((q63_t) out * (xfract)); - - /* y1 * (1 - xfract) * (yfract) in 1.51 and adding to acc */ - out = (q31_t) (((q63_t) y1 * (0xFFFFF - xfract)) >> 4u); - acc += ((q63_t) out * (yfract)); - - /* y2 * (xfract) * (yfract) in 1.51 and adding to acc */ - out = (q31_t) (((q63_t) y2 * (xfract)) >> 4u); - acc += ((q63_t) out * (yfract)); - - /* acc is in 13.51 format and down shift acc by 36 times */ - /* Convert out to 1.15 format */ - return (acc >> 36); - - } - - /** - * @brief Q7 bilinear interpolation. - * @param[in,out] *S points to an instance of the interpolation structure. - * @param[in] X interpolation coordinate in 12.20 format. - * @param[in] Y interpolation coordinate in 12.20 format. - * @return out interpolated value. - */ - - static __INLINE q7_t arm_bilinear_interp_q7( - arm_bilinear_interp_instance_q7 * S, - q31_t X, - q31_t Y) - { - q63_t acc = 0; /* output */ - q31_t out; /* Temporary output */ - q31_t xfract, yfract; /* X, Y fractional parts */ - q7_t x1, x2, y1, y2; /* Nearest output values */ - int32_t rI, cI; /* Row and column indices */ - q7_t *pYData = S->pData; /* pointer to output table values */ - uint32_t nCols = S->numCols; /* num of rows */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - rI = ((X & 0xFFF00000) >> 20); - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - cI = ((Y & 0xFFF00000) >> 20); - - /* Care taken for table outside boundary */ - /* Returns zero output when values are outside table boundary */ - if(rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1)) - { - return (0); - } - - /* 20 bits for the fractional part */ - /* xfract should be in 12.20 format */ - xfract = (X & 0x000FFFFF); - - /* Read two nearest output values from the index */ - x1 = pYData[(rI) + nCols * (cI)]; - x2 = pYData[(rI) + nCols * (cI) + 1u]; - - - /* 20 bits for the fractional part */ - /* yfract should be in 12.20 format */ - yfract = (Y & 0x000FFFFF); - - /* Read two nearest output values from the index */ - y1 = pYData[(rI) + nCols * (cI + 1)]; - y2 = pYData[(rI) + nCols * (cI + 1) + 1u]; - - /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 16.47 format */ - out = ((x1 * (0xFFFFF - xfract))); - acc = (((q63_t) out * (0xFFFFF - yfract))); - - /* x2 * (xfract) * (1-yfract) in 2.22 and adding to acc */ - out = ((x2 * (0xFFFFF - yfract))); - acc += (((q63_t) out * (xfract))); - - /* y1 * (1 - xfract) * (yfract) in 2.22 and adding to acc */ - out = ((y1 * (0xFFFFF - xfract))); - acc += (((q63_t) out * (yfract))); - - /* y2 * (xfract) * (yfract) in 2.22 and adding to acc */ - out = ((y2 * (yfract))); - acc += (((q63_t) out * (xfract))); - - /* acc in 16.47 format and down shift by 40 to convert to 1.7 format */ - return (acc >> 40); - - } - - /** - * @} end of BilinearInterpolate group - */ - - -//SMMLAR -#define multAcc_32x32_keep32_R(a, x, y) \ - a = (q31_t) (((((q63_t) a) << 32) + ((q63_t) x * y) + 0x80000000LL ) >> 32) - -//SMMLSR -#define multSub_32x32_keep32_R(a, x, y) \ - a = (q31_t) (((((q63_t) a) << 32) - ((q63_t) x * y) + 0x80000000LL ) >> 32) - -//SMMULR -#define mult_32x32_keep32_R(a, x, y) \ - a = (q31_t) (((q63_t) x * y + 0x80000000LL ) >> 32) - -//SMMLA -#define multAcc_32x32_keep32(a, x, y) \ - a += (q31_t) (((q63_t) x * y) >> 32) - -//SMMLS -#define multSub_32x32_keep32(a, x, y) \ - a -= (q31_t) (((q63_t) x * y) >> 32) - -//SMMUL -#define mult_32x32_keep32(a, x, y) \ - a = (q31_t) (((q63_t) x * y ) >> 32) - - -#if defined ( __CC_ARM ) //Keil - -//Enter low optimization region - place directly above function definition - #ifdef ARM_MATH_CM4 - #define LOW_OPTIMIZATION_ENTER \ - _Pragma ("push") \ - _Pragma ("O1") - #else - #define LOW_OPTIMIZATION_ENTER - #endif - -//Exit low optimization region - place directly after end of function definition - #ifdef ARM_MATH_CM4 - #define LOW_OPTIMIZATION_EXIT \ - _Pragma ("pop") - #else - #define LOW_OPTIMIZATION_EXIT - #endif - -//Enter low optimization region - place directly above function definition - #define IAR_ONLY_LOW_OPTIMIZATION_ENTER - -//Exit low optimization region - place directly after end of function definition - #define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#elif defined(__ICCARM__) //IAR - -//Enter low optimization region - place directly above function definition - #ifdef ARM_MATH_CM4 - #define LOW_OPTIMIZATION_ENTER \ - _Pragma ("optimize=low") - #else - #define LOW_OPTIMIZATION_ENTER - #endif - -//Exit low optimization region - place directly after end of function definition - #define LOW_OPTIMIZATION_EXIT - -//Enter low optimization region - place directly above function definition - #ifdef ARM_MATH_CM4 - #define IAR_ONLY_LOW_OPTIMIZATION_ENTER \ - _Pragma ("optimize=low") - #else - #define IAR_ONLY_LOW_OPTIMIZATION_ENTER - #endif - -//Exit low optimization region - place directly after end of function definition - #define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#elif defined(__GNUC__) - - #define LOW_OPTIMIZATION_ENTER __attribute__(( optimize("-O1") )) - - #define LOW_OPTIMIZATION_EXIT - - #define IAR_ONLY_LOW_OPTIMIZATION_ENTER - - #define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#elif defined(__CSMC__) // Cosmic - -#define LOW_OPTIMIZATION_ENTER -#define LOW_OPTIMIZATION_EXIT -#define IAR_ONLY_LOW_OPTIMIZATION_ENTER -#define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#elif defined(__TASKING__) // TASKING - -#define LOW_OPTIMIZATION_ENTER -#define LOW_OPTIMIZATION_EXIT -#define IAR_ONLY_LOW_OPTIMIZATION_ENTER -#define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#endif - - -#ifdef __cplusplus -} -#endif - - -#endif /* _ARM_MATH_H */ - -/** - * - * End of file. - */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/core_cm0.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/core_cm0.h deleted file mode 100644 index cf2b5d66..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/core_cm0.h +++ /dev/null @@ -1,740 +0,0 @@ -/**************************************************************************//** - * @file core_cm0.h - * @brief CMSIS Cortex-M0 Core Peripheral Access Layer Header File - * @version V4.10 - * @date 18. March 2015 - * - * @note - * - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#endif - -#ifndef __CORE_CM0_H_GENERIC -#define __CORE_CM0_H_GENERIC - -#ifdef __cplusplus - extern "C" { -#endif - -/** \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions - CMSIS violates the following MISRA-C:2004 rules: - - \li Required Rule 8.5, object/function definition in header file.
- Function definitions in header files are used to allow 'inlining'. - - \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
- Unions are used for effective representation of core registers. - - \li Advisory Rule 19.7, Function-like macro defined.
- Function-like macros are used to allow more efficient code. - */ - - -/******************************************************************************* - * CMSIS definitions - ******************************************************************************/ -/** \ingroup Cortex_M0 - @{ - */ - -/* CMSIS CM0 definitions */ -#define __CM0_CMSIS_VERSION_MAIN (0x04) /*!< [31:16] CMSIS HAL main version */ -#define __CM0_CMSIS_VERSION_SUB (0x00) /*!< [15:0] CMSIS HAL sub version */ -#define __CM0_CMSIS_VERSION ((__CM0_CMSIS_VERSION_MAIN << 16) | \ - __CM0_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */ - -#define __CORTEX_M (0x00) /*!< Cortex-M Core */ - - -#if defined ( __CC_ARM ) - #define __ASM __asm /*!< asm keyword for ARM Compiler */ - #define __INLINE __inline /*!< inline keyword for ARM Compiler */ - #define __STATIC_INLINE static __inline - -#elif defined ( __GNUC__ ) - #define __ASM __asm /*!< asm keyword for GNU Compiler */ - #define __INLINE inline /*!< inline keyword for GNU Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __ICCARM__ ) - #define __ASM __asm /*!< asm keyword for IAR Compiler */ - #define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */ - #define __STATIC_INLINE static inline - -#elif defined ( __TMS470__ ) - #define __ASM __asm /*!< asm keyword for TI CCS Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __TASKING__ ) - #define __ASM __asm /*!< asm keyword for TASKING Compiler */ - #define __INLINE inline /*!< inline keyword for TASKING Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __CSMC__ ) - #define __packed - #define __ASM _asm /*!< asm keyword for COSMIC Compiler */ - #define __INLINE inline /*use -pc99 on compile line !< inline keyword for COSMIC Compiler */ - #define __STATIC_INLINE static inline - -#endif - -/** __FPU_USED indicates whether an FPU is used or not. - This core does not support an FPU at all -*/ -#define __FPU_USED 0 - -#if defined ( __CC_ARM ) - #if defined __TARGET_FPU_VFP - #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #endif - -#elif defined ( __GNUC__ ) - #if defined (__VFP_FP__) && !defined(__SOFTFP__) - #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #endif - -#elif defined ( __ICCARM__ ) - #if defined __ARMVFP__ - #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #endif - -#elif defined ( __TMS470__ ) - #if defined __TI__VFP_SUPPORT____ - #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #endif - -#elif defined ( __TASKING__ ) - #if defined __FPU_VFP__ - #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #endif - -#elif defined ( __CSMC__ ) /* Cosmic */ - #if ( __CSMC__ & 0x400) // FPU present for parser - #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #endif -#endif - -#include /* standard types definitions */ -#include /* Core Instruction Access */ -#include /* Core Function Access */ - -#ifdef __cplusplus -} -#endif - -#endif /* __CORE_CM0_H_GENERIC */ - -#ifndef __CMSIS_GENERIC - -#ifndef __CORE_CM0_H_DEPENDANT -#define __CORE_CM0_H_DEPENDANT - -#ifdef __cplusplus - extern "C" { -#endif - -/* check device defines and use defaults */ -#if defined __CHECK_DEVICE_DEFINES - #ifndef __CM0_REV - #define __CM0_REV 0x0000 - #warning "__CM0_REV not defined in device header file; using default!" - #endif - - #ifndef __NVIC_PRIO_BITS - #define __NVIC_PRIO_BITS 2 - #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" - #endif - - #ifndef __Vendor_SysTickConfig - #define __Vendor_SysTickConfig 0 - #warning "__Vendor_SysTickConfig not defined in device header file; using default!" - #endif -#endif - -/* IO definitions (access restrictions to peripheral registers) */ -/** - \defgroup CMSIS_glob_defs CMSIS Global Defines - - IO Type Qualifiers are used - \li to specify the access to peripheral variables. - \li for automatic generation of peripheral register debug information. -*/ -#ifdef __cplusplus - #define __I volatile /*!< Defines 'read only' permissions */ -#else - #define __I volatile const /*!< Defines 'read only' permissions */ -#endif -#define __O volatile /*!< Defines 'write only' permissions */ -#define __IO volatile /*!< Defines 'read / write' permissions */ - -/*@} end of group Cortex_M0 */ - - - -/******************************************************************************* - * Register Abstraction - Core Register contain: - - Core Register - - Core NVIC Register - - Core SCB Register - - Core SysTick Register - ******************************************************************************/ -/** \defgroup CMSIS_core_register Defines and Type Definitions - \brief Type definitions and defines for Cortex-M processor based devices. -*/ - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_CORE Status and Control Registers - \brief Core Register type definitions. - @{ - */ - -/** \brief Union type to access the Application Program Status Register (APSR). - */ -typedef union -{ - struct - { - uint32_t _reserved0:28; /*!< bit: 0..27 Reserved */ - uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ - uint32_t C:1; /*!< bit: 29 Carry condition code flag */ - uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ - uint32_t N:1; /*!< bit: 31 Negative condition code flag */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} APSR_Type; - -/* APSR Register Definitions */ -#define APSR_N_Pos 31 /*!< APSR: N Position */ -#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ - -#define APSR_Z_Pos 30 /*!< APSR: Z Position */ -#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ - -#define APSR_C_Pos 29 /*!< APSR: C Position */ -#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ - -#define APSR_V_Pos 28 /*!< APSR: V Position */ -#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ - - -/** \brief Union type to access the Interrupt Program Status Register (IPSR). - */ -typedef union -{ - struct - { - uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ - uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} IPSR_Type; - -/* IPSR Register Definitions */ -#define IPSR_ISR_Pos 0 /*!< IPSR: ISR Position */ -#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ - - -/** \brief Union type to access the Special-Purpose Program Status Registers (xPSR). - */ -typedef union -{ - struct - { - uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ - uint32_t _reserved0:15; /*!< bit: 9..23 Reserved */ - uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */ - uint32_t _reserved1:3; /*!< bit: 25..27 Reserved */ - uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ - uint32_t C:1; /*!< bit: 29 Carry condition code flag */ - uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ - uint32_t N:1; /*!< bit: 31 Negative condition code flag */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} xPSR_Type; - -/* xPSR Register Definitions */ -#define xPSR_N_Pos 31 /*!< xPSR: N Position */ -#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ - -#define xPSR_Z_Pos 30 /*!< xPSR: Z Position */ -#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ - -#define xPSR_C_Pos 29 /*!< xPSR: C Position */ -#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ - -#define xPSR_V_Pos 28 /*!< xPSR: V Position */ -#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ - -#define xPSR_T_Pos 24 /*!< xPSR: T Position */ -#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ - -#define xPSR_ISR_Pos 0 /*!< xPSR: ISR Position */ -#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ - - -/** \brief Union type to access the Control Registers (CONTROL). - */ -typedef union -{ - struct - { - uint32_t _reserved0:1; /*!< bit: 0 Reserved */ - uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */ - uint32_t _reserved1:30; /*!< bit: 2..31 Reserved */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} CONTROL_Type; - -/* CONTROL Register Definitions */ -#define CONTROL_SPSEL_Pos 1 /*!< CONTROL: SPSEL Position */ -#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ - -/*@} end of group CMSIS_CORE */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) - \brief Type definitions for the NVIC Registers - @{ - */ - -/** \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). - */ -typedef struct -{ - __IO uint32_t ISER[1]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ - uint32_t RESERVED0[31]; - __IO uint32_t ICER[1]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ - uint32_t RSERVED1[31]; - __IO uint32_t ISPR[1]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ - uint32_t RESERVED2[31]; - __IO uint32_t ICPR[1]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ - uint32_t RESERVED3[31]; - uint32_t RESERVED4[64]; - __IO uint32_t IP[8]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register */ -} NVIC_Type; - -/*@} end of group CMSIS_NVIC */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_SCB System Control Block (SCB) - \brief Type definitions for the System Control Block Registers - @{ - */ - -/** \brief Structure type to access the System Control Block (SCB). - */ -typedef struct -{ - __I uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ - __IO uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ - uint32_t RESERVED0; - __IO uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ - __IO uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ - __IO uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ - uint32_t RESERVED1; - __IO uint32_t SHP[2]; /*!< Offset: 0x01C (R/W) System Handlers Priority Registers. [0] is RESERVED */ - __IO uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ -} SCB_Type; - -/* SCB CPUID Register Definitions */ -#define SCB_CPUID_IMPLEMENTER_Pos 24 /*!< SCB CPUID: IMPLEMENTER Position */ -#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ - -#define SCB_CPUID_VARIANT_Pos 20 /*!< SCB CPUID: VARIANT Position */ -#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ - -#define SCB_CPUID_ARCHITECTURE_Pos 16 /*!< SCB CPUID: ARCHITECTURE Position */ -#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ - -#define SCB_CPUID_PARTNO_Pos 4 /*!< SCB CPUID: PARTNO Position */ -#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ - -#define SCB_CPUID_REVISION_Pos 0 /*!< SCB CPUID: REVISION Position */ -#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ - -/* SCB Interrupt Control State Register Definitions */ -#define SCB_ICSR_NMIPENDSET_Pos 31 /*!< SCB ICSR: NMIPENDSET Position */ -#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */ - -#define SCB_ICSR_PENDSVSET_Pos 28 /*!< SCB ICSR: PENDSVSET Position */ -#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ - -#define SCB_ICSR_PENDSVCLR_Pos 27 /*!< SCB ICSR: PENDSVCLR Position */ -#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ - -#define SCB_ICSR_PENDSTSET_Pos 26 /*!< SCB ICSR: PENDSTSET Position */ -#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ - -#define SCB_ICSR_PENDSTCLR_Pos 25 /*!< SCB ICSR: PENDSTCLR Position */ -#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ - -#define SCB_ICSR_ISRPREEMPT_Pos 23 /*!< SCB ICSR: ISRPREEMPT Position */ -#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ - -#define SCB_ICSR_ISRPENDING_Pos 22 /*!< SCB ICSR: ISRPENDING Position */ -#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ - -#define SCB_ICSR_VECTPENDING_Pos 12 /*!< SCB ICSR: VECTPENDING Position */ -#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ - -#define SCB_ICSR_VECTACTIVE_Pos 0 /*!< SCB ICSR: VECTACTIVE Position */ -#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ - -/* SCB Application Interrupt and Reset Control Register Definitions */ -#define SCB_AIRCR_VECTKEY_Pos 16 /*!< SCB AIRCR: VECTKEY Position */ -#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ - -#define SCB_AIRCR_VECTKEYSTAT_Pos 16 /*!< SCB AIRCR: VECTKEYSTAT Position */ -#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ - -#define SCB_AIRCR_ENDIANESS_Pos 15 /*!< SCB AIRCR: ENDIANESS Position */ -#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ - -#define SCB_AIRCR_SYSRESETREQ_Pos 2 /*!< SCB AIRCR: SYSRESETREQ Position */ -#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ - -#define SCB_AIRCR_VECTCLRACTIVE_Pos 1 /*!< SCB AIRCR: VECTCLRACTIVE Position */ -#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ - -/* SCB System Control Register Definitions */ -#define SCB_SCR_SEVONPEND_Pos 4 /*!< SCB SCR: SEVONPEND Position */ -#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ - -#define SCB_SCR_SLEEPDEEP_Pos 2 /*!< SCB SCR: SLEEPDEEP Position */ -#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ - -#define SCB_SCR_SLEEPONEXIT_Pos 1 /*!< SCB SCR: SLEEPONEXIT Position */ -#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ - -/* SCB Configuration Control Register Definitions */ -#define SCB_CCR_STKALIGN_Pos 9 /*!< SCB CCR: STKALIGN Position */ -#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */ - -#define SCB_CCR_UNALIGN_TRP_Pos 3 /*!< SCB CCR: UNALIGN_TRP Position */ -#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ - -/* SCB System Handler Control and State Register Definitions */ -#define SCB_SHCSR_SVCALLPENDED_Pos 15 /*!< SCB SHCSR: SVCALLPENDED Position */ -#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ - -/*@} end of group CMSIS_SCB */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_SysTick System Tick Timer (SysTick) - \brief Type definitions for the System Timer Registers. - @{ - */ - -/** \brief Structure type to access the System Timer (SysTick). - */ -typedef struct -{ - __IO uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ - __IO uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ - __IO uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ - __I uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ -} SysTick_Type; - -/* SysTick Control / Status Register Definitions */ -#define SysTick_CTRL_COUNTFLAG_Pos 16 /*!< SysTick CTRL: COUNTFLAG Position */ -#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ - -#define SysTick_CTRL_CLKSOURCE_Pos 2 /*!< SysTick CTRL: CLKSOURCE Position */ -#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ - -#define SysTick_CTRL_TICKINT_Pos 1 /*!< SysTick CTRL: TICKINT Position */ -#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ - -#define SysTick_CTRL_ENABLE_Pos 0 /*!< SysTick CTRL: ENABLE Position */ -#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ - -/* SysTick Reload Register Definitions */ -#define SysTick_LOAD_RELOAD_Pos 0 /*!< SysTick LOAD: RELOAD Position */ -#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ - -/* SysTick Current Register Definitions */ -#define SysTick_VAL_CURRENT_Pos 0 /*!< SysTick VAL: CURRENT Position */ -#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ - -/* SysTick Calibration Register Definitions */ -#define SysTick_CALIB_NOREF_Pos 31 /*!< SysTick CALIB: NOREF Position */ -#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ - -#define SysTick_CALIB_SKEW_Pos 30 /*!< SysTick CALIB: SKEW Position */ -#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ - -#define SysTick_CALIB_TENMS_Pos 0 /*!< SysTick CALIB: TENMS Position */ -#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ - -/*@} end of group CMSIS_SysTick */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) - \brief Cortex-M0 Core Debug Registers (DCB registers, SHCSR, and DFSR) - are only accessible over DAP and not via processor. Therefore - they are not covered by the Cortex-M0 header file. - @{ - */ -/*@} end of group CMSIS_CoreDebug */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_core_base Core Definitions - \brief Definitions for base addresses, unions, and structures. - @{ - */ - -/* Memory mapping of Cortex-M0 Hardware */ -#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ -#define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ -#define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ -#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ - -#define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ -#define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ -#define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ - - -/*@} */ - - - -/******************************************************************************* - * Hardware Abstraction Layer - Core Function Interface contains: - - Core NVIC Functions - - Core SysTick Functions - - Core Register Access Functions - ******************************************************************************/ -/** \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference -*/ - - - -/* ########################## NVIC functions #################################### */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_NVICFunctions NVIC Functions - \brief Functions that manage interrupts and exceptions via the NVIC. - @{ - */ - -/* Interrupt Priorities are WORD accessible only under ARMv6M */ -/* The following MACROS handle generation of the register offset and byte masks */ -#define _BIT_SHIFT(IRQn) ( ((((uint32_t)(int32_t)(IRQn)) ) & 0x03UL) * 8UL) -#define _SHP_IDX(IRQn) ( (((((uint32_t)(int32_t)(IRQn)) & 0x0FUL)-8UL) >> 2UL) ) -#define _IP_IDX(IRQn) ( (((uint32_t)(int32_t)(IRQn)) >> 2UL) ) - - -/** \brief Enable External Interrupt - - The function enables a device-specific interrupt in the NVIC interrupt controller. - - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn) -{ - NVIC->ISER[0] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** \brief Disable External Interrupt - - The function disables a device-specific interrupt in the NVIC interrupt controller. - - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn) -{ - NVIC->ICER[0] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** \brief Get Pending Interrupt - - The function reads the pending register in the NVIC and returns the pending bit - for the specified interrupt. - - \param [in] IRQn Interrupt number. - - \return 0 Interrupt status is not pending. - \return 1 Interrupt status is pending. - */ -__STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn) -{ - return((uint32_t)(((NVIC->ISPR[0] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** \brief Set Pending Interrupt - - The function sets the pending bit of an external interrupt. - - \param [in] IRQn Interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ISPR[0] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** \brief Clear Pending Interrupt - - The function clears the pending bit of an external interrupt. - - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ICPR[0] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** \brief Set Interrupt Priority - - The function sets the priority of an interrupt. - - \note The priority cannot be set for every core interrupt. - - \param [in] IRQn Interrupt number. - \param [in] priority Priority to set. - */ -__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) -{ - if((int32_t)(IRQn) < 0) { - SCB->SHP[_SHP_IDX(IRQn)] = ((uint32_t)(SCB->SHP[_SHP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | - (((priority << (8 - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); - } - else { - NVIC->IP[_IP_IDX(IRQn)] = ((uint32_t)(NVIC->IP[_IP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | - (((priority << (8 - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); - } -} - - -/** \brief Get Interrupt Priority - - The function reads the priority of an interrupt. The interrupt - number can be positive to specify an external (device specific) - interrupt, or negative to specify an internal (core) interrupt. - - - \param [in] IRQn Interrupt number. - \return Interrupt Priority. Value is aligned automatically to the implemented - priority bits of the microcontroller. - */ -__STATIC_INLINE uint32_t NVIC_GetPriority(IRQn_Type IRQn) -{ - - if((int32_t)(IRQn) < 0) { - return((uint32_t)(((SCB->SHP[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8 - __NVIC_PRIO_BITS))); - } - else { - return((uint32_t)(((NVIC->IP[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8 - __NVIC_PRIO_BITS))); - } -} - - -/** \brief System Reset - - The function initiates a system reset request to reset the MCU. - */ -__STATIC_INLINE void NVIC_SystemReset(void) -{ - __DSB(); /* Ensure all outstanding memory accesses included - buffered write are completed before reset */ - SCB->AIRCR = ((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | - SCB_AIRCR_SYSRESETREQ_Msk); - __DSB(); /* Ensure completion of memory access */ - while(1) { __NOP(); } /* wait until reset */ -} - -/*@} end of CMSIS_Core_NVICFunctions */ - - - -/* ################################## SysTick function ############################################ */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_SysTickFunctions SysTick Functions - \brief Functions that configure the System. - @{ - */ - -#if (__Vendor_SysTickConfig == 0) - -/** \brief System Tick Configuration - - The function initializes the System Timer and its interrupt, and starts the System Tick Timer. - Counter is in free running mode to generate periodic interrupts. - - \param [in] ticks Number of ticks between two interrupts. - - \return 0 Function succeeded. - \return 1 Function failed. - - \note When the variable __Vendor_SysTickConfig is set to 1, then the - function SysTick_Config is not included. In this case, the file device.h - must contain a vendor-specific implementation of this function. - - */ -__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) -{ - if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) { return (1UL); } /* Reload value impossible */ - - SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ - NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ - SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ - SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | - SysTick_CTRL_TICKINT_Msk | - SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ - return (0UL); /* Function successful */ -} - -#endif - -/*@} end of CMSIS_Core_SysTickFunctions */ - - - - -#ifdef __cplusplus -} -#endif - -#endif /* __CORE_CM0_H_DEPENDANT */ - -#endif /* __CMSIS_GENERIC */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/core_cm0plus.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/core_cm0plus.h deleted file mode 100644 index 123cb400..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/core_cm0plus.h +++ /dev/null @@ -1,854 +0,0 @@ -/**************************************************************************//** - * @file core_cm0plus.h - * @brief CMSIS Cortex-M0+ Core Peripheral Access Layer Header File - * @version V4.10 - * @date 18. March 2015 - * - * @note - * - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#endif - -#ifndef __CORE_CM0PLUS_H_GENERIC -#define __CORE_CM0PLUS_H_GENERIC - -#ifdef __cplusplus - extern "C" { -#endif - -/** \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions - CMSIS violates the following MISRA-C:2004 rules: - - \li Required Rule 8.5, object/function definition in header file.
- Function definitions in header files are used to allow 'inlining'. - - \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
- Unions are used for effective representation of core registers. - - \li Advisory Rule 19.7, Function-like macro defined.
- Function-like macros are used to allow more efficient code. - */ - - -/******************************************************************************* - * CMSIS definitions - ******************************************************************************/ -/** \ingroup Cortex-M0+ - @{ - */ - -/* CMSIS CM0P definitions */ -#define __CM0PLUS_CMSIS_VERSION_MAIN (0x04) /*!< [31:16] CMSIS HAL main version */ -#define __CM0PLUS_CMSIS_VERSION_SUB (0x00) /*!< [15:0] CMSIS HAL sub version */ -#define __CM0PLUS_CMSIS_VERSION ((__CM0PLUS_CMSIS_VERSION_MAIN << 16) | \ - __CM0PLUS_CMSIS_VERSION_SUB) /*!< CMSIS HAL version number */ - -#define __CORTEX_M (0x00) /*!< Cortex-M Core */ - - -#if defined ( __CC_ARM ) - #define __ASM __asm /*!< asm keyword for ARM Compiler */ - #define __INLINE __inline /*!< inline keyword for ARM Compiler */ - #define __STATIC_INLINE static __inline - -#elif defined ( __GNUC__ ) - #define __ASM __asm /*!< asm keyword for GNU Compiler */ - #define __INLINE inline /*!< inline keyword for GNU Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __ICCARM__ ) - #define __ASM __asm /*!< asm keyword for IAR Compiler */ - #define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */ - #define __STATIC_INLINE static inline - -#elif defined ( __TMS470__ ) - #define __ASM __asm /*!< asm keyword for TI CCS Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __TASKING__ ) - #define __ASM __asm /*!< asm keyword for TASKING Compiler */ - #define __INLINE inline /*!< inline keyword for TASKING Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __CSMC__ ) - #define __packed - #define __ASM _asm /*!< asm keyword for COSMIC Compiler */ - #define __INLINE inline /*use -pc99 on compile line !< inline keyword for COSMIC Compiler */ - #define __STATIC_INLINE static inline - -#endif - -/** __FPU_USED indicates whether an FPU is used or not. - This core does not support an FPU at all -*/ -#define __FPU_USED 0 - -#if defined ( __CC_ARM ) - #if defined __TARGET_FPU_VFP - #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #endif - -#elif defined ( __GNUC__ ) - #if defined (__VFP_FP__) && !defined(__SOFTFP__) - #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #endif - -#elif defined ( __ICCARM__ ) - #if defined __ARMVFP__ - #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #endif - -#elif defined ( __TMS470__ ) - #if defined __TI__VFP_SUPPORT____ - #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #endif - -#elif defined ( __TASKING__ ) - #if defined __FPU_VFP__ - #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #endif - -#elif defined ( __CSMC__ ) /* Cosmic */ - #if ( __CSMC__ & 0x400) // FPU present for parser - #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #endif -#endif - -#include /* standard types definitions */ -#include /* Core Instruction Access */ -#include /* Core Function Access */ - -#ifdef __cplusplus -} -#endif - -#endif /* __CORE_CM0PLUS_H_GENERIC */ - -#ifndef __CMSIS_GENERIC - -#ifndef __CORE_CM0PLUS_H_DEPENDANT -#define __CORE_CM0PLUS_H_DEPENDANT - -#ifdef __cplusplus - extern "C" { -#endif - -/* check device defines and use defaults */ -#if defined __CHECK_DEVICE_DEFINES - #ifndef __CM0PLUS_REV - #define __CM0PLUS_REV 0x0000 - #warning "__CM0PLUS_REV not defined in device header file; using default!" - #endif - - #ifndef __MPU_PRESENT - #define __MPU_PRESENT 0 - #warning "__MPU_PRESENT not defined in device header file; using default!" - #endif - - #ifndef __VTOR_PRESENT - #define __VTOR_PRESENT 0 - #warning "__VTOR_PRESENT not defined in device header file; using default!" - #endif - - #ifndef __NVIC_PRIO_BITS - #define __NVIC_PRIO_BITS 2 - #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" - #endif - - #ifndef __Vendor_SysTickConfig - #define __Vendor_SysTickConfig 0 - #warning "__Vendor_SysTickConfig not defined in device header file; using default!" - #endif -#endif - -/* IO definitions (access restrictions to peripheral registers) */ -/** - \defgroup CMSIS_glob_defs CMSIS Global Defines - - IO Type Qualifiers are used - \li to specify the access to peripheral variables. - \li for automatic generation of peripheral register debug information. -*/ -#ifdef __cplusplus - #define __I volatile /*!< Defines 'read only' permissions */ -#else - #define __I volatile const /*!< Defines 'read only' permissions */ -#endif -#define __O volatile /*!< Defines 'write only' permissions */ -#define __IO volatile /*!< Defines 'read / write' permissions */ - -/*@} end of group Cortex-M0+ */ - - - -/******************************************************************************* - * Register Abstraction - Core Register contain: - - Core Register - - Core NVIC Register - - Core SCB Register - - Core SysTick Register - - Core MPU Register - ******************************************************************************/ -/** \defgroup CMSIS_core_register Defines and Type Definitions - \brief Type definitions and defines for Cortex-M processor based devices. -*/ - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_CORE Status and Control Registers - \brief Core Register type definitions. - @{ - */ - -/** \brief Union type to access the Application Program Status Register (APSR). - */ -typedef union -{ - struct - { - uint32_t _reserved0:28; /*!< bit: 0..27 Reserved */ - uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ - uint32_t C:1; /*!< bit: 29 Carry condition code flag */ - uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ - uint32_t N:1; /*!< bit: 31 Negative condition code flag */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} APSR_Type; - -/* APSR Register Definitions */ -#define APSR_N_Pos 31 /*!< APSR: N Position */ -#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ - -#define APSR_Z_Pos 30 /*!< APSR: Z Position */ -#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ - -#define APSR_C_Pos 29 /*!< APSR: C Position */ -#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ - -#define APSR_V_Pos 28 /*!< APSR: V Position */ -#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ - - -/** \brief Union type to access the Interrupt Program Status Register (IPSR). - */ -typedef union -{ - struct - { - uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ - uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} IPSR_Type; - -/* IPSR Register Definitions */ -#define IPSR_ISR_Pos 0 /*!< IPSR: ISR Position */ -#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ - - -/** \brief Union type to access the Special-Purpose Program Status Registers (xPSR). - */ -typedef union -{ - struct - { - uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ - uint32_t _reserved0:15; /*!< bit: 9..23 Reserved */ - uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */ - uint32_t _reserved1:3; /*!< bit: 25..27 Reserved */ - uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ - uint32_t C:1; /*!< bit: 29 Carry condition code flag */ - uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ - uint32_t N:1; /*!< bit: 31 Negative condition code flag */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} xPSR_Type; - -/* xPSR Register Definitions */ -#define xPSR_N_Pos 31 /*!< xPSR: N Position */ -#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ - -#define xPSR_Z_Pos 30 /*!< xPSR: Z Position */ -#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ - -#define xPSR_C_Pos 29 /*!< xPSR: C Position */ -#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ - -#define xPSR_V_Pos 28 /*!< xPSR: V Position */ -#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ - -#define xPSR_T_Pos 24 /*!< xPSR: T Position */ -#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ - -#define xPSR_ISR_Pos 0 /*!< xPSR: ISR Position */ -#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ - - -/** \brief Union type to access the Control Registers (CONTROL). - */ -typedef union -{ - struct - { - uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */ - uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */ - uint32_t _reserved1:30; /*!< bit: 2..31 Reserved */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} CONTROL_Type; - -/* CONTROL Register Definitions */ -#define CONTROL_SPSEL_Pos 1 /*!< CONTROL: SPSEL Position */ -#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ - -#define CONTROL_nPRIV_Pos 0 /*!< CONTROL: nPRIV Position */ -#define CONTROL_nPRIV_Msk (1UL /*<< CONTROL_nPRIV_Pos*/) /*!< CONTROL: nPRIV Mask */ - -/*@} end of group CMSIS_CORE */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) - \brief Type definitions for the NVIC Registers - @{ - */ - -/** \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). - */ -typedef struct -{ - __IO uint32_t ISER[1]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ - uint32_t RESERVED0[31]; - __IO uint32_t ICER[1]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ - uint32_t RSERVED1[31]; - __IO uint32_t ISPR[1]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ - uint32_t RESERVED2[31]; - __IO uint32_t ICPR[1]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ - uint32_t RESERVED3[31]; - uint32_t RESERVED4[64]; - __IO uint32_t IP[8]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register */ -} NVIC_Type; - -/*@} end of group CMSIS_NVIC */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_SCB System Control Block (SCB) - \brief Type definitions for the System Control Block Registers - @{ - */ - -/** \brief Structure type to access the System Control Block (SCB). - */ -typedef struct -{ - __I uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ - __IO uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ -#if (__VTOR_PRESENT == 1) - __IO uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */ -#else - uint32_t RESERVED0; -#endif - __IO uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ - __IO uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ - __IO uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ - uint32_t RESERVED1; - __IO uint32_t SHP[2]; /*!< Offset: 0x01C (R/W) System Handlers Priority Registers. [0] is RESERVED */ - __IO uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ -} SCB_Type; - -/* SCB CPUID Register Definitions */ -#define SCB_CPUID_IMPLEMENTER_Pos 24 /*!< SCB CPUID: IMPLEMENTER Position */ -#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ - -#define SCB_CPUID_VARIANT_Pos 20 /*!< SCB CPUID: VARIANT Position */ -#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ - -#define SCB_CPUID_ARCHITECTURE_Pos 16 /*!< SCB CPUID: ARCHITECTURE Position */ -#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ - -#define SCB_CPUID_PARTNO_Pos 4 /*!< SCB CPUID: PARTNO Position */ -#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ - -#define SCB_CPUID_REVISION_Pos 0 /*!< SCB CPUID: REVISION Position */ -#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ - -/* SCB Interrupt Control State Register Definitions */ -#define SCB_ICSR_NMIPENDSET_Pos 31 /*!< SCB ICSR: NMIPENDSET Position */ -#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */ - -#define SCB_ICSR_PENDSVSET_Pos 28 /*!< SCB ICSR: PENDSVSET Position */ -#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ - -#define SCB_ICSR_PENDSVCLR_Pos 27 /*!< SCB ICSR: PENDSVCLR Position */ -#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ - -#define SCB_ICSR_PENDSTSET_Pos 26 /*!< SCB ICSR: PENDSTSET Position */ -#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ - -#define SCB_ICSR_PENDSTCLR_Pos 25 /*!< SCB ICSR: PENDSTCLR Position */ -#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ - -#define SCB_ICSR_ISRPREEMPT_Pos 23 /*!< SCB ICSR: ISRPREEMPT Position */ -#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ - -#define SCB_ICSR_ISRPENDING_Pos 22 /*!< SCB ICSR: ISRPENDING Position */ -#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ - -#define SCB_ICSR_VECTPENDING_Pos 12 /*!< SCB ICSR: VECTPENDING Position */ -#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ - -#define SCB_ICSR_VECTACTIVE_Pos 0 /*!< SCB ICSR: VECTACTIVE Position */ -#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ - -#if (__VTOR_PRESENT == 1) -/* SCB Interrupt Control State Register Definitions */ -#define SCB_VTOR_TBLOFF_Pos 8 /*!< SCB VTOR: TBLOFF Position */ -#define SCB_VTOR_TBLOFF_Msk (0xFFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ -#endif - -/* SCB Application Interrupt and Reset Control Register Definitions */ -#define SCB_AIRCR_VECTKEY_Pos 16 /*!< SCB AIRCR: VECTKEY Position */ -#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ - -#define SCB_AIRCR_VECTKEYSTAT_Pos 16 /*!< SCB AIRCR: VECTKEYSTAT Position */ -#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ - -#define SCB_AIRCR_ENDIANESS_Pos 15 /*!< SCB AIRCR: ENDIANESS Position */ -#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ - -#define SCB_AIRCR_SYSRESETREQ_Pos 2 /*!< SCB AIRCR: SYSRESETREQ Position */ -#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ - -#define SCB_AIRCR_VECTCLRACTIVE_Pos 1 /*!< SCB AIRCR: VECTCLRACTIVE Position */ -#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ - -/* SCB System Control Register Definitions */ -#define SCB_SCR_SEVONPEND_Pos 4 /*!< SCB SCR: SEVONPEND Position */ -#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ - -#define SCB_SCR_SLEEPDEEP_Pos 2 /*!< SCB SCR: SLEEPDEEP Position */ -#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ - -#define SCB_SCR_SLEEPONEXIT_Pos 1 /*!< SCB SCR: SLEEPONEXIT Position */ -#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ - -/* SCB Configuration Control Register Definitions */ -#define SCB_CCR_STKALIGN_Pos 9 /*!< SCB CCR: STKALIGN Position */ -#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */ - -#define SCB_CCR_UNALIGN_TRP_Pos 3 /*!< SCB CCR: UNALIGN_TRP Position */ -#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ - -/* SCB System Handler Control and State Register Definitions */ -#define SCB_SHCSR_SVCALLPENDED_Pos 15 /*!< SCB SHCSR: SVCALLPENDED Position */ -#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ - -/*@} end of group CMSIS_SCB */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_SysTick System Tick Timer (SysTick) - \brief Type definitions for the System Timer Registers. - @{ - */ - -/** \brief Structure type to access the System Timer (SysTick). - */ -typedef struct -{ - __IO uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ - __IO uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ - __IO uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ - __I uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ -} SysTick_Type; - -/* SysTick Control / Status Register Definitions */ -#define SysTick_CTRL_COUNTFLAG_Pos 16 /*!< SysTick CTRL: COUNTFLAG Position */ -#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ - -#define SysTick_CTRL_CLKSOURCE_Pos 2 /*!< SysTick CTRL: CLKSOURCE Position */ -#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ - -#define SysTick_CTRL_TICKINT_Pos 1 /*!< SysTick CTRL: TICKINT Position */ -#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ - -#define SysTick_CTRL_ENABLE_Pos 0 /*!< SysTick CTRL: ENABLE Position */ -#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ - -/* SysTick Reload Register Definitions */ -#define SysTick_LOAD_RELOAD_Pos 0 /*!< SysTick LOAD: RELOAD Position */ -#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ - -/* SysTick Current Register Definitions */ -#define SysTick_VAL_CURRENT_Pos 0 /*!< SysTick VAL: CURRENT Position */ -#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ - -/* SysTick Calibration Register Definitions */ -#define SysTick_CALIB_NOREF_Pos 31 /*!< SysTick CALIB: NOREF Position */ -#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ - -#define SysTick_CALIB_SKEW_Pos 30 /*!< SysTick CALIB: SKEW Position */ -#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ - -#define SysTick_CALIB_TENMS_Pos 0 /*!< SysTick CALIB: TENMS Position */ -#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ - -/*@} end of group CMSIS_SysTick */ - -#if (__MPU_PRESENT == 1) -/** \ingroup CMSIS_core_register - \defgroup CMSIS_MPU Memory Protection Unit (MPU) - \brief Type definitions for the Memory Protection Unit (MPU) - @{ - */ - -/** \brief Structure type to access the Memory Protection Unit (MPU). - */ -typedef struct -{ - __I uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */ - __IO uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */ - __IO uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region RNRber Register */ - __IO uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */ - __IO uint32_t RASR; /*!< Offset: 0x010 (R/W) MPU Region Attribute and Size Register */ -} MPU_Type; - -/* MPU Type Register */ -#define MPU_TYPE_IREGION_Pos 16 /*!< MPU TYPE: IREGION Position */ -#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */ - -#define MPU_TYPE_DREGION_Pos 8 /*!< MPU TYPE: DREGION Position */ -#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */ - -#define MPU_TYPE_SEPARATE_Pos 0 /*!< MPU TYPE: SEPARATE Position */ -#define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/) /*!< MPU TYPE: SEPARATE Mask */ - -/* MPU Control Register */ -#define MPU_CTRL_PRIVDEFENA_Pos 2 /*!< MPU CTRL: PRIVDEFENA Position */ -#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */ - -#define MPU_CTRL_HFNMIENA_Pos 1 /*!< MPU CTRL: HFNMIENA Position */ -#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */ - -#define MPU_CTRL_ENABLE_Pos 0 /*!< MPU CTRL: ENABLE Position */ -#define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/) /*!< MPU CTRL: ENABLE Mask */ - -/* MPU Region Number Register */ -#define MPU_RNR_REGION_Pos 0 /*!< MPU RNR: REGION Position */ -#define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/) /*!< MPU RNR: REGION Mask */ - -/* MPU Region Base Address Register */ -#define MPU_RBAR_ADDR_Pos 8 /*!< MPU RBAR: ADDR Position */ -#define MPU_RBAR_ADDR_Msk (0xFFFFFFUL << MPU_RBAR_ADDR_Pos) /*!< MPU RBAR: ADDR Mask */ - -#define MPU_RBAR_VALID_Pos 4 /*!< MPU RBAR: VALID Position */ -#define MPU_RBAR_VALID_Msk (1UL << MPU_RBAR_VALID_Pos) /*!< MPU RBAR: VALID Mask */ - -#define MPU_RBAR_REGION_Pos 0 /*!< MPU RBAR: REGION Position */ -#define MPU_RBAR_REGION_Msk (0xFUL /*<< MPU_RBAR_REGION_Pos*/) /*!< MPU RBAR: REGION Mask */ - -/* MPU Region Attribute and Size Register */ -#define MPU_RASR_ATTRS_Pos 16 /*!< MPU RASR: MPU Region Attribute field Position */ -#define MPU_RASR_ATTRS_Msk (0xFFFFUL << MPU_RASR_ATTRS_Pos) /*!< MPU RASR: MPU Region Attribute field Mask */ - -#define MPU_RASR_XN_Pos 28 /*!< MPU RASR: ATTRS.XN Position */ -#define MPU_RASR_XN_Msk (1UL << MPU_RASR_XN_Pos) /*!< MPU RASR: ATTRS.XN Mask */ - -#define MPU_RASR_AP_Pos 24 /*!< MPU RASR: ATTRS.AP Position */ -#define MPU_RASR_AP_Msk (0x7UL << MPU_RASR_AP_Pos) /*!< MPU RASR: ATTRS.AP Mask */ - -#define MPU_RASR_TEX_Pos 19 /*!< MPU RASR: ATTRS.TEX Position */ -#define MPU_RASR_TEX_Msk (0x7UL << MPU_RASR_TEX_Pos) /*!< MPU RASR: ATTRS.TEX Mask */ - -#define MPU_RASR_S_Pos 18 /*!< MPU RASR: ATTRS.S Position */ -#define MPU_RASR_S_Msk (1UL << MPU_RASR_S_Pos) /*!< MPU RASR: ATTRS.S Mask */ - -#define MPU_RASR_C_Pos 17 /*!< MPU RASR: ATTRS.C Position */ -#define MPU_RASR_C_Msk (1UL << MPU_RASR_C_Pos) /*!< MPU RASR: ATTRS.C Mask */ - -#define MPU_RASR_B_Pos 16 /*!< MPU RASR: ATTRS.B Position */ -#define MPU_RASR_B_Msk (1UL << MPU_RASR_B_Pos) /*!< MPU RASR: ATTRS.B Mask */ - -#define MPU_RASR_SRD_Pos 8 /*!< MPU RASR: Sub-Region Disable Position */ -#define MPU_RASR_SRD_Msk (0xFFUL << MPU_RASR_SRD_Pos) /*!< MPU RASR: Sub-Region Disable Mask */ - -#define MPU_RASR_SIZE_Pos 1 /*!< MPU RASR: Region Size Field Position */ -#define MPU_RASR_SIZE_Msk (0x1FUL << MPU_RASR_SIZE_Pos) /*!< MPU RASR: Region Size Field Mask */ - -#define MPU_RASR_ENABLE_Pos 0 /*!< MPU RASR: Region enable bit Position */ -#define MPU_RASR_ENABLE_Msk (1UL /*<< MPU_RASR_ENABLE_Pos*/) /*!< MPU RASR: Region enable bit Disable Mask */ - -/*@} end of group CMSIS_MPU */ -#endif - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) - \brief Cortex-M0+ Core Debug Registers (DCB registers, SHCSR, and DFSR) - are only accessible over DAP and not via processor. Therefore - they are not covered by the Cortex-M0 header file. - @{ - */ -/*@} end of group CMSIS_CoreDebug */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_core_base Core Definitions - \brief Definitions for base addresses, unions, and structures. - @{ - */ - -/* Memory mapping of Cortex-M0+ Hardware */ -#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ -#define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ -#define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ -#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ - -#define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ -#define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ -#define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ - -#if (__MPU_PRESENT == 1) - #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ - #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ -#endif - -/*@} */ - - - -/******************************************************************************* - * Hardware Abstraction Layer - Core Function Interface contains: - - Core NVIC Functions - - Core SysTick Functions - - Core Register Access Functions - ******************************************************************************/ -/** \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference -*/ - - - -/* ########################## NVIC functions #################################### */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_NVICFunctions NVIC Functions - \brief Functions that manage interrupts and exceptions via the NVIC. - @{ - */ - -/* Interrupt Priorities are WORD accessible only under ARMv6M */ -/* The following MACROS handle generation of the register offset and byte masks */ -#define _BIT_SHIFT(IRQn) ( ((((uint32_t)(int32_t)(IRQn)) ) & 0x03UL) * 8UL) -#define _SHP_IDX(IRQn) ( (((((uint32_t)(int32_t)(IRQn)) & 0x0FUL)-8UL) >> 2UL) ) -#define _IP_IDX(IRQn) ( (((uint32_t)(int32_t)(IRQn)) >> 2UL) ) - - -/** \brief Enable External Interrupt - - The function enables a device-specific interrupt in the NVIC interrupt controller. - - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn) -{ - NVIC->ISER[0] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** \brief Disable External Interrupt - - The function disables a device-specific interrupt in the NVIC interrupt controller. - - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn) -{ - NVIC->ICER[0] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** \brief Get Pending Interrupt - - The function reads the pending register in the NVIC and returns the pending bit - for the specified interrupt. - - \param [in] IRQn Interrupt number. - - \return 0 Interrupt status is not pending. - \return 1 Interrupt status is pending. - */ -__STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn) -{ - return((uint32_t)(((NVIC->ISPR[0] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** \brief Set Pending Interrupt - - The function sets the pending bit of an external interrupt. - - \param [in] IRQn Interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ISPR[0] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** \brief Clear Pending Interrupt - - The function clears the pending bit of an external interrupt. - - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ICPR[0] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** \brief Set Interrupt Priority - - The function sets the priority of an interrupt. - - \note The priority cannot be set for every core interrupt. - - \param [in] IRQn Interrupt number. - \param [in] priority Priority to set. - */ -__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) -{ - if((int32_t)(IRQn) < 0) { - SCB->SHP[_SHP_IDX(IRQn)] = ((uint32_t)(SCB->SHP[_SHP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | - (((priority << (8 - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); - } - else { - NVIC->IP[_IP_IDX(IRQn)] = ((uint32_t)(NVIC->IP[_IP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | - (((priority << (8 - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); - } -} - - -/** \brief Get Interrupt Priority - - The function reads the priority of an interrupt. The interrupt - number can be positive to specify an external (device specific) - interrupt, or negative to specify an internal (core) interrupt. - - - \param [in] IRQn Interrupt number. - \return Interrupt Priority. Value is aligned automatically to the implemented - priority bits of the microcontroller. - */ -__STATIC_INLINE uint32_t NVIC_GetPriority(IRQn_Type IRQn) -{ - - if((int32_t)(IRQn) < 0) { - return((uint32_t)(((SCB->SHP[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8 - __NVIC_PRIO_BITS))); - } - else { - return((uint32_t)(((NVIC->IP[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8 - __NVIC_PRIO_BITS))); - } -} - - -/** \brief System Reset - - The function initiates a system reset request to reset the MCU. - */ -__STATIC_INLINE void NVIC_SystemReset(void) -{ - __DSB(); /* Ensure all outstanding memory accesses included - buffered write are completed before reset */ - SCB->AIRCR = ((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | - SCB_AIRCR_SYSRESETREQ_Msk); - __DSB(); /* Ensure completion of memory access */ - while(1) { __NOP(); } /* wait until reset */ -} - -/*@} end of CMSIS_Core_NVICFunctions */ - - - -/* ################################## SysTick function ############################################ */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_SysTickFunctions SysTick Functions - \brief Functions that configure the System. - @{ - */ - -#if (__Vendor_SysTickConfig == 0) - -/** \brief System Tick Configuration - - The function initializes the System Timer and its interrupt, and starts the System Tick Timer. - Counter is in free running mode to generate periodic interrupts. - - \param [in] ticks Number of ticks between two interrupts. - - \return 0 Function succeeded. - \return 1 Function failed. - - \note When the variable __Vendor_SysTickConfig is set to 1, then the - function SysTick_Config is not included. In this case, the file device.h - must contain a vendor-specific implementation of this function. - - */ -__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) -{ - if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) {return (1UL);} /* Reload value impossible */ - - SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ - NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ - SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ - SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | - SysTick_CTRL_TICKINT_Msk | - SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ - return (0UL); /* Function successful */ -} - -#endif - -/*@} end of CMSIS_Core_SysTickFunctions */ - - - - -#ifdef __cplusplus -} -#endif - -#endif /* __CORE_CM0PLUS_H_DEPENDANT */ - -#endif /* __CMSIS_GENERIC */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/core_cm3.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/core_cm3.h deleted file mode 100644 index 092ee23d..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/core_cm3.h +++ /dev/null @@ -1,1693 +0,0 @@ -/**************************************************************************//** - * @file core_cm3.h - * @brief CMSIS Cortex-M3 Core Peripheral Access Layer Header File - * @version V4.10 - * @date 18. March 2015 - * - * @note - * - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#endif - -#ifndef __CORE_CM3_H_GENERIC -#define __CORE_CM3_H_GENERIC - -#ifdef __cplusplus - extern "C" { -#endif - -/** \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions - CMSIS violates the following MISRA-C:2004 rules: - - \li Required Rule 8.5, object/function definition in header file.
- Function definitions in header files are used to allow 'inlining'. - - \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
- Unions are used for effective representation of core registers. - - \li Advisory Rule 19.7, Function-like macro defined.
- Function-like macros are used to allow more efficient code. - */ - - -/******************************************************************************* - * CMSIS definitions - ******************************************************************************/ -/** \ingroup Cortex_M3 - @{ - */ - -/* CMSIS CM3 definitions */ -#define __CM3_CMSIS_VERSION_MAIN (0x04) /*!< [31:16] CMSIS HAL main version */ -#define __CM3_CMSIS_VERSION_SUB (0x00) /*!< [15:0] CMSIS HAL sub version */ -#define __CM3_CMSIS_VERSION ((__CM3_CMSIS_VERSION_MAIN << 16) | \ - __CM3_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */ - -#define __CORTEX_M (0x03) /*!< Cortex-M Core */ - - -#if defined ( __CC_ARM ) - #define __ASM __asm /*!< asm keyword for ARM Compiler */ - #define __INLINE __inline /*!< inline keyword for ARM Compiler */ - #define __STATIC_INLINE static __inline - -#elif defined ( __GNUC__ ) - #define __ASM __asm /*!< asm keyword for GNU Compiler */ - #define __INLINE inline /*!< inline keyword for GNU Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __ICCARM__ ) - #define __ASM __asm /*!< asm keyword for IAR Compiler */ - #define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */ - #define __STATIC_INLINE static inline - -#elif defined ( __TMS470__ ) - #define __ASM __asm /*!< asm keyword for TI CCS Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __TASKING__ ) - #define __ASM __asm /*!< asm keyword for TASKING Compiler */ - #define __INLINE inline /*!< inline keyword for TASKING Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __CSMC__ ) - #define __packed - #define __ASM _asm /*!< asm keyword for COSMIC Compiler */ - #define __INLINE inline /*use -pc99 on compile line !< inline keyword for COSMIC Compiler */ - #define __STATIC_INLINE static inline - -#endif - -/** __FPU_USED indicates whether an FPU is used or not. - This core does not support an FPU at all -*/ -#define __FPU_USED 0 - -#if defined ( __CC_ARM ) - #if defined __TARGET_FPU_VFP - #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #endif - -#elif defined ( __GNUC__ ) - #if defined (__VFP_FP__) && !defined(__SOFTFP__) - #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #endif - -#elif defined ( __ICCARM__ ) - #if defined __ARMVFP__ - #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #endif - -#elif defined ( __TMS470__ ) - #if defined __TI__VFP_SUPPORT____ - #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #endif - -#elif defined ( __TASKING__ ) - #if defined __FPU_VFP__ - #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #endif - -#elif defined ( __CSMC__ ) /* Cosmic */ - #if ( __CSMC__ & 0x400) // FPU present for parser - #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #endif -#endif - -#include /* standard types definitions */ -#include /* Core Instruction Access */ -#include /* Core Function Access */ - -#ifdef __cplusplus -} -#endif - -#endif /* __CORE_CM3_H_GENERIC */ - -#ifndef __CMSIS_GENERIC - -#ifndef __CORE_CM3_H_DEPENDANT -#define __CORE_CM3_H_DEPENDANT - -#ifdef __cplusplus - extern "C" { -#endif - -/* check device defines and use defaults */ -#if defined __CHECK_DEVICE_DEFINES - #ifndef __CM3_REV - #define __CM3_REV 0x0200 - #warning "__CM3_REV not defined in device header file; using default!" - #endif - - #ifndef __MPU_PRESENT - #define __MPU_PRESENT 0 - #warning "__MPU_PRESENT not defined in device header file; using default!" - #endif - - #ifndef __NVIC_PRIO_BITS - #define __NVIC_PRIO_BITS 4 - #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" - #endif - - #ifndef __Vendor_SysTickConfig - #define __Vendor_SysTickConfig 0 - #warning "__Vendor_SysTickConfig not defined in device header file; using default!" - #endif -#endif - -/* IO definitions (access restrictions to peripheral registers) */ -/** - \defgroup CMSIS_glob_defs CMSIS Global Defines - - IO Type Qualifiers are used - \li to specify the access to peripheral variables. - \li for automatic generation of peripheral register debug information. -*/ -#ifdef __cplusplus - #define __I volatile /*!< Defines 'read only' permissions */ -#else - #define __I volatile const /*!< Defines 'read only' permissions */ -#endif -#define __O volatile /*!< Defines 'write only' permissions */ -#define __IO volatile /*!< Defines 'read / write' permissions */ - -/*@} end of group Cortex_M3 */ - - - -/******************************************************************************* - * Register Abstraction - Core Register contain: - - Core Register - - Core NVIC Register - - Core SCB Register - - Core SysTick Register - - Core Debug Register - - Core MPU Register - ******************************************************************************/ -/** \defgroup CMSIS_core_register Defines and Type Definitions - \brief Type definitions and defines for Cortex-M processor based devices. -*/ - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_CORE Status and Control Registers - \brief Core Register type definitions. - @{ - */ - -/** \brief Union type to access the Application Program Status Register (APSR). - */ -typedef union -{ - struct - { - uint32_t _reserved0:27; /*!< bit: 0..26 Reserved */ - uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ - uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ - uint32_t C:1; /*!< bit: 29 Carry condition code flag */ - uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ - uint32_t N:1; /*!< bit: 31 Negative condition code flag */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} APSR_Type; - -/* APSR Register Definitions */ -#define APSR_N_Pos 31 /*!< APSR: N Position */ -#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ - -#define APSR_Z_Pos 30 /*!< APSR: Z Position */ -#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ - -#define APSR_C_Pos 29 /*!< APSR: C Position */ -#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ - -#define APSR_V_Pos 28 /*!< APSR: V Position */ -#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ - -#define APSR_Q_Pos 27 /*!< APSR: Q Position */ -#define APSR_Q_Msk (1UL << APSR_Q_Pos) /*!< APSR: Q Mask */ - - -/** \brief Union type to access the Interrupt Program Status Register (IPSR). - */ -typedef union -{ - struct - { - uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ - uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} IPSR_Type; - -/* IPSR Register Definitions */ -#define IPSR_ISR_Pos 0 /*!< IPSR: ISR Position */ -#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ - - -/** \brief Union type to access the Special-Purpose Program Status Registers (xPSR). - */ -typedef union -{ - struct - { - uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ - uint32_t _reserved0:15; /*!< bit: 9..23 Reserved */ - uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */ - uint32_t IT:2; /*!< bit: 25..26 saved IT state (read 0) */ - uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ - uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ - uint32_t C:1; /*!< bit: 29 Carry condition code flag */ - uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ - uint32_t N:1; /*!< bit: 31 Negative condition code flag */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} xPSR_Type; - -/* xPSR Register Definitions */ -#define xPSR_N_Pos 31 /*!< xPSR: N Position */ -#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ - -#define xPSR_Z_Pos 30 /*!< xPSR: Z Position */ -#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ - -#define xPSR_C_Pos 29 /*!< xPSR: C Position */ -#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ - -#define xPSR_V_Pos 28 /*!< xPSR: V Position */ -#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ - -#define xPSR_Q_Pos 27 /*!< xPSR: Q Position */ -#define xPSR_Q_Msk (1UL << xPSR_Q_Pos) /*!< xPSR: Q Mask */ - -#define xPSR_IT_Pos 25 /*!< xPSR: IT Position */ -#define xPSR_IT_Msk (3UL << xPSR_IT_Pos) /*!< xPSR: IT Mask */ - -#define xPSR_T_Pos 24 /*!< xPSR: T Position */ -#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ - -#define xPSR_ISR_Pos 0 /*!< xPSR: ISR Position */ -#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ - - -/** \brief Union type to access the Control Registers (CONTROL). - */ -typedef union -{ - struct - { - uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */ - uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */ - uint32_t _reserved1:30; /*!< bit: 2..31 Reserved */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} CONTROL_Type; - -/* CONTROL Register Definitions */ -#define CONTROL_SPSEL_Pos 1 /*!< CONTROL: SPSEL Position */ -#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ - -#define CONTROL_nPRIV_Pos 0 /*!< CONTROL: nPRIV Position */ -#define CONTROL_nPRIV_Msk (1UL /*<< CONTROL_nPRIV_Pos*/) /*!< CONTROL: nPRIV Mask */ - -/*@} end of group CMSIS_CORE */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) - \brief Type definitions for the NVIC Registers - @{ - */ - -/** \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). - */ -typedef struct -{ - __IO uint32_t ISER[8]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ - uint32_t RESERVED0[24]; - __IO uint32_t ICER[8]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ - uint32_t RSERVED1[24]; - __IO uint32_t ISPR[8]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ - uint32_t RESERVED2[24]; - __IO uint32_t ICPR[8]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ - uint32_t RESERVED3[24]; - __IO uint32_t IABR[8]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */ - uint32_t RESERVED4[56]; - __IO uint8_t IP[240]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register (8Bit wide) */ - uint32_t RESERVED5[644]; - __O uint32_t STIR; /*!< Offset: 0xE00 ( /W) Software Trigger Interrupt Register */ -} NVIC_Type; - -/* Software Triggered Interrupt Register Definitions */ -#define NVIC_STIR_INTID_Pos 0 /*!< STIR: INTLINESNUM Position */ -#define NVIC_STIR_INTID_Msk (0x1FFUL /*<< NVIC_STIR_INTID_Pos*/) /*!< STIR: INTLINESNUM Mask */ - -/*@} end of group CMSIS_NVIC */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_SCB System Control Block (SCB) - \brief Type definitions for the System Control Block Registers - @{ - */ - -/** \brief Structure type to access the System Control Block (SCB). - */ -typedef struct -{ - __I uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ - __IO uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ - __IO uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */ - __IO uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ - __IO uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ - __IO uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ - __IO uint8_t SHP[12]; /*!< Offset: 0x018 (R/W) System Handlers Priority Registers (4-7, 8-11, 12-15) */ - __IO uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ - __IO uint32_t CFSR; /*!< Offset: 0x028 (R/W) Configurable Fault Status Register */ - __IO uint32_t HFSR; /*!< Offset: 0x02C (R/W) HardFault Status Register */ - __IO uint32_t DFSR; /*!< Offset: 0x030 (R/W) Debug Fault Status Register */ - __IO uint32_t MMFAR; /*!< Offset: 0x034 (R/W) MemManage Fault Address Register */ - __IO uint32_t BFAR; /*!< Offset: 0x038 (R/W) BusFault Address Register */ - __IO uint32_t AFSR; /*!< Offset: 0x03C (R/W) Auxiliary Fault Status Register */ - __I uint32_t PFR[2]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */ - __I uint32_t DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */ - __I uint32_t ADR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */ - __I uint32_t MMFR[4]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */ - __I uint32_t ISAR[5]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */ - uint32_t RESERVED0[5]; - __IO uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */ -} SCB_Type; - -/* SCB CPUID Register Definitions */ -#define SCB_CPUID_IMPLEMENTER_Pos 24 /*!< SCB CPUID: IMPLEMENTER Position */ -#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ - -#define SCB_CPUID_VARIANT_Pos 20 /*!< SCB CPUID: VARIANT Position */ -#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ - -#define SCB_CPUID_ARCHITECTURE_Pos 16 /*!< SCB CPUID: ARCHITECTURE Position */ -#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ - -#define SCB_CPUID_PARTNO_Pos 4 /*!< SCB CPUID: PARTNO Position */ -#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ - -#define SCB_CPUID_REVISION_Pos 0 /*!< SCB CPUID: REVISION Position */ -#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ - -/* SCB Interrupt Control State Register Definitions */ -#define SCB_ICSR_NMIPENDSET_Pos 31 /*!< SCB ICSR: NMIPENDSET Position */ -#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */ - -#define SCB_ICSR_PENDSVSET_Pos 28 /*!< SCB ICSR: PENDSVSET Position */ -#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ - -#define SCB_ICSR_PENDSVCLR_Pos 27 /*!< SCB ICSR: PENDSVCLR Position */ -#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ - -#define SCB_ICSR_PENDSTSET_Pos 26 /*!< SCB ICSR: PENDSTSET Position */ -#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ - -#define SCB_ICSR_PENDSTCLR_Pos 25 /*!< SCB ICSR: PENDSTCLR Position */ -#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ - -#define SCB_ICSR_ISRPREEMPT_Pos 23 /*!< SCB ICSR: ISRPREEMPT Position */ -#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ - -#define SCB_ICSR_ISRPENDING_Pos 22 /*!< SCB ICSR: ISRPENDING Position */ -#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ - -#define SCB_ICSR_VECTPENDING_Pos 12 /*!< SCB ICSR: VECTPENDING Position */ -#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ - -#define SCB_ICSR_RETTOBASE_Pos 11 /*!< SCB ICSR: RETTOBASE Position */ -#define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos) /*!< SCB ICSR: RETTOBASE Mask */ - -#define SCB_ICSR_VECTACTIVE_Pos 0 /*!< SCB ICSR: VECTACTIVE Position */ -#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ - -/* SCB Vector Table Offset Register Definitions */ -#if (__CM3_REV < 0x0201) /* core r2p1 */ -#define SCB_VTOR_TBLBASE_Pos 29 /*!< SCB VTOR: TBLBASE Position */ -#define SCB_VTOR_TBLBASE_Msk (1UL << SCB_VTOR_TBLBASE_Pos) /*!< SCB VTOR: TBLBASE Mask */ - -#define SCB_VTOR_TBLOFF_Pos 7 /*!< SCB VTOR: TBLOFF Position */ -#define SCB_VTOR_TBLOFF_Msk (0x3FFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ -#else -#define SCB_VTOR_TBLOFF_Pos 7 /*!< SCB VTOR: TBLOFF Position */ -#define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ -#endif - -/* SCB Application Interrupt and Reset Control Register Definitions */ -#define SCB_AIRCR_VECTKEY_Pos 16 /*!< SCB AIRCR: VECTKEY Position */ -#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ - -#define SCB_AIRCR_VECTKEYSTAT_Pos 16 /*!< SCB AIRCR: VECTKEYSTAT Position */ -#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ - -#define SCB_AIRCR_ENDIANESS_Pos 15 /*!< SCB AIRCR: ENDIANESS Position */ -#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ - -#define SCB_AIRCR_PRIGROUP_Pos 8 /*!< SCB AIRCR: PRIGROUP Position */ -#define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */ - -#define SCB_AIRCR_SYSRESETREQ_Pos 2 /*!< SCB AIRCR: SYSRESETREQ Position */ -#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ - -#define SCB_AIRCR_VECTCLRACTIVE_Pos 1 /*!< SCB AIRCR: VECTCLRACTIVE Position */ -#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ - -#define SCB_AIRCR_VECTRESET_Pos 0 /*!< SCB AIRCR: VECTRESET Position */ -#define SCB_AIRCR_VECTRESET_Msk (1UL /*<< SCB_AIRCR_VECTRESET_Pos*/) /*!< SCB AIRCR: VECTRESET Mask */ - -/* SCB System Control Register Definitions */ -#define SCB_SCR_SEVONPEND_Pos 4 /*!< SCB SCR: SEVONPEND Position */ -#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ - -#define SCB_SCR_SLEEPDEEP_Pos 2 /*!< SCB SCR: SLEEPDEEP Position */ -#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ - -#define SCB_SCR_SLEEPONEXIT_Pos 1 /*!< SCB SCR: SLEEPONEXIT Position */ -#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ - -/* SCB Configuration Control Register Definitions */ -#define SCB_CCR_STKALIGN_Pos 9 /*!< SCB CCR: STKALIGN Position */ -#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */ - -#define SCB_CCR_BFHFNMIGN_Pos 8 /*!< SCB CCR: BFHFNMIGN Position */ -#define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos) /*!< SCB CCR: BFHFNMIGN Mask */ - -#define SCB_CCR_DIV_0_TRP_Pos 4 /*!< SCB CCR: DIV_0_TRP Position */ -#define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos) /*!< SCB CCR: DIV_0_TRP Mask */ - -#define SCB_CCR_UNALIGN_TRP_Pos 3 /*!< SCB CCR: UNALIGN_TRP Position */ -#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ - -#define SCB_CCR_USERSETMPEND_Pos 1 /*!< SCB CCR: USERSETMPEND Position */ -#define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos) /*!< SCB CCR: USERSETMPEND Mask */ - -#define SCB_CCR_NONBASETHRDENA_Pos 0 /*!< SCB CCR: NONBASETHRDENA Position */ -#define SCB_CCR_NONBASETHRDENA_Msk (1UL /*<< SCB_CCR_NONBASETHRDENA_Pos*/) /*!< SCB CCR: NONBASETHRDENA Mask */ - -/* SCB System Handler Control and State Register Definitions */ -#define SCB_SHCSR_USGFAULTENA_Pos 18 /*!< SCB SHCSR: USGFAULTENA Position */ -#define SCB_SHCSR_USGFAULTENA_Msk (1UL << SCB_SHCSR_USGFAULTENA_Pos) /*!< SCB SHCSR: USGFAULTENA Mask */ - -#define SCB_SHCSR_BUSFAULTENA_Pos 17 /*!< SCB SHCSR: BUSFAULTENA Position */ -#define SCB_SHCSR_BUSFAULTENA_Msk (1UL << SCB_SHCSR_BUSFAULTENA_Pos) /*!< SCB SHCSR: BUSFAULTENA Mask */ - -#define SCB_SHCSR_MEMFAULTENA_Pos 16 /*!< SCB SHCSR: MEMFAULTENA Position */ -#define SCB_SHCSR_MEMFAULTENA_Msk (1UL << SCB_SHCSR_MEMFAULTENA_Pos) /*!< SCB SHCSR: MEMFAULTENA Mask */ - -#define SCB_SHCSR_SVCALLPENDED_Pos 15 /*!< SCB SHCSR: SVCALLPENDED Position */ -#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ - -#define SCB_SHCSR_BUSFAULTPENDED_Pos 14 /*!< SCB SHCSR: BUSFAULTPENDED Position */ -#define SCB_SHCSR_BUSFAULTPENDED_Msk (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos) /*!< SCB SHCSR: BUSFAULTPENDED Mask */ - -#define SCB_SHCSR_MEMFAULTPENDED_Pos 13 /*!< SCB SHCSR: MEMFAULTPENDED Position */ -#define SCB_SHCSR_MEMFAULTPENDED_Msk (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos) /*!< SCB SHCSR: MEMFAULTPENDED Mask */ - -#define SCB_SHCSR_USGFAULTPENDED_Pos 12 /*!< SCB SHCSR: USGFAULTPENDED Position */ -#define SCB_SHCSR_USGFAULTPENDED_Msk (1UL << SCB_SHCSR_USGFAULTPENDED_Pos) /*!< SCB SHCSR: USGFAULTPENDED Mask */ - -#define SCB_SHCSR_SYSTICKACT_Pos 11 /*!< SCB SHCSR: SYSTICKACT Position */ -#define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos) /*!< SCB SHCSR: SYSTICKACT Mask */ - -#define SCB_SHCSR_PENDSVACT_Pos 10 /*!< SCB SHCSR: PENDSVACT Position */ -#define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos) /*!< SCB SHCSR: PENDSVACT Mask */ - -#define SCB_SHCSR_MONITORACT_Pos 8 /*!< SCB SHCSR: MONITORACT Position */ -#define SCB_SHCSR_MONITORACT_Msk (1UL << SCB_SHCSR_MONITORACT_Pos) /*!< SCB SHCSR: MONITORACT Mask */ - -#define SCB_SHCSR_SVCALLACT_Pos 7 /*!< SCB SHCSR: SVCALLACT Position */ -#define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos) /*!< SCB SHCSR: SVCALLACT Mask */ - -#define SCB_SHCSR_USGFAULTACT_Pos 3 /*!< SCB SHCSR: USGFAULTACT Position */ -#define SCB_SHCSR_USGFAULTACT_Msk (1UL << SCB_SHCSR_USGFAULTACT_Pos) /*!< SCB SHCSR: USGFAULTACT Mask */ - -#define SCB_SHCSR_BUSFAULTACT_Pos 1 /*!< SCB SHCSR: BUSFAULTACT Position */ -#define SCB_SHCSR_BUSFAULTACT_Msk (1UL << SCB_SHCSR_BUSFAULTACT_Pos) /*!< SCB SHCSR: BUSFAULTACT Mask */ - -#define SCB_SHCSR_MEMFAULTACT_Pos 0 /*!< SCB SHCSR: MEMFAULTACT Position */ -#define SCB_SHCSR_MEMFAULTACT_Msk (1UL /*<< SCB_SHCSR_MEMFAULTACT_Pos*/) /*!< SCB SHCSR: MEMFAULTACT Mask */ - -/* SCB Configurable Fault Status Registers Definitions */ -#define SCB_CFSR_USGFAULTSR_Pos 16 /*!< SCB CFSR: Usage Fault Status Register Position */ -#define SCB_CFSR_USGFAULTSR_Msk (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos) /*!< SCB CFSR: Usage Fault Status Register Mask */ - -#define SCB_CFSR_BUSFAULTSR_Pos 8 /*!< SCB CFSR: Bus Fault Status Register Position */ -#define SCB_CFSR_BUSFAULTSR_Msk (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos) /*!< SCB CFSR: Bus Fault Status Register Mask */ - -#define SCB_CFSR_MEMFAULTSR_Pos 0 /*!< SCB CFSR: Memory Manage Fault Status Register Position */ -#define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */ - -/* SCB Hard Fault Status Registers Definitions */ -#define SCB_HFSR_DEBUGEVT_Pos 31 /*!< SCB HFSR: DEBUGEVT Position */ -#define SCB_HFSR_DEBUGEVT_Msk (1UL << SCB_HFSR_DEBUGEVT_Pos) /*!< SCB HFSR: DEBUGEVT Mask */ - -#define SCB_HFSR_FORCED_Pos 30 /*!< SCB HFSR: FORCED Position */ -#define SCB_HFSR_FORCED_Msk (1UL << SCB_HFSR_FORCED_Pos) /*!< SCB HFSR: FORCED Mask */ - -#define SCB_HFSR_VECTTBL_Pos 1 /*!< SCB HFSR: VECTTBL Position */ -#define SCB_HFSR_VECTTBL_Msk (1UL << SCB_HFSR_VECTTBL_Pos) /*!< SCB HFSR: VECTTBL Mask */ - -/* SCB Debug Fault Status Register Definitions */ -#define SCB_DFSR_EXTERNAL_Pos 4 /*!< SCB DFSR: EXTERNAL Position */ -#define SCB_DFSR_EXTERNAL_Msk (1UL << SCB_DFSR_EXTERNAL_Pos) /*!< SCB DFSR: EXTERNAL Mask */ - -#define SCB_DFSR_VCATCH_Pos 3 /*!< SCB DFSR: VCATCH Position */ -#define SCB_DFSR_VCATCH_Msk (1UL << SCB_DFSR_VCATCH_Pos) /*!< SCB DFSR: VCATCH Mask */ - -#define SCB_DFSR_DWTTRAP_Pos 2 /*!< SCB DFSR: DWTTRAP Position */ -#define SCB_DFSR_DWTTRAP_Msk (1UL << SCB_DFSR_DWTTRAP_Pos) /*!< SCB DFSR: DWTTRAP Mask */ - -#define SCB_DFSR_BKPT_Pos 1 /*!< SCB DFSR: BKPT Position */ -#define SCB_DFSR_BKPT_Msk (1UL << SCB_DFSR_BKPT_Pos) /*!< SCB DFSR: BKPT Mask */ - -#define SCB_DFSR_HALTED_Pos 0 /*!< SCB DFSR: HALTED Position */ -#define SCB_DFSR_HALTED_Msk (1UL /*<< SCB_DFSR_HALTED_Pos*/) /*!< SCB DFSR: HALTED Mask */ - -/*@} end of group CMSIS_SCB */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB) - \brief Type definitions for the System Control and ID Register not in the SCB - @{ - */ - -/** \brief Structure type to access the System Control and ID Register not in the SCB. - */ -typedef struct -{ - uint32_t RESERVED0[1]; - __I uint32_t ICTR; /*!< Offset: 0x004 (R/ ) Interrupt Controller Type Register */ -#if ((defined __CM3_REV) && (__CM3_REV >= 0x200)) - __IO uint32_t ACTLR; /*!< Offset: 0x008 (R/W) Auxiliary Control Register */ -#else - uint32_t RESERVED1[1]; -#endif -} SCnSCB_Type; - -/* Interrupt Controller Type Register Definitions */ -#define SCnSCB_ICTR_INTLINESNUM_Pos 0 /*!< ICTR: INTLINESNUM Position */ -#define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL /*<< SCnSCB_ICTR_INTLINESNUM_Pos*/) /*!< ICTR: INTLINESNUM Mask */ - -/* Auxiliary Control Register Definitions */ - -#define SCnSCB_ACTLR_DISFOLD_Pos 2 /*!< ACTLR: DISFOLD Position */ -#define SCnSCB_ACTLR_DISFOLD_Msk (1UL << SCnSCB_ACTLR_DISFOLD_Pos) /*!< ACTLR: DISFOLD Mask */ - -#define SCnSCB_ACTLR_DISDEFWBUF_Pos 1 /*!< ACTLR: DISDEFWBUF Position */ -#define SCnSCB_ACTLR_DISDEFWBUF_Msk (1UL << SCnSCB_ACTLR_DISDEFWBUF_Pos) /*!< ACTLR: DISDEFWBUF Mask */ - -#define SCnSCB_ACTLR_DISMCYCINT_Pos 0 /*!< ACTLR: DISMCYCINT Position */ -#define SCnSCB_ACTLR_DISMCYCINT_Msk (1UL /*<< SCnSCB_ACTLR_DISMCYCINT_Pos*/) /*!< ACTLR: DISMCYCINT Mask */ - -/*@} end of group CMSIS_SCnotSCB */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_SysTick System Tick Timer (SysTick) - \brief Type definitions for the System Timer Registers. - @{ - */ - -/** \brief Structure type to access the System Timer (SysTick). - */ -typedef struct -{ - __IO uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ - __IO uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ - __IO uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ - __I uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ -} SysTick_Type; - -/* SysTick Control / Status Register Definitions */ -#define SysTick_CTRL_COUNTFLAG_Pos 16 /*!< SysTick CTRL: COUNTFLAG Position */ -#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ - -#define SysTick_CTRL_CLKSOURCE_Pos 2 /*!< SysTick CTRL: CLKSOURCE Position */ -#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ - -#define SysTick_CTRL_TICKINT_Pos 1 /*!< SysTick CTRL: TICKINT Position */ -#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ - -#define SysTick_CTRL_ENABLE_Pos 0 /*!< SysTick CTRL: ENABLE Position */ -#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ - -/* SysTick Reload Register Definitions */ -#define SysTick_LOAD_RELOAD_Pos 0 /*!< SysTick LOAD: RELOAD Position */ -#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ - -/* SysTick Current Register Definitions */ -#define SysTick_VAL_CURRENT_Pos 0 /*!< SysTick VAL: CURRENT Position */ -#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ - -/* SysTick Calibration Register Definitions */ -#define SysTick_CALIB_NOREF_Pos 31 /*!< SysTick CALIB: NOREF Position */ -#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ - -#define SysTick_CALIB_SKEW_Pos 30 /*!< SysTick CALIB: SKEW Position */ -#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ - -#define SysTick_CALIB_TENMS_Pos 0 /*!< SysTick CALIB: TENMS Position */ -#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ - -/*@} end of group CMSIS_SysTick */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_ITM Instrumentation Trace Macrocell (ITM) - \brief Type definitions for the Instrumentation Trace Macrocell (ITM) - @{ - */ - -/** \brief Structure type to access the Instrumentation Trace Macrocell Register (ITM). - */ -typedef struct -{ - __O union - { - __O uint8_t u8; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 8-bit */ - __O uint16_t u16; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 16-bit */ - __O uint32_t u32; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 32-bit */ - } PORT [32]; /*!< Offset: 0x000 ( /W) ITM Stimulus Port Registers */ - uint32_t RESERVED0[864]; - __IO uint32_t TER; /*!< Offset: 0xE00 (R/W) ITM Trace Enable Register */ - uint32_t RESERVED1[15]; - __IO uint32_t TPR; /*!< Offset: 0xE40 (R/W) ITM Trace Privilege Register */ - uint32_t RESERVED2[15]; - __IO uint32_t TCR; /*!< Offset: 0xE80 (R/W) ITM Trace Control Register */ - uint32_t RESERVED3[29]; - __O uint32_t IWR; /*!< Offset: 0xEF8 ( /W) ITM Integration Write Register */ - __I uint32_t IRR; /*!< Offset: 0xEFC (R/ ) ITM Integration Read Register */ - __IO uint32_t IMCR; /*!< Offset: 0xF00 (R/W) ITM Integration Mode Control Register */ - uint32_t RESERVED4[43]; - __O uint32_t LAR; /*!< Offset: 0xFB0 ( /W) ITM Lock Access Register */ - __I uint32_t LSR; /*!< Offset: 0xFB4 (R/ ) ITM Lock Status Register */ - uint32_t RESERVED5[6]; - __I uint32_t PID4; /*!< Offset: 0xFD0 (R/ ) ITM Peripheral Identification Register #4 */ - __I uint32_t PID5; /*!< Offset: 0xFD4 (R/ ) ITM Peripheral Identification Register #5 */ - __I uint32_t PID6; /*!< Offset: 0xFD8 (R/ ) ITM Peripheral Identification Register #6 */ - __I uint32_t PID7; /*!< Offset: 0xFDC (R/ ) ITM Peripheral Identification Register #7 */ - __I uint32_t PID0; /*!< Offset: 0xFE0 (R/ ) ITM Peripheral Identification Register #0 */ - __I uint32_t PID1; /*!< Offset: 0xFE4 (R/ ) ITM Peripheral Identification Register #1 */ - __I uint32_t PID2; /*!< Offset: 0xFE8 (R/ ) ITM Peripheral Identification Register #2 */ - __I uint32_t PID3; /*!< Offset: 0xFEC (R/ ) ITM Peripheral Identification Register #3 */ - __I uint32_t CID0; /*!< Offset: 0xFF0 (R/ ) ITM Component Identification Register #0 */ - __I uint32_t CID1; /*!< Offset: 0xFF4 (R/ ) ITM Component Identification Register #1 */ - __I uint32_t CID2; /*!< Offset: 0xFF8 (R/ ) ITM Component Identification Register #2 */ - __I uint32_t CID3; /*!< Offset: 0xFFC (R/ ) ITM Component Identification Register #3 */ -} ITM_Type; - -/* ITM Trace Privilege Register Definitions */ -#define ITM_TPR_PRIVMASK_Pos 0 /*!< ITM TPR: PRIVMASK Position */ -#define ITM_TPR_PRIVMASK_Msk (0xFUL /*<< ITM_TPR_PRIVMASK_Pos*/) /*!< ITM TPR: PRIVMASK Mask */ - -/* ITM Trace Control Register Definitions */ -#define ITM_TCR_BUSY_Pos 23 /*!< ITM TCR: BUSY Position */ -#define ITM_TCR_BUSY_Msk (1UL << ITM_TCR_BUSY_Pos) /*!< ITM TCR: BUSY Mask */ - -#define ITM_TCR_TraceBusID_Pos 16 /*!< ITM TCR: ATBID Position */ -#define ITM_TCR_TraceBusID_Msk (0x7FUL << ITM_TCR_TraceBusID_Pos) /*!< ITM TCR: ATBID Mask */ - -#define ITM_TCR_GTSFREQ_Pos 10 /*!< ITM TCR: Global timestamp frequency Position */ -#define ITM_TCR_GTSFREQ_Msk (3UL << ITM_TCR_GTSFREQ_Pos) /*!< ITM TCR: Global timestamp frequency Mask */ - -#define ITM_TCR_TSPrescale_Pos 8 /*!< ITM TCR: TSPrescale Position */ -#define ITM_TCR_TSPrescale_Msk (3UL << ITM_TCR_TSPrescale_Pos) /*!< ITM TCR: TSPrescale Mask */ - -#define ITM_TCR_SWOENA_Pos 4 /*!< ITM TCR: SWOENA Position */ -#define ITM_TCR_SWOENA_Msk (1UL << ITM_TCR_SWOENA_Pos) /*!< ITM TCR: SWOENA Mask */ - -#define ITM_TCR_DWTENA_Pos 3 /*!< ITM TCR: DWTENA Position */ -#define ITM_TCR_DWTENA_Msk (1UL << ITM_TCR_DWTENA_Pos) /*!< ITM TCR: DWTENA Mask */ - -#define ITM_TCR_SYNCENA_Pos 2 /*!< ITM TCR: SYNCENA Position */ -#define ITM_TCR_SYNCENA_Msk (1UL << ITM_TCR_SYNCENA_Pos) /*!< ITM TCR: SYNCENA Mask */ - -#define ITM_TCR_TSENA_Pos 1 /*!< ITM TCR: TSENA Position */ -#define ITM_TCR_TSENA_Msk (1UL << ITM_TCR_TSENA_Pos) /*!< ITM TCR: TSENA Mask */ - -#define ITM_TCR_ITMENA_Pos 0 /*!< ITM TCR: ITM Enable bit Position */ -#define ITM_TCR_ITMENA_Msk (1UL /*<< ITM_TCR_ITMENA_Pos*/) /*!< ITM TCR: ITM Enable bit Mask */ - -/* ITM Integration Write Register Definitions */ -#define ITM_IWR_ATVALIDM_Pos 0 /*!< ITM IWR: ATVALIDM Position */ -#define ITM_IWR_ATVALIDM_Msk (1UL /*<< ITM_IWR_ATVALIDM_Pos*/) /*!< ITM IWR: ATVALIDM Mask */ - -/* ITM Integration Read Register Definitions */ -#define ITM_IRR_ATREADYM_Pos 0 /*!< ITM IRR: ATREADYM Position */ -#define ITM_IRR_ATREADYM_Msk (1UL /*<< ITM_IRR_ATREADYM_Pos*/) /*!< ITM IRR: ATREADYM Mask */ - -/* ITM Integration Mode Control Register Definitions */ -#define ITM_IMCR_INTEGRATION_Pos 0 /*!< ITM IMCR: INTEGRATION Position */ -#define ITM_IMCR_INTEGRATION_Msk (1UL /*<< ITM_IMCR_INTEGRATION_Pos*/) /*!< ITM IMCR: INTEGRATION Mask */ - -/* ITM Lock Status Register Definitions */ -#define ITM_LSR_ByteAcc_Pos 2 /*!< ITM LSR: ByteAcc Position */ -#define ITM_LSR_ByteAcc_Msk (1UL << ITM_LSR_ByteAcc_Pos) /*!< ITM LSR: ByteAcc Mask */ - -#define ITM_LSR_Access_Pos 1 /*!< ITM LSR: Access Position */ -#define ITM_LSR_Access_Msk (1UL << ITM_LSR_Access_Pos) /*!< ITM LSR: Access Mask */ - -#define ITM_LSR_Present_Pos 0 /*!< ITM LSR: Present Position */ -#define ITM_LSR_Present_Msk (1UL /*<< ITM_LSR_Present_Pos*/) /*!< ITM LSR: Present Mask */ - -/*@}*/ /* end of group CMSIS_ITM */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_DWT Data Watchpoint and Trace (DWT) - \brief Type definitions for the Data Watchpoint and Trace (DWT) - @{ - */ - -/** \brief Structure type to access the Data Watchpoint and Trace Register (DWT). - */ -typedef struct -{ - __IO uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */ - __IO uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */ - __IO uint32_t CPICNT; /*!< Offset: 0x008 (R/W) CPI Count Register */ - __IO uint32_t EXCCNT; /*!< Offset: 0x00C (R/W) Exception Overhead Count Register */ - __IO uint32_t SLEEPCNT; /*!< Offset: 0x010 (R/W) Sleep Count Register */ - __IO uint32_t LSUCNT; /*!< Offset: 0x014 (R/W) LSU Count Register */ - __IO uint32_t FOLDCNT; /*!< Offset: 0x018 (R/W) Folded-instruction Count Register */ - __I uint32_t PCSR; /*!< Offset: 0x01C (R/ ) Program Counter Sample Register */ - __IO uint32_t COMP0; /*!< Offset: 0x020 (R/W) Comparator Register 0 */ - __IO uint32_t MASK0; /*!< Offset: 0x024 (R/W) Mask Register 0 */ - __IO uint32_t FUNCTION0; /*!< Offset: 0x028 (R/W) Function Register 0 */ - uint32_t RESERVED0[1]; - __IO uint32_t COMP1; /*!< Offset: 0x030 (R/W) Comparator Register 1 */ - __IO uint32_t MASK1; /*!< Offset: 0x034 (R/W) Mask Register 1 */ - __IO uint32_t FUNCTION1; /*!< Offset: 0x038 (R/W) Function Register 1 */ - uint32_t RESERVED1[1]; - __IO uint32_t COMP2; /*!< Offset: 0x040 (R/W) Comparator Register 2 */ - __IO uint32_t MASK2; /*!< Offset: 0x044 (R/W) Mask Register 2 */ - __IO uint32_t FUNCTION2; /*!< Offset: 0x048 (R/W) Function Register 2 */ - uint32_t RESERVED2[1]; - __IO uint32_t COMP3; /*!< Offset: 0x050 (R/W) Comparator Register 3 */ - __IO uint32_t MASK3; /*!< Offset: 0x054 (R/W) Mask Register 3 */ - __IO uint32_t FUNCTION3; /*!< Offset: 0x058 (R/W) Function Register 3 */ -} DWT_Type; - -/* DWT Control Register Definitions */ -#define DWT_CTRL_NUMCOMP_Pos 28 /*!< DWT CTRL: NUMCOMP Position */ -#define DWT_CTRL_NUMCOMP_Msk (0xFUL << DWT_CTRL_NUMCOMP_Pos) /*!< DWT CTRL: NUMCOMP Mask */ - -#define DWT_CTRL_NOTRCPKT_Pos 27 /*!< DWT CTRL: NOTRCPKT Position */ -#define DWT_CTRL_NOTRCPKT_Msk (0x1UL << DWT_CTRL_NOTRCPKT_Pos) /*!< DWT CTRL: NOTRCPKT Mask */ - -#define DWT_CTRL_NOEXTTRIG_Pos 26 /*!< DWT CTRL: NOEXTTRIG Position */ -#define DWT_CTRL_NOEXTTRIG_Msk (0x1UL << DWT_CTRL_NOEXTTRIG_Pos) /*!< DWT CTRL: NOEXTTRIG Mask */ - -#define DWT_CTRL_NOCYCCNT_Pos 25 /*!< DWT CTRL: NOCYCCNT Position */ -#define DWT_CTRL_NOCYCCNT_Msk (0x1UL << DWT_CTRL_NOCYCCNT_Pos) /*!< DWT CTRL: NOCYCCNT Mask */ - -#define DWT_CTRL_NOPRFCNT_Pos 24 /*!< DWT CTRL: NOPRFCNT Position */ -#define DWT_CTRL_NOPRFCNT_Msk (0x1UL << DWT_CTRL_NOPRFCNT_Pos) /*!< DWT CTRL: NOPRFCNT Mask */ - -#define DWT_CTRL_CYCEVTENA_Pos 22 /*!< DWT CTRL: CYCEVTENA Position */ -#define DWT_CTRL_CYCEVTENA_Msk (0x1UL << DWT_CTRL_CYCEVTENA_Pos) /*!< DWT CTRL: CYCEVTENA Mask */ - -#define DWT_CTRL_FOLDEVTENA_Pos 21 /*!< DWT CTRL: FOLDEVTENA Position */ -#define DWT_CTRL_FOLDEVTENA_Msk (0x1UL << DWT_CTRL_FOLDEVTENA_Pos) /*!< DWT CTRL: FOLDEVTENA Mask */ - -#define DWT_CTRL_LSUEVTENA_Pos 20 /*!< DWT CTRL: LSUEVTENA Position */ -#define DWT_CTRL_LSUEVTENA_Msk (0x1UL << DWT_CTRL_LSUEVTENA_Pos) /*!< DWT CTRL: LSUEVTENA Mask */ - -#define DWT_CTRL_SLEEPEVTENA_Pos 19 /*!< DWT CTRL: SLEEPEVTENA Position */ -#define DWT_CTRL_SLEEPEVTENA_Msk (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos) /*!< DWT CTRL: SLEEPEVTENA Mask */ - -#define DWT_CTRL_EXCEVTENA_Pos 18 /*!< DWT CTRL: EXCEVTENA Position */ -#define DWT_CTRL_EXCEVTENA_Msk (0x1UL << DWT_CTRL_EXCEVTENA_Pos) /*!< DWT CTRL: EXCEVTENA Mask */ - -#define DWT_CTRL_CPIEVTENA_Pos 17 /*!< DWT CTRL: CPIEVTENA Position */ -#define DWT_CTRL_CPIEVTENA_Msk (0x1UL << DWT_CTRL_CPIEVTENA_Pos) /*!< DWT CTRL: CPIEVTENA Mask */ - -#define DWT_CTRL_EXCTRCENA_Pos 16 /*!< DWT CTRL: EXCTRCENA Position */ -#define DWT_CTRL_EXCTRCENA_Msk (0x1UL << DWT_CTRL_EXCTRCENA_Pos) /*!< DWT CTRL: EXCTRCENA Mask */ - -#define DWT_CTRL_PCSAMPLENA_Pos 12 /*!< DWT CTRL: PCSAMPLENA Position */ -#define DWT_CTRL_PCSAMPLENA_Msk (0x1UL << DWT_CTRL_PCSAMPLENA_Pos) /*!< DWT CTRL: PCSAMPLENA Mask */ - -#define DWT_CTRL_SYNCTAP_Pos 10 /*!< DWT CTRL: SYNCTAP Position */ -#define DWT_CTRL_SYNCTAP_Msk (0x3UL << DWT_CTRL_SYNCTAP_Pos) /*!< DWT CTRL: SYNCTAP Mask */ - -#define DWT_CTRL_CYCTAP_Pos 9 /*!< DWT CTRL: CYCTAP Position */ -#define DWT_CTRL_CYCTAP_Msk (0x1UL << DWT_CTRL_CYCTAP_Pos) /*!< DWT CTRL: CYCTAP Mask */ - -#define DWT_CTRL_POSTINIT_Pos 5 /*!< DWT CTRL: POSTINIT Position */ -#define DWT_CTRL_POSTINIT_Msk (0xFUL << DWT_CTRL_POSTINIT_Pos) /*!< DWT CTRL: POSTINIT Mask */ - -#define DWT_CTRL_POSTPRESET_Pos 1 /*!< DWT CTRL: POSTPRESET Position */ -#define DWT_CTRL_POSTPRESET_Msk (0xFUL << DWT_CTRL_POSTPRESET_Pos) /*!< DWT CTRL: POSTPRESET Mask */ - -#define DWT_CTRL_CYCCNTENA_Pos 0 /*!< DWT CTRL: CYCCNTENA Position */ -#define DWT_CTRL_CYCCNTENA_Msk (0x1UL /*<< DWT_CTRL_CYCCNTENA_Pos*/) /*!< DWT CTRL: CYCCNTENA Mask */ - -/* DWT CPI Count Register Definitions */ -#define DWT_CPICNT_CPICNT_Pos 0 /*!< DWT CPICNT: CPICNT Position */ -#define DWT_CPICNT_CPICNT_Msk (0xFFUL /*<< DWT_CPICNT_CPICNT_Pos*/) /*!< DWT CPICNT: CPICNT Mask */ - -/* DWT Exception Overhead Count Register Definitions */ -#define DWT_EXCCNT_EXCCNT_Pos 0 /*!< DWT EXCCNT: EXCCNT Position */ -#define DWT_EXCCNT_EXCCNT_Msk (0xFFUL /*<< DWT_EXCCNT_EXCCNT_Pos*/) /*!< DWT EXCCNT: EXCCNT Mask */ - -/* DWT Sleep Count Register Definitions */ -#define DWT_SLEEPCNT_SLEEPCNT_Pos 0 /*!< DWT SLEEPCNT: SLEEPCNT Position */ -#define DWT_SLEEPCNT_SLEEPCNT_Msk (0xFFUL /*<< DWT_SLEEPCNT_SLEEPCNT_Pos*/) /*!< DWT SLEEPCNT: SLEEPCNT Mask */ - -/* DWT LSU Count Register Definitions */ -#define DWT_LSUCNT_LSUCNT_Pos 0 /*!< DWT LSUCNT: LSUCNT Position */ -#define DWT_LSUCNT_LSUCNT_Msk (0xFFUL /*<< DWT_LSUCNT_LSUCNT_Pos*/) /*!< DWT LSUCNT: LSUCNT Mask */ - -/* DWT Folded-instruction Count Register Definitions */ -#define DWT_FOLDCNT_FOLDCNT_Pos 0 /*!< DWT FOLDCNT: FOLDCNT Position */ -#define DWT_FOLDCNT_FOLDCNT_Msk (0xFFUL /*<< DWT_FOLDCNT_FOLDCNT_Pos*/) /*!< DWT FOLDCNT: FOLDCNT Mask */ - -/* DWT Comparator Mask Register Definitions */ -#define DWT_MASK_MASK_Pos 0 /*!< DWT MASK: MASK Position */ -#define DWT_MASK_MASK_Msk (0x1FUL /*<< DWT_MASK_MASK_Pos*/) /*!< DWT MASK: MASK Mask */ - -/* DWT Comparator Function Register Definitions */ -#define DWT_FUNCTION_MATCHED_Pos 24 /*!< DWT FUNCTION: MATCHED Position */ -#define DWT_FUNCTION_MATCHED_Msk (0x1UL << DWT_FUNCTION_MATCHED_Pos) /*!< DWT FUNCTION: MATCHED Mask */ - -#define DWT_FUNCTION_DATAVADDR1_Pos 16 /*!< DWT FUNCTION: DATAVADDR1 Position */ -#define DWT_FUNCTION_DATAVADDR1_Msk (0xFUL << DWT_FUNCTION_DATAVADDR1_Pos) /*!< DWT FUNCTION: DATAVADDR1 Mask */ - -#define DWT_FUNCTION_DATAVADDR0_Pos 12 /*!< DWT FUNCTION: DATAVADDR0 Position */ -#define DWT_FUNCTION_DATAVADDR0_Msk (0xFUL << DWT_FUNCTION_DATAVADDR0_Pos) /*!< DWT FUNCTION: DATAVADDR0 Mask */ - -#define DWT_FUNCTION_DATAVSIZE_Pos 10 /*!< DWT FUNCTION: DATAVSIZE Position */ -#define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos) /*!< DWT FUNCTION: DATAVSIZE Mask */ - -#define DWT_FUNCTION_LNK1ENA_Pos 9 /*!< DWT FUNCTION: LNK1ENA Position */ -#define DWT_FUNCTION_LNK1ENA_Msk (0x1UL << DWT_FUNCTION_LNK1ENA_Pos) /*!< DWT FUNCTION: LNK1ENA Mask */ - -#define DWT_FUNCTION_DATAVMATCH_Pos 8 /*!< DWT FUNCTION: DATAVMATCH Position */ -#define DWT_FUNCTION_DATAVMATCH_Msk (0x1UL << DWT_FUNCTION_DATAVMATCH_Pos) /*!< DWT FUNCTION: DATAVMATCH Mask */ - -#define DWT_FUNCTION_CYCMATCH_Pos 7 /*!< DWT FUNCTION: CYCMATCH Position */ -#define DWT_FUNCTION_CYCMATCH_Msk (0x1UL << DWT_FUNCTION_CYCMATCH_Pos) /*!< DWT FUNCTION: CYCMATCH Mask */ - -#define DWT_FUNCTION_EMITRANGE_Pos 5 /*!< DWT FUNCTION: EMITRANGE Position */ -#define DWT_FUNCTION_EMITRANGE_Msk (0x1UL << DWT_FUNCTION_EMITRANGE_Pos) /*!< DWT FUNCTION: EMITRANGE Mask */ - -#define DWT_FUNCTION_FUNCTION_Pos 0 /*!< DWT FUNCTION: FUNCTION Position */ -#define DWT_FUNCTION_FUNCTION_Msk (0xFUL /*<< DWT_FUNCTION_FUNCTION_Pos*/) /*!< DWT FUNCTION: FUNCTION Mask */ - -/*@}*/ /* end of group CMSIS_DWT */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_TPI Trace Port Interface (TPI) - \brief Type definitions for the Trace Port Interface (TPI) - @{ - */ - -/** \brief Structure type to access the Trace Port Interface Register (TPI). - */ -typedef struct -{ - __IO uint32_t SSPSR; /*!< Offset: 0x000 (R/ ) Supported Parallel Port Size Register */ - __IO uint32_t CSPSR; /*!< Offset: 0x004 (R/W) Current Parallel Port Size Register */ - uint32_t RESERVED0[2]; - __IO uint32_t ACPR; /*!< Offset: 0x010 (R/W) Asynchronous Clock Prescaler Register */ - uint32_t RESERVED1[55]; - __IO uint32_t SPPR; /*!< Offset: 0x0F0 (R/W) Selected Pin Protocol Register */ - uint32_t RESERVED2[131]; - __I uint32_t FFSR; /*!< Offset: 0x300 (R/ ) Formatter and Flush Status Register */ - __IO uint32_t FFCR; /*!< Offset: 0x304 (R/W) Formatter and Flush Control Register */ - __I uint32_t FSCR; /*!< Offset: 0x308 (R/ ) Formatter Synchronization Counter Register */ - uint32_t RESERVED3[759]; - __I uint32_t TRIGGER; /*!< Offset: 0xEE8 (R/ ) TRIGGER */ - __I uint32_t FIFO0; /*!< Offset: 0xEEC (R/ ) Integration ETM Data */ - __I uint32_t ITATBCTR2; /*!< Offset: 0xEF0 (R/ ) ITATBCTR2 */ - uint32_t RESERVED4[1]; - __I uint32_t ITATBCTR0; /*!< Offset: 0xEF8 (R/ ) ITATBCTR0 */ - __I uint32_t FIFO1; /*!< Offset: 0xEFC (R/ ) Integration ITM Data */ - __IO uint32_t ITCTRL; /*!< Offset: 0xF00 (R/W) Integration Mode Control */ - uint32_t RESERVED5[39]; - __IO uint32_t CLAIMSET; /*!< Offset: 0xFA0 (R/W) Claim tag set */ - __IO uint32_t CLAIMCLR; /*!< Offset: 0xFA4 (R/W) Claim tag clear */ - uint32_t RESERVED7[8]; - __I uint32_t DEVID; /*!< Offset: 0xFC8 (R/ ) TPIU_DEVID */ - __I uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) TPIU_DEVTYPE */ -} TPI_Type; - -/* TPI Asynchronous Clock Prescaler Register Definitions */ -#define TPI_ACPR_PRESCALER_Pos 0 /*!< TPI ACPR: PRESCALER Position */ -#define TPI_ACPR_PRESCALER_Msk (0x1FFFUL /*<< TPI_ACPR_PRESCALER_Pos*/) /*!< TPI ACPR: PRESCALER Mask */ - -/* TPI Selected Pin Protocol Register Definitions */ -#define TPI_SPPR_TXMODE_Pos 0 /*!< TPI SPPR: TXMODE Position */ -#define TPI_SPPR_TXMODE_Msk (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/) /*!< TPI SPPR: TXMODE Mask */ - -/* TPI Formatter and Flush Status Register Definitions */ -#define TPI_FFSR_FtNonStop_Pos 3 /*!< TPI FFSR: FtNonStop Position */ -#define TPI_FFSR_FtNonStop_Msk (0x1UL << TPI_FFSR_FtNonStop_Pos) /*!< TPI FFSR: FtNonStop Mask */ - -#define TPI_FFSR_TCPresent_Pos 2 /*!< TPI FFSR: TCPresent Position */ -#define TPI_FFSR_TCPresent_Msk (0x1UL << TPI_FFSR_TCPresent_Pos) /*!< TPI FFSR: TCPresent Mask */ - -#define TPI_FFSR_FtStopped_Pos 1 /*!< TPI FFSR: FtStopped Position */ -#define TPI_FFSR_FtStopped_Msk (0x1UL << TPI_FFSR_FtStopped_Pos) /*!< TPI FFSR: FtStopped Mask */ - -#define TPI_FFSR_FlInProg_Pos 0 /*!< TPI FFSR: FlInProg Position */ -#define TPI_FFSR_FlInProg_Msk (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/) /*!< TPI FFSR: FlInProg Mask */ - -/* TPI Formatter and Flush Control Register Definitions */ -#define TPI_FFCR_TrigIn_Pos 8 /*!< TPI FFCR: TrigIn Position */ -#define TPI_FFCR_TrigIn_Msk (0x1UL << TPI_FFCR_TrigIn_Pos) /*!< TPI FFCR: TrigIn Mask */ - -#define TPI_FFCR_EnFCont_Pos 1 /*!< TPI FFCR: EnFCont Position */ -#define TPI_FFCR_EnFCont_Msk (0x1UL << TPI_FFCR_EnFCont_Pos) /*!< TPI FFCR: EnFCont Mask */ - -/* TPI TRIGGER Register Definitions */ -#define TPI_TRIGGER_TRIGGER_Pos 0 /*!< TPI TRIGGER: TRIGGER Position */ -#define TPI_TRIGGER_TRIGGER_Msk (0x1UL /*<< TPI_TRIGGER_TRIGGER_Pos*/) /*!< TPI TRIGGER: TRIGGER Mask */ - -/* TPI Integration ETM Data Register Definitions (FIFO0) */ -#define TPI_FIFO0_ITM_ATVALID_Pos 29 /*!< TPI FIFO0: ITM_ATVALID Position */ -#define TPI_FIFO0_ITM_ATVALID_Msk (0x3UL << TPI_FIFO0_ITM_ATVALID_Pos) /*!< TPI FIFO0: ITM_ATVALID Mask */ - -#define TPI_FIFO0_ITM_bytecount_Pos 27 /*!< TPI FIFO0: ITM_bytecount Position */ -#define TPI_FIFO0_ITM_bytecount_Msk (0x3UL << TPI_FIFO0_ITM_bytecount_Pos) /*!< TPI FIFO0: ITM_bytecount Mask */ - -#define TPI_FIFO0_ETM_ATVALID_Pos 26 /*!< TPI FIFO0: ETM_ATVALID Position */ -#define TPI_FIFO0_ETM_ATVALID_Msk (0x3UL << TPI_FIFO0_ETM_ATVALID_Pos) /*!< TPI FIFO0: ETM_ATVALID Mask */ - -#define TPI_FIFO0_ETM_bytecount_Pos 24 /*!< TPI FIFO0: ETM_bytecount Position */ -#define TPI_FIFO0_ETM_bytecount_Msk (0x3UL << TPI_FIFO0_ETM_bytecount_Pos) /*!< TPI FIFO0: ETM_bytecount Mask */ - -#define TPI_FIFO0_ETM2_Pos 16 /*!< TPI FIFO0: ETM2 Position */ -#define TPI_FIFO0_ETM2_Msk (0xFFUL << TPI_FIFO0_ETM2_Pos) /*!< TPI FIFO0: ETM2 Mask */ - -#define TPI_FIFO0_ETM1_Pos 8 /*!< TPI FIFO0: ETM1 Position */ -#define TPI_FIFO0_ETM1_Msk (0xFFUL << TPI_FIFO0_ETM1_Pos) /*!< TPI FIFO0: ETM1 Mask */ - -#define TPI_FIFO0_ETM0_Pos 0 /*!< TPI FIFO0: ETM0 Position */ -#define TPI_FIFO0_ETM0_Msk (0xFFUL /*<< TPI_FIFO0_ETM0_Pos*/) /*!< TPI FIFO0: ETM0 Mask */ - -/* TPI ITATBCTR2 Register Definitions */ -#define TPI_ITATBCTR2_ATREADY_Pos 0 /*!< TPI ITATBCTR2: ATREADY Position */ -#define TPI_ITATBCTR2_ATREADY_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY_Pos*/) /*!< TPI ITATBCTR2: ATREADY Mask */ - -/* TPI Integration ITM Data Register Definitions (FIFO1) */ -#define TPI_FIFO1_ITM_ATVALID_Pos 29 /*!< TPI FIFO1: ITM_ATVALID Position */ -#define TPI_FIFO1_ITM_ATVALID_Msk (0x3UL << TPI_FIFO1_ITM_ATVALID_Pos) /*!< TPI FIFO1: ITM_ATVALID Mask */ - -#define TPI_FIFO1_ITM_bytecount_Pos 27 /*!< TPI FIFO1: ITM_bytecount Position */ -#define TPI_FIFO1_ITM_bytecount_Msk (0x3UL << TPI_FIFO1_ITM_bytecount_Pos) /*!< TPI FIFO1: ITM_bytecount Mask */ - -#define TPI_FIFO1_ETM_ATVALID_Pos 26 /*!< TPI FIFO1: ETM_ATVALID Position */ -#define TPI_FIFO1_ETM_ATVALID_Msk (0x3UL << TPI_FIFO1_ETM_ATVALID_Pos) /*!< TPI FIFO1: ETM_ATVALID Mask */ - -#define TPI_FIFO1_ETM_bytecount_Pos 24 /*!< TPI FIFO1: ETM_bytecount Position */ -#define TPI_FIFO1_ETM_bytecount_Msk (0x3UL << TPI_FIFO1_ETM_bytecount_Pos) /*!< TPI FIFO1: ETM_bytecount Mask */ - -#define TPI_FIFO1_ITM2_Pos 16 /*!< TPI FIFO1: ITM2 Position */ -#define TPI_FIFO1_ITM2_Msk (0xFFUL << TPI_FIFO1_ITM2_Pos) /*!< TPI FIFO1: ITM2 Mask */ - -#define TPI_FIFO1_ITM1_Pos 8 /*!< TPI FIFO1: ITM1 Position */ -#define TPI_FIFO1_ITM1_Msk (0xFFUL << TPI_FIFO1_ITM1_Pos) /*!< TPI FIFO1: ITM1 Mask */ - -#define TPI_FIFO1_ITM0_Pos 0 /*!< TPI FIFO1: ITM0 Position */ -#define TPI_FIFO1_ITM0_Msk (0xFFUL /*<< TPI_FIFO1_ITM0_Pos*/) /*!< TPI FIFO1: ITM0 Mask */ - -/* TPI ITATBCTR0 Register Definitions */ -#define TPI_ITATBCTR0_ATREADY_Pos 0 /*!< TPI ITATBCTR0: ATREADY Position */ -#define TPI_ITATBCTR0_ATREADY_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY_Pos*/) /*!< TPI ITATBCTR0: ATREADY Mask */ - -/* TPI Integration Mode Control Register Definitions */ -#define TPI_ITCTRL_Mode_Pos 0 /*!< TPI ITCTRL: Mode Position */ -#define TPI_ITCTRL_Mode_Msk (0x1UL /*<< TPI_ITCTRL_Mode_Pos*/) /*!< TPI ITCTRL: Mode Mask */ - -/* TPI DEVID Register Definitions */ -#define TPI_DEVID_NRZVALID_Pos 11 /*!< TPI DEVID: NRZVALID Position */ -#define TPI_DEVID_NRZVALID_Msk (0x1UL << TPI_DEVID_NRZVALID_Pos) /*!< TPI DEVID: NRZVALID Mask */ - -#define TPI_DEVID_MANCVALID_Pos 10 /*!< TPI DEVID: MANCVALID Position */ -#define TPI_DEVID_MANCVALID_Msk (0x1UL << TPI_DEVID_MANCVALID_Pos) /*!< TPI DEVID: MANCVALID Mask */ - -#define TPI_DEVID_PTINVALID_Pos 9 /*!< TPI DEVID: PTINVALID Position */ -#define TPI_DEVID_PTINVALID_Msk (0x1UL << TPI_DEVID_PTINVALID_Pos) /*!< TPI DEVID: PTINVALID Mask */ - -#define TPI_DEVID_MinBufSz_Pos 6 /*!< TPI DEVID: MinBufSz Position */ -#define TPI_DEVID_MinBufSz_Msk (0x7UL << TPI_DEVID_MinBufSz_Pos) /*!< TPI DEVID: MinBufSz Mask */ - -#define TPI_DEVID_AsynClkIn_Pos 5 /*!< TPI DEVID: AsynClkIn Position */ -#define TPI_DEVID_AsynClkIn_Msk (0x1UL << TPI_DEVID_AsynClkIn_Pos) /*!< TPI DEVID: AsynClkIn Mask */ - -#define TPI_DEVID_NrTraceInput_Pos 0 /*!< TPI DEVID: NrTraceInput Position */ -#define TPI_DEVID_NrTraceInput_Msk (0x1FUL /*<< TPI_DEVID_NrTraceInput_Pos*/) /*!< TPI DEVID: NrTraceInput Mask */ - -/* TPI DEVTYPE Register Definitions */ -#define TPI_DEVTYPE_MajorType_Pos 4 /*!< TPI DEVTYPE: MajorType Position */ -#define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos) /*!< TPI DEVTYPE: MajorType Mask */ - -#define TPI_DEVTYPE_SubType_Pos 0 /*!< TPI DEVTYPE: SubType Position */ -#define TPI_DEVTYPE_SubType_Msk (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/) /*!< TPI DEVTYPE: SubType Mask */ - -/*@}*/ /* end of group CMSIS_TPI */ - - -#if (__MPU_PRESENT == 1) -/** \ingroup CMSIS_core_register - \defgroup CMSIS_MPU Memory Protection Unit (MPU) - \brief Type definitions for the Memory Protection Unit (MPU) - @{ - */ - -/** \brief Structure type to access the Memory Protection Unit (MPU). - */ -typedef struct -{ - __I uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */ - __IO uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */ - __IO uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region RNRber Register */ - __IO uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */ - __IO uint32_t RASR; /*!< Offset: 0x010 (R/W) MPU Region Attribute and Size Register */ - __IO uint32_t RBAR_A1; /*!< Offset: 0x014 (R/W) MPU Alias 1 Region Base Address Register */ - __IO uint32_t RASR_A1; /*!< Offset: 0x018 (R/W) MPU Alias 1 Region Attribute and Size Register */ - __IO uint32_t RBAR_A2; /*!< Offset: 0x01C (R/W) MPU Alias 2 Region Base Address Register */ - __IO uint32_t RASR_A2; /*!< Offset: 0x020 (R/W) MPU Alias 2 Region Attribute and Size Register */ - __IO uint32_t RBAR_A3; /*!< Offset: 0x024 (R/W) MPU Alias 3 Region Base Address Register */ - __IO uint32_t RASR_A3; /*!< Offset: 0x028 (R/W) MPU Alias 3 Region Attribute and Size Register */ -} MPU_Type; - -/* MPU Type Register */ -#define MPU_TYPE_IREGION_Pos 16 /*!< MPU TYPE: IREGION Position */ -#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */ - -#define MPU_TYPE_DREGION_Pos 8 /*!< MPU TYPE: DREGION Position */ -#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */ - -#define MPU_TYPE_SEPARATE_Pos 0 /*!< MPU TYPE: SEPARATE Position */ -#define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/) /*!< MPU TYPE: SEPARATE Mask */ - -/* MPU Control Register */ -#define MPU_CTRL_PRIVDEFENA_Pos 2 /*!< MPU CTRL: PRIVDEFENA Position */ -#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */ - -#define MPU_CTRL_HFNMIENA_Pos 1 /*!< MPU CTRL: HFNMIENA Position */ -#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */ - -#define MPU_CTRL_ENABLE_Pos 0 /*!< MPU CTRL: ENABLE Position */ -#define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/) /*!< MPU CTRL: ENABLE Mask */ - -/* MPU Region Number Register */ -#define MPU_RNR_REGION_Pos 0 /*!< MPU RNR: REGION Position */ -#define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/) /*!< MPU RNR: REGION Mask */ - -/* MPU Region Base Address Register */ -#define MPU_RBAR_ADDR_Pos 5 /*!< MPU RBAR: ADDR Position */ -#define MPU_RBAR_ADDR_Msk (0x7FFFFFFUL << MPU_RBAR_ADDR_Pos) /*!< MPU RBAR: ADDR Mask */ - -#define MPU_RBAR_VALID_Pos 4 /*!< MPU RBAR: VALID Position */ -#define MPU_RBAR_VALID_Msk (1UL << MPU_RBAR_VALID_Pos) /*!< MPU RBAR: VALID Mask */ - -#define MPU_RBAR_REGION_Pos 0 /*!< MPU RBAR: REGION Position */ -#define MPU_RBAR_REGION_Msk (0xFUL /*<< MPU_RBAR_REGION_Pos*/) /*!< MPU RBAR: REGION Mask */ - -/* MPU Region Attribute and Size Register */ -#define MPU_RASR_ATTRS_Pos 16 /*!< MPU RASR: MPU Region Attribute field Position */ -#define MPU_RASR_ATTRS_Msk (0xFFFFUL << MPU_RASR_ATTRS_Pos) /*!< MPU RASR: MPU Region Attribute field Mask */ - -#define MPU_RASR_XN_Pos 28 /*!< MPU RASR: ATTRS.XN Position */ -#define MPU_RASR_XN_Msk (1UL << MPU_RASR_XN_Pos) /*!< MPU RASR: ATTRS.XN Mask */ - -#define MPU_RASR_AP_Pos 24 /*!< MPU RASR: ATTRS.AP Position */ -#define MPU_RASR_AP_Msk (0x7UL << MPU_RASR_AP_Pos) /*!< MPU RASR: ATTRS.AP Mask */ - -#define MPU_RASR_TEX_Pos 19 /*!< MPU RASR: ATTRS.TEX Position */ -#define MPU_RASR_TEX_Msk (0x7UL << MPU_RASR_TEX_Pos) /*!< MPU RASR: ATTRS.TEX Mask */ - -#define MPU_RASR_S_Pos 18 /*!< MPU RASR: ATTRS.S Position */ -#define MPU_RASR_S_Msk (1UL << MPU_RASR_S_Pos) /*!< MPU RASR: ATTRS.S Mask */ - -#define MPU_RASR_C_Pos 17 /*!< MPU RASR: ATTRS.C Position */ -#define MPU_RASR_C_Msk (1UL << MPU_RASR_C_Pos) /*!< MPU RASR: ATTRS.C Mask */ - -#define MPU_RASR_B_Pos 16 /*!< MPU RASR: ATTRS.B Position */ -#define MPU_RASR_B_Msk (1UL << MPU_RASR_B_Pos) /*!< MPU RASR: ATTRS.B Mask */ - -#define MPU_RASR_SRD_Pos 8 /*!< MPU RASR: Sub-Region Disable Position */ -#define MPU_RASR_SRD_Msk (0xFFUL << MPU_RASR_SRD_Pos) /*!< MPU RASR: Sub-Region Disable Mask */ - -#define MPU_RASR_SIZE_Pos 1 /*!< MPU RASR: Region Size Field Position */ -#define MPU_RASR_SIZE_Msk (0x1FUL << MPU_RASR_SIZE_Pos) /*!< MPU RASR: Region Size Field Mask */ - -#define MPU_RASR_ENABLE_Pos 0 /*!< MPU RASR: Region enable bit Position */ -#define MPU_RASR_ENABLE_Msk (1UL /*<< MPU_RASR_ENABLE_Pos*/) /*!< MPU RASR: Region enable bit Disable Mask */ - -/*@} end of group CMSIS_MPU */ -#endif - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) - \brief Type definitions for the Core Debug Registers - @{ - */ - -/** \brief Structure type to access the Core Debug Register (CoreDebug). - */ -typedef struct -{ - __IO uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */ - __O uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */ - __IO uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */ - __IO uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */ -} CoreDebug_Type; - -/* Debug Halting Control and Status Register */ -#define CoreDebug_DHCSR_DBGKEY_Pos 16 /*!< CoreDebug DHCSR: DBGKEY Position */ -#define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos) /*!< CoreDebug DHCSR: DBGKEY Mask */ - -#define CoreDebug_DHCSR_S_RESET_ST_Pos 25 /*!< CoreDebug DHCSR: S_RESET_ST Position */ -#define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos) /*!< CoreDebug DHCSR: S_RESET_ST Mask */ - -#define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24 /*!< CoreDebug DHCSR: S_RETIRE_ST Position */ -#define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos) /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */ - -#define CoreDebug_DHCSR_S_LOCKUP_Pos 19 /*!< CoreDebug DHCSR: S_LOCKUP Position */ -#define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos) /*!< CoreDebug DHCSR: S_LOCKUP Mask */ - -#define CoreDebug_DHCSR_S_SLEEP_Pos 18 /*!< CoreDebug DHCSR: S_SLEEP Position */ -#define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos) /*!< CoreDebug DHCSR: S_SLEEP Mask */ - -#define CoreDebug_DHCSR_S_HALT_Pos 17 /*!< CoreDebug DHCSR: S_HALT Position */ -#define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos) /*!< CoreDebug DHCSR: S_HALT Mask */ - -#define CoreDebug_DHCSR_S_REGRDY_Pos 16 /*!< CoreDebug DHCSR: S_REGRDY Position */ -#define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos) /*!< CoreDebug DHCSR: S_REGRDY Mask */ - -#define CoreDebug_DHCSR_C_SNAPSTALL_Pos 5 /*!< CoreDebug DHCSR: C_SNAPSTALL Position */ -#define CoreDebug_DHCSR_C_SNAPSTALL_Msk (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos) /*!< CoreDebug DHCSR: C_SNAPSTALL Mask */ - -#define CoreDebug_DHCSR_C_MASKINTS_Pos 3 /*!< CoreDebug DHCSR: C_MASKINTS Position */ -#define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos) /*!< CoreDebug DHCSR: C_MASKINTS Mask */ - -#define CoreDebug_DHCSR_C_STEP_Pos 2 /*!< CoreDebug DHCSR: C_STEP Position */ -#define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos) /*!< CoreDebug DHCSR: C_STEP Mask */ - -#define CoreDebug_DHCSR_C_HALT_Pos 1 /*!< CoreDebug DHCSR: C_HALT Position */ -#define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos) /*!< CoreDebug DHCSR: C_HALT Mask */ - -#define CoreDebug_DHCSR_C_DEBUGEN_Pos 0 /*!< CoreDebug DHCSR: C_DEBUGEN Position */ -#define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/) /*!< CoreDebug DHCSR: C_DEBUGEN Mask */ - -/* Debug Core Register Selector Register */ -#define CoreDebug_DCRSR_REGWnR_Pos 16 /*!< CoreDebug DCRSR: REGWnR Position */ -#define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos) /*!< CoreDebug DCRSR: REGWnR Mask */ - -#define CoreDebug_DCRSR_REGSEL_Pos 0 /*!< CoreDebug DCRSR: REGSEL Position */ -#define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/) /*!< CoreDebug DCRSR: REGSEL Mask */ - -/* Debug Exception and Monitor Control Register */ -#define CoreDebug_DEMCR_TRCENA_Pos 24 /*!< CoreDebug DEMCR: TRCENA Position */ -#define CoreDebug_DEMCR_TRCENA_Msk (1UL << CoreDebug_DEMCR_TRCENA_Pos) /*!< CoreDebug DEMCR: TRCENA Mask */ - -#define CoreDebug_DEMCR_MON_REQ_Pos 19 /*!< CoreDebug DEMCR: MON_REQ Position */ -#define CoreDebug_DEMCR_MON_REQ_Msk (1UL << CoreDebug_DEMCR_MON_REQ_Pos) /*!< CoreDebug DEMCR: MON_REQ Mask */ - -#define CoreDebug_DEMCR_MON_STEP_Pos 18 /*!< CoreDebug DEMCR: MON_STEP Position */ -#define CoreDebug_DEMCR_MON_STEP_Msk (1UL << CoreDebug_DEMCR_MON_STEP_Pos) /*!< CoreDebug DEMCR: MON_STEP Mask */ - -#define CoreDebug_DEMCR_MON_PEND_Pos 17 /*!< CoreDebug DEMCR: MON_PEND Position */ -#define CoreDebug_DEMCR_MON_PEND_Msk (1UL << CoreDebug_DEMCR_MON_PEND_Pos) /*!< CoreDebug DEMCR: MON_PEND Mask */ - -#define CoreDebug_DEMCR_MON_EN_Pos 16 /*!< CoreDebug DEMCR: MON_EN Position */ -#define CoreDebug_DEMCR_MON_EN_Msk (1UL << CoreDebug_DEMCR_MON_EN_Pos) /*!< CoreDebug DEMCR: MON_EN Mask */ - -#define CoreDebug_DEMCR_VC_HARDERR_Pos 10 /*!< CoreDebug DEMCR: VC_HARDERR Position */ -#define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos) /*!< CoreDebug DEMCR: VC_HARDERR Mask */ - -#define CoreDebug_DEMCR_VC_INTERR_Pos 9 /*!< CoreDebug DEMCR: VC_INTERR Position */ -#define CoreDebug_DEMCR_VC_INTERR_Msk (1UL << CoreDebug_DEMCR_VC_INTERR_Pos) /*!< CoreDebug DEMCR: VC_INTERR Mask */ - -#define CoreDebug_DEMCR_VC_BUSERR_Pos 8 /*!< CoreDebug DEMCR: VC_BUSERR Position */ -#define CoreDebug_DEMCR_VC_BUSERR_Msk (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos) /*!< CoreDebug DEMCR: VC_BUSERR Mask */ - -#define CoreDebug_DEMCR_VC_STATERR_Pos 7 /*!< CoreDebug DEMCR: VC_STATERR Position */ -#define CoreDebug_DEMCR_VC_STATERR_Msk (1UL << CoreDebug_DEMCR_VC_STATERR_Pos) /*!< CoreDebug DEMCR: VC_STATERR Mask */ - -#define CoreDebug_DEMCR_VC_CHKERR_Pos 6 /*!< CoreDebug DEMCR: VC_CHKERR Position */ -#define CoreDebug_DEMCR_VC_CHKERR_Msk (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos) /*!< CoreDebug DEMCR: VC_CHKERR Mask */ - -#define CoreDebug_DEMCR_VC_NOCPERR_Pos 5 /*!< CoreDebug DEMCR: VC_NOCPERR Position */ -#define CoreDebug_DEMCR_VC_NOCPERR_Msk (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos) /*!< CoreDebug DEMCR: VC_NOCPERR Mask */ - -#define CoreDebug_DEMCR_VC_MMERR_Pos 4 /*!< CoreDebug DEMCR: VC_MMERR Position */ -#define CoreDebug_DEMCR_VC_MMERR_Msk (1UL << CoreDebug_DEMCR_VC_MMERR_Pos) /*!< CoreDebug DEMCR: VC_MMERR Mask */ - -#define CoreDebug_DEMCR_VC_CORERESET_Pos 0 /*!< CoreDebug DEMCR: VC_CORERESET Position */ -#define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/) /*!< CoreDebug DEMCR: VC_CORERESET Mask */ - -/*@} end of group CMSIS_CoreDebug */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_core_base Core Definitions - \brief Definitions for base addresses, unions, and structures. - @{ - */ - -/* Memory mapping of Cortex-M3 Hardware */ -#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ -#define ITM_BASE (0xE0000000UL) /*!< ITM Base Address */ -#define DWT_BASE (0xE0001000UL) /*!< DWT Base Address */ -#define TPI_BASE (0xE0040000UL) /*!< TPI Base Address */ -#define CoreDebug_BASE (0xE000EDF0UL) /*!< Core Debug Base Address */ -#define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ -#define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ -#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ - -#define SCnSCB ((SCnSCB_Type *) SCS_BASE ) /*!< System control Register not in SCB */ -#define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ -#define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ -#define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ -#define ITM ((ITM_Type *) ITM_BASE ) /*!< ITM configuration struct */ -#define DWT ((DWT_Type *) DWT_BASE ) /*!< DWT configuration struct */ -#define TPI ((TPI_Type *) TPI_BASE ) /*!< TPI configuration struct */ -#define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE) /*!< Core Debug configuration struct */ - -#if (__MPU_PRESENT == 1) - #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ - #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ -#endif - -/*@} */ - - - -/******************************************************************************* - * Hardware Abstraction Layer - Core Function Interface contains: - - Core NVIC Functions - - Core SysTick Functions - - Core Debug Functions - - Core Register Access Functions - ******************************************************************************/ -/** \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference -*/ - - - -/* ########################## NVIC functions #################################### */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_NVICFunctions NVIC Functions - \brief Functions that manage interrupts and exceptions via the NVIC. - @{ - */ - -/** \brief Set Priority Grouping - - The function sets the priority grouping field using the required unlock sequence. - The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field. - Only values from 0..7 are used. - In case of a conflict between priority grouping and available - priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. - - \param [in] PriorityGroup Priority grouping field. - */ -__STATIC_INLINE void NVIC_SetPriorityGrouping(uint32_t PriorityGroup) -{ - uint32_t reg_value; - uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ - - reg_value = SCB->AIRCR; /* read old register configuration */ - reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ - reg_value = (reg_value | - ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | - (PriorityGroupTmp << 8) ); /* Insert write key and priorty group */ - SCB->AIRCR = reg_value; -} - - -/** \brief Get Priority Grouping - - The function reads the priority grouping field from the NVIC Interrupt Controller. - - \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field). - */ -__STATIC_INLINE uint32_t NVIC_GetPriorityGrouping(void) -{ - return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos)); -} - - -/** \brief Enable External Interrupt - - The function enables a device-specific interrupt in the NVIC interrupt controller. - - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn) -{ - NVIC->ISER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** \brief Disable External Interrupt - - The function disables a device-specific interrupt in the NVIC interrupt controller. - - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn) -{ - NVIC->ICER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** \brief Get Pending Interrupt - - The function reads the pending register in the NVIC and returns the pending bit - for the specified interrupt. - - \param [in] IRQn Interrupt number. - - \return 0 Interrupt status is not pending. - \return 1 Interrupt status is pending. - */ -__STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn) -{ - return((uint32_t)(((NVIC->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** \brief Set Pending Interrupt - - The function sets the pending bit of an external interrupt. - - \param [in] IRQn Interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** \brief Clear Pending Interrupt - - The function clears the pending bit of an external interrupt. - - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ICPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** \brief Get Active Interrupt - - The function reads the active register in NVIC and returns the active bit. - - \param [in] IRQn Interrupt number. - - \return 0 Interrupt status is not active. - \return 1 Interrupt status is active. - */ -__STATIC_INLINE uint32_t NVIC_GetActive(IRQn_Type IRQn) -{ - return((uint32_t)(((NVIC->IABR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** \brief Set Interrupt Priority - - The function sets the priority of an interrupt. - - \note The priority cannot be set for every core interrupt. - - \param [in] IRQn Interrupt number. - \param [in] priority Priority to set. - */ -__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) -{ - if((int32_t)IRQn < 0) { - SCB->SHP[(((uint32_t)(int32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8 - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } - else { - NVIC->IP[((uint32_t)(int32_t)IRQn)] = (uint8_t)((priority << (8 - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } -} - - -/** \brief Get Interrupt Priority - - The function reads the priority of an interrupt. The interrupt - number can be positive to specify an external (device specific) - interrupt, or negative to specify an internal (core) interrupt. - - - \param [in] IRQn Interrupt number. - \return Interrupt Priority. Value is aligned automatically to the implemented - priority bits of the microcontroller. - */ -__STATIC_INLINE uint32_t NVIC_GetPriority(IRQn_Type IRQn) -{ - - if((int32_t)IRQn < 0) { - return(((uint32_t)SCB->SHP[(((uint32_t)(int32_t)IRQn) & 0xFUL)-4UL] >> (8 - __NVIC_PRIO_BITS))); - } - else { - return(((uint32_t)NVIC->IP[((uint32_t)(int32_t)IRQn)] >> (8 - __NVIC_PRIO_BITS))); - } -} - - -/** \brief Encode Priority - - The function encodes the priority for an interrupt with the given priority group, - preemptive priority value, and subpriority value. - In case of a conflict between priority grouping and available - priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. - - \param [in] PriorityGroup Used priority group. - \param [in] PreemptPriority Preemptive priority value (starting from 0). - \param [in] SubPriority Subpriority value (starting from 0). - \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority(). - */ -__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) -{ - uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ - uint32_t PreemptPriorityBits; - uint32_t SubPriorityBits; - - PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); - SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); - - return ( - ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | - ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL))) - ); -} - - -/** \brief Decode Priority - - The function decodes an interrupt priority value with a given priority group to - preemptive priority value and subpriority value. - In case of a conflict between priority grouping and available - priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set. - - \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority(). - \param [in] PriorityGroup Used priority group. - \param [out] pPreemptPriority Preemptive priority value (starting from 0). - \param [out] pSubPriority Subpriority value (starting from 0). - */ -__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* pPreemptPriority, uint32_t* pSubPriority) -{ - uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ - uint32_t PreemptPriorityBits; - uint32_t SubPriorityBits; - - PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); - SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); - - *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL); - *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL); -} - - -/** \brief System Reset - - The function initiates a system reset request to reset the MCU. - */ -__STATIC_INLINE void NVIC_SystemReset(void) -{ - __DSB(); /* Ensure all outstanding memory accesses included - buffered write are completed before reset */ - SCB->AIRCR = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | - (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) | - SCB_AIRCR_SYSRESETREQ_Msk ); /* Keep priority group unchanged */ - __DSB(); /* Ensure completion of memory access */ - while(1) { __NOP(); } /* wait until reset */ -} - -/*@} end of CMSIS_Core_NVICFunctions */ - - - -/* ################################## SysTick function ############################################ */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_SysTickFunctions SysTick Functions - \brief Functions that configure the System. - @{ - */ - -#if (__Vendor_SysTickConfig == 0) - -/** \brief System Tick Configuration - - The function initializes the System Timer and its interrupt, and starts the System Tick Timer. - Counter is in free running mode to generate periodic interrupts. - - \param [in] ticks Number of ticks between two interrupts. - - \return 0 Function succeeded. - \return 1 Function failed. - - \note When the variable __Vendor_SysTickConfig is set to 1, then the - function SysTick_Config is not included. In this case, the file device.h - must contain a vendor-specific implementation of this function. - - */ -__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) -{ - if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) { return (1UL); } /* Reload value impossible */ - - SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ - NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ - SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ - SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | - SysTick_CTRL_TICKINT_Msk | - SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ - return (0UL); /* Function successful */ -} - -#endif - -/*@} end of CMSIS_Core_SysTickFunctions */ - - - -/* ##################################### Debug In/Output function ########################################### */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_core_DebugFunctions ITM Functions - \brief Functions that access the ITM debug interface. - @{ - */ - -extern volatile int32_t ITM_RxBuffer; /*!< External variable to receive characters. */ -#define ITM_RXBUFFER_EMPTY 0x5AA55AA5 /*!< Value identifying \ref ITM_RxBuffer is ready for next character. */ - - -/** \brief ITM Send Character - - The function transmits a character via the ITM channel 0, and - \li Just returns when no debugger is connected that has booked the output. - \li Is blocking when a debugger is connected, but the previous character sent has not been transmitted. - - \param [in] ch Character to transmit. - - \returns Character to transmit. - */ -__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch) -{ - if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) && /* ITM enabled */ - ((ITM->TER & 1UL ) != 0UL) ) /* ITM Port #0 enabled */ - { - while (ITM->PORT[0].u32 == 0UL) { __NOP(); } - ITM->PORT[0].u8 = (uint8_t)ch; - } - return (ch); -} - - -/** \brief ITM Receive Character - - The function inputs a character via the external variable \ref ITM_RxBuffer. - - \return Received character. - \return -1 No character pending. - */ -__STATIC_INLINE int32_t ITM_ReceiveChar (void) { - int32_t ch = -1; /* no character available */ - - if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY) { - ch = ITM_RxBuffer; - ITM_RxBuffer = ITM_RXBUFFER_EMPTY; /* ready for next character */ - } - - return (ch); -} - - -/** \brief ITM Check Character - - The function checks whether a character is pending for reading in the variable \ref ITM_RxBuffer. - - \return 0 No character available. - \return 1 Character available. - */ -__STATIC_INLINE int32_t ITM_CheckChar (void) { - - if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY) { - return (0); /* no character available */ - } else { - return (1); /* character available */ - } -} - -/*@} end of CMSIS_core_DebugFunctions */ - - - - -#ifdef __cplusplus -} -#endif - -#endif /* __CORE_CM3_H_DEPENDANT */ - -#endif /* __CMSIS_GENERIC */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/core_cm4.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/core_cm4.h deleted file mode 100644 index 9749c27d..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/core_cm4.h +++ /dev/null @@ -1,1858 +0,0 @@ -/**************************************************************************//** - * @file core_cm4.h - * @brief CMSIS Cortex-M4 Core Peripheral Access Layer Header File - * @version V4.10 - * @date 18. March 2015 - * - * @note - * - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#endif - -#ifndef __CORE_CM4_H_GENERIC -#define __CORE_CM4_H_GENERIC - -#ifdef __cplusplus - extern "C" { -#endif - -/** \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions - CMSIS violates the following MISRA-C:2004 rules: - - \li Required Rule 8.5, object/function definition in header file.
- Function definitions in header files are used to allow 'inlining'. - - \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
- Unions are used for effective representation of core registers. - - \li Advisory Rule 19.7, Function-like macro defined.
- Function-like macros are used to allow more efficient code. - */ - - -/******************************************************************************* - * CMSIS definitions - ******************************************************************************/ -/** \ingroup Cortex_M4 - @{ - */ - -/* CMSIS CM4 definitions */ -#define __CM4_CMSIS_VERSION_MAIN (0x04) /*!< [31:16] CMSIS HAL main version */ -#define __CM4_CMSIS_VERSION_SUB (0x00) /*!< [15:0] CMSIS HAL sub version */ -#define __CM4_CMSIS_VERSION ((__CM4_CMSIS_VERSION_MAIN << 16) | \ - __CM4_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */ - -#define __CORTEX_M (0x04) /*!< Cortex-M Core */ - - -#if defined ( __CC_ARM ) - #define __ASM __asm /*!< asm keyword for ARM Compiler */ - #define __INLINE __inline /*!< inline keyword for ARM Compiler */ - #define __STATIC_INLINE static __inline - -#elif defined ( __GNUC__ ) - #define __ASM __asm /*!< asm keyword for GNU Compiler */ - #define __INLINE inline /*!< inline keyword for GNU Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __ICCARM__ ) - #define __ASM __asm /*!< asm keyword for IAR Compiler */ - #define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */ - #define __STATIC_INLINE static inline - -#elif defined ( __TMS470__ ) - #define __ASM __asm /*!< asm keyword for TI CCS Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __TASKING__ ) - #define __ASM __asm /*!< asm keyword for TASKING Compiler */ - #define __INLINE inline /*!< inline keyword for TASKING Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __CSMC__ ) - #define __packed - #define __ASM _asm /*!< asm keyword for COSMIC Compiler */ - #define __INLINE inline /*use -pc99 on compile line !< inline keyword for COSMIC Compiler */ - #define __STATIC_INLINE static inline - -#endif - -/** __FPU_USED indicates whether an FPU is used or not. - For this, __FPU_PRESENT has to be checked prior to making use of FPU specific registers and functions. -*/ -#if defined ( __CC_ARM ) - #if defined __TARGET_FPU_VFP - #if (__FPU_PRESENT == 1) - #define __FPU_USED 1 - #else - #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #define __FPU_USED 0 - #endif - #else - #define __FPU_USED 0 - #endif - -#elif defined ( __GNUC__ ) - #if defined (__VFP_FP__) && !defined(__SOFTFP__) - #if (__FPU_PRESENT == 1) - #define __FPU_USED 1 - #else - #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #define __FPU_USED 0 - #endif - #else - #define __FPU_USED 0 - #endif - -#elif defined ( __ICCARM__ ) - #if defined __ARMVFP__ - #if (__FPU_PRESENT == 1) - #define __FPU_USED 1 - #else - #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #define __FPU_USED 0 - #endif - #else - #define __FPU_USED 0 - #endif - -#elif defined ( __TMS470__ ) - #if defined __TI_VFP_SUPPORT__ - #if (__FPU_PRESENT == 1) - #define __FPU_USED 1 - #else - #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #define __FPU_USED 0 - #endif - #else - #define __FPU_USED 0 - #endif - -#elif defined ( __TASKING__ ) - #if defined __FPU_VFP__ - #if (__FPU_PRESENT == 1) - #define __FPU_USED 1 - #else - #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #define __FPU_USED 0 - #endif - #else - #define __FPU_USED 0 - #endif - -#elif defined ( __CSMC__ ) /* Cosmic */ - #if ( __CSMC__ & 0x400) // FPU present for parser - #if (__FPU_PRESENT == 1) - #define __FPU_USED 1 - #else - #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #define __FPU_USED 0 - #endif - #else - #define __FPU_USED 0 - #endif -#endif - -#include /* standard types definitions */ -#include /* Core Instruction Access */ -#include /* Core Function Access */ -#include /* Compiler specific SIMD Intrinsics */ - -#ifdef __cplusplus -} -#endif - -#endif /* __CORE_CM4_H_GENERIC */ - -#ifndef __CMSIS_GENERIC - -#ifndef __CORE_CM4_H_DEPENDANT -#define __CORE_CM4_H_DEPENDANT - -#ifdef __cplusplus - extern "C" { -#endif - -/* check device defines and use defaults */ -#if defined __CHECK_DEVICE_DEFINES - #ifndef __CM4_REV - #define __CM4_REV 0x0000 - #warning "__CM4_REV not defined in device header file; using default!" - #endif - - #ifndef __FPU_PRESENT - #define __FPU_PRESENT 0 - #warning "__FPU_PRESENT not defined in device header file; using default!" - #endif - - #ifndef __MPU_PRESENT - #define __MPU_PRESENT 0 - #warning "__MPU_PRESENT not defined in device header file; using default!" - #endif - - #ifndef __NVIC_PRIO_BITS - #define __NVIC_PRIO_BITS 4 - #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" - #endif - - #ifndef __Vendor_SysTickConfig - #define __Vendor_SysTickConfig 0 - #warning "__Vendor_SysTickConfig not defined in device header file; using default!" - #endif -#endif - -/* IO definitions (access restrictions to peripheral registers) */ -/** - \defgroup CMSIS_glob_defs CMSIS Global Defines - - IO Type Qualifiers are used - \li to specify the access to peripheral variables. - \li for automatic generation of peripheral register debug information. -*/ -#ifdef __cplusplus - #define __I volatile /*!< Defines 'read only' permissions */ -#else - #define __I volatile const /*!< Defines 'read only' permissions */ -#endif -#define __O volatile /*!< Defines 'write only' permissions */ -#define __IO volatile /*!< Defines 'read / write' permissions */ - -/*@} end of group Cortex_M4 */ - - - -/******************************************************************************* - * Register Abstraction - Core Register contain: - - Core Register - - Core NVIC Register - - Core SCB Register - - Core SysTick Register - - Core Debug Register - - Core MPU Register - - Core FPU Register - ******************************************************************************/ -/** \defgroup CMSIS_core_register Defines and Type Definitions - \brief Type definitions and defines for Cortex-M processor based devices. -*/ - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_CORE Status and Control Registers - \brief Core Register type definitions. - @{ - */ - -/** \brief Union type to access the Application Program Status Register (APSR). - */ -typedef union -{ - struct - { - uint32_t _reserved0:16; /*!< bit: 0..15 Reserved */ - uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */ - uint32_t _reserved1:7; /*!< bit: 20..26 Reserved */ - uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ - uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ - uint32_t C:1; /*!< bit: 29 Carry condition code flag */ - uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ - uint32_t N:1; /*!< bit: 31 Negative condition code flag */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} APSR_Type; - -/* APSR Register Definitions */ -#define APSR_N_Pos 31 /*!< APSR: N Position */ -#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ - -#define APSR_Z_Pos 30 /*!< APSR: Z Position */ -#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ - -#define APSR_C_Pos 29 /*!< APSR: C Position */ -#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ - -#define APSR_V_Pos 28 /*!< APSR: V Position */ -#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ - -#define APSR_Q_Pos 27 /*!< APSR: Q Position */ -#define APSR_Q_Msk (1UL << APSR_Q_Pos) /*!< APSR: Q Mask */ - -#define APSR_GE_Pos 16 /*!< APSR: GE Position */ -#define APSR_GE_Msk (0xFUL << APSR_GE_Pos) /*!< APSR: GE Mask */ - - -/** \brief Union type to access the Interrupt Program Status Register (IPSR). - */ -typedef union -{ - struct - { - uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ - uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} IPSR_Type; - -/* IPSR Register Definitions */ -#define IPSR_ISR_Pos 0 /*!< IPSR: ISR Position */ -#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ - - -/** \brief Union type to access the Special-Purpose Program Status Registers (xPSR). - */ -typedef union -{ - struct - { - uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ - uint32_t _reserved0:7; /*!< bit: 9..15 Reserved */ - uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */ - uint32_t _reserved1:4; /*!< bit: 20..23 Reserved */ - uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */ - uint32_t IT:2; /*!< bit: 25..26 saved IT state (read 0) */ - uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ - uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ - uint32_t C:1; /*!< bit: 29 Carry condition code flag */ - uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ - uint32_t N:1; /*!< bit: 31 Negative condition code flag */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} xPSR_Type; - -/* xPSR Register Definitions */ -#define xPSR_N_Pos 31 /*!< xPSR: N Position */ -#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ - -#define xPSR_Z_Pos 30 /*!< xPSR: Z Position */ -#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ - -#define xPSR_C_Pos 29 /*!< xPSR: C Position */ -#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ - -#define xPSR_V_Pos 28 /*!< xPSR: V Position */ -#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ - -#define xPSR_Q_Pos 27 /*!< xPSR: Q Position */ -#define xPSR_Q_Msk (1UL << xPSR_Q_Pos) /*!< xPSR: Q Mask */ - -#define xPSR_IT_Pos 25 /*!< xPSR: IT Position */ -#define xPSR_IT_Msk (3UL << xPSR_IT_Pos) /*!< xPSR: IT Mask */ - -#define xPSR_T_Pos 24 /*!< xPSR: T Position */ -#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ - -#define xPSR_GE_Pos 16 /*!< xPSR: GE Position */ -#define xPSR_GE_Msk (0xFUL << xPSR_GE_Pos) /*!< xPSR: GE Mask */ - -#define xPSR_ISR_Pos 0 /*!< xPSR: ISR Position */ -#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ - - -/** \brief Union type to access the Control Registers (CONTROL). - */ -typedef union -{ - struct - { - uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */ - uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */ - uint32_t FPCA:1; /*!< bit: 2 FP extension active flag */ - uint32_t _reserved0:29; /*!< bit: 3..31 Reserved */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} CONTROL_Type; - -/* CONTROL Register Definitions */ -#define CONTROL_FPCA_Pos 2 /*!< CONTROL: FPCA Position */ -#define CONTROL_FPCA_Msk (1UL << CONTROL_FPCA_Pos) /*!< CONTROL: FPCA Mask */ - -#define CONTROL_SPSEL_Pos 1 /*!< CONTROL: SPSEL Position */ -#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ - -#define CONTROL_nPRIV_Pos 0 /*!< CONTROL: nPRIV Position */ -#define CONTROL_nPRIV_Msk (1UL /*<< CONTROL_nPRIV_Pos*/) /*!< CONTROL: nPRIV Mask */ - -/*@} end of group CMSIS_CORE */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) - \brief Type definitions for the NVIC Registers - @{ - */ - -/** \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). - */ -typedef struct -{ - __IO uint32_t ISER[8]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ - uint32_t RESERVED0[24]; - __IO uint32_t ICER[8]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ - uint32_t RSERVED1[24]; - __IO uint32_t ISPR[8]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ - uint32_t RESERVED2[24]; - __IO uint32_t ICPR[8]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ - uint32_t RESERVED3[24]; - __IO uint32_t IABR[8]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */ - uint32_t RESERVED4[56]; - __IO uint8_t IP[240]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register (8Bit wide) */ - uint32_t RESERVED5[644]; - __O uint32_t STIR; /*!< Offset: 0xE00 ( /W) Software Trigger Interrupt Register */ -} NVIC_Type; - -/* Software Triggered Interrupt Register Definitions */ -#define NVIC_STIR_INTID_Pos 0 /*!< STIR: INTLINESNUM Position */ -#define NVIC_STIR_INTID_Msk (0x1FFUL /*<< NVIC_STIR_INTID_Pos*/) /*!< STIR: INTLINESNUM Mask */ - -/*@} end of group CMSIS_NVIC */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_SCB System Control Block (SCB) - \brief Type definitions for the System Control Block Registers - @{ - */ - -/** \brief Structure type to access the System Control Block (SCB). - */ -typedef struct -{ - __I uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ - __IO uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ - __IO uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */ - __IO uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ - __IO uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ - __IO uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ - __IO uint8_t SHP[12]; /*!< Offset: 0x018 (R/W) System Handlers Priority Registers (4-7, 8-11, 12-15) */ - __IO uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ - __IO uint32_t CFSR; /*!< Offset: 0x028 (R/W) Configurable Fault Status Register */ - __IO uint32_t HFSR; /*!< Offset: 0x02C (R/W) HardFault Status Register */ - __IO uint32_t DFSR; /*!< Offset: 0x030 (R/W) Debug Fault Status Register */ - __IO uint32_t MMFAR; /*!< Offset: 0x034 (R/W) MemManage Fault Address Register */ - __IO uint32_t BFAR; /*!< Offset: 0x038 (R/W) BusFault Address Register */ - __IO uint32_t AFSR; /*!< Offset: 0x03C (R/W) Auxiliary Fault Status Register */ - __I uint32_t PFR[2]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */ - __I uint32_t DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */ - __I uint32_t ADR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */ - __I uint32_t MMFR[4]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */ - __I uint32_t ISAR[5]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */ - uint32_t RESERVED0[5]; - __IO uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */ -} SCB_Type; - -/* SCB CPUID Register Definitions */ -#define SCB_CPUID_IMPLEMENTER_Pos 24 /*!< SCB CPUID: IMPLEMENTER Position */ -#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ - -#define SCB_CPUID_VARIANT_Pos 20 /*!< SCB CPUID: VARIANT Position */ -#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ - -#define SCB_CPUID_ARCHITECTURE_Pos 16 /*!< SCB CPUID: ARCHITECTURE Position */ -#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ - -#define SCB_CPUID_PARTNO_Pos 4 /*!< SCB CPUID: PARTNO Position */ -#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ - -#define SCB_CPUID_REVISION_Pos 0 /*!< SCB CPUID: REVISION Position */ -#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ - -/* SCB Interrupt Control State Register Definitions */ -#define SCB_ICSR_NMIPENDSET_Pos 31 /*!< SCB ICSR: NMIPENDSET Position */ -#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */ - -#define SCB_ICSR_PENDSVSET_Pos 28 /*!< SCB ICSR: PENDSVSET Position */ -#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ - -#define SCB_ICSR_PENDSVCLR_Pos 27 /*!< SCB ICSR: PENDSVCLR Position */ -#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ - -#define SCB_ICSR_PENDSTSET_Pos 26 /*!< SCB ICSR: PENDSTSET Position */ -#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ - -#define SCB_ICSR_PENDSTCLR_Pos 25 /*!< SCB ICSR: PENDSTCLR Position */ -#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ - -#define SCB_ICSR_ISRPREEMPT_Pos 23 /*!< SCB ICSR: ISRPREEMPT Position */ -#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ - -#define SCB_ICSR_ISRPENDING_Pos 22 /*!< SCB ICSR: ISRPENDING Position */ -#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ - -#define SCB_ICSR_VECTPENDING_Pos 12 /*!< SCB ICSR: VECTPENDING Position */ -#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ - -#define SCB_ICSR_RETTOBASE_Pos 11 /*!< SCB ICSR: RETTOBASE Position */ -#define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos) /*!< SCB ICSR: RETTOBASE Mask */ - -#define SCB_ICSR_VECTACTIVE_Pos 0 /*!< SCB ICSR: VECTACTIVE Position */ -#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ - -/* SCB Vector Table Offset Register Definitions */ -#define SCB_VTOR_TBLOFF_Pos 7 /*!< SCB VTOR: TBLOFF Position */ -#define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ - -/* SCB Application Interrupt and Reset Control Register Definitions */ -#define SCB_AIRCR_VECTKEY_Pos 16 /*!< SCB AIRCR: VECTKEY Position */ -#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ - -#define SCB_AIRCR_VECTKEYSTAT_Pos 16 /*!< SCB AIRCR: VECTKEYSTAT Position */ -#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ - -#define SCB_AIRCR_ENDIANESS_Pos 15 /*!< SCB AIRCR: ENDIANESS Position */ -#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ - -#define SCB_AIRCR_PRIGROUP_Pos 8 /*!< SCB AIRCR: PRIGROUP Position */ -#define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */ - -#define SCB_AIRCR_SYSRESETREQ_Pos 2 /*!< SCB AIRCR: SYSRESETREQ Position */ -#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ - -#define SCB_AIRCR_VECTCLRACTIVE_Pos 1 /*!< SCB AIRCR: VECTCLRACTIVE Position */ -#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ - -#define SCB_AIRCR_VECTRESET_Pos 0 /*!< SCB AIRCR: VECTRESET Position */ -#define SCB_AIRCR_VECTRESET_Msk (1UL /*<< SCB_AIRCR_VECTRESET_Pos*/) /*!< SCB AIRCR: VECTRESET Mask */ - -/* SCB System Control Register Definitions */ -#define SCB_SCR_SEVONPEND_Pos 4 /*!< SCB SCR: SEVONPEND Position */ -#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ - -#define SCB_SCR_SLEEPDEEP_Pos 2 /*!< SCB SCR: SLEEPDEEP Position */ -#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ - -#define SCB_SCR_SLEEPONEXIT_Pos 1 /*!< SCB SCR: SLEEPONEXIT Position */ -#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ - -/* SCB Configuration Control Register Definitions */ -#define SCB_CCR_STKALIGN_Pos 9 /*!< SCB CCR: STKALIGN Position */ -#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */ - -#define SCB_CCR_BFHFNMIGN_Pos 8 /*!< SCB CCR: BFHFNMIGN Position */ -#define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos) /*!< SCB CCR: BFHFNMIGN Mask */ - -#define SCB_CCR_DIV_0_TRP_Pos 4 /*!< SCB CCR: DIV_0_TRP Position */ -#define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos) /*!< SCB CCR: DIV_0_TRP Mask */ - -#define SCB_CCR_UNALIGN_TRP_Pos 3 /*!< SCB CCR: UNALIGN_TRP Position */ -#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ - -#define SCB_CCR_USERSETMPEND_Pos 1 /*!< SCB CCR: USERSETMPEND Position */ -#define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos) /*!< SCB CCR: USERSETMPEND Mask */ - -#define SCB_CCR_NONBASETHRDENA_Pos 0 /*!< SCB CCR: NONBASETHRDENA Position */ -#define SCB_CCR_NONBASETHRDENA_Msk (1UL /*<< SCB_CCR_NONBASETHRDENA_Pos*/) /*!< SCB CCR: NONBASETHRDENA Mask */ - -/* SCB System Handler Control and State Register Definitions */ -#define SCB_SHCSR_USGFAULTENA_Pos 18 /*!< SCB SHCSR: USGFAULTENA Position */ -#define SCB_SHCSR_USGFAULTENA_Msk (1UL << SCB_SHCSR_USGFAULTENA_Pos) /*!< SCB SHCSR: USGFAULTENA Mask */ - -#define SCB_SHCSR_BUSFAULTENA_Pos 17 /*!< SCB SHCSR: BUSFAULTENA Position */ -#define SCB_SHCSR_BUSFAULTENA_Msk (1UL << SCB_SHCSR_BUSFAULTENA_Pos) /*!< SCB SHCSR: BUSFAULTENA Mask */ - -#define SCB_SHCSR_MEMFAULTENA_Pos 16 /*!< SCB SHCSR: MEMFAULTENA Position */ -#define SCB_SHCSR_MEMFAULTENA_Msk (1UL << SCB_SHCSR_MEMFAULTENA_Pos) /*!< SCB SHCSR: MEMFAULTENA Mask */ - -#define SCB_SHCSR_SVCALLPENDED_Pos 15 /*!< SCB SHCSR: SVCALLPENDED Position */ -#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ - -#define SCB_SHCSR_BUSFAULTPENDED_Pos 14 /*!< SCB SHCSR: BUSFAULTPENDED Position */ -#define SCB_SHCSR_BUSFAULTPENDED_Msk (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos) /*!< SCB SHCSR: BUSFAULTPENDED Mask */ - -#define SCB_SHCSR_MEMFAULTPENDED_Pos 13 /*!< SCB SHCSR: MEMFAULTPENDED Position */ -#define SCB_SHCSR_MEMFAULTPENDED_Msk (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos) /*!< SCB SHCSR: MEMFAULTPENDED Mask */ - -#define SCB_SHCSR_USGFAULTPENDED_Pos 12 /*!< SCB SHCSR: USGFAULTPENDED Position */ -#define SCB_SHCSR_USGFAULTPENDED_Msk (1UL << SCB_SHCSR_USGFAULTPENDED_Pos) /*!< SCB SHCSR: USGFAULTPENDED Mask */ - -#define SCB_SHCSR_SYSTICKACT_Pos 11 /*!< SCB SHCSR: SYSTICKACT Position */ -#define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos) /*!< SCB SHCSR: SYSTICKACT Mask */ - -#define SCB_SHCSR_PENDSVACT_Pos 10 /*!< SCB SHCSR: PENDSVACT Position */ -#define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos) /*!< SCB SHCSR: PENDSVACT Mask */ - -#define SCB_SHCSR_MONITORACT_Pos 8 /*!< SCB SHCSR: MONITORACT Position */ -#define SCB_SHCSR_MONITORACT_Msk (1UL << SCB_SHCSR_MONITORACT_Pos) /*!< SCB SHCSR: MONITORACT Mask */ - -#define SCB_SHCSR_SVCALLACT_Pos 7 /*!< SCB SHCSR: SVCALLACT Position */ -#define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos) /*!< SCB SHCSR: SVCALLACT Mask */ - -#define SCB_SHCSR_USGFAULTACT_Pos 3 /*!< SCB SHCSR: USGFAULTACT Position */ -#define SCB_SHCSR_USGFAULTACT_Msk (1UL << SCB_SHCSR_USGFAULTACT_Pos) /*!< SCB SHCSR: USGFAULTACT Mask */ - -#define SCB_SHCSR_BUSFAULTACT_Pos 1 /*!< SCB SHCSR: BUSFAULTACT Position */ -#define SCB_SHCSR_BUSFAULTACT_Msk (1UL << SCB_SHCSR_BUSFAULTACT_Pos) /*!< SCB SHCSR: BUSFAULTACT Mask */ - -#define SCB_SHCSR_MEMFAULTACT_Pos 0 /*!< SCB SHCSR: MEMFAULTACT Position */ -#define SCB_SHCSR_MEMFAULTACT_Msk (1UL /*<< SCB_SHCSR_MEMFAULTACT_Pos*/) /*!< SCB SHCSR: MEMFAULTACT Mask */ - -/* SCB Configurable Fault Status Registers Definitions */ -#define SCB_CFSR_USGFAULTSR_Pos 16 /*!< SCB CFSR: Usage Fault Status Register Position */ -#define SCB_CFSR_USGFAULTSR_Msk (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos) /*!< SCB CFSR: Usage Fault Status Register Mask */ - -#define SCB_CFSR_BUSFAULTSR_Pos 8 /*!< SCB CFSR: Bus Fault Status Register Position */ -#define SCB_CFSR_BUSFAULTSR_Msk (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos) /*!< SCB CFSR: Bus Fault Status Register Mask */ - -#define SCB_CFSR_MEMFAULTSR_Pos 0 /*!< SCB CFSR: Memory Manage Fault Status Register Position */ -#define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */ - -/* SCB Hard Fault Status Registers Definitions */ -#define SCB_HFSR_DEBUGEVT_Pos 31 /*!< SCB HFSR: DEBUGEVT Position */ -#define SCB_HFSR_DEBUGEVT_Msk (1UL << SCB_HFSR_DEBUGEVT_Pos) /*!< SCB HFSR: DEBUGEVT Mask */ - -#define SCB_HFSR_FORCED_Pos 30 /*!< SCB HFSR: FORCED Position */ -#define SCB_HFSR_FORCED_Msk (1UL << SCB_HFSR_FORCED_Pos) /*!< SCB HFSR: FORCED Mask */ - -#define SCB_HFSR_VECTTBL_Pos 1 /*!< SCB HFSR: VECTTBL Position */ -#define SCB_HFSR_VECTTBL_Msk (1UL << SCB_HFSR_VECTTBL_Pos) /*!< SCB HFSR: VECTTBL Mask */ - -/* SCB Debug Fault Status Register Definitions */ -#define SCB_DFSR_EXTERNAL_Pos 4 /*!< SCB DFSR: EXTERNAL Position */ -#define SCB_DFSR_EXTERNAL_Msk (1UL << SCB_DFSR_EXTERNAL_Pos) /*!< SCB DFSR: EXTERNAL Mask */ - -#define SCB_DFSR_VCATCH_Pos 3 /*!< SCB DFSR: VCATCH Position */ -#define SCB_DFSR_VCATCH_Msk (1UL << SCB_DFSR_VCATCH_Pos) /*!< SCB DFSR: VCATCH Mask */ - -#define SCB_DFSR_DWTTRAP_Pos 2 /*!< SCB DFSR: DWTTRAP Position */ -#define SCB_DFSR_DWTTRAP_Msk (1UL << SCB_DFSR_DWTTRAP_Pos) /*!< SCB DFSR: DWTTRAP Mask */ - -#define SCB_DFSR_BKPT_Pos 1 /*!< SCB DFSR: BKPT Position */ -#define SCB_DFSR_BKPT_Msk (1UL << SCB_DFSR_BKPT_Pos) /*!< SCB DFSR: BKPT Mask */ - -#define SCB_DFSR_HALTED_Pos 0 /*!< SCB DFSR: HALTED Position */ -#define SCB_DFSR_HALTED_Msk (1UL /*<< SCB_DFSR_HALTED_Pos*/) /*!< SCB DFSR: HALTED Mask */ - -/*@} end of group CMSIS_SCB */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB) - \brief Type definitions for the System Control and ID Register not in the SCB - @{ - */ - -/** \brief Structure type to access the System Control and ID Register not in the SCB. - */ -typedef struct -{ - uint32_t RESERVED0[1]; - __I uint32_t ICTR; /*!< Offset: 0x004 (R/ ) Interrupt Controller Type Register */ - __IO uint32_t ACTLR; /*!< Offset: 0x008 (R/W) Auxiliary Control Register */ -} SCnSCB_Type; - -/* Interrupt Controller Type Register Definitions */ -#define SCnSCB_ICTR_INTLINESNUM_Pos 0 /*!< ICTR: INTLINESNUM Position */ -#define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL /*<< SCnSCB_ICTR_INTLINESNUM_Pos*/) /*!< ICTR: INTLINESNUM Mask */ - -/* Auxiliary Control Register Definitions */ -#define SCnSCB_ACTLR_DISOOFP_Pos 9 /*!< ACTLR: DISOOFP Position */ -#define SCnSCB_ACTLR_DISOOFP_Msk (1UL << SCnSCB_ACTLR_DISOOFP_Pos) /*!< ACTLR: DISOOFP Mask */ - -#define SCnSCB_ACTLR_DISFPCA_Pos 8 /*!< ACTLR: DISFPCA Position */ -#define SCnSCB_ACTLR_DISFPCA_Msk (1UL << SCnSCB_ACTLR_DISFPCA_Pos) /*!< ACTLR: DISFPCA Mask */ - -#define SCnSCB_ACTLR_DISFOLD_Pos 2 /*!< ACTLR: DISFOLD Position */ -#define SCnSCB_ACTLR_DISFOLD_Msk (1UL << SCnSCB_ACTLR_DISFOLD_Pos) /*!< ACTLR: DISFOLD Mask */ - -#define SCnSCB_ACTLR_DISDEFWBUF_Pos 1 /*!< ACTLR: DISDEFWBUF Position */ -#define SCnSCB_ACTLR_DISDEFWBUF_Msk (1UL << SCnSCB_ACTLR_DISDEFWBUF_Pos) /*!< ACTLR: DISDEFWBUF Mask */ - -#define SCnSCB_ACTLR_DISMCYCINT_Pos 0 /*!< ACTLR: DISMCYCINT Position */ -#define SCnSCB_ACTLR_DISMCYCINT_Msk (1UL /*<< SCnSCB_ACTLR_DISMCYCINT_Pos*/) /*!< ACTLR: DISMCYCINT Mask */ - -/*@} end of group CMSIS_SCnotSCB */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_SysTick System Tick Timer (SysTick) - \brief Type definitions for the System Timer Registers. - @{ - */ - -/** \brief Structure type to access the System Timer (SysTick). - */ -typedef struct -{ - __IO uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ - __IO uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ - __IO uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ - __I uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ -} SysTick_Type; - -/* SysTick Control / Status Register Definitions */ -#define SysTick_CTRL_COUNTFLAG_Pos 16 /*!< SysTick CTRL: COUNTFLAG Position */ -#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ - -#define SysTick_CTRL_CLKSOURCE_Pos 2 /*!< SysTick CTRL: CLKSOURCE Position */ -#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ - -#define SysTick_CTRL_TICKINT_Pos 1 /*!< SysTick CTRL: TICKINT Position */ -#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ - -#define SysTick_CTRL_ENABLE_Pos 0 /*!< SysTick CTRL: ENABLE Position */ -#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ - -/* SysTick Reload Register Definitions */ -#define SysTick_LOAD_RELOAD_Pos 0 /*!< SysTick LOAD: RELOAD Position */ -#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ - -/* SysTick Current Register Definitions */ -#define SysTick_VAL_CURRENT_Pos 0 /*!< SysTick VAL: CURRENT Position */ -#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ - -/* SysTick Calibration Register Definitions */ -#define SysTick_CALIB_NOREF_Pos 31 /*!< SysTick CALIB: NOREF Position */ -#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ - -#define SysTick_CALIB_SKEW_Pos 30 /*!< SysTick CALIB: SKEW Position */ -#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ - -#define SysTick_CALIB_TENMS_Pos 0 /*!< SysTick CALIB: TENMS Position */ -#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ - -/*@} end of group CMSIS_SysTick */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_ITM Instrumentation Trace Macrocell (ITM) - \brief Type definitions for the Instrumentation Trace Macrocell (ITM) - @{ - */ - -/** \brief Structure type to access the Instrumentation Trace Macrocell Register (ITM). - */ -typedef struct -{ - __O union - { - __O uint8_t u8; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 8-bit */ - __O uint16_t u16; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 16-bit */ - __O uint32_t u32; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 32-bit */ - } PORT [32]; /*!< Offset: 0x000 ( /W) ITM Stimulus Port Registers */ - uint32_t RESERVED0[864]; - __IO uint32_t TER; /*!< Offset: 0xE00 (R/W) ITM Trace Enable Register */ - uint32_t RESERVED1[15]; - __IO uint32_t TPR; /*!< Offset: 0xE40 (R/W) ITM Trace Privilege Register */ - uint32_t RESERVED2[15]; - __IO uint32_t TCR; /*!< Offset: 0xE80 (R/W) ITM Trace Control Register */ - uint32_t RESERVED3[29]; - __O uint32_t IWR; /*!< Offset: 0xEF8 ( /W) ITM Integration Write Register */ - __I uint32_t IRR; /*!< Offset: 0xEFC (R/ ) ITM Integration Read Register */ - __IO uint32_t IMCR; /*!< Offset: 0xF00 (R/W) ITM Integration Mode Control Register */ - uint32_t RESERVED4[43]; - __O uint32_t LAR; /*!< Offset: 0xFB0 ( /W) ITM Lock Access Register */ - __I uint32_t LSR; /*!< Offset: 0xFB4 (R/ ) ITM Lock Status Register */ - uint32_t RESERVED5[6]; - __I uint32_t PID4; /*!< Offset: 0xFD0 (R/ ) ITM Peripheral Identification Register #4 */ - __I uint32_t PID5; /*!< Offset: 0xFD4 (R/ ) ITM Peripheral Identification Register #5 */ - __I uint32_t PID6; /*!< Offset: 0xFD8 (R/ ) ITM Peripheral Identification Register #6 */ - __I uint32_t PID7; /*!< Offset: 0xFDC (R/ ) ITM Peripheral Identification Register #7 */ - __I uint32_t PID0; /*!< Offset: 0xFE0 (R/ ) ITM Peripheral Identification Register #0 */ - __I uint32_t PID1; /*!< Offset: 0xFE4 (R/ ) ITM Peripheral Identification Register #1 */ - __I uint32_t PID2; /*!< Offset: 0xFE8 (R/ ) ITM Peripheral Identification Register #2 */ - __I uint32_t PID3; /*!< Offset: 0xFEC (R/ ) ITM Peripheral Identification Register #3 */ - __I uint32_t CID0; /*!< Offset: 0xFF0 (R/ ) ITM Component Identification Register #0 */ - __I uint32_t CID1; /*!< Offset: 0xFF4 (R/ ) ITM Component Identification Register #1 */ - __I uint32_t CID2; /*!< Offset: 0xFF8 (R/ ) ITM Component Identification Register #2 */ - __I uint32_t CID3; /*!< Offset: 0xFFC (R/ ) ITM Component Identification Register #3 */ -} ITM_Type; - -/* ITM Trace Privilege Register Definitions */ -#define ITM_TPR_PRIVMASK_Pos 0 /*!< ITM TPR: PRIVMASK Position */ -#define ITM_TPR_PRIVMASK_Msk (0xFUL /*<< ITM_TPR_PRIVMASK_Pos*/) /*!< ITM TPR: PRIVMASK Mask */ - -/* ITM Trace Control Register Definitions */ -#define ITM_TCR_BUSY_Pos 23 /*!< ITM TCR: BUSY Position */ -#define ITM_TCR_BUSY_Msk (1UL << ITM_TCR_BUSY_Pos) /*!< ITM TCR: BUSY Mask */ - -#define ITM_TCR_TraceBusID_Pos 16 /*!< ITM TCR: ATBID Position */ -#define ITM_TCR_TraceBusID_Msk (0x7FUL << ITM_TCR_TraceBusID_Pos) /*!< ITM TCR: ATBID Mask */ - -#define ITM_TCR_GTSFREQ_Pos 10 /*!< ITM TCR: Global timestamp frequency Position */ -#define ITM_TCR_GTSFREQ_Msk (3UL << ITM_TCR_GTSFREQ_Pos) /*!< ITM TCR: Global timestamp frequency Mask */ - -#define ITM_TCR_TSPrescale_Pos 8 /*!< ITM TCR: TSPrescale Position */ -#define ITM_TCR_TSPrescale_Msk (3UL << ITM_TCR_TSPrescale_Pos) /*!< ITM TCR: TSPrescale Mask */ - -#define ITM_TCR_SWOENA_Pos 4 /*!< ITM TCR: SWOENA Position */ -#define ITM_TCR_SWOENA_Msk (1UL << ITM_TCR_SWOENA_Pos) /*!< ITM TCR: SWOENA Mask */ - -#define ITM_TCR_DWTENA_Pos 3 /*!< ITM TCR: DWTENA Position */ -#define ITM_TCR_DWTENA_Msk (1UL << ITM_TCR_DWTENA_Pos) /*!< ITM TCR: DWTENA Mask */ - -#define ITM_TCR_SYNCENA_Pos 2 /*!< ITM TCR: SYNCENA Position */ -#define ITM_TCR_SYNCENA_Msk (1UL << ITM_TCR_SYNCENA_Pos) /*!< ITM TCR: SYNCENA Mask */ - -#define ITM_TCR_TSENA_Pos 1 /*!< ITM TCR: TSENA Position */ -#define ITM_TCR_TSENA_Msk (1UL << ITM_TCR_TSENA_Pos) /*!< ITM TCR: TSENA Mask */ - -#define ITM_TCR_ITMENA_Pos 0 /*!< ITM TCR: ITM Enable bit Position */ -#define ITM_TCR_ITMENA_Msk (1UL /*<< ITM_TCR_ITMENA_Pos*/) /*!< ITM TCR: ITM Enable bit Mask */ - -/* ITM Integration Write Register Definitions */ -#define ITM_IWR_ATVALIDM_Pos 0 /*!< ITM IWR: ATVALIDM Position */ -#define ITM_IWR_ATVALIDM_Msk (1UL /*<< ITM_IWR_ATVALIDM_Pos*/) /*!< ITM IWR: ATVALIDM Mask */ - -/* ITM Integration Read Register Definitions */ -#define ITM_IRR_ATREADYM_Pos 0 /*!< ITM IRR: ATREADYM Position */ -#define ITM_IRR_ATREADYM_Msk (1UL /*<< ITM_IRR_ATREADYM_Pos*/) /*!< ITM IRR: ATREADYM Mask */ - -/* ITM Integration Mode Control Register Definitions */ -#define ITM_IMCR_INTEGRATION_Pos 0 /*!< ITM IMCR: INTEGRATION Position */ -#define ITM_IMCR_INTEGRATION_Msk (1UL /*<< ITM_IMCR_INTEGRATION_Pos*/) /*!< ITM IMCR: INTEGRATION Mask */ - -/* ITM Lock Status Register Definitions */ -#define ITM_LSR_ByteAcc_Pos 2 /*!< ITM LSR: ByteAcc Position */ -#define ITM_LSR_ByteAcc_Msk (1UL << ITM_LSR_ByteAcc_Pos) /*!< ITM LSR: ByteAcc Mask */ - -#define ITM_LSR_Access_Pos 1 /*!< ITM LSR: Access Position */ -#define ITM_LSR_Access_Msk (1UL << ITM_LSR_Access_Pos) /*!< ITM LSR: Access Mask */ - -#define ITM_LSR_Present_Pos 0 /*!< ITM LSR: Present Position */ -#define ITM_LSR_Present_Msk (1UL /*<< ITM_LSR_Present_Pos*/) /*!< ITM LSR: Present Mask */ - -/*@}*/ /* end of group CMSIS_ITM */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_DWT Data Watchpoint and Trace (DWT) - \brief Type definitions for the Data Watchpoint and Trace (DWT) - @{ - */ - -/** \brief Structure type to access the Data Watchpoint and Trace Register (DWT). - */ -typedef struct -{ - __IO uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */ - __IO uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */ - __IO uint32_t CPICNT; /*!< Offset: 0x008 (R/W) CPI Count Register */ - __IO uint32_t EXCCNT; /*!< Offset: 0x00C (R/W) Exception Overhead Count Register */ - __IO uint32_t SLEEPCNT; /*!< Offset: 0x010 (R/W) Sleep Count Register */ - __IO uint32_t LSUCNT; /*!< Offset: 0x014 (R/W) LSU Count Register */ - __IO uint32_t FOLDCNT; /*!< Offset: 0x018 (R/W) Folded-instruction Count Register */ - __I uint32_t PCSR; /*!< Offset: 0x01C (R/ ) Program Counter Sample Register */ - __IO uint32_t COMP0; /*!< Offset: 0x020 (R/W) Comparator Register 0 */ - __IO uint32_t MASK0; /*!< Offset: 0x024 (R/W) Mask Register 0 */ - __IO uint32_t FUNCTION0; /*!< Offset: 0x028 (R/W) Function Register 0 */ - uint32_t RESERVED0[1]; - __IO uint32_t COMP1; /*!< Offset: 0x030 (R/W) Comparator Register 1 */ - __IO uint32_t MASK1; /*!< Offset: 0x034 (R/W) Mask Register 1 */ - __IO uint32_t FUNCTION1; /*!< Offset: 0x038 (R/W) Function Register 1 */ - uint32_t RESERVED1[1]; - __IO uint32_t COMP2; /*!< Offset: 0x040 (R/W) Comparator Register 2 */ - __IO uint32_t MASK2; /*!< Offset: 0x044 (R/W) Mask Register 2 */ - __IO uint32_t FUNCTION2; /*!< Offset: 0x048 (R/W) Function Register 2 */ - uint32_t RESERVED2[1]; - __IO uint32_t COMP3; /*!< Offset: 0x050 (R/W) Comparator Register 3 */ - __IO uint32_t MASK3; /*!< Offset: 0x054 (R/W) Mask Register 3 */ - __IO uint32_t FUNCTION3; /*!< Offset: 0x058 (R/W) Function Register 3 */ -} DWT_Type; - -/* DWT Control Register Definitions */ -#define DWT_CTRL_NUMCOMP_Pos 28 /*!< DWT CTRL: NUMCOMP Position */ -#define DWT_CTRL_NUMCOMP_Msk (0xFUL << DWT_CTRL_NUMCOMP_Pos) /*!< DWT CTRL: NUMCOMP Mask */ - -#define DWT_CTRL_NOTRCPKT_Pos 27 /*!< DWT CTRL: NOTRCPKT Position */ -#define DWT_CTRL_NOTRCPKT_Msk (0x1UL << DWT_CTRL_NOTRCPKT_Pos) /*!< DWT CTRL: NOTRCPKT Mask */ - -#define DWT_CTRL_NOEXTTRIG_Pos 26 /*!< DWT CTRL: NOEXTTRIG Position */ -#define DWT_CTRL_NOEXTTRIG_Msk (0x1UL << DWT_CTRL_NOEXTTRIG_Pos) /*!< DWT CTRL: NOEXTTRIG Mask */ - -#define DWT_CTRL_NOCYCCNT_Pos 25 /*!< DWT CTRL: NOCYCCNT Position */ -#define DWT_CTRL_NOCYCCNT_Msk (0x1UL << DWT_CTRL_NOCYCCNT_Pos) /*!< DWT CTRL: NOCYCCNT Mask */ - -#define DWT_CTRL_NOPRFCNT_Pos 24 /*!< DWT CTRL: NOPRFCNT Position */ -#define DWT_CTRL_NOPRFCNT_Msk (0x1UL << DWT_CTRL_NOPRFCNT_Pos) /*!< DWT CTRL: NOPRFCNT Mask */ - -#define DWT_CTRL_CYCEVTENA_Pos 22 /*!< DWT CTRL: CYCEVTENA Position */ -#define DWT_CTRL_CYCEVTENA_Msk (0x1UL << DWT_CTRL_CYCEVTENA_Pos) /*!< DWT CTRL: CYCEVTENA Mask */ - -#define DWT_CTRL_FOLDEVTENA_Pos 21 /*!< DWT CTRL: FOLDEVTENA Position */ -#define DWT_CTRL_FOLDEVTENA_Msk (0x1UL << DWT_CTRL_FOLDEVTENA_Pos) /*!< DWT CTRL: FOLDEVTENA Mask */ - -#define DWT_CTRL_LSUEVTENA_Pos 20 /*!< DWT CTRL: LSUEVTENA Position */ -#define DWT_CTRL_LSUEVTENA_Msk (0x1UL << DWT_CTRL_LSUEVTENA_Pos) /*!< DWT CTRL: LSUEVTENA Mask */ - -#define DWT_CTRL_SLEEPEVTENA_Pos 19 /*!< DWT CTRL: SLEEPEVTENA Position */ -#define DWT_CTRL_SLEEPEVTENA_Msk (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos) /*!< DWT CTRL: SLEEPEVTENA Mask */ - -#define DWT_CTRL_EXCEVTENA_Pos 18 /*!< DWT CTRL: EXCEVTENA Position */ -#define DWT_CTRL_EXCEVTENA_Msk (0x1UL << DWT_CTRL_EXCEVTENA_Pos) /*!< DWT CTRL: EXCEVTENA Mask */ - -#define DWT_CTRL_CPIEVTENA_Pos 17 /*!< DWT CTRL: CPIEVTENA Position */ -#define DWT_CTRL_CPIEVTENA_Msk (0x1UL << DWT_CTRL_CPIEVTENA_Pos) /*!< DWT CTRL: CPIEVTENA Mask */ - -#define DWT_CTRL_EXCTRCENA_Pos 16 /*!< DWT CTRL: EXCTRCENA Position */ -#define DWT_CTRL_EXCTRCENA_Msk (0x1UL << DWT_CTRL_EXCTRCENA_Pos) /*!< DWT CTRL: EXCTRCENA Mask */ - -#define DWT_CTRL_PCSAMPLENA_Pos 12 /*!< DWT CTRL: PCSAMPLENA Position */ -#define DWT_CTRL_PCSAMPLENA_Msk (0x1UL << DWT_CTRL_PCSAMPLENA_Pos) /*!< DWT CTRL: PCSAMPLENA Mask */ - -#define DWT_CTRL_SYNCTAP_Pos 10 /*!< DWT CTRL: SYNCTAP Position */ -#define DWT_CTRL_SYNCTAP_Msk (0x3UL << DWT_CTRL_SYNCTAP_Pos) /*!< DWT CTRL: SYNCTAP Mask */ - -#define DWT_CTRL_CYCTAP_Pos 9 /*!< DWT CTRL: CYCTAP Position */ -#define DWT_CTRL_CYCTAP_Msk (0x1UL << DWT_CTRL_CYCTAP_Pos) /*!< DWT CTRL: CYCTAP Mask */ - -#define DWT_CTRL_POSTINIT_Pos 5 /*!< DWT CTRL: POSTINIT Position */ -#define DWT_CTRL_POSTINIT_Msk (0xFUL << DWT_CTRL_POSTINIT_Pos) /*!< DWT CTRL: POSTINIT Mask */ - -#define DWT_CTRL_POSTPRESET_Pos 1 /*!< DWT CTRL: POSTPRESET Position */ -#define DWT_CTRL_POSTPRESET_Msk (0xFUL << DWT_CTRL_POSTPRESET_Pos) /*!< DWT CTRL: POSTPRESET Mask */ - -#define DWT_CTRL_CYCCNTENA_Pos 0 /*!< DWT CTRL: CYCCNTENA Position */ -#define DWT_CTRL_CYCCNTENA_Msk (0x1UL /*<< DWT_CTRL_CYCCNTENA_Pos*/) /*!< DWT CTRL: CYCCNTENA Mask */ - -/* DWT CPI Count Register Definitions */ -#define DWT_CPICNT_CPICNT_Pos 0 /*!< DWT CPICNT: CPICNT Position */ -#define DWT_CPICNT_CPICNT_Msk (0xFFUL /*<< DWT_CPICNT_CPICNT_Pos*/) /*!< DWT CPICNT: CPICNT Mask */ - -/* DWT Exception Overhead Count Register Definitions */ -#define DWT_EXCCNT_EXCCNT_Pos 0 /*!< DWT EXCCNT: EXCCNT Position */ -#define DWT_EXCCNT_EXCCNT_Msk (0xFFUL /*<< DWT_EXCCNT_EXCCNT_Pos*/) /*!< DWT EXCCNT: EXCCNT Mask */ - -/* DWT Sleep Count Register Definitions */ -#define DWT_SLEEPCNT_SLEEPCNT_Pos 0 /*!< DWT SLEEPCNT: SLEEPCNT Position */ -#define DWT_SLEEPCNT_SLEEPCNT_Msk (0xFFUL /*<< DWT_SLEEPCNT_SLEEPCNT_Pos*/) /*!< DWT SLEEPCNT: SLEEPCNT Mask */ - -/* DWT LSU Count Register Definitions */ -#define DWT_LSUCNT_LSUCNT_Pos 0 /*!< DWT LSUCNT: LSUCNT Position */ -#define DWT_LSUCNT_LSUCNT_Msk (0xFFUL /*<< DWT_LSUCNT_LSUCNT_Pos*/) /*!< DWT LSUCNT: LSUCNT Mask */ - -/* DWT Folded-instruction Count Register Definitions */ -#define DWT_FOLDCNT_FOLDCNT_Pos 0 /*!< DWT FOLDCNT: FOLDCNT Position */ -#define DWT_FOLDCNT_FOLDCNT_Msk (0xFFUL /*<< DWT_FOLDCNT_FOLDCNT_Pos*/) /*!< DWT FOLDCNT: FOLDCNT Mask */ - -/* DWT Comparator Mask Register Definitions */ -#define DWT_MASK_MASK_Pos 0 /*!< DWT MASK: MASK Position */ -#define DWT_MASK_MASK_Msk (0x1FUL /*<< DWT_MASK_MASK_Pos*/) /*!< DWT MASK: MASK Mask */ - -/* DWT Comparator Function Register Definitions */ -#define DWT_FUNCTION_MATCHED_Pos 24 /*!< DWT FUNCTION: MATCHED Position */ -#define DWT_FUNCTION_MATCHED_Msk (0x1UL << DWT_FUNCTION_MATCHED_Pos) /*!< DWT FUNCTION: MATCHED Mask */ - -#define DWT_FUNCTION_DATAVADDR1_Pos 16 /*!< DWT FUNCTION: DATAVADDR1 Position */ -#define DWT_FUNCTION_DATAVADDR1_Msk (0xFUL << DWT_FUNCTION_DATAVADDR1_Pos) /*!< DWT FUNCTION: DATAVADDR1 Mask */ - -#define DWT_FUNCTION_DATAVADDR0_Pos 12 /*!< DWT FUNCTION: DATAVADDR0 Position */ -#define DWT_FUNCTION_DATAVADDR0_Msk (0xFUL << DWT_FUNCTION_DATAVADDR0_Pos) /*!< DWT FUNCTION: DATAVADDR0 Mask */ - -#define DWT_FUNCTION_DATAVSIZE_Pos 10 /*!< DWT FUNCTION: DATAVSIZE Position */ -#define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos) /*!< DWT FUNCTION: DATAVSIZE Mask */ - -#define DWT_FUNCTION_LNK1ENA_Pos 9 /*!< DWT FUNCTION: LNK1ENA Position */ -#define DWT_FUNCTION_LNK1ENA_Msk (0x1UL << DWT_FUNCTION_LNK1ENA_Pos) /*!< DWT FUNCTION: LNK1ENA Mask */ - -#define DWT_FUNCTION_DATAVMATCH_Pos 8 /*!< DWT FUNCTION: DATAVMATCH Position */ -#define DWT_FUNCTION_DATAVMATCH_Msk (0x1UL << DWT_FUNCTION_DATAVMATCH_Pos) /*!< DWT FUNCTION: DATAVMATCH Mask */ - -#define DWT_FUNCTION_CYCMATCH_Pos 7 /*!< DWT FUNCTION: CYCMATCH Position */ -#define DWT_FUNCTION_CYCMATCH_Msk (0x1UL << DWT_FUNCTION_CYCMATCH_Pos) /*!< DWT FUNCTION: CYCMATCH Mask */ - -#define DWT_FUNCTION_EMITRANGE_Pos 5 /*!< DWT FUNCTION: EMITRANGE Position */ -#define DWT_FUNCTION_EMITRANGE_Msk (0x1UL << DWT_FUNCTION_EMITRANGE_Pos) /*!< DWT FUNCTION: EMITRANGE Mask */ - -#define DWT_FUNCTION_FUNCTION_Pos 0 /*!< DWT FUNCTION: FUNCTION Position */ -#define DWT_FUNCTION_FUNCTION_Msk (0xFUL /*<< DWT_FUNCTION_FUNCTION_Pos*/) /*!< DWT FUNCTION: FUNCTION Mask */ - -/*@}*/ /* end of group CMSIS_DWT */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_TPI Trace Port Interface (TPI) - \brief Type definitions for the Trace Port Interface (TPI) - @{ - */ - -/** \brief Structure type to access the Trace Port Interface Register (TPI). - */ -typedef struct -{ - __IO uint32_t SSPSR; /*!< Offset: 0x000 (R/ ) Supported Parallel Port Size Register */ - __IO uint32_t CSPSR; /*!< Offset: 0x004 (R/W) Current Parallel Port Size Register */ - uint32_t RESERVED0[2]; - __IO uint32_t ACPR; /*!< Offset: 0x010 (R/W) Asynchronous Clock Prescaler Register */ - uint32_t RESERVED1[55]; - __IO uint32_t SPPR; /*!< Offset: 0x0F0 (R/W) Selected Pin Protocol Register */ - uint32_t RESERVED2[131]; - __I uint32_t FFSR; /*!< Offset: 0x300 (R/ ) Formatter and Flush Status Register */ - __IO uint32_t FFCR; /*!< Offset: 0x304 (R/W) Formatter and Flush Control Register */ - __I uint32_t FSCR; /*!< Offset: 0x308 (R/ ) Formatter Synchronization Counter Register */ - uint32_t RESERVED3[759]; - __I uint32_t TRIGGER; /*!< Offset: 0xEE8 (R/ ) TRIGGER */ - __I uint32_t FIFO0; /*!< Offset: 0xEEC (R/ ) Integration ETM Data */ - __I uint32_t ITATBCTR2; /*!< Offset: 0xEF0 (R/ ) ITATBCTR2 */ - uint32_t RESERVED4[1]; - __I uint32_t ITATBCTR0; /*!< Offset: 0xEF8 (R/ ) ITATBCTR0 */ - __I uint32_t FIFO1; /*!< Offset: 0xEFC (R/ ) Integration ITM Data */ - __IO uint32_t ITCTRL; /*!< Offset: 0xF00 (R/W) Integration Mode Control */ - uint32_t RESERVED5[39]; - __IO uint32_t CLAIMSET; /*!< Offset: 0xFA0 (R/W) Claim tag set */ - __IO uint32_t CLAIMCLR; /*!< Offset: 0xFA4 (R/W) Claim tag clear */ - uint32_t RESERVED7[8]; - __I uint32_t DEVID; /*!< Offset: 0xFC8 (R/ ) TPIU_DEVID */ - __I uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) TPIU_DEVTYPE */ -} TPI_Type; - -/* TPI Asynchronous Clock Prescaler Register Definitions */ -#define TPI_ACPR_PRESCALER_Pos 0 /*!< TPI ACPR: PRESCALER Position */ -#define TPI_ACPR_PRESCALER_Msk (0x1FFFUL /*<< TPI_ACPR_PRESCALER_Pos*/) /*!< TPI ACPR: PRESCALER Mask */ - -/* TPI Selected Pin Protocol Register Definitions */ -#define TPI_SPPR_TXMODE_Pos 0 /*!< TPI SPPR: TXMODE Position */ -#define TPI_SPPR_TXMODE_Msk (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/) /*!< TPI SPPR: TXMODE Mask */ - -/* TPI Formatter and Flush Status Register Definitions */ -#define TPI_FFSR_FtNonStop_Pos 3 /*!< TPI FFSR: FtNonStop Position */ -#define TPI_FFSR_FtNonStop_Msk (0x1UL << TPI_FFSR_FtNonStop_Pos) /*!< TPI FFSR: FtNonStop Mask */ - -#define TPI_FFSR_TCPresent_Pos 2 /*!< TPI FFSR: TCPresent Position */ -#define TPI_FFSR_TCPresent_Msk (0x1UL << TPI_FFSR_TCPresent_Pos) /*!< TPI FFSR: TCPresent Mask */ - -#define TPI_FFSR_FtStopped_Pos 1 /*!< TPI FFSR: FtStopped Position */ -#define TPI_FFSR_FtStopped_Msk (0x1UL << TPI_FFSR_FtStopped_Pos) /*!< TPI FFSR: FtStopped Mask */ - -#define TPI_FFSR_FlInProg_Pos 0 /*!< TPI FFSR: FlInProg Position */ -#define TPI_FFSR_FlInProg_Msk (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/) /*!< TPI FFSR: FlInProg Mask */ - -/* TPI Formatter and Flush Control Register Definitions */ -#define TPI_FFCR_TrigIn_Pos 8 /*!< TPI FFCR: TrigIn Position */ -#define TPI_FFCR_TrigIn_Msk (0x1UL << TPI_FFCR_TrigIn_Pos) /*!< TPI FFCR: TrigIn Mask */ - -#define TPI_FFCR_EnFCont_Pos 1 /*!< TPI FFCR: EnFCont Position */ -#define TPI_FFCR_EnFCont_Msk (0x1UL << TPI_FFCR_EnFCont_Pos) /*!< TPI FFCR: EnFCont Mask */ - -/* TPI TRIGGER Register Definitions */ -#define TPI_TRIGGER_TRIGGER_Pos 0 /*!< TPI TRIGGER: TRIGGER Position */ -#define TPI_TRIGGER_TRIGGER_Msk (0x1UL /*<< TPI_TRIGGER_TRIGGER_Pos*/) /*!< TPI TRIGGER: TRIGGER Mask */ - -/* TPI Integration ETM Data Register Definitions (FIFO0) */ -#define TPI_FIFO0_ITM_ATVALID_Pos 29 /*!< TPI FIFO0: ITM_ATVALID Position */ -#define TPI_FIFO0_ITM_ATVALID_Msk (0x3UL << TPI_FIFO0_ITM_ATVALID_Pos) /*!< TPI FIFO0: ITM_ATVALID Mask */ - -#define TPI_FIFO0_ITM_bytecount_Pos 27 /*!< TPI FIFO0: ITM_bytecount Position */ -#define TPI_FIFO0_ITM_bytecount_Msk (0x3UL << TPI_FIFO0_ITM_bytecount_Pos) /*!< TPI FIFO0: ITM_bytecount Mask */ - -#define TPI_FIFO0_ETM_ATVALID_Pos 26 /*!< TPI FIFO0: ETM_ATVALID Position */ -#define TPI_FIFO0_ETM_ATVALID_Msk (0x3UL << TPI_FIFO0_ETM_ATVALID_Pos) /*!< TPI FIFO0: ETM_ATVALID Mask */ - -#define TPI_FIFO0_ETM_bytecount_Pos 24 /*!< TPI FIFO0: ETM_bytecount Position */ -#define TPI_FIFO0_ETM_bytecount_Msk (0x3UL << TPI_FIFO0_ETM_bytecount_Pos) /*!< TPI FIFO0: ETM_bytecount Mask */ - -#define TPI_FIFO0_ETM2_Pos 16 /*!< TPI FIFO0: ETM2 Position */ -#define TPI_FIFO0_ETM2_Msk (0xFFUL << TPI_FIFO0_ETM2_Pos) /*!< TPI FIFO0: ETM2 Mask */ - -#define TPI_FIFO0_ETM1_Pos 8 /*!< TPI FIFO0: ETM1 Position */ -#define TPI_FIFO0_ETM1_Msk (0xFFUL << TPI_FIFO0_ETM1_Pos) /*!< TPI FIFO0: ETM1 Mask */ - -#define TPI_FIFO0_ETM0_Pos 0 /*!< TPI FIFO0: ETM0 Position */ -#define TPI_FIFO0_ETM0_Msk (0xFFUL /*<< TPI_FIFO0_ETM0_Pos*/) /*!< TPI FIFO0: ETM0 Mask */ - -/* TPI ITATBCTR2 Register Definitions */ -#define TPI_ITATBCTR2_ATREADY_Pos 0 /*!< TPI ITATBCTR2: ATREADY Position */ -#define TPI_ITATBCTR2_ATREADY_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY_Pos*/) /*!< TPI ITATBCTR2: ATREADY Mask */ - -/* TPI Integration ITM Data Register Definitions (FIFO1) */ -#define TPI_FIFO1_ITM_ATVALID_Pos 29 /*!< TPI FIFO1: ITM_ATVALID Position */ -#define TPI_FIFO1_ITM_ATVALID_Msk (0x3UL << TPI_FIFO1_ITM_ATVALID_Pos) /*!< TPI FIFO1: ITM_ATVALID Mask */ - -#define TPI_FIFO1_ITM_bytecount_Pos 27 /*!< TPI FIFO1: ITM_bytecount Position */ -#define TPI_FIFO1_ITM_bytecount_Msk (0x3UL << TPI_FIFO1_ITM_bytecount_Pos) /*!< TPI FIFO1: ITM_bytecount Mask */ - -#define TPI_FIFO1_ETM_ATVALID_Pos 26 /*!< TPI FIFO1: ETM_ATVALID Position */ -#define TPI_FIFO1_ETM_ATVALID_Msk (0x3UL << TPI_FIFO1_ETM_ATVALID_Pos) /*!< TPI FIFO1: ETM_ATVALID Mask */ - -#define TPI_FIFO1_ETM_bytecount_Pos 24 /*!< TPI FIFO1: ETM_bytecount Position */ -#define TPI_FIFO1_ETM_bytecount_Msk (0x3UL << TPI_FIFO1_ETM_bytecount_Pos) /*!< TPI FIFO1: ETM_bytecount Mask */ - -#define TPI_FIFO1_ITM2_Pos 16 /*!< TPI FIFO1: ITM2 Position */ -#define TPI_FIFO1_ITM2_Msk (0xFFUL << TPI_FIFO1_ITM2_Pos) /*!< TPI FIFO1: ITM2 Mask */ - -#define TPI_FIFO1_ITM1_Pos 8 /*!< TPI FIFO1: ITM1 Position */ -#define TPI_FIFO1_ITM1_Msk (0xFFUL << TPI_FIFO1_ITM1_Pos) /*!< TPI FIFO1: ITM1 Mask */ - -#define TPI_FIFO1_ITM0_Pos 0 /*!< TPI FIFO1: ITM0 Position */ -#define TPI_FIFO1_ITM0_Msk (0xFFUL /*<< TPI_FIFO1_ITM0_Pos*/) /*!< TPI FIFO1: ITM0 Mask */ - -/* TPI ITATBCTR0 Register Definitions */ -#define TPI_ITATBCTR0_ATREADY_Pos 0 /*!< TPI ITATBCTR0: ATREADY Position */ -#define TPI_ITATBCTR0_ATREADY_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY_Pos*/) /*!< TPI ITATBCTR0: ATREADY Mask */ - -/* TPI Integration Mode Control Register Definitions */ -#define TPI_ITCTRL_Mode_Pos 0 /*!< TPI ITCTRL: Mode Position */ -#define TPI_ITCTRL_Mode_Msk (0x1UL /*<< TPI_ITCTRL_Mode_Pos*/) /*!< TPI ITCTRL: Mode Mask */ - -/* TPI DEVID Register Definitions */ -#define TPI_DEVID_NRZVALID_Pos 11 /*!< TPI DEVID: NRZVALID Position */ -#define TPI_DEVID_NRZVALID_Msk (0x1UL << TPI_DEVID_NRZVALID_Pos) /*!< TPI DEVID: NRZVALID Mask */ - -#define TPI_DEVID_MANCVALID_Pos 10 /*!< TPI DEVID: MANCVALID Position */ -#define TPI_DEVID_MANCVALID_Msk (0x1UL << TPI_DEVID_MANCVALID_Pos) /*!< TPI DEVID: MANCVALID Mask */ - -#define TPI_DEVID_PTINVALID_Pos 9 /*!< TPI DEVID: PTINVALID Position */ -#define TPI_DEVID_PTINVALID_Msk (0x1UL << TPI_DEVID_PTINVALID_Pos) /*!< TPI DEVID: PTINVALID Mask */ - -#define TPI_DEVID_MinBufSz_Pos 6 /*!< TPI DEVID: MinBufSz Position */ -#define TPI_DEVID_MinBufSz_Msk (0x7UL << TPI_DEVID_MinBufSz_Pos) /*!< TPI DEVID: MinBufSz Mask */ - -#define TPI_DEVID_AsynClkIn_Pos 5 /*!< TPI DEVID: AsynClkIn Position */ -#define TPI_DEVID_AsynClkIn_Msk (0x1UL << TPI_DEVID_AsynClkIn_Pos) /*!< TPI DEVID: AsynClkIn Mask */ - -#define TPI_DEVID_NrTraceInput_Pos 0 /*!< TPI DEVID: NrTraceInput Position */ -#define TPI_DEVID_NrTraceInput_Msk (0x1FUL /*<< TPI_DEVID_NrTraceInput_Pos*/) /*!< TPI DEVID: NrTraceInput Mask */ - -/* TPI DEVTYPE Register Definitions */ -#define TPI_DEVTYPE_MajorType_Pos 4 /*!< TPI DEVTYPE: MajorType Position */ -#define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos) /*!< TPI DEVTYPE: MajorType Mask */ - -#define TPI_DEVTYPE_SubType_Pos 0 /*!< TPI DEVTYPE: SubType Position */ -#define TPI_DEVTYPE_SubType_Msk (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/) /*!< TPI DEVTYPE: SubType Mask */ - -/*@}*/ /* end of group CMSIS_TPI */ - - -#if (__MPU_PRESENT == 1) -/** \ingroup CMSIS_core_register - \defgroup CMSIS_MPU Memory Protection Unit (MPU) - \brief Type definitions for the Memory Protection Unit (MPU) - @{ - */ - -/** \brief Structure type to access the Memory Protection Unit (MPU). - */ -typedef struct -{ - __I uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */ - __IO uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */ - __IO uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region RNRber Register */ - __IO uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */ - __IO uint32_t RASR; /*!< Offset: 0x010 (R/W) MPU Region Attribute and Size Register */ - __IO uint32_t RBAR_A1; /*!< Offset: 0x014 (R/W) MPU Alias 1 Region Base Address Register */ - __IO uint32_t RASR_A1; /*!< Offset: 0x018 (R/W) MPU Alias 1 Region Attribute and Size Register */ - __IO uint32_t RBAR_A2; /*!< Offset: 0x01C (R/W) MPU Alias 2 Region Base Address Register */ - __IO uint32_t RASR_A2; /*!< Offset: 0x020 (R/W) MPU Alias 2 Region Attribute and Size Register */ - __IO uint32_t RBAR_A3; /*!< Offset: 0x024 (R/W) MPU Alias 3 Region Base Address Register */ - __IO uint32_t RASR_A3; /*!< Offset: 0x028 (R/W) MPU Alias 3 Region Attribute and Size Register */ -} MPU_Type; - -/* MPU Type Register */ -#define MPU_TYPE_IREGION_Pos 16 /*!< MPU TYPE: IREGION Position */ -#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */ - -#define MPU_TYPE_DREGION_Pos 8 /*!< MPU TYPE: DREGION Position */ -#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */ - -#define MPU_TYPE_SEPARATE_Pos 0 /*!< MPU TYPE: SEPARATE Position */ -#define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/) /*!< MPU TYPE: SEPARATE Mask */ - -/* MPU Control Register */ -#define MPU_CTRL_PRIVDEFENA_Pos 2 /*!< MPU CTRL: PRIVDEFENA Position */ -#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */ - -#define MPU_CTRL_HFNMIENA_Pos 1 /*!< MPU CTRL: HFNMIENA Position */ -#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */ - -#define MPU_CTRL_ENABLE_Pos 0 /*!< MPU CTRL: ENABLE Position */ -#define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/) /*!< MPU CTRL: ENABLE Mask */ - -/* MPU Region Number Register */ -#define MPU_RNR_REGION_Pos 0 /*!< MPU RNR: REGION Position */ -#define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/) /*!< MPU RNR: REGION Mask */ - -/* MPU Region Base Address Register */ -#define MPU_RBAR_ADDR_Pos 5 /*!< MPU RBAR: ADDR Position */ -#define MPU_RBAR_ADDR_Msk (0x7FFFFFFUL << MPU_RBAR_ADDR_Pos) /*!< MPU RBAR: ADDR Mask */ - -#define MPU_RBAR_VALID_Pos 4 /*!< MPU RBAR: VALID Position */ -#define MPU_RBAR_VALID_Msk (1UL << MPU_RBAR_VALID_Pos) /*!< MPU RBAR: VALID Mask */ - -#define MPU_RBAR_REGION_Pos 0 /*!< MPU RBAR: REGION Position */ -#define MPU_RBAR_REGION_Msk (0xFUL /*<< MPU_RBAR_REGION_Pos*/) /*!< MPU RBAR: REGION Mask */ - -/* MPU Region Attribute and Size Register */ -#define MPU_RASR_ATTRS_Pos 16 /*!< MPU RASR: MPU Region Attribute field Position */ -#define MPU_RASR_ATTRS_Msk (0xFFFFUL << MPU_RASR_ATTRS_Pos) /*!< MPU RASR: MPU Region Attribute field Mask */ - -#define MPU_RASR_XN_Pos 28 /*!< MPU RASR: ATTRS.XN Position */ -#define MPU_RASR_XN_Msk (1UL << MPU_RASR_XN_Pos) /*!< MPU RASR: ATTRS.XN Mask */ - -#define MPU_RASR_AP_Pos 24 /*!< MPU RASR: ATTRS.AP Position */ -#define MPU_RASR_AP_Msk (0x7UL << MPU_RASR_AP_Pos) /*!< MPU RASR: ATTRS.AP Mask */ - -#define MPU_RASR_TEX_Pos 19 /*!< MPU RASR: ATTRS.TEX Position */ -#define MPU_RASR_TEX_Msk (0x7UL << MPU_RASR_TEX_Pos) /*!< MPU RASR: ATTRS.TEX Mask */ - -#define MPU_RASR_S_Pos 18 /*!< MPU RASR: ATTRS.S Position */ -#define MPU_RASR_S_Msk (1UL << MPU_RASR_S_Pos) /*!< MPU RASR: ATTRS.S Mask */ - -#define MPU_RASR_C_Pos 17 /*!< MPU RASR: ATTRS.C Position */ -#define MPU_RASR_C_Msk (1UL << MPU_RASR_C_Pos) /*!< MPU RASR: ATTRS.C Mask */ - -#define MPU_RASR_B_Pos 16 /*!< MPU RASR: ATTRS.B Position */ -#define MPU_RASR_B_Msk (1UL << MPU_RASR_B_Pos) /*!< MPU RASR: ATTRS.B Mask */ - -#define MPU_RASR_SRD_Pos 8 /*!< MPU RASR: Sub-Region Disable Position */ -#define MPU_RASR_SRD_Msk (0xFFUL << MPU_RASR_SRD_Pos) /*!< MPU RASR: Sub-Region Disable Mask */ - -#define MPU_RASR_SIZE_Pos 1 /*!< MPU RASR: Region Size Field Position */ -#define MPU_RASR_SIZE_Msk (0x1FUL << MPU_RASR_SIZE_Pos) /*!< MPU RASR: Region Size Field Mask */ - -#define MPU_RASR_ENABLE_Pos 0 /*!< MPU RASR: Region enable bit Position */ -#define MPU_RASR_ENABLE_Msk (1UL /*<< MPU_RASR_ENABLE_Pos*/) /*!< MPU RASR: Region enable bit Disable Mask */ - -/*@} end of group CMSIS_MPU */ -#endif - - -#if (__FPU_PRESENT == 1) -/** \ingroup CMSIS_core_register - \defgroup CMSIS_FPU Floating Point Unit (FPU) - \brief Type definitions for the Floating Point Unit (FPU) - @{ - */ - -/** \brief Structure type to access the Floating Point Unit (FPU). - */ -typedef struct -{ - uint32_t RESERVED0[1]; - __IO uint32_t FPCCR; /*!< Offset: 0x004 (R/W) Floating-Point Context Control Register */ - __IO uint32_t FPCAR; /*!< Offset: 0x008 (R/W) Floating-Point Context Address Register */ - __IO uint32_t FPDSCR; /*!< Offset: 0x00C (R/W) Floating-Point Default Status Control Register */ - __I uint32_t MVFR0; /*!< Offset: 0x010 (R/ ) Media and FP Feature Register 0 */ - __I uint32_t MVFR1; /*!< Offset: 0x014 (R/ ) Media and FP Feature Register 1 */ -} FPU_Type; - -/* Floating-Point Context Control Register */ -#define FPU_FPCCR_ASPEN_Pos 31 /*!< FPCCR: ASPEN bit Position */ -#define FPU_FPCCR_ASPEN_Msk (1UL << FPU_FPCCR_ASPEN_Pos) /*!< FPCCR: ASPEN bit Mask */ - -#define FPU_FPCCR_LSPEN_Pos 30 /*!< FPCCR: LSPEN Position */ -#define FPU_FPCCR_LSPEN_Msk (1UL << FPU_FPCCR_LSPEN_Pos) /*!< FPCCR: LSPEN bit Mask */ - -#define FPU_FPCCR_MONRDY_Pos 8 /*!< FPCCR: MONRDY Position */ -#define FPU_FPCCR_MONRDY_Msk (1UL << FPU_FPCCR_MONRDY_Pos) /*!< FPCCR: MONRDY bit Mask */ - -#define FPU_FPCCR_BFRDY_Pos 6 /*!< FPCCR: BFRDY Position */ -#define FPU_FPCCR_BFRDY_Msk (1UL << FPU_FPCCR_BFRDY_Pos) /*!< FPCCR: BFRDY bit Mask */ - -#define FPU_FPCCR_MMRDY_Pos 5 /*!< FPCCR: MMRDY Position */ -#define FPU_FPCCR_MMRDY_Msk (1UL << FPU_FPCCR_MMRDY_Pos) /*!< FPCCR: MMRDY bit Mask */ - -#define FPU_FPCCR_HFRDY_Pos 4 /*!< FPCCR: HFRDY Position */ -#define FPU_FPCCR_HFRDY_Msk (1UL << FPU_FPCCR_HFRDY_Pos) /*!< FPCCR: HFRDY bit Mask */ - -#define FPU_FPCCR_THREAD_Pos 3 /*!< FPCCR: processor mode bit Position */ -#define FPU_FPCCR_THREAD_Msk (1UL << FPU_FPCCR_THREAD_Pos) /*!< FPCCR: processor mode active bit Mask */ - -#define FPU_FPCCR_USER_Pos 1 /*!< FPCCR: privilege level bit Position */ -#define FPU_FPCCR_USER_Msk (1UL << FPU_FPCCR_USER_Pos) /*!< FPCCR: privilege level bit Mask */ - -#define FPU_FPCCR_LSPACT_Pos 0 /*!< FPCCR: Lazy state preservation active bit Position */ -#define FPU_FPCCR_LSPACT_Msk (1UL /*<< FPU_FPCCR_LSPACT_Pos*/) /*!< FPCCR: Lazy state preservation active bit Mask */ - -/* Floating-Point Context Address Register */ -#define FPU_FPCAR_ADDRESS_Pos 3 /*!< FPCAR: ADDRESS bit Position */ -#define FPU_FPCAR_ADDRESS_Msk (0x1FFFFFFFUL << FPU_FPCAR_ADDRESS_Pos) /*!< FPCAR: ADDRESS bit Mask */ - -/* Floating-Point Default Status Control Register */ -#define FPU_FPDSCR_AHP_Pos 26 /*!< FPDSCR: AHP bit Position */ -#define FPU_FPDSCR_AHP_Msk (1UL << FPU_FPDSCR_AHP_Pos) /*!< FPDSCR: AHP bit Mask */ - -#define FPU_FPDSCR_DN_Pos 25 /*!< FPDSCR: DN bit Position */ -#define FPU_FPDSCR_DN_Msk (1UL << FPU_FPDSCR_DN_Pos) /*!< FPDSCR: DN bit Mask */ - -#define FPU_FPDSCR_FZ_Pos 24 /*!< FPDSCR: FZ bit Position */ -#define FPU_FPDSCR_FZ_Msk (1UL << FPU_FPDSCR_FZ_Pos) /*!< FPDSCR: FZ bit Mask */ - -#define FPU_FPDSCR_RMode_Pos 22 /*!< FPDSCR: RMode bit Position */ -#define FPU_FPDSCR_RMode_Msk (3UL << FPU_FPDSCR_RMode_Pos) /*!< FPDSCR: RMode bit Mask */ - -/* Media and FP Feature Register 0 */ -#define FPU_MVFR0_FP_rounding_modes_Pos 28 /*!< MVFR0: FP rounding modes bits Position */ -#define FPU_MVFR0_FP_rounding_modes_Msk (0xFUL << FPU_MVFR0_FP_rounding_modes_Pos) /*!< MVFR0: FP rounding modes bits Mask */ - -#define FPU_MVFR0_Short_vectors_Pos 24 /*!< MVFR0: Short vectors bits Position */ -#define FPU_MVFR0_Short_vectors_Msk (0xFUL << FPU_MVFR0_Short_vectors_Pos) /*!< MVFR0: Short vectors bits Mask */ - -#define FPU_MVFR0_Square_root_Pos 20 /*!< MVFR0: Square root bits Position */ -#define FPU_MVFR0_Square_root_Msk (0xFUL << FPU_MVFR0_Square_root_Pos) /*!< MVFR0: Square root bits Mask */ - -#define FPU_MVFR0_Divide_Pos 16 /*!< MVFR0: Divide bits Position */ -#define FPU_MVFR0_Divide_Msk (0xFUL << FPU_MVFR0_Divide_Pos) /*!< MVFR0: Divide bits Mask */ - -#define FPU_MVFR0_FP_excep_trapping_Pos 12 /*!< MVFR0: FP exception trapping bits Position */ -#define FPU_MVFR0_FP_excep_trapping_Msk (0xFUL << FPU_MVFR0_FP_excep_trapping_Pos) /*!< MVFR0: FP exception trapping bits Mask */ - -#define FPU_MVFR0_Double_precision_Pos 8 /*!< MVFR0: Double-precision bits Position */ -#define FPU_MVFR0_Double_precision_Msk (0xFUL << FPU_MVFR0_Double_precision_Pos) /*!< MVFR0: Double-precision bits Mask */ - -#define FPU_MVFR0_Single_precision_Pos 4 /*!< MVFR0: Single-precision bits Position */ -#define FPU_MVFR0_Single_precision_Msk (0xFUL << FPU_MVFR0_Single_precision_Pos) /*!< MVFR0: Single-precision bits Mask */ - -#define FPU_MVFR0_A_SIMD_registers_Pos 0 /*!< MVFR0: A_SIMD registers bits Position */ -#define FPU_MVFR0_A_SIMD_registers_Msk (0xFUL /*<< FPU_MVFR0_A_SIMD_registers_Pos*/) /*!< MVFR0: A_SIMD registers bits Mask */ - -/* Media and FP Feature Register 1 */ -#define FPU_MVFR1_FP_fused_MAC_Pos 28 /*!< MVFR1: FP fused MAC bits Position */ -#define FPU_MVFR1_FP_fused_MAC_Msk (0xFUL << FPU_MVFR1_FP_fused_MAC_Pos) /*!< MVFR1: FP fused MAC bits Mask */ - -#define FPU_MVFR1_FP_HPFP_Pos 24 /*!< MVFR1: FP HPFP bits Position */ -#define FPU_MVFR1_FP_HPFP_Msk (0xFUL << FPU_MVFR1_FP_HPFP_Pos) /*!< MVFR1: FP HPFP bits Mask */ - -#define FPU_MVFR1_D_NaN_mode_Pos 4 /*!< MVFR1: D_NaN mode bits Position */ -#define FPU_MVFR1_D_NaN_mode_Msk (0xFUL << FPU_MVFR1_D_NaN_mode_Pos) /*!< MVFR1: D_NaN mode bits Mask */ - -#define FPU_MVFR1_FtZ_mode_Pos 0 /*!< MVFR1: FtZ mode bits Position */ -#define FPU_MVFR1_FtZ_mode_Msk (0xFUL /*<< FPU_MVFR1_FtZ_mode_Pos*/) /*!< MVFR1: FtZ mode bits Mask */ - -/*@} end of group CMSIS_FPU */ -#endif - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) - \brief Type definitions for the Core Debug Registers - @{ - */ - -/** \brief Structure type to access the Core Debug Register (CoreDebug). - */ -typedef struct -{ - __IO uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */ - __O uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */ - __IO uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */ - __IO uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */ -} CoreDebug_Type; - -/* Debug Halting Control and Status Register */ -#define CoreDebug_DHCSR_DBGKEY_Pos 16 /*!< CoreDebug DHCSR: DBGKEY Position */ -#define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos) /*!< CoreDebug DHCSR: DBGKEY Mask */ - -#define CoreDebug_DHCSR_S_RESET_ST_Pos 25 /*!< CoreDebug DHCSR: S_RESET_ST Position */ -#define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos) /*!< CoreDebug DHCSR: S_RESET_ST Mask */ - -#define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24 /*!< CoreDebug DHCSR: S_RETIRE_ST Position */ -#define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos) /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */ - -#define CoreDebug_DHCSR_S_LOCKUP_Pos 19 /*!< CoreDebug DHCSR: S_LOCKUP Position */ -#define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos) /*!< CoreDebug DHCSR: S_LOCKUP Mask */ - -#define CoreDebug_DHCSR_S_SLEEP_Pos 18 /*!< CoreDebug DHCSR: S_SLEEP Position */ -#define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos) /*!< CoreDebug DHCSR: S_SLEEP Mask */ - -#define CoreDebug_DHCSR_S_HALT_Pos 17 /*!< CoreDebug DHCSR: S_HALT Position */ -#define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos) /*!< CoreDebug DHCSR: S_HALT Mask */ - -#define CoreDebug_DHCSR_S_REGRDY_Pos 16 /*!< CoreDebug DHCSR: S_REGRDY Position */ -#define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos) /*!< CoreDebug DHCSR: S_REGRDY Mask */ - -#define CoreDebug_DHCSR_C_SNAPSTALL_Pos 5 /*!< CoreDebug DHCSR: C_SNAPSTALL Position */ -#define CoreDebug_DHCSR_C_SNAPSTALL_Msk (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos) /*!< CoreDebug DHCSR: C_SNAPSTALL Mask */ - -#define CoreDebug_DHCSR_C_MASKINTS_Pos 3 /*!< CoreDebug DHCSR: C_MASKINTS Position */ -#define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos) /*!< CoreDebug DHCSR: C_MASKINTS Mask */ - -#define CoreDebug_DHCSR_C_STEP_Pos 2 /*!< CoreDebug DHCSR: C_STEP Position */ -#define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos) /*!< CoreDebug DHCSR: C_STEP Mask */ - -#define CoreDebug_DHCSR_C_HALT_Pos 1 /*!< CoreDebug DHCSR: C_HALT Position */ -#define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos) /*!< CoreDebug DHCSR: C_HALT Mask */ - -#define CoreDebug_DHCSR_C_DEBUGEN_Pos 0 /*!< CoreDebug DHCSR: C_DEBUGEN Position */ -#define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/) /*!< CoreDebug DHCSR: C_DEBUGEN Mask */ - -/* Debug Core Register Selector Register */ -#define CoreDebug_DCRSR_REGWnR_Pos 16 /*!< CoreDebug DCRSR: REGWnR Position */ -#define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos) /*!< CoreDebug DCRSR: REGWnR Mask */ - -#define CoreDebug_DCRSR_REGSEL_Pos 0 /*!< CoreDebug DCRSR: REGSEL Position */ -#define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/) /*!< CoreDebug DCRSR: REGSEL Mask */ - -/* Debug Exception and Monitor Control Register */ -#define CoreDebug_DEMCR_TRCENA_Pos 24 /*!< CoreDebug DEMCR: TRCENA Position */ -#define CoreDebug_DEMCR_TRCENA_Msk (1UL << CoreDebug_DEMCR_TRCENA_Pos) /*!< CoreDebug DEMCR: TRCENA Mask */ - -#define CoreDebug_DEMCR_MON_REQ_Pos 19 /*!< CoreDebug DEMCR: MON_REQ Position */ -#define CoreDebug_DEMCR_MON_REQ_Msk (1UL << CoreDebug_DEMCR_MON_REQ_Pos) /*!< CoreDebug DEMCR: MON_REQ Mask */ - -#define CoreDebug_DEMCR_MON_STEP_Pos 18 /*!< CoreDebug DEMCR: MON_STEP Position */ -#define CoreDebug_DEMCR_MON_STEP_Msk (1UL << CoreDebug_DEMCR_MON_STEP_Pos) /*!< CoreDebug DEMCR: MON_STEP Mask */ - -#define CoreDebug_DEMCR_MON_PEND_Pos 17 /*!< CoreDebug DEMCR: MON_PEND Position */ -#define CoreDebug_DEMCR_MON_PEND_Msk (1UL << CoreDebug_DEMCR_MON_PEND_Pos) /*!< CoreDebug DEMCR: MON_PEND Mask */ - -#define CoreDebug_DEMCR_MON_EN_Pos 16 /*!< CoreDebug DEMCR: MON_EN Position */ -#define CoreDebug_DEMCR_MON_EN_Msk (1UL << CoreDebug_DEMCR_MON_EN_Pos) /*!< CoreDebug DEMCR: MON_EN Mask */ - -#define CoreDebug_DEMCR_VC_HARDERR_Pos 10 /*!< CoreDebug DEMCR: VC_HARDERR Position */ -#define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos) /*!< CoreDebug DEMCR: VC_HARDERR Mask */ - -#define CoreDebug_DEMCR_VC_INTERR_Pos 9 /*!< CoreDebug DEMCR: VC_INTERR Position */ -#define CoreDebug_DEMCR_VC_INTERR_Msk (1UL << CoreDebug_DEMCR_VC_INTERR_Pos) /*!< CoreDebug DEMCR: VC_INTERR Mask */ - -#define CoreDebug_DEMCR_VC_BUSERR_Pos 8 /*!< CoreDebug DEMCR: VC_BUSERR Position */ -#define CoreDebug_DEMCR_VC_BUSERR_Msk (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos) /*!< CoreDebug DEMCR: VC_BUSERR Mask */ - -#define CoreDebug_DEMCR_VC_STATERR_Pos 7 /*!< CoreDebug DEMCR: VC_STATERR Position */ -#define CoreDebug_DEMCR_VC_STATERR_Msk (1UL << CoreDebug_DEMCR_VC_STATERR_Pos) /*!< CoreDebug DEMCR: VC_STATERR Mask */ - -#define CoreDebug_DEMCR_VC_CHKERR_Pos 6 /*!< CoreDebug DEMCR: VC_CHKERR Position */ -#define CoreDebug_DEMCR_VC_CHKERR_Msk (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos) /*!< CoreDebug DEMCR: VC_CHKERR Mask */ - -#define CoreDebug_DEMCR_VC_NOCPERR_Pos 5 /*!< CoreDebug DEMCR: VC_NOCPERR Position */ -#define CoreDebug_DEMCR_VC_NOCPERR_Msk (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos) /*!< CoreDebug DEMCR: VC_NOCPERR Mask */ - -#define CoreDebug_DEMCR_VC_MMERR_Pos 4 /*!< CoreDebug DEMCR: VC_MMERR Position */ -#define CoreDebug_DEMCR_VC_MMERR_Msk (1UL << CoreDebug_DEMCR_VC_MMERR_Pos) /*!< CoreDebug DEMCR: VC_MMERR Mask */ - -#define CoreDebug_DEMCR_VC_CORERESET_Pos 0 /*!< CoreDebug DEMCR: VC_CORERESET Position */ -#define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/) /*!< CoreDebug DEMCR: VC_CORERESET Mask */ - -/*@} end of group CMSIS_CoreDebug */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_core_base Core Definitions - \brief Definitions for base addresses, unions, and structures. - @{ - */ - -/* Memory mapping of Cortex-M4 Hardware */ -#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ -#define ITM_BASE (0xE0000000UL) /*!< ITM Base Address */ -#define DWT_BASE (0xE0001000UL) /*!< DWT Base Address */ -#define TPI_BASE (0xE0040000UL) /*!< TPI Base Address */ -#define CoreDebug_BASE (0xE000EDF0UL) /*!< Core Debug Base Address */ -#define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ -#define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ -#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ - -#define SCnSCB ((SCnSCB_Type *) SCS_BASE ) /*!< System control Register not in SCB */ -#define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ -#define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ -#define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ -#define ITM ((ITM_Type *) ITM_BASE ) /*!< ITM configuration struct */ -#define DWT ((DWT_Type *) DWT_BASE ) /*!< DWT configuration struct */ -#define TPI ((TPI_Type *) TPI_BASE ) /*!< TPI configuration struct */ -#define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE) /*!< Core Debug configuration struct */ - -#if (__MPU_PRESENT == 1) - #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ - #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ -#endif - -#if (__FPU_PRESENT == 1) - #define FPU_BASE (SCS_BASE + 0x0F30UL) /*!< Floating Point Unit */ - #define FPU ((FPU_Type *) FPU_BASE ) /*!< Floating Point Unit */ -#endif - -/*@} */ - - - -/******************************************************************************* - * Hardware Abstraction Layer - Core Function Interface contains: - - Core NVIC Functions - - Core SysTick Functions - - Core Debug Functions - - Core Register Access Functions - ******************************************************************************/ -/** \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference -*/ - - - -/* ########################## NVIC functions #################################### */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_NVICFunctions NVIC Functions - \brief Functions that manage interrupts and exceptions via the NVIC. - @{ - */ - -/** \brief Set Priority Grouping - - The function sets the priority grouping field using the required unlock sequence. - The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field. - Only values from 0..7 are used. - In case of a conflict between priority grouping and available - priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. - - \param [in] PriorityGroup Priority grouping field. - */ -__STATIC_INLINE void NVIC_SetPriorityGrouping(uint32_t PriorityGroup) -{ - uint32_t reg_value; - uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ - - reg_value = SCB->AIRCR; /* read old register configuration */ - reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ - reg_value = (reg_value | - ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | - (PriorityGroupTmp << 8) ); /* Insert write key and priorty group */ - SCB->AIRCR = reg_value; -} - - -/** \brief Get Priority Grouping - - The function reads the priority grouping field from the NVIC Interrupt Controller. - - \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field). - */ -__STATIC_INLINE uint32_t NVIC_GetPriorityGrouping(void) -{ - return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos)); -} - - -/** \brief Enable External Interrupt - - The function enables a device-specific interrupt in the NVIC interrupt controller. - - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn) -{ - NVIC->ISER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** \brief Disable External Interrupt - - The function disables a device-specific interrupt in the NVIC interrupt controller. - - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn) -{ - NVIC->ICER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** \brief Get Pending Interrupt - - The function reads the pending register in the NVIC and returns the pending bit - for the specified interrupt. - - \param [in] IRQn Interrupt number. - - \return 0 Interrupt status is not pending. - \return 1 Interrupt status is pending. - */ -__STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn) -{ - return((uint32_t)(((NVIC->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** \brief Set Pending Interrupt - - The function sets the pending bit of an external interrupt. - - \param [in] IRQn Interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** \brief Clear Pending Interrupt - - The function clears the pending bit of an external interrupt. - - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ICPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** \brief Get Active Interrupt - - The function reads the active register in NVIC and returns the active bit. - - \param [in] IRQn Interrupt number. - - \return 0 Interrupt status is not active. - \return 1 Interrupt status is active. - */ -__STATIC_INLINE uint32_t NVIC_GetActive(IRQn_Type IRQn) -{ - return((uint32_t)(((NVIC->IABR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** \brief Set Interrupt Priority - - The function sets the priority of an interrupt. - - \note The priority cannot be set for every core interrupt. - - \param [in] IRQn Interrupt number. - \param [in] priority Priority to set. - */ -__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) -{ - if((int32_t)IRQn < 0) { - SCB->SHP[(((uint32_t)(int32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8 - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } - else { - NVIC->IP[((uint32_t)(int32_t)IRQn)] = (uint8_t)((priority << (8 - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } -} - - -/** \brief Get Interrupt Priority - - The function reads the priority of an interrupt. The interrupt - number can be positive to specify an external (device specific) - interrupt, or negative to specify an internal (core) interrupt. - - - \param [in] IRQn Interrupt number. - \return Interrupt Priority. Value is aligned automatically to the implemented - priority bits of the microcontroller. - */ -__STATIC_INLINE uint32_t NVIC_GetPriority(IRQn_Type IRQn) -{ - - if((int32_t)IRQn < 0) { - return(((uint32_t)SCB->SHP[(((uint32_t)(int32_t)IRQn) & 0xFUL)-4UL] >> (8 - __NVIC_PRIO_BITS))); - } - else { - return(((uint32_t)NVIC->IP[((uint32_t)(int32_t)IRQn)] >> (8 - __NVIC_PRIO_BITS))); - } -} - - -/** \brief Encode Priority - - The function encodes the priority for an interrupt with the given priority group, - preemptive priority value, and subpriority value. - In case of a conflict between priority grouping and available - priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. - - \param [in] PriorityGroup Used priority group. - \param [in] PreemptPriority Preemptive priority value (starting from 0). - \param [in] SubPriority Subpriority value (starting from 0). - \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority(). - */ -__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) -{ - uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ - uint32_t PreemptPriorityBits; - uint32_t SubPriorityBits; - - PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); - SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); - - return ( - ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | - ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL))) - ); -} - - -/** \brief Decode Priority - - The function decodes an interrupt priority value with a given priority group to - preemptive priority value and subpriority value. - In case of a conflict between priority grouping and available - priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set. - - \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority(). - \param [in] PriorityGroup Used priority group. - \param [out] pPreemptPriority Preemptive priority value (starting from 0). - \param [out] pSubPriority Subpriority value (starting from 0). - */ -__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* pPreemptPriority, uint32_t* pSubPriority) -{ - uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ - uint32_t PreemptPriorityBits; - uint32_t SubPriorityBits; - - PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); - SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); - - *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL); - *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL); -} - - -/** \brief System Reset - - The function initiates a system reset request to reset the MCU. - */ -__STATIC_INLINE void NVIC_SystemReset(void) -{ - __DSB(); /* Ensure all outstanding memory accesses included - buffered write are completed before reset */ - SCB->AIRCR = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | - (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) | - SCB_AIRCR_SYSRESETREQ_Msk ); /* Keep priority group unchanged */ - __DSB(); /* Ensure completion of memory access */ - while(1) { __NOP(); } /* wait until reset */ -} - -/*@} end of CMSIS_Core_NVICFunctions */ - - - -/* ################################## SysTick function ############################################ */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_SysTickFunctions SysTick Functions - \brief Functions that configure the System. - @{ - */ - -#if (__Vendor_SysTickConfig == 0) - -/** \brief System Tick Configuration - - The function initializes the System Timer and its interrupt, and starts the System Tick Timer. - Counter is in free running mode to generate periodic interrupts. - - \param [in] ticks Number of ticks between two interrupts. - - \return 0 Function succeeded. - \return 1 Function failed. - - \note When the variable __Vendor_SysTickConfig is set to 1, then the - function SysTick_Config is not included. In this case, the file device.h - must contain a vendor-specific implementation of this function. - - */ -__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) -{ - if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) { return (1UL); } /* Reload value impossible */ - - SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ - NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ - SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ - SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | - SysTick_CTRL_TICKINT_Msk | - SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ - return (0UL); /* Function successful */ -} - -#endif - -/*@} end of CMSIS_Core_SysTickFunctions */ - - - -/* ##################################### Debug In/Output function ########################################### */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_core_DebugFunctions ITM Functions - \brief Functions that access the ITM debug interface. - @{ - */ - -extern volatile int32_t ITM_RxBuffer; /*!< External variable to receive characters. */ -#define ITM_RXBUFFER_EMPTY 0x5AA55AA5 /*!< Value identifying \ref ITM_RxBuffer is ready for next character. */ - - -/** \brief ITM Send Character - - The function transmits a character via the ITM channel 0, and - \li Just returns when no debugger is connected that has booked the output. - \li Is blocking when a debugger is connected, but the previous character sent has not been transmitted. - - \param [in] ch Character to transmit. - - \returns Character to transmit. - */ -__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch) -{ - if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) && /* ITM enabled */ - ((ITM->TER & 1UL ) != 0UL) ) /* ITM Port #0 enabled */ - { - while (ITM->PORT[0].u32 == 0UL) { __NOP(); } - ITM->PORT[0].u8 = (uint8_t)ch; - } - return (ch); -} - - -/** \brief ITM Receive Character - - The function inputs a character via the external variable \ref ITM_RxBuffer. - - \return Received character. - \return -1 No character pending. - */ -__STATIC_INLINE int32_t ITM_ReceiveChar (void) { - int32_t ch = -1; /* no character available */ - - if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY) { - ch = ITM_RxBuffer; - ITM_RxBuffer = ITM_RXBUFFER_EMPTY; /* ready for next character */ - } - - return (ch); -} - - -/** \brief ITM Check Character - - The function checks whether a character is pending for reading in the variable \ref ITM_RxBuffer. - - \return 0 No character available. - \return 1 Character available. - */ -__STATIC_INLINE int32_t ITM_CheckChar (void) { - - if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY) { - return (0); /* no character available */ - } else { - return (1); /* character available */ - } -} - -/*@} end of CMSIS_core_DebugFunctions */ - - - - -#ifdef __cplusplus -} -#endif - -#endif /* __CORE_CM4_H_DEPENDANT */ - -#endif /* __CMSIS_GENERIC */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/core_cm7.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/core_cm7.h deleted file mode 100644 index 842e323f..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/core_cm7.h +++ /dev/null @@ -1,2397 +0,0 @@ -/**************************************************************************//** - * @file core_cm7.h - * @brief CMSIS Cortex-M7 Core Peripheral Access Layer Header File - * @version V4.10 - * @date 18. March 2015 - * - * @note - * - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#endif - -#ifndef __CORE_CM7_H_GENERIC -#define __CORE_CM7_H_GENERIC - -#ifdef __cplusplus - extern "C" { -#endif - -/** \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions - CMSIS violates the following MISRA-C:2004 rules: - - \li Required Rule 8.5, object/function definition in header file.
- Function definitions in header files are used to allow 'inlining'. - - \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
- Unions are used for effective representation of core registers. - - \li Advisory Rule 19.7, Function-like macro defined.
- Function-like macros are used to allow more efficient code. - */ - - -/******************************************************************************* - * CMSIS definitions - ******************************************************************************/ -/** \ingroup Cortex_M7 - @{ - */ - -/* CMSIS CM7 definitions */ -#define __CM7_CMSIS_VERSION_MAIN (0x04) /*!< [31:16] CMSIS HAL main version */ -#define __CM7_CMSIS_VERSION_SUB (0x00) /*!< [15:0] CMSIS HAL sub version */ -#define __CM7_CMSIS_VERSION ((__CM7_CMSIS_VERSION_MAIN << 16) | \ - __CM7_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */ - -#define __CORTEX_M (0x07) /*!< Cortex-M Core */ - - -#if defined ( __CC_ARM ) - #define __ASM __asm /*!< asm keyword for ARM Compiler */ - #define __INLINE __inline /*!< inline keyword for ARM Compiler */ - #define __STATIC_INLINE static __inline - -#elif defined ( __GNUC__ ) - #define __ASM __asm /*!< asm keyword for GNU Compiler */ - #define __INLINE inline /*!< inline keyword for GNU Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __ICCARM__ ) - #define __ASM __asm /*!< asm keyword for IAR Compiler */ - #define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */ - #define __STATIC_INLINE static inline - -#elif defined ( __TMS470__ ) - #define __ASM __asm /*!< asm keyword for TI CCS Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __TASKING__ ) - #define __ASM __asm /*!< asm keyword for TASKING Compiler */ - #define __INLINE inline /*!< inline keyword for TASKING Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __CSMC__ ) - #define __packed - #define __ASM _asm /*!< asm keyword for COSMIC Compiler */ - #define __INLINE inline /*use -pc99 on compile line !< inline keyword for COSMIC Compiler */ - #define __STATIC_INLINE static inline - -#endif - -/** __FPU_USED indicates whether an FPU is used or not. - For this, __FPU_PRESENT has to be checked prior to making use of FPU specific registers and functions. -*/ -#if defined ( __CC_ARM ) - #if defined __TARGET_FPU_VFP - #if (__FPU_PRESENT == 1) - #define __FPU_USED 1 - #else - #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #define __FPU_USED 0 - #endif - #else - #define __FPU_USED 0 - #endif - -#elif defined ( __GNUC__ ) - #if defined (__VFP_FP__) && !defined(__SOFTFP__) - #if (__FPU_PRESENT == 1) - #define __FPU_USED 1 - #else - #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #define __FPU_USED 0 - #endif - #else - #define __FPU_USED 0 - #endif - -#elif defined ( __ICCARM__ ) - #if defined __ARMVFP__ - #if (__FPU_PRESENT == 1) - #define __FPU_USED 1 - #else - #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #define __FPU_USED 0 - #endif - #else - #define __FPU_USED 0 - #endif - -#elif defined ( __TMS470__ ) - #if defined __TI_VFP_SUPPORT__ - #if (__FPU_PRESENT == 1) - #define __FPU_USED 1 - #else - #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #define __FPU_USED 0 - #endif - #else - #define __FPU_USED 0 - #endif - -#elif defined ( __TASKING__ ) - #if defined __FPU_VFP__ - #if (__FPU_PRESENT == 1) - #define __FPU_USED 1 - #else - #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #define __FPU_USED 0 - #endif - #else - #define __FPU_USED 0 - #endif - -#elif defined ( __CSMC__ ) /* Cosmic */ - #if ( __CSMC__ & 0x400) // FPU present for parser - #if (__FPU_PRESENT == 1) - #define __FPU_USED 1 - #else - #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #define __FPU_USED 0 - #endif - #else - #define __FPU_USED 0 - #endif -#endif - -#include /* standard types definitions */ -#include /* Core Instruction Access */ -#include /* Core Function Access */ -#include /* Compiler specific SIMD Intrinsics */ - -#ifdef __cplusplus -} -#endif - -#endif /* __CORE_CM7_H_GENERIC */ - -#ifndef __CMSIS_GENERIC - -#ifndef __CORE_CM7_H_DEPENDANT -#define __CORE_CM7_H_DEPENDANT - -#ifdef __cplusplus - extern "C" { -#endif - -/* check device defines and use defaults */ -#if defined __CHECK_DEVICE_DEFINES - #ifndef __CM7_REV - #define __CM7_REV 0x0000 - #warning "__CM7_REV not defined in device header file; using default!" - #endif - - #ifndef __FPU_PRESENT - #define __FPU_PRESENT 0 - #warning "__FPU_PRESENT not defined in device header file; using default!" - #endif - - #ifndef __MPU_PRESENT - #define __MPU_PRESENT 0 - #warning "__MPU_PRESENT not defined in device header file; using default!" - #endif - - #ifndef __ICACHE_PRESENT - #define __ICACHE_PRESENT 0 - #warning "__ICACHE_PRESENT not defined in device header file; using default!" - #endif - - #ifndef __DCACHE_PRESENT - #define __DCACHE_PRESENT 0 - #warning "__DCACHE_PRESENT not defined in device header file; using default!" - #endif - - #ifndef __DTCM_PRESENT - #define __DTCM_PRESENT 0 - #warning "__DTCM_PRESENT not defined in device header file; using default!" - #endif - - #ifndef __NVIC_PRIO_BITS - #define __NVIC_PRIO_BITS 3 - #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" - #endif - - #ifndef __Vendor_SysTickConfig - #define __Vendor_SysTickConfig 0 - #warning "__Vendor_SysTickConfig not defined in device header file; using default!" - #endif -#endif - -/* IO definitions (access restrictions to peripheral registers) */ -/** - \defgroup CMSIS_glob_defs CMSIS Global Defines - - IO Type Qualifiers are used - \li to specify the access to peripheral variables. - \li for automatic generation of peripheral register debug information. -*/ -#ifdef __cplusplus - #define __I volatile /*!< Defines 'read only' permissions */ -#else - #define __I volatile const /*!< Defines 'read only' permissions */ -#endif -#define __O volatile /*!< Defines 'write only' permissions */ -#define __IO volatile /*!< Defines 'read / write' permissions */ - -/*@} end of group Cortex_M7 */ - - - -/******************************************************************************* - * Register Abstraction - Core Register contain: - - Core Register - - Core NVIC Register - - Core SCB Register - - Core SysTick Register - - Core Debug Register - - Core MPU Register - - Core FPU Register - ******************************************************************************/ -/** \defgroup CMSIS_core_register Defines and Type Definitions - \brief Type definitions and defines for Cortex-M processor based devices. -*/ - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_CORE Status and Control Registers - \brief Core Register type definitions. - @{ - */ - -/** \brief Union type to access the Application Program Status Register (APSR). - */ -typedef union -{ - struct - { - uint32_t _reserved0:16; /*!< bit: 0..15 Reserved */ - uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */ - uint32_t _reserved1:7; /*!< bit: 20..26 Reserved */ - uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ - uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ - uint32_t C:1; /*!< bit: 29 Carry condition code flag */ - uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ - uint32_t N:1; /*!< bit: 31 Negative condition code flag */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} APSR_Type; - -/* APSR Register Definitions */ -#define APSR_N_Pos 31 /*!< APSR: N Position */ -#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ - -#define APSR_Z_Pos 30 /*!< APSR: Z Position */ -#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ - -#define APSR_C_Pos 29 /*!< APSR: C Position */ -#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ - -#define APSR_V_Pos 28 /*!< APSR: V Position */ -#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ - -#define APSR_Q_Pos 27 /*!< APSR: Q Position */ -#define APSR_Q_Msk (1UL << APSR_Q_Pos) /*!< APSR: Q Mask */ - -#define APSR_GE_Pos 16 /*!< APSR: GE Position */ -#define APSR_GE_Msk (0xFUL << APSR_GE_Pos) /*!< APSR: GE Mask */ - - -/** \brief Union type to access the Interrupt Program Status Register (IPSR). - */ -typedef union -{ - struct - { - uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ - uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} IPSR_Type; - -/* IPSR Register Definitions */ -#define IPSR_ISR_Pos 0 /*!< IPSR: ISR Position */ -#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ - - -/** \brief Union type to access the Special-Purpose Program Status Registers (xPSR). - */ -typedef union -{ - struct - { - uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ - uint32_t _reserved0:7; /*!< bit: 9..15 Reserved */ - uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */ - uint32_t _reserved1:4; /*!< bit: 20..23 Reserved */ - uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */ - uint32_t IT:2; /*!< bit: 25..26 saved IT state (read 0) */ - uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ - uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ - uint32_t C:1; /*!< bit: 29 Carry condition code flag */ - uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ - uint32_t N:1; /*!< bit: 31 Negative condition code flag */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} xPSR_Type; - -/* xPSR Register Definitions */ -#define xPSR_N_Pos 31 /*!< xPSR: N Position */ -#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ - -#define xPSR_Z_Pos 30 /*!< xPSR: Z Position */ -#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ - -#define xPSR_C_Pos 29 /*!< xPSR: C Position */ -#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ - -#define xPSR_V_Pos 28 /*!< xPSR: V Position */ -#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ - -#define xPSR_Q_Pos 27 /*!< xPSR: Q Position */ -#define xPSR_Q_Msk (1UL << xPSR_Q_Pos) /*!< xPSR: Q Mask */ - -#define xPSR_IT_Pos 25 /*!< xPSR: IT Position */ -#define xPSR_IT_Msk (3UL << xPSR_IT_Pos) /*!< xPSR: IT Mask */ - -#define xPSR_T_Pos 24 /*!< xPSR: T Position */ -#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ - -#define xPSR_GE_Pos 16 /*!< xPSR: GE Position */ -#define xPSR_GE_Msk (0xFUL << xPSR_GE_Pos) /*!< xPSR: GE Mask */ - -#define xPSR_ISR_Pos 0 /*!< xPSR: ISR Position */ -#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ - - -/** \brief Union type to access the Control Registers (CONTROL). - */ -typedef union -{ - struct - { - uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */ - uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */ - uint32_t FPCA:1; /*!< bit: 2 FP extension active flag */ - uint32_t _reserved0:29; /*!< bit: 3..31 Reserved */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} CONTROL_Type; - -/* CONTROL Register Definitions */ -#define CONTROL_FPCA_Pos 2 /*!< CONTROL: FPCA Position */ -#define CONTROL_FPCA_Msk (1UL << CONTROL_FPCA_Pos) /*!< CONTROL: FPCA Mask */ - -#define CONTROL_SPSEL_Pos 1 /*!< CONTROL: SPSEL Position */ -#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ - -#define CONTROL_nPRIV_Pos 0 /*!< CONTROL: nPRIV Position */ -#define CONTROL_nPRIV_Msk (1UL /*<< CONTROL_nPRIV_Pos*/) /*!< CONTROL: nPRIV Mask */ - -/*@} end of group CMSIS_CORE */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) - \brief Type definitions for the NVIC Registers - @{ - */ - -/** \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). - */ -typedef struct -{ - __IO uint32_t ISER[8]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ - uint32_t RESERVED0[24]; - __IO uint32_t ICER[8]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ - uint32_t RSERVED1[24]; - __IO uint32_t ISPR[8]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ - uint32_t RESERVED2[24]; - __IO uint32_t ICPR[8]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ - uint32_t RESERVED3[24]; - __IO uint32_t IABR[8]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */ - uint32_t RESERVED4[56]; - __IO uint8_t IP[240]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register (8Bit wide) */ - uint32_t RESERVED5[644]; - __O uint32_t STIR; /*!< Offset: 0xE00 ( /W) Software Trigger Interrupt Register */ -} NVIC_Type; - -/* Software Triggered Interrupt Register Definitions */ -#define NVIC_STIR_INTID_Pos 0 /*!< STIR: INTLINESNUM Position */ -#define NVIC_STIR_INTID_Msk (0x1FFUL /*<< NVIC_STIR_INTID_Pos*/) /*!< STIR: INTLINESNUM Mask */ - -/*@} end of group CMSIS_NVIC */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_SCB System Control Block (SCB) - \brief Type definitions for the System Control Block Registers - @{ - */ - -/** \brief Structure type to access the System Control Block (SCB). - */ -typedef struct -{ - __I uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ - __IO uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ - __IO uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */ - __IO uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ - __IO uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ - __IO uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ - __IO uint8_t SHPR[12]; /*!< Offset: 0x018 (R/W) System Handlers Priority Registers (4-7, 8-11, 12-15) */ - __IO uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ - __IO uint32_t CFSR; /*!< Offset: 0x028 (R/W) Configurable Fault Status Register */ - __IO uint32_t HFSR; /*!< Offset: 0x02C (R/W) HardFault Status Register */ - __IO uint32_t DFSR; /*!< Offset: 0x030 (R/W) Debug Fault Status Register */ - __IO uint32_t MMFAR; /*!< Offset: 0x034 (R/W) MemManage Fault Address Register */ - __IO uint32_t BFAR; /*!< Offset: 0x038 (R/W) BusFault Address Register */ - __IO uint32_t AFSR; /*!< Offset: 0x03C (R/W) Auxiliary Fault Status Register */ - __I uint32_t ID_PFR[2]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */ - __I uint32_t ID_DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */ - __I uint32_t ID_AFR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */ - __I uint32_t ID_MFR[4]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */ - __I uint32_t ID_ISAR[5]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */ - uint32_t RESERVED0[1]; - __I uint32_t CLIDR; /*!< Offset: 0x078 (R/ ) Cache Level ID register */ - __I uint32_t CTR; /*!< Offset: 0x07C (R/ ) Cache Type register */ - __I uint32_t CCSIDR; /*!< Offset: 0x080 (R/ ) Cache Size ID Register */ - __IO uint32_t CSSELR; /*!< Offset: 0x084 (R/W) Cache Size Selection Register */ - __IO uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */ - uint32_t RESERVED3[93]; - __O uint32_t STIR; /*!< Offset: 0x200 ( /W) Software Triggered Interrupt Register */ - uint32_t RESERVED4[15]; - __I uint32_t MVFR0; /*!< Offset: 0x240 (R/ ) Media and VFP Feature Register 0 */ - __I uint32_t MVFR1; /*!< Offset: 0x244 (R/ ) Media and VFP Feature Register 1 */ - __I uint32_t MVFR2; /*!< Offset: 0x248 (R/ ) Media and VFP Feature Register 1 */ - uint32_t RESERVED5[1]; - __O uint32_t ICIALLU; /*!< Offset: 0x250 ( /W) I-Cache Invalidate All to PoU */ - uint32_t RESERVED6[1]; - __O uint32_t ICIMVAU; /*!< Offset: 0x258 ( /W) I-Cache Invalidate by MVA to PoU */ - __O uint32_t DCIMVAC; /*!< Offset: 0x25C ( /W) D-Cache Invalidate by MVA to PoC */ - __O uint32_t DCISW; /*!< Offset: 0x260 ( /W) D-Cache Invalidate by Set-way */ - __O uint32_t DCCMVAU; /*!< Offset: 0x264 ( /W) D-Cache Clean by MVA to PoU */ - __O uint32_t DCCMVAC; /*!< Offset: 0x268 ( /W) D-Cache Clean by MVA to PoC */ - __O uint32_t DCCSW; /*!< Offset: 0x26C ( /W) D-Cache Clean by Set-way */ - __O uint32_t DCCIMVAC; /*!< Offset: 0x270 ( /W) D-Cache Clean and Invalidate by MVA to PoC */ - __O uint32_t DCCISW; /*!< Offset: 0x274 ( /W) D-Cache Clean and Invalidate by Set-way */ - uint32_t RESERVED7[6]; - __IO uint32_t ITCMCR; /*!< Offset: 0x290 (R/W) Instruction Tightly-Coupled Memory Control Register */ - __IO uint32_t DTCMCR; /*!< Offset: 0x294 (R/W) Data Tightly-Coupled Memory Control Registers */ - __IO uint32_t AHBPCR; /*!< Offset: 0x298 (R/W) AHBP Control Register */ - __IO uint32_t CACR; /*!< Offset: 0x29C (R/W) L1 Cache Control Register */ - __IO uint32_t AHBSCR; /*!< Offset: 0x2A0 (R/W) AHB Slave Control Register */ - uint32_t RESERVED8[1]; - __IO uint32_t ABFSR; /*!< Offset: 0x2A8 (R/W) Auxiliary Bus Fault Status Register */ -} SCB_Type; - -/* SCB CPUID Register Definitions */ -#define SCB_CPUID_IMPLEMENTER_Pos 24 /*!< SCB CPUID: IMPLEMENTER Position */ -#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ - -#define SCB_CPUID_VARIANT_Pos 20 /*!< SCB CPUID: VARIANT Position */ -#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ - -#define SCB_CPUID_ARCHITECTURE_Pos 16 /*!< SCB CPUID: ARCHITECTURE Position */ -#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ - -#define SCB_CPUID_PARTNO_Pos 4 /*!< SCB CPUID: PARTNO Position */ -#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ - -#define SCB_CPUID_REVISION_Pos 0 /*!< SCB CPUID: REVISION Position */ -#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ - -/* SCB Interrupt Control State Register Definitions */ -#define SCB_ICSR_NMIPENDSET_Pos 31 /*!< SCB ICSR: NMIPENDSET Position */ -#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */ - -#define SCB_ICSR_PENDSVSET_Pos 28 /*!< SCB ICSR: PENDSVSET Position */ -#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ - -#define SCB_ICSR_PENDSVCLR_Pos 27 /*!< SCB ICSR: PENDSVCLR Position */ -#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ - -#define SCB_ICSR_PENDSTSET_Pos 26 /*!< SCB ICSR: PENDSTSET Position */ -#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ - -#define SCB_ICSR_PENDSTCLR_Pos 25 /*!< SCB ICSR: PENDSTCLR Position */ -#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ - -#define SCB_ICSR_ISRPREEMPT_Pos 23 /*!< SCB ICSR: ISRPREEMPT Position */ -#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ - -#define SCB_ICSR_ISRPENDING_Pos 22 /*!< SCB ICSR: ISRPENDING Position */ -#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ - -#define SCB_ICSR_VECTPENDING_Pos 12 /*!< SCB ICSR: VECTPENDING Position */ -#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ - -#define SCB_ICSR_RETTOBASE_Pos 11 /*!< SCB ICSR: RETTOBASE Position */ -#define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos) /*!< SCB ICSR: RETTOBASE Mask */ - -#define SCB_ICSR_VECTACTIVE_Pos 0 /*!< SCB ICSR: VECTACTIVE Position */ -#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ - -/* SCB Vector Table Offset Register Definitions */ -#define SCB_VTOR_TBLOFF_Pos 7 /*!< SCB VTOR: TBLOFF Position */ -#define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ - -/* SCB Application Interrupt and Reset Control Register Definitions */ -#define SCB_AIRCR_VECTKEY_Pos 16 /*!< SCB AIRCR: VECTKEY Position */ -#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ - -#define SCB_AIRCR_VECTKEYSTAT_Pos 16 /*!< SCB AIRCR: VECTKEYSTAT Position */ -#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ - -#define SCB_AIRCR_ENDIANESS_Pos 15 /*!< SCB AIRCR: ENDIANESS Position */ -#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ - -#define SCB_AIRCR_PRIGROUP_Pos 8 /*!< SCB AIRCR: PRIGROUP Position */ -#define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */ - -#define SCB_AIRCR_SYSRESETREQ_Pos 2 /*!< SCB AIRCR: SYSRESETREQ Position */ -#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ - -#define SCB_AIRCR_VECTCLRACTIVE_Pos 1 /*!< SCB AIRCR: VECTCLRACTIVE Position */ -#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ - -#define SCB_AIRCR_VECTRESET_Pos 0 /*!< SCB AIRCR: VECTRESET Position */ -#define SCB_AIRCR_VECTRESET_Msk (1UL /*<< SCB_AIRCR_VECTRESET_Pos*/) /*!< SCB AIRCR: VECTRESET Mask */ - -/* SCB System Control Register Definitions */ -#define SCB_SCR_SEVONPEND_Pos 4 /*!< SCB SCR: SEVONPEND Position */ -#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ - -#define SCB_SCR_SLEEPDEEP_Pos 2 /*!< SCB SCR: SLEEPDEEP Position */ -#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ - -#define SCB_SCR_SLEEPONEXIT_Pos 1 /*!< SCB SCR: SLEEPONEXIT Position */ -#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ - -/* SCB Configuration Control Register Definitions */ -#define SCB_CCR_BP_Pos 18 /*!< SCB CCR: Branch prediction enable bit Position */ -#define SCB_CCR_BP_Msk (1UL << SCB_CCR_BP_Pos) /*!< SCB CCR: Branch prediction enable bit Mask */ - -#define SCB_CCR_IC_Pos 17 /*!< SCB CCR: Instruction cache enable bit Position */ -#define SCB_CCR_IC_Msk (1UL << SCB_CCR_IC_Pos) /*!< SCB CCR: Instruction cache enable bit Mask */ - -#define SCB_CCR_DC_Pos 16 /*!< SCB CCR: Cache enable bit Position */ -#define SCB_CCR_DC_Msk (1UL << SCB_CCR_DC_Pos) /*!< SCB CCR: Cache enable bit Mask */ - -#define SCB_CCR_STKALIGN_Pos 9 /*!< SCB CCR: STKALIGN Position */ -#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */ - -#define SCB_CCR_BFHFNMIGN_Pos 8 /*!< SCB CCR: BFHFNMIGN Position */ -#define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos) /*!< SCB CCR: BFHFNMIGN Mask */ - -#define SCB_CCR_DIV_0_TRP_Pos 4 /*!< SCB CCR: DIV_0_TRP Position */ -#define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos) /*!< SCB CCR: DIV_0_TRP Mask */ - -#define SCB_CCR_UNALIGN_TRP_Pos 3 /*!< SCB CCR: UNALIGN_TRP Position */ -#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ - -#define SCB_CCR_USERSETMPEND_Pos 1 /*!< SCB CCR: USERSETMPEND Position */ -#define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos) /*!< SCB CCR: USERSETMPEND Mask */ - -#define SCB_CCR_NONBASETHRDENA_Pos 0 /*!< SCB CCR: NONBASETHRDENA Position */ -#define SCB_CCR_NONBASETHRDENA_Msk (1UL /*<< SCB_CCR_NONBASETHRDENA_Pos*/) /*!< SCB CCR: NONBASETHRDENA Mask */ - -/* SCB System Handler Control and State Register Definitions */ -#define SCB_SHCSR_USGFAULTENA_Pos 18 /*!< SCB SHCSR: USGFAULTENA Position */ -#define SCB_SHCSR_USGFAULTENA_Msk (1UL << SCB_SHCSR_USGFAULTENA_Pos) /*!< SCB SHCSR: USGFAULTENA Mask */ - -#define SCB_SHCSR_BUSFAULTENA_Pos 17 /*!< SCB SHCSR: BUSFAULTENA Position */ -#define SCB_SHCSR_BUSFAULTENA_Msk (1UL << SCB_SHCSR_BUSFAULTENA_Pos) /*!< SCB SHCSR: BUSFAULTENA Mask */ - -#define SCB_SHCSR_MEMFAULTENA_Pos 16 /*!< SCB SHCSR: MEMFAULTENA Position */ -#define SCB_SHCSR_MEMFAULTENA_Msk (1UL << SCB_SHCSR_MEMFAULTENA_Pos) /*!< SCB SHCSR: MEMFAULTENA Mask */ - -#define SCB_SHCSR_SVCALLPENDED_Pos 15 /*!< SCB SHCSR: SVCALLPENDED Position */ -#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ - -#define SCB_SHCSR_BUSFAULTPENDED_Pos 14 /*!< SCB SHCSR: BUSFAULTPENDED Position */ -#define SCB_SHCSR_BUSFAULTPENDED_Msk (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos) /*!< SCB SHCSR: BUSFAULTPENDED Mask */ - -#define SCB_SHCSR_MEMFAULTPENDED_Pos 13 /*!< SCB SHCSR: MEMFAULTPENDED Position */ -#define SCB_SHCSR_MEMFAULTPENDED_Msk (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos) /*!< SCB SHCSR: MEMFAULTPENDED Mask */ - -#define SCB_SHCSR_USGFAULTPENDED_Pos 12 /*!< SCB SHCSR: USGFAULTPENDED Position */ -#define SCB_SHCSR_USGFAULTPENDED_Msk (1UL << SCB_SHCSR_USGFAULTPENDED_Pos) /*!< SCB SHCSR: USGFAULTPENDED Mask */ - -#define SCB_SHCSR_SYSTICKACT_Pos 11 /*!< SCB SHCSR: SYSTICKACT Position */ -#define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos) /*!< SCB SHCSR: SYSTICKACT Mask */ - -#define SCB_SHCSR_PENDSVACT_Pos 10 /*!< SCB SHCSR: PENDSVACT Position */ -#define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos) /*!< SCB SHCSR: PENDSVACT Mask */ - -#define SCB_SHCSR_MONITORACT_Pos 8 /*!< SCB SHCSR: MONITORACT Position */ -#define SCB_SHCSR_MONITORACT_Msk (1UL << SCB_SHCSR_MONITORACT_Pos) /*!< SCB SHCSR: MONITORACT Mask */ - -#define SCB_SHCSR_SVCALLACT_Pos 7 /*!< SCB SHCSR: SVCALLACT Position */ -#define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos) /*!< SCB SHCSR: SVCALLACT Mask */ - -#define SCB_SHCSR_USGFAULTACT_Pos 3 /*!< SCB SHCSR: USGFAULTACT Position */ -#define SCB_SHCSR_USGFAULTACT_Msk (1UL << SCB_SHCSR_USGFAULTACT_Pos) /*!< SCB SHCSR: USGFAULTACT Mask */ - -#define SCB_SHCSR_BUSFAULTACT_Pos 1 /*!< SCB SHCSR: BUSFAULTACT Position */ -#define SCB_SHCSR_BUSFAULTACT_Msk (1UL << SCB_SHCSR_BUSFAULTACT_Pos) /*!< SCB SHCSR: BUSFAULTACT Mask */ - -#define SCB_SHCSR_MEMFAULTACT_Pos 0 /*!< SCB SHCSR: MEMFAULTACT Position */ -#define SCB_SHCSR_MEMFAULTACT_Msk (1UL /*<< SCB_SHCSR_MEMFAULTACT_Pos*/) /*!< SCB SHCSR: MEMFAULTACT Mask */ - -/* SCB Configurable Fault Status Registers Definitions */ -#define SCB_CFSR_USGFAULTSR_Pos 16 /*!< SCB CFSR: Usage Fault Status Register Position */ -#define SCB_CFSR_USGFAULTSR_Msk (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos) /*!< SCB CFSR: Usage Fault Status Register Mask */ - -#define SCB_CFSR_BUSFAULTSR_Pos 8 /*!< SCB CFSR: Bus Fault Status Register Position */ -#define SCB_CFSR_BUSFAULTSR_Msk (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos) /*!< SCB CFSR: Bus Fault Status Register Mask */ - -#define SCB_CFSR_MEMFAULTSR_Pos 0 /*!< SCB CFSR: Memory Manage Fault Status Register Position */ -#define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */ - -/* SCB Hard Fault Status Registers Definitions */ -#define SCB_HFSR_DEBUGEVT_Pos 31 /*!< SCB HFSR: DEBUGEVT Position */ -#define SCB_HFSR_DEBUGEVT_Msk (1UL << SCB_HFSR_DEBUGEVT_Pos) /*!< SCB HFSR: DEBUGEVT Mask */ - -#define SCB_HFSR_FORCED_Pos 30 /*!< SCB HFSR: FORCED Position */ -#define SCB_HFSR_FORCED_Msk (1UL << SCB_HFSR_FORCED_Pos) /*!< SCB HFSR: FORCED Mask */ - -#define SCB_HFSR_VECTTBL_Pos 1 /*!< SCB HFSR: VECTTBL Position */ -#define SCB_HFSR_VECTTBL_Msk (1UL << SCB_HFSR_VECTTBL_Pos) /*!< SCB HFSR: VECTTBL Mask */ - -/* SCB Debug Fault Status Register Definitions */ -#define SCB_DFSR_EXTERNAL_Pos 4 /*!< SCB DFSR: EXTERNAL Position */ -#define SCB_DFSR_EXTERNAL_Msk (1UL << SCB_DFSR_EXTERNAL_Pos) /*!< SCB DFSR: EXTERNAL Mask */ - -#define SCB_DFSR_VCATCH_Pos 3 /*!< SCB DFSR: VCATCH Position */ -#define SCB_DFSR_VCATCH_Msk (1UL << SCB_DFSR_VCATCH_Pos) /*!< SCB DFSR: VCATCH Mask */ - -#define SCB_DFSR_DWTTRAP_Pos 2 /*!< SCB DFSR: DWTTRAP Position */ -#define SCB_DFSR_DWTTRAP_Msk (1UL << SCB_DFSR_DWTTRAP_Pos) /*!< SCB DFSR: DWTTRAP Mask */ - -#define SCB_DFSR_BKPT_Pos 1 /*!< SCB DFSR: BKPT Position */ -#define SCB_DFSR_BKPT_Msk (1UL << SCB_DFSR_BKPT_Pos) /*!< SCB DFSR: BKPT Mask */ - -#define SCB_DFSR_HALTED_Pos 0 /*!< SCB DFSR: HALTED Position */ -#define SCB_DFSR_HALTED_Msk (1UL /*<< SCB_DFSR_HALTED_Pos*/) /*!< SCB DFSR: HALTED Mask */ - -/* Cache Level ID register */ -#define SCB_CLIDR_LOUU_Pos 27 /*!< SCB CLIDR: LoUU Position */ -#define SCB_CLIDR_LOUU_Msk (7UL << SCB_CLIDR_LOUU_Pos) /*!< SCB CLIDR: LoUU Mask */ - -#define SCB_CLIDR_LOC_Pos 24 /*!< SCB CLIDR: LoC Position */ -#define SCB_CLIDR_LOC_Msk (7UL << SCB_CLIDR_FORMAT_Pos) /*!< SCB CLIDR: LoC Mask */ - -/* Cache Type register */ -#define SCB_CTR_FORMAT_Pos 29 /*!< SCB CTR: Format Position */ -#define SCB_CTR_FORMAT_Msk (7UL << SCB_CTR_FORMAT_Pos) /*!< SCB CTR: Format Mask */ - -#define SCB_CTR_CWG_Pos 24 /*!< SCB CTR: CWG Position */ -#define SCB_CTR_CWG_Msk (0xFUL << SCB_CTR_CWG_Pos) /*!< SCB CTR: CWG Mask */ - -#define SCB_CTR_ERG_Pos 20 /*!< SCB CTR: ERG Position */ -#define SCB_CTR_ERG_Msk (0xFUL << SCB_CTR_ERG_Pos) /*!< SCB CTR: ERG Mask */ - -#define SCB_CTR_DMINLINE_Pos 16 /*!< SCB CTR: DminLine Position */ -#define SCB_CTR_DMINLINE_Msk (0xFUL << SCB_CTR_DMINLINE_Pos) /*!< SCB CTR: DminLine Mask */ - -#define SCB_CTR_IMINLINE_Pos 0 /*!< SCB CTR: ImInLine Position */ -#define SCB_CTR_IMINLINE_Msk (0xFUL /*<< SCB_CTR_IMINLINE_Pos*/) /*!< SCB CTR: ImInLine Mask */ - -/* Cache Size ID Register */ -#define SCB_CCSIDR_WT_Pos 31 /*!< SCB CCSIDR: WT Position */ -#define SCB_CCSIDR_WT_Msk (7UL << SCB_CCSIDR_WT_Pos) /*!< SCB CCSIDR: WT Mask */ - -#define SCB_CCSIDR_WB_Pos 30 /*!< SCB CCSIDR: WB Position */ -#define SCB_CCSIDR_WB_Msk (7UL << SCB_CCSIDR_WB_Pos) /*!< SCB CCSIDR: WB Mask */ - -#define SCB_CCSIDR_RA_Pos 29 /*!< SCB CCSIDR: RA Position */ -#define SCB_CCSIDR_RA_Msk (7UL << SCB_CCSIDR_RA_Pos) /*!< SCB CCSIDR: RA Mask */ - -#define SCB_CCSIDR_WA_Pos 28 /*!< SCB CCSIDR: WA Position */ -#define SCB_CCSIDR_WA_Msk (7UL << SCB_CCSIDR_WA_Pos) /*!< SCB CCSIDR: WA Mask */ - -#define SCB_CCSIDR_NUMSETS_Pos 13 /*!< SCB CCSIDR: NumSets Position */ -#define SCB_CCSIDR_NUMSETS_Msk (0x7FFFUL << SCB_CCSIDR_NUMSETS_Pos) /*!< SCB CCSIDR: NumSets Mask */ - -#define SCB_CCSIDR_ASSOCIATIVITY_Pos 3 /*!< SCB CCSIDR: Associativity Position */ -#define SCB_CCSIDR_ASSOCIATIVITY_Msk (0x3FFUL << SCB_CCSIDR_ASSOCIATIVITY_Pos) /*!< SCB CCSIDR: Associativity Mask */ - -#define SCB_CCSIDR_LINESIZE_Pos 0 /*!< SCB CCSIDR: LineSize Position */ -#define SCB_CCSIDR_LINESIZE_Msk (7UL /*<< SCB_CCSIDR_LINESIZE_Pos*/) /*!< SCB CCSIDR: LineSize Mask */ - -/* Cache Size Selection Register */ -#define SCB_CSSELR_LEVEL_Pos 1 /*!< SCB CSSELR: Level Position */ -#define SCB_CSSELR_LEVEL_Msk (7UL << SCB_CSSELR_LEVEL_Pos) /*!< SCB CSSELR: Level Mask */ - -#define SCB_CSSELR_IND_Pos 0 /*!< SCB CSSELR: InD Position */ -#define SCB_CSSELR_IND_Msk (1UL /*<< SCB_CSSELR_IND_Pos*/) /*!< SCB CSSELR: InD Mask */ - -/* SCB Software Triggered Interrupt Register */ -#define SCB_STIR_INTID_Pos 0 /*!< SCB STIR: INTID Position */ -#define SCB_STIR_INTID_Msk (0x1FFUL /*<< SCB_STIR_INTID_Pos*/) /*!< SCB STIR: INTID Mask */ - -/* Instruction Tightly-Coupled Memory Control Register*/ -#define SCB_ITCMCR_SZ_Pos 3 /*!< SCB ITCMCR: SZ Position */ -#define SCB_ITCMCR_SZ_Msk (0xFUL << SCB_ITCMCR_SZ_Pos) /*!< SCB ITCMCR: SZ Mask */ - -#define SCB_ITCMCR_RETEN_Pos 2 /*!< SCB ITCMCR: RETEN Position */ -#define SCB_ITCMCR_RETEN_Msk (1UL << SCB_ITCMCR_RETEN_Pos) /*!< SCB ITCMCR: RETEN Mask */ - -#define SCB_ITCMCR_RMW_Pos 1 /*!< SCB ITCMCR: RMW Position */ -#define SCB_ITCMCR_RMW_Msk (1UL << SCB_ITCMCR_RMW_Pos) /*!< SCB ITCMCR: RMW Mask */ - -#define SCB_ITCMCR_EN_Pos 0 /*!< SCB ITCMCR: EN Position */ -#define SCB_ITCMCR_EN_Msk (1UL /*<< SCB_ITCMCR_EN_Pos*/) /*!< SCB ITCMCR: EN Mask */ - -/* Data Tightly-Coupled Memory Control Registers */ -#define SCB_DTCMCR_SZ_Pos 3 /*!< SCB DTCMCR: SZ Position */ -#define SCB_DTCMCR_SZ_Msk (0xFUL << SCB_DTCMCR_SZ_Pos) /*!< SCB DTCMCR: SZ Mask */ - -#define SCB_DTCMCR_RETEN_Pos 2 /*!< SCB DTCMCR: RETEN Position */ -#define SCB_DTCMCR_RETEN_Msk (1UL << SCB_DTCMCR_RETEN_Pos) /*!< SCB DTCMCR: RETEN Mask */ - -#define SCB_DTCMCR_RMW_Pos 1 /*!< SCB DTCMCR: RMW Position */ -#define SCB_DTCMCR_RMW_Msk (1UL << SCB_DTCMCR_RMW_Pos) /*!< SCB DTCMCR: RMW Mask */ - -#define SCB_DTCMCR_EN_Pos 0 /*!< SCB DTCMCR: EN Position */ -#define SCB_DTCMCR_EN_Msk (1UL /*<< SCB_DTCMCR_EN_Pos*/) /*!< SCB DTCMCR: EN Mask */ - -/* AHBP Control Register */ -#define SCB_AHBPCR_SZ_Pos 1 /*!< SCB AHBPCR: SZ Position */ -#define SCB_AHBPCR_SZ_Msk (7UL << SCB_AHBPCR_SZ_Pos) /*!< SCB AHBPCR: SZ Mask */ - -#define SCB_AHBPCR_EN_Pos 0 /*!< SCB AHBPCR: EN Position */ -#define SCB_AHBPCR_EN_Msk (1UL /*<< SCB_AHBPCR_EN_Pos*/) /*!< SCB AHBPCR: EN Mask */ - -/* L1 Cache Control Register */ -#define SCB_CACR_FORCEWT_Pos 2 /*!< SCB CACR: FORCEWT Position */ -#define SCB_CACR_FORCEWT_Msk (1UL << SCB_CACR_FORCEWT_Pos) /*!< SCB CACR: FORCEWT Mask */ - -#define SCB_CACR_ECCEN_Pos 1 /*!< SCB CACR: ECCEN Position */ -#define SCB_CACR_ECCEN_Msk (1UL << SCB_CACR_ECCEN_Pos) /*!< SCB CACR: ECCEN Mask */ - -#define SCB_CACR_SIWT_Pos 0 /*!< SCB CACR: SIWT Position */ -#define SCB_CACR_SIWT_Msk (1UL /*<< SCB_CACR_SIWT_Pos*/) /*!< SCB CACR: SIWT Mask */ - -/* AHBS control register */ -#define SCB_AHBSCR_INITCOUNT_Pos 11 /*!< SCB AHBSCR: INITCOUNT Position */ -#define SCB_AHBSCR_INITCOUNT_Msk (0x1FUL << SCB_AHBPCR_INITCOUNT_Pos) /*!< SCB AHBSCR: INITCOUNT Mask */ - -#define SCB_AHBSCR_TPRI_Pos 2 /*!< SCB AHBSCR: TPRI Position */ -#define SCB_AHBSCR_TPRI_Msk (0x1FFUL << SCB_AHBPCR_TPRI_Pos) /*!< SCB AHBSCR: TPRI Mask */ - -#define SCB_AHBSCR_CTL_Pos 0 /*!< SCB AHBSCR: CTL Position*/ -#define SCB_AHBSCR_CTL_Msk (3UL /*<< SCB_AHBPCR_CTL_Pos*/) /*!< SCB AHBSCR: CTL Mask */ - -/* Auxiliary Bus Fault Status Register */ -#define SCB_ABFSR_AXIMTYPE_Pos 8 /*!< SCB ABFSR: AXIMTYPE Position*/ -#define SCB_ABFSR_AXIMTYPE_Msk (3UL << SCB_ABFSR_AXIMTYPE_Pos) /*!< SCB ABFSR: AXIMTYPE Mask */ - -#define SCB_ABFSR_EPPB_Pos 4 /*!< SCB ABFSR: EPPB Position*/ -#define SCB_ABFSR_EPPB_Msk (1UL << SCB_ABFSR_EPPB_Pos) /*!< SCB ABFSR: EPPB Mask */ - -#define SCB_ABFSR_AXIM_Pos 3 /*!< SCB ABFSR: AXIM Position*/ -#define SCB_ABFSR_AXIM_Msk (1UL << SCB_ABFSR_AXIM_Pos) /*!< SCB ABFSR: AXIM Mask */ - -#define SCB_ABFSR_AHBP_Pos 2 /*!< SCB ABFSR: AHBP Position*/ -#define SCB_ABFSR_AHBP_Msk (1UL << SCB_ABFSR_AHBP_Pos) /*!< SCB ABFSR: AHBP Mask */ - -#define SCB_ABFSR_DTCM_Pos 1 /*!< SCB ABFSR: DTCM Position*/ -#define SCB_ABFSR_DTCM_Msk (1UL << SCB_ABFSR_DTCM_Pos) /*!< SCB ABFSR: DTCM Mask */ - -#define SCB_ABFSR_ITCM_Pos 0 /*!< SCB ABFSR: ITCM Position*/ -#define SCB_ABFSR_ITCM_Msk (1UL /*<< SCB_ABFSR_ITCM_Pos*/) /*!< SCB ABFSR: ITCM Mask */ - -/*@} end of group CMSIS_SCB */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB) - \brief Type definitions for the System Control and ID Register not in the SCB - @{ - */ - -/** \brief Structure type to access the System Control and ID Register not in the SCB. - */ -typedef struct -{ - uint32_t RESERVED0[1]; - __I uint32_t ICTR; /*!< Offset: 0x004 (R/ ) Interrupt Controller Type Register */ - __IO uint32_t ACTLR; /*!< Offset: 0x008 (R/W) Auxiliary Control Register */ -} SCnSCB_Type; - -/* Interrupt Controller Type Register Definitions */ -#define SCnSCB_ICTR_INTLINESNUM_Pos 0 /*!< ICTR: INTLINESNUM Position */ -#define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL /*<< SCnSCB_ICTR_INTLINESNUM_Pos*/) /*!< ICTR: INTLINESNUM Mask */ - -/* Auxiliary Control Register Definitions */ -#define SCnSCB_ACTLR_DISITMATBFLUSH_Pos 12 /*!< ACTLR: DISITMATBFLUSH Position */ -#define SCnSCB_ACTLR_DISITMATBFLUSH_Msk (1UL << SCnSCB_ACTLR_DISITMATBFLUSH_Pos) /*!< ACTLR: DISITMATBFLUSH Mask */ - -#define SCnSCB_ACTLR_DISRAMODE_Pos 11 /*!< ACTLR: DISRAMODE Position */ -#define SCnSCB_ACTLR_DISRAMODE_Msk (1UL << SCnSCB_ACTLR_DISRAMODE_Pos) /*!< ACTLR: DISRAMODE Mask */ - -#define SCnSCB_ACTLR_FPEXCODIS_Pos 10 /*!< ACTLR: FPEXCODIS Position */ -#define SCnSCB_ACTLR_FPEXCODIS_Msk (1UL << SCnSCB_ACTLR_FPEXCODIS_Pos) /*!< ACTLR: FPEXCODIS Mask */ - -#define SCnSCB_ACTLR_DISFOLD_Pos 2 /*!< ACTLR: DISFOLD Position */ -#define SCnSCB_ACTLR_DISFOLD_Msk (1UL << SCnSCB_ACTLR_DISFOLD_Pos) /*!< ACTLR: DISFOLD Mask */ - -#define SCnSCB_ACTLR_DISMCYCINT_Pos 0 /*!< ACTLR: DISMCYCINT Position */ -#define SCnSCB_ACTLR_DISMCYCINT_Msk (1UL /*<< SCnSCB_ACTLR_DISMCYCINT_Pos*/) /*!< ACTLR: DISMCYCINT Mask */ - -/*@} end of group CMSIS_SCnotSCB */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_SysTick System Tick Timer (SysTick) - \brief Type definitions for the System Timer Registers. - @{ - */ - -/** \brief Structure type to access the System Timer (SysTick). - */ -typedef struct -{ - __IO uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ - __IO uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ - __IO uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ - __I uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ -} SysTick_Type; - -/* SysTick Control / Status Register Definitions */ -#define SysTick_CTRL_COUNTFLAG_Pos 16 /*!< SysTick CTRL: COUNTFLAG Position */ -#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ - -#define SysTick_CTRL_CLKSOURCE_Pos 2 /*!< SysTick CTRL: CLKSOURCE Position */ -#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ - -#define SysTick_CTRL_TICKINT_Pos 1 /*!< SysTick CTRL: TICKINT Position */ -#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ - -#define SysTick_CTRL_ENABLE_Pos 0 /*!< SysTick CTRL: ENABLE Position */ -#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ - -/* SysTick Reload Register Definitions */ -#define SysTick_LOAD_RELOAD_Pos 0 /*!< SysTick LOAD: RELOAD Position */ -#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ - -/* SysTick Current Register Definitions */ -#define SysTick_VAL_CURRENT_Pos 0 /*!< SysTick VAL: CURRENT Position */ -#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ - -/* SysTick Calibration Register Definitions */ -#define SysTick_CALIB_NOREF_Pos 31 /*!< SysTick CALIB: NOREF Position */ -#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ - -#define SysTick_CALIB_SKEW_Pos 30 /*!< SysTick CALIB: SKEW Position */ -#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ - -#define SysTick_CALIB_TENMS_Pos 0 /*!< SysTick CALIB: TENMS Position */ -#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ - -/*@} end of group CMSIS_SysTick */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_ITM Instrumentation Trace Macrocell (ITM) - \brief Type definitions for the Instrumentation Trace Macrocell (ITM) - @{ - */ - -/** \brief Structure type to access the Instrumentation Trace Macrocell Register (ITM). - */ -typedef struct -{ - __O union - { - __O uint8_t u8; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 8-bit */ - __O uint16_t u16; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 16-bit */ - __O uint32_t u32; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 32-bit */ - } PORT [32]; /*!< Offset: 0x000 ( /W) ITM Stimulus Port Registers */ - uint32_t RESERVED0[864]; - __IO uint32_t TER; /*!< Offset: 0xE00 (R/W) ITM Trace Enable Register */ - uint32_t RESERVED1[15]; - __IO uint32_t TPR; /*!< Offset: 0xE40 (R/W) ITM Trace Privilege Register */ - uint32_t RESERVED2[15]; - __IO uint32_t TCR; /*!< Offset: 0xE80 (R/W) ITM Trace Control Register */ - uint32_t RESERVED3[29]; - __O uint32_t IWR; /*!< Offset: 0xEF8 ( /W) ITM Integration Write Register */ - __I uint32_t IRR; /*!< Offset: 0xEFC (R/ ) ITM Integration Read Register */ - __IO uint32_t IMCR; /*!< Offset: 0xF00 (R/W) ITM Integration Mode Control Register */ - uint32_t RESERVED4[43]; - __O uint32_t LAR; /*!< Offset: 0xFB0 ( /W) ITM Lock Access Register */ - __I uint32_t LSR; /*!< Offset: 0xFB4 (R/ ) ITM Lock Status Register */ - uint32_t RESERVED5[6]; - __I uint32_t PID4; /*!< Offset: 0xFD0 (R/ ) ITM Peripheral Identification Register #4 */ - __I uint32_t PID5; /*!< Offset: 0xFD4 (R/ ) ITM Peripheral Identification Register #5 */ - __I uint32_t PID6; /*!< Offset: 0xFD8 (R/ ) ITM Peripheral Identification Register #6 */ - __I uint32_t PID7; /*!< Offset: 0xFDC (R/ ) ITM Peripheral Identification Register #7 */ - __I uint32_t PID0; /*!< Offset: 0xFE0 (R/ ) ITM Peripheral Identification Register #0 */ - __I uint32_t PID1; /*!< Offset: 0xFE4 (R/ ) ITM Peripheral Identification Register #1 */ - __I uint32_t PID2; /*!< Offset: 0xFE8 (R/ ) ITM Peripheral Identification Register #2 */ - __I uint32_t PID3; /*!< Offset: 0xFEC (R/ ) ITM Peripheral Identification Register #3 */ - __I uint32_t CID0; /*!< Offset: 0xFF0 (R/ ) ITM Component Identification Register #0 */ - __I uint32_t CID1; /*!< Offset: 0xFF4 (R/ ) ITM Component Identification Register #1 */ - __I uint32_t CID2; /*!< Offset: 0xFF8 (R/ ) ITM Component Identification Register #2 */ - __I uint32_t CID3; /*!< Offset: 0xFFC (R/ ) ITM Component Identification Register #3 */ -} ITM_Type; - -/* ITM Trace Privilege Register Definitions */ -#define ITM_TPR_PRIVMASK_Pos 0 /*!< ITM TPR: PRIVMASK Position */ -#define ITM_TPR_PRIVMASK_Msk (0xFUL /*<< ITM_TPR_PRIVMASK_Pos*/) /*!< ITM TPR: PRIVMASK Mask */ - -/* ITM Trace Control Register Definitions */ -#define ITM_TCR_BUSY_Pos 23 /*!< ITM TCR: BUSY Position */ -#define ITM_TCR_BUSY_Msk (1UL << ITM_TCR_BUSY_Pos) /*!< ITM TCR: BUSY Mask */ - -#define ITM_TCR_TraceBusID_Pos 16 /*!< ITM TCR: ATBID Position */ -#define ITM_TCR_TraceBusID_Msk (0x7FUL << ITM_TCR_TraceBusID_Pos) /*!< ITM TCR: ATBID Mask */ - -#define ITM_TCR_GTSFREQ_Pos 10 /*!< ITM TCR: Global timestamp frequency Position */ -#define ITM_TCR_GTSFREQ_Msk (3UL << ITM_TCR_GTSFREQ_Pos) /*!< ITM TCR: Global timestamp frequency Mask */ - -#define ITM_TCR_TSPrescale_Pos 8 /*!< ITM TCR: TSPrescale Position */ -#define ITM_TCR_TSPrescale_Msk (3UL << ITM_TCR_TSPrescale_Pos) /*!< ITM TCR: TSPrescale Mask */ - -#define ITM_TCR_SWOENA_Pos 4 /*!< ITM TCR: SWOENA Position */ -#define ITM_TCR_SWOENA_Msk (1UL << ITM_TCR_SWOENA_Pos) /*!< ITM TCR: SWOENA Mask */ - -#define ITM_TCR_DWTENA_Pos 3 /*!< ITM TCR: DWTENA Position */ -#define ITM_TCR_DWTENA_Msk (1UL << ITM_TCR_DWTENA_Pos) /*!< ITM TCR: DWTENA Mask */ - -#define ITM_TCR_SYNCENA_Pos 2 /*!< ITM TCR: SYNCENA Position */ -#define ITM_TCR_SYNCENA_Msk (1UL << ITM_TCR_SYNCENA_Pos) /*!< ITM TCR: SYNCENA Mask */ - -#define ITM_TCR_TSENA_Pos 1 /*!< ITM TCR: TSENA Position */ -#define ITM_TCR_TSENA_Msk (1UL << ITM_TCR_TSENA_Pos) /*!< ITM TCR: TSENA Mask */ - -#define ITM_TCR_ITMENA_Pos 0 /*!< ITM TCR: ITM Enable bit Position */ -#define ITM_TCR_ITMENA_Msk (1UL /*<< ITM_TCR_ITMENA_Pos*/) /*!< ITM TCR: ITM Enable bit Mask */ - -/* ITM Integration Write Register Definitions */ -#define ITM_IWR_ATVALIDM_Pos 0 /*!< ITM IWR: ATVALIDM Position */ -#define ITM_IWR_ATVALIDM_Msk (1UL /*<< ITM_IWR_ATVALIDM_Pos*/) /*!< ITM IWR: ATVALIDM Mask */ - -/* ITM Integration Read Register Definitions */ -#define ITM_IRR_ATREADYM_Pos 0 /*!< ITM IRR: ATREADYM Position */ -#define ITM_IRR_ATREADYM_Msk (1UL /*<< ITM_IRR_ATREADYM_Pos*/) /*!< ITM IRR: ATREADYM Mask */ - -/* ITM Integration Mode Control Register Definitions */ -#define ITM_IMCR_INTEGRATION_Pos 0 /*!< ITM IMCR: INTEGRATION Position */ -#define ITM_IMCR_INTEGRATION_Msk (1UL /*<< ITM_IMCR_INTEGRATION_Pos*/) /*!< ITM IMCR: INTEGRATION Mask */ - -/* ITM Lock Status Register Definitions */ -#define ITM_LSR_ByteAcc_Pos 2 /*!< ITM LSR: ByteAcc Position */ -#define ITM_LSR_ByteAcc_Msk (1UL << ITM_LSR_ByteAcc_Pos) /*!< ITM LSR: ByteAcc Mask */ - -#define ITM_LSR_Access_Pos 1 /*!< ITM LSR: Access Position */ -#define ITM_LSR_Access_Msk (1UL << ITM_LSR_Access_Pos) /*!< ITM LSR: Access Mask */ - -#define ITM_LSR_Present_Pos 0 /*!< ITM LSR: Present Position */ -#define ITM_LSR_Present_Msk (1UL /*<< ITM_LSR_Present_Pos*/) /*!< ITM LSR: Present Mask */ - -/*@}*/ /* end of group CMSIS_ITM */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_DWT Data Watchpoint and Trace (DWT) - \brief Type definitions for the Data Watchpoint and Trace (DWT) - @{ - */ - -/** \brief Structure type to access the Data Watchpoint and Trace Register (DWT). - */ -typedef struct -{ - __IO uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */ - __IO uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */ - __IO uint32_t CPICNT; /*!< Offset: 0x008 (R/W) CPI Count Register */ - __IO uint32_t EXCCNT; /*!< Offset: 0x00C (R/W) Exception Overhead Count Register */ - __IO uint32_t SLEEPCNT; /*!< Offset: 0x010 (R/W) Sleep Count Register */ - __IO uint32_t LSUCNT; /*!< Offset: 0x014 (R/W) LSU Count Register */ - __IO uint32_t FOLDCNT; /*!< Offset: 0x018 (R/W) Folded-instruction Count Register */ - __I uint32_t PCSR; /*!< Offset: 0x01C (R/ ) Program Counter Sample Register */ - __IO uint32_t COMP0; /*!< Offset: 0x020 (R/W) Comparator Register 0 */ - __IO uint32_t MASK0; /*!< Offset: 0x024 (R/W) Mask Register 0 */ - __IO uint32_t FUNCTION0; /*!< Offset: 0x028 (R/W) Function Register 0 */ - uint32_t RESERVED0[1]; - __IO uint32_t COMP1; /*!< Offset: 0x030 (R/W) Comparator Register 1 */ - __IO uint32_t MASK1; /*!< Offset: 0x034 (R/W) Mask Register 1 */ - __IO uint32_t FUNCTION1; /*!< Offset: 0x038 (R/W) Function Register 1 */ - uint32_t RESERVED1[1]; - __IO uint32_t COMP2; /*!< Offset: 0x040 (R/W) Comparator Register 2 */ - __IO uint32_t MASK2; /*!< Offset: 0x044 (R/W) Mask Register 2 */ - __IO uint32_t FUNCTION2; /*!< Offset: 0x048 (R/W) Function Register 2 */ - uint32_t RESERVED2[1]; - __IO uint32_t COMP3; /*!< Offset: 0x050 (R/W) Comparator Register 3 */ - __IO uint32_t MASK3; /*!< Offset: 0x054 (R/W) Mask Register 3 */ - __IO uint32_t FUNCTION3; /*!< Offset: 0x058 (R/W) Function Register 3 */ - uint32_t RESERVED3[981]; - __O uint32_t LAR; /*!< Offset: 0xFB0 ( W) Lock Access Register */ - __I uint32_t LSR; /*!< Offset: 0xFB4 (R ) Lock Status Register */ -} DWT_Type; - -/* DWT Control Register Definitions */ -#define DWT_CTRL_NUMCOMP_Pos 28 /*!< DWT CTRL: NUMCOMP Position */ -#define DWT_CTRL_NUMCOMP_Msk (0xFUL << DWT_CTRL_NUMCOMP_Pos) /*!< DWT CTRL: NUMCOMP Mask */ - -#define DWT_CTRL_NOTRCPKT_Pos 27 /*!< DWT CTRL: NOTRCPKT Position */ -#define DWT_CTRL_NOTRCPKT_Msk (0x1UL << DWT_CTRL_NOTRCPKT_Pos) /*!< DWT CTRL: NOTRCPKT Mask */ - -#define DWT_CTRL_NOEXTTRIG_Pos 26 /*!< DWT CTRL: NOEXTTRIG Position */ -#define DWT_CTRL_NOEXTTRIG_Msk (0x1UL << DWT_CTRL_NOEXTTRIG_Pos) /*!< DWT CTRL: NOEXTTRIG Mask */ - -#define DWT_CTRL_NOCYCCNT_Pos 25 /*!< DWT CTRL: NOCYCCNT Position */ -#define DWT_CTRL_NOCYCCNT_Msk (0x1UL << DWT_CTRL_NOCYCCNT_Pos) /*!< DWT CTRL: NOCYCCNT Mask */ - -#define DWT_CTRL_NOPRFCNT_Pos 24 /*!< DWT CTRL: NOPRFCNT Position */ -#define DWT_CTRL_NOPRFCNT_Msk (0x1UL << DWT_CTRL_NOPRFCNT_Pos) /*!< DWT CTRL: NOPRFCNT Mask */ - -#define DWT_CTRL_CYCEVTENA_Pos 22 /*!< DWT CTRL: CYCEVTENA Position */ -#define DWT_CTRL_CYCEVTENA_Msk (0x1UL << DWT_CTRL_CYCEVTENA_Pos) /*!< DWT CTRL: CYCEVTENA Mask */ - -#define DWT_CTRL_FOLDEVTENA_Pos 21 /*!< DWT CTRL: FOLDEVTENA Position */ -#define DWT_CTRL_FOLDEVTENA_Msk (0x1UL << DWT_CTRL_FOLDEVTENA_Pos) /*!< DWT CTRL: FOLDEVTENA Mask */ - -#define DWT_CTRL_LSUEVTENA_Pos 20 /*!< DWT CTRL: LSUEVTENA Position */ -#define DWT_CTRL_LSUEVTENA_Msk (0x1UL << DWT_CTRL_LSUEVTENA_Pos) /*!< DWT CTRL: LSUEVTENA Mask */ - -#define DWT_CTRL_SLEEPEVTENA_Pos 19 /*!< DWT CTRL: SLEEPEVTENA Position */ -#define DWT_CTRL_SLEEPEVTENA_Msk (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos) /*!< DWT CTRL: SLEEPEVTENA Mask */ - -#define DWT_CTRL_EXCEVTENA_Pos 18 /*!< DWT CTRL: EXCEVTENA Position */ -#define DWT_CTRL_EXCEVTENA_Msk (0x1UL << DWT_CTRL_EXCEVTENA_Pos) /*!< DWT CTRL: EXCEVTENA Mask */ - -#define DWT_CTRL_CPIEVTENA_Pos 17 /*!< DWT CTRL: CPIEVTENA Position */ -#define DWT_CTRL_CPIEVTENA_Msk (0x1UL << DWT_CTRL_CPIEVTENA_Pos) /*!< DWT CTRL: CPIEVTENA Mask */ - -#define DWT_CTRL_EXCTRCENA_Pos 16 /*!< DWT CTRL: EXCTRCENA Position */ -#define DWT_CTRL_EXCTRCENA_Msk (0x1UL << DWT_CTRL_EXCTRCENA_Pos) /*!< DWT CTRL: EXCTRCENA Mask */ - -#define DWT_CTRL_PCSAMPLENA_Pos 12 /*!< DWT CTRL: PCSAMPLENA Position */ -#define DWT_CTRL_PCSAMPLENA_Msk (0x1UL << DWT_CTRL_PCSAMPLENA_Pos) /*!< DWT CTRL: PCSAMPLENA Mask */ - -#define DWT_CTRL_SYNCTAP_Pos 10 /*!< DWT CTRL: SYNCTAP Position */ -#define DWT_CTRL_SYNCTAP_Msk (0x3UL << DWT_CTRL_SYNCTAP_Pos) /*!< DWT CTRL: SYNCTAP Mask */ - -#define DWT_CTRL_CYCTAP_Pos 9 /*!< DWT CTRL: CYCTAP Position */ -#define DWT_CTRL_CYCTAP_Msk (0x1UL << DWT_CTRL_CYCTAP_Pos) /*!< DWT CTRL: CYCTAP Mask */ - -#define DWT_CTRL_POSTINIT_Pos 5 /*!< DWT CTRL: POSTINIT Position */ -#define DWT_CTRL_POSTINIT_Msk (0xFUL << DWT_CTRL_POSTINIT_Pos) /*!< DWT CTRL: POSTINIT Mask */ - -#define DWT_CTRL_POSTPRESET_Pos 1 /*!< DWT CTRL: POSTPRESET Position */ -#define DWT_CTRL_POSTPRESET_Msk (0xFUL << DWT_CTRL_POSTPRESET_Pos) /*!< DWT CTRL: POSTPRESET Mask */ - -#define DWT_CTRL_CYCCNTENA_Pos 0 /*!< DWT CTRL: CYCCNTENA Position */ -#define DWT_CTRL_CYCCNTENA_Msk (0x1UL /*<< DWT_CTRL_CYCCNTENA_Pos*/) /*!< DWT CTRL: CYCCNTENA Mask */ - -/* DWT CPI Count Register Definitions */ -#define DWT_CPICNT_CPICNT_Pos 0 /*!< DWT CPICNT: CPICNT Position */ -#define DWT_CPICNT_CPICNT_Msk (0xFFUL /*<< DWT_CPICNT_CPICNT_Pos*/) /*!< DWT CPICNT: CPICNT Mask */ - -/* DWT Exception Overhead Count Register Definitions */ -#define DWT_EXCCNT_EXCCNT_Pos 0 /*!< DWT EXCCNT: EXCCNT Position */ -#define DWT_EXCCNT_EXCCNT_Msk (0xFFUL /*<< DWT_EXCCNT_EXCCNT_Pos*/) /*!< DWT EXCCNT: EXCCNT Mask */ - -/* DWT Sleep Count Register Definitions */ -#define DWT_SLEEPCNT_SLEEPCNT_Pos 0 /*!< DWT SLEEPCNT: SLEEPCNT Position */ -#define DWT_SLEEPCNT_SLEEPCNT_Msk (0xFFUL /*<< DWT_SLEEPCNT_SLEEPCNT_Pos*/) /*!< DWT SLEEPCNT: SLEEPCNT Mask */ - -/* DWT LSU Count Register Definitions */ -#define DWT_LSUCNT_LSUCNT_Pos 0 /*!< DWT LSUCNT: LSUCNT Position */ -#define DWT_LSUCNT_LSUCNT_Msk (0xFFUL /*<< DWT_LSUCNT_LSUCNT_Pos*/) /*!< DWT LSUCNT: LSUCNT Mask */ - -/* DWT Folded-instruction Count Register Definitions */ -#define DWT_FOLDCNT_FOLDCNT_Pos 0 /*!< DWT FOLDCNT: FOLDCNT Position */ -#define DWT_FOLDCNT_FOLDCNT_Msk (0xFFUL /*<< DWT_FOLDCNT_FOLDCNT_Pos*/) /*!< DWT FOLDCNT: FOLDCNT Mask */ - -/* DWT Comparator Mask Register Definitions */ -#define DWT_MASK_MASK_Pos 0 /*!< DWT MASK: MASK Position */ -#define DWT_MASK_MASK_Msk (0x1FUL /*<< DWT_MASK_MASK_Pos*/) /*!< DWT MASK: MASK Mask */ - -/* DWT Comparator Function Register Definitions */ -#define DWT_FUNCTION_MATCHED_Pos 24 /*!< DWT FUNCTION: MATCHED Position */ -#define DWT_FUNCTION_MATCHED_Msk (0x1UL << DWT_FUNCTION_MATCHED_Pos) /*!< DWT FUNCTION: MATCHED Mask */ - -#define DWT_FUNCTION_DATAVADDR1_Pos 16 /*!< DWT FUNCTION: DATAVADDR1 Position */ -#define DWT_FUNCTION_DATAVADDR1_Msk (0xFUL << DWT_FUNCTION_DATAVADDR1_Pos) /*!< DWT FUNCTION: DATAVADDR1 Mask */ - -#define DWT_FUNCTION_DATAVADDR0_Pos 12 /*!< DWT FUNCTION: DATAVADDR0 Position */ -#define DWT_FUNCTION_DATAVADDR0_Msk (0xFUL << DWT_FUNCTION_DATAVADDR0_Pos) /*!< DWT FUNCTION: DATAVADDR0 Mask */ - -#define DWT_FUNCTION_DATAVSIZE_Pos 10 /*!< DWT FUNCTION: DATAVSIZE Position */ -#define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos) /*!< DWT FUNCTION: DATAVSIZE Mask */ - -#define DWT_FUNCTION_LNK1ENA_Pos 9 /*!< DWT FUNCTION: LNK1ENA Position */ -#define DWT_FUNCTION_LNK1ENA_Msk (0x1UL << DWT_FUNCTION_LNK1ENA_Pos) /*!< DWT FUNCTION: LNK1ENA Mask */ - -#define DWT_FUNCTION_DATAVMATCH_Pos 8 /*!< DWT FUNCTION: DATAVMATCH Position */ -#define DWT_FUNCTION_DATAVMATCH_Msk (0x1UL << DWT_FUNCTION_DATAVMATCH_Pos) /*!< DWT FUNCTION: DATAVMATCH Mask */ - -#define DWT_FUNCTION_CYCMATCH_Pos 7 /*!< DWT FUNCTION: CYCMATCH Position */ -#define DWT_FUNCTION_CYCMATCH_Msk (0x1UL << DWT_FUNCTION_CYCMATCH_Pos) /*!< DWT FUNCTION: CYCMATCH Mask */ - -#define DWT_FUNCTION_EMITRANGE_Pos 5 /*!< DWT FUNCTION: EMITRANGE Position */ -#define DWT_FUNCTION_EMITRANGE_Msk (0x1UL << DWT_FUNCTION_EMITRANGE_Pos) /*!< DWT FUNCTION: EMITRANGE Mask */ - -#define DWT_FUNCTION_FUNCTION_Pos 0 /*!< DWT FUNCTION: FUNCTION Position */ -#define DWT_FUNCTION_FUNCTION_Msk (0xFUL /*<< DWT_FUNCTION_FUNCTION_Pos*/) /*!< DWT FUNCTION: FUNCTION Mask */ - -/*@}*/ /* end of group CMSIS_DWT */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_TPI Trace Port Interface (TPI) - \brief Type definitions for the Trace Port Interface (TPI) - @{ - */ - -/** \brief Structure type to access the Trace Port Interface Register (TPI). - */ -typedef struct -{ - __IO uint32_t SSPSR; /*!< Offset: 0x000 (R/ ) Supported Parallel Port Size Register */ - __IO uint32_t CSPSR; /*!< Offset: 0x004 (R/W) Current Parallel Port Size Register */ - uint32_t RESERVED0[2]; - __IO uint32_t ACPR; /*!< Offset: 0x010 (R/W) Asynchronous Clock Prescaler Register */ - uint32_t RESERVED1[55]; - __IO uint32_t SPPR; /*!< Offset: 0x0F0 (R/W) Selected Pin Protocol Register */ - uint32_t RESERVED2[131]; - __I uint32_t FFSR; /*!< Offset: 0x300 (R/ ) Formatter and Flush Status Register */ - __IO uint32_t FFCR; /*!< Offset: 0x304 (R/W) Formatter and Flush Control Register */ - __I uint32_t FSCR; /*!< Offset: 0x308 (R/ ) Formatter Synchronization Counter Register */ - uint32_t RESERVED3[759]; - __I uint32_t TRIGGER; /*!< Offset: 0xEE8 (R/ ) TRIGGER */ - __I uint32_t FIFO0; /*!< Offset: 0xEEC (R/ ) Integration ETM Data */ - __I uint32_t ITATBCTR2; /*!< Offset: 0xEF0 (R/ ) ITATBCTR2 */ - uint32_t RESERVED4[1]; - __I uint32_t ITATBCTR0; /*!< Offset: 0xEF8 (R/ ) ITATBCTR0 */ - __I uint32_t FIFO1; /*!< Offset: 0xEFC (R/ ) Integration ITM Data */ - __IO uint32_t ITCTRL; /*!< Offset: 0xF00 (R/W) Integration Mode Control */ - uint32_t RESERVED5[39]; - __IO uint32_t CLAIMSET; /*!< Offset: 0xFA0 (R/W) Claim tag set */ - __IO uint32_t CLAIMCLR; /*!< Offset: 0xFA4 (R/W) Claim tag clear */ - uint32_t RESERVED7[8]; - __I uint32_t DEVID; /*!< Offset: 0xFC8 (R/ ) TPIU_DEVID */ - __I uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) TPIU_DEVTYPE */ -} TPI_Type; - -/* TPI Asynchronous Clock Prescaler Register Definitions */ -#define TPI_ACPR_PRESCALER_Pos 0 /*!< TPI ACPR: PRESCALER Position */ -#define TPI_ACPR_PRESCALER_Msk (0x1FFFUL /*<< TPI_ACPR_PRESCALER_Pos*/) /*!< TPI ACPR: PRESCALER Mask */ - -/* TPI Selected Pin Protocol Register Definitions */ -#define TPI_SPPR_TXMODE_Pos 0 /*!< TPI SPPR: TXMODE Position */ -#define TPI_SPPR_TXMODE_Msk (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/) /*!< TPI SPPR: TXMODE Mask */ - -/* TPI Formatter and Flush Status Register Definitions */ -#define TPI_FFSR_FtNonStop_Pos 3 /*!< TPI FFSR: FtNonStop Position */ -#define TPI_FFSR_FtNonStop_Msk (0x1UL << TPI_FFSR_FtNonStop_Pos) /*!< TPI FFSR: FtNonStop Mask */ - -#define TPI_FFSR_TCPresent_Pos 2 /*!< TPI FFSR: TCPresent Position */ -#define TPI_FFSR_TCPresent_Msk (0x1UL << TPI_FFSR_TCPresent_Pos) /*!< TPI FFSR: TCPresent Mask */ - -#define TPI_FFSR_FtStopped_Pos 1 /*!< TPI FFSR: FtStopped Position */ -#define TPI_FFSR_FtStopped_Msk (0x1UL << TPI_FFSR_FtStopped_Pos) /*!< TPI FFSR: FtStopped Mask */ - -#define TPI_FFSR_FlInProg_Pos 0 /*!< TPI FFSR: FlInProg Position */ -#define TPI_FFSR_FlInProg_Msk (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/) /*!< TPI FFSR: FlInProg Mask */ - -/* TPI Formatter and Flush Control Register Definitions */ -#define TPI_FFCR_TrigIn_Pos 8 /*!< TPI FFCR: TrigIn Position */ -#define TPI_FFCR_TrigIn_Msk (0x1UL << TPI_FFCR_TrigIn_Pos) /*!< TPI FFCR: TrigIn Mask */ - -#define TPI_FFCR_EnFCont_Pos 1 /*!< TPI FFCR: EnFCont Position */ -#define TPI_FFCR_EnFCont_Msk (0x1UL << TPI_FFCR_EnFCont_Pos) /*!< TPI FFCR: EnFCont Mask */ - -/* TPI TRIGGER Register Definitions */ -#define TPI_TRIGGER_TRIGGER_Pos 0 /*!< TPI TRIGGER: TRIGGER Position */ -#define TPI_TRIGGER_TRIGGER_Msk (0x1UL /*<< TPI_TRIGGER_TRIGGER_Pos*/) /*!< TPI TRIGGER: TRIGGER Mask */ - -/* TPI Integration ETM Data Register Definitions (FIFO0) */ -#define TPI_FIFO0_ITM_ATVALID_Pos 29 /*!< TPI FIFO0: ITM_ATVALID Position */ -#define TPI_FIFO0_ITM_ATVALID_Msk (0x3UL << TPI_FIFO0_ITM_ATVALID_Pos) /*!< TPI FIFO0: ITM_ATVALID Mask */ - -#define TPI_FIFO0_ITM_bytecount_Pos 27 /*!< TPI FIFO0: ITM_bytecount Position */ -#define TPI_FIFO0_ITM_bytecount_Msk (0x3UL << TPI_FIFO0_ITM_bytecount_Pos) /*!< TPI FIFO0: ITM_bytecount Mask */ - -#define TPI_FIFO0_ETM_ATVALID_Pos 26 /*!< TPI FIFO0: ETM_ATVALID Position */ -#define TPI_FIFO0_ETM_ATVALID_Msk (0x3UL << TPI_FIFO0_ETM_ATVALID_Pos) /*!< TPI FIFO0: ETM_ATVALID Mask */ - -#define TPI_FIFO0_ETM_bytecount_Pos 24 /*!< TPI FIFO0: ETM_bytecount Position */ -#define TPI_FIFO0_ETM_bytecount_Msk (0x3UL << TPI_FIFO0_ETM_bytecount_Pos) /*!< TPI FIFO0: ETM_bytecount Mask */ - -#define TPI_FIFO0_ETM2_Pos 16 /*!< TPI FIFO0: ETM2 Position */ -#define TPI_FIFO0_ETM2_Msk (0xFFUL << TPI_FIFO0_ETM2_Pos) /*!< TPI FIFO0: ETM2 Mask */ - -#define TPI_FIFO0_ETM1_Pos 8 /*!< TPI FIFO0: ETM1 Position */ -#define TPI_FIFO0_ETM1_Msk (0xFFUL << TPI_FIFO0_ETM1_Pos) /*!< TPI FIFO0: ETM1 Mask */ - -#define TPI_FIFO0_ETM0_Pos 0 /*!< TPI FIFO0: ETM0 Position */ -#define TPI_FIFO0_ETM0_Msk (0xFFUL /*<< TPI_FIFO0_ETM0_Pos*/) /*!< TPI FIFO0: ETM0 Mask */ - -/* TPI ITATBCTR2 Register Definitions */ -#define TPI_ITATBCTR2_ATREADY_Pos 0 /*!< TPI ITATBCTR2: ATREADY Position */ -#define TPI_ITATBCTR2_ATREADY_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY_Pos*/) /*!< TPI ITATBCTR2: ATREADY Mask */ - -/* TPI Integration ITM Data Register Definitions (FIFO1) */ -#define TPI_FIFO1_ITM_ATVALID_Pos 29 /*!< TPI FIFO1: ITM_ATVALID Position */ -#define TPI_FIFO1_ITM_ATVALID_Msk (0x3UL << TPI_FIFO1_ITM_ATVALID_Pos) /*!< TPI FIFO1: ITM_ATVALID Mask */ - -#define TPI_FIFO1_ITM_bytecount_Pos 27 /*!< TPI FIFO1: ITM_bytecount Position */ -#define TPI_FIFO1_ITM_bytecount_Msk (0x3UL << TPI_FIFO1_ITM_bytecount_Pos) /*!< TPI FIFO1: ITM_bytecount Mask */ - -#define TPI_FIFO1_ETM_ATVALID_Pos 26 /*!< TPI FIFO1: ETM_ATVALID Position */ -#define TPI_FIFO1_ETM_ATVALID_Msk (0x3UL << TPI_FIFO1_ETM_ATVALID_Pos) /*!< TPI FIFO1: ETM_ATVALID Mask */ - -#define TPI_FIFO1_ETM_bytecount_Pos 24 /*!< TPI FIFO1: ETM_bytecount Position */ -#define TPI_FIFO1_ETM_bytecount_Msk (0x3UL << TPI_FIFO1_ETM_bytecount_Pos) /*!< TPI FIFO1: ETM_bytecount Mask */ - -#define TPI_FIFO1_ITM2_Pos 16 /*!< TPI FIFO1: ITM2 Position */ -#define TPI_FIFO1_ITM2_Msk (0xFFUL << TPI_FIFO1_ITM2_Pos) /*!< TPI FIFO1: ITM2 Mask */ - -#define TPI_FIFO1_ITM1_Pos 8 /*!< TPI FIFO1: ITM1 Position */ -#define TPI_FIFO1_ITM1_Msk (0xFFUL << TPI_FIFO1_ITM1_Pos) /*!< TPI FIFO1: ITM1 Mask */ - -#define TPI_FIFO1_ITM0_Pos 0 /*!< TPI FIFO1: ITM0 Position */ -#define TPI_FIFO1_ITM0_Msk (0xFFUL /*<< TPI_FIFO1_ITM0_Pos*/) /*!< TPI FIFO1: ITM0 Mask */ - -/* TPI ITATBCTR0 Register Definitions */ -#define TPI_ITATBCTR0_ATREADY_Pos 0 /*!< TPI ITATBCTR0: ATREADY Position */ -#define TPI_ITATBCTR0_ATREADY_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY_Pos*/) /*!< TPI ITATBCTR0: ATREADY Mask */ - -/* TPI Integration Mode Control Register Definitions */ -#define TPI_ITCTRL_Mode_Pos 0 /*!< TPI ITCTRL: Mode Position */ -#define TPI_ITCTRL_Mode_Msk (0x1UL /*<< TPI_ITCTRL_Mode_Pos*/) /*!< TPI ITCTRL: Mode Mask */ - -/* TPI DEVID Register Definitions */ -#define TPI_DEVID_NRZVALID_Pos 11 /*!< TPI DEVID: NRZVALID Position */ -#define TPI_DEVID_NRZVALID_Msk (0x1UL << TPI_DEVID_NRZVALID_Pos) /*!< TPI DEVID: NRZVALID Mask */ - -#define TPI_DEVID_MANCVALID_Pos 10 /*!< TPI DEVID: MANCVALID Position */ -#define TPI_DEVID_MANCVALID_Msk (0x1UL << TPI_DEVID_MANCVALID_Pos) /*!< TPI DEVID: MANCVALID Mask */ - -#define TPI_DEVID_PTINVALID_Pos 9 /*!< TPI DEVID: PTINVALID Position */ -#define TPI_DEVID_PTINVALID_Msk (0x1UL << TPI_DEVID_PTINVALID_Pos) /*!< TPI DEVID: PTINVALID Mask */ - -#define TPI_DEVID_MinBufSz_Pos 6 /*!< TPI DEVID: MinBufSz Position */ -#define TPI_DEVID_MinBufSz_Msk (0x7UL << TPI_DEVID_MinBufSz_Pos) /*!< TPI DEVID: MinBufSz Mask */ - -#define TPI_DEVID_AsynClkIn_Pos 5 /*!< TPI DEVID: AsynClkIn Position */ -#define TPI_DEVID_AsynClkIn_Msk (0x1UL << TPI_DEVID_AsynClkIn_Pos) /*!< TPI DEVID: AsynClkIn Mask */ - -#define TPI_DEVID_NrTraceInput_Pos 0 /*!< TPI DEVID: NrTraceInput Position */ -#define TPI_DEVID_NrTraceInput_Msk (0x1FUL /*<< TPI_DEVID_NrTraceInput_Pos*/) /*!< TPI DEVID: NrTraceInput Mask */ - -/* TPI DEVTYPE Register Definitions */ -#define TPI_DEVTYPE_MajorType_Pos 4 /*!< TPI DEVTYPE: MajorType Position */ -#define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos) /*!< TPI DEVTYPE: MajorType Mask */ - -#define TPI_DEVTYPE_SubType_Pos 0 /*!< TPI DEVTYPE: SubType Position */ -#define TPI_DEVTYPE_SubType_Msk (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/) /*!< TPI DEVTYPE: SubType Mask */ - -/*@}*/ /* end of group CMSIS_TPI */ - - -#if (__MPU_PRESENT == 1) -/** \ingroup CMSIS_core_register - \defgroup CMSIS_MPU Memory Protection Unit (MPU) - \brief Type definitions for the Memory Protection Unit (MPU) - @{ - */ - -/** \brief Structure type to access the Memory Protection Unit (MPU). - */ -typedef struct -{ - __I uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */ - __IO uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */ - __IO uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region RNRber Register */ - __IO uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */ - __IO uint32_t RASR; /*!< Offset: 0x010 (R/W) MPU Region Attribute and Size Register */ - __IO uint32_t RBAR_A1; /*!< Offset: 0x014 (R/W) MPU Alias 1 Region Base Address Register */ - __IO uint32_t RASR_A1; /*!< Offset: 0x018 (R/W) MPU Alias 1 Region Attribute and Size Register */ - __IO uint32_t RBAR_A2; /*!< Offset: 0x01C (R/W) MPU Alias 2 Region Base Address Register */ - __IO uint32_t RASR_A2; /*!< Offset: 0x020 (R/W) MPU Alias 2 Region Attribute and Size Register */ - __IO uint32_t RBAR_A3; /*!< Offset: 0x024 (R/W) MPU Alias 3 Region Base Address Register */ - __IO uint32_t RASR_A3; /*!< Offset: 0x028 (R/W) MPU Alias 3 Region Attribute and Size Register */ -} MPU_Type; - -/* MPU Type Register */ -#define MPU_TYPE_IREGION_Pos 16 /*!< MPU TYPE: IREGION Position */ -#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */ - -#define MPU_TYPE_DREGION_Pos 8 /*!< MPU TYPE: DREGION Position */ -#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */ - -#define MPU_TYPE_SEPARATE_Pos 0 /*!< MPU TYPE: SEPARATE Position */ -#define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/) /*!< MPU TYPE: SEPARATE Mask */ - -/* MPU Control Register */ -#define MPU_CTRL_PRIVDEFENA_Pos 2 /*!< MPU CTRL: PRIVDEFENA Position */ -#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */ - -#define MPU_CTRL_HFNMIENA_Pos 1 /*!< MPU CTRL: HFNMIENA Position */ -#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */ - -#define MPU_CTRL_ENABLE_Pos 0 /*!< MPU CTRL: ENABLE Position */ -#define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/) /*!< MPU CTRL: ENABLE Mask */ - -/* MPU Region Number Register */ -#define MPU_RNR_REGION_Pos 0 /*!< MPU RNR: REGION Position */ -#define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/) /*!< MPU RNR: REGION Mask */ - -/* MPU Region Base Address Register */ -#define MPU_RBAR_ADDR_Pos 5 /*!< MPU RBAR: ADDR Position */ -#define MPU_RBAR_ADDR_Msk (0x7FFFFFFUL << MPU_RBAR_ADDR_Pos) /*!< MPU RBAR: ADDR Mask */ - -#define MPU_RBAR_VALID_Pos 4 /*!< MPU RBAR: VALID Position */ -#define MPU_RBAR_VALID_Msk (1UL << MPU_RBAR_VALID_Pos) /*!< MPU RBAR: VALID Mask */ - -#define MPU_RBAR_REGION_Pos 0 /*!< MPU RBAR: REGION Position */ -#define MPU_RBAR_REGION_Msk (0xFUL /*<< MPU_RBAR_REGION_Pos*/) /*!< MPU RBAR: REGION Mask */ - -/* MPU Region Attribute and Size Register */ -#define MPU_RASR_ATTRS_Pos 16 /*!< MPU RASR: MPU Region Attribute field Position */ -#define MPU_RASR_ATTRS_Msk (0xFFFFUL << MPU_RASR_ATTRS_Pos) /*!< MPU RASR: MPU Region Attribute field Mask */ - -#define MPU_RASR_XN_Pos 28 /*!< MPU RASR: ATTRS.XN Position */ -#define MPU_RASR_XN_Msk (1UL << MPU_RASR_XN_Pos) /*!< MPU RASR: ATTRS.XN Mask */ - -#define MPU_RASR_AP_Pos 24 /*!< MPU RASR: ATTRS.AP Position */ -#define MPU_RASR_AP_Msk (0x7UL << MPU_RASR_AP_Pos) /*!< MPU RASR: ATTRS.AP Mask */ - -#define MPU_RASR_TEX_Pos 19 /*!< MPU RASR: ATTRS.TEX Position */ -#define MPU_RASR_TEX_Msk (0x7UL << MPU_RASR_TEX_Pos) /*!< MPU RASR: ATTRS.TEX Mask */ - -#define MPU_RASR_S_Pos 18 /*!< MPU RASR: ATTRS.S Position */ -#define MPU_RASR_S_Msk (1UL << MPU_RASR_S_Pos) /*!< MPU RASR: ATTRS.S Mask */ - -#define MPU_RASR_C_Pos 17 /*!< MPU RASR: ATTRS.C Position */ -#define MPU_RASR_C_Msk (1UL << MPU_RASR_C_Pos) /*!< MPU RASR: ATTRS.C Mask */ - -#define MPU_RASR_B_Pos 16 /*!< MPU RASR: ATTRS.B Position */ -#define MPU_RASR_B_Msk (1UL << MPU_RASR_B_Pos) /*!< MPU RASR: ATTRS.B Mask */ - -#define MPU_RASR_SRD_Pos 8 /*!< MPU RASR: Sub-Region Disable Position */ -#define MPU_RASR_SRD_Msk (0xFFUL << MPU_RASR_SRD_Pos) /*!< MPU RASR: Sub-Region Disable Mask */ - -#define MPU_RASR_SIZE_Pos 1 /*!< MPU RASR: Region Size Field Position */ -#define MPU_RASR_SIZE_Msk (0x1FUL << MPU_RASR_SIZE_Pos) /*!< MPU RASR: Region Size Field Mask */ - -#define MPU_RASR_ENABLE_Pos 0 /*!< MPU RASR: Region enable bit Position */ -#define MPU_RASR_ENABLE_Msk (1UL /*<< MPU_RASR_ENABLE_Pos*/) /*!< MPU RASR: Region enable bit Disable Mask */ - -/*@} end of group CMSIS_MPU */ -#endif - - -#if (__FPU_PRESENT == 1) -/** \ingroup CMSIS_core_register - \defgroup CMSIS_FPU Floating Point Unit (FPU) - \brief Type definitions for the Floating Point Unit (FPU) - @{ - */ - -/** \brief Structure type to access the Floating Point Unit (FPU). - */ -typedef struct -{ - uint32_t RESERVED0[1]; - __IO uint32_t FPCCR; /*!< Offset: 0x004 (R/W) Floating-Point Context Control Register */ - __IO uint32_t FPCAR; /*!< Offset: 0x008 (R/W) Floating-Point Context Address Register */ - __IO uint32_t FPDSCR; /*!< Offset: 0x00C (R/W) Floating-Point Default Status Control Register */ - __I uint32_t MVFR0; /*!< Offset: 0x010 (R/ ) Media and FP Feature Register 0 */ - __I uint32_t MVFR1; /*!< Offset: 0x014 (R/ ) Media and FP Feature Register 1 */ - __I uint32_t MVFR2; /*!< Offset: 0x018 (R/ ) Media and FP Feature Register 2 */ -} FPU_Type; - -/* Floating-Point Context Control Register */ -#define FPU_FPCCR_ASPEN_Pos 31 /*!< FPCCR: ASPEN bit Position */ -#define FPU_FPCCR_ASPEN_Msk (1UL << FPU_FPCCR_ASPEN_Pos) /*!< FPCCR: ASPEN bit Mask */ - -#define FPU_FPCCR_LSPEN_Pos 30 /*!< FPCCR: LSPEN Position */ -#define FPU_FPCCR_LSPEN_Msk (1UL << FPU_FPCCR_LSPEN_Pos) /*!< FPCCR: LSPEN bit Mask */ - -#define FPU_FPCCR_MONRDY_Pos 8 /*!< FPCCR: MONRDY Position */ -#define FPU_FPCCR_MONRDY_Msk (1UL << FPU_FPCCR_MONRDY_Pos) /*!< FPCCR: MONRDY bit Mask */ - -#define FPU_FPCCR_BFRDY_Pos 6 /*!< FPCCR: BFRDY Position */ -#define FPU_FPCCR_BFRDY_Msk (1UL << FPU_FPCCR_BFRDY_Pos) /*!< FPCCR: BFRDY bit Mask */ - -#define FPU_FPCCR_MMRDY_Pos 5 /*!< FPCCR: MMRDY Position */ -#define FPU_FPCCR_MMRDY_Msk (1UL << FPU_FPCCR_MMRDY_Pos) /*!< FPCCR: MMRDY bit Mask */ - -#define FPU_FPCCR_HFRDY_Pos 4 /*!< FPCCR: HFRDY Position */ -#define FPU_FPCCR_HFRDY_Msk (1UL << FPU_FPCCR_HFRDY_Pos) /*!< FPCCR: HFRDY bit Mask */ - -#define FPU_FPCCR_THREAD_Pos 3 /*!< FPCCR: processor mode bit Position */ -#define FPU_FPCCR_THREAD_Msk (1UL << FPU_FPCCR_THREAD_Pos) /*!< FPCCR: processor mode active bit Mask */ - -#define FPU_FPCCR_USER_Pos 1 /*!< FPCCR: privilege level bit Position */ -#define FPU_FPCCR_USER_Msk (1UL << FPU_FPCCR_USER_Pos) /*!< FPCCR: privilege level bit Mask */ - -#define FPU_FPCCR_LSPACT_Pos 0 /*!< FPCCR: Lazy state preservation active bit Position */ -#define FPU_FPCCR_LSPACT_Msk (1UL /*<< FPU_FPCCR_LSPACT_Pos*/) /*!< FPCCR: Lazy state preservation active bit Mask */ - -/* Floating-Point Context Address Register */ -#define FPU_FPCAR_ADDRESS_Pos 3 /*!< FPCAR: ADDRESS bit Position */ -#define FPU_FPCAR_ADDRESS_Msk (0x1FFFFFFFUL << FPU_FPCAR_ADDRESS_Pos) /*!< FPCAR: ADDRESS bit Mask */ - -/* Floating-Point Default Status Control Register */ -#define FPU_FPDSCR_AHP_Pos 26 /*!< FPDSCR: AHP bit Position */ -#define FPU_FPDSCR_AHP_Msk (1UL << FPU_FPDSCR_AHP_Pos) /*!< FPDSCR: AHP bit Mask */ - -#define FPU_FPDSCR_DN_Pos 25 /*!< FPDSCR: DN bit Position */ -#define FPU_FPDSCR_DN_Msk (1UL << FPU_FPDSCR_DN_Pos) /*!< FPDSCR: DN bit Mask */ - -#define FPU_FPDSCR_FZ_Pos 24 /*!< FPDSCR: FZ bit Position */ -#define FPU_FPDSCR_FZ_Msk (1UL << FPU_FPDSCR_FZ_Pos) /*!< FPDSCR: FZ bit Mask */ - -#define FPU_FPDSCR_RMode_Pos 22 /*!< FPDSCR: RMode bit Position */ -#define FPU_FPDSCR_RMode_Msk (3UL << FPU_FPDSCR_RMode_Pos) /*!< FPDSCR: RMode bit Mask */ - -/* Media and FP Feature Register 0 */ -#define FPU_MVFR0_FP_rounding_modes_Pos 28 /*!< MVFR0: FP rounding modes bits Position */ -#define FPU_MVFR0_FP_rounding_modes_Msk (0xFUL << FPU_MVFR0_FP_rounding_modes_Pos) /*!< MVFR0: FP rounding modes bits Mask */ - -#define FPU_MVFR0_Short_vectors_Pos 24 /*!< MVFR0: Short vectors bits Position */ -#define FPU_MVFR0_Short_vectors_Msk (0xFUL << FPU_MVFR0_Short_vectors_Pos) /*!< MVFR0: Short vectors bits Mask */ - -#define FPU_MVFR0_Square_root_Pos 20 /*!< MVFR0: Square root bits Position */ -#define FPU_MVFR0_Square_root_Msk (0xFUL << FPU_MVFR0_Square_root_Pos) /*!< MVFR0: Square root bits Mask */ - -#define FPU_MVFR0_Divide_Pos 16 /*!< MVFR0: Divide bits Position */ -#define FPU_MVFR0_Divide_Msk (0xFUL << FPU_MVFR0_Divide_Pos) /*!< MVFR0: Divide bits Mask */ - -#define FPU_MVFR0_FP_excep_trapping_Pos 12 /*!< MVFR0: FP exception trapping bits Position */ -#define FPU_MVFR0_FP_excep_trapping_Msk (0xFUL << FPU_MVFR0_FP_excep_trapping_Pos) /*!< MVFR0: FP exception trapping bits Mask */ - -#define FPU_MVFR0_Double_precision_Pos 8 /*!< MVFR0: Double-precision bits Position */ -#define FPU_MVFR0_Double_precision_Msk (0xFUL << FPU_MVFR0_Double_precision_Pos) /*!< MVFR0: Double-precision bits Mask */ - -#define FPU_MVFR0_Single_precision_Pos 4 /*!< MVFR0: Single-precision bits Position */ -#define FPU_MVFR0_Single_precision_Msk (0xFUL << FPU_MVFR0_Single_precision_Pos) /*!< MVFR0: Single-precision bits Mask */ - -#define FPU_MVFR0_A_SIMD_registers_Pos 0 /*!< MVFR0: A_SIMD registers bits Position */ -#define FPU_MVFR0_A_SIMD_registers_Msk (0xFUL /*<< FPU_MVFR0_A_SIMD_registers_Pos*/) /*!< MVFR0: A_SIMD registers bits Mask */ - -/* Media and FP Feature Register 1 */ -#define FPU_MVFR1_FP_fused_MAC_Pos 28 /*!< MVFR1: FP fused MAC bits Position */ -#define FPU_MVFR1_FP_fused_MAC_Msk (0xFUL << FPU_MVFR1_FP_fused_MAC_Pos) /*!< MVFR1: FP fused MAC bits Mask */ - -#define FPU_MVFR1_FP_HPFP_Pos 24 /*!< MVFR1: FP HPFP bits Position */ -#define FPU_MVFR1_FP_HPFP_Msk (0xFUL << FPU_MVFR1_FP_HPFP_Pos) /*!< MVFR1: FP HPFP bits Mask */ - -#define FPU_MVFR1_D_NaN_mode_Pos 4 /*!< MVFR1: D_NaN mode bits Position */ -#define FPU_MVFR1_D_NaN_mode_Msk (0xFUL << FPU_MVFR1_D_NaN_mode_Pos) /*!< MVFR1: D_NaN mode bits Mask */ - -#define FPU_MVFR1_FtZ_mode_Pos 0 /*!< MVFR1: FtZ mode bits Position */ -#define FPU_MVFR1_FtZ_mode_Msk (0xFUL /*<< FPU_MVFR1_FtZ_mode_Pos*/) /*!< MVFR1: FtZ mode bits Mask */ - -/* Media and FP Feature Register 2 */ - -/*@} end of group CMSIS_FPU */ -#endif - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) - \brief Type definitions for the Core Debug Registers - @{ - */ - -/** \brief Structure type to access the Core Debug Register (CoreDebug). - */ -typedef struct -{ - __IO uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */ - __O uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */ - __IO uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */ - __IO uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */ -} CoreDebug_Type; - -/* Debug Halting Control and Status Register */ -#define CoreDebug_DHCSR_DBGKEY_Pos 16 /*!< CoreDebug DHCSR: DBGKEY Position */ -#define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos) /*!< CoreDebug DHCSR: DBGKEY Mask */ - -#define CoreDebug_DHCSR_S_RESET_ST_Pos 25 /*!< CoreDebug DHCSR: S_RESET_ST Position */ -#define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos) /*!< CoreDebug DHCSR: S_RESET_ST Mask */ - -#define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24 /*!< CoreDebug DHCSR: S_RETIRE_ST Position */ -#define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos) /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */ - -#define CoreDebug_DHCSR_S_LOCKUP_Pos 19 /*!< CoreDebug DHCSR: S_LOCKUP Position */ -#define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos) /*!< CoreDebug DHCSR: S_LOCKUP Mask */ - -#define CoreDebug_DHCSR_S_SLEEP_Pos 18 /*!< CoreDebug DHCSR: S_SLEEP Position */ -#define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos) /*!< CoreDebug DHCSR: S_SLEEP Mask */ - -#define CoreDebug_DHCSR_S_HALT_Pos 17 /*!< CoreDebug DHCSR: S_HALT Position */ -#define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos) /*!< CoreDebug DHCSR: S_HALT Mask */ - -#define CoreDebug_DHCSR_S_REGRDY_Pos 16 /*!< CoreDebug DHCSR: S_REGRDY Position */ -#define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos) /*!< CoreDebug DHCSR: S_REGRDY Mask */ - -#define CoreDebug_DHCSR_C_SNAPSTALL_Pos 5 /*!< CoreDebug DHCSR: C_SNAPSTALL Position */ -#define CoreDebug_DHCSR_C_SNAPSTALL_Msk (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos) /*!< CoreDebug DHCSR: C_SNAPSTALL Mask */ - -#define CoreDebug_DHCSR_C_MASKINTS_Pos 3 /*!< CoreDebug DHCSR: C_MASKINTS Position */ -#define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos) /*!< CoreDebug DHCSR: C_MASKINTS Mask */ - -#define CoreDebug_DHCSR_C_STEP_Pos 2 /*!< CoreDebug DHCSR: C_STEP Position */ -#define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos) /*!< CoreDebug DHCSR: C_STEP Mask */ - -#define CoreDebug_DHCSR_C_HALT_Pos 1 /*!< CoreDebug DHCSR: C_HALT Position */ -#define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos) /*!< CoreDebug DHCSR: C_HALT Mask */ - -#define CoreDebug_DHCSR_C_DEBUGEN_Pos 0 /*!< CoreDebug DHCSR: C_DEBUGEN Position */ -#define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/) /*!< CoreDebug DHCSR: C_DEBUGEN Mask */ - -/* Debug Core Register Selector Register */ -#define CoreDebug_DCRSR_REGWnR_Pos 16 /*!< CoreDebug DCRSR: REGWnR Position */ -#define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos) /*!< CoreDebug DCRSR: REGWnR Mask */ - -#define CoreDebug_DCRSR_REGSEL_Pos 0 /*!< CoreDebug DCRSR: REGSEL Position */ -#define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/) /*!< CoreDebug DCRSR: REGSEL Mask */ - -/* Debug Exception and Monitor Control Register */ -#define CoreDebug_DEMCR_TRCENA_Pos 24 /*!< CoreDebug DEMCR: TRCENA Position */ -#define CoreDebug_DEMCR_TRCENA_Msk (1UL << CoreDebug_DEMCR_TRCENA_Pos) /*!< CoreDebug DEMCR: TRCENA Mask */ - -#define CoreDebug_DEMCR_MON_REQ_Pos 19 /*!< CoreDebug DEMCR: MON_REQ Position */ -#define CoreDebug_DEMCR_MON_REQ_Msk (1UL << CoreDebug_DEMCR_MON_REQ_Pos) /*!< CoreDebug DEMCR: MON_REQ Mask */ - -#define CoreDebug_DEMCR_MON_STEP_Pos 18 /*!< CoreDebug DEMCR: MON_STEP Position */ -#define CoreDebug_DEMCR_MON_STEP_Msk (1UL << CoreDebug_DEMCR_MON_STEP_Pos) /*!< CoreDebug DEMCR: MON_STEP Mask */ - -#define CoreDebug_DEMCR_MON_PEND_Pos 17 /*!< CoreDebug DEMCR: MON_PEND Position */ -#define CoreDebug_DEMCR_MON_PEND_Msk (1UL << CoreDebug_DEMCR_MON_PEND_Pos) /*!< CoreDebug DEMCR: MON_PEND Mask */ - -#define CoreDebug_DEMCR_MON_EN_Pos 16 /*!< CoreDebug DEMCR: MON_EN Position */ -#define CoreDebug_DEMCR_MON_EN_Msk (1UL << CoreDebug_DEMCR_MON_EN_Pos) /*!< CoreDebug DEMCR: MON_EN Mask */ - -#define CoreDebug_DEMCR_VC_HARDERR_Pos 10 /*!< CoreDebug DEMCR: VC_HARDERR Position */ -#define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos) /*!< CoreDebug DEMCR: VC_HARDERR Mask */ - -#define CoreDebug_DEMCR_VC_INTERR_Pos 9 /*!< CoreDebug DEMCR: VC_INTERR Position */ -#define CoreDebug_DEMCR_VC_INTERR_Msk (1UL << CoreDebug_DEMCR_VC_INTERR_Pos) /*!< CoreDebug DEMCR: VC_INTERR Mask */ - -#define CoreDebug_DEMCR_VC_BUSERR_Pos 8 /*!< CoreDebug DEMCR: VC_BUSERR Position */ -#define CoreDebug_DEMCR_VC_BUSERR_Msk (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos) /*!< CoreDebug DEMCR: VC_BUSERR Mask */ - -#define CoreDebug_DEMCR_VC_STATERR_Pos 7 /*!< CoreDebug DEMCR: VC_STATERR Position */ -#define CoreDebug_DEMCR_VC_STATERR_Msk (1UL << CoreDebug_DEMCR_VC_STATERR_Pos) /*!< CoreDebug DEMCR: VC_STATERR Mask */ - -#define CoreDebug_DEMCR_VC_CHKERR_Pos 6 /*!< CoreDebug DEMCR: VC_CHKERR Position */ -#define CoreDebug_DEMCR_VC_CHKERR_Msk (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos) /*!< CoreDebug DEMCR: VC_CHKERR Mask */ - -#define CoreDebug_DEMCR_VC_NOCPERR_Pos 5 /*!< CoreDebug DEMCR: VC_NOCPERR Position */ -#define CoreDebug_DEMCR_VC_NOCPERR_Msk (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos) /*!< CoreDebug DEMCR: VC_NOCPERR Mask */ - -#define CoreDebug_DEMCR_VC_MMERR_Pos 4 /*!< CoreDebug DEMCR: VC_MMERR Position */ -#define CoreDebug_DEMCR_VC_MMERR_Msk (1UL << CoreDebug_DEMCR_VC_MMERR_Pos) /*!< CoreDebug DEMCR: VC_MMERR Mask */ - -#define CoreDebug_DEMCR_VC_CORERESET_Pos 0 /*!< CoreDebug DEMCR: VC_CORERESET Position */ -#define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/) /*!< CoreDebug DEMCR: VC_CORERESET Mask */ - -/*@} end of group CMSIS_CoreDebug */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_core_base Core Definitions - \brief Definitions for base addresses, unions, and structures. - @{ - */ - -/* Memory mapping of Cortex-M4 Hardware */ -#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ -#define ITM_BASE (0xE0000000UL) /*!< ITM Base Address */ -#define DWT_BASE (0xE0001000UL) /*!< DWT Base Address */ -#define TPI_BASE (0xE0040000UL) /*!< TPI Base Address */ -#define CoreDebug_BASE (0xE000EDF0UL) /*!< Core Debug Base Address */ -#define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ -#define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ -#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ - -#define SCnSCB ((SCnSCB_Type *) SCS_BASE ) /*!< System control Register not in SCB */ -#define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ -#define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ -#define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ -#define ITM ((ITM_Type *) ITM_BASE ) /*!< ITM configuration struct */ -#define DWT ((DWT_Type *) DWT_BASE ) /*!< DWT configuration struct */ -#define TPI ((TPI_Type *) TPI_BASE ) /*!< TPI configuration struct */ -#define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE) /*!< Core Debug configuration struct */ - -#if (__MPU_PRESENT == 1) - #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ - #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ -#endif - -#if (__FPU_PRESENT == 1) - #define FPU_BASE (SCS_BASE + 0x0F30UL) /*!< Floating Point Unit */ - #define FPU ((FPU_Type *) FPU_BASE ) /*!< Floating Point Unit */ -#endif - -/*@} */ - - - -/******************************************************************************* - * Hardware Abstraction Layer - Core Function Interface contains: - - Core NVIC Functions - - Core SysTick Functions - - Core Debug Functions - - Core Register Access Functions - ******************************************************************************/ -/** \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference -*/ - - - -/* ########################## NVIC functions #################################### */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_NVICFunctions NVIC Functions - \brief Functions that manage interrupts and exceptions via the NVIC. - @{ - */ - -/** \brief Set Priority Grouping - - The function sets the priority grouping field using the required unlock sequence. - The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field. - Only values from 0..7 are used. - In case of a conflict between priority grouping and available - priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. - - \param [in] PriorityGroup Priority grouping field. - */ -__STATIC_INLINE void NVIC_SetPriorityGrouping(uint32_t PriorityGroup) -{ - uint32_t reg_value; - uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ - - reg_value = SCB->AIRCR; /* read old register configuration */ - reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ - reg_value = (reg_value | - ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | - (PriorityGroupTmp << 8) ); /* Insert write key and priorty group */ - SCB->AIRCR = reg_value; -} - - -/** \brief Get Priority Grouping - - The function reads the priority grouping field from the NVIC Interrupt Controller. - - \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field). - */ -__STATIC_INLINE uint32_t NVIC_GetPriorityGrouping(void) -{ - return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos)); -} - - -/** \brief Enable External Interrupt - - The function enables a device-specific interrupt in the NVIC interrupt controller. - - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn) -{ - NVIC->ISER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** \brief Disable External Interrupt - - The function disables a device-specific interrupt in the NVIC interrupt controller. - - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn) -{ - NVIC->ICER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** \brief Get Pending Interrupt - - The function reads the pending register in the NVIC and returns the pending bit - for the specified interrupt. - - \param [in] IRQn Interrupt number. - - \return 0 Interrupt status is not pending. - \return 1 Interrupt status is pending. - */ -__STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn) -{ - return((uint32_t)(((NVIC->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** \brief Set Pending Interrupt - - The function sets the pending bit of an external interrupt. - - \param [in] IRQn Interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** \brief Clear Pending Interrupt - - The function clears the pending bit of an external interrupt. - - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ICPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** \brief Get Active Interrupt - - The function reads the active register in NVIC and returns the active bit. - - \param [in] IRQn Interrupt number. - - \return 0 Interrupt status is not active. - \return 1 Interrupt status is active. - */ -__STATIC_INLINE uint32_t NVIC_GetActive(IRQn_Type IRQn) -{ - return((uint32_t)(((NVIC->IABR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** \brief Set Interrupt Priority - - The function sets the priority of an interrupt. - - \note The priority cannot be set for every core interrupt. - - \param [in] IRQn Interrupt number. - \param [in] priority Priority to set. - */ -__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) -{ - if((int32_t)IRQn < 0) { - SCB->SHPR[(((uint32_t)(int32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8 - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } - else { - NVIC->IP[((uint32_t)(int32_t)IRQn)] = (uint8_t)((priority << (8 - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } -} - - -/** \brief Get Interrupt Priority - - The function reads the priority of an interrupt. The interrupt - number can be positive to specify an external (device specific) - interrupt, or negative to specify an internal (core) interrupt. - - - \param [in] IRQn Interrupt number. - \return Interrupt Priority. Value is aligned automatically to the implemented - priority bits of the microcontroller. - */ -__STATIC_INLINE uint32_t NVIC_GetPriority(IRQn_Type IRQn) -{ - - if((int32_t)IRQn < 0) { - return(((uint32_t)SCB->SHPR[(((uint32_t)(int32_t)IRQn) & 0xFUL)-4UL] >> (8 - __NVIC_PRIO_BITS))); - } - else { - return(((uint32_t)NVIC->IP[((uint32_t)(int32_t)IRQn)] >> (8 - __NVIC_PRIO_BITS))); - } -} - - -/** \brief Encode Priority - - The function encodes the priority for an interrupt with the given priority group, - preemptive priority value, and subpriority value. - In case of a conflict between priority grouping and available - priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. - - \param [in] PriorityGroup Used priority group. - \param [in] PreemptPriority Preemptive priority value (starting from 0). - \param [in] SubPriority Subpriority value (starting from 0). - \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority(). - */ -__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) -{ - uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ - uint32_t PreemptPriorityBits; - uint32_t SubPriorityBits; - - PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); - SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); - - return ( - ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | - ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL))) - ); -} - - -/** \brief Decode Priority - - The function decodes an interrupt priority value with a given priority group to - preemptive priority value and subpriority value. - In case of a conflict between priority grouping and available - priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set. - - \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority(). - \param [in] PriorityGroup Used priority group. - \param [out] pPreemptPriority Preemptive priority value (starting from 0). - \param [out] pSubPriority Subpriority value (starting from 0). - */ -__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* pPreemptPriority, uint32_t* pSubPriority) -{ - uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ - uint32_t PreemptPriorityBits; - uint32_t SubPriorityBits; - - PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); - SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); - - *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL); - *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL); -} - - -/** \brief System Reset - - The function initiates a system reset request to reset the MCU. - */ -__STATIC_INLINE void NVIC_SystemReset(void) -{ - __DSB(); /* Ensure all outstanding memory accesses included - buffered write are completed before reset */ - SCB->AIRCR = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | - (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) | - SCB_AIRCR_SYSRESETREQ_Msk ); /* Keep priority group unchanged */ - __DSB(); /* Ensure completion of memory access */ - while(1) { __NOP(); } /* wait until reset */ -} - -/*@} end of CMSIS_Core_NVICFunctions */ - - -/* ########################## FPU functions #################################### */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_FpuFunctions FPU Functions - \brief Function that provides FPU type. - @{ - */ - -/** - \fn uint32_t SCB_GetFPUType(void) - \brief get FPU type - \returns - - \b 0: No FPU - - \b 1: Single precision FPU - - \b 2: Double + Single precision FPU - */ -__STATIC_INLINE uint32_t SCB_GetFPUType(void) -{ - uint32_t mvfr0; - - mvfr0 = SCB->MVFR0; - if ((mvfr0 & 0x00000FF0UL) == 0x220UL) { - return 2UL; // Double + Single precision FPU - } else if ((mvfr0 & 0x00000FF0UL) == 0x020UL) { - return 1UL; // Single precision FPU - } else { - return 0UL; // No FPU - } -} - - -/*@} end of CMSIS_Core_FpuFunctions */ - - - -/* ########################## Cache functions #################################### */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_CacheFunctions Cache Functions - \brief Functions that configure Instruction and Data cache. - @{ - */ - -/* Cache Size ID Register Macros */ -#define CCSIDR_WAYS(x) (((x) & SCB_CCSIDR_ASSOCIATIVITY_Msk) >> SCB_CCSIDR_ASSOCIATIVITY_Pos) -#define CCSIDR_SETS(x) (((x) & SCB_CCSIDR_NUMSETS_Msk ) >> SCB_CCSIDR_NUMSETS_Pos ) -#define CCSIDR_LSSHIFT(x) (((x) & SCB_CCSIDR_LINESIZE_Msk ) /*>> SCB_CCSIDR_LINESIZE_Pos*/ ) - - -/** \brief Enable I-Cache - - The function turns on I-Cache - */ -__STATIC_INLINE void SCB_EnableICache (void) -{ - #if (__ICACHE_PRESENT == 1) - __DSB(); - __ISB(); - SCB->ICIALLU = 0UL; // invalidate I-Cache - SCB->CCR |= (uint32_t)SCB_CCR_IC_Msk; // enable I-Cache - __DSB(); - __ISB(); - #endif -} - - -/** \brief Disable I-Cache - - The function turns off I-Cache - */ -__STATIC_INLINE void SCB_DisableICache (void) -{ - #if (__ICACHE_PRESENT == 1) - __DSB(); - __ISB(); - SCB->CCR &= ~(uint32_t)SCB_CCR_IC_Msk; // disable I-Cache - SCB->ICIALLU = 0UL; // invalidate I-Cache - __DSB(); - __ISB(); - #endif -} - - -/** \brief Invalidate I-Cache - - The function invalidates I-Cache - */ -__STATIC_INLINE void SCB_InvalidateICache (void) -{ - #if (__ICACHE_PRESENT == 1) - __DSB(); - __ISB(); - SCB->ICIALLU = 0UL; - __DSB(); - __ISB(); - #endif -} - - -/** \brief Enable D-Cache - - The function turns on D-Cache - */ -__STATIC_INLINE void SCB_EnableDCache (void) -{ - #if (__DCACHE_PRESENT == 1) - uint32_t ccsidr, sshift, wshift, sw; - uint32_t sets, ways; - - SCB->CSSELR = (0UL << 1) | 0UL; // Level 1 data cache - ccsidr = SCB->CCSIDR; - sets = (uint32_t)(CCSIDR_SETS(ccsidr)); - sshift = (uint32_t)(CCSIDR_LSSHIFT(ccsidr) + 4UL); - ways = (uint32_t)(CCSIDR_WAYS(ccsidr)); - wshift = (uint32_t)((uint32_t)__CLZ(ways) & 0x1FUL); - - __DSB(); - - do { // invalidate D-Cache - uint32_t tmpways = ways; - do { - sw = ((tmpways << wshift) | (sets << sshift)); - SCB->DCISW = sw; - } while(tmpways--); - } while(sets--); - __DSB(); - - SCB->CCR |= (uint32_t)SCB_CCR_DC_Msk; // enable D-Cache - - __DSB(); - __ISB(); - #endif -} - - -/** \brief Disable D-Cache - - The function turns off D-Cache - */ -__STATIC_INLINE void SCB_DisableDCache (void) -{ - #if (__DCACHE_PRESENT == 1) - uint32_t ccsidr, sshift, wshift, sw; - uint32_t sets, ways; - - SCB->CSSELR = (0UL << 1) | 0UL; // Level 1 data cache - ccsidr = SCB->CCSIDR; - sets = (uint32_t)(CCSIDR_SETS(ccsidr)); - sshift = (uint32_t)(CCSIDR_LSSHIFT(ccsidr) + 4UL); - ways = (uint32_t)(CCSIDR_WAYS(ccsidr)); - wshift = (uint32_t)((uint32_t)__CLZ(ways) & 0x1FUL); - - __DSB(); - - SCB->CCR &= ~(uint32_t)SCB_CCR_DC_Msk; // disable D-Cache - - do { // clean & invalidate D-Cache - uint32_t tmpways = ways; - do { - sw = ((tmpways << wshift) | (sets << sshift)); - SCB->DCCISW = sw; - } while(tmpways--); - } while(sets--); - - - __DSB(); - __ISB(); - #endif -} - - -/** \brief Invalidate D-Cache - - The function invalidates D-Cache - */ -__STATIC_INLINE void SCB_InvalidateDCache (void) -{ - #if (__DCACHE_PRESENT == 1) - uint32_t ccsidr, sshift, wshift, sw; - uint32_t sets, ways; - - SCB->CSSELR = (0UL << 1) | 0UL; // Level 1 data cache - ccsidr = SCB->CCSIDR; - sets = (uint32_t)(CCSIDR_SETS(ccsidr)); - sshift = (uint32_t)(CCSIDR_LSSHIFT(ccsidr) + 4UL); - ways = (uint32_t)(CCSIDR_WAYS(ccsidr)); - wshift = (uint32_t)((uint32_t)__CLZ(ways) & 0x1FUL); - - __DSB(); - - do { // invalidate D-Cache - uint32_t tmpways = ways; - do { - sw = ((tmpways << wshift) | (sets << sshift)); - SCB->DCISW = sw; - } while(tmpways--); - } while(sets--); - - __DSB(); - __ISB(); - #endif -} - - -/** \brief Clean D-Cache - - The function cleans D-Cache - */ -__STATIC_INLINE void SCB_CleanDCache (void) -{ - #if (__DCACHE_PRESENT == 1) - uint32_t ccsidr, sshift, wshift, sw; - uint32_t sets, ways; - - SCB->CSSELR = (0UL << 1) | 0UL; // Level 1 data cache - ccsidr = SCB->CCSIDR; - sets = (uint32_t)(CCSIDR_SETS(ccsidr)); - sshift = (uint32_t)(CCSIDR_LSSHIFT(ccsidr) + 4UL); - ways = (uint32_t)(CCSIDR_WAYS(ccsidr)); - wshift = (uint32_t)((uint32_t)__CLZ(ways) & 0x1FUL); - - __DSB(); - - do { // clean D-Cache - uint32_t tmpways = ways; - do { - sw = ((tmpways << wshift) | (sets << sshift)); - SCB->DCCSW = sw; - } while(tmpways--); - } while(sets--); - - __DSB(); - __ISB(); - #endif -} - - -/** \brief Clean & Invalidate D-Cache - - The function cleans and Invalidates D-Cache - */ -__STATIC_INLINE void SCB_CleanInvalidateDCache (void) -{ - #if (__DCACHE_PRESENT == 1) - uint32_t ccsidr, sshift, wshift, sw; - uint32_t sets, ways; - - SCB->CSSELR = (0UL << 1) | 0UL; // Level 1 data cache - ccsidr = SCB->CCSIDR; - sets = (uint32_t)(CCSIDR_SETS(ccsidr)); - sshift = (uint32_t)(CCSIDR_LSSHIFT(ccsidr) + 4UL); - ways = (uint32_t)(CCSIDR_WAYS(ccsidr)); - wshift = (uint32_t)((uint32_t)__CLZ(ways) & 0x1FUL); - - __DSB(); - - do { // clean & invalidate D-Cache - uint32_t tmpways = ways; - do { - sw = ((tmpways << wshift) | (sets << sshift)); - SCB->DCCISW = sw; - } while(tmpways--); - } while(sets--); - - __DSB(); - __ISB(); - #endif -} - - -/** - \fn void SCB_InvalidateDCache_by_Addr(volatile uint32_t *addr, int32_t dsize) - \brief D-Cache Invalidate by address - \param[in] addr address (aligned to 32-byte boundary) - \param[in] dsize size of memory block (in number of bytes) -*/ -__STATIC_INLINE void SCB_InvalidateDCache_by_Addr (uint32_t *addr, int32_t dsize) -{ - #if (__DCACHE_PRESENT == 1) - int32_t op_size = dsize; - uint32_t op_addr = (uint32_t)addr; - uint32_t linesize = 32UL; // in Cortex-M7 size of cache line is fixed to 8 words (32 bytes) - - __DSB(); - - while (op_size > 0) { - SCB->DCIMVAC = op_addr; - op_addr += linesize; - op_size -= (int32_t)linesize; - } - - __DSB(); - __ISB(); - #endif -} - - -/** - \fn void SCB_CleanDCache_by_Addr(volatile uint32_t *addr, int32_t dsize) - \brief D-Cache Clean by address - \param[in] addr address (aligned to 32-byte boundary) - \param[in] dsize size of memory block (in number of bytes) -*/ -__STATIC_INLINE void SCB_CleanDCache_by_Addr (uint32_t *addr, int32_t dsize) -{ - #if (__DCACHE_PRESENT == 1) - int32_t op_size = dsize; - uint32_t op_addr = (uint32_t) addr; - uint32_t linesize = 32UL; // in Cortex-M7 size of cache line is fixed to 8 words (32 bytes) - - __DSB(); - - while (op_size > 0) { - SCB->DCCMVAC = op_addr; - op_addr += linesize; - op_size -= (int32_t)linesize; - } - - __DSB(); - __ISB(); - #endif -} - - -/** - \fn void SCB_CleanInvalidateDCache_by_Addr(volatile uint32_t *addr, int32_t dsize) - \brief D-Cache Clean and Invalidate by address - \param[in] addr address (aligned to 32-byte boundary) - \param[in] dsize size of memory block (in number of bytes) -*/ -__STATIC_INLINE void SCB_CleanInvalidateDCache_by_Addr (uint32_t *addr, int32_t dsize) -{ - #if (__DCACHE_PRESENT == 1) - int32_t op_size = dsize; - uint32_t op_addr = (uint32_t) addr; - uint32_t linesize = 32UL; // in Cortex-M7 size of cache line is fixed to 8 words (32 bytes) - - __DSB(); - - while (op_size > 0) { - SCB->DCCIMVAC = op_addr; - op_addr += linesize; - op_size -= (int32_t)linesize; - } - - __DSB(); - __ISB(); - #endif -} - - -/*@} end of CMSIS_Core_CacheFunctions */ - - - -/* ################################## SysTick function ############################################ */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_SysTickFunctions SysTick Functions - \brief Functions that configure the System. - @{ - */ - -#if (__Vendor_SysTickConfig == 0) - -/** \brief System Tick Configuration - - The function initializes the System Timer and its interrupt, and starts the System Tick Timer. - Counter is in free running mode to generate periodic interrupts. - - \param [in] ticks Number of ticks between two interrupts. - - \return 0 Function succeeded. - \return 1 Function failed. - - \note When the variable __Vendor_SysTickConfig is set to 1, then the - function SysTick_Config is not included. In this case, the file device.h - must contain a vendor-specific implementation of this function. - - */ -__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) -{ - if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) { return (1UL); } /* Reload value impossible */ - - SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ - NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ - SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ - SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | - SysTick_CTRL_TICKINT_Msk | - SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ - return (0UL); /* Function successful */ -} - -#endif - -/*@} end of CMSIS_Core_SysTickFunctions */ - - - -/* ##################################### Debug In/Output function ########################################### */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_core_DebugFunctions ITM Functions - \brief Functions that access the ITM debug interface. - @{ - */ - -extern volatile int32_t ITM_RxBuffer; /*!< External variable to receive characters. */ -#define ITM_RXBUFFER_EMPTY 0x5AA55AA5 /*!< Value identifying \ref ITM_RxBuffer is ready for next character. */ - - -/** \brief ITM Send Character - - The function transmits a character via the ITM channel 0, and - \li Just returns when no debugger is connected that has booked the output. - \li Is blocking when a debugger is connected, but the previous character sent has not been transmitted. - - \param [in] ch Character to transmit. - - \returns Character to transmit. - */ -__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch) -{ - if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) && /* ITM enabled */ - ((ITM->TER & 1UL ) != 0UL) ) /* ITM Port #0 enabled */ - { - while (ITM->PORT[0].u32 == 0UL) { __NOP(); } - ITM->PORT[0].u8 = (uint8_t)ch; - } - return (ch); -} - - -/** \brief ITM Receive Character - - The function inputs a character via the external variable \ref ITM_RxBuffer. - - \return Received character. - \return -1 No character pending. - */ -__STATIC_INLINE int32_t ITM_ReceiveChar (void) { - int32_t ch = -1; /* no character available */ - - if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY) { - ch = ITM_RxBuffer; - ITM_RxBuffer = ITM_RXBUFFER_EMPTY; /* ready for next character */ - } - - return (ch); -} - - -/** \brief ITM Check Character - - The function checks whether a character is pending for reading in the variable \ref ITM_RxBuffer. - - \return 0 No character available. - \return 1 Character available. - */ -__STATIC_INLINE int32_t ITM_CheckChar (void) { - - if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY) { - return (0); /* no character available */ - } else { - return (1); /* character available */ - } -} - -/*@} end of CMSIS_core_DebugFunctions */ - - - - -#ifdef __cplusplus -} -#endif - -#endif /* __CORE_CM7_H_DEPENDANT */ - -#endif /* __CMSIS_GENERIC */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/core_cmFunc.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/core_cmFunc.h deleted file mode 100644 index b6ad0a4c..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/core_cmFunc.h +++ /dev/null @@ -1,664 +0,0 @@ -/**************************************************************************//** - * @file core_cmFunc.h - * @brief CMSIS Cortex-M Core Function Access Header File - * @version V4.10 - * @date 18. March 2015 - * - * @note - * - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#ifndef __CORE_CMFUNC_H -#define __CORE_CMFUNC_H - - -/* ########################### Core Function Access ########################### */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions - @{ - */ - -#if defined ( __CC_ARM ) /*------------------RealView Compiler -----------------*/ -/* ARM armcc specific functions */ - -#if (__ARMCC_VERSION < 400677) - #error "Please use ARM Compiler Toolchain V4.0.677 or later!" -#endif - -/* intrinsic void __enable_irq(); */ -/* intrinsic void __disable_irq(); */ - -/** \brief Get Control Register - - This function returns the content of the Control Register. - - \return Control Register value - */ -__STATIC_INLINE uint32_t __get_CONTROL(void) -{ - register uint32_t __regControl __ASM("control"); - return(__regControl); -} - - -/** \brief Set Control Register - - This function writes the given value to the Control Register. - - \param [in] control Control Register value to set - */ -__STATIC_INLINE void __set_CONTROL(uint32_t control) -{ - register uint32_t __regControl __ASM("control"); - __regControl = control; -} - - -/** \brief Get IPSR Register - - This function returns the content of the IPSR Register. - - \return IPSR Register value - */ -__STATIC_INLINE uint32_t __get_IPSR(void) -{ - register uint32_t __regIPSR __ASM("ipsr"); - return(__regIPSR); -} - - -/** \brief Get APSR Register - - This function returns the content of the APSR Register. - - \return APSR Register value - */ -__STATIC_INLINE uint32_t __get_APSR(void) -{ - register uint32_t __regAPSR __ASM("apsr"); - return(__regAPSR); -} - - -/** \brief Get xPSR Register - - This function returns the content of the xPSR Register. - - \return xPSR Register value - */ -__STATIC_INLINE uint32_t __get_xPSR(void) -{ - register uint32_t __regXPSR __ASM("xpsr"); - return(__regXPSR); -} - - -/** \brief Get Process Stack Pointer - - This function returns the current value of the Process Stack Pointer (PSP). - - \return PSP Register value - */ -__STATIC_INLINE uint32_t __get_PSP(void) -{ - register uint32_t __regProcessStackPointer __ASM("psp"); - return(__regProcessStackPointer); -} - - -/** \brief Set Process Stack Pointer - - This function assigns the given value to the Process Stack Pointer (PSP). - - \param [in] topOfProcStack Process Stack Pointer value to set - */ -__STATIC_INLINE void __set_PSP(uint32_t topOfProcStack) -{ - register uint32_t __regProcessStackPointer __ASM("psp"); - __regProcessStackPointer = topOfProcStack; -} - - -/** \brief Get Main Stack Pointer - - This function returns the current value of the Main Stack Pointer (MSP). - - \return MSP Register value - */ -__STATIC_INLINE uint32_t __get_MSP(void) -{ - register uint32_t __regMainStackPointer __ASM("msp"); - return(__regMainStackPointer); -} - - -/** \brief Set Main Stack Pointer - - This function assigns the given value to the Main Stack Pointer (MSP). - - \param [in] topOfMainStack Main Stack Pointer value to set - */ -__STATIC_INLINE void __set_MSP(uint32_t topOfMainStack) -{ - register uint32_t __regMainStackPointer __ASM("msp"); - __regMainStackPointer = topOfMainStack; -} - - -/** \brief Get Priority Mask - - This function returns the current state of the priority mask bit from the Priority Mask Register. - - \return Priority Mask value - */ -__STATIC_INLINE uint32_t __get_PRIMASK(void) -{ - register uint32_t __regPriMask __ASM("primask"); - return(__regPriMask); -} - - -/** \brief Set Priority Mask - - This function assigns the given value to the Priority Mask Register. - - \param [in] priMask Priority Mask - */ -__STATIC_INLINE void __set_PRIMASK(uint32_t priMask) -{ - register uint32_t __regPriMask __ASM("primask"); - __regPriMask = (priMask); -} - - -#if (__CORTEX_M >= 0x03) || (__CORTEX_SC >= 300) - -/** \brief Enable FIQ - - This function enables FIQ interrupts by clearing the F-bit in the CPSR. - Can only be executed in Privileged modes. - */ -#define __enable_fault_irq __enable_fiq - - -/** \brief Disable FIQ - - This function disables FIQ interrupts by setting the F-bit in the CPSR. - Can only be executed in Privileged modes. - */ -#define __disable_fault_irq __disable_fiq - - -/** \brief Get Base Priority - - This function returns the current value of the Base Priority register. - - \return Base Priority register value - */ -__STATIC_INLINE uint32_t __get_BASEPRI(void) -{ - register uint32_t __regBasePri __ASM("basepri"); - return(__regBasePri); -} - - -/** \brief Set Base Priority - - This function assigns the given value to the Base Priority register. - - \param [in] basePri Base Priority value to set - */ -__STATIC_INLINE void __set_BASEPRI(uint32_t basePri) -{ - register uint32_t __regBasePri __ASM("basepri"); - __regBasePri = (basePri & 0xff); -} - - -/** \brief Set Base Priority with condition - - This function assigns the given value to the Base Priority register only if BASEPRI masking is disabled, - or the new value increases the BASEPRI priority level. - - \param [in] basePri Base Priority value to set - */ -__STATIC_INLINE void __set_BASEPRI_MAX(uint32_t basePri) -{ - register uint32_t __regBasePriMax __ASM("basepri_max"); - __regBasePriMax = (basePri & 0xff); -} - - -/** \brief Get Fault Mask - - This function returns the current value of the Fault Mask register. - - \return Fault Mask register value - */ -__STATIC_INLINE uint32_t __get_FAULTMASK(void) -{ - register uint32_t __regFaultMask __ASM("faultmask"); - return(__regFaultMask); -} - - -/** \brief Set Fault Mask - - This function assigns the given value to the Fault Mask register. - - \param [in] faultMask Fault Mask value to set - */ -__STATIC_INLINE void __set_FAULTMASK(uint32_t faultMask) -{ - register uint32_t __regFaultMask __ASM("faultmask"); - __regFaultMask = (faultMask & (uint32_t)1); -} - -#endif /* (__CORTEX_M >= 0x03) || (__CORTEX_SC >= 300) */ - - -#if (__CORTEX_M == 0x04) || (__CORTEX_M == 0x07) - -/** \brief Get FPSCR - - This function returns the current value of the Floating Point Status/Control register. - - \return Floating Point Status/Control register value - */ -__STATIC_INLINE uint32_t __get_FPSCR(void) -{ -#if (__FPU_PRESENT == 1) && (__FPU_USED == 1) - register uint32_t __regfpscr __ASM("fpscr"); - return(__regfpscr); -#else - return(0); -#endif -} - - -/** \brief Set FPSCR - - This function assigns the given value to the Floating Point Status/Control register. - - \param [in] fpscr Floating Point Status/Control value to set - */ -__STATIC_INLINE void __set_FPSCR(uint32_t fpscr) -{ -#if (__FPU_PRESENT == 1) && (__FPU_USED == 1) - register uint32_t __regfpscr __ASM("fpscr"); - __regfpscr = (fpscr); -#endif -} - -#endif /* (__CORTEX_M == 0x04) || (__CORTEX_M == 0x07) */ - - -#elif defined ( __GNUC__ ) /*------------------ GNU Compiler ---------------------*/ -/* GNU gcc specific functions */ - -/** \brief Enable IRQ Interrupts - - This function enables IRQ interrupts by clearing the I-bit in the CPSR. - Can only be executed in Privileged modes. - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __enable_irq(void) -{ - __ASM volatile ("cpsie i" : : : "memory"); -} - - -/** \brief Disable IRQ Interrupts - - This function disables IRQ interrupts by setting the I-bit in the CPSR. - Can only be executed in Privileged modes. - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __disable_irq(void) -{ - __ASM volatile ("cpsid i" : : : "memory"); -} - - -/** \brief Get Control Register - - This function returns the content of the Control Register. - - \return Control Register value - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_CONTROL(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, control" : "=r" (result) ); - return(result); -} - - -/** \brief Set Control Register - - This function writes the given value to the Control Register. - - \param [in] control Control Register value to set - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_CONTROL(uint32_t control) -{ - __ASM volatile ("MSR control, %0" : : "r" (control) : "memory"); -} - - -/** \brief Get IPSR Register - - This function returns the content of the IPSR Register. - - \return IPSR Register value - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_IPSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, ipsr" : "=r" (result) ); - return(result); -} - - -/** \brief Get APSR Register - - This function returns the content of the APSR Register. - - \return APSR Register value - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_APSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, apsr" : "=r" (result) ); - return(result); -} - - -/** \brief Get xPSR Register - - This function returns the content of the xPSR Register. - - \return xPSR Register value - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_xPSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, xpsr" : "=r" (result) ); - return(result); -} - - -/** \brief Get Process Stack Pointer - - This function returns the current value of the Process Stack Pointer (PSP). - - \return PSP Register value - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_PSP(void) -{ - register uint32_t result; - - __ASM volatile ("MRS %0, psp\n" : "=r" (result) ); - return(result); -} - - -/** \brief Set Process Stack Pointer - - This function assigns the given value to the Process Stack Pointer (PSP). - - \param [in] topOfProcStack Process Stack Pointer value to set - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_PSP(uint32_t topOfProcStack) -{ - __ASM volatile ("MSR psp, %0\n" : : "r" (topOfProcStack) : "sp"); -} - - -/** \brief Get Main Stack Pointer - - This function returns the current value of the Main Stack Pointer (MSP). - - \return MSP Register value - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_MSP(void) -{ - register uint32_t result; - - __ASM volatile ("MRS %0, msp\n" : "=r" (result) ); - return(result); -} - - -/** \brief Set Main Stack Pointer - - This function assigns the given value to the Main Stack Pointer (MSP). - - \param [in] topOfMainStack Main Stack Pointer value to set - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_MSP(uint32_t topOfMainStack) -{ - __ASM volatile ("MSR msp, %0\n" : : "r" (topOfMainStack) : "sp"); -} - - -/** \brief Get Priority Mask - - This function returns the current state of the priority mask bit from the Priority Mask Register. - - \return Priority Mask value - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_PRIMASK(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, primask" : "=r" (result) ); - return(result); -} - - -/** \brief Set Priority Mask - - This function assigns the given value to the Priority Mask Register. - - \param [in] priMask Priority Mask - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_PRIMASK(uint32_t priMask) -{ - __ASM volatile ("MSR primask, %0" : : "r" (priMask) : "memory"); -} - - -#if (__CORTEX_M >= 0x03) - -/** \brief Enable FIQ - - This function enables FIQ interrupts by clearing the F-bit in the CPSR. - Can only be executed in Privileged modes. - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __enable_fault_irq(void) -{ - __ASM volatile ("cpsie f" : : : "memory"); -} - - -/** \brief Disable FIQ - - This function disables FIQ interrupts by setting the F-bit in the CPSR. - Can only be executed in Privileged modes. - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __disable_fault_irq(void) -{ - __ASM volatile ("cpsid f" : : : "memory"); -} - - -/** \brief Get Base Priority - - This function returns the current value of the Base Priority register. - - \return Base Priority register value - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_BASEPRI(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, basepri" : "=r" (result) ); - return(result); -} - - -/** \brief Set Base Priority - - This function assigns the given value to the Base Priority register. - - \param [in] basePri Base Priority value to set - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_BASEPRI(uint32_t value) -{ - __ASM volatile ("MSR basepri, %0" : : "r" (value) : "memory"); -} - - -/** \brief Set Base Priority with condition - - This function assigns the given value to the Base Priority register only if BASEPRI masking is disabled, - or the new value increases the BASEPRI priority level. - - \param [in] basePri Base Priority value to set - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_BASEPRI_MAX(uint32_t value) -{ - __ASM volatile ("MSR basepri_max, %0" : : "r" (value) : "memory"); -} - - -/** \brief Get Fault Mask - - This function returns the current value of the Fault Mask register. - - \return Fault Mask register value - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_FAULTMASK(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, faultmask" : "=r" (result) ); - return(result); -} - - -/** \brief Set Fault Mask - - This function assigns the given value to the Fault Mask register. - - \param [in] faultMask Fault Mask value to set - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_FAULTMASK(uint32_t faultMask) -{ - __ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) : "memory"); -} - -#endif /* (__CORTEX_M >= 0x03) */ - - -#if (__CORTEX_M == 0x04) || (__CORTEX_M == 0x07) - -/** \brief Get FPSCR - - This function returns the current value of the Floating Point Status/Control register. - - \return Floating Point Status/Control register value - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_FPSCR(void) -{ -#if (__FPU_PRESENT == 1) && (__FPU_USED == 1) - uint32_t result; - - /* Empty asm statement works as a scheduling barrier */ - __ASM volatile (""); - __ASM volatile ("VMRS %0, fpscr" : "=r" (result) ); - __ASM volatile (""); - return(result); -#else - return(0); -#endif -} - - -/** \brief Set FPSCR - - This function assigns the given value to the Floating Point Status/Control register. - - \param [in] fpscr Floating Point Status/Control value to set - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_FPSCR(uint32_t fpscr) -{ -#if (__FPU_PRESENT == 1) && (__FPU_USED == 1) - /* Empty asm statement works as a scheduling barrier */ - __ASM volatile (""); - __ASM volatile ("VMSR fpscr, %0" : : "r" (fpscr) : "vfpcc"); - __ASM volatile (""); -#endif -} - -#endif /* (__CORTEX_M == 0x04) || (__CORTEX_M == 0x07) */ - - -#elif defined ( __ICCARM__ ) /*------------------ ICC Compiler -------------------*/ -/* IAR iccarm specific functions */ -#include - - -#elif defined ( __TMS470__ ) /*---------------- TI CCS Compiler ------------------*/ -/* TI CCS specific functions */ -#include - - -#elif defined ( __TASKING__ ) /*------------------ TASKING Compiler --------------*/ -/* TASKING carm specific functions */ -/* - * The CMSIS functions have been implemented as intrinsics in the compiler. - * Please use "carm -?i" to get an up to date list of all intrinsics, - * Including the CMSIS ones. - */ - - -#elif defined ( __CSMC__ ) /*------------------ COSMIC Compiler -------------------*/ -/* Cosmic specific functions */ -#include - -#endif - -/*@} end of CMSIS_Core_RegAccFunctions */ - -#endif /* __CORE_CMFUNC_H */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/core_cmInstr.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/core_cmInstr.h deleted file mode 100644 index fca425c5..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/core_cmInstr.h +++ /dev/null @@ -1,916 +0,0 @@ -/**************************************************************************//** - * @file core_cmInstr.h - * @brief CMSIS Cortex-M Core Instruction Access Header File - * @version V4.10 - * @date 18. March 2015 - * - * @note - * - ******************************************************************************/ -/* Copyright (c) 2009 - 2014 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#ifndef __CORE_CMINSTR_H -#define __CORE_CMINSTR_H - - -/* ########################## Core Instruction Access ######################### */ -/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface - Access to dedicated instructions - @{ -*/ - -#if defined ( __CC_ARM ) /*------------------RealView Compiler -----------------*/ -/* ARM armcc specific functions */ - -#if (__ARMCC_VERSION < 400677) - #error "Please use ARM Compiler Toolchain V4.0.677 or later!" -#endif - - -/** \brief No Operation - - No Operation does nothing. This instruction can be used for code alignment purposes. - */ -#define __NOP __nop - - -/** \brief Wait For Interrupt - - Wait For Interrupt is a hint instruction that suspends execution - until one of a number of events occurs. - */ -#define __WFI __wfi - - -/** \brief Wait For Event - - Wait For Event is a hint instruction that permits the processor to enter - a low-power state until one of a number of events occurs. - */ -#define __WFE __wfe - - -/** \brief Send Event - - Send Event is a hint instruction. It causes an event to be signaled to the CPU. - */ -#define __SEV __sev - - -/** \brief Instruction Synchronization Barrier - - Instruction Synchronization Barrier flushes the pipeline in the processor, - so that all instructions following the ISB are fetched from cache or - memory, after the instruction has been completed. - */ -#define __ISB() do {\ - __schedule_barrier();\ - __isb(0xF);\ - __schedule_barrier();\ - } while (0) - -/** \brief Data Synchronization Barrier - - This function acts as a special kind of Data Memory Barrier. - It completes when all explicit memory accesses before this instruction complete. - */ -#define __DSB() do {\ - __schedule_barrier();\ - __dsb(0xF);\ - __schedule_barrier();\ - } while (0) - -/** \brief Data Memory Barrier - - This function ensures the apparent order of the explicit memory operations before - and after the instruction, without ensuring their completion. - */ -#define __DMB() do {\ - __schedule_barrier();\ - __dmb(0xF);\ - __schedule_barrier();\ - } while (0) - -/** \brief Reverse byte order (32 bit) - - This function reverses the byte order in integer value. - - \param [in] value Value to reverse - \return Reversed value - */ -#define __REV __rev - - -/** \brief Reverse byte order (16 bit) - - This function reverses the byte order in two unsigned short values. - - \param [in] value Value to reverse - \return Reversed value - */ -#ifndef __NO_EMBEDDED_ASM -__attribute__((section(".rev16_text"))) __STATIC_INLINE __ASM uint32_t __REV16(uint32_t value) -{ - rev16 r0, r0 - bx lr -} -#endif - -/** \brief Reverse byte order in signed short value - - This function reverses the byte order in a signed short value with sign extension to integer. - - \param [in] value Value to reverse - \return Reversed value - */ -#ifndef __NO_EMBEDDED_ASM -__attribute__((section(".revsh_text"))) __STATIC_INLINE __ASM int32_t __REVSH(int32_t value) -{ - revsh r0, r0 - bx lr -} -#endif - - -/** \brief Rotate Right in unsigned value (32 bit) - - This function Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits. - - \param [in] value Value to rotate - \param [in] value Number of Bits to rotate - \return Rotated value - */ -#define __ROR __ror - - -/** \brief Breakpoint - - This function causes the processor to enter Debug state. - Debug tools can use this to investigate system state when the instruction at a particular address is reached. - - \param [in] value is ignored by the processor. - If required, a debugger can use it to store additional information about the breakpoint. - */ -#define __BKPT(value) __breakpoint(value) - - -/** \brief Reverse bit order of value - - This function reverses the bit order of the given value. - - \param [in] value Value to reverse - \return Reversed value - */ -#if (__CORTEX_M >= 0x03) || (__CORTEX_SC >= 300) - #define __RBIT __rbit -#else -__attribute__((always_inline)) __STATIC_INLINE uint32_t __RBIT(uint32_t value) -{ - uint32_t result; - int32_t s = 4 /*sizeof(v)*/ * 8 - 1; // extra shift needed at end - - result = value; // r will be reversed bits of v; first get LSB of v - for (value >>= 1; value; value >>= 1) - { - result <<= 1; - result |= value & 1; - s--; - } - result <<= s; // shift when v's highest bits are zero - return(result); -} -#endif - - -/** \brief Count leading zeros - - This function counts the number of leading zeros of a data value. - - \param [in] value Value to count the leading zeros - \return number of leading zeros in value - */ -#define __CLZ __clz - - -#if (__CORTEX_M >= 0x03) || (__CORTEX_SC >= 300) - -/** \brief LDR Exclusive (8 bit) - - This function executes a exclusive LDR instruction for 8 bit value. - - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -#define __LDREXB(ptr) ((uint8_t ) __ldrex(ptr)) - - -/** \brief LDR Exclusive (16 bit) - - This function executes a exclusive LDR instruction for 16 bit values. - - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -#define __LDREXH(ptr) ((uint16_t) __ldrex(ptr)) - - -/** \brief LDR Exclusive (32 bit) - - This function executes a exclusive LDR instruction for 32 bit values. - - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -#define __LDREXW(ptr) ((uint32_t ) __ldrex(ptr)) - - -/** \brief STR Exclusive (8 bit) - - This function executes a exclusive STR instruction for 8 bit values. - - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STREXB(value, ptr) __strex(value, ptr) - - -/** \brief STR Exclusive (16 bit) - - This function executes a exclusive STR instruction for 16 bit values. - - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STREXH(value, ptr) __strex(value, ptr) - - -/** \brief STR Exclusive (32 bit) - - This function executes a exclusive STR instruction for 32 bit values. - - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STREXW(value, ptr) __strex(value, ptr) - - -/** \brief Remove the exclusive lock - - This function removes the exclusive lock which is created by LDREX. - - */ -#define __CLREX __clrex - - -/** \brief Signed Saturate - - This function saturates a signed value. - - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (1..32) - \return Saturated value - */ -#define __SSAT __ssat - - -/** \brief Unsigned Saturate - - This function saturates an unsigned value. - - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (0..31) - \return Saturated value - */ -#define __USAT __usat - - -/** \brief Rotate Right with Extend (32 bit) - - This function moves each bit of a bitstring right by one bit. - The carry input is shifted in at the left end of the bitstring. - - \param [in] value Value to rotate - \return Rotated value - */ -#ifndef __NO_EMBEDDED_ASM -__attribute__((section(".rrx_text"))) __STATIC_INLINE __ASM uint32_t __RRX(uint32_t value) -{ - rrx r0, r0 - bx lr -} -#endif - - -/** \brief LDRT Unprivileged (8 bit) - - This function executes a Unprivileged LDRT instruction for 8 bit value. - - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -#define __LDRBT(ptr) ((uint8_t ) __ldrt(ptr)) - - -/** \brief LDRT Unprivileged (16 bit) - - This function executes a Unprivileged LDRT instruction for 16 bit values. - - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -#define __LDRHT(ptr) ((uint16_t) __ldrt(ptr)) - - -/** \brief LDRT Unprivileged (32 bit) - - This function executes a Unprivileged LDRT instruction for 32 bit values. - - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -#define __LDRT(ptr) ((uint32_t ) __ldrt(ptr)) - - -/** \brief STRT Unprivileged (8 bit) - - This function executes a Unprivileged STRT instruction for 8 bit values. - - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -#define __STRBT(value, ptr) __strt(value, ptr) - - -/** \brief STRT Unprivileged (16 bit) - - This function executes a Unprivileged STRT instruction for 16 bit values. - - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -#define __STRHT(value, ptr) __strt(value, ptr) - - -/** \brief STRT Unprivileged (32 bit) - - This function executes a Unprivileged STRT instruction for 32 bit values. - - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -#define __STRT(value, ptr) __strt(value, ptr) - -#endif /* (__CORTEX_M >= 0x03) || (__CORTEX_SC >= 300) */ - - -#elif defined ( __GNUC__ ) /*------------------ GNU Compiler ---------------------*/ -/* GNU gcc specific functions */ - -/* Define macros for porting to both thumb1 and thumb2. - * For thumb1, use low register (r0-r7), specified by constrant "l" - * Otherwise, use general registers, specified by constrant "r" */ -#if defined (__thumb__) && !defined (__thumb2__) -#define __CMSIS_GCC_OUT_REG(r) "=l" (r) -#define __CMSIS_GCC_USE_REG(r) "l" (r) -#else -#define __CMSIS_GCC_OUT_REG(r) "=r" (r) -#define __CMSIS_GCC_USE_REG(r) "r" (r) -#endif - -/** \brief No Operation - - No Operation does nothing. This instruction can be used for code alignment purposes. - */ -__attribute__((always_inline)) __STATIC_INLINE void __NOP(void) -{ - __ASM volatile ("nop"); -} - - -/** \brief Wait For Interrupt - - Wait For Interrupt is a hint instruction that suspends execution - until one of a number of events occurs. - */ -__attribute__((always_inline)) __STATIC_INLINE void __WFI(void) -{ - __ASM volatile ("wfi"); -} - - -/** \brief Wait For Event - - Wait For Event is a hint instruction that permits the processor to enter - a low-power state until one of a number of events occurs. - */ -__attribute__((always_inline)) __STATIC_INLINE void __WFE(void) -{ - __ASM volatile ("wfe"); -} - - -/** \brief Send Event - - Send Event is a hint instruction. It causes an event to be signaled to the CPU. - */ -__attribute__((always_inline)) __STATIC_INLINE void __SEV(void) -{ - __ASM volatile ("sev"); -} - - -/** \brief Instruction Synchronization Barrier - - Instruction Synchronization Barrier flushes the pipeline in the processor, - so that all instructions following the ISB are fetched from cache or - memory, after the instruction has been completed. - */ -__attribute__((always_inline)) __STATIC_INLINE void __ISB(void) -{ - __ASM volatile ("isb 0xF":::"memory"); -} - - -/** \brief Data Synchronization Barrier - - This function acts as a special kind of Data Memory Barrier. - It completes when all explicit memory accesses before this instruction complete. - */ -__attribute__((always_inline)) __STATIC_INLINE void __DSB(void) -{ - __ASM volatile ("dsb 0xF":::"memory"); -} - - -/** \brief Data Memory Barrier - - This function ensures the apparent order of the explicit memory operations before - and after the instruction, without ensuring their completion. - */ -__attribute__((always_inline)) __STATIC_INLINE void __DMB(void) -{ - __ASM volatile ("dmb 0xF":::"memory"); -} - - -/** \brief Reverse byte order (32 bit) - - This function reverses the byte order in integer value. - - \param [in] value Value to reverse - \return Reversed value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __REV(uint32_t value) -{ -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) - return __builtin_bswap32(value); -#else - uint32_t result; - - __ASM volatile ("rev %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); - return(result); -#endif -} - - -/** \brief Reverse byte order (16 bit) - - This function reverses the byte order in two unsigned short values. - - \param [in] value Value to reverse - \return Reversed value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __REV16(uint32_t value) -{ - uint32_t result; - - __ASM volatile ("rev16 %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); - return(result); -} - - -/** \brief Reverse byte order in signed short value - - This function reverses the byte order in a signed short value with sign extension to integer. - - \param [in] value Value to reverse - \return Reversed value - */ -__attribute__((always_inline)) __STATIC_INLINE int32_t __REVSH(int32_t value) -{ -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - return (short)__builtin_bswap16(value); -#else - uint32_t result; - - __ASM volatile ("revsh %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); - return(result); -#endif -} - - -/** \brief Rotate Right in unsigned value (32 bit) - - This function Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits. - - \param [in] value Value to rotate - \param [in] value Number of Bits to rotate - \return Rotated value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __ROR(uint32_t op1, uint32_t op2) -{ - return (op1 >> op2) | (op1 << (32 - op2)); -} - - -/** \brief Breakpoint - - This function causes the processor to enter Debug state. - Debug tools can use this to investigate system state when the instruction at a particular address is reached. - - \param [in] value is ignored by the processor. - If required, a debugger can use it to store additional information about the breakpoint. - */ -#define __BKPT(value) __ASM volatile ("bkpt "#value) - - -/** \brief Reverse bit order of value - - This function reverses the bit order of the given value. - - \param [in] value Value to reverse - \return Reversed value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __RBIT(uint32_t value) -{ - uint32_t result; - -#if (__CORTEX_M >= 0x03) || (__CORTEX_SC >= 300) - __ASM volatile ("rbit %0, %1" : "=r" (result) : "r" (value) ); -#else - int32_t s = 4 /*sizeof(v)*/ * 8 - 1; // extra shift needed at end - - result = value; // r will be reversed bits of v; first get LSB of v - for (value >>= 1; value; value >>= 1) - { - result <<= 1; - result |= value & 1; - s--; - } - result <<= s; // shift when v's highest bits are zero -#endif - return(result); -} - - -/** \brief Count leading zeros - - This function counts the number of leading zeros of a data value. - - \param [in] value Value to count the leading zeros - \return number of leading zeros in value - */ -#define __CLZ __builtin_clz - - -#if (__CORTEX_M >= 0x03) || (__CORTEX_SC >= 300) - -/** \brief LDR Exclusive (8 bit) - - This function executes a exclusive LDR instruction for 8 bit value. - - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -__attribute__((always_inline)) __STATIC_INLINE uint8_t __LDREXB(volatile uint8_t *addr) -{ - uint32_t result; - -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - __ASM volatile ("ldrexb %0, %1" : "=r" (result) : "Q" (*addr) ); -#else - /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not - accepted by assembler. So has to use following less efficient pattern. - */ - __ASM volatile ("ldrexb %0, [%1]" : "=r" (result) : "r" (addr) : "memory" ); -#endif - return ((uint8_t) result); /* Add explicit type cast here */ -} - - -/** \brief LDR Exclusive (16 bit) - - This function executes a exclusive LDR instruction for 16 bit values. - - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -__attribute__((always_inline)) __STATIC_INLINE uint16_t __LDREXH(volatile uint16_t *addr) -{ - uint32_t result; - -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - __ASM volatile ("ldrexh %0, %1" : "=r" (result) : "Q" (*addr) ); -#else - /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not - accepted by assembler. So has to use following less efficient pattern. - */ - __ASM volatile ("ldrexh %0, [%1]" : "=r" (result) : "r" (addr) : "memory" ); -#endif - return ((uint16_t) result); /* Add explicit type cast here */ -} - - -/** \brief LDR Exclusive (32 bit) - - This function executes a exclusive LDR instruction for 32 bit values. - - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __LDREXW(volatile uint32_t *addr) -{ - uint32_t result; - - __ASM volatile ("ldrex %0, %1" : "=r" (result) : "Q" (*addr) ); - return(result); -} - - -/** \brief STR Exclusive (8 bit) - - This function executes a exclusive STR instruction for 8 bit values. - - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __STREXB(uint8_t value, volatile uint8_t *addr) -{ - uint32_t result; - - __ASM volatile ("strexb %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" ((uint32_t)value) ); - return(result); -} - - -/** \brief STR Exclusive (16 bit) - - This function executes a exclusive STR instruction for 16 bit values. - - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __STREXH(uint16_t value, volatile uint16_t *addr) -{ - uint32_t result; - - __ASM volatile ("strexh %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" ((uint32_t)value) ); - return(result); -} - - -/** \brief STR Exclusive (32 bit) - - This function executes a exclusive STR instruction for 32 bit values. - - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __STREXW(uint32_t value, volatile uint32_t *addr) -{ - uint32_t result; - - __ASM volatile ("strex %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" (value) ); - return(result); -} - - -/** \brief Remove the exclusive lock - - This function removes the exclusive lock which is created by LDREX. - - */ -__attribute__((always_inline)) __STATIC_INLINE void __CLREX(void) -{ - __ASM volatile ("clrex" ::: "memory"); -} - - -/** \brief Signed Saturate - - This function saturates a signed value. - - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (1..32) - \return Saturated value - */ -#define __SSAT(ARG1,ARG2) \ -({ \ - uint32_t __RES, __ARG1 = (ARG1); \ - __ASM ("ssat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ - __RES; \ - }) - - -/** \brief Unsigned Saturate - - This function saturates an unsigned value. - - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (0..31) - \return Saturated value - */ -#define __USAT(ARG1,ARG2) \ -({ \ - uint32_t __RES, __ARG1 = (ARG1); \ - __ASM ("usat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ - __RES; \ - }) - - -/** \brief Rotate Right with Extend (32 bit) - - This function moves each bit of a bitstring right by one bit. - The carry input is shifted in at the left end of the bitstring. - - \param [in] value Value to rotate - \return Rotated value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __RRX(uint32_t value) -{ - uint32_t result; - - __ASM volatile ("rrx %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); - return(result); -} - - -/** \brief LDRT Unprivileged (8 bit) - - This function executes a Unprivileged LDRT instruction for 8 bit value. - - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -__attribute__((always_inline)) __STATIC_INLINE uint8_t __LDRBT(volatile uint8_t *addr) -{ - uint32_t result; - -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - __ASM volatile ("ldrbt %0, %1" : "=r" (result) : "Q" (*addr) ); -#else - /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not - accepted by assembler. So has to use following less efficient pattern. - */ - __ASM volatile ("ldrbt %0, [%1]" : "=r" (result) : "r" (addr) : "memory" ); -#endif - return ((uint8_t) result); /* Add explicit type cast here */ -} - - -/** \brief LDRT Unprivileged (16 bit) - - This function executes a Unprivileged LDRT instruction for 16 bit values. - - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -__attribute__((always_inline)) __STATIC_INLINE uint16_t __LDRHT(volatile uint16_t *addr) -{ - uint32_t result; - -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - __ASM volatile ("ldrht %0, %1" : "=r" (result) : "Q" (*addr) ); -#else - /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not - accepted by assembler. So has to use following less efficient pattern. - */ - __ASM volatile ("ldrht %0, [%1]" : "=r" (result) : "r" (addr) : "memory" ); -#endif - return ((uint16_t) result); /* Add explicit type cast here */ -} - - -/** \brief LDRT Unprivileged (32 bit) - - This function executes a Unprivileged LDRT instruction for 32 bit values. - - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __LDRT(volatile uint32_t *addr) -{ - uint32_t result; - - __ASM volatile ("ldrt %0, %1" : "=r" (result) : "Q" (*addr) ); - return(result); -} - - -/** \brief STRT Unprivileged (8 bit) - - This function executes a Unprivileged STRT instruction for 8 bit values. - - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__attribute__((always_inline)) __STATIC_INLINE void __STRBT(uint8_t value, volatile uint8_t *addr) -{ - __ASM volatile ("strbt %1, %0" : "=Q" (*addr) : "r" ((uint32_t)value) ); -} - - -/** \brief STRT Unprivileged (16 bit) - - This function executes a Unprivileged STRT instruction for 16 bit values. - - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__attribute__((always_inline)) __STATIC_INLINE void __STRHT(uint16_t value, volatile uint16_t *addr) -{ - __ASM volatile ("strht %1, %0" : "=Q" (*addr) : "r" ((uint32_t)value) ); -} - - -/** \brief STRT Unprivileged (32 bit) - - This function executes a Unprivileged STRT instruction for 32 bit values. - - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__attribute__((always_inline)) __STATIC_INLINE void __STRT(uint32_t value, volatile uint32_t *addr) -{ - __ASM volatile ("strt %1, %0" : "=Q" (*addr) : "r" (value) ); -} - -#endif /* (__CORTEX_M >= 0x03) || (__CORTEX_SC >= 300) */ - - -#elif defined ( __ICCARM__ ) /*------------------ ICC Compiler -------------------*/ -/* IAR iccarm specific functions */ -#include - - -#elif defined ( __TMS470__ ) /*---------------- TI CCS Compiler ------------------*/ -/* TI CCS specific functions */ -#include - - -#elif defined ( __TASKING__ ) /*------------------ TASKING Compiler --------------*/ -/* TASKING carm specific functions */ -/* - * The CMSIS functions have been implemented as intrinsics in the compiler. - * Please use "carm -?i" to get an up to date list of all intrinsics, - * Including the CMSIS ones. - */ - - -#elif defined ( __CSMC__ ) /*------------------ COSMIC Compiler -------------------*/ -/* Cosmic specific functions */ -#include - -#endif - -/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ - -#endif /* __CORE_CMINSTR_H */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/core_cmSimd.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/core_cmSimd.h deleted file mode 100644 index 7b8e37ff..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/core_cmSimd.h +++ /dev/null @@ -1,697 +0,0 @@ -/**************************************************************************//** - * @file core_cmSimd.h - * @brief CMSIS Cortex-M SIMD Header File - * @version V4.10 - * @date 18. March 2015 - * - * @note - * - ******************************************************************************/ -/* Copyright (c) 2009 - 2014 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#endif - -#ifndef __CORE_CMSIMD_H -#define __CORE_CMSIMD_H - -#ifdef __cplusplus - extern "C" { -#endif - - -/******************************************************************************* - * Hardware Abstraction Layer - ******************************************************************************/ - - -/* ################### Compiler specific Intrinsics ########################### */ -/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics - Access to dedicated SIMD instructions - @{ -*/ - -#if defined ( __CC_ARM ) /*------------------RealView Compiler -----------------*/ -/* ARM armcc specific functions */ -#define __SADD8 __sadd8 -#define __QADD8 __qadd8 -#define __SHADD8 __shadd8 -#define __UADD8 __uadd8 -#define __UQADD8 __uqadd8 -#define __UHADD8 __uhadd8 -#define __SSUB8 __ssub8 -#define __QSUB8 __qsub8 -#define __SHSUB8 __shsub8 -#define __USUB8 __usub8 -#define __UQSUB8 __uqsub8 -#define __UHSUB8 __uhsub8 -#define __SADD16 __sadd16 -#define __QADD16 __qadd16 -#define __SHADD16 __shadd16 -#define __UADD16 __uadd16 -#define __UQADD16 __uqadd16 -#define __UHADD16 __uhadd16 -#define __SSUB16 __ssub16 -#define __QSUB16 __qsub16 -#define __SHSUB16 __shsub16 -#define __USUB16 __usub16 -#define __UQSUB16 __uqsub16 -#define __UHSUB16 __uhsub16 -#define __SASX __sasx -#define __QASX __qasx -#define __SHASX __shasx -#define __UASX __uasx -#define __UQASX __uqasx -#define __UHASX __uhasx -#define __SSAX __ssax -#define __QSAX __qsax -#define __SHSAX __shsax -#define __USAX __usax -#define __UQSAX __uqsax -#define __UHSAX __uhsax -#define __USAD8 __usad8 -#define __USADA8 __usada8 -#define __SSAT16 __ssat16 -#define __USAT16 __usat16 -#define __UXTB16 __uxtb16 -#define __UXTAB16 __uxtab16 -#define __SXTB16 __sxtb16 -#define __SXTAB16 __sxtab16 -#define __SMUAD __smuad -#define __SMUADX __smuadx -#define __SMLAD __smlad -#define __SMLADX __smladx -#define __SMLALD __smlald -#define __SMLALDX __smlaldx -#define __SMUSD __smusd -#define __SMUSDX __smusdx -#define __SMLSD __smlsd -#define __SMLSDX __smlsdx -#define __SMLSLD __smlsld -#define __SMLSLDX __smlsldx -#define __SEL __sel -#define __QADD __qadd -#define __QSUB __qsub - -#define __PKHBT(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0x0000FFFFUL) | \ - ((((uint32_t)(ARG2)) << (ARG3)) & 0xFFFF0000UL) ) - -#define __PKHTB(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0xFFFF0000UL) | \ - ((((uint32_t)(ARG2)) >> (ARG3)) & 0x0000FFFFUL) ) - -#define __SMMLA(ARG1,ARG2,ARG3) ( (int32_t)((((int64_t)(ARG1) * (ARG2)) + \ - ((int64_t)(ARG3) << 32) ) >> 32)) - - -#elif defined ( __GNUC__ ) /*------------------ GNU Compiler ---------------------*/ -/* GNU gcc specific functions */ -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("qadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("shadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uqadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uhadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("ssub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("qsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("shsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __USUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("usub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uqsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uhsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("qadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("shadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uqadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uhadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("ssub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("qsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("shsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __USUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("usub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uqsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uhsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("qasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("shasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uqasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uhasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("ssax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("qsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("shsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __USAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("usax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uqsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uhsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __USAD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("usad8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __USADA8(uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("usada8 %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -#define __SSAT16(ARG1,ARG2) \ -({ \ - uint32_t __RES, __ARG1 = (ARG1); \ - __ASM ("ssat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ - __RES; \ - }) - -#define __USAT16(ARG1,ARG2) \ -({ \ - uint32_t __RES, __ARG1 = (ARG1); \ - __ASM ("usat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ - __RES; \ - }) - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UXTB16(uint32_t op1) -{ - uint32_t result; - - __ASM volatile ("uxtb16 %0, %1" : "=r" (result) : "r" (op1)); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UXTAB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SXTB16(uint32_t op1) -{ - uint32_t result; - - __ASM volatile ("sxtb16 %0, %1" : "=r" (result) : "r" (op1)); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SXTAB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMUAD (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("smuad %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMUADX (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("smuadx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMLAD (uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("smlad %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMLADX (uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("smladx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint64_t __SMLALD (uint32_t op1, uint32_t op2, uint64_t acc) -{ - union llreg_u{ - uint32_t w32[2]; - uint64_t w64; - } llr; - llr.w64 = acc; - -#ifndef __ARMEB__ // Little endian - __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); -#else // Big endian - __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); -#endif - - return(llr.w64); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint64_t __SMLALDX (uint32_t op1, uint32_t op2, uint64_t acc) -{ - union llreg_u{ - uint32_t w32[2]; - uint64_t w64; - } llr; - llr.w64 = acc; - -#ifndef __ARMEB__ // Little endian - __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); -#else // Big endian - __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); -#endif - - return(llr.w64); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMUSD (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("smusd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMUSDX (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("smusdx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMLSD (uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("smlsd %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMLSDX (uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("smlsdx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint64_t __SMLSLD (uint32_t op1, uint32_t op2, uint64_t acc) -{ - union llreg_u{ - uint32_t w32[2]; - uint64_t w64; - } llr; - llr.w64 = acc; - -#ifndef __ARMEB__ // Little endian - __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); -#else // Big endian - __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); -#endif - - return(llr.w64); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint64_t __SMLSLDX (uint32_t op1, uint32_t op2, uint64_t acc) -{ - union llreg_u{ - uint32_t w32[2]; - uint64_t w64; - } llr; - llr.w64 = acc; - -#ifndef __ARMEB__ // Little endian - __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); -#else // Big endian - __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); -#endif - - return(llr.w64); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SEL (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sel %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QADD(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("qadd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QSUB(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("qsub %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -#define __PKHBT(ARG1,ARG2,ARG3) \ -({ \ - uint32_t __RES, __ARG1 = (ARG1), __ARG2 = (ARG2); \ - __ASM ("pkhbt %0, %1, %2, lsl %3" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2), "I" (ARG3) ); \ - __RES; \ - }) - -#define __PKHTB(ARG1,ARG2,ARG3) \ -({ \ - uint32_t __RES, __ARG1 = (ARG1), __ARG2 = (ARG2); \ - if (ARG3 == 0) \ - __ASM ("pkhtb %0, %1, %2" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2) ); \ - else \ - __ASM ("pkhtb %0, %1, %2, asr %3" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2), "I" (ARG3) ); \ - __RES; \ - }) - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMMLA (int32_t op1, int32_t op2, int32_t op3) -{ - int32_t result; - - __ASM volatile ("smmla %0, %1, %2, %3" : "=r" (result): "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - - -#elif defined ( __ICCARM__ ) /*------------------ ICC Compiler -------------------*/ -/* IAR iccarm specific functions */ -#include - - -#elif defined ( __TMS470__ ) /*---------------- TI CCS Compiler ------------------*/ -/* TI CCS specific functions */ -#include - - -#elif defined ( __TASKING__ ) /*------------------ TASKING Compiler --------------*/ -/* TASKING carm specific functions */ -/* not yet supported */ - - -#elif defined ( __CSMC__ ) /*------------------ COSMIC Compiler -------------------*/ -/* Cosmic specific functions */ -#include - -#endif - -/*@} end of group CMSIS_SIMD_intrinsics */ - - -#ifdef __cplusplus -} -#endif - -#endif /* __CORE_CMSIMD_H */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/core_sc000.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/core_sc000.h deleted file mode 100644 index 44cb0274..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/core_sc000.h +++ /dev/null @@ -1,864 +0,0 @@ -/**************************************************************************//** - * @file core_sc000.h - * @brief CMSIS SC000 Core Peripheral Access Layer Header File - * @version V4.10 - * @date 18. March 2015 - * - * @note - * - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#endif - -#ifndef __CORE_SC000_H_GENERIC -#define __CORE_SC000_H_GENERIC - -#ifdef __cplusplus - extern "C" { -#endif - -/** \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions - CMSIS violates the following MISRA-C:2004 rules: - - \li Required Rule 8.5, object/function definition in header file.
- Function definitions in header files are used to allow 'inlining'. - - \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
- Unions are used for effective representation of core registers. - - \li Advisory Rule 19.7, Function-like macro defined.
- Function-like macros are used to allow more efficient code. - */ - - -/******************************************************************************* - * CMSIS definitions - ******************************************************************************/ -/** \ingroup SC000 - @{ - */ - -/* CMSIS SC000 definitions */ -#define __SC000_CMSIS_VERSION_MAIN (0x04) /*!< [31:16] CMSIS HAL main version */ -#define __SC000_CMSIS_VERSION_SUB (0x00) /*!< [15:0] CMSIS HAL sub version */ -#define __SC000_CMSIS_VERSION ((__SC000_CMSIS_VERSION_MAIN << 16) | \ - __SC000_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */ - -#define __CORTEX_SC (000) /*!< Cortex secure core */ - - -#if defined ( __CC_ARM ) - #define __ASM __asm /*!< asm keyword for ARM Compiler */ - #define __INLINE __inline /*!< inline keyword for ARM Compiler */ - #define __STATIC_INLINE static __inline - -#elif defined ( __GNUC__ ) - #define __ASM __asm /*!< asm keyword for GNU Compiler */ - #define __INLINE inline /*!< inline keyword for GNU Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __ICCARM__ ) - #define __ASM __asm /*!< asm keyword for IAR Compiler */ - #define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */ - #define __STATIC_INLINE static inline - -#elif defined ( __TMS470__ ) - #define __ASM __asm /*!< asm keyword for TI CCS Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __TASKING__ ) - #define __ASM __asm /*!< asm keyword for TASKING Compiler */ - #define __INLINE inline /*!< inline keyword for TASKING Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __CSMC__ ) - #define __packed - #define __ASM _asm /*!< asm keyword for COSMIC Compiler */ - #define __INLINE inline /*use -pc99 on compile line !< inline keyword for COSMIC Compiler */ - #define __STATIC_INLINE static inline - -#endif - -/** __FPU_USED indicates whether an FPU is used or not. - This core does not support an FPU at all -*/ -#define __FPU_USED 0 - -#if defined ( __CC_ARM ) - #if defined __TARGET_FPU_VFP - #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #endif - -#elif defined ( __GNUC__ ) - #if defined (__VFP_FP__) && !defined(__SOFTFP__) - #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #endif - -#elif defined ( __ICCARM__ ) - #if defined __ARMVFP__ - #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #endif - -#elif defined ( __TMS470__ ) - #if defined __TI__VFP_SUPPORT____ - #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #endif - -#elif defined ( __TASKING__ ) - #if defined __FPU_VFP__ - #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #endif - -#elif defined ( __CSMC__ ) /* Cosmic */ - #if ( __CSMC__ & 0x400) // FPU present for parser - #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #endif -#endif - -#include /* standard types definitions */ -#include /* Core Instruction Access */ -#include /* Core Function Access */ - -#ifdef __cplusplus -} -#endif - -#endif /* __CORE_SC000_H_GENERIC */ - -#ifndef __CMSIS_GENERIC - -#ifndef __CORE_SC000_H_DEPENDANT -#define __CORE_SC000_H_DEPENDANT - -#ifdef __cplusplus - extern "C" { -#endif - -/* check device defines and use defaults */ -#if defined __CHECK_DEVICE_DEFINES - #ifndef __SC000_REV - #define __SC000_REV 0x0000 - #warning "__SC000_REV not defined in device header file; using default!" - #endif - - #ifndef __MPU_PRESENT - #define __MPU_PRESENT 0 - #warning "__MPU_PRESENT not defined in device header file; using default!" - #endif - - #ifndef __NVIC_PRIO_BITS - #define __NVIC_PRIO_BITS 2 - #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" - #endif - - #ifndef __Vendor_SysTickConfig - #define __Vendor_SysTickConfig 0 - #warning "__Vendor_SysTickConfig not defined in device header file; using default!" - #endif -#endif - -/* IO definitions (access restrictions to peripheral registers) */ -/** - \defgroup CMSIS_glob_defs CMSIS Global Defines - - IO Type Qualifiers are used - \li to specify the access to peripheral variables. - \li for automatic generation of peripheral register debug information. -*/ -#ifdef __cplusplus - #define __I volatile /*!< Defines 'read only' permissions */ -#else - #define __I volatile const /*!< Defines 'read only' permissions */ -#endif -#define __O volatile /*!< Defines 'write only' permissions */ -#define __IO volatile /*!< Defines 'read / write' permissions */ - -/*@} end of group SC000 */ - - - -/******************************************************************************* - * Register Abstraction - Core Register contain: - - Core Register - - Core NVIC Register - - Core SCB Register - - Core SysTick Register - - Core MPU Register - ******************************************************************************/ -/** \defgroup CMSIS_core_register Defines and Type Definitions - \brief Type definitions and defines for Cortex-M processor based devices. -*/ - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_CORE Status and Control Registers - \brief Core Register type definitions. - @{ - */ - -/** \brief Union type to access the Application Program Status Register (APSR). - */ -typedef union -{ - struct - { - uint32_t _reserved0:28; /*!< bit: 0..27 Reserved */ - uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ - uint32_t C:1; /*!< bit: 29 Carry condition code flag */ - uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ - uint32_t N:1; /*!< bit: 31 Negative condition code flag */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} APSR_Type; - -/* APSR Register Definitions */ -#define APSR_N_Pos 31 /*!< APSR: N Position */ -#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ - -#define APSR_Z_Pos 30 /*!< APSR: Z Position */ -#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ - -#define APSR_C_Pos 29 /*!< APSR: C Position */ -#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ - -#define APSR_V_Pos 28 /*!< APSR: V Position */ -#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ - - -/** \brief Union type to access the Interrupt Program Status Register (IPSR). - */ -typedef union -{ - struct - { - uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ - uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} IPSR_Type; - -/* IPSR Register Definitions */ -#define IPSR_ISR_Pos 0 /*!< IPSR: ISR Position */ -#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ - - -/** \brief Union type to access the Special-Purpose Program Status Registers (xPSR). - */ -typedef union -{ - struct - { - uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ - uint32_t _reserved0:15; /*!< bit: 9..23 Reserved */ - uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */ - uint32_t _reserved1:3; /*!< bit: 25..27 Reserved */ - uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ - uint32_t C:1; /*!< bit: 29 Carry condition code flag */ - uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ - uint32_t N:1; /*!< bit: 31 Negative condition code flag */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} xPSR_Type; - -/* xPSR Register Definitions */ -#define xPSR_N_Pos 31 /*!< xPSR: N Position */ -#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ - -#define xPSR_Z_Pos 30 /*!< xPSR: Z Position */ -#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ - -#define xPSR_C_Pos 29 /*!< xPSR: C Position */ -#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ - -#define xPSR_V_Pos 28 /*!< xPSR: V Position */ -#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ - -#define xPSR_T_Pos 24 /*!< xPSR: T Position */ -#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ - -#define xPSR_ISR_Pos 0 /*!< xPSR: ISR Position */ -#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ - - -/** \brief Union type to access the Control Registers (CONTROL). - */ -typedef union -{ - struct - { - uint32_t _reserved0:1; /*!< bit: 0 Reserved */ - uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */ - uint32_t _reserved1:30; /*!< bit: 2..31 Reserved */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} CONTROL_Type; - -/* CONTROL Register Definitions */ -#define CONTROL_SPSEL_Pos 1 /*!< CONTROL: SPSEL Position */ -#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ - -/*@} end of group CMSIS_CORE */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) - \brief Type definitions for the NVIC Registers - @{ - */ - -/** \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). - */ -typedef struct -{ - __IO uint32_t ISER[1]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ - uint32_t RESERVED0[31]; - __IO uint32_t ICER[1]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ - uint32_t RSERVED1[31]; - __IO uint32_t ISPR[1]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ - uint32_t RESERVED2[31]; - __IO uint32_t ICPR[1]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ - uint32_t RESERVED3[31]; - uint32_t RESERVED4[64]; - __IO uint32_t IP[8]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register */ -} NVIC_Type; - -/*@} end of group CMSIS_NVIC */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_SCB System Control Block (SCB) - \brief Type definitions for the System Control Block Registers - @{ - */ - -/** \brief Structure type to access the System Control Block (SCB). - */ -typedef struct -{ - __I uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ - __IO uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ - __IO uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */ - __IO uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ - __IO uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ - __IO uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ - uint32_t RESERVED0[1]; - __IO uint32_t SHP[2]; /*!< Offset: 0x01C (R/W) System Handlers Priority Registers. [0] is RESERVED */ - __IO uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ - uint32_t RESERVED1[154]; - __IO uint32_t SFCR; /*!< Offset: 0x290 (R/W) Security Features Control Register */ -} SCB_Type; - -/* SCB CPUID Register Definitions */ -#define SCB_CPUID_IMPLEMENTER_Pos 24 /*!< SCB CPUID: IMPLEMENTER Position */ -#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ - -#define SCB_CPUID_VARIANT_Pos 20 /*!< SCB CPUID: VARIANT Position */ -#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ - -#define SCB_CPUID_ARCHITECTURE_Pos 16 /*!< SCB CPUID: ARCHITECTURE Position */ -#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ - -#define SCB_CPUID_PARTNO_Pos 4 /*!< SCB CPUID: PARTNO Position */ -#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ - -#define SCB_CPUID_REVISION_Pos 0 /*!< SCB CPUID: REVISION Position */ -#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ - -/* SCB Interrupt Control State Register Definitions */ -#define SCB_ICSR_NMIPENDSET_Pos 31 /*!< SCB ICSR: NMIPENDSET Position */ -#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */ - -#define SCB_ICSR_PENDSVSET_Pos 28 /*!< SCB ICSR: PENDSVSET Position */ -#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ - -#define SCB_ICSR_PENDSVCLR_Pos 27 /*!< SCB ICSR: PENDSVCLR Position */ -#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ - -#define SCB_ICSR_PENDSTSET_Pos 26 /*!< SCB ICSR: PENDSTSET Position */ -#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ - -#define SCB_ICSR_PENDSTCLR_Pos 25 /*!< SCB ICSR: PENDSTCLR Position */ -#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ - -#define SCB_ICSR_ISRPREEMPT_Pos 23 /*!< SCB ICSR: ISRPREEMPT Position */ -#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ - -#define SCB_ICSR_ISRPENDING_Pos 22 /*!< SCB ICSR: ISRPENDING Position */ -#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ - -#define SCB_ICSR_VECTPENDING_Pos 12 /*!< SCB ICSR: VECTPENDING Position */ -#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ - -#define SCB_ICSR_VECTACTIVE_Pos 0 /*!< SCB ICSR: VECTACTIVE Position */ -#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ - -/* SCB Interrupt Control State Register Definitions */ -#define SCB_VTOR_TBLOFF_Pos 7 /*!< SCB VTOR: TBLOFF Position */ -#define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ - -/* SCB Application Interrupt and Reset Control Register Definitions */ -#define SCB_AIRCR_VECTKEY_Pos 16 /*!< SCB AIRCR: VECTKEY Position */ -#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ - -#define SCB_AIRCR_VECTKEYSTAT_Pos 16 /*!< SCB AIRCR: VECTKEYSTAT Position */ -#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ - -#define SCB_AIRCR_ENDIANESS_Pos 15 /*!< SCB AIRCR: ENDIANESS Position */ -#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ - -#define SCB_AIRCR_SYSRESETREQ_Pos 2 /*!< SCB AIRCR: SYSRESETREQ Position */ -#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ - -#define SCB_AIRCR_VECTCLRACTIVE_Pos 1 /*!< SCB AIRCR: VECTCLRACTIVE Position */ -#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ - -/* SCB System Control Register Definitions */ -#define SCB_SCR_SEVONPEND_Pos 4 /*!< SCB SCR: SEVONPEND Position */ -#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ - -#define SCB_SCR_SLEEPDEEP_Pos 2 /*!< SCB SCR: SLEEPDEEP Position */ -#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ - -#define SCB_SCR_SLEEPONEXIT_Pos 1 /*!< SCB SCR: SLEEPONEXIT Position */ -#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ - -/* SCB Configuration Control Register Definitions */ -#define SCB_CCR_STKALIGN_Pos 9 /*!< SCB CCR: STKALIGN Position */ -#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */ - -#define SCB_CCR_UNALIGN_TRP_Pos 3 /*!< SCB CCR: UNALIGN_TRP Position */ -#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ - -/* SCB System Handler Control and State Register Definitions */ -#define SCB_SHCSR_SVCALLPENDED_Pos 15 /*!< SCB SHCSR: SVCALLPENDED Position */ -#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ - -/*@} end of group CMSIS_SCB */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB) - \brief Type definitions for the System Control and ID Register not in the SCB - @{ - */ - -/** \brief Structure type to access the System Control and ID Register not in the SCB. - */ -typedef struct -{ - uint32_t RESERVED0[2]; - __IO uint32_t ACTLR; /*!< Offset: 0x008 (R/W) Auxiliary Control Register */ -} SCnSCB_Type; - -/* Auxiliary Control Register Definitions */ -#define SCnSCB_ACTLR_DISMCYCINT_Pos 0 /*!< ACTLR: DISMCYCINT Position */ -#define SCnSCB_ACTLR_DISMCYCINT_Msk (1UL /*<< SCnSCB_ACTLR_DISMCYCINT_Pos*/) /*!< ACTLR: DISMCYCINT Mask */ - -/*@} end of group CMSIS_SCnotSCB */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_SysTick System Tick Timer (SysTick) - \brief Type definitions for the System Timer Registers. - @{ - */ - -/** \brief Structure type to access the System Timer (SysTick). - */ -typedef struct -{ - __IO uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ - __IO uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ - __IO uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ - __I uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ -} SysTick_Type; - -/* SysTick Control / Status Register Definitions */ -#define SysTick_CTRL_COUNTFLAG_Pos 16 /*!< SysTick CTRL: COUNTFLAG Position */ -#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ - -#define SysTick_CTRL_CLKSOURCE_Pos 2 /*!< SysTick CTRL: CLKSOURCE Position */ -#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ - -#define SysTick_CTRL_TICKINT_Pos 1 /*!< SysTick CTRL: TICKINT Position */ -#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ - -#define SysTick_CTRL_ENABLE_Pos 0 /*!< SysTick CTRL: ENABLE Position */ -#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ - -/* SysTick Reload Register Definitions */ -#define SysTick_LOAD_RELOAD_Pos 0 /*!< SysTick LOAD: RELOAD Position */ -#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ - -/* SysTick Current Register Definitions */ -#define SysTick_VAL_CURRENT_Pos 0 /*!< SysTick VAL: CURRENT Position */ -#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ - -/* SysTick Calibration Register Definitions */ -#define SysTick_CALIB_NOREF_Pos 31 /*!< SysTick CALIB: NOREF Position */ -#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ - -#define SysTick_CALIB_SKEW_Pos 30 /*!< SysTick CALIB: SKEW Position */ -#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ - -#define SysTick_CALIB_TENMS_Pos 0 /*!< SysTick CALIB: TENMS Position */ -#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ - -/*@} end of group CMSIS_SysTick */ - -#if (__MPU_PRESENT == 1) -/** \ingroup CMSIS_core_register - \defgroup CMSIS_MPU Memory Protection Unit (MPU) - \brief Type definitions for the Memory Protection Unit (MPU) - @{ - */ - -/** \brief Structure type to access the Memory Protection Unit (MPU). - */ -typedef struct -{ - __I uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */ - __IO uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */ - __IO uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region RNRber Register */ - __IO uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */ - __IO uint32_t RASR; /*!< Offset: 0x010 (R/W) MPU Region Attribute and Size Register */ -} MPU_Type; - -/* MPU Type Register */ -#define MPU_TYPE_IREGION_Pos 16 /*!< MPU TYPE: IREGION Position */ -#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */ - -#define MPU_TYPE_DREGION_Pos 8 /*!< MPU TYPE: DREGION Position */ -#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */ - -#define MPU_TYPE_SEPARATE_Pos 0 /*!< MPU TYPE: SEPARATE Position */ -#define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/) /*!< MPU TYPE: SEPARATE Mask */ - -/* MPU Control Register */ -#define MPU_CTRL_PRIVDEFENA_Pos 2 /*!< MPU CTRL: PRIVDEFENA Position */ -#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */ - -#define MPU_CTRL_HFNMIENA_Pos 1 /*!< MPU CTRL: HFNMIENA Position */ -#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */ - -#define MPU_CTRL_ENABLE_Pos 0 /*!< MPU CTRL: ENABLE Position */ -#define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/) /*!< MPU CTRL: ENABLE Mask */ - -/* MPU Region Number Register */ -#define MPU_RNR_REGION_Pos 0 /*!< MPU RNR: REGION Position */ -#define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/) /*!< MPU RNR: REGION Mask */ - -/* MPU Region Base Address Register */ -#define MPU_RBAR_ADDR_Pos 8 /*!< MPU RBAR: ADDR Position */ -#define MPU_RBAR_ADDR_Msk (0xFFFFFFUL << MPU_RBAR_ADDR_Pos) /*!< MPU RBAR: ADDR Mask */ - -#define MPU_RBAR_VALID_Pos 4 /*!< MPU RBAR: VALID Position */ -#define MPU_RBAR_VALID_Msk (1UL << MPU_RBAR_VALID_Pos) /*!< MPU RBAR: VALID Mask */ - -#define MPU_RBAR_REGION_Pos 0 /*!< MPU RBAR: REGION Position */ -#define MPU_RBAR_REGION_Msk (0xFUL /*<< MPU_RBAR_REGION_Pos*/) /*!< MPU RBAR: REGION Mask */ - -/* MPU Region Attribute and Size Register */ -#define MPU_RASR_ATTRS_Pos 16 /*!< MPU RASR: MPU Region Attribute field Position */ -#define MPU_RASR_ATTRS_Msk (0xFFFFUL << MPU_RASR_ATTRS_Pos) /*!< MPU RASR: MPU Region Attribute field Mask */ - -#define MPU_RASR_XN_Pos 28 /*!< MPU RASR: ATTRS.XN Position */ -#define MPU_RASR_XN_Msk (1UL << MPU_RASR_XN_Pos) /*!< MPU RASR: ATTRS.XN Mask */ - -#define MPU_RASR_AP_Pos 24 /*!< MPU RASR: ATTRS.AP Position */ -#define MPU_RASR_AP_Msk (0x7UL << MPU_RASR_AP_Pos) /*!< MPU RASR: ATTRS.AP Mask */ - -#define MPU_RASR_TEX_Pos 19 /*!< MPU RASR: ATTRS.TEX Position */ -#define MPU_RASR_TEX_Msk (0x7UL << MPU_RASR_TEX_Pos) /*!< MPU RASR: ATTRS.TEX Mask */ - -#define MPU_RASR_S_Pos 18 /*!< MPU RASR: ATTRS.S Position */ -#define MPU_RASR_S_Msk (1UL << MPU_RASR_S_Pos) /*!< MPU RASR: ATTRS.S Mask */ - -#define MPU_RASR_C_Pos 17 /*!< MPU RASR: ATTRS.C Position */ -#define MPU_RASR_C_Msk (1UL << MPU_RASR_C_Pos) /*!< MPU RASR: ATTRS.C Mask */ - -#define MPU_RASR_B_Pos 16 /*!< MPU RASR: ATTRS.B Position */ -#define MPU_RASR_B_Msk (1UL << MPU_RASR_B_Pos) /*!< MPU RASR: ATTRS.B Mask */ - -#define MPU_RASR_SRD_Pos 8 /*!< MPU RASR: Sub-Region Disable Position */ -#define MPU_RASR_SRD_Msk (0xFFUL << MPU_RASR_SRD_Pos) /*!< MPU RASR: Sub-Region Disable Mask */ - -#define MPU_RASR_SIZE_Pos 1 /*!< MPU RASR: Region Size Field Position */ -#define MPU_RASR_SIZE_Msk (0x1FUL << MPU_RASR_SIZE_Pos) /*!< MPU RASR: Region Size Field Mask */ - -#define MPU_RASR_ENABLE_Pos 0 /*!< MPU RASR: Region enable bit Position */ -#define MPU_RASR_ENABLE_Msk (1UL /*<< MPU_RASR_ENABLE_Pos*/) /*!< MPU RASR: Region enable bit Disable Mask */ - -/*@} end of group CMSIS_MPU */ -#endif - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) - \brief SC000 Core Debug Registers (DCB registers, SHCSR, and DFSR) - are only accessible over DAP and not via processor. Therefore - they are not covered by the Cortex-M0 header file. - @{ - */ -/*@} end of group CMSIS_CoreDebug */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_core_base Core Definitions - \brief Definitions for base addresses, unions, and structures. - @{ - */ - -/* Memory mapping of SC000 Hardware */ -#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ -#define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ -#define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ -#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ - -#define SCnSCB ((SCnSCB_Type *) SCS_BASE ) /*!< System control Register not in SCB */ -#define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ -#define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ -#define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ - -#if (__MPU_PRESENT == 1) - #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ - #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ -#endif - -/*@} */ - - - -/******************************************************************************* - * Hardware Abstraction Layer - Core Function Interface contains: - - Core NVIC Functions - - Core SysTick Functions - - Core Register Access Functions - ******************************************************************************/ -/** \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference -*/ - - - -/* ########################## NVIC functions #################################### */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_NVICFunctions NVIC Functions - \brief Functions that manage interrupts and exceptions via the NVIC. - @{ - */ - -/* Interrupt Priorities are WORD accessible only under ARMv6M */ -/* The following MACROS handle generation of the register offset and byte masks */ -#define _BIT_SHIFT(IRQn) ( ((((uint32_t)(int32_t)(IRQn)) ) & 0x03UL) * 8UL) -#define _SHP_IDX(IRQn) ( (((((uint32_t)(int32_t)(IRQn)) & 0x0FUL)-8UL) >> 2UL) ) -#define _IP_IDX(IRQn) ( (((uint32_t)(int32_t)(IRQn)) >> 2UL) ) - - -/** \brief Enable External Interrupt - - The function enables a device-specific interrupt in the NVIC interrupt controller. - - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn) -{ - NVIC->ISER[0] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** \brief Disable External Interrupt - - The function disables a device-specific interrupt in the NVIC interrupt controller. - - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn) -{ - NVIC->ICER[0] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** \brief Get Pending Interrupt - - The function reads the pending register in the NVIC and returns the pending bit - for the specified interrupt. - - \param [in] IRQn Interrupt number. - - \return 0 Interrupt status is not pending. - \return 1 Interrupt status is pending. - */ -__STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn) -{ - return((uint32_t)(((NVIC->ISPR[0] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** \brief Set Pending Interrupt - - The function sets the pending bit of an external interrupt. - - \param [in] IRQn Interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ISPR[0] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** \brief Clear Pending Interrupt - - The function clears the pending bit of an external interrupt. - - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ICPR[0] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** \brief Set Interrupt Priority - - The function sets the priority of an interrupt. - - \note The priority cannot be set for every core interrupt. - - \param [in] IRQn Interrupt number. - \param [in] priority Priority to set. - */ -__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) -{ - if((int32_t)(IRQn) < 0) { - SCB->SHP[_SHP_IDX(IRQn)] = ((uint32_t)(SCB->SHP[_SHP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | - (((priority << (8 - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); - } - else { - NVIC->IP[_IP_IDX(IRQn)] = ((uint32_t)(NVIC->IP[_IP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | - (((priority << (8 - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); - } -} - - -/** \brief Get Interrupt Priority - - The function reads the priority of an interrupt. The interrupt - number can be positive to specify an external (device specific) - interrupt, or negative to specify an internal (core) interrupt. - - - \param [in] IRQn Interrupt number. - \return Interrupt Priority. Value is aligned automatically to the implemented - priority bits of the microcontroller. - */ -__STATIC_INLINE uint32_t NVIC_GetPriority(IRQn_Type IRQn) -{ - - if((int32_t)(IRQn) < 0) { - return((uint32_t)(((SCB->SHP[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8 - __NVIC_PRIO_BITS))); - } - else { - return((uint32_t)(((NVIC->IP[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8 - __NVIC_PRIO_BITS))); - } -} - - -/** \brief System Reset - - The function initiates a system reset request to reset the MCU. - */ -__STATIC_INLINE void NVIC_SystemReset(void) -{ - __DSB(); /* Ensure all outstanding memory accesses included - buffered write are completed before reset */ - SCB->AIRCR = ((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | - SCB_AIRCR_SYSRESETREQ_Msk); - __DSB(); /* Ensure completion of memory access */ - while(1) { __NOP(); } /* wait until reset */ -} - -/*@} end of CMSIS_Core_NVICFunctions */ - - - -/* ################################## SysTick function ############################################ */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_SysTickFunctions SysTick Functions - \brief Functions that configure the System. - @{ - */ - -#if (__Vendor_SysTickConfig == 0) - -/** \brief System Tick Configuration - - The function initializes the System Timer and its interrupt, and starts the System Tick Timer. - Counter is in free running mode to generate periodic interrupts. - - \param [in] ticks Number of ticks between two interrupts. - - \return 0 Function succeeded. - \return 1 Function failed. - - \note When the variable __Vendor_SysTickConfig is set to 1, then the - function SysTick_Config is not included. In this case, the file device.h - must contain a vendor-specific implementation of this function. - - */ -__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) -{ - if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) {return (1UL);} /* Reload value impossible */ - - SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ - NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ - SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ - SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | - SysTick_CTRL_TICKINT_Msk | - SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ - return (0UL); /* Function successful */ -} - -#endif - -/*@} end of CMSIS_Core_SysTickFunctions */ - - - - -#ifdef __cplusplus -} -#endif - -#endif /* __CORE_SC000_H_DEPENDANT */ - -#endif /* __CMSIS_GENERIC */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/core_sc300.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/core_sc300.h deleted file mode 100644 index 7e40672a..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/cmsis/CMSIS/Include/core_sc300.h +++ /dev/null @@ -1,1675 +0,0 @@ -/**************************************************************************//** - * @file core_sc300.h - * @brief CMSIS SC300 Core Peripheral Access Layer Header File - * @version V4.10 - * @date 18. March 2015 - * - * @note - * - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#endif - -#ifndef __CORE_SC300_H_GENERIC -#define __CORE_SC300_H_GENERIC - -#ifdef __cplusplus - extern "C" { -#endif - -/** \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions - CMSIS violates the following MISRA-C:2004 rules: - - \li Required Rule 8.5, object/function definition in header file.
- Function definitions in header files are used to allow 'inlining'. - - \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
- Unions are used for effective representation of core registers. - - \li Advisory Rule 19.7, Function-like macro defined.
- Function-like macros are used to allow more efficient code. - */ - - -/******************************************************************************* - * CMSIS definitions - ******************************************************************************/ -/** \ingroup SC3000 - @{ - */ - -/* CMSIS SC300 definitions */ -#define __SC300_CMSIS_VERSION_MAIN (0x04) /*!< [31:16] CMSIS HAL main version */ -#define __SC300_CMSIS_VERSION_SUB (0x00) /*!< [15:0] CMSIS HAL sub version */ -#define __SC300_CMSIS_VERSION ((__SC300_CMSIS_VERSION_MAIN << 16) | \ - __SC300_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */ - -#define __CORTEX_SC (300) /*!< Cortex secure core */ - - -#if defined ( __CC_ARM ) - #define __ASM __asm /*!< asm keyword for ARM Compiler */ - #define __INLINE __inline /*!< inline keyword for ARM Compiler */ - #define __STATIC_INLINE static __inline - -#elif defined ( __GNUC__ ) - #define __ASM __asm /*!< asm keyword for GNU Compiler */ - #define __INLINE inline /*!< inline keyword for GNU Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __ICCARM__ ) - #define __ASM __asm /*!< asm keyword for IAR Compiler */ - #define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */ - #define __STATIC_INLINE static inline - -#elif defined ( __TMS470__ ) - #define __ASM __asm /*!< asm keyword for TI CCS Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __TASKING__ ) - #define __ASM __asm /*!< asm keyword for TASKING Compiler */ - #define __INLINE inline /*!< inline keyword for TASKING Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __CSMC__ ) - #define __packed - #define __ASM _asm /*!< asm keyword for COSMIC Compiler */ - #define __INLINE inline /*use -pc99 on compile line !< inline keyword for COSMIC Compiler */ - #define __STATIC_INLINE static inline - -#endif - -/** __FPU_USED indicates whether an FPU is used or not. - This core does not support an FPU at all -*/ -#define __FPU_USED 0 - -#if defined ( __CC_ARM ) - #if defined __TARGET_FPU_VFP - #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #endif - -#elif defined ( __GNUC__ ) - #if defined (__VFP_FP__) && !defined(__SOFTFP__) - #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #endif - -#elif defined ( __ICCARM__ ) - #if defined __ARMVFP__ - #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #endif - -#elif defined ( __TMS470__ ) - #if defined __TI__VFP_SUPPORT____ - #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #endif - -#elif defined ( __TASKING__ ) - #if defined __FPU_VFP__ - #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #endif - -#elif defined ( __CSMC__ ) /* Cosmic */ - #if ( __CSMC__ & 0x400) // FPU present for parser - #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #endif -#endif - -#include /* standard types definitions */ -#include /* Core Instruction Access */ -#include /* Core Function Access */ - -#ifdef __cplusplus -} -#endif - -#endif /* __CORE_SC300_H_GENERIC */ - -#ifndef __CMSIS_GENERIC - -#ifndef __CORE_SC300_H_DEPENDANT -#define __CORE_SC300_H_DEPENDANT - -#ifdef __cplusplus - extern "C" { -#endif - -/* check device defines and use defaults */ -#if defined __CHECK_DEVICE_DEFINES - #ifndef __SC300_REV - #define __SC300_REV 0x0000 - #warning "__SC300_REV not defined in device header file; using default!" - #endif - - #ifndef __MPU_PRESENT - #define __MPU_PRESENT 0 - #warning "__MPU_PRESENT not defined in device header file; using default!" - #endif - - #ifndef __NVIC_PRIO_BITS - #define __NVIC_PRIO_BITS 4 - #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" - #endif - - #ifndef __Vendor_SysTickConfig - #define __Vendor_SysTickConfig 0 - #warning "__Vendor_SysTickConfig not defined in device header file; using default!" - #endif -#endif - -/* IO definitions (access restrictions to peripheral registers) */ -/** - \defgroup CMSIS_glob_defs CMSIS Global Defines - - IO Type Qualifiers are used - \li to specify the access to peripheral variables. - \li for automatic generation of peripheral register debug information. -*/ -#ifdef __cplusplus - #define __I volatile /*!< Defines 'read only' permissions */ -#else - #define __I volatile const /*!< Defines 'read only' permissions */ -#endif -#define __O volatile /*!< Defines 'write only' permissions */ -#define __IO volatile /*!< Defines 'read / write' permissions */ - -/*@} end of group SC300 */ - - - -/******************************************************************************* - * Register Abstraction - Core Register contain: - - Core Register - - Core NVIC Register - - Core SCB Register - - Core SysTick Register - - Core Debug Register - - Core MPU Register - ******************************************************************************/ -/** \defgroup CMSIS_core_register Defines and Type Definitions - \brief Type definitions and defines for Cortex-M processor based devices. -*/ - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_CORE Status and Control Registers - \brief Core Register type definitions. - @{ - */ - -/** \brief Union type to access the Application Program Status Register (APSR). - */ -typedef union -{ - struct - { - uint32_t _reserved0:27; /*!< bit: 0..26 Reserved */ - uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ - uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ - uint32_t C:1; /*!< bit: 29 Carry condition code flag */ - uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ - uint32_t N:1; /*!< bit: 31 Negative condition code flag */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} APSR_Type; - -/* APSR Register Definitions */ -#define APSR_N_Pos 31 /*!< APSR: N Position */ -#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ - -#define APSR_Z_Pos 30 /*!< APSR: Z Position */ -#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ - -#define APSR_C_Pos 29 /*!< APSR: C Position */ -#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ - -#define APSR_V_Pos 28 /*!< APSR: V Position */ -#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ - -#define APSR_Q_Pos 27 /*!< APSR: Q Position */ -#define APSR_Q_Msk (1UL << APSR_Q_Pos) /*!< APSR: Q Mask */ - - -/** \brief Union type to access the Interrupt Program Status Register (IPSR). - */ -typedef union -{ - struct - { - uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ - uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} IPSR_Type; - -/* IPSR Register Definitions */ -#define IPSR_ISR_Pos 0 /*!< IPSR: ISR Position */ -#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ - - -/** \brief Union type to access the Special-Purpose Program Status Registers (xPSR). - */ -typedef union -{ - struct - { - uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ - uint32_t _reserved0:15; /*!< bit: 9..23 Reserved */ - uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */ - uint32_t IT:2; /*!< bit: 25..26 saved IT state (read 0) */ - uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ - uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ - uint32_t C:1; /*!< bit: 29 Carry condition code flag */ - uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ - uint32_t N:1; /*!< bit: 31 Negative condition code flag */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} xPSR_Type; - -/* xPSR Register Definitions */ -#define xPSR_N_Pos 31 /*!< xPSR: N Position */ -#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ - -#define xPSR_Z_Pos 30 /*!< xPSR: Z Position */ -#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ - -#define xPSR_C_Pos 29 /*!< xPSR: C Position */ -#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ - -#define xPSR_V_Pos 28 /*!< xPSR: V Position */ -#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ - -#define xPSR_Q_Pos 27 /*!< xPSR: Q Position */ -#define xPSR_Q_Msk (1UL << xPSR_Q_Pos) /*!< xPSR: Q Mask */ - -#define xPSR_IT_Pos 25 /*!< xPSR: IT Position */ -#define xPSR_IT_Msk (3UL << xPSR_IT_Pos) /*!< xPSR: IT Mask */ - -#define xPSR_T_Pos 24 /*!< xPSR: T Position */ -#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ - -#define xPSR_ISR_Pos 0 /*!< xPSR: ISR Position */ -#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ - - -/** \brief Union type to access the Control Registers (CONTROL). - */ -typedef union -{ - struct - { - uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */ - uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */ - uint32_t _reserved1:30; /*!< bit: 2..31 Reserved */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} CONTROL_Type; - -/* CONTROL Register Definitions */ -#define CONTROL_SPSEL_Pos 1 /*!< CONTROL: SPSEL Position */ -#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ - -#define CONTROL_nPRIV_Pos 0 /*!< CONTROL: nPRIV Position */ -#define CONTROL_nPRIV_Msk (1UL /*<< CONTROL_nPRIV_Pos*/) /*!< CONTROL: nPRIV Mask */ - -/*@} end of group CMSIS_CORE */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) - \brief Type definitions for the NVIC Registers - @{ - */ - -/** \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). - */ -typedef struct -{ - __IO uint32_t ISER[8]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ - uint32_t RESERVED0[24]; - __IO uint32_t ICER[8]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ - uint32_t RSERVED1[24]; - __IO uint32_t ISPR[8]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ - uint32_t RESERVED2[24]; - __IO uint32_t ICPR[8]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ - uint32_t RESERVED3[24]; - __IO uint32_t IABR[8]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */ - uint32_t RESERVED4[56]; - __IO uint8_t IP[240]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register (8Bit wide) */ - uint32_t RESERVED5[644]; - __O uint32_t STIR; /*!< Offset: 0xE00 ( /W) Software Trigger Interrupt Register */ -} NVIC_Type; - -/* Software Triggered Interrupt Register Definitions */ -#define NVIC_STIR_INTID_Pos 0 /*!< STIR: INTLINESNUM Position */ -#define NVIC_STIR_INTID_Msk (0x1FFUL /*<< NVIC_STIR_INTID_Pos*/) /*!< STIR: INTLINESNUM Mask */ - -/*@} end of group CMSIS_NVIC */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_SCB System Control Block (SCB) - \brief Type definitions for the System Control Block Registers - @{ - */ - -/** \brief Structure type to access the System Control Block (SCB). - */ -typedef struct -{ - __I uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ - __IO uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ - __IO uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */ - __IO uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ - __IO uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ - __IO uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ - __IO uint8_t SHP[12]; /*!< Offset: 0x018 (R/W) System Handlers Priority Registers (4-7, 8-11, 12-15) */ - __IO uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ - __IO uint32_t CFSR; /*!< Offset: 0x028 (R/W) Configurable Fault Status Register */ - __IO uint32_t HFSR; /*!< Offset: 0x02C (R/W) HardFault Status Register */ - __IO uint32_t DFSR; /*!< Offset: 0x030 (R/W) Debug Fault Status Register */ - __IO uint32_t MMFAR; /*!< Offset: 0x034 (R/W) MemManage Fault Address Register */ - __IO uint32_t BFAR; /*!< Offset: 0x038 (R/W) BusFault Address Register */ - __IO uint32_t AFSR; /*!< Offset: 0x03C (R/W) Auxiliary Fault Status Register */ - __I uint32_t PFR[2]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */ - __I uint32_t DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */ - __I uint32_t ADR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */ - __I uint32_t MMFR[4]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */ - __I uint32_t ISAR[5]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */ - uint32_t RESERVED0[5]; - __IO uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */ - uint32_t RESERVED1[129]; - __IO uint32_t SFCR; /*!< Offset: 0x290 (R/W) Security Features Control Register */ -} SCB_Type; - -/* SCB CPUID Register Definitions */ -#define SCB_CPUID_IMPLEMENTER_Pos 24 /*!< SCB CPUID: IMPLEMENTER Position */ -#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ - -#define SCB_CPUID_VARIANT_Pos 20 /*!< SCB CPUID: VARIANT Position */ -#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ - -#define SCB_CPUID_ARCHITECTURE_Pos 16 /*!< SCB CPUID: ARCHITECTURE Position */ -#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ - -#define SCB_CPUID_PARTNO_Pos 4 /*!< SCB CPUID: PARTNO Position */ -#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ - -#define SCB_CPUID_REVISION_Pos 0 /*!< SCB CPUID: REVISION Position */ -#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ - -/* SCB Interrupt Control State Register Definitions */ -#define SCB_ICSR_NMIPENDSET_Pos 31 /*!< SCB ICSR: NMIPENDSET Position */ -#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */ - -#define SCB_ICSR_PENDSVSET_Pos 28 /*!< SCB ICSR: PENDSVSET Position */ -#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ - -#define SCB_ICSR_PENDSVCLR_Pos 27 /*!< SCB ICSR: PENDSVCLR Position */ -#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ - -#define SCB_ICSR_PENDSTSET_Pos 26 /*!< SCB ICSR: PENDSTSET Position */ -#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ - -#define SCB_ICSR_PENDSTCLR_Pos 25 /*!< SCB ICSR: PENDSTCLR Position */ -#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ - -#define SCB_ICSR_ISRPREEMPT_Pos 23 /*!< SCB ICSR: ISRPREEMPT Position */ -#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ - -#define SCB_ICSR_ISRPENDING_Pos 22 /*!< SCB ICSR: ISRPENDING Position */ -#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ - -#define SCB_ICSR_VECTPENDING_Pos 12 /*!< SCB ICSR: VECTPENDING Position */ -#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ - -#define SCB_ICSR_RETTOBASE_Pos 11 /*!< SCB ICSR: RETTOBASE Position */ -#define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos) /*!< SCB ICSR: RETTOBASE Mask */ - -#define SCB_ICSR_VECTACTIVE_Pos 0 /*!< SCB ICSR: VECTACTIVE Position */ -#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ - -/* SCB Vector Table Offset Register Definitions */ -#define SCB_VTOR_TBLBASE_Pos 29 /*!< SCB VTOR: TBLBASE Position */ -#define SCB_VTOR_TBLBASE_Msk (1UL << SCB_VTOR_TBLBASE_Pos) /*!< SCB VTOR: TBLBASE Mask */ - -#define SCB_VTOR_TBLOFF_Pos 7 /*!< SCB VTOR: TBLOFF Position */ -#define SCB_VTOR_TBLOFF_Msk (0x3FFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ - -/* SCB Application Interrupt and Reset Control Register Definitions */ -#define SCB_AIRCR_VECTKEY_Pos 16 /*!< SCB AIRCR: VECTKEY Position */ -#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ - -#define SCB_AIRCR_VECTKEYSTAT_Pos 16 /*!< SCB AIRCR: VECTKEYSTAT Position */ -#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ - -#define SCB_AIRCR_ENDIANESS_Pos 15 /*!< SCB AIRCR: ENDIANESS Position */ -#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ - -#define SCB_AIRCR_PRIGROUP_Pos 8 /*!< SCB AIRCR: PRIGROUP Position */ -#define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */ - -#define SCB_AIRCR_SYSRESETREQ_Pos 2 /*!< SCB AIRCR: SYSRESETREQ Position */ -#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ - -#define SCB_AIRCR_VECTCLRACTIVE_Pos 1 /*!< SCB AIRCR: VECTCLRACTIVE Position */ -#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ - -#define SCB_AIRCR_VECTRESET_Pos 0 /*!< SCB AIRCR: VECTRESET Position */ -#define SCB_AIRCR_VECTRESET_Msk (1UL /*<< SCB_AIRCR_VECTRESET_Pos*/) /*!< SCB AIRCR: VECTRESET Mask */ - -/* SCB System Control Register Definitions */ -#define SCB_SCR_SEVONPEND_Pos 4 /*!< SCB SCR: SEVONPEND Position */ -#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ - -#define SCB_SCR_SLEEPDEEP_Pos 2 /*!< SCB SCR: SLEEPDEEP Position */ -#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ - -#define SCB_SCR_SLEEPONEXIT_Pos 1 /*!< SCB SCR: SLEEPONEXIT Position */ -#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ - -/* SCB Configuration Control Register Definitions */ -#define SCB_CCR_STKALIGN_Pos 9 /*!< SCB CCR: STKALIGN Position */ -#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */ - -#define SCB_CCR_BFHFNMIGN_Pos 8 /*!< SCB CCR: BFHFNMIGN Position */ -#define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos) /*!< SCB CCR: BFHFNMIGN Mask */ - -#define SCB_CCR_DIV_0_TRP_Pos 4 /*!< SCB CCR: DIV_0_TRP Position */ -#define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos) /*!< SCB CCR: DIV_0_TRP Mask */ - -#define SCB_CCR_UNALIGN_TRP_Pos 3 /*!< SCB CCR: UNALIGN_TRP Position */ -#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ - -#define SCB_CCR_USERSETMPEND_Pos 1 /*!< SCB CCR: USERSETMPEND Position */ -#define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos) /*!< SCB CCR: USERSETMPEND Mask */ - -#define SCB_CCR_NONBASETHRDENA_Pos 0 /*!< SCB CCR: NONBASETHRDENA Position */ -#define SCB_CCR_NONBASETHRDENA_Msk (1UL /*<< SCB_CCR_NONBASETHRDENA_Pos*/) /*!< SCB CCR: NONBASETHRDENA Mask */ - -/* SCB System Handler Control and State Register Definitions */ -#define SCB_SHCSR_USGFAULTENA_Pos 18 /*!< SCB SHCSR: USGFAULTENA Position */ -#define SCB_SHCSR_USGFAULTENA_Msk (1UL << SCB_SHCSR_USGFAULTENA_Pos) /*!< SCB SHCSR: USGFAULTENA Mask */ - -#define SCB_SHCSR_BUSFAULTENA_Pos 17 /*!< SCB SHCSR: BUSFAULTENA Position */ -#define SCB_SHCSR_BUSFAULTENA_Msk (1UL << SCB_SHCSR_BUSFAULTENA_Pos) /*!< SCB SHCSR: BUSFAULTENA Mask */ - -#define SCB_SHCSR_MEMFAULTENA_Pos 16 /*!< SCB SHCSR: MEMFAULTENA Position */ -#define SCB_SHCSR_MEMFAULTENA_Msk (1UL << SCB_SHCSR_MEMFAULTENA_Pos) /*!< SCB SHCSR: MEMFAULTENA Mask */ - -#define SCB_SHCSR_SVCALLPENDED_Pos 15 /*!< SCB SHCSR: SVCALLPENDED Position */ -#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ - -#define SCB_SHCSR_BUSFAULTPENDED_Pos 14 /*!< SCB SHCSR: BUSFAULTPENDED Position */ -#define SCB_SHCSR_BUSFAULTPENDED_Msk (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos) /*!< SCB SHCSR: BUSFAULTPENDED Mask */ - -#define SCB_SHCSR_MEMFAULTPENDED_Pos 13 /*!< SCB SHCSR: MEMFAULTPENDED Position */ -#define SCB_SHCSR_MEMFAULTPENDED_Msk (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos) /*!< SCB SHCSR: MEMFAULTPENDED Mask */ - -#define SCB_SHCSR_USGFAULTPENDED_Pos 12 /*!< SCB SHCSR: USGFAULTPENDED Position */ -#define SCB_SHCSR_USGFAULTPENDED_Msk (1UL << SCB_SHCSR_USGFAULTPENDED_Pos) /*!< SCB SHCSR: USGFAULTPENDED Mask */ - -#define SCB_SHCSR_SYSTICKACT_Pos 11 /*!< SCB SHCSR: SYSTICKACT Position */ -#define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos) /*!< SCB SHCSR: SYSTICKACT Mask */ - -#define SCB_SHCSR_PENDSVACT_Pos 10 /*!< SCB SHCSR: PENDSVACT Position */ -#define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos) /*!< SCB SHCSR: PENDSVACT Mask */ - -#define SCB_SHCSR_MONITORACT_Pos 8 /*!< SCB SHCSR: MONITORACT Position */ -#define SCB_SHCSR_MONITORACT_Msk (1UL << SCB_SHCSR_MONITORACT_Pos) /*!< SCB SHCSR: MONITORACT Mask */ - -#define SCB_SHCSR_SVCALLACT_Pos 7 /*!< SCB SHCSR: SVCALLACT Position */ -#define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos) /*!< SCB SHCSR: SVCALLACT Mask */ - -#define SCB_SHCSR_USGFAULTACT_Pos 3 /*!< SCB SHCSR: USGFAULTACT Position */ -#define SCB_SHCSR_USGFAULTACT_Msk (1UL << SCB_SHCSR_USGFAULTACT_Pos) /*!< SCB SHCSR: USGFAULTACT Mask */ - -#define SCB_SHCSR_BUSFAULTACT_Pos 1 /*!< SCB SHCSR: BUSFAULTACT Position */ -#define SCB_SHCSR_BUSFAULTACT_Msk (1UL << SCB_SHCSR_BUSFAULTACT_Pos) /*!< SCB SHCSR: BUSFAULTACT Mask */ - -#define SCB_SHCSR_MEMFAULTACT_Pos 0 /*!< SCB SHCSR: MEMFAULTACT Position */ -#define SCB_SHCSR_MEMFAULTACT_Msk (1UL /*<< SCB_SHCSR_MEMFAULTACT_Pos*/) /*!< SCB SHCSR: MEMFAULTACT Mask */ - -/* SCB Configurable Fault Status Registers Definitions */ -#define SCB_CFSR_USGFAULTSR_Pos 16 /*!< SCB CFSR: Usage Fault Status Register Position */ -#define SCB_CFSR_USGFAULTSR_Msk (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos) /*!< SCB CFSR: Usage Fault Status Register Mask */ - -#define SCB_CFSR_BUSFAULTSR_Pos 8 /*!< SCB CFSR: Bus Fault Status Register Position */ -#define SCB_CFSR_BUSFAULTSR_Msk (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos) /*!< SCB CFSR: Bus Fault Status Register Mask */ - -#define SCB_CFSR_MEMFAULTSR_Pos 0 /*!< SCB CFSR: Memory Manage Fault Status Register Position */ -#define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */ - -/* SCB Hard Fault Status Registers Definitions */ -#define SCB_HFSR_DEBUGEVT_Pos 31 /*!< SCB HFSR: DEBUGEVT Position */ -#define SCB_HFSR_DEBUGEVT_Msk (1UL << SCB_HFSR_DEBUGEVT_Pos) /*!< SCB HFSR: DEBUGEVT Mask */ - -#define SCB_HFSR_FORCED_Pos 30 /*!< SCB HFSR: FORCED Position */ -#define SCB_HFSR_FORCED_Msk (1UL << SCB_HFSR_FORCED_Pos) /*!< SCB HFSR: FORCED Mask */ - -#define SCB_HFSR_VECTTBL_Pos 1 /*!< SCB HFSR: VECTTBL Position */ -#define SCB_HFSR_VECTTBL_Msk (1UL << SCB_HFSR_VECTTBL_Pos) /*!< SCB HFSR: VECTTBL Mask */ - -/* SCB Debug Fault Status Register Definitions */ -#define SCB_DFSR_EXTERNAL_Pos 4 /*!< SCB DFSR: EXTERNAL Position */ -#define SCB_DFSR_EXTERNAL_Msk (1UL << SCB_DFSR_EXTERNAL_Pos) /*!< SCB DFSR: EXTERNAL Mask */ - -#define SCB_DFSR_VCATCH_Pos 3 /*!< SCB DFSR: VCATCH Position */ -#define SCB_DFSR_VCATCH_Msk (1UL << SCB_DFSR_VCATCH_Pos) /*!< SCB DFSR: VCATCH Mask */ - -#define SCB_DFSR_DWTTRAP_Pos 2 /*!< SCB DFSR: DWTTRAP Position */ -#define SCB_DFSR_DWTTRAP_Msk (1UL << SCB_DFSR_DWTTRAP_Pos) /*!< SCB DFSR: DWTTRAP Mask */ - -#define SCB_DFSR_BKPT_Pos 1 /*!< SCB DFSR: BKPT Position */ -#define SCB_DFSR_BKPT_Msk (1UL << SCB_DFSR_BKPT_Pos) /*!< SCB DFSR: BKPT Mask */ - -#define SCB_DFSR_HALTED_Pos 0 /*!< SCB DFSR: HALTED Position */ -#define SCB_DFSR_HALTED_Msk (1UL /*<< SCB_DFSR_HALTED_Pos*/) /*!< SCB DFSR: HALTED Mask */ - -/*@} end of group CMSIS_SCB */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB) - \brief Type definitions for the System Control and ID Register not in the SCB - @{ - */ - -/** \brief Structure type to access the System Control and ID Register not in the SCB. - */ -typedef struct -{ - uint32_t RESERVED0[1]; - __I uint32_t ICTR; /*!< Offset: 0x004 (R/ ) Interrupt Controller Type Register */ - uint32_t RESERVED1[1]; -} SCnSCB_Type; - -/* Interrupt Controller Type Register Definitions */ -#define SCnSCB_ICTR_INTLINESNUM_Pos 0 /*!< ICTR: INTLINESNUM Position */ -#define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL /*<< SCnSCB_ICTR_INTLINESNUM_Pos*/) /*!< ICTR: INTLINESNUM Mask */ - -/*@} end of group CMSIS_SCnotSCB */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_SysTick System Tick Timer (SysTick) - \brief Type definitions for the System Timer Registers. - @{ - */ - -/** \brief Structure type to access the System Timer (SysTick). - */ -typedef struct -{ - __IO uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ - __IO uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ - __IO uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ - __I uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ -} SysTick_Type; - -/* SysTick Control / Status Register Definitions */ -#define SysTick_CTRL_COUNTFLAG_Pos 16 /*!< SysTick CTRL: COUNTFLAG Position */ -#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ - -#define SysTick_CTRL_CLKSOURCE_Pos 2 /*!< SysTick CTRL: CLKSOURCE Position */ -#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ - -#define SysTick_CTRL_TICKINT_Pos 1 /*!< SysTick CTRL: TICKINT Position */ -#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ - -#define SysTick_CTRL_ENABLE_Pos 0 /*!< SysTick CTRL: ENABLE Position */ -#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ - -/* SysTick Reload Register Definitions */ -#define SysTick_LOAD_RELOAD_Pos 0 /*!< SysTick LOAD: RELOAD Position */ -#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ - -/* SysTick Current Register Definitions */ -#define SysTick_VAL_CURRENT_Pos 0 /*!< SysTick VAL: CURRENT Position */ -#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ - -/* SysTick Calibration Register Definitions */ -#define SysTick_CALIB_NOREF_Pos 31 /*!< SysTick CALIB: NOREF Position */ -#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ - -#define SysTick_CALIB_SKEW_Pos 30 /*!< SysTick CALIB: SKEW Position */ -#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ - -#define SysTick_CALIB_TENMS_Pos 0 /*!< SysTick CALIB: TENMS Position */ -#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ - -/*@} end of group CMSIS_SysTick */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_ITM Instrumentation Trace Macrocell (ITM) - \brief Type definitions for the Instrumentation Trace Macrocell (ITM) - @{ - */ - -/** \brief Structure type to access the Instrumentation Trace Macrocell Register (ITM). - */ -typedef struct -{ - __O union - { - __O uint8_t u8; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 8-bit */ - __O uint16_t u16; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 16-bit */ - __O uint32_t u32; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 32-bit */ - } PORT [32]; /*!< Offset: 0x000 ( /W) ITM Stimulus Port Registers */ - uint32_t RESERVED0[864]; - __IO uint32_t TER; /*!< Offset: 0xE00 (R/W) ITM Trace Enable Register */ - uint32_t RESERVED1[15]; - __IO uint32_t TPR; /*!< Offset: 0xE40 (R/W) ITM Trace Privilege Register */ - uint32_t RESERVED2[15]; - __IO uint32_t TCR; /*!< Offset: 0xE80 (R/W) ITM Trace Control Register */ - uint32_t RESERVED3[29]; - __O uint32_t IWR; /*!< Offset: 0xEF8 ( /W) ITM Integration Write Register */ - __I uint32_t IRR; /*!< Offset: 0xEFC (R/ ) ITM Integration Read Register */ - __IO uint32_t IMCR; /*!< Offset: 0xF00 (R/W) ITM Integration Mode Control Register */ - uint32_t RESERVED4[43]; - __O uint32_t LAR; /*!< Offset: 0xFB0 ( /W) ITM Lock Access Register */ - __I uint32_t LSR; /*!< Offset: 0xFB4 (R/ ) ITM Lock Status Register */ - uint32_t RESERVED5[6]; - __I uint32_t PID4; /*!< Offset: 0xFD0 (R/ ) ITM Peripheral Identification Register #4 */ - __I uint32_t PID5; /*!< Offset: 0xFD4 (R/ ) ITM Peripheral Identification Register #5 */ - __I uint32_t PID6; /*!< Offset: 0xFD8 (R/ ) ITM Peripheral Identification Register #6 */ - __I uint32_t PID7; /*!< Offset: 0xFDC (R/ ) ITM Peripheral Identification Register #7 */ - __I uint32_t PID0; /*!< Offset: 0xFE0 (R/ ) ITM Peripheral Identification Register #0 */ - __I uint32_t PID1; /*!< Offset: 0xFE4 (R/ ) ITM Peripheral Identification Register #1 */ - __I uint32_t PID2; /*!< Offset: 0xFE8 (R/ ) ITM Peripheral Identification Register #2 */ - __I uint32_t PID3; /*!< Offset: 0xFEC (R/ ) ITM Peripheral Identification Register #3 */ - __I uint32_t CID0; /*!< Offset: 0xFF0 (R/ ) ITM Component Identification Register #0 */ - __I uint32_t CID1; /*!< Offset: 0xFF4 (R/ ) ITM Component Identification Register #1 */ - __I uint32_t CID2; /*!< Offset: 0xFF8 (R/ ) ITM Component Identification Register #2 */ - __I uint32_t CID3; /*!< Offset: 0xFFC (R/ ) ITM Component Identification Register #3 */ -} ITM_Type; - -/* ITM Trace Privilege Register Definitions */ -#define ITM_TPR_PRIVMASK_Pos 0 /*!< ITM TPR: PRIVMASK Position */ -#define ITM_TPR_PRIVMASK_Msk (0xFUL /*<< ITM_TPR_PRIVMASK_Pos*/) /*!< ITM TPR: PRIVMASK Mask */ - -/* ITM Trace Control Register Definitions */ -#define ITM_TCR_BUSY_Pos 23 /*!< ITM TCR: BUSY Position */ -#define ITM_TCR_BUSY_Msk (1UL << ITM_TCR_BUSY_Pos) /*!< ITM TCR: BUSY Mask */ - -#define ITM_TCR_TraceBusID_Pos 16 /*!< ITM TCR: ATBID Position */ -#define ITM_TCR_TraceBusID_Msk (0x7FUL << ITM_TCR_TraceBusID_Pos) /*!< ITM TCR: ATBID Mask */ - -#define ITM_TCR_GTSFREQ_Pos 10 /*!< ITM TCR: Global timestamp frequency Position */ -#define ITM_TCR_GTSFREQ_Msk (3UL << ITM_TCR_GTSFREQ_Pos) /*!< ITM TCR: Global timestamp frequency Mask */ - -#define ITM_TCR_TSPrescale_Pos 8 /*!< ITM TCR: TSPrescale Position */ -#define ITM_TCR_TSPrescale_Msk (3UL << ITM_TCR_TSPrescale_Pos) /*!< ITM TCR: TSPrescale Mask */ - -#define ITM_TCR_SWOENA_Pos 4 /*!< ITM TCR: SWOENA Position */ -#define ITM_TCR_SWOENA_Msk (1UL << ITM_TCR_SWOENA_Pos) /*!< ITM TCR: SWOENA Mask */ - -#define ITM_TCR_DWTENA_Pos 3 /*!< ITM TCR: DWTENA Position */ -#define ITM_TCR_DWTENA_Msk (1UL << ITM_TCR_DWTENA_Pos) /*!< ITM TCR: DWTENA Mask */ - -#define ITM_TCR_SYNCENA_Pos 2 /*!< ITM TCR: SYNCENA Position */ -#define ITM_TCR_SYNCENA_Msk (1UL << ITM_TCR_SYNCENA_Pos) /*!< ITM TCR: SYNCENA Mask */ - -#define ITM_TCR_TSENA_Pos 1 /*!< ITM TCR: TSENA Position */ -#define ITM_TCR_TSENA_Msk (1UL << ITM_TCR_TSENA_Pos) /*!< ITM TCR: TSENA Mask */ - -#define ITM_TCR_ITMENA_Pos 0 /*!< ITM TCR: ITM Enable bit Position */ -#define ITM_TCR_ITMENA_Msk (1UL /*<< ITM_TCR_ITMENA_Pos*/) /*!< ITM TCR: ITM Enable bit Mask */ - -/* ITM Integration Write Register Definitions */ -#define ITM_IWR_ATVALIDM_Pos 0 /*!< ITM IWR: ATVALIDM Position */ -#define ITM_IWR_ATVALIDM_Msk (1UL /*<< ITM_IWR_ATVALIDM_Pos*/) /*!< ITM IWR: ATVALIDM Mask */ - -/* ITM Integration Read Register Definitions */ -#define ITM_IRR_ATREADYM_Pos 0 /*!< ITM IRR: ATREADYM Position */ -#define ITM_IRR_ATREADYM_Msk (1UL /*<< ITM_IRR_ATREADYM_Pos*/) /*!< ITM IRR: ATREADYM Mask */ - -/* ITM Integration Mode Control Register Definitions */ -#define ITM_IMCR_INTEGRATION_Pos 0 /*!< ITM IMCR: INTEGRATION Position */ -#define ITM_IMCR_INTEGRATION_Msk (1UL /*<< ITM_IMCR_INTEGRATION_Pos*/) /*!< ITM IMCR: INTEGRATION Mask */ - -/* ITM Lock Status Register Definitions */ -#define ITM_LSR_ByteAcc_Pos 2 /*!< ITM LSR: ByteAcc Position */ -#define ITM_LSR_ByteAcc_Msk (1UL << ITM_LSR_ByteAcc_Pos) /*!< ITM LSR: ByteAcc Mask */ - -#define ITM_LSR_Access_Pos 1 /*!< ITM LSR: Access Position */ -#define ITM_LSR_Access_Msk (1UL << ITM_LSR_Access_Pos) /*!< ITM LSR: Access Mask */ - -#define ITM_LSR_Present_Pos 0 /*!< ITM LSR: Present Position */ -#define ITM_LSR_Present_Msk (1UL /*<< ITM_LSR_Present_Pos*/) /*!< ITM LSR: Present Mask */ - -/*@}*/ /* end of group CMSIS_ITM */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_DWT Data Watchpoint and Trace (DWT) - \brief Type definitions for the Data Watchpoint and Trace (DWT) - @{ - */ - -/** \brief Structure type to access the Data Watchpoint and Trace Register (DWT). - */ -typedef struct -{ - __IO uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */ - __IO uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */ - __IO uint32_t CPICNT; /*!< Offset: 0x008 (R/W) CPI Count Register */ - __IO uint32_t EXCCNT; /*!< Offset: 0x00C (R/W) Exception Overhead Count Register */ - __IO uint32_t SLEEPCNT; /*!< Offset: 0x010 (R/W) Sleep Count Register */ - __IO uint32_t LSUCNT; /*!< Offset: 0x014 (R/W) LSU Count Register */ - __IO uint32_t FOLDCNT; /*!< Offset: 0x018 (R/W) Folded-instruction Count Register */ - __I uint32_t PCSR; /*!< Offset: 0x01C (R/ ) Program Counter Sample Register */ - __IO uint32_t COMP0; /*!< Offset: 0x020 (R/W) Comparator Register 0 */ - __IO uint32_t MASK0; /*!< Offset: 0x024 (R/W) Mask Register 0 */ - __IO uint32_t FUNCTION0; /*!< Offset: 0x028 (R/W) Function Register 0 */ - uint32_t RESERVED0[1]; - __IO uint32_t COMP1; /*!< Offset: 0x030 (R/W) Comparator Register 1 */ - __IO uint32_t MASK1; /*!< Offset: 0x034 (R/W) Mask Register 1 */ - __IO uint32_t FUNCTION1; /*!< Offset: 0x038 (R/W) Function Register 1 */ - uint32_t RESERVED1[1]; - __IO uint32_t COMP2; /*!< Offset: 0x040 (R/W) Comparator Register 2 */ - __IO uint32_t MASK2; /*!< Offset: 0x044 (R/W) Mask Register 2 */ - __IO uint32_t FUNCTION2; /*!< Offset: 0x048 (R/W) Function Register 2 */ - uint32_t RESERVED2[1]; - __IO uint32_t COMP3; /*!< Offset: 0x050 (R/W) Comparator Register 3 */ - __IO uint32_t MASK3; /*!< Offset: 0x054 (R/W) Mask Register 3 */ - __IO uint32_t FUNCTION3; /*!< Offset: 0x058 (R/W) Function Register 3 */ -} DWT_Type; - -/* DWT Control Register Definitions */ -#define DWT_CTRL_NUMCOMP_Pos 28 /*!< DWT CTRL: NUMCOMP Position */ -#define DWT_CTRL_NUMCOMP_Msk (0xFUL << DWT_CTRL_NUMCOMP_Pos) /*!< DWT CTRL: NUMCOMP Mask */ - -#define DWT_CTRL_NOTRCPKT_Pos 27 /*!< DWT CTRL: NOTRCPKT Position */ -#define DWT_CTRL_NOTRCPKT_Msk (0x1UL << DWT_CTRL_NOTRCPKT_Pos) /*!< DWT CTRL: NOTRCPKT Mask */ - -#define DWT_CTRL_NOEXTTRIG_Pos 26 /*!< DWT CTRL: NOEXTTRIG Position */ -#define DWT_CTRL_NOEXTTRIG_Msk (0x1UL << DWT_CTRL_NOEXTTRIG_Pos) /*!< DWT CTRL: NOEXTTRIG Mask */ - -#define DWT_CTRL_NOCYCCNT_Pos 25 /*!< DWT CTRL: NOCYCCNT Position */ -#define DWT_CTRL_NOCYCCNT_Msk (0x1UL << DWT_CTRL_NOCYCCNT_Pos) /*!< DWT CTRL: NOCYCCNT Mask */ - -#define DWT_CTRL_NOPRFCNT_Pos 24 /*!< DWT CTRL: NOPRFCNT Position */ -#define DWT_CTRL_NOPRFCNT_Msk (0x1UL << DWT_CTRL_NOPRFCNT_Pos) /*!< DWT CTRL: NOPRFCNT Mask */ - -#define DWT_CTRL_CYCEVTENA_Pos 22 /*!< DWT CTRL: CYCEVTENA Position */ -#define DWT_CTRL_CYCEVTENA_Msk (0x1UL << DWT_CTRL_CYCEVTENA_Pos) /*!< DWT CTRL: CYCEVTENA Mask */ - -#define DWT_CTRL_FOLDEVTENA_Pos 21 /*!< DWT CTRL: FOLDEVTENA Position */ -#define DWT_CTRL_FOLDEVTENA_Msk (0x1UL << DWT_CTRL_FOLDEVTENA_Pos) /*!< DWT CTRL: FOLDEVTENA Mask */ - -#define DWT_CTRL_LSUEVTENA_Pos 20 /*!< DWT CTRL: LSUEVTENA Position */ -#define DWT_CTRL_LSUEVTENA_Msk (0x1UL << DWT_CTRL_LSUEVTENA_Pos) /*!< DWT CTRL: LSUEVTENA Mask */ - -#define DWT_CTRL_SLEEPEVTENA_Pos 19 /*!< DWT CTRL: SLEEPEVTENA Position */ -#define DWT_CTRL_SLEEPEVTENA_Msk (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos) /*!< DWT CTRL: SLEEPEVTENA Mask */ - -#define DWT_CTRL_EXCEVTENA_Pos 18 /*!< DWT CTRL: EXCEVTENA Position */ -#define DWT_CTRL_EXCEVTENA_Msk (0x1UL << DWT_CTRL_EXCEVTENA_Pos) /*!< DWT CTRL: EXCEVTENA Mask */ - -#define DWT_CTRL_CPIEVTENA_Pos 17 /*!< DWT CTRL: CPIEVTENA Position */ -#define DWT_CTRL_CPIEVTENA_Msk (0x1UL << DWT_CTRL_CPIEVTENA_Pos) /*!< DWT CTRL: CPIEVTENA Mask */ - -#define DWT_CTRL_EXCTRCENA_Pos 16 /*!< DWT CTRL: EXCTRCENA Position */ -#define DWT_CTRL_EXCTRCENA_Msk (0x1UL << DWT_CTRL_EXCTRCENA_Pos) /*!< DWT CTRL: EXCTRCENA Mask */ - -#define DWT_CTRL_PCSAMPLENA_Pos 12 /*!< DWT CTRL: PCSAMPLENA Position */ -#define DWT_CTRL_PCSAMPLENA_Msk (0x1UL << DWT_CTRL_PCSAMPLENA_Pos) /*!< DWT CTRL: PCSAMPLENA Mask */ - -#define DWT_CTRL_SYNCTAP_Pos 10 /*!< DWT CTRL: SYNCTAP Position */ -#define DWT_CTRL_SYNCTAP_Msk (0x3UL << DWT_CTRL_SYNCTAP_Pos) /*!< DWT CTRL: SYNCTAP Mask */ - -#define DWT_CTRL_CYCTAP_Pos 9 /*!< DWT CTRL: CYCTAP Position */ -#define DWT_CTRL_CYCTAP_Msk (0x1UL << DWT_CTRL_CYCTAP_Pos) /*!< DWT CTRL: CYCTAP Mask */ - -#define DWT_CTRL_POSTINIT_Pos 5 /*!< DWT CTRL: POSTINIT Position */ -#define DWT_CTRL_POSTINIT_Msk (0xFUL << DWT_CTRL_POSTINIT_Pos) /*!< DWT CTRL: POSTINIT Mask */ - -#define DWT_CTRL_POSTPRESET_Pos 1 /*!< DWT CTRL: POSTPRESET Position */ -#define DWT_CTRL_POSTPRESET_Msk (0xFUL << DWT_CTRL_POSTPRESET_Pos) /*!< DWT CTRL: POSTPRESET Mask */ - -#define DWT_CTRL_CYCCNTENA_Pos 0 /*!< DWT CTRL: CYCCNTENA Position */ -#define DWT_CTRL_CYCCNTENA_Msk (0x1UL /*<< DWT_CTRL_CYCCNTENA_Pos*/) /*!< DWT CTRL: CYCCNTENA Mask */ - -/* DWT CPI Count Register Definitions */ -#define DWT_CPICNT_CPICNT_Pos 0 /*!< DWT CPICNT: CPICNT Position */ -#define DWT_CPICNT_CPICNT_Msk (0xFFUL /*<< DWT_CPICNT_CPICNT_Pos*/) /*!< DWT CPICNT: CPICNT Mask */ - -/* DWT Exception Overhead Count Register Definitions */ -#define DWT_EXCCNT_EXCCNT_Pos 0 /*!< DWT EXCCNT: EXCCNT Position */ -#define DWT_EXCCNT_EXCCNT_Msk (0xFFUL /*<< DWT_EXCCNT_EXCCNT_Pos*/) /*!< DWT EXCCNT: EXCCNT Mask */ - -/* DWT Sleep Count Register Definitions */ -#define DWT_SLEEPCNT_SLEEPCNT_Pos 0 /*!< DWT SLEEPCNT: SLEEPCNT Position */ -#define DWT_SLEEPCNT_SLEEPCNT_Msk (0xFFUL /*<< DWT_SLEEPCNT_SLEEPCNT_Pos*/) /*!< DWT SLEEPCNT: SLEEPCNT Mask */ - -/* DWT LSU Count Register Definitions */ -#define DWT_LSUCNT_LSUCNT_Pos 0 /*!< DWT LSUCNT: LSUCNT Position */ -#define DWT_LSUCNT_LSUCNT_Msk (0xFFUL /*<< DWT_LSUCNT_LSUCNT_Pos*/) /*!< DWT LSUCNT: LSUCNT Mask */ - -/* DWT Folded-instruction Count Register Definitions */ -#define DWT_FOLDCNT_FOLDCNT_Pos 0 /*!< DWT FOLDCNT: FOLDCNT Position */ -#define DWT_FOLDCNT_FOLDCNT_Msk (0xFFUL /*<< DWT_FOLDCNT_FOLDCNT_Pos*/) /*!< DWT FOLDCNT: FOLDCNT Mask */ - -/* DWT Comparator Mask Register Definitions */ -#define DWT_MASK_MASK_Pos 0 /*!< DWT MASK: MASK Position */ -#define DWT_MASK_MASK_Msk (0x1FUL /*<< DWT_MASK_MASK_Pos*/) /*!< DWT MASK: MASK Mask */ - -/* DWT Comparator Function Register Definitions */ -#define DWT_FUNCTION_MATCHED_Pos 24 /*!< DWT FUNCTION: MATCHED Position */ -#define DWT_FUNCTION_MATCHED_Msk (0x1UL << DWT_FUNCTION_MATCHED_Pos) /*!< DWT FUNCTION: MATCHED Mask */ - -#define DWT_FUNCTION_DATAVADDR1_Pos 16 /*!< DWT FUNCTION: DATAVADDR1 Position */ -#define DWT_FUNCTION_DATAVADDR1_Msk (0xFUL << DWT_FUNCTION_DATAVADDR1_Pos) /*!< DWT FUNCTION: DATAVADDR1 Mask */ - -#define DWT_FUNCTION_DATAVADDR0_Pos 12 /*!< DWT FUNCTION: DATAVADDR0 Position */ -#define DWT_FUNCTION_DATAVADDR0_Msk (0xFUL << DWT_FUNCTION_DATAVADDR0_Pos) /*!< DWT FUNCTION: DATAVADDR0 Mask */ - -#define DWT_FUNCTION_DATAVSIZE_Pos 10 /*!< DWT FUNCTION: DATAVSIZE Position */ -#define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos) /*!< DWT FUNCTION: DATAVSIZE Mask */ - -#define DWT_FUNCTION_LNK1ENA_Pos 9 /*!< DWT FUNCTION: LNK1ENA Position */ -#define DWT_FUNCTION_LNK1ENA_Msk (0x1UL << DWT_FUNCTION_LNK1ENA_Pos) /*!< DWT FUNCTION: LNK1ENA Mask */ - -#define DWT_FUNCTION_DATAVMATCH_Pos 8 /*!< DWT FUNCTION: DATAVMATCH Position */ -#define DWT_FUNCTION_DATAVMATCH_Msk (0x1UL << DWT_FUNCTION_DATAVMATCH_Pos) /*!< DWT FUNCTION: DATAVMATCH Mask */ - -#define DWT_FUNCTION_CYCMATCH_Pos 7 /*!< DWT FUNCTION: CYCMATCH Position */ -#define DWT_FUNCTION_CYCMATCH_Msk (0x1UL << DWT_FUNCTION_CYCMATCH_Pos) /*!< DWT FUNCTION: CYCMATCH Mask */ - -#define DWT_FUNCTION_EMITRANGE_Pos 5 /*!< DWT FUNCTION: EMITRANGE Position */ -#define DWT_FUNCTION_EMITRANGE_Msk (0x1UL << DWT_FUNCTION_EMITRANGE_Pos) /*!< DWT FUNCTION: EMITRANGE Mask */ - -#define DWT_FUNCTION_FUNCTION_Pos 0 /*!< DWT FUNCTION: FUNCTION Position */ -#define DWT_FUNCTION_FUNCTION_Msk (0xFUL /*<< DWT_FUNCTION_FUNCTION_Pos*/) /*!< DWT FUNCTION: FUNCTION Mask */ - -/*@}*/ /* end of group CMSIS_DWT */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_TPI Trace Port Interface (TPI) - \brief Type definitions for the Trace Port Interface (TPI) - @{ - */ - -/** \brief Structure type to access the Trace Port Interface Register (TPI). - */ -typedef struct -{ - __IO uint32_t SSPSR; /*!< Offset: 0x000 (R/ ) Supported Parallel Port Size Register */ - __IO uint32_t CSPSR; /*!< Offset: 0x004 (R/W) Current Parallel Port Size Register */ - uint32_t RESERVED0[2]; - __IO uint32_t ACPR; /*!< Offset: 0x010 (R/W) Asynchronous Clock Prescaler Register */ - uint32_t RESERVED1[55]; - __IO uint32_t SPPR; /*!< Offset: 0x0F0 (R/W) Selected Pin Protocol Register */ - uint32_t RESERVED2[131]; - __I uint32_t FFSR; /*!< Offset: 0x300 (R/ ) Formatter and Flush Status Register */ - __IO uint32_t FFCR; /*!< Offset: 0x304 (R/W) Formatter and Flush Control Register */ - __I uint32_t FSCR; /*!< Offset: 0x308 (R/ ) Formatter Synchronization Counter Register */ - uint32_t RESERVED3[759]; - __I uint32_t TRIGGER; /*!< Offset: 0xEE8 (R/ ) TRIGGER */ - __I uint32_t FIFO0; /*!< Offset: 0xEEC (R/ ) Integration ETM Data */ - __I uint32_t ITATBCTR2; /*!< Offset: 0xEF0 (R/ ) ITATBCTR2 */ - uint32_t RESERVED4[1]; - __I uint32_t ITATBCTR0; /*!< Offset: 0xEF8 (R/ ) ITATBCTR0 */ - __I uint32_t FIFO1; /*!< Offset: 0xEFC (R/ ) Integration ITM Data */ - __IO uint32_t ITCTRL; /*!< Offset: 0xF00 (R/W) Integration Mode Control */ - uint32_t RESERVED5[39]; - __IO uint32_t CLAIMSET; /*!< Offset: 0xFA0 (R/W) Claim tag set */ - __IO uint32_t CLAIMCLR; /*!< Offset: 0xFA4 (R/W) Claim tag clear */ - uint32_t RESERVED7[8]; - __I uint32_t DEVID; /*!< Offset: 0xFC8 (R/ ) TPIU_DEVID */ - __I uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) TPIU_DEVTYPE */ -} TPI_Type; - -/* TPI Asynchronous Clock Prescaler Register Definitions */ -#define TPI_ACPR_PRESCALER_Pos 0 /*!< TPI ACPR: PRESCALER Position */ -#define TPI_ACPR_PRESCALER_Msk (0x1FFFUL /*<< TPI_ACPR_PRESCALER_Pos*/) /*!< TPI ACPR: PRESCALER Mask */ - -/* TPI Selected Pin Protocol Register Definitions */ -#define TPI_SPPR_TXMODE_Pos 0 /*!< TPI SPPR: TXMODE Position */ -#define TPI_SPPR_TXMODE_Msk (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/) /*!< TPI SPPR: TXMODE Mask */ - -/* TPI Formatter and Flush Status Register Definitions */ -#define TPI_FFSR_FtNonStop_Pos 3 /*!< TPI FFSR: FtNonStop Position */ -#define TPI_FFSR_FtNonStop_Msk (0x1UL << TPI_FFSR_FtNonStop_Pos) /*!< TPI FFSR: FtNonStop Mask */ - -#define TPI_FFSR_TCPresent_Pos 2 /*!< TPI FFSR: TCPresent Position */ -#define TPI_FFSR_TCPresent_Msk (0x1UL << TPI_FFSR_TCPresent_Pos) /*!< TPI FFSR: TCPresent Mask */ - -#define TPI_FFSR_FtStopped_Pos 1 /*!< TPI FFSR: FtStopped Position */ -#define TPI_FFSR_FtStopped_Msk (0x1UL << TPI_FFSR_FtStopped_Pos) /*!< TPI FFSR: FtStopped Mask */ - -#define TPI_FFSR_FlInProg_Pos 0 /*!< TPI FFSR: FlInProg Position */ -#define TPI_FFSR_FlInProg_Msk (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/) /*!< TPI FFSR: FlInProg Mask */ - -/* TPI Formatter and Flush Control Register Definitions */ -#define TPI_FFCR_TrigIn_Pos 8 /*!< TPI FFCR: TrigIn Position */ -#define TPI_FFCR_TrigIn_Msk (0x1UL << TPI_FFCR_TrigIn_Pos) /*!< TPI FFCR: TrigIn Mask */ - -#define TPI_FFCR_EnFCont_Pos 1 /*!< TPI FFCR: EnFCont Position */ -#define TPI_FFCR_EnFCont_Msk (0x1UL << TPI_FFCR_EnFCont_Pos) /*!< TPI FFCR: EnFCont Mask */ - -/* TPI TRIGGER Register Definitions */ -#define TPI_TRIGGER_TRIGGER_Pos 0 /*!< TPI TRIGGER: TRIGGER Position */ -#define TPI_TRIGGER_TRIGGER_Msk (0x1UL /*<< TPI_TRIGGER_TRIGGER_Pos*/) /*!< TPI TRIGGER: TRIGGER Mask */ - -/* TPI Integration ETM Data Register Definitions (FIFO0) */ -#define TPI_FIFO0_ITM_ATVALID_Pos 29 /*!< TPI FIFO0: ITM_ATVALID Position */ -#define TPI_FIFO0_ITM_ATVALID_Msk (0x3UL << TPI_FIFO0_ITM_ATVALID_Pos) /*!< TPI FIFO0: ITM_ATVALID Mask */ - -#define TPI_FIFO0_ITM_bytecount_Pos 27 /*!< TPI FIFO0: ITM_bytecount Position */ -#define TPI_FIFO0_ITM_bytecount_Msk (0x3UL << TPI_FIFO0_ITM_bytecount_Pos) /*!< TPI FIFO0: ITM_bytecount Mask */ - -#define TPI_FIFO0_ETM_ATVALID_Pos 26 /*!< TPI FIFO0: ETM_ATVALID Position */ -#define TPI_FIFO0_ETM_ATVALID_Msk (0x3UL << TPI_FIFO0_ETM_ATVALID_Pos) /*!< TPI FIFO0: ETM_ATVALID Mask */ - -#define TPI_FIFO0_ETM_bytecount_Pos 24 /*!< TPI FIFO0: ETM_bytecount Position */ -#define TPI_FIFO0_ETM_bytecount_Msk (0x3UL << TPI_FIFO0_ETM_bytecount_Pos) /*!< TPI FIFO0: ETM_bytecount Mask */ - -#define TPI_FIFO0_ETM2_Pos 16 /*!< TPI FIFO0: ETM2 Position */ -#define TPI_FIFO0_ETM2_Msk (0xFFUL << TPI_FIFO0_ETM2_Pos) /*!< TPI FIFO0: ETM2 Mask */ - -#define TPI_FIFO0_ETM1_Pos 8 /*!< TPI FIFO0: ETM1 Position */ -#define TPI_FIFO0_ETM1_Msk (0xFFUL << TPI_FIFO0_ETM1_Pos) /*!< TPI FIFO0: ETM1 Mask */ - -#define TPI_FIFO0_ETM0_Pos 0 /*!< TPI FIFO0: ETM0 Position */ -#define TPI_FIFO0_ETM0_Msk (0xFFUL /*<< TPI_FIFO0_ETM0_Pos*/) /*!< TPI FIFO0: ETM0 Mask */ - -/* TPI ITATBCTR2 Register Definitions */ -#define TPI_ITATBCTR2_ATREADY_Pos 0 /*!< TPI ITATBCTR2: ATREADY Position */ -#define TPI_ITATBCTR2_ATREADY_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY_Pos*/) /*!< TPI ITATBCTR2: ATREADY Mask */ - -/* TPI Integration ITM Data Register Definitions (FIFO1) */ -#define TPI_FIFO1_ITM_ATVALID_Pos 29 /*!< TPI FIFO1: ITM_ATVALID Position */ -#define TPI_FIFO1_ITM_ATVALID_Msk (0x3UL << TPI_FIFO1_ITM_ATVALID_Pos) /*!< TPI FIFO1: ITM_ATVALID Mask */ - -#define TPI_FIFO1_ITM_bytecount_Pos 27 /*!< TPI FIFO1: ITM_bytecount Position */ -#define TPI_FIFO1_ITM_bytecount_Msk (0x3UL << TPI_FIFO1_ITM_bytecount_Pos) /*!< TPI FIFO1: ITM_bytecount Mask */ - -#define TPI_FIFO1_ETM_ATVALID_Pos 26 /*!< TPI FIFO1: ETM_ATVALID Position */ -#define TPI_FIFO1_ETM_ATVALID_Msk (0x3UL << TPI_FIFO1_ETM_ATVALID_Pos) /*!< TPI FIFO1: ETM_ATVALID Mask */ - -#define TPI_FIFO1_ETM_bytecount_Pos 24 /*!< TPI FIFO1: ETM_bytecount Position */ -#define TPI_FIFO1_ETM_bytecount_Msk (0x3UL << TPI_FIFO1_ETM_bytecount_Pos) /*!< TPI FIFO1: ETM_bytecount Mask */ - -#define TPI_FIFO1_ITM2_Pos 16 /*!< TPI FIFO1: ITM2 Position */ -#define TPI_FIFO1_ITM2_Msk (0xFFUL << TPI_FIFO1_ITM2_Pos) /*!< TPI FIFO1: ITM2 Mask */ - -#define TPI_FIFO1_ITM1_Pos 8 /*!< TPI FIFO1: ITM1 Position */ -#define TPI_FIFO1_ITM1_Msk (0xFFUL << TPI_FIFO1_ITM1_Pos) /*!< TPI FIFO1: ITM1 Mask */ - -#define TPI_FIFO1_ITM0_Pos 0 /*!< TPI FIFO1: ITM0 Position */ -#define TPI_FIFO1_ITM0_Msk (0xFFUL /*<< TPI_FIFO1_ITM0_Pos*/) /*!< TPI FIFO1: ITM0 Mask */ - -/* TPI ITATBCTR0 Register Definitions */ -#define TPI_ITATBCTR0_ATREADY_Pos 0 /*!< TPI ITATBCTR0: ATREADY Position */ -#define TPI_ITATBCTR0_ATREADY_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY_Pos*/) /*!< TPI ITATBCTR0: ATREADY Mask */ - -/* TPI Integration Mode Control Register Definitions */ -#define TPI_ITCTRL_Mode_Pos 0 /*!< TPI ITCTRL: Mode Position */ -#define TPI_ITCTRL_Mode_Msk (0x1UL /*<< TPI_ITCTRL_Mode_Pos*/) /*!< TPI ITCTRL: Mode Mask */ - -/* TPI DEVID Register Definitions */ -#define TPI_DEVID_NRZVALID_Pos 11 /*!< TPI DEVID: NRZVALID Position */ -#define TPI_DEVID_NRZVALID_Msk (0x1UL << TPI_DEVID_NRZVALID_Pos) /*!< TPI DEVID: NRZVALID Mask */ - -#define TPI_DEVID_MANCVALID_Pos 10 /*!< TPI DEVID: MANCVALID Position */ -#define TPI_DEVID_MANCVALID_Msk (0x1UL << TPI_DEVID_MANCVALID_Pos) /*!< TPI DEVID: MANCVALID Mask */ - -#define TPI_DEVID_PTINVALID_Pos 9 /*!< TPI DEVID: PTINVALID Position */ -#define TPI_DEVID_PTINVALID_Msk (0x1UL << TPI_DEVID_PTINVALID_Pos) /*!< TPI DEVID: PTINVALID Mask */ - -#define TPI_DEVID_MinBufSz_Pos 6 /*!< TPI DEVID: MinBufSz Position */ -#define TPI_DEVID_MinBufSz_Msk (0x7UL << TPI_DEVID_MinBufSz_Pos) /*!< TPI DEVID: MinBufSz Mask */ - -#define TPI_DEVID_AsynClkIn_Pos 5 /*!< TPI DEVID: AsynClkIn Position */ -#define TPI_DEVID_AsynClkIn_Msk (0x1UL << TPI_DEVID_AsynClkIn_Pos) /*!< TPI DEVID: AsynClkIn Mask */ - -#define TPI_DEVID_NrTraceInput_Pos 0 /*!< TPI DEVID: NrTraceInput Position */ -#define TPI_DEVID_NrTraceInput_Msk (0x1FUL /*<< TPI_DEVID_NrTraceInput_Pos*/) /*!< TPI DEVID: NrTraceInput Mask */ - -/* TPI DEVTYPE Register Definitions */ -#define TPI_DEVTYPE_MajorType_Pos 4 /*!< TPI DEVTYPE: MajorType Position */ -#define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos) /*!< TPI DEVTYPE: MajorType Mask */ - -#define TPI_DEVTYPE_SubType_Pos 0 /*!< TPI DEVTYPE: SubType Position */ -#define TPI_DEVTYPE_SubType_Msk (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/) /*!< TPI DEVTYPE: SubType Mask */ - -/*@}*/ /* end of group CMSIS_TPI */ - - -#if (__MPU_PRESENT == 1) -/** \ingroup CMSIS_core_register - \defgroup CMSIS_MPU Memory Protection Unit (MPU) - \brief Type definitions for the Memory Protection Unit (MPU) - @{ - */ - -/** \brief Structure type to access the Memory Protection Unit (MPU). - */ -typedef struct -{ - __I uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */ - __IO uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */ - __IO uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region RNRber Register */ - __IO uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */ - __IO uint32_t RASR; /*!< Offset: 0x010 (R/W) MPU Region Attribute and Size Register */ - __IO uint32_t RBAR_A1; /*!< Offset: 0x014 (R/W) MPU Alias 1 Region Base Address Register */ - __IO uint32_t RASR_A1; /*!< Offset: 0x018 (R/W) MPU Alias 1 Region Attribute and Size Register */ - __IO uint32_t RBAR_A2; /*!< Offset: 0x01C (R/W) MPU Alias 2 Region Base Address Register */ - __IO uint32_t RASR_A2; /*!< Offset: 0x020 (R/W) MPU Alias 2 Region Attribute and Size Register */ - __IO uint32_t RBAR_A3; /*!< Offset: 0x024 (R/W) MPU Alias 3 Region Base Address Register */ - __IO uint32_t RASR_A3; /*!< Offset: 0x028 (R/W) MPU Alias 3 Region Attribute and Size Register */ -} MPU_Type; - -/* MPU Type Register */ -#define MPU_TYPE_IREGION_Pos 16 /*!< MPU TYPE: IREGION Position */ -#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */ - -#define MPU_TYPE_DREGION_Pos 8 /*!< MPU TYPE: DREGION Position */ -#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */ - -#define MPU_TYPE_SEPARATE_Pos 0 /*!< MPU TYPE: SEPARATE Position */ -#define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/) /*!< MPU TYPE: SEPARATE Mask */ - -/* MPU Control Register */ -#define MPU_CTRL_PRIVDEFENA_Pos 2 /*!< MPU CTRL: PRIVDEFENA Position */ -#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */ - -#define MPU_CTRL_HFNMIENA_Pos 1 /*!< MPU CTRL: HFNMIENA Position */ -#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */ - -#define MPU_CTRL_ENABLE_Pos 0 /*!< MPU CTRL: ENABLE Position */ -#define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/) /*!< MPU CTRL: ENABLE Mask */ - -/* MPU Region Number Register */ -#define MPU_RNR_REGION_Pos 0 /*!< MPU RNR: REGION Position */ -#define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/) /*!< MPU RNR: REGION Mask */ - -/* MPU Region Base Address Register */ -#define MPU_RBAR_ADDR_Pos 5 /*!< MPU RBAR: ADDR Position */ -#define MPU_RBAR_ADDR_Msk (0x7FFFFFFUL << MPU_RBAR_ADDR_Pos) /*!< MPU RBAR: ADDR Mask */ - -#define MPU_RBAR_VALID_Pos 4 /*!< MPU RBAR: VALID Position */ -#define MPU_RBAR_VALID_Msk (1UL << MPU_RBAR_VALID_Pos) /*!< MPU RBAR: VALID Mask */ - -#define MPU_RBAR_REGION_Pos 0 /*!< MPU RBAR: REGION Position */ -#define MPU_RBAR_REGION_Msk (0xFUL /*<< MPU_RBAR_REGION_Pos*/) /*!< MPU RBAR: REGION Mask */ - -/* MPU Region Attribute and Size Register */ -#define MPU_RASR_ATTRS_Pos 16 /*!< MPU RASR: MPU Region Attribute field Position */ -#define MPU_RASR_ATTRS_Msk (0xFFFFUL << MPU_RASR_ATTRS_Pos) /*!< MPU RASR: MPU Region Attribute field Mask */ - -#define MPU_RASR_XN_Pos 28 /*!< MPU RASR: ATTRS.XN Position */ -#define MPU_RASR_XN_Msk (1UL << MPU_RASR_XN_Pos) /*!< MPU RASR: ATTRS.XN Mask */ - -#define MPU_RASR_AP_Pos 24 /*!< MPU RASR: ATTRS.AP Position */ -#define MPU_RASR_AP_Msk (0x7UL << MPU_RASR_AP_Pos) /*!< MPU RASR: ATTRS.AP Mask */ - -#define MPU_RASR_TEX_Pos 19 /*!< MPU RASR: ATTRS.TEX Position */ -#define MPU_RASR_TEX_Msk (0x7UL << MPU_RASR_TEX_Pos) /*!< MPU RASR: ATTRS.TEX Mask */ - -#define MPU_RASR_S_Pos 18 /*!< MPU RASR: ATTRS.S Position */ -#define MPU_RASR_S_Msk (1UL << MPU_RASR_S_Pos) /*!< MPU RASR: ATTRS.S Mask */ - -#define MPU_RASR_C_Pos 17 /*!< MPU RASR: ATTRS.C Position */ -#define MPU_RASR_C_Msk (1UL << MPU_RASR_C_Pos) /*!< MPU RASR: ATTRS.C Mask */ - -#define MPU_RASR_B_Pos 16 /*!< MPU RASR: ATTRS.B Position */ -#define MPU_RASR_B_Msk (1UL << MPU_RASR_B_Pos) /*!< MPU RASR: ATTRS.B Mask */ - -#define MPU_RASR_SRD_Pos 8 /*!< MPU RASR: Sub-Region Disable Position */ -#define MPU_RASR_SRD_Msk (0xFFUL << MPU_RASR_SRD_Pos) /*!< MPU RASR: Sub-Region Disable Mask */ - -#define MPU_RASR_SIZE_Pos 1 /*!< MPU RASR: Region Size Field Position */ -#define MPU_RASR_SIZE_Msk (0x1FUL << MPU_RASR_SIZE_Pos) /*!< MPU RASR: Region Size Field Mask */ - -#define MPU_RASR_ENABLE_Pos 0 /*!< MPU RASR: Region enable bit Position */ -#define MPU_RASR_ENABLE_Msk (1UL /*<< MPU_RASR_ENABLE_Pos*/) /*!< MPU RASR: Region enable bit Disable Mask */ - -/*@} end of group CMSIS_MPU */ -#endif - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) - \brief Type definitions for the Core Debug Registers - @{ - */ - -/** \brief Structure type to access the Core Debug Register (CoreDebug). - */ -typedef struct -{ - __IO uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */ - __O uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */ - __IO uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */ - __IO uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */ -} CoreDebug_Type; - -/* Debug Halting Control and Status Register */ -#define CoreDebug_DHCSR_DBGKEY_Pos 16 /*!< CoreDebug DHCSR: DBGKEY Position */ -#define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos) /*!< CoreDebug DHCSR: DBGKEY Mask */ - -#define CoreDebug_DHCSR_S_RESET_ST_Pos 25 /*!< CoreDebug DHCSR: S_RESET_ST Position */ -#define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos) /*!< CoreDebug DHCSR: S_RESET_ST Mask */ - -#define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24 /*!< CoreDebug DHCSR: S_RETIRE_ST Position */ -#define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos) /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */ - -#define CoreDebug_DHCSR_S_LOCKUP_Pos 19 /*!< CoreDebug DHCSR: S_LOCKUP Position */ -#define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos) /*!< CoreDebug DHCSR: S_LOCKUP Mask */ - -#define CoreDebug_DHCSR_S_SLEEP_Pos 18 /*!< CoreDebug DHCSR: S_SLEEP Position */ -#define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos) /*!< CoreDebug DHCSR: S_SLEEP Mask */ - -#define CoreDebug_DHCSR_S_HALT_Pos 17 /*!< CoreDebug DHCSR: S_HALT Position */ -#define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos) /*!< CoreDebug DHCSR: S_HALT Mask */ - -#define CoreDebug_DHCSR_S_REGRDY_Pos 16 /*!< CoreDebug DHCSR: S_REGRDY Position */ -#define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos) /*!< CoreDebug DHCSR: S_REGRDY Mask */ - -#define CoreDebug_DHCSR_C_SNAPSTALL_Pos 5 /*!< CoreDebug DHCSR: C_SNAPSTALL Position */ -#define CoreDebug_DHCSR_C_SNAPSTALL_Msk (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos) /*!< CoreDebug DHCSR: C_SNAPSTALL Mask */ - -#define CoreDebug_DHCSR_C_MASKINTS_Pos 3 /*!< CoreDebug DHCSR: C_MASKINTS Position */ -#define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos) /*!< CoreDebug DHCSR: C_MASKINTS Mask */ - -#define CoreDebug_DHCSR_C_STEP_Pos 2 /*!< CoreDebug DHCSR: C_STEP Position */ -#define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos) /*!< CoreDebug DHCSR: C_STEP Mask */ - -#define CoreDebug_DHCSR_C_HALT_Pos 1 /*!< CoreDebug DHCSR: C_HALT Position */ -#define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos) /*!< CoreDebug DHCSR: C_HALT Mask */ - -#define CoreDebug_DHCSR_C_DEBUGEN_Pos 0 /*!< CoreDebug DHCSR: C_DEBUGEN Position */ -#define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/) /*!< CoreDebug DHCSR: C_DEBUGEN Mask */ - -/* Debug Core Register Selector Register */ -#define CoreDebug_DCRSR_REGWnR_Pos 16 /*!< CoreDebug DCRSR: REGWnR Position */ -#define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos) /*!< CoreDebug DCRSR: REGWnR Mask */ - -#define CoreDebug_DCRSR_REGSEL_Pos 0 /*!< CoreDebug DCRSR: REGSEL Position */ -#define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/) /*!< CoreDebug DCRSR: REGSEL Mask */ - -/* Debug Exception and Monitor Control Register */ -#define CoreDebug_DEMCR_TRCENA_Pos 24 /*!< CoreDebug DEMCR: TRCENA Position */ -#define CoreDebug_DEMCR_TRCENA_Msk (1UL << CoreDebug_DEMCR_TRCENA_Pos) /*!< CoreDebug DEMCR: TRCENA Mask */ - -#define CoreDebug_DEMCR_MON_REQ_Pos 19 /*!< CoreDebug DEMCR: MON_REQ Position */ -#define CoreDebug_DEMCR_MON_REQ_Msk (1UL << CoreDebug_DEMCR_MON_REQ_Pos) /*!< CoreDebug DEMCR: MON_REQ Mask */ - -#define CoreDebug_DEMCR_MON_STEP_Pos 18 /*!< CoreDebug DEMCR: MON_STEP Position */ -#define CoreDebug_DEMCR_MON_STEP_Msk (1UL << CoreDebug_DEMCR_MON_STEP_Pos) /*!< CoreDebug DEMCR: MON_STEP Mask */ - -#define CoreDebug_DEMCR_MON_PEND_Pos 17 /*!< CoreDebug DEMCR: MON_PEND Position */ -#define CoreDebug_DEMCR_MON_PEND_Msk (1UL << CoreDebug_DEMCR_MON_PEND_Pos) /*!< CoreDebug DEMCR: MON_PEND Mask */ - -#define CoreDebug_DEMCR_MON_EN_Pos 16 /*!< CoreDebug DEMCR: MON_EN Position */ -#define CoreDebug_DEMCR_MON_EN_Msk (1UL << CoreDebug_DEMCR_MON_EN_Pos) /*!< CoreDebug DEMCR: MON_EN Mask */ - -#define CoreDebug_DEMCR_VC_HARDERR_Pos 10 /*!< CoreDebug DEMCR: VC_HARDERR Position */ -#define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos) /*!< CoreDebug DEMCR: VC_HARDERR Mask */ - -#define CoreDebug_DEMCR_VC_INTERR_Pos 9 /*!< CoreDebug DEMCR: VC_INTERR Position */ -#define CoreDebug_DEMCR_VC_INTERR_Msk (1UL << CoreDebug_DEMCR_VC_INTERR_Pos) /*!< CoreDebug DEMCR: VC_INTERR Mask */ - -#define CoreDebug_DEMCR_VC_BUSERR_Pos 8 /*!< CoreDebug DEMCR: VC_BUSERR Position */ -#define CoreDebug_DEMCR_VC_BUSERR_Msk (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos) /*!< CoreDebug DEMCR: VC_BUSERR Mask */ - -#define CoreDebug_DEMCR_VC_STATERR_Pos 7 /*!< CoreDebug DEMCR: VC_STATERR Position */ -#define CoreDebug_DEMCR_VC_STATERR_Msk (1UL << CoreDebug_DEMCR_VC_STATERR_Pos) /*!< CoreDebug DEMCR: VC_STATERR Mask */ - -#define CoreDebug_DEMCR_VC_CHKERR_Pos 6 /*!< CoreDebug DEMCR: VC_CHKERR Position */ -#define CoreDebug_DEMCR_VC_CHKERR_Msk (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos) /*!< CoreDebug DEMCR: VC_CHKERR Mask */ - -#define CoreDebug_DEMCR_VC_NOCPERR_Pos 5 /*!< CoreDebug DEMCR: VC_NOCPERR Position */ -#define CoreDebug_DEMCR_VC_NOCPERR_Msk (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos) /*!< CoreDebug DEMCR: VC_NOCPERR Mask */ - -#define CoreDebug_DEMCR_VC_MMERR_Pos 4 /*!< CoreDebug DEMCR: VC_MMERR Position */ -#define CoreDebug_DEMCR_VC_MMERR_Msk (1UL << CoreDebug_DEMCR_VC_MMERR_Pos) /*!< CoreDebug DEMCR: VC_MMERR Mask */ - -#define CoreDebug_DEMCR_VC_CORERESET_Pos 0 /*!< CoreDebug DEMCR: VC_CORERESET Position */ -#define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/) /*!< CoreDebug DEMCR: VC_CORERESET Mask */ - -/*@} end of group CMSIS_CoreDebug */ - - -/** \ingroup CMSIS_core_register - \defgroup CMSIS_core_base Core Definitions - \brief Definitions for base addresses, unions, and structures. - @{ - */ - -/* Memory mapping of Cortex-M3 Hardware */ -#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ -#define ITM_BASE (0xE0000000UL) /*!< ITM Base Address */ -#define DWT_BASE (0xE0001000UL) /*!< DWT Base Address */ -#define TPI_BASE (0xE0040000UL) /*!< TPI Base Address */ -#define CoreDebug_BASE (0xE000EDF0UL) /*!< Core Debug Base Address */ -#define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ -#define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ -#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ - -#define SCnSCB ((SCnSCB_Type *) SCS_BASE ) /*!< System control Register not in SCB */ -#define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ -#define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ -#define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ -#define ITM ((ITM_Type *) ITM_BASE ) /*!< ITM configuration struct */ -#define DWT ((DWT_Type *) DWT_BASE ) /*!< DWT configuration struct */ -#define TPI ((TPI_Type *) TPI_BASE ) /*!< TPI configuration struct */ -#define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE) /*!< Core Debug configuration struct */ - -#if (__MPU_PRESENT == 1) - #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ - #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ -#endif - -/*@} */ - - - -/******************************************************************************* - * Hardware Abstraction Layer - Core Function Interface contains: - - Core NVIC Functions - - Core SysTick Functions - - Core Debug Functions - - Core Register Access Functions - ******************************************************************************/ -/** \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference -*/ - - - -/* ########################## NVIC functions #################################### */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_NVICFunctions NVIC Functions - \brief Functions that manage interrupts and exceptions via the NVIC. - @{ - */ - -/** \brief Set Priority Grouping - - The function sets the priority grouping field using the required unlock sequence. - The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field. - Only values from 0..7 are used. - In case of a conflict between priority grouping and available - priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. - - \param [in] PriorityGroup Priority grouping field. - */ -__STATIC_INLINE void NVIC_SetPriorityGrouping(uint32_t PriorityGroup) -{ - uint32_t reg_value; - uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ - - reg_value = SCB->AIRCR; /* read old register configuration */ - reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ - reg_value = (reg_value | - ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | - (PriorityGroupTmp << 8) ); /* Insert write key and priorty group */ - SCB->AIRCR = reg_value; -} - - -/** \brief Get Priority Grouping - - The function reads the priority grouping field from the NVIC Interrupt Controller. - - \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field). - */ -__STATIC_INLINE uint32_t NVIC_GetPriorityGrouping(void) -{ - return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos)); -} - - -/** \brief Enable External Interrupt - - The function enables a device-specific interrupt in the NVIC interrupt controller. - - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn) -{ - NVIC->ISER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** \brief Disable External Interrupt - - The function disables a device-specific interrupt in the NVIC interrupt controller. - - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn) -{ - NVIC->ICER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** \brief Get Pending Interrupt - - The function reads the pending register in the NVIC and returns the pending bit - for the specified interrupt. - - \param [in] IRQn Interrupt number. - - \return 0 Interrupt status is not pending. - \return 1 Interrupt status is pending. - */ -__STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn) -{ - return((uint32_t)(((NVIC->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** \brief Set Pending Interrupt - - The function sets the pending bit of an external interrupt. - - \param [in] IRQn Interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** \brief Clear Pending Interrupt - - The function clears the pending bit of an external interrupt. - - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ICPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** \brief Get Active Interrupt - - The function reads the active register in NVIC and returns the active bit. - - \param [in] IRQn Interrupt number. - - \return 0 Interrupt status is not active. - \return 1 Interrupt status is active. - */ -__STATIC_INLINE uint32_t NVIC_GetActive(IRQn_Type IRQn) -{ - return((uint32_t)(((NVIC->IABR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** \brief Set Interrupt Priority - - The function sets the priority of an interrupt. - - \note The priority cannot be set for every core interrupt. - - \param [in] IRQn Interrupt number. - \param [in] priority Priority to set. - */ -__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) -{ - if((int32_t)IRQn < 0) { - SCB->SHP[(((uint32_t)(int32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8 - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } - else { - NVIC->IP[((uint32_t)(int32_t)IRQn)] = (uint8_t)((priority << (8 - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } -} - - -/** \brief Get Interrupt Priority - - The function reads the priority of an interrupt. The interrupt - number can be positive to specify an external (device specific) - interrupt, or negative to specify an internal (core) interrupt. - - - \param [in] IRQn Interrupt number. - \return Interrupt Priority. Value is aligned automatically to the implemented - priority bits of the microcontroller. - */ -__STATIC_INLINE uint32_t NVIC_GetPriority(IRQn_Type IRQn) -{ - - if((int32_t)IRQn < 0) { - return(((uint32_t)SCB->SHP[(((uint32_t)(int32_t)IRQn) & 0xFUL)-4UL] >> (8 - __NVIC_PRIO_BITS))); - } - else { - return(((uint32_t)NVIC->IP[((uint32_t)(int32_t)IRQn)] >> (8 - __NVIC_PRIO_BITS))); - } -} - - -/** \brief Encode Priority - - The function encodes the priority for an interrupt with the given priority group, - preemptive priority value, and subpriority value. - In case of a conflict between priority grouping and available - priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. - - \param [in] PriorityGroup Used priority group. - \param [in] PreemptPriority Preemptive priority value (starting from 0). - \param [in] SubPriority Subpriority value (starting from 0). - \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority(). - */ -__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) -{ - uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ - uint32_t PreemptPriorityBits; - uint32_t SubPriorityBits; - - PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); - SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); - - return ( - ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | - ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL))) - ); -} - - -/** \brief Decode Priority - - The function decodes an interrupt priority value with a given priority group to - preemptive priority value and subpriority value. - In case of a conflict between priority grouping and available - priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set. - - \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority(). - \param [in] PriorityGroup Used priority group. - \param [out] pPreemptPriority Preemptive priority value (starting from 0). - \param [out] pSubPriority Subpriority value (starting from 0). - */ -__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* pPreemptPriority, uint32_t* pSubPriority) -{ - uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ - uint32_t PreemptPriorityBits; - uint32_t SubPriorityBits; - - PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); - SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); - - *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL); - *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL); -} - - -/** \brief System Reset - - The function initiates a system reset request to reset the MCU. - */ -__STATIC_INLINE void NVIC_SystemReset(void) -{ - __DSB(); /* Ensure all outstanding memory accesses included - buffered write are completed before reset */ - SCB->AIRCR = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | - (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) | - SCB_AIRCR_SYSRESETREQ_Msk ); /* Keep priority group unchanged */ - __DSB(); /* Ensure completion of memory access */ - while(1) { __NOP(); } /* wait until reset */ -} - -/*@} end of CMSIS_Core_NVICFunctions */ - - - -/* ################################## SysTick function ############################################ */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_SysTickFunctions SysTick Functions - \brief Functions that configure the System. - @{ - */ - -#if (__Vendor_SysTickConfig == 0) - -/** \brief System Tick Configuration - - The function initializes the System Timer and its interrupt, and starts the System Tick Timer. - Counter is in free running mode to generate periodic interrupts. - - \param [in] ticks Number of ticks between two interrupts. - - \return 0 Function succeeded. - \return 1 Function failed. - - \note When the variable __Vendor_SysTickConfig is set to 1, then the - function SysTick_Config is not included. In this case, the file device.h - must contain a vendor-specific implementation of this function. - - */ -__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) -{ - if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) { return (1UL); } /* Reload value impossible */ - - SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ - NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ - SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ - SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | - SysTick_CTRL_TICKINT_Msk | - SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ - return (0UL); /* Function successful */ -} - -#endif - -/*@} end of CMSIS_Core_SysTickFunctions */ - - - -/* ##################################### Debug In/Output function ########################################### */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_core_DebugFunctions ITM Functions - \brief Functions that access the ITM debug interface. - @{ - */ - -extern volatile int32_t ITM_RxBuffer; /*!< External variable to receive characters. */ -#define ITM_RXBUFFER_EMPTY 0x5AA55AA5 /*!< Value identifying \ref ITM_RxBuffer is ready for next character. */ - - -/** \brief ITM Send Character - - The function transmits a character via the ITM channel 0, and - \li Just returns when no debugger is connected that has booked the output. - \li Is blocking when a debugger is connected, but the previous character sent has not been transmitted. - - \param [in] ch Character to transmit. - - \returns Character to transmit. - */ -__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch) -{ - if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) && /* ITM enabled */ - ((ITM->TER & 1UL ) != 0UL) ) /* ITM Port #0 enabled */ - { - while (ITM->PORT[0].u32 == 0UL) { __NOP(); } - ITM->PORT[0].u8 = (uint8_t)ch; - } - return (ch); -} - - -/** \brief ITM Receive Character - - The function inputs a character via the external variable \ref ITM_RxBuffer. - - \return Received character. - \return -1 No character pending. - */ -__STATIC_INLINE int32_t ITM_ReceiveChar (void) { - int32_t ch = -1; /* no character available */ - - if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY) { - ch = ITM_RxBuffer; - ITM_RxBuffer = ITM_RXBUFFER_EMPTY; /* ready for next character */ - } - - return (ch); -} - - -/** \brief ITM Check Character - - The function checks whether a character is pending for reading in the variable \ref ITM_RxBuffer. - - \return 0 No character available. - \return 1 Character available. - */ -__STATIC_INLINE int32_t ITM_CheckChar (void) { - - if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY) { - return (0); /* no character available */ - } else { - return (1); /* character available */ - } -} - -/*@} end of CMSIS_core_DebugFunctions */ - - - - -#ifdef __cplusplus -} -#endif - -#endif /* __CORE_SC300_H_DEPENDANT */ - -#endif /* __CMSIS_GENERIC */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/dac_dma.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/dac_dma.h deleted file mode 100644 index 71b7da95..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/dac_dma.h +++ /dev/null @@ -1,151 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2014, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ -/** - * \file - * - * \section Purpose - * - * Interface for configuration the Analog-to-Digital Converter (DACC) peripheral. - * - * \section Usage - * - * -# Configurate the pins for DACC - * -# Initialize the DACC with DACC_Initialize(). - * -# Select the active channel using DACC_EnableChannel() - * -# Start the conversion with DACC_StartConversion() - * -# Wait the end of the conversion by polling status with DACC_GetStatus() - * -# Finally, get the converted data using DACC_GetConvertedData() - * -*/ -#ifndef _DAC_DMA_ -#define _DAC_DMA_ - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ -#include "chip.h" - -#include -#include - - -#ifdef __cplusplus - extern "C" { -#endif - - -/*---------------------------------------------------------------------------- - * Types - *----------------------------------------------------------------------------*/ - -/** DAC transfer complete callback. */ -typedef void (*DacCallback)( uint8_t, void* ) ; - -/** \brief Dac Transfer Request prepared by the application upper layer. - * - * This structure is sent to the DAC_SendCommand function to start the transfer. - * At the end of the transfer, the callback is invoked by the interrupt handler. - */ -typedef struct -{ - /** Pointer to the Tx data. */ - uint8_t *pTxBuff; - /** Tx size in bytes. */ - uint16_t TxSize; - /** Tx loop back. */ - uint16_t loopback; - /** DACC channel*/ - uint8_t dacChannel; - /** Callback function invoked at the end of transfer. */ - DacCallback callback; - /** Callback arguments. */ - void *pArgument; -} DacCmd ; - - -/** Constant structure associated with DAC port. This structure prevents - client applications to have access in the same time. */ -typedef struct -{ - /** Pointer to DAC Hardware registers */ - Dacc* pDacHw ; - /** Current SpiCommand being processed */ - DacCmd *pCurrentCommand ; - /** Pointer to DMA driver */ - sXdmad* pXdmad ; - /** DACC Id as defined in the product datasheet */ - uint8_t dacId ; - /** Mutual exclusion semaphore. */ - volatile int8_t semaphore ; -} DacDma; - - -/*------------------------------------------------------------------------------ - * Definitions - *------------------------------------------------------------------------------*/ -#define DAC_OK 0 -#define DAC_ERROR 1 -#define DAC_ERROR_LOCK 2 - -#define DACC_CHANNEL_0 0 -#define DACC_CHANNEL_1 1 - -/*------------------------------------------------------------------------------ - * Exported functions - *------------------------------------------------------------------------------*/ -extern uint32_t Dac_ConfigureDma( DacDma *pDacd , - Dacc *pDacHw , - uint8_t DacId, - sXdmad *pXdmad ); -extern uint32_t Dac_SendData( DacDma *pDacd, DacCmd *pCommand); - - -/*------------------------------------------------------------------------------ - * Macros function of register access - *------------------------------------------------------------------------------*/ -#define DACC_SoftReset(pDACC) ((pDACC)->DACC_CR = DACC_CR_SWRST) -#define DACC_CfgModeReg(pDACC, mode) { (pDACC)->DACC_MR = (mode); } -#define DACC_GetModeReg(pDACC) ((pDACC)->DACC_MR) -#define DACC_CfgTrigger(pDACC, mode) { (pDACC)->DACC_TRIGR = (mode); } - -#define DACC_EnableChannel(pDACC, channel) {(pDACC)->DACC_CHER = (1 << (channel));} -#define DACC_DisableChannel(pDACC, channel) {(pDACC)->DACC_CHDR = (1 << (channel));} - -#define DACC_EnableIt(pDACC, mode) {(pDACC)->DACC_IER = (mode);} -#define DACC_DisableIt(pDACC, mode) {(pDACC)->DACC_IDR = (mode);} -#define DACC_GetStatus(pDACC) ((pDACC)->DACC_ISR) -#define DACC_GetChannelStatus(pDACC) ((pDACC)->DACC_CHSR) -#define DACC_GetInterruptMaskStatus(pDACC) ((pDACC)->DACC_IMR) - - -#ifdef __cplusplus -} -#endif - -#endif /* #ifndef _DAC_DMA_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/efc.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/efc.h deleted file mode 100644 index 254333b3..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/efc.h +++ /dev/null @@ -1,128 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2012, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * \section Purpose - * - * Interface for configuration the Enhanced Embedded Flash Controller (EEFC) - * peripheral. - * - * \section Usage - * - * -# Enable/disable %flash ready interrupt sources using EFC_EnableFrdyIt() - * and EFC_DisableFrdyIt(). - * -# Translates the given address into which EEFC, page and offset values - * for difference density %flash memory using EFC_TranslateAddress(). - * -# Computes the address of a %flash access given the EFC, page and offset - * for difference density %flash memory using EFC_ComputeAddress(). - * -# Start the executing command with EFC_PerformCommand() - * -# Retrieve the current status of the EFC using EFC_GetStatus(). - * -# Retrieve the result of the last executed command with EFC_GetResult(). - */ - -#ifndef _EEFC_ -#define _EEFC_ - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ -#include "chip.h" - -#include - -/*---------------------------------------------------------------------------- - * Definitions - *----------------------------------------------------------------------------*/ -/* TODO: Temporary definition for missing symbol in header file */ -#define IFLASH_SECTOR_SIZE 65536u - - -/* EFC command */ -#define EFC_FCMD_GETD 0x00 /* Get Flash Descriptor */ -#define EFC_FCMD_WP 0x01 /* Write page */ -#define EFC_FCMD_WPL 0x02 /* Write page and lock */ -#define EFC_FCMD_EWP 0x03 /* Erase page and write page */ -#define EFC_FCMD_EWPL 0x04 /* Erase page and write page then lock */ -#define EFC_FCMD_EA 0x05 /* Erase all */ -#define EFC_FCMD_EPA 0x07 /* Erase pages */ -#define EFC_FCMD_SLB 0x08 /* Set Lock Bit */ -#define EFC_FCMD_CLB 0x09 /* Clear Lock Bit */ -#define EFC_FCMD_GLB 0x0A /* Get Lock Bit */ -#define EFC_FCMD_SFB 0x0B /* Set GPNVM Bit */ -#define EFC_FCMD_CFB 0x0C /* Clear GPNVM Bit */ -#define EFC_FCMD_GFB 0x0D /* Get GPNVM Bit */ -#define EFC_FCMD_STUI 0x0E /* Start unique ID */ -#define EFC_FCMD_SPUI 0x0F /* Stop unique ID */ -#define EFC_FCMD_GCALB 0x10 /* Get CALIB Bit */ -#define EFC_FCMD_ES 0x11 /* Erase Sector */ -#define EFC_FCMD_WUS 0x12 /* Write User Signature */ -#define EFC_FCMD_EUS 0x13 /* Erase User Signature */ -#define EFC_FCMD_STUS 0x14 /* Start Read User Signature */ -#define EFC_FCMD_SPUS 0x15 /* Stop Read User Signature */ - -/* The IAP function entry address */ -#define CHIP_FLASH_IAP_ADDRESS (0x00800008) - -#ifdef __cplusplus - extern "C" { -#endif - -/*---------------------------------------------------------------------------- - * Exported functions - *----------------------------------------------------------------------------*/ - -extern void EFC_EnableFrdyIt( Efc* efc ) ; - -extern void EFC_DisableFrdyIt( Efc* efc ) ; - -extern void EFC_SetWaitState( Efc* efc, uint8_t cycles ) ; - -extern void EFC_TranslateAddress( Efc** pEfc, uint32_t dwAddress, - uint16_t *pwPage, uint16_t *pwOffset ) ; - -extern void EFC_ComputeAddress( Efc* efc, uint16_t wPage, uint16_t wOffset, - uint32_t *pdwAddress ) ; - -extern uint32_t EFC_PerformCommand( Efc* efc, uint32_t dwCommand, - uint32_t dwArgument, uint32_t dwUseIAP ) ; - -extern uint32_t EFC_GetStatus( Efc* efc ) ; - -extern uint32_t EFC_GetResult( Efc* efc ) ; - -extern void EFC_SetFlashAccessMode(Efc* efc, uint32_t dwMode) ; - -#ifdef __cplusplus -} -#endif - -#endif /* #ifndef _EEFC_ */ - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/exceptions.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/exceptions.h deleted file mode 100644 index 8683678f..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/exceptions.h +++ /dev/null @@ -1,52 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * Interface for default exception handlers. - */ - -#ifndef _EXCEPTIONS_ -#define _EXCEPTIONS_ - -/*---------------------------------------------------------------------------- - * Types - *----------------------------------------------------------------------------*/ - -/* Function prototype for exception table items (interrupt handler). */ -typedef void( *IntFunc )( void ) ; - -/*---------------------------------------------------------------------------- - * Exported functions - *----------------------------------------------------------------------------*/ - -/* Default empty handler */ -extern void IrqHandlerNotUsed( void ) ; - -#endif /* _EXCEPTIONS_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/flashd.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/flashd.h deleted file mode 100644 index 800d0660..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/flashd.h +++ /dev/null @@ -1,91 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2012, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- -*/ - -/** - * \file - * - * The flash driver provides the unified interface for flash program operations. - * - */ - -#ifndef _FLASHD_ -#define _FLASHD_ - -#include - -#ifdef __cplusplus - extern "C" { -#endif - -#define GPNVBit_SecurityBit 0 -#define GPNVBit_BootMode 1 -#define GPNVBit_TCMBit1 6 -#define GPNVBit_TCMBit2 7 - -/*---------------------------------------------------------------------------- - * Exported functions - *----------------------------------------------------------------------------*/ - -extern void FLASHD_Initialize( uint32_t dwMCk, uint32_t dwUseIAP ) ; - -extern uint32_t FLASHD_Erase( uint32_t dwAddress ) ; - -extern uint32_t FLASHD_EraseSector( uint32_t dwAddress ) ; - -extern uint32_t FLASHD_ErasePages( uint32_t dwAddress, uint32_t dwPageNum ) ; - -extern uint32_t FLASHD_Write( uint32_t dwAddress, const void *pvBuffer, - uint32_t dwSize ) ; - -extern uint32_t FLASHD_Lock( uint32_t dwStart, uint32_t dwEnd, - uint32_t *pdwActualStart, uint32_t *pdwActualEnd ) ; - -extern uint32_t FLASHD_Unlock( uint32_t dwStart, uint32_t dwEnd, - uint32_t *pdwActualStart, uint32_t *pdwActualEnd ) ; - -extern uint32_t FLASHD_IsLocked( uint32_t dwStart, uint32_t dwEnd ) ; - -extern uint32_t FLASHD_SetGPNVM( uint8_t gpnvm ) ; - -extern uint32_t FLASHD_ClearGPNVM( uint8_t gpnvm ) ; - -extern uint32_t FLASHD_IsGPNVMSet( uint8_t gpnvm ) ; - -#define FLASHD_IsSecurityBitSet() FLASHD_IsGPNVMSet( 0 ) - -#define FLASHD_SetSecurityBit() FLASHD_SetGPNVM( 0 ) - -extern uint32_t FLASHD_ReadUniqueID( uint32_t* pdwUniqueID ) ; - -#ifdef __cplusplus -} -#endif - -#endif /* #ifndef _FLASHD_ */ - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/gmac.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/gmac.h deleted file mode 100644 index c2f79620..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/gmac.h +++ /dev/null @@ -1,338 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2012, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** \file */ - -/** \addtogroup gmac_module - * @{ - * Provides the interface to configure and use the GMAC peripheral. - * - * \section gmac_usage Usage - * - Configure Gmac::GMAC_NCFG with GMAC_Configure(), some of related controls - * are also available, such as: - * - GMAC_SetSpeed(): Setup GMAC working clock. - * - GMAC_FullDuplexEnable(): Working in full duplex or not. - * - GMAC_CpyAllEnable(): Copying all valid frames (\ref GMAC_NCFG_CAF). - * - ... - * - Setup Gmac::GMAC_NCR with GMAC_NetworkControl(), more related controls - * can modify with: - * - GMAC_ReceiveEnable(): Enable/Disable Rx. - * - GMAC_TransmitEnable(): Enable/Disable Tx. - * - GMAC_BroadcastDisable(): Enable/Disable broadcast receiving. - * - ... - * - Manage GMAC interrupts with GMAC_EnableIt(), GMAC_DisableIt(), - * GMAC_GetItMask() and GMAC_GetItStatus(). - * - Manage GMAC Tx/Rx status with GMAC_GetTxStatus(), GMAC_GetRxStatus() - * GMAC_ClearTxStatus() and GMAC_ClearRxStatus(). - * - Manage GMAC Queue with GMAC_SetTxQueue(), GMAC_GetTxQueue(), - * GMAC_SetRxQueue() and GMAC_GetRxQueue(), the queue descriptor can define - * by \ref sGmacRxDescriptor and \ref sGmacTxDescriptor. - * - Manage PHY through GMAC is performed by - * - GMAC_ManagementEnable(): Enable/Disable PHY management. - * - GMAC_PHYMaintain(): Execute PHY management commands. - * - GMAC_PHYData(): Return PHY management data. - * - GMAC_IsIdle(): Check if PHY is idle. - * - Setup GMAC parameters with following functions: - * - GMAC_SetHash(): Set Hash value. - * - GMAC_SetAddress(): Set MAC address. - * - Enable/Disable GMAC transceiver clock via GMAC_TransceiverClockEnable() - * - Switch GMAC MII/RMII mode through GMAC_RMIIEnable() - * - * For more accurate information, please look at the GMAC section of the - * Datasheet. - * - * \sa \ref gmacd_module - * - * Related files:\n - * gmac.c\n - * gmac.h.\n - * - * \defgroup gmac_defines GMAC Defines - * \defgroup gmac_structs GMAC Data Structs - * \defgroup gmac_functions GMAC Functions - */ -/**@}*/ - -#ifndef _GMAC_H -#define _GMAC_H - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ -#include "chip.h" - -#include - -#ifdef __cplusplus - extern "C" { -#endif - -/*---------------------------------------------------------------------------- - * Defines - *----------------------------------------------------------------------------*/ -/** \addtogroup gmac_defines - @{*/ - -#define NUM_GMAC_QUEUES 3 -/// Board GMAC base address - -#define GMAC_DUPLEX_HALF 0 -#define GMAC_DUPLEX_FULL 1 - -// -#define GMAC_SPEED_10M 0 -#define GMAC_SPEED_100M 1 -#define GMAC_SPEED_1000M 2 - -/*------------------------------------------------------------------------------ - Definitions ------------------------------------------------------------------------------- -*/ -/// The buffer addresses written into the descriptors must be aligned so the -/// last few bits are zero. These bits have special meaning for the GMAC -/// peripheral and cannot be used as part of the address. -#define GMAC_ADDRESS_MASK ((unsigned int)0xFFFFFFFC) -#define GMAC_LENGTH_FRAME ((unsigned int)0x3FFF) /// Length of frame mask - -// receive buffer descriptor bits -#define GMAC_RX_OWNERSHIP_BIT (1u << 0) -#define GMAC_RX_WRAP_BIT (1u << 1) -#define GMAC_RX_SOF_BIT (1u << 14) -#define GMAC_RX_EOF_BIT (1u << 15) - -// Transmit buffer descriptor bits -#define GMAC_TX_LAST_BUFFER_BIT (1u << 15) -#define GMAC_TX_WRAP_BIT (1u << 30) -#define GMAC_TX_USED_BIT (1u << 31) -#define GMAC_TX_RLE_BIT (1u << 29) /// Retry Limit Exceeded -#define GMAC_TX_UND_BIT (1u << 28) /// Tx Buffer Under-run -#define GMAC_TX_ERR_BIT (1u << 27) /// Exhausted in mid-frame -#define GMAC_TX_ERR_BITS \ - (GMAC_TX_RLE_BIT | GMAC_TX_UND_BIT | GMAC_TX_ERR_BIT) - -// Interrupt bits -#define GMAC_INT_RX_BITS \ - (GMAC_IER_RCOMP | GMAC_IER_RXUBR | GMAC_IER_ROVR) -#define GMAC_INT_TX_ERR_BITS \ - (GMAC_IER_TUR | GMAC_IER_RLEX | GMAC_IER_TFC | GMAC_IER_HRESP) -#define GMAC_INT_TX_BITS \ - (GMAC_INT_TX_ERR_BITS | GMAC_IER_TCOMP) -// Interrupt Status bits -#define GMAC_INT_RX_STATUS_BITS \ - (GMAC_ISR_RCOMP | GMAC_ISR_RXUBR | GMAC_ISR_ROVR) -#define GMAC_INT_TX_STATUS_ERR_BITS \ - (GMAC_ISR_TUR | GMAC_ISR_RLEX | GMAC_ISR_TFC | GMAC_ISR_HRESP) -/*---------------------------------------------------------------------------- - * Types - *----------------------------------------------------------------------------*/ -/** \addtogroup gmac_structs - @{*/ - -/* This is the list of GMAC queue */ -typedef enum { - GMAC_QUE_0 = 0, - GMAC_QUE_1 = 1, - GMAC_QUE_2 = 2 -}gmacQueList_t; - -/** Receive buffer descriptor struct */ -typedef struct _GmacRxDescriptor { - union _GmacRxAddr { - uint32_t val; - struct _GmacRxAddrBM { - uint32_t bOwnership:1, /**< User clear, GMAC set this to one once - it has successfully written a frame to - memory */ - bWrap:1, /**< Marks last descriptor in receive buffer */ - addrDW:30; /**< Address in number of DW */ - } bm; - } addr; /**< Address, Wrap & Ownership */ - union _GmacRxStatus { - uint32_t val; - struct _GmacRxStatusBM { - uint32_t len:12, /** Length of frame including FCS */ - offset:2, /** Receive buffer offset, - bits 13:12 of frame length for jumbo - frame */ - bSof:1, /** Start of frame */ - bEof:1, /** End of frame */ - bCFI:1, /** Concatenation Format Indicator */ - vlanPriority:3, /** VLAN priority (if VLAN detected) */ - bPriorityDetected:1, /** Priority tag detected */ - bVlanDetected:1, /**< VLAN tag detected */ - bTypeIDMatch:1, /**< Type ID match */ - bAddr4Match:1, /**< Address register 4 match */ - bAddr3Match:1, /**< Address register 3 match */ - bAddr2Match:1, /**< Address register 2 match */ - bAddr1Match:1, /**< Address register 1 match */ - reserved:1, - bExtAddrMatch:1, /**< External address match */ - bUniHashMatch:1, /**< Unicast hash match */ - bMultiHashMatch:1, /**< Multicast hash match */ - bBroadcastDetected:1; /**< Global all ones broadcast - address detected */ - } bm; - } status; -} sGmacRxDescriptor ; /* GCC */ - -/** Transmit buffer descriptor struct */ -typedef struct _GmacTxDescriptor { - uint32_t addr; - union _GmacTxStatus { - uint32_t val; - struct _GmacTxStatusBM { - uint32_t len:11, /**< Length of buffer */ - reserved:4, - bLastBuffer:1, /**< Last buffer (in the current frame) */ - bNoCRC:1, /**< No CRC */ - reserved1:10, - bExhausted:1, /**< Buffer exhausted in mid frame */ - bUnderrun:1, /**< Transmit under run */ - bError:1, /**< Retry limit exceeded, error detected */ - bWrap:1, /**< Marks last descriptor in TD list */ - bUsed:1; /**< User clear, GMAC sets this once a frame - has been successfully transmitted */ - } bm; - } status; -} sGmacTxDescriptor; /* GCC */ - -/** @}*/ - -//----------------------------------------------------------------------------- -// PHY Exported functions -//----------------------------------------------------------------------------- -extern uint8_t GMAC_IsIdle(Gmac *pGmac); -extern void GMAC_PHYMaintain(Gmac *pGmac, - uint8_t bPhyAddr, - uint8_t bRegAddr, - uint8_t bRW, - uint16_t wData); -extern uint16_t GMAC_PHYData(Gmac *pGmac); -extern void GMAC_ClearStatistics(Gmac *pGmac); -extern void GMAC_IncreaseStatistics(Gmac *pGmac); -extern void GMAC_StatisticsWriteEnable(Gmac *pGmac, uint8_t bEnaDis); -extern uint8_t GMAC_SetMdcClock(Gmac *pGmac, uint32_t mck ); -extern void GMAC_EnableMdio(Gmac *pGmac ); -extern void GMAC_DisableMdio(Gmac *pGmac ); -extern void GMAC_EnableMII(Gmac *pGmac ); -extern void GMAC_EnableRMII(Gmac *pGmac ); -extern void GMAC_EnableGMII( Gmac *pGmac ); -extern void GMAC_SetLinkSpeed(Gmac *pGmac, uint8_t speed, uint8_t fullduplex); -extern void GMAC_EnableIt(Gmac *pGmac, uint32_t dwSources, gmacQueList_t queueIdx); -extern void GMAC_EnableAllQueueIt(Gmac *pGmac, uint32_t dwSources); -extern void GMAC_DisableIt(Gmac *pGmac, uint32_t dwSources, gmacQueList_t queueIdx); -extern void GMAC_DisableAllQueueIt(Gmac *pGmac, uint32_t dwSources); -extern uint32_t GMAC_GetItStatus(Gmac *pGmac, gmacQueList_t queueIdx); -extern uint32_t GMAC_GetItMask(Gmac *pGmac, gmacQueList_t queueIdx); -extern uint32_t GMAC_GetTxStatus(Gmac *pGmac); -extern void GMAC_ClearTxStatus(Gmac *pGmac, uint32_t dwStatus); -extern uint32_t GMAC_GetRxStatus(Gmac *pGmac); -extern void GMAC_ClearRxStatus(Gmac *pGmac, uint32_t dwStatus); -extern void GMAC_ReceiveEnable(Gmac* pGmac, uint8_t bEnaDis); -extern void GMAC_TransmitEnable(Gmac *pGmac, uint8_t bEnaDis); -extern uint32_t GMAC_SetLocalLoopBack(Gmac *pGmac); -extern void GMAC_SetRxQueue(Gmac *pGmac, uint32_t dwAddr, gmacQueList_t queueIdx); -extern uint32_t GMAC_GetRxQueue(Gmac *pGmac, gmacQueList_t queueIdx); -extern void GMAC_SetTxQueue(Gmac *pGmac, uint32_t dwAddr, gmacQueList_t queueIdx); -extern uint32_t GMAC_GetTxQueue(Gmac *pGmac, gmacQueList_t queueIdx); -extern void GMAC_NetworkControl(Gmac *pGmac, uint32_t bmNCR); -extern uint32_t GMAC_GetNetworkControl(Gmac *pGmac); -extern void GMAC_SetAddress(Gmac *pGmac, uint8_t bIndex, uint8_t *pMacAddr); -extern void GMAC_SetAddress32(Gmac *pGmac, uint8_t bIndex, uint32_t dwMacT, uint32_t dwMacB); -extern void GMAC_SetAddress64(Gmac *pGmac, uint8_t bIndex, uint64_t ddwMac); -extern void GMAC_Configure(Gmac *pGmac, uint32_t dwCfg); -extern void GMAC_SetDMAConfig(Gmac *pGmac, uint32_t dwDmaCfg, gmacQueList_t queueIdx); -extern uint32_t GMAC_GetDMAConfig(Gmac *pGmac, gmacQueList_t queueIdx); -extern uint32_t GMAC_GetConfigure(Gmac *pGmac); -extern void GMAC_TransmissionStart(Gmac *pGmac); -extern void GMAC_TransmissionHalt(Gmac *pGmac); -extern void GMAC_EnableRGMII(Gmac *pGmac, uint32_t duplex, uint32_t speed); - -void GMAC_ClearScreener1Reg (Gmac* pGmac, gmacQueList_t queueIdx); - -void GMAC_WriteScreener1Reg(Gmac* pGmac, gmacQueList_t queueIdx, uint32_t regVal); - -void GMAC_ClearScreener2Reg (Gmac* pGmac, gmacQueList_t queueIdx); - -void GMAC_WriteScreener2Reg (Gmac* pGmac, gmacQueList_t queueIdx, uint32_t regVal); - -void GMAC_WriteEthTypeReg (Gmac* pGmac, gmacQueList_t queueIdx, uint16_t etherType); - -void GMAC_WriteCompareReg(Gmac* pGmac, gmacQueList_t queueIdx, uint32_t c0Reg, uint16_t c1Reg); - -void GMAC_EnableCbsQueA(Gmac *pGmac); - -void GMAC_DisableCbsQueA(Gmac *pGmac); - -void GMAC_EnableCbsQueB(Gmac *pGmac); - -void GMAC_DisableCbsQueB(Gmac *pGmac); - -void GMAC_ConfigIdleSlopeA(Gmac *pGmac, uint32_t idleSlopeA); - -void GMAC_ConfigIdleSlopeB(Gmac *pGmac, uint32_t idleSlopeB); - -void GMAC_SetTsuTmrIncReg( Gmac *pGmac, uint32_t nanoSec); - -uint16_t GMAC_GetPtpEvtMsgRxdMsbSec( Gmac *pGmac ); - -uint32_t GMAC_GetPtpEvtMsgRxdLsbSec( Gmac *pGmac ); - -uint32_t GMAC_GetPtpEvtMsgRxdNanoSec( Gmac *pGmac ); - -void GMAC_SetTsuCompare(Gmac *pGmac, uint32_t seconds47, uint32_t seconds31, uint32_t nanosec ); - -void GMAC_SetTsuCompareNanoSec(Gmac *pGmac, uint32_t nanosec); - -void GMAC_SetTsuCompareSec31(Gmac *pGmac, uint32_t seconds31); - -void GMAC_SetTsuCompareSec47(Gmac *pGmac, uint16_t seconds47); - -uint32_t GMAC_GetRxEvtFrameSec(Gmac *pGmac); - -uint32_t GMAC_GetRxEvtFrameNsec(Gmac *pGmac); - -uint32_t GMAC_GetRxPeerEvtFrameSec(Gmac *pGmac); - -uint32_t GMAC_GetRxPeerEvtFrameNsec(Gmac *pGmac); - -uint32_t GMAC_GetTxEvtFrameSec(Gmac *pGmac); - -uint32_t GMAC_GetTxEvtFrameNsec(Gmac *pGmac); - -uint32_t GMAC_GetTxPeerEvtFrameSec(Gmac *pGmac); - -uint32_t GMAC_GetTxPeerEvtFrameNsec(Gmac *pGmac); - -#ifdef __cplusplus -} -#endif - -#endif // #ifndef GMAC_H - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/gmacd.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/gmacd.h deleted file mode 100644 index 69f913c2..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/gmacd.h +++ /dev/null @@ -1,284 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2012, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** \file */ - -/** \addtogroup gmacd_module - * @{ - * Implement GMAC data transfer and PHY management functions. - * - * \section Usage - * -# Implement GMAC interrupt handler, which must invoke GMACD_Handler() - * to handle GMAC interrupt events. - * -# Implement sGmacd instance in application. - * -# Initialize the instance with GMACD_Init() and GMACD_InitTransfer(), - * so that GMAC data can be transmitted/received. - * -# Some management callbacks can be set by GMACD_SetRxCallback() - * and GMACD_SetTxWakeupCallback(). - * -# Send ethernet packets using GMACD_Send(), GMACD_TxLoad() is used - * to check the free space in TX queue. - * -# Check and obtain received ethernet packets via GMACD_Poll(). - * - * \sa \ref gmacb_module, \ref gmac_module - * - * Related files:\n - * \ref gmacd.c\n - * \ref gmacd.h.\n - * - * \defgroup gmacd_defines GMAC Driver Defines - * \defgroup gmacd_types GMAC Driver Types - * \defgroup gmacd_functions GMAC Driver Functions - */ -/**@}*/ - -#ifndef _GMACD_H_ -#define _GMACD_H_ - -/*--------------------------------------------------------------------------- - * Headers - *---------------------------------------------------------------------------*/ - -#include "chip.h" - - -/*--------------------------------------------------------------------------- - * Definitions - *---------------------------------------------------------------------------*/ -/** \addtogroup gmacd_defines - @{*/ - - -/** \addtogroup gmacd_rc GMACD Return Codes - @{*/ -#define GMACD_OK 0 /**< Operation OK */ -#define GMACD_TX_BUSY 1 /**< TX in progress */ -#define GMACD_RX_NULL 1 /**< No data received */ -/** Buffer size not enough */ -#define GMACD_SIZE_TOO_SMALL 2 -/** Parameter error, TX packet invalid or RX size too small */ -#define GMACD_PARAM 3 -/** Transfer is not initialized */ -#define GMACD_NOT_INITIALIZED 4 -/** @}*/ - -/** @}*/ - -/* Should be a power of 2. - - Buffer Length to store the timestamps of 1588 event messages -*/ -#define EFRS_BUFFER_LEN (1u) - -/*--------------------------------------------------------------------------- -* Types -*---------------------------------------------------------------------------*/ -/** \addtogroup gmacd_types - @{*/ - -typedef enum ptpMsgType_t -{ - SYNC_MSG_TYPE = 0, - DELAY_REQ_MSG_TYPE = 1, - PDELAY_REQ_TYPE = 2, - PDELAY_RESP_TYPE = 3, - FOLLOW_UP_MSG_TYPE = 8, - DELAY_RESP_MSG_TYPE = 9 -}ptpMsgType; - - - -/** RX callback */ -typedef void (*fGmacdTransferCallback)(uint32_t status); -/** Wakeup callback */ -typedef void (*fGmacdWakeupCallback)(void); -/** Tx PTP message callback */ -typedef void (*fGmacdTxPtpEvtCallBack) (ptpMsgType msg, uint32_t sec, \ - uint32_t nanosec, uint16_t seqId); - -/** - * GMAC scatter-gather entry. - */ -typedef struct _GmacSG { - uint32_t size; - void *pBuffer; -} sGmacSG; - -/** - * GMAC scatter-gather list. - */ -typedef struct _GmacSGList { - uint32_t len; - sGmacSG *sg; -} sGmacSGList; - -/** - * GMAC Queue driver. - */ -typedef struct _GmacQueueDriver { - uint8_t *pTxBuffer; - /** Pointer to allocated RX buffer */ - uint8_t *pRxBuffer; - - /** Pointer to Rx TDs (must be 8-byte aligned) */ - sGmacRxDescriptor *pRxD; - /** Pointer to Tx TDs (must be 8-byte aligned) */ - sGmacTxDescriptor *pTxD; - - /** Optional callback to be invoked once a frame has been received */ - fGmacdTransferCallback fRxCb; - /** Optional callback to be invoked once several TD have been released */ - fGmacdWakeupCallback fWakupCb; - /** Optional callback list to be invoked once TD has been processed */ - fGmacdTransferCallback *fTxCbList; - - /** Optional callback to be invoked on transmit of PTP Event messages */ - fGmacdTxPtpEvtCallBack fTxPtpEvtCb; - - /** RX TD list size */ - uint16_t wRxListSize; - /** RX index for current processing TD */ - uint16_t wRxI; - - /** TX TD list size */ - uint16_t wTxListSize; - /** Circular buffer head pointer by upper layer (buffer to be sent) */ - uint16_t wTxHead; - /** Circular buffer tail pointer incremented by handlers (buffer sent) */ - uint16_t wTxTail; - - /** Number of free TD before wakeup callback is invoked */ - uint8_t bWakeupThreshold; - - /** RX buffer size */ - uint16_t wTxBufferSize; - uint16_t wRxBufferSize; - -} sGmacQd; - -/** - * GMAC driver struct. - */ -typedef struct _GmacDriver { - - /** Pointer to HW register base */ - Gmac *pHw; - /** HW ID */ - uint8_t bId; - /** Base Queue list params **/ - sGmacQd queueList[NUM_GMAC_QUEUES]; -} sGmacd; - -/** - * GMAC driver init struct. - */ -typedef struct _GmacInit { - uint32_t bIsGem:1; - uint32_t reserved:31; - - uint8_t bDmaBurstLength; - - /** RX descriptor and data buffers */ - uint8_t *pRxBuffer; - /** RX data buffers: should be wRxBufferSize * wRxSize byte long in a DMA - capable memory region */ - sGmacRxDescriptor *pRxD; - /** RX buffer descriptors: should have wRxSize entries in a DMA - capable memory region */ - uint16_t wRxBufferSize; /** size of a single RX data buffer */ - uint16_t wRxSize; /** number of RX descriptor and data buffers */ - - /** TX descriptor and data buffers */ - /** TX data buffers: should be wTxBufferSize * wTxSize byte long - in a DMA capable memory region */ - uint8_t *pTxBuffer; - /** TX buffer descriptors: should have wTxSize entries - in a DMA capable non-cached memory region */ - sGmacTxDescriptor *pTxD; - /** size of a single TX data buffer */ - uint16_t wTxBufferSize; - /** number of TX descriptor and data buffers */ - uint16_t wTxSize; - - fGmacdTransferCallback *pTxCb; /** should have wTxSize entries */ -} sGmacInit; -/** @}*/ - -/** \addtogroup gmacd_functions - @{*/ - -/*--------------------------------------------------------------------------- - * GMAC Exported functions - *---------------------------------------------------------------------------*/ - -extern void GMACD_Handler(sGmacd *pGmacd , gmacQueList_t queIdx); - -extern void GMACD_Init(sGmacd *pGmacd, - Gmac *pHw, - uint8_t bID, - uint8_t enableCAF, - uint8_t enableNBC ); - -extern uint8_t GMACD_InitTransfer(sGmacd *pGmacd, - const sGmacInit *pInit, gmacQueList_t queIdx); - -extern void GMACD_Reset(sGmacd *pGmacd); - -extern uint8_t GMACD_SendSG(sGmacd *pGmacd, - const sGmacSGList *sgl, - fGmacdTransferCallback fTxCb, - gmacQueList_t queIdx); - -extern uint8_t GMACD_Send(sGmacd *pGmacd, - void *pBuffer, - uint32_t size, - fGmacdTransferCallback fTxCb, - gmacQueList_t queIdx ); - -extern uint32_t GMACD_TxLoad(sGmacd *pGmacd, gmacQueList_t queIdx); - -extern uint8_t GMACD_Poll(sGmacd * pGmacd, - uint8_t *pFrame, - uint32_t frameSize, - uint32_t *pRcvSize, - gmacQueList_t queIdx); - -extern void GMACD_SetRxCallback(sGmacd * pGmacd, fGmacdTransferCallback - fRxCb, gmacQueList_t queIdx); - -extern uint8_t GMACD_SetTxWakeupCallback(sGmacd * pGmacd, - fGmacdWakeupCallback fWakeup, - uint8_t bThreshold, - gmacQueList_t queIdx); - -extern void GMACD_TxPtpEvtMsgCBRegister (sGmacd * pGmacd, - fGmacdTxPtpEvtCallBack pTxPtpEvtCb, - gmacQueList_t queIdx); - -/** @}*/ - -#endif // #ifndef _GMACD_H_ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/hsmci.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/hsmci.h deleted file mode 100644 index 3fa9427c..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/hsmci.h +++ /dev/null @@ -1,154 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2013, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** \file */ - -/** \addtogroup hsmci_module Working with HSMCI - * \ingroup mcid_module - * - * \section Purpose - * - * The HSMCI driver provides the interface to configure and use the HSMCI - * peripheral. - * - * \section Usage - * - * -# HSMCI_Enable(), MCI_Disable(): Enable/Disable HSMCI interface. - * -# HSMCI_Reset(): Reset HSMCI interface. - * -# HSMCI_Select(): HSMCI slot and buswidth selection - * (\ref Hsmci::HSMCI_SDCR). - * -# HSMCI_ConfigureMode(): Configure the MCI CLKDIV in the _MR register - * (\ref Hsmci::HSMCI_MR). - * -# HSMCI_EnableIt(), HSMCI_DisableIt(), HSMCI_GetItMask(), HSMCI_GetStatus() - * HSMCI Interrupt control (\ref Hsmci::HSMCI_IER, \ref Hsmci::HSMCI_IDR, - * \ref Hsmci::HSMCI_IMR, \ref Hsmci::HSMCI_SR). - * -# HSMCI_ConfigureTransfer(): Setup block length and count for MCI transfer - * (\ref Hsmci::HSMCI_BLKR). - * -# HSMCI_SendCmd(): Send SD/MMC command with argument - * (\ref Hsmci::HSMCI_ARGR, \ref Hsmci::HSMCI_CMDR). - * -# HSMCI_GetResponse(): Get SD/MMC response after command finished - * (\ref Hsmci::HSMCI_RSPR). - * -# HSMCI_ConfigureDma(): Configure MCI DMA transfer - * (\ref Hsmci::HSMCI_DMA). - * -# HSMCI_Configure(): Configure the HSMCI interface (\ref Hsmci::HSMCI_CFG). - * -# HSMCI_HsEnable(), HSMCI_IsHsEnabled(): High Speed control. - * - * For more accurate information, please look at the HSMCI section of the - * Datasheet. - * - * \sa \ref mcid_module - * - * Related files :\n - * \ref hsmci.h\n - * \ref hsmci.c.\n - */ - -#ifndef HSMCID_H -#define HSMCID_H -/** \addtogroup hsmci_module - *@{ - */ - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ - -#include "chip.h" - -#include - -#ifdef __cplusplus - extern "C" { -#endif -/*---------------------------------------------------------------------------- - * Exported functions - *----------------------------------------------------------------------------*/ -/** \addtogroup hsmci_functions HSMCI Functions - * @{ - */ - -extern void HSMCI_Enable(Hsmci* pRMci); -extern void HSMCI_Disable(Hsmci* pRMci); -extern void HSMCI_Reset(Hsmci* pRMci, uint8_t bBackup); - -extern void HSMCI_Select(Hsmci * pRMci,uint8_t bSlot,uint8_t bBusWidth); -extern void HSMCI_SetSlot(Hsmci * pRMci,uint8_t bSlot); -extern void HSMCI_SetBusWidth(Hsmci * pRMci,uint8_t bBusWidth); -extern uint8_t HSMCI_GetBusWidth(Hsmci * pRMci); - -extern void HSMCI_ConfigureMode(Hsmci *pRMci, uint32_t dwMode); -extern uint32_t HSMCI_GetMode(Hsmci *pRMci); -extern void HSMCI_ProofEnable(Hsmci *pRMci, uint8_t bRdProof, uint8_t bWrProof); -extern void HSMCI_PadvCtl(Hsmci *pRMci, uint8_t bPadv); -extern void HSMCI_FByteEnable(Hsmci *pRMci, uint8_t bFByteEn); -extern uint8_t HSMCI_IsFByteEnabled(Hsmci * pRMci); -extern void HSMCI_DivCtrl(Hsmci *pRMci, uint32_t bClkDiv, uint8_t bPwsDiv); - -extern void HSMCI_EnableIt(Hsmci *pRMci, uint32_t dwSources); -extern void HSMCI_DisableIt(Hsmci *pRMci, uint32_t dwSources); -extern uint32_t HSMCI_GetItMask(Hsmci *pRMci); - -extern void HSMCI_ConfigureTransfer(Hsmci * pRMci,uint16_t wBlkLen,uint16_t wCnt); -extern void HSMCI_SetBlockLen(Hsmci * pRMci,uint16_t wBlkSize); -extern void HSMCI_SetBlockCount(Hsmci * pRMci,uint16_t wBlkCnt); - -extern void HSMCI_ConfigureCompletionTO(Hsmci *pRMci, uint32_t dwConfigure); -extern void HSMCI_ConfigureDataTO(Hsmci *pRMci, uint32_t dwConfigure); - -extern void HSMCI_SendCmd(Hsmci * pRMci,uint32_t dwCmd,uint32_t dwArg); -extern uint32_t HSMCI_GetResponse(Hsmci *pRMci); -extern uint32_t HSMCI_Read(Hsmci *pRMci); -extern void HSMCI_ReadFifo(Hsmci *pRMci, uint8_t *pdwData, uint32_t dwSize); -extern void HSMCI_Write(Hsmci *pRMci, uint32_t dwData); -extern void HSMCI_WriteFifo(Hsmci *pRMci, uint8_t *pdwData, uint32_t dwSize); - -extern uint32_t HSMCI_GetStatus(Hsmci *pRMci); - -extern void HSMCI_ConfigureDma(Hsmci *pRMci, uint32_t dwConfigure); -extern void HSMCI_EnableDma(Hsmci * pRMci,uint8_t bEnable); - -extern void HSMCI_Configure(Hsmci *pRMci, uint32_t dwConfigure); -extern void HSMCI_HsEnable(Hsmci *pRMci, uint8_t bHsEnable); -extern uint8_t HSMCI_IsHsEnabled(Hsmci *pRMci); - -extern void HSMCI_BusWidthCtl(Hsmci *pRMci, uint8_t bBusWidth); -extern void HSMCI_SlotCtl(Hsmci *pRMci, uint8_t bSlot); -extern uint8_t HSMCI_GetSlot(Hsmci *pRMci); - -extern void HSMCI_ConfigureWP(Hsmci *pRMci, uint32_t dwConfigure); -extern uint32_t HSMCI_GetWPStatus(Hsmci *pRMci); - -#ifdef __cplusplus -} -#endif - -/** @}*/ -/**@}*/ -#endif //#ifndef HSMCID_H - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/icm.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/icm.h deleted file mode 100644 index fd53e4e7..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/icm.h +++ /dev/null @@ -1,113 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2013, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -#ifndef _ICM_ -#define _ICM_ - -/*------------------------------------------------------------------------------ - * Headers - *------------------------------------------------------------------------------*/ - -#include "chip.h" - - -/*------------------------------------------------------------------------------*/ -/* Definition */ -/*------------------------------------------------------------------------------*/ -#define ICM_RCFG_CDWBN (0x1u << 0) -/**< \brief (ICM_RCFG) Compare Digest or Write Back Digest */ -#define ICM_RCFG_WRAP (0x1u << 1) -/**< \brief (ICM_RCFG) Wrap Command */ -#define ICM_RCFG_EOM (0x1u << 2) -/**< \brief (ICM_RCFG) End Of Monitoring */ -#define ICM_RCFG_RHIEN (0x1u << 4) -/**< \brief (ICM_RCFG) Region Hash Completed interrupt enable */ -#define ICM_RCFG_DMIEN (0x1u << 5) -/**< \brief (ICM_RCFG) Digest Mismatch interrupt enable */ -#define ICM_RCFG_BEIEN (0x1u << 6) -/**< \brief (ICM_RCFG) Bus error interrupt enable */ -#define ICM_RCFG_WCIEN (0x1u << 7) -/**< \brief (ICM_RCFG) Warp condition interrupt enable */ -#define ICM_RCFG_ECIEN (0x1u << 8) -/**< \brief (ICM_RCFG) End bit condition interrupt enable */ -#define ICM_RCFG_SUIEN (0x1u << 9) -/**< \brief (ICM_RCFG) Monitoring Status Updated Condition Interrupt Enable */ -#define ICM_RCFG_PROCDLY (0x1u << 10) -/**< \brief (ICM_RCFG) Processing Delay*/ -#define ICM_RCFG_UALGO_Pos 12 -#define ICM_RCFG_UALGO_Msk (0x7u << ICM_RCFG_UALGO_Pos) -/**< \brief (ICM_RCFG) User SHA Algorithm */ -#define ICM_RCFG_ALGO_SHA1 (0x0u << 12) -/**< \brief (ICM_RCFG) SHA1 algorithm processed */ -#define ICM_RCFG_ALGO_SHA256 (0x1u << 12) -/**< \brief (ICM_RCFG) SHA256 algorithm processed */ -#define ICM_RCFG_ALGO_SHA224 (0x4u << 12) -/**< \brief (ICM_RCFG) SHA224 algorithm processed */ -#define ICM_RCFG_MRPROT_Pos 24 -#define ICM_RCFG_MRPROT_Msk (0x3fu << ICM_RCFG_MRPROT_Pos) -/**< \brief (ICM_RCFG) Memory Region AHB Protection */ -#define ICM_RCFG_MRPROT(value) \ - ((ICM_RCFG_MRPROT_Msk & ((value) << ICM_RCFG_MRPROT_Pos))) - -/*----------------------------------------------------------------------------*/ -/* Type */ -/*----------------------------------------------------------------------------*/ - -/** \brief Structure ICM region descriptor area. */ -typedef struct _LinkedListDescriporIcmRegion -{ - /** the first byte address of the Region. */ - uint32_t icm_raddr; - /** Configuration Structure Member. */ - uint32_t icm_rcfg; - /** Control Structure Member. */ - uint32_t icm_rctrl; - /** Next Address Structure Member. */ - uint32_t icm_rnext; -}LinkedListDescriporIcmRegion; - -/*----------------------------------------------------------------------------*/ -/* Exported functions */ -/*----------------------------------------------------------------------------*/ -extern void ICM_Enable(void); -extern void ICM_Disable(void); -extern void ICM_SoftReset(void); -extern void ICM_ReComputeHash(uint8_t region); -extern void ICM_EnableMonitor(uint8_t region); -extern void ICM_DisableMonitor(uint8_t region); -extern void ICM_Configure(uint32_t mode); -extern void ICM_EnableIt(uint32_t sources); -extern void ICM_DisableIt(uint32_t sources); -extern uint32_t ICM_GetIntStatus(void); -extern uint32_t ICM_GetStatus(void); -extern uint32_t ICM_GetUStatus(void); -extern void ICM_SetDescStartAddress(uint32_t addr); -extern void ICM_SetHashStartAddress(uint32_t addr); -extern void ICM_SetInitHashValue(uint32_t val); -#endif /* #ifndef _ICM_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/isi.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/isi.h deleted file mode 100644 index 05018be0..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/isi.h +++ /dev/null @@ -1,204 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2013, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** \file */ - -/** \addtogroup isi_module - * @{ - * \section gmac_usage Usage - * - ISI_Init: initialize ISI with default parameters - * - ISI_EnableInterrupt: enable one or more interrupts - * - ISI_DisableInterrupt: disable one or more interrupts - * - ISI_Enable: enable isi module - * - ISI_Disable: disable isi module - * - ISI_CodecPathFull: enable codec path - * - ISI_SetFrame: set frame rate - * - ISI_BytesForOnePixel: return number of byte for one pixel - * - ISI_StatusRegister: return ISI status register - * - ISI_Reset: make a software reset - */ -/**@}*/ - -#ifndef ISI_H -#define ISI_H - - - -/*---------------------------------------------------------------------------- - * Definition - *----------------------------------------------------------------------------*/ -#define YUV_INPUT 0 -#define RGB_INPUT 1 -#define GRAYSCALE_INPUT 2 - -/*---------------------------------------------------------------------------- - * Types - *----------------------------------------------------------------------------*/ - -/** ISI descriptors */ -typedef struct -{ - /** Current LCD index, used with AT91C_ISI_MAX_PREV_BUFFER */ - uint32_t CurrentLcdIndex; - /** set if Fifo Codec Empty is present */ - volatile uint32_t DisplayCodec; - /** upgrade for each Fifo Codec Overflow (statistics use) */ - uint32_t nb_codec_ovf; - /** upgrade for each Fifo Preview Overflow (statistics use) */ - uint32_t nb_prev_ovf; -}ISI_Descriptors; - -/** Frame Buffer Descriptors */ -typedef struct -{ - /** Address of the Current FrameBuffer */ - uint32_t Current; - /** Address of the Control */ - uint32_t Control; - /** Address of the Next FrameBuffer */ - uint32_t Next; -}ISI_FrameBufferDescriptors; - - -/** ISI Matrix Color Space Conversion YCrCb to RGB */ -typedef struct -{ - /** Color Space Conversion Matrix Coefficient C0*/ - uint8_t C0; - /** Color Space Conversion Matrix Coefficient C1 */ - uint8_t C1; - /** Color Space Conversion Matrix Coefficient C2 */ - uint8_t C2; - /** Color Space Conversion Matrix Coefficient C3 */ - uint8_t C3; - /** Color Space Conversion Red Chrominance Default Offset */ - uint8_t Croff; - /** Color Space Conversion Blue Chrominance Default Offset */ - uint8_t Cboff; - /** Color Space Conversion Luminance Default Offset */ - uint8_t Yoff; - /** Color Space Conversion Matrix Coefficient C4 */ - uint16_t C4; -}ISI_Y2R; - -/** ISI Matrix Color Space Conversion RGB to YCrCb */ -typedef struct -{ - /** Color Space Conversion Matrix Coefficient C0*/ - uint8_t C0; - /** Color Space Conversion Matrix Coefficient C1 */ - uint8_t C1; - /** Color Space Conversion Matrix Coefficient C2 */ - uint8_t C2; - /** Color Space Conversion Red Component Offset */ - uint8_t Roff; - /** Color Space Conversion Matrix Coefficient C3*/ - uint8_t C3; - /** Color Space Conversion Matrix Coefficient C4 */ - uint8_t C4; - /** Color Space Conversion Matrix Coefficient C5 */ - uint8_t C5; - /** Color Space Conversion Green Component Offset */ - uint8_t Goff; - /** Color Space Conversion Matrix Coefficient C6*/ - uint8_t C6; - /** Color Space Conversion Matrix Coefficient C7 */ - uint8_t C7; - /** Color Space Conversion Matrix Coefficient C8 */ - uint8_t C8; - /** Color Space Conversion Blue Component Offset */ - uint8_t Boff; -}ISI_R2Y; - -/*---------------------------------------------------------------------------- - * Exported functions - *----------------------------------------------------------------------------*/ -extern void ISI_Enable(void); - -extern void ISI_Disable(void); - -void ISI_DmaChannelEnable(uint32_t channel); - -void ISI_DmaChannelDisable(uint32_t channel); - -extern void ISI_EnableInterrupt(uint32_t flag); - -extern void ISI_DisableInterrupt(uint32_t flag); - -extern void ISI_CodecPathFull(void); - -extern void ISI_SetFrameRate(uint32_t frame); - -extern uint8_t ISI_BytesForOnePixel(uint8_t bmpRgb); - -extern void ISI_Reset(void); - -extern void ISI_Init(pIsi_Video pVideo); - -extern uint32_t ISI_StatusRegister(void); - -extern void ISI_SetBlank( - uint8_t hBlank, - uint8_t vBlank); - -extern void ISI_SetSensorSize( - uint32_t hSize, - uint32_t vSize); - -extern void ISI_RgbPixelMapping(uint32_t wRgbPixelMapping); - -extern void ISI_RgbSwapMode(uint32_t swapMode); - -extern void ISI_YCrCbFormat(uint32_t wYuvSwapMode); - -extern void ISI_setGrayScaleMode(uint32_t wPixelFormat); - -extern void ISI_setInputStream(uint32_t wStreamMode); - -extern void ISI_setPreviewSize( - uint32_t hSize, - uint32_t vSize); - -extern void ISI_calcScalerFactor( void ); - -extern void ISI_setDmaInPreviewPath( - uint32_t baseFrameBufDesc, - uint32_t dmaCtrl, - uint32_t frameBufferStartAddr); - -extern void ISI_setDmaInCodecPath( - uint32_t baseFrameBufDesc, - uint32_t dmaCtrl, - uint32_t frameBufferStartAddr); - -extern void ISI_SetMatrix4Yuv2Rgb (ISI_Y2R* yuv2rgb); -extern void ISI_SetMatrix4Rgb2Yuv (ISI_R2Y* rgb2yuv); - -#endif //#ifndef ISI_H - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/iso7816_4.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/iso7816_4.h deleted file mode 100644 index 4a7b9a78..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/iso7816_4.h +++ /dev/null @@ -1,110 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -//------------------------------------------------------------------------------ -/** \page - * - * \section Purpose - * - * Definition of methods for ISO7816 driver. - * - * \section Usage - * - * -# ISO7816_Init - * -# ISO7816_IccPowerOff - * -# ISO7816_XfrBlockTPDU_T0 - * -# ISO7816_Escape - * -# ISO7816_RestartClock - * -# ISO7816_StopClock - * -# ISO7816_toAPDU - * -# ISO7816_Datablock_ATR - * -# ISO7816_SetDataRateandClockFrequency - * -# ISO7816_StatusReset - * -# ISO7816_cold_reset - * -# ISO7816_warm_reset - * -# ISO7816_Decode_ATR - *----------------------------------------------------------------------------*/ - -#ifndef ISO7816_4_H -#define ISO7816_4_H - -#include "chip.h" - -/*------------------------------------------------------------------------------ - * Constants Definition - *----------------------------------------------------------------------------*/ - -/** Size max of Answer To Reset */ -#define ATR_SIZE_MAX 55 - -/** NULL byte to restart byte procedure */ -#define ISO_NULL_VAL 0x60 - -/*------------------------------------------------------------------------------ - * Exported functions - *----------------------------------------------------------------------------*/ - -extern void ISO7816_Init( - Usart *pUsart, - uint32_t usartId , - const Pin pPinIso7816RstMC ); - -extern void ISO7816_IccPowerOff( void ); - -extern uint16_t ISO7816_XfrBlockTPDU_T0( - const uint8_t *pAPDU, - uint8_t *pMessage, - uint16_t wLength ); - -extern void ISO7816_Escape( void ); - -extern void ISO7816_RestartClock( void); - -extern void ISO7816_StopClock( void ); - -extern void ISO7816_toAPDU( void ); - -extern void ISO7816_Datablock_ATR( - uint8_t* pAtr, - uint8_t* pLength ); - -extern void ISO7816_SetDataRateandClockFrequency( - uint32_t dwClockFrequency, - uint32_t dwDataRate ); - -extern uint8_t ISO7816_StatusReset( void ); - -extern void ISO7816_cold_reset( void ); - -extern void ISO7816_warm_reset( void ); - -extern void ISO7816_Decode_ATR( uint8_t* pAtr ); - -#endif /* ISO7816_4_H */ - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/mcan.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/mcan.h deleted file mode 100644 index c28a93d0..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/mcan.h +++ /dev/null @@ -1,344 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * \section Purpose - * - * Interface for configuring and using Timer Counter (TC) peripherals. - * - * \section Usage - * -# Optionally, use TC_FindMckDivisor() to let the program find the best - * TCCLKS field value automatically. - * -# Configure a Timer Counter in the desired mode using TC_Configure(). - * -# Start or stop the timer clock using TC_Start() and TC_Stop(). - */ - -#ifndef _MCAN_ -#define _MCAN_ - -/*------------------------------------------------------------------------------ - * Headers - *------------------------------------------------------------------------------*/ - -#include "chip.h" - -#include - -/*------------------------------------------------------------------------------ - * Global functions - *------------------------------------------------------------------------------*/ - -#ifdef __cplusplus - extern "C" { -#endif - -typedef enum -{ - CAN_STD_ID = 0, - CAN_EXT_ID = 1 -} MCan_IdType; - -typedef enum -{ - CAN_DLC_0 = 0, - CAN_DLC_1 = 1, - CAN_DLC_2 = 2, - CAN_DLC_3 = 3, - CAN_DLC_4 = 4, - CAN_DLC_5 = 5, - CAN_DLC_6 = 6, - CAN_DLC_7 = 7, - CAN_DLC_8 = 8, - CAN_DLC_12 = 9, - CAN_DLC_16 = 10, - CAN_DLC_20 = 11, - CAN_DLC_24 = 12, - CAN_DLC_32 = 13, - CAN_DLC_48 = 14, - CAN_DLC_64 = 15 -} MCan_DlcType; - -typedef enum -{ - CAN_FIFO_0 = 0, - CAN_FIFO_1 = 1 -} MCan_FifoType; - -typedef enum -{ - CAN_INTR_LINE_0 = 0, - CAN_INTR_LINE_1 = 1 -} MCan_IntrLineType; - -typedef struct MailboxInfoTag -{ - uint32_t id; - uint32_t length; - uint32_t timestamp; -} MailboxInfoType; - - -typedef struct MailBox8Tag -{ - MailboxInfoType info; - uint8_t data[8]; -} Mailbox8Type; - -typedef struct MailBox12Tag -{ - MailboxInfoType info; - uint8_t data[12]; -} Mailbox12Type; - -typedef struct MailBox16Tag -{ - MailboxInfoType info; - uint8_t data[16]; -} Mailbox16Type; - -typedef struct MailBox20Tag -{ - MailboxInfoType info; - uint8_t data[20]; -} Mailbox20Type; - -typedef struct MailBox24Tag -{ - MailboxInfoType info; - uint8_t data[24]; -} Mailbox24Type; - -typedef struct MailBox32Tag -{ - MailboxInfoType info; - uint8_t data[32]; -} Mailbox32ype; - -typedef struct MailBox48Tag -{ - MailboxInfoType info; - uint8_t data[48]; -} Mailbox48Type; - -typedef struct MailBox64Tag -{ - MailboxInfoType info; - uint8_t data[64]; -} Mailbox64Type; - - - -typedef struct MCan_MsgRamPntrsTag -{ - uint32_t * pStdFilts; - uint32_t * pExtFilts; - uint32_t * pRxFifo0; - uint32_t * pRxFifo1; - uint32_t * pRxDedBuf; - uint32_t * pTxEvtFifo; - uint32_t * pTxDedBuf; - uint32_t * pTxFifoQ; -} MCan_MsgRamPntrs; - -typedef struct MCan_ConfigTag -{ - Mcan * pMCan; - uint32_t bitTiming; - uint32_t fastBitTiming; - uint32_t nmbrStdFilts; - uint32_t nmbrExtFilts; - uint32_t nmbrFifo0Elmts; - uint32_t nmbrFifo1Elmts; - uint32_t nmbrRxDedBufElmts; - uint32_t nmbrTxEvtFifoElmts; - uint32_t nmbrTxDedBufElmts; - uint32_t nmbrTxFifoQElmts; - uint32_t rxFifo0ElmtSize; - uint32_t rxFifo1ElmtSize; - uint32_t rxBufElmtSize; - // Element sizes and data sizes (encoded element size) - uint32_t txBufElmtSize; - // Element size and data size (encoded element size) - MCan_MsgRamPntrs msgRam; -} MCan_ConfigType; - -extern const MCan_ConfigType mcan0Config; -extern const MCan_ConfigType mcan1Config; - -__STATIC_INLINE uint32_t MCAN_IsTxComplete( - const MCan_ConfigType * mcanConfig ) -{ - Mcan * mcan = mcanConfig->pMCan; - return ( mcan->MCAN_IR & MCAN_IR_TC ); -} - -__STATIC_INLINE void MCAN_ClearTxComplete( - const MCan_ConfigType * mcanConfig ) -{ - Mcan * mcan = mcanConfig->pMCan; - mcan->MCAN_IR = MCAN_IR_TC; -} - -__STATIC_INLINE uint32_t MCAN_IsMessageStoredToRxDedBuffer( - const MCan_ConfigType * mcanConfig ) -{ - Mcan * mcan = mcanConfig->pMCan; - - return ( mcan->MCAN_IR & MCAN_IR_DRX ); -} - -__STATIC_INLINE void MCAN_ClearMessageStoredToRxBuffer( - const MCan_ConfigType * mcanConfig ) -{ - Mcan * mcan = mcanConfig->pMCan; - mcan->MCAN_IR = MCAN_IR_DRX; -} - -__STATIC_INLINE uint32_t MCAN_IsMessageStoredToRxFifo0( - const MCan_ConfigType * mcanConfig ) -{ - Mcan * mcan = mcanConfig->pMCan; - return ( mcan->MCAN_IR & MCAN_IR_RF0N ); -} - -__STATIC_INLINE void MCAN_ClearMessageStoredToRxFifo0( - const MCan_ConfigType * mcanConfig ) -{ - Mcan * mcan = mcanConfig->pMCan; - mcan->MCAN_IR = MCAN_IR_RF0N; -} - -__STATIC_INLINE uint32_t MCAN_IsMessageStoredToRxFifo1( - const MCan_ConfigType * mcanConfig ) -{ - Mcan * mcan = mcanConfig->pMCan; - return ( mcan->MCAN_IR & MCAN_IR_RF1N ); -} - -__STATIC_INLINE void MCAN_ClearMessageStoredToRxFifo1( - const MCan_ConfigType * mcanConfig ) -{ - Mcan * mcan = mcanConfig->pMCan; - mcan->MCAN_IR = MCAN_IR_RF1N; -} - -void MCAN_Init( - const MCan_ConfigType * mcanConfig ); - -void MCAN_InitFdEnable( - const MCan_ConfigType * mcanConfig ); - -void MCAN_InitFdBitRateSwitchEnable( - const MCan_ConfigType * mcanConfig ); - -void MCAN_InitTxQueue( - const MCan_ConfigType * mcanConfig ); - -void MCAN_InitLoopback( - const MCan_ConfigType * mcanConfig ); - -void MCAN_Enable( - const MCan_ConfigType * mcanConfig ); - -void MCAN_RequestIso11898_1( - const MCan_ConfigType * mcanConfig ); - -void MCAN_RequestFd( - const MCan_ConfigType * mcanConfig ); - -void MCAN_RequestFdBitRateSwitch( - const MCan_ConfigType * mcanConfig ); - -void MCAN_LoopbackOn( - const MCan_ConfigType * mcanConfig ); - -void MCAN_LoopbackOff( - const MCan_ConfigType * mcanConfig ); - -void MCAN_IEnableMessageStoredToRxDedBuffer( - const MCan_ConfigType * mcanConfig, - MCan_IntrLineType line ); - -uint8_t * MCAN_ConfigTxDedBuffer( - const MCan_ConfigType * mcanConfig, - uint8_t buffer, - uint32_t id, - MCan_IdType idType, - MCan_DlcType dlc ); - -void MCAN_SendTxDedBuffer( - const MCan_ConfigType * mcanConfig, - uint8_t buffer ); - -uint32_t MCAN_AddToTxFifoQ( - const MCan_ConfigType * mcanConfig, - uint32_t id, MCan_IdType idType, - MCan_DlcType dlc, uint8_t * data ); - -uint8_t MCAN_IsBufferTxd( - const MCan_ConfigType * mcanConfig, - uint8_t buffer ); - -void MCAN_ConfigRxBufferFilter( - const MCan_ConfigType * mcanConfig, - uint32_t buffer, - uint32_t filter, - uint32_t id, - MCan_IdType idType); - -void MCAN_ConfigRxClassicFilter( - const MCan_ConfigType * mcanConfig, - MCan_FifoType fifo, - uint8_t filter, - uint32_t id, - MCan_IdType idType, - uint32_t mask ); - -uint8_t MCAN_IsNewDataInRxDedBuffer( - const MCan_ConfigType * mcanConfig, - uint8_t buffer ); - -void MCAN_GetRxDedBuffer( - const MCan_ConfigType * mcanConfig, - uint8_t buffer, - Mailbox64Type * pRxMailbox ); - -uint32_t MCAN_GetRxFifoBuffer( - const MCan_ConfigType * mcanConfig, - MCan_FifoType fifo, - Mailbox64Type * pRxMailbox ); - -#ifdef __cplusplus -} -#endif - -#endif /* #ifndef _MCAN_ */ - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/mcid.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/mcid.h deleted file mode 100644 index 5b4a118f..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/mcid.h +++ /dev/null @@ -1,172 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2013, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - - -/** \file */ - -/** - * \ingroup sdmmc_hal - * \addtogroup mcid_module MCI Driver (HAL for SD/MMC Lib) - * - * \section Purpose - * - * This driver implements SD(IO)/MMC command operations and MCI configuration - * routines to perform SD(IO)/MMC access. It's used for upper layer - * (\ref libsdmmc_module "SD/MMC driver") to perform SD/MMC operations. - * - * \section Usage - * - * -# MCID_Init(): Initializes a MCI driver instance and the underlying - * peripheral. - * -# MCID_SendCmd(): Starts a MCI transfer which described by - * \ref sSdmmcCommand. - * -# MCID_CancelCmd(): Cancel a pending command. - * -# MCID_IsCmdCompleted(): Check if MCI transfer is finished. - * -# MCID_Handler(): Interrupt handler which is called by ISR handler. - * -# MCID_IOCtrl(): IO control function to report HW attributes to upper - * layer driver and modify HW settings (such as clock - * frequency, High-speed support, etc. See - * \ref sdmmc_ioctrls). - * - * \sa \ref dmad_module "DMA Driver", \ref hsmci_module "HSMCI", - * \ref libsdmmc_module "SD/MMC Library" - * - * Related files:\n - * \ref mcid.h\n - * \ref mcid_dma.c.\n - */ - -#ifndef MCID_H -#define MCID_H -/** \addtogroup mcid_module - *@{ - */ - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ - -#include "chip.h" - -#include -#include - -/** \addtogroup mcid_defines MCI Driver Defines - * @{*/ - -/*---------------------------------------------------------------------------- - * Constants - *----------------------------------------------------------------------------*/ - -/** MCI States */ -#define MCID_IDLE 0 /**< Idle */ -#define MCID_LOCKED 1 /**< Locked for specific slot */ -#define MCID_CMD 2 /**< Processing the command */ -#define MCID_ERROR 3 /**< Command error */ - -/** MCI Initialize clock 400K Hz */ -#define MCI_INITIAL_SPEED 400000 - -/** @}*/ - -/*---------------------------------------------------------------------------- - * Types - *----------------------------------------------------------------------------*/ -/** \addtogroup mcid_structs MCI Driver Data Structs - * @{ - */ -#ifdef __cplusplus - extern "C" { -#endif - -/** - * \brief MCI Driver - */ -typedef struct _Mcid -{ - /** Pointer to a MCI peripheral. */ - Hsmci *pMciHw; - /** Pointer to a DMA driver */ - sXdmad *pXdmad; - /** Pointer to currently executing command. */ - void *pCmd; - /** MCK source, Hz */ - uint32_t dwMck; - /** DMA transfer channel */ - uint32_t dwDmaCh; - /** DMA transferred data index (bytes) */ - uint32_t dwXfrNdx; - /** DMA transfer size (bytes) */ - uint32_t dwXSize; - /** MCI peripheral identifier. */ - uint8_t bID; - /** Polling mode */ - uint8_t bPolling; - /** Reserved */ - uint8_t reserved; - /** state. */ - volatile uint8_t bState; -} sMcid; - -/** @}*/ -/*---------------------------------------------------------------------------- - * Exported functions - *----------------------------------------------------------------------------*/ -/** \addtogroup mcid_functions MCI Driver Functions - @{*/ -extern void MCID_Init(sMcid * pMcid, - Hsmci * pMci, uint8_t bID, uint32_t dwMck, - sXdmad * pXdmad, - uint8_t bPolling); - -extern void MCID_Reset(sMcid * pMcid); - -extern void MCID_SetSlot(Hsmci *pMci, uint8_t slot); - -extern uint32_t MCID_Lock(sMcid * pMcid, uint8_t bSlot); - -extern uint32_t MCID_Release(sMcid * pMcid); - -extern void MCID_Handler(sMcid * pMcid); - -extern uint32_t MCID_SendCmd(sMcid * pMcid, void * pCmd); - -extern uint32_t MCID_CancelCmd(sMcid * pMcid); - -extern uint32_t MCID_IsCmdCompleted(sMcid * pMcid); - -extern uint32_t MCID_IOCtrl(sMcid * pMcid,uint32_t bCtl,uint32_t param); - -#ifdef __cplusplus -} -#endif -/** @}*/ -/**@}*/ -#endif //#ifndef HSMCID_H - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/mediaLB.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/mediaLB.h deleted file mode 100644 index b922a861..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/mediaLB.h +++ /dev/null @@ -1,45 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2014, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -#ifndef _MEDILB_H_ -#define _MEDILB_H_ - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ - - -/*---------------------------------------------------------------------------- - * Exported functions - *----------------------------------------------------------------------------*/ - - - -#endif /* #ifndef _MEDILB_H_ */ - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/mpu.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/mpu.h deleted file mode 100644 index 753b3117..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/mpu.h +++ /dev/null @@ -1,172 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2012, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -#ifndef _MPU_H_ -#define _MPU_H_ - -/*---------------------------------------------------------------------------- - * Definitions - *----------------------------------------------------------------------------*/ -#define ARM_MODE_USR 0x10 - -#define PRIVILEGE_MODE 0 -#define USER_MODE 1 - -#define MPU_DEFAULT_ITCM_REGION ( 1 ) -#define MPU_DEFAULT_IFLASH_REGION ( 2 ) -#define MPU_DEFAULT_DTCM_REGION ( 3 ) -#define MPU_DEFAULT_SRAM_REGION_1 ( 4 ) -#define MPU_DEFAULT_SRAM_REGION_2 ( 5 ) -#define MPU_PERIPHERALS_REGION ( 6 ) -#define MPU_EXT_EBI_REGION ( 7 ) -#define MPU_DEFAULT_SDRAM_REGION ( 8 ) -#define MPU_QSPIMEM_REGION ( 9 ) -#define MPU_USBHSRAM_REGION ( 10 ) -#if defined MPU_HAS_NOCACHE_REGION -#define MPU_NOCACHE_SRAM_REGION ( 11 ) -#endif - -#define MPU_REGION_VALID ( 0x10 ) -#define MPU_REGION_ENABLE ( 0x01 ) -#define MPU_REGION_DISABLE ( 0x0 ) - -#define MPU_ENABLE ( 0x1 << MPU_CTRL_ENABLE_Pos) -#define MPU_HFNMIENA ( 0x1 << MPU_CTRL_HFNMIENA_Pos ) -#define MPU_PRIVDEFENA ( 0x1 << MPU_CTRL_PRIVDEFENA_Pos ) - - -#define MPU_REGION_BUFFERABLE ( 0x01 << MPU_RASR_B_Pos ) -#define MPU_REGION_CACHEABLE ( 0x01 << MPU_RASR_C_Pos ) -#define MPU_REGION_SHAREABLE ( 0x01 << MPU_RASR_S_Pos ) - -#define MPU_REGION_EXECUTE_NEVER ( 0x01 << MPU_RASR_XN_Pos ) - -#define MPU_AP_NO_ACCESS ( 0x00 << MPU_RASR_AP_Pos ) -#define MPU_AP_PRIVILEGED_READ_WRITE ( 0x01 << MPU_RASR_AP_Pos ) -#define MPU_AP_UNPRIVILEGED_READONLY ( 0x02 << MPU_RASR_AP_Pos ) -#define MPU_AP_FULL_ACCESS ( 0x03 << MPU_RASR_AP_Pos ) -#define MPU_AP_RES ( 0x04 << MPU_RASR_AP_Pos ) -#define MPU_AP_PRIVILEGED_READONLY ( 0x05 << MPU_RASR_AP_Pos ) -#define MPU_AP_READONLY ( 0x06 << MPU_RASR_AP_Pos ) -#define MPU_AP_READONLY2 ( 0x07 << MPU_RASR_AP_Pos ) - -#define MPU_TEX_B000 ( 0x01 << MPU_RASR_TEX_Pos ) -#define MPU_TEX_B001 ( 0x01 << MPU_RASR_TEX_Pos ) -#define MPU_TEX_B010 ( 0x01 << MPU_RASR_TEX_Pos ) -#define MPU_TEX_B011 ( 0x01 << MPU_RASR_TEX_Pos ) -#define MPU_TEX_B100 ( 0x01 << MPU_RASR_TEX_Pos ) -#define MPU_TEX_B101 ( 0x01 << MPU_RASR_TEX_Pos ) -#define MPU_TEX_B110 ( 0x01 << MPU_RASR_TEX_Pos ) -#define MPU_TEX_B111 ( 0x01 << MPU_RASR_TEX_Pos ) - -/* Default memory map - Address range Memory region Memory type Shareability Cache policy - 0x00000000- 0x1FFFFFFF Code Normal Non-shareable WT - 0x20000000- 0x3FFFFFFF SRAM Normal Non-shareable WBWA - 0x40000000- 0x5FFFFFFF Peripheral Device Non-shareable - - 0x60000000- 0x7FFFFFFF RAM Normal Non-shareable WBWA - 0x80000000- 0x9FFFFFFF RAM Normal Non-shareable WT - 0xA0000000- 0xBFFFFFFF Device Device Shareable - 0xC0000000- 0xDFFFFFFF Device Device Non Shareable - 0xE0000000- 0xFFFFFFFF System - - - */ - -/********* IFLASH memory macros *********************/ -#define ITCM_START_ADDRESS 0x00000000UL -#define ITCM_END_ADDRESS 0x003FFFFFUL -#define IFLASH_START_ADDRESS 0x00400000UL -#define IFLASH_END_ADDRESS 0x005FFFFFUL - - -#define IFLASH_PRIVILEGE_START_ADDRESS (IFLASH_START_ADDRESS) -#define IFLASH_PRIVILEGE_END_ADDRESS (IFLASH_START_ADDRESS + 0xFFF) - -#define IFLASH_UNPRIVILEGE_START_ADDRESS (IFLASH_PRIVILEGE_END_ADDRESS + 1) -#define IFLASH_UNPRIVILEGE_END_ADDRESS (IFLASH_END_ADDRESS) - -/**************** DTCM *******************************/ -#define DTCM_START_ADDRESS 0x20000000UL -#define DTCM_END_ADDRESS 0x203FFFFFUL - - -/******* SRAM memory macros ***************************/ - -#define SRAM_START_ADDRESS 0x20400000UL -#define SRAM_END_ADDRESS 0x2045FFFFUL - -#if defined MPU_HAS_NOCACHE_REGION -#define NOCACHE_SRAM_REGION_SIZE 0x1000 -#endif - -/* Regions should be a 2^(N+1) where 4 < N < 31 */ -#define SRAM_FIRST_START_ADDRESS (SRAM_START_ADDRESS) -#define SRAM_FIRST_END_ADDRESS (SRAM_FIRST_START_ADDRESS + 0x3FFFF) // (2^18) 256 KB - -#if defined MPU_HAS_NOCACHE_REGION -#define SRAM_SECOND_START_ADDRESS (SRAM_FIRST_END_ADDRESS+1) -#define SRAM_SECOND_END_ADDRESS (SRAM_END_ADDRESS - NOCACHE_SRAM_REGION_SIZE ) // (2^17) 128 - 0x1000 KB -#define SRAM_NOCACHE_START_ADDRESS (SRAM_SECOND_END_ADDRESS + 1) -#define SRAM_NOCACHE_END_ADDRESS (SRAM_END_ADDRESS ) -#else -#define SRAM_SECOND_START_ADDRESS (SRAM_FIRST_END_ADDRESS + 1) -#define SRAM_SECOND_END_ADDRESS (SRAM_END_ADDRESS) // (2^17) 128 KB -#endif -/************** Peripherals memory region macros ********/ -#define PERIPHERALS_START_ADDRESS 0x40000000UL -#define PERIPHERALS_END_ADDRESS 0x5FFFFFFFUL - -/******* Ext EBI memory macros ***************************/ -#define EXT_EBI_START_ADDRESS 0x60000000UL -#define EXT_EBI_END_ADDRESS 0x6FFFFFFFUL - -/******* Ext-SRAM memory macros ***************************/ -#define SDRAM_START_ADDRESS 0x70000000UL -#define SDRAM_END_ADDRESS 0x7FFFFFFFUL - -/******* QSPI macros ***************************/ -#define QSPI_START_ADDRESS 0x80000000UL -#define QSPI_END_ADDRESS 0x9FFFFFFFUL - -/************** USBHS_RAM region macros ******************/ -#define USBHSRAM_START_ADDRESS 0xA0100000UL -#define USBHSRAM_END_ADDRESS 0xA01FFFFFUL - -/*---------------------------------------------------------------------------- - * Export functions - *----------------------------------------------------------------------------*/ -void MPU_Enable( uint32_t dwMPUEnable ); -void MPU_SetRegion( uint32_t dwRegionBaseAddr, uint32_t dwRegionAttr ); -void MPU_SetRegionNum( uint32_t dwRegionNum ); -void MPU_DisableRegion( void ); -uint32_t MPU_CalMPURegionSize( uint32_t dwActualSizeInBytes ); -void MPU_UpdateRegions( uint32_t dwRegionNum, uint32_t dwRegionBaseAddr, - uint32_t dwRegionAttr); - -#endif /* #ifndef _MMU_ */ - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/pio.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/pio.h deleted file mode 100644 index e9a4bb82..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/pio.h +++ /dev/null @@ -1,218 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2012, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * \section Purpose - * - * This file provides a basic API for PIO configuration and usage of - * user-controlled pins. Please refer to the board.h file for a list of - * available pin definitions. - * - * \section Usage - * - * -# Define a constant pin description array such as the following one, using - * the existing definitions provided by the board.h file if possible: - * \code - * const Pin pPins[] = {PIN_USART0_TXD, PIN_USART0_RXD}; - * \endcode - * Alternatively, it is possible to add new pins by provided the full Pin - * structure: - * \code - * // Pin instance to configure PA10 & PA11 as inputs with the internal - * // pull-up enabled. - * const Pin pPins = { - * (1 << 10) | (1 << 11), - * REG_PIOA, - * ID_PIOA, - * PIO_INPUT, - * PIO_PULLUP - * }; - * \endcode - * -# Configure a pin array by calling PIO_Configure() with a pointer to the - * array and its size (which is computed using the PIO_LISTSIZE macro). - * -# Change and get the value of a user-controlled pin using the PIO_Set, - * PIO_Clear and PIO_Get methods. - * -# Get the level being currently output by a user-controlled pin configured - * as an output using PIO_GetOutputDataStatus(). - */ - -#ifndef _PIO_ -#define _PIO_ - -/* - * Headers - */ - -#include "chip.h" - -#include - -/* - * Global Definitions - */ - -/** The pin is controlled by the associated signal of peripheral A. */ -#define PIO_PERIPH_A 0 -/** The pin is controlled by the associated signal of peripheral B. */ -#define PIO_PERIPH_B 1 -/** The pin is controlled by the associated signal of peripheral C. */ -#define PIO_PERIPH_C 2 -/** The pin is controlled by the associated signal of peripheral D. */ -#define PIO_PERIPH_D 3 -/** The pin is an input. */ -#define PIO_INPUT 4 -/** The pin is an output and has a default level of 0. */ -#define PIO_OUTPUT_0 5 -/** The pin is an output and has a default level of 1. */ -#define PIO_OUTPUT_1 6 - -/** Default pin configuration (no attribute). */ -#define PIO_DEFAULT (0 << 0) -/** The internal pin pull-up is active. */ -#define PIO_PULLUP (1 << 0) -/** The internal glitch filter is active. */ -#define PIO_DEGLITCH (1 << 1) -/** The pin is open-drain. */ -#define PIO_OPENDRAIN (1 << 2) - -/** The internal debouncing filter is active. */ -#define PIO_DEBOUNCE (1 << 3) - -/** Enable additional interrupt modes. */ -#define PIO_IT_AIME (1 << 4) - -/** Interrupt High Level/Rising Edge detection is active. */ -#define PIO_IT_RE_OR_HL (1 << 5) -/** Interrupt Edge detection is active. */ -#define PIO_IT_EDGE (1 << 6) - -/** Low level interrupt is active */ -#define PIO_IT_LOW_LEVEL (0 | 0 | PIO_IT_AIME) -/** High level interrupt is active */ -#define PIO_IT_HIGH_LEVEL (PIO_IT_RE_OR_HL | 0 | PIO_IT_AIME) -/** Falling edge interrupt is active */ -#define PIO_IT_FALL_EDGE (0 | PIO_IT_EDGE | PIO_IT_AIME) -/** Rising edge interrupt is active */ -#define PIO_IT_RISE_EDGE (PIO_IT_RE_OR_HL | PIO_IT_EDGE | PIO_IT_AIME) -/** The WP is enable */ -#define PIO_WPMR_WPEN_EN ( 0x01 << 0 ) -/** The WP is disable */ -#define PIO_WPMR_WPEN_DIS ( 0x00 << 0 ) -/** Valid WP key */ -#define PIO_WPMR_WPKEY_VALID ( 0x50494F << 8 ) -#ifdef __cplusplus - extern "C" { -#endif - -/* - * Global Macros - */ - -/** - * Calculates the size of an array of Pin instances. The array must be defined - * locally (i.e. not a pointer), otherwise the computation will not be correct. - * \param pPins Local array of Pin instances. - * \return Number of elements in array. - */ -#define PIO_LISTSIZE(pPins) (sizeof(pPins) / sizeof(Pin)) - -/* - * Global Types - */ - - -/* - * Describes the type and attribute of one PIO pin or a group of similar pins. - * The #type# field can have the following values: - * - PIO_PERIPH_A - * - PIO_PERIPH_B - * - PIO_OUTPUT_0 - * - PIO_OUTPUT_1 - * - PIO_INPUT - * - * The #attribute# field is a bitmask that can either be set to PIO_DEFAULt, - * or combine (using bitwise OR '|') any number of the following constants: - * - PIO_PULLUP - * - PIO_DEGLITCH - * - PIO_DEBOUNCE - * - PIO_OPENDRAIN - * - PIO_IT_LOW_LEVEL - * - PIO_IT_HIGH_LEVEL - * - PIO_IT_FALL_EDGE - * - PIO_IT_RISE_EDGE - */ -typedef struct _Pin -{ - /* Bitmask indicating which pin(s) to configure. */ - uint32_t mask; - /* Pointer to the PIO controller which has the pin(s). */ - Pio *pio; - /* Peripheral ID of the PIO controller which has the pin(s). */ - uint8_t id; - /* Pin type. */ - uint8_t type; - /* Pin attribute. */ - uint8_t attribute; -} Pin ; - -/* - * Global Access Macros - */ - -/* - * Global Functions - */ - -extern uint8_t PIO_Configure( const Pin *list, uint32_t size ) ; - -extern void PIO_Set( const Pin *pin ) ; - -extern void PIO_Clear( const Pin *pin ) ; - -extern uint8_t PIO_Get( const Pin *pin ) ; - -extern uint8_t PIO_GetOutputDataStatus( const Pin *pin ) ; - -extern void PIO_SetDebounceFilter( const Pin *pin, uint32_t cuttoff ); - -extern void PIO_EnableWriteProtect( const Pin *pin ); - -extern void PIO_DisableWriteProtect( const Pin *pin ); - -extern void PIO_SetPinType( Pin * pin, uint8_t pinType); - -extern uint32_t PIO_GetWriteProtectViolationInfo( const Pin * pin ); -#ifdef __cplusplus -} -#endif - -#endif /* #ifndef _PIO_ */ - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/pio_capture.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/pio_capture.h deleted file mode 100644 index cac9991a..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/pio_capture.h +++ /dev/null @@ -1,79 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -#ifndef PIO_CAPTURE_H -#define PIO_CAPTURE_H - -/*---------------------------------------------------------------------------- - * Types - *----------------------------------------------------------------------------*/ - -/** \brief PIO Parallel Capture structure for initialize. - * - * At the end of the transfer, the callback is invoked by the interrupt handler. - */ -typedef struct _SpioCaptureInit { - - /** PIO_PCRHR register is a BYTE, HALF-WORD or WORD */ - uint8_t dsize; - /** PDC size, data to be received */ - uint16_t dPDCsize; - /** Data to be received */ - uint32_t *pData; - /** Parallel Capture Mode Always Sampling */ - uint8_t alwaysSampling; - /** Parallel Capture Mode Half Sampling */ - uint8_t halfSampling; - /** Parallel Capture Mode First Sample */ - uint8_t modeFirstSample; - /** Callback function invoked at Mode Data Ready */ - void (*CbkDataReady)( struct _SpioCaptureInit* ); - /** Callback function invoked at Mode Overrun Error */ - void (*CbkOverrun)( struct _SpioCaptureInit* ); - /** Callback function invoked at End of Reception Transfer */ - void (*CbkEndReception)( struct _SpioCaptureInit* ); - /** Callback function invoked at Reception Buffer Full */ - void (*CbkBuffFull)( struct _SpioCaptureInit* ); - /** Callback arguments.*/ - void *pParam; - -} SpioCaptureInit ; - - -/*---------------------------------------------------------------------------- - * Global Functions - *----------------------------------------------------------------------------*/ -extern void PIO_CaptureDisableIt( uint32_t itToDisable ) ; -extern void PIO_CaptureEnableIt( uint32_t itToEnable ) ; -extern void PIO_CaptureEnable( void ) ; -extern void PIO_CaptureDisable( void ) ; -extern void PIO_CaptureInit( SpioCaptureInit* pInit ) ; - -#endif /* #ifndef PIO_CAPTURE_H */ - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/pio_it.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/pio_it.h deleted file mode 100644 index c8d594c8..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/pio_it.h +++ /dev/null @@ -1,97 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * \par Purpose - * - * Configuration and handling of interrupts on PIO status changes. The API - * provided here have several advantages over the traditional PIO interrupt - * configuration approach: - * - It is highly portable - * - It automatically demultiplexes interrupts when multiples pins have been - * configured on a single PIO controller - * - It allows a group of pins to share the same interrupt - * - * However, it also has several minor drawbacks that may prevent from using it - * in particular applications: - * - It enables the clocks of all PIO controllers - * - PIO controllers all share the same interrupt handler, which does the - * demultiplexing and can be slower than direct configuration - * - It reserves space for a fixed number of interrupts, which can be - * increased by modifying the appropriate constant in pio_it.c. - * - * \par Usage - * - * -# Initialize the PIO interrupt mechanism using PIO_InitializeInterrupts() - * with the desired priority (0 ... 7). - * -# Configure a status change interrupt on one or more pin(s) with - * PIO_ConfigureIt(). - * -# Enable & disable interrupts on pins using PIO_EnableIt() and - * PIO_DisableIt(). - */ - -#ifndef _PIO_IT_ -#define _PIO_IT_ - -/* - * Headers - */ - -#include "pio.h" - -#ifdef __cplusplus - extern "C" { -#endif - -/* - * Global functions - */ - -extern void PIO_InitializeInterrupts( uint32_t dwPriority ) ; - -extern void PIO_ConfigureIt( const Pin *pPin, void (*handler)( const Pin* ) ) ; - -extern void PIO_EnableIt( const Pin *pPin ) ; - -extern void PIO_DisableIt( const Pin *pPin ) ; - -extern void PIO_IT_InterruptHandler( void ) ; - -extern void PioInterruptHandler( uint32_t id, Pio *pPio ) ; - -extern void PIO_CaptureHandler( void ) ; - -#ifdef __cplusplus -} -#endif - -#endif /* #ifndef _PIO_IT_ */ - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/pmc.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/pmc.h deleted file mode 100644 index 6c5ba317..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/pmc.h +++ /dev/null @@ -1,101 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2012, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -#ifndef _PMC_ -#define _PMC_ - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ -#include - - -/*---------------------------------------------------------------------------- - * Definitions - *----------------------------------------------------------------------------*/ -/* Definition for fast RC frequency */ -#define FAST_RC_4MHZ CKGR_MOR_MOSCRCF_4MHz -#define FAST_RC_8MHZ CKGR_MOR_MOSCRCF_8MHz -#define FAST_RC_12MHZ CKGR_MOR_MOSCRCF_12MHz - -/* Definitions for startup count. - * Note: 1 count unit stand for: 1 / 32768 * 8 = 244 us - */ -/* Default startup count for 4/8/12MHz fast RC (startup time: 10us ) */ -#define DEFAUTL_FAST_RC_COUNT 1 -/* Default startup count for 3-20MHz main oscillator (startup time: 1.4ms ) */ -#define DEFAUTL_MAIN_OSC_COUNT 8 -/* Default startup count for PLLA (startup time: 200us ) */ -#define DEFAUTL_PLLA_COUNT 1 -/* Default startup count for UPLL */ -#define DEFAUTL_UPLL_COUNT 3 -/* No change for default startup count */ -#define DEFAUTL_COUNT_NO_CHANGE 0xFFFF - - -/*---------------------------------------------------------------------------- - * Exported functions - *----------------------------------------------------------------------------*/ - -#ifdef __cplusplus - extern "C" { -#endif - -extern void PMC_EnablePeripheral( uint32_t dwId ) ; -extern void PMC_DisablePeripheral( uint32_t dwId ) ; - -extern void PMC_EnableAllPeripherals( void ) ; -extern void PMC_DisableAllPeripherals( void ) ; - -extern uint32_t PMC_IsPeriphEnabled( uint32_t dwId ) ; - -extern void PMC_SelectExtOsc(void); -extern void PMC_EnableExtOsc(void); -extern void PMC_DisableExtOsc(void); -extern void PMC_SelectExtBypassOsc(void); -extern void PMC_EnableIntRC4_8_12MHz(uint32_t fastRcFreq); -extern void PMC_DisableIntRC4_8_12MHz(void); -extern void PMC_SetPllaClock(uint32_t mul, uint32_t div); -extern void PMC_SetPllbClock(uint32_t mul, uint32_t div); -extern void PMC_SetMckSelection(uint32_t clockSource, uint32_t prescaler); -extern void PMC_DisableAllClocks(void); -extern void PMC_ConfigureMckWithPlla(uint32_t mul, uint32_t div, - uint32_t prescaler); -extern void PMC_ConfigureMckWithPllb(uint32_t mul, uint32_t div, - uint32_t prescaler); -extern void PMC_EnableXT32KFME(void); -extern void PMC_ConfigurePCK0(uint32_t MasterClk, uint32_t prescaler); -extern void PMC_ConfigurePCK1(uint32_t MasterClk, uint32_t prescaler); -extern void PMC_ConfigurePCK2(uint32_t MasterClk, uint32_t prescaler); - -#ifdef __cplusplus -} -#endif - -#endif /* #ifndef _PMC_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/pwmc.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/pwmc.h deleted file mode 100644 index f5bca771..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/pwmc.h +++ /dev/null @@ -1,135 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * \par Purpose - * - * Interface for configuration the Pulse Width Modulation Controller (PWM) - * peripheral. - * - * \par Usage - * - * -# Configures PWM clocks A & B to run at the given frequencies using - * \ref PWMC_ConfigureClocks(). - * -# Configure PWMC channel using \ref PWMC_ConfigureChannel(), - * \ref PWMC_ConfigureChannelExt() - * \ref PWMC_SetPeriod(), \ref PWMC_SetDutyCycle() and - * \ref PWMC_SetDeadTime(). - * -# Enable & disable channel using \ref PWMC_EnableChannel() and - * \ref PWMC_DisableChannel(). - * -# Enable & disable the period interrupt for the given PWM channel using - * \ref PWMC_EnableChannelIt() and \ref PWMC_DisableChannelIt(). - * -# Enable & disable the selected interrupts sources on a PWMC peripheral - * using \ref PWMC_EnableIt() and \ref PWMC_DisableIt(). - * -# Control synchronous channel using \ref PWMC_ConfigureSyncChannel(), - * \ref PWMC_SetSyncChannelUpdatePeriod() and - * \ref PWMC_SetSyncChannelUpdateUnlock(). - * -# Control PWM override output using \ref PWMC_SetOverrideValue(), - * \ref PWMC_EnableOverrideOutput() and \ref PWMC_DisableOverrideOutput(). - * -# Send data through the transmitter using \ref PWMC_WriteBuffer(). - * - */ - -#ifndef _PWMC_ -#define _PWMC_ - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ - -#include "chip.h" - -#include - -#ifdef __cplusplus - extern "C" { -#endif - -/*---------------------------------------------------------------------------- - * Exported functions - *----------------------------------------------------------------------------*/ - -extern void PWMC_ConfigureChannel( - Pwm* pPwm, - uint8_t channel, - uint32_t prescaler, - uint32_t alignment, - uint32_t polarity); -extern void PWMC_ConfigureChannelExt( - Pwm* pPwm, - uint8_t channel, - uint32_t prescaler, - uint32_t alignment, - uint32_t polarity, - uint32_t countEventSelect, - uint32_t DTEnable, - uint32_t DTHInverte, - uint32_t DTLInverte); -extern void PWMC_ConfigureClocks(Pwm* pPwm, uint32_t clka, uint32_t clkb, - uint32_t mck); -extern void PWMC_SetPeriod( Pwm* pPwm, uint8_t channel, uint16_t period); -extern void PWMC_SetDutyCycle( Pwm* pPwm, uint8_t channel, uint16_t duty); -extern void PWMC_SetDeadTime( Pwm* pPwm, uint8_t channel, uint16_t timeH, - uint16_t timeL); -extern void PWMC_ConfigureSyncChannel( Pwm* pPwm, - uint32_t channels, - uint32_t updateMode, - uint32_t requestMode, - uint32_t requestComparisonSelect); -extern void PWMC_SetSyncChannelUpdatePeriod( Pwm* pPwm, uint8_t period); -extern void PWMC_SetSyncChannelUpdateUnlock( Pwm* pPwm ); -extern void PWMC_EnableChannel( Pwm* pPwm, uint8_t channel); -extern void PWMC_DisableChannel( Pwm* pPwm, uint8_t channel); -extern void PWMC_EnableChannelIt( Pwm* pPwm, uint8_t channel); -extern void PWMC_DisableChannelIt( Pwm* pPwm, uint8_t channel); -extern void PWMC_EnableIt( Pwm* pPwm, uint32_t sources1, uint32_t sources2); -extern void PWMC_DisableIt( Pwm* pPwm, uint32_t sources1, uint32_t sources2); -extern uint8_t PWMC_WriteBuffer(Pwm *pwmc, - void *buffer, - uint32_t length); -extern void PWMC_SetOverrideValue( Pwm* pPwm, uint32_t value); -extern void PWMC_EnableOverrideOutput( Pwm* pPwm, uint32_t value, uint32_t sync); -extern void PWMC_OutputOverrideSelection( Pwm* pPwm, uint32_t value ); -extern void PWMC_DisableOverrideOutput( Pwm* pPwm, uint32_t value, uint32_t sync); -extern void PWMC_SetFaultMode( Pwm* pPwm, uint32_t mode); -extern void PWMC_FaultClear( Pwm* pPwm, uint32_t fault); -extern void PWMC_SetFaultProtectionValue( Pwm* pPwm, uint32_t value); -extern void PWMC_EnableFaultProtection( Pwm* pPwm, uint32_t value); -extern void PWMC_ConfigureComparisonUnit( Pwm* pPwm, uint32_t x, - uint32_t value, uint32_t mode); -extern void PWMC_ConfigureEventLineMode( Pwm* pPwm, uint32_t x, uint32_t mode); -extern uint32_t PWMC_GetStatus2( Pwm* pPwm); -#ifdef __cplusplus -} -#endif - -#endif /* #ifndef _PWMC_ */ - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/qspi.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/qspi.h deleted file mode 100644 index c1fb81b1..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/qspi.h +++ /dev/null @@ -1,236 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - - -/** - * \file - * - * Interface for Serial Peripheral Interface (SPI) controller. - * - */ - -#ifndef _QSPI_ -#define _QSPI_ -/*---------------------------------------------------------------------------- - * Macros - *----------------------------------------------------------------------------*/ - -/** - * - * Here are several macros which should be used when configuring a SPI - * peripheral. - * - * \section qspi_configuration_macros SPI Configuration Macros - * - \ref QSPI_PCS - * - \ref QSPI_SCBR - * - \ref QSPI_DLYBS - * - \ref QSPI_DLYBCT - */ - -/** Calculates the value of the CSR SCBR field given the baudrate and MCK. */ -#define QSPI_SCBR(baudrate, masterClock) \ - ((uint32_t) (masterClock / baudrate) << 8) - -/** Calculates the value of the CSR DLYBS field given the desired delay (in ns) */ -#define QSPI_DLYBS(delay, masterClock) \ - ((uint32_t) (((masterClock / 1000000) * delay) / 1000) << 16) - -/** Calculates the value of the CSR DLYBCT field given the desired delay (in ns) */ -#define QSPI_DLYBCT(delay, masterClock) \ - ((uint32_t) (((masterClock / 1000000) * delay) / 32000) << 24) - -/*--------------------------------------------------------------------------- */ - -#ifdef __cplusplus - extern "C" { -#endif - -/*---------------------------------------------------------------------------- - * Exported functions - *----------------------------------------------------------------------------*/ - -/** \brief qspi access modes - */ -typedef enum{ - CmdAccess = 0, - ReadAccess, - WriteAccess -}Access_t; - -/** \brief qspi modes SPI or QSPI - */ -typedef enum{ - SpiMode = QSPI_MR_SMM_SPI, - QspiMemMode = QSPI_MR_SMM_MEMORY -}QspiMode_t; - - -/** \brief qspi clock modes , regarding clock phase and clock polarity - */ -typedef enum{ - ClockMode_00 = 0, - ClockMode_10, - ClockMode_01, - ClockMode_11 -}QspiClockMode_t; - - -/** \brief qspi status codes - */ -typedef enum{ - QSPI_SUCCESS = 0, - QSPI_BUSY, - QSPI_BUSY_SENDING, - QSPI_READ_ERROR, - QSPI_WRITE_ERROR, - QSPI_UNKNOWN_ERROR, - QSPI_INIT_ERROR, - QSPI_INPUT_ERROR, - QSPI_TOTAL_ERROR -}QspidStatus_t; - - -/** \brief qspi status regiter bits - */ -typedef enum { - IsReceived = QSPI_SR_RDRF, - IsTxSent = QSPI_SR_TDRE, - IsTxEmpty = QSPI_SR_TXEMPTY, - IsOverrun = QSPI_SR_OVRES, - IsCsRise = QSPI_SR_CSR, - IsCsAsserted = QSPI_SR_CSS, - IsEofInst = QSPI_SR_INSTRE, - IsEnabled = QSPI_SR_QSPIENS -}QspiStatus_t; - -/** \brief qspi command structure - */ -typedef struct { - uint8_t Instruction; - uint8_t Option; -}QspiMemCmd_t; - -/** \brief qspi buffer structure - */ -typedef struct { - uint32_t TxDataSize; /* Tx buffer size */ - uint32_t RxDataSize; /* Rx buffer size */ - uint32_t *pDataTx; /* Tx buffer */ - uint32_t *pDataRx; /* Rx buffer */ -}QspiBuffer_t; - - -/** \brief qspi frame structure for QSPI mode - */ -typedef struct { - union _QspiInstFrame { - uint32_t val; - struct _QspiInstFrameBM { - uint32_t bwidth:3, /** Width of QSPI Addr , inst data */ - reserved0:1, /** Reserved*/ - bInstEn:1, /** Enable Inst */ - bAddrEn:1, /** Enable Address */ - bOptEn:1, /** Enable Option */ - bDataEn:1, /** Enable Data */ - bOptLen:2, /** Option Length*/ - bAddrLen:1, /** Addrs Length*/ - reserved1:1, /** Option Length*/ - bXfrType:2, /** Transfer type*/ - bContinuesRead:1, /** Continoues read mode*/ - reserved2:1, /** Reserved*/ - bDummyCycles:5, /**< Unicast hash match */ - reserved3:11; /** Reserved*/ - } bm; - } InstFrame; - uint32_t Addr; -}QspiInstFrame_t; - -/** \brief qspi driver structure - */ -typedef struct { - uint8_t qspiId; /* QSPI ID */ - Qspi *pQspiHw; /* QSPI Hw instance */ - QspiMode_t qspiMode; /* Qspi mode: SPI or QSPI */ - QspiMemCmd_t qspiCommand; /* Qspi command structure*/ - QspiBuffer_t qspiBuffer; /* Qspi buffer*/ - QspiInstFrame_t *pQspiFrame; /* Qspi QSPI mode Fram register informations*/ -}Qspid_t; - - -void QSPI_SwReset( Qspi *pQspi ); - -void QSPI_Disable( Qspi *pQspi ); - -void QSPI_Enable( Qspi *pQspi ); - -QspidStatus_t QSPI_EndTransfer( Qspi *pQspi ); - -uint32_t QSPI_GetStatus( Qspi *pQspi, const QspiStatus_t rStatus ); - -void QSPI_ConfigureClock( Qspi *pQspi, QspiClockMode_t ClockMode, - uint32_t dwClockCfg ); - -QspidStatus_t QSPI_SingleReadSPI( Qspid_t *pQspid, uint16_t* const pData ); - -QspidStatus_t QSPI_MultiReadSPI( Qspid_t *pQspid, uint16_t* - const pData, uint32_t NumOfBytes ); - -QspidStatus_t QSPI_SingleWriteSPI( Qspid_t *pQspid, uint16_t const *pData ); - -QspidStatus_t QSPI_MultiWriteSPI( Qspid_t *pQspid, uint16_t const *pData , - uint32_t NumOfBytes ); - -QspidStatus_t QSPI_EnableIt( Qspi *pQspi, uint32_t dwSources ); - -QspidStatus_t QSPI_DisableIt( Qspi *pQspi, uint32_t dwSources ); - -uint32_t QSPI_GetItMask( Qspi *pQspi ); - -uint32_t QSPI_GetEnabledItStatus( Qspi *pQspi ); - -QspidStatus_t QSPI_ConfigureInterface( Qspid_t *pQspid, QspiMode_t Mode, - uint32_t dwConfiguration ); - -QspidStatus_t QSPI_SendCommand( Qspid_t *pQspi, uint8_t const KeepCfg); - -QspidStatus_t QSPI_SendCommandWithData( Qspid_t *pQspi, uint8_t const KeepCfg); - -QspidStatus_t QSPI_ReadCommand( Qspid_t *pQspi, uint8_t const KeepCfg); - -QspidStatus_t QSPI_EnableMemAccess( Qspid_t *pQspi, uint8_t const KeepCfg, - uint8_t ScrambleFlag); - -QspidStatus_t QSPI_ReadWriteMem( Qspid_t *pQspid, Access_t const ReadWrite); - -#ifdef __cplusplus -} -#endif - -#endif /* #ifndef _QSPI_ */ - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/qspi_dma.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/qspi_dma.h deleted file mode 100644 index 686f738d..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/qspi_dma.h +++ /dev/null @@ -1,115 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - - -/** - * \file - * - * Implementation of SPI driver, transfer data through DMA. - * - */ - -#ifndef QSPI_DMA_H -#define QSPI_DMA_H - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ - -#include "chip.h" -#include "utils/utility.h" - -/*---------------------------------------------------------------------------- - * Definitions - *----------------------------------------------------------------------------*/ - -/** An unspecified error has occurred.*/ -#define QSPID_ERROR 1 - -/** SPI driver is currently in use.*/ -#define QSPID_ERROR_LOCK 2 - -#define QSPID_CH_NOT_ENABLED 0xFF -/*---------------------------------------------------------------------------- - * Types - *----------------------------------------------------------------------------*/ - -/** SPI transfer complete callback. */ -typedef void (*QspidCallback)( uint8_t, void* ) ; - -/** Constant structure associated with SPI port. This structure prevents - client applications to have access in the same time. */ -typedef struct _Qspid -{ - Qspid_t Qspid; - /** Pointer to DMA driver */ - sXdmad* pXdmad; - /** Polling */ - uint8_t Polling ; - /** Tx ch num */ - uint8_t TxChNum ; - /** Rx ch num */ - uint8_t RxChNum ; - /** QSPI Xfr state. */ - volatile uint8_t progress ; -} QspiDma_t ; - -#ifdef __cplusplus - extern "C" { -#endif -/*---------------------------------------------------------------------------- - * Exported functions - *----------------------------------------------------------------------------*/ - -uint32_t QSPID_Configure( QspiDma_t *pQspidma, QspiMode_t Mode, - uint32_t dwConfiguration, sXdmad* pXdmad); - -uint32_t QSPID_EnableQspiRxChannel(QspiDma_t *pQspidma); - -uint32_t QSPID_EnableQspiTxChannel(QspiDma_t *pQspidma); - -uint32_t QSPID_DisableQspiRxChannel(QspiDma_t *pQspidma); - -uint32_t QSPID_DisableQspiTxChannel(QspiDma_t *pQspidma); - -uint32_t QSPID_DisableSpiChannel(QspiDma_t *pQspidma); - -uint32_t QSPID_EnableSpiChannel(QspiDma_t *pQspidma); - -uint32_t QSPID_ReadWriteQSPI( QspiDma_t *pQspidma, Access_t const ReadWrite); - -uint32_t QSPID_ReadWriteSPI(QspiDma_t *pQspidma, Access_t const ReadWrite); - -uint32_t QSPID_IsBusy( volatile uint8_t *QspiSemaphore) ; - -#ifdef __cplusplus -} -#endif - -#endif /* #ifndef _SPI_DMA_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/rstc.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/rstc.h deleted file mode 100644 index 97efdfa0..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/rstc.h +++ /dev/null @@ -1,64 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -#ifndef _RSTC_H -#define _RSTC_H - -/*--------------------------------------------------------------------------- - * Includes - *---------------------------------------------------------------------------*/ - -#include - -/*--------------------------------------------------------------------------- - * Exported functions - *---------------------------------------------------------------------------*/ - -void RSTC_ConfigureMode(uint32_t rmr); - -void RSTC_SetUserResetEnable(uint8_t enable); - -void RSTC_SetUserResetInterruptEnable(uint8_t enable); - -void RSTC_SetExtResetLength(uint8_t powl); - -void RSTC_ProcessorReset(void); - -void RSTC_ExtReset(void); - -uint8_t RSTC_GetNrstLevel(void); - -uint8_t RSTC_IsUserResetDetected(void); - -uint8_t RSTC_IsBusy(void); - -uint32_t RSTC_GetStatus(void); - -#endif /* #ifndef _RSTC_H */ - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/rtc.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/rtc.h deleted file mode 100644 index 7ae27b48..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/rtc.h +++ /dev/null @@ -1,102 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * Interface for Real Time Clock (RTC) controller. - * - */ - -#ifndef _RTC_ -#define _RTC_ - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ -#include "chip.h" - -#include - -/*---------------------------------------------------------------------------- - * Definitions - *----------------------------------------------------------------------------*/ - -#define RTC_HOUR_BIT_LEN_MASK 0x3F -#define RTC_MIN_BIT_LEN_MASK 0x7F -#define RTC_SEC_BIT_LEN_MASK 0x7F -#define RTC_CENT_BIT_LEN_MASK 0x7F -#define RTC_YEAR_BIT_LEN_MASK 0xFF -#define RTC_MONTH_BIT_LEN_MASK 0x1F -#define RTC_DATE_BIT_LEN_MASK 0x3F -#define RTC_WEEK_BIT_LEN_MASK 0x07 - -/*---------------------------------------------------------------------------- - * Exported functions - *----------------------------------------------------------------------------*/ - -#ifdef __cplusplus - extern "C" { -#endif - -extern void RTC_SetHourMode( Rtc* pRtc, uint32_t dwMode ) ; - -extern uint32_t RTC_GetHourMode( Rtc* pRtc ) ; - -extern void RTC_EnableIt( Rtc* pRtc, uint32_t dwSources ) ; - -extern void RTC_DisableIt( Rtc* pRtc, uint32_t dwSources ) ; - -extern int RTC_SetTime( Rtc* pRtc, uint8_t ucHour, uint8_t ucMinute, - uint8_t ucSecond ) ; - -extern void RTC_GetTime( Rtc* pRtc, uint8_t *pucHour, uint8_t *pucMinute, - uint8_t *pucSecond ) ; - -extern int RTC_SetTimeAlarm( Rtc* pRtc, uint8_t *pucHour, uint8_t *pucMinute, - uint8_t *pucSecond ) ; - -extern void RTC_GetDate( Rtc* pRtc, uint16_t *pwYear, uint8_t *pucMonth, - uint8_t *pucDay, uint8_t *pucWeek ) ; - -extern int RTC_SetDate( Rtc* pRtc, uint16_t wYear, uint8_t ucMonth, - uint8_t ucDay, uint8_t ucWeek ) ; - -extern int RTC_SetDateAlarm( Rtc* pRtc, uint8_t *pucMonth, uint8_t *pucDay ) ; - -extern void RTC_ClearSCCR( Rtc* pRtc, uint32_t dwMask ) ; - -extern uint32_t RTC_GetSR( Rtc* pRtc, uint32_t dwMask ) ; - -#ifdef __cplusplus -} -#endif - -#endif /* #ifndef _RTC_ */ - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/rtt.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/rtt.h deleted file mode 100644 index ac2483cb..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/rtt.h +++ /dev/null @@ -1,82 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * \par Purpose - * - * Interface for Real Time Timer (RTT) controller. - * - * \par Usage - * - * -# Changes the prescaler value of the given RTT and restarts it - * using \ref RTT_SetPrescaler(). - * -# Get current value of the RTT using \ref RTT_GetTime(). - * -# Enables the specified RTT interrupt using \ref RTT_EnableIT(). - * -# Get the status register value of the given RTT using \ref RTT_GetStatus(). - * -# Configures the RTT to generate an alarm at the given time - * using \ref RTT_SetAlarm(). - */ - -#ifndef _RTT_ -#define _RTT_ - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ - -#include "chip.h" - -#include - -/*---------------------------------------------------------------------------- - * Exported functions - *----------------------------------------------------------------------------*/ - -#ifdef __cplusplus - extern "C" { -#endif - -extern void RTT_SetPrescaler( Rtt* pRtt, uint16_t wPrescaler ) ; - -extern uint32_t RTT_GetTime( Rtt* pRtt ) ; - -extern void RTT_EnableIT( Rtt* pRtt, uint32_t dwSources ) ; - -extern uint32_t RTT_GetStatus( Rtt *pRtt ) ; - -extern void RTT_SetAlarm( Rtt *pRtt, uint32_t dwTime ) ; - -#ifdef __cplusplus -} -#endif - -#endif /* #ifndef RTT_H */ - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_acc.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_acc.h deleted file mode 100644 index 9dd634d1..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_acc.h +++ /dev/null @@ -1,128 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_ACC_COMPONENT_ -#define _SAMV71_ACC_COMPONENT_ - -/* ============================================================================= */ -/** SOFTWARE API DEFINITION FOR Analog Comparator Controller */ -/* ============================================================================= */ -/** \addtogroup SAMV71_ACC Analog Comparator Controller */ -/*@{*/ - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -/** \brief Acc hardware registers */ -typedef struct { - __O uint32_t ACC_CR; /**< \brief (Acc Offset: 0x00) Control Register */ - __IO uint32_t ACC_MR; /**< \brief (Acc Offset: 0x04) Mode Register */ - __I uint32_t Reserved1[7]; - __O uint32_t ACC_IER; /**< \brief (Acc Offset: 0x24) Interrupt Enable Register */ - __O uint32_t ACC_IDR; /**< \brief (Acc Offset: 0x28) Interrupt Disable Register */ - __I uint32_t ACC_IMR; /**< \brief (Acc Offset: 0x2C) Interrupt Mask Register */ - __I uint32_t ACC_ISR; /**< \brief (Acc Offset: 0x30) Interrupt Status Register */ - __I uint32_t Reserved2[24]; - __IO uint32_t ACC_ACR; /**< \brief (Acc Offset: 0x94) Analog Control Register */ - __I uint32_t Reserved3[19]; - __IO uint32_t ACC_WPMR; /**< \brief (Acc Offset: 0xE4) Write Protection Mode Register */ - __I uint32_t ACC_WPSR; /**< \brief (Acc Offset: 0xE8) Write Protection Status Register */ -} Acc; -#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/* -------- ACC_CR : (ACC Offset: 0x00) Control Register -------- */ -#define ACC_CR_SWRST (0x1u << 0) /**< \brief (ACC_CR) Software Reset */ -/* -------- ACC_MR : (ACC Offset: 0x04) Mode Register -------- */ -#define ACC_MR_SELMINUS_Pos 0 -#define ACC_MR_SELMINUS_Msk (0x7u << ACC_MR_SELMINUS_Pos) /**< \brief (ACC_MR) Selection for Minus Comparator Input */ -#define ACC_MR_SELMINUS(value) ((ACC_MR_SELMINUS_Msk & ((value) << ACC_MR_SELMINUS_Pos))) -#define ACC_MR_SELMINUS_TS (0x0u << 0) /**< \brief (ACC_MR) Select TS */ -#define ACC_MR_SELMINUS_ADVREFP (0x1u << 0) /**< \brief (ACC_MR) Select ADVREFP */ -#define ACC_MR_SELMINUS_DAC0 (0x2u << 0) /**< \brief (ACC_MR) Select DAC0 */ -#define ACC_MR_SELMINUS_DAC1 (0x3u << 0) /**< \brief (ACC_MR) Select DAC1 */ -#define ACC_MR_SELMINUS_AFE0_AD0 (0x4u << 0) /**< \brief (ACC_MR) Select AFE0_AD0 */ -#define ACC_MR_SELMINUS_AFE0_AD1 (0x5u << 0) /**< \brief (ACC_MR) Select AFE0_AD1 */ -#define ACC_MR_SELMINUS_AFE0_AD2 (0x6u << 0) /**< \brief (ACC_MR) Select AFE0_AD2 */ -#define ACC_MR_SELMINUS_AFE0_AD3 (0x7u << 0) /**< \brief (ACC_MR) Select AFE0_AD3 */ -#define ACC_MR_SELPLUS_Pos 4 -#define ACC_MR_SELPLUS_Msk (0x7u << ACC_MR_SELPLUS_Pos) /**< \brief (ACC_MR) Selection For Plus Comparator Input */ -#define ACC_MR_SELPLUS(value) ((ACC_MR_SELPLUS_Msk & ((value) << ACC_MR_SELPLUS_Pos))) -#define ACC_MR_SELPLUS_AFE0_AD0 (0x0u << 4) /**< \brief (ACC_MR) Select AFE0_AD0 */ -#define ACC_MR_SELPLUS_AFE0_AD1 (0x1u << 4) /**< \brief (ACC_MR) Select AFE0_AD1 */ -#define ACC_MR_SELPLUS_AFE0_AD2 (0x2u << 4) /**< \brief (ACC_MR) Select AFE0_AD2 */ -#define ACC_MR_SELPLUS_AFE0_AD3 (0x3u << 4) /**< \brief (ACC_MR) Select AFE0_AD3 */ -#define ACC_MR_SELPLUS_AFE0_AD4 (0x4u << 4) /**< \brief (ACC_MR) Select AFE0_AD4 */ -#define ACC_MR_SELPLUS_AFE0_AD5 (0x5u << 4) /**< \brief (ACC_MR) Select AFE0_AD5 */ -#define ACC_MR_SELPLUS_AFE1_AD0 (0x6u << 4) /**< \brief (ACC_MR) Select AFE1_AD0 */ -#define ACC_MR_SELPLUS_AFE1_AD1 (0x7u << 4) /**< \brief (ACC_MR) Select AFE1_AD1 */ -#define ACC_MR_ACEN (0x1u << 8) /**< \brief (ACC_MR) Analog Comparator Enable */ -#define ACC_MR_ACEN_DIS (0x0u << 8) /**< \brief (ACC_MR) Analog comparator disabled. */ -#define ACC_MR_ACEN_EN (0x1u << 8) /**< \brief (ACC_MR) Analog comparator enabled. */ -#define ACC_MR_EDGETYP_Pos 9 -#define ACC_MR_EDGETYP_Msk (0x3u << ACC_MR_EDGETYP_Pos) /**< \brief (ACC_MR) Edge Type */ -#define ACC_MR_EDGETYP(value) ((ACC_MR_EDGETYP_Msk & ((value) << ACC_MR_EDGETYP_Pos))) -#define ACC_MR_EDGETYP_RISING (0x0u << 9) /**< \brief (ACC_MR) Only rising edge of comparator output */ -#define ACC_MR_EDGETYP_FALLING (0x1u << 9) /**< \brief (ACC_MR) Falling edge of comparator output */ -#define ACC_MR_EDGETYP_ANY (0x2u << 9) /**< \brief (ACC_MR) Any edge of comparator output */ -#define ACC_MR_INV (0x1u << 12) /**< \brief (ACC_MR) Invert Comparator Output */ -#define ACC_MR_INV_DIS (0x0u << 12) /**< \brief (ACC_MR) Analog comparator output is directly processed. */ -#define ACC_MR_INV_EN (0x1u << 12) /**< \brief (ACC_MR) Analog comparator output is inverted prior to being processed. */ -#define ACC_MR_SELFS (0x1u << 13) /**< \brief (ACC_MR) Selection Of Fault Source */ -#define ACC_MR_SELFS_CE (0x0u << 13) /**< \brief (ACC_MR) The CE flag is used to drive the FAULT output. */ -#define ACC_MR_SELFS_OUTPUT (0x1u << 13) /**< \brief (ACC_MR) The output of the analog comparator flag is used to drive the FAULT output. */ -#define ACC_MR_FE (0x1u << 14) /**< \brief (ACC_MR) Fault Enable */ -#define ACC_MR_FE_DIS (0x0u << 14) /**< \brief (ACC_MR) The FAULT output is tied to 0. */ -#define ACC_MR_FE_EN (0x1u << 14) /**< \brief (ACC_MR) The FAULT output is driven by the signal defined by SELFS. */ -/* -------- ACC_IER : (ACC Offset: 0x24) Interrupt Enable Register -------- */ -#define ACC_IER_CE (0x1u << 0) /**< \brief (ACC_IER) Comparison Edge */ -/* -------- ACC_IDR : (ACC Offset: 0x28) Interrupt Disable Register -------- */ -#define ACC_IDR_CE (0x1u << 0) /**< \brief (ACC_IDR) Comparison Edge */ -/* -------- ACC_IMR : (ACC Offset: 0x2C) Interrupt Mask Register -------- */ -#define ACC_IMR_CE (0x1u << 0) /**< \brief (ACC_IMR) Comparison Edge */ -/* -------- ACC_ISR : (ACC Offset: 0x30) Interrupt Status Register -------- */ -#define ACC_ISR_CE (0x1u << 0) /**< \brief (ACC_ISR) Comparison Edge (cleared on read) */ -#define ACC_ISR_SCO (0x1u << 1) /**< \brief (ACC_ISR) Synchronized Comparator Output */ -#define ACC_ISR_MASK (0x1u << 31) /**< \brief (ACC_ISR) Flag Mask */ -/* -------- ACC_ACR : (ACC Offset: 0x94) Analog Control Register -------- */ -#define ACC_ACR_ISEL (0x1u << 0) /**< \brief (ACC_ACR) Current Selection */ -#define ACC_ACR_ISEL_LOPW (0x0u << 0) /**< \brief (ACC_ACR) Low-power option. */ -#define ACC_ACR_ISEL_HISP (0x1u << 0) /**< \brief (ACC_ACR) High-speed option. */ -#define ACC_ACR_HYST_Pos 1 -#define ACC_ACR_HYST_Msk (0x3u << ACC_ACR_HYST_Pos) /**< \brief (ACC_ACR) Hysteresis Selection */ -#define ACC_ACR_HYST(value) ((ACC_ACR_HYST_Msk & ((value) << ACC_ACR_HYST_Pos))) -/* -------- ACC_WPMR : (ACC Offset: 0xE4) Write Protection Mode Register -------- */ -#define ACC_WPMR_WPEN (0x1u << 0) /**< \brief (ACC_WPMR) Write Protection Enable */ -#define ACC_WPMR_WPKEY_Pos 8 -#define ACC_WPMR_WPKEY_Msk (0xffffffu << ACC_WPMR_WPKEY_Pos) /**< \brief (ACC_WPMR) Write Protection Key */ -#define ACC_WPMR_WPKEY(value) ((ACC_WPMR_WPKEY_Msk & ((value) << ACC_WPMR_WPKEY_Pos))) -#define ACC_WPMR_WPKEY_PASSWD (0x414343u << 8) /**< \brief (ACC_WPMR) Writing any other value in this field aborts the write operation of the WPEN bit.Always reads as 0. */ -/* -------- ACC_WPSR : (ACC Offset: 0xE8) Write Protection Status Register -------- */ -#define ACC_WPSR_WPVS (0x1u << 0) /**< \brief (ACC_WPSR) Write Protection Violation Status */ - -/*@}*/ - - -#endif /* _SAMV71_ACC_COMPONENT_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_aes.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_aes.h deleted file mode 100644 index 197590d8..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_aes.h +++ /dev/null @@ -1,172 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_AES_COMPONENT_ -#define _SAMV71_AES_COMPONENT_ - -/* ============================================================================= */ -/** SOFTWARE API DEFINITION FOR Advanced Encryption Standard */ -/* ============================================================================= */ -/** \addtogroup SAMV71_AES Advanced Encryption Standard */ -/*@{*/ - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -/** \brief Aes hardware registers */ -typedef struct { - __O uint32_t AES_CR; /**< \brief (Aes Offset: 0x00) Control Register */ - __IO uint32_t AES_MR; /**< \brief (Aes Offset: 0x04) Mode Register */ - __I uint32_t Reserved1[2]; - __O uint32_t AES_IER; /**< \brief (Aes Offset: 0x10) Interrupt Enable Register */ - __O uint32_t AES_IDR; /**< \brief (Aes Offset: 0x14) Interrupt Disable Register */ - __I uint32_t AES_IMR; /**< \brief (Aes Offset: 0x18) Interrupt Mask Register */ - __I uint32_t AES_ISR; /**< \brief (Aes Offset: 0x1C) Interrupt Status Register */ - __O uint32_t AES_KEYWR[8]; /**< \brief (Aes Offset: 0x20) Key Word Register */ - __O uint32_t AES_IDATAR[4]; /**< \brief (Aes Offset: 0x40) Input Data Register */ - __I uint32_t AES_ODATAR[4]; /**< \brief (Aes Offset: 0x50) Output Data Register */ - __O uint32_t AES_IVR[4]; /**< \brief (Aes Offset: 0x60) Initialization Vector Register */ - __IO uint32_t AES_AADLENR; /**< \brief (Aes Offset: 0x70) Additional Authenticated Data Length Register */ - __IO uint32_t AES_CLENR; /**< \brief (Aes Offset: 0x74) Plaintext/Ciphertext Length Register */ - __IO uint32_t AES_GHASHR[4]; /**< \brief (Aes Offset: 0x78) GCM Intermediate Hash Word Register */ - __I uint32_t AES_TAGR[4]; /**< \brief (Aes Offset: 0x88) GCM Authentication Tag Word Register */ - __I uint32_t AES_CTRR; /**< \brief (Aes Offset: 0x98) GCM Encryption Counter Value Register */ - __IO uint32_t AES_GCMHR[4]; /**< \brief (Aes Offset: 0x9C) GCM H Word Register */ -} Aes; -#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/* -------- AES_CR : (AES Offset: 0x00) Control Register -------- */ -#define AES_CR_START (0x1u << 0) /**< \brief (AES_CR) Start Processing */ -#define AES_CR_SWRST (0x1u << 8) /**< \brief (AES_CR) Software Reset */ -/* -------- AES_MR : (AES Offset: 0x04) Mode Register -------- */ -#define AES_MR_CIPHER (0x1u << 0) /**< \brief (AES_MR) Processing Mode */ -#define AES_MR_GTAGEN (0x1u << 1) /**< \brief (AES_MR) GCM Automatic Tag Generation Enable */ -#define AES_MR_DUALBUFF (0x1u << 3) /**< \brief (AES_MR) Dual Input Buffer */ -#define AES_MR_DUALBUFF_INACTIVE (0x0u << 3) /**< \brief (AES_MR) AES_IDATARx cannot be written during processing of previous block. */ -#define AES_MR_DUALBUFF_ACTIVE (0x1u << 3) /**< \brief (AES_MR) AES_IDATARx can be written during processing of previous block when SMOD = 0x2. It speeds up the overall runtime of large files. */ -#define AES_MR_PROCDLY_Pos 4 -#define AES_MR_PROCDLY_Msk (0xfu << AES_MR_PROCDLY_Pos) /**< \brief (AES_MR) Processing Delay */ -#define AES_MR_PROCDLY(value) ((AES_MR_PROCDLY_Msk & ((value) << AES_MR_PROCDLY_Pos))) -#define AES_MR_SMOD_Pos 8 -#define AES_MR_SMOD_Msk (0x3u << AES_MR_SMOD_Pos) /**< \brief (AES_MR) Start Mode */ -#define AES_MR_SMOD(value) ((AES_MR_SMOD_Msk & ((value) << AES_MR_SMOD_Pos))) -#define AES_MR_SMOD_MANUAL_START (0x0u << 8) /**< \brief (AES_MR) Manual Mode */ -#define AES_MR_SMOD_AUTO_START (0x1u << 8) /**< \brief (AES_MR) Auto Mode */ -#define AES_MR_SMOD_IDATAR0_START (0x2u << 8) /**< \brief (AES_MR) AES_IDATAR0 access only Auto Mode (DMA) */ -#define AES_MR_KEYSIZE_Pos 10 -#define AES_MR_KEYSIZE_Msk (0x3u << AES_MR_KEYSIZE_Pos) /**< \brief (AES_MR) Key Size */ -#define AES_MR_KEYSIZE(value) ((AES_MR_KEYSIZE_Msk & ((value) << AES_MR_KEYSIZE_Pos))) -#define AES_MR_KEYSIZE_AES128 (0x0u << 10) /**< \brief (AES_MR) AES Key Size is 128 bits */ -#define AES_MR_KEYSIZE_AES192 (0x1u << 10) /**< \brief (AES_MR) AES Key Size is 192 bits */ -#define AES_MR_KEYSIZE_AES256 (0x2u << 10) /**< \brief (AES_MR) AES Key Size is 256 bits */ -#define AES_MR_OPMOD_Pos 12 -#define AES_MR_OPMOD_Msk (0x7u << AES_MR_OPMOD_Pos) /**< \brief (AES_MR) Operation Mode */ -#define AES_MR_OPMOD(value) ((AES_MR_OPMOD_Msk & ((value) << AES_MR_OPMOD_Pos))) -#define AES_MR_OPMOD_ECB (0x0u << 12) /**< \brief (AES_MR) ECB: Electronic Code Book mode */ -#define AES_MR_OPMOD_CBC (0x1u << 12) /**< \brief (AES_MR) CBC: Cipher Block Chaining mode */ -#define AES_MR_OPMOD_OFB (0x2u << 12) /**< \brief (AES_MR) OFB: Output Feedback mode */ -#define AES_MR_OPMOD_CFB (0x3u << 12) /**< \brief (AES_MR) CFB: Cipher Feedback mode */ -#define AES_MR_OPMOD_CTR (0x4u << 12) /**< \brief (AES_MR) CTR: Counter mode (16-bit internal counter) */ -#define AES_MR_OPMOD_GCM (0x5u << 12) /**< \brief (AES_MR) GCM: Galois/Counter mode */ -#define AES_MR_LOD (0x1u << 15) /**< \brief (AES_MR) Last Output Data Mode */ -#define AES_MR_CFBS_Pos 16 -#define AES_MR_CFBS_Msk (0x7u << AES_MR_CFBS_Pos) /**< \brief (AES_MR) Cipher Feedback Data Size */ -#define AES_MR_CFBS(value) ((AES_MR_CFBS_Msk & ((value) << AES_MR_CFBS_Pos))) -#define AES_MR_CFBS_SIZE_128BIT (0x0u << 16) /**< \brief (AES_MR) 128-bit */ -#define AES_MR_CFBS_SIZE_64BIT (0x1u << 16) /**< \brief (AES_MR) 64-bit */ -#define AES_MR_CFBS_SIZE_32BIT (0x2u << 16) /**< \brief (AES_MR) 32-bit */ -#define AES_MR_CFBS_SIZE_16BIT (0x3u << 16) /**< \brief (AES_MR) 16-bit */ -#define AES_MR_CFBS_SIZE_8BIT (0x4u << 16) /**< \brief (AES_MR) 8-bit */ -#define AES_MR_CKEY_Pos 20 -#define AES_MR_CKEY_Msk (0xfu << AES_MR_CKEY_Pos) /**< \brief (AES_MR) Key */ -#define AES_MR_CKEY(value) ((AES_MR_CKEY_Msk & ((value) << AES_MR_CKEY_Pos))) -#define AES_MR_CKEY_PASSWD (0xEu << 20) /**< \brief (AES_MR) This field must be written with 0xE the first time that AES_MR is programmed. For subsequent programming of the AES_MR, any value can be written, including that of 0xE.Always reads as 0. */ -/* -------- AES_IER : (AES Offset: 0x10) Interrupt Enable Register -------- */ -#define AES_IER_DATRDY (0x1u << 0) /**< \brief (AES_IER) Data Ready Interrupt Enable */ -#define AES_IER_URAD (0x1u << 8) /**< \brief (AES_IER) Unspecified Register Access Detection Interrupt Enable */ -#define AES_IER_TAGRDY (0x1u << 16) /**< \brief (AES_IER) GCM Tag Ready Interrupt Enable */ -/* -------- AES_IDR : (AES Offset: 0x14) Interrupt Disable Register -------- */ -#define AES_IDR_DATRDY (0x1u << 0) /**< \brief (AES_IDR) Data Ready Interrupt Disable */ -#define AES_IDR_URAD (0x1u << 8) /**< \brief (AES_IDR) Unspecified Register Access Detection Interrupt Disable */ -#define AES_IDR_TAGRDY (0x1u << 16) /**< \brief (AES_IDR) GCM Tag Ready Interrupt Disable */ -/* -------- AES_IMR : (AES Offset: 0x18) Interrupt Mask Register -------- */ -#define AES_IMR_DATRDY (0x1u << 0) /**< \brief (AES_IMR) Data Ready Interrupt Mask */ -#define AES_IMR_URAD (0x1u << 8) /**< \brief (AES_IMR) Unspecified Register Access Detection Interrupt Mask */ -#define AES_IMR_TAGRDY (0x1u << 16) /**< \brief (AES_IMR) GCM Tag Ready Interrupt Mask */ -/* -------- AES_ISR : (AES Offset: 0x1C) Interrupt Status Register -------- */ -#define AES_ISR_DATRDY (0x1u << 0) /**< \brief (AES_ISR) Data Ready (cleared by setting bit START or bit SWRST in AES_CR or by reading AES_ODATARx) */ -#define AES_ISR_URAD (0x1u << 8) /**< \brief (AES_ISR) Unspecified Register Access Detection Status (cleared by writing SWRST in AES_CR) */ -#define AES_ISR_URAT_Pos 12 -#define AES_ISR_URAT_Msk (0xfu << AES_ISR_URAT_Pos) /**< \brief (AES_ISR) Unspecified Register Access (cleared by writing SWRST in AES_CR) */ -#define AES_ISR_URAT_IDR_WR_PROCESSING (0x0u << 12) /**< \brief (AES_ISR) Input Data Register written during the data processing when SMOD = 0x2 mode. */ -#define AES_ISR_URAT_ODR_RD_PROCESSING (0x1u << 12) /**< \brief (AES_ISR) Output Data Register read during the data processing. */ -#define AES_ISR_URAT_MR_WR_PROCESSING (0x2u << 12) /**< \brief (AES_ISR) Mode Register written during the data processing. */ -#define AES_ISR_URAT_ODR_RD_SUBKGEN (0x3u << 12) /**< \brief (AES_ISR) Output Data Register read during the sub-keys generation. */ -#define AES_ISR_URAT_MR_WR_SUBKGEN (0x4u << 12) /**< \brief (AES_ISR) Mode Register written during the sub-keys generation. */ -#define AES_ISR_URAT_WOR_RD_ACCESS (0x5u << 12) /**< \brief (AES_ISR) Write-only register read access. */ -#define AES_ISR_TAGRDY (0x1u << 16) /**< \brief (AES_ISR) GCM Tag Ready */ -/* -------- AES_KEYWR[8] : (AES Offset: 0x20) Key Word Register -------- */ -#define AES_KEYWR_KEYW_Pos 0 -#define AES_KEYWR_KEYW_Msk (0xffffffffu << AES_KEYWR_KEYW_Pos) /**< \brief (AES_KEYWR[8]) Key Word */ -#define AES_KEYWR_KEYW(value) ((AES_KEYWR_KEYW_Msk & ((value) << AES_KEYWR_KEYW_Pos))) -/* -------- AES_IDATAR[4] : (AES Offset: 0x40) Input Data Register -------- */ -#define AES_IDATAR_IDATA_Pos 0 -#define AES_IDATAR_IDATA_Msk (0xffffffffu << AES_IDATAR_IDATA_Pos) /**< \brief (AES_IDATAR[4]) Input Data Word */ -#define AES_IDATAR_IDATA(value) ((AES_IDATAR_IDATA_Msk & ((value) << AES_IDATAR_IDATA_Pos))) -/* -------- AES_ODATAR[4] : (AES Offset: 0x50) Output Data Register -------- */ -#define AES_ODATAR_ODATA_Pos 0 -#define AES_ODATAR_ODATA_Msk (0xffffffffu << AES_ODATAR_ODATA_Pos) /**< \brief (AES_ODATAR[4]) Output Data */ -/* -------- AES_IVR[4] : (AES Offset: 0x60) Initialization Vector Register -------- */ -#define AES_IVR_IV_Pos 0 -#define AES_IVR_IV_Msk (0xffffffffu << AES_IVR_IV_Pos) /**< \brief (AES_IVR[4]) Initialization Vector */ -#define AES_IVR_IV(value) ((AES_IVR_IV_Msk & ((value) << AES_IVR_IV_Pos))) -/* -------- AES_AADLENR : (AES Offset: 0x70) Additional Authenticated Data Length Register -------- */ -#define AES_AADLENR_AADLEN_Pos 0 -#define AES_AADLENR_AADLEN_Msk (0xffffffffu << AES_AADLENR_AADLEN_Pos) /**< \brief (AES_AADLENR) Additional Authenticated Data Length */ -#define AES_AADLENR_AADLEN(value) ((AES_AADLENR_AADLEN_Msk & ((value) << AES_AADLENR_AADLEN_Pos))) -/* -------- AES_CLENR : (AES Offset: 0x74) Plaintext/Ciphertext Length Register -------- */ -#define AES_CLENR_CLEN_Pos 0 -#define AES_CLENR_CLEN_Msk (0xffffffffu << AES_CLENR_CLEN_Pos) /**< \brief (AES_CLENR) Plaintext/Ciphertext Length */ -#define AES_CLENR_CLEN(value) ((AES_CLENR_CLEN_Msk & ((value) << AES_CLENR_CLEN_Pos))) -/* -------- AES_GHASHR[4] : (AES Offset: 0x78) GCM Intermediate Hash Word Register -------- */ -#define AES_GHASHR_GHASH_Pos 0 -#define AES_GHASHR_GHASH_Msk (0xffffffffu << AES_GHASHR_GHASH_Pos) /**< \brief (AES_GHASHR[4]) Intermediate GCM Hash Word x */ -#define AES_GHASHR_GHASH(value) ((AES_GHASHR_GHASH_Msk & ((value) << AES_GHASHR_GHASH_Pos))) -/* -------- AES_TAGR[4] : (AES Offset: 0x88) GCM Authentication Tag Word Register -------- */ -#define AES_TAGR_TAG_Pos 0 -#define AES_TAGR_TAG_Msk (0xffffffffu << AES_TAGR_TAG_Pos) /**< \brief (AES_TAGR[4]) GCM Authentication Tag x */ -/* -------- AES_CTRR : (AES Offset: 0x98) GCM Encryption Counter Value Register -------- */ -#define AES_CTRR_CTR_Pos 0 -#define AES_CTRR_CTR_Msk (0xffffffffu << AES_CTRR_CTR_Pos) /**< \brief (AES_CTRR) GCM Encryption Counter */ -/* -------- AES_GCMHR[4] : (AES Offset: 0x9C) GCM H Word Register -------- */ -#define AES_GCMHR_H_Pos 0 -#define AES_GCMHR_H_Msk (0xffffffffu << AES_GCMHR_H_Pos) /**< \brief (AES_GCMHR[4]) GCM H Word x */ -#define AES_GCMHR_H(value) ((AES_GCMHR_H_Msk & ((value) << AES_GCMHR_H_Pos))) - -/*@}*/ - - -#endif /* _SAMV71_AES_COMPONENT_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_afec.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_afec.h deleted file mode 100644 index 72b8a3c3..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_afec.h +++ /dev/null @@ -1,483 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_AFEC_COMPONENT_ -#define _SAMV71_AFEC_COMPONENT_ - -/* ============================================================================= */ -/** SOFTWARE API DEFINITION FOR Analog Front-End Controller */ -/* ============================================================================= */ -/** \addtogroup SAMV71_AFEC Analog Front-End Controller */ -/*@{*/ - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -/** \brief Afec hardware registers */ -typedef struct { - __O uint32_t AFEC_CR; /**< \brief (Afec Offset: 0x00) AFEC Control Register */ - __IO uint32_t AFEC_MR; /**< \brief (Afec Offset: 0x04) AFEC Mode Register */ - __IO uint32_t AFEC_EMR; /**< \brief (Afec Offset: 0x08) AFEC Extended Mode Register */ - __IO uint32_t AFEC_SEQ1R; /**< \brief (Afec Offset: 0x0C) AFEC Channel Sequence 1 Register */ - __IO uint32_t AFEC_SEQ2R; /**< \brief (Afec Offset: 0x10) AFEC Channel Sequence 2 Register */ - __O uint32_t AFEC_CHER; /**< \brief (Afec Offset: 0x14) AFEC Channel Enable Register */ - __O uint32_t AFEC_CHDR; /**< \brief (Afec Offset: 0x18) AFEC Channel Disable Register */ - __I uint32_t AFEC_CHSR; /**< \brief (Afec Offset: 0x1C) AFEC Channel Status Register */ - __I uint32_t AFEC_LCDR; /**< \brief (Afec Offset: 0x20) AFEC Last Converted Data Register */ - __O uint32_t AFEC_IER; /**< \brief (Afec Offset: 0x24) AFEC Interrupt Enable Register */ - __O uint32_t AFEC_IDR; /**< \brief (Afec Offset: 0x28) AFEC Interrupt Disable Register */ - __I uint32_t AFEC_IMR; /**< \brief (Afec Offset: 0x2C) AFEC Interrupt Mask Register */ - __I uint32_t AFEC_ISR; /**< \brief (Afec Offset: 0x30) AFEC Interrupt Status Register */ - __I uint32_t Reserved1[6]; - __I uint32_t AFEC_OVER; /**< \brief (Afec Offset: 0x4C) AFEC Overrun Status Register */ - __IO uint32_t AFEC_CWR; /**< \brief (Afec Offset: 0x50) AFEC Compare Window Register */ - __IO uint32_t AFEC_CGR; /**< \brief (Afec Offset: 0x54) AFEC Channel Gain Register */ - __I uint32_t Reserved2[2]; - __IO uint32_t AFEC_DIFFR; /**< \brief (Afec Offset: 0x60) AFEC Channel Differential Register */ - __IO uint32_t AFEC_CSELR; /**< \brief (Afec Offset: 0x64) AFEC Channel Selection Register */ - __I uint32_t AFEC_CDR; /**< \brief (Afec Offset: 0x68) AFEC Channel Data Register */ - __IO uint32_t AFEC_COCR; /**< \brief (Afec Offset: 0x6C) AFEC Channel Offset Compensation Register */ - __IO uint32_t AFEC_TEMPMR; /**< \brief (Afec Offset: 0x70) AFEC Temperature Sensor Mode Register */ - __IO uint32_t AFEC_TEMPCWR; /**< \brief (Afec Offset: 0x74) AFEC Temperature Compare Window Register */ - __I uint32_t Reserved3[7]; - __IO uint32_t AFEC_ACR; /**< \brief (Afec Offset: 0x94) AFEC Analog Control Register */ - __I uint32_t Reserved4[2]; - __IO uint32_t AFEC_SHMR; /**< \brief (Afec Offset: 0xA0) AFEC Sample & Hold Mode Register */ - __I uint32_t Reserved5[11]; - __IO uint32_t AFEC_COSR; /**< \brief (Afec Offset: 0xD0) AFEC Correction Select Register */ - __IO uint32_t AFEC_CVR; /**< \brief (Afec Offset: 0xD4) AFEC Correction Values Register */ - __IO uint32_t AFEC_CECR; /**< \brief (Afec Offset: 0xD8) AFEC Channel Error Correction Register */ - __I uint32_t Reserved6[2]; - __IO uint32_t AFEC_WPMR; /**< \brief (Afec Offset: 0xE4) AFEC Write Protection Mode Register */ - __I uint32_t AFEC_WPSR; /**< \brief (Afec Offset: 0xE8) AFEC Write Protection Status Register */ -} Afec; -#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/* -------- AFEC_CR : (AFEC Offset: 0x00) AFEC Control Register -------- */ -#define AFEC_CR_SWRST (0x1u << 0) /**< \brief (AFEC_CR) Software Reset */ -#define AFEC_CR_START (0x1u << 1) /**< \brief (AFEC_CR) Start Conversion */ -/* -------- AFEC_MR : (AFEC Offset: 0x04) AFEC Mode Register -------- */ -#define AFEC_MR_TRGEN (0x1u << 0) /**< \brief (AFEC_MR) Trigger Enable */ -#define AFEC_MR_TRGEN_DIS (0x0u << 0) /**< \brief (AFEC_MR) Hardware triggers are disabled. Starting a conversion is only possible by software. */ -#define AFEC_MR_TRGEN_EN (0x1u << 0) /**< \brief (AFEC_MR) Hardware trigger selected by TRGSEL field is enabled. */ -#define AFEC_MR_TRGSEL_Pos 1 -#define AFEC_MR_TRGSEL_Msk (0x7u << AFEC_MR_TRGSEL_Pos) /**< \brief (AFEC_MR) Trigger Selection */ -#define AFEC_MR_TRGSEL(value) ((AFEC_MR_TRGSEL_Msk & ((value) << AFEC_MR_TRGSEL_Pos))) -#define AFEC_MR_TRGSEL_AFEC_TRIG0 (0x0u << 1) /**< \brief (AFEC_MR) AFE0_ADTRG for AFEC0 / AFE1_ADTRG for AFEC1 */ -#define AFEC_MR_TRGSEL_AFEC_TRIG1 (0x1u << 1) /**< \brief (AFEC_MR) TIOA Output of the Timer Counter Channel 0 for AFEC0/TIOA Output of the Timer Counter Channel 3 for AFEC1 */ -#define AFEC_MR_TRGSEL_AFEC_TRIG2 (0x2u << 1) /**< \brief (AFEC_MR) TIOA Output of the Timer Counter Channel 1 for AFEC0/TIOA Output of the Timer Counter Channel 4 for AFEC1 */ -#define AFEC_MR_TRGSEL_AFEC_TRIG3 (0x3u << 1) /**< \brief (AFEC_MR) TIOA Output of the Timer Counter Channel 2 for AFEC0/TIOA Output of the Timer Counter Channel 5 for AFEC1 */ -#define AFEC_MR_TRGSEL_AFEC_TRIG4 (0x4u << 1) /**< \brief (AFEC_MR) PWM0 event line 0 for AFEC0 / PWM1 event line 0 for AFEC1 */ -#define AFEC_MR_TRGSEL_AFEC_TRIG5 (0x5u << 1) /**< \brief (AFEC_MR) PWM0 event line 1 for AFEC0 / PWM1 event line 1 for AFEC1 */ -#define AFEC_MR_TRGSEL_AFEC_TRIG6 (0x6u << 1) /**< \brief (AFEC_MR) Analog Comparator */ -#define AFEC_MR_SLEEP (0x1u << 5) /**< \brief (AFEC_MR) Sleep Mode */ -#define AFEC_MR_SLEEP_NORMAL (0x0u << 5) /**< \brief (AFEC_MR) Normal mode: The AFE and reference voltage circuitry are kept ON between conversions. */ -#define AFEC_MR_SLEEP_SLEEP (0x1u << 5) /**< \brief (AFEC_MR) Sleep mode: The AFE and reference voltage circuitry are OFF between conversions. */ -#define AFEC_MR_FWUP (0x1u << 6) /**< \brief (AFEC_MR) Fast Wake-up */ -#define AFEC_MR_FWUP_OFF (0x0u << 6) /**< \brief (AFEC_MR) Normal Sleep mode: The sleep mode is defined by the SLEEP bit. */ -#define AFEC_MR_FWUP_ON (0x1u << 6) /**< \brief (AFEC_MR) Fast wake-up Sleep mode: The voltage reference is ON between conversions and AFE is OFF. */ -#define AFEC_MR_FREERUN (0x1u << 7) /**< \brief (AFEC_MR) Free Run Mode */ -#define AFEC_MR_FREERUN_OFF (0x0u << 7) /**< \brief (AFEC_MR) Normal mode */ -#define AFEC_MR_FREERUN_ON (0x1u << 7) /**< \brief (AFEC_MR) Free Run mode: Never wait for any trigger. */ -#define AFEC_MR_PRESCAL_Pos 8 -#define AFEC_MR_PRESCAL_Msk (0xffu << AFEC_MR_PRESCAL_Pos) /**< \brief (AFEC_MR) Prescaler Rate Selection */ -#define AFEC_MR_PRESCAL(value) ((AFEC_MR_PRESCAL_Msk & ((value) << AFEC_MR_PRESCAL_Pos))) -#define AFEC_MR_STARTUP_Pos 16 -#define AFEC_MR_STARTUP_Msk (0xfu << AFEC_MR_STARTUP_Pos) /**< \brief (AFEC_MR) Start-up Time */ -#define AFEC_MR_STARTUP(value) ((AFEC_MR_STARTUP_Msk & ((value) << AFEC_MR_STARTUP_Pos))) -#define AFEC_MR_STARTUP_SUT0 (0x0u << 16) /**< \brief (AFEC_MR) 0 periods of AFE clock */ -#define AFEC_MR_STARTUP_SUT8 (0x1u << 16) /**< \brief (AFEC_MR) 8 periods of AFE clock */ -#define AFEC_MR_STARTUP_SUT16 (0x2u << 16) /**< \brief (AFEC_MR) 16 periods of AFE clock */ -#define AFEC_MR_STARTUP_SUT24 (0x3u << 16) /**< \brief (AFEC_MR) 24 periods of AFE clock */ -#define AFEC_MR_STARTUP_SUT64 (0x4u << 16) /**< \brief (AFEC_MR) 64 periods of AFE clock */ -#define AFEC_MR_STARTUP_SUT80 (0x5u << 16) /**< \brief (AFEC_MR) 80 periods of AFE clock */ -#define AFEC_MR_STARTUP_SUT96 (0x6u << 16) /**< \brief (AFEC_MR) 96 periods of AFE clock */ -#define AFEC_MR_STARTUP_SUT112 (0x7u << 16) /**< \brief (AFEC_MR) 112 periods of AFE clock */ -#define AFEC_MR_STARTUP_SUT512 (0x8u << 16) /**< \brief (AFEC_MR) 512 periods of AFE clock */ -#define AFEC_MR_STARTUP_SUT576 (0x9u << 16) /**< \brief (AFEC_MR) 576 periods of AFE clock */ -#define AFEC_MR_STARTUP_SUT640 (0xAu << 16) /**< \brief (AFEC_MR) 640 periods of AFE clock */ -#define AFEC_MR_STARTUP_SUT704 (0xBu << 16) /**< \brief (AFEC_MR) 704 periods of AFE clock */ -#define AFEC_MR_STARTUP_SUT768 (0xCu << 16) /**< \brief (AFEC_MR) 768 periods of AFE clock */ -#define AFEC_MR_STARTUP_SUT832 (0xDu << 16) /**< \brief (AFEC_MR) 832 periods of AFE clock */ -#define AFEC_MR_STARTUP_SUT896 (0xEu << 16) /**< \brief (AFEC_MR) 896 periods of AFE clock */ -#define AFEC_MR_STARTUP_SUT960 (0xFu << 16) /**< \brief (AFEC_MR) 960 periods of AFE clock */ -#define AFEC_MR_ONE (0x1u << 23) /**< \brief (AFEC_MR) One */ -#define AFEC_MR_TRACKTIM_Pos 24 -#define AFEC_MR_TRACKTIM_Msk (0xfu << AFEC_MR_TRACKTIM_Pos) /**< \brief (AFEC_MR) Tracking Time */ -#define AFEC_MR_TRACKTIM(value) ((AFEC_MR_TRACKTIM_Msk & ((value) << AFEC_MR_TRACKTIM_Pos))) -#define AFEC_MR_TRANSFER_Pos 28 -#define AFEC_MR_TRANSFER_Msk (0x3u << AFEC_MR_TRANSFER_Pos) /**< \brief (AFEC_MR) Transfer Period */ -#define AFEC_MR_TRANSFER(value) ((AFEC_MR_TRANSFER_Msk & ((value) << AFEC_MR_TRANSFER_Pos))) -#define AFEC_MR_USEQ (0x1u << 31) /**< \brief (AFEC_MR) User Sequence Enable */ -#define AFEC_MR_USEQ_NUM_ORDER (0x0u << 31) /**< \brief (AFEC_MR) Normal mode: The controller converts channels in a simple numeric order. */ -#define AFEC_MR_USEQ_REG_ORDER (0x1u << 31) /**< \brief (AFEC_MR) User Sequence mode: The sequence respects what is defined in AFEC_SEQ1R and AFEC_SEQ1R. */ -/* -------- AFEC_EMR : (AFEC Offset: 0x08) AFEC Extended Mode Register -------- */ -#define AFEC_EMR_CMPMODE_Pos 0 -#define AFEC_EMR_CMPMODE_Msk (0x3u << AFEC_EMR_CMPMODE_Pos) /**< \brief (AFEC_EMR) Comparison Mode */ -#define AFEC_EMR_CMPMODE(value) ((AFEC_EMR_CMPMODE_Msk & ((value) << AFEC_EMR_CMPMODE_Pos))) -#define AFEC_EMR_CMPMODE_LOW (0x0u << 0) /**< \brief (AFEC_EMR) Generates an event when the converted data is lower than the low threshold of the window. */ -#define AFEC_EMR_CMPMODE_HIGH (0x1u << 0) /**< \brief (AFEC_EMR) Generates an event when the converted data is higher than the high threshold of the window. */ -#define AFEC_EMR_CMPMODE_IN (0x2u << 0) /**< \brief (AFEC_EMR) Generates an event when the converted data is in the comparison window. */ -#define AFEC_EMR_CMPMODE_OUT (0x3u << 0) /**< \brief (AFEC_EMR) Generates an event when the converted data is out of the comparison window. */ -#define AFEC_EMR_CMPSEL_Pos 3 -#define AFEC_EMR_CMPSEL_Msk (0x1fu << AFEC_EMR_CMPSEL_Pos) /**< \brief (AFEC_EMR) Comparison Selected Channel */ -#define AFEC_EMR_CMPSEL(value) ((AFEC_EMR_CMPSEL_Msk & ((value) << AFEC_EMR_CMPSEL_Pos))) -#define AFEC_EMR_CMPALL (0x1u << 9) /**< \brief (AFEC_EMR) Compare All Channels */ -#define AFEC_EMR_CMPFILTER_Pos 12 -#define AFEC_EMR_CMPFILTER_Msk (0x3u << AFEC_EMR_CMPFILTER_Pos) /**< \brief (AFEC_EMR) Compare Event Filtering */ -#define AFEC_EMR_CMPFILTER(value) ((AFEC_EMR_CMPFILTER_Msk & ((value) << AFEC_EMR_CMPFILTER_Pos))) -#define AFEC_EMR_RES_Pos 16 -#define AFEC_EMR_RES_Msk (0x7u << AFEC_EMR_RES_Pos) /**< \brief (AFEC_EMR) Resolution */ -#define AFEC_EMR_RES(value) ((AFEC_EMR_RES_Msk & ((value) << AFEC_EMR_RES_Pos))) -#define AFEC_EMR_RES_NO_AVERAGE (0x0u << 16) /**< \brief (AFEC_EMR) 12-bit resolution, AFE sample rate is maximum (no averaging). */ -#define AFEC_EMR_RES_OSR4 (0x2u << 16) /**< \brief (AFEC_EMR) 13-bit resolution, AFE sample rate divided by 4 (averaging). */ -#define AFEC_EMR_RES_OSR16 (0x3u << 16) /**< \brief (AFEC_EMR) 14-bit resolution, AFE sample rate divided by 16 (averaging). */ -#define AFEC_EMR_RES_OSR64 (0x4u << 16) /**< \brief (AFEC_EMR) 15-bit resolution, AFE sample rate divided by 64 (averaging). */ -#define AFEC_EMR_RES_OSR256 (0x5u << 16) /**< \brief (AFEC_EMR) 16-bit resolution, AFE sample rate divided by 256 (averaging). */ -#define AFEC_EMR_TAG (0x1u << 24) /**< \brief (AFEC_EMR) TAG of the AFEC_LDCR */ -#define AFEC_EMR_STM (0x1u << 25) /**< \brief (AFEC_EMR) Single Trigger Mode */ -#define AFEC_EMR_SIGNMODE_Pos 28 -#define AFEC_EMR_SIGNMODE_Msk (0x3u << AFEC_EMR_SIGNMODE_Pos) /**< \brief (AFEC_EMR) Sign Mode */ -#define AFEC_EMR_SIGNMODE(value) ((AFEC_EMR_SIGNMODE_Msk & ((value) << AFEC_EMR_SIGNMODE_Pos))) -#define AFEC_EMR_SIGNMODE_SE_UNSG_DF_SIGN (0x0u << 28) /**< \brief (AFEC_EMR) Single-Ended channels: Unsigned conversions.Differential channels: Signed conversions. */ -#define AFEC_EMR_SIGNMODE_SE_SIGN_DF_UNSG (0x1u << 28) /**< \brief (AFEC_EMR) Single-Ended channels: Signed conversions.Differential channels: Unsigned conversions. */ -#define AFEC_EMR_SIGNMODE_ALL_UNSIGNED (0x2u << 28) /**< \brief (AFEC_EMR) All channels: Unsigned conversions. */ -#define AFEC_EMR_SIGNMODE_ALL_SIGNED (0x3u << 28) /**< \brief (AFEC_EMR) All channels: Signed conversions. */ -/* -------- AFEC_SEQ1R : (AFEC Offset: 0x0C) AFEC Channel Sequence 1 Register -------- */ -#define AFEC_SEQ1R_USCH0_Pos 0 -#define AFEC_SEQ1R_USCH0_Msk (0xfu << AFEC_SEQ1R_USCH0_Pos) /**< \brief (AFEC_SEQ1R) User Sequence Number 0 */ -#define AFEC_SEQ1R_USCH0(value) ((AFEC_SEQ1R_USCH0_Msk & ((value) << AFEC_SEQ1R_USCH0_Pos))) -#define AFEC_SEQ1R_USCH1_Pos 4 -#define AFEC_SEQ1R_USCH1_Msk (0xfu << AFEC_SEQ1R_USCH1_Pos) /**< \brief (AFEC_SEQ1R) User Sequence Number 1 */ -#define AFEC_SEQ1R_USCH1(value) ((AFEC_SEQ1R_USCH1_Msk & ((value) << AFEC_SEQ1R_USCH1_Pos))) -#define AFEC_SEQ1R_USCH2_Pos 8 -#define AFEC_SEQ1R_USCH2_Msk (0xfu << AFEC_SEQ1R_USCH2_Pos) /**< \brief (AFEC_SEQ1R) User Sequence Number 2 */ -#define AFEC_SEQ1R_USCH2(value) ((AFEC_SEQ1R_USCH2_Msk & ((value) << AFEC_SEQ1R_USCH2_Pos))) -#define AFEC_SEQ1R_USCH3_Pos 12 -#define AFEC_SEQ1R_USCH3_Msk (0xfu << AFEC_SEQ1R_USCH3_Pos) /**< \brief (AFEC_SEQ1R) User Sequence Number 3 */ -#define AFEC_SEQ1R_USCH3(value) ((AFEC_SEQ1R_USCH3_Msk & ((value) << AFEC_SEQ1R_USCH3_Pos))) -#define AFEC_SEQ1R_USCH4_Pos 16 -#define AFEC_SEQ1R_USCH4_Msk (0xfu << AFEC_SEQ1R_USCH4_Pos) /**< \brief (AFEC_SEQ1R) User Sequence Number 4 */ -#define AFEC_SEQ1R_USCH4(value) ((AFEC_SEQ1R_USCH4_Msk & ((value) << AFEC_SEQ1R_USCH4_Pos))) -#define AFEC_SEQ1R_USCH5_Pos 20 -#define AFEC_SEQ1R_USCH5_Msk (0xfu << AFEC_SEQ1R_USCH5_Pos) /**< \brief (AFEC_SEQ1R) User Sequence Number 5 */ -#define AFEC_SEQ1R_USCH5(value) ((AFEC_SEQ1R_USCH5_Msk & ((value) << AFEC_SEQ1R_USCH5_Pos))) -#define AFEC_SEQ1R_USCH6_Pos 24 -#define AFEC_SEQ1R_USCH6_Msk (0xfu << AFEC_SEQ1R_USCH6_Pos) /**< \brief (AFEC_SEQ1R) User Sequence Number 6 */ -#define AFEC_SEQ1R_USCH6(value) ((AFEC_SEQ1R_USCH6_Msk & ((value) << AFEC_SEQ1R_USCH6_Pos))) -#define AFEC_SEQ1R_USCH7_Pos 28 -#define AFEC_SEQ1R_USCH7_Msk (0xfu << AFEC_SEQ1R_USCH7_Pos) /**< \brief (AFEC_SEQ1R) User Sequence Number 7 */ -#define AFEC_SEQ1R_USCH7(value) ((AFEC_SEQ1R_USCH7_Msk & ((value) << AFEC_SEQ1R_USCH7_Pos))) -/* -------- AFEC_SEQ2R : (AFEC Offset: 0x10) AFEC Channel Sequence 2 Register -------- */ -#define AFEC_SEQ2R_USCH8_Pos 0 -#define AFEC_SEQ2R_USCH8_Msk (0xfu << AFEC_SEQ2R_USCH8_Pos) /**< \brief (AFEC_SEQ2R) User Sequence Number 8 */ -#define AFEC_SEQ2R_USCH8(value) ((AFEC_SEQ2R_USCH8_Msk & ((value) << AFEC_SEQ2R_USCH8_Pos))) -#define AFEC_SEQ2R_USCH9_Pos 4 -#define AFEC_SEQ2R_USCH9_Msk (0xfu << AFEC_SEQ2R_USCH9_Pos) /**< \brief (AFEC_SEQ2R) User Sequence Number 9 */ -#define AFEC_SEQ2R_USCH9(value) ((AFEC_SEQ2R_USCH9_Msk & ((value) << AFEC_SEQ2R_USCH9_Pos))) -#define AFEC_SEQ2R_USCH10_Pos 8 -#define AFEC_SEQ2R_USCH10_Msk (0xfu << AFEC_SEQ2R_USCH10_Pos) /**< \brief (AFEC_SEQ2R) User Sequence Number 10 */ -#define AFEC_SEQ2R_USCH10(value) ((AFEC_SEQ2R_USCH10_Msk & ((value) << AFEC_SEQ2R_USCH10_Pos))) -#define AFEC_SEQ2R_USCH11_Pos 12 -#define AFEC_SEQ2R_USCH11_Msk (0xfu << AFEC_SEQ2R_USCH11_Pos) /**< \brief (AFEC_SEQ2R) User Sequence Number 11 */ -#define AFEC_SEQ2R_USCH11(value) ((AFEC_SEQ2R_USCH11_Msk & ((value) << AFEC_SEQ2R_USCH11_Pos))) -#define AFEC_SEQ2R_USCH12_Pos 16 -#define AFEC_SEQ2R_USCH12_Msk (0xfu << AFEC_SEQ2R_USCH12_Pos) /**< \brief (AFEC_SEQ2R) User Sequence Number 12 */ -#define AFEC_SEQ2R_USCH12(value) ((AFEC_SEQ2R_USCH12_Msk & ((value) << AFEC_SEQ2R_USCH12_Pos))) -#define AFEC_SEQ2R_USCH13_Pos 20 -#define AFEC_SEQ2R_USCH13_Msk (0xfu << AFEC_SEQ2R_USCH13_Pos) /**< \brief (AFEC_SEQ2R) User Sequence Number 13 */ -#define AFEC_SEQ2R_USCH13(value) ((AFEC_SEQ2R_USCH13_Msk & ((value) << AFEC_SEQ2R_USCH13_Pos))) -#define AFEC_SEQ2R_USCH14_Pos 24 -#define AFEC_SEQ2R_USCH14_Msk (0xfu << AFEC_SEQ2R_USCH14_Pos) /**< \brief (AFEC_SEQ2R) User Sequence Number 14 */ -#define AFEC_SEQ2R_USCH14(value) ((AFEC_SEQ2R_USCH14_Msk & ((value) << AFEC_SEQ2R_USCH14_Pos))) -#define AFEC_SEQ2R_USCH15_Pos 28 -#define AFEC_SEQ2R_USCH15_Msk (0xfu << AFEC_SEQ2R_USCH15_Pos) /**< \brief (AFEC_SEQ2R) User Sequence Number 15 */ -#define AFEC_SEQ2R_USCH15(value) ((AFEC_SEQ2R_USCH15_Msk & ((value) << AFEC_SEQ2R_USCH15_Pos))) -/* -------- AFEC_CHER : (AFEC Offset: 0x14) AFEC Channel Enable Register -------- */ -#define AFEC_CHER_CH0 (0x1u << 0) /**< \brief (AFEC_CHER) Channel 0 Enable */ -#define AFEC_CHER_CH1 (0x1u << 1) /**< \brief (AFEC_CHER) Channel 1 Enable */ -#define AFEC_CHER_CH2 (0x1u << 2) /**< \brief (AFEC_CHER) Channel 2 Enable */ -#define AFEC_CHER_CH3 (0x1u << 3) /**< \brief (AFEC_CHER) Channel 3 Enable */ -#define AFEC_CHER_CH4 (0x1u << 4) /**< \brief (AFEC_CHER) Channel 4 Enable */ -#define AFEC_CHER_CH5 (0x1u << 5) /**< \brief (AFEC_CHER) Channel 5 Enable */ -#define AFEC_CHER_CH6 (0x1u << 6) /**< \brief (AFEC_CHER) Channel 6 Enable */ -#define AFEC_CHER_CH7 (0x1u << 7) /**< \brief (AFEC_CHER) Channel 7 Enable */ -#define AFEC_CHER_CH8 (0x1u << 8) /**< \brief (AFEC_CHER) Channel 8 Enable */ -#define AFEC_CHER_CH9 (0x1u << 9) /**< \brief (AFEC_CHER) Channel 9 Enable */ -#define AFEC_CHER_CH10 (0x1u << 10) /**< \brief (AFEC_CHER) Channel 10 Enable */ -#define AFEC_CHER_CH11 (0x1u << 11) /**< \brief (AFEC_CHER) Channel 11 Enable */ -/* -------- AFEC_CHDR : (AFEC Offset: 0x18) AFEC Channel Disable Register -------- */ -#define AFEC_CHDR_CH0 (0x1u << 0) /**< \brief (AFEC_CHDR) Channel 0 Disable */ -#define AFEC_CHDR_CH1 (0x1u << 1) /**< \brief (AFEC_CHDR) Channel 1 Disable */ -#define AFEC_CHDR_CH2 (0x1u << 2) /**< \brief (AFEC_CHDR) Channel 2 Disable */ -#define AFEC_CHDR_CH3 (0x1u << 3) /**< \brief (AFEC_CHDR) Channel 3 Disable */ -#define AFEC_CHDR_CH4 (0x1u << 4) /**< \brief (AFEC_CHDR) Channel 4 Disable */ -#define AFEC_CHDR_CH5 (0x1u << 5) /**< \brief (AFEC_CHDR) Channel 5 Disable */ -#define AFEC_CHDR_CH6 (0x1u << 6) /**< \brief (AFEC_CHDR) Channel 6 Disable */ -#define AFEC_CHDR_CH7 (0x1u << 7) /**< \brief (AFEC_CHDR) Channel 7 Disable */ -#define AFEC_CHDR_CH8 (0x1u << 8) /**< \brief (AFEC_CHDR) Channel 8 Disable */ -#define AFEC_CHDR_CH9 (0x1u << 9) /**< \brief (AFEC_CHDR) Channel 9 Disable */ -#define AFEC_CHDR_CH10 (0x1u << 10) /**< \brief (AFEC_CHDR) Channel 10 Disable */ -#define AFEC_CHDR_CH11 (0x1u << 11) /**< \brief (AFEC_CHDR) Channel 11 Disable */ -/* -------- AFEC_CHSR : (AFEC Offset: 0x1C) AFEC Channel Status Register -------- */ -#define AFEC_CHSR_CH0 (0x1u << 0) /**< \brief (AFEC_CHSR) Channel 0 Status */ -#define AFEC_CHSR_CH1 (0x1u << 1) /**< \brief (AFEC_CHSR) Channel 1 Status */ -#define AFEC_CHSR_CH2 (0x1u << 2) /**< \brief (AFEC_CHSR) Channel 2 Status */ -#define AFEC_CHSR_CH3 (0x1u << 3) /**< \brief (AFEC_CHSR) Channel 3 Status */ -#define AFEC_CHSR_CH4 (0x1u << 4) /**< \brief (AFEC_CHSR) Channel 4 Status */ -#define AFEC_CHSR_CH5 (0x1u << 5) /**< \brief (AFEC_CHSR) Channel 5 Status */ -#define AFEC_CHSR_CH6 (0x1u << 6) /**< \brief (AFEC_CHSR) Channel 6 Status */ -#define AFEC_CHSR_CH7 (0x1u << 7) /**< \brief (AFEC_CHSR) Channel 7 Status */ -#define AFEC_CHSR_CH8 (0x1u << 8) /**< \brief (AFEC_CHSR) Channel 8 Status */ -#define AFEC_CHSR_CH9 (0x1u << 9) /**< \brief (AFEC_CHSR) Channel 9 Status */ -#define AFEC_CHSR_CH10 (0x1u << 10) /**< \brief (AFEC_CHSR) Channel 10 Status */ -#define AFEC_CHSR_CH11 (0x1u << 11) /**< \brief (AFEC_CHSR) Channel 11 Status */ -/* -------- AFEC_LCDR : (AFEC Offset: 0x20) AFEC Last Converted Data Register -------- */ -#define AFEC_LCDR_LDATA_Pos 0 -#define AFEC_LCDR_LDATA_Msk (0xffffu << AFEC_LCDR_LDATA_Pos) /**< \brief (AFEC_LCDR) Last Data Converted */ -#define AFEC_LCDR_CHNB_Pos 24 -#define AFEC_LCDR_CHNB_Msk (0xfu << AFEC_LCDR_CHNB_Pos) /**< \brief (AFEC_LCDR) Channel Number */ -/* -------- AFEC_IER : (AFEC Offset: 0x24) AFEC Interrupt Enable Register -------- */ -#define AFEC_IER_EOC0 (0x1u << 0) /**< \brief (AFEC_IER) End of Conversion Interrupt Enable 0 */ -#define AFEC_IER_EOC1 (0x1u << 1) /**< \brief (AFEC_IER) End of Conversion Interrupt Enable 1 */ -#define AFEC_IER_EOC2 (0x1u << 2) /**< \brief (AFEC_IER) End of Conversion Interrupt Enable 2 */ -#define AFEC_IER_EOC3 (0x1u << 3) /**< \brief (AFEC_IER) End of Conversion Interrupt Enable 3 */ -#define AFEC_IER_EOC4 (0x1u << 4) /**< \brief (AFEC_IER) End of Conversion Interrupt Enable 4 */ -#define AFEC_IER_EOC5 (0x1u << 5) /**< \brief (AFEC_IER) End of Conversion Interrupt Enable 5 */ -#define AFEC_IER_EOC6 (0x1u << 6) /**< \brief (AFEC_IER) End of Conversion Interrupt Enable 6 */ -#define AFEC_IER_EOC7 (0x1u << 7) /**< \brief (AFEC_IER) End of Conversion Interrupt Enable 7 */ -#define AFEC_IER_EOC8 (0x1u << 8) /**< \brief (AFEC_IER) End of Conversion Interrupt Enable 8 */ -#define AFEC_IER_EOC9 (0x1u << 9) /**< \brief (AFEC_IER) End of Conversion Interrupt Enable 9 */ -#define AFEC_IER_EOC10 (0x1u << 10) /**< \brief (AFEC_IER) End of Conversion Interrupt Enable 10 */ -#define AFEC_IER_EOC11 (0x1u << 11) /**< \brief (AFEC_IER) End of Conversion Interrupt Enable 11 */ -#define AFEC_IER_DRDY (0x1u << 24) /**< \brief (AFEC_IER) Data Ready Interrupt Enable */ -#define AFEC_IER_GOVRE (0x1u << 25) /**< \brief (AFEC_IER) General Overrun Error Interrupt Enable */ -#define AFEC_IER_COMPE (0x1u << 26) /**< \brief (AFEC_IER) Comparison Event Interrupt Enable */ -#define AFEC_IER_TEMPCHG (0x1u << 30) /**< \brief (AFEC_IER) Temperature Change Interrupt Enable */ -/* -------- AFEC_IDR : (AFEC Offset: 0x28) AFEC Interrupt Disable Register -------- */ -#define AFEC_IDR_EOC0 (0x1u << 0) /**< \brief (AFEC_IDR) End of Conversion Interrupt Disable 0 */ -#define AFEC_IDR_EOC1 (0x1u << 1) /**< \brief (AFEC_IDR) End of Conversion Interrupt Disable 1 */ -#define AFEC_IDR_EOC2 (0x1u << 2) /**< \brief (AFEC_IDR) End of Conversion Interrupt Disable 2 */ -#define AFEC_IDR_EOC3 (0x1u << 3) /**< \brief (AFEC_IDR) End of Conversion Interrupt Disable 3 */ -#define AFEC_IDR_EOC4 (0x1u << 4) /**< \brief (AFEC_IDR) End of Conversion Interrupt Disable 4 */ -#define AFEC_IDR_EOC5 (0x1u << 5) /**< \brief (AFEC_IDR) End of Conversion Interrupt Disable 5 */ -#define AFEC_IDR_EOC6 (0x1u << 6) /**< \brief (AFEC_IDR) End of Conversion Interrupt Disable 6 */ -#define AFEC_IDR_EOC7 (0x1u << 7) /**< \brief (AFEC_IDR) End of Conversion Interrupt Disable 7 */ -#define AFEC_IDR_EOC8 (0x1u << 8) /**< \brief (AFEC_IDR) End of Conversion Interrupt Disable 8 */ -#define AFEC_IDR_EOC9 (0x1u << 9) /**< \brief (AFEC_IDR) End of Conversion Interrupt Disable 9 */ -#define AFEC_IDR_EOC10 (0x1u << 10) /**< \brief (AFEC_IDR) End of Conversion Interrupt Disable 10 */ -#define AFEC_IDR_EOC11 (0x1u << 11) /**< \brief (AFEC_IDR) End of Conversion Interrupt Disable 11 */ -#define AFEC_IDR_DRDY (0x1u << 24) /**< \brief (AFEC_IDR) Data Ready Interrupt Disable */ -#define AFEC_IDR_GOVRE (0x1u << 25) /**< \brief (AFEC_IDR) General Overrun Error Interrupt Disable */ -#define AFEC_IDR_COMPE (0x1u << 26) /**< \brief (AFEC_IDR) Comparison Event Interrupt Disable */ -#define AFEC_IDR_TEMPCHG (0x1u << 30) /**< \brief (AFEC_IDR) Temperature Change Interrupt Disable */ -/* -------- AFEC_IMR : (AFEC Offset: 0x2C) AFEC Interrupt Mask Register -------- */ -#define AFEC_IMR_EOC0 (0x1u << 0) /**< \brief (AFEC_IMR) End of Conversion Interrupt Mask 0 */ -#define AFEC_IMR_EOC1 (0x1u << 1) /**< \brief (AFEC_IMR) End of Conversion Interrupt Mask 1 */ -#define AFEC_IMR_EOC2 (0x1u << 2) /**< \brief (AFEC_IMR) End of Conversion Interrupt Mask 2 */ -#define AFEC_IMR_EOC3 (0x1u << 3) /**< \brief (AFEC_IMR) End of Conversion Interrupt Mask 3 */ -#define AFEC_IMR_EOC4 (0x1u << 4) /**< \brief (AFEC_IMR) End of Conversion Interrupt Mask 4 */ -#define AFEC_IMR_EOC5 (0x1u << 5) /**< \brief (AFEC_IMR) End of Conversion Interrupt Mask 5 */ -#define AFEC_IMR_EOC6 (0x1u << 6) /**< \brief (AFEC_IMR) End of Conversion Interrupt Mask 6 */ -#define AFEC_IMR_EOC7 (0x1u << 7) /**< \brief (AFEC_IMR) End of Conversion Interrupt Mask 7 */ -#define AFEC_IMR_EOC8 (0x1u << 8) /**< \brief (AFEC_IMR) End of Conversion Interrupt Mask 8 */ -#define AFEC_IMR_EOC9 (0x1u << 9) /**< \brief (AFEC_IMR) End of Conversion Interrupt Mask 9 */ -#define AFEC_IMR_EOC10 (0x1u << 10) /**< \brief (AFEC_IMR) End of Conversion Interrupt Mask 10 */ -#define AFEC_IMR_EOC11 (0x1u << 11) /**< \brief (AFEC_IMR) End of Conversion Interrupt Mask 11 */ -#define AFEC_IMR_DRDY (0x1u << 24) /**< \brief (AFEC_IMR) Data Ready Interrupt Mask */ -#define AFEC_IMR_GOVRE (0x1u << 25) /**< \brief (AFEC_IMR) General Overrun Error Interrupt Mask */ -#define AFEC_IMR_COMPE (0x1u << 26) /**< \brief (AFEC_IMR) Comparison Event Interrupt Mask */ -#define AFEC_IMR_TEMPCHG (0x1u << 30) /**< \brief (AFEC_IMR) Temperature Change Interrupt Mask */ -/* -------- AFEC_ISR : (AFEC Offset: 0x30) AFEC Interrupt Status Register -------- */ -#define AFEC_ISR_EOC0 (0x1u << 0) /**< \brief (AFEC_ISR) End of Conversion 0 (cleared by reading AFEC_CDRx) */ -#define AFEC_ISR_EOC1 (0x1u << 1) /**< \brief (AFEC_ISR) End of Conversion 1 (cleared by reading AFEC_CDRx) */ -#define AFEC_ISR_EOC2 (0x1u << 2) /**< \brief (AFEC_ISR) End of Conversion 2 (cleared by reading AFEC_CDRx) */ -#define AFEC_ISR_EOC3 (0x1u << 3) /**< \brief (AFEC_ISR) End of Conversion 3 (cleared by reading AFEC_CDRx) */ -#define AFEC_ISR_EOC4 (0x1u << 4) /**< \brief (AFEC_ISR) End of Conversion 4 (cleared by reading AFEC_CDRx) */ -#define AFEC_ISR_EOC5 (0x1u << 5) /**< \brief (AFEC_ISR) End of Conversion 5 (cleared by reading AFEC_CDRx) */ -#define AFEC_ISR_EOC6 (0x1u << 6) /**< \brief (AFEC_ISR) End of Conversion 6 (cleared by reading AFEC_CDRx) */ -#define AFEC_ISR_EOC7 (0x1u << 7) /**< \brief (AFEC_ISR) End of Conversion 7 (cleared by reading AFEC_CDRx) */ -#define AFEC_ISR_EOC8 (0x1u << 8) /**< \brief (AFEC_ISR) End of Conversion 8 (cleared by reading AFEC_CDRx) */ -#define AFEC_ISR_EOC9 (0x1u << 9) /**< \brief (AFEC_ISR) End of Conversion 9 (cleared by reading AFEC_CDRx) */ -#define AFEC_ISR_EOC10 (0x1u << 10) /**< \brief (AFEC_ISR) End of Conversion 10 (cleared by reading AFEC_CDRx) */ -#define AFEC_ISR_EOC11 (0x1u << 11) /**< \brief (AFEC_ISR) End of Conversion 11 (cleared by reading AFEC_CDRx) */ -#define AFEC_ISR_DRDY (0x1u << 24) /**< \brief (AFEC_ISR) Data Ready (cleared by reading AFEC_LCDR) */ -#define AFEC_ISR_GOVRE (0x1u << 25) /**< \brief (AFEC_ISR) General Overrun Error (cleared by reading AFEC_ISR) */ -#define AFEC_ISR_COMPE (0x1u << 26) /**< \brief (AFEC_ISR) Comparison Error (cleared by reading AFEC_ISR) */ -#define AFEC_ISR_TEMPCHG (0x1u << 30) /**< \brief (AFEC_ISR) Temperature Change (cleared on read) */ -/* -------- AFEC_OVER : (AFEC Offset: 0x4C) AFEC Overrun Status Register -------- */ -#define AFEC_OVER_OVRE0 (0x1u << 0) /**< \brief (AFEC_OVER) Overrun Error 0 */ -#define AFEC_OVER_OVRE1 (0x1u << 1) /**< \brief (AFEC_OVER) Overrun Error 1 */ -#define AFEC_OVER_OVRE2 (0x1u << 2) /**< \brief (AFEC_OVER) Overrun Error 2 */ -#define AFEC_OVER_OVRE3 (0x1u << 3) /**< \brief (AFEC_OVER) Overrun Error 3 */ -#define AFEC_OVER_OVRE4 (0x1u << 4) /**< \brief (AFEC_OVER) Overrun Error 4 */ -#define AFEC_OVER_OVRE5 (0x1u << 5) /**< \brief (AFEC_OVER) Overrun Error 5 */ -#define AFEC_OVER_OVRE6 (0x1u << 6) /**< \brief (AFEC_OVER) Overrun Error 6 */ -#define AFEC_OVER_OVRE7 (0x1u << 7) /**< \brief (AFEC_OVER) Overrun Error 7 */ -#define AFEC_OVER_OVRE8 (0x1u << 8) /**< \brief (AFEC_OVER) Overrun Error 8 */ -#define AFEC_OVER_OVRE9 (0x1u << 9) /**< \brief (AFEC_OVER) Overrun Error 9 */ -#define AFEC_OVER_OVRE10 (0x1u << 10) /**< \brief (AFEC_OVER) Overrun Error 10 */ -#define AFEC_OVER_OVRE11 (0x1u << 11) /**< \brief (AFEC_OVER) Overrun Error 11 */ -/* -------- AFEC_CWR : (AFEC Offset: 0x50) AFEC Compare Window Register -------- */ -#define AFEC_CWR_LOWTHRES_Pos 0 -#define AFEC_CWR_LOWTHRES_Msk (0xffffu << AFEC_CWR_LOWTHRES_Pos) /**< \brief (AFEC_CWR) Low Threshold */ -#define AFEC_CWR_LOWTHRES(value) ((AFEC_CWR_LOWTHRES_Msk & ((value) << AFEC_CWR_LOWTHRES_Pos))) -#define AFEC_CWR_HIGHTHRES_Pos 16 -#define AFEC_CWR_HIGHTHRES_Msk (0xffffu << AFEC_CWR_HIGHTHRES_Pos) /**< \brief (AFEC_CWR) High Threshold */ -#define AFEC_CWR_HIGHTHRES(value) ((AFEC_CWR_HIGHTHRES_Msk & ((value) << AFEC_CWR_HIGHTHRES_Pos))) -/* -------- AFEC_CGR : (AFEC Offset: 0x54) AFEC Channel Gain Register -------- */ -#define AFEC_CGR_GAIN0_Pos 0 -#define AFEC_CGR_GAIN0_Msk (0x3u << AFEC_CGR_GAIN0_Pos) /**< \brief (AFEC_CGR) Gain for Channel 0 */ -#define AFEC_CGR_GAIN0(value) ((AFEC_CGR_GAIN0_Msk & ((value) << AFEC_CGR_GAIN0_Pos))) -#define AFEC_CGR_GAIN1_Pos 2 -#define AFEC_CGR_GAIN1_Msk (0x3u << AFEC_CGR_GAIN1_Pos) /**< \brief (AFEC_CGR) Gain for Channel 1 */ -#define AFEC_CGR_GAIN1(value) ((AFEC_CGR_GAIN1_Msk & ((value) << AFEC_CGR_GAIN1_Pos))) -#define AFEC_CGR_GAIN2_Pos 4 -#define AFEC_CGR_GAIN2_Msk (0x3u << AFEC_CGR_GAIN2_Pos) /**< \brief (AFEC_CGR) Gain for Channel 2 */ -#define AFEC_CGR_GAIN2(value) ((AFEC_CGR_GAIN2_Msk & ((value) << AFEC_CGR_GAIN2_Pos))) -#define AFEC_CGR_GAIN3_Pos 6 -#define AFEC_CGR_GAIN3_Msk (0x3u << AFEC_CGR_GAIN3_Pos) /**< \brief (AFEC_CGR) Gain for Channel 3 */ -#define AFEC_CGR_GAIN3(value) ((AFEC_CGR_GAIN3_Msk & ((value) << AFEC_CGR_GAIN3_Pos))) -#define AFEC_CGR_GAIN4_Pos 8 -#define AFEC_CGR_GAIN4_Msk (0x3u << AFEC_CGR_GAIN4_Pos) /**< \brief (AFEC_CGR) Gain for Channel 4 */ -#define AFEC_CGR_GAIN4(value) ((AFEC_CGR_GAIN4_Msk & ((value) << AFEC_CGR_GAIN4_Pos))) -#define AFEC_CGR_GAIN5_Pos 10 -#define AFEC_CGR_GAIN5_Msk (0x3u << AFEC_CGR_GAIN5_Pos) /**< \brief (AFEC_CGR) Gain for Channel 5 */ -#define AFEC_CGR_GAIN5(value) ((AFEC_CGR_GAIN5_Msk & ((value) << AFEC_CGR_GAIN5_Pos))) -#define AFEC_CGR_GAIN6_Pos 12 -#define AFEC_CGR_GAIN6_Msk (0x3u << AFEC_CGR_GAIN6_Pos) /**< \brief (AFEC_CGR) Gain for Channel 6 */ -#define AFEC_CGR_GAIN6(value) ((AFEC_CGR_GAIN6_Msk & ((value) << AFEC_CGR_GAIN6_Pos))) -#define AFEC_CGR_GAIN7_Pos 14 -#define AFEC_CGR_GAIN7_Msk (0x3u << AFEC_CGR_GAIN7_Pos) /**< \brief (AFEC_CGR) Gain for Channel 7 */ -#define AFEC_CGR_GAIN7(value) ((AFEC_CGR_GAIN7_Msk & ((value) << AFEC_CGR_GAIN7_Pos))) -#define AFEC_CGR_GAIN8_Pos 16 -#define AFEC_CGR_GAIN8_Msk (0x3u << AFEC_CGR_GAIN8_Pos) /**< \brief (AFEC_CGR) Gain for Channel 8 */ -#define AFEC_CGR_GAIN8(value) ((AFEC_CGR_GAIN8_Msk & ((value) << AFEC_CGR_GAIN8_Pos))) -#define AFEC_CGR_GAIN9_Pos 18 -#define AFEC_CGR_GAIN9_Msk (0x3u << AFEC_CGR_GAIN9_Pos) /**< \brief (AFEC_CGR) Gain for Channel 9 */ -#define AFEC_CGR_GAIN9(value) ((AFEC_CGR_GAIN9_Msk & ((value) << AFEC_CGR_GAIN9_Pos))) -#define AFEC_CGR_GAIN10_Pos 20 -#define AFEC_CGR_GAIN10_Msk (0x3u << AFEC_CGR_GAIN10_Pos) /**< \brief (AFEC_CGR) Gain for Channel 10 */ -#define AFEC_CGR_GAIN10(value) ((AFEC_CGR_GAIN10_Msk & ((value) << AFEC_CGR_GAIN10_Pos))) -#define AFEC_CGR_GAIN11_Pos 22 -#define AFEC_CGR_GAIN11_Msk (0x3u << AFEC_CGR_GAIN11_Pos) /**< \brief (AFEC_CGR) Gain for Channel 11 */ -#define AFEC_CGR_GAIN11(value) ((AFEC_CGR_GAIN11_Msk & ((value) << AFEC_CGR_GAIN11_Pos))) -/* -------- AFEC_DIFFR : (AFEC Offset: 0x60) AFEC Channel Differential Register -------- */ -#define AFEC_DIFFR_DIFF0 (0x1u << 0) /**< \brief (AFEC_DIFFR) Differential inputs for channel 0 */ -#define AFEC_DIFFR_DIFF1 (0x1u << 1) /**< \brief (AFEC_DIFFR) Differential inputs for channel 1 */ -#define AFEC_DIFFR_DIFF2 (0x1u << 2) /**< \brief (AFEC_DIFFR) Differential inputs for channel 2 */ -#define AFEC_DIFFR_DIFF3 (0x1u << 3) /**< \brief (AFEC_DIFFR) Differential inputs for channel 3 */ -#define AFEC_DIFFR_DIFF4 (0x1u << 4) /**< \brief (AFEC_DIFFR) Differential inputs for channel 4 */ -#define AFEC_DIFFR_DIFF5 (0x1u << 5) /**< \brief (AFEC_DIFFR) Differential inputs for channel 5 */ -#define AFEC_DIFFR_DIFF6 (0x1u << 6) /**< \brief (AFEC_DIFFR) Differential inputs for channel 6 */ -#define AFEC_DIFFR_DIFF7 (0x1u << 7) /**< \brief (AFEC_DIFFR) Differential inputs for channel 7 */ -#define AFEC_DIFFR_DIFF8 (0x1u << 8) /**< \brief (AFEC_DIFFR) Differential inputs for channel 8 */ -#define AFEC_DIFFR_DIFF9 (0x1u << 9) /**< \brief (AFEC_DIFFR) Differential inputs for channel 9 */ -#define AFEC_DIFFR_DIFF10 (0x1u << 10) /**< \brief (AFEC_DIFFR) Differential inputs for channel 10 */ -#define AFEC_DIFFR_DIFF11 (0x1u << 11) /**< \brief (AFEC_DIFFR) Differential inputs for channel 11 */ -/* -------- AFEC_CSELR : (AFEC Offset: 0x64) AFEC Channel Selection Register -------- */ -#define AFEC_CSELR_CSEL_Pos 0 -#define AFEC_CSELR_CSEL_Msk (0xfu << AFEC_CSELR_CSEL_Pos) /**< \brief (AFEC_CSELR) Channel Selection */ -#define AFEC_CSELR_CSEL(value) ((AFEC_CSELR_CSEL_Msk & ((value) << AFEC_CSELR_CSEL_Pos))) -/* -------- AFEC_CDR : (AFEC Offset: 0x68) AFEC Channel Data Register -------- */ -#define AFEC_CDR_DATA_Pos 0 -#define AFEC_CDR_DATA_Msk (0xffffu << AFEC_CDR_DATA_Pos) /**< \brief (AFEC_CDR) Converted Data */ -/* -------- AFEC_COCR : (AFEC Offset: 0x6C) AFEC Channel Offset Compensation Register -------- */ -#define AFEC_COCR_AOFF_Pos 0 -#define AFEC_COCR_AOFF_Msk (0xfffu << AFEC_COCR_AOFF_Pos) /**< \brief (AFEC_COCR) Analog Offset */ -#define AFEC_COCR_AOFF(value) ((AFEC_COCR_AOFF_Msk & ((value) << AFEC_COCR_AOFF_Pos))) -/* -------- AFEC_TEMPMR : (AFEC Offset: 0x70) AFEC Temperature Sensor Mode Register -------- */ -#define AFEC_TEMPMR_RTCT (0x1u << 0) /**< \brief (AFEC_TEMPMR) Temperature Sensor RTC Trigger Mode */ -#define AFEC_TEMPMR_TEMPCMPMOD_Pos 4 -#define AFEC_TEMPMR_TEMPCMPMOD_Msk (0x3u << AFEC_TEMPMR_TEMPCMPMOD_Pos) /**< \brief (AFEC_TEMPMR) Temperature Comparison Mode */ -#define AFEC_TEMPMR_TEMPCMPMOD(value) ((AFEC_TEMPMR_TEMPCMPMOD_Msk & ((value) << AFEC_TEMPMR_TEMPCMPMOD_Pos))) -#define AFEC_TEMPMR_TEMPCMPMOD_LOW (0x0u << 4) /**< \brief (AFEC_TEMPMR) Generates an event when the converted data is lower than the low threshold of the window. */ -#define AFEC_TEMPMR_TEMPCMPMOD_HIGH (0x1u << 4) /**< \brief (AFEC_TEMPMR) Generates an event when the converted data is higher than the high threshold of the window. */ -#define AFEC_TEMPMR_TEMPCMPMOD_IN (0x2u << 4) /**< \brief (AFEC_TEMPMR) Generates an event when the converted data is in the comparison window. */ -#define AFEC_TEMPMR_TEMPCMPMOD_OUT (0x3u << 4) /**< \brief (AFEC_TEMPMR) Generates an event when the converted data is out of the comparison window. */ -/* -------- AFEC_TEMPCWR : (AFEC Offset: 0x74) AFEC Temperature Compare Window Register -------- */ -#define AFEC_TEMPCWR_TLOWTHRES_Pos 0 -#define AFEC_TEMPCWR_TLOWTHRES_Msk (0xffffu << AFEC_TEMPCWR_TLOWTHRES_Pos) /**< \brief (AFEC_TEMPCWR) Temperature Low Threshold */ -#define AFEC_TEMPCWR_TLOWTHRES(value) ((AFEC_TEMPCWR_TLOWTHRES_Msk & ((value) << AFEC_TEMPCWR_TLOWTHRES_Pos))) -#define AFEC_TEMPCWR_THIGHTHRES_Pos 16 -#define AFEC_TEMPCWR_THIGHTHRES_Msk (0xffffu << AFEC_TEMPCWR_THIGHTHRES_Pos) /**< \brief (AFEC_TEMPCWR) Temperature High Threshold */ -#define AFEC_TEMPCWR_THIGHTHRES(value) ((AFEC_TEMPCWR_THIGHTHRES_Msk & ((value) << AFEC_TEMPCWR_THIGHTHRES_Pos))) -/* -------- AFEC_ACR : (AFEC Offset: 0x94) AFEC Analog Control Register -------- */ -#define AFEC_ACR_PGA0EN (0x1u << 2) /**< \brief (AFEC_ACR) PGA0 Enable */ -#define AFEC_ACR_PGA1EN (0x1u << 3) /**< \brief (AFEC_ACR) PGA1 Enable */ -#define AFEC_ACR_IBCTL_Pos 8 -#define AFEC_ACR_IBCTL_Msk (0x3u << AFEC_ACR_IBCTL_Pos) /**< \brief (AFEC_ACR) AFE Bias Current Control */ -#define AFEC_ACR_IBCTL(value) ((AFEC_ACR_IBCTL_Msk & ((value) << AFEC_ACR_IBCTL_Pos))) -/* -------- AFEC_SHMR : (AFEC Offset: 0xA0) AFEC Sample & Hold Mode Register -------- */ -#define AFEC_SHMR_DUAL0 (0x1u << 0) /**< \brief (AFEC_SHMR) Dual Sample & Hold for channel 0 */ -#define AFEC_SHMR_DUAL1 (0x1u << 1) /**< \brief (AFEC_SHMR) Dual Sample & Hold for channel 1 */ -#define AFEC_SHMR_DUAL2 (0x1u << 2) /**< \brief (AFEC_SHMR) Dual Sample & Hold for channel 2 */ -#define AFEC_SHMR_DUAL3 (0x1u << 3) /**< \brief (AFEC_SHMR) Dual Sample & Hold for channel 3 */ -#define AFEC_SHMR_DUAL4 (0x1u << 4) /**< \brief (AFEC_SHMR) Dual Sample & Hold for channel 4 */ -#define AFEC_SHMR_DUAL5 (0x1u << 5) /**< \brief (AFEC_SHMR) Dual Sample & Hold for channel 5 */ -#define AFEC_SHMR_DUAL6 (0x1u << 6) /**< \brief (AFEC_SHMR) Dual Sample & Hold for channel 6 */ -#define AFEC_SHMR_DUAL7 (0x1u << 7) /**< \brief (AFEC_SHMR) Dual Sample & Hold for channel 7 */ -#define AFEC_SHMR_DUAL8 (0x1u << 8) /**< \brief (AFEC_SHMR) Dual Sample & Hold for channel 8 */ -#define AFEC_SHMR_DUAL9 (0x1u << 9) /**< \brief (AFEC_SHMR) Dual Sample & Hold for channel 9 */ -#define AFEC_SHMR_DUAL10 (0x1u << 10) /**< \brief (AFEC_SHMR) Dual Sample & Hold for channel 10 */ -#define AFEC_SHMR_DUAL11 (0x1u << 11) /**< \brief (AFEC_SHMR) Dual Sample & Hold for channel 11 */ -/* -------- AFEC_COSR : (AFEC Offset: 0xD0) AFEC Correction Select Register -------- */ -#define AFEC_COSR_CSEL (0x1u << 0) /**< \brief (AFEC_COSR) Sample & Hold unit Correction Select */ -/* -------- AFEC_CVR : (AFEC Offset: 0xD4) AFEC Correction Values Register -------- */ -#define AFEC_CVR_OFFSETCORR_Pos 0 -#define AFEC_CVR_OFFSETCORR_Msk (0xffffu << AFEC_CVR_OFFSETCORR_Pos) /**< \brief (AFEC_CVR) Offset Correction */ -#define AFEC_CVR_OFFSETCORR(value) ((AFEC_CVR_OFFSETCORR_Msk & ((value) << AFEC_CVR_OFFSETCORR_Pos))) -#define AFEC_CVR_GAINCORR_Pos 16 -#define AFEC_CVR_GAINCORR_Msk (0xffffu << AFEC_CVR_GAINCORR_Pos) /**< \brief (AFEC_CVR) Gain Correction */ -#define AFEC_CVR_GAINCORR(value) ((AFEC_CVR_GAINCORR_Msk & ((value) << AFEC_CVR_GAINCORR_Pos))) -/* -------- AFEC_CECR : (AFEC Offset: 0xD8) AFEC Channel Error Correction Register -------- */ -#define AFEC_CECR_ECORR0 (0x1u << 0) /**< \brief (AFEC_CECR) Error Correction Enable for channel 0 */ -#define AFEC_CECR_ECORR1 (0x1u << 1) /**< \brief (AFEC_CECR) Error Correction Enable for channel 1 */ -#define AFEC_CECR_ECORR2 (0x1u << 2) /**< \brief (AFEC_CECR) Error Correction Enable for channel 2 */ -#define AFEC_CECR_ECORR3 (0x1u << 3) /**< \brief (AFEC_CECR) Error Correction Enable for channel 3 */ -#define AFEC_CECR_ECORR4 (0x1u << 4) /**< \brief (AFEC_CECR) Error Correction Enable for channel 4 */ -#define AFEC_CECR_ECORR5 (0x1u << 5) /**< \brief (AFEC_CECR) Error Correction Enable for channel 5 */ -#define AFEC_CECR_ECORR6 (0x1u << 6) /**< \brief (AFEC_CECR) Error Correction Enable for channel 6 */ -#define AFEC_CECR_ECORR7 (0x1u << 7) /**< \brief (AFEC_CECR) Error Correction Enable for channel 7 */ -#define AFEC_CECR_ECORR8 (0x1u << 8) /**< \brief (AFEC_CECR) Error Correction Enable for channel 8 */ -#define AFEC_CECR_ECORR9 (0x1u << 9) /**< \brief (AFEC_CECR) Error Correction Enable for channel 9 */ -#define AFEC_CECR_ECORR10 (0x1u << 10) /**< \brief (AFEC_CECR) Error Correction Enable for channel 10 */ -#define AFEC_CECR_ECORR11 (0x1u << 11) /**< \brief (AFEC_CECR) Error Correction Enable for channel 11 */ -/* -------- AFEC_WPMR : (AFEC Offset: 0xE4) AFEC Write Protection Mode Register -------- */ -#define AFEC_WPMR_WPEN (0x1u << 0) /**< \brief (AFEC_WPMR) Write Protection Enable */ -#define AFEC_WPMR_WPKEY_Pos 8 -#define AFEC_WPMR_WPKEY_Msk (0xffffffu << AFEC_WPMR_WPKEY_Pos) /**< \brief (AFEC_WPMR) Write Protect KEY */ -#define AFEC_WPMR_WPKEY(value) ((AFEC_WPMR_WPKEY_Msk & ((value) << AFEC_WPMR_WPKEY_Pos))) -#define AFEC_WPMR_WPKEY_PASSWD (0x414443u << 8) /**< \brief (AFEC_WPMR) Writing any other value in this field aborts the write operation of the WPEN bit. Always reads as 0. */ -/* -------- AFEC_WPSR : (AFEC Offset: 0xE8) AFEC Write Protection Status Register -------- */ -#define AFEC_WPSR_WPVS (0x1u << 0) /**< \brief (AFEC_WPSR) Write Protect Violation Status */ -#define AFEC_WPSR_WPVSRC_Pos 8 -#define AFEC_WPSR_WPVSRC_Msk (0xffffu << AFEC_WPSR_WPVSRC_Pos) /**< \brief (AFEC_WPSR) Write Protect Violation Source */ - -/*@}*/ - - -#endif /* _SAMV71_AFEC_COMPONENT_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_chipid.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_chipid.h deleted file mode 100644 index c9571829..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_chipid.h +++ /dev/null @@ -1,123 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_CHIPID_COMPONENT_ -#define _SAMV71_CHIPID_COMPONENT_ - -/* ============================================================================= */ -/** SOFTWARE API DEFINITION FOR Chip Identifier */ -/* ============================================================================= */ -/** \addtogroup SAMV71_CHIPID Chip Identifier */ -/*@{*/ - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -/** \brief Chipid hardware registers */ -typedef struct { - __I uint32_t CHIPID_CIDR; /**< \brief (Chipid Offset: 0x0) Chip ID Register */ - __I uint32_t CHIPID_EXID; /**< \brief (Chipid Offset: 0x4) Chip ID Extension Register */ -} Chipid; -#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/* -------- CHIPID_CIDR : (CHIPID Offset: 0x0) Chip ID Register -------- */ -#define CHIPID_CIDR_VERSION_Pos 0 -#define CHIPID_CIDR_VERSION_Msk (0x1fu << CHIPID_CIDR_VERSION_Pos) /**< \brief (CHIPID_CIDR) Version of the Device */ -#define CHIPID_CIDR_EPROC_Pos 5 -#define CHIPID_CIDR_EPROC_Msk (0x7u << CHIPID_CIDR_EPROC_Pos) /**< \brief (CHIPID_CIDR) Embedded Processor */ -#define CHIPID_CIDR_EPROC_SAMx7 (0x0u << 5) /**< \brief (CHIPID_CIDR) Cortex-M7 */ -#define CHIPID_CIDR_EPROC_ARM946ES (0x1u << 5) /**< \brief (CHIPID_CIDR) ARM946ES */ -#define CHIPID_CIDR_EPROC_ARM7TDMI (0x2u << 5) /**< \brief (CHIPID_CIDR) ARM7TDMI */ -#define CHIPID_CIDR_EPROC_CM3 (0x3u << 5) /**< \brief (CHIPID_CIDR) Cortex-M3 */ -#define CHIPID_CIDR_EPROC_ARM920T (0x4u << 5) /**< \brief (CHIPID_CIDR) ARM920T */ -#define CHIPID_CIDR_EPROC_ARM926EJS (0x5u << 5) /**< \brief (CHIPID_CIDR) ARM926EJS */ -#define CHIPID_CIDR_EPROC_CA5 (0x6u << 5) /**< \brief (CHIPID_CIDR) Cortex-A5 */ -#define CHIPID_CIDR_EPROC_CM4 (0x7u << 5) /**< \brief (CHIPID_CIDR) Cortex-M4 */ -#define CHIPID_CIDR_NVPSIZ_Pos 8 -#define CHIPID_CIDR_NVPSIZ_Msk (0xfu << CHIPID_CIDR_NVPSIZ_Pos) /**< \brief (CHIPID_CIDR) Nonvolatile Program Memory Size */ -#define CHIPID_CIDR_NVPSIZ_NONE (0x0u << 8) /**< \brief (CHIPID_CIDR) None */ -#define CHIPID_CIDR_NVPSIZ_8K (0x1u << 8) /**< \brief (CHIPID_CIDR) 8 Kbytes */ -#define CHIPID_CIDR_NVPSIZ_16K (0x2u << 8) /**< \brief (CHIPID_CIDR) 16 Kbytes */ -#define CHIPID_CIDR_NVPSIZ_32K (0x3u << 8) /**< \brief (CHIPID_CIDR) 32 Kbytes */ -#define CHIPID_CIDR_NVPSIZ_64K (0x5u << 8) /**< \brief (CHIPID_CIDR) 64 Kbytes */ -#define CHIPID_CIDR_NVPSIZ_128K (0x7u << 8) /**< \brief (CHIPID_CIDR) 128 Kbytes */ -#define CHIPID_CIDR_NVPSIZ_160K (0x8u << 8) /**< \brief (CHIPID_CIDR) 160 Kbytes */ -#define CHIPID_CIDR_NVPSIZ_256K (0x9u << 8) /**< \brief (CHIPID_CIDR) 256 Kbytes */ -#define CHIPID_CIDR_NVPSIZ_512K (0xAu << 8) /**< \brief (CHIPID_CIDR) 512 Kbytes */ -#define CHIPID_CIDR_NVPSIZ_1024K (0xCu << 8) /**< \brief (CHIPID_CIDR) 1024 Kbytes */ -#define CHIPID_CIDR_NVPSIZ_2048K (0xEu << 8) /**< \brief (CHIPID_CIDR) 2048 Kbytes */ -#define CHIPID_CIDR_NVPSIZ2_Pos 12 -#define CHIPID_CIDR_NVPSIZ2_Msk (0xfu << CHIPID_CIDR_NVPSIZ2_Pos) /**< \brief (CHIPID_CIDR) Second Nonvolatile Program Memory Size */ -#define CHIPID_CIDR_NVPSIZ2_NONE (0x0u << 12) /**< \brief (CHIPID_CIDR) None */ -#define CHIPID_CIDR_NVPSIZ2_8K (0x1u << 12) /**< \brief (CHIPID_CIDR) 8 Kbytes */ -#define CHIPID_CIDR_NVPSIZ2_16K (0x2u << 12) /**< \brief (CHIPID_CIDR) 16 Kbytes */ -#define CHIPID_CIDR_NVPSIZ2_32K (0x3u << 12) /**< \brief (CHIPID_CIDR) 32 Kbytes */ -#define CHIPID_CIDR_NVPSIZ2_64K (0x5u << 12) /**< \brief (CHIPID_CIDR) 64 Kbytes */ -#define CHIPID_CIDR_NVPSIZ2_128K (0x7u << 12) /**< \brief (CHIPID_CIDR) 128 Kbytes */ -#define CHIPID_CIDR_NVPSIZ2_256K (0x9u << 12) /**< \brief (CHIPID_CIDR) 256 Kbytes */ -#define CHIPID_CIDR_NVPSIZ2_512K (0xAu << 12) /**< \brief (CHIPID_CIDR) 512 Kbytes */ -#define CHIPID_CIDR_NVPSIZ2_1024K (0xCu << 12) /**< \brief (CHIPID_CIDR) 1024 Kbytes */ -#define CHIPID_CIDR_NVPSIZ2_2048K (0xEu << 12) /**< \brief (CHIPID_CIDR) 2048 Kbytes */ -#define CHIPID_CIDR_SRAMSIZ_Pos 16 -#define CHIPID_CIDR_SRAMSIZ_Msk (0xfu << CHIPID_CIDR_SRAMSIZ_Pos) /**< \brief (CHIPID_CIDR) Internal SRAM Size */ -#define CHIPID_CIDR_SRAMSIZ_48K (0x0u << 16) /**< \brief (CHIPID_CIDR) 48 Kbytes */ -#define CHIPID_CIDR_SRAMSIZ_192K (0x1u << 16) /**< \brief (CHIPID_CIDR) 192 Kbytes */ -#define CHIPID_CIDR_SRAMSIZ_384K (0x2u << 16) /**< \brief (CHIPID_CIDR) 384 Kbytes */ -#define CHIPID_CIDR_SRAMSIZ_6K (0x3u << 16) /**< \brief (CHIPID_CIDR) 6 Kbytes */ -#define CHIPID_CIDR_SRAMSIZ_24K (0x4u << 16) /**< \brief (CHIPID_CIDR) 24 Kbytes */ -#define CHIPID_CIDR_SRAMSIZ_4K (0x5u << 16) /**< \brief (CHIPID_CIDR) 4 Kbytes */ -#define CHIPID_CIDR_SRAMSIZ_80K (0x6u << 16) /**< \brief (CHIPID_CIDR) 80 Kbytes */ -#define CHIPID_CIDR_SRAMSIZ_160K (0x7u << 16) /**< \brief (CHIPID_CIDR) 160 Kbytes */ -#define CHIPID_CIDR_SRAMSIZ_8K (0x8u << 16) /**< \brief (CHIPID_CIDR) 8 Kbytes */ -#define CHIPID_CIDR_SRAMSIZ_16K (0x9u << 16) /**< \brief (CHIPID_CIDR) 16 Kbytes */ -#define CHIPID_CIDR_SRAMSIZ_32K (0xAu << 16) /**< \brief (CHIPID_CIDR) 32 Kbytes */ -#define CHIPID_CIDR_SRAMSIZ_64K (0xBu << 16) /**< \brief (CHIPID_CIDR) 64 Kbytes */ -#define CHIPID_CIDR_SRAMSIZ_128K (0xCu << 16) /**< \brief (CHIPID_CIDR) 128 Kbytes */ -#define CHIPID_CIDR_SRAMSIZ_256K (0xDu << 16) /**< \brief (CHIPID_CIDR) 256 Kbytes */ -#define CHIPID_CIDR_SRAMSIZ_96K (0xEu << 16) /**< \brief (CHIPID_CIDR) 96 Kbytes */ -#define CHIPID_CIDR_SRAMSIZ_512K (0xFu << 16) /**< \brief (CHIPID_CIDR) 512 Kbytes */ -#define CHIPID_CIDR_ARCH_Pos 20 -#define CHIPID_CIDR_ARCH_Msk (0xffu << CHIPID_CIDR_ARCH_Pos) /**< \brief (CHIPID_CIDR) Architecture Identifier */ -#define CHIPID_CIDR_ARCH_SAME70 (0x10u << 20) /**< \brief (CHIPID_CIDR) SAM E70 */ -#define CHIPID_CIDR_ARCH_SAMS70 (0x11u << 20) /**< \brief (CHIPID_CIDR) SAM S70 */ -#define CHIPID_CIDR_ARCH_SAMV71 (0x12u << 20) /**< \brief (CHIPID_CIDR) SAM V71 */ -#define CHIPID_CIDR_ARCH_SAMV70 (0x13u << 20) /**< \brief (CHIPID_CIDR) SAM V70 */ -#define CHIPID_CIDR_NVPTYP_Pos 28 -#define CHIPID_CIDR_NVPTYP_Msk (0x7u << CHIPID_CIDR_NVPTYP_Pos) /**< \brief (CHIPID_CIDR) Nonvolatile Program Memory Type */ -#define CHIPID_CIDR_NVPTYP_ROM (0x0u << 28) /**< \brief (CHIPID_CIDR) ROM */ -#define CHIPID_CIDR_NVPTYP_ROMLESS (0x1u << 28) /**< \brief (CHIPID_CIDR) ROMless or on-chip Flash */ -#define CHIPID_CIDR_NVPTYP_FLASH (0x2u << 28) /**< \brief (CHIPID_CIDR) Embedded Flash Memory */ -#define CHIPID_CIDR_NVPTYP_ROM_FLASH (0x3u << 28) /**< \brief (CHIPID_CIDR) ROM and Embedded Flash Memory- NVPSIZ is ROM size- NVPSIZ2 is Flash size */ -#define CHIPID_CIDR_NVPTYP_SRAM (0x4u << 28) /**< \brief (CHIPID_CIDR) SRAM emulating ROM */ -#define CHIPID_CIDR_EXT (0x1u << 31) /**< \brief (CHIPID_CIDR) Extension Flag */ -/* -------- CHIPID_EXID : (CHIPID Offset: 0x4) Chip ID Extension Register -------- */ -#define CHIPID_EXID_EXID_Pos 0 -#define CHIPID_EXID_EXID_Msk (0xffffffffu << CHIPID_EXID_EXID_Pos) /**< \brief (CHIPID_EXID) Chip ID Extension */ - -/*@}*/ - - -#endif /* _SAMV71_CHIPID_COMPONENT_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_dacc.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_dacc.h deleted file mode 100644 index c20cbf38..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_dacc.h +++ /dev/null @@ -1,202 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_DACC_COMPONENT_ -#define _SAMV71_DACC_COMPONENT_ - -/* ============================================================================= */ -/** SOFTWARE API DEFINITION FOR Digital-to-Analog Converter Controller */ -/* ============================================================================= */ -/** \addtogroup SAMV71_DACC Digital-to-Analog Converter Controller */ -/*@{*/ - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -/** \brief Dacc hardware registers */ -typedef struct { - __O uint32_t DACC_CR; /**< \brief (Dacc Offset: 0x00) Control Register */ - __IO uint32_t DACC_MR; /**< \brief (Dacc Offset: 0x04) Mode Register */ - __IO uint32_t DACC_TRIGR; /**< \brief (Dacc Offset: 0x08) Trigger Register */ - __I uint32_t Reserved1[1]; - __O uint32_t DACC_CHER; /**< \brief (Dacc Offset: 0x10) Channel Enable Register */ - __O uint32_t DACC_CHDR; /**< \brief (Dacc Offset: 0x14) Channel Disable Register */ - __I uint32_t DACC_CHSR; /**< \brief (Dacc Offset: 0x18) Channel Status Register */ - __O uint32_t DACC_CDR[2]; /**< \brief (Dacc Offset: 0x1C) Conversion Data Register */ - __O uint32_t DACC_IER; /**< \brief (Dacc Offset: 0x24) Interrupt Enable Register */ - __O uint32_t DACC_IDR; /**< \brief (Dacc Offset: 0x28) Interrupt Disable Register */ - __I uint32_t DACC_IMR; /**< \brief (Dacc Offset: 0x2C) Interrupt Mask Register */ - __I uint32_t DACC_ISR; /**< \brief (Dacc Offset: 0x30) Interrupt Status Register */ - __I uint32_t Reserved2[24]; - __IO uint32_t DACC_ACR; /**< \brief (Dacc Offset: 0x94) Analog Current Register */ - __I uint32_t Reserved3[19]; - __IO uint32_t DACC_WPMR; /**< \brief (Dacc Offset: 0xE4) Write Protection Mode register */ - __I uint32_t DACC_WPSR; /**< \brief (Dacc Offset: 0xE8) Write Protection Status register */ -} Dacc; -#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/* -------- DACC_CR : (DACC Offset: 0x00) Control Register -------- */ -#define DACC_CR_SWRST (0x1u << 0) /**< \brief (DACC_CR) Software Reset */ -/* -------- DACC_MR : (DACC Offset: 0x04) Mode Register -------- */ -#define DACC_MR_MAXS0 (0x1u << 0) /**< \brief (DACC_MR) Max Speed Mode for Channel 0 */ -#define DACC_MR_MAXS0_TRIG_EVENT (0x0u << 0) /**< \brief (DACC_MR) Triggered by selected event */ -#define DACC_MR_MAXS0_MAXIMUM (0x1u << 0) /**< \brief (DACC_MR) Max Speed Mode enabled */ -#define DACC_MR_MAXS1 (0x1u << 1) /**< \brief (DACC_MR) Max Speed Mode for Channel 1 */ -#define DACC_MR_MAXS1_TRIG_EVENT (0x0u << 1) /**< \brief (DACC_MR) Triggered by selected event */ -#define DACC_MR_MAXS1_MAXIMUM (0x1u << 1) /**< \brief (DACC_MR) Max Speed Mode enabled */ -#define DACC_MR_WORD (0x1u << 4) /**< \brief (DACC_MR) Word Transfer Mode */ -#define DACC_MR_WORD_DISABLED (0x0u << 4) /**< \brief (DACC_MR) One data to convert is written to the FIFO per access to DACC */ -#define DACC_MR_WORD_ENABLED (0x1u << 4) /**< \brief (DACC_MR) Two data to convert are written to the FIFO per access to DACC (reduces number of requests to DMA and the number of system bus accesses) */ -#define DACC_MR_REFRESH_Pos 8 -#define DACC_MR_REFRESH_Msk (0xffu << DACC_MR_REFRESH_Pos) /**< \brief (DACC_MR) Refresh Period */ -#define DACC_MR_REFRESH(value) ((DACC_MR_REFRESH_Msk & ((value) << DACC_MR_REFRESH_Pos))) -#define DACC_MR_DIFF (0x1u << 23) /**< \brief (DACC_MR) Differential Mode */ -#define DACC_MR_DIFF_DISABLED (0x0u << 23) /**< \brief (DACC_MR) DAC0 and DAC1 outputs can be separately configured */ -#define DACC_MR_DIFF_ENABLED (0x1u << 23) /**< \brief (DACC_MR) DACP and DACN outputs are configured by the channel 0 value. */ -#define DACC_MR_PRESCALER_Pos 24 -#define DACC_MR_PRESCALER_Msk (0xfu << DACC_MR_PRESCALER_Pos) /**< \brief (DACC_MR) Peripheral Clock to DAC Clock Ratio */ -#define DACC_MR_PRESCALER(value) ((DACC_MR_PRESCALER_Msk & ((value) << DACC_MR_PRESCALER_Pos))) -/* -------- DACC_TRIGR : (DACC Offset: 0x08) Trigger Register -------- */ -#define DACC_TRIGR_TRGEN0 (0x1u << 0) /**< \brief (DACC_TRIGR) Trigger Enable of Channel 0 */ -#define DACC_TRIGR_TRGEN0_DIS (0x0u << 0) /**< \brief (DACC_TRIGR) External trigger mode disabled. DAC is in free running mode. */ -#define DACC_TRIGR_TRGEN0_EN (0x1u << 0) /**< \brief (DACC_TRIGR) External trigger mode enabled. */ -#define DACC_TRIGR_TRGEN1 (0x1u << 1) /**< \brief (DACC_TRIGR) Trigger Enable of Channel 1 */ -#define DACC_TRIGR_TRGEN1_DIS (0x0u << 1) /**< \brief (DACC_TRIGR) External trigger mode disabled. DAC is in free running mode. */ -#define DACC_TRIGR_TRGEN1_EN (0x1u << 1) /**< \brief (DACC_TRIGR) External trigger mode enabled. */ -#define DACC_TRIGR_TRGSEL0_Pos 4 -#define DACC_TRIGR_TRGSEL0_Msk (0x7u << DACC_TRIGR_TRGSEL0_Pos) /**< \brief (DACC_TRIGR) Trigger Selection of Channel 0 */ -#define DACC_TRIGR_TRGSEL0(value) ((DACC_TRIGR_TRGSEL0_Msk & ((value) << DACC_TRIGR_TRGSEL0_Pos))) -#define DACC_TRIGR_TRGSEL0_TRGSEL0 (0x0u << 4) /**< \brief (DACC_TRIGR) TC0 output */ -#define DACC_TRIGR_TRGSEL0_TRGSEL1 (0x1u << 4) /**< \brief (DACC_TRIGR) TC1 output */ -#define DACC_TRIGR_TRGSEL0_TRGSEL2 (0x2u << 4) /**< \brief (DACC_TRIGR) TC2 output */ -#define DACC_TRIGR_TRGSEL0_TRGSEL3 (0x3u << 4) /**< \brief (DACC_TRIGR) PWM0 event 0 */ -#define DACC_TRIGR_TRGSEL0_TRGSEL4 (0x4u << 4) /**< \brief (DACC_TRIGR) PWM0 event 1 */ -#define DACC_TRIGR_TRGSEL0_TRGSEL5 (0x5u << 4) /**< \brief (DACC_TRIGR) PWM1 event 0 */ -#define DACC_TRIGR_TRGSEL0_TRGSEL6 (0x6u << 4) /**< \brief (DACC_TRIGR) PWM1 event 1 */ -#define DACC_TRIGR_TRGSEL1_Pos 8 -#define DACC_TRIGR_TRGSEL1_Msk (0x7u << DACC_TRIGR_TRGSEL1_Pos) /**< \brief (DACC_TRIGR) Trigger Selection of Channel 1 */ -#define DACC_TRIGR_TRGSEL1(value) ((DACC_TRIGR_TRGSEL1_Msk & ((value) << DACC_TRIGR_TRGSEL1_Pos))) -#define DACC_TRIGR_TRGSEL1_TRGSEL0 (0x0u << 8) /**< \brief (DACC_TRIGR) TC0 output */ -#define DACC_TRIGR_TRGSEL1_TRGSEL1 (0x1u << 8) /**< \brief (DACC_TRIGR) TC1 output */ -#define DACC_TRIGR_TRGSEL1_TRGSEL2 (0x2u << 8) /**< \brief (DACC_TRIGR) TC2 output */ -#define DACC_TRIGR_TRGSEL1_TRGSEL3 (0x3u << 8) /**< \brief (DACC_TRIGR) PWM0 event 0 */ -#define DACC_TRIGR_TRGSEL1_TRGSEL4 (0x4u << 8) /**< \brief (DACC_TRIGR) PWM0 event 1 */ -#define DACC_TRIGR_TRGSEL1_TRGSEL5 (0x5u << 8) /**< \brief (DACC_TRIGR) PWM1 event 0 */ -#define DACC_TRIGR_TRGSEL1_TRGSEL6 (0x6u << 8) /**< \brief (DACC_TRIGR) PWM1 event 1 */ -#define DACC_TRIGR_OSR0_Pos 16 -#define DACC_TRIGR_OSR0_Msk (0x7u << DACC_TRIGR_OSR0_Pos) /**< \brief (DACC_TRIGR) Over Sampling Ratio of Channel 0 */ -#define DACC_TRIGR_OSR0(value) ((DACC_TRIGR_OSR0_Msk & ((value) << DACC_TRIGR_OSR0_Pos))) -#define DACC_TRIGR_OSR0_OSR_1 (0x0u << 16) /**< \brief (DACC_TRIGR) OSR = 1 */ -#define DACC_TRIGR_OSR0_OSR_2 (0x1u << 16) /**< \brief (DACC_TRIGR) OSR = 2 */ -#define DACC_TRIGR_OSR0_OSR_4 (0x2u << 16) /**< \brief (DACC_TRIGR) OSR = 4 */ -#define DACC_TRIGR_OSR0_OSR_8 (0x3u << 16) /**< \brief (DACC_TRIGR) OSR = 8 */ -#define DACC_TRIGR_OSR0_OSR_16 (0x4u << 16) /**< \brief (DACC_TRIGR) OSR = 16 */ -#define DACC_TRIGR_OSR0_OSR_32 (0x5u << 16) /**< \brief (DACC_TRIGR) OSR = 32 */ -#define DACC_TRIGR_OSR1_Pos 20 -#define DACC_TRIGR_OSR1_Msk (0x7u << DACC_TRIGR_OSR1_Pos) /**< \brief (DACC_TRIGR) Over Sampling Ratio of Channel 1 */ -#define DACC_TRIGR_OSR1(value) ((DACC_TRIGR_OSR1_Msk & ((value) << DACC_TRIGR_OSR1_Pos))) -#define DACC_TRIGR_OSR1_OSR_1 (0x0u << 20) /**< \brief (DACC_TRIGR) OSR = 1 */ -#define DACC_TRIGR_OSR1_OSR_2 (0x1u << 20) /**< \brief (DACC_TRIGR) OSR = 2 */ -#define DACC_TRIGR_OSR1_OSR_4 (0x2u << 20) /**< \brief (DACC_TRIGR) OSR = 4 */ -#define DACC_TRIGR_OSR1_OSR_8 (0x3u << 20) /**< \brief (DACC_TRIGR) OSR = 8 */ -#define DACC_TRIGR_OSR1_OSR_16 (0x4u << 20) /**< \brief (DACC_TRIGR) OSR = 16 */ -#define DACC_TRIGR_OSR1_OSR_32 (0x5u << 20) /**< \brief (DACC_TRIGR) OSR = 32 */ -/* -------- DACC_CHER : (DACC Offset: 0x10) Channel Enable Register -------- */ -#define DACC_CHER_CH0 (0x1u << 0) /**< \brief (DACC_CHER) Channel 0 Enable */ -#define DACC_CHER_CH1 (0x1u << 1) /**< \brief (DACC_CHER) Channel 1 Enable */ -/* -------- DACC_CHDR : (DACC Offset: 0x14) Channel Disable Register -------- */ -#define DACC_CHDR_CH0 (0x1u << 0) /**< \brief (DACC_CHDR) Channel 0 Disable */ -#define DACC_CHDR_CH1 (0x1u << 1) /**< \brief (DACC_CHDR) Channel 1 Disable */ -/* -------- DACC_CHSR : (DACC Offset: 0x18) Channel Status Register -------- */ -#define DACC_CHSR_CH0 (0x1u << 0) /**< \brief (DACC_CHSR) Channel 0 Status */ -#define DACC_CHSR_CH1 (0x1u << 1) /**< \brief (DACC_CHSR) Channel 1 Status */ -#define DACC_CHSR_DACRDY0 (0x1u << 8) /**< \brief (DACC_CHSR) DAC ready flag */ -#define DACC_CHSR_DACRDY1 (0x1u << 9) /**< \brief (DACC_CHSR) DAC ready flag */ -/* -------- DACC_CDR[2] : (DACC Offset: 0x1C) Conversion Data Register -------- */ -#define DACC_CDR_DATA0_Pos 0 -#define DACC_CDR_DATA0_Msk (0xffffu << DACC_CDR_DATA0_Pos) /**< \brief (DACC_CDR[2]) Data to Convert for channel 0 */ -#define DACC_CDR_DATA0(value) ((DACC_CDR_DATA0_Msk & ((value) << DACC_CDR_DATA0_Pos))) -#define DACC_CDR_DATA1_Pos 16 -#define DACC_CDR_DATA1_Msk (0xffffu << DACC_CDR_DATA1_Pos) /**< \brief (DACC_CDR[2]) Data to Convert for channel 1 */ -#define DACC_CDR_DATA1(value) ((DACC_CDR_DATA1_Msk & ((value) << DACC_CDR_DATA1_Pos))) -/* -------- DACC_IER : (DACC Offset: 0x24) Interrupt Enable Register -------- */ -#define DACC_IER_TXRDY0 (0x1u << 0) /**< \brief (DACC_IER) Transmit Ready Interrupt Enable of channel 0 */ -#define DACC_IER_TXRDY1 (0x1u << 1) /**< \brief (DACC_IER) Transmit Ready Interrupt Enable of channel 1 */ -#define DACC_IER_EOC0 (0x1u << 4) /**< \brief (DACC_IER) End of Conversion Interrupt Enable of channel 0 */ -#define DACC_IER_EOC1 (0x1u << 5) /**< \brief (DACC_IER) End of Conversion Interrupt Enable of channel 1 */ -#define DACC_IER_ENDTX0 (0x1u << 8) /**< \brief (DACC_IER) End of Transmit Buffer Interrupt Enable of channel 0 */ -#define DACC_IER_ENDTX1 (0x1u << 9) /**< \brief (DACC_IER) End of Transmit Buffer Interrupt Enable of channel 1 */ -#define DACC_IER_TXBUFE0 (0x1u << 12) /**< \brief (DACC_IER) Transmit Buffer Empty Interrupt Enable of channel 0 */ -#define DACC_IER_TXBUFE1 (0x1u << 13) /**< \brief (DACC_IER) Transmit Buffer Empty Interrupt Enable of channel 1 */ -/* -------- DACC_IDR : (DACC Offset: 0x28) Interrupt Disable Register -------- */ -#define DACC_IDR_TXRDY0 (0x1u << 0) /**< \brief (DACC_IDR) Transmit Ready Interrupt Disable of channel 0 */ -#define DACC_IDR_TXRDY1 (0x1u << 1) /**< \brief (DACC_IDR) Transmit Ready Interrupt Disable of channel 1 */ -#define DACC_IDR_EOC0 (0x1u << 4) /**< \brief (DACC_IDR) End of Conversion Interrupt Disable of channel 0 */ -#define DACC_IDR_EOC1 (0x1u << 5) /**< \brief (DACC_IDR) End of Conversion Interrupt Disable of channel 1 */ -#define DACC_IDR_ENDTX0 (0x1u << 8) /**< \brief (DACC_IDR) End of Transmit Buffer Interrupt Disable of channel 0 */ -#define DACC_IDR_ENDTX1 (0x1u << 9) /**< \brief (DACC_IDR) End of Transmit Buffer Interrupt Disable of channel 1 */ -#define DACC_IDR_TXBUFE0 (0x1u << 12) /**< \brief (DACC_IDR) Transmit Buffer Empty Interrupt Disable of channel 0 */ -#define DACC_IDR_TXBUFE1 (0x1u << 13) /**< \brief (DACC_IDR) Transmit Buffer Empty Interrupt Disable of channel 1 */ -/* -------- DACC_IMR : (DACC Offset: 0x2C) Interrupt Mask Register -------- */ -#define DACC_IMR_TXRDY0 (0x1u << 0) /**< \brief (DACC_IMR) Transmit Ready Interrupt Mask of channel 0 */ -#define DACC_IMR_TXRDY1 (0x1u << 1) /**< \brief (DACC_IMR) Transmit Ready Interrupt Mask of channel 1 */ -#define DACC_IMR_EOC0 (0x1u << 4) /**< \brief (DACC_IMR) End of Conversion Interrupt Mask of channel 0 */ -#define DACC_IMR_EOC1 (0x1u << 5) /**< \brief (DACC_IMR) End of Conversion Interrupt Mask of channel 1 */ -#define DACC_IMR_ENDTX0 (0x1u << 8) /**< \brief (DACC_IMR) End of Transmit Buffer Interrupt Mask of channel 0 */ -#define DACC_IMR_ENDTX1 (0x1u << 9) /**< \brief (DACC_IMR) End of Transmit Buffer Interrupt Mask of channel 1 */ -#define DACC_IMR_TXBUFE0 (0x1u << 12) /**< \brief (DACC_IMR) Transmit Buffer Empty Interrupt Mask of channel 0 */ -#define DACC_IMR_TXBUFE1 (0x1u << 13) /**< \brief (DACC_IMR) Transmit Buffer Empty Interrupt Mask of channel 1 */ -/* -------- DACC_ISR : (DACC Offset: 0x30) Interrupt Status Register -------- */ -#define DACC_ISR_TXRDY0 (0x1u << 0) /**< \brief (DACC_ISR) Transmit Ready Interrupt Flag of channel 0 */ -#define DACC_ISR_TXRDY1 (0x1u << 1) /**< \brief (DACC_ISR) Transmit Ready Interrupt Flag of channel 1 */ -#define DACC_ISR_EOC0 (0x1u << 4) /**< \brief (DACC_ISR) End of Conversion Interrupt Flag of channel 0 */ -#define DACC_ISR_EOC1 (0x1u << 5) /**< \brief (DACC_ISR) End of Conversion Interrupt Flag of channel 1 */ -#define DACC_ISR_ENDTX0 (0x1u << 8) /**< \brief (DACC_ISR) End of DMA Interrupt Flag of channel 0 */ -#define DACC_ISR_ENDTX1 (0x1u << 9) /**< \brief (DACC_ISR) End of DMA Interrupt Flag of channel 1 */ -#define DACC_ISR_TXBUFE0 (0x1u << 12) /**< \brief (DACC_ISR) Transmit Buffer Empty of channel 0 */ -#define DACC_ISR_TXBUFE1 (0x1u << 13) /**< \brief (DACC_ISR) Transmit Buffer Empty of channel 1 */ -/* -------- DACC_ACR : (DACC Offset: 0x94) Analog Current Register -------- */ -#define DACC_ACR_IBCTLCH0_Pos 0 -#define DACC_ACR_IBCTLCH0_Msk (0x3u << DACC_ACR_IBCTLCH0_Pos) /**< \brief (DACC_ACR) Analog Output Current Control */ -#define DACC_ACR_IBCTLCH0(value) ((DACC_ACR_IBCTLCH0_Msk & ((value) << DACC_ACR_IBCTLCH0_Pos))) -#define DACC_ACR_IBCTLCH1_Pos 2 -#define DACC_ACR_IBCTLCH1_Msk (0x3u << DACC_ACR_IBCTLCH1_Pos) /**< \brief (DACC_ACR) Analog Output Current Control */ -#define DACC_ACR_IBCTLCH1(value) ((DACC_ACR_IBCTLCH1_Msk & ((value) << DACC_ACR_IBCTLCH1_Pos))) -/* -------- DACC_WPMR : (DACC Offset: 0xE4) Write Protection Mode register -------- */ -#define DACC_WPMR_WPEN (0x1u << 0) /**< \brief (DACC_WPMR) Write Protection Enable */ -#define DACC_WPMR_WPKEY_Pos 8 -#define DACC_WPMR_WPKEY_Msk (0xffffffu << DACC_WPMR_WPKEY_Pos) /**< \brief (DACC_WPMR) Write Protect Key */ -#define DACC_WPMR_WPKEY(value) ((DACC_WPMR_WPKEY_Msk & ((value) << DACC_WPMR_WPKEY_Pos))) -#define DACC_WPMR_WPKEY_PASSWD (0x444143u << 8) /**< \brief (DACC_WPMR) Writing any other value in this field aborts the write operation of bit WPEN.Always reads as 0. */ -/* -------- DACC_WPSR : (DACC Offset: 0xE8) Write Protection Status register -------- */ -#define DACC_WPSR_WPVS (0x1u << 0) /**< \brief (DACC_WPSR) Write Protection Violation Status */ -#define DACC_WPSR_WPVSRC_Pos 8 -#define DACC_WPSR_WPVSRC_Msk (0xffu << DACC_WPSR_WPVSRC_Pos) /**< \brief (DACC_WPSR) Write Protection Violation Source */ - -/*@}*/ - - -#endif /* _SAMV71_DACC_COMPONENT_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_efc.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_efc.h deleted file mode 100644 index 984492f7..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_efc.h +++ /dev/null @@ -1,118 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_EFC_COMPONENT_ -#define _SAMV71_EFC_COMPONENT_ - -/* ============================================================================= */ -/** SOFTWARE API DEFINITION FOR Embedded Flash Controller */ -/* ============================================================================= */ -/** \addtogroup SAMV71_EFC Embedded Flash Controller */ -/*@{*/ - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -/** \brief Efc hardware registers */ -typedef struct { - __IO uint32_t EEFC_FMR; /**< \brief (Efc Offset: 0x00) EEFC Flash Mode Register */ - __O uint32_t EEFC_FCR; /**< \brief (Efc Offset: 0x04) EEFC Flash Command Register */ - __I uint32_t EEFC_FSR; /**< \brief (Efc Offset: 0x08) EEFC Flash Status Register */ - __I uint32_t EEFC_FRR; /**< \brief (Efc Offset: 0x0C) EEFC Flash Result Register */ - __I uint32_t Reserved1[1]; - __I uint32_t EEFC_VERSION; /**< \brief (Efc Offset: 0x14) EEFC Version Register */ - __I uint32_t Reserved2[51]; - __IO uint32_t EEFC_WPMR; /**< \brief (Efc Offset: 0xE4) Write Protection Mode Register */ -} Efc; -#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/* -------- EEFC_FMR : (EFC Offset: 0x00) EEFC Flash Mode Register -------- */ -#define EEFC_FMR_FRDY (0x1u << 0) /**< \brief (EEFC_FMR) Flash Ready Interrupt Enable */ -#define EEFC_FMR_FWS_Pos 8 -#define EEFC_FMR_FWS_Msk (0xfu << EEFC_FMR_FWS_Pos) /**< \brief (EEFC_FMR) Flash Wait State */ -#define EEFC_FMR_FWS(value) ((EEFC_FMR_FWS_Msk & ((value) << EEFC_FMR_FWS_Pos))) -#define EEFC_FMR_SCOD (0x1u << 16) /**< \brief (EEFC_FMR) Sequential Code Optimization Disable */ -#define EEFC_FMR_CLOE (0x1u << 26) /**< \brief (EEFC_FMR) Code Loop Optimization Enable */ -/* -------- EEFC_FCR : (EFC Offset: 0x04) EEFC Flash Command Register -------- */ -#define EEFC_FCR_FCMD_Pos 0 -#define EEFC_FCR_FCMD_Msk (0xffu << EEFC_FCR_FCMD_Pos) /**< \brief (EEFC_FCR) Flash Command */ -#define EEFC_FCR_FCMD(value) ((EEFC_FCR_FCMD_Msk & ((value) << EEFC_FCR_FCMD_Pos))) -#define EEFC_FCR_FCMD_GETD (0x0u << 0) /**< \brief (EEFC_FCR) Get Flash descriptor */ -#define EEFC_FCR_FCMD_WP (0x1u << 0) /**< \brief (EEFC_FCR) Write page */ -#define EEFC_FCR_FCMD_WPL (0x2u << 0) /**< \brief (EEFC_FCR) Write page and lock */ -#define EEFC_FCR_FCMD_EWP (0x3u << 0) /**< \brief (EEFC_FCR) Erase page and write page */ -#define EEFC_FCR_FCMD_EWPL (0x4u << 0) /**< \brief (EEFC_FCR) Erase page and write page then lock */ -#define EEFC_FCR_FCMD_EA (0x5u << 0) /**< \brief (EEFC_FCR) Erase all */ -#define EEFC_FCR_FCMD_EPA (0x7u << 0) /**< \brief (EEFC_FCR) Erase pages */ -#define EEFC_FCR_FCMD_SLB (0x8u << 0) /**< \brief (EEFC_FCR) Set lock bit */ -#define EEFC_FCR_FCMD_CLB (0x9u << 0) /**< \brief (EEFC_FCR) Clear lock bit */ -#define EEFC_FCR_FCMD_GLB (0xAu << 0) /**< \brief (EEFC_FCR) Get lock bit */ -#define EEFC_FCR_FCMD_SGPB (0xBu << 0) /**< \brief (EEFC_FCR) Set GPNVM bit */ -#define EEFC_FCR_FCMD_CGPB (0xCu << 0) /**< \brief (EEFC_FCR) Clear GPNVM bit */ -#define EEFC_FCR_FCMD_GGPB (0xDu << 0) /**< \brief (EEFC_FCR) Get GPNVM bit */ -#define EEFC_FCR_FCMD_STUI (0xEu << 0) /**< \brief (EEFC_FCR) Start read unique identifier */ -#define EEFC_FCR_FCMD_SPUI (0xFu << 0) /**< \brief (EEFC_FCR) Stop read unique identifier */ -#define EEFC_FCR_FCMD_GCALB (0x10u << 0) /**< \brief (EEFC_FCR) Get CALIB bit */ -#define EEFC_FCR_FCMD_ES (0x11u << 0) /**< \brief (EEFC_FCR) Erase sector */ -#define EEFC_FCR_FCMD_WUS (0x12u << 0) /**< \brief (EEFC_FCR) Write user signature */ -#define EEFC_FCR_FCMD_EUS (0x13u << 0) /**< \brief (EEFC_FCR) Erase user signature */ -#define EEFC_FCR_FCMD_STUS (0x14u << 0) /**< \brief (EEFC_FCR) Start read user signature */ -#define EEFC_FCR_FCMD_SPUS (0x15u << 0) /**< \brief (EEFC_FCR) Stop read user signature */ -#define EEFC_FCR_FARG_Pos 8 -#define EEFC_FCR_FARG_Msk (0xffffu << EEFC_FCR_FARG_Pos) /**< \brief (EEFC_FCR) Flash Command Argument */ -#define EEFC_FCR_FARG(value) ((EEFC_FCR_FARG_Msk & ((value) << EEFC_FCR_FARG_Pos))) -#define EEFC_FCR_FKEY_Pos 24 -#define EEFC_FCR_FKEY_Msk (0xffu << EEFC_FCR_FKEY_Pos) /**< \brief (EEFC_FCR) Flash Writing Protection Key */ -#define EEFC_FCR_FKEY(value) ((EEFC_FCR_FKEY_Msk & ((value) << EEFC_FCR_FKEY_Pos))) -#define EEFC_FCR_FKEY_PASSWD (0x5Au << 24) /**< \brief (EEFC_FCR) The 0x5A value enables the command defined by the bits of the register. If the field is written with a different value, the write is not performed and no action is started. */ -/* -------- EEFC_FSR : (EFC Offset: 0x08) EEFC Flash Status Register -------- */ -#define EEFC_FSR_FRDY (0x1u << 0) /**< \brief (EEFC_FSR) Flash Ready Status (cleared when Flash is busy) */ -#define EEFC_FSR_FCMDE (0x1u << 1) /**< \brief (EEFC_FSR) Flash Command Error Status (cleared on read or by writing EEFC_FCR) */ -#define EEFC_FSR_FLOCKE (0x1u << 2) /**< \brief (EEFC_FSR) Flash Lock Error Status (cleared on read) */ -#define EEFC_FSR_FLERR (0x1u << 3) /**< \brief (EEFC_FSR) Flash Error Status (cleared when a programming operation starts) */ -#define EEFC_FSR_UECCELSB (0x1u << 16) /**< \brief (EEFC_FSR) Unique ECC Error on LSB Part of the Memory Flash Data Bus (cleared on read) */ -#define EEFC_FSR_MECCELSB (0x1u << 17) /**< \brief (EEFC_FSR) Multiple ECC Error on LSB Part of the Memory Flash Data Bus (cleared on read) */ -#define EEFC_FSR_UECCEMSB (0x1u << 18) /**< \brief (EEFC_FSR) Unique ECC Error on MSB Part of the Memory Flash Data Bus (cleared on read) */ -#define EEFC_FSR_MECCEMSB (0x1u << 19) /**< \brief (EEFC_FSR) Multiple ECC Error on MSB Part of the Memory Flash Data Bus (cleared on read) */ -/* -------- EEFC_FRR : (EFC Offset: 0x0C) EEFC Flash Result Register -------- */ -#define EEFC_FRR_FVALUE_Pos 0 -#define EEFC_FRR_FVALUE_Msk (0xffffffffu << EEFC_FRR_FVALUE_Pos) /**< \brief (EEFC_FRR) Flash Result Value */ -/* -------- EEFC_VERSION : (EFC Offset: 0x14) EEFC Version Register -------- */ -#define EEFC_VERSION_VERSION_Pos 0 -#define EEFC_VERSION_VERSION_Msk (0xfffu << EEFC_VERSION_VERSION_Pos) /**< \brief (EEFC_VERSION) Version of the Hardware Module */ -#define EEFC_VERSION_MFN_Pos 16 -#define EEFC_VERSION_MFN_Msk (0x7u << EEFC_VERSION_MFN_Pos) /**< \brief (EEFC_VERSION) Metal Fix Number */ -/* -------- EEFC_WPMR : (EFC Offset: 0xE4) Write Protection Mode Register -------- */ -#define EEFC_WPMR_WPEN (0x1u << 0) /**< \brief (EEFC_WPMR) Write Protection Enable */ -#define EEFC_WPMR_WPKEY_Pos 8 -#define EEFC_WPMR_WPKEY_Msk (0xffffffu << EEFC_WPMR_WPKEY_Pos) /**< \brief (EEFC_WPMR) Write Protection Key */ -#define EEFC_WPMR_WPKEY(value) ((EEFC_WPMR_WPKEY_Msk & ((value) << EEFC_WPMR_WPKEY_Pos))) -#define EEFC_WPMR_WPKEY_PASSWD (0x454643u << 8) /**< \brief (EEFC_WPMR) Writing any other value in this field aborts the write operation.Always reads as 0. */ - -/*@}*/ - - -#endif /* _SAMV71_EFC_COMPONENT_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_gmac.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_gmac.h deleted file mode 100644 index 152b504f..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_gmac.h +++ /dev/null @@ -1,832 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_GMAC_COMPONENT_ -#define _SAMV71_GMAC_COMPONENT_ - -/* ============================================================================= */ -/** SOFTWARE API DEFINITION FOR Gigabit Ethernet MAC */ -/* ============================================================================= */ -/** \addtogroup SAMV71_GMAC Gigabit Ethernet MAC */ -/*@{*/ - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -/** \brief GmacSa hardware registers */ -typedef struct { - __IO uint32_t GMAC_SAB; /**< \brief (GmacSa Offset: 0x0) Specific Address 1 Bottom Register */ - __IO uint32_t GMAC_SAT; /**< \brief (GmacSa Offset: 0x4) Specific Address 1 Top Register */ -} GmacSa; - -/** \brief GmacSt2Compare hardware registers */ -typedef struct { - __IO uint32_t GMAC_ST2COM0; /**< \brief 31:16 - Compare Value. 15:0 - Mask Value. */ - __IO uint32_t GMAC_ST2COM1; /**< \brief 31:9 - Reserved; 8:7 - Offset location in frame; 6:0 Offset value in bytes */ -} GmacSt2Compare; - -/** \brief Gmac hardware registers */ -#define GMACSA_NUMBER 4 -#define GMACST2COMPARE_NUMBER 24 -typedef struct { - __IO uint32_t GMAC_NCR; /**< \brief (Gmac Offset: 0x000) Network Control Register */ - __IO uint32_t GMAC_NCFGR; /**< \brief (Gmac Offset: 0x004) Network Configuration Register */ - __I uint32_t GMAC_NSR; /**< \brief (Gmac Offset: 0x008) Network Status Register */ - __IO uint32_t GMAC_UR; /**< \brief (Gmac Offset: 0x00C) User Register */ - __IO uint32_t GMAC_DCFGR; /**< \brief (Gmac Offset: 0x010) DMA Configuration Register */ - __IO uint32_t GMAC_TSR; /**< \brief (Gmac Offset: 0x014) Transmit Status Register */ - __IO uint32_t GMAC_RBQB; /**< \brief (Gmac Offset: 0x018) Receive Buffer Queue Base Address Register */ - __IO uint32_t GMAC_TBQB; /**< \brief (Gmac Offset: 0x01C) Transmit Buffer Queue Base Address Register */ - __IO uint32_t GMAC_RSR; /**< \brief (Gmac Offset: 0x020) Receive Status Register */ - __I uint32_t GMAC_ISR; /**< \brief (Gmac Offset: 0x024) Interrupt Status Register */ - __O uint32_t GMAC_IER; /**< \brief (Gmac Offset: 0x028) Interrupt Enable Register */ - __O uint32_t GMAC_IDR; /**< \brief (Gmac Offset: 0x02C) Interrupt Disable Register */ - __IO uint32_t GMAC_IMR; /**< \brief (Gmac Offset: 0x030) Interrupt Mask Register */ - __IO uint32_t GMAC_MAN; /**< \brief (Gmac Offset: 0x034) PHY Maintenance Register */ - __I uint32_t GMAC_RPQ; /**< \brief (Gmac Offset: 0x038) Received Pause Quantum Register */ - __IO uint32_t GMAC_TPQ; /**< \brief (Gmac Offset: 0x03C) Transmit Pause Quantum Register */ - __IO uint32_t GMAC_TPSF; /**< \brief (Gmac Offset: 0x040) TX Partial Store and Forward Register */ - __IO uint32_t GMAC_RPSF; /**< \brief (Gmac Offset: 0x044) RX Partial Store and Forward Register */ - __IO uint32_t GMAC_RJFML; /**< \brief (Gmac Offset: 0x048) RX Jumbo Frame Max Length Register */ - __I uint32_t Reserved1[13]; - __IO uint32_t GMAC_HRB; /**< \brief (Gmac Offset: 0x080) Hash Register Bottom */ - __IO uint32_t GMAC_HRT; /**< \brief (Gmac Offset: 0x084) Hash Register Top */ - GmacSa GMAC_SA[GMACSA_NUMBER]; /**< \brief (Gmac Offset: 0x088) 1 .. 4 */ - __IO uint32_t GMAC_TIDM1; /**< \brief (Gmac Offset: 0x0A8) Type ID Match 1 Register */ - __IO uint32_t GMAC_TIDM2; /**< \brief (Gmac Offset: 0x0AC) Type ID Match 2 Register */ - __IO uint32_t GMAC_TIDM3; /**< \brief (Gmac Offset: 0x0B0) Type ID Match 3 Register */ - __IO uint32_t GMAC_TIDM4; /**< \brief (Gmac Offset: 0x0B4) Type ID Match 4 Register */ - __IO uint32_t GMAC_WOL; /**< \brief (Gmac Offset: 0x0B8) Wake on LAN Register */ - __IO uint32_t GMAC_IPGS; /**< \brief (Gmac Offset: 0x0BC) IPG Stretch Register */ - __IO uint32_t GMAC_SVLAN; /**< \brief (Gmac Offset: 0x0C0) Stacked VLAN Register */ - __IO uint32_t GMAC_TPFCP; /**< \brief (Gmac Offset: 0x0C4) Transmit PFC Pause Register */ - __IO uint32_t GMAC_SAMB1; /**< \brief (Gmac Offset: 0x0C8) Specific Address 1 Mask Bottom Register */ - __IO uint32_t GMAC_SAMT1; /**< \brief (Gmac Offset: 0x0CC) Specific Address 1 Mask Top Register */ - __I uint32_t Reserved2[3]; - __IO uint32_t GMAC_NSC; /**< \brief (Gmac Offset: 0x0DC) 1588 Timer Nanosecond Comparison Register */ - __IO uint32_t GMAC_SCL; /**< \brief (Gmac Offset: 0x0E0) 1588 Timer Second Comparison Low Register */ - __IO uint32_t GMAC_SCH; /**< \brief (Gmac Offset: 0x0E4) 1588 Timer Second Comparison High Register */ - __I uint32_t GMAC_EFTSH; /**< \brief (Gmac Offset: 0x0E8) PTP Event Frame Transmitted Seconds High Register */ - __I uint32_t GMAC_EFRSH; /**< \brief (Gmac Offset: 0x0EC) PTP Event Frame Received Seconds High Register */ - __I uint32_t GMAC_PEFTSH; /**< \brief (Gmac Offset: 0x0F0) PTP Peer Event Frame Transmitted Seconds High Register */ - __I uint32_t GMAC_PEFRSH; /**< \brief (Gmac Offset: 0x0F4) PTP Peer Event Frame Received Seconds High Register */ - __I uint32_t Reserved3[2]; - __I uint32_t GMAC_OTLO; /**< \brief (Gmac Offset: 0x100) Octets Transmitted Low Register */ - __I uint32_t GMAC_OTHI; /**< \brief (Gmac Offset: 0x104) Octets Transmitted High Register */ - __I uint32_t GMAC_FT; /**< \brief (Gmac Offset: 0x108) Frames Transmitted Register */ - __I uint32_t GMAC_BCFT; /**< \brief (Gmac Offset: 0x10C) Broadcast Frames Transmitted Register */ - __I uint32_t GMAC_MFT; /**< \brief (Gmac Offset: 0x110) Multicast Frames Transmitted Register */ - __I uint32_t GMAC_PFT; /**< \brief (Gmac Offset: 0x114) Pause Frames Transmitted Register */ - __I uint32_t GMAC_BFT64; /**< \brief (Gmac Offset: 0x118) 64 Byte Frames Transmitted Register */ - __I uint32_t GMAC_TBFT127; /**< \brief (Gmac Offset: 0x11C) 65 to 127 Byte Frames Transmitted Register */ - __I uint32_t GMAC_TBFT255; /**< \brief (Gmac Offset: 0x120) 128 to 255 Byte Frames Transmitted Register */ - __I uint32_t GMAC_TBFT511; /**< \brief (Gmac Offset: 0x124) 256 to 511 Byte Frames Transmitted Register */ - __I uint32_t GMAC_TBFT1023; /**< \brief (Gmac Offset: 0x128) 512 to 1023 Byte Frames Transmitted Register */ - __I uint32_t GMAC_TBFT1518; /**< \brief (Gmac Offset: 0x12C) 1024 to 1518 Byte Frames Transmitted Register */ - __I uint32_t GMAC_GTBFT1518; /**< \brief (Gmac Offset: 0x130) Greater Than 1518 Byte Frames Transmitted Register */ - __I uint32_t GMAC_TUR; /**< \brief (Gmac Offset: 0x134) Transmit Underruns Register */ - __I uint32_t GMAC_SCF; /**< \brief (Gmac Offset: 0x138) Single Collision Frames Register */ - __I uint32_t GMAC_MCF; /**< \brief (Gmac Offset: 0x13C) Multiple Collision Frames Register */ - __I uint32_t GMAC_EC; /**< \brief (Gmac Offset: 0x140) Excessive Collisions Register */ - __I uint32_t GMAC_LC; /**< \brief (Gmac Offset: 0x144) Late Collisions Register */ - __I uint32_t GMAC_DTF; /**< \brief (Gmac Offset: 0x148) Deferred Transmission Frames Register */ - __I uint32_t GMAC_CSE; /**< \brief (Gmac Offset: 0x14C) Carrier Sense Errors Register Register */ - __I uint32_t GMAC_ORLO; /**< \brief (Gmac Offset: 0x150) Octets Received Low Received Register */ - __I uint32_t GMAC_ORHI; /**< \brief (Gmac Offset: 0x154) Octets Received High Received Register */ - __I uint32_t GMAC_FR; /**< \brief (Gmac Offset: 0x158) Frames Received Register */ - __I uint32_t GMAC_BCFR; /**< \brief (Gmac Offset: 0x15C) Broadcast Frames Received Register */ - __I uint32_t GMAC_MFR; /**< \brief (Gmac Offset: 0x160) Multicast Frames Received Register */ - __I uint32_t GMAC_PFR; /**< \brief (Gmac Offset: 0x164) Pause Frames Received Register */ - __I uint32_t GMAC_BFR64; /**< \brief (Gmac Offset: 0x168) 64 Byte Frames Received Register */ - __I uint32_t GMAC_TBFR127; /**< \brief (Gmac Offset: 0x16C) 65 to 127 Byte Frames Received Register */ - __I uint32_t GMAC_TBFR255; /**< \brief (Gmac Offset: 0x170) 128 to 255 Byte Frames Received Register */ - __I uint32_t GMAC_TBFR511; /**< \brief (Gmac Offset: 0x174) 256 to 511 Byte Frames Received Register */ - __I uint32_t GMAC_TBFR1023; /**< \brief (Gmac Offset: 0x178) 512 to 1023 Byte Frames Received Register */ - __I uint32_t GMAC_TBFR1518; /**< \brief (Gmac Offset: 0x17C) 1024 to 1518 Byte Frames Received Register */ - __I uint32_t GMAC_TMXBFR; /**< \brief (Gmac Offset: 0x180) 1519 to Maximum Byte Frames Received Register */ - __I uint32_t GMAC_UFR; /**< \brief (Gmac Offset: 0x184) Undersize Frames Received Register */ - __I uint32_t GMAC_OFR; /**< \brief (Gmac Offset: 0x188) Oversize Frames Received Register */ - __I uint32_t GMAC_JR; /**< \brief (Gmac Offset: 0x18C) Jabbers Received Register */ - __I uint32_t GMAC_FCSE; /**< \brief (Gmac Offset: 0x190) Frame Check Sequence Errors Register */ - __I uint32_t GMAC_LFFE; /**< \brief (Gmac Offset: 0x194) Length Field Frame Errors Register */ - __I uint32_t GMAC_RSE; /**< \brief (Gmac Offset: 0x198) Receive Symbol Errors Register */ - __I uint32_t GMAC_AE; /**< \brief (Gmac Offset: 0x19C) Alignment Errors Register */ - __I uint32_t GMAC_RRE; /**< \brief (Gmac Offset: 0x1A0) Receive Resource Errors Register */ - __I uint32_t GMAC_ROE; /**< \brief (Gmac Offset: 0x1A4) Receive Overrun Register */ - __I uint32_t GMAC_IHCE; /**< \brief (Gmac Offset: 0x1A8) IP Header Checksum Errors Register */ - __I uint32_t GMAC_TCE; /**< \brief (Gmac Offset: 0x1AC) TCP Checksum Errors Register */ - __I uint32_t GMAC_UCE; /**< \brief (Gmac Offset: 0x1B0) UDP Checksum Errors Register */ - __I uint32_t Reserved4[2]; - __IO uint32_t GMAC_TISUBN; /**< \brief (Gmac Offset: 0x1BC) 1588 Timer Increment Sub-nanoseconds Register */ - __IO uint32_t GMAC_TSH; /**< \brief (Gmac Offset: 0x1C0) 1588 Timer Seconds High Register */ - __I uint32_t Reserved5[3]; - __IO uint32_t GMAC_TSL; /**< \brief (Gmac Offset: 0x1D0) 1588 Timer Seconds Low Register */ - __IO uint32_t GMAC_TN; /**< \brief (Gmac Offset: 0x1D4) 1588 Timer Nanoseconds Register */ - __O uint32_t GMAC_TA; /**< \brief (Gmac Offset: 0x1D8) 1588 Timer Adjust Register */ - __IO uint32_t GMAC_TI; /**< \brief (Gmac Offset: 0x1DC) 1588 Timer Increment Register */ - __I uint32_t GMAC_EFTSL; /**< \brief (Gmac Offset: 0x1E0) PTP Event Frame Transmitted Seconds Low Register */ - __I uint32_t GMAC_EFTN; /**< \brief (Gmac Offset: 0x1E4) PTP Event Frame Transmitted Nanoseconds Register */ - __I uint32_t GMAC_EFRSL; /**< \brief (Gmac Offset: 0x1E8) PTP Event Frame Received Seconds Low Register */ - __I uint32_t GMAC_EFRN; /**< \brief (Gmac Offset: 0x1EC) PTP Event Frame Received Nanoseconds Register */ - __I uint32_t GMAC_PEFTSL; /**< \brief (Gmac Offset: 0x1F0) PTP Peer Event Frame Transmitted Seconds Low Register */ - __I uint32_t GMAC_PEFTN; /**< \brief (Gmac Offset: 0x1F4) PTP Peer Event Frame Transmitted Nanoseconds Register */ - __I uint32_t GMAC_PEFRSL; /**< \brief (Gmac Offset: 0x1F8) PTP Peer Event Frame Received Seconds Low Register */ - __I uint32_t GMAC_PEFRN; /**< \brief (Gmac Offset: 0x1FC) PTP Peer Event Frame Received Nanoseconds Register */ - __I uint32_t Reserved6[128]; - __I uint32_t GMAC_ISRPQ[3]; /**< \brief (Gmac Offset: 0x400) Interrupt Status Register Priority Queue (index = 1) */ - __I uint32_t Reserved7[13]; - __IO uint32_t GMAC_TBQBAPQ[3]; /**< \brief (Gmac Offset: 0x440) Transmit Buffer Queue Base Address Register Priority Queue (index = 1) */ - __I uint32_t Reserved8[13]; - __IO uint32_t GMAC_RBQBAPQ[3]; /**< \brief (Gmac Offset: 0x480) Receive Buffer Queue Base Address Register Priority Queue (index = 1) */ - __I uint32_t Reserved9[5]; - __IO uint32_t GMAC_RBSRPQ[3]; /**< \brief (Gmac Offset: 0x4A0) Receive Buffer Size Register Priority Queue (index = 1) */ - __I uint32_t Reserved10[4]; - __IO uint32_t GMAC_CBSCR; /**< \brief (Gmac Offset: 0x4BC) Credit-Based Shaping Control Register */ - __IO uint32_t GMAC_CBSISQA; /**< \brief (Gmac Offset: 0x4C0) Credit-Based Shaping IdleSlope Register for Queue A */ - __IO uint32_t GMAC_CBSISQB; /**< \brief (Gmac Offset: 0x4C4) Credit-Based Shaping IdleSlope Register for Queue B */ - __I uint32_t Reserved11[14]; - __IO uint32_t GMAC_ST1RPQ[4]; /**< \brief (Gmac Offset: 0x500) Screening Type 1 Register Priority Queue (index = 0) */ - __I uint32_t Reserved12[12]; - __IO uint32_t GMAC_ST2RPQ[8]; /**< \brief (Gmac Offset: 0x540) Screening Type 2 Register Priority Queue (index = 0) */ - __I uint32_t Reserved13[12]; - __I uint32_t Reserved14[28]; - __O uint32_t GMAC_IERPQ[3]; /**< \brief (Gmac Offset: 0x600) Interrupt Enable Register Priority Queue (index = 1) */ - __I uint32_t Reserved15[5]; - __O uint32_t GMAC_IDRPQ[3]; /**< \brief (Gmac Offset: 0x620) Interrupt Disable Register Priority Queue (index = 1) */ - __I uint32_t Reserved16[5]; - __IO uint32_t GMAC_IMRPQ[3]; /**< \brief (Gmac Offset: 0x640) Interrupt Mask Register Priority Queue (index = 1) */ - __I uint32_t Reserved17[37]; - __IO uint32_t GMAC_ST2ER[4]; /**< \brief (Gmac Offset: 0x6E0) Screening Type 2 Ethertype Register (index = 0) */ - __I uint32_t Reserved18[4]; - __IO GmacSt2Compare GMAC_ST2COMP[GMACST2COMPARE_NUMBER];/**< \brief (Gmac Offset: 0x700) Screener Type 2 Compare Registers */ -} Gmac; -#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/* -------- GMAC_NCR : (GMAC Offset: 0x000) Network Control Register -------- */ -#define GMAC_NCR_LBL (0x1u << 1) /**< \brief (GMAC_NCR) Loop Back Local */ -#define GMAC_NCR_RXEN (0x1u << 2) /**< \brief (GMAC_NCR) Receive Enable */ -#define GMAC_NCR_TXEN (0x1u << 3) /**< \brief (GMAC_NCR) Transmit Enable */ -#define GMAC_NCR_MPE (0x1u << 4) /**< \brief (GMAC_NCR) Management Port Enable */ -#define GMAC_NCR_CLRSTAT (0x1u << 5) /**< \brief (GMAC_NCR) Clear Statistics Registers */ -#define GMAC_NCR_INCSTAT (0x1u << 6) /**< \brief (GMAC_NCR) Increment Statistics Registers */ -#define GMAC_NCR_WESTAT (0x1u << 7) /**< \brief (GMAC_NCR) Write Enable for Statistics Registers */ -#define GMAC_NCR_BP (0x1u << 8) /**< \brief (GMAC_NCR) Back pressure */ -#define GMAC_NCR_TSTART (0x1u << 9) /**< \brief (GMAC_NCR) Start Transmission */ -#define GMAC_NCR_THALT (0x1u << 10) /**< \brief (GMAC_NCR) Transmit Halt */ -#define GMAC_NCR_TXPF (0x1u << 11) /**< \brief (GMAC_NCR) Transmit Pause Frame */ -#define GMAC_NCR_TXZQPF (0x1u << 12) /**< \brief (GMAC_NCR) Transmit Zero Quantum Pause Frame */ -#define GMAC_NCR_SRTSM (0x1u << 15) /**< \brief (GMAC_NCR) Store Receive Time Stamp to Memory */ -#define GMAC_NCR_ENPBPR (0x1u << 16) /**< \brief (GMAC_NCR) Enable PFC Priority-based Pause Reception */ -#define GMAC_NCR_TXPBPF (0x1u << 17) /**< \brief (GMAC_NCR) Transmit PFC Priority-based Pause Frame */ -#define GMAC_NCR_FNP (0x1u << 18) /**< \brief (GMAC_NCR) Flush Next Packet */ -/* -------- GMAC_NCFGR : (GMAC Offset: 0x004) Network Configuration Register -------- */ -#define GMAC_NCFGR_SPD (0x1u << 0) /**< \brief (GMAC_NCFGR) Speed */ -#define GMAC_NCFGR_FD (0x1u << 1) /**< \brief (GMAC_NCFGR) Full Duplex */ -#define GMAC_NCFGR_DNVLAN (0x1u << 2) /**< \brief (GMAC_NCFGR) Discard Non-VLAN FRAMES */ -#define GMAC_NCFGR_JFRAME (0x1u << 3) /**< \brief (GMAC_NCFGR) Jumbo Frame Size */ -#define GMAC_NCFGR_CAF (0x1u << 4) /**< \brief (GMAC_NCFGR) Copy All Frames */ -#define GMAC_NCFGR_NBC (0x1u << 5) /**< \brief (GMAC_NCFGR) No Broadcast */ -#define GMAC_NCFGR_MTIHEN (0x1u << 6) /**< \brief (GMAC_NCFGR) Multicast Hash Enable */ -#define GMAC_NCFGR_UNIHEN (0x1u << 7) /**< \brief (GMAC_NCFGR) Unicast Hash Enable */ -#define GMAC_NCFGR_MAXFS (0x1u << 8) /**< \brief (GMAC_NCFGR) 1536 Maximum Frame Size */ -#define GMAC_NCFGR_RTY (0x1u << 12) /**< \brief (GMAC_NCFGR) Retry Test */ -#define GMAC_NCFGR_PEN (0x1u << 13) /**< \brief (GMAC_NCFGR) Pause Enable */ -#define GMAC_NCFGR_RXBUFO_Pos 14 -#define GMAC_NCFGR_RXBUFO_Msk (0x3u << GMAC_NCFGR_RXBUFO_Pos) /**< \brief (GMAC_NCFGR) Receive Buffer Offset */ -#define GMAC_NCFGR_RXBUFO(value) ((GMAC_NCFGR_RXBUFO_Msk & ((value) << GMAC_NCFGR_RXBUFO_Pos))) -#define GMAC_NCFGR_LFERD (0x1u << 16) /**< \brief (GMAC_NCFGR) Length Field Error Frame Discard */ -#define GMAC_NCFGR_RFCS (0x1u << 17) /**< \brief (GMAC_NCFGR) Remove FCS */ -#define GMAC_NCFGR_CLK_Pos 18 -#define GMAC_NCFGR_CLK_Msk (0x7u << GMAC_NCFGR_CLK_Pos) /**< \brief (GMAC_NCFGR) MDC CLock Division */ -#define GMAC_NCFGR_CLK(value) ((GMAC_NCFGR_CLK_Msk & ((value) << GMAC_NCFGR_CLK_Pos))) -#define GMAC_NCFGR_CLK_MCK_8 (0x0u << 18) /**< \brief (GMAC_NCFGR) MCK divided by 8 (MCK up to 20 MHz) */ -#define GMAC_NCFGR_CLK_MCK_16 (0x1u << 18) /**< \brief (GMAC_NCFGR) MCK divided by 16 (MCK up to 40 MHz) */ -#define GMAC_NCFGR_CLK_MCK_32 (0x2u << 18) /**< \brief (GMAC_NCFGR) MCK divided by 32 (MCK up to 80 MHz) */ -#define GMAC_NCFGR_CLK_MCK_48 (0x3u << 18) /**< \brief (GMAC_NCFGR) MCK divided by 48 (MCK up to 120 MHz) */ -#define GMAC_NCFGR_CLK_MCK_64 (0x4u << 18) /**< \brief (GMAC_NCFGR) MCK divided by 64 (MCK up to 160 MHz) */ -#define GMAC_NCFGR_CLK_MCK_96 (0x5u << 18) /**< \brief (GMAC_NCFGR) MCK divided by 96 (MCK up to 240 MHz) */ -#define GMAC_NCFGR_DBW_Pos 21 -#define GMAC_NCFGR_DBW_Msk (0x3u << GMAC_NCFGR_DBW_Pos) /**< \brief (GMAC_NCFGR) Data Bus Width */ -#define GMAC_NCFGR_DBW(value) ((GMAC_NCFGR_DBW_Msk & ((value) << GMAC_NCFGR_DBW_Pos))) -#define GMAC_NCFGR_DCPF (0x1u << 23) /**< \brief (GMAC_NCFGR) Disable Copy of Pause Frames */ -#define GMAC_NCFGR_RXCOEN (0x1u << 24) /**< \brief (GMAC_NCFGR) Receive Checksum Offload Enable */ -#define GMAC_NCFGR_EFRHD (0x1u << 25) /**< \brief (GMAC_NCFGR) Enable Frames Received in Half Duplex */ -#define GMAC_NCFGR_IRXFCS (0x1u << 26) /**< \brief (GMAC_NCFGR) Ignore RX FCS */ -#define GMAC_NCFGR_IPGSEN (0x1u << 28) /**< \brief (GMAC_NCFGR) IP Stretch Enable */ -#define GMAC_NCFGR_RXBP (0x1u << 29) /**< \brief (GMAC_NCFGR) Receive Bad Preamble */ -#define GMAC_NCFGR_IRXER (0x1u << 30) /**< \brief (GMAC_NCFGR) Ignore IPG GRXER */ -/* -------- GMAC_NSR : (GMAC Offset: 0x008) Network Status Register -------- */ -#define GMAC_NSR_MDIO (0x1u << 1) /**< \brief (GMAC_NSR) MDIO Input Status */ -#define GMAC_NSR_IDLE (0x1u << 2) /**< \brief (GMAC_NSR) PHY Management Logic Idle */ -/* -------- GMAC_UR : (GMAC Offset: 0x00C) User Register -------- */ -#define GMAC_UR_RMII (0x1u << 0) /**< \brief (GMAC_UR) Reduced MII Mode */ -/* -------- GMAC_DCFGR : (GMAC Offset: 0x010) DMA Configuration Register -------- */ -#define GMAC_DCFGR_FBLDO_Pos 0 -#define GMAC_DCFGR_FBLDO_Msk (0x1fu << GMAC_DCFGR_FBLDO_Pos) /**< \brief (GMAC_DCFGR) Fixed Burst Length for DMA Data Operations: */ -#define GMAC_DCFGR_FBLDO(value) ((GMAC_DCFGR_FBLDO_Msk & ((value) << GMAC_DCFGR_FBLDO_Pos))) -#define GMAC_DCFGR_FBLDO_SINGLE (0x1u << 0) /**< \brief (GMAC_DCFGR) 00001: Always use SINGLE AHB bursts */ -#define GMAC_DCFGR_FBLDO_INCR4 (0x4u << 0) /**< \brief (GMAC_DCFGR) 001xx: Attempt to use INCR4 AHB bursts (Default) */ -#define GMAC_DCFGR_FBLDO_INCR8 (0x8u << 0) /**< \brief (GMAC_DCFGR) 01xxx: Attempt to use INCR8 AHB bursts */ -#define GMAC_DCFGR_FBLDO_INCR16 (0x10u << 0) /**< \brief (GMAC_DCFGR) 1xxxx: Attempt to use INCR16 AHB bursts */ -#define GMAC_DCFGR_ESMA (0x1u << 6) /**< \brief (GMAC_DCFGR) Endian Swap Mode Enable for Management Descriptor Accesses */ -#define GMAC_DCFGR_ESPA (0x1u << 7) /**< \brief (GMAC_DCFGR) Endian Swap Mode Enable for Packet Data Accesses */ -#define GMAC_DCFGR_RXBMS_Pos 8 -#define GMAC_DCFGR_RXBMS_Msk (0x3u << GMAC_DCFGR_RXBMS_Pos) /**< \brief (GMAC_DCFGR) Receiver Packet Buffer Memory Size Select */ -#define GMAC_DCFGR_RXBMS(value) ((GMAC_DCFGR_RXBMS_Msk & ((value) << GMAC_DCFGR_RXBMS_Pos))) -#define GMAC_DCFGR_RXBMS_EIGHTH (0x0u << 8) /**< \brief (GMAC_DCFGR) 4/8 Kbyte Memory Size */ -#define GMAC_DCFGR_RXBMS_QUARTER (0x1u << 8) /**< \brief (GMAC_DCFGR) 4/4 Kbytes Memory Size */ -#define GMAC_DCFGR_RXBMS_HALF (0x2u << 8) /**< \brief (GMAC_DCFGR) 4/2 Kbytes Memory Size */ -#define GMAC_DCFGR_RXBMS_FULL (0x3u << 8) /**< \brief (GMAC_DCFGR) 4 Kbytes Memory Size */ -#define GMAC_DCFGR_TXPBMS (0x1u << 10) /**< \brief (GMAC_DCFGR) Transmitter Packet Buffer Memory Size Select */ -#define GMAC_DCFGR_TXCOEN (0x1u << 11) /**< \brief (GMAC_DCFGR) Transmitter Checksum Generation Offload Enable */ -#define GMAC_DCFGR_DRBS_Pos 16 -#define GMAC_DCFGR_DRBS_Msk (0xffu << GMAC_DCFGR_DRBS_Pos) /**< \brief (GMAC_DCFGR) DMA Receive Buffer Size */ -#define GMAC_DCFGR_DRBS(value) ((GMAC_DCFGR_DRBS_Msk & ((value) << GMAC_DCFGR_DRBS_Pos))) -#define GMAC_DCFGR_DDRP (0x1u << 24) /**< \brief (GMAC_DCFGR) DMA Discard Receive Packets */ -/* -------- GMAC_TSR : (GMAC Offset: 0x014) Transmit Status Register -------- */ -#define GMAC_TSR_UBR (0x1u << 0) /**< \brief (GMAC_TSR) Used Bit Read */ -#define GMAC_TSR_COL (0x1u << 1) /**< \brief (GMAC_TSR) Collision Occurred */ -#define GMAC_TSR_RLE (0x1u << 2) /**< \brief (GMAC_TSR) Retry Limit Exceeded */ -#define GMAC_TSR_TXGO (0x1u << 3) /**< \brief (GMAC_TSR) Transmit Go */ -#define GMAC_TSR_TFC (0x1u << 4) /**< \brief (GMAC_TSR) Transmit Frame Corruption Due to AHB Error */ -#define GMAC_TSR_TXCOMP (0x1u << 5) /**< \brief (GMAC_TSR) Transmit Complete */ -#define GMAC_TSR_HRESP (0x1u << 8) /**< \brief (GMAC_TSR) HRESP Not OK */ -/* -------- GMAC_RBQB : (GMAC Offset: 0x018) Receive Buffer Queue Base Address Register -------- */ -#define GMAC_RBQB_ADDR_Pos 2 -#define GMAC_RBQB_ADDR_Msk (0x3fffffffu << GMAC_RBQB_ADDR_Pos) /**< \brief (GMAC_RBQB) Receive Buffer Queue Base Address */ -#define GMAC_RBQB_ADDR(value) ((GMAC_RBQB_ADDR_Msk & ((value) << GMAC_RBQB_ADDR_Pos))) -/* -------- GMAC_TBQB : (GMAC Offset: 0x01C) Transmit Buffer Queue Base Address Register -------- */ -#define GMAC_TBQB_ADDR_Pos 2 -#define GMAC_TBQB_ADDR_Msk (0x3fffffffu << GMAC_TBQB_ADDR_Pos) /**< \brief (GMAC_TBQB) Transmit Buffer Queue Base Address */ -#define GMAC_TBQB_ADDR(value) ((GMAC_TBQB_ADDR_Msk & ((value) << GMAC_TBQB_ADDR_Pos))) -/* -------- GMAC_RSR : (GMAC Offset: 0x020) Receive Status Register -------- */ -#define GMAC_RSR_BNA (0x1u << 0) /**< \brief (GMAC_RSR) Buffer Not Available */ -#define GMAC_RSR_REC (0x1u << 1) /**< \brief (GMAC_RSR) Frame Received */ -#define GMAC_RSR_RXOVR (0x1u << 2) /**< \brief (GMAC_RSR) Receive Overrun */ -#define GMAC_RSR_HNO (0x1u << 3) /**< \brief (GMAC_RSR) HRESP Not OK */ -/* -------- GMAC_ISR : (GMAC Offset: 0x024) Interrupt Status Register -------- */ -#define GMAC_ISR_MFS (0x1u << 0) /**< \brief (GMAC_ISR) Management Frame Sent */ -#define GMAC_ISR_RCOMP (0x1u << 1) /**< \brief (GMAC_ISR) Receive Complete */ -#define GMAC_ISR_RXUBR (0x1u << 2) /**< \brief (GMAC_ISR) RX Used Bit Read */ -#define GMAC_ISR_TXUBR (0x1u << 3) /**< \brief (GMAC_ISR) TX Used Bit Read */ -#define GMAC_ISR_TUR (0x1u << 4) /**< \brief (GMAC_ISR) Transmit Underrun */ -#define GMAC_ISR_RLEX (0x1u << 5) /**< \brief (GMAC_ISR) Retry Limit Exceeded */ -#define GMAC_ISR_TFC (0x1u << 6) /**< \brief (GMAC_ISR) Transmit Frame Corruption Due to AHB Error */ -#define GMAC_ISR_TCOMP (0x1u << 7) /**< \brief (GMAC_ISR) Transmit Complete */ -#define GMAC_ISR_ROVR (0x1u << 10) /**< \brief (GMAC_ISR) Receive Overrun */ -#define GMAC_ISR_HRESP (0x1u << 11) /**< \brief (GMAC_ISR) HRESP Not OK */ -#define GMAC_ISR_PFNZ (0x1u << 12) /**< \brief (GMAC_ISR) Pause Frame with Non-zero Pause Quantum Received */ -#define GMAC_ISR_PTZ (0x1u << 13) /**< \brief (GMAC_ISR) Pause Time Zero */ -#define GMAC_ISR_PFTR (0x1u << 14) /**< \brief (GMAC_ISR) Pause Frame Transmitted */ -#define GMAC_ISR_DRQFR (0x1u << 18) /**< \brief (GMAC_ISR) PTP Delay Request Frame Received */ -#define GMAC_ISR_SFR (0x1u << 19) /**< \brief (GMAC_ISR) PTP Sync Frame Received */ -#define GMAC_ISR_DRQFT (0x1u << 20) /**< \brief (GMAC_ISR) PTP Delay Request Frame Transmitted */ -#define GMAC_ISR_SFT (0x1u << 21) /**< \brief (GMAC_ISR) PTP Sync Frame Transmitted */ -#define GMAC_ISR_PDRQFR (0x1u << 22) /**< \brief (GMAC_ISR) PDelay Request Frame Received */ -#define GMAC_ISR_PDRSFR (0x1u << 23) /**< \brief (GMAC_ISR) PDelay Response Frame Received */ -#define GMAC_ISR_PDRQFT (0x1u << 24) /**< \brief (GMAC_ISR) PDelay Request Frame Transmitted */ -#define GMAC_ISR_PDRSFT (0x1u << 25) /**< \brief (GMAC_ISR) PDelay Response Frame Transmitted */ -#define GMAC_ISR_SRI (0x1u << 26) /**< \brief (GMAC_ISR) TSU Seconds Register Increment */ -#define GMAC_ISR_LPI (0x1u << 27) /**< \brief (GMAC_ISR) RX LPI indication */ -#define GMAC_ISR_WOL (0x1u << 28) /**< \brief (GMAC_ISR) Wake On LAN */ -#define GMAC_ISR_TSU (0x1u << 29) /**< \brief (GMAC_ISR) TSU timer comparison interrupt */ -/* -------- GMAC_IER : (GMAC Offset: 0x028) Interrupt Enable Register -------- */ -#define GMAC_IER_MFS (0x1u << 0) /**< \brief (GMAC_IER) Management Frame Sent */ -#define GMAC_IER_RCOMP (0x1u << 1) /**< \brief (GMAC_IER) Receive Complete */ -#define GMAC_IER_RXUBR (0x1u << 2) /**< \brief (GMAC_IER) RX Used Bit Read */ -#define GMAC_IER_TXUBR (0x1u << 3) /**< \brief (GMAC_IER) TX Used Bit Read */ -#define GMAC_IER_TUR (0x1u << 4) /**< \brief (GMAC_IER) Transmit Underrun */ -#define GMAC_IER_RLEX (0x1u << 5) /**< \brief (GMAC_IER) Retry Limit Exceeded or Late Collision */ -#define GMAC_IER_TFC (0x1u << 6) /**< \brief (GMAC_IER) Transmit Frame Corruption Due to AHB Error */ -#define GMAC_IER_TCOMP (0x1u << 7) /**< \brief (GMAC_IER) Transmit Complete */ -#define GMAC_IER_ROVR (0x1u << 10) /**< \brief (GMAC_IER) Receive Overrun */ -#define GMAC_IER_HRESP (0x1u << 11) /**< \brief (GMAC_IER) HRESP Not OK */ -#define GMAC_IER_PFNZ (0x1u << 12) /**< \brief (GMAC_IER) Pause Frame with Non-zero Pause Quantum Received */ -#define GMAC_IER_PTZ (0x1u << 13) /**< \brief (GMAC_IER) Pause Time Zero */ -#define GMAC_IER_PFTR (0x1u << 14) /**< \brief (GMAC_IER) Pause Frame Transmitted */ -#define GMAC_IER_EXINT (0x1u << 15) /**< \brief (GMAC_IER) External Interrupt */ -#define GMAC_IER_DRQFR (0x1u << 18) /**< \brief (GMAC_IER) PTP Delay Request Frame Received */ -#define GMAC_IER_SFR (0x1u << 19) /**< \brief (GMAC_IER) PTP Sync Frame Received */ -#define GMAC_IER_DRQFT (0x1u << 20) /**< \brief (GMAC_IER) PTP Delay Request Frame Transmitted */ -#define GMAC_IER_SFT (0x1u << 21) /**< \brief (GMAC_IER) PTP Sync Frame Transmitted */ -#define GMAC_IER_PDRQFR (0x1u << 22) /**< \brief (GMAC_IER) PDelay Request Frame Received */ -#define GMAC_IER_PDRSFR (0x1u << 23) /**< \brief (GMAC_IER) PDelay Response Frame Received */ -#define GMAC_IER_PDRQFT (0x1u << 24) /**< \brief (GMAC_IER) PDelay Request Frame Transmitted */ -#define GMAC_IER_PDRSFT (0x1u << 25) /**< \brief (GMAC_IER) PDelay Response Frame Transmitted */ -#define GMAC_IER_SRI (0x1u << 26) /**< \brief (GMAC_IER) TSU Seconds Register Increment */ -#define GMAC_IER_LPI (0x1u << 27) /**< \brief (GMAC_IER) RX LPI indication */ -#define GMAC_IER_WOL (0x1u << 28) /**< \brief (GMAC_IER) Wake On LAN */ -#define GMAC_IER_TSU (0x1u << 29) /**< \brief (GMAC_IER) TSU timer comparison interrupt*/ -/* -------- GMAC_IDR : (GMAC Offset: 0x02C) Interrupt Disable Register -------- */ -#define GMAC_IDR_MFS (0x1u << 0) /**< \brief (GMAC_IDR) Management Frame Sent */ -#define GMAC_IDR_RCOMP (0x1u << 1) /**< \brief (GMAC_IDR) Receive Complete */ -#define GMAC_IDR_RXUBR (0x1u << 2) /**< \brief (GMAC_IDR) RX Used Bit Read */ -#define GMAC_IDR_TXUBR (0x1u << 3) /**< \brief (GMAC_IDR) TX Used Bit Read */ -#define GMAC_IDR_TUR (0x1u << 4) /**< \brief (GMAC_IDR) Transmit Underrun */ -#define GMAC_IDR_RLEX (0x1u << 5) /**< \brief (GMAC_IDR) Retry Limit Exceeded or Late Collision */ -#define GMAC_IDR_TFC (0x1u << 6) /**< \brief (GMAC_IDR) Transmit Frame Corruption Due to AHB Error */ -#define GMAC_IDR_TCOMP (0x1u << 7) /**< \brief (GMAC_IDR) Transmit Complete */ -#define GMAC_IDR_ROVR (0x1u << 10) /**< \brief (GMAC_IDR) Receive Overrun */ -#define GMAC_IDR_HRESP (0x1u << 11) /**< \brief (GMAC_IDR) HRESP Not OK */ -#define GMAC_IDR_PFNZ (0x1u << 12) /**< \brief (GMAC_IDR) Pause Frame with Non-zero Pause Quantum Received */ -#define GMAC_IDR_PTZ (0x1u << 13) /**< \brief (GMAC_IDR) Pause Time Zero */ -#define GMAC_IDR_PFTR (0x1u << 14) /**< \brief (GMAC_IDR) Pause Frame Transmitted */ -#define GMAC_IDR_EXINT (0x1u << 15) /**< \brief (GMAC_IDR) External Interrupt */ -#define GMAC_IDR_DRQFR (0x1u << 18) /**< \brief (GMAC_IDR) PTP Delay Request Frame Received */ -#define GMAC_IDR_SFR (0x1u << 19) /**< \brief (GMAC_IDR) PTP Sync Frame Received */ -#define GMAC_IDR_DRQFT (0x1u << 20) /**< \brief (GMAC_IDR) PTP Delay Request Frame Transmitted */ -#define GMAC_IDR_SFT (0x1u << 21) /**< \brief (GMAC_IDR) PTP Sync Frame Transmitted */ -#define GMAC_IDR_PDRQFR (0x1u << 22) /**< \brief (GMAC_IDR) PDelay Request Frame Received */ -#define GMAC_IDR_PDRSFR (0x1u << 23) /**< \brief (GMAC_IDR) PDelay Response Frame Received */ -#define GMAC_IDR_PDRQFT (0x1u << 24) /**< \brief (GMAC_IDR) PDelay Request Frame Transmitted */ -#define GMAC_IDR_PDRSFT (0x1u << 25) /**< \brief (GMAC_IDR) PDelay Response Frame Transmitted */ -#define GMAC_IDR_SRI (0x1u << 26) /**< \brief (GMAC_IDR) TSU Seconds Register Increment */ -#define GMAC_IDR_LPI (0x1u << 27) /**< \brief (GMAC_IER) RX LPI indication */ -#define GMAC_IDR_WOL (0x1u << 28) /**< \brief (GMAC_IER) Wake On LAN */ -#define GMAC_IDR_TSU (0x1u << 29) /**< \brief (GMAC_IER) TSU timer comparison interrupt*/ -/* -------- GMAC_IMR : (GMAC Offset: 0x030) Interrupt Mask Register -------- */ -#define GMAC_IMR_MFS (0x1u << 0) /**< \brief (GMAC_IMR) Management Frame Sent */ -#define GMAC_IMR_RCOMP (0x1u << 1) /**< \brief (GMAC_IMR) Receive Complete */ -#define GMAC_IMR_RXUBR (0x1u << 2) /**< \brief (GMAC_IMR) RX Used Bit Read */ -#define GMAC_IMR_TXUBR (0x1u << 3) /**< \brief (GMAC_IMR) TX Used Bit Read */ -#define GMAC_IMR_TUR (0x1u << 4) /**< \brief (GMAC_IMR) Transmit Underrun */ -#define GMAC_IMR_RLEX (0x1u << 5) /**< \brief (GMAC_IMR) Retry Limit Exceeded */ -#define GMAC_IMR_TFC (0x1u << 6) /**< \brief (GMAC_IMR) Transmit Frame Corruption Due to AHB Error */ -#define GMAC_IMR_TCOMP (0x1u << 7) /**< \brief (GMAC_IMR) Transmit Complete */ -#define GMAC_IMR_ROVR (0x1u << 10) /**< \brief (GMAC_IMR) Receive Overrun */ -#define GMAC_IMR_HRESP (0x1u << 11) /**< \brief (GMAC_IMR) HRESP Not OK */ -#define GMAC_IMR_PFNZ (0x1u << 12) /**< \brief (GMAC_IMR) Pause Frame with Non-zero Pause Quantum Received */ -#define GMAC_IMR_PTZ (0x1u << 13) /**< \brief (GMAC_IMR) Pause Time Zero */ -#define GMAC_IMR_PFTR (0x1u << 14) /**< \brief (GMAC_IMR) Pause Frame Transmitted */ -#define GMAC_IMR_EXINT (0x1u << 15) /**< \brief (GMAC_IMR) External Interrupt */ -#define GMAC_IMR_DRQFR (0x1u << 18) /**< \brief (GMAC_IMR) PTP Delay Request Frame Received */ -#define GMAC_IMR_SFR (0x1u << 19) /**< \brief (GMAC_IMR) PTP Sync Frame Received */ -#define GMAC_IMR_DRQFT (0x1u << 20) /**< \brief (GMAC_IMR) PTP Delay Request Frame Transmitted */ -#define GMAC_IMR_SFT (0x1u << 21) /**< \brief (GMAC_IMR) PTP Sync Frame Transmitted */ -#define GMAC_IMR_PDRQFR (0x1u << 22) /**< \brief (GMAC_IMR) PDelay Request Frame Received */ -#define GMAC_IMR_PDRSFR (0x1u << 23) /**< \brief (GMAC_IMR) PDelay Response Frame Received */ -#define GMAC_IMR_PDRQFT (0x1u << 24) /**< \brief (GMAC_IMR) PDelay Request Frame Transmitted */ -#define GMAC_IMR_PDRSFT (0x1u << 25) /**< \brief (GMAC_IMR) PDelay Response Frame Transmitted */ -#define GMAC_IMR_SRI (0x1u << 26) /**< \brief (GMAC_IDR) TSU Seconds Register Increment */ -#define GMAC_IMR_LPI (0x1u << 27) /**< \brief (GMAC_IER) RX LPI indication */ -#define GMAC_IMR_WOL (0x1u << 28) /**< \brief (GMAC_IER) Wake On LAN */ -#define GMAC_IMR_TSU (0x1u << 29) /**< \brief (GMAC_IER) TSU timer comparison interrupt*/ -/* -------- GMAC_MAN : (GMAC Offset: 0x034) PHY Maintenance Register -------- */ -#define GMAC_MAN_DATA_Pos 0 -#define GMAC_MAN_DATA_Msk (0xffffu << GMAC_MAN_DATA_Pos) /**< \brief (GMAC_MAN) PHY Data */ -#define GMAC_MAN_DATA(value) ((GMAC_MAN_DATA_Msk & ((value) << GMAC_MAN_DATA_Pos))) -#define GMAC_MAN_WTN_Pos 16 -#define GMAC_MAN_WTN_Msk (0x3u << GMAC_MAN_WTN_Pos) /**< \brief (GMAC_MAN) Write Ten */ -#define GMAC_MAN_WTN(value) ((GMAC_MAN_WTN_Msk & ((value) << GMAC_MAN_WTN_Pos))) -#define GMAC_MAN_REGA_Pos 18 -#define GMAC_MAN_REGA_Msk (0x1fu << GMAC_MAN_REGA_Pos) /**< \brief (GMAC_MAN) Register Address */ -#define GMAC_MAN_REGA(value) ((GMAC_MAN_REGA_Msk & ((value) << GMAC_MAN_REGA_Pos))) -#define GMAC_MAN_PHYA_Pos 23 -#define GMAC_MAN_PHYA_Msk (0x1fu << GMAC_MAN_PHYA_Pos) /**< \brief (GMAC_MAN) PHY Address */ -#define GMAC_MAN_PHYA(value) ((GMAC_MAN_PHYA_Msk & ((value) << GMAC_MAN_PHYA_Pos))) -#define GMAC_MAN_OP_Pos 28 -#define GMAC_MAN_OP_Msk (0x3u << GMAC_MAN_OP_Pos) /**< \brief (GMAC_MAN) Operation */ -#define GMAC_MAN_OP(value) ((GMAC_MAN_OP_Msk & ((value) << GMAC_MAN_OP_Pos))) -#define GMAC_MAN_CLTTO (0x1u << 30) /**< \brief (GMAC_MAN) Clause 22 Operation */ -#define GMAC_MAN_WZO (0x1u << 31) /**< \brief (GMAC_MAN) Write ZERO */ -/* -------- GMAC_RPQ : (GMAC Offset: 0x038) Received Pause Quantum Register -------- */ -#define GMAC_RPQ_RPQ_Pos 0 -#define GMAC_RPQ_RPQ_Msk (0xffffu << GMAC_RPQ_RPQ_Pos) /**< \brief (GMAC_RPQ) Received Pause Quantum */ -/* -------- GMAC_TPQ : (GMAC Offset: 0x03C) Transmit Pause Quantum Register -------- */ -#define GMAC_TPQ_TPQ_Pos 0 -#define GMAC_TPQ_TPQ_Msk (0xffffu << GMAC_TPQ_TPQ_Pos) /**< \brief (GMAC_TPQ) Transmit Pause Quantum */ -#define GMAC_TPQ_TPQ(value) ((GMAC_TPQ_TPQ_Msk & ((value) << GMAC_TPQ_TPQ_Pos))) -/* -------- GMAC_TPSF : (GMAC Offset: 0x040) TX Partial Store and Forward Register -------- */ -#define GMAC_TPSF_TPB1ADR_Pos 0 -#define GMAC_TPSF_TPB1ADR_Msk (0xfffu << GMAC_TPSF_TPB1ADR_Pos) /**< \brief (GMAC_TPSF) Transmit Partial Store and Forward Address */ -#define GMAC_TPSF_TPB1ADR(value) ((GMAC_TPSF_TPB1ADR_Msk & ((value) << GMAC_TPSF_TPB1ADR_Pos))) -#define GMAC_TPSF_ENTXP (0x1u << 31) /**< \brief (GMAC_TPSF) Enable TX Partial Store and Forward Operation */ -/* -------- GMAC_RPSF : (GMAC Offset: 0x044) RX Partial Store and Forward Register -------- */ -#define GMAC_RPSF_RPB1ADR_Pos 0 -#define GMAC_RPSF_RPB1ADR_Msk (0xfffu << GMAC_RPSF_RPB1ADR_Pos) /**< \brief (GMAC_RPSF) Receive Partial Store and Forward Address */ -#define GMAC_RPSF_RPB1ADR(value) ((GMAC_RPSF_RPB1ADR_Msk & ((value) << GMAC_RPSF_RPB1ADR_Pos))) -#define GMAC_RPSF_ENRXP (0x1u << 31) /**< \brief (GMAC_RPSF) Enable RX Partial Store and Forward Operation */ -/* -------- GMAC_RJFML : (GMAC Offset: 0x048) RX Jumbo Frame Max Length Register -------- */ -#define GMAC_RJFML_FML_Pos 0 -#define GMAC_RJFML_FML_Msk (0x3fffu << GMAC_RJFML_FML_Pos) /**< \brief (GMAC_RJFML) Frame Max Length */ -#define GMAC_RJFML_FML(value) ((GMAC_RJFML_FML_Msk & ((value) << GMAC_RJFML_FML_Pos))) -/* -------- GMAC_HRB : (GMAC Offset: 0x080) Hash Register Bottom -------- */ -#define GMAC_HRB_ADDR_Pos 0 -#define GMAC_HRB_ADDR_Msk (0xffffffffu << GMAC_HRB_ADDR_Pos) /**< \brief (GMAC_HRB) Hash Address */ -#define GMAC_HRB_ADDR(value) ((GMAC_HRB_ADDR_Msk & ((value) << GMAC_HRB_ADDR_Pos))) -/* -------- GMAC_HRT : (GMAC Offset: 0x084) Hash Register Top -------- */ -#define GMAC_HRT_ADDR_Pos 0 -#define GMAC_HRT_ADDR_Msk (0xffffffffu << GMAC_HRT_ADDR_Pos) /**< \brief (GMAC_HRT) Hash Address */ -#define GMAC_HRT_ADDR(value) ((GMAC_HRT_ADDR_Msk & ((value) << GMAC_HRT_ADDR_Pos))) -/* -------- GMAC_SAB : (GMAC Offset: N/A) Specific Address 1 Bottom Register -------- */ -#define GMAC_SAB_ADDR_Pos 0 -#define GMAC_SAB_ADDR_Msk (0xffffffffu << GMAC_SAB_ADDR_Pos) /**< \brief (GMAC_SAB) Specific Address 1 */ -#define GMAC_SAB_ADDR(value) ((GMAC_SAB_ADDR_Msk & ((value) << GMAC_SAB_ADDR_Pos))) -/* -------- GMAC_SAT : (GMAC Offset: N/A) Specific Address 1 Top Register -------- */ -#define GMAC_SAT_ADDR_Pos 0 -#define GMAC_SAT_ADDR_Msk (0xffffu << GMAC_SAT_ADDR_Pos) /**< \brief (GMAC_SAT) Specific Address 1 */ -#define GMAC_SAT_ADDR(value) ((GMAC_SAT_ADDR_Msk & ((value) << GMAC_SAT_ADDR_Pos))) -/* -------- GMAC_TIDM1 : (GMAC Offset: 0x0A8) Type ID Match 1 Register -------- */ -#define GMAC_TIDM1_TID_Pos 0 -#define GMAC_TIDM1_TID_Msk (0xffffu << GMAC_TIDM1_TID_Pos) /**< \brief (GMAC_TIDM1) Type ID Match 1 */ -#define GMAC_TIDM1_TID(value) ((GMAC_TIDM1_TID_Msk & ((value) << GMAC_TIDM1_TID_Pos))) -#define GMAC_TIDM1_ENID1 (0x1u << 31) /**< \brief (GMAC_TIDM1) Enable Copying of TID Matched Frames */ -/* -------- GMAC_TIDM2 : (GMAC Offset: 0x0AC) Type ID Match 2 Register -------- */ -#define GMAC_TIDM2_TID_Pos 0 -#define GMAC_TIDM2_TID_Msk (0xffffu << GMAC_TIDM2_TID_Pos) /**< \brief (GMAC_TIDM2) Type ID Match 2 */ -#define GMAC_TIDM2_TID(value) ((GMAC_TIDM2_TID_Msk & ((value) << GMAC_TIDM2_TID_Pos))) -#define GMAC_TIDM2_ENID2 (0x1u << 31) /**< \brief (GMAC_TIDM2) Enable Copying of TID Matched Frames */ -/* -------- GMAC_TIDM3 : (GMAC Offset: 0x0B0) Type ID Match 3 Register -------- */ -#define GMAC_TIDM3_TID_Pos 0 -#define GMAC_TIDM3_TID_Msk (0xffffu << GMAC_TIDM3_TID_Pos) /**< \brief (GMAC_TIDM3) Type ID Match 3 */ -#define GMAC_TIDM3_TID(value) ((GMAC_TIDM3_TID_Msk & ((value) << GMAC_TIDM3_TID_Pos))) -#define GMAC_TIDM3_ENID3 (0x1u << 31) /**< \brief (GMAC_TIDM3) Enable Copying of TID Matched Frames */ -/* -------- GMAC_TIDM4 : (GMAC Offset: 0x0B4) Type ID Match 4 Register -------- */ -#define GMAC_TIDM4_TID_Pos 0 -#define GMAC_TIDM4_TID_Msk (0xffffu << GMAC_TIDM4_TID_Pos) /**< \brief (GMAC_TIDM4) Type ID Match 4 */ -#define GMAC_TIDM4_TID(value) ((GMAC_TIDM4_TID_Msk & ((value) << GMAC_TIDM4_TID_Pos))) -#define GMAC_TIDM4_ENID4 (0x1u << 31) /**< \brief (GMAC_TIDM4) Enable Copying of TID Matched Frames */ -/* -------- GMAC_WOL : (GMAC Offset: 0x0B8) Wake on LAN Register -------- */ -#define GMAC_WOL_IP_Pos 0 -#define GMAC_WOL_IP_Msk (0xffffu << GMAC_WOL_IP_Pos) /**< \brief (GMAC_WOL) ARP Request IP Address */ -#define GMAC_WOL_IP(value) ((GMAC_WOL_IP_Msk & ((value) << GMAC_WOL_IP_Pos))) -#define GMAC_WOL_MAG (0x1u << 16) /**< \brief (GMAC_WOL) Magic Packet Event Enable */ -#define GMAC_WOL_ARP (0x1u << 17) /**< \brief (GMAC_WOL) ARP Request IP Address */ -#define GMAC_WOL_SA1 (0x1u << 18) /**< \brief (GMAC_WOL) Specific Address Register 1 Event Enable */ -#define GMAC_WOL_MTI (0x1u << 19) /**< \brief (GMAC_WOL) Multicast Hash Event Enable */ -/* -------- GMAC_IPGS : (GMAC Offset: 0x0BC) IPG Stretch Register -------- */ -#define GMAC_IPGS_FL_Pos 0 -#define GMAC_IPGS_FL_Msk (0xffffu << GMAC_IPGS_FL_Pos) /**< \brief (GMAC_IPGS) Frame Length */ -#define GMAC_IPGS_FL(value) ((GMAC_IPGS_FL_Msk & ((value) << GMAC_IPGS_FL_Pos))) -/* -------- GMAC_SVLAN : (GMAC Offset: 0x0C0) Stacked VLAN Register -------- */ -#define GMAC_SVLAN_VLAN_TYPE_Pos 0 -#define GMAC_SVLAN_VLAN_TYPE_Msk (0xffffu << GMAC_SVLAN_VLAN_TYPE_Pos) /**< \brief (GMAC_SVLAN) User Defined VLAN_TYPE Field */ -#define GMAC_SVLAN_VLAN_TYPE(value) ((GMAC_SVLAN_VLAN_TYPE_Msk & ((value) << GMAC_SVLAN_VLAN_TYPE_Pos))) -#define GMAC_SVLAN_ESVLAN (0x1u << 31) /**< \brief (GMAC_SVLAN) Enable Stacked VLAN Processing Mode */ -/* -------- GMAC_TPFCP : (GMAC Offset: 0x0C4) Transmit PFC Pause Register -------- */ -#define GMAC_TPFCP_PEV_Pos 0 -#define GMAC_TPFCP_PEV_Msk (0xffu << GMAC_TPFCP_PEV_Pos) /**< \brief (GMAC_TPFCP) Priority Enable Vector */ -#define GMAC_TPFCP_PEV(value) ((GMAC_TPFCP_PEV_Msk & ((value) << GMAC_TPFCP_PEV_Pos))) -#define GMAC_TPFCP_PQ_Pos 8 -#define GMAC_TPFCP_PQ_Msk (0xffu << GMAC_TPFCP_PQ_Pos) /**< \brief (GMAC_TPFCP) Pause Quantum */ -#define GMAC_TPFCP_PQ(value) ((GMAC_TPFCP_PQ_Msk & ((value) << GMAC_TPFCP_PQ_Pos))) -/* -------- GMAC_SAMB1 : (GMAC Offset: 0x0C8) Specific Address 1 Mask Bottom Register -------- */ -#define GMAC_SAMB1_ADDR_Pos 0 -#define GMAC_SAMB1_ADDR_Msk (0xffffffffu << GMAC_SAMB1_ADDR_Pos) /**< \brief (GMAC_SAMB1) Specific Address 1 Mask */ -#define GMAC_SAMB1_ADDR(value) ((GMAC_SAMB1_ADDR_Msk & ((value) << GMAC_SAMB1_ADDR_Pos))) -/* -------- GMAC_SAMT1 : (GMAC Offset: 0x0CC) Specific Address 1 Mask Top Register -------- */ -#define GMAC_SAMT1_ADDR_Pos 0 -#define GMAC_SAMT1_ADDR_Msk (0xffffu << GMAC_SAMT1_ADDR_Pos) /**< \brief (GMAC_SAMT1) Specific Address 1 Mask */ -#define GMAC_SAMT1_ADDR(value) ((GMAC_SAMT1_ADDR_Msk & ((value) << GMAC_SAMT1_ADDR_Pos))) -/* -------- GMAC_NSC : (GMAC Offset: 0x0DC) 1588 Timer Nanosecond Comparison Register -------- */ -#define GMAC_NSC_NANOSEC_Pos 0 -#define GMAC_NSC_NANOSEC_Msk (0x3fffffu << GMAC_NSC_NANOSEC_Pos) /**< \brief (GMAC_NSC) 1588 Timer Nanosecond Comparison Value */ -#define GMAC_NSC_NANOSEC(value) ((GMAC_NSC_NANOSEC_Msk & ((value) << GMAC_NSC_NANOSEC_Pos))) -/* -------- GMAC_SCL : (GMAC Offset: 0x0E0) 1588 Timer Second Comparison Low Register -------- */ -#define GMAC_SCL_SEC_Pos 0 -#define GMAC_SCL_SEC_Msk (0xffffffffu << GMAC_SCL_SEC_Pos) /**< \brief (GMAC_SCL) 1588 Timer Second Comparison Value */ -#define GMAC_SCL_SEC(value) ((GMAC_SCL_SEC_Msk & ((value) << GMAC_SCL_SEC_Pos))) -/* -------- GMAC_SCH : (GMAC Offset: 0x0E4) 1588 Timer Second Comparison High Register -------- */ -#define GMAC_SCH_SEC_Pos 0 -#define GMAC_SCH_SEC_Msk (0xffffu << GMAC_SCH_SEC_Pos) /**< \brief (GMAC_SCH) 1588 Timer Second Comparison Value */ -#define GMAC_SCH_SEC(value) ((GMAC_SCH_SEC_Msk & ((value) << GMAC_SCH_SEC_Pos))) -/* -------- GMAC_EFTSH : (GMAC Offset: 0x0E8) PTP Event Frame Transmitted Seconds High Register -------- */ -#define GMAC_EFTSH_RUD_Pos 0 -#define GMAC_EFTSH_RUD_Msk (0xffffu << GMAC_EFTSH_RUD_Pos) /**< \brief (GMAC_EFTSH) Register Update */ -/* -------- GMAC_EFRSH : (GMAC Offset: 0x0EC) PTP Event Frame Received Seconds High Register -------- */ -#define GMAC_EFRSH_RUD_Pos 0 -#define GMAC_EFRSH_RUD_Msk (0xffffu << GMAC_EFRSH_RUD_Pos) /**< \brief (GMAC_EFRSH) Register Update */ -/* -------- GMAC_PEFTSH : (GMAC Offset: 0x0F0) PTP Peer Event Frame Transmitted Seconds High Register -------- */ -#define GMAC_PEFTSH_RUD_Pos 0 -#define GMAC_PEFTSH_RUD_Msk (0xffffu << GMAC_PEFTSH_RUD_Pos) /**< \brief (GMAC_PEFTSH) Register Update */ -/* -------- GMAC_PEFRSH : (GMAC Offset: 0x0F4) PTP Peer Event Frame Received Seconds High Register -------- */ -#define GMAC_PEFRSH_RUD_Pos 0 -#define GMAC_PEFRSH_RUD_Msk (0xffffu << GMAC_PEFRSH_RUD_Pos) /**< \brief (GMAC_PEFRSH) Register Update */ -/* -------- GMAC_OTLO : (GMAC Offset: 0x100) Octets Transmitted Low Register -------- */ -#define GMAC_OTLO_TXO_Pos 0 -#define GMAC_OTLO_TXO_Msk (0xffffffffu << GMAC_OTLO_TXO_Pos) /**< \brief (GMAC_OTLO) Transmitted Octets */ -/* -------- GMAC_OTHI : (GMAC Offset: 0x104) Octets Transmitted High Register -------- */ -#define GMAC_OTHI_TXO_Pos 0 -#define GMAC_OTHI_TXO_Msk (0xffffu << GMAC_OTHI_TXO_Pos) /**< \brief (GMAC_OTHI) Transmitted Octets */ -/* -------- GMAC_FT : (GMAC Offset: 0x108) Frames Transmitted Register -------- */ -#define GMAC_FT_FTX_Pos 0 -#define GMAC_FT_FTX_Msk (0xffffffffu << GMAC_FT_FTX_Pos) /**< \brief (GMAC_FT) Frames Transmitted without Error */ -/* -------- GMAC_BCFT : (GMAC Offset: 0x10C) Broadcast Frames Transmitted Register -------- */ -#define GMAC_BCFT_BFTX_Pos 0 -#define GMAC_BCFT_BFTX_Msk (0xffffffffu << GMAC_BCFT_BFTX_Pos) /**< \brief (GMAC_BCFT) Broadcast Frames Transmitted without Error */ -/* -------- GMAC_MFT : (GMAC Offset: 0x110) Multicast Frames Transmitted Register -------- */ -#define GMAC_MFT_MFTX_Pos 0 -#define GMAC_MFT_MFTX_Msk (0xffffffffu << GMAC_MFT_MFTX_Pos) /**< \brief (GMAC_MFT) Multicast Frames Transmitted without Error */ -/* -------- GMAC_PFT : (GMAC Offset: 0x114) Pause Frames Transmitted Register -------- */ -#define GMAC_PFT_PFTX_Pos 0 -#define GMAC_PFT_PFTX_Msk (0xffffu << GMAC_PFT_PFTX_Pos) /**< \brief (GMAC_PFT) Pause Frames Transmitted Register */ -/* -------- GMAC_BFT64 : (GMAC Offset: 0x118) 64 Byte Frames Transmitted Register -------- */ -#define GMAC_BFT64_NFTX_Pos 0 -#define GMAC_BFT64_NFTX_Msk (0xffffffffu << GMAC_BFT64_NFTX_Pos) /**< \brief (GMAC_BFT64) 64 Byte Frames Transmitted without Error */ -/* -------- GMAC_TBFT127 : (GMAC Offset: 0x11C) 65 to 127 Byte Frames Transmitted Register -------- */ -#define GMAC_TBFT127_NFTX_Pos 0 -#define GMAC_TBFT127_NFTX_Msk (0xffffffffu << GMAC_TBFT127_NFTX_Pos) /**< \brief (GMAC_TBFT127) 65 to 127 Byte Frames Transmitted without Error */ -/* -------- GMAC_TBFT255 : (GMAC Offset: 0x120) 128 to 255 Byte Frames Transmitted Register -------- */ -#define GMAC_TBFT255_NFTX_Pos 0 -#define GMAC_TBFT255_NFTX_Msk (0xffffffffu << GMAC_TBFT255_NFTX_Pos) /**< \brief (GMAC_TBFT255) 128 to 255 Byte Frames Transmitted without Error */ -/* -------- GMAC_TBFT511 : (GMAC Offset: 0x124) 256 to 511 Byte Frames Transmitted Register -------- */ -#define GMAC_TBFT511_NFTX_Pos 0 -#define GMAC_TBFT511_NFTX_Msk (0xffffffffu << GMAC_TBFT511_NFTX_Pos) /**< \brief (GMAC_TBFT511) 256 to 511 Byte Frames Transmitted without Error */ -/* -------- GMAC_TBFT1023 : (GMAC Offset: 0x128) 512 to 1023 Byte Frames Transmitted Register -------- */ -#define GMAC_TBFT1023_NFTX_Pos 0 -#define GMAC_TBFT1023_NFTX_Msk (0xffffffffu << GMAC_TBFT1023_NFTX_Pos) /**< \brief (GMAC_TBFT1023) 512 to 1023 Byte Frames Transmitted without Error */ -/* -------- GMAC_TBFT1518 : (GMAC Offset: 0x12C) 1024 to 1518 Byte Frames Transmitted Register -------- */ -#define GMAC_TBFT1518_NFTX_Pos 0 -#define GMAC_TBFT1518_NFTX_Msk (0xffffffffu << GMAC_TBFT1518_NFTX_Pos) /**< \brief (GMAC_TBFT1518) 1024 to 1518 Byte Frames Transmitted without Error */ -/* -------- GMAC_GTBFT1518 : (GMAC Offset: 0x130) Greater Than 1518 Byte Frames Transmitted Register -------- */ -#define GMAC_GTBFT1518_NFTX_Pos 0 -#define GMAC_GTBFT1518_NFTX_Msk (0xffffffffu << GMAC_GTBFT1518_NFTX_Pos) /**< \brief (GMAC_GTBFT1518) Greater than 1518 Byte Frames Transmitted without Error */ -/* -------- GMAC_TUR : (GMAC Offset: 0x134) Transmit Underruns Register -------- */ -#define GMAC_TUR_TXUNR_Pos 0 -#define GMAC_TUR_TXUNR_Msk (0x3ffu << GMAC_TUR_TXUNR_Pos) /**< \brief (GMAC_TUR) Transmit Underruns */ -/* -------- GMAC_SCF : (GMAC Offset: 0x138) Single Collision Frames Register -------- */ -#define GMAC_SCF_SCOL_Pos 0 -#define GMAC_SCF_SCOL_Msk (0x3ffffu << GMAC_SCF_SCOL_Pos) /**< \brief (GMAC_SCF) Single Collision */ -/* -------- GMAC_MCF : (GMAC Offset: 0x13C) Multiple Collision Frames Register -------- */ -#define GMAC_MCF_MCOL_Pos 0 -#define GMAC_MCF_MCOL_Msk (0x3ffffu << GMAC_MCF_MCOL_Pos) /**< \brief (GMAC_MCF) Multiple Collision */ -/* -------- GMAC_EC : (GMAC Offset: 0x140) Excessive Collisions Register -------- */ -#define GMAC_EC_XCOL_Pos 0 -#define GMAC_EC_XCOL_Msk (0x3ffu << GMAC_EC_XCOL_Pos) /**< \brief (GMAC_EC) Excessive Collisions */ -/* -------- GMAC_LC : (GMAC Offset: 0x144) Late Collisions Register -------- */ -#define GMAC_LC_LCOL_Pos 0 -#define GMAC_LC_LCOL_Msk (0x3ffu << GMAC_LC_LCOL_Pos) /**< \brief (GMAC_LC) Late Collisions */ -/* -------- GMAC_DTF : (GMAC Offset: 0x148) Deferred Transmission Frames Register -------- */ -#define GMAC_DTF_DEFT_Pos 0 -#define GMAC_DTF_DEFT_Msk (0x3ffffu << GMAC_DTF_DEFT_Pos) /**< \brief (GMAC_DTF) Deferred Transmission */ -/* -------- GMAC_CSE : (GMAC Offset: 0x14C) Carrier Sense Errors Register Register -------- */ -#define GMAC_CSE_CSR_Pos 0 -#define GMAC_CSE_CSR_Msk (0x3ffu << GMAC_CSE_CSR_Pos) /**< \brief (GMAC_CSE) Carrier Sense Error */ -/* -------- GMAC_ORLO : (GMAC Offset: 0x150) Octets Received Low Received Register -------- */ -#define GMAC_ORLO_RXO_Pos 0 -#define GMAC_ORLO_RXO_Msk (0xffffffffu << GMAC_ORLO_RXO_Pos) /**< \brief (GMAC_ORLO) Received Octets */ -/* -------- GMAC_ORHI : (GMAC Offset: 0x154) Octets Received High Received Register -------- */ -#define GMAC_ORHI_RXO_Pos 0 -#define GMAC_ORHI_RXO_Msk (0xffffu << GMAC_ORHI_RXO_Pos) /**< \brief (GMAC_ORHI) Received Octets */ -/* -------- GMAC_FR : (GMAC Offset: 0x158) Frames Received Register -------- */ -#define GMAC_FR_FRX_Pos 0 -#define GMAC_FR_FRX_Msk (0xffffffffu << GMAC_FR_FRX_Pos) /**< \brief (GMAC_FR) Frames Received without Error */ -/* -------- GMAC_BCFR : (GMAC Offset: 0x15C) Broadcast Frames Received Register -------- */ -#define GMAC_BCFR_BFRX_Pos 0 -#define GMAC_BCFR_BFRX_Msk (0xffffffffu << GMAC_BCFR_BFRX_Pos) /**< \brief (GMAC_BCFR) Broadcast Frames Received without Error */ -/* -------- GMAC_MFR : (GMAC Offset: 0x160) Multicast Frames Received Register -------- */ -#define GMAC_MFR_MFRX_Pos 0 -#define GMAC_MFR_MFRX_Msk (0xffffffffu << GMAC_MFR_MFRX_Pos) /**< \brief (GMAC_MFR) Multicast Frames Received without Error */ -/* -------- GMAC_PFR : (GMAC Offset: 0x164) Pause Frames Received Register -------- */ -#define GMAC_PFR_PFRX_Pos 0 -#define GMAC_PFR_PFRX_Msk (0xffffu << GMAC_PFR_PFRX_Pos) /**< \brief (GMAC_PFR) Pause Frames Received Register */ -/* -------- GMAC_BFR64 : (GMAC Offset: 0x168) 64 Byte Frames Received Register -------- */ -#define GMAC_BFR64_NFRX_Pos 0 -#define GMAC_BFR64_NFRX_Msk (0xffffffffu << GMAC_BFR64_NFRX_Pos) /**< \brief (GMAC_BFR64) 64 Byte Frames Received without Error */ -/* -------- GMAC_TBFR127 : (GMAC Offset: 0x16C) 65 to 127 Byte Frames Received Register -------- */ -#define GMAC_TBFR127_NFRX_Pos 0 -#define GMAC_TBFR127_NFRX_Msk (0xffffffffu << GMAC_TBFR127_NFRX_Pos) /**< \brief (GMAC_TBFR127) 65 to 127 Byte Frames Received without Error */ -/* -------- GMAC_TBFR255 : (GMAC Offset: 0x170) 128 to 255 Byte Frames Received Register -------- */ -#define GMAC_TBFR255_NFRX_Pos 0 -#define GMAC_TBFR255_NFRX_Msk (0xffffffffu << GMAC_TBFR255_NFRX_Pos) /**< \brief (GMAC_TBFR255) 128 to 255 Byte Frames Received without Error */ -/* -------- GMAC_TBFR511 : (GMAC Offset: 0x174) 256 to 511 Byte Frames Received Register -------- */ -#define GMAC_TBFR511_NFRX_Pos 0 -#define GMAC_TBFR511_NFRX_Msk (0xffffffffu << GMAC_TBFR511_NFRX_Pos) /**< \brief (GMAC_TBFR511) 256 to 511 Byte Frames Received without Error */ -/* -------- GMAC_TBFR1023 : (GMAC Offset: 0x178) 512 to 1023 Byte Frames Received Register -------- */ -#define GMAC_TBFR1023_NFRX_Pos 0 -#define GMAC_TBFR1023_NFRX_Msk (0xffffffffu << GMAC_TBFR1023_NFRX_Pos) /**< \brief (GMAC_TBFR1023) 512 to 1023 Byte Frames Received without Error */ -/* -------- GMAC_TBFR1518 : (GMAC Offset: 0x17C) 1024 to 1518 Byte Frames Received Register -------- */ -#define GMAC_TBFR1518_NFRX_Pos 0 -#define GMAC_TBFR1518_NFRX_Msk (0xffffffffu << GMAC_TBFR1518_NFRX_Pos) /**< \brief (GMAC_TBFR1518) 1024 to 1518 Byte Frames Received without Error */ -/* -------- GMAC_TMXBFR : (GMAC Offset: 0x180) 1519 to Maximum Byte Frames Received Register -------- */ -#define GMAC_TMXBFR_NFRX_Pos 0 -#define GMAC_TMXBFR_NFRX_Msk (0xffffffffu << GMAC_TMXBFR_NFRX_Pos) /**< \brief (GMAC_TMXBFR) 1519 to Maximum Byte Frames Received without Error */ -/* -------- GMAC_UFR : (GMAC Offset: 0x184) Undersize Frames Received Register -------- */ -#define GMAC_UFR_UFRX_Pos 0 -#define GMAC_UFR_UFRX_Msk (0x3ffu << GMAC_UFR_UFRX_Pos) /**< \brief (GMAC_UFR) Undersize Frames Received */ -/* -------- GMAC_OFR : (GMAC Offset: 0x188) Oversize Frames Received Register -------- */ -#define GMAC_OFR_OFRX_Pos 0 -#define GMAC_OFR_OFRX_Msk (0x3ffu << GMAC_OFR_OFRX_Pos) /**< \brief (GMAC_OFR) Oversized Frames Received */ -/* -------- GMAC_JR : (GMAC Offset: 0x18C) Jabbers Received Register -------- */ -#define GMAC_JR_JRX_Pos 0 -#define GMAC_JR_JRX_Msk (0x3ffu << GMAC_JR_JRX_Pos) /**< \brief (GMAC_JR) Jabbers Received */ -/* -------- GMAC_FCSE : (GMAC Offset: 0x190) Frame Check Sequence Errors Register -------- */ -#define GMAC_FCSE_FCKR_Pos 0 -#define GMAC_FCSE_FCKR_Msk (0x3ffu << GMAC_FCSE_FCKR_Pos) /**< \brief (GMAC_FCSE) Frame Check Sequence Errors */ -/* -------- GMAC_LFFE : (GMAC Offset: 0x194) Length Field Frame Errors Register -------- */ -#define GMAC_LFFE_LFER_Pos 0 -#define GMAC_LFFE_LFER_Msk (0x3ffu << GMAC_LFFE_LFER_Pos) /**< \brief (GMAC_LFFE) Length Field Frame Errors */ -/* -------- GMAC_RSE : (GMAC Offset: 0x198) Receive Symbol Errors Register -------- */ -#define GMAC_RSE_RXSE_Pos 0 -#define GMAC_RSE_RXSE_Msk (0x3ffu << GMAC_RSE_RXSE_Pos) /**< \brief (GMAC_RSE) Receive Symbol Errors */ -/* -------- GMAC_AE : (GMAC Offset: 0x19C) Alignment Errors Register -------- */ -#define GMAC_AE_AER_Pos 0 -#define GMAC_AE_AER_Msk (0x3ffu << GMAC_AE_AER_Pos) /**< \brief (GMAC_AE) Alignment Errors */ -/* -------- GMAC_RRE : (GMAC Offset: 0x1A0) Receive Resource Errors Register -------- */ -#define GMAC_RRE_RXRER_Pos 0 -#define GMAC_RRE_RXRER_Msk (0x3ffffu << GMAC_RRE_RXRER_Pos) /**< \brief (GMAC_RRE) Receive Resource Errors */ -/* -------- GMAC_ROE : (GMAC Offset: 0x1A4) Receive Overrun Register -------- */ -#define GMAC_ROE_RXOVR_Pos 0 -#define GMAC_ROE_RXOVR_Msk (0x3ffu << GMAC_ROE_RXOVR_Pos) /**< \brief (GMAC_ROE) Receive Overruns */ -/* -------- GMAC_IHCE : (GMAC Offset: 0x1A8) IP Header Checksum Errors Register -------- */ -#define GMAC_IHCE_HCKER_Pos 0 -#define GMAC_IHCE_HCKER_Msk (0xffu << GMAC_IHCE_HCKER_Pos) /**< \brief (GMAC_IHCE) IP Header Checksum Errors */ -/* -------- GMAC_TCE : (GMAC Offset: 0x1AC) TCP Checksum Errors Register -------- */ -#define GMAC_TCE_TCKER_Pos 0 -#define GMAC_TCE_TCKER_Msk (0xffu << GMAC_TCE_TCKER_Pos) /**< \brief (GMAC_TCE) TCP Checksum Errors */ -/* -------- GMAC_UCE : (GMAC Offset: 0x1B0) UDP Checksum Errors Register -------- */ -#define GMAC_UCE_UCKER_Pos 0 -#define GMAC_UCE_UCKER_Msk (0xffu << GMAC_UCE_UCKER_Pos) /**< \brief (GMAC_UCE) UDP Checksum Errors */ -/* -------- GMAC_TISUBN : (GMAC Offset: 0x1BC) 1588 Timer Increment Sub-nanoseconds Register -------- */ -#define GMAC_TISUBN_LSBTIR_Pos 0 -#define GMAC_TISUBN_LSBTIR_Msk (0xffffu << GMAC_TISUBN_LSBTIR_Pos) /**< \brief (GMAC_TISUBN) Lower Significant Bits of Timer Increment Register */ -#define GMAC_TISUBN_LSBTIR(value) ((GMAC_TISUBN_LSBTIR_Msk & ((value) << GMAC_TISUBN_LSBTIR_Pos))) -/* -------- GMAC_TSH : (GMAC Offset: 0x1C0) 1588 Timer Seconds High Register -------- */ -#define GMAC_TSH_TCS_Pos 0 -#define GMAC_TSH_TCS_Msk (0xffffu << GMAC_TSH_TCS_Pos) /**< \brief (GMAC_TSH) Timer Count in Seconds */ -#define GMAC_TSH_TCS(value) ((GMAC_TSH_TCS_Msk & ((value) << GMAC_TSH_TCS_Pos))) -/* -------- GMAC_TSL : (GMAC Offset: 0x1D0) 1588 Timer Seconds Low Register -------- */ -#define GMAC_TSL_TCS_Pos 0 -#define GMAC_TSL_TCS_Msk (0xffffffffu << GMAC_TSL_TCS_Pos) /**< \brief (GMAC_TSL) Timer Count in Seconds */ -#define GMAC_TSL_TCS(value) ((GMAC_TSL_TCS_Msk & ((value) << GMAC_TSL_TCS_Pos))) -/* -------- GMAC_TN : (GMAC Offset: 0x1D4) 1588 Timer Nanoseconds Register -------- */ -#define GMAC_TN_TNS_Pos 0 -#define GMAC_TN_TNS_Msk (0x3fffffffu << GMAC_TN_TNS_Pos) /**< \brief (GMAC_TN) Timer Count in Nanoseconds */ -#define GMAC_TN_TNS(value) ((GMAC_TN_TNS_Msk & ((value) << GMAC_TN_TNS_Pos))) -/* -------- GMAC_TA : (GMAC Offset: 0x1D8) 1588 Timer Adjust Register -------- */ -#define GMAC_TA_ITDT_Pos 0 -#define GMAC_TA_ITDT_Msk (0x3fffffffu << GMAC_TA_ITDT_Pos) /**< \brief (GMAC_TA) Increment/Decrement */ -#define GMAC_TA_ITDT(value) ((GMAC_TA_ITDT_Msk & ((value) << GMAC_TA_ITDT_Pos))) -#define GMAC_TA_ADJ (0x1u << 31) /**< \brief (GMAC_TA) Adjust 1588 Timer */ -/* -------- GMAC_TI : (GMAC Offset: 0x1DC) 1588 Timer Increment Register -------- */ -#define GMAC_TI_CNS_Pos 0 -#define GMAC_TI_CNS_Msk (0xffu << GMAC_TI_CNS_Pos) /**< \brief (GMAC_TI) Count Nanoseconds */ -#define GMAC_TI_CNS(value) ((GMAC_TI_CNS_Msk & ((value) << GMAC_TI_CNS_Pos))) -#define GMAC_TI_ACNS_Pos 8 -#define GMAC_TI_ACNS_Msk (0xffu << GMAC_TI_ACNS_Pos) /**< \brief (GMAC_TI) Alternative Count Nanoseconds */ -#define GMAC_TI_ACNS(value) ((GMAC_TI_ACNS_Msk & ((value) << GMAC_TI_ACNS_Pos))) -#define GMAC_TI_NIT_Pos 16 -#define GMAC_TI_NIT_Msk (0xffu << GMAC_TI_NIT_Pos) /**< \brief (GMAC_TI) Number of Increments */ -#define GMAC_TI_NIT(value) ((GMAC_TI_NIT_Msk & ((value) << GMAC_TI_NIT_Pos))) -/* -------- GMAC_EFTSL : (GMAC Offset: 0x1E0) PTP Event Frame Transmitted Seconds Low Register -------- */ -#define GMAC_EFTSL_RUD_Pos 0 -#define GMAC_EFTSL_RUD_Msk (0xffffffffu << GMAC_EFTSL_RUD_Pos) /**< \brief (GMAC_EFTSL) Register Update */ -/* -------- GMAC_EFTN : (GMAC Offset: 0x1E4) PTP Event Frame Transmitted Nanoseconds Register -------- */ -#define GMAC_EFTN_RUD_Pos 0 -#define GMAC_EFTN_RUD_Msk (0x3fffffffu << GMAC_EFTN_RUD_Pos) /**< \brief (GMAC_EFTN) Register Update */ -/* -------- GMAC_EFRSL : (GMAC Offset: 0x1E8) PTP Event Frame Received Seconds Low Register -------- */ -#define GMAC_EFRSL_RUD_Pos 0 -#define GMAC_EFRSL_RUD_Msk (0xffffffffu << GMAC_EFRSL_RUD_Pos) /**< \brief (GMAC_EFRSL) Register Update */ -/* -------- GMAC_EFRN : (GMAC Offset: 0x1EC) PTP Event Frame Received Nanoseconds Register -------- */ -#define GMAC_EFRN_RUD_Pos 0 -#define GMAC_EFRN_RUD_Msk (0x3fffffffu << GMAC_EFRN_RUD_Pos) /**< \brief (GMAC_EFRN) Register Update */ -/* -------- GMAC_PEFTSL : (GMAC Offset: 0x1F0) PTP Peer Event Frame Transmitted Seconds Low Register -------- */ -#define GMAC_PEFTSL_RUD_Pos 0 -#define GMAC_PEFTSL_RUD_Msk (0xffffffffu << GMAC_PEFTSL_RUD_Pos) /**< \brief (GMAC_PEFTSL) Register Update */ -/* -------- GMAC_PEFTN : (GMAC Offset: 0x1F4) PTP Peer Event Frame Transmitted Nanoseconds Register -------- */ -#define GMAC_PEFTN_RUD_Pos 0 -#define GMAC_PEFTN_RUD_Msk (0x3fffffffu << GMAC_PEFTN_RUD_Pos) /**< \brief (GMAC_PEFTN) Register Update */ -/* -------- GMAC_PEFRSL : (GMAC Offset: 0x1F8) PTP Peer Event Frame Received Seconds Low Register -------- */ -#define GMAC_PEFRSL_RUD_Pos 0 -#define GMAC_PEFRSL_RUD_Msk (0xffffffffu << GMAC_PEFRSL_RUD_Pos) /**< \brief (GMAC_PEFRSL) Register Update */ -/* -------- GMAC_PEFRN : (GMAC Offset: 0x1FC) PTP Peer Event Frame Received Nanoseconds Register -------- */ -#define GMAC_PEFRN_RUD_Pos 0 -#define GMAC_PEFRN_RUD_Msk (0x3fffffffu << GMAC_PEFRN_RUD_Pos) /**< \brief (GMAC_PEFRN) Register Update */ -/* -------- GMAC_ISRPQ[3] : (GMAC Offset: 0x400) Interrupt Status Register Priority Queue (index = 1) -------- */ -#define GMAC_ISRPQ_RCOMP (0x1u << 1) /**< \brief (GMAC_ISRPQ[3]) Receive Complete */ -#define GMAC_ISRPQ_RXUBR (0x1u << 2) /**< \brief (GMAC_ISRPQ[3]) RX Used Bit Read */ -#define GMAC_ISRPQ_RLEX (0x1u << 5) /**< \brief (GMAC_ISRPQ[3]) Retry Limit Exceeded or Late Collision */ -#define GMAC_ISRPQ_TFC (0x1u << 6) /**< \brief (GMAC_ISRPQ[3]) Transmit Frame Corruption Due to AHB Error */ -#define GMAC_ISRPQ_TCOMP (0x1u << 7) /**< \brief (GMAC_ISRPQ[3]) Transmit Complete */ -#define GMAC_ISRPQ_ROVR (0x1u << 10) /**< \brief (GMAC_ISRPQ[3]) Receive Overrun */ -#define GMAC_ISRPQ_HRESP (0x1u << 11) /**< \brief (GMAC_ISRPQ[3]) HRESP Not OK */ -/* -------- GMAC_TBQBAPQ[3] : (GMAC Offset: 0x440) Transmit Buffer Queue Base Address Register Priority Queue (index = 1) -------- */ -#define GMAC_TBQBAPQ_TXBQBA_Pos 2 -#define GMAC_TBQBAPQ_TXBQBA_Msk (0x3fu << GMAC_TBQBAPQ_TXBQBA_Pos) /**< \brief (GMAC_TBQBAPQ[3]) Transmit Buffer Queue Base Address */ -#define GMAC_TBQBAPQ_TXBQBA(value) ((GMAC_TBQBAPQ_TXBQBA_Msk & ((value) << GMAC_TBQBAPQ_TXBQBA_Pos))) -/* -------- GMAC_RBQBAPQ[3] : (GMAC Offset: 0x480) Receive Buffer Queue Base Address Register Priority Queue (index = 1) -------- */ -#define GMAC_RBQBAPQ_RXBQBA_Pos 2 -#define GMAC_RBQBAPQ_RXBQBA_Msk (0x3fu << GMAC_RBQBAPQ_RXBQBA_Pos) /**< \brief (GMAC_RBQBAPQ[3]) Receive Buffer Queue Base Address */ -#define GMAC_RBQBAPQ_RXBQBA(value) ((GMAC_RBQBAPQ_RXBQBA_Msk & ((value) << GMAC_RBQBAPQ_RXBQBA_Pos))) -/* -------- GMAC_RBSRPQ[3] : (GMAC Offset: 0x4A0) Receive Buffer Size Register Priority Queue (index = 1) -------- */ -#define GMAC_RBSRPQ_RBS_Pos 0 -#define GMAC_RBSRPQ_RBS_Msk (0xffffu << GMAC_RBSRPQ_RBS_Pos) /**< \brief (GMAC_RBSRPQ[3]) Receive Buffer Size */ -#define GMAC_RBSRPQ_RBS(value) ((GMAC_RBSRPQ_RBS_Msk & ((value) << GMAC_RBSRPQ_RBS_Pos))) -/* -------- GMAC_CBSCR : (GMAC Offset: 0x4BC) Credit-Based Shaping Control Register -------- */ -#define GMAC_CBSCR_QBE (0x1u << 0) /**< \brief (GMAC_CBSCR) Queue B CBS Enable */ -#define GMAC_CBSCR_QAE (0x1u << 1) /**< \brief (GMAC_CBSCR) Queue A CBS Enable */ -/* -------- GMAC_CBSISQA : (GMAC Offset: 0x4C0) Credit-Based Shaping IdleSlope Register for Queue A -------- */ -#define GMAC_CBSISQA_IS_Pos 0 -#define GMAC_CBSISQA_IS_Msk (0xffffffffu << GMAC_CBSISQA_IS_Pos) /**< \brief (GMAC_CBSISQA) IdleSlope */ -#define GMAC_CBSISQA_IS(value) ((GMAC_CBSISQA_IS_Msk & ((value) << GMAC_CBSISQA_IS_Pos))) -/* -------- GMAC_CBSISQB : (GMAC Offset: 0x4C4) Credit-Based Shaping IdleSlope Register for Queue B -------- */ -#define GMAC_CBSISQB_IS_Pos 0 -#define GMAC_CBSISQB_IS_Msk (0xffffffffu << GMAC_CBSISQB_IS_Pos) /**< \brief (GMAC_CBSISQB) IdleSlope */ -#define GMAC_CBSISQB_IS(value) ((GMAC_CBSISQB_IS_Msk & ((value) << GMAC_CBSISQB_IS_Pos))) -/* -------- GMAC_ST1RPQ[4] : (GMAC Offset: 0x500) Screening Type 1 Register Priority Queue (index = 0) -------- */ -#define GMAC_ST1RPQ_QNB_Pos 0 -#define GMAC_ST1RPQ_QNB_Msk (0x7u << GMAC_ST1RPQ_QNB_Pos) /**< \brief (GMAC_ST1RPQ[4]) Queue Number (0-2) */ -#define GMAC_ST1RPQ_QNB(value) ((GMAC_ST1RPQ_QNB_Msk & ((value) << GMAC_ST1RPQ_QNB_Pos))) -#define GMAC_ST1RPQ_DSTCM_Pos 4 -#define GMAC_ST1RPQ_DSTCM_Msk (0xffu << GMAC_ST1RPQ_DSTCM_Pos) /**< \brief (GMAC_ST1RPQ[4]) Differentiated Services or Traffic Class Match */ -#define GMAC_ST1RPQ_DSTCM(value) ((GMAC_ST1RPQ_DSTCM_Msk & ((value) << GMAC_ST1RPQ_DSTCM_Pos))) -#define GMAC_ST1RPQ_UDPM_Pos 12 -#define GMAC_ST1RPQ_UDPM_Msk (0xffffu << GMAC_ST1RPQ_UDPM_Pos) /**< \brief (GMAC_ST1RPQ[4]) UDP Port Match */ -#define GMAC_ST1RPQ_UDPM(value) ((GMAC_ST1RPQ_UDPM_Msk & ((value) << GMAC_ST1RPQ_UDPM_Pos))) -#define GMAC_ST1RPQ_DSTCE (0x1u << 28) /**< \brief (GMAC_ST1RPQ[4]) Differentiated Services or Traffic Class Match Enable */ -#define GMAC_ST1RPQ_UDPE (0x1u << 29) /**< \brief (GMAC_ST1RPQ[4]) UDP Port Match Enable */ -/* -------- GMAC_ST2RPQ[8] : (GMAC Offset: 0x540) Screening Type 2 Register Priority Queue (index = 0) -------- */ -#define GMAC_ST2RPQ_QNB_Pos 0 -#define GMAC_ST2RPQ_QNB_Msk (0x7u << GMAC_ST2RPQ_QNB_Pos) /**< \brief (GMAC_ST2RPQ[8]) Queue Number (0-2) */ -#define GMAC_ST2RPQ_QNB(value) ((GMAC_ST2RPQ_QNB_Msk & ((value) << GMAC_ST2RPQ_QNB_Pos))) -#define GMAC_ST2RPQ_VLANP_Pos 4 -#define GMAC_ST2RPQ_VLANP_Msk (0x7u << GMAC_ST2RPQ_VLANP_Pos) /**< \brief (GMAC_ST2RPQ[8]) VLAN Priority */ -#define GMAC_ST2RPQ_VLANP(value) ((GMAC_ST2RPQ_VLANP_Msk & ((value) << GMAC_ST2RPQ_VLANP_Pos))) -#define GMAC_ST2RPQ_VLANE (0x1u << 8) /**< \brief (GMAC_ST2RPQ[8]) VLAN Enable */ -#define GMAC_ST2RPQ_I2ETH_Pos 9 -#define GMAC_ST2RPQ_I2ETH_Msk (0x7u << GMAC_ST2RPQ_I2ETH_Pos) /**< \brief (GMAC_ST2RPQ[8]) Index of Screening Type 2 EtherType register x */ -#define GMAC_ST2RPQ_I2ETH(value) ((GMAC_ST2RPQ_I2ETH_Msk & ((value) << GMAC_ST2RPQ_I2ETH_Pos))) -#define GMAC_ST2RPQ_ETHE (0x1u << 12) /**< \brief (GMAC_ST2RPQ[8]) EtherType Enable */ -#define GMAC_ST2RPQ_COMPA_Pos 13 -#define GMAC_ST2RPQ_COMPA_Msk (0x1fu << GMAC_ST2RPQ_COMPA_Pos) /**< \brief (GMAC_ST2RPQ[8]) Index of Screening Type 2 Compare Word 0/Word 1 register x */ -#define GMAC_ST2RPQ_COMPA(value) ((GMAC_ST2RPQ_COMPA_Msk & ((value) << GMAC_ST2RPQ_COMPA_Pos))) -#define GMAC_ST2RPQ_COMPAE (0x1u << 18) /**< \brief (GMAC_ST2RPQ[8]) Compare A Enable */ -#define GMAC_ST2RPQ_COMPB_Pos 19 -#define GMAC_ST2RPQ_COMPB_Msk (0x1fu << GMAC_ST2RPQ_COMPB_Pos) /**< \brief (GMAC_ST2RPQ[8]) Index of Screening Type 2 Compare Word 0/Word 1 register x */ -#define GMAC_ST2RPQ_COMPB(value) ((GMAC_ST2RPQ_COMPB_Msk & ((value) << GMAC_ST2RPQ_COMPB_Pos))) -#define GMAC_ST2RPQ_COMPBE (0x1u << 24) /**< \brief (GMAC_ST2RPQ[8]) Compare B Enable */ -#define GMAC_ST2RPQ_COMPC_Pos 25 -#define GMAC_ST2RPQ_COMPC_Msk (0x1fu << GMAC_ST2RPQ_COMPC_Pos) /**< \brief (GMAC_ST2RPQ[8]) Index of Screening Type 2 Compare Word 0/Word 1 register x */ -#define GMAC_ST2RPQ_COMPC(value) ((GMAC_ST2RPQ_COMPC_Msk & ((value) << GMAC_ST2RPQ_COMPC_Pos))) -#define GMAC_ST2RPQ_COMPCE (0x1u << 30) /**< \brief (GMAC_ST2RPQ[8]) Compare C Enable */ -/* -------- GMAC_IERPQ[3] : (GMAC Offset: 0x600) Interrupt Enable Register Priority Queue (index = 1) -------- */ -#define GMAC_IERPQ_RCOMP (0x1u << 1) /**< \brief (GMAC_IERPQ[3]) Receive Complete */ -#define GMAC_IERPQ_RXUBR (0x1u << 2) /**< \brief (GMAC_IERPQ[3]) RX Used Bit Read */ -#define GMAC_IERPQ_RLEX (0x1u << 5) /**< \brief (GMAC_IERPQ[3]) Retry Limit Exceeded or Late Collision */ -#define GMAC_IERPQ_TFC (0x1u << 6) /**< \brief (GMAC_IERPQ[3]) Transmit Frame Corruption Due to AHB Error */ -#define GMAC_IERPQ_TCOMP (0x1u << 7) /**< \brief (GMAC_IERPQ[3]) Transmit Complete */ -#define GMAC_IERPQ_ROVR (0x1u << 10) /**< \brief (GMAC_IERPQ[3]) Receive Overrun */ -#define GMAC_IERPQ_HRESP (0x1u << 11) /**< \brief (GMAC_IERPQ[3]) HRESP Not OK */ -/* -------- GMAC_IDRPQ[3] : (GMAC Offset: 0x620) Interrupt Disable Register Priority Queue (index = 1) -------- */ -#define GMAC_IDRPQ_RCOMP (0x1u << 1) /**< \brief (GMAC_IDRPQ[3]) Receive Complete */ -#define GMAC_IDRPQ_RXUBR (0x1u << 2) /**< \brief (GMAC_IDRPQ[3]) RX Used Bit Read */ -#define GMAC_IDRPQ_RLEX (0x1u << 5) /**< \brief (GMAC_IDRPQ[3]) Retry Limit Exceeded or Late Collision */ -#define GMAC_IDRPQ_TFC (0x1u << 6) /**< \brief (GMAC_IDRPQ[3]) Transmit Frame Corruption Due to AHB Error */ -#define GMAC_IDRPQ_TCOMP (0x1u << 7) /**< \brief (GMAC_IDRPQ[3]) Transmit Complete */ -#define GMAC_IDRPQ_ROVR (0x1u << 10) /**< \brief (GMAC_IDRPQ[3]) Receive Overrun */ -#define GMAC_IDRPQ_HRESP (0x1u << 11) /**< \brief (GMAC_IDRPQ[3]) HRESP Not OK */ -/* -------- GMAC_IMRPQ[3] : (GMAC Offset: 0x640) Interrupt Mask Register Priority Queue (index = 1) -------- */ -#define GMAC_IMRPQ_RCOMP (0x1u << 1) /**< \brief (GMAC_IMRPQ[3]) Receive Complete */ -#define GMAC_IMRPQ_RXUBR (0x1u << 2) /**< \brief (GMAC_IMRPQ[3]) RX Used Bit Read */ -#define GMAC_IMRPQ_RLEX (0x1u << 5) /**< \brief (GMAC_IMRPQ[3]) Retry Limit Exceeded or Late Collision */ -#define GMAC_IMRPQ_AHB (0x1u << 6) /**< \brief (GMAC_IMRPQ[3]) AHB Error */ -#define GMAC_IMRPQ_TCOMP (0x1u << 7) /**< \brief (GMAC_IMRPQ[3]) Transmit Complete */ -#define GMAC_IMRPQ_ROVR (0x1u << 10) /**< \brief (GMAC_IMRPQ[3]) Receive Overrun */ -#define GMAC_IMRPQ_HRESP (0x1u << 11) /**< \brief (GMAC_IMRPQ[3]) HRESP Not OK */ -/* -------- GMAC_ST2ER[4] : (GMAC Offset: 0x6E0) Screening Type 2 Ethertype Register (index = 0) -------- */ -#define GMAC_ST2ER_COMPVAL_Pos 0 -#define GMAC_ST2ER_COMPVAL_Msk (0xffffu << GMAC_ST2ER_COMPVAL_Pos) /**< \brief (GMAC_ST2ER[4]) Ethertype Compare Value */ -#define GMAC_ST2ER_COMPVAL(value) ((GMAC_ST2ER_COMPVAL_Msk & ((value) << GMAC_ST2ER_COMPVAL_Pos))) - -/* -------- GMAC_ST2COM0[32] : (GMAC Offset: 0x700) Type2 Compare # x, Word 0 -------- */ -#define GMAC_ST2COM0_2BMASK_Pos 0 -#define GMAC_ST2COM0_2BMASK_Msk (0xffffu << GMAC_ST2COM0_2BMASK_Pos) /**< 2-byte Mask Value */ -#define GMAC_ST2COM0_2BMASK(value) ((GMAC_ST2COM0_2BMASK_Msk & ((value) << GMAC_ST2COM0_2BMASK_Pos))) -#define GMAC_ST2COM0_2BCOMP_Pos 16 -#define GMAC_ST2COM0_2BCOMP_Msk (0xffffu << GMAC_ST2COM0_2BCOMP_Pos) /**< 2-byte Compare Value */ -#define GMAC_ST2COM0_2BCOMP(value) ((GMAC_ST2COM0_2BCOMP_Msk & ((value) << GMAC_ST2COM0_2BCOMP_Pos))) -/* -------- GMAC_ST2COM1[32] : (GMAC Offset: 0x704) Type2 Compare # x, Word 1 -------- */ -#define GMAC_ST2COM1_OFFSET_Pos 0 -#define GMAC_ST2COM1_OFFSET_Msk (0x3fu << GMAC_ST2COM1_OFFSET_Pos) /**< Offset value in bytes */ -#define GMAC_ST2COM1_OFFSET(value) ((GMAC_ST2COM1_OFFSET_Msk & ((value) << GMAC_ST2COM1_OFFSET_Pos))) -#define GMAC_ST2COM1_OFFSET_TYPE_Pos 7 -#define GMAC_ST2COM1_OFFSET_TYPE_Msk (0x3u << GMAC_ST2COM1_OFFSET_TYPE_Pos) /**< Offset start location type */ -#define GMAC_ST2COM1_OFFSET_TYPE(value) ((GMAC_ST2COM1_OFFSET_TYPE_Msk & ((value) << GMAC_ST2COM1_OFFSET_TYPE_Pos))) - -/*@}*/ - - -#endif /* _SAMV71_GMAC_COMPONENT_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_gpbr.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_gpbr.h deleted file mode 100644 index f77042ce..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_gpbr.h +++ /dev/null @@ -1,53 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_GPBR_COMPONENT_ -#define _SAMV71_GPBR_COMPONENT_ - -/* ============================================================================= */ -/** SOFTWARE API DEFINITION FOR General Purpose Backup Registers */ -/* ============================================================================= */ -/** \addtogroup SAMV71_GPBR General Purpose Backup Registers */ -/*@{*/ - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -/** \brief Gpbr hardware registers */ -typedef struct { - __IO uint32_t SYS_GPBR[8]; /**< \brief (Gpbr Offset: 0x0) General Purpose Backup Register */ -} Gpbr; -#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/* -------- SYS_GPBR[8] : (GPBR Offset: 0x0) General Purpose Backup Register -------- */ -#define SYS_GPBR_GPBR_VALUE_Pos 0 -#define SYS_GPBR_GPBR_VALUE_Msk (0xffffffffu << SYS_GPBR_GPBR_VALUE_Pos) /**< \brief (SYS_GPBR[8]) Value of GPBR x */ -#define SYS_GPBR_GPBR_VALUE(value) ((SYS_GPBR_GPBR_VALUE_Msk & ((value) << SYS_GPBR_GPBR_VALUE_Pos))) - -/*@}*/ - - -#endif /* _SAMV71_GPBR_COMPONENT_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_hsmci.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_hsmci.h deleted file mode 100644 index 52c3f74f..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_hsmci.h +++ /dev/null @@ -1,335 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_HSMCI_COMPONENT_ -#define _SAMV71_HSMCI_COMPONENT_ - -/* ============================================================================= */ -/** SOFTWARE API DEFINITION FOR High Speed MultiMedia Card Interface */ -/* ============================================================================= */ -/** \addtogroup SAMV71_HSMCI High Speed MultiMedia Card Interface */ -/*@{*/ - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -/** \brief Hsmci hardware registers */ -typedef struct { - __O uint32_t HSMCI_CR; /**< \brief (Hsmci Offset: 0x00) Control Register */ - __IO uint32_t HSMCI_MR; /**< \brief (Hsmci Offset: 0x04) Mode Register */ - __IO uint32_t HSMCI_DTOR; /**< \brief (Hsmci Offset: 0x08) Data Timeout Register */ - __IO uint32_t HSMCI_SDCR; /**< \brief (Hsmci Offset: 0x0C) SD/SDIO Card Register */ - __IO uint32_t HSMCI_ARGR; /**< \brief (Hsmci Offset: 0x10) Argument Register */ - __O uint32_t HSMCI_CMDR; /**< \brief (Hsmci Offset: 0x14) Command Register */ - __IO uint32_t HSMCI_BLKR; /**< \brief (Hsmci Offset: 0x18) Block Register */ - __IO uint32_t HSMCI_CSTOR; /**< \brief (Hsmci Offset: 0x1C) Completion Signal Timeout Register */ - __I uint32_t HSMCI_RSPR[4]; /**< \brief (Hsmci Offset: 0x20) Response Register */ - __I uint32_t HSMCI_RDR; /**< \brief (Hsmci Offset: 0x30) Receive Data Register */ - __O uint32_t HSMCI_TDR; /**< \brief (Hsmci Offset: 0x34) Transmit Data Register */ - __I uint32_t Reserved1[2]; - __I uint32_t HSMCI_SR; /**< \brief (Hsmci Offset: 0x40) Status Register */ - __O uint32_t HSMCI_IER; /**< \brief (Hsmci Offset: 0x44) Interrupt Enable Register */ - __O uint32_t HSMCI_IDR; /**< \brief (Hsmci Offset: 0x48) Interrupt Disable Register */ - __I uint32_t HSMCI_IMR; /**< \brief (Hsmci Offset: 0x4C) Interrupt Mask Register */ - __IO uint32_t HSMCI_DMA; /**< \brief (Hsmci Offset: 0x50) DMA Configuration Register */ - __IO uint32_t HSMCI_CFG; /**< \brief (Hsmci Offset: 0x54) Configuration Register */ - __I uint32_t Reserved2[35]; - __IO uint32_t HSMCI_WPMR; /**< \brief (Hsmci Offset: 0xE4) Write Protection Mode Register */ - __I uint32_t HSMCI_WPSR; /**< \brief (Hsmci Offset: 0xE8) Write Protection Status Register */ - __I uint32_t Reserved3[69]; - __IO uint32_t HSMCI_FIFO[256]; /**< \brief (Hsmci Offset: 0x200) FIFO Memory Aperture0 */ -} Hsmci; -#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/* -------- HSMCI_CR : (HSMCI Offset: 0x00) Control Register -------- */ -#define HSMCI_CR_MCIEN (0x1u << 0) /**< \brief (HSMCI_CR) Multi-Media Interface Enable */ -#define HSMCI_CR_MCIDIS (0x1u << 1) /**< \brief (HSMCI_CR) Multi-Media Interface Disable */ -#define HSMCI_CR_PWSEN (0x1u << 2) /**< \brief (HSMCI_CR) Power Save Mode Enable */ -#define HSMCI_CR_PWSDIS (0x1u << 3) /**< \brief (HSMCI_CR) Power Save Mode Disable */ -#define HSMCI_CR_SWRST (0x1u << 7) /**< \brief (HSMCI_CR) Software Reset */ -/* -------- HSMCI_MR : (HSMCI Offset: 0x04) Mode Register -------- */ -#define HSMCI_MR_CLKDIV_Pos 0 -#define HSMCI_MR_CLKDIV_Msk (0xffu << HSMCI_MR_CLKDIV_Pos) /**< \brief (HSMCI_MR) Clock Divider */ -#define HSMCI_MR_CLKDIV(value) ((HSMCI_MR_CLKDIV_Msk & ((value) << HSMCI_MR_CLKDIV_Pos))) -#define HSMCI_MR_PWSDIV_Pos 8 -#define HSMCI_MR_PWSDIV_Msk (0x7u << HSMCI_MR_PWSDIV_Pos) /**< \brief (HSMCI_MR) Power Saving Divider */ -#define HSMCI_MR_PWSDIV(value) ((HSMCI_MR_PWSDIV_Msk & ((value) << HSMCI_MR_PWSDIV_Pos))) -#define HSMCI_MR_RDPROOF (0x1u << 11) /**< \brief (HSMCI_MR) Read Proof Enable */ -#define HSMCI_MR_WRPROOF (0x1u << 12) /**< \brief (HSMCI_MR) Write Proof Enable */ -#define HSMCI_MR_FBYTE (0x1u << 13) /**< \brief (HSMCI_MR) Force Byte Transfer */ -#define HSMCI_MR_PADV (0x1u << 14) /**< \brief (HSMCI_MR) Padding Value */ -#define HSMCI_MR_CLKODD (0x1u << 16) /**< \brief (HSMCI_MR) Clock divider is odd */ -/* -------- HSMCI_DTOR : (HSMCI Offset: 0x08) Data Timeout Register -------- */ -#define HSMCI_DTOR_DTOCYC_Pos 0 -#define HSMCI_DTOR_DTOCYC_Msk (0xfu << HSMCI_DTOR_DTOCYC_Pos) /**< \brief (HSMCI_DTOR) Data Timeout Cycle Number */ -#define HSMCI_DTOR_DTOCYC(value) ((HSMCI_DTOR_DTOCYC_Msk & ((value) << HSMCI_DTOR_DTOCYC_Pos))) -#define HSMCI_DTOR_DTOMUL_Pos 4 -#define HSMCI_DTOR_DTOMUL_Msk (0x7u << HSMCI_DTOR_DTOMUL_Pos) /**< \brief (HSMCI_DTOR) Data Timeout Multiplier */ -#define HSMCI_DTOR_DTOMUL(value) ((HSMCI_DTOR_DTOMUL_Msk & ((value) << HSMCI_DTOR_DTOMUL_Pos))) -#define HSMCI_DTOR_DTOMUL_1 (0x0u << 4) /**< \brief (HSMCI_DTOR) DTOCYC */ -#define HSMCI_DTOR_DTOMUL_16 (0x1u << 4) /**< \brief (HSMCI_DTOR) DTOCYC x 16 */ -#define HSMCI_DTOR_DTOMUL_128 (0x2u << 4) /**< \brief (HSMCI_DTOR) DTOCYC x 128 */ -#define HSMCI_DTOR_DTOMUL_256 (0x3u << 4) /**< \brief (HSMCI_DTOR) DTOCYC x 256 */ -#define HSMCI_DTOR_DTOMUL_1024 (0x4u << 4) /**< \brief (HSMCI_DTOR) DTOCYC x 1024 */ -#define HSMCI_DTOR_DTOMUL_4096 (0x5u << 4) /**< \brief (HSMCI_DTOR) DTOCYC x 4096 */ -#define HSMCI_DTOR_DTOMUL_65536 (0x6u << 4) /**< \brief (HSMCI_DTOR) DTOCYC x 65536 */ -#define HSMCI_DTOR_DTOMUL_1048576 (0x7u << 4) /**< \brief (HSMCI_DTOR) DTOCYC x 1048576 */ -/* -------- HSMCI_SDCR : (HSMCI Offset: 0x0C) SD/SDIO Card Register -------- */ -#define HSMCI_SDCR_SDCSEL_Pos 0 -#define HSMCI_SDCR_SDCSEL_Msk (0x3u << HSMCI_SDCR_SDCSEL_Pos) /**< \brief (HSMCI_SDCR) SDCard/SDIO Slot */ -#define HSMCI_SDCR_SDCSEL(value) ((HSMCI_SDCR_SDCSEL_Msk & ((value) << HSMCI_SDCR_SDCSEL_Pos))) -#define HSMCI_SDCR_SDCSEL_SLOTA (0x0u << 0) /**< \brief (HSMCI_SDCR) Slot A is selected. */ -#define HSMCI_SDCR_SDCBUS_Pos 6 -#define HSMCI_SDCR_SDCBUS_Msk (0x3u << HSMCI_SDCR_SDCBUS_Pos) /**< \brief (HSMCI_SDCR) SDCard/SDIO Bus Width */ -#define HSMCI_SDCR_SDCBUS(value) ((HSMCI_SDCR_SDCBUS_Msk & ((value) << HSMCI_SDCR_SDCBUS_Pos))) -#define HSMCI_SDCR_SDCBUS_1 (0x0u << 6) /**< \brief (HSMCI_SDCR) 1 bit */ -#define HSMCI_SDCR_SDCBUS_4 (0x2u << 6) /**< \brief (HSMCI_SDCR) 4 bits */ -#define HSMCI_SDCR_SDCBUS_8 (0x3u << 6) /**< \brief (HSMCI_SDCR) 8 bits */ -/* -------- HSMCI_ARGR : (HSMCI Offset: 0x10) Argument Register -------- */ -#define HSMCI_ARGR_ARG_Pos 0 -#define HSMCI_ARGR_ARG_Msk (0xffffffffu << HSMCI_ARGR_ARG_Pos) /**< \brief (HSMCI_ARGR) Command Argument */ -#define HSMCI_ARGR_ARG(value) ((HSMCI_ARGR_ARG_Msk & ((value) << HSMCI_ARGR_ARG_Pos))) -/* -------- HSMCI_CMDR : (HSMCI Offset: 0x14) Command Register -------- */ -#define HSMCI_CMDR_CMDNB_Pos 0 -#define HSMCI_CMDR_CMDNB_Msk (0x3fu << HSMCI_CMDR_CMDNB_Pos) /**< \brief (HSMCI_CMDR) Command Number */ -#define HSMCI_CMDR_CMDNB(value) ((HSMCI_CMDR_CMDNB_Msk & ((value) << HSMCI_CMDR_CMDNB_Pos))) -#define HSMCI_CMDR_RSPTYP_Pos 6 -#define HSMCI_CMDR_RSPTYP_Msk (0x3u << HSMCI_CMDR_RSPTYP_Pos) /**< \brief (HSMCI_CMDR) Response Type */ -#define HSMCI_CMDR_RSPTYP(value) ((HSMCI_CMDR_RSPTYP_Msk & ((value) << HSMCI_CMDR_RSPTYP_Pos))) -#define HSMCI_CMDR_RSPTYP_NORESP (0x0u << 6) /**< \brief (HSMCI_CMDR) No response */ -#define HSMCI_CMDR_RSPTYP_48_BIT (0x1u << 6) /**< \brief (HSMCI_CMDR) 48-bit response */ -#define HSMCI_CMDR_RSPTYP_136_BIT (0x2u << 6) /**< \brief (HSMCI_CMDR) 136-bit response */ -#define HSMCI_CMDR_RSPTYP_R1B (0x3u << 6) /**< \brief (HSMCI_CMDR) R1b response type */ -#define HSMCI_CMDR_SPCMD_Pos 8 -#define HSMCI_CMDR_SPCMD_Msk (0x7u << HSMCI_CMDR_SPCMD_Pos) /**< \brief (HSMCI_CMDR) Special Command */ -#define HSMCI_CMDR_SPCMD(value) ((HSMCI_CMDR_SPCMD_Msk & ((value) << HSMCI_CMDR_SPCMD_Pos))) -#define HSMCI_CMDR_SPCMD_STD (0x0u << 8) /**< \brief (HSMCI_CMDR) Not a special CMD. */ -#define HSMCI_CMDR_SPCMD_INIT (0x1u << 8) /**< \brief (HSMCI_CMDR) Initialization CMD: 74 clock cycles for initialization sequence. */ -#define HSMCI_CMDR_SPCMD_SYNC (0x2u << 8) /**< \brief (HSMCI_CMDR) Synchronized CMD: Wait for the end of the current data block transfer before sending the pending command. */ -#define HSMCI_CMDR_SPCMD_CE_ATA (0x3u << 8) /**< \brief (HSMCI_CMDR) CE-ATA Completion Signal disable Command. The host cancels the ability for the device to return a command completion signal on the command line. */ -#define HSMCI_CMDR_SPCMD_IT_CMD (0x4u << 8) /**< \brief (HSMCI_CMDR) Interrupt command: Corresponds to the Interrupt Mode (CMD40). */ -#define HSMCI_CMDR_SPCMD_IT_RESP (0x5u << 8) /**< \brief (HSMCI_CMDR) Interrupt response: Corresponds to the Interrupt Mode (CMD40). */ -#define HSMCI_CMDR_SPCMD_BOR (0x6u << 8) /**< \brief (HSMCI_CMDR) Boot Operation Request. Start a boot operation mode, the host processor can read boot data from the MMC device directly. */ -#define HSMCI_CMDR_SPCMD_EBO (0x7u << 8) /**< \brief (HSMCI_CMDR) End Boot Operation. This command allows the host processor to terminate the boot operation mode. */ -#define HSMCI_CMDR_OPDCMD (0x1u << 11) /**< \brief (HSMCI_CMDR) Open Drain Command */ -#define HSMCI_CMDR_OPDCMD_PUSHPULL (0x0u << 11) /**< \brief (HSMCI_CMDR) Push pull command. */ -#define HSMCI_CMDR_OPDCMD_OPENDRAIN (0x1u << 11) /**< \brief (HSMCI_CMDR) Open drain command. */ -#define HSMCI_CMDR_MAXLAT (0x1u << 12) /**< \brief (HSMCI_CMDR) Max Latency for Command to Response */ -#define HSMCI_CMDR_MAXLAT_5 (0x0u << 12) /**< \brief (HSMCI_CMDR) 5-cycle max latency. */ -#define HSMCI_CMDR_MAXLAT_64 (0x1u << 12) /**< \brief (HSMCI_CMDR) 64-cycle max latency. */ -#define HSMCI_CMDR_TRCMD_Pos 16 -#define HSMCI_CMDR_TRCMD_Msk (0x3u << HSMCI_CMDR_TRCMD_Pos) /**< \brief (HSMCI_CMDR) Transfer Command */ -#define HSMCI_CMDR_TRCMD(value) ((HSMCI_CMDR_TRCMD_Msk & ((value) << HSMCI_CMDR_TRCMD_Pos))) -#define HSMCI_CMDR_TRCMD_NO_DATA (0x0u << 16) /**< \brief (HSMCI_CMDR) No data transfer */ -#define HSMCI_CMDR_TRCMD_START_DATA (0x1u << 16) /**< \brief (HSMCI_CMDR) Start data transfer */ -#define HSMCI_CMDR_TRCMD_STOP_DATA (0x2u << 16) /**< \brief (HSMCI_CMDR) Stop data transfer */ -#define HSMCI_CMDR_TRDIR (0x1u << 18) /**< \brief (HSMCI_CMDR) Transfer Direction */ -#define HSMCI_CMDR_TRDIR_WRITE (0x0u << 18) /**< \brief (HSMCI_CMDR) Write. */ -#define HSMCI_CMDR_TRDIR_READ (0x1u << 18) /**< \brief (HSMCI_CMDR) Read. */ -#define HSMCI_CMDR_TRTYP_Pos 19 -#define HSMCI_CMDR_TRTYP_Msk (0x7u << HSMCI_CMDR_TRTYP_Pos) /**< \brief (HSMCI_CMDR) Transfer Type */ -#define HSMCI_CMDR_TRTYP(value) ((HSMCI_CMDR_TRTYP_Msk & ((value) << HSMCI_CMDR_TRTYP_Pos))) -#define HSMCI_CMDR_TRTYP_SINGLE (0x0u << 19) /**< \brief (HSMCI_CMDR) MMC/SD Card Single Block */ -#define HSMCI_CMDR_TRTYP_MULTIPLE (0x1u << 19) /**< \brief (HSMCI_CMDR) MMC/SD Card Multiple Block */ -#define HSMCI_CMDR_TRTYP_STREAM (0x2u << 19) /**< \brief (HSMCI_CMDR) MMC Stream */ -#define HSMCI_CMDR_TRTYP_BYTE (0x4u << 19) /**< \brief (HSMCI_CMDR) SDIO Byte */ -#define HSMCI_CMDR_TRTYP_BLOCK (0x5u << 19) /**< \brief (HSMCI_CMDR) SDIO Block */ -#define HSMCI_CMDR_IOSPCMD_Pos 24 -#define HSMCI_CMDR_IOSPCMD_Msk (0x3u << HSMCI_CMDR_IOSPCMD_Pos) /**< \brief (HSMCI_CMDR) SDIO Special Command */ -#define HSMCI_CMDR_IOSPCMD(value) ((HSMCI_CMDR_IOSPCMD_Msk & ((value) << HSMCI_CMDR_IOSPCMD_Pos))) -#define HSMCI_CMDR_IOSPCMD_STD (0x0u << 24) /**< \brief (HSMCI_CMDR) Not an SDIO Special Command */ -#define HSMCI_CMDR_IOSPCMD_SUSPEND (0x1u << 24) /**< \brief (HSMCI_CMDR) SDIO Suspend Command */ -#define HSMCI_CMDR_IOSPCMD_RESUME (0x2u << 24) /**< \brief (HSMCI_CMDR) SDIO Resume Command */ -#define HSMCI_CMDR_ATACS (0x1u << 26) /**< \brief (HSMCI_CMDR) ATA with Command Completion Signal */ -#define HSMCI_CMDR_ATACS_NORMAL (0x0u << 26) /**< \brief (HSMCI_CMDR) Normal operation mode. */ -#define HSMCI_CMDR_ATACS_COMPLETION (0x1u << 26) /**< \brief (HSMCI_CMDR) This bit indicates that a completion signal is expected within a programmed amount of time (HSMCI_CSTOR). */ -#define HSMCI_CMDR_BOOT_ACK (0x1u << 27) /**< \brief (HSMCI_CMDR) Boot Operation Acknowledge */ -/* -------- HSMCI_BLKR : (HSMCI Offset: 0x18) Block Register -------- */ -#define HSMCI_BLKR_BCNT_Pos 0 -#define HSMCI_BLKR_BCNT_Msk (0xffffu << HSMCI_BLKR_BCNT_Pos) /**< \brief (HSMCI_BLKR) MMC/SDIO Block Count - SDIO Byte Count */ -#define HSMCI_BLKR_BCNT(value) ((HSMCI_BLKR_BCNT_Msk & ((value) << HSMCI_BLKR_BCNT_Pos))) -#define HSMCI_BLKR_BLKLEN_Pos 16 -#define HSMCI_BLKR_BLKLEN_Msk (0xffffu << HSMCI_BLKR_BLKLEN_Pos) /**< \brief (HSMCI_BLKR) Data Block Length */ -#define HSMCI_BLKR_BLKLEN(value) ((HSMCI_BLKR_BLKLEN_Msk & ((value) << HSMCI_BLKR_BLKLEN_Pos))) -/* -------- HSMCI_CSTOR : (HSMCI Offset: 0x1C) Completion Signal Timeout Register -------- */ -#define HSMCI_CSTOR_CSTOCYC_Pos 0 -#define HSMCI_CSTOR_CSTOCYC_Msk (0xfu << HSMCI_CSTOR_CSTOCYC_Pos) /**< \brief (HSMCI_CSTOR) Completion Signal Timeout Cycle Number */ -#define HSMCI_CSTOR_CSTOCYC(value) ((HSMCI_CSTOR_CSTOCYC_Msk & ((value) << HSMCI_CSTOR_CSTOCYC_Pos))) -#define HSMCI_CSTOR_CSTOMUL_Pos 4 -#define HSMCI_CSTOR_CSTOMUL_Msk (0x7u << HSMCI_CSTOR_CSTOMUL_Pos) /**< \brief (HSMCI_CSTOR) Completion Signal Timeout Multiplier */ -#define HSMCI_CSTOR_CSTOMUL(value) ((HSMCI_CSTOR_CSTOMUL_Msk & ((value) << HSMCI_CSTOR_CSTOMUL_Pos))) -#define HSMCI_CSTOR_CSTOMUL_1 (0x0u << 4) /**< \brief (HSMCI_CSTOR) CSTOCYC x 1 */ -#define HSMCI_CSTOR_CSTOMUL_16 (0x1u << 4) /**< \brief (HSMCI_CSTOR) CSTOCYC x 16 */ -#define HSMCI_CSTOR_CSTOMUL_128 (0x2u << 4) /**< \brief (HSMCI_CSTOR) CSTOCYC x 128 */ -#define HSMCI_CSTOR_CSTOMUL_256 (0x3u << 4) /**< \brief (HSMCI_CSTOR) CSTOCYC x 256 */ -#define HSMCI_CSTOR_CSTOMUL_1024 (0x4u << 4) /**< \brief (HSMCI_CSTOR) CSTOCYC x 1024 */ -#define HSMCI_CSTOR_CSTOMUL_4096 (0x5u << 4) /**< \brief (HSMCI_CSTOR) CSTOCYC x 4096 */ -#define HSMCI_CSTOR_CSTOMUL_65536 (0x6u << 4) /**< \brief (HSMCI_CSTOR) CSTOCYC x 65536 */ -#define HSMCI_CSTOR_CSTOMUL_1048576 (0x7u << 4) /**< \brief (HSMCI_CSTOR) CSTOCYC x 1048576 */ -/* -------- HSMCI_RSPR[4] : (HSMCI Offset: 0x20) Response Register -------- */ -#define HSMCI_RSPR_RSP_Pos 0 -#define HSMCI_RSPR_RSP_Msk (0xffffffffu << HSMCI_RSPR_RSP_Pos) /**< \brief (HSMCI_RSPR[4]) Response */ -/* -------- HSMCI_RDR : (HSMCI Offset: 0x30) Receive Data Register -------- */ -#define HSMCI_RDR_DATA_Pos 0 -#define HSMCI_RDR_DATA_Msk (0xffffffffu << HSMCI_RDR_DATA_Pos) /**< \brief (HSMCI_RDR) Data to Read */ -/* -------- HSMCI_TDR : (HSMCI Offset: 0x34) Transmit Data Register -------- */ -#define HSMCI_TDR_DATA_Pos 0 -#define HSMCI_TDR_DATA_Msk (0xffffffffu << HSMCI_TDR_DATA_Pos) /**< \brief (HSMCI_TDR) Data to Write */ -#define HSMCI_TDR_DATA(value) ((HSMCI_TDR_DATA_Msk & ((value) << HSMCI_TDR_DATA_Pos))) -/* -------- HSMCI_SR : (HSMCI Offset: 0x40) Status Register -------- */ -#define HSMCI_SR_CMDRDY (0x1u << 0) /**< \brief (HSMCI_SR) Command Ready (cleared by writing in HSMCI_CMDR) */ -#define HSMCI_SR_RXRDY (0x1u << 1) /**< \brief (HSMCI_SR) Receiver Ready (cleared by reading HSMCI_RDR) */ -#define HSMCI_SR_TXRDY (0x1u << 2) /**< \brief (HSMCI_SR) Transmit Ready (cleared by writing in HSMCI_TDR) */ -#define HSMCI_SR_BLKE (0x1u << 3) /**< \brief (HSMCI_SR) Data Block Ended (cleared on read) */ -#define HSMCI_SR_DTIP (0x1u << 4) /**< \brief (HSMCI_SR) Data Transfer in Progress (cleared at the end of CRC16 calculation) */ -#define HSMCI_SR_NOTBUSY (0x1u << 5) /**< \brief (HSMCI_SR) HSMCI Not Busy */ -#define HSMCI_SR_SDIOIRQA (0x1u << 8) /**< \brief (HSMCI_SR) SDIO Interrupt for Slot A (cleared on read) */ -#define HSMCI_SR_SDIOWAIT (0x1u << 12) /**< \brief (HSMCI_SR) SDIO Read Wait Operation Status */ -#define HSMCI_SR_CSRCV (0x1u << 13) /**< \brief (HSMCI_SR) CE-ATA Completion Signal Received (cleared on read) */ -#define HSMCI_SR_RINDE (0x1u << 16) /**< \brief (HSMCI_SR) Response Index Error (cleared by writing in HSMCI_CMDR) */ -#define HSMCI_SR_RDIRE (0x1u << 17) /**< \brief (HSMCI_SR) Response Direction Error (cleared by writing in HSMCI_CMDR) */ -#define HSMCI_SR_RCRCE (0x1u << 18) /**< \brief (HSMCI_SR) Response CRC Error (cleared by writing in HSMCI_CMDR) */ -#define HSMCI_SR_RENDE (0x1u << 19) /**< \brief (HSMCI_SR) Response End Bit Error (cleared by writing in HSMCI_CMDR) */ -#define HSMCI_SR_RTOE (0x1u << 20) /**< \brief (HSMCI_SR) Response Time-out Error (cleared by writing in HSMCI_CMDR) */ -#define HSMCI_SR_DCRCE (0x1u << 21) /**< \brief (HSMCI_SR) Data CRC Error (cleared on read) */ -#define HSMCI_SR_DTOE (0x1u << 22) /**< \brief (HSMCI_SR) Data Time-out Error (cleared on read) */ -#define HSMCI_SR_CSTOE (0x1u << 23) /**< \brief (HSMCI_SR) Completion Signal Time-out Error (cleared on read) */ -#define HSMCI_SR_BLKOVRE (0x1u << 24) /**< \brief (HSMCI_SR) DMA Block Overrun Error (cleared on read) */ -#define HSMCI_SR_FIFOEMPTY (0x1u << 26) /**< \brief (HSMCI_SR) FIFO empty flag */ -#define HSMCI_SR_XFRDONE (0x1u << 27) /**< \brief (HSMCI_SR) Transfer Done flag */ -#define HSMCI_SR_ACKRCV (0x1u << 28) /**< \brief (HSMCI_SR) Boot Operation Acknowledge Received (cleared on read) */ -#define HSMCI_SR_ACKRCVE (0x1u << 29) /**< \brief (HSMCI_SR) Boot Operation Acknowledge Error (cleared on read) */ -#define HSMCI_SR_OVRE (0x1u << 30) /**< \brief (HSMCI_SR) Overrun (if FERRCTRL = 1, cleared by writing in HSMCI_CMDR or cleared on read if FERRCTRL = 0) */ -#define HSMCI_SR_UNRE (0x1u << 31) /**< \brief (HSMCI_SR) Underrun (if FERRCTRL = 1, cleared by writing in HSMCI_CMDR or cleared on read if FERRCTRL = 0) */ -/* -------- HSMCI_IER : (HSMCI Offset: 0x44) Interrupt Enable Register -------- */ -#define HSMCI_IER_CMDRDY (0x1u << 0) /**< \brief (HSMCI_IER) Command Ready Interrupt Enable */ -#define HSMCI_IER_RXRDY (0x1u << 1) /**< \brief (HSMCI_IER) Receiver Ready Interrupt Enable */ -#define HSMCI_IER_TXRDY (0x1u << 2) /**< \brief (HSMCI_IER) Transmit Ready Interrupt Enable */ -#define HSMCI_IER_BLKE (0x1u << 3) /**< \brief (HSMCI_IER) Data Block Ended Interrupt Enable */ -#define HSMCI_IER_DTIP (0x1u << 4) /**< \brief (HSMCI_IER) Data Transfer in Progress Interrupt Enable */ -#define HSMCI_IER_NOTBUSY (0x1u << 5) /**< \brief (HSMCI_IER) Data Not Busy Interrupt Enable */ -#define HSMCI_IER_SDIOIRQA (0x1u << 8) /**< \brief (HSMCI_IER) SDIO Interrupt for Slot A Interrupt Enable */ -#define HSMCI_IER_SDIOWAIT (0x1u << 12) /**< \brief (HSMCI_IER) SDIO Read Wait Operation Status Interrupt Enable */ -#define HSMCI_IER_CSRCV (0x1u << 13) /**< \brief (HSMCI_IER) Completion Signal Received Interrupt Enable */ -#define HSMCI_IER_RINDE (0x1u << 16) /**< \brief (HSMCI_IER) Response Index Error Interrupt Enable */ -#define HSMCI_IER_RDIRE (0x1u << 17) /**< \brief (HSMCI_IER) Response Direction Error Interrupt Enable */ -#define HSMCI_IER_RCRCE (0x1u << 18) /**< \brief (HSMCI_IER) Response CRC Error Interrupt Enable */ -#define HSMCI_IER_RENDE (0x1u << 19) /**< \brief (HSMCI_IER) Response End Bit Error Interrupt Enable */ -#define HSMCI_IER_RTOE (0x1u << 20) /**< \brief (HSMCI_IER) Response Time-out Error Interrupt Enable */ -#define HSMCI_IER_DCRCE (0x1u << 21) /**< \brief (HSMCI_IER) Data CRC Error Interrupt Enable */ -#define HSMCI_IER_DTOE (0x1u << 22) /**< \brief (HSMCI_IER) Data Time-out Error Interrupt Enable */ -#define HSMCI_IER_CSTOE (0x1u << 23) /**< \brief (HSMCI_IER) Completion Signal Timeout Error Interrupt Enable */ -#define HSMCI_IER_BLKOVRE (0x1u << 24) /**< \brief (HSMCI_IER) DMA Block Overrun Error Interrupt Enable */ -#define HSMCI_IER_FIFOEMPTY (0x1u << 26) /**< \brief (HSMCI_IER) FIFO empty Interrupt enable */ -#define HSMCI_IER_XFRDONE (0x1u << 27) /**< \brief (HSMCI_IER) Transfer Done Interrupt enable */ -#define HSMCI_IER_ACKRCV (0x1u << 28) /**< \brief (HSMCI_IER) Boot Acknowledge Interrupt Enable */ -#define HSMCI_IER_ACKRCVE (0x1u << 29) /**< \brief (HSMCI_IER) Boot Acknowledge Error Interrupt Enable */ -#define HSMCI_IER_OVRE (0x1u << 30) /**< \brief (HSMCI_IER) Overrun Interrupt Enable */ -#define HSMCI_IER_UNRE (0x1u << 31) /**< \brief (HSMCI_IER) Underrun Interrupt Enable */ -/* -------- HSMCI_IDR : (HSMCI Offset: 0x48) Interrupt Disable Register -------- */ -#define HSMCI_IDR_CMDRDY (0x1u << 0) /**< \brief (HSMCI_IDR) Command Ready Interrupt Disable */ -#define HSMCI_IDR_RXRDY (0x1u << 1) /**< \brief (HSMCI_IDR) Receiver Ready Interrupt Disable */ -#define HSMCI_IDR_TXRDY (0x1u << 2) /**< \brief (HSMCI_IDR) Transmit Ready Interrupt Disable */ -#define HSMCI_IDR_BLKE (0x1u << 3) /**< \brief (HSMCI_IDR) Data Block Ended Interrupt Disable */ -#define HSMCI_IDR_DTIP (0x1u << 4) /**< \brief (HSMCI_IDR) Data Transfer in Progress Interrupt Disable */ -#define HSMCI_IDR_NOTBUSY (0x1u << 5) /**< \brief (HSMCI_IDR) Data Not Busy Interrupt Disable */ -#define HSMCI_IDR_SDIOIRQA (0x1u << 8) /**< \brief (HSMCI_IDR) SDIO Interrupt for Slot A Interrupt Disable */ -#define HSMCI_IDR_SDIOWAIT (0x1u << 12) /**< \brief (HSMCI_IDR) SDIO Read Wait Operation Status Interrupt Disable */ -#define HSMCI_IDR_CSRCV (0x1u << 13) /**< \brief (HSMCI_IDR) Completion Signal received interrupt Disable */ -#define HSMCI_IDR_RINDE (0x1u << 16) /**< \brief (HSMCI_IDR) Response Index Error Interrupt Disable */ -#define HSMCI_IDR_RDIRE (0x1u << 17) /**< \brief (HSMCI_IDR) Response Direction Error Interrupt Disable */ -#define HSMCI_IDR_RCRCE (0x1u << 18) /**< \brief (HSMCI_IDR) Response CRC Error Interrupt Disable */ -#define HSMCI_IDR_RENDE (0x1u << 19) /**< \brief (HSMCI_IDR) Response End Bit Error Interrupt Disable */ -#define HSMCI_IDR_RTOE (0x1u << 20) /**< \brief (HSMCI_IDR) Response Time-out Error Interrupt Disable */ -#define HSMCI_IDR_DCRCE (0x1u << 21) /**< \brief (HSMCI_IDR) Data CRC Error Interrupt Disable */ -#define HSMCI_IDR_DTOE (0x1u << 22) /**< \brief (HSMCI_IDR) Data Time-out Error Interrupt Disable */ -#define HSMCI_IDR_CSTOE (0x1u << 23) /**< \brief (HSMCI_IDR) Completion Signal Time out Error Interrupt Disable */ -#define HSMCI_IDR_BLKOVRE (0x1u << 24) /**< \brief (HSMCI_IDR) DMA Block Overrun Error Interrupt Disable */ -#define HSMCI_IDR_FIFOEMPTY (0x1u << 26) /**< \brief (HSMCI_IDR) FIFO empty Interrupt Disable */ -#define HSMCI_IDR_XFRDONE (0x1u << 27) /**< \brief (HSMCI_IDR) Transfer Done Interrupt Disable */ -#define HSMCI_IDR_ACKRCV (0x1u << 28) /**< \brief (HSMCI_IDR) Boot Acknowledge Interrupt Disable */ -#define HSMCI_IDR_ACKRCVE (0x1u << 29) /**< \brief (HSMCI_IDR) Boot Acknowledge Error Interrupt Disable */ -#define HSMCI_IDR_OVRE (0x1u << 30) /**< \brief (HSMCI_IDR) Overrun Interrupt Disable */ -#define HSMCI_IDR_UNRE (0x1u << 31) /**< \brief (HSMCI_IDR) Underrun Interrupt Disable */ -/* -------- HSMCI_IMR : (HSMCI Offset: 0x4C) Interrupt Mask Register -------- */ -#define HSMCI_IMR_CMDRDY (0x1u << 0) /**< \brief (HSMCI_IMR) Command Ready Interrupt Mask */ -#define HSMCI_IMR_RXRDY (0x1u << 1) /**< \brief (HSMCI_IMR) Receiver Ready Interrupt Mask */ -#define HSMCI_IMR_TXRDY (0x1u << 2) /**< \brief (HSMCI_IMR) Transmit Ready Interrupt Mask */ -#define HSMCI_IMR_BLKE (0x1u << 3) /**< \brief (HSMCI_IMR) Data Block Ended Interrupt Mask */ -#define HSMCI_IMR_DTIP (0x1u << 4) /**< \brief (HSMCI_IMR) Data Transfer in Progress Interrupt Mask */ -#define HSMCI_IMR_NOTBUSY (0x1u << 5) /**< \brief (HSMCI_IMR) Data Not Busy Interrupt Mask */ -#define HSMCI_IMR_SDIOIRQA (0x1u << 8) /**< \brief (HSMCI_IMR) SDIO Interrupt for Slot A Interrupt Mask */ -#define HSMCI_IMR_SDIOWAIT (0x1u << 12) /**< \brief (HSMCI_IMR) SDIO Read Wait Operation Status Interrupt Mask */ -#define HSMCI_IMR_CSRCV (0x1u << 13) /**< \brief (HSMCI_IMR) Completion Signal Received Interrupt Mask */ -#define HSMCI_IMR_RINDE (0x1u << 16) /**< \brief (HSMCI_IMR) Response Index Error Interrupt Mask */ -#define HSMCI_IMR_RDIRE (0x1u << 17) /**< \brief (HSMCI_IMR) Response Direction Error Interrupt Mask */ -#define HSMCI_IMR_RCRCE (0x1u << 18) /**< \brief (HSMCI_IMR) Response CRC Error Interrupt Mask */ -#define HSMCI_IMR_RENDE (0x1u << 19) /**< \brief (HSMCI_IMR) Response End Bit Error Interrupt Mask */ -#define HSMCI_IMR_RTOE (0x1u << 20) /**< \brief (HSMCI_IMR) Response Time-out Error Interrupt Mask */ -#define HSMCI_IMR_DCRCE (0x1u << 21) /**< \brief (HSMCI_IMR) Data CRC Error Interrupt Mask */ -#define HSMCI_IMR_DTOE (0x1u << 22) /**< \brief (HSMCI_IMR) Data Time-out Error Interrupt Mask */ -#define HSMCI_IMR_CSTOE (0x1u << 23) /**< \brief (HSMCI_IMR) Completion Signal Time-out Error Interrupt Mask */ -#define HSMCI_IMR_BLKOVRE (0x1u << 24) /**< \brief (HSMCI_IMR) DMA Block Overrun Error Interrupt Mask */ -#define HSMCI_IMR_FIFOEMPTY (0x1u << 26) /**< \brief (HSMCI_IMR) FIFO Empty Interrupt Mask */ -#define HSMCI_IMR_XFRDONE (0x1u << 27) /**< \brief (HSMCI_IMR) Transfer Done Interrupt Mask */ -#define HSMCI_IMR_ACKRCV (0x1u << 28) /**< \brief (HSMCI_IMR) Boot Operation Acknowledge Received Interrupt Mask */ -#define HSMCI_IMR_ACKRCVE (0x1u << 29) /**< \brief (HSMCI_IMR) Boot Operation Acknowledge Error Interrupt Mask */ -#define HSMCI_IMR_OVRE (0x1u << 30) /**< \brief (HSMCI_IMR) Overrun Interrupt Mask */ -#define HSMCI_IMR_UNRE (0x1u << 31) /**< \brief (HSMCI_IMR) Underrun Interrupt Mask */ -/* -------- HSMCI_DMA : (HSMCI Offset: 0x50) DMA Configuration Register -------- */ -#define HSMCI_DMA_CHKSIZE_Pos 4 -#define HSMCI_DMA_CHKSIZE_Msk (0x7u << HSMCI_DMA_CHKSIZE_Pos) /**< \brief (HSMCI_DMA) DMA Channel Read and Write Chunk Size */ -#define HSMCI_DMA_CHKSIZE(value) ((HSMCI_DMA_CHKSIZE_Msk & ((value) << HSMCI_DMA_CHKSIZE_Pos))) -#define HSMCI_DMA_CHKSIZE_1 (0x0u << 4) /**< \brief (HSMCI_DMA) 1 data available */ -#define HSMCI_DMA_CHKSIZE_2 (0x1u << 4) /**< \brief (HSMCI_DMA) 2 data available */ -#define HSMCI_DMA_CHKSIZE_4 (0x2u << 4) /**< \brief (HSMCI_DMA) 4 data available */ -#define HSMCI_DMA_CHKSIZE_8 (0x3u << 4) /**< \brief (HSMCI_DMA) 8 data available */ -#define HSMCI_DMA_CHKSIZE_16 (0x4u << 4) /**< \brief (HSMCI_DMA) 16 data available */ -#define HSMCI_DMA_DMAEN (0x1u << 8) /**< \brief (HSMCI_DMA) DMA Hardware Handshaking Enable */ -/* -------- HSMCI_CFG : (HSMCI Offset: 0x54) Configuration Register -------- */ -#define HSMCI_CFG_FIFOMODE (0x1u << 0) /**< \brief (HSMCI_CFG) HSMCI Internal FIFO control mode */ -#define HSMCI_CFG_FERRCTRL (0x1u << 4) /**< \brief (HSMCI_CFG) Flow Error flag reset control mode */ -#define HSMCI_CFG_HSMODE (0x1u << 8) /**< \brief (HSMCI_CFG) High Speed Mode */ -#define HSMCI_CFG_LSYNC (0x1u << 12) /**< \brief (HSMCI_CFG) Synchronize on the last block */ -/* -------- HSMCI_WPMR : (HSMCI Offset: 0xE4) Write Protection Mode Register -------- */ -#define HSMCI_WPMR_WPEN (0x1u << 0) /**< \brief (HSMCI_WPMR) Write Protect Enable */ -#define HSMCI_WPMR_WPKEY_Pos 8 -#define HSMCI_WPMR_WPKEY_Msk (0xffffffu << HSMCI_WPMR_WPKEY_Pos) /**< \brief (HSMCI_WPMR) Write Protect Key */ -#define HSMCI_WPMR_WPKEY(value) ((HSMCI_WPMR_WPKEY_Msk & ((value) << HSMCI_WPMR_WPKEY_Pos))) -#define HSMCI_WPMR_WPKEY_PASSWD (0x4D4349u << 8) /**< \brief (HSMCI_WPMR) Writing any other value in this field aborts the write operation of the WPEN bit.Always reads as 0. */ -/* -------- HSMCI_WPSR : (HSMCI Offset: 0xE8) Write Protection Status Register -------- */ -#define HSMCI_WPSR_WPVS (0x1u << 0) /**< \brief (HSMCI_WPSR) Write Protection Violation Status */ -#define HSMCI_WPSR_WPVSRC_Pos 8 -#define HSMCI_WPSR_WPVSRC_Msk (0xffffu << HSMCI_WPSR_WPVSRC_Pos) /**< \brief (HSMCI_WPSR) Write Protection Violation Source */ -/* -------- HSMCI_FIFO[256] : (HSMCI Offset: 0x200) FIFO Memory Aperture0 -------- */ -#define HSMCI_FIFO_DATA_Pos 0 -#define HSMCI_FIFO_DATA_Msk (0xffffffffu << HSMCI_FIFO_DATA_Pos) /**< \brief (HSMCI_FIFO[256]) Data to Read or Data to Write */ -#define HSMCI_FIFO_DATA(value) ((HSMCI_FIFO_DATA_Msk & ((value) << HSMCI_FIFO_DATA_Pos))) - -/*@}*/ - - -#endif /* _SAMV71_HSMCI_COMPONENT_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_icm.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_icm.h deleted file mode 100644 index 0aa35989..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_icm.h +++ /dev/null @@ -1,192 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_ICM_COMPONENT_ -#define _SAMV71_ICM_COMPONENT_ - -/* ============================================================================= */ -/** SOFTWARE API DEFINITION FOR Integrity Check Monitor */ -/* ============================================================================= */ -/** \addtogroup SAMV71_ICM Integrity Check Monitor */ -/*@{*/ - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -/** \brief Icm hardware registers */ -typedef struct { - __IO uint32_t ICM_CFG; /**< \brief (Icm Offset: 0x00) Configuration Register */ - __O uint32_t ICM_CTRL; /**< \brief (Icm Offset: 0x04) Control Register */ - __O uint32_t ICM_SR; /**< \brief (Icm Offset: 0x08) Status Register */ - __I uint32_t Reserved1[1]; - __O uint32_t ICM_IER; /**< \brief (Icm Offset: 0x10) Interrupt Enable Register */ - __O uint32_t ICM_IDR; /**< \brief (Icm Offset: 0x14) Interrupt Disable Register */ - __I uint32_t ICM_IMR; /**< \brief (Icm Offset: 0x18) Interrupt Mask Register */ - __I uint32_t ICM_ISR; /**< \brief (Icm Offset: 0x1C) Interrupt Status Register */ - __I uint32_t ICM_UASR; /**< \brief (Icm Offset: 0x20) Undefined Access Status Register */ - __I uint32_t Reserved2[3]; - __IO uint32_t ICM_DSCR; /**< \brief (Icm Offset: 0x30) Region Descriptor Area Start Address Register */ - __IO uint32_t ICM_HASH; /**< \brief (Icm Offset: 0x34) Region Hash Area Start Address Register */ - __O uint32_t ICM_UIHVAL[8]; /**< \brief (Icm Offset: 0x38) User Initial Hash Value 0 Register */ -} Icm; -#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/* -------- ICM_CFG : (ICM Offset: 0x00) Configuration Register -------- */ -#define ICM_CFG_WBDIS (0x1u << 0) /**< \brief (ICM_CFG) Write Back Disable */ -#define ICM_CFG_EOMDIS (0x1u << 1) /**< \brief (ICM_CFG) End of Monitoring Disable */ -#define ICM_CFG_SLBDIS (0x1u << 2) /**< \brief (ICM_CFG) Secondary List Branching Disable */ -#define ICM_CFG_BBC_Pos 4 -#define ICM_CFG_BBC_Msk (0xfu << ICM_CFG_BBC_Pos) /**< \brief (ICM_CFG) Bus Burden Control */ -#define ICM_CFG_BBC(value) ((ICM_CFG_BBC_Msk & ((value) << ICM_CFG_BBC_Pos))) -#define ICM_CFG_ASCD (0x1u << 8) /**< \brief (ICM_CFG) Automatic Switch To Compare Digest */ -#define ICM_CFG_DUALBUFF (0x1u << 9) /**< \brief (ICM_CFG) Dual Input Buffer */ -#define ICM_CFG_UIHASH (0x1u << 12) /**< \brief (ICM_CFG) User Initial Hash Value */ -#define ICM_CFG_UALGO_Pos 13 -#define ICM_CFG_UALGO_Msk (0x7u << ICM_CFG_UALGO_Pos) /**< \brief (ICM_CFG) User SHA Algorithm */ -#define ICM_CFG_UALGO(value) ((ICM_CFG_UALGO_Msk & ((value) << ICM_CFG_UALGO_Pos))) -#define ICM_CFG_UALGO_SHA1 (0x0u << 13) /**< \brief (ICM_CFG) SHA1 algorithm processed */ -#define ICM_CFG_UALGO_SHA256 (0x1u << 13) /**< \brief (ICM_CFG) SHA256 algorithm processed */ -#define ICM_CFG_UALGO_SHA224 (0x4u << 13) /**< \brief (ICM_CFG) SHA224 algorithm processed */ -#define ICM_CFG_HAPROT_Pos 16 -#define ICM_CFG_HAPROT_Msk (0x3fu << ICM_CFG_HAPROT_Pos) /**< \brief (ICM_CFG) Region Hash Area Protection */ -#define ICM_CFG_HAPROT(value) ((ICM_CFG_HAPROT_Msk & ((value) << ICM_CFG_HAPROT_Pos))) -#define ICM_CFG_DAPROT_Pos 24 -#define ICM_CFG_DAPROT_Msk (0x3fu << ICM_CFG_DAPROT_Pos) /**< \brief (ICM_CFG) Region Descriptor Area Protection */ -#define ICM_CFG_DAPROT(value) ((ICM_CFG_DAPROT_Msk & ((value) << ICM_CFG_DAPROT_Pos))) -/* -------- ICM_CTRL : (ICM Offset: 0x04) Control Register -------- */ -#define ICM_CTRL_ENABLE (0x1u << 0) /**< \brief (ICM_CTRL) ICM Enable */ -#define ICM_CTRL_DISABLE (0x1u << 1) /**< \brief (ICM_CTRL) ICM Disable Register */ -#define ICM_CTRL_SWRST (0x1u << 2) /**< \brief (ICM_CTRL) Software Reset */ -#define ICM_CTRL_REHASH_Pos 4 -#define ICM_CTRL_REHASH_Msk (0xfu << ICM_CTRL_REHASH_Pos) /**< \brief (ICM_CTRL) Recompute Internal Hash */ -#define ICM_CTRL_REHASH(value) ((ICM_CTRL_REHASH_Msk & ((value) << ICM_CTRL_REHASH_Pos))) -#define ICM_CTRL_RMDIS_Pos 8 -#define ICM_CTRL_RMDIS_Msk (0xfu << ICM_CTRL_RMDIS_Pos) /**< \brief (ICM_CTRL) Region Monitoring Disable */ -#define ICM_CTRL_RMDIS(value) ((ICM_CTRL_RMDIS_Msk & ((value) << ICM_CTRL_RMDIS_Pos))) -#define ICM_CTRL_RMEN_Pos 12 -#define ICM_CTRL_RMEN_Msk (0xfu << ICM_CTRL_RMEN_Pos) /**< \brief (ICM_CTRL) Region Monitoring Enable */ -#define ICM_CTRL_RMEN(value) ((ICM_CTRL_RMEN_Msk & ((value) << ICM_CTRL_RMEN_Pos))) -/* -------- ICM_SR : (ICM Offset: 0x08) Status Register -------- */ -#define ICM_SR_ENABLE (0x1u << 0) /**< \brief (ICM_SR) ICM Controller Enable Register */ -#define ICM_SR_RAWRMDIS_Pos 8 -#define ICM_SR_RAWRMDIS_Msk (0xfu << ICM_SR_RAWRMDIS_Pos) /**< \brief (ICM_SR) RAW Region Monitoring Disabled Status */ -#define ICM_SR_RAWRMDIS(value) ((ICM_SR_RAWRMDIS_Msk & ((value) << ICM_SR_RAWRMDIS_Pos))) -#define ICM_SR_RMDIS_Pos 12 -#define ICM_SR_RMDIS_Msk (0xfu << ICM_SR_RMDIS_Pos) /**< \brief (ICM_SR) Region Monitoring Disabled Status */ -#define ICM_SR_RMDIS(value) ((ICM_SR_RMDIS_Msk & ((value) << ICM_SR_RMDIS_Pos))) -/* -------- ICM_IER : (ICM Offset: 0x10) Interrupt Enable Register -------- */ -#define ICM_IER_RHC_Pos 0 -#define ICM_IER_RHC_Msk (0xfu << ICM_IER_RHC_Pos) /**< \brief (ICM_IER) Region Hash Completed Interrupt Enable */ -#define ICM_IER_RHC(value) ((ICM_IER_RHC_Msk & ((value) << ICM_IER_RHC_Pos))) -#define ICM_IER_RDM_Pos 4 -#define ICM_IER_RDM_Msk (0xfu << ICM_IER_RDM_Pos) /**< \brief (ICM_IER) Region Digest Mismatch Interrupt Enable */ -#define ICM_IER_RDM(value) ((ICM_IER_RDM_Msk & ((value) << ICM_IER_RDM_Pos))) -#define ICM_IER_RBE_Pos 8 -#define ICM_IER_RBE_Msk (0xfu << ICM_IER_RBE_Pos) /**< \brief (ICM_IER) Region Bus Error Interrupt Enable */ -#define ICM_IER_RBE(value) ((ICM_IER_RBE_Msk & ((value) << ICM_IER_RBE_Pos))) -#define ICM_IER_RWC_Pos 12 -#define ICM_IER_RWC_Msk (0xfu << ICM_IER_RWC_Pos) /**< \brief (ICM_IER) Region Wrap Condition detected Interrupt Enable */ -#define ICM_IER_RWC(value) ((ICM_IER_RWC_Msk & ((value) << ICM_IER_RWC_Pos))) -#define ICM_IER_REC_Pos 16 -#define ICM_IER_REC_Msk (0xfu << ICM_IER_REC_Pos) /**< \brief (ICM_IER) Region End bit Condition Detected Interrupt Enable */ -#define ICM_IER_REC(value) ((ICM_IER_REC_Msk & ((value) << ICM_IER_REC_Pos))) -#define ICM_IER_RSU_Pos 20 -#define ICM_IER_RSU_Msk (0xfu << ICM_IER_RSU_Pos) /**< \brief (ICM_IER) Region Status Updated Interrupt Disable */ -#define ICM_IER_RSU(value) ((ICM_IER_RSU_Msk & ((value) << ICM_IER_RSU_Pos))) -#define ICM_IER_URAD (0x1u << 24) /**< \brief (ICM_IER) Undefined Register Access Detection Interrupt Enable */ -/* -------- ICM_IDR : (ICM Offset: 0x14) Interrupt Disable Register -------- */ -#define ICM_IDR_RHC_Pos 0 -#define ICM_IDR_RHC_Msk (0xfu << ICM_IDR_RHC_Pos) /**< \brief (ICM_IDR) Region Hash Completed Interrupt Disable */ -#define ICM_IDR_RHC(value) ((ICM_IDR_RHC_Msk & ((value) << ICM_IDR_RHC_Pos))) -#define ICM_IDR_RDM_Pos 4 -#define ICM_IDR_RDM_Msk (0xfu << ICM_IDR_RDM_Pos) /**< \brief (ICM_IDR) Region Digest Mismatch Interrupt Disable */ -#define ICM_IDR_RDM(value) ((ICM_IDR_RDM_Msk & ((value) << ICM_IDR_RDM_Pos))) -#define ICM_IDR_RBE_Pos 8 -#define ICM_IDR_RBE_Msk (0xfu << ICM_IDR_RBE_Pos) /**< \brief (ICM_IDR) Region Bus Error Interrupt Disable */ -#define ICM_IDR_RBE(value) ((ICM_IDR_RBE_Msk & ((value) << ICM_IDR_RBE_Pos))) -#define ICM_IDR_RWC_Pos 12 -#define ICM_IDR_RWC_Msk (0xfu << ICM_IDR_RWC_Pos) /**< \brief (ICM_IDR) Region Wrap Condition Detected Interrupt Disable */ -#define ICM_IDR_RWC(value) ((ICM_IDR_RWC_Msk & ((value) << ICM_IDR_RWC_Pos))) -#define ICM_IDR_REC_Pos 16 -#define ICM_IDR_REC_Msk (0xfu << ICM_IDR_REC_Pos) /**< \brief (ICM_IDR) Region End bit Condition detected Interrupt Disable */ -#define ICM_IDR_REC(value) ((ICM_IDR_REC_Msk & ((value) << ICM_IDR_REC_Pos))) -#define ICM_IDR_RSU_Pos 20 -#define ICM_IDR_RSU_Msk (0xfu << ICM_IDR_RSU_Pos) /**< \brief (ICM_IDR) Region Status Updated Interrupt Disable */ -#define ICM_IDR_RSU(value) ((ICM_IDR_RSU_Msk & ((value) << ICM_IDR_RSU_Pos))) -#define ICM_IDR_URAD (0x1u << 24) /**< \brief (ICM_IDR) Undefined Register Access Detection Interrupt Disable */ -/* -------- ICM_IMR : (ICM Offset: 0x18) Interrupt Mask Register -------- */ -#define ICM_IMR_RHC_Pos 0 -#define ICM_IMR_RHC_Msk (0xfu << ICM_IMR_RHC_Pos) /**< \brief (ICM_IMR) Region Hash Completed Interrupt Mask */ -#define ICM_IMR_RDM_Pos 4 -#define ICM_IMR_RDM_Msk (0xfu << ICM_IMR_RDM_Pos) /**< \brief (ICM_IMR) Region Digest Mismatch Interrupt Mask */ -#define ICM_IMR_RBE_Pos 8 -#define ICM_IMR_RBE_Msk (0xfu << ICM_IMR_RBE_Pos) /**< \brief (ICM_IMR) Region Bus Error Interrupt Mask */ -#define ICM_IMR_RWC_Pos 12 -#define ICM_IMR_RWC_Msk (0xfu << ICM_IMR_RWC_Pos) /**< \brief (ICM_IMR) Region Wrap Condition Detected Interrupt Mask */ -#define ICM_IMR_REC_Pos 16 -#define ICM_IMR_REC_Msk (0xfu << ICM_IMR_REC_Pos) /**< \brief (ICM_IMR) Region End bit Condition Detected Interrupt Mask */ -#define ICM_IMR_RSU_Pos 20 -#define ICM_IMR_RSU_Msk (0xfu << ICM_IMR_RSU_Pos) /**< \brief (ICM_IMR) Region Status Updated Interrupt Mask */ -#define ICM_IMR_URAD (0x1u << 24) /**< \brief (ICM_IMR) Undefined Register Access Detection Interrupt Mask */ -/* -------- ICM_ISR : (ICM Offset: 0x1C) Interrupt Status Register -------- */ -#define ICM_ISR_RHC_Pos 0 -#define ICM_ISR_RHC_Msk (0xfu << ICM_ISR_RHC_Pos) /**< \brief (ICM_ISR) Region Hash Completed */ -#define ICM_ISR_RDM_Pos 4 -#define ICM_ISR_RDM_Msk (0xfu << ICM_ISR_RDM_Pos) /**< \brief (ICM_ISR) Region Digest Mismatch */ -#define ICM_ISR_RBE_Pos 8 -#define ICM_ISR_RBE_Msk (0xfu << ICM_ISR_RBE_Pos) /**< \brief (ICM_ISR) Region Bus Error */ -#define ICM_ISR_RWC_Pos 12 -#define ICM_ISR_RWC_Msk (0xfu << ICM_ISR_RWC_Pos) /**< \brief (ICM_ISR) Region Wrap Condition Detected */ -#define ICM_ISR_REC_Pos 16 -#define ICM_ISR_REC_Msk (0xfu << ICM_ISR_REC_Pos) /**< \brief (ICM_ISR) Region End bit Condition Detected */ -#define ICM_ISR_RSU_Pos 20 -#define ICM_ISR_RSU_Msk (0xfu << ICM_ISR_RSU_Pos) /**< \brief (ICM_ISR) Region Status Updated Detected */ -#define ICM_ISR_URAD (0x1u << 24) /**< \brief (ICM_ISR) Undefined Register Access Detection Status */ -/* -------- ICM_UASR : (ICM Offset: 0x20) Undefined Access Status Register -------- */ -#define ICM_UASR_URAT_Pos 0 -#define ICM_UASR_URAT_Msk (0x7u << ICM_UASR_URAT_Pos) /**< \brief (ICM_UASR) Undefined Register Access Trace */ -#define ICM_UASR_URAT_UNSPEC_STRUCT_MEMBER (0x0u << 0) /**< \brief (ICM_UASR) Unspecified structure member set to one detected when the descriptor is loaded. */ -#define ICM_UASR_URAT_ICM_CFG_MODIFIED (0x1u << 0) /**< \brief (ICM_UASR) ICM_CFG modified during active monitoring. */ -#define ICM_UASR_URAT_ICM_DSCR_MODIFIED (0x2u << 0) /**< \brief (ICM_UASR) ICM_DSCR modified during active monitoring. */ -#define ICM_UASR_URAT_ICM_HASH_MODIFIED (0x3u << 0) /**< \brief (ICM_UASR) ICM_HASH modified during active monitoring */ -#define ICM_UASR_URAT_READ_ACCESS (0x4u << 0) /**< \brief (ICM_UASR) Write-only register read access */ -/* -------- ICM_DSCR : (ICM Offset: 0x30) Region Descriptor Area Start Address Register -------- */ -#define ICM_DSCR_DASA_Pos 6 -#define ICM_DSCR_DASA_Msk (0x3ffffffu << ICM_DSCR_DASA_Pos) /**< \brief (ICM_DSCR) Descriptor Area Start Address */ -#define ICM_DSCR_DASA(value) ((ICM_DSCR_DASA_Msk & ((value) << ICM_DSCR_DASA_Pos))) -/* -------- ICM_HASH : (ICM Offset: 0x34) Region Hash Area Start Address Register -------- */ -#define ICM_HASH_HASA_Pos 7 -#define ICM_HASH_HASA_Msk (0x1ffffffu << ICM_HASH_HASA_Pos) /**< \brief (ICM_HASH) Hash Area Start Address */ -#define ICM_HASH_HASA(value) ((ICM_HASH_HASA_Msk & ((value) << ICM_HASH_HASA_Pos))) -/* -------- ICM_UIHVAL[8] : (ICM Offset: 0x38) User Initial Hash Value 0 Register -------- */ -#define ICM_UIHVAL_VAL_Pos 0 -#define ICM_UIHVAL_VAL_Msk (0xffffffffu << ICM_UIHVAL_VAL_Pos) /**< \brief (ICM_UIHVAL[8]) Initial Hash Value */ -#define ICM_UIHVAL_VAL(value) ((ICM_UIHVAL_VAL_Msk & ((value) << ICM_UIHVAL_VAL_Pos))) - -/*@}*/ - - -#endif /* _SAMV71_ICM_COMPONENT_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_isi.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_isi.h deleted file mode 100644 index bcaebcb9..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_isi.h +++ /dev/null @@ -1,280 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_ISI_COMPONENT_ -#define _SAMV71_ISI_COMPONENT_ - -/* ============================================================================= */ -/** SOFTWARE API DEFINITION FOR Image Sensor Interface */ -/* ============================================================================= */ -/** \addtogroup SAMV71_ISI Image Sensor Interface */ -/*@{*/ - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -/** \brief Isi hardware registers */ -typedef struct { - __IO uint32_t ISI_CFG1; /**< \brief (Isi Offset: 0x00) ISI Configuration 1 Register */ - __IO uint32_t ISI_CFG2; /**< \brief (Isi Offset: 0x04) ISI Configuration 2 Register */ - __IO uint32_t ISI_PSIZE; /**< \brief (Isi Offset: 0x08) ISI Preview Size Register */ - __IO uint32_t ISI_PDECF; /**< \brief (Isi Offset: 0x0C) ISI Preview Decimation Factor Register */ - __IO uint32_t ISI_Y2R_SET0; /**< \brief (Isi Offset: 0x10) ISI Color Space Conversion YCrCb To RGB Set 0 Register */ - __IO uint32_t ISI_Y2R_SET1; /**< \brief (Isi Offset: 0x14) ISI Color Space Conversion YCrCb To RGB Set 1 Register */ - __IO uint32_t ISI_R2Y_SET0; /**< \brief (Isi Offset: 0x18) ISI Color Space Conversion RGB To YCrCb Set 0 Register */ - __IO uint32_t ISI_R2Y_SET1; /**< \brief (Isi Offset: 0x1C) ISI Color Space Conversion RGB To YCrCb Set 1 Register */ - __IO uint32_t ISI_R2Y_SET2; /**< \brief (Isi Offset: 0x20) ISI Color Space Conversion RGB To YCrCb Set 2 Register */ - __O uint32_t ISI_CR; /**< \brief (Isi Offset: 0x24) ISI Control Register */ - __I uint32_t ISI_SR; /**< \brief (Isi Offset: 0x28) ISI Status Register */ - __O uint32_t ISI_IER; /**< \brief (Isi Offset: 0x2C) ISI Interrupt Enable Register */ - __O uint32_t ISI_IDR; /**< \brief (Isi Offset: 0x30) ISI Interrupt Disable Register */ - __I uint32_t ISI_IMR; /**< \brief (Isi Offset: 0x34) ISI Interrupt Mask Register */ - __O uint32_t ISI_DMA_CHER; /**< \brief (Isi Offset: 0x38) DMA Channel Enable Register */ - __O uint32_t ISI_DMA_CHDR; /**< \brief (Isi Offset: 0x3C) DMA Channel Disable Register */ - __I uint32_t ISI_DMA_CHSR; /**< \brief (Isi Offset: 0x40) DMA Channel Status Register */ - __IO uint32_t ISI_DMA_P_ADDR; /**< \brief (Isi Offset: 0x44) DMA Preview Base Address Register */ - __IO uint32_t ISI_DMA_P_CTRL; /**< \brief (Isi Offset: 0x48) DMA Preview Control Register */ - __IO uint32_t ISI_DMA_P_DSCR; /**< \brief (Isi Offset: 0x4C) DMA Preview Descriptor Address Register */ - __IO uint32_t ISI_DMA_C_ADDR; /**< \brief (Isi Offset: 0x50) DMA Codec Base Address Register */ - __IO uint32_t ISI_DMA_C_CTRL; /**< \brief (Isi Offset: 0x54) DMA Codec Control Register */ - __IO uint32_t ISI_DMA_C_DSCR; /**< \brief (Isi Offset: 0x58) DMA Codec Descriptor Address Register */ - __I uint32_t Reserved1[34]; - __IO uint32_t ISI_WPMR; /**< \brief (Isi Offset: 0xE4) Write Protection Mode Register */ - __I uint32_t ISI_WPSR; /**< \brief (Isi Offset: 0xE8) Write Protection Status Register */ -} Isi; -#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/* -------- ISI_CFG1 : (ISI Offset: 0x00) ISI Configuration 1 Register -------- */ -#define ISI_CFG1_HSYNC_POL (0x1u << 2) /**< \brief (ISI_CFG1) Horizontal Synchronization Polarity */ -#define ISI_CFG1_VSYNC_POL (0x1u << 3) /**< \brief (ISI_CFG1) Vertical Synchronization Polarity */ -#define ISI_CFG1_PIXCLK_POL (0x1u << 4) /**< \brief (ISI_CFG1) Pixel Clock Polarity */ -#define ISI_CFG1_EMB_SYNC (0x1u << 6) /**< \brief (ISI_CFG1) Embedded Synchronization */ -#define ISI_CFG1_CRC_SYNC (0x1u << 7) /**< \brief (ISI_CFG1) Embedded Synchronization Correction */ -#define ISI_CFG1_FRATE_Pos 8 -#define ISI_CFG1_FRATE_Msk (0x7u << ISI_CFG1_FRATE_Pos) /**< \brief (ISI_CFG1) Frame Rate [0..7] */ -#define ISI_CFG1_FRATE(value) ((ISI_CFG1_FRATE_Msk & ((value) << ISI_CFG1_FRATE_Pos))) -#define ISI_CFG1_DISCR (0x1u << 11) /**< \brief (ISI_CFG1) Disable Codec Request */ -#define ISI_CFG1_FULL (0x1u << 12) /**< \brief (ISI_CFG1) Full Mode is Allowed */ -#define ISI_CFG1_THMASK_Pos 13 -#define ISI_CFG1_THMASK_Msk (0x3u << ISI_CFG1_THMASK_Pos) /**< \brief (ISI_CFG1) Threshold Mask */ -#define ISI_CFG1_THMASK(value) ((ISI_CFG1_THMASK_Msk & ((value) << ISI_CFG1_THMASK_Pos))) -#define ISI_CFG1_THMASK_BEATS_4 (0x0u << 13) /**< \brief (ISI_CFG1) Only 4 beats AHB burst allowed */ -#define ISI_CFG1_THMASK_BEATS_8 (0x1u << 13) /**< \brief (ISI_CFG1) Only 4 and 8 beats AHB burst allowed */ -#define ISI_CFG1_THMASK_BEATS_16 (0x2u << 13) /**< \brief (ISI_CFG1) 4, 8 and 16 beats AHB burst allowed */ -#define ISI_CFG1_SLD_Pos 16 -#define ISI_CFG1_SLD_Msk (0xffu << ISI_CFG1_SLD_Pos) /**< \brief (ISI_CFG1) Start of Line Delay */ -#define ISI_CFG1_SLD(value) ((ISI_CFG1_SLD_Msk & ((value) << ISI_CFG1_SLD_Pos))) -#define ISI_CFG1_SFD_Pos 24 -#define ISI_CFG1_SFD_Msk (0xffu << ISI_CFG1_SFD_Pos) /**< \brief (ISI_CFG1) Start of Frame Delay */ -#define ISI_CFG1_SFD(value) ((ISI_CFG1_SFD_Msk & ((value) << ISI_CFG1_SFD_Pos))) -/* -------- ISI_CFG2 : (ISI Offset: 0x04) ISI Configuration 2 Register -------- */ -#define ISI_CFG2_IM_VSIZE_Pos 0 -#define ISI_CFG2_IM_VSIZE_Msk (0x7ffu << ISI_CFG2_IM_VSIZE_Pos) /**< \brief (ISI_CFG2) Vertical Size of the Image Sensor [0..2047] */ -#define ISI_CFG2_IM_VSIZE(value) ((ISI_CFG2_IM_VSIZE_Msk & ((value) << ISI_CFG2_IM_VSIZE_Pos))) -#define ISI_CFG2_GS_MODE (0x1u << 11) /**< \brief (ISI_CFG2) Grayscale Pixel Format Mode */ -#define ISI_CFG2_RGB_MODE (0x1u << 12) /**< \brief (ISI_CFG2) RGB Input Mode */ -#define ISI_CFG2_GRAYSCALE (0x1u << 13) /**< \brief (ISI_CFG2) Grayscale Mode Format Enable */ -#define ISI_CFG2_RGB_SWAP (0x1u << 14) /**< \brief (ISI_CFG2) RGB Format Swap Mode */ -#define ISI_CFG2_COL_SPACE (0x1u << 15) /**< \brief (ISI_CFG2) Color Space for the Image Data */ -#define ISI_CFG2_IM_HSIZE_Pos 16 -#define ISI_CFG2_IM_HSIZE_Msk (0x7ffu << ISI_CFG2_IM_HSIZE_Pos) /**< \brief (ISI_CFG2) Horizontal Size of the Image Sensor [0..2047] */ -#define ISI_CFG2_IM_HSIZE(value) ((ISI_CFG2_IM_HSIZE_Msk & ((value) << ISI_CFG2_IM_HSIZE_Pos))) -#define ISI_CFG2_YCC_SWAP_Pos 28 -#define ISI_CFG2_YCC_SWAP_Msk (0x3u << ISI_CFG2_YCC_SWAP_Pos) /**< \brief (ISI_CFG2) YCrCb Format Swap Mode */ -#define ISI_CFG2_YCC_SWAP(value) ((ISI_CFG2_YCC_SWAP_Msk & ((value) << ISI_CFG2_YCC_SWAP_Pos))) -#define ISI_CFG2_YCC_SWAP_DEFAULT (0x0u << 28) /**< \brief (ISI_CFG2) Byte 0 Cb(i)Byte 1 Y(i)Byte 2 Cr(i)Byte 3 Y(i+1) */ -#define ISI_CFG2_YCC_SWAP_MODE1 (0x1u << 28) /**< \brief (ISI_CFG2) Byte 0 Cr(i)Byte 1 Y(i)Byte 2 Cb(i)Byte 3 Y(i+1) */ -#define ISI_CFG2_YCC_SWAP_MODE2 (0x2u << 28) /**< \brief (ISI_CFG2) Byte 0 Y(i)Byte 1 Cb(i)Byte 2 Y(i+1)Byte 3 Cr(i) */ -#define ISI_CFG2_YCC_SWAP_MODE3 (0x3u << 28) /**< \brief (ISI_CFG2) Byte 0 Y(i)Byte 1 Cr(i)Byte 2 Y(i+1)Byte 3 Cb(i) */ -#define ISI_CFG2_RGB_CFG_Pos 30 -#define ISI_CFG2_RGB_CFG_Msk (0x3u << ISI_CFG2_RGB_CFG_Pos) /**< \brief (ISI_CFG2) RGB Pixel Mapping Configuration */ -#define ISI_CFG2_RGB_CFG(value) ((ISI_CFG2_RGB_CFG_Msk & ((value) << ISI_CFG2_RGB_CFG_Pos))) -#define ISI_CFG2_RGB_CFG_DEFAULT (0x0u << 30) /**< \brief (ISI_CFG2) Byte 0 R/G(MSB)Byte 1 G(LSB)/BByte 2 R/G(MSB)Byte 3 G(LSB)/B */ -#define ISI_CFG2_RGB_CFG_MODE1 (0x1u << 30) /**< \brief (ISI_CFG2) Byte 0 B/G(MSB)Byte 1 G(LSB)/RByte 2 B/G(MSB)Byte 3 G(LSB)/R */ -#define ISI_CFG2_RGB_CFG_MODE2 (0x2u << 30) /**< \brief (ISI_CFG2) Byte 0 G(LSB)/RByte 1 B/G(MSB)Byte 2 G(LSB)/RByte 3 B/G(MSB) */ -#define ISI_CFG2_RGB_CFG_MODE3 (0x3u << 30) /**< \brief (ISI_CFG2) Byte 0 G(LSB)/BByte 1 R/G(MSB)Byte 2 G(LSB)/BByte 3 R/G(MSB) */ -/* -------- ISI_PSIZE : (ISI Offset: 0x08) ISI Preview Size Register -------- */ -#define ISI_PSIZE_PREV_VSIZE_Pos 0 -#define ISI_PSIZE_PREV_VSIZE_Msk (0x3ffu << ISI_PSIZE_PREV_VSIZE_Pos) /**< \brief (ISI_PSIZE) Vertical Size for the Preview Path */ -#define ISI_PSIZE_PREV_VSIZE(value) ((ISI_PSIZE_PREV_VSIZE_Msk & ((value) << ISI_PSIZE_PREV_VSIZE_Pos))) -#define ISI_PSIZE_PREV_HSIZE_Pos 16 -#define ISI_PSIZE_PREV_HSIZE_Msk (0x3ffu << ISI_PSIZE_PREV_HSIZE_Pos) /**< \brief (ISI_PSIZE) Horizontal Size for the Preview Path */ -#define ISI_PSIZE_PREV_HSIZE(value) ((ISI_PSIZE_PREV_HSIZE_Msk & ((value) << ISI_PSIZE_PREV_HSIZE_Pos))) -/* -------- ISI_PDECF : (ISI Offset: 0x0C) ISI Preview Decimation Factor Register -------- */ -#define ISI_PDECF_DEC_FACTOR_Pos 0 -#define ISI_PDECF_DEC_FACTOR_Msk (0xffu << ISI_PDECF_DEC_FACTOR_Pos) /**< \brief (ISI_PDECF) Decimation Factor */ -#define ISI_PDECF_DEC_FACTOR(value) ((ISI_PDECF_DEC_FACTOR_Msk & ((value) << ISI_PDECF_DEC_FACTOR_Pos))) -/* -------- ISI_Y2R_SET0 : (ISI Offset: 0x10) ISI Color Space Conversion YCrCb To RGB Set 0 Register -------- */ -#define ISI_Y2R_SET0_C0_Pos 0 -#define ISI_Y2R_SET0_C0_Msk (0xffu << ISI_Y2R_SET0_C0_Pos) /**< \brief (ISI_Y2R_SET0) Color Space Conversion Matrix Coefficient C0 */ -#define ISI_Y2R_SET0_C0(value) ((ISI_Y2R_SET0_C0_Msk & ((value) << ISI_Y2R_SET0_C0_Pos))) -#define ISI_Y2R_SET0_C1_Pos 8 -#define ISI_Y2R_SET0_C1_Msk (0xffu << ISI_Y2R_SET0_C1_Pos) /**< \brief (ISI_Y2R_SET0) Color Space Conversion Matrix Coefficient C1 */ -#define ISI_Y2R_SET0_C1(value) ((ISI_Y2R_SET0_C1_Msk & ((value) << ISI_Y2R_SET0_C1_Pos))) -#define ISI_Y2R_SET0_C2_Pos 16 -#define ISI_Y2R_SET0_C2_Msk (0xffu << ISI_Y2R_SET0_C2_Pos) /**< \brief (ISI_Y2R_SET0) Color Space Conversion Matrix Coefficient C2 */ -#define ISI_Y2R_SET0_C2(value) ((ISI_Y2R_SET0_C2_Msk & ((value) << ISI_Y2R_SET0_C2_Pos))) -#define ISI_Y2R_SET0_C3_Pos 24 -#define ISI_Y2R_SET0_C3_Msk (0xffu << ISI_Y2R_SET0_C3_Pos) /**< \brief (ISI_Y2R_SET0) Color Space Conversion Matrix Coefficient C3 */ -#define ISI_Y2R_SET0_C3(value) ((ISI_Y2R_SET0_C3_Msk & ((value) << ISI_Y2R_SET0_C3_Pos))) -/* -------- ISI_Y2R_SET1 : (ISI Offset: 0x14) ISI Color Space Conversion YCrCb To RGB Set 1 Register -------- */ -#define ISI_Y2R_SET1_C4_Pos 0 -#define ISI_Y2R_SET1_C4_Msk (0x1ffu << ISI_Y2R_SET1_C4_Pos) /**< \brief (ISI_Y2R_SET1) Color Space Conversion Matrix Coefficient C4 */ -#define ISI_Y2R_SET1_C4(value) ((ISI_Y2R_SET1_C4_Msk & ((value) << ISI_Y2R_SET1_C4_Pos))) -#define ISI_Y2R_SET1_Yoff (0x1u << 12) /**< \brief (ISI_Y2R_SET1) Color Space Conversion Luminance Default Offset */ -#define ISI_Y2R_SET1_Croff (0x1u << 13) /**< \brief (ISI_Y2R_SET1) Color Space Conversion Red Chrominance Default Offset */ -#define ISI_Y2R_SET1_Cboff (0x1u << 14) /**< \brief (ISI_Y2R_SET1) Color Space Conversion Blue Chrominance Default Offset */ -/* -------- ISI_R2Y_SET0 : (ISI Offset: 0x18) ISI Color Space Conversion RGB To YCrCb Set 0 Register -------- */ -#define ISI_R2Y_SET0_C0_Pos 0 -#define ISI_R2Y_SET0_C0_Msk (0x7fu << ISI_R2Y_SET0_C0_Pos) /**< \brief (ISI_R2Y_SET0) Color Space Conversion Matrix Coefficient C0 */ -#define ISI_R2Y_SET0_C0(value) ((ISI_R2Y_SET0_C0_Msk & ((value) << ISI_R2Y_SET0_C0_Pos))) -#define ISI_R2Y_SET0_C1_Pos 8 -#define ISI_R2Y_SET0_C1_Msk (0x7fu << ISI_R2Y_SET0_C1_Pos) /**< \brief (ISI_R2Y_SET0) Color Space Conversion Matrix Coefficient C1 */ -#define ISI_R2Y_SET0_C1(value) ((ISI_R2Y_SET0_C1_Msk & ((value) << ISI_R2Y_SET0_C1_Pos))) -#define ISI_R2Y_SET0_C2_Pos 16 -#define ISI_R2Y_SET0_C2_Msk (0x7fu << ISI_R2Y_SET0_C2_Pos) /**< \brief (ISI_R2Y_SET0) Color Space Conversion Matrix Coefficient C2 */ -#define ISI_R2Y_SET0_C2(value) ((ISI_R2Y_SET0_C2_Msk & ((value) << ISI_R2Y_SET0_C2_Pos))) -#define ISI_R2Y_SET0_Roff (0x1u << 24) /**< \brief (ISI_R2Y_SET0) Color Space Conversion Red Component Offset */ -/* -------- ISI_R2Y_SET1 : (ISI Offset: 0x1C) ISI Color Space Conversion RGB To YCrCb Set 1 Register -------- */ -#define ISI_R2Y_SET1_C3_Pos 0 -#define ISI_R2Y_SET1_C3_Msk (0x7fu << ISI_R2Y_SET1_C3_Pos) /**< \brief (ISI_R2Y_SET1) Color Space Conversion Matrix Coefficient C3 */ -#define ISI_R2Y_SET1_C3(value) ((ISI_R2Y_SET1_C3_Msk & ((value) << ISI_R2Y_SET1_C3_Pos))) -#define ISI_R2Y_SET1_C4_Pos 8 -#define ISI_R2Y_SET1_C4_Msk (0x7fu << ISI_R2Y_SET1_C4_Pos) /**< \brief (ISI_R2Y_SET1) Color Space Conversion Matrix Coefficient C4 */ -#define ISI_R2Y_SET1_C4(value) ((ISI_R2Y_SET1_C4_Msk & ((value) << ISI_R2Y_SET1_C4_Pos))) -#define ISI_R2Y_SET1_C5_Pos 16 -#define ISI_R2Y_SET1_C5_Msk (0x7fu << ISI_R2Y_SET1_C5_Pos) /**< \brief (ISI_R2Y_SET1) Color Space Conversion Matrix Coefficient C5 */ -#define ISI_R2Y_SET1_C5(value) ((ISI_R2Y_SET1_C5_Msk & ((value) << ISI_R2Y_SET1_C5_Pos))) -#define ISI_R2Y_SET1_Goff (0x1u << 24) /**< \brief (ISI_R2Y_SET1) Color Space Conversion Green Component Offset */ -/* -------- ISI_R2Y_SET2 : (ISI Offset: 0x20) ISI Color Space Conversion RGB To YCrCb Set 2 Register -------- */ -#define ISI_R2Y_SET2_C6_Pos 0 -#define ISI_R2Y_SET2_C6_Msk (0x7fu << ISI_R2Y_SET2_C6_Pos) /**< \brief (ISI_R2Y_SET2) Color Space Conversion Matrix Coefficient C6 */ -#define ISI_R2Y_SET2_C6(value) ((ISI_R2Y_SET2_C6_Msk & ((value) << ISI_R2Y_SET2_C6_Pos))) -#define ISI_R2Y_SET2_C7_Pos 8 -#define ISI_R2Y_SET2_C7_Msk (0x7fu << ISI_R2Y_SET2_C7_Pos) /**< \brief (ISI_R2Y_SET2) Color Space Conversion Matrix Coefficient C7 */ -#define ISI_R2Y_SET2_C7(value) ((ISI_R2Y_SET2_C7_Msk & ((value) << ISI_R2Y_SET2_C7_Pos))) -#define ISI_R2Y_SET2_C8_Pos 16 -#define ISI_R2Y_SET2_C8_Msk (0x7fu << ISI_R2Y_SET2_C8_Pos) /**< \brief (ISI_R2Y_SET2) Color Space Conversion Matrix Coefficient C8 */ -#define ISI_R2Y_SET2_C8(value) ((ISI_R2Y_SET2_C8_Msk & ((value) << ISI_R2Y_SET2_C8_Pos))) -#define ISI_R2Y_SET2_Boff (0x1u << 24) /**< \brief (ISI_R2Y_SET2) Color Space Conversion Blue Component Offset */ -/* -------- ISI_CR : (ISI Offset: 0x24) ISI Control Register -------- */ -#define ISI_CR_ISI_EN (0x1u << 0) /**< \brief (ISI_CR) ISI Module Enable Request */ -#define ISI_CR_ISI_DIS (0x1u << 1) /**< \brief (ISI_CR) ISI Module Disable Request */ -#define ISI_CR_ISI_SRST (0x1u << 2) /**< \brief (ISI_CR) ISI Software Reset Request */ -#define ISI_CR_ISI_CDC (0x1u << 8) /**< \brief (ISI_CR) ISI Codec Request */ -/* -------- ISI_SR : (ISI Offset: 0x28) ISI Status Register -------- */ -#define ISI_SR_ENABLE (0x1u << 0) /**< \brief (ISI_SR) Module Enable */ -#define ISI_SR_DIS_DONE (0x1u << 1) /**< \brief (ISI_SR) Module Disable Request has Terminated (cleared on read) */ -#define ISI_SR_SRST (0x1u << 2) /**< \brief (ISI_SR) Module Software Reset Request has Terminated (cleared on read) */ -#define ISI_SR_CDC_PND (0x1u << 8) /**< \brief (ISI_SR) Pending Codec Request */ -#define ISI_SR_VSYNC (0x1u << 10) /**< \brief (ISI_SR) Vertical Synchronization (cleared on read) */ -#define ISI_SR_PXFR_DONE (0x1u << 16) /**< \brief (ISI_SR) Preview DMA Transfer has Terminated (cleared on read) */ -#define ISI_SR_CXFR_DONE (0x1u << 17) /**< \brief (ISI_SR) Codec DMA Transfer has Terminated (cleared on read) */ -#define ISI_SR_SIP (0x1u << 19) /**< \brief (ISI_SR) Synchronization in Progress */ -#define ISI_SR_P_OVR (0x1u << 24) /**< \brief (ISI_SR) Preview Datapath Overflow (cleared on read) */ -#define ISI_SR_C_OVR (0x1u << 25) /**< \brief (ISI_SR) Codec Datapath Overflow (cleared on read) */ -#define ISI_SR_CRC_ERR (0x1u << 26) /**< \brief (ISI_SR) CRC Synchronization Error (cleared on read) */ -#define ISI_SR_FR_OVR (0x1u << 27) /**< \brief (ISI_SR) Frame Rate Overrun (cleared on read) */ -/* -------- ISI_IER : (ISI Offset: 0x2C) ISI Interrupt Enable Register -------- */ -#define ISI_IER_DIS_DONE (0x1u << 1) /**< \brief (ISI_IER) Disable Done Interrupt Enable */ -#define ISI_IER_SRST (0x1u << 2) /**< \brief (ISI_IER) Software Reset Interrupt Enable */ -#define ISI_IER_VSYNC (0x1u << 10) /**< \brief (ISI_IER) Vertical Synchronization Interrupt Enable */ -#define ISI_IER_PXFR_DONE (0x1u << 16) /**< \brief (ISI_IER) Preview DMA Transfer Done Interrupt Enable */ -#define ISI_IER_CXFR_DONE (0x1u << 17) /**< \brief (ISI_IER) Codec DMA Transfer Done Interrupt Enable */ -#define ISI_IER_P_OVR (0x1u << 24) /**< \brief (ISI_IER) Preview Datapath Overflow Interrupt Enable */ -#define ISI_IER_C_OVR (0x1u << 25) /**< \brief (ISI_IER) Codec Datapath Overflow Interrupt Enable */ -#define ISI_IER_CRC_ERR (0x1u << 26) /**< \brief (ISI_IER) Embedded Synchronization CRC Error Interrupt Enable */ -#define ISI_IER_FR_OVR (0x1u << 27) /**< \brief (ISI_IER) Frame Rate Overflow Interrupt Enable */ -/* -------- ISI_IDR : (ISI Offset: 0x30) ISI Interrupt Disable Register -------- */ -#define ISI_IDR_DIS_DONE (0x1u << 1) /**< \brief (ISI_IDR) Disable Done Interrupt Disable */ -#define ISI_IDR_SRST (0x1u << 2) /**< \brief (ISI_IDR) Software Reset Interrupt Disable */ -#define ISI_IDR_VSYNC (0x1u << 10) /**< \brief (ISI_IDR) Vertical Synchronization Interrupt Disable */ -#define ISI_IDR_PXFR_DONE (0x1u << 16) /**< \brief (ISI_IDR) Preview DMA Transfer Done Interrupt Disable */ -#define ISI_IDR_CXFR_DONE (0x1u << 17) /**< \brief (ISI_IDR) Codec DMA Transfer Done Interrupt Disable */ -#define ISI_IDR_P_OVR (0x1u << 24) /**< \brief (ISI_IDR) Preview Datapath Overflow Interrupt Disable */ -#define ISI_IDR_C_OVR (0x1u << 25) /**< \brief (ISI_IDR) Codec Datapath Overflow Interrupt Disable */ -#define ISI_IDR_CRC_ERR (0x1u << 26) /**< \brief (ISI_IDR) Embedded Synchronization CRC Error Interrupt Disable */ -#define ISI_IDR_FR_OVR (0x1u << 27) /**< \brief (ISI_IDR) Frame Rate Overflow Interrupt Disable */ -/* -------- ISI_IMR : (ISI Offset: 0x34) ISI Interrupt Mask Register -------- */ -#define ISI_IMR_DIS_DONE (0x1u << 1) /**< \brief (ISI_IMR) Module Disable Operation Completed */ -#define ISI_IMR_SRST (0x1u << 2) /**< \brief (ISI_IMR) Software Reset Completed */ -#define ISI_IMR_VSYNC (0x1u << 10) /**< \brief (ISI_IMR) Vertical Synchronization */ -#define ISI_IMR_PXFR_DONE (0x1u << 16) /**< \brief (ISI_IMR) Preview DMA Transfer Completed */ -#define ISI_IMR_CXFR_DONE (0x1u << 17) /**< \brief (ISI_IMR) Codec DMA Transfer Completed */ -#define ISI_IMR_P_OVR (0x1u << 24) /**< \brief (ISI_IMR) Preview FIFO Overflow */ -#define ISI_IMR_C_OVR (0x1u << 25) /**< \brief (ISI_IMR) Codec FIFO Overflow */ -#define ISI_IMR_CRC_ERR (0x1u << 26) /**< \brief (ISI_IMR) CRC Synchronization Error */ -#define ISI_IMR_FR_OVR (0x1u << 27) /**< \brief (ISI_IMR) Frame Rate Overrun */ -/* -------- ISI_DMA_CHER : (ISI Offset: 0x38) DMA Channel Enable Register -------- */ -#define ISI_DMA_CHER_P_CH_EN (0x1u << 0) /**< \brief (ISI_DMA_CHER) Preview Channel Enable */ -#define ISI_DMA_CHER_C_CH_EN (0x1u << 1) /**< \brief (ISI_DMA_CHER) Codec Channel Enable */ -/* -------- ISI_DMA_CHDR : (ISI Offset: 0x3C) DMA Channel Disable Register -------- */ -#define ISI_DMA_CHDR_P_CH_DIS (0x1u << 0) /**< \brief (ISI_DMA_CHDR) Preview Channel Disable Request */ -#define ISI_DMA_CHDR_C_CH_DIS (0x1u << 1) /**< \brief (ISI_DMA_CHDR) Codec Channel Disable Request */ -/* -------- ISI_DMA_CHSR : (ISI Offset: 0x40) DMA Channel Status Register -------- */ -#define ISI_DMA_CHSR_P_CH_S (0x1u << 0) /**< \brief (ISI_DMA_CHSR) Preview DMA Channel Status */ -#define ISI_DMA_CHSR_C_CH_S (0x1u << 1) /**< \brief (ISI_DMA_CHSR) Code DMA Channel Status */ -/* -------- ISI_DMA_P_ADDR : (ISI Offset: 0x44) DMA Preview Base Address Register -------- */ -#define ISI_DMA_P_ADDR_P_ADDR_Pos 2 -#define ISI_DMA_P_ADDR_P_ADDR_Msk (0x3fffffffu << ISI_DMA_P_ADDR_P_ADDR_Pos) /**< \brief (ISI_DMA_P_ADDR) Preview Image Base Address */ -#define ISI_DMA_P_ADDR_P_ADDR(value) ((ISI_DMA_P_ADDR_P_ADDR_Msk & ((value) << ISI_DMA_P_ADDR_P_ADDR_Pos))) -/* -------- ISI_DMA_P_CTRL : (ISI Offset: 0x48) DMA Preview Control Register -------- */ -#define ISI_DMA_P_CTRL_P_FETCH (0x1u << 0) /**< \brief (ISI_DMA_P_CTRL) Descriptor Fetch Control Bit */ -#define ISI_DMA_P_CTRL_P_WB (0x1u << 1) /**< \brief (ISI_DMA_P_CTRL) Descriptor Writeback Control Bit */ -#define ISI_DMA_P_CTRL_P_IEN (0x1u << 2) /**< \brief (ISI_DMA_P_CTRL) Transfer Done Flag Control */ -#define ISI_DMA_P_CTRL_P_DONE (0x1u << 3) /**< \brief (ISI_DMA_P_CTRL) Preview Transfer Done */ -/* -------- ISI_DMA_P_DSCR : (ISI Offset: 0x4C) DMA Preview Descriptor Address Register -------- */ -#define ISI_DMA_P_DSCR_P_DSCR_Pos 2 -#define ISI_DMA_P_DSCR_P_DSCR_Msk (0x3fffffffu << ISI_DMA_P_DSCR_P_DSCR_Pos) /**< \brief (ISI_DMA_P_DSCR) Preview Descriptor Base Address */ -#define ISI_DMA_P_DSCR_P_DSCR(value) ((ISI_DMA_P_DSCR_P_DSCR_Msk & ((value) << ISI_DMA_P_DSCR_P_DSCR_Pos))) -/* -------- ISI_DMA_C_ADDR : (ISI Offset: 0x50) DMA Codec Base Address Register -------- */ -#define ISI_DMA_C_ADDR_C_ADDR_Pos 2 -#define ISI_DMA_C_ADDR_C_ADDR_Msk (0x3fffffffu << ISI_DMA_C_ADDR_C_ADDR_Pos) /**< \brief (ISI_DMA_C_ADDR) Codec Image Base Address */ -#define ISI_DMA_C_ADDR_C_ADDR(value) ((ISI_DMA_C_ADDR_C_ADDR_Msk & ((value) << ISI_DMA_C_ADDR_C_ADDR_Pos))) -/* -------- ISI_DMA_C_CTRL : (ISI Offset: 0x54) DMA Codec Control Register -------- */ -#define ISI_DMA_C_CTRL_C_FETCH (0x1u << 0) /**< \brief (ISI_DMA_C_CTRL) Descriptor Fetch Control Bit */ -#define ISI_DMA_C_CTRL_C_WB (0x1u << 1) /**< \brief (ISI_DMA_C_CTRL) Descriptor Writeback Control Bit */ -#define ISI_DMA_C_CTRL_C_IEN (0x1u << 2) /**< \brief (ISI_DMA_C_CTRL) Transfer Done Flag Control */ -#define ISI_DMA_C_CTRL_C_DONE (0x1u << 3) /**< \brief (ISI_DMA_C_CTRL) Codec Transfer Done */ -/* -------- ISI_DMA_C_DSCR : (ISI Offset: 0x58) DMA Codec Descriptor Address Register -------- */ -#define ISI_DMA_C_DSCR_C_DSCR_Pos 2 -#define ISI_DMA_C_DSCR_C_DSCR_Msk (0x3fffffffu << ISI_DMA_C_DSCR_C_DSCR_Pos) /**< \brief (ISI_DMA_C_DSCR) Codec Descriptor Base Address */ -#define ISI_DMA_C_DSCR_C_DSCR(value) ((ISI_DMA_C_DSCR_C_DSCR_Msk & ((value) << ISI_DMA_C_DSCR_C_DSCR_Pos))) -/* -------- ISI_WPMR : (ISI Offset: 0xE4) Write Protection Mode Register -------- */ -#define ISI_WPMR_WPEN (0x1u << 0) /**< \brief (ISI_WPMR) Write Protection Enable */ -#define ISI_WPMR_WPKEY_Pos 8 -#define ISI_WPMR_WPKEY_Msk (0xffffffu << ISI_WPMR_WPKEY_Pos) /**< \brief (ISI_WPMR) Write Protection Key Password */ -#define ISI_WPMR_WPKEY(value) ((ISI_WPMR_WPKEY_Msk & ((value) << ISI_WPMR_WPKEY_Pos))) -#define ISI_WPMR_WPKEY_PASSWD (0x495349u << 8) /**< \brief (ISI_WPMR) Writing any other value in this field aborts the write operation of the WPEN bit.Always reads as 0. */ -/* -------- ISI_WPSR : (ISI Offset: 0xE8) Write Protection Status Register -------- */ -#define ISI_WPSR_WPVS (0x1u << 0) /**< \brief (ISI_WPSR) Write Protection Violation Status */ -#define ISI_WPSR_WPVSRC_Pos 8 -#define ISI_WPSR_WPVSRC_Msk (0xffffu << ISI_WPSR_WPVSRC_Pos) /**< \brief (ISI_WPSR) Write Protection Violation Source */ - -/*@}*/ - - -#endif /* _SAMV71_ISI_COMPONENT_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_matrix.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_matrix.h deleted file mode 100644 index 2a337bb8..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_matrix.h +++ /dev/null @@ -1,174 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_MATRIX_COMPONENT_ -#define _SAMV71_MATRIX_COMPONENT_ - -/* ============================================================================= */ -/** SOFTWARE API DEFINITION FOR AHB Bus Matrix */ -/* ============================================================================= */ -/** \addtogroup SAMV71_MATRIX AHB Bus Matrix */ -/*@{*/ - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -/** \brief MatrixPr hardware registers */ -typedef struct { - __IO uint32_t MATRIX_PRAS; /**< \brief (MatrixPr Offset: 0x0) Priority Register A for Slave 0 */ - __IO uint32_t MATRIX_PRBS; /**< \brief (MatrixPr Offset: 0x4) Priority Register B for Slave 0 */ -} MatrixPr; -/** \brief Matrix hardware registers */ -#define MATRIXPR_NUMBER 9 -typedef struct { - __IO uint32_t MATRIX_MCFG[12]; /**< \brief (Matrix Offset: 0x0000) Master Configuration Register */ - __I uint32_t Reserved1[4]; - __IO uint32_t MATRIX_SCFG[9]; /**< \brief (Matrix Offset: 0x0040) Slave Configuration Register */ - __I uint32_t Reserved2[7]; - MatrixPr MATRIX_PR[MATRIXPR_NUMBER]; /**< \brief (Matrix Offset: 0x0080) 0 .. 8 */ - __I uint32_t Reserved3[14]; - __IO uint32_t MATRIX_MRCR; /**< \brief (Matrix Offset: 0x0100) Master Remap Control Register */ - __I uint32_t Reserved4[3]; - __IO uint32_t CCFG_CAN0; /**< \brief (Matrix Offset: 0x0110) CAN0 Configuration Register */ - __IO uint32_t CCFG_SYSIO; /**< \brief (Matrix Offset: 0x0114) System I/O and CAN1 Configuration Register */ - __I uint32_t Reserved5[3]; - __IO uint32_t CCFG_SMCNFCS; /**< \brief (Matrix Offset: 0x0124) SMC NAND Flash Chip Select Configuration Register */ - __I uint32_t Reserved6[47]; - __IO uint32_t MATRIX_WPMR; /**< \brief (Matrix Offset: 0x01E4) Write Protection Mode Register */ - __I uint32_t MATRIX_WPSR; /**< \brief (Matrix Offset: 0x01E8) Write Protection Status Register */ -} Matrix; -#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/* -------- MATRIX_MCFG[12] : (MATRIX Offset: 0x0000) Master Configuration Register -------- */ -#define MATRIX_MCFG_ULBT_Pos 0 -#define MATRIX_MCFG_ULBT_Msk (0x7u << MATRIX_MCFG_ULBT_Pos) /**< \brief (MATRIX_MCFG[12]) Undefined Length Burst Type */ -#define MATRIX_MCFG_ULBT(value) ((MATRIX_MCFG_ULBT_Msk & ((value) << MATRIX_MCFG_ULBT_Pos))) -#define MATRIX_MCFG_ULBT_UNLTD_LENGTH (0x0u << 0) /**< \brief (MATRIX_MCFG[12]) Unlimited Length Burst-No predicted end of burst is generated, therefore INCR bursts coming from this master can only be broken if the Slave Slot Cycle Limit is reached. If the Slot Cycle Limit is not reached, the burst is normally completed by the master, at the latest, on the next AHB 1-Kbyte address boundary, allowing up to 256-beat word bursts or 128-beat double-word bursts.This value should not be used in the very particular case of a master capable of performing back-to-back undefined length bursts on a single slave, since this could indefinitely freeze the slave arbitration and thus prevent another master from accessing this slave. */ -#define MATRIX_MCFG_ULBT_SINGLE_ACCESS (0x1u << 0) /**< \brief (MATRIX_MCFG[12]) Single Access-The undefined length burst is treated as a succession of single accesses, allowing re-arbitration at each beat of the INCR burst or bursts sequence. */ -#define MATRIX_MCFG_ULBT_4BEAT_BURST (0x2u << 0) /**< \brief (MATRIX_MCFG[12]) 4-beat Burst-The undefined length burst or bursts sequence is split into 4-beat bursts or less, allowing re-arbitration every 4 beats. */ -#define MATRIX_MCFG_ULBT_8BEAT_BURST (0x3u << 0) /**< \brief (MATRIX_MCFG[12]) 8-beat Burst-The undefined length burst or bursts sequence is split into 8-beat bursts or less, allowing re-arbitration every 8 beats. */ -#define MATRIX_MCFG_ULBT_16BEAT_BURST (0x4u << 0) /**< \brief (MATRIX_MCFG[12]) 16-beat Burst-The undefined length burst or bursts sequence is split into 16-beat bursts or less, allowing re-arbitration every 16 beats. */ -#define MATRIX_MCFG_ULBT_32BEAT_BURST (0x5u << 0) /**< \brief (MATRIX_MCFG[12]) 32-beat Burst -The undefined length burst or bursts sequence is split into 32-beat bursts or less, allowing re-arbitration every 32 beats. */ -#define MATRIX_MCFG_ULBT_64BEAT_BURST (0x6u << 0) /**< \brief (MATRIX_MCFG[12]) 64-beat Burst-The undefined length burst or bursts sequence is split into 64-beat bursts or less, allowing re-arbitration every 64 beats. */ -#define MATRIX_MCFG_ULBT_128BEAT_BURST (0x7u << 0) /**< \brief (MATRIX_MCFG[12]) 128-beat Burst-The undefined length burst or bursts sequence is split into 128-beat bursts or less, allowing re-arbitration every 128 beats. */ -/* -------- MATRIX_SCFG[9] : (MATRIX Offset: 0x0040) Slave Configuration Register -------- */ -#define MATRIX_SCFG_SLOT_CYCLE_Pos 0 -#define MATRIX_SCFG_SLOT_CYCLE_Msk (0x1ffu << MATRIX_SCFG_SLOT_CYCLE_Pos) /**< \brief (MATRIX_SCFG[9]) Maximum Bus Grant Duration for Masters */ -#define MATRIX_SCFG_SLOT_CYCLE(value) ((MATRIX_SCFG_SLOT_CYCLE_Msk & ((value) << MATRIX_SCFG_SLOT_CYCLE_Pos))) -#define MATRIX_SCFG_DEFMSTR_TYPE_Pos 16 -#define MATRIX_SCFG_DEFMSTR_TYPE_Msk (0x3u << MATRIX_SCFG_DEFMSTR_TYPE_Pos) /**< \brief (MATRIX_SCFG[9]) Default Master Type */ -#define MATRIX_SCFG_DEFMSTR_TYPE(value) ((MATRIX_SCFG_DEFMSTR_TYPE_Msk & ((value) << MATRIX_SCFG_DEFMSTR_TYPE_Pos))) -#define MATRIX_SCFG_DEFMSTR_TYPE_NONE (0x0u << 16) /**< \brief (MATRIX_SCFG[9]) No Default Master-At the end of the current slave access, if no other master request is pending, the slave is disconnected from all masters.This results in a one clock cycle latency for the first access of a burst transfer or for a single access. */ -#define MATRIX_SCFG_DEFMSTR_TYPE_LAST (0x1u << 16) /**< \brief (MATRIX_SCFG[9]) Last Default Master-At the end of the current slave access, if no other master request is pending, the slave stays connected to the last master having accessed it.This results in not having one clock cycle latency when the last master tries to access the slave again. */ -#define MATRIX_SCFG_DEFMSTR_TYPE_FIXED (0x2u << 16) /**< \brief (MATRIX_SCFG[9]) Fixed Default Master-At the end of the current slave access, if no other master request is pending, the slave connects to the fixed master the number that has been written in the FIXED_DEFMSTR field.This results in not having one clock cycle latency when the fixed master tries to access the slave again. */ -#define MATRIX_SCFG_FIXED_DEFMSTR_Pos 18 -#define MATRIX_SCFG_FIXED_DEFMSTR_Msk (0xfu << MATRIX_SCFG_FIXED_DEFMSTR_Pos) /**< \brief (MATRIX_SCFG[9]) Fixed Default Master */ -#define MATRIX_SCFG_FIXED_DEFMSTR(value) ((MATRIX_SCFG_FIXED_DEFMSTR_Msk & ((value) << MATRIX_SCFG_FIXED_DEFMSTR_Pos))) -/* -------- MATRIX_PRAS : (MATRIX Offset: N/A) Priority Register A for Slave 0 -------- */ -#define MATRIX_PRAS_M0PR_Pos 0 -#define MATRIX_PRAS_M0PR_Msk (0x3u << MATRIX_PRAS_M0PR_Pos) /**< \brief (MATRIX_PRAS) Master 0 Priority */ -#define MATRIX_PRAS_M0PR(value) ((MATRIX_PRAS_M0PR_Msk & ((value) << MATRIX_PRAS_M0PR_Pos))) -#define MATRIX_PRAS_M1PR_Pos 4 -#define MATRIX_PRAS_M1PR_Msk (0x3u << MATRIX_PRAS_M1PR_Pos) /**< \brief (MATRIX_PRAS) Master 1 Priority */ -#define MATRIX_PRAS_M1PR(value) ((MATRIX_PRAS_M1PR_Msk & ((value) << MATRIX_PRAS_M1PR_Pos))) -#define MATRIX_PRAS_M2PR_Pos 8 -#define MATRIX_PRAS_M2PR_Msk (0x3u << MATRIX_PRAS_M2PR_Pos) /**< \brief (MATRIX_PRAS) Master 2 Priority */ -#define MATRIX_PRAS_M2PR(value) ((MATRIX_PRAS_M2PR_Msk & ((value) << MATRIX_PRAS_M2PR_Pos))) -#define MATRIX_PRAS_M3PR_Pos 12 -#define MATRIX_PRAS_M3PR_Msk (0x3u << MATRIX_PRAS_M3PR_Pos) /**< \brief (MATRIX_PRAS) Master 3 Priority */ -#define MATRIX_PRAS_M3PR(value) ((MATRIX_PRAS_M3PR_Msk & ((value) << MATRIX_PRAS_M3PR_Pos))) -#define MATRIX_PRAS_M4PR_Pos 16 -#define MATRIX_PRAS_M4PR_Msk (0x3u << MATRIX_PRAS_M4PR_Pos) /**< \brief (MATRIX_PRAS) Master 4 Priority */ -#define MATRIX_PRAS_M4PR(value) ((MATRIX_PRAS_M4PR_Msk & ((value) << MATRIX_PRAS_M4PR_Pos))) -#define MATRIX_PRAS_M5PR_Pos 20 -#define MATRIX_PRAS_M5PR_Msk (0x3u << MATRIX_PRAS_M5PR_Pos) /**< \brief (MATRIX_PRAS) Master 5 Priority */ -#define MATRIX_PRAS_M5PR(value) ((MATRIX_PRAS_M5PR_Msk & ((value) << MATRIX_PRAS_M5PR_Pos))) -#define MATRIX_PRAS_M6PR_Pos 24 -#define MATRIX_PRAS_M6PR_Msk (0x3u << MATRIX_PRAS_M6PR_Pos) /**< \brief (MATRIX_PRAS) Master 6 Priority */ -#define MATRIX_PRAS_M6PR(value) ((MATRIX_PRAS_M6PR_Msk & ((value) << MATRIX_PRAS_M6PR_Pos))) -#define MATRIX_PRAS_M7PR_Pos 28 -#define MATRIX_PRAS_M7PR_Msk (0x3u << MATRIX_PRAS_M7PR_Pos) /**< \brief (MATRIX_PRAS) Master 7 Priority */ -#define MATRIX_PRAS_M7PR(value) ((MATRIX_PRAS_M7PR_Msk & ((value) << MATRIX_PRAS_M7PR_Pos))) -/* -------- MATRIX_PRBS : (MATRIX Offset: N/A) Priority Register B for Slave 0 -------- */ -#define MATRIX_PRBS_M8PR_Pos 0 -#define MATRIX_PRBS_M8PR_Msk (0x3u << MATRIX_PRBS_M8PR_Pos) /**< \brief (MATRIX_PRBS) Master 8 Priority */ -#define MATRIX_PRBS_M8PR(value) ((MATRIX_PRBS_M8PR_Msk & ((value) << MATRIX_PRBS_M8PR_Pos))) -#define MATRIX_PRBS_M9PR_Pos 4 -#define MATRIX_PRBS_M9PR_Msk (0x3u << MATRIX_PRBS_M9PR_Pos) /**< \brief (MATRIX_PRBS) Master 9 Priority */ -#define MATRIX_PRBS_M9PR(value) ((MATRIX_PRBS_M9PR_Msk & ((value) << MATRIX_PRBS_M9PR_Pos))) -#define MATRIX_PRBS_M10PR_Pos 8 -#define MATRIX_PRBS_M10PR_Msk (0x3u << MATRIX_PRBS_M10PR_Pos) /**< \brief (MATRIX_PRBS) Master 10 Priority */ -#define MATRIX_PRBS_M10PR(value) ((MATRIX_PRBS_M10PR_Msk & ((value) << MATRIX_PRBS_M10PR_Pos))) -#define MATRIX_PRBS_M11PR_Pos 12 -#define MATRIX_PRBS_M11PR_Msk (0x3u << MATRIX_PRBS_M11PR_Pos) /**< \brief (MATRIX_PRBS) Master 11 Priority */ -#define MATRIX_PRBS_M11PR(value) ((MATRIX_PRBS_M11PR_Msk & ((value) << MATRIX_PRBS_M11PR_Pos))) -/* -------- MATRIX_MRCR : (MATRIX Offset: 0x0100) Master Remap Control Register -------- */ -#define MATRIX_MRCR_RCB0 (0x1u << 0) /**< \brief (MATRIX_MRCR) Remap Command Bit for Master 0 */ -#define MATRIX_MRCR_RCB1 (0x1u << 1) /**< \brief (MATRIX_MRCR) Remap Command Bit for Master 1 */ -#define MATRIX_MRCR_RCB2 (0x1u << 2) /**< \brief (MATRIX_MRCR) Remap Command Bit for Master 2 */ -#define MATRIX_MRCR_RCB3 (0x1u << 3) /**< \brief (MATRIX_MRCR) Remap Command Bit for Master 3 */ -#define MATRIX_MRCR_RCB4 (0x1u << 4) /**< \brief (MATRIX_MRCR) Remap Command Bit for Master 4 */ -#define MATRIX_MRCR_RCB5 (0x1u << 5) /**< \brief (MATRIX_MRCR) Remap Command Bit for Master 5 */ -#define MATRIX_MRCR_RCB6 (0x1u << 6) /**< \brief (MATRIX_MRCR) Remap Command Bit for Master 6 */ -#define MATRIX_MRCR_RCB7 (0x1u << 7) /**< \brief (MATRIX_MRCR) Remap Command Bit for Master 7 */ -#define MATRIX_MRCR_RCB8 (0x1u << 8) /**< \brief (MATRIX_MRCR) Remap Command Bit for Master 8 */ -#define MATRIX_MRCR_RCB9 (0x1u << 9) /**< \brief (MATRIX_MRCR) Remap Command Bit for Master 9 */ -#define MATRIX_MRCR_RCB10 (0x1u << 10) /**< \brief (MATRIX_MRCR) Remap Command Bit for Master 10 */ -#define MATRIX_MRCR_RCB11 (0x1u << 11) /**< \brief (MATRIX_MRCR) Remap Command Bit for Master 11 */ -/* -------- CCFG_CAN0 : (MATRIX Offset: 0x0110) CAN0 Configuration Register -------- */ -#define CCFG_CAN0_CAN0DMABA_Pos 16 -#define CCFG_CAN0_CAN0DMABA_Msk (0xffffu << CCFG_CAN0_CAN0DMABA_Pos) /**< \brief (CCFG_CAN0) CAN0 DMA Base Address */ -#define CCFG_CAN0_CAN0DMABA(value) ((CCFG_CAN0_CAN0DMABA_Msk & ((value) << CCFG_CAN0_CAN0DMABA_Pos))) -/* -------- CCFG_SYSIO : (MATRIX Offset: 0x0114) System I/O and CAN1 Configuration Register -------- */ -#define CCFG_SYSIO_SYSIO4 (0x1u << 4) /**< \brief (CCFG_SYSIO) PB4 or TDI Assignment */ -#define CCFG_SYSIO_SYSIO5 (0x1u << 5) /**< \brief (CCFG_SYSIO) PB5 or TDO/TRACESWO Assignment */ -#define CCFG_SYSIO_SYSIO6 (0x1u << 6) /**< \brief (CCFG_SYSIO) PB6 or TMS/SWDIO Assignment */ -#define CCFG_SYSIO_SYSIO7 (0x1u << 7) /**< \brief (CCFG_SYSIO) PB7 or TCK/SWCLK Assignment */ -#define CCFG_SYSIO_SYSIO12 (0x1u << 12) /**< \brief (CCFG_SYSIO) PB12 or ERASE Assignment */ -#define CCFG_SYSIO_CAN1DMABA_Pos 16 -#define CCFG_SYSIO_CAN1DMABA_Msk (0xffffu << CCFG_SYSIO_CAN1DMABA_Pos) /**< \brief (CCFG_SYSIO) CAN0 DMA Base Address */ -#define CCFG_SYSIO_CAN1DMABA(value) ((CCFG_SYSIO_CAN1DMABA_Msk & ((value) << CCFG_SYSIO_CAN1DMABA_Pos))) -/* -------- CCFG_SMCNFCS : (MATRIX Offset: 0x0124) SMC NAND Flash Chip Select Configuration Register -------- */ -#define CCFG_SMCNFCS_SMC_NFCS0 (0x1u << 0) /**< \brief (CCFG_SMCNFCS) SMC NAND Flash Chip Select 0 Assignment */ -#define CCFG_SMCNFCS_SMC_NFCS1 (0x1u << 1) /**< \brief (CCFG_SMCNFCS) SMC NAND Flash Chip Select 1 Assignment */ -#define CCFG_SMCNFCS_SMC_NFCS2 (0x1u << 2) /**< \brief (CCFG_SMCNFCS) SMC NAND Flash Chip Select 2 Assignment */ -#define CCFG_SMCNFCS_SMC_NFCS3 (0x1u << 3) /**< \brief (CCFG_SMCNFCS) SMC NAND Flash Chip Select 3 Assignment */ -#define CCFG_SMCNFCS_SDRAMEN (0x1u << 4) /**< \brief (CCFG_SMCNFCS) SDRAM Enable */ -/* -------- MATRIX_WPMR : (MATRIX Offset: 0x01E4) Write Protection Mode Register -------- */ -#define MATRIX_WPMR_WPEN (0x1u << 0) /**< \brief (MATRIX_WPMR) Write Protection Enable */ -#define MATRIX_WPMR_WPKEY_Pos 8 -#define MATRIX_WPMR_WPKEY_Msk (0xffffffu << MATRIX_WPMR_WPKEY_Pos) /**< \brief (MATRIX_WPMR) Write Protection Key */ -#define MATRIX_WPMR_WPKEY(value) ((MATRIX_WPMR_WPKEY_Msk & ((value) << MATRIX_WPMR_WPKEY_Pos))) -#define MATRIX_WPMR_WPKEY_PASSWD (0x4D4154u << 8) /**< \brief (MATRIX_WPMR) Writing any other value in this field aborts the write operation of the WPEN bit.Always reads as 0. */ -/* -------- MATRIX_WPSR : (MATRIX Offset: 0x01E8) Write Protection Status Register -------- */ -#define MATRIX_WPSR_WPVS (0x1u << 0) /**< \brief (MATRIX_WPSR) Write Protection Violation Status */ -#define MATRIX_WPSR_WPVSRC_Pos 8 -#define MATRIX_WPSR_WPVSRC_Msk (0xffffu << MATRIX_WPSR_WPVSRC_Pos) /**< \brief (MATRIX_WPSR) Write Protection Violation Source */ - -/*@}*/ - - -#endif /* _SAMV71_MATRIX_COMPONENT_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_mcan.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_mcan.h deleted file mode 100644 index d3bfa010..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_mcan.h +++ /dev/null @@ -1,845 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_MCAN_COMPONENT_ -#define _SAMV71_MCAN_COMPONENT_ - -/* ============================================================================= */ -/** SOFTWARE API DEFINITION FOR Controller Area Network */ -/* ============================================================================= */ -/** \addtogroup SAMV71_MCAN Controller Area Network */ -/*@{*/ - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -/** \brief Mcan hardware registers */ -typedef struct { - __I uint32_t Reserved1[2]; - __IO uint32_t MCAN_CUST; /**< \brief (Mcan Offset: 0x08) Customer Register */ - __IO uint32_t MCAN_FBTP; /**< \brief (Mcan Offset: 0x0C) Fast Bit Timing and Prescaler Register */ - __IO uint32_t MCAN_TEST; /**< \brief (Mcan Offset: 0x10) Test Register */ - __IO uint32_t MCAN_RWD; /**< \brief (Mcan Offset: 0x14) RAM Watchdog Register */ - __IO uint32_t MCAN_CCCR; /**< \brief (Mcan Offset: 0x18) CC Control Register */ - __IO uint32_t MCAN_BTP; /**< \brief (Mcan Offset: 0x1C) Bit Timing and Prescaler Register */ - __IO uint32_t MCAN_TSCC; /**< \brief (Mcan Offset: 0x20) Timestamp Counter Configuration Register */ - __IO uint32_t MCAN_TSCV; /**< \brief (Mcan Offset: 0x24) Timestamp Counter Value Register */ - __IO uint32_t MCAN_TOCC; /**< \brief (Mcan Offset: 0x28) Timeout Counter Configuration Register */ - __IO uint32_t MCAN_TOCV; /**< \brief (Mcan Offset: 0x2C) Timeout Counter Value Register */ - __I uint32_t Reserved2[4]; - __I uint32_t MCAN_ECR; /**< \brief (Mcan Offset: 0x40) Error Counter Register */ - __I uint32_t MCAN_PSR; /**< \brief (Mcan Offset: 0x44) Protocol Status Register */ - __I uint32_t Reserved3[2]; - __IO uint32_t MCAN_IR; /**< \brief (Mcan Offset: 0x50) Interrupt Register */ - __IO uint32_t MCAN_IE; /**< \brief (Mcan Offset: 0x54) Interrupt Enable Register */ - __IO uint32_t MCAN_ILS; /**< \brief (Mcan Offset: 0x58) Interrupt Line Select Register */ - __IO uint32_t MCAN_ILE; /**< \brief (Mcan Offset: 0x5C) Interrupt Line Enable Register */ - __I uint32_t Reserved4[8]; - __IO uint32_t MCAN_GFC; /**< \brief (Mcan Offset: 0x80) Global Filter Configuration Register */ - __IO uint32_t MCAN_SIDFC; /**< \brief (Mcan Offset: 0x84) Standard ID Filter Configuration Register */ - __IO uint32_t MCAN_XIDFC; /**< \brief (Mcan Offset: 0x88) Extended ID Filter Configuration Register */ - __I uint32_t Reserved5[1]; - __IO uint32_t MCAN_XIDAM; /**< \brief (Mcan Offset: 0x90) Extended ID AND Mask Register */ - __I uint32_t MCAN_HPMS; /**< \brief (Mcan Offset: 0x94) High Priority Message Status Register */ - __IO uint32_t MCAN_NDAT1; /**< \brief (Mcan Offset: 0x98) New Data 1 Register */ - __IO uint32_t MCAN_NDAT2; /**< \brief (Mcan Offset: 0x9C) New Data 2 Register */ - __IO uint32_t MCAN_RXF0C; /**< \brief (Mcan Offset: 0xA0) Receive FIFO 0 Configuration Register */ - __I uint32_t MCAN_RXF0S; /**< \brief (Mcan Offset: 0xA4) Receive FIFO 0 Status Register */ - __IO uint32_t MCAN_RXF0A; /**< \brief (Mcan Offset: 0xA8) Receive FIFO 0 Acknowledge Register */ - __IO uint32_t MCAN_RXBC; /**< \brief (Mcan Offset: 0xAC) Receive Rx Buffer Configuration Register */ - __IO uint32_t MCAN_RXF1C; /**< \brief (Mcan Offset: 0xB0) Receive FIFO 1 Configuration Register */ - __I uint32_t MCAN_RXF1S; /**< \brief (Mcan Offset: 0xB4) Receive FIFO 1 Status Register */ - __IO uint32_t MCAN_RXF1A; /**< \brief (Mcan Offset: 0xB8) Receive FIFO 1 Acknowledge Register */ - __IO uint32_t MCAN_RXESC; /**< \brief (Mcan Offset: 0xBC) Receive Buffer / FIFO Element Size Configuration Register */ - __IO uint32_t MCAN_TXBC; /**< \brief (Mcan Offset: 0xC0) Transmit Buffer Configuration Register */ - __I uint32_t MCAN_TXFQS; /**< \brief (Mcan Offset: 0xC4) Transmit FIFO/Queue Status Register */ - __IO uint32_t MCAN_TXESC; /**< \brief (Mcan Offset: 0xC8) Transmit Buffer Element Size Configuration Register */ - __I uint32_t MCAN_TXBRP; /**< \brief (Mcan Offset: 0xCC) Transmit Buffer Request Pending Register */ - __IO uint32_t MCAN_TXBAR; /**< \brief (Mcan Offset: 0xD0) Transmit Buffer Add Request Register */ - __IO uint32_t MCAN_TXBCR; /**< \brief (Mcan Offset: 0xD4) Transmit Buffer Cancellation Request Register */ - __I uint32_t MCAN_TXBTO; /**< \brief (Mcan Offset: 0xD8) Transmit Buffer Transmission Occurred Register */ - __I uint32_t MCAN_TXBCF; /**< \brief (Mcan Offset: 0xDC) Transmit Buffer Cancellation Finished Register */ - __IO uint32_t MCAN_TXBTIE; /**< \brief (Mcan Offset: 0xE0) Transmit Buffer Transmission Interrupt Enable Register */ - __IO uint32_t MCAN_TXBCIE; /**< \brief (Mcan Offset: 0xE4) Transmit Buffer Cancellation Finished Interrupt Enable Register */ - __I uint32_t Reserved6[2]; - __IO uint32_t MCAN_TXEFC; /**< \brief (Mcan Offset: 0xF0) Transmit Event FIFO Configuration Register */ - __I uint32_t MCAN_TXEFS; /**< \brief (Mcan Offset: 0xF4) Transmit Event FIFO Status Register */ - __IO uint32_t MCAN_TXEFA; /**< \brief (Mcan Offset: 0xF8) Transmit Event FIFO Acknowledge Register */ -} Mcan; -#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/* -------- MCAN_CUST : (MCAN Offset: 0x08) Customer Register -------- */ -#define MCAN_CUST_CSV_Pos 0 -#define MCAN_CUST_CSV_Msk (0xffffffffu << MCAN_CUST_CSV_Pos) /**< \brief (MCAN_CUST) Customer-specific Value */ -#define MCAN_CUST_CSV(value) ((MCAN_CUST_CSV_Msk & ((value) << MCAN_CUST_CSV_Pos))) -/* -------- MCAN_FBTP : (MCAN Offset: 0x0C) Fast Bit Timing and Prescaler Register -------- */ -#define MCAN_FBTP_FSJW_Pos 0 -#define MCAN_FBTP_FSJW_Msk (0x3u << MCAN_FBTP_FSJW_Pos) /**< \brief (MCAN_FBTP) Fast (Re) Synchronization Jump Width */ -#define MCAN_FBTP_FSJW(value) ((MCAN_FBTP_FSJW_Msk & ((value) << MCAN_FBTP_FSJW_Pos))) -#define MCAN_FBTP_FTSEG2_Pos 4 -#define MCAN_FBTP_FTSEG2_Msk (0x7u << MCAN_FBTP_FTSEG2_Pos) /**< \brief (MCAN_FBTP) Fast Time Segment After Sample Point */ -#define MCAN_FBTP_FTSEG2(value) ((MCAN_FBTP_FTSEG2_Msk & ((value) << MCAN_FBTP_FTSEG2_Pos))) -#define MCAN_FBTP_FTSEG1_Pos 8 -#define MCAN_FBTP_FTSEG1_Msk (0xfu << MCAN_FBTP_FTSEG1_Pos) /**< \brief (MCAN_FBTP) Fast Time Segment Before Sample Point */ -#define MCAN_FBTP_FTSEG1(value) ((MCAN_FBTP_FTSEG1_Msk & ((value) << MCAN_FBTP_FTSEG1_Pos))) -#define MCAN_FBTP_FBRP_Pos 16 -#define MCAN_FBTP_FBRP_Msk (0x1fu << MCAN_FBTP_FBRP_Pos) /**< \brief (MCAN_FBTP) Fast Baud Rate Prescaler */ -#define MCAN_FBTP_FBRP(value) ((MCAN_FBTP_FBRP_Msk & ((value) << MCAN_FBTP_FBRP_Pos))) -#define MCAN_FBTP_TDC (0x1u << 23) /**< \brief (MCAN_FBTP) Transceiver Delay Compensation */ -#define MCAN_FBTP_TDC_DISABLED (0x0u << 23) /**< \brief (MCAN_FBTP) Transceiver Delay Compensation disabled. */ -#define MCAN_FBTP_TDC_ENABLED (0x1u << 23) /**< \brief (MCAN_FBTP) Transceiver Delay Compensation enabled. */ -#define MCAN_FBTP_TDCO_Pos 24 -#define MCAN_FBTP_TDCO_Msk (0x1fu << MCAN_FBTP_TDCO_Pos) /**< \brief (MCAN_FBTP) Transce iver Delay Compensation Offset */ -#define MCAN_FBTP_TDCO(value) ((MCAN_FBTP_TDCO_Msk & ((value) << MCAN_FBTP_TDCO_Pos))) -/* -------- MCAN_TEST : (MCAN Offset: 0x10) Test Register -------- */ -#define MCAN_TEST_LBCK (0x1u << 4) /**< \brief (MCAN_TEST) Loop Back Mode (read/write) */ -#define MCAN_TEST_LBCK_DISABLED (0x0u << 4) /**< \brief (MCAN_TEST) Reset value. Loop Back mode is disabled. */ -#define MCAN_TEST_LBCK_ENABLED (0x1u << 4) /**< \brief (MCAN_TEST) Loop Back mode is enabled (see Section 6.1.9). */ -#define MCAN_TEST_TX_Pos 5 -#define MCAN_TEST_TX_Msk (0x3u << MCAN_TEST_TX_Pos) /**< \brief (MCAN_TEST) Control of Transmit Pin (read/write) */ -#define MCAN_TEST_TX(value) ((MCAN_TEST_TX_Msk & ((value) << MCAN_TEST_TX_Pos))) -#define MCAN_TEST_TX_RESET (0x0u << 5) /**< \brief (MCAN_TEST) Reset value, CANTX controlled by the CAN Core, updated at the end of the CAN bit time. */ -#define MCAN_TEST_TX_SAMPLE_POINT_MONITORING (0x1u << 5) /**< \brief (MCAN_TEST) Sample Point can be monitored at pin CANTX. */ -#define MCAN_TEST_TX_DOMINANT (0x2u << 5) /**< \brief (MCAN_TEST) Dominant ('0') level at pin CANTX. */ -#define MCAN_TEST_TX_RECESSIVE (0x3u << 5) /**< \brief (MCAN_TEST) Recessive ('1') at pin CANTX. */ -#define MCAN_TEST_RX (0x1u << 7) /**< \brief (MCAN_TEST) Receive Pin (read-only) */ -#define MCAN_TEST_TDCV_Pos 8 -#define MCAN_TEST_TDCV_Msk (0x3fu << MCAN_TEST_TDCV_Pos) /**< \brief (MCAN_TEST) Transceiver Delay Compensation Value (read-only) */ -#define MCAN_TEST_TDCV(value) ((MCAN_TEST_TDCV_Msk & ((value) << MCAN_TEST_TDCV_Pos))) -/* -------- MCAN_RWD : (MCAN Offset: 0x14) RAM Watchdog Register -------- */ -#define MCAN_RWD_WDC_Pos 0 -#define MCAN_RWD_WDC_Msk (0xffu << MCAN_RWD_WDC_Pos) /**< \brief (MCAN_RWD) Watchdog Configuration (read/write) */ -#define MCAN_RWD_WDC(value) ((MCAN_RWD_WDC_Msk & ((value) << MCAN_RWD_WDC_Pos))) -#define MCAN_RWD_WDV_Pos 8 -#define MCAN_RWD_WDV_Msk (0xffu << MCAN_RWD_WDV_Pos) /**< \brief (MCAN_RWD) Watchdog Value (read-only) */ -#define MCAN_RWD_WDV(value) ((MCAN_RWD_WDV_Msk & ((value) << MCAN_RWD_WDV_Pos))) -/* -------- MCAN_CCCR : (MCAN Offset: 0x18) CC Control Register -------- */ -#define MCAN_CCCR_INIT (0x1u << 0) /**< \brief (MCAN_CCCR) Initialization (read/write) */ -#define MCAN_CCCR_INIT_DISABLED (0x0u << 0) /**< \brief (MCAN_CCCR) Normal operation. */ -#define MCAN_CCCR_INIT_ENABLED (0x1u << 0) /**< \brief (MCAN_CCCR) Initialization is started. */ -#define MCAN_CCCR_CCE (0x1u << 1) /**< \brief (MCAN_CCCR) Configuration Change Enable (read/write, write protection) */ -#define MCAN_CCCR_CCE_PROTECTED (0x0u << 1) /**< \brief (MCAN_CCCR) The processor has no write access to the protected configuration registers. */ -#define MCAN_CCCR_CCE_CONFIGURABLE (0x1u << 1) /**< \brief (MCAN_CCCR) The processor has write access to the protected configuration registers (while MCAN_CCCR.INIT = '1'). */ -#define MCAN_CCCR_ASM (0x1u << 2) /**< \brief (MCAN_CCCR) Restricted Operation Mode (read/write, write protection against '1') */ -#define MCAN_CCCR_ASM_NORMAL (0x0u << 2) /**< \brief (MCAN_CCCR) Normal CAN operation. */ -#define MCAN_CCCR_ASM_RESTRICTED (0x1u << 2) /**< \brief (MCAN_CCCR) Restricted operation mode active. */ -#define MCAN_CCCR_CSA (0x1u << 3) /**< \brief (MCAN_CCCR) Clock Stop Acknowledge (read-only) */ -#define MCAN_CCCR_CSR (0x1u << 4) /**< \brief (MCAN_CCCR) Clock Stop Request (read/write) */ -#define MCAN_CCCR_CSR_NO_CLOCK_STOP (0x0u << 4) /**< \brief (MCAN_CCCR) No clock stop is requested. */ -#define MCAN_CCCR_CSR_CLOCK_STOP (0x1u << 4) /**< \brief (MCAN_CCCR) Clock stop requested. When clock stop is requested, first INIT and then CSA will be set after all pend-ing transfer requests have been completed and the CAN bus reached idle. */ -#define MCAN_CCCR_MON (0x1u << 5) /**< \brief (MCAN_CCCR) Bus Monitoring Mode (read/write, write protection against '1') */ -#define MCAN_CCCR_MON_DISABLED (0x0u << 5) /**< \brief (MCAN_CCCR) Bus Monitoring mode is disabled. */ -#define MCAN_CCCR_MON_ENABLED (0x1u << 5) /**< \brief (MCAN_CCCR) Bus Monitoring mode is enabled. */ -#define MCAN_CCCR_DAR (0x1u << 6) /**< \brief (MCAN_CCCR) Disable Automatic Retransmission (read/write, write protection) */ -#define MCAN_CCCR_DAR_AUTO_RETX (0x0u << 6) /**< \brief (MCAN_CCCR) Automatic retransmission of messages not transmitted successfully enabled. */ -#define MCAN_CCCR_DAR_NO_AUTO_RETX (0x1u << 6) /**< \brief (MCAN_CCCR) Automatic retransmission disabled. */ -#define MCAN_CCCR_TEST (0x1u << 7) /**< \brief (MCAN_CCCR) Test Mode Enable (read/write, write protection against '1') */ -#define MCAN_CCCR_TEST_DISABLED (0x0u << 7) /**< \brief (MCAN_CCCR) Normal operation, MCAN_TEST register holds reset values. */ -#define MCAN_CCCR_TEST_ENABLED (0x1u << 7) /**< \brief (MCAN_CCCR) Test mode, write access to MCAN_TEST register enabled. */ -#define MCAN_CCCR_CME_Pos 8 -#define MCAN_CCCR_CME_Msk (0x3u << MCAN_CCCR_CME_Pos) /**< \brief (MCAN_CCCR) CAN Mode Enable (read/write, write protection) */ -#define MCAN_CCCR_CME(value) ((MCAN_CCCR_CME_Msk & ((value) << MCAN_CCCR_CME_Pos))) -#define MCAN_CCCR_CME_ISO11898_1 (0x0u << 8) /**< \brief (MCAN_CCCR) CAN operation according to ISO11898-1 enabled */ -#define MCAN_CCCR_CME_FD (0x1u << 8) /**< \brief (MCAN_CCCR) CAN FD operation enabled */ -#define MCAN_CCCR_CMR_Pos 10 -#define MCAN_CCCR_CMR_Msk (0x3u << MCAN_CCCR_CMR_Pos) /**< \brief (MCAN_CCCR) CAN Mode Request (read/write) */ -#define MCAN_CCCR_CMR(value) ((MCAN_CCCR_CMR_Msk & ((value) << MCAN_CCCR_CMR_Pos))) -#define MCAN_CCCR_CMR_NO_CHANGE (0x0u << 10) /**< \brief (MCAN_CCCR) No mode change */ -#define MCAN_CCCR_CMR_FD (0x1u << 10) /**< \brief (MCAN_CCCR) Request CAN FD operation */ -#define MCAN_CCCR_CMR_FD_BITRATE_SWITCH (0x2u << 10) /**< \brief (MCAN_CCCR) Request CAN FD operation with bit rate switching */ -#define MCAN_CCCR_CMR_ISO11898_1 (0x3u << 10) /**< \brief (MCAN_CCCR) Request CAN operation according ISO11898-1 */ -#define MCAN_CCCR_FDO (0x1u << 12) /**< \brief (MCAN_CCCR) CAN FD Operation (read-only) */ -#define MCAN_CCCR_FDBS (0x1u << 13) /**< \brief (MCAN_CCCR) CAN FD Bit Rate Switching (read-only) */ -#define MCAN_CCCR_TXP (0x1u << 14) /**< \brief (MCAN_CCCR) Transmit Pause (read/write, write protection) */ -/* -------- MCAN_BTP : (MCAN Offset: 0x1C) Bit Timing and Prescaler Register -------- */ -#define MCAN_BTP_SJW_Pos 0 -#define MCAN_BTP_SJW_Msk (0xfu << MCAN_BTP_SJW_Pos) /**< \brief (MCAN_BTP) (Re) Synchronization Jump Width */ -#define MCAN_BTP_SJW(value) ((MCAN_BTP_SJW_Msk & ((value) << MCAN_BTP_SJW_Pos))) -#define MCAN_BTP_TSEG2_Pos 4 -#define MCAN_BTP_TSEG2_Msk (0xfu << MCAN_BTP_TSEG2_Pos) /**< \brief (MCAN_BTP) Time Segment After Sample Point */ -#define MCAN_BTP_TSEG2(value) ((MCAN_BTP_TSEG2_Msk & ((value) << MCAN_BTP_TSEG2_Pos))) -#define MCAN_BTP_TSEG1_Pos 8 -#define MCAN_BTP_TSEG1_Msk (0x3fu << MCAN_BTP_TSEG1_Pos) /**< \brief (MCAN_BTP) Time Segment Before Sample Point */ -#define MCAN_BTP_TSEG1(value) ((MCAN_BTP_TSEG1_Msk & ((value) << MCAN_BTP_TSEG1_Pos))) -#define MCAN_BTP_BRP_Pos 16 -#define MCAN_BTP_BRP_Msk (0x3ffu << MCAN_BTP_BRP_Pos) /**< \brief (MCAN_BTP) Baud Rate Prescaler */ -#define MCAN_BTP_BRP(value) ((MCAN_BTP_BRP_Msk & ((value) << MCAN_BTP_BRP_Pos))) -/* -------- MCAN_TSCC : (MCAN Offset: 0x20) Timestamp Counter Configuration Register -------- */ -#define MCAN_TSCC_TSS_Pos 0 -#define MCAN_TSCC_TSS_Msk (0x3u << MCAN_TSCC_TSS_Pos) /**< \brief (MCAN_TSCC) Timestamp Select */ -#define MCAN_TSCC_TSS(value) ((MCAN_TSCC_TSS_Msk & ((value) << MCAN_TSCC_TSS_Pos))) -#define MCAN_TSCC_TSS_ALWAYS_0 (0x0u << 0) /**< \brief (MCAN_TSCC) Timestamp counter value always 0x0000 */ -#define MCAN_TSCC_TSS_TCP_INC (0x1u << 0) /**< \brief (MCAN_TSCC) Timestamp counter value incremented according to TCP */ -#define MCAN_TSCC_TSS_EXT_TIMESTAMP (0x2u << 0) /**< \brief (MCAN_TSCC) External timestamp counter value used */ -#define MCAN_TSCC_TCP_Pos 16 -#define MCAN_TSCC_TCP_Msk (0xfu << MCAN_TSCC_TCP_Pos) /**< \brief (MCAN_TSCC) Timestamp Counter Prescaler */ -#define MCAN_TSCC_TCP(value) ((MCAN_TSCC_TCP_Msk & ((value) << MCAN_TSCC_TCP_Pos))) -/* -------- MCAN_TSCV : (MCAN Offset: 0x24) Timestamp Counter Value Register -------- */ -#define MCAN_TSCV_TSC_Pos 0 -#define MCAN_TSCV_TSC_Msk (0xffffu << MCAN_TSCV_TSC_Pos) /**< \brief (MCAN_TSCV) Timestamp Counter (cleared on write) */ -#define MCAN_TSCV_TSC(value) ((MCAN_TSCV_TSC_Msk & ((value) << MCAN_TSCV_TSC_Pos))) -/* -------- MCAN_TOCC : (MCAN Offset: 0x28) Timeout Counter Configuration Register -------- */ -#define MCAN_TOCC_ETOC (0x1u << 0) /**< \brief (MCAN_TOCC) Enable Timeout Counter */ -#define MCAN_TOCC_ETOC_NO_TIMEOUT (0x0u << 0) /**< \brief (MCAN_TOCC) Timeout Counter disabled. */ -#define MCAN_TOCC_ETOC_TOS_CONTROLLED (0x1u << 0) /**< \brief (MCAN_TOCC) Timeout Counter enabled. */ -#define MCAN_TOCC_TOS_Pos 1 -#define MCAN_TOCC_TOS_Msk (0x3u << MCAN_TOCC_TOS_Pos) /**< \brief (MCAN_TOCC) Timeout Select */ -#define MCAN_TOCC_TOS(value) ((MCAN_TOCC_TOS_Msk & ((value) << MCAN_TOCC_TOS_Pos))) -#define MCAN_TOCC_TOS_CONTINUOUS (0x0u << 1) /**< \brief (MCAN_TOCC) Continuous operation */ -#define MCAN_TOCC_TOS_TX_EV_TIMEOUT (0x1u << 1) /**< \brief (MCAN_TOCC) Timeout controlled by Tx Event FIFO */ -#define MCAN_TOCC_TOS_RX0_EV_TIMEOUT (0x2u << 1) /**< \brief (MCAN_TOCC) Timeout controlled by Receive FIFO 0 */ -#define MCAN_TOCC_TOS_RX1_EV_TIMEOUT (0x3u << 1) /**< \brief (MCAN_TOCC) Timeout controlled by Receive FIFO 1 */ -#define MCAN_TOCC_TOP_Pos 16 -#define MCAN_TOCC_TOP_Msk (0xffffu << MCAN_TOCC_TOP_Pos) /**< \brief (MCAN_TOCC) Timeout Period */ -#define MCAN_TOCC_TOP(value) ((MCAN_TOCC_TOP_Msk & ((value) << MCAN_TOCC_TOP_Pos))) -/* -------- MCAN_TOCV : (MCAN Offset: 0x2C) Timeout Counter Value Register -------- */ -#define MCAN_TOCV_TOC_Pos 0 -#define MCAN_TOCV_TOC_Msk (0xffffu << MCAN_TOCV_TOC_Pos) /**< \brief (MCAN_TOCV) Timeout Counter (cleared on write) */ -#define MCAN_TOCV_TOC(value) ((MCAN_TOCV_TOC_Msk & ((value) << MCAN_TOCV_TOC_Pos))) -/* -------- MCAN_ECR : (MCAN Offset: 0x40) Error Counter Register -------- */ -#define MCAN_ECR_TEC_Pos 0 -#define MCAN_ECR_TEC_Msk (0xffu << MCAN_ECR_TEC_Pos) /**< \brief (MCAN_ECR) Transmit Error Counter */ -#define MCAN_ECR_REC_Pos 8 -#define MCAN_ECR_REC_Msk (0x7fu << MCAN_ECR_REC_Pos) /**< \brief (MCAN_ECR) Receive Error Counter */ -#define MCAN_ECR_RP (0x1u << 15) /**< \brief (MCAN_ECR) Receive Error Passive */ -#define MCAN_ECR_CEL_Pos 16 -#define MCAN_ECR_CEL_Msk (0xffu << MCAN_ECR_CEL_Pos) /**< \brief (MCAN_ECR) CAN Error Logging (cleared on read) */ -/* -------- MCAN_PSR : (MCAN Offset: 0x44) Protocol Status Register -------- */ -#define MCAN_PSR_LEC_Pos 0 -#define MCAN_PSR_LEC_Msk (0x7u << MCAN_PSR_LEC_Pos) /**< \brief (MCAN_PSR) Last Error Code (set to 111 on read) */ -#define MCAN_PSR_LEC_NO_ERROR (0x0u << 0) /**< \brief (MCAN_PSR) No error occurred since LEC has been reset by successful reception or transmission. */ -#define MCAN_PSR_LEC_STUFF_ERROR (0x1u << 0) /**< \brief (MCAN_PSR) More than 5 equal bits in a sequence have occurred in a part of a received meSsage where this is not allowed. */ -#define MCAN_PSR_LEC_FORM_ERROR (0x2u << 0) /**< \brief (MCAN_PSR) A fixed format part of a received frame has the wrong format. */ -#define MCAN_PSR_LEC_ACK_ERROR (0x3u << 0) /**< \brief (MCAN_PSR) The message transmitted by the MCAN was not acknowledged by another node. */ -#define MCAN_PSR_LEC_BIT1_ERROR (0x4u << 0) /**< \brief (MCAN_PSR) During the transmission of a message (with the exception of the arbitration field), the device wanted to send a recessive level (bit of logical value '1'), but the monitored bus value was dominant. */ -#define MCAN_PSR_LEC_BIT0_ERROR (0x5u << 0) /**< \brief (MCAN_PSR) During the transmission of a message (or acknowledge bit, or active error flag, or overload flag), the device wanted to send a dominant level (data or identifier bit logical value '0'), but the monitored bus value was recessive. During Bus_Off recovery this status is set each time a sequence of 11 recessive bits has been monitored. This enables the processor to monitor the proceeding of the Bus_Off recovery sequence (indicating the bus is not stuck at dominant or continuously disturbed). */ -#define MCAN_PSR_LEC_CRC_ERROR (0x6u << 0) /**< \brief (MCAN_PSR) The CRC check sum of a received message was incorrect. The CRC of an incoming message does not match with the CRC calculated from the received data. */ -#define MCAN_PSR_LEC_NO_CHANGE (0x7u << 0) /**< \brief (MCAN_PSR) Any read access to the Protocol Status Register re-initializes the LEC to '7'. When the LEC shows the value '7', no CAN bus event was detected since the last processor read access to the Protocol Status Register. */ -#define MCAN_PSR_ACT_Pos 3 -#define MCAN_PSR_ACT_Msk (0x3u << MCAN_PSR_ACT_Pos) /**< \brief (MCAN_PSR) Activity */ -#define MCAN_PSR_ACT_SYNCHRONIZING (0x0u << 3) /**< \brief (MCAN_PSR) Node is synchronizing on CAN communication */ -#define MCAN_PSR_ACT_IDLE (0x1u << 3) /**< \brief (MCAN_PSR) Node is neither receiver nor transmitter */ -#define MCAN_PSR_ACT_RECEIVER (0x2u << 3) /**< \brief (MCAN_PSR) Node is operating as receiver */ -#define MCAN_PSR_ACT_TRANSMITTER (0x3u << 3) /**< \brief (MCAN_PSR) Node is operating as transmitter */ -#define MCAN_PSR_EP (0x1u << 5) /**< \brief (MCAN_PSR) Error Passive */ -#define MCAN_PSR_EW (0x1u << 6) /**< \brief (MCAN_PSR) Warning Status */ -#define MCAN_PSR_BO (0x1u << 7) /**< \brief (MCAN_PSR) Bus_Off Status */ -#define MCAN_PSR_FLEC_Pos 8 -#define MCAN_PSR_FLEC_Msk (0x7u << MCAN_PSR_FLEC_Pos) /**< \brief (MCAN_PSR) Fast Last Error Code (set to 111 on read) */ -#define MCAN_PSR_RESI (0x1u << 11) /**< \brief (MCAN_PSR) ESI Flag of Last Received CAN FD Message (cleared on read) */ -#define MCAN_PSR_RBRS (0x1u << 12) /**< \brief (MCAN_PSR) BRS Flag of Last Received CAN FD Message (cleared on read) */ -#define MCAN_PSR_REDL (0x1u << 13) /**< \brief (MCAN_PSR) Received a CAN FD Message (cleared on read) */ -/* -------- MCAN_IR : (MCAN Offset: 0x50) Interrupt Register -------- */ -#define MCAN_IR_RF0N (0x1u << 0) /**< \brief (MCAN_IR) Receive FIFO 0 New Message */ -#define MCAN_IR_RF0W (0x1u << 1) /**< \brief (MCAN_IR) Receive FIFO 0 Watermark Reached */ -#define MCAN_IR_RF0F (0x1u << 2) /**< \brief (MCAN_IR) Receive FIFO 0 Full */ -#define MCAN_IR_RF0L (0x1u << 3) /**< \brief (MCAN_IR) Receive FIFO 0 Message Lost */ -#define MCAN_IR_RF1N (0x1u << 4) /**< \brief (MCAN_IR) Receive FIFO 1 New Message */ -#define MCAN_IR_RF1W (0x1u << 5) /**< \brief (MCAN_IR) Receive FIFO 1 Watermark Reached */ -#define MCAN_IR_RF1F (0x1u << 6) /**< \brief (MCAN_IR) Receive FIFO 1 Full */ -#define MCAN_IR_RF1L (0x1u << 7) /**< \brief (MCAN_IR) Receive FIFO 1 Message Lost */ -#define MCAN_IR_HPM (0x1u << 8) /**< \brief (MCAN_IR) High Priority Message */ -#define MCAN_IR_TC (0x1u << 9) /**< \brief (MCAN_IR) Transmission Completed */ -#define MCAN_IR_TCF (0x1u << 10) /**< \brief (MCAN_IR) Transmission Cancellation Finished */ -#define MCAN_IR_TFE (0x1u << 11) /**< \brief (MCAN_IR) Tx FIFO Empty */ -#define MCAN_IR_TEFN (0x1u << 12) /**< \brief (MCAN_IR) Tx Event FIFO New Entry */ -#define MCAN_IR_TEFW (0x1u << 13) /**< \brief (MCAN_IR) Tx Event FIFO Watermark Reached */ -#define MCAN_IR_TEFF (0x1u << 14) /**< \brief (MCAN_IR) Tx Event FIFO Full */ -#define MCAN_IR_TEFL (0x1u << 15) /**< \brief (MCAN_IR) Tx Event FIFO Element Lost */ -#define MCAN_IR_TSW (0x1u << 16) /**< \brief (MCAN_IR) Timestamp Wraparound */ -#define MCAN_IR_MRAF (0x1u << 17) /**< \brief (MCAN_IR) Message RAM Access Failure */ -#define MCAN_IR_TOO (0x1u << 18) /**< \brief (MCAN_IR) Timeout Occurred */ -#define MCAN_IR_DRX (0x1u << 19) /**< \brief (MCAN_IR) Message stored to Dedicated Receive Buffer */ -#define MCAN_IR_ELO (0x1u << 22) /**< \brief (MCAN_IR) Error Logging Overflow */ -#define MCAN_IR_EP (0x1u << 23) /**< \brief (MCAN_IR) Error Passive */ -#define MCAN_IR_EW (0x1u << 24) /**< \brief (MCAN_IR) Warning Status */ -#define MCAN_IR_BO (0x1u << 25) /**< \brief (MCAN_IR) Bus_Off Status */ -#define MCAN_IR_WDI (0x1u << 26) /**< \brief (MCAN_IR) Watchdog Interrupt */ -#define MCAN_IR_CRCE (0x1u << 27) /**< \brief (MCAN_IR) CRC Error */ -#define MCAN_IR_BE (0x1u << 28) /**< \brief (MCAN_IR) Bit Error */ -#define MCAN_IR_ACKE (0x1u << 29) /**< \brief (MCAN_IR) Acknowledge Error */ -#define MCAN_IR_FOE (0x1u << 30) /**< \brief (MCAN_IR) Format Error */ -#define MCAN_IR_STE (0x1u << 31) /**< \brief (MCAN_IR) Stuff Error */ -/* -------- MCAN_IE : (MCAN Offset: 0x54) Interrupt Enable Register -------- */ -#define MCAN_IE_RF0NE (0x1u << 0) /**< \brief (MCAN_IE) Receive FIFO 0 New Message Interrupt Enable */ -#define MCAN_IE_RF0WE (0x1u << 1) /**< \brief (MCAN_IE) Receive FIFO 0 Watermark Reached Interrupt Enable */ -#define MCAN_IE_RF0FE (0x1u << 2) /**< \brief (MCAN_IE) Receive FIFO 0 Full Interrupt Enable */ -#define MCAN_IE_RF0LE (0x1u << 3) /**< \brief (MCAN_IE) Receive FIFO 0 Message Lost Interrupt Enable */ -#define MCAN_IE_RF1NE (0x1u << 4) /**< \brief (MCAN_IE) Receive FIFO 1 New Message Interrupt Enable */ -#define MCAN_IE_RF1WE (0x1u << 5) /**< \brief (MCAN_IE) Receive FIFO 1 Watermark Reached Interrupt Enable */ -#define MCAN_IE_RF1FE (0x1u << 6) /**< \brief (MCAN_IE) Receive FIFO 1 Full Interrupt Enable */ -#define MCAN_IE_RF1LE (0x1u << 7) /**< \brief (MCAN_IE) Receive FIFO 1 Message Lost Interrupt Enable */ -#define MCAN_IE_HPME (0x1u << 8) /**< \brief (MCAN_IE) High Priority Message Interrupt Enable */ -#define MCAN_IE_TCE (0x1u << 9) /**< \brief (MCAN_IE) Transmission Completed Interrupt Enable */ -#define MCAN_IE_TCFE (0x1u << 10) /**< \brief (MCAN_IE) Transmission Cancellation Finished Interrupt Enable */ -#define MCAN_IE_TFEE (0x1u << 11) /**< \brief (MCAN_IE) Tx FIFO Empty Interrupt Enable */ -#define MCAN_IE_TEFNE (0x1u << 12) /**< \brief (MCAN_IE) Tx Event FIFO New Entry Interrupt Enable */ -#define MCAN_IE_TEFWE (0x1u << 13) /**< \brief (MCAN_IE) Tx Event FIFO Watermark Reached Interrupt Enable */ -#define MCAN_IE_TEFFE (0x1u << 14) /**< \brief (MCAN_IE) Tx Event FIFO Full Interrupt Enable */ -#define MCAN_IE_TEFLE (0x1u << 15) /**< \brief (MCAN_IE) Tx Event FIFO Event Lost Interrupt Enable */ -#define MCAN_IE_TSWE (0x1u << 16) /**< \brief (MCAN_IE) Timestamp Wraparound Interrupt Enable */ -#define MCAN_IE_MRAFE (0x1u << 17) /**< \brief (MCAN_IE) Message RAM Access Failure Interrupt Enable */ -#define MCAN_IE_TOOE (0x1u << 18) /**< \brief (MCAN_IE) Timeout Occurred Interrupt Enable */ -#define MCAN_IE_DRXE (0x1u << 19) /**< \brief (MCAN_IE) Message stored to Dedicated Receive Buffer Interrupt Enable */ -#define MCAN_IE_ELOE (0x1u << 22) /**< \brief (MCAN_IE) Error Logging Overflow Interrupt Enable */ -#define MCAN_IE_EPE (0x1u << 23) /**< \brief (MCAN_IE) Error Passive Interrupt Enable */ -#define MCAN_IE_EWE (0x1u << 24) /**< \brief (MCAN_IE) Warning Status Interrupt Enable */ -#define MCAN_IE_BOE (0x1u << 25) /**< \brief (MCAN_IE) Bus_Off Status Interrupt Enable */ -#define MCAN_IE_WDIE (0x1u << 26) /**< \brief (MCAN_IE) Watchdog Interrupt Enable */ -#define MCAN_IE_CRCEE (0x1u << 27) /**< \brief (MCAN_IE) CRC Error Interrupt Enable */ -#define MCAN_IE_BEE (0x1u << 28) /**< \brief (MCAN_IE) Bit Error Interrupt Enable */ -#define MCAN_IE_ACKEE (0x1u << 29) /**< \brief (MCAN_IE) Acknowledge Error Interrupt Enable */ -#define MCAN_IE_FOEE (0x1u << 30) /**< \brief (MCAN_IE) Format Error Interrupt Enable */ -#define MCAN_IE_STEE (0x1u << 31) /**< \brief (MCAN_IE) Stuff Error Interrupt Enable */ -/* -------- MCAN_ILS : (MCAN Offset: 0x58) Interrupt Line Select Register -------- */ -#define MCAN_ILS_RF0NL (0x1u << 0) /**< \brief (MCAN_ILS) Receive FIFO 0 New Message Interrupt Line */ -#define MCAN_ILS_RF0WL (0x1u << 1) /**< \brief (MCAN_ILS) Receive FIFO 0 Watermark Reached Interrupt Line */ -#define MCAN_ILS_RF0FL (0x1u << 2) /**< \brief (MCAN_ILS) Receive FIFO 0 Full Interrupt Line */ -#define MCAN_ILS_RF0LL (0x1u << 3) /**< \brief (MCAN_ILS) Receive FIFO 0 Message Lost Interrupt Line */ -#define MCAN_ILS_RF1NL (0x1u << 4) /**< \brief (MCAN_ILS) Receive FIFO 1 New Message Interrupt Line */ -#define MCAN_ILS_RF1WL (0x1u << 5) /**< \brief (MCAN_ILS) Receive FIFO 1 Watermark Reached Interrupt Line */ -#define MCAN_ILS_RF1FL (0x1u << 6) /**< \brief (MCAN_ILS) Receive FIFO 1 Full Interrupt Line */ -#define MCAN_ILS_RF1LL (0x1u << 7) /**< \brief (MCAN_ILS) Receive FIFO 1 Message Lost Interrupt Line */ -#define MCAN_ILS_HPML (0x1u << 8) /**< \brief (MCAN_ILS) High Priority Message Interrupt Line */ -#define MCAN_ILS_TCL (0x1u << 9) /**< \brief (MCAN_ILS) Transmission Completed Interrupt Line */ -#define MCAN_ILS_TCFL (0x1u << 10) /**< \brief (MCAN_ILS) Transmission Cancellation Finished Interrupt Line */ -#define MCAN_ILS_TFEL (0x1u << 11) /**< \brief (MCAN_ILS) Tx FIFO Empty Interrupt Line */ -#define MCAN_ILS_TEFNL (0x1u << 12) /**< \brief (MCAN_ILS) Tx Event FIFO New Entry Interrupt Line */ -#define MCAN_ILS_TEFWL (0x1u << 13) /**< \brief (MCAN_ILS) Tx Event FIFO Watermark Reached Interrupt Line */ -#define MCAN_ILS_TEFFL (0x1u << 14) /**< \brief (MCAN_ILS) Tx Event FIFO Full Interrupt Line */ -#define MCAN_ILS_TEFLL (0x1u << 15) /**< \brief (MCAN_ILS) Tx Event FIFO Event Lost Interrupt Line */ -#define MCAN_ILS_TSWL (0x1u << 16) /**< \brief (MCAN_ILS) Timestamp Wraparound Interrupt Line */ -#define MCAN_ILS_MRAFL (0x1u << 17) /**< \brief (MCAN_ILS) Message RAM Access Failure Interrupt Line */ -#define MCAN_ILS_TOOL (0x1u << 18) /**< \brief (MCAN_ILS) Timeout Occurred Interrupt Line */ -#define MCAN_ILS_DRXL (0x1u << 19) /**< \brief (MCAN_ILS) Message stored to Dedicated Receive Buffer Interrupt Line */ -#define MCAN_ILS_ELOL (0x1u << 22) /**< \brief (MCAN_ILS) Error Logging Overflow Interrupt Line */ -#define MCAN_ILS_EPL (0x1u << 23) /**< \brief (MCAN_ILS) Error Passive Interrupt Line */ -#define MCAN_ILS_EWL (0x1u << 24) /**< \brief (MCAN_ILS) Warning Status Interrupt Line */ -#define MCAN_ILS_BOL (0x1u << 25) /**< \brief (MCAN_ILS) Bus_Off Status Interrupt Line */ -#define MCAN_ILS_WDIL (0x1u << 26) /**< \brief (MCAN_ILS) Watchdog Interrupt Line */ -#define MCAN_ILS_CRCEL (0x1u << 27) /**< \brief (MCAN_ILS) CRC Error Interrupt Line */ -#define MCAN_ILS_BEL (0x1u << 28) /**< \brief (MCAN_ILS) Bit Error Interrupt Line */ -#define MCAN_ILS_ACKEL (0x1u << 29) /**< \brief (MCAN_ILS) Acknowledge Error Interrupt Line */ -#define MCAN_ILS_FOEL (0x1u << 30) /**< \brief (MCAN_ILS) Format Error Interrupt Line */ -#define MCAN_ILS_STEL (0x1u << 31) /**< \brief (MCAN_ILS) Stuff Error Interrupt Line */ -/* -------- MCAN_ILE : (MCAN Offset: 0x5C) Interrupt Line Enable Register -------- */ -#define MCAN_ILE_EINT0 (0x1u << 0) /**< \brief (MCAN_ILE) Enable Interrupt Line 0 */ -#define MCAN_ILE_EINT1 (0x1u << 1) /**< \brief (MCAN_ILE) Enable Interrupt Line 1 */ -/* -------- MCAN_GFC : (MCAN Offset: 0x80) Global Filter Configuration Register -------- */ -#define MCAN_GFC_RRFE (0x1u << 0) /**< \brief (MCAN_GFC) Reject Remote Frames Extended */ -#define MCAN_GFC_RRFE_FILTER (0x0u << 0) /**< \brief (MCAN_GFC) Filter remote frames with 29-bit extended IDs. */ -#define MCAN_GFC_RRFE_REJECT (0x1u << 0) /**< \brief (MCAN_GFC) Reject all remote frames with 29-bit extended IDs. */ -#define MCAN_GFC_RRFS (0x1u << 1) /**< \brief (MCAN_GFC) Reject Remote Frames Standard */ -#define MCAN_GFC_RRFS_FILTER (0x0u << 1) /**< \brief (MCAN_GFC) Filter remote frames with 11-bit standard IDs. */ -#define MCAN_GFC_RRFS_REJECT (0x1u << 1) /**< \brief (MCAN_GFC) Reject all remote frames with 11-bit standard IDs. */ -#define MCAN_GFC_ANFE_Pos 2 -#define MCAN_GFC_ANFE_Msk (0x3u << MCAN_GFC_ANFE_Pos) /**< \brief (MCAN_GFC) Accept Non-matching Frames Extended */ -#define MCAN_GFC_ANFE(value) ((MCAN_GFC_ANFE_Msk & ((value) << MCAN_GFC_ANFE_Pos))) -#define MCAN_GFC_ANFE_RX_FIFO_0 (0x0u << 2) /**< \brief (MCAN_GFC) Message stored in Receive FIFO 0 */ -#define MCAN_GFC_ANFE_RX_FIFO_1 (0x1u << 2) /**< \brief (MCAN_GFC) Message stored in Receive FIFO 1 */ -#define MCAN_GFC_ANFS_Pos 4 -#define MCAN_GFC_ANFS_Msk (0x3u << MCAN_GFC_ANFS_Pos) /**< \brief (MCAN_GFC) Accept Non-matching Frames Standard */ -#define MCAN_GFC_ANFS(value) ((MCAN_GFC_ANFS_Msk & ((value) << MCAN_GFC_ANFS_Pos))) -#define MCAN_GFC_ANFS_RX_FIFO_0 (0x0u << 4) /**< \brief (MCAN_GFC) Message stored in Receive FIFO 0 */ -#define MCAN_GFC_ANFS_RX_FIFO_1 (0x1u << 4) /**< \brief (MCAN_GFC) Message stored in Receive FIFO 1 */ -/* -------- MCAN_SIDFC : (MCAN Offset: 0x84) Standard ID Filter Configuration Register -------- */ -#define MCAN_SIDFC_FLSSA_Pos 2 -#define MCAN_SIDFC_FLSSA_Msk (0x3fffu << MCAN_SIDFC_FLSSA_Pos) /**< \brief (MCAN_SIDFC) Filter List Standard Start Address */ -#define MCAN_SIDFC_FLSSA(value) ((MCAN_SIDFC_FLSSA_Msk & ((value) << MCAN_SIDFC_FLSSA_Pos))) -#define MCAN_SIDFC_LSS_Pos 16 -#define MCAN_SIDFC_LSS_Msk (0xffu << MCAN_SIDFC_LSS_Pos) /**< \brief (MCAN_SIDFC) List Size Standard */ -#define MCAN_SIDFC_LSS(value) ((MCAN_SIDFC_LSS_Msk & ((value) << MCAN_SIDFC_LSS_Pos))) -/* -------- MCAN_XIDFC : (MCAN Offset: 0x88) Extended ID Filter Configuration Register -------- */ -#define MCAN_XIDFC_FLESA_Pos 2 -#define MCAN_XIDFC_FLESA_Msk (0x3fffu << MCAN_XIDFC_FLESA_Pos) /**< \brief (MCAN_XIDFC) Filter List Extended Start Address */ -#define MCAN_XIDFC_FLESA(value) ((MCAN_XIDFC_FLESA_Msk & ((value) << MCAN_XIDFC_FLESA_Pos))) -#define MCAN_XIDFC_LSE_Pos 16 -#define MCAN_XIDFC_LSE_Msk (0x7fu << MCAN_XIDFC_LSE_Pos) /**< \brief (MCAN_XIDFC) List Size Extended */ -#define MCAN_XIDFC_LSE(value) ((MCAN_XIDFC_LSE_Msk & ((value) << MCAN_XIDFC_LSE_Pos))) -/* -------- MCAN_XIDAM : (MCAN Offset: 0x90) Extended ID AND Mask Register -------- */ -#define MCAN_XIDAM_EIDM_Pos 0 -#define MCAN_XIDAM_EIDM_Msk (0x1fffffffu << MCAN_XIDAM_EIDM_Pos) /**< \brief (MCAN_XIDAM) Extended ID Mask */ -#define MCAN_XIDAM_EIDM(value) ((MCAN_XIDAM_EIDM_Msk & ((value) << MCAN_XIDAM_EIDM_Pos))) -/* -------- MCAN_HPMS : (MCAN Offset: 0x94) High Priority Message Status Register -------- */ -#define MCAN_HPMS_BIDX_Pos 0 -#define MCAN_HPMS_BIDX_Msk (0x3fu << MCAN_HPMS_BIDX_Pos) /**< \brief (MCAN_HPMS) Buffer Index */ -#define MCAN_HPMS_MSI_Pos 6 -#define MCAN_HPMS_MSI_Msk (0x3u << MCAN_HPMS_MSI_Pos) /**< \brief (MCAN_HPMS) Message Storage Indicator */ -#define MCAN_HPMS_MSI_NO_FIFO_SEL (0x0u << 6) /**< \brief (MCAN_HPMS) No FIFO selected. */ -#define MCAN_HPMS_MSI_LOST (0x1u << 6) /**< \brief (MCAN_HPMS) FIFO message. */ -#define MCAN_HPMS_MSI_FIFO_0 (0x2u << 6) /**< \brief (MCAN_HPMS) Message stored in FIFO 0. */ -#define MCAN_HPMS_MSI_FIFO_1 (0x3u << 6) /**< \brief (MCAN_HPMS) Message stored in FIFO 1. */ -#define MCAN_HPMS_FIDX_Pos 8 -#define MCAN_HPMS_FIDX_Msk (0x7fu << MCAN_HPMS_FIDX_Pos) /**< \brief (MCAN_HPMS) Filter Index */ -#define MCAN_HPMS_FLST (0x1u << 15) /**< \brief (MCAN_HPMS) Filter List */ -/* -------- MCAN_NDAT1 : (MCAN Offset: 0x98) New Data 1 Register -------- */ -#define MCAN_NDAT1_ND0 (0x1u << 0) /**< \brief (MCAN_NDAT1) New Data */ -#define MCAN_NDAT1_ND1 (0x1u << 1) /**< \brief (MCAN_NDAT1) New Data */ -#define MCAN_NDAT1_ND2 (0x1u << 2) /**< \brief (MCAN_NDAT1) New Data */ -#define MCAN_NDAT1_ND3 (0x1u << 3) /**< \brief (MCAN_NDAT1) New Data */ -#define MCAN_NDAT1_ND4 (0x1u << 4) /**< \brief (MCAN_NDAT1) New Data */ -#define MCAN_NDAT1_ND5 (0x1u << 5) /**< \brief (MCAN_NDAT1) New Data */ -#define MCAN_NDAT1_ND6 (0x1u << 6) /**< \brief (MCAN_NDAT1) New Data */ -#define MCAN_NDAT1_ND7 (0x1u << 7) /**< \brief (MCAN_NDAT1) New Data */ -#define MCAN_NDAT1_ND8 (0x1u << 8) /**< \brief (MCAN_NDAT1) New Data */ -#define MCAN_NDAT1_ND9 (0x1u << 9) /**< \brief (MCAN_NDAT1) New Data */ -#define MCAN_NDAT1_ND10 (0x1u << 10) /**< \brief (MCAN_NDAT1) New Data */ -#define MCAN_NDAT1_ND11 (0x1u << 11) /**< \brief (MCAN_NDAT1) New Data */ -#define MCAN_NDAT1_ND12 (0x1u << 12) /**< \brief (MCAN_NDAT1) New Data */ -#define MCAN_NDAT1_ND13 (0x1u << 13) /**< \brief (MCAN_NDAT1) New Data */ -#define MCAN_NDAT1_ND14 (0x1u << 14) /**< \brief (MCAN_NDAT1) New Data */ -#define MCAN_NDAT1_ND15 (0x1u << 15) /**< \brief (MCAN_NDAT1) New Data */ -#define MCAN_NDAT1_ND16 (0x1u << 16) /**< \brief (MCAN_NDAT1) New Data */ -#define MCAN_NDAT1_ND17 (0x1u << 17) /**< \brief (MCAN_NDAT1) New Data */ -#define MCAN_NDAT1_ND18 (0x1u << 18) /**< \brief (MCAN_NDAT1) New Data */ -#define MCAN_NDAT1_ND19 (0x1u << 19) /**< \brief (MCAN_NDAT1) New Data */ -#define MCAN_NDAT1_ND20 (0x1u << 20) /**< \brief (MCAN_NDAT1) New Data */ -#define MCAN_NDAT1_ND21 (0x1u << 21) /**< \brief (MCAN_NDAT1) New Data */ -#define MCAN_NDAT1_ND22 (0x1u << 22) /**< \brief (MCAN_NDAT1) New Data */ -#define MCAN_NDAT1_ND23 (0x1u << 23) /**< \brief (MCAN_NDAT1) New Data */ -#define MCAN_NDAT1_ND24 (0x1u << 24) /**< \brief (MCAN_NDAT1) New Data */ -#define MCAN_NDAT1_ND25 (0x1u << 25) /**< \brief (MCAN_NDAT1) New Data */ -#define MCAN_NDAT1_ND26 (0x1u << 26) /**< \brief (MCAN_NDAT1) New Data */ -#define MCAN_NDAT1_ND27 (0x1u << 27) /**< \brief (MCAN_NDAT1) New Data */ -#define MCAN_NDAT1_ND28 (0x1u << 28) /**< \brief (MCAN_NDAT1) New Data */ -#define MCAN_NDAT1_ND29 (0x1u << 29) /**< \brief (MCAN_NDAT1) New Data */ -#define MCAN_NDAT1_ND30 (0x1u << 30) /**< \brief (MCAN_NDAT1) New Data */ -#define MCAN_NDAT1_ND31 (0x1u << 31) /**< \brief (MCAN_NDAT1) New Data */ -/* -------- MCAN_NDAT2 : (MCAN Offset: 0x9C) New Data 2 Register -------- */ -#define MCAN_NDAT2_ND32 (0x1u << 0) /**< \brief (MCAN_NDAT2) New Data */ -#define MCAN_NDAT2_ND33 (0x1u << 1) /**< \brief (MCAN_NDAT2) New Data */ -#define MCAN_NDAT2_ND34 (0x1u << 2) /**< \brief (MCAN_NDAT2) New Data */ -#define MCAN_NDAT2_ND35 (0x1u << 3) /**< \brief (MCAN_NDAT2) New Data */ -#define MCAN_NDAT2_ND36 (0x1u << 4) /**< \brief (MCAN_NDAT2) New Data */ -#define MCAN_NDAT2_ND37 (0x1u << 5) /**< \brief (MCAN_NDAT2) New Data */ -#define MCAN_NDAT2_ND38 (0x1u << 6) /**< \brief (MCAN_NDAT2) New Data */ -#define MCAN_NDAT2_ND39 (0x1u << 7) /**< \brief (MCAN_NDAT2) New Data */ -#define MCAN_NDAT2_ND40 (0x1u << 8) /**< \brief (MCAN_NDAT2) New Data */ -#define MCAN_NDAT2_ND41 (0x1u << 9) /**< \brief (MCAN_NDAT2) New Data */ -#define MCAN_NDAT2_ND42 (0x1u << 10) /**< \brief (MCAN_NDAT2) New Data */ -#define MCAN_NDAT2_ND43 (0x1u << 11) /**< \brief (MCAN_NDAT2) New Data */ -#define MCAN_NDAT2_ND44 (0x1u << 12) /**< \brief (MCAN_NDAT2) New Data */ -#define MCAN_NDAT2_ND45 (0x1u << 13) /**< \brief (MCAN_NDAT2) New Data */ -#define MCAN_NDAT2_ND46 (0x1u << 14) /**< \brief (MCAN_NDAT2) New Data */ -#define MCAN_NDAT2_ND47 (0x1u << 15) /**< \brief (MCAN_NDAT2) New Data */ -#define MCAN_NDAT2_ND48 (0x1u << 16) /**< \brief (MCAN_NDAT2) New Data */ -#define MCAN_NDAT2_ND49 (0x1u << 17) /**< \brief (MCAN_NDAT2) New Data */ -#define MCAN_NDAT2_ND50 (0x1u << 18) /**< \brief (MCAN_NDAT2) New Data */ -#define MCAN_NDAT2_ND51 (0x1u << 19) /**< \brief (MCAN_NDAT2) New Data */ -#define MCAN_NDAT2_ND52 (0x1u << 20) /**< \brief (MCAN_NDAT2) New Data */ -#define MCAN_NDAT2_ND53 (0x1u << 21) /**< \brief (MCAN_NDAT2) New Data */ -#define MCAN_NDAT2_ND54 (0x1u << 22) /**< \brief (MCAN_NDAT2) New Data */ -#define MCAN_NDAT2_ND55 (0x1u << 23) /**< \brief (MCAN_NDAT2) New Data */ -#define MCAN_NDAT2_ND56 (0x1u << 24) /**< \brief (MCAN_NDAT2) New Data */ -#define MCAN_NDAT2_ND57 (0x1u << 25) /**< \brief (MCAN_NDAT2) New Data */ -#define MCAN_NDAT2_ND58 (0x1u << 26) /**< \brief (MCAN_NDAT2) New Data */ -#define MCAN_NDAT2_ND59 (0x1u << 27) /**< \brief (MCAN_NDAT2) New Data */ -#define MCAN_NDAT2_ND60 (0x1u << 28) /**< \brief (MCAN_NDAT2) New Data */ -#define MCAN_NDAT2_ND61 (0x1u << 29) /**< \brief (MCAN_NDAT2) New Data */ -#define MCAN_NDAT2_ND62 (0x1u << 30) /**< \brief (MCAN_NDAT2) New Data */ -#define MCAN_NDAT2_ND63 (0x1u << 31) /**< \brief (MCAN_NDAT2) New Data */ -/* -------- MCAN_RXF0C : (MCAN Offset: 0xA0) Receive FIFO 0 Configuration Register -------- */ -#define MCAN_RXF0C_F0SA_Pos 2 -#define MCAN_RXF0C_F0SA_Msk (0x3fffu << MCAN_RXF0C_F0SA_Pos) /**< \brief (MCAN_RXF0C) Receive FIFO 0 Start Address */ -#define MCAN_RXF0C_F0SA(value) ((MCAN_RXF0C_F0SA_Msk & ((value) << MCAN_RXF0C_F0SA_Pos))) -#define MCAN_RXF0C_F0S_Pos 16 -#define MCAN_RXF0C_F0S_Msk (0x7fu << MCAN_RXF0C_F0S_Pos) /**< \brief (MCAN_RXF0C) Receive FIFO 0 Start Address */ -#define MCAN_RXF0C_F0S(value) ((MCAN_RXF0C_F0S_Msk & ((value) << MCAN_RXF0C_F0S_Pos))) -#define MCAN_RXF0C_F0WM_Pos 24 -#define MCAN_RXF0C_F0WM_Msk (0x7fu << MCAN_RXF0C_F0WM_Pos) /**< \brief (MCAN_RXF0C) Receive FIFO 0 Watermark */ -#define MCAN_RXF0C_F0WM(value) ((MCAN_RXF0C_F0WM_Msk & ((value) << MCAN_RXF0C_F0WM_Pos))) -#define MCAN_RXF0C_F0OM (0x1u << 31) /**< \brief (MCAN_RXF0C) FIFO 0 Operation Mode */ -/* -------- MCAN_RXF0S : (MCAN Offset: 0xA4) Receive FIFO 0 Status Register -------- */ -#define MCAN_RXF0S_F0FL_Pos 0 -#define MCAN_RXF0S_F0FL_Msk (0x7fu << MCAN_RXF0S_F0FL_Pos) /**< \brief (MCAN_RXF0S) Receive FIFO 0 Fill Level */ -#define MCAN_RXF0S_F0GI_Pos 8 -#define MCAN_RXF0S_F0GI_Msk (0x3fu << MCAN_RXF0S_F0GI_Pos) /**< \brief (MCAN_RXF0S) Receive FIFO 0 Get Index */ -#define MCAN_RXF0S_F0PI_Pos 16 -#define MCAN_RXF0S_F0PI_Msk (0x3fu << MCAN_RXF0S_F0PI_Pos) /**< \brief (MCAN_RXF0S) Receive FIFO 0 Put Index */ -#define MCAN_RXF0S_F0F (0x1u << 24) /**< \brief (MCAN_RXF0S) Receive FIFO 0 Fill Level */ -#define MCAN_RXF0S_RF0L (0x1u << 25) /**< \brief (MCAN_RXF0S) Receive FIFO 0 Message Lost */ -/* -------- MCAN_RXF0A : (MCAN Offset: 0xA8) Receive FIFO 0 Acknowledge Register -------- */ -#define MCAN_RXF0A_F0AI_Pos 0 -#define MCAN_RXF0A_F0AI_Msk (0x3fu << MCAN_RXF0A_F0AI_Pos) /**< \brief (MCAN_RXF0A) Receive FIFO 0 Acknowledge Index */ -#define MCAN_RXF0A_F0AI(value) ((MCAN_RXF0A_F0AI_Msk & ((value) << MCAN_RXF0A_F0AI_Pos))) -/* -------- MCAN_RXBC : (MCAN Offset: 0xAC) Receive Rx Buffer Configuration Register -------- */ -#define MCAN_RXBC_RBSA_Pos 2 -#define MCAN_RXBC_RBSA_Msk (0x3fffu << MCAN_RXBC_RBSA_Pos) /**< \brief (MCAN_RXBC) Receive Buffer Start Address */ -#define MCAN_RXBC_RBSA(value) ((MCAN_RXBC_RBSA_Msk & ((value) << MCAN_RXBC_RBSA_Pos))) -/* -------- MCAN_RXF1C : (MCAN Offset: 0xB0) Receive FIFO 1 Configuration Register -------- */ -#define MCAN_RXF1C_F1SA_Pos 2 -#define MCAN_RXF1C_F1SA_Msk (0x3fffu << MCAN_RXF1C_F1SA_Pos) /**< \brief (MCAN_RXF1C) Receive FIFO 1 Start Address */ -#define MCAN_RXF1C_F1SA(value) ((MCAN_RXF1C_F1SA_Msk & ((value) << MCAN_RXF1C_F1SA_Pos))) -#define MCAN_RXF1C_F1S_Pos 16 -#define MCAN_RXF1C_F1S_Msk (0x7fu << MCAN_RXF1C_F1S_Pos) /**< \brief (MCAN_RXF1C) Receive FIFO 1 Start Address */ -#define MCAN_RXF1C_F1S(value) ((MCAN_RXF1C_F1S_Msk & ((value) << MCAN_RXF1C_F1S_Pos))) -#define MCAN_RXF1C_F1WM_Pos 24 -#define MCAN_RXF1C_F1WM_Msk (0x7fu << MCAN_RXF1C_F1WM_Pos) /**< \brief (MCAN_RXF1C) Receive FIFO 1 Watermark */ -#define MCAN_RXF1C_F1WM(value) ((MCAN_RXF1C_F1WM_Msk & ((value) << MCAN_RXF1C_F1WM_Pos))) -#define MCAN_RXF1C_F1OM (0x1u << 31) /**< \brief (MCAN_RXF1C) FIFO 1 Operation Mode */ -/* -------- MCAN_RXF1S : (MCAN Offset: 0xB4) Receive FIFO 1 Status Register -------- */ -#define MCAN_RXF1S_F1FL_Pos 0 -#define MCAN_RXF1S_F1FL_Msk (0x7fu << MCAN_RXF1S_F1FL_Pos) /**< \brief (MCAN_RXF1S) Receive FIFO 1 Fill Level */ -#define MCAN_RXF1S_F1GI_Pos 8 -#define MCAN_RXF1S_F1GI_Msk (0x3fu << MCAN_RXF1S_F1GI_Pos) /**< \brief (MCAN_RXF1S) Receive FIFO 1 Get Index */ -#define MCAN_RXF1S_F1PI_Pos 16 -#define MCAN_RXF1S_F1PI_Msk (0x3fu << MCAN_RXF1S_F1PI_Pos) /**< \brief (MCAN_RXF1S) Receive FIFO 1 Put Index */ -#define MCAN_RXF1S_F1F (0x1u << 24) /**< \brief (MCAN_RXF1S) Receive FIFO 1 Fill Level */ -#define MCAN_RXF1S_RF1L (0x1u << 25) /**< \brief (MCAN_RXF1S) Receive FIFO 1 Message Lost */ -#define MCAN_RXF1S_DMS_Pos 30 -#define MCAN_RXF1S_DMS_Msk (0x3u << MCAN_RXF1S_DMS_Pos) /**< \brief (MCAN_RXF1S) Debug Message Status */ -#define MCAN_RXF1S_DMS_IDLE (0x0u << 30) /**< \brief (MCAN_RXF1S) Idle state, wait for reception of debug messages, DMA request is cleared. */ -#define MCAN_RXF1S_DMS_MSG_A (0x1u << 30) /**< \brief (MCAN_RXF1S) Debug message A received. */ -#define MCAN_RXF1S_DMS_MSG_AB (0x2u << 30) /**< \brief (MCAN_RXF1S) Debug messages A, B received. */ -#define MCAN_RXF1S_DMS_MSG_ABC (0x3u << 30) /**< \brief (MCAN_RXF1S) Debug messages A, B, C received, DMA request is set. */ -/* -------- MCAN_RXF1A : (MCAN Offset: 0xB8) Receive FIFO 1 Acknowledge Register -------- */ -#define MCAN_RXF1A_F1AI_Pos 0 -#define MCAN_RXF1A_F1AI_Msk (0x3fu << MCAN_RXF1A_F1AI_Pos) /**< \brief (MCAN_RXF1A) Receive FIFO 1 Acknowledge Index */ -#define MCAN_RXF1A_F1AI(value) ((MCAN_RXF1A_F1AI_Msk & ((value) << MCAN_RXF1A_F1AI_Pos))) -/* -------- MCAN_RXESC : (MCAN Offset: 0xBC) Receive Buffer / FIFO Element Size Configuration Register -------- */ -#define MCAN_RXESC_F0DS_Pos 0 -#define MCAN_RXESC_F0DS_Msk (0x7u << MCAN_RXESC_F0DS_Pos) /**< \brief (MCAN_RXESC) Receive FIFO 0 Data Field Size */ -#define MCAN_RXESC_F0DS(value) ((MCAN_RXESC_F0DS_Msk & ((value) << MCAN_RXESC_F0DS_Pos))) -#define MCAN_RXESC_F0DS_8_BYTE (0x0u << 0) /**< \brief (MCAN_RXESC) 8 byte data field */ -#define MCAN_RXESC_F0DS_12_BYTE (0x1u << 0) /**< \brief (MCAN_RXESC) 12 byte data field */ -#define MCAN_RXESC_F0DS_16_BYTE (0x2u << 0) /**< \brief (MCAN_RXESC) 16 byte data field */ -#define MCAN_RXESC_F0DS_20_BYTE (0x3u << 0) /**< \brief (MCAN_RXESC) 20 byte data field */ -#define MCAN_RXESC_F0DS_24_BYTE (0x4u << 0) /**< \brief (MCAN_RXESC) 24 byte data field */ -#define MCAN_RXESC_F0DS_32_BYTE (0x5u << 0) /**< \brief (MCAN_RXESC) 32 byte data field */ -#define MCAN_RXESC_F0DS_48_BYTE (0x6u << 0) /**< \brief (MCAN_RXESC) 48 byte data field */ -#define MCAN_RXESC_F0DS_64_BYTE (0x7u << 0) /**< \brief (MCAN_RXESC) 64 byte data field */ -#define MCAN_RXESC_F1DS_Pos 4 -#define MCAN_RXESC_F1DS_Msk (0x7u << MCAN_RXESC_F1DS_Pos) /**< \brief (MCAN_RXESC) Receive FIFO 1 Data Field Size */ -#define MCAN_RXESC_F1DS(value) ((MCAN_RXESC_F1DS_Msk & ((value) << MCAN_RXESC_F1DS_Pos))) -#define MCAN_RXESC_F1DS_8_BYTE (0x0u << 4) /**< \brief (MCAN_RXESC) 8 byte data field */ -#define MCAN_RXESC_F1DS_12_BYTE (0x1u << 4) /**< \brief (MCAN_RXESC) 12 byte data field */ -#define MCAN_RXESC_F1DS_16_BYTE (0x2u << 4) /**< \brief (MCAN_RXESC) 16 byte data field */ -#define MCAN_RXESC_F1DS_20_BYTE (0x3u << 4) /**< \brief (MCAN_RXESC) 20 byte data field */ -#define MCAN_RXESC_F1DS_24_BYTE (0x4u << 4) /**< \brief (MCAN_RXESC) 24 byte data field */ -#define MCAN_RXESC_F1DS_32_BYTE (0x5u << 4) /**< \brief (MCAN_RXESC) 32 byte data field */ -#define MCAN_RXESC_F1DS_48_BYTE (0x6u << 4) /**< \brief (MCAN_RXESC) 48 byte data field */ -#define MCAN_RXESC_F1DS_64_BYTE (0x7u << 4) /**< \brief (MCAN_RXESC) 64 byte data field */ -#define MCAN_RXESC_RBDS_Pos 8 -#define MCAN_RXESC_RBDS_Msk (0x7u << MCAN_RXESC_RBDS_Pos) /**< \brief (MCAN_RXESC) Receive Buffer Data Field Size */ -#define MCAN_RXESC_RBDS(value) ((MCAN_RXESC_RBDS_Msk & ((value) << MCAN_RXESC_RBDS_Pos))) -#define MCAN_RXESC_RBDS_8_BYTE (0x0u << 8) /**< \brief (MCAN_RXESC) 8 byte data field */ -#define MCAN_RXESC_RBDS_12_BYTE (0x1u << 8) /**< \brief (MCAN_RXESC) 12 byte data field */ -#define MCAN_RXESC_RBDS_16_BYTE (0x2u << 8) /**< \brief (MCAN_RXESC) 16 byte data field */ -#define MCAN_RXESC_RBDS_20_BYTE (0x3u << 8) /**< \brief (MCAN_RXESC) 20 byte data field */ -#define MCAN_RXESC_RBDS_24_BYTE (0x4u << 8) /**< \brief (MCAN_RXESC) 24 byte data field */ -#define MCAN_RXESC_RBDS_32_BYTE (0x5u << 8) /**< \brief (MCAN_RXESC) 32 byte data field */ -#define MCAN_RXESC_RBDS_48_BYTE (0x6u << 8) /**< \brief (MCAN_RXESC) 48 byte data field */ -#define MCAN_RXESC_RBDS_64_BYTE (0x7u << 8) /**< \brief (MCAN_RXESC) 64 byte data field */ -/* -------- MCAN_TXBC : (MCAN Offset: 0xC0) Transmit Buffer Configuration Register -------- */ -#define MCAN_TXBC_TBSA_Pos 2 -#define MCAN_TXBC_TBSA_Msk (0x3fffu << MCAN_TXBC_TBSA_Pos) /**< \brief (MCAN_TXBC) Tx Buffers Start Address */ -#define MCAN_TXBC_TBSA(value) ((MCAN_TXBC_TBSA_Msk & ((value) << MCAN_TXBC_TBSA_Pos))) -#define MCAN_TXBC_NDTB_Pos 16 -#define MCAN_TXBC_NDTB_Msk (0x3fu << MCAN_TXBC_NDTB_Pos) /**< \brief (MCAN_TXBC) Number of Dedicated Transmit Buffers */ -#define MCAN_TXBC_NDTB(value) ((MCAN_TXBC_NDTB_Msk & ((value) << MCAN_TXBC_NDTB_Pos))) -#define MCAN_TXBC_TFQS_Pos 24 -#define MCAN_TXBC_TFQS_Msk (0x3fu << MCAN_TXBC_TFQS_Pos) /**< \brief (MCAN_TXBC) Transmit FIFO/Queue Size */ -#define MCAN_TXBC_TFQS(value) ((MCAN_TXBC_TFQS_Msk & ((value) << MCAN_TXBC_TFQS_Pos))) -#define MCAN_TXBC_TFQM (0x1u << 30) /**< \brief (MCAN_TXBC) Tx FIFO/Queue Mode */ -/* -------- MCAN_TXFQS : (MCAN Offset: 0xC4) Transmit FIFO/Queue Status Register -------- */ -#define MCAN_TXFQS_TFFL_Pos 0 -#define MCAN_TXFQS_TFFL_Msk (0x3fu << MCAN_TXFQS_TFFL_Pos) /**< \brief (MCAN_TXFQS) Tx FIFO Free Level */ -#define MCAN_TXFQS_TFGI_Pos 8 -#define MCAN_TXFQS_TFGI_Msk (0x1fu << MCAN_TXFQS_TFGI_Pos) /**< \brief (MCAN_TXFQS) Tx FIFO Get Index */ -#define MCAN_TXFQS_TFQPI_Pos 16 -#define MCAN_TXFQS_TFQPI_Msk (0x1fu << MCAN_TXFQS_TFQPI_Pos) /**< \brief (MCAN_TXFQS) Tx FIFO/Queue Put Index */ -#define MCAN_TXFQS_TFQF (0x1u << 21) /**< \brief (MCAN_TXFQS) Tx FIFO/Queue Full */ -/* -------- MCAN_TXESC : (MCAN Offset: 0xC8) Transmit Buffer Element Size Configuration Register -------- */ -#define MCAN_TXESC_TBDS_Pos 0 -#define MCAN_TXESC_TBDS_Msk (0x7u << MCAN_TXESC_TBDS_Pos) /**< \brief (MCAN_TXESC) Tx Buffer Data Field Size */ -#define MCAN_TXESC_TBDS(value) ((MCAN_TXESC_TBDS_Msk & ((value) << MCAN_TXESC_TBDS_Pos))) -#define MCAN_TXESC_TBDS_8_BYTE (0x0u << 0) /**< \brief (MCAN_TXESC) 8 byte data field */ -#define MCAN_TXESC_TBDS_12_BYTE (0x1u << 0) /**< \brief (MCAN_TXESC) 12 byte data field */ -#define MCAN_TXESC_TBDS_16_BYTE (0x2u << 0) /**< \brief (MCAN_TXESC) 16 byte data field */ -#define MCAN_TXESC_TBDS_20_BYTE (0x3u << 0) /**< \brief (MCAN_TXESC) 20 byte data field */ -#define MCAN_TXESC_TBDS_24_BYTE (0x4u << 0) /**< \brief (MCAN_TXESC) 24 byte data field */ -#define MCAN_TXESC_TBDS_32_BYTE (0x5u << 0) /**< \brief (MCAN_TXESC) 32 byte data field */ -#define MCAN_TXESC_TBDS_48_BYTE (0x6u << 0) /**< \brief (MCAN_TXESC) 48 byte data field */ -#define MCAN_TXESC_TBDS_64_BYTE (0x7u << 0) /**< \brief (MCAN_TXESC) 64 byte data field */ -/* -------- MCAN_TXBRP : (MCAN Offset: 0xCC) Transmit Buffer Request Pending Register -------- */ -#define MCAN_TXBRP_TRP0 (0x1u << 0) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 0 */ -#define MCAN_TXBRP_TRP1 (0x1u << 1) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 1 */ -#define MCAN_TXBRP_TRP2 (0x1u << 2) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 2 */ -#define MCAN_TXBRP_TRP3 (0x1u << 3) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 3 */ -#define MCAN_TXBRP_TRP4 (0x1u << 4) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 4 */ -#define MCAN_TXBRP_TRP5 (0x1u << 5) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 5 */ -#define MCAN_TXBRP_TRP6 (0x1u << 6) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 6 */ -#define MCAN_TXBRP_TRP7 (0x1u << 7) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 7 */ -#define MCAN_TXBRP_TRP8 (0x1u << 8) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 8 */ -#define MCAN_TXBRP_TRP9 (0x1u << 9) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 9 */ -#define MCAN_TXBRP_TRP10 (0x1u << 10) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 10 */ -#define MCAN_TXBRP_TRP11 (0x1u << 11) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 11 */ -#define MCAN_TXBRP_TRP12 (0x1u << 12) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 12 */ -#define MCAN_TXBRP_TRP13 (0x1u << 13) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 13 */ -#define MCAN_TXBRP_TRP14 (0x1u << 14) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 14 */ -#define MCAN_TXBRP_TRP15 (0x1u << 15) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 15 */ -#define MCAN_TXBRP_TRP16 (0x1u << 16) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 16 */ -#define MCAN_TXBRP_TRP17 (0x1u << 17) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 17 */ -#define MCAN_TXBRP_TRP18 (0x1u << 18) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 18 */ -#define MCAN_TXBRP_TRP19 (0x1u << 19) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 19 */ -#define MCAN_TXBRP_TRP20 (0x1u << 20) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 20 */ -#define MCAN_TXBRP_TRP21 (0x1u << 21) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 21 */ -#define MCAN_TXBRP_TRP22 (0x1u << 22) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 22 */ -#define MCAN_TXBRP_TRP23 (0x1u << 23) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 23 */ -#define MCAN_TXBRP_TRP24 (0x1u << 24) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 24 */ -#define MCAN_TXBRP_TRP25 (0x1u << 25) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 25 */ -#define MCAN_TXBRP_TRP26 (0x1u << 26) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 26 */ -#define MCAN_TXBRP_TRP27 (0x1u << 27) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 27 */ -#define MCAN_TXBRP_TRP28 (0x1u << 28) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 28 */ -#define MCAN_TXBRP_TRP29 (0x1u << 29) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 29 */ -#define MCAN_TXBRP_TRP30 (0x1u << 30) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 30 */ -#define MCAN_TXBRP_TRP31 (0x1u << 31) /**< \brief (MCAN_TXBRP) Transmission Request Pending for Buffer 31 */ -/* -------- MCAN_TXBAR : (MCAN Offset: 0xD0) Transmit Buffer Add Request Register -------- */ -#define MCAN_TXBAR_AR0 (0x1u << 0) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 0 */ -#define MCAN_TXBAR_AR1 (0x1u << 1) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 1 */ -#define MCAN_TXBAR_AR2 (0x1u << 2) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 2 */ -#define MCAN_TXBAR_AR3 (0x1u << 3) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 3 */ -#define MCAN_TXBAR_AR4 (0x1u << 4) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 4 */ -#define MCAN_TXBAR_AR5 (0x1u << 5) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 5 */ -#define MCAN_TXBAR_AR6 (0x1u << 6) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 6 */ -#define MCAN_TXBAR_AR7 (0x1u << 7) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 7 */ -#define MCAN_TXBAR_AR8 (0x1u << 8) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 8 */ -#define MCAN_TXBAR_AR9 (0x1u << 9) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 9 */ -#define MCAN_TXBAR_AR10 (0x1u << 10) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 10 */ -#define MCAN_TXBAR_AR11 (0x1u << 11) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 11 */ -#define MCAN_TXBAR_AR12 (0x1u << 12) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 12 */ -#define MCAN_TXBAR_AR13 (0x1u << 13) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 13 */ -#define MCAN_TXBAR_AR14 (0x1u << 14) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 14 */ -#define MCAN_TXBAR_AR15 (0x1u << 15) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 15 */ -#define MCAN_TXBAR_AR16 (0x1u << 16) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 16 */ -#define MCAN_TXBAR_AR17 (0x1u << 17) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 17 */ -#define MCAN_TXBAR_AR18 (0x1u << 18) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 18 */ -#define MCAN_TXBAR_AR19 (0x1u << 19) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 19 */ -#define MCAN_TXBAR_AR20 (0x1u << 20) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 20 */ -#define MCAN_TXBAR_AR21 (0x1u << 21) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 21 */ -#define MCAN_TXBAR_AR22 (0x1u << 22) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 22 */ -#define MCAN_TXBAR_AR23 (0x1u << 23) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 23 */ -#define MCAN_TXBAR_AR24 (0x1u << 24) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 24 */ -#define MCAN_TXBAR_AR25 (0x1u << 25) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 25 */ -#define MCAN_TXBAR_AR26 (0x1u << 26) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 26 */ -#define MCAN_TXBAR_AR27 (0x1u << 27) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 27 */ -#define MCAN_TXBAR_AR28 (0x1u << 28) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 28 */ -#define MCAN_TXBAR_AR29 (0x1u << 29) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 29 */ -#define MCAN_TXBAR_AR30 (0x1u << 30) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 30 */ -#define MCAN_TXBAR_AR31 (0x1u << 31) /**< \brief (MCAN_TXBAR) Add Request for Transmit Buffer 31 */ -/* -------- MCAN_TXBCR : (MCAN Offset: 0xD4) Transmit Buffer Cancellation Request Register -------- */ -#define MCAN_TXBCR_CR0 (0x1u << 0) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 0 */ -#define MCAN_TXBCR_CR1 (0x1u << 1) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 1 */ -#define MCAN_TXBCR_CR2 (0x1u << 2) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 2 */ -#define MCAN_TXBCR_CR3 (0x1u << 3) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 3 */ -#define MCAN_TXBCR_CR4 (0x1u << 4) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 4 */ -#define MCAN_TXBCR_CR5 (0x1u << 5) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 5 */ -#define MCAN_TXBCR_CR6 (0x1u << 6) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 6 */ -#define MCAN_TXBCR_CR7 (0x1u << 7) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 7 */ -#define MCAN_TXBCR_CR8 (0x1u << 8) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 8 */ -#define MCAN_TXBCR_CR9 (0x1u << 9) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 9 */ -#define MCAN_TXBCR_CR10 (0x1u << 10) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 10 */ -#define MCAN_TXBCR_CR11 (0x1u << 11) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 11 */ -#define MCAN_TXBCR_CR12 (0x1u << 12) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 12 */ -#define MCAN_TXBCR_CR13 (0x1u << 13) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 13 */ -#define MCAN_TXBCR_CR14 (0x1u << 14) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 14 */ -#define MCAN_TXBCR_CR15 (0x1u << 15) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 15 */ -#define MCAN_TXBCR_CR16 (0x1u << 16) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 16 */ -#define MCAN_TXBCR_CR17 (0x1u << 17) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 17 */ -#define MCAN_TXBCR_CR18 (0x1u << 18) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 18 */ -#define MCAN_TXBCR_CR19 (0x1u << 19) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 19 */ -#define MCAN_TXBCR_CR20 (0x1u << 20) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 20 */ -#define MCAN_TXBCR_CR21 (0x1u << 21) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 21 */ -#define MCAN_TXBCR_CR22 (0x1u << 22) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 22 */ -#define MCAN_TXBCR_CR23 (0x1u << 23) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 23 */ -#define MCAN_TXBCR_CR24 (0x1u << 24) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 24 */ -#define MCAN_TXBCR_CR25 (0x1u << 25) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 25 */ -#define MCAN_TXBCR_CR26 (0x1u << 26) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 26 */ -#define MCAN_TXBCR_CR27 (0x1u << 27) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 27 */ -#define MCAN_TXBCR_CR28 (0x1u << 28) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 28 */ -#define MCAN_TXBCR_CR29 (0x1u << 29) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 29 */ -#define MCAN_TXBCR_CR30 (0x1u << 30) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 30 */ -#define MCAN_TXBCR_CR31 (0x1u << 31) /**< \brief (MCAN_TXBCR) Cancellation Request for Transmit Buffer 31 */ -/* -------- MCAN_TXBTO : (MCAN Offset: 0xD8) Transmit Buffer Transmission Occurred Register -------- */ -#define MCAN_TXBTO_TO0 (0x1u << 0) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 0 */ -#define MCAN_TXBTO_TO1 (0x1u << 1) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 1 */ -#define MCAN_TXBTO_TO2 (0x1u << 2) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 2 */ -#define MCAN_TXBTO_TO3 (0x1u << 3) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 3 */ -#define MCAN_TXBTO_TO4 (0x1u << 4) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 4 */ -#define MCAN_TXBTO_TO5 (0x1u << 5) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 5 */ -#define MCAN_TXBTO_TO6 (0x1u << 6) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 6 */ -#define MCAN_TXBTO_TO7 (0x1u << 7) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 7 */ -#define MCAN_TXBTO_TO8 (0x1u << 8) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 8 */ -#define MCAN_TXBTO_TO9 (0x1u << 9) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 9 */ -#define MCAN_TXBTO_TO10 (0x1u << 10) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 10 */ -#define MCAN_TXBTO_TO11 (0x1u << 11) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 11 */ -#define MCAN_TXBTO_TO12 (0x1u << 12) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 12 */ -#define MCAN_TXBTO_TO13 (0x1u << 13) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 13 */ -#define MCAN_TXBTO_TO14 (0x1u << 14) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 14 */ -#define MCAN_TXBTO_TO15 (0x1u << 15) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 15 */ -#define MCAN_TXBTO_TO16 (0x1u << 16) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 16 */ -#define MCAN_TXBTO_TO17 (0x1u << 17) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 17 */ -#define MCAN_TXBTO_TO18 (0x1u << 18) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 18 */ -#define MCAN_TXBTO_TO19 (0x1u << 19) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 19 */ -#define MCAN_TXBTO_TO20 (0x1u << 20) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 20 */ -#define MCAN_TXBTO_TO21 (0x1u << 21) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 21 */ -#define MCAN_TXBTO_TO22 (0x1u << 22) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 22 */ -#define MCAN_TXBTO_TO23 (0x1u << 23) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 23 */ -#define MCAN_TXBTO_TO24 (0x1u << 24) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 24 */ -#define MCAN_TXBTO_TO25 (0x1u << 25) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 25 */ -#define MCAN_TXBTO_TO26 (0x1u << 26) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 26 */ -#define MCAN_TXBTO_TO27 (0x1u << 27) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 27 */ -#define MCAN_TXBTO_TO28 (0x1u << 28) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 28 */ -#define MCAN_TXBTO_TO29 (0x1u << 29) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 29 */ -#define MCAN_TXBTO_TO30 (0x1u << 30) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 30 */ -#define MCAN_TXBTO_TO31 (0x1u << 31) /**< \brief (MCAN_TXBTO) Transmission Occurred for Buffer 31 */ -/* -------- MCAN_TXBCF : (MCAN Offset: 0xDC) Transmit Buffer Cancellation Finished Register -------- */ -#define MCAN_TXBCF_CF0 (0x1u << 0) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 0 */ -#define MCAN_TXBCF_CF1 (0x1u << 1) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 1 */ -#define MCAN_TXBCF_CF2 (0x1u << 2) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 2 */ -#define MCAN_TXBCF_CF3 (0x1u << 3) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 3 */ -#define MCAN_TXBCF_CF4 (0x1u << 4) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 4 */ -#define MCAN_TXBCF_CF5 (0x1u << 5) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 5 */ -#define MCAN_TXBCF_CF6 (0x1u << 6) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 6 */ -#define MCAN_TXBCF_CF7 (0x1u << 7) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 7 */ -#define MCAN_TXBCF_CF8 (0x1u << 8) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 8 */ -#define MCAN_TXBCF_CF9 (0x1u << 9) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 9 */ -#define MCAN_TXBCF_CF10 (0x1u << 10) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 10 */ -#define MCAN_TXBCF_CF11 (0x1u << 11) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 11 */ -#define MCAN_TXBCF_CF12 (0x1u << 12) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 12 */ -#define MCAN_TXBCF_CF13 (0x1u << 13) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 13 */ -#define MCAN_TXBCF_CF14 (0x1u << 14) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 14 */ -#define MCAN_TXBCF_CF15 (0x1u << 15) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 15 */ -#define MCAN_TXBCF_CF16 (0x1u << 16) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 16 */ -#define MCAN_TXBCF_CF17 (0x1u << 17) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 17 */ -#define MCAN_TXBCF_CF18 (0x1u << 18) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 18 */ -#define MCAN_TXBCF_CF19 (0x1u << 19) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 19 */ -#define MCAN_TXBCF_CF20 (0x1u << 20) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 20 */ -#define MCAN_TXBCF_CF21 (0x1u << 21) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 21 */ -#define MCAN_TXBCF_CF22 (0x1u << 22) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 22 */ -#define MCAN_TXBCF_CF23 (0x1u << 23) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 23 */ -#define MCAN_TXBCF_CF24 (0x1u << 24) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 24 */ -#define MCAN_TXBCF_CF25 (0x1u << 25) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 25 */ -#define MCAN_TXBCF_CF26 (0x1u << 26) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 26 */ -#define MCAN_TXBCF_CF27 (0x1u << 27) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 27 */ -#define MCAN_TXBCF_CF28 (0x1u << 28) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 28 */ -#define MCAN_TXBCF_CF29 (0x1u << 29) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 29 */ -#define MCAN_TXBCF_CF30 (0x1u << 30) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 30 */ -#define MCAN_TXBCF_CF31 (0x1u << 31) /**< \brief (MCAN_TXBCF) Cancellation Finished for Transmit Buffer 31 */ -/* -------- MCAN_TXBTIE : (MCAN Offset: 0xE0) Transmit Buffer Transmission Interrupt Enable Register -------- */ -#define MCAN_TXBTIE_TIE0 (0x1u << 0) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 0 */ -#define MCAN_TXBTIE_TIE1 (0x1u << 1) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 1 */ -#define MCAN_TXBTIE_TIE2 (0x1u << 2) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 2 */ -#define MCAN_TXBTIE_TIE3 (0x1u << 3) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 3 */ -#define MCAN_TXBTIE_TIE4 (0x1u << 4) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 4 */ -#define MCAN_TXBTIE_TIE5 (0x1u << 5) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 5 */ -#define MCAN_TXBTIE_TIE6 (0x1u << 6) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 6 */ -#define MCAN_TXBTIE_TIE7 (0x1u << 7) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 7 */ -#define MCAN_TXBTIE_TIE8 (0x1u << 8) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 8 */ -#define MCAN_TXBTIE_TIE9 (0x1u << 9) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 9 */ -#define MCAN_TXBTIE_TIE10 (0x1u << 10) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 10 */ -#define MCAN_TXBTIE_TIE11 (0x1u << 11) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 11 */ -#define MCAN_TXBTIE_TIE12 (0x1u << 12) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 12 */ -#define MCAN_TXBTIE_TIE13 (0x1u << 13) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 13 */ -#define MCAN_TXBTIE_TIE14 (0x1u << 14) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 14 */ -#define MCAN_TXBTIE_TIE15 (0x1u << 15) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 15 */ -#define MCAN_TXBTIE_TIE16 (0x1u << 16) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 16 */ -#define MCAN_TXBTIE_TIE17 (0x1u << 17) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 17 */ -#define MCAN_TXBTIE_TIE18 (0x1u << 18) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 18 */ -#define MCAN_TXBTIE_TIE19 (0x1u << 19) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 19 */ -#define MCAN_TXBTIE_TIE20 (0x1u << 20) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 20 */ -#define MCAN_TXBTIE_TIE21 (0x1u << 21) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 21 */ -#define MCAN_TXBTIE_TIE22 (0x1u << 22) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 22 */ -#define MCAN_TXBTIE_TIE23 (0x1u << 23) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 23 */ -#define MCAN_TXBTIE_TIE24 (0x1u << 24) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 24 */ -#define MCAN_TXBTIE_TIE25 (0x1u << 25) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 25 */ -#define MCAN_TXBTIE_TIE26 (0x1u << 26) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 26 */ -#define MCAN_TXBTIE_TIE27 (0x1u << 27) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 27 */ -#define MCAN_TXBTIE_TIE28 (0x1u << 28) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 28 */ -#define MCAN_TXBTIE_TIE29 (0x1u << 29) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 29 */ -#define MCAN_TXBTIE_TIE30 (0x1u << 30) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 30 */ -#define MCAN_TXBTIE_TIE31 (0x1u << 31) /**< \brief (MCAN_TXBTIE) Transmission Interrupt Enable for Buffer 31 */ -/* -------- MCAN_TXBCIE : (MCAN Offset: 0xE4) Transmit Buffer Cancellation Finished Interrupt Enable Register -------- */ -#define MCAN_TXBCIE_CFIE0 (0x1u << 0) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 0 */ -#define MCAN_TXBCIE_CFIE1 (0x1u << 1) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 1 */ -#define MCAN_TXBCIE_CFIE2 (0x1u << 2) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 2 */ -#define MCAN_TXBCIE_CFIE3 (0x1u << 3) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 3 */ -#define MCAN_TXBCIE_CFIE4 (0x1u << 4) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 4 */ -#define MCAN_TXBCIE_CFIE5 (0x1u << 5) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 5 */ -#define MCAN_TXBCIE_CFIE6 (0x1u << 6) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 6 */ -#define MCAN_TXBCIE_CFIE7 (0x1u << 7) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 7 */ -#define MCAN_TXBCIE_CFIE8 (0x1u << 8) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 8 */ -#define MCAN_TXBCIE_CFIE9 (0x1u << 9) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 9 */ -#define MCAN_TXBCIE_CFIE10 (0x1u << 10) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 10 */ -#define MCAN_TXBCIE_CFIE11 (0x1u << 11) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 11 */ -#define MCAN_TXBCIE_CFIE12 (0x1u << 12) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 12 */ -#define MCAN_TXBCIE_CFIE13 (0x1u << 13) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 13 */ -#define MCAN_TXBCIE_CFIE14 (0x1u << 14) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 14 */ -#define MCAN_TXBCIE_CFIE15 (0x1u << 15) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 15 */ -#define MCAN_TXBCIE_CFIE16 (0x1u << 16) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 16 */ -#define MCAN_TXBCIE_CFIE17 (0x1u << 17) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 17 */ -#define MCAN_TXBCIE_CFIE18 (0x1u << 18) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 18 */ -#define MCAN_TXBCIE_CFIE19 (0x1u << 19) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 19 */ -#define MCAN_TXBCIE_CFIE20 (0x1u << 20) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 20 */ -#define MCAN_TXBCIE_CFIE21 (0x1u << 21) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 21 */ -#define MCAN_TXBCIE_CFIE22 (0x1u << 22) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 22 */ -#define MCAN_TXBCIE_CFIE23 (0x1u << 23) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 23 */ -#define MCAN_TXBCIE_CFIE24 (0x1u << 24) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 24 */ -#define MCAN_TXBCIE_CFIE25 (0x1u << 25) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 25 */ -#define MCAN_TXBCIE_CFIE26 (0x1u << 26) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 26 */ -#define MCAN_TXBCIE_CFIE27 (0x1u << 27) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 27 */ -#define MCAN_TXBCIE_CFIE28 (0x1u << 28) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 28 */ -#define MCAN_TXBCIE_CFIE29 (0x1u << 29) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 29 */ -#define MCAN_TXBCIE_CFIE30 (0x1u << 30) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 30 */ -#define MCAN_TXBCIE_CFIE31 (0x1u << 31) /**< \brief (MCAN_TXBCIE) Cancellation Finished Interrupt Enable for Transmit Buffer 31 */ -/* -------- MCAN_TXEFC : (MCAN Offset: 0xF0) Transmit Event FIFO Configuration Register -------- */ -#define MCAN_TXEFC_EFSA_Pos 2 -#define MCAN_TXEFC_EFSA_Msk (0x3fffu << MCAN_TXEFC_EFSA_Pos) /**< \brief (MCAN_TXEFC) Event FIFO Start Address */ -#define MCAN_TXEFC_EFSA(value) ((MCAN_TXEFC_EFSA_Msk & ((value) << MCAN_TXEFC_EFSA_Pos))) -#define MCAN_TXEFC_EFS_Pos 16 -#define MCAN_TXEFC_EFS_Msk (0x3fu << MCAN_TXEFC_EFS_Pos) /**< \brief (MCAN_TXEFC) Event FIFO Size */ -#define MCAN_TXEFC_EFS(value) ((MCAN_TXEFC_EFS_Msk & ((value) << MCAN_TXEFC_EFS_Pos))) -#define MCAN_TXEFC_EFWM_Pos 24 -#define MCAN_TXEFC_EFWM_Msk (0x3fu << MCAN_TXEFC_EFWM_Pos) /**< \brief (MCAN_TXEFC) Event FIFO Watermark */ -#define MCAN_TXEFC_EFWM(value) ((MCAN_TXEFC_EFWM_Msk & ((value) << MCAN_TXEFC_EFWM_Pos))) -/* -------- MCAN_TXEFS : (MCAN Offset: 0xF4) Transmit Event FIFO Status Register -------- */ -#define MCAN_TXEFS_EFFL_Pos 0 -#define MCAN_TXEFS_EFFL_Msk (0x3fu << MCAN_TXEFS_EFFL_Pos) /**< \brief (MCAN_TXEFS) Event FIFO Fill Level */ -#define MCAN_TXEFS_EFGI_Pos 8 -#define MCAN_TXEFS_EFGI_Msk (0x1fu << MCAN_TXEFS_EFGI_Pos) /**< \brief (MCAN_TXEFS) Event FIFO Get Index */ -#define MCAN_TXEFS_EFPI_Pos 16 -#define MCAN_TXEFS_EFPI_Msk (0x1fu << MCAN_TXEFS_EFPI_Pos) /**< \brief (MCAN_TXEFS) Event FIFO Put Index */ -#define MCAN_TXEFS_EFF (0x1u << 24) /**< \brief (MCAN_TXEFS) Event FIFO Full */ -#define MCAN_TXEFS_TEFL (0x1u << 25) /**< \brief (MCAN_TXEFS) Tx Event FIFO Element Lost */ -/* -------- MCAN_TXEFA : (MCAN Offset: 0xF8) Transmit Event FIFO Acknowledge Register -------- */ -#define MCAN_TXEFA_EFAI_Pos 0 -#define MCAN_TXEFA_EFAI_Msk (0x1fu << MCAN_TXEFA_EFAI_Pos) /**< \brief (MCAN_TXEFA) Event FIFO Acknowledge Index */ -#define MCAN_TXEFA_EFAI(value) ((MCAN_TXEFA_EFAI_Msk & ((value) << MCAN_TXEFA_EFAI_Pos))) - -/*@}*/ - - -#endif /* _SAMV71_MCAN_COMPONENT_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_mlb.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_mlb.h deleted file mode 100644 index 2c7b92dd..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_mlb.h +++ /dev/null @@ -1,192 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_MLB_COMPONENT_ -#define _SAMV71_MLB_COMPONENT_ - -/* ============================================================================= */ -/** SOFTWARE API DEFINITION FOR Media LB */ -/* ============================================================================= */ -/** \addtogroup SAMV71_MLB Media LB */ -/*@{*/ - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -/** \brief Mlb hardware registers */ -typedef struct { - __IO uint32_t MLB_MLBC0; /**< \brief (Mlb Offset: 0x000) MediaLB Control 0 Register */ - __I uint32_t Reserved1[2]; - __IO uint32_t MLB_MS0; /**< \brief (Mlb Offset: 0x00C) MediaLB Channel Status 0 Register */ - __I uint32_t Reserved2[1]; - __IO uint32_t MLB_MS1; /**< \brief (Mlb Offset: 0x014) MediaLB Channel Status1 Register */ - __I uint32_t Reserved3[2]; - __IO uint32_t MLB_MSS; /**< \brief (Mlb Offset: 0x020) MediaLB System Status Register */ - __I uint32_t MLB_MSD; /**< \brief (Mlb Offset: 0x024) MediaLB System Data Register */ - __I uint32_t Reserved4[1]; - __IO uint32_t MLB_MIEN; /**< \brief (Mlb Offset: 0x02C) MediaLB Interrupt Enable Register */ - __I uint32_t Reserved5[3]; - __IO uint32_t MLB_MLBC1; /**< \brief (Mlb Offset: 0x03C) MediaLB Control 1 Register */ - __I uint32_t Reserved6[1]; - __I uint32_t Reserved7[15]; - __IO uint32_t MLB_HCTL; /**< \brief (Mlb Offset: 0x080) HBI Control Register */ - __I uint32_t Reserved8[1]; - __IO uint32_t MLB_HCMR[2]; /**< \brief (Mlb Offset: 0x088) HBI Channel Mask 0 Register */ - __I uint32_t MLB_HCER[2]; /**< \brief (Mlb Offset: 0x090) HBI Channel Error 0 Register */ - __I uint32_t MLB_HCBR[2]; /**< \brief (Mlb Offset: 0x098) HBI Channel Busy 0 Register */ - __I uint32_t Reserved9[8]; - __IO uint32_t MLB_MDAT[4]; /**< \brief (Mlb Offset: 0x0C0) MIF Data 0 Register */ - __IO uint32_t MLB_MDWE[4]; /**< \brief (Mlb Offset: 0x0D0) MIF Data Write Enable 0 Register */ - __IO uint32_t MLB_MCTL; /**< \brief (Mlb Offset: 0x0E0) MIF Control Register */ - __IO uint32_t MLB_MADR; /**< \brief (Mlb Offset: 0x0E4) MIF Address Register */ - __I uint32_t Reserved10[182]; - __IO uint32_t MLB_ACTL; /**< \brief (Mlb Offset: 0x3C0) AHB Control Register */ - __I uint32_t Reserved11[3]; - __IO uint32_t MLB_ACSR[2]; /**< \brief (Mlb Offset: 0x3D0) AHB Channel Status 0 Register */ - __IO uint32_t MLB_ACMR[2]; /**< \brief (Mlb Offset: 0x3D8) AHB Channel Mask 0 Register */ -} Mlb; -#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/* -------- MLB_MLBC0 : (MLB Offset: 0x000) MediaLB Control 0 Register -------- */ -#define MLB_MLBC0_MLBEN (0x1u << 0) /**< \brief (MLB_MLBC0) MediaLB Enable */ -#define MLB_MLBC0_MLBCLK_Pos 2 -#define MLB_MLBC0_MLBCLK_Msk (0x7u << MLB_MLBC0_MLBCLK_Pos) /**< \brief (MLB_MLBC0) MLB_CLK (MediaLB clock) speed select */ -#define MLB_MLBC0_MLBCLK(value) ((MLB_MLBC0_MLBCLK_Msk & ((value) << MLB_MLBC0_MLBCLK_Pos))) -#define MLB_MLBC0_MLBCLK_256_FS (0x0u << 2) /**< \brief (MLB_MLBC0) 256xFs (for MLBPEN = 0) */ -#define MLB_MLBC0_MLBCLK_512_FS (0x1u << 2) /**< \brief (MLB_MLBC0) 512xFs (for MLBPEN = 0) */ -#define MLB_MLBC0_MLBCLK_1024_FS (0x2u << 2) /**< \brief (MLB_MLBC0) 1024xFs (for MLBPEN = 0) */ -#define MLB_MLBC0_ZERO (0x1u << 5) /**< \brief (MLB_MLBC0) Must be Written to 0 */ -#define MLB_MLBC0_MLBLK (0x1u << 7) /**< \brief (MLB_MLBC0) MediaLB Lock Status (read-only) */ -#define MLB_MLBC0_ASYRETRY (0x1u << 12) /**< \brief (MLB_MLBC0) Asynchronous Tx Packet Retry */ -#define MLB_MLBC0_CTLRETRY (0x1u << 14) /**< \brief (MLB_MLBC0) Control Tx Packet Retry */ -#define MLB_MLBC0_FCNT_Pos 15 -#define MLB_MLBC0_FCNT_Msk (0x7u << MLB_MLBC0_FCNT_Pos) /**< \brief (MLB_MLBC0) The number of frames per sub-buffer for synchronous channels */ -#define MLB_MLBC0_FCNT(value) ((MLB_MLBC0_FCNT_Msk & ((value) << MLB_MLBC0_FCNT_Pos))) -#define MLB_MLBC0_FCNT_1_FRAME (0x0u << 15) /**< \brief (MLB_MLBC0) 1 frame per sub-buffer (Operation is the same as Standard mode.) */ -#define MLB_MLBC0_FCNT_2_FRAMES (0x1u << 15) /**< \brief (MLB_MLBC0) 2 frames per sub-buffer */ -#define MLB_MLBC0_FCNT_4_FRAMES (0x2u << 15) /**< \brief (MLB_MLBC0) 4 frames per sub-buffer */ -#define MLB_MLBC0_FCNT_8_FRAMES (0x3u << 15) /**< \brief (MLB_MLBC0) 8 frames per sub-buffer */ -#define MLB_MLBC0_FCNT_16_FRAMES (0x4u << 15) /**< \brief (MLB_MLBC0) 16 frames per sub-buffer */ -#define MLB_MLBC0_FCNT_32_FRAMES (0x5u << 15) /**< \brief (MLB_MLBC0) 32 frames per sub-buffer */ -#define MLB_MLBC0_FCNT_64_FRAMES (0x6u << 15) /**< \brief (MLB_MLBC0) 64 frames per sub-buffer */ -/* -------- MLB_MS0 : (MLB Offset: 0x00C) MediaLB Channel Status 0 Register -------- */ -#define MLB_MS0_MCS_Pos 0 -#define MLB_MS0_MCS_Msk (0xffffffffu << MLB_MS0_MCS_Pos) /**< \brief (MLB_MS0) MediaLB Channel Status [31:0] (cleared by writing a 0) */ -#define MLB_MS0_MCS(value) ((MLB_MS0_MCS_Msk & ((value) << MLB_MS0_MCS_Pos))) -/* -------- MLB_MS1 : (MLB Offset: 0x014) MediaLB Channel Status1 Register -------- */ -#define MLB_MS1_MCS_Pos 0 -#define MLB_MS1_MCS_Msk (0xffffffffu << MLB_MS1_MCS_Pos) /**< \brief (MLB_MS1) MediaLB Channel Status [63:32] (cleared by writing a 0) */ -#define MLB_MS1_MCS(value) ((MLB_MS1_MCS_Msk & ((value) << MLB_MS1_MCS_Pos))) -/* -------- MLB_MSS : (MLB Offset: 0x020) MediaLB System Status Register -------- */ -#define MLB_MSS_RSTSYSCMD (0x1u << 0) /**< \brief (MLB_MSS) Reset System Command Detected in the System Quadlet (cleared by writing a 0) */ -#define MLB_MSS_LKSYSCMD (0x1u << 1) /**< \brief (MLB_MSS) Network Lock System Command Detected in the System Quadlet (cleared by writing a 0) */ -#define MLB_MSS_ULKSYSCMD (0x1u << 2) /**< \brief (MLB_MSS) Network Unlock System Command Detected in the System Quadlet (cleared by writing a 0) */ -#define MLB_MSS_CSSYSCMD (0x1u << 3) /**< \brief (MLB_MSS) Channel Scan System Command Detected in the System Quadlet (cleared by writing a 0) */ -#define MLB_MSS_SWSYSCMD (0x1u << 4) /**< \brief (MLB_MSS) Software System Command Detected in the System Quadlet (cleared by writing a 0) */ -#define MLB_MSS_SERVREQ (0x1u << 5) /**< \brief (MLB_MSS) Service Request Enabled */ -/* -------- MLB_MSD : (MLB Offset: 0x024) MediaLB System Data Register -------- */ -#define MLB_MSD_SD0_Pos 0 -#define MLB_MSD_SD0_Msk (0xffu << MLB_MSD_SD0_Pos) /**< \brief (MLB_MSD) System Data (Byte 0) */ -#define MLB_MSD_SD1_Pos 8 -#define MLB_MSD_SD1_Msk (0xffu << MLB_MSD_SD1_Pos) /**< \brief (MLB_MSD) System Data (Byte 1) */ -#define MLB_MSD_SD2_Pos 16 -#define MLB_MSD_SD2_Msk (0xffu << MLB_MSD_SD2_Pos) /**< \brief (MLB_MSD) System Data (Byte 2) */ -#define MLB_MSD_SD3_Pos 24 -#define MLB_MSD_SD3_Msk (0xffu << MLB_MSD_SD3_Pos) /**< \brief (MLB_MSD) System Data (Byte 3) */ -/* -------- MLB_MIEN : (MLB Offset: 0x02C) MediaLB Interrupt Enable Register -------- */ -#define MLB_MIEN_ISOC_PE (0x1u << 0) /**< \brief (MLB_MIEN) Isochronous Rx Protocol Error Enable */ -#define MLB_MIEN_ISOC_BUFO (0x1u << 1) /**< \brief (MLB_MIEN) Isochronous Rx Buffer Overflow Enable */ -#define MLB_MIEN_SYNC_PE (0x1u << 16) /**< \brief (MLB_MIEN) Synchronous Protocol Error Enable */ -#define MLB_MIEN_ARX_DONE (0x1u << 17) /**< \brief (MLB_MIEN) Asynchronous Rx Done Enable */ -#define MLB_MIEN_ARX_PE (0x1u << 18) /**< \brief (MLB_MIEN) Asynchronous Rx Protocol Error Enable */ -#define MLB_MIEN_ARX_BREAK (0x1u << 19) /**< \brief (MLB_MIEN) Asynchronous Rx Break Enable */ -#define MLB_MIEN_ATX_DONE (0x1u << 20) /**< \brief (MLB_MIEN) Asynchronous Tx Packet Done Enable */ -#define MLB_MIEN_ATX_PE (0x1u << 21) /**< \brief (MLB_MIEN) Asynchronous Tx Protocol Error Enable */ -#define MLB_MIEN_ATX_BREAK (0x1u << 22) /**< \brief (MLB_MIEN) Asynchronous Tx Break Enable */ -#define MLB_MIEN_CRX_DONE (0x1u << 24) /**< \brief (MLB_MIEN) Control Rx Packet Done Enable */ -#define MLB_MIEN_CRX_PE (0x1u << 25) /**< \brief (MLB_MIEN) Control Rx Protocol Error Enable */ -#define MLB_MIEN_CRX_BREAK (0x1u << 26) /**< \brief (MLB_MIEN) Control Rx Break Enable */ -#define MLB_MIEN_CTX_DONE (0x1u << 27) /**< \brief (MLB_MIEN) Control Tx Packet Done Enable */ -#define MLB_MIEN_CTX_PE (0x1u << 28) /**< \brief (MLB_MIEN) Control Tx Protocol Error Enable */ -#define MLB_MIEN_CTX_BREAK (0x1u << 29) /**< \brief (MLB_MIEN) Control Tx Break Enable */ -/* -------- MLB_MLBC1 : (MLB Offset: 0x03C) MediaLB Control 1 Register -------- */ -#define MLB_MLBC1_LOCK (0x1u << 6) /**< \brief (MLB_MLBC1) MediaLB Lock Error Status (cleared by writing a 0) */ -#define MLB_MLBC1_CLKM (0x1u << 7) /**< \brief (MLB_MLBC1) MediaLB Clock Missing Status (cleared by writing a 0) */ -#define MLB_MLBC1_NDA_Pos 8 -#define MLB_MLBC1_NDA_Msk (0xffu << MLB_MLBC1_NDA_Pos) /**< \brief (MLB_MLBC1) Node Device Address */ -#define MLB_MLBC1_NDA(value) ((MLB_MLBC1_NDA_Msk & ((value) << MLB_MLBC1_NDA_Pos))) -/* -------- MLB_HCTL : (MLB Offset: 0x080) HBI Control Register -------- */ -#define MLB_HCTL_RST0 (0x1u << 0) /**< \brief (MLB_HCTL) Address Generation Unit 0 Software Reset */ -#define MLB_HCTL_RST1 (0x1u << 1) /**< \brief (MLB_HCTL) Address Generation Unit 1 Software Reset */ -#define MLB_HCTL_EN (0x1u << 15) /**< \brief (MLB_HCTL) HBI Enable */ -/* -------- MLB_HCMR[2] : (MLB Offset: 0x088) HBI Channel Mask 0 Register -------- */ -#define MLB_HCMR_CHM_Pos 0 -#define MLB_HCMR_CHM_Msk (0xffffffffu << MLB_HCMR_CHM_Pos) /**< \brief (MLB_HCMR[2]) Bitwise Channel Mask Bit [31:0] */ -#define MLB_HCMR_CHM(value) ((MLB_HCMR_CHM_Msk & ((value) << MLB_HCMR_CHM_Pos))) -/* -------- MLB_HCER[2] : (MLB Offset: 0x090) HBI Channel Error 0 Register -------- */ -#define MLB_HCER_CERR_Pos 0 -#define MLB_HCER_CERR_Msk (0xffffffffu << MLB_HCER_CERR_Pos) /**< \brief (MLB_HCER[2]) Bitwise Channel Error Bit [31:0] */ -/* -------- MLB_HCBR[2] : (MLB Offset: 0x098) HBI Channel Busy 0 Register -------- */ -#define MLB_HCBR_CHB_Pos 0 -#define MLB_HCBR_CHB_Msk (0xffffffffu << MLB_HCBR_CHB_Pos) /**< \brief (MLB_HCBR[2]) Bitwise Channel Busy Bit [31:0] */ -/* -------- MLB_MDAT[4] : (MLB Offset: 0x0C0) MIF Data 0 Register -------- */ -#define MLB_MDAT_DATA_Pos 0 -#define MLB_MDAT_DATA_Msk (0xffffffffu << MLB_MDAT_DATA_Pos) /**< \brief (MLB_MDAT[4]) CRT or DBR Data */ -#define MLB_MDAT_DATA(value) ((MLB_MDAT_DATA_Msk & ((value) << MLB_MDAT_DATA_Pos))) -/* -------- MLB_MDWE[4] : (MLB Offset: 0x0D0) MIF Data Write Enable 0 Register -------- */ -#define MLB_MDWE_MASK_Pos 0 -#define MLB_MDWE_MASK_Msk (0xffffffffu << MLB_MDWE_MASK_Pos) /**< \brief (MLB_MDWE[4]) Bitwise write enable for CTR data - bits[31:0] */ -#define MLB_MDWE_MASK(value) ((MLB_MDWE_MASK_Msk & ((value) << MLB_MDWE_MASK_Pos))) -/* -------- MLB_MCTL : (MLB Offset: 0x0E0) MIF Control Register -------- */ -#define MLB_MCTL_XCMP (0x1u << 0) /**< \brief (MLB_MCTL) Transfer Complete (Write 0 to Clear) */ -/* -------- MLB_MADR : (MLB Offset: 0x0E4) MIF Address Register -------- */ -#define MLB_MADR_ADDR_Pos 0 -#define MLB_MADR_ADDR_Msk (0x3fffu << MLB_MADR_ADDR_Pos) /**< \brief (MLB_MADR) CTR or DBR Address */ -#define MLB_MADR_ADDR(value) ((MLB_MADR_ADDR_Msk & ((value) << MLB_MADR_ADDR_Pos))) -#define MLB_MADR_TB (0x1u << 30) /**< \brief (MLB_MADR) Target Location Bit */ -#define MLB_MADR_TB_CTR (0x0u << 30) /**< \brief (MLB_MADR) Selects CTR */ -#define MLB_MADR_TB_DBR (0x1u << 30) /**< \brief (MLB_MADR) Selects DBR */ -#define MLB_MADR_WNR (0x1u << 31) /**< \brief (MLB_MADR) Write-Not-Read Selection */ -/* -------- MLB_ACTL : (MLB Offset: 0x3C0) AHB Control Register -------- */ -#define MLB_ACTL_SCE (0x1u << 0) /**< \brief (MLB_ACTL) Software Clear Enable */ -#define MLB_ACTL_SMX (0x1u << 1) /**< \brief (MLB_ACTL) AHB Interrupt Mux Enable */ -#define MLB_ACTL_DMA_MODE (0x1u << 2) /**< \brief (MLB_ACTL) DMA Mode */ -#define MLB_ACTL_MPB (0x1u << 4) /**< \brief (MLB_ACTL) DMA Packet Buffering Mode */ -#define MLB_ACTL_MPB_SINGLE_PACKET (0x0u << 4) /**< \brief (MLB_ACTL) Single-packet mode */ -#define MLB_ACTL_MPB_MULTIPLE_PACKET (0x1u << 4) /**< \brief (MLB_ACTL) Multiple-packet mode */ -/* -------- MLB_ACSR[2] : (MLB Offset: 0x3D0) AHB Channel Status 0 Register -------- */ -#define MLB_ACSR_CHS_Pos 0 -#define MLB_ACSR_CHS_Msk (0xffffffffu << MLB_ACSR_CHS_Pos) /**< \brief (MLB_ACSR[2]) Interrupt Status for Logical Channels [31:0] (cleared by writing a 1) */ -#define MLB_ACSR_CHS(value) ((MLB_ACSR_CHS_Msk & ((value) << MLB_ACSR_CHS_Pos))) -/* -------- MLB_ACMR[2] : (MLB Offset: 0x3D8) AHB Channel Mask 0 Register -------- */ -#define MLB_ACMR_CHM_Pos 0 -#define MLB_ACMR_CHM_Msk (0xffffffffu << MLB_ACMR_CHM_Pos) /**< \brief (MLB_ACMR[2]) Bitwise Channel Mask Bits 31 to 0 */ -#define MLB_ACMR_CHM(value) ((MLB_ACMR_CHM_Msk & ((value) << MLB_ACMR_CHM_Pos))) - -/*@}*/ - - -#endif /* _SAMV71_MLB_COMPONENT_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_pio.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_pio.h deleted file mode 100644 index 0fa6802f..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_pio.h +++ /dev/null @@ -1,1785 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_PIO_COMPONENT_ -#define _SAMV71_PIO_COMPONENT_ - -/* ============================================================================= */ -/** SOFTWARE API DEFINITION FOR Parallel Input/Output Controller */ -/* ============================================================================= */ -/** \addtogroup SAMV71_PIO Parallel Input/Output Controller */ -/*@{*/ - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -/** \brief Pio hardware registers */ -typedef struct { - __O uint32_t PIO_PER; /**< \brief (Pio Offset: 0x0000) PIO Enable Register */ - __O uint32_t PIO_PDR; /**< \brief (Pio Offset: 0x0004) PIO Disable Register */ - __I uint32_t PIO_PSR; /**< \brief (Pio Offset: 0x0008) PIO Status Register */ - __I uint32_t Reserved1[1]; - __O uint32_t PIO_OER; /**< \brief (Pio Offset: 0x0010) Output Enable Register */ - __O uint32_t PIO_ODR; /**< \brief (Pio Offset: 0x0014) Output Disable Register */ - __I uint32_t PIO_OSR; /**< \brief (Pio Offset: 0x0018) Output Status Register */ - __I uint32_t Reserved2[1]; - __O uint32_t PIO_IFER; /**< \brief (Pio Offset: 0x0020) Glitch Input Filter Enable Register */ - __O uint32_t PIO_IFDR; /**< \brief (Pio Offset: 0x0024) Glitch Input Filter Disable Register */ - __I uint32_t PIO_IFSR; /**< \brief (Pio Offset: 0x0028) Glitch Input Filter Status Register */ - __I uint32_t Reserved3[1]; - __O uint32_t PIO_SODR; /**< \brief (Pio Offset: 0x0030) Set Output Data Register */ - __O uint32_t PIO_CODR; /**< \brief (Pio Offset: 0x0034) Clear Output Data Register */ - __IO uint32_t PIO_ODSR; /**< \brief (Pio Offset: 0x0038) Output Data Status Register */ - __I uint32_t PIO_PDSR; /**< \brief (Pio Offset: 0x003C) Pin Data Status Register */ - __O uint32_t PIO_IER; /**< \brief (Pio Offset: 0x0040) Interrupt Enable Register */ - __O uint32_t PIO_IDR; /**< \brief (Pio Offset: 0x0044) Interrupt Disable Register */ - __I uint32_t PIO_IMR; /**< \brief (Pio Offset: 0x0048) Interrupt Mask Register */ - __I uint32_t PIO_ISR; /**< \brief (Pio Offset: 0x004C) Interrupt Status Register */ - __O uint32_t PIO_MDER; /**< \brief (Pio Offset: 0x0050) Multi-driver Enable Register */ - __O uint32_t PIO_MDDR; /**< \brief (Pio Offset: 0x0054) Multi-driver Disable Register */ - __I uint32_t PIO_MDSR; /**< \brief (Pio Offset: 0x0058) Multi-driver Status Register */ - __I uint32_t Reserved4[1]; - __O uint32_t PIO_PUDR; /**< \brief (Pio Offset: 0x0060) Pull-up Disable Register */ - __O uint32_t PIO_PUER; /**< \brief (Pio Offset: 0x0064) Pull-up Enable Register */ - __I uint32_t PIO_PUSR; /**< \brief (Pio Offset: 0x0068) Pad Pull-up Status Register */ - __I uint32_t Reserved5[1]; - __IO uint32_t PIO_ABCDSR[2]; /**< \brief (Pio Offset: 0x0070) Peripheral Select Register */ - __I uint32_t Reserved6[2]; - __O uint32_t PIO_IFSCDR; /**< \brief (Pio Offset: 0x0080) Input Filter Slow Clock Disable Register */ - __O uint32_t PIO_IFSCER; /**< \brief (Pio Offset: 0x0084) Input Filter Slow Clock Enable Register */ - __I uint32_t PIO_IFSCSR; /**< \brief (Pio Offset: 0x0088) Input Filter Slow Clock Status Register */ - __IO uint32_t PIO_SCDR; /**< \brief (Pio Offset: 0x008C) Slow Clock Divider Debouncing Register */ - __O uint32_t PIO_PPDDR; /**< \brief (Pio Offset: 0x0090) Pad Pull-down Disable Register */ - __O uint32_t PIO_PPDER; /**< \brief (Pio Offset: 0x0094) Pad Pull-down Enable Register */ - __I uint32_t PIO_PPDSR; /**< \brief (Pio Offset: 0x0098) Pad Pull-down Status Register */ - __I uint32_t Reserved7[1]; - __O uint32_t PIO_OWER; /**< \brief (Pio Offset: 0x00A0) Output Write Enable */ - __O uint32_t PIO_OWDR; /**< \brief (Pio Offset: 0x00A4) Output Write Disable */ - __I uint32_t PIO_OWSR; /**< \brief (Pio Offset: 0x00A8) Output Write Status Register */ - __I uint32_t Reserved8[1]; - __O uint32_t PIO_AIMER; /**< \brief (Pio Offset: 0x00B0) Additional Interrupt Modes Enable Register */ - __O uint32_t PIO_AIMDR; /**< \brief (Pio Offset: 0x00B4) Additional Interrupt Modes Disable Register */ - __I uint32_t PIO_AIMMR; /**< \brief (Pio Offset: 0x00B8) Additional Interrupt Modes Mask Register */ - __I uint32_t Reserved9[1]; - __O uint32_t PIO_ESR; /**< \brief (Pio Offset: 0x00C0) Edge Select Register */ - __O uint32_t PIO_LSR; /**< \brief (Pio Offset: 0x00C4) Level Select Register */ - __I uint32_t PIO_ELSR; /**< \brief (Pio Offset: 0x00C8) Edge/Level Status Register */ - __I uint32_t Reserved10[1]; - __O uint32_t PIO_FELLSR; /**< \brief (Pio Offset: 0x00D0) Falling Edge/Low-Level Select Register */ - __O uint32_t PIO_REHLSR; /**< \brief (Pio Offset: 0x00D4) Rising Edge/High-Level Select Register */ - __I uint32_t PIO_FRLHSR; /**< \brief (Pio Offset: 0x00D8) Fall/Rise - Low/High Status Register */ - __I uint32_t Reserved11[1]; - __I uint32_t PIO_LOCKSR; /**< \brief (Pio Offset: 0x00E0) Lock Status */ - __IO uint32_t PIO_WPMR; /**< \brief (Pio Offset: 0x00E4) Write Protection Mode Register */ - __I uint32_t PIO_WPSR; /**< \brief (Pio Offset: 0x00E8) Write Protection Status Register */ - __I uint32_t Reserved12[5]; - __IO uint32_t PIO_SCHMITT; /**< \brief (Pio Offset: 0x0100) Schmitt Trigger Register */ - __I uint32_t Reserved13[5]; - __IO uint32_t PIO_DRIVER; /**< \brief (Pio Offset: 0x0118) I/O Drive Register */ - __I uint32_t Reserved14[1]; - __IO uint32_t PIO_KER; /**< \brief (Pio Offset: 0x0120) Keypad Controller Enable Register */ - __IO uint32_t PIO_KRCR; /**< \brief (Pio Offset: 0x0124) Keypad Controller Row Column Register */ - __IO uint32_t PIO_KDR; /**< \brief (Pio Offset: 0x0128) Keypad Controller Debouncing Register */ - __I uint32_t Reserved15[1]; - __O uint32_t PIO_KIER; /**< \brief (Pio Offset: 0x0130) Keypad Controller Interrupt Enable Register */ - __O uint32_t PIO_KIDR; /**< \brief (Pio Offset: 0x0134) Keypad Controller Interrupt Disable Register */ - __I uint32_t PIO_KIMR; /**< \brief (Pio Offset: 0x0138) Keypad Controller Interrupt Mask Register */ - __I uint32_t PIO_KSR; /**< \brief (Pio Offset: 0x013C) Keypad Controller Status Register */ - __I uint32_t PIO_KKPR; /**< \brief (Pio Offset: 0x0140) Keypad Controller Key Press Register */ - __I uint32_t PIO_KKRR; /**< \brief (Pio Offset: 0x0144) Keypad Controller Key Release Register */ - __I uint32_t Reserved16[2]; - __IO uint32_t PIO_PCMR; /**< \brief (Pio Offset: 0x0150) Parallel Capture Mode Register */ - __O uint32_t PIO_PCIER; /**< \brief (Pio Offset: 0x0154) Parallel Capture Interrupt Enable Register */ - __O uint32_t PIO_PCIDR; /**< \brief (Pio Offset: 0x0158) Parallel Capture Interrupt Disable Register */ - __I uint32_t PIO_PCIMR; /**< \brief (Pio Offset: 0x015C) Parallel Capture Interrupt Mask Register */ - __I uint32_t PIO_PCISR; /**< \brief (Pio Offset: 0x0160) Parallel Capture Interrupt Status Register */ - __I uint32_t PIO_PCRHR; /**< \brief (Pio Offset: 0x0164) Parallel Capture Reception Holding Register */ -} Pio; -#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/* -------- PIO_PER : (PIO Offset: 0x0000) PIO Enable Register -------- */ -#define PIO_PER_P0 (0x1u << 0) /**< \brief (PIO_PER) PIO Enable */ -#define PIO_PER_P1 (0x1u << 1) /**< \brief (PIO_PER) PIO Enable */ -#define PIO_PER_P2 (0x1u << 2) /**< \brief (PIO_PER) PIO Enable */ -#define PIO_PER_P3 (0x1u << 3) /**< \brief (PIO_PER) PIO Enable */ -#define PIO_PER_P4 (0x1u << 4) /**< \brief (PIO_PER) PIO Enable */ -#define PIO_PER_P5 (0x1u << 5) /**< \brief (PIO_PER) PIO Enable */ -#define PIO_PER_P6 (0x1u << 6) /**< \brief (PIO_PER) PIO Enable */ -#define PIO_PER_P7 (0x1u << 7) /**< \brief (PIO_PER) PIO Enable */ -#define PIO_PER_P8 (0x1u << 8) /**< \brief (PIO_PER) PIO Enable */ -#define PIO_PER_P9 (0x1u << 9) /**< \brief (PIO_PER) PIO Enable */ -#define PIO_PER_P10 (0x1u << 10) /**< \brief (PIO_PER) PIO Enable */ -#define PIO_PER_P11 (0x1u << 11) /**< \brief (PIO_PER) PIO Enable */ -#define PIO_PER_P12 (0x1u << 12) /**< \brief (PIO_PER) PIO Enable */ -#define PIO_PER_P13 (0x1u << 13) /**< \brief (PIO_PER) PIO Enable */ -#define PIO_PER_P14 (0x1u << 14) /**< \brief (PIO_PER) PIO Enable */ -#define PIO_PER_P15 (0x1u << 15) /**< \brief (PIO_PER) PIO Enable */ -#define PIO_PER_P16 (0x1u << 16) /**< \brief (PIO_PER) PIO Enable */ -#define PIO_PER_P17 (0x1u << 17) /**< \brief (PIO_PER) PIO Enable */ -#define PIO_PER_P18 (0x1u << 18) /**< \brief (PIO_PER) PIO Enable */ -#define PIO_PER_P19 (0x1u << 19) /**< \brief (PIO_PER) PIO Enable */ -#define PIO_PER_P20 (0x1u << 20) /**< \brief (PIO_PER) PIO Enable */ -#define PIO_PER_P21 (0x1u << 21) /**< \brief (PIO_PER) PIO Enable */ -#define PIO_PER_P22 (0x1u << 22) /**< \brief (PIO_PER) PIO Enable */ -#define PIO_PER_P23 (0x1u << 23) /**< \brief (PIO_PER) PIO Enable */ -#define PIO_PER_P24 (0x1u << 24) /**< \brief (PIO_PER) PIO Enable */ -#define PIO_PER_P25 (0x1u << 25) /**< \brief (PIO_PER) PIO Enable */ -#define PIO_PER_P26 (0x1u << 26) /**< \brief (PIO_PER) PIO Enable */ -#define PIO_PER_P27 (0x1u << 27) /**< \brief (PIO_PER) PIO Enable */ -#define PIO_PER_P28 (0x1u << 28) /**< \brief (PIO_PER) PIO Enable */ -#define PIO_PER_P29 (0x1u << 29) /**< \brief (PIO_PER) PIO Enable */ -#define PIO_PER_P30 (0x1u << 30) /**< \brief (PIO_PER) PIO Enable */ -#define PIO_PER_P31 (0x1u << 31) /**< \brief (PIO_PER) PIO Enable */ -/* -------- PIO_PDR : (PIO Offset: 0x0004) PIO Disable Register -------- */ -#define PIO_PDR_P0 (0x1u << 0) /**< \brief (PIO_PDR) PIO Disable */ -#define PIO_PDR_P1 (0x1u << 1) /**< \brief (PIO_PDR) PIO Disable */ -#define PIO_PDR_P2 (0x1u << 2) /**< \brief (PIO_PDR) PIO Disable */ -#define PIO_PDR_P3 (0x1u << 3) /**< \brief (PIO_PDR) PIO Disable */ -#define PIO_PDR_P4 (0x1u << 4) /**< \brief (PIO_PDR) PIO Disable */ -#define PIO_PDR_P5 (0x1u << 5) /**< \brief (PIO_PDR) PIO Disable */ -#define PIO_PDR_P6 (0x1u << 6) /**< \brief (PIO_PDR) PIO Disable */ -#define PIO_PDR_P7 (0x1u << 7) /**< \brief (PIO_PDR) PIO Disable */ -#define PIO_PDR_P8 (0x1u << 8) /**< \brief (PIO_PDR) PIO Disable */ -#define PIO_PDR_P9 (0x1u << 9) /**< \brief (PIO_PDR) PIO Disable */ -#define PIO_PDR_P10 (0x1u << 10) /**< \brief (PIO_PDR) PIO Disable */ -#define PIO_PDR_P11 (0x1u << 11) /**< \brief (PIO_PDR) PIO Disable */ -#define PIO_PDR_P12 (0x1u << 12) /**< \brief (PIO_PDR) PIO Disable */ -#define PIO_PDR_P13 (0x1u << 13) /**< \brief (PIO_PDR) PIO Disable */ -#define PIO_PDR_P14 (0x1u << 14) /**< \brief (PIO_PDR) PIO Disable */ -#define PIO_PDR_P15 (0x1u << 15) /**< \brief (PIO_PDR) PIO Disable */ -#define PIO_PDR_P16 (0x1u << 16) /**< \brief (PIO_PDR) PIO Disable */ -#define PIO_PDR_P17 (0x1u << 17) /**< \brief (PIO_PDR) PIO Disable */ -#define PIO_PDR_P18 (0x1u << 18) /**< \brief (PIO_PDR) PIO Disable */ -#define PIO_PDR_P19 (0x1u << 19) /**< \brief (PIO_PDR) PIO Disable */ -#define PIO_PDR_P20 (0x1u << 20) /**< \brief (PIO_PDR) PIO Disable */ -#define PIO_PDR_P21 (0x1u << 21) /**< \brief (PIO_PDR) PIO Disable */ -#define PIO_PDR_P22 (0x1u << 22) /**< \brief (PIO_PDR) PIO Disable */ -#define PIO_PDR_P23 (0x1u << 23) /**< \brief (PIO_PDR) PIO Disable */ -#define PIO_PDR_P24 (0x1u << 24) /**< \brief (PIO_PDR) PIO Disable */ -#define PIO_PDR_P25 (0x1u << 25) /**< \brief (PIO_PDR) PIO Disable */ -#define PIO_PDR_P26 (0x1u << 26) /**< \brief (PIO_PDR) PIO Disable */ -#define PIO_PDR_P27 (0x1u << 27) /**< \brief (PIO_PDR) PIO Disable */ -#define PIO_PDR_P28 (0x1u << 28) /**< \brief (PIO_PDR) PIO Disable */ -#define PIO_PDR_P29 (0x1u << 29) /**< \brief (PIO_PDR) PIO Disable */ -#define PIO_PDR_P30 (0x1u << 30) /**< \brief (PIO_PDR) PIO Disable */ -#define PIO_PDR_P31 (0x1u << 31) /**< \brief (PIO_PDR) PIO Disable */ -/* -------- PIO_PSR : (PIO Offset: 0x0008) PIO Status Register -------- */ -#define PIO_PSR_P0 (0x1u << 0) /**< \brief (PIO_PSR) PIO Status */ -#define PIO_PSR_P1 (0x1u << 1) /**< \brief (PIO_PSR) PIO Status */ -#define PIO_PSR_P2 (0x1u << 2) /**< \brief (PIO_PSR) PIO Status */ -#define PIO_PSR_P3 (0x1u << 3) /**< \brief (PIO_PSR) PIO Status */ -#define PIO_PSR_P4 (0x1u << 4) /**< \brief (PIO_PSR) PIO Status */ -#define PIO_PSR_P5 (0x1u << 5) /**< \brief (PIO_PSR) PIO Status */ -#define PIO_PSR_P6 (0x1u << 6) /**< \brief (PIO_PSR) PIO Status */ -#define PIO_PSR_P7 (0x1u << 7) /**< \brief (PIO_PSR) PIO Status */ -#define PIO_PSR_P8 (0x1u << 8) /**< \brief (PIO_PSR) PIO Status */ -#define PIO_PSR_P9 (0x1u << 9) /**< \brief (PIO_PSR) PIO Status */ -#define PIO_PSR_P10 (0x1u << 10) /**< \brief (PIO_PSR) PIO Status */ -#define PIO_PSR_P11 (0x1u << 11) /**< \brief (PIO_PSR) PIO Status */ -#define PIO_PSR_P12 (0x1u << 12) /**< \brief (PIO_PSR) PIO Status */ -#define PIO_PSR_P13 (0x1u << 13) /**< \brief (PIO_PSR) PIO Status */ -#define PIO_PSR_P14 (0x1u << 14) /**< \brief (PIO_PSR) PIO Status */ -#define PIO_PSR_P15 (0x1u << 15) /**< \brief (PIO_PSR) PIO Status */ -#define PIO_PSR_P16 (0x1u << 16) /**< \brief (PIO_PSR) PIO Status */ -#define PIO_PSR_P17 (0x1u << 17) /**< \brief (PIO_PSR) PIO Status */ -#define PIO_PSR_P18 (0x1u << 18) /**< \brief (PIO_PSR) PIO Status */ -#define PIO_PSR_P19 (0x1u << 19) /**< \brief (PIO_PSR) PIO Status */ -#define PIO_PSR_P20 (0x1u << 20) /**< \brief (PIO_PSR) PIO Status */ -#define PIO_PSR_P21 (0x1u << 21) /**< \brief (PIO_PSR) PIO Status */ -#define PIO_PSR_P22 (0x1u << 22) /**< \brief (PIO_PSR) PIO Status */ -#define PIO_PSR_P23 (0x1u << 23) /**< \brief (PIO_PSR) PIO Status */ -#define PIO_PSR_P24 (0x1u << 24) /**< \brief (PIO_PSR) PIO Status */ -#define PIO_PSR_P25 (0x1u << 25) /**< \brief (PIO_PSR) PIO Status */ -#define PIO_PSR_P26 (0x1u << 26) /**< \brief (PIO_PSR) PIO Status */ -#define PIO_PSR_P27 (0x1u << 27) /**< \brief (PIO_PSR) PIO Status */ -#define PIO_PSR_P28 (0x1u << 28) /**< \brief (PIO_PSR) PIO Status */ -#define PIO_PSR_P29 (0x1u << 29) /**< \brief (PIO_PSR) PIO Status */ -#define PIO_PSR_P30 (0x1u << 30) /**< \brief (PIO_PSR) PIO Status */ -#define PIO_PSR_P31 (0x1u << 31) /**< \brief (PIO_PSR) PIO Status */ -/* -------- PIO_OER : (PIO Offset: 0x0010) Output Enable Register -------- */ -#define PIO_OER_P0 (0x1u << 0) /**< \brief (PIO_OER) Output Enable */ -#define PIO_OER_P1 (0x1u << 1) /**< \brief (PIO_OER) Output Enable */ -#define PIO_OER_P2 (0x1u << 2) /**< \brief (PIO_OER) Output Enable */ -#define PIO_OER_P3 (0x1u << 3) /**< \brief (PIO_OER) Output Enable */ -#define PIO_OER_P4 (0x1u << 4) /**< \brief (PIO_OER) Output Enable */ -#define PIO_OER_P5 (0x1u << 5) /**< \brief (PIO_OER) Output Enable */ -#define PIO_OER_P6 (0x1u << 6) /**< \brief (PIO_OER) Output Enable */ -#define PIO_OER_P7 (0x1u << 7) /**< \brief (PIO_OER) Output Enable */ -#define PIO_OER_P8 (0x1u << 8) /**< \brief (PIO_OER) Output Enable */ -#define PIO_OER_P9 (0x1u << 9) /**< \brief (PIO_OER) Output Enable */ -#define PIO_OER_P10 (0x1u << 10) /**< \brief (PIO_OER) Output Enable */ -#define PIO_OER_P11 (0x1u << 11) /**< \brief (PIO_OER) Output Enable */ -#define PIO_OER_P12 (0x1u << 12) /**< \brief (PIO_OER) Output Enable */ -#define PIO_OER_P13 (0x1u << 13) /**< \brief (PIO_OER) Output Enable */ -#define PIO_OER_P14 (0x1u << 14) /**< \brief (PIO_OER) Output Enable */ -#define PIO_OER_P15 (0x1u << 15) /**< \brief (PIO_OER) Output Enable */ -#define PIO_OER_P16 (0x1u << 16) /**< \brief (PIO_OER) Output Enable */ -#define PIO_OER_P17 (0x1u << 17) /**< \brief (PIO_OER) Output Enable */ -#define PIO_OER_P18 (0x1u << 18) /**< \brief (PIO_OER) Output Enable */ -#define PIO_OER_P19 (0x1u << 19) /**< \brief (PIO_OER) Output Enable */ -#define PIO_OER_P20 (0x1u << 20) /**< \brief (PIO_OER) Output Enable */ -#define PIO_OER_P21 (0x1u << 21) /**< \brief (PIO_OER) Output Enable */ -#define PIO_OER_P22 (0x1u << 22) /**< \brief (PIO_OER) Output Enable */ -#define PIO_OER_P23 (0x1u << 23) /**< \brief (PIO_OER) Output Enable */ -#define PIO_OER_P24 (0x1u << 24) /**< \brief (PIO_OER) Output Enable */ -#define PIO_OER_P25 (0x1u << 25) /**< \brief (PIO_OER) Output Enable */ -#define PIO_OER_P26 (0x1u << 26) /**< \brief (PIO_OER) Output Enable */ -#define PIO_OER_P27 (0x1u << 27) /**< \brief (PIO_OER) Output Enable */ -#define PIO_OER_P28 (0x1u << 28) /**< \brief (PIO_OER) Output Enable */ -#define PIO_OER_P29 (0x1u << 29) /**< \brief (PIO_OER) Output Enable */ -#define PIO_OER_P30 (0x1u << 30) /**< \brief (PIO_OER) Output Enable */ -#define PIO_OER_P31 (0x1u << 31) /**< \brief (PIO_OER) Output Enable */ -/* -------- PIO_ODR : (PIO Offset: 0x0014) Output Disable Register -------- */ -#define PIO_ODR_P0 (0x1u << 0) /**< \brief (PIO_ODR) Output Disable */ -#define PIO_ODR_P1 (0x1u << 1) /**< \brief (PIO_ODR) Output Disable */ -#define PIO_ODR_P2 (0x1u << 2) /**< \brief (PIO_ODR) Output Disable */ -#define PIO_ODR_P3 (0x1u << 3) /**< \brief (PIO_ODR) Output Disable */ -#define PIO_ODR_P4 (0x1u << 4) /**< \brief (PIO_ODR) Output Disable */ -#define PIO_ODR_P5 (0x1u << 5) /**< \brief (PIO_ODR) Output Disable */ -#define PIO_ODR_P6 (0x1u << 6) /**< \brief (PIO_ODR) Output Disable */ -#define PIO_ODR_P7 (0x1u << 7) /**< \brief (PIO_ODR) Output Disable */ -#define PIO_ODR_P8 (0x1u << 8) /**< \brief (PIO_ODR) Output Disable */ -#define PIO_ODR_P9 (0x1u << 9) /**< \brief (PIO_ODR) Output Disable */ -#define PIO_ODR_P10 (0x1u << 10) /**< \brief (PIO_ODR) Output Disable */ -#define PIO_ODR_P11 (0x1u << 11) /**< \brief (PIO_ODR) Output Disable */ -#define PIO_ODR_P12 (0x1u << 12) /**< \brief (PIO_ODR) Output Disable */ -#define PIO_ODR_P13 (0x1u << 13) /**< \brief (PIO_ODR) Output Disable */ -#define PIO_ODR_P14 (0x1u << 14) /**< \brief (PIO_ODR) Output Disable */ -#define PIO_ODR_P15 (0x1u << 15) /**< \brief (PIO_ODR) Output Disable */ -#define PIO_ODR_P16 (0x1u << 16) /**< \brief (PIO_ODR) Output Disable */ -#define PIO_ODR_P17 (0x1u << 17) /**< \brief (PIO_ODR) Output Disable */ -#define PIO_ODR_P18 (0x1u << 18) /**< \brief (PIO_ODR) Output Disable */ -#define PIO_ODR_P19 (0x1u << 19) /**< \brief (PIO_ODR) Output Disable */ -#define PIO_ODR_P20 (0x1u << 20) /**< \brief (PIO_ODR) Output Disable */ -#define PIO_ODR_P21 (0x1u << 21) /**< \brief (PIO_ODR) Output Disable */ -#define PIO_ODR_P22 (0x1u << 22) /**< \brief (PIO_ODR) Output Disable */ -#define PIO_ODR_P23 (0x1u << 23) /**< \brief (PIO_ODR) Output Disable */ -#define PIO_ODR_P24 (0x1u << 24) /**< \brief (PIO_ODR) Output Disable */ -#define PIO_ODR_P25 (0x1u << 25) /**< \brief (PIO_ODR) Output Disable */ -#define PIO_ODR_P26 (0x1u << 26) /**< \brief (PIO_ODR) Output Disable */ -#define PIO_ODR_P27 (0x1u << 27) /**< \brief (PIO_ODR) Output Disable */ -#define PIO_ODR_P28 (0x1u << 28) /**< \brief (PIO_ODR) Output Disable */ -#define PIO_ODR_P29 (0x1u << 29) /**< \brief (PIO_ODR) Output Disable */ -#define PIO_ODR_P30 (0x1u << 30) /**< \brief (PIO_ODR) Output Disable */ -#define PIO_ODR_P31 (0x1u << 31) /**< \brief (PIO_ODR) Output Disable */ -/* -------- PIO_OSR : (PIO Offset: 0x0018) Output Status Register -------- */ -#define PIO_OSR_P0 (0x1u << 0) /**< \brief (PIO_OSR) Output Status */ -#define PIO_OSR_P1 (0x1u << 1) /**< \brief (PIO_OSR) Output Status */ -#define PIO_OSR_P2 (0x1u << 2) /**< \brief (PIO_OSR) Output Status */ -#define PIO_OSR_P3 (0x1u << 3) /**< \brief (PIO_OSR) Output Status */ -#define PIO_OSR_P4 (0x1u << 4) /**< \brief (PIO_OSR) Output Status */ -#define PIO_OSR_P5 (0x1u << 5) /**< \brief (PIO_OSR) Output Status */ -#define PIO_OSR_P6 (0x1u << 6) /**< \brief (PIO_OSR) Output Status */ -#define PIO_OSR_P7 (0x1u << 7) /**< \brief (PIO_OSR) Output Status */ -#define PIO_OSR_P8 (0x1u << 8) /**< \brief (PIO_OSR) Output Status */ -#define PIO_OSR_P9 (0x1u << 9) /**< \brief (PIO_OSR) Output Status */ -#define PIO_OSR_P10 (0x1u << 10) /**< \brief (PIO_OSR) Output Status */ -#define PIO_OSR_P11 (0x1u << 11) /**< \brief (PIO_OSR) Output Status */ -#define PIO_OSR_P12 (0x1u << 12) /**< \brief (PIO_OSR) Output Status */ -#define PIO_OSR_P13 (0x1u << 13) /**< \brief (PIO_OSR) Output Status */ -#define PIO_OSR_P14 (0x1u << 14) /**< \brief (PIO_OSR) Output Status */ -#define PIO_OSR_P15 (0x1u << 15) /**< \brief (PIO_OSR) Output Status */ -#define PIO_OSR_P16 (0x1u << 16) /**< \brief (PIO_OSR) Output Status */ -#define PIO_OSR_P17 (0x1u << 17) /**< \brief (PIO_OSR) Output Status */ -#define PIO_OSR_P18 (0x1u << 18) /**< \brief (PIO_OSR) Output Status */ -#define PIO_OSR_P19 (0x1u << 19) /**< \brief (PIO_OSR) Output Status */ -#define PIO_OSR_P20 (0x1u << 20) /**< \brief (PIO_OSR) Output Status */ -#define PIO_OSR_P21 (0x1u << 21) /**< \brief (PIO_OSR) Output Status */ -#define PIO_OSR_P22 (0x1u << 22) /**< \brief (PIO_OSR) Output Status */ -#define PIO_OSR_P23 (0x1u << 23) /**< \brief (PIO_OSR) Output Status */ -#define PIO_OSR_P24 (0x1u << 24) /**< \brief (PIO_OSR) Output Status */ -#define PIO_OSR_P25 (0x1u << 25) /**< \brief (PIO_OSR) Output Status */ -#define PIO_OSR_P26 (0x1u << 26) /**< \brief (PIO_OSR) Output Status */ -#define PIO_OSR_P27 (0x1u << 27) /**< \brief (PIO_OSR) Output Status */ -#define PIO_OSR_P28 (0x1u << 28) /**< \brief (PIO_OSR) Output Status */ -#define PIO_OSR_P29 (0x1u << 29) /**< \brief (PIO_OSR) Output Status */ -#define PIO_OSR_P30 (0x1u << 30) /**< \brief (PIO_OSR) Output Status */ -#define PIO_OSR_P31 (0x1u << 31) /**< \brief (PIO_OSR) Output Status */ -/* -------- PIO_IFER : (PIO Offset: 0x0020) Glitch Input Filter Enable Register -------- */ -#define PIO_IFER_P0 (0x1u << 0) /**< \brief (PIO_IFER) Input Filter Enable */ -#define PIO_IFER_P1 (0x1u << 1) /**< \brief (PIO_IFER) Input Filter Enable */ -#define PIO_IFER_P2 (0x1u << 2) /**< \brief (PIO_IFER) Input Filter Enable */ -#define PIO_IFER_P3 (0x1u << 3) /**< \brief (PIO_IFER) Input Filter Enable */ -#define PIO_IFER_P4 (0x1u << 4) /**< \brief (PIO_IFER) Input Filter Enable */ -#define PIO_IFER_P5 (0x1u << 5) /**< \brief (PIO_IFER) Input Filter Enable */ -#define PIO_IFER_P6 (0x1u << 6) /**< \brief (PIO_IFER) Input Filter Enable */ -#define PIO_IFER_P7 (0x1u << 7) /**< \brief (PIO_IFER) Input Filter Enable */ -#define PIO_IFER_P8 (0x1u << 8) /**< \brief (PIO_IFER) Input Filter Enable */ -#define PIO_IFER_P9 (0x1u << 9) /**< \brief (PIO_IFER) Input Filter Enable */ -#define PIO_IFER_P10 (0x1u << 10) /**< \brief (PIO_IFER) Input Filter Enable */ -#define PIO_IFER_P11 (0x1u << 11) /**< \brief (PIO_IFER) Input Filter Enable */ -#define PIO_IFER_P12 (0x1u << 12) /**< \brief (PIO_IFER) Input Filter Enable */ -#define PIO_IFER_P13 (0x1u << 13) /**< \brief (PIO_IFER) Input Filter Enable */ -#define PIO_IFER_P14 (0x1u << 14) /**< \brief (PIO_IFER) Input Filter Enable */ -#define PIO_IFER_P15 (0x1u << 15) /**< \brief (PIO_IFER) Input Filter Enable */ -#define PIO_IFER_P16 (0x1u << 16) /**< \brief (PIO_IFER) Input Filter Enable */ -#define PIO_IFER_P17 (0x1u << 17) /**< \brief (PIO_IFER) Input Filter Enable */ -#define PIO_IFER_P18 (0x1u << 18) /**< \brief (PIO_IFER) Input Filter Enable */ -#define PIO_IFER_P19 (0x1u << 19) /**< \brief (PIO_IFER) Input Filter Enable */ -#define PIO_IFER_P20 (0x1u << 20) /**< \brief (PIO_IFER) Input Filter Enable */ -#define PIO_IFER_P21 (0x1u << 21) /**< \brief (PIO_IFER) Input Filter Enable */ -#define PIO_IFER_P22 (0x1u << 22) /**< \brief (PIO_IFER) Input Filter Enable */ -#define PIO_IFER_P23 (0x1u << 23) /**< \brief (PIO_IFER) Input Filter Enable */ -#define PIO_IFER_P24 (0x1u << 24) /**< \brief (PIO_IFER) Input Filter Enable */ -#define PIO_IFER_P25 (0x1u << 25) /**< \brief (PIO_IFER) Input Filter Enable */ -#define PIO_IFER_P26 (0x1u << 26) /**< \brief (PIO_IFER) Input Filter Enable */ -#define PIO_IFER_P27 (0x1u << 27) /**< \brief (PIO_IFER) Input Filter Enable */ -#define PIO_IFER_P28 (0x1u << 28) /**< \brief (PIO_IFER) Input Filter Enable */ -#define PIO_IFER_P29 (0x1u << 29) /**< \brief (PIO_IFER) Input Filter Enable */ -#define PIO_IFER_P30 (0x1u << 30) /**< \brief (PIO_IFER) Input Filter Enable */ -#define PIO_IFER_P31 (0x1u << 31) /**< \brief (PIO_IFER) Input Filter Enable */ -/* -------- PIO_IFDR : (PIO Offset: 0x0024) Glitch Input Filter Disable Register -------- */ -#define PIO_IFDR_P0 (0x1u << 0) /**< \brief (PIO_IFDR) Input Filter Disable */ -#define PIO_IFDR_P1 (0x1u << 1) /**< \brief (PIO_IFDR) Input Filter Disable */ -#define PIO_IFDR_P2 (0x1u << 2) /**< \brief (PIO_IFDR) Input Filter Disable */ -#define PIO_IFDR_P3 (0x1u << 3) /**< \brief (PIO_IFDR) Input Filter Disable */ -#define PIO_IFDR_P4 (0x1u << 4) /**< \brief (PIO_IFDR) Input Filter Disable */ -#define PIO_IFDR_P5 (0x1u << 5) /**< \brief (PIO_IFDR) Input Filter Disable */ -#define PIO_IFDR_P6 (0x1u << 6) /**< \brief (PIO_IFDR) Input Filter Disable */ -#define PIO_IFDR_P7 (0x1u << 7) /**< \brief (PIO_IFDR) Input Filter Disable */ -#define PIO_IFDR_P8 (0x1u << 8) /**< \brief (PIO_IFDR) Input Filter Disable */ -#define PIO_IFDR_P9 (0x1u << 9) /**< \brief (PIO_IFDR) Input Filter Disable */ -#define PIO_IFDR_P10 (0x1u << 10) /**< \brief (PIO_IFDR) Input Filter Disable */ -#define PIO_IFDR_P11 (0x1u << 11) /**< \brief (PIO_IFDR) Input Filter Disable */ -#define PIO_IFDR_P12 (0x1u << 12) /**< \brief (PIO_IFDR) Input Filter Disable */ -#define PIO_IFDR_P13 (0x1u << 13) /**< \brief (PIO_IFDR) Input Filter Disable */ -#define PIO_IFDR_P14 (0x1u << 14) /**< \brief (PIO_IFDR) Input Filter Disable */ -#define PIO_IFDR_P15 (0x1u << 15) /**< \brief (PIO_IFDR) Input Filter Disable */ -#define PIO_IFDR_P16 (0x1u << 16) /**< \brief (PIO_IFDR) Input Filter Disable */ -#define PIO_IFDR_P17 (0x1u << 17) /**< \brief (PIO_IFDR) Input Filter Disable */ -#define PIO_IFDR_P18 (0x1u << 18) /**< \brief (PIO_IFDR) Input Filter Disable */ -#define PIO_IFDR_P19 (0x1u << 19) /**< \brief (PIO_IFDR) Input Filter Disable */ -#define PIO_IFDR_P20 (0x1u << 20) /**< \brief (PIO_IFDR) Input Filter Disable */ -#define PIO_IFDR_P21 (0x1u << 21) /**< \brief (PIO_IFDR) Input Filter Disable */ -#define PIO_IFDR_P22 (0x1u << 22) /**< \brief (PIO_IFDR) Input Filter Disable */ -#define PIO_IFDR_P23 (0x1u << 23) /**< \brief (PIO_IFDR) Input Filter Disable */ -#define PIO_IFDR_P24 (0x1u << 24) /**< \brief (PIO_IFDR) Input Filter Disable */ -#define PIO_IFDR_P25 (0x1u << 25) /**< \brief (PIO_IFDR) Input Filter Disable */ -#define PIO_IFDR_P26 (0x1u << 26) /**< \brief (PIO_IFDR) Input Filter Disable */ -#define PIO_IFDR_P27 (0x1u << 27) /**< \brief (PIO_IFDR) Input Filter Disable */ -#define PIO_IFDR_P28 (0x1u << 28) /**< \brief (PIO_IFDR) Input Filter Disable */ -#define PIO_IFDR_P29 (0x1u << 29) /**< \brief (PIO_IFDR) Input Filter Disable */ -#define PIO_IFDR_P30 (0x1u << 30) /**< \brief (PIO_IFDR) Input Filter Disable */ -#define PIO_IFDR_P31 (0x1u << 31) /**< \brief (PIO_IFDR) Input Filter Disable */ -/* -------- PIO_IFSR : (PIO Offset: 0x0028) Glitch Input Filter Status Register -------- */ -#define PIO_IFSR_P0 (0x1u << 0) /**< \brief (PIO_IFSR) Input Filter Status */ -#define PIO_IFSR_P1 (0x1u << 1) /**< \brief (PIO_IFSR) Input Filter Status */ -#define PIO_IFSR_P2 (0x1u << 2) /**< \brief (PIO_IFSR) Input Filter Status */ -#define PIO_IFSR_P3 (0x1u << 3) /**< \brief (PIO_IFSR) Input Filter Status */ -#define PIO_IFSR_P4 (0x1u << 4) /**< \brief (PIO_IFSR) Input Filter Status */ -#define PIO_IFSR_P5 (0x1u << 5) /**< \brief (PIO_IFSR) Input Filter Status */ -#define PIO_IFSR_P6 (0x1u << 6) /**< \brief (PIO_IFSR) Input Filter Status */ -#define PIO_IFSR_P7 (0x1u << 7) /**< \brief (PIO_IFSR) Input Filter Status */ -#define PIO_IFSR_P8 (0x1u << 8) /**< \brief (PIO_IFSR) Input Filter Status */ -#define PIO_IFSR_P9 (0x1u << 9) /**< \brief (PIO_IFSR) Input Filter Status */ -#define PIO_IFSR_P10 (0x1u << 10) /**< \brief (PIO_IFSR) Input Filter Status */ -#define PIO_IFSR_P11 (0x1u << 11) /**< \brief (PIO_IFSR) Input Filter Status */ -#define PIO_IFSR_P12 (0x1u << 12) /**< \brief (PIO_IFSR) Input Filter Status */ -#define PIO_IFSR_P13 (0x1u << 13) /**< \brief (PIO_IFSR) Input Filter Status */ -#define PIO_IFSR_P14 (0x1u << 14) /**< \brief (PIO_IFSR) Input Filter Status */ -#define PIO_IFSR_P15 (0x1u << 15) /**< \brief (PIO_IFSR) Input Filter Status */ -#define PIO_IFSR_P16 (0x1u << 16) /**< \brief (PIO_IFSR) Input Filter Status */ -#define PIO_IFSR_P17 (0x1u << 17) /**< \brief (PIO_IFSR) Input Filter Status */ -#define PIO_IFSR_P18 (0x1u << 18) /**< \brief (PIO_IFSR) Input Filter Status */ -#define PIO_IFSR_P19 (0x1u << 19) /**< \brief (PIO_IFSR) Input Filter Status */ -#define PIO_IFSR_P20 (0x1u << 20) /**< \brief (PIO_IFSR) Input Filter Status */ -#define PIO_IFSR_P21 (0x1u << 21) /**< \brief (PIO_IFSR) Input Filter Status */ -#define PIO_IFSR_P22 (0x1u << 22) /**< \brief (PIO_IFSR) Input Filter Status */ -#define PIO_IFSR_P23 (0x1u << 23) /**< \brief (PIO_IFSR) Input Filter Status */ -#define PIO_IFSR_P24 (0x1u << 24) /**< \brief (PIO_IFSR) Input Filter Status */ -#define PIO_IFSR_P25 (0x1u << 25) /**< \brief (PIO_IFSR) Input Filter Status */ -#define PIO_IFSR_P26 (0x1u << 26) /**< \brief (PIO_IFSR) Input Filter Status */ -#define PIO_IFSR_P27 (0x1u << 27) /**< \brief (PIO_IFSR) Input Filter Status */ -#define PIO_IFSR_P28 (0x1u << 28) /**< \brief (PIO_IFSR) Input Filter Status */ -#define PIO_IFSR_P29 (0x1u << 29) /**< \brief (PIO_IFSR) Input Filter Status */ -#define PIO_IFSR_P30 (0x1u << 30) /**< \brief (PIO_IFSR) Input Filter Status */ -#define PIO_IFSR_P31 (0x1u << 31) /**< \brief (PIO_IFSR) Input Filter Status */ -/* -------- PIO_SODR : (PIO Offset: 0x0030) Set Output Data Register -------- */ -#define PIO_SODR_P0 (0x1u << 0) /**< \brief (PIO_SODR) Set Output Data */ -#define PIO_SODR_P1 (0x1u << 1) /**< \brief (PIO_SODR) Set Output Data */ -#define PIO_SODR_P2 (0x1u << 2) /**< \brief (PIO_SODR) Set Output Data */ -#define PIO_SODR_P3 (0x1u << 3) /**< \brief (PIO_SODR) Set Output Data */ -#define PIO_SODR_P4 (0x1u << 4) /**< \brief (PIO_SODR) Set Output Data */ -#define PIO_SODR_P5 (0x1u << 5) /**< \brief (PIO_SODR) Set Output Data */ -#define PIO_SODR_P6 (0x1u << 6) /**< \brief (PIO_SODR) Set Output Data */ -#define PIO_SODR_P7 (0x1u << 7) /**< \brief (PIO_SODR) Set Output Data */ -#define PIO_SODR_P8 (0x1u << 8) /**< \brief (PIO_SODR) Set Output Data */ -#define PIO_SODR_P9 (0x1u << 9) /**< \brief (PIO_SODR) Set Output Data */ -#define PIO_SODR_P10 (0x1u << 10) /**< \brief (PIO_SODR) Set Output Data */ -#define PIO_SODR_P11 (0x1u << 11) /**< \brief (PIO_SODR) Set Output Data */ -#define PIO_SODR_P12 (0x1u << 12) /**< \brief (PIO_SODR) Set Output Data */ -#define PIO_SODR_P13 (0x1u << 13) /**< \brief (PIO_SODR) Set Output Data */ -#define PIO_SODR_P14 (0x1u << 14) /**< \brief (PIO_SODR) Set Output Data */ -#define PIO_SODR_P15 (0x1u << 15) /**< \brief (PIO_SODR) Set Output Data */ -#define PIO_SODR_P16 (0x1u << 16) /**< \brief (PIO_SODR) Set Output Data */ -#define PIO_SODR_P17 (0x1u << 17) /**< \brief (PIO_SODR) Set Output Data */ -#define PIO_SODR_P18 (0x1u << 18) /**< \brief (PIO_SODR) Set Output Data */ -#define PIO_SODR_P19 (0x1u << 19) /**< \brief (PIO_SODR) Set Output Data */ -#define PIO_SODR_P20 (0x1u << 20) /**< \brief (PIO_SODR) Set Output Data */ -#define PIO_SODR_P21 (0x1u << 21) /**< \brief (PIO_SODR) Set Output Data */ -#define PIO_SODR_P22 (0x1u << 22) /**< \brief (PIO_SODR) Set Output Data */ -#define PIO_SODR_P23 (0x1u << 23) /**< \brief (PIO_SODR) Set Output Data */ -#define PIO_SODR_P24 (0x1u << 24) /**< \brief (PIO_SODR) Set Output Data */ -#define PIO_SODR_P25 (0x1u << 25) /**< \brief (PIO_SODR) Set Output Data */ -#define PIO_SODR_P26 (0x1u << 26) /**< \brief (PIO_SODR) Set Output Data */ -#define PIO_SODR_P27 (0x1u << 27) /**< \brief (PIO_SODR) Set Output Data */ -#define PIO_SODR_P28 (0x1u << 28) /**< \brief (PIO_SODR) Set Output Data */ -#define PIO_SODR_P29 (0x1u << 29) /**< \brief (PIO_SODR) Set Output Data */ -#define PIO_SODR_P30 (0x1u << 30) /**< \brief (PIO_SODR) Set Output Data */ -#define PIO_SODR_P31 (0x1u << 31) /**< \brief (PIO_SODR) Set Output Data */ -/* -------- PIO_CODR : (PIO Offset: 0x0034) Clear Output Data Register -------- */ -#define PIO_CODR_P0 (0x1u << 0) /**< \brief (PIO_CODR) Clear Output Data */ -#define PIO_CODR_P1 (0x1u << 1) /**< \brief (PIO_CODR) Clear Output Data */ -#define PIO_CODR_P2 (0x1u << 2) /**< \brief (PIO_CODR) Clear Output Data */ -#define PIO_CODR_P3 (0x1u << 3) /**< \brief (PIO_CODR) Clear Output Data */ -#define PIO_CODR_P4 (0x1u << 4) /**< \brief (PIO_CODR) Clear Output Data */ -#define PIO_CODR_P5 (0x1u << 5) /**< \brief (PIO_CODR) Clear Output Data */ -#define PIO_CODR_P6 (0x1u << 6) /**< \brief (PIO_CODR) Clear Output Data */ -#define PIO_CODR_P7 (0x1u << 7) /**< \brief (PIO_CODR) Clear Output Data */ -#define PIO_CODR_P8 (0x1u << 8) /**< \brief (PIO_CODR) Clear Output Data */ -#define PIO_CODR_P9 (0x1u << 9) /**< \brief (PIO_CODR) Clear Output Data */ -#define PIO_CODR_P10 (0x1u << 10) /**< \brief (PIO_CODR) Clear Output Data */ -#define PIO_CODR_P11 (0x1u << 11) /**< \brief (PIO_CODR) Clear Output Data */ -#define PIO_CODR_P12 (0x1u << 12) /**< \brief (PIO_CODR) Clear Output Data */ -#define PIO_CODR_P13 (0x1u << 13) /**< \brief (PIO_CODR) Clear Output Data */ -#define PIO_CODR_P14 (0x1u << 14) /**< \brief (PIO_CODR) Clear Output Data */ -#define PIO_CODR_P15 (0x1u << 15) /**< \brief (PIO_CODR) Clear Output Data */ -#define PIO_CODR_P16 (0x1u << 16) /**< \brief (PIO_CODR) Clear Output Data */ -#define PIO_CODR_P17 (0x1u << 17) /**< \brief (PIO_CODR) Clear Output Data */ -#define PIO_CODR_P18 (0x1u << 18) /**< \brief (PIO_CODR) Clear Output Data */ -#define PIO_CODR_P19 (0x1u << 19) /**< \brief (PIO_CODR) Clear Output Data */ -#define PIO_CODR_P20 (0x1u << 20) /**< \brief (PIO_CODR) Clear Output Data */ -#define PIO_CODR_P21 (0x1u << 21) /**< \brief (PIO_CODR) Clear Output Data */ -#define PIO_CODR_P22 (0x1u << 22) /**< \brief (PIO_CODR) Clear Output Data */ -#define PIO_CODR_P23 (0x1u << 23) /**< \brief (PIO_CODR) Clear Output Data */ -#define PIO_CODR_P24 (0x1u << 24) /**< \brief (PIO_CODR) Clear Output Data */ -#define PIO_CODR_P25 (0x1u << 25) /**< \brief (PIO_CODR) Clear Output Data */ -#define PIO_CODR_P26 (0x1u << 26) /**< \brief (PIO_CODR) Clear Output Data */ -#define PIO_CODR_P27 (0x1u << 27) /**< \brief (PIO_CODR) Clear Output Data */ -#define PIO_CODR_P28 (0x1u << 28) /**< \brief (PIO_CODR) Clear Output Data */ -#define PIO_CODR_P29 (0x1u << 29) /**< \brief (PIO_CODR) Clear Output Data */ -#define PIO_CODR_P30 (0x1u << 30) /**< \brief (PIO_CODR) Clear Output Data */ -#define PIO_CODR_P31 (0x1u << 31) /**< \brief (PIO_CODR) Clear Output Data */ -/* -------- PIO_ODSR : (PIO Offset: 0x0038) Output Data Status Register -------- */ -#define PIO_ODSR_P0 (0x1u << 0) /**< \brief (PIO_ODSR) Output Data Status */ -#define PIO_ODSR_P1 (0x1u << 1) /**< \brief (PIO_ODSR) Output Data Status */ -#define PIO_ODSR_P2 (0x1u << 2) /**< \brief (PIO_ODSR) Output Data Status */ -#define PIO_ODSR_P3 (0x1u << 3) /**< \brief (PIO_ODSR) Output Data Status */ -#define PIO_ODSR_P4 (0x1u << 4) /**< \brief (PIO_ODSR) Output Data Status */ -#define PIO_ODSR_P5 (0x1u << 5) /**< \brief (PIO_ODSR) Output Data Status */ -#define PIO_ODSR_P6 (0x1u << 6) /**< \brief (PIO_ODSR) Output Data Status */ -#define PIO_ODSR_P7 (0x1u << 7) /**< \brief (PIO_ODSR) Output Data Status */ -#define PIO_ODSR_P8 (0x1u << 8) /**< \brief (PIO_ODSR) Output Data Status */ -#define PIO_ODSR_P9 (0x1u << 9) /**< \brief (PIO_ODSR) Output Data Status */ -#define PIO_ODSR_P10 (0x1u << 10) /**< \brief (PIO_ODSR) Output Data Status */ -#define PIO_ODSR_P11 (0x1u << 11) /**< \brief (PIO_ODSR) Output Data Status */ -#define PIO_ODSR_P12 (0x1u << 12) /**< \brief (PIO_ODSR) Output Data Status */ -#define PIO_ODSR_P13 (0x1u << 13) /**< \brief (PIO_ODSR) Output Data Status */ -#define PIO_ODSR_P14 (0x1u << 14) /**< \brief (PIO_ODSR) Output Data Status */ -#define PIO_ODSR_P15 (0x1u << 15) /**< \brief (PIO_ODSR) Output Data Status */ -#define PIO_ODSR_P16 (0x1u << 16) /**< \brief (PIO_ODSR) Output Data Status */ -#define PIO_ODSR_P17 (0x1u << 17) /**< \brief (PIO_ODSR) Output Data Status */ -#define PIO_ODSR_P18 (0x1u << 18) /**< \brief (PIO_ODSR) Output Data Status */ -#define PIO_ODSR_P19 (0x1u << 19) /**< \brief (PIO_ODSR) Output Data Status */ -#define PIO_ODSR_P20 (0x1u << 20) /**< \brief (PIO_ODSR) Output Data Status */ -#define PIO_ODSR_P21 (0x1u << 21) /**< \brief (PIO_ODSR) Output Data Status */ -#define PIO_ODSR_P22 (0x1u << 22) /**< \brief (PIO_ODSR) Output Data Status */ -#define PIO_ODSR_P23 (0x1u << 23) /**< \brief (PIO_ODSR) Output Data Status */ -#define PIO_ODSR_P24 (0x1u << 24) /**< \brief (PIO_ODSR) Output Data Status */ -#define PIO_ODSR_P25 (0x1u << 25) /**< \brief (PIO_ODSR) Output Data Status */ -#define PIO_ODSR_P26 (0x1u << 26) /**< \brief (PIO_ODSR) Output Data Status */ -#define PIO_ODSR_P27 (0x1u << 27) /**< \brief (PIO_ODSR) Output Data Status */ -#define PIO_ODSR_P28 (0x1u << 28) /**< \brief (PIO_ODSR) Output Data Status */ -#define PIO_ODSR_P29 (0x1u << 29) /**< \brief (PIO_ODSR) Output Data Status */ -#define PIO_ODSR_P30 (0x1u << 30) /**< \brief (PIO_ODSR) Output Data Status */ -#define PIO_ODSR_P31 (0x1u << 31) /**< \brief (PIO_ODSR) Output Data Status */ -/* -------- PIO_PDSR : (PIO Offset: 0x003C) Pin Data Status Register -------- */ -#define PIO_PDSR_P0 (0x1u << 0) /**< \brief (PIO_PDSR) Output Data Status */ -#define PIO_PDSR_P1 (0x1u << 1) /**< \brief (PIO_PDSR) Output Data Status */ -#define PIO_PDSR_P2 (0x1u << 2) /**< \brief (PIO_PDSR) Output Data Status */ -#define PIO_PDSR_P3 (0x1u << 3) /**< \brief (PIO_PDSR) Output Data Status */ -#define PIO_PDSR_P4 (0x1u << 4) /**< \brief (PIO_PDSR) Output Data Status */ -#define PIO_PDSR_P5 (0x1u << 5) /**< \brief (PIO_PDSR) Output Data Status */ -#define PIO_PDSR_P6 (0x1u << 6) /**< \brief (PIO_PDSR) Output Data Status */ -#define PIO_PDSR_P7 (0x1u << 7) /**< \brief (PIO_PDSR) Output Data Status */ -#define PIO_PDSR_P8 (0x1u << 8) /**< \brief (PIO_PDSR) Output Data Status */ -#define PIO_PDSR_P9 (0x1u << 9) /**< \brief (PIO_PDSR) Output Data Status */ -#define PIO_PDSR_P10 (0x1u << 10) /**< \brief (PIO_PDSR) Output Data Status */ -#define PIO_PDSR_P11 (0x1u << 11) /**< \brief (PIO_PDSR) Output Data Status */ -#define PIO_PDSR_P12 (0x1u << 12) /**< \brief (PIO_PDSR) Output Data Status */ -#define PIO_PDSR_P13 (0x1u << 13) /**< \brief (PIO_PDSR) Output Data Status */ -#define PIO_PDSR_P14 (0x1u << 14) /**< \brief (PIO_PDSR) Output Data Status */ -#define PIO_PDSR_P15 (0x1u << 15) /**< \brief (PIO_PDSR) Output Data Status */ -#define PIO_PDSR_P16 (0x1u << 16) /**< \brief (PIO_PDSR) Output Data Status */ -#define PIO_PDSR_P17 (0x1u << 17) /**< \brief (PIO_PDSR) Output Data Status */ -#define PIO_PDSR_P18 (0x1u << 18) /**< \brief (PIO_PDSR) Output Data Status */ -#define PIO_PDSR_P19 (0x1u << 19) /**< \brief (PIO_PDSR) Output Data Status */ -#define PIO_PDSR_P20 (0x1u << 20) /**< \brief (PIO_PDSR) Output Data Status */ -#define PIO_PDSR_P21 (0x1u << 21) /**< \brief (PIO_PDSR) Output Data Status */ -#define PIO_PDSR_P22 (0x1u << 22) /**< \brief (PIO_PDSR) Output Data Status */ -#define PIO_PDSR_P23 (0x1u << 23) /**< \brief (PIO_PDSR) Output Data Status */ -#define PIO_PDSR_P24 (0x1u << 24) /**< \brief (PIO_PDSR) Output Data Status */ -#define PIO_PDSR_P25 (0x1u << 25) /**< \brief (PIO_PDSR) Output Data Status */ -#define PIO_PDSR_P26 (0x1u << 26) /**< \brief (PIO_PDSR) Output Data Status */ -#define PIO_PDSR_P27 (0x1u << 27) /**< \brief (PIO_PDSR) Output Data Status */ -#define PIO_PDSR_P28 (0x1u << 28) /**< \brief (PIO_PDSR) Output Data Status */ -#define PIO_PDSR_P29 (0x1u << 29) /**< \brief (PIO_PDSR) Output Data Status */ -#define PIO_PDSR_P30 (0x1u << 30) /**< \brief (PIO_PDSR) Output Data Status */ -#define PIO_PDSR_P31 (0x1u << 31) /**< \brief (PIO_PDSR) Output Data Status */ -/* -------- PIO_IER : (PIO Offset: 0x0040) Interrupt Enable Register -------- */ -#define PIO_IER_P0 (0x1u << 0) /**< \brief (PIO_IER) Input Change Interrupt Enable */ -#define PIO_IER_P1 (0x1u << 1) /**< \brief (PIO_IER) Input Change Interrupt Enable */ -#define PIO_IER_P2 (0x1u << 2) /**< \brief (PIO_IER) Input Change Interrupt Enable */ -#define PIO_IER_P3 (0x1u << 3) /**< \brief (PIO_IER) Input Change Interrupt Enable */ -#define PIO_IER_P4 (0x1u << 4) /**< \brief (PIO_IER) Input Change Interrupt Enable */ -#define PIO_IER_P5 (0x1u << 5) /**< \brief (PIO_IER) Input Change Interrupt Enable */ -#define PIO_IER_P6 (0x1u << 6) /**< \brief (PIO_IER) Input Change Interrupt Enable */ -#define PIO_IER_P7 (0x1u << 7) /**< \brief (PIO_IER) Input Change Interrupt Enable */ -#define PIO_IER_P8 (0x1u << 8) /**< \brief (PIO_IER) Input Change Interrupt Enable */ -#define PIO_IER_P9 (0x1u << 9) /**< \brief (PIO_IER) Input Change Interrupt Enable */ -#define PIO_IER_P10 (0x1u << 10) /**< \brief (PIO_IER) Input Change Interrupt Enable */ -#define PIO_IER_P11 (0x1u << 11) /**< \brief (PIO_IER) Input Change Interrupt Enable */ -#define PIO_IER_P12 (0x1u << 12) /**< \brief (PIO_IER) Input Change Interrupt Enable */ -#define PIO_IER_P13 (0x1u << 13) /**< \brief (PIO_IER) Input Change Interrupt Enable */ -#define PIO_IER_P14 (0x1u << 14) /**< \brief (PIO_IER) Input Change Interrupt Enable */ -#define PIO_IER_P15 (0x1u << 15) /**< \brief (PIO_IER) Input Change Interrupt Enable */ -#define PIO_IER_P16 (0x1u << 16) /**< \brief (PIO_IER) Input Change Interrupt Enable */ -#define PIO_IER_P17 (0x1u << 17) /**< \brief (PIO_IER) Input Change Interrupt Enable */ -#define PIO_IER_P18 (0x1u << 18) /**< \brief (PIO_IER) Input Change Interrupt Enable */ -#define PIO_IER_P19 (0x1u << 19) /**< \brief (PIO_IER) Input Change Interrupt Enable */ -#define PIO_IER_P20 (0x1u << 20) /**< \brief (PIO_IER) Input Change Interrupt Enable */ -#define PIO_IER_P21 (0x1u << 21) /**< \brief (PIO_IER) Input Change Interrupt Enable */ -#define PIO_IER_P22 (0x1u << 22) /**< \brief (PIO_IER) Input Change Interrupt Enable */ -#define PIO_IER_P23 (0x1u << 23) /**< \brief (PIO_IER) Input Change Interrupt Enable */ -#define PIO_IER_P24 (0x1u << 24) /**< \brief (PIO_IER) Input Change Interrupt Enable */ -#define PIO_IER_P25 (0x1u << 25) /**< \brief (PIO_IER) Input Change Interrupt Enable */ -#define PIO_IER_P26 (0x1u << 26) /**< \brief (PIO_IER) Input Change Interrupt Enable */ -#define PIO_IER_P27 (0x1u << 27) /**< \brief (PIO_IER) Input Change Interrupt Enable */ -#define PIO_IER_P28 (0x1u << 28) /**< \brief (PIO_IER) Input Change Interrupt Enable */ -#define PIO_IER_P29 (0x1u << 29) /**< \brief (PIO_IER) Input Change Interrupt Enable */ -#define PIO_IER_P30 (0x1u << 30) /**< \brief (PIO_IER) Input Change Interrupt Enable */ -#define PIO_IER_P31 (0x1u << 31) /**< \brief (PIO_IER) Input Change Interrupt Enable */ -/* -------- PIO_IDR : (PIO Offset: 0x0044) Interrupt Disable Register -------- */ -#define PIO_IDR_P0 (0x1u << 0) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ -#define PIO_IDR_P1 (0x1u << 1) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ -#define PIO_IDR_P2 (0x1u << 2) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ -#define PIO_IDR_P3 (0x1u << 3) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ -#define PIO_IDR_P4 (0x1u << 4) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ -#define PIO_IDR_P5 (0x1u << 5) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ -#define PIO_IDR_P6 (0x1u << 6) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ -#define PIO_IDR_P7 (0x1u << 7) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ -#define PIO_IDR_P8 (0x1u << 8) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ -#define PIO_IDR_P9 (0x1u << 9) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ -#define PIO_IDR_P10 (0x1u << 10) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ -#define PIO_IDR_P11 (0x1u << 11) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ -#define PIO_IDR_P12 (0x1u << 12) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ -#define PIO_IDR_P13 (0x1u << 13) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ -#define PIO_IDR_P14 (0x1u << 14) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ -#define PIO_IDR_P15 (0x1u << 15) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ -#define PIO_IDR_P16 (0x1u << 16) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ -#define PIO_IDR_P17 (0x1u << 17) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ -#define PIO_IDR_P18 (0x1u << 18) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ -#define PIO_IDR_P19 (0x1u << 19) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ -#define PIO_IDR_P20 (0x1u << 20) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ -#define PIO_IDR_P21 (0x1u << 21) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ -#define PIO_IDR_P22 (0x1u << 22) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ -#define PIO_IDR_P23 (0x1u << 23) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ -#define PIO_IDR_P24 (0x1u << 24) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ -#define PIO_IDR_P25 (0x1u << 25) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ -#define PIO_IDR_P26 (0x1u << 26) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ -#define PIO_IDR_P27 (0x1u << 27) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ -#define PIO_IDR_P28 (0x1u << 28) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ -#define PIO_IDR_P29 (0x1u << 29) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ -#define PIO_IDR_P30 (0x1u << 30) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ -#define PIO_IDR_P31 (0x1u << 31) /**< \brief (PIO_IDR) Input Change Interrupt Disable */ -/* -------- PIO_IMR : (PIO Offset: 0x0048) Interrupt Mask Register -------- */ -#define PIO_IMR_P0 (0x1u << 0) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ -#define PIO_IMR_P1 (0x1u << 1) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ -#define PIO_IMR_P2 (0x1u << 2) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ -#define PIO_IMR_P3 (0x1u << 3) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ -#define PIO_IMR_P4 (0x1u << 4) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ -#define PIO_IMR_P5 (0x1u << 5) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ -#define PIO_IMR_P6 (0x1u << 6) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ -#define PIO_IMR_P7 (0x1u << 7) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ -#define PIO_IMR_P8 (0x1u << 8) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ -#define PIO_IMR_P9 (0x1u << 9) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ -#define PIO_IMR_P10 (0x1u << 10) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ -#define PIO_IMR_P11 (0x1u << 11) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ -#define PIO_IMR_P12 (0x1u << 12) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ -#define PIO_IMR_P13 (0x1u << 13) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ -#define PIO_IMR_P14 (0x1u << 14) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ -#define PIO_IMR_P15 (0x1u << 15) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ -#define PIO_IMR_P16 (0x1u << 16) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ -#define PIO_IMR_P17 (0x1u << 17) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ -#define PIO_IMR_P18 (0x1u << 18) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ -#define PIO_IMR_P19 (0x1u << 19) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ -#define PIO_IMR_P20 (0x1u << 20) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ -#define PIO_IMR_P21 (0x1u << 21) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ -#define PIO_IMR_P22 (0x1u << 22) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ -#define PIO_IMR_P23 (0x1u << 23) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ -#define PIO_IMR_P24 (0x1u << 24) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ -#define PIO_IMR_P25 (0x1u << 25) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ -#define PIO_IMR_P26 (0x1u << 26) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ -#define PIO_IMR_P27 (0x1u << 27) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ -#define PIO_IMR_P28 (0x1u << 28) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ -#define PIO_IMR_P29 (0x1u << 29) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ -#define PIO_IMR_P30 (0x1u << 30) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ -#define PIO_IMR_P31 (0x1u << 31) /**< \brief (PIO_IMR) Input Change Interrupt Mask */ -/* -------- PIO_ISR : (PIO Offset: 0x004C) Interrupt Status Register -------- */ -#define PIO_ISR_P0 (0x1u << 0) /**< \brief (PIO_ISR) Input Change Interrupt Status */ -#define PIO_ISR_P1 (0x1u << 1) /**< \brief (PIO_ISR) Input Change Interrupt Status */ -#define PIO_ISR_P2 (0x1u << 2) /**< \brief (PIO_ISR) Input Change Interrupt Status */ -#define PIO_ISR_P3 (0x1u << 3) /**< \brief (PIO_ISR) Input Change Interrupt Status */ -#define PIO_ISR_P4 (0x1u << 4) /**< \brief (PIO_ISR) Input Change Interrupt Status */ -#define PIO_ISR_P5 (0x1u << 5) /**< \brief (PIO_ISR) Input Change Interrupt Status */ -#define PIO_ISR_P6 (0x1u << 6) /**< \brief (PIO_ISR) Input Change Interrupt Status */ -#define PIO_ISR_P7 (0x1u << 7) /**< \brief (PIO_ISR) Input Change Interrupt Status */ -#define PIO_ISR_P8 (0x1u << 8) /**< \brief (PIO_ISR) Input Change Interrupt Status */ -#define PIO_ISR_P9 (0x1u << 9) /**< \brief (PIO_ISR) Input Change Interrupt Status */ -#define PIO_ISR_P10 (0x1u << 10) /**< \brief (PIO_ISR) Input Change Interrupt Status */ -#define PIO_ISR_P11 (0x1u << 11) /**< \brief (PIO_ISR) Input Change Interrupt Status */ -#define PIO_ISR_P12 (0x1u << 12) /**< \brief (PIO_ISR) Input Change Interrupt Status */ -#define PIO_ISR_P13 (0x1u << 13) /**< \brief (PIO_ISR) Input Change Interrupt Status */ -#define PIO_ISR_P14 (0x1u << 14) /**< \brief (PIO_ISR) Input Change Interrupt Status */ -#define PIO_ISR_P15 (0x1u << 15) /**< \brief (PIO_ISR) Input Change Interrupt Status */ -#define PIO_ISR_P16 (0x1u << 16) /**< \brief (PIO_ISR) Input Change Interrupt Status */ -#define PIO_ISR_P17 (0x1u << 17) /**< \brief (PIO_ISR) Input Change Interrupt Status */ -#define PIO_ISR_P18 (0x1u << 18) /**< \brief (PIO_ISR) Input Change Interrupt Status */ -#define PIO_ISR_P19 (0x1u << 19) /**< \brief (PIO_ISR) Input Change Interrupt Status */ -#define PIO_ISR_P20 (0x1u << 20) /**< \brief (PIO_ISR) Input Change Interrupt Status */ -#define PIO_ISR_P21 (0x1u << 21) /**< \brief (PIO_ISR) Input Change Interrupt Status */ -#define PIO_ISR_P22 (0x1u << 22) /**< \brief (PIO_ISR) Input Change Interrupt Status */ -#define PIO_ISR_P23 (0x1u << 23) /**< \brief (PIO_ISR) Input Change Interrupt Status */ -#define PIO_ISR_P24 (0x1u << 24) /**< \brief (PIO_ISR) Input Change Interrupt Status */ -#define PIO_ISR_P25 (0x1u << 25) /**< \brief (PIO_ISR) Input Change Interrupt Status */ -#define PIO_ISR_P26 (0x1u << 26) /**< \brief (PIO_ISR) Input Change Interrupt Status */ -#define PIO_ISR_P27 (0x1u << 27) /**< \brief (PIO_ISR) Input Change Interrupt Status */ -#define PIO_ISR_P28 (0x1u << 28) /**< \brief (PIO_ISR) Input Change Interrupt Status */ -#define PIO_ISR_P29 (0x1u << 29) /**< \brief (PIO_ISR) Input Change Interrupt Status */ -#define PIO_ISR_P30 (0x1u << 30) /**< \brief (PIO_ISR) Input Change Interrupt Status */ -#define PIO_ISR_P31 (0x1u << 31) /**< \brief (PIO_ISR) Input Change Interrupt Status */ -/* -------- PIO_MDER : (PIO Offset: 0x0050) Multi-driver Enable Register -------- */ -#define PIO_MDER_P0 (0x1u << 0) /**< \brief (PIO_MDER) Multi-drive Enable */ -#define PIO_MDER_P1 (0x1u << 1) /**< \brief (PIO_MDER) Multi-drive Enable */ -#define PIO_MDER_P2 (0x1u << 2) /**< \brief (PIO_MDER) Multi-drive Enable */ -#define PIO_MDER_P3 (0x1u << 3) /**< \brief (PIO_MDER) Multi-drive Enable */ -#define PIO_MDER_P4 (0x1u << 4) /**< \brief (PIO_MDER) Multi-drive Enable */ -#define PIO_MDER_P5 (0x1u << 5) /**< \brief (PIO_MDER) Multi-drive Enable */ -#define PIO_MDER_P6 (0x1u << 6) /**< \brief (PIO_MDER) Multi-drive Enable */ -#define PIO_MDER_P7 (0x1u << 7) /**< \brief (PIO_MDER) Multi-drive Enable */ -#define PIO_MDER_P8 (0x1u << 8) /**< \brief (PIO_MDER) Multi-drive Enable */ -#define PIO_MDER_P9 (0x1u << 9) /**< \brief (PIO_MDER) Multi-drive Enable */ -#define PIO_MDER_P10 (0x1u << 10) /**< \brief (PIO_MDER) Multi-drive Enable */ -#define PIO_MDER_P11 (0x1u << 11) /**< \brief (PIO_MDER) Multi-drive Enable */ -#define PIO_MDER_P12 (0x1u << 12) /**< \brief (PIO_MDER) Multi-drive Enable */ -#define PIO_MDER_P13 (0x1u << 13) /**< \brief (PIO_MDER) Multi-drive Enable */ -#define PIO_MDER_P14 (0x1u << 14) /**< \brief (PIO_MDER) Multi-drive Enable */ -#define PIO_MDER_P15 (0x1u << 15) /**< \brief (PIO_MDER) Multi-drive Enable */ -#define PIO_MDER_P16 (0x1u << 16) /**< \brief (PIO_MDER) Multi-drive Enable */ -#define PIO_MDER_P17 (0x1u << 17) /**< \brief (PIO_MDER) Multi-drive Enable */ -#define PIO_MDER_P18 (0x1u << 18) /**< \brief (PIO_MDER) Multi-drive Enable */ -#define PIO_MDER_P19 (0x1u << 19) /**< \brief (PIO_MDER) Multi-drive Enable */ -#define PIO_MDER_P20 (0x1u << 20) /**< \brief (PIO_MDER) Multi-drive Enable */ -#define PIO_MDER_P21 (0x1u << 21) /**< \brief (PIO_MDER) Multi-drive Enable */ -#define PIO_MDER_P22 (0x1u << 22) /**< \brief (PIO_MDER) Multi-drive Enable */ -#define PIO_MDER_P23 (0x1u << 23) /**< \brief (PIO_MDER) Multi-drive Enable */ -#define PIO_MDER_P24 (0x1u << 24) /**< \brief (PIO_MDER) Multi-drive Enable */ -#define PIO_MDER_P25 (0x1u << 25) /**< \brief (PIO_MDER) Multi-drive Enable */ -#define PIO_MDER_P26 (0x1u << 26) /**< \brief (PIO_MDER) Multi-drive Enable */ -#define PIO_MDER_P27 (0x1u << 27) /**< \brief (PIO_MDER) Multi-drive Enable */ -#define PIO_MDER_P28 (0x1u << 28) /**< \brief (PIO_MDER) Multi-drive Enable */ -#define PIO_MDER_P29 (0x1u << 29) /**< \brief (PIO_MDER) Multi-drive Enable */ -#define PIO_MDER_P30 (0x1u << 30) /**< \brief (PIO_MDER) Multi-drive Enable */ -#define PIO_MDER_P31 (0x1u << 31) /**< \brief (PIO_MDER) Multi-drive Enable */ -/* -------- PIO_MDDR : (PIO Offset: 0x0054) Multi-driver Disable Register -------- */ -#define PIO_MDDR_P0 (0x1u << 0) /**< \brief (PIO_MDDR) Multi-drive Disable */ -#define PIO_MDDR_P1 (0x1u << 1) /**< \brief (PIO_MDDR) Multi-drive Disable */ -#define PIO_MDDR_P2 (0x1u << 2) /**< \brief (PIO_MDDR) Multi-drive Disable */ -#define PIO_MDDR_P3 (0x1u << 3) /**< \brief (PIO_MDDR) Multi-drive Disable */ -#define PIO_MDDR_P4 (0x1u << 4) /**< \brief (PIO_MDDR) Multi-drive Disable */ -#define PIO_MDDR_P5 (0x1u << 5) /**< \brief (PIO_MDDR) Multi-drive Disable */ -#define PIO_MDDR_P6 (0x1u << 6) /**< \brief (PIO_MDDR) Multi-drive Disable */ -#define PIO_MDDR_P7 (0x1u << 7) /**< \brief (PIO_MDDR) Multi-drive Disable */ -#define PIO_MDDR_P8 (0x1u << 8) /**< \brief (PIO_MDDR) Multi-drive Disable */ -#define PIO_MDDR_P9 (0x1u << 9) /**< \brief (PIO_MDDR) Multi-drive Disable */ -#define PIO_MDDR_P10 (0x1u << 10) /**< \brief (PIO_MDDR) Multi-drive Disable */ -#define PIO_MDDR_P11 (0x1u << 11) /**< \brief (PIO_MDDR) Multi-drive Disable */ -#define PIO_MDDR_P12 (0x1u << 12) /**< \brief (PIO_MDDR) Multi-drive Disable */ -#define PIO_MDDR_P13 (0x1u << 13) /**< \brief (PIO_MDDR) Multi-drive Disable */ -#define PIO_MDDR_P14 (0x1u << 14) /**< \brief (PIO_MDDR) Multi-drive Disable */ -#define PIO_MDDR_P15 (0x1u << 15) /**< \brief (PIO_MDDR) Multi-drive Disable */ -#define PIO_MDDR_P16 (0x1u << 16) /**< \brief (PIO_MDDR) Multi-drive Disable */ -#define PIO_MDDR_P17 (0x1u << 17) /**< \brief (PIO_MDDR) Multi-drive Disable */ -#define PIO_MDDR_P18 (0x1u << 18) /**< \brief (PIO_MDDR) Multi-drive Disable */ -#define PIO_MDDR_P19 (0x1u << 19) /**< \brief (PIO_MDDR) Multi-drive Disable */ -#define PIO_MDDR_P20 (0x1u << 20) /**< \brief (PIO_MDDR) Multi-drive Disable */ -#define PIO_MDDR_P21 (0x1u << 21) /**< \brief (PIO_MDDR) Multi-drive Disable */ -#define PIO_MDDR_P22 (0x1u << 22) /**< \brief (PIO_MDDR) Multi-drive Disable */ -#define PIO_MDDR_P23 (0x1u << 23) /**< \brief (PIO_MDDR) Multi-drive Disable */ -#define PIO_MDDR_P24 (0x1u << 24) /**< \brief (PIO_MDDR) Multi-drive Disable */ -#define PIO_MDDR_P25 (0x1u << 25) /**< \brief (PIO_MDDR) Multi-drive Disable */ -#define PIO_MDDR_P26 (0x1u << 26) /**< \brief (PIO_MDDR) Multi-drive Disable */ -#define PIO_MDDR_P27 (0x1u << 27) /**< \brief (PIO_MDDR) Multi-drive Disable */ -#define PIO_MDDR_P28 (0x1u << 28) /**< \brief (PIO_MDDR) Multi-drive Disable */ -#define PIO_MDDR_P29 (0x1u << 29) /**< \brief (PIO_MDDR) Multi-drive Disable */ -#define PIO_MDDR_P30 (0x1u << 30) /**< \brief (PIO_MDDR) Multi-drive Disable */ -#define PIO_MDDR_P31 (0x1u << 31) /**< \brief (PIO_MDDR) Multi-drive Disable */ -/* -------- PIO_MDSR : (PIO Offset: 0x0058) Multi-driver Status Register -------- */ -#define PIO_MDSR_P0 (0x1u << 0) /**< \brief (PIO_MDSR) Multi-drive Status */ -#define PIO_MDSR_P1 (0x1u << 1) /**< \brief (PIO_MDSR) Multi-drive Status */ -#define PIO_MDSR_P2 (0x1u << 2) /**< \brief (PIO_MDSR) Multi-drive Status */ -#define PIO_MDSR_P3 (0x1u << 3) /**< \brief (PIO_MDSR) Multi-drive Status */ -#define PIO_MDSR_P4 (0x1u << 4) /**< \brief (PIO_MDSR) Multi-drive Status */ -#define PIO_MDSR_P5 (0x1u << 5) /**< \brief (PIO_MDSR) Multi-drive Status */ -#define PIO_MDSR_P6 (0x1u << 6) /**< \brief (PIO_MDSR) Multi-drive Status */ -#define PIO_MDSR_P7 (0x1u << 7) /**< \brief (PIO_MDSR) Multi-drive Status */ -#define PIO_MDSR_P8 (0x1u << 8) /**< \brief (PIO_MDSR) Multi-drive Status */ -#define PIO_MDSR_P9 (0x1u << 9) /**< \brief (PIO_MDSR) Multi-drive Status */ -#define PIO_MDSR_P10 (0x1u << 10) /**< \brief (PIO_MDSR) Multi-drive Status */ -#define PIO_MDSR_P11 (0x1u << 11) /**< \brief (PIO_MDSR) Multi-drive Status */ -#define PIO_MDSR_P12 (0x1u << 12) /**< \brief (PIO_MDSR) Multi-drive Status */ -#define PIO_MDSR_P13 (0x1u << 13) /**< \brief (PIO_MDSR) Multi-drive Status */ -#define PIO_MDSR_P14 (0x1u << 14) /**< \brief (PIO_MDSR) Multi-drive Status */ -#define PIO_MDSR_P15 (0x1u << 15) /**< \brief (PIO_MDSR) Multi-drive Status */ -#define PIO_MDSR_P16 (0x1u << 16) /**< \brief (PIO_MDSR) Multi-drive Status */ -#define PIO_MDSR_P17 (0x1u << 17) /**< \brief (PIO_MDSR) Multi-drive Status */ -#define PIO_MDSR_P18 (0x1u << 18) /**< \brief (PIO_MDSR) Multi-drive Status */ -#define PIO_MDSR_P19 (0x1u << 19) /**< \brief (PIO_MDSR) Multi-drive Status */ -#define PIO_MDSR_P20 (0x1u << 20) /**< \brief (PIO_MDSR) Multi-drive Status */ -#define PIO_MDSR_P21 (0x1u << 21) /**< \brief (PIO_MDSR) Multi-drive Status */ -#define PIO_MDSR_P22 (0x1u << 22) /**< \brief (PIO_MDSR) Multi-drive Status */ -#define PIO_MDSR_P23 (0x1u << 23) /**< \brief (PIO_MDSR) Multi-drive Status */ -#define PIO_MDSR_P24 (0x1u << 24) /**< \brief (PIO_MDSR) Multi-drive Status */ -#define PIO_MDSR_P25 (0x1u << 25) /**< \brief (PIO_MDSR) Multi-drive Status */ -#define PIO_MDSR_P26 (0x1u << 26) /**< \brief (PIO_MDSR) Multi-drive Status */ -#define PIO_MDSR_P27 (0x1u << 27) /**< \brief (PIO_MDSR) Multi-drive Status */ -#define PIO_MDSR_P28 (0x1u << 28) /**< \brief (PIO_MDSR) Multi-drive Status */ -#define PIO_MDSR_P29 (0x1u << 29) /**< \brief (PIO_MDSR) Multi-drive Status */ -#define PIO_MDSR_P30 (0x1u << 30) /**< \brief (PIO_MDSR) Multi-drive Status */ -#define PIO_MDSR_P31 (0x1u << 31) /**< \brief (PIO_MDSR) Multi-drive Status */ -/* -------- PIO_PUDR : (PIO Offset: 0x0060) Pull-up Disable Register -------- */ -#define PIO_PUDR_P0 (0x1u << 0) /**< \brief (PIO_PUDR) Pull-Up Disable */ -#define PIO_PUDR_P1 (0x1u << 1) /**< \brief (PIO_PUDR) Pull-Up Disable */ -#define PIO_PUDR_P2 (0x1u << 2) /**< \brief (PIO_PUDR) Pull-Up Disable */ -#define PIO_PUDR_P3 (0x1u << 3) /**< \brief (PIO_PUDR) Pull-Up Disable */ -#define PIO_PUDR_P4 (0x1u << 4) /**< \brief (PIO_PUDR) Pull-Up Disable */ -#define PIO_PUDR_P5 (0x1u << 5) /**< \brief (PIO_PUDR) Pull-Up Disable */ -#define PIO_PUDR_P6 (0x1u << 6) /**< \brief (PIO_PUDR) Pull-Up Disable */ -#define PIO_PUDR_P7 (0x1u << 7) /**< \brief (PIO_PUDR) Pull-Up Disable */ -#define PIO_PUDR_P8 (0x1u << 8) /**< \brief (PIO_PUDR) Pull-Up Disable */ -#define PIO_PUDR_P9 (0x1u << 9) /**< \brief (PIO_PUDR) Pull-Up Disable */ -#define PIO_PUDR_P10 (0x1u << 10) /**< \brief (PIO_PUDR) Pull-Up Disable */ -#define PIO_PUDR_P11 (0x1u << 11) /**< \brief (PIO_PUDR) Pull-Up Disable */ -#define PIO_PUDR_P12 (0x1u << 12) /**< \brief (PIO_PUDR) Pull-Up Disable */ -#define PIO_PUDR_P13 (0x1u << 13) /**< \brief (PIO_PUDR) Pull-Up Disable */ -#define PIO_PUDR_P14 (0x1u << 14) /**< \brief (PIO_PUDR) Pull-Up Disable */ -#define PIO_PUDR_P15 (0x1u << 15) /**< \brief (PIO_PUDR) Pull-Up Disable */ -#define PIO_PUDR_P16 (0x1u << 16) /**< \brief (PIO_PUDR) Pull-Up Disable */ -#define PIO_PUDR_P17 (0x1u << 17) /**< \brief (PIO_PUDR) Pull-Up Disable */ -#define PIO_PUDR_P18 (0x1u << 18) /**< \brief (PIO_PUDR) Pull-Up Disable */ -#define PIO_PUDR_P19 (0x1u << 19) /**< \brief (PIO_PUDR) Pull-Up Disable */ -#define PIO_PUDR_P20 (0x1u << 20) /**< \brief (PIO_PUDR) Pull-Up Disable */ -#define PIO_PUDR_P21 (0x1u << 21) /**< \brief (PIO_PUDR) Pull-Up Disable */ -#define PIO_PUDR_P22 (0x1u << 22) /**< \brief (PIO_PUDR) Pull-Up Disable */ -#define PIO_PUDR_P23 (0x1u << 23) /**< \brief (PIO_PUDR) Pull-Up Disable */ -#define PIO_PUDR_P24 (0x1u << 24) /**< \brief (PIO_PUDR) Pull-Up Disable */ -#define PIO_PUDR_P25 (0x1u << 25) /**< \brief (PIO_PUDR) Pull-Up Disable */ -#define PIO_PUDR_P26 (0x1u << 26) /**< \brief (PIO_PUDR) Pull-Up Disable */ -#define PIO_PUDR_P27 (0x1u << 27) /**< \brief (PIO_PUDR) Pull-Up Disable */ -#define PIO_PUDR_P28 (0x1u << 28) /**< \brief (PIO_PUDR) Pull-Up Disable */ -#define PIO_PUDR_P29 (0x1u << 29) /**< \brief (PIO_PUDR) Pull-Up Disable */ -#define PIO_PUDR_P30 (0x1u << 30) /**< \brief (PIO_PUDR) Pull-Up Disable */ -#define PIO_PUDR_P31 (0x1u << 31) /**< \brief (PIO_PUDR) Pull-Up Disable */ -/* -------- PIO_PUER : (PIO Offset: 0x0064) Pull-up Enable Register -------- */ -#define PIO_PUER_P0 (0x1u << 0) /**< \brief (PIO_PUER) Pull-Up Enable */ -#define PIO_PUER_P1 (0x1u << 1) /**< \brief (PIO_PUER) Pull-Up Enable */ -#define PIO_PUER_P2 (0x1u << 2) /**< \brief (PIO_PUER) Pull-Up Enable */ -#define PIO_PUER_P3 (0x1u << 3) /**< \brief (PIO_PUER) Pull-Up Enable */ -#define PIO_PUER_P4 (0x1u << 4) /**< \brief (PIO_PUER) Pull-Up Enable */ -#define PIO_PUER_P5 (0x1u << 5) /**< \brief (PIO_PUER) Pull-Up Enable */ -#define PIO_PUER_P6 (0x1u << 6) /**< \brief (PIO_PUER) Pull-Up Enable */ -#define PIO_PUER_P7 (0x1u << 7) /**< \brief (PIO_PUER) Pull-Up Enable */ -#define PIO_PUER_P8 (0x1u << 8) /**< \brief (PIO_PUER) Pull-Up Enable */ -#define PIO_PUER_P9 (0x1u << 9) /**< \brief (PIO_PUER) Pull-Up Enable */ -#define PIO_PUER_P10 (0x1u << 10) /**< \brief (PIO_PUER) Pull-Up Enable */ -#define PIO_PUER_P11 (0x1u << 11) /**< \brief (PIO_PUER) Pull-Up Enable */ -#define PIO_PUER_P12 (0x1u << 12) /**< \brief (PIO_PUER) Pull-Up Enable */ -#define PIO_PUER_P13 (0x1u << 13) /**< \brief (PIO_PUER) Pull-Up Enable */ -#define PIO_PUER_P14 (0x1u << 14) /**< \brief (PIO_PUER) Pull-Up Enable */ -#define PIO_PUER_P15 (0x1u << 15) /**< \brief (PIO_PUER) Pull-Up Enable */ -#define PIO_PUER_P16 (0x1u << 16) /**< \brief (PIO_PUER) Pull-Up Enable */ -#define PIO_PUER_P17 (0x1u << 17) /**< \brief (PIO_PUER) Pull-Up Enable */ -#define PIO_PUER_P18 (0x1u << 18) /**< \brief (PIO_PUER) Pull-Up Enable */ -#define PIO_PUER_P19 (0x1u << 19) /**< \brief (PIO_PUER) Pull-Up Enable */ -#define PIO_PUER_P20 (0x1u << 20) /**< \brief (PIO_PUER) Pull-Up Enable */ -#define PIO_PUER_P21 (0x1u << 21) /**< \brief (PIO_PUER) Pull-Up Enable */ -#define PIO_PUER_P22 (0x1u << 22) /**< \brief (PIO_PUER) Pull-Up Enable */ -#define PIO_PUER_P23 (0x1u << 23) /**< \brief (PIO_PUER) Pull-Up Enable */ -#define PIO_PUER_P24 (0x1u << 24) /**< \brief (PIO_PUER) Pull-Up Enable */ -#define PIO_PUER_P25 (0x1u << 25) /**< \brief (PIO_PUER) Pull-Up Enable */ -#define PIO_PUER_P26 (0x1u << 26) /**< \brief (PIO_PUER) Pull-Up Enable */ -#define PIO_PUER_P27 (0x1u << 27) /**< \brief (PIO_PUER) Pull-Up Enable */ -#define PIO_PUER_P28 (0x1u << 28) /**< \brief (PIO_PUER) Pull-Up Enable */ -#define PIO_PUER_P29 (0x1u << 29) /**< \brief (PIO_PUER) Pull-Up Enable */ -#define PIO_PUER_P30 (0x1u << 30) /**< \brief (PIO_PUER) Pull-Up Enable */ -#define PIO_PUER_P31 (0x1u << 31) /**< \brief (PIO_PUER) Pull-Up Enable */ -/* -------- PIO_PUSR : (PIO Offset: 0x0068) Pad Pull-up Status Register -------- */ -#define PIO_PUSR_P0 (0x1u << 0) /**< \brief (PIO_PUSR) Pull-Up Status */ -#define PIO_PUSR_P1 (0x1u << 1) /**< \brief (PIO_PUSR) Pull-Up Status */ -#define PIO_PUSR_P2 (0x1u << 2) /**< \brief (PIO_PUSR) Pull-Up Status */ -#define PIO_PUSR_P3 (0x1u << 3) /**< \brief (PIO_PUSR) Pull-Up Status */ -#define PIO_PUSR_P4 (0x1u << 4) /**< \brief (PIO_PUSR) Pull-Up Status */ -#define PIO_PUSR_P5 (0x1u << 5) /**< \brief (PIO_PUSR) Pull-Up Status */ -#define PIO_PUSR_P6 (0x1u << 6) /**< \brief (PIO_PUSR) Pull-Up Status */ -#define PIO_PUSR_P7 (0x1u << 7) /**< \brief (PIO_PUSR) Pull-Up Status */ -#define PIO_PUSR_P8 (0x1u << 8) /**< \brief (PIO_PUSR) Pull-Up Status */ -#define PIO_PUSR_P9 (0x1u << 9) /**< \brief (PIO_PUSR) Pull-Up Status */ -#define PIO_PUSR_P10 (0x1u << 10) /**< \brief (PIO_PUSR) Pull-Up Status */ -#define PIO_PUSR_P11 (0x1u << 11) /**< \brief (PIO_PUSR) Pull-Up Status */ -#define PIO_PUSR_P12 (0x1u << 12) /**< \brief (PIO_PUSR) Pull-Up Status */ -#define PIO_PUSR_P13 (0x1u << 13) /**< \brief (PIO_PUSR) Pull-Up Status */ -#define PIO_PUSR_P14 (0x1u << 14) /**< \brief (PIO_PUSR) Pull-Up Status */ -#define PIO_PUSR_P15 (0x1u << 15) /**< \brief (PIO_PUSR) Pull-Up Status */ -#define PIO_PUSR_P16 (0x1u << 16) /**< \brief (PIO_PUSR) Pull-Up Status */ -#define PIO_PUSR_P17 (0x1u << 17) /**< \brief (PIO_PUSR) Pull-Up Status */ -#define PIO_PUSR_P18 (0x1u << 18) /**< \brief (PIO_PUSR) Pull-Up Status */ -#define PIO_PUSR_P19 (0x1u << 19) /**< \brief (PIO_PUSR) Pull-Up Status */ -#define PIO_PUSR_P20 (0x1u << 20) /**< \brief (PIO_PUSR) Pull-Up Status */ -#define PIO_PUSR_P21 (0x1u << 21) /**< \brief (PIO_PUSR) Pull-Up Status */ -#define PIO_PUSR_P22 (0x1u << 22) /**< \brief (PIO_PUSR) Pull-Up Status */ -#define PIO_PUSR_P23 (0x1u << 23) /**< \brief (PIO_PUSR) Pull-Up Status */ -#define PIO_PUSR_P24 (0x1u << 24) /**< \brief (PIO_PUSR) Pull-Up Status */ -#define PIO_PUSR_P25 (0x1u << 25) /**< \brief (PIO_PUSR) Pull-Up Status */ -#define PIO_PUSR_P26 (0x1u << 26) /**< \brief (PIO_PUSR) Pull-Up Status */ -#define PIO_PUSR_P27 (0x1u << 27) /**< \brief (PIO_PUSR) Pull-Up Status */ -#define PIO_PUSR_P28 (0x1u << 28) /**< \brief (PIO_PUSR) Pull-Up Status */ -#define PIO_PUSR_P29 (0x1u << 29) /**< \brief (PIO_PUSR) Pull-Up Status */ -#define PIO_PUSR_P30 (0x1u << 30) /**< \brief (PIO_PUSR) Pull-Up Status */ -#define PIO_PUSR_P31 (0x1u << 31) /**< \brief (PIO_PUSR) Pull-Up Status */ -/* -------- PIO_ABCDSR[2] : (PIO Offset: 0x0070) Peripheral Select Register -------- */ -#define PIO_ABCDSR_P0 (0x1u << 0) /**< \brief (PIO_ABCDSR[2]) Peripheral Select */ -#define PIO_ABCDSR_P1 (0x1u << 1) /**< \brief (PIO_ABCDSR[2]) Peripheral Select */ -#define PIO_ABCDSR_P2 (0x1u << 2) /**< \brief (PIO_ABCDSR[2]) Peripheral Select */ -#define PIO_ABCDSR_P3 (0x1u << 3) /**< \brief (PIO_ABCDSR[2]) Peripheral Select */ -#define PIO_ABCDSR_P4 (0x1u << 4) /**< \brief (PIO_ABCDSR[2]) Peripheral Select */ -#define PIO_ABCDSR_P5 (0x1u << 5) /**< \brief (PIO_ABCDSR[2]) Peripheral Select */ -#define PIO_ABCDSR_P6 (0x1u << 6) /**< \brief (PIO_ABCDSR[2]) Peripheral Select */ -#define PIO_ABCDSR_P7 (0x1u << 7) /**< \brief (PIO_ABCDSR[2]) Peripheral Select */ -#define PIO_ABCDSR_P8 (0x1u << 8) /**< \brief (PIO_ABCDSR[2]) Peripheral Select */ -#define PIO_ABCDSR_P9 (0x1u << 9) /**< \brief (PIO_ABCDSR[2]) Peripheral Select */ -#define PIO_ABCDSR_P10 (0x1u << 10) /**< \brief (PIO_ABCDSR[2]) Peripheral Select */ -#define PIO_ABCDSR_P11 (0x1u << 11) /**< \brief (PIO_ABCDSR[2]) Peripheral Select */ -#define PIO_ABCDSR_P12 (0x1u << 12) /**< \brief (PIO_ABCDSR[2]) Peripheral Select */ -#define PIO_ABCDSR_P13 (0x1u << 13) /**< \brief (PIO_ABCDSR[2]) Peripheral Select */ -#define PIO_ABCDSR_P14 (0x1u << 14) /**< \brief (PIO_ABCDSR[2]) Peripheral Select */ -#define PIO_ABCDSR_P15 (0x1u << 15) /**< \brief (PIO_ABCDSR[2]) Peripheral Select */ -#define PIO_ABCDSR_P16 (0x1u << 16) /**< \brief (PIO_ABCDSR[2]) Peripheral Select */ -#define PIO_ABCDSR_P17 (0x1u << 17) /**< \brief (PIO_ABCDSR[2]) Peripheral Select */ -#define PIO_ABCDSR_P18 (0x1u << 18) /**< \brief (PIO_ABCDSR[2]) Peripheral Select */ -#define PIO_ABCDSR_P19 (0x1u << 19) /**< \brief (PIO_ABCDSR[2]) Peripheral Select */ -#define PIO_ABCDSR_P20 (0x1u << 20) /**< \brief (PIO_ABCDSR[2]) Peripheral Select */ -#define PIO_ABCDSR_P21 (0x1u << 21) /**< \brief (PIO_ABCDSR[2]) Peripheral Select */ -#define PIO_ABCDSR_P22 (0x1u << 22) /**< \brief (PIO_ABCDSR[2]) Peripheral Select */ -#define PIO_ABCDSR_P23 (0x1u << 23) /**< \brief (PIO_ABCDSR[2]) Peripheral Select */ -#define PIO_ABCDSR_P24 (0x1u << 24) /**< \brief (PIO_ABCDSR[2]) Peripheral Select */ -#define PIO_ABCDSR_P25 (0x1u << 25) /**< \brief (PIO_ABCDSR[2]) Peripheral Select */ -#define PIO_ABCDSR_P26 (0x1u << 26) /**< \brief (PIO_ABCDSR[2]) Peripheral Select */ -#define PIO_ABCDSR_P27 (0x1u << 27) /**< \brief (PIO_ABCDSR[2]) Peripheral Select */ -#define PIO_ABCDSR_P28 (0x1u << 28) /**< \brief (PIO_ABCDSR[2]) Peripheral Select */ -#define PIO_ABCDSR_P29 (0x1u << 29) /**< \brief (PIO_ABCDSR[2]) Peripheral Select */ -#define PIO_ABCDSR_P30 (0x1u << 30) /**< \brief (PIO_ABCDSR[2]) Peripheral Select */ -#define PIO_ABCDSR_P31 (0x1u << 31) /**< \brief (PIO_ABCDSR[2]) Peripheral Select */ -/* -------- PIO_IFSCDR : (PIO Offset: 0x0080) Input Filter Slow Clock Disable Register -------- */ -#define PIO_IFSCDR_P0 (0x1u << 0) /**< \brief (PIO_IFSCDR) Peripheral Clock Glitch Filtering Select */ -#define PIO_IFSCDR_P1 (0x1u << 1) /**< \brief (PIO_IFSCDR) Peripheral Clock Glitch Filtering Select */ -#define PIO_IFSCDR_P2 (0x1u << 2) /**< \brief (PIO_IFSCDR) Peripheral Clock Glitch Filtering Select */ -#define PIO_IFSCDR_P3 (0x1u << 3) /**< \brief (PIO_IFSCDR) Peripheral Clock Glitch Filtering Select */ -#define PIO_IFSCDR_P4 (0x1u << 4) /**< \brief (PIO_IFSCDR) Peripheral Clock Glitch Filtering Select */ -#define PIO_IFSCDR_P5 (0x1u << 5) /**< \brief (PIO_IFSCDR) Peripheral Clock Glitch Filtering Select */ -#define PIO_IFSCDR_P6 (0x1u << 6) /**< \brief (PIO_IFSCDR) Peripheral Clock Glitch Filtering Select */ -#define PIO_IFSCDR_P7 (0x1u << 7) /**< \brief (PIO_IFSCDR) Peripheral Clock Glitch Filtering Select */ -#define PIO_IFSCDR_P8 (0x1u << 8) /**< \brief (PIO_IFSCDR) Peripheral Clock Glitch Filtering Select */ -#define PIO_IFSCDR_P9 (0x1u << 9) /**< \brief (PIO_IFSCDR) Peripheral Clock Glitch Filtering Select */ -#define PIO_IFSCDR_P10 (0x1u << 10) /**< \brief (PIO_IFSCDR) Peripheral Clock Glitch Filtering Select */ -#define PIO_IFSCDR_P11 (0x1u << 11) /**< \brief (PIO_IFSCDR) Peripheral Clock Glitch Filtering Select */ -#define PIO_IFSCDR_P12 (0x1u << 12) /**< \brief (PIO_IFSCDR) Peripheral Clock Glitch Filtering Select */ -#define PIO_IFSCDR_P13 (0x1u << 13) /**< \brief (PIO_IFSCDR) Peripheral Clock Glitch Filtering Select */ -#define PIO_IFSCDR_P14 (0x1u << 14) /**< \brief (PIO_IFSCDR) Peripheral Clock Glitch Filtering Select */ -#define PIO_IFSCDR_P15 (0x1u << 15) /**< \brief (PIO_IFSCDR) Peripheral Clock Glitch Filtering Select */ -#define PIO_IFSCDR_P16 (0x1u << 16) /**< \brief (PIO_IFSCDR) Peripheral Clock Glitch Filtering Select */ -#define PIO_IFSCDR_P17 (0x1u << 17) /**< \brief (PIO_IFSCDR) Peripheral Clock Glitch Filtering Select */ -#define PIO_IFSCDR_P18 (0x1u << 18) /**< \brief (PIO_IFSCDR) Peripheral Clock Glitch Filtering Select */ -#define PIO_IFSCDR_P19 (0x1u << 19) /**< \brief (PIO_IFSCDR) Peripheral Clock Glitch Filtering Select */ -#define PIO_IFSCDR_P20 (0x1u << 20) /**< \brief (PIO_IFSCDR) Peripheral Clock Glitch Filtering Select */ -#define PIO_IFSCDR_P21 (0x1u << 21) /**< \brief (PIO_IFSCDR) Peripheral Clock Glitch Filtering Select */ -#define PIO_IFSCDR_P22 (0x1u << 22) /**< \brief (PIO_IFSCDR) Peripheral Clock Glitch Filtering Select */ -#define PIO_IFSCDR_P23 (0x1u << 23) /**< \brief (PIO_IFSCDR) Peripheral Clock Glitch Filtering Select */ -#define PIO_IFSCDR_P24 (0x1u << 24) /**< \brief (PIO_IFSCDR) Peripheral Clock Glitch Filtering Select */ -#define PIO_IFSCDR_P25 (0x1u << 25) /**< \brief (PIO_IFSCDR) Peripheral Clock Glitch Filtering Select */ -#define PIO_IFSCDR_P26 (0x1u << 26) /**< \brief (PIO_IFSCDR) Peripheral Clock Glitch Filtering Select */ -#define PIO_IFSCDR_P27 (0x1u << 27) /**< \brief (PIO_IFSCDR) Peripheral Clock Glitch Filtering Select */ -#define PIO_IFSCDR_P28 (0x1u << 28) /**< \brief (PIO_IFSCDR) Peripheral Clock Glitch Filtering Select */ -#define PIO_IFSCDR_P29 (0x1u << 29) /**< \brief (PIO_IFSCDR) Peripheral Clock Glitch Filtering Select */ -#define PIO_IFSCDR_P30 (0x1u << 30) /**< \brief (PIO_IFSCDR) Peripheral Clock Glitch Filtering Select */ -#define PIO_IFSCDR_P31 (0x1u << 31) /**< \brief (PIO_IFSCDR) Peripheral Clock Glitch Filtering Select */ -/* -------- PIO_IFSCER : (PIO Offset: 0x0084) Input Filter Slow Clock Enable Register -------- */ -#define PIO_IFSCER_P0 (0x1u << 0) /**< \brief (PIO_IFSCER) Slow Clock Debouncing Filtering Select */ -#define PIO_IFSCER_P1 (0x1u << 1) /**< \brief (PIO_IFSCER) Slow Clock Debouncing Filtering Select */ -#define PIO_IFSCER_P2 (0x1u << 2) /**< \brief (PIO_IFSCER) Slow Clock Debouncing Filtering Select */ -#define PIO_IFSCER_P3 (0x1u << 3) /**< \brief (PIO_IFSCER) Slow Clock Debouncing Filtering Select */ -#define PIO_IFSCER_P4 (0x1u << 4) /**< \brief (PIO_IFSCER) Slow Clock Debouncing Filtering Select */ -#define PIO_IFSCER_P5 (0x1u << 5) /**< \brief (PIO_IFSCER) Slow Clock Debouncing Filtering Select */ -#define PIO_IFSCER_P6 (0x1u << 6) /**< \brief (PIO_IFSCER) Slow Clock Debouncing Filtering Select */ -#define PIO_IFSCER_P7 (0x1u << 7) /**< \brief (PIO_IFSCER) Slow Clock Debouncing Filtering Select */ -#define PIO_IFSCER_P8 (0x1u << 8) /**< \brief (PIO_IFSCER) Slow Clock Debouncing Filtering Select */ -#define PIO_IFSCER_P9 (0x1u << 9) /**< \brief (PIO_IFSCER) Slow Clock Debouncing Filtering Select */ -#define PIO_IFSCER_P10 (0x1u << 10) /**< \brief (PIO_IFSCER) Slow Clock Debouncing Filtering Select */ -#define PIO_IFSCER_P11 (0x1u << 11) /**< \brief (PIO_IFSCER) Slow Clock Debouncing Filtering Select */ -#define PIO_IFSCER_P12 (0x1u << 12) /**< \brief (PIO_IFSCER) Slow Clock Debouncing Filtering Select */ -#define PIO_IFSCER_P13 (0x1u << 13) /**< \brief (PIO_IFSCER) Slow Clock Debouncing Filtering Select */ -#define PIO_IFSCER_P14 (0x1u << 14) /**< \brief (PIO_IFSCER) Slow Clock Debouncing Filtering Select */ -#define PIO_IFSCER_P15 (0x1u << 15) /**< \brief (PIO_IFSCER) Slow Clock Debouncing Filtering Select */ -#define PIO_IFSCER_P16 (0x1u << 16) /**< \brief (PIO_IFSCER) Slow Clock Debouncing Filtering Select */ -#define PIO_IFSCER_P17 (0x1u << 17) /**< \brief (PIO_IFSCER) Slow Clock Debouncing Filtering Select */ -#define PIO_IFSCER_P18 (0x1u << 18) /**< \brief (PIO_IFSCER) Slow Clock Debouncing Filtering Select */ -#define PIO_IFSCER_P19 (0x1u << 19) /**< \brief (PIO_IFSCER) Slow Clock Debouncing Filtering Select */ -#define PIO_IFSCER_P20 (0x1u << 20) /**< \brief (PIO_IFSCER) Slow Clock Debouncing Filtering Select */ -#define PIO_IFSCER_P21 (0x1u << 21) /**< \brief (PIO_IFSCER) Slow Clock Debouncing Filtering Select */ -#define PIO_IFSCER_P22 (0x1u << 22) /**< \brief (PIO_IFSCER) Slow Clock Debouncing Filtering Select */ -#define PIO_IFSCER_P23 (0x1u << 23) /**< \brief (PIO_IFSCER) Slow Clock Debouncing Filtering Select */ -#define PIO_IFSCER_P24 (0x1u << 24) /**< \brief (PIO_IFSCER) Slow Clock Debouncing Filtering Select */ -#define PIO_IFSCER_P25 (0x1u << 25) /**< \brief (PIO_IFSCER) Slow Clock Debouncing Filtering Select */ -#define PIO_IFSCER_P26 (0x1u << 26) /**< \brief (PIO_IFSCER) Slow Clock Debouncing Filtering Select */ -#define PIO_IFSCER_P27 (0x1u << 27) /**< \brief (PIO_IFSCER) Slow Clock Debouncing Filtering Select */ -#define PIO_IFSCER_P28 (0x1u << 28) /**< \brief (PIO_IFSCER) Slow Clock Debouncing Filtering Select */ -#define PIO_IFSCER_P29 (0x1u << 29) /**< \brief (PIO_IFSCER) Slow Clock Debouncing Filtering Select */ -#define PIO_IFSCER_P30 (0x1u << 30) /**< \brief (PIO_IFSCER) Slow Clock Debouncing Filtering Select */ -#define PIO_IFSCER_P31 (0x1u << 31) /**< \brief (PIO_IFSCER) Slow Clock Debouncing Filtering Select */ -/* -------- PIO_IFSCSR : (PIO Offset: 0x0088) Input Filter Slow Clock Status Register -------- */ -#define PIO_IFSCSR_P0 (0x1u << 0) /**< \brief (PIO_IFSCSR) Glitch or Debouncing Filter Selection Status */ -#define PIO_IFSCSR_P1 (0x1u << 1) /**< \brief (PIO_IFSCSR) Glitch or Debouncing Filter Selection Status */ -#define PIO_IFSCSR_P2 (0x1u << 2) /**< \brief (PIO_IFSCSR) Glitch or Debouncing Filter Selection Status */ -#define PIO_IFSCSR_P3 (0x1u << 3) /**< \brief (PIO_IFSCSR) Glitch or Debouncing Filter Selection Status */ -#define PIO_IFSCSR_P4 (0x1u << 4) /**< \brief (PIO_IFSCSR) Glitch or Debouncing Filter Selection Status */ -#define PIO_IFSCSR_P5 (0x1u << 5) /**< \brief (PIO_IFSCSR) Glitch or Debouncing Filter Selection Status */ -#define PIO_IFSCSR_P6 (0x1u << 6) /**< \brief (PIO_IFSCSR) Glitch or Debouncing Filter Selection Status */ -#define PIO_IFSCSR_P7 (0x1u << 7) /**< \brief (PIO_IFSCSR) Glitch or Debouncing Filter Selection Status */ -#define PIO_IFSCSR_P8 (0x1u << 8) /**< \brief (PIO_IFSCSR) Glitch or Debouncing Filter Selection Status */ -#define PIO_IFSCSR_P9 (0x1u << 9) /**< \brief (PIO_IFSCSR) Glitch or Debouncing Filter Selection Status */ -#define PIO_IFSCSR_P10 (0x1u << 10) /**< \brief (PIO_IFSCSR) Glitch or Debouncing Filter Selection Status */ -#define PIO_IFSCSR_P11 (0x1u << 11) /**< \brief (PIO_IFSCSR) Glitch or Debouncing Filter Selection Status */ -#define PIO_IFSCSR_P12 (0x1u << 12) /**< \brief (PIO_IFSCSR) Glitch or Debouncing Filter Selection Status */ -#define PIO_IFSCSR_P13 (0x1u << 13) /**< \brief (PIO_IFSCSR) Glitch or Debouncing Filter Selection Status */ -#define PIO_IFSCSR_P14 (0x1u << 14) /**< \brief (PIO_IFSCSR) Glitch or Debouncing Filter Selection Status */ -#define PIO_IFSCSR_P15 (0x1u << 15) /**< \brief (PIO_IFSCSR) Glitch or Debouncing Filter Selection Status */ -#define PIO_IFSCSR_P16 (0x1u << 16) /**< \brief (PIO_IFSCSR) Glitch or Debouncing Filter Selection Status */ -#define PIO_IFSCSR_P17 (0x1u << 17) /**< \brief (PIO_IFSCSR) Glitch or Debouncing Filter Selection Status */ -#define PIO_IFSCSR_P18 (0x1u << 18) /**< \brief (PIO_IFSCSR) Glitch or Debouncing Filter Selection Status */ -#define PIO_IFSCSR_P19 (0x1u << 19) /**< \brief (PIO_IFSCSR) Glitch or Debouncing Filter Selection Status */ -#define PIO_IFSCSR_P20 (0x1u << 20) /**< \brief (PIO_IFSCSR) Glitch or Debouncing Filter Selection Status */ -#define PIO_IFSCSR_P21 (0x1u << 21) /**< \brief (PIO_IFSCSR) Glitch or Debouncing Filter Selection Status */ -#define PIO_IFSCSR_P22 (0x1u << 22) /**< \brief (PIO_IFSCSR) Glitch or Debouncing Filter Selection Status */ -#define PIO_IFSCSR_P23 (0x1u << 23) /**< \brief (PIO_IFSCSR) Glitch or Debouncing Filter Selection Status */ -#define PIO_IFSCSR_P24 (0x1u << 24) /**< \brief (PIO_IFSCSR) Glitch or Debouncing Filter Selection Status */ -#define PIO_IFSCSR_P25 (0x1u << 25) /**< \brief (PIO_IFSCSR) Glitch or Debouncing Filter Selection Status */ -#define PIO_IFSCSR_P26 (0x1u << 26) /**< \brief (PIO_IFSCSR) Glitch or Debouncing Filter Selection Status */ -#define PIO_IFSCSR_P27 (0x1u << 27) /**< \brief (PIO_IFSCSR) Glitch or Debouncing Filter Selection Status */ -#define PIO_IFSCSR_P28 (0x1u << 28) /**< \brief (PIO_IFSCSR) Glitch or Debouncing Filter Selection Status */ -#define PIO_IFSCSR_P29 (0x1u << 29) /**< \brief (PIO_IFSCSR) Glitch or Debouncing Filter Selection Status */ -#define PIO_IFSCSR_P30 (0x1u << 30) /**< \brief (PIO_IFSCSR) Glitch or Debouncing Filter Selection Status */ -#define PIO_IFSCSR_P31 (0x1u << 31) /**< \brief (PIO_IFSCSR) Glitch or Debouncing Filter Selection Status */ -/* -------- PIO_SCDR : (PIO Offset: 0x008C) Slow Clock Divider Debouncing Register -------- */ -#define PIO_SCDR_DIV_Pos 0 -#define PIO_SCDR_DIV_Msk (0x3fffu << PIO_SCDR_DIV_Pos) /**< \brief (PIO_SCDR) Slow Clock Divider Selection for Debouncing */ -#define PIO_SCDR_DIV(value) ((PIO_SCDR_DIV_Msk & ((value) << PIO_SCDR_DIV_Pos))) -/* -------- PIO_PPDDR : (PIO Offset: 0x0090) Pad Pull-down Disable Register -------- */ -#define PIO_PPDDR_P0 (0x1u << 0) /**< \brief (PIO_PPDDR) Pull-Down Disable */ -#define PIO_PPDDR_P1 (0x1u << 1) /**< \brief (PIO_PPDDR) Pull-Down Disable */ -#define PIO_PPDDR_P2 (0x1u << 2) /**< \brief (PIO_PPDDR) Pull-Down Disable */ -#define PIO_PPDDR_P3 (0x1u << 3) /**< \brief (PIO_PPDDR) Pull-Down Disable */ -#define PIO_PPDDR_P4 (0x1u << 4) /**< \brief (PIO_PPDDR) Pull-Down Disable */ -#define PIO_PPDDR_P5 (0x1u << 5) /**< \brief (PIO_PPDDR) Pull-Down Disable */ -#define PIO_PPDDR_P6 (0x1u << 6) /**< \brief (PIO_PPDDR) Pull-Down Disable */ -#define PIO_PPDDR_P7 (0x1u << 7) /**< \brief (PIO_PPDDR) Pull-Down Disable */ -#define PIO_PPDDR_P8 (0x1u << 8) /**< \brief (PIO_PPDDR) Pull-Down Disable */ -#define PIO_PPDDR_P9 (0x1u << 9) /**< \brief (PIO_PPDDR) Pull-Down Disable */ -#define PIO_PPDDR_P10 (0x1u << 10) /**< \brief (PIO_PPDDR) Pull-Down Disable */ -#define PIO_PPDDR_P11 (0x1u << 11) /**< \brief (PIO_PPDDR) Pull-Down Disable */ -#define PIO_PPDDR_P12 (0x1u << 12) /**< \brief (PIO_PPDDR) Pull-Down Disable */ -#define PIO_PPDDR_P13 (0x1u << 13) /**< \brief (PIO_PPDDR) Pull-Down Disable */ -#define PIO_PPDDR_P14 (0x1u << 14) /**< \brief (PIO_PPDDR) Pull-Down Disable */ -#define PIO_PPDDR_P15 (0x1u << 15) /**< \brief (PIO_PPDDR) Pull-Down Disable */ -#define PIO_PPDDR_P16 (0x1u << 16) /**< \brief (PIO_PPDDR) Pull-Down Disable */ -#define PIO_PPDDR_P17 (0x1u << 17) /**< \brief (PIO_PPDDR) Pull-Down Disable */ -#define PIO_PPDDR_P18 (0x1u << 18) /**< \brief (PIO_PPDDR) Pull-Down Disable */ -#define PIO_PPDDR_P19 (0x1u << 19) /**< \brief (PIO_PPDDR) Pull-Down Disable */ -#define PIO_PPDDR_P20 (0x1u << 20) /**< \brief (PIO_PPDDR) Pull-Down Disable */ -#define PIO_PPDDR_P21 (0x1u << 21) /**< \brief (PIO_PPDDR) Pull-Down Disable */ -#define PIO_PPDDR_P22 (0x1u << 22) /**< \brief (PIO_PPDDR) Pull-Down Disable */ -#define PIO_PPDDR_P23 (0x1u << 23) /**< \brief (PIO_PPDDR) Pull-Down Disable */ -#define PIO_PPDDR_P24 (0x1u << 24) /**< \brief (PIO_PPDDR) Pull-Down Disable */ -#define PIO_PPDDR_P25 (0x1u << 25) /**< \brief (PIO_PPDDR) Pull-Down Disable */ -#define PIO_PPDDR_P26 (0x1u << 26) /**< \brief (PIO_PPDDR) Pull-Down Disable */ -#define PIO_PPDDR_P27 (0x1u << 27) /**< \brief (PIO_PPDDR) Pull-Down Disable */ -#define PIO_PPDDR_P28 (0x1u << 28) /**< \brief (PIO_PPDDR) Pull-Down Disable */ -#define PIO_PPDDR_P29 (0x1u << 29) /**< \brief (PIO_PPDDR) Pull-Down Disable */ -#define PIO_PPDDR_P30 (0x1u << 30) /**< \brief (PIO_PPDDR) Pull-Down Disable */ -#define PIO_PPDDR_P31 (0x1u << 31) /**< \brief (PIO_PPDDR) Pull-Down Disable */ -/* -------- PIO_PPDER : (PIO Offset: 0x0094) Pad Pull-down Enable Register -------- */ -#define PIO_PPDER_P0 (0x1u << 0) /**< \brief (PIO_PPDER) Pull-Down Enable */ -#define PIO_PPDER_P1 (0x1u << 1) /**< \brief (PIO_PPDER) Pull-Down Enable */ -#define PIO_PPDER_P2 (0x1u << 2) /**< \brief (PIO_PPDER) Pull-Down Enable */ -#define PIO_PPDER_P3 (0x1u << 3) /**< \brief (PIO_PPDER) Pull-Down Enable */ -#define PIO_PPDER_P4 (0x1u << 4) /**< \brief (PIO_PPDER) Pull-Down Enable */ -#define PIO_PPDER_P5 (0x1u << 5) /**< \brief (PIO_PPDER) Pull-Down Enable */ -#define PIO_PPDER_P6 (0x1u << 6) /**< \brief (PIO_PPDER) Pull-Down Enable */ -#define PIO_PPDER_P7 (0x1u << 7) /**< \brief (PIO_PPDER) Pull-Down Enable */ -#define PIO_PPDER_P8 (0x1u << 8) /**< \brief (PIO_PPDER) Pull-Down Enable */ -#define PIO_PPDER_P9 (0x1u << 9) /**< \brief (PIO_PPDER) Pull-Down Enable */ -#define PIO_PPDER_P10 (0x1u << 10) /**< \brief (PIO_PPDER) Pull-Down Enable */ -#define PIO_PPDER_P11 (0x1u << 11) /**< \brief (PIO_PPDER) Pull-Down Enable */ -#define PIO_PPDER_P12 (0x1u << 12) /**< \brief (PIO_PPDER) Pull-Down Enable */ -#define PIO_PPDER_P13 (0x1u << 13) /**< \brief (PIO_PPDER) Pull-Down Enable */ -#define PIO_PPDER_P14 (0x1u << 14) /**< \brief (PIO_PPDER) Pull-Down Enable */ -#define PIO_PPDER_P15 (0x1u << 15) /**< \brief (PIO_PPDER) Pull-Down Enable */ -#define PIO_PPDER_P16 (0x1u << 16) /**< \brief (PIO_PPDER) Pull-Down Enable */ -#define PIO_PPDER_P17 (0x1u << 17) /**< \brief (PIO_PPDER) Pull-Down Enable */ -#define PIO_PPDER_P18 (0x1u << 18) /**< \brief (PIO_PPDER) Pull-Down Enable */ -#define PIO_PPDER_P19 (0x1u << 19) /**< \brief (PIO_PPDER) Pull-Down Enable */ -#define PIO_PPDER_P20 (0x1u << 20) /**< \brief (PIO_PPDER) Pull-Down Enable */ -#define PIO_PPDER_P21 (0x1u << 21) /**< \brief (PIO_PPDER) Pull-Down Enable */ -#define PIO_PPDER_P22 (0x1u << 22) /**< \brief (PIO_PPDER) Pull-Down Enable */ -#define PIO_PPDER_P23 (0x1u << 23) /**< \brief (PIO_PPDER) Pull-Down Enable */ -#define PIO_PPDER_P24 (0x1u << 24) /**< \brief (PIO_PPDER) Pull-Down Enable */ -#define PIO_PPDER_P25 (0x1u << 25) /**< \brief (PIO_PPDER) Pull-Down Enable */ -#define PIO_PPDER_P26 (0x1u << 26) /**< \brief (PIO_PPDER) Pull-Down Enable */ -#define PIO_PPDER_P27 (0x1u << 27) /**< \brief (PIO_PPDER) Pull-Down Enable */ -#define PIO_PPDER_P28 (0x1u << 28) /**< \brief (PIO_PPDER) Pull-Down Enable */ -#define PIO_PPDER_P29 (0x1u << 29) /**< \brief (PIO_PPDER) Pull-Down Enable */ -#define PIO_PPDER_P30 (0x1u << 30) /**< \brief (PIO_PPDER) Pull-Down Enable */ -#define PIO_PPDER_P31 (0x1u << 31) /**< \brief (PIO_PPDER) Pull-Down Enable */ -/* -------- PIO_PPDSR : (PIO Offset: 0x0098) Pad Pull-down Status Register -------- */ -#define PIO_PPDSR_P0 (0x1u << 0) /**< \brief (PIO_PPDSR) Pull-Down Status */ -#define PIO_PPDSR_P1 (0x1u << 1) /**< \brief (PIO_PPDSR) Pull-Down Status */ -#define PIO_PPDSR_P2 (0x1u << 2) /**< \brief (PIO_PPDSR) Pull-Down Status */ -#define PIO_PPDSR_P3 (0x1u << 3) /**< \brief (PIO_PPDSR) Pull-Down Status */ -#define PIO_PPDSR_P4 (0x1u << 4) /**< \brief (PIO_PPDSR) Pull-Down Status */ -#define PIO_PPDSR_P5 (0x1u << 5) /**< \brief (PIO_PPDSR) Pull-Down Status */ -#define PIO_PPDSR_P6 (0x1u << 6) /**< \brief (PIO_PPDSR) Pull-Down Status */ -#define PIO_PPDSR_P7 (0x1u << 7) /**< \brief (PIO_PPDSR) Pull-Down Status */ -#define PIO_PPDSR_P8 (0x1u << 8) /**< \brief (PIO_PPDSR) Pull-Down Status */ -#define PIO_PPDSR_P9 (0x1u << 9) /**< \brief (PIO_PPDSR) Pull-Down Status */ -#define PIO_PPDSR_P10 (0x1u << 10) /**< \brief (PIO_PPDSR) Pull-Down Status */ -#define PIO_PPDSR_P11 (0x1u << 11) /**< \brief (PIO_PPDSR) Pull-Down Status */ -#define PIO_PPDSR_P12 (0x1u << 12) /**< \brief (PIO_PPDSR) Pull-Down Status */ -#define PIO_PPDSR_P13 (0x1u << 13) /**< \brief (PIO_PPDSR) Pull-Down Status */ -#define PIO_PPDSR_P14 (0x1u << 14) /**< \brief (PIO_PPDSR) Pull-Down Status */ -#define PIO_PPDSR_P15 (0x1u << 15) /**< \brief (PIO_PPDSR) Pull-Down Status */ -#define PIO_PPDSR_P16 (0x1u << 16) /**< \brief (PIO_PPDSR) Pull-Down Status */ -#define PIO_PPDSR_P17 (0x1u << 17) /**< \brief (PIO_PPDSR) Pull-Down Status */ -#define PIO_PPDSR_P18 (0x1u << 18) /**< \brief (PIO_PPDSR) Pull-Down Status */ -#define PIO_PPDSR_P19 (0x1u << 19) /**< \brief (PIO_PPDSR) Pull-Down Status */ -#define PIO_PPDSR_P20 (0x1u << 20) /**< \brief (PIO_PPDSR) Pull-Down Status */ -#define PIO_PPDSR_P21 (0x1u << 21) /**< \brief (PIO_PPDSR) Pull-Down Status */ -#define PIO_PPDSR_P22 (0x1u << 22) /**< \brief (PIO_PPDSR) Pull-Down Status */ -#define PIO_PPDSR_P23 (0x1u << 23) /**< \brief (PIO_PPDSR) Pull-Down Status */ -#define PIO_PPDSR_P24 (0x1u << 24) /**< \brief (PIO_PPDSR) Pull-Down Status */ -#define PIO_PPDSR_P25 (0x1u << 25) /**< \brief (PIO_PPDSR) Pull-Down Status */ -#define PIO_PPDSR_P26 (0x1u << 26) /**< \brief (PIO_PPDSR) Pull-Down Status */ -#define PIO_PPDSR_P27 (0x1u << 27) /**< \brief (PIO_PPDSR) Pull-Down Status */ -#define PIO_PPDSR_P28 (0x1u << 28) /**< \brief (PIO_PPDSR) Pull-Down Status */ -#define PIO_PPDSR_P29 (0x1u << 29) /**< \brief (PIO_PPDSR) Pull-Down Status */ -#define PIO_PPDSR_P30 (0x1u << 30) /**< \brief (PIO_PPDSR) Pull-Down Status */ -#define PIO_PPDSR_P31 (0x1u << 31) /**< \brief (PIO_PPDSR) Pull-Down Status */ -/* -------- PIO_OWER : (PIO Offset: 0x00A0) Output Write Enable -------- */ -#define PIO_OWER_P0 (0x1u << 0) /**< \brief (PIO_OWER) Output Write Enable */ -#define PIO_OWER_P1 (0x1u << 1) /**< \brief (PIO_OWER) Output Write Enable */ -#define PIO_OWER_P2 (0x1u << 2) /**< \brief (PIO_OWER) Output Write Enable */ -#define PIO_OWER_P3 (0x1u << 3) /**< \brief (PIO_OWER) Output Write Enable */ -#define PIO_OWER_P4 (0x1u << 4) /**< \brief (PIO_OWER) Output Write Enable */ -#define PIO_OWER_P5 (0x1u << 5) /**< \brief (PIO_OWER) Output Write Enable */ -#define PIO_OWER_P6 (0x1u << 6) /**< \brief (PIO_OWER) Output Write Enable */ -#define PIO_OWER_P7 (0x1u << 7) /**< \brief (PIO_OWER) Output Write Enable */ -#define PIO_OWER_P8 (0x1u << 8) /**< \brief (PIO_OWER) Output Write Enable */ -#define PIO_OWER_P9 (0x1u << 9) /**< \brief (PIO_OWER) Output Write Enable */ -#define PIO_OWER_P10 (0x1u << 10) /**< \brief (PIO_OWER) Output Write Enable */ -#define PIO_OWER_P11 (0x1u << 11) /**< \brief (PIO_OWER) Output Write Enable */ -#define PIO_OWER_P12 (0x1u << 12) /**< \brief (PIO_OWER) Output Write Enable */ -#define PIO_OWER_P13 (0x1u << 13) /**< \brief (PIO_OWER) Output Write Enable */ -#define PIO_OWER_P14 (0x1u << 14) /**< \brief (PIO_OWER) Output Write Enable */ -#define PIO_OWER_P15 (0x1u << 15) /**< \brief (PIO_OWER) Output Write Enable */ -#define PIO_OWER_P16 (0x1u << 16) /**< \brief (PIO_OWER) Output Write Enable */ -#define PIO_OWER_P17 (0x1u << 17) /**< \brief (PIO_OWER) Output Write Enable */ -#define PIO_OWER_P18 (0x1u << 18) /**< \brief (PIO_OWER) Output Write Enable */ -#define PIO_OWER_P19 (0x1u << 19) /**< \brief (PIO_OWER) Output Write Enable */ -#define PIO_OWER_P20 (0x1u << 20) /**< \brief (PIO_OWER) Output Write Enable */ -#define PIO_OWER_P21 (0x1u << 21) /**< \brief (PIO_OWER) Output Write Enable */ -#define PIO_OWER_P22 (0x1u << 22) /**< \brief (PIO_OWER) Output Write Enable */ -#define PIO_OWER_P23 (0x1u << 23) /**< \brief (PIO_OWER) Output Write Enable */ -#define PIO_OWER_P24 (0x1u << 24) /**< \brief (PIO_OWER) Output Write Enable */ -#define PIO_OWER_P25 (0x1u << 25) /**< \brief (PIO_OWER) Output Write Enable */ -#define PIO_OWER_P26 (0x1u << 26) /**< \brief (PIO_OWER) Output Write Enable */ -#define PIO_OWER_P27 (0x1u << 27) /**< \brief (PIO_OWER) Output Write Enable */ -#define PIO_OWER_P28 (0x1u << 28) /**< \brief (PIO_OWER) Output Write Enable */ -#define PIO_OWER_P29 (0x1u << 29) /**< \brief (PIO_OWER) Output Write Enable */ -#define PIO_OWER_P30 (0x1u << 30) /**< \brief (PIO_OWER) Output Write Enable */ -#define PIO_OWER_P31 (0x1u << 31) /**< \brief (PIO_OWER) Output Write Enable */ -/* -------- PIO_OWDR : (PIO Offset: 0x00A4) Output Write Disable -------- */ -#define PIO_OWDR_P0 (0x1u << 0) /**< \brief (PIO_OWDR) Output Write Disable */ -#define PIO_OWDR_P1 (0x1u << 1) /**< \brief (PIO_OWDR) Output Write Disable */ -#define PIO_OWDR_P2 (0x1u << 2) /**< \brief (PIO_OWDR) Output Write Disable */ -#define PIO_OWDR_P3 (0x1u << 3) /**< \brief (PIO_OWDR) Output Write Disable */ -#define PIO_OWDR_P4 (0x1u << 4) /**< \brief (PIO_OWDR) Output Write Disable */ -#define PIO_OWDR_P5 (0x1u << 5) /**< \brief (PIO_OWDR) Output Write Disable */ -#define PIO_OWDR_P6 (0x1u << 6) /**< \brief (PIO_OWDR) Output Write Disable */ -#define PIO_OWDR_P7 (0x1u << 7) /**< \brief (PIO_OWDR) Output Write Disable */ -#define PIO_OWDR_P8 (0x1u << 8) /**< \brief (PIO_OWDR) Output Write Disable */ -#define PIO_OWDR_P9 (0x1u << 9) /**< \brief (PIO_OWDR) Output Write Disable */ -#define PIO_OWDR_P10 (0x1u << 10) /**< \brief (PIO_OWDR) Output Write Disable */ -#define PIO_OWDR_P11 (0x1u << 11) /**< \brief (PIO_OWDR) Output Write Disable */ -#define PIO_OWDR_P12 (0x1u << 12) /**< \brief (PIO_OWDR) Output Write Disable */ -#define PIO_OWDR_P13 (0x1u << 13) /**< \brief (PIO_OWDR) Output Write Disable */ -#define PIO_OWDR_P14 (0x1u << 14) /**< \brief (PIO_OWDR) Output Write Disable */ -#define PIO_OWDR_P15 (0x1u << 15) /**< \brief (PIO_OWDR) Output Write Disable */ -#define PIO_OWDR_P16 (0x1u << 16) /**< \brief (PIO_OWDR) Output Write Disable */ -#define PIO_OWDR_P17 (0x1u << 17) /**< \brief (PIO_OWDR) Output Write Disable */ -#define PIO_OWDR_P18 (0x1u << 18) /**< \brief (PIO_OWDR) Output Write Disable */ -#define PIO_OWDR_P19 (0x1u << 19) /**< \brief (PIO_OWDR) Output Write Disable */ -#define PIO_OWDR_P20 (0x1u << 20) /**< \brief (PIO_OWDR) Output Write Disable */ -#define PIO_OWDR_P21 (0x1u << 21) /**< \brief (PIO_OWDR) Output Write Disable */ -#define PIO_OWDR_P22 (0x1u << 22) /**< \brief (PIO_OWDR) Output Write Disable */ -#define PIO_OWDR_P23 (0x1u << 23) /**< \brief (PIO_OWDR) Output Write Disable */ -#define PIO_OWDR_P24 (0x1u << 24) /**< \brief (PIO_OWDR) Output Write Disable */ -#define PIO_OWDR_P25 (0x1u << 25) /**< \brief (PIO_OWDR) Output Write Disable */ -#define PIO_OWDR_P26 (0x1u << 26) /**< \brief (PIO_OWDR) Output Write Disable */ -#define PIO_OWDR_P27 (0x1u << 27) /**< \brief (PIO_OWDR) Output Write Disable */ -#define PIO_OWDR_P28 (0x1u << 28) /**< \brief (PIO_OWDR) Output Write Disable */ -#define PIO_OWDR_P29 (0x1u << 29) /**< \brief (PIO_OWDR) Output Write Disable */ -#define PIO_OWDR_P30 (0x1u << 30) /**< \brief (PIO_OWDR) Output Write Disable */ -#define PIO_OWDR_P31 (0x1u << 31) /**< \brief (PIO_OWDR) Output Write Disable */ -/* -------- PIO_OWSR : (PIO Offset: 0x00A8) Output Write Status Register -------- */ -#define PIO_OWSR_P0 (0x1u << 0) /**< \brief (PIO_OWSR) Output Write Status */ -#define PIO_OWSR_P1 (0x1u << 1) /**< \brief (PIO_OWSR) Output Write Status */ -#define PIO_OWSR_P2 (0x1u << 2) /**< \brief (PIO_OWSR) Output Write Status */ -#define PIO_OWSR_P3 (0x1u << 3) /**< \brief (PIO_OWSR) Output Write Status */ -#define PIO_OWSR_P4 (0x1u << 4) /**< \brief (PIO_OWSR) Output Write Status */ -#define PIO_OWSR_P5 (0x1u << 5) /**< \brief (PIO_OWSR) Output Write Status */ -#define PIO_OWSR_P6 (0x1u << 6) /**< \brief (PIO_OWSR) Output Write Status */ -#define PIO_OWSR_P7 (0x1u << 7) /**< \brief (PIO_OWSR) Output Write Status */ -#define PIO_OWSR_P8 (0x1u << 8) /**< \brief (PIO_OWSR) Output Write Status */ -#define PIO_OWSR_P9 (0x1u << 9) /**< \brief (PIO_OWSR) Output Write Status */ -#define PIO_OWSR_P10 (0x1u << 10) /**< \brief (PIO_OWSR) Output Write Status */ -#define PIO_OWSR_P11 (0x1u << 11) /**< \brief (PIO_OWSR) Output Write Status */ -#define PIO_OWSR_P12 (0x1u << 12) /**< \brief (PIO_OWSR) Output Write Status */ -#define PIO_OWSR_P13 (0x1u << 13) /**< \brief (PIO_OWSR) Output Write Status */ -#define PIO_OWSR_P14 (0x1u << 14) /**< \brief (PIO_OWSR) Output Write Status */ -#define PIO_OWSR_P15 (0x1u << 15) /**< \brief (PIO_OWSR) Output Write Status */ -#define PIO_OWSR_P16 (0x1u << 16) /**< \brief (PIO_OWSR) Output Write Status */ -#define PIO_OWSR_P17 (0x1u << 17) /**< \brief (PIO_OWSR) Output Write Status */ -#define PIO_OWSR_P18 (0x1u << 18) /**< \brief (PIO_OWSR) Output Write Status */ -#define PIO_OWSR_P19 (0x1u << 19) /**< \brief (PIO_OWSR) Output Write Status */ -#define PIO_OWSR_P20 (0x1u << 20) /**< \brief (PIO_OWSR) Output Write Status */ -#define PIO_OWSR_P21 (0x1u << 21) /**< \brief (PIO_OWSR) Output Write Status */ -#define PIO_OWSR_P22 (0x1u << 22) /**< \brief (PIO_OWSR) Output Write Status */ -#define PIO_OWSR_P23 (0x1u << 23) /**< \brief (PIO_OWSR) Output Write Status */ -#define PIO_OWSR_P24 (0x1u << 24) /**< \brief (PIO_OWSR) Output Write Status */ -#define PIO_OWSR_P25 (0x1u << 25) /**< \brief (PIO_OWSR) Output Write Status */ -#define PIO_OWSR_P26 (0x1u << 26) /**< \brief (PIO_OWSR) Output Write Status */ -#define PIO_OWSR_P27 (0x1u << 27) /**< \brief (PIO_OWSR) Output Write Status */ -#define PIO_OWSR_P28 (0x1u << 28) /**< \brief (PIO_OWSR) Output Write Status */ -#define PIO_OWSR_P29 (0x1u << 29) /**< \brief (PIO_OWSR) Output Write Status */ -#define PIO_OWSR_P30 (0x1u << 30) /**< \brief (PIO_OWSR) Output Write Status */ -#define PIO_OWSR_P31 (0x1u << 31) /**< \brief (PIO_OWSR) Output Write Status */ -/* -------- PIO_AIMER : (PIO Offset: 0x00B0) Additional Interrupt Modes Enable Register -------- */ -#define PIO_AIMER_P0 (0x1u << 0) /**< \brief (PIO_AIMER) Additional Interrupt Modes Enable */ -#define PIO_AIMER_P1 (0x1u << 1) /**< \brief (PIO_AIMER) Additional Interrupt Modes Enable */ -#define PIO_AIMER_P2 (0x1u << 2) /**< \brief (PIO_AIMER) Additional Interrupt Modes Enable */ -#define PIO_AIMER_P3 (0x1u << 3) /**< \brief (PIO_AIMER) Additional Interrupt Modes Enable */ -#define PIO_AIMER_P4 (0x1u << 4) /**< \brief (PIO_AIMER) Additional Interrupt Modes Enable */ -#define PIO_AIMER_P5 (0x1u << 5) /**< \brief (PIO_AIMER) Additional Interrupt Modes Enable */ -#define PIO_AIMER_P6 (0x1u << 6) /**< \brief (PIO_AIMER) Additional Interrupt Modes Enable */ -#define PIO_AIMER_P7 (0x1u << 7) /**< \brief (PIO_AIMER) Additional Interrupt Modes Enable */ -#define PIO_AIMER_P8 (0x1u << 8) /**< \brief (PIO_AIMER) Additional Interrupt Modes Enable */ -#define PIO_AIMER_P9 (0x1u << 9) /**< \brief (PIO_AIMER) Additional Interrupt Modes Enable */ -#define PIO_AIMER_P10 (0x1u << 10) /**< \brief (PIO_AIMER) Additional Interrupt Modes Enable */ -#define PIO_AIMER_P11 (0x1u << 11) /**< \brief (PIO_AIMER) Additional Interrupt Modes Enable */ -#define PIO_AIMER_P12 (0x1u << 12) /**< \brief (PIO_AIMER) Additional Interrupt Modes Enable */ -#define PIO_AIMER_P13 (0x1u << 13) /**< \brief (PIO_AIMER) Additional Interrupt Modes Enable */ -#define PIO_AIMER_P14 (0x1u << 14) /**< \brief (PIO_AIMER) Additional Interrupt Modes Enable */ -#define PIO_AIMER_P15 (0x1u << 15) /**< \brief (PIO_AIMER) Additional Interrupt Modes Enable */ -#define PIO_AIMER_P16 (0x1u << 16) /**< \brief (PIO_AIMER) Additional Interrupt Modes Enable */ -#define PIO_AIMER_P17 (0x1u << 17) /**< \brief (PIO_AIMER) Additional Interrupt Modes Enable */ -#define PIO_AIMER_P18 (0x1u << 18) /**< \brief (PIO_AIMER) Additional Interrupt Modes Enable */ -#define PIO_AIMER_P19 (0x1u << 19) /**< \brief (PIO_AIMER) Additional Interrupt Modes Enable */ -#define PIO_AIMER_P20 (0x1u << 20) /**< \brief (PIO_AIMER) Additional Interrupt Modes Enable */ -#define PIO_AIMER_P21 (0x1u << 21) /**< \brief (PIO_AIMER) Additional Interrupt Modes Enable */ -#define PIO_AIMER_P22 (0x1u << 22) /**< \brief (PIO_AIMER) Additional Interrupt Modes Enable */ -#define PIO_AIMER_P23 (0x1u << 23) /**< \brief (PIO_AIMER) Additional Interrupt Modes Enable */ -#define PIO_AIMER_P24 (0x1u << 24) /**< \brief (PIO_AIMER) Additional Interrupt Modes Enable */ -#define PIO_AIMER_P25 (0x1u << 25) /**< \brief (PIO_AIMER) Additional Interrupt Modes Enable */ -#define PIO_AIMER_P26 (0x1u << 26) /**< \brief (PIO_AIMER) Additional Interrupt Modes Enable */ -#define PIO_AIMER_P27 (0x1u << 27) /**< \brief (PIO_AIMER) Additional Interrupt Modes Enable */ -#define PIO_AIMER_P28 (0x1u << 28) /**< \brief (PIO_AIMER) Additional Interrupt Modes Enable */ -#define PIO_AIMER_P29 (0x1u << 29) /**< \brief (PIO_AIMER) Additional Interrupt Modes Enable */ -#define PIO_AIMER_P30 (0x1u << 30) /**< \brief (PIO_AIMER) Additional Interrupt Modes Enable */ -#define PIO_AIMER_P31 (0x1u << 31) /**< \brief (PIO_AIMER) Additional Interrupt Modes Enable */ -/* -------- PIO_AIMDR : (PIO Offset: 0x00B4) Additional Interrupt Modes Disable Register -------- */ -#define PIO_AIMDR_P0 (0x1u << 0) /**< \brief (PIO_AIMDR) Additional Interrupt Modes Disable */ -#define PIO_AIMDR_P1 (0x1u << 1) /**< \brief (PIO_AIMDR) Additional Interrupt Modes Disable */ -#define PIO_AIMDR_P2 (0x1u << 2) /**< \brief (PIO_AIMDR) Additional Interrupt Modes Disable */ -#define PIO_AIMDR_P3 (0x1u << 3) /**< \brief (PIO_AIMDR) Additional Interrupt Modes Disable */ -#define PIO_AIMDR_P4 (0x1u << 4) /**< \brief (PIO_AIMDR) Additional Interrupt Modes Disable */ -#define PIO_AIMDR_P5 (0x1u << 5) /**< \brief (PIO_AIMDR) Additional Interrupt Modes Disable */ -#define PIO_AIMDR_P6 (0x1u << 6) /**< \brief (PIO_AIMDR) Additional Interrupt Modes Disable */ -#define PIO_AIMDR_P7 (0x1u << 7) /**< \brief (PIO_AIMDR) Additional Interrupt Modes Disable */ -#define PIO_AIMDR_P8 (0x1u << 8) /**< \brief (PIO_AIMDR) Additional Interrupt Modes Disable */ -#define PIO_AIMDR_P9 (0x1u << 9) /**< \brief (PIO_AIMDR) Additional Interrupt Modes Disable */ -#define PIO_AIMDR_P10 (0x1u << 10) /**< \brief (PIO_AIMDR) Additional Interrupt Modes Disable */ -#define PIO_AIMDR_P11 (0x1u << 11) /**< \brief (PIO_AIMDR) Additional Interrupt Modes Disable */ -#define PIO_AIMDR_P12 (0x1u << 12) /**< \brief (PIO_AIMDR) Additional Interrupt Modes Disable */ -#define PIO_AIMDR_P13 (0x1u << 13) /**< \brief (PIO_AIMDR) Additional Interrupt Modes Disable */ -#define PIO_AIMDR_P14 (0x1u << 14) /**< \brief (PIO_AIMDR) Additional Interrupt Modes Disable */ -#define PIO_AIMDR_P15 (0x1u << 15) /**< \brief (PIO_AIMDR) Additional Interrupt Modes Disable */ -#define PIO_AIMDR_P16 (0x1u << 16) /**< \brief (PIO_AIMDR) Additional Interrupt Modes Disable */ -#define PIO_AIMDR_P17 (0x1u << 17) /**< \brief (PIO_AIMDR) Additional Interrupt Modes Disable */ -#define PIO_AIMDR_P18 (0x1u << 18) /**< \brief (PIO_AIMDR) Additional Interrupt Modes Disable */ -#define PIO_AIMDR_P19 (0x1u << 19) /**< \brief (PIO_AIMDR) Additional Interrupt Modes Disable */ -#define PIO_AIMDR_P20 (0x1u << 20) /**< \brief (PIO_AIMDR) Additional Interrupt Modes Disable */ -#define PIO_AIMDR_P21 (0x1u << 21) /**< \brief (PIO_AIMDR) Additional Interrupt Modes Disable */ -#define PIO_AIMDR_P22 (0x1u << 22) /**< \brief (PIO_AIMDR) Additional Interrupt Modes Disable */ -#define PIO_AIMDR_P23 (0x1u << 23) /**< \brief (PIO_AIMDR) Additional Interrupt Modes Disable */ -#define PIO_AIMDR_P24 (0x1u << 24) /**< \brief (PIO_AIMDR) Additional Interrupt Modes Disable */ -#define PIO_AIMDR_P25 (0x1u << 25) /**< \brief (PIO_AIMDR) Additional Interrupt Modes Disable */ -#define PIO_AIMDR_P26 (0x1u << 26) /**< \brief (PIO_AIMDR) Additional Interrupt Modes Disable */ -#define PIO_AIMDR_P27 (0x1u << 27) /**< \brief (PIO_AIMDR) Additional Interrupt Modes Disable */ -#define PIO_AIMDR_P28 (0x1u << 28) /**< \brief (PIO_AIMDR) Additional Interrupt Modes Disable */ -#define PIO_AIMDR_P29 (0x1u << 29) /**< \brief (PIO_AIMDR) Additional Interrupt Modes Disable */ -#define PIO_AIMDR_P30 (0x1u << 30) /**< \brief (PIO_AIMDR) Additional Interrupt Modes Disable */ -#define PIO_AIMDR_P31 (0x1u << 31) /**< \brief (PIO_AIMDR) Additional Interrupt Modes Disable */ -/* -------- PIO_AIMMR : (PIO Offset: 0x00B8) Additional Interrupt Modes Mask Register -------- */ -#define PIO_AIMMR_P0 (0x1u << 0) /**< \brief (PIO_AIMMR) IO Line Index */ -#define PIO_AIMMR_P1 (0x1u << 1) /**< \brief (PIO_AIMMR) IO Line Index */ -#define PIO_AIMMR_P2 (0x1u << 2) /**< \brief (PIO_AIMMR) IO Line Index */ -#define PIO_AIMMR_P3 (0x1u << 3) /**< \brief (PIO_AIMMR) IO Line Index */ -#define PIO_AIMMR_P4 (0x1u << 4) /**< \brief (PIO_AIMMR) IO Line Index */ -#define PIO_AIMMR_P5 (0x1u << 5) /**< \brief (PIO_AIMMR) IO Line Index */ -#define PIO_AIMMR_P6 (0x1u << 6) /**< \brief (PIO_AIMMR) IO Line Index */ -#define PIO_AIMMR_P7 (0x1u << 7) /**< \brief (PIO_AIMMR) IO Line Index */ -#define PIO_AIMMR_P8 (0x1u << 8) /**< \brief (PIO_AIMMR) IO Line Index */ -#define PIO_AIMMR_P9 (0x1u << 9) /**< \brief (PIO_AIMMR) IO Line Index */ -#define PIO_AIMMR_P10 (0x1u << 10) /**< \brief (PIO_AIMMR) IO Line Index */ -#define PIO_AIMMR_P11 (0x1u << 11) /**< \brief (PIO_AIMMR) IO Line Index */ -#define PIO_AIMMR_P12 (0x1u << 12) /**< \brief (PIO_AIMMR) IO Line Index */ -#define PIO_AIMMR_P13 (0x1u << 13) /**< \brief (PIO_AIMMR) IO Line Index */ -#define PIO_AIMMR_P14 (0x1u << 14) /**< \brief (PIO_AIMMR) IO Line Index */ -#define PIO_AIMMR_P15 (0x1u << 15) /**< \brief (PIO_AIMMR) IO Line Index */ -#define PIO_AIMMR_P16 (0x1u << 16) /**< \brief (PIO_AIMMR) IO Line Index */ -#define PIO_AIMMR_P17 (0x1u << 17) /**< \brief (PIO_AIMMR) IO Line Index */ -#define PIO_AIMMR_P18 (0x1u << 18) /**< \brief (PIO_AIMMR) IO Line Index */ -#define PIO_AIMMR_P19 (0x1u << 19) /**< \brief (PIO_AIMMR) IO Line Index */ -#define PIO_AIMMR_P20 (0x1u << 20) /**< \brief (PIO_AIMMR) IO Line Index */ -#define PIO_AIMMR_P21 (0x1u << 21) /**< \brief (PIO_AIMMR) IO Line Index */ -#define PIO_AIMMR_P22 (0x1u << 22) /**< \brief (PIO_AIMMR) IO Line Index */ -#define PIO_AIMMR_P23 (0x1u << 23) /**< \brief (PIO_AIMMR) IO Line Index */ -#define PIO_AIMMR_P24 (0x1u << 24) /**< \brief (PIO_AIMMR) IO Line Index */ -#define PIO_AIMMR_P25 (0x1u << 25) /**< \brief (PIO_AIMMR) IO Line Index */ -#define PIO_AIMMR_P26 (0x1u << 26) /**< \brief (PIO_AIMMR) IO Line Index */ -#define PIO_AIMMR_P27 (0x1u << 27) /**< \brief (PIO_AIMMR) IO Line Index */ -#define PIO_AIMMR_P28 (0x1u << 28) /**< \brief (PIO_AIMMR) IO Line Index */ -#define PIO_AIMMR_P29 (0x1u << 29) /**< \brief (PIO_AIMMR) IO Line Index */ -#define PIO_AIMMR_P30 (0x1u << 30) /**< \brief (PIO_AIMMR) IO Line Index */ -#define PIO_AIMMR_P31 (0x1u << 31) /**< \brief (PIO_AIMMR) IO Line Index */ -/* -------- PIO_ESR : (PIO Offset: 0x00C0) Edge Select Register -------- */ -#define PIO_ESR_P0 (0x1u << 0) /**< \brief (PIO_ESR) Edge Interrupt Selection */ -#define PIO_ESR_P1 (0x1u << 1) /**< \brief (PIO_ESR) Edge Interrupt Selection */ -#define PIO_ESR_P2 (0x1u << 2) /**< \brief (PIO_ESR) Edge Interrupt Selection */ -#define PIO_ESR_P3 (0x1u << 3) /**< \brief (PIO_ESR) Edge Interrupt Selection */ -#define PIO_ESR_P4 (0x1u << 4) /**< \brief (PIO_ESR) Edge Interrupt Selection */ -#define PIO_ESR_P5 (0x1u << 5) /**< \brief (PIO_ESR) Edge Interrupt Selection */ -#define PIO_ESR_P6 (0x1u << 6) /**< \brief (PIO_ESR) Edge Interrupt Selection */ -#define PIO_ESR_P7 (0x1u << 7) /**< \brief (PIO_ESR) Edge Interrupt Selection */ -#define PIO_ESR_P8 (0x1u << 8) /**< \brief (PIO_ESR) Edge Interrupt Selection */ -#define PIO_ESR_P9 (0x1u << 9) /**< \brief (PIO_ESR) Edge Interrupt Selection */ -#define PIO_ESR_P10 (0x1u << 10) /**< \brief (PIO_ESR) Edge Interrupt Selection */ -#define PIO_ESR_P11 (0x1u << 11) /**< \brief (PIO_ESR) Edge Interrupt Selection */ -#define PIO_ESR_P12 (0x1u << 12) /**< \brief (PIO_ESR) Edge Interrupt Selection */ -#define PIO_ESR_P13 (0x1u << 13) /**< \brief (PIO_ESR) Edge Interrupt Selection */ -#define PIO_ESR_P14 (0x1u << 14) /**< \brief (PIO_ESR) Edge Interrupt Selection */ -#define PIO_ESR_P15 (0x1u << 15) /**< \brief (PIO_ESR) Edge Interrupt Selection */ -#define PIO_ESR_P16 (0x1u << 16) /**< \brief (PIO_ESR) Edge Interrupt Selection */ -#define PIO_ESR_P17 (0x1u << 17) /**< \brief (PIO_ESR) Edge Interrupt Selection */ -#define PIO_ESR_P18 (0x1u << 18) /**< \brief (PIO_ESR) Edge Interrupt Selection */ -#define PIO_ESR_P19 (0x1u << 19) /**< \brief (PIO_ESR) Edge Interrupt Selection */ -#define PIO_ESR_P20 (0x1u << 20) /**< \brief (PIO_ESR) Edge Interrupt Selection */ -#define PIO_ESR_P21 (0x1u << 21) /**< \brief (PIO_ESR) Edge Interrupt Selection */ -#define PIO_ESR_P22 (0x1u << 22) /**< \brief (PIO_ESR) Edge Interrupt Selection */ -#define PIO_ESR_P23 (0x1u << 23) /**< \brief (PIO_ESR) Edge Interrupt Selection */ -#define PIO_ESR_P24 (0x1u << 24) /**< \brief (PIO_ESR) Edge Interrupt Selection */ -#define PIO_ESR_P25 (0x1u << 25) /**< \brief (PIO_ESR) Edge Interrupt Selection */ -#define PIO_ESR_P26 (0x1u << 26) /**< \brief (PIO_ESR) Edge Interrupt Selection */ -#define PIO_ESR_P27 (0x1u << 27) /**< \brief (PIO_ESR) Edge Interrupt Selection */ -#define PIO_ESR_P28 (0x1u << 28) /**< \brief (PIO_ESR) Edge Interrupt Selection */ -#define PIO_ESR_P29 (0x1u << 29) /**< \brief (PIO_ESR) Edge Interrupt Selection */ -#define PIO_ESR_P30 (0x1u << 30) /**< \brief (PIO_ESR) Edge Interrupt Selection */ -#define PIO_ESR_P31 (0x1u << 31) /**< \brief (PIO_ESR) Edge Interrupt Selection */ -/* -------- PIO_LSR : (PIO Offset: 0x00C4) Level Select Register -------- */ -#define PIO_LSR_P0 (0x1u << 0) /**< \brief (PIO_LSR) Level Interrupt Selection */ -#define PIO_LSR_P1 (0x1u << 1) /**< \brief (PIO_LSR) Level Interrupt Selection */ -#define PIO_LSR_P2 (0x1u << 2) /**< \brief (PIO_LSR) Level Interrupt Selection */ -#define PIO_LSR_P3 (0x1u << 3) /**< \brief (PIO_LSR) Level Interrupt Selection */ -#define PIO_LSR_P4 (0x1u << 4) /**< \brief (PIO_LSR) Level Interrupt Selection */ -#define PIO_LSR_P5 (0x1u << 5) /**< \brief (PIO_LSR) Level Interrupt Selection */ -#define PIO_LSR_P6 (0x1u << 6) /**< \brief (PIO_LSR) Level Interrupt Selection */ -#define PIO_LSR_P7 (0x1u << 7) /**< \brief (PIO_LSR) Level Interrupt Selection */ -#define PIO_LSR_P8 (0x1u << 8) /**< \brief (PIO_LSR) Level Interrupt Selection */ -#define PIO_LSR_P9 (0x1u << 9) /**< \brief (PIO_LSR) Level Interrupt Selection */ -#define PIO_LSR_P10 (0x1u << 10) /**< \brief (PIO_LSR) Level Interrupt Selection */ -#define PIO_LSR_P11 (0x1u << 11) /**< \brief (PIO_LSR) Level Interrupt Selection */ -#define PIO_LSR_P12 (0x1u << 12) /**< \brief (PIO_LSR) Level Interrupt Selection */ -#define PIO_LSR_P13 (0x1u << 13) /**< \brief (PIO_LSR) Level Interrupt Selection */ -#define PIO_LSR_P14 (0x1u << 14) /**< \brief (PIO_LSR) Level Interrupt Selection */ -#define PIO_LSR_P15 (0x1u << 15) /**< \brief (PIO_LSR) Level Interrupt Selection */ -#define PIO_LSR_P16 (0x1u << 16) /**< \brief (PIO_LSR) Level Interrupt Selection */ -#define PIO_LSR_P17 (0x1u << 17) /**< \brief (PIO_LSR) Level Interrupt Selection */ -#define PIO_LSR_P18 (0x1u << 18) /**< \brief (PIO_LSR) Level Interrupt Selection */ -#define PIO_LSR_P19 (0x1u << 19) /**< \brief (PIO_LSR) Level Interrupt Selection */ -#define PIO_LSR_P20 (0x1u << 20) /**< \brief (PIO_LSR) Level Interrupt Selection */ -#define PIO_LSR_P21 (0x1u << 21) /**< \brief (PIO_LSR) Level Interrupt Selection */ -#define PIO_LSR_P22 (0x1u << 22) /**< \brief (PIO_LSR) Level Interrupt Selection */ -#define PIO_LSR_P23 (0x1u << 23) /**< \brief (PIO_LSR) Level Interrupt Selection */ -#define PIO_LSR_P24 (0x1u << 24) /**< \brief (PIO_LSR) Level Interrupt Selection */ -#define PIO_LSR_P25 (0x1u << 25) /**< \brief (PIO_LSR) Level Interrupt Selection */ -#define PIO_LSR_P26 (0x1u << 26) /**< \brief (PIO_LSR) Level Interrupt Selection */ -#define PIO_LSR_P27 (0x1u << 27) /**< \brief (PIO_LSR) Level Interrupt Selection */ -#define PIO_LSR_P28 (0x1u << 28) /**< \brief (PIO_LSR) Level Interrupt Selection */ -#define PIO_LSR_P29 (0x1u << 29) /**< \brief (PIO_LSR) Level Interrupt Selection */ -#define PIO_LSR_P30 (0x1u << 30) /**< \brief (PIO_LSR) Level Interrupt Selection */ -#define PIO_LSR_P31 (0x1u << 31) /**< \brief (PIO_LSR) Level Interrupt Selection */ -/* -------- PIO_ELSR : (PIO Offset: 0x00C8) Edge/Level Status Register -------- */ -#define PIO_ELSR_P0 (0x1u << 0) /**< \brief (PIO_ELSR) Edge/Level Interrupt Source Selection */ -#define PIO_ELSR_P1 (0x1u << 1) /**< \brief (PIO_ELSR) Edge/Level Interrupt Source Selection */ -#define PIO_ELSR_P2 (0x1u << 2) /**< \brief (PIO_ELSR) Edge/Level Interrupt Source Selection */ -#define PIO_ELSR_P3 (0x1u << 3) /**< \brief (PIO_ELSR) Edge/Level Interrupt Source Selection */ -#define PIO_ELSR_P4 (0x1u << 4) /**< \brief (PIO_ELSR) Edge/Level Interrupt Source Selection */ -#define PIO_ELSR_P5 (0x1u << 5) /**< \brief (PIO_ELSR) Edge/Level Interrupt Source Selection */ -#define PIO_ELSR_P6 (0x1u << 6) /**< \brief (PIO_ELSR) Edge/Level Interrupt Source Selection */ -#define PIO_ELSR_P7 (0x1u << 7) /**< \brief (PIO_ELSR) Edge/Level Interrupt Source Selection */ -#define PIO_ELSR_P8 (0x1u << 8) /**< \brief (PIO_ELSR) Edge/Level Interrupt Source Selection */ -#define PIO_ELSR_P9 (0x1u << 9) /**< \brief (PIO_ELSR) Edge/Level Interrupt Source Selection */ -#define PIO_ELSR_P10 (0x1u << 10) /**< \brief (PIO_ELSR) Edge/Level Interrupt Source Selection */ -#define PIO_ELSR_P11 (0x1u << 11) /**< \brief (PIO_ELSR) Edge/Level Interrupt Source Selection */ -#define PIO_ELSR_P12 (0x1u << 12) /**< \brief (PIO_ELSR) Edge/Level Interrupt Source Selection */ -#define PIO_ELSR_P13 (0x1u << 13) /**< \brief (PIO_ELSR) Edge/Level Interrupt Source Selection */ -#define PIO_ELSR_P14 (0x1u << 14) /**< \brief (PIO_ELSR) Edge/Level Interrupt Source Selection */ -#define PIO_ELSR_P15 (0x1u << 15) /**< \brief (PIO_ELSR) Edge/Level Interrupt Source Selection */ -#define PIO_ELSR_P16 (0x1u << 16) /**< \brief (PIO_ELSR) Edge/Level Interrupt Source Selection */ -#define PIO_ELSR_P17 (0x1u << 17) /**< \brief (PIO_ELSR) Edge/Level Interrupt Source Selection */ -#define PIO_ELSR_P18 (0x1u << 18) /**< \brief (PIO_ELSR) Edge/Level Interrupt Source Selection */ -#define PIO_ELSR_P19 (0x1u << 19) /**< \brief (PIO_ELSR) Edge/Level Interrupt Source Selection */ -#define PIO_ELSR_P20 (0x1u << 20) /**< \brief (PIO_ELSR) Edge/Level Interrupt Source Selection */ -#define PIO_ELSR_P21 (0x1u << 21) /**< \brief (PIO_ELSR) Edge/Level Interrupt Source Selection */ -#define PIO_ELSR_P22 (0x1u << 22) /**< \brief (PIO_ELSR) Edge/Level Interrupt Source Selection */ -#define PIO_ELSR_P23 (0x1u << 23) /**< \brief (PIO_ELSR) Edge/Level Interrupt Source Selection */ -#define PIO_ELSR_P24 (0x1u << 24) /**< \brief (PIO_ELSR) Edge/Level Interrupt Source Selection */ -#define PIO_ELSR_P25 (0x1u << 25) /**< \brief (PIO_ELSR) Edge/Level Interrupt Source Selection */ -#define PIO_ELSR_P26 (0x1u << 26) /**< \brief (PIO_ELSR) Edge/Level Interrupt Source Selection */ -#define PIO_ELSR_P27 (0x1u << 27) /**< \brief (PIO_ELSR) Edge/Level Interrupt Source Selection */ -#define PIO_ELSR_P28 (0x1u << 28) /**< \brief (PIO_ELSR) Edge/Level Interrupt Source Selection */ -#define PIO_ELSR_P29 (0x1u << 29) /**< \brief (PIO_ELSR) Edge/Level Interrupt Source Selection */ -#define PIO_ELSR_P30 (0x1u << 30) /**< \brief (PIO_ELSR) Edge/Level Interrupt Source Selection */ -#define PIO_ELSR_P31 (0x1u << 31) /**< \brief (PIO_ELSR) Edge/Level Interrupt Source Selection */ -/* -------- PIO_FELLSR : (PIO Offset: 0x00D0) Falling Edge/Low-Level Select Register -------- */ -#define PIO_FELLSR_P0 (0x1u << 0) /**< \brief (PIO_FELLSR) Falling Edge/Low-Level Interrupt Selection */ -#define PIO_FELLSR_P1 (0x1u << 1) /**< \brief (PIO_FELLSR) Falling Edge/Low-Level Interrupt Selection */ -#define PIO_FELLSR_P2 (0x1u << 2) /**< \brief (PIO_FELLSR) Falling Edge/Low-Level Interrupt Selection */ -#define PIO_FELLSR_P3 (0x1u << 3) /**< \brief (PIO_FELLSR) Falling Edge/Low-Level Interrupt Selection */ -#define PIO_FELLSR_P4 (0x1u << 4) /**< \brief (PIO_FELLSR) Falling Edge/Low-Level Interrupt Selection */ -#define PIO_FELLSR_P5 (0x1u << 5) /**< \brief (PIO_FELLSR) Falling Edge/Low-Level Interrupt Selection */ -#define PIO_FELLSR_P6 (0x1u << 6) /**< \brief (PIO_FELLSR) Falling Edge/Low-Level Interrupt Selection */ -#define PIO_FELLSR_P7 (0x1u << 7) /**< \brief (PIO_FELLSR) Falling Edge/Low-Level Interrupt Selection */ -#define PIO_FELLSR_P8 (0x1u << 8) /**< \brief (PIO_FELLSR) Falling Edge/Low-Level Interrupt Selection */ -#define PIO_FELLSR_P9 (0x1u << 9) /**< \brief (PIO_FELLSR) Falling Edge/Low-Level Interrupt Selection */ -#define PIO_FELLSR_P10 (0x1u << 10) /**< \brief (PIO_FELLSR) Falling Edge/Low-Level Interrupt Selection */ -#define PIO_FELLSR_P11 (0x1u << 11) /**< \brief (PIO_FELLSR) Falling Edge/Low-Level Interrupt Selection */ -#define PIO_FELLSR_P12 (0x1u << 12) /**< \brief (PIO_FELLSR) Falling Edge/Low-Level Interrupt Selection */ -#define PIO_FELLSR_P13 (0x1u << 13) /**< \brief (PIO_FELLSR) Falling Edge/Low-Level Interrupt Selection */ -#define PIO_FELLSR_P14 (0x1u << 14) /**< \brief (PIO_FELLSR) Falling Edge/Low-Level Interrupt Selection */ -#define PIO_FELLSR_P15 (0x1u << 15) /**< \brief (PIO_FELLSR) Falling Edge/Low-Level Interrupt Selection */ -#define PIO_FELLSR_P16 (0x1u << 16) /**< \brief (PIO_FELLSR) Falling Edge/Low-Level Interrupt Selection */ -#define PIO_FELLSR_P17 (0x1u << 17) /**< \brief (PIO_FELLSR) Falling Edge/Low-Level Interrupt Selection */ -#define PIO_FELLSR_P18 (0x1u << 18) /**< \brief (PIO_FELLSR) Falling Edge/Low-Level Interrupt Selection */ -#define PIO_FELLSR_P19 (0x1u << 19) /**< \brief (PIO_FELLSR) Falling Edge/Low-Level Interrupt Selection */ -#define PIO_FELLSR_P20 (0x1u << 20) /**< \brief (PIO_FELLSR) Falling Edge/Low-Level Interrupt Selection */ -#define PIO_FELLSR_P21 (0x1u << 21) /**< \brief (PIO_FELLSR) Falling Edge/Low-Level Interrupt Selection */ -#define PIO_FELLSR_P22 (0x1u << 22) /**< \brief (PIO_FELLSR) Falling Edge/Low-Level Interrupt Selection */ -#define PIO_FELLSR_P23 (0x1u << 23) /**< \brief (PIO_FELLSR) Falling Edge/Low-Level Interrupt Selection */ -#define PIO_FELLSR_P24 (0x1u << 24) /**< \brief (PIO_FELLSR) Falling Edge/Low-Level Interrupt Selection */ -#define PIO_FELLSR_P25 (0x1u << 25) /**< \brief (PIO_FELLSR) Falling Edge/Low-Level Interrupt Selection */ -#define PIO_FELLSR_P26 (0x1u << 26) /**< \brief (PIO_FELLSR) Falling Edge/Low-Level Interrupt Selection */ -#define PIO_FELLSR_P27 (0x1u << 27) /**< \brief (PIO_FELLSR) Falling Edge/Low-Level Interrupt Selection */ -#define PIO_FELLSR_P28 (0x1u << 28) /**< \brief (PIO_FELLSR) Falling Edge/Low-Level Interrupt Selection */ -#define PIO_FELLSR_P29 (0x1u << 29) /**< \brief (PIO_FELLSR) Falling Edge/Low-Level Interrupt Selection */ -#define PIO_FELLSR_P30 (0x1u << 30) /**< \brief (PIO_FELLSR) Falling Edge/Low-Level Interrupt Selection */ -#define PIO_FELLSR_P31 (0x1u << 31) /**< \brief (PIO_FELLSR) Falling Edge/Low-Level Interrupt Selection */ -/* -------- PIO_REHLSR : (PIO Offset: 0x00D4) Rising Edge/High-Level Select Register -------- */ -#define PIO_REHLSR_P0 (0x1u << 0) /**< \brief (PIO_REHLSR) Rising Edge/High-Level Interrupt Selection */ -#define PIO_REHLSR_P1 (0x1u << 1) /**< \brief (PIO_REHLSR) Rising Edge/High-Level Interrupt Selection */ -#define PIO_REHLSR_P2 (0x1u << 2) /**< \brief (PIO_REHLSR) Rising Edge/High-Level Interrupt Selection */ -#define PIO_REHLSR_P3 (0x1u << 3) /**< \brief (PIO_REHLSR) Rising Edge/High-Level Interrupt Selection */ -#define PIO_REHLSR_P4 (0x1u << 4) /**< \brief (PIO_REHLSR) Rising Edge/High-Level Interrupt Selection */ -#define PIO_REHLSR_P5 (0x1u << 5) /**< \brief (PIO_REHLSR) Rising Edge/High-Level Interrupt Selection */ -#define PIO_REHLSR_P6 (0x1u << 6) /**< \brief (PIO_REHLSR) Rising Edge/High-Level Interrupt Selection */ -#define PIO_REHLSR_P7 (0x1u << 7) /**< \brief (PIO_REHLSR) Rising Edge/High-Level Interrupt Selection */ -#define PIO_REHLSR_P8 (0x1u << 8) /**< \brief (PIO_REHLSR) Rising Edge/High-Level Interrupt Selection */ -#define PIO_REHLSR_P9 (0x1u << 9) /**< \brief (PIO_REHLSR) Rising Edge/High-Level Interrupt Selection */ -#define PIO_REHLSR_P10 (0x1u << 10) /**< \brief (PIO_REHLSR) Rising Edge/High-Level Interrupt Selection */ -#define PIO_REHLSR_P11 (0x1u << 11) /**< \brief (PIO_REHLSR) Rising Edge/High-Level Interrupt Selection */ -#define PIO_REHLSR_P12 (0x1u << 12) /**< \brief (PIO_REHLSR) Rising Edge/High-Level Interrupt Selection */ -#define PIO_REHLSR_P13 (0x1u << 13) /**< \brief (PIO_REHLSR) Rising Edge/High-Level Interrupt Selection */ -#define PIO_REHLSR_P14 (0x1u << 14) /**< \brief (PIO_REHLSR) Rising Edge/High-Level Interrupt Selection */ -#define PIO_REHLSR_P15 (0x1u << 15) /**< \brief (PIO_REHLSR) Rising Edge/High-Level Interrupt Selection */ -#define PIO_REHLSR_P16 (0x1u << 16) /**< \brief (PIO_REHLSR) Rising Edge/High-Level Interrupt Selection */ -#define PIO_REHLSR_P17 (0x1u << 17) /**< \brief (PIO_REHLSR) Rising Edge/High-Level Interrupt Selection */ -#define PIO_REHLSR_P18 (0x1u << 18) /**< \brief (PIO_REHLSR) Rising Edge/High-Level Interrupt Selection */ -#define PIO_REHLSR_P19 (0x1u << 19) /**< \brief (PIO_REHLSR) Rising Edge/High-Level Interrupt Selection */ -#define PIO_REHLSR_P20 (0x1u << 20) /**< \brief (PIO_REHLSR) Rising Edge/High-Level Interrupt Selection */ -#define PIO_REHLSR_P21 (0x1u << 21) /**< \brief (PIO_REHLSR) Rising Edge/High-Level Interrupt Selection */ -#define PIO_REHLSR_P22 (0x1u << 22) /**< \brief (PIO_REHLSR) Rising Edge/High-Level Interrupt Selection */ -#define PIO_REHLSR_P23 (0x1u << 23) /**< \brief (PIO_REHLSR) Rising Edge/High-Level Interrupt Selection */ -#define PIO_REHLSR_P24 (0x1u << 24) /**< \brief (PIO_REHLSR) Rising Edge/High-Level Interrupt Selection */ -#define PIO_REHLSR_P25 (0x1u << 25) /**< \brief (PIO_REHLSR) Rising Edge/High-Level Interrupt Selection */ -#define PIO_REHLSR_P26 (0x1u << 26) /**< \brief (PIO_REHLSR) Rising Edge/High-Level Interrupt Selection */ -#define PIO_REHLSR_P27 (0x1u << 27) /**< \brief (PIO_REHLSR) Rising Edge/High-Level Interrupt Selection */ -#define PIO_REHLSR_P28 (0x1u << 28) /**< \brief (PIO_REHLSR) Rising Edge/High-Level Interrupt Selection */ -#define PIO_REHLSR_P29 (0x1u << 29) /**< \brief (PIO_REHLSR) Rising Edge/High-Level Interrupt Selection */ -#define PIO_REHLSR_P30 (0x1u << 30) /**< \brief (PIO_REHLSR) Rising Edge/High-Level Interrupt Selection */ -#define PIO_REHLSR_P31 (0x1u << 31) /**< \brief (PIO_REHLSR) Rising Edge/High-Level Interrupt Selection */ -/* -------- PIO_FRLHSR : (PIO Offset: 0x00D8) Fall/Rise - Low/High Status Register -------- */ -#define PIO_FRLHSR_P0 (0x1u << 0) /**< \brief (PIO_FRLHSR) Edge/Level Interrupt Source Selection */ -#define PIO_FRLHSR_P1 (0x1u << 1) /**< \brief (PIO_FRLHSR) Edge/Level Interrupt Source Selection */ -#define PIO_FRLHSR_P2 (0x1u << 2) /**< \brief (PIO_FRLHSR) Edge/Level Interrupt Source Selection */ -#define PIO_FRLHSR_P3 (0x1u << 3) /**< \brief (PIO_FRLHSR) Edge/Level Interrupt Source Selection */ -#define PIO_FRLHSR_P4 (0x1u << 4) /**< \brief (PIO_FRLHSR) Edge/Level Interrupt Source Selection */ -#define PIO_FRLHSR_P5 (0x1u << 5) /**< \brief (PIO_FRLHSR) Edge/Level Interrupt Source Selection */ -#define PIO_FRLHSR_P6 (0x1u << 6) /**< \brief (PIO_FRLHSR) Edge/Level Interrupt Source Selection */ -#define PIO_FRLHSR_P7 (0x1u << 7) /**< \brief (PIO_FRLHSR) Edge/Level Interrupt Source Selection */ -#define PIO_FRLHSR_P8 (0x1u << 8) /**< \brief (PIO_FRLHSR) Edge/Level Interrupt Source Selection */ -#define PIO_FRLHSR_P9 (0x1u << 9) /**< \brief (PIO_FRLHSR) Edge/Level Interrupt Source Selection */ -#define PIO_FRLHSR_P10 (0x1u << 10) /**< \brief (PIO_FRLHSR) Edge/Level Interrupt Source Selection */ -#define PIO_FRLHSR_P11 (0x1u << 11) /**< \brief (PIO_FRLHSR) Edge/Level Interrupt Source Selection */ -#define PIO_FRLHSR_P12 (0x1u << 12) /**< \brief (PIO_FRLHSR) Edge/Level Interrupt Source Selection */ -#define PIO_FRLHSR_P13 (0x1u << 13) /**< \brief (PIO_FRLHSR) Edge/Level Interrupt Source Selection */ -#define PIO_FRLHSR_P14 (0x1u << 14) /**< \brief (PIO_FRLHSR) Edge/Level Interrupt Source Selection */ -#define PIO_FRLHSR_P15 (0x1u << 15) /**< \brief (PIO_FRLHSR) Edge/Level Interrupt Source Selection */ -#define PIO_FRLHSR_P16 (0x1u << 16) /**< \brief (PIO_FRLHSR) Edge/Level Interrupt Source Selection */ -#define PIO_FRLHSR_P17 (0x1u << 17) /**< \brief (PIO_FRLHSR) Edge/Level Interrupt Source Selection */ -#define PIO_FRLHSR_P18 (0x1u << 18) /**< \brief (PIO_FRLHSR) Edge/Level Interrupt Source Selection */ -#define PIO_FRLHSR_P19 (0x1u << 19) /**< \brief (PIO_FRLHSR) Edge/Level Interrupt Source Selection */ -#define PIO_FRLHSR_P20 (0x1u << 20) /**< \brief (PIO_FRLHSR) Edge/Level Interrupt Source Selection */ -#define PIO_FRLHSR_P21 (0x1u << 21) /**< \brief (PIO_FRLHSR) Edge/Level Interrupt Source Selection */ -#define PIO_FRLHSR_P22 (0x1u << 22) /**< \brief (PIO_FRLHSR) Edge/Level Interrupt Source Selection */ -#define PIO_FRLHSR_P23 (0x1u << 23) /**< \brief (PIO_FRLHSR) Edge/Level Interrupt Source Selection */ -#define PIO_FRLHSR_P24 (0x1u << 24) /**< \brief (PIO_FRLHSR) Edge/Level Interrupt Source Selection */ -#define PIO_FRLHSR_P25 (0x1u << 25) /**< \brief (PIO_FRLHSR) Edge/Level Interrupt Source Selection */ -#define PIO_FRLHSR_P26 (0x1u << 26) /**< \brief (PIO_FRLHSR) Edge/Level Interrupt Source Selection */ -#define PIO_FRLHSR_P27 (0x1u << 27) /**< \brief (PIO_FRLHSR) Edge/Level Interrupt Source Selection */ -#define PIO_FRLHSR_P28 (0x1u << 28) /**< \brief (PIO_FRLHSR) Edge/Level Interrupt Source Selection */ -#define PIO_FRLHSR_P29 (0x1u << 29) /**< \brief (PIO_FRLHSR) Edge/Level Interrupt Source Selection */ -#define PIO_FRLHSR_P30 (0x1u << 30) /**< \brief (PIO_FRLHSR) Edge/Level Interrupt Source Selection */ -#define PIO_FRLHSR_P31 (0x1u << 31) /**< \brief (PIO_FRLHSR) Edge/Level Interrupt Source Selection */ -/* -------- PIO_LOCKSR : (PIO Offset: 0x00E0) Lock Status -------- */ -#define PIO_LOCKSR_P0 (0x1u << 0) /**< \brief (PIO_LOCKSR) Lock Status */ -#define PIO_LOCKSR_P1 (0x1u << 1) /**< \brief (PIO_LOCKSR) Lock Status */ -#define PIO_LOCKSR_P2 (0x1u << 2) /**< \brief (PIO_LOCKSR) Lock Status */ -#define PIO_LOCKSR_P3 (0x1u << 3) /**< \brief (PIO_LOCKSR) Lock Status */ -#define PIO_LOCKSR_P4 (0x1u << 4) /**< \brief (PIO_LOCKSR) Lock Status */ -#define PIO_LOCKSR_P5 (0x1u << 5) /**< \brief (PIO_LOCKSR) Lock Status */ -#define PIO_LOCKSR_P6 (0x1u << 6) /**< \brief (PIO_LOCKSR) Lock Status */ -#define PIO_LOCKSR_P7 (0x1u << 7) /**< \brief (PIO_LOCKSR) Lock Status */ -#define PIO_LOCKSR_P8 (0x1u << 8) /**< \brief (PIO_LOCKSR) Lock Status */ -#define PIO_LOCKSR_P9 (0x1u << 9) /**< \brief (PIO_LOCKSR) Lock Status */ -#define PIO_LOCKSR_P10 (0x1u << 10) /**< \brief (PIO_LOCKSR) Lock Status */ -#define PIO_LOCKSR_P11 (0x1u << 11) /**< \brief (PIO_LOCKSR) Lock Status */ -#define PIO_LOCKSR_P12 (0x1u << 12) /**< \brief (PIO_LOCKSR) Lock Status */ -#define PIO_LOCKSR_P13 (0x1u << 13) /**< \brief (PIO_LOCKSR) Lock Status */ -#define PIO_LOCKSR_P14 (0x1u << 14) /**< \brief (PIO_LOCKSR) Lock Status */ -#define PIO_LOCKSR_P15 (0x1u << 15) /**< \brief (PIO_LOCKSR) Lock Status */ -#define PIO_LOCKSR_P16 (0x1u << 16) /**< \brief (PIO_LOCKSR) Lock Status */ -#define PIO_LOCKSR_P17 (0x1u << 17) /**< \brief (PIO_LOCKSR) Lock Status */ -#define PIO_LOCKSR_P18 (0x1u << 18) /**< \brief (PIO_LOCKSR) Lock Status */ -#define PIO_LOCKSR_P19 (0x1u << 19) /**< \brief (PIO_LOCKSR) Lock Status */ -#define PIO_LOCKSR_P20 (0x1u << 20) /**< \brief (PIO_LOCKSR) Lock Status */ -#define PIO_LOCKSR_P21 (0x1u << 21) /**< \brief (PIO_LOCKSR) Lock Status */ -#define PIO_LOCKSR_P22 (0x1u << 22) /**< \brief (PIO_LOCKSR) Lock Status */ -#define PIO_LOCKSR_P23 (0x1u << 23) /**< \brief (PIO_LOCKSR) Lock Status */ -#define PIO_LOCKSR_P24 (0x1u << 24) /**< \brief (PIO_LOCKSR) Lock Status */ -#define PIO_LOCKSR_P25 (0x1u << 25) /**< \brief (PIO_LOCKSR) Lock Status */ -#define PIO_LOCKSR_P26 (0x1u << 26) /**< \brief (PIO_LOCKSR) Lock Status */ -#define PIO_LOCKSR_P27 (0x1u << 27) /**< \brief (PIO_LOCKSR) Lock Status */ -#define PIO_LOCKSR_P28 (0x1u << 28) /**< \brief (PIO_LOCKSR) Lock Status */ -#define PIO_LOCKSR_P29 (0x1u << 29) /**< \brief (PIO_LOCKSR) Lock Status */ -#define PIO_LOCKSR_P30 (0x1u << 30) /**< \brief (PIO_LOCKSR) Lock Status */ -#define PIO_LOCKSR_P31 (0x1u << 31) /**< \brief (PIO_LOCKSR) Lock Status */ -/* -------- PIO_WPMR : (PIO Offset: 0x00E4) Write Protection Mode Register -------- */ -#define PIO_WPMR_WPEN (0x1u << 0) /**< \brief (PIO_WPMR) Write Protection Enable */ -#define PIO_WPMR_WPKEY_Pos 8 -#define PIO_WPMR_WPKEY_Msk (0xffffffu << PIO_WPMR_WPKEY_Pos) /**< \brief (PIO_WPMR) Write Protection Key */ -#define PIO_WPMR_WPKEY(value) ((PIO_WPMR_WPKEY_Msk & ((value) << PIO_WPMR_WPKEY_Pos))) -#define PIO_WPMR_WPKEY_PASSWD (0x50494Fu << 8) /**< \brief (PIO_WPMR) Writing any other value in this field aborts the write operation of the WPEN bit. Always reads as 0. */ -/* -------- PIO_WPSR : (PIO Offset: 0x00E8) Write Protection Status Register -------- */ -#define PIO_WPSR_WPVS (0x1u << 0) /**< \brief (PIO_WPSR) Write Protection Violation Status */ -#define PIO_WPSR_WPVSRC_Pos 8 -#define PIO_WPSR_WPVSRC_Msk (0xffffu << PIO_WPSR_WPVSRC_Pos) /**< \brief (PIO_WPSR) Write Protection Violation Source */ -/* -------- PIO_SCHMITT : (PIO Offset: 0x0100) Schmitt Trigger Register -------- */ -#define PIO_SCHMITT_SCHMITT0 (0x1u << 0) /**< \brief (PIO_SCHMITT) Schmitt Trigger Control */ -#define PIO_SCHMITT_SCHMITT1 (0x1u << 1) /**< \brief (PIO_SCHMITT) Schmitt Trigger Control */ -#define PIO_SCHMITT_SCHMITT2 (0x1u << 2) /**< \brief (PIO_SCHMITT) Schmitt Trigger Control */ -#define PIO_SCHMITT_SCHMITT3 (0x1u << 3) /**< \brief (PIO_SCHMITT) Schmitt Trigger Control */ -#define PIO_SCHMITT_SCHMITT4 (0x1u << 4) /**< \brief (PIO_SCHMITT) Schmitt Trigger Control */ -#define PIO_SCHMITT_SCHMITT5 (0x1u << 5) /**< \brief (PIO_SCHMITT) Schmitt Trigger Control */ -#define PIO_SCHMITT_SCHMITT6 (0x1u << 6) /**< \brief (PIO_SCHMITT) Schmitt Trigger Control */ -#define PIO_SCHMITT_SCHMITT7 (0x1u << 7) /**< \brief (PIO_SCHMITT) Schmitt Trigger Control */ -#define PIO_SCHMITT_SCHMITT8 (0x1u << 8) /**< \brief (PIO_SCHMITT) Schmitt Trigger Control */ -#define PIO_SCHMITT_SCHMITT9 (0x1u << 9) /**< \brief (PIO_SCHMITT) Schmitt Trigger Control */ -#define PIO_SCHMITT_SCHMITT10 (0x1u << 10) /**< \brief (PIO_SCHMITT) Schmitt Trigger Control */ -#define PIO_SCHMITT_SCHMITT11 (0x1u << 11) /**< \brief (PIO_SCHMITT) Schmitt Trigger Control */ -#define PIO_SCHMITT_SCHMITT12 (0x1u << 12) /**< \brief (PIO_SCHMITT) Schmitt Trigger Control */ -#define PIO_SCHMITT_SCHMITT13 (0x1u << 13) /**< \brief (PIO_SCHMITT) Schmitt Trigger Control */ -#define PIO_SCHMITT_SCHMITT14 (0x1u << 14) /**< \brief (PIO_SCHMITT) Schmitt Trigger Control */ -#define PIO_SCHMITT_SCHMITT15 (0x1u << 15) /**< \brief (PIO_SCHMITT) Schmitt Trigger Control */ -#define PIO_SCHMITT_SCHMITT16 (0x1u << 16) /**< \brief (PIO_SCHMITT) Schmitt Trigger Control */ -#define PIO_SCHMITT_SCHMITT17 (0x1u << 17) /**< \brief (PIO_SCHMITT) Schmitt Trigger Control */ -#define PIO_SCHMITT_SCHMITT18 (0x1u << 18) /**< \brief (PIO_SCHMITT) Schmitt Trigger Control */ -#define PIO_SCHMITT_SCHMITT19 (0x1u << 19) /**< \brief (PIO_SCHMITT) Schmitt Trigger Control */ -#define PIO_SCHMITT_SCHMITT20 (0x1u << 20) /**< \brief (PIO_SCHMITT) Schmitt Trigger Control */ -#define PIO_SCHMITT_SCHMITT21 (0x1u << 21) /**< \brief (PIO_SCHMITT) Schmitt Trigger Control */ -#define PIO_SCHMITT_SCHMITT22 (0x1u << 22) /**< \brief (PIO_SCHMITT) Schmitt Trigger Control */ -#define PIO_SCHMITT_SCHMITT23 (0x1u << 23) /**< \brief (PIO_SCHMITT) Schmitt Trigger Control */ -#define PIO_SCHMITT_SCHMITT24 (0x1u << 24) /**< \brief (PIO_SCHMITT) Schmitt Trigger Control */ -#define PIO_SCHMITT_SCHMITT25 (0x1u << 25) /**< \brief (PIO_SCHMITT) Schmitt Trigger Control */ -#define PIO_SCHMITT_SCHMITT26 (0x1u << 26) /**< \brief (PIO_SCHMITT) Schmitt Trigger Control */ -#define PIO_SCHMITT_SCHMITT27 (0x1u << 27) /**< \brief (PIO_SCHMITT) Schmitt Trigger Control */ -#define PIO_SCHMITT_SCHMITT28 (0x1u << 28) /**< \brief (PIO_SCHMITT) Schmitt Trigger Control */ -#define PIO_SCHMITT_SCHMITT29 (0x1u << 29) /**< \brief (PIO_SCHMITT) Schmitt Trigger Control */ -#define PIO_SCHMITT_SCHMITT30 (0x1u << 30) /**< \brief (PIO_SCHMITT) Schmitt Trigger Control */ -#define PIO_SCHMITT_SCHMITT31 (0x1u << 31) /**< \brief (PIO_SCHMITT) Schmitt Trigger Control */ -/* -------- PIO_DRIVER : (PIO Offset: 0x0118) I/O Drive Register -------- */ -#define PIO_DRIVER_LINE0 (0x1u << 0) /**< \brief (PIO_DRIVER) Drive of PIO Line 0 */ -#define PIO_DRIVER_LINE0_LOW_DRIVE (0x0u << 0) /**< \brief (PIO_DRIVER) Lowest drive */ -#define PIO_DRIVER_LINE0_HIGH_DRIVE (0x1u << 0) /**< \brief (PIO_DRIVER) Highest drive */ -#define PIO_DRIVER_LINE1 (0x1u << 1) /**< \brief (PIO_DRIVER) Drive of PIO Line 1 */ -#define PIO_DRIVER_LINE1_LOW_DRIVE (0x0u << 1) /**< \brief (PIO_DRIVER) Lowest drive */ -#define PIO_DRIVER_LINE1_HIGH_DRIVE (0x1u << 1) /**< \brief (PIO_DRIVER) Highest drive */ -#define PIO_DRIVER_LINE2 (0x1u << 2) /**< \brief (PIO_DRIVER) Drive of PIO Line 2 */ -#define PIO_DRIVER_LINE2_LOW_DRIVE (0x0u << 2) /**< \brief (PIO_DRIVER) Lowest drive */ -#define PIO_DRIVER_LINE2_HIGH_DRIVE (0x1u << 2) /**< \brief (PIO_DRIVER) Highest drive */ -#define PIO_DRIVER_LINE3 (0x1u << 3) /**< \brief (PIO_DRIVER) Drive of PIO Line 3 */ -#define PIO_DRIVER_LINE3_LOW_DRIVE (0x0u << 3) /**< \brief (PIO_DRIVER) Lowest drive */ -#define PIO_DRIVER_LINE3_HIGH_DRIVE (0x1u << 3) /**< \brief (PIO_DRIVER) Highest drive */ -#define PIO_DRIVER_LINE4 (0x1u << 4) /**< \brief (PIO_DRIVER) Drive of PIO Line 4 */ -#define PIO_DRIVER_LINE4_LOW_DRIVE (0x0u << 4) /**< \brief (PIO_DRIVER) Lowest drive */ -#define PIO_DRIVER_LINE4_HIGH_DRIVE (0x1u << 4) /**< \brief (PIO_DRIVER) Highest drive */ -#define PIO_DRIVER_LINE5 (0x1u << 5) /**< \brief (PIO_DRIVER) Drive of PIO Line 5 */ -#define PIO_DRIVER_LINE5_LOW_DRIVE (0x0u << 5) /**< \brief (PIO_DRIVER) Lowest drive */ -#define PIO_DRIVER_LINE5_HIGH_DRIVE (0x1u << 5) /**< \brief (PIO_DRIVER) Highest drive */ -#define PIO_DRIVER_LINE6 (0x1u << 6) /**< \brief (PIO_DRIVER) Drive of PIO Line 6 */ -#define PIO_DRIVER_LINE6_LOW_DRIVE (0x0u << 6) /**< \brief (PIO_DRIVER) Lowest drive */ -#define PIO_DRIVER_LINE6_HIGH_DRIVE (0x1u << 6) /**< \brief (PIO_DRIVER) Highest drive */ -#define PIO_DRIVER_LINE7 (0x1u << 7) /**< \brief (PIO_DRIVER) Drive of PIO Line 7 */ -#define PIO_DRIVER_LINE7_LOW_DRIVE (0x0u << 7) /**< \brief (PIO_DRIVER) Lowest drive */ -#define PIO_DRIVER_LINE7_HIGH_DRIVE (0x1u << 7) /**< \brief (PIO_DRIVER) Highest drive */ -#define PIO_DRIVER_LINE8 (0x1u << 8) /**< \brief (PIO_DRIVER) Drive of PIO Line 8 */ -#define PIO_DRIVER_LINE8_LOW_DRIVE (0x0u << 8) /**< \brief (PIO_DRIVER) Lowest drive */ -#define PIO_DRIVER_LINE8_HIGH_DRIVE (0x1u << 8) /**< \brief (PIO_DRIVER) Highest drive */ -#define PIO_DRIVER_LINE9 (0x1u << 9) /**< \brief (PIO_DRIVER) Drive of PIO Line 9 */ -#define PIO_DRIVER_LINE9_LOW_DRIVE (0x0u << 9) /**< \brief (PIO_DRIVER) Lowest drive */ -#define PIO_DRIVER_LINE9_HIGH_DRIVE (0x1u << 9) /**< \brief (PIO_DRIVER) Highest drive */ -#define PIO_DRIVER_LINE10 (0x1u << 10) /**< \brief (PIO_DRIVER) Drive of PIO Line 10 */ -#define PIO_DRIVER_LINE10_LOW_DRIVE (0x0u << 10) /**< \brief (PIO_DRIVER) Lowest drive */ -#define PIO_DRIVER_LINE10_HIGH_DRIVE (0x1u << 10) /**< \brief (PIO_DRIVER) Highest drive */ -#define PIO_DRIVER_LINE11 (0x1u << 11) /**< \brief (PIO_DRIVER) Drive of PIO Line 11 */ -#define PIO_DRIVER_LINE11_LOW_DRIVE (0x0u << 11) /**< \brief (PIO_DRIVER) Lowest drive */ -#define PIO_DRIVER_LINE11_HIGH_DRIVE (0x1u << 11) /**< \brief (PIO_DRIVER) Highest drive */ -#define PIO_DRIVER_LINE12 (0x1u << 12) /**< \brief (PIO_DRIVER) Drive of PIO Line 12 */ -#define PIO_DRIVER_LINE12_LOW_DRIVE (0x0u << 12) /**< \brief (PIO_DRIVER) Lowest drive */ -#define PIO_DRIVER_LINE12_HIGH_DRIVE (0x1u << 12) /**< \brief (PIO_DRIVER) Highest drive */ -#define PIO_DRIVER_LINE13 (0x1u << 13) /**< \brief (PIO_DRIVER) Drive of PIO Line 13 */ -#define PIO_DRIVER_LINE13_LOW_DRIVE (0x0u << 13) /**< \brief (PIO_DRIVER) Lowest drive */ -#define PIO_DRIVER_LINE13_HIGH_DRIVE (0x1u << 13) /**< \brief (PIO_DRIVER) Highest drive */ -#define PIO_DRIVER_LINE14 (0x1u << 14) /**< \brief (PIO_DRIVER) Drive of PIO Line 14 */ -#define PIO_DRIVER_LINE14_LOW_DRIVE (0x0u << 14) /**< \brief (PIO_DRIVER) Lowest drive */ -#define PIO_DRIVER_LINE14_HIGH_DRIVE (0x1u << 14) /**< \brief (PIO_DRIVER) Highest drive */ -#define PIO_DRIVER_LINE15 (0x1u << 15) /**< \brief (PIO_DRIVER) Drive of PIO Line 15 */ -#define PIO_DRIVER_LINE15_LOW_DRIVE (0x0u << 15) /**< \brief (PIO_DRIVER) Lowest drive */ -#define PIO_DRIVER_LINE15_HIGH_DRIVE (0x1u << 15) /**< \brief (PIO_DRIVER) Highest drive */ -#define PIO_DRIVER_LINE16 (0x1u << 16) /**< \brief (PIO_DRIVER) Drive of PIO Line 16 */ -#define PIO_DRIVER_LINE16_LOW_DRIVE (0x0u << 16) /**< \brief (PIO_DRIVER) Lowest drive */ -#define PIO_DRIVER_LINE16_HIGH_DRIVE (0x1u << 16) /**< \brief (PIO_DRIVER) Highest drive */ -#define PIO_DRIVER_LINE17 (0x1u << 17) /**< \brief (PIO_DRIVER) Drive of PIO Line 17 */ -#define PIO_DRIVER_LINE17_LOW_DRIVE (0x0u << 17) /**< \brief (PIO_DRIVER) Lowest drive */ -#define PIO_DRIVER_LINE17_HIGH_DRIVE (0x1u << 17) /**< \brief (PIO_DRIVER) Highest drive */ -#define PIO_DRIVER_LINE18 (0x1u << 18) /**< \brief (PIO_DRIVER) Drive of PIO Line 18 */ -#define PIO_DRIVER_LINE18_LOW_DRIVE (0x0u << 18) /**< \brief (PIO_DRIVER) Lowest drive */ -#define PIO_DRIVER_LINE18_HIGH_DRIVE (0x1u << 18) /**< \brief (PIO_DRIVER) Highest drive */ -#define PIO_DRIVER_LINE19 (0x1u << 19) /**< \brief (PIO_DRIVER) Drive of PIO Line 19 */ -#define PIO_DRIVER_LINE19_LOW_DRIVE (0x0u << 19) /**< \brief (PIO_DRIVER) Lowest drive */ -#define PIO_DRIVER_LINE19_HIGH_DRIVE (0x1u << 19) /**< \brief (PIO_DRIVER) Highest drive */ -#define PIO_DRIVER_LINE20 (0x1u << 20) /**< \brief (PIO_DRIVER) Drive of PIO Line 20 */ -#define PIO_DRIVER_LINE20_LOW_DRIVE (0x0u << 20) /**< \brief (PIO_DRIVER) Lowest drive */ -#define PIO_DRIVER_LINE20_HIGH_DRIVE (0x1u << 20) /**< \brief (PIO_DRIVER) Highest drive */ -#define PIO_DRIVER_LINE21 (0x1u << 21) /**< \brief (PIO_DRIVER) Drive of PIO Line 21 */ -#define PIO_DRIVER_LINE21_LOW_DRIVE (0x0u << 21) /**< \brief (PIO_DRIVER) Lowest drive */ -#define PIO_DRIVER_LINE21_HIGH_DRIVE (0x1u << 21) /**< \brief (PIO_DRIVER) Highest drive */ -#define PIO_DRIVER_LINE22 (0x1u << 22) /**< \brief (PIO_DRIVER) Drive of PIO Line 22 */ -#define PIO_DRIVER_LINE22_LOW_DRIVE (0x0u << 22) /**< \brief (PIO_DRIVER) Lowest drive */ -#define PIO_DRIVER_LINE22_HIGH_DRIVE (0x1u << 22) /**< \brief (PIO_DRIVER) Highest drive */ -#define PIO_DRIVER_LINE23 (0x1u << 23) /**< \brief (PIO_DRIVER) Drive of PIO Line 23 */ -#define PIO_DRIVER_LINE23_LOW_DRIVE (0x0u << 23) /**< \brief (PIO_DRIVER) Lowest drive */ -#define PIO_DRIVER_LINE23_HIGH_DRIVE (0x1u << 23) /**< \brief (PIO_DRIVER) Highest drive */ -#define PIO_DRIVER_LINE24 (0x1u << 24) /**< \brief (PIO_DRIVER) Drive of PIO Line 24 */ -#define PIO_DRIVER_LINE24_LOW_DRIVE (0x0u << 24) /**< \brief (PIO_DRIVER) Lowest drive */ -#define PIO_DRIVER_LINE24_HIGH_DRIVE (0x1u << 24) /**< \brief (PIO_DRIVER) Highest drive */ -#define PIO_DRIVER_LINE25 (0x1u << 25) /**< \brief (PIO_DRIVER) Drive of PIO Line 25 */ -#define PIO_DRIVER_LINE25_LOW_DRIVE (0x0u << 25) /**< \brief (PIO_DRIVER) Lowest drive */ -#define PIO_DRIVER_LINE25_HIGH_DRIVE (0x1u << 25) /**< \brief (PIO_DRIVER) Highest drive */ -#define PIO_DRIVER_LINE26 (0x1u << 26) /**< \brief (PIO_DRIVER) Drive of PIO Line 26 */ -#define PIO_DRIVER_LINE26_LOW_DRIVE (0x0u << 26) /**< \brief (PIO_DRIVER) Lowest drive */ -#define PIO_DRIVER_LINE26_HIGH_DRIVE (0x1u << 26) /**< \brief (PIO_DRIVER) Highest drive */ -#define PIO_DRIVER_LINE27 (0x1u << 27) /**< \brief (PIO_DRIVER) Drive of PIO Line 27 */ -#define PIO_DRIVER_LINE27_LOW_DRIVE (0x0u << 27) /**< \brief (PIO_DRIVER) Lowest drive */ -#define PIO_DRIVER_LINE27_HIGH_DRIVE (0x1u << 27) /**< \brief (PIO_DRIVER) Highest drive */ -#define PIO_DRIVER_LINE28 (0x1u << 28) /**< \brief (PIO_DRIVER) Drive of PIO Line 28 */ -#define PIO_DRIVER_LINE28_LOW_DRIVE (0x0u << 28) /**< \brief (PIO_DRIVER) Lowest drive */ -#define PIO_DRIVER_LINE28_HIGH_DRIVE (0x1u << 28) /**< \brief (PIO_DRIVER) Highest drive */ -#define PIO_DRIVER_LINE29 (0x1u << 29) /**< \brief (PIO_DRIVER) Drive of PIO Line 29 */ -#define PIO_DRIVER_LINE29_LOW_DRIVE (0x0u << 29) /**< \brief (PIO_DRIVER) Lowest drive */ -#define PIO_DRIVER_LINE29_HIGH_DRIVE (0x1u << 29) /**< \brief (PIO_DRIVER) Highest drive */ -#define PIO_DRIVER_LINE30 (0x1u << 30) /**< \brief (PIO_DRIVER) Drive of PIO Line 30 */ -#define PIO_DRIVER_LINE30_LOW_DRIVE (0x0u << 30) /**< \brief (PIO_DRIVER) Lowest drive */ -#define PIO_DRIVER_LINE30_HIGH_DRIVE (0x1u << 30) /**< \brief (PIO_DRIVER) Highest drive */ -#define PIO_DRIVER_LINE31 (0x1u << 31) /**< \brief (PIO_DRIVER) Drive of PIO Line 31 */ -#define PIO_DRIVER_LINE31_LOW_DRIVE (0x0u << 31) /**< \brief (PIO_DRIVER) Lowest drive */ -#define PIO_DRIVER_LINE31_HIGH_DRIVE (0x1u << 31) /**< \brief (PIO_DRIVER) Highest drive */ -/* -------- PIO_KER : (PIO Offset: 0x0120) Keypad Controller Enable Register -------- */ -#define PIO_KER_KCE (0x1u << 0) /**< \brief (PIO_KER) Keypad Controller Enable */ -/* -------- PIO_KRCR : (PIO Offset: 0x0124) Keypad Controller Row Column Register -------- */ -#define PIO_KRCR_NBR_Pos 0 -#define PIO_KRCR_NBR_Msk (0x7u << PIO_KRCR_NBR_Pos) /**< \brief (PIO_KRCR) Number of Columns of the Keypad Matrix */ -#define PIO_KRCR_NBR(value) ((PIO_KRCR_NBR_Msk & ((value) << PIO_KRCR_NBR_Pos))) -#define PIO_KRCR_NBC_Pos 8 -#define PIO_KRCR_NBC_Msk (0x7u << PIO_KRCR_NBC_Pos) /**< \brief (PIO_KRCR) Number of Rows of the Keypad Matrix */ -#define PIO_KRCR_NBC(value) ((PIO_KRCR_NBC_Msk & ((value) << PIO_KRCR_NBC_Pos))) -/* -------- PIO_KDR : (PIO Offset: 0x0128) Keypad Controller Debouncing Register -------- */ -#define PIO_KDR_DBC_Pos 0 -#define PIO_KDR_DBC_Msk (0x3ffu << PIO_KDR_DBC_Pos) /**< \brief (PIO_KDR) Debouncing Value */ -#define PIO_KDR_DBC(value) ((PIO_KDR_DBC_Msk & ((value) << PIO_KDR_DBC_Pos))) -/* -------- PIO_KIER : (PIO Offset: 0x0130) Keypad Controller Interrupt Enable Register -------- */ -#define PIO_KIER_KPR (0x1u << 0) /**< \brief (PIO_KIER) Key Press Interrupt Enable */ -#define PIO_KIER_KRL (0x1u << 1) /**< \brief (PIO_KIER) Key Release Interrupt Enable */ -/* -------- PIO_KIDR : (PIO Offset: 0x0134) Keypad Controller Interrupt Disable Register -------- */ -#define PIO_KIDR_KPR (0x1u << 0) /**< \brief (PIO_KIDR) Key Press Interrupt Disable */ -#define PIO_KIDR_KRL (0x1u << 1) /**< \brief (PIO_KIDR) Key Release Interrupt Disable */ -/* -------- PIO_KIMR : (PIO Offset: 0x0138) Keypad Controller Interrupt Mask Register -------- */ -#define PIO_KIMR_KPR (0x1u << 0) /**< \brief (PIO_KIMR) Key Press Interrupt Mask */ -#define PIO_KIMR_KRL (0x1u << 1) /**< \brief (PIO_KIMR) Key Release Interrupt Mask */ -/* -------- PIO_KSR : (PIO Offset: 0x013C) Keypad Controller Status Register -------- */ -#define PIO_KSR_KPR (0x1u << 0) /**< \brief (PIO_KSR) Key Press Status */ -#define PIO_KSR_KRL (0x1u << 1) /**< \brief (PIO_KSR) Key Release Status */ -#define PIO_KSR_NBKPR_Pos 8 -#define PIO_KSR_NBKPR_Msk (0x3u << PIO_KSR_NBKPR_Pos) /**< \brief (PIO_KSR) Number of Simultaneous Key Presses */ -#define PIO_KSR_NBKRL_Pos 16 -#define PIO_KSR_NBKRL_Msk (0x3u << PIO_KSR_NBKRL_Pos) /**< \brief (PIO_KSR) Number of Simultaneous Key Releases */ -/* -------- PIO_KKPR : (PIO Offset: 0x0140) Keypad Controller Key Press Register -------- */ -#define PIO_KKPR_KEY0ROW_Pos 0 -#define PIO_KKPR_KEY0ROW_Msk (0x7u << PIO_KKPR_KEY0ROW_Pos) /**< \brief (PIO_KKPR) Row Index of the First Detected Key Press */ -#define PIO_KKPR_KEY0COL_Pos 4 -#define PIO_KKPR_KEY0COL_Msk (0x7u << PIO_KKPR_KEY0COL_Pos) /**< \brief (PIO_KKPR) Column Index of the First Detected Key Press */ -#define PIO_KKPR_KEY1ROW_Pos 8 -#define PIO_KKPR_KEY1ROW_Msk (0x7u << PIO_KKPR_KEY1ROW_Pos) /**< \brief (PIO_KKPR) Row Index of the Second Detected Key Press */ -#define PIO_KKPR_KEY1COL_Pos 12 -#define PIO_KKPR_KEY1COL_Msk (0x7u << PIO_KKPR_KEY1COL_Pos) /**< \brief (PIO_KKPR) Column Index of the Second Detected Key Press */ -#define PIO_KKPR_KEY2ROW_Pos 16 -#define PIO_KKPR_KEY2ROW_Msk (0x7u << PIO_KKPR_KEY2ROW_Pos) /**< \brief (PIO_KKPR) Row Index of the Third Detected Key Press */ -#define PIO_KKPR_KEY2COL_Pos 20 -#define PIO_KKPR_KEY2COL_Msk (0x7u << PIO_KKPR_KEY2COL_Pos) /**< \brief (PIO_KKPR) Column Index of the Third Detected Key Press */ -#define PIO_KKPR_KEY3ROW_Pos 24 -#define PIO_KKPR_KEY3ROW_Msk (0x7u << PIO_KKPR_KEY3ROW_Pos) /**< \brief (PIO_KKPR) Row Index of the Fourth Detected Key Press */ -#define PIO_KKPR_KEY3COL_Pos 28 -#define PIO_KKPR_KEY3COL_Msk (0x7u << PIO_KKPR_KEY3COL_Pos) /**< \brief (PIO_KKPR) Column Index of the Fourth Detected Key Press */ -/* -------- PIO_KKRR : (PIO Offset: 0x0144) Keypad Controller Key Release Register -------- */ -#define PIO_KKRR_KEY0ROW_Pos 0 -#define PIO_KKRR_KEY0ROW_Msk (0x7u << PIO_KKRR_KEY0ROW_Pos) /**< \brief (PIO_KKRR) Row Index of the First Detected Key Release */ -#define PIO_KKRR_KEY0COL_Pos 4 -#define PIO_KKRR_KEY0COL_Msk (0x7u << PIO_KKRR_KEY0COL_Pos) /**< \brief (PIO_KKRR) Column Index of the First Detected Key Release */ -#define PIO_KKRR_KEY1ROW_Pos 8 -#define PIO_KKRR_KEY1ROW_Msk (0x7u << PIO_KKRR_KEY1ROW_Pos) /**< \brief (PIO_KKRR) Row Index of the Second Detected Key Release */ -#define PIO_KKRR_KEY1COL_Pos 12 -#define PIO_KKRR_KEY1COL_Msk (0x7u << PIO_KKRR_KEY1COL_Pos) /**< \brief (PIO_KKRR) Column Index of the Second Detected Key Release */ -#define PIO_KKRR_KEY2ROW_Pos 16 -#define PIO_KKRR_KEY2ROW_Msk (0x7u << PIO_KKRR_KEY2ROW_Pos) /**< \brief (PIO_KKRR) Row Index of the Third Detected Key Release */ -#define PIO_KKRR_KEY2COL_Pos 20 -#define PIO_KKRR_KEY2COL_Msk (0x7u << PIO_KKRR_KEY2COL_Pos) /**< \brief (PIO_KKRR) Column Index of the Third Detected Key Release */ -#define PIO_KKRR_KEY3ROW_Pos 24 -#define PIO_KKRR_KEY3ROW_Msk (0x7u << PIO_KKRR_KEY3ROW_Pos) /**< \brief (PIO_KKRR) Row Index of the Fourth Detected Key Release */ -#define PIO_KKRR_KEY3COL_Pos 28 -#define PIO_KKRR_KEY3COL_Msk (0x7u << PIO_KKRR_KEY3COL_Pos) /**< \brief (PIO_KKRR) Column Index of the Fourth Detected Key Release */ -/* -------- PIO_PCMR : (PIO Offset: 0x0150) Parallel Capture Mode Register -------- */ -#define PIO_PCMR_PCEN (0x1u << 0) /**< \brief (PIO_PCMR) Parallel Capture Mode Enable */ -#define PIO_PCMR_DSIZE_Pos 4 -#define PIO_PCMR_DSIZE_Msk (0x3u << PIO_PCMR_DSIZE_Pos) /**< \brief (PIO_PCMR) Parallel Capture Mode Data Size */ -#define PIO_PCMR_DSIZE(value) ((PIO_PCMR_DSIZE_Msk & ((value) << PIO_PCMR_DSIZE_Pos))) -#define PIO_PCMR_DSIZE_BYTE (0x0u << 4) /**< \brief (PIO_PCMR) The reception data in the PIO_PCRHR is a byte (8-bit) */ -#define PIO_PCMR_DSIZE_HALFWORD (0x1u << 4) /**< \brief (PIO_PCMR) The reception data in the PIO_PCRHR is a half-word (16-bit) */ -#define PIO_PCMR_DSIZE_WORD (0x2u << 4) /**< \brief (PIO_PCMR) The reception data in the PIO_PCRHR is a word (32-bit) */ -#define PIO_PCMR_ALWYS (0x1u << 9) /**< \brief (PIO_PCMR) Parallel Capture Mode Always Sampling */ -#define PIO_PCMR_HALFS (0x1u << 10) /**< \brief (PIO_PCMR) Parallel Capture Mode Half Sampling */ -#define PIO_PCMR_FRSTS (0x1u << 11) /**< \brief (PIO_PCMR) Parallel Capture Mode First Sample */ -/* -------- PIO_PCIER : (PIO Offset: 0x0154) Parallel Capture Interrupt Enable Register -------- */ -#define PIO_PCIER_DRDY (0x1u << 0) /**< \brief (PIO_PCIER) Parallel Capture Mode Data Ready Interrupt Enable */ -#define PIO_PCIER_OVRE (0x1u << 1) /**< \brief (PIO_PCIER) Parallel Capture Mode Overrun Error Interrupt Enable */ -#define PIO_PCIER_ENDRX (0x1u << 2) /**< \brief (PIO_PCIER) End of Reception Transfer Interrupt Enable */ -#define PIO_PCIER_RXBUFF (0x1u << 3) /**< \brief (PIO_PCIER) Reception Buffer Full Interrupt Enable */ -/* -------- PIO_PCIDR : (PIO Offset: 0x0158) Parallel Capture Interrupt Disable Register -------- */ -#define PIO_PCIDR_DRDY (0x1u << 0) /**< \brief (PIO_PCIDR) Parallel Capture Mode Data Ready Interrupt Disable */ -#define PIO_PCIDR_OVRE (0x1u << 1) /**< \brief (PIO_PCIDR) Parallel Capture Mode Overrun Error Interrupt Disable */ -#define PIO_PCIDR_ENDRX (0x1u << 2) /**< \brief (PIO_PCIDR) End of Reception Transfer Interrupt Disable */ -#define PIO_PCIDR_RXBUFF (0x1u << 3) /**< \brief (PIO_PCIDR) Reception Buffer Full Interrupt Disable */ -/* -------- PIO_PCIMR : (PIO Offset: 0x015C) Parallel Capture Interrupt Mask Register -------- */ -#define PIO_PCIMR_DRDY (0x1u << 0) /**< \brief (PIO_PCIMR) Parallel Capture Mode Data Ready Interrupt Mask */ -#define PIO_PCIMR_OVRE (0x1u << 1) /**< \brief (PIO_PCIMR) Parallel Capture Mode Overrun Error Interrupt Mask */ -#define PIO_PCIMR_ENDRX (0x1u << 2) /**< \brief (PIO_PCIMR) End of Reception Transfer Interrupt Mask */ -#define PIO_PCIMR_RXBUFF (0x1u << 3) /**< \brief (PIO_PCIMR) Reception Buffer Full Interrupt Mask */ -/* -------- PIO_PCISR : (PIO Offset: 0x0160) Parallel Capture Interrupt Status Register -------- */ -#define PIO_PCISR_DRDY (0x1u << 0) /**< \brief (PIO_PCISR) Parallel Capture Mode Data Ready */ -#define PIO_PCISR_OVRE (0x1u << 1) /**< \brief (PIO_PCISR) Parallel Capture Mode Overrun Error */ -/* -------- PIO_PCRHR : (PIO Offset: 0x0164) Parallel Capture Reception Holding Register -------- */ -#define PIO_PCRHR_RDATA_Pos 0 -#define PIO_PCRHR_RDATA_Msk (0xffffffffu << PIO_PCRHR_RDATA_Pos) /**< \brief (PIO_PCRHR) Parallel Capture Mode Reception Data */ - -/*@}*/ - - -#endif /* _SAMV71_PIO_COMPONENT_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_pmc.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_pmc.h deleted file mode 100644 index 540791f1..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_pmc.h +++ /dev/null @@ -1,721 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_PMC_COMPONENT_ -#define _SAMV71_PMC_COMPONENT_ - -/* ============================================================================= */ -/** SOFTWARE API DEFINITION FOR Power Management Controller */ -/* ============================================================================= */ -/** \addtogroup SAMV71_PMC Power Management Controller */ -/*@{*/ - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -/** \brief Pmc hardware registers */ -typedef struct { - __O uint32_t PMC_SCER; /**< \brief (Pmc Offset: 0x0000) System Clock Enable Register */ - __O uint32_t PMC_SCDR; /**< \brief (Pmc Offset: 0x0004) System Clock Disable Register */ - __I uint32_t PMC_SCSR; /**< \brief (Pmc Offset: 0x0008) System Clock Status Register */ - __I uint32_t Reserved1[1]; - __O uint32_t PMC_PCER0; /**< \brief (Pmc Offset: 0x0010) Peripheral Clock Enable Register 0 */ - __O uint32_t PMC_PCDR0; /**< \brief (Pmc Offset: 0x0014) Peripheral Clock Disable Register 0 */ - __I uint32_t PMC_PCSR0; /**< \brief (Pmc Offset: 0x0018) Peripheral Clock Status Register 0 */ - __IO uint32_t CKGR_UCKR; /**< \brief (Pmc Offset: 0x001C) UTMI Clock Register */ - __IO uint32_t CKGR_MOR; /**< \brief (Pmc Offset: 0x0020) Main Oscillator Register */ - __IO uint32_t CKGR_MCFR; /**< \brief (Pmc Offset: 0x0024) Main Clock Frequency Register */ - __IO uint32_t CKGR_PLLAR; /**< \brief (Pmc Offset: 0x0028) PLLA Register */ - __I uint32_t Reserved2[1]; - __IO uint32_t PMC_MCKR; /**< \brief (Pmc Offset: 0x0030) Master Clock Register */ - __I uint32_t Reserved3[1]; - __IO uint32_t PMC_USB; /**< \brief (Pmc Offset: 0x0038) USB Clock Register */ - __I uint32_t Reserved4[1]; - __IO uint32_t PMC_PCK[7]; /**< \brief (Pmc Offset: 0x0040) Programmable Clock 0 Register */ - __I uint32_t Reserved5[1]; - __O uint32_t PMC_IER; /**< \brief (Pmc Offset: 0x0060) Interrupt Enable Register */ - __O uint32_t PMC_IDR; /**< \brief (Pmc Offset: 0x0064) Interrupt Disable Register */ - __I uint32_t PMC_SR; /**< \brief (Pmc Offset: 0x0068) Status Register */ - __I uint32_t PMC_IMR; /**< \brief (Pmc Offset: 0x006C) Interrupt Mask Register */ - __IO uint32_t PMC_FSMR; /**< \brief (Pmc Offset: 0x0070) Fast Startup Mode Register */ - __IO uint32_t PMC_FSPR; /**< \brief (Pmc Offset: 0x0074) Fast Startup Polarity Register */ - __O uint32_t PMC_FOCR; /**< \brief (Pmc Offset: 0x0078) Fault Output Clear Register */ - __I uint32_t Reserved6[26]; - __IO uint32_t PMC_WPMR; /**< \brief (Pmc Offset: 0x00E4) Write Protection Mode Register */ - __I uint32_t PMC_WPSR; /**< \brief (Pmc Offset: 0x00E8) Write Protection Status Register */ - __I uint32_t Reserved7[5]; - __O uint32_t PMC_PCER1; /**< \brief (Pmc Offset: 0x0100) Peripheral Clock Enable Register 1 */ - __O uint32_t PMC_PCDR1; /**< \brief (Pmc Offset: 0x0104) Peripheral Clock Disable Register 1 */ - __I uint32_t PMC_PCSR1; /**< \brief (Pmc Offset: 0x0108) Peripheral Clock Status Register 1 */ - __IO uint32_t PMC_PCR; /**< \brief (Pmc Offset: 0x010C) Peripheral Control Register */ - __IO uint32_t PMC_OCR; /**< \brief (Pmc Offset: 0x0110) Oscillator Calibration Register */ - __O uint32_t PMC_SLPWK_ER0; /**< \brief (Pmc Offset: 0x0114) SleepWalking Enable Register 0 */ - __O uint32_t PMC_SLPWK_DR0; /**< \brief (Pmc Offset: 0x0118) SleepWalking Disable Register 0 */ - __I uint32_t PMC_SLPWK_SR0; /**< \brief (Pmc Offset: 0x011C) SleepWalking Status Register 0 */ - __I uint32_t PMC_SLPWK_ASR0; /**< \brief (Pmc Offset: 0x0120) SleepWalking Activity Status Register 0 */ - __I uint32_t Reserved8[4]; - __O uint32_t PMC_SLPWK_ER1; /**< \brief (Pmc Offset: 0x0134) SleepWalking Enable Register 1 */ - __O uint32_t PMC_SLPWK_DR1; /**< \brief (Pmc Offset: 0x0138) SleepWalking Disable Register 1 */ - __I uint32_t PMC_SLPWK_SR1; /**< \brief (Pmc Offset: 0x013C) SleepWalking Status Register 1 */ - __I uint32_t PMC_SLPWK_ASR1; /**< \brief (Pmc Offset: 0x0140) SleepWalking Activity Status Register 1 */ - __I uint32_t PMC_SLPWK_AIPR; /**< \brief (Pmc Offset: 0x0144) SleepWalking Activity In Progress Register */ -} Pmc; -#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/* -------- PMC_SCER : (PMC Offset: 0x0000) System Clock Enable Register -------- */ -#define PMC_SCER_USBCLK (0x1u << 5) /**< \brief (PMC_SCER) Enable USB FS Clock */ -#define PMC_SCER_PCK0 (0x1u << 8) /**< \brief (PMC_SCER) Programmable Clock 0 Output Enable */ -#define PMC_SCER_PCK1 (0x1u << 9) /**< \brief (PMC_SCER) Programmable Clock 1 Output Enable */ -#define PMC_SCER_PCK2 (0x1u << 10) /**< \brief (PMC_SCER) Programmable Clock 2 Output Enable */ -#define PMC_SCER_PCK3 (0x1u << 11) /**< \brief (PMC_SCER) Programmable Clock 3 Output Enable */ -#define PMC_SCER_PCK4 (0x1u << 12) /**< \brief (PMC_SCER) Programmable Clock 4 Output Enable */ -#define PMC_SCER_PCK5 (0x1u << 13) /**< \brief (PMC_SCER) Programmable Clock 5 Output Enable */ -#define PMC_SCER_PCK6 (0x1u << 14) /**< \brief (PMC_SCER) Programmable Clock 6 Output Enable */ -/* -------- PMC_SCDR : (PMC Offset: 0x0004) System Clock Disable Register -------- */ -#define PMC_SCDR_USBCLK (0x1u << 5) /**< \brief (PMC_SCDR) Disable USB FS Clock */ -#define PMC_SCDR_PCK0 (0x1u << 8) /**< \brief (PMC_SCDR) Programmable Clock 0 Output Disable */ -#define PMC_SCDR_PCK1 (0x1u << 9) /**< \brief (PMC_SCDR) Programmable Clock 1 Output Disable */ -#define PMC_SCDR_PCK2 (0x1u << 10) /**< \brief (PMC_SCDR) Programmable Clock 2 Output Disable */ -#define PMC_SCDR_PCK3 (0x1u << 11) /**< \brief (PMC_SCDR) Programmable Clock 3 Output Disable */ -#define PMC_SCDR_PCK4 (0x1u << 12) /**< \brief (PMC_SCDR) Programmable Clock 4 Output Disable */ -#define PMC_SCDR_PCK5 (0x1u << 13) /**< \brief (PMC_SCDR) Programmable Clock 5 Output Disable */ -#define PMC_SCDR_PCK6 (0x1u << 14) /**< \brief (PMC_SCDR) Programmable Clock 6 Output Disable */ -/* -------- PMC_SCSR : (PMC Offset: 0x0008) System Clock Status Register -------- */ -#define PMC_SCSR_USBCLK (0x1u << 5) /**< \brief (PMC_SCSR) USB FS Clock Status */ -#define PMC_SCSR_PCK0 (0x1u << 8) /**< \brief (PMC_SCSR) Programmable Clock 0 Output Status */ -#define PMC_SCSR_PCK1 (0x1u << 9) /**< \brief (PMC_SCSR) Programmable Clock 1 Output Status */ -#define PMC_SCSR_PCK2 (0x1u << 10) /**< \brief (PMC_SCSR) Programmable Clock 2 Output Status */ -#define PMC_SCSR_PCK3 (0x1u << 11) /**< \brief (PMC_SCSR) Programmable Clock 3 Output Status */ -#define PMC_SCSR_PCK4 (0x1u << 12) /**< \brief (PMC_SCSR) Programmable Clock 4 Output Status */ -#define PMC_SCSR_PCK5 (0x1u << 13) /**< \brief (PMC_SCSR) Programmable Clock 5 Output Status */ -#define PMC_SCSR_PCK6 (0x1u << 14) /**< \brief (PMC_SCSR) Programmable Clock 6 Output Status */ -/* -------- PMC_PCER0 : (PMC Offset: 0x0010) Peripheral Clock Enable Register 0 -------- */ -#define PMC_PCER0_PID7 (0x1u << 7) /**< \brief (PMC_PCER0) Peripheral Clock 7 Enable */ -#define PMC_PCER0_PID8 (0x1u << 8) /**< \brief (PMC_PCER0) Peripheral Clock 8 Enable */ -#define PMC_PCER0_PID9 (0x1u << 9) /**< \brief (PMC_PCER0) Peripheral Clock 9 Enable */ -#define PMC_PCER0_PID10 (0x1u << 10) /**< \brief (PMC_PCER0) Peripheral Clock 10 Enable */ -#define PMC_PCER0_PID11 (0x1u << 11) /**< \brief (PMC_PCER0) Peripheral Clock 11 Enable */ -#define PMC_PCER0_PID12 (0x1u << 12) /**< \brief (PMC_PCER0) Peripheral Clock 12 Enable */ -#define PMC_PCER0_PID13 (0x1u << 13) /**< \brief (PMC_PCER0) Peripheral Clock 13 Enable */ -#define PMC_PCER0_PID14 (0x1u << 14) /**< \brief (PMC_PCER0) Peripheral Clock 14 Enable */ -#define PMC_PCER0_PID15 (0x1u << 15) /**< \brief (PMC_PCER0) Peripheral Clock 15 Enable */ -#define PMC_PCER0_PID16 (0x1u << 16) /**< \brief (PMC_PCER0) Peripheral Clock 16 Enable */ -#define PMC_PCER0_PID17 (0x1u << 17) /**< \brief (PMC_PCER0) Peripheral Clock 17 Enable */ -#define PMC_PCER0_PID18 (0x1u << 18) /**< \brief (PMC_PCER0) Peripheral Clock 18 Enable */ -#define PMC_PCER0_PID19 (0x1u << 19) /**< \brief (PMC_PCER0) Peripheral Clock 19 Enable */ -#define PMC_PCER0_PID20 (0x1u << 20) /**< \brief (PMC_PCER0) Peripheral Clock 20 Enable */ -#define PMC_PCER0_PID21 (0x1u << 21) /**< \brief (PMC_PCER0) Peripheral Clock 21 Enable */ -#define PMC_PCER0_PID22 (0x1u << 22) /**< \brief (PMC_PCER0) Peripheral Clock 22 Enable */ -#define PMC_PCER0_PID23 (0x1u << 23) /**< \brief (PMC_PCER0) Peripheral Clock 23 Enable */ -#define PMC_PCER0_PID24 (0x1u << 24) /**< \brief (PMC_PCER0) Peripheral Clock 24 Enable */ -#define PMC_PCER0_PID25 (0x1u << 25) /**< \brief (PMC_PCER0) Peripheral Clock 25 Enable */ -#define PMC_PCER0_PID26 (0x1u << 26) /**< \brief (PMC_PCER0) Peripheral Clock 26 Enable */ -#define PMC_PCER0_PID27 (0x1u << 27) /**< \brief (PMC_PCER0) Peripheral Clock 27 Enable */ -#define PMC_PCER0_PID28 (0x1u << 28) /**< \brief (PMC_PCER0) Peripheral Clock 28 Enable */ -#define PMC_PCER0_PID29 (0x1u << 29) /**< \brief (PMC_PCER0) Peripheral Clock 29 Enable */ -#define PMC_PCER0_PID30 (0x1u << 30) /**< \brief (PMC_PCER0) Peripheral Clock 30 Enable */ -#define PMC_PCER0_PID31 (0x1u << 31) /**< \brief (PMC_PCER0) Peripheral Clock 31 Enable */ -/* -------- PMC_PCDR0 : (PMC Offset: 0x0014) Peripheral Clock Disable Register 0 -------- */ -#define PMC_PCDR0_PID7 (0x1u << 7) /**< \brief (PMC_PCDR0) Peripheral Clock 7 Disable */ -#define PMC_PCDR0_PID8 (0x1u << 8) /**< \brief (PMC_PCDR0) Peripheral Clock 8 Disable */ -#define PMC_PCDR0_PID9 (0x1u << 9) /**< \brief (PMC_PCDR0) Peripheral Clock 9 Disable */ -#define PMC_PCDR0_PID10 (0x1u << 10) /**< \brief (PMC_PCDR0) Peripheral Clock 10 Disable */ -#define PMC_PCDR0_PID11 (0x1u << 11) /**< \brief (PMC_PCDR0) Peripheral Clock 11 Disable */ -#define PMC_PCDR0_PID12 (0x1u << 12) /**< \brief (PMC_PCDR0) Peripheral Clock 12 Disable */ -#define PMC_PCDR0_PID13 (0x1u << 13) /**< \brief (PMC_PCDR0) Peripheral Clock 13 Disable */ -#define PMC_PCDR0_PID14 (0x1u << 14) /**< \brief (PMC_PCDR0) Peripheral Clock 14 Disable */ -#define PMC_PCDR0_PID15 (0x1u << 15) /**< \brief (PMC_PCDR0) Peripheral Clock 15 Disable */ -#define PMC_PCDR0_PID16 (0x1u << 16) /**< \brief (PMC_PCDR0) Peripheral Clock 16 Disable */ -#define PMC_PCDR0_PID17 (0x1u << 17) /**< \brief (PMC_PCDR0) Peripheral Clock 17 Disable */ -#define PMC_PCDR0_PID18 (0x1u << 18) /**< \brief (PMC_PCDR0) Peripheral Clock 18 Disable */ -#define PMC_PCDR0_PID19 (0x1u << 19) /**< \brief (PMC_PCDR0) Peripheral Clock 19 Disable */ -#define PMC_PCDR0_PID20 (0x1u << 20) /**< \brief (PMC_PCDR0) Peripheral Clock 20 Disable */ -#define PMC_PCDR0_PID21 (0x1u << 21) /**< \brief (PMC_PCDR0) Peripheral Clock 21 Disable */ -#define PMC_PCDR0_PID22 (0x1u << 22) /**< \brief (PMC_PCDR0) Peripheral Clock 22 Disable */ -#define PMC_PCDR0_PID23 (0x1u << 23) /**< \brief (PMC_PCDR0) Peripheral Clock 23 Disable */ -#define PMC_PCDR0_PID24 (0x1u << 24) /**< \brief (PMC_PCDR0) Peripheral Clock 24 Disable */ -#define PMC_PCDR0_PID25 (0x1u << 25) /**< \brief (PMC_PCDR0) Peripheral Clock 25 Disable */ -#define PMC_PCDR0_PID26 (0x1u << 26) /**< \brief (PMC_PCDR0) Peripheral Clock 26 Disable */ -#define PMC_PCDR0_PID27 (0x1u << 27) /**< \brief (PMC_PCDR0) Peripheral Clock 27 Disable */ -#define PMC_PCDR0_PID28 (0x1u << 28) /**< \brief (PMC_PCDR0) Peripheral Clock 28 Disable */ -#define PMC_PCDR0_PID29 (0x1u << 29) /**< \brief (PMC_PCDR0) Peripheral Clock 29 Disable */ -#define PMC_PCDR0_PID30 (0x1u << 30) /**< \brief (PMC_PCDR0) Peripheral Clock 30 Disable */ -#define PMC_PCDR0_PID31 (0x1u << 31) /**< \brief (PMC_PCDR0) Peripheral Clock 31 Disable */ -/* -------- PMC_PCSR0 : (PMC Offset: 0x0018) Peripheral Clock Status Register 0 -------- */ -#define PMC_PCSR0_PID7 (0x1u << 7) /**< \brief (PMC_PCSR0) Peripheral Clock 7 Status */ -#define PMC_PCSR0_PID8 (0x1u << 8) /**< \brief (PMC_PCSR0) Peripheral Clock 8 Status */ -#define PMC_PCSR0_PID9 (0x1u << 9) /**< \brief (PMC_PCSR0) Peripheral Clock 9 Status */ -#define PMC_PCSR0_PID10 (0x1u << 10) /**< \brief (PMC_PCSR0) Peripheral Clock 10 Status */ -#define PMC_PCSR0_PID11 (0x1u << 11) /**< \brief (PMC_PCSR0) Peripheral Clock 11 Status */ -#define PMC_PCSR0_PID12 (0x1u << 12) /**< \brief (PMC_PCSR0) Peripheral Clock 12 Status */ -#define PMC_PCSR0_PID13 (0x1u << 13) /**< \brief (PMC_PCSR0) Peripheral Clock 13 Status */ -#define PMC_PCSR0_PID14 (0x1u << 14) /**< \brief (PMC_PCSR0) Peripheral Clock 14 Status */ -#define PMC_PCSR0_PID15 (0x1u << 15) /**< \brief (PMC_PCSR0) Peripheral Clock 15 Status */ -#define PMC_PCSR0_PID16 (0x1u << 16) /**< \brief (PMC_PCSR0) Peripheral Clock 16 Status */ -#define PMC_PCSR0_PID17 (0x1u << 17) /**< \brief (PMC_PCSR0) Peripheral Clock 17 Status */ -#define PMC_PCSR0_PID18 (0x1u << 18) /**< \brief (PMC_PCSR0) Peripheral Clock 18 Status */ -#define PMC_PCSR0_PID19 (0x1u << 19) /**< \brief (PMC_PCSR0) Peripheral Clock 19 Status */ -#define PMC_PCSR0_PID20 (0x1u << 20) /**< \brief (PMC_PCSR0) Peripheral Clock 20 Status */ -#define PMC_PCSR0_PID21 (0x1u << 21) /**< \brief (PMC_PCSR0) Peripheral Clock 21 Status */ -#define PMC_PCSR0_PID22 (0x1u << 22) /**< \brief (PMC_PCSR0) Peripheral Clock 22 Status */ -#define PMC_PCSR0_PID23 (0x1u << 23) /**< \brief (PMC_PCSR0) Peripheral Clock 23 Status */ -#define PMC_PCSR0_PID24 (0x1u << 24) /**< \brief (PMC_PCSR0) Peripheral Clock 24 Status */ -#define PMC_PCSR0_PID25 (0x1u << 25) /**< \brief (PMC_PCSR0) Peripheral Clock 25 Status */ -#define PMC_PCSR0_PID26 (0x1u << 26) /**< \brief (PMC_PCSR0) Peripheral Clock 26 Status */ -#define PMC_PCSR0_PID27 (0x1u << 27) /**< \brief (PMC_PCSR0) Peripheral Clock 27 Status */ -#define PMC_PCSR0_PID28 (0x1u << 28) /**< \brief (PMC_PCSR0) Peripheral Clock 28 Status */ -#define PMC_PCSR0_PID29 (0x1u << 29) /**< \brief (PMC_PCSR0) Peripheral Clock 29 Status */ -#define PMC_PCSR0_PID30 (0x1u << 30) /**< \brief (PMC_PCSR0) Peripheral Clock 30 Status */ -#define PMC_PCSR0_PID31 (0x1u << 31) /**< \brief (PMC_PCSR0) Peripheral Clock 31 Status */ -/* -------- CKGR_UCKR : (PMC Offset: 0x001C) UTMI Clock Register -------- */ -#define CKGR_UCKR_UPLLEN (0x1u << 16) /**< \brief (CKGR_UCKR) UTMI PLL Enable */ -#define CKGR_UCKR_UPLLCOUNT_Pos 20 -#define CKGR_UCKR_UPLLCOUNT_Msk (0xfu << CKGR_UCKR_UPLLCOUNT_Pos) /**< \brief (CKGR_UCKR) UTMI PLL Start-up Time */ -#define CKGR_UCKR_UPLLCOUNT(value) ((CKGR_UCKR_UPLLCOUNT_Msk & ((value) << CKGR_UCKR_UPLLCOUNT_Pos))) -/* -------- CKGR_MOR : (PMC Offset: 0x0020) Main Oscillator Register -------- */ -#define CKGR_MOR_MOSCXTEN (0x1u << 0) /**< \brief (CKGR_MOR) Main Crystal Oscillator Enable */ -#define CKGR_MOR_MOSCXTBY (0x1u << 1) /**< \brief (CKGR_MOR) Main Crystal Oscillator Bypass */ -#define CKGR_MOR_WAITMODE (0x1u << 2) /**< \brief (CKGR_MOR) Wait Mode Command (Write-only) */ -#define CKGR_MOR_MOSCRCEN (0x1u << 3) /**< \brief (CKGR_MOR) Main On-Chip RC Oscillator Enable */ -#define CKGR_MOR_MOSCRCF_Pos 4 -#define CKGR_MOR_MOSCRCF_Msk (0x7u << CKGR_MOR_MOSCRCF_Pos) /**< \brief (CKGR_MOR) Main On-Chip RC Oscillator Frequency Selection */ -#define CKGR_MOR_MOSCRCF(value) ((CKGR_MOR_MOSCRCF_Msk & ((value) << CKGR_MOR_MOSCRCF_Pos))) -#define CKGR_MOR_MOSCRCF_4_MHz (0x0u << 4) /**< \brief (CKGR_MOR) Fast RC oscillator frequency is at 4 MHz (default) */ -#define CKGR_MOR_MOSCRCF_8_MHz (0x1u << 4) /**< \brief (CKGR_MOR) Fast RC oscillator frequency is at 8 MHz */ -#define CKGR_MOR_MOSCRCF_12_MHz (0x2u << 4) /**< \brief (CKGR_MOR) Fast RC oscillator frequency is at 12 MHz */ -#define CKGR_MOR_MOSCXTST_Pos 8 -#define CKGR_MOR_MOSCXTST_Msk (0xffu << CKGR_MOR_MOSCXTST_Pos) /**< \brief (CKGR_MOR) Main Crystal Oscillator Start-up Time */ -#define CKGR_MOR_MOSCXTST(value) ((CKGR_MOR_MOSCXTST_Msk & ((value) << CKGR_MOR_MOSCXTST_Pos))) -#define CKGR_MOR_KEY_Pos 16 -#define CKGR_MOR_KEY_Msk (0xffu << CKGR_MOR_KEY_Pos) /**< \brief (CKGR_MOR) Write Access Password */ -#define CKGR_MOR_KEY(value) ((CKGR_MOR_KEY_Msk & ((value) << CKGR_MOR_KEY_Pos))) -#define CKGR_MOR_KEY_PASSWD (0x37u << 16) /**< \brief (CKGR_MOR) Writing any other value in this field aborts the write operation.Always reads as 0. */ -#define CKGR_MOR_MOSCSEL (0x1u << 24) /**< \brief (CKGR_MOR) Main Oscillator Selection */ -#define CKGR_MOR_CFDEN (0x1u << 25) /**< \brief (CKGR_MOR) Clock Failure Detector Enable */ -#define CKGR_MOR_XT32KFME (0x1u << 26) /**< \brief (CKGR_MOR) Slow Crystal Oscillator Frequency Monitoring Enable */ -/* -------- CKGR_MCFR : (PMC Offset: 0x0024) Main Clock Frequency Register -------- */ -#define CKGR_MCFR_MAINF_Pos 0 -#define CKGR_MCFR_MAINF_Msk (0xffffu << CKGR_MCFR_MAINF_Pos) /**< \brief (CKGR_MCFR) Main Clock Frequency */ -#define CKGR_MCFR_MAINF(value) ((CKGR_MCFR_MAINF_Msk & ((value) << CKGR_MCFR_MAINF_Pos))) -#define CKGR_MCFR_MAINFRDY (0x1u << 16) /**< \brief (CKGR_MCFR) Main Clock Frequency Measure Ready */ -#define CKGR_MCFR_RCMEAS (0x1u << 20) /**< \brief (CKGR_MCFR) RC Oscillator Frequency Measure (write-only) */ -#define CKGR_MCFR_CCSS (0x1u << 24) /**< \brief (CKGR_MCFR) Counter Clock Source Selection */ -/* -------- CKGR_PLLAR : (PMC Offset: 0x0028) PLLA Register -------- */ -#define CKGR_PLLAR_DIVA_Pos 0 -#define CKGR_PLLAR_DIVA_Msk (0xffu << CKGR_PLLAR_DIVA_Pos) /**< \brief (CKGR_PLLAR) PLLA Front End Divider */ -#define CKGR_PLLAR_DIVA(value) ((CKGR_PLLAR_DIVA_Msk & ((value) << CKGR_PLLAR_DIVA_Pos))) -#define CKGR_PLLAR_DIVA_0 (0x0u << 0) /**< \brief (CKGR_PLLAR) Divider output is 0 and PLLA is disabled. */ -#define CKGR_PLLAR_DIVA_BYPASS (0x1u << 0) /**< \brief (CKGR_PLLAR) Divider is bypassed (divide by 1) and PLLA is enabled. */ -#define CKGR_PLLAR_PLLACOUNT_Pos 8 -#define CKGR_PLLAR_PLLACOUNT_Msk (0x3fu << CKGR_PLLAR_PLLACOUNT_Pos) /**< \brief (CKGR_PLLAR) PLLA Counter */ -#define CKGR_PLLAR_PLLACOUNT(value) ((CKGR_PLLAR_PLLACOUNT_Msk & ((value) << CKGR_PLLAR_PLLACOUNT_Pos))) -#define CKGR_PLLAR_MULA_Pos 16 -#define CKGR_PLLAR_MULA_Msk (0x7ffu << CKGR_PLLAR_MULA_Pos) /**< \brief (CKGR_PLLAR) PLLA Multiplier */ -#define CKGR_PLLAR_MULA(value) ((CKGR_PLLAR_MULA_Msk & ((value) << CKGR_PLLAR_MULA_Pos))) -#define CKGR_PLLAR_ONE (0x1u << 29) /**< \brief (CKGR_PLLAR) Must Be Set to 1 */ -/* -------- PMC_MCKR : (PMC Offset: 0x0030) Master Clock Register -------- */ -#define PMC_MCKR_CSS_Pos 0 -#define PMC_MCKR_CSS_Msk (0x3u << PMC_MCKR_CSS_Pos) /**< \brief (PMC_MCKR) Master Clock Source Selection */ -#define PMC_MCKR_CSS(value) ((PMC_MCKR_CSS_Msk & ((value) << PMC_MCKR_CSS_Pos))) -#define PMC_MCKR_CSS_SLOW_CLK (0x0u << 0) /**< \brief (PMC_MCKR) Slow Clock is selected */ -#define PMC_MCKR_CSS_MAIN_CLK (0x1u << 0) /**< \brief (PMC_MCKR) Main Clock is selected */ -#define PMC_MCKR_CSS_PLLA_CLK (0x2u << 0) /**< \brief (PMC_MCKR) PLLA Clock is selected */ -#define PMC_MCKR_CSS_UPLL_CLK (0x3u << 0) /**< \brief (PMC_MCKR) Divided UPLL Clock is selected */ -#define PMC_MCKR_PRES_Pos 4 -#define PMC_MCKR_PRES_Msk (0x7u << PMC_MCKR_PRES_Pos) /**< \brief (PMC_MCKR) Processor Clock Prescaler */ -#define PMC_MCKR_PRES(value) ((PMC_MCKR_PRES_Msk & ((value) << PMC_MCKR_PRES_Pos))) -#define PMC_MCKR_PRES_CLK_1 (0x0u << 4) /**< \brief (PMC_MCKR) Selected clock */ -#define PMC_MCKR_PRES_CLK_2 (0x1u << 4) /**< \brief (PMC_MCKR) Selected clock divided by 2 */ -#define PMC_MCKR_PRES_CLK_4 (0x2u << 4) /**< \brief (PMC_MCKR) Selected clock divided by 4 */ -#define PMC_MCKR_PRES_CLK_8 (0x3u << 4) /**< \brief (PMC_MCKR) Selected clock divided by 8 */ -#define PMC_MCKR_PRES_CLK_16 (0x4u << 4) /**< \brief (PMC_MCKR) Selected clock divided by 16 */ -#define PMC_MCKR_PRES_CLK_32 (0x5u << 4) /**< \brief (PMC_MCKR) Selected clock divided by 32 */ -#define PMC_MCKR_PRES_CLK_64 (0x6u << 4) /**< \brief (PMC_MCKR) Selected clock divided by 64 */ -#define PMC_MCKR_PRES_CLK_3 (0x7u << 4) /**< \brief (PMC_MCKR) Selected clock divided by 3 */ -#define PMC_MCKR_MDIV_Pos 8 -#define PMC_MCKR_MDIV_Msk (0x3u << PMC_MCKR_MDIV_Pos) /**< \brief (PMC_MCKR) Master Clock Division */ -#define PMC_MCKR_MDIV(value) ((PMC_MCKR_MDIV_Msk & ((value) << PMC_MCKR_MDIV_Pos))) -#define PMC_MCKR_MDIV_EQ_PCK (0x0u << 8) /**< \brief (PMC_MCKR) Master Clock is Prescaler Output Clock divided by 1. */ -#define PMC_MCKR_MDIV_PCK_DIV2 (0x1u << 8) /**< \brief (PMC_MCKR) Master Clock is Prescaler Output Clock divided by 2. */ -#define PMC_MCKR_MDIV_PCK_DIV4 (0x2u << 8) /**< \brief (PMC_MCKR) Master Clock is Prescaler Output Clock divided by 4. */ -#define PMC_MCKR_MDIV_PCK_DIV3 (0x3u << 8) /**< \brief (PMC_MCKR) Master Clock is Prescaler Output Clock divided by 3. */ -#define PMC_MCKR_UPLLDIV2 (0x1u << 13) /**< \brief (PMC_MCKR) UPLL Divisor by 2 */ -/* -------- PMC_USB : (PMC Offset: 0x0038) USB Clock Register -------- */ -#define PMC_USB_USBS (0x1u << 0) /**< \brief (PMC_USB) USB Input Clock Selection */ -#define PMC_USB_USBDIV_Pos 8 -#define PMC_USB_USBDIV_Msk (0xfu << PMC_USB_USBDIV_Pos) /**< \brief (PMC_USB) Divider for USB Clock */ -#define PMC_USB_USBDIV(value) ((PMC_USB_USBDIV_Msk & ((value) << PMC_USB_USBDIV_Pos))) -/* -------- PMC_PCK[7] : (PMC Offset: 0x0040) Programmable Clock 0 Register -------- */ -#define PMC_PCK_CSS_Pos 0 -#define PMC_PCK_CSS_Msk (0x7u << PMC_PCK_CSS_Pos) /**< \brief (PMC_PCK[7]) Master Clock Source Selection */ -#define PMC_PCK_CSS(value) ((PMC_PCK_CSS_Msk & ((value) << PMC_PCK_CSS_Pos))) -#define PMC_PCK_CSS_SLOW_CLK (0x0u << 0) /**< \brief (PMC_PCK[7]) Slow Clock is selected */ -#define PMC_PCK_CSS_MAIN_CLK (0x1u << 0) /**< \brief (PMC_PCK[7]) Main Clock is selected */ -#define PMC_PCK_CSS_PLLA_CLK (0x2u << 0) /**< \brief (PMC_PCK[7]) PLLA Clock is selected */ -#define PMC_PCK_CSS_UPLL_CLK (0x3u << 0) /**< \brief (PMC_PCK[7]) Divided UPLL Clock is selected */ -#define PMC_PCK_CSS_MCK (0x4u << 0) /**< \brief (PMC_PCK[7]) Master Clock is selected */ -#define PMC_PCK_PRES_Pos 4 -#define PMC_PCK_PRES_Msk (0xffu << PMC_PCK_PRES_Pos) /**< \brief (PMC_PCK[7]) Programmable Clock Prescaler */ -#define PMC_PCK_PRES(value) ((PMC_PCK_PRES_Msk & ((value) << PMC_PCK_PRES_Pos))) -/* -------- PMC_IER : (PMC Offset: 0x0060) Interrupt Enable Register -------- */ -#define PMC_IER_MOSCXTS (0x1u << 0) /**< \brief (PMC_IER) Main Crystal Oscillator Status Interrupt Enable */ -#define PMC_IER_LOCKA (0x1u << 1) /**< \brief (PMC_IER) PLLA Lock Interrupt Enable */ -#define PMC_IER_MCKRDY (0x1u << 3) /**< \brief (PMC_IER) Master Clock Ready Interrupt Enable */ -#define PMC_IER_LOCKU (0x1u << 6) /**< \brief (PMC_IER) UTMI PLL Lock Interrupt Enable */ -#define PMC_IER_PCKRDY0 (0x1u << 8) /**< \brief (PMC_IER) Programmable Clock Ready 0 Interrupt Enable */ -#define PMC_IER_PCKRDY1 (0x1u << 9) /**< \brief (PMC_IER) Programmable Clock Ready 1 Interrupt Enable */ -#define PMC_IER_PCKRDY2 (0x1u << 10) /**< \brief (PMC_IER) Programmable Clock Ready 2 Interrupt Enable */ -#define PMC_IER_PCKRDY3 (0x1u << 11) /**< \brief (PMC_IER) Programmable Clock Ready 3 Interrupt Enable */ -#define PMC_IER_PCKRDY4 (0x1u << 12) /**< \brief (PMC_IER) Programmable Clock Ready 4 Interrupt Enable */ -#define PMC_IER_PCKRDY5 (0x1u << 13) /**< \brief (PMC_IER) Programmable Clock Ready 5 Interrupt Enable */ -#define PMC_IER_PCKRDY6 (0x1u << 14) /**< \brief (PMC_IER) Programmable Clock Ready 6 Interrupt Enable */ -#define PMC_IER_MOSCSELS (0x1u << 16) /**< \brief (PMC_IER) Main Oscillator Selection Status Interrupt Enable */ -#define PMC_IER_MOSCRCS (0x1u << 17) /**< \brief (PMC_IER) Main On-Chip RC Status Interrupt Enable */ -#define PMC_IER_CFDEV (0x1u << 18) /**< \brief (PMC_IER) Clock Failure Detector Event Interrupt Enable */ -#define PMC_IER_XT32KERR (0x1u << 21) /**< \brief (PMC_IER) Slow Crystal Oscillator Error Interrupt Enable */ -/* -------- PMC_IDR : (PMC Offset: 0x0064) Interrupt Disable Register -------- */ -#define PMC_IDR_MOSCXTS (0x1u << 0) /**< \brief (PMC_IDR) Main Crystal Oscillator Status Interrupt Disable */ -#define PMC_IDR_LOCKA (0x1u << 1) /**< \brief (PMC_IDR) PLLA Lock Interrupt Disable */ -#define PMC_IDR_MCKRDY (0x1u << 3) /**< \brief (PMC_IDR) Master Clock Ready Interrupt Disable */ -#define PMC_IDR_LOCKU (0x1u << 6) /**< \brief (PMC_IDR) UTMI PLL Lock Interrupt Disable */ -#define PMC_IDR_PCKRDY0 (0x1u << 8) /**< \brief (PMC_IDR) Programmable Clock Ready 0 Interrupt Disable */ -#define PMC_IDR_PCKRDY1 (0x1u << 9) /**< \brief (PMC_IDR) Programmable Clock Ready 1 Interrupt Disable */ -#define PMC_IDR_PCKRDY2 (0x1u << 10) /**< \brief (PMC_IDR) Programmable Clock Ready 2 Interrupt Disable */ -#define PMC_IDR_PCKRDY3 (0x1u << 11) /**< \brief (PMC_IDR) Programmable Clock Ready 3 Interrupt Disable */ -#define PMC_IDR_PCKRDY4 (0x1u << 12) /**< \brief (PMC_IDR) Programmable Clock Ready 4 Interrupt Disable */ -#define PMC_IDR_PCKRDY5 (0x1u << 13) /**< \brief (PMC_IDR) Programmable Clock Ready 5 Interrupt Disable */ -#define PMC_IDR_PCKRDY6 (0x1u << 14) /**< \brief (PMC_IDR) Programmable Clock Ready 6 Interrupt Disable */ -#define PMC_IDR_MOSCSELS (0x1u << 16) /**< \brief (PMC_IDR) Main Oscillator Selection Status Interrupt Disable */ -#define PMC_IDR_MOSCRCS (0x1u << 17) /**< \brief (PMC_IDR) Main On-Chip RC Status Interrupt Disable */ -#define PMC_IDR_CFDEV (0x1u << 18) /**< \brief (PMC_IDR) Clock Failure Detector Event Interrupt Disable */ -#define PMC_IDR_XT32KERR (0x1u << 21) /**< \brief (PMC_IDR) Slow Crystal Oscillator Error Interrupt Disable */ -/* -------- PMC_SR : (PMC Offset: 0x0068) Status Register -------- */ -#define PMC_SR_MOSCXTS (0x1u << 0) /**< \brief (PMC_SR) Main Crystal Oscillator Status */ -#define PMC_SR_LOCKA (0x1u << 1) /**< \brief (PMC_SR) PLLA Lock Status */ -#define PMC_SR_MCKRDY (0x1u << 3) /**< \brief (PMC_SR) Master Clock Status */ -#define PMC_SR_LOCKU (0x1u << 6) /**< \brief (PMC_SR) UTMI PLL Lock Status */ -#define PMC_SR_OSCSELS (0x1u << 7) /**< \brief (PMC_SR) Slow Clock Oscillator Selection */ -#define PMC_SR_PCKRDY0 (0x1u << 8) /**< \brief (PMC_SR) Programmable Clock Ready Status */ -#define PMC_SR_PCKRDY1 (0x1u << 9) /**< \brief (PMC_SR) Programmable Clock Ready Status */ -#define PMC_SR_PCKRDY2 (0x1u << 10) /**< \brief (PMC_SR) Programmable Clock Ready Status */ -#define PMC_SR_PCKRDY3 (0x1u << 11) /**< \brief (PMC_SR) Programmable Clock Ready Status */ -#define PMC_SR_PCKRDY4 (0x1u << 12) /**< \brief (PMC_SR) Programmable Clock Ready Status */ -#define PMC_SR_PCKRDY5 (0x1u << 13) /**< \brief (PMC_SR) Programmable Clock Ready Status */ -#define PMC_SR_PCKRDY6 (0x1u << 14) /**< \brief (PMC_SR) Programmable Clock Ready Status */ -#define PMC_SR_MOSCSELS (0x1u << 16) /**< \brief (PMC_SR) Main Oscillator Selection Status */ -#define PMC_SR_MOSCRCS (0x1u << 17) /**< \brief (PMC_SR) Main On-Chip RC Oscillator Status */ -#define PMC_SR_CFDEV (0x1u << 18) /**< \brief (PMC_SR) Clock Failure Detector Event */ -#define PMC_SR_CFDS (0x1u << 19) /**< \brief (PMC_SR) Clock Failure Detector Status */ -#define PMC_SR_FOS (0x1u << 20) /**< \brief (PMC_SR) Clock Failure Detector Fault Output Status */ -#define PMC_SR_XT32KERR (0x1u << 21) /**< \brief (PMC_SR) Slow Crystal Oscillator Error */ -/* -------- PMC_IMR : (PMC Offset: 0x006C) Interrupt Mask Register -------- */ -#define PMC_IMR_MOSCXTS (0x1u << 0) /**< \brief (PMC_IMR) Main Crystal Oscillator Status Interrupt Mask */ -#define PMC_IMR_LOCKA (0x1u << 1) /**< \brief (PMC_IMR) PLLA Lock Interrupt Mask */ -#define PMC_IMR_MCKRDY (0x1u << 3) /**< \brief (PMC_IMR) Master Clock Ready Interrupt Mask */ -#define PMC_IMR_LOCKU (0x1u << 6) /**< \brief (PMC_IMR) UTMI PLL Lock Interrupt Mask */ -#define PMC_IMR_PCKRDY0 (0x1u << 8) /**< \brief (PMC_IMR) Programmable Clock Ready 0 Interrupt Mask */ -#define PMC_IMR_PCKRDY1 (0x1u << 9) /**< \brief (PMC_IMR) Programmable Clock Ready 1 Interrupt Mask */ -#define PMC_IMR_PCKRDY2 (0x1u << 10) /**< \brief (PMC_IMR) Programmable Clock Ready 2 Interrupt Mask */ -#define PMC_IMR_MOSCSELS (0x1u << 16) /**< \brief (PMC_IMR) Main Oscillator Selection Status Interrupt Mask */ -#define PMC_IMR_MOSCRCS (0x1u << 17) /**< \brief (PMC_IMR) Main On-Chip RC Status Interrupt Mask */ -#define PMC_IMR_CFDEV (0x1u << 18) /**< \brief (PMC_IMR) Clock Failure Detector Event Interrupt Mask */ -#define PMC_IMR_XT32KERR (0x1u << 21) /**< \brief (PMC_IMR) Slow Crystal Oscillator Error Interrupt Mask */ -/* -------- PMC_FSMR : (PMC Offset: 0x0070) Fast Startup Mode Register -------- */ -#define PMC_FSMR_FSTT0 (0x1u << 0) /**< \brief (PMC_FSMR) Fast Startup Input Enable 0 */ -#define PMC_FSMR_FSTT1 (0x1u << 1) /**< \brief (PMC_FSMR) Fast Startup Input Enable 1 */ -#define PMC_FSMR_FSTT2 (0x1u << 2) /**< \brief (PMC_FSMR) Fast Startup Input Enable 2 */ -#define PMC_FSMR_FSTT3 (0x1u << 3) /**< \brief (PMC_FSMR) Fast Startup Input Enable 3 */ -#define PMC_FSMR_FSTT4 (0x1u << 4) /**< \brief (PMC_FSMR) Fast Startup Input Enable 4 */ -#define PMC_FSMR_FSTT5 (0x1u << 5) /**< \brief (PMC_FSMR) Fast Startup Input Enable 5 */ -#define PMC_FSMR_FSTT6 (0x1u << 6) /**< \brief (PMC_FSMR) Fast Startup Input Enable 6 */ -#define PMC_FSMR_FSTT7 (0x1u << 7) /**< \brief (PMC_FSMR) Fast Startup Input Enable 7 */ -#define PMC_FSMR_FSTT8 (0x1u << 8) /**< \brief (PMC_FSMR) Fast Startup Input Enable 8 */ -#define PMC_FSMR_FSTT9 (0x1u << 9) /**< \brief (PMC_FSMR) Fast Startup Input Enable 9 */ -#define PMC_FSMR_FSTT10 (0x1u << 10) /**< \brief (PMC_FSMR) Fast Startup Input Enable 10 */ -#define PMC_FSMR_FSTT11 (0x1u << 11) /**< \brief (PMC_FSMR) Fast Startup Input Enable 11 */ -#define PMC_FSMR_FSTT12 (0x1u << 12) /**< \brief (PMC_FSMR) Fast Startup Input Enable 12 */ -#define PMC_FSMR_FSTT13 (0x1u << 13) /**< \brief (PMC_FSMR) Fast Startup Input Enable 13 */ -#define PMC_FSMR_FSTT14 (0x1u << 14) /**< \brief (PMC_FSMR) Fast Startup Input Enable 14 */ -#define PMC_FSMR_FSTT15 (0x1u << 15) /**< \brief (PMC_FSMR) Fast Startup Input Enable 15 */ -#define PMC_FSMR_RTTAL (0x1u << 16) /**< \brief (PMC_FSMR) RTT Alarm Enable */ -#define PMC_FSMR_RTCAL (0x1u << 17) /**< \brief (PMC_FSMR) RTC Alarm Enable */ -#define PMC_FSMR_USBAL (0x1u << 18) /**< \brief (PMC_FSMR) USB Alarm Enable */ -#define PMC_FSMR_LPM (0x1u << 20) /**< \brief (PMC_FSMR) Low-power Mode */ -#define PMC_FSMR_FLPM_Pos 21 -#define PMC_FSMR_FLPM_Msk (0x3u << PMC_FSMR_FLPM_Pos) /**< \brief (PMC_FSMR) Flash Low-power Mode */ -#define PMC_FSMR_FLPM(value) ((PMC_FSMR_FLPM_Msk & ((value) << PMC_FSMR_FLPM_Pos))) -#define PMC_FSMR_FLPM_FLASH_STANDBY (0x0u << 21) /**< \brief (PMC_FSMR) Flash is in Standby Mode when system enters Wait Mode */ -#define PMC_FSMR_FLPM_FLASH_DEEP_POWERDOWN (0x1u << 21) /**< \brief (PMC_FSMR) Flash is in Deep-power-down mode when system enters Wait Mode */ -#define PMC_FSMR_FLPM_FLASH_IDLE (0x2u << 21) /**< \brief (PMC_FSMR) Idle mode */ -#define PMC_FSMR_FFLPM (0x1u << 23) /**< \brief (PMC_FSMR) Force Flash Low-power Mode */ -/* -------- PMC_FSPR : (PMC Offset: 0x0074) Fast Startup Polarity Register -------- */ -#define PMC_FSPR_FSTP0 (0x1u << 0) /**< \brief (PMC_FSPR) Fast Startup Input Polarity 0 */ -#define PMC_FSPR_FSTP1 (0x1u << 1) /**< \brief (PMC_FSPR) Fast Startup Input Polarity 1 */ -#define PMC_FSPR_FSTP2 (0x1u << 2) /**< \brief (PMC_FSPR) Fast Startup Input Polarity 2 */ -#define PMC_FSPR_FSTP3 (0x1u << 3) /**< \brief (PMC_FSPR) Fast Startup Input Polarity 3 */ -#define PMC_FSPR_FSTP4 (0x1u << 4) /**< \brief (PMC_FSPR) Fast Startup Input Polarity 4 */ -#define PMC_FSPR_FSTP5 (0x1u << 5) /**< \brief (PMC_FSPR) Fast Startup Input Polarity 5 */ -#define PMC_FSPR_FSTP6 (0x1u << 6) /**< \brief (PMC_FSPR) Fast Startup Input Polarity 6 */ -#define PMC_FSPR_FSTP7 (0x1u << 7) /**< \brief (PMC_FSPR) Fast Startup Input Polarity 7 */ -#define PMC_FSPR_FSTP8 (0x1u << 8) /**< \brief (PMC_FSPR) Fast Startup Input Polarity 8 */ -#define PMC_FSPR_FSTP9 (0x1u << 9) /**< \brief (PMC_FSPR) Fast Startup Input Polarity 9 */ -#define PMC_FSPR_FSTP10 (0x1u << 10) /**< \brief (PMC_FSPR) Fast Startup Input Polarity 10 */ -#define PMC_FSPR_FSTP11 (0x1u << 11) /**< \brief (PMC_FSPR) Fast Startup Input Polarity 11 */ -#define PMC_FSPR_FSTP12 (0x1u << 12) /**< \brief (PMC_FSPR) Fast Startup Input Polarity 12 */ -#define PMC_FSPR_FSTP13 (0x1u << 13) /**< \brief (PMC_FSPR) Fast Startup Input Polarity 13 */ -#define PMC_FSPR_FSTP14 (0x1u << 14) /**< \brief (PMC_FSPR) Fast Startup Input Polarity 14 */ -#define PMC_FSPR_FSTP15 (0x1u << 15) /**< \brief (PMC_FSPR) Fast Startup Input Polarity 15 */ -/* -------- PMC_FOCR : (PMC Offset: 0x0078) Fault Output Clear Register -------- */ -#define PMC_FOCR_FOCLR (0x1u << 0) /**< \brief (PMC_FOCR) Fault Output Clear */ -/* -------- PMC_WPMR : (PMC Offset: 0x00E4) Write Protection Mode Register -------- */ -#define PMC_WPMR_WPEN (0x1u << 0) /**< \brief (PMC_WPMR) Write Protection Enable */ -#define PMC_WPMR_WPKEY_Pos 8 -#define PMC_WPMR_WPKEY_Msk (0xffffffu << PMC_WPMR_WPKEY_Pos) /**< \brief (PMC_WPMR) Write Protection Key */ -#define PMC_WPMR_WPKEY(value) ((PMC_WPMR_WPKEY_Msk & ((value) << PMC_WPMR_WPKEY_Pos))) -#define PMC_WPMR_WPKEY_PASSWD (0x504D43u << 8) /**< \brief (PMC_WPMR) Writing any other value in this field aborts the write operation of the WPEN bit. Always reads as 0. */ -/* -------- PMC_WPSR : (PMC Offset: 0x00E8) Write Protection Status Register -------- */ -#define PMC_WPSR_WPVS (0x1u << 0) /**< \brief (PMC_WPSR) Write Protection Violation Status */ -#define PMC_WPSR_WPVSRC_Pos 8 -#define PMC_WPSR_WPVSRC_Msk (0xffffu << PMC_WPSR_WPVSRC_Pos) /**< \brief (PMC_WPSR) Write Protection Violation Source */ -/* -------- PMC_PCER1 : (PMC Offset: 0x0100) Peripheral Clock Enable Register 1 -------- */ -#define PMC_PCER1_PID32 (0x1u << 0) /**< \brief (PMC_PCER1) Peripheral Clock 32 Enable */ -#define PMC_PCER1_PID33 (0x1u << 1) /**< \brief (PMC_PCER1) Peripheral Clock 33 Enable */ -#define PMC_PCER1_PID34 (0x1u << 2) /**< \brief (PMC_PCER1) Peripheral Clock 34 Enable */ -#define PMC_PCER1_PID35 (0x1u << 3) /**< \brief (PMC_PCER1) Peripheral Clock 35 Enable */ -#define PMC_PCER1_PID37 (0x1u << 5) /**< \brief (PMC_PCER1) Peripheral Clock 37 Enable */ -#define PMC_PCER1_PID39 (0x1u << 7) /**< \brief (PMC_PCER1) Peripheral Clock 39 Enable */ -#define PMC_PCER1_PID40 (0x1u << 8) /**< \brief (PMC_PCER1) Peripheral Clock 40 Enable */ -#define PMC_PCER1_PID41 (0x1u << 9) /**< \brief (PMC_PCER1) Peripheral Clock 41 Enable */ -#define PMC_PCER1_PID42 (0x1u << 10) /**< \brief (PMC_PCER1) Peripheral Clock 42 Enable */ -#define PMC_PCER1_PID43 (0x1u << 11) /**< \brief (PMC_PCER1) Peripheral Clock 43 Enable */ -#define PMC_PCER1_PID44 (0x1u << 12) /**< \brief (PMC_PCER1) Peripheral Clock 44 Enable */ -#define PMC_PCER1_PID45 (0x1u << 13) /**< \brief (PMC_PCER1) Peripheral Clock 45 Enable */ -#define PMC_PCER1_PID46 (0x1u << 14) /**< \brief (PMC_PCER1) Peripheral Clock 46 Enable */ -#define PMC_PCER1_PID47 (0x1u << 15) /**< \brief (PMC_PCER1) Peripheral Clock 47 Enable */ -#define PMC_PCER1_PID48 (0x1u << 16) /**< \brief (PMC_PCER1) Peripheral Clock 48 Enable */ -#define PMC_PCER1_PID49 (0x1u << 17) /**< \brief (PMC_PCER1) Peripheral Clock 49 Enable */ -#define PMC_PCER1_PID50 (0x1u << 18) /**< \brief (PMC_PCER1) Peripheral Clock 50 Enable */ -#define PMC_PCER1_PID51 (0x1u << 19) /**< \brief (PMC_PCER1) Peripheral Clock 51 Enable */ -#define PMC_PCER1_PID52 (0x1u << 20) /**< \brief (PMC_PCER1) Peripheral Clock 52 Enable */ -#define PMC_PCER1_PID53 (0x1u << 21) /**< \brief (PMC_PCER1) Peripheral Clock 53 Enable */ -#define PMC_PCER1_PID56 (0x1u << 24) /**< \brief (PMC_PCER1) Peripheral Clock 56 Enable */ -#define PMC_PCER1_PID57 (0x1u << 25) /**< \brief (PMC_PCER1) Peripheral Clock 57 Enable */ -#define PMC_PCER1_PID58 (0x1u << 26) /**< \brief (PMC_PCER1) Peripheral Clock 58 Enable */ -#define PMC_PCER1_PID59 (0x1u << 27) /**< \brief (PMC_PCER1) Peripheral Clock 59 Enable */ -#define PMC_PCER1_PID60 (0x1u << 28) /**< \brief (PMC_PCER1) Peripheral Clock 60 Enable */ -/* -------- PMC_PCDR1 : (PMC Offset: 0x0104) Peripheral Clock Disable Register 1 -------- */ -#define PMC_PCDR1_PID32 (0x1u << 0) /**< \brief (PMC_PCDR1) Peripheral Clock 32 Disable */ -#define PMC_PCDR1_PID33 (0x1u << 1) /**< \brief (PMC_PCDR1) Peripheral Clock 33 Disable */ -#define PMC_PCDR1_PID34 (0x1u << 2) /**< \brief (PMC_PCDR1) Peripheral Clock 34 Disable */ -#define PMC_PCDR1_PID35 (0x1u << 3) /**< \brief (PMC_PCDR1) Peripheral Clock 35 Disable */ -#define PMC_PCDR1_PID37 (0x1u << 5) /**< \brief (PMC_PCDR1) Peripheral Clock 37 Disable */ -#define PMC_PCDR1_PID39 (0x1u << 7) /**< \brief (PMC_PCDR1) Peripheral Clock 39 Disable */ -#define PMC_PCDR1_PID40 (0x1u << 8) /**< \brief (PMC_PCDR1) Peripheral Clock 40 Disable */ -#define PMC_PCDR1_PID41 (0x1u << 9) /**< \brief (PMC_PCDR1) Peripheral Clock 41 Disable */ -#define PMC_PCDR1_PID42 (0x1u << 10) /**< \brief (PMC_PCDR1) Peripheral Clock 42 Disable */ -#define PMC_PCDR1_PID43 (0x1u << 11) /**< \brief (PMC_PCDR1) Peripheral Clock 43 Disable */ -#define PMC_PCDR1_PID44 (0x1u << 12) /**< \brief (PMC_PCDR1) Peripheral Clock 44 Disable */ -#define PMC_PCDR1_PID45 (0x1u << 13) /**< \brief (PMC_PCDR1) Peripheral Clock 45 Disable */ -#define PMC_PCDR1_PID46 (0x1u << 14) /**< \brief (PMC_PCDR1) Peripheral Clock 46 Disable */ -#define PMC_PCDR1_PID47 (0x1u << 15) /**< \brief (PMC_PCDR1) Peripheral Clock 47 Disable */ -#define PMC_PCDR1_PID48 (0x1u << 16) /**< \brief (PMC_PCDR1) Peripheral Clock 48 Disable */ -#define PMC_PCDR1_PID49 (0x1u << 17) /**< \brief (PMC_PCDR1) Peripheral Clock 49 Disable */ -#define PMC_PCDR1_PID50 (0x1u << 18) /**< \brief (PMC_PCDR1) Peripheral Clock 50 Disable */ -#define PMC_PCDR1_PID51 (0x1u << 19) /**< \brief (PMC_PCDR1) Peripheral Clock 51 Disable */ -#define PMC_PCDR1_PID52 (0x1u << 20) /**< \brief (PMC_PCDR1) Peripheral Clock 52 Disable */ -#define PMC_PCDR1_PID53 (0x1u << 21) /**< \brief (PMC_PCDR1) Peripheral Clock 53 Disable */ -#define PMC_PCDR1_PID56 (0x1u << 24) /**< \brief (PMC_PCDR1) Peripheral Clock 56 Disable */ -#define PMC_PCDR1_PID57 (0x1u << 25) /**< \brief (PMC_PCDR1) Peripheral Clock 57 Disable */ -#define PMC_PCDR1_PID58 (0x1u << 26) /**< \brief (PMC_PCDR1) Peripheral Clock 58 Disable */ -#define PMC_PCDR1_PID59 (0x1u << 27) /**< \brief (PMC_PCDR1) Peripheral Clock 59 Disable */ -#define PMC_PCDR1_PID60 (0x1u << 28) /**< \brief (PMC_PCDR1) Peripheral Clock 60 Disable */ -/* -------- PMC_PCSR1 : (PMC Offset: 0x0108) Peripheral Clock Status Register 1 -------- */ -#define PMC_PCSR1_PID32 (0x1u << 0) /**< \brief (PMC_PCSR1) Peripheral Clock 32 Status */ -#define PMC_PCSR1_PID33 (0x1u << 1) /**< \brief (PMC_PCSR1) Peripheral Clock 33 Status */ -#define PMC_PCSR1_PID34 (0x1u << 2) /**< \brief (PMC_PCSR1) Peripheral Clock 34 Status */ -#define PMC_PCSR1_PID35 (0x1u << 3) /**< \brief (PMC_PCSR1) Peripheral Clock 35 Status */ -#define PMC_PCSR1_PID37 (0x1u << 5) /**< \brief (PMC_PCSR1) Peripheral Clock 37 Status */ -#define PMC_PCSR1_PID39 (0x1u << 7) /**< \brief (PMC_PCSR1) Peripheral Clock 39 Status */ -#define PMC_PCSR1_PID40 (0x1u << 8) /**< \brief (PMC_PCSR1) Peripheral Clock 40 Status */ -#define PMC_PCSR1_PID41 (0x1u << 9) /**< \brief (PMC_PCSR1) Peripheral Clock 41 Status */ -#define PMC_PCSR1_PID42 (0x1u << 10) /**< \brief (PMC_PCSR1) Peripheral Clock 42 Status */ -#define PMC_PCSR1_PID43 (0x1u << 11) /**< \brief (PMC_PCSR1) Peripheral Clock 43 Status */ -#define PMC_PCSR1_PID44 (0x1u << 12) /**< \brief (PMC_PCSR1) Peripheral Clock 44 Status */ -#define PMC_PCSR1_PID45 (0x1u << 13) /**< \brief (PMC_PCSR1) Peripheral Clock 45 Status */ -#define PMC_PCSR1_PID46 (0x1u << 14) /**< \brief (PMC_PCSR1) Peripheral Clock 46 Status */ -#define PMC_PCSR1_PID47 (0x1u << 15) /**< \brief (PMC_PCSR1) Peripheral Clock 47 Status */ -#define PMC_PCSR1_PID48 (0x1u << 16) /**< \brief (PMC_PCSR1) Peripheral Clock 48 Status */ -#define PMC_PCSR1_PID49 (0x1u << 17) /**< \brief (PMC_PCSR1) Peripheral Clock 49 Status */ -#define PMC_PCSR1_PID50 (0x1u << 18) /**< \brief (PMC_PCSR1) Peripheral Clock 50 Status */ -#define PMC_PCSR1_PID51 (0x1u << 19) /**< \brief (PMC_PCSR1) Peripheral Clock 51 Status */ -#define PMC_PCSR1_PID52 (0x1u << 20) /**< \brief (PMC_PCSR1) Peripheral Clock 52 Status */ -#define PMC_PCSR1_PID53 (0x1u << 21) /**< \brief (PMC_PCSR1) Peripheral Clock 53 Status */ -#define PMC_PCSR1_PID56 (0x1u << 24) /**< \brief (PMC_PCSR1) Peripheral Clock 56 Status */ -#define PMC_PCSR1_PID57 (0x1u << 25) /**< \brief (PMC_PCSR1) Peripheral Clock 57 Status */ -#define PMC_PCSR1_PID58 (0x1u << 26) /**< \brief (PMC_PCSR1) Peripheral Clock 58 Status */ -#define PMC_PCSR1_PID59 (0x1u << 27) /**< \brief (PMC_PCSR1) Peripheral Clock 59 Status */ -#define PMC_PCSR1_PID60 (0x1u << 28) /**< \brief (PMC_PCSR1) Peripheral Clock 60 Status */ -/* -------- PMC_PCR : (PMC Offset: 0x010C) Peripheral Control Register -------- */ -#define PMC_PCR_PID_Pos 0 -#define PMC_PCR_PID_Msk (0x3fu << PMC_PCR_PID_Pos) /**< \brief (PMC_PCR) Peripheral ID */ -#define PMC_PCR_PID(value) ((PMC_PCR_PID_Msk & ((value) << PMC_PCR_PID_Pos))) -#define PMC_PCR_CMD (0x1u << 12) /**< \brief (PMC_PCR) Command */ -#define PMC_PCR_DIV_Pos 16 -#define PMC_PCR_DIV_Msk (0x3u << PMC_PCR_DIV_Pos) /**< \brief (PMC_PCR) Divisor Value */ -#define PMC_PCR_DIV(value) ((PMC_PCR_DIV_Msk & ((value) << PMC_PCR_DIV_Pos))) -#define PMC_PCR_DIV_PERIPH_DIV_MCK (0x0u << 16) /**< \brief (PMC_PCR) Peripheral clock is MCK */ -#define PMC_PCR_DIV_PERIPH_DIV2_MCK (0x1u << 16) /**< \brief (PMC_PCR) Peripheral clock is MCK/2 */ -#define PMC_PCR_DIV_PERIPH_DIV4_MCK (0x2u << 16) /**< \brief (PMC_PCR) Peripheral clock is MCK/4 */ -#define PMC_PCR_DIV_PERIPH_DIV8_MCK (0x3u << 16) /**< \brief (PMC_PCR) Peripheral clock is MCK/8 */ -#define PMC_PCR_EN (0x1u << 28) /**< \brief (PMC_PCR) Enable */ -/* -------- PMC_OCR : (PMC Offset: 0x0110) Oscillator Calibration Register -------- */ -#define PMC_OCR_CAL4_Pos 0 -#define PMC_OCR_CAL4_Msk (0x7fu << PMC_OCR_CAL4_Pos) /**< \brief (PMC_OCR) RC Oscillator Calibration bits for 4 MHz */ -#define PMC_OCR_CAL4(value) ((PMC_OCR_CAL4_Msk & ((value) << PMC_OCR_CAL4_Pos))) -#define PMC_OCR_SEL4 (0x1u << 7) /**< \brief (PMC_OCR) Selection of RC Oscillator Calibration bits for 4 MHz */ -#define PMC_OCR_CAL8_Pos 8 -#define PMC_OCR_CAL8_Msk (0x7fu << PMC_OCR_CAL8_Pos) /**< \brief (PMC_OCR) RC Oscillator Calibration bits for 8 MHz */ -#define PMC_OCR_CAL8(value) ((PMC_OCR_CAL8_Msk & ((value) << PMC_OCR_CAL8_Pos))) -#define PMC_OCR_SEL8 (0x1u << 15) /**< \brief (PMC_OCR) Selection of RC Oscillator Calibration bits for 8 MHz */ -#define PMC_OCR_CAL12_Pos 16 -#define PMC_OCR_CAL12_Msk (0x7fu << PMC_OCR_CAL12_Pos) /**< \brief (PMC_OCR) RC Oscillator Calibration bits for 12 MHz */ -#define PMC_OCR_CAL12(value) ((PMC_OCR_CAL12_Msk & ((value) << PMC_OCR_CAL12_Pos))) -#define PMC_OCR_SEL12 (0x1u << 23) /**< \brief (PMC_OCR) Selection of RC Oscillator Calibration bits for 12 MHz */ -/* -------- PMC_SLPWK_ER0 : (PMC Offset: 0x0114) SleepWalking Enable Register 0 -------- */ -#define PMC_SLPWK_ER0_PID7 (0x1u << 7) /**< \brief (PMC_SLPWK_ER0) Peripheral 7 SleepWalking Enable */ -#define PMC_SLPWK_ER0_PID8 (0x1u << 8) /**< \brief (PMC_SLPWK_ER0) Peripheral 8 SleepWalking Enable */ -#define PMC_SLPWK_ER0_PID9 (0x1u << 9) /**< \brief (PMC_SLPWK_ER0) Peripheral 9 SleepWalking Enable */ -#define PMC_SLPWK_ER0_PID10 (0x1u << 10) /**< \brief (PMC_SLPWK_ER0) Peripheral 10 SleepWalking Enable */ -#define PMC_SLPWK_ER0_PID11 (0x1u << 11) /**< \brief (PMC_SLPWK_ER0) Peripheral 11 SleepWalking Enable */ -#define PMC_SLPWK_ER0_PID12 (0x1u << 12) /**< \brief (PMC_SLPWK_ER0) Peripheral 12 SleepWalking Enable */ -#define PMC_SLPWK_ER0_PID13 (0x1u << 13) /**< \brief (PMC_SLPWK_ER0) Peripheral 13 SleepWalking Enable */ -#define PMC_SLPWK_ER0_PID14 (0x1u << 14) /**< \brief (PMC_SLPWK_ER0) Peripheral 14 SleepWalking Enable */ -#define PMC_SLPWK_ER0_PID15 (0x1u << 15) /**< \brief (PMC_SLPWK_ER0) Peripheral 15 SleepWalking Enable */ -#define PMC_SLPWK_ER0_PID16 (0x1u << 16) /**< \brief (PMC_SLPWK_ER0) Peripheral 16 SleepWalking Enable */ -#define PMC_SLPWK_ER0_PID17 (0x1u << 17) /**< \brief (PMC_SLPWK_ER0) Peripheral 17 SleepWalking Enable */ -#define PMC_SLPWK_ER0_PID18 (0x1u << 18) /**< \brief (PMC_SLPWK_ER0) Peripheral 18 SleepWalking Enable */ -#define PMC_SLPWK_ER0_PID19 (0x1u << 19) /**< \brief (PMC_SLPWK_ER0) Peripheral 19 SleepWalking Enable */ -#define PMC_SLPWK_ER0_PID20 (0x1u << 20) /**< \brief (PMC_SLPWK_ER0) Peripheral 20 SleepWalking Enable */ -#define PMC_SLPWK_ER0_PID21 (0x1u << 21) /**< \brief (PMC_SLPWK_ER0) Peripheral 21 SleepWalking Enable */ -#define PMC_SLPWK_ER0_PID22 (0x1u << 22) /**< \brief (PMC_SLPWK_ER0) Peripheral 22 SleepWalking Enable */ -#define PMC_SLPWK_ER0_PID23 (0x1u << 23) /**< \brief (PMC_SLPWK_ER0) Peripheral 23 SleepWalking Enable */ -#define PMC_SLPWK_ER0_PID24 (0x1u << 24) /**< \brief (PMC_SLPWK_ER0) Peripheral 24 SleepWalking Enable */ -#define PMC_SLPWK_ER0_PID25 (0x1u << 25) /**< \brief (PMC_SLPWK_ER0) Peripheral 25 SleepWalking Enable */ -#define PMC_SLPWK_ER0_PID26 (0x1u << 26) /**< \brief (PMC_SLPWK_ER0) Peripheral 26 SleepWalking Enable */ -#define PMC_SLPWK_ER0_PID27 (0x1u << 27) /**< \brief (PMC_SLPWK_ER0) Peripheral 27 SleepWalking Enable */ -#define PMC_SLPWK_ER0_PID28 (0x1u << 28) /**< \brief (PMC_SLPWK_ER0) Peripheral 28 SleepWalking Enable */ -#define PMC_SLPWK_ER0_PID29 (0x1u << 29) /**< \brief (PMC_SLPWK_ER0) Peripheral 29 SleepWalking Enable */ -#define PMC_SLPWK_ER0_PID30 (0x1u << 30) /**< \brief (PMC_SLPWK_ER0) Peripheral 30 SleepWalking Enable */ -#define PMC_SLPWK_ER0_PID31 (0x1u << 31) /**< \brief (PMC_SLPWK_ER0) Peripheral 31 SleepWalking Enable */ -/* -------- PMC_SLPWK_DR0 : (PMC Offset: 0x0118) SleepWalking Disable Register 0 -------- */ -#define PMC_SLPWK_DR0_PID7 (0x1u << 7) /**< \brief (PMC_SLPWK_DR0) Peripheral 7 SleepWalking Disable */ -#define PMC_SLPWK_DR0_PID8 (0x1u << 8) /**< \brief (PMC_SLPWK_DR0) Peripheral 8 SleepWalking Disable */ -#define PMC_SLPWK_DR0_PID9 (0x1u << 9) /**< \brief (PMC_SLPWK_DR0) Peripheral 9 SleepWalking Disable */ -#define PMC_SLPWK_DR0_PID10 (0x1u << 10) /**< \brief (PMC_SLPWK_DR0) Peripheral 10 SleepWalking Disable */ -#define PMC_SLPWK_DR0_PID11 (0x1u << 11) /**< \brief (PMC_SLPWK_DR0) Peripheral 11 SleepWalking Disable */ -#define PMC_SLPWK_DR0_PID12 (0x1u << 12) /**< \brief (PMC_SLPWK_DR0) Peripheral 12 SleepWalking Disable */ -#define PMC_SLPWK_DR0_PID13 (0x1u << 13) /**< \brief (PMC_SLPWK_DR0) Peripheral 13 SleepWalking Disable */ -#define PMC_SLPWK_DR0_PID14 (0x1u << 14) /**< \brief (PMC_SLPWK_DR0) Peripheral 14 SleepWalking Disable */ -#define PMC_SLPWK_DR0_PID15 (0x1u << 15) /**< \brief (PMC_SLPWK_DR0) Peripheral 15 SleepWalking Disable */ -#define PMC_SLPWK_DR0_PID16 (0x1u << 16) /**< \brief (PMC_SLPWK_DR0) Peripheral 16 SleepWalking Disable */ -#define PMC_SLPWK_DR0_PID17 (0x1u << 17) /**< \brief (PMC_SLPWK_DR0) Peripheral 17 SleepWalking Disable */ -#define PMC_SLPWK_DR0_PID18 (0x1u << 18) /**< \brief (PMC_SLPWK_DR0) Peripheral 18 SleepWalking Disable */ -#define PMC_SLPWK_DR0_PID19 (0x1u << 19) /**< \brief (PMC_SLPWK_DR0) Peripheral 19 SleepWalking Disable */ -#define PMC_SLPWK_DR0_PID20 (0x1u << 20) /**< \brief (PMC_SLPWK_DR0) Peripheral 20 SleepWalking Disable */ -#define PMC_SLPWK_DR0_PID21 (0x1u << 21) /**< \brief (PMC_SLPWK_DR0) Peripheral 21 SleepWalking Disable */ -#define PMC_SLPWK_DR0_PID22 (0x1u << 22) /**< \brief (PMC_SLPWK_DR0) Peripheral 22 SleepWalking Disable */ -#define PMC_SLPWK_DR0_PID23 (0x1u << 23) /**< \brief (PMC_SLPWK_DR0) Peripheral 23 SleepWalking Disable */ -#define PMC_SLPWK_DR0_PID24 (0x1u << 24) /**< \brief (PMC_SLPWK_DR0) Peripheral 24 SleepWalking Disable */ -#define PMC_SLPWK_DR0_PID25 (0x1u << 25) /**< \brief (PMC_SLPWK_DR0) Peripheral 25 SleepWalking Disable */ -#define PMC_SLPWK_DR0_PID26 (0x1u << 26) /**< \brief (PMC_SLPWK_DR0) Peripheral 26 SleepWalking Disable */ -#define PMC_SLPWK_DR0_PID27 (0x1u << 27) /**< \brief (PMC_SLPWK_DR0) Peripheral 27 SleepWalking Disable */ -#define PMC_SLPWK_DR0_PID28 (0x1u << 28) /**< \brief (PMC_SLPWK_DR0) Peripheral 28 SleepWalking Disable */ -#define PMC_SLPWK_DR0_PID29 (0x1u << 29) /**< \brief (PMC_SLPWK_DR0) Peripheral 29 SleepWalking Disable */ -#define PMC_SLPWK_DR0_PID30 (0x1u << 30) /**< \brief (PMC_SLPWK_DR0) Peripheral 30 SleepWalking Disable */ -#define PMC_SLPWK_DR0_PID31 (0x1u << 31) /**< \brief (PMC_SLPWK_DR0) Peripheral 31 SleepWalking Disable */ -/* -------- PMC_SLPWK_SR0 : (PMC Offset: 0x011C) SleepWalking Status Register 0 -------- */ -#define PMC_SLPWK_SR0_PID7 (0x1u << 7) /**< \brief (PMC_SLPWK_SR0) Peripheral 7 SleepWalking Status */ -#define PMC_SLPWK_SR0_PID8 (0x1u << 8) /**< \brief (PMC_SLPWK_SR0) Peripheral 8 SleepWalking Status */ -#define PMC_SLPWK_SR0_PID9 (0x1u << 9) /**< \brief (PMC_SLPWK_SR0) Peripheral 9 SleepWalking Status */ -#define PMC_SLPWK_SR0_PID10 (0x1u << 10) /**< \brief (PMC_SLPWK_SR0) Peripheral 10 SleepWalking Status */ -#define PMC_SLPWK_SR0_PID11 (0x1u << 11) /**< \brief (PMC_SLPWK_SR0) Peripheral 11 SleepWalking Status */ -#define PMC_SLPWK_SR0_PID12 (0x1u << 12) /**< \brief (PMC_SLPWK_SR0) Peripheral 12 SleepWalking Status */ -#define PMC_SLPWK_SR0_PID13 (0x1u << 13) /**< \brief (PMC_SLPWK_SR0) Peripheral 13 SleepWalking Status */ -#define PMC_SLPWK_SR0_PID14 (0x1u << 14) /**< \brief (PMC_SLPWK_SR0) Peripheral 14 SleepWalking Status */ -#define PMC_SLPWK_SR0_PID15 (0x1u << 15) /**< \brief (PMC_SLPWK_SR0) Peripheral 15 SleepWalking Status */ -#define PMC_SLPWK_SR0_PID16 (0x1u << 16) /**< \brief (PMC_SLPWK_SR0) Peripheral 16 SleepWalking Status */ -#define PMC_SLPWK_SR0_PID17 (0x1u << 17) /**< \brief (PMC_SLPWK_SR0) Peripheral 17 SleepWalking Status */ -#define PMC_SLPWK_SR0_PID18 (0x1u << 18) /**< \brief (PMC_SLPWK_SR0) Peripheral 18 SleepWalking Status */ -#define PMC_SLPWK_SR0_PID19 (0x1u << 19) /**< \brief (PMC_SLPWK_SR0) Peripheral 19 SleepWalking Status */ -#define PMC_SLPWK_SR0_PID20 (0x1u << 20) /**< \brief (PMC_SLPWK_SR0) Peripheral 20 SleepWalking Status */ -#define PMC_SLPWK_SR0_PID21 (0x1u << 21) /**< \brief (PMC_SLPWK_SR0) Peripheral 21 SleepWalking Status */ -#define PMC_SLPWK_SR0_PID22 (0x1u << 22) /**< \brief (PMC_SLPWK_SR0) Peripheral 22 SleepWalking Status */ -#define PMC_SLPWK_SR0_PID23 (0x1u << 23) /**< \brief (PMC_SLPWK_SR0) Peripheral 23 SleepWalking Status */ -#define PMC_SLPWK_SR0_PID24 (0x1u << 24) /**< \brief (PMC_SLPWK_SR0) Peripheral 24 SleepWalking Status */ -#define PMC_SLPWK_SR0_PID25 (0x1u << 25) /**< \brief (PMC_SLPWK_SR0) Peripheral 25 SleepWalking Status */ -#define PMC_SLPWK_SR0_PID26 (0x1u << 26) /**< \brief (PMC_SLPWK_SR0) Peripheral 26 SleepWalking Status */ -#define PMC_SLPWK_SR0_PID27 (0x1u << 27) /**< \brief (PMC_SLPWK_SR0) Peripheral 27 SleepWalking Status */ -#define PMC_SLPWK_SR0_PID28 (0x1u << 28) /**< \brief (PMC_SLPWK_SR0) Peripheral 28 SleepWalking Status */ -#define PMC_SLPWK_SR0_PID29 (0x1u << 29) /**< \brief (PMC_SLPWK_SR0) Peripheral 29 SleepWalking Status */ -#define PMC_SLPWK_SR0_PID30 (0x1u << 30) /**< \brief (PMC_SLPWK_SR0) Peripheral 30 SleepWalking Status */ -#define PMC_SLPWK_SR0_PID31 (0x1u << 31) /**< \brief (PMC_SLPWK_SR0) Peripheral 31 SleepWalking Status */ -/* -------- PMC_SLPWK_ASR0 : (PMC Offset: 0x0120) SleepWalking Activity Status Register 0 -------- */ -#define PMC_SLPWK_ASR0_PID7 (0x1u << 7) /**< \brief (PMC_SLPWK_ASR0) Peripheral 7 Activity Status */ -#define PMC_SLPWK_ASR0_PID8 (0x1u << 8) /**< \brief (PMC_SLPWK_ASR0) Peripheral 8 Activity Status */ -#define PMC_SLPWK_ASR0_PID9 (0x1u << 9) /**< \brief (PMC_SLPWK_ASR0) Peripheral 9 Activity Status */ -#define PMC_SLPWK_ASR0_PID10 (0x1u << 10) /**< \brief (PMC_SLPWK_ASR0) Peripheral 10 Activity Status */ -#define PMC_SLPWK_ASR0_PID11 (0x1u << 11) /**< \brief (PMC_SLPWK_ASR0) Peripheral 11 Activity Status */ -#define PMC_SLPWK_ASR0_PID12 (0x1u << 12) /**< \brief (PMC_SLPWK_ASR0) Peripheral 12 Activity Status */ -#define PMC_SLPWK_ASR0_PID13 (0x1u << 13) /**< \brief (PMC_SLPWK_ASR0) Peripheral 13 Activity Status */ -#define PMC_SLPWK_ASR0_PID14 (0x1u << 14) /**< \brief (PMC_SLPWK_ASR0) Peripheral 14 Activity Status */ -#define PMC_SLPWK_ASR0_PID15 (0x1u << 15) /**< \brief (PMC_SLPWK_ASR0) Peripheral 15 Activity Status */ -#define PMC_SLPWK_ASR0_PID16 (0x1u << 16) /**< \brief (PMC_SLPWK_ASR0) Peripheral 16 Activity Status */ -#define PMC_SLPWK_ASR0_PID17 (0x1u << 17) /**< \brief (PMC_SLPWK_ASR0) Peripheral 17 Activity Status */ -#define PMC_SLPWK_ASR0_PID18 (0x1u << 18) /**< \brief (PMC_SLPWK_ASR0) Peripheral 18 Activity Status */ -#define PMC_SLPWK_ASR0_PID19 (0x1u << 19) /**< \brief (PMC_SLPWK_ASR0) Peripheral 19 Activity Status */ -#define PMC_SLPWK_ASR0_PID20 (0x1u << 20) /**< \brief (PMC_SLPWK_ASR0) Peripheral 20 Activity Status */ -#define PMC_SLPWK_ASR0_PID21 (0x1u << 21) /**< \brief (PMC_SLPWK_ASR0) Peripheral 21 Activity Status */ -#define PMC_SLPWK_ASR0_PID22 (0x1u << 22) /**< \brief (PMC_SLPWK_ASR0) Peripheral 22 Activity Status */ -#define PMC_SLPWK_ASR0_PID23 (0x1u << 23) /**< \brief (PMC_SLPWK_ASR0) Peripheral 23 Activity Status */ -#define PMC_SLPWK_ASR0_PID24 (0x1u << 24) /**< \brief (PMC_SLPWK_ASR0) Peripheral 24 Activity Status */ -#define PMC_SLPWK_ASR0_PID25 (0x1u << 25) /**< \brief (PMC_SLPWK_ASR0) Peripheral 25 Activity Status */ -#define PMC_SLPWK_ASR0_PID26 (0x1u << 26) /**< \brief (PMC_SLPWK_ASR0) Peripheral 26 Activity Status */ -#define PMC_SLPWK_ASR0_PID27 (0x1u << 27) /**< \brief (PMC_SLPWK_ASR0) Peripheral 27 Activity Status */ -#define PMC_SLPWK_ASR0_PID28 (0x1u << 28) /**< \brief (PMC_SLPWK_ASR0) Peripheral 28 Activity Status */ -#define PMC_SLPWK_ASR0_PID29 (0x1u << 29) /**< \brief (PMC_SLPWK_ASR0) Peripheral 29 Activity Status */ -#define PMC_SLPWK_ASR0_PID30 (0x1u << 30) /**< \brief (PMC_SLPWK_ASR0) Peripheral 30 Activity Status */ -#define PMC_SLPWK_ASR0_PID31 (0x1u << 31) /**< \brief (PMC_SLPWK_ASR0) Peripheral 31 Activity Status */ -/* -------- PMC_SLPWK_ER1 : (PMC Offset: 0x0134) SleepWalking Enable Register 1 -------- */ -#define PMC_SLPWK_ER1_PID32 (0x1u << 0) /**< \brief (PMC_SLPWK_ER1) Peripheral 32 SleepWalking Enable */ -#define PMC_SLPWK_ER1_PID33 (0x1u << 1) /**< \brief (PMC_SLPWK_ER1) Peripheral 33 SleepWalking Enable */ -#define PMC_SLPWK_ER1_PID34 (0x1u << 2) /**< \brief (PMC_SLPWK_ER1) Peripheral 34 SleepWalking Enable */ -#define PMC_SLPWK_ER1_PID35 (0x1u << 3) /**< \brief (PMC_SLPWK_ER1) Peripheral 35 SleepWalking Enable */ -#define PMC_SLPWK_ER1_PID37 (0x1u << 5) /**< \brief (PMC_SLPWK_ER1) Peripheral 37 SleepWalking Enable */ -#define PMC_SLPWK_ER1_PID39 (0x1u << 7) /**< \brief (PMC_SLPWK_ER1) Peripheral 39 SleepWalking Enable */ -#define PMC_SLPWK_ER1_PID40 (0x1u << 8) /**< \brief (PMC_SLPWK_ER1) Peripheral 40 SleepWalking Enable */ -#define PMC_SLPWK_ER1_PID41 (0x1u << 9) /**< \brief (PMC_SLPWK_ER1) Peripheral 41 SleepWalking Enable */ -#define PMC_SLPWK_ER1_PID42 (0x1u << 10) /**< \brief (PMC_SLPWK_ER1) Peripheral 42 SleepWalking Enable */ -#define PMC_SLPWK_ER1_PID43 (0x1u << 11) /**< \brief (PMC_SLPWK_ER1) Peripheral 43 SleepWalking Enable */ -#define PMC_SLPWK_ER1_PID44 (0x1u << 12) /**< \brief (PMC_SLPWK_ER1) Peripheral 44 SleepWalking Enable */ -#define PMC_SLPWK_ER1_PID45 (0x1u << 13) /**< \brief (PMC_SLPWK_ER1) Peripheral 45 SleepWalking Enable */ -#define PMC_SLPWK_ER1_PID46 (0x1u << 14) /**< \brief (PMC_SLPWK_ER1) Peripheral 46 SleepWalking Enable */ -#define PMC_SLPWK_ER1_PID47 (0x1u << 15) /**< \brief (PMC_SLPWK_ER1) Peripheral 47 SleepWalking Enable */ -#define PMC_SLPWK_ER1_PID48 (0x1u << 16) /**< \brief (PMC_SLPWK_ER1) Peripheral 48 SleepWalking Enable */ -#define PMC_SLPWK_ER1_PID49 (0x1u << 17) /**< \brief (PMC_SLPWK_ER1) Peripheral 49 SleepWalking Enable */ -#define PMC_SLPWK_ER1_PID50 (0x1u << 18) /**< \brief (PMC_SLPWK_ER1) Peripheral 50 SleepWalking Enable */ -#define PMC_SLPWK_ER1_PID51 (0x1u << 19) /**< \brief (PMC_SLPWK_ER1) Peripheral 51 SleepWalking Enable */ -#define PMC_SLPWK_ER1_PID52 (0x1u << 20) /**< \brief (PMC_SLPWK_ER1) Peripheral 52 SleepWalking Enable */ -#define PMC_SLPWK_ER1_PID53 (0x1u << 21) /**< \brief (PMC_SLPWK_ER1) Peripheral 53 SleepWalking Enable */ -#define PMC_SLPWK_ER1_PID56 (0x1u << 24) /**< \brief (PMC_SLPWK_ER1) Peripheral 56 SleepWalking Enable */ -#define PMC_SLPWK_ER1_PID57 (0x1u << 25) /**< \brief (PMC_SLPWK_ER1) Peripheral 57 SleepWalking Enable */ -#define PMC_SLPWK_ER1_PID58 (0x1u << 26) /**< \brief (PMC_SLPWK_ER1) Peripheral 58 SleepWalking Enable */ -#define PMC_SLPWK_ER1_PID59 (0x1u << 27) /**< \brief (PMC_SLPWK_ER1) Peripheral 59 SleepWalking Enable */ -#define PMC_SLPWK_ER1_PID60 (0x1u << 28) /**< \brief (PMC_SLPWK_ER1) Peripheral 60 SleepWalking Enable */ -/* -------- PMC_SLPWK_DR1 : (PMC Offset: 0x0138) SleepWalking Disable Register 1 -------- */ -#define PMC_SLPWK_DR1_PID32 (0x1u << 0) /**< \brief (PMC_SLPWK_DR1) Peripheral 32 SleepWalking Disable */ -#define PMC_SLPWK_DR1_PID33 (0x1u << 1) /**< \brief (PMC_SLPWK_DR1) Peripheral 33 SleepWalking Disable */ -#define PMC_SLPWK_DR1_PID34 (0x1u << 2) /**< \brief (PMC_SLPWK_DR1) Peripheral 34 SleepWalking Disable */ -#define PMC_SLPWK_DR1_PID35 (0x1u << 3) /**< \brief (PMC_SLPWK_DR1) Peripheral 35 SleepWalking Disable */ -#define PMC_SLPWK_DR1_PID37 (0x1u << 5) /**< \brief (PMC_SLPWK_DR1) Peripheral 37 SleepWalking Disable */ -#define PMC_SLPWK_DR1_PID39 (0x1u << 7) /**< \brief (PMC_SLPWK_DR1) Peripheral 39 SleepWalking Disable */ -#define PMC_SLPWK_DR1_PID40 (0x1u << 8) /**< \brief (PMC_SLPWK_DR1) Peripheral 40 SleepWalking Disable */ -#define PMC_SLPWK_DR1_PID41 (0x1u << 9) /**< \brief (PMC_SLPWK_DR1) Peripheral 41 SleepWalking Disable */ -#define PMC_SLPWK_DR1_PID42 (0x1u << 10) /**< \brief (PMC_SLPWK_DR1) Peripheral 42 SleepWalking Disable */ -#define PMC_SLPWK_DR1_PID43 (0x1u << 11) /**< \brief (PMC_SLPWK_DR1) Peripheral 43 SleepWalking Disable */ -#define PMC_SLPWK_DR1_PID44 (0x1u << 12) /**< \brief (PMC_SLPWK_DR1) Peripheral 44 SleepWalking Disable */ -#define PMC_SLPWK_DR1_PID45 (0x1u << 13) /**< \brief (PMC_SLPWK_DR1) Peripheral 45 SleepWalking Disable */ -#define PMC_SLPWK_DR1_PID46 (0x1u << 14) /**< \brief (PMC_SLPWK_DR1) Peripheral 46 SleepWalking Disable */ -#define PMC_SLPWK_DR1_PID47 (0x1u << 15) /**< \brief (PMC_SLPWK_DR1) Peripheral 47 SleepWalking Disable */ -#define PMC_SLPWK_DR1_PID48 (0x1u << 16) /**< \brief (PMC_SLPWK_DR1) Peripheral 48 SleepWalking Disable */ -#define PMC_SLPWK_DR1_PID49 (0x1u << 17) /**< \brief (PMC_SLPWK_DR1) Peripheral 49 SleepWalking Disable */ -#define PMC_SLPWK_DR1_PID50 (0x1u << 18) /**< \brief (PMC_SLPWK_DR1) Peripheral 50 SleepWalking Disable */ -#define PMC_SLPWK_DR1_PID51 (0x1u << 19) /**< \brief (PMC_SLPWK_DR1) Peripheral 51 SleepWalking Disable */ -#define PMC_SLPWK_DR1_PID52 (0x1u << 20) /**< \brief (PMC_SLPWK_DR1) Peripheral 52 SleepWalking Disable */ -#define PMC_SLPWK_DR1_PID53 (0x1u << 21) /**< \brief (PMC_SLPWK_DR1) Peripheral 53 SleepWalking Disable */ -#define PMC_SLPWK_DR1_PID56 (0x1u << 24) /**< \brief (PMC_SLPWK_DR1) Peripheral 56 SleepWalking Disable */ -#define PMC_SLPWK_DR1_PID57 (0x1u << 25) /**< \brief (PMC_SLPWK_DR1) Peripheral 57 SleepWalking Disable */ -#define PMC_SLPWK_DR1_PID58 (0x1u << 26) /**< \brief (PMC_SLPWK_DR1) Peripheral 58 SleepWalking Disable */ -#define PMC_SLPWK_DR1_PID59 (0x1u << 27) /**< \brief (PMC_SLPWK_DR1) Peripheral 59 SleepWalking Disable */ -#define PMC_SLPWK_DR1_PID60 (0x1u << 28) /**< \brief (PMC_SLPWK_DR1) Peripheral 60 SleepWalking Disable */ -/* -------- PMC_SLPWK_SR1 : (PMC Offset: 0x013C) SleepWalking Status Register 1 -------- */ -#define PMC_SLPWK_SR1_PID32 (0x1u << 0) /**< \brief (PMC_SLPWK_SR1) Peripheral 32 SleepWalking Status */ -#define PMC_SLPWK_SR1_PID33 (0x1u << 1) /**< \brief (PMC_SLPWK_SR1) Peripheral 33 SleepWalking Status */ -#define PMC_SLPWK_SR1_PID34 (0x1u << 2) /**< \brief (PMC_SLPWK_SR1) Peripheral 34 SleepWalking Status */ -#define PMC_SLPWK_SR1_PID35 (0x1u << 3) /**< \brief (PMC_SLPWK_SR1) Peripheral 35 SleepWalking Status */ -#define PMC_SLPWK_SR1_PID37 (0x1u << 5) /**< \brief (PMC_SLPWK_SR1) Peripheral 37 SleepWalking Status */ -#define PMC_SLPWK_SR1_PID39 (0x1u << 7) /**< \brief (PMC_SLPWK_SR1) Peripheral 39 SleepWalking Status */ -#define PMC_SLPWK_SR1_PID40 (0x1u << 8) /**< \brief (PMC_SLPWK_SR1) Peripheral 40 SleepWalking Status */ -#define PMC_SLPWK_SR1_PID41 (0x1u << 9) /**< \brief (PMC_SLPWK_SR1) Peripheral 41 SleepWalking Status */ -#define PMC_SLPWK_SR1_PID42 (0x1u << 10) /**< \brief (PMC_SLPWK_SR1) Peripheral 42 SleepWalking Status */ -#define PMC_SLPWK_SR1_PID43 (0x1u << 11) /**< \brief (PMC_SLPWK_SR1) Peripheral 43 SleepWalking Status */ -#define PMC_SLPWK_SR1_PID44 (0x1u << 12) /**< \brief (PMC_SLPWK_SR1) Peripheral 44 SleepWalking Status */ -#define PMC_SLPWK_SR1_PID45 (0x1u << 13) /**< \brief (PMC_SLPWK_SR1) Peripheral 45 SleepWalking Status */ -#define PMC_SLPWK_SR1_PID46 (0x1u << 14) /**< \brief (PMC_SLPWK_SR1) Peripheral 46 SleepWalking Status */ -#define PMC_SLPWK_SR1_PID47 (0x1u << 15) /**< \brief (PMC_SLPWK_SR1) Peripheral 47 SleepWalking Status */ -#define PMC_SLPWK_SR1_PID48 (0x1u << 16) /**< \brief (PMC_SLPWK_SR1) Peripheral 48 SleepWalking Status */ -#define PMC_SLPWK_SR1_PID49 (0x1u << 17) /**< \brief (PMC_SLPWK_SR1) Peripheral 49 SleepWalking Status */ -#define PMC_SLPWK_SR1_PID50 (0x1u << 18) /**< \brief (PMC_SLPWK_SR1) Peripheral 50 SleepWalking Status */ -#define PMC_SLPWK_SR1_PID51 (0x1u << 19) /**< \brief (PMC_SLPWK_SR1) Peripheral 51 SleepWalking Status */ -#define PMC_SLPWK_SR1_PID52 (0x1u << 20) /**< \brief (PMC_SLPWK_SR1) Peripheral 52 SleepWalking Status */ -#define PMC_SLPWK_SR1_PID53 (0x1u << 21) /**< \brief (PMC_SLPWK_SR1) Peripheral 53 SleepWalking Status */ -#define PMC_SLPWK_SR1_PID56 (0x1u << 24) /**< \brief (PMC_SLPWK_SR1) Peripheral 56 SleepWalking Status */ -#define PMC_SLPWK_SR1_PID57 (0x1u << 25) /**< \brief (PMC_SLPWK_SR1) Peripheral 57 SleepWalking Status */ -#define PMC_SLPWK_SR1_PID58 (0x1u << 26) /**< \brief (PMC_SLPWK_SR1) Peripheral 58 SleepWalking Status */ -#define PMC_SLPWK_SR1_PID59 (0x1u << 27) /**< \brief (PMC_SLPWK_SR1) Peripheral 59 SleepWalking Status */ -#define PMC_SLPWK_SR1_PID60 (0x1u << 28) /**< \brief (PMC_SLPWK_SR1) Peripheral 60 SleepWalking Status */ -/* -------- PMC_SLPWK_ASR1 : (PMC Offset: 0x0140) SleepWalking Activity Status Register 1 -------- */ -#define PMC_SLPWK_ASR1_PID32 (0x1u << 0) /**< \brief (PMC_SLPWK_ASR1) Peripheral 32 Activity Status */ -#define PMC_SLPWK_ASR1_PID33 (0x1u << 1) /**< \brief (PMC_SLPWK_ASR1) Peripheral 33 Activity Status */ -#define PMC_SLPWK_ASR1_PID34 (0x1u << 2) /**< \brief (PMC_SLPWK_ASR1) Peripheral 34 Activity Status */ -#define PMC_SLPWK_ASR1_PID35 (0x1u << 3) /**< \brief (PMC_SLPWK_ASR1) Peripheral 35 Activity Status */ -#define PMC_SLPWK_ASR1_PID37 (0x1u << 5) /**< \brief (PMC_SLPWK_ASR1) Peripheral 37 Activity Status */ -#define PMC_SLPWK_ASR1_PID39 (0x1u << 7) /**< \brief (PMC_SLPWK_ASR1) Peripheral 39 Activity Status */ -#define PMC_SLPWK_ASR1_PID40 (0x1u << 8) /**< \brief (PMC_SLPWK_ASR1) Peripheral 40 Activity Status */ -#define PMC_SLPWK_ASR1_PID41 (0x1u << 9) /**< \brief (PMC_SLPWK_ASR1) Peripheral 41 Activity Status */ -#define PMC_SLPWK_ASR1_PID42 (0x1u << 10) /**< \brief (PMC_SLPWK_ASR1) Peripheral 42 Activity Status */ -#define PMC_SLPWK_ASR1_PID43 (0x1u << 11) /**< \brief (PMC_SLPWK_ASR1) Peripheral 43 Activity Status */ -#define PMC_SLPWK_ASR1_PID44 (0x1u << 12) /**< \brief (PMC_SLPWK_ASR1) Peripheral 44 Activity Status */ -#define PMC_SLPWK_ASR1_PID45 (0x1u << 13) /**< \brief (PMC_SLPWK_ASR1) Peripheral 45 Activity Status */ -#define PMC_SLPWK_ASR1_PID46 (0x1u << 14) /**< \brief (PMC_SLPWK_ASR1) Peripheral 46 Activity Status */ -#define PMC_SLPWK_ASR1_PID47 (0x1u << 15) /**< \brief (PMC_SLPWK_ASR1) Peripheral 47 Activity Status */ -#define PMC_SLPWK_ASR1_PID48 (0x1u << 16) /**< \brief (PMC_SLPWK_ASR1) Peripheral 48 Activity Status */ -#define PMC_SLPWK_ASR1_PID49 (0x1u << 17) /**< \brief (PMC_SLPWK_ASR1) Peripheral 49 Activity Status */ -#define PMC_SLPWK_ASR1_PID50 (0x1u << 18) /**< \brief (PMC_SLPWK_ASR1) Peripheral 50 Activity Status */ -#define PMC_SLPWK_ASR1_PID51 (0x1u << 19) /**< \brief (PMC_SLPWK_ASR1) Peripheral 51 Activity Status */ -#define PMC_SLPWK_ASR1_PID52 (0x1u << 20) /**< \brief (PMC_SLPWK_ASR1) Peripheral 52 Activity Status */ -#define PMC_SLPWK_ASR1_PID53 (0x1u << 21) /**< \brief (PMC_SLPWK_ASR1) Peripheral 53 Activity Status */ -#define PMC_SLPWK_ASR1_PID56 (0x1u << 24) /**< \brief (PMC_SLPWK_ASR1) Peripheral 56 Activity Status */ -#define PMC_SLPWK_ASR1_PID57 (0x1u << 25) /**< \brief (PMC_SLPWK_ASR1) Peripheral 57 Activity Status */ -#define PMC_SLPWK_ASR1_PID58 (0x1u << 26) /**< \brief (PMC_SLPWK_ASR1) Peripheral 58 Activity Status */ -#define PMC_SLPWK_ASR1_PID59 (0x1u << 27) /**< \brief (PMC_SLPWK_ASR1) Peripheral 59 Activity Status */ -#define PMC_SLPWK_ASR1_PID60 (0x1u << 28) /**< \brief (PMC_SLPWK_ASR1) Peripheral 60 Activity Status */ -/* -------- PMC_SLPWK_AIPR : (PMC Offset: 0x0144) SleepWalking Activity In Progress Register -------- */ -#define PMC_SLPWK_AIPR_AIP (0x1u << 0) /**< \brief (PMC_SLPWK_AIPR) Activity In Progress */ - -/*@}*/ - - -#endif /* _SAMV71_PMC_COMPONENT_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_pwm.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_pwm.h deleted file mode 100644 index 50d92f43..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_pwm.h +++ /dev/null @@ -1,700 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_PWM_COMPONENT_ -#define _SAMV71_PWM_COMPONENT_ - -/* ============================================================================= */ -/** SOFTWARE API DEFINITION FOR Pulse Width Modulation Controller */ -/* ============================================================================= */ -/** \addtogroup SAMV71_PWM Pulse Width Modulation Controller */ -/*@{*/ - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -/** \brief PwmCh_num hardware registers */ -typedef struct { - __IO uint32_t PWM_CMR; /**< \brief (PwmCh_num Offset: 0x0) PWM Channel Mode Register */ - __IO uint32_t PWM_CDTY; /**< \brief (PwmCh_num Offset: 0x4) PWM Channel Duty Cycle Register */ - __O uint32_t PWM_CDTYUPD; /**< \brief (PwmCh_num Offset: 0x8) PWM Channel Duty Cycle Update Register */ - __IO uint32_t PWM_CPRD; /**< \brief (PwmCh_num Offset: 0xC) PWM Channel Period Register */ - __O uint32_t PWM_CPRDUPD; /**< \brief (PwmCh_num Offset: 0x10) PWM Channel Period Update Register */ - __I uint32_t PWM_CCNT; /**< \brief (PwmCh_num Offset: 0x14) PWM Channel Counter Register */ - __IO uint32_t PWM_DT; /**< \brief (PwmCh_num Offset: 0x18) PWM Channel Dead Time Register */ - __O uint32_t PWM_DTUPD; /**< \brief (PwmCh_num Offset: 0x1C) PWM Channel Dead Time Update Register */ -} PwmCh_num; -/** \brief PwmCmp hardware registers */ -typedef struct { - __IO uint32_t PWM_CMPV; /**< \brief (PwmCmp Offset: 0x0) PWM Comparison 0 Value Register */ - __O uint32_t PWM_CMPVUPD; /**< \brief (PwmCmp Offset: 0x4) PWM Comparison 0 Value Update Register */ - __IO uint32_t PWM_CMPM; /**< \brief (PwmCmp Offset: 0x8) PWM Comparison 0 Mode Register */ - __O uint32_t PWM_CMPMUPD; /**< \brief (PwmCmp Offset: 0xC) PWM Comparison 0 Mode Update Register */ -} PwmCmp; -/** \brief Pwm hardware registers */ -#define PWMCMP_NUMBER 8 -#define PWMCH_NUM_NUMBER 4 -typedef struct { - __IO uint32_t PWM_CLK; /**< \brief (Pwm Offset: 0x00) PWM Clock Register */ - __O uint32_t PWM_ENA; /**< \brief (Pwm Offset: 0x04) PWM Enable Register */ - __O uint32_t PWM_DIS; /**< \brief (Pwm Offset: 0x08) PWM Disable Register */ - __I uint32_t PWM_SR; /**< \brief (Pwm Offset: 0x0C) PWM Status Register */ - __O uint32_t PWM_IER1; /**< \brief (Pwm Offset: 0x10) PWM Interrupt Enable Register 1 */ - __O uint32_t PWM_IDR1; /**< \brief (Pwm Offset: 0x14) PWM Interrupt Disable Register 1 */ - __I uint32_t PWM_IMR1; /**< \brief (Pwm Offset: 0x18) PWM Interrupt Mask Register 1 */ - __I uint32_t PWM_ISR1; /**< \brief (Pwm Offset: 0x1C) PWM Interrupt Status Register 1 */ - __IO uint32_t PWM_SCM; /**< \brief (Pwm Offset: 0x20) PWM Sync Channels Mode Register */ - __O uint32_t PWM_DMAR; /**< \brief (Pwm Offset: 0x24) PWM DMA Register */ - __IO uint32_t PWM_SCUC; /**< \brief (Pwm Offset: 0x28) PWM Sync Channels Update Control Register */ - __IO uint32_t PWM_SCUP; /**< \brief (Pwm Offset: 0x2C) PWM Sync Channels Update Period Register */ - __O uint32_t PWM_SCUPUPD; /**< \brief (Pwm Offset: 0x30) PWM Sync Channels Update Period Update Register */ - __O uint32_t PWM_IER2; /**< \brief (Pwm Offset: 0x34) PWM Interrupt Enable Register 2 */ - __O uint32_t PWM_IDR2; /**< \brief (Pwm Offset: 0x38) PWM Interrupt Disable Register 2 */ - __I uint32_t PWM_IMR2; /**< \brief (Pwm Offset: 0x3C) PWM Interrupt Mask Register 2 */ - __I uint32_t PWM_ISR2; /**< \brief (Pwm Offset: 0x40) PWM Interrupt Status Register 2 */ - __IO uint32_t PWM_OOV; /**< \brief (Pwm Offset: 0x44) PWM Output Override Value Register */ - __IO uint32_t PWM_OS; /**< \brief (Pwm Offset: 0x48) PWM Output Selection Register */ - __O uint32_t PWM_OSS; /**< \brief (Pwm Offset: 0x4C) PWM Output Selection Set Register */ - __O uint32_t PWM_OSC; /**< \brief (Pwm Offset: 0x50) PWM Output Selection Clear Register */ - __O uint32_t PWM_OSSUPD; /**< \brief (Pwm Offset: 0x54) PWM Output Selection Set Update Register */ - __O uint32_t PWM_OSCUPD; /**< \brief (Pwm Offset: 0x58) PWM Output Selection Clear Update Register */ - __IO uint32_t PWM_FMR; /**< \brief (Pwm Offset: 0x5C) PWM Fault Mode Register */ - __I uint32_t PWM_FSR; /**< \brief (Pwm Offset: 0x60) PWM Fault Status Register */ - __O uint32_t PWM_FCR; /**< \brief (Pwm Offset: 0x64) PWM Fault Clear Register */ - __IO uint32_t PWM_FPV1; /**< \brief (Pwm Offset: 0x68) PWM Fault Protection Value Register 1 */ - __IO uint32_t PWM_FPE; /**< \brief (Pwm Offset: 0x6C) PWM Fault Protection Enable Register */ - __I uint32_t Reserved1[3]; - __IO uint32_t PWM_ELMR[8]; /**< \brief (Pwm Offset: 0x7C) PWM Event Line 0 Mode Register */ - __I uint32_t Reserved2[1]; - __IO uint32_t PWM_SSPR; /**< \brief (Pwm Offset: 0xA0) PWM Spread Spectrum Register */ - __O uint32_t PWM_SSPUP; /**< \brief (Pwm Offset: 0xA4) PWM Spread Spectrum Update Register */ - __I uint32_t Reserved3[2]; - __IO uint32_t PWM_SMMR; /**< \brief (Pwm Offset: 0xB0) PWM Stepper Motor Mode Register */ - __I uint32_t Reserved4[3]; - __IO uint32_t PWM_FPV2; /**< \brief (Pwm Offset: 0xC0) PWM Fault Protection Value 2 Register */ - __I uint32_t Reserved5[8]; - __O uint32_t PWM_WPCR; /**< \brief (Pwm Offset: 0xE4) PWM Write Protection Control Register */ - __I uint32_t PWM_WPSR; /**< \brief (Pwm Offset: 0xE8) PWM Write Protection Status Register */ - __I uint32_t Reserved6[17]; - PwmCmp PWM_CMP[PWMCMP_NUMBER]; /**< \brief (Pwm Offset: 0x130) 0 .. 7 */ - __I uint32_t Reserved7[20]; - PwmCh_num PWM_CH_NUM[PWMCH_NUM_NUMBER]; /**< \brief (Pwm Offset: 0x200) ch_num = 0 .. 3 */ - __I uint32_t Reserved8[96]; - __O uint32_t PWM_CMUPD0; /**< \brief (Pwm Offset: 0x400) PWM Channel Mode Update Register (ch_num = 0) */ - __I uint32_t Reserved9[7]; - __O uint32_t PWM_CMUPD1; /**< \brief (Pwm Offset: 0x420) PWM Channel Mode Update Register (ch_num = 1) */ - __I uint32_t Reserved10[2]; - __IO uint32_t PWM_ETRG1; /**< \brief (Pwm Offset: 0x42C) PWM External Trigger Register (trg_num = 1) */ - __IO uint32_t PWM_LEBR1; /**< \brief (Pwm Offset: 0x430) PWM Leading-Edge Blanking Register (trg_num = 1) */ - __I uint32_t Reserved11[3]; - __O uint32_t PWM_CMUPD2; /**< \brief (Pwm Offset: 0x440) PWM Channel Mode Update Register (ch_num = 2) */ - __I uint32_t Reserved12[2]; - __IO uint32_t PWM_ETRG2; /**< \brief (Pwm Offset: 0x44C) PWM External Trigger Register (trg_num = 2) */ - __IO uint32_t PWM_LEBR2; /**< \brief (Pwm Offset: 0x450) PWM Leading-Edge Blanking Register (trg_num = 2) */ - __I uint32_t Reserved13[3]; - __O uint32_t PWM_CMUPD3; /**< \brief (Pwm Offset: 0x460) PWM Channel Mode Update Register (ch_num = 3) */ - __I uint32_t Reserved14[2]; - __IO uint32_t PWM_ETRG3; /**< \brief (Pwm Offset: 0x46C) PWM External Trigger Register (trg_num = 3) */ - __IO uint32_t PWM_LEBR3; /**< \brief (Pwm Offset: 0x470) PWM Leading-Edge Blanking Register (trg_num = 3) */ - __I uint32_t Reserved15[6]; - __IO uint32_t PWM_ETRG4; /**< \brief (Pwm Offset: 0x48C) PWM External Trigger Register (trg_num = 4) */ - __IO uint32_t PWM_LEBR4; /**< \brief (Pwm Offset: 0x490) PWM Leading-Edge Blanking Register (trg_num = 4) */ -} Pwm; -#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/* -------- PWM_CLK : (PWM Offset: 0x00) PWM Clock Register -------- */ -#define PWM_CLK_DIVA_Pos 0 -#define PWM_CLK_DIVA_Msk (0xffu << PWM_CLK_DIVA_Pos) /**< \brief (PWM_CLK) CLKA Divide Factor */ -#define PWM_CLK_DIVA(value) ((PWM_CLK_DIVA_Msk & ((value) << PWM_CLK_DIVA_Pos))) -#define PWM_CLK_DIVA_CLKA_POFF (0x0u << 0) /**< \brief (PWM_CLK) CLKA clock is turned off */ -#define PWM_CLK_DIVA_PREA (0x1u << 0) /**< \brief (PWM_CLK) CLKA clock is clock selected by PREA */ -#define PWM_CLK_PREA_Pos 8 -#define PWM_CLK_PREA_Msk (0xfu << PWM_CLK_PREA_Pos) /**< \brief (PWM_CLK) CLKA Source Clock Selection */ -#define PWM_CLK_PREA(value) ((PWM_CLK_PREA_Msk & ((value) << PWM_CLK_PREA_Pos))) -#define PWM_CLK_PREA_CLK (0x0u << 8) /**< \brief (PWM_CLK) Peripheral clock */ -#define PWM_CLK_PREA_CLK_DIV2 (0x1u << 8) /**< \brief (PWM_CLK) Peripheral clock/2 */ -#define PWM_CLK_PREA_CLK_DIV4 (0x2u << 8) /**< \brief (PWM_CLK) Peripheral clock/4 */ -#define PWM_CLK_PREA_CLK_DIV8 (0x3u << 8) /**< \brief (PWM_CLK) Peripheral clock/8 */ -#define PWM_CLK_PREA_CLK_DIV16 (0x4u << 8) /**< \brief (PWM_CLK) Peripheral clock/16 */ -#define PWM_CLK_PREA_CLK_DIV32 (0x5u << 8) /**< \brief (PWM_CLK) Peripheral clock/32 */ -#define PWM_CLK_PREA_CLK_DIV64 (0x6u << 8) /**< \brief (PWM_CLK) Peripheral clock/64 */ -#define PWM_CLK_PREA_CLK_DIV128 (0x7u << 8) /**< \brief (PWM_CLK) Peripheral clock/128 */ -#define PWM_CLK_PREA_CLK_DIV256 (0x8u << 8) /**< \brief (PWM_CLK) Peripheral clock/256 */ -#define PWM_CLK_PREA_CLK_DIV512 (0x9u << 8) /**< \brief (PWM_CLK) Peripheral clock/512 */ -#define PWM_CLK_PREA_CLK_DIV1024 (0xAu << 8) /**< \brief (PWM_CLK) Peripheral clock/1024 */ -#define PWM_CLK_DIVB_Pos 16 -#define PWM_CLK_DIVB_Msk (0xffu << PWM_CLK_DIVB_Pos) /**< \brief (PWM_CLK) CLKB Divide Factor */ -#define PWM_CLK_DIVB(value) ((PWM_CLK_DIVB_Msk & ((value) << PWM_CLK_DIVB_Pos))) -#define PWM_CLK_DIVB_CLKB_POFF (0x0u << 16) /**< \brief (PWM_CLK) CLKB clock is turned off */ -#define PWM_CLK_DIVB_PREB (0x1u << 16) /**< \brief (PWM_CLK) CLKB clock is clock selected by PREB */ -#define PWM_CLK_PREB_Pos 24 -#define PWM_CLK_PREB_Msk (0xfu << PWM_CLK_PREB_Pos) /**< \brief (PWM_CLK) CLKB Source Clock Selection */ -#define PWM_CLK_PREB(value) ((PWM_CLK_PREB_Msk & ((value) << PWM_CLK_PREB_Pos))) -#define PWM_CLK_PREB_CLK (0x0u << 24) /**< \brief (PWM_CLK) Peripheral clock */ -#define PWM_CLK_PREB_CLK_DIV2 (0x1u << 24) /**< \brief (PWM_CLK) Peripheral clock/2 */ -#define PWM_CLK_PREB_CLK_DIV4 (0x2u << 24) /**< \brief (PWM_CLK) Peripheral clock/4 */ -#define PWM_CLK_PREB_CLK_DIV8 (0x3u << 24) /**< \brief (PWM_CLK) Peripheral clock/8 */ -#define PWM_CLK_PREB_CLK_DIV16 (0x4u << 24) /**< \brief (PWM_CLK) Peripheral clock/16 */ -#define PWM_CLK_PREB_CLK_DIV32 (0x5u << 24) /**< \brief (PWM_CLK) Peripheral clock/32 */ -#define PWM_CLK_PREB_CLK_DIV64 (0x6u << 24) /**< \brief (PWM_CLK) Peripheral clock/64 */ -#define PWM_CLK_PREB_CLK_DIV128 (0x7u << 24) /**< \brief (PWM_CLK) Peripheral clock/128 */ -#define PWM_CLK_PREB_CLK_DIV256 (0x8u << 24) /**< \brief (PWM_CLK) Peripheral clock/256 */ -#define PWM_CLK_PREB_CLK_DIV512 (0x9u << 24) /**< \brief (PWM_CLK) Peripheral clock/512 */ -#define PWM_CLK_PREB_CLK_DIV1024 (0xAu << 24) /**< \brief (PWM_CLK) Peripheral clock/1024 */ -/* -------- PWM_ENA : (PWM Offset: 0x04) PWM Enable Register -------- */ -#define PWM_ENA_CHID0 (0x1u << 0) /**< \brief (PWM_ENA) Channel ID */ -#define PWM_ENA_CHID1 (0x1u << 1) /**< \brief (PWM_ENA) Channel ID */ -#define PWM_ENA_CHID2 (0x1u << 2) /**< \brief (PWM_ENA) Channel ID */ -#define PWM_ENA_CHID3 (0x1u << 3) /**< \brief (PWM_ENA) Channel ID */ -/* -------- PWM_DIS : (PWM Offset: 0x08) PWM Disable Register -------- */ -#define PWM_DIS_CHID0 (0x1u << 0) /**< \brief (PWM_DIS) Channel ID */ -#define PWM_DIS_CHID1 (0x1u << 1) /**< \brief (PWM_DIS) Channel ID */ -#define PWM_DIS_CHID2 (0x1u << 2) /**< \brief (PWM_DIS) Channel ID */ -#define PWM_DIS_CHID3 (0x1u << 3) /**< \brief (PWM_DIS) Channel ID */ -/* -------- PWM_SR : (PWM Offset: 0x0C) PWM Status Register -------- */ -#define PWM_SR_CHID0 (0x1u << 0) /**< \brief (PWM_SR) Channel ID */ -#define PWM_SR_CHID1 (0x1u << 1) /**< \brief (PWM_SR) Channel ID */ -#define PWM_SR_CHID2 (0x1u << 2) /**< \brief (PWM_SR) Channel ID */ -#define PWM_SR_CHID3 (0x1u << 3) /**< \brief (PWM_SR) Channel ID */ -/* -------- PWM_IER1 : (PWM Offset: 0x10) PWM Interrupt Enable Register 1 -------- */ -#define PWM_IER1_CHID0 (0x1u << 0) /**< \brief (PWM_IER1) Counter Event on Channel 0 Interrupt Enable */ -#define PWM_IER1_CHID1 (0x1u << 1) /**< \brief (PWM_IER1) Counter Event on Channel 1 Interrupt Enable */ -#define PWM_IER1_CHID2 (0x1u << 2) /**< \brief (PWM_IER1) Counter Event on Channel 2 Interrupt Enable */ -#define PWM_IER1_CHID3 (0x1u << 3) /**< \brief (PWM_IER1) Counter Event on Channel 3 Interrupt Enable */ -#define PWM_IER1_FCHID0 (0x1u << 16) /**< \brief (PWM_IER1) Fault Protection Trigger on Channel 0 Interrupt Enable */ -#define PWM_IER1_FCHID1 (0x1u << 17) /**< \brief (PWM_IER1) Fault Protection Trigger on Channel 1 Interrupt Enable */ -#define PWM_IER1_FCHID2 (0x1u << 18) /**< \brief (PWM_IER1) Fault Protection Trigger on Channel 2 Interrupt Enable */ -#define PWM_IER1_FCHID3 (0x1u << 19) /**< \brief (PWM_IER1) Fault Protection Trigger on Channel 3 Interrupt Enable */ -/* -------- PWM_IDR1 : (PWM Offset: 0x14) PWM Interrupt Disable Register 1 -------- */ -#define PWM_IDR1_CHID0 (0x1u << 0) /**< \brief (PWM_IDR1) Counter Event on Channel 0 Interrupt Disable */ -#define PWM_IDR1_CHID1 (0x1u << 1) /**< \brief (PWM_IDR1) Counter Event on Channel 1 Interrupt Disable */ -#define PWM_IDR1_CHID2 (0x1u << 2) /**< \brief (PWM_IDR1) Counter Event on Channel 2 Interrupt Disable */ -#define PWM_IDR1_CHID3 (0x1u << 3) /**< \brief (PWM_IDR1) Counter Event on Channel 3 Interrupt Disable */ -#define PWM_IDR1_FCHID0 (0x1u << 16) /**< \brief (PWM_IDR1) Fault Protection Trigger on Channel 0 Interrupt Disable */ -#define PWM_IDR1_FCHID1 (0x1u << 17) /**< \brief (PWM_IDR1) Fault Protection Trigger on Channel 1 Interrupt Disable */ -#define PWM_IDR1_FCHID2 (0x1u << 18) /**< \brief (PWM_IDR1) Fault Protection Trigger on Channel 2 Interrupt Disable */ -#define PWM_IDR1_FCHID3 (0x1u << 19) /**< \brief (PWM_IDR1) Fault Protection Trigger on Channel 3 Interrupt Disable */ -/* -------- PWM_IMR1 : (PWM Offset: 0x18) PWM Interrupt Mask Register 1 -------- */ -#define PWM_IMR1_CHID0 (0x1u << 0) /**< \brief (PWM_IMR1) Counter Event on Channel 0 Interrupt Mask */ -#define PWM_IMR1_CHID1 (0x1u << 1) /**< \brief (PWM_IMR1) Counter Event on Channel 1 Interrupt Mask */ -#define PWM_IMR1_CHID2 (0x1u << 2) /**< \brief (PWM_IMR1) Counter Event on Channel 2 Interrupt Mask */ -#define PWM_IMR1_CHID3 (0x1u << 3) /**< \brief (PWM_IMR1) Counter Event on Channel 3 Interrupt Mask */ -#define PWM_IMR1_FCHID0 (0x1u << 16) /**< \brief (PWM_IMR1) Fault Protection Trigger on Channel 0 Interrupt Mask */ -#define PWM_IMR1_FCHID1 (0x1u << 17) /**< \brief (PWM_IMR1) Fault Protection Trigger on Channel 1 Interrupt Mask */ -#define PWM_IMR1_FCHID2 (0x1u << 18) /**< \brief (PWM_IMR1) Fault Protection Trigger on Channel 2 Interrupt Mask */ -#define PWM_IMR1_FCHID3 (0x1u << 19) /**< \brief (PWM_IMR1) Fault Protection Trigger on Channel 3 Interrupt Mask */ -/* -------- PWM_ISR1 : (PWM Offset: 0x1C) PWM Interrupt Status Register 1 -------- */ -#define PWM_ISR1_CHID0 (0x1u << 0) /**< \brief (PWM_ISR1) Counter Event on Channel 0 */ -#define PWM_ISR1_CHID1 (0x1u << 1) /**< \brief (PWM_ISR1) Counter Event on Channel 1 */ -#define PWM_ISR1_CHID2 (0x1u << 2) /**< \brief (PWM_ISR1) Counter Event on Channel 2 */ -#define PWM_ISR1_CHID3 (0x1u << 3) /**< \brief (PWM_ISR1) Counter Event on Channel 3 */ -#define PWM_ISR1_FCHID0 (0x1u << 16) /**< \brief (PWM_ISR1) Fault Protection Trigger on Channel 0 */ -#define PWM_ISR1_FCHID1 (0x1u << 17) /**< \brief (PWM_ISR1) Fault Protection Trigger on Channel 1 */ -#define PWM_ISR1_FCHID2 (0x1u << 18) /**< \brief (PWM_ISR1) Fault Protection Trigger on Channel 2 */ -#define PWM_ISR1_FCHID3 (0x1u << 19) /**< \brief (PWM_ISR1) Fault Protection Trigger on Channel 3 */ -/* -------- PWM_SCM : (PWM Offset: 0x20) PWM Sync Channels Mode Register -------- */ -#define PWM_SCM_SYNC0 (0x1u << 0) /**< \brief (PWM_SCM) Synchronous Channel 0 */ -#define PWM_SCM_SYNC1 (0x1u << 1) /**< \brief (PWM_SCM) Synchronous Channel 1 */ -#define PWM_SCM_SYNC2 (0x1u << 2) /**< \brief (PWM_SCM) Synchronous Channel 2 */ -#define PWM_SCM_SYNC3 (0x1u << 3) /**< \brief (PWM_SCM) Synchronous Channel 3 */ -#define PWM_SCM_UPDM_Pos 16 -#define PWM_SCM_UPDM_Msk (0x3u << PWM_SCM_UPDM_Pos) /**< \brief (PWM_SCM) Synchronous Channels Update Mode */ -#define PWM_SCM_UPDM(value) ((PWM_SCM_UPDM_Msk & ((value) << PWM_SCM_UPDM_Pos))) -#define PWM_SCM_UPDM_MODE0 (0x0u << 16) /**< \brief (PWM_SCM) Manual write of double buffer registers and manual update of synchronous channels */ -#define PWM_SCM_UPDM_MODE1 (0x1u << 16) /**< \brief (PWM_SCM) Manual write of double buffer registers and automatic update of synchronous channels */ -#define PWM_SCM_UPDM_MODE2 (0x2u << 16) /**< \brief (PWM_SCM) Automatic write of duty-cycle update registers by the DMA and automatic update of synchronous channels */ -#define PWM_SCM_PTRM (0x1u << 20) /**< \brief (PWM_SCM) DMA Transfer Request Mode */ -#define PWM_SCM_PTRCS_Pos 21 -#define PWM_SCM_PTRCS_Msk (0x7u << PWM_SCM_PTRCS_Pos) /**< \brief (PWM_SCM) DMA Transfer Request Comparison Selection */ -#define PWM_SCM_PTRCS(value) ((PWM_SCM_PTRCS_Msk & ((value) << PWM_SCM_PTRCS_Pos))) -/* -------- PWM_DMAR : (PWM Offset: 0x24) PWM DMA Register -------- */ -#define PWM_DMAR_DMADUTY_Pos 0 -#define PWM_DMAR_DMADUTY_Msk (0xffffffu << PWM_DMAR_DMADUTY_Pos) /**< \brief (PWM_DMAR) Duty-Cycle Holding Register for DMA Access */ -#define PWM_DMAR_DMADUTY(value) ((PWM_DMAR_DMADUTY_Msk & ((value) << PWM_DMAR_DMADUTY_Pos))) -/* -------- PWM_SCUC : (PWM Offset: 0x28) PWM Sync Channels Update Control Register -------- */ -#define PWM_SCUC_UPDULOCK (0x1u << 0) /**< \brief (PWM_SCUC) Synchronous Channels Update Unlock */ -/* -------- PWM_SCUP : (PWM Offset: 0x2C) PWM Sync Channels Update Period Register -------- */ -#define PWM_SCUP_UPR_Pos 0 -#define PWM_SCUP_UPR_Msk (0xfu << PWM_SCUP_UPR_Pos) /**< \brief (PWM_SCUP) Update Period */ -#define PWM_SCUP_UPR(value) ((PWM_SCUP_UPR_Msk & ((value) << PWM_SCUP_UPR_Pos))) -#define PWM_SCUP_UPRCNT_Pos 4 -#define PWM_SCUP_UPRCNT_Msk (0xfu << PWM_SCUP_UPRCNT_Pos) /**< \brief (PWM_SCUP) Update Period Counter */ -#define PWM_SCUP_UPRCNT(value) ((PWM_SCUP_UPRCNT_Msk & ((value) << PWM_SCUP_UPRCNT_Pos))) -/* -------- PWM_SCUPUPD : (PWM Offset: 0x30) PWM Sync Channels Update Period Update Register -------- */ -#define PWM_SCUPUPD_UPRUPD_Pos 0 -#define PWM_SCUPUPD_UPRUPD_Msk (0xfu << PWM_SCUPUPD_UPRUPD_Pos) /**< \brief (PWM_SCUPUPD) Update Period Update */ -#define PWM_SCUPUPD_UPRUPD(value) ((PWM_SCUPUPD_UPRUPD_Msk & ((value) << PWM_SCUPUPD_UPRUPD_Pos))) -/* -------- PWM_IER2 : (PWM Offset: 0x34) PWM Interrupt Enable Register 2 -------- */ -#define PWM_IER2_WRDY (0x1u << 0) /**< \brief (PWM_IER2) Write Ready for Synchronous Channels Update Interrupt Enable */ -#define PWM_IER2_UNRE (0x1u << 3) /**< \brief (PWM_IER2) Synchronous Channels Update Underrun Error Interrupt Enable */ -#define PWM_IER2_CMPM0 (0x1u << 8) /**< \brief (PWM_IER2) Comparison 0 Match Interrupt Enable */ -#define PWM_IER2_CMPM1 (0x1u << 9) /**< \brief (PWM_IER2) Comparison 1 Match Interrupt Enable */ -#define PWM_IER2_CMPM2 (0x1u << 10) /**< \brief (PWM_IER2) Comparison 2 Match Interrupt Enable */ -#define PWM_IER2_CMPM3 (0x1u << 11) /**< \brief (PWM_IER2) Comparison 3 Match Interrupt Enable */ -#define PWM_IER2_CMPM4 (0x1u << 12) /**< \brief (PWM_IER2) Comparison 4 Match Interrupt Enable */ -#define PWM_IER2_CMPM5 (0x1u << 13) /**< \brief (PWM_IER2) Comparison 5 Match Interrupt Enable */ -#define PWM_IER2_CMPM6 (0x1u << 14) /**< \brief (PWM_IER2) Comparison 6 Match Interrupt Enable */ -#define PWM_IER2_CMPM7 (0x1u << 15) /**< \brief (PWM_IER2) Comparison 7 Match Interrupt Enable */ -#define PWM_IER2_CMPU0 (0x1u << 16) /**< \brief (PWM_IER2) Comparison 0 Update Interrupt Enable */ -#define PWM_IER2_CMPU1 (0x1u << 17) /**< \brief (PWM_IER2) Comparison 1 Update Interrupt Enable */ -#define PWM_IER2_CMPU2 (0x1u << 18) /**< \brief (PWM_IER2) Comparison 2 Update Interrupt Enable */ -#define PWM_IER2_CMPU3 (0x1u << 19) /**< \brief (PWM_IER2) Comparison 3 Update Interrupt Enable */ -#define PWM_IER2_CMPU4 (0x1u << 20) /**< \brief (PWM_IER2) Comparison 4 Update Interrupt Enable */ -#define PWM_IER2_CMPU5 (0x1u << 21) /**< \brief (PWM_IER2) Comparison 5 Update Interrupt Enable */ -#define PWM_IER2_CMPU6 (0x1u << 22) /**< \brief (PWM_IER2) Comparison 6 Update Interrupt Enable */ -#define PWM_IER2_CMPU7 (0x1u << 23) /**< \brief (PWM_IER2) Comparison 7 Update Interrupt Enable */ -/* -------- PWM_IDR2 : (PWM Offset: 0x38) PWM Interrupt Disable Register 2 -------- */ -#define PWM_IDR2_WRDY (0x1u << 0) /**< \brief (PWM_IDR2) Write Ready for Synchronous Channels Update Interrupt Disable */ -#define PWM_IDR2_UNRE (0x1u << 3) /**< \brief (PWM_IDR2) Synchronous Channels Update Underrun Error Interrupt Disable */ -#define PWM_IDR2_CMPM0 (0x1u << 8) /**< \brief (PWM_IDR2) Comparison 0 Match Interrupt Disable */ -#define PWM_IDR2_CMPM1 (0x1u << 9) /**< \brief (PWM_IDR2) Comparison 1 Match Interrupt Disable */ -#define PWM_IDR2_CMPM2 (0x1u << 10) /**< \brief (PWM_IDR2) Comparison 2 Match Interrupt Disable */ -#define PWM_IDR2_CMPM3 (0x1u << 11) /**< \brief (PWM_IDR2) Comparison 3 Match Interrupt Disable */ -#define PWM_IDR2_CMPM4 (0x1u << 12) /**< \brief (PWM_IDR2) Comparison 4 Match Interrupt Disable */ -#define PWM_IDR2_CMPM5 (0x1u << 13) /**< \brief (PWM_IDR2) Comparison 5 Match Interrupt Disable */ -#define PWM_IDR2_CMPM6 (0x1u << 14) /**< \brief (PWM_IDR2) Comparison 6 Match Interrupt Disable */ -#define PWM_IDR2_CMPM7 (0x1u << 15) /**< \brief (PWM_IDR2) Comparison 7 Match Interrupt Disable */ -#define PWM_IDR2_CMPU0 (0x1u << 16) /**< \brief (PWM_IDR2) Comparison 0 Update Interrupt Disable */ -#define PWM_IDR2_CMPU1 (0x1u << 17) /**< \brief (PWM_IDR2) Comparison 1 Update Interrupt Disable */ -#define PWM_IDR2_CMPU2 (0x1u << 18) /**< \brief (PWM_IDR2) Comparison 2 Update Interrupt Disable */ -#define PWM_IDR2_CMPU3 (0x1u << 19) /**< \brief (PWM_IDR2) Comparison 3 Update Interrupt Disable */ -#define PWM_IDR2_CMPU4 (0x1u << 20) /**< \brief (PWM_IDR2) Comparison 4 Update Interrupt Disable */ -#define PWM_IDR2_CMPU5 (0x1u << 21) /**< \brief (PWM_IDR2) Comparison 5 Update Interrupt Disable */ -#define PWM_IDR2_CMPU6 (0x1u << 22) /**< \brief (PWM_IDR2) Comparison 6 Update Interrupt Disable */ -#define PWM_IDR2_CMPU7 (0x1u << 23) /**< \brief (PWM_IDR2) Comparison 7 Update Interrupt Disable */ -/* -------- PWM_IMR2 : (PWM Offset: 0x3C) PWM Interrupt Mask Register 2 -------- */ -#define PWM_IMR2_WRDY (0x1u << 0) /**< \brief (PWM_IMR2) Write Ready for Synchronous Channels Update Interrupt Mask */ -#define PWM_IMR2_UNRE (0x1u << 3) /**< \brief (PWM_IMR2) Synchronous Channels Update Underrun Error Interrupt Mask */ -#define PWM_IMR2_CMPM0 (0x1u << 8) /**< \brief (PWM_IMR2) Comparison 0 Match Interrupt Mask */ -#define PWM_IMR2_CMPM1 (0x1u << 9) /**< \brief (PWM_IMR2) Comparison 1 Match Interrupt Mask */ -#define PWM_IMR2_CMPM2 (0x1u << 10) /**< \brief (PWM_IMR2) Comparison 2 Match Interrupt Mask */ -#define PWM_IMR2_CMPM3 (0x1u << 11) /**< \brief (PWM_IMR2) Comparison 3 Match Interrupt Mask */ -#define PWM_IMR2_CMPM4 (0x1u << 12) /**< \brief (PWM_IMR2) Comparison 4 Match Interrupt Mask */ -#define PWM_IMR2_CMPM5 (0x1u << 13) /**< \brief (PWM_IMR2) Comparison 5 Match Interrupt Mask */ -#define PWM_IMR2_CMPM6 (0x1u << 14) /**< \brief (PWM_IMR2) Comparison 6 Match Interrupt Mask */ -#define PWM_IMR2_CMPM7 (0x1u << 15) /**< \brief (PWM_IMR2) Comparison 7 Match Interrupt Mask */ -#define PWM_IMR2_CMPU0 (0x1u << 16) /**< \brief (PWM_IMR2) Comparison 0 Update Interrupt Mask */ -#define PWM_IMR2_CMPU1 (0x1u << 17) /**< \brief (PWM_IMR2) Comparison 1 Update Interrupt Mask */ -#define PWM_IMR2_CMPU2 (0x1u << 18) /**< \brief (PWM_IMR2) Comparison 2 Update Interrupt Mask */ -#define PWM_IMR2_CMPU3 (0x1u << 19) /**< \brief (PWM_IMR2) Comparison 3 Update Interrupt Mask */ -#define PWM_IMR2_CMPU4 (0x1u << 20) /**< \brief (PWM_IMR2) Comparison 4 Update Interrupt Mask */ -#define PWM_IMR2_CMPU5 (0x1u << 21) /**< \brief (PWM_IMR2) Comparison 5 Update Interrupt Mask */ -#define PWM_IMR2_CMPU6 (0x1u << 22) /**< \brief (PWM_IMR2) Comparison 6 Update Interrupt Mask */ -#define PWM_IMR2_CMPU7 (0x1u << 23) /**< \brief (PWM_IMR2) Comparison 7 Update Interrupt Mask */ -/* -------- PWM_ISR2 : (PWM Offset: 0x40) PWM Interrupt Status Register 2 -------- */ -#define PWM_ISR2_WRDY (0x1u << 0) /**< \brief (PWM_ISR2) Write Ready for Synchronous Channels Update */ -#define PWM_ISR2_UNRE (0x1u << 3) /**< \brief (PWM_ISR2) Synchronous Channels Update Underrun Error */ -#define PWM_ISR2_CMPM0 (0x1u << 8) /**< \brief (PWM_ISR2) Comparison 0 Match */ -#define PWM_ISR2_CMPM1 (0x1u << 9) /**< \brief (PWM_ISR2) Comparison 1 Match */ -#define PWM_ISR2_CMPM2 (0x1u << 10) /**< \brief (PWM_ISR2) Comparison 2 Match */ -#define PWM_ISR2_CMPM3 (0x1u << 11) /**< \brief (PWM_ISR2) Comparison 3 Match */ -#define PWM_ISR2_CMPM4 (0x1u << 12) /**< \brief (PWM_ISR2) Comparison 4 Match */ -#define PWM_ISR2_CMPM5 (0x1u << 13) /**< \brief (PWM_ISR2) Comparison 5 Match */ -#define PWM_ISR2_CMPM6 (0x1u << 14) /**< \brief (PWM_ISR2) Comparison 6 Match */ -#define PWM_ISR2_CMPM7 (0x1u << 15) /**< \brief (PWM_ISR2) Comparison 7 Match */ -#define PWM_ISR2_CMPU0 (0x1u << 16) /**< \brief (PWM_ISR2) Comparison 0 Update */ -#define PWM_ISR2_CMPU1 (0x1u << 17) /**< \brief (PWM_ISR2) Comparison 1 Update */ -#define PWM_ISR2_CMPU2 (0x1u << 18) /**< \brief (PWM_ISR2) Comparison 2 Update */ -#define PWM_ISR2_CMPU3 (0x1u << 19) /**< \brief (PWM_ISR2) Comparison 3 Update */ -#define PWM_ISR2_CMPU4 (0x1u << 20) /**< \brief (PWM_ISR2) Comparison 4 Update */ -#define PWM_ISR2_CMPU5 (0x1u << 21) /**< \brief (PWM_ISR2) Comparison 5 Update */ -#define PWM_ISR2_CMPU6 (0x1u << 22) /**< \brief (PWM_ISR2) Comparison 6 Update */ -#define PWM_ISR2_CMPU7 (0x1u << 23) /**< \brief (PWM_ISR2) Comparison 7 Update */ -/* -------- PWM_OOV : (PWM Offset: 0x44) PWM Output Override Value Register -------- */ -#define PWM_OOV_OOVH0 (0x1u << 0) /**< \brief (PWM_OOV) Output Override Value for PWMH output of the channel 0 */ -#define PWM_OOV_OOVH1 (0x1u << 1) /**< \brief (PWM_OOV) Output Override Value for PWMH output of the channel 1 */ -#define PWM_OOV_OOVH2 (0x1u << 2) /**< \brief (PWM_OOV) Output Override Value for PWMH output of the channel 2 */ -#define PWM_OOV_OOVH3 (0x1u << 3) /**< \brief (PWM_OOV) Output Override Value for PWMH output of the channel 3 */ -#define PWM_OOV_OOVL0 (0x1u << 16) /**< \brief (PWM_OOV) Output Override Value for PWML output of the channel 0 */ -#define PWM_OOV_OOVL1 (0x1u << 17) /**< \brief (PWM_OOV) Output Override Value for PWML output of the channel 1 */ -#define PWM_OOV_OOVL2 (0x1u << 18) /**< \brief (PWM_OOV) Output Override Value for PWML output of the channel 2 */ -#define PWM_OOV_OOVL3 (0x1u << 19) /**< \brief (PWM_OOV) Output Override Value for PWML output of the channel 3 */ -/* -------- PWM_OS : (PWM Offset: 0x48) PWM Output Selection Register -------- */ -#define PWM_OS_OSH0 (0x1u << 0) /**< \brief (PWM_OS) Output Selection for PWMH output of the channel 0 */ -#define PWM_OS_OSH1 (0x1u << 1) /**< \brief (PWM_OS) Output Selection for PWMH output of the channel 1 */ -#define PWM_OS_OSH2 (0x1u << 2) /**< \brief (PWM_OS) Output Selection for PWMH output of the channel 2 */ -#define PWM_OS_OSH3 (0x1u << 3) /**< \brief (PWM_OS) Output Selection for PWMH output of the channel 3 */ -#define PWM_OS_OSL0 (0x1u << 16) /**< \brief (PWM_OS) Output Selection for PWML output of the channel 0 */ -#define PWM_OS_OSL1 (0x1u << 17) /**< \brief (PWM_OS) Output Selection for PWML output of the channel 1 */ -#define PWM_OS_OSL2 (0x1u << 18) /**< \brief (PWM_OS) Output Selection for PWML output of the channel 2 */ -#define PWM_OS_OSL3 (0x1u << 19) /**< \brief (PWM_OS) Output Selection for PWML output of the channel 3 */ -/* -------- PWM_OSS : (PWM Offset: 0x4C) PWM Output Selection Set Register -------- */ -#define PWM_OSS_OSSH0 (0x1u << 0) /**< \brief (PWM_OSS) Output Selection Set for PWMH output of the channel 0 */ -#define PWM_OSS_OSSH1 (0x1u << 1) /**< \brief (PWM_OSS) Output Selection Set for PWMH output of the channel 1 */ -#define PWM_OSS_OSSH2 (0x1u << 2) /**< \brief (PWM_OSS) Output Selection Set for PWMH output of the channel 2 */ -#define PWM_OSS_OSSH3 (0x1u << 3) /**< \brief (PWM_OSS) Output Selection Set for PWMH output of the channel 3 */ -#define PWM_OSS_OSSL0 (0x1u << 16) /**< \brief (PWM_OSS) Output Selection Set for PWML output of the channel 0 */ -#define PWM_OSS_OSSL1 (0x1u << 17) /**< \brief (PWM_OSS) Output Selection Set for PWML output of the channel 1 */ -#define PWM_OSS_OSSL2 (0x1u << 18) /**< \brief (PWM_OSS) Output Selection Set for PWML output of the channel 2 */ -#define PWM_OSS_OSSL3 (0x1u << 19) /**< \brief (PWM_OSS) Output Selection Set for PWML output of the channel 3 */ -/* -------- PWM_OSC : (PWM Offset: 0x50) PWM Output Selection Clear Register -------- */ -#define PWM_OSC_OSCH0 (0x1u << 0) /**< \brief (PWM_OSC) Output Selection Clear for PWMH output of the channel 0 */ -#define PWM_OSC_OSCH1 (0x1u << 1) /**< \brief (PWM_OSC) Output Selection Clear for PWMH output of the channel 1 */ -#define PWM_OSC_OSCH2 (0x1u << 2) /**< \brief (PWM_OSC) Output Selection Clear for PWMH output of the channel 2 */ -#define PWM_OSC_OSCH3 (0x1u << 3) /**< \brief (PWM_OSC) Output Selection Clear for PWMH output of the channel 3 */ -#define PWM_OSC_OSCL0 (0x1u << 16) /**< \brief (PWM_OSC) Output Selection Clear for PWML output of the channel 0 */ -#define PWM_OSC_OSCL1 (0x1u << 17) /**< \brief (PWM_OSC) Output Selection Clear for PWML output of the channel 1 */ -#define PWM_OSC_OSCL2 (0x1u << 18) /**< \brief (PWM_OSC) Output Selection Clear for PWML output of the channel 2 */ -#define PWM_OSC_OSCL3 (0x1u << 19) /**< \brief (PWM_OSC) Output Selection Clear for PWML output of the channel 3 */ -/* -------- PWM_OSSUPD : (PWM Offset: 0x54) PWM Output Selection Set Update Register -------- */ -#define PWM_OSSUPD_OSSUPH0 (0x1u << 0) /**< \brief (PWM_OSSUPD) Output Selection Set for PWMH output of the channel 0 */ -#define PWM_OSSUPD_OSSUPH1 (0x1u << 1) /**< \brief (PWM_OSSUPD) Output Selection Set for PWMH output of the channel 1 */ -#define PWM_OSSUPD_OSSUPH2 (0x1u << 2) /**< \brief (PWM_OSSUPD) Output Selection Set for PWMH output of the channel 2 */ -#define PWM_OSSUPD_OSSUPH3 (0x1u << 3) /**< \brief (PWM_OSSUPD) Output Selection Set for PWMH output of the channel 3 */ -#define PWM_OSSUPD_OSSUPL0 (0x1u << 16) /**< \brief (PWM_OSSUPD) Output Selection Set for PWML output of the channel 0 */ -#define PWM_OSSUPD_OSSUPL1 (0x1u << 17) /**< \brief (PWM_OSSUPD) Output Selection Set for PWML output of the channel 1 */ -#define PWM_OSSUPD_OSSUPL2 (0x1u << 18) /**< \brief (PWM_OSSUPD) Output Selection Set for PWML output of the channel 2 */ -#define PWM_OSSUPD_OSSUPL3 (0x1u << 19) /**< \brief (PWM_OSSUPD) Output Selection Set for PWML output of the channel 3 */ -/* -------- PWM_OSCUPD : (PWM Offset: 0x58) PWM Output Selection Clear Update Register -------- */ -#define PWM_OSCUPD_OSCUPH0 (0x1u << 0) /**< \brief (PWM_OSCUPD) Output Selection Clear for PWMH output of the channel 0 */ -#define PWM_OSCUPD_OSCUPH1 (0x1u << 1) /**< \brief (PWM_OSCUPD) Output Selection Clear for PWMH output of the channel 1 */ -#define PWM_OSCUPD_OSCUPH2 (0x1u << 2) /**< \brief (PWM_OSCUPD) Output Selection Clear for PWMH output of the channel 2 */ -#define PWM_OSCUPD_OSCUPH3 (0x1u << 3) /**< \brief (PWM_OSCUPD) Output Selection Clear for PWMH output of the channel 3 */ -#define PWM_OSCUPD_OSCUPL0 (0x1u << 16) /**< \brief (PWM_OSCUPD) Output Selection Clear for PWML output of the channel 0 */ -#define PWM_OSCUPD_OSCUPL1 (0x1u << 17) /**< \brief (PWM_OSCUPD) Output Selection Clear for PWML output of the channel 1 */ -#define PWM_OSCUPD_OSCUPL2 (0x1u << 18) /**< \brief (PWM_OSCUPD) Output Selection Clear for PWML output of the channel 2 */ -#define PWM_OSCUPD_OSCUPL3 (0x1u << 19) /**< \brief (PWM_OSCUPD) Output Selection Clear for PWML output of the channel 3 */ -/* -------- PWM_FMR : (PWM Offset: 0x5C) PWM Fault Mode Register -------- */ -#define PWM_FMR_FPOL_Pos 0 -#define PWM_FMR_FPOL_Msk (0xffu << PWM_FMR_FPOL_Pos) /**< \brief (PWM_FMR) Fault Polarity */ -#define PWM_FMR_FPOL(value) ((PWM_FMR_FPOL_Msk & ((value) << PWM_FMR_FPOL_Pos))) -#define PWM_FMR_FMOD_Pos 8 -#define PWM_FMR_FMOD_Msk (0xffu << PWM_FMR_FMOD_Pos) /**< \brief (PWM_FMR) Fault Activation Mode */ -#define PWM_FMR_FMOD(value) ((PWM_FMR_FMOD_Msk & ((value) << PWM_FMR_FMOD_Pos))) -#define PWM_FMR_FFIL_Pos 16 -#define PWM_FMR_FFIL_Msk (0xffu << PWM_FMR_FFIL_Pos) /**< \brief (PWM_FMR) Fault Filtering */ -#define PWM_FMR_FFIL(value) ((PWM_FMR_FFIL_Msk & ((value) << PWM_FMR_FFIL_Pos))) -/* -------- PWM_FSR : (PWM Offset: 0x60) PWM Fault Status Register -------- */ -#define PWM_FSR_FIV_Pos 0 -#define PWM_FSR_FIV_Msk (0xffu << PWM_FSR_FIV_Pos) /**< \brief (PWM_FSR) Fault Input Value */ -#define PWM_FSR_FS_Pos 8 -#define PWM_FSR_FS_Msk (0xffu << PWM_FSR_FS_Pos) /**< \brief (PWM_FSR) Fault Status */ -/* -------- PWM_FCR : (PWM Offset: 0x64) PWM Fault Clear Register -------- */ -#define PWM_FCR_FCLR_Pos 0 -#define PWM_FCR_FCLR_Msk (0xffu << PWM_FCR_FCLR_Pos) /**< \brief (PWM_FCR) Fault Clear */ -#define PWM_FCR_FCLR(value) ((PWM_FCR_FCLR_Msk & ((value) << PWM_FCR_FCLR_Pos))) -/* -------- PWM_FPV1 : (PWM Offset: 0x68) PWM Fault Protection Value Register 1 -------- */ -#define PWM_FPV1_FPVH0 (0x1u << 0) /**< \brief (PWM_FPV1) Fault Protection Value for PWMH output on channel 0 */ -#define PWM_FPV1_FPVH1 (0x1u << 1) /**< \brief (PWM_FPV1) Fault Protection Value for PWMH output on channel 1 */ -#define PWM_FPV1_FPVH2 (0x1u << 2) /**< \brief (PWM_FPV1) Fault Protection Value for PWMH output on channel 2 */ -#define PWM_FPV1_FPVH3 (0x1u << 3) /**< \brief (PWM_FPV1) Fault Protection Value for PWMH output on channel 3 */ -#define PWM_FPV1_FPVL0 (0x1u << 16) /**< \brief (PWM_FPV1) Fault Protection Value for PWML output on channel 0 */ -#define PWM_FPV1_FPVL1 (0x1u << 17) /**< \brief (PWM_FPV1) Fault Protection Value for PWML output on channel 1 */ -#define PWM_FPV1_FPVL2 (0x1u << 18) /**< \brief (PWM_FPV1) Fault Protection Value for PWML output on channel 2 */ -#define PWM_FPV1_FPVL3 (0x1u << 19) /**< \brief (PWM_FPV1) Fault Protection Value for PWML output on channel 3 */ -/* -------- PWM_FPE : (PWM Offset: 0x6C) PWM Fault Protection Enable Register -------- */ -#define PWM_FPE_FPE0_Pos 0 -#define PWM_FPE_FPE0_Msk (0xffu << PWM_FPE_FPE0_Pos) /**< \brief (PWM_FPE) Fault Protection Enable for channel 0 */ -#define PWM_FPE_FPE0(value) ((PWM_FPE_FPE0_Msk & ((value) << PWM_FPE_FPE0_Pos))) -#define PWM_FPE_FPE1_Pos 8 -#define PWM_FPE_FPE1_Msk (0xffu << PWM_FPE_FPE1_Pos) /**< \brief (PWM_FPE) Fault Protection Enable for channel 1 */ -#define PWM_FPE_FPE1(value) ((PWM_FPE_FPE1_Msk & ((value) << PWM_FPE_FPE1_Pos))) -#define PWM_FPE_FPE2_Pos 16 -#define PWM_FPE_FPE2_Msk (0xffu << PWM_FPE_FPE2_Pos) /**< \brief (PWM_FPE) Fault Protection Enable for channel 2 */ -#define PWM_FPE_FPE2(value) ((PWM_FPE_FPE2_Msk & ((value) << PWM_FPE_FPE2_Pos))) -#define PWM_FPE_FPE3_Pos 24 -#define PWM_FPE_FPE3_Msk (0xffu << PWM_FPE_FPE3_Pos) /**< \brief (PWM_FPE) Fault Protection Enable for channel 3 */ -#define PWM_FPE_FPE3(value) ((PWM_FPE_FPE3_Msk & ((value) << PWM_FPE_FPE3_Pos))) -/* -------- PWM_ELMR[8] : (PWM Offset: 0x7C) PWM Event Line 0 Mode Register -------- */ -#define PWM_ELMR_CSEL0 (0x1u << 0) /**< \brief (PWM_ELMR[8]) Comparison 0 Selection */ -#define PWM_ELMR_CSEL1 (0x1u << 1) /**< \brief (PWM_ELMR[8]) Comparison 1 Selection */ -#define PWM_ELMR_CSEL2 (0x1u << 2) /**< \brief (PWM_ELMR[8]) Comparison 2 Selection */ -#define PWM_ELMR_CSEL3 (0x1u << 3) /**< \brief (PWM_ELMR[8]) Comparison 3 Selection */ -#define PWM_ELMR_CSEL4 (0x1u << 4) /**< \brief (PWM_ELMR[8]) Comparison 4 Selection */ -#define PWM_ELMR_CSEL5 (0x1u << 5) /**< \brief (PWM_ELMR[8]) Comparison 5 Selection */ -#define PWM_ELMR_CSEL6 (0x1u << 6) /**< \brief (PWM_ELMR[8]) Comparison 6 Selection */ -#define PWM_ELMR_CSEL7 (0x1u << 7) /**< \brief (PWM_ELMR[8]) Comparison 7 Selection */ -/* -------- PWM_SSPR : (PWM Offset: 0xA0) PWM Spread Spectrum Register -------- */ -#define PWM_SSPR_SPRD_Pos 0 -#define PWM_SSPR_SPRD_Msk (0xffffffu << PWM_SSPR_SPRD_Pos) /**< \brief (PWM_SSPR) Spread Spectrum Limit Value */ -#define PWM_SSPR_SPRD(value) ((PWM_SSPR_SPRD_Msk & ((value) << PWM_SSPR_SPRD_Pos))) -#define PWM_SSPR_SPRDM (0x1u << 24) /**< \brief (PWM_SSPR) Spread Spectrum Counter Mode */ -/* -------- PWM_SSPUP : (PWM Offset: 0xA4) PWM Spread Spectrum Update Register -------- */ -#define PWM_SSPUP_SPRDUP_Pos 0 -#define PWM_SSPUP_SPRDUP_Msk (0xffffffu << PWM_SSPUP_SPRDUP_Pos) /**< \brief (PWM_SSPUP) Spread Spectrum Limit Value Update */ -#define PWM_SSPUP_SPRDUP(value) ((PWM_SSPUP_SPRDUP_Msk & ((value) << PWM_SSPUP_SPRDUP_Pos))) -/* -------- PWM_SMMR : (PWM Offset: 0xB0) PWM Stepper Motor Mode Register -------- */ -#define PWM_SMMR_GCEN0 (0x1u << 0) /**< \brief (PWM_SMMR) Gray Count ENable */ -#define PWM_SMMR_GCEN1 (0x1u << 1) /**< \brief (PWM_SMMR) Gray Count ENable */ -#define PWM_SMMR_DOWN0 (0x1u << 16) /**< \brief (PWM_SMMR) DOWN Count */ -#define PWM_SMMR_DOWN1 (0x1u << 17) /**< \brief (PWM_SMMR) DOWN Count */ -/* -------- PWM_FPV2 : (PWM Offset: 0xC0) PWM Fault Protection Value 2 Register -------- */ -#define PWM_FPV2_FPZH0 (0x1u << 0) /**< \brief (PWM_FPV2) Fault Protection to Hi-Z for PWMH output on channel 0 */ -#define PWM_FPV2_FPZH1 (0x1u << 1) /**< \brief (PWM_FPV2) Fault Protection to Hi-Z for PWMH output on channel 1 */ -#define PWM_FPV2_FPZH2 (0x1u << 2) /**< \brief (PWM_FPV2) Fault Protection to Hi-Z for PWMH output on channel 2 */ -#define PWM_FPV2_FPZH3 (0x1u << 3) /**< \brief (PWM_FPV2) Fault Protection to Hi-Z for PWMH output on channel 3 */ -#define PWM_FPV2_FPZL0 (0x1u << 16) /**< \brief (PWM_FPV2) Fault Protection to Hi-Z for PWML output on channel 0 */ -#define PWM_FPV2_FPZL1 (0x1u << 17) /**< \brief (PWM_FPV2) Fault Protection to Hi-Z for PWML output on channel 1 */ -#define PWM_FPV2_FPZL2 (0x1u << 18) /**< \brief (PWM_FPV2) Fault Protection to Hi-Z for PWML output on channel 2 */ -#define PWM_FPV2_FPZL3 (0x1u << 19) /**< \brief (PWM_FPV2) Fault Protection to Hi-Z for PWML output on channel 3 */ -/* -------- PWM_WPCR : (PWM Offset: 0xE4) PWM Write Protection Control Register -------- */ -#define PWM_WPCR_WPCMD_Pos 0 -#define PWM_WPCR_WPCMD_Msk (0x3u << PWM_WPCR_WPCMD_Pos) /**< \brief (PWM_WPCR) Write Protection Command */ -#define PWM_WPCR_WPCMD(value) ((PWM_WPCR_WPCMD_Msk & ((value) << PWM_WPCR_WPCMD_Pos))) -#define PWM_WPCR_WPCMD_DISABLE_SW_PROT (0x0u << 0) /**< \brief (PWM_WPCR) Disables the software write protection of the register groups of which the bit WPRGx is at '1'. */ -#define PWM_WPCR_WPCMD_ENABLE_SW_PROT (0x1u << 0) /**< \brief (PWM_WPCR) Enables the software write protection of the register groups of which the bit WPRGx is at '1'. */ -#define PWM_WPCR_WPCMD_ENABLE_HW_PROT (0x2u << 0) /**< \brief (PWM_WPCR) Enables the hardware write protection of the register groups of which the bit WPRGx is at '1'. Only a hardware reset of the PWM controller can disable the hardware write protection. Moreover, to meet security requirements, the PIO lines associated with the PWM can not be configured through the PIO interface. */ -#define PWM_WPCR_WPRG0 (0x1u << 2) /**< \brief (PWM_WPCR) Write Protection Register Group 0 */ -#define PWM_WPCR_WPRG1 (0x1u << 3) /**< \brief (PWM_WPCR) Write Protection Register Group 1 */ -#define PWM_WPCR_WPRG2 (0x1u << 4) /**< \brief (PWM_WPCR) Write Protection Register Group 2 */ -#define PWM_WPCR_WPRG3 (0x1u << 5) /**< \brief (PWM_WPCR) Write Protection Register Group 3 */ -#define PWM_WPCR_WPRG4 (0x1u << 6) /**< \brief (PWM_WPCR) Write Protection Register Group 4 */ -#define PWM_WPCR_WPRG5 (0x1u << 7) /**< \brief (PWM_WPCR) Write Protection Register Group 5 */ -#define PWM_WPCR_WPKEY_Pos 8 -#define PWM_WPCR_WPKEY_Msk (0xffffffu << PWM_WPCR_WPKEY_Pos) /**< \brief (PWM_WPCR) Write Protection Key */ -#define PWM_WPCR_WPKEY(value) ((PWM_WPCR_WPKEY_Msk & ((value) << PWM_WPCR_WPKEY_Pos))) -#define PWM_WPCR_WPKEY_PASSWD (0x50574Du << 8) /**< \brief (PWM_WPCR) Writing any other value in this field aborts the write operation of the WPCMD field.Always reads as 0 */ -/* -------- PWM_WPSR : (PWM Offset: 0xE8) PWM Write Protection Status Register -------- */ -#define PWM_WPSR_WPSWS0 (0x1u << 0) /**< \brief (PWM_WPSR) Write Protect SW Status */ -#define PWM_WPSR_WPSWS1 (0x1u << 1) /**< \brief (PWM_WPSR) Write Protect SW Status */ -#define PWM_WPSR_WPSWS2 (0x1u << 2) /**< \brief (PWM_WPSR) Write Protect SW Status */ -#define PWM_WPSR_WPSWS3 (0x1u << 3) /**< \brief (PWM_WPSR) Write Protect SW Status */ -#define PWM_WPSR_WPSWS4 (0x1u << 4) /**< \brief (PWM_WPSR) Write Protect SW Status */ -#define PWM_WPSR_WPSWS5 (0x1u << 5) /**< \brief (PWM_WPSR) Write Protect SW Status */ -#define PWM_WPSR_WPVS (0x1u << 7) /**< \brief (PWM_WPSR) Write Protect Violation Status */ -#define PWM_WPSR_WPHWS0 (0x1u << 8) /**< \brief (PWM_WPSR) Write Protect HW Status */ -#define PWM_WPSR_WPHWS1 (0x1u << 9) /**< \brief (PWM_WPSR) Write Protect HW Status */ -#define PWM_WPSR_WPHWS2 (0x1u << 10) /**< \brief (PWM_WPSR) Write Protect HW Status */ -#define PWM_WPSR_WPHWS3 (0x1u << 11) /**< \brief (PWM_WPSR) Write Protect HW Status */ -#define PWM_WPSR_WPHWS4 (0x1u << 12) /**< \brief (PWM_WPSR) Write Protect HW Status */ -#define PWM_WPSR_WPHWS5 (0x1u << 13) /**< \brief (PWM_WPSR) Write Protect HW Status */ -#define PWM_WPSR_WPVSRC_Pos 16 -#define PWM_WPSR_WPVSRC_Msk (0xffffu << PWM_WPSR_WPVSRC_Pos) /**< \brief (PWM_WPSR) Write Protect Violation Source */ -/* -------- PWM_CMPV : (PWM Offset: N/A) PWM Comparison 0 Value Register -------- */ -#define PWM_CMPV_CV_Pos 0 -#define PWM_CMPV_CV_Msk (0xffffffu << PWM_CMPV_CV_Pos) /**< \brief (PWM_CMPV) Comparison x Value */ -#define PWM_CMPV_CV(value) ((PWM_CMPV_CV_Msk & ((value) << PWM_CMPV_CV_Pos))) -#define PWM_CMPV_CVM (0x1u << 24) /**< \brief (PWM_CMPV) Comparison x Value Mode */ -/* -------- PWM_CMPVUPD : (PWM Offset: N/A) PWM Comparison 0 Value Update Register -------- */ -#define PWM_CMPVUPD_CVUPD_Pos 0 -#define PWM_CMPVUPD_CVUPD_Msk (0xffffffu << PWM_CMPVUPD_CVUPD_Pos) /**< \brief (PWM_CMPVUPD) Comparison x Value Update */ -#define PWM_CMPVUPD_CVUPD(value) ((PWM_CMPVUPD_CVUPD_Msk & ((value) << PWM_CMPVUPD_CVUPD_Pos))) -#define PWM_CMPVUPD_CVMUPD (0x1u << 24) /**< \brief (PWM_CMPVUPD) Comparison x Value Mode Update */ -/* -------- PWM_CMPM : (PWM Offset: N/A) PWM Comparison 0 Mode Register -------- */ -#define PWM_CMPM_CEN (0x1u << 0) /**< \brief (PWM_CMPM) Comparison x Enable */ -#define PWM_CMPM_CTR_Pos 4 -#define PWM_CMPM_CTR_Msk (0xfu << PWM_CMPM_CTR_Pos) /**< \brief (PWM_CMPM) Comparison x Trigger */ -#define PWM_CMPM_CTR(value) ((PWM_CMPM_CTR_Msk & ((value) << PWM_CMPM_CTR_Pos))) -#define PWM_CMPM_CPR_Pos 8 -#define PWM_CMPM_CPR_Msk (0xfu << PWM_CMPM_CPR_Pos) /**< \brief (PWM_CMPM) Comparison x Period */ -#define PWM_CMPM_CPR(value) ((PWM_CMPM_CPR_Msk & ((value) << PWM_CMPM_CPR_Pos))) -#define PWM_CMPM_CPRCNT_Pos 12 -#define PWM_CMPM_CPRCNT_Msk (0xfu << PWM_CMPM_CPRCNT_Pos) /**< \brief (PWM_CMPM) Comparison x Period Counter */ -#define PWM_CMPM_CPRCNT(value) ((PWM_CMPM_CPRCNT_Msk & ((value) << PWM_CMPM_CPRCNT_Pos))) -#define PWM_CMPM_CUPR_Pos 16 -#define PWM_CMPM_CUPR_Msk (0xfu << PWM_CMPM_CUPR_Pos) /**< \brief (PWM_CMPM) Comparison x Update Period */ -#define PWM_CMPM_CUPR(value) ((PWM_CMPM_CUPR_Msk & ((value) << PWM_CMPM_CUPR_Pos))) -#define PWM_CMPM_CUPRCNT_Pos 20 -#define PWM_CMPM_CUPRCNT_Msk (0xfu << PWM_CMPM_CUPRCNT_Pos) /**< \brief (PWM_CMPM) Comparison x Update Period Counter */ -#define PWM_CMPM_CUPRCNT(value) ((PWM_CMPM_CUPRCNT_Msk & ((value) << PWM_CMPM_CUPRCNT_Pos))) -/* -------- PWM_CMPMUPD : (PWM Offset: N/A) PWM Comparison 0 Mode Update Register -------- */ -#define PWM_CMPMUPD_CENUPD (0x1u << 0) /**< \brief (PWM_CMPMUPD) Comparison x Enable Update */ -#define PWM_CMPMUPD_CTRUPD_Pos 4 -#define PWM_CMPMUPD_CTRUPD_Msk (0xfu << PWM_CMPMUPD_CTRUPD_Pos) /**< \brief (PWM_CMPMUPD) Comparison x Trigger Update */ -#define PWM_CMPMUPD_CTRUPD(value) ((PWM_CMPMUPD_CTRUPD_Msk & ((value) << PWM_CMPMUPD_CTRUPD_Pos))) -#define PWM_CMPMUPD_CPRUPD_Pos 8 -#define PWM_CMPMUPD_CPRUPD_Msk (0xfu << PWM_CMPMUPD_CPRUPD_Pos) /**< \brief (PWM_CMPMUPD) Comparison x Period Update */ -#define PWM_CMPMUPD_CPRUPD(value) ((PWM_CMPMUPD_CPRUPD_Msk & ((value) << PWM_CMPMUPD_CPRUPD_Pos))) -#define PWM_CMPMUPD_CUPRUPD_Pos 16 -#define PWM_CMPMUPD_CUPRUPD_Msk (0xfu << PWM_CMPMUPD_CUPRUPD_Pos) /**< \brief (PWM_CMPMUPD) Comparison x Update Period Update */ -#define PWM_CMPMUPD_CUPRUPD(value) ((PWM_CMPMUPD_CUPRUPD_Msk & ((value) << PWM_CMPMUPD_CUPRUPD_Pos))) -/* -------- PWM_CMR : (PWM Offset: N/A) PWM Channel Mode Register -------- */ -#define PWM_CMR_CPRE_Pos 0 -#define PWM_CMR_CPRE_Msk (0xfu << PWM_CMR_CPRE_Pos) /**< \brief (PWM_CMR) Channel Pre-scaler */ -#define PWM_CMR_CPRE(value) ((PWM_CMR_CPRE_Msk & ((value) << PWM_CMR_CPRE_Pos))) -#define PWM_CMR_CPRE_MCK (0x0u << 0) /**< \brief (PWM_CMR) Peripheral clock */ -#define PWM_CMR_CPRE_MCK_DIV_2 (0x1u << 0) /**< \brief (PWM_CMR) Peripheral clock/2 */ -#define PWM_CMR_CPRE_MCK_DIV_4 (0x2u << 0) /**< \brief (PWM_CMR) Peripheral clock/4 */ -#define PWM_CMR_CPRE_MCK_DIV_8 (0x3u << 0) /**< \brief (PWM_CMR) Peripheral clock/8 */ -#define PWM_CMR_CPRE_MCK_DIV_16 (0x4u << 0) /**< \brief (PWM_CMR) Peripheral clock/16 */ -#define PWM_CMR_CPRE_MCK_DIV_32 (0x5u << 0) /**< \brief (PWM_CMR) Peripheral clock/32 */ -#define PWM_CMR_CPRE_MCK_DIV_64 (0x6u << 0) /**< \brief (PWM_CMR) Peripheral clock/64 */ -#define PWM_CMR_CPRE_MCK_DIV_128 (0x7u << 0) /**< \brief (PWM_CMR) Peripheral clock/128 */ -#define PWM_CMR_CPRE_MCK_DIV_256 (0x8u << 0) /**< \brief (PWM_CMR) Peripheral clock/256 */ -#define PWM_CMR_CPRE_MCK_DIV_512 (0x9u << 0) /**< \brief (PWM_CMR) Peripheral clock/512 */ -#define PWM_CMR_CPRE_MCK_DIV_1024 (0xAu << 0) /**< \brief (PWM_CMR) Peripheral clock/1024 */ -#define PWM_CMR_CPRE_CLKA (0xBu << 0) /**< \brief (PWM_CMR) Clock A */ -#define PWM_CMR_CPRE_CLKB (0xCu << 0) /**< \brief (PWM_CMR) Clock B */ -#define PWM_CMR_CALG (0x1u << 8) /**< \brief (PWM_CMR) Channel Alignment */ -#define PWM_CMR_CPOL (0x1u << 9) /**< \brief (PWM_CMR) Channel Polarity */ -#define PWM_CMR_CES (0x1u << 10) /**< \brief (PWM_CMR) Counter Event Selection */ -#define PWM_CMR_UPDS (0x1u << 11) /**< \brief (PWM_CMR) Update Selection */ -#define PWM_CMR_DPOLI (0x1u << 12) /**< \brief (PWM_CMR) Disabled Polarity Inverted */ -#define PWM_CMR_TCTS (0x1u << 13) /**< \brief (PWM_CMR) Timer Counter Trigger Selection */ -#define PWM_CMR_DTE (0x1u << 16) /**< \brief (PWM_CMR) Dead-Time Generator Enable */ -#define PWM_CMR_DTHI (0x1u << 17) /**< \brief (PWM_CMR) Dead-Time PWMHx Output Inverted */ -#define PWM_CMR_DTLI (0x1u << 18) /**< \brief (PWM_CMR) Dead-Time PWMLx Output Inverted */ -#define PWM_CMR_PPM (0x1u << 19) /**< \brief (PWM_CMR) Push-Pull Mode */ -/* -------- PWM_CDTY : (PWM Offset: N/A) PWM Channel Duty Cycle Register -------- */ -#define PWM_CDTY_CDTY_Pos 0 -#define PWM_CDTY_CDTY_Msk (0xffffffu << PWM_CDTY_CDTY_Pos) /**< \brief (PWM_CDTY) Channel Duty-Cycle */ -#define PWM_CDTY_CDTY(value) ((PWM_CDTY_CDTY_Msk & ((value) << PWM_CDTY_CDTY_Pos))) -/* -------- PWM_CDTYUPD : (PWM Offset: N/A) PWM Channel Duty Cycle Update Register -------- */ -#define PWM_CDTYUPD_CDTYUPD_Pos 0 -#define PWM_CDTYUPD_CDTYUPD_Msk (0xffffffu << PWM_CDTYUPD_CDTYUPD_Pos) /**< \brief (PWM_CDTYUPD) Channel Duty-Cycle Update */ -#define PWM_CDTYUPD_CDTYUPD(value) ((PWM_CDTYUPD_CDTYUPD_Msk & ((value) << PWM_CDTYUPD_CDTYUPD_Pos))) -/* -------- PWM_CPRD : (PWM Offset: N/A) PWM Channel Period Register -------- */ -#define PWM_CPRD_CPRD_Pos 0 -#define PWM_CPRD_CPRD_Msk (0xffffffu << PWM_CPRD_CPRD_Pos) /**< \brief (PWM_CPRD) Channel Period */ -#define PWM_CPRD_CPRD(value) ((PWM_CPRD_CPRD_Msk & ((value) << PWM_CPRD_CPRD_Pos))) -/* -------- PWM_CPRDUPD : (PWM Offset: N/A) PWM Channel Period Update Register -------- */ -#define PWM_CPRDUPD_CPRDUPD_Pos 0 -#define PWM_CPRDUPD_CPRDUPD_Msk (0xffffffu << PWM_CPRDUPD_CPRDUPD_Pos) /**< \brief (PWM_CPRDUPD) Channel Period Update */ -#define PWM_CPRDUPD_CPRDUPD(value) ((PWM_CPRDUPD_CPRDUPD_Msk & ((value) << PWM_CPRDUPD_CPRDUPD_Pos))) -/* -------- PWM_CCNT : (PWM Offset: N/A) PWM Channel Counter Register -------- */ -#define PWM_CCNT_CNT_Pos 0 -#define PWM_CCNT_CNT_Msk (0xffffffu << PWM_CCNT_CNT_Pos) /**< \brief (PWM_CCNT) Channel Counter Register */ -/* -------- PWM_DT : (PWM Offset: N/A) PWM Channel Dead Time Register -------- */ -#define PWM_DT_DTH_Pos 0 -#define PWM_DT_DTH_Msk (0xffffu << PWM_DT_DTH_Pos) /**< \brief (PWM_DT) Dead-Time Value for PWMHx Output */ -#define PWM_DT_DTH(value) ((PWM_DT_DTH_Msk & ((value) << PWM_DT_DTH_Pos))) -#define PWM_DT_DTL_Pos 16 -#define PWM_DT_DTL_Msk (0xffffu << PWM_DT_DTL_Pos) /**< \brief (PWM_DT) Dead-Time Value for PWMLx Output */ -#define PWM_DT_DTL(value) ((PWM_DT_DTL_Msk & ((value) << PWM_DT_DTL_Pos))) -/* -------- PWM_DTUPD : (PWM Offset: N/A) PWM Channel Dead Time Update Register -------- */ -#define PWM_DTUPD_DTHUPD_Pos 0 -#define PWM_DTUPD_DTHUPD_Msk (0xffffu << PWM_DTUPD_DTHUPD_Pos) /**< \brief (PWM_DTUPD) Dead-Time Value Update for PWMHx Output */ -#define PWM_DTUPD_DTHUPD(value) ((PWM_DTUPD_DTHUPD_Msk & ((value) << PWM_DTUPD_DTHUPD_Pos))) -#define PWM_DTUPD_DTLUPD_Pos 16 -#define PWM_DTUPD_DTLUPD_Msk (0xffffu << PWM_DTUPD_DTLUPD_Pos) /**< \brief (PWM_DTUPD) Dead-Time Value Update for PWMLx Output */ -#define PWM_DTUPD_DTLUPD(value) ((PWM_DTUPD_DTLUPD_Msk & ((value) << PWM_DTUPD_DTLUPD_Pos))) -/* -------- PWM_CMUPD0 : (PWM Offset: 0x400) PWM Channel Mode Update Register (ch_num = 0) -------- */ -#define PWM_CMUPD0_CPOLUP (0x1u << 9) /**< \brief (PWM_CMUPD0) Channel Polarity Update */ -#define PWM_CMUPD0_CPOLINVUP (0x1u << 13) /**< \brief (PWM_CMUPD0) Channel Polarity Inversion Update */ -/* -------- PWM_CMUPD1 : (PWM Offset: 0x420) PWM Channel Mode Update Register (ch_num = 1) -------- */ -#define PWM_CMUPD1_CPOLUP (0x1u << 9) /**< \brief (PWM_CMUPD1) Channel Polarity Update */ -#define PWM_CMUPD1_CPOLINVUP (0x1u << 13) /**< \brief (PWM_CMUPD1) Channel Polarity Inversion Update */ -/* -------- PWM_ETRG1 : (PWM Offset: 0x42C) PWM External Trigger Register (trg_num = 1) -------- */ -#define PWM_ETRG1_MAXCNT_Pos 0 -#define PWM_ETRG1_MAXCNT_Msk (0xffffffu << PWM_ETRG1_MAXCNT_Pos) /**< \brief (PWM_ETRG1) Maximum Counter value */ -#define PWM_ETRG1_MAXCNT(value) ((PWM_ETRG1_MAXCNT_Msk & ((value) << PWM_ETRG1_MAXCNT_Pos))) -#define PWM_ETRG1_TRGMODE_Pos 24 -#define PWM_ETRG1_TRGMODE_Msk (0x3u << PWM_ETRG1_TRGMODE_Pos) /**< \brief (PWM_ETRG1) External Trigger Mode */ -#define PWM_ETRG1_TRGMODE(value) ((PWM_ETRG1_TRGMODE_Msk & ((value) << PWM_ETRG1_TRGMODE_Pos))) -#define PWM_ETRG1_TRGMODE_OFF (0x0u << 24) /**< \brief (PWM_ETRG1) External trigger is not enabled. */ -#define PWM_ETRG1_TRGMODE_MODE1 (0x1u << 24) /**< \brief (PWM_ETRG1) External PWM Reset Mode */ -#define PWM_ETRG1_TRGMODE_MODE2 (0x2u << 24) /**< \brief (PWM_ETRG1) External PWM Start Mode */ -#define PWM_ETRG1_TRGMODE_MODE3 (0x3u << 24) /**< \brief (PWM_ETRG1) Cycle-by-cycle Duty Mode */ -#define PWM_ETRG1_TRGEDGE (0x1u << 28) /**< \brief (PWM_ETRG1) Edge Selection */ -#define PWM_ETRG1_TRGEDGE_FALLING_ZERO (0x0u << 28) /**< \brief (PWM_ETRG1) TRGMODE = 1: TRGINx event detection on falling edge.TRGMODE = 2, 3: TRGINx active level is 0 */ -#define PWM_ETRG1_TRGEDGE_RISING_ONE (0x1u << 28) /**< \brief (PWM_ETRG1) TRGMODE = 1: TRGINx event detection on rising edge.TRGMODE = 2, 3: TRGINx active level is 1 */ -#define PWM_ETRG1_TRGFILT (0x1u << 29) /**< \brief (PWM_ETRG1) Filtered input */ -#define PWM_ETRG1_TRGSRC (0x1u << 30) /**< \brief (PWM_ETRG1) Trigger Source */ -#define PWM_ETRG1_RFEN (0x1u << 31) /**< \brief (PWM_ETRG1) Recoverable Fault Enable */ -/* -------- PWM_LEBR1 : (PWM Offset: 0x430) PWM Leading-Edge Blanking Register (trg_num = 1) -------- */ -#define PWM_LEBR1_LEBDELAY_Pos 0 -#define PWM_LEBR1_LEBDELAY_Msk (0x7fu << PWM_LEBR1_LEBDELAY_Pos) /**< \brief (PWM_LEBR1) Leading-Edge Blanking Delay for TRGINx */ -#define PWM_LEBR1_LEBDELAY(value) ((PWM_LEBR1_LEBDELAY_Msk & ((value) << PWM_LEBR1_LEBDELAY_Pos))) -#define PWM_LEBR1_PWMLFEN (0x1u << 16) /**< \brief (PWM_LEBR1) PWML Falling Edge Enable */ -#define PWM_LEBR1_PWMLREN (0x1u << 17) /**< \brief (PWM_LEBR1) PWML Rising Edge Enable */ -#define PWM_LEBR1_PWMHFEN (0x1u << 18) /**< \brief (PWM_LEBR1) PWMH Falling Edge Enable */ -#define PWM_LEBR1_PWMHREN (0x1u << 19) /**< \brief (PWM_LEBR1) PWMH Rising Edge Enable */ -/* -------- PWM_CMUPD2 : (PWM Offset: 0x440) PWM Channel Mode Update Register (ch_num = 2) -------- */ -#define PWM_CMUPD2_CPOLUP (0x1u << 9) /**< \brief (PWM_CMUPD2) Channel Polarity Update */ -#define PWM_CMUPD2_CPOLINVUP (0x1u << 13) /**< \brief (PWM_CMUPD2) Channel Polarity Inversion Update */ -/* -------- PWM_ETRG2 : (PWM Offset: 0x44C) PWM External Trigger Register (trg_num = 2) -------- */ -#define PWM_ETRG2_MAXCNT_Pos 0 -#define PWM_ETRG2_MAXCNT_Msk (0xffffffu << PWM_ETRG2_MAXCNT_Pos) /**< \brief (PWM_ETRG2) Maximum Counter value */ -#define PWM_ETRG2_MAXCNT(value) ((PWM_ETRG2_MAXCNT_Msk & ((value) << PWM_ETRG2_MAXCNT_Pos))) -#define PWM_ETRG2_TRGMODE_Pos 24 -#define PWM_ETRG2_TRGMODE_Msk (0x3u << PWM_ETRG2_TRGMODE_Pos) /**< \brief (PWM_ETRG2) External Trigger Mode */ -#define PWM_ETRG2_TRGMODE(value) ((PWM_ETRG2_TRGMODE_Msk & ((value) << PWM_ETRG2_TRGMODE_Pos))) -#define PWM_ETRG2_TRGMODE_OFF (0x0u << 24) /**< \brief (PWM_ETRG2) External trigger is not enabled. */ -#define PWM_ETRG2_TRGMODE_MODE1 (0x1u << 24) /**< \brief (PWM_ETRG2) External PWM Reset Mode */ -#define PWM_ETRG2_TRGMODE_MODE2 (0x2u << 24) /**< \brief (PWM_ETRG2) External PWM Start Mode */ -#define PWM_ETRG2_TRGMODE_MODE3 (0x3u << 24) /**< \brief (PWM_ETRG2) Cycle-by-cycle Duty Mode */ -#define PWM_ETRG2_TRGEDGE (0x1u << 28) /**< \brief (PWM_ETRG2) Edge Selection */ -#define PWM_ETRG2_TRGEDGE_FALLING_ZERO (0x0u << 28) /**< \brief (PWM_ETRG2) TRGMODE = 1: TRGINx event detection on falling edge.TRGMODE = 2, 3: TRGINx active level is 0 */ -#define PWM_ETRG2_TRGEDGE_RISING_ONE (0x1u << 28) /**< \brief (PWM_ETRG2) TRGMODE = 1: TRGINx event detection on rising edge.TRGMODE = 2, 3: TRGINx active level is 1 */ -#define PWM_ETRG2_TRGFILT (0x1u << 29) /**< \brief (PWM_ETRG2) Filtered input */ -#define PWM_ETRG2_TRGSRC (0x1u << 30) /**< \brief (PWM_ETRG2) Trigger Source */ -#define PWM_ETRG2_RFEN (0x1u << 31) /**< \brief (PWM_ETRG2) Recoverable Fault Enable */ -/* -------- PWM_LEBR2 : (PWM Offset: 0x450) PWM Leading-Edge Blanking Register (trg_num = 2) -------- */ -#define PWM_LEBR2_LEBDELAY_Pos 0 -#define PWM_LEBR2_LEBDELAY_Msk (0x7fu << PWM_LEBR2_LEBDELAY_Pos) /**< \brief (PWM_LEBR2) Leading-Edge Blanking Delay for TRGINx */ -#define PWM_LEBR2_LEBDELAY(value) ((PWM_LEBR2_LEBDELAY_Msk & ((value) << PWM_LEBR2_LEBDELAY_Pos))) -#define PWM_LEBR2_PWMLFEN (0x1u << 16) /**< \brief (PWM_LEBR2) PWML Falling Edge Enable */ -#define PWM_LEBR2_PWMLREN (0x1u << 17) /**< \brief (PWM_LEBR2) PWML Rising Edge Enable */ -#define PWM_LEBR2_PWMHFEN (0x1u << 18) /**< \brief (PWM_LEBR2) PWMH Falling Edge Enable */ -#define PWM_LEBR2_PWMHREN (0x1u << 19) /**< \brief (PWM_LEBR2) PWMH Rising Edge Enable */ -/* -------- PWM_CMUPD3 : (PWM Offset: 0x460) PWM Channel Mode Update Register (ch_num = 3) -------- */ -#define PWM_CMUPD3_CPOLUP (0x1u << 9) /**< \brief (PWM_CMUPD3) Channel Polarity Update */ -#define PWM_CMUPD3_CPOLINVUP (0x1u << 13) /**< \brief (PWM_CMUPD3) Channel Polarity Inversion Update */ -/* -------- PWM_ETRG3 : (PWM Offset: 0x46C) PWM External Trigger Register (trg_num = 3) -------- */ -#define PWM_ETRG3_MAXCNT_Pos 0 -#define PWM_ETRG3_MAXCNT_Msk (0xffffffu << PWM_ETRG3_MAXCNT_Pos) /**< \brief (PWM_ETRG3) Maximum Counter value */ -#define PWM_ETRG3_MAXCNT(value) ((PWM_ETRG3_MAXCNT_Msk & ((value) << PWM_ETRG3_MAXCNT_Pos))) -#define PWM_ETRG3_TRGMODE_Pos 24 -#define PWM_ETRG3_TRGMODE_Msk (0x3u << PWM_ETRG3_TRGMODE_Pos) /**< \brief (PWM_ETRG3) External Trigger Mode */ -#define PWM_ETRG3_TRGMODE(value) ((PWM_ETRG3_TRGMODE_Msk & ((value) << PWM_ETRG3_TRGMODE_Pos))) -#define PWM_ETRG3_TRGMODE_OFF (0x0u << 24) /**< \brief (PWM_ETRG3) External trigger is not enabled. */ -#define PWM_ETRG3_TRGMODE_MODE1 (0x1u << 24) /**< \brief (PWM_ETRG3) External PWM Reset Mode */ -#define PWM_ETRG3_TRGMODE_MODE2 (0x2u << 24) /**< \brief (PWM_ETRG3) External PWM Start Mode */ -#define PWM_ETRG3_TRGMODE_MODE3 (0x3u << 24) /**< \brief (PWM_ETRG3) Cycle-by-cycle Duty Mode */ -#define PWM_ETRG3_TRGEDGE (0x1u << 28) /**< \brief (PWM_ETRG3) Edge Selection */ -#define PWM_ETRG3_TRGEDGE_FALLING_ZERO (0x0u << 28) /**< \brief (PWM_ETRG3) TRGMODE = 1: TRGINx event detection on falling edge.TRGMODE = 2, 3: TRGINx active level is 0 */ -#define PWM_ETRG3_TRGEDGE_RISING_ONE (0x1u << 28) /**< \brief (PWM_ETRG3) TRGMODE = 1: TRGINx event detection on rising edge.TRGMODE = 2, 3: TRGINx active level is 1 */ -#define PWM_ETRG3_TRGFILT (0x1u << 29) /**< \brief (PWM_ETRG3) Filtered input */ -#define PWM_ETRG3_TRGSRC (0x1u << 30) /**< \brief (PWM_ETRG3) Trigger Source */ -#define PWM_ETRG3_RFEN (0x1u << 31) /**< \brief (PWM_ETRG3) Recoverable Fault Enable */ -/* -------- PWM_LEBR3 : (PWM Offset: 0x470) PWM Leading-Edge Blanking Register (trg_num = 3) -------- */ -#define PWM_LEBR3_LEBDELAY_Pos 0 -#define PWM_LEBR3_LEBDELAY_Msk (0x7fu << PWM_LEBR3_LEBDELAY_Pos) /**< \brief (PWM_LEBR3) Leading-Edge Blanking Delay for TRGINx */ -#define PWM_LEBR3_LEBDELAY(value) ((PWM_LEBR3_LEBDELAY_Msk & ((value) << PWM_LEBR3_LEBDELAY_Pos))) -#define PWM_LEBR3_PWMLFEN (0x1u << 16) /**< \brief (PWM_LEBR3) PWML Falling Edge Enable */ -#define PWM_LEBR3_PWMLREN (0x1u << 17) /**< \brief (PWM_LEBR3) PWML Rising Edge Enable */ -#define PWM_LEBR3_PWMHFEN (0x1u << 18) /**< \brief (PWM_LEBR3) PWMH Falling Edge Enable */ -#define PWM_LEBR3_PWMHREN (0x1u << 19) /**< \brief (PWM_LEBR3) PWMH Rising Edge Enable */ -/* -------- PWM_ETRG4 : (PWM Offset: 0x48C) PWM External Trigger Register (trg_num = 4) -------- */ -#define PWM_ETRG4_MAXCNT_Pos 0 -#define PWM_ETRG4_MAXCNT_Msk (0xffffffu << PWM_ETRG4_MAXCNT_Pos) /**< \brief (PWM_ETRG4) Maximum Counter value */ -#define PWM_ETRG4_MAXCNT(value) ((PWM_ETRG4_MAXCNT_Msk & ((value) << PWM_ETRG4_MAXCNT_Pos))) -#define PWM_ETRG4_TRGMODE_Pos 24 -#define PWM_ETRG4_TRGMODE_Msk (0x3u << PWM_ETRG4_TRGMODE_Pos) /**< \brief (PWM_ETRG4) External Trigger Mode */ -#define PWM_ETRG4_TRGMODE(value) ((PWM_ETRG4_TRGMODE_Msk & ((value) << PWM_ETRG4_TRGMODE_Pos))) -#define PWM_ETRG4_TRGMODE_OFF (0x0u << 24) /**< \brief (PWM_ETRG4) External trigger is not enabled. */ -#define PWM_ETRG4_TRGMODE_MODE1 (0x1u << 24) /**< \brief (PWM_ETRG4) External PWM Reset Mode */ -#define PWM_ETRG4_TRGMODE_MODE2 (0x2u << 24) /**< \brief (PWM_ETRG4) External PWM Start Mode */ -#define PWM_ETRG4_TRGMODE_MODE3 (0x3u << 24) /**< \brief (PWM_ETRG4) Cycle-by-cycle Duty Mode */ -#define PWM_ETRG4_TRGEDGE (0x1u << 28) /**< \brief (PWM_ETRG4) Edge Selection */ -#define PWM_ETRG4_TRGEDGE_FALLING_ZERO (0x0u << 28) /**< \brief (PWM_ETRG4) TRGMODE = 1: TRGINx event detection on falling edge.TRGMODE = 2, 3: TRGINx active level is 0 */ -#define PWM_ETRG4_TRGEDGE_RISING_ONE (0x1u << 28) /**< \brief (PWM_ETRG4) TRGMODE = 1: TRGINx event detection on rising edge.TRGMODE = 2, 3: TRGINx active level is 1 */ -#define PWM_ETRG4_TRGFILT (0x1u << 29) /**< \brief (PWM_ETRG4) Filtered input */ -#define PWM_ETRG4_TRGSRC (0x1u << 30) /**< \brief (PWM_ETRG4) Trigger Source */ -#define PWM_ETRG4_RFEN (0x1u << 31) /**< \brief (PWM_ETRG4) Recoverable Fault Enable */ -/* -------- PWM_LEBR4 : (PWM Offset: 0x490) PWM Leading-Edge Blanking Register (trg_num = 4) -------- */ -#define PWM_LEBR4_LEBDELAY_Pos 0 -#define PWM_LEBR4_LEBDELAY_Msk (0x7fu << PWM_LEBR4_LEBDELAY_Pos) /**< \brief (PWM_LEBR4) Leading-Edge Blanking Delay for TRGINx */ -#define PWM_LEBR4_LEBDELAY(value) ((PWM_LEBR4_LEBDELAY_Msk & ((value) << PWM_LEBR4_LEBDELAY_Pos))) -#define PWM_LEBR4_PWMLFEN (0x1u << 16) /**< \brief (PWM_LEBR4) PWML Falling Edge Enable */ -#define PWM_LEBR4_PWMLREN (0x1u << 17) /**< \brief (PWM_LEBR4) PWML Rising Edge Enable */ -#define PWM_LEBR4_PWMHFEN (0x1u << 18) /**< \brief (PWM_LEBR4) PWMH Falling Edge Enable */ -#define PWM_LEBR4_PWMHREN (0x1u << 19) /**< \brief (PWM_LEBR4) PWMH Rising Edge Enable */ - -/*@}*/ - - -#endif /* _SAMV71_PWM_COMPONENT_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_qspi.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_qspi.h deleted file mode 100644 index 5644fc47..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_qspi.h +++ /dev/null @@ -1,223 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_QSPI_COMPONENT_ -#define _SAMV71_QSPI_COMPONENT_ - -/* ============================================================================= */ -/** SOFTWARE API DEFINITION FOR Quad Serial Peripheral Interface */ -/* ============================================================================= */ -/** \addtogroup SAMV71_QSPI Quad Serial Peripheral Interface */ -/*@{*/ - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -/** \brief Qspi hardware registers */ -typedef struct { - __O uint32_t QSPI_CR; /**< \brief (Qspi Offset: 0x00) Control Register */ - __IO uint32_t QSPI_MR; /**< \brief (Qspi Offset: 0x04) Mode Register */ - __I uint32_t QSPI_RDR; /**< \brief (Qspi Offset: 0x08) Receive Data Register */ - __O uint32_t QSPI_TDR; /**< \brief (Qspi Offset: 0x0C) Transmit Data Register */ - __I uint32_t QSPI_SR; /**< \brief (Qspi Offset: 0x10) Status Register */ - __O uint32_t QSPI_IER; /**< \brief (Qspi Offset: 0x14) Interrupt Enable Register */ - __O uint32_t QSPI_IDR; /**< \brief (Qspi Offset: 0x18) Interrupt Disable Register */ - __I uint32_t QSPI_IMR; /**< \brief (Qspi Offset: 0x1C) Interrupt Mask Register */ - __IO uint32_t QSPI_SCR; /**< \brief (Qspi Offset: 0x20) Serial Clock Register */ - __I uint32_t Reserved1[3]; - __IO uint32_t QSPI_IAR; /**< \brief (Qspi Offset: 0x30) Instruction Address Register */ - __IO uint32_t QSPI_ICR; /**< \brief (Qspi Offset: 0x34) Instruction Code Register */ - __IO uint32_t QSPI_IFR; /**< \brief (Qspi Offset: 0x38) Instruction Frame Register */ - __I uint32_t Reserved2[1]; - __IO uint32_t QSPI_SMR; /**< \brief (Qspi Offset: 0x40) Scrambling Mode Register */ - __O uint32_t QSPI_SKR; /**< \brief (Qspi Offset: 0x44) Scrambling Key Register */ - __I uint32_t Reserved3[39]; - __IO uint32_t QSPI_WPMR; /**< \brief (Qspi Offset: 0xE4) Write Protection Mode Register */ - __I uint32_t QSPI_WPSR; /**< \brief (Qspi Offset: 0xE8) Write Protection Status Register */ -} Qspi; -#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/* -------- QSPI_CR : (QSPI Offset: 0x00) Control Register -------- */ -#define QSPI_CR_QSPIEN (0x1u << 0) /**< \brief (QSPI_CR) QSPI Enable */ -#define QSPI_CR_QSPIDIS (0x1u << 1) /**< \brief (QSPI_CR) QSPI Disable */ -#define QSPI_CR_SWRST (0x1u << 7) /**< \brief (QSPI_CR) QSPI Software Reset */ -#define QSPI_CR_LASTXFER (0x1u << 24) /**< \brief (QSPI_CR) Last Transfer */ -/* -------- QSPI_MR : (QSPI Offset: 0x04) Mode Register -------- */ -#define QSPI_MR_SMM (0x1u << 0) /**< \brief (QSPI_MR) Serial Memory Mode */ -#define QSPI_MR_SMM_SPI (0x0u << 0) /**< \brief (QSPI_MR) The QSPI is in SPI mode. */ -#define QSPI_MR_SMM_MEMORY (0x1u << 0) /**< \brief (QSPI_MR) The QSPI is in Serial Memory mode. */ -#define QSPI_MR_LLB (0x1u << 1) /**< \brief (QSPI_MR) Local Loopback Enable */ -#define QSPI_MR_LLB_DISABLED (0x0u << 1) /**< \brief (QSPI_MR) Local loopback path disabled. */ -#define QSPI_MR_LLB_ENABLED (0x1u << 1) /**< \brief (QSPI_MR) Local loopback path enabled. */ -#define QSPI_MR_WDRBT (0x1u << 2) /**< \brief (QSPI_MR) Wait Data Read Before Transfer */ -#define QSPI_MR_WDRBT_DISABLED (0x0u << 2) /**< \brief (QSPI_MR) No effect. In SPI mode, a transfer can be initiated whatever the state of the QSPI_RDR is. */ -#define QSPI_MR_WDRBT_ENABLED (0x1u << 2) /**< \brief (QSPI_MR) In SPI mode, a transfer can start only if the QSPI_RDR is empty, i.e., does not contain any unread data. This mode prevents overrun error in reception. */ -#define QSPI_MR_CSMODE_Pos 4 -#define QSPI_MR_CSMODE_Msk (0x3u << QSPI_MR_CSMODE_Pos) /**< \brief (QSPI_MR) Chip Select Mode */ -#define QSPI_MR_CSMODE(value) ((QSPI_MR_CSMODE_Msk & ((value) << QSPI_MR_CSMODE_Pos))) -#define QSPI_MR_CSMODE_NOT_RELOADED (0x0u << 4) /**< \brief (QSPI_MR) The chip select is deasserted if TD has not been reloaded before the end of the current transfer. */ -#define QSPI_MR_CSMODE_LASTXFER (0x1u << 4) /**< \brief (QSPI_MR) The chip select is deasserted when the bit LASTXFER is written at 1 and the character written in TD has been transferred. */ -#define QSPI_MR_CSMODE_SYSTEMATICALLY (0x2u << 4) /**< \brief (QSPI_MR) The chip select is deasserted systematically after each transfer. */ -#define QSPI_MR_NBBITS_Pos 8 -#define QSPI_MR_NBBITS_Msk (0xfu << QSPI_MR_NBBITS_Pos) /**< \brief (QSPI_MR) Number Of Bits Per Transfer */ -#define QSPI_MR_NBBITS(value) ((QSPI_MR_NBBITS_Msk & ((value) << QSPI_MR_NBBITS_Pos))) -#define QSPI_MR_NBBITS_8_BIT (0x0u << 8) /**< \brief (QSPI_MR) 8 bits for transfer */ -#define QSPI_MR_NBBITS_9_BIT (0x1u << 8) /**< \brief (QSPI_MR) 9 bits for transfer */ -#define QSPI_MR_NBBITS_10_BIT (0x2u << 8) /**< \brief (QSPI_MR) 10 bits for transfer */ -#define QSPI_MR_NBBITS_11_BIT (0x3u << 8) /**< \brief (QSPI_MR) 11 bits for transfer */ -#define QSPI_MR_NBBITS_12_BIT (0x4u << 8) /**< \brief (QSPI_MR) 12 bits for transfer */ -#define QSPI_MR_NBBITS_13_BIT (0x5u << 8) /**< \brief (QSPI_MR) 13 bits for transfer */ -#define QSPI_MR_NBBITS_14_BIT (0x6u << 8) /**< \brief (QSPI_MR) 14 bits for transfer */ -#define QSPI_MR_NBBITS_15_BIT (0x7u << 8) /**< \brief (QSPI_MR) 15 bits for transfer */ -#define QSPI_MR_NBBITS_16_BIT (0x8u << 8) /**< \brief (QSPI_MR) 16 bits for transfer */ -#define QSPI_MR_DLYBCT_Pos 16 -#define QSPI_MR_DLYBCT_Msk (0xffu << QSPI_MR_DLYBCT_Pos) /**< \brief (QSPI_MR) Delay Between Consecutive Transfers */ -#define QSPI_MR_DLYBCT(value) ((QSPI_MR_DLYBCT_Msk & ((value) << QSPI_MR_DLYBCT_Pos))) -#define QSPI_MR_DLYCS_Pos 24 -#define QSPI_MR_DLYCS_Msk (0xffu << QSPI_MR_DLYCS_Pos) /**< \brief (QSPI_MR) Minimum Inactive QCS Delay */ -#define QSPI_MR_DLYCS(value) ((QSPI_MR_DLYCS_Msk & ((value) << QSPI_MR_DLYCS_Pos))) -/* -------- QSPI_RDR : (QSPI Offset: 0x08) Receive Data Register -------- */ -#define QSPI_RDR_RD_Pos 0 -#define QSPI_RDR_RD_Msk (0xffffu << QSPI_RDR_RD_Pos) /**< \brief (QSPI_RDR) Receive Data */ -/* -------- QSPI_TDR : (QSPI Offset: 0x0C) Transmit Data Register -------- */ -#define QSPI_TDR_TD_Pos 0 -#define QSPI_TDR_TD_Msk (0xffffu << QSPI_TDR_TD_Pos) /**< \brief (QSPI_TDR) Transmit Data */ -#define QSPI_TDR_TD(value) ((QSPI_TDR_TD_Msk & ((value) << QSPI_TDR_TD_Pos))) -/* -------- QSPI_SR : (QSPI Offset: 0x10) Status Register -------- */ -#define QSPI_SR_RDRF (0x1u << 0) /**< \brief (QSPI_SR) Receive Data Register Full */ -#define QSPI_SR_TDRE (0x1u << 1) /**< \brief (QSPI_SR) Transmit Data Register Empty */ -#define QSPI_SR_TXEMPTY (0x1u << 2) /**< \brief (QSPI_SR) Transmission Registers Empty */ -#define QSPI_SR_OVRES (0x1u << 3) /**< \brief (QSPI_SR) Overrun Error Status */ -#define QSPI_SR_CSR (0x1u << 8) /**< \brief (QSPI_SR) Chip Select Rise */ -#define QSPI_SR_CSS (0x1u << 9) /**< \brief (QSPI_SR) Chip Select Status */ -#define QSPI_SR_INSTRE (0x1u << 10) /**< \brief (QSPI_SR) Instruction End Status */ -#define QSPI_SR_QSPIENS (0x1u << 24) /**< \brief (QSPI_SR) QSPI Enable Status */ -/* -------- QSPI_IER : (QSPI Offset: 0x14) Interrupt Enable Register -------- */ -#define QSPI_IER_RDRF (0x1u << 0) /**< \brief (QSPI_IER) Receive Data Register Full Interrupt Enable */ -#define QSPI_IER_TDRE (0x1u << 1) /**< \brief (QSPI_IER) Transmit Data Register Empty Interrupt Enable */ -#define QSPI_IER_TXEMPTY (0x1u << 2) /**< \brief (QSPI_IER) Transmission Registers Empty Enable */ -#define QSPI_IER_OVRES (0x1u << 3) /**< \brief (QSPI_IER) Overrun Error Interrupt Enable */ -#define QSPI_IER_CSR (0x1u << 8) /**< \brief (QSPI_IER) Chip Select Rise Interrupt Enable */ -#define QSPI_IER_CSS (0x1u << 9) /**< \brief (QSPI_IER) Chip Select Status Interrupt Enable */ -#define QSPI_IER_INSTRE (0x1u << 10) /**< \brief (QSPI_IER) Instruction End Interrupt Enable */ -/* -------- QSPI_IDR : (QSPI Offset: 0x18) Interrupt Disable Register -------- */ -#define QSPI_IDR_RDRF (0x1u << 0) /**< \brief (QSPI_IDR) Receive Data Register Full Interrupt Disable */ -#define QSPI_IDR_TDRE (0x1u << 1) /**< \brief (QSPI_IDR) Transmit Data Register Empty Interrupt Disable */ -#define QSPI_IDR_TXEMPTY (0x1u << 2) /**< \brief (QSPI_IDR) Transmission Registers Empty Disable */ -#define QSPI_IDR_OVRES (0x1u << 3) /**< \brief (QSPI_IDR) Overrun Error Interrupt Disable */ -#define QSPI_IDR_CSR (0x1u << 8) /**< \brief (QSPI_IDR) Chip Select Rise Interrupt Disable */ -#define QSPI_IDR_CSS (0x1u << 9) /**< \brief (QSPI_IDR) Chip Select Status Interrupt Disable */ -#define QSPI_IDR_INSTRE (0x1u << 10) /**< \brief (QSPI_IDR) Instruction End Interrupt Disable */ -/* -------- QSPI_IMR : (QSPI Offset: 0x1C) Interrupt Mask Register -------- */ -#define QSPI_IMR_RDRF (0x1u << 0) /**< \brief (QSPI_IMR) Receive Data Register Full Interrupt Mask */ -#define QSPI_IMR_TDRE (0x1u << 1) /**< \brief (QSPI_IMR) Transmit Data Register Empty Interrupt Mask */ -#define QSPI_IMR_TXEMPTY (0x1u << 2) /**< \brief (QSPI_IMR) Transmission Registers Empty Mask */ -#define QSPI_IMR_OVRES (0x1u << 3) /**< \brief (QSPI_IMR) Overrun Error Interrupt Mask */ -#define QSPI_IMR_CSR (0x1u << 8) /**< \brief (QSPI_IMR) Chip Select Rise Interrupt Mask */ -#define QSPI_IMR_CSS (0x1u << 9) /**< \brief (QSPI_IMR) Chip Select Status Interrupt Mask */ -#define QSPI_IMR_INSTRE (0x1u << 10) /**< \brief (QSPI_IMR) Instruction End Interrupt Mask */ -/* -------- QSPI_SCR : (QSPI Offset: 0x20) Serial Clock Register -------- */ -#define QSPI_SCR_CPOL (0x1u << 0) /**< \brief (QSPI_SCR) Clock Polarity */ -#define QSPI_SCR_CPHA (0x1u << 1) /**< \brief (QSPI_SCR) Clock Phase */ -#define QSPI_SCR_SCBR_Pos 8 -#define QSPI_SCR_SCBR_Msk (0xffu << QSPI_SCR_SCBR_Pos) /**< \brief (QSPI_SCR) Serial Clock Baud Rate */ -#define QSPI_SCR_SCBR(value) ((QSPI_SCR_SCBR_Msk & ((value) << QSPI_SCR_SCBR_Pos))) -#define QSPI_SCR_DLYBS_Pos 16 -#define QSPI_SCR_DLYBS_Msk (0xffu << QSPI_SCR_DLYBS_Pos) /**< \brief (QSPI_SCR) Delay Before QSCK */ -#define QSPI_SCR_DLYBS(value) ((QSPI_SCR_DLYBS_Msk & ((value) << QSPI_SCR_DLYBS_Pos))) -/* -------- QSPI_IAR : (QSPI Offset: 0x30) Instruction Address Register -------- */ -#define QSPI_IAR_ADDR_Pos 0 -#define QSPI_IAR_ADDR_Msk (0xffffffffu << QSPI_IAR_ADDR_Pos) /**< \brief (QSPI_IAR) Address */ -#define QSPI_IAR_ADDR(value) ((QSPI_IAR_ADDR_Msk & ((value) << QSPI_IAR_ADDR_Pos))) -/* -------- QSPI_ICR : (QSPI Offset: 0x34) Instruction Code Register -------- */ -#define QSPI_ICR_INST_Pos 0 -#define QSPI_ICR_INST_Msk (0xffu << QSPI_ICR_INST_Pos) /**< \brief (QSPI_ICR) Instruction Code */ -#define QSPI_ICR_INST(value) ((QSPI_ICR_INST_Msk & ((value) << QSPI_ICR_INST_Pos))) -#define QSPI_ICR_OPT_Pos 16 -#define QSPI_ICR_OPT_Msk (0xffu << QSPI_ICR_OPT_Pos) /**< \brief (QSPI_ICR) Option Code */ -#define QSPI_ICR_OPT(value) ((QSPI_ICR_OPT_Msk & ((value) << QSPI_ICR_OPT_Pos))) -/* -------- QSPI_IFR : (QSPI Offset: 0x38) Instruction Frame Register -------- */ -#define QSPI_IFR_WIDTH_Pos 0 -#define QSPI_IFR_WIDTH_Msk (0x7u << QSPI_IFR_WIDTH_Pos) /**< \brief (QSPI_IFR) Width of Instruction Code, Address, Option Code and Data */ -#define QSPI_IFR_WIDTH(value) ((QSPI_IFR_WIDTH_Msk & ((value) << QSPI_IFR_WIDTH_Pos))) -#define QSPI_IFR_WIDTH_SINGLE_BIT_SPI (0x0u << 0) /**< \brief (QSPI_IFR) Instruction: Single-bit SPI / Address-Option: Single-bit SPI / Data: Single-bit SPI */ -#define QSPI_IFR_WIDTH_DUAL_OUTPUT (0x1u << 0) /**< \brief (QSPI_IFR) Instruction: Single-bit SPI / Address-Option: Single-bit SPI / Data: Dual SPI */ -#define QSPI_IFR_WIDTH_QUAD_OUTPUT (0x2u << 0) /**< \brief (QSPI_IFR) Instruction: Single-bit SPI / Address-Option: Single-bit SPI / Data: Quad SPI */ -#define QSPI_IFR_WIDTH_DUAL_IO (0x3u << 0) /**< \brief (QSPI_IFR) Instruction: Single-bit SPI / Address-Option: Dual SPI / Data: Dual SPI */ -#define QSPI_IFR_WIDTH_QUAD_IO (0x4u << 0) /**< \brief (QSPI_IFR) Instruction: Single-bit SPI / Address-Option: Quad SPI / Data: Quad SPI */ -#define QSPI_IFR_WIDTH_DUAL_CMD (0x5u << 0) /**< \brief (QSPI_IFR) Instruction: Dual SPI / Address-Option: Dual SPI / Data: Dual SPI */ -#define QSPI_IFR_WIDTH_QUAD_CMD (0x6u << 0) /**< \brief (QSPI_IFR) Instruction: Quad SPI / Address-Option: Quad SPI / Data: Quad SPI */ -#define QSPI_IFR_INSTEN (0x1u << 4) /**< \brief (QSPI_IFR) Instruction Enable */ -#define QSPI_IFR_ADDREN (0x1u << 5) /**< \brief (QSPI_IFR) Address Enable */ -#define QSPI_IFR_OPTEN (0x1u << 6) /**< \brief (QSPI_IFR) Option Enable */ -#define QSPI_IFR_DATAEN (0x1u << 7) /**< \brief (QSPI_IFR) Data Enable */ -#define QSPI_IFR_OPTL_Pos 8 -#define QSPI_IFR_OPTL_Msk (0x3u << QSPI_IFR_OPTL_Pos) /**< \brief (QSPI_IFR) Option Code Length */ -#define QSPI_IFR_OPTL(value) ((QSPI_IFR_OPTL_Msk & ((value) << QSPI_IFR_OPTL_Pos))) -#define QSPI_IFR_OPTL_OPTION_1BIT (0x0u << 8) /**< \brief (QSPI_IFR) The option code is 1 bit long. */ -#define QSPI_IFR_OPTL_OPTION_2BIT (0x1u << 8) /**< \brief (QSPI_IFR) The option code is 2 bits long. */ -#define QSPI_IFR_OPTL_OPTION_4BIT (0x2u << 8) /**< \brief (QSPI_IFR) The option code is 4 bits long. */ -#define QSPI_IFR_OPTL_OPTION_8BIT (0x3u << 8) /**< \brief (QSPI_IFR) The option code is 8 bits long. */ -#define QSPI_IFR_ADDRL (0x1u << 10) /**< \brief (QSPI_IFR) Address Length */ -#define QSPI_IFR_ADDRL_24_BIT (0x0u << 10) /**< \brief (QSPI_IFR) The address is 24 bits long. */ -#define QSPI_IFR_ADDRL_32_BIT (0x1u << 10) /**< \brief (QSPI_IFR) The address is 32 bits long. */ -#define QSPI_IFR_TFRTYP_Pos 12 -#define QSPI_IFR_TFRTYP_Msk (0x3u << QSPI_IFR_TFRTYP_Pos) /**< \brief (QSPI_IFR) Data Transfer Type */ -#define QSPI_IFR_TFRTYP(value) ((QSPI_IFR_TFRTYP_Msk & ((value) << QSPI_IFR_TFRTYP_Pos))) -#define QSPI_IFR_TFRTYP_TRSFR_READ (0x0u << 12) /**< \brief (QSPI_IFR) Read transfer from the serial memory.Scrambling is not performed.Read at random location (fetch) in the serial Flash memory is not possible. */ -#define QSPI_IFR_TFRTYP_TRSFR_READ_MEMORY (0x1u << 12) /**< \brief (QSPI_IFR) Read data transfer from the serial memory.If enabled, scrambling is performed.Read at random location (fetch) in the serial Flash memory is possible. */ -#define QSPI_IFR_TFRTYP_TRSFR_WRITE (0x2u << 12) /**< \brief (QSPI_IFR) Write transfer into the serial memory.Scrambling is not performed. */ -#define QSPI_IFR_TFRTYP_TRSFR_WRITE_MEMORY (0x3u << 12) /**< \brief (QSPI_IFR) Write data transfer into the serial memory.If enabled, scrambling is performed. */ -#define QSPI_IFR_CRM (0x1u << 14) /**< \brief (QSPI_IFR) Continuous Read Mode */ -#define QSPI_IFR_CRM_DISABLED (0x0u << 14) /**< \brief (QSPI_IFR) The Continuous Read mode is disabled. */ -#define QSPI_IFR_CRM_ENABLED (0x1u << 14) /**< \brief (QSPI_IFR) The Continuous Read mode is enabled. */ -#define QSPI_IFR_NBDUM_Pos 16 -#define QSPI_IFR_NBDUM_Msk (0x1fu << QSPI_IFR_NBDUM_Pos) /**< \brief (QSPI_IFR) Number Of Dummy Cycles */ -#define QSPI_IFR_NBDUM(value) ((QSPI_IFR_NBDUM_Msk & ((value) << QSPI_IFR_NBDUM_Pos))) -/* -------- QSPI_SMR : (QSPI Offset: 0x40) Scrambling Mode Register -------- */ -#define QSPI_SMR_SCREN (0x1u << 0) /**< \brief (QSPI_SMR) Scrambling/Unscrambling Enable */ -#define QSPI_SMR_SCREN_DISABLED (0x0u << 0) /**< \brief (QSPI_SMR) The scrambling/unscrambling is disabled. */ -#define QSPI_SMR_SCREN_ENABLED (0x1u << 0) /**< \brief (QSPI_SMR) The scrambling/unscrambling is enabled. */ -#define QSPI_SMR_RVDIS (0x1u << 1) /**< \brief (QSPI_SMR) Scrambling/Unscrambling Random Value Disable */ -/* -------- QSPI_SKR : (QSPI Offset: 0x44) Scrambling Key Register -------- */ -#define QSPI_SKR_USRK_Pos 0 -#define QSPI_SKR_USRK_Msk (0xffffffffu << QSPI_SKR_USRK_Pos) /**< \brief (QSPI_SKR) Scrambling User Key */ -#define QSPI_SKR_USRK(value) ((QSPI_SKR_USRK_Msk & ((value) << QSPI_SKR_USRK_Pos))) -/* -------- QSPI_WPMR : (QSPI Offset: 0xE4) Write Protection Mode Register -------- */ -#define QSPI_WPMR_WPEN (0x1u << 0) /**< \brief (QSPI_WPMR) Write Protection Enable */ -#define QSPI_WPMR_WPKEY_Pos 8 -#define QSPI_WPMR_WPKEY_Msk (0xffffffu << QSPI_WPMR_WPKEY_Pos) /**< \brief (QSPI_WPMR) Write Protection Key */ -#define QSPI_WPMR_WPKEY(value) ((QSPI_WPMR_WPKEY_Msk & ((value) << QSPI_WPMR_WPKEY_Pos))) -#define QSPI_WPMR_WPKEY_PASSWD (0x515350u << 8) /**< \brief (QSPI_WPMR) Writing any other value in this field aborts the write operation of the WPEN bit. Always reads as 0. */ -/* -------- QSPI_WPSR : (QSPI Offset: 0xE8) Write Protection Status Register -------- */ -#define QSPI_WPSR_WPVS (0x1u << 0) /**< \brief (QSPI_WPSR) Write Protection Violation Status */ -#define QSPI_WPSR_WPVSRC_Pos 8 -#define QSPI_WPSR_WPVSRC_Msk (0xffu << QSPI_WPSR_WPVSRC_Pos) /**< \brief (QSPI_WPSR) Write Protection Violation Source */ - -/*@}*/ - - -#endif /* _SAMV71_QSPI_COMPONENT_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_rstc.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_rstc.h deleted file mode 100644 index 29e113a7..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_rstc.h +++ /dev/null @@ -1,79 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_RSTC_COMPONENT_ -#define _SAMV71_RSTC_COMPONENT_ - -/* ============================================================================= */ -/** SOFTWARE API DEFINITION FOR Reset Controller */ -/* ============================================================================= */ -/** \addtogroup SAMV71_RSTC Reset Controller */ -/*@{*/ - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -/** \brief Rstc hardware registers */ -typedef struct { - __O uint32_t RSTC_CR; /**< \brief (Rstc Offset: 0x00) Control Register */ - __I uint32_t RSTC_SR; /**< \brief (Rstc Offset: 0x04) Status Register */ - __IO uint32_t RSTC_MR; /**< \brief (Rstc Offset: 0x08) Mode Register */ -} Rstc; -#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/* -------- RSTC_CR : (RSTC Offset: 0x00) Control Register -------- */ -#define RSTC_CR_PROCRST (0x1u << 0) /**< \brief (RSTC_CR) Processor Reset */ -#define RSTC_CR_EXTRST (0x1u << 3) /**< \brief (RSTC_CR) External Reset */ -#define RSTC_CR_KEY_Pos 24 -#define RSTC_CR_KEY_Msk (0xffu << RSTC_CR_KEY_Pos) /**< \brief (RSTC_CR) System Reset Key */ -#define RSTC_CR_KEY(value) ((RSTC_CR_KEY_Msk & ((value) << RSTC_CR_KEY_Pos))) -#define RSTC_CR_KEY_PASSWD (0xA5u << 24) /**< \brief (RSTC_CR) Writing any other value in this field aborts the write operation. */ -/* -------- RSTC_SR : (RSTC Offset: 0x04) Status Register -------- */ -#define RSTC_SR_URSTS (0x1u << 0) /**< \brief (RSTC_SR) User Reset Status */ -#define RSTC_SR_RSTTYP_Pos 8 -#define RSTC_SR_RSTTYP_Msk (0x7u << RSTC_SR_RSTTYP_Pos) /**< \brief (RSTC_SR) Reset Type */ -#define RSTC_SR_RSTTYP_GENERAL_RST (0x0u << 8) /**< \brief (RSTC_SR) First power-up reset */ -#define RSTC_SR_RSTTYP_BACKUP_RST (0x1u << 8) /**< \brief (RSTC_SR) Return from Backup Mode */ -#define RSTC_SR_RSTTYP_WDT_RST (0x2u << 8) /**< \brief (RSTC_SR) Watchdog fault occurred */ -#define RSTC_SR_RSTTYP_SOFT_RST (0x3u << 8) /**< \brief (RSTC_SR) Processor reset required by the software */ -#define RSTC_SR_RSTTYP_USER_RST (0x4u << 8) /**< \brief (RSTC_SR) NRST pin detected low */ -#define RSTC_SR_NRSTL (0x1u << 16) /**< \brief (RSTC_SR) NRST Pin Level */ -#define RSTC_SR_SRCMP (0x1u << 17) /**< \brief (RSTC_SR) Software Reset Command in Progress */ -/* -------- RSTC_MR : (RSTC Offset: 0x08) Mode Register -------- */ -#define RSTC_MR_URSTEN (0x1u << 0) /**< \brief (RSTC_MR) User Reset Enable */ -#define RSTC_MR_URSTIEN (0x1u << 4) /**< \brief (RSTC_MR) User Reset Interrupt Enable */ -#define RSTC_MR_ERSTL_Pos 8 -#define RSTC_MR_ERSTL_Msk (0xfu << RSTC_MR_ERSTL_Pos) /**< \brief (RSTC_MR) External Reset Length */ -#define RSTC_MR_ERSTL(value) ((RSTC_MR_ERSTL_Msk & ((value) << RSTC_MR_ERSTL_Pos))) -#define RSTC_MR_KEY_Pos 24 -#define RSTC_MR_KEY_Msk (0xffu << RSTC_MR_KEY_Pos) /**< \brief (RSTC_MR) Write Access Password */ -#define RSTC_MR_KEY(value) ((RSTC_MR_KEY_Msk & ((value) << RSTC_MR_KEY_Pos))) -#define RSTC_MR_KEY_PASSWD (0xA5u << 24) /**< \brief (RSTC_MR) Writing any other value in this field aborts the write operation.Always reads as 0. */ - -/*@}*/ - - -#endif /* _SAMV71_RSTC_COMPONENT_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_rswdt.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_rswdt.h deleted file mode 100644 index c455a0fe..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_rswdt.h +++ /dev/null @@ -1,72 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_RSWDT_COMPONENT_ -#define _SAMV71_RSWDT_COMPONENT_ - -/* ============================================================================= */ -/** SOFTWARE API DEFINITION FOR Reinforced Safety Watchdog Timer */ -/* ============================================================================= */ -/** \addtogroup SAMV71_RSWDT Reinforced Safety Watchdog Timer */ -/*@{*/ - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -/** \brief Rswdt hardware registers */ -typedef struct { - __O uint32_t RSWDT_CR; /**< \brief (Rswdt Offset: 0x00) Control Register */ - __IO uint32_t RSWDT_MR; /**< \brief (Rswdt Offset: 0x04) Mode Register */ - __I uint32_t RSWDT_SR; /**< \brief (Rswdt Offset: 0x08) Status Register */ -} Rswdt; -#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/* -------- RSWDT_CR : (RSWDT Offset: 0x00) Control Register -------- */ -#define RSWDT_CR_WDRSTT (0x1u << 0) /**< \brief (RSWDT_CR) Watchdog Restart */ -#define RSWDT_CR_KEY_Pos 24 -#define RSWDT_CR_KEY_Msk (0xffu << RSWDT_CR_KEY_Pos) /**< \brief (RSWDT_CR) Password */ -#define RSWDT_CR_KEY(value) ((RSWDT_CR_KEY_Msk & ((value) << RSWDT_CR_KEY_Pos))) -#define RSWDT_CR_KEY_PASSWD (0xC4u << 24) /**< \brief (RSWDT_CR) Writing any other value in this field aborts the write operation. */ -/* -------- RSWDT_MR : (RSWDT Offset: 0x04) Mode Register -------- */ -#define RSWDT_MR_WDV_Pos 0 -#define RSWDT_MR_WDV_Msk (0xfffu << RSWDT_MR_WDV_Pos) /**< \brief (RSWDT_MR) Watchdog Counter Value */ -#define RSWDT_MR_WDV(value) ((RSWDT_MR_WDV_Msk & ((value) << RSWDT_MR_WDV_Pos))) -#define RSWDT_MR_WDFIEN (0x1u << 12) /**< \brief (RSWDT_MR) Watchdog Fault Interrupt Enable */ -#define RSWDT_MR_WDRSTEN (0x1u << 13) /**< \brief (RSWDT_MR) Watchdog Reset Enable */ -#define RSWDT_MR_WDRPROC (0x1u << 14) /**< \brief (RSWDT_MR) Watchdog Reset Processor */ -#define RSWDT_MR_WDDIS (0x1u << 15) /**< \brief (RSWDT_MR) Watchdog Disable */ -#define RSWDT_MR_ALLONES_Pos 16 -#define RSWDT_MR_ALLONES_Msk (0xfffu << RSWDT_MR_ALLONES_Pos) /**< \brief (RSWDT_MR) Must Always Be Written with 0xFFF */ -#define RSWDT_MR_ALLONES(value) ((RSWDT_MR_ALLONES_Msk & ((value) << RSWDT_MR_ALLONES_Pos))) -#define RSWDT_MR_WDDBGHLT (0x1u << 28) /**< \brief (RSWDT_MR) Watchdog Debug Halt */ -#define RSWDT_MR_WDIDLEHLT (0x1u << 29) /**< \brief (RSWDT_MR) Watchdog Idle Halt */ -/* -------- RSWDT_SR : (RSWDT Offset: 0x08) Status Register -------- */ -#define RSWDT_SR_WDUNF (0x1u << 0) /**< \brief (RSWDT_SR) Watchdog Underflow */ - -/*@}*/ - - -#endif /* _SAMV71_RSWDT_COMPONENT_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_rtc.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_rtc.h deleted file mode 100644 index ccc26e66..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_rtc.h +++ /dev/null @@ -1,226 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_RTC_COMPONENT_ -#define _SAMV71_RTC_COMPONENT_ - -/* ============================================================================= */ -/** SOFTWARE API DEFINITION FOR Real-time Clock */ -/* ============================================================================= */ -/** \addtogroup SAMV71_RTC Real-time Clock */ -/*@{*/ - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -/** \brief Rtc hardware registers */ -typedef struct { - __IO uint32_t RTC_CR; /**< \brief (Rtc Offset: 0x00) Control Register */ - __IO uint32_t RTC_MR; /**< \brief (Rtc Offset: 0x04) Mode Register */ - __IO uint32_t RTC_TIMR; /**< \brief (Rtc Offset: 0x08) Time Register */ - __IO uint32_t RTC_CALR; /**< \brief (Rtc Offset: 0x0C) Calendar Register */ - __IO uint32_t RTC_TIMALR; /**< \brief (Rtc Offset: 0x10) Time Alarm Register */ - __IO uint32_t RTC_CALALR; /**< \brief (Rtc Offset: 0x14) Calendar Alarm Register */ - __I uint32_t RTC_SR; /**< \brief (Rtc Offset: 0x18) Status Register */ - __O uint32_t RTC_SCCR; /**< \brief (Rtc Offset: 0x1C) Status Clear Command Register */ - __O uint32_t RTC_IER; /**< \brief (Rtc Offset: 0x20) Interrupt Enable Register */ - __O uint32_t RTC_IDR; /**< \brief (Rtc Offset: 0x24) Interrupt Disable Register */ - __I uint32_t RTC_IMR; /**< \brief (Rtc Offset: 0x28) Interrupt Mask Register */ - __I uint32_t RTC_VER; /**< \brief (Rtc Offset: 0x2C) Valid Entry Register */ -} Rtc; -#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/* -------- RTC_CR : (RTC Offset: 0x00) Control Register -------- */ -#define RTC_CR_UPDTIM (0x1u << 0) /**< \brief (RTC_CR) Update Request Time Register */ -#define RTC_CR_UPDCAL (0x1u << 1) /**< \brief (RTC_CR) Update Request Calendar Register */ -#define RTC_CR_TIMEVSEL_Pos 8 -#define RTC_CR_TIMEVSEL_Msk (0x3u << RTC_CR_TIMEVSEL_Pos) /**< \brief (RTC_CR) Time Event Selection */ -#define RTC_CR_TIMEVSEL(value) ((RTC_CR_TIMEVSEL_Msk & ((value) << RTC_CR_TIMEVSEL_Pos))) -#define RTC_CR_TIMEVSEL_MINUTE (0x0u << 8) /**< \brief (RTC_CR) Minute change */ -#define RTC_CR_TIMEVSEL_HOUR (0x1u << 8) /**< \brief (RTC_CR) Hour change */ -#define RTC_CR_TIMEVSEL_MIDNIGHT (0x2u << 8) /**< \brief (RTC_CR) Every day at midnight */ -#define RTC_CR_TIMEVSEL_NOON (0x3u << 8) /**< \brief (RTC_CR) Every day at noon */ -#define RTC_CR_CALEVSEL_Pos 16 -#define RTC_CR_CALEVSEL_Msk (0x3u << RTC_CR_CALEVSEL_Pos) /**< \brief (RTC_CR) Calendar Event Selection */ -#define RTC_CR_CALEVSEL(value) ((RTC_CR_CALEVSEL_Msk & ((value) << RTC_CR_CALEVSEL_Pos))) -#define RTC_CR_CALEVSEL_WEEK (0x0u << 16) /**< \brief (RTC_CR) Week change (every Monday at time 00:00:00) */ -#define RTC_CR_CALEVSEL_MONTH (0x1u << 16) /**< \brief (RTC_CR) Month change (every 01 of each month at time 00:00:00) */ -#define RTC_CR_CALEVSEL_YEAR (0x2u << 16) /**< \brief (RTC_CR) Year change (every January 1 at time 00:00:00) */ -/* -------- RTC_MR : (RTC Offset: 0x04) Mode Register -------- */ -#define RTC_MR_HRMOD (0x1u << 0) /**< \brief (RTC_MR) 12-/24-hour Mode */ -#define RTC_MR_PERSIAN (0x1u << 1) /**< \brief (RTC_MR) PERSIAN Calendar */ -#define RTC_MR_NEGPPM (0x1u << 4) /**< \brief (RTC_MR) NEGative PPM Correction */ -#define RTC_MR_CORRECTION_Pos 8 -#define RTC_MR_CORRECTION_Msk (0x7fu << RTC_MR_CORRECTION_Pos) /**< \brief (RTC_MR) Slow Clock Correction */ -#define RTC_MR_CORRECTION(value) ((RTC_MR_CORRECTION_Msk & ((value) << RTC_MR_CORRECTION_Pos))) -#define RTC_MR_HIGHPPM (0x1u << 15) /**< \brief (RTC_MR) HIGH PPM Correction */ -#define RTC_MR_OUT0_Pos 16 -#define RTC_MR_OUT0_Msk (0x7u << RTC_MR_OUT0_Pos) /**< \brief (RTC_MR) RTCOUT0 OutputSource Selection */ -#define RTC_MR_OUT0(value) ((RTC_MR_OUT0_Msk & ((value) << RTC_MR_OUT0_Pos))) -#define RTC_MR_OUT0_NO_WAVE (0x0u << 16) /**< \brief (RTC_MR) No waveform, stuck at '0' */ -#define RTC_MR_OUT0_FREQ1HZ (0x1u << 16) /**< \brief (RTC_MR) 1 Hz square wave */ -#define RTC_MR_OUT0_FREQ32HZ (0x2u << 16) /**< \brief (RTC_MR) 32 Hz square wave */ -#define RTC_MR_OUT0_FREQ64HZ (0x3u << 16) /**< \brief (RTC_MR) 64 Hz square wave */ -#define RTC_MR_OUT0_FREQ512HZ (0x4u << 16) /**< \brief (RTC_MR) 512 Hz square wave */ -#define RTC_MR_OUT0_ALARM_TOGGLE (0x5u << 16) /**< \brief (RTC_MR) Output toggles when alarm flag rises */ -#define RTC_MR_OUT0_ALARM_FLAG (0x6u << 16) /**< \brief (RTC_MR) Output is a copy of the alarm flag */ -#define RTC_MR_OUT0_PROG_PULSE (0x7u << 16) /**< \brief (RTC_MR) Duty cycle programmable pulse */ -#define RTC_MR_OUT1_Pos 20 -#define RTC_MR_OUT1_Msk (0x7u << RTC_MR_OUT1_Pos) /**< \brief (RTC_MR) RTCOUT1 Output Source Selection */ -#define RTC_MR_OUT1(value) ((RTC_MR_OUT1_Msk & ((value) << RTC_MR_OUT1_Pos))) -#define RTC_MR_OUT1_NO_WAVE (0x0u << 20) /**< \brief (RTC_MR) No waveform, stuck at '0' */ -#define RTC_MR_OUT1_FREQ1HZ (0x1u << 20) /**< \brief (RTC_MR) 1 Hz square wave */ -#define RTC_MR_OUT1_FREQ32HZ (0x2u << 20) /**< \brief (RTC_MR) 32 Hz square wave */ -#define RTC_MR_OUT1_FREQ64HZ (0x3u << 20) /**< \brief (RTC_MR) 64 Hz square wave */ -#define RTC_MR_OUT1_FREQ512HZ (0x4u << 20) /**< \brief (RTC_MR) 512 Hz square wave */ -#define RTC_MR_OUT1_ALARM_TOGGLE (0x5u << 20) /**< \brief (RTC_MR) Output toggles when alarm flag rises */ -#define RTC_MR_OUT1_ALARM_FLAG (0x6u << 20) /**< \brief (RTC_MR) Output is a copy of the alarm flag */ -#define RTC_MR_OUT1_PROG_PULSE (0x7u << 20) /**< \brief (RTC_MR) Duty cycle programmable pulse */ -#define RTC_MR_THIGH_Pos 24 -#define RTC_MR_THIGH_Msk (0x7u << RTC_MR_THIGH_Pos) /**< \brief (RTC_MR) High Duration of the Output Pulse */ -#define RTC_MR_THIGH(value) ((RTC_MR_THIGH_Msk & ((value) << RTC_MR_THIGH_Pos))) -#define RTC_MR_THIGH_H_31MS (0x0u << 24) /**< \brief (RTC_MR) 31.2 ms */ -#define RTC_MR_THIGH_H_16MS (0x1u << 24) /**< \brief (RTC_MR) 15.6 ms */ -#define RTC_MR_THIGH_H_4MS (0x2u << 24) /**< \brief (RTC_MR) 3.91 ms */ -#define RTC_MR_THIGH_H_976US (0x3u << 24) /**< \brief (RTC_MR) 976 us */ -#define RTC_MR_THIGH_H_488US (0x4u << 24) /**< \brief (RTC_MR) 488 us */ -#define RTC_MR_THIGH_H_122US (0x5u << 24) /**< \brief (RTC_MR) 122 us */ -#define RTC_MR_THIGH_H_30US (0x6u << 24) /**< \brief (RTC_MR) 30.5 us */ -#define RTC_MR_THIGH_H_15US (0x7u << 24) /**< \brief (RTC_MR) 15.2 us */ -#define RTC_MR_TPERIOD_Pos 28 -#define RTC_MR_TPERIOD_Msk (0x3u << RTC_MR_TPERIOD_Pos) /**< \brief (RTC_MR) Period of the Output Pulse */ -#define RTC_MR_TPERIOD(value) ((RTC_MR_TPERIOD_Msk & ((value) << RTC_MR_TPERIOD_Pos))) -#define RTC_MR_TPERIOD_P_1S (0x0u << 28) /**< \brief (RTC_MR) 1 second */ -#define RTC_MR_TPERIOD_P_500MS (0x1u << 28) /**< \brief (RTC_MR) 500 ms */ -#define RTC_MR_TPERIOD_P_250MS (0x2u << 28) /**< \brief (RTC_MR) 250 ms */ -#define RTC_MR_TPERIOD_P_125MS (0x3u << 28) /**< \brief (RTC_MR) 125 ms */ -/* -------- RTC_TIMR : (RTC Offset: 0x08) Time Register -------- */ -#define RTC_TIMR_SEC_Pos 0 -#define RTC_TIMR_SEC_Msk (0x7fu << RTC_TIMR_SEC_Pos) /**< \brief (RTC_TIMR) Current Second */ -#define RTC_TIMR_SEC(value) ((RTC_TIMR_SEC_Msk & ((value) << RTC_TIMR_SEC_Pos))) -#define RTC_TIMR_MIN_Pos 8 -#define RTC_TIMR_MIN_Msk (0x7fu << RTC_TIMR_MIN_Pos) /**< \brief (RTC_TIMR) Current Minute */ -#define RTC_TIMR_MIN(value) ((RTC_TIMR_MIN_Msk & ((value) << RTC_TIMR_MIN_Pos))) -#define RTC_TIMR_HOUR_Pos 16 -#define RTC_TIMR_HOUR_Msk (0x3fu << RTC_TIMR_HOUR_Pos) /**< \brief (RTC_TIMR) Current Hour */ -#define RTC_TIMR_HOUR(value) ((RTC_TIMR_HOUR_Msk & ((value) << RTC_TIMR_HOUR_Pos))) -#define RTC_TIMR_AMPM (0x1u << 22) /**< \brief (RTC_TIMR) Ante Meridiem Post Meridiem Indicator */ -/* -------- RTC_CALR : (RTC Offset: 0x0C) Calendar Register -------- */ -#define RTC_CALR_CENT_Pos 0 -#define RTC_CALR_CENT_Msk (0x7fu << RTC_CALR_CENT_Pos) /**< \brief (RTC_CALR) Current Century */ -#define RTC_CALR_CENT(value) ((RTC_CALR_CENT_Msk & ((value) << RTC_CALR_CENT_Pos))) -#define RTC_CALR_YEAR_Pos 8 -#define RTC_CALR_YEAR_Msk (0xffu << RTC_CALR_YEAR_Pos) /**< \brief (RTC_CALR) Current Year */ -#define RTC_CALR_YEAR(value) ((RTC_CALR_YEAR_Msk & ((value) << RTC_CALR_YEAR_Pos))) -#define RTC_CALR_MONTH_Pos 16 -#define RTC_CALR_MONTH_Msk (0x1fu << RTC_CALR_MONTH_Pos) /**< \brief (RTC_CALR) Current Month */ -#define RTC_CALR_MONTH(value) ((RTC_CALR_MONTH_Msk & ((value) << RTC_CALR_MONTH_Pos))) -#define RTC_CALR_DAY_Pos 21 -#define RTC_CALR_DAY_Msk (0x7u << RTC_CALR_DAY_Pos) /**< \brief (RTC_CALR) Current Day in Current Week */ -#define RTC_CALR_DAY(value) ((RTC_CALR_DAY_Msk & ((value) << RTC_CALR_DAY_Pos))) -#define RTC_CALR_DATE_Pos 24 -#define RTC_CALR_DATE_Msk (0x3fu << RTC_CALR_DATE_Pos) /**< \brief (RTC_CALR) Current Day in Current Month */ -#define RTC_CALR_DATE(value) ((RTC_CALR_DATE_Msk & ((value) << RTC_CALR_DATE_Pos))) -/* -------- RTC_TIMALR : (RTC Offset: 0x10) Time Alarm Register -------- */ -#define RTC_TIMALR_SEC_Pos 0 -#define RTC_TIMALR_SEC_Msk (0x7fu << RTC_TIMALR_SEC_Pos) /**< \brief (RTC_TIMALR) Second Alarm */ -#define RTC_TIMALR_SEC(value) ((RTC_TIMALR_SEC_Msk & ((value) << RTC_TIMALR_SEC_Pos))) -#define RTC_TIMALR_SECEN (0x1u << 7) /**< \brief (RTC_TIMALR) Second Alarm Enable */ -#define RTC_TIMALR_MIN_Pos 8 -#define RTC_TIMALR_MIN_Msk (0x7fu << RTC_TIMALR_MIN_Pos) /**< \brief (RTC_TIMALR) Minute Alarm */ -#define RTC_TIMALR_MIN(value) ((RTC_TIMALR_MIN_Msk & ((value) << RTC_TIMALR_MIN_Pos))) -#define RTC_TIMALR_MINEN (0x1u << 15) /**< \brief (RTC_TIMALR) Minute Alarm Enable */ -#define RTC_TIMALR_HOUR_Pos 16 -#define RTC_TIMALR_HOUR_Msk (0x3fu << RTC_TIMALR_HOUR_Pos) /**< \brief (RTC_TIMALR) Hour Alarm */ -#define RTC_TIMALR_HOUR(value) ((RTC_TIMALR_HOUR_Msk & ((value) << RTC_TIMALR_HOUR_Pos))) -#define RTC_TIMALR_AMPM (0x1u << 22) /**< \brief (RTC_TIMALR) AM/PM Indicator */ -#define RTC_TIMALR_HOUREN (0x1u << 23) /**< \brief (RTC_TIMALR) Hour Alarm Enable */ -/* -------- RTC_CALALR : (RTC Offset: 0x14) Calendar Alarm Register -------- */ -#define RTC_CALALR_MONTH_Pos 16 -#define RTC_CALALR_MONTH_Msk (0x1fu << RTC_CALALR_MONTH_Pos) /**< \brief (RTC_CALALR) Month Alarm */ -#define RTC_CALALR_MONTH(value) ((RTC_CALALR_MONTH_Msk & ((value) << RTC_CALALR_MONTH_Pos))) -#define RTC_CALALR_MTHEN (0x1u << 23) /**< \brief (RTC_CALALR) Month Alarm Enable */ -#define RTC_CALALR_DATE_Pos 24 -#define RTC_CALALR_DATE_Msk (0x3fu << RTC_CALALR_DATE_Pos) /**< \brief (RTC_CALALR) Date Alarm */ -#define RTC_CALALR_DATE(value) ((RTC_CALALR_DATE_Msk & ((value) << RTC_CALALR_DATE_Pos))) -#define RTC_CALALR_DATEEN (0x1u << 31) /**< \brief (RTC_CALALR) Date Alarm Enable */ -/* -------- RTC_SR : (RTC Offset: 0x18) Status Register -------- */ -#define RTC_SR_ACKUPD (0x1u << 0) /**< \brief (RTC_SR) Acknowledge for Update */ -#define RTC_SR_ACKUPD_FREERUN (0x0u << 0) /**< \brief (RTC_SR) Time and calendar registers cannot be updated. */ -#define RTC_SR_ACKUPD_UPDATE (0x1u << 0) /**< \brief (RTC_SR) Time and calendar registers can be updated. */ -#define RTC_SR_ALARM (0x1u << 1) /**< \brief (RTC_SR) Alarm Flag */ -#define RTC_SR_ALARM_NO_ALARMEVENT (0x0u << 1) /**< \brief (RTC_SR) No alarm matching condition occurred. */ -#define RTC_SR_ALARM_ALARMEVENT (0x1u << 1) /**< \brief (RTC_SR) An alarm matching condition has occurred. */ -#define RTC_SR_SEC (0x1u << 2) /**< \brief (RTC_SR) Second Event */ -#define RTC_SR_SEC_NO_SECEVENT (0x0u << 2) /**< \brief (RTC_SR) No second event has occurred since the last clear. */ -#define RTC_SR_SEC_SECEVENT (0x1u << 2) /**< \brief (RTC_SR) At least one second event has occurred since the last clear. */ -#define RTC_SR_TIMEV (0x1u << 3) /**< \brief (RTC_SR) Time Event */ -#define RTC_SR_TIMEV_NO_TIMEVENT (0x0u << 3) /**< \brief (RTC_SR) No time event has occurred since the last clear. */ -#define RTC_SR_TIMEV_TIMEVENT (0x1u << 3) /**< \brief (RTC_SR) At least one time event has occurred since the last clear. */ -#define RTC_SR_CALEV (0x1u << 4) /**< \brief (RTC_SR) Calendar Event */ -#define RTC_SR_CALEV_NO_CALEVENT (0x0u << 4) /**< \brief (RTC_SR) No calendar event has occurred since the last clear. */ -#define RTC_SR_CALEV_CALEVENT (0x1u << 4) /**< \brief (RTC_SR) At least one calendar event has occurred since the last clear. */ -#define RTC_SR_TDERR (0x1u << 5) /**< \brief (RTC_SR) Time and/or Date Free Running Error */ -#define RTC_SR_TDERR_CORRECT (0x0u << 5) /**< \brief (RTC_SR) The internal free running counters are carrying valid values since the last read of the Status Register (RTC_SR). */ -#define RTC_SR_TDERR_ERR_TIMEDATE (0x1u << 5) /**< \brief (RTC_SR) The internal free running counters have been corrupted (invalid date or time, non-BCD values) since the last read and/or they are still invalid. */ -/* -------- RTC_SCCR : (RTC Offset: 0x1C) Status Clear Command Register -------- */ -#define RTC_SCCR_ACKCLR (0x1u << 0) /**< \brief (RTC_SCCR) Acknowledge Clear */ -#define RTC_SCCR_ALRCLR (0x1u << 1) /**< \brief (RTC_SCCR) Alarm Clear */ -#define RTC_SCCR_SECCLR (0x1u << 2) /**< \brief (RTC_SCCR) Second Clear */ -#define RTC_SCCR_TIMCLR (0x1u << 3) /**< \brief (RTC_SCCR) Time Clear */ -#define RTC_SCCR_CALCLR (0x1u << 4) /**< \brief (RTC_SCCR) Calendar Clear */ -#define RTC_SCCR_TDERRCLR (0x1u << 5) /**< \brief (RTC_SCCR) Time and/or Date Free Running Error Clear */ -/* -------- RTC_IER : (RTC Offset: 0x20) Interrupt Enable Register -------- */ -#define RTC_IER_ACKEN (0x1u << 0) /**< \brief (RTC_IER) Acknowledge Update Interrupt Enable */ -#define RTC_IER_ALREN (0x1u << 1) /**< \brief (RTC_IER) Alarm Interrupt Enable */ -#define RTC_IER_SECEN (0x1u << 2) /**< \brief (RTC_IER) Second Event Interrupt Enable */ -#define RTC_IER_TIMEN (0x1u << 3) /**< \brief (RTC_IER) Time Event Interrupt Enable */ -#define RTC_IER_CALEN (0x1u << 4) /**< \brief (RTC_IER) Calendar Event Interrupt Enable */ -#define RTC_IER_TDERREN (0x1u << 5) /**< \brief (RTC_IER) Time and/or Date Error Interrupt Enable */ -/* -------- RTC_IDR : (RTC Offset: 0x24) Interrupt Disable Register -------- */ -#define RTC_IDR_ACKDIS (0x1u << 0) /**< \brief (RTC_IDR) Acknowledge Update Interrupt Disable */ -#define RTC_IDR_ALRDIS (0x1u << 1) /**< \brief (RTC_IDR) Alarm Interrupt Disable */ -#define RTC_IDR_SECDIS (0x1u << 2) /**< \brief (RTC_IDR) Second Event Interrupt Disable */ -#define RTC_IDR_TIMDIS (0x1u << 3) /**< \brief (RTC_IDR) Time Event Interrupt Disable */ -#define RTC_IDR_CALDIS (0x1u << 4) /**< \brief (RTC_IDR) Calendar Event Interrupt Disable */ -#define RTC_IDR_TDERRDIS (0x1u << 5) /**< \brief (RTC_IDR) Time and/or Date Error Interrupt Disable */ -/* -------- RTC_IMR : (RTC Offset: 0x28) Interrupt Mask Register -------- */ -#define RTC_IMR_ACK (0x1u << 0) /**< \brief (RTC_IMR) Acknowledge Update Interrupt Mask */ -#define RTC_IMR_ALR (0x1u << 1) /**< \brief (RTC_IMR) Alarm Interrupt Mask */ -#define RTC_IMR_SEC (0x1u << 2) /**< \brief (RTC_IMR) Second Event Interrupt Mask */ -#define RTC_IMR_TIM (0x1u << 3) /**< \brief (RTC_IMR) Time Event Interrupt Mask */ -#define RTC_IMR_CAL (0x1u << 4) /**< \brief (RTC_IMR) Calendar Event Interrupt Mask */ -#define RTC_IMR_TDERR (0x1u << 5) /**< \brief (RTC_IMR) Time and/or Date Error Mask */ -/* -------- RTC_VER : (RTC Offset: 0x2C) Valid Entry Register -------- */ -#define RTC_VER_NVTIM (0x1u << 0) /**< \brief (RTC_VER) Non-valid Time */ -#define RTC_VER_NVCAL (0x1u << 1) /**< \brief (RTC_VER) Non-valid Calendar */ -#define RTC_VER_NVTIMALR (0x1u << 2) /**< \brief (RTC_VER) Non-valid Time Alarm */ -#define RTC_VER_NVCALALR (0x1u << 3) /**< \brief (RTC_VER) Non-valid Calendar Alarm */ - -/*@}*/ - - -#endif /* _SAMV71_RTC_COMPONENT_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_rtt.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_rtt.h deleted file mode 100644 index e208e1e0..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_rtt.h +++ /dev/null @@ -1,71 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_RTT_COMPONENT_ -#define _SAMV71_RTT_COMPONENT_ - -/* ============================================================================= */ -/** SOFTWARE API DEFINITION FOR Real-time Timer */ -/* ============================================================================= */ -/** \addtogroup SAMV71_RTT Real-time Timer */ -/*@{*/ - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -/** \brief Rtt hardware registers */ -typedef struct { - __IO uint32_t RTT_MR; /**< \brief (Rtt Offset: 0x00) Mode Register */ - __IO uint32_t RTT_AR; /**< \brief (Rtt Offset: 0x04) Alarm Register */ - __I uint32_t RTT_VR; /**< \brief (Rtt Offset: 0x08) Value Register */ - __I uint32_t RTT_SR; /**< \brief (Rtt Offset: 0x0C) Status Register */ -} Rtt; -#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/* -------- RTT_MR : (RTT Offset: 0x00) Mode Register -------- */ -#define RTT_MR_RTPRES_Pos 0 -#define RTT_MR_RTPRES_Msk (0xffffu << RTT_MR_RTPRES_Pos) /**< \brief (RTT_MR) Real-time Timer Prescaler Value */ -#define RTT_MR_RTPRES(value) ((RTT_MR_RTPRES_Msk & ((value) << RTT_MR_RTPRES_Pos))) -#define RTT_MR_ALMIEN (0x1u << 16) /**< \brief (RTT_MR) Alarm Interrupt Enable */ -#define RTT_MR_RTTINCIEN (0x1u << 17) /**< \brief (RTT_MR) Real-time Timer Increment Interrupt Enable */ -#define RTT_MR_RTTRST (0x1u << 18) /**< \brief (RTT_MR) Real-time Timer Restart */ -#define RTT_MR_RTTDIS (0x1u << 20) /**< \brief (RTT_MR) Real-time Timer Disable */ -#define RTT_MR_RTC1HZ (0x1u << 24) /**< \brief (RTT_MR) Real-Time Clock 1Hz Clock Selection */ -/* -------- RTT_AR : (RTT Offset: 0x04) Alarm Register -------- */ -#define RTT_AR_ALMV_Pos 0 -#define RTT_AR_ALMV_Msk (0xffffffffu << RTT_AR_ALMV_Pos) /**< \brief (RTT_AR) Alarm Value */ -#define RTT_AR_ALMV(value) ((RTT_AR_ALMV_Msk & ((value) << RTT_AR_ALMV_Pos))) -/* -------- RTT_VR : (RTT Offset: 0x08) Value Register -------- */ -#define RTT_VR_CRTV_Pos 0 -#define RTT_VR_CRTV_Msk (0xffffffffu << RTT_VR_CRTV_Pos) /**< \brief (RTT_VR) Current Real-time Value */ -/* -------- RTT_SR : (RTT Offset: 0x0C) Status Register -------- */ -#define RTT_SR_ALMS (0x1u << 0) /**< \brief (RTT_SR) Real-time Alarm Status (cleared on read) */ -#define RTT_SR_RTTINC (0x1u << 1) /**< \brief (RTT_SR) Prescaler Roll-over Status (cleared on read) */ - -/*@}*/ - - -#endif /* _SAMV71_RTT_COMPONENT_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_sdramc.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_sdramc.h deleted file mode 100644 index 10ff9805..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_sdramc.h +++ /dev/null @@ -1,173 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_SDRAMC_COMPONENT_ -#define _SAMV71_SDRAMC_COMPONENT_ - -/* ============================================================================= */ -/** SOFTWARE API DEFINITION FOR SDRAM Controller */ -/* ============================================================================= */ -/** \addtogroup SAMV71_SDRAMC SDRAM Controller */ -/*@{*/ - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -/** \brief Sdramc hardware registers */ -typedef struct { - __IO uint32_t SDRAMC_MR; /**< \brief (Sdramc Offset: 0x00) SDRAMC Mode Register */ - __IO uint32_t SDRAMC_TR; /**< \brief (Sdramc Offset: 0x04) SDRAMC Refresh Timer Register */ - __IO uint32_t SDRAMC_CR; /**< \brief (Sdramc Offset: 0x08) SDRAMC Configuration Register */ - __I uint32_t Reserved1[1]; - __IO uint32_t SDRAMC_LPR; /**< \brief (Sdramc Offset: 0x10) SDRAMC Low Power Register */ - __O uint32_t SDRAMC_IER; /**< \brief (Sdramc Offset: 0x14) SDRAMC Interrupt Enable Register */ - __O uint32_t SDRAMC_IDR; /**< \brief (Sdramc Offset: 0x18) SDRAMC Interrupt Disable Register */ - __I uint32_t SDRAMC_IMR; /**< \brief (Sdramc Offset: 0x1C) SDRAMC Interrupt Mask Register */ - __I uint32_t SDRAMC_ISR; /**< \brief (Sdramc Offset: 0x20) SDRAMC Interrupt Status Register */ - __IO uint32_t SDRAMC_MDR; /**< \brief (Sdramc Offset: 0x24) SDRAMC Memory Device Register */ - __IO uint32_t SDRAMC_CFR1; /**< \brief (Sdramc Offset: 0x28) SDRAMC Configuration Register 1 */ - __IO uint32_t SDRAMC_OCMS; /**< \brief (Sdramc Offset: 0x2C) SDRAMC OCMS Register */ - __O uint32_t SDRAMC_OCMS_KEY1; /**< \brief (Sdramc Offset: 0x30) SDRAMC OCMS KEY1 Register */ - __O uint32_t SDRAMC_OCMS_KEY2; /**< \brief (Sdramc Offset: 0x34) SDRAMC OCMS KEY2 Register */ -} Sdramc; -#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/* -------- SDRAMC_MR : (SDRAMC Offset: 0x00) SDRAMC Mode Register -------- */ -#define SDRAMC_MR_MODE_Pos 0 -#define SDRAMC_MR_MODE_Msk (0x7u << SDRAMC_MR_MODE_Pos) /**< \brief (SDRAMC_MR) SDRAMC Command Mode */ -#define SDRAMC_MR_MODE(value) ((SDRAMC_MR_MODE_Msk & ((value) << SDRAMC_MR_MODE_Pos))) -#define SDRAMC_MR_MODE_NORMAL (0x0u << 0) /**< \brief (SDRAMC_MR) Normal mode. Any access to the SDRAM is decoded normally. To activate this mode, command must be followed by a write to the SDRAM. */ -#define SDRAMC_MR_MODE_NOP (0x1u << 0) /**< \brief (SDRAMC_MR) The SDRAMC issues a NOP command when the SDRAM device is accessed regardless of the cycle. To activate this mode, command must be followed by a write to the SDRAM. */ -#define SDRAMC_MR_MODE_ALLBANKS_PRECHARGE (0x2u << 0) /**< \brief (SDRAMC_MR) The SDRAMC issues an "All Banks Precharge" command when the SDRAM device is accessed regardless of the cycle. To activate this mode, command must be followed by a write to the SDRAM. */ -#define SDRAMC_MR_MODE_LOAD_MODEREG (0x3u << 0) /**< \brief (SDRAMC_MR) The SDRAMC issues a "Load Mode Register" command when the SDRAM device is accessed regardless of the cycle. To activate this mode, command must be followed by a write to the SDRAM. */ -#define SDRAMC_MR_MODE_AUTO_REFRESH (0x4u << 0) /**< \brief (SDRAMC_MR) The SDRAMC issues an "Auto-Refresh" Command when the SDRAM device is accessed regardless of the cycle. Previously, an "All Banks Precharge" command must be issued. To activate this mode, command must be followed by a write to the SDRAM. */ -#define SDRAMC_MR_MODE_EXT_LOAD_MODEREG (0x5u << 0) /**< \brief (SDRAMC_MR) The SDRAMC issues an "Extended Load Mode Register" command when the SDRAM device is accessed regardless of the cycle. To activate this mode, the "Extended Load Mode Register" command must be followed by a write to the SDRAM. The write in the SDRAM must be done in the appropriate bank; most low-power SDRAM devices use the bank 1. */ -#define SDRAMC_MR_MODE_DEEP_POWERDOWN (0x6u << 0) /**< \brief (SDRAMC_MR) Deep power-down mode. Enters deep power-down mode. */ -/* -------- SDRAMC_TR : (SDRAMC Offset: 0x04) SDRAMC Refresh Timer Register -------- */ -#define SDRAMC_TR_COUNT_Pos 0 -#define SDRAMC_TR_COUNT_Msk (0xfffu << SDRAMC_TR_COUNT_Pos) /**< \brief (SDRAMC_TR) SDRAMC Refresh Timer Count */ -#define SDRAMC_TR_COUNT(value) ((SDRAMC_TR_COUNT_Msk & ((value) << SDRAMC_TR_COUNT_Pos))) -/* -------- SDRAMC_CR : (SDRAMC Offset: 0x08) SDRAMC Configuration Register -------- */ -#define SDRAMC_CR_NC_Pos 0 -#define SDRAMC_CR_NC_Msk (0x3u << SDRAMC_CR_NC_Pos) /**< \brief (SDRAMC_CR) Number of Column Bits */ -#define SDRAMC_CR_NC(value) ((SDRAMC_CR_NC_Msk & ((value) << SDRAMC_CR_NC_Pos))) -#define SDRAMC_CR_NC_COL8 (0x0u << 0) /**< \brief (SDRAMC_CR) 8 column bits */ -#define SDRAMC_CR_NC_COL9 (0x1u << 0) /**< \brief (SDRAMC_CR) 9 column bits */ -#define SDRAMC_CR_NC_COL10 (0x2u << 0) /**< \brief (SDRAMC_CR) 10 column bits */ -#define SDRAMC_CR_NC_COL11 (0x3u << 0) /**< \brief (SDRAMC_CR) 11 column bits */ -#define SDRAMC_CR_NR_Pos 2 -#define SDRAMC_CR_NR_Msk (0x3u << SDRAMC_CR_NR_Pos) /**< \brief (SDRAMC_CR) Number of Row Bits */ -#define SDRAMC_CR_NR(value) ((SDRAMC_CR_NR_Msk & ((value) << SDRAMC_CR_NR_Pos))) -#define SDRAMC_CR_NR_ROW11 (0x0u << 2) /**< \brief (SDRAMC_CR) 11 row bits */ -#define SDRAMC_CR_NR_ROW12 (0x1u << 2) /**< \brief (SDRAMC_CR) 12 row bits */ -#define SDRAMC_CR_NR_ROW13 (0x2u << 2) /**< \brief (SDRAMC_CR) 13 row bits */ -#define SDRAMC_CR_NB (0x1u << 4) /**< \brief (SDRAMC_CR) Number of Banks */ -#define SDRAMC_CR_NB_BANK2 (0x0u << 4) /**< \brief (SDRAMC_CR) 2 banks */ -#define SDRAMC_CR_NB_BANK4 (0x1u << 4) /**< \brief (SDRAMC_CR) 4 banks */ -#define SDRAMC_CR_CAS_Pos 5 -#define SDRAMC_CR_CAS_Msk (0x3u << SDRAMC_CR_CAS_Pos) /**< \brief (SDRAMC_CR) CAS Latency */ -#define SDRAMC_CR_CAS(value) ((SDRAMC_CR_CAS_Msk & ((value) << SDRAMC_CR_CAS_Pos))) -#define SDRAMC_CR_CAS_LATENCY1 (0x0u << 5) /**< \brief (SDRAMC_CR) 1 cycle CAS latency */ -#define SDRAMC_CR_CAS_LATENCY2 (0x1u << 5) /**< \brief (SDRAMC_CR) 2 cycle CAS latency */ -#define SDRAMC_CR_CAS_LATENCY3 (0x2u << 5) /**< \brief (SDRAMC_CR) 3 cycle CAS latency */ -#define SDRAMC_CR_DBW (0x1u << 7) /**< \brief (SDRAMC_CR) Data Bus Width */ -#define SDRAMC_CR_TWR_Pos 8 -#define SDRAMC_CR_TWR_Msk (0xfu << SDRAMC_CR_TWR_Pos) /**< \brief (SDRAMC_CR) Write Recovery Delay */ -#define SDRAMC_CR_TWR(value) ((SDRAMC_CR_TWR_Msk & ((value) << SDRAMC_CR_TWR_Pos))) -#define SDRAMC_CR_TRC_TRFC_Pos 12 -#define SDRAMC_CR_TRC_TRFC_Msk (0xfu << SDRAMC_CR_TRC_TRFC_Pos) /**< \brief (SDRAMC_CR) Row Cycle Delay and Row Refresh Cycle */ -#define SDRAMC_CR_TRC_TRFC(value) ((SDRAMC_CR_TRC_TRFC_Msk & ((value) << SDRAMC_CR_TRC_TRFC_Pos))) -#define SDRAMC_CR_TRP_Pos 16 -#define SDRAMC_CR_TRP_Msk (0xfu << SDRAMC_CR_TRP_Pos) /**< \brief (SDRAMC_CR) Row Precharge Delay */ -#define SDRAMC_CR_TRP(value) ((SDRAMC_CR_TRP_Msk & ((value) << SDRAMC_CR_TRP_Pos))) -#define SDRAMC_CR_TRCD_Pos 20 -#define SDRAMC_CR_TRCD_Msk (0xfu << SDRAMC_CR_TRCD_Pos) /**< \brief (SDRAMC_CR) Row to Column Delay */ -#define SDRAMC_CR_TRCD(value) ((SDRAMC_CR_TRCD_Msk & ((value) << SDRAMC_CR_TRCD_Pos))) -#define SDRAMC_CR_TRAS_Pos 24 -#define SDRAMC_CR_TRAS_Msk (0xfu << SDRAMC_CR_TRAS_Pos) /**< \brief (SDRAMC_CR) Active to Precharge Delay */ -#define SDRAMC_CR_TRAS(value) ((SDRAMC_CR_TRAS_Msk & ((value) << SDRAMC_CR_TRAS_Pos))) -#define SDRAMC_CR_TXSR_Pos 28 -#define SDRAMC_CR_TXSR_Msk (0xfu << SDRAMC_CR_TXSR_Pos) /**< \brief (SDRAMC_CR) Exit Self Refresh to Active Delay */ -#define SDRAMC_CR_TXSR(value) ((SDRAMC_CR_TXSR_Msk & ((value) << SDRAMC_CR_TXSR_Pos))) -/* -------- SDRAMC_LPR : (SDRAMC Offset: 0x10) SDRAMC Low Power Register -------- */ -#define SDRAMC_LPR_LPCB_Pos 0 -#define SDRAMC_LPR_LPCB_Msk (0x3u << SDRAMC_LPR_LPCB_Pos) /**< \brief (SDRAMC_LPR) Low-power Configuration Bits */ -#define SDRAMC_LPR_LPCB(value) ((SDRAMC_LPR_LPCB_Msk & ((value) << SDRAMC_LPR_LPCB_Pos))) -#define SDRAMC_LPR_LPCB_DISABLED (0x0u << 0) /**< \brief (SDRAMC_LPR) Low Power Feature is inhibited: no Power-down, Self-refresh or Deep Power-down command is issued to the SDRAM device. */ -#define SDRAMC_LPR_LPCB_SELF_REFRESH (0x1u << 0) /**< \brief (SDRAMC_LPR) The SDRAMC issues a Self-refresh command to the SDRAM device, the SDCK clock is deactivated and the SDCKE signal is set low. The SDRAM device leaves the Self Refresh Mode when accessed and enters it after the access. */ -#define SDRAMC_LPR_LPCB_POWER_DOWN (0x2u << 0) /**< \brief (SDRAMC_LPR) The SDRAMC issues a Power-down Command to the SDRAM device after each access, the SDCKE signal is set to low. The SDRAM device leaves the Power-down Mode when accessed and enters it after the access. */ -#define SDRAMC_LPR_LPCB_DEEP_POWER_DOWN (0x3u << 0) /**< \brief (SDRAMC_LPR) The SDRAMC issues a Deep Power-down command to the SDRAM device. This mode is unique to low-power SDRAM. */ -#define SDRAMC_LPR_PASR_Pos 4 -#define SDRAMC_LPR_PASR_Msk (0x7u << SDRAMC_LPR_PASR_Pos) /**< \brief (SDRAMC_LPR) Partial Array Self-refresh (only for low-power SDRAM) */ -#define SDRAMC_LPR_PASR(value) ((SDRAMC_LPR_PASR_Msk & ((value) << SDRAMC_LPR_PASR_Pos))) -#define SDRAMC_LPR_TCSR_Pos 8 -#define SDRAMC_LPR_TCSR_Msk (0x3u << SDRAMC_LPR_TCSR_Pos) /**< \brief (SDRAMC_LPR) Temperature Compensated Self-Refresh (only for low-power SDRAM) */ -#define SDRAMC_LPR_TCSR(value) ((SDRAMC_LPR_TCSR_Msk & ((value) << SDRAMC_LPR_TCSR_Pos))) -#define SDRAMC_LPR_DS_Pos 10 -#define SDRAMC_LPR_DS_Msk (0x3u << SDRAMC_LPR_DS_Pos) /**< \brief (SDRAMC_LPR) Drive Strength (only for low-power SDRAM) */ -#define SDRAMC_LPR_DS(value) ((SDRAMC_LPR_DS_Msk & ((value) << SDRAMC_LPR_DS_Pos))) -#define SDRAMC_LPR_TIMEOUT_Pos 12 -#define SDRAMC_LPR_TIMEOUT_Msk (0x3u << SDRAMC_LPR_TIMEOUT_Pos) /**< \brief (SDRAMC_LPR) Time to Define When Low-power Mode Is Enabled */ -#define SDRAMC_LPR_TIMEOUT(value) ((SDRAMC_LPR_TIMEOUT_Msk & ((value) << SDRAMC_LPR_TIMEOUT_Pos))) -#define SDRAMC_LPR_TIMEOUT_LP_LAST_XFER (0x0u << 12) /**< \brief (SDRAMC_LPR) The SDRAMC activates the SDRAM low-power mode immediately after the end of the last transfer. */ -#define SDRAMC_LPR_TIMEOUT_LP_LAST_XFER_64 (0x1u << 12) /**< \brief (SDRAMC_LPR) The SDRAMC activates the SDRAM low-power mode 64 clock cycles after the end of the last transfer. */ -#define SDRAMC_LPR_TIMEOUT_LP_LAST_XFER_128 (0x2u << 12) /**< \brief (SDRAMC_LPR) The SDRAMC activates the SDRAM low-power mode 128 clock cycles after the end of the last transfer. */ -/* -------- SDRAMC_IER : (SDRAMC Offset: 0x14) SDRAMC Interrupt Enable Register -------- */ -#define SDRAMC_IER_RES (0x1u << 0) /**< \brief (SDRAMC_IER) Refresh Error Status */ -/* -------- SDRAMC_IDR : (SDRAMC Offset: 0x18) SDRAMC Interrupt Disable Register -------- */ -#define SDRAMC_IDR_RES (0x1u << 0) /**< \brief (SDRAMC_IDR) Refresh Error Status */ -/* -------- SDRAMC_IMR : (SDRAMC Offset: 0x1C) SDRAMC Interrupt Mask Register -------- */ -#define SDRAMC_IMR_RES (0x1u << 0) /**< \brief (SDRAMC_IMR) Refresh Error Status */ -/* -------- SDRAMC_ISR : (SDRAMC Offset: 0x20) SDRAMC Interrupt Status Register -------- */ -#define SDRAMC_ISR_RES (0x1u << 0) /**< \brief (SDRAMC_ISR) Refresh Error Status (cleared on read) */ -/* -------- SDRAMC_MDR : (SDRAMC Offset: 0x24) SDRAMC Memory Device Register -------- */ -#define SDRAMC_MDR_MD_Pos 0 -#define SDRAMC_MDR_MD_Msk (0x3u << SDRAMC_MDR_MD_Pos) /**< \brief (SDRAMC_MDR) Memory Device Type */ -#define SDRAMC_MDR_MD(value) ((SDRAMC_MDR_MD_Msk & ((value) << SDRAMC_MDR_MD_Pos))) -#define SDRAMC_MDR_MD_SDRAM (0x0u << 0) /**< \brief (SDRAMC_MDR) SDRAM */ -#define SDRAMC_MDR_MD_LPSDRAM (0x1u << 0) /**< \brief (SDRAMC_MDR) Low-power SDRAM */ -/* -------- SDRAMC_CFR1 : (SDRAMC Offset: 0x28) SDRAMC Configuration Register 1 -------- */ -#define SDRAMC_CFR1_TMRD_Pos 0 -#define SDRAMC_CFR1_TMRD_Msk (0xfu << SDRAMC_CFR1_TMRD_Pos) /**< \brief (SDRAMC_CFR1) Load Mode Register Command to Active or Refresh Command */ -#define SDRAMC_CFR1_TMRD(value) ((SDRAMC_CFR1_TMRD_Msk & ((value) << SDRAMC_CFR1_TMRD_Pos))) -#define SDRAMC_CFR1_UNAL (0x1u << 8) /**< \brief (SDRAMC_CFR1) Support Unaligned Access */ -#define SDRAMC_CFR1_UNAL_UNSUPPORTED (0x0u << 8) /**< \brief (SDRAMC_CFR1) Unaligned access is not supported. */ -#define SDRAMC_CFR1_UNAL_SUPPORTED (0x1u << 8) /**< \brief (SDRAMC_CFR1) Unaligned access is supported. */ -/* -------- SDRAMC_OCMS : (SDRAMC Offset: 0x2C) SDRAMC OCMS Register -------- */ -#define SDRAMC_OCMS_SDR_SE (0x1u << 0) /**< \brief (SDRAMC_OCMS) SDRAM Memory Controller Scrambling Enable */ -/* -------- SDRAMC_OCMS_KEY1 : (SDRAMC Offset: 0x30) SDRAMC OCMS KEY1 Register -------- */ -#define SDRAMC_OCMS_KEY1_KEY1_Pos 0 -#define SDRAMC_OCMS_KEY1_KEY1_Msk (0xffffffffu << SDRAMC_OCMS_KEY1_KEY1_Pos) /**< \brief (SDRAMC_OCMS_KEY1) Off-chip Memory Scrambling (OCMS) Key Part 1 */ -#define SDRAMC_OCMS_KEY1_KEY1(value) ((SDRAMC_OCMS_KEY1_KEY1_Msk & ((value) << SDRAMC_OCMS_KEY1_KEY1_Pos))) -/* -------- SDRAMC_OCMS_KEY2 : (SDRAMC Offset: 0x34) SDRAMC OCMS KEY2 Register -------- */ -#define SDRAMC_OCMS_KEY2_KEY2_Pos 0 -#define SDRAMC_OCMS_KEY2_KEY2_Msk (0xffffffffu << SDRAMC_OCMS_KEY2_KEY2_Pos) /**< \brief (SDRAMC_OCMS_KEY2) Off-chip Memory Scrambling (OCMS) Key Part 2 */ -#define SDRAMC_OCMS_KEY2_KEY2(value) ((SDRAMC_OCMS_KEY2_KEY2_Msk & ((value) << SDRAMC_OCMS_KEY2_KEY2_Pos))) - -/*@}*/ - - -#endif /* _SAMV71_SDRAMC_COMPONENT_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_smc.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_smc.h deleted file mode 100644 index e4dc38c7..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_smc.h +++ /dev/null @@ -1,144 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_SMC_COMPONENT_ -#define _SAMV71_SMC_COMPONENT_ - -/* ============================================================================= */ -/** SOFTWARE API DEFINITION FOR Static Memory Controller */ -/* ============================================================================= */ -/** \addtogroup SAMV71_SMC Static Memory Controller */ -/*@{*/ - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -/** \brief SmcCs_number hardware registers */ -typedef struct { - __IO uint32_t SMC_SETUP; /**< \brief (SmcCs_number Offset: 0x0) SMC Setup Register */ - __IO uint32_t SMC_PULSE; /**< \brief (SmcCs_number Offset: 0x4) SMC Pulse Register */ - __IO uint32_t SMC_CYCLE; /**< \brief (SmcCs_number Offset: 0x8) SMC Cycle Register */ - __IO uint32_t SMC_MODE; /**< \brief (SmcCs_number Offset: 0xC) SMC MODE Register */ -} SmcCs_number; -/** \brief Smc hardware registers */ -#define SMCCS_NUMBER_NUMBER 4 -typedef struct { - SmcCs_number SMC_CS_NUMBER[SMCCS_NUMBER_NUMBER]; /**< \brief (Smc Offset: 0x0) CS_number = 0 .. 3 */ - __I uint32_t Reserved1[16]; - __IO uint32_t SMC_OCMS; /**< \brief (Smc Offset: 0x80) SMC OCMS MODE Register */ - __O uint32_t SMC_KEY1; /**< \brief (Smc Offset: 0x84) SMC OCMS KEY1 Register */ - __O uint32_t SMC_KEY2; /**< \brief (Smc Offset: 0x88) SMC OCMS KEY2 Register */ - __I uint32_t Reserved2[22]; - __IO uint32_t SMC_WPMR; /**< \brief (Smc Offset: 0xE4) SMC Write Protection Mode Register */ - __I uint32_t SMC_WPSR; /**< \brief (Smc Offset: 0xE8) SMC Write Protection Status Register */ -} Smc; -#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/* -------- SMC_SETUP : (SMC Offset: N/A) SMC Setup Register -------- */ -#define SMC_SETUP_NWE_SETUP_Pos 0 -#define SMC_SETUP_NWE_SETUP_Msk (0x3fu << SMC_SETUP_NWE_SETUP_Pos) /**< \brief (SMC_SETUP) NWE Setup Length */ -#define SMC_SETUP_NWE_SETUP(value) ((SMC_SETUP_NWE_SETUP_Msk & ((value) << SMC_SETUP_NWE_SETUP_Pos))) -#define SMC_SETUP_NCS_WR_SETUP_Pos 8 -#define SMC_SETUP_NCS_WR_SETUP_Msk (0x3fu << SMC_SETUP_NCS_WR_SETUP_Pos) /**< \brief (SMC_SETUP) NCS Setup Length in WRITE Access */ -#define SMC_SETUP_NCS_WR_SETUP(value) ((SMC_SETUP_NCS_WR_SETUP_Msk & ((value) << SMC_SETUP_NCS_WR_SETUP_Pos))) -#define SMC_SETUP_NRD_SETUP_Pos 16 -#define SMC_SETUP_NRD_SETUP_Msk (0x3fu << SMC_SETUP_NRD_SETUP_Pos) /**< \brief (SMC_SETUP) NRD Setup Length */ -#define SMC_SETUP_NRD_SETUP(value) ((SMC_SETUP_NRD_SETUP_Msk & ((value) << SMC_SETUP_NRD_SETUP_Pos))) -#define SMC_SETUP_NCS_RD_SETUP_Pos 24 -#define SMC_SETUP_NCS_RD_SETUP_Msk (0x3fu << SMC_SETUP_NCS_RD_SETUP_Pos) /**< \brief (SMC_SETUP) NCS Setup Length in READ Access */ -#define SMC_SETUP_NCS_RD_SETUP(value) ((SMC_SETUP_NCS_RD_SETUP_Msk & ((value) << SMC_SETUP_NCS_RD_SETUP_Pos))) -/* -------- SMC_PULSE : (SMC Offset: N/A) SMC Pulse Register -------- */ -#define SMC_PULSE_NWE_PULSE_Pos 0 -#define SMC_PULSE_NWE_PULSE_Msk (0x7fu << SMC_PULSE_NWE_PULSE_Pos) /**< \brief (SMC_PULSE) NWE Pulse Length */ -#define SMC_PULSE_NWE_PULSE(value) ((SMC_PULSE_NWE_PULSE_Msk & ((value) << SMC_PULSE_NWE_PULSE_Pos))) -#define SMC_PULSE_NCS_WR_PULSE_Pos 8 -#define SMC_PULSE_NCS_WR_PULSE_Msk (0x7fu << SMC_PULSE_NCS_WR_PULSE_Pos) /**< \brief (SMC_PULSE) NCS Pulse Length in WRITE Access */ -#define SMC_PULSE_NCS_WR_PULSE(value) ((SMC_PULSE_NCS_WR_PULSE_Msk & ((value) << SMC_PULSE_NCS_WR_PULSE_Pos))) -#define SMC_PULSE_NRD_PULSE_Pos 16 -#define SMC_PULSE_NRD_PULSE_Msk (0x7fu << SMC_PULSE_NRD_PULSE_Pos) /**< \brief (SMC_PULSE) NRD Pulse Length */ -#define SMC_PULSE_NRD_PULSE(value) ((SMC_PULSE_NRD_PULSE_Msk & ((value) << SMC_PULSE_NRD_PULSE_Pos))) -#define SMC_PULSE_NCS_RD_PULSE_Pos 24 -#define SMC_PULSE_NCS_RD_PULSE_Msk (0x7fu << SMC_PULSE_NCS_RD_PULSE_Pos) /**< \brief (SMC_PULSE) NCS Pulse Length in READ Access */ -#define SMC_PULSE_NCS_RD_PULSE(value) ((SMC_PULSE_NCS_RD_PULSE_Msk & ((value) << SMC_PULSE_NCS_RD_PULSE_Pos))) -/* -------- SMC_CYCLE : (SMC Offset: N/A) SMC Cycle Register -------- */ -#define SMC_CYCLE_NWE_CYCLE_Pos 0 -#define SMC_CYCLE_NWE_CYCLE_Msk (0x1ffu << SMC_CYCLE_NWE_CYCLE_Pos) /**< \brief (SMC_CYCLE) Total Write Cycle Length */ -#define SMC_CYCLE_NWE_CYCLE(value) ((SMC_CYCLE_NWE_CYCLE_Msk & ((value) << SMC_CYCLE_NWE_CYCLE_Pos))) -#define SMC_CYCLE_NRD_CYCLE_Pos 16 -#define SMC_CYCLE_NRD_CYCLE_Msk (0x1ffu << SMC_CYCLE_NRD_CYCLE_Pos) /**< \brief (SMC_CYCLE) Total Read Cycle Length */ -#define SMC_CYCLE_NRD_CYCLE(value) ((SMC_CYCLE_NRD_CYCLE_Msk & ((value) << SMC_CYCLE_NRD_CYCLE_Pos))) -/* -------- SMC_MODE : (SMC Offset: N/A) SMC MODE Register -------- */ -#define SMC_MODE_READ_MODE (0x1u << 0) /**< \brief (SMC_MODE) Read Mode */ -#define SMC_MODE_WRITE_MODE (0x1u << 1) /**< \brief (SMC_MODE) Write Mode */ -#define SMC_MODE_EXNW_MODE_Pos 4 -#define SMC_MODE_EXNW_MODE_Msk (0x3u << SMC_MODE_EXNW_MODE_Pos) /**< \brief (SMC_MODE) NWAIT Mode */ -#define SMC_MODE_EXNW_MODE(value) ((SMC_MODE_EXNW_MODE_Msk & ((value) << SMC_MODE_EXNW_MODE_Pos))) -#define SMC_MODE_EXNW_MODE_DISABLED (0x0u << 4) /**< \brief (SMC_MODE) Disabled */ -#define SMC_MODE_EXNW_MODE_FROZEN (0x2u << 4) /**< \brief (SMC_MODE) Frozen Mode */ -#define SMC_MODE_EXNW_MODE_READY (0x3u << 4) /**< \brief (SMC_MODE) Ready Mode */ -#define SMC_MODE_BAT (0x1u << 8) /**< \brief (SMC_MODE) Byte Access Type */ -#define SMC_MODE_BAT_BYTE_SELECT (0x0u << 8) /**< \brief (SMC_MODE) Byte select access type:- Write operation is controlled using NCS, NWE, NBS0, NBS1.- Read operation is controlled using NCS, NRD, NBS0, NBS1. */ -#define SMC_MODE_BAT_BYTE_WRITE (0x1u << 8) /**< \brief (SMC_MODE) Byte write access type:- Write operation is controlled using NCS, NWR0, NWR1.- Read operation is controlled using NCS and NRD. */ -#define SMC_MODE_DBW (0x1u << 12) /**< \brief (SMC_MODE) Data Bus Width */ -#define SMC_MODE_DBW_8_BIT (0x0u << 12) /**< \brief (SMC_MODE) 8-bit Data Bus */ -#define SMC_MODE_DBW_16_BIT (0x1u << 12) /**< \brief (SMC_MODE) 16-bit Data Bus */ -#define SMC_MODE_TDF_CYCLES_Pos 16 -#define SMC_MODE_TDF_CYCLES_Msk (0xfu << SMC_MODE_TDF_CYCLES_Pos) /**< \brief (SMC_MODE) Data Float Time */ -#define SMC_MODE_TDF_CYCLES(value) ((SMC_MODE_TDF_CYCLES_Msk & ((value) << SMC_MODE_TDF_CYCLES_Pos))) -#define SMC_MODE_TDF_MODE (0x1u << 20) /**< \brief (SMC_MODE) TDF Optimization */ -#define SMC_MODE_PMEN (0x1u << 24) /**< \brief (SMC_MODE) Page Mode Enabled */ -#define SMC_MODE_PS_Pos 28 -#define SMC_MODE_PS_Msk (0x3u << SMC_MODE_PS_Pos) /**< \brief (SMC_MODE) Page Size */ -#define SMC_MODE_PS(value) ((SMC_MODE_PS_Msk & ((value) << SMC_MODE_PS_Pos))) -#define SMC_MODE_PS_4_BYTE (0x0u << 28) /**< \brief (SMC_MODE) 4-byte page */ -#define SMC_MODE_PS_8_BYTE (0x1u << 28) /**< \brief (SMC_MODE) 8-byte page */ -#define SMC_MODE_PS_16_BYTE (0x2u << 28) /**< \brief (SMC_MODE) 16-byte page */ -#define SMC_MODE_PS_32_BYTE (0x3u << 28) /**< \brief (SMC_MODE) 32-byte page */ -/* -------- SMC_OCMS : (SMC Offset: 0x80) SMC OCMS MODE Register -------- */ -#define SMC_OCMS_SMSE (0x1u << 0) /**< \brief (SMC_OCMS) Static Memory Controller Scrambling Enable */ -/* -------- SMC_KEY1 : (SMC Offset: 0x84) SMC OCMS KEY1 Register -------- */ -#define SMC_KEY1_KEY1_Pos 0 -#define SMC_KEY1_KEY1_Msk (0xffffffffu << SMC_KEY1_KEY1_Pos) /**< \brief (SMC_KEY1) Off Chip Memory Scrambling (OCMS) Key Part 1 */ -#define SMC_KEY1_KEY1(value) ((SMC_KEY1_KEY1_Msk & ((value) << SMC_KEY1_KEY1_Pos))) -/* -------- SMC_KEY2 : (SMC Offset: 0x88) SMC OCMS KEY2 Register -------- */ -#define SMC_KEY2_KEY2_Pos 0 -#define SMC_KEY2_KEY2_Msk (0xffffffffu << SMC_KEY2_KEY2_Pos) /**< \brief (SMC_KEY2) Off Chip Memory Scrambling (OCMS) Key Part 2 */ -#define SMC_KEY2_KEY2(value) ((SMC_KEY2_KEY2_Msk & ((value) << SMC_KEY2_KEY2_Pos))) -/* -------- SMC_WPMR : (SMC Offset: 0xE4) SMC Write Protection Mode Register -------- */ -#define SMC_WPMR_WPEN (0x1u << 0) /**< \brief (SMC_WPMR) Write Protect Enable */ -#define SMC_WPMR_WPKEY_Pos 8 -#define SMC_WPMR_WPKEY_Msk (0xffffffu << SMC_WPMR_WPKEY_Pos) /**< \brief (SMC_WPMR) Write Protection Key */ -#define SMC_WPMR_WPKEY(value) ((SMC_WPMR_WPKEY_Msk & ((value) << SMC_WPMR_WPKEY_Pos))) -#define SMC_WPMR_WPKEY_PASSWD (0x534D43u << 8) /**< \brief (SMC_WPMR) Writing any other value in this field aborts the write operation of the WPEN bit. Always reads as 0. */ -/* -------- SMC_WPSR : (SMC Offset: 0xE8) SMC Write Protection Status Register -------- */ -#define SMC_WPSR_WPVS (0x1u << 0) /**< \brief (SMC_WPSR) Write Protection Violation Status */ -#define SMC_WPSR_WPVSRC_Pos 8 -#define SMC_WPSR_WPVSRC_Msk (0xffffu << SMC_WPSR_WPVSRC_Pos) /**< \brief (SMC_WPSR) Write Protection Violation Source */ - -/*@}*/ - - -#endif /* _SAMV71_SMC_COMPONENT_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_spi.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_spi.h deleted file mode 100644 index 913fddad..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_spi.h +++ /dev/null @@ -1,161 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_SPI_COMPONENT_ -#define _SAMV71_SPI_COMPONENT_ - -/* ============================================================================= */ -/** SOFTWARE API DEFINITION FOR Serial Peripheral Interface */ -/* ============================================================================= */ -/** \addtogroup SAMV71_SPI Serial Peripheral Interface */ -/*@{*/ - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -/** \brief Spi hardware registers */ -typedef struct { - __O uint32_t SPI_CR; /**< \brief (Spi Offset: 0x00) Control Register */ - __IO uint32_t SPI_MR; /**< \brief (Spi Offset: 0x04) Mode Register */ - __I uint32_t SPI_RDR; /**< \brief (Spi Offset: 0x08) Receive Data Register */ - __O uint32_t SPI_TDR; /**< \brief (Spi Offset: 0x0C) Transmit Data Register */ - __I uint32_t SPI_SR; /**< \brief (Spi Offset: 0x10) Status Register */ - __O uint32_t SPI_IER; /**< \brief (Spi Offset: 0x14) Interrupt Enable Register */ - __O uint32_t SPI_IDR; /**< \brief (Spi Offset: 0x18) Interrupt Disable Register */ - __I uint32_t SPI_IMR; /**< \brief (Spi Offset: 0x1C) Interrupt Mask Register */ - __I uint32_t Reserved1[4]; - __IO uint32_t SPI_CSR[4]; /**< \brief (Spi Offset: 0x30) Chip Select Register */ - __I uint32_t Reserved2[41]; - __IO uint32_t SPI_WPMR; /**< \brief (Spi Offset: 0xE4) Write Protection Mode Register */ - __I uint32_t SPI_WPSR; /**< \brief (Spi Offset: 0xE8) Write Protection Status Register */ -} Spi; -#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/* -------- SPI_CR : (SPI Offset: 0x00) Control Register -------- */ -#define SPI_CR_SPIEN (0x1u << 0) /**< \brief (SPI_CR) SPI Enable */ -#define SPI_CR_SPIDIS (0x1u << 1) /**< \brief (SPI_CR) SPI Disable */ -#define SPI_CR_SWRST (0x1u << 7) /**< \brief (SPI_CR) SPI Software Reset */ -#define SPI_CR_LASTXFER (0x1u << 24) /**< \brief (SPI_CR) Last Transfer */ -/* -------- SPI_MR : (SPI Offset: 0x04) Mode Register -------- */ -#define SPI_MR_MSTR (0x1u << 0) /**< \brief (SPI_MR) Master/Slave Mode */ -#define SPI_MR_PS (0x1u << 1) /**< \brief (SPI_MR) Peripheral Select */ -#define SPI_MR_PCSDEC (0x1u << 2) /**< \brief (SPI_MR) Chip Select Decode */ -#define SPI_MR_MODFDIS (0x1u << 4) /**< \brief (SPI_MR) Mode Fault Detection */ -#define SPI_MR_WDRBT (0x1u << 5) /**< \brief (SPI_MR) Wait Data Read Before Transfer */ -#define SPI_MR_LLB (0x1u << 7) /**< \brief (SPI_MR) Local Loopback Enable */ -#define SPI_MR_PCS_Pos 16 -#define SPI_MR_PCS_Msk (0xfu << SPI_MR_PCS_Pos) /**< \brief (SPI_MR) Peripheral Chip Select */ -#define SPI_MR_PCS(value) ((SPI_MR_PCS_Msk & ((value) << SPI_MR_PCS_Pos))) -#define SPI_MR_DLYBCS_Pos 24 -#define SPI_MR_DLYBCS_Msk (0xffu << SPI_MR_DLYBCS_Pos) /**< \brief (SPI_MR) Delay Between Chip Selects */ -#define SPI_MR_DLYBCS(value) ((SPI_MR_DLYBCS_Msk & ((value) << SPI_MR_DLYBCS_Pos))) -/* -------- SPI_RDR : (SPI Offset: 0x08) Receive Data Register -------- */ -#define SPI_RDR_RD_Pos 0 -#define SPI_RDR_RD_Msk (0xffffu << SPI_RDR_RD_Pos) /**< \brief (SPI_RDR) Receive Data */ -#define SPI_RDR_PCS_Pos 16 -#define SPI_RDR_PCS_Msk (0xfu << SPI_RDR_PCS_Pos) /**< \brief (SPI_RDR) Peripheral Chip Select */ -/* -------- SPI_TDR : (SPI Offset: 0x0C) Transmit Data Register -------- */ -#define SPI_TDR_TD_Pos 0 -#define SPI_TDR_TD_Msk (0xffffu << SPI_TDR_TD_Pos) /**< \brief (SPI_TDR) Transmit Data */ -#define SPI_TDR_TD(value) ((SPI_TDR_TD_Msk & ((value) << SPI_TDR_TD_Pos))) -#define SPI_TDR_PCS_Pos 16 -#define SPI_TDR_PCS_Msk (0xfu << SPI_TDR_PCS_Pos) /**< \brief (SPI_TDR) Peripheral Chip Select */ -#define SPI_TDR_PCS(value) ((SPI_TDR_PCS_Msk & ((value) << SPI_TDR_PCS_Pos))) -#define SPI_TDR_LASTXFER (0x1u << 24) /**< \brief (SPI_TDR) Last Transfer */ -/* -------- SPI_SR : (SPI Offset: 0x10) Status Register -------- */ -#define SPI_SR_RDRF (0x1u << 0) /**< \brief (SPI_SR) Receive Data Register Full (cleared by reading SPI_RDR) */ -#define SPI_SR_TDRE (0x1u << 1) /**< \brief (SPI_SR) Transmit Data Register Empty (cleared by writing SPI_TDR) */ -#define SPI_SR_MODF (0x1u << 2) /**< \brief (SPI_SR) Mode Fault Error (cleared on read) */ -#define SPI_SR_OVRES (0x1u << 3) /**< \brief (SPI_SR) Overrun Error Status (cleared on read) */ -#define SPI_SR_NSSR (0x1u << 8) /**< \brief (SPI_SR) NSS Rising (cleared on read) */ -#define SPI_SR_TXEMPTY (0x1u << 9) /**< \brief (SPI_SR) Transmission Registers Empty (cleared by writing SPI_TDR) */ -#define SPI_SR_UNDES (0x1u << 10) /**< \brief (SPI_SR) Underrun Error Status (Slave mode only) (cleared on read) */ -#define SPI_SR_SPIENS (0x1u << 16) /**< \brief (SPI_SR) SPI Enable Status */ -/* -------- SPI_IER : (SPI Offset: 0x14) Interrupt Enable Register -------- */ -#define SPI_IER_RDRF (0x1u << 0) /**< \brief (SPI_IER) Receive Data Register Full Interrupt Enable */ -#define SPI_IER_TDRE (0x1u << 1) /**< \brief (SPI_IER) SPI Transmit Data Register Empty Interrupt Enable */ -#define SPI_IER_MODF (0x1u << 2) /**< \brief (SPI_IER) Mode Fault Error Interrupt Enable */ -#define SPI_IER_OVRES (0x1u << 3) /**< \brief (SPI_IER) Overrun Error Interrupt Enable */ -#define SPI_IER_NSSR (0x1u << 8) /**< \brief (SPI_IER) NSS Rising Interrupt Enable */ -#define SPI_IER_TXEMPTY (0x1u << 9) /**< \brief (SPI_IER) Transmission Registers Empty Enable */ -#define SPI_IER_UNDES (0x1u << 10) /**< \brief (SPI_IER) Underrun Error Interrupt Enable */ -/* -------- SPI_IDR : (SPI Offset: 0x18) Interrupt Disable Register -------- */ -#define SPI_IDR_RDRF (0x1u << 0) /**< \brief (SPI_IDR) Receive Data Register Full Interrupt Disable */ -#define SPI_IDR_TDRE (0x1u << 1) /**< \brief (SPI_IDR) SPI Transmit Data Register Empty Interrupt Disable */ -#define SPI_IDR_MODF (0x1u << 2) /**< \brief (SPI_IDR) Mode Fault Error Interrupt Disable */ -#define SPI_IDR_OVRES (0x1u << 3) /**< \brief (SPI_IDR) Overrun Error Interrupt Disable */ -#define SPI_IDR_NSSR (0x1u << 8) /**< \brief (SPI_IDR) NSS Rising Interrupt Disable */ -#define SPI_IDR_TXEMPTY (0x1u << 9) /**< \brief (SPI_IDR) Transmission Registers Empty Disable */ -#define SPI_IDR_UNDES (0x1u << 10) /**< \brief (SPI_IDR) Underrun Error Interrupt Disable */ -/* -------- SPI_IMR : (SPI Offset: 0x1C) Interrupt Mask Register -------- */ -#define SPI_IMR_RDRF (0x1u << 0) /**< \brief (SPI_IMR) Receive Data Register Full Interrupt Mask */ -#define SPI_IMR_TDRE (0x1u << 1) /**< \brief (SPI_IMR) SPI Transmit Data Register Empty Interrupt Mask */ -#define SPI_IMR_MODF (0x1u << 2) /**< \brief (SPI_IMR) Mode Fault Error Interrupt Mask */ -#define SPI_IMR_OVRES (0x1u << 3) /**< \brief (SPI_IMR) Overrun Error Interrupt Mask */ -#define SPI_IMR_NSSR (0x1u << 8) /**< \brief (SPI_IMR) NSS Rising Interrupt Mask */ -#define SPI_IMR_TXEMPTY (0x1u << 9) /**< \brief (SPI_IMR) Transmission Registers Empty Mask */ -#define SPI_IMR_UNDES (0x1u << 10) /**< \brief (SPI_IMR) Underrun Error Interrupt Mask */ -/* -------- SPI_CSR[4] : (SPI Offset: 0x30) Chip Select Register -------- */ -#define SPI_CSR_CPOL (0x1u << 0) /**< \brief (SPI_CSR[4]) Clock Polarity */ -#define SPI_CSR_NCPHA (0x1u << 1) /**< \brief (SPI_CSR[4]) Clock Phase */ -#define SPI_CSR_CSNAAT (0x1u << 2) /**< \brief (SPI_CSR[4]) Chip Select Not Active After Transfer (Ignored if CSAAT = 1) */ -#define SPI_CSR_CSAAT (0x1u << 3) /**< \brief (SPI_CSR[4]) Chip Select Active After Transfer */ -#define SPI_CSR_BITS_Pos 4 -#define SPI_CSR_BITS_Msk (0xfu << SPI_CSR_BITS_Pos) /**< \brief (SPI_CSR[4]) Bits Per Transfer */ -#define SPI_CSR_BITS(value) ((SPI_CSR_BITS_Msk & ((value) << SPI_CSR_BITS_Pos))) -#define SPI_CSR_BITS_8_BIT (0x0u << 4) /**< \brief (SPI_CSR[4]) 8 bits for transfer */ -#define SPI_CSR_BITS_9_BIT (0x1u << 4) /**< \brief (SPI_CSR[4]) 9 bits for transfer */ -#define SPI_CSR_BITS_10_BIT (0x2u << 4) /**< \brief (SPI_CSR[4]) 10 bits for transfer */ -#define SPI_CSR_BITS_11_BIT (0x3u << 4) /**< \brief (SPI_CSR[4]) 11 bits for transfer */ -#define SPI_CSR_BITS_12_BIT (0x4u << 4) /**< \brief (SPI_CSR[4]) 12 bits for transfer */ -#define SPI_CSR_BITS_13_BIT (0x5u << 4) /**< \brief (SPI_CSR[4]) 13 bits for transfer */ -#define SPI_CSR_BITS_14_BIT (0x6u << 4) /**< \brief (SPI_CSR[4]) 14 bits for transfer */ -#define SPI_CSR_BITS_15_BIT (0x7u << 4) /**< \brief (SPI_CSR[4]) 15 bits for transfer */ -#define SPI_CSR_BITS_16_BIT (0x8u << 4) /**< \brief (SPI_CSR[4]) 16 bits for transfer */ -#define SPI_CSR_SCBR_Pos 8 -#define SPI_CSR_SCBR_Msk (0xffu << SPI_CSR_SCBR_Pos) /**< \brief (SPI_CSR[4]) Serial Clock Bit Rate */ -#define SPI_CSR_SCBR(value) ((SPI_CSR_SCBR_Msk & ((value) << SPI_CSR_SCBR_Pos))) -#define SPI_CSR_DLYBS_Pos 16 -#define SPI_CSR_DLYBS_Msk (0xffu << SPI_CSR_DLYBS_Pos) /**< \brief (SPI_CSR[4]) Delay Before SPCK */ -#define SPI_CSR_DLYBS(value) ((SPI_CSR_DLYBS_Msk & ((value) << SPI_CSR_DLYBS_Pos))) -#define SPI_CSR_DLYBCT_Pos 24 -#define SPI_CSR_DLYBCT_Msk (0xffu << SPI_CSR_DLYBCT_Pos) /**< \brief (SPI_CSR[4]) Delay Between Consecutive Transfers */ -#define SPI_CSR_DLYBCT(value) ((SPI_CSR_DLYBCT_Msk & ((value) << SPI_CSR_DLYBCT_Pos))) -/* -------- SPI_WPMR : (SPI Offset: 0xE4) Write Protection Mode Register -------- */ -#define SPI_WPMR_WPEN (0x1u << 0) /**< \brief (SPI_WPMR) Write Protection Enable */ -#define SPI_WPMR_WPKEY_Pos 8 -#define SPI_WPMR_WPKEY_Msk (0xffffffu << SPI_WPMR_WPKEY_Pos) /**< \brief (SPI_WPMR) Write Protection Key */ -#define SPI_WPMR_WPKEY(value) ((SPI_WPMR_WPKEY_Msk & ((value) << SPI_WPMR_WPKEY_Pos))) -#define SPI_WPMR_WPKEY_PASSWD (0x535049u << 8) /**< \brief (SPI_WPMR) Writing any other value in this field aborts the write operation of the WPEN bit.Always reads as 0. */ -/* -------- SPI_WPSR : (SPI Offset: 0xE8) Write Protection Status Register -------- */ -#define SPI_WPSR_WPVS (0x1u << 0) /**< \brief (SPI_WPSR) Write Protection Violation Status */ -#define SPI_WPSR_WPVSRC_Pos 8 -#define SPI_WPSR_WPVSRC_Msk (0xffu << SPI_WPSR_WPVSRC_Pos) /**< \brief (SPI_WPSR) Write Protection Violation Source */ - -/*@}*/ - - -#endif /* _SAMV71_SPI_COMPONENT_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_ssc.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_ssc.h deleted file mode 100644 index e95900ae..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_ssc.h +++ /dev/null @@ -1,280 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_SSC_COMPONENT_ -#define _SAMV71_SSC_COMPONENT_ - -/* ============================================================================= */ -/** SOFTWARE API DEFINITION FOR Synchronous Serial Controller */ -/* ============================================================================= */ -/** \addtogroup SAMV71_SSC Synchronous Serial Controller */ -/*@{*/ - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -/** \brief Ssc hardware registers */ -typedef struct { - __O uint32_t SSC_CR; /**< \brief (Ssc Offset: 0x0) Control Register */ - __IO uint32_t SSC_CMR; /**< \brief (Ssc Offset: 0x4) Clock Mode Register */ - __I uint32_t Reserved1[2]; - __IO uint32_t SSC_RCMR; /**< \brief (Ssc Offset: 0x10) Receive Clock Mode Register */ - __IO uint32_t SSC_RFMR; /**< \brief (Ssc Offset: 0x14) Receive Frame Mode Register */ - __IO uint32_t SSC_TCMR; /**< \brief (Ssc Offset: 0x18) Transmit Clock Mode Register */ - __IO uint32_t SSC_TFMR; /**< \brief (Ssc Offset: 0x1C) Transmit Frame Mode Register */ - __I uint32_t SSC_RHR; /**< \brief (Ssc Offset: 0x20) Receive Holding Register */ - __O uint32_t SSC_THR; /**< \brief (Ssc Offset: 0x24) Transmit Holding Register */ - __I uint32_t Reserved2[2]; - __I uint32_t SSC_RSHR; /**< \brief (Ssc Offset: 0x30) Receive Sync. Holding Register */ - __IO uint32_t SSC_TSHR; /**< \brief (Ssc Offset: 0x34) Transmit Sync. Holding Register */ - __IO uint32_t SSC_RC0R; /**< \brief (Ssc Offset: 0x38) Receive Compare 0 Register */ - __IO uint32_t SSC_RC1R; /**< \brief (Ssc Offset: 0x3C) Receive Compare 1 Register */ - __I uint32_t SSC_SR; /**< \brief (Ssc Offset: 0x40) Status Register */ - __O uint32_t SSC_IER; /**< \brief (Ssc Offset: 0x44) Interrupt Enable Register */ - __O uint32_t SSC_IDR; /**< \brief (Ssc Offset: 0x48) Interrupt Disable Register */ - __I uint32_t SSC_IMR; /**< \brief (Ssc Offset: 0x4C) Interrupt Mask Register */ - __I uint32_t Reserved3[37]; - __IO uint32_t SSC_WPMR; /**< \brief (Ssc Offset: 0xE4) Write Protection Mode Register */ - __I uint32_t SSC_WPSR; /**< \brief (Ssc Offset: 0xE8) Write Protection Status Register */ -} Ssc; -#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/* -------- SSC_CR : (SSC Offset: 0x0) Control Register -------- */ -#define SSC_CR_RXEN (0x1u << 0) /**< \brief (SSC_CR) Receive Enable */ -#define SSC_CR_RXDIS (0x1u << 1) /**< \brief (SSC_CR) Receive Disable */ -#define SSC_CR_TXEN (0x1u << 8) /**< \brief (SSC_CR) Transmit Enable */ -#define SSC_CR_TXDIS (0x1u << 9) /**< \brief (SSC_CR) Transmit Disable */ -#define SSC_CR_SWRST (0x1u << 15) /**< \brief (SSC_CR) Software Reset */ -/* -------- SSC_CMR : (SSC Offset: 0x4) Clock Mode Register -------- */ -#define SSC_CMR_DIV_Pos 0 -#define SSC_CMR_DIV_Msk (0xfffu << SSC_CMR_DIV_Pos) /**< \brief (SSC_CMR) Clock Divider */ -#define SSC_CMR_DIV(value) ((SSC_CMR_DIV_Msk & ((value) << SSC_CMR_DIV_Pos))) -/* -------- SSC_RCMR : (SSC Offset: 0x10) Receive Clock Mode Register -------- */ -#define SSC_RCMR_CKS_Pos 0 -#define SSC_RCMR_CKS_Msk (0x3u << SSC_RCMR_CKS_Pos) /**< \brief (SSC_RCMR) Receive Clock Selection */ -#define SSC_RCMR_CKS(value) ((SSC_RCMR_CKS_Msk & ((value) << SSC_RCMR_CKS_Pos))) -#define SSC_RCMR_CKS_MCK (0x0u << 0) /**< \brief (SSC_RCMR) Divided Clock */ -#define SSC_RCMR_CKS_TK (0x1u << 0) /**< \brief (SSC_RCMR) TK Clock signal */ -#define SSC_RCMR_CKS_RK (0x2u << 0) /**< \brief (SSC_RCMR) RK pin */ -#define SSC_RCMR_CKO_Pos 2 -#define SSC_RCMR_CKO_Msk (0x7u << SSC_RCMR_CKO_Pos) /**< \brief (SSC_RCMR) Receive Clock Output Mode Selection */ -#define SSC_RCMR_CKO(value) ((SSC_RCMR_CKO_Msk & ((value) << SSC_RCMR_CKO_Pos))) -#define SSC_RCMR_CKO_NONE (0x0u << 2) /**< \brief (SSC_RCMR) None, RK pin is an input */ -#define SSC_RCMR_CKO_CONTINUOUS (0x1u << 2) /**< \brief (SSC_RCMR) Continuous Receive Clock, RK pin is an output */ -#define SSC_RCMR_CKO_TRANSFER (0x2u << 2) /**< \brief (SSC_RCMR) Receive Clock only during data transfers, RK pin is an output */ -#define SSC_RCMR_CKI (0x1u << 5) /**< \brief (SSC_RCMR) Receive Clock Inversion */ -#define SSC_RCMR_CKG_Pos 6 -#define SSC_RCMR_CKG_Msk (0x3u << SSC_RCMR_CKG_Pos) /**< \brief (SSC_RCMR) Receive Clock Gating Selection */ -#define SSC_RCMR_CKG(value) ((SSC_RCMR_CKG_Msk & ((value) << SSC_RCMR_CKG_Pos))) -#define SSC_RCMR_CKG_CONTINUOUS (0x0u << 6) /**< \brief (SSC_RCMR) None */ -#define SSC_RCMR_CKG_EN_RF_LOW (0x1u << 6) /**< \brief (SSC_RCMR) Receive Clock enabled only if RF Low */ -#define SSC_RCMR_CKG_EN_RF_HIGH (0x2u << 6) /**< \brief (SSC_RCMR) Receive Clock enabled only if RF High */ -#define SSC_RCMR_START_Pos 8 -#define SSC_RCMR_START_Msk (0xfu << SSC_RCMR_START_Pos) /**< \brief (SSC_RCMR) Receive Start Selection */ -#define SSC_RCMR_START(value) ((SSC_RCMR_START_Msk & ((value) << SSC_RCMR_START_Pos))) -#define SSC_RCMR_START_CONTINUOUS (0x0u << 8) /**< \brief (SSC_RCMR) Continuous, as soon as the receiver is enabled, and immediately after the end of transfer of the previous data. */ -#define SSC_RCMR_START_TRANSMIT (0x1u << 8) /**< \brief (SSC_RCMR) Transmit start */ -#define SSC_RCMR_START_RF_LOW (0x2u << 8) /**< \brief (SSC_RCMR) Detection of a low level on RF signal */ -#define SSC_RCMR_START_RF_HIGH (0x3u << 8) /**< \brief (SSC_RCMR) Detection of a high level on RF signal */ -#define SSC_RCMR_START_RF_FALLING (0x4u << 8) /**< \brief (SSC_RCMR) Detection of a falling edge on RF signal */ -#define SSC_RCMR_START_RF_RISING (0x5u << 8) /**< \brief (SSC_RCMR) Detection of a rising edge on RF signal */ -#define SSC_RCMR_START_RF_LEVEL (0x6u << 8) /**< \brief (SSC_RCMR) Detection of any level change on RF signal */ -#define SSC_RCMR_START_RF_EDGE (0x7u << 8) /**< \brief (SSC_RCMR) Detection of any edge on RF signal */ -#define SSC_RCMR_START_CMP_0 (0x8u << 8) /**< \brief (SSC_RCMR) Compare 0 */ -#define SSC_RCMR_STOP (0x1u << 12) /**< \brief (SSC_RCMR) Receive Stop Selection */ -#define SSC_RCMR_STTDLY_Pos 16 -#define SSC_RCMR_STTDLY_Msk (0xffu << SSC_RCMR_STTDLY_Pos) /**< \brief (SSC_RCMR) Receive Start Delay */ -#define SSC_RCMR_STTDLY(value) ((SSC_RCMR_STTDLY_Msk & ((value) << SSC_RCMR_STTDLY_Pos))) -#define SSC_RCMR_PERIOD_Pos 24 -#define SSC_RCMR_PERIOD_Msk (0xffu << SSC_RCMR_PERIOD_Pos) /**< \brief (SSC_RCMR) Receive Period Divider Selection */ -#define SSC_RCMR_PERIOD(value) ((SSC_RCMR_PERIOD_Msk & ((value) << SSC_RCMR_PERIOD_Pos))) -/* -------- SSC_RFMR : (SSC Offset: 0x14) Receive Frame Mode Register -------- */ -#define SSC_RFMR_DATLEN_Pos 0 -#define SSC_RFMR_DATLEN_Msk (0x1fu << SSC_RFMR_DATLEN_Pos) /**< \brief (SSC_RFMR) Data Length */ -#define SSC_RFMR_DATLEN(value) ((SSC_RFMR_DATLEN_Msk & ((value) << SSC_RFMR_DATLEN_Pos))) -#define SSC_RFMR_LOOP (0x1u << 5) /**< \brief (SSC_RFMR) Loop Mode */ -#define SSC_RFMR_MSBF (0x1u << 7) /**< \brief (SSC_RFMR) Most Significant Bit First */ -#define SSC_RFMR_DATNB_Pos 8 -#define SSC_RFMR_DATNB_Msk (0xfu << SSC_RFMR_DATNB_Pos) /**< \brief (SSC_RFMR) Data Number per Frame */ -#define SSC_RFMR_DATNB(value) ((SSC_RFMR_DATNB_Msk & ((value) << SSC_RFMR_DATNB_Pos))) -#define SSC_RFMR_FSLEN_Pos 16 -#define SSC_RFMR_FSLEN_Msk (0xfu << SSC_RFMR_FSLEN_Pos) /**< \brief (SSC_RFMR) Receive Frame Sync Length */ -#define SSC_RFMR_FSLEN(value) ((SSC_RFMR_FSLEN_Msk & ((value) << SSC_RFMR_FSLEN_Pos))) -#define SSC_RFMR_FSOS_Pos 20 -#define SSC_RFMR_FSOS_Msk (0x7u << SSC_RFMR_FSOS_Pos) /**< \brief (SSC_RFMR) Receive Frame Sync Output Selection */ -#define SSC_RFMR_FSOS(value) ((SSC_RFMR_FSOS_Msk & ((value) << SSC_RFMR_FSOS_Pos))) -#define SSC_RFMR_FSOS_NONE (0x0u << 20) /**< \brief (SSC_RFMR) None, RF pin is an input */ -#define SSC_RFMR_FSOS_NEGATIVE (0x1u << 20) /**< \brief (SSC_RFMR) Negative Pulse, RF pin is an output */ -#define SSC_RFMR_FSOS_POSITIVE (0x2u << 20) /**< \brief (SSC_RFMR) Positive Pulse, RF pin is an output */ -#define SSC_RFMR_FSOS_LOW (0x3u << 20) /**< \brief (SSC_RFMR) Driven Low during data transfer, RF pin is an output */ -#define SSC_RFMR_FSOS_HIGH (0x4u << 20) /**< \brief (SSC_RFMR) Driven High during data transfer, RF pin is an output */ -#define SSC_RFMR_FSOS_TOGGLING (0x5u << 20) /**< \brief (SSC_RFMR) Toggling at each start of data transfer, RF pin is an output */ -#define SSC_RFMR_FSEDGE (0x1u << 24) /**< \brief (SSC_RFMR) Frame Sync Edge Detection */ -#define SSC_RFMR_FSEDGE_POSITIVE (0x0u << 24) /**< \brief (SSC_RFMR) Positive Edge Detection */ -#define SSC_RFMR_FSEDGE_NEGATIVE (0x1u << 24) /**< \brief (SSC_RFMR) Negative Edge Detection */ -#define SSC_RFMR_FSLEN_EXT_Pos 28 -#define SSC_RFMR_FSLEN_EXT_Msk (0xfu << SSC_RFMR_FSLEN_EXT_Pos) /**< \brief (SSC_RFMR) FSLEN Field Extension */ -#define SSC_RFMR_FSLEN_EXT(value) ((SSC_RFMR_FSLEN_EXT_Msk & ((value) << SSC_RFMR_FSLEN_EXT_Pos))) -/* -------- SSC_TCMR : (SSC Offset: 0x18) Transmit Clock Mode Register -------- */ -#define SSC_TCMR_CKS_Pos 0 -#define SSC_TCMR_CKS_Msk (0x3u << SSC_TCMR_CKS_Pos) /**< \brief (SSC_TCMR) Transmit Clock Selection */ -#define SSC_TCMR_CKS(value) ((SSC_TCMR_CKS_Msk & ((value) << SSC_TCMR_CKS_Pos))) -#define SSC_TCMR_CKS_MCK (0x0u << 0) /**< \brief (SSC_TCMR) Divided Clock */ -#define SSC_TCMR_CKS_RK (0x1u << 0) /**< \brief (SSC_TCMR) RK Clock signal */ -#define SSC_TCMR_CKS_TK (0x2u << 0) /**< \brief (SSC_TCMR) TK pin */ -#define SSC_TCMR_CKO_Pos 2 -#define SSC_TCMR_CKO_Msk (0x7u << SSC_TCMR_CKO_Pos) /**< \brief (SSC_TCMR) Transmit Clock Output Mode Selection */ -#define SSC_TCMR_CKO(value) ((SSC_TCMR_CKO_Msk & ((value) << SSC_TCMR_CKO_Pos))) -#define SSC_TCMR_CKO_NONE (0x0u << 2) /**< \brief (SSC_TCMR) None, TK pin is an input */ -#define SSC_TCMR_CKO_CONTINUOUS (0x1u << 2) /**< \brief (SSC_TCMR) Continuous Transmit Clock, TK pin is an output */ -#define SSC_TCMR_CKO_TRANSFER (0x2u << 2) /**< \brief (SSC_TCMR) Transmit Clock only during data transfers, TK pin is an output */ -#define SSC_TCMR_CKI (0x1u << 5) /**< \brief (SSC_TCMR) Transmit Clock Inversion */ -#define SSC_TCMR_CKG_Pos 6 -#define SSC_TCMR_CKG_Msk (0x3u << SSC_TCMR_CKG_Pos) /**< \brief (SSC_TCMR) Transmit Clock Gating Selection */ -#define SSC_TCMR_CKG(value) ((SSC_TCMR_CKG_Msk & ((value) << SSC_TCMR_CKG_Pos))) -#define SSC_TCMR_CKG_CONTINUOUS (0x0u << 6) /**< \brief (SSC_TCMR) None */ -#define SSC_TCMR_CKG_EN_TF_LOW (0x1u << 6) /**< \brief (SSC_TCMR) Transmit Clock enabled only if TF Low */ -#define SSC_TCMR_CKG_EN_TF_HIGH (0x2u << 6) /**< \brief (SSC_TCMR) Transmit Clock enabled only if TF High */ -#define SSC_TCMR_START_Pos 8 -#define SSC_TCMR_START_Msk (0xfu << SSC_TCMR_START_Pos) /**< \brief (SSC_TCMR) Transmit Start Selection */ -#define SSC_TCMR_START(value) ((SSC_TCMR_START_Msk & ((value) << SSC_TCMR_START_Pos))) -#define SSC_TCMR_START_CONTINUOUS (0x0u << 8) /**< \brief (SSC_TCMR) Continuous, as soon as a word is written in the SSC_THR (if Transmit is enabled), and immediately after the end of transfer of the previous data */ -#define SSC_TCMR_START_RECEIVE (0x1u << 8) /**< \brief (SSC_TCMR) Receive start */ -#define SSC_TCMR_START_TF_LOW (0x2u << 8) /**< \brief (SSC_TCMR) Detection of a low level on TF signal */ -#define SSC_TCMR_START_TF_HIGH (0x3u << 8) /**< \brief (SSC_TCMR) Detection of a high level on TF signal */ -#define SSC_TCMR_START_TF_FALLING (0x4u << 8) /**< \brief (SSC_TCMR) Detection of a falling edge on TF signal */ -#define SSC_TCMR_START_TF_RISING (0x5u << 8) /**< \brief (SSC_TCMR) Detection of a rising edge on TF signal */ -#define SSC_TCMR_START_TF_LEVEL (0x6u << 8) /**< \brief (SSC_TCMR) Detection of any level change on TF signal */ -#define SSC_TCMR_START_TF_EDGE (0x7u << 8) /**< \brief (SSC_TCMR) Detection of any edge on TF signal */ -#define SSC_TCMR_STTDLY_Pos 16 -#define SSC_TCMR_STTDLY_Msk (0xffu << SSC_TCMR_STTDLY_Pos) /**< \brief (SSC_TCMR) Transmit Start Delay */ -#define SSC_TCMR_STTDLY(value) ((SSC_TCMR_STTDLY_Msk & ((value) << SSC_TCMR_STTDLY_Pos))) -#define SSC_TCMR_PERIOD_Pos 24 -#define SSC_TCMR_PERIOD_Msk (0xffu << SSC_TCMR_PERIOD_Pos) /**< \brief (SSC_TCMR) Transmit Period Divider Selection */ -#define SSC_TCMR_PERIOD(value) ((SSC_TCMR_PERIOD_Msk & ((value) << SSC_TCMR_PERIOD_Pos))) -/* -------- SSC_TFMR : (SSC Offset: 0x1C) Transmit Frame Mode Register -------- */ -#define SSC_TFMR_DATLEN_Pos 0 -#define SSC_TFMR_DATLEN_Msk (0x1fu << SSC_TFMR_DATLEN_Pos) /**< \brief (SSC_TFMR) Data Length */ -#define SSC_TFMR_DATLEN(value) ((SSC_TFMR_DATLEN_Msk & ((value) << SSC_TFMR_DATLEN_Pos))) -#define SSC_TFMR_DATDEF (0x1u << 5) /**< \brief (SSC_TFMR) Data Default Value */ -#define SSC_TFMR_MSBF (0x1u << 7) /**< \brief (SSC_TFMR) Most Significant Bit First */ -#define SSC_TFMR_DATNB_Pos 8 -#define SSC_TFMR_DATNB_Msk (0xfu << SSC_TFMR_DATNB_Pos) /**< \brief (SSC_TFMR) Data Number per Frame */ -#define SSC_TFMR_DATNB(value) ((SSC_TFMR_DATNB_Msk & ((value) << SSC_TFMR_DATNB_Pos))) -#define SSC_TFMR_FSLEN_Pos 16 -#define SSC_TFMR_FSLEN_Msk (0xfu << SSC_TFMR_FSLEN_Pos) /**< \brief (SSC_TFMR) Transmit Frame Sync Length */ -#define SSC_TFMR_FSLEN(value) ((SSC_TFMR_FSLEN_Msk & ((value) << SSC_TFMR_FSLEN_Pos))) -#define SSC_TFMR_FSOS_Pos 20 -#define SSC_TFMR_FSOS_Msk (0x7u << SSC_TFMR_FSOS_Pos) /**< \brief (SSC_TFMR) Transmit Frame Sync Output Selection */ -#define SSC_TFMR_FSOS(value) ((SSC_TFMR_FSOS_Msk & ((value) << SSC_TFMR_FSOS_Pos))) -#define SSC_TFMR_FSOS_NONE (0x0u << 20) /**< \brief (SSC_TFMR) None, TF pin is an input */ -#define SSC_TFMR_FSOS_NEGATIVE (0x1u << 20) /**< \brief (SSC_TFMR) Negative Pulse, TF pin is an output */ -#define SSC_TFMR_FSOS_POSITIVE (0x2u << 20) /**< \brief (SSC_TFMR) Positive Pulse, TF pin is an output */ -#define SSC_TFMR_FSOS_LOW (0x3u << 20) /**< \brief (SSC_TFMR) Driven Low during data transfer */ -#define SSC_TFMR_FSOS_HIGH (0x4u << 20) /**< \brief (SSC_TFMR) Driven High during data transfer */ -#define SSC_TFMR_FSOS_TOGGLING (0x5u << 20) /**< \brief (SSC_TFMR) Toggling at each start of data transfer */ -#define SSC_TFMR_FSDEN (0x1u << 23) /**< \brief (SSC_TFMR) Frame Sync Data Enable */ -#define SSC_TFMR_FSEDGE (0x1u << 24) /**< \brief (SSC_TFMR) Frame Sync Edge Detection */ -#define SSC_TFMR_FSEDGE_POSITIVE (0x0u << 24) /**< \brief (SSC_TFMR) Positive Edge Detection */ -#define SSC_TFMR_FSEDGE_NEGATIVE (0x1u << 24) /**< \brief (SSC_TFMR) Negative Edge Detection */ -#define SSC_TFMR_FSLEN_EXT_Pos 28 -#define SSC_TFMR_FSLEN_EXT_Msk (0xfu << SSC_TFMR_FSLEN_EXT_Pos) /**< \brief (SSC_TFMR) FSLEN Field Extension */ -#define SSC_TFMR_FSLEN_EXT(value) ((SSC_TFMR_FSLEN_EXT_Msk & ((value) << SSC_TFMR_FSLEN_EXT_Pos))) -/* -------- SSC_RHR : (SSC Offset: 0x20) Receive Holding Register -------- */ -#define SSC_RHR_RDAT_Pos 0 -#define SSC_RHR_RDAT_Msk (0xffffffffu << SSC_RHR_RDAT_Pos) /**< \brief (SSC_RHR) Receive Data */ -/* -------- SSC_THR : (SSC Offset: 0x24) Transmit Holding Register -------- */ -#define SSC_THR_TDAT_Pos 0 -#define SSC_THR_TDAT_Msk (0xffffffffu << SSC_THR_TDAT_Pos) /**< \brief (SSC_THR) Transmit Data */ -#define SSC_THR_TDAT(value) ((SSC_THR_TDAT_Msk & ((value) << SSC_THR_TDAT_Pos))) -/* -------- SSC_RSHR : (SSC Offset: 0x30) Receive Sync. Holding Register -------- */ -#define SSC_RSHR_RSDAT_Pos 0 -#define SSC_RSHR_RSDAT_Msk (0xffffu << SSC_RSHR_RSDAT_Pos) /**< \brief (SSC_RSHR) Receive Synchronization Data */ -/* -------- SSC_TSHR : (SSC Offset: 0x34) Transmit Sync. Holding Register -------- */ -#define SSC_TSHR_TSDAT_Pos 0 -#define SSC_TSHR_TSDAT_Msk (0xffffu << SSC_TSHR_TSDAT_Pos) /**< \brief (SSC_TSHR) Transmit Synchronization Data */ -#define SSC_TSHR_TSDAT(value) ((SSC_TSHR_TSDAT_Msk & ((value) << SSC_TSHR_TSDAT_Pos))) -/* -------- SSC_RC0R : (SSC Offset: 0x38) Receive Compare 0 Register -------- */ -#define SSC_RC0R_CP0_Pos 0 -#define SSC_RC0R_CP0_Msk (0xffffu << SSC_RC0R_CP0_Pos) /**< \brief (SSC_RC0R) Receive Compare Data 0 */ -#define SSC_RC0R_CP0(value) ((SSC_RC0R_CP0_Msk & ((value) << SSC_RC0R_CP0_Pos))) -/* -------- SSC_RC1R : (SSC Offset: 0x3C) Receive Compare 1 Register -------- */ -#define SSC_RC1R_CP1_Pos 0 -#define SSC_RC1R_CP1_Msk (0xffffu << SSC_RC1R_CP1_Pos) /**< \brief (SSC_RC1R) Receive Compare Data 1 */ -#define SSC_RC1R_CP1(value) ((SSC_RC1R_CP1_Msk & ((value) << SSC_RC1R_CP1_Pos))) -/* -------- SSC_SR : (SSC Offset: 0x40) Status Register -------- */ -#define SSC_SR_TXRDY (0x1u << 0) /**< \brief (SSC_SR) Transmit Ready */ -#define SSC_SR_TXEMPTY (0x1u << 1) /**< \brief (SSC_SR) Transmit Empty */ -#define SSC_SR_RXRDY (0x1u << 4) /**< \brief (SSC_SR) Receive Ready */ -#define SSC_SR_OVRUN (0x1u << 5) /**< \brief (SSC_SR) Receive Overrun */ -#define SSC_SR_CP0 (0x1u << 8) /**< \brief (SSC_SR) Compare 0 */ -#define SSC_SR_CP1 (0x1u << 9) /**< \brief (SSC_SR) Compare 1 */ -#define SSC_SR_TXSYN (0x1u << 10) /**< \brief (SSC_SR) Transmit Sync */ -#define SSC_SR_RXSYN (0x1u << 11) /**< \brief (SSC_SR) Receive Sync */ -#define SSC_SR_TXEN (0x1u << 16) /**< \brief (SSC_SR) Transmit Enable */ -#define SSC_SR_RXEN (0x1u << 17) /**< \brief (SSC_SR) Receive Enable */ -/* -------- SSC_IER : (SSC Offset: 0x44) Interrupt Enable Register -------- */ -#define SSC_IER_TXRDY (0x1u << 0) /**< \brief (SSC_IER) Transmit Ready Interrupt Enable */ -#define SSC_IER_TXEMPTY (0x1u << 1) /**< \brief (SSC_IER) Transmit Empty Interrupt Enable */ -#define SSC_IER_RXRDY (0x1u << 4) /**< \brief (SSC_IER) Receive Ready Interrupt Enable */ -#define SSC_IER_OVRUN (0x1u << 5) /**< \brief (SSC_IER) Receive Overrun Interrupt Enable */ -#define SSC_IER_CP0 (0x1u << 8) /**< \brief (SSC_IER) Compare 0 Interrupt Enable */ -#define SSC_IER_CP1 (0x1u << 9) /**< \brief (SSC_IER) Compare 1 Interrupt Enable */ -#define SSC_IER_TXSYN (0x1u << 10) /**< \brief (SSC_IER) Tx Sync Interrupt Enable */ -#define SSC_IER_RXSYN (0x1u << 11) /**< \brief (SSC_IER) Rx Sync Interrupt Enable */ -/* -------- SSC_IDR : (SSC Offset: 0x48) Interrupt Disable Register -------- */ -#define SSC_IDR_TXRDY (0x1u << 0) /**< \brief (SSC_IDR) Transmit Ready Interrupt Disable */ -#define SSC_IDR_TXEMPTY (0x1u << 1) /**< \brief (SSC_IDR) Transmit Empty Interrupt Disable */ -#define SSC_IDR_RXRDY (0x1u << 4) /**< \brief (SSC_IDR) Receive Ready Interrupt Disable */ -#define SSC_IDR_OVRUN (0x1u << 5) /**< \brief (SSC_IDR) Receive Overrun Interrupt Disable */ -#define SSC_IDR_CP0 (0x1u << 8) /**< \brief (SSC_IDR) Compare 0 Interrupt Disable */ -#define SSC_IDR_CP1 (0x1u << 9) /**< \brief (SSC_IDR) Compare 1 Interrupt Disable */ -#define SSC_IDR_TXSYN (0x1u << 10) /**< \brief (SSC_IDR) Tx Sync Interrupt Enable */ -#define SSC_IDR_RXSYN (0x1u << 11) /**< \brief (SSC_IDR) Rx Sync Interrupt Enable */ -/* -------- SSC_IMR : (SSC Offset: 0x4C) Interrupt Mask Register -------- */ -#define SSC_IMR_TXRDY (0x1u << 0) /**< \brief (SSC_IMR) Transmit Ready Interrupt Mask */ -#define SSC_IMR_TXEMPTY (0x1u << 1) /**< \brief (SSC_IMR) Transmit Empty Interrupt Mask */ -#define SSC_IMR_RXRDY (0x1u << 4) /**< \brief (SSC_IMR) Receive Ready Interrupt Mask */ -#define SSC_IMR_OVRUN (0x1u << 5) /**< \brief (SSC_IMR) Receive Overrun Interrupt Mask */ -#define SSC_IMR_CP0 (0x1u << 8) /**< \brief (SSC_IMR) Compare 0 Interrupt Mask */ -#define SSC_IMR_CP1 (0x1u << 9) /**< \brief (SSC_IMR) Compare 1 Interrupt Mask */ -#define SSC_IMR_TXSYN (0x1u << 10) /**< \brief (SSC_IMR) Tx Sync Interrupt Mask */ -#define SSC_IMR_RXSYN (0x1u << 11) /**< \brief (SSC_IMR) Rx Sync Interrupt Mask */ -/* -------- SSC_WPMR : (SSC Offset: 0xE4) Write Protection Mode Register -------- */ -#define SSC_WPMR_WPEN (0x1u << 0) /**< \brief (SSC_WPMR) Write Protection Enable */ -#define SSC_WPMR_WPKEY_Pos 8 -#define SSC_WPMR_WPKEY_Msk (0xffffffu << SSC_WPMR_WPKEY_Pos) /**< \brief (SSC_WPMR) Write Protection Key */ -#define SSC_WPMR_WPKEY(value) ((SSC_WPMR_WPKEY_Msk & ((value) << SSC_WPMR_WPKEY_Pos))) -#define SSC_WPMR_WPKEY_PASSWD (0x535343u << 8) /**< \brief (SSC_WPMR) Writing any other value in this field aborts the write operation of the WPEN bit.Always reads as 0. */ -/* -------- SSC_WPSR : (SSC Offset: 0xE8) Write Protection Status Register -------- */ -#define SSC_WPSR_WPVS (0x1u << 0) /**< \brief (SSC_WPSR) Write Protection Violation Status */ -#define SSC_WPSR_WPVSRC_Pos 8 -#define SSC_WPSR_WPVSRC_Msk (0xffffu << SSC_WPSR_WPVSRC_Pos) /**< \brief (SSC_WPSR) Write Protect Violation Source */ - -/*@}*/ - - -#endif /* _SAMV71_SSC_COMPONENT_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_supc.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_supc.h deleted file mode 100644 index 8ddeb97d..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_supc.h +++ /dev/null @@ -1,295 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_SUPC_COMPONENT_ -#define _SAMV71_SUPC_COMPONENT_ - -/* ============================================================================= */ -/** SOFTWARE API DEFINITION FOR Supply Controller */ -/* ============================================================================= */ -/** \addtogroup SAMV71_SUPC Supply Controller */ -/*@{*/ - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -/** \brief Supc hardware registers */ -typedef struct { - __O uint32_t SUPC_CR; /**< \brief (Supc Offset: 0x00) Supply Controller Control Register */ - __IO uint32_t SUPC_SMMR; /**< \brief (Supc Offset: 0x04) Supply Controller Supply Monitor Mode Register */ - __IO uint32_t SUPC_MR; /**< \brief (Supc Offset: 0x08) Supply Controller Mode Register */ - __IO uint32_t SUPC_WUMR; /**< \brief (Supc Offset: 0x0C) Supply Controller Wake-up Mode Register */ - __IO uint32_t SUPC_WUIR; /**< \brief (Supc Offset: 0x10) Supply Controller Wake-up Inputs Register */ - __I uint32_t SUPC_SR; /**< \brief (Supc Offset: 0x14) Supply Controller Status Register */ -} Supc; -#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/* -------- SUPC_CR : (SUPC Offset: 0x00) Supply Controller Control Register -------- */ -#define SUPC_CR_VROFF (0x1u << 2) /**< \brief (SUPC_CR) Voltage Regulator Off */ -#define SUPC_CR_VROFF_NO_EFFECT (0x0u << 2) /**< \brief (SUPC_CR) No effect. */ -#define SUPC_CR_VROFF_STOP_VREG (0x1u << 2) /**< \brief (SUPC_CR) If KEY is correct, VROFF asserts the vddcore_nreset and stops the voltage regulator. */ -#define SUPC_CR_XTALSEL (0x1u << 3) /**< \brief (SUPC_CR) Crystal Oscillator Select */ -#define SUPC_CR_XTALSEL_NO_EFFECT (0x0u << 3) /**< \brief (SUPC_CR) No effect. */ -#define SUPC_CR_XTALSEL_CRYSTAL_SEL (0x1u << 3) /**< \brief (SUPC_CR) If KEY is correct, XTALSEL switches the slow clock on the crystal oscillator output. */ -#define SUPC_CR_KEY_Pos 24 -#define SUPC_CR_KEY_Msk (0xffu << SUPC_CR_KEY_Pos) /**< \brief (SUPC_CR) Password */ -#define SUPC_CR_KEY(value) ((SUPC_CR_KEY_Msk & ((value) << SUPC_CR_KEY_Pos))) -#define SUPC_CR_KEY_PASSWD (0xA5u << 24) /**< \brief (SUPC_CR) Writing any other value in this field aborts the write operation. */ -/* -------- SUPC_SMMR : (SUPC Offset: 0x04) Supply Controller Supply Monitor Mode Register -------- */ -#define SUPC_SMMR_SMTH_Pos 0 -#define SUPC_SMMR_SMTH_Msk (0xfu << SUPC_SMMR_SMTH_Pos) /**< \brief (SUPC_SMMR) Supply Monitor Threshold */ -#define SUPC_SMMR_SMTH(value) ((SUPC_SMMR_SMTH_Msk & ((value) << SUPC_SMMR_SMTH_Pos))) -#define SUPC_SMMR_SMSMPL_Pos 8 -#define SUPC_SMMR_SMSMPL_Msk (0x7u << SUPC_SMMR_SMSMPL_Pos) /**< \brief (SUPC_SMMR) Supply Monitor Sampling Period */ -#define SUPC_SMMR_SMSMPL(value) ((SUPC_SMMR_SMSMPL_Msk & ((value) << SUPC_SMMR_SMSMPL_Pos))) -#define SUPC_SMMR_SMSMPL_SMD (0x0u << 8) /**< \brief (SUPC_SMMR) Supply Monitor disabled */ -#define SUPC_SMMR_SMSMPL_CSM (0x1u << 8) /**< \brief (SUPC_SMMR) Continuous Supply Monitor */ -#define SUPC_SMMR_SMSMPL_32SLCK (0x2u << 8) /**< \brief (SUPC_SMMR) Supply Monitor enabled one SLCK period every 32 SLCK periods */ -#define SUPC_SMMR_SMSMPL_256SLCK (0x3u << 8) /**< \brief (SUPC_SMMR) Supply Monitor enabled one SLCK period every 256 SLCK periods */ -#define SUPC_SMMR_SMSMPL_2048SLCK (0x4u << 8) /**< \brief (SUPC_SMMR) Supply Monitor enabled one SLCK period every 2,048 SLCK periods */ -#define SUPC_SMMR_SMRSTEN (0x1u << 12) /**< \brief (SUPC_SMMR) Supply Monitor Reset Enable */ -#define SUPC_SMMR_SMRSTEN_NOT_ENABLE (0x0u << 12) /**< \brief (SUPC_SMMR) The core reset signal vddcore_nreset is not affected when a supply monitor detection occurs. */ -#define SUPC_SMMR_SMRSTEN_ENABLE (0x1u << 12) /**< \brief (SUPC_SMMR) The core reset signal, vddcore_nreset is asserted when a supply monitor detection occurs. */ -#define SUPC_SMMR_SMIEN (0x1u << 13) /**< \brief (SUPC_SMMR) Supply Monitor Interrupt Enable */ -#define SUPC_SMMR_SMIEN_NOT_ENABLE (0x0u << 13) /**< \brief (SUPC_SMMR) The SUPC interrupt signal is not affected when a supply monitor detection occurs. */ -#define SUPC_SMMR_SMIEN_ENABLE (0x1u << 13) /**< \brief (SUPC_SMMR) The SUPC interrupt signal is asserted when a supply monitor detection occurs. */ -/* -------- SUPC_MR : (SUPC Offset: 0x08) Supply Controller Mode Register -------- */ -#define SUPC_MR_BODRSTEN (0x1u << 12) /**< \brief (SUPC_MR) Brownout Detector Reset Enable */ -#define SUPC_MR_BODRSTEN_NOT_ENABLE (0x0u << 12) /**< \brief (SUPC_MR) The core reset signal vddcore_nreset is not affected when a brownout detection occurs. */ -#define SUPC_MR_BODRSTEN_ENABLE (0x1u << 12) /**< \brief (SUPC_MR) The core reset signal, vddcore_nreset is asserted when a brownout detection occurs. */ -#define SUPC_MR_BODDIS (0x1u << 13) /**< \brief (SUPC_MR) Brownout Detector Disable */ -#define SUPC_MR_BODDIS_ENABLE (0x0u << 13) /**< \brief (SUPC_MR) The core brownout detector is enabled. */ -#define SUPC_MR_BODDIS_DISABLE (0x1u << 13) /**< \brief (SUPC_MR) The core brownout detector is disabled. */ -#define SUPC_MR_ONREG (0x1u << 14) /**< \brief (SUPC_MR) Voltage Regulator Enable */ -#define SUPC_MR_ONREG_ONREG_UNUSED (0x0u << 14) /**< \brief (SUPC_MR) Internal voltage regulator is not used (external power supply is used). */ -#define SUPC_MR_ONREG_ONREG_USED (0x1u << 14) /**< \brief (SUPC_MR) Internal voltage regulator is used. */ -#define SUPC_MR_BKUPRETON (0x1u << 17) /**< \brief (SUPC_MR) SRAM On In Backup Mode */ -#define SUPC_MR_OSCBYPASS (0x1u << 20) /**< \brief (SUPC_MR) Oscillator Bypass */ -#define SUPC_MR_OSCBYPASS_NO_EFFECT (0x0u << 20) /**< \brief (SUPC_MR) No effect. Clock selection depends on the value of XTALSEL (SUPC_CR). */ -#define SUPC_MR_OSCBYPASS_BYPASS (0x1u << 20) /**< \brief (SUPC_MR) The 32 kHz crystal oscillator is bypassed if XTALSEL (SUPC_CR) is set. OSCBYPASS must be set prior to setting XTALSEL. */ -#define SUPC_MR_KEY_Pos 24 -#define SUPC_MR_KEY_Msk (0xffu << SUPC_MR_KEY_Pos) /**< \brief (SUPC_MR) Password Key */ -#define SUPC_MR_KEY(value) ((SUPC_MR_KEY_Msk & ((value) << SUPC_MR_KEY_Pos))) -#define SUPC_MR_KEY_PASSWD (0xA5u << 24) /**< \brief (SUPC_MR) Writing any other value in this field aborts the write operation. */ -/* -------- SUPC_WUMR : (SUPC Offset: 0x0C) Supply Controller Wake-up Mode Register -------- */ -#define SUPC_WUMR_SMEN (0x1u << 1) /**< \brief (SUPC_WUMR) Supply Monitor Wake-up Enable */ -#define SUPC_WUMR_SMEN_NOT_ENABLE (0x0u << 1) /**< \brief (SUPC_WUMR) The supply monitor detection has no wake-up effect. */ -#define SUPC_WUMR_SMEN_ENABLE (0x1u << 1) /**< \brief (SUPC_WUMR) The supply monitor detection forces the wake-up of the core power supply. */ -#define SUPC_WUMR_RTTEN (0x1u << 2) /**< \brief (SUPC_WUMR) Real-time Timer Wake-up Enable */ -#define SUPC_WUMR_RTTEN_NOT_ENABLE (0x0u << 2) /**< \brief (SUPC_WUMR) The RTT alarm signal has no wake-up effect. */ -#define SUPC_WUMR_RTTEN_ENABLE (0x1u << 2) /**< \brief (SUPC_WUMR) The RTT alarm signal forces the wake-up of the core power supply. */ -#define SUPC_WUMR_RTCEN (0x1u << 3) /**< \brief (SUPC_WUMR) Real-time Clock Wake-up Enable */ -#define SUPC_WUMR_RTCEN_NOT_ENABLE (0x0u << 3) /**< \brief (SUPC_WUMR) The RTC alarm signal has no wake-up effect. */ -#define SUPC_WUMR_RTCEN_ENABLE (0x1u << 3) /**< \brief (SUPC_WUMR) The RTC alarm signal forces the wake-up of the core power supply. */ -#define SUPC_WUMR_LPDBCEN0 (0x1u << 5) /**< \brief (SUPC_WUMR) Low-power Debouncer Enable WKUP0 */ -#define SUPC_WUMR_LPDBCEN0_NOT_ENABLE (0x0u << 5) /**< \brief (SUPC_WUMR) The WKUP0 input pin is not connected to the low-power debouncer. */ -#define SUPC_WUMR_LPDBCEN0_ENABLE (0x1u << 5) /**< \brief (SUPC_WUMR) The WKUP0 input pin is connected to the low-power debouncer and forces a system wake-up. */ -#define SUPC_WUMR_LPDBCEN1 (0x1u << 6) /**< \brief (SUPC_WUMR) Low-power Debouncer Enable WKUP1 */ -#define SUPC_WUMR_LPDBCEN1_NOT_ENABLE (0x0u << 6) /**< \brief (SUPC_WUMR) The WKUP1 input pin is not connected to the low-power debouncer. */ -#define SUPC_WUMR_LPDBCEN1_ENABLE (0x1u << 6) /**< \brief (SUPC_WUMR) The WKUP1 input pin is connected to the low-power debouncer and forces a system wake-up. */ -#define SUPC_WUMR_LPDBCCLR (0x1u << 7) /**< \brief (SUPC_WUMR) Low-power Debouncer Clear */ -#define SUPC_WUMR_LPDBCCLR_NOT_ENABLE (0x0u << 7) /**< \brief (SUPC_WUMR) A low-power debounce event does not create an immediate clear on the first half of GPBR registers. */ -#define SUPC_WUMR_LPDBCCLR_ENABLE (0x1u << 7) /**< \brief (SUPC_WUMR) A low-power debounce event on WKUP0 or WKUP1 generates an immediate clear on the first half of GPBR registers. */ -#define SUPC_WUMR_WKUPDBC_Pos 12 -#define SUPC_WUMR_WKUPDBC_Msk (0x7u << SUPC_WUMR_WKUPDBC_Pos) /**< \brief (SUPC_WUMR) Wake-up Inputs Debouncer Period */ -#define SUPC_WUMR_WKUPDBC(value) ((SUPC_WUMR_WKUPDBC_Msk & ((value) << SUPC_WUMR_WKUPDBC_Pos))) -#define SUPC_WUMR_WKUPDBC_IMMEDIATE (0x0u << 12) /**< \brief (SUPC_WUMR) Immediate, no debouncing, detected active at least on one Slow Clock edge. */ -#define SUPC_WUMR_WKUPDBC_3_SLCK (0x1u << 12) /**< \brief (SUPC_WUMR) WKUPx shall be in its active state for at least 3 SLCK periods */ -#define SUPC_WUMR_WKUPDBC_32_SLCK (0x2u << 12) /**< \brief (SUPC_WUMR) WKUPx shall be in its active state for at least 32 SLCK periods */ -#define SUPC_WUMR_WKUPDBC_512_SLCK (0x3u << 12) /**< \brief (SUPC_WUMR) WKUPx shall be in its active state for at least 512 SLCK periods */ -#define SUPC_WUMR_WKUPDBC_4096_SLCK (0x4u << 12) /**< \brief (SUPC_WUMR) WKUPx shall be in its active state for at least 4,096 SLCK periods */ -#define SUPC_WUMR_WKUPDBC_32768_SLCK (0x5u << 12) /**< \brief (SUPC_WUMR) WKUPx shall be in its active state for at least 32,768 SLCK periods */ -#define SUPC_WUMR_LPDBC_Pos 16 -#define SUPC_WUMR_LPDBC_Msk (0x7u << SUPC_WUMR_LPDBC_Pos) /**< \brief (SUPC_WUMR) Low-power Debouncer Period */ -#define SUPC_WUMR_LPDBC(value) ((SUPC_WUMR_LPDBC_Msk & ((value) << SUPC_WUMR_LPDBC_Pos))) -#define SUPC_WUMR_LPDBC_DISABLE (0x0u << 16) /**< \brief (SUPC_WUMR) Disable the low-power debouncers. */ -#define SUPC_WUMR_LPDBC_2_RTCOUT (0x1u << 16) /**< \brief (SUPC_WUMR) WKUP0/1 in active state for at least 2 RTCOUTx clock periods */ -#define SUPC_WUMR_LPDBC_3_RTCOUT (0x2u << 16) /**< \brief (SUPC_WUMR) WKUP0/1 in active state for at least 3 RTCOUTx clock periods */ -#define SUPC_WUMR_LPDBC_4_RTCOUT (0x3u << 16) /**< \brief (SUPC_WUMR) WKUP0/1 in active state for at least 4 RTCOUTx clock periods */ -#define SUPC_WUMR_LPDBC_5_RTCOUT (0x4u << 16) /**< \brief (SUPC_WUMR) WKUP0/1 in active state for at least 5 RTCOUTx clock periods */ -#define SUPC_WUMR_LPDBC_6_RTCOUT (0x5u << 16) /**< \brief (SUPC_WUMR) WKUP0/1 in active state for at least 6 RTCOUTx clock periods */ -#define SUPC_WUMR_LPDBC_7_RTCOUT (0x6u << 16) /**< \brief (SUPC_WUMR) WKUP0/1 in active state for at least 7 RTCOUTx clock periods */ -#define SUPC_WUMR_LPDBC_8_RTCOUT (0x7u << 16) /**< \brief (SUPC_WUMR) WKUP0/1 in active state for at least 8 RTCOUTx clock periods */ -/* -------- SUPC_WUIR : (SUPC Offset: 0x10) Supply Controller Wake-up Inputs Register -------- */ -#define SUPC_WUIR_WKUPEN0 (0x1u << 0) /**< \brief (SUPC_WUIR) Wake-up Input Enable 0 to 0 */ -#define SUPC_WUIR_WKUPEN0_DISABLE (0x0u << 0) /**< \brief (SUPC_WUIR) The corresponding wake-up input has no wake-up effect. */ -#define SUPC_WUIR_WKUPEN0_ENABLE (0x1u << 0) /**< \brief (SUPC_WUIR) The corresponding wake-up input is enabled for a wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPEN1 (0x1u << 1) /**< \brief (SUPC_WUIR) Wake-up Input Enable 0 to 1 */ -#define SUPC_WUIR_WKUPEN1_DISABLE (0x0u << 1) /**< \brief (SUPC_WUIR) The corresponding wake-up input has no wake-up effect. */ -#define SUPC_WUIR_WKUPEN1_ENABLE (0x1u << 1) /**< \brief (SUPC_WUIR) The corresponding wake-up input is enabled for a wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPEN2 (0x1u << 2) /**< \brief (SUPC_WUIR) Wake-up Input Enable 0 to 2 */ -#define SUPC_WUIR_WKUPEN2_DISABLE (0x0u << 2) /**< \brief (SUPC_WUIR) The corresponding wake-up input has no wake-up effect. */ -#define SUPC_WUIR_WKUPEN2_ENABLE (0x1u << 2) /**< \brief (SUPC_WUIR) The corresponding wake-up input is enabled for a wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPEN3 (0x1u << 3) /**< \brief (SUPC_WUIR) Wake-up Input Enable 0 to 3 */ -#define SUPC_WUIR_WKUPEN3_DISABLE (0x0u << 3) /**< \brief (SUPC_WUIR) The corresponding wake-up input has no wake-up effect. */ -#define SUPC_WUIR_WKUPEN3_ENABLE (0x1u << 3) /**< \brief (SUPC_WUIR) The corresponding wake-up input is enabled for a wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPEN4 (0x1u << 4) /**< \brief (SUPC_WUIR) Wake-up Input Enable 0 to 4 */ -#define SUPC_WUIR_WKUPEN4_DISABLE (0x0u << 4) /**< \brief (SUPC_WUIR) The corresponding wake-up input has no wake-up effect. */ -#define SUPC_WUIR_WKUPEN4_ENABLE (0x1u << 4) /**< \brief (SUPC_WUIR) The corresponding wake-up input is enabled for a wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPEN5 (0x1u << 5) /**< \brief (SUPC_WUIR) Wake-up Input Enable 0 to 5 */ -#define SUPC_WUIR_WKUPEN5_DISABLE (0x0u << 5) /**< \brief (SUPC_WUIR) The corresponding wake-up input has no wake-up effect. */ -#define SUPC_WUIR_WKUPEN5_ENABLE (0x1u << 5) /**< \brief (SUPC_WUIR) The corresponding wake-up input is enabled for a wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPEN6 (0x1u << 6) /**< \brief (SUPC_WUIR) Wake-up Input Enable 0 to 6 */ -#define SUPC_WUIR_WKUPEN6_DISABLE (0x0u << 6) /**< \brief (SUPC_WUIR) The corresponding wake-up input has no wake-up effect. */ -#define SUPC_WUIR_WKUPEN6_ENABLE (0x1u << 6) /**< \brief (SUPC_WUIR) The corresponding wake-up input is enabled for a wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPEN7 (0x1u << 7) /**< \brief (SUPC_WUIR) Wake-up Input Enable 0 to 7 */ -#define SUPC_WUIR_WKUPEN7_DISABLE (0x0u << 7) /**< \brief (SUPC_WUIR) The corresponding wake-up input has no wake-up effect. */ -#define SUPC_WUIR_WKUPEN7_ENABLE (0x1u << 7) /**< \brief (SUPC_WUIR) The corresponding wake-up input is enabled for a wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPEN8 (0x1u << 8) /**< \brief (SUPC_WUIR) Wake-up Input Enable 0 to 8 */ -#define SUPC_WUIR_WKUPEN8_DISABLE (0x0u << 8) /**< \brief (SUPC_WUIR) The corresponding wake-up input has no wake-up effect. */ -#define SUPC_WUIR_WKUPEN8_ENABLE (0x1u << 8) /**< \brief (SUPC_WUIR) The corresponding wake-up input is enabled for a wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPEN9 (0x1u << 9) /**< \brief (SUPC_WUIR) Wake-up Input Enable 0 to 9 */ -#define SUPC_WUIR_WKUPEN9_DISABLE (0x0u << 9) /**< \brief (SUPC_WUIR) The corresponding wake-up input has no wake-up effect. */ -#define SUPC_WUIR_WKUPEN9_ENABLE (0x1u << 9) /**< \brief (SUPC_WUIR) The corresponding wake-up input is enabled for a wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPEN10 (0x1u << 10) /**< \brief (SUPC_WUIR) Wake-up Input Enable 0 to 10 */ -#define SUPC_WUIR_WKUPEN10_DISABLE (0x0u << 10) /**< \brief (SUPC_WUIR) The corresponding wake-up input has no wake-up effect. */ -#define SUPC_WUIR_WKUPEN10_ENABLE (0x1u << 10) /**< \brief (SUPC_WUIR) The corresponding wake-up input is enabled for a wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPEN11 (0x1u << 11) /**< \brief (SUPC_WUIR) Wake-up Input Enable 0 to 11 */ -#define SUPC_WUIR_WKUPEN11_DISABLE (0x0u << 11) /**< \brief (SUPC_WUIR) The corresponding wake-up input has no wake-up effect. */ -#define SUPC_WUIR_WKUPEN11_ENABLE (0x1u << 11) /**< \brief (SUPC_WUIR) The corresponding wake-up input is enabled for a wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPEN12 (0x1u << 12) /**< \brief (SUPC_WUIR) Wake-up Input Enable 0 to 12 */ -#define SUPC_WUIR_WKUPEN12_DISABLE (0x0u << 12) /**< \brief (SUPC_WUIR) The corresponding wake-up input has no wake-up effect. */ -#define SUPC_WUIR_WKUPEN12_ENABLE (0x1u << 12) /**< \brief (SUPC_WUIR) The corresponding wake-up input is enabled for a wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPEN13 (0x1u << 13) /**< \brief (SUPC_WUIR) Wake-up Input Enable 0 to 13 */ -#define SUPC_WUIR_WKUPEN13_DISABLE (0x0u << 13) /**< \brief (SUPC_WUIR) The corresponding wake-up input has no wake-up effect. */ -#define SUPC_WUIR_WKUPEN13_ENABLE (0x1u << 13) /**< \brief (SUPC_WUIR) The corresponding wake-up input is enabled for a wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPT0 (0x1u << 16) /**< \brief (SUPC_WUIR) Wake-up Input Type 0 to 0 */ -#define SUPC_WUIR_WKUPT0_LOW (0x0u << 16) /**< \brief (SUPC_WUIR) A falling edge followed by a low level for a period defined by WKUPDBC on the corre-sponding wake-up input forces the wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPT0_HIGH (0x1u << 16) /**< \brief (SUPC_WUIR) A rising edge followed by a high level for a period defined by WKUPDBC on the cor-responding wake-up input forces the wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPT1 (0x1u << 17) /**< \brief (SUPC_WUIR) Wake-up Input Type 0 to 1 */ -#define SUPC_WUIR_WKUPT1_LOW (0x0u << 17) /**< \brief (SUPC_WUIR) A falling edge followed by a low level for a period defined by WKUPDBC on the corre-sponding wake-up input forces the wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPT1_HIGH (0x1u << 17) /**< \brief (SUPC_WUIR) A rising edge followed by a high level for a period defined by WKUPDBC on the cor-responding wake-up input forces the wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPT2 (0x1u << 18) /**< \brief (SUPC_WUIR) Wake-up Input Type 0 to 2 */ -#define SUPC_WUIR_WKUPT2_LOW (0x0u << 18) /**< \brief (SUPC_WUIR) A falling edge followed by a low level for a period defined by WKUPDBC on the corre-sponding wake-up input forces the wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPT2_HIGH (0x1u << 18) /**< \brief (SUPC_WUIR) A rising edge followed by a high level for a period defined by WKUPDBC on the cor-responding wake-up input forces the wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPT3 (0x1u << 19) /**< \brief (SUPC_WUIR) Wake-up Input Type 0 to 3 */ -#define SUPC_WUIR_WKUPT3_LOW (0x0u << 19) /**< \brief (SUPC_WUIR) A falling edge followed by a low level for a period defined by WKUPDBC on the corre-sponding wake-up input forces the wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPT3_HIGH (0x1u << 19) /**< \brief (SUPC_WUIR) A rising edge followed by a high level for a period defined by WKUPDBC on the cor-responding wake-up input forces the wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPT4 (0x1u << 20) /**< \brief (SUPC_WUIR) Wake-up Input Type 0 to 4 */ -#define SUPC_WUIR_WKUPT4_LOW (0x0u << 20) /**< \brief (SUPC_WUIR) A falling edge followed by a low level for a period defined by WKUPDBC on the corre-sponding wake-up input forces the wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPT4_HIGH (0x1u << 20) /**< \brief (SUPC_WUIR) A rising edge followed by a high level for a period defined by WKUPDBC on the cor-responding wake-up input forces the wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPT5 (0x1u << 21) /**< \brief (SUPC_WUIR) Wake-up Input Type 0 to 5 */ -#define SUPC_WUIR_WKUPT5_LOW (0x0u << 21) /**< \brief (SUPC_WUIR) A falling edge followed by a low level for a period defined by WKUPDBC on the corre-sponding wake-up input forces the wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPT5_HIGH (0x1u << 21) /**< \brief (SUPC_WUIR) A rising edge followed by a high level for a period defined by WKUPDBC on the cor-responding wake-up input forces the wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPT6 (0x1u << 22) /**< \brief (SUPC_WUIR) Wake-up Input Type 0 to 6 */ -#define SUPC_WUIR_WKUPT6_LOW (0x0u << 22) /**< \brief (SUPC_WUIR) A falling edge followed by a low level for a period defined by WKUPDBC on the corre-sponding wake-up input forces the wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPT6_HIGH (0x1u << 22) /**< \brief (SUPC_WUIR) A rising edge followed by a high level for a period defined by WKUPDBC on the cor-responding wake-up input forces the wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPT7 (0x1u << 23) /**< \brief (SUPC_WUIR) Wake-up Input Type 0 to 7 */ -#define SUPC_WUIR_WKUPT7_LOW (0x0u << 23) /**< \brief (SUPC_WUIR) A falling edge followed by a low level for a period defined by WKUPDBC on the corre-sponding wake-up input forces the wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPT7_HIGH (0x1u << 23) /**< \brief (SUPC_WUIR) A rising edge followed by a high level for a period defined by WKUPDBC on the cor-responding wake-up input forces the wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPT8 (0x1u << 24) /**< \brief (SUPC_WUIR) Wake-up Input Type 0 to 8 */ -#define SUPC_WUIR_WKUPT8_LOW (0x0u << 24) /**< \brief (SUPC_WUIR) A falling edge followed by a low level for a period defined by WKUPDBC on the corre-sponding wake-up input forces the wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPT8_HIGH (0x1u << 24) /**< \brief (SUPC_WUIR) A rising edge followed by a high level for a period defined by WKUPDBC on the cor-responding wake-up input forces the wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPT9 (0x1u << 25) /**< \brief (SUPC_WUIR) Wake-up Input Type 0 to 9 */ -#define SUPC_WUIR_WKUPT9_LOW (0x0u << 25) /**< \brief (SUPC_WUIR) A falling edge followed by a low level for a period defined by WKUPDBC on the corre-sponding wake-up input forces the wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPT9_HIGH (0x1u << 25) /**< \brief (SUPC_WUIR) A rising edge followed by a high level for a period defined by WKUPDBC on the cor-responding wake-up input forces the wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPT10 (0x1u << 26) /**< \brief (SUPC_WUIR) Wake-up Input Type 0 to 10 */ -#define SUPC_WUIR_WKUPT10_LOW (0x0u << 26) /**< \brief (SUPC_WUIR) A falling edge followed by a low level for a period defined by WKUPDBC on the corre-sponding wake-up input forces the wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPT10_HIGH (0x1u << 26) /**< \brief (SUPC_WUIR) A rising edge followed by a high level for a period defined by WKUPDBC on the cor-responding wake-up input forces the wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPT11 (0x1u << 27) /**< \brief (SUPC_WUIR) Wake-up Input Type 0 to 11 */ -#define SUPC_WUIR_WKUPT11_LOW (0x0u << 27) /**< \brief (SUPC_WUIR) A falling edge followed by a low level for a period defined by WKUPDBC on the corre-sponding wake-up input forces the wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPT11_HIGH (0x1u << 27) /**< \brief (SUPC_WUIR) A rising edge followed by a high level for a period defined by WKUPDBC on the cor-responding wake-up input forces the wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPT12 (0x1u << 28) /**< \brief (SUPC_WUIR) Wake-up Input Type 0 to 12 */ -#define SUPC_WUIR_WKUPT12_LOW (0x0u << 28) /**< \brief (SUPC_WUIR) A falling edge followed by a low level for a period defined by WKUPDBC on the corre-sponding wake-up input forces the wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPT12_HIGH (0x1u << 28) /**< \brief (SUPC_WUIR) A rising edge followed by a high level for a period defined by WKUPDBC on the cor-responding wake-up input forces the wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPT13 (0x1u << 29) /**< \brief (SUPC_WUIR) Wake-up Input Type 0 to 13 */ -#define SUPC_WUIR_WKUPT13_LOW (0x0u << 29) /**< \brief (SUPC_WUIR) A falling edge followed by a low level for a period defined by WKUPDBC on the corre-sponding wake-up input forces the wake-up of the core power supply. */ -#define SUPC_WUIR_WKUPT13_HIGH (0x1u << 29) /**< \brief (SUPC_WUIR) A rising edge followed by a high level for a period defined by WKUPDBC on the cor-responding wake-up input forces the wake-up of the core power supply. */ -/* -------- SUPC_SR : (SUPC Offset: 0x14) Supply Controller Status Register -------- */ -#define SUPC_SR_WKUPS (0x1u << 1) /**< \brief (SUPC_SR) WKUP Wake-up Status (cleared on read) */ -#define SUPC_SR_WKUPS_NO (0x0u << 1) /**< \brief (SUPC_SR) No wake-up due to the assertion of the WKUP pins has occurred since the last read of SUPC_SR. */ -#define SUPC_SR_WKUPS_PRESENT (0x1u << 1) /**< \brief (SUPC_SR) At least one wake-up due to the assertion of the WKUP pins has occurred since the last read of SUPC_SR. */ -#define SUPC_SR_SMWS (0x1u << 2) /**< \brief (SUPC_SR) Supply Monitor Detection Wake-up Status (cleared on read) */ -#define SUPC_SR_SMWS_NO (0x0u << 2) /**< \brief (SUPC_SR) No wake-up due to a supply monitor detection has occurred since the last read of SUPC_SR. */ -#define SUPC_SR_SMWS_PRESENT (0x1u << 2) /**< \brief (SUPC_SR) At least one wake-up due to a supply monitor detection has occurred since the last read of SUPC_SR. */ -#define SUPC_SR_BODRSTS (0x1u << 3) /**< \brief (SUPC_SR) Brownout Detector Reset Status (cleared on read) */ -#define SUPC_SR_BODRSTS_NO (0x0u << 3) /**< \brief (SUPC_SR) No core brownout rising edge event has been detected since the last read of the SUPC_SR. */ -#define SUPC_SR_BODRSTS_PRESENT (0x1u << 3) /**< \brief (SUPC_SR) At least one brownout output rising edge event has been detected since the last read of the SUPC_SR. */ -#define SUPC_SR_SMRSTS (0x1u << 4) /**< \brief (SUPC_SR) Supply Monitor Reset Status (cleared on read) */ -#define SUPC_SR_SMRSTS_NO (0x0u << 4) /**< \brief (SUPC_SR) No supply monitor detection has generated a core reset since the last read of the SUPC_SR. */ -#define SUPC_SR_SMRSTS_PRESENT (0x1u << 4) /**< \brief (SUPC_SR) At least one supply monitor detection has generated a core reset since the last read of the SUPC_SR. */ -#define SUPC_SR_SMS (0x1u << 5) /**< \brief (SUPC_SR) Supply Monitor Status (cleared on read) */ -#define SUPC_SR_SMS_NO (0x0u << 5) /**< \brief (SUPC_SR) No supply monitor detection since the last read of SUPC_SR. */ -#define SUPC_SR_SMS_PRESENT (0x1u << 5) /**< \brief (SUPC_SR) At least one supply monitor detection since the last read of SUPC_SR. */ -#define SUPC_SR_SMOS (0x1u << 6) /**< \brief (SUPC_SR) Supply Monitor Output Status */ -#define SUPC_SR_SMOS_HIGH (0x0u << 6) /**< \brief (SUPC_SR) The supply monitor detected VDDIO higher than its threshold at its last measurement. */ -#define SUPC_SR_SMOS_LOW (0x1u << 6) /**< \brief (SUPC_SR) The supply monitor detected VDDIO lower than its threshold at its last measurement. */ -#define SUPC_SR_OSCSEL (0x1u << 7) /**< \brief (SUPC_SR) 32-kHz Oscillator Selection Status */ -#define SUPC_SR_OSCSEL_RC (0x0u << 7) /**< \brief (SUPC_SR) The slow clock, SLCK, is generated by the embedded 32 kHz RC oscillator. */ -#define SUPC_SR_OSCSEL_CRYST (0x1u << 7) /**< \brief (SUPC_SR) The slow clock, SLCK, is generated by the 32 kHz crystal oscillator. */ -#define SUPC_SR_LPDBCS0 (0x1u << 13) /**< \brief (SUPC_SR) Low-power Debouncer Wake-up Status on WKUP0 (cleared on read) */ -#define SUPC_SR_LPDBCS0_NO (0x0u << 13) /**< \brief (SUPC_SR) No wake-up due to the assertion of the WKUP0 pin has occurred since the last read of SUPC_SR. */ -#define SUPC_SR_LPDBCS0_PRESENT (0x1u << 13) /**< \brief (SUPC_SR) At least one wake-up due to the assertion of the WKUP0 pin has occurred since the last read of SUPC_SR. */ -#define SUPC_SR_LPDBCS1 (0x1u << 14) /**< \brief (SUPC_SR) Low-power Debouncer Wake-up Status on WKUP1 (cleared on read) */ -#define SUPC_SR_LPDBCS1_NO (0x0u << 14) /**< \brief (SUPC_SR) No wake-up due to the assertion of the WKUP1 pin has occurred since the last read of SUPC_SR. */ -#define SUPC_SR_LPDBCS1_PRESENT (0x1u << 14) /**< \brief (SUPC_SR) At least one wake-up due to the assertion of the WKUP1 pin has occurred since the last read of SUPC_SR. */ -#define SUPC_SR_WKUPIS0 (0x1u << 16) /**< \brief (SUPC_SR) WKUPx Input Status (cleared on read) */ -#define SUPC_SR_WKUPIS0_DIS (0x0u << 16) /**< \brief (SUPC_SR) The corresponding wake-up input is disabled, or was inactive at the time the debouncer triggered a wake-up event. */ -#define SUPC_SR_WKUPIS0_EN (0x1u << 16) /**< \brief (SUPC_SR) The corresponding wake-up input was active at the time the debouncer triggered a wake-up event since the last read of SUPC_SR. */ -#define SUPC_SR_WKUPIS1 (0x1u << 17) /**< \brief (SUPC_SR) WKUPx Input Status (cleared on read) */ -#define SUPC_SR_WKUPIS1_DIS (0x0u << 17) /**< \brief (SUPC_SR) The corresponding wake-up input is disabled, or was inactive at the time the debouncer triggered a wake-up event. */ -#define SUPC_SR_WKUPIS1_EN (0x1u << 17) /**< \brief (SUPC_SR) The corresponding wake-up input was active at the time the debouncer triggered a wake-up event since the last read of SUPC_SR. */ -#define SUPC_SR_WKUPIS2 (0x1u << 18) /**< \brief (SUPC_SR) WKUPx Input Status (cleared on read) */ -#define SUPC_SR_WKUPIS2_DIS (0x0u << 18) /**< \brief (SUPC_SR) The corresponding wake-up input is disabled, or was inactive at the time the debouncer triggered a wake-up event. */ -#define SUPC_SR_WKUPIS2_EN (0x1u << 18) /**< \brief (SUPC_SR) The corresponding wake-up input was active at the time the debouncer triggered a wake-up event since the last read of SUPC_SR. */ -#define SUPC_SR_WKUPIS3 (0x1u << 19) /**< \brief (SUPC_SR) WKUPx Input Status (cleared on read) */ -#define SUPC_SR_WKUPIS3_DIS (0x0u << 19) /**< \brief (SUPC_SR) The corresponding wake-up input is disabled, or was inactive at the time the debouncer triggered a wake-up event. */ -#define SUPC_SR_WKUPIS3_EN (0x1u << 19) /**< \brief (SUPC_SR) The corresponding wake-up input was active at the time the debouncer triggered a wake-up event since the last read of SUPC_SR. */ -#define SUPC_SR_WKUPIS4 (0x1u << 20) /**< \brief (SUPC_SR) WKUPx Input Status (cleared on read) */ -#define SUPC_SR_WKUPIS4_DIS (0x0u << 20) /**< \brief (SUPC_SR) The corresponding wake-up input is disabled, or was inactive at the time the debouncer triggered a wake-up event. */ -#define SUPC_SR_WKUPIS4_EN (0x1u << 20) /**< \brief (SUPC_SR) The corresponding wake-up input was active at the time the debouncer triggered a wake-up event since the last read of SUPC_SR. */ -#define SUPC_SR_WKUPIS5 (0x1u << 21) /**< \brief (SUPC_SR) WKUPx Input Status (cleared on read) */ -#define SUPC_SR_WKUPIS5_DIS (0x0u << 21) /**< \brief (SUPC_SR) The corresponding wake-up input is disabled, or was inactive at the time the debouncer triggered a wake-up event. */ -#define SUPC_SR_WKUPIS5_EN (0x1u << 21) /**< \brief (SUPC_SR) The corresponding wake-up input was active at the time the debouncer triggered a wake-up event since the last read of SUPC_SR. */ -#define SUPC_SR_WKUPIS6 (0x1u << 22) /**< \brief (SUPC_SR) WKUPx Input Status (cleared on read) */ -#define SUPC_SR_WKUPIS6_DIS (0x0u << 22) /**< \brief (SUPC_SR) The corresponding wake-up input is disabled, or was inactive at the time the debouncer triggered a wake-up event. */ -#define SUPC_SR_WKUPIS6_EN (0x1u << 22) /**< \brief (SUPC_SR) The corresponding wake-up input was active at the time the debouncer triggered a wake-up event since the last read of SUPC_SR. */ -#define SUPC_SR_WKUPIS7 (0x1u << 23) /**< \brief (SUPC_SR) WKUPx Input Status (cleared on read) */ -#define SUPC_SR_WKUPIS7_DIS (0x0u << 23) /**< \brief (SUPC_SR) The corresponding wake-up input is disabled, or was inactive at the time the debouncer triggered a wake-up event. */ -#define SUPC_SR_WKUPIS7_EN (0x1u << 23) /**< \brief (SUPC_SR) The corresponding wake-up input was active at the time the debouncer triggered a wake-up event since the last read of SUPC_SR. */ -#define SUPC_SR_WKUPIS8 (0x1u << 24) /**< \brief (SUPC_SR) WKUPx Input Status (cleared on read) */ -#define SUPC_SR_WKUPIS8_DIS (0x0u << 24) /**< \brief (SUPC_SR) The corresponding wake-up input is disabled, or was inactive at the time the debouncer triggered a wake-up event. */ -#define SUPC_SR_WKUPIS8_EN (0x1u << 24) /**< \brief (SUPC_SR) The corresponding wake-up input was active at the time the debouncer triggered a wake-up event since the last read of SUPC_SR. */ -#define SUPC_SR_WKUPIS9 (0x1u << 25) /**< \brief (SUPC_SR) WKUPx Input Status (cleared on read) */ -#define SUPC_SR_WKUPIS9_DIS (0x0u << 25) /**< \brief (SUPC_SR) The corresponding wake-up input is disabled, or was inactive at the time the debouncer triggered a wake-up event. */ -#define SUPC_SR_WKUPIS9_EN (0x1u << 25) /**< \brief (SUPC_SR) The corresponding wake-up input was active at the time the debouncer triggered a wake-up event since the last read of SUPC_SR. */ -#define SUPC_SR_WKUPIS10 (0x1u << 26) /**< \brief (SUPC_SR) WKUPx Input Status (cleared on read) */ -#define SUPC_SR_WKUPIS10_DIS (0x0u << 26) /**< \brief (SUPC_SR) The corresponding wake-up input is disabled, or was inactive at the time the debouncer triggered a wake-up event. */ -#define SUPC_SR_WKUPIS10_EN (0x1u << 26) /**< \brief (SUPC_SR) The corresponding wake-up input was active at the time the debouncer triggered a wake-up event since the last read of SUPC_SR. */ -#define SUPC_SR_WKUPIS11 (0x1u << 27) /**< \brief (SUPC_SR) WKUPx Input Status (cleared on read) */ -#define SUPC_SR_WKUPIS11_DIS (0x0u << 27) /**< \brief (SUPC_SR) The corresponding wake-up input is disabled, or was inactive at the time the debouncer triggered a wake-up event. */ -#define SUPC_SR_WKUPIS11_EN (0x1u << 27) /**< \brief (SUPC_SR) The corresponding wake-up input was active at the time the debouncer triggered a wake-up event since the last read of SUPC_SR. */ -#define SUPC_SR_WKUPIS12 (0x1u << 28) /**< \brief (SUPC_SR) WKUPx Input Status (cleared on read) */ -#define SUPC_SR_WKUPIS12_DIS (0x0u << 28) /**< \brief (SUPC_SR) The corresponding wake-up input is disabled, or was inactive at the time the debouncer triggered a wake-up event. */ -#define SUPC_SR_WKUPIS12_EN (0x1u << 28) /**< \brief (SUPC_SR) The corresponding wake-up input was active at the time the debouncer triggered a wake-up event since the last read of SUPC_SR. */ -#define SUPC_SR_WKUPIS13 (0x1u << 29) /**< \brief (SUPC_SR) WKUPx Input Status (cleared on read) */ -#define SUPC_SR_WKUPIS13_DIS (0x0u << 29) /**< \brief (SUPC_SR) The corresponding wake-up input is disabled, or was inactive at the time the debouncer triggered a wake-up event. */ -#define SUPC_SR_WKUPIS13_EN (0x1u << 29) /**< \brief (SUPC_SR) The corresponding wake-up input was active at the time the debouncer triggered a wake-up event since the last read of SUPC_SR. */ - -/*@}*/ - - -#endif /* _SAMV71_SUPC_COMPONENT_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_tc.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_tc.h deleted file mode 100644 index 680faee9..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_tc.h +++ /dev/null @@ -1,346 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_TC_COMPONENT_ -#define _SAMV71_TC_COMPONENT_ - -/* ============================================================================= */ -/** SOFTWARE API DEFINITION FOR Timer Counter */ -/* ============================================================================= */ -/** \addtogroup SAMV71_TC Timer Counter */ -/*@{*/ - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -/** \brief TcChannel hardware registers */ -typedef struct { - __O uint32_t TC_CCR; /**< \brief (TcChannel Offset: 0x0) Channel Control Register */ - __IO uint32_t TC_CMR; /**< \brief (TcChannel Offset: 0x4) Channel Mode Register */ - __IO uint32_t TC_SMMR; /**< \brief (TcChannel Offset: 0x8) Stepper Motor Mode Register */ - __I uint32_t TC_RAB; /**< \brief (TcChannel Offset: 0xC) Register AB */ - __I uint32_t TC_CV; /**< \brief (TcChannel Offset: 0x10) Counter Value */ - __IO uint32_t TC_RA; /**< \brief (TcChannel Offset: 0x14) Register A */ - __IO uint32_t TC_RB; /**< \brief (TcChannel Offset: 0x18) Register B */ - __IO uint32_t TC_RC; /**< \brief (TcChannel Offset: 0x1C) Register C */ - __I uint32_t TC_SR; /**< \brief (TcChannel Offset: 0x20) Status Register */ - __O uint32_t TC_IER; /**< \brief (TcChannel Offset: 0x24) Interrupt Enable Register */ - __O uint32_t TC_IDR; /**< \brief (TcChannel Offset: 0x28) Interrupt Disable Register */ - __I uint32_t TC_IMR; /**< \brief (TcChannel Offset: 0x2C) Interrupt Mask Register */ - __IO uint32_t TC_EMR; /**< \brief (TcChannel Offset: 0x30) Extended Mode Register */ - __I uint32_t Reserved1[3]; -} TcChannel; -/** \brief Tc hardware registers */ -#define TCCHANNEL_NUMBER 3 -typedef struct { - TcChannel TC_CHANNEL[TCCHANNEL_NUMBER]; /**< \brief (Tc Offset: 0x0) channel = 0 .. 2 */ - __O uint32_t TC_BCR; /**< \brief (Tc Offset: 0xC0) Block Control Register */ - __IO uint32_t TC_BMR; /**< \brief (Tc Offset: 0xC4) Block Mode Register */ - __O uint32_t TC_QIER; /**< \brief (Tc Offset: 0xC8) QDEC Interrupt Enable Register */ - __O uint32_t TC_QIDR; /**< \brief (Tc Offset: 0xCC) QDEC Interrupt Disable Register */ - __I uint32_t TC_QIMR; /**< \brief (Tc Offset: 0xD0) QDEC Interrupt Mask Register */ - __I uint32_t TC_QISR; /**< \brief (Tc Offset: 0xD4) QDEC Interrupt Status Register */ - __IO uint32_t TC_FMR; /**< \brief (Tc Offset: 0xD8) Fault Mode Register */ - __I uint32_t Reserved1[2]; - __IO uint32_t TC_WPMR; /**< \brief (Tc Offset: 0xE4) Write Protection Mode Register */ -} Tc; -#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/* -------- TC_CCR : (TC Offset: N/A) Channel Control Register -------- */ -#define TC_CCR_CLKEN (0x1u << 0) /**< \brief (TC_CCR) Counter Clock Enable Command */ -#define TC_CCR_CLKDIS (0x1u << 1) /**< \brief (TC_CCR) Counter Clock Disable Command */ -#define TC_CCR_SWTRG (0x1u << 2) /**< \brief (TC_CCR) Software Trigger Command */ -/* -------- TC_CMR : (TC Offset: N/A) Channel Mode Register -------- */ -#define TC_CMR_TCCLKS_Pos 0 -#define TC_CMR_TCCLKS_Msk (0x7u << TC_CMR_TCCLKS_Pos) /**< \brief (TC_CMR) Clock Selection */ -#define TC_CMR_TCCLKS(value) ((TC_CMR_TCCLKS_Msk & ((value) << TC_CMR_TCCLKS_Pos))) -#define TC_CMR_TCCLKS_TIMER_CLOCK1 (0x0u << 0) /**< \brief (TC_CMR) Clock selected: internal PCK6 clock signal (from PMC) */ -#define TC_CMR_TCCLKS_TIMER_CLOCK2 (0x1u << 0) /**< \brief (TC_CMR) Clock selected: internal MCK/8 clock signal (from PMC) */ -#define TC_CMR_TCCLKS_TIMER_CLOCK3 (0x2u << 0) /**< \brief (TC_CMR) Clock selected: internal MCK/32 clock signal (from PMC) */ -#define TC_CMR_TCCLKS_TIMER_CLOCK4 (0x3u << 0) /**< \brief (TC_CMR) Clock selected: internal MCK/128 clock signal (from PMC) */ -#define TC_CMR_TCCLKS_TIMER_CLOCK5 (0x4u << 0) /**< \brief (TC_CMR) Clock selected: internal SLCK clock signal (from PMC) */ -#define TC_CMR_TCCLKS_XC0 (0x5u << 0) /**< \brief (TC_CMR) Clock selected: XC0 */ -#define TC_CMR_TCCLKS_XC1 (0x6u << 0) /**< \brief (TC_CMR) Clock selected: XC1 */ -#define TC_CMR_TCCLKS_XC2 (0x7u << 0) /**< \brief (TC_CMR) Clock selected: XC2 */ -#define TC_CMR_CLKI (0x1u << 3) /**< \brief (TC_CMR) Clock Invert */ -#define TC_CMR_BURST_Pos 4 -#define TC_CMR_BURST_Msk (0x3u << TC_CMR_BURST_Pos) /**< \brief (TC_CMR) Burst Signal Selection */ -#define TC_CMR_BURST(value) ((TC_CMR_BURST_Msk & ((value) << TC_CMR_BURST_Pos))) -#define TC_CMR_BURST_NONE (0x0u << 4) /**< \brief (TC_CMR) The clock is not gated by an external signal. */ -#define TC_CMR_BURST_XC0 (0x1u << 4) /**< \brief (TC_CMR) XC0 is ANDed with the selected clock. */ -#define TC_CMR_BURST_XC1 (0x2u << 4) /**< \brief (TC_CMR) XC1 is ANDed with the selected clock. */ -#define TC_CMR_BURST_XC2 (0x3u << 4) /**< \brief (TC_CMR) XC2 is ANDed with the selected clock. */ -#define TC_CMR_LDBSTOP (0x1u << 6) /**< \brief (TC_CMR) Counter Clock Stopped with RB Loading */ -#define TC_CMR_LDBDIS (0x1u << 7) /**< \brief (TC_CMR) Counter Clock Disable with RB Loading */ -#define TC_CMR_ETRGEDG_Pos 8 -#define TC_CMR_ETRGEDG_Msk (0x3u << TC_CMR_ETRGEDG_Pos) /**< \brief (TC_CMR) External Trigger Edge Selection */ -#define TC_CMR_ETRGEDG(value) ((TC_CMR_ETRGEDG_Msk & ((value) << TC_CMR_ETRGEDG_Pos))) -#define TC_CMR_ETRGEDG_NONE (0x0u << 8) /**< \brief (TC_CMR) The clock is not gated by an external signal. */ -#define TC_CMR_ETRGEDG_RISING (0x1u << 8) /**< \brief (TC_CMR) Rising edge */ -#define TC_CMR_ETRGEDG_FALLING (0x2u << 8) /**< \brief (TC_CMR) Falling edge */ -#define TC_CMR_ETRGEDG_EDGE (0x3u << 8) /**< \brief (TC_CMR) Each edge */ -#define TC_CMR_ABETRG (0x1u << 10) /**< \brief (TC_CMR) TIOA or TIOB External Trigger Selection */ -#define TC_CMR_CPCTRG (0x1u << 14) /**< \brief (TC_CMR) RC Compare Trigger Enable */ -#define TC_CMR_WAVE (0x1u << 15) /**< \brief (TC_CMR) Waveform Mode */ -#define TC_CMR_LDRA_Pos 16 -#define TC_CMR_LDRA_Msk (0x3u << TC_CMR_LDRA_Pos) /**< \brief (TC_CMR) RA Loading Edge Selection */ -#define TC_CMR_LDRA(value) ((TC_CMR_LDRA_Msk & ((value) << TC_CMR_LDRA_Pos))) -#define TC_CMR_LDRA_NONE (0x0u << 16) /**< \brief (TC_CMR) None */ -#define TC_CMR_LDRA_RISING (0x1u << 16) /**< \brief (TC_CMR) Rising edge of TIOA */ -#define TC_CMR_LDRA_FALLING (0x2u << 16) /**< \brief (TC_CMR) Falling edge of TIOA */ -#define TC_CMR_LDRA_EDGE (0x3u << 16) /**< \brief (TC_CMR) Each edge of TIOA */ -#define TC_CMR_LDRB_Pos 18 -#define TC_CMR_LDRB_Msk (0x3u << TC_CMR_LDRB_Pos) /**< \brief (TC_CMR) RB Loading Edge Selection */ -#define TC_CMR_LDRB(value) ((TC_CMR_LDRB_Msk & ((value) << TC_CMR_LDRB_Pos))) -#define TC_CMR_LDRB_NONE (0x0u << 18) /**< \brief (TC_CMR) None */ -#define TC_CMR_LDRB_RISING (0x1u << 18) /**< \brief (TC_CMR) Rising edge of TIOA */ -#define TC_CMR_LDRB_FALLING (0x2u << 18) /**< \brief (TC_CMR) Falling edge of TIOA */ -#define TC_CMR_LDRB_EDGE (0x3u << 18) /**< \brief (TC_CMR) Each edge of TIOA */ -#define TC_CMR_SBSMPLR_Pos 20 -#define TC_CMR_SBSMPLR_Msk (0x7u << TC_CMR_SBSMPLR_Pos) /**< \brief (TC_CMR) Loading Edge Subsampling Ratio */ -#define TC_CMR_SBSMPLR(value) ((TC_CMR_SBSMPLR_Msk & ((value) << TC_CMR_SBSMPLR_Pos))) -#define TC_CMR_SBSMPLR_ONE (0x0u << 20) /**< \brief (TC_CMR) Load a Capture Register each selected edge */ -#define TC_CMR_SBSMPLR_HALF (0x1u << 20) /**< \brief (TC_CMR) Load a Capture Register every 2 selected edges */ -#define TC_CMR_SBSMPLR_FOURTH (0x2u << 20) /**< \brief (TC_CMR) Load a Capture Register every 4 selected edges */ -#define TC_CMR_SBSMPLR_EIGHTH (0x3u << 20) /**< \brief (TC_CMR) Load a Capture Register every 8 selected edges */ -#define TC_CMR_SBSMPLR_SIXTEENTH (0x4u << 20) /**< \brief (TC_CMR) Load a Capture Register every 16 selected edges */ -#define TC_CMR_CPCSTOP (0x1u << 6) /**< \brief (TC_CMR) Counter Clock Stopped with RC Compare */ -#define TC_CMR_CPCDIS (0x1u << 7) /**< \brief (TC_CMR) Counter Clock Disable with RC Compare */ -#define TC_CMR_EEVTEDG_Pos 8 -#define TC_CMR_EEVTEDG_Msk (0x3u << TC_CMR_EEVTEDG_Pos) /**< \brief (TC_CMR) External Event Edge Selection */ -#define TC_CMR_EEVTEDG(value) ((TC_CMR_EEVTEDG_Msk & ((value) << TC_CMR_EEVTEDG_Pos))) -#define TC_CMR_EEVTEDG_NONE (0x0u << 8) /**< \brief (TC_CMR) None */ -#define TC_CMR_EEVTEDG_RISING (0x1u << 8) /**< \brief (TC_CMR) Rising edge */ -#define TC_CMR_EEVTEDG_FALLING (0x2u << 8) /**< \brief (TC_CMR) Falling edge */ -#define TC_CMR_EEVTEDG_EDGE (0x3u << 8) /**< \brief (TC_CMR) Each edge */ -#define TC_CMR_EEVT_Pos 10 -#define TC_CMR_EEVT_Msk (0x3u << TC_CMR_EEVT_Pos) /**< \brief (TC_CMR) External Event Selection */ -#define TC_CMR_EEVT(value) ((TC_CMR_EEVT_Msk & ((value) << TC_CMR_EEVT_Pos))) -#define TC_CMR_EEVT_TIOB (0x0u << 10) /**< \brief (TC_CMR) TIOB */ -#define TC_CMR_EEVT_XC0 (0x1u << 10) /**< \brief (TC_CMR) XC0 */ -#define TC_CMR_EEVT_XC1 (0x2u << 10) /**< \brief (TC_CMR) XC1 */ -#define TC_CMR_EEVT_XC2 (0x3u << 10) /**< \brief (TC_CMR) XC2 */ -#define TC_CMR_ENETRG (0x1u << 12) /**< \brief (TC_CMR) External Event Trigger Enable */ -#define TC_CMR_WAVSEL_Pos 13 -#define TC_CMR_WAVSEL_Msk (0x3u << TC_CMR_WAVSEL_Pos) /**< \brief (TC_CMR) Waveform Selection */ -#define TC_CMR_WAVSEL(value) ((TC_CMR_WAVSEL_Msk & ((value) << TC_CMR_WAVSEL_Pos))) -#define TC_CMR_WAVSEL_UP (0x0u << 13) /**< \brief (TC_CMR) UP mode without automatic trigger on RC Compare */ -#define TC_CMR_WAVSEL_UPDOWN (0x1u << 13) /**< \brief (TC_CMR) UPDOWN mode without automatic trigger on RC Compare */ -#define TC_CMR_WAVSEL_UP_RC (0x2u << 13) /**< \brief (TC_CMR) UP mode with automatic trigger on RC Compare */ -#define TC_CMR_WAVSEL_UPDOWN_RC (0x3u << 13) /**< \brief (TC_CMR) UPDOWN mode with automatic trigger on RC Compare */ -#define TC_CMR_ACPA_Pos 16 -#define TC_CMR_ACPA_Msk (0x3u << TC_CMR_ACPA_Pos) /**< \brief (TC_CMR) RA Compare Effect on TIOA */ -#define TC_CMR_ACPA(value) ((TC_CMR_ACPA_Msk & ((value) << TC_CMR_ACPA_Pos))) -#define TC_CMR_ACPA_NONE (0x0u << 16) /**< \brief (TC_CMR) None */ -#define TC_CMR_ACPA_SET (0x1u << 16) /**< \brief (TC_CMR) Set */ -#define TC_CMR_ACPA_CLEAR (0x2u << 16) /**< \brief (TC_CMR) Clear */ -#define TC_CMR_ACPA_TOGGLE (0x3u << 16) /**< \brief (TC_CMR) Toggle */ -#define TC_CMR_ACPC_Pos 18 -#define TC_CMR_ACPC_Msk (0x3u << TC_CMR_ACPC_Pos) /**< \brief (TC_CMR) RC Compare Effect on TIOA */ -#define TC_CMR_ACPC(value) ((TC_CMR_ACPC_Msk & ((value) << TC_CMR_ACPC_Pos))) -#define TC_CMR_ACPC_NONE (0x0u << 18) /**< \brief (TC_CMR) None */ -#define TC_CMR_ACPC_SET (0x1u << 18) /**< \brief (TC_CMR) Set */ -#define TC_CMR_ACPC_CLEAR (0x2u << 18) /**< \brief (TC_CMR) Clear */ -#define TC_CMR_ACPC_TOGGLE (0x3u << 18) /**< \brief (TC_CMR) Toggle */ -#define TC_CMR_AEEVT_Pos 20 -#define TC_CMR_AEEVT_Msk (0x3u << TC_CMR_AEEVT_Pos) /**< \brief (TC_CMR) External Event Effect on TIOA */ -#define TC_CMR_AEEVT(value) ((TC_CMR_AEEVT_Msk & ((value) << TC_CMR_AEEVT_Pos))) -#define TC_CMR_AEEVT_NONE (0x0u << 20) /**< \brief (TC_CMR) None */ -#define TC_CMR_AEEVT_SET (0x1u << 20) /**< \brief (TC_CMR) Set */ -#define TC_CMR_AEEVT_CLEAR (0x2u << 20) /**< \brief (TC_CMR) Clear */ -#define TC_CMR_AEEVT_TOGGLE (0x3u << 20) /**< \brief (TC_CMR) Toggle */ -#define TC_CMR_ASWTRG_Pos 22 -#define TC_CMR_ASWTRG_Msk (0x3u << TC_CMR_ASWTRG_Pos) /**< \brief (TC_CMR) Software Trigger Effect on TIOA */ -#define TC_CMR_ASWTRG(value) ((TC_CMR_ASWTRG_Msk & ((value) << TC_CMR_ASWTRG_Pos))) -#define TC_CMR_ASWTRG_NONE (0x0u << 22) /**< \brief (TC_CMR) None */ -#define TC_CMR_ASWTRG_SET (0x1u << 22) /**< \brief (TC_CMR) Set */ -#define TC_CMR_ASWTRG_CLEAR (0x2u << 22) /**< \brief (TC_CMR) Clear */ -#define TC_CMR_ASWTRG_TOGGLE (0x3u << 22) /**< \brief (TC_CMR) Toggle */ -#define TC_CMR_BCPB_Pos 24 -#define TC_CMR_BCPB_Msk (0x3u << TC_CMR_BCPB_Pos) /**< \brief (TC_CMR) RB Compare Effect on TIOB */ -#define TC_CMR_BCPB(value) ((TC_CMR_BCPB_Msk & ((value) << TC_CMR_BCPB_Pos))) -#define TC_CMR_BCPB_NONE (0x0u << 24) /**< \brief (TC_CMR) None */ -#define TC_CMR_BCPB_SET (0x1u << 24) /**< \brief (TC_CMR) Set */ -#define TC_CMR_BCPB_CLEAR (0x2u << 24) /**< \brief (TC_CMR) Clear */ -#define TC_CMR_BCPB_TOGGLE (0x3u << 24) /**< \brief (TC_CMR) Toggle */ -#define TC_CMR_BCPC_Pos 26 -#define TC_CMR_BCPC_Msk (0x3u << TC_CMR_BCPC_Pos) /**< \brief (TC_CMR) RC Compare Effect on TIOB */ -#define TC_CMR_BCPC(value) ((TC_CMR_BCPC_Msk & ((value) << TC_CMR_BCPC_Pos))) -#define TC_CMR_BCPC_NONE (0x0u << 26) /**< \brief (TC_CMR) None */ -#define TC_CMR_BCPC_SET (0x1u << 26) /**< \brief (TC_CMR) Set */ -#define TC_CMR_BCPC_CLEAR (0x2u << 26) /**< \brief (TC_CMR) Clear */ -#define TC_CMR_BCPC_TOGGLE (0x3u << 26) /**< \brief (TC_CMR) Toggle */ -#define TC_CMR_BEEVT_Pos 28 -#define TC_CMR_BEEVT_Msk (0x3u << TC_CMR_BEEVT_Pos) /**< \brief (TC_CMR) External Event Effect on TIOB */ -#define TC_CMR_BEEVT(value) ((TC_CMR_BEEVT_Msk & ((value) << TC_CMR_BEEVT_Pos))) -#define TC_CMR_BEEVT_NONE (0x0u << 28) /**< \brief (TC_CMR) None */ -#define TC_CMR_BEEVT_SET (0x1u << 28) /**< \brief (TC_CMR) Set */ -#define TC_CMR_BEEVT_CLEAR (0x2u << 28) /**< \brief (TC_CMR) Clear */ -#define TC_CMR_BEEVT_TOGGLE (0x3u << 28) /**< \brief (TC_CMR) Toggle */ -#define TC_CMR_BSWTRG_Pos 30 -#define TC_CMR_BSWTRG_Msk (0x3u << TC_CMR_BSWTRG_Pos) /**< \brief (TC_CMR) Software Trigger Effect on TIOB */ -#define TC_CMR_BSWTRG(value) ((TC_CMR_BSWTRG_Msk & ((value) << TC_CMR_BSWTRG_Pos))) -#define TC_CMR_BSWTRG_NONE (0x0u << 30) /**< \brief (TC_CMR) None */ -#define TC_CMR_BSWTRG_SET (0x1u << 30) /**< \brief (TC_CMR) Set */ -#define TC_CMR_BSWTRG_CLEAR (0x2u << 30) /**< \brief (TC_CMR) Clear */ -#define TC_CMR_BSWTRG_TOGGLE (0x3u << 30) /**< \brief (TC_CMR) Toggle */ -/* -------- TC_SMMR : (TC Offset: N/A) Stepper Motor Mode Register -------- */ -#define TC_SMMR_GCEN (0x1u << 0) /**< \brief (TC_SMMR) Gray Count Enable */ -#define TC_SMMR_DOWN (0x1u << 1) /**< \brief (TC_SMMR) Down Count */ -/* -------- TC_RAB : (TC Offset: N/A) Register AB -------- */ -#define TC_RAB_RAB_Pos 0 -#define TC_RAB_RAB_Msk (0xffffffffu << TC_RAB_RAB_Pos) /**< \brief (TC_RAB) Register A or Register B */ -/* -------- TC_CV : (TC Offset: N/A) Counter Value -------- */ -#define TC_CV_CV_Pos 0 -#define TC_CV_CV_Msk (0xffffffffu << TC_CV_CV_Pos) /**< \brief (TC_CV) Counter Value */ -/* -------- TC_RA : (TC Offset: N/A) Register A -------- */ -#define TC_RA_RA_Pos 0 -#define TC_RA_RA_Msk (0xffffffffu << TC_RA_RA_Pos) /**< \brief (TC_RA) Register A */ -#define TC_RA_RA(value) ((TC_RA_RA_Msk & ((value) << TC_RA_RA_Pos))) -/* -------- TC_RB : (TC Offset: N/A) Register B -------- */ -#define TC_RB_RB_Pos 0 -#define TC_RB_RB_Msk (0xffffffffu << TC_RB_RB_Pos) /**< \brief (TC_RB) Register B */ -#define TC_RB_RB(value) ((TC_RB_RB_Msk & ((value) << TC_RB_RB_Pos))) -/* -------- TC_RC : (TC Offset: N/A) Register C -------- */ -#define TC_RC_RC_Pos 0 -#define TC_RC_RC_Msk (0xffffffffu << TC_RC_RC_Pos) /**< \brief (TC_RC) Register C */ -#define TC_RC_RC(value) ((TC_RC_RC_Msk & ((value) << TC_RC_RC_Pos))) -/* -------- TC_SR : (TC Offset: N/A) Status Register -------- */ -#define TC_SR_COVFS (0x1u << 0) /**< \brief (TC_SR) Counter Overflow Status (cleared on read) */ -#define TC_SR_LOVRS (0x1u << 1) /**< \brief (TC_SR) Load Overrun Status (cleared on read) */ -#define TC_SR_CPAS (0x1u << 2) /**< \brief (TC_SR) RA Compare Status (cleared on read) */ -#define TC_SR_CPBS (0x1u << 3) /**< \brief (TC_SR) RB Compare Status (cleared on read) */ -#define TC_SR_CPCS (0x1u << 4) /**< \brief (TC_SR) RC Compare Status (cleared on read) */ -#define TC_SR_LDRAS (0x1u << 5) /**< \brief (TC_SR) RA Loading Status (cleared on read) */ -#define TC_SR_LDRBS (0x1u << 6) /**< \brief (TC_SR) RB Loading Status (cleared on read) */ -#define TC_SR_ETRGS (0x1u << 7) /**< \brief (TC_SR) External Trigger Status (cleared on read) */ -#define TC_SR_CLKSTA (0x1u << 16) /**< \brief (TC_SR) Clock Enabling Status */ -#define TC_SR_MTIOA (0x1u << 17) /**< \brief (TC_SR) TIOA Mirror */ -#define TC_SR_MTIOB (0x1u << 18) /**< \brief (TC_SR) TIOB Mirror */ -/* -------- TC_IER : (TC Offset: N/A) Interrupt Enable Register -------- */ -#define TC_IER_COVFS (0x1u << 0) /**< \brief (TC_IER) Counter Overflow */ -#define TC_IER_LOVRS (0x1u << 1) /**< \brief (TC_IER) Load Overrun */ -#define TC_IER_CPAS (0x1u << 2) /**< \brief (TC_IER) RA Compare */ -#define TC_IER_CPBS (0x1u << 3) /**< \brief (TC_IER) RB Compare */ -#define TC_IER_CPCS (0x1u << 4) /**< \brief (TC_IER) RC Compare */ -#define TC_IER_LDRAS (0x1u << 5) /**< \brief (TC_IER) RA Loading */ -#define TC_IER_LDRBS (0x1u << 6) /**< \brief (TC_IER) RB Loading */ -#define TC_IER_ETRGS (0x1u << 7) /**< \brief (TC_IER) External Trigger */ -/* -------- TC_IDR : (TC Offset: N/A) Interrupt Disable Register -------- */ -#define TC_IDR_COVFS (0x1u << 0) /**< \brief (TC_IDR) Counter Overflow */ -#define TC_IDR_LOVRS (0x1u << 1) /**< \brief (TC_IDR) Load Overrun */ -#define TC_IDR_CPAS (0x1u << 2) /**< \brief (TC_IDR) RA Compare */ -#define TC_IDR_CPBS (0x1u << 3) /**< \brief (TC_IDR) RB Compare */ -#define TC_IDR_CPCS (0x1u << 4) /**< \brief (TC_IDR) RC Compare */ -#define TC_IDR_LDRAS (0x1u << 5) /**< \brief (TC_IDR) RA Loading */ -#define TC_IDR_LDRBS (0x1u << 6) /**< \brief (TC_IDR) RB Loading */ -#define TC_IDR_ETRGS (0x1u << 7) /**< \brief (TC_IDR) External Trigger */ -/* -------- TC_IMR : (TC Offset: N/A) Interrupt Mask Register -------- */ -#define TC_IMR_COVFS (0x1u << 0) /**< \brief (TC_IMR) Counter Overflow */ -#define TC_IMR_LOVRS (0x1u << 1) /**< \brief (TC_IMR) Load Overrun */ -#define TC_IMR_CPAS (0x1u << 2) /**< \brief (TC_IMR) RA Compare */ -#define TC_IMR_CPBS (0x1u << 3) /**< \brief (TC_IMR) RB Compare */ -#define TC_IMR_CPCS (0x1u << 4) /**< \brief (TC_IMR) RC Compare */ -#define TC_IMR_LDRAS (0x1u << 5) /**< \brief (TC_IMR) RA Loading */ -#define TC_IMR_LDRBS (0x1u << 6) /**< \brief (TC_IMR) RB Loading */ -#define TC_IMR_ETRGS (0x1u << 7) /**< \brief (TC_IMR) External Trigger */ -/* -------- TC_EMR : (TC Offset: N/A) Extended Mode Register -------- */ -#define TC_EMR_TRIGSRCA_Pos 0 -#define TC_EMR_TRIGSRCA_Msk (0x3u << TC_EMR_TRIGSRCA_Pos) /**< \brief (TC_EMR) Trigger Source for Input A */ -#define TC_EMR_TRIGSRCA(value) ((TC_EMR_TRIGSRCA_Msk & ((value) << TC_EMR_TRIGSRCA_Pos))) -#define TC_EMR_TRIGSRCA_EXTERNAL_TIOAx (0x0u << 0) /**< \brief (TC_EMR) The trigger/capture input A is driven by external pin TIOAx */ -#define TC_EMR_TRIGSRCA_PWMx (0x1u << 0) /**< \brief (TC_EMR) The trigger/capture input A is driven internally by PWMx */ -#define TC_EMR_TRIGSRCB_Pos 4 -#define TC_EMR_TRIGSRCB_Msk (0x3u << TC_EMR_TRIGSRCB_Pos) /**< \brief (TC_EMR) Trigger Source for Input B */ -#define TC_EMR_TRIGSRCB(value) ((TC_EMR_TRIGSRCB_Msk & ((value) << TC_EMR_TRIGSRCB_Pos))) -#define TC_EMR_TRIGSRCB_EXTERNAL_TIOBx (0x0u << 4) /**< \brief (TC_EMR) The trigger/capture input B is driven by external pin TIOBx */ -#define TC_EMR_TRIGSRCB_PWMx (0x1u << 4) /**< \brief (TC_EMR) The trigger/capture input B is driven internally by PWMx */ -#define TC_EMR_NODIVCLK (0x1u << 8) /**< \brief (TC_EMR) No Divided Clock */ -/* -------- TC_BCR : (TC Offset: 0xC0) Block Control Register -------- */ -#define TC_BCR_SYNC (0x1u << 0) /**< \brief (TC_BCR) Synchro Command */ -/* -------- TC_BMR : (TC Offset: 0xC4) Block Mode Register -------- */ -#define TC_BMR_TC0XC0S_Pos 0 -#define TC_BMR_TC0XC0S_Msk (0x3u << TC_BMR_TC0XC0S_Pos) /**< \brief (TC_BMR) External Clock Signal 0 Selection */ -#define TC_BMR_TC0XC0S(value) ((TC_BMR_TC0XC0S_Msk & ((value) << TC_BMR_TC0XC0S_Pos))) -#define TC_BMR_TC0XC0S_TCLK0 (0x0u << 0) /**< \brief (TC_BMR) Signal connected to XC0: TCLK0 */ -#define TC_BMR_TC0XC0S_TIOA1 (0x2u << 0) /**< \brief (TC_BMR) Signal connected to XC0: TIOA1 */ -#define TC_BMR_TC0XC0S_TIOA2 (0x3u << 0) /**< \brief (TC_BMR) Signal connected to XC0: TIOA2 */ -#define TC_BMR_TC1XC1S_Pos 2 -#define TC_BMR_TC1XC1S_Msk (0x3u << TC_BMR_TC1XC1S_Pos) /**< \brief (TC_BMR) External Clock Signal 1 Selection */ -#define TC_BMR_TC1XC1S(value) ((TC_BMR_TC1XC1S_Msk & ((value) << TC_BMR_TC1XC1S_Pos))) -#define TC_BMR_TC1XC1S_TCLK1 (0x0u << 2) /**< \brief (TC_BMR) Signal connected to XC1: TCLK1 */ -#define TC_BMR_TC1XC1S_TIOA0 (0x2u << 2) /**< \brief (TC_BMR) Signal connected to XC1: TIOA0 */ -#define TC_BMR_TC1XC1S_TIOA2 (0x3u << 2) /**< \brief (TC_BMR) Signal connected to XC1: TIOA2 */ -#define TC_BMR_TC2XC2S_Pos 4 -#define TC_BMR_TC2XC2S_Msk (0x3u << TC_BMR_TC2XC2S_Pos) /**< \brief (TC_BMR) External Clock Signal 2 Selection */ -#define TC_BMR_TC2XC2S(value) ((TC_BMR_TC2XC2S_Msk & ((value) << TC_BMR_TC2XC2S_Pos))) -#define TC_BMR_TC2XC2S_TCLK2 (0x0u << 4) /**< \brief (TC_BMR) Signal connected to XC2: TCLK2 */ -#define TC_BMR_TC2XC2S_TIOA0 (0x2u << 4) /**< \brief (TC_BMR) Signal connected to XC2: TIOA0 */ -#define TC_BMR_TC2XC2S_TIOA1 (0x3u << 4) /**< \brief (TC_BMR) Signal connected to XC2: TIOA1 */ -#define TC_BMR_QDEN (0x1u << 8) /**< \brief (TC_BMR) Quadrature Decoder Enabled */ -#define TC_BMR_POSEN (0x1u << 9) /**< \brief (TC_BMR) Position Enabled */ -#define TC_BMR_SPEEDEN (0x1u << 10) /**< \brief (TC_BMR) Speed Enabled */ -#define TC_BMR_QDTRANS (0x1u << 11) /**< \brief (TC_BMR) Quadrature Decoding Transparent */ -#define TC_BMR_EDGPHA (0x1u << 12) /**< \brief (TC_BMR) Edge on PHA Count Mode */ -#define TC_BMR_INVA (0x1u << 13) /**< \brief (TC_BMR) Inverted PHA */ -#define TC_BMR_INVB (0x1u << 14) /**< \brief (TC_BMR) Inverted PHB */ -#define TC_BMR_INVIDX (0x1u << 15) /**< \brief (TC_BMR) Inverted Index */ -#define TC_BMR_SWAP (0x1u << 16) /**< \brief (TC_BMR) Swap PHA and PHB */ -#define TC_BMR_IDXPHB (0x1u << 17) /**< \brief (TC_BMR) Index Pin is PHB Pin */ -#define TC_BMR_MAXFILT_Pos 20 -#define TC_BMR_MAXFILT_Msk (0x3fu << TC_BMR_MAXFILT_Pos) /**< \brief (TC_BMR) Maximum Filter */ -#define TC_BMR_MAXFILT(value) ((TC_BMR_MAXFILT_Msk & ((value) << TC_BMR_MAXFILT_Pos))) -/* -------- TC_QIER : (TC Offset: 0xC8) QDEC Interrupt Enable Register -------- */ -#define TC_QIER_IDX (0x1u << 0) /**< \brief (TC_QIER) Index */ -#define TC_QIER_DIRCHG (0x1u << 1) /**< \brief (TC_QIER) Direction Change */ -#define TC_QIER_QERR (0x1u << 2) /**< \brief (TC_QIER) Quadrature Error */ -/* -------- TC_QIDR : (TC Offset: 0xCC) QDEC Interrupt Disable Register -------- */ -#define TC_QIDR_IDX (0x1u << 0) /**< \brief (TC_QIDR) Index */ -#define TC_QIDR_DIRCHG (0x1u << 1) /**< \brief (TC_QIDR) Direction Change */ -#define TC_QIDR_QERR (0x1u << 2) /**< \brief (TC_QIDR) Quadrature Error */ -/* -------- TC_QIMR : (TC Offset: 0xD0) QDEC Interrupt Mask Register -------- */ -#define TC_QIMR_IDX (0x1u << 0) /**< \brief (TC_QIMR) Index */ -#define TC_QIMR_DIRCHG (0x1u << 1) /**< \brief (TC_QIMR) Direction Change */ -#define TC_QIMR_QERR (0x1u << 2) /**< \brief (TC_QIMR) Quadrature Error */ -/* -------- TC_QISR : (TC Offset: 0xD4) QDEC Interrupt Status Register -------- */ -#define TC_QISR_IDX (0x1u << 0) /**< \brief (TC_QISR) Index */ -#define TC_QISR_DIRCHG (0x1u << 1) /**< \brief (TC_QISR) Direction Change */ -#define TC_QISR_QERR (0x1u << 2) /**< \brief (TC_QISR) Quadrature Error */ -#define TC_QISR_DIR (0x1u << 8) /**< \brief (TC_QISR) Direction */ -/* -------- TC_FMR : (TC Offset: 0xD8) Fault Mode Register -------- */ -#define TC_FMR_ENCF0 (0x1u << 0) /**< \brief (TC_FMR) Enable Compare Fault Channel 0 */ -#define TC_FMR_ENCF1 (0x1u << 1) /**< \brief (TC_FMR) Enable Compare Fault Channel 1 */ -/* -------- TC_WPMR : (TC Offset: 0xE4) Write Protection Mode Register -------- */ -#define TC_WPMR_WPEN (0x1u << 0) /**< \brief (TC_WPMR) Write Protection Enable */ -#define TC_WPMR_WPKEY_Pos 8 -#define TC_WPMR_WPKEY_Msk (0xffffffu << TC_WPMR_WPKEY_Pos) /**< \brief (TC_WPMR) Write Protection Key */ -#define TC_WPMR_WPKEY(value) ((TC_WPMR_WPKEY_Msk & ((value) << TC_WPMR_WPKEY_Pos))) -#define TC_WPMR_WPKEY_PASSWD (0x54494Du << 8) /**< \brief (TC_WPMR) Writing any other value in this field aborts the write operation of the WPEN bit.Always reads as 0. */ - -/*@}*/ - - -#endif /* _SAMV71_TC_COMPONENT_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_trng.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_trng.h deleted file mode 100644 index bf5a25fc..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_trng.h +++ /dev/null @@ -1,73 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_TRNG_COMPONENT_ -#define _SAMV71_TRNG_COMPONENT_ - -/* ============================================================================= */ -/** SOFTWARE API DEFINITION FOR True Random Number Generator */ -/* ============================================================================= */ -/** \addtogroup SAMV71_TRNG True Random Number Generator */ -/*@{*/ - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -/** \brief Trng hardware registers */ -typedef struct { - __O uint32_t TRNG_CR; /**< \brief (Trng Offset: 0x00) Control Register */ - __I uint32_t Reserved1[3]; - __O uint32_t TRNG_IER; /**< \brief (Trng Offset: 0x10) Interrupt Enable Register */ - __O uint32_t TRNG_IDR; /**< \brief (Trng Offset: 0x14) Interrupt Disable Register */ - __I uint32_t TRNG_IMR; /**< \brief (Trng Offset: 0x18) Interrupt Mask Register */ - __I uint32_t TRNG_ISR; /**< \brief (Trng Offset: 0x1C) Interrupt Status Register */ - __I uint32_t Reserved2[12]; - __I uint32_t TRNG_ODATA; /**< \brief (Trng Offset: 0x50) Output Data Register */ -} Trng; -#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/* -------- TRNG_CR : (TRNG Offset: 0x00) Control Register -------- */ -#define TRNG_CR_ENABLE (0x1u << 0) /**< \brief (TRNG_CR) Enables the TRNG to provide random values */ -#define TRNG_CR_KEY_Pos 8 -#define TRNG_CR_KEY_Msk (0xffffffu << TRNG_CR_KEY_Pos) /**< \brief (TRNG_CR) Security Key. */ -#define TRNG_CR_KEY(value) ((TRNG_CR_KEY_Msk & ((value) << TRNG_CR_KEY_Pos))) -#define TRNG_CR_KEY_PASSWD (0x524E47u << 8) /**< \brief (TRNG_CR) Writing any other value in this field aborts the write operation. */ -/* -------- TRNG_IER : (TRNG Offset: 0x10) Interrupt Enable Register -------- */ -#define TRNG_IER_DATRDY (0x1u << 0) /**< \brief (TRNG_IER) Data Ready Interrupt Enable */ -/* -------- TRNG_IDR : (TRNG Offset: 0x14) Interrupt Disable Register -------- */ -#define TRNG_IDR_DATRDY (0x1u << 0) /**< \brief (TRNG_IDR) Data Ready Interrupt Disable */ -/* -------- TRNG_IMR : (TRNG Offset: 0x18) Interrupt Mask Register -------- */ -#define TRNG_IMR_DATRDY (0x1u << 0) /**< \brief (TRNG_IMR) Data Ready Interrupt Mask */ -/* -------- TRNG_ISR : (TRNG Offset: 0x1C) Interrupt Status Register -------- */ -#define TRNG_ISR_DATRDY (0x1u << 0) /**< \brief (TRNG_ISR) Data Ready */ -/* -------- TRNG_ODATA : (TRNG Offset: 0x50) Output Data Register -------- */ -#define TRNG_ODATA_ODATA_Pos 0 -#define TRNG_ODATA_ODATA_Msk (0xffffffffu << TRNG_ODATA_ODATA_Pos) /**< \brief (TRNG_ODATA) Output Data */ - -/*@}*/ - - -#endif /* _SAMV71_TRNG_COMPONENT_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_twi.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_twi.h deleted file mode 100644 index b07b0232..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_twi.h +++ /dev/null @@ -1,165 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAM_TWI_COMPONENT_ -#define _SAM_TWI_COMPONENT_ - -/* ============================================================================= */ -/** SOFTWARE API DEFINITION FOR Two-wire Interface */ -/* ============================================================================= */ -/** \addtogroup SAM_TWI Two-wire Interface */ -/*@{*/ - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -/** \brief Twi hardware registers */ -typedef struct { - __O uint32_t TWI_CR; /**< \brief (Twi Offset: 0x00) Control Register */ - __IO uint32_t TWI_MMR; /**< \brief (Twi Offset: 0x04) Master Mode Register */ - __IO uint32_t TWI_SMR; /**< \brief (Twi Offset: 0x08) Slave Mode Register */ - __IO uint32_t TWI_IADR; /**< \brief (Twi Offset: 0x0C) Internal Address Register */ - __IO uint32_t TWI_CWGR; /**< \brief (Twi Offset: 0x10) Clock Waveform Generator Register */ - __I uint32_t Reserved1[3]; - __I uint32_t TWI_SR; /**< \brief (Twi Offset: 0x20) Status Register */ - __O uint32_t TWI_IER; /**< \brief (Twi Offset: 0x24) Interrupt Enable Register */ - __O uint32_t TWI_IDR; /**< \brief (Twi Offset: 0x28) Interrupt Disable Register */ - __I uint32_t TWI_IMR; /**< \brief (Twi Offset: 0x2C) Interrupt Mask Register */ - __I uint32_t TWI_RHR; /**< \brief (Twi Offset: 0x30) Receive Holding Register */ - __O uint32_t TWI_THR; /**< \brief (Twi Offset: 0x34) Transmit Holding Register */ - __I uint32_t Reserved2[43]; - __IO uint32_t TWI_WPMR; /**< \brief (Twi Offset: 0xE4) Write Protection Mode Register */ - __I uint32_t TWI_WPSR; /**< \brief (Twi Offset: 0xE8) Write Protection Status Register */ -} Twi; -#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/* -------- TWI_CR : (TWI Offset: 0x00) Control Register -------- */ -#define TWI_CR_START (0x1u << 0) /**< \brief (TWI_CR) Send a START Condition */ -#define TWI_CR_STOP (0x1u << 1) /**< \brief (TWI_CR) Send a STOP Condition */ -#define TWI_CR_MSEN (0x1u << 2) /**< \brief (TWI_CR) TWI Master Mode Enabled */ -#define TWI_CR_MSDIS (0x1u << 3) /**< \brief (TWI_CR) TWI Master Mode Disabled */ -#define TWI_CR_SVEN (0x1u << 4) /**< \brief (TWI_CR) TWI Slave Mode Enabled */ -#define TWI_CR_SVDIS (0x1u << 5) /**< \brief (TWI_CR) TWI Slave Mode Disabled */ -#define TWI_CR_QUICK (0x1u << 6) /**< \brief (TWI_CR) SMBUS Quick Command */ -#define TWI_CR_SWRST (0x1u << 7) /**< \brief (TWI_CR) Software Reset */ -/* -------- TWI_MMR : (TWI Offset: 0x04) Master Mode Register -------- */ -#define TWI_MMR_IADRSZ_Pos 8 -#define TWI_MMR_IADRSZ_Msk (0x3u << TWI_MMR_IADRSZ_Pos) /**< \brief (TWI_MMR) Internal Device Address Size */ -#define TWI_MMR_IADRSZ_NONE (0x0u << 8) /**< \brief (TWI_MMR) No internal device address */ -#define TWI_MMR_IADRSZ_1_BYTE (0x1u << 8) /**< \brief (TWI_MMR) One-byte internal device address */ -#define TWI_MMR_IADRSZ_2_BYTE (0x2u << 8) /**< \brief (TWI_MMR) Two-byte internal device address */ -#define TWI_MMR_IADRSZ_3_BYTE (0x3u << 8) /**< \brief (TWI_MMR) Three-byte internal device address */ -#define TWI_MMR_MREAD (0x1u << 12) /**< \brief (TWI_MMR) Master Read Direction */ -#define TWI_MMR_DADR_Pos 16 -#define TWI_MMR_DADR_Msk (0x7fu << TWI_MMR_DADR_Pos) /**< \brief (TWI_MMR) Device Address */ -#define TWI_MMR_DADR(value) ((TWI_MMR_DADR_Msk & ((value) << TWI_MMR_DADR_Pos))) -/* -------- TWI_SMR : (TWI Offset: 0x08) Slave Mode Register -------- */ -#define TWI_SMR_SADR_Pos 16 -#define TWI_SMR_SADR_Msk (0x7fu << TWI_SMR_SADR_Pos) /**< \brief (TWI_SMR) Slave Address */ -#define TWI_SMR_SADR(value) ((TWI_SMR_SADR_Msk & ((value) << TWI_SMR_SADR_Pos))) -/* -------- TWI_IADR : (TWI Offset: 0x0C) Internal Address Register -------- */ -#define TWI_IADR_IADR_Pos 0 -#define TWI_IADR_IADR_Msk (0xffffffu << TWI_IADR_IADR_Pos) /**< \brief (TWI_IADR) Internal Address */ -#define TWI_IADR_IADR(value) ((TWI_IADR_IADR_Msk & ((value) << TWI_IADR_IADR_Pos))) -/* -------- TWI_CWGR : (TWI Offset: 0x10) Clock Waveform Generator Register -------- */ -#define TWI_CWGR_CLDIV_Pos 0 -#define TWI_CWGR_CLDIV_Msk (0xffu << TWI_CWGR_CLDIV_Pos) /**< \brief (TWI_CWGR) Clock Low Divider */ -#define TWI_CWGR_CLDIV(value) ((TWI_CWGR_CLDIV_Msk & ((value) << TWI_CWGR_CLDIV_Pos))) -#define TWI_CWGR_CHDIV_Pos 8 -#define TWI_CWGR_CHDIV_Msk (0xffu << TWI_CWGR_CHDIV_Pos) /**< \brief (TWI_CWGR) Clock High Divider */ -#define TWI_CWGR_CHDIV(value) ((TWI_CWGR_CHDIV_Msk & ((value) << TWI_CWGR_CHDIV_Pos))) -#define TWI_CWGR_CKDIV_Pos 16 -#define TWI_CWGR_CKDIV_Msk (0x7u << TWI_CWGR_CKDIV_Pos) /**< \brief (TWI_CWGR) Clock Divider */ -#define TWI_CWGR_CKDIV(value) ((TWI_CWGR_CKDIV_Msk & ((value) << TWI_CWGR_CKDIV_Pos))) -#define TWI_CWGR_HOLD_Pos 24 -#define TWI_CWGR_HOLD_Msk (0x1fu << TWI_CWGR_HOLD_Pos) /**< \brief (TWI_CWGR) TWD Hold Time versus TWCK falling */ -#define TWI_CWGR_HOLD(value) ((TWI_CWGR_HOLD_Msk & ((value) << TWI_CWGR_HOLD_Pos))) -/* -------- TWI_SR : (TWI Offset: 0x20) Status Register -------- */ -#define TWI_SR_TXCOMP (0x1u << 0) /**< \brief (TWI_SR) Transmission Completed (automatically set / reset) */ -#define TWI_SR_RXRDY (0x1u << 1) /**< \brief (TWI_SR) Receive Holding Register Ready (automatically set / reset) */ -#define TWI_SR_TXRDY (0x1u << 2) /**< \brief (TWI_SR) Transmit Holding Register Ready (automatically set / reset) */ -#define TWI_SR_SVREAD (0x1u << 3) /**< \brief (TWI_SR) Slave Read (automatically set / reset) */ -#define TWI_SR_SVACC (0x1u << 4) /**< \brief (TWI_SR) Slave Access (automatically set / reset) */ -#define TWI_SR_GACC (0x1u << 5) /**< \brief (TWI_SR) General Call Access (clear on read) */ -#define TWI_SR_OVRE (0x1u << 6) /**< \brief (TWI_SR) Overrun Error (clear on read) */ -#define TWI_SR_NACK (0x1u << 8) /**< \brief (TWI_SR) Not Acknowledged (clear on read) */ -#define TWI_SR_ARBLST (0x1u << 9) /**< \brief (TWI_SR) Arbitration Lost (clear on read) */ -#define TWI_SR_SCLWS (0x1u << 10) /**< \brief (TWI_SR) Clock Wait State (automatically set / reset) */ -#define TWI_SR_EOSACC (0x1u << 11) /**< \brief (TWI_SR) End Of Slave Access (clear on read) */ -/* -------- TWI_IER : (TWI Offset: 0x24) Interrupt Enable Register -------- */ -#define TWI_IER_TXCOMP (0x1u << 0) /**< \brief (TWI_IER) Transmission Completed Interrupt Enable */ -#define TWI_IER_RXRDY (0x1u << 1) /**< \brief (TWI_IER) Receive Holding Register Ready Interrupt Enable */ -#define TWI_IER_TXRDY (0x1u << 2) /**< \brief (TWI_IER) Transmit Holding Register Ready Interrupt Enable */ -#define TWI_IER_SVACC (0x1u << 4) /**< \brief (TWI_IER) Slave Access Interrupt Enable */ -#define TWI_IER_GACC (0x1u << 5) /**< \brief (TWI_IER) General Call Access Interrupt Enable */ -#define TWI_IER_OVRE (0x1u << 6) /**< \brief (TWI_IER) Overrun Error Interrupt Enable */ -#define TWI_IER_NACK (0x1u << 8) /**< \brief (TWI_IER) Not Acknowledge Interrupt Enable */ -#define TWI_IER_ARBLST (0x1u << 9) /**< \brief (TWI_IER) Arbitration Lost Interrupt Enable */ -#define TWI_IER_SCL_WS (0x1u << 10) /**< \brief (TWI_IER) Clock Wait State Interrupt Enable */ -#define TWI_IER_EOSACC (0x1u << 11) /**< \brief (TWI_IER) End Of Slave Access Interrupt Enable */ -/* -------- TWI_IDR : (TWI Offset: 0x28) Interrupt Disable Register -------- */ -#define TWI_IDR_TXCOMP (0x1u << 0) /**< \brief (TWI_IDR) Transmission Completed Interrupt Disable */ -#define TWI_IDR_RXRDY (0x1u << 1) /**< \brief (TWI_IDR) Receive Holding Register Ready Interrupt Disable */ -#define TWI_IDR_TXRDY (0x1u << 2) /**< \brief (TWI_IDR) Transmit Holding Register Ready Interrupt Disable */ -#define TWI_IDR_SVACC (0x1u << 4) /**< \brief (TWI_IDR) Slave Access Interrupt Disable */ -#define TWI_IDR_GACC (0x1u << 5) /**< \brief (TWI_IDR) General Call Access Interrupt Disable */ -#define TWI_IDR_OVRE (0x1u << 6) /**< \brief (TWI_IDR) Overrun Error Interrupt Disable */ -#define TWI_IDR_NACK (0x1u << 8) /**< \brief (TWI_IDR) Not Acknowledge Interrupt Disable */ -#define TWI_IDR_ARBLST (0x1u << 9) /**< \brief (TWI_IDR) Arbitration Lost Interrupt Disable */ -#define TWI_IDR_SCL_WS (0x1u << 10) /**< \brief (TWI_IDR) Clock Wait State Interrupt Disable */ -#define TWI_IDR_EOSACC (0x1u << 11) /**< \brief (TWI_IDR) End Of Slave Access Interrupt Disable */ -/* -------- TWI_IMR : (TWI Offset: 0x2C) Interrupt Mask Register -------- */ -#define TWI_IMR_TXCOMP (0x1u << 0) /**< \brief (TWI_IMR) Transmission Completed Interrupt Mask */ -#define TWI_IMR_RXRDY (0x1u << 1) /**< \brief (TWI_IMR) Receive Holding Register Ready Interrupt Mask */ -#define TWI_IMR_TXRDY (0x1u << 2) /**< \brief (TWI_IMR) Transmit Holding Register Ready Interrupt Mask */ -#define TWI_IMR_SVACC (0x1u << 4) /**< \brief (TWI_IMR) Slave Access Interrupt Mask */ -#define TWI_IMR_GACC (0x1u << 5) /**< \brief (TWI_IMR) General Call Access Interrupt Mask */ -#define TWI_IMR_OVRE (0x1u << 6) /**< \brief (TWI_IMR) Overrun Error Interrupt Mask */ -#define TWI_IMR_NACK (0x1u << 8) /**< \brief (TWI_IMR) Not Acknowledge Interrupt Mask */ -#define TWI_IMR_ARBLST (0x1u << 9) /**< \brief (TWI_IMR) Arbitration Lost Interrupt Mask */ -#define TWI_IMR_SCL_WS (0x1u << 10) /**< \brief (TWI_IMR) Clock Wait State Interrupt Mask */ -#define TWI_IMR_EOSACC (0x1u << 11) /**< \brief (TWI_IMR) End Of Slave Access Interrupt Mask */ -/* -------- TWI_RHR : (TWI Offset: 0x30) Receive Holding Register -------- */ -#define TWI_RHR_RXDATA_Pos 0 -#define TWI_RHR_RXDATA_Msk (0xffu << TWI_RHR_RXDATA_Pos) /**< \brief (TWI_RHR) Master or Slave Receive Holding Data */ -/* -------- TWI_THR : (TWI Offset: 0x34) Transmit Holding Register -------- */ -#define TWI_THR_TXDATA_Pos 0 -#define TWI_THR_TXDATA_Msk (0xffu << TWI_THR_TXDATA_Pos) /**< \brief (TWI_THR) Master or Slave Transmit Holding Data */ -#define TWI_THR_TXDATA(value) ((TWI_THR_TXDATA_Msk & ((value) << TWI_THR_TXDATA_Pos))) -/* -------- TWI_WPMR : (TWI Offset: 0xE4) Write Protection Mode Register -------- */ -#define TWI_WPMR_WPEN (0x1u << 0) /**< \brief (TWI_WPMR) Write Protection Enable */ -#define TWI_WPMR_WPKEY_Pos 8 -#define TWI_WPMR_WPKEY_Msk (0xffffffu << TWI_WPMR_WPKEY_Pos) /**< \brief (TWI_WPMR) Write Protection Key */ -#define TWI_WPMR_WPKEY_PASSWD (0x545749u << 8) /**< \brief (TWI_WPMR) Writing any other value in this field aborts the write operation of the WPEN bit.Always reads as 0 */ -/* -------- TWI_WPSR : (TWI Offset: 0xE8) Write Protection Status Register -------- */ -#define TWI_WPSR_WPVS (0x1u << 0) /**< \brief (TWI_WPSR) Write Protection Violation Status */ -#define TWI_WPSR_WPVSRC_Pos 8 -#define TWI_WPSR_WPVSRC_Msk (0xffffffu << TWI_WPSR_WPVSRC_Pos) /**< \brief (TWI_WPSR) Write Protection Violation Source */ - -/*@}*/ - - -#endif /* _SAM_TWI_COMPONENT_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_twihs.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_twihs.h deleted file mode 100644 index 7473b074..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_twihs.h +++ /dev/null @@ -1,250 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_TWIHS_COMPONENT_ -#define _SAMV71_TWIHS_COMPONENT_ - -/* ============================================================================= */ -/** SOFTWARE API DEFINITION FOR Two-wire Interface High Speed */ -/* ============================================================================= */ -/** \addtogroup SAMV71_TWIHS Two-wire Interface High Speed */ -/*@{*/ - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -/** \brief Twihs hardware registers */ -typedef struct { - __O uint32_t TWIHS_CR; /**< \brief (Twihs Offset: 0x00) Control Register */ - __IO uint32_t TWIHS_MMR; /**< \brief (Twihs Offset: 0x04) Master Mode Register */ - __IO uint32_t TWIHS_SMR; /**< \brief (Twihs Offset: 0x08) Slave Mode Register */ - __IO uint32_t TWIHS_IADR; /**< \brief (Twihs Offset: 0x0C) Internal Address Register */ - __IO uint32_t TWIHS_CWGR; /**< \brief (Twihs Offset: 0x10) Clock Waveform Generator Register */ - __I uint32_t Reserved1[3]; - __I uint32_t TWIHS_SR; /**< \brief (Twihs Offset: 0x20) Status Register */ - __O uint32_t TWIHS_IER; /**< \brief (Twihs Offset: 0x24) Interrupt Enable Register */ - __O uint32_t TWIHS_IDR; /**< \brief (Twihs Offset: 0x28) Interrupt Disable Register */ - __I uint32_t TWIHS_IMR; /**< \brief (Twihs Offset: 0x2C) Interrupt Mask Register */ - __I uint32_t TWIHS_RHR; /**< \brief (Twihs Offset: 0x30) Receive Holding Register */ - __O uint32_t TWIHS_THR; /**< \brief (Twihs Offset: 0x34) Transmit Holding Register */ - __IO uint32_t TWIHS_SMBTR; /**< \brief (Twihs Offset: 0x38) SMBus Timing Register */ - __I uint32_t Reserved2[2]; - __IO uint32_t TWIHS_FILTR; /**< \brief (Twihs Offset: 0x44) Filter Register */ - __I uint32_t Reserved3[1]; - __IO uint32_t TWIHS_SWMR; /**< \brief (Twihs Offset: 0x4C) SleepWalking Matching Register */ - __I uint32_t Reserved4[37]; - __IO uint32_t TWIHS_WPMR; /**< \brief (Twihs Offset: 0xE4) Write Protection Mode Register */ - __I uint32_t TWIHS_WPSR; /**< \brief (Twihs Offset: 0xE8) Write Protection Status Register */ -} Twihs; -#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/* -------- TWIHS_CR : (TWIHS Offset: 0x00) Control Register -------- */ -#define TWIHS_CR_START (0x1u << 0) /**< \brief (TWIHS_CR) Send a START Condition */ -#define TWIHS_CR_STOP (0x1u << 1) /**< \brief (TWIHS_CR) Send a STOP Condition */ -#define TWIHS_CR_MSEN (0x1u << 2) /**< \brief (TWIHS_CR) TWIHS Master Mode Enabled */ -#define TWIHS_CR_MSDIS (0x1u << 3) /**< \brief (TWIHS_CR) TWIHS Master Mode Disabled */ -#define TWIHS_CR_SVEN (0x1u << 4) /**< \brief (TWIHS_CR) TWIHS Slave Mode Enabled */ -#define TWIHS_CR_SVDIS (0x1u << 5) /**< \brief (TWIHS_CR) TWIHS Slave Mode Disabled */ -#define TWIHS_CR_QUICK (0x1u << 6) /**< \brief (TWIHS_CR) SMBus Quick Command */ -#define TWIHS_CR_SWRST (0x1u << 7) /**< \brief (TWIHS_CR) Software Reset */ -#define TWIHS_CR_HSEN (0x1u << 8) /**< \brief (TWIHS_CR) TWIHS High-Speed Mode Enabled */ -#define TWIHS_CR_HSDIS (0x1u << 9) /**< \brief (TWIHS_CR) TWIHS High-Speed Mode Disabled */ -#define TWIHS_CR_SMBEN (0x1u << 10) /**< \brief (TWIHS_CR) SMBus Mode Enabled */ -#define TWIHS_CR_SMBDIS (0x1u << 11) /**< \brief (TWIHS_CR) SMBus Mode Disabled */ -#define TWIHS_CR_PECEN (0x1u << 12) /**< \brief (TWIHS_CR) Packet Error Checking Enable */ -#define TWIHS_CR_PECDIS (0x1u << 13) /**< \brief (TWIHS_CR) Packet Error Checking Disable */ -#define TWIHS_CR_PECRQ (0x1u << 14) /**< \brief (TWIHS_CR) PEC Request */ -#define TWIHS_CR_CLEAR (0x1u << 15) /**< \brief (TWIHS_CR) Bus CLEAR Command */ -/* -------- TWIHS_MMR : (TWIHS Offset: 0x04) Master Mode Register -------- */ -#define TWIHS_MMR_IADRSZ_Pos 8 -#define TWIHS_MMR_IADRSZ_Msk (0x3u << TWIHS_MMR_IADRSZ_Pos) /**< \brief (TWIHS_MMR) Internal Device Address Size */ -#define TWIHS_MMR_IADRSZ(value) ((TWIHS_MMR_IADRSZ_Msk & ((value) << TWIHS_MMR_IADRSZ_Pos))) -#define TWIHS_MMR_IADRSZ_NONE (0x0u << 8) /**< \brief (TWIHS_MMR) No internal device address */ -#define TWIHS_MMR_IADRSZ_1_BYTE (0x1u << 8) /**< \brief (TWIHS_MMR) One-byte internal device address */ -#define TWIHS_MMR_IADRSZ_2_BYTE (0x2u << 8) /**< \brief (TWIHS_MMR) Two-byte internal device address */ -#define TWIHS_MMR_IADRSZ_3_BYTE (0x3u << 8) /**< \brief (TWIHS_MMR) Three-byte internal device address */ -#define TWIHS_MMR_MREAD (0x1u << 12) /**< \brief (TWIHS_MMR) Master Read Direction */ -#define TWIHS_MMR_DADR_Pos 16 -#define TWIHS_MMR_DADR_Msk (0x7fu << TWIHS_MMR_DADR_Pos) /**< \brief (TWIHS_MMR) Device Address */ -#define TWIHS_MMR_DADR(value) ((TWIHS_MMR_DADR_Msk & ((value) << TWIHS_MMR_DADR_Pos))) -/* -------- TWIHS_SMR : (TWIHS Offset: 0x08) Slave Mode Register -------- */ -#define TWIHS_SMR_NACKEN (0x1u << 0) /**< \brief (TWIHS_SMR) Slave Receiver Data Phase NACK enable */ -#define TWIHS_SMR_SMDA (0x1u << 2) /**< \brief (TWIHS_SMR) SMBus Default Address */ -#define TWIHS_SMR_SMHH (0x1u << 3) /**< \brief (TWIHS_SMR) SMBus Host Header */ -#define TWIHS_SMR_SCLWSDIS (0x1u << 6) /**< \brief (TWIHS_SMR) Clock Wait State Disable */ -#define TWIHS_SMR_MASK_Pos 8 -#define TWIHS_SMR_MASK_Msk (0x7fu << TWIHS_SMR_MASK_Pos) /**< \brief (TWIHS_SMR) Slave Address Mask */ -#define TWIHS_SMR_MASK(value) ((TWIHS_SMR_MASK_Msk & ((value) << TWIHS_SMR_MASK_Pos))) -#define TWIHS_SMR_SADR_Pos 16 -#define TWIHS_SMR_SADR_Msk (0x7fu << TWIHS_SMR_SADR_Pos) /**< \brief (TWIHS_SMR) Slave Address */ -#define TWIHS_SMR_SADR(value) ((TWIHS_SMR_SADR_Msk & ((value) << TWIHS_SMR_SADR_Pos))) -#define TWIHS_SMR_SADR1EN (0x1u << 28) /**< \brief (TWIHS_SMR) Slave Address 1 Enable */ -#define TWIHS_SMR_SADR2EN (0x1u << 29) /**< \brief (TWIHS_SMR) Slave Address 2 Enable */ -#define TWIHS_SMR_SADR3EN (0x1u << 30) /**< \brief (TWIHS_SMR) Slave Address 3 Enable */ -#define TWIHS_SMR_DATAMEN (0x1u << 31) /**< \brief (TWIHS_SMR) Data Matching Enable */ -/* -------- TWIHS_IADR : (TWIHS Offset: 0x0C) Internal Address Register -------- */ -#define TWIHS_IADR_IADR_Pos 0 -#define TWIHS_IADR_IADR_Msk (0xffffffu << TWIHS_IADR_IADR_Pos) /**< \brief (TWIHS_IADR) Internal Address */ -#define TWIHS_IADR_IADR(value) ((TWIHS_IADR_IADR_Msk & ((value) << TWIHS_IADR_IADR_Pos))) -/* -------- TWIHS_CWGR : (TWIHS Offset: 0x10) Clock Waveform Generator Register -------- */ -#define TWIHS_CWGR_CLDIV_Pos 0 -#define TWIHS_CWGR_CLDIV_Msk (0xffu << TWIHS_CWGR_CLDIV_Pos) /**< \brief (TWIHS_CWGR) Clock Low Divider */ -#define TWIHS_CWGR_CLDIV(value) ((TWIHS_CWGR_CLDIV_Msk & ((value) << TWIHS_CWGR_CLDIV_Pos))) -#define TWIHS_CWGR_CHDIV_Pos 8 -#define TWIHS_CWGR_CHDIV_Msk (0xffu << TWIHS_CWGR_CHDIV_Pos) /**< \brief (TWIHS_CWGR) Clock High Divider */ -#define TWIHS_CWGR_CHDIV(value) ((TWIHS_CWGR_CHDIV_Msk & ((value) << TWIHS_CWGR_CHDIV_Pos))) -#define TWIHS_CWGR_CKDIV_Pos 16 -#define TWIHS_CWGR_CKDIV_Msk (0x7u << TWIHS_CWGR_CKDIV_Pos) /**< \brief (TWIHS_CWGR) Clock Divider */ -#define TWIHS_CWGR_CKDIV(value) ((TWIHS_CWGR_CKDIV_Msk & ((value) << TWIHS_CWGR_CKDIV_Pos))) -#define TWIHS_CWGR_HOLD_Pos 24 -#define TWIHS_CWGR_HOLD_Msk (0x1fu << TWIHS_CWGR_HOLD_Pos) /**< \brief (TWIHS_CWGR) TWD Hold Time Versus TWCK Falling */ -#define TWIHS_CWGR_HOLD(value) ((TWIHS_CWGR_HOLD_Msk & ((value) << TWIHS_CWGR_HOLD_Pos))) -/* -------- TWIHS_SR : (TWIHS Offset: 0x20) Status Register -------- */ -#define TWIHS_SR_TXCOMP (0x1u << 0) /**< \brief (TWIHS_SR) Transmission Completed (cleared by writing TWIHS_THR) */ -#define TWIHS_SR_RXRDY (0x1u << 1) /**< \brief (TWIHS_SR) Receive Holding Register Ready (cleared by reading TWIHS_RHR) */ -#define TWIHS_SR_TXRDY (0x1u << 2) /**< \brief (TWIHS_SR) Transmit Holding Register Ready (cleared by writing TWIHS_THR) */ -#define TWIHS_SR_SVREAD (0x1u << 3) /**< \brief (TWIHS_SR) Slave Read */ -#define TWIHS_SR_SVACC (0x1u << 4) /**< \brief (TWIHS_SR) Slave Access */ -#define TWIHS_SR_GACC (0x1u << 5) /**< \brief (TWIHS_SR) General Call Access (cleared on read) */ -#define TWIHS_SR_OVRE (0x1u << 6) /**< \brief (TWIHS_SR) Overrun Error (cleared on read) */ -#define TWIHS_SR_UNRE (0x1u << 7) /**< \brief (TWIHS_SR) Underrun Error (cleared on read) */ -#define TWIHS_SR_NACK (0x1u << 8) /**< \brief (TWIHS_SR) Not Acknowledged (cleared on read) */ -#define TWIHS_SR_ARBLST (0x1u << 9) /**< \brief (TWIHS_SR) Arbitration Lost (cleared on read) */ -#define TWIHS_SR_SCLWS (0x1u << 10) /**< \brief (TWIHS_SR) Clock Wait State */ -#define TWIHS_SR_EOSACC (0x1u << 11) /**< \brief (TWIHS_SR) End Of Slave Access (cleared on read) */ -#define TWIHS_SR_MCACK (0x1u << 16) /**< \brief (TWIHS_SR) Master Code Acknowledge (cleared on read) */ -#define TWIHS_SR_TOUT (0x1u << 18) /**< \brief (TWIHS_SR) Timeout Error (cleared on read) */ -#define TWIHS_SR_PECERR (0x1u << 19) /**< \brief (TWIHS_SR) PEC Error (cleared on read) */ -#define TWIHS_SR_SMBDAM (0x1u << 20) /**< \brief (TWIHS_SR) SMBus Default Address Match (cleared on read) */ -#define TWIHS_SR_SMBHHM (0x1u << 21) /**< \brief (TWIHS_SR) SMBus Host Header Address Match (cleared on read) */ -#define TWIHS_SR_SCL (0x1u << 24) /**< \brief (TWIHS_SR) SCL line value */ -#define TWIHS_SR_SDA (0x1u << 25) /**< \brief (TWIHS_SR) SDA line value */ -/* -------- TWIHS_IER : (TWIHS Offset: 0x24) Interrupt Enable Register -------- */ -#define TWIHS_IER_TXCOMP (0x1u << 0) /**< \brief (TWIHS_IER) Transmission Completed Interrupt Enable */ -#define TWIHS_IER_RXRDY (0x1u << 1) /**< \brief (TWIHS_IER) Receive Holding Register Ready Interrupt Enable */ -#define TWIHS_IER_TXRDY (0x1u << 2) /**< \brief (TWIHS_IER) Transmit Holding Register Ready Interrupt Enable */ -#define TWIHS_IER_SVACC (0x1u << 4) /**< \brief (TWIHS_IER) Slave Access Interrupt Enable */ -#define TWIHS_IER_GACC (0x1u << 5) /**< \brief (TWIHS_IER) General Call Access Interrupt Enable */ -#define TWIHS_IER_OVRE (0x1u << 6) /**< \brief (TWIHS_IER) Overrun Error Interrupt Enable */ -#define TWIHS_IER_UNRE (0x1u << 7) /**< \brief (TWIHS_IER) Underrun Error Interrupt Enable */ -#define TWIHS_IER_NACK (0x1u << 8) /**< \brief (TWIHS_IER) Not Acknowledge Interrupt Enable */ -#define TWIHS_IER_ARBLST (0x1u << 9) /**< \brief (TWIHS_IER) Arbitration Lost Interrupt Enable */ -#define TWIHS_IER_SCL_WS (0x1u << 10) /**< \brief (TWIHS_IER) Clock Wait State Interrupt Enable */ -#define TWIHS_IER_EOSACC (0x1u << 11) /**< \brief (TWIHS_IER) End Of Slave Access Interrupt Enable */ -#define TWIHS_IER_MCACK (0x1u << 16) /**< \brief (TWIHS_IER) Master Code Acknowledge Interrupt Enable */ -#define TWIHS_IER_TOUT (0x1u << 18) /**< \brief (TWIHS_IER) Timeout Error Interrupt Enable */ -#define TWIHS_IER_PECERR (0x1u << 19) /**< \brief (TWIHS_IER) PEC Error Interrupt Enable */ -#define TWIHS_IER_SMBDAM (0x1u << 20) /**< \brief (TWIHS_IER) SMBus Default Address Match Interrupt Enable */ -#define TWIHS_IER_SMBHHM (0x1u << 21) /**< \brief (TWIHS_IER) SMBus Host Header Address Match Interrupt Enable */ -/* -------- TWIHS_IDR : (TWIHS Offset: 0x28) Interrupt Disable Register -------- */ -#define TWIHS_IDR_TXCOMP (0x1u << 0) /**< \brief (TWIHS_IDR) Transmission Completed Interrupt Disable */ -#define TWIHS_IDR_RXRDY (0x1u << 1) /**< \brief (TWIHS_IDR) Receive Holding Register Ready Interrupt Disable */ -#define TWIHS_IDR_TXRDY (0x1u << 2) /**< \brief (TWIHS_IDR) Transmit Holding Register Ready Interrupt Disable */ -#define TWIHS_IDR_SVACC (0x1u << 4) /**< \brief (TWIHS_IDR) Slave Access Interrupt Disable */ -#define TWIHS_IDR_GACC (0x1u << 5) /**< \brief (TWIHS_IDR) General Call Access Interrupt Disable */ -#define TWIHS_IDR_OVRE (0x1u << 6) /**< \brief (TWIHS_IDR) Overrun Error Interrupt Disable */ -#define TWIHS_IDR_UNRE (0x1u << 7) /**< \brief (TWIHS_IDR) Underrun Error Interrupt Disable */ -#define TWIHS_IDR_NACK (0x1u << 8) /**< \brief (TWIHS_IDR) Not Acknowledge Interrupt Disable */ -#define TWIHS_IDR_ARBLST (0x1u << 9) /**< \brief (TWIHS_IDR) Arbitration Lost Interrupt Disable */ -#define TWIHS_IDR_SCL_WS (0x1u << 10) /**< \brief (TWIHS_IDR) Clock Wait State Interrupt Disable */ -#define TWIHS_IDR_EOSACC (0x1u << 11) /**< \brief (TWIHS_IDR) End Of Slave Access Interrupt Disable */ -#define TWIHS_IDR_MCACK (0x1u << 16) /**< \brief (TWIHS_IDR) Master Code Acknowledge Interrupt Disable */ -#define TWIHS_IDR_TOUT (0x1u << 18) /**< \brief (TWIHS_IDR) Timeout Error Interrupt Disable */ -#define TWIHS_IDR_PECERR (0x1u << 19) /**< \brief (TWIHS_IDR) PEC Error Interrupt Disable */ -#define TWIHS_IDR_SMBDAM (0x1u << 20) /**< \brief (TWIHS_IDR) SMBus Default Address Match Interrupt Disable */ -#define TWIHS_IDR_SMBHHM (0x1u << 21) /**< \brief (TWIHS_IDR) SMBus Host Header Address Match Interrupt Disable */ -/* -------- TWIHS_IMR : (TWIHS Offset: 0x2C) Interrupt Mask Register -------- */ -#define TWIHS_IMR_TXCOMP (0x1u << 0) /**< \brief (TWIHS_IMR) Transmission Completed Interrupt Mask */ -#define TWIHS_IMR_RXRDY (0x1u << 1) /**< \brief (TWIHS_IMR) Receive Holding Register Ready Interrupt Mask */ -#define TWIHS_IMR_TXRDY (0x1u << 2) /**< \brief (TWIHS_IMR) Transmit Holding Register Ready Interrupt Mask */ -#define TWIHS_IMR_SVACC (0x1u << 4) /**< \brief (TWIHS_IMR) Slave Access Interrupt Mask */ -#define TWIHS_IMR_GACC (0x1u << 5) /**< \brief (TWIHS_IMR) General Call Access Interrupt Mask */ -#define TWIHS_IMR_OVRE (0x1u << 6) /**< \brief (TWIHS_IMR) Overrun Error Interrupt Mask */ -#define TWIHS_IMR_UNRE (0x1u << 7) /**< \brief (TWIHS_IMR) Underrun Error Interrupt Mask */ -#define TWIHS_IMR_NACK (0x1u << 8) /**< \brief (TWIHS_IMR) Not Acknowledge Interrupt Mask */ -#define TWIHS_IMR_ARBLST (0x1u << 9) /**< \brief (TWIHS_IMR) Arbitration Lost Interrupt Mask */ -#define TWIHS_IMR_SCL_WS (0x1u << 10) /**< \brief (TWIHS_IMR) Clock Wait State Interrupt Mask */ -#define TWIHS_IMR_EOSACC (0x1u << 11) /**< \brief (TWIHS_IMR) End Of Slave Access Interrupt Mask */ -#define TWIHS_IMR_MCACK (0x1u << 16) /**< \brief (TWIHS_IMR) Master Code Acknowledge Interrupt Mask */ -#define TWIHS_IMR_TOUT (0x1u << 18) /**< \brief (TWIHS_IMR) Timeout Error Interrupt Mask */ -#define TWIHS_IMR_PECERR (0x1u << 19) /**< \brief (TWIHS_IMR) PEC Error Interrupt Mask */ -#define TWIHS_IMR_SMBDAM (0x1u << 20) /**< \brief (TWIHS_IMR) SMBus Default Address Match Interrupt Mask */ -#define TWIHS_IMR_SMBHHM (0x1u << 21) /**< \brief (TWIHS_IMR) SMBus Host Header Address Match Interrupt Mask */ -/* -------- TWIHS_RHR : (TWIHS Offset: 0x30) Receive Holding Register -------- */ -#define TWIHS_RHR_RXDATA_Pos 0 -#define TWIHS_RHR_RXDATA_Msk (0xffu << TWIHS_RHR_RXDATA_Pos) /**< \brief (TWIHS_RHR) Master or Slave Receive Holding Data */ -/* -------- TWIHS_THR : (TWIHS Offset: 0x34) Transmit Holding Register -------- */ -#define TWIHS_THR_TXDATA_Pos 0 -#define TWIHS_THR_TXDATA_Msk (0xffu << TWIHS_THR_TXDATA_Pos) /**< \brief (TWIHS_THR) Master or Slave Transmit Holding Data */ -#define TWIHS_THR_TXDATA(value) ((TWIHS_THR_TXDATA_Msk & ((value) << TWIHS_THR_TXDATA_Pos))) -/* -------- TWIHS_SMBTR : (TWIHS Offset: 0x38) SMBus Timing Register -------- */ -#define TWIHS_SMBTR_PRESC_Pos 0 -#define TWIHS_SMBTR_PRESC_Msk (0xfu << TWIHS_SMBTR_PRESC_Pos) /**< \brief (TWIHS_SMBTR) SMBus Clock Prescaler */ -#define TWIHS_SMBTR_PRESC(value) ((TWIHS_SMBTR_PRESC_Msk & ((value) << TWIHS_SMBTR_PRESC_Pos))) -#define TWIHS_SMBTR_TLOWS_Pos 8 -#define TWIHS_SMBTR_TLOWS_Msk (0xffu << TWIHS_SMBTR_TLOWS_Pos) /**< \brief (TWIHS_SMBTR) Slave Clock Stretch Maximum Cycles */ -#define TWIHS_SMBTR_TLOWS(value) ((TWIHS_SMBTR_TLOWS_Msk & ((value) << TWIHS_SMBTR_TLOWS_Pos))) -#define TWIHS_SMBTR_TLOWM_Pos 16 -#define TWIHS_SMBTR_TLOWM_Msk (0xffu << TWIHS_SMBTR_TLOWM_Pos) /**< \brief (TWIHS_SMBTR) Master Clock Stretch Maximum Cycles */ -#define TWIHS_SMBTR_TLOWM(value) ((TWIHS_SMBTR_TLOWM_Msk & ((value) << TWIHS_SMBTR_TLOWM_Pos))) -#define TWIHS_SMBTR_THMAX_Pos 24 -#define TWIHS_SMBTR_THMAX_Msk (0xffu << TWIHS_SMBTR_THMAX_Pos) /**< \brief (TWIHS_SMBTR) Clock High Maximum Cycles */ -#define TWIHS_SMBTR_THMAX(value) ((TWIHS_SMBTR_THMAX_Msk & ((value) << TWIHS_SMBTR_THMAX_Pos))) -/* -------- TWIHS_FILTR : (TWIHS Offset: 0x44) Filter Register -------- */ -#define TWIHS_FILTR_FILT (0x1u << 0) /**< \brief (TWIHS_FILTR) RX Digital Filter */ -#define TWIHS_FILTR_PADFEN (0x1u << 1) /**< \brief (TWIHS_FILTR) PAD Filter Enable */ -#define TWIHS_FILTR_PADFCFG (0x1u << 2) /**< \brief (TWIHS_FILTR) PAD Filter Config */ -#define TWIHS_FILTR_THRES_Pos 8 -#define TWIHS_FILTR_THRES_Msk (0x7u << TWIHS_FILTR_THRES_Pos) /**< \brief (TWIHS_FILTR) Digital Filter Threshold */ -#define TWIHS_FILTR_THRES(value) ((TWIHS_FILTR_THRES_Msk & ((value) << TWIHS_FILTR_THRES_Pos))) -/* -------- TWIHS_SWMR : (TWIHS Offset: 0x4C) SleepWalking Matching Register -------- */ -#define TWIHS_SWMR_SADR1_Pos 0 -#define TWIHS_SWMR_SADR1_Msk (0x7fu << TWIHS_SWMR_SADR1_Pos) /**< \brief (TWIHS_SWMR) Slave Address 1 */ -#define TWIHS_SWMR_SADR1(value) ((TWIHS_SWMR_SADR1_Msk & ((value) << TWIHS_SWMR_SADR1_Pos))) -#define TWIHS_SWMR_SADR2_Pos 8 -#define TWIHS_SWMR_SADR2_Msk (0x7fu << TWIHS_SWMR_SADR2_Pos) /**< \brief (TWIHS_SWMR) Slave Address 2 */ -#define TWIHS_SWMR_SADR2(value) ((TWIHS_SWMR_SADR2_Msk & ((value) << TWIHS_SWMR_SADR2_Pos))) -#define TWIHS_SWMR_SADR3_Pos 16 -#define TWIHS_SWMR_SADR3_Msk (0x7fu << TWIHS_SWMR_SADR3_Pos) /**< \brief (TWIHS_SWMR) Slave Address 3 */ -#define TWIHS_SWMR_SADR3(value) ((TWIHS_SWMR_SADR3_Msk & ((value) << TWIHS_SWMR_SADR3_Pos))) -#define TWIHS_SWMR_DATAM_Pos 24 -#define TWIHS_SWMR_DATAM_Msk (0xffu << TWIHS_SWMR_DATAM_Pos) /**< \brief (TWIHS_SWMR) Data Match */ -#define TWIHS_SWMR_DATAM(value) ((TWIHS_SWMR_DATAM_Msk & ((value) << TWIHS_SWMR_DATAM_Pos))) -/* -------- TWIHS_WPMR : (TWIHS Offset: 0xE4) Write Protection Mode Register -------- */ -#define TWIHS_WPMR_WPEN (0x1u << 0) /**< \brief (TWIHS_WPMR) Write Protection Enable */ -#define TWIHS_WPMR_WPKEY_Pos 8 -#define TWIHS_WPMR_WPKEY_Msk (0xffffffu << TWIHS_WPMR_WPKEY_Pos) /**< \brief (TWIHS_WPMR) Write Protection Key */ -#define TWIHS_WPMR_WPKEY(value) ((TWIHS_WPMR_WPKEY_Msk & ((value) << TWIHS_WPMR_WPKEY_Pos))) -#define TWIHS_WPMR_WPKEY_PASSWD (0x545749u << 8) /**< \brief (TWIHS_WPMR) Writing any other value in this field aborts the write operation of the WPEN bit.Always reads as 0 */ -/* -------- TWIHS_WPSR : (TWIHS Offset: 0xE8) Write Protection Status Register -------- */ -#define TWIHS_WPSR_WPVS (0x1u << 0) /**< \brief (TWIHS_WPSR) Write Protection Violation Status */ -#define TWIHS_WPSR_WPVSRC_Pos 8 -#define TWIHS_WPSR_WPVSRC_Msk (0xffffffu << TWIHS_WPSR_WPVSRC_Pos) /**< \brief (TWIHS_WPSR) Write Protection Violation Source */ - -/*@}*/ - - -#endif /* _SAMV71_TWIHS_COMPONENT_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_uart.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_uart.h deleted file mode 100644 index 0f8b5fc7..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_uart.h +++ /dev/null @@ -1,151 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_UART_COMPONENT_ -#define _SAMV71_UART_COMPONENT_ - -/* ============================================================================= */ -/** SOFTWARE API DEFINITION FOR Universal Asynchronous Receiver Transmitter */ -/* ============================================================================= */ -/** \addtogroup SAMV71_UART Universal Asynchronous Receiver Transmitter */ -/*@{*/ - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -/** \brief Uart hardware registers */ -typedef struct { - __O uint32_t UART_CR; /**< \brief (Uart Offset: 0x0000) Control Register */ - __IO uint32_t UART_MR; /**< \brief (Uart Offset: 0x0004) Mode Register */ - __O uint32_t UART_IER; /**< \brief (Uart Offset: 0x0008) Interrupt Enable Register */ - __O uint32_t UART_IDR; /**< \brief (Uart Offset: 0x000C) Interrupt Disable Register */ - __I uint32_t UART_IMR; /**< \brief (Uart Offset: 0x0010) Interrupt Mask Register */ - __I uint32_t UART_SR; /**< \brief (Uart Offset: 0x0014) Status Register */ - __I uint32_t UART_RHR; /**< \brief (Uart Offset: 0x0018) Receive Holding Register */ - __O uint32_t UART_THR; /**< \brief (Uart Offset: 0x001C) Transmit Holding Register */ - __IO uint32_t UART_BRGR; /**< \brief (Uart Offset: 0x0020) Baud Rate Generator Register */ - __IO uint32_t UART_CMPR; /**< \brief (Uart Offset: 0x0024) Comparison Register */ - __I uint32_t Reserved1[47]; - __IO uint32_t UART_WPMR; /**< \brief (Uart Offset: 0x00E4) Write Protection Mode Register */ -} Uart; -#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/* -------- UART_CR : (UART Offset: 0x0000) Control Register -------- */ -#define UART_CR_RSTRX (0x1u << 2) /**< \brief (UART_CR) Reset Receiver */ -#define UART_CR_RSTTX (0x1u << 3) /**< \brief (UART_CR) Reset Transmitter */ -#define UART_CR_RXEN (0x1u << 4) /**< \brief (UART_CR) Receiver Enable */ -#define UART_CR_RXDIS (0x1u << 5) /**< \brief (UART_CR) Receiver Disable */ -#define UART_CR_TXEN (0x1u << 6) /**< \brief (UART_CR) Transmitter Enable */ -#define UART_CR_TXDIS (0x1u << 7) /**< \brief (UART_CR) Transmitter Disable */ -#define UART_CR_RSTSTA (0x1u << 8) /**< \brief (UART_CR) Reset Status */ -#define UART_CR_REQCLR (0x1u << 12) /**< \brief (UART_CR) Request Clear */ -/* -------- UART_MR : (UART Offset: 0x0004) Mode Register -------- */ -#define UART_MR_FILTER (0x1u << 4) /**< \brief (UART_MR) Receiver Digital Filter */ -#define UART_MR_FILTER_DISABLED (0x0u << 4) /**< \brief (UART_MR) UART does not filter the receive line. */ -#define UART_MR_FILTER_ENABLED (0x1u << 4) /**< \brief (UART_MR) UART filters the receive line using a three-sample filter (16x-bit clock) (2 over 3 majority). */ -#define UART_MR_PAR_Pos 9 -#define UART_MR_PAR_Msk (0x7u << UART_MR_PAR_Pos) /**< \brief (UART_MR) Parity Type */ -#define UART_MR_PAR(value) ((UART_MR_PAR_Msk & ((value) << UART_MR_PAR_Pos))) -#define UART_MR_PAR_EVEN (0x0u << 9) /**< \brief (UART_MR) Even Parity */ -#define UART_MR_PAR_ODD (0x1u << 9) /**< \brief (UART_MR) Odd Parity */ -#define UART_MR_PAR_SPACE (0x2u << 9) /**< \brief (UART_MR) Space: parity forced to 0 */ -#define UART_MR_PAR_MARK (0x3u << 9) /**< \brief (UART_MR) Mark: parity forced to 1 */ -#define UART_MR_PAR_NO (0x4u << 9) /**< \brief (UART_MR) No parity */ -#define UART_MR_BRSRCCK (0x1u << 12) /**< \brief (UART_MR) Baud Rate Source Clock */ -#define UART_MR_BRSRCCK_PERIPH_CLK (0x0u << 12) /**< \brief (UART_MR) The baud rate is driven by the peripheral clock */ -#define UART_MR_BRSRCCK_PMC_PCK (0x1u << 12) /**< \brief (UART_MR) The baud rate is driven by a PMC programmable clock PCK (see section Power Management Controller (PMC)). */ -#define UART_MR_CHMODE_Pos 14 -#define UART_MR_CHMODE_Msk (0x3u << UART_MR_CHMODE_Pos) /**< \brief (UART_MR) Channel Mode */ -#define UART_MR_CHMODE(value) ((UART_MR_CHMODE_Msk & ((value) << UART_MR_CHMODE_Pos))) -#define UART_MR_CHMODE_NORMAL (0x0u << 14) /**< \brief (UART_MR) Normal mode */ -#define UART_MR_CHMODE_AUTOMATIC (0x1u << 14) /**< \brief (UART_MR) Automatic echo */ -#define UART_MR_CHMODE_LOCAL_LOOPBACK (0x2u << 14) /**< \brief (UART_MR) Local loopback */ -#define UART_MR_CHMODE_REMOTE_LOOPBACK (0x3u << 14) /**< \brief (UART_MR) Remote loopback */ -/* -------- UART_IER : (UART Offset: 0x0008) Interrupt Enable Register -------- */ -#define UART_IER_RXRDY (0x1u << 0) /**< \brief (UART_IER) Enable RXRDY Interrupt */ -#define UART_IER_TXRDY (0x1u << 1) /**< \brief (UART_IER) Enable TXRDY Interrupt */ -#define UART_IER_OVRE (0x1u << 5) /**< \brief (UART_IER) Enable Overrun Error Interrupt */ -#define UART_IER_FRAME (0x1u << 6) /**< \brief (UART_IER) Enable Framing Error Interrupt */ -#define UART_IER_PARE (0x1u << 7) /**< \brief (UART_IER) Enable Parity Error Interrupt */ -#define UART_IER_TXEMPTY (0x1u << 9) /**< \brief (UART_IER) Enable TXEMPTY Interrupt */ -#define UART_IER_CMP (0x1u << 15) /**< \brief (UART_IER) Enable Comparison Interrupt */ -/* -------- UART_IDR : (UART Offset: 0x000C) Interrupt Disable Register -------- */ -#define UART_IDR_RXRDY (0x1u << 0) /**< \brief (UART_IDR) Disable RXRDY Interrupt */ -#define UART_IDR_TXRDY (0x1u << 1) /**< \brief (UART_IDR) Disable TXRDY Interrupt */ -#define UART_IDR_OVRE (0x1u << 5) /**< \brief (UART_IDR) Disable Overrun Error Interrupt */ -#define UART_IDR_FRAME (0x1u << 6) /**< \brief (UART_IDR) Disable Framing Error Interrupt */ -#define UART_IDR_PARE (0x1u << 7) /**< \brief (UART_IDR) Disable Parity Error Interrupt */ -#define UART_IDR_TXEMPTY (0x1u << 9) /**< \brief (UART_IDR) Disable TXEMPTY Interrupt */ -#define UART_IDR_CMP (0x1u << 15) /**< \brief (UART_IDR) Disable Comparison Interrupt */ -/* -------- UART_IMR : (UART Offset: 0x0010) Interrupt Mask Register -------- */ -#define UART_IMR_RXRDY (0x1u << 0) /**< \brief (UART_IMR) Mask RXRDY Interrupt */ -#define UART_IMR_TXRDY (0x1u << 1) /**< \brief (UART_IMR) Disable TXRDY Interrupt */ -#define UART_IMR_OVRE (0x1u << 5) /**< \brief (UART_IMR) Mask Overrun Error Interrupt */ -#define UART_IMR_FRAME (0x1u << 6) /**< \brief (UART_IMR) Mask Framing Error Interrupt */ -#define UART_IMR_PARE (0x1u << 7) /**< \brief (UART_IMR) Mask Parity Error Interrupt */ -#define UART_IMR_TXEMPTY (0x1u << 9) /**< \brief (UART_IMR) Mask TXEMPTY Interrupt */ -#define UART_IMR_CMP (0x1u << 15) /**< \brief (UART_IMR) Mask Comparison Interrupt */ -/* -------- UART_SR : (UART Offset: 0x0014) Status Register -------- */ -#define UART_SR_RXRDY (0x1u << 0) /**< \brief (UART_SR) Receiver Ready */ -#define UART_SR_TXRDY (0x1u << 1) /**< \brief (UART_SR) Transmitter Ready */ -#define UART_SR_OVRE (0x1u << 5) /**< \brief (UART_SR) Overrun Error */ -#define UART_SR_FRAME (0x1u << 6) /**< \brief (UART_SR) Framing Error */ -#define UART_SR_PARE (0x1u << 7) /**< \brief (UART_SR) Parity Error */ -#define UART_SR_TXEMPTY (0x1u << 9) /**< \brief (UART_SR) Transmitter Empty */ -#define UART_SR_CMP (0x1u << 15) /**< \brief (UART_SR) Comparison Match */ -/* -------- UART_RHR : (UART Offset: 0x0018) Receive Holding Register -------- */ -#define UART_RHR_RXCHR_Pos 0 -#define UART_RHR_RXCHR_Msk (0xffu << UART_RHR_RXCHR_Pos) /**< \brief (UART_RHR) Received Character */ -/* -------- UART_THR : (UART Offset: 0x001C) Transmit Holding Register -------- */ -#define UART_THR_TXCHR_Pos 0 -#define UART_THR_TXCHR_Msk (0xffu << UART_THR_TXCHR_Pos) /**< \brief (UART_THR) Character to be Transmitted */ -#define UART_THR_TXCHR(value) ((UART_THR_TXCHR_Msk & ((value) << UART_THR_TXCHR_Pos))) -/* -------- UART_BRGR : (UART Offset: 0x0020) Baud Rate Generator Register -------- */ -#define UART_BRGR_CD_Pos 0 -#define UART_BRGR_CD_Msk (0xffffu << UART_BRGR_CD_Pos) /**< \brief (UART_BRGR) Clock Divisor */ -#define UART_BRGR_CD(value) ((UART_BRGR_CD_Msk & ((value) << UART_BRGR_CD_Pos))) -/* -------- UART_CMPR : (UART Offset: 0x0024) Comparison Register -------- */ -#define UART_CMPR_VAL1_Pos 0 -#define UART_CMPR_VAL1_Msk (0xffu << UART_CMPR_VAL1_Pos) /**< \brief (UART_CMPR) First Comparison Value for Received Character */ -#define UART_CMPR_VAL1(value) ((UART_CMPR_VAL1_Msk & ((value) << UART_CMPR_VAL1_Pos))) -#define UART_CMPR_CMPMODE (0x1u << 12) /**< \brief (UART_CMPR) Comparison Mode */ -#define UART_CMPR_CMPMODE_FLAG_ONLY (0x0u << 12) /**< \brief (UART_CMPR) Any character is received and comparison function drives CMP flag. */ -#define UART_CMPR_CMPMODE_START_CONDITION (0x1u << 12) /**< \brief (UART_CMPR) Comparison condition must be met to start reception. */ -#define UART_CMPR_CMPPAR (0x1u << 14) /**< \brief (UART_CMPR) Compare Parity */ -#define UART_CMPR_VAL2_Pos 16 -#define UART_CMPR_VAL2_Msk (0xffu << UART_CMPR_VAL2_Pos) /**< \brief (UART_CMPR) Second Comparison Value for Received Character */ -#define UART_CMPR_VAL2(value) ((UART_CMPR_VAL2_Msk & ((value) << UART_CMPR_VAL2_Pos))) -/* -------- UART_WPMR : (UART Offset: 0x00E4) Write Protection Mode Register -------- */ -#define UART_WPMR_WPEN (0x1u << 0) /**< \brief (UART_WPMR) Write Protection Enable */ -#define UART_WPMR_WPKEY_Pos 8 -#define UART_WPMR_WPKEY_Msk (0xffffffu << UART_WPMR_WPKEY_Pos) /**< \brief (UART_WPMR) Write Protection Key */ -#define UART_WPMR_WPKEY(value) ((UART_WPMR_WPKEY_Msk & ((value) << UART_WPMR_WPKEY_Pos))) -#define UART_WPMR_WPKEY_PASSWD (0x554152u << 8) /**< \brief (UART_WPMR) Writing any other value in this field aborts the write operation.Always reads as 0. */ - -/*@}*/ - - -#endif /* _SAMV71_UART_COMPONENT_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_uotghs.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_uotghs.h deleted file mode 100644 index 09e596d3..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_uotghs.h +++ /dev/null @@ -1,1033 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAM_UOTGHS_COMPONENT_ -#define _SAM_UOTGHS_COMPONENT_ - -/* ============================================================================= */ -/** SOFTWARE API DEFINITION FOR USB On-The-Go Interface */ -/* ============================================================================= */ -/** \addtogroup SAM_UOTGHS USB On-The-Go Interface */ -/*@{*/ - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -/** \brief UotghsDevdma hardware registers */ -typedef struct { - __IO uint32_t UOTGHS_DEVDMANXTDSC; /**< \brief (UotghsDevdma Offset: 0x0) Device DMA Channel Next Descriptor Address Register */ - __IO uint32_t UOTGHS_DEVDMAADDRESS; /**< \brief (UotghsDevdma Offset: 0x4) Device DMA Channel Address Register */ - __IO uint32_t UOTGHS_DEVDMACONTROL; /**< \brief (UotghsDevdma Offset: 0x8) Device DMA Channel Control Register */ - __IO uint32_t UOTGHS_DEVDMASTATUS; /**< \brief (UotghsDevdma Offset: 0xC) Device DMA Channel Status Register */ -} UotghsDevdma; -/** \brief UotghsHstdma hardware registers */ -typedef struct { - __IO uint32_t UOTGHS_HSTDMANXTDSC; /**< \brief (UotghsHstdma Offset: 0x0) Host DMA Channel Next Descriptor Address Register */ - __IO uint32_t UOTGHS_HSTDMAADDRESS; /**< \brief (UotghsHstdma Offset: 0x4) Host DMA Channel Address Register */ - __IO uint32_t UOTGHS_HSTDMACONTROL; /**< \brief (UotghsHstdma Offset: 0x8) Host DMA Channel Control Register */ - __IO uint32_t UOTGHS_HSTDMASTATUS; /**< \brief (UotghsHstdma Offset: 0xC) Host DMA Channel Status Register */ -} UotghsHstdma; -/** \brief Uotghs hardware registers */ -#define UOTGHSDEVDMA_NUMBER 7 -#define UOTGHSHSTDMA_NUMBER 7 -typedef struct { - __IO uint32_t UOTGHS_DEVCTRL; /**< \brief (Uotghs Offset: 0x0000) Device General Control Register */ - __I uint32_t UOTGHS_DEVISR; /**< \brief (Uotghs Offset: 0x0004) Device Global Interrupt Status Register */ - __O uint32_t UOTGHS_DEVICR; /**< \brief (Uotghs Offset: 0x0008) Device Global Interrupt Clear Register */ - __O uint32_t UOTGHS_DEVIFR; /**< \brief (Uotghs Offset: 0x000C) Device Global Interrupt Set Register */ - __I uint32_t UOTGHS_DEVIMR; /**< \brief (Uotghs Offset: 0x0010) Device Global Interrupt Mask Register */ - __O uint32_t UOTGHS_DEVIDR; /**< \brief (Uotghs Offset: 0x0014) Device Global Interrupt Disable Register */ - __O uint32_t UOTGHS_DEVIER; /**< \brief (Uotghs Offset: 0x0018) Device Global Interrupt Enable Register */ - __IO uint32_t UOTGHS_DEVEPT; /**< \brief (Uotghs Offset: 0x001C) Device Endpoint Register */ - __I uint32_t UOTGHS_DEVFNUM; /**< \brief (Uotghs Offset: 0x0020) Device Frame Number Register */ - __I uint32_t Reserved1[55]; - __IO uint32_t UOTGHS_DEVEPTCFG[12]; /**< \brief (Uotghs Offset: 0x100) Device Endpoint Configuration Register (n = 0) */ - __I uint32_t UOTGHS_DEVEPTISR[12]; /**< \brief (Uotghs Offset: 0x130) Device Endpoint Status Register (n = 0) */ - __O uint32_t UOTGHS_DEVEPTICR[12]; /**< \brief (Uotghs Offset: 0x160) Device Endpoint Clear Register (n = 0) */ - __O uint32_t UOTGHS_DEVEPTIFR[12]; /**< \brief (Uotghs Offset: 0x190) Device Endpoint Set Register (n = 0) */ - __I uint32_t UOTGHS_DEVEPTIMR[12]; /**< \brief (Uotghs Offset: 0x1C0) Device Endpoint Mask Register (n = 0) */ - __O uint32_t UOTGHS_DEVEPTIER[12]; /**< \brief (Uotghs Offset: 0x1F0) Device Endpoint Enable Register (n = 0) */ - __O uint32_t UOTGHS_DEVEPTIDR[12]; /**< \brief (Uotghs Offset: 0x220) Device Endpoint Disable Register (n = 0) */ - __I uint32_t Reserved2[48]; - UotghsDevdma UOTGHS_DEVDMA[UOTGHSDEVDMA_NUMBER]; /**< \brief (Uotghs Offset: 0x310) n = 1 .. 7 */ - __I uint32_t Reserved3[32]; - __IO uint32_t UOTGHS_HSTCTRL; /**< \brief (Uotghs Offset: 0x0400) Host General Control Register */ - __I uint32_t UOTGHS_HSTISR; /**< \brief (Uotghs Offset: 0x0404) Host Global Interrupt Status Register */ - __O uint32_t UOTGHS_HSTICR; /**< \brief (Uotghs Offset: 0x0408) Host Global Interrupt Clear Register */ - __O uint32_t UOTGHS_HSTIFR; /**< \brief (Uotghs Offset: 0x040C) Host Global Interrupt Set Register */ - __I uint32_t UOTGHS_HSTIMR; /**< \brief (Uotghs Offset: 0x0410) Host Global Interrupt Mask Register */ - __O uint32_t UOTGHS_HSTIDR; /**< \brief (Uotghs Offset: 0x0414) Host Global Interrupt Disable Register */ - __O uint32_t UOTGHS_HSTIER; /**< \brief (Uotghs Offset: 0x0418) Host Global Interrupt Enable Register */ - __IO uint32_t UOTGHS_HSTPIP; /**< \brief (Uotghs Offset: 0x0041C) Host Pipe Register */ - __IO uint32_t UOTGHS_HSTFNUM; /**< \brief (Uotghs Offset: 0x0420) Host Frame Number Register */ - __IO uint32_t UOTGHS_HSTADDR1; /**< \brief (Uotghs Offset: 0x0424) Host Address 1 Register */ - __IO uint32_t UOTGHS_HSTADDR2; /**< \brief (Uotghs Offset: 0x0428) Host Address 2 Register */ - __IO uint32_t UOTGHS_HSTADDR3; /**< \brief (Uotghs Offset: 0x042C) Host Address 3 Register */ - __I uint32_t Reserved4[52]; - __IO uint32_t UOTGHS_HSTPIPCFG[12]; /**< \brief (Uotghs Offset: 0x500) Host Pipe Configuration Register (n = 0) */ - __I uint32_t UOTGHS_HSTPIPISR[12]; /**< \brief (Uotghs Offset: 0x530) Host Pipe Status Register (n = 0) */ - __O uint32_t UOTGHS_HSTPIPICR[12]; /**< \brief (Uotghs Offset: 0x560) Host Pipe Clear Register (n = 0) */ - __O uint32_t UOTGHS_HSTPIPIFR[12]; /**< \brief (Uotghs Offset: 0x590) Host Pipe Set Register (n = 0) */ - __I uint32_t UOTGHS_HSTPIPIMR[12]; /**< \brief (Uotghs Offset: 0x5C0) Host Pipe Mask Register (n = 0) */ - __O uint32_t UOTGHS_HSTPIPIER[12]; /**< \brief (Uotghs Offset: 0x5F0) Host Pipe Enable Register (n = 0) */ - __O uint32_t UOTGHS_HSTPIPIDR[12]; /**< \brief (Uotghs Offset: 0x620) Host Pipe Disable Register (n = 0) */ - __IO uint32_t UOTGHS_HSTPIPINRQ[12]; /**< \brief (Uotghs Offset: 0x650) Host Pipe IN Request Register (n = 0) */ - __IO uint32_t UOTGHS_HSTPIPERR[12]; /**< \brief (Uotghs Offset: 0x680) Host Pipe Error Register (n = 0) */ - __I uint32_t Reserved5[24]; - UotghsHstdma UOTGHS_HSTDMA[UOTGHSHSTDMA_NUMBER]; /**< \brief (Uotghs Offset: 0x710) n = 1 .. 7 */ - __I uint32_t Reserved6[32]; - __IO uint32_t UOTGHS_CTRL; /**< \brief (Uotghs Offset: 0x0800) General Control Register */ - __I uint32_t UOTGHS_SR; /**< \brief (Uotghs Offset: 0x0804) General Status Register */ - __O uint32_t UOTGHS_SCR; /**< \brief (Uotghs Offset: 0x0808) General Status Clear Register */ - __O uint32_t UOTGHS_SFR; /**< \brief (Uotghs Offset: 0x080C) General Status Set Register */ - __IO uint32_t UOTGHS_TSTA1; /**< \brief (Uotghs Offset: 0x0810) General Test A1 Register */ - __IO uint32_t UOTGHS_TSTA2; /**< \brief (Uotghs Offset: 0x0814) General Test A2 Register */ - __I uint32_t UOTGHS_VERSION; /**< \brief (Uotghs Offset: 0x0818) General Version Register */ - __I uint32_t UOTGHS_FEATURES; /**< \brief (Uotghs Offset: 0x081C) General Features Register */ - __I uint32_t UOTGHS_ADDRSIZE; /**< \brief (Uotghs Offset: 0x0820) General APB Address Size Register */ - __I uint32_t UOTGHS_IPNAME1; /**< \brief (Uotghs Offset: 0x0824) General Name Register 1 */ - __I uint32_t UOTGHS_IPNAME2; /**< \brief (Uotghs Offset: 0x0828) General Name Register 2 */ - __I uint32_t UOTGHS_FSM; /**< \brief (Uotghs Offset: 0x082C) General Finite State Machine Register */ -} Uotghs; -#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/* -------- UOTGHS_DEVCTRL : (UOTGHS Offset: 0x0000) Device General Control Register -------- */ -#define UOTGHS_DEVCTRL_UADD_Pos 0 -#define UOTGHS_DEVCTRL_UADD_Msk (0x7fu << UOTGHS_DEVCTRL_UADD_Pos) /**< \brief (UOTGHS_DEVCTRL) USB Address */ -#define UOTGHS_DEVCTRL_UADD(value) ((UOTGHS_DEVCTRL_UADD_Msk & ((value) << UOTGHS_DEVCTRL_UADD_Pos))) -#define UOTGHS_DEVCTRL_ADDEN (0x1u << 7) /**< \brief (UOTGHS_DEVCTRL) Address Enable */ -#define UOTGHS_DEVCTRL_DETACH (0x1u << 8) /**< \brief (UOTGHS_DEVCTRL) Detach */ -#define UOTGHS_DEVCTRL_RMWKUP (0x1u << 9) /**< \brief (UOTGHS_DEVCTRL) Remote Wake-Up */ -#define UOTGHS_DEVCTRL_SPDCONF_Pos 10 -#define UOTGHS_DEVCTRL_SPDCONF_Msk (0x3u << UOTGHS_DEVCTRL_SPDCONF_Pos) /**< \brief (UOTGHS_DEVCTRL) Mode Configuration */ -#define UOTGHS_DEVCTRL_SPDCONF_NORMAL (0x0u << 10) /**< \brief (UOTGHS_DEVCTRL) The peripheral starts in full-speed mode and performs a high-speed reset to switch to the high-speed mode if the host is high-speed capable. */ -#define UOTGHS_DEVCTRL_SPDCONF_LOW_POWER (0x1u << 10) /**< \brief (UOTGHS_DEVCTRL) For a better consumption, if high-speed is not needed. */ -#define UOTGHS_DEVCTRL_SPDCONF_HIGH_SPEED (0x2u << 10) /**< \brief (UOTGHS_DEVCTRL) Forced high speed. */ -#define UOTGHS_DEVCTRL_SPDCONF_FORCED_FS (0x3u << 10) /**< \brief (UOTGHS_DEVCTRL) The peripheral remains in full-speed mode whatever the host speed capability. */ -#define UOTGHS_DEVCTRL_LS (0x1u << 12) /**< \brief (UOTGHS_DEVCTRL) Low-Speed Mode Force */ -#define UOTGHS_DEVCTRL_TSTJ (0x1u << 13) /**< \brief (UOTGHS_DEVCTRL) Test mode J */ -#define UOTGHS_DEVCTRL_TSTK (0x1u << 14) /**< \brief (UOTGHS_DEVCTRL) Test mode K */ -#define UOTGHS_DEVCTRL_TSTPCKT (0x1u << 15) /**< \brief (UOTGHS_DEVCTRL) Test packet mode */ -#define UOTGHS_DEVCTRL_OPMODE2 (0x1u << 16) /**< \brief (UOTGHS_DEVCTRL) Specific Operational mode */ -/* -------- UOTGHS_DEVISR : (UOTGHS Offset: 0x0004) Device Global Interrupt Status Register -------- */ -#define UOTGHS_DEVISR_SUSP (0x1u << 0) /**< \brief (UOTGHS_DEVISR) Suspend Interrupt */ -#define UOTGHS_DEVISR_MSOF (0x1u << 1) /**< \brief (UOTGHS_DEVISR) Micro Start of Frame Interrupt */ -#define UOTGHS_DEVISR_SOF (0x1u << 2) /**< \brief (UOTGHS_DEVISR) Start of Frame Interrupt */ -#define UOTGHS_DEVISR_EORST (0x1u << 3) /**< \brief (UOTGHS_DEVISR) End of Reset Interrupt */ -#define UOTGHS_DEVISR_WAKEUP (0x1u << 4) /**< \brief (UOTGHS_DEVISR) Wake-Up Interrupt */ -#define UOTGHS_DEVISR_EORSM (0x1u << 5) /**< \brief (UOTGHS_DEVISR) End of Resume Interrupt */ -#define UOTGHS_DEVISR_UPRSM (0x1u << 6) /**< \brief (UOTGHS_DEVISR) Upstream Resume Interrupt */ -#define UOTGHS_DEVISR_PEP_0 (0x1u << 12) /**< \brief (UOTGHS_DEVISR) Endpoint 0 Interrupt */ -#define UOTGHS_DEVISR_PEP_1 (0x1u << 13) /**< \brief (UOTGHS_DEVISR) Endpoint 1 Interrupt */ -#define UOTGHS_DEVISR_PEP_2 (0x1u << 14) /**< \brief (UOTGHS_DEVISR) Endpoint 2 Interrupt */ -#define UOTGHS_DEVISR_PEP_3 (0x1u << 15) /**< \brief (UOTGHS_DEVISR) Endpoint 3 Interrupt */ -#define UOTGHS_DEVISR_PEP_4 (0x1u << 16) /**< \brief (UOTGHS_DEVISR) Endpoint 4 Interrupt */ -#define UOTGHS_DEVISR_PEP_5 (0x1u << 17) /**< \brief (UOTGHS_DEVISR) Endpoint 5 Interrupt */ -#define UOTGHS_DEVISR_PEP_6 (0x1u << 18) /**< \brief (UOTGHS_DEVISR) Endpoint 6 Interrupt */ -#define UOTGHS_DEVISR_PEP_7 (0x1u << 19) /**< \brief (UOTGHS_DEVISR) Endpoint 7 Interrupt */ -#define UOTGHS_DEVISR_PEP_8 (0x1u << 20) /**< \brief (UOTGHS_DEVISR) Endpoint 8 Interrupt */ -#define UOTGHS_DEVISR_PEP_9 (0x1u << 21) /**< \brief (UOTGHS_DEVISR) Endpoint 9 Interrupt */ -#define UOTGHS_DEVISR_PEP_10 (0x1u << 22) /**< \brief (UOTGHS_DEVISR) Endpoint 10 Interrupt */ -#define UOTGHS_DEVISR_PEP_11 (0x1u << 23) /**< \brief (UOTGHS_DEVISR) Endpoint 11 Interrupt */ -#define UOTGHS_DEVISR_DMA_1 (0x1u << 25) /**< \brief (UOTGHS_DEVISR) DMA Channel 1 Interrupt */ -#define UOTGHS_DEVISR_DMA_2 (0x1u << 26) /**< \brief (UOTGHS_DEVISR) DMA Channel 2 Interrupt */ -#define UOTGHS_DEVISR_DMA_3 (0x1u << 27) /**< \brief (UOTGHS_DEVISR) DMA Channel 3 Interrupt */ -#define UOTGHS_DEVISR_DMA_4 (0x1u << 28) /**< \brief (UOTGHS_DEVISR) DMA Channel 4 Interrupt */ -#define UOTGHS_DEVISR_DMA_5 (0x1u << 29) /**< \brief (UOTGHS_DEVISR) DMA Channel 5 Interrupt */ -#define UOTGHS_DEVISR_DMA_6 (0x1u << 30) /**< \brief (UOTGHS_DEVISR) DMA Channel 6 Interrupt */ -#define UOTGHS_DEVISR_DMA_7 (0x1u << 31) /**< \brief (UOTGHS_DEVISR) DMA Channel 7 Interrupt */ -/* -------- UOTGHS_DEVICR : (UOTGHS Offset: 0x0008) Device Global Interrupt Clear Register -------- */ -#define UOTGHS_DEVICR_SUSPC (0x1u << 0) /**< \brief (UOTGHS_DEVICR) Suspend Interrupt Clear */ -#define UOTGHS_DEVICR_MSOFC (0x1u << 1) /**< \brief (UOTGHS_DEVICR) Micro Start of Frame Interrupt Clear */ -#define UOTGHS_DEVICR_SOFC (0x1u << 2) /**< \brief (UOTGHS_DEVICR) Start of Frame Interrupt Clear */ -#define UOTGHS_DEVICR_EORSTC (0x1u << 3) /**< \brief (UOTGHS_DEVICR) End of Reset Interrupt Clear */ -#define UOTGHS_DEVICR_WAKEUPC (0x1u << 4) /**< \brief (UOTGHS_DEVICR) Wake-Up Interrupt Clear */ -#define UOTGHS_DEVICR_EORSMC (0x1u << 5) /**< \brief (UOTGHS_DEVICR) End of Resume Interrupt Clear */ -#define UOTGHS_DEVICR_UPRSMC (0x1u << 6) /**< \brief (UOTGHS_DEVICR) Upstream Resume Interrupt Clear */ -/* -------- UOTGHS_DEVIFR : (UOTGHS Offset: 0x000C) Device Global Interrupt Set Register -------- */ -#define UOTGHS_DEVIFR_SUSPS (0x1u << 0) /**< \brief (UOTGHS_DEVIFR) Suspend Interrupt Set */ -#define UOTGHS_DEVIFR_MSOFS (0x1u << 1) /**< \brief (UOTGHS_DEVIFR) Micro Start of Frame Interrupt Set */ -#define UOTGHS_DEVIFR_SOFS (0x1u << 2) /**< \brief (UOTGHS_DEVIFR) Start of Frame Interrupt Set */ -#define UOTGHS_DEVIFR_EORSTS (0x1u << 3) /**< \brief (UOTGHS_DEVIFR) End of Reset Interrupt Set */ -#define UOTGHS_DEVIFR_WAKEUPS (0x1u << 4) /**< \brief (UOTGHS_DEVIFR) Wake-Up Interrupt Set */ -#define UOTGHS_DEVIFR_EORSMS (0x1u << 5) /**< \brief (UOTGHS_DEVIFR) End of Resume Interrupt Set */ -#define UOTGHS_DEVIFR_UPRSMS (0x1u << 6) /**< \brief (UOTGHS_DEVIFR) Upstream Resume Interrupt Set */ -#define UOTGHS_DEVIFR_DMA_1 (0x1u << 25) /**< \brief (UOTGHS_DEVIFR) DMA Channel 1 Interrupt Set */ -#define UOTGHS_DEVIFR_DMA_2 (0x1u << 26) /**< \brief (UOTGHS_DEVIFR) DMA Channel 2 Interrupt Set */ -#define UOTGHS_DEVIFR_DMA_3 (0x1u << 27) /**< \brief (UOTGHS_DEVIFR) DMA Channel 3 Interrupt Set */ -#define UOTGHS_DEVIFR_DMA_4 (0x1u << 28) /**< \brief (UOTGHS_DEVIFR) DMA Channel 4 Interrupt Set */ -#define UOTGHS_DEVIFR_DMA_5 (0x1u << 29) /**< \brief (UOTGHS_DEVIFR) DMA Channel 5 Interrupt Set */ -#define UOTGHS_DEVIFR_DMA_6 (0x1u << 30) /**< \brief (UOTGHS_DEVIFR) DMA Channel 6 Interrupt Set */ -#define UOTGHS_DEVIFR_DMA_7 (0x1u << 31) /**< \brief (UOTGHS_DEVIFR) DMA Channel 7 Interrupt Set */ -/* -------- UOTGHS_DEVIMR : (UOTGHS Offset: 0x0010) Device Global Interrupt Mask Register -------- */ -#define UOTGHS_DEVIMR_SUSPE (0x1u << 0) /**< \brief (UOTGHS_DEVIMR) Suspend Interrupt Mask */ -#define UOTGHS_DEVIMR_MSOFE (0x1u << 1) /**< \brief (UOTGHS_DEVIMR) Micro Start of Frame Interrupt Mask */ -#define UOTGHS_DEVIMR_SOFE (0x1u << 2) /**< \brief (UOTGHS_DEVIMR) Start of Frame Interrupt Mask */ -#define UOTGHS_DEVIMR_EORSTE (0x1u << 3) /**< \brief (UOTGHS_DEVIMR) End of Reset Interrupt Mask */ -#define UOTGHS_DEVIMR_WAKEUPE (0x1u << 4) /**< \brief (UOTGHS_DEVIMR) Wake-Up Interrupt Mask */ -#define UOTGHS_DEVIMR_EORSME (0x1u << 5) /**< \brief (UOTGHS_DEVIMR) End of Resume Interrupt Mask */ -#define UOTGHS_DEVIMR_UPRSME (0x1u << 6) /**< \brief (UOTGHS_DEVIMR) Upstream Resume Interrupt Mask */ -#define UOTGHS_DEVIMR_PEP_0 (0x1u << 12) /**< \brief (UOTGHS_DEVIMR) Endpoint 0 Interrupt Mask */ -#define UOTGHS_DEVIMR_PEP_1 (0x1u << 13) /**< \brief (UOTGHS_DEVIMR) Endpoint 1 Interrupt Mask */ -#define UOTGHS_DEVIMR_PEP_2 (0x1u << 14) /**< \brief (UOTGHS_DEVIMR) Endpoint 2 Interrupt Mask */ -#define UOTGHS_DEVIMR_PEP_3 (0x1u << 15) /**< \brief (UOTGHS_DEVIMR) Endpoint 3 Interrupt Mask */ -#define UOTGHS_DEVIMR_PEP_4 (0x1u << 16) /**< \brief (UOTGHS_DEVIMR) Endpoint 4 Interrupt Mask */ -#define UOTGHS_DEVIMR_PEP_5 (0x1u << 17) /**< \brief (UOTGHS_DEVIMR) Endpoint 5 Interrupt Mask */ -#define UOTGHS_DEVIMR_PEP_6 (0x1u << 18) /**< \brief (UOTGHS_DEVIMR) Endpoint 6 Interrupt Mask */ -#define UOTGHS_DEVIMR_PEP_7 (0x1u << 19) /**< \brief (UOTGHS_DEVIMR) Endpoint 7 Interrupt Mask */ -#define UOTGHS_DEVIMR_PEP_8 (0x1u << 20) /**< \brief (UOTGHS_DEVIMR) Endpoint 8 Interrupt Mask */ -#define UOTGHS_DEVIMR_PEP_9 (0x1u << 21) /**< \brief (UOTGHS_DEVIMR) Endpoint 9 Interrupt Mask */ -#define UOTGHS_DEVIMR_PEP_10 (0x1u << 22) /**< \brief (UOTGHS_DEVIMR) Endpoint 10 Interrupt Mask */ -#define UOTGHS_DEVIMR_PEP_11 (0x1u << 23) /**< \brief (UOTGHS_DEVIMR) Endpoint 11 Interrupt Mask */ -#define UOTGHS_DEVIMR_DMA_1 (0x1u << 25) /**< \brief (UOTGHS_DEVIMR) DMA Channel 1 Interrupt Mask */ -#define UOTGHS_DEVIMR_DMA_2 (0x1u << 26) /**< \brief (UOTGHS_DEVIMR) DMA Channel 2 Interrupt Mask */ -#define UOTGHS_DEVIMR_DMA_3 (0x1u << 27) /**< \brief (UOTGHS_DEVIMR) DMA Channel 3 Interrupt Mask */ -#define UOTGHS_DEVIMR_DMA_4 (0x1u << 28) /**< \brief (UOTGHS_DEVIMR) DMA Channel 4 Interrupt Mask */ -#define UOTGHS_DEVIMR_DMA_5 (0x1u << 29) /**< \brief (UOTGHS_DEVIMR) DMA Channel 5 Interrupt Mask */ -#define UOTGHS_DEVIMR_DMA_6 (0x1u << 30) /**< \brief (UOTGHS_DEVIMR) DMA Channel 6 Interrupt Mask */ -#define UOTGHS_DEVIMR_DMA_7 (0x1u << 31) /**< \brief (UOTGHS_DEVIMR) DMA Channel 7 Interrupt Mask */ -/* -------- UOTGHS_DEVIDR : (UOTGHS Offset: 0x0014) Device Global Interrupt Disable Register -------- */ -#define UOTGHS_DEVIDR_SUSPEC (0x1u << 0) /**< \brief (UOTGHS_DEVIDR) Suspend Interrupt Disable */ -#define UOTGHS_DEVIDR_MSOFEC (0x1u << 1) /**< \brief (UOTGHS_DEVIDR) Micro Start of Frame Interrupt Disable */ -#define UOTGHS_DEVIDR_SOFEC (0x1u << 2) /**< \brief (UOTGHS_DEVIDR) Start of Frame Interrupt Disable */ -#define UOTGHS_DEVIDR_EORSTEC (0x1u << 3) /**< \brief (UOTGHS_DEVIDR) End of Reset Interrupt Disable */ -#define UOTGHS_DEVIDR_WAKEUPEC (0x1u << 4) /**< \brief (UOTGHS_DEVIDR) Wake-Up Interrupt Disable */ -#define UOTGHS_DEVIDR_EORSMEC (0x1u << 5) /**< \brief (UOTGHS_DEVIDR) End of Resume Interrupt Disable */ -#define UOTGHS_DEVIDR_UPRSMEC (0x1u << 6) /**< \brief (UOTGHS_DEVIDR) Upstream Resume Interrupt Disable */ -#define UOTGHS_DEVIDR_PEP_0 (0x1u << 12) /**< \brief (UOTGHS_DEVIDR) Endpoint 0 Interrupt Disable */ -#define UOTGHS_DEVIDR_PEP_1 (0x1u << 13) /**< \brief (UOTGHS_DEVIDR) Endpoint 1 Interrupt Disable */ -#define UOTGHS_DEVIDR_PEP_2 (0x1u << 14) /**< \brief (UOTGHS_DEVIDR) Endpoint 2 Interrupt Disable */ -#define UOTGHS_DEVIDR_PEP_3 (0x1u << 15) /**< \brief (UOTGHS_DEVIDR) Endpoint 3 Interrupt Disable */ -#define UOTGHS_DEVIDR_PEP_4 (0x1u << 16) /**< \brief (UOTGHS_DEVIDR) Endpoint 4 Interrupt Disable */ -#define UOTGHS_DEVIDR_PEP_5 (0x1u << 17) /**< \brief (UOTGHS_DEVIDR) Endpoint 5 Interrupt Disable */ -#define UOTGHS_DEVIDR_PEP_6 (0x1u << 18) /**< \brief (UOTGHS_DEVIDR) Endpoint 6 Interrupt Disable */ -#define UOTGHS_DEVIDR_PEP_7 (0x1u << 19) /**< \brief (UOTGHS_DEVIDR) Endpoint 7 Interrupt Disable */ -#define UOTGHS_DEVIDR_PEP_8 (0x1u << 20) /**< \brief (UOTGHS_DEVIDR) Endpoint 8 Interrupt Disable */ -#define UOTGHS_DEVIDR_PEP_9 (0x1u << 21) /**< \brief (UOTGHS_DEVIDR) Endpoint 9 Interrupt Disable */ -#define UOTGHS_DEVIDR_PEP_10 (0x1u << 22) /**< \brief (UOTGHS_DEVIDR) Endpoint 10 Interrupt Disable */ -#define UOTGHS_DEVIDR_PEP_11 (0x1u << 23) /**< \brief (UOTGHS_DEVIDR) Endpoint 11 Interrupt Disable */ -#define UOTGHS_DEVIDR_DMA_1 (0x1u << 25) /**< \brief (UOTGHS_DEVIDR) DMA Channel 1 Interrupt Disable */ -#define UOTGHS_DEVIDR_DMA_2 (0x1u << 26) /**< \brief (UOTGHS_DEVIDR) DMA Channel 2 Interrupt Disable */ -#define UOTGHS_DEVIDR_DMA_3 (0x1u << 27) /**< \brief (UOTGHS_DEVIDR) DMA Channel 3 Interrupt Disable */ -#define UOTGHS_DEVIDR_DMA_4 (0x1u << 28) /**< \brief (UOTGHS_DEVIDR) DMA Channel 4 Interrupt Disable */ -#define UOTGHS_DEVIDR_DMA_5 (0x1u << 29) /**< \brief (UOTGHS_DEVIDR) DMA Channel 5 Interrupt Disable */ -#define UOTGHS_DEVIDR_DMA_6 (0x1u << 30) /**< \brief (UOTGHS_DEVIDR) DMA Channel 6 Interrupt Disable */ -#define UOTGHS_DEVIDR_DMA_7 (0x1u << 31) /**< \brief (UOTGHS_DEVIDR) DMA Channel 7 Interrupt Disable */ -/* -------- UOTGHS_DEVIER : (UOTGHS Offset: 0x0018) Device Global Interrupt Enable Register -------- */ -#define UOTGHS_DEVIER_SUSPES (0x1u << 0) /**< \brief (UOTGHS_DEVIER) Suspend Interrupt Enable */ -#define UOTGHS_DEVIER_MSOFES (0x1u << 1) /**< \brief (UOTGHS_DEVIER) Micro Start of Frame Interrupt Enable */ -#define UOTGHS_DEVIER_SOFES (0x1u << 2) /**< \brief (UOTGHS_DEVIER) Start of Frame Interrupt Enable */ -#define UOTGHS_DEVIER_EORSTES (0x1u << 3) /**< \brief (UOTGHS_DEVIER) End of Reset Interrupt Enable */ -#define UOTGHS_DEVIER_WAKEUPES (0x1u << 4) /**< \brief (UOTGHS_DEVIER) Wake-Up Interrupt Enable */ -#define UOTGHS_DEVIER_EORSMES (0x1u << 5) /**< \brief (UOTGHS_DEVIER) End of Resume Interrupt Enable */ -#define UOTGHS_DEVIER_UPRSMES (0x1u << 6) /**< \brief (UOTGHS_DEVIER) Upstream Resume Interrupt Enable */ -#define UOTGHS_DEVIER_PEP_0 (0x1u << 12) /**< \brief (UOTGHS_DEVIER) Endpoint 0 Interrupt Enable */ -#define UOTGHS_DEVIER_PEP_1 (0x1u << 13) /**< \brief (UOTGHS_DEVIER) Endpoint 1 Interrupt Enable */ -#define UOTGHS_DEVIER_PEP_2 (0x1u << 14) /**< \brief (UOTGHS_DEVIER) Endpoint 2 Interrupt Enable */ -#define UOTGHS_DEVIER_PEP_3 (0x1u << 15) /**< \brief (UOTGHS_DEVIER) Endpoint 3 Interrupt Enable */ -#define UOTGHS_DEVIER_PEP_4 (0x1u << 16) /**< \brief (UOTGHS_DEVIER) Endpoint 4 Interrupt Enable */ -#define UOTGHS_DEVIER_PEP_5 (0x1u << 17) /**< \brief (UOTGHS_DEVIER) Endpoint 5 Interrupt Enable */ -#define UOTGHS_DEVIER_PEP_6 (0x1u << 18) /**< \brief (UOTGHS_DEVIER) Endpoint 6 Interrupt Enable */ -#define UOTGHS_DEVIER_PEP_7 (0x1u << 19) /**< \brief (UOTGHS_DEVIER) Endpoint 7 Interrupt Enable */ -#define UOTGHS_DEVIER_PEP_8 (0x1u << 20) /**< \brief (UOTGHS_DEVIER) Endpoint 8 Interrupt Enable */ -#define UOTGHS_DEVIER_PEP_9 (0x1u << 21) /**< \brief (UOTGHS_DEVIER) Endpoint 9 Interrupt Enable */ -#define UOTGHS_DEVIER_PEP_10 (0x1u << 22) /**< \brief (UOTGHS_DEVIER) Endpoint 10 Interrupt Enable */ -#define UOTGHS_DEVIER_PEP_11 (0x1u << 23) /**< \brief (UOTGHS_DEVIER) Endpoint 11 Interrupt Enable */ -#define UOTGHS_DEVIER_DMA_1 (0x1u << 25) /**< \brief (UOTGHS_DEVIER) DMA Channel 1 Interrupt Enable */ -#define UOTGHS_DEVIER_DMA_2 (0x1u << 26) /**< \brief (UOTGHS_DEVIER) DMA Channel 2 Interrupt Enable */ -#define UOTGHS_DEVIER_DMA_3 (0x1u << 27) /**< \brief (UOTGHS_DEVIER) DMA Channel 3 Interrupt Enable */ -#define UOTGHS_DEVIER_DMA_4 (0x1u << 28) /**< \brief (UOTGHS_DEVIER) DMA Channel 4 Interrupt Enable */ -#define UOTGHS_DEVIER_DMA_5 (0x1u << 29) /**< \brief (UOTGHS_DEVIER) DMA Channel 5 Interrupt Enable */ -#define UOTGHS_DEVIER_DMA_6 (0x1u << 30) /**< \brief (UOTGHS_DEVIER) DMA Channel 6 Interrupt Enable */ -#define UOTGHS_DEVIER_DMA_7 (0x1u << 31) /**< \brief (UOTGHS_DEVIER) DMA Channel 7 Interrupt Enable */ -/* -------- UOTGHS_DEVEPT : (UOTGHS Offset: 0x001C) Device Endpoint Register -------- */ -#define UOTGHS_DEVEPT_EPEN0 (0x1u << 0) /**< \brief (UOTGHS_DEVEPT) Endpoint 0 Enable */ -#define UOTGHS_DEVEPT_EPEN1 (0x1u << 1) /**< \brief (UOTGHS_DEVEPT) Endpoint 1 Enable */ -#define UOTGHS_DEVEPT_EPEN2 (0x1u << 2) /**< \brief (UOTGHS_DEVEPT) Endpoint 2 Enable */ -#define UOTGHS_DEVEPT_EPEN3 (0x1u << 3) /**< \brief (UOTGHS_DEVEPT) Endpoint 3 Enable */ -#define UOTGHS_DEVEPT_EPEN4 (0x1u << 4) /**< \brief (UOTGHS_DEVEPT) Endpoint 4 Enable */ -#define UOTGHS_DEVEPT_EPEN5 (0x1u << 5) /**< \brief (UOTGHS_DEVEPT) Endpoint 5 Enable */ -#define UOTGHS_DEVEPT_EPEN6 (0x1u << 6) /**< \brief (UOTGHS_DEVEPT) Endpoint 6 Enable */ -#define UOTGHS_DEVEPT_EPEN7 (0x1u << 7) /**< \brief (UOTGHS_DEVEPT) Endpoint 7 Enable */ -#define UOTGHS_DEVEPT_EPEN8 (0x1u << 8) /**< \brief (UOTGHS_DEVEPT) Endpoint 8 Enable */ -#define UOTGHS_DEVEPT_EPRST0 (0x1u << 16) /**< \brief (UOTGHS_DEVEPT) Endpoint 0 Reset */ -#define UOTGHS_DEVEPT_EPRST1 (0x1u << 17) /**< \brief (UOTGHS_DEVEPT) Endpoint 1 Reset */ -#define UOTGHS_DEVEPT_EPRST2 (0x1u << 18) /**< \brief (UOTGHS_DEVEPT) Endpoint 2 Reset */ -#define UOTGHS_DEVEPT_EPRST3 (0x1u << 19) /**< \brief (UOTGHS_DEVEPT) Endpoint 3 Reset */ -#define UOTGHS_DEVEPT_EPRST4 (0x1u << 20) /**< \brief (UOTGHS_DEVEPT) Endpoint 4 Reset */ -#define UOTGHS_DEVEPT_EPRST5 (0x1u << 21) /**< \brief (UOTGHS_DEVEPT) Endpoint 5 Reset */ -#define UOTGHS_DEVEPT_EPRST6 (0x1u << 22) /**< \brief (UOTGHS_DEVEPT) Endpoint 6 Reset */ -#define UOTGHS_DEVEPT_EPRST7 (0x1u << 23) /**< \brief (UOTGHS_DEVEPT) Endpoint 7 Reset */ -#define UOTGHS_DEVEPT_EPRST8 (0x1u << 24) /**< \brief (UOTGHS_DEVEPT) Endpoint 8 Reset */ -/* -------- UOTGHS_DEVFNUM : (UOTGHS Offset: 0x0020) Device Frame Number Register -------- */ -#define UOTGHS_DEVFNUM_MFNUM_Pos 0 -#define UOTGHS_DEVFNUM_MFNUM_Msk (0x7u << UOTGHS_DEVFNUM_MFNUM_Pos) /**< \brief (UOTGHS_DEVFNUM) Micro Frame Number */ -#define UOTGHS_DEVFNUM_FNUM_Pos 3 -#define UOTGHS_DEVFNUM_FNUM_Msk (0x7ffu << UOTGHS_DEVFNUM_FNUM_Pos) /**< \brief (UOTGHS_DEVFNUM) Frame Number */ -#define UOTGHS_DEVFNUM_FNCERR (0x1u << 15) /**< \brief (UOTGHS_DEVFNUM) Frame Number CRC Error */ -/* -------- UOTGHS_DEVEPTCFG[12] : (UOTGHS Offset: 0x100) Device Endpoint Configuration Register (n = 0) -------- */ -#define UOTGHS_DEVEPTCFG_ALLOC (0x1u << 1) /**< \brief (UOTGHS_DEVEPTCFG[12]) Endpoint Memory Allocate */ -#define UOTGHS_DEVEPTCFG_EPBK_Pos 2 -#define UOTGHS_DEVEPTCFG_EPBK_Msk (0x3u << UOTGHS_DEVEPTCFG_EPBK_Pos) /**< \brief (UOTGHS_DEVEPTCFG[12]) Endpoint Banks */ -#define UOTGHS_DEVEPTCFG_EPBK_1_BANK (0x0u << 2) /**< \brief (UOTGHS_DEVEPTCFG[12]) Single-bank endpoint */ -#define UOTGHS_DEVEPTCFG_EPBK_2_BANK (0x1u << 2) /**< \brief (UOTGHS_DEVEPTCFG[12]) Double-bank endpoint */ -#define UOTGHS_DEVEPTCFG_EPBK_3_BANK (0x2u << 2) /**< \brief (UOTGHS_DEVEPTCFG[12]) Triple-bank endpoint */ -#define UOTGHS_DEVEPTCFG_EPSIZE_Pos 4 -#define UOTGHS_DEVEPTCFG_EPSIZE_Msk (0x7u << UOTGHS_DEVEPTCFG_EPSIZE_Pos) /**< \brief (UOTGHS_DEVEPTCFG[12]) Endpoint Size */ -#define UOTGHS_DEVEPTCFG_EPSIZE_8_BYTE (0x0u << 4) /**< \brief (UOTGHS_DEVEPTCFG[12]) 8 bytes */ -#define UOTGHS_DEVEPTCFG_EPSIZE_16_BYTE (0x1u << 4) /**< \brief (UOTGHS_DEVEPTCFG[12]) 16 bytes */ -#define UOTGHS_DEVEPTCFG_EPSIZE_32_BYTE (0x2u << 4) /**< \brief (UOTGHS_DEVEPTCFG[12]) 32 bytes */ -#define UOTGHS_DEVEPTCFG_EPSIZE_64_BYTE (0x3u << 4) /**< \brief (UOTGHS_DEVEPTCFG[12]) 64 bytes */ -#define UOTGHS_DEVEPTCFG_EPSIZE_128_BYTE (0x4u << 4) /**< \brief (UOTGHS_DEVEPTCFG[12]) 128 bytes */ -#define UOTGHS_DEVEPTCFG_EPSIZE_256_BYTE (0x5u << 4) /**< \brief (UOTGHS_DEVEPTCFG[12]) 256 bytes */ -#define UOTGHS_DEVEPTCFG_EPSIZE_512_BYTE (0x6u << 4) /**< \brief (UOTGHS_DEVEPTCFG[12]) 512 bytes */ -#define UOTGHS_DEVEPTCFG_EPSIZE_1024_BYTE (0x7u << 4) /**< \brief (UOTGHS_DEVEPTCFG[12]) 1024 bytes */ -#define UOTGHS_DEVEPTCFG_EPDIR (0x1u << 8) /**< \brief (UOTGHS_DEVEPTCFG[12]) Endpoint Direction */ -#define UOTGHS_DEVEPTCFG_EPDIR_OUT (0x0u << 8) /**< \brief (UOTGHS_DEVEPTCFG[12]) The endpoint direction is OUT. */ -#define UOTGHS_DEVEPTCFG_EPDIR_IN (0x1u << 8) /**< \brief (UOTGHS_DEVEPTCFG[12]) The endpoint direction is IN (nor for control endpoints). */ -#define UOTGHS_DEVEPTCFG_AUTOSW (0x1u << 9) /**< \brief (UOTGHS_DEVEPTCFG[12]) Automatic Switch */ -#define UOTGHS_DEVEPTCFG_EPTYPE_Pos 11 -#define UOTGHS_DEVEPTCFG_EPTYPE_Msk (0x3u << UOTGHS_DEVEPTCFG_EPTYPE_Pos) /**< \brief (UOTGHS_DEVEPTCFG[12]) Endpoint Type */ -#define UOTGHS_DEVEPTCFG_EPTYPE_CTRL (0x0u << 11) /**< \brief (UOTGHS_DEVEPTCFG[12]) Control */ -#define UOTGHS_DEVEPTCFG_EPTYPE_ISO (0x1u << 11) /**< \brief (UOTGHS_DEVEPTCFG[12]) Isochronous */ -#define UOTGHS_DEVEPTCFG_EPTYPE_BLK (0x2u << 11) /**< \brief (UOTGHS_DEVEPTCFG[12]) Bulk */ -#define UOTGHS_DEVEPTCFG_EPTYPE_INTRPT (0x3u << 11) /**< \brief (UOTGHS_DEVEPTCFG[12]) Interrupt */ -#define UOTGHS_DEVEPTCFG_NBTRANS_Pos 13 -#define UOTGHS_DEVEPTCFG_NBTRANS_Msk (0x3u << UOTGHS_DEVEPTCFG_NBTRANS_Pos) /**< \brief (UOTGHS_DEVEPTCFG[12]) Number of transaction per microframe for isochronous endpoint */ -#define UOTGHS_DEVEPTCFG_NBTRANS_0_TRANS (0x0u << 13) /**< \brief (UOTGHS_DEVEPTCFG[12]) reserved to endpoint that does not have the high-bandwidth isochronous capability. */ -#define UOTGHS_DEVEPTCFG_NBTRANS_1_TRANS (0x1u << 13) /**< \brief (UOTGHS_DEVEPTCFG[12]) default value: one transaction per micro-frame. */ -#define UOTGHS_DEVEPTCFG_NBTRANS_2_TRANS (0x2u << 13) /**< \brief (UOTGHS_DEVEPTCFG[12]) 2 transactions per micro-frame. This endpoint should be configured as double-bank. */ -#define UOTGHS_DEVEPTCFG_NBTRANS_3_TRANS (0x3u << 13) /**< \brief (UOTGHS_DEVEPTCFG[12]) 3 transactions per micro-frame. This endpoint should be configured as triple-bank. */ -/* -------- UOTGHS_DEVEPTISR[12] : (UOTGHS Offset: 0x130) Device Endpoint Status Register (n = 0) -------- */ -#define UOTGHS_DEVEPTISR_TXINI (0x1u << 0) /**< \brief (UOTGHS_DEVEPTISR[12]) Transmitted IN Data Interrupt */ -#define UOTGHS_DEVEPTISR_RXOUTI (0x1u << 1) /**< \brief (UOTGHS_DEVEPTISR[12]) Received OUT Data Interrupt */ -#define UOTGHS_DEVEPTISR_RXSTPI (0x1u << 2) /**< \brief (UOTGHS_DEVEPTISR[12]) Received SETUP Interrupt */ -#define UOTGHS_DEVEPTISR_NAKOUTI (0x1u << 3) /**< \brief (UOTGHS_DEVEPTISR[12]) NAKed OUT Interrupt */ -#define UOTGHS_DEVEPTISR_NAKINI (0x1u << 4) /**< \brief (UOTGHS_DEVEPTISR[12]) NAKed IN Interrupt */ -#define UOTGHS_DEVEPTISR_OVERFI (0x1u << 5) /**< \brief (UOTGHS_DEVEPTISR[12]) Overflow Interrupt */ -#define UOTGHS_DEVEPTISR_STALLEDI (0x1u << 6) /**< \brief (UOTGHS_DEVEPTISR[12]) STALLed Interrupt */ -#define UOTGHS_DEVEPTISR_SHORTPACKET (0x1u << 7) /**< \brief (UOTGHS_DEVEPTISR[12]) Short Packet Interrupt */ -#define UOTGHS_DEVEPTISR_DTSEQ_Pos 8 -#define UOTGHS_DEVEPTISR_DTSEQ_Msk (0x3u << UOTGHS_DEVEPTISR_DTSEQ_Pos) /**< \brief (UOTGHS_DEVEPTISR[12]) Data Toggle Sequence */ -#define UOTGHS_DEVEPTISR_DTSEQ_DATA0 (0x0u << 8) /**< \brief (UOTGHS_DEVEPTISR[12]) Data0 toggle sequence */ -#define UOTGHS_DEVEPTISR_DTSEQ_DATA1 (0x1u << 8) /**< \brief (UOTGHS_DEVEPTISR[12]) Data1 toggle sequence */ -#define UOTGHS_DEVEPTISR_DTSEQ_DATA2 (0x2u << 8) /**< \brief (UOTGHS_DEVEPTISR[12]) Reserved for high-bandwidth isochronous endpoint */ -#define UOTGHS_DEVEPTISR_DTSEQ_MDATA (0x3u << 8) /**< \brief (UOTGHS_DEVEPTISR[12]) Reserved for high-bandwidth isochronous endpoint */ -#define UOTGHS_DEVEPTISR_NBUSYBK_Pos 12 -#define UOTGHS_DEVEPTISR_NBUSYBK_Msk (0x3u << UOTGHS_DEVEPTISR_NBUSYBK_Pos) /**< \brief (UOTGHS_DEVEPTISR[12]) Number of Busy Banks */ -#define UOTGHS_DEVEPTISR_NBUSYBK_0_BUSY (0x0u << 12) /**< \brief (UOTGHS_DEVEPTISR[12]) 0 busy bank (all banks free) */ -#define UOTGHS_DEVEPTISR_NBUSYBK_1_BUSY (0x1u << 12) /**< \brief (UOTGHS_DEVEPTISR[12]) 1 busy bank */ -#define UOTGHS_DEVEPTISR_NBUSYBK_2_BUSY (0x2u << 12) /**< \brief (UOTGHS_DEVEPTISR[12]) 2 busy banks */ -#define UOTGHS_DEVEPTISR_NBUSYBK_3_BUSY (0x3u << 12) /**< \brief (UOTGHS_DEVEPTISR[12]) 3 busy banks */ -#define UOTGHS_DEVEPTISR_CURRBK_Pos 14 -#define UOTGHS_DEVEPTISR_CURRBK_Msk (0x3u << UOTGHS_DEVEPTISR_CURRBK_Pos) /**< \brief (UOTGHS_DEVEPTISR[12]) Current Bank */ -#define UOTGHS_DEVEPTISR_CURRBK_BANK0 (0x0u << 14) /**< \brief (UOTGHS_DEVEPTISR[12]) Current bank is bank0 */ -#define UOTGHS_DEVEPTISR_CURRBK_BANK1 (0x1u << 14) /**< \brief (UOTGHS_DEVEPTISR[12]) Current bank is bank1 */ -#define UOTGHS_DEVEPTISR_CURRBK_BANK2 (0x2u << 14) /**< \brief (UOTGHS_DEVEPTISR[12]) Current bank is bank2 */ -#define UOTGHS_DEVEPTISR_RWALL (0x1u << 16) /**< \brief (UOTGHS_DEVEPTISR[12]) Read-write Allowed */ -#define UOTGHS_DEVEPTISR_CTRLDIR (0x1u << 17) /**< \brief (UOTGHS_DEVEPTISR[12]) Control Direction */ -#define UOTGHS_DEVEPTISR_CFGOK (0x1u << 18) /**< \brief (UOTGHS_DEVEPTISR[12]) Configuration OK Status */ -#define UOTGHS_DEVEPTISR_BYCT_Pos 20 -#define UOTGHS_DEVEPTISR_BYCT_Msk (0x7ffu << UOTGHS_DEVEPTISR_BYCT_Pos) /**< \brief (UOTGHS_DEVEPTISR[12]) Byte Count */ -#define UOTGHS_DEVEPTISR_UNDERFI (0x1u << 2) /**< \brief (UOTGHS_DEVEPTISR[12]) Underflow Interrupt */ -#define UOTGHS_DEVEPTISR_HBISOINERRI (0x1u << 3) /**< \brief (UOTGHS_DEVEPTISR[12]) High Bandwidth Isochronous IN Underflow Error Interrupt */ -#define UOTGHS_DEVEPTISR_HBISOFLUSHI (0x1u << 4) /**< \brief (UOTGHS_DEVEPTISR[12]) High Bandwidth Isochronous IN Flush Interrupt */ -#define UOTGHS_DEVEPTISR_CRCERRI (0x1u << 6) /**< \brief (UOTGHS_DEVEPTISR[12]) CRC Error Interrupt */ -#define UOTGHS_DEVEPTISR_ERRORTRANS (0x1u << 10) /**< \brief (UOTGHS_DEVEPTISR[12]) High-bandwidth Isochronous OUT Endpoint Transaction Error Interrupt */ -/* -------- UOTGHS_DEVEPTICR[12] : (UOTGHS Offset: 0x160) Device Endpoint Clear Register (n = 0) -------- */ -#define UOTGHS_DEVEPTICR_TXINIC (0x1u << 0) /**< \brief (UOTGHS_DEVEPTICR[12]) Transmitted IN Data Interrupt Clear */ -#define UOTGHS_DEVEPTICR_RXOUTIC (0x1u << 1) /**< \brief (UOTGHS_DEVEPTICR[12]) Received OUT Data Interrupt Clear */ -#define UOTGHS_DEVEPTICR_RXSTPIC (0x1u << 2) /**< \brief (UOTGHS_DEVEPTICR[12]) Received SETUP Interrupt Clear */ -#define UOTGHS_DEVEPTICR_NAKOUTIC (0x1u << 3) /**< \brief (UOTGHS_DEVEPTICR[12]) NAKed OUT Interrupt Clear */ -#define UOTGHS_DEVEPTICR_NAKINIC (0x1u << 4) /**< \brief (UOTGHS_DEVEPTICR[12]) NAKed IN Interrupt Clear */ -#define UOTGHS_DEVEPTICR_OVERFIC (0x1u << 5) /**< \brief (UOTGHS_DEVEPTICR[12]) Overflow Interrupt Clear */ -#define UOTGHS_DEVEPTICR_STALLEDIC (0x1u << 6) /**< \brief (UOTGHS_DEVEPTICR[12]) STALLed Interrupt Clear */ -#define UOTGHS_DEVEPTICR_SHORTPACKETC (0x1u << 7) /**< \brief (UOTGHS_DEVEPTICR[12]) Short Packet Interrupt Clear */ -#define UOTGHS_DEVEPTICR_UNDERFIC (0x1u << 2) /**< \brief (UOTGHS_DEVEPTICR[12]) Underflow Interrupt Clear */ -#define UOTGHS_DEVEPTICR_HBISOINERRIC (0x1u << 3) /**< \brief (UOTGHS_DEVEPTICR[12]) High bandwidth isochronous IN Underflow Error Interrupt Clear */ -#define UOTGHS_DEVEPTICR_HBISOFLUSHIC (0x1u << 4) /**< \brief (UOTGHS_DEVEPTICR[12]) High Bandwidth Isochronous IN Flush Interrupt Clear */ -#define UOTGHS_DEVEPTICR_CRCERRIC (0x1u << 6) /**< \brief (UOTGHS_DEVEPTICR[12]) CRC Error Interrupt Clear */ -/* -------- UOTGHS_DEVEPTIFR[12] : (UOTGHS Offset: 0x190) Device Endpoint Set Register (n = 0) -------- */ -#define UOTGHS_DEVEPTIFR_TXINIS (0x1u << 0) /**< \brief (UOTGHS_DEVEPTIFR[12]) Transmitted IN Data Interrupt Set */ -#define UOTGHS_DEVEPTIFR_RXOUTIS (0x1u << 1) /**< \brief (UOTGHS_DEVEPTIFR[12]) Received OUT Data Interrupt Set */ -#define UOTGHS_DEVEPTIFR_RXSTPIS (0x1u << 2) /**< \brief (UOTGHS_DEVEPTIFR[12]) Received SETUP Interrupt Set */ -#define UOTGHS_DEVEPTIFR_NAKOUTIS (0x1u << 3) /**< \brief (UOTGHS_DEVEPTIFR[12]) NAKed OUT Interrupt Set */ -#define UOTGHS_DEVEPTIFR_NAKINIS (0x1u << 4) /**< \brief (UOTGHS_DEVEPTIFR[12]) NAKed IN Interrupt Set */ -#define UOTGHS_DEVEPTIFR_OVERFIS (0x1u << 5) /**< \brief (UOTGHS_DEVEPTIFR[12]) Overflow Interrupt Set */ -#define UOTGHS_DEVEPTIFR_STALLEDIS (0x1u << 6) /**< \brief (UOTGHS_DEVEPTIFR[12]) STALLed Interrupt Set */ -#define UOTGHS_DEVEPTIFR_SHORTPACKETS (0x1u << 7) /**< \brief (UOTGHS_DEVEPTIFR[12]) Short Packet Interrupt Set */ -#define UOTGHS_DEVEPTIFR_NBUSYBKS (0x1u << 12) /**< \brief (UOTGHS_DEVEPTIFR[12]) Number of Busy Banks Interrupt Set */ -#define UOTGHS_DEVEPTIFR_UNDERFIS (0x1u << 2) /**< \brief (UOTGHS_DEVEPTIFR[12]) Underflow Interrupt Set */ -#define UOTGHS_DEVEPTIFR_HBISOINERRIS (0x1u << 3) /**< \brief (UOTGHS_DEVEPTIFR[12]) High bandwidth isochronous IN Underflow Error Interrupt Set */ -#define UOTGHS_DEVEPTIFR_HBISOFLUSHIS (0x1u << 4) /**< \brief (UOTGHS_DEVEPTIFR[12]) High Bandwidth Isochronous IN Flush Interrupt Set */ -#define UOTGHS_DEVEPTIFR_CRCERRIS (0x1u << 6) /**< \brief (UOTGHS_DEVEPTIFR[12]) CRC Error Interrupt Set */ -/* -------- UOTGHS_DEVEPTIMR[12] : (UOTGHS Offset: 0x1C0) Device Endpoint Mask Register (n = 0) -------- */ -#define UOTGHS_DEVEPTIMR_TXINE (0x1u << 0) /**< \brief (UOTGHS_DEVEPTIMR[12]) Transmitted IN Data Interrupt */ -#define UOTGHS_DEVEPTIMR_RXOUTE (0x1u << 1) /**< \brief (UOTGHS_DEVEPTIMR[12]) Received OUT Data Interrupt */ -#define UOTGHS_DEVEPTIMR_RXSTPE (0x1u << 2) /**< \brief (UOTGHS_DEVEPTIMR[12]) Received SETUP Interrupt */ -#define UOTGHS_DEVEPTIMR_NAKOUTE (0x1u << 3) /**< \brief (UOTGHS_DEVEPTIMR[12]) NAKed OUT Interrupt */ -#define UOTGHS_DEVEPTIMR_NAKINE (0x1u << 4) /**< \brief (UOTGHS_DEVEPTIMR[12]) NAKed IN Interrupt */ -#define UOTGHS_DEVEPTIMR_OVERFE (0x1u << 5) /**< \brief (UOTGHS_DEVEPTIMR[12]) Overflow Interrupt */ -#define UOTGHS_DEVEPTIMR_STALLEDE (0x1u << 6) /**< \brief (UOTGHS_DEVEPTIMR[12]) STALLed Interrupt */ -#define UOTGHS_DEVEPTIMR_SHORTPACKETE (0x1u << 7) /**< \brief (UOTGHS_DEVEPTIMR[12]) Short Packet Interrupt */ -#define UOTGHS_DEVEPTIMR_NBUSYBKE (0x1u << 12) /**< \brief (UOTGHS_DEVEPTIMR[12]) Number of Busy Banks Interrupt */ -#define UOTGHS_DEVEPTIMR_KILLBK (0x1u << 13) /**< \brief (UOTGHS_DEVEPTIMR[12]) Kill IN Bank */ -#define UOTGHS_DEVEPTIMR_FIFOCON (0x1u << 14) /**< \brief (UOTGHS_DEVEPTIMR[12]) FIFO Control */ -#define UOTGHS_DEVEPTIMR_EPDISHDMA (0x1u << 16) /**< \brief (UOTGHS_DEVEPTIMR[12]) Endpoint Interrupts Disable HDMA Request */ -#define UOTGHS_DEVEPTIMR_NYETDIS (0x1u << 17) /**< \brief (UOTGHS_DEVEPTIMR[12]) NYET Token Disable */ -#define UOTGHS_DEVEPTIMR_RSTDT (0x1u << 18) /**< \brief (UOTGHS_DEVEPTIMR[12]) Reset Data Toggle */ -#define UOTGHS_DEVEPTIMR_STALLRQ (0x1u << 19) /**< \brief (UOTGHS_DEVEPTIMR[12]) STALL Request */ -#define UOTGHS_DEVEPTIMR_UNDERFE (0x1u << 2) /**< \brief (UOTGHS_DEVEPTIMR[12]) Underflow Interrupt */ -#define UOTGHS_DEVEPTIMR_HBISOINERRE (0x1u << 3) /**< \brief (UOTGHS_DEVEPTIMR[12]) High Bandwidth Isochronous IN Error Interrupt */ -#define UOTGHS_DEVEPTIMR_HBISOFLUSHE (0x1u << 4) /**< \brief (UOTGHS_DEVEPTIMR[12]) High Bandwidth Isochronous IN Flush Interrupt */ -#define UOTGHS_DEVEPTIMR_CRCERRE (0x1u << 6) /**< \brief (UOTGHS_DEVEPTIMR[12]) CRC Error Interrupt */ -#define UOTGHS_DEVEPTIMR_MDATAE (0x1u << 8) /**< \brief (UOTGHS_DEVEPTIMR[12]) MData Interrupt */ -#define UOTGHS_DEVEPTIMR_DATAXE (0x1u << 9) /**< \brief (UOTGHS_DEVEPTIMR[12]) DataX Interrupt */ -#define UOTGHS_DEVEPTIMR_ERRORTRANSE (0x1u << 10) /**< \brief (UOTGHS_DEVEPTIMR[12]) Transaction Error Interrupt */ -/* -------- UOTGHS_DEVEPTIER[12] : (UOTGHS Offset: 0x1F0) Device Endpoint Enable Register (n = 0) -------- */ -#define UOTGHS_DEVEPTIER_TXINES (0x1u << 0) /**< \brief (UOTGHS_DEVEPTIER[12]) Transmitted IN Data Interrupt Enable */ -#define UOTGHS_DEVEPTIER_RXOUTES (0x1u << 1) /**< \brief (UOTGHS_DEVEPTIER[12]) Received OUT Data Interrupt Enable */ -#define UOTGHS_DEVEPTIER_RXSTPES (0x1u << 2) /**< \brief (UOTGHS_DEVEPTIER[12]) Received SETUP Interrupt Enable */ -#define UOTGHS_DEVEPTIER_NAKOUTES (0x1u << 3) /**< \brief (UOTGHS_DEVEPTIER[12]) NAKed OUT Interrupt Enable */ -#define UOTGHS_DEVEPTIER_NAKINES (0x1u << 4) /**< \brief (UOTGHS_DEVEPTIER[12]) NAKed IN Interrupt Enable */ -#define UOTGHS_DEVEPTIER_OVERFES (0x1u << 5) /**< \brief (UOTGHS_DEVEPTIER[12]) Overflow Interrupt Enable */ -#define UOTGHS_DEVEPTIER_STALLEDES (0x1u << 6) /**< \brief (UOTGHS_DEVEPTIER[12]) STALLed Interrupt Enable */ -#define UOTGHS_DEVEPTIER_SHORTPACKETES (0x1u << 7) /**< \brief (UOTGHS_DEVEPTIER[12]) Short Packet Interrupt Enable */ -#define UOTGHS_DEVEPTIER_NBUSYBKES (0x1u << 12) /**< \brief (UOTGHS_DEVEPTIER[12]) Number of Busy Banks Interrupt Enable */ -#define UOTGHS_DEVEPTIER_KILLBKS (0x1u << 13) /**< \brief (UOTGHS_DEVEPTIER[12]) Kill IN Bank */ -#define UOTGHS_DEVEPTIER_FIFOCONS (0x1u << 14) /**< \brief (UOTGHS_DEVEPTIER[12]) FIFO Control */ -#define UOTGHS_DEVEPTIER_EPDISHDMAS (0x1u << 16) /**< \brief (UOTGHS_DEVEPTIER[12]) Endpoint Interrupts Disable HDMA Request Enable */ -#define UOTGHS_DEVEPTIER_NYETDISS (0x1u << 17) /**< \brief (UOTGHS_DEVEPTIER[12]) NYET Token Disable Enable */ -#define UOTGHS_DEVEPTIER_RSTDTS (0x1u << 18) /**< \brief (UOTGHS_DEVEPTIER[12]) Reset Data Toggle Enable */ -#define UOTGHS_DEVEPTIER_STALLRQS (0x1u << 19) /**< \brief (UOTGHS_DEVEPTIER[12]) STALL Request Enable */ -#define UOTGHS_DEVEPTIER_UNDERFES (0x1u << 2) /**< \brief (UOTGHS_DEVEPTIER[12]) Underflow Interrupt Enable */ -#define UOTGHS_DEVEPTIER_HBISOINERRES (0x1u << 3) /**< \brief (UOTGHS_DEVEPTIER[12]) High Bandwidth Isochronous IN Error Interrupt Enable */ -#define UOTGHS_DEVEPTIER_HBISOFLUSHES (0x1u << 4) /**< \brief (UOTGHS_DEVEPTIER[12]) High Bandwidth Isochronous IN Flush Interrupt Enable */ -#define UOTGHS_DEVEPTIER_CRCERRES (0x1u << 6) /**< \brief (UOTGHS_DEVEPTIER[12]) CRC Error Interrupt Enable */ -#define UOTGHS_DEVEPTIER_MDATAES (0x1u << 8) /**< \brief (UOTGHS_DEVEPTIER[12]) MData Interrupt Enable */ -#define UOTGHS_DEVEPTIER_DATAXES (0x1u << 9) /**< \brief (UOTGHS_DEVEPTIER[12]) DataX Interrupt Enable */ -#define UOTGHS_DEVEPTIER_ERRORTRANSES (0x1u << 10) /**< \brief (UOTGHS_DEVEPTIER[12]) Transaction Error Interrupt Enable */ -/* -------- UOTGHS_DEVEPTIDR[12] : (UOTGHS Offset: 0x220) Device Endpoint Disable Register (n = 0) -------- */ -#define UOTGHS_DEVEPTIDR_TXINEC (0x1u << 0) /**< \brief (UOTGHS_DEVEPTIDR[12]) Transmitted IN Interrupt Clear */ -#define UOTGHS_DEVEPTIDR_RXOUTEC (0x1u << 1) /**< \brief (UOTGHS_DEVEPTIDR[12]) Received OUT Data Interrupt Clear */ -#define UOTGHS_DEVEPTIDR_RXSTPEC (0x1u << 2) /**< \brief (UOTGHS_DEVEPTIDR[12]) Received SETUP Interrupt Clear */ -#define UOTGHS_DEVEPTIDR_NAKOUTEC (0x1u << 3) /**< \brief (UOTGHS_DEVEPTIDR[12]) NAKed OUT Interrupt Clear */ -#define UOTGHS_DEVEPTIDR_NAKINEC (0x1u << 4) /**< \brief (UOTGHS_DEVEPTIDR[12]) NAKed IN Interrupt Clear */ -#define UOTGHS_DEVEPTIDR_OVERFEC (0x1u << 5) /**< \brief (UOTGHS_DEVEPTIDR[12]) Overflow Interrupt Clear */ -#define UOTGHS_DEVEPTIDR_STALLEDEC (0x1u << 6) /**< \brief (UOTGHS_DEVEPTIDR[12]) STALLed Interrupt Clear */ -#define UOTGHS_DEVEPTIDR_SHORTPACKETEC (0x1u << 7) /**< \brief (UOTGHS_DEVEPTIDR[12]) Shortpacket Interrupt Clear */ -#define UOTGHS_DEVEPTIDR_NBUSYBKEC (0x1u << 12) /**< \brief (UOTGHS_DEVEPTIDR[12]) Number of Busy Banks Interrupt Clear */ -#define UOTGHS_DEVEPTIDR_FIFOCONC (0x1u << 14) /**< \brief (UOTGHS_DEVEPTIDR[12]) FIFO Control Clear */ -#define UOTGHS_DEVEPTIDR_EPDISHDMAC (0x1u << 16) /**< \brief (UOTGHS_DEVEPTIDR[12]) Endpoint Interrupts Disable HDMA Request Clear */ -#define UOTGHS_DEVEPTIDR_NYETDISC (0x1u << 17) /**< \brief (UOTGHS_DEVEPTIDR[12]) NYET Token Disable Clear */ -#define UOTGHS_DEVEPTIDR_STALLRQC (0x1u << 19) /**< \brief (UOTGHS_DEVEPTIDR[12]) STALL Request Clear */ -#define UOTGHS_DEVEPTIDR_UNDERFEC (0x1u << 2) /**< \brief (UOTGHS_DEVEPTIDR[12]) Underflow Interrupt Clear */ -#define UOTGHS_DEVEPTIDR_HBISOINERREC (0x1u << 3) /**< \brief (UOTGHS_DEVEPTIDR[12]) High Bandwidth Isochronous IN Error Interrupt Clear */ -#define UOTGHS_DEVEPTIDR_HBISOFLUSHEC (0x1u << 4) /**< \brief (UOTGHS_DEVEPTIDR[12]) High Bandwidth Isochronous IN Flush Interrupt Clear */ -#define UOTGHS_DEVEPTIDR_CRCERREC (0x1u << 6) /**< \brief (UOTGHS_DEVEPTIDR[12]) CRC Error Interrupt Clear */ -#define UOTGHS_DEVEPTIDR_MDATEC (0x1u << 8) /**< \brief (UOTGHS_DEVEPTIDR[12]) MData Interrupt Clear */ -#define UOTGHS_DEVEPTIDR_DATAXEC (0x1u << 9) /**< \brief (UOTGHS_DEVEPTIDR[12]) DataX Interrupt Clear */ -#define UOTGHS_DEVEPTIDR_ERRORTRANSEC (0x1u << 10) /**< \brief (UOTGHS_DEVEPTIDR[12]) Transaction Error Interrupt Clear */ -/* -------- UOTGHS_DEVDMANXTDSC : (UOTGHS Offset: N/A) Device DMA Channel Next Descriptor Address Register -------- */ -#define UOTGHS_DEVDMANXTDSC_NXT_DSC_ADD_Pos 0 -#define UOTGHS_DEVDMANXTDSC_NXT_DSC_ADD_Msk (0xffffffffu << UOTGHS_DEVDMANXTDSC_NXT_DSC_ADD_Pos) /**< \brief (UOTGHS_DEVDMANXTDSC) Next Descriptor Address */ -#define UOTGHS_DEVDMANXTDSC_NXT_DSC_ADD(value) ((UOTGHS_DEVDMANXTDSC_NXT_DSC_ADD_Msk & ((value) << UOTGHS_DEVDMANXTDSC_NXT_DSC_ADD_Pos))) -/* -------- UOTGHS_DEVDMAADDRESS : (UOTGHS Offset: N/A) Device DMA Channel Address Register -------- */ -#define UOTGHS_DEVDMAADDRESS_BUFF_ADD_Pos 0 -#define UOTGHS_DEVDMAADDRESS_BUFF_ADD_Msk (0xffffffffu << UOTGHS_DEVDMAADDRESS_BUFF_ADD_Pos) /**< \brief (UOTGHS_DEVDMAADDRESS) Buffer Address */ -#define UOTGHS_DEVDMAADDRESS_BUFF_ADD(value) ((UOTGHS_DEVDMAADDRESS_BUFF_ADD_Msk & ((value) << UOTGHS_DEVDMAADDRESS_BUFF_ADD_Pos))) -/* -------- UOTGHS_DEVDMACONTROL : (UOTGHS Offset: N/A) Device DMA Channel Control Register -------- */ -#define UOTGHS_DEVDMACONTROL_CHANN_ENB (0x1u << 0) /**< \brief (UOTGHS_DEVDMACONTROL) Channel Enable Command */ -#define UOTGHS_DEVDMACONTROL_LDNXT_DSC (0x1u << 1) /**< \brief (UOTGHS_DEVDMACONTROL) Load Next Channel Transfer Descriptor Enable Command */ -#define UOTGHS_DEVDMACONTROL_END_TR_EN (0x1u << 2) /**< \brief (UOTGHS_DEVDMACONTROL) End of Transfer Enable Control */ -#define UOTGHS_DEVDMACONTROL_END_B_EN (0x1u << 3) /**< \brief (UOTGHS_DEVDMACONTROL) End of Buffer Enable Control */ -#define UOTGHS_DEVDMACONTROL_END_TR_IT (0x1u << 4) /**< \brief (UOTGHS_DEVDMACONTROL) End of Transfer Interrupt Enable */ -#define UOTGHS_DEVDMACONTROL_END_BUFFIT (0x1u << 5) /**< \brief (UOTGHS_DEVDMACONTROL) End of Buffer Interrupt Enable */ -#define UOTGHS_DEVDMACONTROL_DESC_LD_IT (0x1u << 6) /**< \brief (UOTGHS_DEVDMACONTROL) Descriptor Loaded Interrupt Enable */ -#define UOTGHS_DEVDMACONTROL_BURST_LCK (0x1u << 7) /**< \brief (UOTGHS_DEVDMACONTROL) Burst Lock Enable */ -#define UOTGHS_DEVDMACONTROL_BUFF_LENGTH_Pos 16 -#define UOTGHS_DEVDMACONTROL_BUFF_LENGTH_Msk (0xffffu << UOTGHS_DEVDMACONTROL_BUFF_LENGTH_Pos) /**< \brief (UOTGHS_DEVDMACONTROL) Buffer Byte Length (Write-only) */ -#define UOTGHS_DEVDMACONTROL_BUFF_LENGTH(value) ((UOTGHS_DEVDMACONTROL_BUFF_LENGTH_Msk & ((value) << UOTGHS_DEVDMACONTROL_BUFF_LENGTH_Pos))) -/* -------- UOTGHS_DEVDMASTATUS : (UOTGHS Offset: N/A) Device DMA Channel Status Register -------- */ -#define UOTGHS_DEVDMASTATUS_CHANN_ENB (0x1u << 0) /**< \brief (UOTGHS_DEVDMASTATUS) Channel Enable Status */ -#define UOTGHS_DEVDMASTATUS_CHANN_ACT (0x1u << 1) /**< \brief (UOTGHS_DEVDMASTATUS) Channel Active Status */ -#define UOTGHS_DEVDMASTATUS_END_TR_ST (0x1u << 4) /**< \brief (UOTGHS_DEVDMASTATUS) End of Channel Transfer Status */ -#define UOTGHS_DEVDMASTATUS_END_BF_ST (0x1u << 5) /**< \brief (UOTGHS_DEVDMASTATUS) End of Channel Buffer Status */ -#define UOTGHS_DEVDMASTATUS_DESC_LDST (0x1u << 6) /**< \brief (UOTGHS_DEVDMASTATUS) Descriptor Loaded Status */ -#define UOTGHS_DEVDMASTATUS_BUFF_COUNT_Pos 16 -#define UOTGHS_DEVDMASTATUS_BUFF_COUNT_Msk (0xffffu << UOTGHS_DEVDMASTATUS_BUFF_COUNT_Pos) /**< \brief (UOTGHS_DEVDMASTATUS) Buffer Byte Count */ -#define UOTGHS_DEVDMASTATUS_BUFF_COUNT(value) ((UOTGHS_DEVDMASTATUS_BUFF_COUNT_Msk & ((value) << UOTGHS_DEVDMASTATUS_BUFF_COUNT_Pos))) -/* -------- UOTGHS_HSTCTRL : (UOTGHS Offset: 0x0400) Host General Control Register -------- */ -#define UOTGHS_HSTCTRL_SOFE (0x1u << 8) /**< \brief (UOTGHS_HSTCTRL) Start of Frame Generation Enable */ -#define UOTGHS_HSTCTRL_RESET (0x1u << 9) /**< \brief (UOTGHS_HSTCTRL) Send USB Reset */ -#define UOTGHS_HSTCTRL_RESUME (0x1u << 10) /**< \brief (UOTGHS_HSTCTRL) Send USB Resume */ -#define UOTGHS_HSTCTRL_SPDCONF_Pos 12 -#define UOTGHS_HSTCTRL_SPDCONF_Msk (0x3u << UOTGHS_HSTCTRL_SPDCONF_Pos) /**< \brief (UOTGHS_HSTCTRL) Mode Configuration */ -#define UOTGHS_HSTCTRL_SPDCONF_NORMAL (0x0u << 12) /**< \brief (UOTGHS_HSTCTRL) The host starts in full-speed mode and performs a high-speed reset to switch to the high-speed mode if the downstream peripheral is high-speed capable. */ -#define UOTGHS_HSTCTRL_SPDCONF_LOW_POWER (0x1u << 12) /**< \brief (UOTGHS_HSTCTRL) For a better consumption, if high-speed is not needed. */ -#define UOTGHS_HSTCTRL_SPDCONF_HIGH_SPEED (0x2u << 12) /**< \brief (UOTGHS_HSTCTRL) Forced high speed. */ -#define UOTGHS_HSTCTRL_SPDCONF_FORCED_FS (0x3u << 12) /**< \brief (UOTGHS_HSTCTRL) The host remains to full-speed mode whatever the peripheral speed capability. */ -/* -------- UOTGHS_HSTISR : (UOTGHS Offset: 0x0404) Host Global Interrupt Status Register -------- */ -#define UOTGHS_HSTISR_DCONNI (0x1u << 0) /**< \brief (UOTGHS_HSTISR) Device Connection Interrupt */ -#define UOTGHS_HSTISR_DDISCI (0x1u << 1) /**< \brief (UOTGHS_HSTISR) Device Disconnection Interrupt */ -#define UOTGHS_HSTISR_RSTI (0x1u << 2) /**< \brief (UOTGHS_HSTISR) USB Reset Sent Interrupt */ -#define UOTGHS_HSTISR_RSMEDI (0x1u << 3) /**< \brief (UOTGHS_HSTISR) Downstream Resume Sent Interrupt */ -#define UOTGHS_HSTISR_RXRSMI (0x1u << 4) /**< \brief (UOTGHS_HSTISR) Upstream Resume Received Interrupt */ -#define UOTGHS_HSTISR_HSOFI (0x1u << 5) /**< \brief (UOTGHS_HSTISR) Host Start of Frame Interrupt */ -#define UOTGHS_HSTISR_HWUPI (0x1u << 6) /**< \brief (UOTGHS_HSTISR) Host Wake-Up Interrupt */ -#define UOTGHS_HSTISR_PEP_0 (0x1u << 8) /**< \brief (UOTGHS_HSTISR) Pipe 0 Interrupt */ -#define UOTGHS_HSTISR_PEP_1 (0x1u << 9) /**< \brief (UOTGHS_HSTISR) Pipe 1 Interrupt */ -#define UOTGHS_HSTISR_PEP_2 (0x1u << 10) /**< \brief (UOTGHS_HSTISR) Pipe 2 Interrupt */ -#define UOTGHS_HSTISR_PEP_3 (0x1u << 11) /**< \brief (UOTGHS_HSTISR) Pipe 3 Interrupt */ -#define UOTGHS_HSTISR_PEP_4 (0x1u << 12) /**< \brief (UOTGHS_HSTISR) Pipe 4 Interrupt */ -#define UOTGHS_HSTISR_PEP_5 (0x1u << 13) /**< \brief (UOTGHS_HSTISR) Pipe 5 Interrupt */ -#define UOTGHS_HSTISR_PEP_6 (0x1u << 14) /**< \brief (UOTGHS_HSTISR) Pipe 6 Interrupt */ -#define UOTGHS_HSTISR_PEP_7 (0x1u << 15) /**< \brief (UOTGHS_HSTISR) Pipe 7 Interrupt */ -#define UOTGHS_HSTISR_PEP_8 (0x1u << 16) /**< \brief (UOTGHS_HSTISR) Pipe 8 Interrupt */ -#define UOTGHS_HSTISR_PEP_9 (0x1u << 17) /**< \brief (UOTGHS_HSTISR) Pipe 9 Interrupt */ -#define UOTGHS_HSTISR_PEP_10 (0x1u << 18) /**< \brief (UOTGHS_HSTISR) Pipe 10 Interrupt */ -#define UOTGHS_HSTISR_PEP_11 (0x1u << 19) /**< \brief (UOTGHS_HSTISR) Pipe 11 Interrupt */ -#define UOTGHS_HSTISR_DMA_1 (0x1u << 25) /**< \brief (UOTGHS_HSTISR) DMA Channel 1 Interrupt */ -#define UOTGHS_HSTISR_DMA_2 (0x1u << 26) /**< \brief (UOTGHS_HSTISR) DMA Channel 2 Interrupt */ -#define UOTGHS_HSTISR_DMA_3 (0x1u << 27) /**< \brief (UOTGHS_HSTISR) DMA Channel 3 Interrupt */ -#define UOTGHS_HSTISR_DMA_4 (0x1u << 28) /**< \brief (UOTGHS_HSTISR) DMA Channel 4 Interrupt */ -#define UOTGHS_HSTISR_DMA_5 (0x1u << 29) /**< \brief (UOTGHS_HSTISR) DMA Channel 5 Interrupt */ -#define UOTGHS_HSTISR_DMA_6 (0x1u << 30) /**< \brief (UOTGHS_HSTISR) DMA Channel 6 Interrupt */ -#define UOTGHS_HSTISR_DMA_7 (0x1u << 31) /**< \brief (UOTGHS_HSTISR) DMA Channel 7 Interrupt */ -/* -------- UOTGHS_HSTICR : (UOTGHS Offset: 0x0408) Host Global Interrupt Clear Register -------- */ -#define UOTGHS_HSTICR_DCONNIC (0x1u << 0) /**< \brief (UOTGHS_HSTICR) Device Connection Interrupt Clear */ -#define UOTGHS_HSTICR_DDISCIC (0x1u << 1) /**< \brief (UOTGHS_HSTICR) Device Disconnection Interrupt Clear */ -#define UOTGHS_HSTICR_RSTIC (0x1u << 2) /**< \brief (UOTGHS_HSTICR) USB Reset Sent Interrupt Clear */ -#define UOTGHS_HSTICR_RSMEDIC (0x1u << 3) /**< \brief (UOTGHS_HSTICR) Downstream Resume Sent Interrupt Clear */ -#define UOTGHS_HSTICR_RXRSMIC (0x1u << 4) /**< \brief (UOTGHS_HSTICR) Upstream Resume Received Interrupt Clear */ -#define UOTGHS_HSTICR_HSOFIC (0x1u << 5) /**< \brief (UOTGHS_HSTICR) Host Start of Frame Interrupt Clear */ -#define UOTGHS_HSTICR_HWUPIC (0x1u << 6) /**< \brief (UOTGHS_HSTICR) Host Wake-Up Interrupt Clear */ -/* -------- UOTGHS_HSTIFR : (UOTGHS Offset: 0x040C) Host Global Interrupt Set Register -------- */ -#define UOTGHS_HSTIFR_DCONNIS (0x1u << 0) /**< \brief (UOTGHS_HSTIFR) Device Connection Interrupt Set */ -#define UOTGHS_HSTIFR_DDISCIS (0x1u << 1) /**< \brief (UOTGHS_HSTIFR) Device Disconnection Interrupt Set */ -#define UOTGHS_HSTIFR_RSTIS (0x1u << 2) /**< \brief (UOTGHS_HSTIFR) USB Reset Sent Interrupt Set */ -#define UOTGHS_HSTIFR_RSMEDIS (0x1u << 3) /**< \brief (UOTGHS_HSTIFR) Downstream Resume Sent Interrupt Set */ -#define UOTGHS_HSTIFR_RXRSMIS (0x1u << 4) /**< \brief (UOTGHS_HSTIFR) Upstream Resume Received Interrupt Set */ -#define UOTGHS_HSTIFR_HSOFIS (0x1u << 5) /**< \brief (UOTGHS_HSTIFR) Host Start of Frame Interrupt Set */ -#define UOTGHS_HSTIFR_HWUPIS (0x1u << 6) /**< \brief (UOTGHS_HSTIFR) Host Wake-Up Interrupt Set */ -#define UOTGHS_HSTIFR_DMA_1 (0x1u << 25) /**< \brief (UOTGHS_HSTIFR) DMA Channel 1 Interrupt Set */ -#define UOTGHS_HSTIFR_DMA_2 (0x1u << 26) /**< \brief (UOTGHS_HSTIFR) DMA Channel 2 Interrupt Set */ -#define UOTGHS_HSTIFR_DMA_3 (0x1u << 27) /**< \brief (UOTGHS_HSTIFR) DMA Channel 3 Interrupt Set */ -#define UOTGHS_HSTIFR_DMA_4 (0x1u << 28) /**< \brief (UOTGHS_HSTIFR) DMA Channel 4 Interrupt Set */ -#define UOTGHS_HSTIFR_DMA_5 (0x1u << 29) /**< \brief (UOTGHS_HSTIFR) DMA Channel 5 Interrupt Set */ -#define UOTGHS_HSTIFR_DMA_6 (0x1u << 30) /**< \brief (UOTGHS_HSTIFR) DMA Channel 6 Interrupt Set */ -#define UOTGHS_HSTIFR_DMA_7 (0x1u << 31) /**< \brief (UOTGHS_HSTIFR) DMA Channel 7 Interrupt Set */ -/* -------- UOTGHS_HSTIMR : (UOTGHS Offset: 0x0410) Host Global Interrupt Mask Register -------- */ -#define UOTGHS_HSTIMR_DCONNIE (0x1u << 0) /**< \brief (UOTGHS_HSTIMR) Device Connection Interrupt Enable */ -#define UOTGHS_HSTIMR_DDISCIE (0x1u << 1) /**< \brief (UOTGHS_HSTIMR) Device Disconnection Interrupt Enable */ -#define UOTGHS_HSTIMR_RSTIE (0x1u << 2) /**< \brief (UOTGHS_HSTIMR) USB Reset Sent Interrupt Enable */ -#define UOTGHS_HSTIMR_RSMEDIE (0x1u << 3) /**< \brief (UOTGHS_HSTIMR) Downstream Resume Sent Interrupt Enable */ -#define UOTGHS_HSTIMR_RXRSMIE (0x1u << 4) /**< \brief (UOTGHS_HSTIMR) Upstream Resume Received Interrupt Enable */ -#define UOTGHS_HSTIMR_HSOFIE (0x1u << 5) /**< \brief (UOTGHS_HSTIMR) Host Start of Frame Interrupt Enable */ -#define UOTGHS_HSTIMR_HWUPIE (0x1u << 6) /**< \brief (UOTGHS_HSTIMR) Host Wake-Up Interrupt Enable */ -#define UOTGHS_HSTIMR_PEP_0 (0x1u << 8) /**< \brief (UOTGHS_HSTIMR) Pipe 0 Interrupt Enable */ -#define UOTGHS_HSTIMR_PEP_1 (0x1u << 9) /**< \brief (UOTGHS_HSTIMR) Pipe 1 Interrupt Enable */ -#define UOTGHS_HSTIMR_PEP_2 (0x1u << 10) /**< \brief (UOTGHS_HSTIMR) Pipe 2 Interrupt Enable */ -#define UOTGHS_HSTIMR_PEP_3 (0x1u << 11) /**< \brief (UOTGHS_HSTIMR) Pipe 3 Interrupt Enable */ -#define UOTGHS_HSTIMR_PEP_4 (0x1u << 12) /**< \brief (UOTGHS_HSTIMR) Pipe 4 Interrupt Enable */ -#define UOTGHS_HSTIMR_PEP_5 (0x1u << 13) /**< \brief (UOTGHS_HSTIMR) Pipe 5 Interrupt Enable */ -#define UOTGHS_HSTIMR_PEP_6 (0x1u << 14) /**< \brief (UOTGHS_HSTIMR) Pipe 6 Interrupt Enable */ -#define UOTGHS_HSTIMR_PEP_7 (0x1u << 15) /**< \brief (UOTGHS_HSTIMR) Pipe 7 Interrupt Enable */ -#define UOTGHS_HSTIMR_PEP_8 (0x1u << 16) /**< \brief (UOTGHS_HSTIMR) Pipe 8 Interrupt Enable */ -#define UOTGHS_HSTIMR_PEP_9 (0x1u << 17) /**< \brief (UOTGHS_HSTIMR) Pipe 9 Interrupt Enable */ -#define UOTGHS_HSTIMR_PEP_10 (0x1u << 18) /**< \brief (UOTGHS_HSTIMR) Pipe 10 Interrupt Enable */ -#define UOTGHS_HSTIMR_PEP_11 (0x1u << 19) /**< \brief (UOTGHS_HSTIMR) Pipe 11 Interrupt Enable */ -#define UOTGHS_HSTIMR_DMA_1 (0x1u << 25) /**< \brief (UOTGHS_HSTIMR) DMA Channel 1 Interrupt Enable */ -#define UOTGHS_HSTIMR_DMA_2 (0x1u << 26) /**< \brief (UOTGHS_HSTIMR) DMA Channel 2 Interrupt Enable */ -#define UOTGHS_HSTIMR_DMA_3 (0x1u << 27) /**< \brief (UOTGHS_HSTIMR) DMA Channel 3 Interrupt Enable */ -#define UOTGHS_HSTIMR_DMA_4 (0x1u << 28) /**< \brief (UOTGHS_HSTIMR) DMA Channel 4 Interrupt Enable */ -#define UOTGHS_HSTIMR_DMA_5 (0x1u << 29) /**< \brief (UOTGHS_HSTIMR) DMA Channel 5 Interrupt Enable */ -#define UOTGHS_HSTIMR_DMA_6 (0x1u << 30) /**< \brief (UOTGHS_HSTIMR) DMA Channel 6 Interrupt Enable */ -#define UOTGHS_HSTIMR_DMA_7 (0x1u << 31) /**< \brief (UOTGHS_HSTIMR) DMA Channel 7 Interrupt Enable */ -/* -------- UOTGHS_HSTIDR : (UOTGHS Offset: 0x0414) Host Global Interrupt Disable Register -------- */ -#define UOTGHS_HSTIDR_DCONNIEC (0x1u << 0) /**< \brief (UOTGHS_HSTIDR) Device Connection Interrupt Disable */ -#define UOTGHS_HSTIDR_DDISCIEC (0x1u << 1) /**< \brief (UOTGHS_HSTIDR) Device Disconnection Interrupt Disable */ -#define UOTGHS_HSTIDR_RSTIEC (0x1u << 2) /**< \brief (UOTGHS_HSTIDR) USB Reset Sent Interrupt Disable */ -#define UOTGHS_HSTIDR_RSMEDIEC (0x1u << 3) /**< \brief (UOTGHS_HSTIDR) Downstream Resume Sent Interrupt Disable */ -#define UOTGHS_HSTIDR_RXRSMIEC (0x1u << 4) /**< \brief (UOTGHS_HSTIDR) Upstream Resume Received Interrupt Disable */ -#define UOTGHS_HSTIDR_HSOFIEC (0x1u << 5) /**< \brief (UOTGHS_HSTIDR) Host Start of Frame Interrupt Disable */ -#define UOTGHS_HSTIDR_HWUPIEC (0x1u << 6) /**< \brief (UOTGHS_HSTIDR) Host Wake-Up Interrupt Disable */ -#define UOTGHS_HSTIDR_PEP_0 (0x1u << 8) /**< \brief (UOTGHS_HSTIDR) Pipe 0 Interrupt Disable */ -#define UOTGHS_HSTIDR_PEP_1 (0x1u << 9) /**< \brief (UOTGHS_HSTIDR) Pipe 1 Interrupt Disable */ -#define UOTGHS_HSTIDR_PEP_2 (0x1u << 10) /**< \brief (UOTGHS_HSTIDR) Pipe 2 Interrupt Disable */ -#define UOTGHS_HSTIDR_PEP_3 (0x1u << 11) /**< \brief (UOTGHS_HSTIDR) Pipe 3 Interrupt Disable */ -#define UOTGHS_HSTIDR_PEP_4 (0x1u << 12) /**< \brief (UOTGHS_HSTIDR) Pipe 4 Interrupt Disable */ -#define UOTGHS_HSTIDR_PEP_5 (0x1u << 13) /**< \brief (UOTGHS_HSTIDR) Pipe 5 Interrupt Disable */ -#define UOTGHS_HSTIDR_PEP_6 (0x1u << 14) /**< \brief (UOTGHS_HSTIDR) Pipe 6 Interrupt Disable */ -#define UOTGHS_HSTIDR_PEP_7 (0x1u << 15) /**< \brief (UOTGHS_HSTIDR) Pipe 7 Interrupt Disable */ -#define UOTGHS_HSTIDR_PEP_8 (0x1u << 16) /**< \brief (UOTGHS_HSTIDR) Pipe 8 Interrupt Disable */ -#define UOTGHS_HSTIDR_PEP_9 (0x1u << 17) /**< \brief (UOTGHS_HSTIDR) Pipe 9 Interrupt Disable */ -#define UOTGHS_HSTIDR_PEP_10 (0x1u << 18) /**< \brief (UOTGHS_HSTIDR) Pipe 10 Interrupt Disable */ -#define UOTGHS_HSTIDR_PEP_11 (0x1u << 19) /**< \brief (UOTGHS_HSTIDR) Pipe 11 Interrupt Disable */ -#define UOTGHS_HSTIDR_DMA_1 (0x1u << 25) /**< \brief (UOTGHS_HSTIDR) DMA Channel 1 Interrupt Disable */ -#define UOTGHS_HSTIDR_DMA_2 (0x1u << 26) /**< \brief (UOTGHS_HSTIDR) DMA Channel 2 Interrupt Disable */ -#define UOTGHS_HSTIDR_DMA_3 (0x1u << 27) /**< \brief (UOTGHS_HSTIDR) DMA Channel 3 Interrupt Disable */ -#define UOTGHS_HSTIDR_DMA_4 (0x1u << 28) /**< \brief (UOTGHS_HSTIDR) DMA Channel 4 Interrupt Disable */ -#define UOTGHS_HSTIDR_DMA_5 (0x1u << 29) /**< \brief (UOTGHS_HSTIDR) DMA Channel 5 Interrupt Disable */ -#define UOTGHS_HSTIDR_DMA_6 (0x1u << 30) /**< \brief (UOTGHS_HSTIDR) DMA Channel 6 Interrupt Disable */ -#define UOTGHS_HSTIDR_DMA_7 (0x1u << 31) /**< \brief (UOTGHS_HSTIDR) DMA Channel 7 Interrupt Disable */ -/* -------- UOTGHS_HSTIER : (UOTGHS Offset: 0x0418) Host Global Interrupt Enable Register -------- */ -#define UOTGHS_HSTIER_DCONNIES (0x1u << 0) /**< \brief (UOTGHS_HSTIER) Device Connection Interrupt Enable */ -#define UOTGHS_HSTIER_DDISCIES (0x1u << 1) /**< \brief (UOTGHS_HSTIER) Device Disconnection Interrupt Enable */ -#define UOTGHS_HSTIER_RSTIES (0x1u << 2) /**< \brief (UOTGHS_HSTIER) USB Reset Sent Interrupt Enable */ -#define UOTGHS_HSTIER_RSMEDIES (0x1u << 3) /**< \brief (UOTGHS_HSTIER) Downstream Resume Sent Interrupt Enable */ -#define UOTGHS_HSTIER_RXRSMIES (0x1u << 4) /**< \brief (UOTGHS_HSTIER) Upstream Resume Received Interrupt Enable */ -#define UOTGHS_HSTIER_HSOFIES (0x1u << 5) /**< \brief (UOTGHS_HSTIER) Host Start of Frame Interrupt Enable */ -#define UOTGHS_HSTIER_HWUPIES (0x1u << 6) /**< \brief (UOTGHS_HSTIER) Host Wake-Up Interrupt Enable */ -#define UOTGHS_HSTIER_PEP_0 (0x1u << 8) /**< \brief (UOTGHS_HSTIER) Pipe 0 Interrupt Enable */ -#define UOTGHS_HSTIER_PEP_1 (0x1u << 9) /**< \brief (UOTGHS_HSTIER) Pipe 1 Interrupt Enable */ -#define UOTGHS_HSTIER_PEP_2 (0x1u << 10) /**< \brief (UOTGHS_HSTIER) Pipe 2 Interrupt Enable */ -#define UOTGHS_HSTIER_PEP_3 (0x1u << 11) /**< \brief (UOTGHS_HSTIER) Pipe 3 Interrupt Enable */ -#define UOTGHS_HSTIER_PEP_4 (0x1u << 12) /**< \brief (UOTGHS_HSTIER) Pipe 4 Interrupt Enable */ -#define UOTGHS_HSTIER_PEP_5 (0x1u << 13) /**< \brief (UOTGHS_HSTIER) Pipe 5 Interrupt Enable */ -#define UOTGHS_HSTIER_PEP_6 (0x1u << 14) /**< \brief (UOTGHS_HSTIER) Pipe 6 Interrupt Enable */ -#define UOTGHS_HSTIER_PEP_7 (0x1u << 15) /**< \brief (UOTGHS_HSTIER) Pipe 7 Interrupt Enable */ -#define UOTGHS_HSTIER_PEP_8 (0x1u << 16) /**< \brief (UOTGHS_HSTIER) Pipe 8 Interrupt Enable */ -#define UOTGHS_HSTIER_PEP_9 (0x1u << 17) /**< \brief (UOTGHS_HSTIER) Pipe 9 Interrupt Enable */ -#define UOTGHS_HSTIER_PEP_10 (0x1u << 18) /**< \brief (UOTGHS_HSTIER) Pipe 10 Interrupt Enable */ -#define UOTGHS_HSTIER_PEP_11 (0x1u << 19) /**< \brief (UOTGHS_HSTIER) Pipe 11 Interrupt Enable */ -#define UOTGHS_HSTIER_DMA_1 (0x1u << 25) /**< \brief (UOTGHS_HSTIER) DMA Channel 1 Interrupt Enable */ -#define UOTGHS_HSTIER_DMA_2 (0x1u << 26) /**< \brief (UOTGHS_HSTIER) DMA Channel 2 Interrupt Enable */ -#define UOTGHS_HSTIER_DMA_3 (0x1u << 27) /**< \brief (UOTGHS_HSTIER) DMA Channel 3 Interrupt Enable */ -#define UOTGHS_HSTIER_DMA_4 (0x1u << 28) /**< \brief (UOTGHS_HSTIER) DMA Channel 4 Interrupt Enable */ -#define UOTGHS_HSTIER_DMA_5 (0x1u << 29) /**< \brief (UOTGHS_HSTIER) DMA Channel 5 Interrupt Enable */ -#define UOTGHS_HSTIER_DMA_6 (0x1u << 30) /**< \brief (UOTGHS_HSTIER) DMA Channel 6 Interrupt Enable */ -#define UOTGHS_HSTIER_DMA_7 (0x1u << 31) /**< \brief (UOTGHS_HSTIER) DMA Channel 7 Interrupt Enable */ -/* -------- UOTGHS_HSTPIP : (UOTGHS Offset: 0x0041C) Host Pipe Register -------- */ -#define UOTGHS_HSTPIP_PEN0 (0x1u << 0) /**< \brief (UOTGHS_HSTPIP) Pipe 0 Enable */ -#define UOTGHS_HSTPIP_PEN1 (0x1u << 1) /**< \brief (UOTGHS_HSTPIP) Pipe 1 Enable */ -#define UOTGHS_HSTPIP_PEN2 (0x1u << 2) /**< \brief (UOTGHS_HSTPIP) Pipe 2 Enable */ -#define UOTGHS_HSTPIP_PEN3 (0x1u << 3) /**< \brief (UOTGHS_HSTPIP) Pipe 3 Enable */ -#define UOTGHS_HSTPIP_PEN4 (0x1u << 4) /**< \brief (UOTGHS_HSTPIP) Pipe 4 Enable */ -#define UOTGHS_HSTPIP_PEN5 (0x1u << 5) /**< \brief (UOTGHS_HSTPIP) Pipe 5 Enable */ -#define UOTGHS_HSTPIP_PEN6 (0x1u << 6) /**< \brief (UOTGHS_HSTPIP) Pipe 6 Enable */ -#define UOTGHS_HSTPIP_PEN7 (0x1u << 7) /**< \brief (UOTGHS_HSTPIP) Pipe 7 Enable */ -#define UOTGHS_HSTPIP_PEN8 (0x1u << 8) /**< \brief (UOTGHS_HSTPIP) Pipe 8 Enable */ -#define UOTGHS_HSTPIP_PRST0 (0x1u << 16) /**< \brief (UOTGHS_HSTPIP) Pipe 0 Reset */ -#define UOTGHS_HSTPIP_PRST1 (0x1u << 17) /**< \brief (UOTGHS_HSTPIP) Pipe 1 Reset */ -#define UOTGHS_HSTPIP_PRST2 (0x1u << 18) /**< \brief (UOTGHS_HSTPIP) Pipe 2 Reset */ -#define UOTGHS_HSTPIP_PRST3 (0x1u << 19) /**< \brief (UOTGHS_HSTPIP) Pipe 3 Reset */ -#define UOTGHS_HSTPIP_PRST4 (0x1u << 20) /**< \brief (UOTGHS_HSTPIP) Pipe 4 Reset */ -#define UOTGHS_HSTPIP_PRST5 (0x1u << 21) /**< \brief (UOTGHS_HSTPIP) Pipe 5 Reset */ -#define UOTGHS_HSTPIP_PRST6 (0x1u << 22) /**< \brief (UOTGHS_HSTPIP) Pipe 6 Reset */ -#define UOTGHS_HSTPIP_PRST7 (0x1u << 23) /**< \brief (UOTGHS_HSTPIP) Pipe 7 Reset */ -#define UOTGHS_HSTPIP_PRST8 (0x1u << 24) /**< \brief (UOTGHS_HSTPIP) Pipe 8 Reset */ -/* -------- UOTGHS_HSTFNUM : (UOTGHS Offset: 0x0420) Host Frame Number Register -------- */ -#define UOTGHS_HSTFNUM_MFNUM_Pos 0 -#define UOTGHS_HSTFNUM_MFNUM_Msk (0x7u << UOTGHS_HSTFNUM_MFNUM_Pos) /**< \brief (UOTGHS_HSTFNUM) Micro Frame Number */ -#define UOTGHS_HSTFNUM_MFNUM(value) ((UOTGHS_HSTFNUM_MFNUM_Msk & ((value) << UOTGHS_HSTFNUM_MFNUM_Pos))) -#define UOTGHS_HSTFNUM_FNUM_Pos 3 -#define UOTGHS_HSTFNUM_FNUM_Msk (0x7ffu << UOTGHS_HSTFNUM_FNUM_Pos) /**< \brief (UOTGHS_HSTFNUM) Frame Number */ -#define UOTGHS_HSTFNUM_FNUM(value) ((UOTGHS_HSTFNUM_FNUM_Msk & ((value) << UOTGHS_HSTFNUM_FNUM_Pos))) -#define UOTGHS_HSTFNUM_FLENHIGH_Pos 16 -#define UOTGHS_HSTFNUM_FLENHIGH_Msk (0xffu << UOTGHS_HSTFNUM_FLENHIGH_Pos) /**< \brief (UOTGHS_HSTFNUM) Frame Length */ -#define UOTGHS_HSTFNUM_FLENHIGH(value) ((UOTGHS_HSTFNUM_FLENHIGH_Msk & ((value) << UOTGHS_HSTFNUM_FLENHIGH_Pos))) -/* -------- UOTGHS_HSTADDR1 : (UOTGHS Offset: 0x0424) Host Address 1 Register -------- */ -#define UOTGHS_HSTADDR1_HSTADDRP0_Pos 0 -#define UOTGHS_HSTADDR1_HSTADDRP0_Msk (0x7fu << UOTGHS_HSTADDR1_HSTADDRP0_Pos) /**< \brief (UOTGHS_HSTADDR1) USB Host Address */ -#define UOTGHS_HSTADDR1_HSTADDRP0(value) ((UOTGHS_HSTADDR1_HSTADDRP0_Msk & ((value) << UOTGHS_HSTADDR1_HSTADDRP0_Pos))) -#define UOTGHS_HSTADDR1_HSTADDRP1_Pos 8 -#define UOTGHS_HSTADDR1_HSTADDRP1_Msk (0x7fu << UOTGHS_HSTADDR1_HSTADDRP1_Pos) /**< \brief (UOTGHS_HSTADDR1) USB Host Address */ -#define UOTGHS_HSTADDR1_HSTADDRP1(value) ((UOTGHS_HSTADDR1_HSTADDRP1_Msk & ((value) << UOTGHS_HSTADDR1_HSTADDRP1_Pos))) -#define UOTGHS_HSTADDR1_HSTADDRP2_Pos 16 -#define UOTGHS_HSTADDR1_HSTADDRP2_Msk (0x7fu << UOTGHS_HSTADDR1_HSTADDRP2_Pos) /**< \brief (UOTGHS_HSTADDR1) USB Host Address */ -#define UOTGHS_HSTADDR1_HSTADDRP2(value) ((UOTGHS_HSTADDR1_HSTADDRP2_Msk & ((value) << UOTGHS_HSTADDR1_HSTADDRP2_Pos))) -#define UOTGHS_HSTADDR1_HSTADDRP3_Pos 24 -#define UOTGHS_HSTADDR1_HSTADDRP3_Msk (0x7fu << UOTGHS_HSTADDR1_HSTADDRP3_Pos) /**< \brief (UOTGHS_HSTADDR1) USB Host Address */ -#define UOTGHS_HSTADDR1_HSTADDRP3(value) ((UOTGHS_HSTADDR1_HSTADDRP3_Msk & ((value) << UOTGHS_HSTADDR1_HSTADDRP3_Pos))) -/* -------- UOTGHS_HSTADDR2 : (UOTGHS Offset: 0x0428) Host Address 2 Register -------- */ -#define UOTGHS_HSTADDR2_HSTADDRP4_Pos 0 -#define UOTGHS_HSTADDR2_HSTADDRP4_Msk (0x7fu << UOTGHS_HSTADDR2_HSTADDRP4_Pos) /**< \brief (UOTGHS_HSTADDR2) USB Host Address */ -#define UOTGHS_HSTADDR2_HSTADDRP4(value) ((UOTGHS_HSTADDR2_HSTADDRP4_Msk & ((value) << UOTGHS_HSTADDR2_HSTADDRP4_Pos))) -#define UOTGHS_HSTADDR2_HSTADDRP5_Pos 8 -#define UOTGHS_HSTADDR2_HSTADDRP5_Msk (0x7fu << UOTGHS_HSTADDR2_HSTADDRP5_Pos) /**< \brief (UOTGHS_HSTADDR2) USB Host Address */ -#define UOTGHS_HSTADDR2_HSTADDRP5(value) ((UOTGHS_HSTADDR2_HSTADDRP5_Msk & ((value) << UOTGHS_HSTADDR2_HSTADDRP5_Pos))) -#define UOTGHS_HSTADDR2_HSTADDRP6_Pos 16 -#define UOTGHS_HSTADDR2_HSTADDRP6_Msk (0x7fu << UOTGHS_HSTADDR2_HSTADDRP6_Pos) /**< \brief (UOTGHS_HSTADDR2) USB Host Address */ -#define UOTGHS_HSTADDR2_HSTADDRP6(value) ((UOTGHS_HSTADDR2_HSTADDRP6_Msk & ((value) << UOTGHS_HSTADDR2_HSTADDRP6_Pos))) -#define UOTGHS_HSTADDR2_HSTADDRP7_Pos 24 -#define UOTGHS_HSTADDR2_HSTADDRP7_Msk (0x7fu << UOTGHS_HSTADDR2_HSTADDRP7_Pos) /**< \brief (UOTGHS_HSTADDR2) USB Host Address */ -#define UOTGHS_HSTADDR2_HSTADDRP7(value) ((UOTGHS_HSTADDR2_HSTADDRP7_Msk & ((value) << UOTGHS_HSTADDR2_HSTADDRP7_Pos))) -/* -------- UOTGHS_HSTADDR3 : (UOTGHS Offset: 0x042C) Host Address 3 Register -------- */ -#define UOTGHS_HSTADDR3_HSTADDRP8_Pos 0 -#define UOTGHS_HSTADDR3_HSTADDRP8_Msk (0x7fu << UOTGHS_HSTADDR3_HSTADDRP8_Pos) /**< \brief (UOTGHS_HSTADDR3) USB Host Address */ -#define UOTGHS_HSTADDR3_HSTADDRP8(value) ((UOTGHS_HSTADDR3_HSTADDRP8_Msk & ((value) << UOTGHS_HSTADDR3_HSTADDRP8_Pos))) -#define UOTGHS_HSTADDR3_HSTADDRP9_Pos 8 -#define UOTGHS_HSTADDR3_HSTADDRP9_Msk (0x7fu << UOTGHS_HSTADDR3_HSTADDRP9_Pos) /**< \brief (UOTGHS_HSTADDR3) USB Host Address */ -#define UOTGHS_HSTADDR3_HSTADDRP9(value) ((UOTGHS_HSTADDR3_HSTADDRP9_Msk & ((value) << UOTGHS_HSTADDR3_HSTADDRP9_Pos))) -/* -------- UOTGHS_HSTPIPCFG[12] : (UOTGHS Offset: 0x500) Host Pipe Configuration Register (n = 0) -------- */ -#define UOTGHS_HSTPIPCFG_ALLOC (0x1u << 1) /**< \brief (UOTGHS_HSTPIPCFG[12]) Pipe Memory Allocate */ -#define UOTGHS_HSTPIPCFG_PBK_Pos 2 -#define UOTGHS_HSTPIPCFG_PBK_Msk (0x3u << UOTGHS_HSTPIPCFG_PBK_Pos) /**< \brief (UOTGHS_HSTPIPCFG[12]) Pipe Banks */ -#define UOTGHS_HSTPIPCFG_PBK_1_BANK (0x0u << 2) /**< \brief (UOTGHS_HSTPIPCFG[12]) Single-bank pipe */ -#define UOTGHS_HSTPIPCFG_PBK_2_BANK (0x1u << 2) /**< \brief (UOTGHS_HSTPIPCFG[12]) Double-bank pipe */ -#define UOTGHS_HSTPIPCFG_PBK_3_BANK (0x2u << 2) /**< \brief (UOTGHS_HSTPIPCFG[12]) Triple-bank pipe */ -#define UOTGHS_HSTPIPCFG_PSIZE_Pos 4 -#define UOTGHS_HSTPIPCFG_PSIZE_Msk (0x7u << UOTGHS_HSTPIPCFG_PSIZE_Pos) /**< \brief (UOTGHS_HSTPIPCFG[12]) Pipe Size */ -#define UOTGHS_HSTPIPCFG_PSIZE_8_BYTE (0x0u << 4) /**< \brief (UOTGHS_HSTPIPCFG[12]) 8 bytes */ -#define UOTGHS_HSTPIPCFG_PSIZE_16_BYTE (0x1u << 4) /**< \brief (UOTGHS_HSTPIPCFG[12]) 16 bytes */ -#define UOTGHS_HSTPIPCFG_PSIZE_32_BYTE (0x2u << 4) /**< \brief (UOTGHS_HSTPIPCFG[12]) 32 bytes */ -#define UOTGHS_HSTPIPCFG_PSIZE_64_BYTE (0x3u << 4) /**< \brief (UOTGHS_HSTPIPCFG[12]) 64 bytes */ -#define UOTGHS_HSTPIPCFG_PSIZE_128_BYTE (0x4u << 4) /**< \brief (UOTGHS_HSTPIPCFG[12]) 128 bytes */ -#define UOTGHS_HSTPIPCFG_PSIZE_256_BYTE (0x5u << 4) /**< \brief (UOTGHS_HSTPIPCFG[12]) 256 bytes */ -#define UOTGHS_HSTPIPCFG_PSIZE_512_BYTE (0x6u << 4) /**< \brief (UOTGHS_HSTPIPCFG[12]) 512 bytes */ -#define UOTGHS_HSTPIPCFG_PSIZE_1024_BYTE (0x7u << 4) /**< \brief (UOTGHS_HSTPIPCFG[12]) 1024 bytes */ -#define UOTGHS_HSTPIPCFG_PTOKEN_Pos 8 -#define UOTGHS_HSTPIPCFG_PTOKEN_Msk (0x3u << UOTGHS_HSTPIPCFG_PTOKEN_Pos) /**< \brief (UOTGHS_HSTPIPCFG[12]) Pipe Token */ -#define UOTGHS_HSTPIPCFG_PTOKEN_SETUP (0x0u << 8) /**< \brief (UOTGHS_HSTPIPCFG[12]) SETUP */ -#define UOTGHS_HSTPIPCFG_PTOKEN_IN (0x1u << 8) /**< \brief (UOTGHS_HSTPIPCFG[12]) IN */ -#define UOTGHS_HSTPIPCFG_PTOKEN_OUT (0x2u << 8) /**< \brief (UOTGHS_HSTPIPCFG[12]) OUT */ -#define UOTGHS_HSTPIPCFG_AUTOSW (0x1u << 10) /**< \brief (UOTGHS_HSTPIPCFG[12]) Automatic Switch */ -#define UOTGHS_HSTPIPCFG_PTYPE_Pos 12 -#define UOTGHS_HSTPIPCFG_PTYPE_Msk (0x3u << UOTGHS_HSTPIPCFG_PTYPE_Pos) /**< \brief (UOTGHS_HSTPIPCFG[12]) Pipe Type */ -#define UOTGHS_HSTPIPCFG_PTYPE_CTRL (0x0u << 12) /**< \brief (UOTGHS_HSTPIPCFG[12]) Control */ -#define UOTGHS_HSTPIPCFG_PTYPE_ISO (0x1u << 12) /**< \brief (UOTGHS_HSTPIPCFG[12]) Isochronous */ -#define UOTGHS_HSTPIPCFG_PTYPE_BLK (0x2u << 12) /**< \brief (UOTGHS_HSTPIPCFG[12]) Bulk */ -#define UOTGHS_HSTPIPCFG_PTYPE_INTRPT (0x3u << 12) /**< \brief (UOTGHS_HSTPIPCFG[12]) Interrupt */ -#define UOTGHS_HSTPIPCFG_PEPNUM_Pos 16 -#define UOTGHS_HSTPIPCFG_PEPNUM_Msk (0xfu << UOTGHS_HSTPIPCFG_PEPNUM_Pos) /**< \brief (UOTGHS_HSTPIPCFG[12]) Pipe Endpoint Number */ -#define UOTGHS_HSTPIPCFG_PEPNUM(value) ((UOTGHS_HSTPIPCFG_PEPNUM_Msk & ((value) << UOTGHS_HSTPIPCFG_PEPNUM_Pos))) -#define UOTGHS_HSTPIPCFG_INTFRQ_Pos 24 -#define UOTGHS_HSTPIPCFG_INTFRQ_Msk (0xffu << UOTGHS_HSTPIPCFG_INTFRQ_Pos) /**< \brief (UOTGHS_HSTPIPCFG[12]) Pipe Interrupt Request Frequency */ -#define UOTGHS_HSTPIPCFG_INTFRQ(value) ((UOTGHS_HSTPIPCFG_INTFRQ_Msk & ((value) << UOTGHS_HSTPIPCFG_INTFRQ_Pos))) -#define UOTGHS_HSTPIPCFG_PINGEN (0x1u << 20) /**< \brief (UOTGHS_HSTPIPCFG[12]) Ping Enable */ -#define UOTGHS_HSTPIPCFG_BINTERVAL_Pos 24 -#define UOTGHS_HSTPIPCFG_BINTERVAL_Msk (0xffu << UOTGHS_HSTPIPCFG_BINTERVAL_Pos) /**< \brief (UOTGHS_HSTPIPCFG[12]) Binterval Parameter for the Bulk-Out/Ping Transaction */ -#define UOTGHS_HSTPIPCFG_BINTERVAL(value) ((UOTGHS_HSTPIPCFG_BINTERVAL_Msk & ((value) << UOTGHS_HSTPIPCFG_BINTERVAL_Pos))) -/* -------- UOTGHS_HSTPIPISR[12] : (UOTGHS Offset: 0x530) Host Pipe Status Register (n = 0) -------- */ -#define UOTGHS_HSTPIPISR_RXINI (0x1u << 0) /**< \brief (UOTGHS_HSTPIPISR[12]) Received IN Data Interrupt */ -#define UOTGHS_HSTPIPISR_TXOUTI (0x1u << 1) /**< \brief (UOTGHS_HSTPIPISR[12]) Transmitted OUT Data Interrupt */ -#define UOTGHS_HSTPIPISR_TXSTPI (0x1u << 2) /**< \brief (UOTGHS_HSTPIPISR[12]) Transmitted SETUP Interrupt */ -#define UOTGHS_HSTPIPISR_PERRI (0x1u << 3) /**< \brief (UOTGHS_HSTPIPISR[12]) Pipe Error Interrupt */ -#define UOTGHS_HSTPIPISR_NAKEDI (0x1u << 4) /**< \brief (UOTGHS_HSTPIPISR[12]) NAKed Interrupt */ -#define UOTGHS_HSTPIPISR_OVERFI (0x1u << 5) /**< \brief (UOTGHS_HSTPIPISR[12]) Overflow Interrupt */ -#define UOTGHS_HSTPIPISR_RXSTALLDI (0x1u << 6) /**< \brief (UOTGHS_HSTPIPISR[12]) Received STALLed Interrupt */ -#define UOTGHS_HSTPIPISR_SHORTPACKETI (0x1u << 7) /**< \brief (UOTGHS_HSTPIPISR[12]) Short Packet Interrupt */ -#define UOTGHS_HSTPIPISR_DTSEQ_Pos 8 -#define UOTGHS_HSTPIPISR_DTSEQ_Msk (0x3u << UOTGHS_HSTPIPISR_DTSEQ_Pos) /**< \brief (UOTGHS_HSTPIPISR[12]) Data Toggle Sequence */ -#define UOTGHS_HSTPIPISR_DTSEQ_DATA0 (0x0u << 8) /**< \brief (UOTGHS_HSTPIPISR[12]) Data0 toggle sequence */ -#define UOTGHS_HSTPIPISR_DTSEQ_DATA1 (0x1u << 8) /**< \brief (UOTGHS_HSTPIPISR[12]) Data1 toggle sequence */ -#define UOTGHS_HSTPIPISR_NBUSYBK_Pos 12 -#define UOTGHS_HSTPIPISR_NBUSYBK_Msk (0x3u << UOTGHS_HSTPIPISR_NBUSYBK_Pos) /**< \brief (UOTGHS_HSTPIPISR[12]) Number of Busy Banks */ -#define UOTGHS_HSTPIPISR_NBUSYBK_0_BUSY (0x0u << 12) /**< \brief (UOTGHS_HSTPIPISR[12]) 0 busy bank (all banks free) */ -#define UOTGHS_HSTPIPISR_NBUSYBK_1_BUSY (0x1u << 12) /**< \brief (UOTGHS_HSTPIPISR[12]) 1 busy bank */ -#define UOTGHS_HSTPIPISR_NBUSYBK_2_BUSY (0x2u << 12) /**< \brief (UOTGHS_HSTPIPISR[12]) 2 busy banks */ -#define UOTGHS_HSTPIPISR_NBUSYBK_3_BUSY (0x3u << 12) /**< \brief (UOTGHS_HSTPIPISR[12]) 3 busy banks */ -#define UOTGHS_HSTPIPISR_CURRBK_Pos 14 -#define UOTGHS_HSTPIPISR_CURRBK_Msk (0x3u << UOTGHS_HSTPIPISR_CURRBK_Pos) /**< \brief (UOTGHS_HSTPIPISR[12]) Current Bank */ -#define UOTGHS_HSTPIPISR_CURRBK_BANK0 (0x0u << 14) /**< \brief (UOTGHS_HSTPIPISR[12]) Current bank is bank0 */ -#define UOTGHS_HSTPIPISR_CURRBK_BANK1 (0x1u << 14) /**< \brief (UOTGHS_HSTPIPISR[12]) Current bank is bank1 */ -#define UOTGHS_HSTPIPISR_CURRBK_BANK2 (0x2u << 14) /**< \brief (UOTGHS_HSTPIPISR[12]) Current bank is bank2 */ -#define UOTGHS_HSTPIPISR_RWALL (0x1u << 16) /**< \brief (UOTGHS_HSTPIPISR[12]) Read-write Allowed */ -#define UOTGHS_HSTPIPISR_CFGOK (0x1u << 18) /**< \brief (UOTGHS_HSTPIPISR[12]) Configuration OK Status */ -#define UOTGHS_HSTPIPISR_PBYCT_Pos 20 -#define UOTGHS_HSTPIPISR_PBYCT_Msk (0x7ffu << UOTGHS_HSTPIPISR_PBYCT_Pos) /**< \brief (UOTGHS_HSTPIPISR[12]) Pipe Byte Count */ -#define UOTGHS_HSTPIPISR_UNDERFI (0x1u << 2) /**< \brief (UOTGHS_HSTPIPISR[12]) Underflow Interrupt */ -#define UOTGHS_HSTPIPISR_CRCERRI (0x1u << 6) /**< \brief (UOTGHS_HSTPIPISR[12]) CRC Error Interrupt */ -/* -------- UOTGHS_HSTPIPICR[12] : (UOTGHS Offset: 0x560) Host Pipe Clear Register (n = 0) -------- */ -#define UOTGHS_HSTPIPICR_RXINIC (0x1u << 0) /**< \brief (UOTGHS_HSTPIPICR[12]) Received IN Data Interrupt Clear */ -#define UOTGHS_HSTPIPICR_TXOUTIC (0x1u << 1) /**< \brief (UOTGHS_HSTPIPICR[12]) Transmitted OUT Data Interrupt Clear */ -#define UOTGHS_HSTPIPICR_TXSTPIC (0x1u << 2) /**< \brief (UOTGHS_HSTPIPICR[12]) Transmitted SETUP Interrupt Clear */ -#define UOTGHS_HSTPIPICR_NAKEDIC (0x1u << 4) /**< \brief (UOTGHS_HSTPIPICR[12]) NAKed Interrupt Clear */ -#define UOTGHS_HSTPIPICR_OVERFIC (0x1u << 5) /**< \brief (UOTGHS_HSTPIPICR[12]) Overflow Interrupt Clear */ -#define UOTGHS_HSTPIPICR_RXSTALLDIC (0x1u << 6) /**< \brief (UOTGHS_HSTPIPICR[12]) Received STALLed Interrupt Clear */ -#define UOTGHS_HSTPIPICR_SHORTPACKETIC (0x1u << 7) /**< \brief (UOTGHS_HSTPIPICR[12]) Short Packet Interrupt Clear */ -#define UOTGHS_HSTPIPICR_UNDERFIC (0x1u << 2) /**< \brief (UOTGHS_HSTPIPICR[12]) Underflow Interrupt Clear */ -#define UOTGHS_HSTPIPICR_CRCERRIC (0x1u << 6) /**< \brief (UOTGHS_HSTPIPICR[12]) CRC Error Interrupt Clear */ -/* -------- UOTGHS_HSTPIPIFR[12] : (UOTGHS Offset: 0x590) Host Pipe Set Register (n = 0) -------- */ -#define UOTGHS_HSTPIPIFR_RXINIS (0x1u << 0) /**< \brief (UOTGHS_HSTPIPIFR[12]) Received IN Data Interrupt Set */ -#define UOTGHS_HSTPIPIFR_TXOUTIS (0x1u << 1) /**< \brief (UOTGHS_HSTPIPIFR[12]) Transmitted OUT Data Interrupt Set */ -#define UOTGHS_HSTPIPIFR_TXSTPIS (0x1u << 2) /**< \brief (UOTGHS_HSTPIPIFR[12]) Transmitted SETUP Interrupt Set */ -#define UOTGHS_HSTPIPIFR_PERRIS (0x1u << 3) /**< \brief (UOTGHS_HSTPIPIFR[12]) Pipe Error Interrupt Set */ -#define UOTGHS_HSTPIPIFR_NAKEDIS (0x1u << 4) /**< \brief (UOTGHS_HSTPIPIFR[12]) NAKed Interrupt Set */ -#define UOTGHS_HSTPIPIFR_OVERFIS (0x1u << 5) /**< \brief (UOTGHS_HSTPIPIFR[12]) Overflow Interrupt Set */ -#define UOTGHS_HSTPIPIFR_RXSTALLDIS (0x1u << 6) /**< \brief (UOTGHS_HSTPIPIFR[12]) Received STALLed Interrupt Set */ -#define UOTGHS_HSTPIPIFR_SHORTPACKETIS (0x1u << 7) /**< \brief (UOTGHS_HSTPIPIFR[12]) Short Packet Interrupt Set */ -#define UOTGHS_HSTPIPIFR_NBUSYBKS (0x1u << 12) /**< \brief (UOTGHS_HSTPIPIFR[12]) Number of Busy Banks Set */ -#define UOTGHS_HSTPIPIFR_UNDERFIS (0x1u << 2) /**< \brief (UOTGHS_HSTPIPIFR[12]) Underflow Interrupt Set */ -#define UOTGHS_HSTPIPIFR_CRCERRIS (0x1u << 6) /**< \brief (UOTGHS_HSTPIPIFR[12]) CRC Error Interrupt Set */ -/* -------- UOTGHS_HSTPIPIMR[12] : (UOTGHS Offset: 0x5C0) Host Pipe Mask Register (n = 0) -------- */ -#define UOTGHS_HSTPIPIMR_RXINE (0x1u << 0) /**< \brief (UOTGHS_HSTPIPIMR[12]) Received IN Data Interrupt Enable */ -#define UOTGHS_HSTPIPIMR_TXOUTE (0x1u << 1) /**< \brief (UOTGHS_HSTPIPIMR[12]) Transmitted OUT Data Interrupt Enable */ -#define UOTGHS_HSTPIPIMR_TXSTPE (0x1u << 2) /**< \brief (UOTGHS_HSTPIPIMR[12]) Transmitted SETUP Interrupt Enable */ -#define UOTGHS_HSTPIPIMR_PERRE (0x1u << 3) /**< \brief (UOTGHS_HSTPIPIMR[12]) Pipe Error Interrupt Enable */ -#define UOTGHS_HSTPIPIMR_NAKEDE (0x1u << 4) /**< \brief (UOTGHS_HSTPIPIMR[12]) NAKed Interrupt Enable */ -#define UOTGHS_HSTPIPIMR_OVERFIE (0x1u << 5) /**< \brief (UOTGHS_HSTPIPIMR[12]) Overflow Interrupt Enable */ -#define UOTGHS_HSTPIPIMR_RXSTALLDE (0x1u << 6) /**< \brief (UOTGHS_HSTPIPIMR[12]) Received STALLed Interrupt Enable */ -#define UOTGHS_HSTPIPIMR_SHORTPACKETIE (0x1u << 7) /**< \brief (UOTGHS_HSTPIPIMR[12]) Short Packet Interrupt Enable */ -#define UOTGHS_HSTPIPIMR_NBUSYBKE (0x1u << 12) /**< \brief (UOTGHS_HSTPIPIMR[12]) Number of Busy Banks Interrupt Enable */ -#define UOTGHS_HSTPIPIMR_FIFOCON (0x1u << 14) /**< \brief (UOTGHS_HSTPIPIMR[12]) FIFO Control */ -#define UOTGHS_HSTPIPIMR_PDISHDMA (0x1u << 16) /**< \brief (UOTGHS_HSTPIPIMR[12]) Pipe Interrupts Disable HDMA Request Enable */ -#define UOTGHS_HSTPIPIMR_PFREEZE (0x1u << 17) /**< \brief (UOTGHS_HSTPIPIMR[12]) Pipe Freeze */ -#define UOTGHS_HSTPIPIMR_RSTDT (0x1u << 18) /**< \brief (UOTGHS_HSTPIPIMR[12]) Reset Data Toggle */ -#define UOTGHS_HSTPIPIMR_UNDERFIE (0x1u << 2) /**< \brief (UOTGHS_HSTPIPIMR[12]) Underflow Interrupt Enable */ -#define UOTGHS_HSTPIPIMR_CRCERRE (0x1u << 6) /**< \brief (UOTGHS_HSTPIPIMR[12]) CRC Error Interrupt Enable */ -/* -------- UOTGHS_HSTPIPIER[12] : (UOTGHS Offset: 0x5F0) Host Pipe Enable Register (n = 0) -------- */ -#define UOTGHS_HSTPIPIER_RXINES (0x1u << 0) /**< \brief (UOTGHS_HSTPIPIER[12]) Received IN Data Interrupt Enable */ -#define UOTGHS_HSTPIPIER_TXOUTES (0x1u << 1) /**< \brief (UOTGHS_HSTPIPIER[12]) Transmitted OUT Data Interrupt Enable */ -#define UOTGHS_HSTPIPIER_TXSTPES (0x1u << 2) /**< \brief (UOTGHS_HSTPIPIER[12]) Transmitted SETUP Interrupt Enable */ -#define UOTGHS_HSTPIPIER_PERRES (0x1u << 3) /**< \brief (UOTGHS_HSTPIPIER[12]) Pipe Error Interrupt Enable */ -#define UOTGHS_HSTPIPIER_NAKEDES (0x1u << 4) /**< \brief (UOTGHS_HSTPIPIER[12]) NAKed Interrupt Enable */ -#define UOTGHS_HSTPIPIER_OVERFIES (0x1u << 5) /**< \brief (UOTGHS_HSTPIPIER[12]) Overflow Interrupt Enable */ -#define UOTGHS_HSTPIPIER_RXSTALLDES (0x1u << 6) /**< \brief (UOTGHS_HSTPIPIER[12]) Received STALLed Interrupt Enable */ -#define UOTGHS_HSTPIPIER_SHORTPACKETIES (0x1u << 7) /**< \brief (UOTGHS_HSTPIPIER[12]) Short Packet Interrupt Enable */ -#define UOTGHS_HSTPIPIER_NBUSYBKES (0x1u << 12) /**< \brief (UOTGHS_HSTPIPIER[12]) Number of Busy Banks Enable */ -#define UOTGHS_HSTPIPIER_PDISHDMAS (0x1u << 16) /**< \brief (UOTGHS_HSTPIPIER[12]) Pipe Interrupts Disable HDMA Request Enable */ -#define UOTGHS_HSTPIPIER_PFREEZES (0x1u << 17) /**< \brief (UOTGHS_HSTPIPIER[12]) Pipe Freeze Enable */ -#define UOTGHS_HSTPIPIER_RSTDTS (0x1u << 18) /**< \brief (UOTGHS_HSTPIPIER[12]) Reset Data Toggle Enable */ -#define UOTGHS_HSTPIPIER_UNDERFIES (0x1u << 2) /**< \brief (UOTGHS_HSTPIPIER[12]) Underflow Interrupt Enable */ -#define UOTGHS_HSTPIPIER_CRCERRES (0x1u << 6) /**< \brief (UOTGHS_HSTPIPIER[12]) CRC Error Interrupt Enable */ -/* -------- UOTGHS_HSTPIPIDR[12] : (UOTGHS Offset: 0x620) Host Pipe Disable Register (n = 0) -------- */ -#define UOTGHS_HSTPIPIDR_RXINEC (0x1u << 0) /**< \brief (UOTGHS_HSTPIPIDR[12]) Received IN Data Interrupt Disable */ -#define UOTGHS_HSTPIPIDR_TXOUTEC (0x1u << 1) /**< \brief (UOTGHS_HSTPIPIDR[12]) Transmitted OUT Data Interrupt Disable */ -#define UOTGHS_HSTPIPIDR_TXSTPEC (0x1u << 2) /**< \brief (UOTGHS_HSTPIPIDR[12]) Transmitted SETUP Interrupt Disable */ -#define UOTGHS_HSTPIPIDR_PERREC (0x1u << 3) /**< \brief (UOTGHS_HSTPIPIDR[12]) Pipe Error Interrupt Disable */ -#define UOTGHS_HSTPIPIDR_NAKEDEC (0x1u << 4) /**< \brief (UOTGHS_HSTPIPIDR[12]) NAKed Interrupt Disable */ -#define UOTGHS_HSTPIPIDR_OVERFIEC (0x1u << 5) /**< \brief (UOTGHS_HSTPIPIDR[12]) Overflow Interrupt Disable */ -#define UOTGHS_HSTPIPIDR_RXSTALLDEC (0x1u << 6) /**< \brief (UOTGHS_HSTPIPIDR[12]) Received STALLed Interrupt Disable */ -#define UOTGHS_HSTPIPIDR_SHORTPACKETIEC (0x1u << 7) /**< \brief (UOTGHS_HSTPIPIDR[12]) Short Packet Interrupt Disable */ -#define UOTGHS_HSTPIPIDR_NBUSYBKEC (0x1u << 12) /**< \brief (UOTGHS_HSTPIPIDR[12]) Number of Busy Banks Disable */ -#define UOTGHS_HSTPIPIDR_FIFOCONC (0x1u << 14) /**< \brief (UOTGHS_HSTPIPIDR[12]) FIFO Control Disable */ -#define UOTGHS_HSTPIPIDR_PDISHDMAC (0x1u << 16) /**< \brief (UOTGHS_HSTPIPIDR[12]) Pipe Interrupts Disable HDMA Request Disable */ -#define UOTGHS_HSTPIPIDR_PFREEZEC (0x1u << 17) /**< \brief (UOTGHS_HSTPIPIDR[12]) Pipe Freeze Disable */ -#define UOTGHS_HSTPIPIDR_UNDERFIEC (0x1u << 2) /**< \brief (UOTGHS_HSTPIPIDR[12]) Underflow Interrupt Disable */ -#define UOTGHS_HSTPIPIDR_CRCERREC (0x1u << 6) /**< \brief (UOTGHS_HSTPIPIDR[12]) CRC Error Interrupt Disable */ -/* -------- UOTGHS_HSTPIPINRQ[12] : (UOTGHS Offset: 0x650) Host Pipe IN Request Register (n = 0) -------- */ -#define UOTGHS_HSTPIPINRQ_INRQ_Pos 0 -#define UOTGHS_HSTPIPINRQ_INRQ_Msk (0xffu << UOTGHS_HSTPIPINRQ_INRQ_Pos) /**< \brief (UOTGHS_HSTPIPINRQ[12]) IN Request Number before Freeze */ -#define UOTGHS_HSTPIPINRQ_INRQ(value) ((UOTGHS_HSTPIPINRQ_INRQ_Msk & ((value) << UOTGHS_HSTPIPINRQ_INRQ_Pos))) -#define UOTGHS_HSTPIPINRQ_INMODE (0x1u << 8) /**< \brief (UOTGHS_HSTPIPINRQ[12]) IN Request Mode */ -/* -------- UOTGHS_HSTPIPERR[12] : (UOTGHS Offset: 0x680) Host Pipe Error Register (n = 0) -------- */ -#define UOTGHS_HSTPIPERR_DATATGL (0x1u << 0) /**< \brief (UOTGHS_HSTPIPERR[12]) Data Toggle Error */ -#define UOTGHS_HSTPIPERR_DATAPID (0x1u << 1) /**< \brief (UOTGHS_HSTPIPERR[12]) Data PID Error */ -#define UOTGHS_HSTPIPERR_PID (0x1u << 2) /**< \brief (UOTGHS_HSTPIPERR[12]) PID Error */ -#define UOTGHS_HSTPIPERR_TIMEOUT (0x1u << 3) /**< \brief (UOTGHS_HSTPIPERR[12]) Time-Out Error */ -#define UOTGHS_HSTPIPERR_CRC16 (0x1u << 4) /**< \brief (UOTGHS_HSTPIPERR[12]) CRC16 Error */ -#define UOTGHS_HSTPIPERR_COUNTER_Pos 5 -#define UOTGHS_HSTPIPERR_COUNTER_Msk (0x3u << UOTGHS_HSTPIPERR_COUNTER_Pos) /**< \brief (UOTGHS_HSTPIPERR[12]) Error Counter */ -#define UOTGHS_HSTPIPERR_COUNTER(value) ((UOTGHS_HSTPIPERR_COUNTER_Msk & ((value) << UOTGHS_HSTPIPERR_COUNTER_Pos))) -/* -------- UOTGHS_HSTDMANXTDSC : (UOTGHS Offset: N/A) Host DMA Channel Next Descriptor Address Register -------- */ -#define UOTGHS_HSTDMANXTDSC_NXT_DSC_ADD_Pos 0 -#define UOTGHS_HSTDMANXTDSC_NXT_DSC_ADD_Msk (0xffffffffu << UOTGHS_HSTDMANXTDSC_NXT_DSC_ADD_Pos) /**< \brief (UOTGHS_HSTDMANXTDSC) Next Descriptor Address */ -#define UOTGHS_HSTDMANXTDSC_NXT_DSC_ADD(value) ((UOTGHS_HSTDMANXTDSC_NXT_DSC_ADD_Msk & ((value) << UOTGHS_HSTDMANXTDSC_NXT_DSC_ADD_Pos))) -/* -------- UOTGHS_HSTDMAADDRESS : (UOTGHS Offset: N/A) Host DMA Channel Address Register -------- */ -#define UOTGHS_HSTDMAADDRESS_BUFF_ADD_Pos 0 -#define UOTGHS_HSTDMAADDRESS_BUFF_ADD_Msk (0xffffffffu << UOTGHS_HSTDMAADDRESS_BUFF_ADD_Pos) /**< \brief (UOTGHS_HSTDMAADDRESS) Buffer Address */ -#define UOTGHS_HSTDMAADDRESS_BUFF_ADD(value) ((UOTGHS_HSTDMAADDRESS_BUFF_ADD_Msk & ((value) << UOTGHS_HSTDMAADDRESS_BUFF_ADD_Pos))) -/* -------- UOTGHS_HSTDMACONTROL : (UOTGHS Offset: N/A) Host DMA Channel Control Register -------- */ -#define UOTGHS_HSTDMACONTROL_CHANN_ENB (0x1u << 0) /**< \brief (UOTGHS_HSTDMACONTROL) Channel Enable Command */ -#define UOTGHS_HSTDMACONTROL_LDNXT_DSC (0x1u << 1) /**< \brief (UOTGHS_HSTDMACONTROL) Load Next Channel Transfer Descriptor Enable Command */ -#define UOTGHS_HSTDMACONTROL_END_TR_EN (0x1u << 2) /**< \brief (UOTGHS_HSTDMACONTROL) End of Transfer Enable (Control) */ -#define UOTGHS_HSTDMACONTROL_END_B_EN (0x1u << 3) /**< \brief (UOTGHS_HSTDMACONTROL) End of Buffer Enable Control */ -#define UOTGHS_HSTDMACONTROL_END_TR_IT (0x1u << 4) /**< \brief (UOTGHS_HSTDMACONTROL) End of Transfer Interrupt Enable */ -#define UOTGHS_HSTDMACONTROL_END_BUFFIT (0x1u << 5) /**< \brief (UOTGHS_HSTDMACONTROL) End of Buffer Interrupt Enable */ -#define UOTGHS_HSTDMACONTROL_DESC_LD_IT (0x1u << 6) /**< \brief (UOTGHS_HSTDMACONTROL) Descriptor Loaded Interrupt Enable */ -#define UOTGHS_HSTDMACONTROL_BURST_LCK (0x1u << 7) /**< \brief (UOTGHS_HSTDMACONTROL) Burst Lock Enable */ -#define UOTGHS_HSTDMACONTROL_BUFF_LENGTH_Pos 16 -#define UOTGHS_HSTDMACONTROL_BUFF_LENGTH_Msk (0xffffu << UOTGHS_HSTDMACONTROL_BUFF_LENGTH_Pos) /**< \brief (UOTGHS_HSTDMACONTROL) Buffer Byte Length (Write-only) */ -#define UOTGHS_HSTDMACONTROL_BUFF_LENGTH(value) ((UOTGHS_HSTDMACONTROL_BUFF_LENGTH_Msk & ((value) << UOTGHS_HSTDMACONTROL_BUFF_LENGTH_Pos))) -/* -------- UOTGHS_HSTDMASTATUS : (UOTGHS Offset: N/A) Host DMA Channel Status Register -------- */ -#define UOTGHS_HSTDMASTATUS_CHANN_ENB (0x1u << 0) /**< \brief (UOTGHS_HSTDMASTATUS) Channel Enable Status */ -#define UOTGHS_HSTDMASTATUS_CHANN_ACT (0x1u << 1) /**< \brief (UOTGHS_HSTDMASTATUS) Channel Active Status */ -#define UOTGHS_HSTDMASTATUS_END_TR_ST (0x1u << 4) /**< \brief (UOTGHS_HSTDMASTATUS) End of Channel Transfer Status */ -#define UOTGHS_HSTDMASTATUS_END_BF_ST (0x1u << 5) /**< \brief (UOTGHS_HSTDMASTATUS) End of Channel Buffer Status */ -#define UOTGHS_HSTDMASTATUS_DESC_LDST (0x1u << 6) /**< \brief (UOTGHS_HSTDMASTATUS) Descriptor Loaded Status */ -#define UOTGHS_HSTDMASTATUS_BUFF_COUNT_Pos 16 -#define UOTGHS_HSTDMASTATUS_BUFF_COUNT_Msk (0xffffu << UOTGHS_HSTDMASTATUS_BUFF_COUNT_Pos) /**< \brief (UOTGHS_HSTDMASTATUS) Buffer Byte Count */ -#define UOTGHS_HSTDMASTATUS_BUFF_COUNT(value) ((UOTGHS_HSTDMASTATUS_BUFF_COUNT_Msk & ((value) << UOTGHS_HSTDMASTATUS_BUFF_COUNT_Pos))) -/* -------- UOTGHS_CTRL : (UOTGHS Offset: 0x0800) General Control Register -------- */ -#define UOTGHS_CTRL_IDTE (0x1u << 0) /**< \brief (UOTGHS_CTRL) ID Transition Interrupt Enable */ -#define UOTGHS_CTRL_VBUSTE (0x1u << 1) /**< \brief (UOTGHS_CTRL) VBus Transition Interrupt Enable */ -#define UOTGHS_CTRL_SRPE (0x1u << 2) /**< \brief (UOTGHS_CTRL) SRP Interrupt Enable */ -#define UOTGHS_CTRL_VBERRE (0x1u << 3) /**< \brief (UOTGHS_CTRL) VBus Error Interrupt Enable */ -#define UOTGHS_CTRL_BCERRE (0x1u << 4) /**< \brief (UOTGHS_CTRL) B-Connection Error Interrupt Enable */ -#define UOTGHS_CTRL_ROLEEXE (0x1u << 5) /**< \brief (UOTGHS_CTRL) Role Exchange Interrupt Enable */ -#define UOTGHS_CTRL_HNPERRE (0x1u << 6) /**< \brief (UOTGHS_CTRL) HNP Error Interrupt Enable */ -#define UOTGHS_CTRL_STOE (0x1u << 7) /**< \brief (UOTGHS_CTRL) Suspend Time-Out Interrupt Enable */ -#define UOTGHS_CTRL_VBUSHWC (0x1u << 8) /**< \brief (UOTGHS_CTRL) VBus Hardware Control */ -#define UOTGHS_CTRL_SRPSEL (0x1u << 9) /**< \brief (UOTGHS_CTRL) SRP Selection */ -#define UOTGHS_CTRL_SRPREQ (0x1u << 10) /**< \brief (UOTGHS_CTRL) SRP Request */ -#define UOTGHS_CTRL_HNPREQ (0x1u << 11) /**< \brief (UOTGHS_CTRL) HNP Request */ -#define UOTGHS_CTRL_OTGPADE (0x1u << 12) /**< \brief (UOTGHS_CTRL) OTG Pad Enable */ -#define UOTGHS_CTRL_VBUSPO (0x1u << 13) /**< \brief (UOTGHS_CTRL) VBus Polarity Off */ -#define UOTGHS_CTRL_FRZCLK (0x1u << 14) /**< \brief (UOTGHS_CTRL) Freeze USB Clock */ -#define UOTGHS_CTRL_USBE (0x1u << 15) /**< \brief (UOTGHS_CTRL) UOTGHS Enable */ -#define UOTGHS_CTRL_TIMVALUE_Pos 16 -#define UOTGHS_CTRL_TIMVALUE_Msk (0x3u << UOTGHS_CTRL_TIMVALUE_Pos) /**< \brief (UOTGHS_CTRL) Timer Value */ -#define UOTGHS_CTRL_TIMVALUE(value) ((UOTGHS_CTRL_TIMVALUE_Msk & ((value) << UOTGHS_CTRL_TIMVALUE_Pos))) -#define UOTGHS_CTRL_TIMPAGE_Pos 20 -#define UOTGHS_CTRL_TIMPAGE_Msk (0x3u << UOTGHS_CTRL_TIMPAGE_Pos) /**< \brief (UOTGHS_CTRL) Timer Page */ -#define UOTGHS_CTRL_TIMPAGE(value) ((UOTGHS_CTRL_TIMPAGE_Msk & ((value) << UOTGHS_CTRL_TIMPAGE_Pos))) -#define UOTGHS_CTRL_UNLOCK (0x1u << 22) /**< \brief (UOTGHS_CTRL) Timer Access Unlock */ -#define UOTGHS_CTRL_UIDE (0x1u << 24) /**< \brief (UOTGHS_CTRL) UOTGID Pin Enable */ -#define UOTGHS_CTRL_UIDE_UIMOD (0x0u << 24) /**< \brief (UOTGHS_CTRL) The USB mode (device/host) is selected from the UIMOD bit. */ -#define UOTGHS_CTRL_UIDE_UOTGID (0x1u << 24) /**< \brief (UOTGHS_CTRL) The USB mode (device/host) is selected from the UOTGID input pin. */ -#define UOTGHS_CTRL_UIMOD (0x1u << 25) /**< \brief (UOTGHS_CTRL) UOTGHS Mode */ -#define UOTGHS_CTRL_UIMOD_HOST (0x0u << 25) /**< \brief (UOTGHS_CTRL) The module is in USB host mode. */ -#define UOTGHS_CTRL_UIMOD_DEVICE (0x1u << 25) /**< \brief (UOTGHS_CTRL) The module is in USB device mode. */ -/* -------- UOTGHS_SR : (UOTGHS Offset: 0x0804) General Status Register -------- */ -#define UOTGHS_SR_IDTI (0x1u << 0) /**< \brief (UOTGHS_SR) ID Transition Interrupt */ -#define UOTGHS_SR_VBUSTI (0x1u << 1) /**< \brief (UOTGHS_SR) VBus Transition Interrupt */ -#define UOTGHS_SR_SRPI (0x1u << 2) /**< \brief (UOTGHS_SR) SRP Interrupt */ -#define UOTGHS_SR_VBERRI (0x1u << 3) /**< \brief (UOTGHS_SR) VBus Error Interrupt */ -#define UOTGHS_SR_BCERRI (0x1u << 4) /**< \brief (UOTGHS_SR) B-Connection Error Interrupt */ -#define UOTGHS_SR_ROLEEXI (0x1u << 5) /**< \brief (UOTGHS_SR) Role Exchange Interrupt */ -#define UOTGHS_SR_HNPERRI (0x1u << 6) /**< \brief (UOTGHS_SR) HNP Error Interrupt */ -#define UOTGHS_SR_STOI (0x1u << 7) /**< \brief (UOTGHS_SR) Suspend Time-Out Interrupt */ -#define UOTGHS_SR_VBUSRQ (0x1u << 9) /**< \brief (UOTGHS_SR) VBus Request */ -#define UOTGHS_SR_ID (0x1u << 10) /**< \brief (UOTGHS_SR) UOTGID Pin State */ -#define UOTGHS_SR_VBUS (0x1u << 11) /**< \brief (UOTGHS_SR) VBus Level */ -#define UOTGHS_SR_SPEED_Pos 12 -#define UOTGHS_SR_SPEED_Msk (0x3u << UOTGHS_SR_SPEED_Pos) /**< \brief (UOTGHS_SR) Speed Status */ -#define UOTGHS_SR_SPEED_FULL_SPEED (0x0u << 12) /**< \brief (UOTGHS_SR) Full-Speed mode */ -#define UOTGHS_SR_SPEED_HIGH_SPEED (0x1u << 12) /**< \brief (UOTGHS_SR) High-Speed mode */ -#define UOTGHS_SR_SPEED_LOW_SPEED (0x2u << 12) /**< \brief (UOTGHS_SR) Low-Speed mode */ -#define UOTGHS_SR_CLKUSABLE (0x1u << 14) /**< \brief (UOTGHS_SR) UTMI Clock Usable */ -/* -------- UOTGHS_SCR : (UOTGHS Offset: 0x0808) General Status Clear Register -------- */ -#define UOTGHS_SCR_IDTIC (0x1u << 0) /**< \brief (UOTGHS_SCR) ID Transition Interrupt Clear */ -#define UOTGHS_SCR_VBUSTIC (0x1u << 1) /**< \brief (UOTGHS_SCR) VBus Transition Interrupt Clear */ -#define UOTGHS_SCR_SRPIC (0x1u << 2) /**< \brief (UOTGHS_SCR) SRP Interrupt Clear */ -#define UOTGHS_SCR_VBERRIC (0x1u << 3) /**< \brief (UOTGHS_SCR) VBus Error Interrupt Clear */ -#define UOTGHS_SCR_BCERRIC (0x1u << 4) /**< \brief (UOTGHS_SCR) B-Connection Error Interrupt Clear */ -#define UOTGHS_SCR_ROLEEXIC (0x1u << 5) /**< \brief (UOTGHS_SCR) Role Exchange Interrupt Clear */ -#define UOTGHS_SCR_HNPERRIC (0x1u << 6) /**< \brief (UOTGHS_SCR) HNP Error Interrupt Clear */ -#define UOTGHS_SCR_STOIC (0x1u << 7) /**< \brief (UOTGHS_SCR) Suspend Time-Out Interrupt Clear */ -#define UOTGHS_SCR_VBUSRQC (0x1u << 9) /**< \brief (UOTGHS_SCR) VBus Request Clear */ -/* -------- UOTGHS_SFR : (UOTGHS Offset: 0x080C) General Status Set Register -------- */ -#define UOTGHS_SFR_IDTIS (0x1u << 0) /**< \brief (UOTGHS_SFR) ID Transition Interrupt Set */ -#define UOTGHS_SFR_VBUSTIS (0x1u << 1) /**< \brief (UOTGHS_SFR) VBus Transition Interrupt Set */ -#define UOTGHS_SFR_SRPIS (0x1u << 2) /**< \brief (UOTGHS_SFR) SRP Interrupt Set */ -#define UOTGHS_SFR_VBERRIS (0x1u << 3) /**< \brief (UOTGHS_SFR) VBus Error Interrupt Set */ -#define UOTGHS_SFR_BCERRIS (0x1u << 4) /**< \brief (UOTGHS_SFR) B-Connection Error Interrupt Set */ -#define UOTGHS_SFR_ROLEEXIS (0x1u << 5) /**< \brief (UOTGHS_SFR) Role Exchange Interrupt Set */ -#define UOTGHS_SFR_HNPERRIS (0x1u << 6) /**< \brief (UOTGHS_SFR) HNP Error Interrupt Set */ -#define UOTGHS_SFR_STOIS (0x1u << 7) /**< \brief (UOTGHS_SFR) Suspend Time-Out Interrupt Set */ -#define UOTGHS_SFR_VBUSRQS (0x1u << 9) /**< \brief (UOTGHS_SFR) VBus Request Set */ -/* -------- UOTGHS_TSTA1 : (UOTGHS Offset: 0x0810) General Test A1 Register -------- */ -#define UOTGHS_TSTA1_CounterA_Pos 0 -#define UOTGHS_TSTA1_CounterA_Msk (0x7fffu << UOTGHS_TSTA1_CounterA_Pos) /**< \brief (UOTGHS_TSTA1) Load CounterA */ -#define UOTGHS_TSTA1_CounterA(value) ((UOTGHS_TSTA1_CounterA_Msk & ((value) << UOTGHS_TSTA1_CounterA_Pos))) -#define UOTGHS_TSTA1_LoadCntA (0x1u << 15) /**< \brief (UOTGHS_TSTA1) Load CounterA */ -#define UOTGHS_TSTA1_CounterB_Pos 16 -#define UOTGHS_TSTA1_CounterB_Msk (0x3fu << UOTGHS_TSTA1_CounterB_Pos) /**< \brief (UOTGHS_TSTA1) Load CounterB */ -#define UOTGHS_TSTA1_CounterB(value) ((UOTGHS_TSTA1_CounterB_Msk & ((value) << UOTGHS_TSTA1_CounterB_Pos))) -#define UOTGHS_TSTA1_LoadCntB (0x1u << 23) /**< \brief (UOTGHS_TSTA1) Load CounterB */ -#define UOTGHS_TSTA1_SOFCntMa1_Pos 24 -#define UOTGHS_TSTA1_SOFCntMa1_Msk (0x7fu << UOTGHS_TSTA1_SOFCntMa1_Pos) /**< \brief (UOTGHS_TSTA1) SOF Counter Max */ -#define UOTGHS_TSTA1_SOFCntMa1(value) ((UOTGHS_TSTA1_SOFCntMa1_Msk & ((value) << UOTGHS_TSTA1_SOFCntMa1_Pos))) -#define UOTGHS_TSTA1_LoadSOFCnt (0x1u << 31) /**< \brief (UOTGHS_TSTA1) Load SOF Counter */ -/* -------- UOTGHS_TSTA2 : (UOTGHS Offset: 0x0814) General Test A2 Register -------- */ -#define UOTGHS_TSTA2_FullDetachEn (0x1u << 0) /**< \brief (UOTGHS_TSTA2) Full Detach Enable */ -#define UOTGHS_TSTA2_HSSerialMode (0x1u << 1) /**< \brief (UOTGHS_TSTA2) HS Serial Mode */ -#define UOTGHS_TSTA2_LoopBackMode (0x1u << 2) /**< \brief (UOTGHS_TSTA2) Loop-back Mode */ -#define UOTGHS_TSTA2_DisableGatedClock (0x1u << 3) /**< \brief (UOTGHS_TSTA2) Disable Gated Clock */ -#define UOTGHS_TSTA2_ForceSuspendMTo1 (0x1u << 4) /**< \brief (UOTGHS_TSTA2) Force SuspendM to 1 */ -#define UOTGHS_TSTA2_ByPassDpll (0x1u << 5) /**< \brief (UOTGHS_TSTA2) Bypass DPLL */ -#define UOTGHS_TSTA2_HostHSDisconnectDisable (0x1u << 6) /**< \brief (UOTGHS_TSTA2) Host HS Disconnect Disable */ -#define UOTGHS_TSTA2_ForceHSRst_50ms (0x1u << 7) /**< \brief (UOTGHS_TSTA2) Force HS Reset to 50 ms */ -#define UOTGHS_TSTA2_UTMIReset (0x1u << 8) /**< \brief (UOTGHS_TSTA2) UTMI Reset */ -#define UOTGHS_TSTA2_RemovePUWhenTX (0x1u << 9) /**< \brief (UOTGHS_TSTA2) Remove Pull-up When TX */ -/* -------- UOTGHS_VERSION : (UOTGHS Offset: 0x0818) General Version Register -------- */ -#define UOTGHS_VERSION_VERSION_Pos 0 -#define UOTGHS_VERSION_VERSION_Msk (0xfffu << UOTGHS_VERSION_VERSION_Pos) /**< \brief (UOTGHS_VERSION) Version Number */ -#define UOTGHS_VERSION_VARIANT_Pos 16 -#define UOTGHS_VERSION_VARIANT_Msk (0xfu << UOTGHS_VERSION_VARIANT_Pos) /**< \brief (UOTGHS_VERSION) Variant Number */ -/* -------- UOTGHS_FEATURES : (UOTGHS Offset: 0x081C) General Features Register -------- */ -#define UOTGHS_FEATURES_EPTNBRMAX_Pos 0 -#define UOTGHS_FEATURES_EPTNBRMAX_Msk (0xfu << UOTGHS_FEATURES_EPTNBRMAX_Pos) /**< \brief (UOTGHS_FEATURES) Maximal Number of Pipes/Endpoints */ -#define UOTGHS_FEATURES_EPTNBRMAX_16_P_E (0x0u << 0) /**< \brief (UOTGHS_FEATURES) 16 pipes/endpoints */ -#define UOTGHS_FEATURES_EPTNBRMAX_1_P_E (0x1u << 0) /**< \brief (UOTGHS_FEATURES) 1 pipe/endpoint */ -#define UOTGHS_FEATURES_EPTNBRMAX_2_P_E (0x2u << 0) /**< \brief (UOTGHS_FEATURES) 2 pipes/endpoints */ -#define UOTGHS_FEATURES_EPTNBRMAX_15_P_E (0xFu << 0) /**< \brief (UOTGHS_FEATURES) 15 pipes/endpoints */ -#define UOTGHS_FEATURES_DMACHANNELNBR_Pos 4 -#define UOTGHS_FEATURES_DMACHANNELNBR_Msk (0x7u << UOTGHS_FEATURES_DMACHANNELNBR_Pos) /**< \brief (UOTGHS_FEATURES) Number of DMA Channels */ -#define UOTGHS_FEATURES_DMACHANNELNBR_1_DMA_CH (0x1u << 4) /**< \brief (UOTGHS_FEATURES) 1 DMA channel */ -#define UOTGHS_FEATURES_DMACHANNELNBR_2_DMA_CH (0x2u << 4) /**< \brief (UOTGHS_FEATURES) 2 DMA channels */ -#define UOTGHS_FEATURES_DMACHANNELNBR_7_DMA_CH (0x7u << 4) /**< \brief (UOTGHS_FEATURES) 7 DMA channels */ -#define UOTGHS_FEATURES_DMABUFFERSIZE (0x1u << 7) /**< \brief (UOTGHS_FEATURES) DMA Buffer Size */ -#define UOTGHS_FEATURES_DMAFIFOWORDDEPTH_Pos 8 -#define UOTGHS_FEATURES_DMAFIFOWORDDEPTH_Msk (0xfu << UOTGHS_FEATURES_DMAFIFOWORDDEPTH_Pos) /**< \brief (UOTGHS_FEATURES) DMA FIFO Depth in Words */ -#define UOTGHS_FEATURES_DMAFIFOWORDDEPTH_16_DMA_F_D (0x0u << 8) /**< \brief (UOTGHS_FEATURES) 16 DMA FIFO depth */ -#define UOTGHS_FEATURES_DMAFIFOWORDDEPTH_1_DMA_F_D (0x1u << 8) /**< \brief (UOTGHS_FEATURES) 1 DMA FIFO depth */ -#define UOTGHS_FEATURES_DMAFIFOWORDDEPTH_2_DMA_F_D (0x2u << 8) /**< \brief (UOTGHS_FEATURES) 2 DMA FIFO depth */ -#define UOTGHS_FEATURES_DMAFIFOWORDDEPTH_15_DMA_F_D (0xFu << 8) /**< \brief (UOTGHS_FEATURES) 15 DMA FIFO depth */ -#define UOTGHS_FEATURES_FIFOMAXSIZE_Pos 12 -#define UOTGHS_FEATURES_FIFOMAXSIZE_Msk (0x7u << UOTGHS_FEATURES_FIFOMAXSIZE_Pos) /**< \brief (UOTGHS_FEATURES) Maximal FIFO Size */ -#define UOTGHS_FEATURES_FIFOMAXSIZE_256_BYTE (0x0u << 12) /**< \brief (UOTGHS_FEATURES) < 256 bytes */ -#define UOTGHS_FEATURES_FIFOMAXSIZE_512_BYTE (0x1u << 12) /**< \brief (UOTGHS_FEATURES) < 512 bytes */ -#define UOTGHS_FEATURES_FIFOMAXSIZE_1024_BYTE (0x2u << 12) /**< \brief (UOTGHS_FEATURES) < 1024 bytes */ -#define UOTGHS_FEATURES_FIFOMAXSIZE_2048_BYTE (0x3u << 12) /**< \brief (UOTGHS_FEATURES) < 2048 bytes */ -#define UOTGHS_FEATURES_FIFOMAXSIZE_4096_BYTE (0x4u << 12) /**< \brief (UOTGHS_FEATURES) < 4096 bytes */ -#define UOTGHS_FEATURES_FIFOMAXSIZE_8192_BYTE (0x5u << 12) /**< \brief (UOTGHS_FEATURES) < 8192 bytes */ -#define UOTGHS_FEATURES_FIFOMAXSIZE_16384_BYTE (0x6u << 12) /**< \brief (UOTGHS_FEATURES) < 16384 bytes */ -#define UOTGHS_FEATURES_FIFOMAXSIZE_P16384_BYTE (0x7u << 12) /**< \brief (UOTGHS_FEATURES) >= 16384 bytes */ -#define UOTGHS_FEATURES_BYTEWRITEDPRAM (0x1u << 15) /**< \brief (UOTGHS_FEATURES) DPRAM Byte-Write Capability */ -#define UOTGHS_FEATURES_DATABUS (0x1u << 16) /**< \brief (UOTGHS_FEATURES) Data Bus 16-8 */ -#define UOTGHS_FEATURES_ENHBISO1 (0x1u << 17) /**< \brief (UOTGHS_FEATURES) High Bandwidth Isochronous Feature for Endpoint 1 */ -#define UOTGHS_FEATURES_ENHBISO2 (0x1u << 18) /**< \brief (UOTGHS_FEATURES) High Bandwidth Isochronous Feature for Endpoint 2 */ -#define UOTGHS_FEATURES_ENHBISO3 (0x1u << 19) /**< \brief (UOTGHS_FEATURES) High Bandwidth Isochronous Feature for Endpoint 3 */ -#define UOTGHS_FEATURES_ENHBISO4 (0x1u << 20) /**< \brief (UOTGHS_FEATURES) High Bandwidth Isochronous Feature for Endpoint 4 */ -#define UOTGHS_FEATURES_ENHBISO5 (0x1u << 21) /**< \brief (UOTGHS_FEATURES) High Bandwidth Isochronous Feature for Endpoint 5 */ -#define UOTGHS_FEATURES_ENHBISO6 (0x1u << 22) /**< \brief (UOTGHS_FEATURES) High Bandwidth Isochronous Feature for Endpoint 6 */ -#define UOTGHS_FEATURES_ENHBISO7 (0x1u << 23) /**< \brief (UOTGHS_FEATURES) High Bandwidth Isochronous Feature for Endpoint 7 */ -/* -------- UOTGHS_ADDRSIZE : (UOTGHS Offset: 0x0820) General APB Address Size Register -------- */ -#define UOTGHS_ADDRSIZE_UOTGHS_ADDRSIZE_Pos 0 -#define UOTGHS_ADDRSIZE_UOTGHS_ADDRSIZE_Msk (0xffffffffu << UOTGHS_ADDRSIZE_UOTGHS_ADDRSIZE_Pos) /**< \brief (UOTGHS_ADDRSIZE) IP APB Address Size */ -/* -------- UOTGHS_IPNAME1 : (UOTGHS Offset: 0x0824) General Name Register 1 -------- */ -#define UOTGHS_IPNAME1_UOTGHS_IPNAME1_Pos 0 -#define UOTGHS_IPNAME1_UOTGHS_IPNAME1_Msk (0xffffffffu << UOTGHS_IPNAME1_UOTGHS_IPNAME1_Pos) /**< \brief (UOTGHS_IPNAME1) IP Name Part One */ -/* -------- UOTGHS_IPNAME2 : (UOTGHS Offset: 0x0828) General Name Register 2 -------- */ -#define UOTGHS_IPNAME2_UOTGHS_IPNAME2_Pos 0 -#define UOTGHS_IPNAME2_UOTGHS_IPNAME2_Msk (0xffffffffu << UOTGHS_IPNAME2_UOTGHS_IPNAME2_Pos) /**< \brief (UOTGHS_IPNAME2) IP Name Part Two */ -/* -------- UOTGHS_FSM : (UOTGHS Offset: 0x082C) General Finite State Machine Register -------- */ -#define UOTGHS_FSM_DRDSTATE_Pos 0 -#define UOTGHS_FSM_DRDSTATE_Msk (0xfu << UOTGHS_FSM_DRDSTATE_Pos) /**< \brief (UOTGHS_FSM) Dual Role Device State */ -#define UOTGHS_FSM_DRDSTATE_A_IDLESTATE (0x0u << 0) /**< \brief (UOTGHS_FSM) This is the start state for A-devices (when the ID pin is 0) */ -#define UOTGHS_FSM_DRDSTATE_A_WAIT_VRISE (0x1u << 0) /**< \brief (UOTGHS_FSM) In this state, the A-device waits for the voltage on VBus to rise above the A-device VBus Valid threshold (4.4 V). */ -#define UOTGHS_FSM_DRDSTATE_A_WAIT_BCON (0x2u << 0) /**< \brief (UOTGHS_FSM) In this state, the A-device waits for the B-device to signal a connection. */ -#define UOTGHS_FSM_DRDSTATE_A_HOST (0x3u << 0) /**< \brief (UOTGHS_FSM) In this state, the A-device that operates in Host mode is operational. */ -#define UOTGHS_FSM_DRDSTATE_A_SUSPEND (0x4u << 0) /**< \brief (UOTGHS_FSM) The A-device operating as a host is in the suspend mode. */ -#define UOTGHS_FSM_DRDSTATE_A_PERIPHERAL (0x5u << 0) /**< \brief (UOTGHS_FSM) The A-device operates as a peripheral. */ -#define UOTGHS_FSM_DRDSTATE_A_WAIT_VFALL (0x6u << 0) /**< \brief (UOTGHS_FSM) In this state, the A-device waits for the voltage on VBus to drop below the A-device Session Valid threshold (1.4 V). */ -#define UOTGHS_FSM_DRDSTATE_A_VBUS_ERR (0x7u << 0) /**< \brief (UOTGHS_FSM) In this state, the A-device waits for recovery of the over-current condition that caused it to enter this state. */ -#define UOTGHS_FSM_DRDSTATE_A_WAIT_DISCHARGE (0x8u << 0) /**< \brief (UOTGHS_FSM) In this state, the A-device waits for the data USB line to discharge (100 us). */ -#define UOTGHS_FSM_DRDSTATE_B_IDLE (0x9u << 0) /**< \brief (UOTGHS_FSM) This is the start state for B-device (when the ID pin is 1). */ -#define UOTGHS_FSM_DRDSTATE_B_PERIPHERAL (0xAu << 0) /**< \brief (UOTGHS_FSM) In this state, the B-device acts as the peripheral. */ -#define UOTGHS_FSM_DRDSTATE_B_WAIT_BEGIN_HNP (0xBu << 0) /**< \brief (UOTGHS_FSM) In this state, the B-device is in suspend mode and waits until 3 ms before initiating the HNP protocol if requested. */ -#define UOTGHS_FSM_DRDSTATE_B_WAIT_DISCHARGE (0xCu << 0) /**< \brief (UOTGHS_FSM) In this state, the B-device waits for the data USB line to discharge (100 us) before becoming Host. */ -#define UOTGHS_FSM_DRDSTATE_B_WAIT_ACON (0xDu << 0) /**< \brief (UOTGHS_FSM) In this state, the B-device waits for the A-device to signal a connect before becoming B-Host. */ -#define UOTGHS_FSM_DRDSTATE_B_HOST (0xEu << 0) /**< \brief (UOTGHS_FSM) In this state, the B-device acts as the Host. */ -#define UOTGHS_FSM_DRDSTATE_B_SRP_INIT (0xFu << 0) /**< \brief (UOTGHS_FSM) In this state, the B-device attempts to start a session using the SRP protocol. */ - -/*@}*/ - - -#endif /* _SAM_UOTGHS_COMPONENT_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_usart.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_usart.h deleted file mode 100644 index 00a4564d..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_usart.h +++ /dev/null @@ -1,425 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_USART_COMPONENT_ -#define _SAMV71_USART_COMPONENT_ - -/* ============================================================================= */ -/** SOFTWARE API DEFINITION FOR Universal Synchronous Asynchronous Receiver Transmitter */ -/* ============================================================================= */ -/** \addtogroup SAMV71_USART Universal Synchronous Asynchronous Receiver Transmitter */ -/*@{*/ - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -/** \brief Usart hardware registers */ -typedef struct { - __O uint32_t US_CR; /**< \brief (Usart Offset: 0x0000) Control Register */ - __IO uint32_t US_MR; /**< \brief (Usart Offset: 0x0004) Mode Register */ - __O uint32_t US_IER; /**< \brief (Usart Offset: 0x0008) Interrupt Enable Register */ - __O uint32_t US_IDR; /**< \brief (Usart Offset: 0x000C) Interrupt Disable Register */ - __I uint32_t US_IMR; /**< \brief (Usart Offset: 0x0010) Interrupt Mask Register */ - __I uint32_t US_CSR; /**< \brief (Usart Offset: 0x0014) Channel Status Register */ - __I uint32_t US_RHR; /**< \brief (Usart Offset: 0x0018) Receive Holding Register */ - __O uint32_t US_THR; /**< \brief (Usart Offset: 0x001C) Transmit Holding Register */ - __IO uint32_t US_BRGR; /**< \brief (Usart Offset: 0x0020) Baud Rate Generator Register */ - __IO uint32_t US_RTOR; /**< \brief (Usart Offset: 0x0024) Receiver Time-out Register */ - __IO uint32_t US_TTGR; /**< \brief (Usart Offset: 0x0028) Transmitter Timeguard Register */ - __I uint32_t Reserved1[5]; - __IO uint32_t US_FIDI; /**< \brief (Usart Offset: 0x0040) FI DI Ratio Register */ - __I uint32_t US_NER; /**< \brief (Usart Offset: 0x0044) Number of Errors Register */ - __I uint32_t Reserved2[2]; - __IO uint32_t US_MAN; /**< \brief (Usart Offset: 0x0050) Manchester Configuration Register */ - __IO uint32_t US_LINMR; /**< \brief (Usart Offset: 0x0054) LIN Mode Register */ - __IO uint32_t US_LINIR; /**< \brief (Usart Offset: 0x0058) LIN Identifier Register */ - __I uint32_t US_LINBRR; /**< \brief (Usart Offset: 0x005C) LIN Baud Rate Register */ - __IO uint32_t US_LONMR; /**< \brief (Usart Offset: 0x0060) LON Mode Register */ - __IO uint32_t US_LONPR; /**< \brief (Usart Offset: 0x0064) LON Preamble Register */ - __IO uint32_t US_LONDL; /**< \brief (Usart Offset: 0x0068) LON Data Length Register */ - __IO uint32_t US_LONL2HDR; /**< \brief (Usart Offset: 0x006C) LON L2HDR Register */ - __I uint32_t US_LONBL; /**< \brief (Usart Offset: 0x0070) LON Backlog Register */ - __IO uint32_t US_LONB1TX; /**< \brief (Usart Offset: 0x0074) LON Beta1 Tx Register */ - __IO uint32_t US_LONB1RX; /**< \brief (Usart Offset: 0x0078) LON Beta1 Rx Register */ - __IO uint32_t US_LONPRIO; /**< \brief (Usart Offset: 0x007C) LON Priority Register */ - __IO uint32_t US_IDTTX; /**< \brief (Usart Offset: 0x0080) LON IDT Tx Register */ - __IO uint32_t US_IDTRX; /**< \brief (Usart Offset: 0x0084) LON IDT Rx Register */ - __IO uint32_t US_ICDIFF; /**< \brief (Usart Offset: 0x0088) IC DIFF Register */ - __I uint32_t Reserved3[22]; - __IO uint32_t US_WPMR; /**< \brief (Usart Offset: 0x00E4) Write Protection Mode Register */ - __I uint32_t US_WPSR; /**< \brief (Usart Offset: 0x00E8) Write Protection Status Register */ -} Usart; -#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/* -------- US_CR : (USART Offset: 0x0000) Control Register -------- */ -#define US_CR_RSTRX (0x1u << 2) /**< \brief (US_CR) Reset Receiver */ -#define US_CR_RSTTX (0x1u << 3) /**< \brief (US_CR) Reset Transmitter */ -#define US_CR_RXEN (0x1u << 4) /**< \brief (US_CR) Receiver Enable */ -#define US_CR_RXDIS (0x1u << 5) /**< \brief (US_CR) Receiver Disable */ -#define US_CR_TXEN (0x1u << 6) /**< \brief (US_CR) Transmitter Enable */ -#define US_CR_TXDIS (0x1u << 7) /**< \brief (US_CR) Transmitter Disable */ -#define US_CR_RSTSTA (0x1u << 8) /**< \brief (US_CR) Reset Status Bits */ -#define US_CR_STTBRK (0x1u << 9) /**< \brief (US_CR) Start Break */ -#define US_CR_STPBRK (0x1u << 10) /**< \brief (US_CR) Stop Break */ -#define US_CR_STTTO (0x1u << 11) /**< \brief (US_CR) Clear TIMEOUT Flag and Start Time-out After Next Character Received */ -#define US_CR_SENDA (0x1u << 12) /**< \brief (US_CR) Send Address */ -#define US_CR_RSTIT (0x1u << 13) /**< \brief (US_CR) Reset Iterations */ -#define US_CR_RSTNACK (0x1u << 14) /**< \brief (US_CR) Reset Non Acknowledge */ -#define US_CR_RETTO (0x1u << 15) /**< \brief (US_CR) Start Time-out Immediately */ -#define US_CR_RTSEN (0x1u << 18) /**< \brief (US_CR) Request to Send Pin Control */ -#define US_CR_RTSDIS (0x1u << 19) /**< \brief (US_CR) Request to Send Pin Control */ -#define US_CR_LINABT (0x1u << 20) /**< \brief (US_CR) Abort LIN Transmission */ -#define US_CR_LINWKUP (0x1u << 21) /**< \brief (US_CR) Send LIN Wakeup Signal */ -#define US_CR_FCS (0x1u << 18) /**< \brief (US_CR) Force SPI Chip Select */ -#define US_CR_RCS (0x1u << 19) /**< \brief (US_CR) Release SPI Chip Select */ -/* -------- US_MR : (USART Offset: 0x0004) Mode Register -------- */ -#define US_MR_USART_MODE_Pos 0 -#define US_MR_USART_MODE_Msk (0xfu << US_MR_USART_MODE_Pos) /**< \brief (US_MR) USART Mode of Operation */ -#define US_MR_USART_MODE(value) ((US_MR_USART_MODE_Msk & ((value) << US_MR_USART_MODE_Pos))) -#define US_MR_USART_MODE_NORMAL (0x0u << 0) /**< \brief (US_MR) Normal mode */ -#define US_MR_USART_MODE_RS485 (0x1u << 0) /**< \brief (US_MR) RS485 */ -#define US_MR_USART_MODE_HW_HANDSHAKING (0x2u << 0) /**< \brief (US_MR) Hardware Handshaking */ -#define US_MR_USART_MODE_IS07816_T_0 (0x4u << 0) /**< \brief (US_MR) IS07816 Protocol: T = 0 */ -#define US_MR_USART_MODE_IS07816_T_1 (0x6u << 0) /**< \brief (US_MR) IS07816 Protocol: T = 1 */ -#define US_MR_USART_MODE_LON (0x9u << 0) /**< \brief (US_MR) LON */ -#define US_MR_USART_MODE_SPI_MASTER (0xEu << 0) /**< \brief (US_MR) SPI master */ -#define US_MR_USART_MODE_SPI_SLAVE (0xFu << 0) /**< \brief (US_MR) SPI Slave */ -#define US_MR_USCLKS_Pos 4 -#define US_MR_USCLKS_Msk (0x3u << US_MR_USCLKS_Pos) /**< \brief (US_MR) Clock Selection */ -#define US_MR_USCLKS(value) ((US_MR_USCLKS_Msk & ((value) << US_MR_USCLKS_Pos))) -#define US_MR_USCLKS_MCK (0x0u << 4) /**< \brief (US_MR) Peripheral clock is selected */ -#define US_MR_USCLKS_DIV (0x1u << 4) /**< \brief (US_MR) Peripheral clock divided (DIV=DIV=8) is selected */ -#define US_MR_USCLKS_PCK (0x2u << 4) /**< \brief (US_MR) PMC programmable clock (PCK) is selected. If the SCK pin is driven (CLKO = 1), the CD field must be greater than 1. */ -#define US_MR_USCLKS_SCK (0x3u << 4) /**< \brief (US_MR) Serial clock (SCK) is selected */ -#define US_MR_CHRL_Pos 6 -#define US_MR_CHRL_Msk (0x3u << US_MR_CHRL_Pos) /**< \brief (US_MR) Character Length */ -#define US_MR_CHRL(value) ((US_MR_CHRL_Msk & ((value) << US_MR_CHRL_Pos))) -#define US_MR_CHRL_5_BIT (0x0u << 6) /**< \brief (US_MR) Character length is 5 bits */ -#define US_MR_CHRL_6_BIT (0x1u << 6) /**< \brief (US_MR) Character length is 6 bits */ -#define US_MR_CHRL_7_BIT (0x2u << 6) /**< \brief (US_MR) Character length is 7 bits */ -#define US_MR_CHRL_8_BIT (0x3u << 6) /**< \brief (US_MR) Character length is 8 bits */ -#define US_MR_SYNC (0x1u << 8) /**< \brief (US_MR) Synchronous Mode Select */ -#define US_MR_PAR_Pos 9 -#define US_MR_PAR_Msk (0x7u << US_MR_PAR_Pos) /**< \brief (US_MR) Parity Type */ -#define US_MR_PAR(value) ((US_MR_PAR_Msk & ((value) << US_MR_PAR_Pos))) -#define US_MR_PAR_EVEN (0x0u << 9) /**< \brief (US_MR) Even parity */ -#define US_MR_PAR_ODD (0x1u << 9) /**< \brief (US_MR) Odd parity */ -#define US_MR_PAR_SPACE (0x2u << 9) /**< \brief (US_MR) Parity forced to 0 (Space) */ -#define US_MR_PAR_MARK (0x3u << 9) /**< \brief (US_MR) Parity forced to 1 (Mark) */ -#define US_MR_PAR_NO (0x4u << 9) /**< \brief (US_MR) No parity */ -#define US_MR_PAR_MULTIDROP (0x6u << 9) /**< \brief (US_MR) Multidrop mode */ -#define US_MR_NBSTOP_Pos 12 -#define US_MR_NBSTOP_Msk (0x3u << US_MR_NBSTOP_Pos) /**< \brief (US_MR) Number of Stop Bits */ -#define US_MR_NBSTOP(value) ((US_MR_NBSTOP_Msk & ((value) << US_MR_NBSTOP_Pos))) -#define US_MR_NBSTOP_1_BIT (0x0u << 12) /**< \brief (US_MR) 1 stop bit */ -#define US_MR_NBSTOP_1_5_BIT (0x1u << 12) /**< \brief (US_MR) 1.5 stop bit (SYNC = 0) or reserved (SYNC = 1) */ -#define US_MR_NBSTOP_2_BIT (0x2u << 12) /**< \brief (US_MR) 2 stop bits */ -#define US_MR_CHMODE_Pos 14 -#define US_MR_CHMODE_Msk (0x3u << US_MR_CHMODE_Pos) /**< \brief (US_MR) Channel Mode */ -#define US_MR_CHMODE(value) ((US_MR_CHMODE_Msk & ((value) << US_MR_CHMODE_Pos))) -#define US_MR_CHMODE_NORMAL (0x0u << 14) /**< \brief (US_MR) Normal mode */ -#define US_MR_CHMODE_AUTOMATIC (0x1u << 14) /**< \brief (US_MR) Automatic Echo. Receiver input is connected to the TXD pin. */ -#define US_MR_CHMODE_LOCAL_LOOPBACK (0x2u << 14) /**< \brief (US_MR) Local Loopback. Transmitter output is connected to the Receiver Input. */ -#define US_MR_CHMODE_REMOTE_LOOPBACK (0x3u << 14) /**< \brief (US_MR) Remote Loopback. RXD pin is internally connected to the TXD pin. */ -#define US_MR_MODE9 (0x1u << 17) /**< \brief (US_MR) 9-bit Character Length */ -#define US_MR_CLKO (0x1u << 18) /**< \brief (US_MR) Clock Output Select */ -#define US_MR_OVER (0x1u << 19) /**< \brief (US_MR) Oversampling Mode */ -#define US_MR_VAR_SYNC (0x1u << 22) /**< \brief (US_MR) Variable Synchronization of Command/Data Sync Start Frame Delimiter */ -#define US_MR_FILTER (0x1u << 28) /**< \brief (US_MR) Receive Line Filter */ -#define US_MR_MAN (0x1u << 29) /**< \brief (US_MR) Manchester Encoder/Decoder Enable */ -#define US_MR_MODSYNC (0x1u << 30) /**< \brief (US_MR) Manchester Synchronization Mode */ -#define US_MR_ONEBIT (0x1u << 31) /**< \brief (US_MR) Start Frame Delimiter Selector */ -#define US_MR_CPHA (0x1u << 8) /**< \brief (US_MR) SPI Clock Phase */ -#define US_MR_CPOL (0x1u << 16) /**< \brief (US_MR) SPI Clock Polarity */ -#define US_MR_WRDBT (0x1u << 20) /**< \brief (US_MR) Wait Read Data Before Transfer */ -/* -------- US_IER : (USART Offset: 0x0008) Interrupt Enable Register -------- */ -#define US_IER_RXRDY (0x1u << 0) /**< \brief (US_IER) RXRDY Interrupt Enable */ -#define US_IER_TXRDY (0x1u << 1) /**< \brief (US_IER) TXRDY Interrupt Enable */ -#define US_IER_RXBRK (0x1u << 2) /**< \brief (US_IER) Receiver Break Interrupt Enable */ -#define US_IER_OVRE (0x1u << 5) /**< \brief (US_IER) Overrun Error Interrupt Enable */ -#define US_IER_FRAME (0x1u << 6) /**< \brief (US_IER) Framing Error Interrupt Enable */ -#define US_IER_PARE (0x1u << 7) /**< \brief (US_IER) Parity Error Interrupt Enable */ -#define US_IER_TIMEOUT (0x1u << 8) /**< \brief (US_IER) Time-out Interrupt Enable */ -#define US_IER_TXEMPTY (0x1u << 9) /**< \brief (US_IER) TXEMPTY Interrupt Enable */ -#define US_IER_CTSIC (0x1u << 19) /**< \brief (US_IER) Clear to Send Input Change Interrupt Enable */ -#define US_IER_MANE (0x1u << 24) /**< \brief (US_IER) Manchester Error Interrupt Enable */ -#define US_IER_UNRE (0x1u << 10) /**< \brief (US_IER) SPI Underrun Error Interrupt Enable */ -#define US_IER_LINBK (0x1u << 13) /**< \brief (US_IER) LIN Break Sent or LIN Break Received Interrupt Enable */ -#define US_IER_LINID (0x1u << 14) /**< \brief (US_IER) LIN Identifier Sent or LIN Identifier Received Interrupt Enable */ -#define US_IER_LINTC (0x1u << 15) /**< \brief (US_IER) LIN Transfer Completed Interrupt Enable */ -#define US_IER_LINBE (0x1u << 25) /**< \brief (US_IER) LIN Bus Error Interrupt Enable */ -#define US_IER_LINISFE (0x1u << 26) /**< \brief (US_IER) LIN Inconsistent Synch Field Error Interrupt Enable */ -#define US_IER_LINIPE (0x1u << 27) /**< \brief (US_IER) LIN Identifier Parity Interrupt Enable */ -#define US_IER_LINCE (0x1u << 28) /**< \brief (US_IER) LIN Checksum Error Interrupt Enable */ -#define US_IER_LINSNRE (0x1u << 29) /**< \brief (US_IER) LIN Slave Not Responding Error Interrupt Enable */ -#define US_IER_LINSTE (0x1u << 30) /**< \brief (US_IER) LIN Synch Tolerance Error Interrupt Enable */ -#define US_IER_LINHTE (0x1u << 31) /**< \brief (US_IER) LIN Header Timeout Error Interrupt Enable */ -#define US_IER_LSFE (0x1u << 6) /**< \brief (US_IER) LON Short Frame Error Interrupt Enable */ -#define US_IER_LCRCE (0x1u << 7) /**< \brief (US_IER) LON CRC Error Interrupt Enable */ -#define US_IER_LTXD (0x1u << 24) /**< \brief (US_IER) LON Transmission Done Interrupt Enable */ -#define US_IER_LCOL (0x1u << 25) /**< \brief (US_IER) LON Collision Interrupt Enable */ -#define US_IER_LFET (0x1u << 26) /**< \brief (US_IER) LON Frame Early Termination Interrupt Enable */ -#define US_IER_LRXD (0x1u << 27) /**< \brief (US_IER) LON Reception Done Interrupt Enable */ -#define US_IER_LBLOVFE (0x1u << 28) /**< \brief (US_IER) LON Backlog Overflow Error Interrupt Enable */ -/* -------- US_IDR : (USART Offset: 0x000C) Interrupt Disable Register -------- */ -#define US_IDR_RXRDY (0x1u << 0) /**< \brief (US_IDR) RXRDY Interrupt Disable */ -#define US_IDR_TXRDY (0x1u << 1) /**< \brief (US_IDR) TXRDY Interrupt Disable */ -#define US_IDR_RXBRK (0x1u << 2) /**< \brief (US_IDR) Receiver Break Interrupt Disable */ -#define US_IDR_OVRE (0x1u << 5) /**< \brief (US_IDR) Overrun Error Interrupt Enable */ -#define US_IDR_FRAME (0x1u << 6) /**< \brief (US_IDR) Framing Error Interrupt Disable */ -#define US_IDR_PARE (0x1u << 7) /**< \brief (US_IDR) Parity Error Interrupt Disable */ -#define US_IDR_TIMEOUT (0x1u << 8) /**< \brief (US_IDR) Time-out Interrupt Disable */ -#define US_IDR_TXEMPTY (0x1u << 9) /**< \brief (US_IDR) TXEMPTY Interrupt Disable */ -#define US_IDR_CTSIC (0x1u << 19) /**< \brief (US_IDR) Clear to Send Input Change Interrupt Disable */ -#define US_IDR_MANE (0x1u << 24) /**< \brief (US_IDR) Manchester Error Interrupt Disable */ -#define US_IDR_UNRE (0x1u << 10) /**< \brief (US_IDR) SPI Underrun Error Interrupt Disable */ -#define US_IDR_LINBK (0x1u << 13) /**< \brief (US_IDR) LIN Break Sent or LIN Break Received Interrupt Disable */ -#define US_IDR_LINID (0x1u << 14) /**< \brief (US_IDR) LIN Identifier Sent or LIN Identifier Received Interrupt Disable */ -#define US_IDR_LINTC (0x1u << 15) /**< \brief (US_IDR) LIN Transfer Completed Interrupt Disable */ -#define US_IDR_LINBE (0x1u << 25) /**< \brief (US_IDR) LIN Bus Error Interrupt Disable */ -#define US_IDR_LINISFE (0x1u << 26) /**< \brief (US_IDR) LIN Inconsistent Synch Field Error Interrupt Disable */ -#define US_IDR_LINIPE (0x1u << 27) /**< \brief (US_IDR) LIN Identifier Parity Interrupt Disable */ -#define US_IDR_LINCE (0x1u << 28) /**< \brief (US_IDR) LIN Checksum Error Interrupt Disable */ -#define US_IDR_LINSNRE (0x1u << 29) /**< \brief (US_IDR) LIN Slave Not Responding Error Interrupt Disable */ -#define US_IDR_LINSTE (0x1u << 30) /**< \brief (US_IDR) LIN Synch Tolerance Error Interrupt Disable */ -#define US_IDR_LINHTE (0x1u << 31) /**< \brief (US_IDR) LIN Header Timeout Error Interrupt Disable */ -#define US_IDR_LSFE (0x1u << 6) /**< \brief (US_IDR) LON Short Frame Error Interrupt Disable */ -#define US_IDR_LCRCE (0x1u << 7) /**< \brief (US_IDR) LON CRC Error Interrupt Disable */ -#define US_IDR_LTXD (0x1u << 24) /**< \brief (US_IDR) LON Transmission Done Interrupt Disable */ -#define US_IDR_LCOL (0x1u << 25) /**< \brief (US_IDR) LON Collision Interrupt Disable */ -#define US_IDR_LFET (0x1u << 26) /**< \brief (US_IDR) LON Frame Early Termination Interrupt Disable */ -#define US_IDR_LRXD (0x1u << 27) /**< \brief (US_IDR) LON Reception Done Interrupt Disable */ -#define US_IDR_LBLOVFE (0x1u << 28) /**< \brief (US_IDR) LON Backlog Overflow Error Interrupt Disable */ -/* -------- US_IMR : (USART Offset: 0x0010) Interrupt Mask Register -------- */ -#define US_IMR_RXRDY (0x1u << 0) /**< \brief (US_IMR) RXRDY Interrupt Mask */ -#define US_IMR_TXRDY (0x1u << 1) /**< \brief (US_IMR) TXRDY Interrupt Mask */ -#define US_IMR_RXBRK (0x1u << 2) /**< \brief (US_IMR) Receiver Break Interrupt Mask */ -#define US_IMR_OVRE (0x1u << 5) /**< \brief (US_IMR) Overrun Error Interrupt Mask */ -#define US_IMR_FRAME (0x1u << 6) /**< \brief (US_IMR) Framing Error Interrupt Mask */ -#define US_IMR_PARE (0x1u << 7) /**< \brief (US_IMR) Parity Error Interrupt Mask */ -#define US_IMR_TIMEOUT (0x1u << 8) /**< \brief (US_IMR) Time-out Interrupt Mask */ -#define US_IMR_TXEMPTY (0x1u << 9) /**< \brief (US_IMR) TXEMPTY Interrupt Mask */ -#define US_IMR_CTSIC (0x1u << 19) /**< \brief (US_IMR) Clear to Send Input Change Interrupt Mask */ -#define US_IMR_MANE (0x1u << 24) /**< \brief (US_IMR) Manchester Error Interrupt Mask */ -#define US_IMR_UNRE (0x1u << 10) /**< \brief (US_IMR) SPI Underrun Error Interrupt Mask */ -#define US_IMR_LINBK (0x1u << 13) /**< \brief (US_IMR) LIN Break Sent or LIN Break Received Interrupt Mask */ -#define US_IMR_LINID (0x1u << 14) /**< \brief (US_IMR) LIN Identifier Sent or LIN Identifier Received Interrupt Mask */ -#define US_IMR_LINTC (0x1u << 15) /**< \brief (US_IMR) LIN Transfer Completed Interrupt Mask */ -#define US_IMR_LINBE (0x1u << 25) /**< \brief (US_IMR) LIN Bus Error Interrupt Mask */ -#define US_IMR_LINISFE (0x1u << 26) /**< \brief (US_IMR) LIN Inconsistent Synch Field Error Interrupt Mask */ -#define US_IMR_LINIPE (0x1u << 27) /**< \brief (US_IMR) LIN Identifier Parity Interrupt Mask */ -#define US_IMR_LINCE (0x1u << 28) /**< \brief (US_IMR) LIN Checksum Error Interrupt Mask */ -#define US_IMR_LINSNRE (0x1u << 29) /**< \brief (US_IMR) LIN Slave Not Responding Error Interrupt Mask */ -#define US_IMR_LINSTE (0x1u << 30) /**< \brief (US_IMR) LIN Synch Tolerance Error Interrupt Mask */ -#define US_IMR_LINHTE (0x1u << 31) /**< \brief (US_IMR) LIN Header Timeout Error Interrupt Mask */ -#define US_IMR_LSFE (0x1u << 6) /**< \brief (US_IMR) LON Short Frame Error Interrupt Mask */ -#define US_IMR_LCRCE (0x1u << 7) /**< \brief (US_IMR) LON CRC Error Interrupt Mask */ -#define US_IMR_LTXD (0x1u << 24) /**< \brief (US_IMR) LON Transmission Done Interrupt Mask */ -#define US_IMR_LCOL (0x1u << 25) /**< \brief (US_IMR) LON Collision Interrupt Mask */ -#define US_IMR_LFET (0x1u << 26) /**< \brief (US_IMR) LON Frame Early Termination Interrupt Mask */ -#define US_IMR_LRXD (0x1u << 27) /**< \brief (US_IMR) LON Reception Done Interrupt Mask */ -#define US_IMR_LBLOVFE (0x1u << 28) /**< \brief (US_IMR) LON Backlog Overflow Error Interrupt Mask */ -/* -------- US_CSR : (USART Offset: 0x0014) Channel Status Register -------- */ -#define US_CSR_RXRDY (0x1u << 0) /**< \brief (US_CSR) Receiver Ready (cleared by reading US_RHR) */ -#define US_CSR_TXRDY (0x1u << 1) /**< \brief (US_CSR) Transmitter Ready (cleared by writing US_THR) */ -#define US_CSR_RXBRK (0x1u << 2) /**< \brief (US_CSR) Break Received/End of Break (cleared by writing a one to bit US_CR.RSTSTA) */ -#define US_CSR_OVRE (0x1u << 5) /**< \brief (US_CSR) Overrun Error (cleared by writing a one to bit US_CR.RSTSTA) */ -#define US_CSR_FRAME (0x1u << 6) /**< \brief (US_CSR) Framing Error (cleared by writing a one to bit US_CR.RSTSTA) */ -#define US_CSR_PARE (0x1u << 7) /**< \brief (US_CSR) Parity Error (cleared by writing a one to bit US_CR.RSTSTA) */ -#define US_CSR_TIMEOUT (0x1u << 8) /**< \brief (US_CSR) Receiver Time-out (cleared by writing a one to bit US_CR.STTTO) */ -#define US_CSR_TXEMPTY (0x1u << 9) /**< \brief (US_CSR) Transmitter Empty (cleared by writing US_THR) */ -#define US_CSR_NACK (0x1u << 13) /**< \brief (US_CSR) Non AcknowledgeInterrupt */ -#define US_CSR_CTSIC (0x1u << 19) /**< \brief (US_CSR) Clear to Send Input Change Flag (cleared on read) */ -#define US_CSR_CTS (0x1u << 23) /**< \brief (US_CSR) Image of CTS Input */ -#define US_CSR_MANERR (0x1u << 24) /**< \brief (US_CSR) Manchester Error (cleared by writing a one to the bit US_CR.RSTSTA) */ -#define US_CSR_UNRE (0x1u << 10) /**< \brief (US_CSR) Underrun Error (cleared by writing a one to bit US_CR.RSTSTA) */ -#define US_CSR_LINBK (0x1u << 13) /**< \brief (US_CSR) LIN Break Sent or LIN Break Received (cleared by writing a one to bit US_CR.RSTSTA) */ -#define US_CSR_LINID (0x1u << 14) /**< \brief (US_CSR) LIN Identifier Sent or LIN Identifier Received (cleared by writing a one to bit US_CR.RSTSTA) */ -#define US_CSR_LINTC (0x1u << 15) /**< \brief (US_CSR) LIN Transfer Completed (cleared by writing a one to bit US_CR.RSTSTA) */ -#define US_CSR_LINBLS (0x1u << 23) /**< \brief (US_CSR) LIN Bus Line Status */ -#define US_CSR_LINBE (0x1u << 25) /**< \brief (US_CSR) LIN Bit Error (cleared by writing a one to bit US_CR.RSTSTA) */ -#define US_CSR_LINISFE (0x1u << 26) /**< \brief (US_CSR) LIN Inconsistent Synch Field Error (cleared by writing a one to bit US_CR.RSTSTA) */ -#define US_CSR_LINIPE (0x1u << 27) /**< \brief (US_CSR) LIN Identifier Parity Error (cleared by writing a one to bit US_CR.RSTSTA) */ -#define US_CSR_LINCE (0x1u << 28) /**< \brief (US_CSR) LIN Checksum Error (cleared by writing a one to bit US_CR.RSTSTA) */ -#define US_CSR_LINSNRE (0x1u << 29) /**< \brief (US_CSR) LIN Slave Not Responding Error (cleared by writing a one to bit US_CR.RSTSTA) */ -#define US_CSR_LINSTE (0x1u << 30) /**< \brief (US_CSR) LIN Synch Tolerance Error (cleared by writing a one to bit US_CR.RSTSTA) */ -#define US_CSR_LINHTE (0x1u << 31) /**< \brief (US_CSR) LIN Header Timeout Error (cleared by writing a one to bit US_CR.RSTSTA) */ -#define US_CSR_LSFE (0x1u << 6) /**< \brief (US_CSR) LON Short Frame Error (cleared by writing a one to bit US_CR.RSTSTA) */ -#define US_CSR_LCRCE (0x1u << 7) /**< \brief (US_CSR) LON CRC Error (cleared by writing a one to bit US_CR.RSTSTA) */ -#define US_CSR_LTXD (0x1u << 24) /**< \brief (US_CSR) LON Transmission End Flag (cleared by writing a one to bit US_CR.RSTSTA) */ -#define US_CSR_LCOL (0x1u << 25) /**< \brief (US_CSR) LON Collision Detected Flag (cleared by writing a one to bit US_CR.RSTSTA) */ -#define US_CSR_LFET (0x1u << 26) /**< \brief (US_CSR) LON Frame Early Termination (cleared by writing a one to bit US_CR.RSTSTA) */ -#define US_CSR_LRXD (0x1u << 27) /**< \brief (US_CSR) LON Reception End Flag (cleared by writing a one to bit US_CR.RSTSTA) */ -#define US_CSR_LBLOVFE (0x1u << 28) /**< \brief (US_CSR) LON Backlog Overflow Error (cleared by writing a one to bit US_CR.RSTSTA) */ -/* -------- US_RHR : (USART Offset: 0x0018) Receive Holding Register -------- */ -#define US_RHR_RXCHR_Pos 0 -#define US_RHR_RXCHR_Msk (0x1ffu << US_RHR_RXCHR_Pos) /**< \brief (US_RHR) Received Character */ -#define US_RHR_RXSYNH (0x1u << 15) /**< \brief (US_RHR) Received Sync */ -/* -------- US_THR : (USART Offset: 0x001C) Transmit Holding Register -------- */ -#define US_THR_TXCHR_Pos 0 -#define US_THR_TXCHR_Msk (0x1ffu << US_THR_TXCHR_Pos) /**< \brief (US_THR) Character to be Transmitted */ -#define US_THR_TXCHR(value) ((US_THR_TXCHR_Msk & ((value) << US_THR_TXCHR_Pos))) -#define US_THR_TXSYNH (0x1u << 15) /**< \brief (US_THR) Sync Field to be Transmitted */ -/* -------- US_BRGR : (USART Offset: 0x0020) Baud Rate Generator Register -------- */ -#define US_BRGR_CD_Pos 0 -#define US_BRGR_CD_Msk (0xffffu << US_BRGR_CD_Pos) /**< \brief (US_BRGR) Clock Divider */ -#define US_BRGR_CD(value) ((US_BRGR_CD_Msk & ((value) << US_BRGR_CD_Pos))) -#define US_BRGR_FP_Pos 16 -#define US_BRGR_FP_Msk (0x7u << US_BRGR_FP_Pos) /**< \brief (US_BRGR) Fractional Part */ -#define US_BRGR_FP(value) ((US_BRGR_FP_Msk & ((value) << US_BRGR_FP_Pos))) -/* -------- US_RTOR : (USART Offset: 0x0024) Receiver Time-out Register -------- */ -#define US_RTOR_TO_Pos 0 -#define US_RTOR_TO_Msk (0x1ffffu << US_RTOR_TO_Pos) /**< \brief (US_RTOR) Time-out Value */ -#define US_RTOR_TO(value) ((US_RTOR_TO_Msk & ((value) << US_RTOR_TO_Pos))) -/* -------- US_TTGR : (USART Offset: 0x0028) Transmitter Timeguard Register -------- */ -#define US_TTGR_TG_Pos 0 -#define US_TTGR_TG_Msk (0xffu << US_TTGR_TG_Pos) /**< \brief (US_TTGR) Timeguard Value */ -#define US_TTGR_TG(value) ((US_TTGR_TG_Msk & ((value) << US_TTGR_TG_Pos))) -#define US_TTGR_PCYCLE_Pos 0 -#define US_TTGR_PCYCLE_Msk (0xffffffu << US_TTGR_PCYCLE_Pos) /**< \brief (US_TTGR) LON PCYCLE Length */ -#define US_TTGR_PCYCLE(value) ((US_TTGR_PCYCLE_Msk & ((value) << US_TTGR_PCYCLE_Pos))) -/* -------- US_MAN : (USART Offset: 0x0050) Manchester Configuration Register -------- */ -#define US_MAN_TX_PL_Pos 0 -#define US_MAN_TX_PL_Msk (0xfu << US_MAN_TX_PL_Pos) /**< \brief (US_MAN) Transmitter Preamble Length */ -#define US_MAN_TX_PL(value) ((US_MAN_TX_PL_Msk & ((value) << US_MAN_TX_PL_Pos))) -#define US_MAN_TX_PP_Pos 8 -#define US_MAN_TX_PP_Msk (0x3u << US_MAN_TX_PP_Pos) /**< \brief (US_MAN) Transmitter Preamble Pattern */ -#define US_MAN_TX_PP(value) ((US_MAN_TX_PP_Msk & ((value) << US_MAN_TX_PP_Pos))) -#define US_MAN_TX_PP_ALL_ONE (0x0u << 8) /**< \brief (US_MAN) The preamble is composed of '1's */ -#define US_MAN_TX_PP_ALL_ZERO (0x1u << 8) /**< \brief (US_MAN) The preamble is composed of '0's */ -#define US_MAN_TX_PP_ZERO_ONE (0x2u << 8) /**< \brief (US_MAN) The preamble is composed of '01's */ -#define US_MAN_TX_PP_ONE_ZERO (0x3u << 8) /**< \brief (US_MAN) The preamble is composed of '10's */ -#define US_MAN_TX_MPOL (0x1u << 12) /**< \brief (US_MAN) Transmitter Manchester Polarity */ -#define US_MAN_RX_PL_Pos 16 -#define US_MAN_RX_PL_Msk (0xfu << US_MAN_RX_PL_Pos) /**< \brief (US_MAN) Receiver Preamble Length */ -#define US_MAN_RX_PL(value) ((US_MAN_RX_PL_Msk & ((value) << US_MAN_RX_PL_Pos))) -#define US_MAN_RX_PP_Pos 24 -#define US_MAN_RX_PP_Msk (0x3u << US_MAN_RX_PP_Pos) /**< \brief (US_MAN) Receiver Preamble Pattern detected */ -#define US_MAN_RX_PP(value) ((US_MAN_RX_PP_Msk & ((value) << US_MAN_RX_PP_Pos))) -#define US_MAN_RX_PP_ALL_ONE (0x0u << 24) /**< \brief (US_MAN) The preamble is composed of '1's */ -#define US_MAN_RX_PP_ALL_ZERO (0x1u << 24) /**< \brief (US_MAN) The preamble is composed of '0's */ -#define US_MAN_RX_PP_ZERO_ONE (0x2u << 24) /**< \brief (US_MAN) The preamble is composed of '01's */ -#define US_MAN_RX_PP_ONE_ZERO (0x3u << 24) /**< \brief (US_MAN) The preamble is composed of '10's */ -#define US_MAN_RX_MPOL (0x1u << 28) /**< \brief (US_MAN) Receiver Manchester Polarity */ -#define US_MAN_ONE (0x1u << 29) /**< \brief (US_MAN) Must Be Set to 1 */ -#define US_MAN_DRIFT (0x1u << 30) /**< \brief (US_MAN) Drift Compensation */ -#define US_MAN_RXIDLEV (0x1u << 31) /**< \brief (US_MAN) */ -/* -------- US_LINMR : (USART Offset: 0x0054) LIN Mode Register -------- */ -#define US_LINMR_NACT_Pos 0 -#define US_LINMR_NACT_Msk (0x3u << US_LINMR_NACT_Pos) /**< \brief (US_LINMR) LIN Node Action */ -#define US_LINMR_NACT(value) ((US_LINMR_NACT_Msk & ((value) << US_LINMR_NACT_Pos))) -#define US_LINMR_NACT_PUBLISH (0x0u << 0) /**< \brief (US_LINMR) The USART transmits the response. */ -#define US_LINMR_NACT_SUBSCRIBE (0x1u << 0) /**< \brief (US_LINMR) The USART receives the response. */ -#define US_LINMR_NACT_IGNORE (0x2u << 0) /**< \brief (US_LINMR) The USART does not transmit and does not receive the response. */ -#define US_LINMR_PARDIS (0x1u << 2) /**< \brief (US_LINMR) Parity Disable */ -#define US_LINMR_CHKDIS (0x1u << 3) /**< \brief (US_LINMR) Checksum Disable */ -#define US_LINMR_CHKTYP (0x1u << 4) /**< \brief (US_LINMR) Checksum Type */ -#define US_LINMR_DLM (0x1u << 5) /**< \brief (US_LINMR) Data Length Mode */ -#define US_LINMR_FSDIS (0x1u << 6) /**< \brief (US_LINMR) Frame Slot Mode Disable */ -#define US_LINMR_WKUPTYP (0x1u << 7) /**< \brief (US_LINMR) Wakeup Signal Type */ -#define US_LINMR_DLC_Pos 8 -#define US_LINMR_DLC_Msk (0xffu << US_LINMR_DLC_Pos) /**< \brief (US_LINMR) Data Length Control */ -#define US_LINMR_DLC(value) ((US_LINMR_DLC_Msk & ((value) << US_LINMR_DLC_Pos))) -#define US_LINMR_PDCM (0x1u << 16) /**< \brief (US_LINMR) DMAC Mode */ -#define US_LINMR_SYNCDIS (0x1u << 17) /**< \brief (US_LINMR) Synchronization Disable */ -/* -------- US_LINIR : (USART Offset: 0x0058) LIN Identifier Register -------- */ -#define US_LINIR_IDCHR_Pos 0 -#define US_LINIR_IDCHR_Msk (0xffu << US_LINIR_IDCHR_Pos) /**< \brief (US_LINIR) Identifier Character */ -#define US_LINIR_IDCHR(value) ((US_LINIR_IDCHR_Msk & ((value) << US_LINIR_IDCHR_Pos))) -/* -------- US_LINBRR : (USART Offset: 0x005C) LIN Baud Rate Register -------- */ -#define US_LINBRR_LINCD_Pos 0 -#define US_LINBRR_LINCD_Msk (0xffffu << US_LINBRR_LINCD_Pos) /**< \brief (US_LINBRR) Clock Divider after Synchronization */ -#define US_LINBRR_LINFP_Pos 16 -#define US_LINBRR_LINFP_Msk (0x7u << US_LINBRR_LINFP_Pos) /**< \brief (US_LINBRR) Fractional Part after Synchronization */ -/* -------- US_LONMR : (USART Offset: 0x0060) LON Mode Register -------- */ -#define US_LONMR_COMMT (0x1u << 0) /**< \brief (US_LONMR) LON comm_type Parameter Value */ -#define US_LONMR_COLDET (0x1u << 1) /**< \brief (US_LONMR) LON Collision Detection Feature */ -#define US_LONMR_TCOL (0x1u << 2) /**< \brief (US_LONMR) Terminate Frame upon Collision Notification */ -#define US_LONMR_CDTAIL (0x1u << 3) /**< \brief (US_LONMR) LON Collision Detection on Frame Tail */ -#define US_LONMR_DMAM (0x1u << 4) /**< \brief (US_LONMR) LON DMA Mode */ -#define US_LONMR_LCDS (0x1u << 5) /**< \brief (US_LONMR) LON Collision Detection Source */ -#define US_LONMR_EOFS_Pos 16 -#define US_LONMR_EOFS_Msk (0xffu << US_LONMR_EOFS_Pos) /**< \brief (US_LONMR) End of Frame Condition Size */ -#define US_LONMR_EOFS(value) ((US_LONMR_EOFS_Msk & ((value) << US_LONMR_EOFS_Pos))) -/* -------- US_LONPR : (USART Offset: 0x0064) LON Preamble Register -------- */ -#define US_LONPR_LONPL_Pos 0 -#define US_LONPR_LONPL_Msk (0x3fffu << US_LONPR_LONPL_Pos) /**< \brief (US_LONPR) LON Preamble Length */ -#define US_LONPR_LONPL(value) ((US_LONPR_LONPL_Msk & ((value) << US_LONPR_LONPL_Pos))) -/* -------- US_LONDL : (USART Offset: 0x0068) LON Data Length Register -------- */ -#define US_LONDL_LONDL_Pos 0 -#define US_LONDL_LONDL_Msk (0xffu << US_LONDL_LONDL_Pos) /**< \brief (US_LONDL) LON Data Length */ -#define US_LONDL_LONDL(value) ((US_LONDL_LONDL_Msk & ((value) << US_LONDL_LONDL_Pos))) -/* -------- US_LONL2HDR : (USART Offset: 0x006C) LON L2HDR Register -------- */ -#define US_LONL2HDR_BLI_Pos 0 -#define US_LONL2HDR_BLI_Msk (0x3fu << US_LONL2HDR_BLI_Pos) /**< \brief (US_LONL2HDR) LON Backlog Increment */ -#define US_LONL2HDR_BLI(value) ((US_LONL2HDR_BLI_Msk & ((value) << US_LONL2HDR_BLI_Pos))) -#define US_LONL2HDR_ALTP (0x1u << 6) /**< \brief (US_LONL2HDR) LON Alternate Path Bit */ -#define US_LONL2HDR_PB (0x1u << 7) /**< \brief (US_LONL2HDR) LON Priority Bit */ -/* -------- US_LONBL : (USART Offset: 0x0070) LON Backlog Register -------- */ -#define US_LONBL_LONBL_Pos 0 -#define US_LONBL_LONBL_Msk (0x3fu << US_LONBL_LONBL_Pos) /**< \brief (US_LONBL) LON Node Backlog Value */ -/* -------- US_LONB1TX : (USART Offset: 0x0074) LON Beta1 Tx Register -------- */ -#define US_LONB1TX_BETA1TX_Pos 0 -#define US_LONB1TX_BETA1TX_Msk (0xffffffu << US_LONB1TX_BETA1TX_Pos) /**< \brief (US_LONB1TX) LON Beta1 Length after Transmission */ -#define US_LONB1TX_BETA1TX(value) ((US_LONB1TX_BETA1TX_Msk & ((value) << US_LONB1TX_BETA1TX_Pos))) -/* -------- US_LONB1RX : (USART Offset: 0x0078) LON Beta1 Rx Register -------- */ -#define US_LONB1RX_BETA1RX_Pos 0 -#define US_LONB1RX_BETA1RX_Msk (0xffffffu << US_LONB1RX_BETA1RX_Pos) /**< \brief (US_LONB1RX) LON Beta1 Length after Reception */ -#define US_LONB1RX_BETA1RX(value) ((US_LONB1RX_BETA1RX_Msk & ((value) << US_LONB1RX_BETA1RX_Pos))) -/* -------- US_LONPRIO : (USART Offset: 0x007C) LON Priority Register -------- */ -#define US_LONPRIO_PSNB_Pos 0 -#define US_LONPRIO_PSNB_Msk (0x7fu << US_LONPRIO_PSNB_Pos) /**< \brief (US_LONPRIO) LON Priority Slot Number */ -#define US_LONPRIO_PSNB(value) ((US_LONPRIO_PSNB_Msk & ((value) << US_LONPRIO_PSNB_Pos))) -#define US_LONPRIO_NPS_Pos 8 -#define US_LONPRIO_NPS_Msk (0x7fu << US_LONPRIO_NPS_Pos) /**< \brief (US_LONPRIO) LON Node Priority Slot */ -#define US_LONPRIO_NPS(value) ((US_LONPRIO_NPS_Msk & ((value) << US_LONPRIO_NPS_Pos))) -/* -------- US_IDTTX : (USART Offset: 0x0080) LON IDT Tx Register -------- */ -#define US_IDTTX_IDTTX_Pos 0 -#define US_IDTTX_IDTTX_Msk (0xffffffu << US_IDTTX_IDTTX_Pos) /**< \brief (US_IDTTX) LON Indeterminate Time after Transmission (comm_type = 1 mode only) */ -#define US_IDTTX_IDTTX(value) ((US_IDTTX_IDTTX_Msk & ((value) << US_IDTTX_IDTTX_Pos))) -/* -------- US_IDTRX : (USART Offset: 0x0084) LON IDT Rx Register -------- */ -#define US_IDTRX_IDTRX_Pos 0 -#define US_IDTRX_IDTRX_Msk (0xffffffu << US_IDTRX_IDTRX_Pos) /**< \brief (US_IDTRX) LON Indeterminate Time after Reception (comm_type = 1 mode only) */ -#define US_IDTRX_IDTRX(value) ((US_IDTRX_IDTRX_Msk & ((value) << US_IDTRX_IDTRX_Pos))) -/* -------- US_ICDIFF : (USART Offset: 0x0088) IC DIFF Register -------- */ -#define US_ICDIFF_ICDIFF_Pos 0 -#define US_ICDIFF_ICDIFF_Msk (0xfu << US_ICDIFF_ICDIFF_Pos) /**< \brief (US_ICDIFF) IC Differentiator Number */ -#define US_ICDIFF_ICDIFF(value) ((US_ICDIFF_ICDIFF_Msk & ((value) << US_ICDIFF_ICDIFF_Pos))) -/* -------- US_WPMR : (USART Offset: 0x00E4) Write Protection Mode Register -------- */ -#define US_WPMR_WPEN (0x1u << 0) /**< \brief (US_WPMR) Write Protection Enable */ -#define US_WPMR_WPKEY_Pos 8 -#define US_WPMR_WPKEY_Msk (0xffffffu << US_WPMR_WPKEY_Pos) /**< \brief (US_WPMR) Write Protection Key */ -#define US_WPMR_WPKEY(value) ((US_WPMR_WPKEY_Msk & ((value) << US_WPMR_WPKEY_Pos))) -#define US_WPMR_WPKEY_PASSWD (0x555341u << 8) /**< \brief (US_WPMR) Writing any other value in this field aborts the write operation of the WPEN bit. Always reads as 0. */ -/* -------- US_WPSR : (USART Offset: 0x00E8) Write Protection Status Register -------- */ -#define US_WPSR_WPVS (0x1u << 0) /**< \brief (US_WPSR) Write Protection Violation Status */ -#define US_WPSR_WPVSRC_Pos 8 -#define US_WPSR_WPVSRC_Msk (0xffffu << US_WPSR_WPVSRC_Pos) /**< \brief (US_WPSR) Write Protection Violation Source */ - -/*@}*/ - - -#endif /* _SAMV71_USART_COMPONENT_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_usbhs.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_usbhs.h deleted file mode 100644 index c3aac2d5..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_usbhs.h +++ /dev/null @@ -1,960 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_USBHS_COMPONENT_ -#define _SAMV71_USBHS_COMPONENT_ - -/* ============================================================================= */ -/** SOFTWARE API DEFINITION FOR USB High-Speed Interface */ -/* ============================================================================= */ -/** \addtogroup SAMV71_USBHS USB High-Speed Interface */ -/*@{*/ - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -/** \brief UsbhsDevdma hardware registers */ -typedef struct { - __IO uint32_t USBHS_DEVDMANXTDSC; /**< \brief (UsbhsDevdma Offset: 0x0) Device DMA Channel Next Descriptor Address Register */ - __IO uint32_t USBHS_DEVDMAADDRESS; /**< \brief (UsbhsDevdma Offset: 0x4) Device DMA Channel Address Register */ - __IO uint32_t USBHS_DEVDMACONTROL; /**< \brief (UsbhsDevdma Offset: 0x8) Device DMA Channel Control Register */ - __IO uint32_t USBHS_DEVDMASTATUS; /**< \brief (UsbhsDevdma Offset: 0xC) Device DMA Channel Status Register */ -} UsbhsDevdma; -/** \brief UsbhsHstdma hardware registers */ -typedef struct { - __IO uint32_t USBHS_HSTDMANXTDSC; /**< \brief (UsbhsHstdma Offset: 0x0) Host DMA Channel Next Descriptor Address Register */ - __IO uint32_t USBHS_HSTDMAADDRESS; /**< \brief (UsbhsHstdma Offset: 0x4) Host DMA Channel Address Register */ - __IO uint32_t USBHS_HSTDMACONTROL; /**< \brief (UsbhsHstdma Offset: 0x8) Host DMA Channel Control Register */ - __IO uint32_t USBHS_HSTDMASTATUS; /**< \brief (UsbhsHstdma Offset: 0xC) Host DMA Channel Status Register */ -} UsbhsHstdma; -/** \brief Usbhs hardware registers */ -#define USBHSDEVDMA_NUMBER 7 -#define USBHSHSTDMA_NUMBER 7 -typedef struct { - __IO uint32_t USBHS_DEVCTRL; /**< \brief (Usbhs Offset: 0x0000) Device General Control Register */ - __I uint32_t USBHS_DEVISR; /**< \brief (Usbhs Offset: 0x0004) Device Global Interrupt Status Register */ - __O uint32_t USBHS_DEVICR; /**< \brief (Usbhs Offset: 0x0008) Device Global Interrupt Clear Register */ - __O uint32_t USBHS_DEVIFR; /**< \brief (Usbhs Offset: 0x000C) Device Global Interrupt Set Register */ - __I uint32_t USBHS_DEVIMR; /**< \brief (Usbhs Offset: 0x0010) Device Global Interrupt Mask Register */ - __O uint32_t USBHS_DEVIDR; /**< \brief (Usbhs Offset: 0x0014) Device Global Interrupt Disable Register */ - __O uint32_t USBHS_DEVIER; /**< \brief (Usbhs Offset: 0x0018) Device Global Interrupt Enable Register */ - __IO uint32_t USBHS_DEVEPT; /**< \brief (Usbhs Offset: 0x001C) Device Endpoint Register */ - __I uint32_t USBHS_DEVFNUM; /**< \brief (Usbhs Offset: 0x0020) Device Frame Number Register */ - __I uint32_t Reserved1[55]; - __IO uint32_t USBHS_DEVEPTCFG[10]; /**< \brief (Usbhs Offset: 0x100) Device Endpoint Configuration Register (n = 0) */ - __I uint32_t Reserved2[2]; - __I uint32_t USBHS_DEVEPTISR[10]; /**< \brief (Usbhs Offset: 0x130) Device Endpoint Status Register (n = 0) */ - __I uint32_t Reserved3[2]; - __O uint32_t USBHS_DEVEPTICR[10]; /**< \brief (Usbhs Offset: 0x160) Device Endpoint Clear Register (n = 0) */ - __I uint32_t Reserved4[2]; - __O uint32_t USBHS_DEVEPTIFR[10]; /**< \brief (Usbhs Offset: 0x190) Device Endpoint Set Register (n = 0) */ - __I uint32_t Reserved5[2]; - __I uint32_t USBHS_DEVEPTIMR[10]; /**< \brief (Usbhs Offset: 0x1C0) Device Endpoint Mask Register (n = 0) */ - __I uint32_t Reserved6[2]; - __O uint32_t USBHS_DEVEPTIER[10]; /**< \brief (Usbhs Offset: 0x1F0) Device Endpoint Enable Register (n = 0) */ - __I uint32_t Reserved7[2]; - __O uint32_t USBHS_DEVEPTIDR[10]; /**< \brief (Usbhs Offset: 0x220) Device Endpoint Disable Register (n = 0) */ - __I uint32_t Reserved8[50]; - UsbhsDevdma USBHS_DEVDMA[USBHSDEVDMA_NUMBER]; /**< \brief (Usbhs Offset: 0x310) n = 1 .. 7 */ - __I uint32_t Reserved9[32]; - __IO uint32_t USBHS_HSTCTRL; /**< \brief (Usbhs Offset: 0x0400) Host General Control Register */ - __I uint32_t USBHS_HSTISR; /**< \brief (Usbhs Offset: 0x0404) Host Global Interrupt Status Register */ - __O uint32_t USBHS_HSTICR; /**< \brief (Usbhs Offset: 0x0408) Host Global Interrupt Clear Register */ - __O uint32_t USBHS_HSTIFR; /**< \brief (Usbhs Offset: 0x040C) Host Global Interrupt Set Register */ - __I uint32_t USBHS_HSTIMR; /**< \brief (Usbhs Offset: 0x0410) Host Global Interrupt Mask Register */ - __O uint32_t USBHS_HSTIDR; /**< \brief (Usbhs Offset: 0x0414) Host Global Interrupt Disable Register */ - __O uint32_t USBHS_HSTIER; /**< \brief (Usbhs Offset: 0x0418) Host Global Interrupt Enable Register */ - __IO uint32_t USBHS_HSTPIP; /**< \brief (Usbhs Offset: 0x0041C) Host Pipe Register */ - __IO uint32_t USBHS_HSTFNUM; /**< \brief (Usbhs Offset: 0x0420) Host Frame Number Register */ - __IO uint32_t USBHS_HSTADDR1; /**< \brief (Usbhs Offset: 0x0424) Host Address 1 Register */ - __IO uint32_t USBHS_HSTADDR2; /**< \brief (Usbhs Offset: 0x0428) Host Address 2 Register */ - __IO uint32_t USBHS_HSTADDR3; /**< \brief (Usbhs Offset: 0x042C) Host Address 3 Register */ - __I uint32_t Reserved10[52]; - __IO uint32_t USBHS_HSTPIPCFG[10]; /**< \brief (Usbhs Offset: 0x500) Host Pipe Configuration Register (n = 0) */ - __I uint32_t Reserved11[2]; - __I uint32_t USBHS_HSTPIPISR[10]; /**< \brief (Usbhs Offset: 0x530) Host Pipe Status Register (n = 0) */ - __I uint32_t Reserved12[2]; - __O uint32_t USBHS_HSTPIPICR[10]; /**< \brief (Usbhs Offset: 0x560) Host Pipe Clear Register (n = 0) */ - __I uint32_t Reserved13[2]; - __O uint32_t USBHS_HSTPIPIFR[10]; /**< \brief (Usbhs Offset: 0x590) Host Pipe Set Register (n = 0) */ - __I uint32_t Reserved14[2]; - __I uint32_t USBHS_HSTPIPIMR[10]; /**< \brief (Usbhs Offset: 0x5C0) Host Pipe Mask Register (n = 0) */ - __I uint32_t Reserved15[2]; - __O uint32_t USBHS_HSTPIPIER[10]; /**< \brief (Usbhs Offset: 0x5F0) Host Pipe Enable Register (n = 0) */ - __I uint32_t Reserved16[2]; - __O uint32_t USBHS_HSTPIPIDR[10]; /**< \brief (Usbhs Offset: 0x620) Host Pipe Disable Register (n = 0) */ - __I uint32_t Reserved17[2]; - __IO uint32_t USBHS_HSTPIPINRQ[10]; /**< \brief (Usbhs Offset: 0x650) Host Pipe IN Request Register (n = 0) */ - __I uint32_t Reserved18[2]; - __IO uint32_t USBHS_HSTPIPERR[10]; /**< \brief (Usbhs Offset: 0x680) Host Pipe Error Register (n = 0) */ - __I uint32_t Reserved19[26]; - UsbhsHstdma USBHS_HSTDMA[USBHSHSTDMA_NUMBER]; /**< \brief (Usbhs Offset: 0x710) n = 1 .. 7 */ - __I uint32_t Reserved20[32]; - __IO uint32_t USBHS_CTRL; /**< \brief (Usbhs Offset: 0x0800) General Control Register */ - __I uint32_t USBHS_SR; /**< \brief (Usbhs Offset: 0x0804) General Status Register */ - __O uint32_t USBHS_SCR; /**< \brief (Usbhs Offset: 0x0808) General Status Clear Register */ - __O uint32_t USBHS_SFR; /**< \brief (Usbhs Offset: 0x080C) General Status Set Register */ - __IO uint32_t USBHS_TSTA1; /**< \brief (Usbhs Offset: 0x0810) General Test A1 Register */ - __IO uint32_t USBHS_TSTA2; /**< \brief (Usbhs Offset: 0x0814) General Test A2 Register */ - __I uint32_t USBHS_VERSION; /**< \brief (Usbhs Offset: 0x0818) General Version Register */ - __I uint32_t Reserved21[4]; - __I uint32_t USBHS_FSM; /**< \brief (Usbhs Offset: 0x082C) General Finite State Machine Register */ -} Usbhs; -#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/* -------- USBHS_DEVCTRL : (USBHS Offset: 0x0000) Device General Control Register -------- */ -#define USBHS_DEVCTRL_UADD_Pos 0 -#define USBHS_DEVCTRL_UADD_Msk (0x7fu << USBHS_DEVCTRL_UADD_Pos) /**< \brief (USBHS_DEVCTRL) USB Address */ -#define USBHS_DEVCTRL_UADD(value) ((USBHS_DEVCTRL_UADD_Msk & ((value) << USBHS_DEVCTRL_UADD_Pos))) -#define USBHS_DEVCTRL_ADDEN (0x1u << 7) /**< \brief (USBHS_DEVCTRL) Address Enable */ -#define USBHS_DEVCTRL_DETACH (0x1u << 8) /**< \brief (USBHS_DEVCTRL) Detach */ -#define USBHS_DEVCTRL_RMWKUP (0x1u << 9) /**< \brief (USBHS_DEVCTRL) Remote Wake-Up */ -#define USBHS_DEVCTRL_SPDCONF_Pos 10 -#define USBHS_DEVCTRL_SPDCONF_Msk (0x3u << USBHS_DEVCTRL_SPDCONF_Pos) /**< \brief (USBHS_DEVCTRL) Mode Configuration */ -#define USBHS_DEVCTRL_SPDCONF(value) ((USBHS_DEVCTRL_SPDCONF_Msk & ((value) << USBHS_DEVCTRL_SPDCONF_Pos))) -#define USBHS_DEVCTRL_SPDCONF_NORMAL (0x0u << 10) /**< \brief (USBHS_DEVCTRL) The peripheral starts in Full-speed mode and performs a high-speed reset to switch to High-speed mode if the host is high-speed-capable. */ -#define USBHS_DEVCTRL_SPDCONF_LOW_POWER (0x1u << 10) /**< \brief (USBHS_DEVCTRL) For a better consumption, if high speed is not needed. */ -#define USBHS_DEVCTRL_SPDCONF_HIGH_SPEED (0x2u << 10) /**< \brief (USBHS_DEVCTRL) Forced high speed. */ -#define USBHS_DEVCTRL_SPDCONF_FORCED_FS (0x3u << 10) /**< \brief (USBHS_DEVCTRL) The peripheral remains in Full-speed mode whatever the host speed capability. */ -#define USBHS_DEVCTRL_LS (0x1u << 12) /**< \brief (USBHS_DEVCTRL) Low-Speed Mode Force */ -#define USBHS_DEVCTRL_TSTJ (0x1u << 13) /**< \brief (USBHS_DEVCTRL) Test mode J */ -#define USBHS_DEVCTRL_TSTK (0x1u << 14) /**< \brief (USBHS_DEVCTRL) Test mode K */ -#define USBHS_DEVCTRL_TSTPCKT (0x1u << 15) /**< \brief (USBHS_DEVCTRL) Test packet mode */ -#define USBHS_DEVCTRL_OPMODE2 (0x1u << 16) /**< \brief (USBHS_DEVCTRL) Specific Operational mode */ -/* -------- USBHS_DEVISR : (USBHS Offset: 0x0004) Device Global Interrupt Status Register -------- */ -#define USBHS_DEVISR_SUSP (0x1u << 0) /**< \brief (USBHS_DEVISR) Suspend Interrupt */ -#define USBHS_DEVISR_MSOF (0x1u << 1) /**< \brief (USBHS_DEVISR) Micro Start of Frame Interrupt */ -#define USBHS_DEVISR_SOF (0x1u << 2) /**< \brief (USBHS_DEVISR) Start of Frame Interrupt */ -#define USBHS_DEVISR_EORST (0x1u << 3) /**< \brief (USBHS_DEVISR) End of Reset Interrupt */ -#define USBHS_DEVISR_WAKEUP (0x1u << 4) /**< \brief (USBHS_DEVISR) Wake-Up Interrupt */ -#define USBHS_DEVISR_EORSM (0x1u << 5) /**< \brief (USBHS_DEVISR) End of Resume Interrupt */ -#define USBHS_DEVISR_UPRSM (0x1u << 6) /**< \brief (USBHS_DEVISR) Upstream Resume Interrupt */ -#define USBHS_DEVISR_PEP_0 (0x1u << 12) /**< \brief (USBHS_DEVISR) Endpoint 0 Interrupt */ -#define USBHS_DEVISR_PEP_1 (0x1u << 13) /**< \brief (USBHS_DEVISR) Endpoint 1 Interrupt */ -#define USBHS_DEVISR_PEP_2 (0x1u << 14) /**< \brief (USBHS_DEVISR) Endpoint 2 Interrupt */ -#define USBHS_DEVISR_PEP_3 (0x1u << 15) /**< \brief (USBHS_DEVISR) Endpoint 3 Interrupt */ -#define USBHS_DEVISR_PEP_4 (0x1u << 16) /**< \brief (USBHS_DEVISR) Endpoint 4 Interrupt */ -#define USBHS_DEVISR_PEP_5 (0x1u << 17) /**< \brief (USBHS_DEVISR) Endpoint 5 Interrupt */ -#define USBHS_DEVISR_PEP_6 (0x1u << 18) /**< \brief (USBHS_DEVISR) Endpoint 6 Interrupt */ -#define USBHS_DEVISR_PEP_7 (0x1u << 19) /**< \brief (USBHS_DEVISR) Endpoint 7 Interrupt */ -#define USBHS_DEVISR_PEP_8 (0x1u << 20) /**< \brief (USBHS_DEVISR) Endpoint 8 Interrupt */ -#define USBHS_DEVISR_PEP_9 (0x1u << 21) /**< \brief (USBHS_DEVISR) Endpoint 9 Interrupt */ -#define USBHS_DEVISR_PEP_10 (0x1u << 22) /**< \brief (USBHS_DEVISR) Endpoint 10 Interrupt */ -#define USBHS_DEVISR_PEP_11 (0x1u << 23) /**< \brief (USBHS_DEVISR) Endpoint 11 Interrupt */ -#define USBHS_DEVISR_DMA_1 (0x1u << 25) /**< \brief (USBHS_DEVISR) DMA Channel 1 Interrupt */ -#define USBHS_DEVISR_DMA_2 (0x1u << 26) /**< \brief (USBHS_DEVISR) DMA Channel 2 Interrupt */ -#define USBHS_DEVISR_DMA_3 (0x1u << 27) /**< \brief (USBHS_DEVISR) DMA Channel 3 Interrupt */ -#define USBHS_DEVISR_DMA_4 (0x1u << 28) /**< \brief (USBHS_DEVISR) DMA Channel 4 Interrupt */ -#define USBHS_DEVISR_DMA_5 (0x1u << 29) /**< \brief (USBHS_DEVISR) DMA Channel 5 Interrupt */ -#define USBHS_DEVISR_DMA_6 (0x1u << 30) /**< \brief (USBHS_DEVISR) DMA Channel 6 Interrupt */ -#define USBHS_DEVISR_DMA_7 (0x1u << 31) /**< \brief (USBHS_DEVISR) DMA Channel 7 Interrupt */ -/* -------- USBHS_DEVICR : (USBHS Offset: 0x0008) Device Global Interrupt Clear Register -------- */ -#define USBHS_DEVICR_SUSPC (0x1u << 0) /**< \brief (USBHS_DEVICR) Suspend Interrupt Clear */ -#define USBHS_DEVICR_MSOFC (0x1u << 1) /**< \brief (USBHS_DEVICR) Micro Start of Frame Interrupt Clear */ -#define USBHS_DEVICR_SOFC (0x1u << 2) /**< \brief (USBHS_DEVICR) Start of Frame Interrupt Clear */ -#define USBHS_DEVICR_EORSTC (0x1u << 3) /**< \brief (USBHS_DEVICR) End of Reset Interrupt Clear */ -#define USBHS_DEVICR_WAKEUPC (0x1u << 4) /**< \brief (USBHS_DEVICR) Wake-Up Interrupt Clear */ -#define USBHS_DEVICR_EORSMC (0x1u << 5) /**< \brief (USBHS_DEVICR) End of Resume Interrupt Clear */ -#define USBHS_DEVICR_UPRSMC (0x1u << 6) /**< \brief (USBHS_DEVICR) Upstream Resume Interrupt Clear */ -/* -------- USBHS_DEVIFR : (USBHS Offset: 0x000C) Device Global Interrupt Set Register -------- */ -#define USBHS_DEVIFR_SUSPS (0x1u << 0) /**< \brief (USBHS_DEVIFR) Suspend Interrupt Set */ -#define USBHS_DEVIFR_MSOFS (0x1u << 1) /**< \brief (USBHS_DEVIFR) Micro Start of Frame Interrupt Set */ -#define USBHS_DEVIFR_SOFS (0x1u << 2) /**< \brief (USBHS_DEVIFR) Start of Frame Interrupt Set */ -#define USBHS_DEVIFR_EORSTS (0x1u << 3) /**< \brief (USBHS_DEVIFR) End of Reset Interrupt Set */ -#define USBHS_DEVIFR_WAKEUPS (0x1u << 4) /**< \brief (USBHS_DEVIFR) Wake-Up Interrupt Set */ -#define USBHS_DEVIFR_EORSMS (0x1u << 5) /**< \brief (USBHS_DEVIFR) End of Resume Interrupt Set */ -#define USBHS_DEVIFR_UPRSMS (0x1u << 6) /**< \brief (USBHS_DEVIFR) Upstream Resume Interrupt Set */ -#define USBHS_DEVIFR_DMA_1 (0x1u << 25) /**< \brief (USBHS_DEVIFR) DMA Channel 1 Interrupt Set */ -#define USBHS_DEVIFR_DMA_2 (0x1u << 26) /**< \brief (USBHS_DEVIFR) DMA Channel 2 Interrupt Set */ -#define USBHS_DEVIFR_DMA_3 (0x1u << 27) /**< \brief (USBHS_DEVIFR) DMA Channel 3 Interrupt Set */ -#define USBHS_DEVIFR_DMA_4 (0x1u << 28) /**< \brief (USBHS_DEVIFR) DMA Channel 4 Interrupt Set */ -#define USBHS_DEVIFR_DMA_5 (0x1u << 29) /**< \brief (USBHS_DEVIFR) DMA Channel 5 Interrupt Set */ -#define USBHS_DEVIFR_DMA_6 (0x1u << 30) /**< \brief (USBHS_DEVIFR) DMA Channel 6 Interrupt Set */ -#define USBHS_DEVIFR_DMA_7 (0x1u << 31) /**< \brief (USBHS_DEVIFR) DMA Channel 7 Interrupt Set */ -/* -------- USBHS_DEVIMR : (USBHS Offset: 0x0010) Device Global Interrupt Mask Register -------- */ -#define USBHS_DEVIMR_SUSPE (0x1u << 0) /**< \brief (USBHS_DEVIMR) Suspend Interrupt Mask */ -#define USBHS_DEVIMR_MSOFE (0x1u << 1) /**< \brief (USBHS_DEVIMR) Micro Start of Frame Interrupt Mask */ -#define USBHS_DEVIMR_SOFE (0x1u << 2) /**< \brief (USBHS_DEVIMR) Start of Frame Interrupt Mask */ -#define USBHS_DEVIMR_EORSTE (0x1u << 3) /**< \brief (USBHS_DEVIMR) End of Reset Interrupt Mask */ -#define USBHS_DEVIMR_WAKEUPE (0x1u << 4) /**< \brief (USBHS_DEVIMR) Wake-Up Interrupt Mask */ -#define USBHS_DEVIMR_EORSME (0x1u << 5) /**< \brief (USBHS_DEVIMR) End of Resume Interrupt Mask */ -#define USBHS_DEVIMR_UPRSME (0x1u << 6) /**< \brief (USBHS_DEVIMR) Upstream Resume Interrupt Mask */ -#define USBHS_DEVIMR_PEP_0 (0x1u << 12) /**< \brief (USBHS_DEVIMR) Endpoint 0 Interrupt Mask */ -#define USBHS_DEVIMR_PEP_1 (0x1u << 13) /**< \brief (USBHS_DEVIMR) Endpoint 1 Interrupt Mask */ -#define USBHS_DEVIMR_PEP_2 (0x1u << 14) /**< \brief (USBHS_DEVIMR) Endpoint 2 Interrupt Mask */ -#define USBHS_DEVIMR_PEP_3 (0x1u << 15) /**< \brief (USBHS_DEVIMR) Endpoint 3 Interrupt Mask */ -#define USBHS_DEVIMR_PEP_4 (0x1u << 16) /**< \brief (USBHS_DEVIMR) Endpoint 4 Interrupt Mask */ -#define USBHS_DEVIMR_PEP_5 (0x1u << 17) /**< \brief (USBHS_DEVIMR) Endpoint 5 Interrupt Mask */ -#define USBHS_DEVIMR_PEP_6 (0x1u << 18) /**< \brief (USBHS_DEVIMR) Endpoint 6 Interrupt Mask */ -#define USBHS_DEVIMR_PEP_7 (0x1u << 19) /**< \brief (USBHS_DEVIMR) Endpoint 7 Interrupt Mask */ -#define USBHS_DEVIMR_PEP_8 (0x1u << 20) /**< \brief (USBHS_DEVIMR) Endpoint 8 Interrupt Mask */ -#define USBHS_DEVIMR_PEP_9 (0x1u << 21) /**< \brief (USBHS_DEVIMR) Endpoint 9 Interrupt Mask */ -#define USBHS_DEVIMR_PEP_10 (0x1u << 22) /**< \brief (USBHS_DEVIMR) Endpoint 10 Interrupt Mask */ -#define USBHS_DEVIMR_PEP_11 (0x1u << 23) /**< \brief (USBHS_DEVIMR) Endpoint 11 Interrupt Mask */ -#define USBHS_DEVIMR_DMA_1 (0x1u << 25) /**< \brief (USBHS_DEVIMR) DMA Channel 1 Interrupt Mask */ -#define USBHS_DEVIMR_DMA_2 (0x1u << 26) /**< \brief (USBHS_DEVIMR) DMA Channel 2 Interrupt Mask */ -#define USBHS_DEVIMR_DMA_3 (0x1u << 27) /**< \brief (USBHS_DEVIMR) DMA Channel 3 Interrupt Mask */ -#define USBHS_DEVIMR_DMA_4 (0x1u << 28) /**< \brief (USBHS_DEVIMR) DMA Channel 4 Interrupt Mask */ -#define USBHS_DEVIMR_DMA_5 (0x1u << 29) /**< \brief (USBHS_DEVIMR) DMA Channel 5 Interrupt Mask */ -#define USBHS_DEVIMR_DMA_6 (0x1u << 30) /**< \brief (USBHS_DEVIMR) DMA Channel 6 Interrupt Mask */ -#define USBHS_DEVIMR_DMA_7 (0x1u << 31) /**< \brief (USBHS_DEVIMR) DMA Channel 7 Interrupt Mask */ -/* -------- USBHS_DEVIDR : (USBHS Offset: 0x0014) Device Global Interrupt Disable Register -------- */ -#define USBHS_DEVIDR_SUSPEC (0x1u << 0) /**< \brief (USBHS_DEVIDR) Suspend Interrupt Disable */ -#define USBHS_DEVIDR_MSOFEC (0x1u << 1) /**< \brief (USBHS_DEVIDR) Micro Start of Frame Interrupt Disable */ -#define USBHS_DEVIDR_SOFEC (0x1u << 2) /**< \brief (USBHS_DEVIDR) Start of Frame Interrupt Disable */ -#define USBHS_DEVIDR_EORSTEC (0x1u << 3) /**< \brief (USBHS_DEVIDR) End of Reset Interrupt Disable */ -#define USBHS_DEVIDR_WAKEUPEC (0x1u << 4) /**< \brief (USBHS_DEVIDR) Wake-Up Interrupt Disable */ -#define USBHS_DEVIDR_EORSMEC (0x1u << 5) /**< \brief (USBHS_DEVIDR) End of Resume Interrupt Disable */ -#define USBHS_DEVIDR_UPRSMEC (0x1u << 6) /**< \brief (USBHS_DEVIDR) Upstream Resume Interrupt Disable */ -#define USBHS_DEVIDR_PEP_0 (0x1u << 12) /**< \brief (USBHS_DEVIDR) Endpoint 0 Interrupt Disable */ -#define USBHS_DEVIDR_PEP_1 (0x1u << 13) /**< \brief (USBHS_DEVIDR) Endpoint 1 Interrupt Disable */ -#define USBHS_DEVIDR_PEP_2 (0x1u << 14) /**< \brief (USBHS_DEVIDR) Endpoint 2 Interrupt Disable */ -#define USBHS_DEVIDR_PEP_3 (0x1u << 15) /**< \brief (USBHS_DEVIDR) Endpoint 3 Interrupt Disable */ -#define USBHS_DEVIDR_PEP_4 (0x1u << 16) /**< \brief (USBHS_DEVIDR) Endpoint 4 Interrupt Disable */ -#define USBHS_DEVIDR_PEP_5 (0x1u << 17) /**< \brief (USBHS_DEVIDR) Endpoint 5 Interrupt Disable */ -#define USBHS_DEVIDR_PEP_6 (0x1u << 18) /**< \brief (USBHS_DEVIDR) Endpoint 6 Interrupt Disable */ -#define USBHS_DEVIDR_PEP_7 (0x1u << 19) /**< \brief (USBHS_DEVIDR) Endpoint 7 Interrupt Disable */ -#define USBHS_DEVIDR_PEP_8 (0x1u << 20) /**< \brief (USBHS_DEVIDR) Endpoint 8 Interrupt Disable */ -#define USBHS_DEVIDR_PEP_9 (0x1u << 21) /**< \brief (USBHS_DEVIDR) Endpoint 9 Interrupt Disable */ -#define USBHS_DEVIDR_PEP_10 (0x1u << 22) /**< \brief (USBHS_DEVIDR) Endpoint 10 Interrupt Disable */ -#define USBHS_DEVIDR_PEP_11 (0x1u << 23) /**< \brief (USBHS_DEVIDR) Endpoint 11 Interrupt Disable */ -#define USBHS_DEVIDR_DMA_1 (0x1u << 25) /**< \brief (USBHS_DEVIDR) DMA Channel 1 Interrupt Disable */ -#define USBHS_DEVIDR_DMA_2 (0x1u << 26) /**< \brief (USBHS_DEVIDR) DMA Channel 2 Interrupt Disable */ -#define USBHS_DEVIDR_DMA_3 (0x1u << 27) /**< \brief (USBHS_DEVIDR) DMA Channel 3 Interrupt Disable */ -#define USBHS_DEVIDR_DMA_4 (0x1u << 28) /**< \brief (USBHS_DEVIDR) DMA Channel 4 Interrupt Disable */ -#define USBHS_DEVIDR_DMA_5 (0x1u << 29) /**< \brief (USBHS_DEVIDR) DMA Channel 5 Interrupt Disable */ -#define USBHS_DEVIDR_DMA_6 (0x1u << 30) /**< \brief (USBHS_DEVIDR) DMA Channel 6 Interrupt Disable */ -#define USBHS_DEVIDR_DMA_7 (0x1u << 31) /**< \brief (USBHS_DEVIDR) DMA Channel 7 Interrupt Disable */ -/* -------- USBHS_DEVIER : (USBHS Offset: 0x0018) Device Global Interrupt Enable Register -------- */ -#define USBHS_DEVIER_SUSPES (0x1u << 0) /**< \brief (USBHS_DEVIER) Suspend Interrupt Enable */ -#define USBHS_DEVIER_MSOFES (0x1u << 1) /**< \brief (USBHS_DEVIER) Micro Start of Frame Interrupt Enable */ -#define USBHS_DEVIER_SOFES (0x1u << 2) /**< \brief (USBHS_DEVIER) Start of Frame Interrupt Enable */ -#define USBHS_DEVIER_EORSTES (0x1u << 3) /**< \brief (USBHS_DEVIER) End of Reset Interrupt Enable */ -#define USBHS_DEVIER_WAKEUPES (0x1u << 4) /**< \brief (USBHS_DEVIER) Wake-Up Interrupt Enable */ -#define USBHS_DEVIER_EORSMES (0x1u << 5) /**< \brief (USBHS_DEVIER) End of Resume Interrupt Enable */ -#define USBHS_DEVIER_UPRSMES (0x1u << 6) /**< \brief (USBHS_DEVIER) Upstream Resume Interrupt Enable */ -#define USBHS_DEVIER_PEP_0 (0x1u << 12) /**< \brief (USBHS_DEVIER) Endpoint 0 Interrupt Enable */ -#define USBHS_DEVIER_PEP_1 (0x1u << 13) /**< \brief (USBHS_DEVIER) Endpoint 1 Interrupt Enable */ -#define USBHS_DEVIER_PEP_2 (0x1u << 14) /**< \brief (USBHS_DEVIER) Endpoint 2 Interrupt Enable */ -#define USBHS_DEVIER_PEP_3 (0x1u << 15) /**< \brief (USBHS_DEVIER) Endpoint 3 Interrupt Enable */ -#define USBHS_DEVIER_PEP_4 (0x1u << 16) /**< \brief (USBHS_DEVIER) Endpoint 4 Interrupt Enable */ -#define USBHS_DEVIER_PEP_5 (0x1u << 17) /**< \brief (USBHS_DEVIER) Endpoint 5 Interrupt Enable */ -#define USBHS_DEVIER_PEP_6 (0x1u << 18) /**< \brief (USBHS_DEVIER) Endpoint 6 Interrupt Enable */ -#define USBHS_DEVIER_PEP_7 (0x1u << 19) /**< \brief (USBHS_DEVIER) Endpoint 7 Interrupt Enable */ -#define USBHS_DEVIER_PEP_8 (0x1u << 20) /**< \brief (USBHS_DEVIER) Endpoint 8 Interrupt Enable */ -#define USBHS_DEVIER_PEP_9 (0x1u << 21) /**< \brief (USBHS_DEVIER) Endpoint 9 Interrupt Enable */ -#define USBHS_DEVIER_PEP_10 (0x1u << 22) /**< \brief (USBHS_DEVIER) Endpoint 10 Interrupt Enable */ -#define USBHS_DEVIER_PEP_11 (0x1u << 23) /**< \brief (USBHS_DEVIER) Endpoint 11 Interrupt Enable */ -#define USBHS_DEVIER_DMA_1 (0x1u << 25) /**< \brief (USBHS_DEVIER) DMA Channel 1 Interrupt Enable */ -#define USBHS_DEVIER_DMA_2 (0x1u << 26) /**< \brief (USBHS_DEVIER) DMA Channel 2 Interrupt Enable */ -#define USBHS_DEVIER_DMA_3 (0x1u << 27) /**< \brief (USBHS_DEVIER) DMA Channel 3 Interrupt Enable */ -#define USBHS_DEVIER_DMA_4 (0x1u << 28) /**< \brief (USBHS_DEVIER) DMA Channel 4 Interrupt Enable */ -#define USBHS_DEVIER_DMA_5 (0x1u << 29) /**< \brief (USBHS_DEVIER) DMA Channel 5 Interrupt Enable */ -#define USBHS_DEVIER_DMA_6 (0x1u << 30) /**< \brief (USBHS_DEVIER) DMA Channel 6 Interrupt Enable */ -#define USBHS_DEVIER_DMA_7 (0x1u << 31) /**< \brief (USBHS_DEVIER) DMA Channel 7 Interrupt Enable */ -/* -------- USBHS_DEVEPT : (USBHS Offset: 0x001C) Device Endpoint Register -------- */ -#define USBHS_DEVEPT_EPEN0 (0x1u << 0) /**< \brief (USBHS_DEVEPT) Endpoint 0 Enable */ -#define USBHS_DEVEPT_EPEN1 (0x1u << 1) /**< \brief (USBHS_DEVEPT) Endpoint 1 Enable */ -#define USBHS_DEVEPT_EPEN2 (0x1u << 2) /**< \brief (USBHS_DEVEPT) Endpoint 2 Enable */ -#define USBHS_DEVEPT_EPEN3 (0x1u << 3) /**< \brief (USBHS_DEVEPT) Endpoint 3 Enable */ -#define USBHS_DEVEPT_EPEN4 (0x1u << 4) /**< \brief (USBHS_DEVEPT) Endpoint 4 Enable */ -#define USBHS_DEVEPT_EPEN5 (0x1u << 5) /**< \brief (USBHS_DEVEPT) Endpoint 5 Enable */ -#define USBHS_DEVEPT_EPEN6 (0x1u << 6) /**< \brief (USBHS_DEVEPT) Endpoint 6 Enable */ -#define USBHS_DEVEPT_EPEN7 (0x1u << 7) /**< \brief (USBHS_DEVEPT) Endpoint 7 Enable */ -#define USBHS_DEVEPT_EPEN8 (0x1u << 8) /**< \brief (USBHS_DEVEPT) Endpoint 8 Enable */ -#define USBHS_DEVEPT_EPRST0 (0x1u << 16) /**< \brief (USBHS_DEVEPT) Endpoint 0 Reset */ -#define USBHS_DEVEPT_EPRST1 (0x1u << 17) /**< \brief (USBHS_DEVEPT) Endpoint 1 Reset */ -#define USBHS_DEVEPT_EPRST2 (0x1u << 18) /**< \brief (USBHS_DEVEPT) Endpoint 2 Reset */ -#define USBHS_DEVEPT_EPRST3 (0x1u << 19) /**< \brief (USBHS_DEVEPT) Endpoint 3 Reset */ -#define USBHS_DEVEPT_EPRST4 (0x1u << 20) /**< \brief (USBHS_DEVEPT) Endpoint 4 Reset */ -#define USBHS_DEVEPT_EPRST5 (0x1u << 21) /**< \brief (USBHS_DEVEPT) Endpoint 5 Reset */ -#define USBHS_DEVEPT_EPRST6 (0x1u << 22) /**< \brief (USBHS_DEVEPT) Endpoint 6 Reset */ -#define USBHS_DEVEPT_EPRST7 (0x1u << 23) /**< \brief (USBHS_DEVEPT) Endpoint 7 Reset */ -#define USBHS_DEVEPT_EPRST8 (0x1u << 24) /**< \brief (USBHS_DEVEPT) Endpoint 8 Reset */ -/* -------- USBHS_DEVFNUM : (USBHS Offset: 0x0020) Device Frame Number Register -------- */ -#define USBHS_DEVFNUM_MFNUM_Pos 0 -#define USBHS_DEVFNUM_MFNUM_Msk (0x7u << USBHS_DEVFNUM_MFNUM_Pos) /**< \brief (USBHS_DEVFNUM) Micro Frame Number */ -#define USBHS_DEVFNUM_FNUM_Pos 3 -#define USBHS_DEVFNUM_FNUM_Msk (0x7ffu << USBHS_DEVFNUM_FNUM_Pos) /**< \brief (USBHS_DEVFNUM) Frame Number */ -#define USBHS_DEVFNUM_FNCERR (0x1u << 15) /**< \brief (USBHS_DEVFNUM) Frame Number CRC Error */ -/* -------- USBHS_DEVEPTCFG[10] : (USBHS Offset: 0x100) Device Endpoint Configuration Register (n = 0) -------- */ -#define USBHS_DEVEPTCFG_ALLOC (0x1u << 1) /**< \brief (USBHS_DEVEPTCFG[10]) Endpoint Memory Allocate */ -#define USBHS_DEVEPTCFG_EPBK_Pos 2 -#define USBHS_DEVEPTCFG_EPBK_Msk (0x3u << USBHS_DEVEPTCFG_EPBK_Pos) /**< \brief (USBHS_DEVEPTCFG[10]) Endpoint Banks */ -#define USBHS_DEVEPTCFG_EPBK(value) ((USBHS_DEVEPTCFG_EPBK_Msk & ((value) << USBHS_DEVEPTCFG_EPBK_Pos))) -#define USBHS_DEVEPTCFG_EPBK_1_BANK (0x0u << 2) /**< \brief (USBHS_DEVEPTCFG[10]) Single-bank endpoint */ -#define USBHS_DEVEPTCFG_EPBK_2_BANK (0x1u << 2) /**< \brief (USBHS_DEVEPTCFG[10]) Double-bank endpoint */ -#define USBHS_DEVEPTCFG_EPBK_3_BANK (0x2u << 2) /**< \brief (USBHS_DEVEPTCFG[10]) Triple-bank endpoint */ -#define USBHS_DEVEPTCFG_EPSIZE_Pos 4 -#define USBHS_DEVEPTCFG_EPSIZE_Msk (0x7u << USBHS_DEVEPTCFG_EPSIZE_Pos) /**< \brief (USBHS_DEVEPTCFG[10]) Endpoint Size */ -#define USBHS_DEVEPTCFG_EPSIZE(value) ((USBHS_DEVEPTCFG_EPSIZE_Msk & ((value) << USBHS_DEVEPTCFG_EPSIZE_Pos))) -#define USBHS_DEVEPTCFG_EPSIZE_8_BYTE (0x0u << 4) /**< \brief (USBHS_DEVEPTCFG[10]) 8 bytes */ -#define USBHS_DEVEPTCFG_EPSIZE_16_BYTE (0x1u << 4) /**< \brief (USBHS_DEVEPTCFG[10]) 16 bytes */ -#define USBHS_DEVEPTCFG_EPSIZE_32_BYTE (0x2u << 4) /**< \brief (USBHS_DEVEPTCFG[10]) 32 bytes */ -#define USBHS_DEVEPTCFG_EPSIZE_64_BYTE (0x3u << 4) /**< \brief (USBHS_DEVEPTCFG[10]) 64 bytes */ -#define USBHS_DEVEPTCFG_EPSIZE_128_BYTE (0x4u << 4) /**< \brief (USBHS_DEVEPTCFG[10]) 128 bytes */ -#define USBHS_DEVEPTCFG_EPSIZE_256_BYTE (0x5u << 4) /**< \brief (USBHS_DEVEPTCFG[10]) 256 bytes */ -#define USBHS_DEVEPTCFG_EPSIZE_512_BYTE (0x6u << 4) /**< \brief (USBHS_DEVEPTCFG[10]) 512 bytes */ -#define USBHS_DEVEPTCFG_EPSIZE_1024_BYTE (0x7u << 4) /**< \brief (USBHS_DEVEPTCFG[10]) 1024 bytes */ -#define USBHS_DEVEPTCFG_EPDIR (0x1u << 8) /**< \brief (USBHS_DEVEPTCFG[10]) Endpoint Direction */ -#define USBHS_DEVEPTCFG_EPDIR_OUT (0x0u << 8) /**< \brief (USBHS_DEVEPTCFG[10]) The endpoint direction is OUT. */ -#define USBHS_DEVEPTCFG_EPDIR_IN (0x1u << 8) /**< \brief (USBHS_DEVEPTCFG[10]) The endpoint direction is IN (nor for control endpoints). */ -#define USBHS_DEVEPTCFG_AUTOSW (0x1u << 9) /**< \brief (USBHS_DEVEPTCFG[10]) Automatic Switch */ -#define USBHS_DEVEPTCFG_EPTYPE_Pos 11 -#define USBHS_DEVEPTCFG_EPTYPE_Msk (0x3u << USBHS_DEVEPTCFG_EPTYPE_Pos) /**< \brief (USBHS_DEVEPTCFG[10]) Endpoint Type */ -#define USBHS_DEVEPTCFG_EPTYPE(value) ((USBHS_DEVEPTCFG_EPTYPE_Msk & ((value) << USBHS_DEVEPTCFG_EPTYPE_Pos))) -#define USBHS_DEVEPTCFG_EPTYPE_CTRL (0x0u << 11) /**< \brief (USBHS_DEVEPTCFG[10]) Control */ -#define USBHS_DEVEPTCFG_EPTYPE_ISO (0x1u << 11) /**< \brief (USBHS_DEVEPTCFG[10]) Isochronous */ -#define USBHS_DEVEPTCFG_EPTYPE_BLK (0x2u << 11) /**< \brief (USBHS_DEVEPTCFG[10]) Bulk */ -#define USBHS_DEVEPTCFG_EPTYPE_INTRPT (0x3u << 11) /**< \brief (USBHS_DEVEPTCFG[10]) Interrupt */ -#define USBHS_DEVEPTCFG_NBTRANS_Pos 13 -#define USBHS_DEVEPTCFG_NBTRANS_Msk (0x3u << USBHS_DEVEPTCFG_NBTRANS_Pos) /**< \brief (USBHS_DEVEPTCFG[10]) Number of transactions per microframe for isochronous endpoint */ -#define USBHS_DEVEPTCFG_NBTRANS(value) ((USBHS_DEVEPTCFG_NBTRANS_Msk & ((value) << USBHS_DEVEPTCFG_NBTRANS_Pos))) -#define USBHS_DEVEPTCFG_NBTRANS_0_TRANS (0x0u << 13) /**< \brief (USBHS_DEVEPTCFG[10]) Reserved to endpoint that does not have the high-bandwidth isochronous capability. */ -#define USBHS_DEVEPTCFG_NBTRANS_1_TRANS (0x1u << 13) /**< \brief (USBHS_DEVEPTCFG[10]) Default value: one transaction per microframe. */ -#define USBHS_DEVEPTCFG_NBTRANS_2_TRANS (0x2u << 13) /**< \brief (USBHS_DEVEPTCFG[10]) Two transactions per microframe. This endpoint should be configured as double-bank. */ -#define USBHS_DEVEPTCFG_NBTRANS_3_TRANS (0x3u << 13) /**< \brief (USBHS_DEVEPTCFG[10]) Three transactions per microframe. This endpoint should be configured as triple-bank. */ -/* -------- USBHS_DEVEPTISR[10] : (USBHS Offset: 0x130) Device Endpoint Status Register (n = 0) -------- */ -#define USBHS_DEVEPTISR_TXINI (0x1u << 0) /**< \brief (USBHS_DEVEPTISR[10]) Transmitted IN Data Interrupt */ -#define USBHS_DEVEPTISR_RXOUTI (0x1u << 1) /**< \brief (USBHS_DEVEPTISR[10]) Received OUT Data Interrupt */ -#define USBHS_DEVEPTISR_RXSTPI (0x1u << 2) /**< \brief (USBHS_DEVEPTISR[10]) Received SETUP Interrupt */ -#define USBHS_DEVEPTISR_NAKOUTI (0x1u << 3) /**< \brief (USBHS_DEVEPTISR[10]) NAKed OUT Interrupt */ -#define USBHS_DEVEPTISR_NAKINI (0x1u << 4) /**< \brief (USBHS_DEVEPTISR[10]) NAKed IN Interrupt */ -#define USBHS_DEVEPTISR_OVERFI (0x1u << 5) /**< \brief (USBHS_DEVEPTISR[10]) Overflow Interrupt */ -#define USBHS_DEVEPTISR_STALLEDI (0x1u << 6) /**< \brief (USBHS_DEVEPTISR[10]) STALLed Interrupt */ -#define USBHS_DEVEPTISR_SHORTPACKET (0x1u << 7) /**< \brief (USBHS_DEVEPTISR[10]) Short Packet Interrupt */ -#define USBHS_DEVEPTISR_DTSEQ_Pos 8 -#define USBHS_DEVEPTISR_DTSEQ_Msk (0x3u << USBHS_DEVEPTISR_DTSEQ_Pos) /**< \brief (USBHS_DEVEPTISR[10]) Data Toggle Sequence */ -#define USBHS_DEVEPTISR_DTSEQ_DATA0 (0x0u << 8) /**< \brief (USBHS_DEVEPTISR[10]) Data0 toggle sequence */ -#define USBHS_DEVEPTISR_DTSEQ_DATA1 (0x1u << 8) /**< \brief (USBHS_DEVEPTISR[10]) Data1 toggle sequence */ -#define USBHS_DEVEPTISR_DTSEQ_DATA2 (0x2u << 8) /**< \brief (USBHS_DEVEPTISR[10]) Reserved for high-bandwidth isochronous endpoint */ -#define USBHS_DEVEPTISR_DTSEQ_MDATA (0x3u << 8) /**< \brief (USBHS_DEVEPTISR[10]) Reserved for high-bandwidth isochronous endpoint */ -#define USBHS_DEVEPTISR_NBUSYBK_Pos 12 -#define USBHS_DEVEPTISR_NBUSYBK_Msk (0x3u << USBHS_DEVEPTISR_NBUSYBK_Pos) /**< \brief (USBHS_DEVEPTISR[10]) Number of Busy Banks */ -#define USBHS_DEVEPTISR_NBUSYBK_0_BUSY (0x0u << 12) /**< \brief (USBHS_DEVEPTISR[10]) 0 busy bank (all banks free) */ -#define USBHS_DEVEPTISR_NBUSYBK_1_BUSY (0x1u << 12) /**< \brief (USBHS_DEVEPTISR[10]) 1 busy bank */ -#define USBHS_DEVEPTISR_NBUSYBK_2_BUSY (0x2u << 12) /**< \brief (USBHS_DEVEPTISR[10]) 2 busy banks */ -#define USBHS_DEVEPTISR_NBUSYBK_3_BUSY (0x3u << 12) /**< \brief (USBHS_DEVEPTISR[10]) 3 busy banks */ -#define USBHS_DEVEPTISR_CURRBK_Pos 14 -#define USBHS_DEVEPTISR_CURRBK_Msk (0x3u << USBHS_DEVEPTISR_CURRBK_Pos) /**< \brief (USBHS_DEVEPTISR[10]) Current Bank */ -#define USBHS_DEVEPTISR_CURRBK_BANK0 (0x0u << 14) /**< \brief (USBHS_DEVEPTISR[10]) Current bank is bank0 */ -#define USBHS_DEVEPTISR_CURRBK_BANK1 (0x1u << 14) /**< \brief (USBHS_DEVEPTISR[10]) Current bank is bank1 */ -#define USBHS_DEVEPTISR_CURRBK_BANK2 (0x2u << 14) /**< \brief (USBHS_DEVEPTISR[10]) Current bank is bank2 */ -#define USBHS_DEVEPTISR_RWALL (0x1u << 16) /**< \brief (USBHS_DEVEPTISR[10]) Read/Write Allowed */ -#define USBHS_DEVEPTISR_CTRLDIR (0x1u << 17) /**< \brief (USBHS_DEVEPTISR[10]) Control Direction */ -#define USBHS_DEVEPTISR_CFGOK (0x1u << 18) /**< \brief (USBHS_DEVEPTISR[10]) Configuration OK Status */ -#define USBHS_DEVEPTISR_BYCT_Pos 20 -#define USBHS_DEVEPTISR_BYCT_Msk (0x7ffu << USBHS_DEVEPTISR_BYCT_Pos) /**< \brief (USBHS_DEVEPTISR[10]) Byte Count */ -#define USBHS_DEVEPTISR_UNDERFI (0x1u << 2) /**< \brief (USBHS_DEVEPTISR[10]) Underflow Interrupt */ -#define USBHS_DEVEPTISR_HBISOINERRI (0x1u << 3) /**< \brief (USBHS_DEVEPTISR[10]) High Bandwidth Isochronous IN Underflow Error Interrupt */ -#define USBHS_DEVEPTISR_HBISOFLUSHI (0x1u << 4) /**< \brief (USBHS_DEVEPTISR[10]) High Bandwidth Isochronous IN Flush Interrupt */ -#define USBHS_DEVEPTISR_CRCERRI (0x1u << 6) /**< \brief (USBHS_DEVEPTISR[10]) CRC Error Interrupt */ -#define USBHS_DEVEPTISR_ERRORTRANS (0x1u << 10) /**< \brief (USBHS_DEVEPTISR[10]) High-bandwidth Isochronous OUT Endpoint Transaction Error Interrupt */ -/* -------- USBHS_DEVEPTICR[10] : (USBHS Offset: 0x160) Device Endpoint Clear Register (n = 0) -------- */ -#define USBHS_DEVEPTICR_TXINIC (0x1u << 0) /**< \brief (USBHS_DEVEPTICR[10]) Transmitted IN Data Interrupt Clear */ -#define USBHS_DEVEPTICR_RXOUTIC (0x1u << 1) /**< \brief (USBHS_DEVEPTICR[10]) Received OUT Data Interrupt Clear */ -#define USBHS_DEVEPTICR_RXSTPIC (0x1u << 2) /**< \brief (USBHS_DEVEPTICR[10]) Received SETUP Interrupt Clear */ -#define USBHS_DEVEPTICR_NAKOUTIC (0x1u << 3) /**< \brief (USBHS_DEVEPTICR[10]) NAKed OUT Interrupt Clear */ -#define USBHS_DEVEPTICR_NAKINIC (0x1u << 4) /**< \brief (USBHS_DEVEPTICR[10]) NAKed IN Interrupt Clear */ -#define USBHS_DEVEPTICR_OVERFIC (0x1u << 5) /**< \brief (USBHS_DEVEPTICR[10]) Overflow Interrupt Clear */ -#define USBHS_DEVEPTICR_STALLEDIC (0x1u << 6) /**< \brief (USBHS_DEVEPTICR[10]) STALLed Interrupt Clear */ -#define USBHS_DEVEPTICR_SHORTPACKETC (0x1u << 7) /**< \brief (USBHS_DEVEPTICR[10]) Short Packet Interrupt Clear */ -#define USBHS_DEVEPTICR_UNDERFIC (0x1u << 2) /**< \brief (USBHS_DEVEPTICR[10]) Underflow Interrupt Clear */ -#define USBHS_DEVEPTICR_HBISOINERRIC (0x1u << 3) /**< \brief (USBHS_DEVEPTICR[10]) High Bandwidth Isochronous IN Underflow Error Interrupt Clear */ -#define USBHS_DEVEPTICR_HBISOFLUSHIC (0x1u << 4) /**< \brief (USBHS_DEVEPTICR[10]) High Bandwidth Isochronous IN Flush Interrupt Clear */ -#define USBHS_DEVEPTICR_CRCERRIC (0x1u << 6) /**< \brief (USBHS_DEVEPTICR[10]) CRC Error Interrupt Clear */ -/* -------- USBHS_DEVEPTIFR[10] : (USBHS Offset: 0x190) Device Endpoint Set Register (n = 0) -------- */ -#define USBHS_DEVEPTIFR_TXINIS (0x1u << 0) /**< \brief (USBHS_DEVEPTIFR[10]) Transmitted IN Data Interrupt Set */ -#define USBHS_DEVEPTIFR_RXOUTIS (0x1u << 1) /**< \brief (USBHS_DEVEPTIFR[10]) Received OUT Data Interrupt Set */ -#define USBHS_DEVEPTIFR_RXSTPIS (0x1u << 2) /**< \brief (USBHS_DEVEPTIFR[10]) Received SETUP Interrupt Set */ -#define USBHS_DEVEPTIFR_NAKOUTIS (0x1u << 3) /**< \brief (USBHS_DEVEPTIFR[10]) NAKed OUT Interrupt Set */ -#define USBHS_DEVEPTIFR_NAKINIS (0x1u << 4) /**< \brief (USBHS_DEVEPTIFR[10]) NAKed IN Interrupt Set */ -#define USBHS_DEVEPTIFR_OVERFIS (0x1u << 5) /**< \brief (USBHS_DEVEPTIFR[10]) Overflow Interrupt Set */ -#define USBHS_DEVEPTIFR_STALLEDIS (0x1u << 6) /**< \brief (USBHS_DEVEPTIFR[10]) STALLed Interrupt Set */ -#define USBHS_DEVEPTIFR_SHORTPACKETS (0x1u << 7) /**< \brief (USBHS_DEVEPTIFR[10]) Short Packet Interrupt Set */ -#define USBHS_DEVEPTIFR_NBUSYBKS (0x1u << 12) /**< \brief (USBHS_DEVEPTIFR[10]) Number of Busy Banks Interrupt Set */ -#define USBHS_DEVEPTIFR_UNDERFIS (0x1u << 2) /**< \brief (USBHS_DEVEPTIFR[10]) Underflow Interrupt Set */ -#define USBHS_DEVEPTIFR_HBISOINERRIS (0x1u << 3) /**< \brief (USBHS_DEVEPTIFR[10]) High Bandwidth Isochronous IN Underflow Error Interrupt Set */ -#define USBHS_DEVEPTIFR_HBISOFLUSHIS (0x1u << 4) /**< \brief (USBHS_DEVEPTIFR[10]) High Bandwidth Isochronous IN Flush Interrupt Set */ -#define USBHS_DEVEPTIFR_CRCERRIS (0x1u << 6) /**< \brief (USBHS_DEVEPTIFR[10]) CRC Error Interrupt Set */ -/* -------- USBHS_DEVEPTIMR[10] : (USBHS Offset: 0x1C0) Device Endpoint Mask Register (n = 0) -------- */ -#define USBHS_DEVEPTIMR_TXINE (0x1u << 0) /**< \brief (USBHS_DEVEPTIMR[10]) Transmitted IN Data Interrupt */ -#define USBHS_DEVEPTIMR_RXOUTE (0x1u << 1) /**< \brief (USBHS_DEVEPTIMR[10]) Received OUT Data Interrupt */ -#define USBHS_DEVEPTIMR_RXSTPE (0x1u << 2) /**< \brief (USBHS_DEVEPTIMR[10]) Received SETUP Interrupt */ -#define USBHS_DEVEPTIMR_NAKOUTE (0x1u << 3) /**< \brief (USBHS_DEVEPTIMR[10]) NAKed OUT Interrupt */ -#define USBHS_DEVEPTIMR_NAKINE (0x1u << 4) /**< \brief (USBHS_DEVEPTIMR[10]) NAKed IN Interrupt */ -#define USBHS_DEVEPTIMR_OVERFE (0x1u << 5) /**< \brief (USBHS_DEVEPTIMR[10]) Overflow Interrupt */ -#define USBHS_DEVEPTIMR_STALLEDE (0x1u << 6) /**< \brief (USBHS_DEVEPTIMR[10]) STALLed Interrupt */ -#define USBHS_DEVEPTIMR_SHORTPACKETE (0x1u << 7) /**< \brief (USBHS_DEVEPTIMR[10]) Short Packet Interrupt */ -#define USBHS_DEVEPTIMR_NBUSYBKE (0x1u << 12) /**< \brief (USBHS_DEVEPTIMR[10]) Number of Busy Banks Interrupt */ -#define USBHS_DEVEPTIMR_KILLBK (0x1u << 13) /**< \brief (USBHS_DEVEPTIMR[10]) Kill IN Bank */ -#define USBHS_DEVEPTIMR_FIFOCON (0x1u << 14) /**< \brief (USBHS_DEVEPTIMR[10]) FIFO Control */ -#define USBHS_DEVEPTIMR_EPDISHDMA (0x1u << 16) /**< \brief (USBHS_DEVEPTIMR[10]) Endpoint Interrupts Disable HDMA Request */ -#define USBHS_DEVEPTIMR_NYETDIS (0x1u << 17) /**< \brief (USBHS_DEVEPTIMR[10]) NYET Token Disable */ -#define USBHS_DEVEPTIMR_RSTDT (0x1u << 18) /**< \brief (USBHS_DEVEPTIMR[10]) Reset Data Toggle */ -#define USBHS_DEVEPTIMR_STALLRQ (0x1u << 19) /**< \brief (USBHS_DEVEPTIMR[10]) STALL Request */ -#define USBHS_DEVEPTIMR_UNDERFE (0x1u << 2) /**< \brief (USBHS_DEVEPTIMR[10]) Underflow Interrupt */ -#define USBHS_DEVEPTIMR_HBISOINERRE (0x1u << 3) /**< \brief (USBHS_DEVEPTIMR[10]) High Bandwidth Isochronous IN Error Interrupt */ -#define USBHS_DEVEPTIMR_HBISOFLUSHE (0x1u << 4) /**< \brief (USBHS_DEVEPTIMR[10]) High Bandwidth Isochronous IN Flush Interrupt */ -#define USBHS_DEVEPTIMR_CRCERRE (0x1u << 6) /**< \brief (USBHS_DEVEPTIMR[10]) CRC Error Interrupt */ -#define USBHS_DEVEPTIMR_MDATAE (0x1u << 8) /**< \brief (USBHS_DEVEPTIMR[10]) MData Interrupt */ -#define USBHS_DEVEPTIMR_DATAXE (0x1u << 9) /**< \brief (USBHS_DEVEPTIMR[10]) DataX Interrupt */ -#define USBHS_DEVEPTIMR_ERRORTRANSE (0x1u << 10) /**< \brief (USBHS_DEVEPTIMR[10]) Transaction Error Interrupt */ -/* -------- USBHS_DEVEPTIER[10] : (USBHS Offset: 0x1F0) Device Endpoint Enable Register (n = 0) -------- */ -#define USBHS_DEVEPTIER_TXINES (0x1u << 0) /**< \brief (USBHS_DEVEPTIER[10]) Transmitted IN Data Interrupt Enable */ -#define USBHS_DEVEPTIER_RXOUTES (0x1u << 1) /**< \brief (USBHS_DEVEPTIER[10]) Received OUT Data Interrupt Enable */ -#define USBHS_DEVEPTIER_RXSTPES (0x1u << 2) /**< \brief (USBHS_DEVEPTIER[10]) Received SETUP Interrupt Enable */ -#define USBHS_DEVEPTIER_NAKOUTES (0x1u << 3) /**< \brief (USBHS_DEVEPTIER[10]) NAKed OUT Interrupt Enable */ -#define USBHS_DEVEPTIER_NAKINES (0x1u << 4) /**< \brief (USBHS_DEVEPTIER[10]) NAKed IN Interrupt Enable */ -#define USBHS_DEVEPTIER_OVERFES (0x1u << 5) /**< \brief (USBHS_DEVEPTIER[10]) Overflow Interrupt Enable */ -#define USBHS_DEVEPTIER_STALLEDES (0x1u << 6) /**< \brief (USBHS_DEVEPTIER[10]) STALLed Interrupt Enable */ -#define USBHS_DEVEPTIER_SHORTPACKETES (0x1u << 7) /**< \brief (USBHS_DEVEPTIER[10]) Short Packet Interrupt Enable */ -#define USBHS_DEVEPTIER_NBUSYBKES (0x1u << 12) /**< \brief (USBHS_DEVEPTIER[10]) Number of Busy Banks Interrupt Enable */ -#define USBHS_DEVEPTIER_KILLBKS (0x1u << 13) /**< \brief (USBHS_DEVEPTIER[10]) Kill IN Bank */ -#define USBHS_DEVEPTIER_FIFOCONS (0x1u << 14) /**< \brief (USBHS_DEVEPTIER[10]) FIFO Control */ -#define USBHS_DEVEPTIER_EPDISHDMAS (0x1u << 16) /**< \brief (USBHS_DEVEPTIER[10]) Endpoint Interrupts Disable HDMA Request Enable */ -#define USBHS_DEVEPTIER_NYETDISS (0x1u << 17) /**< \brief (USBHS_DEVEPTIER[10]) NYET Token Disable Enable */ -#define USBHS_DEVEPTIER_RSTDTS (0x1u << 18) /**< \brief (USBHS_DEVEPTIER[10]) Reset Data Toggle Enable */ -#define USBHS_DEVEPTIER_STALLRQS (0x1u << 19) /**< \brief (USBHS_DEVEPTIER[10]) STALL Request Enable */ -#define USBHS_DEVEPTIER_UNDERFES (0x1u << 2) /**< \brief (USBHS_DEVEPTIER[10]) Underflow Interrupt Enable */ -#define USBHS_DEVEPTIER_HBISOINERRES (0x1u << 3) /**< \brief (USBHS_DEVEPTIER[10]) High Bandwidth Isochronous IN Error Interrupt Enable */ -#define USBHS_DEVEPTIER_HBISOFLUSHES (0x1u << 4) /**< \brief (USBHS_DEVEPTIER[10]) High Bandwidth Isochronous IN Flush Interrupt Enable */ -#define USBHS_DEVEPTIER_CRCERRES (0x1u << 6) /**< \brief (USBHS_DEVEPTIER[10]) CRC Error Interrupt Enable */ -#define USBHS_DEVEPTIER_MDATAES (0x1u << 8) /**< \brief (USBHS_DEVEPTIER[10]) MData Interrupt Enable */ -#define USBHS_DEVEPTIER_DATAXES (0x1u << 9) /**< \brief (USBHS_DEVEPTIER[10]) DataX Interrupt Enable */ -#define USBHS_DEVEPTIER_ERRORTRANSES (0x1u << 10) /**< \brief (USBHS_DEVEPTIER[10]) Transaction Error Interrupt Enable */ -/* -------- USBHS_DEVEPTIDR[10] : (USBHS Offset: 0x220) Device Endpoint Disable Register (n = 0) -------- */ -#define USBHS_DEVEPTIDR_TXINEC (0x1u << 0) /**< \brief (USBHS_DEVEPTIDR[10]) Transmitted IN Interrupt Clear */ -#define USBHS_DEVEPTIDR_RXOUTEC (0x1u << 1) /**< \brief (USBHS_DEVEPTIDR[10]) Received OUT Data Interrupt Clear */ -#define USBHS_DEVEPTIDR_RXSTPEC (0x1u << 2) /**< \brief (USBHS_DEVEPTIDR[10]) Received SETUP Interrupt Clear */ -#define USBHS_DEVEPTIDR_NAKOUTEC (0x1u << 3) /**< \brief (USBHS_DEVEPTIDR[10]) NAKed OUT Interrupt Clear */ -#define USBHS_DEVEPTIDR_NAKINEC (0x1u << 4) /**< \brief (USBHS_DEVEPTIDR[10]) NAKed IN Interrupt Clear */ -#define USBHS_DEVEPTIDR_OVERFEC (0x1u << 5) /**< \brief (USBHS_DEVEPTIDR[10]) Overflow Interrupt Clear */ -#define USBHS_DEVEPTIDR_STALLEDEC (0x1u << 6) /**< \brief (USBHS_DEVEPTIDR[10]) STALLed Interrupt Clear */ -#define USBHS_DEVEPTIDR_SHORTPACKETEC (0x1u << 7) /**< \brief (USBHS_DEVEPTIDR[10]) Shortpacket Interrupt Clear */ -#define USBHS_DEVEPTIDR_NBUSYBKEC (0x1u << 12) /**< \brief (USBHS_DEVEPTIDR[10]) Number of Busy Banks Interrupt Clear */ -#define USBHS_DEVEPTIDR_FIFOCONC (0x1u << 14) /**< \brief (USBHS_DEVEPTIDR[10]) FIFO Control Clear */ -#define USBHS_DEVEPTIDR_EPDISHDMAC (0x1u << 16) /**< \brief (USBHS_DEVEPTIDR[10]) Endpoint Interrupts Disable HDMA Request Clear */ -#define USBHS_DEVEPTIDR_NYETDISC (0x1u << 17) /**< \brief (USBHS_DEVEPTIDR[10]) NYET Token Disable Clear */ -#define USBHS_DEVEPTIDR_STALLRQC (0x1u << 19) /**< \brief (USBHS_DEVEPTIDR[10]) STALL Request Clear */ -#define USBHS_DEVEPTIDR_UNDERFEC (0x1u << 2) /**< \brief (USBHS_DEVEPTIDR[10]) Underflow Interrupt Clear */ -#define USBHS_DEVEPTIDR_HBISOINERREC (0x1u << 3) /**< \brief (USBHS_DEVEPTIDR[10]) High Bandwidth Isochronous IN Error Interrupt Clear */ -#define USBHS_DEVEPTIDR_HBISOFLUSHEC (0x1u << 4) /**< \brief (USBHS_DEVEPTIDR[10]) High Bandwidth Isochronous IN Flush Interrupt Clear */ -#define USBHS_DEVEPTIDR_CRCERREC (0x1u << 6) /**< \brief (USBHS_DEVEPTIDR[10]) CRC Error Interrupt Clear */ -#define USBHS_DEVEPTIDR_MDATEC (0x1u << 8) /**< \brief (USBHS_DEVEPTIDR[10]) MData Interrupt Clear */ -#define USBHS_DEVEPTIDR_DATAXEC (0x1u << 9) /**< \brief (USBHS_DEVEPTIDR[10]) DataX Interrupt Clear */ -#define USBHS_DEVEPTIDR_ERRORTRANSEC (0x1u << 10) /**< \brief (USBHS_DEVEPTIDR[10]) Transaction Error Interrupt Clear */ -/* -------- USBHS_DEVDMANXTDSC : (USBHS Offset: N/A) Device DMA Channel Next Descriptor Address Register -------- */ -#define USBHS_DEVDMANXTDSC_NXT_DSC_ADD_Pos 0 -#define USBHS_DEVDMANXTDSC_NXT_DSC_ADD_Msk (0xffffffffu << USBHS_DEVDMANXTDSC_NXT_DSC_ADD_Pos) /**< \brief (USBHS_DEVDMANXTDSC) Next Descriptor Address */ -#define USBHS_DEVDMANXTDSC_NXT_DSC_ADD(value) ((USBHS_DEVDMANXTDSC_NXT_DSC_ADD_Msk & ((value) << USBHS_DEVDMANXTDSC_NXT_DSC_ADD_Pos))) -/* -------- USBHS_DEVDMAADDRESS : (USBHS Offset: N/A) Device DMA Channel Address Register -------- */ -#define USBHS_DEVDMAADDRESS_BUFF_ADD_Pos 0 -#define USBHS_DEVDMAADDRESS_BUFF_ADD_Msk (0xffffffffu << USBHS_DEVDMAADDRESS_BUFF_ADD_Pos) /**< \brief (USBHS_DEVDMAADDRESS) Buffer Address */ -#define USBHS_DEVDMAADDRESS_BUFF_ADD(value) ((USBHS_DEVDMAADDRESS_BUFF_ADD_Msk & ((value) << USBHS_DEVDMAADDRESS_BUFF_ADD_Pos))) -/* -------- USBHS_DEVDMACONTROL : (USBHS Offset: N/A) Device DMA Channel Control Register -------- */ -#define USBHS_DEVDMACONTROL_CHANN_ENB (0x1u << 0) /**< \brief (USBHS_DEVDMACONTROL) Channel Enable Command */ -#define USBHS_DEVDMACONTROL_LDNXT_DSC (0x1u << 1) /**< \brief (USBHS_DEVDMACONTROL) Load Next Channel Transfer Descriptor Enable Command */ -#define USBHS_DEVDMACONTROL_END_TR_EN (0x1u << 2) /**< \brief (USBHS_DEVDMACONTROL) End of Transfer Enable Control (OUT transfers only) */ -#define USBHS_DEVDMACONTROL_END_B_EN (0x1u << 3) /**< \brief (USBHS_DEVDMACONTROL) End of Buffer Enable Control */ -#define USBHS_DEVDMACONTROL_END_TR_IT (0x1u << 4) /**< \brief (USBHS_DEVDMACONTROL) End of Transfer Interrupt Enable */ -#define USBHS_DEVDMACONTROL_END_BUFFIT (0x1u << 5) /**< \brief (USBHS_DEVDMACONTROL) End of Buffer Interrupt Enable */ -#define USBHS_DEVDMACONTROL_DESC_LD_IT (0x1u << 6) /**< \brief (USBHS_DEVDMACONTROL) Descriptor Loaded Interrupt Enable */ -#define USBHS_DEVDMACONTROL_BURST_LCK (0x1u << 7) /**< \brief (USBHS_DEVDMACONTROL) Burst Lock Enable */ -#define USBHS_DEVDMACONTROL_BUFF_LENGTH_Pos 16 -#define USBHS_DEVDMACONTROL_BUFF_LENGTH_Msk (0xffffu << USBHS_DEVDMACONTROL_BUFF_LENGTH_Pos) /**< \brief (USBHS_DEVDMACONTROL) Buffer Byte Length (Write-only) */ -#define USBHS_DEVDMACONTROL_BUFF_LENGTH(value) ((USBHS_DEVDMACONTROL_BUFF_LENGTH_Msk & ((value) << USBHS_DEVDMACONTROL_BUFF_LENGTH_Pos))) -/* -------- USBHS_DEVDMASTATUS : (USBHS Offset: N/A) Device DMA Channel Status Register -------- */ -#define USBHS_DEVDMASTATUS_CHANN_ENB (0x1u << 0) /**< \brief (USBHS_DEVDMASTATUS) Channel Enable Status */ -#define USBHS_DEVDMASTATUS_CHANN_ACT (0x1u << 1) /**< \brief (USBHS_DEVDMASTATUS) Channel Active Status */ -#define USBHS_DEVDMASTATUS_END_TR_ST (0x1u << 4) /**< \brief (USBHS_DEVDMASTATUS) End of Channel Transfer Status */ -#define USBHS_DEVDMASTATUS_END_BF_ST (0x1u << 5) /**< \brief (USBHS_DEVDMASTATUS) End of Channel Buffer Status */ -#define USBHS_DEVDMASTATUS_DESC_LDST (0x1u << 6) /**< \brief (USBHS_DEVDMASTATUS) Descriptor Loaded Status */ -#define USBHS_DEVDMASTATUS_BUFF_COUNT_Pos 16 -#define USBHS_DEVDMASTATUS_BUFF_COUNT_Msk (0xffffu << USBHS_DEVDMASTATUS_BUFF_COUNT_Pos) /**< \brief (USBHS_DEVDMASTATUS) Buffer Byte Count */ -#define USBHS_DEVDMASTATUS_BUFF_COUNT(value) ((USBHS_DEVDMASTATUS_BUFF_COUNT_Msk & ((value) << USBHS_DEVDMASTATUS_BUFF_COUNT_Pos))) -/* -------- USBHS_HSTCTRL : (USBHS Offset: 0x0400) Host General Control Register -------- */ -#define USBHS_HSTCTRL_SOFE (0x1u << 8) /**< \brief (USBHS_HSTCTRL) Start of Frame Generation Enable */ -#define USBHS_HSTCTRL_RESET (0x1u << 9) /**< \brief (USBHS_HSTCTRL) Send USB Reset */ -#define USBHS_HSTCTRL_RESUME (0x1u << 10) /**< \brief (USBHS_HSTCTRL) Send USB Resume */ -#define USBHS_HSTCTRL_SPDCONF_Pos 12 -#define USBHS_HSTCTRL_SPDCONF_Msk (0x3u << USBHS_HSTCTRL_SPDCONF_Pos) /**< \brief (USBHS_HSTCTRL) Mode Configuration */ -#define USBHS_HSTCTRL_SPDCONF(value) ((USBHS_HSTCTRL_SPDCONF_Msk & ((value) << USBHS_HSTCTRL_SPDCONF_Pos))) -#define USBHS_HSTCTRL_SPDCONF_NORMAL (0x0u << 12) /**< \brief (USBHS_HSTCTRL) The host starts in Full-speed mode and performs a high-speed reset to switch to High-speed mode if the downstream peripheral is high-speed capable. */ -#define USBHS_HSTCTRL_SPDCONF_LOW_POWER (0x1u << 12) /**< \brief (USBHS_HSTCTRL) For a better consumption, if high speed is not needed. */ -#define USBHS_HSTCTRL_SPDCONF_HIGH_SPEED (0x2u << 12) /**< \brief (USBHS_HSTCTRL) Forced high speed. */ -#define USBHS_HSTCTRL_SPDCONF_FORCED_FS (0x3u << 12) /**< \brief (USBHS_HSTCTRL) The host remains in Full-speed mode whatever the peripheral speed capability. */ -/* -------- USBHS_HSTISR : (USBHS Offset: 0x0404) Host Global Interrupt Status Register -------- */ -#define USBHS_HSTISR_DCONNI (0x1u << 0) /**< \brief (USBHS_HSTISR) Device Connection Interrupt */ -#define USBHS_HSTISR_DDISCI (0x1u << 1) /**< \brief (USBHS_HSTISR) Device Disconnection Interrupt */ -#define USBHS_HSTISR_RSTI (0x1u << 2) /**< \brief (USBHS_HSTISR) USB Reset Sent Interrupt */ -#define USBHS_HSTISR_RSMEDI (0x1u << 3) /**< \brief (USBHS_HSTISR) Downstream Resume Sent Interrupt */ -#define USBHS_HSTISR_RXRSMI (0x1u << 4) /**< \brief (USBHS_HSTISR) Upstream Resume Received Interrupt */ -#define USBHS_HSTISR_HSOFI (0x1u << 5) /**< \brief (USBHS_HSTISR) Host Start of Frame Interrupt */ -#define USBHS_HSTISR_HWUPI (0x1u << 6) /**< \brief (USBHS_HSTISR) Host Wake-Up Interrupt */ -#define USBHS_HSTISR_PEP_0 (0x1u << 8) /**< \brief (USBHS_HSTISR) Pipe 0 Interrupt */ -#define USBHS_HSTISR_PEP_1 (0x1u << 9) /**< \brief (USBHS_HSTISR) Pipe 1 Interrupt */ -#define USBHS_HSTISR_PEP_2 (0x1u << 10) /**< \brief (USBHS_HSTISR) Pipe 2 Interrupt */ -#define USBHS_HSTISR_PEP_3 (0x1u << 11) /**< \brief (USBHS_HSTISR) Pipe 3 Interrupt */ -#define USBHS_HSTISR_PEP_4 (0x1u << 12) /**< \brief (USBHS_HSTISR) Pipe 4 Interrupt */ -#define USBHS_HSTISR_PEP_5 (0x1u << 13) /**< \brief (USBHS_HSTISR) Pipe 5 Interrupt */ -#define USBHS_HSTISR_PEP_6 (0x1u << 14) /**< \brief (USBHS_HSTISR) Pipe 6 Interrupt */ -#define USBHS_HSTISR_PEP_7 (0x1u << 15) /**< \brief (USBHS_HSTISR) Pipe 7 Interrupt */ -#define USBHS_HSTISR_PEP_8 (0x1u << 16) /**< \brief (USBHS_HSTISR) Pipe 8 Interrupt */ -#define USBHS_HSTISR_PEP_9 (0x1u << 17) /**< \brief (USBHS_HSTISR) Pipe 9 Interrupt */ -#define USBHS_HSTISR_PEP_10 (0x1u << 18) /**< \brief (USBHS_HSTISR) Pipe 10 Interrupt */ -#define USBHS_HSTISR_PEP_11 (0x1u << 19) /**< \brief (USBHS_HSTISR) Pipe 11 Interrupt */ -#define USBHS_HSTISR_DMA_1 (0x1u << 25) /**< \brief (USBHS_HSTISR) DMA Channel 1 Interrupt */ -#define USBHS_HSTISR_DMA_2 (0x1u << 26) /**< \brief (USBHS_HSTISR) DMA Channel 2 Interrupt */ -#define USBHS_HSTISR_DMA_3 (0x1u << 27) /**< \brief (USBHS_HSTISR) DMA Channel 3 Interrupt */ -#define USBHS_HSTISR_DMA_4 (0x1u << 28) /**< \brief (USBHS_HSTISR) DMA Channel 4 Interrupt */ -#define USBHS_HSTISR_DMA_5 (0x1u << 29) /**< \brief (USBHS_HSTISR) DMA Channel 5 Interrupt */ -#define USBHS_HSTISR_DMA_6 (0x1u << 30) /**< \brief (USBHS_HSTISR) DMA Channel 6 Interrupt */ -#define USBHS_HSTISR_DMA_7 (0x1u << 31) /**< \brief (USBHS_HSTISR) DMA Channel 7 Interrupt */ -/* -------- USBHS_HSTICR : (USBHS Offset: 0x0408) Host Global Interrupt Clear Register -------- */ -#define USBHS_HSTICR_DCONNIC (0x1u << 0) /**< \brief (USBHS_HSTICR) Device Connection Interrupt Clear */ -#define USBHS_HSTICR_DDISCIC (0x1u << 1) /**< \brief (USBHS_HSTICR) Device Disconnection Interrupt Clear */ -#define USBHS_HSTICR_RSTIC (0x1u << 2) /**< \brief (USBHS_HSTICR) USB Reset Sent Interrupt Clear */ -#define USBHS_HSTICR_RSMEDIC (0x1u << 3) /**< \brief (USBHS_HSTICR) Downstream Resume Sent Interrupt Clear */ -#define USBHS_HSTICR_RXRSMIC (0x1u << 4) /**< \brief (USBHS_HSTICR) Upstream Resume Received Interrupt Clear */ -#define USBHS_HSTICR_HSOFIC (0x1u << 5) /**< \brief (USBHS_HSTICR) Host Start of Frame Interrupt Clear */ -#define USBHS_HSTICR_HWUPIC (0x1u << 6) /**< \brief (USBHS_HSTICR) Host Wake-Up Interrupt Clear */ -/* -------- USBHS_HSTIFR : (USBHS Offset: 0x040C) Host Global Interrupt Set Register -------- */ -#define USBHS_HSTIFR_DCONNIS (0x1u << 0) /**< \brief (USBHS_HSTIFR) Device Connection Interrupt Set */ -#define USBHS_HSTIFR_DDISCIS (0x1u << 1) /**< \brief (USBHS_HSTIFR) Device Disconnection Interrupt Set */ -#define USBHS_HSTIFR_RSTIS (0x1u << 2) /**< \brief (USBHS_HSTIFR) USB Reset Sent Interrupt Set */ -#define USBHS_HSTIFR_RSMEDIS (0x1u << 3) /**< \brief (USBHS_HSTIFR) Downstream Resume Sent Interrupt Set */ -#define USBHS_HSTIFR_RXRSMIS (0x1u << 4) /**< \brief (USBHS_HSTIFR) Upstream Resume Received Interrupt Set */ -#define USBHS_HSTIFR_HSOFIS (0x1u << 5) /**< \brief (USBHS_HSTIFR) Host Start of Frame Interrupt Set */ -#define USBHS_HSTIFR_HWUPIS (0x1u << 6) /**< \brief (USBHS_HSTIFR) Host Wake-Up Interrupt Set */ -#define USBHS_HSTIFR_DMA_1 (0x1u << 25) /**< \brief (USBHS_HSTIFR) DMA Channel 1 Interrupt Set */ -#define USBHS_HSTIFR_DMA_2 (0x1u << 26) /**< \brief (USBHS_HSTIFR) DMA Channel 2 Interrupt Set */ -#define USBHS_HSTIFR_DMA_3 (0x1u << 27) /**< \brief (USBHS_HSTIFR) DMA Channel 3 Interrupt Set */ -#define USBHS_HSTIFR_DMA_4 (0x1u << 28) /**< \brief (USBHS_HSTIFR) DMA Channel 4 Interrupt Set */ -#define USBHS_HSTIFR_DMA_5 (0x1u << 29) /**< \brief (USBHS_HSTIFR) DMA Channel 5 Interrupt Set */ -#define USBHS_HSTIFR_DMA_6 (0x1u << 30) /**< \brief (USBHS_HSTIFR) DMA Channel 6 Interrupt Set */ -#define USBHS_HSTIFR_DMA_7 (0x1u << 31) /**< \brief (USBHS_HSTIFR) DMA Channel 7 Interrupt Set */ -/* -------- USBHS_HSTIMR : (USBHS Offset: 0x0410) Host Global Interrupt Mask Register -------- */ -#define USBHS_HSTIMR_DCONNIE (0x1u << 0) /**< \brief (USBHS_HSTIMR) Device Connection Interrupt Enable */ -#define USBHS_HSTIMR_DDISCIE (0x1u << 1) /**< \brief (USBHS_HSTIMR) Device Disconnection Interrupt Enable */ -#define USBHS_HSTIMR_RSTIE (0x1u << 2) /**< \brief (USBHS_HSTIMR) USB Reset Sent Interrupt Enable */ -#define USBHS_HSTIMR_RSMEDIE (0x1u << 3) /**< \brief (USBHS_HSTIMR) Downstream Resume Sent Interrupt Enable */ -#define USBHS_HSTIMR_RXRSMIE (0x1u << 4) /**< \brief (USBHS_HSTIMR) Upstream Resume Received Interrupt Enable */ -#define USBHS_HSTIMR_HSOFIE (0x1u << 5) /**< \brief (USBHS_HSTIMR) Host Start of Frame Interrupt Enable */ -#define USBHS_HSTIMR_HWUPIE (0x1u << 6) /**< \brief (USBHS_HSTIMR) Host Wake-Up Interrupt Enable */ -#define USBHS_HSTIMR_PEP_0 (0x1u << 8) /**< \brief (USBHS_HSTIMR) Pipe 0 Interrupt Enable */ -#define USBHS_HSTIMR_PEP_1 (0x1u << 9) /**< \brief (USBHS_HSTIMR) Pipe 1 Interrupt Enable */ -#define USBHS_HSTIMR_PEP_2 (0x1u << 10) /**< \brief (USBHS_HSTIMR) Pipe 2 Interrupt Enable */ -#define USBHS_HSTIMR_PEP_3 (0x1u << 11) /**< \brief (USBHS_HSTIMR) Pipe 3 Interrupt Enable */ -#define USBHS_HSTIMR_PEP_4 (0x1u << 12) /**< \brief (USBHS_HSTIMR) Pipe 4 Interrupt Enable */ -#define USBHS_HSTIMR_PEP_5 (0x1u << 13) /**< \brief (USBHS_HSTIMR) Pipe 5 Interrupt Enable */ -#define USBHS_HSTIMR_PEP_6 (0x1u << 14) /**< \brief (USBHS_HSTIMR) Pipe 6 Interrupt Enable */ -#define USBHS_HSTIMR_PEP_7 (0x1u << 15) /**< \brief (USBHS_HSTIMR) Pipe 7 Interrupt Enable */ -#define USBHS_HSTIMR_PEP_8 (0x1u << 16) /**< \brief (USBHS_HSTIMR) Pipe 8 Interrupt Enable */ -#define USBHS_HSTIMR_PEP_9 (0x1u << 17) /**< \brief (USBHS_HSTIMR) Pipe 9 Interrupt Enable */ -#define USBHS_HSTIMR_PEP_10 (0x1u << 18) /**< \brief (USBHS_HSTIMR) Pipe 10 Interrupt Enable */ -#define USBHS_HSTIMR_PEP_11 (0x1u << 19) /**< \brief (USBHS_HSTIMR) Pipe 11 Interrupt Enable */ -#define USBHS_HSTIMR_DMA_1 (0x1u << 25) /**< \brief (USBHS_HSTIMR) DMA Channel 1 Interrupt Enable */ -#define USBHS_HSTIMR_DMA_2 (0x1u << 26) /**< \brief (USBHS_HSTIMR) DMA Channel 2 Interrupt Enable */ -#define USBHS_HSTIMR_DMA_3 (0x1u << 27) /**< \brief (USBHS_HSTIMR) DMA Channel 3 Interrupt Enable */ -#define USBHS_HSTIMR_DMA_4 (0x1u << 28) /**< \brief (USBHS_HSTIMR) DMA Channel 4 Interrupt Enable */ -#define USBHS_HSTIMR_DMA_5 (0x1u << 29) /**< \brief (USBHS_HSTIMR) DMA Channel 5 Interrupt Enable */ -#define USBHS_HSTIMR_DMA_6 (0x1u << 30) /**< \brief (USBHS_HSTIMR) DMA Channel 6 Interrupt Enable */ -#define USBHS_HSTIMR_DMA_7 (0x1u << 31) /**< \brief (USBHS_HSTIMR) DMA Channel 7 Interrupt Enable */ -/* -------- USBHS_HSTIDR : (USBHS Offset: 0x0414) Host Global Interrupt Disable Register -------- */ -#define USBHS_HSTIDR_DCONNIEC (0x1u << 0) /**< \brief (USBHS_HSTIDR) Device Connection Interrupt Disable */ -#define USBHS_HSTIDR_DDISCIEC (0x1u << 1) /**< \brief (USBHS_HSTIDR) Device Disconnection Interrupt Disable */ -#define USBHS_HSTIDR_RSTIEC (0x1u << 2) /**< \brief (USBHS_HSTIDR) USB Reset Sent Interrupt Disable */ -#define USBHS_HSTIDR_RSMEDIEC (0x1u << 3) /**< \brief (USBHS_HSTIDR) Downstream Resume Sent Interrupt Disable */ -#define USBHS_HSTIDR_RXRSMIEC (0x1u << 4) /**< \brief (USBHS_HSTIDR) Upstream Resume Received Interrupt Disable */ -#define USBHS_HSTIDR_HSOFIEC (0x1u << 5) /**< \brief (USBHS_HSTIDR) Host Start of Frame Interrupt Disable */ -#define USBHS_HSTIDR_HWUPIEC (0x1u << 6) /**< \brief (USBHS_HSTIDR) Host Wake-Up Interrupt Disable */ -#define USBHS_HSTIDR_PEP_0 (0x1u << 8) /**< \brief (USBHS_HSTIDR) Pipe 0 Interrupt Disable */ -#define USBHS_HSTIDR_PEP_1 (0x1u << 9) /**< \brief (USBHS_HSTIDR) Pipe 1 Interrupt Disable */ -#define USBHS_HSTIDR_PEP_2 (0x1u << 10) /**< \brief (USBHS_HSTIDR) Pipe 2 Interrupt Disable */ -#define USBHS_HSTIDR_PEP_3 (0x1u << 11) /**< \brief (USBHS_HSTIDR) Pipe 3 Interrupt Disable */ -#define USBHS_HSTIDR_PEP_4 (0x1u << 12) /**< \brief (USBHS_HSTIDR) Pipe 4 Interrupt Disable */ -#define USBHS_HSTIDR_PEP_5 (0x1u << 13) /**< \brief (USBHS_HSTIDR) Pipe 5 Interrupt Disable */ -#define USBHS_HSTIDR_PEP_6 (0x1u << 14) /**< \brief (USBHS_HSTIDR) Pipe 6 Interrupt Disable */ -#define USBHS_HSTIDR_PEP_7 (0x1u << 15) /**< \brief (USBHS_HSTIDR) Pipe 7 Interrupt Disable */ -#define USBHS_HSTIDR_PEP_8 (0x1u << 16) /**< \brief (USBHS_HSTIDR) Pipe 8 Interrupt Disable */ -#define USBHS_HSTIDR_PEP_9 (0x1u << 17) /**< \brief (USBHS_HSTIDR) Pipe 9 Interrupt Disable */ -#define USBHS_HSTIDR_PEP_10 (0x1u << 18) /**< \brief (USBHS_HSTIDR) Pipe 10 Interrupt Disable */ -#define USBHS_HSTIDR_PEP_11 (0x1u << 19) /**< \brief (USBHS_HSTIDR) Pipe 11 Interrupt Disable */ -#define USBHS_HSTIDR_DMA_1 (0x1u << 25) /**< \brief (USBHS_HSTIDR) DMA Channel 1 Interrupt Disable */ -#define USBHS_HSTIDR_DMA_2 (0x1u << 26) /**< \brief (USBHS_HSTIDR) DMA Channel 2 Interrupt Disable */ -#define USBHS_HSTIDR_DMA_3 (0x1u << 27) /**< \brief (USBHS_HSTIDR) DMA Channel 3 Interrupt Disable */ -#define USBHS_HSTIDR_DMA_4 (0x1u << 28) /**< \brief (USBHS_HSTIDR) DMA Channel 4 Interrupt Disable */ -#define USBHS_HSTIDR_DMA_5 (0x1u << 29) /**< \brief (USBHS_HSTIDR) DMA Channel 5 Interrupt Disable */ -#define USBHS_HSTIDR_DMA_6 (0x1u << 30) /**< \brief (USBHS_HSTIDR) DMA Channel 6 Interrupt Disable */ -#define USBHS_HSTIDR_DMA_7 (0x1u << 31) /**< \brief (USBHS_HSTIDR) DMA Channel 7 Interrupt Disable */ -/* -------- USBHS_HSTIER : (USBHS Offset: 0x0418) Host Global Interrupt Enable Register -------- */ -#define USBHS_HSTIER_DCONNIES (0x1u << 0) /**< \brief (USBHS_HSTIER) Device Connection Interrupt Enable */ -#define USBHS_HSTIER_DDISCIES (0x1u << 1) /**< \brief (USBHS_HSTIER) Device Disconnection Interrupt Enable */ -#define USBHS_HSTIER_RSTIES (0x1u << 2) /**< \brief (USBHS_HSTIER) USB Reset Sent Interrupt Enable */ -#define USBHS_HSTIER_RSMEDIES (0x1u << 3) /**< \brief (USBHS_HSTIER) Downstream Resume Sent Interrupt Enable */ -#define USBHS_HSTIER_RXRSMIES (0x1u << 4) /**< \brief (USBHS_HSTIER) Upstream Resume Received Interrupt Enable */ -#define USBHS_HSTIER_HSOFIES (0x1u << 5) /**< \brief (USBHS_HSTIER) Host Start of Frame Interrupt Enable */ -#define USBHS_HSTIER_HWUPIES (0x1u << 6) /**< \brief (USBHS_HSTIER) Host Wake-Up Interrupt Enable */ -#define USBHS_HSTIER_PEP_0 (0x1u << 8) /**< \brief (USBHS_HSTIER) Pipe 0 Interrupt Enable */ -#define USBHS_HSTIER_PEP_1 (0x1u << 9) /**< \brief (USBHS_HSTIER) Pipe 1 Interrupt Enable */ -#define USBHS_HSTIER_PEP_2 (0x1u << 10) /**< \brief (USBHS_HSTIER) Pipe 2 Interrupt Enable */ -#define USBHS_HSTIER_PEP_3 (0x1u << 11) /**< \brief (USBHS_HSTIER) Pipe 3 Interrupt Enable */ -#define USBHS_HSTIER_PEP_4 (0x1u << 12) /**< \brief (USBHS_HSTIER) Pipe 4 Interrupt Enable */ -#define USBHS_HSTIER_PEP_5 (0x1u << 13) /**< \brief (USBHS_HSTIER) Pipe 5 Interrupt Enable */ -#define USBHS_HSTIER_PEP_6 (0x1u << 14) /**< \brief (USBHS_HSTIER) Pipe 6 Interrupt Enable */ -#define USBHS_HSTIER_PEP_7 (0x1u << 15) /**< \brief (USBHS_HSTIER) Pipe 7 Interrupt Enable */ -#define USBHS_HSTIER_PEP_8 (0x1u << 16) /**< \brief (USBHS_HSTIER) Pipe 8 Interrupt Enable */ -#define USBHS_HSTIER_PEP_9 (0x1u << 17) /**< \brief (USBHS_HSTIER) Pipe 9 Interrupt Enable */ -#define USBHS_HSTIER_PEP_10 (0x1u << 18) /**< \brief (USBHS_HSTIER) Pipe 10 Interrupt Enable */ -#define USBHS_HSTIER_PEP_11 (0x1u << 19) /**< \brief (USBHS_HSTIER) Pipe 11 Interrupt Enable */ -#define USBHS_HSTIER_DMA_1 (0x1u << 25) /**< \brief (USBHS_HSTIER) DMA Channel 1 Interrupt Enable */ -#define USBHS_HSTIER_DMA_2 (0x1u << 26) /**< \brief (USBHS_HSTIER) DMA Channel 2 Interrupt Enable */ -#define USBHS_HSTIER_DMA_3 (0x1u << 27) /**< \brief (USBHS_HSTIER) DMA Channel 3 Interrupt Enable */ -#define USBHS_HSTIER_DMA_4 (0x1u << 28) /**< \brief (USBHS_HSTIER) DMA Channel 4 Interrupt Enable */ -#define USBHS_HSTIER_DMA_5 (0x1u << 29) /**< \brief (USBHS_HSTIER) DMA Channel 5 Interrupt Enable */ -#define USBHS_HSTIER_DMA_6 (0x1u << 30) /**< \brief (USBHS_HSTIER) DMA Channel 6 Interrupt Enable */ -#define USBHS_HSTIER_DMA_7 (0x1u << 31) /**< \brief (USBHS_HSTIER) DMA Channel 7 Interrupt Enable */ -/* -------- USBHS_HSTPIP : (USBHS Offset: 0x0041C) Host Pipe Register -------- */ -#define USBHS_HSTPIP_PEN0 (0x1u << 0) /**< \brief (USBHS_HSTPIP) Pipe 0 Enable */ -#define USBHS_HSTPIP_PEN1 (0x1u << 1) /**< \brief (USBHS_HSTPIP) Pipe 1 Enable */ -#define USBHS_HSTPIP_PEN2 (0x1u << 2) /**< \brief (USBHS_HSTPIP) Pipe 2 Enable */ -#define USBHS_HSTPIP_PEN3 (0x1u << 3) /**< \brief (USBHS_HSTPIP) Pipe 3 Enable */ -#define USBHS_HSTPIP_PEN4 (0x1u << 4) /**< \brief (USBHS_HSTPIP) Pipe 4 Enable */ -#define USBHS_HSTPIP_PEN5 (0x1u << 5) /**< \brief (USBHS_HSTPIP) Pipe 5 Enable */ -#define USBHS_HSTPIP_PEN6 (0x1u << 6) /**< \brief (USBHS_HSTPIP) Pipe 6 Enable */ -#define USBHS_HSTPIP_PEN7 (0x1u << 7) /**< \brief (USBHS_HSTPIP) Pipe 7 Enable */ -#define USBHS_HSTPIP_PEN8 (0x1u << 8) /**< \brief (USBHS_HSTPIP) Pipe 8 Enable */ -#define USBHS_HSTPIP_PRST0 (0x1u << 16) /**< \brief (USBHS_HSTPIP) Pipe 0 Reset */ -#define USBHS_HSTPIP_PRST1 (0x1u << 17) /**< \brief (USBHS_HSTPIP) Pipe 1 Reset */ -#define USBHS_HSTPIP_PRST2 (0x1u << 18) /**< \brief (USBHS_HSTPIP) Pipe 2 Reset */ -#define USBHS_HSTPIP_PRST3 (0x1u << 19) /**< \brief (USBHS_HSTPIP) Pipe 3 Reset */ -#define USBHS_HSTPIP_PRST4 (0x1u << 20) /**< \brief (USBHS_HSTPIP) Pipe 4 Reset */ -#define USBHS_HSTPIP_PRST5 (0x1u << 21) /**< \brief (USBHS_HSTPIP) Pipe 5 Reset */ -#define USBHS_HSTPIP_PRST6 (0x1u << 22) /**< \brief (USBHS_HSTPIP) Pipe 6 Reset */ -#define USBHS_HSTPIP_PRST7 (0x1u << 23) /**< \brief (USBHS_HSTPIP) Pipe 7 Reset */ -#define USBHS_HSTPIP_PRST8 (0x1u << 24) /**< \brief (USBHS_HSTPIP) Pipe 8 Reset */ -/* -------- USBHS_HSTFNUM : (USBHS Offset: 0x0420) Host Frame Number Register -------- */ -#define USBHS_HSTFNUM_MFNUM_Pos 0 -#define USBHS_HSTFNUM_MFNUM_Msk (0x7u << USBHS_HSTFNUM_MFNUM_Pos) /**< \brief (USBHS_HSTFNUM) Micro Frame Number */ -#define USBHS_HSTFNUM_MFNUM(value) ((USBHS_HSTFNUM_MFNUM_Msk & ((value) << USBHS_HSTFNUM_MFNUM_Pos))) -#define USBHS_HSTFNUM_FNUM_Pos 3 -#define USBHS_HSTFNUM_FNUM_Msk (0x7ffu << USBHS_HSTFNUM_FNUM_Pos) /**< \brief (USBHS_HSTFNUM) Frame Number */ -#define USBHS_HSTFNUM_FNUM(value) ((USBHS_HSTFNUM_FNUM_Msk & ((value) << USBHS_HSTFNUM_FNUM_Pos))) -#define USBHS_HSTFNUM_FLENHIGH_Pos 16 -#define USBHS_HSTFNUM_FLENHIGH_Msk (0xffu << USBHS_HSTFNUM_FLENHIGH_Pos) /**< \brief (USBHS_HSTFNUM) Frame Length */ -#define USBHS_HSTFNUM_FLENHIGH(value) ((USBHS_HSTFNUM_FLENHIGH_Msk & ((value) << USBHS_HSTFNUM_FLENHIGH_Pos))) -/* -------- USBHS_HSTADDR1 : (USBHS Offset: 0x0424) Host Address 1 Register -------- */ -#define USBHS_HSTADDR1_HSTADDRP0_Pos 0 -#define USBHS_HSTADDR1_HSTADDRP0_Msk (0x7fu << USBHS_HSTADDR1_HSTADDRP0_Pos) /**< \brief (USBHS_HSTADDR1) USB Host Address */ -#define USBHS_HSTADDR1_HSTADDRP0(value) ((USBHS_HSTADDR1_HSTADDRP0_Msk & ((value) << USBHS_HSTADDR1_HSTADDRP0_Pos))) -#define USBHS_HSTADDR1_HSTADDRP1_Pos 8 -#define USBHS_HSTADDR1_HSTADDRP1_Msk (0x7fu << USBHS_HSTADDR1_HSTADDRP1_Pos) /**< \brief (USBHS_HSTADDR1) USB Host Address */ -#define USBHS_HSTADDR1_HSTADDRP1(value) ((USBHS_HSTADDR1_HSTADDRP1_Msk & ((value) << USBHS_HSTADDR1_HSTADDRP1_Pos))) -#define USBHS_HSTADDR1_HSTADDRP2_Pos 16 -#define USBHS_HSTADDR1_HSTADDRP2_Msk (0x7fu << USBHS_HSTADDR1_HSTADDRP2_Pos) /**< \brief (USBHS_HSTADDR1) USB Host Address */ -#define USBHS_HSTADDR1_HSTADDRP2(value) ((USBHS_HSTADDR1_HSTADDRP2_Msk & ((value) << USBHS_HSTADDR1_HSTADDRP2_Pos))) -#define USBHS_HSTADDR1_HSTADDRP3_Pos 24 -#define USBHS_HSTADDR1_HSTADDRP3_Msk (0x7fu << USBHS_HSTADDR1_HSTADDRP3_Pos) /**< \brief (USBHS_HSTADDR1) USB Host Address */ -#define USBHS_HSTADDR1_HSTADDRP3(value) ((USBHS_HSTADDR1_HSTADDRP3_Msk & ((value) << USBHS_HSTADDR1_HSTADDRP3_Pos))) -/* -------- USBHS_HSTADDR2 : (USBHS Offset: 0x0428) Host Address 2 Register -------- */ -#define USBHS_HSTADDR2_HSTADDRP4_Pos 0 -#define USBHS_HSTADDR2_HSTADDRP4_Msk (0x7fu << USBHS_HSTADDR2_HSTADDRP4_Pos) /**< \brief (USBHS_HSTADDR2) USB Host Address */ -#define USBHS_HSTADDR2_HSTADDRP4(value) ((USBHS_HSTADDR2_HSTADDRP4_Msk & ((value) << USBHS_HSTADDR2_HSTADDRP4_Pos))) -#define USBHS_HSTADDR2_HSTADDRP5_Pos 8 -#define USBHS_HSTADDR2_HSTADDRP5_Msk (0x7fu << USBHS_HSTADDR2_HSTADDRP5_Pos) /**< \brief (USBHS_HSTADDR2) USB Host Address */ -#define USBHS_HSTADDR2_HSTADDRP5(value) ((USBHS_HSTADDR2_HSTADDRP5_Msk & ((value) << USBHS_HSTADDR2_HSTADDRP5_Pos))) -#define USBHS_HSTADDR2_HSTADDRP6_Pos 16 -#define USBHS_HSTADDR2_HSTADDRP6_Msk (0x7fu << USBHS_HSTADDR2_HSTADDRP6_Pos) /**< \brief (USBHS_HSTADDR2) USB Host Address */ -#define USBHS_HSTADDR2_HSTADDRP6(value) ((USBHS_HSTADDR2_HSTADDRP6_Msk & ((value) << USBHS_HSTADDR2_HSTADDRP6_Pos))) -#define USBHS_HSTADDR2_HSTADDRP7_Pos 24 -#define USBHS_HSTADDR2_HSTADDRP7_Msk (0x7fu << USBHS_HSTADDR2_HSTADDRP7_Pos) /**< \brief (USBHS_HSTADDR2) USB Host Address */ -#define USBHS_HSTADDR2_HSTADDRP7(value) ((USBHS_HSTADDR2_HSTADDRP7_Msk & ((value) << USBHS_HSTADDR2_HSTADDRP7_Pos))) -/* -------- USBHS_HSTADDR3 : (USBHS Offset: 0x042C) Host Address 3 Register -------- */ -#define USBHS_HSTADDR3_HSTADDRP8_Pos 0 -#define USBHS_HSTADDR3_HSTADDRP8_Msk (0x7fu << USBHS_HSTADDR3_HSTADDRP8_Pos) /**< \brief (USBHS_HSTADDR3) USB Host Address */ -#define USBHS_HSTADDR3_HSTADDRP8(value) ((USBHS_HSTADDR3_HSTADDRP8_Msk & ((value) << USBHS_HSTADDR3_HSTADDRP8_Pos))) -#define USBHS_HSTADDR3_HSTADDRP9_Pos 8 -#define USBHS_HSTADDR3_HSTADDRP9_Msk (0x7fu << USBHS_HSTADDR3_HSTADDRP9_Pos) /**< \brief (USBHS_HSTADDR3) USB Host Address */ -#define USBHS_HSTADDR3_HSTADDRP9(value) ((USBHS_HSTADDR3_HSTADDRP9_Msk & ((value) << USBHS_HSTADDR3_HSTADDRP9_Pos))) -/* -------- USBHS_HSTPIPCFG[10] : (USBHS Offset: 0x500) Host Pipe Configuration Register (n = 0) -------- */ -#define USBHS_HSTPIPCFG_ALLOC (0x1u << 1) /**< \brief (USBHS_HSTPIPCFG[10]) Pipe Memory Allocate */ -#define USBHS_HSTPIPCFG_PBK_Pos 2 -#define USBHS_HSTPIPCFG_PBK_Msk (0x3u << USBHS_HSTPIPCFG_PBK_Pos) /**< \brief (USBHS_HSTPIPCFG[10]) Pipe Banks */ -#define USBHS_HSTPIPCFG_PBK(value) ((USBHS_HSTPIPCFG_PBK_Msk & ((value) << USBHS_HSTPIPCFG_PBK_Pos))) -#define USBHS_HSTPIPCFG_PBK_1_BANK (0x0u << 2) /**< \brief (USBHS_HSTPIPCFG[10]) Single-bank pipe */ -#define USBHS_HSTPIPCFG_PBK_2_BANK (0x1u << 2) /**< \brief (USBHS_HSTPIPCFG[10]) Double-bank pipe */ -#define USBHS_HSTPIPCFG_PBK_3_BANK (0x2u << 2) /**< \brief (USBHS_HSTPIPCFG[10]) Triple-bank pipe */ -#define USBHS_HSTPIPCFG_PSIZE_Pos 4 -#define USBHS_HSTPIPCFG_PSIZE_Msk (0x7u << USBHS_HSTPIPCFG_PSIZE_Pos) /**< \brief (USBHS_HSTPIPCFG[10]) Pipe Size */ -#define USBHS_HSTPIPCFG_PSIZE(value) ((USBHS_HSTPIPCFG_PSIZE_Msk & ((value) << USBHS_HSTPIPCFG_PSIZE_Pos))) -#define USBHS_HSTPIPCFG_PSIZE_8_BYTE (0x0u << 4) /**< \brief (USBHS_HSTPIPCFG[10]) 8 bytes */ -#define USBHS_HSTPIPCFG_PSIZE_16_BYTE (0x1u << 4) /**< \brief (USBHS_HSTPIPCFG[10]) 16 bytes */ -#define USBHS_HSTPIPCFG_PSIZE_32_BYTE (0x2u << 4) /**< \brief (USBHS_HSTPIPCFG[10]) 32 bytes */ -#define USBHS_HSTPIPCFG_PSIZE_64_BYTE (0x3u << 4) /**< \brief (USBHS_HSTPIPCFG[10]) 64 bytes */ -#define USBHS_HSTPIPCFG_PSIZE_128_BYTE (0x4u << 4) /**< \brief (USBHS_HSTPIPCFG[10]) 128 bytes */ -#define USBHS_HSTPIPCFG_PSIZE_256_BYTE (0x5u << 4) /**< \brief (USBHS_HSTPIPCFG[10]) 256 bytes */ -#define USBHS_HSTPIPCFG_PSIZE_512_BYTE (0x6u << 4) /**< \brief (USBHS_HSTPIPCFG[10]) 512 bytes */ -#define USBHS_HSTPIPCFG_PSIZE_1024_BYTE (0x7u << 4) /**< \brief (USBHS_HSTPIPCFG[10]) 1024 bytes */ -#define USBHS_HSTPIPCFG_PTOKEN_Pos 8 -#define USBHS_HSTPIPCFG_PTOKEN_Msk (0x3u << USBHS_HSTPIPCFG_PTOKEN_Pos) /**< \brief (USBHS_HSTPIPCFG[10]) Pipe Token */ -#define USBHS_HSTPIPCFG_PTOKEN(value) ((USBHS_HSTPIPCFG_PTOKEN_Msk & ((value) << USBHS_HSTPIPCFG_PTOKEN_Pos))) -#define USBHS_HSTPIPCFG_PTOKEN_SETUP (0x0u << 8) /**< \brief (USBHS_HSTPIPCFG[10]) SETUP */ -#define USBHS_HSTPIPCFG_PTOKEN_IN (0x1u << 8) /**< \brief (USBHS_HSTPIPCFG[10]) IN */ -#define USBHS_HSTPIPCFG_PTOKEN_OUT (0x2u << 8) /**< \brief (USBHS_HSTPIPCFG[10]) OUT */ -#define USBHS_HSTPIPCFG_AUTOSW (0x1u << 10) /**< \brief (USBHS_HSTPIPCFG[10]) Automatic Switch */ -#define USBHS_HSTPIPCFG_PTYPE_Pos 12 -#define USBHS_HSTPIPCFG_PTYPE_Msk (0x3u << USBHS_HSTPIPCFG_PTYPE_Pos) /**< \brief (USBHS_HSTPIPCFG[10]) Pipe Type */ -#define USBHS_HSTPIPCFG_PTYPE(value) ((USBHS_HSTPIPCFG_PTYPE_Msk & ((value) << USBHS_HSTPIPCFG_PTYPE_Pos))) -#define USBHS_HSTPIPCFG_PTYPE_CTRL (0x0u << 12) /**< \brief (USBHS_HSTPIPCFG[10]) Control */ -#define USBHS_HSTPIPCFG_PTYPE_ISO (0x1u << 12) /**< \brief (USBHS_HSTPIPCFG[10]) Isochronous */ -#define USBHS_HSTPIPCFG_PTYPE_BLK (0x2u << 12) /**< \brief (USBHS_HSTPIPCFG[10]) Bulk */ -#define USBHS_HSTPIPCFG_PTYPE_INTRPT (0x3u << 12) /**< \brief (USBHS_HSTPIPCFG[10]) Interrupt */ -#define USBHS_HSTPIPCFG_PEPNUM_Pos 16 -#define USBHS_HSTPIPCFG_PEPNUM_Msk (0xfu << USBHS_HSTPIPCFG_PEPNUM_Pos) /**< \brief (USBHS_HSTPIPCFG[10]) Pipe Endpoint Number */ -#define USBHS_HSTPIPCFG_PEPNUM(value) ((USBHS_HSTPIPCFG_PEPNUM_Msk & ((value) << USBHS_HSTPIPCFG_PEPNUM_Pos))) -#define USBHS_HSTPIPCFG_INTFRQ_Pos 24 -#define USBHS_HSTPIPCFG_INTFRQ_Msk (0xffu << USBHS_HSTPIPCFG_INTFRQ_Pos) /**< \brief (USBHS_HSTPIPCFG[10]) Pipe Interrupt Request Frequency */ -#define USBHS_HSTPIPCFG_INTFRQ(value) ((USBHS_HSTPIPCFG_INTFRQ_Msk & ((value) << USBHS_HSTPIPCFG_INTFRQ_Pos))) -#define USBHS_HSTPIPCFG_PINGEN (0x1u << 20) /**< \brief (USBHS_HSTPIPCFG[10]) Ping Enable */ -#define USBHS_HSTPIPCFG_BINTERVAL_Pos 24 -#define USBHS_HSTPIPCFG_BINTERVAL_Msk (0xffu << USBHS_HSTPIPCFG_BINTERVAL_Pos) /**< \brief (USBHS_HSTPIPCFG[10]) Binterval Parameter for the Bulk-Out/Ping Transaction */ -#define USBHS_HSTPIPCFG_BINTERVAL(value) ((USBHS_HSTPIPCFG_BINTERVAL_Msk & ((value) << USBHS_HSTPIPCFG_BINTERVAL_Pos))) -/* -------- USBHS_HSTPIPISR[10] : (USBHS Offset: 0x530) Host Pipe Status Register (n = 0) -------- */ -#define USBHS_HSTPIPISR_RXINI (0x1u << 0) /**< \brief (USBHS_HSTPIPISR[10]) Received IN Data Interrupt */ -#define USBHS_HSTPIPISR_TXOUTI (0x1u << 1) /**< \brief (USBHS_HSTPIPISR[10]) Transmitted OUT Data Interrupt */ -#define USBHS_HSTPIPISR_TXSTPI (0x1u << 2) /**< \brief (USBHS_HSTPIPISR[10]) Transmitted SETUP Interrupt */ -#define USBHS_HSTPIPISR_PERRI (0x1u << 3) /**< \brief (USBHS_HSTPIPISR[10]) Pipe Error Interrupt */ -#define USBHS_HSTPIPISR_NAKEDI (0x1u << 4) /**< \brief (USBHS_HSTPIPISR[10]) NAKed Interrupt */ -#define USBHS_HSTPIPISR_OVERFI (0x1u << 5) /**< \brief (USBHS_HSTPIPISR[10]) Overflow Interrupt */ -#define USBHS_HSTPIPISR_RXSTALLDI (0x1u << 6) /**< \brief (USBHS_HSTPIPISR[10]) Received STALLed Interrupt */ -#define USBHS_HSTPIPISR_SHORTPACKETI (0x1u << 7) /**< \brief (USBHS_HSTPIPISR[10]) Short Packet Interrupt */ -#define USBHS_HSTPIPISR_DTSEQ_Pos 8 -#define USBHS_HSTPIPISR_DTSEQ_Msk (0x3u << USBHS_HSTPIPISR_DTSEQ_Pos) /**< \brief (USBHS_HSTPIPISR[10]) Data Toggle Sequence */ -#define USBHS_HSTPIPISR_DTSEQ_DATA0 (0x0u << 8) /**< \brief (USBHS_HSTPIPISR[10]) Data0 toggle sequence */ -#define USBHS_HSTPIPISR_DTSEQ_DATA1 (0x1u << 8) /**< \brief (USBHS_HSTPIPISR[10]) Data1 toggle sequence */ -#define USBHS_HSTPIPISR_NBUSYBK_Pos 12 -#define USBHS_HSTPIPISR_NBUSYBK_Msk (0x3u << USBHS_HSTPIPISR_NBUSYBK_Pos) /**< \brief (USBHS_HSTPIPISR[10]) Number of Busy Banks */ -#define USBHS_HSTPIPISR_NBUSYBK_0_BUSY (0x0u << 12) /**< \brief (USBHS_HSTPIPISR[10]) 0 busy bank (all banks free) */ -#define USBHS_HSTPIPISR_NBUSYBK_1_BUSY (0x1u << 12) /**< \brief (USBHS_HSTPIPISR[10]) 1 busy bank */ -#define USBHS_HSTPIPISR_NBUSYBK_2_BUSY (0x2u << 12) /**< \brief (USBHS_HSTPIPISR[10]) 2 busy banks */ -#define USBHS_HSTPIPISR_NBUSYBK_3_BUSY (0x3u << 12) /**< \brief (USBHS_HSTPIPISR[10]) 3 busy banks */ -#define USBHS_HSTPIPISR_CURRBK_Pos 14 -#define USBHS_HSTPIPISR_CURRBK_Msk (0x3u << USBHS_HSTPIPISR_CURRBK_Pos) /**< \brief (USBHS_HSTPIPISR[10]) Current Bank */ -#define USBHS_HSTPIPISR_CURRBK_BANK0 (0x0u << 14) /**< \brief (USBHS_HSTPIPISR[10]) Current bank is bank0 */ -#define USBHS_HSTPIPISR_CURRBK_BANK1 (0x1u << 14) /**< \brief (USBHS_HSTPIPISR[10]) Current bank is bank1 */ -#define USBHS_HSTPIPISR_CURRBK_BANK2 (0x2u << 14) /**< \brief (USBHS_HSTPIPISR[10]) Current bank is bank2 */ -#define USBHS_HSTPIPISR_RWALL (0x1u << 16) /**< \brief (USBHS_HSTPIPISR[10]) Read/Write Allowed */ -#define USBHS_HSTPIPISR_CFGOK (0x1u << 18) /**< \brief (USBHS_HSTPIPISR[10]) Configuration OK Status */ -#define USBHS_HSTPIPISR_PBYCT_Pos 20 -#define USBHS_HSTPIPISR_PBYCT_Msk (0x7ffu << USBHS_HSTPIPISR_PBYCT_Pos) /**< \brief (USBHS_HSTPIPISR[10]) Pipe Byte Count */ -#define USBHS_HSTPIPISR_UNDERFI (0x1u << 2) /**< \brief (USBHS_HSTPIPISR[10]) Underflow Interrupt */ -#define USBHS_HSTPIPISR_CRCERRI (0x1u << 6) /**< \brief (USBHS_HSTPIPISR[10]) CRC Error Interrupt */ -/* -------- USBHS_HSTPIPICR[10] : (USBHS Offset: 0x560) Host Pipe Clear Register (n = 0) -------- */ -#define USBHS_HSTPIPICR_RXINIC (0x1u << 0) /**< \brief (USBHS_HSTPIPICR[10]) Received IN Data Interrupt Clear */ -#define USBHS_HSTPIPICR_TXOUTIC (0x1u << 1) /**< \brief (USBHS_HSTPIPICR[10]) Transmitted OUT Data Interrupt Clear */ -#define USBHS_HSTPIPICR_TXSTPIC (0x1u << 2) /**< \brief (USBHS_HSTPIPICR[10]) Transmitted SETUP Interrupt Clear */ -#define USBHS_HSTPIPICR_NAKEDIC (0x1u << 4) /**< \brief (USBHS_HSTPIPICR[10]) NAKed Interrupt Clear */ -#define USBHS_HSTPIPICR_OVERFIC (0x1u << 5) /**< \brief (USBHS_HSTPIPICR[10]) Overflow Interrupt Clear */ -#define USBHS_HSTPIPICR_RXSTALLDIC (0x1u << 6) /**< \brief (USBHS_HSTPIPICR[10]) Received STALLed Interrupt Clear */ -#define USBHS_HSTPIPICR_SHORTPACKETIC (0x1u << 7) /**< \brief (USBHS_HSTPIPICR[10]) Short Packet Interrupt Clear */ -#define USBHS_HSTPIPICR_UNDERFIC (0x1u << 2) /**< \brief (USBHS_HSTPIPICR[10]) Underflow Interrupt Clear */ -#define USBHS_HSTPIPICR_CRCERRIC (0x1u << 6) /**< \brief (USBHS_HSTPIPICR[10]) CRC Error Interrupt Clear */ -/* -------- USBHS_HSTPIPIFR[10] : (USBHS Offset: 0x590) Host Pipe Set Register (n = 0) -------- */ -#define USBHS_HSTPIPIFR_RXINIS (0x1u << 0) /**< \brief (USBHS_HSTPIPIFR[10]) Received IN Data Interrupt Set */ -#define USBHS_HSTPIPIFR_TXOUTIS (0x1u << 1) /**< \brief (USBHS_HSTPIPIFR[10]) Transmitted OUT Data Interrupt Set */ -#define USBHS_HSTPIPIFR_TXSTPIS (0x1u << 2) /**< \brief (USBHS_HSTPIPIFR[10]) Transmitted SETUP Interrupt Set */ -#define USBHS_HSTPIPIFR_PERRIS (0x1u << 3) /**< \brief (USBHS_HSTPIPIFR[10]) Pipe Error Interrupt Set */ -#define USBHS_HSTPIPIFR_NAKEDIS (0x1u << 4) /**< \brief (USBHS_HSTPIPIFR[10]) NAKed Interrupt Set */ -#define USBHS_HSTPIPIFR_OVERFIS (0x1u << 5) /**< \brief (USBHS_HSTPIPIFR[10]) Overflow Interrupt Set */ -#define USBHS_HSTPIPIFR_RXSTALLDIS (0x1u << 6) /**< \brief (USBHS_HSTPIPIFR[10]) Received STALLed Interrupt Set */ -#define USBHS_HSTPIPIFR_SHORTPACKETIS (0x1u << 7) /**< \brief (USBHS_HSTPIPIFR[10]) Short Packet Interrupt Set */ -#define USBHS_HSTPIPIFR_NBUSYBKS (0x1u << 12) /**< \brief (USBHS_HSTPIPIFR[10]) Number of Busy Banks Set */ -#define USBHS_HSTPIPIFR_UNDERFIS (0x1u << 2) /**< \brief (USBHS_HSTPIPIFR[10]) Underflow Interrupt Set */ -#define USBHS_HSTPIPIFR_CRCERRIS (0x1u << 6) /**< \brief (USBHS_HSTPIPIFR[10]) CRC Error Interrupt Set */ -/* -------- USBHS_HSTPIPIMR[10] : (USBHS Offset: 0x5C0) Host Pipe Mask Register (n = 0) -------- */ -#define USBHS_HSTPIPIMR_RXINE (0x1u << 0) /**< \brief (USBHS_HSTPIPIMR[10]) Received IN Data Interrupt Enable */ -#define USBHS_HSTPIPIMR_TXOUTE (0x1u << 1) /**< \brief (USBHS_HSTPIPIMR[10]) Transmitted OUT Data Interrupt Enable */ -#define USBHS_HSTPIPIMR_TXSTPE (0x1u << 2) /**< \brief (USBHS_HSTPIPIMR[10]) Transmitted SETUP Interrupt Enable */ -#define USBHS_HSTPIPIMR_PERRE (0x1u << 3) /**< \brief (USBHS_HSTPIPIMR[10]) Pipe Error Interrupt Enable */ -#define USBHS_HSTPIPIMR_NAKEDE (0x1u << 4) /**< \brief (USBHS_HSTPIPIMR[10]) NAKed Interrupt Enable */ -#define USBHS_HSTPIPIMR_OVERFIE (0x1u << 5) /**< \brief (USBHS_HSTPIPIMR[10]) Overflow Interrupt Enable */ -#define USBHS_HSTPIPIMR_RXSTALLDE (0x1u << 6) /**< \brief (USBHS_HSTPIPIMR[10]) Received STALLed Interrupt Enable */ -#define USBHS_HSTPIPIMR_SHORTPACKETIE (0x1u << 7) /**< \brief (USBHS_HSTPIPIMR[10]) Short Packet Interrupt Enable */ -#define USBHS_HSTPIPIMR_NBUSYBKE (0x1u << 12) /**< \brief (USBHS_HSTPIPIMR[10]) Number of Busy Banks Interrupt Enable */ -#define USBHS_HSTPIPIMR_FIFOCON (0x1u << 14) /**< \brief (USBHS_HSTPIPIMR[10]) FIFO Control */ -#define USBHS_HSTPIPIMR_PDISHDMA (0x1u << 16) /**< \brief (USBHS_HSTPIPIMR[10]) Pipe Interrupts Disable HDMA Request Enable */ -#define USBHS_HSTPIPIMR_PFREEZE (0x1u << 17) /**< \brief (USBHS_HSTPIPIMR[10]) Pipe Freeze */ -#define USBHS_HSTPIPIMR_RSTDT (0x1u << 18) /**< \brief (USBHS_HSTPIPIMR[10]) Reset Data Toggle */ -#define USBHS_HSTPIPIMR_UNDERFIE (0x1u << 2) /**< \brief (USBHS_HSTPIPIMR[10]) Underflow Interrupt Enable */ -#define USBHS_HSTPIPIMR_CRCERRE (0x1u << 6) /**< \brief (USBHS_HSTPIPIMR[10]) CRC Error Interrupt Enable */ -/* -------- USBHS_HSTPIPIER[10] : (USBHS Offset: 0x5F0) Host Pipe Enable Register (n = 0) -------- */ -#define USBHS_HSTPIPIER_RXINES (0x1u << 0) /**< \brief (USBHS_HSTPIPIER[10]) Received IN Data Interrupt Enable */ -#define USBHS_HSTPIPIER_TXOUTES (0x1u << 1) /**< \brief (USBHS_HSTPIPIER[10]) Transmitted OUT Data Interrupt Enable */ -#define USBHS_HSTPIPIER_TXSTPES (0x1u << 2) /**< \brief (USBHS_HSTPIPIER[10]) Transmitted SETUP Interrupt Enable */ -#define USBHS_HSTPIPIER_PERRES (0x1u << 3) /**< \brief (USBHS_HSTPIPIER[10]) Pipe Error Interrupt Enable */ -#define USBHS_HSTPIPIER_NAKEDES (0x1u << 4) /**< \brief (USBHS_HSTPIPIER[10]) NAKed Interrupt Enable */ -#define USBHS_HSTPIPIER_OVERFIES (0x1u << 5) /**< \brief (USBHS_HSTPIPIER[10]) Overflow Interrupt Enable */ -#define USBHS_HSTPIPIER_RXSTALLDES (0x1u << 6) /**< \brief (USBHS_HSTPIPIER[10]) Received STALLed Interrupt Enable */ -#define USBHS_HSTPIPIER_SHORTPACKETIES (0x1u << 7) /**< \brief (USBHS_HSTPIPIER[10]) Short Packet Interrupt Enable */ -#define USBHS_HSTPIPIER_NBUSYBKES (0x1u << 12) /**< \brief (USBHS_HSTPIPIER[10]) Number of Busy Banks Enable */ -#define USBHS_HSTPIPIER_PDISHDMAS (0x1u << 16) /**< \brief (USBHS_HSTPIPIER[10]) Pipe Interrupts Disable HDMA Request Enable */ -#define USBHS_HSTPIPIER_PFREEZES (0x1u << 17) /**< \brief (USBHS_HSTPIPIER[10]) Pipe Freeze Enable */ -#define USBHS_HSTPIPIER_RSTDTS (0x1u << 18) /**< \brief (USBHS_HSTPIPIER[10]) Reset Data Toggle Enable */ -#define USBHS_HSTPIPIER_UNDERFIES (0x1u << 2) /**< \brief (USBHS_HSTPIPIER[10]) Underflow Interrupt Enable */ -#define USBHS_HSTPIPIER_CRCERRES (0x1u << 6) /**< \brief (USBHS_HSTPIPIER[10]) CRC Error Interrupt Enable */ -/* -------- USBHS_HSTPIPIDR[10] : (USBHS Offset: 0x620) Host Pipe Disable Register (n = 0) -------- */ -#define USBHS_HSTPIPIDR_RXINEC (0x1u << 0) /**< \brief (USBHS_HSTPIPIDR[10]) Received IN Data Interrupt Disable */ -#define USBHS_HSTPIPIDR_TXOUTEC (0x1u << 1) /**< \brief (USBHS_HSTPIPIDR[10]) Transmitted OUT Data Interrupt Disable */ -#define USBHS_HSTPIPIDR_TXSTPEC (0x1u << 2) /**< \brief (USBHS_HSTPIPIDR[10]) Transmitted SETUP Interrupt Disable */ -#define USBHS_HSTPIPIDR_PERREC (0x1u << 3) /**< \brief (USBHS_HSTPIPIDR[10]) Pipe Error Interrupt Disable */ -#define USBHS_HSTPIPIDR_NAKEDEC (0x1u << 4) /**< \brief (USBHS_HSTPIPIDR[10]) NAKed Interrupt Disable */ -#define USBHS_HSTPIPIDR_OVERFIEC (0x1u << 5) /**< \brief (USBHS_HSTPIPIDR[10]) Overflow Interrupt Disable */ -#define USBHS_HSTPIPIDR_RXSTALLDEC (0x1u << 6) /**< \brief (USBHS_HSTPIPIDR[10]) Received STALLed Interrupt Disable */ -#define USBHS_HSTPIPIDR_SHORTPACKETIEC (0x1u << 7) /**< \brief (USBHS_HSTPIPIDR[10]) Short Packet Interrupt Disable */ -#define USBHS_HSTPIPIDR_NBUSYBKEC (0x1u << 12) /**< \brief (USBHS_HSTPIPIDR[10]) Number of Busy Banks Disable */ -#define USBHS_HSTPIPIDR_FIFOCONC (0x1u << 14) /**< \brief (USBHS_HSTPIPIDR[10]) FIFO Control Disable */ -#define USBHS_HSTPIPIDR_PDISHDMAC (0x1u << 16) /**< \brief (USBHS_HSTPIPIDR[10]) Pipe Interrupts Disable HDMA Request Disable */ -#define USBHS_HSTPIPIDR_PFREEZEC (0x1u << 17) /**< \brief (USBHS_HSTPIPIDR[10]) Pipe Freeze Disable */ -#define USBHS_HSTPIPIDR_UNDERFIEC (0x1u << 2) /**< \brief (USBHS_HSTPIPIDR[10]) Underflow Interrupt Disable */ -#define USBHS_HSTPIPIDR_CRCERREC (0x1u << 6) /**< \brief (USBHS_HSTPIPIDR[10]) CRC Error Interrupt Disable */ -/* -------- USBHS_HSTPIPINRQ[10] : (USBHS Offset: 0x650) Host Pipe IN Request Register (n = 0) -------- */ -#define USBHS_HSTPIPINRQ_INRQ_Pos 0 -#define USBHS_HSTPIPINRQ_INRQ_Msk (0xffu << USBHS_HSTPIPINRQ_INRQ_Pos) /**< \brief (USBHS_HSTPIPINRQ[10]) IN Request Number before Freeze */ -#define USBHS_HSTPIPINRQ_INRQ(value) ((USBHS_HSTPIPINRQ_INRQ_Msk & ((value) << USBHS_HSTPIPINRQ_INRQ_Pos))) -#define USBHS_HSTPIPINRQ_INMODE (0x1u << 8) /**< \brief (USBHS_HSTPIPINRQ[10]) IN Request Mode */ -/* -------- USBHS_HSTPIPERR[10] : (USBHS Offset: 0x680) Host Pipe Error Register (n = 0) -------- */ -#define USBHS_HSTPIPERR_DATATGL (0x1u << 0) /**< \brief (USBHS_HSTPIPERR[10]) Data Toggle Error */ -#define USBHS_HSTPIPERR_DATAPID (0x1u << 1) /**< \brief (USBHS_HSTPIPERR[10]) Data PID Error */ -#define USBHS_HSTPIPERR_PID (0x1u << 2) /**< \brief (USBHS_HSTPIPERR[10]) Data PID Error */ -#define USBHS_HSTPIPERR_TIMEOUT (0x1u << 3) /**< \brief (USBHS_HSTPIPERR[10]) Time-Out Error */ -#define USBHS_HSTPIPERR_CRC16 (0x1u << 4) /**< \brief (USBHS_HSTPIPERR[10]) CRC16 Error */ -#define USBHS_HSTPIPERR_COUNTER_Pos 5 -#define USBHS_HSTPIPERR_COUNTER_Msk (0x3u << USBHS_HSTPIPERR_COUNTER_Pos) /**< \brief (USBHS_HSTPIPERR[10]) Error Counter */ -#define USBHS_HSTPIPERR_COUNTER(value) ((USBHS_HSTPIPERR_COUNTER_Msk & ((value) << USBHS_HSTPIPERR_COUNTER_Pos))) -/* -------- USBHS_HSTDMANXTDSC : (USBHS Offset: N/A) Host DMA Channel Next Descriptor Address Register -------- */ -#define USBHS_HSTDMANXTDSC_NXT_DSC_ADD_Pos 0 -#define USBHS_HSTDMANXTDSC_NXT_DSC_ADD_Msk (0xffffffffu << USBHS_HSTDMANXTDSC_NXT_DSC_ADD_Pos) /**< \brief (USBHS_HSTDMANXTDSC) Next Descriptor Address */ -#define USBHS_HSTDMANXTDSC_NXT_DSC_ADD(value) ((USBHS_HSTDMANXTDSC_NXT_DSC_ADD_Msk & ((value) << USBHS_HSTDMANXTDSC_NXT_DSC_ADD_Pos))) -/* -------- USBHS_HSTDMAADDRESS : (USBHS Offset: N/A) Host DMA Channel Address Register -------- */ -#define USBHS_HSTDMAADDRESS_BUFF_ADD_Pos 0 -#define USBHS_HSTDMAADDRESS_BUFF_ADD_Msk (0xffffffffu << USBHS_HSTDMAADDRESS_BUFF_ADD_Pos) /**< \brief (USBHS_HSTDMAADDRESS) Buffer Address */ -#define USBHS_HSTDMAADDRESS_BUFF_ADD(value) ((USBHS_HSTDMAADDRESS_BUFF_ADD_Msk & ((value) << USBHS_HSTDMAADDRESS_BUFF_ADD_Pos))) -/* -------- USBHS_HSTDMACONTROL : (USBHS Offset: N/A) Host DMA Channel Control Register -------- */ -#define USBHS_HSTDMACONTROL_CHANN_ENB (0x1u << 0) /**< \brief (USBHS_HSTDMACONTROL) Channel Enable Command */ -#define USBHS_HSTDMACONTROL_LDNXT_DSC (0x1u << 1) /**< \brief (USBHS_HSTDMACONTROL) Load Next Channel Transfer Descriptor Enable Command */ -#define USBHS_HSTDMACONTROL_END_TR_EN (0x1u << 2) /**< \brief (USBHS_HSTDMACONTROL) End of Transfer Enable Control (OUT transfers only) */ -#define USBHS_HSTDMACONTROL_END_B_EN (0x1u << 3) /**< \brief (USBHS_HSTDMACONTROL) End of Buffer Enable Control */ -#define USBHS_HSTDMACONTROL_END_TR_IT (0x1u << 4) /**< \brief (USBHS_HSTDMACONTROL) End of Transfer Interrupt Enable */ -#define USBHS_HSTDMACONTROL_END_BUFFIT (0x1u << 5) /**< \brief (USBHS_HSTDMACONTROL) End of Buffer Interrupt Enable */ -#define USBHS_HSTDMACONTROL_DESC_LD_IT (0x1u << 6) /**< \brief (USBHS_HSTDMACONTROL) Descriptor Loaded Interrupt Enable */ -#define USBHS_HSTDMACONTROL_BURST_LCK (0x1u << 7) /**< \brief (USBHS_HSTDMACONTROL) Burst Lock Enable */ -#define USBHS_HSTDMACONTROL_BUFF_LENGTH_Pos 16 -#define USBHS_HSTDMACONTROL_BUFF_LENGTH_Msk (0xffffu << USBHS_HSTDMACONTROL_BUFF_LENGTH_Pos) /**< \brief (USBHS_HSTDMACONTROL) Buffer Byte Length (Write-only) */ -#define USBHS_HSTDMACONTROL_BUFF_LENGTH(value) ((USBHS_HSTDMACONTROL_BUFF_LENGTH_Msk & ((value) << USBHS_HSTDMACONTROL_BUFF_LENGTH_Pos))) -/* -------- USBHS_HSTDMASTATUS : (USBHS Offset: N/A) Host DMA Channel Status Register -------- */ -#define USBHS_HSTDMASTATUS_CHANN_ENB (0x1u << 0) /**< \brief (USBHS_HSTDMASTATUS) Channel Enable Status */ -#define USBHS_HSTDMASTATUS_CHANN_ACT (0x1u << 1) /**< \brief (USBHS_HSTDMASTATUS) Channel Active Status */ -#define USBHS_HSTDMASTATUS_END_TR_ST (0x1u << 4) /**< \brief (USBHS_HSTDMASTATUS) End of Channel Transfer Status */ -#define USBHS_HSTDMASTATUS_END_BF_ST (0x1u << 5) /**< \brief (USBHS_HSTDMASTATUS) End of Channel Buffer Status */ -#define USBHS_HSTDMASTATUS_DESC_LDST (0x1u << 6) /**< \brief (USBHS_HSTDMASTATUS) Descriptor Loaded Status */ -#define USBHS_HSTDMASTATUS_BUFF_COUNT_Pos 16 -#define USBHS_HSTDMASTATUS_BUFF_COUNT_Msk (0xffffu << USBHS_HSTDMASTATUS_BUFF_COUNT_Pos) /**< \brief (USBHS_HSTDMASTATUS) Buffer Byte Count */ -#define USBHS_HSTDMASTATUS_BUFF_COUNT(value) ((USBHS_HSTDMASTATUS_BUFF_COUNT_Msk & ((value) << USBHS_HSTDMASTATUS_BUFF_COUNT_Pos))) -/* -------- USBHS_CTRL : (USBHS Offset: 0x0800) General Control Register -------- */ -#define USBHS_CTRL_RDERRE (0x1u << 4) /**< \brief (USBHS_CTRL) Remote Device Connection Error Interrupt Enable */ -#define USBHS_CTRL_FRZCLK (0x1u << 14) /**< \brief (USBHS_CTRL) Freeze USB Clock */ -#define USBHS_CTRL_USBE (0x1u << 15) /**< \brief (USBHS_CTRL) USBHS Enable */ -#define USBHS_CTRL_UIMOD (0x1u << 25) /**< \brief (USBHS_CTRL) USBHS Mode */ -#define USBHS_CTRL_UIMOD_HOST (0x0u << 25) /**< \brief (USBHS_CTRL) The module is in USB Host mode. */ -#define USBHS_CTRL_UIMOD_DEVICE (0x1u << 25) /**< \brief (USBHS_CTRL) The module is in USB Device mode. */ -/* -------- USBHS_SR : (USBHS Offset: 0x0804) General Status Register -------- */ -#define USBHS_SR_RDERRI (0x1u << 4) /**< \brief (USBHS_SR) Remote Device Connection Error Interrupt (Host mode only) */ -#define USBHS_SR_VBUSRQ (0x1u << 9) /**< \brief (USBHS_SR) VBus Request (Host mode only) */ -#define USBHS_SR_SPEED_Pos 12 -#define USBHS_SR_SPEED_Msk (0x3u << USBHS_SR_SPEED_Pos) /**< \brief (USBHS_SR) Speed Status (Device mode only) */ -#define USBHS_SR_SPEED_FULL_SPEED (0x0u << 12) /**< \brief (USBHS_SR) Full-Speed mode */ -#define USBHS_SR_SPEED_HIGH_SPEED (0x1u << 12) /**< \brief (USBHS_SR) High-Speed mode */ -#define USBHS_SR_SPEED_LOW_SPEED (0x2u << 12) /**< \brief (USBHS_SR) Low-Speed mode */ -#define USBHS_SR_CLKUSABLE (0x1u << 14) /**< \brief (USBHS_SR) UTMI Clock Usable */ -/* -------- USBHS_SCR : (USBHS Offset: 0x0808) General Status Clear Register -------- */ -#define USBHS_SCR_RDERRIC (0x1u << 4) /**< \brief (USBHS_SCR) Remote Device Connection Error Interrupt Clear */ -#define USBHS_SCR_VBUSRQC (0x1u << 9) /**< \brief (USBHS_SCR) VBus Request Clear */ -/* -------- USBHS_SFR : (USBHS Offset: 0x080C) General Status Set Register -------- */ -#define USBHS_SFR_RDERRIS (0x1u << 4) /**< \brief (USBHS_SFR) Remote Device Connection Error Interrupt Set */ -#define USBHS_SFR_VBUSRQS (0x1u << 9) /**< \brief (USBHS_SFR) VBus Request Set */ -/* -------- USBHS_TSTA1 : (USBHS Offset: 0x0810) General Test A1 Register -------- */ -#define USBHS_TSTA1_CounterA_Pos 0 -#define USBHS_TSTA1_CounterA_Msk (0x7fffu << USBHS_TSTA1_CounterA_Pos) /**< \brief (USBHS_TSTA1) Counter A */ -#define USBHS_TSTA1_CounterA(value) ((USBHS_TSTA1_CounterA_Msk & ((value) << USBHS_TSTA1_CounterA_Pos))) -#define USBHS_TSTA1_LoadCntA (0x1u << 15) /**< \brief (USBHS_TSTA1) Load CounterA */ -#define USBHS_TSTA1_CounterB_Pos 16 -#define USBHS_TSTA1_CounterB_Msk (0x3fu << USBHS_TSTA1_CounterB_Pos) /**< \brief (USBHS_TSTA1) Counter B */ -#define USBHS_TSTA1_CounterB(value) ((USBHS_TSTA1_CounterB_Msk & ((value) << USBHS_TSTA1_CounterB_Pos))) -#define USBHS_TSTA1_LoadCntB (0x1u << 23) /**< \brief (USBHS_TSTA1) Load CounterB */ -#define USBHS_TSTA1_SOFCntMa1_Pos 24 -#define USBHS_TSTA1_SOFCntMa1_Msk (0x7fu << USBHS_TSTA1_SOFCntMa1_Pos) /**< \brief (USBHS_TSTA1) SOF Counter Max */ -#define USBHS_TSTA1_SOFCntMa1(value) ((USBHS_TSTA1_SOFCntMa1_Msk & ((value) << USBHS_TSTA1_SOFCntMa1_Pos))) -#define USBHS_TSTA1_LoadSOFCnt (0x1u << 31) /**< \brief (USBHS_TSTA1) Load SOF Counter */ -/* -------- USBHS_TSTA2 : (USBHS Offset: 0x0814) General Test A2 Register -------- */ -#define USBHS_TSTA2_FullDetachEn (0x1u << 0) /**< \brief (USBHS_TSTA2) Full Detach Enable */ -#define USBHS_TSTA2_HSSerialMode (0x1u << 1) /**< \brief (USBHS_TSTA2) HS Serial Mode */ -#define USBHS_TSTA2_LoopBackMode (0x1u << 2) /**< \brief (USBHS_TSTA2) Loop-back Mode */ -#define USBHS_TSTA2_DisableGatedClock (0x1u << 3) /**< \brief (USBHS_TSTA2) Disable Gated Clock */ -#define USBHS_TSTA2_ForceSuspendMTo1 (0x1u << 4) /**< \brief (USBHS_TSTA2) Force SuspendM to 1 */ -#define USBHS_TSTA2_ByPassDpll (0x1u << 5) /**< \brief (USBHS_TSTA2) Bypass DPLL */ -#define USBHS_TSTA2_HostHSDisconnectDisable (0x1u << 6) /**< \brief (USBHS_TSTA2) Host HS Disconnect Disable */ -#define USBHS_TSTA2_ForceHSRst_50ms (0x1u << 7) /**< \brief (USBHS_TSTA2) Force HS Reset to 50 ms */ -#define USBHS_TSTA2_RemovePUWhenTX (0x1u << 9) /**< \brief (USBHS_TSTA2) Remove Pull-up When TX */ -/* -------- USBHS_VERSION : (USBHS Offset: 0x0818) General Version Register -------- */ -#define USBHS_VERSION_VERSION_Pos 0 -#define USBHS_VERSION_VERSION_Msk (0xfffu << USBHS_VERSION_VERSION_Pos) /**< \brief (USBHS_VERSION) Version Number */ -#define USBHS_VERSION_MFN_Pos 16 -#define USBHS_VERSION_MFN_Msk (0xfu << USBHS_VERSION_MFN_Pos) /**< \brief (USBHS_VERSION) Metal Fix Number */ -/* -------- USBHS_FSM : (USBHS Offset: 0x082C) General Finite State Machine Register -------- */ -#define USBHS_FSM_DRDSTATE_Pos 0 -#define USBHS_FSM_DRDSTATE_Msk (0xfu << USBHS_FSM_DRDSTATE_Pos) /**< \brief (USBHS_FSM) Dual Role Device State */ -#define USBHS_FSM_DRDSTATE_A_IDLESTATE (0x0u << 0) /**< \brief (USBHS_FSM) This is the start state for A-devices (when the ID pin is 0) */ -#define USBHS_FSM_DRDSTATE_A_WAIT_VRISE (0x1u << 0) /**< \brief (USBHS_FSM) In this state, the A-device waits for the voltage on VBus to rise above the A-device VBus Valid threshold (4.4 V). */ -#define USBHS_FSM_DRDSTATE_A_WAIT_BCON (0x2u << 0) /**< \brief (USBHS_FSM) In this state, the A-device waits for the B-device to signal a connection. */ -#define USBHS_FSM_DRDSTATE_A_HOST (0x3u << 0) /**< \brief (USBHS_FSM) In this state, the A-device that operates in Host mode is operational. */ -#define USBHS_FSM_DRDSTATE_A_SUSPEND (0x4u << 0) /**< \brief (USBHS_FSM) The A-device operating as a host is in the Suspend mode. */ -#define USBHS_FSM_DRDSTATE_A_PERIPHERAL (0x5u << 0) /**< \brief (USBHS_FSM) The A-device operates as a peripheral. */ -#define USBHS_FSM_DRDSTATE_A_WAIT_VFALL (0x6u << 0) /**< \brief (USBHS_FSM) In this state, the A-device waits for the voltage on VBus to drop below the A-device Session Valid threshold (1.4 V). */ -#define USBHS_FSM_DRDSTATE_A_VBUS_ERR (0x7u << 0) /**< \brief (USBHS_FSM) In this state, the A-device waits for recovery of the over-current condition that caused it to enter this state. */ -#define USBHS_FSM_DRDSTATE_A_WAIT_DISCHARGE (0x8u << 0) /**< \brief (USBHS_FSM) In this state, the A-device waits for the data USB line to discharge (100 us). */ -#define USBHS_FSM_DRDSTATE_B_IDLE (0x9u << 0) /**< \brief (USBHS_FSM) This is the start state for B-device (when the ID pin is 1). */ -#define USBHS_FSM_DRDSTATE_B_PERIPHERAL (0xAu << 0) /**< \brief (USBHS_FSM) In this state, the B-device acts as the peripheral. */ -#define USBHS_FSM_DRDSTATE_B_WAIT_BEGIN_HNP (0xBu << 0) /**< \brief (USBHS_FSM) In this state, the B-device is in Suspend mode and waits until 3 ms before initiating the HNP protocol if requested. */ -#define USBHS_FSM_DRDSTATE_B_WAIT_DISCHARGE (0xCu << 0) /**< \brief (USBHS_FSM) In this state, the B-device waits for the data USB line to discharge (100 us)) before becoming Host. */ -#define USBHS_FSM_DRDSTATE_B_WAIT_ACON (0xDu << 0) /**< \brief (USBHS_FSM) In this state, the B-device waits for the A-device to signal a connect before becoming B-Host. */ -#define USBHS_FSM_DRDSTATE_B_HOST (0xEu << 0) /**< \brief (USBHS_FSM) In this state, the B-device acts as the Host. */ -#define USBHS_FSM_DRDSTATE_B_SRP_INIT (0xFu << 0) /**< \brief (USBHS_FSM) In this state, the B-device attempts to start a session using the SRP protocol. */ - -/*@}*/ - - -#endif /* _SAMV71_USBHS_COMPONENT_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_utmi.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_utmi.h deleted file mode 100644 index 682c48d3..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_utmi.h +++ /dev/null @@ -1,63 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_UTMI_COMPONENT_ -#define _SAMV71_UTMI_COMPONENT_ - -/* ============================================================================= */ -/** SOFTWARE API DEFINITION FOR USB Transmitter Interface Macrocell */ -/* ============================================================================= */ -/** \addtogroup SAMV71_UTMI USB Transmitter Interface Macrocell */ -/*@{*/ - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -/** \brief Utmi hardware registers */ -typedef struct { - __I uint32_t Reserved1[4]; - __IO uint32_t UTMI_OHCIICR; /**< \brief (Utmi Offset: 0x10) OHCI Interrupt Configuration Register */ - __I uint32_t Reserved2[7]; - __IO uint32_t UTMI_CKTRIM; /**< \brief (Utmi Offset: 0x30) UTMI Clock Trimming Register */ -} Utmi; -#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/* -------- UTMI_OHCIICR : (UTMI Offset: 0x10) OHCI Interrupt Configuration Register -------- */ -#define UTMI_OHCIICR_RES0 (0x1u << 0) /**< \brief (UTMI_OHCIICR) USB PORTx Reset */ -#define UTMI_OHCIICR_ARIE (0x1u << 4) /**< \brief (UTMI_OHCIICR) OHCI Asynchronous Resume Interrupt Enable */ -#define UTMI_OHCIICR_APPSTART (0x1u << 5) /**< \brief (UTMI_OHCIICR) Reserved */ -#define UTMI_OHCIICR_UDPPUDIS (0x1u << 23) /**< \brief (UTMI_OHCIICR) USB Device Pull-up Disable */ -/* -------- UTMI_CKTRIM : (UTMI Offset: 0x30) UTMI Clock Trimming Register -------- */ -#define UTMI_CKTRIM_FREQ_Pos 0 -#define UTMI_CKTRIM_FREQ_Msk (0x3u << UTMI_CKTRIM_FREQ_Pos) /**< \brief (UTMI_CKTRIM) UTMI Reference Clock Frequency */ -#define UTMI_CKTRIM_FREQ(value) ((UTMI_CKTRIM_FREQ_Msk & ((value) << UTMI_CKTRIM_FREQ_Pos))) -#define UTMI_CKTRIM_FREQ_XTAL12 (0x0u << 0) /**< \brief (UTMI_CKTRIM) 12 MHz reference clock */ -#define UTMI_CKTRIM_FREQ_XTAL16 (0x1u << 0) /**< \brief (UTMI_CKTRIM) 16 MHz reference clock */ - -/*@}*/ - - -#endif /* _SAMV71_UTMI_COMPONENT_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_wdt.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_wdt.h deleted file mode 100644 index 1e2ac187..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_wdt.h +++ /dev/null @@ -1,72 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_WDT_COMPONENT_ -#define _SAMV71_WDT_COMPONENT_ - -/* ============================================================================= */ -/** SOFTWARE API DEFINITION FOR Watchdog Timer */ -/* ============================================================================= */ -/** \addtogroup SAMV71_WDT Watchdog Timer */ -/*@{*/ - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -/** \brief Wdt hardware registers */ -typedef struct { - __O uint32_t WDT_CR; /**< \brief (Wdt Offset: 0x00) Control Register */ - __IO uint32_t WDT_MR; /**< \brief (Wdt Offset: 0x04) Mode Register */ - __I uint32_t WDT_SR; /**< \brief (Wdt Offset: 0x08) Status Register */ -} Wdt; -#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/* -------- WDT_CR : (WDT Offset: 0x00) Control Register -------- */ -#define WDT_CR_WDRSTT (0x1u << 0) /**< \brief (WDT_CR) Watchdog Restart */ -#define WDT_CR_KEY_Pos 24 -#define WDT_CR_KEY_Msk (0xffu << WDT_CR_KEY_Pos) /**< \brief (WDT_CR) Password */ -#define WDT_CR_KEY(value) ((WDT_CR_KEY_Msk & ((value) << WDT_CR_KEY_Pos))) -#define WDT_CR_KEY_PASSWD (0xA5u << 24) /**< \brief (WDT_CR) Writing any other value in this field aborts the write operation. */ -/* -------- WDT_MR : (WDT Offset: 0x04) Mode Register -------- */ -#define WDT_MR_WDV_Pos 0 -#define WDT_MR_WDV_Msk (0xfffu << WDT_MR_WDV_Pos) /**< \brief (WDT_MR) Watchdog Counter Value */ -#define WDT_MR_WDV(value) ((WDT_MR_WDV_Msk & ((value) << WDT_MR_WDV_Pos))) -#define WDT_MR_WDFIEN (0x1u << 12) /**< \brief (WDT_MR) Watchdog Fault Interrupt Enable */ -#define WDT_MR_WDRSTEN (0x1u << 13) /**< \brief (WDT_MR) Watchdog Reset Enable */ -#define WDT_MR_WDDIS (0x1u << 15) /**< \brief (WDT_MR) Watchdog Disable */ -#define WDT_MR_WDD_Pos 16 -#define WDT_MR_WDD_Msk (0xfffu << WDT_MR_WDD_Pos) /**< \brief (WDT_MR) Watchdog Delta Value */ -#define WDT_MR_WDD(value) ((WDT_MR_WDD_Msk & ((value) << WDT_MR_WDD_Pos))) -#define WDT_MR_WDDBGHLT (0x1u << 28) /**< \brief (WDT_MR) Watchdog Debug Halt */ -#define WDT_MR_WDIDLEHLT (0x1u << 29) /**< \brief (WDT_MR) Watchdog Idle Halt */ -/* -------- WDT_SR : (WDT Offset: 0x08) Status Register -------- */ -#define WDT_SR_WDUNF (0x1u << 0) /**< \brief (WDT_SR) Watchdog Underflow (cleared on read) */ -#define WDT_SR_WDERR (0x1u << 1) /**< \brief (WDT_SR) Watchdog Error (cleared on read) */ - -/*@}*/ - - -#endif /* _SAMV71_WDT_COMPONENT_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_xdmac.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_xdmac.h deleted file mode 100644 index 4e23710a..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/component/component_xdmac.h +++ /dev/null @@ -1,619 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_XDMAC_COMPONENT_ -#define _SAMV71_XDMAC_COMPONENT_ - -/* ============================================================================= */ -/** SOFTWARE API DEFINITION FOR Extensible DMA Controller */ -/* ============================================================================= */ -/** \addtogroup SAMV71_XDMAC Extensible DMA Controller */ -/*@{*/ - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -/** \brief XdmacChid hardware registers */ -typedef struct { - __O uint32_t XDMAC_CIE; /**< \brief (XdmacChid Offset: 0x0) Channel Interrupt Enable Register */ - __O uint32_t XDMAC_CID; /**< \brief (XdmacChid Offset: 0x4) Channel Interrupt Disable Register */ - __O uint32_t XDMAC_CIM; /**< \brief (XdmacChid Offset: 0x8) Channel Interrupt Mask Register */ - __I uint32_t XDMAC_CIS; /**< \brief (XdmacChid Offset: 0xC) Channel Interrupt Status Register */ - __IO uint32_t XDMAC_CSA; /**< \brief (XdmacChid Offset: 0x10) Channel Source Address Register */ - __IO uint32_t XDMAC_CDA; /**< \brief (XdmacChid Offset: 0x14) Channel Destination Address Register */ - __IO uint32_t XDMAC_CNDA; /**< \brief (XdmacChid Offset: 0x18) Channel Next Descriptor Address Register */ - __IO uint32_t XDMAC_CNDC; /**< \brief (XdmacChid Offset: 0x1C) Channel Next Descriptor Control Register */ - __IO uint32_t XDMAC_CUBC; /**< \brief (XdmacChid Offset: 0x20) Channel Microblock Control Register */ - __IO uint32_t XDMAC_CBC; /**< \brief (XdmacChid Offset: 0x24) Channel Block Control Register */ - __IO uint32_t XDMAC_CC; /**< \brief (XdmacChid Offset: 0x28) Channel Configuration Register */ - __IO uint32_t XDMAC_CDS_MSP; /**< \brief (XdmacChid Offset: 0x2C) Channel Data Stride Memory Set Pattern */ - __IO uint32_t XDMAC_CSUS; /**< \brief (XdmacChid Offset: 0x30) Channel Source Microblock Stride */ - __IO uint32_t XDMAC_CDUS; /**< \brief (XdmacChid Offset: 0x34) Channel Destination Microblock Stride */ - __I uint32_t Reserved1[2]; -} XdmacChid; -/** \brief Xdmac hardware registers */ -#define XDMACCHID_NUMBER 24 -typedef struct { - __IO uint32_t XDMAC_GTYPE; /**< \brief (Xdmac Offset: 0x00) Global Type Register */ - __I uint32_t XDMAC_GCFG; /**< \brief (Xdmac Offset: 0x04) Global Configuration Register */ - __IO uint32_t XDMAC_GWAC; /**< \brief (Xdmac Offset: 0x08) Global Weighted Arbiter Configuration Register */ - __O uint32_t XDMAC_GIE; /**< \brief (Xdmac Offset: 0x0C) Global Interrupt Enable Register */ - __O uint32_t XDMAC_GID; /**< \brief (Xdmac Offset: 0x10) Global Interrupt Disable Register */ - __I uint32_t XDMAC_GIM; /**< \brief (Xdmac Offset: 0x14) Global Interrupt Mask Register */ - __I uint32_t XDMAC_GIS; /**< \brief (Xdmac Offset: 0x18) Global Interrupt Status Register */ - __O uint32_t XDMAC_GE; /**< \brief (Xdmac Offset: 0x1C) Global Channel Enable Register */ - __O uint32_t XDMAC_GD; /**< \brief (Xdmac Offset: 0x20) Global Channel Disable Register */ - __I uint32_t XDMAC_GS; /**< \brief (Xdmac Offset: 0x24) Global Channel Status Register */ - __IO uint32_t XDMAC_GRS; /**< \brief (Xdmac Offset: 0x28) Global Channel Read Suspend Register */ - __IO uint32_t XDMAC_GWS; /**< \brief (Xdmac Offset: 0x2C) Global Channel Write Suspend Register */ - __O uint32_t XDMAC_GRWS; /**< \brief (Xdmac Offset: 0x30) Global Channel Read Write Suspend Register */ - __O uint32_t XDMAC_GRWR; /**< \brief (Xdmac Offset: 0x34) Global Channel Read Write Resume Register */ - __O uint32_t XDMAC_GSWR; /**< \brief (Xdmac Offset: 0x38) Global Channel Software Request Register */ - __I uint32_t XDMAC_GSWS; /**< \brief (Xdmac Offset: 0x3C) Global Channel Software Request Status Register */ - __O uint32_t XDMAC_GSWF; /**< \brief (Xdmac Offset: 0x40) Global Channel Software Flush Request Register */ - __I uint32_t Reserved1[3]; - XdmacChid XDMAC_CHID[XDMACCHID_NUMBER]; /**< \brief (Xdmac Offset: 0x50) chid = 0 .. 23 */ -} Xdmac; -#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/* -------- XDMAC_GTYPE : (XDMAC Offset: 0x00) Global Type Register -------- */ -#define XDMAC_GTYPE_NB_CH_Pos 0 -#define XDMAC_GTYPE_NB_CH_Msk (0x1fu << XDMAC_GTYPE_NB_CH_Pos) /**< \brief (XDMAC_GTYPE) Number of Channels Minus One */ -#define XDMAC_GTYPE_NB_CH(value) ((XDMAC_GTYPE_NB_CH_Msk & ((value) << XDMAC_GTYPE_NB_CH_Pos))) -#define XDMAC_GTYPE_FIFO_SZ_Pos 5 -#define XDMAC_GTYPE_FIFO_SZ_Msk (0x7ffu << XDMAC_GTYPE_FIFO_SZ_Pos) /**< \brief (XDMAC_GTYPE) Number of Bytes */ -#define XDMAC_GTYPE_FIFO_SZ(value) ((XDMAC_GTYPE_FIFO_SZ_Msk & ((value) << XDMAC_GTYPE_FIFO_SZ_Pos))) -#define XDMAC_GTYPE_NB_REQ_Pos 16 -#define XDMAC_GTYPE_NB_REQ_Msk (0x7fu << XDMAC_GTYPE_NB_REQ_Pos) /**< \brief (XDMAC_GTYPE) Number of Peripheral Requests Minus One */ -#define XDMAC_GTYPE_NB_REQ(value) ((XDMAC_GTYPE_NB_REQ_Msk & ((value) << XDMAC_GTYPE_NB_REQ_Pos))) -/* -------- XDMAC_GCFG : (XDMAC Offset: 0x04) Global Configuration Register -------- */ -#define XDMAC_GCFG_CGDISREG (0x1u << 0) /**< \brief (XDMAC_GCFG) Configuration Registers Clock Gating Disable */ -#define XDMAC_GCFG_CGDISPIPE (0x1u << 1) /**< \brief (XDMAC_GCFG) Pipeline Clock Gating Disable */ -#define XDMAC_GCFG_CGDISFIFO (0x1u << 2) /**< \brief (XDMAC_GCFG) FIFO Clock Gating Disable */ -#define XDMAC_GCFG_CGDISIF (0x1u << 3) /**< \brief (XDMAC_GCFG) Bus Interface Clock Gating Disable */ -#define XDMAC_GCFG_BXKBEN (0x1u << 8) /**< \brief (XDMAC_GCFG) Boundary X Kilo byte Enable */ -/* -------- XDMAC_GWAC : (XDMAC Offset: 0x08) Global Weighted Arbiter Configuration Register -------- */ -#define XDMAC_GWAC_PW0_Pos 0 -#define XDMAC_GWAC_PW0_Msk (0xfu << XDMAC_GWAC_PW0_Pos) /**< \brief (XDMAC_GWAC) Pool Weight 0 */ -#define XDMAC_GWAC_PW0(value) ((XDMAC_GWAC_PW0_Msk & ((value) << XDMAC_GWAC_PW0_Pos))) -#define XDMAC_GWAC_PW1_Pos 4 -#define XDMAC_GWAC_PW1_Msk (0xfu << XDMAC_GWAC_PW1_Pos) /**< \brief (XDMAC_GWAC) Pool Weight 1 */ -#define XDMAC_GWAC_PW1(value) ((XDMAC_GWAC_PW1_Msk & ((value) << XDMAC_GWAC_PW1_Pos))) -#define XDMAC_GWAC_PW2_Pos 8 -#define XDMAC_GWAC_PW2_Msk (0xfu << XDMAC_GWAC_PW2_Pos) /**< \brief (XDMAC_GWAC) Pool Weight 2 */ -#define XDMAC_GWAC_PW2(value) ((XDMAC_GWAC_PW2_Msk & ((value) << XDMAC_GWAC_PW2_Pos))) -#define XDMAC_GWAC_PW3_Pos 12 -#define XDMAC_GWAC_PW3_Msk (0xfu << XDMAC_GWAC_PW3_Pos) /**< \brief (XDMAC_GWAC) Pool Weight 3 */ -#define XDMAC_GWAC_PW3(value) ((XDMAC_GWAC_PW3_Msk & ((value) << XDMAC_GWAC_PW3_Pos))) -/* -------- XDMAC_GIE : (XDMAC Offset: 0x0C) Global Interrupt Enable Register -------- */ -#define XDMAC_GIE_IE0 (0x1u << 0) /**< \brief (XDMAC_GIE) XDMAC Channel 0 Interrupt Enable Bit */ -#define XDMAC_GIE_IE1 (0x1u << 1) /**< \brief (XDMAC_GIE) XDMAC Channel 1 Interrupt Enable Bit */ -#define XDMAC_GIE_IE2 (0x1u << 2) /**< \brief (XDMAC_GIE) XDMAC Channel 2 Interrupt Enable Bit */ -#define XDMAC_GIE_IE3 (0x1u << 3) /**< \brief (XDMAC_GIE) XDMAC Channel 3 Interrupt Enable Bit */ -#define XDMAC_GIE_IE4 (0x1u << 4) /**< \brief (XDMAC_GIE) XDMAC Channel 4 Interrupt Enable Bit */ -#define XDMAC_GIE_IE5 (0x1u << 5) /**< \brief (XDMAC_GIE) XDMAC Channel 5 Interrupt Enable Bit */ -#define XDMAC_GIE_IE6 (0x1u << 6) /**< \brief (XDMAC_GIE) XDMAC Channel 6 Interrupt Enable Bit */ -#define XDMAC_GIE_IE7 (0x1u << 7) /**< \brief (XDMAC_GIE) XDMAC Channel 7 Interrupt Enable Bit */ -#define XDMAC_GIE_IE8 (0x1u << 8) /**< \brief (XDMAC_GIE) XDMAC Channel 8 Interrupt Enable Bit */ -#define XDMAC_GIE_IE9 (0x1u << 9) /**< \brief (XDMAC_GIE) XDMAC Channel 9 Interrupt Enable Bit */ -#define XDMAC_GIE_IE10 (0x1u << 10) /**< \brief (XDMAC_GIE) XDMAC Channel 10 Interrupt Enable Bit */ -#define XDMAC_GIE_IE11 (0x1u << 11) /**< \brief (XDMAC_GIE) XDMAC Channel 11 Interrupt Enable Bit */ -#define XDMAC_GIE_IE12 (0x1u << 12) /**< \brief (XDMAC_GIE) XDMAC Channel 12 Interrupt Enable Bit */ -#define XDMAC_GIE_IE13 (0x1u << 13) /**< \brief (XDMAC_GIE) XDMAC Channel 13 Interrupt Enable Bit */ -#define XDMAC_GIE_IE14 (0x1u << 14) /**< \brief (XDMAC_GIE) XDMAC Channel 14 Interrupt Enable Bit */ -#define XDMAC_GIE_IE15 (0x1u << 15) /**< \brief (XDMAC_GIE) XDMAC Channel 15 Interrupt Enable Bit */ -#define XDMAC_GIE_IE16 (0x1u << 16) /**< \brief (XDMAC_GIE) XDMAC Channel 16 Interrupt Enable Bit */ -#define XDMAC_GIE_IE17 (0x1u << 17) /**< \brief (XDMAC_GIE) XDMAC Channel 17 Interrupt Enable Bit */ -#define XDMAC_GIE_IE18 (0x1u << 18) /**< \brief (XDMAC_GIE) XDMAC Channel 18 Interrupt Enable Bit */ -#define XDMAC_GIE_IE19 (0x1u << 19) /**< \brief (XDMAC_GIE) XDMAC Channel 19 Interrupt Enable Bit */ -#define XDMAC_GIE_IE20 (0x1u << 20) /**< \brief (XDMAC_GIE) XDMAC Channel 20 Interrupt Enable Bit */ -#define XDMAC_GIE_IE21 (0x1u << 21) /**< \brief (XDMAC_GIE) XDMAC Channel 21 Interrupt Enable Bit */ -#define XDMAC_GIE_IE22 (0x1u << 22) /**< \brief (XDMAC_GIE) XDMAC Channel 22 Interrupt Enable Bit */ -#define XDMAC_GIE_IE23 (0x1u << 23) /**< \brief (XDMAC_GIE) XDMAC Channel 23 Interrupt Enable Bit */ -/* -------- XDMAC_GID : (XDMAC Offset: 0x10) Global Interrupt Disable Register -------- */ -#define XDMAC_GID_ID0 (0x1u << 0) /**< \brief (XDMAC_GID) XDMAC Channel 0 Interrupt Disable Bit */ -#define XDMAC_GID_ID1 (0x1u << 1) /**< \brief (XDMAC_GID) XDMAC Channel 1 Interrupt Disable Bit */ -#define XDMAC_GID_ID2 (0x1u << 2) /**< \brief (XDMAC_GID) XDMAC Channel 2 Interrupt Disable Bit */ -#define XDMAC_GID_ID3 (0x1u << 3) /**< \brief (XDMAC_GID) XDMAC Channel 3 Interrupt Disable Bit */ -#define XDMAC_GID_ID4 (0x1u << 4) /**< \brief (XDMAC_GID) XDMAC Channel 4 Interrupt Disable Bit */ -#define XDMAC_GID_ID5 (0x1u << 5) /**< \brief (XDMAC_GID) XDMAC Channel 5 Interrupt Disable Bit */ -#define XDMAC_GID_ID6 (0x1u << 6) /**< \brief (XDMAC_GID) XDMAC Channel 6 Interrupt Disable Bit */ -#define XDMAC_GID_ID7 (0x1u << 7) /**< \brief (XDMAC_GID) XDMAC Channel 7 Interrupt Disable Bit */ -#define XDMAC_GID_ID8 (0x1u << 8) /**< \brief (XDMAC_GID) XDMAC Channel 8 Interrupt Disable Bit */ -#define XDMAC_GID_ID9 (0x1u << 9) /**< \brief (XDMAC_GID) XDMAC Channel 9 Interrupt Disable Bit */ -#define XDMAC_GID_ID10 (0x1u << 10) /**< \brief (XDMAC_GID) XDMAC Channel 10 Interrupt Disable Bit */ -#define XDMAC_GID_ID11 (0x1u << 11) /**< \brief (XDMAC_GID) XDMAC Channel 11 Interrupt Disable Bit */ -#define XDMAC_GID_ID12 (0x1u << 12) /**< \brief (XDMAC_GID) XDMAC Channel 12 Interrupt Disable Bit */ -#define XDMAC_GID_ID13 (0x1u << 13) /**< \brief (XDMAC_GID) XDMAC Channel 13 Interrupt Disable Bit */ -#define XDMAC_GID_ID14 (0x1u << 14) /**< \brief (XDMAC_GID) XDMAC Channel 14 Interrupt Disable Bit */ -#define XDMAC_GID_ID15 (0x1u << 15) /**< \brief (XDMAC_GID) XDMAC Channel 15 Interrupt Disable Bit */ -#define XDMAC_GID_ID16 (0x1u << 16) /**< \brief (XDMAC_GID) XDMAC Channel 16 Interrupt Disable Bit */ -#define XDMAC_GID_ID17 (0x1u << 17) /**< \brief (XDMAC_GID) XDMAC Channel 17 Interrupt Disable Bit */ -#define XDMAC_GID_ID18 (0x1u << 18) /**< \brief (XDMAC_GID) XDMAC Channel 18 Interrupt Disable Bit */ -#define XDMAC_GID_ID19 (0x1u << 19) /**< \brief (XDMAC_GID) XDMAC Channel 19 Interrupt Disable Bit */ -#define XDMAC_GID_ID20 (0x1u << 20) /**< \brief (XDMAC_GID) XDMAC Channel 20 Interrupt Disable Bit */ -#define XDMAC_GID_ID21 (0x1u << 21) /**< \brief (XDMAC_GID) XDMAC Channel 21 Interrupt Disable Bit */ -#define XDMAC_GID_ID22 (0x1u << 22) /**< \brief (XDMAC_GID) XDMAC Channel 22 Interrupt Disable Bit */ -#define XDMAC_GID_ID23 (0x1u << 23) /**< \brief (XDMAC_GID) XDMAC Channel 23 Interrupt Disable Bit */ -/* -------- XDMAC_GIM : (XDMAC Offset: 0x14) Global Interrupt Mask Register -------- */ -#define XDMAC_GIM_IM0 (0x1u << 0) /**< \brief (XDMAC_GIM) XDMAC Channel 0 Interrupt Mask Bit */ -#define XDMAC_GIM_IM1 (0x1u << 1) /**< \brief (XDMAC_GIM) XDMAC Channel 1 Interrupt Mask Bit */ -#define XDMAC_GIM_IM2 (0x1u << 2) /**< \brief (XDMAC_GIM) XDMAC Channel 2 Interrupt Mask Bit */ -#define XDMAC_GIM_IM3 (0x1u << 3) /**< \brief (XDMAC_GIM) XDMAC Channel 3 Interrupt Mask Bit */ -#define XDMAC_GIM_IM4 (0x1u << 4) /**< \brief (XDMAC_GIM) XDMAC Channel 4 Interrupt Mask Bit */ -#define XDMAC_GIM_IM5 (0x1u << 5) /**< \brief (XDMAC_GIM) XDMAC Channel 5 Interrupt Mask Bit */ -#define XDMAC_GIM_IM6 (0x1u << 6) /**< \brief (XDMAC_GIM) XDMAC Channel 6 Interrupt Mask Bit */ -#define XDMAC_GIM_IM7 (0x1u << 7) /**< \brief (XDMAC_GIM) XDMAC Channel 7 Interrupt Mask Bit */ -#define XDMAC_GIM_IM8 (0x1u << 8) /**< \brief (XDMAC_GIM) XDMAC Channel 8 Interrupt Mask Bit */ -#define XDMAC_GIM_IM9 (0x1u << 9) /**< \brief (XDMAC_GIM) XDMAC Channel 9 Interrupt Mask Bit */ -#define XDMAC_GIM_IM10 (0x1u << 10) /**< \brief (XDMAC_GIM) XDMAC Channel 10 Interrupt Mask Bit */ -#define XDMAC_GIM_IM11 (0x1u << 11) /**< \brief (XDMAC_GIM) XDMAC Channel 11 Interrupt Mask Bit */ -#define XDMAC_GIM_IM12 (0x1u << 12) /**< \brief (XDMAC_GIM) XDMAC Channel 12 Interrupt Mask Bit */ -#define XDMAC_GIM_IM13 (0x1u << 13) /**< \brief (XDMAC_GIM) XDMAC Channel 13 Interrupt Mask Bit */ -#define XDMAC_GIM_IM14 (0x1u << 14) /**< \brief (XDMAC_GIM) XDMAC Channel 14 Interrupt Mask Bit */ -#define XDMAC_GIM_IM15 (0x1u << 15) /**< \brief (XDMAC_GIM) XDMAC Channel 15 Interrupt Mask Bit */ -#define XDMAC_GIM_IM16 (0x1u << 16) /**< \brief (XDMAC_GIM) XDMAC Channel 16 Interrupt Mask Bit */ -#define XDMAC_GIM_IM17 (0x1u << 17) /**< \brief (XDMAC_GIM) XDMAC Channel 17 Interrupt Mask Bit */ -#define XDMAC_GIM_IM18 (0x1u << 18) /**< \brief (XDMAC_GIM) XDMAC Channel 18 Interrupt Mask Bit */ -#define XDMAC_GIM_IM19 (0x1u << 19) /**< \brief (XDMAC_GIM) XDMAC Channel 19 Interrupt Mask Bit */ -#define XDMAC_GIM_IM20 (0x1u << 20) /**< \brief (XDMAC_GIM) XDMAC Channel 20 Interrupt Mask Bit */ -#define XDMAC_GIM_IM21 (0x1u << 21) /**< \brief (XDMAC_GIM) XDMAC Channel 21 Interrupt Mask Bit */ -#define XDMAC_GIM_IM22 (0x1u << 22) /**< \brief (XDMAC_GIM) XDMAC Channel 22 Interrupt Mask Bit */ -#define XDMAC_GIM_IM23 (0x1u << 23) /**< \brief (XDMAC_GIM) XDMAC Channel 23 Interrupt Mask Bit */ -/* -------- XDMAC_GIS : (XDMAC Offset: 0x18) Global Interrupt Status Register -------- */ -#define XDMAC_GIS_IS0 (0x1u << 0) /**< \brief (XDMAC_GIS) XDMAC Channel 0 Interrupt Status Bit */ -#define XDMAC_GIS_IS1 (0x1u << 1) /**< \brief (XDMAC_GIS) XDMAC Channel 1 Interrupt Status Bit */ -#define XDMAC_GIS_IS2 (0x1u << 2) /**< \brief (XDMAC_GIS) XDMAC Channel 2 Interrupt Status Bit */ -#define XDMAC_GIS_IS3 (0x1u << 3) /**< \brief (XDMAC_GIS) XDMAC Channel 3 Interrupt Status Bit */ -#define XDMAC_GIS_IS4 (0x1u << 4) /**< \brief (XDMAC_GIS) XDMAC Channel 4 Interrupt Status Bit */ -#define XDMAC_GIS_IS5 (0x1u << 5) /**< \brief (XDMAC_GIS) XDMAC Channel 5 Interrupt Status Bit */ -#define XDMAC_GIS_IS6 (0x1u << 6) /**< \brief (XDMAC_GIS) XDMAC Channel 6 Interrupt Status Bit */ -#define XDMAC_GIS_IS7 (0x1u << 7) /**< \brief (XDMAC_GIS) XDMAC Channel 7 Interrupt Status Bit */ -#define XDMAC_GIS_IS8 (0x1u << 8) /**< \brief (XDMAC_GIS) XDMAC Channel 8 Interrupt Status Bit */ -#define XDMAC_GIS_IS9 (0x1u << 9) /**< \brief (XDMAC_GIS) XDMAC Channel 9 Interrupt Status Bit */ -#define XDMAC_GIS_IS10 (0x1u << 10) /**< \brief (XDMAC_GIS) XDMAC Channel 10 Interrupt Status Bit */ -#define XDMAC_GIS_IS11 (0x1u << 11) /**< \brief (XDMAC_GIS) XDMAC Channel 11 Interrupt Status Bit */ -#define XDMAC_GIS_IS12 (0x1u << 12) /**< \brief (XDMAC_GIS) XDMAC Channel 12 Interrupt Status Bit */ -#define XDMAC_GIS_IS13 (0x1u << 13) /**< \brief (XDMAC_GIS) XDMAC Channel 13 Interrupt Status Bit */ -#define XDMAC_GIS_IS14 (0x1u << 14) /**< \brief (XDMAC_GIS) XDMAC Channel 14 Interrupt Status Bit */ -#define XDMAC_GIS_IS15 (0x1u << 15) /**< \brief (XDMAC_GIS) XDMAC Channel 15 Interrupt Status Bit */ -#define XDMAC_GIS_IS16 (0x1u << 16) /**< \brief (XDMAC_GIS) XDMAC Channel 16 Interrupt Status Bit */ -#define XDMAC_GIS_IS17 (0x1u << 17) /**< \brief (XDMAC_GIS) XDMAC Channel 17 Interrupt Status Bit */ -#define XDMAC_GIS_IS18 (0x1u << 18) /**< \brief (XDMAC_GIS) XDMAC Channel 18 Interrupt Status Bit */ -#define XDMAC_GIS_IS19 (0x1u << 19) /**< \brief (XDMAC_GIS) XDMAC Channel 19 Interrupt Status Bit */ -#define XDMAC_GIS_IS20 (0x1u << 20) /**< \brief (XDMAC_GIS) XDMAC Channel 20 Interrupt Status Bit */ -#define XDMAC_GIS_IS21 (0x1u << 21) /**< \brief (XDMAC_GIS) XDMAC Channel 21 Interrupt Status Bit */ -#define XDMAC_GIS_IS22 (0x1u << 22) /**< \brief (XDMAC_GIS) XDMAC Channel 22 Interrupt Status Bit */ -#define XDMAC_GIS_IS23 (0x1u << 23) /**< \brief (XDMAC_GIS) XDMAC Channel 23 Interrupt Status Bit */ -/* -------- XDMAC_GE : (XDMAC Offset: 0x1C) Global Channel Enable Register -------- */ -#define XDMAC_GE_EN0 (0x1u << 0) /**< \brief (XDMAC_GE) XDMAC Channel 0 Enable Bit */ -#define XDMAC_GE_EN1 (0x1u << 1) /**< \brief (XDMAC_GE) XDMAC Channel 1 Enable Bit */ -#define XDMAC_GE_EN2 (0x1u << 2) /**< \brief (XDMAC_GE) XDMAC Channel 2 Enable Bit */ -#define XDMAC_GE_EN3 (0x1u << 3) /**< \brief (XDMAC_GE) XDMAC Channel 3 Enable Bit */ -#define XDMAC_GE_EN4 (0x1u << 4) /**< \brief (XDMAC_GE) XDMAC Channel 4 Enable Bit */ -#define XDMAC_GE_EN5 (0x1u << 5) /**< \brief (XDMAC_GE) XDMAC Channel 5 Enable Bit */ -#define XDMAC_GE_EN6 (0x1u << 6) /**< \brief (XDMAC_GE) XDMAC Channel 6 Enable Bit */ -#define XDMAC_GE_EN7 (0x1u << 7) /**< \brief (XDMAC_GE) XDMAC Channel 7 Enable Bit */ -#define XDMAC_GE_EN8 (0x1u << 8) /**< \brief (XDMAC_GE) XDMAC Channel 8 Enable Bit */ -#define XDMAC_GE_EN9 (0x1u << 9) /**< \brief (XDMAC_GE) XDMAC Channel 9 Enable Bit */ -#define XDMAC_GE_EN10 (0x1u << 10) /**< \brief (XDMAC_GE) XDMAC Channel 10 Enable Bit */ -#define XDMAC_GE_EN11 (0x1u << 11) /**< \brief (XDMAC_GE) XDMAC Channel 11 Enable Bit */ -#define XDMAC_GE_EN12 (0x1u << 12) /**< \brief (XDMAC_GE) XDMAC Channel 12 Enable Bit */ -#define XDMAC_GE_EN13 (0x1u << 13) /**< \brief (XDMAC_GE) XDMAC Channel 13 Enable Bit */ -#define XDMAC_GE_EN14 (0x1u << 14) /**< \brief (XDMAC_GE) XDMAC Channel 14 Enable Bit */ -#define XDMAC_GE_EN15 (0x1u << 15) /**< \brief (XDMAC_GE) XDMAC Channel 15 Enable Bit */ -#define XDMAC_GE_EN16 (0x1u << 16) /**< \brief (XDMAC_GE) XDMAC Channel 16 Enable Bit */ -#define XDMAC_GE_EN17 (0x1u << 17) /**< \brief (XDMAC_GE) XDMAC Channel 17 Enable Bit */ -#define XDMAC_GE_EN18 (0x1u << 18) /**< \brief (XDMAC_GE) XDMAC Channel 18 Enable Bit */ -#define XDMAC_GE_EN19 (0x1u << 19) /**< \brief (XDMAC_GE) XDMAC Channel 19 Enable Bit */ -#define XDMAC_GE_EN20 (0x1u << 20) /**< \brief (XDMAC_GE) XDMAC Channel 20 Enable Bit */ -#define XDMAC_GE_EN21 (0x1u << 21) /**< \brief (XDMAC_GE) XDMAC Channel 21 Enable Bit */ -#define XDMAC_GE_EN22 (0x1u << 22) /**< \brief (XDMAC_GE) XDMAC Channel 22 Enable Bit */ -#define XDMAC_GE_EN23 (0x1u << 23) /**< \brief (XDMAC_GE) XDMAC Channel 23 Enable Bit */ -/* -------- XDMAC_GD : (XDMAC Offset: 0x20) Global Channel Disable Register -------- */ -#define XDMAC_GD_DI0 (0x1u << 0) /**< \brief (XDMAC_GD) XDMAC Channel 0 Disable Bit */ -#define XDMAC_GD_DI1 (0x1u << 1) /**< \brief (XDMAC_GD) XDMAC Channel 1 Disable Bit */ -#define XDMAC_GD_DI2 (0x1u << 2) /**< \brief (XDMAC_GD) XDMAC Channel 2 Disable Bit */ -#define XDMAC_GD_DI3 (0x1u << 3) /**< \brief (XDMAC_GD) XDMAC Channel 3 Disable Bit */ -#define XDMAC_GD_DI4 (0x1u << 4) /**< \brief (XDMAC_GD) XDMAC Channel 4 Disable Bit */ -#define XDMAC_GD_DI5 (0x1u << 5) /**< \brief (XDMAC_GD) XDMAC Channel 5 Disable Bit */ -#define XDMAC_GD_DI6 (0x1u << 6) /**< \brief (XDMAC_GD) XDMAC Channel 6 Disable Bit */ -#define XDMAC_GD_DI7 (0x1u << 7) /**< \brief (XDMAC_GD) XDMAC Channel 7 Disable Bit */ -#define XDMAC_GD_DI8 (0x1u << 8) /**< \brief (XDMAC_GD) XDMAC Channel 8 Disable Bit */ -#define XDMAC_GD_DI9 (0x1u << 9) /**< \brief (XDMAC_GD) XDMAC Channel 9 Disable Bit */ -#define XDMAC_GD_DI10 (0x1u << 10) /**< \brief (XDMAC_GD) XDMAC Channel 10 Disable Bit */ -#define XDMAC_GD_DI11 (0x1u << 11) /**< \brief (XDMAC_GD) XDMAC Channel 11 Disable Bit */ -#define XDMAC_GD_DI12 (0x1u << 12) /**< \brief (XDMAC_GD) XDMAC Channel 12 Disable Bit */ -#define XDMAC_GD_DI13 (0x1u << 13) /**< \brief (XDMAC_GD) XDMAC Channel 13 Disable Bit */ -#define XDMAC_GD_DI14 (0x1u << 14) /**< \brief (XDMAC_GD) XDMAC Channel 14 Disable Bit */ -#define XDMAC_GD_DI15 (0x1u << 15) /**< \brief (XDMAC_GD) XDMAC Channel 15 Disable Bit */ -#define XDMAC_GD_DI16 (0x1u << 16) /**< \brief (XDMAC_GD) XDMAC Channel 16 Disable Bit */ -#define XDMAC_GD_DI17 (0x1u << 17) /**< \brief (XDMAC_GD) XDMAC Channel 17 Disable Bit */ -#define XDMAC_GD_DI18 (0x1u << 18) /**< \brief (XDMAC_GD) XDMAC Channel 18 Disable Bit */ -#define XDMAC_GD_DI19 (0x1u << 19) /**< \brief (XDMAC_GD) XDMAC Channel 19 Disable Bit */ -#define XDMAC_GD_DI20 (0x1u << 20) /**< \brief (XDMAC_GD) XDMAC Channel 20 Disable Bit */ -#define XDMAC_GD_DI21 (0x1u << 21) /**< \brief (XDMAC_GD) XDMAC Channel 21 Disable Bit */ -#define XDMAC_GD_DI22 (0x1u << 22) /**< \brief (XDMAC_GD) XDMAC Channel 22 Disable Bit */ -#define XDMAC_GD_DI23 (0x1u << 23) /**< \brief (XDMAC_GD) XDMAC Channel 23 Disable Bit */ -/* -------- XDMAC_GS : (XDMAC Offset: 0x24) Global Channel Status Register -------- */ -#define XDMAC_GS_ST0 (0x1u << 0) /**< \brief (XDMAC_GS) XDMAC Channel 0 Status Bit */ -#define XDMAC_GS_ST1 (0x1u << 1) /**< \brief (XDMAC_GS) XDMAC Channel 1 Status Bit */ -#define XDMAC_GS_ST2 (0x1u << 2) /**< \brief (XDMAC_GS) XDMAC Channel 2 Status Bit */ -#define XDMAC_GS_ST3 (0x1u << 3) /**< \brief (XDMAC_GS) XDMAC Channel 3 Status Bit */ -#define XDMAC_GS_ST4 (0x1u << 4) /**< \brief (XDMAC_GS) XDMAC Channel 4 Status Bit */ -#define XDMAC_GS_ST5 (0x1u << 5) /**< \brief (XDMAC_GS) XDMAC Channel 5 Status Bit */ -#define XDMAC_GS_ST6 (0x1u << 6) /**< \brief (XDMAC_GS) XDMAC Channel 6 Status Bit */ -#define XDMAC_GS_ST7 (0x1u << 7) /**< \brief (XDMAC_GS) XDMAC Channel 7 Status Bit */ -#define XDMAC_GS_ST8 (0x1u << 8) /**< \brief (XDMAC_GS) XDMAC Channel 8 Status Bit */ -#define XDMAC_GS_ST9 (0x1u << 9) /**< \brief (XDMAC_GS) XDMAC Channel 9 Status Bit */ -#define XDMAC_GS_ST10 (0x1u << 10) /**< \brief (XDMAC_GS) XDMAC Channel 10 Status Bit */ -#define XDMAC_GS_ST11 (0x1u << 11) /**< \brief (XDMAC_GS) XDMAC Channel 11 Status Bit */ -#define XDMAC_GS_ST12 (0x1u << 12) /**< \brief (XDMAC_GS) XDMAC Channel 12 Status Bit */ -#define XDMAC_GS_ST13 (0x1u << 13) /**< \brief (XDMAC_GS) XDMAC Channel 13 Status Bit */ -#define XDMAC_GS_ST14 (0x1u << 14) /**< \brief (XDMAC_GS) XDMAC Channel 14 Status Bit */ -#define XDMAC_GS_ST15 (0x1u << 15) /**< \brief (XDMAC_GS) XDMAC Channel 15 Status Bit */ -#define XDMAC_GS_ST16 (0x1u << 16) /**< \brief (XDMAC_GS) XDMAC Channel 16 Status Bit */ -#define XDMAC_GS_ST17 (0x1u << 17) /**< \brief (XDMAC_GS) XDMAC Channel 17 Status Bit */ -#define XDMAC_GS_ST18 (0x1u << 18) /**< \brief (XDMAC_GS) XDMAC Channel 18 Status Bit */ -#define XDMAC_GS_ST19 (0x1u << 19) /**< \brief (XDMAC_GS) XDMAC Channel 19 Status Bit */ -#define XDMAC_GS_ST20 (0x1u << 20) /**< \brief (XDMAC_GS) XDMAC Channel 20 Status Bit */ -#define XDMAC_GS_ST21 (0x1u << 21) /**< \brief (XDMAC_GS) XDMAC Channel 21 Status Bit */ -#define XDMAC_GS_ST22 (0x1u << 22) /**< \brief (XDMAC_GS) XDMAC Channel 22 Status Bit */ -#define XDMAC_GS_ST23 (0x1u << 23) /**< \brief (XDMAC_GS) XDMAC Channel 23 Status Bit */ -/* -------- XDMAC_GRS : (XDMAC Offset: 0x28) Global Channel Read Suspend Register -------- */ -#define XDMAC_GRS_RS0 (0x1u << 0) /**< \brief (XDMAC_GRS) XDMAC Channel 0 Read Suspend Bit */ -#define XDMAC_GRS_RS1 (0x1u << 1) /**< \brief (XDMAC_GRS) XDMAC Channel 1 Read Suspend Bit */ -#define XDMAC_GRS_RS2 (0x1u << 2) /**< \brief (XDMAC_GRS) XDMAC Channel 2 Read Suspend Bit */ -#define XDMAC_GRS_RS3 (0x1u << 3) /**< \brief (XDMAC_GRS) XDMAC Channel 3 Read Suspend Bit */ -#define XDMAC_GRS_RS4 (0x1u << 4) /**< \brief (XDMAC_GRS) XDMAC Channel 4 Read Suspend Bit */ -#define XDMAC_GRS_RS5 (0x1u << 5) /**< \brief (XDMAC_GRS) XDMAC Channel 5 Read Suspend Bit */ -#define XDMAC_GRS_RS6 (0x1u << 6) /**< \brief (XDMAC_GRS) XDMAC Channel 6 Read Suspend Bit */ -#define XDMAC_GRS_RS7 (0x1u << 7) /**< \brief (XDMAC_GRS) XDMAC Channel 7 Read Suspend Bit */ -#define XDMAC_GRS_RS8 (0x1u << 8) /**< \brief (XDMAC_GRS) XDMAC Channel 8 Read Suspend Bit */ -#define XDMAC_GRS_RS9 (0x1u << 9) /**< \brief (XDMAC_GRS) XDMAC Channel 9 Read Suspend Bit */ -#define XDMAC_GRS_RS10 (0x1u << 10) /**< \brief (XDMAC_GRS) XDMAC Channel 10 Read Suspend Bit */ -#define XDMAC_GRS_RS11 (0x1u << 11) /**< \brief (XDMAC_GRS) XDMAC Channel 11 Read Suspend Bit */ -#define XDMAC_GRS_RS12 (0x1u << 12) /**< \brief (XDMAC_GRS) XDMAC Channel 12 Read Suspend Bit */ -#define XDMAC_GRS_RS13 (0x1u << 13) /**< \brief (XDMAC_GRS) XDMAC Channel 13 Read Suspend Bit */ -#define XDMAC_GRS_RS14 (0x1u << 14) /**< \brief (XDMAC_GRS) XDMAC Channel 14 Read Suspend Bit */ -#define XDMAC_GRS_RS15 (0x1u << 15) /**< \brief (XDMAC_GRS) XDMAC Channel 15 Read Suspend Bit */ -#define XDMAC_GRS_RS16 (0x1u << 16) /**< \brief (XDMAC_GRS) XDMAC Channel 16 Read Suspend Bit */ -#define XDMAC_GRS_RS17 (0x1u << 17) /**< \brief (XDMAC_GRS) XDMAC Channel 17 Read Suspend Bit */ -#define XDMAC_GRS_RS18 (0x1u << 18) /**< \brief (XDMAC_GRS) XDMAC Channel 18 Read Suspend Bit */ -#define XDMAC_GRS_RS19 (0x1u << 19) /**< \brief (XDMAC_GRS) XDMAC Channel 19 Read Suspend Bit */ -#define XDMAC_GRS_RS20 (0x1u << 20) /**< \brief (XDMAC_GRS) XDMAC Channel 20 Read Suspend Bit */ -#define XDMAC_GRS_RS21 (0x1u << 21) /**< \brief (XDMAC_GRS) XDMAC Channel 21 Read Suspend Bit */ -#define XDMAC_GRS_RS22 (0x1u << 22) /**< \brief (XDMAC_GRS) XDMAC Channel 22 Read Suspend Bit */ -#define XDMAC_GRS_RS23 (0x1u << 23) /**< \brief (XDMAC_GRS) XDMAC Channel 23 Read Suspend Bit */ -/* -------- XDMAC_GWS : (XDMAC Offset: 0x2C) Global Channel Write Suspend Register -------- */ -#define XDMAC_GWS_WS0 (0x1u << 0) /**< \brief (XDMAC_GWS) XDMAC Channel 0 Write Suspend Bit */ -#define XDMAC_GWS_WS1 (0x1u << 1) /**< \brief (XDMAC_GWS) XDMAC Channel 1 Write Suspend Bit */ -#define XDMAC_GWS_WS2 (0x1u << 2) /**< \brief (XDMAC_GWS) XDMAC Channel 2 Write Suspend Bit */ -#define XDMAC_GWS_WS3 (0x1u << 3) /**< \brief (XDMAC_GWS) XDMAC Channel 3 Write Suspend Bit */ -#define XDMAC_GWS_WS4 (0x1u << 4) /**< \brief (XDMAC_GWS) XDMAC Channel 4 Write Suspend Bit */ -#define XDMAC_GWS_WS5 (0x1u << 5) /**< \brief (XDMAC_GWS) XDMAC Channel 5 Write Suspend Bit */ -#define XDMAC_GWS_WS6 (0x1u << 6) /**< \brief (XDMAC_GWS) XDMAC Channel 6 Write Suspend Bit */ -#define XDMAC_GWS_WS7 (0x1u << 7) /**< \brief (XDMAC_GWS) XDMAC Channel 7 Write Suspend Bit */ -#define XDMAC_GWS_WS8 (0x1u << 8) /**< \brief (XDMAC_GWS) XDMAC Channel 8 Write Suspend Bit */ -#define XDMAC_GWS_WS9 (0x1u << 9) /**< \brief (XDMAC_GWS) XDMAC Channel 9 Write Suspend Bit */ -#define XDMAC_GWS_WS10 (0x1u << 10) /**< \brief (XDMAC_GWS) XDMAC Channel 10 Write Suspend Bit */ -#define XDMAC_GWS_WS11 (0x1u << 11) /**< \brief (XDMAC_GWS) XDMAC Channel 11 Write Suspend Bit */ -#define XDMAC_GWS_WS12 (0x1u << 12) /**< \brief (XDMAC_GWS) XDMAC Channel 12 Write Suspend Bit */ -#define XDMAC_GWS_WS13 (0x1u << 13) /**< \brief (XDMAC_GWS) XDMAC Channel 13 Write Suspend Bit */ -#define XDMAC_GWS_WS14 (0x1u << 14) /**< \brief (XDMAC_GWS) XDMAC Channel 14 Write Suspend Bit */ -#define XDMAC_GWS_WS15 (0x1u << 15) /**< \brief (XDMAC_GWS) XDMAC Channel 15 Write Suspend Bit */ -#define XDMAC_GWS_WS16 (0x1u << 16) /**< \brief (XDMAC_GWS) XDMAC Channel 16 Write Suspend Bit */ -#define XDMAC_GWS_WS17 (0x1u << 17) /**< \brief (XDMAC_GWS) XDMAC Channel 17 Write Suspend Bit */ -#define XDMAC_GWS_WS18 (0x1u << 18) /**< \brief (XDMAC_GWS) XDMAC Channel 18 Write Suspend Bit */ -#define XDMAC_GWS_WS19 (0x1u << 19) /**< \brief (XDMAC_GWS) XDMAC Channel 19 Write Suspend Bit */ -#define XDMAC_GWS_WS20 (0x1u << 20) /**< \brief (XDMAC_GWS) XDMAC Channel 20 Write Suspend Bit */ -#define XDMAC_GWS_WS21 (0x1u << 21) /**< \brief (XDMAC_GWS) XDMAC Channel 21 Write Suspend Bit */ -#define XDMAC_GWS_WS22 (0x1u << 22) /**< \brief (XDMAC_GWS) XDMAC Channel 22 Write Suspend Bit */ -#define XDMAC_GWS_WS23 (0x1u << 23) /**< \brief (XDMAC_GWS) XDMAC Channel 23 Write Suspend Bit */ -/* -------- XDMAC_GRWS : (XDMAC Offset: 0x30) Global Channel Read Write Suspend Register -------- */ -#define XDMAC_GRWS_RWS0 (0x1u << 0) /**< \brief (XDMAC_GRWS) XDMAC Channel 0 Read Write Suspend Bit */ -#define XDMAC_GRWS_RWS1 (0x1u << 1) /**< \brief (XDMAC_GRWS) XDMAC Channel 1 Read Write Suspend Bit */ -#define XDMAC_GRWS_RWS2 (0x1u << 2) /**< \brief (XDMAC_GRWS) XDMAC Channel 2 Read Write Suspend Bit */ -#define XDMAC_GRWS_RWS3 (0x1u << 3) /**< \brief (XDMAC_GRWS) XDMAC Channel 3 Read Write Suspend Bit */ -#define XDMAC_GRWS_RWS4 (0x1u << 4) /**< \brief (XDMAC_GRWS) XDMAC Channel 4 Read Write Suspend Bit */ -#define XDMAC_GRWS_RWS5 (0x1u << 5) /**< \brief (XDMAC_GRWS) XDMAC Channel 5 Read Write Suspend Bit */ -#define XDMAC_GRWS_RWS6 (0x1u << 6) /**< \brief (XDMAC_GRWS) XDMAC Channel 6 Read Write Suspend Bit */ -#define XDMAC_GRWS_RWS7 (0x1u << 7) /**< \brief (XDMAC_GRWS) XDMAC Channel 7 Read Write Suspend Bit */ -#define XDMAC_GRWS_RWS8 (0x1u << 8) /**< \brief (XDMAC_GRWS) XDMAC Channel 8 Read Write Suspend Bit */ -#define XDMAC_GRWS_RWS9 (0x1u << 9) /**< \brief (XDMAC_GRWS) XDMAC Channel 9 Read Write Suspend Bit */ -#define XDMAC_GRWS_RWS10 (0x1u << 10) /**< \brief (XDMAC_GRWS) XDMAC Channel 10 Read Write Suspend Bit */ -#define XDMAC_GRWS_RWS11 (0x1u << 11) /**< \brief (XDMAC_GRWS) XDMAC Channel 11 Read Write Suspend Bit */ -#define XDMAC_GRWS_RWS12 (0x1u << 12) /**< \brief (XDMAC_GRWS) XDMAC Channel 12 Read Write Suspend Bit */ -#define XDMAC_GRWS_RWS13 (0x1u << 13) /**< \brief (XDMAC_GRWS) XDMAC Channel 13 Read Write Suspend Bit */ -#define XDMAC_GRWS_RWS14 (0x1u << 14) /**< \brief (XDMAC_GRWS) XDMAC Channel 14 Read Write Suspend Bit */ -#define XDMAC_GRWS_RWS15 (0x1u << 15) /**< \brief (XDMAC_GRWS) XDMAC Channel 15 Read Write Suspend Bit */ -#define XDMAC_GRWS_RWS16 (0x1u << 16) /**< \brief (XDMAC_GRWS) XDMAC Channel 16 Read Write Suspend Bit */ -#define XDMAC_GRWS_RWS17 (0x1u << 17) /**< \brief (XDMAC_GRWS) XDMAC Channel 17 Read Write Suspend Bit */ -#define XDMAC_GRWS_RWS18 (0x1u << 18) /**< \brief (XDMAC_GRWS) XDMAC Channel 18 Read Write Suspend Bit */ -#define XDMAC_GRWS_RWS19 (0x1u << 19) /**< \brief (XDMAC_GRWS) XDMAC Channel 19 Read Write Suspend Bit */ -#define XDMAC_GRWS_RWS20 (0x1u << 20) /**< \brief (XDMAC_GRWS) XDMAC Channel 20 Read Write Suspend Bit */ -#define XDMAC_GRWS_RWS21 (0x1u << 21) /**< \brief (XDMAC_GRWS) XDMAC Channel 21 Read Write Suspend Bit */ -#define XDMAC_GRWS_RWS22 (0x1u << 22) /**< \brief (XDMAC_GRWS) XDMAC Channel 22 Read Write Suspend Bit */ -#define XDMAC_GRWS_RWS23 (0x1u << 23) /**< \brief (XDMAC_GRWS) XDMAC Channel 23 Read Write Suspend Bit */ -/* -------- XDMAC_GRWR : (XDMAC Offset: 0x34) Global Channel Read Write Resume Register -------- */ -#define XDMAC_GRWR_RWR0 (0x1u << 0) /**< \brief (XDMAC_GRWR) XDMAC Channel 0 Read Write Resume Bit */ -#define XDMAC_GRWR_RWR1 (0x1u << 1) /**< \brief (XDMAC_GRWR) XDMAC Channel 1 Read Write Resume Bit */ -#define XDMAC_GRWR_RWR2 (0x1u << 2) /**< \brief (XDMAC_GRWR) XDMAC Channel 2 Read Write Resume Bit */ -#define XDMAC_GRWR_RWR3 (0x1u << 3) /**< \brief (XDMAC_GRWR) XDMAC Channel 3 Read Write Resume Bit */ -#define XDMAC_GRWR_RWR4 (0x1u << 4) /**< \brief (XDMAC_GRWR) XDMAC Channel 4 Read Write Resume Bit */ -#define XDMAC_GRWR_RWR5 (0x1u << 5) /**< \brief (XDMAC_GRWR) XDMAC Channel 5 Read Write Resume Bit */ -#define XDMAC_GRWR_RWR6 (0x1u << 6) /**< \brief (XDMAC_GRWR) XDMAC Channel 6 Read Write Resume Bit */ -#define XDMAC_GRWR_RWR7 (0x1u << 7) /**< \brief (XDMAC_GRWR) XDMAC Channel 7 Read Write Resume Bit */ -#define XDMAC_GRWR_RWR8 (0x1u << 8) /**< \brief (XDMAC_GRWR) XDMAC Channel 8 Read Write Resume Bit */ -#define XDMAC_GRWR_RWR9 (0x1u << 9) /**< \brief (XDMAC_GRWR) XDMAC Channel 9 Read Write Resume Bit */ -#define XDMAC_GRWR_RWR10 (0x1u << 10) /**< \brief (XDMAC_GRWR) XDMAC Channel 10 Read Write Resume Bit */ -#define XDMAC_GRWR_RWR11 (0x1u << 11) /**< \brief (XDMAC_GRWR) XDMAC Channel 11 Read Write Resume Bit */ -#define XDMAC_GRWR_RWR12 (0x1u << 12) /**< \brief (XDMAC_GRWR) XDMAC Channel 12 Read Write Resume Bit */ -#define XDMAC_GRWR_RWR13 (0x1u << 13) /**< \brief (XDMAC_GRWR) XDMAC Channel 13 Read Write Resume Bit */ -#define XDMAC_GRWR_RWR14 (0x1u << 14) /**< \brief (XDMAC_GRWR) XDMAC Channel 14 Read Write Resume Bit */ -#define XDMAC_GRWR_RWR15 (0x1u << 15) /**< \brief (XDMAC_GRWR) XDMAC Channel 15 Read Write Resume Bit */ -#define XDMAC_GRWR_RWR16 (0x1u << 16) /**< \brief (XDMAC_GRWR) XDMAC Channel 16 Read Write Resume Bit */ -#define XDMAC_GRWR_RWR17 (0x1u << 17) /**< \brief (XDMAC_GRWR) XDMAC Channel 17 Read Write Resume Bit */ -#define XDMAC_GRWR_RWR18 (0x1u << 18) /**< \brief (XDMAC_GRWR) XDMAC Channel 18 Read Write Resume Bit */ -#define XDMAC_GRWR_RWR19 (0x1u << 19) /**< \brief (XDMAC_GRWR) XDMAC Channel 19 Read Write Resume Bit */ -#define XDMAC_GRWR_RWR20 (0x1u << 20) /**< \brief (XDMAC_GRWR) XDMAC Channel 20 Read Write Resume Bit */ -#define XDMAC_GRWR_RWR21 (0x1u << 21) /**< \brief (XDMAC_GRWR) XDMAC Channel 21 Read Write Resume Bit */ -#define XDMAC_GRWR_RWR22 (0x1u << 22) /**< \brief (XDMAC_GRWR) XDMAC Channel 22 Read Write Resume Bit */ -#define XDMAC_GRWR_RWR23 (0x1u << 23) /**< \brief (XDMAC_GRWR) XDMAC Channel 23 Read Write Resume Bit */ -/* -------- XDMAC_GSWR : (XDMAC Offset: 0x38) Global Channel Software Request Register -------- */ -#define XDMAC_GSWR_SWREQ0 (0x1u << 0) /**< \brief (XDMAC_GSWR) XDMAC Channel 0 Software Request Bit */ -#define XDMAC_GSWR_SWREQ1 (0x1u << 1) /**< \brief (XDMAC_GSWR) XDMAC Channel 1 Software Request Bit */ -#define XDMAC_GSWR_SWREQ2 (0x1u << 2) /**< \brief (XDMAC_GSWR) XDMAC Channel 2 Software Request Bit */ -#define XDMAC_GSWR_SWREQ3 (0x1u << 3) /**< \brief (XDMAC_GSWR) XDMAC Channel 3 Software Request Bit */ -#define XDMAC_GSWR_SWREQ4 (0x1u << 4) /**< \brief (XDMAC_GSWR) XDMAC Channel 4 Software Request Bit */ -#define XDMAC_GSWR_SWREQ5 (0x1u << 5) /**< \brief (XDMAC_GSWR) XDMAC Channel 5 Software Request Bit */ -#define XDMAC_GSWR_SWREQ6 (0x1u << 6) /**< \brief (XDMAC_GSWR) XDMAC Channel 6 Software Request Bit */ -#define XDMAC_GSWR_SWREQ7 (0x1u << 7) /**< \brief (XDMAC_GSWR) XDMAC Channel 7 Software Request Bit */ -#define XDMAC_GSWR_SWREQ8 (0x1u << 8) /**< \brief (XDMAC_GSWR) XDMAC Channel 8 Software Request Bit */ -#define XDMAC_GSWR_SWREQ9 (0x1u << 9) /**< \brief (XDMAC_GSWR) XDMAC Channel 9 Software Request Bit */ -#define XDMAC_GSWR_SWREQ10 (0x1u << 10) /**< \brief (XDMAC_GSWR) XDMAC Channel 10 Software Request Bit */ -#define XDMAC_GSWR_SWREQ11 (0x1u << 11) /**< \brief (XDMAC_GSWR) XDMAC Channel 11 Software Request Bit */ -#define XDMAC_GSWR_SWREQ12 (0x1u << 12) /**< \brief (XDMAC_GSWR) XDMAC Channel 12 Software Request Bit */ -#define XDMAC_GSWR_SWREQ13 (0x1u << 13) /**< \brief (XDMAC_GSWR) XDMAC Channel 13 Software Request Bit */ -#define XDMAC_GSWR_SWREQ14 (0x1u << 14) /**< \brief (XDMAC_GSWR) XDMAC Channel 14 Software Request Bit */ -#define XDMAC_GSWR_SWREQ15 (0x1u << 15) /**< \brief (XDMAC_GSWR) XDMAC Channel 15 Software Request Bit */ -#define XDMAC_GSWR_SWREQ16 (0x1u << 16) /**< \brief (XDMAC_GSWR) XDMAC Channel 16 Software Request Bit */ -#define XDMAC_GSWR_SWREQ17 (0x1u << 17) /**< \brief (XDMAC_GSWR) XDMAC Channel 17 Software Request Bit */ -#define XDMAC_GSWR_SWREQ18 (0x1u << 18) /**< \brief (XDMAC_GSWR) XDMAC Channel 18 Software Request Bit */ -#define XDMAC_GSWR_SWREQ19 (0x1u << 19) /**< \brief (XDMAC_GSWR) XDMAC Channel 19 Software Request Bit */ -#define XDMAC_GSWR_SWREQ20 (0x1u << 20) /**< \brief (XDMAC_GSWR) XDMAC Channel 20 Software Request Bit */ -#define XDMAC_GSWR_SWREQ21 (0x1u << 21) /**< \brief (XDMAC_GSWR) XDMAC Channel 21 Software Request Bit */ -#define XDMAC_GSWR_SWREQ22 (0x1u << 22) /**< \brief (XDMAC_GSWR) XDMAC Channel 22 Software Request Bit */ -#define XDMAC_GSWR_SWREQ23 (0x1u << 23) /**< \brief (XDMAC_GSWR) XDMAC Channel 23 Software Request Bit */ -/* -------- XDMAC_GSWS : (XDMAC Offset: 0x3C) Global Channel Software Request Status Register -------- */ -#define XDMAC_GSWS_SWRS0 (0x1u << 0) /**< \brief (XDMAC_GSWS) XDMAC Channel 0 Software Request Status Bit */ -#define XDMAC_GSWS_SWRS1 (0x1u << 1) /**< \brief (XDMAC_GSWS) XDMAC Channel 1 Software Request Status Bit */ -#define XDMAC_GSWS_SWRS2 (0x1u << 2) /**< \brief (XDMAC_GSWS) XDMAC Channel 2 Software Request Status Bit */ -#define XDMAC_GSWS_SWRS3 (0x1u << 3) /**< \brief (XDMAC_GSWS) XDMAC Channel 3 Software Request Status Bit */ -#define XDMAC_GSWS_SWRS4 (0x1u << 4) /**< \brief (XDMAC_GSWS) XDMAC Channel 4 Software Request Status Bit */ -#define XDMAC_GSWS_SWRS5 (0x1u << 5) /**< \brief (XDMAC_GSWS) XDMAC Channel 5 Software Request Status Bit */ -#define XDMAC_GSWS_SWRS6 (0x1u << 6) /**< \brief (XDMAC_GSWS) XDMAC Channel 6 Software Request Status Bit */ -#define XDMAC_GSWS_SWRS7 (0x1u << 7) /**< \brief (XDMAC_GSWS) XDMAC Channel 7 Software Request Status Bit */ -#define XDMAC_GSWS_SWRS8 (0x1u << 8) /**< \brief (XDMAC_GSWS) XDMAC Channel 8 Software Request Status Bit */ -#define XDMAC_GSWS_SWRS9 (0x1u << 9) /**< \brief (XDMAC_GSWS) XDMAC Channel 9 Software Request Status Bit */ -#define XDMAC_GSWS_SWRS10 (0x1u << 10) /**< \brief (XDMAC_GSWS) XDMAC Channel 10 Software Request Status Bit */ -#define XDMAC_GSWS_SWRS11 (0x1u << 11) /**< \brief (XDMAC_GSWS) XDMAC Channel 11 Software Request Status Bit */ -#define XDMAC_GSWS_SWRS12 (0x1u << 12) /**< \brief (XDMAC_GSWS) XDMAC Channel 12 Software Request Status Bit */ -#define XDMAC_GSWS_SWRS13 (0x1u << 13) /**< \brief (XDMAC_GSWS) XDMAC Channel 13 Software Request Status Bit */ -#define XDMAC_GSWS_SWRS14 (0x1u << 14) /**< \brief (XDMAC_GSWS) XDMAC Channel 14 Software Request Status Bit */ -#define XDMAC_GSWS_SWRS15 (0x1u << 15) /**< \brief (XDMAC_GSWS) XDMAC Channel 15 Software Request Status Bit */ -#define XDMAC_GSWS_SWRS16 (0x1u << 16) /**< \brief (XDMAC_GSWS) XDMAC Channel 16 Software Request Status Bit */ -#define XDMAC_GSWS_SWRS17 (0x1u << 17) /**< \brief (XDMAC_GSWS) XDMAC Channel 17 Software Request Status Bit */ -#define XDMAC_GSWS_SWRS18 (0x1u << 18) /**< \brief (XDMAC_GSWS) XDMAC Channel 18 Software Request Status Bit */ -#define XDMAC_GSWS_SWRS19 (0x1u << 19) /**< \brief (XDMAC_GSWS) XDMAC Channel 19 Software Request Status Bit */ -#define XDMAC_GSWS_SWRS20 (0x1u << 20) /**< \brief (XDMAC_GSWS) XDMAC Channel 20 Software Request Status Bit */ -#define XDMAC_GSWS_SWRS21 (0x1u << 21) /**< \brief (XDMAC_GSWS) XDMAC Channel 21 Software Request Status Bit */ -#define XDMAC_GSWS_SWRS22 (0x1u << 22) /**< \brief (XDMAC_GSWS) XDMAC Channel 22 Software Request Status Bit */ -#define XDMAC_GSWS_SWRS23 (0x1u << 23) /**< \brief (XDMAC_GSWS) XDMAC Channel 23 Software Request Status Bit */ -/* -------- XDMAC_GSWF : (XDMAC Offset: 0x40) Global Channel Software Flush Request Register -------- */ -#define XDMAC_GSWF_SWF0 (0x1u << 0) /**< \brief (XDMAC_GSWF) XDMAC Channel 0 Software Flush Request Bit */ -#define XDMAC_GSWF_SWF1 (0x1u << 1) /**< \brief (XDMAC_GSWF) XDMAC Channel 1 Software Flush Request Bit */ -#define XDMAC_GSWF_SWF2 (0x1u << 2) /**< \brief (XDMAC_GSWF) XDMAC Channel 2 Software Flush Request Bit */ -#define XDMAC_GSWF_SWF3 (0x1u << 3) /**< \brief (XDMAC_GSWF) XDMAC Channel 3 Software Flush Request Bit */ -#define XDMAC_GSWF_SWF4 (0x1u << 4) /**< \brief (XDMAC_GSWF) XDMAC Channel 4 Software Flush Request Bit */ -#define XDMAC_GSWF_SWF5 (0x1u << 5) /**< \brief (XDMAC_GSWF) XDMAC Channel 5 Software Flush Request Bit */ -#define XDMAC_GSWF_SWF6 (0x1u << 6) /**< \brief (XDMAC_GSWF) XDMAC Channel 6 Software Flush Request Bit */ -#define XDMAC_GSWF_SWF7 (0x1u << 7) /**< \brief (XDMAC_GSWF) XDMAC Channel 7 Software Flush Request Bit */ -#define XDMAC_GSWF_SWF8 (0x1u << 8) /**< \brief (XDMAC_GSWF) XDMAC Channel 8 Software Flush Request Bit */ -#define XDMAC_GSWF_SWF9 (0x1u << 9) /**< \brief (XDMAC_GSWF) XDMAC Channel 9 Software Flush Request Bit */ -#define XDMAC_GSWF_SWF10 (0x1u << 10) /**< \brief (XDMAC_GSWF) XDMAC Channel 10 Software Flush Request Bit */ -#define XDMAC_GSWF_SWF11 (0x1u << 11) /**< \brief (XDMAC_GSWF) XDMAC Channel 11 Software Flush Request Bit */ -#define XDMAC_GSWF_SWF12 (0x1u << 12) /**< \brief (XDMAC_GSWF) XDMAC Channel 12 Software Flush Request Bit */ -#define XDMAC_GSWF_SWF13 (0x1u << 13) /**< \brief (XDMAC_GSWF) XDMAC Channel 13 Software Flush Request Bit */ -#define XDMAC_GSWF_SWF14 (0x1u << 14) /**< \brief (XDMAC_GSWF) XDMAC Channel 14 Software Flush Request Bit */ -#define XDMAC_GSWF_SWF15 (0x1u << 15) /**< \brief (XDMAC_GSWF) XDMAC Channel 15 Software Flush Request Bit */ -#define XDMAC_GSWF_SWF16 (0x1u << 16) /**< \brief (XDMAC_GSWF) XDMAC Channel 16 Software Flush Request Bit */ -#define XDMAC_GSWF_SWF17 (0x1u << 17) /**< \brief (XDMAC_GSWF) XDMAC Channel 17 Software Flush Request Bit */ -#define XDMAC_GSWF_SWF18 (0x1u << 18) /**< \brief (XDMAC_GSWF) XDMAC Channel 18 Software Flush Request Bit */ -#define XDMAC_GSWF_SWF19 (0x1u << 19) /**< \brief (XDMAC_GSWF) XDMAC Channel 19 Software Flush Request Bit */ -#define XDMAC_GSWF_SWF20 (0x1u << 20) /**< \brief (XDMAC_GSWF) XDMAC Channel 20 Software Flush Request Bit */ -#define XDMAC_GSWF_SWF21 (0x1u << 21) /**< \brief (XDMAC_GSWF) XDMAC Channel 21 Software Flush Request Bit */ -#define XDMAC_GSWF_SWF22 (0x1u << 22) /**< \brief (XDMAC_GSWF) XDMAC Channel 22 Software Flush Request Bit */ -#define XDMAC_GSWF_SWF23 (0x1u << 23) /**< \brief (XDMAC_GSWF) XDMAC Channel 23 Software Flush Request Bit */ -/* -------- XDMAC_CIE : (XDMAC Offset: N/A) Channel Interrupt Enable Register -------- */ -#define XDMAC_CIE_BIE (0x1u << 0) /**< \brief (XDMAC_CIE) End of Block Interrupt Enable Bit */ -#define XDMAC_CIE_LIE (0x1u << 1) /**< \brief (XDMAC_CIE) End of Linked List Interrupt Enable Bit */ -#define XDMAC_CIE_DIE (0x1u << 2) /**< \brief (XDMAC_CIE) End of Disable Interrupt Enable Bit */ -#define XDMAC_CIE_FIE (0x1u << 3) /**< \brief (XDMAC_CIE) End of Flush Interrupt Enable Bit */ -#define XDMAC_CIE_RBIE (0x1u << 4) /**< \brief (XDMAC_CIE) Read Bus Error Interrupt Enable Bit */ -#define XDMAC_CIE_WBIE (0x1u << 5) /**< \brief (XDMAC_CIE) Write Bus Error Interrupt Enable Bit */ -#define XDMAC_CIE_ROIE (0x1u << 6) /**< \brief (XDMAC_CIE) Request Overflow Error Interrupt Enable Bit */ -/* -------- XDMAC_CID : (XDMAC Offset: N/A) Channel Interrupt Disable Register -------- */ -#define XDMAC_CID_BID (0x1u << 0) /**< \brief (XDMAC_CID) End of Block Interrupt Disable Bit */ -#define XDMAC_CID_LID (0x1u << 1) /**< \brief (XDMAC_CID) End of Linked List Interrupt Disable Bit */ -#define XDMAC_CID_DID (0x1u << 2) /**< \brief (XDMAC_CID) End of Disable Interrupt Disable Bit */ -#define XDMAC_CID_FID (0x1u << 3) /**< \brief (XDMAC_CID) End of Flush Interrupt Disable Bit */ -#define XDMAC_CID_RBEID (0x1u << 4) /**< \brief (XDMAC_CID) Read Bus Error Interrupt Disable Bit */ -#define XDMAC_CID_WBEID (0x1u << 5) /**< \brief (XDMAC_CID) Write Bus Error Interrupt Disable Bit */ -#define XDMAC_CID_ROID (0x1u << 6) /**< \brief (XDMAC_CID) Request Overflow Error Interrupt Disable Bit */ -/* -------- XDMAC_CIM : (XDMAC Offset: N/A) Channel Interrupt Mask Register -------- */ -#define XDMAC_CIM_BIM (0x1u << 0) /**< \brief (XDMAC_CIM) End of Block Interrupt Mask Bit */ -#define XDMAC_CIM_LIM (0x1u << 1) /**< \brief (XDMAC_CIM) End of Linked List Interrupt Mask Bit */ -#define XDMAC_CIM_DIM (0x1u << 2) /**< \brief (XDMAC_CIM) End of Disable Interrupt Mask Bit */ -#define XDMAC_CIM_FIM (0x1u << 3) /**< \brief (XDMAC_CIM) End of Flush Interrupt Mask Bit */ -#define XDMAC_CIM_RBEIM (0x1u << 4) /**< \brief (XDMAC_CIM) Read Bus Error Interrupt Mask Bit */ -#define XDMAC_CIM_WBEIM (0x1u << 5) /**< \brief (XDMAC_CIM) Write Bus Error Interrupt Mask Bit */ -#define XDMAC_CIM_ROIM (0x1u << 6) /**< \brief (XDMAC_CIM) Request Overflow Error Interrupt Mask Bit */ -/* -------- XDMAC_CIS : (XDMAC Offset: N/A) Channel Interrupt Status Register -------- */ -#define XDMAC_CIS_BIS (0x1u << 0) /**< \brief (XDMAC_CIS) End of Block Interrupt Status Bit */ -#define XDMAC_CIS_LIS (0x1u << 1) /**< \brief (XDMAC_CIS) End of Linked List Interrupt Status Bit */ -#define XDMAC_CIS_DIS (0x1u << 2) /**< \brief (XDMAC_CIS) End of Disable Interrupt Status Bit */ -#define XDMAC_CIS_FIS (0x1u << 3) /**< \brief (XDMAC_CIS) End of Flush Interrupt Status Bit */ -#define XDMAC_CIS_RBEIS (0x1u << 4) /**< \brief (XDMAC_CIS) Read Bus Error Interrupt Status Bit */ -#define XDMAC_CIS_WBEIS (0x1u << 5) /**< \brief (XDMAC_CIS) Write Bus Error Interrupt Status Bit */ -#define XDMAC_CIS_ROIS (0x1u << 6) /**< \brief (XDMAC_CIS) Request Overflow Error Interrupt Status Bit */ -/* -------- XDMAC_CSA : (XDMAC Offset: N/A) Channel Source Address Register -------- */ -#define XDMAC_CSA_SA_Pos 0 -#define XDMAC_CSA_SA_Msk (0xffffffffu << XDMAC_CSA_SA_Pos) /**< \brief (XDMAC_CSA) Channel x Source Address */ -#define XDMAC_CSA_SA(value) ((XDMAC_CSA_SA_Msk & ((value) << XDMAC_CSA_SA_Pos))) -/* -------- XDMAC_CDA : (XDMAC Offset: N/A) Channel Destination Address Register -------- */ -#define XDMAC_CDA_DA_Pos 0 -#define XDMAC_CDA_DA_Msk (0xffffffffu << XDMAC_CDA_DA_Pos) /**< \brief (XDMAC_CDA) Channel x Destination Address */ -#define XDMAC_CDA_DA(value) ((XDMAC_CDA_DA_Msk & ((value) << XDMAC_CDA_DA_Pos))) -/* -------- XDMAC_CNDA : (XDMAC Offset: N/A) Channel Next Descriptor Address Register -------- */ -#define XDMAC_CNDA_NDAIF (0x1u << 0) /**< \brief (XDMAC_CNDA) Channel x Next Descriptor Interface */ -#define XDMAC_CNDA_NDA_Pos 2 -#define XDMAC_CNDA_NDA_Msk (0x3fffffffu << XDMAC_CNDA_NDA_Pos) /**< \brief (XDMAC_CNDA) Channel x Next Descriptor Address */ -#define XDMAC_CNDA_NDA(value) ((XDMAC_CNDA_NDA_Msk & ((value) << XDMAC_CNDA_NDA_Pos))) -/* -------- XDMAC_CNDC : (XDMAC Offset: N/A) Channel Next Descriptor Control Register -------- */ -#define XDMAC_CNDC_NDE (0x1u << 0) /**< \brief (XDMAC_CNDC) Channel x Next Descriptor Enable */ -#define XDMAC_CNDC_NDE_DSCR_FETCH_DIS (0x0u << 0) /**< \brief (XDMAC_CNDC) Descriptor fetch is disabled */ -#define XDMAC_CNDC_NDE_DSCR_FETCH_EN (0x1u << 0) /**< \brief (XDMAC_CNDC) Descriptor fetch is enabled */ -#define XDMAC_CNDC_NDSUP (0x1u << 1) /**< \brief (XDMAC_CNDC) Channel x Next Descriptor Source Update */ -#define XDMAC_CNDC_NDSUP_SRC_PARAMS_UNCHANGED (0x0u << 1) /**< \brief (XDMAC_CNDC) Source parameters remain unchanged. */ -#define XDMAC_CNDC_NDSUP_SRC_PARAMS_UPDATED (0x1u << 1) /**< \brief (XDMAC_CNDC) Source parameters are updated when the descriptor is retrieved. */ -#define XDMAC_CNDC_NDDUP (0x1u << 2) /**< \brief (XDMAC_CNDC) Channel x Next Descriptor Destination Update */ -#define XDMAC_CNDC_NDDUP_DST_PARAMS_UNCHANGED (0x0u << 2) /**< \brief (XDMAC_CNDC) Destination parameters remain unchanged. */ -#define XDMAC_CNDC_NDDUP_DST_PARAMS_UPDATED (0x1u << 2) /**< \brief (XDMAC_CNDC) Destination parameters are updated when the descriptor is retrieved. */ -#define XDMAC_CNDC_NDVIEW_Pos 3 -#define XDMAC_CNDC_NDVIEW_Msk (0x3u << XDMAC_CNDC_NDVIEW_Pos) /**< \brief (XDMAC_CNDC) Channel x Next Descriptor View */ -#define XDMAC_CNDC_NDVIEW(value) ((XDMAC_CNDC_NDVIEW_Msk & ((value) << XDMAC_CNDC_NDVIEW_Pos))) -#define XDMAC_CNDC_NDVIEW_NDV0 (0x0u << 3) /**< \brief (XDMAC_CNDC) Next Descriptor View 0 */ -#define XDMAC_CNDC_NDVIEW_NDV1 (0x1u << 3) /**< \brief (XDMAC_CNDC) Next Descriptor View 1 */ -#define XDMAC_CNDC_NDVIEW_NDV2 (0x2u << 3) /**< \brief (XDMAC_CNDC) Next Descriptor View 2 */ -#define XDMAC_CNDC_NDVIEW_NDV3 (0x3u << 3) /**< \brief (XDMAC_CNDC) Next Descriptor View 3 */ -/* -------- XDMAC_CUBC : (XDMAC Offset: N/A) Channel Microblock Control Register -------- */ -#define XDMAC_CUBC_UBLEN_Pos 0 -#define XDMAC_CUBC_UBLEN_Msk (0xffffffu << XDMAC_CUBC_UBLEN_Pos) /**< \brief (XDMAC_CUBC) Channel x Microblock Length */ -#define XDMAC_CUBC_UBLEN(value) ((XDMAC_CUBC_UBLEN_Msk & ((value) << XDMAC_CUBC_UBLEN_Pos))) -/* -------- XDMAC_CBC : (XDMAC Offset: N/A) Channel Block Control Register -------- */ -#define XDMAC_CBC_BLEN_Pos 0 -#define XDMAC_CBC_BLEN_Msk (0xfffu << XDMAC_CBC_BLEN_Pos) /**< \brief (XDMAC_CBC) Channel x Block Length */ -#define XDMAC_CBC_BLEN(value) ((XDMAC_CBC_BLEN_Msk & ((value) << XDMAC_CBC_BLEN_Pos))) -/* -------- XDMAC_CC : (XDMAC Offset: N/A) Channel Configuration Register -------- */ -#define XDMAC_CC_TYPE (0x1u << 0) /**< \brief (XDMAC_CC) Channel x Transfer Type */ -#define XDMAC_CC_TYPE_MEM_TRAN (0x0u << 0) /**< \brief (XDMAC_CC) Self triggered mode (Memory to Memory Transfer). */ -#define XDMAC_CC_TYPE_PER_TRAN (0x1u << 0) /**< \brief (XDMAC_CC) Synchronized mode (Peripheral to Memory or Memory to Peripheral Transfer). */ -#define XDMAC_CC_MBSIZE_Pos 1 -#define XDMAC_CC_MBSIZE_Msk (0x3u << XDMAC_CC_MBSIZE_Pos) /**< \brief (XDMAC_CC) Channel x Memory Burst Size */ -#define XDMAC_CC_MBSIZE(value) ((XDMAC_CC_MBSIZE_Msk & ((value) << XDMAC_CC_MBSIZE_Pos))) -#define XDMAC_CC_MBSIZE_SINGLE (0x0u << 1) /**< \brief (XDMAC_CC) The memory burst size is set to one. */ -#define XDMAC_CC_MBSIZE_FOUR (0x1u << 1) /**< \brief (XDMAC_CC) The memory burst size is set to four. */ -#define XDMAC_CC_MBSIZE_EIGHT (0x2u << 1) /**< \brief (XDMAC_CC) The memory burst size is set to eight. */ -#define XDMAC_CC_MBSIZE_SIXTEEN (0x3u << 1) /**< \brief (XDMAC_CC) The memory burst size is set to sixteen. */ -#define XDMAC_CC_DSYNC (0x1u << 4) /**< \brief (XDMAC_CC) Channel x Synchronization */ -#define XDMAC_CC_DSYNC_PER2MEM (0x0u << 4) /**< \brief (XDMAC_CC) Peripheral to Memory transfer */ -#define XDMAC_CC_DSYNC_MEM2PER (0x1u << 4) /**< \brief (XDMAC_CC) Memory to Peripheral transfer */ -#define XDMAC_CC_PROT (0x1u << 5) /**< \brief (XDMAC_CC) Channel x Protection */ -#define XDMAC_CC_PROT_SEC (0x0u << 5) /**< \brief (XDMAC_CC) Channel is secured */ -#define XDMAC_CC_PROT_UNSEC (0x1u << 5) /**< \brief (XDMAC_CC) Channel is unsecured */ -#define XDMAC_CC_SWREQ (0x1u << 6) /**< \brief (XDMAC_CC) Channel x Software Request Trigger */ -#define XDMAC_CC_SWREQ_HWR_CONNECTED (0x0u << 6) /**< \brief (XDMAC_CC) Hardware request line is connected to the peripheral request line. */ -#define XDMAC_CC_SWREQ_SWR_CONNECTED (0x1u << 6) /**< \brief (XDMAC_CC) Software request is connected to the peripheral request line. */ -#define XDMAC_CC_MEMSET (0x1u << 7) /**< \brief (XDMAC_CC) Channel x Fill Block of memory */ -#define XDMAC_CC_MEMSET_NORMAL_MODE (0x0u << 7) /**< \brief (XDMAC_CC) Memset is not activated */ -#define XDMAC_CC_MEMSET_HW_MODE (0x1u << 7) /**< \brief (XDMAC_CC) Sets the block of memory pointed by DA field to the specified value. This operation is performed on 8, 16 or 32 bits basis. */ -#define XDMAC_CC_CSIZE_Pos 8 -#define XDMAC_CC_CSIZE_Msk (0x7u << XDMAC_CC_CSIZE_Pos) /**< \brief (XDMAC_CC) Channel x Chunk Size */ -#define XDMAC_CC_CSIZE(value) ((XDMAC_CC_CSIZE_Msk & ((value) << XDMAC_CC_CSIZE_Pos))) -#define XDMAC_CC_CSIZE_CHK_1 (0x0u << 8) /**< \brief (XDMAC_CC) 1 data transferred */ -#define XDMAC_CC_CSIZE_CHK_2 (0x1u << 8) /**< \brief (XDMAC_CC) 2 data transferred */ -#define XDMAC_CC_CSIZE_CHK_4 (0x2u << 8) /**< \brief (XDMAC_CC) 4 data transferred */ -#define XDMAC_CC_CSIZE_CHK_8 (0x3u << 8) /**< \brief (XDMAC_CC) 8 data transferred */ -#define XDMAC_CC_CSIZE_CHK_16 (0x4u << 8) /**< \brief (XDMAC_CC) 16 data transferred */ -#define XDMAC_CC_DWIDTH_Pos 11 -#define XDMAC_CC_DWIDTH_Msk (0x3u << XDMAC_CC_DWIDTH_Pos) /**< \brief (XDMAC_CC) Channel x Data Width */ -#define XDMAC_CC_DWIDTH(value) ((XDMAC_CC_DWIDTH_Msk & ((value) << XDMAC_CC_DWIDTH_Pos))) -#define XDMAC_CC_DWIDTH_BYTE (0x0u << 11) /**< \brief (XDMAC_CC) The data size is set to 8 bits */ -#define XDMAC_CC_DWIDTH_HALFWORD (0x1u << 11) /**< \brief (XDMAC_CC) The data size is set to 16 bits */ -#define XDMAC_CC_DWIDTH_WORD (0x2u << 11) /**< \brief (XDMAC_CC) The data size is set to 32 bits */ -#define XDMAC_CC_SIF (0x1u << 13) /**< \brief (XDMAC_CC) Channel x Source Interface Identifier */ -#define XDMAC_CC_SIF_AHB_IF0 (0x0u << 13) /**< \brief (XDMAC_CC) The data is read through the system bus interface 0 */ -#define XDMAC_CC_SIF_AHB_IF1 (0x1u << 13) /**< \brief (XDMAC_CC) The data is read through the system bus interface 1 */ -#define XDMAC_CC_DIF (0x1u << 14) /**< \brief (XDMAC_CC) Channel x Destination Interface Identifier */ -#define XDMAC_CC_DIF_AHB_IF0 (0x0u << 14) /**< \brief (XDMAC_CC) The data is written through the system bus interface 0 */ -#define XDMAC_CC_DIF_AHB_IF1 (0x1u << 14) /**< \brief (XDMAC_CC) The data is written though the system bus interface 1 */ -#define XDMAC_CC_SAM_Pos 16 -#define XDMAC_CC_SAM_Msk (0x3u << XDMAC_CC_SAM_Pos) /**< \brief (XDMAC_CC) Channel x Source Addressing Mode */ -#define XDMAC_CC_SAM(value) ((XDMAC_CC_SAM_Msk & ((value) << XDMAC_CC_SAM_Pos))) -#define XDMAC_CC_SAM_FIXED_AM (0x0u << 16) /**< \brief (XDMAC_CC) The address remains unchanged. */ -#define XDMAC_CC_SAM_INCREMENTED_AM (0x1u << 16) /**< \brief (XDMAC_CC) The addressing mode is incremented (the increment size is set to the data size). */ -#define XDMAC_CC_SAM_UBS_AM (0x2u << 16) /**< \brief (XDMAC_CC) The microblock stride is added at the microblock boundary. */ -#define XDMAC_CC_SAM_UBS_DS_AM (0x3u << 16) /**< \brief (XDMAC_CC) The microblock stride is added at the microblock boundary, the data stride is added at the data boundary. */ -#define XDMAC_CC_DAM_Pos 18 -#define XDMAC_CC_DAM_Msk (0x3u << XDMAC_CC_DAM_Pos) /**< \brief (XDMAC_CC) Channel x Destination Addressing Mode */ -#define XDMAC_CC_DAM(value) ((XDMAC_CC_DAM_Msk & ((value) << XDMAC_CC_DAM_Pos))) -#define XDMAC_CC_DAM_FIXED_AM (0x0u << 18) /**< \brief (XDMAC_CC) The address remains unchanged. */ -#define XDMAC_CC_DAM_INCREMENTED_AM (0x1u << 18) /**< \brief (XDMAC_CC) The addressing mode is incremented (the increment size is set to the data size). */ -#define XDMAC_CC_DAM_UBS_AM (0x2u << 18) /**< \brief (XDMAC_CC) The microblock stride is added at the microblock boundary. */ -#define XDMAC_CC_DAM_UBS_DS_AM (0x3u << 18) /**< \brief (XDMAC_CC) The microblock stride is added at the microblock boundary, the data stride is added at the data boundary. */ -#define XDMAC_CC_INITD (0x1u << 21) /**< \brief (XDMAC_CC) Channel Initialization Terminated (this bit is read-only) */ -#define XDMAC_CC_INITD_TERMINATED (0x0u << 21) /**< \brief (XDMAC_CC) Channel initialization is in progress. */ -#define XDMAC_CC_INITD_IN_PROGRESS (0x1u << 21) /**< \brief (XDMAC_CC) Channel initialization is completed. */ -#define XDMAC_CC_RDIP (0x1u << 22) /**< \brief (XDMAC_CC) Read in Progress (this bit is read-only) */ -#define XDMAC_CC_RDIP_DONE (0x0u << 22) /**< \brief (XDMAC_CC) No Active read transaction on the bus. */ -#define XDMAC_CC_RDIP_IN_PROGRESS (0x1u << 22) /**< \brief (XDMAC_CC) A read transaction is in progress. */ -#define XDMAC_CC_WRIP (0x1u << 23) /**< \brief (XDMAC_CC) Write in Progress (this bit is read-only) */ -#define XDMAC_CC_WRIP_DONE (0x0u << 23) /**< \brief (XDMAC_CC) No Active write transaction on the bus. */ -#define XDMAC_CC_WRIP_IN_PROGRESS (0x1u << 23) /**< \brief (XDMAC_CC) A Write transaction is in progress. */ -#define XDMAC_CC_PERID_Pos 24 -#define XDMAC_CC_PERID_Msk (0x7fu << XDMAC_CC_PERID_Pos) /**< \brief (XDMAC_CC) Channel x Peripheral Identifier */ -#define XDMAC_CC_PERID(value) ((XDMAC_CC_PERID_Msk & ((value) << XDMAC_CC_PERID_Pos))) -/* -------- XDMAC_CDS_MSP : (XDMAC Offset: N/A) Channel Data Stride Memory Set Pattern -------- */ -#define XDMAC_CDS_MSP_SDS_MSP_Pos 0 -#define XDMAC_CDS_MSP_SDS_MSP_Msk (0xffffu << XDMAC_CDS_MSP_SDS_MSP_Pos) /**< \brief (XDMAC_CDS_MSP) Channel x Source Data stride or Memory Set Pattern */ -#define XDMAC_CDS_MSP_SDS_MSP(value) ((XDMAC_CDS_MSP_SDS_MSP_Msk & ((value) << XDMAC_CDS_MSP_SDS_MSP_Pos))) -#define XDMAC_CDS_MSP_DDS_MSP_Pos 16 -#define XDMAC_CDS_MSP_DDS_MSP_Msk (0xffffu << XDMAC_CDS_MSP_DDS_MSP_Pos) /**< \brief (XDMAC_CDS_MSP) Channel x Destination Data Stride or Memory Set Pattern */ -#define XDMAC_CDS_MSP_DDS_MSP(value) ((XDMAC_CDS_MSP_DDS_MSP_Msk & ((value) << XDMAC_CDS_MSP_DDS_MSP_Pos))) -/* -------- XDMAC_CSUS : (XDMAC Offset: N/A) Channel Source Microblock Stride -------- */ -#define XDMAC_CSUS_SUBS_Pos 0 -#define XDMAC_CSUS_SUBS_Msk (0xffffffu << XDMAC_CSUS_SUBS_Pos) /**< \brief (XDMAC_CSUS) Channel x Source Microblock Stride */ -#define XDMAC_CSUS_SUBS(value) ((XDMAC_CSUS_SUBS_Msk & ((value) << XDMAC_CSUS_SUBS_Pos))) -/* -------- XDMAC_CDUS : (XDMAC Offset: N/A) Channel Destination Microblock Stride -------- */ -#define XDMAC_CDUS_DUBS_Pos 0 -#define XDMAC_CDUS_DUBS_Msk (0xffffffu << XDMAC_CDUS_DUBS_Pos) /**< \brief (XDMAC_CDUS) Channel x Destination Microblock Stride */ -#define XDMAC_CDUS_DUBS(value) ((XDMAC_CDUS_DUBS_Msk & ((value) << XDMAC_CDUS_DUBS_Pos))) - -/*@}*/ - - -#endif /* _SAMV71_XDMAC_COMPONENT_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_acc.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_acc.h deleted file mode 100644 index 4521d7e9..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_acc.h +++ /dev/null @@ -1,56 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_ACC_INSTANCE_ -#define _SAMV71_ACC_INSTANCE_ - -/* ========== Register definition for ACC peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_ACC_CR (0x40044000U) /**< \brief (ACC) Control Register */ - #define REG_ACC_MR (0x40044004U) /**< \brief (ACC) Mode Register */ - #define REG_ACC_IER (0x40044024U) /**< \brief (ACC) Interrupt Enable Register */ - #define REG_ACC_IDR (0x40044028U) /**< \brief (ACC) Interrupt Disable Register */ - #define REG_ACC_IMR (0x4004402CU) /**< \brief (ACC) Interrupt Mask Register */ - #define REG_ACC_ISR (0x40044030U) /**< \brief (ACC) Interrupt Status Register */ - #define REG_ACC_ACR (0x40044094U) /**< \brief (ACC) Analog Control Register */ - #define REG_ACC_WPMR (0x400440E4U) /**< \brief (ACC) Write Protection Mode Register */ - #define REG_ACC_WPSR (0x400440E8U) /**< \brief (ACC) Write Protection Status Register */ -#else - #define REG_ACC_CR (*(__O uint32_t*)0x40044000U) /**< \brief (ACC) Control Register */ - #define REG_ACC_MR (*(__IO uint32_t*)0x40044004U) /**< \brief (ACC) Mode Register */ - #define REG_ACC_IER (*(__O uint32_t*)0x40044024U) /**< \brief (ACC) Interrupt Enable Register */ - #define REG_ACC_IDR (*(__O uint32_t*)0x40044028U) /**< \brief (ACC) Interrupt Disable Register */ - #define REG_ACC_IMR (*(__I uint32_t*)0x4004402CU) /**< \brief (ACC) Interrupt Mask Register */ - #define REG_ACC_ISR (*(__I uint32_t*)0x40044030U) /**< \brief (ACC) Interrupt Status Register */ - #define REG_ACC_ACR (*(__IO uint32_t*)0x40044094U) /**< \brief (ACC) Analog Control Register */ - #define REG_ACC_WPMR (*(__IO uint32_t*)0x400440E4U) /**< \brief (ACC) Write Protection Mode Register */ - #define REG_ACC_WPSR (*(__I uint32_t*)0x400440E8U) /**< \brief (ACC) Write Protection Status Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_ACC_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_aes.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_aes.h deleted file mode 100644 index cb822a7d..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_aes.h +++ /dev/null @@ -1,70 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_AES_INSTANCE_ -#define _SAMV71_AES_INSTANCE_ - -/* ========== Register definition for AES peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_AES_CR (0x4006C000U) /**< \brief (AES) Control Register */ - #define REG_AES_MR (0x4006C004U) /**< \brief (AES) Mode Register */ - #define REG_AES_IER (0x4006C010U) /**< \brief (AES) Interrupt Enable Register */ - #define REG_AES_IDR (0x4006C014U) /**< \brief (AES) Interrupt Disable Register */ - #define REG_AES_IMR (0x4006C018U) /**< \brief (AES) Interrupt Mask Register */ - #define REG_AES_ISR (0x4006C01CU) /**< \brief (AES) Interrupt Status Register */ - #define REG_AES_KEYWR (0x4006C020U) /**< \brief (AES) Key Word Register */ - #define REG_AES_IDATAR (0x4006C040U) /**< \brief (AES) Input Data Register */ - #define REG_AES_ODATAR (0x4006C050U) /**< \brief (AES) Output Data Register */ - #define REG_AES_IVR (0x4006C060U) /**< \brief (AES) Initialization Vector Register */ - #define REG_AES_AADLENR (0x4006C070U) /**< \brief (AES) Additional Authenticated Data Length Register */ - #define REG_AES_CLENR (0x4006C074U) /**< \brief (AES) Plaintext/Ciphertext Length Register */ - #define REG_AES_GHASHR (0x4006C078U) /**< \brief (AES) GCM Intermediate Hash Word Register */ - #define REG_AES_TAGR (0x4006C088U) /**< \brief (AES) GCM Authentication Tag Word Register */ - #define REG_AES_CTRR (0x4006C098U) /**< \brief (AES) GCM Encryption Counter Value Register */ - #define REG_AES_GCMHR (0x4006C09CU) /**< \brief (AES) GCM H Word Register */ -#else - #define REG_AES_CR (*(__O uint32_t*)0x4006C000U) /**< \brief (AES) Control Register */ - #define REG_AES_MR (*(__IO uint32_t*)0x4006C004U) /**< \brief (AES) Mode Register */ - #define REG_AES_IER (*(__O uint32_t*)0x4006C010U) /**< \brief (AES) Interrupt Enable Register */ - #define REG_AES_IDR (*(__O uint32_t*)0x4006C014U) /**< \brief (AES) Interrupt Disable Register */ - #define REG_AES_IMR (*(__I uint32_t*)0x4006C018U) /**< \brief (AES) Interrupt Mask Register */ - #define REG_AES_ISR (*(__I uint32_t*)0x4006C01CU) /**< \brief (AES) Interrupt Status Register */ - #define REG_AES_KEYWR (*(__O uint32_t*)0x4006C020U) /**< \brief (AES) Key Word Register */ - #define REG_AES_IDATAR (*(__O uint32_t*)0x4006C040U) /**< \brief (AES) Input Data Register */ - #define REG_AES_ODATAR (*(__I uint32_t*)0x4006C050U) /**< \brief (AES) Output Data Register */ - #define REG_AES_IVR (*(__O uint32_t*)0x4006C060U) /**< \brief (AES) Initialization Vector Register */ - #define REG_AES_AADLENR (*(__IO uint32_t*)0x4006C070U) /**< \brief (AES) Additional Authenticated Data Length Register */ - #define REG_AES_CLENR (*(__IO uint32_t*)0x4006C074U) /**< \brief (AES) Plaintext/Ciphertext Length Register */ - #define REG_AES_GHASHR (*(__IO uint32_t*)0x4006C078U) /**< \brief (AES) GCM Intermediate Hash Word Register */ - #define REG_AES_TAGR (*(__I uint32_t*)0x4006C088U) /**< \brief (AES) GCM Authentication Tag Word Register */ - #define REG_AES_CTRR (*(__I uint32_t*)0x4006C098U) /**< \brief (AES) GCM Encryption Counter Value Register */ - #define REG_AES_GCMHR (*(__IO uint32_t*)0x4006C09CU) /**< \brief (AES) GCM H Word Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_AES_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_afec0.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_afec0.h deleted file mode 100644 index e168aee0..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_afec0.h +++ /dev/null @@ -1,96 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_AFEC0_INSTANCE_ -#define _SAMV71_AFEC0_INSTANCE_ - -/* ========== Register definition for AFEC0 peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_AFEC0_CR (0x4003C000U) /**< \brief (AFEC0) AFEC Control Register */ - #define REG_AFEC0_MR (0x4003C004U) /**< \brief (AFEC0) AFEC Mode Register */ - #define REG_AFEC0_EMR (0x4003C008U) /**< \brief (AFEC0) AFEC Extended Mode Register */ - #define REG_AFEC0_SEQ1R (0x4003C00CU) /**< \brief (AFEC0) AFEC Channel Sequence 1 Register */ - #define REG_AFEC0_SEQ2R (0x4003C010U) /**< \brief (AFEC0) AFEC Channel Sequence 2 Register */ - #define REG_AFEC0_CHER (0x4003C014U) /**< \brief (AFEC0) AFEC Channel Enable Register */ - #define REG_AFEC0_CHDR (0x4003C018U) /**< \brief (AFEC0) AFEC Channel Disable Register */ - #define REG_AFEC0_CHSR (0x4003C01CU) /**< \brief (AFEC0) AFEC Channel Status Register */ - #define REG_AFEC0_LCDR (0x4003C020U) /**< \brief (AFEC0) AFEC Last Converted Data Register */ - #define REG_AFEC0_IER (0x4003C024U) /**< \brief (AFEC0) AFEC Interrupt Enable Register */ - #define REG_AFEC0_IDR (0x4003C028U) /**< \brief (AFEC0) AFEC Interrupt Disable Register */ - #define REG_AFEC0_IMR (0x4003C02CU) /**< \brief (AFEC0) AFEC Interrupt Mask Register */ - #define REG_AFEC0_ISR (0x4003C030U) /**< \brief (AFEC0) AFEC Interrupt Status Register */ - #define REG_AFEC0_OVER (0x4003C04CU) /**< \brief (AFEC0) AFEC Overrun Status Register */ - #define REG_AFEC0_CWR (0x4003C050U) /**< \brief (AFEC0) AFEC Compare Window Register */ - #define REG_AFEC0_CGR (0x4003C054U) /**< \brief (AFEC0) AFEC Channel Gain Register */ - #define REG_AFEC0_DIFFR (0x4003C060U) /**< \brief (AFEC0) AFEC Channel Differential Register */ - #define REG_AFEC0_CSELR (0x4003C064U) /**< \brief (AFEC0) AFEC Channel Selection Register */ - #define REG_AFEC0_CDR (0x4003C068U) /**< \brief (AFEC0) AFEC Channel Data Register */ - #define REG_AFEC0_COCR (0x4003C06CU) /**< \brief (AFEC0) AFEC Channel Offset Compensation Register */ - #define REG_AFEC0_TEMPMR (0x4003C070U) /**< \brief (AFEC0) AFEC Temperature Sensor Mode Register */ - #define REG_AFEC0_TEMPCWR (0x4003C074U) /**< \brief (AFEC0) AFEC Temperature Compare Window Register */ - #define REG_AFEC0_ACR (0x4003C094U) /**< \brief (AFEC0) AFEC Analog Control Register */ - #define REG_AFEC0_SHMR (0x4003C0A0U) /**< \brief (AFEC0) AFEC Sample & Hold Mode Register */ - #define REG_AFEC0_COSR (0x4003C0D0U) /**< \brief (AFEC0) AFEC Correction Select Register */ - #define REG_AFEC0_CVR (0x4003C0D4U) /**< \brief (AFEC0) AFEC Correction Values Register */ - #define REG_AFEC0_CECR (0x4003C0D8U) /**< \brief (AFEC0) AFEC Channel Error Correction Register */ - #define REG_AFEC0_WPMR (0x4003C0E4U) /**< \brief (AFEC0) AFEC Write Protection Mode Register */ - #define REG_AFEC0_WPSR (0x4003C0E8U) /**< \brief (AFEC0) AFEC Write Protection Status Register */ -#else - #define REG_AFEC0_CR (*(__O uint32_t*)0x4003C000U) /**< \brief (AFEC0) AFEC Control Register */ - #define REG_AFEC0_MR (*(__IO uint32_t*)0x4003C004U) /**< \brief (AFEC0) AFEC Mode Register */ - #define REG_AFEC0_EMR (*(__IO uint32_t*)0x4003C008U) /**< \brief (AFEC0) AFEC Extended Mode Register */ - #define REG_AFEC0_SEQ1R (*(__IO uint32_t*)0x4003C00CU) /**< \brief (AFEC0) AFEC Channel Sequence 1 Register */ - #define REG_AFEC0_SEQ2R (*(__IO uint32_t*)0x4003C010U) /**< \brief (AFEC0) AFEC Channel Sequence 2 Register */ - #define REG_AFEC0_CHER (*(__O uint32_t*)0x4003C014U) /**< \brief (AFEC0) AFEC Channel Enable Register */ - #define REG_AFEC0_CHDR (*(__O uint32_t*)0x4003C018U) /**< \brief (AFEC0) AFEC Channel Disable Register */ - #define REG_AFEC0_CHSR (*(__I uint32_t*)0x4003C01CU) /**< \brief (AFEC0) AFEC Channel Status Register */ - #define REG_AFEC0_LCDR (*(__I uint32_t*)0x4003C020U) /**< \brief (AFEC0) AFEC Last Converted Data Register */ - #define REG_AFEC0_IER (*(__O uint32_t*)0x4003C024U) /**< \brief (AFEC0) AFEC Interrupt Enable Register */ - #define REG_AFEC0_IDR (*(__O uint32_t*)0x4003C028U) /**< \brief (AFEC0) AFEC Interrupt Disable Register */ - #define REG_AFEC0_IMR (*(__I uint32_t*)0x4003C02CU) /**< \brief (AFEC0) AFEC Interrupt Mask Register */ - #define REG_AFEC0_ISR (*(__I uint32_t*)0x4003C030U) /**< \brief (AFEC0) AFEC Interrupt Status Register */ - #define REG_AFEC0_OVER (*(__I uint32_t*)0x4003C04CU) /**< \brief (AFEC0) AFEC Overrun Status Register */ - #define REG_AFEC0_CWR (*(__IO uint32_t*)0x4003C050U) /**< \brief (AFEC0) AFEC Compare Window Register */ - #define REG_AFEC0_CGR (*(__IO uint32_t*)0x4003C054U) /**< \brief (AFEC0) AFEC Channel Gain Register */ - #define REG_AFEC0_DIFFR (*(__IO uint32_t*)0x4003C060U) /**< \brief (AFEC0) AFEC Channel Differential Register */ - #define REG_AFEC0_CSELR (*(__IO uint32_t*)0x4003C064U) /**< \brief (AFEC0) AFEC Channel Selection Register */ - #define REG_AFEC0_CDR (*(__I uint32_t*)0x4003C068U) /**< \brief (AFEC0) AFEC Channel Data Register */ - #define REG_AFEC0_COCR (*(__IO uint32_t*)0x4003C06CU) /**< \brief (AFEC0) AFEC Channel Offset Compensation Register */ - #define REG_AFEC0_TEMPMR (*(__IO uint32_t*)0x4003C070U) /**< \brief (AFEC0) AFEC Temperature Sensor Mode Register */ - #define REG_AFEC0_TEMPCWR (*(__IO uint32_t*)0x4003C074U) /**< \brief (AFEC0) AFEC Temperature Compare Window Register */ - #define REG_AFEC0_ACR (*(__IO uint32_t*)0x4003C094U) /**< \brief (AFEC0) AFEC Analog Control Register */ - #define REG_AFEC0_SHMR (*(__IO uint32_t*)0x4003C0A0U) /**< \brief (AFEC0) AFEC Sample & Hold Mode Register */ - #define REG_AFEC0_COSR (*(__IO uint32_t*)0x4003C0D0U) /**< \brief (AFEC0) AFEC Correction Select Register */ - #define REG_AFEC0_CVR (*(__IO uint32_t*)0x4003C0D4U) /**< \brief (AFEC0) AFEC Correction Values Register */ - #define REG_AFEC0_CECR (*(__IO uint32_t*)0x4003C0D8U) /**< \brief (AFEC0) AFEC Channel Error Correction Register */ - #define REG_AFEC0_WPMR (*(__IO uint32_t*)0x4003C0E4U) /**< \brief (AFEC0) AFEC Write Protection Mode Register */ - #define REG_AFEC0_WPSR (*(__I uint32_t*)0x4003C0E8U) /**< \brief (AFEC0) AFEC Write Protection Status Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_AFEC0_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_afec1.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_afec1.h deleted file mode 100644 index 1816ad5d..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_afec1.h +++ /dev/null @@ -1,96 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_AFEC1_INSTANCE_ -#define _SAMV71_AFEC1_INSTANCE_ - -/* ========== Register definition for AFEC1 peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_AFEC1_CR (0x40064000U) /**< \brief (AFEC1) AFEC Control Register */ - #define REG_AFEC1_MR (0x40064004U) /**< \brief (AFEC1) AFEC Mode Register */ - #define REG_AFEC1_EMR (0x40064008U) /**< \brief (AFEC1) AFEC Extended Mode Register */ - #define REG_AFEC1_SEQ1R (0x4006400CU) /**< \brief (AFEC1) AFEC Channel Sequence 1 Register */ - #define REG_AFEC1_SEQ2R (0x40064010U) /**< \brief (AFEC1) AFEC Channel Sequence 2 Register */ - #define REG_AFEC1_CHER (0x40064014U) /**< \brief (AFEC1) AFEC Channel Enable Register */ - #define REG_AFEC1_CHDR (0x40064018U) /**< \brief (AFEC1) AFEC Channel Disable Register */ - #define REG_AFEC1_CHSR (0x4006401CU) /**< \brief (AFEC1) AFEC Channel Status Register */ - #define REG_AFEC1_LCDR (0x40064020U) /**< \brief (AFEC1) AFEC Last Converted Data Register */ - #define REG_AFEC1_IER (0x40064024U) /**< \brief (AFEC1) AFEC Interrupt Enable Register */ - #define REG_AFEC1_IDR (0x40064028U) /**< \brief (AFEC1) AFEC Interrupt Disable Register */ - #define REG_AFEC1_IMR (0x4006402CU) /**< \brief (AFEC1) AFEC Interrupt Mask Register */ - #define REG_AFEC1_ISR (0x40064030U) /**< \brief (AFEC1) AFEC Interrupt Status Register */ - #define REG_AFEC1_OVER (0x4006404CU) /**< \brief (AFEC1) AFEC Overrun Status Register */ - #define REG_AFEC1_CWR (0x40064050U) /**< \brief (AFEC1) AFEC Compare Window Register */ - #define REG_AFEC1_CGR (0x40064054U) /**< \brief (AFEC1) AFEC Channel Gain Register */ - #define REG_AFEC1_DIFFR (0x40064060U) /**< \brief (AFEC1) AFEC Channel Differential Register */ - #define REG_AFEC1_CSELR (0x40064064U) /**< \brief (AFEC1) AFEC Channel Selection Register */ - #define REG_AFEC1_CDR (0x40064068U) /**< \brief (AFEC1) AFEC Channel Data Register */ - #define REG_AFEC1_COCR (0x4006406CU) /**< \brief (AFEC1) AFEC Channel Offset Compensation Register */ - #define REG_AFEC1_TEMPMR (0x40064070U) /**< \brief (AFEC1) AFEC Temperature Sensor Mode Register */ - #define REG_AFEC1_TEMPCWR (0x40064074U) /**< \brief (AFEC1) AFEC Temperature Compare Window Register */ - #define REG_AFEC1_ACR (0x40064094U) /**< \brief (AFEC1) AFEC Analog Control Register */ - #define REG_AFEC1_SHMR (0x400640A0U) /**< \brief (AFEC1) AFEC Sample & Hold Mode Register */ - #define REG_AFEC1_COSR (0x400640D0U) /**< \brief (AFEC1) AFEC Correction Select Register */ - #define REG_AFEC1_CVR (0x400640D4U) /**< \brief (AFEC1) AFEC Correction Values Register */ - #define REG_AFEC1_CECR (0x400640D8U) /**< \brief (AFEC1) AFEC Channel Error Correction Register */ - #define REG_AFEC1_WPMR (0x400640E4U) /**< \brief (AFEC1) AFEC Write Protection Mode Register */ - #define REG_AFEC1_WPSR (0x400640E8U) /**< \brief (AFEC1) AFEC Write Protection Status Register */ -#else - #define REG_AFEC1_CR (*(__O uint32_t*)0x40064000U) /**< \brief (AFEC1) AFEC Control Register */ - #define REG_AFEC1_MR (*(__IO uint32_t*)0x40064004U) /**< \brief (AFEC1) AFEC Mode Register */ - #define REG_AFEC1_EMR (*(__IO uint32_t*)0x40064008U) /**< \brief (AFEC1) AFEC Extended Mode Register */ - #define REG_AFEC1_SEQ1R (*(__IO uint32_t*)0x4006400CU) /**< \brief (AFEC1) AFEC Channel Sequence 1 Register */ - #define REG_AFEC1_SEQ2R (*(__IO uint32_t*)0x40064010U) /**< \brief (AFEC1) AFEC Channel Sequence 2 Register */ - #define REG_AFEC1_CHER (*(__O uint32_t*)0x40064014U) /**< \brief (AFEC1) AFEC Channel Enable Register */ - #define REG_AFEC1_CHDR (*(__O uint32_t*)0x40064018U) /**< \brief (AFEC1) AFEC Channel Disable Register */ - #define REG_AFEC1_CHSR (*(__I uint32_t*)0x4006401CU) /**< \brief (AFEC1) AFEC Channel Status Register */ - #define REG_AFEC1_LCDR (*(__I uint32_t*)0x40064020U) /**< \brief (AFEC1) AFEC Last Converted Data Register */ - #define REG_AFEC1_IER (*(__O uint32_t*)0x40064024U) /**< \brief (AFEC1) AFEC Interrupt Enable Register */ - #define REG_AFEC1_IDR (*(__O uint32_t*)0x40064028U) /**< \brief (AFEC1) AFEC Interrupt Disable Register */ - #define REG_AFEC1_IMR (*(__I uint32_t*)0x4006402CU) /**< \brief (AFEC1) AFEC Interrupt Mask Register */ - #define REG_AFEC1_ISR (*(__I uint32_t*)0x40064030U) /**< \brief (AFEC1) AFEC Interrupt Status Register */ - #define REG_AFEC1_OVER (*(__I uint32_t*)0x4006404CU) /**< \brief (AFEC1) AFEC Overrun Status Register */ - #define REG_AFEC1_CWR (*(__IO uint32_t*)0x40064050U) /**< \brief (AFEC1) AFEC Compare Window Register */ - #define REG_AFEC1_CGR (*(__IO uint32_t*)0x40064054U) /**< \brief (AFEC1) AFEC Channel Gain Register */ - #define REG_AFEC1_DIFFR (*(__IO uint32_t*)0x40064060U) /**< \brief (AFEC1) AFEC Channel Differential Register */ - #define REG_AFEC1_CSELR (*(__IO uint32_t*)0x40064064U) /**< \brief (AFEC1) AFEC Channel Selection Register */ - #define REG_AFEC1_CDR (*(__I uint32_t*)0x40064068U) /**< \brief (AFEC1) AFEC Channel Data Register */ - #define REG_AFEC1_COCR (*(__IO uint32_t*)0x4006406CU) /**< \brief (AFEC1) AFEC Channel Offset Compensation Register */ - #define REG_AFEC1_TEMPMR (*(__IO uint32_t*)0x40064070U) /**< \brief (AFEC1) AFEC Temperature Sensor Mode Register */ - #define REG_AFEC1_TEMPCWR (*(__IO uint32_t*)0x40064074U) /**< \brief (AFEC1) AFEC Temperature Compare Window Register */ - #define REG_AFEC1_ACR (*(__IO uint32_t*)0x40064094U) /**< \brief (AFEC1) AFEC Analog Control Register */ - #define REG_AFEC1_SHMR (*(__IO uint32_t*)0x400640A0U) /**< \brief (AFEC1) AFEC Sample & Hold Mode Register */ - #define REG_AFEC1_COSR (*(__IO uint32_t*)0x400640D0U) /**< \brief (AFEC1) AFEC Correction Select Register */ - #define REG_AFEC1_CVR (*(__IO uint32_t*)0x400640D4U) /**< \brief (AFEC1) AFEC Correction Values Register */ - #define REG_AFEC1_CECR (*(__IO uint32_t*)0x400640D8U) /**< \brief (AFEC1) AFEC Channel Error Correction Register */ - #define REG_AFEC1_WPMR (*(__IO uint32_t*)0x400640E4U) /**< \brief (AFEC1) AFEC Write Protection Mode Register */ - #define REG_AFEC1_WPSR (*(__I uint32_t*)0x400640E8U) /**< \brief (AFEC1) AFEC Write Protection Status Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_AFEC1_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_chipid.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_chipid.h deleted file mode 100644 index 8c297de9..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_chipid.h +++ /dev/null @@ -1,42 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_CHIPID_INSTANCE_ -#define _SAMV71_CHIPID_INSTANCE_ - -/* ========== Register definition for CHIPID peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_CHIPID_CIDR (0x400E0940U) /**< \brief (CHIPID) Chip ID Register */ - #define REG_CHIPID_EXID (0x400E0944U) /**< \brief (CHIPID) Chip ID Extension Register */ -#else - #define REG_CHIPID_CIDR (*(__I uint32_t*)0x400E0940U) /**< \brief (CHIPID) Chip ID Register */ - #define REG_CHIPID_EXID (*(__I uint32_t*)0x400E0944U) /**< \brief (CHIPID) Chip ID Extension Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_CHIPID_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_dacc.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_dacc.h deleted file mode 100644 index 31a5a4a7..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_dacc.h +++ /dev/null @@ -1,66 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_DACC_INSTANCE_ -#define _SAMV71_DACC_INSTANCE_ - -/* ========== Register definition for DACC peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_DACC_CR (0x40040000U) /**< \brief (DACC) Control Register */ - #define REG_DACC_MR (0x40040004U) /**< \brief (DACC) Mode Register */ - #define REG_DACC_TRIGR (0x40040008U) /**< \brief (DACC) Trigger Register */ - #define REG_DACC_CHER (0x40040010U) /**< \brief (DACC) Channel Enable Register */ - #define REG_DACC_CHDR (0x40040014U) /**< \brief (DACC) Channel Disable Register */ - #define REG_DACC_CHSR (0x40040018U) /**< \brief (DACC) Channel Status Register */ - #define REG_DACC_CDR (0x4004001CU) /**< \brief (DACC) Conversion Data Register */ - #define REG_DACC_IER (0x40040024U) /**< \brief (DACC) Interrupt Enable Register */ - #define REG_DACC_IDR (0x40040028U) /**< \brief (DACC) Interrupt Disable Register */ - #define REG_DACC_IMR (0x4004002CU) /**< \brief (DACC) Interrupt Mask Register */ - #define REG_DACC_ISR (0x40040030U) /**< \brief (DACC) Interrupt Status Register */ - #define REG_DACC_ACR (0x40040094U) /**< \brief (DACC) Analog Current Register */ - #define REG_DACC_WPMR (0x400400E4U) /**< \brief (DACC) Write Protection Mode register */ - #define REG_DACC_WPSR (0x400400E8U) /**< \brief (DACC) Write Protection Status register */ -#else - #define REG_DACC_CR (*(__O uint32_t*)0x40040000U) /**< \brief (DACC) Control Register */ - #define REG_DACC_MR (*(__IO uint32_t*)0x40040004U) /**< \brief (DACC) Mode Register */ - #define REG_DACC_TRIGR (*(__IO uint32_t*)0x40040008U) /**< \brief (DACC) Trigger Register */ - #define REG_DACC_CHER (*(__O uint32_t*)0x40040010U) /**< \brief (DACC) Channel Enable Register */ - #define REG_DACC_CHDR (*(__O uint32_t*)0x40040014U) /**< \brief (DACC) Channel Disable Register */ - #define REG_DACC_CHSR (*(__I uint32_t*)0x40040018U) /**< \brief (DACC) Channel Status Register */ - #define REG_DACC_CDR (*(__O uint32_t*)0x4004001CU) /**< \brief (DACC) Conversion Data Register */ - #define REG_DACC_IER (*(__O uint32_t*)0x40040024U) /**< \brief (DACC) Interrupt Enable Register */ - #define REG_DACC_IDR (*(__O uint32_t*)0x40040028U) /**< \brief (DACC) Interrupt Disable Register */ - #define REG_DACC_IMR (*(__I uint32_t*)0x4004002CU) /**< \brief (DACC) Interrupt Mask Register */ - #define REG_DACC_ISR (*(__I uint32_t*)0x40040030U) /**< \brief (DACC) Interrupt Status Register */ - #define REG_DACC_ACR (*(__IO uint32_t*)0x40040094U) /**< \brief (DACC) Analog Current Register */ - #define REG_DACC_WPMR (*(__IO uint32_t*)0x400400E4U) /**< \brief (DACC) Write Protection Mode register */ - #define REG_DACC_WPSR (*(__I uint32_t*)0x400400E8U) /**< \brief (DACC) Write Protection Status register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_DACC_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_efc.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_efc.h deleted file mode 100644 index 92ac20d4..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_efc.h +++ /dev/null @@ -1,50 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_EFC_INSTANCE_ -#define _SAMV71_EFC_INSTANCE_ - -/* ========== Register definition for EFC peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_EFC_FMR (0x400E0C00U) /**< \brief (EFC) EEFC Flash Mode Register */ - #define REG_EFC_FCR (0x400E0C04U) /**< \brief (EFC) EEFC Flash Command Register */ - #define REG_EFC_FSR (0x400E0C08U) /**< \brief (EFC) EEFC Flash Status Register */ - #define REG_EFC_FRR (0x400E0C0CU) /**< \brief (EFC) EEFC Flash Result Register */ - #define REG_EFC_VERSION (0x400E0C14U) /**< \brief (EFC) EEFC Version Register */ - #define REG_EFC_WPMR (0x400E0CE4U) /**< \brief (EFC) Write Protection Mode Register */ -#else - #define REG_EFC_FMR (*(__IO uint32_t*)0x400E0C00U) /**< \brief (EFC) EEFC Flash Mode Register */ - #define REG_EFC_FCR (*(__O uint32_t*)0x400E0C04U) /**< \brief (EFC) EEFC Flash Command Register */ - #define REG_EFC_FSR (*(__I uint32_t*)0x400E0C08U) /**< \brief (EFC) EEFC Flash Status Register */ - #define REG_EFC_FRR (*(__I uint32_t*)0x400E0C0CU) /**< \brief (EFC) EEFC Flash Result Register */ - #define REG_EFC_VERSION (*(__I uint32_t*)0x400E0C14U) /**< \brief (EFC) EEFC Version Register */ - #define REG_EFC_WPMR (*(__IO uint32_t*)0x400E0CE4U) /**< \brief (EFC) Write Protection Mode Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_EFC_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_gmac.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_gmac.h deleted file mode 100644 index 378eb146..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_gmac.h +++ /dev/null @@ -1,370 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_GMAC_INSTANCE_ -#define _SAMV71_GMAC_INSTANCE_ - -/* ========== Register definition for GMAC peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_GMAC_NCR (0x40050000U) /**< \brief (GMAC) Network Control Register */ - #define REG_GMAC_NCFGR (0x40050004U) /**< \brief (GMAC) Network Configuration Register */ - #define REG_GMAC_NSR (0x40050008U) /**< \brief (GMAC) Network Status Register */ - #define REG_GMAC_UR (0x4005000CU) /**< \brief (GMAC) User Register */ - #define REG_GMAC_DCFGR (0x40050010U) /**< \brief (GMAC) DMA Configuration Register */ - #define REG_GMAC_TSR (0x40050014U) /**< \brief (GMAC) Transmit Status Register */ - #define REG_GMAC_RBQB (0x40050018U) /**< \brief (GMAC) Receive Buffer Queue Base Address Register */ - #define REG_GMAC_TBQB (0x4005001CU) /**< \brief (GMAC) Transmit Buffer Queue Base Address Register */ - #define REG_GMAC_RSR (0x40050020U) /**< \brief (GMAC) Receive Status Register */ - #define REG_GMAC_ISR (0x40050024U) /**< \brief (GMAC) Interrupt Status Register */ - #define REG_GMAC_IER (0x40050028U) /**< \brief (GMAC) Interrupt Enable Register */ - #define REG_GMAC_IDR (0x4005002CU) /**< \brief (GMAC) Interrupt Disable Register */ - #define REG_GMAC_IMR (0x40050030U) /**< \brief (GMAC) Interrupt Mask Register */ - #define REG_GMAC_MAN (0x40050034U) /**< \brief (GMAC) PHY Maintenance Register */ - #define REG_GMAC_RPQ (0x40050038U) /**< \brief (GMAC) Received Pause Quantum Register */ - #define REG_GMAC_TPQ (0x4005003CU) /**< \brief (GMAC) Transmit Pause Quantum Register */ - #define REG_GMAC_TPSF (0x40050040U) /**< \brief (GMAC) TX Partial Store and Forward Register */ - #define REG_GMAC_RPSF (0x40050044U) /**< \brief (GMAC) RX Partial Store and Forward Register */ - #define REG_GMAC_RJFML (0x40050048U) /**< \brief (GMAC) RX Jumbo Frame Max Length Register */ - #define REG_GMAC_HRB (0x40050080U) /**< \brief (GMAC) Hash Register Bottom */ - #define REG_GMAC_HRT (0x40050084U) /**< \brief (GMAC) Hash Register Top */ - #define REG_GMAC_SAB1 (0x40050088U) /**< \brief (GMAC) Specific Address 1 Bottom Register */ - #define REG_GMAC_SAT1 (0x4005008CU) /**< \brief (GMAC) Specific Address 1 Top Register */ - #define REG_GMAC_SAB2 (0x40050090U) /**< \brief (GMAC) Specific Address 2 Bottom Register */ - #define REG_GMAC_SAT2 (0x40050094U) /**< \brief (GMAC) Specific Address 2 Top Register */ - #define REG_GMAC_SAB3 (0x40050098U) /**< \brief (GMAC) Specific Address 3 Bottom Register */ - #define REG_GMAC_SAT3 (0x4005009CU) /**< \brief (GMAC) Specific Address 3 Top Register */ - #define REG_GMAC_SAB4 (0x400500A0U) /**< \brief (GMAC) Specific Address 4 Bottom Register */ - #define REG_GMAC_SAT4 (0x400500A4U) /**< \brief (GMAC) Specific Address 4 Top Register */ - #define REG_GMAC_TIDM1 (0x400500A8U) /**< \brief (GMAC) Type ID Match 1 Register */ - #define REG_GMAC_TIDM2 (0x400500ACU) /**< \brief (GMAC) Type ID Match 2 Register */ - #define REG_GMAC_TIDM3 (0x400500B0U) /**< \brief (GMAC) Type ID Match 3 Register */ - #define REG_GMAC_TIDM4 (0x400500B4U) /**< \brief (GMAC) Type ID Match 4 Register */ - #define REG_GMAC_WOL (0x400500B8U) /**< \brief (GMAC) Wake on LAN Register */ - #define REG_GMAC_IPGS (0x400500BCU) /**< \brief (GMAC) IPG Stretch Register */ - #define REG_GMAC_SVLAN (0x400500C0U) /**< \brief (GMAC) Stacked VLAN Register */ - #define REG_GMAC_TPFCP (0x400500C4U) /**< \brief (GMAC) Transmit PFC Pause Register */ - #define REG_GMAC_SAMB1 (0x400500C8U) /**< \brief (GMAC) Specific Address 1 Mask Bottom Register */ - #define REG_GMAC_SAMT1 (0x400500CCU) /**< \brief (GMAC) Specific Address 1 Mask Top Register */ - #define REG_GMAC_NSC (0x400500DCU) /**< \brief (GMAC) 1588 Timer Nanosecond Comparison Register */ - #define REG_GMAC_SCL (0x400500E0U) /**< \brief (GMAC) 1588 Timer Second Comparison Low Register */ - #define REG_GMAC_SCH (0x400500E4U) /**< \brief (GMAC) 1588 Timer Second Comparison High Register */ - #define REG_GMAC_EFTSH (0x400500E8U) /**< \brief (GMAC) PTP Event Frame Transmitted Seconds High Register */ - #define REG_GMAC_EFRSH (0x400500ECU) /**< \brief (GMAC) PTP Event Frame Received Seconds High Register */ - #define REG_GMAC_PEFTSH (0x400500F0U) /**< \brief (GMAC) PTP Peer Event Frame Transmitted Seconds High Register */ - #define REG_GMAC_PEFRSH (0x400500F4U) /**< \brief (GMAC) PTP Peer Event Frame Received Seconds High Register */ - #define REG_GMAC_OTLO (0x40050100U) /**< \brief (GMAC) Octets Transmitted Low Register */ - #define REG_GMAC_OTHI (0x40050104U) /**< \brief (GMAC) Octets Transmitted High Register */ - #define REG_GMAC_FT (0x40050108U) /**< \brief (GMAC) Frames Transmitted Register */ - #define REG_GMAC_BCFT (0x4005010CU) /**< \brief (GMAC) Broadcast Frames Transmitted Register */ - #define REG_GMAC_MFT (0x40050110U) /**< \brief (GMAC) Multicast Frames Transmitted Register */ - #define REG_GMAC_PFT (0x40050114U) /**< \brief (GMAC) Pause Frames Transmitted Register */ - #define REG_GMAC_BFT64 (0x40050118U) /**< \brief (GMAC) 64 Byte Frames Transmitted Register */ - #define REG_GMAC_TBFT127 (0x4005011CU) /**< \brief (GMAC) 65 to 127 Byte Frames Transmitted Register */ - #define REG_GMAC_TBFT255 (0x40050120U) /**< \brief (GMAC) 128 to 255 Byte Frames Transmitted Register */ - #define REG_GMAC_TBFT511 (0x40050124U) /**< \brief (GMAC) 256 to 511 Byte Frames Transmitted Register */ - #define REG_GMAC_TBFT1023 (0x40050128U) /**< \brief (GMAC) 512 to 1023 Byte Frames Transmitted Register */ - #define REG_GMAC_TBFT1518 (0x4005012CU) /**< \brief (GMAC) 1024 to 1518 Byte Frames Transmitted Register */ - #define REG_GMAC_GTBFT1518 (0x40050130U) /**< \brief (GMAC) Greater Than 1518 Byte Frames Transmitted Register */ - #define REG_GMAC_TUR (0x40050134U) /**< \brief (GMAC) Transmit Underruns Register */ - #define REG_GMAC_SCF (0x40050138U) /**< \brief (GMAC) Single Collision Frames Register */ - #define REG_GMAC_MCF (0x4005013CU) /**< \brief (GMAC) Multiple Collision Frames Register */ - #define REG_GMAC_EC (0x40050140U) /**< \brief (GMAC) Excessive Collisions Register */ - #define REG_GMAC_LC (0x40050144U) /**< \brief (GMAC) Late Collisions Register */ - #define REG_GMAC_DTF (0x40050148U) /**< \brief (GMAC) Deferred Transmission Frames Register */ - #define REG_GMAC_CSE (0x4005014CU) /**< \brief (GMAC) Carrier Sense Errors Register Register */ - #define REG_GMAC_ORLO (0x40050150U) /**< \brief (GMAC) Octets Received Low Received Register */ - #define REG_GMAC_ORHI (0x40050154U) /**< \brief (GMAC) Octets Received High Received Register */ - #define REG_GMAC_FR (0x40050158U) /**< \brief (GMAC) Frames Received Register */ - #define REG_GMAC_BCFR (0x4005015CU) /**< \brief (GMAC) Broadcast Frames Received Register */ - #define REG_GMAC_MFR (0x40050160U) /**< \brief (GMAC) Multicast Frames Received Register */ - #define REG_GMAC_PFR (0x40050164U) /**< \brief (GMAC) Pause Frames Received Register */ - #define REG_GMAC_BFR64 (0x40050168U) /**< \brief (GMAC) 64 Byte Frames Received Register */ - #define REG_GMAC_TBFR127 (0x4005016CU) /**< \brief (GMAC) 65 to 127 Byte Frames Received Register */ - #define REG_GMAC_TBFR255 (0x40050170U) /**< \brief (GMAC) 128 to 255 Byte Frames Received Register */ - #define REG_GMAC_TBFR511 (0x40050174U) /**< \brief (GMAC) 256 to 511 Byte Frames Received Register */ - #define REG_GMAC_TBFR1023 (0x40050178U) /**< \brief (GMAC) 512 to 1023 Byte Frames Received Register */ - #define REG_GMAC_TBFR1518 (0x4005017CU) /**< \brief (GMAC) 1024 to 1518 Byte Frames Received Register */ - #define REG_GMAC_TMXBFR (0x40050180U) /**< \brief (GMAC) 1519 to Maximum Byte Frames Received Register */ - #define REG_GMAC_UFR (0x40050184U) /**< \brief (GMAC) Undersize Frames Received Register */ - #define REG_GMAC_OFR (0x40050188U) /**< \brief (GMAC) Oversize Frames Received Register */ - #define REG_GMAC_JR (0x4005018CU) /**< \brief (GMAC) Jabbers Received Register */ - #define REG_GMAC_FCSE (0x40050190U) /**< \brief (GMAC) Frame Check Sequence Errors Register */ - #define REG_GMAC_LFFE (0x40050194U) /**< \brief (GMAC) Length Field Frame Errors Register */ - #define REG_GMAC_RSE (0x40050198U) /**< \brief (GMAC) Receive Symbol Errors Register */ - #define REG_GMAC_AE (0x4005019CU) /**< \brief (GMAC) Alignment Errors Register */ - #define REG_GMAC_RRE (0x400501A0U) /**< \brief (GMAC) Receive Resource Errors Register */ - #define REG_GMAC_ROE (0x400501A4U) /**< \brief (GMAC) Receive Overrun Register */ - #define REG_GMAC_IHCE (0x400501A8U) /**< \brief (GMAC) IP Header Checksum Errors Register */ - #define REG_GMAC_TCE (0x400501ACU) /**< \brief (GMAC) TCP Checksum Errors Register */ - #define REG_GMAC_UCE (0x400501B0U) /**< \brief (GMAC) UDP Checksum Errors Register */ - #define REG_GMAC_TISUBN (0x400501BCU) /**< \brief (GMAC) 1588 Timer Increment Sub-nanoseconds Register */ - #define REG_GMAC_TSH (0x400501C0U) /**< \brief (GMAC) 1588 Timer Seconds High Register */ - #define REG_GMAC_TSL (0x400501D0U) /**< \brief (GMAC) 1588 Timer Seconds Low Register */ - #define REG_GMAC_TN (0x400501D4U) /**< \brief (GMAC) 1588 Timer Nanoseconds Register */ - #define REG_GMAC_TA (0x400501D8U) /**< \brief (GMAC) 1588 Timer Adjust Register */ - #define REG_GMAC_TI (0x400501DCU) /**< \brief (GMAC) 1588 Timer Increment Register */ - #define REG_GMAC_EFTSL (0x400501E0U) /**< \brief (GMAC) PTP Event Frame Transmitted Seconds Low Register */ - #define REG_GMAC_EFTN (0x400501E4U) /**< \brief (GMAC) PTP Event Frame Transmitted Nanoseconds Register */ - #define REG_GMAC_EFRSL (0x400501E8U) /**< \brief (GMAC) PTP Event Frame Received Seconds Low Register */ - #define REG_GMAC_EFRN (0x400501ECU) /**< \brief (GMAC) PTP Event Frame Received Nanoseconds Register */ - #define REG_GMAC_PEFTSL (0x400501F0U) /**< \brief (GMAC) PTP Peer Event Frame Transmitted Seconds Low Register */ - #define REG_GMAC_PEFTN (0x400501F4U) /**< \brief (GMAC) PTP Peer Event Frame Transmitted Nanoseconds Register */ - #define REG_GMAC_PEFRSL (0x400501F8U) /**< \brief (GMAC) PTP Peer Event Frame Received Seconds Low Register */ - #define REG_GMAC_PEFRN (0x400501FCU) /**< \brief (GMAC) PTP Peer Event Frame Received Nanoseconds Register */ - #define REG_GMAC_ISRPQ (0x40050400U) /**< \brief (GMAC) Interrupt Status Register Priority Queue (index = 1) */ - #define REG_GMAC_TBQBAPQ (0x40050440U) /**< \brief (GMAC) Transmit Buffer Queue Base Address Register Priority Queue (index = 1) */ - #define REG_GMAC_RBQBAPQ (0x40050480U) /**< \brief (GMAC) Receive Buffer Queue Base Address Register Priority Queue (index = 1) */ - #define REG_GMAC_RBSRPQ (0x400504A0U) /**< \brief (GMAC) Receive Buffer Size Register Priority Queue (index = 1) */ - #define REG_GMAC_CBSCR (0x400504BCU) /**< \brief (GMAC) Credit-Based Shaping Control Register */ - #define REG_GMAC_CBSISQA (0x400504C0U) /**< \brief (GMAC) Credit-Based Shaping IdleSlope Register for Queue A */ - #define REG_GMAC_CBSISQB (0x400504C4U) /**< \brief (GMAC) Credit-Based Shaping IdleSlope Register for Queue B */ - #define REG_GMAC_ST1RPQ (0x40050500U) /**< \brief (GMAC) Screening Type 1 Register Priority Queue (index = 0) */ - #define REG_GMAC_ST2RPQ (0x40050540U) /**< \brief (GMAC) Screening Type 2 Register Priority Queue (index = 0) */ - #define REG_GMAC_IERPQ (0x40050600U) /**< \brief (GMAC) Interrupt Enable Register Priority Queue (index = 1) */ - #define REG_GMAC_IDRPQ (0x40050620U) /**< \brief (GMAC) Interrupt Disable Register Priority Queue (index = 1) */ - #define REG_GMAC_IMRPQ (0x40050640U) /**< \brief (GMAC) Interrupt Mask Register Priority Queue (index = 1) */ - #define REG_GMAC_ST2ER (0x400506E0U) /**< \brief (GMAC) Screening Type 2 Ethertype Register (index = 0) */ - #define REG_GMAC_ST2CW00 (0x40050700U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 0) */ - #define REG_GMAC_ST2CW10 (0x40050704U) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 0) */ - #define REG_GMAC_ST2CW01 (0x40050708U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 1) */ - #define REG_GMAC_ST2CW11 (0x4005070CU) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 1) */ - #define REG_GMAC_ST2CW02 (0x40050710U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 2) */ - #define REG_GMAC_ST2CW12 (0x40050714U) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 2) */ - #define REG_GMAC_ST2CW03 (0x40050718U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 3) */ - #define REG_GMAC_ST2CW13 (0x4005071CU) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 3) */ - #define REG_GMAC_ST2CW04 (0x40050720U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 4) */ - #define REG_GMAC_ST2CW14 (0x40050724U) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 4) */ - #define REG_GMAC_ST2CW05 (0x40050728U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 5) */ - #define REG_GMAC_ST2CW15 (0x4005072CU) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 5) */ - #define REG_GMAC_ST2CW06 (0x40050730U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 6) */ - #define REG_GMAC_ST2CW16 (0x40050734U) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 6) */ - #define REG_GMAC_ST2CW07 (0x40050738U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 7) */ - #define REG_GMAC_ST2CW17 (0x4005073CU) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 7) */ - #define REG_GMAC_ST2CW08 (0x40050740U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 8) */ - #define REG_GMAC_ST2CW18 (0x40050744U) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 8) */ - #define REG_GMAC_ST2CW09 (0x40050748U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 9) */ - #define REG_GMAC_ST2CW19 (0x4005074CU) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 9) */ - #define REG_GMAC_ST2CW010 (0x40050750U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 10) */ - #define REG_GMAC_ST2CW110 (0x40050754U) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 10) */ - #define REG_GMAC_ST2CW011 (0x40050758U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 11) */ - #define REG_GMAC_ST2CW111 (0x4005075CU) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 11) */ - #define REG_GMAC_ST2CW012 (0x40050760U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 12) */ - #define REG_GMAC_ST2CW112 (0x40050764U) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 12) */ - #define REG_GMAC_ST2CW013 (0x40050768U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 13) */ - #define REG_GMAC_ST2CW113 (0x4005076CU) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 13) */ - #define REG_GMAC_ST2CW014 (0x40050770U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 14) */ - #define REG_GMAC_ST2CW114 (0x40050774U) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 14) */ - #define REG_GMAC_ST2CW015 (0x40050778U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 15) */ - #define REG_GMAC_ST2CW115 (0x4005077CU) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 15) */ - #define REG_GMAC_ST2CW016 (0x40050780U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 16) */ - #define REG_GMAC_ST2CW116 (0x40050784U) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 16) */ - #define REG_GMAC_ST2CW017 (0x40050788U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 17) */ - #define REG_GMAC_ST2CW117 (0x4005078CU) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 17) */ - #define REG_GMAC_ST2CW018 (0x40050790U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 18) */ - #define REG_GMAC_ST2CW118 (0x40050794U) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 18) */ - #define REG_GMAC_ST2CW019 (0x40050798U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 19) */ - #define REG_GMAC_ST2CW119 (0x4005079CU) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 19) */ - #define REG_GMAC_ST2CW020 (0x400507A0U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 20) */ - #define REG_GMAC_ST2CW120 (0x400507A4U) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 20) */ - #define REG_GMAC_ST2CW021 (0x400507A8U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 21) */ - #define REG_GMAC_ST2CW121 (0x400507ACU) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 21) */ - #define REG_GMAC_ST2CW022 (0x400507B0U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 22) */ - #define REG_GMAC_ST2CW122 (0x400507B4U) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 22) */ - #define REG_GMAC_ST2CW023 (0x400507B8U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 23) */ - #define REG_GMAC_ST2CW123 (0x400507BCU) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 23) */ -#else - #define REG_GMAC_NCR (*(__IO uint32_t*)0x40050000U) /**< \brief (GMAC) Network Control Register */ - #define REG_GMAC_NCFGR (*(__IO uint32_t*)0x40050004U) /**< \brief (GMAC) Network Configuration Register */ - #define REG_GMAC_NSR (*(__I uint32_t*)0x40050008U) /**< \brief (GMAC) Network Status Register */ - #define REG_GMAC_UR (*(__IO uint32_t*)0x4005000CU) /**< \brief (GMAC) User Register */ - #define REG_GMAC_DCFGR (*(__IO uint32_t*)0x40050010U) /**< \brief (GMAC) DMA Configuration Register */ - #define REG_GMAC_TSR (*(__IO uint32_t*)0x40050014U) /**< \brief (GMAC) Transmit Status Register */ - #define REG_GMAC_RBQB (*(__IO uint32_t*)0x40050018U) /**< \brief (GMAC) Receive Buffer Queue Base Address Register */ - #define REG_GMAC_TBQB (*(__IO uint32_t*)0x4005001CU) /**< \brief (GMAC) Transmit Buffer Queue Base Address Register */ - #define REG_GMAC_RSR (*(__IO uint32_t*)0x40050020U) /**< \brief (GMAC) Receive Status Register */ - #define REG_GMAC_ISR (*(__I uint32_t*)0x40050024U) /**< \brief (GMAC) Interrupt Status Register */ - #define REG_GMAC_IER (*(__O uint32_t*)0x40050028U) /**< \brief (GMAC) Interrupt Enable Register */ - #define REG_GMAC_IDR (*(__O uint32_t*)0x4005002CU) /**< \brief (GMAC) Interrupt Disable Register */ - #define REG_GMAC_IMR (*(__IO uint32_t*)0x40050030U) /**< \brief (GMAC) Interrupt Mask Register */ - #define REG_GMAC_MAN (*(__IO uint32_t*)0x40050034U) /**< \brief (GMAC) PHY Maintenance Register */ - #define REG_GMAC_RPQ (*(__I uint32_t*)0x40050038U) /**< \brief (GMAC) Received Pause Quantum Register */ - #define REG_GMAC_TPQ (*(__IO uint32_t*)0x4005003CU) /**< \brief (GMAC) Transmit Pause Quantum Register */ - #define REG_GMAC_TPSF (*(__IO uint32_t*)0x40050040U) /**< \brief (GMAC) TX Partial Store and Forward Register */ - #define REG_GMAC_RPSF (*(__IO uint32_t*)0x40050044U) /**< \brief (GMAC) RX Partial Store and Forward Register */ - #define REG_GMAC_RJFML (*(__IO uint32_t*)0x40050048U) /**< \brief (GMAC) RX Jumbo Frame Max Length Register */ - #define REG_GMAC_HRB (*(__IO uint32_t*)0x40050080U) /**< \brief (GMAC) Hash Register Bottom */ - #define REG_GMAC_HRT (*(__IO uint32_t*)0x40050084U) /**< \brief (GMAC) Hash Register Top */ - #define REG_GMAC_SAB1 (*(__IO uint32_t*)0x40050088U) /**< \brief (GMAC) Specific Address 1 Bottom Register */ - #define REG_GMAC_SAT1 (*(__IO uint32_t*)0x4005008CU) /**< \brief (GMAC) Specific Address 1 Top Register */ - #define REG_GMAC_SAB2 (*(__IO uint32_t*)0x40050090U) /**< \brief (GMAC) Specific Address 2 Bottom Register */ - #define REG_GMAC_SAT2 (*(__IO uint32_t*)0x40050094U) /**< \brief (GMAC) Specific Address 2 Top Register */ - #define REG_GMAC_SAB3 (*(__IO uint32_t*)0x40050098U) /**< \brief (GMAC) Specific Address 3 Bottom Register */ - #define REG_GMAC_SAT3 (*(__IO uint32_t*)0x4005009CU) /**< \brief (GMAC) Specific Address 3 Top Register */ - #define REG_GMAC_SAB4 (*(__IO uint32_t*)0x400500A0U) /**< \brief (GMAC) Specific Address 4 Bottom Register */ - #define REG_GMAC_SAT4 (*(__IO uint32_t*)0x400500A4U) /**< \brief (GMAC) Specific Address 4 Top Register */ - #define REG_GMAC_TIDM1 (*(__IO uint32_t*)0x400500A8U) /**< \brief (GMAC) Type ID Match 1 Register */ - #define REG_GMAC_TIDM2 (*(__IO uint32_t*)0x400500ACU) /**< \brief (GMAC) Type ID Match 2 Register */ - #define REG_GMAC_TIDM3 (*(__IO uint32_t*)0x400500B0U) /**< \brief (GMAC) Type ID Match 3 Register */ - #define REG_GMAC_TIDM4 (*(__IO uint32_t*)0x400500B4U) /**< \brief (GMAC) Type ID Match 4 Register */ - #define REG_GMAC_WOL (*(__IO uint32_t*)0x400500B8U) /**< \brief (GMAC) Wake on LAN Register */ - #define REG_GMAC_IPGS (*(__IO uint32_t*)0x400500BCU) /**< \brief (GMAC) IPG Stretch Register */ - #define REG_GMAC_SVLAN (*(__IO uint32_t*)0x400500C0U) /**< \brief (GMAC) Stacked VLAN Register */ - #define REG_GMAC_TPFCP (*(__IO uint32_t*)0x400500C4U) /**< \brief (GMAC) Transmit PFC Pause Register */ - #define REG_GMAC_SAMB1 (*(__IO uint32_t*)0x400500C8U) /**< \brief (GMAC) Specific Address 1 Mask Bottom Register */ - #define REG_GMAC_SAMT1 (*(__IO uint32_t*)0x400500CCU) /**< \brief (GMAC) Specific Address 1 Mask Top Register */ - #define REG_GMAC_NSC (*(__IO uint32_t*)0x400500DCU) /**< \brief (GMAC) 1588 Timer Nanosecond Comparison Register */ - #define REG_GMAC_SCL (*(__IO uint32_t*)0x400500E0U) /**< \brief (GMAC) 1588 Timer Second Comparison Low Register */ - #define REG_GMAC_SCH (*(__IO uint32_t*)0x400500E4U) /**< \brief (GMAC) 1588 Timer Second Comparison High Register */ - #define REG_GMAC_EFTSH (*(__I uint32_t*)0x400500E8U) /**< \brief (GMAC) PTP Event Frame Transmitted Seconds High Register */ - #define REG_GMAC_EFRSH (*(__I uint32_t*)0x400500ECU) /**< \brief (GMAC) PTP Event Frame Received Seconds High Register */ - #define REG_GMAC_PEFTSH (*(__I uint32_t*)0x400500F0U) /**< \brief (GMAC) PTP Peer Event Frame Transmitted Seconds High Register */ - #define REG_GMAC_PEFRSH (*(__I uint32_t*)0x400500F4U) /**< \brief (GMAC) PTP Peer Event Frame Received Seconds High Register */ - #define REG_GMAC_OTLO (*(__I uint32_t*)0x40050100U) /**< \brief (GMAC) Octets Transmitted Low Register */ - #define REG_GMAC_OTHI (*(__I uint32_t*)0x40050104U) /**< \brief (GMAC) Octets Transmitted High Register */ - #define REG_GMAC_FT (*(__I uint32_t*)0x40050108U) /**< \brief (GMAC) Frames Transmitted Register */ - #define REG_GMAC_BCFT (*(__I uint32_t*)0x4005010CU) /**< \brief (GMAC) Broadcast Frames Transmitted Register */ - #define REG_GMAC_MFT (*(__I uint32_t*)0x40050110U) /**< \brief (GMAC) Multicast Frames Transmitted Register */ - #define REG_GMAC_PFT (*(__I uint32_t*)0x40050114U) /**< \brief (GMAC) Pause Frames Transmitted Register */ - #define REG_GMAC_BFT64 (*(__I uint32_t*)0x40050118U) /**< \brief (GMAC) 64 Byte Frames Transmitted Register */ - #define REG_GMAC_TBFT127 (*(__I uint32_t*)0x4005011CU) /**< \brief (GMAC) 65 to 127 Byte Frames Transmitted Register */ - #define REG_GMAC_TBFT255 (*(__I uint32_t*)0x40050120U) /**< \brief (GMAC) 128 to 255 Byte Frames Transmitted Register */ - #define REG_GMAC_TBFT511 (*(__I uint32_t*)0x40050124U) /**< \brief (GMAC) 256 to 511 Byte Frames Transmitted Register */ - #define REG_GMAC_TBFT1023 (*(__I uint32_t*)0x40050128U) /**< \brief (GMAC) 512 to 1023 Byte Frames Transmitted Register */ - #define REG_GMAC_TBFT1518 (*(__I uint32_t*)0x4005012CU) /**< \brief (GMAC) 1024 to 1518 Byte Frames Transmitted Register */ - #define REG_GMAC_GTBFT1518 (*(__I uint32_t*)0x40050130U) /**< \brief (GMAC) Greater Than 1518 Byte Frames Transmitted Register */ - #define REG_GMAC_TUR (*(__I uint32_t*)0x40050134U) /**< \brief (GMAC) Transmit Underruns Register */ - #define REG_GMAC_SCF (*(__I uint32_t*)0x40050138U) /**< \brief (GMAC) Single Collision Frames Register */ - #define REG_GMAC_MCF (*(__I uint32_t*)0x4005013CU) /**< \brief (GMAC) Multiple Collision Frames Register */ - #define REG_GMAC_EC (*(__I uint32_t*)0x40050140U) /**< \brief (GMAC) Excessive Collisions Register */ - #define REG_GMAC_LC (*(__I uint32_t*)0x40050144U) /**< \brief (GMAC) Late Collisions Register */ - #define REG_GMAC_DTF (*(__I uint32_t*)0x40050148U) /**< \brief (GMAC) Deferred Transmission Frames Register */ - #define REG_GMAC_CSE (*(__I uint32_t*)0x4005014CU) /**< \brief (GMAC) Carrier Sense Errors Register Register */ - #define REG_GMAC_ORLO (*(__I uint32_t*)0x40050150U) /**< \brief (GMAC) Octets Received Low Received Register */ - #define REG_GMAC_ORHI (*(__I uint32_t*)0x40050154U) /**< \brief (GMAC) Octets Received High Received Register */ - #define REG_GMAC_FR (*(__I uint32_t*)0x40050158U) /**< \brief (GMAC) Frames Received Register */ - #define REG_GMAC_BCFR (*(__I uint32_t*)0x4005015CU) /**< \brief (GMAC) Broadcast Frames Received Register */ - #define REG_GMAC_MFR (*(__I uint32_t*)0x40050160U) /**< \brief (GMAC) Multicast Frames Received Register */ - #define REG_GMAC_PFR (*(__I uint32_t*)0x40050164U) /**< \brief (GMAC) Pause Frames Received Register */ - #define REG_GMAC_BFR64 (*(__I uint32_t*)0x40050168U) /**< \brief (GMAC) 64 Byte Frames Received Register */ - #define REG_GMAC_TBFR127 (*(__I uint32_t*)0x4005016CU) /**< \brief (GMAC) 65 to 127 Byte Frames Received Register */ - #define REG_GMAC_TBFR255 (*(__I uint32_t*)0x40050170U) /**< \brief (GMAC) 128 to 255 Byte Frames Received Register */ - #define REG_GMAC_TBFR511 (*(__I uint32_t*)0x40050174U) /**< \brief (GMAC) 256 to 511 Byte Frames Received Register */ - #define REG_GMAC_TBFR1023 (*(__I uint32_t*)0x40050178U) /**< \brief (GMAC) 512 to 1023 Byte Frames Received Register */ - #define REG_GMAC_TBFR1518 (*(__I uint32_t*)0x4005017CU) /**< \brief (GMAC) 1024 to 1518 Byte Frames Received Register */ - #define REG_GMAC_TMXBFR (*(__I uint32_t*)0x40050180U) /**< \brief (GMAC) 1519 to Maximum Byte Frames Received Register */ - #define REG_GMAC_UFR (*(__I uint32_t*)0x40050184U) /**< \brief (GMAC) Undersize Frames Received Register */ - #define REG_GMAC_OFR (*(__I uint32_t*)0x40050188U) /**< \brief (GMAC) Oversize Frames Received Register */ - #define REG_GMAC_JR (*(__I uint32_t*)0x4005018CU) /**< \brief (GMAC) Jabbers Received Register */ - #define REG_GMAC_FCSE (*(__I uint32_t*)0x40050190U) /**< \brief (GMAC) Frame Check Sequence Errors Register */ - #define REG_GMAC_LFFE (*(__I uint32_t*)0x40050194U) /**< \brief (GMAC) Length Field Frame Errors Register */ - #define REG_GMAC_RSE (*(__I uint32_t*)0x40050198U) /**< \brief (GMAC) Receive Symbol Errors Register */ - #define REG_GMAC_AE (*(__I uint32_t*)0x4005019CU) /**< \brief (GMAC) Alignment Errors Register */ - #define REG_GMAC_RRE (*(__I uint32_t*)0x400501A0U) /**< \brief (GMAC) Receive Resource Errors Register */ - #define REG_GMAC_ROE (*(__I uint32_t*)0x400501A4U) /**< \brief (GMAC) Receive Overrun Register */ - #define REG_GMAC_IHCE (*(__I uint32_t*)0x400501A8U) /**< \brief (GMAC) IP Header Checksum Errors Register */ - #define REG_GMAC_TCE (*(__I uint32_t*)0x400501ACU) /**< \brief (GMAC) TCP Checksum Errors Register */ - #define REG_GMAC_UCE (*(__I uint32_t*)0x400501B0U) /**< \brief (GMAC) UDP Checksum Errors Register */ - #define REG_GMAC_TISUBN (*(__IO uint32_t*)0x400501BCU) /**< \brief (GMAC) 1588 Timer Increment Sub-nanoseconds Register */ - #define REG_GMAC_TSH (*(__IO uint32_t*)0x400501C0U) /**< \brief (GMAC) 1588 Timer Seconds High Register */ - #define REG_GMAC_TSL (*(__IO uint32_t*)0x400501D0U) /**< \brief (GMAC) 1588 Timer Seconds Low Register */ - #define REG_GMAC_TN (*(__IO uint32_t*)0x400501D4U) /**< \brief (GMAC) 1588 Timer Nanoseconds Register */ - #define REG_GMAC_TA (*(__O uint32_t*)0x400501D8U) /**< \brief (GMAC) 1588 Timer Adjust Register */ - #define REG_GMAC_TI (*(__IO uint32_t*)0x400501DCU) /**< \brief (GMAC) 1588 Timer Increment Register */ - #define REG_GMAC_EFTSL (*(__I uint32_t*)0x400501E0U) /**< \brief (GMAC) PTP Event Frame Transmitted Seconds Low Register */ - #define REG_GMAC_EFTN (*(__I uint32_t*)0x400501E4U) /**< \brief (GMAC) PTP Event Frame Transmitted Nanoseconds Register */ - #define REG_GMAC_EFRSL (*(__I uint32_t*)0x400501E8U) /**< \brief (GMAC) PTP Event Frame Received Seconds Low Register */ - #define REG_GMAC_EFRN (*(__I uint32_t*)0x400501ECU) /**< \brief (GMAC) PTP Event Frame Received Nanoseconds Register */ - #define REG_GMAC_PEFTSL (*(__I uint32_t*)0x400501F0U) /**< \brief (GMAC) PTP Peer Event Frame Transmitted Seconds Low Register */ - #define REG_GMAC_PEFTN (*(__I uint32_t*)0x400501F4U) /**< \brief (GMAC) PTP Peer Event Frame Transmitted Nanoseconds Register */ - #define REG_GMAC_PEFRSL (*(__I uint32_t*)0x400501F8U) /**< \brief (GMAC) PTP Peer Event Frame Received Seconds Low Register */ - #define REG_GMAC_PEFRN (*(__I uint32_t*)0x400501FCU) /**< \brief (GMAC) PTP Peer Event Frame Received Nanoseconds Register */ - #define REG_GMAC_ISRPQ (*(__I uint32_t*)0x40050400U) /**< \brief (GMAC) Interrupt Status Register Priority Queue (index = 1) */ - #define REG_GMAC_TBQBAPQ (*(__IO uint32_t*)0x40050440U) /**< \brief (GMAC) Transmit Buffer Queue Base Address Register Priority Queue (index = 1) */ - #define REG_GMAC_RBQBAPQ (*(__IO uint32_t*)0x40050480U) /**< \brief (GMAC) Receive Buffer Queue Base Address Register Priority Queue (index = 1) */ - #define REG_GMAC_RBSRPQ (*(__IO uint32_t*)0x400504A0U) /**< \brief (GMAC) Receive Buffer Size Register Priority Queue (index = 1) */ - #define REG_GMAC_CBSCR (*(__IO uint32_t*)0x400504BCU) /**< \brief (GMAC) Credit-Based Shaping Control Register */ - #define REG_GMAC_CBSISQA (*(__IO uint32_t*)0x400504C0U) /**< \brief (GMAC) Credit-Based Shaping IdleSlope Register for Queue A */ - #define REG_GMAC_CBSISQB (*(__IO uint32_t*)0x400504C4U) /**< \brief (GMAC) Credit-Based Shaping IdleSlope Register for Queue B */ - #define REG_GMAC_ST1RPQ (*(__IO uint32_t*)0x40050500U) /**< \brief (GMAC) Screening Type 1 Register Priority Queue (index = 0) */ - #define REG_GMAC_ST2RPQ (*(__IO uint32_t*)0x40050540U) /**< \brief (GMAC) Screening Type 2 Register Priority Queue (index = 0) */ - #define REG_GMAC_IERPQ (*(__O uint32_t*)0x40050600U) /**< \brief (GMAC) Interrupt Enable Register Priority Queue (index = 1) */ - #define REG_GMAC_IDRPQ (*(__O uint32_t*)0x40050620U) /**< \brief (GMAC) Interrupt Disable Register Priority Queue (index = 1) */ - #define REG_GMAC_IMRPQ (*(__IO uint32_t*)0x40050640U) /**< \brief (GMAC) Interrupt Mask Register Priority Queue (index = 1) */ - #define REG_GMAC_ST2ER (*(__IO uint32_t*)0x400506E0U) /**< \brief (GMAC) Screening Type 2 Ethertype Register (index = 0) */ - #define REG_GMAC_ST2CW00 (*(__IO uint32_t*)0x40050700U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 0) */ - #define REG_GMAC_ST2CW10 (*(__IO uint32_t*)0x40050704U) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 0) */ - #define REG_GMAC_ST2CW01 (*(__IO uint32_t*)0x40050708U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 1) */ - #define REG_GMAC_ST2CW11 (*(__IO uint32_t*)0x4005070CU) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 1) */ - #define REG_GMAC_ST2CW02 (*(__IO uint32_t*)0x40050710U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 2) */ - #define REG_GMAC_ST2CW12 (*(__IO uint32_t*)0x40050714U) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 2) */ - #define REG_GMAC_ST2CW03 (*(__IO uint32_t*)0x40050718U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 3) */ - #define REG_GMAC_ST2CW13 (*(__IO uint32_t*)0x4005071CU) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 3) */ - #define REG_GMAC_ST2CW04 (*(__IO uint32_t*)0x40050720U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 4) */ - #define REG_GMAC_ST2CW14 (*(__IO uint32_t*)0x40050724U) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 4) */ - #define REG_GMAC_ST2CW05 (*(__IO uint32_t*)0x40050728U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 5) */ - #define REG_GMAC_ST2CW15 (*(__IO uint32_t*)0x4005072CU) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 5) */ - #define REG_GMAC_ST2CW06 (*(__IO uint32_t*)0x40050730U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 6) */ - #define REG_GMAC_ST2CW16 (*(__IO uint32_t*)0x40050734U) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 6) */ - #define REG_GMAC_ST2CW07 (*(__IO uint32_t*)0x40050738U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 7) */ - #define REG_GMAC_ST2CW17 (*(__IO uint32_t*)0x4005073CU) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 7) */ - #define REG_GMAC_ST2CW08 (*(__IO uint32_t*)0x40050740U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 8) */ - #define REG_GMAC_ST2CW18 (*(__IO uint32_t*)0x40050744U) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 8) */ - #define REG_GMAC_ST2CW09 (*(__IO uint32_t*)0x40050748U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 9) */ - #define REG_GMAC_ST2CW19 (*(__IO uint32_t*)0x4005074CU) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 9) */ - #define REG_GMAC_ST2CW010 (*(__IO uint32_t*)0x40050750U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 10) */ - #define REG_GMAC_ST2CW110 (*(__IO uint32_t*)0x40050754U) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 10) */ - #define REG_GMAC_ST2CW011 (*(__IO uint32_t*)0x40050758U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 11) */ - #define REG_GMAC_ST2CW111 (*(__IO uint32_t*)0x4005075CU) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 11) */ - #define REG_GMAC_ST2CW012 (*(__IO uint32_t*)0x40050760U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 12) */ - #define REG_GMAC_ST2CW112 (*(__IO uint32_t*)0x40050764U) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 12) */ - #define REG_GMAC_ST2CW013 (*(__IO uint32_t*)0x40050768U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 13) */ - #define REG_GMAC_ST2CW113 (*(__IO uint32_t*)0x4005076CU) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 13) */ - #define REG_GMAC_ST2CW014 (*(__IO uint32_t*)0x40050770U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 14) */ - #define REG_GMAC_ST2CW114 (*(__IO uint32_t*)0x40050774U) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 14) */ - #define REG_GMAC_ST2CW015 (*(__IO uint32_t*)0x40050778U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 15) */ - #define REG_GMAC_ST2CW115 (*(__IO uint32_t*)0x4005077CU) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 15) */ - #define REG_GMAC_ST2CW016 (*(__IO uint32_t*)0x40050780U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 16) */ - #define REG_GMAC_ST2CW116 (*(__IO uint32_t*)0x40050784U) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 16) */ - #define REG_GMAC_ST2CW017 (*(__IO uint32_t*)0x40050788U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 17) */ - #define REG_GMAC_ST2CW117 (*(__IO uint32_t*)0x4005078CU) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 17) */ - #define REG_GMAC_ST2CW018 (*(__IO uint32_t*)0x40050790U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 18) */ - #define REG_GMAC_ST2CW118 (*(__IO uint32_t*)0x40050794U) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 18) */ - #define REG_GMAC_ST2CW019 (*(__IO uint32_t*)0x40050798U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 19) */ - #define REG_GMAC_ST2CW119 (*(__IO uint32_t*)0x4005079CU) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 19) */ - #define REG_GMAC_ST2CW020 (*(__IO uint32_t*)0x400507A0U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 20) */ - #define REG_GMAC_ST2CW120 (*(__IO uint32_t*)0x400507A4U) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 20) */ - #define REG_GMAC_ST2CW021 (*(__IO uint32_t*)0x400507A8U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 21) */ - #define REG_GMAC_ST2CW121 (*(__IO uint32_t*)0x400507ACU) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 21) */ - #define REG_GMAC_ST2CW022 (*(__IO uint32_t*)0x400507B0U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 22) */ - #define REG_GMAC_ST2CW122 (*(__IO uint32_t*)0x400507B4U) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 22) */ - #define REG_GMAC_ST2CW023 (*(__IO uint32_t*)0x400507B8U) /**< \brief (GMAC) Screening Type 2 Compare Word 0 Register (index = 23) */ - #define REG_GMAC_ST2CW123 (*(__IO uint32_t*)0x400507BCU) /**< \brief (GMAC) Screening Type 2 Compare Word 1 Register (index = 23) */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_GMAC_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_gpbr.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_gpbr.h deleted file mode 100644 index 7ecd31e3..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_gpbr.h +++ /dev/null @@ -1,40 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_GPBR_INSTANCE_ -#define _SAMV71_GPBR_INSTANCE_ - -/* ========== Register definition for GPBR peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_GPBR_GPBR (0x400E1890U) /**< \brief (GPBR) General Purpose Backup Register */ -#else - #define REG_GPBR_GPBR (*(__IO uint32_t*)0x400E1890U) /**< \brief (GPBR) General Purpose Backup Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_GPBR_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_hsmci.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_hsmci.h deleted file mode 100644 index 8caf067c..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_hsmci.h +++ /dev/null @@ -1,78 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_HSMCI_INSTANCE_ -#define _SAMV71_HSMCI_INSTANCE_ - -/* ========== Register definition for HSMCI peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_HSMCI_CR (0x40000000U) /**< \brief (HSMCI) Control Register */ - #define REG_HSMCI_MR (0x40000004U) /**< \brief (HSMCI) Mode Register */ - #define REG_HSMCI_DTOR (0x40000008U) /**< \brief (HSMCI) Data Timeout Register */ - #define REG_HSMCI_SDCR (0x4000000CU) /**< \brief (HSMCI) SD/SDIO Card Register */ - #define REG_HSMCI_ARGR (0x40000010U) /**< \brief (HSMCI) Argument Register */ - #define REG_HSMCI_CMDR (0x40000014U) /**< \brief (HSMCI) Command Register */ - #define REG_HSMCI_BLKR (0x40000018U) /**< \brief (HSMCI) Block Register */ - #define REG_HSMCI_CSTOR (0x4000001CU) /**< \brief (HSMCI) Completion Signal Timeout Register */ - #define REG_HSMCI_RSPR (0x40000020U) /**< \brief (HSMCI) Response Register */ - #define REG_HSMCI_RDR (0x40000030U) /**< \brief (HSMCI) Receive Data Register */ - #define REG_HSMCI_TDR (0x40000034U) /**< \brief (HSMCI) Transmit Data Register */ - #define REG_HSMCI_SR (0x40000040U) /**< \brief (HSMCI) Status Register */ - #define REG_HSMCI_IER (0x40000044U) /**< \brief (HSMCI) Interrupt Enable Register */ - #define REG_HSMCI_IDR (0x40000048U) /**< \brief (HSMCI) Interrupt Disable Register */ - #define REG_HSMCI_IMR (0x4000004CU) /**< \brief (HSMCI) Interrupt Mask Register */ - #define REG_HSMCI_DMA (0x40000050U) /**< \brief (HSMCI) DMA Configuration Register */ - #define REG_HSMCI_CFG (0x40000054U) /**< \brief (HSMCI) Configuration Register */ - #define REG_HSMCI_WPMR (0x400000E4U) /**< \brief (HSMCI) Write Protection Mode Register */ - #define REG_HSMCI_WPSR (0x400000E8U) /**< \brief (HSMCI) Write Protection Status Register */ - #define REG_HSMCI_FIFO (0x40000200U) /**< \brief (HSMCI) FIFO Memory Aperture0 */ -#else - #define REG_HSMCI_CR (*(__O uint32_t*)0x40000000U) /**< \brief (HSMCI) Control Register */ - #define REG_HSMCI_MR (*(__IO uint32_t*)0x40000004U) /**< \brief (HSMCI) Mode Register */ - #define REG_HSMCI_DTOR (*(__IO uint32_t*)0x40000008U) /**< \brief (HSMCI) Data Timeout Register */ - #define REG_HSMCI_SDCR (*(__IO uint32_t*)0x4000000CU) /**< \brief (HSMCI) SD/SDIO Card Register */ - #define REG_HSMCI_ARGR (*(__IO uint32_t*)0x40000010U) /**< \brief (HSMCI) Argument Register */ - #define REG_HSMCI_CMDR (*(__O uint32_t*)0x40000014U) /**< \brief (HSMCI) Command Register */ - #define REG_HSMCI_BLKR (*(__IO uint32_t*)0x40000018U) /**< \brief (HSMCI) Block Register */ - #define REG_HSMCI_CSTOR (*(__IO uint32_t*)0x4000001CU) /**< \brief (HSMCI) Completion Signal Timeout Register */ - #define REG_HSMCI_RSPR (*(__I uint32_t*)0x40000020U) /**< \brief (HSMCI) Response Register */ - #define REG_HSMCI_RDR (*(__I uint32_t*)0x40000030U) /**< \brief (HSMCI) Receive Data Register */ - #define REG_HSMCI_TDR (*(__O uint32_t*)0x40000034U) /**< \brief (HSMCI) Transmit Data Register */ - #define REG_HSMCI_SR (*(__I uint32_t*)0x40000040U) /**< \brief (HSMCI) Status Register */ - #define REG_HSMCI_IER (*(__O uint32_t*)0x40000044U) /**< \brief (HSMCI) Interrupt Enable Register */ - #define REG_HSMCI_IDR (*(__O uint32_t*)0x40000048U) /**< \brief (HSMCI) Interrupt Disable Register */ - #define REG_HSMCI_IMR (*(__I uint32_t*)0x4000004CU) /**< \brief (HSMCI) Interrupt Mask Register */ - #define REG_HSMCI_DMA (*(__IO uint32_t*)0x40000050U) /**< \brief (HSMCI) DMA Configuration Register */ - #define REG_HSMCI_CFG (*(__IO uint32_t*)0x40000054U) /**< \brief (HSMCI) Configuration Register */ - #define REG_HSMCI_WPMR (*(__IO uint32_t*)0x400000E4U) /**< \brief (HSMCI) Write Protection Mode Register */ - #define REG_HSMCI_WPSR (*(__I uint32_t*)0x400000E8U) /**< \brief (HSMCI) Write Protection Status Register */ - #define REG_HSMCI_FIFO (*(__IO uint32_t*)0x40000200U) /**< \brief (HSMCI) FIFO Memory Aperture0 */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_HSMCI_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_icm.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_icm.h deleted file mode 100644 index c5ea9bdb..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_icm.h +++ /dev/null @@ -1,60 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_ICM_INSTANCE_ -#define _SAMV71_ICM_INSTANCE_ - -/* ========== Register definition for ICM peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_ICM_CFG (0x40048000U) /**< \brief (ICM) Configuration Register */ - #define REG_ICM_CTRL (0x40048004U) /**< \brief (ICM) Control Register */ - #define REG_ICM_SR (0x40048008U) /**< \brief (ICM) Status Register */ - #define REG_ICM_IER (0x40048010U) /**< \brief (ICM) Interrupt Enable Register */ - #define REG_ICM_IDR (0x40048014U) /**< \brief (ICM) Interrupt Disable Register */ - #define REG_ICM_IMR (0x40048018U) /**< \brief (ICM) Interrupt Mask Register */ - #define REG_ICM_ISR (0x4004801CU) /**< \brief (ICM) Interrupt Status Register */ - #define REG_ICM_UASR (0x40048020U) /**< \brief (ICM) Undefined Access Status Register */ - #define REG_ICM_DSCR (0x40048030U) /**< \brief (ICM) Region Descriptor Area Start Address Register */ - #define REG_ICM_HASH (0x40048034U) /**< \brief (ICM) Region Hash Area Start Address Register */ - #define REG_ICM_UIHVAL (0x40048038U) /**< \brief (ICM) User Initial Hash Value 0 Register */ -#else - #define REG_ICM_CFG (*(__IO uint32_t*)0x40048000U) /**< \brief (ICM) Configuration Register */ - #define REG_ICM_CTRL (*(__O uint32_t*)0x40048004U) /**< \brief (ICM) Control Register */ - #define REG_ICM_SR (*(__O uint32_t*)0x40048008U) /**< \brief (ICM) Status Register */ - #define REG_ICM_IER (*(__O uint32_t*)0x40048010U) /**< \brief (ICM) Interrupt Enable Register */ - #define REG_ICM_IDR (*(__O uint32_t*)0x40048014U) /**< \brief (ICM) Interrupt Disable Register */ - #define REG_ICM_IMR (*(__I uint32_t*)0x40048018U) /**< \brief (ICM) Interrupt Mask Register */ - #define REG_ICM_ISR (*(__I uint32_t*)0x4004801CU) /**< \brief (ICM) Interrupt Status Register */ - #define REG_ICM_UASR (*(__I uint32_t*)0x40048020U) /**< \brief (ICM) Undefined Access Status Register */ - #define REG_ICM_DSCR (*(__IO uint32_t*)0x40048030U) /**< \brief (ICM) Region Descriptor Area Start Address Register */ - #define REG_ICM_HASH (*(__IO uint32_t*)0x40048034U) /**< \brief (ICM) Region Hash Area Start Address Register */ - #define REG_ICM_UIHVAL (*(__O uint32_t*)0x40048038U) /**< \brief (ICM) User Initial Hash Value 0 Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_ICM_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_isi.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_isi.h deleted file mode 100644 index 10f75b0d..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_isi.h +++ /dev/null @@ -1,88 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_ISI_INSTANCE_ -#define _SAMV71_ISI_INSTANCE_ - -/* ========== Register definition for ISI peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_ISI_CFG1 (0x4004C000U) /**< \brief (ISI) ISI Configuration 1 Register */ - #define REG_ISI_CFG2 (0x4004C004U) /**< \brief (ISI) ISI Configuration 2 Register */ - #define REG_ISI_PSIZE (0x4004C008U) /**< \brief (ISI) ISI Preview Size Register */ - #define REG_ISI_PDECF (0x4004C00CU) /**< \brief (ISI) ISI Preview Decimation Factor Register */ - #define REG_ISI_Y2R_SET0 (0x4004C010U) /**< \brief (ISI) ISI Color Space Conversion YCrCb To RGB Set 0 Register */ - #define REG_ISI_Y2R_SET1 (0x4004C014U) /**< \brief (ISI) ISI Color Space Conversion YCrCb To RGB Set 1 Register */ - #define REG_ISI_R2Y_SET0 (0x4004C018U) /**< \brief (ISI) ISI Color Space Conversion RGB To YCrCb Set 0 Register */ - #define REG_ISI_R2Y_SET1 (0x4004C01CU) /**< \brief (ISI) ISI Color Space Conversion RGB To YCrCb Set 1 Register */ - #define REG_ISI_R2Y_SET2 (0x4004C020U) /**< \brief (ISI) ISI Color Space Conversion RGB To YCrCb Set 2 Register */ - #define REG_ISI_CR (0x4004C024U) /**< \brief (ISI) ISI Control Register */ - #define REG_ISI_SR (0x4004C028U) /**< \brief (ISI) ISI Status Register */ - #define REG_ISI_IER (0x4004C02CU) /**< \brief (ISI) ISI Interrupt Enable Register */ - #define REG_ISI_IDR (0x4004C030U) /**< \brief (ISI) ISI Interrupt Disable Register */ - #define REG_ISI_IMR (0x4004C034U) /**< \brief (ISI) ISI Interrupt Mask Register */ - #define REG_ISI_DMA_CHER (0x4004C038U) /**< \brief (ISI) DMA Channel Enable Register */ - #define REG_ISI_DMA_CHDR (0x4004C03CU) /**< \brief (ISI) DMA Channel Disable Register */ - #define REG_ISI_DMA_CHSR (0x4004C040U) /**< \brief (ISI) DMA Channel Status Register */ - #define REG_ISI_DMA_P_ADDR (0x4004C044U) /**< \brief (ISI) DMA Preview Base Address Register */ - #define REG_ISI_DMA_P_CTRL (0x4004C048U) /**< \brief (ISI) DMA Preview Control Register */ - #define REG_ISI_DMA_P_DSCR (0x4004C04CU) /**< \brief (ISI) DMA Preview Descriptor Address Register */ - #define REG_ISI_DMA_C_ADDR (0x4004C050U) /**< \brief (ISI) DMA Codec Base Address Register */ - #define REG_ISI_DMA_C_CTRL (0x4004C054U) /**< \brief (ISI) DMA Codec Control Register */ - #define REG_ISI_DMA_C_DSCR (0x4004C058U) /**< \brief (ISI) DMA Codec Descriptor Address Register */ - #define REG_ISI_WPMR (0x4004C0E4U) /**< \brief (ISI) Write Protection Mode Register */ - #define REG_ISI_WPSR (0x4004C0E8U) /**< \brief (ISI) Write Protection Status Register */ -#else - #define REG_ISI_CFG1 (*(__IO uint32_t*)0x4004C000U) /**< \brief (ISI) ISI Configuration 1 Register */ - #define REG_ISI_CFG2 (*(__IO uint32_t*)0x4004C004U) /**< \brief (ISI) ISI Configuration 2 Register */ - #define REG_ISI_PSIZE (*(__IO uint32_t*)0x4004C008U) /**< \brief (ISI) ISI Preview Size Register */ - #define REG_ISI_PDECF (*(__IO uint32_t*)0x4004C00CU) /**< \brief (ISI) ISI Preview Decimation Factor Register */ - #define REG_ISI_Y2R_SET0 (*(__IO uint32_t*)0x4004C010U) /**< \brief (ISI) ISI Color Space Conversion YCrCb To RGB Set 0 Register */ - #define REG_ISI_Y2R_SET1 (*(__IO uint32_t*)0x4004C014U) /**< \brief (ISI) ISI Color Space Conversion YCrCb To RGB Set 1 Register */ - #define REG_ISI_R2Y_SET0 (*(__IO uint32_t*)0x4004C018U) /**< \brief (ISI) ISI Color Space Conversion RGB To YCrCb Set 0 Register */ - #define REG_ISI_R2Y_SET1 (*(__IO uint32_t*)0x4004C01CU) /**< \brief (ISI) ISI Color Space Conversion RGB To YCrCb Set 1 Register */ - #define REG_ISI_R2Y_SET2 (*(__IO uint32_t*)0x4004C020U) /**< \brief (ISI) ISI Color Space Conversion RGB To YCrCb Set 2 Register */ - #define REG_ISI_CR (*(__O uint32_t*)0x4004C024U) /**< \brief (ISI) ISI Control Register */ - #define REG_ISI_SR (*(__I uint32_t*)0x4004C028U) /**< \brief (ISI) ISI Status Register */ - #define REG_ISI_IER (*(__O uint32_t*)0x4004C02CU) /**< \brief (ISI) ISI Interrupt Enable Register */ - #define REG_ISI_IDR (*(__O uint32_t*)0x4004C030U) /**< \brief (ISI) ISI Interrupt Disable Register */ - #define REG_ISI_IMR (*(__I uint32_t*)0x4004C034U) /**< \brief (ISI) ISI Interrupt Mask Register */ - #define REG_ISI_DMA_CHER (*(__O uint32_t*)0x4004C038U) /**< \brief (ISI) DMA Channel Enable Register */ - #define REG_ISI_DMA_CHDR (*(__O uint32_t*)0x4004C03CU) /**< \brief (ISI) DMA Channel Disable Register */ - #define REG_ISI_DMA_CHSR (*(__I uint32_t*)0x4004C040U) /**< \brief (ISI) DMA Channel Status Register */ - #define REG_ISI_DMA_P_ADDR (*(__IO uint32_t*)0x4004C044U) /**< \brief (ISI) DMA Preview Base Address Register */ - #define REG_ISI_DMA_P_CTRL (*(__IO uint32_t*)0x4004C048U) /**< \brief (ISI) DMA Preview Control Register */ - #define REG_ISI_DMA_P_DSCR (*(__IO uint32_t*)0x4004C04CU) /**< \brief (ISI) DMA Preview Descriptor Address Register */ - #define REG_ISI_DMA_C_ADDR (*(__IO uint32_t*)0x4004C050U) /**< \brief (ISI) DMA Codec Base Address Register */ - #define REG_ISI_DMA_C_CTRL (*(__IO uint32_t*)0x4004C054U) /**< \brief (ISI) DMA Codec Control Register */ - #define REG_ISI_DMA_C_DSCR (*(__IO uint32_t*)0x4004C058U) /**< \brief (ISI) DMA Codec Descriptor Address Register */ - #define REG_ISI_WPMR (*(__IO uint32_t*)0x4004C0E4U) /**< \brief (ISI) Write Protection Mode Register */ - #define REG_ISI_WPSR (*(__I uint32_t*)0x4004C0E8U) /**< \brief (ISI) Write Protection Status Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_ISI_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_matrix.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_matrix.h deleted file mode 100644 index 5e35df82..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_matrix.h +++ /dev/null @@ -1,90 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_MATRIX_INSTANCE_ -#define _SAMV71_MATRIX_INSTANCE_ - -/* ========== Register definition for MATRIX peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_MATRIX_MCFG (0x40088000U) /**< \brief (MATRIX) Master Configuration Register */ - #define REG_MATRIX_SCFG (0x40088040U) /**< \brief (MATRIX) Slave Configuration Register */ - #define REG_MATRIX_PRAS0 (0x40088080U) /**< \brief (MATRIX) Priority Register A for Slave 0 */ - #define REG_MATRIX_PRBS0 (0x40088084U) /**< \brief (MATRIX) Priority Register B for Slave 0 */ - #define REG_MATRIX_PRAS1 (0x40088088U) /**< \brief (MATRIX) Priority Register A for Slave 1 */ - #define REG_MATRIX_PRBS1 (0x4008808CU) /**< \brief (MATRIX) Priority Register B for Slave 1 */ - #define REG_MATRIX_PRAS2 (0x40088090U) /**< \brief (MATRIX) Priority Register A for Slave 2 */ - #define REG_MATRIX_PRBS2 (0x40088094U) /**< \brief (MATRIX) Priority Register B for Slave 2 */ - #define REG_MATRIX_PRAS3 (0x40088098U) /**< \brief (MATRIX) Priority Register A for Slave 3 */ - #define REG_MATRIX_PRBS3 (0x4008809CU) /**< \brief (MATRIX) Priority Register B for Slave 3 */ - #define REG_MATRIX_PRAS4 (0x400880A0U) /**< \brief (MATRIX) Priority Register A for Slave 4 */ - #define REG_MATRIX_PRBS4 (0x400880A4U) /**< \brief (MATRIX) Priority Register B for Slave 4 */ - #define REG_MATRIX_PRAS5 (0x400880A8U) /**< \brief (MATRIX) Priority Register A for Slave 5 */ - #define REG_MATRIX_PRBS5 (0x400880ACU) /**< \brief (MATRIX) Priority Register B for Slave 5 */ - #define REG_MATRIX_PRAS6 (0x400880B0U) /**< \brief (MATRIX) Priority Register A for Slave 6 */ - #define REG_MATRIX_PRBS6 (0x400880B4U) /**< \brief (MATRIX) Priority Register B for Slave 6 */ - #define REG_MATRIX_PRAS7 (0x400880B8U) /**< \brief (MATRIX) Priority Register A for Slave 7 */ - #define REG_MATRIX_PRBS7 (0x400880BCU) /**< \brief (MATRIX) Priority Register B for Slave 7 */ - #define REG_MATRIX_PRAS8 (0x400880C0U) /**< \brief (MATRIX) Priority Register A for Slave 8 */ - #define REG_MATRIX_PRBS8 (0x400880C4U) /**< \brief (MATRIX) Priority Register B for Slave 8 */ - #define REG_MATRIX_MRCR (0x40088100U) /**< \brief (MATRIX) Master Remap Control Register */ - #define REG_CCFG_CAN0 (0x40088110U) /**< \brief (MATRIX) CAN0 Configuration Register */ - #define REG_CCFG_SYSIO (0x40088114U) /**< \brief (MATRIX) System I/O and CAN1 Configuration Register */ - #define REG_CCFG_SMCNFCS (0x40088124U) /**< \brief (MATRIX) SMC NAND Flash Chip Select Configuration Register */ - #define REG_MATRIX_WPMR (0x400881E4U) /**< \brief (MATRIX) Write Protection Mode Register */ - #define REG_MATRIX_WPSR (0x400881E8U) /**< \brief (MATRIX) Write Protection Status Register */ -#else - #define REG_MATRIX_MCFG (*(__IO uint32_t*)0x40088000U) /**< \brief (MATRIX) Master Configuration Register */ - #define REG_MATRIX_SCFG (*(__IO uint32_t*)0x40088040U) /**< \brief (MATRIX) Slave Configuration Register */ - #define REG_MATRIX_PRAS0 (*(__IO uint32_t*)0x40088080U) /**< \brief (MATRIX) Priority Register A for Slave 0 */ - #define REG_MATRIX_PRBS0 (*(__IO uint32_t*)0x40088084U) /**< \brief (MATRIX) Priority Register B for Slave 0 */ - #define REG_MATRIX_PRAS1 (*(__IO uint32_t*)0x40088088U) /**< \brief (MATRIX) Priority Register A for Slave 1 */ - #define REG_MATRIX_PRBS1 (*(__IO uint32_t*)0x4008808CU) /**< \brief (MATRIX) Priority Register B for Slave 1 */ - #define REG_MATRIX_PRAS2 (*(__IO uint32_t*)0x40088090U) /**< \brief (MATRIX) Priority Register A for Slave 2 */ - #define REG_MATRIX_PRBS2 (*(__IO uint32_t*)0x40088094U) /**< \brief (MATRIX) Priority Register B for Slave 2 */ - #define REG_MATRIX_PRAS3 (*(__IO uint32_t*)0x40088098U) /**< \brief (MATRIX) Priority Register A for Slave 3 */ - #define REG_MATRIX_PRBS3 (*(__IO uint32_t*)0x4008809CU) /**< \brief (MATRIX) Priority Register B for Slave 3 */ - #define REG_MATRIX_PRAS4 (*(__IO uint32_t*)0x400880A0U) /**< \brief (MATRIX) Priority Register A for Slave 4 */ - #define REG_MATRIX_PRBS4 (*(__IO uint32_t*)0x400880A4U) /**< \brief (MATRIX) Priority Register B for Slave 4 */ - #define REG_MATRIX_PRAS5 (*(__IO uint32_t*)0x400880A8U) /**< \brief (MATRIX) Priority Register A for Slave 5 */ - #define REG_MATRIX_PRBS5 (*(__IO uint32_t*)0x400880ACU) /**< \brief (MATRIX) Priority Register B for Slave 5 */ - #define REG_MATRIX_PRAS6 (*(__IO uint32_t*)0x400880B0U) /**< \brief (MATRIX) Priority Register A for Slave 6 */ - #define REG_MATRIX_PRBS6 (*(__IO uint32_t*)0x400880B4U) /**< \brief (MATRIX) Priority Register B for Slave 6 */ - #define REG_MATRIX_PRAS7 (*(__IO uint32_t*)0x400880B8U) /**< \brief (MATRIX) Priority Register A for Slave 7 */ - #define REG_MATRIX_PRBS7 (*(__IO uint32_t*)0x400880BCU) /**< \brief (MATRIX) Priority Register B for Slave 7 */ - #define REG_MATRIX_PRAS8 (*(__IO uint32_t*)0x400880C0U) /**< \brief (MATRIX) Priority Register A for Slave 8 */ - #define REG_MATRIX_PRBS8 (*(__IO uint32_t*)0x400880C4U) /**< \brief (MATRIX) Priority Register B for Slave 8 */ - #define REG_MATRIX_MRCR (*(__IO uint32_t*)0x40088100U) /**< \brief (MATRIX) Master Remap Control Register */ - #define REG_CCFG_CAN0 (*(__IO uint32_t*)0x40088110U) /**< \brief (MATRIX) CAN0 Configuration Register */ - #define REG_CCFG_SYSIO (*(__IO uint32_t*)0x40088114U) /**< \brief (MATRIX) System I/O and CAN1 Configuration Register */ - #define REG_CCFG_SMCNFCS (*(__IO uint32_t*)0x40088124U) /**< \brief (MATRIX) SMC NAND Flash Chip Select Configuration Register */ - #define REG_MATRIX_WPMR (*(__IO uint32_t*)0x400881E4U) /**< \brief (MATRIX) Write Protection Mode Register */ - #define REG_MATRIX_WPSR (*(__I uint32_t*)0x400881E8U) /**< \brief (MATRIX) Write Protection Status Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_MATRIX_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_mcan0.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_mcan0.h deleted file mode 100644 index 480ee3ab..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_mcan0.h +++ /dev/null @@ -1,126 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_MCAN0_INSTANCE_ -#define _SAMV71_MCAN0_INSTANCE_ - -/* ========== Register definition for MCAN0 peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_MCAN0_CUST (0x40030008U) /**< \brief (MCAN0) Customer Register */ - #define REG_MCAN0_FBTP (0x4003000CU) /**< \brief (MCAN0) Fast Bit Timing and Prescaler Register */ - #define REG_MCAN0_TEST (0x40030010U) /**< \brief (MCAN0) Test Register */ - #define REG_MCAN0_RWD (0x40030014U) /**< \brief (MCAN0) RAM Watchdog Register */ - #define REG_MCAN0_CCCR (0x40030018U) /**< \brief (MCAN0) CC Control Register */ - #define REG_MCAN0_BTP (0x4003001CU) /**< \brief (MCAN0) Bit Timing and Prescaler Register */ - #define REG_MCAN0_TSCC (0x40030020U) /**< \brief (MCAN0) Timestamp Counter Configuration Register */ - #define REG_MCAN0_TSCV (0x40030024U) /**< \brief (MCAN0) Timestamp Counter Value Register */ - #define REG_MCAN0_TOCC (0x40030028U) /**< \brief (MCAN0) Timeout Counter Configuration Register */ - #define REG_MCAN0_TOCV (0x4003002CU) /**< \brief (MCAN0) Timeout Counter Value Register */ - #define REG_MCAN0_ECR (0x40030040U) /**< \brief (MCAN0) Error Counter Register */ - #define REG_MCAN0_PSR (0x40030044U) /**< \brief (MCAN0) Protocol Status Register */ - #define REG_MCAN0_IR (0x40030050U) /**< \brief (MCAN0) Interrupt Register */ - #define REG_MCAN0_IE (0x40030054U) /**< \brief (MCAN0) Interrupt Enable Register */ - #define REG_MCAN0_ILS (0x40030058U) /**< \brief (MCAN0) Interrupt Line Select Register */ - #define REG_MCAN0_ILE (0x4003005CU) /**< \brief (MCAN0) Interrupt Line Enable Register */ - #define REG_MCAN0_GFC (0x40030080U) /**< \brief (MCAN0) Global Filter Configuration Register */ - #define REG_MCAN0_SIDFC (0x40030084U) /**< \brief (MCAN0) Standard ID Filter Configuration Register */ - #define REG_MCAN0_XIDFC (0x40030088U) /**< \brief (MCAN0) Extended ID Filter Configuration Register */ - #define REG_MCAN0_XIDAM (0x40030090U) /**< \brief (MCAN0) Extended ID AND Mask Register */ - #define REG_MCAN0_HPMS (0x40030094U) /**< \brief (MCAN0) High Priority Message Status Register */ - #define REG_MCAN0_NDAT1 (0x40030098U) /**< \brief (MCAN0) New Data 1 Register */ - #define REG_MCAN0_NDAT2 (0x4003009CU) /**< \brief (MCAN0) New Data 2 Register */ - #define REG_MCAN0_RXF0C (0x400300A0U) /**< \brief (MCAN0) Receive FIFO 0 Configuration Register */ - #define REG_MCAN0_RXF0S (0x400300A4U) /**< \brief (MCAN0) Receive FIFO 0 Status Register */ - #define REG_MCAN0_RXF0A (0x400300A8U) /**< \brief (MCAN0) Receive FIFO 0 Acknowledge Register */ - #define REG_MCAN0_RXBC (0x400300ACU) /**< \brief (MCAN0) Receive Rx Buffer Configuration Register */ - #define REG_MCAN0_RXF1C (0x400300B0U) /**< \brief (MCAN0) Receive FIFO 1 Configuration Register */ - #define REG_MCAN0_RXF1S (0x400300B4U) /**< \brief (MCAN0) Receive FIFO 1 Status Register */ - #define REG_MCAN0_RXF1A (0x400300B8U) /**< \brief (MCAN0) Receive FIFO 1 Acknowledge Register */ - #define REG_MCAN0_RXESC (0x400300BCU) /**< \brief (MCAN0) Receive Buffer / FIFO Element Size Configuration Register */ - #define REG_MCAN0_TXBC (0x400300C0U) /**< \brief (MCAN0) Transmit Buffer Configuration Register */ - #define REG_MCAN0_TXFQS (0x400300C4U) /**< \brief (MCAN0) Transmit FIFO/Queue Status Register */ - #define REG_MCAN0_TXESC (0x400300C8U) /**< \brief (MCAN0) Transmit Buffer Element Size Configuration Register */ - #define REG_MCAN0_TXBRP (0x400300CCU) /**< \brief (MCAN0) Transmit Buffer Request Pending Register */ - #define REG_MCAN0_TXBAR (0x400300D0U) /**< \brief (MCAN0) Transmit Buffer Add Request Register */ - #define REG_MCAN0_TXBCR (0x400300D4U) /**< \brief (MCAN0) Transmit Buffer Cancellation Request Register */ - #define REG_MCAN0_TXBTO (0x400300D8U) /**< \brief (MCAN0) Transmit Buffer Transmission Occurred Register */ - #define REG_MCAN0_TXBCF (0x400300DCU) /**< \brief (MCAN0) Transmit Buffer Cancellation Finished Register */ - #define REG_MCAN0_TXBTIE (0x400300E0U) /**< \brief (MCAN0) Transmit Buffer Transmission Interrupt Enable Register */ - #define REG_MCAN0_TXBCIE (0x400300E4U) /**< \brief (MCAN0) Transmit Buffer Cancellation Finished Interrupt Enable Register */ - #define REG_MCAN0_TXEFC (0x400300F0U) /**< \brief (MCAN0) Transmit Event FIFO Configuration Register */ - #define REG_MCAN0_TXEFS (0x400300F4U) /**< \brief (MCAN0) Transmit Event FIFO Status Register */ - #define REG_MCAN0_TXEFA (0x400300F8U) /**< \brief (MCAN0) Transmit Event FIFO Acknowledge Register */ -#else - #define REG_MCAN0_CUST (*(__IO uint32_t*)0x40030008U) /**< \brief (MCAN0) Customer Register */ - #define REG_MCAN0_FBTP (*(__IO uint32_t*)0x4003000CU) /**< \brief (MCAN0) Fast Bit Timing and Prescaler Register */ - #define REG_MCAN0_TEST (*(__IO uint32_t*)0x40030010U) /**< \brief (MCAN0) Test Register */ - #define REG_MCAN0_RWD (*(__IO uint32_t*)0x40030014U) /**< \brief (MCAN0) RAM Watchdog Register */ - #define REG_MCAN0_CCCR (*(__IO uint32_t*)0x40030018U) /**< \brief (MCAN0) CC Control Register */ - #define REG_MCAN0_BTP (*(__IO uint32_t*)0x4003001CU) /**< \brief (MCAN0) Bit Timing and Prescaler Register */ - #define REG_MCAN0_TSCC (*(__IO uint32_t*)0x40030020U) /**< \brief (MCAN0) Timestamp Counter Configuration Register */ - #define REG_MCAN0_TSCV (*(__IO uint32_t*)0x40030024U) /**< \brief (MCAN0) Timestamp Counter Value Register */ - #define REG_MCAN0_TOCC (*(__IO uint32_t*)0x40030028U) /**< \brief (MCAN0) Timeout Counter Configuration Register */ - #define REG_MCAN0_TOCV (*(__IO uint32_t*)0x4003002CU) /**< \brief (MCAN0) Timeout Counter Value Register */ - #define REG_MCAN0_ECR (*(__I uint32_t*)0x40030040U) /**< \brief (MCAN0) Error Counter Register */ - #define REG_MCAN0_PSR (*(__I uint32_t*)0x40030044U) /**< \brief (MCAN0) Protocol Status Register */ - #define REG_MCAN0_IR (*(__IO uint32_t*)0x40030050U) /**< \brief (MCAN0) Interrupt Register */ - #define REG_MCAN0_IE (*(__IO uint32_t*)0x40030054U) /**< \brief (MCAN0) Interrupt Enable Register */ - #define REG_MCAN0_ILS (*(__IO uint32_t*)0x40030058U) /**< \brief (MCAN0) Interrupt Line Select Register */ - #define REG_MCAN0_ILE (*(__IO uint32_t*)0x4003005CU) /**< \brief (MCAN0) Interrupt Line Enable Register */ - #define REG_MCAN0_GFC (*(__IO uint32_t*)0x40030080U) /**< \brief (MCAN0) Global Filter Configuration Register */ - #define REG_MCAN0_SIDFC (*(__IO uint32_t*)0x40030084U) /**< \brief (MCAN0) Standard ID Filter Configuration Register */ - #define REG_MCAN0_XIDFC (*(__IO uint32_t*)0x40030088U) /**< \brief (MCAN0) Extended ID Filter Configuration Register */ - #define REG_MCAN0_XIDAM (*(__IO uint32_t*)0x40030090U) /**< \brief (MCAN0) Extended ID AND Mask Register */ - #define REG_MCAN0_HPMS (*(__I uint32_t*)0x40030094U) /**< \brief (MCAN0) High Priority Message Status Register */ - #define REG_MCAN0_NDAT1 (*(__IO uint32_t*)0x40030098U) /**< \brief (MCAN0) New Data 1 Register */ - #define REG_MCAN0_NDAT2 (*(__IO uint32_t*)0x4003009CU) /**< \brief (MCAN0) New Data 2 Register */ - #define REG_MCAN0_RXF0C (*(__IO uint32_t*)0x400300A0U) /**< \brief (MCAN0) Receive FIFO 0 Configuration Register */ - #define REG_MCAN0_RXF0S (*(__I uint32_t*)0x400300A4U) /**< \brief (MCAN0) Receive FIFO 0 Status Register */ - #define REG_MCAN0_RXF0A (*(__IO uint32_t*)0x400300A8U) /**< \brief (MCAN0) Receive FIFO 0 Acknowledge Register */ - #define REG_MCAN0_RXBC (*(__IO uint32_t*)0x400300ACU) /**< \brief (MCAN0) Receive Rx Buffer Configuration Register */ - #define REG_MCAN0_RXF1C (*(__IO uint32_t*)0x400300B0U) /**< \brief (MCAN0) Receive FIFO 1 Configuration Register */ - #define REG_MCAN0_RXF1S (*(__I uint32_t*)0x400300B4U) /**< \brief (MCAN0) Receive FIFO 1 Status Register */ - #define REG_MCAN0_RXF1A (*(__IO uint32_t*)0x400300B8U) /**< \brief (MCAN0) Receive FIFO 1 Acknowledge Register */ - #define REG_MCAN0_RXESC (*(__IO uint32_t*)0x400300BCU) /**< \brief (MCAN0) Receive Buffer / FIFO Element Size Configuration Register */ - #define REG_MCAN0_TXBC (*(__IO uint32_t*)0x400300C0U) /**< \brief (MCAN0) Transmit Buffer Configuration Register */ - #define REG_MCAN0_TXFQS (*(__I uint32_t*)0x400300C4U) /**< \brief (MCAN0) Transmit FIFO/Queue Status Register */ - #define REG_MCAN0_TXESC (*(__IO uint32_t*)0x400300C8U) /**< \brief (MCAN0) Transmit Buffer Element Size Configuration Register */ - #define REG_MCAN0_TXBRP (*(__I uint32_t*)0x400300CCU) /**< \brief (MCAN0) Transmit Buffer Request Pending Register */ - #define REG_MCAN0_TXBAR (*(__IO uint32_t*)0x400300D0U) /**< \brief (MCAN0) Transmit Buffer Add Request Register */ - #define REG_MCAN0_TXBCR (*(__IO uint32_t*)0x400300D4U) /**< \brief (MCAN0) Transmit Buffer Cancellation Request Register */ - #define REG_MCAN0_TXBTO (*(__I uint32_t*)0x400300D8U) /**< \brief (MCAN0) Transmit Buffer Transmission Occurred Register */ - #define REG_MCAN0_TXBCF (*(__I uint32_t*)0x400300DCU) /**< \brief (MCAN0) Transmit Buffer Cancellation Finished Register */ - #define REG_MCAN0_TXBTIE (*(__IO uint32_t*)0x400300E0U) /**< \brief (MCAN0) Transmit Buffer Transmission Interrupt Enable Register */ - #define REG_MCAN0_TXBCIE (*(__IO uint32_t*)0x400300E4U) /**< \brief (MCAN0) Transmit Buffer Cancellation Finished Interrupt Enable Register */ - #define REG_MCAN0_TXEFC (*(__IO uint32_t*)0x400300F0U) /**< \brief (MCAN0) Transmit Event FIFO Configuration Register */ - #define REG_MCAN0_TXEFS (*(__I uint32_t*)0x400300F4U) /**< \brief (MCAN0) Transmit Event FIFO Status Register */ - #define REG_MCAN0_TXEFA (*(__IO uint32_t*)0x400300F8U) /**< \brief (MCAN0) Transmit Event FIFO Acknowledge Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_MCAN0_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_mcan1.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_mcan1.h deleted file mode 100644 index 6cac21c2..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_mcan1.h +++ /dev/null @@ -1,126 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_MCAN1_INSTANCE_ -#define _SAMV71_MCAN1_INSTANCE_ - -/* ========== Register definition for MCAN1 peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_MCAN1_CUST (0x40034008U) /**< \brief (MCAN1) Customer Register */ - #define REG_MCAN1_FBTP (0x4003400CU) /**< \brief (MCAN1) Fast Bit Timing and Prescaler Register */ - #define REG_MCAN1_TEST (0x40034010U) /**< \brief (MCAN1) Test Register */ - #define REG_MCAN1_RWD (0x40034014U) /**< \brief (MCAN1) RAM Watchdog Register */ - #define REG_MCAN1_CCCR (0x40034018U) /**< \brief (MCAN1) CC Control Register */ - #define REG_MCAN1_BTP (0x4003401CU) /**< \brief (MCAN1) Bit Timing and Prescaler Register */ - #define REG_MCAN1_TSCC (0x40034020U) /**< \brief (MCAN1) Timestamp Counter Configuration Register */ - #define REG_MCAN1_TSCV (0x40034024U) /**< \brief (MCAN1) Timestamp Counter Value Register */ - #define REG_MCAN1_TOCC (0x40034028U) /**< \brief (MCAN1) Timeout Counter Configuration Register */ - #define REG_MCAN1_TOCV (0x4003402CU) /**< \brief (MCAN1) Timeout Counter Value Register */ - #define REG_MCAN1_ECR (0x40034040U) /**< \brief (MCAN1) Error Counter Register */ - #define REG_MCAN1_PSR (0x40034044U) /**< \brief (MCAN1) Protocol Status Register */ - #define REG_MCAN1_IR (0x40034050U) /**< \brief (MCAN1) Interrupt Register */ - #define REG_MCAN1_IE (0x40034054U) /**< \brief (MCAN1) Interrupt Enable Register */ - #define REG_MCAN1_ILS (0x40034058U) /**< \brief (MCAN1) Interrupt Line Select Register */ - #define REG_MCAN1_ILE (0x4003405CU) /**< \brief (MCAN1) Interrupt Line Enable Register */ - #define REG_MCAN1_GFC (0x40034080U) /**< \brief (MCAN1) Global Filter Configuration Register */ - #define REG_MCAN1_SIDFC (0x40034084U) /**< \brief (MCAN1) Standard ID Filter Configuration Register */ - #define REG_MCAN1_XIDFC (0x40034088U) /**< \brief (MCAN1) Extended ID Filter Configuration Register */ - #define REG_MCAN1_XIDAM (0x40034090U) /**< \brief (MCAN1) Extended ID AND Mask Register */ - #define REG_MCAN1_HPMS (0x40034094U) /**< \brief (MCAN1) High Priority Message Status Register */ - #define REG_MCAN1_NDAT1 (0x40034098U) /**< \brief (MCAN1) New Data 1 Register */ - #define REG_MCAN1_NDAT2 (0x4003409CU) /**< \brief (MCAN1) New Data 2 Register */ - #define REG_MCAN1_RXF0C (0x400340A0U) /**< \brief (MCAN1) Receive FIFO 0 Configuration Register */ - #define REG_MCAN1_RXF0S (0x400340A4U) /**< \brief (MCAN1) Receive FIFO 0 Status Register */ - #define REG_MCAN1_RXF0A (0x400340A8U) /**< \brief (MCAN1) Receive FIFO 0 Acknowledge Register */ - #define REG_MCAN1_RXBC (0x400340ACU) /**< \brief (MCAN1) Receive Rx Buffer Configuration Register */ - #define REG_MCAN1_RXF1C (0x400340B0U) /**< \brief (MCAN1) Receive FIFO 1 Configuration Register */ - #define REG_MCAN1_RXF1S (0x400340B4U) /**< \brief (MCAN1) Receive FIFO 1 Status Register */ - #define REG_MCAN1_RXF1A (0x400340B8U) /**< \brief (MCAN1) Receive FIFO 1 Acknowledge Register */ - #define REG_MCAN1_RXESC (0x400340BCU) /**< \brief (MCAN1) Receive Buffer / FIFO Element Size Configuration Register */ - #define REG_MCAN1_TXBC (0x400340C0U) /**< \brief (MCAN1) Transmit Buffer Configuration Register */ - #define REG_MCAN1_TXFQS (0x400340C4U) /**< \brief (MCAN1) Transmit FIFO/Queue Status Register */ - #define REG_MCAN1_TXESC (0x400340C8U) /**< \brief (MCAN1) Transmit Buffer Element Size Configuration Register */ - #define REG_MCAN1_TXBRP (0x400340CCU) /**< \brief (MCAN1) Transmit Buffer Request Pending Register */ - #define REG_MCAN1_TXBAR (0x400340D0U) /**< \brief (MCAN1) Transmit Buffer Add Request Register */ - #define REG_MCAN1_TXBCR (0x400340D4U) /**< \brief (MCAN1) Transmit Buffer Cancellation Request Register */ - #define REG_MCAN1_TXBTO (0x400340D8U) /**< \brief (MCAN1) Transmit Buffer Transmission Occurred Register */ - #define REG_MCAN1_TXBCF (0x400340DCU) /**< \brief (MCAN1) Transmit Buffer Cancellation Finished Register */ - #define REG_MCAN1_TXBTIE (0x400340E0U) /**< \brief (MCAN1) Transmit Buffer Transmission Interrupt Enable Register */ - #define REG_MCAN1_TXBCIE (0x400340E4U) /**< \brief (MCAN1) Transmit Buffer Cancellation Finished Interrupt Enable Register */ - #define REG_MCAN1_TXEFC (0x400340F0U) /**< \brief (MCAN1) Transmit Event FIFO Configuration Register */ - #define REG_MCAN1_TXEFS (0x400340F4U) /**< \brief (MCAN1) Transmit Event FIFO Status Register */ - #define REG_MCAN1_TXEFA (0x400340F8U) /**< \brief (MCAN1) Transmit Event FIFO Acknowledge Register */ -#else - #define REG_MCAN1_CUST (*(__IO uint32_t*)0x40034008U) /**< \brief (MCAN1) Customer Register */ - #define REG_MCAN1_FBTP (*(__IO uint32_t*)0x4003400CU) /**< \brief (MCAN1) Fast Bit Timing and Prescaler Register */ - #define REG_MCAN1_TEST (*(__IO uint32_t*)0x40034010U) /**< \brief (MCAN1) Test Register */ - #define REG_MCAN1_RWD (*(__IO uint32_t*)0x40034014U) /**< \brief (MCAN1) RAM Watchdog Register */ - #define REG_MCAN1_CCCR (*(__IO uint32_t*)0x40034018U) /**< \brief (MCAN1) CC Control Register */ - #define REG_MCAN1_BTP (*(__IO uint32_t*)0x4003401CU) /**< \brief (MCAN1) Bit Timing and Prescaler Register */ - #define REG_MCAN1_TSCC (*(__IO uint32_t*)0x40034020U) /**< \brief (MCAN1) Timestamp Counter Configuration Register */ - #define REG_MCAN1_TSCV (*(__IO uint32_t*)0x40034024U) /**< \brief (MCAN1) Timestamp Counter Value Register */ - #define REG_MCAN1_TOCC (*(__IO uint32_t*)0x40034028U) /**< \brief (MCAN1) Timeout Counter Configuration Register */ - #define REG_MCAN1_TOCV (*(__IO uint32_t*)0x4003402CU) /**< \brief (MCAN1) Timeout Counter Value Register */ - #define REG_MCAN1_ECR (*(__I uint32_t*)0x40034040U) /**< \brief (MCAN1) Error Counter Register */ - #define REG_MCAN1_PSR (*(__I uint32_t*)0x40034044U) /**< \brief (MCAN1) Protocol Status Register */ - #define REG_MCAN1_IR (*(__IO uint32_t*)0x40034050U) /**< \brief (MCAN1) Interrupt Register */ - #define REG_MCAN1_IE (*(__IO uint32_t*)0x40034054U) /**< \brief (MCAN1) Interrupt Enable Register */ - #define REG_MCAN1_ILS (*(__IO uint32_t*)0x40034058U) /**< \brief (MCAN1) Interrupt Line Select Register */ - #define REG_MCAN1_ILE (*(__IO uint32_t*)0x4003405CU) /**< \brief (MCAN1) Interrupt Line Enable Register */ - #define REG_MCAN1_GFC (*(__IO uint32_t*)0x40034080U) /**< \brief (MCAN1) Global Filter Configuration Register */ - #define REG_MCAN1_SIDFC (*(__IO uint32_t*)0x40034084U) /**< \brief (MCAN1) Standard ID Filter Configuration Register */ - #define REG_MCAN1_XIDFC (*(__IO uint32_t*)0x40034088U) /**< \brief (MCAN1) Extended ID Filter Configuration Register */ - #define REG_MCAN1_XIDAM (*(__IO uint32_t*)0x40034090U) /**< \brief (MCAN1) Extended ID AND Mask Register */ - #define REG_MCAN1_HPMS (*(__I uint32_t*)0x40034094U) /**< \brief (MCAN1) High Priority Message Status Register */ - #define REG_MCAN1_NDAT1 (*(__IO uint32_t*)0x40034098U) /**< \brief (MCAN1) New Data 1 Register */ - #define REG_MCAN1_NDAT2 (*(__IO uint32_t*)0x4003409CU) /**< \brief (MCAN1) New Data 2 Register */ - #define REG_MCAN1_RXF0C (*(__IO uint32_t*)0x400340A0U) /**< \brief (MCAN1) Receive FIFO 0 Configuration Register */ - #define REG_MCAN1_RXF0S (*(__I uint32_t*)0x400340A4U) /**< \brief (MCAN1) Receive FIFO 0 Status Register */ - #define REG_MCAN1_RXF0A (*(__IO uint32_t*)0x400340A8U) /**< \brief (MCAN1) Receive FIFO 0 Acknowledge Register */ - #define REG_MCAN1_RXBC (*(__IO uint32_t*)0x400340ACU) /**< \brief (MCAN1) Receive Rx Buffer Configuration Register */ - #define REG_MCAN1_RXF1C (*(__IO uint32_t*)0x400340B0U) /**< \brief (MCAN1) Receive FIFO 1 Configuration Register */ - #define REG_MCAN1_RXF1S (*(__I uint32_t*)0x400340B4U) /**< \brief (MCAN1) Receive FIFO 1 Status Register */ - #define REG_MCAN1_RXF1A (*(__IO uint32_t*)0x400340B8U) /**< \brief (MCAN1) Receive FIFO 1 Acknowledge Register */ - #define REG_MCAN1_RXESC (*(__IO uint32_t*)0x400340BCU) /**< \brief (MCAN1) Receive Buffer / FIFO Element Size Configuration Register */ - #define REG_MCAN1_TXBC (*(__IO uint32_t*)0x400340C0U) /**< \brief (MCAN1) Transmit Buffer Configuration Register */ - #define REG_MCAN1_TXFQS (*(__I uint32_t*)0x400340C4U) /**< \brief (MCAN1) Transmit FIFO/Queue Status Register */ - #define REG_MCAN1_TXESC (*(__IO uint32_t*)0x400340C8U) /**< \brief (MCAN1) Transmit Buffer Element Size Configuration Register */ - #define REG_MCAN1_TXBRP (*(__I uint32_t*)0x400340CCU) /**< \brief (MCAN1) Transmit Buffer Request Pending Register */ - #define REG_MCAN1_TXBAR (*(__IO uint32_t*)0x400340D0U) /**< \brief (MCAN1) Transmit Buffer Add Request Register */ - #define REG_MCAN1_TXBCR (*(__IO uint32_t*)0x400340D4U) /**< \brief (MCAN1) Transmit Buffer Cancellation Request Register */ - #define REG_MCAN1_TXBTO (*(__I uint32_t*)0x400340D8U) /**< \brief (MCAN1) Transmit Buffer Transmission Occurred Register */ - #define REG_MCAN1_TXBCF (*(__I uint32_t*)0x400340DCU) /**< \brief (MCAN1) Transmit Buffer Cancellation Finished Register */ - #define REG_MCAN1_TXBTIE (*(__IO uint32_t*)0x400340E0U) /**< \brief (MCAN1) Transmit Buffer Transmission Interrupt Enable Register */ - #define REG_MCAN1_TXBCIE (*(__IO uint32_t*)0x400340E4U) /**< \brief (MCAN1) Transmit Buffer Cancellation Finished Interrupt Enable Register */ - #define REG_MCAN1_TXEFC (*(__IO uint32_t*)0x400340F0U) /**< \brief (MCAN1) Transmit Event FIFO Configuration Register */ - #define REG_MCAN1_TXEFS (*(__I uint32_t*)0x400340F4U) /**< \brief (MCAN1) Transmit Event FIFO Status Register */ - #define REG_MCAN1_TXEFA (*(__IO uint32_t*)0x400340F8U) /**< \brief (MCAN1) Transmit Event FIFO Acknowledge Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_MCAN1_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_mlb.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_mlb.h deleted file mode 100644 index 81e506db..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_mlb.h +++ /dev/null @@ -1,74 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_MLB_INSTANCE_ -#define _SAMV71_MLB_INSTANCE_ - -/* ========== Register definition for MLB peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_MLB_MLBC0 (0x40068000U) /**< \brief (MLB) MediaLB Control 0 Register */ - #define REG_MLB_MS0 (0x4006800CU) /**< \brief (MLB) MediaLB Channel Status 0 Register */ - #define REG_MLB_MS1 (0x40068014U) /**< \brief (MLB) MediaLB Channel Status1 Register */ - #define REG_MLB_MSS (0x40068020U) /**< \brief (MLB) MediaLB System Status Register */ - #define REG_MLB_MSD (0x40068024U) /**< \brief (MLB) MediaLB System Data Register */ - #define REG_MLB_MIEN (0x4006802CU) /**< \brief (MLB) MediaLB Interrupt Enable Register */ - #define REG_MLB_MLBC1 (0x4006803CU) /**< \brief (MLB) MediaLB Control 1 Register */ - #define REG_MLB_HCTL (0x40068080U) /**< \brief (MLB) HBI Control Register */ - #define REG_MLB_HCMR (0x40068088U) /**< \brief (MLB) HBI Channel Mask 0 Register */ - #define REG_MLB_HCER (0x40068090U) /**< \brief (MLB) HBI Channel Error 0 Register */ - #define REG_MLB_HCBR (0x40068098U) /**< \brief (MLB) HBI Channel Busy 0 Register */ - #define REG_MLB_MDAT (0x400680C0U) /**< \brief (MLB) MIF Data 0 Register */ - #define REG_MLB_MDWE (0x400680D0U) /**< \brief (MLB) MIF Data Write Enable 0 Register */ - #define REG_MLB_MCTL (0x400680E0U) /**< \brief (MLB) MIF Control Register */ - #define REG_MLB_MADR (0x400680E4U) /**< \brief (MLB) MIF Address Register */ - #define REG_MLB_ACTL (0x400683C0U) /**< \brief (MLB) AHB Control Register */ - #define REG_MLB_ACSR (0x400683D0U) /**< \brief (MLB) AHB Channel Status 0 Register */ - #define REG_MLB_ACMR (0x400683D8U) /**< \brief (MLB) AHB Channel Mask 0 Register */ -#else - #define REG_MLB_MLBC0 (*(__IO uint32_t*)0x40068000U) /**< \brief (MLB) MediaLB Control 0 Register */ - #define REG_MLB_MS0 (*(__IO uint32_t*)0x4006800CU) /**< \brief (MLB) MediaLB Channel Status 0 Register */ - #define REG_MLB_MS1 (*(__IO uint32_t*)0x40068014U) /**< \brief (MLB) MediaLB Channel Status1 Register */ - #define REG_MLB_MSS (*(__IO uint32_t*)0x40068020U) /**< \brief (MLB) MediaLB System Status Register */ - #define REG_MLB_MSD (*(__I uint32_t*)0x40068024U) /**< \brief (MLB) MediaLB System Data Register */ - #define REG_MLB_MIEN (*(__IO uint32_t*)0x4006802CU) /**< \brief (MLB) MediaLB Interrupt Enable Register */ - #define REG_MLB_MLBC1 (*(__IO uint32_t*)0x4006803CU) /**< \brief (MLB) MediaLB Control 1 Register */ - #define REG_MLB_HCTL (*(__IO uint32_t*)0x40068080U) /**< \brief (MLB) HBI Control Register */ - #define REG_MLB_HCMR (*(__IO uint32_t*)0x40068088U) /**< \brief (MLB) HBI Channel Mask 0 Register */ - #define REG_MLB_HCER (*(__I uint32_t*)0x40068090U) /**< \brief (MLB) HBI Channel Error 0 Register */ - #define REG_MLB_HCBR (*(__I uint32_t*)0x40068098U) /**< \brief (MLB) HBI Channel Busy 0 Register */ - #define REG_MLB_MDAT (*(__IO uint32_t*)0x400680C0U) /**< \brief (MLB) MIF Data 0 Register */ - #define REG_MLB_MDWE (*(__IO uint32_t*)0x400680D0U) /**< \brief (MLB) MIF Data Write Enable 0 Register */ - #define REG_MLB_MCTL (*(__IO uint32_t*)0x400680E0U) /**< \brief (MLB) MIF Control Register */ - #define REG_MLB_MADR (*(__IO uint32_t*)0x400680E4U) /**< \brief (MLB) MIF Address Register */ - #define REG_MLB_ACTL (*(__IO uint32_t*)0x400683C0U) /**< \brief (MLB) AHB Control Register */ - #define REG_MLB_ACSR (*(__IO uint32_t*)0x400683D0U) /**< \brief (MLB) AHB Channel Status 0 Register */ - #define REG_MLB_ACMR (*(__IO uint32_t*)0x400683D8U) /**< \brief (MLB) AHB Channel Mask 0 Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_MLB_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_pioa.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_pioa.h deleted file mode 100644 index d7a1cd26..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_pioa.h +++ /dev/null @@ -1,162 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_PIOA_INSTANCE_ -#define _SAMV71_PIOA_INSTANCE_ - -/* ========== Register definition for PIOA peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_PIOA_PER (0x400E0E00U) /**< \brief (PIOA) PIO Enable Register */ - #define REG_PIOA_PDR (0x400E0E04U) /**< \brief (PIOA) PIO Disable Register */ - #define REG_PIOA_PSR (0x400E0E08U) /**< \brief (PIOA) PIO Status Register */ - #define REG_PIOA_OER (0x400E0E10U) /**< \brief (PIOA) Output Enable Register */ - #define REG_PIOA_ODR (0x400E0E14U) /**< \brief (PIOA) Output Disable Register */ - #define REG_PIOA_OSR (0x400E0E18U) /**< \brief (PIOA) Output Status Register */ - #define REG_PIOA_IFER (0x400E0E20U) /**< \brief (PIOA) Glitch Input Filter Enable Register */ - #define REG_PIOA_IFDR (0x400E0E24U) /**< \brief (PIOA) Glitch Input Filter Disable Register */ - #define REG_PIOA_IFSR (0x400E0E28U) /**< \brief (PIOA) Glitch Input Filter Status Register */ - #define REG_PIOA_SODR (0x400E0E30U) /**< \brief (PIOA) Set Output Data Register */ - #define REG_PIOA_CODR (0x400E0E34U) /**< \brief (PIOA) Clear Output Data Register */ - #define REG_PIOA_ODSR (0x400E0E38U) /**< \brief (PIOA) Output Data Status Register */ - #define REG_PIOA_PDSR (0x400E0E3CU) /**< \brief (PIOA) Pin Data Status Register */ - #define REG_PIOA_IER (0x400E0E40U) /**< \brief (PIOA) Interrupt Enable Register */ - #define REG_PIOA_IDR (0x400E0E44U) /**< \brief (PIOA) Interrupt Disable Register */ - #define REG_PIOA_IMR (0x400E0E48U) /**< \brief (PIOA) Interrupt Mask Register */ - #define REG_PIOA_ISR (0x400E0E4CU) /**< \brief (PIOA) Interrupt Status Register */ - #define REG_PIOA_MDER (0x400E0E50U) /**< \brief (PIOA) Multi-driver Enable Register */ - #define REG_PIOA_MDDR (0x400E0E54U) /**< \brief (PIOA) Multi-driver Disable Register */ - #define REG_PIOA_MDSR (0x400E0E58U) /**< \brief (PIOA) Multi-driver Status Register */ - #define REG_PIOA_PUDR (0x400E0E60U) /**< \brief (PIOA) Pull-up Disable Register */ - #define REG_PIOA_PUER (0x400E0E64U) /**< \brief (PIOA) Pull-up Enable Register */ - #define REG_PIOA_PUSR (0x400E0E68U) /**< \brief (PIOA) Pad Pull-up Status Register */ - #define REG_PIOA_ABCDSR (0x400E0E70U) /**< \brief (PIOA) Peripheral Select Register */ - #define REG_PIOA_IFSCDR (0x400E0E80U) /**< \brief (PIOA) Input Filter Slow Clock Disable Register */ - #define REG_PIOA_IFSCER (0x400E0E84U) /**< \brief (PIOA) Input Filter Slow Clock Enable Register */ - #define REG_PIOA_IFSCSR (0x400E0E88U) /**< \brief (PIOA) Input Filter Slow Clock Status Register */ - #define REG_PIOA_SCDR (0x400E0E8CU) /**< \brief (PIOA) Slow Clock Divider Debouncing Register */ - #define REG_PIOA_PPDDR (0x400E0E90U) /**< \brief (PIOA) Pad Pull-down Disable Register */ - #define REG_PIOA_PPDER (0x400E0E94U) /**< \brief (PIOA) Pad Pull-down Enable Register */ - #define REG_PIOA_PPDSR (0x400E0E98U) /**< \brief (PIOA) Pad Pull-down Status Register */ - #define REG_PIOA_OWER (0x400E0EA0U) /**< \brief (PIOA) Output Write Enable */ - #define REG_PIOA_OWDR (0x400E0EA4U) /**< \brief (PIOA) Output Write Disable */ - #define REG_PIOA_OWSR (0x400E0EA8U) /**< \brief (PIOA) Output Write Status Register */ - #define REG_PIOA_AIMER (0x400E0EB0U) /**< \brief (PIOA) Additional Interrupt Modes Enable Register */ - #define REG_PIOA_AIMDR (0x400E0EB4U) /**< \brief (PIOA) Additional Interrupt Modes Disable Register */ - #define REG_PIOA_AIMMR (0x400E0EB8U) /**< \brief (PIOA) Additional Interrupt Modes Mask Register */ - #define REG_PIOA_ESR (0x400E0EC0U) /**< \brief (PIOA) Edge Select Register */ - #define REG_PIOA_LSR (0x400E0EC4U) /**< \brief (PIOA) Level Select Register */ - #define REG_PIOA_ELSR (0x400E0EC8U) /**< \brief (PIOA) Edge/Level Status Register */ - #define REG_PIOA_FELLSR (0x400E0ED0U) /**< \brief (PIOA) Falling Edge/Low-Level Select Register */ - #define REG_PIOA_REHLSR (0x400E0ED4U) /**< \brief (PIOA) Rising Edge/High-Level Select Register */ - #define REG_PIOA_FRLHSR (0x400E0ED8U) /**< \brief (PIOA) Fall/Rise - Low/High Status Register */ - #define REG_PIOA_LOCKSR (0x400E0EE0U) /**< \brief (PIOA) Lock Status */ - #define REG_PIOA_WPMR (0x400E0EE4U) /**< \brief (PIOA) Write Protection Mode Register */ - #define REG_PIOA_WPSR (0x400E0EE8U) /**< \brief (PIOA) Write Protection Status Register */ - #define REG_PIOA_SCHMITT (0x400E0F00U) /**< \brief (PIOA) Schmitt Trigger Register */ - #define REG_PIOA_KER (0x400E0F20U) /**< \brief (PIOA) Keypad Controller Enable Register */ - #define REG_PIOA_KRCR (0x400E0F24U) /**< \brief (PIOA) Keypad Controller Row Column Register */ - #define REG_PIOA_KDR (0x400E0F28U) /**< \brief (PIOA) Keypad Controller Debouncing Register */ - #define REG_PIOA_KIER (0x400E0F30U) /**< \brief (PIOA) Keypad Controller Interrupt Enable Register */ - #define REG_PIOA_KIDR (0x400E0F34U) /**< \brief (PIOA) Keypad Controller Interrupt Disable Register */ - #define REG_PIOA_KIMR (0x400E0F38U) /**< \brief (PIOA) Keypad Controller Interrupt Mask Register */ - #define REG_PIOA_KSR (0x400E0F3CU) /**< \brief (PIOA) Keypad Controller Status Register */ - #define REG_PIOA_KKPR (0x400E0F40U) /**< \brief (PIOA) Keypad Controller Key Press Register */ - #define REG_PIOA_KKRR (0x400E0F44U) /**< \brief (PIOA) Keypad Controller Key Release Register */ - #define REG_PIOA_PCMR (0x400E0F50U) /**< \brief (PIOA) Parallel Capture Mode Register */ - #define REG_PIOA_PCIER (0x400E0F54U) /**< \brief (PIOA) Parallel Capture Interrupt Enable Register */ - #define REG_PIOA_PCIDR (0x400E0F58U) /**< \brief (PIOA) Parallel Capture Interrupt Disable Register */ - #define REG_PIOA_PCIMR (0x400E0F5CU) /**< \brief (PIOA) Parallel Capture Interrupt Mask Register */ - #define REG_PIOA_PCISR (0x400E0F60U) /**< \brief (PIOA) Parallel Capture Interrupt Status Register */ - #define REG_PIOA_PCRHR (0x400E0F64U) /**< \brief (PIOA) Parallel Capture Reception Holding Register */ -#else - #define REG_PIOA_PER (*(__O uint32_t*)0x400E0E00U) /**< \brief (PIOA) PIO Enable Register */ - #define REG_PIOA_PDR (*(__O uint32_t*)0x400E0E04U) /**< \brief (PIOA) PIO Disable Register */ - #define REG_PIOA_PSR (*(__I uint32_t*)0x400E0E08U) /**< \brief (PIOA) PIO Status Register */ - #define REG_PIOA_OER (*(__O uint32_t*)0x400E0E10U) /**< \brief (PIOA) Output Enable Register */ - #define REG_PIOA_ODR (*(__O uint32_t*)0x400E0E14U) /**< \brief (PIOA) Output Disable Register */ - #define REG_PIOA_OSR (*(__I uint32_t*)0x400E0E18U) /**< \brief (PIOA) Output Status Register */ - #define REG_PIOA_IFER (*(__O uint32_t*)0x400E0E20U) /**< \brief (PIOA) Glitch Input Filter Enable Register */ - #define REG_PIOA_IFDR (*(__O uint32_t*)0x400E0E24U) /**< \brief (PIOA) Glitch Input Filter Disable Register */ - #define REG_PIOA_IFSR (*(__I uint32_t*)0x400E0E28U) /**< \brief (PIOA) Glitch Input Filter Status Register */ - #define REG_PIOA_SODR (*(__O uint32_t*)0x400E0E30U) /**< \brief (PIOA) Set Output Data Register */ - #define REG_PIOA_CODR (*(__O uint32_t*)0x400E0E34U) /**< \brief (PIOA) Clear Output Data Register */ - #define REG_PIOA_ODSR (*(__IO uint32_t*)0x400E0E38U) /**< \brief (PIOA) Output Data Status Register */ - #define REG_PIOA_PDSR (*(__I uint32_t*)0x400E0E3CU) /**< \brief (PIOA) Pin Data Status Register */ - #define REG_PIOA_IER (*(__O uint32_t*)0x400E0E40U) /**< \brief (PIOA) Interrupt Enable Register */ - #define REG_PIOA_IDR (*(__O uint32_t*)0x400E0E44U) /**< \brief (PIOA) Interrupt Disable Register */ - #define REG_PIOA_IMR (*(__I uint32_t*)0x400E0E48U) /**< \brief (PIOA) Interrupt Mask Register */ - #define REG_PIOA_ISR (*(__I uint32_t*)0x400E0E4CU) /**< \brief (PIOA) Interrupt Status Register */ - #define REG_PIOA_MDER (*(__O uint32_t*)0x400E0E50U) /**< \brief (PIOA) Multi-driver Enable Register */ - #define REG_PIOA_MDDR (*(__O uint32_t*)0x400E0E54U) /**< \brief (PIOA) Multi-driver Disable Register */ - #define REG_PIOA_MDSR (*(__I uint32_t*)0x400E0E58U) /**< \brief (PIOA) Multi-driver Status Register */ - #define REG_PIOA_PUDR (*(__O uint32_t*)0x400E0E60U) /**< \brief (PIOA) Pull-up Disable Register */ - #define REG_PIOA_PUER (*(__O uint32_t*)0x400E0E64U) /**< \brief (PIOA) Pull-up Enable Register */ - #define REG_PIOA_PUSR (*(__I uint32_t*)0x400E0E68U) /**< \brief (PIOA) Pad Pull-up Status Register */ - #define REG_PIOA_ABCDSR (*(__IO uint32_t*)0x400E0E70U) /**< \brief (PIOA) Peripheral Select Register */ - #define REG_PIOA_IFSCDR (*(__O uint32_t*)0x400E0E80U) /**< \brief (PIOA) Input Filter Slow Clock Disable Register */ - #define REG_PIOA_IFSCER (*(__O uint32_t*)0x400E0E84U) /**< \brief (PIOA) Input Filter Slow Clock Enable Register */ - #define REG_PIOA_IFSCSR (*(__I uint32_t*)0x400E0E88U) /**< \brief (PIOA) Input Filter Slow Clock Status Register */ - #define REG_PIOA_SCDR (*(__IO uint32_t*)0x400E0E8CU) /**< \brief (PIOA) Slow Clock Divider Debouncing Register */ - #define REG_PIOA_PPDDR (*(__O uint32_t*)0x400E0E90U) /**< \brief (PIOA) Pad Pull-down Disable Register */ - #define REG_PIOA_PPDER (*(__O uint32_t*)0x400E0E94U) /**< \brief (PIOA) Pad Pull-down Enable Register */ - #define REG_PIOA_PPDSR (*(__I uint32_t*)0x400E0E98U) /**< \brief (PIOA) Pad Pull-down Status Register */ - #define REG_PIOA_OWER (*(__O uint32_t*)0x400E0EA0U) /**< \brief (PIOA) Output Write Enable */ - #define REG_PIOA_OWDR (*(__O uint32_t*)0x400E0EA4U) /**< \brief (PIOA) Output Write Disable */ - #define REG_PIOA_OWSR (*(__I uint32_t*)0x400E0EA8U) /**< \brief (PIOA) Output Write Status Register */ - #define REG_PIOA_AIMER (*(__O uint32_t*)0x400E0EB0U) /**< \brief (PIOA) Additional Interrupt Modes Enable Register */ - #define REG_PIOA_AIMDR (*(__O uint32_t*)0x400E0EB4U) /**< \brief (PIOA) Additional Interrupt Modes Disable Register */ - #define REG_PIOA_AIMMR (*(__I uint32_t*)0x400E0EB8U) /**< \brief (PIOA) Additional Interrupt Modes Mask Register */ - #define REG_PIOA_ESR (*(__O uint32_t*)0x400E0EC0U) /**< \brief (PIOA) Edge Select Register */ - #define REG_PIOA_LSR (*(__O uint32_t*)0x400E0EC4U) /**< \brief (PIOA) Level Select Register */ - #define REG_PIOA_ELSR (*(__I uint32_t*)0x400E0EC8U) /**< \brief (PIOA) Edge/Level Status Register */ - #define REG_PIOA_FELLSR (*(__O uint32_t*)0x400E0ED0U) /**< \brief (PIOA) Falling Edge/Low-Level Select Register */ - #define REG_PIOA_REHLSR (*(__O uint32_t*)0x400E0ED4U) /**< \brief (PIOA) Rising Edge/High-Level Select Register */ - #define REG_PIOA_FRLHSR (*(__I uint32_t*)0x400E0ED8U) /**< \brief (PIOA) Fall/Rise - Low/High Status Register */ - #define REG_PIOA_LOCKSR (*(__I uint32_t*)0x400E0EE0U) /**< \brief (PIOA) Lock Status */ - #define REG_PIOA_WPMR (*(__IO uint32_t*)0x400E0EE4U) /**< \brief (PIOA) Write Protection Mode Register */ - #define REG_PIOA_WPSR (*(__I uint32_t*)0x400E0EE8U) /**< \brief (PIOA) Write Protection Status Register */ - #define REG_PIOA_SCHMITT (*(__IO uint32_t*)0x400E0F00U) /**< \brief (PIOA) Schmitt Trigger Register */ - #define REG_PIOA_KER (*(__IO uint32_t*)0x400E0F20U) /**< \brief (PIOA) Keypad Controller Enable Register */ - #define REG_PIOA_KRCR (*(__IO uint32_t*)0x400E0F24U) /**< \brief (PIOA) Keypad Controller Row Column Register */ - #define REG_PIOA_KDR (*(__IO uint32_t*)0x400E0F28U) /**< \brief (PIOA) Keypad Controller Debouncing Register */ - #define REG_PIOA_KIER (*(__O uint32_t*)0x400E0F30U) /**< \brief (PIOA) Keypad Controller Interrupt Enable Register */ - #define REG_PIOA_KIDR (*(__O uint32_t*)0x400E0F34U) /**< \brief (PIOA) Keypad Controller Interrupt Disable Register */ - #define REG_PIOA_KIMR (*(__I uint32_t*)0x400E0F38U) /**< \brief (PIOA) Keypad Controller Interrupt Mask Register */ - #define REG_PIOA_KSR (*(__I uint32_t*)0x400E0F3CU) /**< \brief (PIOA) Keypad Controller Status Register */ - #define REG_PIOA_KKPR (*(__I uint32_t*)0x400E0F40U) /**< \brief (PIOA) Keypad Controller Key Press Register */ - #define REG_PIOA_KKRR (*(__I uint32_t*)0x400E0F44U) /**< \brief (PIOA) Keypad Controller Key Release Register */ - #define REG_PIOA_PCMR (*(__IO uint32_t*)0x400E0F50U) /**< \brief (PIOA) Parallel Capture Mode Register */ - #define REG_PIOA_PCIER (*(__O uint32_t*)0x400E0F54U) /**< \brief (PIOA) Parallel Capture Interrupt Enable Register */ - #define REG_PIOA_PCIDR (*(__O uint32_t*)0x400E0F58U) /**< \brief (PIOA) Parallel Capture Interrupt Disable Register */ - #define REG_PIOA_PCIMR (*(__I uint32_t*)0x400E0F5CU) /**< \brief (PIOA) Parallel Capture Interrupt Mask Register */ - #define REG_PIOA_PCISR (*(__I uint32_t*)0x400E0F60U) /**< \brief (PIOA) Parallel Capture Interrupt Status Register */ - #define REG_PIOA_PCRHR (*(__I uint32_t*)0x400E0F64U) /**< \brief (PIOA) Parallel Capture Reception Holding Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_PIOA_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_piob.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_piob.h deleted file mode 100644 index 71787615..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_piob.h +++ /dev/null @@ -1,162 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_PIOB_INSTANCE_ -#define _SAMV71_PIOB_INSTANCE_ - -/* ========== Register definition for PIOB peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_PIOB_PER (0x400E1000U) /**< \brief (PIOB) PIO Enable Register */ - #define REG_PIOB_PDR (0x400E1004U) /**< \brief (PIOB) PIO Disable Register */ - #define REG_PIOB_PSR (0x400E1008U) /**< \brief (PIOB) PIO Status Register */ - #define REG_PIOB_OER (0x400E1010U) /**< \brief (PIOB) Output Enable Register */ - #define REG_PIOB_ODR (0x400E1014U) /**< \brief (PIOB) Output Disable Register */ - #define REG_PIOB_OSR (0x400E1018U) /**< \brief (PIOB) Output Status Register */ - #define REG_PIOB_IFER (0x400E1020U) /**< \brief (PIOB) Glitch Input Filter Enable Register */ - #define REG_PIOB_IFDR (0x400E1024U) /**< \brief (PIOB) Glitch Input Filter Disable Register */ - #define REG_PIOB_IFSR (0x400E1028U) /**< \brief (PIOB) Glitch Input Filter Status Register */ - #define REG_PIOB_SODR (0x400E1030U) /**< \brief (PIOB) Set Output Data Register */ - #define REG_PIOB_CODR (0x400E1034U) /**< \brief (PIOB) Clear Output Data Register */ - #define REG_PIOB_ODSR (0x400E1038U) /**< \brief (PIOB) Output Data Status Register */ - #define REG_PIOB_PDSR (0x400E103CU) /**< \brief (PIOB) Pin Data Status Register */ - #define REG_PIOB_IER (0x400E1040U) /**< \brief (PIOB) Interrupt Enable Register */ - #define REG_PIOB_IDR (0x400E1044U) /**< \brief (PIOB) Interrupt Disable Register */ - #define REG_PIOB_IMR (0x400E1048U) /**< \brief (PIOB) Interrupt Mask Register */ - #define REG_PIOB_ISR (0x400E104CU) /**< \brief (PIOB) Interrupt Status Register */ - #define REG_PIOB_MDER (0x400E1050U) /**< \brief (PIOB) Multi-driver Enable Register */ - #define REG_PIOB_MDDR (0x400E1054U) /**< \brief (PIOB) Multi-driver Disable Register */ - #define REG_PIOB_MDSR (0x400E1058U) /**< \brief (PIOB) Multi-driver Status Register */ - #define REG_PIOB_PUDR (0x400E1060U) /**< \brief (PIOB) Pull-up Disable Register */ - #define REG_PIOB_PUER (0x400E1064U) /**< \brief (PIOB) Pull-up Enable Register */ - #define REG_PIOB_PUSR (0x400E1068U) /**< \brief (PIOB) Pad Pull-up Status Register */ - #define REG_PIOB_ABCDSR (0x400E1070U) /**< \brief (PIOB) Peripheral Select Register */ - #define REG_PIOB_IFSCDR (0x400E1080U) /**< \brief (PIOB) Input Filter Slow Clock Disable Register */ - #define REG_PIOB_IFSCER (0x400E1084U) /**< \brief (PIOB) Input Filter Slow Clock Enable Register */ - #define REG_PIOB_IFSCSR (0x400E1088U) /**< \brief (PIOB) Input Filter Slow Clock Status Register */ - #define REG_PIOB_SCDR (0x400E108CU) /**< \brief (PIOB) Slow Clock Divider Debouncing Register */ - #define REG_PIOB_PPDDR (0x400E1090U) /**< \brief (PIOB) Pad Pull-down Disable Register */ - #define REG_PIOB_PPDER (0x400E1094U) /**< \brief (PIOB) Pad Pull-down Enable Register */ - #define REG_PIOB_PPDSR (0x400E1098U) /**< \brief (PIOB) Pad Pull-down Status Register */ - #define REG_PIOB_OWER (0x400E10A0U) /**< \brief (PIOB) Output Write Enable */ - #define REG_PIOB_OWDR (0x400E10A4U) /**< \brief (PIOB) Output Write Disable */ - #define REG_PIOB_OWSR (0x400E10A8U) /**< \brief (PIOB) Output Write Status Register */ - #define REG_PIOB_AIMER (0x400E10B0U) /**< \brief (PIOB) Additional Interrupt Modes Enable Register */ - #define REG_PIOB_AIMDR (0x400E10B4U) /**< \brief (PIOB) Additional Interrupt Modes Disable Register */ - #define REG_PIOB_AIMMR (0x400E10B8U) /**< \brief (PIOB) Additional Interrupt Modes Mask Register */ - #define REG_PIOB_ESR (0x400E10C0U) /**< \brief (PIOB) Edge Select Register */ - #define REG_PIOB_LSR (0x400E10C4U) /**< \brief (PIOB) Level Select Register */ - #define REG_PIOB_ELSR (0x400E10C8U) /**< \brief (PIOB) Edge/Level Status Register */ - #define REG_PIOB_FELLSR (0x400E10D0U) /**< \brief (PIOB) Falling Edge/Low-Level Select Register */ - #define REG_PIOB_REHLSR (0x400E10D4U) /**< \brief (PIOB) Rising Edge/High-Level Select Register */ - #define REG_PIOB_FRLHSR (0x400E10D8U) /**< \brief (PIOB) Fall/Rise - Low/High Status Register */ - #define REG_PIOB_LOCKSR (0x400E10E0U) /**< \brief (PIOB) Lock Status */ - #define REG_PIOB_WPMR (0x400E10E4U) /**< \brief (PIOB) Write Protection Mode Register */ - #define REG_PIOB_WPSR (0x400E10E8U) /**< \brief (PIOB) Write Protection Status Register */ - #define REG_PIOB_SCHMITT (0x400E1100U) /**< \brief (PIOB) Schmitt Trigger Register */ - #define REG_PIOB_KER (0x400E1120U) /**< \brief (PIOB) Keypad Controller Enable Register */ - #define REG_PIOB_KRCR (0x400E1124U) /**< \brief (PIOB) Keypad Controller Row Column Register */ - #define REG_PIOB_KDR (0x400E1128U) /**< \brief (PIOB) Keypad Controller Debouncing Register */ - #define REG_PIOB_KIER (0x400E1130U) /**< \brief (PIOB) Keypad Controller Interrupt Enable Register */ - #define REG_PIOB_KIDR (0x400E1134U) /**< \brief (PIOB) Keypad Controller Interrupt Disable Register */ - #define REG_PIOB_KIMR (0x400E1138U) /**< \brief (PIOB) Keypad Controller Interrupt Mask Register */ - #define REG_PIOB_KSR (0x400E113CU) /**< \brief (PIOB) Keypad Controller Status Register */ - #define REG_PIOB_KKPR (0x400E1140U) /**< \brief (PIOB) Keypad Controller Key Press Register */ - #define REG_PIOB_KKRR (0x400E1144U) /**< \brief (PIOB) Keypad Controller Key Release Register */ - #define REG_PIOB_PCMR (0x400E1150U) /**< \brief (PIOB) Parallel Capture Mode Register */ - #define REG_PIOB_PCIER (0x400E1154U) /**< \brief (PIOB) Parallel Capture Interrupt Enable Register */ - #define REG_PIOB_PCIDR (0x400E1158U) /**< \brief (PIOB) Parallel Capture Interrupt Disable Register */ - #define REG_PIOB_PCIMR (0x400E115CU) /**< \brief (PIOB) Parallel Capture Interrupt Mask Register */ - #define REG_PIOB_PCISR (0x400E1160U) /**< \brief (PIOB) Parallel Capture Interrupt Status Register */ - #define REG_PIOB_PCRHR (0x400E1164U) /**< \brief (PIOB) Parallel Capture Reception Holding Register */ -#else - #define REG_PIOB_PER (*(__O uint32_t*)0x400E1000U) /**< \brief (PIOB) PIO Enable Register */ - #define REG_PIOB_PDR (*(__O uint32_t*)0x400E1004U) /**< \brief (PIOB) PIO Disable Register */ - #define REG_PIOB_PSR (*(__I uint32_t*)0x400E1008U) /**< \brief (PIOB) PIO Status Register */ - #define REG_PIOB_OER (*(__O uint32_t*)0x400E1010U) /**< \brief (PIOB) Output Enable Register */ - #define REG_PIOB_ODR (*(__O uint32_t*)0x400E1014U) /**< \brief (PIOB) Output Disable Register */ - #define REG_PIOB_OSR (*(__I uint32_t*)0x400E1018U) /**< \brief (PIOB) Output Status Register */ - #define REG_PIOB_IFER (*(__O uint32_t*)0x400E1020U) /**< \brief (PIOB) Glitch Input Filter Enable Register */ - #define REG_PIOB_IFDR (*(__O uint32_t*)0x400E1024U) /**< \brief (PIOB) Glitch Input Filter Disable Register */ - #define REG_PIOB_IFSR (*(__I uint32_t*)0x400E1028U) /**< \brief (PIOB) Glitch Input Filter Status Register */ - #define REG_PIOB_SODR (*(__O uint32_t*)0x400E1030U) /**< \brief (PIOB) Set Output Data Register */ - #define REG_PIOB_CODR (*(__O uint32_t*)0x400E1034U) /**< \brief (PIOB) Clear Output Data Register */ - #define REG_PIOB_ODSR (*(__IO uint32_t*)0x400E1038U) /**< \brief (PIOB) Output Data Status Register */ - #define REG_PIOB_PDSR (*(__I uint32_t*)0x400E103CU) /**< \brief (PIOB) Pin Data Status Register */ - #define REG_PIOB_IER (*(__O uint32_t*)0x400E1040U) /**< \brief (PIOB) Interrupt Enable Register */ - #define REG_PIOB_IDR (*(__O uint32_t*)0x400E1044U) /**< \brief (PIOB) Interrupt Disable Register */ - #define REG_PIOB_IMR (*(__I uint32_t*)0x400E1048U) /**< \brief (PIOB) Interrupt Mask Register */ - #define REG_PIOB_ISR (*(__I uint32_t*)0x400E104CU) /**< \brief (PIOB) Interrupt Status Register */ - #define REG_PIOB_MDER (*(__O uint32_t*)0x400E1050U) /**< \brief (PIOB) Multi-driver Enable Register */ - #define REG_PIOB_MDDR (*(__O uint32_t*)0x400E1054U) /**< \brief (PIOB) Multi-driver Disable Register */ - #define REG_PIOB_MDSR (*(__I uint32_t*)0x400E1058U) /**< \brief (PIOB) Multi-driver Status Register */ - #define REG_PIOB_PUDR (*(__O uint32_t*)0x400E1060U) /**< \brief (PIOB) Pull-up Disable Register */ - #define REG_PIOB_PUER (*(__O uint32_t*)0x400E1064U) /**< \brief (PIOB) Pull-up Enable Register */ - #define REG_PIOB_PUSR (*(__I uint32_t*)0x400E1068U) /**< \brief (PIOB) Pad Pull-up Status Register */ - #define REG_PIOB_ABCDSR (*(__IO uint32_t*)0x400E1070U) /**< \brief (PIOB) Peripheral Select Register */ - #define REG_PIOB_IFSCDR (*(__O uint32_t*)0x400E1080U) /**< \brief (PIOB) Input Filter Slow Clock Disable Register */ - #define REG_PIOB_IFSCER (*(__O uint32_t*)0x400E1084U) /**< \brief (PIOB) Input Filter Slow Clock Enable Register */ - #define REG_PIOB_IFSCSR (*(__I uint32_t*)0x400E1088U) /**< \brief (PIOB) Input Filter Slow Clock Status Register */ - #define REG_PIOB_SCDR (*(__IO uint32_t*)0x400E108CU) /**< \brief (PIOB) Slow Clock Divider Debouncing Register */ - #define REG_PIOB_PPDDR (*(__O uint32_t*)0x400E1090U) /**< \brief (PIOB) Pad Pull-down Disable Register */ - #define REG_PIOB_PPDER (*(__O uint32_t*)0x400E1094U) /**< \brief (PIOB) Pad Pull-down Enable Register */ - #define REG_PIOB_PPDSR (*(__I uint32_t*)0x400E1098U) /**< \brief (PIOB) Pad Pull-down Status Register */ - #define REG_PIOB_OWER (*(__O uint32_t*)0x400E10A0U) /**< \brief (PIOB) Output Write Enable */ - #define REG_PIOB_OWDR (*(__O uint32_t*)0x400E10A4U) /**< \brief (PIOB) Output Write Disable */ - #define REG_PIOB_OWSR (*(__I uint32_t*)0x400E10A8U) /**< \brief (PIOB) Output Write Status Register */ - #define REG_PIOB_AIMER (*(__O uint32_t*)0x400E10B0U) /**< \brief (PIOB) Additional Interrupt Modes Enable Register */ - #define REG_PIOB_AIMDR (*(__O uint32_t*)0x400E10B4U) /**< \brief (PIOB) Additional Interrupt Modes Disable Register */ - #define REG_PIOB_AIMMR (*(__I uint32_t*)0x400E10B8U) /**< \brief (PIOB) Additional Interrupt Modes Mask Register */ - #define REG_PIOB_ESR (*(__O uint32_t*)0x400E10C0U) /**< \brief (PIOB) Edge Select Register */ - #define REG_PIOB_LSR (*(__O uint32_t*)0x400E10C4U) /**< \brief (PIOB) Level Select Register */ - #define REG_PIOB_ELSR (*(__I uint32_t*)0x400E10C8U) /**< \brief (PIOB) Edge/Level Status Register */ - #define REG_PIOB_FELLSR (*(__O uint32_t*)0x400E10D0U) /**< \brief (PIOB) Falling Edge/Low-Level Select Register */ - #define REG_PIOB_REHLSR (*(__O uint32_t*)0x400E10D4U) /**< \brief (PIOB) Rising Edge/High-Level Select Register */ - #define REG_PIOB_FRLHSR (*(__I uint32_t*)0x400E10D8U) /**< \brief (PIOB) Fall/Rise - Low/High Status Register */ - #define REG_PIOB_LOCKSR (*(__I uint32_t*)0x400E10E0U) /**< \brief (PIOB) Lock Status */ - #define REG_PIOB_WPMR (*(__IO uint32_t*)0x400E10E4U) /**< \brief (PIOB) Write Protection Mode Register */ - #define REG_PIOB_WPSR (*(__I uint32_t*)0x400E10E8U) /**< \brief (PIOB) Write Protection Status Register */ - #define REG_PIOB_SCHMITT (*(__IO uint32_t*)0x400E1100U) /**< \brief (PIOB) Schmitt Trigger Register */ - #define REG_PIOB_KER (*(__IO uint32_t*)0x400E1120U) /**< \brief (PIOB) Keypad Controller Enable Register */ - #define REG_PIOB_KRCR (*(__IO uint32_t*)0x400E1124U) /**< \brief (PIOB) Keypad Controller Row Column Register */ - #define REG_PIOB_KDR (*(__IO uint32_t*)0x400E1128U) /**< \brief (PIOB) Keypad Controller Debouncing Register */ - #define REG_PIOB_KIER (*(__O uint32_t*)0x400E1130U) /**< \brief (PIOB) Keypad Controller Interrupt Enable Register */ - #define REG_PIOB_KIDR (*(__O uint32_t*)0x400E1134U) /**< \brief (PIOB) Keypad Controller Interrupt Disable Register */ - #define REG_PIOB_KIMR (*(__I uint32_t*)0x400E1138U) /**< \brief (PIOB) Keypad Controller Interrupt Mask Register */ - #define REG_PIOB_KSR (*(__I uint32_t*)0x400E113CU) /**< \brief (PIOB) Keypad Controller Status Register */ - #define REG_PIOB_KKPR (*(__I uint32_t*)0x400E1140U) /**< \brief (PIOB) Keypad Controller Key Press Register */ - #define REG_PIOB_KKRR (*(__I uint32_t*)0x400E1144U) /**< \brief (PIOB) Keypad Controller Key Release Register */ - #define REG_PIOB_PCMR (*(__IO uint32_t*)0x400E1150U) /**< \brief (PIOB) Parallel Capture Mode Register */ - #define REG_PIOB_PCIER (*(__O uint32_t*)0x400E1154U) /**< \brief (PIOB) Parallel Capture Interrupt Enable Register */ - #define REG_PIOB_PCIDR (*(__O uint32_t*)0x400E1158U) /**< \brief (PIOB) Parallel Capture Interrupt Disable Register */ - #define REG_PIOB_PCIMR (*(__I uint32_t*)0x400E115CU) /**< \brief (PIOB) Parallel Capture Interrupt Mask Register */ - #define REG_PIOB_PCISR (*(__I uint32_t*)0x400E1160U) /**< \brief (PIOB) Parallel Capture Interrupt Status Register */ - #define REG_PIOB_PCRHR (*(__I uint32_t*)0x400E1164U) /**< \brief (PIOB) Parallel Capture Reception Holding Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_PIOB_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_pioc.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_pioc.h deleted file mode 100644 index 5e9129dd..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_pioc.h +++ /dev/null @@ -1,162 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_PIOC_INSTANCE_ -#define _SAMV71_PIOC_INSTANCE_ - -/* ========== Register definition for PIOC peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_PIOC_PER (0x400E1200U) /**< \brief (PIOC) PIO Enable Register */ - #define REG_PIOC_PDR (0x400E1204U) /**< \brief (PIOC) PIO Disable Register */ - #define REG_PIOC_PSR (0x400E1208U) /**< \brief (PIOC) PIO Status Register */ - #define REG_PIOC_OER (0x400E1210U) /**< \brief (PIOC) Output Enable Register */ - #define REG_PIOC_ODR (0x400E1214U) /**< \brief (PIOC) Output Disable Register */ - #define REG_PIOC_OSR (0x400E1218U) /**< \brief (PIOC) Output Status Register */ - #define REG_PIOC_IFER (0x400E1220U) /**< \brief (PIOC) Glitch Input Filter Enable Register */ - #define REG_PIOC_IFDR (0x400E1224U) /**< \brief (PIOC) Glitch Input Filter Disable Register */ - #define REG_PIOC_IFSR (0x400E1228U) /**< \brief (PIOC) Glitch Input Filter Status Register */ - #define REG_PIOC_SODR (0x400E1230U) /**< \brief (PIOC) Set Output Data Register */ - #define REG_PIOC_CODR (0x400E1234U) /**< \brief (PIOC) Clear Output Data Register */ - #define REG_PIOC_ODSR (0x400E1238U) /**< \brief (PIOC) Output Data Status Register */ - #define REG_PIOC_PDSR (0x400E123CU) /**< \brief (PIOC) Pin Data Status Register */ - #define REG_PIOC_IER (0x400E1240U) /**< \brief (PIOC) Interrupt Enable Register */ - #define REG_PIOC_IDR (0x400E1244U) /**< \brief (PIOC) Interrupt Disable Register */ - #define REG_PIOC_IMR (0x400E1248U) /**< \brief (PIOC) Interrupt Mask Register */ - #define REG_PIOC_ISR (0x400E124CU) /**< \brief (PIOC) Interrupt Status Register */ - #define REG_PIOC_MDER (0x400E1250U) /**< \brief (PIOC) Multi-driver Enable Register */ - #define REG_PIOC_MDDR (0x400E1254U) /**< \brief (PIOC) Multi-driver Disable Register */ - #define REG_PIOC_MDSR (0x400E1258U) /**< \brief (PIOC) Multi-driver Status Register */ - #define REG_PIOC_PUDR (0x400E1260U) /**< \brief (PIOC) Pull-up Disable Register */ - #define REG_PIOC_PUER (0x400E1264U) /**< \brief (PIOC) Pull-up Enable Register */ - #define REG_PIOC_PUSR (0x400E1268U) /**< \brief (PIOC) Pad Pull-up Status Register */ - #define REG_PIOC_ABCDSR (0x400E1270U) /**< \brief (PIOC) Peripheral Select Register */ - #define REG_PIOC_IFSCDR (0x400E1280U) /**< \brief (PIOC) Input Filter Slow Clock Disable Register */ - #define REG_PIOC_IFSCER (0x400E1284U) /**< \brief (PIOC) Input Filter Slow Clock Enable Register */ - #define REG_PIOC_IFSCSR (0x400E1288U) /**< \brief (PIOC) Input Filter Slow Clock Status Register */ - #define REG_PIOC_SCDR (0x400E128CU) /**< \brief (PIOC) Slow Clock Divider Debouncing Register */ - #define REG_PIOC_PPDDR (0x400E1290U) /**< \brief (PIOC) Pad Pull-down Disable Register */ - #define REG_PIOC_PPDER (0x400E1294U) /**< \brief (PIOC) Pad Pull-down Enable Register */ - #define REG_PIOC_PPDSR (0x400E1298U) /**< \brief (PIOC) Pad Pull-down Status Register */ - #define REG_PIOC_OWER (0x400E12A0U) /**< \brief (PIOC) Output Write Enable */ - #define REG_PIOC_OWDR (0x400E12A4U) /**< \brief (PIOC) Output Write Disable */ - #define REG_PIOC_OWSR (0x400E12A8U) /**< \brief (PIOC) Output Write Status Register */ - #define REG_PIOC_AIMER (0x400E12B0U) /**< \brief (PIOC) Additional Interrupt Modes Enable Register */ - #define REG_PIOC_AIMDR (0x400E12B4U) /**< \brief (PIOC) Additional Interrupt Modes Disable Register */ - #define REG_PIOC_AIMMR (0x400E12B8U) /**< \brief (PIOC) Additional Interrupt Modes Mask Register */ - #define REG_PIOC_ESR (0x400E12C0U) /**< \brief (PIOC) Edge Select Register */ - #define REG_PIOC_LSR (0x400E12C4U) /**< \brief (PIOC) Level Select Register */ - #define REG_PIOC_ELSR (0x400E12C8U) /**< \brief (PIOC) Edge/Level Status Register */ - #define REG_PIOC_FELLSR (0x400E12D0U) /**< \brief (PIOC) Falling Edge/Low-Level Select Register */ - #define REG_PIOC_REHLSR (0x400E12D4U) /**< \brief (PIOC) Rising Edge/High-Level Select Register */ - #define REG_PIOC_FRLHSR (0x400E12D8U) /**< \brief (PIOC) Fall/Rise - Low/High Status Register */ - #define REG_PIOC_LOCKSR (0x400E12E0U) /**< \brief (PIOC) Lock Status */ - #define REG_PIOC_WPMR (0x400E12E4U) /**< \brief (PIOC) Write Protection Mode Register */ - #define REG_PIOC_WPSR (0x400E12E8U) /**< \brief (PIOC) Write Protection Status Register */ - #define REG_PIOC_SCHMITT (0x400E1300U) /**< \brief (PIOC) Schmitt Trigger Register */ - #define REG_PIOC_KER (0x400E1320U) /**< \brief (PIOC) Keypad Controller Enable Register */ - #define REG_PIOC_KRCR (0x400E1324U) /**< \brief (PIOC) Keypad Controller Row Column Register */ - #define REG_PIOC_KDR (0x400E1328U) /**< \brief (PIOC) Keypad Controller Debouncing Register */ - #define REG_PIOC_KIER (0x400E1330U) /**< \brief (PIOC) Keypad Controller Interrupt Enable Register */ - #define REG_PIOC_KIDR (0x400E1334U) /**< \brief (PIOC) Keypad Controller Interrupt Disable Register */ - #define REG_PIOC_KIMR (0x400E1338U) /**< \brief (PIOC) Keypad Controller Interrupt Mask Register */ - #define REG_PIOC_KSR (0x400E133CU) /**< \brief (PIOC) Keypad Controller Status Register */ - #define REG_PIOC_KKPR (0x400E1340U) /**< \brief (PIOC) Keypad Controller Key Press Register */ - #define REG_PIOC_KKRR (0x400E1344U) /**< \brief (PIOC) Keypad Controller Key Release Register */ - #define REG_PIOC_PCMR (0x400E1350U) /**< \brief (PIOC) Parallel Capture Mode Register */ - #define REG_PIOC_PCIER (0x400E1354U) /**< \brief (PIOC) Parallel Capture Interrupt Enable Register */ - #define REG_PIOC_PCIDR (0x400E1358U) /**< \brief (PIOC) Parallel Capture Interrupt Disable Register */ - #define REG_PIOC_PCIMR (0x400E135CU) /**< \brief (PIOC) Parallel Capture Interrupt Mask Register */ - #define REG_PIOC_PCISR (0x400E1360U) /**< \brief (PIOC) Parallel Capture Interrupt Status Register */ - #define REG_PIOC_PCRHR (0x400E1364U) /**< \brief (PIOC) Parallel Capture Reception Holding Register */ -#else - #define REG_PIOC_PER (*(__O uint32_t*)0x400E1200U) /**< \brief (PIOC) PIO Enable Register */ - #define REG_PIOC_PDR (*(__O uint32_t*)0x400E1204U) /**< \brief (PIOC) PIO Disable Register */ - #define REG_PIOC_PSR (*(__I uint32_t*)0x400E1208U) /**< \brief (PIOC) PIO Status Register */ - #define REG_PIOC_OER (*(__O uint32_t*)0x400E1210U) /**< \brief (PIOC) Output Enable Register */ - #define REG_PIOC_ODR (*(__O uint32_t*)0x400E1214U) /**< \brief (PIOC) Output Disable Register */ - #define REG_PIOC_OSR (*(__I uint32_t*)0x400E1218U) /**< \brief (PIOC) Output Status Register */ - #define REG_PIOC_IFER (*(__O uint32_t*)0x400E1220U) /**< \brief (PIOC) Glitch Input Filter Enable Register */ - #define REG_PIOC_IFDR (*(__O uint32_t*)0x400E1224U) /**< \brief (PIOC) Glitch Input Filter Disable Register */ - #define REG_PIOC_IFSR (*(__I uint32_t*)0x400E1228U) /**< \brief (PIOC) Glitch Input Filter Status Register */ - #define REG_PIOC_SODR (*(__O uint32_t*)0x400E1230U) /**< \brief (PIOC) Set Output Data Register */ - #define REG_PIOC_CODR (*(__O uint32_t*)0x400E1234U) /**< \brief (PIOC) Clear Output Data Register */ - #define REG_PIOC_ODSR (*(__IO uint32_t*)0x400E1238U) /**< \brief (PIOC) Output Data Status Register */ - #define REG_PIOC_PDSR (*(__I uint32_t*)0x400E123CU) /**< \brief (PIOC) Pin Data Status Register */ - #define REG_PIOC_IER (*(__O uint32_t*)0x400E1240U) /**< \brief (PIOC) Interrupt Enable Register */ - #define REG_PIOC_IDR (*(__O uint32_t*)0x400E1244U) /**< \brief (PIOC) Interrupt Disable Register */ - #define REG_PIOC_IMR (*(__I uint32_t*)0x400E1248U) /**< \brief (PIOC) Interrupt Mask Register */ - #define REG_PIOC_ISR (*(__I uint32_t*)0x400E124CU) /**< \brief (PIOC) Interrupt Status Register */ - #define REG_PIOC_MDER (*(__O uint32_t*)0x400E1250U) /**< \brief (PIOC) Multi-driver Enable Register */ - #define REG_PIOC_MDDR (*(__O uint32_t*)0x400E1254U) /**< \brief (PIOC) Multi-driver Disable Register */ - #define REG_PIOC_MDSR (*(__I uint32_t*)0x400E1258U) /**< \brief (PIOC) Multi-driver Status Register */ - #define REG_PIOC_PUDR (*(__O uint32_t*)0x400E1260U) /**< \brief (PIOC) Pull-up Disable Register */ - #define REG_PIOC_PUER (*(__O uint32_t*)0x400E1264U) /**< \brief (PIOC) Pull-up Enable Register */ - #define REG_PIOC_PUSR (*(__I uint32_t*)0x400E1268U) /**< \brief (PIOC) Pad Pull-up Status Register */ - #define REG_PIOC_ABCDSR (*(__IO uint32_t*)0x400E1270U) /**< \brief (PIOC) Peripheral Select Register */ - #define REG_PIOC_IFSCDR (*(__O uint32_t*)0x400E1280U) /**< \brief (PIOC) Input Filter Slow Clock Disable Register */ - #define REG_PIOC_IFSCER (*(__O uint32_t*)0x400E1284U) /**< \brief (PIOC) Input Filter Slow Clock Enable Register */ - #define REG_PIOC_IFSCSR (*(__I uint32_t*)0x400E1288U) /**< \brief (PIOC) Input Filter Slow Clock Status Register */ - #define REG_PIOC_SCDR (*(__IO uint32_t*)0x400E128CU) /**< \brief (PIOC) Slow Clock Divider Debouncing Register */ - #define REG_PIOC_PPDDR (*(__O uint32_t*)0x400E1290U) /**< \brief (PIOC) Pad Pull-down Disable Register */ - #define REG_PIOC_PPDER (*(__O uint32_t*)0x400E1294U) /**< \brief (PIOC) Pad Pull-down Enable Register */ - #define REG_PIOC_PPDSR (*(__I uint32_t*)0x400E1298U) /**< \brief (PIOC) Pad Pull-down Status Register */ - #define REG_PIOC_OWER (*(__O uint32_t*)0x400E12A0U) /**< \brief (PIOC) Output Write Enable */ - #define REG_PIOC_OWDR (*(__O uint32_t*)0x400E12A4U) /**< \brief (PIOC) Output Write Disable */ - #define REG_PIOC_OWSR (*(__I uint32_t*)0x400E12A8U) /**< \brief (PIOC) Output Write Status Register */ - #define REG_PIOC_AIMER (*(__O uint32_t*)0x400E12B0U) /**< \brief (PIOC) Additional Interrupt Modes Enable Register */ - #define REG_PIOC_AIMDR (*(__O uint32_t*)0x400E12B4U) /**< \brief (PIOC) Additional Interrupt Modes Disable Register */ - #define REG_PIOC_AIMMR (*(__I uint32_t*)0x400E12B8U) /**< \brief (PIOC) Additional Interrupt Modes Mask Register */ - #define REG_PIOC_ESR (*(__O uint32_t*)0x400E12C0U) /**< \brief (PIOC) Edge Select Register */ - #define REG_PIOC_LSR (*(__O uint32_t*)0x400E12C4U) /**< \brief (PIOC) Level Select Register */ - #define REG_PIOC_ELSR (*(__I uint32_t*)0x400E12C8U) /**< \brief (PIOC) Edge/Level Status Register */ - #define REG_PIOC_FELLSR (*(__O uint32_t*)0x400E12D0U) /**< \brief (PIOC) Falling Edge/Low-Level Select Register */ - #define REG_PIOC_REHLSR (*(__O uint32_t*)0x400E12D4U) /**< \brief (PIOC) Rising Edge/High-Level Select Register */ - #define REG_PIOC_FRLHSR (*(__I uint32_t*)0x400E12D8U) /**< \brief (PIOC) Fall/Rise - Low/High Status Register */ - #define REG_PIOC_LOCKSR (*(__I uint32_t*)0x400E12E0U) /**< \brief (PIOC) Lock Status */ - #define REG_PIOC_WPMR (*(__IO uint32_t*)0x400E12E4U) /**< \brief (PIOC) Write Protection Mode Register */ - #define REG_PIOC_WPSR (*(__I uint32_t*)0x400E12E8U) /**< \brief (PIOC) Write Protection Status Register */ - #define REG_PIOC_SCHMITT (*(__IO uint32_t*)0x400E1300U) /**< \brief (PIOC) Schmitt Trigger Register */ - #define REG_PIOC_KER (*(__IO uint32_t*)0x400E1320U) /**< \brief (PIOC) Keypad Controller Enable Register */ - #define REG_PIOC_KRCR (*(__IO uint32_t*)0x400E1324U) /**< \brief (PIOC) Keypad Controller Row Column Register */ - #define REG_PIOC_KDR (*(__IO uint32_t*)0x400E1328U) /**< \brief (PIOC) Keypad Controller Debouncing Register */ - #define REG_PIOC_KIER (*(__O uint32_t*)0x400E1330U) /**< \brief (PIOC) Keypad Controller Interrupt Enable Register */ - #define REG_PIOC_KIDR (*(__O uint32_t*)0x400E1334U) /**< \brief (PIOC) Keypad Controller Interrupt Disable Register */ - #define REG_PIOC_KIMR (*(__I uint32_t*)0x400E1338U) /**< \brief (PIOC) Keypad Controller Interrupt Mask Register */ - #define REG_PIOC_KSR (*(__I uint32_t*)0x400E133CU) /**< \brief (PIOC) Keypad Controller Status Register */ - #define REG_PIOC_KKPR (*(__I uint32_t*)0x400E1340U) /**< \brief (PIOC) Keypad Controller Key Press Register */ - #define REG_PIOC_KKRR (*(__I uint32_t*)0x400E1344U) /**< \brief (PIOC) Keypad Controller Key Release Register */ - #define REG_PIOC_PCMR (*(__IO uint32_t*)0x400E1350U) /**< \brief (PIOC) Parallel Capture Mode Register */ - #define REG_PIOC_PCIER (*(__O uint32_t*)0x400E1354U) /**< \brief (PIOC) Parallel Capture Interrupt Enable Register */ - #define REG_PIOC_PCIDR (*(__O uint32_t*)0x400E1358U) /**< \brief (PIOC) Parallel Capture Interrupt Disable Register */ - #define REG_PIOC_PCIMR (*(__I uint32_t*)0x400E135CU) /**< \brief (PIOC) Parallel Capture Interrupt Mask Register */ - #define REG_PIOC_PCISR (*(__I uint32_t*)0x400E1360U) /**< \brief (PIOC) Parallel Capture Interrupt Status Register */ - #define REG_PIOC_PCRHR (*(__I uint32_t*)0x400E1364U) /**< \brief (PIOC) Parallel Capture Reception Holding Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_PIOC_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_piod.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_piod.h deleted file mode 100644 index 7726c792..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_piod.h +++ /dev/null @@ -1,162 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_PIOD_INSTANCE_ -#define _SAMV71_PIOD_INSTANCE_ - -/* ========== Register definition for PIOD peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_PIOD_PER (0x400E1400U) /**< \brief (PIOD) PIO Enable Register */ - #define REG_PIOD_PDR (0x400E1404U) /**< \brief (PIOD) PIO Disable Register */ - #define REG_PIOD_PSR (0x400E1408U) /**< \brief (PIOD) PIO Status Register */ - #define REG_PIOD_OER (0x400E1410U) /**< \brief (PIOD) Output Enable Register */ - #define REG_PIOD_ODR (0x400E1414U) /**< \brief (PIOD) Output Disable Register */ - #define REG_PIOD_OSR (0x400E1418U) /**< \brief (PIOD) Output Status Register */ - #define REG_PIOD_IFER (0x400E1420U) /**< \brief (PIOD) Glitch Input Filter Enable Register */ - #define REG_PIOD_IFDR (0x400E1424U) /**< \brief (PIOD) Glitch Input Filter Disable Register */ - #define REG_PIOD_IFSR (0x400E1428U) /**< \brief (PIOD) Glitch Input Filter Status Register */ - #define REG_PIOD_SODR (0x400E1430U) /**< \brief (PIOD) Set Output Data Register */ - #define REG_PIOD_CODR (0x400E1434U) /**< \brief (PIOD) Clear Output Data Register */ - #define REG_PIOD_ODSR (0x400E1438U) /**< \brief (PIOD) Output Data Status Register */ - #define REG_PIOD_PDSR (0x400E143CU) /**< \brief (PIOD) Pin Data Status Register */ - #define REG_PIOD_IER (0x400E1440U) /**< \brief (PIOD) Interrupt Enable Register */ - #define REG_PIOD_IDR (0x400E1444U) /**< \brief (PIOD) Interrupt Disable Register */ - #define REG_PIOD_IMR (0x400E1448U) /**< \brief (PIOD) Interrupt Mask Register */ - #define REG_PIOD_ISR (0x400E144CU) /**< \brief (PIOD) Interrupt Status Register */ - #define REG_PIOD_MDER (0x400E1450U) /**< \brief (PIOD) Multi-driver Enable Register */ - #define REG_PIOD_MDDR (0x400E1454U) /**< \brief (PIOD) Multi-driver Disable Register */ - #define REG_PIOD_MDSR (0x400E1458U) /**< \brief (PIOD) Multi-driver Status Register */ - #define REG_PIOD_PUDR (0x400E1460U) /**< \brief (PIOD) Pull-up Disable Register */ - #define REG_PIOD_PUER (0x400E1464U) /**< \brief (PIOD) Pull-up Enable Register */ - #define REG_PIOD_PUSR (0x400E1468U) /**< \brief (PIOD) Pad Pull-up Status Register */ - #define REG_PIOD_ABCDSR (0x400E1470U) /**< \brief (PIOD) Peripheral Select Register */ - #define REG_PIOD_IFSCDR (0x400E1480U) /**< \brief (PIOD) Input Filter Slow Clock Disable Register */ - #define REG_PIOD_IFSCER (0x400E1484U) /**< \brief (PIOD) Input Filter Slow Clock Enable Register */ - #define REG_PIOD_IFSCSR (0x400E1488U) /**< \brief (PIOD) Input Filter Slow Clock Status Register */ - #define REG_PIOD_SCDR (0x400E148CU) /**< \brief (PIOD) Slow Clock Divider Debouncing Register */ - #define REG_PIOD_PPDDR (0x400E1490U) /**< \brief (PIOD) Pad Pull-down Disable Register */ - #define REG_PIOD_PPDER (0x400E1494U) /**< \brief (PIOD) Pad Pull-down Enable Register */ - #define REG_PIOD_PPDSR (0x400E1498U) /**< \brief (PIOD) Pad Pull-down Status Register */ - #define REG_PIOD_OWER (0x400E14A0U) /**< \brief (PIOD) Output Write Enable */ - #define REG_PIOD_OWDR (0x400E14A4U) /**< \brief (PIOD) Output Write Disable */ - #define REG_PIOD_OWSR (0x400E14A8U) /**< \brief (PIOD) Output Write Status Register */ - #define REG_PIOD_AIMER (0x400E14B0U) /**< \brief (PIOD) Additional Interrupt Modes Enable Register */ - #define REG_PIOD_AIMDR (0x400E14B4U) /**< \brief (PIOD) Additional Interrupt Modes Disable Register */ - #define REG_PIOD_AIMMR (0x400E14B8U) /**< \brief (PIOD) Additional Interrupt Modes Mask Register */ - #define REG_PIOD_ESR (0x400E14C0U) /**< \brief (PIOD) Edge Select Register */ - #define REG_PIOD_LSR (0x400E14C4U) /**< \brief (PIOD) Level Select Register */ - #define REG_PIOD_ELSR (0x400E14C8U) /**< \brief (PIOD) Edge/Level Status Register */ - #define REG_PIOD_FELLSR (0x400E14D0U) /**< \brief (PIOD) Falling Edge/Low-Level Select Register */ - #define REG_PIOD_REHLSR (0x400E14D4U) /**< \brief (PIOD) Rising Edge/High-Level Select Register */ - #define REG_PIOD_FRLHSR (0x400E14D8U) /**< \brief (PIOD) Fall/Rise - Low/High Status Register */ - #define REG_PIOD_LOCKSR (0x400E14E0U) /**< \brief (PIOD) Lock Status */ - #define REG_PIOD_WPMR (0x400E14E4U) /**< \brief (PIOD) Write Protection Mode Register */ - #define REG_PIOD_WPSR (0x400E14E8U) /**< \brief (PIOD) Write Protection Status Register */ - #define REG_PIOD_SCHMITT (0x400E1500U) /**< \brief (PIOD) Schmitt Trigger Register */ - #define REG_PIOD_KER (0x400E1520U) /**< \brief (PIOD) Keypad Controller Enable Register */ - #define REG_PIOD_KRCR (0x400E1524U) /**< \brief (PIOD) Keypad Controller Row Column Register */ - #define REG_PIOD_KDR (0x400E1528U) /**< \brief (PIOD) Keypad Controller Debouncing Register */ - #define REG_PIOD_KIER (0x400E1530U) /**< \brief (PIOD) Keypad Controller Interrupt Enable Register */ - #define REG_PIOD_KIDR (0x400E1534U) /**< \brief (PIOD) Keypad Controller Interrupt Disable Register */ - #define REG_PIOD_KIMR (0x400E1538U) /**< \brief (PIOD) Keypad Controller Interrupt Mask Register */ - #define REG_PIOD_KSR (0x400E153CU) /**< \brief (PIOD) Keypad Controller Status Register */ - #define REG_PIOD_KKPR (0x400E1540U) /**< \brief (PIOD) Keypad Controller Key Press Register */ - #define REG_PIOD_KKRR (0x400E1544U) /**< \brief (PIOD) Keypad Controller Key Release Register */ - #define REG_PIOD_PCMR (0x400E1550U) /**< \brief (PIOD) Parallel Capture Mode Register */ - #define REG_PIOD_PCIER (0x400E1554U) /**< \brief (PIOD) Parallel Capture Interrupt Enable Register */ - #define REG_PIOD_PCIDR (0x400E1558U) /**< \brief (PIOD) Parallel Capture Interrupt Disable Register */ - #define REG_PIOD_PCIMR (0x400E155CU) /**< \brief (PIOD) Parallel Capture Interrupt Mask Register */ - #define REG_PIOD_PCISR (0x400E1560U) /**< \brief (PIOD) Parallel Capture Interrupt Status Register */ - #define REG_PIOD_PCRHR (0x400E1564U) /**< \brief (PIOD) Parallel Capture Reception Holding Register */ -#else - #define REG_PIOD_PER (*(__O uint32_t*)0x400E1400U) /**< \brief (PIOD) PIO Enable Register */ - #define REG_PIOD_PDR (*(__O uint32_t*)0x400E1404U) /**< \brief (PIOD) PIO Disable Register */ - #define REG_PIOD_PSR (*(__I uint32_t*)0x400E1408U) /**< \brief (PIOD) PIO Status Register */ - #define REG_PIOD_OER (*(__O uint32_t*)0x400E1410U) /**< \brief (PIOD) Output Enable Register */ - #define REG_PIOD_ODR (*(__O uint32_t*)0x400E1414U) /**< \brief (PIOD) Output Disable Register */ - #define REG_PIOD_OSR (*(__I uint32_t*)0x400E1418U) /**< \brief (PIOD) Output Status Register */ - #define REG_PIOD_IFER (*(__O uint32_t*)0x400E1420U) /**< \brief (PIOD) Glitch Input Filter Enable Register */ - #define REG_PIOD_IFDR (*(__O uint32_t*)0x400E1424U) /**< \brief (PIOD) Glitch Input Filter Disable Register */ - #define REG_PIOD_IFSR (*(__I uint32_t*)0x400E1428U) /**< \brief (PIOD) Glitch Input Filter Status Register */ - #define REG_PIOD_SODR (*(__O uint32_t*)0x400E1430U) /**< \brief (PIOD) Set Output Data Register */ - #define REG_PIOD_CODR (*(__O uint32_t*)0x400E1434U) /**< \brief (PIOD) Clear Output Data Register */ - #define REG_PIOD_ODSR (*(__IO uint32_t*)0x400E1438U) /**< \brief (PIOD) Output Data Status Register */ - #define REG_PIOD_PDSR (*(__I uint32_t*)0x400E143CU) /**< \brief (PIOD) Pin Data Status Register */ - #define REG_PIOD_IER (*(__O uint32_t*)0x400E1440U) /**< \brief (PIOD) Interrupt Enable Register */ - #define REG_PIOD_IDR (*(__O uint32_t*)0x400E1444U) /**< \brief (PIOD) Interrupt Disable Register */ - #define REG_PIOD_IMR (*(__I uint32_t*)0x400E1448U) /**< \brief (PIOD) Interrupt Mask Register */ - #define REG_PIOD_ISR (*(__I uint32_t*)0x400E144CU) /**< \brief (PIOD) Interrupt Status Register */ - #define REG_PIOD_MDER (*(__O uint32_t*)0x400E1450U) /**< \brief (PIOD) Multi-driver Enable Register */ - #define REG_PIOD_MDDR (*(__O uint32_t*)0x400E1454U) /**< \brief (PIOD) Multi-driver Disable Register */ - #define REG_PIOD_MDSR (*(__I uint32_t*)0x400E1458U) /**< \brief (PIOD) Multi-driver Status Register */ - #define REG_PIOD_PUDR (*(__O uint32_t*)0x400E1460U) /**< \brief (PIOD) Pull-up Disable Register */ - #define REG_PIOD_PUER (*(__O uint32_t*)0x400E1464U) /**< \brief (PIOD) Pull-up Enable Register */ - #define REG_PIOD_PUSR (*(__I uint32_t*)0x400E1468U) /**< \brief (PIOD) Pad Pull-up Status Register */ - #define REG_PIOD_ABCDSR (*(__IO uint32_t*)0x400E1470U) /**< \brief (PIOD) Peripheral Select Register */ - #define REG_PIOD_IFSCDR (*(__O uint32_t*)0x400E1480U) /**< \brief (PIOD) Input Filter Slow Clock Disable Register */ - #define REG_PIOD_IFSCER (*(__O uint32_t*)0x400E1484U) /**< \brief (PIOD) Input Filter Slow Clock Enable Register */ - #define REG_PIOD_IFSCSR (*(__I uint32_t*)0x400E1488U) /**< \brief (PIOD) Input Filter Slow Clock Status Register */ - #define REG_PIOD_SCDR (*(__IO uint32_t*)0x400E148CU) /**< \brief (PIOD) Slow Clock Divider Debouncing Register */ - #define REG_PIOD_PPDDR (*(__O uint32_t*)0x400E1490U) /**< \brief (PIOD) Pad Pull-down Disable Register */ - #define REG_PIOD_PPDER (*(__O uint32_t*)0x400E1494U) /**< \brief (PIOD) Pad Pull-down Enable Register */ - #define REG_PIOD_PPDSR (*(__I uint32_t*)0x400E1498U) /**< \brief (PIOD) Pad Pull-down Status Register */ - #define REG_PIOD_OWER (*(__O uint32_t*)0x400E14A0U) /**< \brief (PIOD) Output Write Enable */ - #define REG_PIOD_OWDR (*(__O uint32_t*)0x400E14A4U) /**< \brief (PIOD) Output Write Disable */ - #define REG_PIOD_OWSR (*(__I uint32_t*)0x400E14A8U) /**< \brief (PIOD) Output Write Status Register */ - #define REG_PIOD_AIMER (*(__O uint32_t*)0x400E14B0U) /**< \brief (PIOD) Additional Interrupt Modes Enable Register */ - #define REG_PIOD_AIMDR (*(__O uint32_t*)0x400E14B4U) /**< \brief (PIOD) Additional Interrupt Modes Disable Register */ - #define REG_PIOD_AIMMR (*(__I uint32_t*)0x400E14B8U) /**< \brief (PIOD) Additional Interrupt Modes Mask Register */ - #define REG_PIOD_ESR (*(__O uint32_t*)0x400E14C0U) /**< \brief (PIOD) Edge Select Register */ - #define REG_PIOD_LSR (*(__O uint32_t*)0x400E14C4U) /**< \brief (PIOD) Level Select Register */ - #define REG_PIOD_ELSR (*(__I uint32_t*)0x400E14C8U) /**< \brief (PIOD) Edge/Level Status Register */ - #define REG_PIOD_FELLSR (*(__O uint32_t*)0x400E14D0U) /**< \brief (PIOD) Falling Edge/Low-Level Select Register */ - #define REG_PIOD_REHLSR (*(__O uint32_t*)0x400E14D4U) /**< \brief (PIOD) Rising Edge/High-Level Select Register */ - #define REG_PIOD_FRLHSR (*(__I uint32_t*)0x400E14D8U) /**< \brief (PIOD) Fall/Rise - Low/High Status Register */ - #define REG_PIOD_LOCKSR (*(__I uint32_t*)0x400E14E0U) /**< \brief (PIOD) Lock Status */ - #define REG_PIOD_WPMR (*(__IO uint32_t*)0x400E14E4U) /**< \brief (PIOD) Write Protection Mode Register */ - #define REG_PIOD_WPSR (*(__I uint32_t*)0x400E14E8U) /**< \brief (PIOD) Write Protection Status Register */ - #define REG_PIOD_SCHMITT (*(__IO uint32_t*)0x400E1500U) /**< \brief (PIOD) Schmitt Trigger Register */ - #define REG_PIOD_KER (*(__IO uint32_t*)0x400E1520U) /**< \brief (PIOD) Keypad Controller Enable Register */ - #define REG_PIOD_KRCR (*(__IO uint32_t*)0x400E1524U) /**< \brief (PIOD) Keypad Controller Row Column Register */ - #define REG_PIOD_KDR (*(__IO uint32_t*)0x400E1528U) /**< \brief (PIOD) Keypad Controller Debouncing Register */ - #define REG_PIOD_KIER (*(__O uint32_t*)0x400E1530U) /**< \brief (PIOD) Keypad Controller Interrupt Enable Register */ - #define REG_PIOD_KIDR (*(__O uint32_t*)0x400E1534U) /**< \brief (PIOD) Keypad Controller Interrupt Disable Register */ - #define REG_PIOD_KIMR (*(__I uint32_t*)0x400E1538U) /**< \brief (PIOD) Keypad Controller Interrupt Mask Register */ - #define REG_PIOD_KSR (*(__I uint32_t*)0x400E153CU) /**< \brief (PIOD) Keypad Controller Status Register */ - #define REG_PIOD_KKPR (*(__I uint32_t*)0x400E1540U) /**< \brief (PIOD) Keypad Controller Key Press Register */ - #define REG_PIOD_KKRR (*(__I uint32_t*)0x400E1544U) /**< \brief (PIOD) Keypad Controller Key Release Register */ - #define REG_PIOD_PCMR (*(__IO uint32_t*)0x400E1550U) /**< \brief (PIOD) Parallel Capture Mode Register */ - #define REG_PIOD_PCIER (*(__O uint32_t*)0x400E1554U) /**< \brief (PIOD) Parallel Capture Interrupt Enable Register */ - #define REG_PIOD_PCIDR (*(__O uint32_t*)0x400E1558U) /**< \brief (PIOD) Parallel Capture Interrupt Disable Register */ - #define REG_PIOD_PCIMR (*(__I uint32_t*)0x400E155CU) /**< \brief (PIOD) Parallel Capture Interrupt Mask Register */ - #define REG_PIOD_PCISR (*(__I uint32_t*)0x400E1560U) /**< \brief (PIOD) Parallel Capture Interrupt Status Register */ - #define REG_PIOD_PCRHR (*(__I uint32_t*)0x400E1564U) /**< \brief (PIOD) Parallel Capture Reception Holding Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_PIOD_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_pioe.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_pioe.h deleted file mode 100644 index c0162332..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_pioe.h +++ /dev/null @@ -1,162 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_PIOE_INSTANCE_ -#define _SAMV71_PIOE_INSTANCE_ - -/* ========== Register definition for PIOE peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_PIOE_PER (0x400E1600U) /**< \brief (PIOE) PIO Enable Register */ - #define REG_PIOE_PDR (0x400E1604U) /**< \brief (PIOE) PIO Disable Register */ - #define REG_PIOE_PSR (0x400E1608U) /**< \brief (PIOE) PIO Status Register */ - #define REG_PIOE_OER (0x400E1610U) /**< \brief (PIOE) Output Enable Register */ - #define REG_PIOE_ODR (0x400E1614U) /**< \brief (PIOE) Output Disable Register */ - #define REG_PIOE_OSR (0x400E1618U) /**< \brief (PIOE) Output Status Register */ - #define REG_PIOE_IFER (0x400E1620U) /**< \brief (PIOE) Glitch Input Filter Enable Register */ - #define REG_PIOE_IFDR (0x400E1624U) /**< \brief (PIOE) Glitch Input Filter Disable Register */ - #define REG_PIOE_IFSR (0x400E1628U) /**< \brief (PIOE) Glitch Input Filter Status Register */ - #define REG_PIOE_SODR (0x400E1630U) /**< \brief (PIOE) Set Output Data Register */ - #define REG_PIOE_CODR (0x400E1634U) /**< \brief (PIOE) Clear Output Data Register */ - #define REG_PIOE_ODSR (0x400E1638U) /**< \brief (PIOE) Output Data Status Register */ - #define REG_PIOE_PDSR (0x400E163CU) /**< \brief (PIOE) Pin Data Status Register */ - #define REG_PIOE_IER (0x400E1640U) /**< \brief (PIOE) Interrupt Enable Register */ - #define REG_PIOE_IDR (0x400E1644U) /**< \brief (PIOE) Interrupt Disable Register */ - #define REG_PIOE_IMR (0x400E1648U) /**< \brief (PIOE) Interrupt Mask Register */ - #define REG_PIOE_ISR (0x400E164CU) /**< \brief (PIOE) Interrupt Status Register */ - #define REG_PIOE_MDER (0x400E1650U) /**< \brief (PIOE) Multi-driver Enable Register */ - #define REG_PIOE_MDDR (0x400E1654U) /**< \brief (PIOE) Multi-driver Disable Register */ - #define REG_PIOE_MDSR (0x400E1658U) /**< \brief (PIOE) Multi-driver Status Register */ - #define REG_PIOE_PUDR (0x400E1660U) /**< \brief (PIOE) Pull-up Disable Register */ - #define REG_PIOE_PUER (0x400E1664U) /**< \brief (PIOE) Pull-up Enable Register */ - #define REG_PIOE_PUSR (0x400E1668U) /**< \brief (PIOE) Pad Pull-up Status Register */ - #define REG_PIOE_ABCDSR (0x400E1670U) /**< \brief (PIOE) Peripheral Select Register */ - #define REG_PIOE_IFSCDR (0x400E1680U) /**< \brief (PIOE) Input Filter Slow Clock Disable Register */ - #define REG_PIOE_IFSCER (0x400E1684U) /**< \brief (PIOE) Input Filter Slow Clock Enable Register */ - #define REG_PIOE_IFSCSR (0x400E1688U) /**< \brief (PIOE) Input Filter Slow Clock Status Register */ - #define REG_PIOE_SCDR (0x400E168CU) /**< \brief (PIOE) Slow Clock Divider Debouncing Register */ - #define REG_PIOE_PPDDR (0x400E1690U) /**< \brief (PIOE) Pad Pull-down Disable Register */ - #define REG_PIOE_PPDER (0x400E1694U) /**< \brief (PIOE) Pad Pull-down Enable Register */ - #define REG_PIOE_PPDSR (0x400E1698U) /**< \brief (PIOE) Pad Pull-down Status Register */ - #define REG_PIOE_OWER (0x400E16A0U) /**< \brief (PIOE) Output Write Enable */ - #define REG_PIOE_OWDR (0x400E16A4U) /**< \brief (PIOE) Output Write Disable */ - #define REG_PIOE_OWSR (0x400E16A8U) /**< \brief (PIOE) Output Write Status Register */ - #define REG_PIOE_AIMER (0x400E16B0U) /**< \brief (PIOE) Additional Interrupt Modes Enable Register */ - #define REG_PIOE_AIMDR (0x400E16B4U) /**< \brief (PIOE) Additional Interrupt Modes Disable Register */ - #define REG_PIOE_AIMMR (0x400E16B8U) /**< \brief (PIOE) Additional Interrupt Modes Mask Register */ - #define REG_PIOE_ESR (0x400E16C0U) /**< \brief (PIOE) Edge Select Register */ - #define REG_PIOE_LSR (0x400E16C4U) /**< \brief (PIOE) Level Select Register */ - #define REG_PIOE_ELSR (0x400E16C8U) /**< \brief (PIOE) Edge/Level Status Register */ - #define REG_PIOE_FELLSR (0x400E16D0U) /**< \brief (PIOE) Falling Edge/Low-Level Select Register */ - #define REG_PIOE_REHLSR (0x400E16D4U) /**< \brief (PIOE) Rising Edge/High-Level Select Register */ - #define REG_PIOE_FRLHSR (0x400E16D8U) /**< \brief (PIOE) Fall/Rise - Low/High Status Register */ - #define REG_PIOE_LOCKSR (0x400E16E0U) /**< \brief (PIOE) Lock Status */ - #define REG_PIOE_WPMR (0x400E16E4U) /**< \brief (PIOE) Write Protection Mode Register */ - #define REG_PIOE_WPSR (0x400E16E8U) /**< \brief (PIOE) Write Protection Status Register */ - #define REG_PIOE_SCHMITT (0x400E1700U) /**< \brief (PIOE) Schmitt Trigger Register */ - #define REG_PIOE_KER (0x400E1720U) /**< \brief (PIOE) Keypad Controller Enable Register */ - #define REG_PIOE_KRCR (0x400E1724U) /**< \brief (PIOE) Keypad Controller Row Column Register */ - #define REG_PIOE_KDR (0x400E1728U) /**< \brief (PIOE) Keypad Controller Debouncing Register */ - #define REG_PIOE_KIER (0x400E1730U) /**< \brief (PIOE) Keypad Controller Interrupt Enable Register */ - #define REG_PIOE_KIDR (0x400E1734U) /**< \brief (PIOE) Keypad Controller Interrupt Disable Register */ - #define REG_PIOE_KIMR (0x400E1738U) /**< \brief (PIOE) Keypad Controller Interrupt Mask Register */ - #define REG_PIOE_KSR (0x400E173CU) /**< \brief (PIOE) Keypad Controller Status Register */ - #define REG_PIOE_KKPR (0x400E1740U) /**< \brief (PIOE) Keypad Controller Key Press Register */ - #define REG_PIOE_KKRR (0x400E1744U) /**< \brief (PIOE) Keypad Controller Key Release Register */ - #define REG_PIOE_PCMR (0x400E1750U) /**< \brief (PIOE) Parallel Capture Mode Register */ - #define REG_PIOE_PCIER (0x400E1754U) /**< \brief (PIOE) Parallel Capture Interrupt Enable Register */ - #define REG_PIOE_PCIDR (0x400E1758U) /**< \brief (PIOE) Parallel Capture Interrupt Disable Register */ - #define REG_PIOE_PCIMR (0x400E175CU) /**< \brief (PIOE) Parallel Capture Interrupt Mask Register */ - #define REG_PIOE_PCISR (0x400E1760U) /**< \brief (PIOE) Parallel Capture Interrupt Status Register */ - #define REG_PIOE_PCRHR (0x400E1764U) /**< \brief (PIOE) Parallel Capture Reception Holding Register */ -#else - #define REG_PIOE_PER (*(__O uint32_t*)0x400E1600U) /**< \brief (PIOE) PIO Enable Register */ - #define REG_PIOE_PDR (*(__O uint32_t*)0x400E1604U) /**< \brief (PIOE) PIO Disable Register */ - #define REG_PIOE_PSR (*(__I uint32_t*)0x400E1608U) /**< \brief (PIOE) PIO Status Register */ - #define REG_PIOE_OER (*(__O uint32_t*)0x400E1610U) /**< \brief (PIOE) Output Enable Register */ - #define REG_PIOE_ODR (*(__O uint32_t*)0x400E1614U) /**< \brief (PIOE) Output Disable Register */ - #define REG_PIOE_OSR (*(__I uint32_t*)0x400E1618U) /**< \brief (PIOE) Output Status Register */ - #define REG_PIOE_IFER (*(__O uint32_t*)0x400E1620U) /**< \brief (PIOE) Glitch Input Filter Enable Register */ - #define REG_PIOE_IFDR (*(__O uint32_t*)0x400E1624U) /**< \brief (PIOE) Glitch Input Filter Disable Register */ - #define REG_PIOE_IFSR (*(__I uint32_t*)0x400E1628U) /**< \brief (PIOE) Glitch Input Filter Status Register */ - #define REG_PIOE_SODR (*(__O uint32_t*)0x400E1630U) /**< \brief (PIOE) Set Output Data Register */ - #define REG_PIOE_CODR (*(__O uint32_t*)0x400E1634U) /**< \brief (PIOE) Clear Output Data Register */ - #define REG_PIOE_ODSR (*(__IO uint32_t*)0x400E1638U) /**< \brief (PIOE) Output Data Status Register */ - #define REG_PIOE_PDSR (*(__I uint32_t*)0x400E163CU) /**< \brief (PIOE) Pin Data Status Register */ - #define REG_PIOE_IER (*(__O uint32_t*)0x400E1640U) /**< \brief (PIOE) Interrupt Enable Register */ - #define REG_PIOE_IDR (*(__O uint32_t*)0x400E1644U) /**< \brief (PIOE) Interrupt Disable Register */ - #define REG_PIOE_IMR (*(__I uint32_t*)0x400E1648U) /**< \brief (PIOE) Interrupt Mask Register */ - #define REG_PIOE_ISR (*(__I uint32_t*)0x400E164CU) /**< \brief (PIOE) Interrupt Status Register */ - #define REG_PIOE_MDER (*(__O uint32_t*)0x400E1650U) /**< \brief (PIOE) Multi-driver Enable Register */ - #define REG_PIOE_MDDR (*(__O uint32_t*)0x400E1654U) /**< \brief (PIOE) Multi-driver Disable Register */ - #define REG_PIOE_MDSR (*(__I uint32_t*)0x400E1658U) /**< \brief (PIOE) Multi-driver Status Register */ - #define REG_PIOE_PUDR (*(__O uint32_t*)0x400E1660U) /**< \brief (PIOE) Pull-up Disable Register */ - #define REG_PIOE_PUER (*(__O uint32_t*)0x400E1664U) /**< \brief (PIOE) Pull-up Enable Register */ - #define REG_PIOE_PUSR (*(__I uint32_t*)0x400E1668U) /**< \brief (PIOE) Pad Pull-up Status Register */ - #define REG_PIOE_ABCDSR (*(__IO uint32_t*)0x400E1670U) /**< \brief (PIOE) Peripheral Select Register */ - #define REG_PIOE_IFSCDR (*(__O uint32_t*)0x400E1680U) /**< \brief (PIOE) Input Filter Slow Clock Disable Register */ - #define REG_PIOE_IFSCER (*(__O uint32_t*)0x400E1684U) /**< \brief (PIOE) Input Filter Slow Clock Enable Register */ - #define REG_PIOE_IFSCSR (*(__I uint32_t*)0x400E1688U) /**< \brief (PIOE) Input Filter Slow Clock Status Register */ - #define REG_PIOE_SCDR (*(__IO uint32_t*)0x400E168CU) /**< \brief (PIOE) Slow Clock Divider Debouncing Register */ - #define REG_PIOE_PPDDR (*(__O uint32_t*)0x400E1690U) /**< \brief (PIOE) Pad Pull-down Disable Register */ - #define REG_PIOE_PPDER (*(__O uint32_t*)0x400E1694U) /**< \brief (PIOE) Pad Pull-down Enable Register */ - #define REG_PIOE_PPDSR (*(__I uint32_t*)0x400E1698U) /**< \brief (PIOE) Pad Pull-down Status Register */ - #define REG_PIOE_OWER (*(__O uint32_t*)0x400E16A0U) /**< \brief (PIOE) Output Write Enable */ - #define REG_PIOE_OWDR (*(__O uint32_t*)0x400E16A4U) /**< \brief (PIOE) Output Write Disable */ - #define REG_PIOE_OWSR (*(__I uint32_t*)0x400E16A8U) /**< \brief (PIOE) Output Write Status Register */ - #define REG_PIOE_AIMER (*(__O uint32_t*)0x400E16B0U) /**< \brief (PIOE) Additional Interrupt Modes Enable Register */ - #define REG_PIOE_AIMDR (*(__O uint32_t*)0x400E16B4U) /**< \brief (PIOE) Additional Interrupt Modes Disable Register */ - #define REG_PIOE_AIMMR (*(__I uint32_t*)0x400E16B8U) /**< \brief (PIOE) Additional Interrupt Modes Mask Register */ - #define REG_PIOE_ESR (*(__O uint32_t*)0x400E16C0U) /**< \brief (PIOE) Edge Select Register */ - #define REG_PIOE_LSR (*(__O uint32_t*)0x400E16C4U) /**< \brief (PIOE) Level Select Register */ - #define REG_PIOE_ELSR (*(__I uint32_t*)0x400E16C8U) /**< \brief (PIOE) Edge/Level Status Register */ - #define REG_PIOE_FELLSR (*(__O uint32_t*)0x400E16D0U) /**< \brief (PIOE) Falling Edge/Low-Level Select Register */ - #define REG_PIOE_REHLSR (*(__O uint32_t*)0x400E16D4U) /**< \brief (PIOE) Rising Edge/High-Level Select Register */ - #define REG_PIOE_FRLHSR (*(__I uint32_t*)0x400E16D8U) /**< \brief (PIOE) Fall/Rise - Low/High Status Register */ - #define REG_PIOE_LOCKSR (*(__I uint32_t*)0x400E16E0U) /**< \brief (PIOE) Lock Status */ - #define REG_PIOE_WPMR (*(__IO uint32_t*)0x400E16E4U) /**< \brief (PIOE) Write Protection Mode Register */ - #define REG_PIOE_WPSR (*(__I uint32_t*)0x400E16E8U) /**< \brief (PIOE) Write Protection Status Register */ - #define REG_PIOE_SCHMITT (*(__IO uint32_t*)0x400E1700U) /**< \brief (PIOE) Schmitt Trigger Register */ - #define REG_PIOE_KER (*(__IO uint32_t*)0x400E1720U) /**< \brief (PIOE) Keypad Controller Enable Register */ - #define REG_PIOE_KRCR (*(__IO uint32_t*)0x400E1724U) /**< \brief (PIOE) Keypad Controller Row Column Register */ - #define REG_PIOE_KDR (*(__IO uint32_t*)0x400E1728U) /**< \brief (PIOE) Keypad Controller Debouncing Register */ - #define REG_PIOE_KIER (*(__O uint32_t*)0x400E1730U) /**< \brief (PIOE) Keypad Controller Interrupt Enable Register */ - #define REG_PIOE_KIDR (*(__O uint32_t*)0x400E1734U) /**< \brief (PIOE) Keypad Controller Interrupt Disable Register */ - #define REG_PIOE_KIMR (*(__I uint32_t*)0x400E1738U) /**< \brief (PIOE) Keypad Controller Interrupt Mask Register */ - #define REG_PIOE_KSR (*(__I uint32_t*)0x400E173CU) /**< \brief (PIOE) Keypad Controller Status Register */ - #define REG_PIOE_KKPR (*(__I uint32_t*)0x400E1740U) /**< \brief (PIOE) Keypad Controller Key Press Register */ - #define REG_PIOE_KKRR (*(__I uint32_t*)0x400E1744U) /**< \brief (PIOE) Keypad Controller Key Release Register */ - #define REG_PIOE_PCMR (*(__IO uint32_t*)0x400E1750U) /**< \brief (PIOE) Parallel Capture Mode Register */ - #define REG_PIOE_PCIER (*(__O uint32_t*)0x400E1754U) /**< \brief (PIOE) Parallel Capture Interrupt Enable Register */ - #define REG_PIOE_PCIDR (*(__O uint32_t*)0x400E1758U) /**< \brief (PIOE) Parallel Capture Interrupt Disable Register */ - #define REG_PIOE_PCIMR (*(__I uint32_t*)0x400E175CU) /**< \brief (PIOE) Parallel Capture Interrupt Mask Register */ - #define REG_PIOE_PCISR (*(__I uint32_t*)0x400E1760U) /**< \brief (PIOE) Parallel Capture Interrupt Status Register */ - #define REG_PIOE_PCRHR (*(__I uint32_t*)0x400E1764U) /**< \brief (PIOE) Parallel Capture Reception Holding Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_PIOE_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_pmc.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_pmc.h deleted file mode 100644 index 56723b35..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_pmc.h +++ /dev/null @@ -1,110 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_PMC_INSTANCE_ -#define _SAMV71_PMC_INSTANCE_ - -/* ========== Register definition for PMC peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_PMC_SCER (0x400E0600U) /**< \brief (PMC) System Clock Enable Register */ - #define REG_PMC_SCDR (0x400E0604U) /**< \brief (PMC) System Clock Disable Register */ - #define REG_PMC_SCSR (0x400E0608U) /**< \brief (PMC) System Clock Status Register */ - #define REG_PMC_PCER0 (0x400E0610U) /**< \brief (PMC) Peripheral Clock Enable Register 0 */ - #define REG_PMC_PCDR0 (0x400E0614U) /**< \brief (PMC) Peripheral Clock Disable Register 0 */ - #define REG_PMC_PCSR0 (0x400E0618U) /**< \brief (PMC) Peripheral Clock Status Register 0 */ - #define REG_CKGR_UCKR (0x400E061CU) /**< \brief (PMC) UTMI Clock Register */ - #define REG_CKGR_MOR (0x400E0620U) /**< \brief (PMC) Main Oscillator Register */ - #define REG_CKGR_MCFR (0x400E0624U) /**< \brief (PMC) Main Clock Frequency Register */ - #define REG_CKGR_PLLAR (0x400E0628U) /**< \brief (PMC) PLLA Register */ - #define REG_PMC_MCKR (0x400E0630U) /**< \brief (PMC) Master Clock Register */ - #define REG_PMC_USB (0x400E0638U) /**< \brief (PMC) USB Clock Register */ - #define REG_PMC_PCK (0x400E0640U) /**< \brief (PMC) Programmable Clock 0 Register */ - #define REG_PMC_IER (0x400E0660U) /**< \brief (PMC) Interrupt Enable Register */ - #define REG_PMC_IDR (0x400E0664U) /**< \brief (PMC) Interrupt Disable Register */ - #define REG_PMC_SR (0x400E0668U) /**< \brief (PMC) Status Register */ - #define REG_PMC_IMR (0x400E066CU) /**< \brief (PMC) Interrupt Mask Register */ - #define REG_PMC_FSMR (0x400E0670U) /**< \brief (PMC) Fast Startup Mode Register */ - #define REG_PMC_FSPR (0x400E0674U) /**< \brief (PMC) Fast Startup Polarity Register */ - #define REG_PMC_FOCR (0x400E0678U) /**< \brief (PMC) Fault Output Clear Register */ - #define REG_PMC_WPMR (0x400E06E4U) /**< \brief (PMC) Write Protection Mode Register */ - #define REG_PMC_WPSR (0x400E06E8U) /**< \brief (PMC) Write Protection Status Register */ - #define REG_PMC_PCER1 (0x400E0700U) /**< \brief (PMC) Peripheral Clock Enable Register 1 */ - #define REG_PMC_PCDR1 (0x400E0704U) /**< \brief (PMC) Peripheral Clock Disable Register 1 */ - #define REG_PMC_PCSR1 (0x400E0708U) /**< \brief (PMC) Peripheral Clock Status Register 1 */ - #define REG_PMC_PCR (0x400E070CU) /**< \brief (PMC) Peripheral Control Register */ - #define REG_PMC_OCR (0x400E0710U) /**< \brief (PMC) Oscillator Calibration Register */ - #define REG_PMC_SLPWK_ER0 (0x400E0714U) /**< \brief (PMC) SleepWalking Enable Register 0 */ - #define REG_PMC_SLPWK_DR0 (0x400E0718U) /**< \brief (PMC) SleepWalking Disable Register 0 */ - #define REG_PMC_SLPWK_SR0 (0x400E071CU) /**< \brief (PMC) SleepWalking Status Register 0 */ - #define REG_PMC_SLPWK_ASR0 (0x400E0720U) /**< \brief (PMC) SleepWalking Activity Status Register 0 */ - #define REG_PMC_SLPWK_ER1 (0x400E0734U) /**< \brief (PMC) SleepWalking Enable Register 1 */ - #define REG_PMC_SLPWK_DR1 (0x400E0738U) /**< \brief (PMC) SleepWalking Disable Register 1 */ - #define REG_PMC_SLPWK_SR1 (0x400E073CU) /**< \brief (PMC) SleepWalking Status Register 1 */ - #define REG_PMC_SLPWK_ASR1 (0x400E0740U) /**< \brief (PMC) SleepWalking Activity Status Register 1 */ - #define REG_PMC_SLPWK_AIPR (0x400E0744U) /**< \brief (PMC) SleepWalking Activity In Progress Register */ -#else - #define REG_PMC_SCER (*(__O uint32_t*)0x400E0600U) /**< \brief (PMC) System Clock Enable Register */ - #define REG_PMC_SCDR (*(__O uint32_t*)0x400E0604U) /**< \brief (PMC) System Clock Disable Register */ - #define REG_PMC_SCSR (*(__I uint32_t*)0x400E0608U) /**< \brief (PMC) System Clock Status Register */ - #define REG_PMC_PCER0 (*(__O uint32_t*)0x400E0610U) /**< \brief (PMC) Peripheral Clock Enable Register 0 */ - #define REG_PMC_PCDR0 (*(__O uint32_t*)0x400E0614U) /**< \brief (PMC) Peripheral Clock Disable Register 0 */ - #define REG_PMC_PCSR0 (*(__I uint32_t*)0x400E0618U) /**< \brief (PMC) Peripheral Clock Status Register 0 */ - #define REG_CKGR_UCKR (*(__IO uint32_t*)0x400E061CU) /**< \brief (PMC) UTMI Clock Register */ - #define REG_CKGR_MOR (*(__IO uint32_t*)0x400E0620U) /**< \brief (PMC) Main Oscillator Register */ - #define REG_CKGR_MCFR (*(__IO uint32_t*)0x400E0624U) /**< \brief (PMC) Main Clock Frequency Register */ - #define REG_CKGR_PLLAR (*(__IO uint32_t*)0x400E0628U) /**< \brief (PMC) PLLA Register */ - #define REG_PMC_MCKR (*(__IO uint32_t*)0x400E0630U) /**< \brief (PMC) Master Clock Register */ - #define REG_PMC_USB (*(__IO uint32_t*)0x400E0638U) /**< \brief (PMC) USB Clock Register */ - #define REG_PMC_PCK (*(__IO uint32_t*)0x400E0640U) /**< \brief (PMC) Programmable Clock 0 Register */ - #define REG_PMC_IER (*(__O uint32_t*)0x400E0660U) /**< \brief (PMC) Interrupt Enable Register */ - #define REG_PMC_IDR (*(__O uint32_t*)0x400E0664U) /**< \brief (PMC) Interrupt Disable Register */ - #define REG_PMC_SR (*(__I uint32_t*)0x400E0668U) /**< \brief (PMC) Status Register */ - #define REG_PMC_IMR (*(__I uint32_t*)0x400E066CU) /**< \brief (PMC) Interrupt Mask Register */ - #define REG_PMC_FSMR (*(__IO uint32_t*)0x400E0670U) /**< \brief (PMC) Fast Startup Mode Register */ - #define REG_PMC_FSPR (*(__IO uint32_t*)0x400E0674U) /**< \brief (PMC) Fast Startup Polarity Register */ - #define REG_PMC_FOCR (*(__O uint32_t*)0x400E0678U) /**< \brief (PMC) Fault Output Clear Register */ - #define REG_PMC_WPMR (*(__IO uint32_t*)0x400E06E4U) /**< \brief (PMC) Write Protection Mode Register */ - #define REG_PMC_WPSR (*(__I uint32_t*)0x400E06E8U) /**< \brief (PMC) Write Protection Status Register */ - #define REG_PMC_PCER1 (*(__O uint32_t*)0x400E0700U) /**< \brief (PMC) Peripheral Clock Enable Register 1 */ - #define REG_PMC_PCDR1 (*(__O uint32_t*)0x400E0704U) /**< \brief (PMC) Peripheral Clock Disable Register 1 */ - #define REG_PMC_PCSR1 (*(__I uint32_t*)0x400E0708U) /**< \brief (PMC) Peripheral Clock Status Register 1 */ - #define REG_PMC_PCR (*(__IO uint32_t*)0x400E070CU) /**< \brief (PMC) Peripheral Control Register */ - #define REG_PMC_OCR (*(__IO uint32_t*)0x400E0710U) /**< \brief (PMC) Oscillator Calibration Register */ - #define REG_PMC_SLPWK_ER0 (*(__O uint32_t*)0x400E0714U) /**< \brief (PMC) SleepWalking Enable Register 0 */ - #define REG_PMC_SLPWK_DR0 (*(__O uint32_t*)0x400E0718U) /**< \brief (PMC) SleepWalking Disable Register 0 */ - #define REG_PMC_SLPWK_SR0 (*(__I uint32_t*)0x400E071CU) /**< \brief (PMC) SleepWalking Status Register 0 */ - #define REG_PMC_SLPWK_ASR0 (*(__I uint32_t*)0x400E0720U) /**< \brief (PMC) SleepWalking Activity Status Register 0 */ - #define REG_PMC_SLPWK_ER1 (*(__O uint32_t*)0x400E0734U) /**< \brief (PMC) SleepWalking Enable Register 1 */ - #define REG_PMC_SLPWK_DR1 (*(__O uint32_t*)0x400E0738U) /**< \brief (PMC) SleepWalking Disable Register 1 */ - #define REG_PMC_SLPWK_SR1 (*(__I uint32_t*)0x400E073CU) /**< \brief (PMC) SleepWalking Status Register 1 */ - #define REG_PMC_SLPWK_ASR1 (*(__I uint32_t*)0x400E0740U) /**< \brief (PMC) SleepWalking Activity Status Register 1 */ - #define REG_PMC_SLPWK_AIPR (*(__I uint32_t*)0x400E0744U) /**< \brief (PMC) SleepWalking Activity In Progress Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_PMC_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_pwm0.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_pwm0.h deleted file mode 100644 index a0e6ee19..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_pwm0.h +++ /dev/null @@ -1,260 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_PWM0_INSTANCE_ -#define _SAMV71_PWM0_INSTANCE_ - -/* ========== Register definition for PWM0 peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_PWM0_CLK (0x40020000U) /**< \brief (PWM0) PWM Clock Register */ - #define REG_PWM0_ENA (0x40020004U) /**< \brief (PWM0) PWM Enable Register */ - #define REG_PWM0_DIS (0x40020008U) /**< \brief (PWM0) PWM Disable Register */ - #define REG_PWM0_SR (0x4002000CU) /**< \brief (PWM0) PWM Status Register */ - #define REG_PWM0_IER1 (0x40020010U) /**< \brief (PWM0) PWM Interrupt Enable Register 1 */ - #define REG_PWM0_IDR1 (0x40020014U) /**< \brief (PWM0) PWM Interrupt Disable Register 1 */ - #define REG_PWM0_IMR1 (0x40020018U) /**< \brief (PWM0) PWM Interrupt Mask Register 1 */ - #define REG_PWM0_ISR1 (0x4002001CU) /**< \brief (PWM0) PWM Interrupt Status Register 1 */ - #define REG_PWM0_SCM (0x40020020U) /**< \brief (PWM0) PWM Sync Channels Mode Register */ - #define REG_PWM0_DMAR (0x40020024U) /**< \brief (PWM0) PWM DMA Register */ - #define REG_PWM0_SCUC (0x40020028U) /**< \brief (PWM0) PWM Sync Channels Update Control Register */ - #define REG_PWM0_SCUP (0x4002002CU) /**< \brief (PWM0) PWM Sync Channels Update Period Register */ - #define REG_PWM0_SCUPUPD (0x40020030U) /**< \brief (PWM0) PWM Sync Channels Update Period Update Register */ - #define REG_PWM0_IER2 (0x40020034U) /**< \brief (PWM0) PWM Interrupt Enable Register 2 */ - #define REG_PWM0_IDR2 (0x40020038U) /**< \brief (PWM0) PWM Interrupt Disable Register 2 */ - #define REG_PWM0_IMR2 (0x4002003CU) /**< \brief (PWM0) PWM Interrupt Mask Register 2 */ - #define REG_PWM0_ISR2 (0x40020040U) /**< \brief (PWM0) PWM Interrupt Status Register 2 */ - #define REG_PWM0_OOV (0x40020044U) /**< \brief (PWM0) PWM Output Override Value Register */ - #define REG_PWM0_OS (0x40020048U) /**< \brief (PWM0) PWM Output Selection Register */ - #define REG_PWM0_OSS (0x4002004CU) /**< \brief (PWM0) PWM Output Selection Set Register */ - #define REG_PWM0_OSC (0x40020050U) /**< \brief (PWM0) PWM Output Selection Clear Register */ - #define REG_PWM0_OSSUPD (0x40020054U) /**< \brief (PWM0) PWM Output Selection Set Update Register */ - #define REG_PWM0_OSCUPD (0x40020058U) /**< \brief (PWM0) PWM Output Selection Clear Update Register */ - #define REG_PWM0_FMR (0x4002005CU) /**< \brief (PWM0) PWM Fault Mode Register */ - #define REG_PWM0_FSR (0x40020060U) /**< \brief (PWM0) PWM Fault Status Register */ - #define REG_PWM0_FCR (0x40020064U) /**< \brief (PWM0) PWM Fault Clear Register */ - #define REG_PWM0_FPV1 (0x40020068U) /**< \brief (PWM0) PWM Fault Protection Value Register 1 */ - #define REG_PWM0_FPE (0x4002006CU) /**< \brief (PWM0) PWM Fault Protection Enable Register */ - #define REG_PWM0_ELMR (0x4002007CU) /**< \brief (PWM0) PWM Event Line 0 Mode Register */ - #define REG_PWM0_SSPR (0x400200A0U) /**< \brief (PWM0) PWM Spread Spectrum Register */ - #define REG_PWM0_SSPUP (0x400200A4U) /**< \brief (PWM0) PWM Spread Spectrum Update Register */ - #define REG_PWM0_SMMR (0x400200B0U) /**< \brief (PWM0) PWM Stepper Motor Mode Register */ - #define REG_PWM0_FPV2 (0x400200C0U) /**< \brief (PWM0) PWM Fault Protection Value 2 Register */ - #define REG_PWM0_WPCR (0x400200E4U) /**< \brief (PWM0) PWM Write Protection Control Register */ - #define REG_PWM0_WPSR (0x400200E8U) /**< \brief (PWM0) PWM Write Protection Status Register */ - #define REG_PWM0_CMPV0 (0x40020130U) /**< \brief (PWM0) PWM Comparison 0 Value Register */ - #define REG_PWM0_CMPVUPD0 (0x40020134U) /**< \brief (PWM0) PWM Comparison 0 Value Update Register */ - #define REG_PWM0_CMPM0 (0x40020138U) /**< \brief (PWM0) PWM Comparison 0 Mode Register */ - #define REG_PWM0_CMPMUPD0 (0x4002013CU) /**< \brief (PWM0) PWM Comparison 0 Mode Update Register */ - #define REG_PWM0_CMPV1 (0x40020140U) /**< \brief (PWM0) PWM Comparison 1 Value Register */ - #define REG_PWM0_CMPVUPD1 (0x40020144U) /**< \brief (PWM0) PWM Comparison 1 Value Update Register */ - #define REG_PWM0_CMPM1 (0x40020148U) /**< \brief (PWM0) PWM Comparison 1 Mode Register */ - #define REG_PWM0_CMPMUPD1 (0x4002014CU) /**< \brief (PWM0) PWM Comparison 1 Mode Update Register */ - #define REG_PWM0_CMPV2 (0x40020150U) /**< \brief (PWM0) PWM Comparison 2 Value Register */ - #define REG_PWM0_CMPVUPD2 (0x40020154U) /**< \brief (PWM0) PWM Comparison 2 Value Update Register */ - #define REG_PWM0_CMPM2 (0x40020158U) /**< \brief (PWM0) PWM Comparison 2 Mode Register */ - #define REG_PWM0_CMPMUPD2 (0x4002015CU) /**< \brief (PWM0) PWM Comparison 2 Mode Update Register */ - #define REG_PWM0_CMPV3 (0x40020160U) /**< \brief (PWM0) PWM Comparison 3 Value Register */ - #define REG_PWM0_CMPVUPD3 (0x40020164U) /**< \brief (PWM0) PWM Comparison 3 Value Update Register */ - #define REG_PWM0_CMPM3 (0x40020168U) /**< \brief (PWM0) PWM Comparison 3 Mode Register */ - #define REG_PWM0_CMPMUPD3 (0x4002016CU) /**< \brief (PWM0) PWM Comparison 3 Mode Update Register */ - #define REG_PWM0_CMPV4 (0x40020170U) /**< \brief (PWM0) PWM Comparison 4 Value Register */ - #define REG_PWM0_CMPVUPD4 (0x40020174U) /**< \brief (PWM0) PWM Comparison 4 Value Update Register */ - #define REG_PWM0_CMPM4 (0x40020178U) /**< \brief (PWM0) PWM Comparison 4 Mode Register */ - #define REG_PWM0_CMPMUPD4 (0x4002017CU) /**< \brief (PWM0) PWM Comparison 4 Mode Update Register */ - #define REG_PWM0_CMPV5 (0x40020180U) /**< \brief (PWM0) PWM Comparison 5 Value Register */ - #define REG_PWM0_CMPVUPD5 (0x40020184U) /**< \brief (PWM0) PWM Comparison 5 Value Update Register */ - #define REG_PWM0_CMPM5 (0x40020188U) /**< \brief (PWM0) PWM Comparison 5 Mode Register */ - #define REG_PWM0_CMPMUPD5 (0x4002018CU) /**< \brief (PWM0) PWM Comparison 5 Mode Update Register */ - #define REG_PWM0_CMPV6 (0x40020190U) /**< \brief (PWM0) PWM Comparison 6 Value Register */ - #define REG_PWM0_CMPVUPD6 (0x40020194U) /**< \brief (PWM0) PWM Comparison 6 Value Update Register */ - #define REG_PWM0_CMPM6 (0x40020198U) /**< \brief (PWM0) PWM Comparison 6 Mode Register */ - #define REG_PWM0_CMPMUPD6 (0x4002019CU) /**< \brief (PWM0) PWM Comparison 6 Mode Update Register */ - #define REG_PWM0_CMPV7 (0x400201A0U) /**< \brief (PWM0) PWM Comparison 7 Value Register */ - #define REG_PWM0_CMPVUPD7 (0x400201A4U) /**< \brief (PWM0) PWM Comparison 7 Value Update Register */ - #define REG_PWM0_CMPM7 (0x400201A8U) /**< \brief (PWM0) PWM Comparison 7 Mode Register */ - #define REG_PWM0_CMPMUPD7 (0x400201ACU) /**< \brief (PWM0) PWM Comparison 7 Mode Update Register */ - #define REG_PWM0_CMR0 (0x40020200U) /**< \brief (PWM0) PWM Channel Mode Register (ch_num = 0) */ - #define REG_PWM0_CDTY0 (0x40020204U) /**< \brief (PWM0) PWM Channel Duty Cycle Register (ch_num = 0) */ - #define REG_PWM0_CDTYUPD0 (0x40020208U) /**< \brief (PWM0) PWM Channel Duty Cycle Update Register (ch_num = 0) */ - #define REG_PWM0_CPRD0 (0x4002020CU) /**< \brief (PWM0) PWM Channel Period Register (ch_num = 0) */ - #define REG_PWM0_CPRDUPD0 (0x40020210U) /**< \brief (PWM0) PWM Channel Period Update Register (ch_num = 0) */ - #define REG_PWM0_CCNT0 (0x40020214U) /**< \brief (PWM0) PWM Channel Counter Register (ch_num = 0) */ - #define REG_PWM0_DT0 (0x40020218U) /**< \brief (PWM0) PWM Channel Dead Time Register (ch_num = 0) */ - #define REG_PWM0_DTUPD0 (0x4002021CU) /**< \brief (PWM0) PWM Channel Dead Time Update Register (ch_num = 0) */ - #define REG_PWM0_CMR1 (0x40020220U) /**< \brief (PWM0) PWM Channel Mode Register (ch_num = 1) */ - #define REG_PWM0_CDTY1 (0x40020224U) /**< \brief (PWM0) PWM Channel Duty Cycle Register (ch_num = 1) */ - #define REG_PWM0_CDTYUPD1 (0x40020228U) /**< \brief (PWM0) PWM Channel Duty Cycle Update Register (ch_num = 1) */ - #define REG_PWM0_CPRD1 (0x4002022CU) /**< \brief (PWM0) PWM Channel Period Register (ch_num = 1) */ - #define REG_PWM0_CPRDUPD1 (0x40020230U) /**< \brief (PWM0) PWM Channel Period Update Register (ch_num = 1) */ - #define REG_PWM0_CCNT1 (0x40020234U) /**< \brief (PWM0) PWM Channel Counter Register (ch_num = 1) */ - #define REG_PWM0_DT1 (0x40020238U) /**< \brief (PWM0) PWM Channel Dead Time Register (ch_num = 1) */ - #define REG_PWM0_DTUPD1 (0x4002023CU) /**< \brief (PWM0) PWM Channel Dead Time Update Register (ch_num = 1) */ - #define REG_PWM0_CMR2 (0x40020240U) /**< \brief (PWM0) PWM Channel Mode Register (ch_num = 2) */ - #define REG_PWM0_CDTY2 (0x40020244U) /**< \brief (PWM0) PWM Channel Duty Cycle Register (ch_num = 2) */ - #define REG_PWM0_CDTYUPD2 (0x40020248U) /**< \brief (PWM0) PWM Channel Duty Cycle Update Register (ch_num = 2) */ - #define REG_PWM0_CPRD2 (0x4002024CU) /**< \brief (PWM0) PWM Channel Period Register (ch_num = 2) */ - #define REG_PWM0_CPRDUPD2 (0x40020250U) /**< \brief (PWM0) PWM Channel Period Update Register (ch_num = 2) */ - #define REG_PWM0_CCNT2 (0x40020254U) /**< \brief (PWM0) PWM Channel Counter Register (ch_num = 2) */ - #define REG_PWM0_DT2 (0x40020258U) /**< \brief (PWM0) PWM Channel Dead Time Register (ch_num = 2) */ - #define REG_PWM0_DTUPD2 (0x4002025CU) /**< \brief (PWM0) PWM Channel Dead Time Update Register (ch_num = 2) */ - #define REG_PWM0_CMR3 (0x40020260U) /**< \brief (PWM0) PWM Channel Mode Register (ch_num = 3) */ - #define REG_PWM0_CDTY3 (0x40020264U) /**< \brief (PWM0) PWM Channel Duty Cycle Register (ch_num = 3) */ - #define REG_PWM0_CDTYUPD3 (0x40020268U) /**< \brief (PWM0) PWM Channel Duty Cycle Update Register (ch_num = 3) */ - #define REG_PWM0_CPRD3 (0x4002026CU) /**< \brief (PWM0) PWM Channel Period Register (ch_num = 3) */ - #define REG_PWM0_CPRDUPD3 (0x40020270U) /**< \brief (PWM0) PWM Channel Period Update Register (ch_num = 3) */ - #define REG_PWM0_CCNT3 (0x40020274U) /**< \brief (PWM0) PWM Channel Counter Register (ch_num = 3) */ - #define REG_PWM0_DT3 (0x40020278U) /**< \brief (PWM0) PWM Channel Dead Time Register (ch_num = 3) */ - #define REG_PWM0_DTUPD3 (0x4002027CU) /**< \brief (PWM0) PWM Channel Dead Time Update Register (ch_num = 3) */ - #define REG_PWM0_CMUPD0 (0x40020400U) /**< \brief (PWM0) PWM Channel Mode Update Register (ch_num = 0) */ - #define REG_PWM0_CMUPD1 (0x40020420U) /**< \brief (PWM0) PWM Channel Mode Update Register (ch_num = 1) */ - #define REG_PWM0_ETRG1 (0x4002042CU) /**< \brief (PWM0) PWM External Trigger Register (trg_num = 1) */ - #define REG_PWM0_LEBR1 (0x40020430U) /**< \brief (PWM0) PWM Leading-Edge Blanking Register (trg_num = 1) */ - #define REG_PWM0_CMUPD2 (0x40020440U) /**< \brief (PWM0) PWM Channel Mode Update Register (ch_num = 2) */ - #define REG_PWM0_ETRG2 (0x4002044CU) /**< \brief (PWM0) PWM External Trigger Register (trg_num = 2) */ - #define REG_PWM0_LEBR2 (0x40020450U) /**< \brief (PWM0) PWM Leading-Edge Blanking Register (trg_num = 2) */ - #define REG_PWM0_CMUPD3 (0x40020460U) /**< \brief (PWM0) PWM Channel Mode Update Register (ch_num = 3) */ - #define REG_PWM0_ETRG3 (0x4002046CU) /**< \brief (PWM0) PWM External Trigger Register (trg_num = 3) */ - #define REG_PWM0_LEBR3 (0x40020470U) /**< \brief (PWM0) PWM Leading-Edge Blanking Register (trg_num = 3) */ - #define REG_PWM0_ETRG4 (0x4002048CU) /**< \brief (PWM0) PWM External Trigger Register (trg_num = 4) */ - #define REG_PWM0_LEBR4 (0x40020490U) /**< \brief (PWM0) PWM Leading-Edge Blanking Register (trg_num = 4) */ -#else - #define REG_PWM0_CLK (*(__IO uint32_t*)0x40020000U) /**< \brief (PWM0) PWM Clock Register */ - #define REG_PWM0_ENA (*(__O uint32_t*)0x40020004U) /**< \brief (PWM0) PWM Enable Register */ - #define REG_PWM0_DIS (*(__O uint32_t*)0x40020008U) /**< \brief (PWM0) PWM Disable Register */ - #define REG_PWM0_SR (*(__I uint32_t*)0x4002000CU) /**< \brief (PWM0) PWM Status Register */ - #define REG_PWM0_IER1 (*(__O uint32_t*)0x40020010U) /**< \brief (PWM0) PWM Interrupt Enable Register 1 */ - #define REG_PWM0_IDR1 (*(__O uint32_t*)0x40020014U) /**< \brief (PWM0) PWM Interrupt Disable Register 1 */ - #define REG_PWM0_IMR1 (*(__I uint32_t*)0x40020018U) /**< \brief (PWM0) PWM Interrupt Mask Register 1 */ - #define REG_PWM0_ISR1 (*(__I uint32_t*)0x4002001CU) /**< \brief (PWM0) PWM Interrupt Status Register 1 */ - #define REG_PWM0_SCM (*(__IO uint32_t*)0x40020020U) /**< \brief (PWM0) PWM Sync Channels Mode Register */ - #define REG_PWM0_DMAR (*(__O uint32_t*)0x40020024U) /**< \brief (PWM0) PWM DMA Register */ - #define REG_PWM0_SCUC (*(__IO uint32_t*)0x40020028U) /**< \brief (PWM0) PWM Sync Channels Update Control Register */ - #define REG_PWM0_SCUP (*(__IO uint32_t*)0x4002002CU) /**< \brief (PWM0) PWM Sync Channels Update Period Register */ - #define REG_PWM0_SCUPUPD (*(__O uint32_t*)0x40020030U) /**< \brief (PWM0) PWM Sync Channels Update Period Update Register */ - #define REG_PWM0_IER2 (*(__O uint32_t*)0x40020034U) /**< \brief (PWM0) PWM Interrupt Enable Register 2 */ - #define REG_PWM0_IDR2 (*(__O uint32_t*)0x40020038U) /**< \brief (PWM0) PWM Interrupt Disable Register 2 */ - #define REG_PWM0_IMR2 (*(__I uint32_t*)0x4002003CU) /**< \brief (PWM0) PWM Interrupt Mask Register 2 */ - #define REG_PWM0_ISR2 (*(__I uint32_t*)0x40020040U) /**< \brief (PWM0) PWM Interrupt Status Register 2 */ - #define REG_PWM0_OOV (*(__IO uint32_t*)0x40020044U) /**< \brief (PWM0) PWM Output Override Value Register */ - #define REG_PWM0_OS (*(__IO uint32_t*)0x40020048U) /**< \brief (PWM0) PWM Output Selection Register */ - #define REG_PWM0_OSS (*(__O uint32_t*)0x4002004CU) /**< \brief (PWM0) PWM Output Selection Set Register */ - #define REG_PWM0_OSC (*(__O uint32_t*)0x40020050U) /**< \brief (PWM0) PWM Output Selection Clear Register */ - #define REG_PWM0_OSSUPD (*(__O uint32_t*)0x40020054U) /**< \brief (PWM0) PWM Output Selection Set Update Register */ - #define REG_PWM0_OSCUPD (*(__O uint32_t*)0x40020058U) /**< \brief (PWM0) PWM Output Selection Clear Update Register */ - #define REG_PWM0_FMR (*(__IO uint32_t*)0x4002005CU) /**< \brief (PWM0) PWM Fault Mode Register */ - #define REG_PWM0_FSR (*(__I uint32_t*)0x40020060U) /**< \brief (PWM0) PWM Fault Status Register */ - #define REG_PWM0_FCR (*(__O uint32_t*)0x40020064U) /**< \brief (PWM0) PWM Fault Clear Register */ - #define REG_PWM0_FPV1 (*(__IO uint32_t*)0x40020068U) /**< \brief (PWM0) PWM Fault Protection Value Register 1 */ - #define REG_PWM0_FPE (*(__IO uint32_t*)0x4002006CU) /**< \brief (PWM0) PWM Fault Protection Enable Register */ - #define REG_PWM0_ELMR (*(__IO uint32_t*)0x4002007CU) /**< \brief (PWM0) PWM Event Line 0 Mode Register */ - #define REG_PWM0_SSPR (*(__IO uint32_t*)0x400200A0U) /**< \brief (PWM0) PWM Spread Spectrum Register */ - #define REG_PWM0_SSPUP (*(__O uint32_t*)0x400200A4U) /**< \brief (PWM0) PWM Spread Spectrum Update Register */ - #define REG_PWM0_SMMR (*(__IO uint32_t*)0x400200B0U) /**< \brief (PWM0) PWM Stepper Motor Mode Register */ - #define REG_PWM0_FPV2 (*(__IO uint32_t*)0x400200C0U) /**< \brief (PWM0) PWM Fault Protection Value 2 Register */ - #define REG_PWM0_WPCR (*(__O uint32_t*)0x400200E4U) /**< \brief (PWM0) PWM Write Protection Control Register */ - #define REG_PWM0_WPSR (*(__I uint32_t*)0x400200E8U) /**< \brief (PWM0) PWM Write Protection Status Register */ - #define REG_PWM0_CMPV0 (*(__IO uint32_t*)0x40020130U) /**< \brief (PWM0) PWM Comparison 0 Value Register */ - #define REG_PWM0_CMPVUPD0 (*(__O uint32_t*)0x40020134U) /**< \brief (PWM0) PWM Comparison 0 Value Update Register */ - #define REG_PWM0_CMPM0 (*(__IO uint32_t*)0x40020138U) /**< \brief (PWM0) PWM Comparison 0 Mode Register */ - #define REG_PWM0_CMPMUPD0 (*(__O uint32_t*)0x4002013CU) /**< \brief (PWM0) PWM Comparison 0 Mode Update Register */ - #define REG_PWM0_CMPV1 (*(__IO uint32_t*)0x40020140U) /**< \brief (PWM0) PWM Comparison 1 Value Register */ - #define REG_PWM0_CMPVUPD1 (*(__O uint32_t*)0x40020144U) /**< \brief (PWM0) PWM Comparison 1 Value Update Register */ - #define REG_PWM0_CMPM1 (*(__IO uint32_t*)0x40020148U) /**< \brief (PWM0) PWM Comparison 1 Mode Register */ - #define REG_PWM0_CMPMUPD1 (*(__O uint32_t*)0x4002014CU) /**< \brief (PWM0) PWM Comparison 1 Mode Update Register */ - #define REG_PWM0_CMPV2 (*(__IO uint32_t*)0x40020150U) /**< \brief (PWM0) PWM Comparison 2 Value Register */ - #define REG_PWM0_CMPVUPD2 (*(__O uint32_t*)0x40020154U) /**< \brief (PWM0) PWM Comparison 2 Value Update Register */ - #define REG_PWM0_CMPM2 (*(__IO uint32_t*)0x40020158U) /**< \brief (PWM0) PWM Comparison 2 Mode Register */ - #define REG_PWM0_CMPMUPD2 (*(__O uint32_t*)0x4002015CU) /**< \brief (PWM0) PWM Comparison 2 Mode Update Register */ - #define REG_PWM0_CMPV3 (*(__IO uint32_t*)0x40020160U) /**< \brief (PWM0) PWM Comparison 3 Value Register */ - #define REG_PWM0_CMPVUPD3 (*(__O uint32_t*)0x40020164U) /**< \brief (PWM0) PWM Comparison 3 Value Update Register */ - #define REG_PWM0_CMPM3 (*(__IO uint32_t*)0x40020168U) /**< \brief (PWM0) PWM Comparison 3 Mode Register */ - #define REG_PWM0_CMPMUPD3 (*(__O uint32_t*)0x4002016CU) /**< \brief (PWM0) PWM Comparison 3 Mode Update Register */ - #define REG_PWM0_CMPV4 (*(__IO uint32_t*)0x40020170U) /**< \brief (PWM0) PWM Comparison 4 Value Register */ - #define REG_PWM0_CMPVUPD4 (*(__O uint32_t*)0x40020174U) /**< \brief (PWM0) PWM Comparison 4 Value Update Register */ - #define REG_PWM0_CMPM4 (*(__IO uint32_t*)0x40020178U) /**< \brief (PWM0) PWM Comparison 4 Mode Register */ - #define REG_PWM0_CMPMUPD4 (*(__O uint32_t*)0x4002017CU) /**< \brief (PWM0) PWM Comparison 4 Mode Update Register */ - #define REG_PWM0_CMPV5 (*(__IO uint32_t*)0x40020180U) /**< \brief (PWM0) PWM Comparison 5 Value Register */ - #define REG_PWM0_CMPVUPD5 (*(__O uint32_t*)0x40020184U) /**< \brief (PWM0) PWM Comparison 5 Value Update Register */ - #define REG_PWM0_CMPM5 (*(__IO uint32_t*)0x40020188U) /**< \brief (PWM0) PWM Comparison 5 Mode Register */ - #define REG_PWM0_CMPMUPD5 (*(__O uint32_t*)0x4002018CU) /**< \brief (PWM0) PWM Comparison 5 Mode Update Register */ - #define REG_PWM0_CMPV6 (*(__IO uint32_t*)0x40020190U) /**< \brief (PWM0) PWM Comparison 6 Value Register */ - #define REG_PWM0_CMPVUPD6 (*(__O uint32_t*)0x40020194U) /**< \brief (PWM0) PWM Comparison 6 Value Update Register */ - #define REG_PWM0_CMPM6 (*(__IO uint32_t*)0x40020198U) /**< \brief (PWM0) PWM Comparison 6 Mode Register */ - #define REG_PWM0_CMPMUPD6 (*(__O uint32_t*)0x4002019CU) /**< \brief (PWM0) PWM Comparison 6 Mode Update Register */ - #define REG_PWM0_CMPV7 (*(__IO uint32_t*)0x400201A0U) /**< \brief (PWM0) PWM Comparison 7 Value Register */ - #define REG_PWM0_CMPVUPD7 (*(__O uint32_t*)0x400201A4U) /**< \brief (PWM0) PWM Comparison 7 Value Update Register */ - #define REG_PWM0_CMPM7 (*(__IO uint32_t*)0x400201A8U) /**< \brief (PWM0) PWM Comparison 7 Mode Register */ - #define REG_PWM0_CMPMUPD7 (*(__O uint32_t*)0x400201ACU) /**< \brief (PWM0) PWM Comparison 7 Mode Update Register */ - #define REG_PWM0_CMR0 (*(__IO uint32_t*)0x40020200U) /**< \brief (PWM0) PWM Channel Mode Register (ch_num = 0) */ - #define REG_PWM0_CDTY0 (*(__IO uint32_t*)0x40020204U) /**< \brief (PWM0) PWM Channel Duty Cycle Register (ch_num = 0) */ - #define REG_PWM0_CDTYUPD0 (*(__O uint32_t*)0x40020208U) /**< \brief (PWM0) PWM Channel Duty Cycle Update Register (ch_num = 0) */ - #define REG_PWM0_CPRD0 (*(__IO uint32_t*)0x4002020CU) /**< \brief (PWM0) PWM Channel Period Register (ch_num = 0) */ - #define REG_PWM0_CPRDUPD0 (*(__O uint32_t*)0x40020210U) /**< \brief (PWM0) PWM Channel Period Update Register (ch_num = 0) */ - #define REG_PWM0_CCNT0 (*(__I uint32_t*)0x40020214U) /**< \brief (PWM0) PWM Channel Counter Register (ch_num = 0) */ - #define REG_PWM0_DT0 (*(__IO uint32_t*)0x40020218U) /**< \brief (PWM0) PWM Channel Dead Time Register (ch_num = 0) */ - #define REG_PWM0_DTUPD0 (*(__O uint32_t*)0x4002021CU) /**< \brief (PWM0) PWM Channel Dead Time Update Register (ch_num = 0) */ - #define REG_PWM0_CMR1 (*(__IO uint32_t*)0x40020220U) /**< \brief (PWM0) PWM Channel Mode Register (ch_num = 1) */ - #define REG_PWM0_CDTY1 (*(__IO uint32_t*)0x40020224U) /**< \brief (PWM0) PWM Channel Duty Cycle Register (ch_num = 1) */ - #define REG_PWM0_CDTYUPD1 (*(__O uint32_t*)0x40020228U) /**< \brief (PWM0) PWM Channel Duty Cycle Update Register (ch_num = 1) */ - #define REG_PWM0_CPRD1 (*(__IO uint32_t*)0x4002022CU) /**< \brief (PWM0) PWM Channel Period Register (ch_num = 1) */ - #define REG_PWM0_CPRDUPD1 (*(__O uint32_t*)0x40020230U) /**< \brief (PWM0) PWM Channel Period Update Register (ch_num = 1) */ - #define REG_PWM0_CCNT1 (*(__I uint32_t*)0x40020234U) /**< \brief (PWM0) PWM Channel Counter Register (ch_num = 1) */ - #define REG_PWM0_DT1 (*(__IO uint32_t*)0x40020238U) /**< \brief (PWM0) PWM Channel Dead Time Register (ch_num = 1) */ - #define REG_PWM0_DTUPD1 (*(__O uint32_t*)0x4002023CU) /**< \brief (PWM0) PWM Channel Dead Time Update Register (ch_num = 1) */ - #define REG_PWM0_CMR2 (*(__IO uint32_t*)0x40020240U) /**< \brief (PWM0) PWM Channel Mode Register (ch_num = 2) */ - #define REG_PWM0_CDTY2 (*(__IO uint32_t*)0x40020244U) /**< \brief (PWM0) PWM Channel Duty Cycle Register (ch_num = 2) */ - #define REG_PWM0_CDTYUPD2 (*(__O uint32_t*)0x40020248U) /**< \brief (PWM0) PWM Channel Duty Cycle Update Register (ch_num = 2) */ - #define REG_PWM0_CPRD2 (*(__IO uint32_t*)0x4002024CU) /**< \brief (PWM0) PWM Channel Period Register (ch_num = 2) */ - #define REG_PWM0_CPRDUPD2 (*(__O uint32_t*)0x40020250U) /**< \brief (PWM0) PWM Channel Period Update Register (ch_num = 2) */ - #define REG_PWM0_CCNT2 (*(__I uint32_t*)0x40020254U) /**< \brief (PWM0) PWM Channel Counter Register (ch_num = 2) */ - #define REG_PWM0_DT2 (*(__IO uint32_t*)0x40020258U) /**< \brief (PWM0) PWM Channel Dead Time Register (ch_num = 2) */ - #define REG_PWM0_DTUPD2 (*(__O uint32_t*)0x4002025CU) /**< \brief (PWM0) PWM Channel Dead Time Update Register (ch_num = 2) */ - #define REG_PWM0_CMR3 (*(__IO uint32_t*)0x40020260U) /**< \brief (PWM0) PWM Channel Mode Register (ch_num = 3) */ - #define REG_PWM0_CDTY3 (*(__IO uint32_t*)0x40020264U) /**< \brief (PWM0) PWM Channel Duty Cycle Register (ch_num = 3) */ - #define REG_PWM0_CDTYUPD3 (*(__O uint32_t*)0x40020268U) /**< \brief (PWM0) PWM Channel Duty Cycle Update Register (ch_num = 3) */ - #define REG_PWM0_CPRD3 (*(__IO uint32_t*)0x4002026CU) /**< \brief (PWM0) PWM Channel Period Register (ch_num = 3) */ - #define REG_PWM0_CPRDUPD3 (*(__O uint32_t*)0x40020270U) /**< \brief (PWM0) PWM Channel Period Update Register (ch_num = 3) */ - #define REG_PWM0_CCNT3 (*(__I uint32_t*)0x40020274U) /**< \brief (PWM0) PWM Channel Counter Register (ch_num = 3) */ - #define REG_PWM0_DT3 (*(__IO uint32_t*)0x40020278U) /**< \brief (PWM0) PWM Channel Dead Time Register (ch_num = 3) */ - #define REG_PWM0_DTUPD3 (*(__O uint32_t*)0x4002027CU) /**< \brief (PWM0) PWM Channel Dead Time Update Register (ch_num = 3) */ - #define REG_PWM0_CMUPD0 (*(__O uint32_t*)0x40020400U) /**< \brief (PWM0) PWM Channel Mode Update Register (ch_num = 0) */ - #define REG_PWM0_CMUPD1 (*(__O uint32_t*)0x40020420U) /**< \brief (PWM0) PWM Channel Mode Update Register (ch_num = 1) */ - #define REG_PWM0_ETRG1 (*(__IO uint32_t*)0x4002042CU) /**< \brief (PWM0) PWM External Trigger Register (trg_num = 1) */ - #define REG_PWM0_LEBR1 (*(__IO uint32_t*)0x40020430U) /**< \brief (PWM0) PWM Leading-Edge Blanking Register (trg_num = 1) */ - #define REG_PWM0_CMUPD2 (*(__O uint32_t*)0x40020440U) /**< \brief (PWM0) PWM Channel Mode Update Register (ch_num = 2) */ - #define REG_PWM0_ETRG2 (*(__IO uint32_t*)0x4002044CU) /**< \brief (PWM0) PWM External Trigger Register (trg_num = 2) */ - #define REG_PWM0_LEBR2 (*(__IO uint32_t*)0x40020450U) /**< \brief (PWM0) PWM Leading-Edge Blanking Register (trg_num = 2) */ - #define REG_PWM0_CMUPD3 (*(__O uint32_t*)0x40020460U) /**< \brief (PWM0) PWM Channel Mode Update Register (ch_num = 3) */ - #define REG_PWM0_ETRG3 (*(__IO uint32_t*)0x4002046CU) /**< \brief (PWM0) PWM External Trigger Register (trg_num = 3) */ - #define REG_PWM0_LEBR3 (*(__IO uint32_t*)0x40020470U) /**< \brief (PWM0) PWM Leading-Edge Blanking Register (trg_num = 3) */ - #define REG_PWM0_ETRG4 (*(__IO uint32_t*)0x4002048CU) /**< \brief (PWM0) PWM External Trigger Register (trg_num = 4) */ - #define REG_PWM0_LEBR4 (*(__IO uint32_t*)0x40020490U) /**< \brief (PWM0) PWM Leading-Edge Blanking Register (trg_num = 4) */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_PWM0_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_pwm1.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_pwm1.h deleted file mode 100644 index 4350bf16..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_pwm1.h +++ /dev/null @@ -1,260 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_PWM1_INSTANCE_ -#define _SAMV71_PWM1_INSTANCE_ - -/* ========== Register definition for PWM1 peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_PWM1_CLK (0x4005C000U) /**< \brief (PWM1) PWM Clock Register */ - #define REG_PWM1_ENA (0x4005C004U) /**< \brief (PWM1) PWM Enable Register */ - #define REG_PWM1_DIS (0x4005C008U) /**< \brief (PWM1) PWM Disable Register */ - #define REG_PWM1_SR (0x4005C00CU) /**< \brief (PWM1) PWM Status Register */ - #define REG_PWM1_IER1 (0x4005C010U) /**< \brief (PWM1) PWM Interrupt Enable Register 1 */ - #define REG_PWM1_IDR1 (0x4005C014U) /**< \brief (PWM1) PWM Interrupt Disable Register 1 */ - #define REG_PWM1_IMR1 (0x4005C018U) /**< \brief (PWM1) PWM Interrupt Mask Register 1 */ - #define REG_PWM1_ISR1 (0x4005C01CU) /**< \brief (PWM1) PWM Interrupt Status Register 1 */ - #define REG_PWM1_SCM (0x4005C020U) /**< \brief (PWM1) PWM Sync Channels Mode Register */ - #define REG_PWM1_DMAR (0x4005C024U) /**< \brief (PWM1) PWM DMA Register */ - #define REG_PWM1_SCUC (0x4005C028U) /**< \brief (PWM1) PWM Sync Channels Update Control Register */ - #define REG_PWM1_SCUP (0x4005C02CU) /**< \brief (PWM1) PWM Sync Channels Update Period Register */ - #define REG_PWM1_SCUPUPD (0x4005C030U) /**< \brief (PWM1) PWM Sync Channels Update Period Update Register */ - #define REG_PWM1_IER2 (0x4005C034U) /**< \brief (PWM1) PWM Interrupt Enable Register 2 */ - #define REG_PWM1_IDR2 (0x4005C038U) /**< \brief (PWM1) PWM Interrupt Disable Register 2 */ - #define REG_PWM1_IMR2 (0x4005C03CU) /**< \brief (PWM1) PWM Interrupt Mask Register 2 */ - #define REG_PWM1_ISR2 (0x4005C040U) /**< \brief (PWM1) PWM Interrupt Status Register 2 */ - #define REG_PWM1_OOV (0x4005C044U) /**< \brief (PWM1) PWM Output Override Value Register */ - #define REG_PWM1_OS (0x4005C048U) /**< \brief (PWM1) PWM Output Selection Register */ - #define REG_PWM1_OSS (0x4005C04CU) /**< \brief (PWM1) PWM Output Selection Set Register */ - #define REG_PWM1_OSC (0x4005C050U) /**< \brief (PWM1) PWM Output Selection Clear Register */ - #define REG_PWM1_OSSUPD (0x4005C054U) /**< \brief (PWM1) PWM Output Selection Set Update Register */ - #define REG_PWM1_OSCUPD (0x4005C058U) /**< \brief (PWM1) PWM Output Selection Clear Update Register */ - #define REG_PWM1_FMR (0x4005C05CU) /**< \brief (PWM1) PWM Fault Mode Register */ - #define REG_PWM1_FSR (0x4005C060U) /**< \brief (PWM1) PWM Fault Status Register */ - #define REG_PWM1_FCR (0x4005C064U) /**< \brief (PWM1) PWM Fault Clear Register */ - #define REG_PWM1_FPV1 (0x4005C068U) /**< \brief (PWM1) PWM Fault Protection Value Register 1 */ - #define REG_PWM1_FPE (0x4005C06CU) /**< \brief (PWM1) PWM Fault Protection Enable Register */ - #define REG_PWM1_ELMR (0x4005C07CU) /**< \brief (PWM1) PWM Event Line 0 Mode Register */ - #define REG_PWM1_SSPR (0x4005C0A0U) /**< \brief (PWM1) PWM Spread Spectrum Register */ - #define REG_PWM1_SSPUP (0x4005C0A4U) /**< \brief (PWM1) PWM Spread Spectrum Update Register */ - #define REG_PWM1_SMMR (0x4005C0B0U) /**< \brief (PWM1) PWM Stepper Motor Mode Register */ - #define REG_PWM1_FPV2 (0x4005C0C0U) /**< \brief (PWM1) PWM Fault Protection Value 2 Register */ - #define REG_PWM1_WPCR (0x4005C0E4U) /**< \brief (PWM1) PWM Write Protection Control Register */ - #define REG_PWM1_WPSR (0x4005C0E8U) /**< \brief (PWM1) PWM Write Protection Status Register */ - #define REG_PWM1_CMPV0 (0x4005C130U) /**< \brief (PWM1) PWM Comparison 0 Value Register */ - #define REG_PWM1_CMPVUPD0 (0x4005C134U) /**< \brief (PWM1) PWM Comparison 0 Value Update Register */ - #define REG_PWM1_CMPM0 (0x4005C138U) /**< \brief (PWM1) PWM Comparison 0 Mode Register */ - #define REG_PWM1_CMPMUPD0 (0x4005C13CU) /**< \brief (PWM1) PWM Comparison 0 Mode Update Register */ - #define REG_PWM1_CMPV1 (0x4005C140U) /**< \brief (PWM1) PWM Comparison 1 Value Register */ - #define REG_PWM1_CMPVUPD1 (0x4005C144U) /**< \brief (PWM1) PWM Comparison 1 Value Update Register */ - #define REG_PWM1_CMPM1 (0x4005C148U) /**< \brief (PWM1) PWM Comparison 1 Mode Register */ - #define REG_PWM1_CMPMUPD1 (0x4005C14CU) /**< \brief (PWM1) PWM Comparison 1 Mode Update Register */ - #define REG_PWM1_CMPV2 (0x4005C150U) /**< \brief (PWM1) PWM Comparison 2 Value Register */ - #define REG_PWM1_CMPVUPD2 (0x4005C154U) /**< \brief (PWM1) PWM Comparison 2 Value Update Register */ - #define REG_PWM1_CMPM2 (0x4005C158U) /**< \brief (PWM1) PWM Comparison 2 Mode Register */ - #define REG_PWM1_CMPMUPD2 (0x4005C15CU) /**< \brief (PWM1) PWM Comparison 2 Mode Update Register */ - #define REG_PWM1_CMPV3 (0x4005C160U) /**< \brief (PWM1) PWM Comparison 3 Value Register */ - #define REG_PWM1_CMPVUPD3 (0x4005C164U) /**< \brief (PWM1) PWM Comparison 3 Value Update Register */ - #define REG_PWM1_CMPM3 (0x4005C168U) /**< \brief (PWM1) PWM Comparison 3 Mode Register */ - #define REG_PWM1_CMPMUPD3 (0x4005C16CU) /**< \brief (PWM1) PWM Comparison 3 Mode Update Register */ - #define REG_PWM1_CMPV4 (0x4005C170U) /**< \brief (PWM1) PWM Comparison 4 Value Register */ - #define REG_PWM1_CMPVUPD4 (0x4005C174U) /**< \brief (PWM1) PWM Comparison 4 Value Update Register */ - #define REG_PWM1_CMPM4 (0x4005C178U) /**< \brief (PWM1) PWM Comparison 4 Mode Register */ - #define REG_PWM1_CMPMUPD4 (0x4005C17CU) /**< \brief (PWM1) PWM Comparison 4 Mode Update Register */ - #define REG_PWM1_CMPV5 (0x4005C180U) /**< \brief (PWM1) PWM Comparison 5 Value Register */ - #define REG_PWM1_CMPVUPD5 (0x4005C184U) /**< \brief (PWM1) PWM Comparison 5 Value Update Register */ - #define REG_PWM1_CMPM5 (0x4005C188U) /**< \brief (PWM1) PWM Comparison 5 Mode Register */ - #define REG_PWM1_CMPMUPD5 (0x4005C18CU) /**< \brief (PWM1) PWM Comparison 5 Mode Update Register */ - #define REG_PWM1_CMPV6 (0x4005C190U) /**< \brief (PWM1) PWM Comparison 6 Value Register */ - #define REG_PWM1_CMPVUPD6 (0x4005C194U) /**< \brief (PWM1) PWM Comparison 6 Value Update Register */ - #define REG_PWM1_CMPM6 (0x4005C198U) /**< \brief (PWM1) PWM Comparison 6 Mode Register */ - #define REG_PWM1_CMPMUPD6 (0x4005C19CU) /**< \brief (PWM1) PWM Comparison 6 Mode Update Register */ - #define REG_PWM1_CMPV7 (0x4005C1A0U) /**< \brief (PWM1) PWM Comparison 7 Value Register */ - #define REG_PWM1_CMPVUPD7 (0x4005C1A4U) /**< \brief (PWM1) PWM Comparison 7 Value Update Register */ - #define REG_PWM1_CMPM7 (0x4005C1A8U) /**< \brief (PWM1) PWM Comparison 7 Mode Register */ - #define REG_PWM1_CMPMUPD7 (0x4005C1ACU) /**< \brief (PWM1) PWM Comparison 7 Mode Update Register */ - #define REG_PWM1_CMR0 (0x4005C200U) /**< \brief (PWM1) PWM Channel Mode Register (ch_num = 0) */ - #define REG_PWM1_CDTY0 (0x4005C204U) /**< \brief (PWM1) PWM Channel Duty Cycle Register (ch_num = 0) */ - #define REG_PWM1_CDTYUPD0 (0x4005C208U) /**< \brief (PWM1) PWM Channel Duty Cycle Update Register (ch_num = 0) */ - #define REG_PWM1_CPRD0 (0x4005C20CU) /**< \brief (PWM1) PWM Channel Period Register (ch_num = 0) */ - #define REG_PWM1_CPRDUPD0 (0x4005C210U) /**< \brief (PWM1) PWM Channel Period Update Register (ch_num = 0) */ - #define REG_PWM1_CCNT0 (0x4005C214U) /**< \brief (PWM1) PWM Channel Counter Register (ch_num = 0) */ - #define REG_PWM1_DT0 (0x4005C218U) /**< \brief (PWM1) PWM Channel Dead Time Register (ch_num = 0) */ - #define REG_PWM1_DTUPD0 (0x4005C21CU) /**< \brief (PWM1) PWM Channel Dead Time Update Register (ch_num = 0) */ - #define REG_PWM1_CMR1 (0x4005C220U) /**< \brief (PWM1) PWM Channel Mode Register (ch_num = 1) */ - #define REG_PWM1_CDTY1 (0x4005C224U) /**< \brief (PWM1) PWM Channel Duty Cycle Register (ch_num = 1) */ - #define REG_PWM1_CDTYUPD1 (0x4005C228U) /**< \brief (PWM1) PWM Channel Duty Cycle Update Register (ch_num = 1) */ - #define REG_PWM1_CPRD1 (0x4005C22CU) /**< \brief (PWM1) PWM Channel Period Register (ch_num = 1) */ - #define REG_PWM1_CPRDUPD1 (0x4005C230U) /**< \brief (PWM1) PWM Channel Period Update Register (ch_num = 1) */ - #define REG_PWM1_CCNT1 (0x4005C234U) /**< \brief (PWM1) PWM Channel Counter Register (ch_num = 1) */ - #define REG_PWM1_DT1 (0x4005C238U) /**< \brief (PWM1) PWM Channel Dead Time Register (ch_num = 1) */ - #define REG_PWM1_DTUPD1 (0x4005C23CU) /**< \brief (PWM1) PWM Channel Dead Time Update Register (ch_num = 1) */ - #define REG_PWM1_CMR2 (0x4005C240U) /**< \brief (PWM1) PWM Channel Mode Register (ch_num = 2) */ - #define REG_PWM1_CDTY2 (0x4005C244U) /**< \brief (PWM1) PWM Channel Duty Cycle Register (ch_num = 2) */ - #define REG_PWM1_CDTYUPD2 (0x4005C248U) /**< \brief (PWM1) PWM Channel Duty Cycle Update Register (ch_num = 2) */ - #define REG_PWM1_CPRD2 (0x4005C24CU) /**< \brief (PWM1) PWM Channel Period Register (ch_num = 2) */ - #define REG_PWM1_CPRDUPD2 (0x4005C250U) /**< \brief (PWM1) PWM Channel Period Update Register (ch_num = 2) */ - #define REG_PWM1_CCNT2 (0x4005C254U) /**< \brief (PWM1) PWM Channel Counter Register (ch_num = 2) */ - #define REG_PWM1_DT2 (0x4005C258U) /**< \brief (PWM1) PWM Channel Dead Time Register (ch_num = 2) */ - #define REG_PWM1_DTUPD2 (0x4005C25CU) /**< \brief (PWM1) PWM Channel Dead Time Update Register (ch_num = 2) */ - #define REG_PWM1_CMR3 (0x4005C260U) /**< \brief (PWM1) PWM Channel Mode Register (ch_num = 3) */ - #define REG_PWM1_CDTY3 (0x4005C264U) /**< \brief (PWM1) PWM Channel Duty Cycle Register (ch_num = 3) */ - #define REG_PWM1_CDTYUPD3 (0x4005C268U) /**< \brief (PWM1) PWM Channel Duty Cycle Update Register (ch_num = 3) */ - #define REG_PWM1_CPRD3 (0x4005C26CU) /**< \brief (PWM1) PWM Channel Period Register (ch_num = 3) */ - #define REG_PWM1_CPRDUPD3 (0x4005C270U) /**< \brief (PWM1) PWM Channel Period Update Register (ch_num = 3) */ - #define REG_PWM1_CCNT3 (0x4005C274U) /**< \brief (PWM1) PWM Channel Counter Register (ch_num = 3) */ - #define REG_PWM1_DT3 (0x4005C278U) /**< \brief (PWM1) PWM Channel Dead Time Register (ch_num = 3) */ - #define REG_PWM1_DTUPD3 (0x4005C27CU) /**< \brief (PWM1) PWM Channel Dead Time Update Register (ch_num = 3) */ - #define REG_PWM1_CMUPD0 (0x4005C400U) /**< \brief (PWM1) PWM Channel Mode Update Register (ch_num = 0) */ - #define REG_PWM1_CMUPD1 (0x4005C420U) /**< \brief (PWM1) PWM Channel Mode Update Register (ch_num = 1) */ - #define REG_PWM1_ETRG1 (0x4005C42CU) /**< \brief (PWM1) PWM External Trigger Register (trg_num = 1) */ - #define REG_PWM1_LEBR1 (0x4005C430U) /**< \brief (PWM1) PWM Leading-Edge Blanking Register (trg_num = 1) */ - #define REG_PWM1_CMUPD2 (0x4005C440U) /**< \brief (PWM1) PWM Channel Mode Update Register (ch_num = 2) */ - #define REG_PWM1_ETRG2 (0x4005C44CU) /**< \brief (PWM1) PWM External Trigger Register (trg_num = 2) */ - #define REG_PWM1_LEBR2 (0x4005C450U) /**< \brief (PWM1) PWM Leading-Edge Blanking Register (trg_num = 2) */ - #define REG_PWM1_CMUPD3 (0x4005C460U) /**< \brief (PWM1) PWM Channel Mode Update Register (ch_num = 3) */ - #define REG_PWM1_ETRG3 (0x4005C46CU) /**< \brief (PWM1) PWM External Trigger Register (trg_num = 3) */ - #define REG_PWM1_LEBR3 (0x4005C470U) /**< \brief (PWM1) PWM Leading-Edge Blanking Register (trg_num = 3) */ - #define REG_PWM1_ETRG4 (0x4005C48CU) /**< \brief (PWM1) PWM External Trigger Register (trg_num = 4) */ - #define REG_PWM1_LEBR4 (0x4005C490U) /**< \brief (PWM1) PWM Leading-Edge Blanking Register (trg_num = 4) */ -#else - #define REG_PWM1_CLK (*(__IO uint32_t*)0x4005C000U) /**< \brief (PWM1) PWM Clock Register */ - #define REG_PWM1_ENA (*(__O uint32_t*)0x4005C004U) /**< \brief (PWM1) PWM Enable Register */ - #define REG_PWM1_DIS (*(__O uint32_t*)0x4005C008U) /**< \brief (PWM1) PWM Disable Register */ - #define REG_PWM1_SR (*(__I uint32_t*)0x4005C00CU) /**< \brief (PWM1) PWM Status Register */ - #define REG_PWM1_IER1 (*(__O uint32_t*)0x4005C010U) /**< \brief (PWM1) PWM Interrupt Enable Register 1 */ - #define REG_PWM1_IDR1 (*(__O uint32_t*)0x4005C014U) /**< \brief (PWM1) PWM Interrupt Disable Register 1 */ - #define REG_PWM1_IMR1 (*(__I uint32_t*)0x4005C018U) /**< \brief (PWM1) PWM Interrupt Mask Register 1 */ - #define REG_PWM1_ISR1 (*(__I uint32_t*)0x4005C01CU) /**< \brief (PWM1) PWM Interrupt Status Register 1 */ - #define REG_PWM1_SCM (*(__IO uint32_t*)0x4005C020U) /**< \brief (PWM1) PWM Sync Channels Mode Register */ - #define REG_PWM1_DMAR (*(__O uint32_t*)0x4005C024U) /**< \brief (PWM1) PWM DMA Register */ - #define REG_PWM1_SCUC (*(__IO uint32_t*)0x4005C028U) /**< \brief (PWM1) PWM Sync Channels Update Control Register */ - #define REG_PWM1_SCUP (*(__IO uint32_t*)0x4005C02CU) /**< \brief (PWM1) PWM Sync Channels Update Period Register */ - #define REG_PWM1_SCUPUPD (*(__O uint32_t*)0x4005C030U) /**< \brief (PWM1) PWM Sync Channels Update Period Update Register */ - #define REG_PWM1_IER2 (*(__O uint32_t*)0x4005C034U) /**< \brief (PWM1) PWM Interrupt Enable Register 2 */ - #define REG_PWM1_IDR2 (*(__O uint32_t*)0x4005C038U) /**< \brief (PWM1) PWM Interrupt Disable Register 2 */ - #define REG_PWM1_IMR2 (*(__I uint32_t*)0x4005C03CU) /**< \brief (PWM1) PWM Interrupt Mask Register 2 */ - #define REG_PWM1_ISR2 (*(__I uint32_t*)0x4005C040U) /**< \brief (PWM1) PWM Interrupt Status Register 2 */ - #define REG_PWM1_OOV (*(__IO uint32_t*)0x4005C044U) /**< \brief (PWM1) PWM Output Override Value Register */ - #define REG_PWM1_OS (*(__IO uint32_t*)0x4005C048U) /**< \brief (PWM1) PWM Output Selection Register */ - #define REG_PWM1_OSS (*(__O uint32_t*)0x4005C04CU) /**< \brief (PWM1) PWM Output Selection Set Register */ - #define REG_PWM1_OSC (*(__O uint32_t*)0x4005C050U) /**< \brief (PWM1) PWM Output Selection Clear Register */ - #define REG_PWM1_OSSUPD (*(__O uint32_t*)0x4005C054U) /**< \brief (PWM1) PWM Output Selection Set Update Register */ - #define REG_PWM1_OSCUPD (*(__O uint32_t*)0x4005C058U) /**< \brief (PWM1) PWM Output Selection Clear Update Register */ - #define REG_PWM1_FMR (*(__IO uint32_t*)0x4005C05CU) /**< \brief (PWM1) PWM Fault Mode Register */ - #define REG_PWM1_FSR (*(__I uint32_t*)0x4005C060U) /**< \brief (PWM1) PWM Fault Status Register */ - #define REG_PWM1_FCR (*(__O uint32_t*)0x4005C064U) /**< \brief (PWM1) PWM Fault Clear Register */ - #define REG_PWM1_FPV1 (*(__IO uint32_t*)0x4005C068U) /**< \brief (PWM1) PWM Fault Protection Value Register 1 */ - #define REG_PWM1_FPE (*(__IO uint32_t*)0x4005C06CU) /**< \brief (PWM1) PWM Fault Protection Enable Register */ - #define REG_PWM1_ELMR (*(__IO uint32_t*)0x4005C07CU) /**< \brief (PWM1) PWM Event Line 0 Mode Register */ - #define REG_PWM1_SSPR (*(__IO uint32_t*)0x4005C0A0U) /**< \brief (PWM1) PWM Spread Spectrum Register */ - #define REG_PWM1_SSPUP (*(__O uint32_t*)0x4005C0A4U) /**< \brief (PWM1) PWM Spread Spectrum Update Register */ - #define REG_PWM1_SMMR (*(__IO uint32_t*)0x4005C0B0U) /**< \brief (PWM1) PWM Stepper Motor Mode Register */ - #define REG_PWM1_FPV2 (*(__IO uint32_t*)0x4005C0C0U) /**< \brief (PWM1) PWM Fault Protection Value 2 Register */ - #define REG_PWM1_WPCR (*(__O uint32_t*)0x4005C0E4U) /**< \brief (PWM1) PWM Write Protection Control Register */ - #define REG_PWM1_WPSR (*(__I uint32_t*)0x4005C0E8U) /**< \brief (PWM1) PWM Write Protection Status Register */ - #define REG_PWM1_CMPV0 (*(__IO uint32_t*)0x4005C130U) /**< \brief (PWM1) PWM Comparison 0 Value Register */ - #define REG_PWM1_CMPVUPD0 (*(__O uint32_t*)0x4005C134U) /**< \brief (PWM1) PWM Comparison 0 Value Update Register */ - #define REG_PWM1_CMPM0 (*(__IO uint32_t*)0x4005C138U) /**< \brief (PWM1) PWM Comparison 0 Mode Register */ - #define REG_PWM1_CMPMUPD0 (*(__O uint32_t*)0x4005C13CU) /**< \brief (PWM1) PWM Comparison 0 Mode Update Register */ - #define REG_PWM1_CMPV1 (*(__IO uint32_t*)0x4005C140U) /**< \brief (PWM1) PWM Comparison 1 Value Register */ - #define REG_PWM1_CMPVUPD1 (*(__O uint32_t*)0x4005C144U) /**< \brief (PWM1) PWM Comparison 1 Value Update Register */ - #define REG_PWM1_CMPM1 (*(__IO uint32_t*)0x4005C148U) /**< \brief (PWM1) PWM Comparison 1 Mode Register */ - #define REG_PWM1_CMPMUPD1 (*(__O uint32_t*)0x4005C14CU) /**< \brief (PWM1) PWM Comparison 1 Mode Update Register */ - #define REG_PWM1_CMPV2 (*(__IO uint32_t*)0x4005C150U) /**< \brief (PWM1) PWM Comparison 2 Value Register */ - #define REG_PWM1_CMPVUPD2 (*(__O uint32_t*)0x4005C154U) /**< \brief (PWM1) PWM Comparison 2 Value Update Register */ - #define REG_PWM1_CMPM2 (*(__IO uint32_t*)0x4005C158U) /**< \brief (PWM1) PWM Comparison 2 Mode Register */ - #define REG_PWM1_CMPMUPD2 (*(__O uint32_t*)0x4005C15CU) /**< \brief (PWM1) PWM Comparison 2 Mode Update Register */ - #define REG_PWM1_CMPV3 (*(__IO uint32_t*)0x4005C160U) /**< \brief (PWM1) PWM Comparison 3 Value Register */ - #define REG_PWM1_CMPVUPD3 (*(__O uint32_t*)0x4005C164U) /**< \brief (PWM1) PWM Comparison 3 Value Update Register */ - #define REG_PWM1_CMPM3 (*(__IO uint32_t*)0x4005C168U) /**< \brief (PWM1) PWM Comparison 3 Mode Register */ - #define REG_PWM1_CMPMUPD3 (*(__O uint32_t*)0x4005C16CU) /**< \brief (PWM1) PWM Comparison 3 Mode Update Register */ - #define REG_PWM1_CMPV4 (*(__IO uint32_t*)0x4005C170U) /**< \brief (PWM1) PWM Comparison 4 Value Register */ - #define REG_PWM1_CMPVUPD4 (*(__O uint32_t*)0x4005C174U) /**< \brief (PWM1) PWM Comparison 4 Value Update Register */ - #define REG_PWM1_CMPM4 (*(__IO uint32_t*)0x4005C178U) /**< \brief (PWM1) PWM Comparison 4 Mode Register */ - #define REG_PWM1_CMPMUPD4 (*(__O uint32_t*)0x4005C17CU) /**< \brief (PWM1) PWM Comparison 4 Mode Update Register */ - #define REG_PWM1_CMPV5 (*(__IO uint32_t*)0x4005C180U) /**< \brief (PWM1) PWM Comparison 5 Value Register */ - #define REG_PWM1_CMPVUPD5 (*(__O uint32_t*)0x4005C184U) /**< \brief (PWM1) PWM Comparison 5 Value Update Register */ - #define REG_PWM1_CMPM5 (*(__IO uint32_t*)0x4005C188U) /**< \brief (PWM1) PWM Comparison 5 Mode Register */ - #define REG_PWM1_CMPMUPD5 (*(__O uint32_t*)0x4005C18CU) /**< \brief (PWM1) PWM Comparison 5 Mode Update Register */ - #define REG_PWM1_CMPV6 (*(__IO uint32_t*)0x4005C190U) /**< \brief (PWM1) PWM Comparison 6 Value Register */ - #define REG_PWM1_CMPVUPD6 (*(__O uint32_t*)0x4005C194U) /**< \brief (PWM1) PWM Comparison 6 Value Update Register */ - #define REG_PWM1_CMPM6 (*(__IO uint32_t*)0x4005C198U) /**< \brief (PWM1) PWM Comparison 6 Mode Register */ - #define REG_PWM1_CMPMUPD6 (*(__O uint32_t*)0x4005C19CU) /**< \brief (PWM1) PWM Comparison 6 Mode Update Register */ - #define REG_PWM1_CMPV7 (*(__IO uint32_t*)0x4005C1A0U) /**< \brief (PWM1) PWM Comparison 7 Value Register */ - #define REG_PWM1_CMPVUPD7 (*(__O uint32_t*)0x4005C1A4U) /**< \brief (PWM1) PWM Comparison 7 Value Update Register */ - #define REG_PWM1_CMPM7 (*(__IO uint32_t*)0x4005C1A8U) /**< \brief (PWM1) PWM Comparison 7 Mode Register */ - #define REG_PWM1_CMPMUPD7 (*(__O uint32_t*)0x4005C1ACU) /**< \brief (PWM1) PWM Comparison 7 Mode Update Register */ - #define REG_PWM1_CMR0 (*(__IO uint32_t*)0x4005C200U) /**< \brief (PWM1) PWM Channel Mode Register (ch_num = 0) */ - #define REG_PWM1_CDTY0 (*(__IO uint32_t*)0x4005C204U) /**< \brief (PWM1) PWM Channel Duty Cycle Register (ch_num = 0) */ - #define REG_PWM1_CDTYUPD0 (*(__O uint32_t*)0x4005C208U) /**< \brief (PWM1) PWM Channel Duty Cycle Update Register (ch_num = 0) */ - #define REG_PWM1_CPRD0 (*(__IO uint32_t*)0x4005C20CU) /**< \brief (PWM1) PWM Channel Period Register (ch_num = 0) */ - #define REG_PWM1_CPRDUPD0 (*(__O uint32_t*)0x4005C210U) /**< \brief (PWM1) PWM Channel Period Update Register (ch_num = 0) */ - #define REG_PWM1_CCNT0 (*(__I uint32_t*)0x4005C214U) /**< \brief (PWM1) PWM Channel Counter Register (ch_num = 0) */ - #define REG_PWM1_DT0 (*(__IO uint32_t*)0x4005C218U) /**< \brief (PWM1) PWM Channel Dead Time Register (ch_num = 0) */ - #define REG_PWM1_DTUPD0 (*(__O uint32_t*)0x4005C21CU) /**< \brief (PWM1) PWM Channel Dead Time Update Register (ch_num = 0) */ - #define REG_PWM1_CMR1 (*(__IO uint32_t*)0x4005C220U) /**< \brief (PWM1) PWM Channel Mode Register (ch_num = 1) */ - #define REG_PWM1_CDTY1 (*(__IO uint32_t*)0x4005C224U) /**< \brief (PWM1) PWM Channel Duty Cycle Register (ch_num = 1) */ - #define REG_PWM1_CDTYUPD1 (*(__O uint32_t*)0x4005C228U) /**< \brief (PWM1) PWM Channel Duty Cycle Update Register (ch_num = 1) */ - #define REG_PWM1_CPRD1 (*(__IO uint32_t*)0x4005C22CU) /**< \brief (PWM1) PWM Channel Period Register (ch_num = 1) */ - #define REG_PWM1_CPRDUPD1 (*(__O uint32_t*)0x4005C230U) /**< \brief (PWM1) PWM Channel Period Update Register (ch_num = 1) */ - #define REG_PWM1_CCNT1 (*(__I uint32_t*)0x4005C234U) /**< \brief (PWM1) PWM Channel Counter Register (ch_num = 1) */ - #define REG_PWM1_DT1 (*(__IO uint32_t*)0x4005C238U) /**< \brief (PWM1) PWM Channel Dead Time Register (ch_num = 1) */ - #define REG_PWM1_DTUPD1 (*(__O uint32_t*)0x4005C23CU) /**< \brief (PWM1) PWM Channel Dead Time Update Register (ch_num = 1) */ - #define REG_PWM1_CMR2 (*(__IO uint32_t*)0x4005C240U) /**< \brief (PWM1) PWM Channel Mode Register (ch_num = 2) */ - #define REG_PWM1_CDTY2 (*(__IO uint32_t*)0x4005C244U) /**< \brief (PWM1) PWM Channel Duty Cycle Register (ch_num = 2) */ - #define REG_PWM1_CDTYUPD2 (*(__O uint32_t*)0x4005C248U) /**< \brief (PWM1) PWM Channel Duty Cycle Update Register (ch_num = 2) */ - #define REG_PWM1_CPRD2 (*(__IO uint32_t*)0x4005C24CU) /**< \brief (PWM1) PWM Channel Period Register (ch_num = 2) */ - #define REG_PWM1_CPRDUPD2 (*(__O uint32_t*)0x4005C250U) /**< \brief (PWM1) PWM Channel Period Update Register (ch_num = 2) */ - #define REG_PWM1_CCNT2 (*(__I uint32_t*)0x4005C254U) /**< \brief (PWM1) PWM Channel Counter Register (ch_num = 2) */ - #define REG_PWM1_DT2 (*(__IO uint32_t*)0x4005C258U) /**< \brief (PWM1) PWM Channel Dead Time Register (ch_num = 2) */ - #define REG_PWM1_DTUPD2 (*(__O uint32_t*)0x4005C25CU) /**< \brief (PWM1) PWM Channel Dead Time Update Register (ch_num = 2) */ - #define REG_PWM1_CMR3 (*(__IO uint32_t*)0x4005C260U) /**< \brief (PWM1) PWM Channel Mode Register (ch_num = 3) */ - #define REG_PWM1_CDTY3 (*(__IO uint32_t*)0x4005C264U) /**< \brief (PWM1) PWM Channel Duty Cycle Register (ch_num = 3) */ - #define REG_PWM1_CDTYUPD3 (*(__O uint32_t*)0x4005C268U) /**< \brief (PWM1) PWM Channel Duty Cycle Update Register (ch_num = 3) */ - #define REG_PWM1_CPRD3 (*(__IO uint32_t*)0x4005C26CU) /**< \brief (PWM1) PWM Channel Period Register (ch_num = 3) */ - #define REG_PWM1_CPRDUPD3 (*(__O uint32_t*)0x4005C270U) /**< \brief (PWM1) PWM Channel Period Update Register (ch_num = 3) */ - #define REG_PWM1_CCNT3 (*(__I uint32_t*)0x4005C274U) /**< \brief (PWM1) PWM Channel Counter Register (ch_num = 3) */ - #define REG_PWM1_DT3 (*(__IO uint32_t*)0x4005C278U) /**< \brief (PWM1) PWM Channel Dead Time Register (ch_num = 3) */ - #define REG_PWM1_DTUPD3 (*(__O uint32_t*)0x4005C27CU) /**< \brief (PWM1) PWM Channel Dead Time Update Register (ch_num = 3) */ - #define REG_PWM1_CMUPD0 (*(__O uint32_t*)0x4005C400U) /**< \brief (PWM1) PWM Channel Mode Update Register (ch_num = 0) */ - #define REG_PWM1_CMUPD1 (*(__O uint32_t*)0x4005C420U) /**< \brief (PWM1) PWM Channel Mode Update Register (ch_num = 1) */ - #define REG_PWM1_ETRG1 (*(__IO uint32_t*)0x4005C42CU) /**< \brief (PWM1) PWM External Trigger Register (trg_num = 1) */ - #define REG_PWM1_LEBR1 (*(__IO uint32_t*)0x4005C430U) /**< \brief (PWM1) PWM Leading-Edge Blanking Register (trg_num = 1) */ - #define REG_PWM1_CMUPD2 (*(__O uint32_t*)0x4005C440U) /**< \brief (PWM1) PWM Channel Mode Update Register (ch_num = 2) */ - #define REG_PWM1_ETRG2 (*(__IO uint32_t*)0x4005C44CU) /**< \brief (PWM1) PWM External Trigger Register (trg_num = 2) */ - #define REG_PWM1_LEBR2 (*(__IO uint32_t*)0x4005C450U) /**< \brief (PWM1) PWM Leading-Edge Blanking Register (trg_num = 2) */ - #define REG_PWM1_CMUPD3 (*(__O uint32_t*)0x4005C460U) /**< \brief (PWM1) PWM Channel Mode Update Register (ch_num = 3) */ - #define REG_PWM1_ETRG3 (*(__IO uint32_t*)0x4005C46CU) /**< \brief (PWM1) PWM External Trigger Register (trg_num = 3) */ - #define REG_PWM1_LEBR3 (*(__IO uint32_t*)0x4005C470U) /**< \brief (PWM1) PWM Leading-Edge Blanking Register (trg_num = 3) */ - #define REG_PWM1_ETRG4 (*(__IO uint32_t*)0x4005C48CU) /**< \brief (PWM1) PWM External Trigger Register (trg_num = 4) */ - #define REG_PWM1_LEBR4 (*(__IO uint32_t*)0x4005C490U) /**< \brief (PWM1) PWM Leading-Edge Blanking Register (trg_num = 4) */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_PWM1_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_qspi.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_qspi.h deleted file mode 100644 index 30aae74c..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_qspi.h +++ /dev/null @@ -1,70 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_QSPI_INSTANCE_ -#define _SAMV71_QSPI_INSTANCE_ - -/* ========== Register definition for QSPI peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_QSPI_CR (0x4007C000U) /**< \brief (QSPI) Control Register */ - #define REG_QSPI_MR (0x4007C004U) /**< \brief (QSPI) Mode Register */ - #define REG_QSPI_RDR (0x4007C008U) /**< \brief (QSPI) Receive Data Register */ - #define REG_QSPI_TDR (0x4007C00CU) /**< \brief (QSPI) Transmit Data Register */ - #define REG_QSPI_SR (0x4007C010U) /**< \brief (QSPI) Status Register */ - #define REG_QSPI_IER (0x4007C014U) /**< \brief (QSPI) Interrupt Enable Register */ - #define REG_QSPI_IDR (0x4007C018U) /**< \brief (QSPI) Interrupt Disable Register */ - #define REG_QSPI_IMR (0x4007C01CU) /**< \brief (QSPI) Interrupt Mask Register */ - #define REG_QSPI_SCR (0x4007C020U) /**< \brief (QSPI) Serial Clock Register */ - #define REG_QSPI_IAR (0x4007C030U) /**< \brief (QSPI) Instruction Address Register */ - #define REG_QSPI_ICR (0x4007C034U) /**< \brief (QSPI) Instruction Code Register */ - #define REG_QSPI_IFR (0x4007C038U) /**< \brief (QSPI) Instruction Frame Register */ - #define REG_QSPI_SMR (0x4007C040U) /**< \brief (QSPI) Scrambling Mode Register */ - #define REG_QSPI_SKR (0x4007C044U) /**< \brief (QSPI) Scrambling Key Register */ - #define REG_QSPI_WPMR (0x4007C0E4U) /**< \brief (QSPI) Write Protection Mode Register */ - #define REG_QSPI_WPSR (0x4007C0E8U) /**< \brief (QSPI) Write Protection Status Register */ -#else - #define REG_QSPI_CR (*(__O uint32_t*)0x4007C000U) /**< \brief (QSPI) Control Register */ - #define REG_QSPI_MR (*(__IO uint32_t*)0x4007C004U) /**< \brief (QSPI) Mode Register */ - #define REG_QSPI_RDR (*(__I uint32_t*)0x4007C008U) /**< \brief (QSPI) Receive Data Register */ - #define REG_QSPI_TDR (*(__O uint32_t*)0x4007C00CU) /**< \brief (QSPI) Transmit Data Register */ - #define REG_QSPI_SR (*(__I uint32_t*)0x4007C010U) /**< \brief (QSPI) Status Register */ - #define REG_QSPI_IER (*(__O uint32_t*)0x4007C014U) /**< \brief (QSPI) Interrupt Enable Register */ - #define REG_QSPI_IDR (*(__O uint32_t*)0x4007C018U) /**< \brief (QSPI) Interrupt Disable Register */ - #define REG_QSPI_IMR (*(__I uint32_t*)0x4007C01CU) /**< \brief (QSPI) Interrupt Mask Register */ - #define REG_QSPI_SCR (*(__IO uint32_t*)0x4007C020U) /**< \brief (QSPI) Serial Clock Register */ - #define REG_QSPI_IAR (*(__IO uint32_t*)0x4007C030U) /**< \brief (QSPI) Instruction Address Register */ - #define REG_QSPI_ICR (*(__IO uint32_t*)0x4007C034U) /**< \brief (QSPI) Instruction Code Register */ - #define REG_QSPI_IFR (*(__IO uint32_t*)0x4007C038U) /**< \brief (QSPI) Instruction Frame Register */ - #define REG_QSPI_SMR (*(__IO uint32_t*)0x4007C040U) /**< \brief (QSPI) Scrambling Mode Register */ - #define REG_QSPI_SKR (*(__O uint32_t*)0x4007C044U) /**< \brief (QSPI) Scrambling Key Register */ - #define REG_QSPI_WPMR (*(__IO uint32_t*)0x4007C0E4U) /**< \brief (QSPI) Write Protection Mode Register */ - #define REG_QSPI_WPSR (*(__I uint32_t*)0x4007C0E8U) /**< \brief (QSPI) Write Protection Status Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_QSPI_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_rstc.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_rstc.h deleted file mode 100644 index ab13eb6c..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_rstc.h +++ /dev/null @@ -1,44 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_RSTC_INSTANCE_ -#define _SAMV71_RSTC_INSTANCE_ - -/* ========== Register definition for RSTC peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_RSTC_CR (0x400E1800U) /**< \brief (RSTC) Control Register */ - #define REG_RSTC_SR (0x400E1804U) /**< \brief (RSTC) Status Register */ - #define REG_RSTC_MR (0x400E1808U) /**< \brief (RSTC) Mode Register */ -#else - #define REG_RSTC_CR (*(__O uint32_t*)0x400E1800U) /**< \brief (RSTC) Control Register */ - #define REG_RSTC_SR (*(__I uint32_t*)0x400E1804U) /**< \brief (RSTC) Status Register */ - #define REG_RSTC_MR (*(__IO uint32_t*)0x400E1808U) /**< \brief (RSTC) Mode Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_RSTC_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_rswdt.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_rswdt.h deleted file mode 100644 index 665ef010..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_rswdt.h +++ /dev/null @@ -1,44 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_RSWDT_INSTANCE_ -#define _SAMV71_RSWDT_INSTANCE_ - -/* ========== Register definition for RSWDT peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_RSWDT_CR (0x400E1900U) /**< \brief (RSWDT) Control Register */ - #define REG_RSWDT_MR (0x400E1904U) /**< \brief (RSWDT) Mode Register */ - #define REG_RSWDT_SR (0x400E1908U) /**< \brief (RSWDT) Status Register */ -#else - #define REG_RSWDT_CR (*(__O uint32_t*)0x400E1900U) /**< \brief (RSWDT) Control Register */ - #define REG_RSWDT_MR (*(__IO uint32_t*)0x400E1904U) /**< \brief (RSWDT) Mode Register */ - #define REG_RSWDT_SR (*(__I uint32_t*)0x400E1908U) /**< \brief (RSWDT) Status Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_RSWDT_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_rtc.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_rtc.h deleted file mode 100644 index 2d865f60..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_rtc.h +++ /dev/null @@ -1,62 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_RTC_INSTANCE_ -#define _SAMV71_RTC_INSTANCE_ - -/* ========== Register definition for RTC peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_RTC_CR (0x400E1860U) /**< \brief (RTC) Control Register */ - #define REG_RTC_MR (0x400E1864U) /**< \brief (RTC) Mode Register */ - #define REG_RTC_TIMR (0x400E1868U) /**< \brief (RTC) Time Register */ - #define REG_RTC_CALR (0x400E186CU) /**< \brief (RTC) Calendar Register */ - #define REG_RTC_TIMALR (0x400E1870U) /**< \brief (RTC) Time Alarm Register */ - #define REG_RTC_CALALR (0x400E1874U) /**< \brief (RTC) Calendar Alarm Register */ - #define REG_RTC_SR (0x400E1878U) /**< \brief (RTC) Status Register */ - #define REG_RTC_SCCR (0x400E187CU) /**< \brief (RTC) Status Clear Command Register */ - #define REG_RTC_IER (0x400E1880U) /**< \brief (RTC) Interrupt Enable Register */ - #define REG_RTC_IDR (0x400E1884U) /**< \brief (RTC) Interrupt Disable Register */ - #define REG_RTC_IMR (0x400E1888U) /**< \brief (RTC) Interrupt Mask Register */ - #define REG_RTC_VER (0x400E188CU) /**< \brief (RTC) Valid Entry Register */ -#else - #define REG_RTC_CR (*(__IO uint32_t*)0x400E1860U) /**< \brief (RTC) Control Register */ - #define REG_RTC_MR (*(__IO uint32_t*)0x400E1864U) /**< \brief (RTC) Mode Register */ - #define REG_RTC_TIMR (*(__IO uint32_t*)0x400E1868U) /**< \brief (RTC) Time Register */ - #define REG_RTC_CALR (*(__IO uint32_t*)0x400E186CU) /**< \brief (RTC) Calendar Register */ - #define REG_RTC_TIMALR (*(__IO uint32_t*)0x400E1870U) /**< \brief (RTC) Time Alarm Register */ - #define REG_RTC_CALALR (*(__IO uint32_t*)0x400E1874U) /**< \brief (RTC) Calendar Alarm Register */ - #define REG_RTC_SR (*(__I uint32_t*)0x400E1878U) /**< \brief (RTC) Status Register */ - #define REG_RTC_SCCR (*(__O uint32_t*)0x400E187CU) /**< \brief (RTC) Status Clear Command Register */ - #define REG_RTC_IER (*(__O uint32_t*)0x400E1880U) /**< \brief (RTC) Interrupt Enable Register */ - #define REG_RTC_IDR (*(__O uint32_t*)0x400E1884U) /**< \brief (RTC) Interrupt Disable Register */ - #define REG_RTC_IMR (*(__I uint32_t*)0x400E1888U) /**< \brief (RTC) Interrupt Mask Register */ - #define REG_RTC_VER (*(__I uint32_t*)0x400E188CU) /**< \brief (RTC) Valid Entry Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_RTC_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_rtt.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_rtt.h deleted file mode 100644 index 0c377a9a..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_rtt.h +++ /dev/null @@ -1,46 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_RTT_INSTANCE_ -#define _SAMV71_RTT_INSTANCE_ - -/* ========== Register definition for RTT peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_RTT_MR (0x400E1830U) /**< \brief (RTT) Mode Register */ - #define REG_RTT_AR (0x400E1834U) /**< \brief (RTT) Alarm Register */ - #define REG_RTT_VR (0x400E1838U) /**< \brief (RTT) Value Register */ - #define REG_RTT_SR (0x400E183CU) /**< \brief (RTT) Status Register */ -#else - #define REG_RTT_MR (*(__IO uint32_t*)0x400E1830U) /**< \brief (RTT) Mode Register */ - #define REG_RTT_AR (*(__IO uint32_t*)0x400E1834U) /**< \brief (RTT) Alarm Register */ - #define REG_RTT_VR (*(__I uint32_t*)0x400E1838U) /**< \brief (RTT) Value Register */ - #define REG_RTT_SR (*(__I uint32_t*)0x400E183CU) /**< \brief (RTT) Status Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_RTT_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_sdramc.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_sdramc.h deleted file mode 100644 index c6c603ef..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_sdramc.h +++ /dev/null @@ -1,64 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_SDRAMC_INSTANCE_ -#define _SAMV71_SDRAMC_INSTANCE_ - -/* ========== Register definition for SDRAMC peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_SDRAMC_MR (0x40084000U) /**< \brief (SDRAMC) SDRAMC Mode Register */ - #define REG_SDRAMC_TR (0x40084004U) /**< \brief (SDRAMC) SDRAMC Refresh Timer Register */ - #define REG_SDRAMC_CR (0x40084008U) /**< \brief (SDRAMC) SDRAMC Configuration Register */ - #define REG_SDRAMC_LPR (0x40084010U) /**< \brief (SDRAMC) SDRAMC Low Power Register */ - #define REG_SDRAMC_IER (0x40084014U) /**< \brief (SDRAMC) SDRAMC Interrupt Enable Register */ - #define REG_SDRAMC_IDR (0x40084018U) /**< \brief (SDRAMC) SDRAMC Interrupt Disable Register */ - #define REG_SDRAMC_IMR (0x4008401CU) /**< \brief (SDRAMC) SDRAMC Interrupt Mask Register */ - #define REG_SDRAMC_ISR (0x40084020U) /**< \brief (SDRAMC) SDRAMC Interrupt Status Register */ - #define REG_SDRAMC_MDR (0x40084024U) /**< \brief (SDRAMC) SDRAMC Memory Device Register */ - #define REG_SDRAMC_CFR1 (0x40084028U) /**< \brief (SDRAMC) SDRAMC Configuration Register 1 */ - #define REG_SDRAMC_OCMS (0x4008402CU) /**< \brief (SDRAMC) SDRAMC OCMS Register */ - #define REG_SDRAMC_OCMS_KEY1 (0x40084030U) /**< \brief (SDRAMC) SDRAMC OCMS KEY1 Register */ - #define REG_SDRAMC_OCMS_KEY2 (0x40084034U) /**< \brief (SDRAMC) SDRAMC OCMS KEY2 Register */ -#else - #define REG_SDRAMC_MR (*(__IO uint32_t*)0x40084000U) /**< \brief (SDRAMC) SDRAMC Mode Register */ - #define REG_SDRAMC_TR (*(__IO uint32_t*)0x40084004U) /**< \brief (SDRAMC) SDRAMC Refresh Timer Register */ - #define REG_SDRAMC_CR (*(__IO uint32_t*)0x40084008U) /**< \brief (SDRAMC) SDRAMC Configuration Register */ - #define REG_SDRAMC_LPR (*(__IO uint32_t*)0x40084010U) /**< \brief (SDRAMC) SDRAMC Low Power Register */ - #define REG_SDRAMC_IER (*(__O uint32_t*)0x40084014U) /**< \brief (SDRAMC) SDRAMC Interrupt Enable Register */ - #define REG_SDRAMC_IDR (*(__O uint32_t*)0x40084018U) /**< \brief (SDRAMC) SDRAMC Interrupt Disable Register */ - #define REG_SDRAMC_IMR (*(__I uint32_t*)0x4008401CU) /**< \brief (SDRAMC) SDRAMC Interrupt Mask Register */ - #define REG_SDRAMC_ISR (*(__I uint32_t*)0x40084020U) /**< \brief (SDRAMC) SDRAMC Interrupt Status Register */ - #define REG_SDRAMC_MDR (*(__IO uint32_t*)0x40084024U) /**< \brief (SDRAMC) SDRAMC Memory Device Register */ - #define REG_SDRAMC_CFR1 (*(__IO uint32_t*)0x40084028U) /**< \brief (SDRAMC) SDRAMC Configuration Register 1 */ - #define REG_SDRAMC_OCMS (*(__IO uint32_t*)0x4008402CU) /**< \brief (SDRAMC) SDRAMC OCMS Register */ - #define REG_SDRAMC_OCMS_KEY1 (*(__O uint32_t*)0x40084030U) /**< \brief (SDRAMC) SDRAMC OCMS KEY1 Register */ - #define REG_SDRAMC_OCMS_KEY2 (*(__O uint32_t*)0x40084034U) /**< \brief (SDRAMC) SDRAMC OCMS KEY2 Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_SDRAMC_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_smc.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_smc.h deleted file mode 100644 index cd0b6213..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_smc.h +++ /dev/null @@ -1,80 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_SMC_INSTANCE_ -#define _SAMV71_SMC_INSTANCE_ - -/* ========== Register definition for SMC peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_SMC_SETUP0 (0x40080000U) /**< \brief (SMC) SMC Setup Register (CS_number = 0) */ - #define REG_SMC_PULSE0 (0x40080004U) /**< \brief (SMC) SMC Pulse Register (CS_number = 0) */ - #define REG_SMC_CYCLE0 (0x40080008U) /**< \brief (SMC) SMC Cycle Register (CS_number = 0) */ - #define REG_SMC_MODE0 (0x4008000CU) /**< \brief (SMC) SMC MODE Register (CS_number = 0) */ - #define REG_SMC_SETUP1 (0x40080010U) /**< \brief (SMC) SMC Setup Register (CS_number = 1) */ - #define REG_SMC_PULSE1 (0x40080014U) /**< \brief (SMC) SMC Pulse Register (CS_number = 1) */ - #define REG_SMC_CYCLE1 (0x40080018U) /**< \brief (SMC) SMC Cycle Register (CS_number = 1) */ - #define REG_SMC_MODE1 (0x4008001CU) /**< \brief (SMC) SMC MODE Register (CS_number = 1) */ - #define REG_SMC_SETUP2 (0x40080020U) /**< \brief (SMC) SMC Setup Register (CS_number = 2) */ - #define REG_SMC_PULSE2 (0x40080024U) /**< \brief (SMC) SMC Pulse Register (CS_number = 2) */ - #define REG_SMC_CYCLE2 (0x40080028U) /**< \brief (SMC) SMC Cycle Register (CS_number = 2) */ - #define REG_SMC_MODE2 (0x4008002CU) /**< \brief (SMC) SMC MODE Register (CS_number = 2) */ - #define REG_SMC_SETUP3 (0x40080030U) /**< \brief (SMC) SMC Setup Register (CS_number = 3) */ - #define REG_SMC_PULSE3 (0x40080034U) /**< \brief (SMC) SMC Pulse Register (CS_number = 3) */ - #define REG_SMC_CYCLE3 (0x40080038U) /**< \brief (SMC) SMC Cycle Register (CS_number = 3) */ - #define REG_SMC_MODE3 (0x4008003CU) /**< \brief (SMC) SMC MODE Register (CS_number = 3) */ - #define REG_SMC_OCMS (0x40080080U) /**< \brief (SMC) SMC OCMS MODE Register */ - #define REG_SMC_KEY1 (0x40080084U) /**< \brief (SMC) SMC OCMS KEY1 Register */ - #define REG_SMC_KEY2 (0x40080088U) /**< \brief (SMC) SMC OCMS KEY2 Register */ - #define REG_SMC_WPMR (0x400800E4U) /**< \brief (SMC) SMC Write Protection Mode Register */ - #define REG_SMC_WPSR (0x400800E8U) /**< \brief (SMC) SMC Write Protection Status Register */ -#else - #define REG_SMC_SETUP0 (*(__IO uint32_t*)0x40080000U) /**< \brief (SMC) SMC Setup Register (CS_number = 0) */ - #define REG_SMC_PULSE0 (*(__IO uint32_t*)0x40080004U) /**< \brief (SMC) SMC Pulse Register (CS_number = 0) */ - #define REG_SMC_CYCLE0 (*(__IO uint32_t*)0x40080008U) /**< \brief (SMC) SMC Cycle Register (CS_number = 0) */ - #define REG_SMC_MODE0 (*(__IO uint32_t*)0x4008000CU) /**< \brief (SMC) SMC MODE Register (CS_number = 0) */ - #define REG_SMC_SETUP1 (*(__IO uint32_t*)0x40080010U) /**< \brief (SMC) SMC Setup Register (CS_number = 1) */ - #define REG_SMC_PULSE1 (*(__IO uint32_t*)0x40080014U) /**< \brief (SMC) SMC Pulse Register (CS_number = 1) */ - #define REG_SMC_CYCLE1 (*(__IO uint32_t*)0x40080018U) /**< \brief (SMC) SMC Cycle Register (CS_number = 1) */ - #define REG_SMC_MODE1 (*(__IO uint32_t*)0x4008001CU) /**< \brief (SMC) SMC MODE Register (CS_number = 1) */ - #define REG_SMC_SETUP2 (*(__IO uint32_t*)0x40080020U) /**< \brief (SMC) SMC Setup Register (CS_number = 2) */ - #define REG_SMC_PULSE2 (*(__IO uint32_t*)0x40080024U) /**< \brief (SMC) SMC Pulse Register (CS_number = 2) */ - #define REG_SMC_CYCLE2 (*(__IO uint32_t*)0x40080028U) /**< \brief (SMC) SMC Cycle Register (CS_number = 2) */ - #define REG_SMC_MODE2 (*(__IO uint32_t*)0x4008002CU) /**< \brief (SMC) SMC MODE Register (CS_number = 2) */ - #define REG_SMC_SETUP3 (*(__IO uint32_t*)0x40080030U) /**< \brief (SMC) SMC Setup Register (CS_number = 3) */ - #define REG_SMC_PULSE3 (*(__IO uint32_t*)0x40080034U) /**< \brief (SMC) SMC Pulse Register (CS_number = 3) */ - #define REG_SMC_CYCLE3 (*(__IO uint32_t*)0x40080038U) /**< \brief (SMC) SMC Cycle Register (CS_number = 3) */ - #define REG_SMC_MODE3 (*(__IO uint32_t*)0x4008003CU) /**< \brief (SMC) SMC MODE Register (CS_number = 3) */ - #define REG_SMC_OCMS (*(__IO uint32_t*)0x40080080U) /**< \brief (SMC) SMC OCMS MODE Register */ - #define REG_SMC_KEY1 (*(__O uint32_t*)0x40080084U) /**< \brief (SMC) SMC OCMS KEY1 Register */ - #define REG_SMC_KEY2 (*(__O uint32_t*)0x40080088U) /**< \brief (SMC) SMC OCMS KEY2 Register */ - #define REG_SMC_WPMR (*(__IO uint32_t*)0x400800E4U) /**< \brief (SMC) SMC Write Protection Mode Register */ - #define REG_SMC_WPSR (*(__I uint32_t*)0x400800E8U) /**< \brief (SMC) SMC Write Protection Status Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_SMC_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_spi0.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_spi0.h deleted file mode 100644 index 8d7bc3a0..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_spi0.h +++ /dev/null @@ -1,60 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_SPI0_INSTANCE_ -#define _SAMV71_SPI0_INSTANCE_ - -/* ========== Register definition for SPI0 peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_SPI0_CR (0x40008000U) /**< \brief (SPI0) Control Register */ - #define REG_SPI0_MR (0x40008004U) /**< \brief (SPI0) Mode Register */ - #define REG_SPI0_RDR (0x40008008U) /**< \brief (SPI0) Receive Data Register */ - #define REG_SPI0_TDR (0x4000800CU) /**< \brief (SPI0) Transmit Data Register */ - #define REG_SPI0_SR (0x40008010U) /**< \brief (SPI0) Status Register */ - #define REG_SPI0_IER (0x40008014U) /**< \brief (SPI0) Interrupt Enable Register */ - #define REG_SPI0_IDR (0x40008018U) /**< \brief (SPI0) Interrupt Disable Register */ - #define REG_SPI0_IMR (0x4000801CU) /**< \brief (SPI0) Interrupt Mask Register */ - #define REG_SPI0_CSR (0x40008030U) /**< \brief (SPI0) Chip Select Register */ - #define REG_SPI0_WPMR (0x400080E4U) /**< \brief (SPI0) Write Protection Mode Register */ - #define REG_SPI0_WPSR (0x400080E8U) /**< \brief (SPI0) Write Protection Status Register */ -#else - #define REG_SPI0_CR (*(__O uint32_t*)0x40008000U) /**< \brief (SPI0) Control Register */ - #define REG_SPI0_MR (*(__IO uint32_t*)0x40008004U) /**< \brief (SPI0) Mode Register */ - #define REG_SPI0_RDR (*(__I uint32_t*)0x40008008U) /**< \brief (SPI0) Receive Data Register */ - #define REG_SPI0_TDR (*(__O uint32_t*)0x4000800CU) /**< \brief (SPI0) Transmit Data Register */ - #define REG_SPI0_SR (*(__I uint32_t*)0x40008010U) /**< \brief (SPI0) Status Register */ - #define REG_SPI0_IER (*(__O uint32_t*)0x40008014U) /**< \brief (SPI0) Interrupt Enable Register */ - #define REG_SPI0_IDR (*(__O uint32_t*)0x40008018U) /**< \brief (SPI0) Interrupt Disable Register */ - #define REG_SPI0_IMR (*(__I uint32_t*)0x4000801CU) /**< \brief (SPI0) Interrupt Mask Register */ - #define REG_SPI0_CSR (*(__IO uint32_t*)0x40008030U) /**< \brief (SPI0) Chip Select Register */ - #define REG_SPI0_WPMR (*(__IO uint32_t*)0x400080E4U) /**< \brief (SPI0) Write Protection Mode Register */ - #define REG_SPI0_WPSR (*(__I uint32_t*)0x400080E8U) /**< \brief (SPI0) Write Protection Status Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_SPI0_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_spi1.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_spi1.h deleted file mode 100644 index 2b8443fb..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_spi1.h +++ /dev/null @@ -1,60 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_SPI1_INSTANCE_ -#define _SAMV71_SPI1_INSTANCE_ - -/* ========== Register definition for SPI1 peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_SPI1_CR (0x40058000U) /**< \brief (SPI1) Control Register */ - #define REG_SPI1_MR (0x40058004U) /**< \brief (SPI1) Mode Register */ - #define REG_SPI1_RDR (0x40058008U) /**< \brief (SPI1) Receive Data Register */ - #define REG_SPI1_TDR (0x4005800CU) /**< \brief (SPI1) Transmit Data Register */ - #define REG_SPI1_SR (0x40058010U) /**< \brief (SPI1) Status Register */ - #define REG_SPI1_IER (0x40058014U) /**< \brief (SPI1) Interrupt Enable Register */ - #define REG_SPI1_IDR (0x40058018U) /**< \brief (SPI1) Interrupt Disable Register */ - #define REG_SPI1_IMR (0x4005801CU) /**< \brief (SPI1) Interrupt Mask Register */ - #define REG_SPI1_CSR (0x40058030U) /**< \brief (SPI1) Chip Select Register */ - #define REG_SPI1_WPMR (0x400580E4U) /**< \brief (SPI1) Write Protection Mode Register */ - #define REG_SPI1_WPSR (0x400580E8U) /**< \brief (SPI1) Write Protection Status Register */ -#else - #define REG_SPI1_CR (*(__O uint32_t*)0x40058000U) /**< \brief (SPI1) Control Register */ - #define REG_SPI1_MR (*(__IO uint32_t*)0x40058004U) /**< \brief (SPI1) Mode Register */ - #define REG_SPI1_RDR (*(__I uint32_t*)0x40058008U) /**< \brief (SPI1) Receive Data Register */ - #define REG_SPI1_TDR (*(__O uint32_t*)0x4005800CU) /**< \brief (SPI1) Transmit Data Register */ - #define REG_SPI1_SR (*(__I uint32_t*)0x40058010U) /**< \brief (SPI1) Status Register */ - #define REG_SPI1_IER (*(__O uint32_t*)0x40058014U) /**< \brief (SPI1) Interrupt Enable Register */ - #define REG_SPI1_IDR (*(__O uint32_t*)0x40058018U) /**< \brief (SPI1) Interrupt Disable Register */ - #define REG_SPI1_IMR (*(__I uint32_t*)0x4005801CU) /**< \brief (SPI1) Interrupt Mask Register */ - #define REG_SPI1_CSR (*(__IO uint32_t*)0x40058030U) /**< \brief (SPI1) Chip Select Register */ - #define REG_SPI1_WPMR (*(__IO uint32_t*)0x400580E4U) /**< \brief (SPI1) Write Protection Mode Register */ - #define REG_SPI1_WPSR (*(__I uint32_t*)0x400580E8U) /**< \brief (SPI1) Write Protection Status Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_SPI1_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_ssc.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_ssc.h deleted file mode 100644 index 5522d2f8..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_ssc.h +++ /dev/null @@ -1,74 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_SSC_INSTANCE_ -#define _SAMV71_SSC_INSTANCE_ - -/* ========== Register definition for SSC peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_SSC_CR (0x40004000U) /**< \brief (SSC) Control Register */ - #define REG_SSC_CMR (0x40004004U) /**< \brief (SSC) Clock Mode Register */ - #define REG_SSC_RCMR (0x40004010U) /**< \brief (SSC) Receive Clock Mode Register */ - #define REG_SSC_RFMR (0x40004014U) /**< \brief (SSC) Receive Frame Mode Register */ - #define REG_SSC_TCMR (0x40004018U) /**< \brief (SSC) Transmit Clock Mode Register */ - #define REG_SSC_TFMR (0x4000401CU) /**< \brief (SSC) Transmit Frame Mode Register */ - #define REG_SSC_RHR (0x40004020U) /**< \brief (SSC) Receive Holding Register */ - #define REG_SSC_THR (0x40004024U) /**< \brief (SSC) Transmit Holding Register */ - #define REG_SSC_RSHR (0x40004030U) /**< \brief (SSC) Receive Sync. Holding Register */ - #define REG_SSC_TSHR (0x40004034U) /**< \brief (SSC) Transmit Sync. Holding Register */ - #define REG_SSC_RC0R (0x40004038U) /**< \brief (SSC) Receive Compare 0 Register */ - #define REG_SSC_RC1R (0x4000403CU) /**< \brief (SSC) Receive Compare 1 Register */ - #define REG_SSC_SR (0x40004040U) /**< \brief (SSC) Status Register */ - #define REG_SSC_IER (0x40004044U) /**< \brief (SSC) Interrupt Enable Register */ - #define REG_SSC_IDR (0x40004048U) /**< \brief (SSC) Interrupt Disable Register */ - #define REG_SSC_IMR (0x4000404CU) /**< \brief (SSC) Interrupt Mask Register */ - #define REG_SSC_WPMR (0x400040E4U) /**< \brief (SSC) Write Protection Mode Register */ - #define REG_SSC_WPSR (0x400040E8U) /**< \brief (SSC) Write Protection Status Register */ -#else - #define REG_SSC_CR (*(__O uint32_t*)0x40004000U) /**< \brief (SSC) Control Register */ - #define REG_SSC_CMR (*(__IO uint32_t*)0x40004004U) /**< \brief (SSC) Clock Mode Register */ - #define REG_SSC_RCMR (*(__IO uint32_t*)0x40004010U) /**< \brief (SSC) Receive Clock Mode Register */ - #define REG_SSC_RFMR (*(__IO uint32_t*)0x40004014U) /**< \brief (SSC) Receive Frame Mode Register */ - #define REG_SSC_TCMR (*(__IO uint32_t*)0x40004018U) /**< \brief (SSC) Transmit Clock Mode Register */ - #define REG_SSC_TFMR (*(__IO uint32_t*)0x4000401CU) /**< \brief (SSC) Transmit Frame Mode Register */ - #define REG_SSC_RHR (*(__I uint32_t*)0x40004020U) /**< \brief (SSC) Receive Holding Register */ - #define REG_SSC_THR (*(__O uint32_t*)0x40004024U) /**< \brief (SSC) Transmit Holding Register */ - #define REG_SSC_RSHR (*(__I uint32_t*)0x40004030U) /**< \brief (SSC) Receive Sync. Holding Register */ - #define REG_SSC_TSHR (*(__IO uint32_t*)0x40004034U) /**< \brief (SSC) Transmit Sync. Holding Register */ - #define REG_SSC_RC0R (*(__IO uint32_t*)0x40004038U) /**< \brief (SSC) Receive Compare 0 Register */ - #define REG_SSC_RC1R (*(__IO uint32_t*)0x4000403CU) /**< \brief (SSC) Receive Compare 1 Register */ - #define REG_SSC_SR (*(__I uint32_t*)0x40004040U) /**< \brief (SSC) Status Register */ - #define REG_SSC_IER (*(__O uint32_t*)0x40004044U) /**< \brief (SSC) Interrupt Enable Register */ - #define REG_SSC_IDR (*(__O uint32_t*)0x40004048U) /**< \brief (SSC) Interrupt Disable Register */ - #define REG_SSC_IMR (*(__I uint32_t*)0x4000404CU) /**< \brief (SSC) Interrupt Mask Register */ - #define REG_SSC_WPMR (*(__IO uint32_t*)0x400040E4U) /**< \brief (SSC) Write Protection Mode Register */ - #define REG_SSC_WPSR (*(__I uint32_t*)0x400040E8U) /**< \brief (SSC) Write Protection Status Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_SSC_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_supc.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_supc.h deleted file mode 100644 index 88c0f49d..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_supc.h +++ /dev/null @@ -1,50 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_SUPC_INSTANCE_ -#define _SAMV71_SUPC_INSTANCE_ - -/* ========== Register definition for SUPC peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_SUPC_CR (0x400E1810U) /**< \brief (SUPC) Supply Controller Control Register */ - #define REG_SUPC_SMMR (0x400E1814U) /**< \brief (SUPC) Supply Controller Supply Monitor Mode Register */ - #define REG_SUPC_MR (0x400E1818U) /**< \brief (SUPC) Supply Controller Mode Register */ - #define REG_SUPC_WUMR (0x400E181CU) /**< \brief (SUPC) Supply Controller Wake-up Mode Register */ - #define REG_SUPC_WUIR (0x400E1820U) /**< \brief (SUPC) Supply Controller Wake-up Inputs Register */ - #define REG_SUPC_SR (0x400E1824U) /**< \brief (SUPC) Supply Controller Status Register */ -#else - #define REG_SUPC_CR (*(__O uint32_t*)0x400E1810U) /**< \brief (SUPC) Supply Controller Control Register */ - #define REG_SUPC_SMMR (*(__IO uint32_t*)0x400E1814U) /**< \brief (SUPC) Supply Controller Supply Monitor Mode Register */ - #define REG_SUPC_MR (*(__IO uint32_t*)0x400E1818U) /**< \brief (SUPC) Supply Controller Mode Register */ - #define REG_SUPC_WUMR (*(__IO uint32_t*)0x400E181CU) /**< \brief (SUPC) Supply Controller Wake-up Mode Register */ - #define REG_SUPC_WUIR (*(__IO uint32_t*)0x400E1820U) /**< \brief (SUPC) Supply Controller Wake-up Inputs Register */ - #define REG_SUPC_SR (*(__I uint32_t*)0x400E1824U) /**< \brief (SUPC) Supply Controller Status Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_SUPC_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_tc0.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_tc0.h deleted file mode 100644 index 23cb2b94..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_tc0.h +++ /dev/null @@ -1,132 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_TC0_INSTANCE_ -#define _SAMV71_TC0_INSTANCE_ - -/* ========== Register definition for TC0 peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_TC0_CCR0 (0x4000C000U) /**< \brief (TC0) Channel Control Register (channel = 0) */ - #define REG_TC0_CMR0 (0x4000C004U) /**< \brief (TC0) Channel Mode Register (channel = 0) */ - #define REG_TC0_SMMR0 (0x4000C008U) /**< \brief (TC0) Stepper Motor Mode Register (channel = 0) */ - #define REG_TC0_RAB0 (0x4000C00CU) /**< \brief (TC0) Register AB (channel = 0) */ - #define REG_TC0_CV0 (0x4000C010U) /**< \brief (TC0) Counter Value (channel = 0) */ - #define REG_TC0_RA0 (0x4000C014U) /**< \brief (TC0) Register A (channel = 0) */ - #define REG_TC0_RB0 (0x4000C018U) /**< \brief (TC0) Register B (channel = 0) */ - #define REG_TC0_RC0 (0x4000C01CU) /**< \brief (TC0) Register C (channel = 0) */ - #define REG_TC0_SR0 (0x4000C020U) /**< \brief (TC0) Status Register (channel = 0) */ - #define REG_TC0_IER0 (0x4000C024U) /**< \brief (TC0) Interrupt Enable Register (channel = 0) */ - #define REG_TC0_IDR0 (0x4000C028U) /**< \brief (TC0) Interrupt Disable Register (channel = 0) */ - #define REG_TC0_IMR0 (0x4000C02CU) /**< \brief (TC0) Interrupt Mask Register (channel = 0) */ - #define REG_TC0_EMR0 (0x4000C030U) /**< \brief (TC0) Extended Mode Register (channel = 0) */ - #define REG_TC0_CCR1 (0x4000C040U) /**< \brief (TC0) Channel Control Register (channel = 1) */ - #define REG_TC0_CMR1 (0x4000C044U) /**< \brief (TC0) Channel Mode Register (channel = 1) */ - #define REG_TC0_SMMR1 (0x4000C048U) /**< \brief (TC0) Stepper Motor Mode Register (channel = 1) */ - #define REG_TC0_RAB1 (0x4000C04CU) /**< \brief (TC0) Register AB (channel = 1) */ - #define REG_TC0_CV1 (0x4000C050U) /**< \brief (TC0) Counter Value (channel = 1) */ - #define REG_TC0_RA1 (0x4000C054U) /**< \brief (TC0) Register A (channel = 1) */ - #define REG_TC0_RB1 (0x4000C058U) /**< \brief (TC0) Register B (channel = 1) */ - #define REG_TC0_RC1 (0x4000C05CU) /**< \brief (TC0) Register C (channel = 1) */ - #define REG_TC0_SR1 (0x4000C060U) /**< \brief (TC0) Status Register (channel = 1) */ - #define REG_TC0_IER1 (0x4000C064U) /**< \brief (TC0) Interrupt Enable Register (channel = 1) */ - #define REG_TC0_IDR1 (0x4000C068U) /**< \brief (TC0) Interrupt Disable Register (channel = 1) */ - #define REG_TC0_IMR1 (0x4000C06CU) /**< \brief (TC0) Interrupt Mask Register (channel = 1) */ - #define REG_TC0_EMR1 (0x4000C070U) /**< \brief (TC0) Extended Mode Register (channel = 1) */ - #define REG_TC0_CCR2 (0x4000C080U) /**< \brief (TC0) Channel Control Register (channel = 2) */ - #define REG_TC0_CMR2 (0x4000C084U) /**< \brief (TC0) Channel Mode Register (channel = 2) */ - #define REG_TC0_SMMR2 (0x4000C088U) /**< \brief (TC0) Stepper Motor Mode Register (channel = 2) */ - #define REG_TC0_RAB2 (0x4000C08CU) /**< \brief (TC0) Register AB (channel = 2) */ - #define REG_TC0_CV2 (0x4000C090U) /**< \brief (TC0) Counter Value (channel = 2) */ - #define REG_TC0_RA2 (0x4000C094U) /**< \brief (TC0) Register A (channel = 2) */ - #define REG_TC0_RB2 (0x4000C098U) /**< \brief (TC0) Register B (channel = 2) */ - #define REG_TC0_RC2 (0x4000C09CU) /**< \brief (TC0) Register C (channel = 2) */ - #define REG_TC0_SR2 (0x4000C0A0U) /**< \brief (TC0) Status Register (channel = 2) */ - #define REG_TC0_IER2 (0x4000C0A4U) /**< \brief (TC0) Interrupt Enable Register (channel = 2) */ - #define REG_TC0_IDR2 (0x4000C0A8U) /**< \brief (TC0) Interrupt Disable Register (channel = 2) */ - #define REG_TC0_IMR2 (0x4000C0ACU) /**< \brief (TC0) Interrupt Mask Register (channel = 2) */ - #define REG_TC0_EMR2 (0x4000C0B0U) /**< \brief (TC0) Extended Mode Register (channel = 2) */ - #define REG_TC0_BCR (0x4000C0C0U) /**< \brief (TC0) Block Control Register */ - #define REG_TC0_BMR (0x4000C0C4U) /**< \brief (TC0) Block Mode Register */ - #define REG_TC0_QIER (0x4000C0C8U) /**< \brief (TC0) QDEC Interrupt Enable Register */ - #define REG_TC0_QIDR (0x4000C0CCU) /**< \brief (TC0) QDEC Interrupt Disable Register */ - #define REG_TC0_QIMR (0x4000C0D0U) /**< \brief (TC0) QDEC Interrupt Mask Register */ - #define REG_TC0_QISR (0x4000C0D4U) /**< \brief (TC0) QDEC Interrupt Status Register */ - #define REG_TC0_FMR (0x4000C0D8U) /**< \brief (TC0) Fault Mode Register */ - #define REG_TC0_WPMR (0x4000C0E4U) /**< \brief (TC0) Write Protection Mode Register */ -#else - #define REG_TC0_CCR0 (*(__O uint32_t*)0x4000C000U) /**< \brief (TC0) Channel Control Register (channel = 0) */ - #define REG_TC0_CMR0 (*(__IO uint32_t*)0x4000C004U) /**< \brief (TC0) Channel Mode Register (channel = 0) */ - #define REG_TC0_SMMR0 (*(__IO uint32_t*)0x4000C008U) /**< \brief (TC0) Stepper Motor Mode Register (channel = 0) */ - #define REG_TC0_RAB0 (*(__I uint32_t*)0x4000C00CU) /**< \brief (TC0) Register AB (channel = 0) */ - #define REG_TC0_CV0 (*(__I uint32_t*)0x4000C010U) /**< \brief (TC0) Counter Value (channel = 0) */ - #define REG_TC0_RA0 (*(__IO uint32_t*)0x4000C014U) /**< \brief (TC0) Register A (channel = 0) */ - #define REG_TC0_RB0 (*(__IO uint32_t*)0x4000C018U) /**< \brief (TC0) Register B (channel = 0) */ - #define REG_TC0_RC0 (*(__IO uint32_t*)0x4000C01CU) /**< \brief (TC0) Register C (channel = 0) */ - #define REG_TC0_SR0 (*(__I uint32_t*)0x4000C020U) /**< \brief (TC0) Status Register (channel = 0) */ - #define REG_TC0_IER0 (*(__O uint32_t*)0x4000C024U) /**< \brief (TC0) Interrupt Enable Register (channel = 0) */ - #define REG_TC0_IDR0 (*(__O uint32_t*)0x4000C028U) /**< \brief (TC0) Interrupt Disable Register (channel = 0) */ - #define REG_TC0_IMR0 (*(__I uint32_t*)0x4000C02CU) /**< \brief (TC0) Interrupt Mask Register (channel = 0) */ - #define REG_TC0_EMR0 (*(__IO uint32_t*)0x4000C030U) /**< \brief (TC0) Extended Mode Register (channel = 0) */ - #define REG_TC0_CCR1 (*(__O uint32_t*)0x4000C040U) /**< \brief (TC0) Channel Control Register (channel = 1) */ - #define REG_TC0_CMR1 (*(__IO uint32_t*)0x4000C044U) /**< \brief (TC0) Channel Mode Register (channel = 1) */ - #define REG_TC0_SMMR1 (*(__IO uint32_t*)0x4000C048U) /**< \brief (TC0) Stepper Motor Mode Register (channel = 1) */ - #define REG_TC0_RAB1 (*(__I uint32_t*)0x4000C04CU) /**< \brief (TC0) Register AB (channel = 1) */ - #define REG_TC0_CV1 (*(__I uint32_t*)0x4000C050U) /**< \brief (TC0) Counter Value (channel = 1) */ - #define REG_TC0_RA1 (*(__IO uint32_t*)0x4000C054U) /**< \brief (TC0) Register A (channel = 1) */ - #define REG_TC0_RB1 (*(__IO uint32_t*)0x4000C058U) /**< \brief (TC0) Register B (channel = 1) */ - #define REG_TC0_RC1 (*(__IO uint32_t*)0x4000C05CU) /**< \brief (TC0) Register C (channel = 1) */ - #define REG_TC0_SR1 (*(__I uint32_t*)0x4000C060U) /**< \brief (TC0) Status Register (channel = 1) */ - #define REG_TC0_IER1 (*(__O uint32_t*)0x4000C064U) /**< \brief (TC0) Interrupt Enable Register (channel = 1) */ - #define REG_TC0_IDR1 (*(__O uint32_t*)0x4000C068U) /**< \brief (TC0) Interrupt Disable Register (channel = 1) */ - #define REG_TC0_IMR1 (*(__I uint32_t*)0x4000C06CU) /**< \brief (TC0) Interrupt Mask Register (channel = 1) */ - #define REG_TC0_EMR1 (*(__IO uint32_t*)0x4000C070U) /**< \brief (TC0) Extended Mode Register (channel = 1) */ - #define REG_TC0_CCR2 (*(__O uint32_t*)0x4000C080U) /**< \brief (TC0) Channel Control Register (channel = 2) */ - #define REG_TC0_CMR2 (*(__IO uint32_t*)0x4000C084U) /**< \brief (TC0) Channel Mode Register (channel = 2) */ - #define REG_TC0_SMMR2 (*(__IO uint32_t*)0x4000C088U) /**< \brief (TC0) Stepper Motor Mode Register (channel = 2) */ - #define REG_TC0_RAB2 (*(__I uint32_t*)0x4000C08CU) /**< \brief (TC0) Register AB (channel = 2) */ - #define REG_TC0_CV2 (*(__I uint32_t*)0x4000C090U) /**< \brief (TC0) Counter Value (channel = 2) */ - #define REG_TC0_RA2 (*(__IO uint32_t*)0x4000C094U) /**< \brief (TC0) Register A (channel = 2) */ - #define REG_TC0_RB2 (*(__IO uint32_t*)0x4000C098U) /**< \brief (TC0) Register B (channel = 2) */ - #define REG_TC0_RC2 (*(__IO uint32_t*)0x4000C09CU) /**< \brief (TC0) Register C (channel = 2) */ - #define REG_TC0_SR2 (*(__I uint32_t*)0x4000C0A0U) /**< \brief (TC0) Status Register (channel = 2) */ - #define REG_TC0_IER2 (*(__O uint32_t*)0x4000C0A4U) /**< \brief (TC0) Interrupt Enable Register (channel = 2) */ - #define REG_TC0_IDR2 (*(__O uint32_t*)0x4000C0A8U) /**< \brief (TC0) Interrupt Disable Register (channel = 2) */ - #define REG_TC0_IMR2 (*(__I uint32_t*)0x4000C0ACU) /**< \brief (TC0) Interrupt Mask Register (channel = 2) */ - #define REG_TC0_EMR2 (*(__IO uint32_t*)0x4000C0B0U) /**< \brief (TC0) Extended Mode Register (channel = 2) */ - #define REG_TC0_BCR (*(__O uint32_t*)0x4000C0C0U) /**< \brief (TC0) Block Control Register */ - #define REG_TC0_BMR (*(__IO uint32_t*)0x4000C0C4U) /**< \brief (TC0) Block Mode Register */ - #define REG_TC0_QIER (*(__O uint32_t*)0x4000C0C8U) /**< \brief (TC0) QDEC Interrupt Enable Register */ - #define REG_TC0_QIDR (*(__O uint32_t*)0x4000C0CCU) /**< \brief (TC0) QDEC Interrupt Disable Register */ - #define REG_TC0_QIMR (*(__I uint32_t*)0x4000C0D0U) /**< \brief (TC0) QDEC Interrupt Mask Register */ - #define REG_TC0_QISR (*(__I uint32_t*)0x4000C0D4U) /**< \brief (TC0) QDEC Interrupt Status Register */ - #define REG_TC0_FMR (*(__IO uint32_t*)0x4000C0D8U) /**< \brief (TC0) Fault Mode Register */ - #define REG_TC0_WPMR (*(__IO uint32_t*)0x4000C0E4U) /**< \brief (TC0) Write Protection Mode Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_TC0_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_tc1.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_tc1.h deleted file mode 100644 index 059c8d50..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_tc1.h +++ /dev/null @@ -1,132 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_TC1_INSTANCE_ -#define _SAMV71_TC1_INSTANCE_ - -/* ========== Register definition for TC1 peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_TC1_CCR0 (0x40010000U) /**< \brief (TC1) Channel Control Register (channel = 0) */ - #define REG_TC1_CMR0 (0x40010004U) /**< \brief (TC1) Channel Mode Register (channel = 0) */ - #define REG_TC1_SMMR0 (0x40010008U) /**< \brief (TC1) Stepper Motor Mode Register (channel = 0) */ - #define REG_TC1_RAB0 (0x4001000CU) /**< \brief (TC1) Register AB (channel = 0) */ - #define REG_TC1_CV0 (0x40010010U) /**< \brief (TC1) Counter Value (channel = 0) */ - #define REG_TC1_RA0 (0x40010014U) /**< \brief (TC1) Register A (channel = 0) */ - #define REG_TC1_RB0 (0x40010018U) /**< \brief (TC1) Register B (channel = 0) */ - #define REG_TC1_RC0 (0x4001001CU) /**< \brief (TC1) Register C (channel = 0) */ - #define REG_TC1_SR0 (0x40010020U) /**< \brief (TC1) Status Register (channel = 0) */ - #define REG_TC1_IER0 (0x40010024U) /**< \brief (TC1) Interrupt Enable Register (channel = 0) */ - #define REG_TC1_IDR0 (0x40010028U) /**< \brief (TC1) Interrupt Disable Register (channel = 0) */ - #define REG_TC1_IMR0 (0x4001002CU) /**< \brief (TC1) Interrupt Mask Register (channel = 0) */ - #define REG_TC1_EMR0 (0x40010030U) /**< \brief (TC1) Extended Mode Register (channel = 0) */ - #define REG_TC1_CCR1 (0x40010040U) /**< \brief (TC1) Channel Control Register (channel = 1) */ - #define REG_TC1_CMR1 (0x40010044U) /**< \brief (TC1) Channel Mode Register (channel = 1) */ - #define REG_TC1_SMMR1 (0x40010048U) /**< \brief (TC1) Stepper Motor Mode Register (channel = 1) */ - #define REG_TC1_RAB1 (0x4001004CU) /**< \brief (TC1) Register AB (channel = 1) */ - #define REG_TC1_CV1 (0x40010050U) /**< \brief (TC1) Counter Value (channel = 1) */ - #define REG_TC1_RA1 (0x40010054U) /**< \brief (TC1) Register A (channel = 1) */ - #define REG_TC1_RB1 (0x40010058U) /**< \brief (TC1) Register B (channel = 1) */ - #define REG_TC1_RC1 (0x4001005CU) /**< \brief (TC1) Register C (channel = 1) */ - #define REG_TC1_SR1 (0x40010060U) /**< \brief (TC1) Status Register (channel = 1) */ - #define REG_TC1_IER1 (0x40010064U) /**< \brief (TC1) Interrupt Enable Register (channel = 1) */ - #define REG_TC1_IDR1 (0x40010068U) /**< \brief (TC1) Interrupt Disable Register (channel = 1) */ - #define REG_TC1_IMR1 (0x4001006CU) /**< \brief (TC1) Interrupt Mask Register (channel = 1) */ - #define REG_TC1_EMR1 (0x40010070U) /**< \brief (TC1) Extended Mode Register (channel = 1) */ - #define REG_TC1_CCR2 (0x40010080U) /**< \brief (TC1) Channel Control Register (channel = 2) */ - #define REG_TC1_CMR2 (0x40010084U) /**< \brief (TC1) Channel Mode Register (channel = 2) */ - #define REG_TC1_SMMR2 (0x40010088U) /**< \brief (TC1) Stepper Motor Mode Register (channel = 2) */ - #define REG_TC1_RAB2 (0x4001008CU) /**< \brief (TC1) Register AB (channel = 2) */ - #define REG_TC1_CV2 (0x40010090U) /**< \brief (TC1) Counter Value (channel = 2) */ - #define REG_TC1_RA2 (0x40010094U) /**< \brief (TC1) Register A (channel = 2) */ - #define REG_TC1_RB2 (0x40010098U) /**< \brief (TC1) Register B (channel = 2) */ - #define REG_TC1_RC2 (0x4001009CU) /**< \brief (TC1) Register C (channel = 2) */ - #define REG_TC1_SR2 (0x400100A0U) /**< \brief (TC1) Status Register (channel = 2) */ - #define REG_TC1_IER2 (0x400100A4U) /**< \brief (TC1) Interrupt Enable Register (channel = 2) */ - #define REG_TC1_IDR2 (0x400100A8U) /**< \brief (TC1) Interrupt Disable Register (channel = 2) */ - #define REG_TC1_IMR2 (0x400100ACU) /**< \brief (TC1) Interrupt Mask Register (channel = 2) */ - #define REG_TC1_EMR2 (0x400100B0U) /**< \brief (TC1) Extended Mode Register (channel = 2) */ - #define REG_TC1_BCR (0x400100C0U) /**< \brief (TC1) Block Control Register */ - #define REG_TC1_BMR (0x400100C4U) /**< \brief (TC1) Block Mode Register */ - #define REG_TC1_QIER (0x400100C8U) /**< \brief (TC1) QDEC Interrupt Enable Register */ - #define REG_TC1_QIDR (0x400100CCU) /**< \brief (TC1) QDEC Interrupt Disable Register */ - #define REG_TC1_QIMR (0x400100D0U) /**< \brief (TC1) QDEC Interrupt Mask Register */ - #define REG_TC1_QISR (0x400100D4U) /**< \brief (TC1) QDEC Interrupt Status Register */ - #define REG_TC1_FMR (0x400100D8U) /**< \brief (TC1) Fault Mode Register */ - #define REG_TC1_WPMR (0x400100E4U) /**< \brief (TC1) Write Protection Mode Register */ -#else - #define REG_TC1_CCR0 (*(__O uint32_t*)0x40010000U) /**< \brief (TC1) Channel Control Register (channel = 0) */ - #define REG_TC1_CMR0 (*(__IO uint32_t*)0x40010004U) /**< \brief (TC1) Channel Mode Register (channel = 0) */ - #define REG_TC1_SMMR0 (*(__IO uint32_t*)0x40010008U) /**< \brief (TC1) Stepper Motor Mode Register (channel = 0) */ - #define REG_TC1_RAB0 (*(__I uint32_t*)0x4001000CU) /**< \brief (TC1) Register AB (channel = 0) */ - #define REG_TC1_CV0 (*(__I uint32_t*)0x40010010U) /**< \brief (TC1) Counter Value (channel = 0) */ - #define REG_TC1_RA0 (*(__IO uint32_t*)0x40010014U) /**< \brief (TC1) Register A (channel = 0) */ - #define REG_TC1_RB0 (*(__IO uint32_t*)0x40010018U) /**< \brief (TC1) Register B (channel = 0) */ - #define REG_TC1_RC0 (*(__IO uint32_t*)0x4001001CU) /**< \brief (TC1) Register C (channel = 0) */ - #define REG_TC1_SR0 (*(__I uint32_t*)0x40010020U) /**< \brief (TC1) Status Register (channel = 0) */ - #define REG_TC1_IER0 (*(__O uint32_t*)0x40010024U) /**< \brief (TC1) Interrupt Enable Register (channel = 0) */ - #define REG_TC1_IDR0 (*(__O uint32_t*)0x40010028U) /**< \brief (TC1) Interrupt Disable Register (channel = 0) */ - #define REG_TC1_IMR0 (*(__I uint32_t*)0x4001002CU) /**< \brief (TC1) Interrupt Mask Register (channel = 0) */ - #define REG_TC1_EMR0 (*(__IO uint32_t*)0x40010030U) /**< \brief (TC1) Extended Mode Register (channel = 0) */ - #define REG_TC1_CCR1 (*(__O uint32_t*)0x40010040U) /**< \brief (TC1) Channel Control Register (channel = 1) */ - #define REG_TC1_CMR1 (*(__IO uint32_t*)0x40010044U) /**< \brief (TC1) Channel Mode Register (channel = 1) */ - #define REG_TC1_SMMR1 (*(__IO uint32_t*)0x40010048U) /**< \brief (TC1) Stepper Motor Mode Register (channel = 1) */ - #define REG_TC1_RAB1 (*(__I uint32_t*)0x4001004CU) /**< \brief (TC1) Register AB (channel = 1) */ - #define REG_TC1_CV1 (*(__I uint32_t*)0x40010050U) /**< \brief (TC1) Counter Value (channel = 1) */ - #define REG_TC1_RA1 (*(__IO uint32_t*)0x40010054U) /**< \brief (TC1) Register A (channel = 1) */ - #define REG_TC1_RB1 (*(__IO uint32_t*)0x40010058U) /**< \brief (TC1) Register B (channel = 1) */ - #define REG_TC1_RC1 (*(__IO uint32_t*)0x4001005CU) /**< \brief (TC1) Register C (channel = 1) */ - #define REG_TC1_SR1 (*(__I uint32_t*)0x40010060U) /**< \brief (TC1) Status Register (channel = 1) */ - #define REG_TC1_IER1 (*(__O uint32_t*)0x40010064U) /**< \brief (TC1) Interrupt Enable Register (channel = 1) */ - #define REG_TC1_IDR1 (*(__O uint32_t*)0x40010068U) /**< \brief (TC1) Interrupt Disable Register (channel = 1) */ - #define REG_TC1_IMR1 (*(__I uint32_t*)0x4001006CU) /**< \brief (TC1) Interrupt Mask Register (channel = 1) */ - #define REG_TC1_EMR1 (*(__IO uint32_t*)0x40010070U) /**< \brief (TC1) Extended Mode Register (channel = 1) */ - #define REG_TC1_CCR2 (*(__O uint32_t*)0x40010080U) /**< \brief (TC1) Channel Control Register (channel = 2) */ - #define REG_TC1_CMR2 (*(__IO uint32_t*)0x40010084U) /**< \brief (TC1) Channel Mode Register (channel = 2) */ - #define REG_TC1_SMMR2 (*(__IO uint32_t*)0x40010088U) /**< \brief (TC1) Stepper Motor Mode Register (channel = 2) */ - #define REG_TC1_RAB2 (*(__I uint32_t*)0x4001008CU) /**< \brief (TC1) Register AB (channel = 2) */ - #define REG_TC1_CV2 (*(__I uint32_t*)0x40010090U) /**< \brief (TC1) Counter Value (channel = 2) */ - #define REG_TC1_RA2 (*(__IO uint32_t*)0x40010094U) /**< \brief (TC1) Register A (channel = 2) */ - #define REG_TC1_RB2 (*(__IO uint32_t*)0x40010098U) /**< \brief (TC1) Register B (channel = 2) */ - #define REG_TC1_RC2 (*(__IO uint32_t*)0x4001009CU) /**< \brief (TC1) Register C (channel = 2) */ - #define REG_TC1_SR2 (*(__I uint32_t*)0x400100A0U) /**< \brief (TC1) Status Register (channel = 2) */ - #define REG_TC1_IER2 (*(__O uint32_t*)0x400100A4U) /**< \brief (TC1) Interrupt Enable Register (channel = 2) */ - #define REG_TC1_IDR2 (*(__O uint32_t*)0x400100A8U) /**< \brief (TC1) Interrupt Disable Register (channel = 2) */ - #define REG_TC1_IMR2 (*(__I uint32_t*)0x400100ACU) /**< \brief (TC1) Interrupt Mask Register (channel = 2) */ - #define REG_TC1_EMR2 (*(__IO uint32_t*)0x400100B0U) /**< \brief (TC1) Extended Mode Register (channel = 2) */ - #define REG_TC1_BCR (*(__O uint32_t*)0x400100C0U) /**< \brief (TC1) Block Control Register */ - #define REG_TC1_BMR (*(__IO uint32_t*)0x400100C4U) /**< \brief (TC1) Block Mode Register */ - #define REG_TC1_QIER (*(__O uint32_t*)0x400100C8U) /**< \brief (TC1) QDEC Interrupt Enable Register */ - #define REG_TC1_QIDR (*(__O uint32_t*)0x400100CCU) /**< \brief (TC1) QDEC Interrupt Disable Register */ - #define REG_TC1_QIMR (*(__I uint32_t*)0x400100D0U) /**< \brief (TC1) QDEC Interrupt Mask Register */ - #define REG_TC1_QISR (*(__I uint32_t*)0x400100D4U) /**< \brief (TC1) QDEC Interrupt Status Register */ - #define REG_TC1_FMR (*(__IO uint32_t*)0x400100D8U) /**< \brief (TC1) Fault Mode Register */ - #define REG_TC1_WPMR (*(__IO uint32_t*)0x400100E4U) /**< \brief (TC1) Write Protection Mode Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_TC1_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_tc2.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_tc2.h deleted file mode 100644 index 4d8ba52f..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_tc2.h +++ /dev/null @@ -1,132 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_TC2_INSTANCE_ -#define _SAMV71_TC2_INSTANCE_ - -/* ========== Register definition for TC2 peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_TC2_CCR0 (0x40014000U) /**< \brief (TC2) Channel Control Register (channel = 0) */ - #define REG_TC2_CMR0 (0x40014004U) /**< \brief (TC2) Channel Mode Register (channel = 0) */ - #define REG_TC2_SMMR0 (0x40014008U) /**< \brief (TC2) Stepper Motor Mode Register (channel = 0) */ - #define REG_TC2_RAB0 (0x4001400CU) /**< \brief (TC2) Register AB (channel = 0) */ - #define REG_TC2_CV0 (0x40014010U) /**< \brief (TC2) Counter Value (channel = 0) */ - #define REG_TC2_RA0 (0x40014014U) /**< \brief (TC2) Register A (channel = 0) */ - #define REG_TC2_RB0 (0x40014018U) /**< \brief (TC2) Register B (channel = 0) */ - #define REG_TC2_RC0 (0x4001401CU) /**< \brief (TC2) Register C (channel = 0) */ - #define REG_TC2_SR0 (0x40014020U) /**< \brief (TC2) Status Register (channel = 0) */ - #define REG_TC2_IER0 (0x40014024U) /**< \brief (TC2) Interrupt Enable Register (channel = 0) */ - #define REG_TC2_IDR0 (0x40014028U) /**< \brief (TC2) Interrupt Disable Register (channel = 0) */ - #define REG_TC2_IMR0 (0x4001402CU) /**< \brief (TC2) Interrupt Mask Register (channel = 0) */ - #define REG_TC2_EMR0 (0x40014030U) /**< \brief (TC2) Extended Mode Register (channel = 0) */ - #define REG_TC2_CCR1 (0x40014040U) /**< \brief (TC2) Channel Control Register (channel = 1) */ - #define REG_TC2_CMR1 (0x40014044U) /**< \brief (TC2) Channel Mode Register (channel = 1) */ - #define REG_TC2_SMMR1 (0x40014048U) /**< \brief (TC2) Stepper Motor Mode Register (channel = 1) */ - #define REG_TC2_RAB1 (0x4001404CU) /**< \brief (TC2) Register AB (channel = 1) */ - #define REG_TC2_CV1 (0x40014050U) /**< \brief (TC2) Counter Value (channel = 1) */ - #define REG_TC2_RA1 (0x40014054U) /**< \brief (TC2) Register A (channel = 1) */ - #define REG_TC2_RB1 (0x40014058U) /**< \brief (TC2) Register B (channel = 1) */ - #define REG_TC2_RC1 (0x4001405CU) /**< \brief (TC2) Register C (channel = 1) */ - #define REG_TC2_SR1 (0x40014060U) /**< \brief (TC2) Status Register (channel = 1) */ - #define REG_TC2_IER1 (0x40014064U) /**< \brief (TC2) Interrupt Enable Register (channel = 1) */ - #define REG_TC2_IDR1 (0x40014068U) /**< \brief (TC2) Interrupt Disable Register (channel = 1) */ - #define REG_TC2_IMR1 (0x4001406CU) /**< \brief (TC2) Interrupt Mask Register (channel = 1) */ - #define REG_TC2_EMR1 (0x40014070U) /**< \brief (TC2) Extended Mode Register (channel = 1) */ - #define REG_TC2_CCR2 (0x40014080U) /**< \brief (TC2) Channel Control Register (channel = 2) */ - #define REG_TC2_CMR2 (0x40014084U) /**< \brief (TC2) Channel Mode Register (channel = 2) */ - #define REG_TC2_SMMR2 (0x40014088U) /**< \brief (TC2) Stepper Motor Mode Register (channel = 2) */ - #define REG_TC2_RAB2 (0x4001408CU) /**< \brief (TC2) Register AB (channel = 2) */ - #define REG_TC2_CV2 (0x40014090U) /**< \brief (TC2) Counter Value (channel = 2) */ - #define REG_TC2_RA2 (0x40014094U) /**< \brief (TC2) Register A (channel = 2) */ - #define REG_TC2_RB2 (0x40014098U) /**< \brief (TC2) Register B (channel = 2) */ - #define REG_TC2_RC2 (0x4001409CU) /**< \brief (TC2) Register C (channel = 2) */ - #define REG_TC2_SR2 (0x400140A0U) /**< \brief (TC2) Status Register (channel = 2) */ - #define REG_TC2_IER2 (0x400140A4U) /**< \brief (TC2) Interrupt Enable Register (channel = 2) */ - #define REG_TC2_IDR2 (0x400140A8U) /**< \brief (TC2) Interrupt Disable Register (channel = 2) */ - #define REG_TC2_IMR2 (0x400140ACU) /**< \brief (TC2) Interrupt Mask Register (channel = 2) */ - #define REG_TC2_EMR2 (0x400140B0U) /**< \brief (TC2) Extended Mode Register (channel = 2) */ - #define REG_TC2_BCR (0x400140C0U) /**< \brief (TC2) Block Control Register */ - #define REG_TC2_BMR (0x400140C4U) /**< \brief (TC2) Block Mode Register */ - #define REG_TC2_QIER (0x400140C8U) /**< \brief (TC2) QDEC Interrupt Enable Register */ - #define REG_TC2_QIDR (0x400140CCU) /**< \brief (TC2) QDEC Interrupt Disable Register */ - #define REG_TC2_QIMR (0x400140D0U) /**< \brief (TC2) QDEC Interrupt Mask Register */ - #define REG_TC2_QISR (0x400140D4U) /**< \brief (TC2) QDEC Interrupt Status Register */ - #define REG_TC2_FMR (0x400140D8U) /**< \brief (TC2) Fault Mode Register */ - #define REG_TC2_WPMR (0x400140E4U) /**< \brief (TC2) Write Protection Mode Register */ -#else - #define REG_TC2_CCR0 (*(__O uint32_t*)0x40014000U) /**< \brief (TC2) Channel Control Register (channel = 0) */ - #define REG_TC2_CMR0 (*(__IO uint32_t*)0x40014004U) /**< \brief (TC2) Channel Mode Register (channel = 0) */ - #define REG_TC2_SMMR0 (*(__IO uint32_t*)0x40014008U) /**< \brief (TC2) Stepper Motor Mode Register (channel = 0) */ - #define REG_TC2_RAB0 (*(__I uint32_t*)0x4001400CU) /**< \brief (TC2) Register AB (channel = 0) */ - #define REG_TC2_CV0 (*(__I uint32_t*)0x40014010U) /**< \brief (TC2) Counter Value (channel = 0) */ - #define REG_TC2_RA0 (*(__IO uint32_t*)0x40014014U) /**< \brief (TC2) Register A (channel = 0) */ - #define REG_TC2_RB0 (*(__IO uint32_t*)0x40014018U) /**< \brief (TC2) Register B (channel = 0) */ - #define REG_TC2_RC0 (*(__IO uint32_t*)0x4001401CU) /**< \brief (TC2) Register C (channel = 0) */ - #define REG_TC2_SR0 (*(__I uint32_t*)0x40014020U) /**< \brief (TC2) Status Register (channel = 0) */ - #define REG_TC2_IER0 (*(__O uint32_t*)0x40014024U) /**< \brief (TC2) Interrupt Enable Register (channel = 0) */ - #define REG_TC2_IDR0 (*(__O uint32_t*)0x40014028U) /**< \brief (TC2) Interrupt Disable Register (channel = 0) */ - #define REG_TC2_IMR0 (*(__I uint32_t*)0x4001402CU) /**< \brief (TC2) Interrupt Mask Register (channel = 0) */ - #define REG_TC2_EMR0 (*(__IO uint32_t*)0x40014030U) /**< \brief (TC2) Extended Mode Register (channel = 0) */ - #define REG_TC2_CCR1 (*(__O uint32_t*)0x40014040U) /**< \brief (TC2) Channel Control Register (channel = 1) */ - #define REG_TC2_CMR1 (*(__IO uint32_t*)0x40014044U) /**< \brief (TC2) Channel Mode Register (channel = 1) */ - #define REG_TC2_SMMR1 (*(__IO uint32_t*)0x40014048U) /**< \brief (TC2) Stepper Motor Mode Register (channel = 1) */ - #define REG_TC2_RAB1 (*(__I uint32_t*)0x4001404CU) /**< \brief (TC2) Register AB (channel = 1) */ - #define REG_TC2_CV1 (*(__I uint32_t*)0x40014050U) /**< \brief (TC2) Counter Value (channel = 1) */ - #define REG_TC2_RA1 (*(__IO uint32_t*)0x40014054U) /**< \brief (TC2) Register A (channel = 1) */ - #define REG_TC2_RB1 (*(__IO uint32_t*)0x40014058U) /**< \brief (TC2) Register B (channel = 1) */ - #define REG_TC2_RC1 (*(__IO uint32_t*)0x4001405CU) /**< \brief (TC2) Register C (channel = 1) */ - #define REG_TC2_SR1 (*(__I uint32_t*)0x40014060U) /**< \brief (TC2) Status Register (channel = 1) */ - #define REG_TC2_IER1 (*(__O uint32_t*)0x40014064U) /**< \brief (TC2) Interrupt Enable Register (channel = 1) */ - #define REG_TC2_IDR1 (*(__O uint32_t*)0x40014068U) /**< \brief (TC2) Interrupt Disable Register (channel = 1) */ - #define REG_TC2_IMR1 (*(__I uint32_t*)0x4001406CU) /**< \brief (TC2) Interrupt Mask Register (channel = 1) */ - #define REG_TC2_EMR1 (*(__IO uint32_t*)0x40014070U) /**< \brief (TC2) Extended Mode Register (channel = 1) */ - #define REG_TC2_CCR2 (*(__O uint32_t*)0x40014080U) /**< \brief (TC2) Channel Control Register (channel = 2) */ - #define REG_TC2_CMR2 (*(__IO uint32_t*)0x40014084U) /**< \brief (TC2) Channel Mode Register (channel = 2) */ - #define REG_TC2_SMMR2 (*(__IO uint32_t*)0x40014088U) /**< \brief (TC2) Stepper Motor Mode Register (channel = 2) */ - #define REG_TC2_RAB2 (*(__I uint32_t*)0x4001408CU) /**< \brief (TC2) Register AB (channel = 2) */ - #define REG_TC2_CV2 (*(__I uint32_t*)0x40014090U) /**< \brief (TC2) Counter Value (channel = 2) */ - #define REG_TC2_RA2 (*(__IO uint32_t*)0x40014094U) /**< \brief (TC2) Register A (channel = 2) */ - #define REG_TC2_RB2 (*(__IO uint32_t*)0x40014098U) /**< \brief (TC2) Register B (channel = 2) */ - #define REG_TC2_RC2 (*(__IO uint32_t*)0x4001409CU) /**< \brief (TC2) Register C (channel = 2) */ - #define REG_TC2_SR2 (*(__I uint32_t*)0x400140A0U) /**< \brief (TC2) Status Register (channel = 2) */ - #define REG_TC2_IER2 (*(__O uint32_t*)0x400140A4U) /**< \brief (TC2) Interrupt Enable Register (channel = 2) */ - #define REG_TC2_IDR2 (*(__O uint32_t*)0x400140A8U) /**< \brief (TC2) Interrupt Disable Register (channel = 2) */ - #define REG_TC2_IMR2 (*(__I uint32_t*)0x400140ACU) /**< \brief (TC2) Interrupt Mask Register (channel = 2) */ - #define REG_TC2_EMR2 (*(__IO uint32_t*)0x400140B0U) /**< \brief (TC2) Extended Mode Register (channel = 2) */ - #define REG_TC2_BCR (*(__O uint32_t*)0x400140C0U) /**< \brief (TC2) Block Control Register */ - #define REG_TC2_BMR (*(__IO uint32_t*)0x400140C4U) /**< \brief (TC2) Block Mode Register */ - #define REG_TC2_QIER (*(__O uint32_t*)0x400140C8U) /**< \brief (TC2) QDEC Interrupt Enable Register */ - #define REG_TC2_QIDR (*(__O uint32_t*)0x400140CCU) /**< \brief (TC2) QDEC Interrupt Disable Register */ - #define REG_TC2_QIMR (*(__I uint32_t*)0x400140D0U) /**< \brief (TC2) QDEC Interrupt Mask Register */ - #define REG_TC2_QISR (*(__I uint32_t*)0x400140D4U) /**< \brief (TC2) QDEC Interrupt Status Register */ - #define REG_TC2_FMR (*(__IO uint32_t*)0x400140D8U) /**< \brief (TC2) Fault Mode Register */ - #define REG_TC2_WPMR (*(__IO uint32_t*)0x400140E4U) /**< \brief (TC2) Write Protection Mode Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_TC2_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_tc3.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_tc3.h deleted file mode 100644 index 20ea7e42..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_tc3.h +++ /dev/null @@ -1,132 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_TC3_INSTANCE_ -#define _SAMV71_TC3_INSTANCE_ - -/* ========== Register definition for TC3 peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_TC3_CCR0 (0x40054000U) /**< \brief (TC3) Channel Control Register (channel = 0) */ - #define REG_TC3_CMR0 (0x40054004U) /**< \brief (TC3) Channel Mode Register (channel = 0) */ - #define REG_TC3_SMMR0 (0x40054008U) /**< \brief (TC3) Stepper Motor Mode Register (channel = 0) */ - #define REG_TC3_RAB0 (0x4005400CU) /**< \brief (TC3) Register AB (channel = 0) */ - #define REG_TC3_CV0 (0x40054010U) /**< \brief (TC3) Counter Value (channel = 0) */ - #define REG_TC3_RA0 (0x40054014U) /**< \brief (TC3) Register A (channel = 0) */ - #define REG_TC3_RB0 (0x40054018U) /**< \brief (TC3) Register B (channel = 0) */ - #define REG_TC3_RC0 (0x4005401CU) /**< \brief (TC3) Register C (channel = 0) */ - #define REG_TC3_SR0 (0x40054020U) /**< \brief (TC3) Status Register (channel = 0) */ - #define REG_TC3_IER0 (0x40054024U) /**< \brief (TC3) Interrupt Enable Register (channel = 0) */ - #define REG_TC3_IDR0 (0x40054028U) /**< \brief (TC3) Interrupt Disable Register (channel = 0) */ - #define REG_TC3_IMR0 (0x4005402CU) /**< \brief (TC3) Interrupt Mask Register (channel = 0) */ - #define REG_TC3_EMR0 (0x40054030U) /**< \brief (TC3) Extended Mode Register (channel = 0) */ - #define REG_TC3_CCR1 (0x40054040U) /**< \brief (TC3) Channel Control Register (channel = 1) */ - #define REG_TC3_CMR1 (0x40054044U) /**< \brief (TC3) Channel Mode Register (channel = 1) */ - #define REG_TC3_SMMR1 (0x40054048U) /**< \brief (TC3) Stepper Motor Mode Register (channel = 1) */ - #define REG_TC3_RAB1 (0x4005404CU) /**< \brief (TC3) Register AB (channel = 1) */ - #define REG_TC3_CV1 (0x40054050U) /**< \brief (TC3) Counter Value (channel = 1) */ - #define REG_TC3_RA1 (0x40054054U) /**< \brief (TC3) Register A (channel = 1) */ - #define REG_TC3_RB1 (0x40054058U) /**< \brief (TC3) Register B (channel = 1) */ - #define REG_TC3_RC1 (0x4005405CU) /**< \brief (TC3) Register C (channel = 1) */ - #define REG_TC3_SR1 (0x40054060U) /**< \brief (TC3) Status Register (channel = 1) */ - #define REG_TC3_IER1 (0x40054064U) /**< \brief (TC3) Interrupt Enable Register (channel = 1) */ - #define REG_TC3_IDR1 (0x40054068U) /**< \brief (TC3) Interrupt Disable Register (channel = 1) */ - #define REG_TC3_IMR1 (0x4005406CU) /**< \brief (TC3) Interrupt Mask Register (channel = 1) */ - #define REG_TC3_EMR1 (0x40054070U) /**< \brief (TC3) Extended Mode Register (channel = 1) */ - #define REG_TC3_CCR2 (0x40054080U) /**< \brief (TC3) Channel Control Register (channel = 2) */ - #define REG_TC3_CMR2 (0x40054084U) /**< \brief (TC3) Channel Mode Register (channel = 2) */ - #define REG_TC3_SMMR2 (0x40054088U) /**< \brief (TC3) Stepper Motor Mode Register (channel = 2) */ - #define REG_TC3_RAB2 (0x4005408CU) /**< \brief (TC3) Register AB (channel = 2) */ - #define REG_TC3_CV2 (0x40054090U) /**< \brief (TC3) Counter Value (channel = 2) */ - #define REG_TC3_RA2 (0x40054094U) /**< \brief (TC3) Register A (channel = 2) */ - #define REG_TC3_RB2 (0x40054098U) /**< \brief (TC3) Register B (channel = 2) */ - #define REG_TC3_RC2 (0x4005409CU) /**< \brief (TC3) Register C (channel = 2) */ - #define REG_TC3_SR2 (0x400540A0U) /**< \brief (TC3) Status Register (channel = 2) */ - #define REG_TC3_IER2 (0x400540A4U) /**< \brief (TC3) Interrupt Enable Register (channel = 2) */ - #define REG_TC3_IDR2 (0x400540A8U) /**< \brief (TC3) Interrupt Disable Register (channel = 2) */ - #define REG_TC3_IMR2 (0x400540ACU) /**< \brief (TC3) Interrupt Mask Register (channel = 2) */ - #define REG_TC3_EMR2 (0x400540B0U) /**< \brief (TC3) Extended Mode Register (channel = 2) */ - #define REG_TC3_BCR (0x400540C0U) /**< \brief (TC3) Block Control Register */ - #define REG_TC3_BMR (0x400540C4U) /**< \brief (TC3) Block Mode Register */ - #define REG_TC3_QIER (0x400540C8U) /**< \brief (TC3) QDEC Interrupt Enable Register */ - #define REG_TC3_QIDR (0x400540CCU) /**< \brief (TC3) QDEC Interrupt Disable Register */ - #define REG_TC3_QIMR (0x400540D0U) /**< \brief (TC3) QDEC Interrupt Mask Register */ - #define REG_TC3_QISR (0x400540D4U) /**< \brief (TC3) QDEC Interrupt Status Register */ - #define REG_TC3_FMR (0x400540D8U) /**< \brief (TC3) Fault Mode Register */ - #define REG_TC3_WPMR (0x400540E4U) /**< \brief (TC3) Write Protection Mode Register */ -#else - #define REG_TC3_CCR0 (*(__O uint32_t*)0x40054000U) /**< \brief (TC3) Channel Control Register (channel = 0) */ - #define REG_TC3_CMR0 (*(__IO uint32_t*)0x40054004U) /**< \brief (TC3) Channel Mode Register (channel = 0) */ - #define REG_TC3_SMMR0 (*(__IO uint32_t*)0x40054008U) /**< \brief (TC3) Stepper Motor Mode Register (channel = 0) */ - #define REG_TC3_RAB0 (*(__I uint32_t*)0x4005400CU) /**< \brief (TC3) Register AB (channel = 0) */ - #define REG_TC3_CV0 (*(__I uint32_t*)0x40054010U) /**< \brief (TC3) Counter Value (channel = 0) */ - #define REG_TC3_RA0 (*(__IO uint32_t*)0x40054014U) /**< \brief (TC3) Register A (channel = 0) */ - #define REG_TC3_RB0 (*(__IO uint32_t*)0x40054018U) /**< \brief (TC3) Register B (channel = 0) */ - #define REG_TC3_RC0 (*(__IO uint32_t*)0x4005401CU) /**< \brief (TC3) Register C (channel = 0) */ - #define REG_TC3_SR0 (*(__I uint32_t*)0x40054020U) /**< \brief (TC3) Status Register (channel = 0) */ - #define REG_TC3_IER0 (*(__O uint32_t*)0x40054024U) /**< \brief (TC3) Interrupt Enable Register (channel = 0) */ - #define REG_TC3_IDR0 (*(__O uint32_t*)0x40054028U) /**< \brief (TC3) Interrupt Disable Register (channel = 0) */ - #define REG_TC3_IMR0 (*(__I uint32_t*)0x4005402CU) /**< \brief (TC3) Interrupt Mask Register (channel = 0) */ - #define REG_TC3_EMR0 (*(__IO uint32_t*)0x40054030U) /**< \brief (TC3) Extended Mode Register (channel = 0) */ - #define REG_TC3_CCR1 (*(__O uint32_t*)0x40054040U) /**< \brief (TC3) Channel Control Register (channel = 1) */ - #define REG_TC3_CMR1 (*(__IO uint32_t*)0x40054044U) /**< \brief (TC3) Channel Mode Register (channel = 1) */ - #define REG_TC3_SMMR1 (*(__IO uint32_t*)0x40054048U) /**< \brief (TC3) Stepper Motor Mode Register (channel = 1) */ - #define REG_TC3_RAB1 (*(__I uint32_t*)0x4005404CU) /**< \brief (TC3) Register AB (channel = 1) */ - #define REG_TC3_CV1 (*(__I uint32_t*)0x40054050U) /**< \brief (TC3) Counter Value (channel = 1) */ - #define REG_TC3_RA1 (*(__IO uint32_t*)0x40054054U) /**< \brief (TC3) Register A (channel = 1) */ - #define REG_TC3_RB1 (*(__IO uint32_t*)0x40054058U) /**< \brief (TC3) Register B (channel = 1) */ - #define REG_TC3_RC1 (*(__IO uint32_t*)0x4005405CU) /**< \brief (TC3) Register C (channel = 1) */ - #define REG_TC3_SR1 (*(__I uint32_t*)0x40054060U) /**< \brief (TC3) Status Register (channel = 1) */ - #define REG_TC3_IER1 (*(__O uint32_t*)0x40054064U) /**< \brief (TC3) Interrupt Enable Register (channel = 1) */ - #define REG_TC3_IDR1 (*(__O uint32_t*)0x40054068U) /**< \brief (TC3) Interrupt Disable Register (channel = 1) */ - #define REG_TC3_IMR1 (*(__I uint32_t*)0x4005406CU) /**< \brief (TC3) Interrupt Mask Register (channel = 1) */ - #define REG_TC3_EMR1 (*(__IO uint32_t*)0x40054070U) /**< \brief (TC3) Extended Mode Register (channel = 1) */ - #define REG_TC3_CCR2 (*(__O uint32_t*)0x40054080U) /**< \brief (TC3) Channel Control Register (channel = 2) */ - #define REG_TC3_CMR2 (*(__IO uint32_t*)0x40054084U) /**< \brief (TC3) Channel Mode Register (channel = 2) */ - #define REG_TC3_SMMR2 (*(__IO uint32_t*)0x40054088U) /**< \brief (TC3) Stepper Motor Mode Register (channel = 2) */ - #define REG_TC3_RAB2 (*(__I uint32_t*)0x4005408CU) /**< \brief (TC3) Register AB (channel = 2) */ - #define REG_TC3_CV2 (*(__I uint32_t*)0x40054090U) /**< \brief (TC3) Counter Value (channel = 2) */ - #define REG_TC3_RA2 (*(__IO uint32_t*)0x40054094U) /**< \brief (TC3) Register A (channel = 2) */ - #define REG_TC3_RB2 (*(__IO uint32_t*)0x40054098U) /**< \brief (TC3) Register B (channel = 2) */ - #define REG_TC3_RC2 (*(__IO uint32_t*)0x4005409CU) /**< \brief (TC3) Register C (channel = 2) */ - #define REG_TC3_SR2 (*(__I uint32_t*)0x400540A0U) /**< \brief (TC3) Status Register (channel = 2) */ - #define REG_TC3_IER2 (*(__O uint32_t*)0x400540A4U) /**< \brief (TC3) Interrupt Enable Register (channel = 2) */ - #define REG_TC3_IDR2 (*(__O uint32_t*)0x400540A8U) /**< \brief (TC3) Interrupt Disable Register (channel = 2) */ - #define REG_TC3_IMR2 (*(__I uint32_t*)0x400540ACU) /**< \brief (TC3) Interrupt Mask Register (channel = 2) */ - #define REG_TC3_EMR2 (*(__IO uint32_t*)0x400540B0U) /**< \brief (TC3) Extended Mode Register (channel = 2) */ - #define REG_TC3_BCR (*(__O uint32_t*)0x400540C0U) /**< \brief (TC3) Block Control Register */ - #define REG_TC3_BMR (*(__IO uint32_t*)0x400540C4U) /**< \brief (TC3) Block Mode Register */ - #define REG_TC3_QIER (*(__O uint32_t*)0x400540C8U) /**< \brief (TC3) QDEC Interrupt Enable Register */ - #define REG_TC3_QIDR (*(__O uint32_t*)0x400540CCU) /**< \brief (TC3) QDEC Interrupt Disable Register */ - #define REG_TC3_QIMR (*(__I uint32_t*)0x400540D0U) /**< \brief (TC3) QDEC Interrupt Mask Register */ - #define REG_TC3_QISR (*(__I uint32_t*)0x400540D4U) /**< \brief (TC3) QDEC Interrupt Status Register */ - #define REG_TC3_FMR (*(__IO uint32_t*)0x400540D8U) /**< \brief (TC3) Fault Mode Register */ - #define REG_TC3_WPMR (*(__IO uint32_t*)0x400540E4U) /**< \brief (TC3) Write Protection Mode Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_TC3_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_trng.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_trng.h deleted file mode 100644 index ee9b08d7..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_trng.h +++ /dev/null @@ -1,50 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_TRNG_INSTANCE_ -#define _SAMV71_TRNG_INSTANCE_ - -/* ========== Register definition for TRNG peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_TRNG_CR (0x40070000U) /**< \brief (TRNG) Control Register */ - #define REG_TRNG_IER (0x40070010U) /**< \brief (TRNG) Interrupt Enable Register */ - #define REG_TRNG_IDR (0x40070014U) /**< \brief (TRNG) Interrupt Disable Register */ - #define REG_TRNG_IMR (0x40070018U) /**< \brief (TRNG) Interrupt Mask Register */ - #define REG_TRNG_ISR (0x4007001CU) /**< \brief (TRNG) Interrupt Status Register */ - #define REG_TRNG_ODATA (0x40070050U) /**< \brief (TRNG) Output Data Register */ -#else - #define REG_TRNG_CR (*(__O uint32_t*)0x40070000U) /**< \brief (TRNG) Control Register */ - #define REG_TRNG_IER (*(__O uint32_t*)0x40070010U) /**< \brief (TRNG) Interrupt Enable Register */ - #define REG_TRNG_IDR (*(__O uint32_t*)0x40070014U) /**< \brief (TRNG) Interrupt Disable Register */ - #define REG_TRNG_IMR (*(__I uint32_t*)0x40070018U) /**< \brief (TRNG) Interrupt Mask Register */ - #define REG_TRNG_ISR (*(__I uint32_t*)0x4007001CU) /**< \brief (TRNG) Interrupt Status Register */ - #define REG_TRNG_ODATA (*(__I uint32_t*)0x40070050U) /**< \brief (TRNG) Output Data Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_TRNG_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_twihs0.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_twihs0.h deleted file mode 100644 index 12705822..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_twihs0.h +++ /dev/null @@ -1,70 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_TWIHS0_INSTANCE_ -#define _SAMV71_TWIHS0_INSTANCE_ - -/* ========== Register definition for TWIHS0 peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_TWIHS0_CR (0x40018000U) /**< \brief (TWIHS0) Control Register */ - #define REG_TWIHS0_MMR (0x40018004U) /**< \brief (TWIHS0) Master Mode Register */ - #define REG_TWIHS0_SMR (0x40018008U) /**< \brief (TWIHS0) Slave Mode Register */ - #define REG_TWIHS0_IADR (0x4001800CU) /**< \brief (TWIHS0) Internal Address Register */ - #define REG_TWIHS0_CWGR (0x40018010U) /**< \brief (TWIHS0) Clock Waveform Generator Register */ - #define REG_TWIHS0_SR (0x40018020U) /**< \brief (TWIHS0) Status Register */ - #define REG_TWIHS0_IER (0x40018024U) /**< \brief (TWIHS0) Interrupt Enable Register */ - #define REG_TWIHS0_IDR (0x40018028U) /**< \brief (TWIHS0) Interrupt Disable Register */ - #define REG_TWIHS0_IMR (0x4001802CU) /**< \brief (TWIHS0) Interrupt Mask Register */ - #define REG_TWIHS0_RHR (0x40018030U) /**< \brief (TWIHS0) Receive Holding Register */ - #define REG_TWIHS0_THR (0x40018034U) /**< \brief (TWIHS0) Transmit Holding Register */ - #define REG_TWIHS0_SMBTR (0x40018038U) /**< \brief (TWIHS0) SMBus Timing Register */ - #define REG_TWIHS0_FILTR (0x40018044U) /**< \brief (TWIHS0) Filter Register */ - #define REG_TWIHS0_SWMR (0x4001804CU) /**< \brief (TWIHS0) SleepWalking Matching Register */ - #define REG_TWIHS0_WPMR (0x400180E4U) /**< \brief (TWIHS0) Write Protection Mode Register */ - #define REG_TWIHS0_WPSR (0x400180E8U) /**< \brief (TWIHS0) Write Protection Status Register */ -#else - #define REG_TWIHS0_CR (*(__O uint32_t*)0x40018000U) /**< \brief (TWIHS0) Control Register */ - #define REG_TWIHS0_MMR (*(__IO uint32_t*)0x40018004U) /**< \brief (TWIHS0) Master Mode Register */ - #define REG_TWIHS0_SMR (*(__IO uint32_t*)0x40018008U) /**< \brief (TWIHS0) Slave Mode Register */ - #define REG_TWIHS0_IADR (*(__IO uint32_t*)0x4001800CU) /**< \brief (TWIHS0) Internal Address Register */ - #define REG_TWIHS0_CWGR (*(__IO uint32_t*)0x40018010U) /**< \brief (TWIHS0) Clock Waveform Generator Register */ - #define REG_TWIHS0_SR (*(__I uint32_t*)0x40018020U) /**< \brief (TWIHS0) Status Register */ - #define REG_TWIHS0_IER (*(__O uint32_t*)0x40018024U) /**< \brief (TWIHS0) Interrupt Enable Register */ - #define REG_TWIHS0_IDR (*(__O uint32_t*)0x40018028U) /**< \brief (TWIHS0) Interrupt Disable Register */ - #define REG_TWIHS0_IMR (*(__I uint32_t*)0x4001802CU) /**< \brief (TWIHS0) Interrupt Mask Register */ - #define REG_TWIHS0_RHR (*(__I uint32_t*)0x40018030U) /**< \brief (TWIHS0) Receive Holding Register */ - #define REG_TWIHS0_THR (*(__O uint32_t*)0x40018034U) /**< \brief (TWIHS0) Transmit Holding Register */ - #define REG_TWIHS0_SMBTR (*(__IO uint32_t*)0x40018038U) /**< \brief (TWIHS0) SMBus Timing Register */ - #define REG_TWIHS0_FILTR (*(__IO uint32_t*)0x40018044U) /**< \brief (TWIHS0) Filter Register */ - #define REG_TWIHS0_SWMR (*(__IO uint32_t*)0x4001804CU) /**< \brief (TWIHS0) SleepWalking Matching Register */ - #define REG_TWIHS0_WPMR (*(__IO uint32_t*)0x400180E4U) /**< \brief (TWIHS0) Write Protection Mode Register */ - #define REG_TWIHS0_WPSR (*(__I uint32_t*)0x400180E8U) /**< \brief (TWIHS0) Write Protection Status Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_TWIHS0_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_twihs1.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_twihs1.h deleted file mode 100644 index 11631f74..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_twihs1.h +++ /dev/null @@ -1,70 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_TWIHS1_INSTANCE_ -#define _SAMV71_TWIHS1_INSTANCE_ - -/* ========== Register definition for TWIHS1 peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_TWIHS1_CR (0x4001C000U) /**< \brief (TWIHS1) Control Register */ - #define REG_TWIHS1_MMR (0x4001C004U) /**< \brief (TWIHS1) Master Mode Register */ - #define REG_TWIHS1_SMR (0x4001C008U) /**< \brief (TWIHS1) Slave Mode Register */ - #define REG_TWIHS1_IADR (0x4001C00CU) /**< \brief (TWIHS1) Internal Address Register */ - #define REG_TWIHS1_CWGR (0x4001C010U) /**< \brief (TWIHS1) Clock Waveform Generator Register */ - #define REG_TWIHS1_SR (0x4001C020U) /**< \brief (TWIHS1) Status Register */ - #define REG_TWIHS1_IER (0x4001C024U) /**< \brief (TWIHS1) Interrupt Enable Register */ - #define REG_TWIHS1_IDR (0x4001C028U) /**< \brief (TWIHS1) Interrupt Disable Register */ - #define REG_TWIHS1_IMR (0x4001C02CU) /**< \brief (TWIHS1) Interrupt Mask Register */ - #define REG_TWIHS1_RHR (0x4001C030U) /**< \brief (TWIHS1) Receive Holding Register */ - #define REG_TWIHS1_THR (0x4001C034U) /**< \brief (TWIHS1) Transmit Holding Register */ - #define REG_TWIHS1_SMBTR (0x4001C038U) /**< \brief (TWIHS1) SMBus Timing Register */ - #define REG_TWIHS1_FILTR (0x4001C044U) /**< \brief (TWIHS1) Filter Register */ - #define REG_TWIHS1_SWMR (0x4001C04CU) /**< \brief (TWIHS1) SleepWalking Matching Register */ - #define REG_TWIHS1_WPMR (0x4001C0E4U) /**< \brief (TWIHS1) Write Protection Mode Register */ - #define REG_TWIHS1_WPSR (0x4001C0E8U) /**< \brief (TWIHS1) Write Protection Status Register */ -#else - #define REG_TWIHS1_CR (*(__O uint32_t*)0x4001C000U) /**< \brief (TWIHS1) Control Register */ - #define REG_TWIHS1_MMR (*(__IO uint32_t*)0x4001C004U) /**< \brief (TWIHS1) Master Mode Register */ - #define REG_TWIHS1_SMR (*(__IO uint32_t*)0x4001C008U) /**< \brief (TWIHS1) Slave Mode Register */ - #define REG_TWIHS1_IADR (*(__IO uint32_t*)0x4001C00CU) /**< \brief (TWIHS1) Internal Address Register */ - #define REG_TWIHS1_CWGR (*(__IO uint32_t*)0x4001C010U) /**< \brief (TWIHS1) Clock Waveform Generator Register */ - #define REG_TWIHS1_SR (*(__I uint32_t*)0x4001C020U) /**< \brief (TWIHS1) Status Register */ - #define REG_TWIHS1_IER (*(__O uint32_t*)0x4001C024U) /**< \brief (TWIHS1) Interrupt Enable Register */ - #define REG_TWIHS1_IDR (*(__O uint32_t*)0x4001C028U) /**< \brief (TWIHS1) Interrupt Disable Register */ - #define REG_TWIHS1_IMR (*(__I uint32_t*)0x4001C02CU) /**< \brief (TWIHS1) Interrupt Mask Register */ - #define REG_TWIHS1_RHR (*(__I uint32_t*)0x4001C030U) /**< \brief (TWIHS1) Receive Holding Register */ - #define REG_TWIHS1_THR (*(__O uint32_t*)0x4001C034U) /**< \brief (TWIHS1) Transmit Holding Register */ - #define REG_TWIHS1_SMBTR (*(__IO uint32_t*)0x4001C038U) /**< \brief (TWIHS1) SMBus Timing Register */ - #define REG_TWIHS1_FILTR (*(__IO uint32_t*)0x4001C044U) /**< \brief (TWIHS1) Filter Register */ - #define REG_TWIHS1_SWMR (*(__IO uint32_t*)0x4001C04CU) /**< \brief (TWIHS1) SleepWalking Matching Register */ - #define REG_TWIHS1_WPMR (*(__IO uint32_t*)0x4001C0E4U) /**< \brief (TWIHS1) Write Protection Mode Register */ - #define REG_TWIHS1_WPSR (*(__I uint32_t*)0x4001C0E8U) /**< \brief (TWIHS1) Write Protection Status Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_TWIHS1_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_twihs2.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_twihs2.h deleted file mode 100644 index 90e4ac20..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_twihs2.h +++ /dev/null @@ -1,70 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_TWIHS2_INSTANCE_ -#define _SAMV71_TWIHS2_INSTANCE_ - -/* ========== Register definition for TWIHS2 peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_TWIHS2_CR (0x40060000U) /**< \brief (TWIHS2) Control Register */ - #define REG_TWIHS2_MMR (0x40060004U) /**< \brief (TWIHS2) Master Mode Register */ - #define REG_TWIHS2_SMR (0x40060008U) /**< \brief (TWIHS2) Slave Mode Register */ - #define REG_TWIHS2_IADR (0x4006000CU) /**< \brief (TWIHS2) Internal Address Register */ - #define REG_TWIHS2_CWGR (0x40060010U) /**< \brief (TWIHS2) Clock Waveform Generator Register */ - #define REG_TWIHS2_SR (0x40060020U) /**< \brief (TWIHS2) Status Register */ - #define REG_TWIHS2_IER (0x40060024U) /**< \brief (TWIHS2) Interrupt Enable Register */ - #define REG_TWIHS2_IDR (0x40060028U) /**< \brief (TWIHS2) Interrupt Disable Register */ - #define REG_TWIHS2_IMR (0x4006002CU) /**< \brief (TWIHS2) Interrupt Mask Register */ - #define REG_TWIHS2_RHR (0x40060030U) /**< \brief (TWIHS2) Receive Holding Register */ - #define REG_TWIHS2_THR (0x40060034U) /**< \brief (TWIHS2) Transmit Holding Register */ - #define REG_TWIHS2_SMBTR (0x40060038U) /**< \brief (TWIHS2) SMBus Timing Register */ - #define REG_TWIHS2_FILTR (0x40060044U) /**< \brief (TWIHS2) Filter Register */ - #define REG_TWIHS2_SWMR (0x4006004CU) /**< \brief (TWIHS2) SleepWalking Matching Register */ - #define REG_TWIHS2_WPMR (0x400600E4U) /**< \brief (TWIHS2) Write Protection Mode Register */ - #define REG_TWIHS2_WPSR (0x400600E8U) /**< \brief (TWIHS2) Write Protection Status Register */ -#else - #define REG_TWIHS2_CR (*(__O uint32_t*)0x40060000U) /**< \brief (TWIHS2) Control Register */ - #define REG_TWIHS2_MMR (*(__IO uint32_t*)0x40060004U) /**< \brief (TWIHS2) Master Mode Register */ - #define REG_TWIHS2_SMR (*(__IO uint32_t*)0x40060008U) /**< \brief (TWIHS2) Slave Mode Register */ - #define REG_TWIHS2_IADR (*(__IO uint32_t*)0x4006000CU) /**< \brief (TWIHS2) Internal Address Register */ - #define REG_TWIHS2_CWGR (*(__IO uint32_t*)0x40060010U) /**< \brief (TWIHS2) Clock Waveform Generator Register */ - #define REG_TWIHS2_SR (*(__I uint32_t*)0x40060020U) /**< \brief (TWIHS2) Status Register */ - #define REG_TWIHS2_IER (*(__O uint32_t*)0x40060024U) /**< \brief (TWIHS2) Interrupt Enable Register */ - #define REG_TWIHS2_IDR (*(__O uint32_t*)0x40060028U) /**< \brief (TWIHS2) Interrupt Disable Register */ - #define REG_TWIHS2_IMR (*(__I uint32_t*)0x4006002CU) /**< \brief (TWIHS2) Interrupt Mask Register */ - #define REG_TWIHS2_RHR (*(__I uint32_t*)0x40060030U) /**< \brief (TWIHS2) Receive Holding Register */ - #define REG_TWIHS2_THR (*(__O uint32_t*)0x40060034U) /**< \brief (TWIHS2) Transmit Holding Register */ - #define REG_TWIHS2_SMBTR (*(__IO uint32_t*)0x40060038U) /**< \brief (TWIHS2) SMBus Timing Register */ - #define REG_TWIHS2_FILTR (*(__IO uint32_t*)0x40060044U) /**< \brief (TWIHS2) Filter Register */ - #define REG_TWIHS2_SWMR (*(__IO uint32_t*)0x4006004CU) /**< \brief (TWIHS2) SleepWalking Matching Register */ - #define REG_TWIHS2_WPMR (*(__IO uint32_t*)0x400600E4U) /**< \brief (TWIHS2) Write Protection Mode Register */ - #define REG_TWIHS2_WPSR (*(__I uint32_t*)0x400600E8U) /**< \brief (TWIHS2) Write Protection Status Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_TWIHS2_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_uart0.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_uart0.h deleted file mode 100644 index 3a8fa60b..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_uart0.h +++ /dev/null @@ -1,60 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_UART0_INSTANCE_ -#define _SAMV71_UART0_INSTANCE_ - -/* ========== Register definition for UART0 peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_UART0_CR (0x400E0800U) /**< \brief (UART0) Control Register */ - #define REG_UART0_MR (0x400E0804U) /**< \brief (UART0) Mode Register */ - #define REG_UART0_IER (0x400E0808U) /**< \brief (UART0) Interrupt Enable Register */ - #define REG_UART0_IDR (0x400E080CU) /**< \brief (UART0) Interrupt Disable Register */ - #define REG_UART0_IMR (0x400E0810U) /**< \brief (UART0) Interrupt Mask Register */ - #define REG_UART0_SR (0x400E0814U) /**< \brief (UART0) Status Register */ - #define REG_UART0_RHR (0x400E0818U) /**< \brief (UART0) Receive Holding Register */ - #define REG_UART0_THR (0x400E081CU) /**< \brief (UART0) Transmit Holding Register */ - #define REG_UART0_BRGR (0x400E0820U) /**< \brief (UART0) Baud Rate Generator Register */ - #define REG_UART0_CMPR (0x400E0824U) /**< \brief (UART0) Comparison Register */ - #define REG_UART0_WPMR (0x400E08E4U) /**< \brief (UART0) Write Protection Mode Register */ -#else - #define REG_UART0_CR (*(__O uint32_t*)0x400E0800U) /**< \brief (UART0) Control Register */ - #define REG_UART0_MR (*(__IO uint32_t*)0x400E0804U) /**< \brief (UART0) Mode Register */ - #define REG_UART0_IER (*(__O uint32_t*)0x400E0808U) /**< \brief (UART0) Interrupt Enable Register */ - #define REG_UART0_IDR (*(__O uint32_t*)0x400E080CU) /**< \brief (UART0) Interrupt Disable Register */ - #define REG_UART0_IMR (*(__I uint32_t*)0x400E0810U) /**< \brief (UART0) Interrupt Mask Register */ - #define REG_UART0_SR (*(__I uint32_t*)0x400E0814U) /**< \brief (UART0) Status Register */ - #define REG_UART0_RHR (*(__I uint32_t*)0x400E0818U) /**< \brief (UART0) Receive Holding Register */ - #define REG_UART0_THR (*(__O uint32_t*)0x400E081CU) /**< \brief (UART0) Transmit Holding Register */ - #define REG_UART0_BRGR (*(__IO uint32_t*)0x400E0820U) /**< \brief (UART0) Baud Rate Generator Register */ - #define REG_UART0_CMPR (*(__IO uint32_t*)0x400E0824U) /**< \brief (UART0) Comparison Register */ - #define REG_UART0_WPMR (*(__IO uint32_t*)0x400E08E4U) /**< \brief (UART0) Write Protection Mode Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_UART0_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_uart1.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_uart1.h deleted file mode 100644 index 4c93aa3c..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_uart1.h +++ /dev/null @@ -1,60 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_UART1_INSTANCE_ -#define _SAMV71_UART1_INSTANCE_ - -/* ========== Register definition for UART1 peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_UART1_CR (0x400E0A00U) /**< \brief (UART1) Control Register */ - #define REG_UART1_MR (0x400E0A04U) /**< \brief (UART1) Mode Register */ - #define REG_UART1_IER (0x400E0A08U) /**< \brief (UART1) Interrupt Enable Register */ - #define REG_UART1_IDR (0x400E0A0CU) /**< \brief (UART1) Interrupt Disable Register */ - #define REG_UART1_IMR (0x400E0A10U) /**< \brief (UART1) Interrupt Mask Register */ - #define REG_UART1_SR (0x400E0A14U) /**< \brief (UART1) Status Register */ - #define REG_UART1_RHR (0x400E0A18U) /**< \brief (UART1) Receive Holding Register */ - #define REG_UART1_THR (0x400E0A1CU) /**< \brief (UART1) Transmit Holding Register */ - #define REG_UART1_BRGR (0x400E0A20U) /**< \brief (UART1) Baud Rate Generator Register */ - #define REG_UART1_CMPR (0x400E0A24U) /**< \brief (UART1) Comparison Register */ - #define REG_UART1_WPMR (0x400E0AE4U) /**< \brief (UART1) Write Protection Mode Register */ -#else - #define REG_UART1_CR (*(__O uint32_t*)0x400E0A00U) /**< \brief (UART1) Control Register */ - #define REG_UART1_MR (*(__IO uint32_t*)0x400E0A04U) /**< \brief (UART1) Mode Register */ - #define REG_UART1_IER (*(__O uint32_t*)0x400E0A08U) /**< \brief (UART1) Interrupt Enable Register */ - #define REG_UART1_IDR (*(__O uint32_t*)0x400E0A0CU) /**< \brief (UART1) Interrupt Disable Register */ - #define REG_UART1_IMR (*(__I uint32_t*)0x400E0A10U) /**< \brief (UART1) Interrupt Mask Register */ - #define REG_UART1_SR (*(__I uint32_t*)0x400E0A14U) /**< \brief (UART1) Status Register */ - #define REG_UART1_RHR (*(__I uint32_t*)0x400E0A18U) /**< \brief (UART1) Receive Holding Register */ - #define REG_UART1_THR (*(__O uint32_t*)0x400E0A1CU) /**< \brief (UART1) Transmit Holding Register */ - #define REG_UART1_BRGR (*(__IO uint32_t*)0x400E0A20U) /**< \brief (UART1) Baud Rate Generator Register */ - #define REG_UART1_CMPR (*(__IO uint32_t*)0x400E0A24U) /**< \brief (UART1) Comparison Register */ - #define REG_UART1_WPMR (*(__IO uint32_t*)0x400E0AE4U) /**< \brief (UART1) Write Protection Mode Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_UART1_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_uart2.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_uart2.h deleted file mode 100644 index 78bb4036..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_uart2.h +++ /dev/null @@ -1,60 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_UART2_INSTANCE_ -#define _SAMV71_UART2_INSTANCE_ - -/* ========== Register definition for UART2 peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_UART2_CR (0x400E1A00U) /**< \brief (UART2) Control Register */ - #define REG_UART2_MR (0x400E1A04U) /**< \brief (UART2) Mode Register */ - #define REG_UART2_IER (0x400E1A08U) /**< \brief (UART2) Interrupt Enable Register */ - #define REG_UART2_IDR (0x400E1A0CU) /**< \brief (UART2) Interrupt Disable Register */ - #define REG_UART2_IMR (0x400E1A10U) /**< \brief (UART2) Interrupt Mask Register */ - #define REG_UART2_SR (0x400E1A14U) /**< \brief (UART2) Status Register */ - #define REG_UART2_RHR (0x400E1A18U) /**< \brief (UART2) Receive Holding Register */ - #define REG_UART2_THR (0x400E1A1CU) /**< \brief (UART2) Transmit Holding Register */ - #define REG_UART2_BRGR (0x400E1A20U) /**< \brief (UART2) Baud Rate Generator Register */ - #define REG_UART2_CMPR (0x400E1A24U) /**< \brief (UART2) Comparison Register */ - #define REG_UART2_WPMR (0x400E1AE4U) /**< \brief (UART2) Write Protection Mode Register */ -#else - #define REG_UART2_CR (*(__O uint32_t*)0x400E1A00U) /**< \brief (UART2) Control Register */ - #define REG_UART2_MR (*(__IO uint32_t*)0x400E1A04U) /**< \brief (UART2) Mode Register */ - #define REG_UART2_IER (*(__O uint32_t*)0x400E1A08U) /**< \brief (UART2) Interrupt Enable Register */ - #define REG_UART2_IDR (*(__O uint32_t*)0x400E1A0CU) /**< \brief (UART2) Interrupt Disable Register */ - #define REG_UART2_IMR (*(__I uint32_t*)0x400E1A10U) /**< \brief (UART2) Interrupt Mask Register */ - #define REG_UART2_SR (*(__I uint32_t*)0x400E1A14U) /**< \brief (UART2) Status Register */ - #define REG_UART2_RHR (*(__I uint32_t*)0x400E1A18U) /**< \brief (UART2) Receive Holding Register */ - #define REG_UART2_THR (*(__O uint32_t*)0x400E1A1CU) /**< \brief (UART2) Transmit Holding Register */ - #define REG_UART2_BRGR (*(__IO uint32_t*)0x400E1A20U) /**< \brief (UART2) Baud Rate Generator Register */ - #define REG_UART2_CMPR (*(__IO uint32_t*)0x400E1A24U) /**< \brief (UART2) Comparison Register */ - #define REG_UART2_WPMR (*(__IO uint32_t*)0x400E1AE4U) /**< \brief (UART2) Write Protection Mode Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_UART2_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_uart3.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_uart3.h deleted file mode 100644 index 56c1ffa4..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_uart3.h +++ /dev/null @@ -1,60 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_UART3_INSTANCE_ -#define _SAMV71_UART3_INSTANCE_ - -/* ========== Register definition for UART3 peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_UART3_CR (0x400E1C00U) /**< \brief (UART3) Control Register */ - #define REG_UART3_MR (0x400E1C04U) /**< \brief (UART3) Mode Register */ - #define REG_UART3_IER (0x400E1C08U) /**< \brief (UART3) Interrupt Enable Register */ - #define REG_UART3_IDR (0x400E1C0CU) /**< \brief (UART3) Interrupt Disable Register */ - #define REG_UART3_IMR (0x400E1C10U) /**< \brief (UART3) Interrupt Mask Register */ - #define REG_UART3_SR (0x400E1C14U) /**< \brief (UART3) Status Register */ - #define REG_UART3_RHR (0x400E1C18U) /**< \brief (UART3) Receive Holding Register */ - #define REG_UART3_THR (0x400E1C1CU) /**< \brief (UART3) Transmit Holding Register */ - #define REG_UART3_BRGR (0x400E1C20U) /**< \brief (UART3) Baud Rate Generator Register */ - #define REG_UART3_CMPR (0x400E1C24U) /**< \brief (UART3) Comparison Register */ - #define REG_UART3_WPMR (0x400E1CE4U) /**< \brief (UART3) Write Protection Mode Register */ -#else - #define REG_UART3_CR (*(__O uint32_t*)0x400E1C00U) /**< \brief (UART3) Control Register */ - #define REG_UART3_MR (*(__IO uint32_t*)0x400E1C04U) /**< \brief (UART3) Mode Register */ - #define REG_UART3_IER (*(__O uint32_t*)0x400E1C08U) /**< \brief (UART3) Interrupt Enable Register */ - #define REG_UART3_IDR (*(__O uint32_t*)0x400E1C0CU) /**< \brief (UART3) Interrupt Disable Register */ - #define REG_UART3_IMR (*(__I uint32_t*)0x400E1C10U) /**< \brief (UART3) Interrupt Mask Register */ - #define REG_UART3_SR (*(__I uint32_t*)0x400E1C14U) /**< \brief (UART3) Status Register */ - #define REG_UART3_RHR (*(__I uint32_t*)0x400E1C18U) /**< \brief (UART3) Receive Holding Register */ - #define REG_UART3_THR (*(__O uint32_t*)0x400E1C1CU) /**< \brief (UART3) Transmit Holding Register */ - #define REG_UART3_BRGR (*(__IO uint32_t*)0x400E1C20U) /**< \brief (UART3) Baud Rate Generator Register */ - #define REG_UART3_CMPR (*(__IO uint32_t*)0x400E1C24U) /**< \brief (UART3) Comparison Register */ - #define REG_UART3_WPMR (*(__IO uint32_t*)0x400E1CE4U) /**< \brief (UART3) Write Protection Mode Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_UART3_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_uart4.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_uart4.h deleted file mode 100644 index db5ce7ad..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_uart4.h +++ /dev/null @@ -1,60 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_UART4_INSTANCE_ -#define _SAMV71_UART4_INSTANCE_ - -/* ========== Register definition for UART4 peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_UART4_CR (0x400E1E00U) /**< \brief (UART4) Control Register */ - #define REG_UART4_MR (0x400E1E04U) /**< \brief (UART4) Mode Register */ - #define REG_UART4_IER (0x400E1E08U) /**< \brief (UART4) Interrupt Enable Register */ - #define REG_UART4_IDR (0x400E1E0CU) /**< \brief (UART4) Interrupt Disable Register */ - #define REG_UART4_IMR (0x400E1E10U) /**< \brief (UART4) Interrupt Mask Register */ - #define REG_UART4_SR (0x400E1E14U) /**< \brief (UART4) Status Register */ - #define REG_UART4_RHR (0x400E1E18U) /**< \brief (UART4) Receive Holding Register */ - #define REG_UART4_THR (0x400E1E1CU) /**< \brief (UART4) Transmit Holding Register */ - #define REG_UART4_BRGR (0x400E1E20U) /**< \brief (UART4) Baud Rate Generator Register */ - #define REG_UART4_CMPR (0x400E1E24U) /**< \brief (UART4) Comparison Register */ - #define REG_UART4_WPMR (0x400E1EE4U) /**< \brief (UART4) Write Protection Mode Register */ -#else - #define REG_UART4_CR (*(__O uint32_t*)0x400E1E00U) /**< \brief (UART4) Control Register */ - #define REG_UART4_MR (*(__IO uint32_t*)0x400E1E04U) /**< \brief (UART4) Mode Register */ - #define REG_UART4_IER (*(__O uint32_t*)0x400E1E08U) /**< \brief (UART4) Interrupt Enable Register */ - #define REG_UART4_IDR (*(__O uint32_t*)0x400E1E0CU) /**< \brief (UART4) Interrupt Disable Register */ - #define REG_UART4_IMR (*(__I uint32_t*)0x400E1E10U) /**< \brief (UART4) Interrupt Mask Register */ - #define REG_UART4_SR (*(__I uint32_t*)0x400E1E14U) /**< \brief (UART4) Status Register */ - #define REG_UART4_RHR (*(__I uint32_t*)0x400E1E18U) /**< \brief (UART4) Receive Holding Register */ - #define REG_UART4_THR (*(__O uint32_t*)0x400E1E1CU) /**< \brief (UART4) Transmit Holding Register */ - #define REG_UART4_BRGR (*(__IO uint32_t*)0x400E1E20U) /**< \brief (UART4) Baud Rate Generator Register */ - #define REG_UART4_CMPR (*(__IO uint32_t*)0x400E1E24U) /**< \brief (UART4) Comparison Register */ - #define REG_UART4_WPMR (*(__IO uint32_t*)0x400E1EE4U) /**< \brief (UART4) Write Protection Mode Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_UART4_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_usart0.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_usart0.h deleted file mode 100644 index 742ca1f6..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_usart0.h +++ /dev/null @@ -1,94 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_USART0_INSTANCE_ -#define _SAMV71_USART0_INSTANCE_ - -/* ========== Register definition for USART0 peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_USART0_CR (0x40024000U) /**< \brief (USART0) Control Register */ - #define REG_USART0_MR (0x40024004U) /**< \brief (USART0) Mode Register */ - #define REG_USART0_IER (0x40024008U) /**< \brief (USART0) Interrupt Enable Register */ - #define REG_USART0_IDR (0x4002400CU) /**< \brief (USART0) Interrupt Disable Register */ - #define REG_USART0_IMR (0x40024010U) /**< \brief (USART0) Interrupt Mask Register */ - #define REG_USART0_CSR (0x40024014U) /**< \brief (USART0) Channel Status Register */ - #define REG_USART0_RHR (0x40024018U) /**< \brief (USART0) Receive Holding Register */ - #define REG_USART0_THR (0x4002401CU) /**< \brief (USART0) Transmit Holding Register */ - #define REG_USART0_BRGR (0x40024020U) /**< \brief (USART0) Baud Rate Generator Register */ - #define REG_USART0_RTOR (0x40024024U) /**< \brief (USART0) Receiver Time-out Register */ - #define REG_USART0_TTGR (0x40024028U) /**< \brief (USART0) Transmitter Timeguard Register */ - #define REG_USART0_MAN (0x40024050U) /**< \brief (USART0) Manchester Configuration Register */ - #define REG_USART0_LINMR (0x40024054U) /**< \brief (USART0) LIN Mode Register */ - #define REG_USART0_LINIR (0x40024058U) /**< \brief (USART0) LIN Identifier Register */ - #define REG_USART0_LINBRR (0x4002405CU) /**< \brief (USART0) LIN Baud Rate Register */ - #define REG_USART0_LONMR (0x40024060U) /**< \brief (USART0) LON Mode Register */ - #define REG_USART0_LONPR (0x40024064U) /**< \brief (USART0) LON Preamble Register */ - #define REG_USART0_LONDL (0x40024068U) /**< \brief (USART0) LON Data Length Register */ - #define REG_USART0_LONL2HDR (0x4002406CU) /**< \brief (USART0) LON L2HDR Register */ - #define REG_USART0_LONBL (0x40024070U) /**< \brief (USART0) LON Backlog Register */ - #define REG_USART0_LONB1TX (0x40024074U) /**< \brief (USART0) LON Beta1 Tx Register */ - #define REG_USART0_LONB1RX (0x40024078U) /**< \brief (USART0) LON Beta1 Rx Register */ - #define REG_USART0_LONPRIO (0x4002407CU) /**< \brief (USART0) LON Priority Register */ - #define REG_USART0_IDTTX (0x40024080U) /**< \brief (USART0) LON IDT Tx Register */ - #define REG_USART0_IDTRX (0x40024084U) /**< \brief (USART0) LON IDT Rx Register */ - #define REG_USART0_ICDIFF (0x40024088U) /**< \brief (USART0) IC DIFF Register */ - #define REG_USART0_WPMR (0x400240E4U) /**< \brief (USART0) Write Protection Mode Register */ - #define REG_USART0_WPSR (0x400240E8U) /**< \brief (USART0) Write Protection Status Register */ -#else - #define REG_USART0_CR (*(__O uint32_t*)0x40024000U) /**< \brief (USART0) Control Register */ - #define REG_USART0_MR (*(__IO uint32_t*)0x40024004U) /**< \brief (USART0) Mode Register */ - #define REG_USART0_IER (*(__O uint32_t*)0x40024008U) /**< \brief (USART0) Interrupt Enable Register */ - #define REG_USART0_IDR (*(__O uint32_t*)0x4002400CU) /**< \brief (USART0) Interrupt Disable Register */ - #define REG_USART0_IMR (*(__I uint32_t*)0x40024010U) /**< \brief (USART0) Interrupt Mask Register */ - #define REG_USART0_CSR (*(__I uint32_t*)0x40024014U) /**< \brief (USART0) Channel Status Register */ - #define REG_USART0_RHR (*(__I uint32_t*)0x40024018U) /**< \brief (USART0) Receive Holding Register */ - #define REG_USART0_THR (*(__O uint32_t*)0x4002401CU) /**< \brief (USART0) Transmit Holding Register */ - #define REG_USART0_BRGR (*(__IO uint32_t*)0x40024020U) /**< \brief (USART0) Baud Rate Generator Register */ - #define REG_USART0_RTOR (*(__IO uint32_t*)0x40024024U) /**< \brief (USART0) Receiver Time-out Register */ - #define REG_USART0_TTGR (*(__IO uint32_t*)0x40024028U) /**< \brief (USART0) Transmitter Timeguard Register */ - #define REG_USART0_MAN (*(__IO uint32_t*)0x40024050U) /**< \brief (USART0) Manchester Configuration Register */ - #define REG_USART0_LINMR (*(__IO uint32_t*)0x40024054U) /**< \brief (USART0) LIN Mode Register */ - #define REG_USART0_LINIR (*(__IO uint32_t*)0x40024058U) /**< \brief (USART0) LIN Identifier Register */ - #define REG_USART0_LINBRR (*(__I uint32_t*)0x4002405CU) /**< \brief (USART0) LIN Baud Rate Register */ - #define REG_USART0_LONMR (*(__IO uint32_t*)0x40024060U) /**< \brief (USART0) LON Mode Register */ - #define REG_USART0_LONPR (*(__IO uint32_t*)0x40024064U) /**< \brief (USART0) LON Preamble Register */ - #define REG_USART0_LONDL (*(__IO uint32_t*)0x40024068U) /**< \brief (USART0) LON Data Length Register */ - #define REG_USART0_LONL2HDR (*(__IO uint32_t*)0x4002406CU) /**< \brief (USART0) LON L2HDR Register */ - #define REG_USART0_LONBL (*(__I uint32_t*)0x40024070U) /**< \brief (USART0) LON Backlog Register */ - #define REG_USART0_LONB1TX (*(__IO uint32_t*)0x40024074U) /**< \brief (USART0) LON Beta1 Tx Register */ - #define REG_USART0_LONB1RX (*(__IO uint32_t*)0x40024078U) /**< \brief (USART0) LON Beta1 Rx Register */ - #define REG_USART0_LONPRIO (*(__IO uint32_t*)0x4002407CU) /**< \brief (USART0) LON Priority Register */ - #define REG_USART0_IDTTX (*(__IO uint32_t*)0x40024080U) /**< \brief (USART0) LON IDT Tx Register */ - #define REG_USART0_IDTRX (*(__IO uint32_t*)0x40024084U) /**< \brief (USART0) LON IDT Rx Register */ - #define REG_USART0_ICDIFF (*(__IO uint32_t*)0x40024088U) /**< \brief (USART0) IC DIFF Register */ - #define REG_USART0_WPMR (*(__IO uint32_t*)0x400240E4U) /**< \brief (USART0) Write Protection Mode Register */ - #define REG_USART0_WPSR (*(__I uint32_t*)0x400240E8U) /**< \brief (USART0) Write Protection Status Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_USART0_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_usart1.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_usart1.h deleted file mode 100644 index 871f81c5..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_usart1.h +++ /dev/null @@ -1,94 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_USART1_INSTANCE_ -#define _SAMV71_USART1_INSTANCE_ - -/* ========== Register definition for USART1 peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_USART1_CR (0x40028000U) /**< \brief (USART1) Control Register */ - #define REG_USART1_MR (0x40028004U) /**< \brief (USART1) Mode Register */ - #define REG_USART1_IER (0x40028008U) /**< \brief (USART1) Interrupt Enable Register */ - #define REG_USART1_IDR (0x4002800CU) /**< \brief (USART1) Interrupt Disable Register */ - #define REG_USART1_IMR (0x40028010U) /**< \brief (USART1) Interrupt Mask Register */ - #define REG_USART1_CSR (0x40028014U) /**< \brief (USART1) Channel Status Register */ - #define REG_USART1_RHR (0x40028018U) /**< \brief (USART1) Receive Holding Register */ - #define REG_USART1_THR (0x4002801CU) /**< \brief (USART1) Transmit Holding Register */ - #define REG_USART1_BRGR (0x40028020U) /**< \brief (USART1) Baud Rate Generator Register */ - #define REG_USART1_RTOR (0x40028024U) /**< \brief (USART1) Receiver Time-out Register */ - #define REG_USART1_TTGR (0x40028028U) /**< \brief (USART1) Transmitter Timeguard Register */ - #define REG_USART1_MAN (0x40028050U) /**< \brief (USART1) Manchester Configuration Register */ - #define REG_USART1_LINMR (0x40028054U) /**< \brief (USART1) LIN Mode Register */ - #define REG_USART1_LINIR (0x40028058U) /**< \brief (USART1) LIN Identifier Register */ - #define REG_USART1_LINBRR (0x4002805CU) /**< \brief (USART1) LIN Baud Rate Register */ - #define REG_USART1_LONMR (0x40028060U) /**< \brief (USART1) LON Mode Register */ - #define REG_USART1_LONPR (0x40028064U) /**< \brief (USART1) LON Preamble Register */ - #define REG_USART1_LONDL (0x40028068U) /**< \brief (USART1) LON Data Length Register */ - #define REG_USART1_LONL2HDR (0x4002806CU) /**< \brief (USART1) LON L2HDR Register */ - #define REG_USART1_LONBL (0x40028070U) /**< \brief (USART1) LON Backlog Register */ - #define REG_USART1_LONB1TX (0x40028074U) /**< \brief (USART1) LON Beta1 Tx Register */ - #define REG_USART1_LONB1RX (0x40028078U) /**< \brief (USART1) LON Beta1 Rx Register */ - #define REG_USART1_LONPRIO (0x4002807CU) /**< \brief (USART1) LON Priority Register */ - #define REG_USART1_IDTTX (0x40028080U) /**< \brief (USART1) LON IDT Tx Register */ - #define REG_USART1_IDTRX (0x40028084U) /**< \brief (USART1) LON IDT Rx Register */ - #define REG_USART1_ICDIFF (0x40028088U) /**< \brief (USART1) IC DIFF Register */ - #define REG_USART1_WPMR (0x400280E4U) /**< \brief (USART1) Write Protection Mode Register */ - #define REG_USART1_WPSR (0x400280E8U) /**< \brief (USART1) Write Protection Status Register */ -#else - #define REG_USART1_CR (*(__O uint32_t*)0x40028000U) /**< \brief (USART1) Control Register */ - #define REG_USART1_MR (*(__IO uint32_t*)0x40028004U) /**< \brief (USART1) Mode Register */ - #define REG_USART1_IER (*(__O uint32_t*)0x40028008U) /**< \brief (USART1) Interrupt Enable Register */ - #define REG_USART1_IDR (*(__O uint32_t*)0x4002800CU) /**< \brief (USART1) Interrupt Disable Register */ - #define REG_USART1_IMR (*(__I uint32_t*)0x40028010U) /**< \brief (USART1) Interrupt Mask Register */ - #define REG_USART1_CSR (*(__I uint32_t*)0x40028014U) /**< \brief (USART1) Channel Status Register */ - #define REG_USART1_RHR (*(__I uint32_t*)0x40028018U) /**< \brief (USART1) Receive Holding Register */ - #define REG_USART1_THR (*(__O uint32_t*)0x4002801CU) /**< \brief (USART1) Transmit Holding Register */ - #define REG_USART1_BRGR (*(__IO uint32_t*)0x40028020U) /**< \brief (USART1) Baud Rate Generator Register */ - #define REG_USART1_RTOR (*(__IO uint32_t*)0x40028024U) /**< \brief (USART1) Receiver Time-out Register */ - #define REG_USART1_TTGR (*(__IO uint32_t*)0x40028028U) /**< \brief (USART1) Transmitter Timeguard Register */ - #define REG_USART1_MAN (*(__IO uint32_t*)0x40028050U) /**< \brief (USART1) Manchester Configuration Register */ - #define REG_USART1_LINMR (*(__IO uint32_t*)0x40028054U) /**< \brief (USART1) LIN Mode Register */ - #define REG_USART1_LINIR (*(__IO uint32_t*)0x40028058U) /**< \brief (USART1) LIN Identifier Register */ - #define REG_USART1_LINBRR (*(__I uint32_t*)0x4002805CU) /**< \brief (USART1) LIN Baud Rate Register */ - #define REG_USART1_LONMR (*(__IO uint32_t*)0x40028060U) /**< \brief (USART1) LON Mode Register */ - #define REG_USART1_LONPR (*(__IO uint32_t*)0x40028064U) /**< \brief (USART1) LON Preamble Register */ - #define REG_USART1_LONDL (*(__IO uint32_t*)0x40028068U) /**< \brief (USART1) LON Data Length Register */ - #define REG_USART1_LONL2HDR (*(__IO uint32_t*)0x4002806CU) /**< \brief (USART1) LON L2HDR Register */ - #define REG_USART1_LONBL (*(__I uint32_t*)0x40028070U) /**< \brief (USART1) LON Backlog Register */ - #define REG_USART1_LONB1TX (*(__IO uint32_t*)0x40028074U) /**< \brief (USART1) LON Beta1 Tx Register */ - #define REG_USART1_LONB1RX (*(__IO uint32_t*)0x40028078U) /**< \brief (USART1) LON Beta1 Rx Register */ - #define REG_USART1_LONPRIO (*(__IO uint32_t*)0x4002807CU) /**< \brief (USART1) LON Priority Register */ - #define REG_USART1_IDTTX (*(__IO uint32_t*)0x40028080U) /**< \brief (USART1) LON IDT Tx Register */ - #define REG_USART1_IDTRX (*(__IO uint32_t*)0x40028084U) /**< \brief (USART1) LON IDT Rx Register */ - #define REG_USART1_ICDIFF (*(__IO uint32_t*)0x40028088U) /**< \brief (USART1) IC DIFF Register */ - #define REG_USART1_WPMR (*(__IO uint32_t*)0x400280E4U) /**< \brief (USART1) Write Protection Mode Register */ - #define REG_USART1_WPSR (*(__I uint32_t*)0x400280E8U) /**< \brief (USART1) Write Protection Status Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_USART1_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_usart2.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_usart2.h deleted file mode 100644 index c97827e1..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_usart2.h +++ /dev/null @@ -1,94 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_USART2_INSTANCE_ -#define _SAMV71_USART2_INSTANCE_ - -/* ========== Register definition for USART2 peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_USART2_CR (0x4002C000U) /**< \brief (USART2) Control Register */ - #define REG_USART2_MR (0x4002C004U) /**< \brief (USART2) Mode Register */ - #define REG_USART2_IER (0x4002C008U) /**< \brief (USART2) Interrupt Enable Register */ - #define REG_USART2_IDR (0x4002C00CU) /**< \brief (USART2) Interrupt Disable Register */ - #define REG_USART2_IMR (0x4002C010U) /**< \brief (USART2) Interrupt Mask Register */ - #define REG_USART2_CSR (0x4002C014U) /**< \brief (USART2) Channel Status Register */ - #define REG_USART2_RHR (0x4002C018U) /**< \brief (USART2) Receive Holding Register */ - #define REG_USART2_THR (0x4002C01CU) /**< \brief (USART2) Transmit Holding Register */ - #define REG_USART2_BRGR (0x4002C020U) /**< \brief (USART2) Baud Rate Generator Register */ - #define REG_USART2_RTOR (0x4002C024U) /**< \brief (USART2) Receiver Time-out Register */ - #define REG_USART2_TTGR (0x4002C028U) /**< \brief (USART2) Transmitter Timeguard Register */ - #define REG_USART2_MAN (0x4002C050U) /**< \brief (USART2) Manchester Configuration Register */ - #define REG_USART2_LINMR (0x4002C054U) /**< \brief (USART2) LIN Mode Register */ - #define REG_USART2_LINIR (0x4002C058U) /**< \brief (USART2) LIN Identifier Register */ - #define REG_USART2_LINBRR (0x4002C05CU) /**< \brief (USART2) LIN Baud Rate Register */ - #define REG_USART2_LONMR (0x4002C060U) /**< \brief (USART2) LON Mode Register */ - #define REG_USART2_LONPR (0x4002C064U) /**< \brief (USART2) LON Preamble Register */ - #define REG_USART2_LONDL (0x4002C068U) /**< \brief (USART2) LON Data Length Register */ - #define REG_USART2_LONL2HDR (0x4002C06CU) /**< \brief (USART2) LON L2HDR Register */ - #define REG_USART2_LONBL (0x4002C070U) /**< \brief (USART2) LON Backlog Register */ - #define REG_USART2_LONB1TX (0x4002C074U) /**< \brief (USART2) LON Beta1 Tx Register */ - #define REG_USART2_LONB1RX (0x4002C078U) /**< \brief (USART2) LON Beta1 Rx Register */ - #define REG_USART2_LONPRIO (0x4002C07CU) /**< \brief (USART2) LON Priority Register */ - #define REG_USART2_IDTTX (0x4002C080U) /**< \brief (USART2) LON IDT Tx Register */ - #define REG_USART2_IDTRX (0x4002C084U) /**< \brief (USART2) LON IDT Rx Register */ - #define REG_USART2_ICDIFF (0x4002C088U) /**< \brief (USART2) IC DIFF Register */ - #define REG_USART2_WPMR (0x4002C0E4U) /**< \brief (USART2) Write Protection Mode Register */ - #define REG_USART2_WPSR (0x4002C0E8U) /**< \brief (USART2) Write Protection Status Register */ -#else - #define REG_USART2_CR (*(__O uint32_t*)0x4002C000U) /**< \brief (USART2) Control Register */ - #define REG_USART2_MR (*(__IO uint32_t*)0x4002C004U) /**< \brief (USART2) Mode Register */ - #define REG_USART2_IER (*(__O uint32_t*)0x4002C008U) /**< \brief (USART2) Interrupt Enable Register */ - #define REG_USART2_IDR (*(__O uint32_t*)0x4002C00CU) /**< \brief (USART2) Interrupt Disable Register */ - #define REG_USART2_IMR (*(__I uint32_t*)0x4002C010U) /**< \brief (USART2) Interrupt Mask Register */ - #define REG_USART2_CSR (*(__I uint32_t*)0x4002C014U) /**< \brief (USART2) Channel Status Register */ - #define REG_USART2_RHR (*(__I uint32_t*)0x4002C018U) /**< \brief (USART2) Receive Holding Register */ - #define REG_USART2_THR (*(__O uint32_t*)0x4002C01CU) /**< \brief (USART2) Transmit Holding Register */ - #define REG_USART2_BRGR (*(__IO uint32_t*)0x4002C020U) /**< \brief (USART2) Baud Rate Generator Register */ - #define REG_USART2_RTOR (*(__IO uint32_t*)0x4002C024U) /**< \brief (USART2) Receiver Time-out Register */ - #define REG_USART2_TTGR (*(__IO uint32_t*)0x4002C028U) /**< \brief (USART2) Transmitter Timeguard Register */ - #define REG_USART2_MAN (*(__IO uint32_t*)0x4002C050U) /**< \brief (USART2) Manchester Configuration Register */ - #define REG_USART2_LINMR (*(__IO uint32_t*)0x4002C054U) /**< \brief (USART2) LIN Mode Register */ - #define REG_USART2_LINIR (*(__IO uint32_t*)0x4002C058U) /**< \brief (USART2) LIN Identifier Register */ - #define REG_USART2_LINBRR (*(__I uint32_t*)0x4002C05CU) /**< \brief (USART2) LIN Baud Rate Register */ - #define REG_USART2_LONMR (*(__IO uint32_t*)0x4002C060U) /**< \brief (USART2) LON Mode Register */ - #define REG_USART2_LONPR (*(__IO uint32_t*)0x4002C064U) /**< \brief (USART2) LON Preamble Register */ - #define REG_USART2_LONDL (*(__IO uint32_t*)0x4002C068U) /**< \brief (USART2) LON Data Length Register */ - #define REG_USART2_LONL2HDR (*(__IO uint32_t*)0x4002C06CU) /**< \brief (USART2) LON L2HDR Register */ - #define REG_USART2_LONBL (*(__I uint32_t*)0x4002C070U) /**< \brief (USART2) LON Backlog Register */ - #define REG_USART2_LONB1TX (*(__IO uint32_t*)0x4002C074U) /**< \brief (USART2) LON Beta1 Tx Register */ - #define REG_USART2_LONB1RX (*(__IO uint32_t*)0x4002C078U) /**< \brief (USART2) LON Beta1 Rx Register */ - #define REG_USART2_LONPRIO (*(__IO uint32_t*)0x4002C07CU) /**< \brief (USART2) LON Priority Register */ - #define REG_USART2_IDTTX (*(__IO uint32_t*)0x4002C080U) /**< \brief (USART2) LON IDT Tx Register */ - #define REG_USART2_IDTRX (*(__IO uint32_t*)0x4002C084U) /**< \brief (USART2) LON IDT Rx Register */ - #define REG_USART2_ICDIFF (*(__IO uint32_t*)0x4002C088U) /**< \brief (USART2) IC DIFF Register */ - #define REG_USART2_WPMR (*(__IO uint32_t*)0x4002C0E4U) /**< \brief (USART2) Write Protection Mode Register */ - #define REG_USART2_WPSR (*(__I uint32_t*)0x4002C0E8U) /**< \brief (USART2) Write Protection Status Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_USART2_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_usbhs.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_usbhs.h deleted file mode 100644 index 86a83f05..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_usbhs.h +++ /dev/null @@ -1,240 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_USBHS_INSTANCE_ -#define _SAMV71_USBHS_INSTANCE_ - -/* ========== Register definition for USBHS peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_USBHS_DEVCTRL (0x40038000U) /**< \brief (USBHS) Device General Control Register */ - #define REG_USBHS_DEVISR (0x40038004U) /**< \brief (USBHS) Device Global Interrupt Status Register */ - #define REG_USBHS_DEVICR (0x40038008U) /**< \brief (USBHS) Device Global Interrupt Clear Register */ - #define REG_USBHS_DEVIFR (0x4003800CU) /**< \brief (USBHS) Device Global Interrupt Set Register */ - #define REG_USBHS_DEVIMR (0x40038010U) /**< \brief (USBHS) Device Global Interrupt Mask Register */ - #define REG_USBHS_DEVIDR (0x40038014U) /**< \brief (USBHS) Device Global Interrupt Disable Register */ - #define REG_USBHS_DEVIER (0x40038018U) /**< \brief (USBHS) Device Global Interrupt Enable Register */ - #define REG_USBHS_DEVEPT (0x4003801CU) /**< \brief (USBHS) Device Endpoint Register */ - #define REG_USBHS_DEVFNUM (0x40038020U) /**< \brief (USBHS) Device Frame Number Register */ - #define REG_USBHS_DEVEPTCFG (0x40038100U) /**< \brief (USBHS) Device Endpoint Configuration Register (n = 0) */ - #define REG_USBHS_DEVEPTISR (0x40038130U) /**< \brief (USBHS) Device Endpoint Status Register (n = 0) */ - #define REG_USBHS_DEVEPTICR (0x40038160U) /**< \brief (USBHS) Device Endpoint Clear Register (n = 0) */ - #define REG_USBHS_DEVEPTIFR (0x40038190U) /**< \brief (USBHS) Device Endpoint Set Register (n = 0) */ - #define REG_USBHS_DEVEPTIMR (0x400381C0U) /**< \brief (USBHS) Device Endpoint Mask Register (n = 0) */ - #define REG_USBHS_DEVEPTIER (0x400381F0U) /**< \brief (USBHS) Device Endpoint Enable Register (n = 0) */ - #define REG_USBHS_DEVEPTIDR (0x40038220U) /**< \brief (USBHS) Device Endpoint Disable Register (n = 0) */ - #define REG_USBHS_DEVDMANXTDSC1 (0x40038310U) /**< \brief (USBHS) Device DMA Channel Next Descriptor Address Register (n = 1) */ - #define REG_USBHS_DEVDMAADDRESS1 (0x40038314U) /**< \brief (USBHS) Device DMA Channel Address Register (n = 1) */ - #define REG_USBHS_DEVDMACONTROL1 (0x40038318U) /**< \brief (USBHS) Device DMA Channel Control Register (n = 1) */ - #define REG_USBHS_DEVDMASTATUS1 (0x4003831CU) /**< \brief (USBHS) Device DMA Channel Status Register (n = 1) */ - #define REG_USBHS_DEVDMANXTDSC2 (0x40038320U) /**< \brief (USBHS) Device DMA Channel Next Descriptor Address Register (n = 2) */ - #define REG_USBHS_DEVDMAADDRESS2 (0x40038324U) /**< \brief (USBHS) Device DMA Channel Address Register (n = 2) */ - #define REG_USBHS_DEVDMACONTROL2 (0x40038328U) /**< \brief (USBHS) Device DMA Channel Control Register (n = 2) */ - #define REG_USBHS_DEVDMASTATUS2 (0x4003832CU) /**< \brief (USBHS) Device DMA Channel Status Register (n = 2) */ - #define REG_USBHS_DEVDMANXTDSC3 (0x40038330U) /**< \brief (USBHS) Device DMA Channel Next Descriptor Address Register (n = 3) */ - #define REG_USBHS_DEVDMAADDRESS3 (0x40038334U) /**< \brief (USBHS) Device DMA Channel Address Register (n = 3) */ - #define REG_USBHS_DEVDMACONTROL3 (0x40038338U) /**< \brief (USBHS) Device DMA Channel Control Register (n = 3) */ - #define REG_USBHS_DEVDMASTATUS3 (0x4003833CU) /**< \brief (USBHS) Device DMA Channel Status Register (n = 3) */ - #define REG_USBHS_DEVDMANXTDSC4 (0x40038340U) /**< \brief (USBHS) Device DMA Channel Next Descriptor Address Register (n = 4) */ - #define REG_USBHS_DEVDMAADDRESS4 (0x40038344U) /**< \brief (USBHS) Device DMA Channel Address Register (n = 4) */ - #define REG_USBHS_DEVDMACONTROL4 (0x40038348U) /**< \brief (USBHS) Device DMA Channel Control Register (n = 4) */ - #define REG_USBHS_DEVDMASTATUS4 (0x4003834CU) /**< \brief (USBHS) Device DMA Channel Status Register (n = 4) */ - #define REG_USBHS_DEVDMANXTDSC5 (0x40038350U) /**< \brief (USBHS) Device DMA Channel Next Descriptor Address Register (n = 5) */ - #define REG_USBHS_DEVDMAADDRESS5 (0x40038354U) /**< \brief (USBHS) Device DMA Channel Address Register (n = 5) */ - #define REG_USBHS_DEVDMACONTROL5 (0x40038358U) /**< \brief (USBHS) Device DMA Channel Control Register (n = 5) */ - #define REG_USBHS_DEVDMASTATUS5 (0x4003835CU) /**< \brief (USBHS) Device DMA Channel Status Register (n = 5) */ - #define REG_USBHS_DEVDMANXTDSC6 (0x40038360U) /**< \brief (USBHS) Device DMA Channel Next Descriptor Address Register (n = 6) */ - #define REG_USBHS_DEVDMAADDRESS6 (0x40038364U) /**< \brief (USBHS) Device DMA Channel Address Register (n = 6) */ - #define REG_USBHS_DEVDMACONTROL6 (0x40038368U) /**< \brief (USBHS) Device DMA Channel Control Register (n = 6) */ - #define REG_USBHS_DEVDMASTATUS6 (0x4003836CU) /**< \brief (USBHS) Device DMA Channel Status Register (n = 6) */ - #define REG_USBHS_DEVDMANXTDSC7 (0x40038370U) /**< \brief (USBHS) Device DMA Channel Next Descriptor Address Register (n = 7) */ - #define REG_USBHS_DEVDMAADDRESS7 (0x40038374U) /**< \brief (USBHS) Device DMA Channel Address Register (n = 7) */ - #define REG_USBHS_DEVDMACONTROL7 (0x40038378U) /**< \brief (USBHS) Device DMA Channel Control Register (n = 7) */ - #define REG_USBHS_DEVDMASTATUS7 (0x4003837CU) /**< \brief (USBHS) Device DMA Channel Status Register (n = 7) */ - #define REG_USBHS_HSTCTRL (0x40038400U) /**< \brief (USBHS) Host General Control Register */ - #define REG_USBHS_HSTISR (0x40038404U) /**< \brief (USBHS) Host Global Interrupt Status Register */ - #define REG_USBHS_HSTICR (0x40038408U) /**< \brief (USBHS) Host Global Interrupt Clear Register */ - #define REG_USBHS_HSTIFR (0x4003840CU) /**< \brief (USBHS) Host Global Interrupt Set Register */ - #define REG_USBHS_HSTIMR (0x40038410U) /**< \brief (USBHS) Host Global Interrupt Mask Register */ - #define REG_USBHS_HSTIDR (0x40038414U) /**< \brief (USBHS) Host Global Interrupt Disable Register */ - #define REG_USBHS_HSTIER (0x40038418U) /**< \brief (USBHS) Host Global Interrupt Enable Register */ - #define REG_USBHS_HSTPIP (0x4003841CU) /**< \brief (USBHS) Host Pipe Register */ - #define REG_USBHS_HSTFNUM (0x40038420U) /**< \brief (USBHS) Host Frame Number Register */ - #define REG_USBHS_HSTADDR1 (0x40038424U) /**< \brief (USBHS) Host Address 1 Register */ - #define REG_USBHS_HSTADDR2 (0x40038428U) /**< \brief (USBHS) Host Address 2 Register */ - #define REG_USBHS_HSTADDR3 (0x4003842CU) /**< \brief (USBHS) Host Address 3 Register */ - #define REG_USBHS_HSTPIPCFG (0x40038500U) /**< \brief (USBHS) Host Pipe Configuration Register (n = 0) */ - #define REG_USBHS_HSTPIPISR (0x40038530U) /**< \brief (USBHS) Host Pipe Status Register (n = 0) */ - #define REG_USBHS_HSTPIPICR (0x40038560U) /**< \brief (USBHS) Host Pipe Clear Register (n = 0) */ - #define REG_USBHS_HSTPIPIFR (0x40038590U) /**< \brief (USBHS) Host Pipe Set Register (n = 0) */ - #define REG_USBHS_HSTPIPIMR (0x400385C0U) /**< \brief (USBHS) Host Pipe Mask Register (n = 0) */ - #define REG_USBHS_HSTPIPIER (0x400385F0U) /**< \brief (USBHS) Host Pipe Enable Register (n = 0) */ - #define REG_USBHS_HSTPIPIDR (0x40038620U) /**< \brief (USBHS) Host Pipe Disable Register (n = 0) */ - #define REG_USBHS_HSTPIPINRQ (0x40038650U) /**< \brief (USBHS) Host Pipe IN Request Register (n = 0) */ - #define REG_USBHS_HSTPIPERR (0x40038680U) /**< \brief (USBHS) Host Pipe Error Register (n = 0) */ - #define REG_USBHS_HSTDMANXTDSC1 (0x40038710U) /**< \brief (USBHS) Host DMA Channel Next Descriptor Address Register (n = 1) */ - #define REG_USBHS_HSTDMAADDRESS1 (0x40038714U) /**< \brief (USBHS) Host DMA Channel Address Register (n = 1) */ - #define REG_USBHS_HSTDMACONTROL1 (0x40038718U) /**< \brief (USBHS) Host DMA Channel Control Register (n = 1) */ - #define REG_USBHS_HSTDMASTATUS1 (0x4003871CU) /**< \brief (USBHS) Host DMA Channel Status Register (n = 1) */ - #define REG_USBHS_HSTDMANXTDSC2 (0x40038720U) /**< \brief (USBHS) Host DMA Channel Next Descriptor Address Register (n = 2) */ - #define REG_USBHS_HSTDMAADDRESS2 (0x40038724U) /**< \brief (USBHS) Host DMA Channel Address Register (n = 2) */ - #define REG_USBHS_HSTDMACONTROL2 (0x40038728U) /**< \brief (USBHS) Host DMA Channel Control Register (n = 2) */ - #define REG_USBHS_HSTDMASTATUS2 (0x4003872CU) /**< \brief (USBHS) Host DMA Channel Status Register (n = 2) */ - #define REG_USBHS_HSTDMANXTDSC3 (0x40038730U) /**< \brief (USBHS) Host DMA Channel Next Descriptor Address Register (n = 3) */ - #define REG_USBHS_HSTDMAADDRESS3 (0x40038734U) /**< \brief (USBHS) Host DMA Channel Address Register (n = 3) */ - #define REG_USBHS_HSTDMACONTROL3 (0x40038738U) /**< \brief (USBHS) Host DMA Channel Control Register (n = 3) */ - #define REG_USBHS_HSTDMASTATUS3 (0x4003873CU) /**< \brief (USBHS) Host DMA Channel Status Register (n = 3) */ - #define REG_USBHS_HSTDMANXTDSC4 (0x40038740U) /**< \brief (USBHS) Host DMA Channel Next Descriptor Address Register (n = 4) */ - #define REG_USBHS_HSTDMAADDRESS4 (0x40038744U) /**< \brief (USBHS) Host DMA Channel Address Register (n = 4) */ - #define REG_USBHS_HSTDMACONTROL4 (0x40038748U) /**< \brief (USBHS) Host DMA Channel Control Register (n = 4) */ - #define REG_USBHS_HSTDMASTATUS4 (0x4003874CU) /**< \brief (USBHS) Host DMA Channel Status Register (n = 4) */ - #define REG_USBHS_HSTDMANXTDSC5 (0x40038750U) /**< \brief (USBHS) Host DMA Channel Next Descriptor Address Register (n = 5) */ - #define REG_USBHS_HSTDMAADDRESS5 (0x40038754U) /**< \brief (USBHS) Host DMA Channel Address Register (n = 5) */ - #define REG_USBHS_HSTDMACONTROL5 (0x40038758U) /**< \brief (USBHS) Host DMA Channel Control Register (n = 5) */ - #define REG_USBHS_HSTDMASTATUS5 (0x4003875CU) /**< \brief (USBHS) Host DMA Channel Status Register (n = 5) */ - #define REG_USBHS_HSTDMANXTDSC6 (0x40038760U) /**< \brief (USBHS) Host DMA Channel Next Descriptor Address Register (n = 6) */ - #define REG_USBHS_HSTDMAADDRESS6 (0x40038764U) /**< \brief (USBHS) Host DMA Channel Address Register (n = 6) */ - #define REG_USBHS_HSTDMACONTROL6 (0x40038768U) /**< \brief (USBHS) Host DMA Channel Control Register (n = 6) */ - #define REG_USBHS_HSTDMASTATUS6 (0x4003876CU) /**< \brief (USBHS) Host DMA Channel Status Register (n = 6) */ - #define REG_USBHS_HSTDMANXTDSC7 (0x40038770U) /**< \brief (USBHS) Host DMA Channel Next Descriptor Address Register (n = 7) */ - #define REG_USBHS_HSTDMAADDRESS7 (0x40038774U) /**< \brief (USBHS) Host DMA Channel Address Register (n = 7) */ - #define REG_USBHS_HSTDMACONTROL7 (0x40038778U) /**< \brief (USBHS) Host DMA Channel Control Register (n = 7) */ - #define REG_USBHS_HSTDMASTATUS7 (0x4003877CU) /**< \brief (USBHS) Host DMA Channel Status Register (n = 7) */ - #define REG_USBHS_CTRL (0x40038800U) /**< \brief (USBHS) General Control Register */ - #define REG_USBHS_SR (0x40038804U) /**< \brief (USBHS) General Status Register */ - #define REG_USBHS_SCR (0x40038808U) /**< \brief (USBHS) General Status Clear Register */ - #define REG_USBHS_SFR (0x4003880CU) /**< \brief (USBHS) General Status Set Register */ - #define REG_USBHS_TSTA1 (0x40038810U) /**< \brief (USBHS) General Test A1 Register */ - #define REG_USBHS_TSTA2 (0x40038814U) /**< \brief (USBHS) General Test A2 Register */ - #define REG_USBHS_VERSION (0x40038818U) /**< \brief (USBHS) General Version Register */ - #define REG_USBHS_FSM (0x4003882CU) /**< \brief (USBHS) General Finite State Machine Register */ -#else - #define REG_USBHS_DEVCTRL (*(__IO uint32_t*)0x40038000U) /**< \brief (USBHS) Device General Control Register */ - #define REG_USBHS_DEVISR (*(__I uint32_t*)0x40038004U) /**< \brief (USBHS) Device Global Interrupt Status Register */ - #define REG_USBHS_DEVICR (*(__O uint32_t*)0x40038008U) /**< \brief (USBHS) Device Global Interrupt Clear Register */ - #define REG_USBHS_DEVIFR (*(__O uint32_t*)0x4003800CU) /**< \brief (USBHS) Device Global Interrupt Set Register */ - #define REG_USBHS_DEVIMR (*(__I uint32_t*)0x40038010U) /**< \brief (USBHS) Device Global Interrupt Mask Register */ - #define REG_USBHS_DEVIDR (*(__O uint32_t*)0x40038014U) /**< \brief (USBHS) Device Global Interrupt Disable Register */ - #define REG_USBHS_DEVIER (*(__O uint32_t*)0x40038018U) /**< \brief (USBHS) Device Global Interrupt Enable Register */ - #define REG_USBHS_DEVEPT (*(__IO uint32_t*)0x4003801CU) /**< \brief (USBHS) Device Endpoint Register */ - #define REG_USBHS_DEVFNUM (*(__I uint32_t*)0x40038020U) /**< \brief (USBHS) Device Frame Number Register */ - #define REG_USBHS_DEVEPTCFG (*(__IO uint32_t*)0x40038100U) /**< \brief (USBHS) Device Endpoint Configuration Register (n = 0) */ - #define REG_USBHS_DEVEPTISR (*(__I uint32_t*)0x40038130U) /**< \brief (USBHS) Device Endpoint Status Register (n = 0) */ - #define REG_USBHS_DEVEPTICR (*(__O uint32_t*)0x40038160U) /**< \brief (USBHS) Device Endpoint Clear Register (n = 0) */ - #define REG_USBHS_DEVEPTIFR (*(__O uint32_t*)0x40038190U) /**< \brief (USBHS) Device Endpoint Set Register (n = 0) */ - #define REG_USBHS_DEVEPTIMR (*(__I uint32_t*)0x400381C0U) /**< \brief (USBHS) Device Endpoint Mask Register (n = 0) */ - #define REG_USBHS_DEVEPTIER (*(__O uint32_t*)0x400381F0U) /**< \brief (USBHS) Device Endpoint Enable Register (n = 0) */ - #define REG_USBHS_DEVEPTIDR (*(__O uint32_t*)0x40038220U) /**< \brief (USBHS) Device Endpoint Disable Register (n = 0) */ - #define REG_USBHS_DEVDMANXTDSC1 (*(__IO uint32_t*)0x40038310U) /**< \brief (USBHS) Device DMA Channel Next Descriptor Address Register (n = 1) */ - #define REG_USBHS_DEVDMAADDRESS1 (*(__IO uint32_t*)0x40038314U) /**< \brief (USBHS) Device DMA Channel Address Register (n = 1) */ - #define REG_USBHS_DEVDMACONTROL1 (*(__IO uint32_t*)0x40038318U) /**< \brief (USBHS) Device DMA Channel Control Register (n = 1) */ - #define REG_USBHS_DEVDMASTATUS1 (*(__IO uint32_t*)0x4003831CU) /**< \brief (USBHS) Device DMA Channel Status Register (n = 1) */ - #define REG_USBHS_DEVDMANXTDSC2 (*(__IO uint32_t*)0x40038320U) /**< \brief (USBHS) Device DMA Channel Next Descriptor Address Register (n = 2) */ - #define REG_USBHS_DEVDMAADDRESS2 (*(__IO uint32_t*)0x40038324U) /**< \brief (USBHS) Device DMA Channel Address Register (n = 2) */ - #define REG_USBHS_DEVDMACONTROL2 (*(__IO uint32_t*)0x40038328U) /**< \brief (USBHS) Device DMA Channel Control Register (n = 2) */ - #define REG_USBHS_DEVDMASTATUS2 (*(__IO uint32_t*)0x4003832CU) /**< \brief (USBHS) Device DMA Channel Status Register (n = 2) */ - #define REG_USBHS_DEVDMANXTDSC3 (*(__IO uint32_t*)0x40038330U) /**< \brief (USBHS) Device DMA Channel Next Descriptor Address Register (n = 3) */ - #define REG_USBHS_DEVDMAADDRESS3 (*(__IO uint32_t*)0x40038334U) /**< \brief (USBHS) Device DMA Channel Address Register (n = 3) */ - #define REG_USBHS_DEVDMACONTROL3 (*(__IO uint32_t*)0x40038338U) /**< \brief (USBHS) Device DMA Channel Control Register (n = 3) */ - #define REG_USBHS_DEVDMASTATUS3 (*(__IO uint32_t*)0x4003833CU) /**< \brief (USBHS) Device DMA Channel Status Register (n = 3) */ - #define REG_USBHS_DEVDMANXTDSC4 (*(__IO uint32_t*)0x40038340U) /**< \brief (USBHS) Device DMA Channel Next Descriptor Address Register (n = 4) */ - #define REG_USBHS_DEVDMAADDRESS4 (*(__IO uint32_t*)0x40038344U) /**< \brief (USBHS) Device DMA Channel Address Register (n = 4) */ - #define REG_USBHS_DEVDMACONTROL4 (*(__IO uint32_t*)0x40038348U) /**< \brief (USBHS) Device DMA Channel Control Register (n = 4) */ - #define REG_USBHS_DEVDMASTATUS4 (*(__IO uint32_t*)0x4003834CU) /**< \brief (USBHS) Device DMA Channel Status Register (n = 4) */ - #define REG_USBHS_DEVDMANXTDSC5 (*(__IO uint32_t*)0x40038350U) /**< \brief (USBHS) Device DMA Channel Next Descriptor Address Register (n = 5) */ - #define REG_USBHS_DEVDMAADDRESS5 (*(__IO uint32_t*)0x40038354U) /**< \brief (USBHS) Device DMA Channel Address Register (n = 5) */ - #define REG_USBHS_DEVDMACONTROL5 (*(__IO uint32_t*)0x40038358U) /**< \brief (USBHS) Device DMA Channel Control Register (n = 5) */ - #define REG_USBHS_DEVDMASTATUS5 (*(__IO uint32_t*)0x4003835CU) /**< \brief (USBHS) Device DMA Channel Status Register (n = 5) */ - #define REG_USBHS_DEVDMANXTDSC6 (*(__IO uint32_t*)0x40038360U) /**< \brief (USBHS) Device DMA Channel Next Descriptor Address Register (n = 6) */ - #define REG_USBHS_DEVDMAADDRESS6 (*(__IO uint32_t*)0x40038364U) /**< \brief (USBHS) Device DMA Channel Address Register (n = 6) */ - #define REG_USBHS_DEVDMACONTROL6 (*(__IO uint32_t*)0x40038368U) /**< \brief (USBHS) Device DMA Channel Control Register (n = 6) */ - #define REG_USBHS_DEVDMASTATUS6 (*(__IO uint32_t*)0x4003836CU) /**< \brief (USBHS) Device DMA Channel Status Register (n = 6) */ - #define REG_USBHS_DEVDMANXTDSC7 (*(__IO uint32_t*)0x40038370U) /**< \brief (USBHS) Device DMA Channel Next Descriptor Address Register (n = 7) */ - #define REG_USBHS_DEVDMAADDRESS7 (*(__IO uint32_t*)0x40038374U) /**< \brief (USBHS) Device DMA Channel Address Register (n = 7) */ - #define REG_USBHS_DEVDMACONTROL7 (*(__IO uint32_t*)0x40038378U) /**< \brief (USBHS) Device DMA Channel Control Register (n = 7) */ - #define REG_USBHS_DEVDMASTATUS7 (*(__IO uint32_t*)0x4003837CU) /**< \brief (USBHS) Device DMA Channel Status Register (n = 7) */ - #define REG_USBHS_HSTCTRL (*(__IO uint32_t*)0x40038400U) /**< \brief (USBHS) Host General Control Register */ - #define REG_USBHS_HSTISR (*(__I uint32_t*)0x40038404U) /**< \brief (USBHS) Host Global Interrupt Status Register */ - #define REG_USBHS_HSTICR (*(__O uint32_t*)0x40038408U) /**< \brief (USBHS) Host Global Interrupt Clear Register */ - #define REG_USBHS_HSTIFR (*(__O uint32_t*)0x4003840CU) /**< \brief (USBHS) Host Global Interrupt Set Register */ - #define REG_USBHS_HSTIMR (*(__I uint32_t*)0x40038410U) /**< \brief (USBHS) Host Global Interrupt Mask Register */ - #define REG_USBHS_HSTIDR (*(__O uint32_t*)0x40038414U) /**< \brief (USBHS) Host Global Interrupt Disable Register */ - #define REG_USBHS_HSTIER (*(__O uint32_t*)0x40038418U) /**< \brief (USBHS) Host Global Interrupt Enable Register */ - #define REG_USBHS_HSTPIP (*(__IO uint32_t*)0x4003841CU) /**< \brief (USBHS) Host Pipe Register */ - #define REG_USBHS_HSTFNUM (*(__IO uint32_t*)0x40038420U) /**< \brief (USBHS) Host Frame Number Register */ - #define REG_USBHS_HSTADDR1 (*(__IO uint32_t*)0x40038424U) /**< \brief (USBHS) Host Address 1 Register */ - #define REG_USBHS_HSTADDR2 (*(__IO uint32_t*)0x40038428U) /**< \brief (USBHS) Host Address 2 Register */ - #define REG_USBHS_HSTADDR3 (*(__IO uint32_t*)0x4003842CU) /**< \brief (USBHS) Host Address 3 Register */ - #define REG_USBHS_HSTPIPCFG (*(__IO uint32_t*)0x40038500U) /**< \brief (USBHS) Host Pipe Configuration Register (n = 0) */ - #define REG_USBHS_HSTPIPISR (*(__I uint32_t*)0x40038530U) /**< \brief (USBHS) Host Pipe Status Register (n = 0) */ - #define REG_USBHS_HSTPIPICR (*(__O uint32_t*)0x40038560U) /**< \brief (USBHS) Host Pipe Clear Register (n = 0) */ - #define REG_USBHS_HSTPIPIFR (*(__O uint32_t*)0x40038590U) /**< \brief (USBHS) Host Pipe Set Register (n = 0) */ - #define REG_USBHS_HSTPIPIMR (*(__I uint32_t*)0x400385C0U) /**< \brief (USBHS) Host Pipe Mask Register (n = 0) */ - #define REG_USBHS_HSTPIPIER (*(__O uint32_t*)0x400385F0U) /**< \brief (USBHS) Host Pipe Enable Register (n = 0) */ - #define REG_USBHS_HSTPIPIDR (*(__O uint32_t*)0x40038620U) /**< \brief (USBHS) Host Pipe Disable Register (n = 0) */ - #define REG_USBHS_HSTPIPINRQ (*(__IO uint32_t*)0x40038650U) /**< \brief (USBHS) Host Pipe IN Request Register (n = 0) */ - #define REG_USBHS_HSTPIPERR (*(__IO uint32_t*)0x40038680U) /**< \brief (USBHS) Host Pipe Error Register (n = 0) */ - #define REG_USBHS_HSTDMANXTDSC1 (*(__IO uint32_t*)0x40038710U) /**< \brief (USBHS) Host DMA Channel Next Descriptor Address Register (n = 1) */ - #define REG_USBHS_HSTDMAADDRESS1 (*(__IO uint32_t*)0x40038714U) /**< \brief (USBHS) Host DMA Channel Address Register (n = 1) */ - #define REG_USBHS_HSTDMACONTROL1 (*(__IO uint32_t*)0x40038718U) /**< \brief (USBHS) Host DMA Channel Control Register (n = 1) */ - #define REG_USBHS_HSTDMASTATUS1 (*(__IO uint32_t*)0x4003871CU) /**< \brief (USBHS) Host DMA Channel Status Register (n = 1) */ - #define REG_USBHS_HSTDMANXTDSC2 (*(__IO uint32_t*)0x40038720U) /**< \brief (USBHS) Host DMA Channel Next Descriptor Address Register (n = 2) */ - #define REG_USBHS_HSTDMAADDRESS2 (*(__IO uint32_t*)0x40038724U) /**< \brief (USBHS) Host DMA Channel Address Register (n = 2) */ - #define REG_USBHS_HSTDMACONTROL2 (*(__IO uint32_t*)0x40038728U) /**< \brief (USBHS) Host DMA Channel Control Register (n = 2) */ - #define REG_USBHS_HSTDMASTATUS2 (*(__IO uint32_t*)0x4003872CU) /**< \brief (USBHS) Host DMA Channel Status Register (n = 2) */ - #define REG_USBHS_HSTDMANXTDSC3 (*(__IO uint32_t*)0x40038730U) /**< \brief (USBHS) Host DMA Channel Next Descriptor Address Register (n = 3) */ - #define REG_USBHS_HSTDMAADDRESS3 (*(__IO uint32_t*)0x40038734U) /**< \brief (USBHS) Host DMA Channel Address Register (n = 3) */ - #define REG_USBHS_HSTDMACONTROL3 (*(__IO uint32_t*)0x40038738U) /**< \brief (USBHS) Host DMA Channel Control Register (n = 3) */ - #define REG_USBHS_HSTDMASTATUS3 (*(__IO uint32_t*)0x4003873CU) /**< \brief (USBHS) Host DMA Channel Status Register (n = 3) */ - #define REG_USBHS_HSTDMANXTDSC4 (*(__IO uint32_t*)0x40038740U) /**< \brief (USBHS) Host DMA Channel Next Descriptor Address Register (n = 4) */ - #define REG_USBHS_HSTDMAADDRESS4 (*(__IO uint32_t*)0x40038744U) /**< \brief (USBHS) Host DMA Channel Address Register (n = 4) */ - #define REG_USBHS_HSTDMACONTROL4 (*(__IO uint32_t*)0x40038748U) /**< \brief (USBHS) Host DMA Channel Control Register (n = 4) */ - #define REG_USBHS_HSTDMASTATUS4 (*(__IO uint32_t*)0x4003874CU) /**< \brief (USBHS) Host DMA Channel Status Register (n = 4) */ - #define REG_USBHS_HSTDMANXTDSC5 (*(__IO uint32_t*)0x40038750U) /**< \brief (USBHS) Host DMA Channel Next Descriptor Address Register (n = 5) */ - #define REG_USBHS_HSTDMAADDRESS5 (*(__IO uint32_t*)0x40038754U) /**< \brief (USBHS) Host DMA Channel Address Register (n = 5) */ - #define REG_USBHS_HSTDMACONTROL5 (*(__IO uint32_t*)0x40038758U) /**< \brief (USBHS) Host DMA Channel Control Register (n = 5) */ - #define REG_USBHS_HSTDMASTATUS5 (*(__IO uint32_t*)0x4003875CU) /**< \brief (USBHS) Host DMA Channel Status Register (n = 5) */ - #define REG_USBHS_HSTDMANXTDSC6 (*(__IO uint32_t*)0x40038760U) /**< \brief (USBHS) Host DMA Channel Next Descriptor Address Register (n = 6) */ - #define REG_USBHS_HSTDMAADDRESS6 (*(__IO uint32_t*)0x40038764U) /**< \brief (USBHS) Host DMA Channel Address Register (n = 6) */ - #define REG_USBHS_HSTDMACONTROL6 (*(__IO uint32_t*)0x40038768U) /**< \brief (USBHS) Host DMA Channel Control Register (n = 6) */ - #define REG_USBHS_HSTDMASTATUS6 (*(__IO uint32_t*)0x4003876CU) /**< \brief (USBHS) Host DMA Channel Status Register (n = 6) */ - #define REG_USBHS_HSTDMANXTDSC7 (*(__IO uint32_t*)0x40038770U) /**< \brief (USBHS) Host DMA Channel Next Descriptor Address Register (n = 7) */ - #define REG_USBHS_HSTDMAADDRESS7 (*(__IO uint32_t*)0x40038774U) /**< \brief (USBHS) Host DMA Channel Address Register (n = 7) */ - #define REG_USBHS_HSTDMACONTROL7 (*(__IO uint32_t*)0x40038778U) /**< \brief (USBHS) Host DMA Channel Control Register (n = 7) */ - #define REG_USBHS_HSTDMASTATUS7 (*(__IO uint32_t*)0x4003877CU) /**< \brief (USBHS) Host DMA Channel Status Register (n = 7) */ - #define REG_USBHS_CTRL (*(__IO uint32_t*)0x40038800U) /**< \brief (USBHS) General Control Register */ - #define REG_USBHS_SR (*(__I uint32_t*)0x40038804U) /**< \brief (USBHS) General Status Register */ - #define REG_USBHS_SCR (*(__O uint32_t*)0x40038808U) /**< \brief (USBHS) General Status Clear Register */ - #define REG_USBHS_SFR (*(__O uint32_t*)0x4003880CU) /**< \brief (USBHS) General Status Set Register */ - #define REG_USBHS_TSTA1 (*(__IO uint32_t*)0x40038810U) /**< \brief (USBHS) General Test A1 Register */ - #define REG_USBHS_TSTA2 (*(__IO uint32_t*)0x40038814U) /**< \brief (USBHS) General Test A2 Register */ - #define REG_USBHS_VERSION (*(__I uint32_t*)0x40038818U) /**< \brief (USBHS) General Version Register */ - #define REG_USBHS_FSM (*(__I uint32_t*)0x4003882CU) /**< \brief (USBHS) General Finite State Machine Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_USBHS_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_utmi.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_utmi.h deleted file mode 100644 index f5b5af86..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_utmi.h +++ /dev/null @@ -1,42 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_UTMI_INSTANCE_ -#define _SAMV71_UTMI_INSTANCE_ - -/* ========== Register definition for UTMI peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_UTMI_OHCIICR (0x400E0410U) /**< \brief (UTMI) OHCI Interrupt Configuration Register */ - #define REG_UTMI_CKTRIM (0x400E0430U) /**< \brief (UTMI) UTMI Clock Trimming Register */ -#else - #define REG_UTMI_OHCIICR (*(__IO uint32_t*)0x400E0410U) /**< \brief (UTMI) OHCI Interrupt Configuration Register */ - #define REG_UTMI_CKTRIM (*(__IO uint32_t*)0x400E0430U) /**< \brief (UTMI) UTMI Clock Trimming Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_UTMI_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_wdt.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_wdt.h deleted file mode 100644 index 4bbc0aae..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_wdt.h +++ /dev/null @@ -1,44 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_WDT_INSTANCE_ -#define _SAMV71_WDT_INSTANCE_ - -/* ========== Register definition for WDT peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_WDT_CR (0x400E1850U) /**< \brief (WDT) Control Register */ - #define REG_WDT_MR (0x400E1854U) /**< \brief (WDT) Mode Register */ - #define REG_WDT_SR (0x400E1858U) /**< \brief (WDT) Status Register */ -#else - #define REG_WDT_CR (*(__O uint32_t*)0x400E1850U) /**< \brief (WDT) Control Register */ - #define REG_WDT_MR (*(__IO uint32_t*)0x400E1854U) /**< \brief (WDT) Mode Register */ - #define REG_WDT_SR (*(__I uint32_t*)0x400E1858U) /**< \brief (WDT) Status Register */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_WDT_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_xdmac.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_xdmac.h deleted file mode 100644 index 65087654..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/instance/instance_xdmac.h +++ /dev/null @@ -1,744 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_XDMAC_INSTANCE_ -#define _SAMV71_XDMAC_INSTANCE_ - -/* ========== Register definition for XDMAC peripheral ========== */ -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) - #define REG_XDMAC_GTYPE (0x40078000U) /**< \brief (XDMAC) Global Type Register */ - #define REG_XDMAC_GCFG (0x40078004U) /**< \brief (XDMAC) Global Configuration Register */ - #define REG_XDMAC_GWAC (0x40078008U) /**< \brief (XDMAC) Global Weighted Arbiter Configuration Register */ - #define REG_XDMAC_GIE (0x4007800CU) /**< \brief (XDMAC) Global Interrupt Enable Register */ - #define REG_XDMAC_GID (0x40078010U) /**< \brief (XDMAC) Global Interrupt Disable Register */ - #define REG_XDMAC_GIM (0x40078014U) /**< \brief (XDMAC) Global Interrupt Mask Register */ - #define REG_XDMAC_GIS (0x40078018U) /**< \brief (XDMAC) Global Interrupt Status Register */ - #define REG_XDMAC_GE (0x4007801CU) /**< \brief (XDMAC) Global Channel Enable Register */ - #define REG_XDMAC_GD (0x40078020U) /**< \brief (XDMAC) Global Channel Disable Register */ - #define REG_XDMAC_GS (0x40078024U) /**< \brief (XDMAC) Global Channel Status Register */ - #define REG_XDMAC_GRS (0x40078028U) /**< \brief (XDMAC) Global Channel Read Suspend Register */ - #define REG_XDMAC_GWS (0x4007802CU) /**< \brief (XDMAC) Global Channel Write Suspend Register */ - #define REG_XDMAC_GRWS (0x40078030U) /**< \brief (XDMAC) Global Channel Read Write Suspend Register */ - #define REG_XDMAC_GRWR (0x40078034U) /**< \brief (XDMAC) Global Channel Read Write Resume Register */ - #define REG_XDMAC_GSWR (0x40078038U) /**< \brief (XDMAC) Global Channel Software Request Register */ - #define REG_XDMAC_GSWS (0x4007803CU) /**< \brief (XDMAC) Global Channel Software Request Status Register */ - #define REG_XDMAC_GSWF (0x40078040U) /**< \brief (XDMAC) Global Channel Software Flush Request Register */ - #define REG_XDMAC_CIE0 (0x40078050U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 0) */ - #define REG_XDMAC_CID0 (0x40078054U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 0) */ - #define REG_XDMAC_CIM0 (0x40078058U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 0) */ - #define REG_XDMAC_CIS0 (0x4007805CU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 0) */ - #define REG_XDMAC_CSA0 (0x40078060U) /**< \brief (XDMAC) Channel Source Address Register (chid = 0) */ - #define REG_XDMAC_CDA0 (0x40078064U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 0) */ - #define REG_XDMAC_CNDA0 (0x40078068U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 0) */ - #define REG_XDMAC_CNDC0 (0x4007806CU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 0) */ - #define REG_XDMAC_CUBC0 (0x40078070U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 0) */ - #define REG_XDMAC_CBC0 (0x40078074U) /**< \brief (XDMAC) Channel Block Control Register (chid = 0) */ - #define REG_XDMAC_CC0 (0x40078078U) /**< \brief (XDMAC) Channel Configuration Register (chid = 0) */ - #define REG_XDMAC_CDS_MSP0 (0x4007807CU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 0) */ - #define REG_XDMAC_CSUS0 (0x40078080U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 0) */ - #define REG_XDMAC_CDUS0 (0x40078084U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 0) */ - #define REG_XDMAC_CIE1 (0x40078090U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 1) */ - #define REG_XDMAC_CID1 (0x40078094U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 1) */ - #define REG_XDMAC_CIM1 (0x40078098U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 1) */ - #define REG_XDMAC_CIS1 (0x4007809CU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 1) */ - #define REG_XDMAC_CSA1 (0x400780A0U) /**< \brief (XDMAC) Channel Source Address Register (chid = 1) */ - #define REG_XDMAC_CDA1 (0x400780A4U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 1) */ - #define REG_XDMAC_CNDA1 (0x400780A8U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 1) */ - #define REG_XDMAC_CNDC1 (0x400780ACU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 1) */ - #define REG_XDMAC_CUBC1 (0x400780B0U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 1) */ - #define REG_XDMAC_CBC1 (0x400780B4U) /**< \brief (XDMAC) Channel Block Control Register (chid = 1) */ - #define REG_XDMAC_CC1 (0x400780B8U) /**< \brief (XDMAC) Channel Configuration Register (chid = 1) */ - #define REG_XDMAC_CDS_MSP1 (0x400780BCU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 1) */ - #define REG_XDMAC_CSUS1 (0x400780C0U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 1) */ - #define REG_XDMAC_CDUS1 (0x400780C4U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 1) */ - #define REG_XDMAC_CIE2 (0x400780D0U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 2) */ - #define REG_XDMAC_CID2 (0x400780D4U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 2) */ - #define REG_XDMAC_CIM2 (0x400780D8U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 2) */ - #define REG_XDMAC_CIS2 (0x400780DCU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 2) */ - #define REG_XDMAC_CSA2 (0x400780E0U) /**< \brief (XDMAC) Channel Source Address Register (chid = 2) */ - #define REG_XDMAC_CDA2 (0x400780E4U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 2) */ - #define REG_XDMAC_CNDA2 (0x400780E8U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 2) */ - #define REG_XDMAC_CNDC2 (0x400780ECU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 2) */ - #define REG_XDMAC_CUBC2 (0x400780F0U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 2) */ - #define REG_XDMAC_CBC2 (0x400780F4U) /**< \brief (XDMAC) Channel Block Control Register (chid = 2) */ - #define REG_XDMAC_CC2 (0x400780F8U) /**< \brief (XDMAC) Channel Configuration Register (chid = 2) */ - #define REG_XDMAC_CDS_MSP2 (0x400780FCU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 2) */ - #define REG_XDMAC_CSUS2 (0x40078100U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 2) */ - #define REG_XDMAC_CDUS2 (0x40078104U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 2) */ - #define REG_XDMAC_CIE3 (0x40078110U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 3) */ - #define REG_XDMAC_CID3 (0x40078114U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 3) */ - #define REG_XDMAC_CIM3 (0x40078118U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 3) */ - #define REG_XDMAC_CIS3 (0x4007811CU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 3) */ - #define REG_XDMAC_CSA3 (0x40078120U) /**< \brief (XDMAC) Channel Source Address Register (chid = 3) */ - #define REG_XDMAC_CDA3 (0x40078124U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 3) */ - #define REG_XDMAC_CNDA3 (0x40078128U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 3) */ - #define REG_XDMAC_CNDC3 (0x4007812CU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 3) */ - #define REG_XDMAC_CUBC3 (0x40078130U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 3) */ - #define REG_XDMAC_CBC3 (0x40078134U) /**< \brief (XDMAC) Channel Block Control Register (chid = 3) */ - #define REG_XDMAC_CC3 (0x40078138U) /**< \brief (XDMAC) Channel Configuration Register (chid = 3) */ - #define REG_XDMAC_CDS_MSP3 (0x4007813CU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 3) */ - #define REG_XDMAC_CSUS3 (0x40078140U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 3) */ - #define REG_XDMAC_CDUS3 (0x40078144U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 3) */ - #define REG_XDMAC_CIE4 (0x40078150U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 4) */ - #define REG_XDMAC_CID4 (0x40078154U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 4) */ - #define REG_XDMAC_CIM4 (0x40078158U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 4) */ - #define REG_XDMAC_CIS4 (0x4007815CU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 4) */ - #define REG_XDMAC_CSA4 (0x40078160U) /**< \brief (XDMAC) Channel Source Address Register (chid = 4) */ - #define REG_XDMAC_CDA4 (0x40078164U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 4) */ - #define REG_XDMAC_CNDA4 (0x40078168U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 4) */ - #define REG_XDMAC_CNDC4 (0x4007816CU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 4) */ - #define REG_XDMAC_CUBC4 (0x40078170U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 4) */ - #define REG_XDMAC_CBC4 (0x40078174U) /**< \brief (XDMAC) Channel Block Control Register (chid = 4) */ - #define REG_XDMAC_CC4 (0x40078178U) /**< \brief (XDMAC) Channel Configuration Register (chid = 4) */ - #define REG_XDMAC_CDS_MSP4 (0x4007817CU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 4) */ - #define REG_XDMAC_CSUS4 (0x40078180U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 4) */ - #define REG_XDMAC_CDUS4 (0x40078184U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 4) */ - #define REG_XDMAC_CIE5 (0x40078190U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 5) */ - #define REG_XDMAC_CID5 (0x40078194U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 5) */ - #define REG_XDMAC_CIM5 (0x40078198U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 5) */ - #define REG_XDMAC_CIS5 (0x4007819CU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 5) */ - #define REG_XDMAC_CSA5 (0x400781A0U) /**< \brief (XDMAC) Channel Source Address Register (chid = 5) */ - #define REG_XDMAC_CDA5 (0x400781A4U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 5) */ - #define REG_XDMAC_CNDA5 (0x400781A8U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 5) */ - #define REG_XDMAC_CNDC5 (0x400781ACU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 5) */ - #define REG_XDMAC_CUBC5 (0x400781B0U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 5) */ - #define REG_XDMAC_CBC5 (0x400781B4U) /**< \brief (XDMAC) Channel Block Control Register (chid = 5) */ - #define REG_XDMAC_CC5 (0x400781B8U) /**< \brief (XDMAC) Channel Configuration Register (chid = 5) */ - #define REG_XDMAC_CDS_MSP5 (0x400781BCU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 5) */ - #define REG_XDMAC_CSUS5 (0x400781C0U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 5) */ - #define REG_XDMAC_CDUS5 (0x400781C4U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 5) */ - #define REG_XDMAC_CIE6 (0x400781D0U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 6) */ - #define REG_XDMAC_CID6 (0x400781D4U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 6) */ - #define REG_XDMAC_CIM6 (0x400781D8U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 6) */ - #define REG_XDMAC_CIS6 (0x400781DCU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 6) */ - #define REG_XDMAC_CSA6 (0x400781E0U) /**< \brief (XDMAC) Channel Source Address Register (chid = 6) */ - #define REG_XDMAC_CDA6 (0x400781E4U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 6) */ - #define REG_XDMAC_CNDA6 (0x400781E8U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 6) */ - #define REG_XDMAC_CNDC6 (0x400781ECU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 6) */ - #define REG_XDMAC_CUBC6 (0x400781F0U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 6) */ - #define REG_XDMAC_CBC6 (0x400781F4U) /**< \brief (XDMAC) Channel Block Control Register (chid = 6) */ - #define REG_XDMAC_CC6 (0x400781F8U) /**< \brief (XDMAC) Channel Configuration Register (chid = 6) */ - #define REG_XDMAC_CDS_MSP6 (0x400781FCU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 6) */ - #define REG_XDMAC_CSUS6 (0x40078200U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 6) */ - #define REG_XDMAC_CDUS6 (0x40078204U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 6) */ - #define REG_XDMAC_CIE7 (0x40078210U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 7) */ - #define REG_XDMAC_CID7 (0x40078214U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 7) */ - #define REG_XDMAC_CIM7 (0x40078218U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 7) */ - #define REG_XDMAC_CIS7 (0x4007821CU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 7) */ - #define REG_XDMAC_CSA7 (0x40078220U) /**< \brief (XDMAC) Channel Source Address Register (chid = 7) */ - #define REG_XDMAC_CDA7 (0x40078224U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 7) */ - #define REG_XDMAC_CNDA7 (0x40078228U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 7) */ - #define REG_XDMAC_CNDC7 (0x4007822CU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 7) */ - #define REG_XDMAC_CUBC7 (0x40078230U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 7) */ - #define REG_XDMAC_CBC7 (0x40078234U) /**< \brief (XDMAC) Channel Block Control Register (chid = 7) */ - #define REG_XDMAC_CC7 (0x40078238U) /**< \brief (XDMAC) Channel Configuration Register (chid = 7) */ - #define REG_XDMAC_CDS_MSP7 (0x4007823CU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 7) */ - #define REG_XDMAC_CSUS7 (0x40078240U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 7) */ - #define REG_XDMAC_CDUS7 (0x40078244U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 7) */ - #define REG_XDMAC_CIE8 (0x40078250U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 8) */ - #define REG_XDMAC_CID8 (0x40078254U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 8) */ - #define REG_XDMAC_CIM8 (0x40078258U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 8) */ - #define REG_XDMAC_CIS8 (0x4007825CU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 8) */ - #define REG_XDMAC_CSA8 (0x40078260U) /**< \brief (XDMAC) Channel Source Address Register (chid = 8) */ - #define REG_XDMAC_CDA8 (0x40078264U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 8) */ - #define REG_XDMAC_CNDA8 (0x40078268U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 8) */ - #define REG_XDMAC_CNDC8 (0x4007826CU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 8) */ - #define REG_XDMAC_CUBC8 (0x40078270U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 8) */ - #define REG_XDMAC_CBC8 (0x40078274U) /**< \brief (XDMAC) Channel Block Control Register (chid = 8) */ - #define REG_XDMAC_CC8 (0x40078278U) /**< \brief (XDMAC) Channel Configuration Register (chid = 8) */ - #define REG_XDMAC_CDS_MSP8 (0x4007827CU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 8) */ - #define REG_XDMAC_CSUS8 (0x40078280U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 8) */ - #define REG_XDMAC_CDUS8 (0x40078284U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 8) */ - #define REG_XDMAC_CIE9 (0x40078290U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 9) */ - #define REG_XDMAC_CID9 (0x40078294U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 9) */ - #define REG_XDMAC_CIM9 (0x40078298U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 9) */ - #define REG_XDMAC_CIS9 (0x4007829CU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 9) */ - #define REG_XDMAC_CSA9 (0x400782A0U) /**< \brief (XDMAC) Channel Source Address Register (chid = 9) */ - #define REG_XDMAC_CDA9 (0x400782A4U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 9) */ - #define REG_XDMAC_CNDA9 (0x400782A8U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 9) */ - #define REG_XDMAC_CNDC9 (0x400782ACU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 9) */ - #define REG_XDMAC_CUBC9 (0x400782B0U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 9) */ - #define REG_XDMAC_CBC9 (0x400782B4U) /**< \brief (XDMAC) Channel Block Control Register (chid = 9) */ - #define REG_XDMAC_CC9 (0x400782B8U) /**< \brief (XDMAC) Channel Configuration Register (chid = 9) */ - #define REG_XDMAC_CDS_MSP9 (0x400782BCU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 9) */ - #define REG_XDMAC_CSUS9 (0x400782C0U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 9) */ - #define REG_XDMAC_CDUS9 (0x400782C4U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 9) */ - #define REG_XDMAC_CIE10 (0x400782D0U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 10) */ - #define REG_XDMAC_CID10 (0x400782D4U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 10) */ - #define REG_XDMAC_CIM10 (0x400782D8U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 10) */ - #define REG_XDMAC_CIS10 (0x400782DCU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 10) */ - #define REG_XDMAC_CSA10 (0x400782E0U) /**< \brief (XDMAC) Channel Source Address Register (chid = 10) */ - #define REG_XDMAC_CDA10 (0x400782E4U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 10) */ - #define REG_XDMAC_CNDA10 (0x400782E8U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 10) */ - #define REG_XDMAC_CNDC10 (0x400782ECU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 10) */ - #define REG_XDMAC_CUBC10 (0x400782F0U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 10) */ - #define REG_XDMAC_CBC10 (0x400782F4U) /**< \brief (XDMAC) Channel Block Control Register (chid = 10) */ - #define REG_XDMAC_CC10 (0x400782F8U) /**< \brief (XDMAC) Channel Configuration Register (chid = 10) */ - #define REG_XDMAC_CDS_MSP10 (0x400782FCU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 10) */ - #define REG_XDMAC_CSUS10 (0x40078300U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 10) */ - #define REG_XDMAC_CDUS10 (0x40078304U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 10) */ - #define REG_XDMAC_CIE11 (0x40078310U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 11) */ - #define REG_XDMAC_CID11 (0x40078314U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 11) */ - #define REG_XDMAC_CIM11 (0x40078318U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 11) */ - #define REG_XDMAC_CIS11 (0x4007831CU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 11) */ - #define REG_XDMAC_CSA11 (0x40078320U) /**< \brief (XDMAC) Channel Source Address Register (chid = 11) */ - #define REG_XDMAC_CDA11 (0x40078324U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 11) */ - #define REG_XDMAC_CNDA11 (0x40078328U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 11) */ - #define REG_XDMAC_CNDC11 (0x4007832CU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 11) */ - #define REG_XDMAC_CUBC11 (0x40078330U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 11) */ - #define REG_XDMAC_CBC11 (0x40078334U) /**< \brief (XDMAC) Channel Block Control Register (chid = 11) */ - #define REG_XDMAC_CC11 (0x40078338U) /**< \brief (XDMAC) Channel Configuration Register (chid = 11) */ - #define REG_XDMAC_CDS_MSP11 (0x4007833CU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 11) */ - #define REG_XDMAC_CSUS11 (0x40078340U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 11) */ - #define REG_XDMAC_CDUS11 (0x40078344U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 11) */ - #define REG_XDMAC_CIE12 (0x40078350U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 12) */ - #define REG_XDMAC_CID12 (0x40078354U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 12) */ - #define REG_XDMAC_CIM12 (0x40078358U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 12) */ - #define REG_XDMAC_CIS12 (0x4007835CU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 12) */ - #define REG_XDMAC_CSA12 (0x40078360U) /**< \brief (XDMAC) Channel Source Address Register (chid = 12) */ - #define REG_XDMAC_CDA12 (0x40078364U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 12) */ - #define REG_XDMAC_CNDA12 (0x40078368U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 12) */ - #define REG_XDMAC_CNDC12 (0x4007836CU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 12) */ - #define REG_XDMAC_CUBC12 (0x40078370U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 12) */ - #define REG_XDMAC_CBC12 (0x40078374U) /**< \brief (XDMAC) Channel Block Control Register (chid = 12) */ - #define REG_XDMAC_CC12 (0x40078378U) /**< \brief (XDMAC) Channel Configuration Register (chid = 12) */ - #define REG_XDMAC_CDS_MSP12 (0x4007837CU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 12) */ - #define REG_XDMAC_CSUS12 (0x40078380U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 12) */ - #define REG_XDMAC_CDUS12 (0x40078384U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 12) */ - #define REG_XDMAC_CIE13 (0x40078390U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 13) */ - #define REG_XDMAC_CID13 (0x40078394U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 13) */ - #define REG_XDMAC_CIM13 (0x40078398U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 13) */ - #define REG_XDMAC_CIS13 (0x4007839CU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 13) */ - #define REG_XDMAC_CSA13 (0x400783A0U) /**< \brief (XDMAC) Channel Source Address Register (chid = 13) */ - #define REG_XDMAC_CDA13 (0x400783A4U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 13) */ - #define REG_XDMAC_CNDA13 (0x400783A8U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 13) */ - #define REG_XDMAC_CNDC13 (0x400783ACU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 13) */ - #define REG_XDMAC_CUBC13 (0x400783B0U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 13) */ - #define REG_XDMAC_CBC13 (0x400783B4U) /**< \brief (XDMAC) Channel Block Control Register (chid = 13) */ - #define REG_XDMAC_CC13 (0x400783B8U) /**< \brief (XDMAC) Channel Configuration Register (chid = 13) */ - #define REG_XDMAC_CDS_MSP13 (0x400783BCU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 13) */ - #define REG_XDMAC_CSUS13 (0x400783C0U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 13) */ - #define REG_XDMAC_CDUS13 (0x400783C4U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 13) */ - #define REG_XDMAC_CIE14 (0x400783D0U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 14) */ - #define REG_XDMAC_CID14 (0x400783D4U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 14) */ - #define REG_XDMAC_CIM14 (0x400783D8U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 14) */ - #define REG_XDMAC_CIS14 (0x400783DCU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 14) */ - #define REG_XDMAC_CSA14 (0x400783E0U) /**< \brief (XDMAC) Channel Source Address Register (chid = 14) */ - #define REG_XDMAC_CDA14 (0x400783E4U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 14) */ - #define REG_XDMAC_CNDA14 (0x400783E8U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 14) */ - #define REG_XDMAC_CNDC14 (0x400783ECU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 14) */ - #define REG_XDMAC_CUBC14 (0x400783F0U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 14) */ - #define REG_XDMAC_CBC14 (0x400783F4U) /**< \brief (XDMAC) Channel Block Control Register (chid = 14) */ - #define REG_XDMAC_CC14 (0x400783F8U) /**< \brief (XDMAC) Channel Configuration Register (chid = 14) */ - #define REG_XDMAC_CDS_MSP14 (0x400783FCU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 14) */ - #define REG_XDMAC_CSUS14 (0x40078400U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 14) */ - #define REG_XDMAC_CDUS14 (0x40078404U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 14) */ - #define REG_XDMAC_CIE15 (0x40078410U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 15) */ - #define REG_XDMAC_CID15 (0x40078414U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 15) */ - #define REG_XDMAC_CIM15 (0x40078418U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 15) */ - #define REG_XDMAC_CIS15 (0x4007841CU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 15) */ - #define REG_XDMAC_CSA15 (0x40078420U) /**< \brief (XDMAC) Channel Source Address Register (chid = 15) */ - #define REG_XDMAC_CDA15 (0x40078424U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 15) */ - #define REG_XDMAC_CNDA15 (0x40078428U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 15) */ - #define REG_XDMAC_CNDC15 (0x4007842CU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 15) */ - #define REG_XDMAC_CUBC15 (0x40078430U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 15) */ - #define REG_XDMAC_CBC15 (0x40078434U) /**< \brief (XDMAC) Channel Block Control Register (chid = 15) */ - #define REG_XDMAC_CC15 (0x40078438U) /**< \brief (XDMAC) Channel Configuration Register (chid = 15) */ - #define REG_XDMAC_CDS_MSP15 (0x4007843CU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 15) */ - #define REG_XDMAC_CSUS15 (0x40078440U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 15) */ - #define REG_XDMAC_CDUS15 (0x40078444U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 15) */ - #define REG_XDMAC_CIE16 (0x40078450U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 16) */ - #define REG_XDMAC_CID16 (0x40078454U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 16) */ - #define REG_XDMAC_CIM16 (0x40078458U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 16) */ - #define REG_XDMAC_CIS16 (0x4007845CU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 16) */ - #define REG_XDMAC_CSA16 (0x40078460U) /**< \brief (XDMAC) Channel Source Address Register (chid = 16) */ - #define REG_XDMAC_CDA16 (0x40078464U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 16) */ - #define REG_XDMAC_CNDA16 (0x40078468U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 16) */ - #define REG_XDMAC_CNDC16 (0x4007846CU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 16) */ - #define REG_XDMAC_CUBC16 (0x40078470U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 16) */ - #define REG_XDMAC_CBC16 (0x40078474U) /**< \brief (XDMAC) Channel Block Control Register (chid = 16) */ - #define REG_XDMAC_CC16 (0x40078478U) /**< \brief (XDMAC) Channel Configuration Register (chid = 16) */ - #define REG_XDMAC_CDS_MSP16 (0x4007847CU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 16) */ - #define REG_XDMAC_CSUS16 (0x40078480U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 16) */ - #define REG_XDMAC_CDUS16 (0x40078484U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 16) */ - #define REG_XDMAC_CIE17 (0x40078490U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 17) */ - #define REG_XDMAC_CID17 (0x40078494U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 17) */ - #define REG_XDMAC_CIM17 (0x40078498U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 17) */ - #define REG_XDMAC_CIS17 (0x4007849CU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 17) */ - #define REG_XDMAC_CSA17 (0x400784A0U) /**< \brief (XDMAC) Channel Source Address Register (chid = 17) */ - #define REG_XDMAC_CDA17 (0x400784A4U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 17) */ - #define REG_XDMAC_CNDA17 (0x400784A8U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 17) */ - #define REG_XDMAC_CNDC17 (0x400784ACU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 17) */ - #define REG_XDMAC_CUBC17 (0x400784B0U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 17) */ - #define REG_XDMAC_CBC17 (0x400784B4U) /**< \brief (XDMAC) Channel Block Control Register (chid = 17) */ - #define REG_XDMAC_CC17 (0x400784B8U) /**< \brief (XDMAC) Channel Configuration Register (chid = 17) */ - #define REG_XDMAC_CDS_MSP17 (0x400784BCU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 17) */ - #define REG_XDMAC_CSUS17 (0x400784C0U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 17) */ - #define REG_XDMAC_CDUS17 (0x400784C4U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 17) */ - #define REG_XDMAC_CIE18 (0x400784D0U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 18) */ - #define REG_XDMAC_CID18 (0x400784D4U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 18) */ - #define REG_XDMAC_CIM18 (0x400784D8U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 18) */ - #define REG_XDMAC_CIS18 (0x400784DCU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 18) */ - #define REG_XDMAC_CSA18 (0x400784E0U) /**< \brief (XDMAC) Channel Source Address Register (chid = 18) */ - #define REG_XDMAC_CDA18 (0x400784E4U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 18) */ - #define REG_XDMAC_CNDA18 (0x400784E8U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 18) */ - #define REG_XDMAC_CNDC18 (0x400784ECU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 18) */ - #define REG_XDMAC_CUBC18 (0x400784F0U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 18) */ - #define REG_XDMAC_CBC18 (0x400784F4U) /**< \brief (XDMAC) Channel Block Control Register (chid = 18) */ - #define REG_XDMAC_CC18 (0x400784F8U) /**< \brief (XDMAC) Channel Configuration Register (chid = 18) */ - #define REG_XDMAC_CDS_MSP18 (0x400784FCU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 18) */ - #define REG_XDMAC_CSUS18 (0x40078500U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 18) */ - #define REG_XDMAC_CDUS18 (0x40078504U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 18) */ - #define REG_XDMAC_CIE19 (0x40078510U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 19) */ - #define REG_XDMAC_CID19 (0x40078514U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 19) */ - #define REG_XDMAC_CIM19 (0x40078518U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 19) */ - #define REG_XDMAC_CIS19 (0x4007851CU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 19) */ - #define REG_XDMAC_CSA19 (0x40078520U) /**< \brief (XDMAC) Channel Source Address Register (chid = 19) */ - #define REG_XDMAC_CDA19 (0x40078524U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 19) */ - #define REG_XDMAC_CNDA19 (0x40078528U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 19) */ - #define REG_XDMAC_CNDC19 (0x4007852CU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 19) */ - #define REG_XDMAC_CUBC19 (0x40078530U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 19) */ - #define REG_XDMAC_CBC19 (0x40078534U) /**< \brief (XDMAC) Channel Block Control Register (chid = 19) */ - #define REG_XDMAC_CC19 (0x40078538U) /**< \brief (XDMAC) Channel Configuration Register (chid = 19) */ - #define REG_XDMAC_CDS_MSP19 (0x4007853CU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 19) */ - #define REG_XDMAC_CSUS19 (0x40078540U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 19) */ - #define REG_XDMAC_CDUS19 (0x40078544U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 19) */ - #define REG_XDMAC_CIE20 (0x40078550U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 20) */ - #define REG_XDMAC_CID20 (0x40078554U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 20) */ - #define REG_XDMAC_CIM20 (0x40078558U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 20) */ - #define REG_XDMAC_CIS20 (0x4007855CU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 20) */ - #define REG_XDMAC_CSA20 (0x40078560U) /**< \brief (XDMAC) Channel Source Address Register (chid = 20) */ - #define REG_XDMAC_CDA20 (0x40078564U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 20) */ - #define REG_XDMAC_CNDA20 (0x40078568U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 20) */ - #define REG_XDMAC_CNDC20 (0x4007856CU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 20) */ - #define REG_XDMAC_CUBC20 (0x40078570U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 20) */ - #define REG_XDMAC_CBC20 (0x40078574U) /**< \brief (XDMAC) Channel Block Control Register (chid = 20) */ - #define REG_XDMAC_CC20 (0x40078578U) /**< \brief (XDMAC) Channel Configuration Register (chid = 20) */ - #define REG_XDMAC_CDS_MSP20 (0x4007857CU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 20) */ - #define REG_XDMAC_CSUS20 (0x40078580U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 20) */ - #define REG_XDMAC_CDUS20 (0x40078584U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 20) */ - #define REG_XDMAC_CIE21 (0x40078590U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 21) */ - #define REG_XDMAC_CID21 (0x40078594U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 21) */ - #define REG_XDMAC_CIM21 (0x40078598U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 21) */ - #define REG_XDMAC_CIS21 (0x4007859CU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 21) */ - #define REG_XDMAC_CSA21 (0x400785A0U) /**< \brief (XDMAC) Channel Source Address Register (chid = 21) */ - #define REG_XDMAC_CDA21 (0x400785A4U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 21) */ - #define REG_XDMAC_CNDA21 (0x400785A8U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 21) */ - #define REG_XDMAC_CNDC21 (0x400785ACU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 21) */ - #define REG_XDMAC_CUBC21 (0x400785B0U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 21) */ - #define REG_XDMAC_CBC21 (0x400785B4U) /**< \brief (XDMAC) Channel Block Control Register (chid = 21) */ - #define REG_XDMAC_CC21 (0x400785B8U) /**< \brief (XDMAC) Channel Configuration Register (chid = 21) */ - #define REG_XDMAC_CDS_MSP21 (0x400785BCU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 21) */ - #define REG_XDMAC_CSUS21 (0x400785C0U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 21) */ - #define REG_XDMAC_CDUS21 (0x400785C4U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 21) */ - #define REG_XDMAC_CIE22 (0x400785D0U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 22) */ - #define REG_XDMAC_CID22 (0x400785D4U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 22) */ - #define REG_XDMAC_CIM22 (0x400785D8U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 22) */ - #define REG_XDMAC_CIS22 (0x400785DCU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 22) */ - #define REG_XDMAC_CSA22 (0x400785E0U) /**< \brief (XDMAC) Channel Source Address Register (chid = 22) */ - #define REG_XDMAC_CDA22 (0x400785E4U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 22) */ - #define REG_XDMAC_CNDA22 (0x400785E8U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 22) */ - #define REG_XDMAC_CNDC22 (0x400785ECU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 22) */ - #define REG_XDMAC_CUBC22 (0x400785F0U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 22) */ - #define REG_XDMAC_CBC22 (0x400785F4U) /**< \brief (XDMAC) Channel Block Control Register (chid = 22) */ - #define REG_XDMAC_CC22 (0x400785F8U) /**< \brief (XDMAC) Channel Configuration Register (chid = 22) */ - #define REG_XDMAC_CDS_MSP22 (0x400785FCU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 22) */ - #define REG_XDMAC_CSUS22 (0x40078600U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 22) */ - #define REG_XDMAC_CDUS22 (0x40078604U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 22) */ - #define REG_XDMAC_CIE23 (0x40078610U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 23) */ - #define REG_XDMAC_CID23 (0x40078614U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 23) */ - #define REG_XDMAC_CIM23 (0x40078618U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 23) */ - #define REG_XDMAC_CIS23 (0x4007861CU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 23) */ - #define REG_XDMAC_CSA23 (0x40078620U) /**< \brief (XDMAC) Channel Source Address Register (chid = 23) */ - #define REG_XDMAC_CDA23 (0x40078624U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 23) */ - #define REG_XDMAC_CNDA23 (0x40078628U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 23) */ - #define REG_XDMAC_CNDC23 (0x4007862CU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 23) */ - #define REG_XDMAC_CUBC23 (0x40078630U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 23) */ - #define REG_XDMAC_CBC23 (0x40078634U) /**< \brief (XDMAC) Channel Block Control Register (chid = 23) */ - #define REG_XDMAC_CC23 (0x40078638U) /**< \brief (XDMAC) Channel Configuration Register (chid = 23) */ - #define REG_XDMAC_CDS_MSP23 (0x4007863CU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 23) */ - #define REG_XDMAC_CSUS23 (0x40078640U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 23) */ - #define REG_XDMAC_CDUS23 (0x40078644U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 23) */ -#else - #define REG_XDMAC_GTYPE (*(__IO uint32_t*)0x40078000U) /**< \brief (XDMAC) Global Type Register */ - #define REG_XDMAC_GCFG (*(__I uint32_t*)0x40078004U) /**< \brief (XDMAC) Global Configuration Register */ - #define REG_XDMAC_GWAC (*(__IO uint32_t*)0x40078008U) /**< \brief (XDMAC) Global Weighted Arbiter Configuration Register */ - #define REG_XDMAC_GIE (*(__O uint32_t*)0x4007800CU) /**< \brief (XDMAC) Global Interrupt Enable Register */ - #define REG_XDMAC_GID (*(__O uint32_t*)0x40078010U) /**< \brief (XDMAC) Global Interrupt Disable Register */ - #define REG_XDMAC_GIM (*(__I uint32_t*)0x40078014U) /**< \brief (XDMAC) Global Interrupt Mask Register */ - #define REG_XDMAC_GIS (*(__I uint32_t*)0x40078018U) /**< \brief (XDMAC) Global Interrupt Status Register */ - #define REG_XDMAC_GE (*(__O uint32_t*)0x4007801CU) /**< \brief (XDMAC) Global Channel Enable Register */ - #define REG_XDMAC_GD (*(__O uint32_t*)0x40078020U) /**< \brief (XDMAC) Global Channel Disable Register */ - #define REG_XDMAC_GS (*(__I uint32_t*)0x40078024U) /**< \brief (XDMAC) Global Channel Status Register */ - #define REG_XDMAC_GRS (*(__IO uint32_t*)0x40078028U) /**< \brief (XDMAC) Global Channel Read Suspend Register */ - #define REG_XDMAC_GWS (*(__IO uint32_t*)0x4007802CU) /**< \brief (XDMAC) Global Channel Write Suspend Register */ - #define REG_XDMAC_GRWS (*(__O uint32_t*)0x40078030U) /**< \brief (XDMAC) Global Channel Read Write Suspend Register */ - #define REG_XDMAC_GRWR (*(__O uint32_t*)0x40078034U) /**< \brief (XDMAC) Global Channel Read Write Resume Register */ - #define REG_XDMAC_GSWR (*(__O uint32_t*)0x40078038U) /**< \brief (XDMAC) Global Channel Software Request Register */ - #define REG_XDMAC_GSWS (*(__I uint32_t*)0x4007803CU) /**< \brief (XDMAC) Global Channel Software Request Status Register */ - #define REG_XDMAC_GSWF (*(__O uint32_t*)0x40078040U) /**< \brief (XDMAC) Global Channel Software Flush Request Register */ - #define REG_XDMAC_CIE0 (*(__O uint32_t*)0x40078050U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 0) */ - #define REG_XDMAC_CID0 (*(__O uint32_t*)0x40078054U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 0) */ - #define REG_XDMAC_CIM0 (*(__O uint32_t*)0x40078058U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 0) */ - #define REG_XDMAC_CIS0 (*(__I uint32_t*)0x4007805CU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 0) */ - #define REG_XDMAC_CSA0 (*(__IO uint32_t*)0x40078060U) /**< \brief (XDMAC) Channel Source Address Register (chid = 0) */ - #define REG_XDMAC_CDA0 (*(__IO uint32_t*)0x40078064U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 0) */ - #define REG_XDMAC_CNDA0 (*(__IO uint32_t*)0x40078068U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 0) */ - #define REG_XDMAC_CNDC0 (*(__IO uint32_t*)0x4007806CU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 0) */ - #define REG_XDMAC_CUBC0 (*(__IO uint32_t*)0x40078070U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 0) */ - #define REG_XDMAC_CBC0 (*(__IO uint32_t*)0x40078074U) /**< \brief (XDMAC) Channel Block Control Register (chid = 0) */ - #define REG_XDMAC_CC0 (*(__IO uint32_t*)0x40078078U) /**< \brief (XDMAC) Channel Configuration Register (chid = 0) */ - #define REG_XDMAC_CDS_MSP0 (*(__IO uint32_t*)0x4007807CU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 0) */ - #define REG_XDMAC_CSUS0 (*(__IO uint32_t*)0x40078080U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 0) */ - #define REG_XDMAC_CDUS0 (*(__IO uint32_t*)0x40078084U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 0) */ - #define REG_XDMAC_CIE1 (*(__O uint32_t*)0x40078090U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 1) */ - #define REG_XDMAC_CID1 (*(__O uint32_t*)0x40078094U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 1) */ - #define REG_XDMAC_CIM1 (*(__O uint32_t*)0x40078098U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 1) */ - #define REG_XDMAC_CIS1 (*(__I uint32_t*)0x4007809CU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 1) */ - #define REG_XDMAC_CSA1 (*(__IO uint32_t*)0x400780A0U) /**< \brief (XDMAC) Channel Source Address Register (chid = 1) */ - #define REG_XDMAC_CDA1 (*(__IO uint32_t*)0x400780A4U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 1) */ - #define REG_XDMAC_CNDA1 (*(__IO uint32_t*)0x400780A8U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 1) */ - #define REG_XDMAC_CNDC1 (*(__IO uint32_t*)0x400780ACU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 1) */ - #define REG_XDMAC_CUBC1 (*(__IO uint32_t*)0x400780B0U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 1) */ - #define REG_XDMAC_CBC1 (*(__IO uint32_t*)0x400780B4U) /**< \brief (XDMAC) Channel Block Control Register (chid = 1) */ - #define REG_XDMAC_CC1 (*(__IO uint32_t*)0x400780B8U) /**< \brief (XDMAC) Channel Configuration Register (chid = 1) */ - #define REG_XDMAC_CDS_MSP1 (*(__IO uint32_t*)0x400780BCU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 1) */ - #define REG_XDMAC_CSUS1 (*(__IO uint32_t*)0x400780C0U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 1) */ - #define REG_XDMAC_CDUS1 (*(__IO uint32_t*)0x400780C4U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 1) */ - #define REG_XDMAC_CIE2 (*(__O uint32_t*)0x400780D0U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 2) */ - #define REG_XDMAC_CID2 (*(__O uint32_t*)0x400780D4U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 2) */ - #define REG_XDMAC_CIM2 (*(__O uint32_t*)0x400780D8U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 2) */ - #define REG_XDMAC_CIS2 (*(__I uint32_t*)0x400780DCU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 2) */ - #define REG_XDMAC_CSA2 (*(__IO uint32_t*)0x400780E0U) /**< \brief (XDMAC) Channel Source Address Register (chid = 2) */ - #define REG_XDMAC_CDA2 (*(__IO uint32_t*)0x400780E4U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 2) */ - #define REG_XDMAC_CNDA2 (*(__IO uint32_t*)0x400780E8U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 2) */ - #define REG_XDMAC_CNDC2 (*(__IO uint32_t*)0x400780ECU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 2) */ - #define REG_XDMAC_CUBC2 (*(__IO uint32_t*)0x400780F0U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 2) */ - #define REG_XDMAC_CBC2 (*(__IO uint32_t*)0x400780F4U) /**< \brief (XDMAC) Channel Block Control Register (chid = 2) */ - #define REG_XDMAC_CC2 (*(__IO uint32_t*)0x400780F8U) /**< \brief (XDMAC) Channel Configuration Register (chid = 2) */ - #define REG_XDMAC_CDS_MSP2 (*(__IO uint32_t*)0x400780FCU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 2) */ - #define REG_XDMAC_CSUS2 (*(__IO uint32_t*)0x40078100U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 2) */ - #define REG_XDMAC_CDUS2 (*(__IO uint32_t*)0x40078104U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 2) */ - #define REG_XDMAC_CIE3 (*(__O uint32_t*)0x40078110U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 3) */ - #define REG_XDMAC_CID3 (*(__O uint32_t*)0x40078114U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 3) */ - #define REG_XDMAC_CIM3 (*(__O uint32_t*)0x40078118U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 3) */ - #define REG_XDMAC_CIS3 (*(__I uint32_t*)0x4007811CU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 3) */ - #define REG_XDMAC_CSA3 (*(__IO uint32_t*)0x40078120U) /**< \brief (XDMAC) Channel Source Address Register (chid = 3) */ - #define REG_XDMAC_CDA3 (*(__IO uint32_t*)0x40078124U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 3) */ - #define REG_XDMAC_CNDA3 (*(__IO uint32_t*)0x40078128U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 3) */ - #define REG_XDMAC_CNDC3 (*(__IO uint32_t*)0x4007812CU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 3) */ - #define REG_XDMAC_CUBC3 (*(__IO uint32_t*)0x40078130U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 3) */ - #define REG_XDMAC_CBC3 (*(__IO uint32_t*)0x40078134U) /**< \brief (XDMAC) Channel Block Control Register (chid = 3) */ - #define REG_XDMAC_CC3 (*(__IO uint32_t*)0x40078138U) /**< \brief (XDMAC) Channel Configuration Register (chid = 3) */ - #define REG_XDMAC_CDS_MSP3 (*(__IO uint32_t*)0x4007813CU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 3) */ - #define REG_XDMAC_CSUS3 (*(__IO uint32_t*)0x40078140U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 3) */ - #define REG_XDMAC_CDUS3 (*(__IO uint32_t*)0x40078144U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 3) */ - #define REG_XDMAC_CIE4 (*(__O uint32_t*)0x40078150U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 4) */ - #define REG_XDMAC_CID4 (*(__O uint32_t*)0x40078154U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 4) */ - #define REG_XDMAC_CIM4 (*(__O uint32_t*)0x40078158U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 4) */ - #define REG_XDMAC_CIS4 (*(__I uint32_t*)0x4007815CU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 4) */ - #define REG_XDMAC_CSA4 (*(__IO uint32_t*)0x40078160U) /**< \brief (XDMAC) Channel Source Address Register (chid = 4) */ - #define REG_XDMAC_CDA4 (*(__IO uint32_t*)0x40078164U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 4) */ - #define REG_XDMAC_CNDA4 (*(__IO uint32_t*)0x40078168U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 4) */ - #define REG_XDMAC_CNDC4 (*(__IO uint32_t*)0x4007816CU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 4) */ - #define REG_XDMAC_CUBC4 (*(__IO uint32_t*)0x40078170U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 4) */ - #define REG_XDMAC_CBC4 (*(__IO uint32_t*)0x40078174U) /**< \brief (XDMAC) Channel Block Control Register (chid = 4) */ - #define REG_XDMAC_CC4 (*(__IO uint32_t*)0x40078178U) /**< \brief (XDMAC) Channel Configuration Register (chid = 4) */ - #define REG_XDMAC_CDS_MSP4 (*(__IO uint32_t*)0x4007817CU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 4) */ - #define REG_XDMAC_CSUS4 (*(__IO uint32_t*)0x40078180U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 4) */ - #define REG_XDMAC_CDUS4 (*(__IO uint32_t*)0x40078184U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 4) */ - #define REG_XDMAC_CIE5 (*(__O uint32_t*)0x40078190U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 5) */ - #define REG_XDMAC_CID5 (*(__O uint32_t*)0x40078194U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 5) */ - #define REG_XDMAC_CIM5 (*(__O uint32_t*)0x40078198U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 5) */ - #define REG_XDMAC_CIS5 (*(__I uint32_t*)0x4007819CU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 5) */ - #define REG_XDMAC_CSA5 (*(__IO uint32_t*)0x400781A0U) /**< \brief (XDMAC) Channel Source Address Register (chid = 5) */ - #define REG_XDMAC_CDA5 (*(__IO uint32_t*)0x400781A4U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 5) */ - #define REG_XDMAC_CNDA5 (*(__IO uint32_t*)0x400781A8U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 5) */ - #define REG_XDMAC_CNDC5 (*(__IO uint32_t*)0x400781ACU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 5) */ - #define REG_XDMAC_CUBC5 (*(__IO uint32_t*)0x400781B0U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 5) */ - #define REG_XDMAC_CBC5 (*(__IO uint32_t*)0x400781B4U) /**< \brief (XDMAC) Channel Block Control Register (chid = 5) */ - #define REG_XDMAC_CC5 (*(__IO uint32_t*)0x400781B8U) /**< \brief (XDMAC) Channel Configuration Register (chid = 5) */ - #define REG_XDMAC_CDS_MSP5 (*(__IO uint32_t*)0x400781BCU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 5) */ - #define REG_XDMAC_CSUS5 (*(__IO uint32_t*)0x400781C0U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 5) */ - #define REG_XDMAC_CDUS5 (*(__IO uint32_t*)0x400781C4U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 5) */ - #define REG_XDMAC_CIE6 (*(__O uint32_t*)0x400781D0U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 6) */ - #define REG_XDMAC_CID6 (*(__O uint32_t*)0x400781D4U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 6) */ - #define REG_XDMAC_CIM6 (*(__O uint32_t*)0x400781D8U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 6) */ - #define REG_XDMAC_CIS6 (*(__I uint32_t*)0x400781DCU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 6) */ - #define REG_XDMAC_CSA6 (*(__IO uint32_t*)0x400781E0U) /**< \brief (XDMAC) Channel Source Address Register (chid = 6) */ - #define REG_XDMAC_CDA6 (*(__IO uint32_t*)0x400781E4U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 6) */ - #define REG_XDMAC_CNDA6 (*(__IO uint32_t*)0x400781E8U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 6) */ - #define REG_XDMAC_CNDC6 (*(__IO uint32_t*)0x400781ECU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 6) */ - #define REG_XDMAC_CUBC6 (*(__IO uint32_t*)0x400781F0U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 6) */ - #define REG_XDMAC_CBC6 (*(__IO uint32_t*)0x400781F4U) /**< \brief (XDMAC) Channel Block Control Register (chid = 6) */ - #define REG_XDMAC_CC6 (*(__IO uint32_t*)0x400781F8U) /**< \brief (XDMAC) Channel Configuration Register (chid = 6) */ - #define REG_XDMAC_CDS_MSP6 (*(__IO uint32_t*)0x400781FCU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 6) */ - #define REG_XDMAC_CSUS6 (*(__IO uint32_t*)0x40078200U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 6) */ - #define REG_XDMAC_CDUS6 (*(__IO uint32_t*)0x40078204U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 6) */ - #define REG_XDMAC_CIE7 (*(__O uint32_t*)0x40078210U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 7) */ - #define REG_XDMAC_CID7 (*(__O uint32_t*)0x40078214U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 7) */ - #define REG_XDMAC_CIM7 (*(__O uint32_t*)0x40078218U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 7) */ - #define REG_XDMAC_CIS7 (*(__I uint32_t*)0x4007821CU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 7) */ - #define REG_XDMAC_CSA7 (*(__IO uint32_t*)0x40078220U) /**< \brief (XDMAC) Channel Source Address Register (chid = 7) */ - #define REG_XDMAC_CDA7 (*(__IO uint32_t*)0x40078224U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 7) */ - #define REG_XDMAC_CNDA7 (*(__IO uint32_t*)0x40078228U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 7) */ - #define REG_XDMAC_CNDC7 (*(__IO uint32_t*)0x4007822CU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 7) */ - #define REG_XDMAC_CUBC7 (*(__IO uint32_t*)0x40078230U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 7) */ - #define REG_XDMAC_CBC7 (*(__IO uint32_t*)0x40078234U) /**< \brief (XDMAC) Channel Block Control Register (chid = 7) */ - #define REG_XDMAC_CC7 (*(__IO uint32_t*)0x40078238U) /**< \brief (XDMAC) Channel Configuration Register (chid = 7) */ - #define REG_XDMAC_CDS_MSP7 (*(__IO uint32_t*)0x4007823CU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 7) */ - #define REG_XDMAC_CSUS7 (*(__IO uint32_t*)0x40078240U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 7) */ - #define REG_XDMAC_CDUS7 (*(__IO uint32_t*)0x40078244U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 7) */ - #define REG_XDMAC_CIE8 (*(__O uint32_t*)0x40078250U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 8) */ - #define REG_XDMAC_CID8 (*(__O uint32_t*)0x40078254U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 8) */ - #define REG_XDMAC_CIM8 (*(__O uint32_t*)0x40078258U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 8) */ - #define REG_XDMAC_CIS8 (*(__I uint32_t*)0x4007825CU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 8) */ - #define REG_XDMAC_CSA8 (*(__IO uint32_t*)0x40078260U) /**< \brief (XDMAC) Channel Source Address Register (chid = 8) */ - #define REG_XDMAC_CDA8 (*(__IO uint32_t*)0x40078264U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 8) */ - #define REG_XDMAC_CNDA8 (*(__IO uint32_t*)0x40078268U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 8) */ - #define REG_XDMAC_CNDC8 (*(__IO uint32_t*)0x4007826CU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 8) */ - #define REG_XDMAC_CUBC8 (*(__IO uint32_t*)0x40078270U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 8) */ - #define REG_XDMAC_CBC8 (*(__IO uint32_t*)0x40078274U) /**< \brief (XDMAC) Channel Block Control Register (chid = 8) */ - #define REG_XDMAC_CC8 (*(__IO uint32_t*)0x40078278U) /**< \brief (XDMAC) Channel Configuration Register (chid = 8) */ - #define REG_XDMAC_CDS_MSP8 (*(__IO uint32_t*)0x4007827CU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 8) */ - #define REG_XDMAC_CSUS8 (*(__IO uint32_t*)0x40078280U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 8) */ - #define REG_XDMAC_CDUS8 (*(__IO uint32_t*)0x40078284U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 8) */ - #define REG_XDMAC_CIE9 (*(__O uint32_t*)0x40078290U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 9) */ - #define REG_XDMAC_CID9 (*(__O uint32_t*)0x40078294U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 9) */ - #define REG_XDMAC_CIM9 (*(__O uint32_t*)0x40078298U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 9) */ - #define REG_XDMAC_CIS9 (*(__I uint32_t*)0x4007829CU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 9) */ - #define REG_XDMAC_CSA9 (*(__IO uint32_t*)0x400782A0U) /**< \brief (XDMAC) Channel Source Address Register (chid = 9) */ - #define REG_XDMAC_CDA9 (*(__IO uint32_t*)0x400782A4U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 9) */ - #define REG_XDMAC_CNDA9 (*(__IO uint32_t*)0x400782A8U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 9) */ - #define REG_XDMAC_CNDC9 (*(__IO uint32_t*)0x400782ACU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 9) */ - #define REG_XDMAC_CUBC9 (*(__IO uint32_t*)0x400782B0U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 9) */ - #define REG_XDMAC_CBC9 (*(__IO uint32_t*)0x400782B4U) /**< \brief (XDMAC) Channel Block Control Register (chid = 9) */ - #define REG_XDMAC_CC9 (*(__IO uint32_t*)0x400782B8U) /**< \brief (XDMAC) Channel Configuration Register (chid = 9) */ - #define REG_XDMAC_CDS_MSP9 (*(__IO uint32_t*)0x400782BCU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 9) */ - #define REG_XDMAC_CSUS9 (*(__IO uint32_t*)0x400782C0U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 9) */ - #define REG_XDMAC_CDUS9 (*(__IO uint32_t*)0x400782C4U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 9) */ - #define REG_XDMAC_CIE10 (*(__O uint32_t*)0x400782D0U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 10) */ - #define REG_XDMAC_CID10 (*(__O uint32_t*)0x400782D4U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 10) */ - #define REG_XDMAC_CIM10 (*(__O uint32_t*)0x400782D8U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 10) */ - #define REG_XDMAC_CIS10 (*(__I uint32_t*)0x400782DCU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 10) */ - #define REG_XDMAC_CSA10 (*(__IO uint32_t*)0x400782E0U) /**< \brief (XDMAC) Channel Source Address Register (chid = 10) */ - #define REG_XDMAC_CDA10 (*(__IO uint32_t*)0x400782E4U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 10) */ - #define REG_XDMAC_CNDA10 (*(__IO uint32_t*)0x400782E8U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 10) */ - #define REG_XDMAC_CNDC10 (*(__IO uint32_t*)0x400782ECU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 10) */ - #define REG_XDMAC_CUBC10 (*(__IO uint32_t*)0x400782F0U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 10) */ - #define REG_XDMAC_CBC10 (*(__IO uint32_t*)0x400782F4U) /**< \brief (XDMAC) Channel Block Control Register (chid = 10) */ - #define REG_XDMAC_CC10 (*(__IO uint32_t*)0x400782F8U) /**< \brief (XDMAC) Channel Configuration Register (chid = 10) */ - #define REG_XDMAC_CDS_MSP10 (*(__IO uint32_t*)0x400782FCU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 10) */ - #define REG_XDMAC_CSUS10 (*(__IO uint32_t*)0x40078300U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 10) */ - #define REG_XDMAC_CDUS10 (*(__IO uint32_t*)0x40078304U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 10) */ - #define REG_XDMAC_CIE11 (*(__O uint32_t*)0x40078310U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 11) */ - #define REG_XDMAC_CID11 (*(__O uint32_t*)0x40078314U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 11) */ - #define REG_XDMAC_CIM11 (*(__O uint32_t*)0x40078318U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 11) */ - #define REG_XDMAC_CIS11 (*(__I uint32_t*)0x4007831CU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 11) */ - #define REG_XDMAC_CSA11 (*(__IO uint32_t*)0x40078320U) /**< \brief (XDMAC) Channel Source Address Register (chid = 11) */ - #define REG_XDMAC_CDA11 (*(__IO uint32_t*)0x40078324U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 11) */ - #define REG_XDMAC_CNDA11 (*(__IO uint32_t*)0x40078328U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 11) */ - #define REG_XDMAC_CNDC11 (*(__IO uint32_t*)0x4007832CU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 11) */ - #define REG_XDMAC_CUBC11 (*(__IO uint32_t*)0x40078330U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 11) */ - #define REG_XDMAC_CBC11 (*(__IO uint32_t*)0x40078334U) /**< \brief (XDMAC) Channel Block Control Register (chid = 11) */ - #define REG_XDMAC_CC11 (*(__IO uint32_t*)0x40078338U) /**< \brief (XDMAC) Channel Configuration Register (chid = 11) */ - #define REG_XDMAC_CDS_MSP11 (*(__IO uint32_t*)0x4007833CU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 11) */ - #define REG_XDMAC_CSUS11 (*(__IO uint32_t*)0x40078340U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 11) */ - #define REG_XDMAC_CDUS11 (*(__IO uint32_t*)0x40078344U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 11) */ - #define REG_XDMAC_CIE12 (*(__O uint32_t*)0x40078350U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 12) */ - #define REG_XDMAC_CID12 (*(__O uint32_t*)0x40078354U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 12) */ - #define REG_XDMAC_CIM12 (*(__O uint32_t*)0x40078358U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 12) */ - #define REG_XDMAC_CIS12 (*(__I uint32_t*)0x4007835CU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 12) */ - #define REG_XDMAC_CSA12 (*(__IO uint32_t*)0x40078360U) /**< \brief (XDMAC) Channel Source Address Register (chid = 12) */ - #define REG_XDMAC_CDA12 (*(__IO uint32_t*)0x40078364U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 12) */ - #define REG_XDMAC_CNDA12 (*(__IO uint32_t*)0x40078368U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 12) */ - #define REG_XDMAC_CNDC12 (*(__IO uint32_t*)0x4007836CU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 12) */ - #define REG_XDMAC_CUBC12 (*(__IO uint32_t*)0x40078370U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 12) */ - #define REG_XDMAC_CBC12 (*(__IO uint32_t*)0x40078374U) /**< \brief (XDMAC) Channel Block Control Register (chid = 12) */ - #define REG_XDMAC_CC12 (*(__IO uint32_t*)0x40078378U) /**< \brief (XDMAC) Channel Configuration Register (chid = 12) */ - #define REG_XDMAC_CDS_MSP12 (*(__IO uint32_t*)0x4007837CU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 12) */ - #define REG_XDMAC_CSUS12 (*(__IO uint32_t*)0x40078380U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 12) */ - #define REG_XDMAC_CDUS12 (*(__IO uint32_t*)0x40078384U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 12) */ - #define REG_XDMAC_CIE13 (*(__O uint32_t*)0x40078390U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 13) */ - #define REG_XDMAC_CID13 (*(__O uint32_t*)0x40078394U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 13) */ - #define REG_XDMAC_CIM13 (*(__O uint32_t*)0x40078398U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 13) */ - #define REG_XDMAC_CIS13 (*(__I uint32_t*)0x4007839CU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 13) */ - #define REG_XDMAC_CSA13 (*(__IO uint32_t*)0x400783A0U) /**< \brief (XDMAC) Channel Source Address Register (chid = 13) */ - #define REG_XDMAC_CDA13 (*(__IO uint32_t*)0x400783A4U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 13) */ - #define REG_XDMAC_CNDA13 (*(__IO uint32_t*)0x400783A8U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 13) */ - #define REG_XDMAC_CNDC13 (*(__IO uint32_t*)0x400783ACU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 13) */ - #define REG_XDMAC_CUBC13 (*(__IO uint32_t*)0x400783B0U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 13) */ - #define REG_XDMAC_CBC13 (*(__IO uint32_t*)0x400783B4U) /**< \brief (XDMAC) Channel Block Control Register (chid = 13) */ - #define REG_XDMAC_CC13 (*(__IO uint32_t*)0x400783B8U) /**< \brief (XDMAC) Channel Configuration Register (chid = 13) */ - #define REG_XDMAC_CDS_MSP13 (*(__IO uint32_t*)0x400783BCU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 13) */ - #define REG_XDMAC_CSUS13 (*(__IO uint32_t*)0x400783C0U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 13) */ - #define REG_XDMAC_CDUS13 (*(__IO uint32_t*)0x400783C4U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 13) */ - #define REG_XDMAC_CIE14 (*(__O uint32_t*)0x400783D0U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 14) */ - #define REG_XDMAC_CID14 (*(__O uint32_t*)0x400783D4U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 14) */ - #define REG_XDMAC_CIM14 (*(__O uint32_t*)0x400783D8U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 14) */ - #define REG_XDMAC_CIS14 (*(__I uint32_t*)0x400783DCU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 14) */ - #define REG_XDMAC_CSA14 (*(__IO uint32_t*)0x400783E0U) /**< \brief (XDMAC) Channel Source Address Register (chid = 14) */ - #define REG_XDMAC_CDA14 (*(__IO uint32_t*)0x400783E4U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 14) */ - #define REG_XDMAC_CNDA14 (*(__IO uint32_t*)0x400783E8U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 14) */ - #define REG_XDMAC_CNDC14 (*(__IO uint32_t*)0x400783ECU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 14) */ - #define REG_XDMAC_CUBC14 (*(__IO uint32_t*)0x400783F0U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 14) */ - #define REG_XDMAC_CBC14 (*(__IO uint32_t*)0x400783F4U) /**< \brief (XDMAC) Channel Block Control Register (chid = 14) */ - #define REG_XDMAC_CC14 (*(__IO uint32_t*)0x400783F8U) /**< \brief (XDMAC) Channel Configuration Register (chid = 14) */ - #define REG_XDMAC_CDS_MSP14 (*(__IO uint32_t*)0x400783FCU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 14) */ - #define REG_XDMAC_CSUS14 (*(__IO uint32_t*)0x40078400U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 14) */ - #define REG_XDMAC_CDUS14 (*(__IO uint32_t*)0x40078404U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 14) */ - #define REG_XDMAC_CIE15 (*(__O uint32_t*)0x40078410U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 15) */ - #define REG_XDMAC_CID15 (*(__O uint32_t*)0x40078414U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 15) */ - #define REG_XDMAC_CIM15 (*(__O uint32_t*)0x40078418U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 15) */ - #define REG_XDMAC_CIS15 (*(__I uint32_t*)0x4007841CU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 15) */ - #define REG_XDMAC_CSA15 (*(__IO uint32_t*)0x40078420U) /**< \brief (XDMAC) Channel Source Address Register (chid = 15) */ - #define REG_XDMAC_CDA15 (*(__IO uint32_t*)0x40078424U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 15) */ - #define REG_XDMAC_CNDA15 (*(__IO uint32_t*)0x40078428U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 15) */ - #define REG_XDMAC_CNDC15 (*(__IO uint32_t*)0x4007842CU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 15) */ - #define REG_XDMAC_CUBC15 (*(__IO uint32_t*)0x40078430U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 15) */ - #define REG_XDMAC_CBC15 (*(__IO uint32_t*)0x40078434U) /**< \brief (XDMAC) Channel Block Control Register (chid = 15) */ - #define REG_XDMAC_CC15 (*(__IO uint32_t*)0x40078438U) /**< \brief (XDMAC) Channel Configuration Register (chid = 15) */ - #define REG_XDMAC_CDS_MSP15 (*(__IO uint32_t*)0x4007843CU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 15) */ - #define REG_XDMAC_CSUS15 (*(__IO uint32_t*)0x40078440U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 15) */ - #define REG_XDMAC_CDUS15 (*(__IO uint32_t*)0x40078444U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 15) */ - #define REG_XDMAC_CIE16 (*(__O uint32_t*)0x40078450U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 16) */ - #define REG_XDMAC_CID16 (*(__O uint32_t*)0x40078454U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 16) */ - #define REG_XDMAC_CIM16 (*(__O uint32_t*)0x40078458U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 16) */ - #define REG_XDMAC_CIS16 (*(__I uint32_t*)0x4007845CU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 16) */ - #define REG_XDMAC_CSA16 (*(__IO uint32_t*)0x40078460U) /**< \brief (XDMAC) Channel Source Address Register (chid = 16) */ - #define REG_XDMAC_CDA16 (*(__IO uint32_t*)0x40078464U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 16) */ - #define REG_XDMAC_CNDA16 (*(__IO uint32_t*)0x40078468U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 16) */ - #define REG_XDMAC_CNDC16 (*(__IO uint32_t*)0x4007846CU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 16) */ - #define REG_XDMAC_CUBC16 (*(__IO uint32_t*)0x40078470U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 16) */ - #define REG_XDMAC_CBC16 (*(__IO uint32_t*)0x40078474U) /**< \brief (XDMAC) Channel Block Control Register (chid = 16) */ - #define REG_XDMAC_CC16 (*(__IO uint32_t*)0x40078478U) /**< \brief (XDMAC) Channel Configuration Register (chid = 16) */ - #define REG_XDMAC_CDS_MSP16 (*(__IO uint32_t*)0x4007847CU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 16) */ - #define REG_XDMAC_CSUS16 (*(__IO uint32_t*)0x40078480U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 16) */ - #define REG_XDMAC_CDUS16 (*(__IO uint32_t*)0x40078484U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 16) */ - #define REG_XDMAC_CIE17 (*(__O uint32_t*)0x40078490U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 17) */ - #define REG_XDMAC_CID17 (*(__O uint32_t*)0x40078494U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 17) */ - #define REG_XDMAC_CIM17 (*(__O uint32_t*)0x40078498U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 17) */ - #define REG_XDMAC_CIS17 (*(__I uint32_t*)0x4007849CU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 17) */ - #define REG_XDMAC_CSA17 (*(__IO uint32_t*)0x400784A0U) /**< \brief (XDMAC) Channel Source Address Register (chid = 17) */ - #define REG_XDMAC_CDA17 (*(__IO uint32_t*)0x400784A4U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 17) */ - #define REG_XDMAC_CNDA17 (*(__IO uint32_t*)0x400784A8U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 17) */ - #define REG_XDMAC_CNDC17 (*(__IO uint32_t*)0x400784ACU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 17) */ - #define REG_XDMAC_CUBC17 (*(__IO uint32_t*)0x400784B0U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 17) */ - #define REG_XDMAC_CBC17 (*(__IO uint32_t*)0x400784B4U) /**< \brief (XDMAC) Channel Block Control Register (chid = 17) */ - #define REG_XDMAC_CC17 (*(__IO uint32_t*)0x400784B8U) /**< \brief (XDMAC) Channel Configuration Register (chid = 17) */ - #define REG_XDMAC_CDS_MSP17 (*(__IO uint32_t*)0x400784BCU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 17) */ - #define REG_XDMAC_CSUS17 (*(__IO uint32_t*)0x400784C0U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 17) */ - #define REG_XDMAC_CDUS17 (*(__IO uint32_t*)0x400784C4U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 17) */ - #define REG_XDMAC_CIE18 (*(__O uint32_t*)0x400784D0U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 18) */ - #define REG_XDMAC_CID18 (*(__O uint32_t*)0x400784D4U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 18) */ - #define REG_XDMAC_CIM18 (*(__O uint32_t*)0x400784D8U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 18) */ - #define REG_XDMAC_CIS18 (*(__I uint32_t*)0x400784DCU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 18) */ - #define REG_XDMAC_CSA18 (*(__IO uint32_t*)0x400784E0U) /**< \brief (XDMAC) Channel Source Address Register (chid = 18) */ - #define REG_XDMAC_CDA18 (*(__IO uint32_t*)0x400784E4U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 18) */ - #define REG_XDMAC_CNDA18 (*(__IO uint32_t*)0x400784E8U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 18) */ - #define REG_XDMAC_CNDC18 (*(__IO uint32_t*)0x400784ECU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 18) */ - #define REG_XDMAC_CUBC18 (*(__IO uint32_t*)0x400784F0U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 18) */ - #define REG_XDMAC_CBC18 (*(__IO uint32_t*)0x400784F4U) /**< \brief (XDMAC) Channel Block Control Register (chid = 18) */ - #define REG_XDMAC_CC18 (*(__IO uint32_t*)0x400784F8U) /**< \brief (XDMAC) Channel Configuration Register (chid = 18) */ - #define REG_XDMAC_CDS_MSP18 (*(__IO uint32_t*)0x400784FCU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 18) */ - #define REG_XDMAC_CSUS18 (*(__IO uint32_t*)0x40078500U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 18) */ - #define REG_XDMAC_CDUS18 (*(__IO uint32_t*)0x40078504U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 18) */ - #define REG_XDMAC_CIE19 (*(__O uint32_t*)0x40078510U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 19) */ - #define REG_XDMAC_CID19 (*(__O uint32_t*)0x40078514U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 19) */ - #define REG_XDMAC_CIM19 (*(__O uint32_t*)0x40078518U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 19) */ - #define REG_XDMAC_CIS19 (*(__I uint32_t*)0x4007851CU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 19) */ - #define REG_XDMAC_CSA19 (*(__IO uint32_t*)0x40078520U) /**< \brief (XDMAC) Channel Source Address Register (chid = 19) */ - #define REG_XDMAC_CDA19 (*(__IO uint32_t*)0x40078524U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 19) */ - #define REG_XDMAC_CNDA19 (*(__IO uint32_t*)0x40078528U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 19) */ - #define REG_XDMAC_CNDC19 (*(__IO uint32_t*)0x4007852CU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 19) */ - #define REG_XDMAC_CUBC19 (*(__IO uint32_t*)0x40078530U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 19) */ - #define REG_XDMAC_CBC19 (*(__IO uint32_t*)0x40078534U) /**< \brief (XDMAC) Channel Block Control Register (chid = 19) */ - #define REG_XDMAC_CC19 (*(__IO uint32_t*)0x40078538U) /**< \brief (XDMAC) Channel Configuration Register (chid = 19) */ - #define REG_XDMAC_CDS_MSP19 (*(__IO uint32_t*)0x4007853CU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 19) */ - #define REG_XDMAC_CSUS19 (*(__IO uint32_t*)0x40078540U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 19) */ - #define REG_XDMAC_CDUS19 (*(__IO uint32_t*)0x40078544U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 19) */ - #define REG_XDMAC_CIE20 (*(__O uint32_t*)0x40078550U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 20) */ - #define REG_XDMAC_CID20 (*(__O uint32_t*)0x40078554U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 20) */ - #define REG_XDMAC_CIM20 (*(__O uint32_t*)0x40078558U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 20) */ - #define REG_XDMAC_CIS20 (*(__I uint32_t*)0x4007855CU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 20) */ - #define REG_XDMAC_CSA20 (*(__IO uint32_t*)0x40078560U) /**< \brief (XDMAC) Channel Source Address Register (chid = 20) */ - #define REG_XDMAC_CDA20 (*(__IO uint32_t*)0x40078564U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 20) */ - #define REG_XDMAC_CNDA20 (*(__IO uint32_t*)0x40078568U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 20) */ - #define REG_XDMAC_CNDC20 (*(__IO uint32_t*)0x4007856CU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 20) */ - #define REG_XDMAC_CUBC20 (*(__IO uint32_t*)0x40078570U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 20) */ - #define REG_XDMAC_CBC20 (*(__IO uint32_t*)0x40078574U) /**< \brief (XDMAC) Channel Block Control Register (chid = 20) */ - #define REG_XDMAC_CC20 (*(__IO uint32_t*)0x40078578U) /**< \brief (XDMAC) Channel Configuration Register (chid = 20) */ - #define REG_XDMAC_CDS_MSP20 (*(__IO uint32_t*)0x4007857CU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 20) */ - #define REG_XDMAC_CSUS20 (*(__IO uint32_t*)0x40078580U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 20) */ - #define REG_XDMAC_CDUS20 (*(__IO uint32_t*)0x40078584U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 20) */ - #define REG_XDMAC_CIE21 (*(__O uint32_t*)0x40078590U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 21) */ - #define REG_XDMAC_CID21 (*(__O uint32_t*)0x40078594U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 21) */ - #define REG_XDMAC_CIM21 (*(__O uint32_t*)0x40078598U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 21) */ - #define REG_XDMAC_CIS21 (*(__I uint32_t*)0x4007859CU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 21) */ - #define REG_XDMAC_CSA21 (*(__IO uint32_t*)0x400785A0U) /**< \brief (XDMAC) Channel Source Address Register (chid = 21) */ - #define REG_XDMAC_CDA21 (*(__IO uint32_t*)0x400785A4U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 21) */ - #define REG_XDMAC_CNDA21 (*(__IO uint32_t*)0x400785A8U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 21) */ - #define REG_XDMAC_CNDC21 (*(__IO uint32_t*)0x400785ACU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 21) */ - #define REG_XDMAC_CUBC21 (*(__IO uint32_t*)0x400785B0U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 21) */ - #define REG_XDMAC_CBC21 (*(__IO uint32_t*)0x400785B4U) /**< \brief (XDMAC) Channel Block Control Register (chid = 21) */ - #define REG_XDMAC_CC21 (*(__IO uint32_t*)0x400785B8U) /**< \brief (XDMAC) Channel Configuration Register (chid = 21) */ - #define REG_XDMAC_CDS_MSP21 (*(__IO uint32_t*)0x400785BCU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 21) */ - #define REG_XDMAC_CSUS21 (*(__IO uint32_t*)0x400785C0U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 21) */ - #define REG_XDMAC_CDUS21 (*(__IO uint32_t*)0x400785C4U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 21) */ - #define REG_XDMAC_CIE22 (*(__O uint32_t*)0x400785D0U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 22) */ - #define REG_XDMAC_CID22 (*(__O uint32_t*)0x400785D4U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 22) */ - #define REG_XDMAC_CIM22 (*(__O uint32_t*)0x400785D8U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 22) */ - #define REG_XDMAC_CIS22 (*(__I uint32_t*)0x400785DCU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 22) */ - #define REG_XDMAC_CSA22 (*(__IO uint32_t*)0x400785E0U) /**< \brief (XDMAC) Channel Source Address Register (chid = 22) */ - #define REG_XDMAC_CDA22 (*(__IO uint32_t*)0x400785E4U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 22) */ - #define REG_XDMAC_CNDA22 (*(__IO uint32_t*)0x400785E8U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 22) */ - #define REG_XDMAC_CNDC22 (*(__IO uint32_t*)0x400785ECU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 22) */ - #define REG_XDMAC_CUBC22 (*(__IO uint32_t*)0x400785F0U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 22) */ - #define REG_XDMAC_CBC22 (*(__IO uint32_t*)0x400785F4U) /**< \brief (XDMAC) Channel Block Control Register (chid = 22) */ - #define REG_XDMAC_CC22 (*(__IO uint32_t*)0x400785F8U) /**< \brief (XDMAC) Channel Configuration Register (chid = 22) */ - #define REG_XDMAC_CDS_MSP22 (*(__IO uint32_t*)0x400785FCU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 22) */ - #define REG_XDMAC_CSUS22 (*(__IO uint32_t*)0x40078600U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 22) */ - #define REG_XDMAC_CDUS22 (*(__IO uint32_t*)0x40078604U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 22) */ - #define REG_XDMAC_CIE23 (*(__O uint32_t*)0x40078610U) /**< \brief (XDMAC) Channel Interrupt Enable Register (chid = 23) */ - #define REG_XDMAC_CID23 (*(__O uint32_t*)0x40078614U) /**< \brief (XDMAC) Channel Interrupt Disable Register (chid = 23) */ - #define REG_XDMAC_CIM23 (*(__O uint32_t*)0x40078618U) /**< \brief (XDMAC) Channel Interrupt Mask Register (chid = 23) */ - #define REG_XDMAC_CIS23 (*(__I uint32_t*)0x4007861CU) /**< \brief (XDMAC) Channel Interrupt Status Register (chid = 23) */ - #define REG_XDMAC_CSA23 (*(__IO uint32_t*)0x40078620U) /**< \brief (XDMAC) Channel Source Address Register (chid = 23) */ - #define REG_XDMAC_CDA23 (*(__IO uint32_t*)0x40078624U) /**< \brief (XDMAC) Channel Destination Address Register (chid = 23) */ - #define REG_XDMAC_CNDA23 (*(__IO uint32_t*)0x40078628U) /**< \brief (XDMAC) Channel Next Descriptor Address Register (chid = 23) */ - #define REG_XDMAC_CNDC23 (*(__IO uint32_t*)0x4007862CU) /**< \brief (XDMAC) Channel Next Descriptor Control Register (chid = 23) */ - #define REG_XDMAC_CUBC23 (*(__IO uint32_t*)0x40078630U) /**< \brief (XDMAC) Channel Microblock Control Register (chid = 23) */ - #define REG_XDMAC_CBC23 (*(__IO uint32_t*)0x40078634U) /**< \brief (XDMAC) Channel Block Control Register (chid = 23) */ - #define REG_XDMAC_CC23 (*(__IO uint32_t*)0x40078638U) /**< \brief (XDMAC) Channel Configuration Register (chid = 23) */ - #define REG_XDMAC_CDS_MSP23 (*(__IO uint32_t*)0x4007863CU) /**< \brief (XDMAC) Channel Data Stride Memory Set Pattern (chid = 23) */ - #define REG_XDMAC_CSUS23 (*(__IO uint32_t*)0x40078640U) /**< \brief (XDMAC) Channel Source Microblock Stride (chid = 23) */ - #define REG_XDMAC_CDUS23 (*(__IO uint32_t*)0x40078644U) /**< \brief (XDMAC) Channel Destination Microblock Stride (chid = 23) */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ - -#endif /* _SAMV71_XDMAC_INSTANCE_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/pio/pio_samv71j19.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/pio/pio_samv71j19.h deleted file mode 100644 index 4fba181e..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/pio/pio_samv71j19.h +++ /dev/null @@ -1,438 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71J19_PIO_ -#define _SAMV71J19_PIO_ - -#define PIO_PA3 (1u << 3) /**< \brief Pin Controlled by PA3 */ -#define PIO_PA4 (1u << 4) /**< \brief Pin Controlled by PA4 */ -#define PIO_PA5 (1u << 5) /**< \brief Pin Controlled by PA5 */ -#define PIO_PA7 (1u << 7) /**< \brief Pin Controlled by PA7 */ -#define PIO_PA8 (1u << 8) /**< \brief Pin Controlled by PA8 */ -#define PIO_PA9 (1u << 9) /**< \brief Pin Controlled by PA9 */ -#define PIO_PA10 (1u << 10) /**< \brief Pin Controlled by PA10 */ -#define PIO_PA11 (1u << 11) /**< \brief Pin Controlled by PA11 */ -#define PIO_PA12 (1u << 12) /**< \brief Pin Controlled by PA12 */ -#define PIO_PA13 (1u << 13) /**< \brief Pin Controlled by PA13 */ -#define PIO_PA14 (1u << 14) /**< \brief Pin Controlled by PA14 */ -#define PIO_PA21 (1u << 21) /**< \brief Pin Controlled by PA21 */ -#define PIO_PA22 (1u << 22) /**< \brief Pin Controlled by PA22 */ -#define PIO_PA24 (1u << 24) /**< \brief Pin Controlled by PA24 */ -#define PIO_PA27 (1u << 27) /**< \brief Pin Controlled by PA27 */ -#define PIO_PB0 (1u << 0) /**< \brief Pin Controlled by PB0 */ -#define PIO_PB1 (1u << 1) /**< \brief Pin Controlled by PB1 */ -#define PIO_PB2 (1u << 2) /**< \brief Pin Controlled by PB2 */ -#define PIO_PB3 (1u << 3) /**< \brief Pin Controlled by PB3 */ -#define PIO_PB4 (1u << 4) /**< \brief Pin Controlled by PB4 */ -#define PIO_PB5 (1u << 5) /**< \brief Pin Controlled by PB5 */ -#define PIO_PB6 (1u << 6) /**< \brief Pin Controlled by PB6 */ -#define PIO_PB7 (1u << 7) /**< \brief Pin Controlled by PB7 */ -#define PIO_PB8 (1u << 8) /**< \brief Pin Controlled by PB8 */ -#define PIO_PB9 (1u << 9) /**< \brief Pin Controlled by PB9 */ -#define PIO_PB12 (1u << 12) /**< \brief Pin Controlled by PB12 */ -#define PIO_PD0 (1u << 0) /**< \brief Pin Controlled by PD0 */ -#define PIO_PD1 (1u << 1) /**< \brief Pin Controlled by PD1 */ -#define PIO_PD2 (1u << 2) /**< \brief Pin Controlled by PD2 */ -#define PIO_PD3 (1u << 3) /**< \brief Pin Controlled by PD3 */ -#define PIO_PD4 (1u << 4) /**< \brief Pin Controlled by PD4 */ -#define PIO_PD5 (1u << 5) /**< \brief Pin Controlled by PD5 */ -#define PIO_PD6 (1u << 6) /**< \brief Pin Controlled by PD6 */ -#define PIO_PD7 (1u << 7) /**< \brief Pin Controlled by PD7 */ -#define PIO_PD8 (1u << 8) /**< \brief Pin Controlled by PD8 */ -#define PIO_PD9 (1u << 9) /**< \brief Pin Controlled by PD9 */ -#define PIO_PD10 (1u << 10) /**< \brief Pin Controlled by PD10 */ -#define PIO_PD11 (1u << 11) /**< \brief Pin Controlled by PD11 */ -#define PIO_PD12 (1u << 12) /**< \brief Pin Controlled by PD12 */ -#define PIO_PD21 (1u << 21) /**< \brief Pin Controlled by PD21 */ -#define PIO_PD22 (1u << 22) /**< \brief Pin Controlled by PD22 */ -#define PIO_PD24 (1u << 24) /**< \brief Pin Controlled by PD24 */ -#define PIO_PD25 (1u << 25) /**< \brief Pin Controlled by PD25 */ -#define PIO_PD26 (1u << 26) /**< \brief Pin Controlled by PD26 */ -#define PIO_PD31 (1u << 31) /**< \brief Pin Controlled by PD31 */ -/* ========== Pio definition for AFEC0 peripheral ========== */ -#define PIO_PD30X1_AFE0_AD0 (1u << 30) /**< \brief Afec0 signal: AFE0_AD0 */ -#define PIO_PA21X1_AFE0_AD1 (1u << 21) /**< \brief Afec0 signal: AFE0_AD1/PIODCEN2 */ -#define PIO_PA21X1_PIODCEN2 (1u << 21) /**< \brief Afec0 signal: AFE0_AD1/PIODCEN2 */ -#define PIO_PB0X1_AFE0_AD10 (1u << 0) /**< \brief Afec0 signal: AFE0_AD10/RTCOUT0 */ -#define PIO_PB0X1_RTCOUT0 (1u << 0) /**< \brief Afec0 signal: AFE0_AD10/RTCOUT0 */ -#define PIO_PB3X1_AFE0_AD2 (1u << 3) /**< \brief Afec0 signal: AFE0_AD2/WKUP12 */ -#define PIO_PB3X1_WKUP12 (1u << 3) /**< \brief Afec0 signal: AFE0_AD2/WKUP12 */ -#define PIO_PE5X1_AFE0_AD3 (1u << 5) /**< \brief Afec0 signal: AFE0_AD3 */ -#define PIO_PE4X1_AFE0_AD4 (1u << 4) /**< \brief Afec0 signal: AFE0_AD4 */ -#define PIO_PB2X1_AFE0_AD5 (1u << 2) /**< \brief Afec0 signal: AFE0_AD5 */ -#define PIO_PA17X1_AFE0_AD6 (1u << 17) /**< \brief Afec0 signal: AFE0_AD6 */ -#define PIO_PA18X1_AFE0_AD7 (1u << 18) /**< \brief Afec0 signal: AFE0_AD7 */ -#define PIO_PA19X1_AFE0_AD8 (1u << 19) /**< \brief Afec0 signal: AFE0_AD8/WKUP9 */ -#define PIO_PA19X1_WKUP9 (1u << 19) /**< \brief Afec0 signal: AFE0_AD8/WKUP9 */ -#define PIO_PA20X1_AFE0_AD9 (1u << 20) /**< \brief Afec0 signal: AFE0_AD9/WKUP10 */ -#define PIO_PA20X1_WKUP10 (1u << 20) /**< \brief Afec0 signal: AFE0_AD9/WKUP10 */ -#define PIO_PA8B_AFE0_ADTRG (1u << 8) /**< \brief Afec0 signal: AFE0_ADTRG */ -/* ========== Pio definition for AFEC1 peripheral ========== */ -#define PIO_PB1X1_AFE1_AD0 (1u << 1) /**< \brief Afec1 signal: AFE1_AD0/RTCOUT1 */ -#define PIO_PB1X1_RTCOUT1 (1u << 1) /**< \brief Afec1 signal: AFE1_AD0/RTCOUT1 */ -#define PIO_PC13X1_AFE1_AD1 (1u << 13) /**< \brief Afec1 signal: AFE1_AD1 */ -#define PIO_PE3X1_AFE1_AD10 (1u << 3) /**< \brief Afec1 signal: AFE1_AD10 */ -#define PIO_PE0X1_AFE1_AD11 (1u << 0) /**< \brief Afec1 signal: AFE1_AD11 */ -#define PIO_PC15X1_AFE1_AD2 (1u << 15) /**< \brief Afec1 signal: AFE1_AD2 */ -#define PIO_PC12X1_AFE1_AD3 (1u << 12) /**< \brief Afec1 signal: AFE1_AD3 */ -#define PIO_PC29X1_AFE1_AD4 (1u << 29) /**< \brief Afec1 signal: AFE1_AD4 */ -#define PIO_PC30X1_AFE1_AD5 (1u << 30) /**< \brief Afec1 signal: AFE1_AD5 */ -#define PIO_PC31X1_AFE1_AD6 (1u << 31) /**< \brief Afec1 signal: AFE1_AD6 */ -#define PIO_PC26X1_AFE1_AD7 (1u << 26) /**< \brief Afec1 signal: AFE1_AD7 */ -#define PIO_PC27X1_AFE1_AD8 (1u << 27) /**< \brief Afec1 signal: AFE1_AD8 */ -#define PIO_PC0X1_AFE1_AD9 (1u << 0) /**< \brief Afec1 signal: AFE1_AD9 */ -#define PIO_PD9C_AFE1_ADTRG (1u << 9) /**< \brief Afec1 signal: AFE1_ADTRG */ -/* ========== Pio definition for ARM peripheral ========== */ -#define PIO_PB7X1_SWCLK (1u << 7) /**< \brief Arm signal: SWCLK/TCK */ -#define PIO_PB7X1_TCK (1u << 7) /**< \brief Arm signal: SWCLK/TCK */ -#define PIO_PB6X1_SWDIO (1u << 6) /**< \brief Arm signal: SWDIO/TMS */ -#define PIO_PB6X1_TMS (1u << 6) /**< \brief Arm signal: SWDIO/TMS */ -#define PIO_PB4X1_TDI (1u << 4) /**< \brief Arm signal: TDI */ -#define PIO_PB5X1_TDO (1u << 5) /**< \brief Arm signal: TDO/TRACESWO/WKUP13 */ -#define PIO_PB5X1_TRACESWO (1u << 5) /**< \brief Arm signal: TDO/TRACESWO/WKUP13 */ -#define PIO_PB5X1_WKUP13 (1u << 5) /**< \brief Arm signal: TDO/TRACESWO/WKUP13 */ -/* ========== Pio definition for GMAC peripheral ========== */ -#define PIO_PD13A_GCOL (1u << 13) /**< \brief Gmac signal: GCOL */ -#define PIO_PD10A_GCRS (1u << 10) /**< \brief Gmac signal: GCRS */ -#define PIO_PD8A_GMDC (1u << 8) /**< \brief Gmac signal: GMDC */ -#define PIO_PD9A_GMDIO (1u << 9) /**< \brief Gmac signal: GMDIO */ -#define PIO_PD5A_GRX0 (1u << 5) /**< \brief Gmac signal: GRX0 */ -#define PIO_PD6A_GRX1 (1u << 6) /**< \brief Gmac signal: GRX1 */ -#define PIO_PD11A_GRX2 (1u << 11) /**< \brief Gmac signal: GRX2 */ -#define PIO_PD12A_GRX3 (1u << 12) /**< \brief Gmac signal: GRX3 */ -#define PIO_PD14A_GRXCK (1u << 14) /**< \brief Gmac signal: GRXCK */ -#define PIO_PD4A_GRXDV (1u << 4) /**< \brief Gmac signal: GRXDV */ -#define PIO_PD7A_GRXER (1u << 7) /**< \brief Gmac signal: GRXER */ -#define PIO_PB1B_GTSUCOMP (1u << 1) /**< \brief Gmac signal: GTSUCOMP */ -#define PIO_PB12B_GTSUCOMP (1u << 12) /**< \brief Gmac signal: GTSUCOMP */ -#define PIO_PD11C_GTSUCOMP (1u << 11) /**< \brief Gmac signal: GTSUCOMP */ -#define PIO_PD20C_GTSUCOMP (1u << 20) /**< \brief Gmac signal: GTSUCOMP */ -#define PIO_PD2A_GTX0 (1u << 2) /**< \brief Gmac signal: GTX0 */ -#define PIO_PD3A_GTX1 (1u << 3) /**< \brief Gmac signal: GTX1 */ -#define PIO_PD15A_GTX2 (1u << 15) /**< \brief Gmac signal: GTX2 */ -#define PIO_PD16A_GTX3 (1u << 16) /**< \brief Gmac signal: GTX3 */ -#define PIO_PD0A_GTXCK (1u << 0) /**< \brief Gmac signal: GTXCK */ -#define PIO_PD1A_GTXEN (1u << 1) /**< \brief Gmac signal: GTXEN */ -#define PIO_PD17A_GTXER (1u << 17) /**< \brief Gmac signal: GTXER */ -/* ========== Pio definition for HSMCI peripheral ========== */ -#define PIO_PA28C_MCCDA (1u << 28) /**< \brief Hsmci signal: MCCDA */ -#define PIO_PA25D_MCCK (1u << 25) /**< \brief Hsmci signal: MCCK */ -#define PIO_PA30C_MCDA0 (1u << 30) /**< \brief Hsmci signal: MCDA0 */ -#define PIO_PA31C_MCDA1 (1u << 31) /**< \brief Hsmci signal: MCDA1 */ -#define PIO_PA26C_MCDA2 (1u << 26) /**< \brief Hsmci signal: MCDA2 */ -#define PIO_PA27C_MCDA3 (1u << 27) /**< \brief Hsmci signal: MCDA3 */ -/* ========== Pio definition for ISI peripheral ========== */ -#define PIO_PD22D_ISI_D0 (1u << 22) /**< \brief Isi signal: ISI_D0 */ -#define PIO_PD21D_ISI_D1 (1u << 21) /**< \brief Isi signal: ISI_D1 */ -#define PIO_PD30D_ISI_D10 (1u << 30) /**< \brief Isi signal: ISI_D10 */ -#define PIO_PD31D_ISI_D11 (1u << 31) /**< \brief Isi signal: ISI_D11 */ -#define PIO_PB3D_ISI_D2 (1u << 3) /**< \brief Isi signal: ISI_D2 */ -#define PIO_PA9B_ISI_D3 (1u << 9) /**< \brief Isi signal: ISI_D3 */ -#define PIO_PA5B_ISI_D4 (1u << 5) /**< \brief Isi signal: ISI_D4 */ -#define PIO_PD11D_ISI_D5 (1u << 11) /**< \brief Isi signal: ISI_D5 */ -#define PIO_PD12D_ISI_D6 (1u << 12) /**< \brief Isi signal: ISI_D6 */ -#define PIO_PA27D_ISI_D7 (1u << 27) /**< \brief Isi signal: ISI_D7 */ -#define PIO_PD27D_ISI_D8 (1u << 27) /**< \brief Isi signal: ISI_D8 */ -#define PIO_PD28D_ISI_D9 (1u << 28) /**< \brief Isi signal: ISI_D9 */ -#define PIO_PD24D_ISI_HSYNC (1u << 24) /**< \brief Isi signal: ISI_HSYNC */ -#define PIO_PA24D_ISI_PCK (1u << 24) /**< \brief Isi signal: ISI_PCK */ -#define PIO_PD25D_ISI_VSYNC (1u << 25) /**< \brief Isi signal: ISI_VSYNC */ -/* ========== Pio definition for MCAN0 peripheral ========== */ -#define PIO_PB3A_CANRX0 (1u << 3) /**< \brief Mcan0 signal: CANRX0 */ -#define PIO_PB2A_CANTX0 (1u << 2) /**< \brief Mcan0 signal: CANTX0 */ -/* ========== Pio definition for MCAN1 peripheral ========== */ -#define PIO_PC12C_CANRX1 (1u << 12) /**< \brief Mcan1 signal: CANRX1 */ -#define PIO_PD28B_CANRX1 (1u << 28) /**< \brief Mcan1 signal: CANRX1 */ -#define PIO_PC14C_CANTX1 (1u << 14) /**< \brief Mcan1 signal: CANTX1 */ -#define PIO_PD12B_CANTX1 (1u << 12) /**< \brief Mcan1 signal: CANTX1 */ -/* ========== Pio definition for MLB peripheral ========== */ -#define PIO_PB4C_MLBCLK (1u << 4) /**< \brief Mlb signal: MLBCLK */ -#define PIO_PB5C_MLBDAT (1u << 5) /**< \brief Mlb signal: MLBDAT */ -#define PIO_PD10D_MLBSIG (1u << 10) /**< \brief Mlb signal: MLBSIG */ -/* ========== Pio definition for PIOA peripheral ========== */ -#define PIO_PA21X1_AFE0_AD1 (1u << 21) /**< \brief Pioa signal: AFE0_AD1/PIODCEN2 */ -#define PIO_PA21X1_PIODCEN2 (1u << 21) /**< \brief Pioa signal: AFE0_AD1/PIODCEN2 */ -#define PIO_PA3X1_PIODC0 (1u << 3) /**< \brief Pioa signal: PIODC0 */ -#define PIO_PA10X1_PIODC4 (1u << 10) /**< \brief Pioa signal: PIODC4 */ -#define PIO_PA12X1_PIODC6 (1u << 12) /**< \brief Pioa signal: PIODC6 */ -#define PIO_PA13X1_PIODC7 (1u << 13) /**< \brief Pioa signal: PIODC7 */ -#define PIO_PA22X1_PIODCCLK (1u << 22) /**< \brief Pioa signal: PIODCCLK */ -#define PIO_PA4X1_WKUP3 (1u << 4) /**< \brief Pioa signal: WKUP3/PIODC1 */ -#define PIO_PA4X1_PIODC1 (1u << 4) /**< \brief Pioa signal: WKUP3/PIODC1 */ -#define PIO_PA5X1_WKUP4 (1u << 5) /**< \brief Pioa signal: WKUP4/PIODC2 */ -#define PIO_PA5X1_PIODC2 (1u << 5) /**< \brief Pioa signal: WKUP4/PIODC2 */ -#define PIO_PA9X1_WKUP6 (1u << 9) /**< \brief Pioa signal: WKUP6/PIODC3 */ -#define PIO_PA9X1_PIODC3 (1u << 9) /**< \brief Pioa signal: WKUP6/PIODC3 */ -#define PIO_PA11X1_WKUP7 (1u << 11) /**< \brief Pioa signal: WKUP7/PIODC5 */ -#define PIO_PA11X1_PIODC5 (1u << 11) /**< \brief Pioa signal: WKUP7/PIODC5 */ -#define PIO_PA14X1_WKUP8 (1u << 14) /**< \brief Pioa signal: WKUP8/PIODCEN1 */ -#define PIO_PA14X1_PIODCEN1 (1u << 14) /**< \brief Pioa signal: WKUP8/PIODCEN1 */ -/* ========== Pio definition for PMC peripheral ========== */ -#define PIO_PA6B_PCK0 (1u << 6) /**< \brief Pmc signal: PCK0 */ -#define PIO_PB12D_PCK0 (1u << 12) /**< \brief Pmc signal: PCK0 */ -#define PIO_PB13B_PCK0 (1u << 13) /**< \brief Pmc signal: PCK0 */ -#define PIO_PA17B_PCK1 (1u << 17) /**< \brief Pmc signal: PCK1 */ -#define PIO_PA21B_PCK1 (1u << 21) /**< \brief Pmc signal: PCK1 */ -#define PIO_PA3C_PCK2 (1u << 3) /**< \brief Pmc signal: PCK2 */ -#define PIO_PA18B_PCK2 (1u << 18) /**< \brief Pmc signal: PCK2 */ -#define PIO_PA31B_PCK2 (1u << 31) /**< \brief Pmc signal: PCK2 */ -#define PIO_PB3B_PCK2 (1u << 3) /**< \brief Pmc signal: PCK2 */ -#define PIO_PD31C_PCK2 (1u << 31) /**< \brief Pmc signal: PCK2 */ -/* ========== Pio definition for PWM0 peripheral ========== */ -#define PIO_PA10B_PWMC0_PWMEXTRG0 (1u << 10) /**< \brief Pwm0 signal: PWMC0_PWMEXTRG0 */ -#define PIO_PA22B_PWMC0_PWMEXTRG1 (1u << 22) /**< \brief Pwm0 signal: PWMC0_PWMEXTRG1 */ -#define PIO_PA9C_PWMC0_PWMFI0 (1u << 9) /**< \brief Pwm0 signal: PWMC0_PWMFI0 */ -#define PIO_PD8B_PWMC0_PWMFI1 (1u << 8) /**< \brief Pwm0 signal: PWMC0_PWMFI1 */ -#define PIO_PD9B_PWMC0_PWMFI2 (1u << 9) /**< \brief Pwm0 signal: PWMC0_PWMFI2 */ -#define PIO_PA0A_PWMC0_PWMH0 (1u << 0) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PA11B_PWMC0_PWMH0 (1u << 11) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PA23B_PWMC0_PWMH0 (1u << 23) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PB0A_PWMC0_PWMH0 (1u << 0) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PD11B_PWMC0_PWMH0 (1u << 11) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PD20A_PWMC0_PWMH0 (1u << 20) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PA2A_PWMC0_PWMH1 (1u << 2) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PA12B_PWMC0_PWMH1 (1u << 12) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PA24B_PWMC0_PWMH1 (1u << 24) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PB1A_PWMC0_PWMH1 (1u << 1) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PD21A_PWMC0_PWMH1 (1u << 21) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PA13B_PWMC0_PWMH2 (1u << 13) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PA25B_PWMC0_PWMH2 (1u << 25) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PB4B_PWMC0_PWMH2 (1u << 4) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PC19B_PWMC0_PWMH2 (1u << 19) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PD22A_PWMC0_PWMH2 (1u << 22) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PA7B_PWMC0_PWMH3 (1u << 7) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PA14B_PWMC0_PWMH3 (1u << 14) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PA17C_PWMC0_PWMH3 (1u << 17) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PC13B_PWMC0_PWMH3 (1u << 13) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PC21B_PWMC0_PWMH3 (1u << 21) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PD23A_PWMC0_PWMH3 (1u << 23) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PA1A_PWMC0_PWML0 (1u << 1) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PA19B_PWMC0_PWML0 (1u << 19) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PB5B_PWMC0_PWML0 (1u << 5) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PC0B_PWMC0_PWML0 (1u << 0) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PD10B_PWMC0_PWML0 (1u << 10) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PD24A_PWMC0_PWML0 (1u << 24) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PA20B_PWMC0_PWML1 (1u << 20) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PB12A_PWMC0_PWML1 (1u << 12) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PC1B_PWMC0_PWML1 (1u << 1) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PC18B_PWMC0_PWML1 (1u << 18) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PD25A_PWMC0_PWML1 (1u << 25) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PA16C_PWMC0_PWML2 (1u << 16) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PA30A_PWMC0_PWML2 (1u << 30) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PB13A_PWMC0_PWML2 (1u << 13) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PC2B_PWMC0_PWML2 (1u << 2) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PC20B_PWMC0_PWML2 (1u << 20) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PD26A_PWMC0_PWML2 (1u << 26) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PA15C_PWMC0_PWML3 (1u << 15) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -#define PIO_PC3B_PWMC0_PWML3 (1u << 3) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -#define PIO_PC15B_PWMC0_PWML3 (1u << 15) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -#define PIO_PC22B_PWMC0_PWML3 (1u << 22) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -#define PIO_PD27A_PWMC0_PWML3 (1u << 27) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -/* ========== Pio definition for PWM1 peripheral ========== */ -#define PIO_PA30B_PWMC1_PWMEXTRG0 (1u << 30) /**< \brief Pwm1 signal: PWMC1_PWMEXTRG0 */ -#define PIO_PA18A_PWMC1_PWMEXTRG1 (1u << 18) /**< \brief Pwm1 signal: PWMC1_PWMEXTRG1 */ -#define PIO_PA21C_PWMC1_PWMFI0 (1u << 21) /**< \brief Pwm1 signal: PWMC1_PWMFI0 */ -#define PIO_PA26D_PWMC1_PWMFI1 (1u << 26) /**< \brief Pwm1 signal: PWMC1_PWMFI1 */ -#define PIO_PA28D_PWMC1_PWMFI2 (1u << 28) /**< \brief Pwm1 signal: PWMC1_PWMFI2 */ -#define PIO_PA12C_PWMC1_PWMH0 (1u << 12) /**< \brief Pwm1 signal: PWMC1_PWMH0 */ -#define PIO_PD1B_PWMC1_PWMH0 (1u << 1) /**< \brief Pwm1 signal: PWMC1_PWMH0 */ -#define PIO_PA14C_PWMC1_PWMH1 (1u << 14) /**< \brief Pwm1 signal: PWMC1_PWMH1 */ -#define PIO_PD3B_PWMC1_PWMH1 (1u << 3) /**< \brief Pwm1 signal: PWMC1_PWMH1 */ -#define PIO_PA31D_PWMC1_PWMH2 (1u << 31) /**< \brief Pwm1 signal: PWMC1_PWMH2 */ -#define PIO_PD5B_PWMC1_PWMH2 (1u << 5) /**< \brief Pwm1 signal: PWMC1_PWMH2 */ -#define PIO_PA8A_PWMC1_PWMH3 (1u << 8) /**< \brief Pwm1 signal: PWMC1_PWMH3 */ -#define PIO_PD7B_PWMC1_PWMH3 (1u << 7) /**< \brief Pwm1 signal: PWMC1_PWMH3 */ -#define PIO_PA11C_PWMC1_PWML0 (1u << 11) /**< \brief Pwm1 signal: PWMC1_PWML0 */ -#define PIO_PD0B_PWMC1_PWML0 (1u << 0) /**< \brief Pwm1 signal: PWMC1_PWML0 */ -#define PIO_PA13C_PWMC1_PWML1 (1u << 13) /**< \brief Pwm1 signal: PWMC1_PWML1 */ -#define PIO_PD2B_PWMC1_PWML1 (1u << 2) /**< \brief Pwm1 signal: PWMC1_PWML1 */ -#define PIO_PA23D_PWMC1_PWML2 (1u << 23) /**< \brief Pwm1 signal: PWMC1_PWML2 */ -#define PIO_PD4B_PWMC1_PWML2 (1u << 4) /**< \brief Pwm1 signal: PWMC1_PWML2 */ -#define PIO_PA5A_PWMC1_PWML3 (1u << 5) /**< \brief Pwm1 signal: PWMC1_PWML3 */ -#define PIO_PD6B_PWMC1_PWML3 (1u << 6) /**< \brief Pwm1 signal: PWMC1_PWML3 */ -/* ========== Pio definition for QSPI peripheral ========== */ -#define PIO_PA11A_QCS (1u << 11) /**< \brief Qspi signal: QCS */ -#define PIO_PA13A_QIO0 (1u << 13) /**< \brief Qspi signal: QIO0 */ -#define PIO_PA12A_QIO1 (1u << 12) /**< \brief Qspi signal: QIO1 */ -#define PIO_PA17A_QIO2 (1u << 17) /**< \brief Qspi signal: QIO2 */ -#define PIO_PD31A_QIO3 (1u << 31) /**< \brief Qspi signal: QIO3 */ -#define PIO_PA14A_QSCK (1u << 14) /**< \brief Qspi signal: QSCK */ -/* ========== Pio definition for SPI0 peripheral ========== */ -#define PIO_PD20B_SPI0_MISO (1u << 20) /**< \brief Spi0 signal: SPI0_MISO */ -#define PIO_PD21B_SPI0_MOSI (1u << 21) /**< \brief Spi0 signal: SPI0_MOSI */ -#define PIO_PB2D_SPI0_NPCS0 (1u << 2) /**< \brief Spi0 signal: SPI0_NPCS0 */ -#define PIO_PA31A_SPI0_NPCS1 (1u << 31) /**< \brief Spi0 signal: SPI0_NPCS1 */ -#define PIO_PD25B_SPI0_NPCS1 (1u << 25) /**< \brief Spi0 signal: SPI0_NPCS1 */ -#define PIO_PD12C_SPI0_NPCS2 (1u << 12) /**< \brief Spi0 signal: SPI0_NPCS2 */ -#define PIO_PD27B_SPI0_NPCS3 (1u << 27) /**< \brief Spi0 signal: SPI0_NPCS3 */ -#define PIO_PD22B_SPI0_SPCK (1u << 22) /**< \brief Spi0 signal: SPI0_SPCK */ -/* ========== Pio definition for SPI1 peripheral ========== */ -#define PIO_PC26C_SPI1_MISO (1u << 26) /**< \brief Spi1 signal: SPI1_MISO */ -#define PIO_PC27C_SPI1_MOSI (1u << 27) /**< \brief Spi1 signal: SPI1_MOSI */ -#define PIO_PC25C_SPI1_NPCS0 (1u << 25) /**< \brief Spi1 signal: SPI1_NPCS0 */ -#define PIO_PC28C_SPI1_NPCS1 (1u << 28) /**< \brief Spi1 signal: SPI1_NPCS1 */ -#define PIO_PD0C_SPI1_NPCS1 (1u << 0) /**< \brief Spi1 signal: SPI1_NPCS1 */ -#define PIO_PC29C_SPI1_NPCS2 (1u << 29) /**< \brief Spi1 signal: SPI1_NPCS2 */ -#define PIO_PD1C_SPI1_NPCS2 (1u << 1) /**< \brief Spi1 signal: SPI1_NPCS2 */ -#define PIO_PC30C_SPI1_NPCS3 (1u << 30) /**< \brief Spi1 signal: SPI1_NPCS3 */ -#define PIO_PD2C_SPI1_NPCS3 (1u << 2) /**< \brief Spi1 signal: SPI1_NPCS3 */ -#define PIO_PC24C_SPI1_SPCK (1u << 24) /**< \brief Spi1 signal: SPI1_SPCK */ -/* ========== Pio definition for SSC peripheral ========== */ -#define PIO_PA10C_RD (1u << 10) /**< \brief Ssc signal: RD */ -#define PIO_PD24B_RF (1u << 24) /**< \brief Ssc signal: RF */ -#define PIO_PA22A_RK (1u << 22) /**< \brief Ssc signal: RK */ -#define PIO_PB5D_TD (1u << 5) /**< \brief Ssc signal: TD */ -#define PIO_PD10C_TD (1u << 10) /**< \brief Ssc signal: TD */ -#define PIO_PD26B_TD (1u << 26) /**< \brief Ssc signal: TD */ -#define PIO_PB0D_TF (1u << 0) /**< \brief Ssc signal: TF */ -#define PIO_PB1D_TK (1u << 1) /**< \brief Ssc signal: TK */ -/* ========== Pio definition for TC0 peripheral ========== */ -#define PIO_PA4B_TCLK0 (1u << 4) /**< \brief Tc0 signal: TCLK0 */ -#define PIO_PA28B_TCLK1 (1u << 28) /**< \brief Tc0 signal: TCLK1 */ -#define PIO_PA29B_TCLK2 (1u << 29) /**< \brief Tc0 signal: TCLK2 */ -#define PIO_PA0B_TIOA0 (1u << 0) /**< \brief Tc0 signal: TIOA0 */ -#define PIO_PA15B_TIOA1 (1u << 15) /**< \brief Tc0 signal: TIOA1 */ -#define PIO_PA26B_TIOA2 (1u << 26) /**< \brief Tc0 signal: TIOA2 */ -#define PIO_PA1B_TIOB0 (1u << 1) /**< \brief Tc0 signal: TIOB0 */ -#define PIO_PA16B_TIOB1 (1u << 16) /**< \brief Tc0 signal: TIOB1 */ -#define PIO_PA27B_TIOB2 (1u << 27) /**< \brief Tc0 signal: TIOB2 */ -/* ========== Pio definition for TC3 peripheral ========== */ -#define PIO_PE5B_TCLK10 (1u << 5) /**< \brief Tc3 signal: TCLK10 */ -#define PIO_PD24C_TCLK11 (1u << 24) /**< \brief Tc3 signal: TCLK11 */ -#define PIO_PE2B_TCLK9 (1u << 2) /**< \brief Tc3 signal: TCLK9 */ -#define PIO_PE3B_TIOA10 (1u << 3) /**< \brief Tc3 signal: TIOA10 */ -#define PIO_PD21C_TIOA11 (1u << 21) /**< \brief Tc3 signal: TIOA11 */ -#define PIO_PE0B_TIOA9 (1u << 0) /**< \brief Tc3 signal: TIOA9 */ -#define PIO_PE4B_TIOB10 (1u << 4) /**< \brief Tc3 signal: TIOB10 */ -#define PIO_PD22C_TIOB11 (1u << 22) /**< \brief Tc3 signal: TIOB11 */ -#define PIO_PE1B_TIOB9 (1u << 1) /**< \brief Tc3 signal: TIOB9 */ -/* ========== Pio definition for TWIHS0 peripheral ========== */ -#define PIO_PA4A_TWCK0 (1u << 4) /**< \brief Twihs0 signal: TWCK0 */ -#define PIO_PA3A_TWD0 (1u << 3) /**< \brief Twihs0 signal: TWD0 */ -/* ========== Pio definition for TWIHS1 peripheral ========== */ -#define PIO_PB5A_TWCK1 (1u << 5) /**< \brief Twihs1 signal: TWCK1 */ -#define PIO_PB4A_TWD1 (1u << 4) /**< \brief Twihs1 signal: TWD1 */ -/* ========== Pio definition for UART0 peripheral ========== */ -#define PIO_PA9A_URXD0 (1u << 9) /**< \brief Uart0 signal: URXD0 */ -#define PIO_PA10A_UTXD0 (1u << 10) /**< \brief Uart0 signal: UTXD0 */ -/* ========== Pio definition for UART1 peripheral ========== */ -#define PIO_PA5C_URXD1 (1u << 5) /**< \brief Uart1 signal: URXD1 */ -#define PIO_PA4C_UTXD1 (1u << 4) /**< \brief Uart1 signal: UTXD1 */ -#define PIO_PA6C_UTXD1 (1u << 6) /**< \brief Uart1 signal: UTXD1 */ -#define PIO_PD26D_UTXD1 (1u << 26) /**< \brief Uart1 signal: UTXD1 */ -/* ========== Pio definition for UART2 peripheral ========== */ -#define PIO_PD25C_URXD2 (1u << 25) /**< \brief Uart2 signal: URXD2 */ -#define PIO_PD26C_UTXD2 (1u << 26) /**< \brief Uart2 signal: UTXD2 */ -/* ========== Pio definition for UART3 peripheral ========== */ -#define PIO_PD28A_URXD3 (1u << 28) /**< \brief Uart3 signal: URXD3 */ -#define PIO_PD30A_UTXD3 (1u << 30) /**< \brief Uart3 signal: UTXD3 */ -#define PIO_PD31B_UTXD3 (1u << 31) /**< \brief Uart3 signal: UTXD3 */ -/* ========== Pio definition for UART4 peripheral ========== */ -#define PIO_PD18C_URXD4 (1u << 18) /**< \brief Uart4 signal: URXD4 */ -#define PIO_PD3C_UTXD4 (1u << 3) /**< \brief Uart4 signal: UTXD4 */ -#define PIO_PD19C_UTXD4 (1u << 19) /**< \brief Uart4 signal: UTXD4 */ -/* ========== Pio definition for USART0 peripheral ========== */ -#define PIO_PB2C_CTS0 (1u << 2) /**< \brief Usart0 signal: CTS0 */ -#define PIO_PD0D_DCD0 (1u << 0) /**< \brief Usart0 signal: DCD0 */ -#define PIO_PD2D_DSR0 (1u << 2) /**< \brief Usart0 signal: DSR0 */ -#define PIO_PD1D_DTR0 (1u << 1) /**< \brief Usart0 signal: DTR0 */ -#define PIO_PD3D_RI0 (1u << 3) /**< \brief Usart0 signal: RI0 */ -#define PIO_PB3C_RTS0 (1u << 3) /**< \brief Usart0 signal: RTS0 */ -#define PIO_PB0C_RXD0 (1u << 0) /**< \brief Usart0 signal: RXD0 */ -#define PIO_PB13C_SCK0 (1u << 13) /**< \brief Usart0 signal: SCK0 */ -#define PIO_PB1C_TXD0 (1u << 1) /**< \brief Usart0 signal: TXD0 */ -/* ========== Pio definition for USART1 peripheral ========== */ -#define PIO_PA25A_CTS1 (1u << 25) /**< \brief Usart1 signal: CTS1 */ -#define PIO_PA26A_DCD1 (1u << 26) /**< \brief Usart1 signal: DCD1 */ -#define PIO_PA28A_DSR1 (1u << 28) /**< \brief Usart1 signal: DSR1 */ -#define PIO_PA27A_DTR1 (1u << 27) /**< \brief Usart1 signal: DTR1 */ -#define PIO_PA3B_LONCOL1 (1u << 3) /**< \brief Usart1 signal: LONCOL1 */ -#define PIO_PA29A_RI1 (1u << 29) /**< \brief Usart1 signal: RI1 */ -#define PIO_PA24A_RTS1 (1u << 24) /**< \brief Usart1 signal: RTS1 */ -#define PIO_PA21A_RXD1 (1u << 21) /**< \brief Usart1 signal: RXD1 */ -#define PIO_PA23A_SCK1 (1u << 23) /**< \brief Usart1 signal: SCK1 */ -#define PIO_PB4D_TXD1 (1u << 4) /**< \brief Usart1 signal: TXD1 */ -/* ========== Pio definition for USART2 peripheral ========== */ -#define PIO_PD19B_CTS2 (1u << 19) /**< \brief Usart2 signal: CTS2 */ -#define PIO_PD4D_DCD2 (1u << 4) /**< \brief Usart2 signal: DCD2 */ -#define PIO_PD6D_DSR2 (1u << 6) /**< \brief Usart2 signal: DSR2 */ -#define PIO_PD5D_DTR2 (1u << 5) /**< \brief Usart2 signal: DTR2 */ -#define PIO_PD7D_RI2 (1u << 7) /**< \brief Usart2 signal: RI2 */ -#define PIO_PD18B_RTS2 (1u << 18) /**< \brief Usart2 signal: RTS2 */ -#define PIO_PD15B_RXD2 (1u << 15) /**< \brief Usart2 signal: RXD2 */ -#define PIO_PD17B_SCK2 (1u << 17) /**< \brief Usart2 signal: SCK2 */ -#define PIO_PD16B_TXD2 (1u << 16) /**< \brief Usart2 signal: TXD2 */ -/* ========== Pio indexes ========== */ -#define PIO_PA3_IDX 3 -#define PIO_PA4_IDX 4 -#define PIO_PA5_IDX 5 -#define PIO_PA7_IDX 7 -#define PIO_PA8_IDX 8 -#define PIO_PA9_IDX 9 -#define PIO_PA10_IDX 10 -#define PIO_PA11_IDX 11 -#define PIO_PA12_IDX 12 -#define PIO_PA13_IDX 13 -#define PIO_PA14_IDX 14 -#define PIO_PA21_IDX 21 -#define PIO_PA22_IDX 22 -#define PIO_PA24_IDX 24 -#define PIO_PA27_IDX 27 -#define PIO_PB0_IDX 32 -#define PIO_PB1_IDX 33 -#define PIO_PB2_IDX 34 -#define PIO_PB3_IDX 35 -#define PIO_PB4_IDX 36 -#define PIO_PB5_IDX 37 -#define PIO_PB6_IDX 38 -#define PIO_PB7_IDX 39 -#define PIO_PB8_IDX 40 -#define PIO_PB9_IDX 41 -#define PIO_PB12_IDX 44 -#define PIO_PD0_IDX 96 -#define PIO_PD1_IDX 97 -#define PIO_PD2_IDX 98 -#define PIO_PD3_IDX 99 -#define PIO_PD4_IDX 100 -#define PIO_PD5_IDX 101 -#define PIO_PD6_IDX 102 -#define PIO_PD7_IDX 103 -#define PIO_PD8_IDX 104 -#define PIO_PD9_IDX 105 -#define PIO_PD10_IDX 106 -#define PIO_PD11_IDX 107 -#define PIO_PD12_IDX 108 -#define PIO_PD21_IDX 117 -#define PIO_PD22_IDX 118 -#define PIO_PD24_IDX 120 -#define PIO_PD25_IDX 121 -#define PIO_PD26_IDX 122 -#define PIO_PD31_IDX 127 - -#endif /* _SAMV71J19_PIO_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/pio/pio_samv71j20.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/pio/pio_samv71j20.h deleted file mode 100644 index a2c87403..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/pio/pio_samv71j20.h +++ /dev/null @@ -1,442 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71J20_PIO_ -#define _SAMV71J20_PIO_ - -#define PIO_PA3 (1u << 3) /**< \brief Pin Controlled by PA3 */ -#define PIO_PA4 (1u << 4) /**< \brief Pin Controlled by PA4 */ -#define PIO_PA5 (1u << 5) /**< \brief Pin Controlled by PA5 */ -#define PIO_PA7 (1u << 7) /**< \brief Pin Controlled by PA7 */ -#define PIO_PA8 (1u << 8) /**< \brief Pin Controlled by PA8 */ -#define PIO_PA9 (1u << 9) /**< \brief Pin Controlled by PA9 */ -#define PIO_PA10 (1u << 10) /**< \brief Pin Controlled by PA10 */ -#define PIO_PA11 (1u << 11) /**< \brief Pin Controlled by PA11 */ -#define PIO_PA12 (1u << 12) /**< \brief Pin Controlled by PA12 */ -#define PIO_PA13 (1u << 13) /**< \brief Pin Controlled by PA13 */ -#define PIO_PA14 (1u << 14) /**< \brief Pin Controlled by PA14 */ -#define PIO_PA21 (1u << 21) /**< \brief Pin Controlled by PA21 */ -#define PIO_PA22 (1u << 22) /**< \brief Pin Controlled by PA22 */ -#define PIO_PA24 (1u << 24) /**< \brief Pin Controlled by PA24 */ -#define PIO_PA27 (1u << 27) /**< \brief Pin Controlled by PA27 */ -#define PIO_PB0 (1u << 0) /**< \brief Pin Controlled by PB0 */ -#define PIO_PB1 (1u << 1) /**< \brief Pin Controlled by PB1 */ -#define PIO_PB2 (1u << 2) /**< \brief Pin Controlled by PB2 */ -#define PIO_PB3 (1u << 3) /**< \brief Pin Controlled by PB3 */ -#define PIO_PB4 (1u << 4) /**< \brief Pin Controlled by PB4 */ -#define PIO_PB5 (1u << 5) /**< \brief Pin Controlled by PB5 */ -#define PIO_PB6 (1u << 6) /**< \brief Pin Controlled by PB6 */ -#define PIO_PB7 (1u << 7) /**< \brief Pin Controlled by PB7 */ -#define PIO_PB8 (1u << 8) /**< \brief Pin Controlled by PB8 */ -#define PIO_PB9 (1u << 9) /**< \brief Pin Controlled by PB9 */ -#define PIO_PB12 (1u << 12) /**< \brief Pin Controlled by PB12 */ -#define PIO_PD0 (1u << 0) /**< \brief Pin Controlled by PD0 */ -#define PIO_PD1 (1u << 1) /**< \brief Pin Controlled by PD1 */ -#define PIO_PD2 (1u << 2) /**< \brief Pin Controlled by PD2 */ -#define PIO_PD3 (1u << 3) /**< \brief Pin Controlled by PD3 */ -#define PIO_PD4 (1u << 4) /**< \brief Pin Controlled by PD4 */ -#define PIO_PD5 (1u << 5) /**< \brief Pin Controlled by PD5 */ -#define PIO_PD6 (1u << 6) /**< \brief Pin Controlled by PD6 */ -#define PIO_PD7 (1u << 7) /**< \brief Pin Controlled by PD7 */ -#define PIO_PD8 (1u << 8) /**< \brief Pin Controlled by PD8 */ -#define PIO_PD9 (1u << 9) /**< \brief Pin Controlled by PD9 */ -#define PIO_PD10 (1u << 10) /**< \brief Pin Controlled by PD10 */ -#define PIO_PD11 (1u << 11) /**< \brief Pin Controlled by PD11 */ -#define PIO_PD12 (1u << 12) /**< \brief Pin Controlled by PD12 */ -#define PIO_PD21 (1u << 21) /**< \brief Pin Controlled by PD21 */ -#define PIO_PD22 (1u << 22) /**< \brief Pin Controlled by PD22 */ -#define PIO_PD24 (1u << 24) /**< \brief Pin Controlled by PD24 */ -#define PIO_PD25 (1u << 25) /**< \brief Pin Controlled by PD25 */ -#define PIO_PD26 (1u << 26) /**< \brief Pin Controlled by PD26 */ -#define PIO_PD31 (1u << 31) /**< \brief Pin Controlled by PD31 */ -/* ========== Pio definition for AFEC0 peripheral ========== */ -#define PIO_PD30X1_AFE0_AD0 (1u << 30) /**< \brief Afec0 signal: AFE0_AD0 */ -#define PIO_PA21X1_AFE0_AD1 (1u << 21) /**< \brief Afec0 signal: AFE0_AD1/PIODCEN2 */ -#define PIO_PA21X1_PIODCEN2 (1u << 21) /**< \brief Afec0 signal: AFE0_AD1/PIODCEN2 */ -#define PIO_PB0X1_AFE0_AD10 (1u << 0) /**< \brief Afec0 signal: AFE0_AD10/RTCOUT0 */ -#define PIO_PB0X1_RTCOUT0 (1u << 0) /**< \brief Afec0 signal: AFE0_AD10/RTCOUT0 */ -#define PIO_PB3X1_AFE0_AD2 (1u << 3) /**< \brief Afec0 signal: AFE0_AD2/WKUP12 */ -#define PIO_PB3X1_WKUP12 (1u << 3) /**< \brief Afec0 signal: AFE0_AD2/WKUP12 */ -#define PIO_PE5X1_AFE0_AD3 (1u << 5) /**< \brief Afec0 signal: AFE0_AD3 */ -#define PIO_PE4X1_AFE0_AD4 (1u << 4) /**< \brief Afec0 signal: AFE0_AD4 */ -#define PIO_PB2X1_AFE0_AD5 (1u << 2) /**< \brief Afec0 signal: AFE0_AD5 */ -#define PIO_PA17X1_AFE0_AD6 (1u << 17) /**< \brief Afec0 signal: AFE0_AD6 */ -#define PIO_PA18X1_AFE0_AD7 (1u << 18) /**< \brief Afec0 signal: AFE0_AD7 */ -#define PIO_PA19X1_AFE0_AD8 (1u << 19) /**< \brief Afec0 signal: AFE0_AD8/WKUP9 */ -#define PIO_PA19X1_WKUP9 (1u << 19) /**< \brief Afec0 signal: AFE0_AD8/WKUP9 */ -#define PIO_PA20X1_AFE0_AD9 (1u << 20) /**< \brief Afec0 signal: AFE0_AD9/WKUP10 */ -#define PIO_PA20X1_WKUP10 (1u << 20) /**< \brief Afec0 signal: AFE0_AD9/WKUP10 */ -#define PIO_PA8B_AFE0_ADTRG (1u << 8) /**< \brief Afec0 signal: AFE0_ADTRG */ -/* ========== Pio definition for AFEC1 peripheral ========== */ -#define PIO_PB1X1_AFE1_AD0 (1u << 1) /**< \brief Afec1 signal: AFE1_AD0/RTCOUT1 */ -#define PIO_PB1X1_RTCOUT1 (1u << 1) /**< \brief Afec1 signal: AFE1_AD0/RTCOUT1 */ -#define PIO_PC13X1_AFE1_AD1 (1u << 13) /**< \brief Afec1 signal: AFE1_AD1 */ -#define PIO_PE3X1_AFE1_AD10 (1u << 3) /**< \brief Afec1 signal: AFE1_AD10 */ -#define PIO_PE0X1_AFE1_AD11 (1u << 0) /**< \brief Afec1 signal: AFE1_AD11 */ -#define PIO_PC15X1_AFE1_AD2 (1u << 15) /**< \brief Afec1 signal: AFE1_AD2 */ -#define PIO_PC12X1_AFE1_AD3 (1u << 12) /**< \brief Afec1 signal: AFE1_AD3 */ -#define PIO_PC29X1_AFE1_AD4 (1u << 29) /**< \brief Afec1 signal: AFE1_AD4 */ -#define PIO_PC30X1_AFE1_AD5 (1u << 30) /**< \brief Afec1 signal: AFE1_AD5 */ -#define PIO_PC31X1_AFE1_AD6 (1u << 31) /**< \brief Afec1 signal: AFE1_AD6 */ -#define PIO_PC26X1_AFE1_AD7 (1u << 26) /**< \brief Afec1 signal: AFE1_AD7 */ -#define PIO_PC27X1_AFE1_AD8 (1u << 27) /**< \brief Afec1 signal: AFE1_AD8 */ -#define PIO_PC0X1_AFE1_AD9 (1u << 0) /**< \brief Afec1 signal: AFE1_AD9 */ -#define PIO_PD9C_AFE1_ADTRG (1u << 9) /**< \brief Afec1 signal: AFE1_ADTRG */ -/* ========== Pio definition for ARM peripheral ========== */ -#define PIO_PB7X1_SWCLK (1u << 7) /**< \brief Arm signal: SWCLK/TCK */ -#define PIO_PB7X1_TCK (1u << 7) /**< \brief Arm signal: SWCLK/TCK */ -#define PIO_PB6X1_SWDIO (1u << 6) /**< \brief Arm signal: SWDIO/TMS */ -#define PIO_PB6X1_TMS (1u << 6) /**< \brief Arm signal: SWDIO/TMS */ -#define PIO_PB4X1_TDI (1u << 4) /**< \brief Arm signal: TDI */ -#define PIO_PB5X1_TDO (1u << 5) /**< \brief Arm signal: TDO/TRACESWO/WKUP13 */ -#define PIO_PB5X1_TRACESWO (1u << 5) /**< \brief Arm signal: TDO/TRACESWO/WKUP13 */ -#define PIO_PB5X1_WKUP13 (1u << 5) /**< \brief Arm signal: TDO/TRACESWO/WKUP13 */ -/* ========== Pio definition for DACC peripheral ========== */ -#define PIO_PB13X1_DAC0 (1u << 13) /**< \brief Dacc signal: DAC0 */ -#define PIO_PD0X1_DAC1 (1u << 0) /**< \brief Dacc signal: DAC1 */ -#define PIO_PA2C_DATRG (1u << 2) /**< \brief Dacc signal: DATRG */ -/* ========== Pio definition for GMAC peripheral ========== */ -#define PIO_PD13A_GCOL (1u << 13) /**< \brief Gmac signal: GCOL */ -#define PIO_PD10A_GCRS (1u << 10) /**< \brief Gmac signal: GCRS */ -#define PIO_PD8A_GMDC (1u << 8) /**< \brief Gmac signal: GMDC */ -#define PIO_PD9A_GMDIO (1u << 9) /**< \brief Gmac signal: GMDIO */ -#define PIO_PD5A_GRX0 (1u << 5) /**< \brief Gmac signal: GRX0 */ -#define PIO_PD6A_GRX1 (1u << 6) /**< \brief Gmac signal: GRX1 */ -#define PIO_PD11A_GRX2 (1u << 11) /**< \brief Gmac signal: GRX2 */ -#define PIO_PD12A_GRX3 (1u << 12) /**< \brief Gmac signal: GRX3 */ -#define PIO_PD14A_GRXCK (1u << 14) /**< \brief Gmac signal: GRXCK */ -#define PIO_PD4A_GRXDV (1u << 4) /**< \brief Gmac signal: GRXDV */ -#define PIO_PD7A_GRXER (1u << 7) /**< \brief Gmac signal: GRXER */ -#define PIO_PB1B_GTSUCOMP (1u << 1) /**< \brief Gmac signal: GTSUCOMP */ -#define PIO_PB12B_GTSUCOMP (1u << 12) /**< \brief Gmac signal: GTSUCOMP */ -#define PIO_PD11C_GTSUCOMP (1u << 11) /**< \brief Gmac signal: GTSUCOMP */ -#define PIO_PD20C_GTSUCOMP (1u << 20) /**< \brief Gmac signal: GTSUCOMP */ -#define PIO_PD2A_GTX0 (1u << 2) /**< \brief Gmac signal: GTX0 */ -#define PIO_PD3A_GTX1 (1u << 3) /**< \brief Gmac signal: GTX1 */ -#define PIO_PD15A_GTX2 (1u << 15) /**< \brief Gmac signal: GTX2 */ -#define PIO_PD16A_GTX3 (1u << 16) /**< \brief Gmac signal: GTX3 */ -#define PIO_PD0A_GTXCK (1u << 0) /**< \brief Gmac signal: GTXCK */ -#define PIO_PD1A_GTXEN (1u << 1) /**< \brief Gmac signal: GTXEN */ -#define PIO_PD17A_GTXER (1u << 17) /**< \brief Gmac signal: GTXER */ -/* ========== Pio definition for HSMCI peripheral ========== */ -#define PIO_PA28C_MCCDA (1u << 28) /**< \brief Hsmci signal: MCCDA */ -#define PIO_PA25D_MCCK (1u << 25) /**< \brief Hsmci signal: MCCK */ -#define PIO_PA30C_MCDA0 (1u << 30) /**< \brief Hsmci signal: MCDA0 */ -#define PIO_PA31C_MCDA1 (1u << 31) /**< \brief Hsmci signal: MCDA1 */ -#define PIO_PA26C_MCDA2 (1u << 26) /**< \brief Hsmci signal: MCDA2 */ -#define PIO_PA27C_MCDA3 (1u << 27) /**< \brief Hsmci signal: MCDA3 */ -/* ========== Pio definition for ISI peripheral ========== */ -#define PIO_PD22D_ISI_D0 (1u << 22) /**< \brief Isi signal: ISI_D0 */ -#define PIO_PD21D_ISI_D1 (1u << 21) /**< \brief Isi signal: ISI_D1 */ -#define PIO_PD30D_ISI_D10 (1u << 30) /**< \brief Isi signal: ISI_D10 */ -#define PIO_PD31D_ISI_D11 (1u << 31) /**< \brief Isi signal: ISI_D11 */ -#define PIO_PB3D_ISI_D2 (1u << 3) /**< \brief Isi signal: ISI_D2 */ -#define PIO_PA9B_ISI_D3 (1u << 9) /**< \brief Isi signal: ISI_D3 */ -#define PIO_PA5B_ISI_D4 (1u << 5) /**< \brief Isi signal: ISI_D4 */ -#define PIO_PD11D_ISI_D5 (1u << 11) /**< \brief Isi signal: ISI_D5 */ -#define PIO_PD12D_ISI_D6 (1u << 12) /**< \brief Isi signal: ISI_D6 */ -#define PIO_PA27D_ISI_D7 (1u << 27) /**< \brief Isi signal: ISI_D7 */ -#define PIO_PD27D_ISI_D8 (1u << 27) /**< \brief Isi signal: ISI_D8 */ -#define PIO_PD28D_ISI_D9 (1u << 28) /**< \brief Isi signal: ISI_D9 */ -#define PIO_PD24D_ISI_HSYNC (1u << 24) /**< \brief Isi signal: ISI_HSYNC */ -#define PIO_PA24D_ISI_PCK (1u << 24) /**< \brief Isi signal: ISI_PCK */ -#define PIO_PD25D_ISI_VSYNC (1u << 25) /**< \brief Isi signal: ISI_VSYNC */ -/* ========== Pio definition for MCAN0 peripheral ========== */ -#define PIO_PB3A_CANRX0 (1u << 3) /**< \brief Mcan0 signal: CANRX0 */ -#define PIO_PB2A_CANTX0 (1u << 2) /**< \brief Mcan0 signal: CANTX0 */ -/* ========== Pio definition for MCAN1 peripheral ========== */ -#define PIO_PC12C_CANRX1 (1u << 12) /**< \brief Mcan1 signal: CANRX1 */ -#define PIO_PD28B_CANRX1 (1u << 28) /**< \brief Mcan1 signal: CANRX1 */ -#define PIO_PC14C_CANTX1 (1u << 14) /**< \brief Mcan1 signal: CANTX1 */ -#define PIO_PD12B_CANTX1 (1u << 12) /**< \brief Mcan1 signal: CANTX1 */ -/* ========== Pio definition for MLB peripheral ========== */ -#define PIO_PB4C_MLBCLK (1u << 4) /**< \brief Mlb signal: MLBCLK */ -#define PIO_PB5C_MLBDAT (1u << 5) /**< \brief Mlb signal: MLBDAT */ -#define PIO_PD10D_MLBSIG (1u << 10) /**< \brief Mlb signal: MLBSIG */ -/* ========== Pio definition for PIOA peripheral ========== */ -#define PIO_PA21X1_AFE0_AD1 (1u << 21) /**< \brief Pioa signal: AFE0_AD1/PIODCEN2 */ -#define PIO_PA21X1_PIODCEN2 (1u << 21) /**< \brief Pioa signal: AFE0_AD1/PIODCEN2 */ -#define PIO_PA3X1_PIODC0 (1u << 3) /**< \brief Pioa signal: PIODC0 */ -#define PIO_PA10X1_PIODC4 (1u << 10) /**< \brief Pioa signal: PIODC4 */ -#define PIO_PA12X1_PIODC6 (1u << 12) /**< \brief Pioa signal: PIODC6 */ -#define PIO_PA13X1_PIODC7 (1u << 13) /**< \brief Pioa signal: PIODC7 */ -#define PIO_PA22X1_PIODCCLK (1u << 22) /**< \brief Pioa signal: PIODCCLK */ -#define PIO_PA4X1_WKUP3 (1u << 4) /**< \brief Pioa signal: WKUP3/PIODC1 */ -#define PIO_PA4X1_PIODC1 (1u << 4) /**< \brief Pioa signal: WKUP3/PIODC1 */ -#define PIO_PA5X1_WKUP4 (1u << 5) /**< \brief Pioa signal: WKUP4/PIODC2 */ -#define PIO_PA5X1_PIODC2 (1u << 5) /**< \brief Pioa signal: WKUP4/PIODC2 */ -#define PIO_PA9X1_WKUP6 (1u << 9) /**< \brief Pioa signal: WKUP6/PIODC3 */ -#define PIO_PA9X1_PIODC3 (1u << 9) /**< \brief Pioa signal: WKUP6/PIODC3 */ -#define PIO_PA11X1_WKUP7 (1u << 11) /**< \brief Pioa signal: WKUP7/PIODC5 */ -#define PIO_PA11X1_PIODC5 (1u << 11) /**< \brief Pioa signal: WKUP7/PIODC5 */ -#define PIO_PA14X1_WKUP8 (1u << 14) /**< \brief Pioa signal: WKUP8/PIODCEN1 */ -#define PIO_PA14X1_PIODCEN1 (1u << 14) /**< \brief Pioa signal: WKUP8/PIODCEN1 */ -/* ========== Pio definition for PMC peripheral ========== */ -#define PIO_PA6B_PCK0 (1u << 6) /**< \brief Pmc signal: PCK0 */ -#define PIO_PB12D_PCK0 (1u << 12) /**< \brief Pmc signal: PCK0 */ -#define PIO_PB13B_PCK0 (1u << 13) /**< \brief Pmc signal: PCK0 */ -#define PIO_PA17B_PCK1 (1u << 17) /**< \brief Pmc signal: PCK1 */ -#define PIO_PA21B_PCK1 (1u << 21) /**< \brief Pmc signal: PCK1 */ -#define PIO_PA3C_PCK2 (1u << 3) /**< \brief Pmc signal: PCK2 */ -#define PIO_PA18B_PCK2 (1u << 18) /**< \brief Pmc signal: PCK2 */ -#define PIO_PA31B_PCK2 (1u << 31) /**< \brief Pmc signal: PCK2 */ -#define PIO_PB3B_PCK2 (1u << 3) /**< \brief Pmc signal: PCK2 */ -#define PIO_PD31C_PCK2 (1u << 31) /**< \brief Pmc signal: PCK2 */ -/* ========== Pio definition for PWM0 peripheral ========== */ -#define PIO_PA10B_PWMC0_PWMEXTRG0 (1u << 10) /**< \brief Pwm0 signal: PWMC0_PWMEXTRG0 */ -#define PIO_PA22B_PWMC0_PWMEXTRG1 (1u << 22) /**< \brief Pwm0 signal: PWMC0_PWMEXTRG1 */ -#define PIO_PA9C_PWMC0_PWMFI0 (1u << 9) /**< \brief Pwm0 signal: PWMC0_PWMFI0 */ -#define PIO_PD8B_PWMC0_PWMFI1 (1u << 8) /**< \brief Pwm0 signal: PWMC0_PWMFI1 */ -#define PIO_PD9B_PWMC0_PWMFI2 (1u << 9) /**< \brief Pwm0 signal: PWMC0_PWMFI2 */ -#define PIO_PA0A_PWMC0_PWMH0 (1u << 0) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PA11B_PWMC0_PWMH0 (1u << 11) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PA23B_PWMC0_PWMH0 (1u << 23) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PB0A_PWMC0_PWMH0 (1u << 0) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PD11B_PWMC0_PWMH0 (1u << 11) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PD20A_PWMC0_PWMH0 (1u << 20) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PA2A_PWMC0_PWMH1 (1u << 2) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PA12B_PWMC0_PWMH1 (1u << 12) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PA24B_PWMC0_PWMH1 (1u << 24) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PB1A_PWMC0_PWMH1 (1u << 1) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PD21A_PWMC0_PWMH1 (1u << 21) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PA13B_PWMC0_PWMH2 (1u << 13) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PA25B_PWMC0_PWMH2 (1u << 25) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PB4B_PWMC0_PWMH2 (1u << 4) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PC19B_PWMC0_PWMH2 (1u << 19) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PD22A_PWMC0_PWMH2 (1u << 22) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PA7B_PWMC0_PWMH3 (1u << 7) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PA14B_PWMC0_PWMH3 (1u << 14) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PA17C_PWMC0_PWMH3 (1u << 17) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PC13B_PWMC0_PWMH3 (1u << 13) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PC21B_PWMC0_PWMH3 (1u << 21) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PD23A_PWMC0_PWMH3 (1u << 23) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PA1A_PWMC0_PWML0 (1u << 1) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PA19B_PWMC0_PWML0 (1u << 19) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PB5B_PWMC0_PWML0 (1u << 5) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PC0B_PWMC0_PWML0 (1u << 0) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PD10B_PWMC0_PWML0 (1u << 10) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PD24A_PWMC0_PWML0 (1u << 24) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PA20B_PWMC0_PWML1 (1u << 20) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PB12A_PWMC0_PWML1 (1u << 12) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PC1B_PWMC0_PWML1 (1u << 1) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PC18B_PWMC0_PWML1 (1u << 18) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PD25A_PWMC0_PWML1 (1u << 25) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PA16C_PWMC0_PWML2 (1u << 16) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PA30A_PWMC0_PWML2 (1u << 30) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PB13A_PWMC0_PWML2 (1u << 13) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PC2B_PWMC0_PWML2 (1u << 2) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PC20B_PWMC0_PWML2 (1u << 20) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PD26A_PWMC0_PWML2 (1u << 26) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PA15C_PWMC0_PWML3 (1u << 15) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -#define PIO_PC3B_PWMC0_PWML3 (1u << 3) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -#define PIO_PC15B_PWMC0_PWML3 (1u << 15) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -#define PIO_PC22B_PWMC0_PWML3 (1u << 22) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -#define PIO_PD27A_PWMC0_PWML3 (1u << 27) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -/* ========== Pio definition for PWM1 peripheral ========== */ -#define PIO_PA30B_PWMC1_PWMEXTRG0 (1u << 30) /**< \brief Pwm1 signal: PWMC1_PWMEXTRG0 */ -#define PIO_PA18A_PWMC1_PWMEXTRG1 (1u << 18) /**< \brief Pwm1 signal: PWMC1_PWMEXTRG1 */ -#define PIO_PA21C_PWMC1_PWMFI0 (1u << 21) /**< \brief Pwm1 signal: PWMC1_PWMFI0 */ -#define PIO_PA26D_PWMC1_PWMFI1 (1u << 26) /**< \brief Pwm1 signal: PWMC1_PWMFI1 */ -#define PIO_PA28D_PWMC1_PWMFI2 (1u << 28) /**< \brief Pwm1 signal: PWMC1_PWMFI2 */ -#define PIO_PA12C_PWMC1_PWMH0 (1u << 12) /**< \brief Pwm1 signal: PWMC1_PWMH0 */ -#define PIO_PD1B_PWMC1_PWMH0 (1u << 1) /**< \brief Pwm1 signal: PWMC1_PWMH0 */ -#define PIO_PA14C_PWMC1_PWMH1 (1u << 14) /**< \brief Pwm1 signal: PWMC1_PWMH1 */ -#define PIO_PD3B_PWMC1_PWMH1 (1u << 3) /**< \brief Pwm1 signal: PWMC1_PWMH1 */ -#define PIO_PA31D_PWMC1_PWMH2 (1u << 31) /**< \brief Pwm1 signal: PWMC1_PWMH2 */ -#define PIO_PD5B_PWMC1_PWMH2 (1u << 5) /**< \brief Pwm1 signal: PWMC1_PWMH2 */ -#define PIO_PA8A_PWMC1_PWMH3 (1u << 8) /**< \brief Pwm1 signal: PWMC1_PWMH3 */ -#define PIO_PD7B_PWMC1_PWMH3 (1u << 7) /**< \brief Pwm1 signal: PWMC1_PWMH3 */ -#define PIO_PA11C_PWMC1_PWML0 (1u << 11) /**< \brief Pwm1 signal: PWMC1_PWML0 */ -#define PIO_PD0B_PWMC1_PWML0 (1u << 0) /**< \brief Pwm1 signal: PWMC1_PWML0 */ -#define PIO_PA13C_PWMC1_PWML1 (1u << 13) /**< \brief Pwm1 signal: PWMC1_PWML1 */ -#define PIO_PD2B_PWMC1_PWML1 (1u << 2) /**< \brief Pwm1 signal: PWMC1_PWML1 */ -#define PIO_PA23D_PWMC1_PWML2 (1u << 23) /**< \brief Pwm1 signal: PWMC1_PWML2 */ -#define PIO_PD4B_PWMC1_PWML2 (1u << 4) /**< \brief Pwm1 signal: PWMC1_PWML2 */ -#define PIO_PA5A_PWMC1_PWML3 (1u << 5) /**< \brief Pwm1 signal: PWMC1_PWML3 */ -#define PIO_PD6B_PWMC1_PWML3 (1u << 6) /**< \brief Pwm1 signal: PWMC1_PWML3 */ -/* ========== Pio definition for QSPI peripheral ========== */ -#define PIO_PA11A_QCS (1u << 11) /**< \brief Qspi signal: QCS */ -#define PIO_PA13A_QIO0 (1u << 13) /**< \brief Qspi signal: QIO0 */ -#define PIO_PA12A_QIO1 (1u << 12) /**< \brief Qspi signal: QIO1 */ -#define PIO_PA17A_QIO2 (1u << 17) /**< \brief Qspi signal: QIO2 */ -#define PIO_PD31A_QIO3 (1u << 31) /**< \brief Qspi signal: QIO3 */ -#define PIO_PA14A_QSCK (1u << 14) /**< \brief Qspi signal: QSCK */ -/* ========== Pio definition for SPI0 peripheral ========== */ -#define PIO_PD20B_SPI0_MISO (1u << 20) /**< \brief Spi0 signal: SPI0_MISO */ -#define PIO_PD21B_SPI0_MOSI (1u << 21) /**< \brief Spi0 signal: SPI0_MOSI */ -#define PIO_PB2D_SPI0_NPCS0 (1u << 2) /**< \brief Spi0 signal: SPI0_NPCS0 */ -#define PIO_PA31A_SPI0_NPCS1 (1u << 31) /**< \brief Spi0 signal: SPI0_NPCS1 */ -#define PIO_PD25B_SPI0_NPCS1 (1u << 25) /**< \brief Spi0 signal: SPI0_NPCS1 */ -#define PIO_PD12C_SPI0_NPCS2 (1u << 12) /**< \brief Spi0 signal: SPI0_NPCS2 */ -#define PIO_PD27B_SPI0_NPCS3 (1u << 27) /**< \brief Spi0 signal: SPI0_NPCS3 */ -#define PIO_PD22B_SPI0_SPCK (1u << 22) /**< \brief Spi0 signal: SPI0_SPCK */ -/* ========== Pio definition for SPI1 peripheral ========== */ -#define PIO_PC26C_SPI1_MISO (1u << 26) /**< \brief Spi1 signal: SPI1_MISO */ -#define PIO_PC27C_SPI1_MOSI (1u << 27) /**< \brief Spi1 signal: SPI1_MOSI */ -#define PIO_PC25C_SPI1_NPCS0 (1u << 25) /**< \brief Spi1 signal: SPI1_NPCS0 */ -#define PIO_PC28C_SPI1_NPCS1 (1u << 28) /**< \brief Spi1 signal: SPI1_NPCS1 */ -#define PIO_PD0C_SPI1_NPCS1 (1u << 0) /**< \brief Spi1 signal: SPI1_NPCS1 */ -#define PIO_PC29C_SPI1_NPCS2 (1u << 29) /**< \brief Spi1 signal: SPI1_NPCS2 */ -#define PIO_PD1C_SPI1_NPCS2 (1u << 1) /**< \brief Spi1 signal: SPI1_NPCS2 */ -#define PIO_PC30C_SPI1_NPCS3 (1u << 30) /**< \brief Spi1 signal: SPI1_NPCS3 */ -#define PIO_PD2C_SPI1_NPCS3 (1u << 2) /**< \brief Spi1 signal: SPI1_NPCS3 */ -#define PIO_PC24C_SPI1_SPCK (1u << 24) /**< \brief Spi1 signal: SPI1_SPCK */ -/* ========== Pio definition for SSC peripheral ========== */ -#define PIO_PA10C_RD (1u << 10) /**< \brief Ssc signal: RD */ -#define PIO_PD24B_RF (1u << 24) /**< \brief Ssc signal: RF */ -#define PIO_PA22A_RK (1u << 22) /**< \brief Ssc signal: RK */ -#define PIO_PB5D_TD (1u << 5) /**< \brief Ssc signal: TD */ -#define PIO_PD10C_TD (1u << 10) /**< \brief Ssc signal: TD */ -#define PIO_PD26B_TD (1u << 26) /**< \brief Ssc signal: TD */ -#define PIO_PB0D_TF (1u << 0) /**< \brief Ssc signal: TF */ -#define PIO_PB1D_TK (1u << 1) /**< \brief Ssc signal: TK */ -/* ========== Pio definition for TC0 peripheral ========== */ -#define PIO_PA4B_TCLK0 (1u << 4) /**< \brief Tc0 signal: TCLK0 */ -#define PIO_PA28B_TCLK1 (1u << 28) /**< \brief Tc0 signal: TCLK1 */ -#define PIO_PA29B_TCLK2 (1u << 29) /**< \brief Tc0 signal: TCLK2 */ -#define PIO_PA0B_TIOA0 (1u << 0) /**< \brief Tc0 signal: TIOA0 */ -#define PIO_PA15B_TIOA1 (1u << 15) /**< \brief Tc0 signal: TIOA1 */ -#define PIO_PA26B_TIOA2 (1u << 26) /**< \brief Tc0 signal: TIOA2 */ -#define PIO_PA1B_TIOB0 (1u << 1) /**< \brief Tc0 signal: TIOB0 */ -#define PIO_PA16B_TIOB1 (1u << 16) /**< \brief Tc0 signal: TIOB1 */ -#define PIO_PA27B_TIOB2 (1u << 27) /**< \brief Tc0 signal: TIOB2 */ -/* ========== Pio definition for TC3 peripheral ========== */ -#define PIO_PE5B_TCLK10 (1u << 5) /**< \brief Tc3 signal: TCLK10 */ -#define PIO_PD24C_TCLK11 (1u << 24) /**< \brief Tc3 signal: TCLK11 */ -#define PIO_PE2B_TCLK9 (1u << 2) /**< \brief Tc3 signal: TCLK9 */ -#define PIO_PE3B_TIOA10 (1u << 3) /**< \brief Tc3 signal: TIOA10 */ -#define PIO_PD21C_TIOA11 (1u << 21) /**< \brief Tc3 signal: TIOA11 */ -#define PIO_PE0B_TIOA9 (1u << 0) /**< \brief Tc3 signal: TIOA9 */ -#define PIO_PE4B_TIOB10 (1u << 4) /**< \brief Tc3 signal: TIOB10 */ -#define PIO_PD22C_TIOB11 (1u << 22) /**< \brief Tc3 signal: TIOB11 */ -#define PIO_PE1B_TIOB9 (1u << 1) /**< \brief Tc3 signal: TIOB9 */ -/* ========== Pio definition for TWIHS0 peripheral ========== */ -#define PIO_PA4A_TWCK0 (1u << 4) /**< \brief Twihs0 signal: TWCK0 */ -#define PIO_PA3A_TWD0 (1u << 3) /**< \brief Twihs0 signal: TWD0 */ -/* ========== Pio definition for TWIHS1 peripheral ========== */ -#define PIO_PB5A_TWCK1 (1u << 5) /**< \brief Twihs1 signal: TWCK1 */ -#define PIO_PB4A_TWD1 (1u << 4) /**< \brief Twihs1 signal: TWD1 */ -/* ========== Pio definition for UART0 peripheral ========== */ -#define PIO_PA9A_URXD0 (1u << 9) /**< \brief Uart0 signal: URXD0 */ -#define PIO_PA10A_UTXD0 (1u << 10) /**< \brief Uart0 signal: UTXD0 */ -/* ========== Pio definition for UART1 peripheral ========== */ -#define PIO_PA5C_URXD1 (1u << 5) /**< \brief Uart1 signal: URXD1 */ -#define PIO_PA4C_UTXD1 (1u << 4) /**< \brief Uart1 signal: UTXD1 */ -#define PIO_PA6C_UTXD1 (1u << 6) /**< \brief Uart1 signal: UTXD1 */ -#define PIO_PD26D_UTXD1 (1u << 26) /**< \brief Uart1 signal: UTXD1 */ -/* ========== Pio definition for UART2 peripheral ========== */ -#define PIO_PD25C_URXD2 (1u << 25) /**< \brief Uart2 signal: URXD2 */ -#define PIO_PD26C_UTXD2 (1u << 26) /**< \brief Uart2 signal: UTXD2 */ -/* ========== Pio definition for UART3 peripheral ========== */ -#define PIO_PD28A_URXD3 (1u << 28) /**< \brief Uart3 signal: URXD3 */ -#define PIO_PD30A_UTXD3 (1u << 30) /**< \brief Uart3 signal: UTXD3 */ -#define PIO_PD31B_UTXD3 (1u << 31) /**< \brief Uart3 signal: UTXD3 */ -/* ========== Pio definition for UART4 peripheral ========== */ -#define PIO_PD18C_URXD4 (1u << 18) /**< \brief Uart4 signal: URXD4 */ -#define PIO_PD3C_UTXD4 (1u << 3) /**< \brief Uart4 signal: UTXD4 */ -#define PIO_PD19C_UTXD4 (1u << 19) /**< \brief Uart4 signal: UTXD4 */ -/* ========== Pio definition for USART0 peripheral ========== */ -#define PIO_PB2C_CTS0 (1u << 2) /**< \brief Usart0 signal: CTS0 */ -#define PIO_PD0D_DCD0 (1u << 0) /**< \brief Usart0 signal: DCD0 */ -#define PIO_PD2D_DSR0 (1u << 2) /**< \brief Usart0 signal: DSR0 */ -#define PIO_PD1D_DTR0 (1u << 1) /**< \brief Usart0 signal: DTR0 */ -#define PIO_PD3D_RI0 (1u << 3) /**< \brief Usart0 signal: RI0 */ -#define PIO_PB3C_RTS0 (1u << 3) /**< \brief Usart0 signal: RTS0 */ -#define PIO_PB0C_RXD0 (1u << 0) /**< \brief Usart0 signal: RXD0 */ -#define PIO_PB13C_SCK0 (1u << 13) /**< \brief Usart0 signal: SCK0 */ -#define PIO_PB1C_TXD0 (1u << 1) /**< \brief Usart0 signal: TXD0 */ -/* ========== Pio definition for USART1 peripheral ========== */ -#define PIO_PA25A_CTS1 (1u << 25) /**< \brief Usart1 signal: CTS1 */ -#define PIO_PA26A_DCD1 (1u << 26) /**< \brief Usart1 signal: DCD1 */ -#define PIO_PA28A_DSR1 (1u << 28) /**< \brief Usart1 signal: DSR1 */ -#define PIO_PA27A_DTR1 (1u << 27) /**< \brief Usart1 signal: DTR1 */ -#define PIO_PA3B_LONCOL1 (1u << 3) /**< \brief Usart1 signal: LONCOL1 */ -#define PIO_PA29A_RI1 (1u << 29) /**< \brief Usart1 signal: RI1 */ -#define PIO_PA24A_RTS1 (1u << 24) /**< \brief Usart1 signal: RTS1 */ -#define PIO_PA21A_RXD1 (1u << 21) /**< \brief Usart1 signal: RXD1 */ -#define PIO_PA23A_SCK1 (1u << 23) /**< \brief Usart1 signal: SCK1 */ -#define PIO_PB4D_TXD1 (1u << 4) /**< \brief Usart1 signal: TXD1 */ -/* ========== Pio definition for USART2 peripheral ========== */ -#define PIO_PD19B_CTS2 (1u << 19) /**< \brief Usart2 signal: CTS2 */ -#define PIO_PD4D_DCD2 (1u << 4) /**< \brief Usart2 signal: DCD2 */ -#define PIO_PD6D_DSR2 (1u << 6) /**< \brief Usart2 signal: DSR2 */ -#define PIO_PD5D_DTR2 (1u << 5) /**< \brief Usart2 signal: DTR2 */ -#define PIO_PD7D_RI2 (1u << 7) /**< \brief Usart2 signal: RI2 */ -#define PIO_PD18B_RTS2 (1u << 18) /**< \brief Usart2 signal: RTS2 */ -#define PIO_PD15B_RXD2 (1u << 15) /**< \brief Usart2 signal: RXD2 */ -#define PIO_PD17B_SCK2 (1u << 17) /**< \brief Usart2 signal: SCK2 */ -#define PIO_PD16B_TXD2 (1u << 16) /**< \brief Usart2 signal: TXD2 */ -/* ========== Pio indexes ========== */ -#define PIO_PA3_IDX 3 -#define PIO_PA4_IDX 4 -#define PIO_PA5_IDX 5 -#define PIO_PA7_IDX 7 -#define PIO_PA8_IDX 8 -#define PIO_PA9_IDX 9 -#define PIO_PA10_IDX 10 -#define PIO_PA11_IDX 11 -#define PIO_PA12_IDX 12 -#define PIO_PA13_IDX 13 -#define PIO_PA14_IDX 14 -#define PIO_PA21_IDX 21 -#define PIO_PA22_IDX 22 -#define PIO_PA24_IDX 24 -#define PIO_PA27_IDX 27 -#define PIO_PB0_IDX 32 -#define PIO_PB1_IDX 33 -#define PIO_PB2_IDX 34 -#define PIO_PB3_IDX 35 -#define PIO_PB4_IDX 36 -#define PIO_PB5_IDX 37 -#define PIO_PB6_IDX 38 -#define PIO_PB7_IDX 39 -#define PIO_PB8_IDX 40 -#define PIO_PB9_IDX 41 -#define PIO_PB12_IDX 44 -#define PIO_PD0_IDX 96 -#define PIO_PD1_IDX 97 -#define PIO_PD2_IDX 98 -#define PIO_PD3_IDX 99 -#define PIO_PD4_IDX 100 -#define PIO_PD5_IDX 101 -#define PIO_PD6_IDX 102 -#define PIO_PD7_IDX 103 -#define PIO_PD8_IDX 104 -#define PIO_PD9_IDX 105 -#define PIO_PD10_IDX 106 -#define PIO_PD11_IDX 107 -#define PIO_PD12_IDX 108 -#define PIO_PD21_IDX 117 -#define PIO_PD22_IDX 118 -#define PIO_PD24_IDX 120 -#define PIO_PD25_IDX 121 -#define PIO_PD26_IDX 122 -#define PIO_PD31_IDX 127 - -#endif /* _SAMV71J20_PIO_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/pio/pio_samv71j21.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/pio/pio_samv71j21.h deleted file mode 100644 index 277e631f..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/pio/pio_samv71j21.h +++ /dev/null @@ -1,442 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71J21_PIO_ -#define _SAMV71J21_PIO_ - -#define PIO_PA3 (1u << 3) /**< \brief Pin Controlled by PA3 */ -#define PIO_PA4 (1u << 4) /**< \brief Pin Controlled by PA4 */ -#define PIO_PA5 (1u << 5) /**< \brief Pin Controlled by PA5 */ -#define PIO_PA7 (1u << 7) /**< \brief Pin Controlled by PA7 */ -#define PIO_PA8 (1u << 8) /**< \brief Pin Controlled by PA8 */ -#define PIO_PA9 (1u << 9) /**< \brief Pin Controlled by PA9 */ -#define PIO_PA10 (1u << 10) /**< \brief Pin Controlled by PA10 */ -#define PIO_PA11 (1u << 11) /**< \brief Pin Controlled by PA11 */ -#define PIO_PA12 (1u << 12) /**< \brief Pin Controlled by PA12 */ -#define PIO_PA13 (1u << 13) /**< \brief Pin Controlled by PA13 */ -#define PIO_PA14 (1u << 14) /**< \brief Pin Controlled by PA14 */ -#define PIO_PA21 (1u << 21) /**< \brief Pin Controlled by PA21 */ -#define PIO_PA22 (1u << 22) /**< \brief Pin Controlled by PA22 */ -#define PIO_PA24 (1u << 24) /**< \brief Pin Controlled by PA24 */ -#define PIO_PA27 (1u << 27) /**< \brief Pin Controlled by PA27 */ -#define PIO_PB0 (1u << 0) /**< \brief Pin Controlled by PB0 */ -#define PIO_PB1 (1u << 1) /**< \brief Pin Controlled by PB1 */ -#define PIO_PB2 (1u << 2) /**< \brief Pin Controlled by PB2 */ -#define PIO_PB3 (1u << 3) /**< \brief Pin Controlled by PB3 */ -#define PIO_PB4 (1u << 4) /**< \brief Pin Controlled by PB4 */ -#define PIO_PB5 (1u << 5) /**< \brief Pin Controlled by PB5 */ -#define PIO_PB6 (1u << 6) /**< \brief Pin Controlled by PB6 */ -#define PIO_PB7 (1u << 7) /**< \brief Pin Controlled by PB7 */ -#define PIO_PB8 (1u << 8) /**< \brief Pin Controlled by PB8 */ -#define PIO_PB9 (1u << 9) /**< \brief Pin Controlled by PB9 */ -#define PIO_PB12 (1u << 12) /**< \brief Pin Controlled by PB12 */ -#define PIO_PD0 (1u << 0) /**< \brief Pin Controlled by PD0 */ -#define PIO_PD1 (1u << 1) /**< \brief Pin Controlled by PD1 */ -#define PIO_PD2 (1u << 2) /**< \brief Pin Controlled by PD2 */ -#define PIO_PD3 (1u << 3) /**< \brief Pin Controlled by PD3 */ -#define PIO_PD4 (1u << 4) /**< \brief Pin Controlled by PD4 */ -#define PIO_PD5 (1u << 5) /**< \brief Pin Controlled by PD5 */ -#define PIO_PD6 (1u << 6) /**< \brief Pin Controlled by PD6 */ -#define PIO_PD7 (1u << 7) /**< \brief Pin Controlled by PD7 */ -#define PIO_PD8 (1u << 8) /**< \brief Pin Controlled by PD8 */ -#define PIO_PD9 (1u << 9) /**< \brief Pin Controlled by PD9 */ -#define PIO_PD10 (1u << 10) /**< \brief Pin Controlled by PD10 */ -#define PIO_PD11 (1u << 11) /**< \brief Pin Controlled by PD11 */ -#define PIO_PD12 (1u << 12) /**< \brief Pin Controlled by PD12 */ -#define PIO_PD21 (1u << 21) /**< \brief Pin Controlled by PD21 */ -#define PIO_PD22 (1u << 22) /**< \brief Pin Controlled by PD22 */ -#define PIO_PD24 (1u << 24) /**< \brief Pin Controlled by PD24 */ -#define PIO_PD25 (1u << 25) /**< \brief Pin Controlled by PD25 */ -#define PIO_PD26 (1u << 26) /**< \brief Pin Controlled by PD26 */ -#define PIO_PD31 (1u << 31) /**< \brief Pin Controlled by PD31 */ -/* ========== Pio definition for AFEC0 peripheral ========== */ -#define PIO_PD30X1_AFE0_AD0 (1u << 30) /**< \brief Afec0 signal: AFE0_AD0 */ -#define PIO_PA21X1_AFE0_AD1 (1u << 21) /**< \brief Afec0 signal: AFE0_AD1/PIODCEN2 */ -#define PIO_PA21X1_PIODCEN2 (1u << 21) /**< \brief Afec0 signal: AFE0_AD1/PIODCEN2 */ -#define PIO_PB0X1_AFE0_AD10 (1u << 0) /**< \brief Afec0 signal: AFE0_AD10/RTCOUT0 */ -#define PIO_PB0X1_RTCOUT0 (1u << 0) /**< \brief Afec0 signal: AFE0_AD10/RTCOUT0 */ -#define PIO_PB3X1_AFE0_AD2 (1u << 3) /**< \brief Afec0 signal: AFE0_AD2/WKUP12 */ -#define PIO_PB3X1_WKUP12 (1u << 3) /**< \brief Afec0 signal: AFE0_AD2/WKUP12 */ -#define PIO_PE5X1_AFE0_AD3 (1u << 5) /**< \brief Afec0 signal: AFE0_AD3 */ -#define PIO_PE4X1_AFE0_AD4 (1u << 4) /**< \brief Afec0 signal: AFE0_AD4 */ -#define PIO_PB2X1_AFE0_AD5 (1u << 2) /**< \brief Afec0 signal: AFE0_AD5 */ -#define PIO_PA17X1_AFE0_AD6 (1u << 17) /**< \brief Afec0 signal: AFE0_AD6 */ -#define PIO_PA18X1_AFE0_AD7 (1u << 18) /**< \brief Afec0 signal: AFE0_AD7 */ -#define PIO_PA19X1_AFE0_AD8 (1u << 19) /**< \brief Afec0 signal: AFE0_AD8/WKUP9 */ -#define PIO_PA19X1_WKUP9 (1u << 19) /**< \brief Afec0 signal: AFE0_AD8/WKUP9 */ -#define PIO_PA20X1_AFE0_AD9 (1u << 20) /**< \brief Afec0 signal: AFE0_AD9/WKUP10 */ -#define PIO_PA20X1_WKUP10 (1u << 20) /**< \brief Afec0 signal: AFE0_AD9/WKUP10 */ -#define PIO_PA8B_AFE0_ADTRG (1u << 8) /**< \brief Afec0 signal: AFE0_ADTRG */ -/* ========== Pio definition for AFEC1 peripheral ========== */ -#define PIO_PB1X1_AFE1_AD0 (1u << 1) /**< \brief Afec1 signal: AFE1_AD0/RTCOUT1 */ -#define PIO_PB1X1_RTCOUT1 (1u << 1) /**< \brief Afec1 signal: AFE1_AD0/RTCOUT1 */ -#define PIO_PC13X1_AFE1_AD1 (1u << 13) /**< \brief Afec1 signal: AFE1_AD1 */ -#define PIO_PE3X1_AFE1_AD10 (1u << 3) /**< \brief Afec1 signal: AFE1_AD10 */ -#define PIO_PE0X1_AFE1_AD11 (1u << 0) /**< \brief Afec1 signal: AFE1_AD11 */ -#define PIO_PC15X1_AFE1_AD2 (1u << 15) /**< \brief Afec1 signal: AFE1_AD2 */ -#define PIO_PC12X1_AFE1_AD3 (1u << 12) /**< \brief Afec1 signal: AFE1_AD3 */ -#define PIO_PC29X1_AFE1_AD4 (1u << 29) /**< \brief Afec1 signal: AFE1_AD4 */ -#define PIO_PC30X1_AFE1_AD5 (1u << 30) /**< \brief Afec1 signal: AFE1_AD5 */ -#define PIO_PC31X1_AFE1_AD6 (1u << 31) /**< \brief Afec1 signal: AFE1_AD6 */ -#define PIO_PC26X1_AFE1_AD7 (1u << 26) /**< \brief Afec1 signal: AFE1_AD7 */ -#define PIO_PC27X1_AFE1_AD8 (1u << 27) /**< \brief Afec1 signal: AFE1_AD8 */ -#define PIO_PC0X1_AFE1_AD9 (1u << 0) /**< \brief Afec1 signal: AFE1_AD9 */ -#define PIO_PD9C_AFE1_ADTRG (1u << 9) /**< \brief Afec1 signal: AFE1_ADTRG */ -/* ========== Pio definition for ARM peripheral ========== */ -#define PIO_PB7X1_SWCLK (1u << 7) /**< \brief Arm signal: SWCLK/TCK */ -#define PIO_PB7X1_TCK (1u << 7) /**< \brief Arm signal: SWCLK/TCK */ -#define PIO_PB6X1_SWDIO (1u << 6) /**< \brief Arm signal: SWDIO/TMS */ -#define PIO_PB6X1_TMS (1u << 6) /**< \brief Arm signal: SWDIO/TMS */ -#define PIO_PB4X1_TDI (1u << 4) /**< \brief Arm signal: TDI */ -#define PIO_PB5X1_TDO (1u << 5) /**< \brief Arm signal: TDO/TRACESWO/WKUP13 */ -#define PIO_PB5X1_TRACESWO (1u << 5) /**< \brief Arm signal: TDO/TRACESWO/WKUP13 */ -#define PIO_PB5X1_WKUP13 (1u << 5) /**< \brief Arm signal: TDO/TRACESWO/WKUP13 */ -/* ========== Pio definition for DACC peripheral ========== */ -#define PIO_PB13X1_DAC0 (1u << 13) /**< \brief Dacc signal: DAC0 */ -#define PIO_PD0X1_DAC1 (1u << 0) /**< \brief Dacc signal: DAC1 */ -#define PIO_PA2C_DATRG (1u << 2) /**< \brief Dacc signal: DATRG */ -/* ========== Pio definition for GMAC peripheral ========== */ -#define PIO_PD13A_GCOL (1u << 13) /**< \brief Gmac signal: GCOL */ -#define PIO_PD10A_GCRS (1u << 10) /**< \brief Gmac signal: GCRS */ -#define PIO_PD8A_GMDC (1u << 8) /**< \brief Gmac signal: GMDC */ -#define PIO_PD9A_GMDIO (1u << 9) /**< \brief Gmac signal: GMDIO */ -#define PIO_PD5A_GRX0 (1u << 5) /**< \brief Gmac signal: GRX0 */ -#define PIO_PD6A_GRX1 (1u << 6) /**< \brief Gmac signal: GRX1 */ -#define PIO_PD11A_GRX2 (1u << 11) /**< \brief Gmac signal: GRX2 */ -#define PIO_PD12A_GRX3 (1u << 12) /**< \brief Gmac signal: GRX3 */ -#define PIO_PD14A_GRXCK (1u << 14) /**< \brief Gmac signal: GRXCK */ -#define PIO_PD4A_GRXDV (1u << 4) /**< \brief Gmac signal: GRXDV */ -#define PIO_PD7A_GRXER (1u << 7) /**< \brief Gmac signal: GRXER */ -#define PIO_PB1B_GTSUCOMP (1u << 1) /**< \brief Gmac signal: GTSUCOMP */ -#define PIO_PB12B_GTSUCOMP (1u << 12) /**< \brief Gmac signal: GTSUCOMP */ -#define PIO_PD11C_GTSUCOMP (1u << 11) /**< \brief Gmac signal: GTSUCOMP */ -#define PIO_PD20C_GTSUCOMP (1u << 20) /**< \brief Gmac signal: GTSUCOMP */ -#define PIO_PD2A_GTX0 (1u << 2) /**< \brief Gmac signal: GTX0 */ -#define PIO_PD3A_GTX1 (1u << 3) /**< \brief Gmac signal: GTX1 */ -#define PIO_PD15A_GTX2 (1u << 15) /**< \brief Gmac signal: GTX2 */ -#define PIO_PD16A_GTX3 (1u << 16) /**< \brief Gmac signal: GTX3 */ -#define PIO_PD0A_GTXCK (1u << 0) /**< \brief Gmac signal: GTXCK */ -#define PIO_PD1A_GTXEN (1u << 1) /**< \brief Gmac signal: GTXEN */ -#define PIO_PD17A_GTXER (1u << 17) /**< \brief Gmac signal: GTXER */ -/* ========== Pio definition for HSMCI peripheral ========== */ -#define PIO_PA28C_MCCDA (1u << 28) /**< \brief Hsmci signal: MCCDA */ -#define PIO_PA25D_MCCK (1u << 25) /**< \brief Hsmci signal: MCCK */ -#define PIO_PA30C_MCDA0 (1u << 30) /**< \brief Hsmci signal: MCDA0 */ -#define PIO_PA31C_MCDA1 (1u << 31) /**< \brief Hsmci signal: MCDA1 */ -#define PIO_PA26C_MCDA2 (1u << 26) /**< \brief Hsmci signal: MCDA2 */ -#define PIO_PA27C_MCDA3 (1u << 27) /**< \brief Hsmci signal: MCDA3 */ -/* ========== Pio definition for ISI peripheral ========== */ -#define PIO_PD22D_ISI_D0 (1u << 22) /**< \brief Isi signal: ISI_D0 */ -#define PIO_PD21D_ISI_D1 (1u << 21) /**< \brief Isi signal: ISI_D1 */ -#define PIO_PD30D_ISI_D10 (1u << 30) /**< \brief Isi signal: ISI_D10 */ -#define PIO_PD31D_ISI_D11 (1u << 31) /**< \brief Isi signal: ISI_D11 */ -#define PIO_PB3D_ISI_D2 (1u << 3) /**< \brief Isi signal: ISI_D2 */ -#define PIO_PA9B_ISI_D3 (1u << 9) /**< \brief Isi signal: ISI_D3 */ -#define PIO_PA5B_ISI_D4 (1u << 5) /**< \brief Isi signal: ISI_D4 */ -#define PIO_PD11D_ISI_D5 (1u << 11) /**< \brief Isi signal: ISI_D5 */ -#define PIO_PD12D_ISI_D6 (1u << 12) /**< \brief Isi signal: ISI_D6 */ -#define PIO_PA27D_ISI_D7 (1u << 27) /**< \brief Isi signal: ISI_D7 */ -#define PIO_PD27D_ISI_D8 (1u << 27) /**< \brief Isi signal: ISI_D8 */ -#define PIO_PD28D_ISI_D9 (1u << 28) /**< \brief Isi signal: ISI_D9 */ -#define PIO_PD24D_ISI_HSYNC (1u << 24) /**< \brief Isi signal: ISI_HSYNC */ -#define PIO_PA24D_ISI_PCK (1u << 24) /**< \brief Isi signal: ISI_PCK */ -#define PIO_PD25D_ISI_VSYNC (1u << 25) /**< \brief Isi signal: ISI_VSYNC */ -/* ========== Pio definition for MCAN0 peripheral ========== */ -#define PIO_PB3A_CANRX0 (1u << 3) /**< \brief Mcan0 signal: CANRX0 */ -#define PIO_PB2A_CANTX0 (1u << 2) /**< \brief Mcan0 signal: CANTX0 */ -/* ========== Pio definition for MCAN1 peripheral ========== */ -#define PIO_PC12C_CANRX1 (1u << 12) /**< \brief Mcan1 signal: CANRX1 */ -#define PIO_PD28B_CANRX1 (1u << 28) /**< \brief Mcan1 signal: CANRX1 */ -#define PIO_PC14C_CANTX1 (1u << 14) /**< \brief Mcan1 signal: CANTX1 */ -#define PIO_PD12B_CANTX1 (1u << 12) /**< \brief Mcan1 signal: CANTX1 */ -/* ========== Pio definition for MLB peripheral ========== */ -#define PIO_PB4C_MLBCLK (1u << 4) /**< \brief Mlb signal: MLBCLK */ -#define PIO_PB5C_MLBDAT (1u << 5) /**< \brief Mlb signal: MLBDAT */ -#define PIO_PD10D_MLBSIG (1u << 10) /**< \brief Mlb signal: MLBSIG */ -/* ========== Pio definition for PIOA peripheral ========== */ -#define PIO_PA21X1_AFE0_AD1 (1u << 21) /**< \brief Pioa signal: AFE0_AD1/PIODCEN2 */ -#define PIO_PA21X1_PIODCEN2 (1u << 21) /**< \brief Pioa signal: AFE0_AD1/PIODCEN2 */ -#define PIO_PA3X1_PIODC0 (1u << 3) /**< \brief Pioa signal: PIODC0 */ -#define PIO_PA10X1_PIODC4 (1u << 10) /**< \brief Pioa signal: PIODC4 */ -#define PIO_PA12X1_PIODC6 (1u << 12) /**< \brief Pioa signal: PIODC6 */ -#define PIO_PA13X1_PIODC7 (1u << 13) /**< \brief Pioa signal: PIODC7 */ -#define PIO_PA22X1_PIODCCLK (1u << 22) /**< \brief Pioa signal: PIODCCLK */ -#define PIO_PA4X1_WKUP3 (1u << 4) /**< \brief Pioa signal: WKUP3/PIODC1 */ -#define PIO_PA4X1_PIODC1 (1u << 4) /**< \brief Pioa signal: WKUP3/PIODC1 */ -#define PIO_PA5X1_WKUP4 (1u << 5) /**< \brief Pioa signal: WKUP4/PIODC2 */ -#define PIO_PA5X1_PIODC2 (1u << 5) /**< \brief Pioa signal: WKUP4/PIODC2 */ -#define PIO_PA9X1_WKUP6 (1u << 9) /**< \brief Pioa signal: WKUP6/PIODC3 */ -#define PIO_PA9X1_PIODC3 (1u << 9) /**< \brief Pioa signal: WKUP6/PIODC3 */ -#define PIO_PA11X1_WKUP7 (1u << 11) /**< \brief Pioa signal: WKUP7/PIODC5 */ -#define PIO_PA11X1_PIODC5 (1u << 11) /**< \brief Pioa signal: WKUP7/PIODC5 */ -#define PIO_PA14X1_WKUP8 (1u << 14) /**< \brief Pioa signal: WKUP8/PIODCEN1 */ -#define PIO_PA14X1_PIODCEN1 (1u << 14) /**< \brief Pioa signal: WKUP8/PIODCEN1 */ -/* ========== Pio definition for PMC peripheral ========== */ -#define PIO_PA6B_PCK0 (1u << 6) /**< \brief Pmc signal: PCK0 */ -#define PIO_PB12D_PCK0 (1u << 12) /**< \brief Pmc signal: PCK0 */ -#define PIO_PB13B_PCK0 (1u << 13) /**< \brief Pmc signal: PCK0 */ -#define PIO_PA17B_PCK1 (1u << 17) /**< \brief Pmc signal: PCK1 */ -#define PIO_PA21B_PCK1 (1u << 21) /**< \brief Pmc signal: PCK1 */ -#define PIO_PA3C_PCK2 (1u << 3) /**< \brief Pmc signal: PCK2 */ -#define PIO_PA18B_PCK2 (1u << 18) /**< \brief Pmc signal: PCK2 */ -#define PIO_PA31B_PCK2 (1u << 31) /**< \brief Pmc signal: PCK2 */ -#define PIO_PB3B_PCK2 (1u << 3) /**< \brief Pmc signal: PCK2 */ -#define PIO_PD31C_PCK2 (1u << 31) /**< \brief Pmc signal: PCK2 */ -/* ========== Pio definition for PWM0 peripheral ========== */ -#define PIO_PA10B_PWMC0_PWMEXTRG0 (1u << 10) /**< \brief Pwm0 signal: PWMC0_PWMEXTRG0 */ -#define PIO_PA22B_PWMC0_PWMEXTRG1 (1u << 22) /**< \brief Pwm0 signal: PWMC0_PWMEXTRG1 */ -#define PIO_PA9C_PWMC0_PWMFI0 (1u << 9) /**< \brief Pwm0 signal: PWMC0_PWMFI0 */ -#define PIO_PD8B_PWMC0_PWMFI1 (1u << 8) /**< \brief Pwm0 signal: PWMC0_PWMFI1 */ -#define PIO_PD9B_PWMC0_PWMFI2 (1u << 9) /**< \brief Pwm0 signal: PWMC0_PWMFI2 */ -#define PIO_PA0A_PWMC0_PWMH0 (1u << 0) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PA11B_PWMC0_PWMH0 (1u << 11) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PA23B_PWMC0_PWMH0 (1u << 23) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PB0A_PWMC0_PWMH0 (1u << 0) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PD11B_PWMC0_PWMH0 (1u << 11) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PD20A_PWMC0_PWMH0 (1u << 20) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PA2A_PWMC0_PWMH1 (1u << 2) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PA12B_PWMC0_PWMH1 (1u << 12) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PA24B_PWMC0_PWMH1 (1u << 24) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PB1A_PWMC0_PWMH1 (1u << 1) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PD21A_PWMC0_PWMH1 (1u << 21) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PA13B_PWMC0_PWMH2 (1u << 13) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PA25B_PWMC0_PWMH2 (1u << 25) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PB4B_PWMC0_PWMH2 (1u << 4) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PC19B_PWMC0_PWMH2 (1u << 19) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PD22A_PWMC0_PWMH2 (1u << 22) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PA7B_PWMC0_PWMH3 (1u << 7) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PA14B_PWMC0_PWMH3 (1u << 14) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PA17C_PWMC0_PWMH3 (1u << 17) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PC13B_PWMC0_PWMH3 (1u << 13) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PC21B_PWMC0_PWMH3 (1u << 21) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PD23A_PWMC0_PWMH3 (1u << 23) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PA1A_PWMC0_PWML0 (1u << 1) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PA19B_PWMC0_PWML0 (1u << 19) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PB5B_PWMC0_PWML0 (1u << 5) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PC0B_PWMC0_PWML0 (1u << 0) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PD10B_PWMC0_PWML0 (1u << 10) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PD24A_PWMC0_PWML0 (1u << 24) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PA20B_PWMC0_PWML1 (1u << 20) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PB12A_PWMC0_PWML1 (1u << 12) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PC1B_PWMC0_PWML1 (1u << 1) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PC18B_PWMC0_PWML1 (1u << 18) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PD25A_PWMC0_PWML1 (1u << 25) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PA16C_PWMC0_PWML2 (1u << 16) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PA30A_PWMC0_PWML2 (1u << 30) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PB13A_PWMC0_PWML2 (1u << 13) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PC2B_PWMC0_PWML2 (1u << 2) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PC20B_PWMC0_PWML2 (1u << 20) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PD26A_PWMC0_PWML2 (1u << 26) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PA15C_PWMC0_PWML3 (1u << 15) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -#define PIO_PC3B_PWMC0_PWML3 (1u << 3) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -#define PIO_PC15B_PWMC0_PWML3 (1u << 15) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -#define PIO_PC22B_PWMC0_PWML3 (1u << 22) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -#define PIO_PD27A_PWMC0_PWML3 (1u << 27) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -/* ========== Pio definition for PWM1 peripheral ========== */ -#define PIO_PA30B_PWMC1_PWMEXTRG0 (1u << 30) /**< \brief Pwm1 signal: PWMC1_PWMEXTRG0 */ -#define PIO_PA18A_PWMC1_PWMEXTRG1 (1u << 18) /**< \brief Pwm1 signal: PWMC1_PWMEXTRG1 */ -#define PIO_PA21C_PWMC1_PWMFI0 (1u << 21) /**< \brief Pwm1 signal: PWMC1_PWMFI0 */ -#define PIO_PA26D_PWMC1_PWMFI1 (1u << 26) /**< \brief Pwm1 signal: PWMC1_PWMFI1 */ -#define PIO_PA28D_PWMC1_PWMFI2 (1u << 28) /**< \brief Pwm1 signal: PWMC1_PWMFI2 */ -#define PIO_PA12C_PWMC1_PWMH0 (1u << 12) /**< \brief Pwm1 signal: PWMC1_PWMH0 */ -#define PIO_PD1B_PWMC1_PWMH0 (1u << 1) /**< \brief Pwm1 signal: PWMC1_PWMH0 */ -#define PIO_PA14C_PWMC1_PWMH1 (1u << 14) /**< \brief Pwm1 signal: PWMC1_PWMH1 */ -#define PIO_PD3B_PWMC1_PWMH1 (1u << 3) /**< \brief Pwm1 signal: PWMC1_PWMH1 */ -#define PIO_PA31D_PWMC1_PWMH2 (1u << 31) /**< \brief Pwm1 signal: PWMC1_PWMH2 */ -#define PIO_PD5B_PWMC1_PWMH2 (1u << 5) /**< \brief Pwm1 signal: PWMC1_PWMH2 */ -#define PIO_PA8A_PWMC1_PWMH3 (1u << 8) /**< \brief Pwm1 signal: PWMC1_PWMH3 */ -#define PIO_PD7B_PWMC1_PWMH3 (1u << 7) /**< \brief Pwm1 signal: PWMC1_PWMH3 */ -#define PIO_PA11C_PWMC1_PWML0 (1u << 11) /**< \brief Pwm1 signal: PWMC1_PWML0 */ -#define PIO_PD0B_PWMC1_PWML0 (1u << 0) /**< \brief Pwm1 signal: PWMC1_PWML0 */ -#define PIO_PA13C_PWMC1_PWML1 (1u << 13) /**< \brief Pwm1 signal: PWMC1_PWML1 */ -#define PIO_PD2B_PWMC1_PWML1 (1u << 2) /**< \brief Pwm1 signal: PWMC1_PWML1 */ -#define PIO_PA23D_PWMC1_PWML2 (1u << 23) /**< \brief Pwm1 signal: PWMC1_PWML2 */ -#define PIO_PD4B_PWMC1_PWML2 (1u << 4) /**< \brief Pwm1 signal: PWMC1_PWML2 */ -#define PIO_PA5A_PWMC1_PWML3 (1u << 5) /**< \brief Pwm1 signal: PWMC1_PWML3 */ -#define PIO_PD6B_PWMC1_PWML3 (1u << 6) /**< \brief Pwm1 signal: PWMC1_PWML3 */ -/* ========== Pio definition for QSPI peripheral ========== */ -#define PIO_PA11A_QCS (1u << 11) /**< \brief Qspi signal: QCS */ -#define PIO_PA13A_QIO0 (1u << 13) /**< \brief Qspi signal: QIO0 */ -#define PIO_PA12A_QIO1 (1u << 12) /**< \brief Qspi signal: QIO1 */ -#define PIO_PA17A_QIO2 (1u << 17) /**< \brief Qspi signal: QIO2 */ -#define PIO_PD31A_QIO3 (1u << 31) /**< \brief Qspi signal: QIO3 */ -#define PIO_PA14A_QSCK (1u << 14) /**< \brief Qspi signal: QSCK */ -/* ========== Pio definition for SPI0 peripheral ========== */ -#define PIO_PD20B_SPI0_MISO (1u << 20) /**< \brief Spi0 signal: SPI0_MISO */ -#define PIO_PD21B_SPI0_MOSI (1u << 21) /**< \brief Spi0 signal: SPI0_MOSI */ -#define PIO_PB2D_SPI0_NPCS0 (1u << 2) /**< \brief Spi0 signal: SPI0_NPCS0 */ -#define PIO_PA31A_SPI0_NPCS1 (1u << 31) /**< \brief Spi0 signal: SPI0_NPCS1 */ -#define PIO_PD25B_SPI0_NPCS1 (1u << 25) /**< \brief Spi0 signal: SPI0_NPCS1 */ -#define PIO_PD12C_SPI0_NPCS2 (1u << 12) /**< \brief Spi0 signal: SPI0_NPCS2 */ -#define PIO_PD27B_SPI0_NPCS3 (1u << 27) /**< \brief Spi0 signal: SPI0_NPCS3 */ -#define PIO_PD22B_SPI0_SPCK (1u << 22) /**< \brief Spi0 signal: SPI0_SPCK */ -/* ========== Pio definition for SPI1 peripheral ========== */ -#define PIO_PC26C_SPI1_MISO (1u << 26) /**< \brief Spi1 signal: SPI1_MISO */ -#define PIO_PC27C_SPI1_MOSI (1u << 27) /**< \brief Spi1 signal: SPI1_MOSI */ -#define PIO_PC25C_SPI1_NPCS0 (1u << 25) /**< \brief Spi1 signal: SPI1_NPCS0 */ -#define PIO_PC28C_SPI1_NPCS1 (1u << 28) /**< \brief Spi1 signal: SPI1_NPCS1 */ -#define PIO_PD0C_SPI1_NPCS1 (1u << 0) /**< \brief Spi1 signal: SPI1_NPCS1 */ -#define PIO_PC29C_SPI1_NPCS2 (1u << 29) /**< \brief Spi1 signal: SPI1_NPCS2 */ -#define PIO_PD1C_SPI1_NPCS2 (1u << 1) /**< \brief Spi1 signal: SPI1_NPCS2 */ -#define PIO_PC30C_SPI1_NPCS3 (1u << 30) /**< \brief Spi1 signal: SPI1_NPCS3 */ -#define PIO_PD2C_SPI1_NPCS3 (1u << 2) /**< \brief Spi1 signal: SPI1_NPCS3 */ -#define PIO_PC24C_SPI1_SPCK (1u << 24) /**< \brief Spi1 signal: SPI1_SPCK */ -/* ========== Pio definition for SSC peripheral ========== */ -#define PIO_PA10C_RD (1u << 10) /**< \brief Ssc signal: RD */ -#define PIO_PD24B_RF (1u << 24) /**< \brief Ssc signal: RF */ -#define PIO_PA22A_RK (1u << 22) /**< \brief Ssc signal: RK */ -#define PIO_PB5D_TD (1u << 5) /**< \brief Ssc signal: TD */ -#define PIO_PD10C_TD (1u << 10) /**< \brief Ssc signal: TD */ -#define PIO_PD26B_TD (1u << 26) /**< \brief Ssc signal: TD */ -#define PIO_PB0D_TF (1u << 0) /**< \brief Ssc signal: TF */ -#define PIO_PB1D_TK (1u << 1) /**< \brief Ssc signal: TK */ -/* ========== Pio definition for TC0 peripheral ========== */ -#define PIO_PA4B_TCLK0 (1u << 4) /**< \brief Tc0 signal: TCLK0 */ -#define PIO_PA28B_TCLK1 (1u << 28) /**< \brief Tc0 signal: TCLK1 */ -#define PIO_PA29B_TCLK2 (1u << 29) /**< \brief Tc0 signal: TCLK2 */ -#define PIO_PA0B_TIOA0 (1u << 0) /**< \brief Tc0 signal: TIOA0 */ -#define PIO_PA15B_TIOA1 (1u << 15) /**< \brief Tc0 signal: TIOA1 */ -#define PIO_PA26B_TIOA2 (1u << 26) /**< \brief Tc0 signal: TIOA2 */ -#define PIO_PA1B_TIOB0 (1u << 1) /**< \brief Tc0 signal: TIOB0 */ -#define PIO_PA16B_TIOB1 (1u << 16) /**< \brief Tc0 signal: TIOB1 */ -#define PIO_PA27B_TIOB2 (1u << 27) /**< \brief Tc0 signal: TIOB2 */ -/* ========== Pio definition for TC3 peripheral ========== */ -#define PIO_PE5B_TCLK10 (1u << 5) /**< \brief Tc3 signal: TCLK10 */ -#define PIO_PD24C_TCLK11 (1u << 24) /**< \brief Tc3 signal: TCLK11 */ -#define PIO_PE2B_TCLK9 (1u << 2) /**< \brief Tc3 signal: TCLK9 */ -#define PIO_PE3B_TIOA10 (1u << 3) /**< \brief Tc3 signal: TIOA10 */ -#define PIO_PD21C_TIOA11 (1u << 21) /**< \brief Tc3 signal: TIOA11 */ -#define PIO_PE0B_TIOA9 (1u << 0) /**< \brief Tc3 signal: TIOA9 */ -#define PIO_PE4B_TIOB10 (1u << 4) /**< \brief Tc3 signal: TIOB10 */ -#define PIO_PD22C_TIOB11 (1u << 22) /**< \brief Tc3 signal: TIOB11 */ -#define PIO_PE1B_TIOB9 (1u << 1) /**< \brief Tc3 signal: TIOB9 */ -/* ========== Pio definition for TWIHS0 peripheral ========== */ -#define PIO_PA4A_TWCK0 (1u << 4) /**< \brief Twihs0 signal: TWCK0 */ -#define PIO_PA3A_TWD0 (1u << 3) /**< \brief Twihs0 signal: TWD0 */ -/* ========== Pio definition for TWIHS1 peripheral ========== */ -#define PIO_PB5A_TWCK1 (1u << 5) /**< \brief Twihs1 signal: TWCK1 */ -#define PIO_PB4A_TWD1 (1u << 4) /**< \brief Twihs1 signal: TWD1 */ -/* ========== Pio definition for UART0 peripheral ========== */ -#define PIO_PA9A_URXD0 (1u << 9) /**< \brief Uart0 signal: URXD0 */ -#define PIO_PA10A_UTXD0 (1u << 10) /**< \brief Uart0 signal: UTXD0 */ -/* ========== Pio definition for UART1 peripheral ========== */ -#define PIO_PA5C_URXD1 (1u << 5) /**< \brief Uart1 signal: URXD1 */ -#define PIO_PA4C_UTXD1 (1u << 4) /**< \brief Uart1 signal: UTXD1 */ -#define PIO_PA6C_UTXD1 (1u << 6) /**< \brief Uart1 signal: UTXD1 */ -#define PIO_PD26D_UTXD1 (1u << 26) /**< \brief Uart1 signal: UTXD1 */ -/* ========== Pio definition for UART2 peripheral ========== */ -#define PIO_PD25C_URXD2 (1u << 25) /**< \brief Uart2 signal: URXD2 */ -#define PIO_PD26C_UTXD2 (1u << 26) /**< \brief Uart2 signal: UTXD2 */ -/* ========== Pio definition for UART3 peripheral ========== */ -#define PIO_PD28A_URXD3 (1u << 28) /**< \brief Uart3 signal: URXD3 */ -#define PIO_PD30A_UTXD3 (1u << 30) /**< \brief Uart3 signal: UTXD3 */ -#define PIO_PD31B_UTXD3 (1u << 31) /**< \brief Uart3 signal: UTXD3 */ -/* ========== Pio definition for UART4 peripheral ========== */ -#define PIO_PD18C_URXD4 (1u << 18) /**< \brief Uart4 signal: URXD4 */ -#define PIO_PD3C_UTXD4 (1u << 3) /**< \brief Uart4 signal: UTXD4 */ -#define PIO_PD19C_UTXD4 (1u << 19) /**< \brief Uart4 signal: UTXD4 */ -/* ========== Pio definition for USART0 peripheral ========== */ -#define PIO_PB2C_CTS0 (1u << 2) /**< \brief Usart0 signal: CTS0 */ -#define PIO_PD0D_DCD0 (1u << 0) /**< \brief Usart0 signal: DCD0 */ -#define PIO_PD2D_DSR0 (1u << 2) /**< \brief Usart0 signal: DSR0 */ -#define PIO_PD1D_DTR0 (1u << 1) /**< \brief Usart0 signal: DTR0 */ -#define PIO_PD3D_RI0 (1u << 3) /**< \brief Usart0 signal: RI0 */ -#define PIO_PB3C_RTS0 (1u << 3) /**< \brief Usart0 signal: RTS0 */ -#define PIO_PB0C_RXD0 (1u << 0) /**< \brief Usart0 signal: RXD0 */ -#define PIO_PB13C_SCK0 (1u << 13) /**< \brief Usart0 signal: SCK0 */ -#define PIO_PB1C_TXD0 (1u << 1) /**< \brief Usart0 signal: TXD0 */ -/* ========== Pio definition for USART1 peripheral ========== */ -#define PIO_PA25A_CTS1 (1u << 25) /**< \brief Usart1 signal: CTS1 */ -#define PIO_PA26A_DCD1 (1u << 26) /**< \brief Usart1 signal: DCD1 */ -#define PIO_PA28A_DSR1 (1u << 28) /**< \brief Usart1 signal: DSR1 */ -#define PIO_PA27A_DTR1 (1u << 27) /**< \brief Usart1 signal: DTR1 */ -#define PIO_PA3B_LONCOL1 (1u << 3) /**< \brief Usart1 signal: LONCOL1 */ -#define PIO_PA29A_RI1 (1u << 29) /**< \brief Usart1 signal: RI1 */ -#define PIO_PA24A_RTS1 (1u << 24) /**< \brief Usart1 signal: RTS1 */ -#define PIO_PA21A_RXD1 (1u << 21) /**< \brief Usart1 signal: RXD1 */ -#define PIO_PA23A_SCK1 (1u << 23) /**< \brief Usart1 signal: SCK1 */ -#define PIO_PB4D_TXD1 (1u << 4) /**< \brief Usart1 signal: TXD1 */ -/* ========== Pio definition for USART2 peripheral ========== */ -#define PIO_PD19B_CTS2 (1u << 19) /**< \brief Usart2 signal: CTS2 */ -#define PIO_PD4D_DCD2 (1u << 4) /**< \brief Usart2 signal: DCD2 */ -#define PIO_PD6D_DSR2 (1u << 6) /**< \brief Usart2 signal: DSR2 */ -#define PIO_PD5D_DTR2 (1u << 5) /**< \brief Usart2 signal: DTR2 */ -#define PIO_PD7D_RI2 (1u << 7) /**< \brief Usart2 signal: RI2 */ -#define PIO_PD18B_RTS2 (1u << 18) /**< \brief Usart2 signal: RTS2 */ -#define PIO_PD15B_RXD2 (1u << 15) /**< \brief Usart2 signal: RXD2 */ -#define PIO_PD17B_SCK2 (1u << 17) /**< \brief Usart2 signal: SCK2 */ -#define PIO_PD16B_TXD2 (1u << 16) /**< \brief Usart2 signal: TXD2 */ -/* ========== Pio indexes ========== */ -#define PIO_PA3_IDX 3 -#define PIO_PA4_IDX 4 -#define PIO_PA5_IDX 5 -#define PIO_PA7_IDX 7 -#define PIO_PA8_IDX 8 -#define PIO_PA9_IDX 9 -#define PIO_PA10_IDX 10 -#define PIO_PA11_IDX 11 -#define PIO_PA12_IDX 12 -#define PIO_PA13_IDX 13 -#define PIO_PA14_IDX 14 -#define PIO_PA21_IDX 21 -#define PIO_PA22_IDX 22 -#define PIO_PA24_IDX 24 -#define PIO_PA27_IDX 27 -#define PIO_PB0_IDX 32 -#define PIO_PB1_IDX 33 -#define PIO_PB2_IDX 34 -#define PIO_PB3_IDX 35 -#define PIO_PB4_IDX 36 -#define PIO_PB5_IDX 37 -#define PIO_PB6_IDX 38 -#define PIO_PB7_IDX 39 -#define PIO_PB8_IDX 40 -#define PIO_PB9_IDX 41 -#define PIO_PB12_IDX 44 -#define PIO_PD0_IDX 96 -#define PIO_PD1_IDX 97 -#define PIO_PD2_IDX 98 -#define PIO_PD3_IDX 99 -#define PIO_PD4_IDX 100 -#define PIO_PD5_IDX 101 -#define PIO_PD6_IDX 102 -#define PIO_PD7_IDX 103 -#define PIO_PD8_IDX 104 -#define PIO_PD9_IDX 105 -#define PIO_PD10_IDX 106 -#define PIO_PD11_IDX 107 -#define PIO_PD12_IDX 108 -#define PIO_PD21_IDX 117 -#define PIO_PD22_IDX 118 -#define PIO_PD24_IDX 120 -#define PIO_PD25_IDX 121 -#define PIO_PD26_IDX 122 -#define PIO_PD31_IDX 127 - -#endif /* _SAMV71J21_PIO_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/pio/pio_samv71n19.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/pio/pio_samv71n19.h deleted file mode 100644 index 52144e7e..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/pio/pio_samv71n19.h +++ /dev/null @@ -1,499 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71N19_PIO_ -#define _SAMV71N19_PIO_ - -#define PIO_PA0 (1u << 0) /**< \brief Pin Controlled by PA0 */ -#define PIO_PA1 (1u << 1) /**< \brief Pin Controlled by PA1 */ -#define PIO_PA2 (1u << 2) /**< \brief Pin Controlled by PA2 */ -#define PIO_PA3 (1u << 3) /**< \brief Pin Controlled by PA3 */ -#define PIO_PA4 (1u << 4) /**< \brief Pin Controlled by PA4 */ -#define PIO_PA5 (1u << 5) /**< \brief Pin Controlled by PA5 */ -#define PIO_PA7 (1u << 7) /**< \brief Pin Controlled by PA7 */ -#define PIO_PA8 (1u << 8) /**< \brief Pin Controlled by PA8 */ -#define PIO_PA9 (1u << 9) /**< \brief Pin Controlled by PA9 */ -#define PIO_PA10 (1u << 10) /**< \brief Pin Controlled by PA10 */ -#define PIO_PA11 (1u << 11) /**< \brief Pin Controlled by PA11 */ -#define PIO_PA12 (1u << 12) /**< \brief Pin Controlled by PA12 */ -#define PIO_PA13 (1u << 13) /**< \brief Pin Controlled by PA13 */ -#define PIO_PA14 (1u << 14) /**< \brief Pin Controlled by PA14 */ -#define PIO_PA15 (1u << 15) /**< \brief Pin Controlled by PA15 */ -#define PIO_PA16 (1u << 16) /**< \brief Pin Controlled by PA16 */ -#define PIO_PA17 (1u << 17) /**< \brief Pin Controlled by PA17 */ -#define PIO_PA18 (1u << 18) /**< \brief Pin Controlled by PA18 */ -#define PIO_PA19 (1u << 19) /**< \brief Pin Controlled by PA19 */ -#define PIO_PA20 (1u << 20) /**< \brief Pin Controlled by PA20 */ -#define PIO_PA21 (1u << 21) /**< \brief Pin Controlled by PA21 */ -#define PIO_PA22 (1u << 22) /**< \brief Pin Controlled by PA22 */ -#define PIO_PA23 (1u << 23) /**< \brief Pin Controlled by PA23 */ -#define PIO_PA24 (1u << 24) /**< \brief Pin Controlled by PA24 */ -#define PIO_PA25 (1u << 25) /**< \brief Pin Controlled by PA25 */ -#define PIO_PA26 (1u << 26) /**< \brief Pin Controlled by PA26 */ -#define PIO_PA27 (1u << 27) /**< \brief Pin Controlled by PA27 */ -#define PIO_PA28 (1u << 28) /**< \brief Pin Controlled by PA28 */ -#define PIO_PA30 (1u << 30) /**< \brief Pin Controlled by PA30 */ -#define PIO_PA31 (1u << 31) /**< \brief Pin Controlled by PA31 */ -#define PIO_PB0 (1u << 0) /**< \brief Pin Controlled by PB0 */ -#define PIO_PB1 (1u << 1) /**< \brief Pin Controlled by PB1 */ -#define PIO_PB2 (1u << 2) /**< \brief Pin Controlled by PB2 */ -#define PIO_PB3 (1u << 3) /**< \brief Pin Controlled by PB3 */ -#define PIO_PB4 (1u << 4) /**< \brief Pin Controlled by PB4 */ -#define PIO_PB5 (1u << 5) /**< \brief Pin Controlled by PB5 */ -#define PIO_PB6 (1u << 6) /**< \brief Pin Controlled by PB6 */ -#define PIO_PB7 (1u << 7) /**< \brief Pin Controlled by PB7 */ -#define PIO_PB8 (1u << 8) /**< \brief Pin Controlled by PB8 */ -#define PIO_PB9 (1u << 9) /**< \brief Pin Controlled by PB9 */ -#define PIO_PB12 (1u << 12) /**< \brief Pin Controlled by PB12 */ -#define PIO_PB13 (1u << 13) /**< \brief Pin Controlled by PB13 */ -#define PIO_PD0 (1u << 0) /**< \brief Pin Controlled by PD0 */ -#define PIO_PD1 (1u << 1) /**< \brief Pin Controlled by PD1 */ -#define PIO_PD2 (1u << 2) /**< \brief Pin Controlled by PD2 */ -#define PIO_PD3 (1u << 3) /**< \brief Pin Controlled by PD3 */ -#define PIO_PD4 (1u << 4) /**< \brief Pin Controlled by PD4 */ -#define PIO_PD5 (1u << 5) /**< \brief Pin Controlled by PD5 */ -#define PIO_PD6 (1u << 6) /**< \brief Pin Controlled by PD6 */ -#define PIO_PD7 (1u << 7) /**< \brief Pin Controlled by PD7 */ -#define PIO_PD8 (1u << 8) /**< \brief Pin Controlled by PD8 */ -#define PIO_PD9 (1u << 9) /**< \brief Pin Controlled by PD9 */ -#define PIO_PD10 (1u << 10) /**< \brief Pin Controlled by PD10 */ -#define PIO_PD11 (1u << 11) /**< \brief Pin Controlled by PD11 */ -#define PIO_PD12 (1u << 12) /**< \brief Pin Controlled by PD12 */ -#define PIO_PD13 (1u << 13) /**< \brief Pin Controlled by PD13 */ -#define PIO_PD14 (1u << 14) /**< \brief Pin Controlled by PD14 */ -#define PIO_PD15 (1u << 15) /**< \brief Pin Controlled by PD15 */ -#define PIO_PD16 (1u << 16) /**< \brief Pin Controlled by PD16 */ -#define PIO_PD17 (1u << 17) /**< \brief Pin Controlled by PD17 */ -#define PIO_PD18 (1u << 18) /**< \brief Pin Controlled by PD18 */ -#define PIO_PD19 (1u << 19) /**< \brief Pin Controlled by PD19 */ -#define PIO_PD20 (1u << 20) /**< \brief Pin Controlled by PD20 */ -#define PIO_PD21 (1u << 21) /**< \brief Pin Controlled by PD21 */ -#define PIO_PD22 (1u << 22) /**< \brief Pin Controlled by PD22 */ -#define PIO_PD24 (1u << 24) /**< \brief Pin Controlled by PD24 */ -#define PIO_PD25 (1u << 25) /**< \brief Pin Controlled by PD25 */ -#define PIO_PD26 (1u << 26) /**< \brief Pin Controlled by PD26 */ -#define PIO_PD27 (1u << 27) /**< \brief Pin Controlled by PD27 */ -#define PIO_PD28 (1u << 28) /**< \brief Pin Controlled by PD28 */ -#define PIO_PD30 (1u << 30) /**< \brief Pin Controlled by PD30 */ -#define PIO_PD31 (1u << 31) /**< \brief Pin Controlled by PD31 */ -/* ========== Pio definition for AFEC0 peripheral ========== */ -#define PIO_PD30X1_AFE0_AD0 (1u << 30) /**< \brief Afec0 signal: AFE0_AD0 */ -#define PIO_PA21X1_AFE0_AD1 (1u << 21) /**< \brief Afec0 signal: AFE0_AD1/PIODCEN2 */ -#define PIO_PA21X1_PIODCEN2 (1u << 21) /**< \brief Afec0 signal: AFE0_AD1/PIODCEN2 */ -#define PIO_PB0X1_AFE0_AD10 (1u << 0) /**< \brief Afec0 signal: AFE0_AD10/RTCOUT0 */ -#define PIO_PB0X1_RTCOUT0 (1u << 0) /**< \brief Afec0 signal: AFE0_AD10/RTCOUT0 */ -#define PIO_PB3X1_AFE0_AD2 (1u << 3) /**< \brief Afec0 signal: AFE0_AD2/WKUP12 */ -#define PIO_PB3X1_WKUP12 (1u << 3) /**< \brief Afec0 signal: AFE0_AD2/WKUP12 */ -#define PIO_PE5X1_AFE0_AD3 (1u << 5) /**< \brief Afec0 signal: AFE0_AD3 */ -#define PIO_PE4X1_AFE0_AD4 (1u << 4) /**< \brief Afec0 signal: AFE0_AD4 */ -#define PIO_PB2X1_AFE0_AD5 (1u << 2) /**< \brief Afec0 signal: AFE0_AD5 */ -#define PIO_PA17X1_AFE0_AD6 (1u << 17) /**< \brief Afec0 signal: AFE0_AD6 */ -#define PIO_PA18X1_AFE0_AD7 (1u << 18) /**< \brief Afec0 signal: AFE0_AD7 */ -#define PIO_PA19X1_AFE0_AD8 (1u << 19) /**< \brief Afec0 signal: AFE0_AD8/WKUP9 */ -#define PIO_PA19X1_WKUP9 (1u << 19) /**< \brief Afec0 signal: AFE0_AD8/WKUP9 */ -#define PIO_PA20X1_AFE0_AD9 (1u << 20) /**< \brief Afec0 signal: AFE0_AD9/WKUP10 */ -#define PIO_PA20X1_WKUP10 (1u << 20) /**< \brief Afec0 signal: AFE0_AD9/WKUP10 */ -#define PIO_PA8B_AFE0_ADTRG (1u << 8) /**< \brief Afec0 signal: AFE0_ADTRG */ -/* ========== Pio definition for AFEC1 peripheral ========== */ -#define PIO_PB1X1_AFE1_AD0 (1u << 1) /**< \brief Afec1 signal: AFE1_AD0/RTCOUT1 */ -#define PIO_PB1X1_RTCOUT1 (1u << 1) /**< \brief Afec1 signal: AFE1_AD0/RTCOUT1 */ -#define PIO_PC13X1_AFE1_AD1 (1u << 13) /**< \brief Afec1 signal: AFE1_AD1 */ -#define PIO_PE3X1_AFE1_AD10 (1u << 3) /**< \brief Afec1 signal: AFE1_AD10 */ -#define PIO_PE0X1_AFE1_AD11 (1u << 0) /**< \brief Afec1 signal: AFE1_AD11 */ -#define PIO_PC15X1_AFE1_AD2 (1u << 15) /**< \brief Afec1 signal: AFE1_AD2 */ -#define PIO_PC12X1_AFE1_AD3 (1u << 12) /**< \brief Afec1 signal: AFE1_AD3 */ -#define PIO_PC29X1_AFE1_AD4 (1u << 29) /**< \brief Afec1 signal: AFE1_AD4 */ -#define PIO_PC30X1_AFE1_AD5 (1u << 30) /**< \brief Afec1 signal: AFE1_AD5 */ -#define PIO_PC31X1_AFE1_AD6 (1u << 31) /**< \brief Afec1 signal: AFE1_AD6 */ -#define PIO_PC26X1_AFE1_AD7 (1u << 26) /**< \brief Afec1 signal: AFE1_AD7 */ -#define PIO_PC27X1_AFE1_AD8 (1u << 27) /**< \brief Afec1 signal: AFE1_AD8 */ -#define PIO_PC0X1_AFE1_AD9 (1u << 0) /**< \brief Afec1 signal: AFE1_AD9 */ -#define PIO_PD9C_AFE1_ADTRG (1u << 9) /**< \brief Afec1 signal: AFE1_ADTRG */ -/* ========== Pio definition for ARM peripheral ========== */ -#define PIO_PB7X1_SWCLK (1u << 7) /**< \brief Arm signal: SWCLK/TCK */ -#define PIO_PB7X1_TCK (1u << 7) /**< \brief Arm signal: SWCLK/TCK */ -#define PIO_PB6X1_SWDIO (1u << 6) /**< \brief Arm signal: SWDIO/TMS */ -#define PIO_PB6X1_TMS (1u << 6) /**< \brief Arm signal: SWDIO/TMS */ -#define PIO_PB4X1_TDI (1u << 4) /**< \brief Arm signal: TDI */ -#define PIO_PB5X1_TDO (1u << 5) /**< \brief Arm signal: TDO/TRACESWO/WKUP13 */ -#define PIO_PB5X1_TRACESWO (1u << 5) /**< \brief Arm signal: TDO/TRACESWO/WKUP13 */ -#define PIO_PB5X1_WKUP13 (1u << 5) /**< \brief Arm signal: TDO/TRACESWO/WKUP13 */ -/* ========== Pio definition for DACC peripheral ========== */ -#define PIO_PB13X1_DAC0 (1u << 13) /**< \brief Dacc signal: DAC0 */ -#define PIO_PD0X1_DAC1 (1u << 0) /**< \brief Dacc signal: DAC1 */ -#define PIO_PA2C_DATRG (1u << 2) /**< \brief Dacc signal: DATRG */ -/* ========== Pio definition for GMAC peripheral ========== */ -#define PIO_PD13A_GCOL (1u << 13) /**< \brief Gmac signal: GCOL */ -#define PIO_PD10A_GCRS (1u << 10) /**< \brief Gmac signal: GCRS */ -#define PIO_PD8A_GMDC (1u << 8) /**< \brief Gmac signal: GMDC */ -#define PIO_PD9A_GMDIO (1u << 9) /**< \brief Gmac signal: GMDIO */ -#define PIO_PD5A_GRX0 (1u << 5) /**< \brief Gmac signal: GRX0 */ -#define PIO_PD6A_GRX1 (1u << 6) /**< \brief Gmac signal: GRX1 */ -#define PIO_PD11A_GRX2 (1u << 11) /**< \brief Gmac signal: GRX2 */ -#define PIO_PD12A_GRX3 (1u << 12) /**< \brief Gmac signal: GRX3 */ -#define PIO_PD14A_GRXCK (1u << 14) /**< \brief Gmac signal: GRXCK */ -#define PIO_PD4A_GRXDV (1u << 4) /**< \brief Gmac signal: GRXDV */ -#define PIO_PD7A_GRXER (1u << 7) /**< \brief Gmac signal: GRXER */ -#define PIO_PB1B_GTSUCOMP (1u << 1) /**< \brief Gmac signal: GTSUCOMP */ -#define PIO_PB12B_GTSUCOMP (1u << 12) /**< \brief Gmac signal: GTSUCOMP */ -#define PIO_PD11C_GTSUCOMP (1u << 11) /**< \brief Gmac signal: GTSUCOMP */ -#define PIO_PD20C_GTSUCOMP (1u << 20) /**< \brief Gmac signal: GTSUCOMP */ -#define PIO_PD2A_GTX0 (1u << 2) /**< \brief Gmac signal: GTX0 */ -#define PIO_PD3A_GTX1 (1u << 3) /**< \brief Gmac signal: GTX1 */ -#define PIO_PD15A_GTX2 (1u << 15) /**< \brief Gmac signal: GTX2 */ -#define PIO_PD16A_GTX3 (1u << 16) /**< \brief Gmac signal: GTX3 */ -#define PIO_PD0A_GTXCK (1u << 0) /**< \brief Gmac signal: GTXCK */ -#define PIO_PD1A_GTXEN (1u << 1) /**< \brief Gmac signal: GTXEN */ -#define PIO_PD17A_GTXER (1u << 17) /**< \brief Gmac signal: GTXER */ -/* ========== Pio definition for HSMCI peripheral ========== */ -#define PIO_PA28C_MCCDA (1u << 28) /**< \brief Hsmci signal: MCCDA */ -#define PIO_PA25D_MCCK (1u << 25) /**< \brief Hsmci signal: MCCK */ -#define PIO_PA30C_MCDA0 (1u << 30) /**< \brief Hsmci signal: MCDA0 */ -#define PIO_PA31C_MCDA1 (1u << 31) /**< \brief Hsmci signal: MCDA1 */ -#define PIO_PA26C_MCDA2 (1u << 26) /**< \brief Hsmci signal: MCDA2 */ -#define PIO_PA27C_MCDA3 (1u << 27) /**< \brief Hsmci signal: MCDA3 */ -/* ========== Pio definition for ISI peripheral ========== */ -#define PIO_PD22D_ISI_D0 (1u << 22) /**< \brief Isi signal: ISI_D0 */ -#define PIO_PD21D_ISI_D1 (1u << 21) /**< \brief Isi signal: ISI_D1 */ -#define PIO_PD30D_ISI_D10 (1u << 30) /**< \brief Isi signal: ISI_D10 */ -#define PIO_PD31D_ISI_D11 (1u << 31) /**< \brief Isi signal: ISI_D11 */ -#define PIO_PB3D_ISI_D2 (1u << 3) /**< \brief Isi signal: ISI_D2 */ -#define PIO_PA9B_ISI_D3 (1u << 9) /**< \brief Isi signal: ISI_D3 */ -#define PIO_PA5B_ISI_D4 (1u << 5) /**< \brief Isi signal: ISI_D4 */ -#define PIO_PD11D_ISI_D5 (1u << 11) /**< \brief Isi signal: ISI_D5 */ -#define PIO_PD12D_ISI_D6 (1u << 12) /**< \brief Isi signal: ISI_D6 */ -#define PIO_PA27D_ISI_D7 (1u << 27) /**< \brief Isi signal: ISI_D7 */ -#define PIO_PD27D_ISI_D8 (1u << 27) /**< \brief Isi signal: ISI_D8 */ -#define PIO_PD28D_ISI_D9 (1u << 28) /**< \brief Isi signal: ISI_D9 */ -#define PIO_PD24D_ISI_HSYNC (1u << 24) /**< \brief Isi signal: ISI_HSYNC */ -#define PIO_PA24D_ISI_PCK (1u << 24) /**< \brief Isi signal: ISI_PCK */ -#define PIO_PD25D_ISI_VSYNC (1u << 25) /**< \brief Isi signal: ISI_VSYNC */ -/* ========== Pio definition for MCAN0 peripheral ========== */ -#define PIO_PB3A_CANRX0 (1u << 3) /**< \brief Mcan0 signal: CANRX0 */ -#define PIO_PB2A_CANTX0 (1u << 2) /**< \brief Mcan0 signal: CANTX0 */ -/* ========== Pio definition for MCAN1 peripheral ========== */ -#define PIO_PC12C_CANRX1 (1u << 12) /**< \brief Mcan1 signal: CANRX1 */ -#define PIO_PD28B_CANRX1 (1u << 28) /**< \brief Mcan1 signal: CANRX1 */ -#define PIO_PC14C_CANTX1 (1u << 14) /**< \brief Mcan1 signal: CANTX1 */ -#define PIO_PD12B_CANTX1 (1u << 12) /**< \brief Mcan1 signal: CANTX1 */ -/* ========== Pio definition for MLB peripheral ========== */ -#define PIO_PB4C_MLBCLK (1u << 4) /**< \brief Mlb signal: MLBCLK */ -#define PIO_PB5C_MLBDAT (1u << 5) /**< \brief Mlb signal: MLBDAT */ -#define PIO_PD10D_MLBSIG (1u << 10) /**< \brief Mlb signal: MLBSIG */ -/* ========== Pio definition for PIOA peripheral ========== */ -#define PIO_PA21X1_AFE0_AD1 (1u << 21) /**< \brief Pioa signal: AFE0_AD1/PIODCEN2 */ -#define PIO_PA21X1_PIODCEN2 (1u << 21) /**< \brief Pioa signal: AFE0_AD1/PIODCEN2 */ -#define PIO_PA3X1_PIODC0 (1u << 3) /**< \brief Pioa signal: PIODC0 */ -#define PIO_PA10X1_PIODC4 (1u << 10) /**< \brief Pioa signal: PIODC4 */ -#define PIO_PA12X1_PIODC6 (1u << 12) /**< \brief Pioa signal: PIODC6 */ -#define PIO_PA13X1_PIODC7 (1u << 13) /**< \brief Pioa signal: PIODC7 */ -#define PIO_PA22X1_PIODCCLK (1u << 22) /**< \brief Pioa signal: PIODCCLK */ -#define PIO_PA4X1_WKUP3 (1u << 4) /**< \brief Pioa signal: WKUP3/PIODC1 */ -#define PIO_PA4X1_PIODC1 (1u << 4) /**< \brief Pioa signal: WKUP3/PIODC1 */ -#define PIO_PA5X1_WKUP4 (1u << 5) /**< \brief Pioa signal: WKUP4/PIODC2 */ -#define PIO_PA5X1_PIODC2 (1u << 5) /**< \brief Pioa signal: WKUP4/PIODC2 */ -#define PIO_PA9X1_WKUP6 (1u << 9) /**< \brief Pioa signal: WKUP6/PIODC3 */ -#define PIO_PA9X1_PIODC3 (1u << 9) /**< \brief Pioa signal: WKUP6/PIODC3 */ -#define PIO_PA11X1_WKUP7 (1u << 11) /**< \brief Pioa signal: WKUP7/PIODC5 */ -#define PIO_PA11X1_PIODC5 (1u << 11) /**< \brief Pioa signal: WKUP7/PIODC5 */ -#define PIO_PA14X1_WKUP8 (1u << 14) /**< \brief Pioa signal: WKUP8/PIODCEN1 */ -#define PIO_PA14X1_PIODCEN1 (1u << 14) /**< \brief Pioa signal: WKUP8/PIODCEN1 */ -/* ========== Pio definition for PMC peripheral ========== */ -#define PIO_PA6B_PCK0 (1u << 6) /**< \brief Pmc signal: PCK0 */ -#define PIO_PB12D_PCK0 (1u << 12) /**< \brief Pmc signal: PCK0 */ -#define PIO_PB13B_PCK0 (1u << 13) /**< \brief Pmc signal: PCK0 */ -#define PIO_PA17B_PCK1 (1u << 17) /**< \brief Pmc signal: PCK1 */ -#define PIO_PA21B_PCK1 (1u << 21) /**< \brief Pmc signal: PCK1 */ -#define PIO_PA3C_PCK2 (1u << 3) /**< \brief Pmc signal: PCK2 */ -#define PIO_PA18B_PCK2 (1u << 18) /**< \brief Pmc signal: PCK2 */ -#define PIO_PA31B_PCK2 (1u << 31) /**< \brief Pmc signal: PCK2 */ -#define PIO_PB3B_PCK2 (1u << 3) /**< \brief Pmc signal: PCK2 */ -#define PIO_PD31C_PCK2 (1u << 31) /**< \brief Pmc signal: PCK2 */ -/* ========== Pio definition for PWM0 peripheral ========== */ -#define PIO_PA10B_PWMC0_PWMEXTRG0 (1u << 10) /**< \brief Pwm0 signal: PWMC0_PWMEXTRG0 */ -#define PIO_PA22B_PWMC0_PWMEXTRG1 (1u << 22) /**< \brief Pwm0 signal: PWMC0_PWMEXTRG1 */ -#define PIO_PA9C_PWMC0_PWMFI0 (1u << 9) /**< \brief Pwm0 signal: PWMC0_PWMFI0 */ -#define PIO_PD8B_PWMC0_PWMFI1 (1u << 8) /**< \brief Pwm0 signal: PWMC0_PWMFI1 */ -#define PIO_PD9B_PWMC0_PWMFI2 (1u << 9) /**< \brief Pwm0 signal: PWMC0_PWMFI2 */ -#define PIO_PA0A_PWMC0_PWMH0 (1u << 0) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PA11B_PWMC0_PWMH0 (1u << 11) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PA23B_PWMC0_PWMH0 (1u << 23) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PB0A_PWMC0_PWMH0 (1u << 0) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PD11B_PWMC0_PWMH0 (1u << 11) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PD20A_PWMC0_PWMH0 (1u << 20) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PA2A_PWMC0_PWMH1 (1u << 2) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PA12B_PWMC0_PWMH1 (1u << 12) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PA24B_PWMC0_PWMH1 (1u << 24) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PB1A_PWMC0_PWMH1 (1u << 1) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PD21A_PWMC0_PWMH1 (1u << 21) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PA13B_PWMC0_PWMH2 (1u << 13) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PA25B_PWMC0_PWMH2 (1u << 25) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PB4B_PWMC0_PWMH2 (1u << 4) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PC19B_PWMC0_PWMH2 (1u << 19) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PD22A_PWMC0_PWMH2 (1u << 22) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PA7B_PWMC0_PWMH3 (1u << 7) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PA14B_PWMC0_PWMH3 (1u << 14) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PA17C_PWMC0_PWMH3 (1u << 17) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PC13B_PWMC0_PWMH3 (1u << 13) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PC21B_PWMC0_PWMH3 (1u << 21) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PD23A_PWMC0_PWMH3 (1u << 23) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PA1A_PWMC0_PWML0 (1u << 1) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PA19B_PWMC0_PWML0 (1u << 19) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PB5B_PWMC0_PWML0 (1u << 5) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PC0B_PWMC0_PWML0 (1u << 0) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PD10B_PWMC0_PWML0 (1u << 10) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PD24A_PWMC0_PWML0 (1u << 24) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PA20B_PWMC0_PWML1 (1u << 20) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PB12A_PWMC0_PWML1 (1u << 12) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PC1B_PWMC0_PWML1 (1u << 1) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PC18B_PWMC0_PWML1 (1u << 18) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PD25A_PWMC0_PWML1 (1u << 25) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PA16C_PWMC0_PWML2 (1u << 16) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PA30A_PWMC0_PWML2 (1u << 30) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PB13A_PWMC0_PWML2 (1u << 13) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PC2B_PWMC0_PWML2 (1u << 2) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PC20B_PWMC0_PWML2 (1u << 20) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PD26A_PWMC0_PWML2 (1u << 26) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PA15C_PWMC0_PWML3 (1u << 15) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -#define PIO_PC3B_PWMC0_PWML3 (1u << 3) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -#define PIO_PC15B_PWMC0_PWML3 (1u << 15) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -#define PIO_PC22B_PWMC0_PWML3 (1u << 22) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -#define PIO_PD27A_PWMC0_PWML3 (1u << 27) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -/* ========== Pio definition for PWM1 peripheral ========== */ -#define PIO_PA30B_PWMC1_PWMEXTRG0 (1u << 30) /**< \brief Pwm1 signal: PWMC1_PWMEXTRG0 */ -#define PIO_PA18A_PWMC1_PWMEXTRG1 (1u << 18) /**< \brief Pwm1 signal: PWMC1_PWMEXTRG1 */ -#define PIO_PA21C_PWMC1_PWMFI0 (1u << 21) /**< \brief Pwm1 signal: PWMC1_PWMFI0 */ -#define PIO_PA26D_PWMC1_PWMFI1 (1u << 26) /**< \brief Pwm1 signal: PWMC1_PWMFI1 */ -#define PIO_PA28D_PWMC1_PWMFI2 (1u << 28) /**< \brief Pwm1 signal: PWMC1_PWMFI2 */ -#define PIO_PA12C_PWMC1_PWMH0 (1u << 12) /**< \brief Pwm1 signal: PWMC1_PWMH0 */ -#define PIO_PD1B_PWMC1_PWMH0 (1u << 1) /**< \brief Pwm1 signal: PWMC1_PWMH0 */ -#define PIO_PA14C_PWMC1_PWMH1 (1u << 14) /**< \brief Pwm1 signal: PWMC1_PWMH1 */ -#define PIO_PD3B_PWMC1_PWMH1 (1u << 3) /**< \brief Pwm1 signal: PWMC1_PWMH1 */ -#define PIO_PA31D_PWMC1_PWMH2 (1u << 31) /**< \brief Pwm1 signal: PWMC1_PWMH2 */ -#define PIO_PD5B_PWMC1_PWMH2 (1u << 5) /**< \brief Pwm1 signal: PWMC1_PWMH2 */ -#define PIO_PA8A_PWMC1_PWMH3 (1u << 8) /**< \brief Pwm1 signal: PWMC1_PWMH3 */ -#define PIO_PD7B_PWMC1_PWMH3 (1u << 7) /**< \brief Pwm1 signal: PWMC1_PWMH3 */ -#define PIO_PA11C_PWMC1_PWML0 (1u << 11) /**< \brief Pwm1 signal: PWMC1_PWML0 */ -#define PIO_PD0B_PWMC1_PWML0 (1u << 0) /**< \brief Pwm1 signal: PWMC1_PWML0 */ -#define PIO_PA13C_PWMC1_PWML1 (1u << 13) /**< \brief Pwm1 signal: PWMC1_PWML1 */ -#define PIO_PD2B_PWMC1_PWML1 (1u << 2) /**< \brief Pwm1 signal: PWMC1_PWML1 */ -#define PIO_PA23D_PWMC1_PWML2 (1u << 23) /**< \brief Pwm1 signal: PWMC1_PWML2 */ -#define PIO_PD4B_PWMC1_PWML2 (1u << 4) /**< \brief Pwm1 signal: PWMC1_PWML2 */ -#define PIO_PA5A_PWMC1_PWML3 (1u << 5) /**< \brief Pwm1 signal: PWMC1_PWML3 */ -#define PIO_PD6B_PWMC1_PWML3 (1u << 6) /**< \brief Pwm1 signal: PWMC1_PWML3 */ -/* ========== Pio definition for QSPI peripheral ========== */ -#define PIO_PA11A_QCS (1u << 11) /**< \brief Qspi signal: QCS */ -#define PIO_PA13A_QIO0 (1u << 13) /**< \brief Qspi signal: QIO0 */ -#define PIO_PA12A_QIO1 (1u << 12) /**< \brief Qspi signal: QIO1 */ -#define PIO_PA17A_QIO2 (1u << 17) /**< \brief Qspi signal: QIO2 */ -#define PIO_PD31A_QIO3 (1u << 31) /**< \brief Qspi signal: QIO3 */ -#define PIO_PA14A_QSCK (1u << 14) /**< \brief Qspi signal: QSCK */ -/* ========== Pio definition for SPI0 peripheral ========== */ -#define PIO_PD20B_SPI0_MISO (1u << 20) /**< \brief Spi0 signal: SPI0_MISO */ -#define PIO_PD21B_SPI0_MOSI (1u << 21) /**< \brief Spi0 signal: SPI0_MOSI */ -#define PIO_PB2D_SPI0_NPCS0 (1u << 2) /**< \brief Spi0 signal: SPI0_NPCS0 */ -#define PIO_PA31A_SPI0_NPCS1 (1u << 31) /**< \brief Spi0 signal: SPI0_NPCS1 */ -#define PIO_PD25B_SPI0_NPCS1 (1u << 25) /**< \brief Spi0 signal: SPI0_NPCS1 */ -#define PIO_PD12C_SPI0_NPCS2 (1u << 12) /**< \brief Spi0 signal: SPI0_NPCS2 */ -#define PIO_PD27B_SPI0_NPCS3 (1u << 27) /**< \brief Spi0 signal: SPI0_NPCS3 */ -#define PIO_PD22B_SPI0_SPCK (1u << 22) /**< \brief Spi0 signal: SPI0_SPCK */ -/* ========== Pio definition for SPI1 peripheral ========== */ -#define PIO_PC26C_SPI1_MISO (1u << 26) /**< \brief Spi1 signal: SPI1_MISO */ -#define PIO_PC27C_SPI1_MOSI (1u << 27) /**< \brief Spi1 signal: SPI1_MOSI */ -#define PIO_PC25C_SPI1_NPCS0 (1u << 25) /**< \brief Spi1 signal: SPI1_NPCS0 */ -#define PIO_PC28C_SPI1_NPCS1 (1u << 28) /**< \brief Spi1 signal: SPI1_NPCS1 */ -#define PIO_PD0C_SPI1_NPCS1 (1u << 0) /**< \brief Spi1 signal: SPI1_NPCS1 */ -#define PIO_PC29C_SPI1_NPCS2 (1u << 29) /**< \brief Spi1 signal: SPI1_NPCS2 */ -#define PIO_PD1C_SPI1_NPCS2 (1u << 1) /**< \brief Spi1 signal: SPI1_NPCS2 */ -#define PIO_PC30C_SPI1_NPCS3 (1u << 30) /**< \brief Spi1 signal: SPI1_NPCS3 */ -#define PIO_PD2C_SPI1_NPCS3 (1u << 2) /**< \brief Spi1 signal: SPI1_NPCS3 */ -#define PIO_PC24C_SPI1_SPCK (1u << 24) /**< \brief Spi1 signal: SPI1_SPCK */ -/* ========== Pio definition for SSC peripheral ========== */ -#define PIO_PA10C_RD (1u << 10) /**< \brief Ssc signal: RD */ -#define PIO_PD24B_RF (1u << 24) /**< \brief Ssc signal: RF */ -#define PIO_PA22A_RK (1u << 22) /**< \brief Ssc signal: RK */ -#define PIO_PB5D_TD (1u << 5) /**< \brief Ssc signal: TD */ -#define PIO_PD10C_TD (1u << 10) /**< \brief Ssc signal: TD */ -#define PIO_PD26B_TD (1u << 26) /**< \brief Ssc signal: TD */ -#define PIO_PB0D_TF (1u << 0) /**< \brief Ssc signal: TF */ -#define PIO_PB1D_TK (1u << 1) /**< \brief Ssc signal: TK */ -/* ========== Pio definition for TC0 peripheral ========== */ -#define PIO_PA4B_TCLK0 (1u << 4) /**< \brief Tc0 signal: TCLK0 */ -#define PIO_PA28B_TCLK1 (1u << 28) /**< \brief Tc0 signal: TCLK1 */ -#define PIO_PA29B_TCLK2 (1u << 29) /**< \brief Tc0 signal: TCLK2 */ -#define PIO_PA0B_TIOA0 (1u << 0) /**< \brief Tc0 signal: TIOA0 */ -#define PIO_PA15B_TIOA1 (1u << 15) /**< \brief Tc0 signal: TIOA1 */ -#define PIO_PA26B_TIOA2 (1u << 26) /**< \brief Tc0 signal: TIOA2 */ -#define PIO_PA1B_TIOB0 (1u << 1) /**< \brief Tc0 signal: TIOB0 */ -#define PIO_PA16B_TIOB1 (1u << 16) /**< \brief Tc0 signal: TIOB1 */ -#define PIO_PA27B_TIOB2 (1u << 27) /**< \brief Tc0 signal: TIOB2 */ -/* ========== Pio definition for TC3 peripheral ========== */ -#define PIO_PE5B_TCLK10 (1u << 5) /**< \brief Tc3 signal: TCLK10 */ -#define PIO_PD24C_TCLK11 (1u << 24) /**< \brief Tc3 signal: TCLK11 */ -#define PIO_PE2B_TCLK9 (1u << 2) /**< \brief Tc3 signal: TCLK9 */ -#define PIO_PE3B_TIOA10 (1u << 3) /**< \brief Tc3 signal: TIOA10 */ -#define PIO_PD21C_TIOA11 (1u << 21) /**< \brief Tc3 signal: TIOA11 */ -#define PIO_PE0B_TIOA9 (1u << 0) /**< \brief Tc3 signal: TIOA9 */ -#define PIO_PE4B_TIOB10 (1u << 4) /**< \brief Tc3 signal: TIOB10 */ -#define PIO_PD22C_TIOB11 (1u << 22) /**< \brief Tc3 signal: TIOB11 */ -#define PIO_PE1B_TIOB9 (1u << 1) /**< \brief Tc3 signal: TIOB9 */ -/* ========== Pio definition for TWIHS0 peripheral ========== */ -#define PIO_PA4A_TWCK0 (1u << 4) /**< \brief Twihs0 signal: TWCK0 */ -#define PIO_PA3A_TWD0 (1u << 3) /**< \brief Twihs0 signal: TWD0 */ -/* ========== Pio definition for TWIHS1 peripheral ========== */ -#define PIO_PB5A_TWCK1 (1u << 5) /**< \brief Twihs1 signal: TWCK1 */ -#define PIO_PB4A_TWD1 (1u << 4) /**< \brief Twihs1 signal: TWD1 */ -/* ========== Pio definition for TWIHS2 peripheral ========== */ -#define PIO_PD28C_TWCK2 (1u << 28) /**< \brief Twihs2 signal: TWCK2 */ -#define PIO_PD27C_TWD2 (1u << 27) /**< \brief Twihs2 signal: TWD2 */ -/* ========== Pio definition for UART0 peripheral ========== */ -#define PIO_PA9A_URXD0 (1u << 9) /**< \brief Uart0 signal: URXD0 */ -#define PIO_PA10A_UTXD0 (1u << 10) /**< \brief Uart0 signal: UTXD0 */ -/* ========== Pio definition for UART1 peripheral ========== */ -#define PIO_PA5C_URXD1 (1u << 5) /**< \brief Uart1 signal: URXD1 */ -#define PIO_PA4C_UTXD1 (1u << 4) /**< \brief Uart1 signal: UTXD1 */ -#define PIO_PA6C_UTXD1 (1u << 6) /**< \brief Uart1 signal: UTXD1 */ -#define PIO_PD26D_UTXD1 (1u << 26) /**< \brief Uart1 signal: UTXD1 */ -/* ========== Pio definition for UART2 peripheral ========== */ -#define PIO_PD25C_URXD2 (1u << 25) /**< \brief Uart2 signal: URXD2 */ -#define PIO_PD26C_UTXD2 (1u << 26) /**< \brief Uart2 signal: UTXD2 */ -/* ========== Pio definition for UART3 peripheral ========== */ -#define PIO_PD28A_URXD3 (1u << 28) /**< \brief Uart3 signal: URXD3 */ -#define PIO_PD30A_UTXD3 (1u << 30) /**< \brief Uart3 signal: UTXD3 */ -#define PIO_PD31B_UTXD3 (1u << 31) /**< \brief Uart3 signal: UTXD3 */ -/* ========== Pio definition for UART4 peripheral ========== */ -#define PIO_PD18C_URXD4 (1u << 18) /**< \brief Uart4 signal: URXD4 */ -#define PIO_PD3C_UTXD4 (1u << 3) /**< \brief Uart4 signal: UTXD4 */ -#define PIO_PD19C_UTXD4 (1u << 19) /**< \brief Uart4 signal: UTXD4 */ -/* ========== Pio definition for USART0 peripheral ========== */ -#define PIO_PB2C_CTS0 (1u << 2) /**< \brief Usart0 signal: CTS0 */ -#define PIO_PD0D_DCD0 (1u << 0) /**< \brief Usart0 signal: DCD0 */ -#define PIO_PD2D_DSR0 (1u << 2) /**< \brief Usart0 signal: DSR0 */ -#define PIO_PD1D_DTR0 (1u << 1) /**< \brief Usart0 signal: DTR0 */ -#define PIO_PD3D_RI0 (1u << 3) /**< \brief Usart0 signal: RI0 */ -#define PIO_PB3C_RTS0 (1u << 3) /**< \brief Usart0 signal: RTS0 */ -#define PIO_PB0C_RXD0 (1u << 0) /**< \brief Usart0 signal: RXD0 */ -#define PIO_PB13C_SCK0 (1u << 13) /**< \brief Usart0 signal: SCK0 */ -#define PIO_PB1C_TXD0 (1u << 1) /**< \brief Usart0 signal: TXD0 */ -/* ========== Pio definition for USART1 peripheral ========== */ -#define PIO_PA25A_CTS1 (1u << 25) /**< \brief Usart1 signal: CTS1 */ -#define PIO_PA26A_DCD1 (1u << 26) /**< \brief Usart1 signal: DCD1 */ -#define PIO_PA28A_DSR1 (1u << 28) /**< \brief Usart1 signal: DSR1 */ -#define PIO_PA27A_DTR1 (1u << 27) /**< \brief Usart1 signal: DTR1 */ -#define PIO_PA3B_LONCOL1 (1u << 3) /**< \brief Usart1 signal: LONCOL1 */ -#define PIO_PA29A_RI1 (1u << 29) /**< \brief Usart1 signal: RI1 */ -#define PIO_PA24A_RTS1 (1u << 24) /**< \brief Usart1 signal: RTS1 */ -#define PIO_PA21A_RXD1 (1u << 21) /**< \brief Usart1 signal: RXD1 */ -#define PIO_PA23A_SCK1 (1u << 23) /**< \brief Usart1 signal: SCK1 */ -#define PIO_PB4D_TXD1 (1u << 4) /**< \brief Usart1 signal: TXD1 */ -/* ========== Pio definition for USART2 peripheral ========== */ -#define PIO_PD19B_CTS2 (1u << 19) /**< \brief Usart2 signal: CTS2 */ -#define PIO_PD4D_DCD2 (1u << 4) /**< \brief Usart2 signal: DCD2 */ -#define PIO_PD6D_DSR2 (1u << 6) /**< \brief Usart2 signal: DSR2 */ -#define PIO_PD5D_DTR2 (1u << 5) /**< \brief Usart2 signal: DTR2 */ -#define PIO_PD7D_RI2 (1u << 7) /**< \brief Usart2 signal: RI2 */ -#define PIO_PD18B_RTS2 (1u << 18) /**< \brief Usart2 signal: RTS2 */ -#define PIO_PD15B_RXD2 (1u << 15) /**< \brief Usart2 signal: RXD2 */ -#define PIO_PD17B_SCK2 (1u << 17) /**< \brief Usart2 signal: SCK2 */ -#define PIO_PD16B_TXD2 (1u << 16) /**< \brief Usart2 signal: TXD2 */ -/* ========== Pio indexes ========== */ -#define PIO_PA0_IDX 0 -#define PIO_PA1_IDX 1 -#define PIO_PA2_IDX 2 -#define PIO_PA3_IDX 3 -#define PIO_PA4_IDX 4 -#define PIO_PA5_IDX 5 -#define PIO_PA7_IDX 7 -#define PIO_PA8_IDX 8 -#define PIO_PA9_IDX 9 -#define PIO_PA10_IDX 10 -#define PIO_PA11_IDX 11 -#define PIO_PA12_IDX 12 -#define PIO_PA13_IDX 13 -#define PIO_PA14_IDX 14 -#define PIO_PA15_IDX 15 -#define PIO_PA16_IDX 16 -#define PIO_PA17_IDX 17 -#define PIO_PA18_IDX 18 -#define PIO_PA19_IDX 19 -#define PIO_PA20_IDX 20 -#define PIO_PA21_IDX 21 -#define PIO_PA22_IDX 22 -#define PIO_PA23_IDX 23 -#define PIO_PA24_IDX 24 -#define PIO_PA25_IDX 25 -#define PIO_PA26_IDX 26 -#define PIO_PA27_IDX 27 -#define PIO_PA28_IDX 28 -#define PIO_PA30_IDX 30 -#define PIO_PA31_IDX 31 -#define PIO_PB0_IDX 32 -#define PIO_PB1_IDX 33 -#define PIO_PB2_IDX 34 -#define PIO_PB3_IDX 35 -#define PIO_PB4_IDX 36 -#define PIO_PB5_IDX 37 -#define PIO_PB6_IDX 38 -#define PIO_PB7_IDX 39 -#define PIO_PB8_IDX 40 -#define PIO_PB9_IDX 41 -#define PIO_PB12_IDX 44 -#define PIO_PB13_IDX 45 -#define PIO_PD0_IDX 96 -#define PIO_PD1_IDX 97 -#define PIO_PD2_IDX 98 -#define PIO_PD3_IDX 99 -#define PIO_PD4_IDX 100 -#define PIO_PD5_IDX 101 -#define PIO_PD6_IDX 102 -#define PIO_PD7_IDX 103 -#define PIO_PD8_IDX 104 -#define PIO_PD9_IDX 105 -#define PIO_PD10_IDX 106 -#define PIO_PD11_IDX 107 -#define PIO_PD12_IDX 108 -#define PIO_PD13_IDX 109 -#define PIO_PD14_IDX 110 -#define PIO_PD15_IDX 111 -#define PIO_PD16_IDX 112 -#define PIO_PD17_IDX 113 -#define PIO_PD18_IDX 114 -#define PIO_PD19_IDX 115 -#define PIO_PD20_IDX 116 -#define PIO_PD21_IDX 117 -#define PIO_PD22_IDX 118 -#define PIO_PD24_IDX 120 -#define PIO_PD25_IDX 121 -#define PIO_PD26_IDX 122 -#define PIO_PD27_IDX 123 -#define PIO_PD28_IDX 124 -#define PIO_PD30_IDX 126 -#define PIO_PD31_IDX 127 - -#endif /* _SAMV71N19_PIO_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/pio/pio_samv71n20.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/pio/pio_samv71n20.h deleted file mode 100644 index e0c50bf2..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/pio/pio_samv71n20.h +++ /dev/null @@ -1,495 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71N20_PIO_ -#define _SAMV71N20_PIO_ - -#define PIO_PA0 (1u << 0) /**< \brief Pin Controlled by PA0 */ -#define PIO_PA1 (1u << 1) /**< \brief Pin Controlled by PA1 */ -#define PIO_PA2 (1u << 2) /**< \brief Pin Controlled by PA2 */ -#define PIO_PA3 (1u << 3) /**< \brief Pin Controlled by PA3 */ -#define PIO_PA4 (1u << 4) /**< \brief Pin Controlled by PA4 */ -#define PIO_PA5 (1u << 5) /**< \brief Pin Controlled by PA5 */ -#define PIO_PA7 (1u << 7) /**< \brief Pin Controlled by PA7 */ -#define PIO_PA8 (1u << 8) /**< \brief Pin Controlled by PA8 */ -#define PIO_PA9 (1u << 9) /**< \brief Pin Controlled by PA9 */ -#define PIO_PA10 (1u << 10) /**< \brief Pin Controlled by PA10 */ -#define PIO_PA11 (1u << 11) /**< \brief Pin Controlled by PA11 */ -#define PIO_PA12 (1u << 12) /**< \brief Pin Controlled by PA12 */ -#define PIO_PA13 (1u << 13) /**< \brief Pin Controlled by PA13 */ -#define PIO_PA14 (1u << 14) /**< \brief Pin Controlled by PA14 */ -#define PIO_PA15 (1u << 15) /**< \brief Pin Controlled by PA15 */ -#define PIO_PA16 (1u << 16) /**< \brief Pin Controlled by PA16 */ -#define PIO_PA17 (1u << 17) /**< \brief Pin Controlled by PA17 */ -#define PIO_PA18 (1u << 18) /**< \brief Pin Controlled by PA18 */ -#define PIO_PA19 (1u << 19) /**< \brief Pin Controlled by PA19 */ -#define PIO_PA20 (1u << 20) /**< \brief Pin Controlled by PA20 */ -#define PIO_PA21 (1u << 21) /**< \brief Pin Controlled by PA21 */ -#define PIO_PA22 (1u << 22) /**< \brief Pin Controlled by PA22 */ -#define PIO_PA23 (1u << 23) /**< \brief Pin Controlled by PA23 */ -#define PIO_PA24 (1u << 24) /**< \brief Pin Controlled by PA24 */ -#define PIO_PA25 (1u << 25) /**< \brief Pin Controlled by PA25 */ -#define PIO_PA26 (1u << 26) /**< \brief Pin Controlled by PA26 */ -#define PIO_PA27 (1u << 27) /**< \brief Pin Controlled by PA27 */ -#define PIO_PA28 (1u << 28) /**< \brief Pin Controlled by PA28 */ -#define PIO_PA30 (1u << 30) /**< \brief Pin Controlled by PA30 */ -#define PIO_PA31 (1u << 31) /**< \brief Pin Controlled by PA31 */ -#define PIO_PB0 (1u << 0) /**< \brief Pin Controlled by PB0 */ -#define PIO_PB1 (1u << 1) /**< \brief Pin Controlled by PB1 */ -#define PIO_PB2 (1u << 2) /**< \brief Pin Controlled by PB2 */ -#define PIO_PB3 (1u << 3) /**< \brief Pin Controlled by PB3 */ -#define PIO_PB4 (1u << 4) /**< \brief Pin Controlled by PB4 */ -#define PIO_PB5 (1u << 5) /**< \brief Pin Controlled by PB5 */ -#define PIO_PB6 (1u << 6) /**< \brief Pin Controlled by PB6 */ -#define PIO_PB7 (1u << 7) /**< \brief Pin Controlled by PB7 */ -#define PIO_PB8 (1u << 8) /**< \brief Pin Controlled by PB8 */ -#define PIO_PB9 (1u << 9) /**< \brief Pin Controlled by PB9 */ -#define PIO_PB12 (1u << 12) /**< \brief Pin Controlled by PB12 */ -#define PIO_PB13 (1u << 13) /**< \brief Pin Controlled by PB13 */ -#define PIO_PD0 (1u << 0) /**< \brief Pin Controlled by PD0 */ -#define PIO_PD1 (1u << 1) /**< \brief Pin Controlled by PD1 */ -#define PIO_PD2 (1u << 2) /**< \brief Pin Controlled by PD2 */ -#define PIO_PD3 (1u << 3) /**< \brief Pin Controlled by PD3 */ -#define PIO_PD4 (1u << 4) /**< \brief Pin Controlled by PD4 */ -#define PIO_PD5 (1u << 5) /**< \brief Pin Controlled by PD5 */ -#define PIO_PD6 (1u << 6) /**< \brief Pin Controlled by PD6 */ -#define PIO_PD7 (1u << 7) /**< \brief Pin Controlled by PD7 */ -#define PIO_PD8 (1u << 8) /**< \brief Pin Controlled by PD8 */ -#define PIO_PD9 (1u << 9) /**< \brief Pin Controlled by PD9 */ -#define PIO_PD10 (1u << 10) /**< \brief Pin Controlled by PD10 */ -#define PIO_PD11 (1u << 11) /**< \brief Pin Controlled by PD11 */ -#define PIO_PD12 (1u << 12) /**< \brief Pin Controlled by PD12 */ -#define PIO_PD13 (1u << 13) /**< \brief Pin Controlled by PD13 */ -#define PIO_PD14 (1u << 14) /**< \brief Pin Controlled by PD14 */ -#define PIO_PD15 (1u << 15) /**< \brief Pin Controlled by PD15 */ -#define PIO_PD16 (1u << 16) /**< \brief Pin Controlled by PD16 */ -#define PIO_PD17 (1u << 17) /**< \brief Pin Controlled by PD17 */ -#define PIO_PD18 (1u << 18) /**< \brief Pin Controlled by PD18 */ -#define PIO_PD19 (1u << 19) /**< \brief Pin Controlled by PD19 */ -#define PIO_PD20 (1u << 20) /**< \brief Pin Controlled by PD20 */ -#define PIO_PD21 (1u << 21) /**< \brief Pin Controlled by PD21 */ -#define PIO_PD22 (1u << 22) /**< \brief Pin Controlled by PD22 */ -#define PIO_PD24 (1u << 24) /**< \brief Pin Controlled by PD24 */ -#define PIO_PD25 (1u << 25) /**< \brief Pin Controlled by PD25 */ -#define PIO_PD26 (1u << 26) /**< \brief Pin Controlled by PD26 */ -#define PIO_PD27 (1u << 27) /**< \brief Pin Controlled by PD27 */ -#define PIO_PD28 (1u << 28) /**< \brief Pin Controlled by PD28 */ -#define PIO_PD30 (1u << 30) /**< \brief Pin Controlled by PD30 */ -#define PIO_PD31 (1u << 31) /**< \brief Pin Controlled by PD31 */ -/* ========== Pio definition for AFEC0 peripheral ========== */ -#define PIO_PD30X1_AFE0_AD0 (1u << 30) /**< \brief Afec0 signal: AFE0_AD0 */ -#define PIO_PA21X1_AFE0_AD1 (1u << 21) /**< \brief Afec0 signal: AFE0_AD1/PIODCEN2 */ -#define PIO_PA21X1_PIODCEN2 (1u << 21) /**< \brief Afec0 signal: AFE0_AD1/PIODCEN2 */ -#define PIO_PB0X1_AFE0_AD10 (1u << 0) /**< \brief Afec0 signal: AFE0_AD10/RTCOUT0 */ -#define PIO_PB0X1_RTCOUT0 (1u << 0) /**< \brief Afec0 signal: AFE0_AD10/RTCOUT0 */ -#define PIO_PB3X1_AFE0_AD2 (1u << 3) /**< \brief Afec0 signal: AFE0_AD2/WKUP12 */ -#define PIO_PB3X1_WKUP12 (1u << 3) /**< \brief Afec0 signal: AFE0_AD2/WKUP12 */ -#define PIO_PE5X1_AFE0_AD3 (1u << 5) /**< \brief Afec0 signal: AFE0_AD3 */ -#define PIO_PE4X1_AFE0_AD4 (1u << 4) /**< \brief Afec0 signal: AFE0_AD4 */ -#define PIO_PB2X1_AFE0_AD5 (1u << 2) /**< \brief Afec0 signal: AFE0_AD5 */ -#define PIO_PA17X1_AFE0_AD6 (1u << 17) /**< \brief Afec0 signal: AFE0_AD6 */ -#define PIO_PA18X1_AFE0_AD7 (1u << 18) /**< \brief Afec0 signal: AFE0_AD7 */ -#define PIO_PA19X1_AFE0_AD8 (1u << 19) /**< \brief Afec0 signal: AFE0_AD8/WKUP9 */ -#define PIO_PA19X1_WKUP9 (1u << 19) /**< \brief Afec0 signal: AFE0_AD8/WKUP9 */ -#define PIO_PA20X1_AFE0_AD9 (1u << 20) /**< \brief Afec0 signal: AFE0_AD9/WKUP10 */ -#define PIO_PA20X1_WKUP10 (1u << 20) /**< \brief Afec0 signal: AFE0_AD9/WKUP10 */ -#define PIO_PA8B_AFE0_ADTRG (1u << 8) /**< \brief Afec0 signal: AFE0_ADTRG */ -/* ========== Pio definition for AFEC1 peripheral ========== */ -#define PIO_PB1X1_AFE1_AD0 (1u << 1) /**< \brief Afec1 signal: AFE1_AD0/RTCOUT1 */ -#define PIO_PB1X1_RTCOUT1 (1u << 1) /**< \brief Afec1 signal: AFE1_AD0/RTCOUT1 */ -#define PIO_PC13X1_AFE1_AD1 (1u << 13) /**< \brief Afec1 signal: AFE1_AD1 */ -#define PIO_PE3X1_AFE1_AD10 (1u << 3) /**< \brief Afec1 signal: AFE1_AD10 */ -#define PIO_PE0X1_AFE1_AD11 (1u << 0) /**< \brief Afec1 signal: AFE1_AD11 */ -#define PIO_PC15X1_AFE1_AD2 (1u << 15) /**< \brief Afec1 signal: AFE1_AD2 */ -#define PIO_PC12X1_AFE1_AD3 (1u << 12) /**< \brief Afec1 signal: AFE1_AD3 */ -#define PIO_PC29X1_AFE1_AD4 (1u << 29) /**< \brief Afec1 signal: AFE1_AD4 */ -#define PIO_PC30X1_AFE1_AD5 (1u << 30) /**< \brief Afec1 signal: AFE1_AD5 */ -#define PIO_PC31X1_AFE1_AD6 (1u << 31) /**< \brief Afec1 signal: AFE1_AD6 */ -#define PIO_PC26X1_AFE1_AD7 (1u << 26) /**< \brief Afec1 signal: AFE1_AD7 */ -#define PIO_PC27X1_AFE1_AD8 (1u << 27) /**< \brief Afec1 signal: AFE1_AD8 */ -#define PIO_PC0X1_AFE1_AD9 (1u << 0) /**< \brief Afec1 signal: AFE1_AD9 */ -#define PIO_PD9C_AFE1_ADTRG (1u << 9) /**< \brief Afec1 signal: AFE1_ADTRG */ -/* ========== Pio definition for ARM peripheral ========== */ -#define PIO_PB7X1_SWCLK (1u << 7) /**< \brief Arm signal: SWCLK/TCK */ -#define PIO_PB7X1_TCK (1u << 7) /**< \brief Arm signal: SWCLK/TCK */ -#define PIO_PB6X1_SWDIO (1u << 6) /**< \brief Arm signal: SWDIO/TMS */ -#define PIO_PB6X1_TMS (1u << 6) /**< \brief Arm signal: SWDIO/TMS */ -#define PIO_PB4X1_TDI (1u << 4) /**< \brief Arm signal: TDI */ -#define PIO_PB5X1_TDO (1u << 5) /**< \brief Arm signal: TDO/TRACESWO/WKUP13 */ -#define PIO_PB5X1_TRACESWO (1u << 5) /**< \brief Arm signal: TDO/TRACESWO/WKUP13 */ -#define PIO_PB5X1_WKUP13 (1u << 5) /**< \brief Arm signal: TDO/TRACESWO/WKUP13 */ -/* ========== Pio definition for GMAC peripheral ========== */ -#define PIO_PD13A_GCOL (1u << 13) /**< \brief Gmac signal: GCOL */ -#define PIO_PD10A_GCRS (1u << 10) /**< \brief Gmac signal: GCRS */ -#define PIO_PD8A_GMDC (1u << 8) /**< \brief Gmac signal: GMDC */ -#define PIO_PD9A_GMDIO (1u << 9) /**< \brief Gmac signal: GMDIO */ -#define PIO_PD5A_GRX0 (1u << 5) /**< \brief Gmac signal: GRX0 */ -#define PIO_PD6A_GRX1 (1u << 6) /**< \brief Gmac signal: GRX1 */ -#define PIO_PD11A_GRX2 (1u << 11) /**< \brief Gmac signal: GRX2 */ -#define PIO_PD12A_GRX3 (1u << 12) /**< \brief Gmac signal: GRX3 */ -#define PIO_PD14A_GRXCK (1u << 14) /**< \brief Gmac signal: GRXCK */ -#define PIO_PD4A_GRXDV (1u << 4) /**< \brief Gmac signal: GRXDV */ -#define PIO_PD7A_GRXER (1u << 7) /**< \brief Gmac signal: GRXER */ -#define PIO_PB1B_GTSUCOMP (1u << 1) /**< \brief Gmac signal: GTSUCOMP */ -#define PIO_PB12B_GTSUCOMP (1u << 12) /**< \brief Gmac signal: GTSUCOMP */ -#define PIO_PD11C_GTSUCOMP (1u << 11) /**< \brief Gmac signal: GTSUCOMP */ -#define PIO_PD20C_GTSUCOMP (1u << 20) /**< \brief Gmac signal: GTSUCOMP */ -#define PIO_PD2A_GTX0 (1u << 2) /**< \brief Gmac signal: GTX0 */ -#define PIO_PD3A_GTX1 (1u << 3) /**< \brief Gmac signal: GTX1 */ -#define PIO_PD15A_GTX2 (1u << 15) /**< \brief Gmac signal: GTX2 */ -#define PIO_PD16A_GTX3 (1u << 16) /**< \brief Gmac signal: GTX3 */ -#define PIO_PD0A_GTXCK (1u << 0) /**< \brief Gmac signal: GTXCK */ -#define PIO_PD1A_GTXEN (1u << 1) /**< \brief Gmac signal: GTXEN */ -#define PIO_PD17A_GTXER (1u << 17) /**< \brief Gmac signal: GTXER */ -/* ========== Pio definition for HSMCI peripheral ========== */ -#define PIO_PA28C_MCCDA (1u << 28) /**< \brief Hsmci signal: MCCDA */ -#define PIO_PA25D_MCCK (1u << 25) /**< \brief Hsmci signal: MCCK */ -#define PIO_PA30C_MCDA0 (1u << 30) /**< \brief Hsmci signal: MCDA0 */ -#define PIO_PA31C_MCDA1 (1u << 31) /**< \brief Hsmci signal: MCDA1 */ -#define PIO_PA26C_MCDA2 (1u << 26) /**< \brief Hsmci signal: MCDA2 */ -#define PIO_PA27C_MCDA3 (1u << 27) /**< \brief Hsmci signal: MCDA3 */ -/* ========== Pio definition for ISI peripheral ========== */ -#define PIO_PD22D_ISI_D0 (1u << 22) /**< \brief Isi signal: ISI_D0 */ -#define PIO_PD21D_ISI_D1 (1u << 21) /**< \brief Isi signal: ISI_D1 */ -#define PIO_PD30D_ISI_D10 (1u << 30) /**< \brief Isi signal: ISI_D10 */ -#define PIO_PD31D_ISI_D11 (1u << 31) /**< \brief Isi signal: ISI_D11 */ -#define PIO_PB3D_ISI_D2 (1u << 3) /**< \brief Isi signal: ISI_D2 */ -#define PIO_PA9B_ISI_D3 (1u << 9) /**< \brief Isi signal: ISI_D3 */ -#define PIO_PA5B_ISI_D4 (1u << 5) /**< \brief Isi signal: ISI_D4 */ -#define PIO_PD11D_ISI_D5 (1u << 11) /**< \brief Isi signal: ISI_D5 */ -#define PIO_PD12D_ISI_D6 (1u << 12) /**< \brief Isi signal: ISI_D6 */ -#define PIO_PA27D_ISI_D7 (1u << 27) /**< \brief Isi signal: ISI_D7 */ -#define PIO_PD27D_ISI_D8 (1u << 27) /**< \brief Isi signal: ISI_D8 */ -#define PIO_PD28D_ISI_D9 (1u << 28) /**< \brief Isi signal: ISI_D9 */ -#define PIO_PD24D_ISI_HSYNC (1u << 24) /**< \brief Isi signal: ISI_HSYNC */ -#define PIO_PA24D_ISI_PCK (1u << 24) /**< \brief Isi signal: ISI_PCK */ -#define PIO_PD25D_ISI_VSYNC (1u << 25) /**< \brief Isi signal: ISI_VSYNC */ -/* ========== Pio definition for MCAN0 peripheral ========== */ -#define PIO_PB3A_CANRX0 (1u << 3) /**< \brief Mcan0 signal: CANRX0 */ -#define PIO_PB2A_CANTX0 (1u << 2) /**< \brief Mcan0 signal: CANTX0 */ -/* ========== Pio definition for MCAN1 peripheral ========== */ -#define PIO_PC12C_CANRX1 (1u << 12) /**< \brief Mcan1 signal: CANRX1 */ -#define PIO_PD28B_CANRX1 (1u << 28) /**< \brief Mcan1 signal: CANRX1 */ -#define PIO_PC14C_CANTX1 (1u << 14) /**< \brief Mcan1 signal: CANTX1 */ -#define PIO_PD12B_CANTX1 (1u << 12) /**< \brief Mcan1 signal: CANTX1 */ -/* ========== Pio definition for MLB peripheral ========== */ -#define PIO_PB4C_MLBCLK (1u << 4) /**< \brief Mlb signal: MLBCLK */ -#define PIO_PB5C_MLBDAT (1u << 5) /**< \brief Mlb signal: MLBDAT */ -#define PIO_PD10D_MLBSIG (1u << 10) /**< \brief Mlb signal: MLBSIG */ -/* ========== Pio definition for PIOA peripheral ========== */ -#define PIO_PA21X1_AFE0_AD1 (1u << 21) /**< \brief Pioa signal: AFE0_AD1/PIODCEN2 */ -#define PIO_PA21X1_PIODCEN2 (1u << 21) /**< \brief Pioa signal: AFE0_AD1/PIODCEN2 */ -#define PIO_PA3X1_PIODC0 (1u << 3) /**< \brief Pioa signal: PIODC0 */ -#define PIO_PA10X1_PIODC4 (1u << 10) /**< \brief Pioa signal: PIODC4 */ -#define PIO_PA12X1_PIODC6 (1u << 12) /**< \brief Pioa signal: PIODC6 */ -#define PIO_PA13X1_PIODC7 (1u << 13) /**< \brief Pioa signal: PIODC7 */ -#define PIO_PA22X1_PIODCCLK (1u << 22) /**< \brief Pioa signal: PIODCCLK */ -#define PIO_PA4X1_WKUP3 (1u << 4) /**< \brief Pioa signal: WKUP3/PIODC1 */ -#define PIO_PA4X1_PIODC1 (1u << 4) /**< \brief Pioa signal: WKUP3/PIODC1 */ -#define PIO_PA5X1_WKUP4 (1u << 5) /**< \brief Pioa signal: WKUP4/PIODC2 */ -#define PIO_PA5X1_PIODC2 (1u << 5) /**< \brief Pioa signal: WKUP4/PIODC2 */ -#define PIO_PA9X1_WKUP6 (1u << 9) /**< \brief Pioa signal: WKUP6/PIODC3 */ -#define PIO_PA9X1_PIODC3 (1u << 9) /**< \brief Pioa signal: WKUP6/PIODC3 */ -#define PIO_PA11X1_WKUP7 (1u << 11) /**< \brief Pioa signal: WKUP7/PIODC5 */ -#define PIO_PA11X1_PIODC5 (1u << 11) /**< \brief Pioa signal: WKUP7/PIODC5 */ -#define PIO_PA14X1_WKUP8 (1u << 14) /**< \brief Pioa signal: WKUP8/PIODCEN1 */ -#define PIO_PA14X1_PIODCEN1 (1u << 14) /**< \brief Pioa signal: WKUP8/PIODCEN1 */ -/* ========== Pio definition for PMC peripheral ========== */ -#define PIO_PA6B_PCK0 (1u << 6) /**< \brief Pmc signal: PCK0 */ -#define PIO_PB12D_PCK0 (1u << 12) /**< \brief Pmc signal: PCK0 */ -#define PIO_PB13B_PCK0 (1u << 13) /**< \brief Pmc signal: PCK0 */ -#define PIO_PA17B_PCK1 (1u << 17) /**< \brief Pmc signal: PCK1 */ -#define PIO_PA21B_PCK1 (1u << 21) /**< \brief Pmc signal: PCK1 */ -#define PIO_PA3C_PCK2 (1u << 3) /**< \brief Pmc signal: PCK2 */ -#define PIO_PA18B_PCK2 (1u << 18) /**< \brief Pmc signal: PCK2 */ -#define PIO_PA31B_PCK2 (1u << 31) /**< \brief Pmc signal: PCK2 */ -#define PIO_PB3B_PCK2 (1u << 3) /**< \brief Pmc signal: PCK2 */ -#define PIO_PD31C_PCK2 (1u << 31) /**< \brief Pmc signal: PCK2 */ -/* ========== Pio definition for PWM0 peripheral ========== */ -#define PIO_PA10B_PWMC0_PWMEXTRG0 (1u << 10) /**< \brief Pwm0 signal: PWMC0_PWMEXTRG0 */ -#define PIO_PA22B_PWMC0_PWMEXTRG1 (1u << 22) /**< \brief Pwm0 signal: PWMC0_PWMEXTRG1 */ -#define PIO_PA9C_PWMC0_PWMFI0 (1u << 9) /**< \brief Pwm0 signal: PWMC0_PWMFI0 */ -#define PIO_PD8B_PWMC0_PWMFI1 (1u << 8) /**< \brief Pwm0 signal: PWMC0_PWMFI1 */ -#define PIO_PD9B_PWMC0_PWMFI2 (1u << 9) /**< \brief Pwm0 signal: PWMC0_PWMFI2 */ -#define PIO_PA0A_PWMC0_PWMH0 (1u << 0) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PA11B_PWMC0_PWMH0 (1u << 11) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PA23B_PWMC0_PWMH0 (1u << 23) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PB0A_PWMC0_PWMH0 (1u << 0) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PD11B_PWMC0_PWMH0 (1u << 11) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PD20A_PWMC0_PWMH0 (1u << 20) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PA2A_PWMC0_PWMH1 (1u << 2) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PA12B_PWMC0_PWMH1 (1u << 12) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PA24B_PWMC0_PWMH1 (1u << 24) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PB1A_PWMC0_PWMH1 (1u << 1) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PD21A_PWMC0_PWMH1 (1u << 21) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PA13B_PWMC0_PWMH2 (1u << 13) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PA25B_PWMC0_PWMH2 (1u << 25) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PB4B_PWMC0_PWMH2 (1u << 4) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PC19B_PWMC0_PWMH2 (1u << 19) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PD22A_PWMC0_PWMH2 (1u << 22) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PA7B_PWMC0_PWMH3 (1u << 7) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PA14B_PWMC0_PWMH3 (1u << 14) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PA17C_PWMC0_PWMH3 (1u << 17) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PC13B_PWMC0_PWMH3 (1u << 13) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PC21B_PWMC0_PWMH3 (1u << 21) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PD23A_PWMC0_PWMH3 (1u << 23) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PA1A_PWMC0_PWML0 (1u << 1) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PA19B_PWMC0_PWML0 (1u << 19) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PB5B_PWMC0_PWML0 (1u << 5) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PC0B_PWMC0_PWML0 (1u << 0) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PD10B_PWMC0_PWML0 (1u << 10) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PD24A_PWMC0_PWML0 (1u << 24) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PA20B_PWMC0_PWML1 (1u << 20) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PB12A_PWMC0_PWML1 (1u << 12) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PC1B_PWMC0_PWML1 (1u << 1) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PC18B_PWMC0_PWML1 (1u << 18) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PD25A_PWMC0_PWML1 (1u << 25) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PA16C_PWMC0_PWML2 (1u << 16) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PA30A_PWMC0_PWML2 (1u << 30) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PB13A_PWMC0_PWML2 (1u << 13) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PC2B_PWMC0_PWML2 (1u << 2) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PC20B_PWMC0_PWML2 (1u << 20) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PD26A_PWMC0_PWML2 (1u << 26) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PA15C_PWMC0_PWML3 (1u << 15) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -#define PIO_PC3B_PWMC0_PWML3 (1u << 3) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -#define PIO_PC15B_PWMC0_PWML3 (1u << 15) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -#define PIO_PC22B_PWMC0_PWML3 (1u << 22) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -#define PIO_PD27A_PWMC0_PWML3 (1u << 27) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -/* ========== Pio definition for PWM1 peripheral ========== */ -#define PIO_PA30B_PWMC1_PWMEXTRG0 (1u << 30) /**< \brief Pwm1 signal: PWMC1_PWMEXTRG0 */ -#define PIO_PA18A_PWMC1_PWMEXTRG1 (1u << 18) /**< \brief Pwm1 signal: PWMC1_PWMEXTRG1 */ -#define PIO_PA21C_PWMC1_PWMFI0 (1u << 21) /**< \brief Pwm1 signal: PWMC1_PWMFI0 */ -#define PIO_PA26D_PWMC1_PWMFI1 (1u << 26) /**< \brief Pwm1 signal: PWMC1_PWMFI1 */ -#define PIO_PA28D_PWMC1_PWMFI2 (1u << 28) /**< \brief Pwm1 signal: PWMC1_PWMFI2 */ -#define PIO_PA12C_PWMC1_PWMH0 (1u << 12) /**< \brief Pwm1 signal: PWMC1_PWMH0 */ -#define PIO_PD1B_PWMC1_PWMH0 (1u << 1) /**< \brief Pwm1 signal: PWMC1_PWMH0 */ -#define PIO_PA14C_PWMC1_PWMH1 (1u << 14) /**< \brief Pwm1 signal: PWMC1_PWMH1 */ -#define PIO_PD3B_PWMC1_PWMH1 (1u << 3) /**< \brief Pwm1 signal: PWMC1_PWMH1 */ -#define PIO_PA31D_PWMC1_PWMH2 (1u << 31) /**< \brief Pwm1 signal: PWMC1_PWMH2 */ -#define PIO_PD5B_PWMC1_PWMH2 (1u << 5) /**< \brief Pwm1 signal: PWMC1_PWMH2 */ -#define PIO_PA8A_PWMC1_PWMH3 (1u << 8) /**< \brief Pwm1 signal: PWMC1_PWMH3 */ -#define PIO_PD7B_PWMC1_PWMH3 (1u << 7) /**< \brief Pwm1 signal: PWMC1_PWMH3 */ -#define PIO_PA11C_PWMC1_PWML0 (1u << 11) /**< \brief Pwm1 signal: PWMC1_PWML0 */ -#define PIO_PD0B_PWMC1_PWML0 (1u << 0) /**< \brief Pwm1 signal: PWMC1_PWML0 */ -#define PIO_PA13C_PWMC1_PWML1 (1u << 13) /**< \brief Pwm1 signal: PWMC1_PWML1 */ -#define PIO_PD2B_PWMC1_PWML1 (1u << 2) /**< \brief Pwm1 signal: PWMC1_PWML1 */ -#define PIO_PA23D_PWMC1_PWML2 (1u << 23) /**< \brief Pwm1 signal: PWMC1_PWML2 */ -#define PIO_PD4B_PWMC1_PWML2 (1u << 4) /**< \brief Pwm1 signal: PWMC1_PWML2 */ -#define PIO_PA5A_PWMC1_PWML3 (1u << 5) /**< \brief Pwm1 signal: PWMC1_PWML3 */ -#define PIO_PD6B_PWMC1_PWML3 (1u << 6) /**< \brief Pwm1 signal: PWMC1_PWML3 */ -/* ========== Pio definition for QSPI peripheral ========== */ -#define PIO_PA11A_QCS (1u << 11) /**< \brief Qspi signal: QCS */ -#define PIO_PA13A_QIO0 (1u << 13) /**< \brief Qspi signal: QIO0 */ -#define PIO_PA12A_QIO1 (1u << 12) /**< \brief Qspi signal: QIO1 */ -#define PIO_PA17A_QIO2 (1u << 17) /**< \brief Qspi signal: QIO2 */ -#define PIO_PD31A_QIO3 (1u << 31) /**< \brief Qspi signal: QIO3 */ -#define PIO_PA14A_QSCK (1u << 14) /**< \brief Qspi signal: QSCK */ -/* ========== Pio definition for SPI0 peripheral ========== */ -#define PIO_PD20B_SPI0_MISO (1u << 20) /**< \brief Spi0 signal: SPI0_MISO */ -#define PIO_PD21B_SPI0_MOSI (1u << 21) /**< \brief Spi0 signal: SPI0_MOSI */ -#define PIO_PB2D_SPI0_NPCS0 (1u << 2) /**< \brief Spi0 signal: SPI0_NPCS0 */ -#define PIO_PA31A_SPI0_NPCS1 (1u << 31) /**< \brief Spi0 signal: SPI0_NPCS1 */ -#define PIO_PD25B_SPI0_NPCS1 (1u << 25) /**< \brief Spi0 signal: SPI0_NPCS1 */ -#define PIO_PD12C_SPI0_NPCS2 (1u << 12) /**< \brief Spi0 signal: SPI0_NPCS2 */ -#define PIO_PD27B_SPI0_NPCS3 (1u << 27) /**< \brief Spi0 signal: SPI0_NPCS3 */ -#define PIO_PD22B_SPI0_SPCK (1u << 22) /**< \brief Spi0 signal: SPI0_SPCK */ -/* ========== Pio definition for SPI1 peripheral ========== */ -#define PIO_PC26C_SPI1_MISO (1u << 26) /**< \brief Spi1 signal: SPI1_MISO */ -#define PIO_PC27C_SPI1_MOSI (1u << 27) /**< \brief Spi1 signal: SPI1_MOSI */ -#define PIO_PC25C_SPI1_NPCS0 (1u << 25) /**< \brief Spi1 signal: SPI1_NPCS0 */ -#define PIO_PC28C_SPI1_NPCS1 (1u << 28) /**< \brief Spi1 signal: SPI1_NPCS1 */ -#define PIO_PD0C_SPI1_NPCS1 (1u << 0) /**< \brief Spi1 signal: SPI1_NPCS1 */ -#define PIO_PC29C_SPI1_NPCS2 (1u << 29) /**< \brief Spi1 signal: SPI1_NPCS2 */ -#define PIO_PD1C_SPI1_NPCS2 (1u << 1) /**< \brief Spi1 signal: SPI1_NPCS2 */ -#define PIO_PC30C_SPI1_NPCS3 (1u << 30) /**< \brief Spi1 signal: SPI1_NPCS3 */ -#define PIO_PD2C_SPI1_NPCS3 (1u << 2) /**< \brief Spi1 signal: SPI1_NPCS3 */ -#define PIO_PC24C_SPI1_SPCK (1u << 24) /**< \brief Spi1 signal: SPI1_SPCK */ -/* ========== Pio definition for SSC peripheral ========== */ -#define PIO_PA10C_RD (1u << 10) /**< \brief Ssc signal: RD */ -#define PIO_PD24B_RF (1u << 24) /**< \brief Ssc signal: RF */ -#define PIO_PA22A_RK (1u << 22) /**< \brief Ssc signal: RK */ -#define PIO_PB5D_TD (1u << 5) /**< \brief Ssc signal: TD */ -#define PIO_PD10C_TD (1u << 10) /**< \brief Ssc signal: TD */ -#define PIO_PD26B_TD (1u << 26) /**< \brief Ssc signal: TD */ -#define PIO_PB0D_TF (1u << 0) /**< \brief Ssc signal: TF */ -#define PIO_PB1D_TK (1u << 1) /**< \brief Ssc signal: TK */ -/* ========== Pio definition for TC0 peripheral ========== */ -#define PIO_PA4B_TCLK0 (1u << 4) /**< \brief Tc0 signal: TCLK0 */ -#define PIO_PA28B_TCLK1 (1u << 28) /**< \brief Tc0 signal: TCLK1 */ -#define PIO_PA29B_TCLK2 (1u << 29) /**< \brief Tc0 signal: TCLK2 */ -#define PIO_PA0B_TIOA0 (1u << 0) /**< \brief Tc0 signal: TIOA0 */ -#define PIO_PA15B_TIOA1 (1u << 15) /**< \brief Tc0 signal: TIOA1 */ -#define PIO_PA26B_TIOA2 (1u << 26) /**< \brief Tc0 signal: TIOA2 */ -#define PIO_PA1B_TIOB0 (1u << 1) /**< \brief Tc0 signal: TIOB0 */ -#define PIO_PA16B_TIOB1 (1u << 16) /**< \brief Tc0 signal: TIOB1 */ -#define PIO_PA27B_TIOB2 (1u << 27) /**< \brief Tc0 signal: TIOB2 */ -/* ========== Pio definition for TC3 peripheral ========== */ -#define PIO_PE5B_TCLK10 (1u << 5) /**< \brief Tc3 signal: TCLK10 */ -#define PIO_PD24C_TCLK11 (1u << 24) /**< \brief Tc3 signal: TCLK11 */ -#define PIO_PE2B_TCLK9 (1u << 2) /**< \brief Tc3 signal: TCLK9 */ -#define PIO_PE3B_TIOA10 (1u << 3) /**< \brief Tc3 signal: TIOA10 */ -#define PIO_PD21C_TIOA11 (1u << 21) /**< \brief Tc3 signal: TIOA11 */ -#define PIO_PE0B_TIOA9 (1u << 0) /**< \brief Tc3 signal: TIOA9 */ -#define PIO_PE4B_TIOB10 (1u << 4) /**< \brief Tc3 signal: TIOB10 */ -#define PIO_PD22C_TIOB11 (1u << 22) /**< \brief Tc3 signal: TIOB11 */ -#define PIO_PE1B_TIOB9 (1u << 1) /**< \brief Tc3 signal: TIOB9 */ -/* ========== Pio definition for TWIHS0 peripheral ========== */ -#define PIO_PA4A_TWCK0 (1u << 4) /**< \brief Twihs0 signal: TWCK0 */ -#define PIO_PA3A_TWD0 (1u << 3) /**< \brief Twihs0 signal: TWD0 */ -/* ========== Pio definition for TWIHS1 peripheral ========== */ -#define PIO_PB5A_TWCK1 (1u << 5) /**< \brief Twihs1 signal: TWCK1 */ -#define PIO_PB4A_TWD1 (1u << 4) /**< \brief Twihs1 signal: TWD1 */ -/* ========== Pio definition for TWIHS2 peripheral ========== */ -#define PIO_PD28C_TWCK2 (1u << 28) /**< \brief Twihs2 signal: TWCK2 */ -#define PIO_PD27C_TWD2 (1u << 27) /**< \brief Twihs2 signal: TWD2 */ -/* ========== Pio definition for UART0 peripheral ========== */ -#define PIO_PA9A_URXD0 (1u << 9) /**< \brief Uart0 signal: URXD0 */ -#define PIO_PA10A_UTXD0 (1u << 10) /**< \brief Uart0 signal: UTXD0 */ -/* ========== Pio definition for UART1 peripheral ========== */ -#define PIO_PA5C_URXD1 (1u << 5) /**< \brief Uart1 signal: URXD1 */ -#define PIO_PA4C_UTXD1 (1u << 4) /**< \brief Uart1 signal: UTXD1 */ -#define PIO_PA6C_UTXD1 (1u << 6) /**< \brief Uart1 signal: UTXD1 */ -#define PIO_PD26D_UTXD1 (1u << 26) /**< \brief Uart1 signal: UTXD1 */ -/* ========== Pio definition for UART2 peripheral ========== */ -#define PIO_PD25C_URXD2 (1u << 25) /**< \brief Uart2 signal: URXD2 */ -#define PIO_PD26C_UTXD2 (1u << 26) /**< \brief Uart2 signal: UTXD2 */ -/* ========== Pio definition for UART3 peripheral ========== */ -#define PIO_PD28A_URXD3 (1u << 28) /**< \brief Uart3 signal: URXD3 */ -#define PIO_PD30A_UTXD3 (1u << 30) /**< \brief Uart3 signal: UTXD3 */ -#define PIO_PD31B_UTXD3 (1u << 31) /**< \brief Uart3 signal: UTXD3 */ -/* ========== Pio definition for UART4 peripheral ========== */ -#define PIO_PD18C_URXD4 (1u << 18) /**< \brief Uart4 signal: URXD4 */ -#define PIO_PD3C_UTXD4 (1u << 3) /**< \brief Uart4 signal: UTXD4 */ -#define PIO_PD19C_UTXD4 (1u << 19) /**< \brief Uart4 signal: UTXD4 */ -/* ========== Pio definition for USART0 peripheral ========== */ -#define PIO_PB2C_CTS0 (1u << 2) /**< \brief Usart0 signal: CTS0 */ -#define PIO_PD0D_DCD0 (1u << 0) /**< \brief Usart0 signal: DCD0 */ -#define PIO_PD2D_DSR0 (1u << 2) /**< \brief Usart0 signal: DSR0 */ -#define PIO_PD1D_DTR0 (1u << 1) /**< \brief Usart0 signal: DTR0 */ -#define PIO_PD3D_RI0 (1u << 3) /**< \brief Usart0 signal: RI0 */ -#define PIO_PB3C_RTS0 (1u << 3) /**< \brief Usart0 signal: RTS0 */ -#define PIO_PB0C_RXD0 (1u << 0) /**< \brief Usart0 signal: RXD0 */ -#define PIO_PB13C_SCK0 (1u << 13) /**< \brief Usart0 signal: SCK0 */ -#define PIO_PB1C_TXD0 (1u << 1) /**< \brief Usart0 signal: TXD0 */ -/* ========== Pio definition for USART1 peripheral ========== */ -#define PIO_PA25A_CTS1 (1u << 25) /**< \brief Usart1 signal: CTS1 */ -#define PIO_PA26A_DCD1 (1u << 26) /**< \brief Usart1 signal: DCD1 */ -#define PIO_PA28A_DSR1 (1u << 28) /**< \brief Usart1 signal: DSR1 */ -#define PIO_PA27A_DTR1 (1u << 27) /**< \brief Usart1 signal: DTR1 */ -#define PIO_PA3B_LONCOL1 (1u << 3) /**< \brief Usart1 signal: LONCOL1 */ -#define PIO_PA29A_RI1 (1u << 29) /**< \brief Usart1 signal: RI1 */ -#define PIO_PA24A_RTS1 (1u << 24) /**< \brief Usart1 signal: RTS1 */ -#define PIO_PA21A_RXD1 (1u << 21) /**< \brief Usart1 signal: RXD1 */ -#define PIO_PA23A_SCK1 (1u << 23) /**< \brief Usart1 signal: SCK1 */ -#define PIO_PB4D_TXD1 (1u << 4) /**< \brief Usart1 signal: TXD1 */ -/* ========== Pio definition for USART2 peripheral ========== */ -#define PIO_PD19B_CTS2 (1u << 19) /**< \brief Usart2 signal: CTS2 */ -#define PIO_PD4D_DCD2 (1u << 4) /**< \brief Usart2 signal: DCD2 */ -#define PIO_PD6D_DSR2 (1u << 6) /**< \brief Usart2 signal: DSR2 */ -#define PIO_PD5D_DTR2 (1u << 5) /**< \brief Usart2 signal: DTR2 */ -#define PIO_PD7D_RI2 (1u << 7) /**< \brief Usart2 signal: RI2 */ -#define PIO_PD18B_RTS2 (1u << 18) /**< \brief Usart2 signal: RTS2 */ -#define PIO_PD15B_RXD2 (1u << 15) /**< \brief Usart2 signal: RXD2 */ -#define PIO_PD17B_SCK2 (1u << 17) /**< \brief Usart2 signal: SCK2 */ -#define PIO_PD16B_TXD2 (1u << 16) /**< \brief Usart2 signal: TXD2 */ -/* ========== Pio indexes ========== */ -#define PIO_PA0_IDX 0 -#define PIO_PA1_IDX 1 -#define PIO_PA2_IDX 2 -#define PIO_PA3_IDX 3 -#define PIO_PA4_IDX 4 -#define PIO_PA5_IDX 5 -#define PIO_PA7_IDX 7 -#define PIO_PA8_IDX 8 -#define PIO_PA9_IDX 9 -#define PIO_PA10_IDX 10 -#define PIO_PA11_IDX 11 -#define PIO_PA12_IDX 12 -#define PIO_PA13_IDX 13 -#define PIO_PA14_IDX 14 -#define PIO_PA15_IDX 15 -#define PIO_PA16_IDX 16 -#define PIO_PA17_IDX 17 -#define PIO_PA18_IDX 18 -#define PIO_PA19_IDX 19 -#define PIO_PA20_IDX 20 -#define PIO_PA21_IDX 21 -#define PIO_PA22_IDX 22 -#define PIO_PA23_IDX 23 -#define PIO_PA24_IDX 24 -#define PIO_PA25_IDX 25 -#define PIO_PA26_IDX 26 -#define PIO_PA27_IDX 27 -#define PIO_PA28_IDX 28 -#define PIO_PA30_IDX 30 -#define PIO_PA31_IDX 31 -#define PIO_PB0_IDX 32 -#define PIO_PB1_IDX 33 -#define PIO_PB2_IDX 34 -#define PIO_PB3_IDX 35 -#define PIO_PB4_IDX 36 -#define PIO_PB5_IDX 37 -#define PIO_PB6_IDX 38 -#define PIO_PB7_IDX 39 -#define PIO_PB8_IDX 40 -#define PIO_PB9_IDX 41 -#define PIO_PB12_IDX 44 -#define PIO_PB13_IDX 45 -#define PIO_PD0_IDX 96 -#define PIO_PD1_IDX 97 -#define PIO_PD2_IDX 98 -#define PIO_PD3_IDX 99 -#define PIO_PD4_IDX 100 -#define PIO_PD5_IDX 101 -#define PIO_PD6_IDX 102 -#define PIO_PD7_IDX 103 -#define PIO_PD8_IDX 104 -#define PIO_PD9_IDX 105 -#define PIO_PD10_IDX 106 -#define PIO_PD11_IDX 107 -#define PIO_PD12_IDX 108 -#define PIO_PD13_IDX 109 -#define PIO_PD14_IDX 110 -#define PIO_PD15_IDX 111 -#define PIO_PD16_IDX 112 -#define PIO_PD17_IDX 113 -#define PIO_PD18_IDX 114 -#define PIO_PD19_IDX 115 -#define PIO_PD20_IDX 116 -#define PIO_PD21_IDX 117 -#define PIO_PD22_IDX 118 -#define PIO_PD24_IDX 120 -#define PIO_PD25_IDX 121 -#define PIO_PD26_IDX 122 -#define PIO_PD27_IDX 123 -#define PIO_PD28_IDX 124 -#define PIO_PD30_IDX 126 -#define PIO_PD31_IDX 127 - -#endif /* _SAMV71N20_PIO_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/pio/pio_samv71n21.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/pio/pio_samv71n21.h deleted file mode 100644 index 58d4e17c..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/pio/pio_samv71n21.h +++ /dev/null @@ -1,495 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71N21_PIO_ -#define _SAMV71N21_PIO_ - -#define PIO_PA0 (1u << 0) /**< \brief Pin Controlled by PA0 */ -#define PIO_PA1 (1u << 1) /**< \brief Pin Controlled by PA1 */ -#define PIO_PA2 (1u << 2) /**< \brief Pin Controlled by PA2 */ -#define PIO_PA3 (1u << 3) /**< \brief Pin Controlled by PA3 */ -#define PIO_PA4 (1u << 4) /**< \brief Pin Controlled by PA4 */ -#define PIO_PA5 (1u << 5) /**< \brief Pin Controlled by PA5 */ -#define PIO_PA7 (1u << 7) /**< \brief Pin Controlled by PA7 */ -#define PIO_PA8 (1u << 8) /**< \brief Pin Controlled by PA8 */ -#define PIO_PA9 (1u << 9) /**< \brief Pin Controlled by PA9 */ -#define PIO_PA10 (1u << 10) /**< \brief Pin Controlled by PA10 */ -#define PIO_PA11 (1u << 11) /**< \brief Pin Controlled by PA11 */ -#define PIO_PA12 (1u << 12) /**< \brief Pin Controlled by PA12 */ -#define PIO_PA13 (1u << 13) /**< \brief Pin Controlled by PA13 */ -#define PIO_PA14 (1u << 14) /**< \brief Pin Controlled by PA14 */ -#define PIO_PA15 (1u << 15) /**< \brief Pin Controlled by PA15 */ -#define PIO_PA16 (1u << 16) /**< \brief Pin Controlled by PA16 */ -#define PIO_PA17 (1u << 17) /**< \brief Pin Controlled by PA17 */ -#define PIO_PA18 (1u << 18) /**< \brief Pin Controlled by PA18 */ -#define PIO_PA19 (1u << 19) /**< \brief Pin Controlled by PA19 */ -#define PIO_PA20 (1u << 20) /**< \brief Pin Controlled by PA20 */ -#define PIO_PA21 (1u << 21) /**< \brief Pin Controlled by PA21 */ -#define PIO_PA22 (1u << 22) /**< \brief Pin Controlled by PA22 */ -#define PIO_PA23 (1u << 23) /**< \brief Pin Controlled by PA23 */ -#define PIO_PA24 (1u << 24) /**< \brief Pin Controlled by PA24 */ -#define PIO_PA25 (1u << 25) /**< \brief Pin Controlled by PA25 */ -#define PIO_PA26 (1u << 26) /**< \brief Pin Controlled by PA26 */ -#define PIO_PA27 (1u << 27) /**< \brief Pin Controlled by PA27 */ -#define PIO_PA28 (1u << 28) /**< \brief Pin Controlled by PA28 */ -#define PIO_PA30 (1u << 30) /**< \brief Pin Controlled by PA30 */ -#define PIO_PA31 (1u << 31) /**< \brief Pin Controlled by PA31 */ -#define PIO_PB0 (1u << 0) /**< \brief Pin Controlled by PB0 */ -#define PIO_PB1 (1u << 1) /**< \brief Pin Controlled by PB1 */ -#define PIO_PB2 (1u << 2) /**< \brief Pin Controlled by PB2 */ -#define PIO_PB3 (1u << 3) /**< \brief Pin Controlled by PB3 */ -#define PIO_PB4 (1u << 4) /**< \brief Pin Controlled by PB4 */ -#define PIO_PB5 (1u << 5) /**< \brief Pin Controlled by PB5 */ -#define PIO_PB6 (1u << 6) /**< \brief Pin Controlled by PB6 */ -#define PIO_PB7 (1u << 7) /**< \brief Pin Controlled by PB7 */ -#define PIO_PB8 (1u << 8) /**< \brief Pin Controlled by PB8 */ -#define PIO_PB9 (1u << 9) /**< \brief Pin Controlled by PB9 */ -#define PIO_PB12 (1u << 12) /**< \brief Pin Controlled by PB12 */ -#define PIO_PB13 (1u << 13) /**< \brief Pin Controlled by PB13 */ -#define PIO_PD0 (1u << 0) /**< \brief Pin Controlled by PD0 */ -#define PIO_PD1 (1u << 1) /**< \brief Pin Controlled by PD1 */ -#define PIO_PD2 (1u << 2) /**< \brief Pin Controlled by PD2 */ -#define PIO_PD3 (1u << 3) /**< \brief Pin Controlled by PD3 */ -#define PIO_PD4 (1u << 4) /**< \brief Pin Controlled by PD4 */ -#define PIO_PD5 (1u << 5) /**< \brief Pin Controlled by PD5 */ -#define PIO_PD6 (1u << 6) /**< \brief Pin Controlled by PD6 */ -#define PIO_PD7 (1u << 7) /**< \brief Pin Controlled by PD7 */ -#define PIO_PD8 (1u << 8) /**< \brief Pin Controlled by PD8 */ -#define PIO_PD9 (1u << 9) /**< \brief Pin Controlled by PD9 */ -#define PIO_PD10 (1u << 10) /**< \brief Pin Controlled by PD10 */ -#define PIO_PD11 (1u << 11) /**< \brief Pin Controlled by PD11 */ -#define PIO_PD12 (1u << 12) /**< \brief Pin Controlled by PD12 */ -#define PIO_PD13 (1u << 13) /**< \brief Pin Controlled by PD13 */ -#define PIO_PD14 (1u << 14) /**< \brief Pin Controlled by PD14 */ -#define PIO_PD15 (1u << 15) /**< \brief Pin Controlled by PD15 */ -#define PIO_PD16 (1u << 16) /**< \brief Pin Controlled by PD16 */ -#define PIO_PD17 (1u << 17) /**< \brief Pin Controlled by PD17 */ -#define PIO_PD18 (1u << 18) /**< \brief Pin Controlled by PD18 */ -#define PIO_PD19 (1u << 19) /**< \brief Pin Controlled by PD19 */ -#define PIO_PD20 (1u << 20) /**< \brief Pin Controlled by PD20 */ -#define PIO_PD21 (1u << 21) /**< \brief Pin Controlled by PD21 */ -#define PIO_PD22 (1u << 22) /**< \brief Pin Controlled by PD22 */ -#define PIO_PD24 (1u << 24) /**< \brief Pin Controlled by PD24 */ -#define PIO_PD25 (1u << 25) /**< \brief Pin Controlled by PD25 */ -#define PIO_PD26 (1u << 26) /**< \brief Pin Controlled by PD26 */ -#define PIO_PD27 (1u << 27) /**< \brief Pin Controlled by PD27 */ -#define PIO_PD28 (1u << 28) /**< \brief Pin Controlled by PD28 */ -#define PIO_PD30 (1u << 30) /**< \brief Pin Controlled by PD30 */ -#define PIO_PD31 (1u << 31) /**< \brief Pin Controlled by PD31 */ -/* ========== Pio definition for AFEC0 peripheral ========== */ -#define PIO_PD30X1_AFE0_AD0 (1u << 30) /**< \brief Afec0 signal: AFE0_AD0 */ -#define PIO_PA21X1_AFE0_AD1 (1u << 21) /**< \brief Afec0 signal: AFE0_AD1/PIODCEN2 */ -#define PIO_PA21X1_PIODCEN2 (1u << 21) /**< \brief Afec0 signal: AFE0_AD1/PIODCEN2 */ -#define PIO_PB0X1_AFE0_AD10 (1u << 0) /**< \brief Afec0 signal: AFE0_AD10/RTCOUT0 */ -#define PIO_PB0X1_RTCOUT0 (1u << 0) /**< \brief Afec0 signal: AFE0_AD10/RTCOUT0 */ -#define PIO_PB3X1_AFE0_AD2 (1u << 3) /**< \brief Afec0 signal: AFE0_AD2/WKUP12 */ -#define PIO_PB3X1_WKUP12 (1u << 3) /**< \brief Afec0 signal: AFE0_AD2/WKUP12 */ -#define PIO_PE5X1_AFE0_AD3 (1u << 5) /**< \brief Afec0 signal: AFE0_AD3 */ -#define PIO_PE4X1_AFE0_AD4 (1u << 4) /**< \brief Afec0 signal: AFE0_AD4 */ -#define PIO_PB2X1_AFE0_AD5 (1u << 2) /**< \brief Afec0 signal: AFE0_AD5 */ -#define PIO_PA17X1_AFE0_AD6 (1u << 17) /**< \brief Afec0 signal: AFE0_AD6 */ -#define PIO_PA18X1_AFE0_AD7 (1u << 18) /**< \brief Afec0 signal: AFE0_AD7 */ -#define PIO_PA19X1_AFE0_AD8 (1u << 19) /**< \brief Afec0 signal: AFE0_AD8/WKUP9 */ -#define PIO_PA19X1_WKUP9 (1u << 19) /**< \brief Afec0 signal: AFE0_AD8/WKUP9 */ -#define PIO_PA20X1_AFE0_AD9 (1u << 20) /**< \brief Afec0 signal: AFE0_AD9/WKUP10 */ -#define PIO_PA20X1_WKUP10 (1u << 20) /**< \brief Afec0 signal: AFE0_AD9/WKUP10 */ -#define PIO_PA8B_AFE0_ADTRG (1u << 8) /**< \brief Afec0 signal: AFE0_ADTRG */ -/* ========== Pio definition for AFEC1 peripheral ========== */ -#define PIO_PB1X1_AFE1_AD0 (1u << 1) /**< \brief Afec1 signal: AFE1_AD0/RTCOUT1 */ -#define PIO_PB1X1_RTCOUT1 (1u << 1) /**< \brief Afec1 signal: AFE1_AD0/RTCOUT1 */ -#define PIO_PC13X1_AFE1_AD1 (1u << 13) /**< \brief Afec1 signal: AFE1_AD1 */ -#define PIO_PE3X1_AFE1_AD10 (1u << 3) /**< \brief Afec1 signal: AFE1_AD10 */ -#define PIO_PE0X1_AFE1_AD11 (1u << 0) /**< \brief Afec1 signal: AFE1_AD11 */ -#define PIO_PC15X1_AFE1_AD2 (1u << 15) /**< \brief Afec1 signal: AFE1_AD2 */ -#define PIO_PC12X1_AFE1_AD3 (1u << 12) /**< \brief Afec1 signal: AFE1_AD3 */ -#define PIO_PC29X1_AFE1_AD4 (1u << 29) /**< \brief Afec1 signal: AFE1_AD4 */ -#define PIO_PC30X1_AFE1_AD5 (1u << 30) /**< \brief Afec1 signal: AFE1_AD5 */ -#define PIO_PC31X1_AFE1_AD6 (1u << 31) /**< \brief Afec1 signal: AFE1_AD6 */ -#define PIO_PC26X1_AFE1_AD7 (1u << 26) /**< \brief Afec1 signal: AFE1_AD7 */ -#define PIO_PC27X1_AFE1_AD8 (1u << 27) /**< \brief Afec1 signal: AFE1_AD8 */ -#define PIO_PC0X1_AFE1_AD9 (1u << 0) /**< \brief Afec1 signal: AFE1_AD9 */ -#define PIO_PD9C_AFE1_ADTRG (1u << 9) /**< \brief Afec1 signal: AFE1_ADTRG */ -/* ========== Pio definition for ARM peripheral ========== */ -#define PIO_PB7X1_SWCLK (1u << 7) /**< \brief Arm signal: SWCLK/TCK */ -#define PIO_PB7X1_TCK (1u << 7) /**< \brief Arm signal: SWCLK/TCK */ -#define PIO_PB6X1_SWDIO (1u << 6) /**< \brief Arm signal: SWDIO/TMS */ -#define PIO_PB6X1_TMS (1u << 6) /**< \brief Arm signal: SWDIO/TMS */ -#define PIO_PB4X1_TDI (1u << 4) /**< \brief Arm signal: TDI */ -#define PIO_PB5X1_TDO (1u << 5) /**< \brief Arm signal: TDO/TRACESWO/WKUP13 */ -#define PIO_PB5X1_TRACESWO (1u << 5) /**< \brief Arm signal: TDO/TRACESWO/WKUP13 */ -#define PIO_PB5X1_WKUP13 (1u << 5) /**< \brief Arm signal: TDO/TRACESWO/WKUP13 */ -/* ========== Pio definition for GMAC peripheral ========== */ -#define PIO_PD13A_GCOL (1u << 13) /**< \brief Gmac signal: GCOL */ -#define PIO_PD10A_GCRS (1u << 10) /**< \brief Gmac signal: GCRS */ -#define PIO_PD8A_GMDC (1u << 8) /**< \brief Gmac signal: GMDC */ -#define PIO_PD9A_GMDIO (1u << 9) /**< \brief Gmac signal: GMDIO */ -#define PIO_PD5A_GRX0 (1u << 5) /**< \brief Gmac signal: GRX0 */ -#define PIO_PD6A_GRX1 (1u << 6) /**< \brief Gmac signal: GRX1 */ -#define PIO_PD11A_GRX2 (1u << 11) /**< \brief Gmac signal: GRX2 */ -#define PIO_PD12A_GRX3 (1u << 12) /**< \brief Gmac signal: GRX3 */ -#define PIO_PD14A_GRXCK (1u << 14) /**< \brief Gmac signal: GRXCK */ -#define PIO_PD4A_GRXDV (1u << 4) /**< \brief Gmac signal: GRXDV */ -#define PIO_PD7A_GRXER (1u << 7) /**< \brief Gmac signal: GRXER */ -#define PIO_PB1B_GTSUCOMP (1u << 1) /**< \brief Gmac signal: GTSUCOMP */ -#define PIO_PB12B_GTSUCOMP (1u << 12) /**< \brief Gmac signal: GTSUCOMP */ -#define PIO_PD11C_GTSUCOMP (1u << 11) /**< \brief Gmac signal: GTSUCOMP */ -#define PIO_PD20C_GTSUCOMP (1u << 20) /**< \brief Gmac signal: GTSUCOMP */ -#define PIO_PD2A_GTX0 (1u << 2) /**< \brief Gmac signal: GTX0 */ -#define PIO_PD3A_GTX1 (1u << 3) /**< \brief Gmac signal: GTX1 */ -#define PIO_PD15A_GTX2 (1u << 15) /**< \brief Gmac signal: GTX2 */ -#define PIO_PD16A_GTX3 (1u << 16) /**< \brief Gmac signal: GTX3 */ -#define PIO_PD0A_GTXCK (1u << 0) /**< \brief Gmac signal: GTXCK */ -#define PIO_PD1A_GTXEN (1u << 1) /**< \brief Gmac signal: GTXEN */ -#define PIO_PD17A_GTXER (1u << 17) /**< \brief Gmac signal: GTXER */ -/* ========== Pio definition for HSMCI peripheral ========== */ -#define PIO_PA28C_MCCDA (1u << 28) /**< \brief Hsmci signal: MCCDA */ -#define PIO_PA25D_MCCK (1u << 25) /**< \brief Hsmci signal: MCCK */ -#define PIO_PA30C_MCDA0 (1u << 30) /**< \brief Hsmci signal: MCDA0 */ -#define PIO_PA31C_MCDA1 (1u << 31) /**< \brief Hsmci signal: MCDA1 */ -#define PIO_PA26C_MCDA2 (1u << 26) /**< \brief Hsmci signal: MCDA2 */ -#define PIO_PA27C_MCDA3 (1u << 27) /**< \brief Hsmci signal: MCDA3 */ -/* ========== Pio definition for ISI peripheral ========== */ -#define PIO_PD22D_ISI_D0 (1u << 22) /**< \brief Isi signal: ISI_D0 */ -#define PIO_PD21D_ISI_D1 (1u << 21) /**< \brief Isi signal: ISI_D1 */ -#define PIO_PD30D_ISI_D10 (1u << 30) /**< \brief Isi signal: ISI_D10 */ -#define PIO_PD31D_ISI_D11 (1u << 31) /**< \brief Isi signal: ISI_D11 */ -#define PIO_PB3D_ISI_D2 (1u << 3) /**< \brief Isi signal: ISI_D2 */ -#define PIO_PA9B_ISI_D3 (1u << 9) /**< \brief Isi signal: ISI_D3 */ -#define PIO_PA5B_ISI_D4 (1u << 5) /**< \brief Isi signal: ISI_D4 */ -#define PIO_PD11D_ISI_D5 (1u << 11) /**< \brief Isi signal: ISI_D5 */ -#define PIO_PD12D_ISI_D6 (1u << 12) /**< \brief Isi signal: ISI_D6 */ -#define PIO_PA27D_ISI_D7 (1u << 27) /**< \brief Isi signal: ISI_D7 */ -#define PIO_PD27D_ISI_D8 (1u << 27) /**< \brief Isi signal: ISI_D8 */ -#define PIO_PD28D_ISI_D9 (1u << 28) /**< \brief Isi signal: ISI_D9 */ -#define PIO_PD24D_ISI_HSYNC (1u << 24) /**< \brief Isi signal: ISI_HSYNC */ -#define PIO_PA24D_ISI_PCK (1u << 24) /**< \brief Isi signal: ISI_PCK */ -#define PIO_PD25D_ISI_VSYNC (1u << 25) /**< \brief Isi signal: ISI_VSYNC */ -/* ========== Pio definition for MCAN0 peripheral ========== */ -#define PIO_PB3A_CANRX0 (1u << 3) /**< \brief Mcan0 signal: CANRX0 */ -#define PIO_PB2A_CANTX0 (1u << 2) /**< \brief Mcan0 signal: CANTX0 */ -/* ========== Pio definition for MCAN1 peripheral ========== */ -#define PIO_PC12C_CANRX1 (1u << 12) /**< \brief Mcan1 signal: CANRX1 */ -#define PIO_PD28B_CANRX1 (1u << 28) /**< \brief Mcan1 signal: CANRX1 */ -#define PIO_PC14C_CANTX1 (1u << 14) /**< \brief Mcan1 signal: CANTX1 */ -#define PIO_PD12B_CANTX1 (1u << 12) /**< \brief Mcan1 signal: CANTX1 */ -/* ========== Pio definition for MLB peripheral ========== */ -#define PIO_PB4C_MLBCLK (1u << 4) /**< \brief Mlb signal: MLBCLK */ -#define PIO_PB5C_MLBDAT (1u << 5) /**< \brief Mlb signal: MLBDAT */ -#define PIO_PD10D_MLBSIG (1u << 10) /**< \brief Mlb signal: MLBSIG */ -/* ========== Pio definition for PIOA peripheral ========== */ -#define PIO_PA21X1_AFE0_AD1 (1u << 21) /**< \brief Pioa signal: AFE0_AD1/PIODCEN2 */ -#define PIO_PA21X1_PIODCEN2 (1u << 21) /**< \brief Pioa signal: AFE0_AD1/PIODCEN2 */ -#define PIO_PA3X1_PIODC0 (1u << 3) /**< \brief Pioa signal: PIODC0 */ -#define PIO_PA10X1_PIODC4 (1u << 10) /**< \brief Pioa signal: PIODC4 */ -#define PIO_PA12X1_PIODC6 (1u << 12) /**< \brief Pioa signal: PIODC6 */ -#define PIO_PA13X1_PIODC7 (1u << 13) /**< \brief Pioa signal: PIODC7 */ -#define PIO_PA22X1_PIODCCLK (1u << 22) /**< \brief Pioa signal: PIODCCLK */ -#define PIO_PA4X1_WKUP3 (1u << 4) /**< \brief Pioa signal: WKUP3/PIODC1 */ -#define PIO_PA4X1_PIODC1 (1u << 4) /**< \brief Pioa signal: WKUP3/PIODC1 */ -#define PIO_PA5X1_WKUP4 (1u << 5) /**< \brief Pioa signal: WKUP4/PIODC2 */ -#define PIO_PA5X1_PIODC2 (1u << 5) /**< \brief Pioa signal: WKUP4/PIODC2 */ -#define PIO_PA9X1_WKUP6 (1u << 9) /**< \brief Pioa signal: WKUP6/PIODC3 */ -#define PIO_PA9X1_PIODC3 (1u << 9) /**< \brief Pioa signal: WKUP6/PIODC3 */ -#define PIO_PA11X1_WKUP7 (1u << 11) /**< \brief Pioa signal: WKUP7/PIODC5 */ -#define PIO_PA11X1_PIODC5 (1u << 11) /**< \brief Pioa signal: WKUP7/PIODC5 */ -#define PIO_PA14X1_WKUP8 (1u << 14) /**< \brief Pioa signal: WKUP8/PIODCEN1 */ -#define PIO_PA14X1_PIODCEN1 (1u << 14) /**< \brief Pioa signal: WKUP8/PIODCEN1 */ -/* ========== Pio definition for PMC peripheral ========== */ -#define PIO_PA6B_PCK0 (1u << 6) /**< \brief Pmc signal: PCK0 */ -#define PIO_PB12D_PCK0 (1u << 12) /**< \brief Pmc signal: PCK0 */ -#define PIO_PB13B_PCK0 (1u << 13) /**< \brief Pmc signal: PCK0 */ -#define PIO_PA17B_PCK1 (1u << 17) /**< \brief Pmc signal: PCK1 */ -#define PIO_PA21B_PCK1 (1u << 21) /**< \brief Pmc signal: PCK1 */ -#define PIO_PA3C_PCK2 (1u << 3) /**< \brief Pmc signal: PCK2 */ -#define PIO_PA18B_PCK2 (1u << 18) /**< \brief Pmc signal: PCK2 */ -#define PIO_PA31B_PCK2 (1u << 31) /**< \brief Pmc signal: PCK2 */ -#define PIO_PB3B_PCK2 (1u << 3) /**< \brief Pmc signal: PCK2 */ -#define PIO_PD31C_PCK2 (1u << 31) /**< \brief Pmc signal: PCK2 */ -/* ========== Pio definition for PWM0 peripheral ========== */ -#define PIO_PA10B_PWMC0_PWMEXTRG0 (1u << 10) /**< \brief Pwm0 signal: PWMC0_PWMEXTRG0 */ -#define PIO_PA22B_PWMC0_PWMEXTRG1 (1u << 22) /**< \brief Pwm0 signal: PWMC0_PWMEXTRG1 */ -#define PIO_PA9C_PWMC0_PWMFI0 (1u << 9) /**< \brief Pwm0 signal: PWMC0_PWMFI0 */ -#define PIO_PD8B_PWMC0_PWMFI1 (1u << 8) /**< \brief Pwm0 signal: PWMC0_PWMFI1 */ -#define PIO_PD9B_PWMC0_PWMFI2 (1u << 9) /**< \brief Pwm0 signal: PWMC0_PWMFI2 */ -#define PIO_PA0A_PWMC0_PWMH0 (1u << 0) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PA11B_PWMC0_PWMH0 (1u << 11) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PA23B_PWMC0_PWMH0 (1u << 23) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PB0A_PWMC0_PWMH0 (1u << 0) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PD11B_PWMC0_PWMH0 (1u << 11) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PD20A_PWMC0_PWMH0 (1u << 20) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PA2A_PWMC0_PWMH1 (1u << 2) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PA12B_PWMC0_PWMH1 (1u << 12) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PA24B_PWMC0_PWMH1 (1u << 24) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PB1A_PWMC0_PWMH1 (1u << 1) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PD21A_PWMC0_PWMH1 (1u << 21) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PA13B_PWMC0_PWMH2 (1u << 13) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PA25B_PWMC0_PWMH2 (1u << 25) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PB4B_PWMC0_PWMH2 (1u << 4) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PC19B_PWMC0_PWMH2 (1u << 19) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PD22A_PWMC0_PWMH2 (1u << 22) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PA7B_PWMC0_PWMH3 (1u << 7) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PA14B_PWMC0_PWMH3 (1u << 14) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PA17C_PWMC0_PWMH3 (1u << 17) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PC13B_PWMC0_PWMH3 (1u << 13) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PC21B_PWMC0_PWMH3 (1u << 21) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PD23A_PWMC0_PWMH3 (1u << 23) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PA1A_PWMC0_PWML0 (1u << 1) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PA19B_PWMC0_PWML0 (1u << 19) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PB5B_PWMC0_PWML0 (1u << 5) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PC0B_PWMC0_PWML0 (1u << 0) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PD10B_PWMC0_PWML0 (1u << 10) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PD24A_PWMC0_PWML0 (1u << 24) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PA20B_PWMC0_PWML1 (1u << 20) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PB12A_PWMC0_PWML1 (1u << 12) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PC1B_PWMC0_PWML1 (1u << 1) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PC18B_PWMC0_PWML1 (1u << 18) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PD25A_PWMC0_PWML1 (1u << 25) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PA16C_PWMC0_PWML2 (1u << 16) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PA30A_PWMC0_PWML2 (1u << 30) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PB13A_PWMC0_PWML2 (1u << 13) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PC2B_PWMC0_PWML2 (1u << 2) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PC20B_PWMC0_PWML2 (1u << 20) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PD26A_PWMC0_PWML2 (1u << 26) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PA15C_PWMC0_PWML3 (1u << 15) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -#define PIO_PC3B_PWMC0_PWML3 (1u << 3) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -#define PIO_PC15B_PWMC0_PWML3 (1u << 15) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -#define PIO_PC22B_PWMC0_PWML3 (1u << 22) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -#define PIO_PD27A_PWMC0_PWML3 (1u << 27) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -/* ========== Pio definition for PWM1 peripheral ========== */ -#define PIO_PA30B_PWMC1_PWMEXTRG0 (1u << 30) /**< \brief Pwm1 signal: PWMC1_PWMEXTRG0 */ -#define PIO_PA18A_PWMC1_PWMEXTRG1 (1u << 18) /**< \brief Pwm1 signal: PWMC1_PWMEXTRG1 */ -#define PIO_PA21C_PWMC1_PWMFI0 (1u << 21) /**< \brief Pwm1 signal: PWMC1_PWMFI0 */ -#define PIO_PA26D_PWMC1_PWMFI1 (1u << 26) /**< \brief Pwm1 signal: PWMC1_PWMFI1 */ -#define PIO_PA28D_PWMC1_PWMFI2 (1u << 28) /**< \brief Pwm1 signal: PWMC1_PWMFI2 */ -#define PIO_PA12C_PWMC1_PWMH0 (1u << 12) /**< \brief Pwm1 signal: PWMC1_PWMH0 */ -#define PIO_PD1B_PWMC1_PWMH0 (1u << 1) /**< \brief Pwm1 signal: PWMC1_PWMH0 */ -#define PIO_PA14C_PWMC1_PWMH1 (1u << 14) /**< \brief Pwm1 signal: PWMC1_PWMH1 */ -#define PIO_PD3B_PWMC1_PWMH1 (1u << 3) /**< \brief Pwm1 signal: PWMC1_PWMH1 */ -#define PIO_PA31D_PWMC1_PWMH2 (1u << 31) /**< \brief Pwm1 signal: PWMC1_PWMH2 */ -#define PIO_PD5B_PWMC1_PWMH2 (1u << 5) /**< \brief Pwm1 signal: PWMC1_PWMH2 */ -#define PIO_PA8A_PWMC1_PWMH3 (1u << 8) /**< \brief Pwm1 signal: PWMC1_PWMH3 */ -#define PIO_PD7B_PWMC1_PWMH3 (1u << 7) /**< \brief Pwm1 signal: PWMC1_PWMH3 */ -#define PIO_PA11C_PWMC1_PWML0 (1u << 11) /**< \brief Pwm1 signal: PWMC1_PWML0 */ -#define PIO_PD0B_PWMC1_PWML0 (1u << 0) /**< \brief Pwm1 signal: PWMC1_PWML0 */ -#define PIO_PA13C_PWMC1_PWML1 (1u << 13) /**< \brief Pwm1 signal: PWMC1_PWML1 */ -#define PIO_PD2B_PWMC1_PWML1 (1u << 2) /**< \brief Pwm1 signal: PWMC1_PWML1 */ -#define PIO_PA23D_PWMC1_PWML2 (1u << 23) /**< \brief Pwm1 signal: PWMC1_PWML2 */ -#define PIO_PD4B_PWMC1_PWML2 (1u << 4) /**< \brief Pwm1 signal: PWMC1_PWML2 */ -#define PIO_PA5A_PWMC1_PWML3 (1u << 5) /**< \brief Pwm1 signal: PWMC1_PWML3 */ -#define PIO_PD6B_PWMC1_PWML3 (1u << 6) /**< \brief Pwm1 signal: PWMC1_PWML3 */ -/* ========== Pio definition for QSPI peripheral ========== */ -#define PIO_PA11A_QCS (1u << 11) /**< \brief Qspi signal: QCS */ -#define PIO_PA13A_QIO0 (1u << 13) /**< \brief Qspi signal: QIO0 */ -#define PIO_PA12A_QIO1 (1u << 12) /**< \brief Qspi signal: QIO1 */ -#define PIO_PA17A_QIO2 (1u << 17) /**< \brief Qspi signal: QIO2 */ -#define PIO_PD31A_QIO3 (1u << 31) /**< \brief Qspi signal: QIO3 */ -#define PIO_PA14A_QSCK (1u << 14) /**< \brief Qspi signal: QSCK */ -/* ========== Pio definition for SPI0 peripheral ========== */ -#define PIO_PD20B_SPI0_MISO (1u << 20) /**< \brief Spi0 signal: SPI0_MISO */ -#define PIO_PD21B_SPI0_MOSI (1u << 21) /**< \brief Spi0 signal: SPI0_MOSI */ -#define PIO_PB2D_SPI0_NPCS0 (1u << 2) /**< \brief Spi0 signal: SPI0_NPCS0 */ -#define PIO_PA31A_SPI0_NPCS1 (1u << 31) /**< \brief Spi0 signal: SPI0_NPCS1 */ -#define PIO_PD25B_SPI0_NPCS1 (1u << 25) /**< \brief Spi0 signal: SPI0_NPCS1 */ -#define PIO_PD12C_SPI0_NPCS2 (1u << 12) /**< \brief Spi0 signal: SPI0_NPCS2 */ -#define PIO_PD27B_SPI0_NPCS3 (1u << 27) /**< \brief Spi0 signal: SPI0_NPCS3 */ -#define PIO_PD22B_SPI0_SPCK (1u << 22) /**< \brief Spi0 signal: SPI0_SPCK */ -/* ========== Pio definition for SPI1 peripheral ========== */ -#define PIO_PC26C_SPI1_MISO (1u << 26) /**< \brief Spi1 signal: SPI1_MISO */ -#define PIO_PC27C_SPI1_MOSI (1u << 27) /**< \brief Spi1 signal: SPI1_MOSI */ -#define PIO_PC25C_SPI1_NPCS0 (1u << 25) /**< \brief Spi1 signal: SPI1_NPCS0 */ -#define PIO_PC28C_SPI1_NPCS1 (1u << 28) /**< \brief Spi1 signal: SPI1_NPCS1 */ -#define PIO_PD0C_SPI1_NPCS1 (1u << 0) /**< \brief Spi1 signal: SPI1_NPCS1 */ -#define PIO_PC29C_SPI1_NPCS2 (1u << 29) /**< \brief Spi1 signal: SPI1_NPCS2 */ -#define PIO_PD1C_SPI1_NPCS2 (1u << 1) /**< \brief Spi1 signal: SPI1_NPCS2 */ -#define PIO_PC30C_SPI1_NPCS3 (1u << 30) /**< \brief Spi1 signal: SPI1_NPCS3 */ -#define PIO_PD2C_SPI1_NPCS3 (1u << 2) /**< \brief Spi1 signal: SPI1_NPCS3 */ -#define PIO_PC24C_SPI1_SPCK (1u << 24) /**< \brief Spi1 signal: SPI1_SPCK */ -/* ========== Pio definition for SSC peripheral ========== */ -#define PIO_PA10C_RD (1u << 10) /**< \brief Ssc signal: RD */ -#define PIO_PD24B_RF (1u << 24) /**< \brief Ssc signal: RF */ -#define PIO_PA22A_RK (1u << 22) /**< \brief Ssc signal: RK */ -#define PIO_PB5D_TD (1u << 5) /**< \brief Ssc signal: TD */ -#define PIO_PD10C_TD (1u << 10) /**< \brief Ssc signal: TD */ -#define PIO_PD26B_TD (1u << 26) /**< \brief Ssc signal: TD */ -#define PIO_PB0D_TF (1u << 0) /**< \brief Ssc signal: TF */ -#define PIO_PB1D_TK (1u << 1) /**< \brief Ssc signal: TK */ -/* ========== Pio definition for TC0 peripheral ========== */ -#define PIO_PA4B_TCLK0 (1u << 4) /**< \brief Tc0 signal: TCLK0 */ -#define PIO_PA28B_TCLK1 (1u << 28) /**< \brief Tc0 signal: TCLK1 */ -#define PIO_PA29B_TCLK2 (1u << 29) /**< \brief Tc0 signal: TCLK2 */ -#define PIO_PA0B_TIOA0 (1u << 0) /**< \brief Tc0 signal: TIOA0 */ -#define PIO_PA15B_TIOA1 (1u << 15) /**< \brief Tc0 signal: TIOA1 */ -#define PIO_PA26B_TIOA2 (1u << 26) /**< \brief Tc0 signal: TIOA2 */ -#define PIO_PA1B_TIOB0 (1u << 1) /**< \brief Tc0 signal: TIOB0 */ -#define PIO_PA16B_TIOB1 (1u << 16) /**< \brief Tc0 signal: TIOB1 */ -#define PIO_PA27B_TIOB2 (1u << 27) /**< \brief Tc0 signal: TIOB2 */ -/* ========== Pio definition for TC3 peripheral ========== */ -#define PIO_PE5B_TCLK10 (1u << 5) /**< \brief Tc3 signal: TCLK10 */ -#define PIO_PD24C_TCLK11 (1u << 24) /**< \brief Tc3 signal: TCLK11 */ -#define PIO_PE2B_TCLK9 (1u << 2) /**< \brief Tc3 signal: TCLK9 */ -#define PIO_PE3B_TIOA10 (1u << 3) /**< \brief Tc3 signal: TIOA10 */ -#define PIO_PD21C_TIOA11 (1u << 21) /**< \brief Tc3 signal: TIOA11 */ -#define PIO_PE0B_TIOA9 (1u << 0) /**< \brief Tc3 signal: TIOA9 */ -#define PIO_PE4B_TIOB10 (1u << 4) /**< \brief Tc3 signal: TIOB10 */ -#define PIO_PD22C_TIOB11 (1u << 22) /**< \brief Tc3 signal: TIOB11 */ -#define PIO_PE1B_TIOB9 (1u << 1) /**< \brief Tc3 signal: TIOB9 */ -/* ========== Pio definition for TWIHS0 peripheral ========== */ -#define PIO_PA4A_TWCK0 (1u << 4) /**< \brief Twihs0 signal: TWCK0 */ -#define PIO_PA3A_TWD0 (1u << 3) /**< \brief Twihs0 signal: TWD0 */ -/* ========== Pio definition for TWIHS1 peripheral ========== */ -#define PIO_PB5A_TWCK1 (1u << 5) /**< \brief Twihs1 signal: TWCK1 */ -#define PIO_PB4A_TWD1 (1u << 4) /**< \brief Twihs1 signal: TWD1 */ -/* ========== Pio definition for TWIHS2 peripheral ========== */ -#define PIO_PD28C_TWCK2 (1u << 28) /**< \brief Twihs2 signal: TWCK2 */ -#define PIO_PD27C_TWD2 (1u << 27) /**< \brief Twihs2 signal: TWD2 */ -/* ========== Pio definition for UART0 peripheral ========== */ -#define PIO_PA9A_URXD0 (1u << 9) /**< \brief Uart0 signal: URXD0 */ -#define PIO_PA10A_UTXD0 (1u << 10) /**< \brief Uart0 signal: UTXD0 */ -/* ========== Pio definition for UART1 peripheral ========== */ -#define PIO_PA5C_URXD1 (1u << 5) /**< \brief Uart1 signal: URXD1 */ -#define PIO_PA4C_UTXD1 (1u << 4) /**< \brief Uart1 signal: UTXD1 */ -#define PIO_PA6C_UTXD1 (1u << 6) /**< \brief Uart1 signal: UTXD1 */ -#define PIO_PD26D_UTXD1 (1u << 26) /**< \brief Uart1 signal: UTXD1 */ -/* ========== Pio definition for UART2 peripheral ========== */ -#define PIO_PD25C_URXD2 (1u << 25) /**< \brief Uart2 signal: URXD2 */ -#define PIO_PD26C_UTXD2 (1u << 26) /**< \brief Uart2 signal: UTXD2 */ -/* ========== Pio definition for UART3 peripheral ========== */ -#define PIO_PD28A_URXD3 (1u << 28) /**< \brief Uart3 signal: URXD3 */ -#define PIO_PD30A_UTXD3 (1u << 30) /**< \brief Uart3 signal: UTXD3 */ -#define PIO_PD31B_UTXD3 (1u << 31) /**< \brief Uart3 signal: UTXD3 */ -/* ========== Pio definition for UART4 peripheral ========== */ -#define PIO_PD18C_URXD4 (1u << 18) /**< \brief Uart4 signal: URXD4 */ -#define PIO_PD3C_UTXD4 (1u << 3) /**< \brief Uart4 signal: UTXD4 */ -#define PIO_PD19C_UTXD4 (1u << 19) /**< \brief Uart4 signal: UTXD4 */ -/* ========== Pio definition for USART0 peripheral ========== */ -#define PIO_PB2C_CTS0 (1u << 2) /**< \brief Usart0 signal: CTS0 */ -#define PIO_PD0D_DCD0 (1u << 0) /**< \brief Usart0 signal: DCD0 */ -#define PIO_PD2D_DSR0 (1u << 2) /**< \brief Usart0 signal: DSR0 */ -#define PIO_PD1D_DTR0 (1u << 1) /**< \brief Usart0 signal: DTR0 */ -#define PIO_PD3D_RI0 (1u << 3) /**< \brief Usart0 signal: RI0 */ -#define PIO_PB3C_RTS0 (1u << 3) /**< \brief Usart0 signal: RTS0 */ -#define PIO_PB0C_RXD0 (1u << 0) /**< \brief Usart0 signal: RXD0 */ -#define PIO_PB13C_SCK0 (1u << 13) /**< \brief Usart0 signal: SCK0 */ -#define PIO_PB1C_TXD0 (1u << 1) /**< \brief Usart0 signal: TXD0 */ -/* ========== Pio definition for USART1 peripheral ========== */ -#define PIO_PA25A_CTS1 (1u << 25) /**< \brief Usart1 signal: CTS1 */ -#define PIO_PA26A_DCD1 (1u << 26) /**< \brief Usart1 signal: DCD1 */ -#define PIO_PA28A_DSR1 (1u << 28) /**< \brief Usart1 signal: DSR1 */ -#define PIO_PA27A_DTR1 (1u << 27) /**< \brief Usart1 signal: DTR1 */ -#define PIO_PA3B_LONCOL1 (1u << 3) /**< \brief Usart1 signal: LONCOL1 */ -#define PIO_PA29A_RI1 (1u << 29) /**< \brief Usart1 signal: RI1 */ -#define PIO_PA24A_RTS1 (1u << 24) /**< \brief Usart1 signal: RTS1 */ -#define PIO_PA21A_RXD1 (1u << 21) /**< \brief Usart1 signal: RXD1 */ -#define PIO_PA23A_SCK1 (1u << 23) /**< \brief Usart1 signal: SCK1 */ -#define PIO_PB4D_TXD1 (1u << 4) /**< \brief Usart1 signal: TXD1 */ -/* ========== Pio definition for USART2 peripheral ========== */ -#define PIO_PD19B_CTS2 (1u << 19) /**< \brief Usart2 signal: CTS2 */ -#define PIO_PD4D_DCD2 (1u << 4) /**< \brief Usart2 signal: DCD2 */ -#define PIO_PD6D_DSR2 (1u << 6) /**< \brief Usart2 signal: DSR2 */ -#define PIO_PD5D_DTR2 (1u << 5) /**< \brief Usart2 signal: DTR2 */ -#define PIO_PD7D_RI2 (1u << 7) /**< \brief Usart2 signal: RI2 */ -#define PIO_PD18B_RTS2 (1u << 18) /**< \brief Usart2 signal: RTS2 */ -#define PIO_PD15B_RXD2 (1u << 15) /**< \brief Usart2 signal: RXD2 */ -#define PIO_PD17B_SCK2 (1u << 17) /**< \brief Usart2 signal: SCK2 */ -#define PIO_PD16B_TXD2 (1u << 16) /**< \brief Usart2 signal: TXD2 */ -/* ========== Pio indexes ========== */ -#define PIO_PA0_IDX 0 -#define PIO_PA1_IDX 1 -#define PIO_PA2_IDX 2 -#define PIO_PA3_IDX 3 -#define PIO_PA4_IDX 4 -#define PIO_PA5_IDX 5 -#define PIO_PA7_IDX 7 -#define PIO_PA8_IDX 8 -#define PIO_PA9_IDX 9 -#define PIO_PA10_IDX 10 -#define PIO_PA11_IDX 11 -#define PIO_PA12_IDX 12 -#define PIO_PA13_IDX 13 -#define PIO_PA14_IDX 14 -#define PIO_PA15_IDX 15 -#define PIO_PA16_IDX 16 -#define PIO_PA17_IDX 17 -#define PIO_PA18_IDX 18 -#define PIO_PA19_IDX 19 -#define PIO_PA20_IDX 20 -#define PIO_PA21_IDX 21 -#define PIO_PA22_IDX 22 -#define PIO_PA23_IDX 23 -#define PIO_PA24_IDX 24 -#define PIO_PA25_IDX 25 -#define PIO_PA26_IDX 26 -#define PIO_PA27_IDX 27 -#define PIO_PA28_IDX 28 -#define PIO_PA30_IDX 30 -#define PIO_PA31_IDX 31 -#define PIO_PB0_IDX 32 -#define PIO_PB1_IDX 33 -#define PIO_PB2_IDX 34 -#define PIO_PB3_IDX 35 -#define PIO_PB4_IDX 36 -#define PIO_PB5_IDX 37 -#define PIO_PB6_IDX 38 -#define PIO_PB7_IDX 39 -#define PIO_PB8_IDX 40 -#define PIO_PB9_IDX 41 -#define PIO_PB12_IDX 44 -#define PIO_PB13_IDX 45 -#define PIO_PD0_IDX 96 -#define PIO_PD1_IDX 97 -#define PIO_PD2_IDX 98 -#define PIO_PD3_IDX 99 -#define PIO_PD4_IDX 100 -#define PIO_PD5_IDX 101 -#define PIO_PD6_IDX 102 -#define PIO_PD7_IDX 103 -#define PIO_PD8_IDX 104 -#define PIO_PD9_IDX 105 -#define PIO_PD10_IDX 106 -#define PIO_PD11_IDX 107 -#define PIO_PD12_IDX 108 -#define PIO_PD13_IDX 109 -#define PIO_PD14_IDX 110 -#define PIO_PD15_IDX 111 -#define PIO_PD16_IDX 112 -#define PIO_PD17_IDX 113 -#define PIO_PD18_IDX 114 -#define PIO_PD19_IDX 115 -#define PIO_PD20_IDX 116 -#define PIO_PD21_IDX 117 -#define PIO_PD22_IDX 118 -#define PIO_PD24_IDX 120 -#define PIO_PD25_IDX 121 -#define PIO_PD26_IDX 122 -#define PIO_PD27_IDX 123 -#define PIO_PD28_IDX 124 -#define PIO_PD30_IDX 126 -#define PIO_PD31_IDX 127 - -#endif /* _SAMV71N21_PIO_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/pio/pio_samv71q19.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/pio/pio_samv71q19.h deleted file mode 100644 index 5bdec5c8..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/pio/pio_samv71q19.h +++ /dev/null @@ -1,672 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71Q19_PIO_ -#define _SAMV71Q19_PIO_ - -#define PIO_PA0 (1u << 0) /**< \brief Pin Controlled by PA0 */ -#define PIO_PA1 (1u << 1) /**< \brief Pin Controlled by PA1 */ -#define PIO_PA2 (1u << 2) /**< \brief Pin Controlled by PA2 */ -#define PIO_PA3 (1u << 3) /**< \brief Pin Controlled by PA3 */ -#define PIO_PA4 (1u << 4) /**< \brief Pin Controlled by PA4 */ -#define PIO_PA5 (1u << 5) /**< \brief Pin Controlled by PA5 */ -#define PIO_PA6 (1u << 6) /**< \brief Pin Controlled by PA6 */ -#define PIO_PA7 (1u << 7) /**< \brief Pin Controlled by PA7 */ -#define PIO_PA8 (1u << 8) /**< \brief Pin Controlled by PA8 */ -#define PIO_PA9 (1u << 9) /**< \brief Pin Controlled by PA9 */ -#define PIO_PA10 (1u << 10) /**< \brief Pin Controlled by PA10 */ -#define PIO_PA11 (1u << 11) /**< \brief Pin Controlled by PA11 */ -#define PIO_PA12 (1u << 12) /**< \brief Pin Controlled by PA12 */ -#define PIO_PA13 (1u << 13) /**< \brief Pin Controlled by PA13 */ -#define PIO_PA14 (1u << 14) /**< \brief Pin Controlled by PA14 */ -#define PIO_PA15 (1u << 15) /**< \brief Pin Controlled by PA15 */ -#define PIO_PA16 (1u << 16) /**< \brief Pin Controlled by PA16 */ -#define PIO_PA17 (1u << 17) /**< \brief Pin Controlled by PA17 */ -#define PIO_PA18 (1u << 18) /**< \brief Pin Controlled by PA18 */ -#define PIO_PA19 (1u << 19) /**< \brief Pin Controlled by PA19 */ -#define PIO_PA20 (1u << 20) /**< \brief Pin Controlled by PA20 */ -#define PIO_PA21 (1u << 21) /**< \brief Pin Controlled by PA21 */ -#define PIO_PA22 (1u << 22) /**< \brief Pin Controlled by PA22 */ -#define PIO_PA23 (1u << 23) /**< \brief Pin Controlled by PA23 */ -#define PIO_PA24 (1u << 24) /**< \brief Pin Controlled by PA24 */ -#define PIO_PA25 (1u << 25) /**< \brief Pin Controlled by PA25 */ -#define PIO_PA26 (1u << 26) /**< \brief Pin Controlled by PA26 */ -#define PIO_PA27 (1u << 27) /**< \brief Pin Controlled by PA27 */ -#define PIO_PA28 (1u << 28) /**< \brief Pin Controlled by PA28 */ -#define PIO_PA29 (1u << 29) /**< \brief Pin Controlled by PA29 */ -#define PIO_PA30 (1u << 30) /**< \brief Pin Controlled by PA30 */ -#define PIO_PA31 (1u << 31) /**< \brief Pin Controlled by PA31 */ -#define PIO_PB0 (1u << 0) /**< \brief Pin Controlled by PB0 */ -#define PIO_PB1 (1u << 1) /**< \brief Pin Controlled by PB1 */ -#define PIO_PB2 (1u << 2) /**< \brief Pin Controlled by PB2 */ -#define PIO_PB3 (1u << 3) /**< \brief Pin Controlled by PB3 */ -#define PIO_PB4 (1u << 4) /**< \brief Pin Controlled by PB4 */ -#define PIO_PB5 (1u << 5) /**< \brief Pin Controlled by PB5 */ -#define PIO_PB6 (1u << 6) /**< \brief Pin Controlled by PB6 */ -#define PIO_PB7 (1u << 7) /**< \brief Pin Controlled by PB7 */ -#define PIO_PB8 (1u << 8) /**< \brief Pin Controlled by PB8 */ -#define PIO_PB9 (1u << 9) /**< \brief Pin Controlled by PB9 */ -#define PIO_PB12 (1u << 12) /**< \brief Pin Controlled by PB12 */ -#define PIO_PB13 (1u << 13) /**< \brief Pin Controlled by PB13 */ -#define PIO_PC0 (1u << 0) /**< \brief Pin Controlled by PC0 */ -#define PIO_PC1 (1u << 1) /**< \brief Pin Controlled by PC1 */ -#define PIO_PC2 (1u << 2) /**< \brief Pin Controlled by PC2 */ -#define PIO_PC3 (1u << 3) /**< \brief Pin Controlled by PC3 */ -#define PIO_PC4 (1u << 4) /**< \brief Pin Controlled by PC4 */ -#define PIO_PC5 (1u << 5) /**< \brief Pin Controlled by PC5 */ -#define PIO_PC6 (1u << 6) /**< \brief Pin Controlled by PC6 */ -#define PIO_PC7 (1u << 7) /**< \brief Pin Controlled by PC7 */ -#define PIO_PC8 (1u << 8) /**< \brief Pin Controlled by PC8 */ -#define PIO_PC9 (1u << 9) /**< \brief Pin Controlled by PC9 */ -#define PIO_PC10 (1u << 10) /**< \brief Pin Controlled by PC10 */ -#define PIO_PC11 (1u << 11) /**< \brief Pin Controlled by PC11 */ -#define PIO_PC12 (1u << 12) /**< \brief Pin Controlled by PC12 */ -#define PIO_PC13 (1u << 13) /**< \brief Pin Controlled by PC13 */ -#define PIO_PC14 (1u << 14) /**< \brief Pin Controlled by PC14 */ -#define PIO_PC15 (1u << 15) /**< \brief Pin Controlled by PC15 */ -#define PIO_PC16 (1u << 16) /**< \brief Pin Controlled by PC16 */ -#define PIO_PC17 (1u << 17) /**< \brief Pin Controlled by PC17 */ -#define PIO_PC18 (1u << 18) /**< \brief Pin Controlled by PC18 */ -#define PIO_PC19 (1u << 19) /**< \brief Pin Controlled by PC19 */ -#define PIO_PC20 (1u << 20) /**< \brief Pin Controlled by PC20 */ -#define PIO_PC21 (1u << 21) /**< \brief Pin Controlled by PC21 */ -#define PIO_PC22 (1u << 22) /**< \brief Pin Controlled by PC22 */ -#define PIO_PC23 (1u << 23) /**< \brief Pin Controlled by PC23 */ -#define PIO_PC24 (1u << 24) /**< \brief Pin Controlled by PC24 */ -#define PIO_PC25 (1u << 25) /**< \brief Pin Controlled by PC25 */ -#define PIO_PC26 (1u << 26) /**< \brief Pin Controlled by PC26 */ -#define PIO_PC27 (1u << 27) /**< \brief Pin Controlled by PC27 */ -#define PIO_PC28 (1u << 28) /**< \brief Pin Controlled by PC28 */ -#define PIO_PC29 (1u << 29) /**< \brief Pin Controlled by PC29 */ -#define PIO_PC30 (1u << 30) /**< \brief Pin Controlled by PC30 */ -#define PIO_PC31 (1u << 31) /**< \brief Pin Controlled by PC31 */ -#define PIO_PD0 (1u << 0) /**< \brief Pin Controlled by PD0 */ -#define PIO_PD1 (1u << 1) /**< \brief Pin Controlled by PD1 */ -#define PIO_PD2 (1u << 2) /**< \brief Pin Controlled by PD2 */ -#define PIO_PD3 (1u << 3) /**< \brief Pin Controlled by PD3 */ -#define PIO_PD4 (1u << 4) /**< \brief Pin Controlled by PD4 */ -#define PIO_PD5 (1u << 5) /**< \brief Pin Controlled by PD5 */ -#define PIO_PD6 (1u << 6) /**< \brief Pin Controlled by PD6 */ -#define PIO_PD7 (1u << 7) /**< \brief Pin Controlled by PD7 */ -#define PIO_PD8 (1u << 8) /**< \brief Pin Controlled by PD8 */ -#define PIO_PD9 (1u << 9) /**< \brief Pin Controlled by PD9 */ -#define PIO_PD10 (1u << 10) /**< \brief Pin Controlled by PD10 */ -#define PIO_PD11 (1u << 11) /**< \brief Pin Controlled by PD11 */ -#define PIO_PD12 (1u << 12) /**< \brief Pin Controlled by PD12 */ -#define PIO_PD13 (1u << 13) /**< \brief Pin Controlled by PD13 */ -#define PIO_PD14 (1u << 14) /**< \brief Pin Controlled by PD14 */ -#define PIO_PD15 (1u << 15) /**< \brief Pin Controlled by PD15 */ -#define PIO_PD16 (1u << 16) /**< \brief Pin Controlled by PD16 */ -#define PIO_PD17 (1u << 17) /**< \brief Pin Controlled by PD17 */ -#define PIO_PD18 (1u << 18) /**< \brief Pin Controlled by PD18 */ -#define PIO_PD19 (1u << 19) /**< \brief Pin Controlled by PD19 */ -#define PIO_PD20 (1u << 20) /**< \brief Pin Controlled by PD20 */ -#define PIO_PD21 (1u << 21) /**< \brief Pin Controlled by PD21 */ -#define PIO_PD22 (1u << 22) /**< \brief Pin Controlled by PD22 */ -#define PIO_PD23 (1u << 23) /**< \brief Pin Controlled by PD23 */ -#define PIO_PD24 (1u << 24) /**< \brief Pin Controlled by PD24 */ -#define PIO_PD25 (1u << 25) /**< \brief Pin Controlled by PD25 */ -#define PIO_PD26 (1u << 26) /**< \brief Pin Controlled by PD26 */ -#define PIO_PD27 (1u << 27) /**< \brief Pin Controlled by PD27 */ -#define PIO_PD28 (1u << 28) /**< \brief Pin Controlled by PD28 */ -#define PIO_PD29 (1u << 29) /**< \brief Pin Controlled by PD29 */ -#define PIO_PD30 (1u << 30) /**< \brief Pin Controlled by PD30 */ -#define PIO_PD31 (1u << 31) /**< \brief Pin Controlled by PD31 */ -#define PIO_PE0 (1u << 0) /**< \brief Pin Controlled by PE0 */ -#define PIO_PE1 (1u << 1) /**< \brief Pin Controlled by PE1 */ -#define PIO_PE2 (1u << 2) /**< \brief Pin Controlled by PE2 */ -#define PIO_PE3 (1u << 3) /**< \brief Pin Controlled by PE3 */ -#define PIO_PE4 (1u << 4) /**< \brief Pin Controlled by PE4 */ -#define PIO_PE5 (1u << 5) /**< \brief Pin Controlled by PE5 */ -/* ========== PIO definition for AFEC0 peripheral ========== */ -#define PIO_PD30X1_AFE0_AD0 (1u << 30) /**< \brief Afec0 signal: AFE0_AD0 */ -#define PIO_PA21X1_AFE0_AD1 (1u << 21) /**< \brief Afec0 signal: AFE0_AD1/PIODCEN2 */ -#define PIO_PA21X1_PIODCEN2 (1u << 21) /**< \brief Afec0 signal: AFE0_AD1/PIODCEN2 */ -#define PIO_PB0X1_AFE0_AD10 (1u << 0) /**< \brief Afec0 signal: AFE0_AD10/RTCOUT0 */ -#define PIO_PB0X1_RTCOUT0 (1u << 0) /**< \brief Afec0 signal: AFE0_AD10/RTCOUT0 */ -#define PIO_PB3X1_AFE0_AD2 (1u << 3) /**< \brief Afec0 signal: AFE0_AD2/WKUP12 */ -#define PIO_PB3X1_WKUP12 (1u << 3) /**< \brief Afec0 signal: AFE0_AD2/WKUP12 */ -#define PIO_PE5X1_AFE0_AD3 (1u << 5) /**< \brief Afec0 signal: AFE0_AD3 */ -#define PIO_PE4X1_AFE0_AD4 (1u << 4) /**< \brief Afec0 signal: AFE0_AD4 */ -#define PIO_PB2X1_AFE0_AD5 (1u << 2) /**< \brief Afec0 signal: AFE0_AD5 */ -#define PIO_PA17X1_AFE0_AD6 (1u << 17) /**< \brief Afec0 signal: AFE0_AD6 */ -#define PIO_PA18X1_AFE0_AD7 (1u << 18) /**< \brief Afec0 signal: AFE0_AD7 */ -#define PIO_PA19X1_AFE0_AD8 (1u << 19) /**< \brief Afec0 signal: AFE0_AD8/WKUP9 */ -#define PIO_PA19X1_WKUP9 (1u << 19) /**< \brief Afec0 signal: AFE0_AD8/WKUP9 */ -#define PIO_PA20X1_AFE0_AD9 (1u << 20) /**< \brief Afec0 signal: AFE0_AD9/WKUP10 */ -#define PIO_PA20X1_WKUP10 (1u << 20) /**< \brief Afec0 signal: AFE0_AD9/WKUP10 */ -#define PIO_PA8B_AFE0_ADTRG (1u << 8) /**< \brief Afec0 signal: AFE0_ADTRG */ -/* ========== PIO definition for AFEC1 peripheral ========== */ -#define PIO_PB1X1_AFE1_AD0 (1u << 1) /**< \brief Afec1 signal: AFE1_AD0/RTCOUT1 */ -#define PIO_PB1X1_RTCOUT1 (1u << 1) /**< \brief Afec1 signal: AFE1_AD0/RTCOUT1 */ -#define PIO_PC13X1_AFE1_AD1 (1u << 13) /**< \brief Afec1 signal: AFE1_AD1 */ -#define PIO_PE3X1_AFE1_AD10 (1u << 3) /**< \brief Afec1 signal: AFE1_AD10 */ -#define PIO_PE0X1_AFE1_AD11 (1u << 0) /**< \brief Afec1 signal: AFE1_AD11 */ -#define PIO_PC15X1_AFE1_AD2 (1u << 15) /**< \brief Afec1 signal: AFE1_AD2 */ -#define PIO_PC12X1_AFE1_AD3 (1u << 12) /**< \brief Afec1 signal: AFE1_AD3 */ -#define PIO_PC29X1_AFE1_AD4 (1u << 29) /**< \brief Afec1 signal: AFE1_AD4 */ -#define PIO_PC30X1_AFE1_AD5 (1u << 30) /**< \brief Afec1 signal: AFE1_AD5 */ -#define PIO_PC31X1_AFE1_AD6 (1u << 31) /**< \brief Afec1 signal: AFE1_AD6 */ -#define PIO_PC26X1_AFE1_AD7 (1u << 26) /**< \brief Afec1 signal: AFE1_AD7 */ -#define PIO_PC27X1_AFE1_AD8 (1u << 27) /**< \brief Afec1 signal: AFE1_AD8 */ -#define PIO_PC0X1_AFE1_AD9 (1u << 0) /**< \brief Afec1 signal: AFE1_AD9 */ -#define PIO_PD9C_AFE1_ADTRG (1u << 9) /**< \brief Afec1 signal: AFE1_ADTRG */ -/* ========== PIO definition for ARM peripheral ========== */ -#define PIO_PB7X1_SWCLK (1u << 7) /**< \brief Arm signal: SWCLK/TCK */ -#define PIO_PB7X1_TCK (1u << 7) /**< \brief Arm signal: SWCLK/TCK */ -#define PIO_PB6X1_SWDIO (1u << 6) /**< \brief Arm signal: SWDIO/TMS */ -#define PIO_PB6X1_TMS (1u << 6) /**< \brief Arm signal: SWDIO/TMS */ -#define PIO_PB4X1_TDI (1u << 4) /**< \brief Arm signal: TDI */ -#define PIO_PB5X1_TDO (1u << 5) /**< \brief Arm signal: TDO/TRACESWO/WKUP13 */ -#define PIO_PB5X1_TRACESWO (1u << 5) /**< \brief Arm signal: TDO/TRACESWO/WKUP13 */ -#define PIO_PB5X1_WKUP13 (1u << 5) /**< \brief Arm signal: TDO/TRACESWO/WKUP13 */ -/* ========== PIO definition for DACC peripheral ========== */ -#define PIO_PB13X1_DAC0 (1u << 13) /**< \brief Dacc signal: DAC0 */ -#define PIO_PD0X1_DAC1 (1u << 0) /**< \brief Dacc signal: DAC1 */ -#define PIO_PA2C_DATRG (1u << 2) /**< \brief Dacc signal: DATRG */ -/* ========== PIO definition for EBI peripheral ========== */ -#define PIO_PC18A_A0 (1u << 18) /**< \brief Ebi signal: A0/NBS0 */ -#define PIO_PC18A_NBS0 (1u << 18) /**< \brief Ebi signal: A0/NBS0 */ -#define PIO_PC19A_A1 (1u << 19) /**< \brief Ebi signal: A1 */ -#define PIO_PC28A_A10 (1u << 28) /**< \brief Ebi signal: A10 */ -#define PIO_PC29A_A11 (1u << 29) /**< \brief Ebi signal: A11 */ -#define PIO_PC30A_A12 (1u << 30) /**< \brief Ebi signal: A12 */ -#define PIO_PC31A_A13 (1u << 31) /**< \brief Ebi signal: A13 */ -#define PIO_PA18C_A14 (1u << 18) /**< \brief Ebi signal: A14 */ -#define PIO_PA19C_A15 (1u << 19) /**< \brief Ebi signal: A15 */ -#define PIO_PA20C_A16 (1u << 20) /**< \brief Ebi signal: A16/BA0 */ -#define PIO_PA20C_BA0 (1u << 20) /**< \brief Ebi signal: A16/BA0 */ -#define PIO_PA0C_A17 (1u << 0) /**< \brief Ebi signal: A17/BA1 */ -#define PIO_PA0C_BA1 (1u << 0) /**< \brief Ebi signal: A17/BA1 */ -#define PIO_PA1C_A18 (1u << 1) /**< \brief Ebi signal: A18 */ -#define PIO_PA23C_A19 (1u << 23) /**< \brief Ebi signal: A19 */ -#define PIO_PC20A_A2 (1u << 20) /**< \brief Ebi signal: A2 */ -#define PIO_PA24C_A20 (1u << 24) /**< \brief Ebi signal: A20 */ -#define PIO_PC16A_A21 (1u << 16) /**< \brief Ebi signal: A21/NANDALE */ -#define PIO_PC16A_NANDALE (1u << 16) /**< \brief Ebi signal: A21/NANDALE */ -#define PIO_PC17A_A22 (1u << 17) /**< \brief Ebi signal: A22/NANDCLE */ -#define PIO_PC17A_NANDCLE (1u << 17) /**< \brief Ebi signal: A22/NANDCLE */ -#define PIO_PA25C_A23 (1u << 25) /**< \brief Ebi signal: A23 */ -#define PIO_PC21A_A3 (1u << 21) /**< \brief Ebi signal: A3 */ -#define PIO_PC22A_A4 (1u << 22) /**< \brief Ebi signal: A4 */ -#define PIO_PC23A_A5 (1u << 23) /**< \brief Ebi signal: A5 */ -#define PIO_PC24A_A6 (1u << 24) /**< \brief Ebi signal: A6 */ -#define PIO_PC25A_A7 (1u << 25) /**< \brief Ebi signal: A7 */ -#define PIO_PC26A_A8 (1u << 26) /**< \brief Ebi signal: A8 */ -#define PIO_PC27A_A9 (1u << 27) /**< \brief Ebi signal: A9 */ -#define PIO_PD17C_CAS (1u << 17) /**< \brief Ebi signal: CAS */ -#define PIO_PC0A_D0 (1u << 0) /**< \brief Ebi signal: D0 */ -#define PIO_PC1A_D1 (1u << 1) /**< \brief Ebi signal: D1 */ -#define PIO_PE2A_D10 (1u << 2) /**< \brief Ebi signal: D10 */ -#define PIO_PE3A_D11 (1u << 3) /**< \brief Ebi signal: D11 */ -#define PIO_PE4A_D12 (1u << 4) /**< \brief Ebi signal: D12 */ -#define PIO_PE5A_D13 (1u << 5) /**< \brief Ebi signal: D13 */ -#define PIO_PA15A_D14 (1u << 15) /**< \brief Ebi signal: D14 */ -#define PIO_PA16A_D15 (1u << 16) /**< \brief Ebi signal: D15 */ -#define PIO_PC2A_D2 (1u << 2) /**< \brief Ebi signal: D2 */ -#define PIO_PC3A_D3 (1u << 3) /**< \brief Ebi signal: D3 */ -#define PIO_PC4A_D4 (1u << 4) /**< \brief Ebi signal: D4 */ -#define PIO_PC5A_D5 (1u << 5) /**< \brief Ebi signal: D5 */ -#define PIO_PC6A_D6 (1u << 6) /**< \brief Ebi signal: D6 */ -#define PIO_PC7A_D7 (1u << 7) /**< \brief Ebi signal: D7 */ -#define PIO_PE0A_D8 (1u << 0) /**< \brief Ebi signal: D8 */ -#define PIO_PE1A_D9 (1u << 1) /**< \brief Ebi signal: D9 */ -#define PIO_PC9A_NANDOE (1u << 9) /**< \brief Ebi signal: NANDOE */ -#define PIO_PC10A_NANDWE (1u << 10) /**< \brief Ebi signal: NANDWE */ -#define PIO_PC14A_NCS0 (1u << 14) /**< \brief Ebi signal: NCS0 */ -#define PIO_PC15A_NCS1 (1u << 15) /**< \brief Ebi signal: NCS1/SDCS */ -#define PIO_PC15A_SDCS (1u << 15) /**< \brief Ebi signal: NCS1/SDCS */ -#define PIO_PD18A_NCS1 (1u << 18) /**< \brief Ebi signal: NCS1/SDCS */ -#define PIO_PD18A_SDCS (1u << 18) /**< \brief Ebi signal: NCS1/SDCS */ -#define PIO_PA22C_NCS2 (1u << 22) /**< \brief Ebi signal: NCS2 */ -#define PIO_PC12A_NCS3 (1u << 12) /**< \brief Ebi signal: NCS3 */ -#define PIO_PD19A_NCS3 (1u << 19) /**< \brief Ebi signal: NCS3 */ -#define PIO_PC11A_NRD (1u << 11) /**< \brief Ebi signal: NRD */ -#define PIO_PC13A_NWAIT (1u << 13) /**< \brief Ebi signal: NWAIT */ -#define PIO_PC8A_NWR0 (1u << 8) /**< \brief Ebi signal: NWR0/NWE */ -#define PIO_PC8A_NWE (1u << 8) /**< \brief Ebi signal: NWR0/NWE */ -#define PIO_PD15C_NWR1 (1u << 15) /**< \brief Ebi signal: NWR1/NBS1 */ -#define PIO_PD15C_NBS1 (1u << 15) /**< \brief Ebi signal: NWR1/NBS1 */ -#define PIO_PD16C_RAS (1u << 16) /**< \brief Ebi signal: RAS */ -#define PIO_PC13C_SDA10 (1u << 13) /**< \brief Ebi signal: SDA10 */ -#define PIO_PD13C_SDA10 (1u << 13) /**< \brief Ebi signal: SDA10 */ -#define PIO_PD23C_SDCK (1u << 23) /**< \brief Ebi signal: SDCK */ -#define PIO_PD14C_SDCKE (1u << 14) /**< \brief Ebi signal: SDCKE */ -#define PIO_PD29C_SDWE (1u << 29) /**< \brief Ebi signal: SDWE */ -/* ========== PIO definition for GMAC peripheral ========== */ -#define PIO_PD13A_GCOL (1u << 13) /**< \brief Gmac signal: GCOL */ -#define PIO_PD10A_GCRS (1u << 10) /**< \brief Gmac signal: GCRS */ -#define PIO_PD8A_GMDC (1u << 8) /**< \brief Gmac signal: GMDC */ -#define PIO_PD9A_GMDIO (1u << 9) /**< \brief Gmac signal: GMDIO */ -#define PIO_PD5A_GRX0 (1u << 5) /**< \brief Gmac signal: GRX0 */ -#define PIO_PD6A_GRX1 (1u << 6) /**< \brief Gmac signal: GRX1 */ -#define PIO_PD11A_GRX2 (1u << 11) /**< \brief Gmac signal: GRX2 */ -#define PIO_PD12A_GRX3 (1u << 12) /**< \brief Gmac signal: GRX3 */ -#define PIO_PD14A_GRXCK (1u << 14) /**< \brief Gmac signal: GRXCK */ -#define PIO_PD4A_GRXDV (1u << 4) /**< \brief Gmac signal: GRXDV */ -#define PIO_PD7A_GRXER (1u << 7) /**< \brief Gmac signal: GRXER */ -#define PIO_PB1B_GTSUCOMP (1u << 1) /**< \brief Gmac signal: GTSUCOMP */ -#define PIO_PB12B_GTSUCOMP (1u << 12) /**< \brief Gmac signal: GTSUCOMP */ -#define PIO_PD11C_GTSUCOMP (1u << 11) /**< \brief Gmac signal: GTSUCOMP */ -#define PIO_PD20C_GTSUCOMP (1u << 20) /**< \brief Gmac signal: GTSUCOMP */ -#define PIO_PD2A_GTX0 (1u << 2) /**< \brief Gmac signal: GTX0 */ -#define PIO_PD3A_GTX1 (1u << 3) /**< \brief Gmac signal: GTX1 */ -#define PIO_PD15A_GTX2 (1u << 15) /**< \brief Gmac signal: GTX2 */ -#define PIO_PD16A_GTX3 (1u << 16) /**< \brief Gmac signal: GTX3 */ -#define PIO_PD0A_GTXCK (1u << 0) /**< \brief Gmac signal: GTXCK */ -#define PIO_PD1A_GTXEN (1u << 1) /**< \brief Gmac signal: GTXEN */ -#define PIO_PD17A_GTXER (1u << 17) /**< \brief Gmac signal: GTXER */ -/* ========== PIO definition for HSMCI peripheral ========== */ -#define PIO_PA28C_MCCDA (1u << 28) /**< \brief Hsmci signal: MCCDA */ -#define PIO_PA25D_MCCK (1u << 25) /**< \brief Hsmci signal: MCCK */ -#define PIO_PA30C_MCDA0 (1u << 30) /**< \brief Hsmci signal: MCDA0 */ -#define PIO_PA31C_MCDA1 (1u << 31) /**< \brief Hsmci signal: MCDA1 */ -#define PIO_PA26C_MCDA2 (1u << 26) /**< \brief Hsmci signal: MCDA2 */ -#define PIO_PA27C_MCDA3 (1u << 27) /**< \brief Hsmci signal: MCDA3 */ -/* ========== PIO definition for ISI peripheral ========== */ -#define PIO_PD22D_ISI_D0 (1u << 22) /**< \brief Isi signal: ISI_D0 */ -#define PIO_PD21D_ISI_D1 (1u << 21) /**< \brief Isi signal: ISI_D1 */ -#define PIO_PD30D_ISI_D10 (1u << 30) /**< \brief Isi signal: ISI_D10 */ -#define PIO_PD31D_ISI_D11 (1u << 31) /**< \brief Isi signal: ISI_D11 */ -#define PIO_PB3D_ISI_D2 (1u << 3) /**< \brief Isi signal: ISI_D2 */ -#define PIO_PA9B_ISI_D3 (1u << 9) /**< \brief Isi signal: ISI_D3 */ -#define PIO_PA5B_ISI_D4 (1u << 5) /**< \brief Isi signal: ISI_D4 */ -#define PIO_PD11D_ISI_D5 (1u << 11) /**< \brief Isi signal: ISI_D5 */ -#define PIO_PD12D_ISI_D6 (1u << 12) /**< \brief Isi signal: ISI_D6 */ -#define PIO_PA27D_ISI_D7 (1u << 27) /**< \brief Isi signal: ISI_D7 */ -#define PIO_PD27D_ISI_D8 (1u << 27) /**< \brief Isi signal: ISI_D8 */ -#define PIO_PD28D_ISI_D9 (1u << 28) /**< \brief Isi signal: ISI_D9 */ -#define PIO_PD24D_ISI_HSYNC (1u << 24) /**< \brief Isi signal: ISI_HSYNC */ -#define PIO_PA24D_ISI_PCK (1u << 24) /**< \brief Isi signal: ISI_PCK */ -#define PIO_PD25D_ISI_VSYNC (1u << 25) /**< \brief Isi signal: ISI_VSYNC */ -/* ========== PIO definition for MCAN0 peripheral ========== */ -#define PIO_PB3A_CANRX0 (1u << 3) /**< \brief Mcan0 signal: CANRX0 */ -#define PIO_PB2A_CANTX0 (1u << 2) /**< \brief Mcan0 signal: CANTX0 */ -/* ========== PIO definition for MCAN1 peripheral ========== */ -#define PIO_PC12C_CANRX1 (1u << 12) /**< \brief Mcan1 signal: CANRX1 */ -#define PIO_PD28B_CANRX1 (1u << 28) /**< \brief Mcan1 signal: CANRX1 */ -#define PIO_PC14C_CANTX1 (1u << 14) /**< \brief Mcan1 signal: CANTX1 */ -#define PIO_PD12B_CANTX1 (1u << 12) /**< \brief Mcan1 signal: CANTX1 */ -/* ========== PIO definition for MLB peripheral ========== */ -#define PIO_PB4C_MLBCLK (1u << 4) /**< \brief Mlb signal: MLBCLK */ -#define PIO_PB5C_MLBDAT (1u << 5) /**< \brief Mlb signal: MLBDAT */ -#define PIO_PD10D_MLBSIG (1u << 10) /**< \brief Mlb signal: MLBSIG */ -/* ========== PIO definition for PIOA peripheral ========== */ -#define PIO_PA21X1_AFE0_AD1 (1u << 21) /**< \brief Pioa signal: AFE0_AD1/PIODCEN2 */ -#define PIO_PA21X1_PIODCEN2 (1u << 21) /**< \brief Pioa signal: AFE0_AD1/PIODCEN2 */ -#define PIO_PA3X1_PIODC0 (1u << 3) /**< \brief Pioa signal: PIODC0 */ -#define PIO_PA10X1_PIODC4 (1u << 10) /**< \brief Pioa signal: PIODC4 */ -#define PIO_PA12X1_PIODC6 (1u << 12) /**< \brief Pioa signal: PIODC6 */ -#define PIO_PA13X1_PIODC7 (1u << 13) /**< \brief Pioa signal: PIODC7 */ -#define PIO_PA22X1_PIODCCLK (1u << 22) /**< \brief Pioa signal: PIODCCLK */ -#define PIO_PA4X1_WKUP3 (1u << 4) /**< \brief Pioa signal: WKUP3/PIODC1 */ -#define PIO_PA4X1_PIODC1 (1u << 4) /**< \brief Pioa signal: WKUP3/PIODC1 */ -#define PIO_PA5X1_WKUP4 (1u << 5) /**< \brief Pioa signal: WKUP4/PIODC2 */ -#define PIO_PA5X1_PIODC2 (1u << 5) /**< \brief Pioa signal: WKUP4/PIODC2 */ -#define PIO_PA9X1_WKUP6 (1u << 9) /**< \brief Pioa signal: WKUP6/PIODC3 */ -#define PIO_PA9X1_PIODC3 (1u << 9) /**< \brief Pioa signal: WKUP6/PIODC3 */ -#define PIO_PA11X1_WKUP7 (1u << 11) /**< \brief Pioa signal: WKUP7/PIODC5 */ -#define PIO_PA11X1_PIODC5 (1u << 11) /**< \brief Pioa signal: WKUP7/PIODC5 */ -#define PIO_PA14X1_WKUP8 (1u << 14) /**< \brief Pioa signal: WKUP8/PIODCEN1 */ -#define PIO_PA14X1_PIODCEN1 (1u << 14) /**< \brief Pioa signal: WKUP8/PIODCEN1 */ -/* ========== PIO definition for PMC peripheral ========== */ -#define PIO_PA6B_PCK0 (1u << 6) /**< \brief Pmc signal: PCK0 */ -#define PIO_PB12D_PCK0 (1u << 12) /**< \brief Pmc signal: PCK0 */ -#define PIO_PB13B_PCK0 (1u << 13) /**< \brief Pmc signal: PCK0 */ -#define PIO_PA17B_PCK1 (1u << 17) /**< \brief Pmc signal: PCK1 */ -#define PIO_PA21B_PCK1 (1u << 21) /**< \brief Pmc signal: PCK1 */ -#define PIO_PA3C_PCK2 (1u << 3) /**< \brief Pmc signal: PCK2 */ -#define PIO_PA18B_PCK2 (1u << 18) /**< \brief Pmc signal: PCK2 */ -#define PIO_PA31B_PCK2 (1u << 31) /**< \brief Pmc signal: PCK2 */ -#define PIO_PB3B_PCK2 (1u << 3) /**< \brief Pmc signal: PCK2 */ -#define PIO_PD31C_PCK2 (1u << 31) /**< \brief Pmc signal: PCK2 */ -/* ========== PIO definition for PWM0 peripheral ========== */ -#define PIO_PA10B_PWMC0_PWMEXTRG0 (1u << 10) /**< \brief Pwm0 signal: PWMC0_PWMEXTRG0 */ -#define PIO_PA22B_PWMC0_PWMEXTRG1 (1u << 22) /**< \brief Pwm0 signal: PWMC0_PWMEXTRG1 */ -#define PIO_PA9C_PWMC0_PWMFI0 (1u << 9) /**< \brief Pwm0 signal: PWMC0_PWMFI0 */ -#define PIO_PD8B_PWMC0_PWMFI1 (1u << 8) /**< \brief Pwm0 signal: PWMC0_PWMFI1 */ -#define PIO_PD9B_PWMC0_PWMFI2 (1u << 9) /**< \brief Pwm0 signal: PWMC0_PWMFI2 */ -#define PIO_PA0A_PWMC0_PWMH0 (1u << 0) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PA11B_PWMC0_PWMH0 (1u << 11) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PA23B_PWMC0_PWMH0 (1u << 23) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PB0A_PWMC0_PWMH0 (1u << 0) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PD11B_PWMC0_PWMH0 (1u << 11) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PD20A_PWMC0_PWMH0 (1u << 20) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PA2A_PWMC0_PWMH1 (1u << 2) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PA12B_PWMC0_PWMH1 (1u << 12) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PA24B_PWMC0_PWMH1 (1u << 24) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PB1A_PWMC0_PWMH1 (1u << 1) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PD21A_PWMC0_PWMH1 (1u << 21) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PA13B_PWMC0_PWMH2 (1u << 13) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PA25B_PWMC0_PWMH2 (1u << 25) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PB4B_PWMC0_PWMH2 (1u << 4) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PC19B_PWMC0_PWMH2 (1u << 19) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PD22A_PWMC0_PWMH2 (1u << 22) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PA7B_PWMC0_PWMH3 (1u << 7) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PA14B_PWMC0_PWMH3 (1u << 14) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PA17C_PWMC0_PWMH3 (1u << 17) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PC13B_PWMC0_PWMH3 (1u << 13) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PC21B_PWMC0_PWMH3 (1u << 21) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PD23A_PWMC0_PWMH3 (1u << 23) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PA1A_PWMC0_PWML0 (1u << 1) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PA19B_PWMC0_PWML0 (1u << 19) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PB5B_PWMC0_PWML0 (1u << 5) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PC0B_PWMC0_PWML0 (1u << 0) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PD10B_PWMC0_PWML0 (1u << 10) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PD24A_PWMC0_PWML0 (1u << 24) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PA20B_PWMC0_PWML1 (1u << 20) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PB12A_PWMC0_PWML1 (1u << 12) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PC1B_PWMC0_PWML1 (1u << 1) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PC18B_PWMC0_PWML1 (1u << 18) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PD25A_PWMC0_PWML1 (1u << 25) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PA16C_PWMC0_PWML2 (1u << 16) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PA30A_PWMC0_PWML2 (1u << 30) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PB13A_PWMC0_PWML2 (1u << 13) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PC2B_PWMC0_PWML2 (1u << 2) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PC20B_PWMC0_PWML2 (1u << 20) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PD26A_PWMC0_PWML2 (1u << 26) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PA15C_PWMC0_PWML3 (1u << 15) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -#define PIO_PC3B_PWMC0_PWML3 (1u << 3) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -#define PIO_PC15B_PWMC0_PWML3 (1u << 15) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -#define PIO_PC22B_PWMC0_PWML3 (1u << 22) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -#define PIO_PD27A_PWMC0_PWML3 (1u << 27) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -/* ========== PIO definition for PWM1 peripheral ========== */ -#define PIO_PA30B_PWMC1_PWMEXTRG0 (1u << 30) /**< \brief Pwm1 signal: PWMC1_PWMEXTRG0 */ -#define PIO_PA18A_PWMC1_PWMEXTRG1 (1u << 18) /**< \brief Pwm1 signal: PWMC1_PWMEXTRG1 */ -#define PIO_PA21C_PWMC1_PWMFI0 (1u << 21) /**< \brief Pwm1 signal: PWMC1_PWMFI0 */ -#define PIO_PA26D_PWMC1_PWMFI1 (1u << 26) /**< \brief Pwm1 signal: PWMC1_PWMFI1 */ -#define PIO_PA28D_PWMC1_PWMFI2 (1u << 28) /**< \brief Pwm1 signal: PWMC1_PWMFI2 */ -#define PIO_PA12C_PWMC1_PWMH0 (1u << 12) /**< \brief Pwm1 signal: PWMC1_PWMH0 */ -#define PIO_PD1B_PWMC1_PWMH0 (1u << 1) /**< \brief Pwm1 signal: PWMC1_PWMH0 */ -#define PIO_PA14C_PWMC1_PWMH1 (1u << 14) /**< \brief Pwm1 signal: PWMC1_PWMH1 */ -#define PIO_PD3B_PWMC1_PWMH1 (1u << 3) /**< \brief Pwm1 signal: PWMC1_PWMH1 */ -#define PIO_PA31D_PWMC1_PWMH2 (1u << 31) /**< \brief Pwm1 signal: PWMC1_PWMH2 */ -#define PIO_PD5B_PWMC1_PWMH2 (1u << 5) /**< \brief Pwm1 signal: PWMC1_PWMH2 */ -#define PIO_PA8A_PWMC1_PWMH3 (1u << 8) /**< \brief Pwm1 signal: PWMC1_PWMH3 */ -#define PIO_PD7B_PWMC1_PWMH3 (1u << 7) /**< \brief Pwm1 signal: PWMC1_PWMH3 */ -#define PIO_PA11C_PWMC1_PWML0 (1u << 11) /**< \brief Pwm1 signal: PWMC1_PWML0 */ -#define PIO_PD0B_PWMC1_PWML0 (1u << 0) /**< \brief Pwm1 signal: PWMC1_PWML0 */ -#define PIO_PA13C_PWMC1_PWML1 (1u << 13) /**< \brief Pwm1 signal: PWMC1_PWML1 */ -#define PIO_PD2B_PWMC1_PWML1 (1u << 2) /**< \brief Pwm1 signal: PWMC1_PWML1 */ -#define PIO_PA23D_PWMC1_PWML2 (1u << 23) /**< \brief Pwm1 signal: PWMC1_PWML2 */ -#define PIO_PD4B_PWMC1_PWML2 (1u << 4) /**< \brief Pwm1 signal: PWMC1_PWML2 */ -#define PIO_PA5A_PWMC1_PWML3 (1u << 5) /**< \brief Pwm1 signal: PWMC1_PWML3 */ -#define PIO_PD6B_PWMC1_PWML3 (1u << 6) /**< \brief Pwm1 signal: PWMC1_PWML3 */ -/* ========== PIO definition for QSPI peripheral ========== */ -#define PIO_PA11A_QCS (1u << 11) /**< \brief Qspi signal: QCS */ -#define PIO_PA13A_QIO0 (1u << 13) /**< \brief Qspi signal: QIO0 */ -#define PIO_PA12A_QIO1 (1u << 12) /**< \brief Qspi signal: QIO1 */ -#define PIO_PA17A_QIO2 (1u << 17) /**< \brief Qspi signal: QIO2 */ -#define PIO_PD31A_QIO3 (1u << 31) /**< \brief Qspi signal: QIO3 */ -#define PIO_PA14A_QSCK (1u << 14) /**< \brief Qspi signal: QSCK */ -/* ========== PIO definition for SPI0 peripheral ========== */ -#define PIO_PD20B_SPI0_MISO (1u << 20) /**< \brief Spi0 signal: SPI0_MISO */ -#define PIO_PD21B_SPI0_MOSI (1u << 21) /**< \brief Spi0 signal: SPI0_MOSI */ -#define PIO_PB2D_SPI0_NPCS0 (1u << 2) /**< \brief Spi0 signal: SPI0_NPCS0 */ -#define PIO_PA31A_SPI0_NPCS1 (1u << 31) /**< \brief Spi0 signal: SPI0_NPCS1 */ -#define PIO_PD25B_SPI0_NPCS1 (1u << 25) /**< \brief Spi0 signal: SPI0_NPCS1 */ -#define PIO_PD12C_SPI0_NPCS2 (1u << 12) /**< \brief Spi0 signal: SPI0_NPCS2 */ -#define PIO_PD27B_SPI0_NPCS3 (1u << 27) /**< \brief Spi0 signal: SPI0_NPCS3 */ -#define PIO_PD22B_SPI0_SPCK (1u << 22) /**< \brief Spi0 signal: SPI0_SPCK */ -/* ========== PIO definition for SPI1 peripheral ========== */ -#define PIO_PC26C_SPI1_MISO (1u << 26) /**< \brief Spi1 signal: SPI1_MISO */ -#define PIO_PC27C_SPI1_MOSI (1u << 27) /**< \brief Spi1 signal: SPI1_MOSI */ -#define PIO_PC25C_SPI1_NPCS0 (1u << 25) /**< \brief Spi1 signal: SPI1_NPCS0 */ -#define PIO_PC28C_SPI1_NPCS1 (1u << 28) /**< \brief Spi1 signal: SPI1_NPCS1 */ -#define PIO_PD0C_SPI1_NPCS1 (1u << 0) /**< \brief Spi1 signal: SPI1_NPCS1 */ -#define PIO_PC29C_SPI1_NPCS2 (1u << 29) /**< \brief Spi1 signal: SPI1_NPCS2 */ -#define PIO_PD1C_SPI1_NPCS2 (1u << 1) /**< \brief Spi1 signal: SPI1_NPCS2 */ -#define PIO_PC30C_SPI1_NPCS3 (1u << 30) /**< \brief Spi1 signal: SPI1_NPCS3 */ -#define PIO_PD2C_SPI1_NPCS3 (1u << 2) /**< \brief Spi1 signal: SPI1_NPCS3 */ -#define PIO_PC24C_SPI1_SPCK (1u << 24) /**< \brief Spi1 signal: SPI1_SPCK */ -/* ========== PIO definition for SSC peripheral ========== */ -#define PIO_PA10C_RD (1u << 10) /**< \brief Ssc signal: RD */ -#define PIO_PD24B_RF (1u << 24) /**< \brief Ssc signal: RF */ -#define PIO_PA22A_RK (1u << 22) /**< \brief Ssc signal: RK */ -#define PIO_PB5D_TD (1u << 5) /**< \brief Ssc signal: TD */ -#define PIO_PD10C_TD (1u << 10) /**< \brief Ssc signal: TD */ -#define PIO_PD26B_TD (1u << 26) /**< \brief Ssc signal: TD */ -#define PIO_PB0D_TF (1u << 0) /**< \brief Ssc signal: TF */ -#define PIO_PB1D_TK (1u << 1) /**< \brief Ssc signal: TK */ -/* ========== PIO definition for TC0 peripheral ========== */ -#define PIO_PA4B_TCLK0 (1u << 4) /**< \brief Tc0 signal: TCLK0 */ -#define PIO_PA28B_TCLK1 (1u << 28) /**< \brief Tc0 signal: TCLK1 */ -#define PIO_PA29B_TCLK2 (1u << 29) /**< \brief Tc0 signal: TCLK2 */ -#define PIO_PA0B_TIOA0 (1u << 0) /**< \brief Tc0 signal: TIOA0 */ -#define PIO_PA15B_TIOA1 (1u << 15) /**< \brief Tc0 signal: TIOA1 */ -#define PIO_PA26B_TIOA2 (1u << 26) /**< \brief Tc0 signal: TIOA2 */ -#define PIO_PA1B_TIOB0 (1u << 1) /**< \brief Tc0 signal: TIOB0 */ -#define PIO_PA16B_TIOB1 (1u << 16) /**< \brief Tc0 signal: TIOB1 */ -#define PIO_PA27B_TIOB2 (1u << 27) /**< \brief Tc0 signal: TIOB2 */ -/* ========== PIO definition for TC1 peripheral ========== */ -#define PIO_PC25B_TCLK3 (1u << 25) /**< \brief Tc1 signal: TCLK3 */ -#define PIO_PC28B_TCLK4 (1u << 28) /**< \brief Tc1 signal: TCLK4 */ -#define PIO_PC31B_TCLK5 (1u << 31) /**< \brief Tc1 signal: TCLK5 */ -#define PIO_PC23B_TIOA3 (1u << 23) /**< \brief Tc1 signal: TIOA3 */ -#define PIO_PC26B_TIOA4 (1u << 26) /**< \brief Tc1 signal: TIOA4 */ -#define PIO_PC29B_TIOA5 (1u << 29) /**< \brief Tc1 signal: TIOA5 */ -#define PIO_PC24B_TIOB3 (1u << 24) /**< \brief Tc1 signal: TIOB3 */ -#define PIO_PC27B_TIOB4 (1u << 27) /**< \brief Tc1 signal: TIOB4 */ -#define PIO_PC30B_TIOB5 (1u << 30) /**< \brief Tc1 signal: TIOB5 */ -/* ========== PIO definition for TC2 peripheral ========== */ -#define PIO_PC7B_TCLK6 (1u << 7) /**< \brief Tc2 signal: TCLK6 */ -#define PIO_PC10B_TCLK7 (1u << 10) /**< \brief Tc2 signal: TCLK7 */ -#define PIO_PC14B_TCLK8 (1u << 14) /**< \brief Tc2 signal: TCLK8 */ -#define PIO_PC5B_TIOA6 (1u << 5) /**< \brief Tc2 signal: TIOA6 */ -#define PIO_PC8B_TIOA7 (1u << 8) /**< \brief Tc2 signal: TIOA7 */ -#define PIO_PC11B_TIOA8 (1u << 11) /**< \brief Tc2 signal: TIOA8 */ -#define PIO_PC6B_TIOB6 (1u << 6) /**< \brief Tc2 signal: TIOB6 */ -#define PIO_PC9B_TIOB7 (1u << 9) /**< \brief Tc2 signal: TIOB7 */ -#define PIO_PC12B_TIOB8 (1u << 12) /**< \brief Tc2 signal: TIOB8 */ -/* ========== PIO definition for TC3 peripheral ========== */ -#define PIO_PE5B_TCLK10 (1u << 5) /**< \brief Tc3 signal: TCLK10 */ -#define PIO_PD24C_TCLK11 (1u << 24) /**< \brief Tc3 signal: TCLK11 */ -#define PIO_PE2B_TCLK9 (1u << 2) /**< \brief Tc3 signal: TCLK9 */ -#define PIO_PE3B_TIOA10 (1u << 3) /**< \brief Tc3 signal: TIOA10 */ -#define PIO_PD21C_TIOA11 (1u << 21) /**< \brief Tc3 signal: TIOA11 */ -#define PIO_PE0B_TIOA9 (1u << 0) /**< \brief Tc3 signal: TIOA9 */ -#define PIO_PE4B_TIOB10 (1u << 4) /**< \brief Tc3 signal: TIOB10 */ -#define PIO_PD22C_TIOB11 (1u << 22) /**< \brief Tc3 signal: TIOB11 */ -#define PIO_PE1B_TIOB9 (1u << 1) /**< \brief Tc3 signal: TIOB9 */ -/* ========== PIO definition for TWIHS0 peripheral ========== */ -#define PIO_PA4A_TWCK0 (1u << 4) /**< \brief Twihs0 signal: TWCK0 */ -#define PIO_PA3A_TWD0 (1u << 3) /**< \brief Twihs0 signal: TWD0 */ -/* ========== PIO definition for TWIHS1 peripheral ========== */ -#define PIO_PB5A_TWCK1 (1u << 5) /**< \brief Twihs1 signal: TWCK1 */ -#define PIO_PB4A_TWD1 (1u << 4) /**< \brief Twihs1 signal: TWD1 */ -/* ========== PIO definition for TWIHS2 peripheral ========== */ -#define PIO_PD28C_TWCK2 (1u << 28) /**< \brief Twihs2 signal: TWCK2 */ -#define PIO_PD27C_TWD2 (1u << 27) /**< \brief Twihs2 signal: TWD2 */ -/* ========== PIO definition for UART0 peripheral ========== */ -#define PIO_PA9A_URXD0 (1u << 9) /**< \brief Uart0 signal: URXD0 */ -#define PIO_PA10A_UTXD0 (1u << 10) /**< \brief Uart0 signal: UTXD0 */ -/* ========== PIO definition for UART1 peripheral ========== */ -#define PIO_PA5C_URXD1 (1u << 5) /**< \brief Uart1 signal: URXD1 */ -#define PIO_PA4C_UTXD1 (1u << 4) /**< \brief Uart1 signal: UTXD1 */ -#define PIO_PA6C_UTXD1 (1u << 6) /**< \brief Uart1 signal: UTXD1 */ -#define PIO_PD26D_UTXD1 (1u << 26) /**< \brief Uart1 signal: UTXD1 */ -/* ========== PIO definition for UART2 peripheral ========== */ -#define PIO_PD25C_URXD2 (1u << 25) /**< \brief Uart2 signal: URXD2 */ -#define PIO_PD26C_UTXD2 (1u << 26) /**< \brief Uart2 signal: UTXD2 */ -/* ========== PIO definition for UART3 peripheral ========== */ -#define PIO_PD28A_URXD3 (1u << 28) /**< \brief Uart3 signal: URXD3 */ -#define PIO_PD30A_UTXD3 (1u << 30) /**< \brief Uart3 signal: UTXD3 */ -#define PIO_PD31B_UTXD3 (1u << 31) /**< \brief Uart3 signal: UTXD3 */ -/* ========== PIO definition for UART4 peripheral ========== */ -#define PIO_PD18C_URXD4 (1u << 18) /**< \brief Uart4 signal: URXD4 */ -#define PIO_PD3C_UTXD4 (1u << 3) /**< \brief Uart4 signal: UTXD4 */ -#define PIO_PD19C_UTXD4 (1u << 19) /**< \brief Uart4 signal: UTXD4 */ -/* ========== PIO definition for USART0 peripheral ========== */ -#define PIO_PB2C_CTS0 (1u << 2) /**< \brief Usart0 signal: CTS0 */ -#define PIO_PD0D_DCD0 (1u << 0) /**< \brief Usart0 signal: DCD0 */ -#define PIO_PD2D_DSR0 (1u << 2) /**< \brief Usart0 signal: DSR0 */ -#define PIO_PD1D_DTR0 (1u << 1) /**< \brief Usart0 signal: DTR0 */ -#define PIO_PD3D_RI0 (1u << 3) /**< \brief Usart0 signal: RI0 */ -#define PIO_PB3C_RTS0 (1u << 3) /**< \brief Usart0 signal: RTS0 */ -#define PIO_PB0C_RXD0 (1u << 0) /**< \brief Usart0 signal: RXD0 */ -#define PIO_PB13C_SCK0 (1u << 13) /**< \brief Usart0 signal: SCK0 */ -#define PIO_PB1C_TXD0 (1u << 1) /**< \brief Usart0 signal: TXD0 */ -/* ========== PIO definition for USART1 peripheral ========== */ -#define PIO_PA25A_CTS1 (1u << 25) /**< \brief Usart1 signal: CTS1 */ -#define PIO_PA26A_DCD1 (1u << 26) /**< \brief Usart1 signal: DCD1 */ -#define PIO_PA28A_DSR1 (1u << 28) /**< \brief Usart1 signal: DSR1 */ -#define PIO_PA27A_DTR1 (1u << 27) /**< \brief Usart1 signal: DTR1 */ -#define PIO_PA3B_LONCOL1 (1u << 3) /**< \brief Usart1 signal: LONCOL1 */ -#define PIO_PA29A_RI1 (1u << 29) /**< \brief Usart1 signal: RI1 */ -#define PIO_PA24A_RTS1 (1u << 24) /**< \brief Usart1 signal: RTS1 */ -#define PIO_PA21A_RXD1 (1u << 21) /**< \brief Usart1 signal: RXD1 */ -#define PIO_PA23A_SCK1 (1u << 23) /**< \brief Usart1 signal: SCK1 */ -#define PIO_PB4D_TXD1 (1u << 4) /**< \brief Usart1 signal: TXD1 */ -/* ========== PIO definition for USART2 peripheral ========== */ -#define PIO_PD19B_CTS2 (1u << 19) /**< \brief Usart2 signal: CTS2 */ -#define PIO_PD4D_DCD2 (1u << 4) /**< \brief Usart2 signal: DCD2 */ -#define PIO_PD6D_DSR2 (1u << 6) /**< \brief Usart2 signal: DSR2 */ -#define PIO_PD5D_DTR2 (1u << 5) /**< \brief Usart2 signal: DTR2 */ -#define PIO_PD7D_RI2 (1u << 7) /**< \brief Usart2 signal: RI2 */ -#define PIO_PD18B_RTS2 (1u << 18) /**< \brief Usart2 signal: RTS2 */ -#define PIO_PD15B_RXD2 (1u << 15) /**< \brief Usart2 signal: RXD2 */ -#define PIO_PD17B_SCK2 (1u << 17) /**< \brief Usart2 signal: SCK2 */ -#define PIO_PD16B_TXD2 (1u << 16) /**< \brief Usart2 signal: TXD2 */ -/* ========== PIO indexes ========== */ -#define PIO_PA0_IDX 0 -#define PIO_PA1_IDX 1 -#define PIO_PA2_IDX 2 -#define PIO_PA3_IDX 3 -#define PIO_PA4_IDX 4 -#define PIO_PA5_IDX 5 -#define PIO_PA6_IDX 6 -#define PIO_PA7_IDX 7 -#define PIO_PA8_IDX 8 -#define PIO_PA9_IDX 9 -#define PIO_PA10_IDX 10 -#define PIO_PA11_IDX 11 -#define PIO_PA12_IDX 12 -#define PIO_PA13_IDX 13 -#define PIO_PA14_IDX 14 -#define PIO_PA15_IDX 15 -#define PIO_PA16_IDX 16 -#define PIO_PA17_IDX 17 -#define PIO_PA18_IDX 18 -#define PIO_PA19_IDX 19 -#define PIO_PA20_IDX 20 -#define PIO_PA21_IDX 21 -#define PIO_PA22_IDX 22 -#define PIO_PA23_IDX 23 -#define PIO_PA24_IDX 24 -#define PIO_PA25_IDX 25 -#define PIO_PA26_IDX 26 -#define PIO_PA27_IDX 27 -#define PIO_PA28_IDX 28 -#define PIO_PA29_IDX 29 -#define PIO_PA30_IDX 30 -#define PIO_PA31_IDX 31 -#define PIO_PB0_IDX 32 -#define PIO_PB1_IDX 33 -#define PIO_PB2_IDX 34 -#define PIO_PB3_IDX 35 -#define PIO_PB4_IDX 36 -#define PIO_PB5_IDX 37 -#define PIO_PB6_IDX 38 -#define PIO_PB7_IDX 39 -#define PIO_PB8_IDX 40 -#define PIO_PB9_IDX 41 -#define PIO_PB12_IDX 44 -#define PIO_PB13_IDX 45 -#define PIO_PC0_IDX 64 -#define PIO_PC1_IDX 65 -#define PIO_PC2_IDX 66 -#define PIO_PC3_IDX 67 -#define PIO_PC4_IDX 68 -#define PIO_PC5_IDX 69 -#define PIO_PC6_IDX 70 -#define PIO_PC7_IDX 71 -#define PIO_PC8_IDX 72 -#define PIO_PC9_IDX 73 -#define PIO_PC10_IDX 74 -#define PIO_PC11_IDX 75 -#define PIO_PC12_IDX 76 -#define PIO_PC13_IDX 77 -#define PIO_PC14_IDX 78 -#define PIO_PC15_IDX 79 -#define PIO_PC16_IDX 80 -#define PIO_PC17_IDX 81 -#define PIO_PC18_IDX 82 -#define PIO_PC19_IDX 83 -#define PIO_PC20_IDX 84 -#define PIO_PC21_IDX 85 -#define PIO_PC22_IDX 86 -#define PIO_PC23_IDX 87 -#define PIO_PC24_IDX 88 -#define PIO_PC25_IDX 89 -#define PIO_PC26_IDX 90 -#define PIO_PC27_IDX 91 -#define PIO_PC28_IDX 92 -#define PIO_PC29_IDX 93 -#define PIO_PC30_IDX 94 -#define PIO_PC31_IDX 95 -#define PIO_PD0_IDX 96 -#define PIO_PD1_IDX 97 -#define PIO_PD2_IDX 98 -#define PIO_PD3_IDX 99 -#define PIO_PD4_IDX 100 -#define PIO_PD5_IDX 101 -#define PIO_PD6_IDX 102 -#define PIO_PD7_IDX 103 -#define PIO_PD8_IDX 104 -#define PIO_PD9_IDX 105 -#define PIO_PD10_IDX 106 -#define PIO_PD11_IDX 107 -#define PIO_PD12_IDX 108 -#define PIO_PD13_IDX 109 -#define PIO_PD14_IDX 110 -#define PIO_PD15_IDX 111 -#define PIO_PD16_IDX 112 -#define PIO_PD17_IDX 113 -#define PIO_PD18_IDX 114 -#define PIO_PD19_IDX 115 -#define PIO_PD20_IDX 116 -#define PIO_PD21_IDX 117 -#define PIO_PD22_IDX 118 -#define PIO_PD23_IDX 119 -#define PIO_PD24_IDX 120 -#define PIO_PD25_IDX 121 -#define PIO_PD26_IDX 122 -#define PIO_PD27_IDX 123 -#define PIO_PD28_IDX 124 -#define PIO_PD29_IDX 125 -#define PIO_PD30_IDX 126 -#define PIO_PD31_IDX 127 -#define PIO_PE0_IDX 128 -#define PIO_PE1_IDX 129 -#define PIO_PE2_IDX 130 -#define PIO_PE3_IDX 131 -#define PIO_PE4_IDX 132 -#define PIO_PE5_IDX 133 - -#endif /* _SAMV71Q19_PIO_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/pio/pio_samv71q20.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/pio/pio_samv71q20.h deleted file mode 100644 index cd9ea31e..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/pio/pio_samv71q20.h +++ /dev/null @@ -1,672 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71Q20_PIO_ -#define _SAMV71Q20_PIO_ - -#define PIO_PA0 (1u << 0) /**< \brief Pin Controlled by PA0 */ -#define PIO_PA1 (1u << 1) /**< \brief Pin Controlled by PA1 */ -#define PIO_PA2 (1u << 2) /**< \brief Pin Controlled by PA2 */ -#define PIO_PA3 (1u << 3) /**< \brief Pin Controlled by PA3 */ -#define PIO_PA4 (1u << 4) /**< \brief Pin Controlled by PA4 */ -#define PIO_PA5 (1u << 5) /**< \brief Pin Controlled by PA5 */ -#define PIO_PA6 (1u << 6) /**< \brief Pin Controlled by PA6 */ -#define PIO_PA7 (1u << 7) /**< \brief Pin Controlled by PA7 */ -#define PIO_PA8 (1u << 8) /**< \brief Pin Controlled by PA8 */ -#define PIO_PA9 (1u << 9) /**< \brief Pin Controlled by PA9 */ -#define PIO_PA10 (1u << 10) /**< \brief Pin Controlled by PA10 */ -#define PIO_PA11 (1u << 11) /**< \brief Pin Controlled by PA11 */ -#define PIO_PA12 (1u << 12) /**< \brief Pin Controlled by PA12 */ -#define PIO_PA13 (1u << 13) /**< \brief Pin Controlled by PA13 */ -#define PIO_PA14 (1u << 14) /**< \brief Pin Controlled by PA14 */ -#define PIO_PA15 (1u << 15) /**< \brief Pin Controlled by PA15 */ -#define PIO_PA16 (1u << 16) /**< \brief Pin Controlled by PA16 */ -#define PIO_PA17 (1u << 17) /**< \brief Pin Controlled by PA17 */ -#define PIO_PA18 (1u << 18) /**< \brief Pin Controlled by PA18 */ -#define PIO_PA19 (1u << 19) /**< \brief Pin Controlled by PA19 */ -#define PIO_PA20 (1u << 20) /**< \brief Pin Controlled by PA20 */ -#define PIO_PA21 (1u << 21) /**< \brief Pin Controlled by PA21 */ -#define PIO_PA22 (1u << 22) /**< \brief Pin Controlled by PA22 */ -#define PIO_PA23 (1u << 23) /**< \brief Pin Controlled by PA23 */ -#define PIO_PA24 (1u << 24) /**< \brief Pin Controlled by PA24 */ -#define PIO_PA25 (1u << 25) /**< \brief Pin Controlled by PA25 */ -#define PIO_PA26 (1u << 26) /**< \brief Pin Controlled by PA26 */ -#define PIO_PA27 (1u << 27) /**< \brief Pin Controlled by PA27 */ -#define PIO_PA28 (1u << 28) /**< \brief Pin Controlled by PA28 */ -#define PIO_PA29 (1u << 29) /**< \brief Pin Controlled by PA29 */ -#define PIO_PA30 (1u << 30) /**< \brief Pin Controlled by PA30 */ -#define PIO_PA31 (1u << 31) /**< \brief Pin Controlled by PA31 */ -#define PIO_PB0 (1u << 0) /**< \brief Pin Controlled by PB0 */ -#define PIO_PB1 (1u << 1) /**< \brief Pin Controlled by PB1 */ -#define PIO_PB2 (1u << 2) /**< \brief Pin Controlled by PB2 */ -#define PIO_PB3 (1u << 3) /**< \brief Pin Controlled by PB3 */ -#define PIO_PB4 (1u << 4) /**< \brief Pin Controlled by PB4 */ -#define PIO_PB5 (1u << 5) /**< \brief Pin Controlled by PB5 */ -#define PIO_PB6 (1u << 6) /**< \brief Pin Controlled by PB6 */ -#define PIO_PB7 (1u << 7) /**< \brief Pin Controlled by PB7 */ -#define PIO_PB8 (1u << 8) /**< \brief Pin Controlled by PB8 */ -#define PIO_PB9 (1u << 9) /**< \brief Pin Controlled by PB9 */ -#define PIO_PB12 (1u << 12) /**< \brief Pin Controlled by PB12 */ -#define PIO_PB13 (1u << 13) /**< \brief Pin Controlled by PB13 */ -#define PIO_PC0 (1u << 0) /**< \brief Pin Controlled by PC0 */ -#define PIO_PC1 (1u << 1) /**< \brief Pin Controlled by PC1 */ -#define PIO_PC2 (1u << 2) /**< \brief Pin Controlled by PC2 */ -#define PIO_PC3 (1u << 3) /**< \brief Pin Controlled by PC3 */ -#define PIO_PC4 (1u << 4) /**< \brief Pin Controlled by PC4 */ -#define PIO_PC5 (1u << 5) /**< \brief Pin Controlled by PC5 */ -#define PIO_PC6 (1u << 6) /**< \brief Pin Controlled by PC6 */ -#define PIO_PC7 (1u << 7) /**< \brief Pin Controlled by PC7 */ -#define PIO_PC8 (1u << 8) /**< \brief Pin Controlled by PC8 */ -#define PIO_PC9 (1u << 9) /**< \brief Pin Controlled by PC9 */ -#define PIO_PC10 (1u << 10) /**< \brief Pin Controlled by PC10 */ -#define PIO_PC11 (1u << 11) /**< \brief Pin Controlled by PC11 */ -#define PIO_PC12 (1u << 12) /**< \brief Pin Controlled by PC12 */ -#define PIO_PC13 (1u << 13) /**< \brief Pin Controlled by PC13 */ -#define PIO_PC14 (1u << 14) /**< \brief Pin Controlled by PC14 */ -#define PIO_PC15 (1u << 15) /**< \brief Pin Controlled by PC15 */ -#define PIO_PC16 (1u << 16) /**< \brief Pin Controlled by PC16 */ -#define PIO_PC17 (1u << 17) /**< \brief Pin Controlled by PC17 */ -#define PIO_PC18 (1u << 18) /**< \brief Pin Controlled by PC18 */ -#define PIO_PC19 (1u << 19) /**< \brief Pin Controlled by PC19 */ -#define PIO_PC20 (1u << 20) /**< \brief Pin Controlled by PC20 */ -#define PIO_PC21 (1u << 21) /**< \brief Pin Controlled by PC21 */ -#define PIO_PC22 (1u << 22) /**< \brief Pin Controlled by PC22 */ -#define PIO_PC23 (1u << 23) /**< \brief Pin Controlled by PC23 */ -#define PIO_PC24 (1u << 24) /**< \brief Pin Controlled by PC24 */ -#define PIO_PC25 (1u << 25) /**< \brief Pin Controlled by PC25 */ -#define PIO_PC26 (1u << 26) /**< \brief Pin Controlled by PC26 */ -#define PIO_PC27 (1u << 27) /**< \brief Pin Controlled by PC27 */ -#define PIO_PC28 (1u << 28) /**< \brief Pin Controlled by PC28 */ -#define PIO_PC29 (1u << 29) /**< \brief Pin Controlled by PC29 */ -#define PIO_PC30 (1u << 30) /**< \brief Pin Controlled by PC30 */ -#define PIO_PC31 (1u << 31) /**< \brief Pin Controlled by PC31 */ -#define PIO_PD0 (1u << 0) /**< \brief Pin Controlled by PD0 */ -#define PIO_PD1 (1u << 1) /**< \brief Pin Controlled by PD1 */ -#define PIO_PD2 (1u << 2) /**< \brief Pin Controlled by PD2 */ -#define PIO_PD3 (1u << 3) /**< \brief Pin Controlled by PD3 */ -#define PIO_PD4 (1u << 4) /**< \brief Pin Controlled by PD4 */ -#define PIO_PD5 (1u << 5) /**< \brief Pin Controlled by PD5 */ -#define PIO_PD6 (1u << 6) /**< \brief Pin Controlled by PD6 */ -#define PIO_PD7 (1u << 7) /**< \brief Pin Controlled by PD7 */ -#define PIO_PD8 (1u << 8) /**< \brief Pin Controlled by PD8 */ -#define PIO_PD9 (1u << 9) /**< \brief Pin Controlled by PD9 */ -#define PIO_PD10 (1u << 10) /**< \brief Pin Controlled by PD10 */ -#define PIO_PD11 (1u << 11) /**< \brief Pin Controlled by PD11 */ -#define PIO_PD12 (1u << 12) /**< \brief Pin Controlled by PD12 */ -#define PIO_PD13 (1u << 13) /**< \brief Pin Controlled by PD13 */ -#define PIO_PD14 (1u << 14) /**< \brief Pin Controlled by PD14 */ -#define PIO_PD15 (1u << 15) /**< \brief Pin Controlled by PD15 */ -#define PIO_PD16 (1u << 16) /**< \brief Pin Controlled by PD16 */ -#define PIO_PD17 (1u << 17) /**< \brief Pin Controlled by PD17 */ -#define PIO_PD18 (1u << 18) /**< \brief Pin Controlled by PD18 */ -#define PIO_PD19 (1u << 19) /**< \brief Pin Controlled by PD19 */ -#define PIO_PD20 (1u << 20) /**< \brief Pin Controlled by PD20 */ -#define PIO_PD21 (1u << 21) /**< \brief Pin Controlled by PD21 */ -#define PIO_PD22 (1u << 22) /**< \brief Pin Controlled by PD22 */ -#define PIO_PD23 (1u << 23) /**< \brief Pin Controlled by PD23 */ -#define PIO_PD24 (1u << 24) /**< \brief Pin Controlled by PD24 */ -#define PIO_PD25 (1u << 25) /**< \brief Pin Controlled by PD25 */ -#define PIO_PD26 (1u << 26) /**< \brief Pin Controlled by PD26 */ -#define PIO_PD27 (1u << 27) /**< \brief Pin Controlled by PD27 */ -#define PIO_PD28 (1u << 28) /**< \brief Pin Controlled by PD28 */ -#define PIO_PD29 (1u << 29) /**< \brief Pin Controlled by PD29 */ -#define PIO_PD30 (1u << 30) /**< \brief Pin Controlled by PD30 */ -#define PIO_PD31 (1u << 31) /**< \brief Pin Controlled by PD31 */ -#define PIO_PE0 (1u << 0) /**< \brief Pin Controlled by PE0 */ -#define PIO_PE1 (1u << 1) /**< \brief Pin Controlled by PE1 */ -#define PIO_PE2 (1u << 2) /**< \brief Pin Controlled by PE2 */ -#define PIO_PE3 (1u << 3) /**< \brief Pin Controlled by PE3 */ -#define PIO_PE4 (1u << 4) /**< \brief Pin Controlled by PE4 */ -#define PIO_PE5 (1u << 5) /**< \brief Pin Controlled by PE5 */ -/* ========== Pio definition for AFEC0 peripheral ========== */ -#define PIO_PD30X1_AFE0_AD0 (1u << 30) /**< \brief Afec0 signal: AFE0_AD0 */ -#define PIO_PA21X1_AFE0_AD1 (1u << 21) /**< \brief Afec0 signal: AFE0_AD1/PIODCEN2 */ -#define PIO_PA21X1_PIODCEN2 (1u << 21) /**< \brief Afec0 signal: AFE0_AD1/PIODCEN2 */ -#define PIO_PB0X1_AFE0_AD10 (1u << 0) /**< \brief Afec0 signal: AFE0_AD10/RTCOUT0 */ -#define PIO_PB0X1_RTCOUT0 (1u << 0) /**< \brief Afec0 signal: AFE0_AD10/RTCOUT0 */ -#define PIO_PB3X1_AFE0_AD2 (1u << 3) /**< \brief Afec0 signal: AFE0_AD2/WKUP12 */ -#define PIO_PB3X1_WKUP12 (1u << 3) /**< \brief Afec0 signal: AFE0_AD2/WKUP12 */ -#define PIO_PE5X1_AFE0_AD3 (1u << 5) /**< \brief Afec0 signal: AFE0_AD3 */ -#define PIO_PE4X1_AFE0_AD4 (1u << 4) /**< \brief Afec0 signal: AFE0_AD4 */ -#define PIO_PB2X1_AFE0_AD5 (1u << 2) /**< \brief Afec0 signal: AFE0_AD5 */ -#define PIO_PA17X1_AFE0_AD6 (1u << 17) /**< \brief Afec0 signal: AFE0_AD6 */ -#define PIO_PA18X1_AFE0_AD7 (1u << 18) /**< \brief Afec0 signal: AFE0_AD7 */ -#define PIO_PA19X1_AFE0_AD8 (1u << 19) /**< \brief Afec0 signal: AFE0_AD8/WKUP9 */ -#define PIO_PA19X1_WKUP9 (1u << 19) /**< \brief Afec0 signal: AFE0_AD8/WKUP9 */ -#define PIO_PA20X1_AFE0_AD9 (1u << 20) /**< \brief Afec0 signal: AFE0_AD9/WKUP10 */ -#define PIO_PA20X1_WKUP10 (1u << 20) /**< \brief Afec0 signal: AFE0_AD9/WKUP10 */ -#define PIO_PA8B_AFE0_ADTRG (1u << 8) /**< \brief Afec0 signal: AFE0_ADTRG */ -/* ========== Pio definition for AFEC1 peripheral ========== */ -#define PIO_PB1X1_AFE1_AD0 (1u << 1) /**< \brief Afec1 signal: AFE1_AD0/RTCOUT1 */ -#define PIO_PB1X1_RTCOUT1 (1u << 1) /**< \brief Afec1 signal: AFE1_AD0/RTCOUT1 */ -#define PIO_PC13X1_AFE1_AD1 (1u << 13) /**< \brief Afec1 signal: AFE1_AD1 */ -#define PIO_PE3X1_AFE1_AD10 (1u << 3) /**< \brief Afec1 signal: AFE1_AD10 */ -#define PIO_PE0X1_AFE1_AD11 (1u << 0) /**< \brief Afec1 signal: AFE1_AD11 */ -#define PIO_PC15X1_AFE1_AD2 (1u << 15) /**< \brief Afec1 signal: AFE1_AD2 */ -#define PIO_PC12X1_AFE1_AD3 (1u << 12) /**< \brief Afec1 signal: AFE1_AD3 */ -#define PIO_PC29X1_AFE1_AD4 (1u << 29) /**< \brief Afec1 signal: AFE1_AD4 */ -#define PIO_PC30X1_AFE1_AD5 (1u << 30) /**< \brief Afec1 signal: AFE1_AD5 */ -#define PIO_PC31X1_AFE1_AD6 (1u << 31) /**< \brief Afec1 signal: AFE1_AD6 */ -#define PIO_PC26X1_AFE1_AD7 (1u << 26) /**< \brief Afec1 signal: AFE1_AD7 */ -#define PIO_PC27X1_AFE1_AD8 (1u << 27) /**< \brief Afec1 signal: AFE1_AD8 */ -#define PIO_PC0X1_AFE1_AD9 (1u << 0) /**< \brief Afec1 signal: AFE1_AD9 */ -#define PIO_PD9C_AFE1_ADTRG (1u << 9) /**< \brief Afec1 signal: AFE1_ADTRG */ -/* ========== Pio definition for ARM peripheral ========== */ -#define PIO_PB7X1_SWCLK (1u << 7) /**< \brief Arm signal: SWCLK/TCK */ -#define PIO_PB7X1_TCK (1u << 7) /**< \brief Arm signal: SWCLK/TCK */ -#define PIO_PB6X1_SWDIO (1u << 6) /**< \brief Arm signal: SWDIO/TMS */ -#define PIO_PB6X1_TMS (1u << 6) /**< \brief Arm signal: SWDIO/TMS */ -#define PIO_PB4X1_TDI (1u << 4) /**< \brief Arm signal: TDI */ -#define PIO_PB5X1_TDO (1u << 5) /**< \brief Arm signal: TDO/TRACESWO/WKUP13 */ -#define PIO_PB5X1_TRACESWO (1u << 5) /**< \brief Arm signal: TDO/TRACESWO/WKUP13 */ -#define PIO_PB5X1_WKUP13 (1u << 5) /**< \brief Arm signal: TDO/TRACESWO/WKUP13 */ -/* ========== Pio definition for DACC peripheral ========== */ -#define PIO_PB13X1_DAC0 (1u << 13) /**< \brief Dacc signal: DAC0 */ -#define PIO_PD0X1_DAC1 (1u << 0) /**< \brief Dacc signal: DAC1 */ -#define PIO_PA2C_DATRG (1u << 2) /**< \brief Dacc signal: DATRG */ -/* ========== Pio definition for EBI peripheral ========== */ -#define PIO_PC18A_A0 (1u << 18) /**< \brief Ebi signal: A0/NBS0 */ -#define PIO_PC18A_NBS0 (1u << 18) /**< \brief Ebi signal: A0/NBS0 */ -#define PIO_PC19A_A1 (1u << 19) /**< \brief Ebi signal: A1 */ -#define PIO_PC28A_A10 (1u << 28) /**< \brief Ebi signal: A10 */ -#define PIO_PC29A_A11 (1u << 29) /**< \brief Ebi signal: A11 */ -#define PIO_PC30A_A12 (1u << 30) /**< \brief Ebi signal: A12 */ -#define PIO_PC31A_A13 (1u << 31) /**< \brief Ebi signal: A13 */ -#define PIO_PA18C_A14 (1u << 18) /**< \brief Ebi signal: A14 */ -#define PIO_PA19C_A15 (1u << 19) /**< \brief Ebi signal: A15 */ -#define PIO_PA20C_A16 (1u << 20) /**< \brief Ebi signal: A16/BA0 */ -#define PIO_PA20C_BA0 (1u << 20) /**< \brief Ebi signal: A16/BA0 */ -#define PIO_PA0C_A17 (1u << 0) /**< \brief Ebi signal: A17/BA1 */ -#define PIO_PA0C_BA1 (1u << 0) /**< \brief Ebi signal: A17/BA1 */ -#define PIO_PA1C_A18 (1u << 1) /**< \brief Ebi signal: A18 */ -#define PIO_PA23C_A19 (1u << 23) /**< \brief Ebi signal: A19 */ -#define PIO_PC20A_A2 (1u << 20) /**< \brief Ebi signal: A2 */ -#define PIO_PA24C_A20 (1u << 24) /**< \brief Ebi signal: A20 */ -#define PIO_PC16A_A21 (1u << 16) /**< \brief Ebi signal: A21/NANDALE */ -#define PIO_PC16A_NANDALE (1u << 16) /**< \brief Ebi signal: A21/NANDALE */ -#define PIO_PC17A_A22 (1u << 17) /**< \brief Ebi signal: A22/NANDCLE */ -#define PIO_PC17A_NANDCLE (1u << 17) /**< \brief Ebi signal: A22/NANDCLE */ -#define PIO_PA25C_A23 (1u << 25) /**< \brief Ebi signal: A23 */ -#define PIO_PC21A_A3 (1u << 21) /**< \brief Ebi signal: A3 */ -#define PIO_PC22A_A4 (1u << 22) /**< \brief Ebi signal: A4 */ -#define PIO_PC23A_A5 (1u << 23) /**< \brief Ebi signal: A5 */ -#define PIO_PC24A_A6 (1u << 24) /**< \brief Ebi signal: A6 */ -#define PIO_PC25A_A7 (1u << 25) /**< \brief Ebi signal: A7 */ -#define PIO_PC26A_A8 (1u << 26) /**< \brief Ebi signal: A8 */ -#define PIO_PC27A_A9 (1u << 27) /**< \brief Ebi signal: A9 */ -#define PIO_PD17C_CAS (1u << 17) /**< \brief Ebi signal: CAS */ -#define PIO_PC0A_D0 (1u << 0) /**< \brief Ebi signal: D0 */ -#define PIO_PC1A_D1 (1u << 1) /**< \brief Ebi signal: D1 */ -#define PIO_PE2A_D10 (1u << 2) /**< \brief Ebi signal: D10 */ -#define PIO_PE3A_D11 (1u << 3) /**< \brief Ebi signal: D11 */ -#define PIO_PE4A_D12 (1u << 4) /**< \brief Ebi signal: D12 */ -#define PIO_PE5A_D13 (1u << 5) /**< \brief Ebi signal: D13 */ -#define PIO_PA15A_D14 (1u << 15) /**< \brief Ebi signal: D14 */ -#define PIO_PA16A_D15 (1u << 16) /**< \brief Ebi signal: D15 */ -#define PIO_PC2A_D2 (1u << 2) /**< \brief Ebi signal: D2 */ -#define PIO_PC3A_D3 (1u << 3) /**< \brief Ebi signal: D3 */ -#define PIO_PC4A_D4 (1u << 4) /**< \brief Ebi signal: D4 */ -#define PIO_PC5A_D5 (1u << 5) /**< \brief Ebi signal: D5 */ -#define PIO_PC6A_D6 (1u << 6) /**< \brief Ebi signal: D6 */ -#define PIO_PC7A_D7 (1u << 7) /**< \brief Ebi signal: D7 */ -#define PIO_PE0A_D8 (1u << 0) /**< \brief Ebi signal: D8 */ -#define PIO_PE1A_D9 (1u << 1) /**< \brief Ebi signal: D9 */ -#define PIO_PC9A_NANDOE (1u << 9) /**< \brief Ebi signal: NANDOE */ -#define PIO_PC10A_NANDWE (1u << 10) /**< \brief Ebi signal: NANDWE */ -#define PIO_PC14A_NCS0 (1u << 14) /**< \brief Ebi signal: NCS0 */ -#define PIO_PC15A_NCS1 (1u << 15) /**< \brief Ebi signal: NCS1/SDCS */ -#define PIO_PC15A_SDCS (1u << 15) /**< \brief Ebi signal: NCS1/SDCS */ -#define PIO_PD18A_NCS1 (1u << 18) /**< \brief Ebi signal: NCS1/SDCS */ -#define PIO_PD18A_SDCS (1u << 18) /**< \brief Ebi signal: NCS1/SDCS */ -#define PIO_PA22C_NCS2 (1u << 22) /**< \brief Ebi signal: NCS2 */ -#define PIO_PC12A_NCS3 (1u << 12) /**< \brief Ebi signal: NCS3 */ -#define PIO_PD19A_NCS3 (1u << 19) /**< \brief Ebi signal: NCS3 */ -#define PIO_PC11A_NRD (1u << 11) /**< \brief Ebi signal: NRD */ -#define PIO_PC13A_NWAIT (1u << 13) /**< \brief Ebi signal: NWAIT */ -#define PIO_PC8A_NWR0 (1u << 8) /**< \brief Ebi signal: NWR0/NWE */ -#define PIO_PC8A_NWE (1u << 8) /**< \brief Ebi signal: NWR0/NWE */ -#define PIO_PD15C_NWR1 (1u << 15) /**< \brief Ebi signal: NWR1/NBS1 */ -#define PIO_PD15C_NBS1 (1u << 15) /**< \brief Ebi signal: NWR1/NBS1 */ -#define PIO_PD16C_RAS (1u << 16) /**< \brief Ebi signal: RAS */ -#define PIO_PC13C_SDA10 (1u << 13) /**< \brief Ebi signal: SDA10 */ -#define PIO_PD13C_SDA10 (1u << 13) /**< \brief Ebi signal: SDA10 */ -#define PIO_PD23C_SDCK (1u << 23) /**< \brief Ebi signal: SDCK */ -#define PIO_PD14C_SDCKE (1u << 14) /**< \brief Ebi signal: SDCKE */ -#define PIO_PD29C_SDWE (1u << 29) /**< \brief Ebi signal: SDWE */ -/* ========== Pio definition for GMAC peripheral ========== */ -#define PIO_PD13A_GCOL (1u << 13) /**< \brief Gmac signal: GCOL */ -#define PIO_PD10A_GCRS (1u << 10) /**< \brief Gmac signal: GCRS */ -#define PIO_PD8A_GMDC (1u << 8) /**< \brief Gmac signal: GMDC */ -#define PIO_PD9A_GMDIO (1u << 9) /**< \brief Gmac signal: GMDIO */ -#define PIO_PD5A_GRX0 (1u << 5) /**< \brief Gmac signal: GRX0 */ -#define PIO_PD6A_GRX1 (1u << 6) /**< \brief Gmac signal: GRX1 */ -#define PIO_PD11A_GRX2 (1u << 11) /**< \brief Gmac signal: GRX2 */ -#define PIO_PD12A_GRX3 (1u << 12) /**< \brief Gmac signal: GRX3 */ -#define PIO_PD14A_GRXCK (1u << 14) /**< \brief Gmac signal: GRXCK */ -#define PIO_PD4A_GRXDV (1u << 4) /**< \brief Gmac signal: GRXDV */ -#define PIO_PD7A_GRXER (1u << 7) /**< \brief Gmac signal: GRXER */ -#define PIO_PB1B_GTSUCOMP (1u << 1) /**< \brief Gmac signal: GTSUCOMP */ -#define PIO_PB12B_GTSUCOMP (1u << 12) /**< \brief Gmac signal: GTSUCOMP */ -#define PIO_PD11C_GTSUCOMP (1u << 11) /**< \brief Gmac signal: GTSUCOMP */ -#define PIO_PD20C_GTSUCOMP (1u << 20) /**< \brief Gmac signal: GTSUCOMP */ -#define PIO_PD2A_GTX0 (1u << 2) /**< \brief Gmac signal: GTX0 */ -#define PIO_PD3A_GTX1 (1u << 3) /**< \brief Gmac signal: GTX1 */ -#define PIO_PD15A_GTX2 (1u << 15) /**< \brief Gmac signal: GTX2 */ -#define PIO_PD16A_GTX3 (1u << 16) /**< \brief Gmac signal: GTX3 */ -#define PIO_PD0A_GTXCK (1u << 0) /**< \brief Gmac signal: GTXCK */ -#define PIO_PD1A_GTXEN (1u << 1) /**< \brief Gmac signal: GTXEN */ -#define PIO_PD17A_GTXER (1u << 17) /**< \brief Gmac signal: GTXER */ -/* ========== Pio definition for HSMCI peripheral ========== */ -#define PIO_PA28C_MCCDA (1u << 28) /**< \brief Hsmci signal: MCCDA */ -#define PIO_PA25D_MCCK (1u << 25) /**< \brief Hsmci signal: MCCK */ -#define PIO_PA30C_MCDA0 (1u << 30) /**< \brief Hsmci signal: MCDA0 */ -#define PIO_PA31C_MCDA1 (1u << 31) /**< \brief Hsmci signal: MCDA1 */ -#define PIO_PA26C_MCDA2 (1u << 26) /**< \brief Hsmci signal: MCDA2 */ -#define PIO_PA27C_MCDA3 (1u << 27) /**< \brief Hsmci signal: MCDA3 */ -/* ========== Pio definition for ISI peripheral ========== */ -#define PIO_PD22D_ISI_D0 (1u << 22) /**< \brief Isi signal: ISI_D0 */ -#define PIO_PD21D_ISI_D1 (1u << 21) /**< \brief Isi signal: ISI_D1 */ -#define PIO_PD30D_ISI_D10 (1u << 30) /**< \brief Isi signal: ISI_D10 */ -#define PIO_PD31D_ISI_D11 (1u << 31) /**< \brief Isi signal: ISI_D11 */ -#define PIO_PB3D_ISI_D2 (1u << 3) /**< \brief Isi signal: ISI_D2 */ -#define PIO_PA9B_ISI_D3 (1u << 9) /**< \brief Isi signal: ISI_D3 */ -#define PIO_PA5B_ISI_D4 (1u << 5) /**< \brief Isi signal: ISI_D4 */ -#define PIO_PD11D_ISI_D5 (1u << 11) /**< \brief Isi signal: ISI_D5 */ -#define PIO_PD12D_ISI_D6 (1u << 12) /**< \brief Isi signal: ISI_D6 */ -#define PIO_PA27D_ISI_D7 (1u << 27) /**< \brief Isi signal: ISI_D7 */ -#define PIO_PD27D_ISI_D8 (1u << 27) /**< \brief Isi signal: ISI_D8 */ -#define PIO_PD28D_ISI_D9 (1u << 28) /**< \brief Isi signal: ISI_D9 */ -#define PIO_PD24D_ISI_HSYNC (1u << 24) /**< \brief Isi signal: ISI_HSYNC */ -#define PIO_PA24D_ISI_PCK (1u << 24) /**< \brief Isi signal: ISI_PCK */ -#define PIO_PD25D_ISI_VSYNC (1u << 25) /**< \brief Isi signal: ISI_VSYNC */ -/* ========== Pio definition for MCAN0 peripheral ========== */ -#define PIO_PB3A_CANRX0 (1u << 3) /**< \brief Mcan0 signal: CANRX0 */ -#define PIO_PB2A_CANTX0 (1u << 2) /**< \brief Mcan0 signal: CANTX0 */ -/* ========== Pio definition for MCAN1 peripheral ========== */ -#define PIO_PC12C_CANRX1 (1u << 12) /**< \brief Mcan1 signal: CANRX1 */ -#define PIO_PD28B_CANRX1 (1u << 28) /**< \brief Mcan1 signal: CANRX1 */ -#define PIO_PC14C_CANTX1 (1u << 14) /**< \brief Mcan1 signal: CANTX1 */ -#define PIO_PD12B_CANTX1 (1u << 12) /**< \brief Mcan1 signal: CANTX1 */ -/* ========== Pio definition for MLB peripheral ========== */ -#define PIO_PB4C_MLBCLK (1u << 4) /**< \brief Mlb signal: MLBCLK */ -#define PIO_PB5C_MLBDAT (1u << 5) /**< \brief Mlb signal: MLBDAT */ -#define PIO_PD10D_MLBSIG (1u << 10) /**< \brief Mlb signal: MLBSIG */ -/* ========== Pio definition for PIOA peripheral ========== */ -#define PIO_PA21X1_AFE0_AD1 (1u << 21) /**< \brief Pioa signal: AFE0_AD1/PIODCEN2 */ -#define PIO_PA21X1_PIODCEN2 (1u << 21) /**< \brief Pioa signal: AFE0_AD1/PIODCEN2 */ -#define PIO_PA3X1_PIODC0 (1u << 3) /**< \brief Pioa signal: PIODC0 */ -#define PIO_PA10X1_PIODC4 (1u << 10) /**< \brief Pioa signal: PIODC4 */ -#define PIO_PA12X1_PIODC6 (1u << 12) /**< \brief Pioa signal: PIODC6 */ -#define PIO_PA13X1_PIODC7 (1u << 13) /**< \brief Pioa signal: PIODC7 */ -#define PIO_PA22X1_PIODCCLK (1u << 22) /**< \brief Pioa signal: PIODCCLK */ -#define PIO_PA4X1_WKUP3 (1u << 4) /**< \brief Pioa signal: WKUP3/PIODC1 */ -#define PIO_PA4X1_PIODC1 (1u << 4) /**< \brief Pioa signal: WKUP3/PIODC1 */ -#define PIO_PA5X1_WKUP4 (1u << 5) /**< \brief Pioa signal: WKUP4/PIODC2 */ -#define PIO_PA5X1_PIODC2 (1u << 5) /**< \brief Pioa signal: WKUP4/PIODC2 */ -#define PIO_PA9X1_WKUP6 (1u << 9) /**< \brief Pioa signal: WKUP6/PIODC3 */ -#define PIO_PA9X1_PIODC3 (1u << 9) /**< \brief Pioa signal: WKUP6/PIODC3 */ -#define PIO_PA11X1_WKUP7 (1u << 11) /**< \brief Pioa signal: WKUP7/PIODC5 */ -#define PIO_PA11X1_PIODC5 (1u << 11) /**< \brief Pioa signal: WKUP7/PIODC5 */ -#define PIO_PA14X1_WKUP8 (1u << 14) /**< \brief Pioa signal: WKUP8/PIODCEN1 */ -#define PIO_PA14X1_PIODCEN1 (1u << 14) /**< \brief Pioa signal: WKUP8/PIODCEN1 */ -/* ========== Pio definition for PMC peripheral ========== */ -#define PIO_PA6B_PCK0 (1u << 6) /**< \brief Pmc signal: PCK0 */ -#define PIO_PB12D_PCK0 (1u << 12) /**< \brief Pmc signal: PCK0 */ -#define PIO_PB13B_PCK0 (1u << 13) /**< \brief Pmc signal: PCK0 */ -#define PIO_PA17B_PCK1 (1u << 17) /**< \brief Pmc signal: PCK1 */ -#define PIO_PA21B_PCK1 (1u << 21) /**< \brief Pmc signal: PCK1 */ -#define PIO_PA3C_PCK2 (1u << 3) /**< \brief Pmc signal: PCK2 */ -#define PIO_PA18B_PCK2 (1u << 18) /**< \brief Pmc signal: PCK2 */ -#define PIO_PA31B_PCK2 (1u << 31) /**< \brief Pmc signal: PCK2 */ -#define PIO_PB3B_PCK2 (1u << 3) /**< \brief Pmc signal: PCK2 */ -#define PIO_PD31C_PCK2 (1u << 31) /**< \brief Pmc signal: PCK2 */ -/* ========== Pio definition for PWM0 peripheral ========== */ -#define PIO_PA10B_PWMC0_PWMEXTRG0 (1u << 10) /**< \brief Pwm0 signal: PWMC0_PWMEXTRG0 */ -#define PIO_PA22B_PWMC0_PWMEXTRG1 (1u << 22) /**< \brief Pwm0 signal: PWMC0_PWMEXTRG1 */ -#define PIO_PA9C_PWMC0_PWMFI0 (1u << 9) /**< \brief Pwm0 signal: PWMC0_PWMFI0 */ -#define PIO_PD8B_PWMC0_PWMFI1 (1u << 8) /**< \brief Pwm0 signal: PWMC0_PWMFI1 */ -#define PIO_PD9B_PWMC0_PWMFI2 (1u << 9) /**< \brief Pwm0 signal: PWMC0_PWMFI2 */ -#define PIO_PA0A_PWMC0_PWMH0 (1u << 0) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PA11B_PWMC0_PWMH0 (1u << 11) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PA23B_PWMC0_PWMH0 (1u << 23) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PB0A_PWMC0_PWMH0 (1u << 0) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PD11B_PWMC0_PWMH0 (1u << 11) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PD20A_PWMC0_PWMH0 (1u << 20) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PA2A_PWMC0_PWMH1 (1u << 2) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PA12B_PWMC0_PWMH1 (1u << 12) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PA24B_PWMC0_PWMH1 (1u << 24) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PB1A_PWMC0_PWMH1 (1u << 1) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PD21A_PWMC0_PWMH1 (1u << 21) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PA13B_PWMC0_PWMH2 (1u << 13) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PA25B_PWMC0_PWMH2 (1u << 25) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PB4B_PWMC0_PWMH2 (1u << 4) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PC19B_PWMC0_PWMH2 (1u << 19) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PD22A_PWMC0_PWMH2 (1u << 22) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PA7B_PWMC0_PWMH3 (1u << 7) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PA14B_PWMC0_PWMH3 (1u << 14) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PA17C_PWMC0_PWMH3 (1u << 17) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PC13B_PWMC0_PWMH3 (1u << 13) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PC21B_PWMC0_PWMH3 (1u << 21) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PD23A_PWMC0_PWMH3 (1u << 23) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PA1A_PWMC0_PWML0 (1u << 1) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PA19B_PWMC0_PWML0 (1u << 19) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PB5B_PWMC0_PWML0 (1u << 5) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PC0B_PWMC0_PWML0 (1u << 0) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PD10B_PWMC0_PWML0 (1u << 10) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PD24A_PWMC0_PWML0 (1u << 24) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PA20B_PWMC0_PWML1 (1u << 20) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PB12A_PWMC0_PWML1 (1u << 12) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PC1B_PWMC0_PWML1 (1u << 1) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PC18B_PWMC0_PWML1 (1u << 18) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PD25A_PWMC0_PWML1 (1u << 25) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PA16C_PWMC0_PWML2 (1u << 16) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PA30A_PWMC0_PWML2 (1u << 30) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PB13A_PWMC0_PWML2 (1u << 13) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PC2B_PWMC0_PWML2 (1u << 2) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PC20B_PWMC0_PWML2 (1u << 20) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PD26A_PWMC0_PWML2 (1u << 26) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PA15C_PWMC0_PWML3 (1u << 15) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -#define PIO_PC3B_PWMC0_PWML3 (1u << 3) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -#define PIO_PC15B_PWMC0_PWML3 (1u << 15) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -#define PIO_PC22B_PWMC0_PWML3 (1u << 22) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -#define PIO_PD27A_PWMC0_PWML3 (1u << 27) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -/* ========== Pio definition for PWM1 peripheral ========== */ -#define PIO_PA30B_PWMC1_PWMEXTRG0 (1u << 30) /**< \brief Pwm1 signal: PWMC1_PWMEXTRG0 */ -#define PIO_PA18A_PWMC1_PWMEXTRG1 (1u << 18) /**< \brief Pwm1 signal: PWMC1_PWMEXTRG1 */ -#define PIO_PA21C_PWMC1_PWMFI0 (1u << 21) /**< \brief Pwm1 signal: PWMC1_PWMFI0 */ -#define PIO_PA26D_PWMC1_PWMFI1 (1u << 26) /**< \brief Pwm1 signal: PWMC1_PWMFI1 */ -#define PIO_PA28D_PWMC1_PWMFI2 (1u << 28) /**< \brief Pwm1 signal: PWMC1_PWMFI2 */ -#define PIO_PA12C_PWMC1_PWMH0 (1u << 12) /**< \brief Pwm1 signal: PWMC1_PWMH0 */ -#define PIO_PD1B_PWMC1_PWMH0 (1u << 1) /**< \brief Pwm1 signal: PWMC1_PWMH0 */ -#define PIO_PA14C_PWMC1_PWMH1 (1u << 14) /**< \brief Pwm1 signal: PWMC1_PWMH1 */ -#define PIO_PD3B_PWMC1_PWMH1 (1u << 3) /**< \brief Pwm1 signal: PWMC1_PWMH1 */ -#define PIO_PA31D_PWMC1_PWMH2 (1u << 31) /**< \brief Pwm1 signal: PWMC1_PWMH2 */ -#define PIO_PD5B_PWMC1_PWMH2 (1u << 5) /**< \brief Pwm1 signal: PWMC1_PWMH2 */ -#define PIO_PA8A_PWMC1_PWMH3 (1u << 8) /**< \brief Pwm1 signal: PWMC1_PWMH3 */ -#define PIO_PD7B_PWMC1_PWMH3 (1u << 7) /**< \brief Pwm1 signal: PWMC1_PWMH3 */ -#define PIO_PA11C_PWMC1_PWML0 (1u << 11) /**< \brief Pwm1 signal: PWMC1_PWML0 */ -#define PIO_PD0B_PWMC1_PWML0 (1u << 0) /**< \brief Pwm1 signal: PWMC1_PWML0 */ -#define PIO_PA13C_PWMC1_PWML1 (1u << 13) /**< \brief Pwm1 signal: PWMC1_PWML1 */ -#define PIO_PD2B_PWMC1_PWML1 (1u << 2) /**< \brief Pwm1 signal: PWMC1_PWML1 */ -#define PIO_PA23D_PWMC1_PWML2 (1u << 23) /**< \brief Pwm1 signal: PWMC1_PWML2 */ -#define PIO_PD4B_PWMC1_PWML2 (1u << 4) /**< \brief Pwm1 signal: PWMC1_PWML2 */ -#define PIO_PA5A_PWMC1_PWML3 (1u << 5) /**< \brief Pwm1 signal: PWMC1_PWML3 */ -#define PIO_PD6B_PWMC1_PWML3 (1u << 6) /**< \brief Pwm1 signal: PWMC1_PWML3 */ -/* ========== Pio definition for QSPI peripheral ========== */ -#define PIO_PA11A_QCS (1u << 11) /**< \brief Qspi signal: QCS */ -#define PIO_PA13A_QIO0 (1u << 13) /**< \brief Qspi signal: QIO0 */ -#define PIO_PA12A_QIO1 (1u << 12) /**< \brief Qspi signal: QIO1 */ -#define PIO_PA17A_QIO2 (1u << 17) /**< \brief Qspi signal: QIO2 */ -#define PIO_PD31A_QIO3 (1u << 31) /**< \brief Qspi signal: QIO3 */ -#define PIO_PA14A_QSCK (1u << 14) /**< \brief Qspi signal: QSCK */ -/* ========== Pio definition for SPI0 peripheral ========== */ -#define PIO_PD20B_SPI0_MISO (1u << 20) /**< \brief Spi0 signal: SPI0_MISO */ -#define PIO_PD21B_SPI0_MOSI (1u << 21) /**< \brief Spi0 signal: SPI0_MOSI */ -#define PIO_PB2D_SPI0_NPCS0 (1u << 2) /**< \brief Spi0 signal: SPI0_NPCS0 */ -#define PIO_PA31A_SPI0_NPCS1 (1u << 31) /**< \brief Spi0 signal: SPI0_NPCS1 */ -#define PIO_PD25B_SPI0_NPCS1 (1u << 25) /**< \brief Spi0 signal: SPI0_NPCS1 */ -#define PIO_PD12C_SPI0_NPCS2 (1u << 12) /**< \brief Spi0 signal: SPI0_NPCS2 */ -#define PIO_PD27B_SPI0_NPCS3 (1u << 27) /**< \brief Spi0 signal: SPI0_NPCS3 */ -#define PIO_PD22B_SPI0_SPCK (1u << 22) /**< \brief Spi0 signal: SPI0_SPCK */ -/* ========== Pio definition for SPI1 peripheral ========== */ -#define PIO_PC26C_SPI1_MISO (1u << 26) /**< \brief Spi1 signal: SPI1_MISO */ -#define PIO_PC27C_SPI1_MOSI (1u << 27) /**< \brief Spi1 signal: SPI1_MOSI */ -#define PIO_PC25C_SPI1_NPCS0 (1u << 25) /**< \brief Spi1 signal: SPI1_NPCS0 */ -#define PIO_PC28C_SPI1_NPCS1 (1u << 28) /**< \brief Spi1 signal: SPI1_NPCS1 */ -#define PIO_PD0C_SPI1_NPCS1 (1u << 0) /**< \brief Spi1 signal: SPI1_NPCS1 */ -#define PIO_PC29C_SPI1_NPCS2 (1u << 29) /**< \brief Spi1 signal: SPI1_NPCS2 */ -#define PIO_PD1C_SPI1_NPCS2 (1u << 1) /**< \brief Spi1 signal: SPI1_NPCS2 */ -#define PIO_PC30C_SPI1_NPCS3 (1u << 30) /**< \brief Spi1 signal: SPI1_NPCS3 */ -#define PIO_PD2C_SPI1_NPCS3 (1u << 2) /**< \brief Spi1 signal: SPI1_NPCS3 */ -#define PIO_PC24C_SPI1_SPCK (1u << 24) /**< \brief Spi1 signal: SPI1_SPCK */ -/* ========== Pio definition for SSC peripheral ========== */ -#define PIO_PA10C_RD (1u << 10) /**< \brief Ssc signal: RD */ -#define PIO_PD24B_RF (1u << 24) /**< \brief Ssc signal: RF */ -#define PIO_PA22A_RK (1u << 22) /**< \brief Ssc signal: RK */ -#define PIO_PB5D_TD (1u << 5) /**< \brief Ssc signal: TD */ -#define PIO_PD10C_TD (1u << 10) /**< \brief Ssc signal: TD */ -#define PIO_PD26B_TD (1u << 26) /**< \brief Ssc signal: TD */ -#define PIO_PB0D_TF (1u << 0) /**< \brief Ssc signal: TF */ -#define PIO_PB1D_TK (1u << 1) /**< \brief Ssc signal: TK */ -/* ========== Pio definition for TC0 peripheral ========== */ -#define PIO_PA4B_TCLK0 (1u << 4) /**< \brief Tc0 signal: TCLK0 */ -#define PIO_PA28B_TCLK1 (1u << 28) /**< \brief Tc0 signal: TCLK1 */ -#define PIO_PA29B_TCLK2 (1u << 29) /**< \brief Tc0 signal: TCLK2 */ -#define PIO_PA0B_TIOA0 (1u << 0) /**< \brief Tc0 signal: TIOA0 */ -#define PIO_PA15B_TIOA1 (1u << 15) /**< \brief Tc0 signal: TIOA1 */ -#define PIO_PA26B_TIOA2 (1u << 26) /**< \brief Tc0 signal: TIOA2 */ -#define PIO_PA1B_TIOB0 (1u << 1) /**< \brief Tc0 signal: TIOB0 */ -#define PIO_PA16B_TIOB1 (1u << 16) /**< \brief Tc0 signal: TIOB1 */ -#define PIO_PA27B_TIOB2 (1u << 27) /**< \brief Tc0 signal: TIOB2 */ -/* ========== Pio definition for TC1 peripheral ========== */ -#define PIO_PC25B_TCLK3 (1u << 25) /**< \brief Tc1 signal: TCLK3 */ -#define PIO_PC28B_TCLK4 (1u << 28) /**< \brief Tc1 signal: TCLK4 */ -#define PIO_PC31B_TCLK5 (1u << 31) /**< \brief Tc1 signal: TCLK5 */ -#define PIO_PC23B_TIOA3 (1u << 23) /**< \brief Tc1 signal: TIOA3 */ -#define PIO_PC26B_TIOA4 (1u << 26) /**< \brief Tc1 signal: TIOA4 */ -#define PIO_PC29B_TIOA5 (1u << 29) /**< \brief Tc1 signal: TIOA5 */ -#define PIO_PC24B_TIOB3 (1u << 24) /**< \brief Tc1 signal: TIOB3 */ -#define PIO_PC27B_TIOB4 (1u << 27) /**< \brief Tc1 signal: TIOB4 */ -#define PIO_PC30B_TIOB5 (1u << 30) /**< \brief Tc1 signal: TIOB5 */ -/* ========== Pio definition for TC2 peripheral ========== */ -#define PIO_PC7B_TCLK6 (1u << 7) /**< \brief Tc2 signal: TCLK6 */ -#define PIO_PC10B_TCLK7 (1u << 10) /**< \brief Tc2 signal: TCLK7 */ -#define PIO_PC14B_TCLK8 (1u << 14) /**< \brief Tc2 signal: TCLK8 */ -#define PIO_PC5B_TIOA6 (1u << 5) /**< \brief Tc2 signal: TIOA6 */ -#define PIO_PC8B_TIOA7 (1u << 8) /**< \brief Tc2 signal: TIOA7 */ -#define PIO_PC11B_TIOA8 (1u << 11) /**< \brief Tc2 signal: TIOA8 */ -#define PIO_PC6B_TIOB6 (1u << 6) /**< \brief Tc2 signal: TIOB6 */ -#define PIO_PC9B_TIOB7 (1u << 9) /**< \brief Tc2 signal: TIOB7 */ -#define PIO_PC12B_TIOB8 (1u << 12) /**< \brief Tc2 signal: TIOB8 */ -/* ========== Pio definition for TC3 peripheral ========== */ -#define PIO_PE5B_TCLK10 (1u << 5) /**< \brief Tc3 signal: TCLK10 */ -#define PIO_PD24C_TCLK11 (1u << 24) /**< \brief Tc3 signal: TCLK11 */ -#define PIO_PE2B_TCLK9 (1u << 2) /**< \brief Tc3 signal: TCLK9 */ -#define PIO_PE3B_TIOA10 (1u << 3) /**< \brief Tc3 signal: TIOA10 */ -#define PIO_PD21C_TIOA11 (1u << 21) /**< \brief Tc3 signal: TIOA11 */ -#define PIO_PE0B_TIOA9 (1u << 0) /**< \brief Tc3 signal: TIOA9 */ -#define PIO_PE4B_TIOB10 (1u << 4) /**< \brief Tc3 signal: TIOB10 */ -#define PIO_PD22C_TIOB11 (1u << 22) /**< \brief Tc3 signal: TIOB11 */ -#define PIO_PE1B_TIOB9 (1u << 1) /**< \brief Tc3 signal: TIOB9 */ -/* ========== Pio definition for TWIHS0 peripheral ========== */ -#define PIO_PA4A_TWCK0 (1u << 4) /**< \brief Twihs0 signal: TWCK0 */ -#define PIO_PA3A_TWD0 (1u << 3) /**< \brief Twihs0 signal: TWD0 */ -/* ========== Pio definition for TWIHS1 peripheral ========== */ -#define PIO_PB5A_TWCK1 (1u << 5) /**< \brief Twihs1 signal: TWCK1 */ -#define PIO_PB4A_TWD1 (1u << 4) /**< \brief Twihs1 signal: TWD1 */ -/* ========== Pio definition for TWIHS2 peripheral ========== */ -#define PIO_PD28C_TWCK2 (1u << 28) /**< \brief Twihs2 signal: TWCK2 */ -#define PIO_PD27C_TWD2 (1u << 27) /**< \brief Twihs2 signal: TWD2 */ -/* ========== Pio definition for UART0 peripheral ========== */ -#define PIO_PA9A_URXD0 (1u << 9) /**< \brief Uart0 signal: URXD0 */ -#define PIO_PA10A_UTXD0 (1u << 10) /**< \brief Uart0 signal: UTXD0 */ -/* ========== Pio definition for UART1 peripheral ========== */ -#define PIO_PA5C_URXD1 (1u << 5) /**< \brief Uart1 signal: URXD1 */ -#define PIO_PA4C_UTXD1 (1u << 4) /**< \brief Uart1 signal: UTXD1 */ -#define PIO_PA6C_UTXD1 (1u << 6) /**< \brief Uart1 signal: UTXD1 */ -#define PIO_PD26D_UTXD1 (1u << 26) /**< \brief Uart1 signal: UTXD1 */ -/* ========== Pio definition for UART2 peripheral ========== */ -#define PIO_PD25C_URXD2 (1u << 25) /**< \brief Uart2 signal: URXD2 */ -#define PIO_PD26C_UTXD2 (1u << 26) /**< \brief Uart2 signal: UTXD2 */ -/* ========== Pio definition for UART3 peripheral ========== */ -#define PIO_PD28A_URXD3 (1u << 28) /**< \brief Uart3 signal: URXD3 */ -#define PIO_PD30A_UTXD3 (1u << 30) /**< \brief Uart3 signal: UTXD3 */ -#define PIO_PD31B_UTXD3 (1u << 31) /**< \brief Uart3 signal: UTXD3 */ -/* ========== Pio definition for UART4 peripheral ========== */ -#define PIO_PD18C_URXD4 (1u << 18) /**< \brief Uart4 signal: URXD4 */ -#define PIO_PD3C_UTXD4 (1u << 3) /**< \brief Uart4 signal: UTXD4 */ -#define PIO_PD19C_UTXD4 (1u << 19) /**< \brief Uart4 signal: UTXD4 */ -/* ========== Pio definition for USART0 peripheral ========== */ -#define PIO_PB2C_CTS0 (1u << 2) /**< \brief Usart0 signal: CTS0 */ -#define PIO_PD0D_DCD0 (1u << 0) /**< \brief Usart0 signal: DCD0 */ -#define PIO_PD2D_DSR0 (1u << 2) /**< \brief Usart0 signal: DSR0 */ -#define PIO_PD1D_DTR0 (1u << 1) /**< \brief Usart0 signal: DTR0 */ -#define PIO_PD3D_RI0 (1u << 3) /**< \brief Usart0 signal: RI0 */ -#define PIO_PB3C_RTS0 (1u << 3) /**< \brief Usart0 signal: RTS0 */ -#define PIO_PB0C_RXD0 (1u << 0) /**< \brief Usart0 signal: RXD0 */ -#define PIO_PB13C_SCK0 (1u << 13) /**< \brief Usart0 signal: SCK0 */ -#define PIO_PB1C_TXD0 (1u << 1) /**< \brief Usart0 signal: TXD0 */ -/* ========== Pio definition for USART1 peripheral ========== */ -#define PIO_PA25A_CTS1 (1u << 25) /**< \brief Usart1 signal: CTS1 */ -#define PIO_PA26A_DCD1 (1u << 26) /**< \brief Usart1 signal: DCD1 */ -#define PIO_PA28A_DSR1 (1u << 28) /**< \brief Usart1 signal: DSR1 */ -#define PIO_PA27A_DTR1 (1u << 27) /**< \brief Usart1 signal: DTR1 */ -#define PIO_PA3B_LONCOL1 (1u << 3) /**< \brief Usart1 signal: LONCOL1 */ -#define PIO_PA29A_RI1 (1u << 29) /**< \brief Usart1 signal: RI1 */ -#define PIO_PA24A_RTS1 (1u << 24) /**< \brief Usart1 signal: RTS1 */ -#define PIO_PA21A_RXD1 (1u << 21) /**< \brief Usart1 signal: RXD1 */ -#define PIO_PA23A_SCK1 (1u << 23) /**< \brief Usart1 signal: SCK1 */ -#define PIO_PB4D_TXD1 (1u << 4) /**< \brief Usart1 signal: TXD1 */ -/* ========== Pio definition for USART2 peripheral ========== */ -#define PIO_PD19B_CTS2 (1u << 19) /**< \brief Usart2 signal: CTS2 */ -#define PIO_PD4D_DCD2 (1u << 4) /**< \brief Usart2 signal: DCD2 */ -#define PIO_PD6D_DSR2 (1u << 6) /**< \brief Usart2 signal: DSR2 */ -#define PIO_PD5D_DTR2 (1u << 5) /**< \brief Usart2 signal: DTR2 */ -#define PIO_PD7D_RI2 (1u << 7) /**< \brief Usart2 signal: RI2 */ -#define PIO_PD18B_RTS2 (1u << 18) /**< \brief Usart2 signal: RTS2 */ -#define PIO_PD15B_RXD2 (1u << 15) /**< \brief Usart2 signal: RXD2 */ -#define PIO_PD17B_SCK2 (1u << 17) /**< \brief Usart2 signal: SCK2 */ -#define PIO_PD16B_TXD2 (1u << 16) /**< \brief Usart2 signal: TXD2 */ -/* ========== Pio indexes ========== */ -#define PIO_PA0_IDX 0 -#define PIO_PA1_IDX 1 -#define PIO_PA2_IDX 2 -#define PIO_PA3_IDX 3 -#define PIO_PA4_IDX 4 -#define PIO_PA5_IDX 5 -#define PIO_PA6_IDX 6 -#define PIO_PA7_IDX 7 -#define PIO_PA8_IDX 8 -#define PIO_PA9_IDX 9 -#define PIO_PA10_IDX 10 -#define PIO_PA11_IDX 11 -#define PIO_PA12_IDX 12 -#define PIO_PA13_IDX 13 -#define PIO_PA14_IDX 14 -#define PIO_PA15_IDX 15 -#define PIO_PA16_IDX 16 -#define PIO_PA17_IDX 17 -#define PIO_PA18_IDX 18 -#define PIO_PA19_IDX 19 -#define PIO_PA20_IDX 20 -#define PIO_PA21_IDX 21 -#define PIO_PA22_IDX 22 -#define PIO_PA23_IDX 23 -#define PIO_PA24_IDX 24 -#define PIO_PA25_IDX 25 -#define PIO_PA26_IDX 26 -#define PIO_PA27_IDX 27 -#define PIO_PA28_IDX 28 -#define PIO_PA29_IDX 29 -#define PIO_PA30_IDX 30 -#define PIO_PA31_IDX 31 -#define PIO_PB0_IDX 32 -#define PIO_PB1_IDX 33 -#define PIO_PB2_IDX 34 -#define PIO_PB3_IDX 35 -#define PIO_PB4_IDX 36 -#define PIO_PB5_IDX 37 -#define PIO_PB6_IDX 38 -#define PIO_PB7_IDX 39 -#define PIO_PB8_IDX 40 -#define PIO_PB9_IDX 41 -#define PIO_PB12_IDX 44 -#define PIO_PB13_IDX 45 -#define PIO_PC0_IDX 64 -#define PIO_PC1_IDX 65 -#define PIO_PC2_IDX 66 -#define PIO_PC3_IDX 67 -#define PIO_PC4_IDX 68 -#define PIO_PC5_IDX 69 -#define PIO_PC6_IDX 70 -#define PIO_PC7_IDX 71 -#define PIO_PC8_IDX 72 -#define PIO_PC9_IDX 73 -#define PIO_PC10_IDX 74 -#define PIO_PC11_IDX 75 -#define PIO_PC12_IDX 76 -#define PIO_PC13_IDX 77 -#define PIO_PC14_IDX 78 -#define PIO_PC15_IDX 79 -#define PIO_PC16_IDX 80 -#define PIO_PC17_IDX 81 -#define PIO_PC18_IDX 82 -#define PIO_PC19_IDX 83 -#define PIO_PC20_IDX 84 -#define PIO_PC21_IDX 85 -#define PIO_PC22_IDX 86 -#define PIO_PC23_IDX 87 -#define PIO_PC24_IDX 88 -#define PIO_PC25_IDX 89 -#define PIO_PC26_IDX 90 -#define PIO_PC27_IDX 91 -#define PIO_PC28_IDX 92 -#define PIO_PC29_IDX 93 -#define PIO_PC30_IDX 94 -#define PIO_PC31_IDX 95 -#define PIO_PD0_IDX 96 -#define PIO_PD1_IDX 97 -#define PIO_PD2_IDX 98 -#define PIO_PD3_IDX 99 -#define PIO_PD4_IDX 100 -#define PIO_PD5_IDX 101 -#define PIO_PD6_IDX 102 -#define PIO_PD7_IDX 103 -#define PIO_PD8_IDX 104 -#define PIO_PD9_IDX 105 -#define PIO_PD10_IDX 106 -#define PIO_PD11_IDX 107 -#define PIO_PD12_IDX 108 -#define PIO_PD13_IDX 109 -#define PIO_PD14_IDX 110 -#define PIO_PD15_IDX 111 -#define PIO_PD16_IDX 112 -#define PIO_PD17_IDX 113 -#define PIO_PD18_IDX 114 -#define PIO_PD19_IDX 115 -#define PIO_PD20_IDX 116 -#define PIO_PD21_IDX 117 -#define PIO_PD22_IDX 118 -#define PIO_PD23_IDX 119 -#define PIO_PD24_IDX 120 -#define PIO_PD25_IDX 121 -#define PIO_PD26_IDX 122 -#define PIO_PD27_IDX 123 -#define PIO_PD28_IDX 124 -#define PIO_PD29_IDX 125 -#define PIO_PD30_IDX 126 -#define PIO_PD31_IDX 127 -#define PIO_PE0_IDX 128 -#define PIO_PE1_IDX 129 -#define PIO_PE2_IDX 130 -#define PIO_PE3_IDX 131 -#define PIO_PE4_IDX 132 -#define PIO_PE5_IDX 133 - -#endif /* _SAMV71Q20_PIO_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/pio/pio_samv71q21.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/pio/pio_samv71q21.h deleted file mode 100644 index 7a221e63..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/pio/pio_samv71q21.h +++ /dev/null @@ -1,672 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71Q21_PIO_ -#define _SAMV71Q21_PIO_ - -#define PIO_PA0 (1u << 0) /**< \brief Pin Controlled by PA0 */ -#define PIO_PA1 (1u << 1) /**< \brief Pin Controlled by PA1 */ -#define PIO_PA2 (1u << 2) /**< \brief Pin Controlled by PA2 */ -#define PIO_PA3 (1u << 3) /**< \brief Pin Controlled by PA3 */ -#define PIO_PA4 (1u << 4) /**< \brief Pin Controlled by PA4 */ -#define PIO_PA5 (1u << 5) /**< \brief Pin Controlled by PA5 */ -#define PIO_PA6 (1u << 6) /**< \brief Pin Controlled by PA6 */ -#define PIO_PA7 (1u << 7) /**< \brief Pin Controlled by PA7 */ -#define PIO_PA8 (1u << 8) /**< \brief Pin Controlled by PA8 */ -#define PIO_PA9 (1u << 9) /**< \brief Pin Controlled by PA9 */ -#define PIO_PA10 (1u << 10) /**< \brief Pin Controlled by PA10 */ -#define PIO_PA11 (1u << 11) /**< \brief Pin Controlled by PA11 */ -#define PIO_PA12 (1u << 12) /**< \brief Pin Controlled by PA12 */ -#define PIO_PA13 (1u << 13) /**< \brief Pin Controlled by PA13 */ -#define PIO_PA14 (1u << 14) /**< \brief Pin Controlled by PA14 */ -#define PIO_PA15 (1u << 15) /**< \brief Pin Controlled by PA15 */ -#define PIO_PA16 (1u << 16) /**< \brief Pin Controlled by PA16 */ -#define PIO_PA17 (1u << 17) /**< \brief Pin Controlled by PA17 */ -#define PIO_PA18 (1u << 18) /**< \brief Pin Controlled by PA18 */ -#define PIO_PA19 (1u << 19) /**< \brief Pin Controlled by PA19 */ -#define PIO_PA20 (1u << 20) /**< \brief Pin Controlled by PA20 */ -#define PIO_PA21 (1u << 21) /**< \brief Pin Controlled by PA21 */ -#define PIO_PA22 (1u << 22) /**< \brief Pin Controlled by PA22 */ -#define PIO_PA23 (1u << 23) /**< \brief Pin Controlled by PA23 */ -#define PIO_PA24 (1u << 24) /**< \brief Pin Controlled by PA24 */ -#define PIO_PA25 (1u << 25) /**< \brief Pin Controlled by PA25 */ -#define PIO_PA26 (1u << 26) /**< \brief Pin Controlled by PA26 */ -#define PIO_PA27 (1u << 27) /**< \brief Pin Controlled by PA27 */ -#define PIO_PA28 (1u << 28) /**< \brief Pin Controlled by PA28 */ -#define PIO_PA29 (1u << 29) /**< \brief Pin Controlled by PA29 */ -#define PIO_PA30 (1u << 30) /**< \brief Pin Controlled by PA30 */ -#define PIO_PA31 (1u << 31) /**< \brief Pin Controlled by PA31 */ -#define PIO_PB0 (1u << 0) /**< \brief Pin Controlled by PB0 */ -#define PIO_PB1 (1u << 1) /**< \brief Pin Controlled by PB1 */ -#define PIO_PB2 (1u << 2) /**< \brief Pin Controlled by PB2 */ -#define PIO_PB3 (1u << 3) /**< \brief Pin Controlled by PB3 */ -#define PIO_PB4 (1u << 4) /**< \brief Pin Controlled by PB4 */ -#define PIO_PB5 (1u << 5) /**< \brief Pin Controlled by PB5 */ -#define PIO_PB6 (1u << 6) /**< \brief Pin Controlled by PB6 */ -#define PIO_PB7 (1u << 7) /**< \brief Pin Controlled by PB7 */ -#define PIO_PB8 (1u << 8) /**< \brief Pin Controlled by PB8 */ -#define PIO_PB9 (1u << 9) /**< \brief Pin Controlled by PB9 */ -#define PIO_PB12 (1u << 12) /**< \brief Pin Controlled by PB12 */ -#define PIO_PB13 (1u << 13) /**< \brief Pin Controlled by PB13 */ -#define PIO_PC0 (1u << 0) /**< \brief Pin Controlled by PC0 */ -#define PIO_PC1 (1u << 1) /**< \brief Pin Controlled by PC1 */ -#define PIO_PC2 (1u << 2) /**< \brief Pin Controlled by PC2 */ -#define PIO_PC3 (1u << 3) /**< \brief Pin Controlled by PC3 */ -#define PIO_PC4 (1u << 4) /**< \brief Pin Controlled by PC4 */ -#define PIO_PC5 (1u << 5) /**< \brief Pin Controlled by PC5 */ -#define PIO_PC6 (1u << 6) /**< \brief Pin Controlled by PC6 */ -#define PIO_PC7 (1u << 7) /**< \brief Pin Controlled by PC7 */ -#define PIO_PC8 (1u << 8) /**< \brief Pin Controlled by PC8 */ -#define PIO_PC9 (1u << 9) /**< \brief Pin Controlled by PC9 */ -#define PIO_PC10 (1u << 10) /**< \brief Pin Controlled by PC10 */ -#define PIO_PC11 (1u << 11) /**< \brief Pin Controlled by PC11 */ -#define PIO_PC12 (1u << 12) /**< \brief Pin Controlled by PC12 */ -#define PIO_PC13 (1u << 13) /**< \brief Pin Controlled by PC13 */ -#define PIO_PC14 (1u << 14) /**< \brief Pin Controlled by PC14 */ -#define PIO_PC15 (1u << 15) /**< \brief Pin Controlled by PC15 */ -#define PIO_PC16 (1u << 16) /**< \brief Pin Controlled by PC16 */ -#define PIO_PC17 (1u << 17) /**< \brief Pin Controlled by PC17 */ -#define PIO_PC18 (1u << 18) /**< \brief Pin Controlled by PC18 */ -#define PIO_PC19 (1u << 19) /**< \brief Pin Controlled by PC19 */ -#define PIO_PC20 (1u << 20) /**< \brief Pin Controlled by PC20 */ -#define PIO_PC21 (1u << 21) /**< \brief Pin Controlled by PC21 */ -#define PIO_PC22 (1u << 22) /**< \brief Pin Controlled by PC22 */ -#define PIO_PC23 (1u << 23) /**< \brief Pin Controlled by PC23 */ -#define PIO_PC24 (1u << 24) /**< \brief Pin Controlled by PC24 */ -#define PIO_PC25 (1u << 25) /**< \brief Pin Controlled by PC25 */ -#define PIO_PC26 (1u << 26) /**< \brief Pin Controlled by PC26 */ -#define PIO_PC27 (1u << 27) /**< \brief Pin Controlled by PC27 */ -#define PIO_PC28 (1u << 28) /**< \brief Pin Controlled by PC28 */ -#define PIO_PC29 (1u << 29) /**< \brief Pin Controlled by PC29 */ -#define PIO_PC30 (1u << 30) /**< \brief Pin Controlled by PC30 */ -#define PIO_PC31 (1u << 31) /**< \brief Pin Controlled by PC31 */ -#define PIO_PD0 (1u << 0) /**< \brief Pin Controlled by PD0 */ -#define PIO_PD1 (1u << 1) /**< \brief Pin Controlled by PD1 */ -#define PIO_PD2 (1u << 2) /**< \brief Pin Controlled by PD2 */ -#define PIO_PD3 (1u << 3) /**< \brief Pin Controlled by PD3 */ -#define PIO_PD4 (1u << 4) /**< \brief Pin Controlled by PD4 */ -#define PIO_PD5 (1u << 5) /**< \brief Pin Controlled by PD5 */ -#define PIO_PD6 (1u << 6) /**< \brief Pin Controlled by PD6 */ -#define PIO_PD7 (1u << 7) /**< \brief Pin Controlled by PD7 */ -#define PIO_PD8 (1u << 8) /**< \brief Pin Controlled by PD8 */ -#define PIO_PD9 (1u << 9) /**< \brief Pin Controlled by PD9 */ -#define PIO_PD10 (1u << 10) /**< \brief Pin Controlled by PD10 */ -#define PIO_PD11 (1u << 11) /**< \brief Pin Controlled by PD11 */ -#define PIO_PD12 (1u << 12) /**< \brief Pin Controlled by PD12 */ -#define PIO_PD13 (1u << 13) /**< \brief Pin Controlled by PD13 */ -#define PIO_PD14 (1u << 14) /**< \brief Pin Controlled by PD14 */ -#define PIO_PD15 (1u << 15) /**< \brief Pin Controlled by PD15 */ -#define PIO_PD16 (1u << 16) /**< \brief Pin Controlled by PD16 */ -#define PIO_PD17 (1u << 17) /**< \brief Pin Controlled by PD17 */ -#define PIO_PD18 (1u << 18) /**< \brief Pin Controlled by PD18 */ -#define PIO_PD19 (1u << 19) /**< \brief Pin Controlled by PD19 */ -#define PIO_PD20 (1u << 20) /**< \brief Pin Controlled by PD20 */ -#define PIO_PD21 (1u << 21) /**< \brief Pin Controlled by PD21 */ -#define PIO_PD22 (1u << 22) /**< \brief Pin Controlled by PD22 */ -#define PIO_PD23 (1u << 23) /**< \brief Pin Controlled by PD23 */ -#define PIO_PD24 (1u << 24) /**< \brief Pin Controlled by PD24 */ -#define PIO_PD25 (1u << 25) /**< \brief Pin Controlled by PD25 */ -#define PIO_PD26 (1u << 26) /**< \brief Pin Controlled by PD26 */ -#define PIO_PD27 (1u << 27) /**< \brief Pin Controlled by PD27 */ -#define PIO_PD28 (1u << 28) /**< \brief Pin Controlled by PD28 */ -#define PIO_PD29 (1u << 29) /**< \brief Pin Controlled by PD29 */ -#define PIO_PD30 (1u << 30) /**< \brief Pin Controlled by PD30 */ -#define PIO_PD31 (1u << 31) /**< \brief Pin Controlled by PD31 */ -#define PIO_PE0 (1u << 0) /**< \brief Pin Controlled by PE0 */ -#define PIO_PE1 (1u << 1) /**< \brief Pin Controlled by PE1 */ -#define PIO_PE2 (1u << 2) /**< \brief Pin Controlled by PE2 */ -#define PIO_PE3 (1u << 3) /**< \brief Pin Controlled by PE3 */ -#define PIO_PE4 (1u << 4) /**< \brief Pin Controlled by PE4 */ -#define PIO_PE5 (1u << 5) /**< \brief Pin Controlled by PE5 */ -/* ========== Pio definition for AFEC0 peripheral ========== */ -#define PIO_PD30X1_AFE0_AD0 (1u << 30) /**< \brief Afec0 signal: AFE0_AD0 */ -#define PIO_PA21X1_AFE0_AD1 (1u << 21) /**< \brief Afec0 signal: AFE0_AD1/PIODCEN2 */ -#define PIO_PA21X1_PIODCEN2 (1u << 21) /**< \brief Afec0 signal: AFE0_AD1/PIODCEN2 */ -#define PIO_PB0X1_AFE0_AD10 (1u << 0) /**< \brief Afec0 signal: AFE0_AD10/RTCOUT0 */ -#define PIO_PB0X1_RTCOUT0 (1u << 0) /**< \brief Afec0 signal: AFE0_AD10/RTCOUT0 */ -#define PIO_PB3X1_AFE0_AD2 (1u << 3) /**< \brief Afec0 signal: AFE0_AD2/WKUP12 */ -#define PIO_PB3X1_WKUP12 (1u << 3) /**< \brief Afec0 signal: AFE0_AD2/WKUP12 */ -#define PIO_PE5X1_AFE0_AD3 (1u << 5) /**< \brief Afec0 signal: AFE0_AD3 */ -#define PIO_PE4X1_AFE0_AD4 (1u << 4) /**< \brief Afec0 signal: AFE0_AD4 */ -#define PIO_PB2X1_AFE0_AD5 (1u << 2) /**< \brief Afec0 signal: AFE0_AD5 */ -#define PIO_PA17X1_AFE0_AD6 (1u << 17) /**< \brief Afec0 signal: AFE0_AD6 */ -#define PIO_PA18X1_AFE0_AD7 (1u << 18) /**< \brief Afec0 signal: AFE0_AD7 */ -#define PIO_PA19X1_AFE0_AD8 (1u << 19) /**< \brief Afec0 signal: AFE0_AD8/WKUP9 */ -#define PIO_PA19X1_WKUP9 (1u << 19) /**< \brief Afec0 signal: AFE0_AD8/WKUP9 */ -#define PIO_PA20X1_AFE0_AD9 (1u << 20) /**< \brief Afec0 signal: AFE0_AD9/WKUP10 */ -#define PIO_PA20X1_WKUP10 (1u << 20) /**< \brief Afec0 signal: AFE0_AD9/WKUP10 */ -#define PIO_PA8B_AFE0_ADTRG (1u << 8) /**< \brief Afec0 signal: AFE0_ADTRG */ -/* ========== Pio definition for AFEC1 peripheral ========== */ -#define PIO_PB1X1_AFE1_AD0 (1u << 1) /**< \brief Afec1 signal: AFE1_AD0/RTCOUT1 */ -#define PIO_PB1X1_RTCOUT1 (1u << 1) /**< \brief Afec1 signal: AFE1_AD0/RTCOUT1 */ -#define PIO_PC13X1_AFE1_AD1 (1u << 13) /**< \brief Afec1 signal: AFE1_AD1 */ -#define PIO_PE3X1_AFE1_AD10 (1u << 3) /**< \brief Afec1 signal: AFE1_AD10 */ -#define PIO_PE0X1_AFE1_AD11 (1u << 0) /**< \brief Afec1 signal: AFE1_AD11 */ -#define PIO_PC15X1_AFE1_AD2 (1u << 15) /**< \brief Afec1 signal: AFE1_AD2 */ -#define PIO_PC12X1_AFE1_AD3 (1u << 12) /**< \brief Afec1 signal: AFE1_AD3 */ -#define PIO_PC29X1_AFE1_AD4 (1u << 29) /**< \brief Afec1 signal: AFE1_AD4 */ -#define PIO_PC30X1_AFE1_AD5 (1u << 30) /**< \brief Afec1 signal: AFE1_AD5 */ -#define PIO_PC31X1_AFE1_AD6 (1u << 31) /**< \brief Afec1 signal: AFE1_AD6 */ -#define PIO_PC26X1_AFE1_AD7 (1u << 26) /**< \brief Afec1 signal: AFE1_AD7 */ -#define PIO_PC27X1_AFE1_AD8 (1u << 27) /**< \brief Afec1 signal: AFE1_AD8 */ -#define PIO_PC0X1_AFE1_AD9 (1u << 0) /**< \brief Afec1 signal: AFE1_AD9 */ -#define PIO_PD9C_AFE1_ADTRG (1u << 9) /**< \brief Afec1 signal: AFE1_ADTRG */ -/* ========== Pio definition for ARM peripheral ========== */ -#define PIO_PB7X1_SWCLK (1u << 7) /**< \brief Arm signal: SWCLK/TCK */ -#define PIO_PB7X1_TCK (1u << 7) /**< \brief Arm signal: SWCLK/TCK */ -#define PIO_PB6X1_SWDIO (1u << 6) /**< \brief Arm signal: SWDIO/TMS */ -#define PIO_PB6X1_TMS (1u << 6) /**< \brief Arm signal: SWDIO/TMS */ -#define PIO_PB4X1_TDI (1u << 4) /**< \brief Arm signal: TDI */ -#define PIO_PB5X1_TDO (1u << 5) /**< \brief Arm signal: TDO/TRACESWO/WKUP13 */ -#define PIO_PB5X1_TRACESWO (1u << 5) /**< \brief Arm signal: TDO/TRACESWO/WKUP13 */ -#define PIO_PB5X1_WKUP13 (1u << 5) /**< \brief Arm signal: TDO/TRACESWO/WKUP13 */ -/* ========== Pio definition for DACC peripheral ========== */ -#define PIO_PB13X1_DAC0 (1u << 13) /**< \brief Dacc signal: DAC0 */ -#define PIO_PD0X1_DAC1 (1u << 0) /**< \brief Dacc signal: DAC1 */ -#define PIO_PA2C_DATRG (1u << 2) /**< \brief Dacc signal: DATRG */ -/* ========== Pio definition for EBI peripheral ========== */ -#define PIO_PC18A_A0 (1u << 18) /**< \brief Ebi signal: A0/NBS0 */ -#define PIO_PC18A_NBS0 (1u << 18) /**< \brief Ebi signal: A0/NBS0 */ -#define PIO_PC19A_A1 (1u << 19) /**< \brief Ebi signal: A1 */ -#define PIO_PC28A_A10 (1u << 28) /**< \brief Ebi signal: A10 */ -#define PIO_PC29A_A11 (1u << 29) /**< \brief Ebi signal: A11 */ -#define PIO_PC30A_A12 (1u << 30) /**< \brief Ebi signal: A12 */ -#define PIO_PC31A_A13 (1u << 31) /**< \brief Ebi signal: A13 */ -#define PIO_PA18C_A14 (1u << 18) /**< \brief Ebi signal: A14 */ -#define PIO_PA19C_A15 (1u << 19) /**< \brief Ebi signal: A15 */ -#define PIO_PA20C_A16 (1u << 20) /**< \brief Ebi signal: A16/BA0 */ -#define PIO_PA20C_BA0 (1u << 20) /**< \brief Ebi signal: A16/BA0 */ -#define PIO_PA0C_A17 (1u << 0) /**< \brief Ebi signal: A17/BA1 */ -#define PIO_PA0C_BA1 (1u << 0) /**< \brief Ebi signal: A17/BA1 */ -#define PIO_PA1C_A18 (1u << 1) /**< \brief Ebi signal: A18 */ -#define PIO_PA23C_A19 (1u << 23) /**< \brief Ebi signal: A19 */ -#define PIO_PC20A_A2 (1u << 20) /**< \brief Ebi signal: A2 */ -#define PIO_PA24C_A20 (1u << 24) /**< \brief Ebi signal: A20 */ -#define PIO_PC16A_A21 (1u << 16) /**< \brief Ebi signal: A21/NANDALE */ -#define PIO_PC16A_NANDALE (1u << 16) /**< \brief Ebi signal: A21/NANDALE */ -#define PIO_PC17A_A22 (1u << 17) /**< \brief Ebi signal: A22/NANDCLE */ -#define PIO_PC17A_NANDCLE (1u << 17) /**< \brief Ebi signal: A22/NANDCLE */ -#define PIO_PA25C_A23 (1u << 25) /**< \brief Ebi signal: A23 */ -#define PIO_PC21A_A3 (1u << 21) /**< \brief Ebi signal: A3 */ -#define PIO_PC22A_A4 (1u << 22) /**< \brief Ebi signal: A4 */ -#define PIO_PC23A_A5 (1u << 23) /**< \brief Ebi signal: A5 */ -#define PIO_PC24A_A6 (1u << 24) /**< \brief Ebi signal: A6 */ -#define PIO_PC25A_A7 (1u << 25) /**< \brief Ebi signal: A7 */ -#define PIO_PC26A_A8 (1u << 26) /**< \brief Ebi signal: A8 */ -#define PIO_PC27A_A9 (1u << 27) /**< \brief Ebi signal: A9 */ -#define PIO_PD17C_CAS (1u << 17) /**< \brief Ebi signal: CAS */ -#define PIO_PC0A_D0 (1u << 0) /**< \brief Ebi signal: D0 */ -#define PIO_PC1A_D1 (1u << 1) /**< \brief Ebi signal: D1 */ -#define PIO_PE2A_D10 (1u << 2) /**< \brief Ebi signal: D10 */ -#define PIO_PE3A_D11 (1u << 3) /**< \brief Ebi signal: D11 */ -#define PIO_PE4A_D12 (1u << 4) /**< \brief Ebi signal: D12 */ -#define PIO_PE5A_D13 (1u << 5) /**< \brief Ebi signal: D13 */ -#define PIO_PA15A_D14 (1u << 15) /**< \brief Ebi signal: D14 */ -#define PIO_PA16A_D15 (1u << 16) /**< \brief Ebi signal: D15 */ -#define PIO_PC2A_D2 (1u << 2) /**< \brief Ebi signal: D2 */ -#define PIO_PC3A_D3 (1u << 3) /**< \brief Ebi signal: D3 */ -#define PIO_PC4A_D4 (1u << 4) /**< \brief Ebi signal: D4 */ -#define PIO_PC5A_D5 (1u << 5) /**< \brief Ebi signal: D5 */ -#define PIO_PC6A_D6 (1u << 6) /**< \brief Ebi signal: D6 */ -#define PIO_PC7A_D7 (1u << 7) /**< \brief Ebi signal: D7 */ -#define PIO_PE0A_D8 (1u << 0) /**< \brief Ebi signal: D8 */ -#define PIO_PE1A_D9 (1u << 1) /**< \brief Ebi signal: D9 */ -#define PIO_PC9A_NANDOE (1u << 9) /**< \brief Ebi signal: NANDOE */ -#define PIO_PC10A_NANDWE (1u << 10) /**< \brief Ebi signal: NANDWE */ -#define PIO_PC14A_NCS0 (1u << 14) /**< \brief Ebi signal: NCS0 */ -#define PIO_PC15A_NCS1 (1u << 15) /**< \brief Ebi signal: NCS1/SDCS */ -#define PIO_PC15A_SDCS (1u << 15) /**< \brief Ebi signal: NCS1/SDCS */ -#define PIO_PD18A_NCS1 (1u << 18) /**< \brief Ebi signal: NCS1/SDCS */ -#define PIO_PD18A_SDCS (1u << 18) /**< \brief Ebi signal: NCS1/SDCS */ -#define PIO_PA22C_NCS2 (1u << 22) /**< \brief Ebi signal: NCS2 */ -#define PIO_PC12A_NCS3 (1u << 12) /**< \brief Ebi signal: NCS3 */ -#define PIO_PD19A_NCS3 (1u << 19) /**< \brief Ebi signal: NCS3 */ -#define PIO_PC11A_NRD (1u << 11) /**< \brief Ebi signal: NRD */ -#define PIO_PC13A_NWAIT (1u << 13) /**< \brief Ebi signal: NWAIT */ -#define PIO_PC8A_NWR0 (1u << 8) /**< \brief Ebi signal: NWR0/NWE */ -#define PIO_PC8A_NWE (1u << 8) /**< \brief Ebi signal: NWR0/NWE */ -#define PIO_PD15C_NWR1 (1u << 15) /**< \brief Ebi signal: NWR1/NBS1 */ -#define PIO_PD15C_NBS1 (1u << 15) /**< \brief Ebi signal: NWR1/NBS1 */ -#define PIO_PD16C_RAS (1u << 16) /**< \brief Ebi signal: RAS */ -#define PIO_PC13C_SDA10 (1u << 13) /**< \brief Ebi signal: SDA10 */ -#define PIO_PD13C_SDA10 (1u << 13) /**< \brief Ebi signal: SDA10 */ -#define PIO_PD23C_SDCK (1u << 23) /**< \brief Ebi signal: SDCK */ -#define PIO_PD14C_SDCKE (1u << 14) /**< \brief Ebi signal: SDCKE */ -#define PIO_PD29C_SDWE (1u << 29) /**< \brief Ebi signal: SDWE */ -/* ========== Pio definition for GMAC peripheral ========== */ -#define PIO_PD13A_GCOL (1u << 13) /**< \brief Gmac signal: GCOL */ -#define PIO_PD10A_GCRS (1u << 10) /**< \brief Gmac signal: GCRS */ -#define PIO_PD8A_GMDC (1u << 8) /**< \brief Gmac signal: GMDC */ -#define PIO_PD9A_GMDIO (1u << 9) /**< \brief Gmac signal: GMDIO */ -#define PIO_PD5A_GRX0 (1u << 5) /**< \brief Gmac signal: GRX0 */ -#define PIO_PD6A_GRX1 (1u << 6) /**< \brief Gmac signal: GRX1 */ -#define PIO_PD11A_GRX2 (1u << 11) /**< \brief Gmac signal: GRX2 */ -#define PIO_PD12A_GRX3 (1u << 12) /**< \brief Gmac signal: GRX3 */ -#define PIO_PD14A_GRXCK (1u << 14) /**< \brief Gmac signal: GRXCK */ -#define PIO_PD4A_GRXDV (1u << 4) /**< \brief Gmac signal: GRXDV */ -#define PIO_PD7A_GRXER (1u << 7) /**< \brief Gmac signal: GRXER */ -#define PIO_PB1B_GTSUCOMP (1u << 1) /**< \brief Gmac signal: GTSUCOMP */ -#define PIO_PB12B_GTSUCOMP (1u << 12) /**< \brief Gmac signal: GTSUCOMP */ -#define PIO_PD11C_GTSUCOMP (1u << 11) /**< \brief Gmac signal: GTSUCOMP */ -#define PIO_PD20C_GTSUCOMP (1u << 20) /**< \brief Gmac signal: GTSUCOMP */ -#define PIO_PD2A_GTX0 (1u << 2) /**< \brief Gmac signal: GTX0 */ -#define PIO_PD3A_GTX1 (1u << 3) /**< \brief Gmac signal: GTX1 */ -#define PIO_PD15A_GTX2 (1u << 15) /**< \brief Gmac signal: GTX2 */ -#define PIO_PD16A_GTX3 (1u << 16) /**< \brief Gmac signal: GTX3 */ -#define PIO_PD0A_GTXCK (1u << 0) /**< \brief Gmac signal: GTXCK */ -#define PIO_PD1A_GTXEN (1u << 1) /**< \brief Gmac signal: GTXEN */ -#define PIO_PD17A_GTXER (1u << 17) /**< \brief Gmac signal: GTXER */ -/* ========== Pio definition for HSMCI peripheral ========== */ -#define PIO_PA28C_MCCDA (1u << 28) /**< \brief Hsmci signal: MCCDA */ -#define PIO_PA25D_MCCK (1u << 25) /**< \brief Hsmci signal: MCCK */ -#define PIO_PA30C_MCDA0 (1u << 30) /**< \brief Hsmci signal: MCDA0 */ -#define PIO_PA31C_MCDA1 (1u << 31) /**< \brief Hsmci signal: MCDA1 */ -#define PIO_PA26C_MCDA2 (1u << 26) /**< \brief Hsmci signal: MCDA2 */ -#define PIO_PA27C_MCDA3 (1u << 27) /**< \brief Hsmci signal: MCDA3 */ -/* ========== Pio definition for ISI peripheral ========== */ -#define PIO_PD22D_ISI_D0 (1u << 22) /**< \brief Isi signal: ISI_D0 */ -#define PIO_PD21D_ISI_D1 (1u << 21) /**< \brief Isi signal: ISI_D1 */ -#define PIO_PD30D_ISI_D10 (1u << 30) /**< \brief Isi signal: ISI_D10 */ -#define PIO_PD31D_ISI_D11 (1u << 31) /**< \brief Isi signal: ISI_D11 */ -#define PIO_PB3D_ISI_D2 (1u << 3) /**< \brief Isi signal: ISI_D2 */ -#define PIO_PA9B_ISI_D3 (1u << 9) /**< \brief Isi signal: ISI_D3 */ -#define PIO_PA5B_ISI_D4 (1u << 5) /**< \brief Isi signal: ISI_D4 */ -#define PIO_PD11D_ISI_D5 (1u << 11) /**< \brief Isi signal: ISI_D5 */ -#define PIO_PD12D_ISI_D6 (1u << 12) /**< \brief Isi signal: ISI_D6 */ -#define PIO_PA27D_ISI_D7 (1u << 27) /**< \brief Isi signal: ISI_D7 */ -#define PIO_PD27D_ISI_D8 (1u << 27) /**< \brief Isi signal: ISI_D8 */ -#define PIO_PD28D_ISI_D9 (1u << 28) /**< \brief Isi signal: ISI_D9 */ -#define PIO_PD24D_ISI_HSYNC (1u << 24) /**< \brief Isi signal: ISI_HSYNC */ -#define PIO_PA24D_ISI_PCK (1u << 24) /**< \brief Isi signal: ISI_PCK */ -#define PIO_PD25D_ISI_VSYNC (1u << 25) /**< \brief Isi signal: ISI_VSYNC */ -/* ========== Pio definition for MCAN0 peripheral ========== */ -#define PIO_PB3A_CANRX0 (1u << 3) /**< \brief Mcan0 signal: CANRX0 */ -#define PIO_PB2A_CANTX0 (1u << 2) /**< \brief Mcan0 signal: CANTX0 */ -/* ========== Pio definition for MCAN1 peripheral ========== */ -#define PIO_PC12C_CANRX1 (1u << 12) /**< \brief Mcan1 signal: CANRX1 */ -#define PIO_PD28B_CANRX1 (1u << 28) /**< \brief Mcan1 signal: CANRX1 */ -#define PIO_PC14C_CANTX1 (1u << 14) /**< \brief Mcan1 signal: CANTX1 */ -#define PIO_PD12B_CANTX1 (1u << 12) /**< \brief Mcan1 signal: CANTX1 */ -/* ========== Pio definition for MLB peripheral ========== */ -#define PIO_PB4C_MLBCLK (1u << 4) /**< \brief Mlb signal: MLBCLK */ -#define PIO_PB5C_MLBDAT (1u << 5) /**< \brief Mlb signal: MLBDAT */ -#define PIO_PD10D_MLBSIG (1u << 10) /**< \brief Mlb signal: MLBSIG */ -/* ========== Pio definition for PIOA peripheral ========== */ -#define PIO_PA21X1_AFE0_AD1 (1u << 21) /**< \brief Pioa signal: AFE0_AD1/PIODCEN2 */ -#define PIO_PA21X1_PIODCEN2 (1u << 21) /**< \brief Pioa signal: AFE0_AD1/PIODCEN2 */ -#define PIO_PA3X1_PIODC0 (1u << 3) /**< \brief Pioa signal: PIODC0 */ -#define PIO_PA10X1_PIODC4 (1u << 10) /**< \brief Pioa signal: PIODC4 */ -#define PIO_PA12X1_PIODC6 (1u << 12) /**< \brief Pioa signal: PIODC6 */ -#define PIO_PA13X1_PIODC7 (1u << 13) /**< \brief Pioa signal: PIODC7 */ -#define PIO_PA22X1_PIODCCLK (1u << 22) /**< \brief Pioa signal: PIODCCLK */ -#define PIO_PA4X1_WKUP3 (1u << 4) /**< \brief Pioa signal: WKUP3/PIODC1 */ -#define PIO_PA4X1_PIODC1 (1u << 4) /**< \brief Pioa signal: WKUP3/PIODC1 */ -#define PIO_PA5X1_WKUP4 (1u << 5) /**< \brief Pioa signal: WKUP4/PIODC2 */ -#define PIO_PA5X1_PIODC2 (1u << 5) /**< \brief Pioa signal: WKUP4/PIODC2 */ -#define PIO_PA9X1_WKUP6 (1u << 9) /**< \brief Pioa signal: WKUP6/PIODC3 */ -#define PIO_PA9X1_PIODC3 (1u << 9) /**< \brief Pioa signal: WKUP6/PIODC3 */ -#define PIO_PA11X1_WKUP7 (1u << 11) /**< \brief Pioa signal: WKUP7/PIODC5 */ -#define PIO_PA11X1_PIODC5 (1u << 11) /**< \brief Pioa signal: WKUP7/PIODC5 */ -#define PIO_PA14X1_WKUP8 (1u << 14) /**< \brief Pioa signal: WKUP8/PIODCEN1 */ -#define PIO_PA14X1_PIODCEN1 (1u << 14) /**< \brief Pioa signal: WKUP8/PIODCEN1 */ -/* ========== Pio definition for PMC peripheral ========== */ -#define PIO_PA6B_PCK0 (1u << 6) /**< \brief Pmc signal: PCK0 */ -#define PIO_PB12D_PCK0 (1u << 12) /**< \brief Pmc signal: PCK0 */ -#define PIO_PB13B_PCK0 (1u << 13) /**< \brief Pmc signal: PCK0 */ -#define PIO_PA17B_PCK1 (1u << 17) /**< \brief Pmc signal: PCK1 */ -#define PIO_PA21B_PCK1 (1u << 21) /**< \brief Pmc signal: PCK1 */ -#define PIO_PA3C_PCK2 (1u << 3) /**< \brief Pmc signal: PCK2 */ -#define PIO_PA18B_PCK2 (1u << 18) /**< \brief Pmc signal: PCK2 */ -#define PIO_PA31B_PCK2 (1u << 31) /**< \brief Pmc signal: PCK2 */ -#define PIO_PB3B_PCK2 (1u << 3) /**< \brief Pmc signal: PCK2 */ -#define PIO_PD31C_PCK2 (1u << 31) /**< \brief Pmc signal: PCK2 */ -/* ========== Pio definition for PWM0 peripheral ========== */ -#define PIO_PA10B_PWMC0_PWMEXTRG0 (1u << 10) /**< \brief Pwm0 signal: PWMC0_PWMEXTRG0 */ -#define PIO_PA22B_PWMC0_PWMEXTRG1 (1u << 22) /**< \brief Pwm0 signal: PWMC0_PWMEXTRG1 */ -#define PIO_PA9C_PWMC0_PWMFI0 (1u << 9) /**< \brief Pwm0 signal: PWMC0_PWMFI0 */ -#define PIO_PD8B_PWMC0_PWMFI1 (1u << 8) /**< \brief Pwm0 signal: PWMC0_PWMFI1 */ -#define PIO_PD9B_PWMC0_PWMFI2 (1u << 9) /**< \brief Pwm0 signal: PWMC0_PWMFI2 */ -#define PIO_PA0A_PWMC0_PWMH0 (1u << 0) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PA11B_PWMC0_PWMH0 (1u << 11) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PA23B_PWMC0_PWMH0 (1u << 23) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PB0A_PWMC0_PWMH0 (1u << 0) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PD11B_PWMC0_PWMH0 (1u << 11) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PD20A_PWMC0_PWMH0 (1u << 20) /**< \brief Pwm0 signal: PWMC0_PWMH0 */ -#define PIO_PA2A_PWMC0_PWMH1 (1u << 2) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PA12B_PWMC0_PWMH1 (1u << 12) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PA24B_PWMC0_PWMH1 (1u << 24) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PB1A_PWMC0_PWMH1 (1u << 1) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PD21A_PWMC0_PWMH1 (1u << 21) /**< \brief Pwm0 signal: PWMC0_PWMH1 */ -#define PIO_PA13B_PWMC0_PWMH2 (1u << 13) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PA25B_PWMC0_PWMH2 (1u << 25) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PB4B_PWMC0_PWMH2 (1u << 4) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PC19B_PWMC0_PWMH2 (1u << 19) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PD22A_PWMC0_PWMH2 (1u << 22) /**< \brief Pwm0 signal: PWMC0_PWMH2 */ -#define PIO_PA7B_PWMC0_PWMH3 (1u << 7) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PA14B_PWMC0_PWMH3 (1u << 14) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PA17C_PWMC0_PWMH3 (1u << 17) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PC13B_PWMC0_PWMH3 (1u << 13) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PC21B_PWMC0_PWMH3 (1u << 21) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PD23A_PWMC0_PWMH3 (1u << 23) /**< \brief Pwm0 signal: PWMC0_PWMH3 */ -#define PIO_PA1A_PWMC0_PWML0 (1u << 1) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PA19B_PWMC0_PWML0 (1u << 19) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PB5B_PWMC0_PWML0 (1u << 5) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PC0B_PWMC0_PWML0 (1u << 0) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PD10B_PWMC0_PWML0 (1u << 10) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PD24A_PWMC0_PWML0 (1u << 24) /**< \brief Pwm0 signal: PWMC0_PWML0 */ -#define PIO_PA20B_PWMC0_PWML1 (1u << 20) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PB12A_PWMC0_PWML1 (1u << 12) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PC1B_PWMC0_PWML1 (1u << 1) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PC18B_PWMC0_PWML1 (1u << 18) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PD25A_PWMC0_PWML1 (1u << 25) /**< \brief Pwm0 signal: PWMC0_PWML1 */ -#define PIO_PA16C_PWMC0_PWML2 (1u << 16) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PA30A_PWMC0_PWML2 (1u << 30) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PB13A_PWMC0_PWML2 (1u << 13) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PC2B_PWMC0_PWML2 (1u << 2) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PC20B_PWMC0_PWML2 (1u << 20) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PD26A_PWMC0_PWML2 (1u << 26) /**< \brief Pwm0 signal: PWMC0_PWML2 */ -#define PIO_PA15C_PWMC0_PWML3 (1u << 15) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -#define PIO_PC3B_PWMC0_PWML3 (1u << 3) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -#define PIO_PC15B_PWMC0_PWML3 (1u << 15) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -#define PIO_PC22B_PWMC0_PWML3 (1u << 22) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -#define PIO_PD27A_PWMC0_PWML3 (1u << 27) /**< \brief Pwm0 signal: PWMC0_PWML3 */ -/* ========== Pio definition for PWM1 peripheral ========== */ -#define PIO_PA30B_PWMC1_PWMEXTRG0 (1u << 30) /**< \brief Pwm1 signal: PWMC1_PWMEXTRG0 */ -#define PIO_PA18A_PWMC1_PWMEXTRG1 (1u << 18) /**< \brief Pwm1 signal: PWMC1_PWMEXTRG1 */ -#define PIO_PA21C_PWMC1_PWMFI0 (1u << 21) /**< \brief Pwm1 signal: PWMC1_PWMFI0 */ -#define PIO_PA26D_PWMC1_PWMFI1 (1u << 26) /**< \brief Pwm1 signal: PWMC1_PWMFI1 */ -#define PIO_PA28D_PWMC1_PWMFI2 (1u << 28) /**< \brief Pwm1 signal: PWMC1_PWMFI2 */ -#define PIO_PA12C_PWMC1_PWMH0 (1u << 12) /**< \brief Pwm1 signal: PWMC1_PWMH0 */ -#define PIO_PD1B_PWMC1_PWMH0 (1u << 1) /**< \brief Pwm1 signal: PWMC1_PWMH0 */ -#define PIO_PA14C_PWMC1_PWMH1 (1u << 14) /**< \brief Pwm1 signal: PWMC1_PWMH1 */ -#define PIO_PD3B_PWMC1_PWMH1 (1u << 3) /**< \brief Pwm1 signal: PWMC1_PWMH1 */ -#define PIO_PA31D_PWMC1_PWMH2 (1u << 31) /**< \brief Pwm1 signal: PWMC1_PWMH2 */ -#define PIO_PD5B_PWMC1_PWMH2 (1u << 5) /**< \brief Pwm1 signal: PWMC1_PWMH2 */ -#define PIO_PA8A_PWMC1_PWMH3 (1u << 8) /**< \brief Pwm1 signal: PWMC1_PWMH3 */ -#define PIO_PD7B_PWMC1_PWMH3 (1u << 7) /**< \brief Pwm1 signal: PWMC1_PWMH3 */ -#define PIO_PA11C_PWMC1_PWML0 (1u << 11) /**< \brief Pwm1 signal: PWMC1_PWML0 */ -#define PIO_PD0B_PWMC1_PWML0 (1u << 0) /**< \brief Pwm1 signal: PWMC1_PWML0 */ -#define PIO_PA13C_PWMC1_PWML1 (1u << 13) /**< \brief Pwm1 signal: PWMC1_PWML1 */ -#define PIO_PD2B_PWMC1_PWML1 (1u << 2) /**< \brief Pwm1 signal: PWMC1_PWML1 */ -#define PIO_PA23D_PWMC1_PWML2 (1u << 23) /**< \brief Pwm1 signal: PWMC1_PWML2 */ -#define PIO_PD4B_PWMC1_PWML2 (1u << 4) /**< \brief Pwm1 signal: PWMC1_PWML2 */ -#define PIO_PA5A_PWMC1_PWML3 (1u << 5) /**< \brief Pwm1 signal: PWMC1_PWML3 */ -#define PIO_PD6B_PWMC1_PWML3 (1u << 6) /**< \brief Pwm1 signal: PWMC1_PWML3 */ -/* ========== Pio definition for QSPI peripheral ========== */ -#define PIO_PA11A_QCS (1u << 11) /**< \brief Qspi signal: QCS */ -#define PIO_PA13A_QIO0 (1u << 13) /**< \brief Qspi signal: QIO0 */ -#define PIO_PA12A_QIO1 (1u << 12) /**< \brief Qspi signal: QIO1 */ -#define PIO_PA17A_QIO2 (1u << 17) /**< \brief Qspi signal: QIO2 */ -#define PIO_PD31A_QIO3 (1u << 31) /**< \brief Qspi signal: QIO3 */ -#define PIO_PA14A_QSCK (1u << 14) /**< \brief Qspi signal: QSCK */ -/* ========== Pio definition for SPI0 peripheral ========== */ -#define PIO_PD20B_SPI0_MISO (1u << 20) /**< \brief Spi0 signal: SPI0_MISO */ -#define PIO_PD21B_SPI0_MOSI (1u << 21) /**< \brief Spi0 signal: SPI0_MOSI */ -#define PIO_PB2D_SPI0_NPCS0 (1u << 2) /**< \brief Spi0 signal: SPI0_NPCS0 */ -#define PIO_PA31A_SPI0_NPCS1 (1u << 31) /**< \brief Spi0 signal: SPI0_NPCS1 */ -#define PIO_PD25B_SPI0_NPCS1 (1u << 25) /**< \brief Spi0 signal: SPI0_NPCS1 */ -#define PIO_PD12C_SPI0_NPCS2 (1u << 12) /**< \brief Spi0 signal: SPI0_NPCS2 */ -#define PIO_PD27B_SPI0_NPCS3 (1u << 27) /**< \brief Spi0 signal: SPI0_NPCS3 */ -#define PIO_PD22B_SPI0_SPCK (1u << 22) /**< \brief Spi0 signal: SPI0_SPCK */ -/* ========== Pio definition for SPI1 peripheral ========== */ -#define PIO_PC26C_SPI1_MISO (1u << 26) /**< \brief Spi1 signal: SPI1_MISO */ -#define PIO_PC27C_SPI1_MOSI (1u << 27) /**< \brief Spi1 signal: SPI1_MOSI */ -#define PIO_PC25C_SPI1_NPCS0 (1u << 25) /**< \brief Spi1 signal: SPI1_NPCS0 */ -#define PIO_PC28C_SPI1_NPCS1 (1u << 28) /**< \brief Spi1 signal: SPI1_NPCS1 */ -#define PIO_PD0C_SPI1_NPCS1 (1u << 0) /**< \brief Spi1 signal: SPI1_NPCS1 */ -#define PIO_PC29C_SPI1_NPCS2 (1u << 29) /**< \brief Spi1 signal: SPI1_NPCS2 */ -#define PIO_PD1C_SPI1_NPCS2 (1u << 1) /**< \brief Spi1 signal: SPI1_NPCS2 */ -#define PIO_PC30C_SPI1_NPCS3 (1u << 30) /**< \brief Spi1 signal: SPI1_NPCS3 */ -#define PIO_PD2C_SPI1_NPCS3 (1u << 2) /**< \brief Spi1 signal: SPI1_NPCS3 */ -#define PIO_PC24C_SPI1_SPCK (1u << 24) /**< \brief Spi1 signal: SPI1_SPCK */ -/* ========== Pio definition for SSC peripheral ========== */ -#define PIO_PA10C_RD (1u << 10) /**< \brief Ssc signal: RD */ -#define PIO_PD24B_RF (1u << 24) /**< \brief Ssc signal: RF */ -#define PIO_PA22A_RK (1u << 22) /**< \brief Ssc signal: RK */ -#define PIO_PB5D_TD (1u << 5) /**< \brief Ssc signal: TD */ -#define PIO_PD10C_TD (1u << 10) /**< \brief Ssc signal: TD */ -#define PIO_PD26B_TD (1u << 26) /**< \brief Ssc signal: TD */ -#define PIO_PB0D_TF (1u << 0) /**< \brief Ssc signal: TF */ -#define PIO_PB1D_TK (1u << 1) /**< \brief Ssc signal: TK */ -/* ========== Pio definition for TC0 peripheral ========== */ -#define PIO_PA4B_TCLK0 (1u << 4) /**< \brief Tc0 signal: TCLK0 */ -#define PIO_PA28B_TCLK1 (1u << 28) /**< \brief Tc0 signal: TCLK1 */ -#define PIO_PA29B_TCLK2 (1u << 29) /**< \brief Tc0 signal: TCLK2 */ -#define PIO_PA0B_TIOA0 (1u << 0) /**< \brief Tc0 signal: TIOA0 */ -#define PIO_PA15B_TIOA1 (1u << 15) /**< \brief Tc0 signal: TIOA1 */ -#define PIO_PA26B_TIOA2 (1u << 26) /**< \brief Tc0 signal: TIOA2 */ -#define PIO_PA1B_TIOB0 (1u << 1) /**< \brief Tc0 signal: TIOB0 */ -#define PIO_PA16B_TIOB1 (1u << 16) /**< \brief Tc0 signal: TIOB1 */ -#define PIO_PA27B_TIOB2 (1u << 27) /**< \brief Tc0 signal: TIOB2 */ -/* ========== Pio definition for TC1 peripheral ========== */ -#define PIO_PC25B_TCLK3 (1u << 25) /**< \brief Tc1 signal: TCLK3 */ -#define PIO_PC28B_TCLK4 (1u << 28) /**< \brief Tc1 signal: TCLK4 */ -#define PIO_PC31B_TCLK5 (1u << 31) /**< \brief Tc1 signal: TCLK5 */ -#define PIO_PC23B_TIOA3 (1u << 23) /**< \brief Tc1 signal: TIOA3 */ -#define PIO_PC26B_TIOA4 (1u << 26) /**< \brief Tc1 signal: TIOA4 */ -#define PIO_PC29B_TIOA5 (1u << 29) /**< \brief Tc1 signal: TIOA5 */ -#define PIO_PC24B_TIOB3 (1u << 24) /**< \brief Tc1 signal: TIOB3 */ -#define PIO_PC27B_TIOB4 (1u << 27) /**< \brief Tc1 signal: TIOB4 */ -#define PIO_PC30B_TIOB5 (1u << 30) /**< \brief Tc1 signal: TIOB5 */ -/* ========== Pio definition for TC2 peripheral ========== */ -#define PIO_PC7B_TCLK6 (1u << 7) /**< \brief Tc2 signal: TCLK6 */ -#define PIO_PC10B_TCLK7 (1u << 10) /**< \brief Tc2 signal: TCLK7 */ -#define PIO_PC14B_TCLK8 (1u << 14) /**< \brief Tc2 signal: TCLK8 */ -#define PIO_PC5B_TIOA6 (1u << 5) /**< \brief Tc2 signal: TIOA6 */ -#define PIO_PC8B_TIOA7 (1u << 8) /**< \brief Tc2 signal: TIOA7 */ -#define PIO_PC11B_TIOA8 (1u << 11) /**< \brief Tc2 signal: TIOA8 */ -#define PIO_PC6B_TIOB6 (1u << 6) /**< \brief Tc2 signal: TIOB6 */ -#define PIO_PC9B_TIOB7 (1u << 9) /**< \brief Tc2 signal: TIOB7 */ -#define PIO_PC12B_TIOB8 (1u << 12) /**< \brief Tc2 signal: TIOB8 */ -/* ========== Pio definition for TC3 peripheral ========== */ -#define PIO_PE5B_TCLK10 (1u << 5) /**< \brief Tc3 signal: TCLK10 */ -#define PIO_PD24C_TCLK11 (1u << 24) /**< \brief Tc3 signal: TCLK11 */ -#define PIO_PE2B_TCLK9 (1u << 2) /**< \brief Tc3 signal: TCLK9 */ -#define PIO_PE3B_TIOA10 (1u << 3) /**< \brief Tc3 signal: TIOA10 */ -#define PIO_PD21C_TIOA11 (1u << 21) /**< \brief Tc3 signal: TIOA11 */ -#define PIO_PE0B_TIOA9 (1u << 0) /**< \brief Tc3 signal: TIOA9 */ -#define PIO_PE4B_TIOB10 (1u << 4) /**< \brief Tc3 signal: TIOB10 */ -#define PIO_PD22C_TIOB11 (1u << 22) /**< \brief Tc3 signal: TIOB11 */ -#define PIO_PE1B_TIOB9 (1u << 1) /**< \brief Tc3 signal: TIOB9 */ -/* ========== Pio definition for TWIHS0 peripheral ========== */ -#define PIO_PA4A_TWCK0 (1u << 4) /**< \brief Twihs0 signal: TWCK0 */ -#define PIO_PA3A_TWD0 (1u << 3) /**< \brief Twihs0 signal: TWD0 */ -/* ========== Pio definition for TWIHS1 peripheral ========== */ -#define PIO_PB5A_TWCK1 (1u << 5) /**< \brief Twihs1 signal: TWCK1 */ -#define PIO_PB4A_TWD1 (1u << 4) /**< \brief Twihs1 signal: TWD1 */ -/* ========== Pio definition for TWIHS2 peripheral ========== */ -#define PIO_PD28C_TWCK2 (1u << 28) /**< \brief Twihs2 signal: TWCK2 */ -#define PIO_PD27C_TWD2 (1u << 27) /**< \brief Twihs2 signal: TWD2 */ -/* ========== Pio definition for UART0 peripheral ========== */ -#define PIO_PA9A_URXD0 (1u << 9) /**< \brief Uart0 signal: URXD0 */ -#define PIO_PA10A_UTXD0 (1u << 10) /**< \brief Uart0 signal: UTXD0 */ -/* ========== Pio definition for UART1 peripheral ========== */ -#define PIO_PA5C_URXD1 (1u << 5) /**< \brief Uart1 signal: URXD1 */ -#define PIO_PA4C_UTXD1 (1u << 4) /**< \brief Uart1 signal: UTXD1 */ -#define PIO_PA6C_UTXD1 (1u << 6) /**< \brief Uart1 signal: UTXD1 */ -#define PIO_PD26D_UTXD1 (1u << 26) /**< \brief Uart1 signal: UTXD1 */ -/* ========== Pio definition for UART2 peripheral ========== */ -#define PIO_PD25C_URXD2 (1u << 25) /**< \brief Uart2 signal: URXD2 */ -#define PIO_PD26C_UTXD2 (1u << 26) /**< \brief Uart2 signal: UTXD2 */ -/* ========== Pio definition for UART3 peripheral ========== */ -#define PIO_PD28A_URXD3 (1u << 28) /**< \brief Uart3 signal: URXD3 */ -#define PIO_PD30A_UTXD3 (1u << 30) /**< \brief Uart3 signal: UTXD3 */ -#define PIO_PD31B_UTXD3 (1u << 31) /**< \brief Uart3 signal: UTXD3 */ -/* ========== Pio definition for UART4 peripheral ========== */ -#define PIO_PD18C_URXD4 (1u << 18) /**< \brief Uart4 signal: URXD4 */ -#define PIO_PD3C_UTXD4 (1u << 3) /**< \brief Uart4 signal: UTXD4 */ -#define PIO_PD19C_UTXD4 (1u << 19) /**< \brief Uart4 signal: UTXD4 */ -/* ========== Pio definition for USART0 peripheral ========== */ -#define PIO_PB2C_CTS0 (1u << 2) /**< \brief Usart0 signal: CTS0 */ -#define PIO_PD0D_DCD0 (1u << 0) /**< \brief Usart0 signal: DCD0 */ -#define PIO_PD2D_DSR0 (1u << 2) /**< \brief Usart0 signal: DSR0 */ -#define PIO_PD1D_DTR0 (1u << 1) /**< \brief Usart0 signal: DTR0 */ -#define PIO_PD3D_RI0 (1u << 3) /**< \brief Usart0 signal: RI0 */ -#define PIO_PB3C_RTS0 (1u << 3) /**< \brief Usart0 signal: RTS0 */ -#define PIO_PB0C_RXD0 (1u << 0) /**< \brief Usart0 signal: RXD0 */ -#define PIO_PB13C_SCK0 (1u << 13) /**< \brief Usart0 signal: SCK0 */ -#define PIO_PB1C_TXD0 (1u << 1) /**< \brief Usart0 signal: TXD0 */ -/* ========== Pio definition for USART1 peripheral ========== */ -#define PIO_PA25A_CTS1 (1u << 25) /**< \brief Usart1 signal: CTS1 */ -#define PIO_PA26A_DCD1 (1u << 26) /**< \brief Usart1 signal: DCD1 */ -#define PIO_PA28A_DSR1 (1u << 28) /**< \brief Usart1 signal: DSR1 */ -#define PIO_PA27A_DTR1 (1u << 27) /**< \brief Usart1 signal: DTR1 */ -#define PIO_PA3B_LONCOL1 (1u << 3) /**< \brief Usart1 signal: LONCOL1 */ -#define PIO_PA29A_RI1 (1u << 29) /**< \brief Usart1 signal: RI1 */ -#define PIO_PA24A_RTS1 (1u << 24) /**< \brief Usart1 signal: RTS1 */ -#define PIO_PA21A_RXD1 (1u << 21) /**< \brief Usart1 signal: RXD1 */ -#define PIO_PA23A_SCK1 (1u << 23) /**< \brief Usart1 signal: SCK1 */ -#define PIO_PB4D_TXD1 (1u << 4) /**< \brief Usart1 signal: TXD1 */ -/* ========== Pio definition for USART2 peripheral ========== */ -#define PIO_PD19B_CTS2 (1u << 19) /**< \brief Usart2 signal: CTS2 */ -#define PIO_PD4D_DCD2 (1u << 4) /**< \brief Usart2 signal: DCD2 */ -#define PIO_PD6D_DSR2 (1u << 6) /**< \brief Usart2 signal: DSR2 */ -#define PIO_PD5D_DTR2 (1u << 5) /**< \brief Usart2 signal: DTR2 */ -#define PIO_PD7D_RI2 (1u << 7) /**< \brief Usart2 signal: RI2 */ -#define PIO_PD18B_RTS2 (1u << 18) /**< \brief Usart2 signal: RTS2 */ -#define PIO_PD15B_RXD2 (1u << 15) /**< \brief Usart2 signal: RXD2 */ -#define PIO_PD17B_SCK2 (1u << 17) /**< \brief Usart2 signal: SCK2 */ -#define PIO_PD16B_TXD2 (1u << 16) /**< \brief Usart2 signal: TXD2 */ -/* ========== Pio indexes ========== */ -#define PIO_PA0_IDX 0 -#define PIO_PA1_IDX 1 -#define PIO_PA2_IDX 2 -#define PIO_PA3_IDX 3 -#define PIO_PA4_IDX 4 -#define PIO_PA5_IDX 5 -#define PIO_PA6_IDX 6 -#define PIO_PA7_IDX 7 -#define PIO_PA8_IDX 8 -#define PIO_PA9_IDX 9 -#define PIO_PA10_IDX 10 -#define PIO_PA11_IDX 11 -#define PIO_PA12_IDX 12 -#define PIO_PA13_IDX 13 -#define PIO_PA14_IDX 14 -#define PIO_PA15_IDX 15 -#define PIO_PA16_IDX 16 -#define PIO_PA17_IDX 17 -#define PIO_PA18_IDX 18 -#define PIO_PA19_IDX 19 -#define PIO_PA20_IDX 20 -#define PIO_PA21_IDX 21 -#define PIO_PA22_IDX 22 -#define PIO_PA23_IDX 23 -#define PIO_PA24_IDX 24 -#define PIO_PA25_IDX 25 -#define PIO_PA26_IDX 26 -#define PIO_PA27_IDX 27 -#define PIO_PA28_IDX 28 -#define PIO_PA29_IDX 29 -#define PIO_PA30_IDX 30 -#define PIO_PA31_IDX 31 -#define PIO_PB0_IDX 32 -#define PIO_PB1_IDX 33 -#define PIO_PB2_IDX 34 -#define PIO_PB3_IDX 35 -#define PIO_PB4_IDX 36 -#define PIO_PB5_IDX 37 -#define PIO_PB6_IDX 38 -#define PIO_PB7_IDX 39 -#define PIO_PB8_IDX 40 -#define PIO_PB9_IDX 41 -#define PIO_PB12_IDX 44 -#define PIO_PB13_IDX 45 -#define PIO_PC0_IDX 64 -#define PIO_PC1_IDX 65 -#define PIO_PC2_IDX 66 -#define PIO_PC3_IDX 67 -#define PIO_PC4_IDX 68 -#define PIO_PC5_IDX 69 -#define PIO_PC6_IDX 70 -#define PIO_PC7_IDX 71 -#define PIO_PC8_IDX 72 -#define PIO_PC9_IDX 73 -#define PIO_PC10_IDX 74 -#define PIO_PC11_IDX 75 -#define PIO_PC12_IDX 76 -#define PIO_PC13_IDX 77 -#define PIO_PC14_IDX 78 -#define PIO_PC15_IDX 79 -#define PIO_PC16_IDX 80 -#define PIO_PC17_IDX 81 -#define PIO_PC18_IDX 82 -#define PIO_PC19_IDX 83 -#define PIO_PC20_IDX 84 -#define PIO_PC21_IDX 85 -#define PIO_PC22_IDX 86 -#define PIO_PC23_IDX 87 -#define PIO_PC24_IDX 88 -#define PIO_PC25_IDX 89 -#define PIO_PC26_IDX 90 -#define PIO_PC27_IDX 91 -#define PIO_PC28_IDX 92 -#define PIO_PC29_IDX 93 -#define PIO_PC30_IDX 94 -#define PIO_PC31_IDX 95 -#define PIO_PD0_IDX 96 -#define PIO_PD1_IDX 97 -#define PIO_PD2_IDX 98 -#define PIO_PD3_IDX 99 -#define PIO_PD4_IDX 100 -#define PIO_PD5_IDX 101 -#define PIO_PD6_IDX 102 -#define PIO_PD7_IDX 103 -#define PIO_PD8_IDX 104 -#define PIO_PD9_IDX 105 -#define PIO_PD10_IDX 106 -#define PIO_PD11_IDX 107 -#define PIO_PD12_IDX 108 -#define PIO_PD13_IDX 109 -#define PIO_PD14_IDX 110 -#define PIO_PD15_IDX 111 -#define PIO_PD16_IDX 112 -#define PIO_PD17_IDX 113 -#define PIO_PD18_IDX 114 -#define PIO_PD19_IDX 115 -#define PIO_PD20_IDX 116 -#define PIO_PD21_IDX 117 -#define PIO_PD22_IDX 118 -#define PIO_PD23_IDX 119 -#define PIO_PD24_IDX 120 -#define PIO_PD25_IDX 121 -#define PIO_PD26_IDX 122 -#define PIO_PD27_IDX 123 -#define PIO_PD28_IDX 124 -#define PIO_PD29_IDX 125 -#define PIO_PD30_IDX 126 -#define PIO_PD31_IDX 127 -#define PIO_PE0_IDX 128 -#define PIO_PE1_IDX 129 -#define PIO_PE2_IDX 130 -#define PIO_PE3_IDX 131 -#define PIO_PE4_IDX 132 -#define PIO_PE5_IDX 133 - -#endif /* _SAMV71Q21_PIO_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/samv71.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/samv71.h deleted file mode 100644 index 91f3699b..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/samv71.h +++ /dev/null @@ -1,55 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71_ -#define _SAMV71_ - -#if defined __SAMV71J19__ - #include "samv71j19.h" -#elif defined __SAMV71J20__ - #include "samv71j20.h" -#elif defined __SAMV71J21__ - #include "samv71j21.h" -#elif defined __SAMV71N19__ - #include "samv71n19.h" -#elif defined __SAMV71N20__ - #include "samv71n20.h" -#elif defined __SAMV71N21__ - #include "samv71n21.h" -#elif defined __SAMV71Q19__ - #include "samv71q19.h" -#elif defined __SAMV71Q20__ - #include "samv71q20.h" -#elif defined __SAMV71Q21__ - #include "samv71q21.h" -#else - #error Library does not support the specified device. -#endif - -#endif /* _SAMV71_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/samv71j19.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/samv71j19.h deleted file mode 100644 index aa09324f..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/samv71j19.h +++ /dev/null @@ -1,633 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71J19_ -#define _SAMV71J19_ - -/** \addtogroup SAMV71J19_definitions SAMV71J19 definitions - This file defines all structures and symbols for SAMV71J19: - - registers and bit-fields - - peripheral base address - - peripheral ID - - PIO definitions -*/ -/*@{*/ - -#ifdef __cplusplus - extern "C" { -#endif - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -#include -#endif - -/* ************************************************************************** */ -/* CMSIS DEFINITIONS FOR SAMV71J19 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71J19_cmsis CMSIS Definitions */ -/*@{*/ - -/**< Interrupt Number Definition */ -typedef enum IRQn -{ -/****** Cortex-M7 Processor Exceptions Numbers ******************************/ - NonMaskableInt_IRQn = -14, /**< 2 Non Maskable Interrupt */ - HardFault_IRQn = -13, /**< 3 HardFault Interrupt */ - MemoryManagement_IRQn = -12, /**< 4 Cortex-M7 Memory Management Interrupt */ - BusFault_IRQn = -11, /**< 5 Cortex-M7 Bus Fault Interrupt */ - UsageFault_IRQn = -10, /**< 6 Cortex-M7 Usage Fault Interrupt */ - SVCall_IRQn = -5, /**< 11 Cortex-M7 SV Call Interrupt */ - DebugMonitor_IRQn = -4, /**< 12 Cortex-M7 Debug Monitor Interrupt */ - PendSV_IRQn = -2, /**< 14 Cortex-M7 Pend SV Interrupt */ - SysTick_IRQn = -1, /**< 15 Cortex-M7 System Tick Interrupt */ -/****** SAMV71J19 specific Interrupt Numbers *********************************/ - - SUPC_IRQn = 0, /**< 0 SAMV71J19 Supply Controller (SUPC) */ - RSTC_IRQn = 1, /**< 1 SAMV71J19 Reset Controller (RSTC) */ - RTC_IRQn = 2, /**< 2 SAMV71J19 Real Time Clock (RTC) */ - RTT_IRQn = 3, /**< 3 SAMV71J19 Real Time Timer (RTT) */ - WDT_IRQn = 4, /**< 4 SAMV71J19 Watchdog Timer (WDT) */ - PMC_IRQn = 5, /**< 5 SAMV71J19 Power Management Controller (PMC) */ - EFC_IRQn = 6, /**< 6 SAMV71J19 Enhanced Embedded Flash Controller (EFC) */ - UART0_IRQn = 7, /**< 7 SAMV71J19 UART 0 (UART0) */ - UART1_IRQn = 8, /**< 8 SAMV71J19 UART 1 (UART1) */ - PIOA_IRQn = 10, /**< 10 SAMV71J19 Parallel I/O Controller A (PIOA) */ - PIOB_IRQn = 11, /**< 11 SAMV71J19 Parallel I/O Controller B (PIOB) */ - USART0_IRQn = 13, /**< 13 SAMV71J19 USART 0 (USART0) */ - USART1_IRQn = 14, /**< 14 SAMV71J19 USART 1 (USART1) */ - USART2_IRQn = 15, /**< 15 SAMV71J19 USART 2 (USART2) */ - PIOD_IRQn = 16, /**< 16 SAMV71J19 Parallel I/O Controller D (PIOD) */ - HSMCI_IRQn = 18, /**< 18 SAMV71J19 Multimedia Card Interface (HSMCI) */ - TWIHS0_IRQn = 19, /**< 19 SAMV71J19 Two Wire Interface 0 HS (TWIHS0) */ - TWIHS1_IRQn = 20, /**< 20 SAMV71J19 Two Wire Interface 1 HS (TWIHS1) */ - SPI0_IRQn = 21, /**< 21 SAMV71J19 Serial Peripheral Interface 0 (SPI0) */ - SSC_IRQn = 22, /**< 22 SAMV71J19 Synchronous Serial Controller (SSC) */ - TC0_IRQn = 23, /**< 23 SAMV71J19 Timer/Counter 0 (TC0) */ - TC1_IRQn = 24, /**< 24 SAMV71J19 Timer/Counter 1 (TC1) */ - TC2_IRQn = 25, /**< 25 SAMV71J19 Timer/Counter 2 (TC2) */ - AFEC0_IRQn = 29, /**< 29 SAMV71J19 Analog Front End 0 (AFEC0) */ - PWM0_IRQn = 31, /**< 31 SAMV71J19 Pulse Width Modulation 0 (PWM0) */ - ICM_IRQn = 32, /**< 32 SAMV71J19 Integrity Check Monitor (ICM) */ - ACC_IRQn = 33, /**< 33 SAMV71J19 Analog Comparator (ACC) */ - USBHS_IRQn = 34, /**< 34 SAMV71J19 USB Host / Device Controller (USBHS) */ - MCAN0_IRQn = 35, /**< 35 SAMV71J19 MCAN Controller 0 (MCAN0) */ - MCAN0_LINE1_IRQn = 36, /**< 36 SAMV71Q21 MCAN Controller 0 LINE1 (MCAN0) */ - MCAN1_IRQn = 37, /**< 37 SAMV71J19 MCAN Controller 1 (MCAN1) */ - MCAN1_LINE1_IRQn = 38, /**< 38 SAMV71Q21 MCAN Controller 1 LINE1 (MCAN1) */ - GMAC_IRQn = 39, /**< 39 SAMV71J19 Ethernet MAC (GMAC) */ - AFEC1_IRQn = 40, /**< 40 SAMV71J19 Analog Front End 1 (AFEC1) */ - SPI1_IRQn = 42, /**< 42 SAMV71J19 Serial Peripheral Interface 1 (SPI1) */ - QSPI_IRQn = 43, /**< 43 SAMV71J19 Quad I/O Serial Peripheral Interface (QSPI) */ - UART2_IRQn = 44, /**< 44 SAMV71J19 UART 2 (UART2) */ - UART3_IRQn = 45, /**< 45 SAMV71J19 UART 3 (UART3) */ - UART4_IRQn = 46, /**< 46 SAMV71J19 UART 4 (UART4) */ - TC9_IRQn = 50, /**< 50 SAMV71J19 Timer/Counter 9 (TC9) */ - TC10_IRQn = 51, /**< 51 SAMV71J19 Timer/Counter 10 (TC10) */ - TC11_IRQn = 52, /**< 52 SAMV71J19 Timer/Counter 11 (TC11) */ - MLB_IRQn = 53, /**< 53 SAMV71J19 MediaLB (MLB) */ - AES_IRQn = 56, /**< 56 SAMV71J19 AES (AES) */ - TRNG_IRQn = 57, /**< 57 SAMV71J19 True Random Generator (TRNG) */ - XDMAC_IRQn = 58, /**< 58 SAMV71J19 DMA (XDMAC) */ - ISI_IRQn = 59, /**< 59 SAMV71J19 Camera Interface (ISI) */ - PWM1_IRQn = 60, /**< 60 SAMV71J19 Pulse Width Modulation 1 (PWM1) */ - RSWDT_IRQn = 63, /**< 63 SAMV71J19 Reinforced Secure Watchdog Timer (RSWDT) */ - - PERIPH_COUNT_IRQn = 64 /**< Number of peripheral IDs */ -} IRQn_Type; - -typedef struct _DeviceVectors -{ - /* Stack pointer */ - void* pvStack; - - /* Cortex-M handlers */ - void* pfnReset_Handler; - void* pfnNMI_Handler; - void* pfnHardFault_Handler; - void* pfnMemManage_Handler; - void* pfnBusFault_Handler; - void* pfnUsageFault_Handler; - void* pfnReserved1_Handler; - void* pfnReserved2_Handler; - void* pfnReserved3_Handler; - void* pfnReserved4_Handler; - void* pfnSVC_Handler; - void* pfnDebugMon_Handler; - void* pfnReserved5_Handler; - void* pfnPendSV_Handler; - void* pfnSysTick_Handler; - - /* Peripheral handlers */ - void* pfnSUPC_Handler; /* 0 Supply Controller */ - void* pfnRSTC_Handler; /* 1 Reset Controller */ - void* pfnRTC_Handler; /* 2 Real Time Clock */ - void* pfnRTT_Handler; /* 3 Real Time Timer */ - void* pfnWDT_Handler; /* 4 Watchdog Timer */ - void* pfnPMC_Handler; /* 5 Power Management Controller */ - void* pfnEFC_Handler; /* 6 Enhanced Embedded Flash Controller */ - void* pfnUART0_Handler; /* 7 UART 0 */ - void* pfnUART1_Handler; /* 8 UART 1 */ - void* pvReserved9; - void* pfnPIOA_Handler; /* 10 Parallel I/O Controller A */ - void* pfnPIOB_Handler; /* 11 Parallel I/O Controller B */ - void* pvReserved12; - void* pfnUSART0_Handler; /* 13 USART 0 */ - void* pfnUSART1_Handler; /* 14 USART 1 */ - void* pfnUSART2_Handler; /* 15 USART 2 */ - void* pfnPIOD_Handler; /* 16 Parallel I/O Controller D */ - void* pvReserved17; - void* pfnHSMCI_Handler; /* 18 Multimedia Card Interface */ - void* pfnTWIHS0_Handler; /* 19 Two Wire Interface 0 HS */ - void* pfnTWIHS1_Handler; /* 20 Two Wire Interface 1 HS */ - void* pfnSPI0_Handler; /* 21 Serial Peripheral Interface 0 */ - void* pfnSSC_Handler; /* 22 Synchronous Serial Controller */ - void* pfnTC0_Handler; /* 23 Timer/Counter 0 */ - void* pfnTC1_Handler; /* 24 Timer/Counter 1 */ - void* pfnTC2_Handler; /* 25 Timer/Counter 2 */ - void* pvReserved26; - void* pvReserved27; - void* pvReserved28; - void* pfnAFEC0_Handler; /* 29 Analog Front End 0 */ - void* pvReserved30; - void* pfnPWM0_Handler; /* 31 Pulse Width Modulation 0 */ - void* pfnICM_Handler; /* 32 Integrity Check Monitor */ - void* pfnACC_Handler; /* 33 Analog Comparator */ - void* pfnUSBHS_Handler; /* 34 USB Host / Device Controller */ - void* pfnMCAN0_Handler; /* 35 MCAN Controller 0 */ - void* pfnMCAN0_Line1_Handler; /* 36 MCAN Controller 0 */ - void* pfnMCAN1_Handler; /* 37 MCAN Controller 1 */ - void* pfnMCAN1_Line1_Handler; /* 38 MCAN Controller 1 */ - void* pfnGMAC_Handler; /* 39 Ethernet MAC */ - void* pfnAFEC1_Handler; /* 40 Analog Front End 1 */ - void* pvReserved41; - void* pfnSPI1_Handler; /* 42 Serial Peripheral Interface 1 */ - void* pfnQSPI_Handler; /* 43 Quad I/O Serial Peripheral Interface */ - void* pfnUART2_Handler; /* 44 UART 2 */ - void* pfnUART3_Handler; /* 45 UART 3 */ - void* pfnUART4_Handler; /* 46 UART 4 */ - void* pvReserved47; - void* pvReserved48; - void* pvReserved49; - void* pfnTC9_Handler; /* 50 Timer/Counter 9 */ - void* pfnTC10_Handler; /* 51 Timer/Counter 10 */ - void* pfnTC11_Handler; /* 52 Timer/Counter 11 */ - void* pfnMLB_Handler; /* 53 MediaLB */ - void* pvReserved54; - void* pvReserved55; - void* pfnAES_Handler; /* 56 AES */ - void* pfnTRNG_Handler; /* 57 True Random Generator */ - void* pfnXDMAC_Handler; /* 58 DMA */ - void* pfnISI_Handler; /* 59 Camera Interface */ - void* pfnPWM1_Handler; /* 60 Pulse Width Modulation 1 */ - void* pvReserved61; - void* pvReserved62; - void* pfnRSWDT_Handler; /* 63 Reinforced Secure Watchdog Timer */ -} DeviceVectors; - -/* Cortex-M7 core handlers */ -void Reset_Handler ( void ); -void NMI_Handler ( void ); -void HardFault_Handler ( void ); -void MemManage_Handler ( void ); -void BusFault_Handler ( void ); -void UsageFault_Handler ( void ); -void SVC_Handler ( void ); -void DebugMon_Handler ( void ); -void PendSV_Handler ( void ); -void SysTick_Handler ( void ); - -/* Peripherals handlers */ -void ACC_Handler ( void ); -void AES_Handler ( void ); -void AFEC0_Handler ( void ); -void AFEC1_Handler ( void ); -void EFC_Handler ( void ); -void GMAC_Handler ( void ); -void HSMCI_Handler ( void ); -void ICM_Handler ( void ); -void ISI_Handler ( void ); -void MCAN0_Handler ( void ); -void MCAN0_Line1_Handler( void ); -void MCAN1_Handler ( void ); -void MCAN1_Line1_Handler( void ); -void MLB_Handler ( void ); -void PIOA_Handler ( void ); -void PIOB_Handler ( void ); -void PIOD_Handler ( void ); -void PMC_Handler ( void ); -void PWM0_Handler ( void ); -void PWM1_Handler ( void ); -void QSPI_Handler ( void ); -void RSTC_Handler ( void ); -void RSWDT_Handler ( void ); -void RTC_Handler ( void ); -void RTT_Handler ( void ); -void SPI0_Handler ( void ); -void SPI1_Handler ( void ); -void SSC_Handler ( void ); -void SUPC_Handler ( void ); -void TC0_Handler ( void ); -void TC1_Handler ( void ); -void TC2_Handler ( void ); -void TC9_Handler ( void ); -void TC10_Handler ( void ); -void TC11_Handler ( void ); -void TRNG_Handler ( void ); -void TWIHS0_Handler ( void ); -void TWIHS1_Handler ( void ); -void UART0_Handler ( void ); -void UART1_Handler ( void ); -void UART2_Handler ( void ); -void UART3_Handler ( void ); -void UART4_Handler ( void ); -void USART0_Handler ( void ); -void USART1_Handler ( void ); -void USART2_Handler ( void ); -void USBHS_Handler ( void ); -void WDT_Handler ( void ); -void XDMAC_Handler ( void ); - -/** - * \brief Configuration of the Cortex-M7 Processor and Core Peripherals - */ - -#define __CM7_REV 0x0000 /**< SAMV71J19 core revision number ([15:8] revision number, [7:0] patch number) */ -#define __MPU_PRESENT 1 /**< SAMV71J19 does provide a MPU */ -#define __NVIC_PRIO_BITS 3 /**< SAMV71J19 uses 3 Bits for the Priority Levels */ -#define __FPU_PRESENT 1 /**< SAMV71J19 does provide a FPU */ -#define __FPU_DP 1 /**< SAMV71J19 Double precision FPU */ -#define __ICACHE_PRESENT 1 /**< SAMV71J19 does provide an Instruction Cache */ -#define __DCACHE_PRESENT 1 /**< SAMV71J19 does provide a Data Cache */ -#define __DTCM_PRESENT 1 /**< SAMV71J19 does provide a Data TCM */ -#define __ITCM_PRESENT 1 /**< SAMV71J19 does provide an Instruction TCM */ -#define __Vendor_SysTickConfig 0 /**< Set to 1 if different SysTick Config is used */ - -/* - * \brief CMSIS includes - */ - -#include -#if !defined DONT_USE_CMSIS_INIT -#include "system_samv71.h" -#endif /* DONT_USE_CMSIS_INIT */ - -/*@}*/ - -/* ************************************************************************** */ -/** SOFTWARE PERIPHERAL API DEFINITION FOR SAMV71J19 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71J19_api Peripheral Software API */ -/*@{*/ - -#include "component/component_acc.h" -#include "component/component_aes.h" -#include "component/component_afec.h" -#include "component/component_chipid.h" -#include "component/component_efc.h" -#include "component/component_gmac.h" -#include "component/component_gpbr.h" -#include "component/component_hsmci.h" -#include "component/component_icm.h" -#include "component/component_isi.h" -#include "component/component_matrix.h" -#include "component/component_mcan.h" -#include "component/component_mlb.h" -#include "component/component_pio.h" -#include "component/component_pmc.h" -#include "component/component_pwm.h" -#include "component/component_qspi.h" -#include "component/component_rstc.h" -#include "component/component_rswdt.h" -#include "component/component_rtc.h" -#include "component/component_rtt.h" -#include "component/component_spi.h" -#include "component/component_ssc.h" -#include "component/component_supc.h" -#include "component/component_tc.h" -#include "component/component_trng.h" -#include "component/component_twihs.h" -#include "component/component_uart.h" -#include "component/component_usart.h" -#include "component/component_usbhs.h" -#include "component/component_utmi.h" -#include "component/component_wdt.h" -#include "component/component_xdmac.h" -/*@}*/ - -/* ************************************************************************** */ -/* REGISTER ACCESS DEFINITIONS FOR SAMV71J19 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71J19_reg Registers Access Definitions */ -/*@{*/ - -#include "instance/instance_hsmci.h" -#include "instance/instance_ssc.h" -#include "instance/instance_spi0.h" -#include "instance/instance_tc0.h" -#include "instance/instance_twihs0.h" -#include "instance/instance_twihs1.h" -#include "instance/instance_pwm0.h" -#include "instance/instance_usart0.h" -#include "instance/instance_usart1.h" -#include "instance/instance_usart2.h" -#include "instance/instance_mcan0.h" -#include "instance/instance_mcan1.h" -#include "instance/instance_usbhs.h" -#include "instance/instance_afec0.h" -#include "instance/instance_acc.h" -#include "instance/instance_icm.h" -#include "instance/instance_isi.h" -#include "instance/instance_gmac.h" -#include "instance/instance_tc3.h" -#include "instance/instance_spi1.h" -#include "instance/instance_pwm1.h" -#include "instance/instance_afec1.h" -#include "instance/instance_mlb.h" -#include "instance/instance_aes.h" -#include "instance/instance_trng.h" -#include "instance/instance_xdmac.h" -#include "instance/instance_qspi.h" -#include "instance/instance_matrix.h" -#include "instance/instance_utmi.h" -#include "instance/instance_pmc.h" -#include "instance/instance_uart0.h" -#include "instance/instance_chipid.h" -#include "instance/instance_uart1.h" -#include "instance/instance_efc.h" -#include "instance/instance_pioa.h" -#include "instance/instance_piob.h" -#include "instance/instance_piod.h" -#include "instance/instance_rstc.h" -#include "instance/instance_supc.h" -#include "instance/instance_rtt.h" -#include "instance/instance_wdt.h" -#include "instance/instance_rtc.h" -#include "instance/instance_gpbr.h" -#include "instance/instance_rswdt.h" -#include "instance/instance_uart2.h" -#include "instance/instance_uart3.h" -#include "instance/instance_uart4.h" -/*@}*/ - -/* ************************************************************************** */ -/* PERIPHERAL ID DEFINITIONS FOR SAMV71J19 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71J19_id Peripheral Ids Definitions */ -/*@{*/ - -#define ID_SUPC ( 0) /**< \brief Supply Controller (SUPC) */ -#define ID_RSTC ( 1) /**< \brief Reset Controller (RSTC) */ -#define ID_RTC ( 2) /**< \brief Real Time Clock (RTC) */ -#define ID_RTT ( 3) /**< \brief Real Time Timer (RTT) */ -#define ID_WDT ( 4) /**< \brief Watchdog Timer (WDT) */ -#define ID_PMC ( 5) /**< \brief Power Management Controller (PMC) */ -#define ID_EFC ( 6) /**< \brief Enhanced Embedded Flash Controller (EFC) */ -#define ID_UART0 ( 7) /**< \brief UART 0 (UART0) */ -#define ID_UART1 ( 8) /**< \brief UART 1 (UART1) */ -#define ID_PIOA (10) /**< \brief Parallel I/O Controller A (PIOA) */ -#define ID_PIOB (11) /**< \brief Parallel I/O Controller B (PIOB) */ -#define ID_USART0 (13) /**< \brief USART 0 (USART0) */ -#define ID_USART1 (14) /**< \brief USART 1 (USART1) */ -#define ID_USART2 (15) /**< \brief USART 2 (USART2) */ -#define ID_PIOD (16) /**< \brief Parallel I/O Controller D (PIOD) */ -#define ID_HSMCI (18) /**< \brief Multimedia Card Interface (HSMCI) */ -#define ID_TWIHS0 (19) /**< \brief Two Wire Interface 0 HS (TWIHS0) */ -#define ID_TWIHS1 (20) /**< \brief Two Wire Interface 1 HS (TWIHS1) */ -#define ID_SPI0 (21) /**< \brief Serial Peripheral Interface 0 (SPI0) */ -#define ID_SSC (22) /**< \brief Synchronous Serial Controller (SSC) */ -#define ID_TC0 (23) /**< \brief Timer/Counter 0 (TC0) */ -#define ID_TC1 (24) /**< \brief Timer/Counter 1 (TC1) */ -#define ID_TC2 (25) /**< \brief Timer/Counter 2 (TC2) */ -#define ID_AFEC0 (29) /**< \brief Analog Front End 0 (AFEC0) */ -#define ID_PWM0 (31) /**< \brief Pulse Width Modulation 0 (PWM0) */ -#define ID_ICM (32) /**< \brief Integrity Check Monitor (ICM) */ -#define ID_ACC (33) /**< \brief Analog Comparator (ACC) */ -#define ID_USBHS (34) /**< \brief USB Host / Device Controller (USBHS) */ -#define ID_MCAN0 (35) /**< \brief MCAN Controller 0 (MCAN0) */ -#define ID_MCAN1 (37) /**< \brief MCAN Controller 1 (MCAN1) */ -#define ID_GMAC (39) /**< \brief Ethernet MAC (GMAC) */ -#define ID_AFEC1 (40) /**< \brief Analog Front End 1 (AFEC1) */ -#define ID_SPI1 (42) /**< \brief Serial Peripheral Interface 1 (SPI1) */ -#define ID_QSPI (43) /**< \brief Quad I/O Serial Peripheral Interface (QSPI) */ -#define ID_UART2 (44) /**< \brief UART 2 (UART2) */ -#define ID_UART3 (45) /**< \brief UART 3 (UART3) */ -#define ID_UART4 (46) /**< \brief UART 4 (UART4) */ -#define ID_TC9 (50) /**< \brief Timer/Counter 9 (TC9) */ -#define ID_TC10 (51) /**< \brief Timer/Counter 10 (TC10) */ -#define ID_TC11 (52) /**< \brief Timer/Counter 11 (TC11) */ -#define ID_MLB (53) /**< \brief MediaLB (MLB) */ -#define ID_AES (56) /**< \brief AES (AES) */ -#define ID_TRNG (57) /**< \brief True Random Generator (TRNG) */ -#define ID_XDMAC (58) /**< \brief DMA (XDMAC) */ -#define ID_ISI (59) /**< \brief Camera Interface (ISI) */ -#define ID_PWM1 (60) /**< \brief Pulse Width Modulation 1 (PWM1) */ -#define ID_RSWDT (63) /**< \brief Reinforced Secure Watchdog Timer (RSWDT) */ - -#define ID_PERIPH_COUNT (64) /**< \brief Number of peripheral IDs */ -/*@}*/ - -/* ************************************************************************** */ -/* BASE ADDRESS DEFINITIONS FOR SAMV71J19 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71J19_base Peripheral Base Address Definitions */ -/*@{*/ - -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -#define HSMCI (0x40000000U) /**< \brief (HSMCI ) Base Address */ -#define SSC (0x40004000U) /**< \brief (SSC ) Base Address */ -#define SPI0 (0x40008000U) /**< \brief (SPI0 ) Base Address */ -#define TC0 (0x4000C000U) /**< \brief (TC0 ) Base Address */ -#define TWIHS0 (0x40018000U) /**< \brief (TWIHS0) Base Address */ -#define TWIHS1 (0x4001C000U) /**< \brief (TWIHS1) Base Address */ -#define PWM0 (0x40020000U) /**< \brief (PWM0 ) Base Address */ -#define USART0 (0x40024000U) /**< \brief (USART0) Base Address */ -#define USART1 (0x40028000U) /**< \brief (USART1) Base Address */ -#define USART2 (0x4002C000U) /**< \brief (USART2) Base Address */ -#define MCAN0 (0x40030000U) /**< \brief (MCAN0 ) Base Address */ -#define MCAN1 (0x40034000U) /**< \brief (MCAN1 ) Base Address */ -#define USBHS (0x40038000U) /**< \brief (USBHS ) Base Address */ -#define AFEC0 (0x4003C000U) /**< \brief (AFEC0 ) Base Address */ -#define ACC (0x40044000U) /**< \brief (ACC ) Base Address */ -#define ICM (0x40048000U) /**< \brief (ICM ) Base Address */ -#define ISI (0x4004C000U) /**< \brief (ISI ) Base Address */ -#define GMAC (0x40050000U) /**< \brief (GMAC ) Base Address */ -#define TC3 (0x40054000U) /**< \brief (TC3 ) Base Address */ -#define SPI1 (0x40058000U) /**< \brief (SPI1 ) Base Address */ -#define PWM1 (0x4005C000U) /**< \brief (PWM1 ) Base Address */ -#define AFEC1 (0x40064000U) /**< \brief (AFEC1 ) Base Address */ -#define MLB (0x40068000U) /**< \brief (MLB ) Base Address */ -#define AES (0x4006C000U) /**< \brief (AES ) Base Address */ -#define TRNG (0x40070000U) /**< \brief (TRNG ) Base Address */ -#define XDMAC (0x40078000U) /**< \brief (XDMAC ) Base Address */ -#define QSPI (0x4007C000U) /**< \brief (QSPI ) Base Address */ -#define MATRIX (0x40088000U) /**< \brief (MATRIX) Base Address */ -#define UTMI (0x400E0400U) /**< \brief (UTMI ) Base Address */ -#define PMC (0x400E0600U) /**< \brief (PMC ) Base Address */ -#define UART0 (0x400E0800U) /**< \brief (UART0 ) Base Address */ -#define CHIPID (0x400E0940U) /**< \brief (CHIPID) Base Address */ -#define UART1 (0x400E0A00U) /**< \brief (UART1 ) Base Address */ -#define EFC (0x400E0C00U) /**< \brief (EFC ) Base Address */ -#define PIOA (0x400E0E00U) /**< \brief (PIOA ) Base Address */ -#define PIOB (0x400E1000U) /**< \brief (PIOB ) Base Address */ -#define PIOD (0x400E1400U) /**< \brief (PIOD ) Base Address */ -#define RSTC (0x400E1800U) /**< \brief (RSTC ) Base Address */ -#define SUPC (0x400E1810U) /**< \brief (SUPC ) Base Address */ -#define RTT (0x400E1830U) /**< \brief (RTT ) Base Address */ -#define WDT (0x400E1850U) /**< \brief (WDT ) Base Address */ -#define RTC (0x400E1860U) /**< \brief (RTC ) Base Address */ -#define GPBR (0x400E1890U) /**< \brief (GPBR ) Base Address */ -#define RSWDT (0x400E1900U) /**< \brief (RSWDT ) Base Address */ -#define UART2 (0x400E1A00U) /**< \brief (UART2 ) Base Address */ -#define UART3 (0x400E1C00U) /**< \brief (UART3 ) Base Address */ -#define UART4 (0x400E1E00U) /**< \brief (UART4 ) Base Address */ -#else -#define HSMCI ((Hsmci *)0x40000000U) /**< \brief (HSMCI ) Base Address */ -#define SSC ((Ssc *)0x40004000U) /**< \brief (SSC ) Base Address */ -#define SPI0 ((Spi *)0x40008000U) /**< \brief (SPI0 ) Base Address */ -#define TC0 ((Tc *)0x4000C000U) /**< \brief (TC0 ) Base Address */ -#define TWIHS0 ((Twihs *)0x40018000U) /**< \brief (TWIHS0) Base Address */ -#define TWIHS1 ((Twihs *)0x4001C000U) /**< \brief (TWIHS1) Base Address */ -#define PWM0 ((Pwm *)0x40020000U) /**< \brief (PWM0 ) Base Address */ -#define USART0 ((Usart *)0x40024000U) /**< \brief (USART0) Base Address */ -#define USART1 ((Usart *)0x40028000U) /**< \brief (USART1) Base Address */ -#define USART2 ((Usart *)0x4002C000U) /**< \brief (USART2) Base Address */ -#define MCAN0 ((Mcan *)0x40030000U) /**< \brief (MCAN0 ) Base Address */ -#define MCAN1 ((Mcan *)0x40034000U) /**< \brief (MCAN1 ) Base Address */ -#define USBHS ((Usbhs *)0x40038000U) /**< \brief (USBHS ) Base Address */ -#define AFEC0 ((Afec *)0x4003C000U) /**< \brief (AFEC0 ) Base Address */ -#define ACC ((Acc *)0x40044000U) /**< \brief (ACC ) Base Address */ -#define ICM ((Icm *)0x40048000U) /**< \brief (ICM ) Base Address */ -#define ISI ((Isi *)0x4004C000U) /**< \brief (ISI ) Base Address */ -#define GMAC ((Gmac *)0x40050000U) /**< \brief (GMAC ) Base Address */ -#define TC3 ((Tc *)0x40054000U) /**< \brief (TC3 ) Base Address */ -#define SPI1 ((Spi *)0x40058000U) /**< \brief (SPI1 ) Base Address */ -#define PWM1 ((Pwm *)0x4005C000U) /**< \brief (PWM1 ) Base Address */ -#define AFEC1 ((Afec *)0x40064000U) /**< \brief (AFEC1 ) Base Address */ -#define MLB ((Mlb *)0x40068000U) /**< \brief (MLB ) Base Address */ -#define AES ((Aes *)0x4006C000U) /**< \brief (AES ) Base Address */ -#define TRNG ((Trng *)0x40070000U) /**< \brief (TRNG ) Base Address */ -#define XDMAC ((Xdmac *)0x40078000U) /**< \brief (XDMAC ) Base Address */ -#define QSPI ((Qspi *)0x4007C000U) /**< \brief (QSPI ) Base Address */ -#define MATRIX ((Matrix *)0x40088000U) /**< \brief (MATRIX) Base Address */ -#define UTMI ((Utmi *)0x400E0400U) /**< \brief (UTMI ) Base Address */ -#define PMC ((Pmc *)0x400E0600U) /**< \brief (PMC ) Base Address */ -#define UART0 ((Uart *)0x400E0800U) /**< \brief (UART0 ) Base Address */ -#define CHIPID ((Chipid *)0x400E0940U) /**< \brief (CHIPID) Base Address */ -#define UART1 ((Uart *)0x400E0A00U) /**< \brief (UART1 ) Base Address */ -#define EFC ((Efc *)0x400E0C00U) /**< \brief (EFC ) Base Address */ -#define PIOA ((Pio *)0x400E0E00U) /**< \brief (PIOA ) Base Address */ -#define PIOB ((Pio *)0x400E1000U) /**< \brief (PIOB ) Base Address */ -#define PIOD ((Pio *)0x400E1400U) /**< \brief (PIOD ) Base Address */ -#define RSTC ((Rstc *)0x400E1800U) /**< \brief (RSTC ) Base Address */ -#define SUPC ((Supc *)0x400E1810U) /**< \brief (SUPC ) Base Address */ -#define RTT ((Rtt *)0x400E1830U) /**< \brief (RTT ) Base Address */ -#define WDT ((Wdt *)0x400E1850U) /**< \brief (WDT ) Base Address */ -#define RTC ((Rtc *)0x400E1860U) /**< \brief (RTC ) Base Address */ -#define GPBR ((Gpbr *)0x400E1890U) /**< \brief (GPBR ) Base Address */ -#define RSWDT ((Rswdt *)0x400E1900U) /**< \brief (RSWDT ) Base Address */ -#define UART2 ((Uart *)0x400E1A00U) /**< \brief (UART2 ) Base Address */ -#define UART3 ((Uart *)0x400E1C00U) /**< \brief (UART3 ) Base Address */ -#define UART4 ((Uart *)0x400E1E00U) /**< \brief (UART4 ) Base Address */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/*@}*/ - -/* ************************************************************************** */ -/* PIO DEFINITIONS FOR SAMV71J19 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71J19_pio Peripheral Pio Definitions */ -/*@{*/ - -#include "pio/pio_samv71j19.h" -/*@}*/ - -/* ************************************************************************** */ -/* MEMORY MAPPING DEFINITIONS FOR SAMV71J19 */ -/* ************************************************************************** */ - -#define IFLASH_SIZE (0x80000u) -#define IFLASH_PAGE_SIZE (512u) -#define IFLASH_LOCK_REGION_SIZE (16384u) -#define IFLASH_NB_OF_PAGES (1024u) -#define IFLASH_NB_OF_LOCK_BITS (32u) -#define IRAM_SIZE (0x40000u) - -#define QSPIMEM_ADDR (0x80000000u) /**< QSPI Memory base address */ -#define AXIMX_ADDR (0xA0000000u) /**< AXI Bus Matrix base address */ -#define ITCM_ADDR (0x00000000u) /**< Instruction Tightly Coupled Memory base address */ -#define IFLASH_ADDR (0x00400000u) /**< Internal Flash base address */ -#define IROM_ADDR (0x00800000u) /**< Internal ROM base address */ -#define DTCM_ADDR (0x20000000u) /**< Data Tightly Coupled Memory base address */ -#define IRAM_ADDR (0x20400000u) /**< Internal RAM base address */ -#define EBI_CS0_ADDR (0x60000000u) /**< EBI Chip Select 0 base address */ -#define EBI_CS1_ADDR (0x61000000u) /**< EBI Chip Select 1 base address */ -#define EBI_CS2_ADDR (0x62000000u) /**< EBI Chip Select 2 base address */ -#define EBI_CS3_ADDR (0x63000000u) /**< EBI Chip Select 3 base address */ -#define SDRAM_CS_ADDR (0x70000000u) /**< SDRAM Chip Select base address */ - -/* ************************************************************************** */ -/* MISCELLANEOUS DEFINITIONS FOR SAMV71J19 */ -/* ************************************************************************** */ - -#define CHIP_JTAGID (0x05B3D03FUL) -#define CHIP_CIDR (0xA12D0A00UL) -#define CHIP_EXID (0x00000000UL) - -/* ************************************************************************** */ -/* ELECTRICAL DEFINITIONS FOR SAMV71J19 */ -/* ************************************************************************** */ - -/* %ATMEL_ELECTRICAL% */ - -/* Device characteristics */ -#define CHIP_FREQ_SLCK_RC_MIN (20000UL) -#define CHIP_FREQ_SLCK_RC (32000UL) -#define CHIP_FREQ_SLCK_RC_MAX (44000UL) -#define CHIP_FREQ_MAINCK_RC_4MHZ (4000000UL) -#define CHIP_FREQ_MAINCK_RC_8MHZ (8000000UL) -#define CHIP_FREQ_MAINCK_RC_12MHZ (12000000UL) -#define CHIP_FREQ_CPU_MAX (300000000UL) -#define CHIP_FREQ_XTAL_32K (32768UL) -#define CHIP_FREQ_XTAL_12M (12000000UL) - -/* Embedded Flash Read Wait State (VDDCORE set at 1.20V) */ -#define CHIP_FREQ_FWS_0 (26000000UL) /**< \brief Maximum operating frequency when FWS is 0 */ -#define CHIP_FREQ_FWS_1 (52000000UL) /**< \brief Maximum operating frequency when FWS is 1 */ -#define CHIP_FREQ_FWS_2 (78000000UL) /**< \brief Maximum operating frequency when FWS is 2 */ -#define CHIP_FREQ_FWS_3 (104000000UL) /**< \brief Maximum operating frequency when FWS is 3 */ -#define CHIP_FREQ_FWS_4 (131000000UL) /**< \brief Maximum operating frequency when FWS is 4 */ -#define CHIP_FREQ_FWS_5 (150000000UL) /**< \brief Maximum operating frequency when FWS is 5 */ - - -#ifdef __cplusplus -} -#endif - -/*@}*/ - -#endif /* _SAMV71J19_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/samv71j20.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/samv71j20.h deleted file mode 100644 index 8dbcc41c..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/samv71j20.h +++ /dev/null @@ -1,640 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71J20_ -#define _SAMV71J20_ - -/** \addtogroup SAMV71J20_definitions SAMV71J20 definitions - This file defines all structures and symbols for SAMV71J20: - - registers and bit-fields - - peripheral base address - - peripheral ID - - PIO definitions -*/ -/*@{*/ - -#ifdef __cplusplus - extern "C" { -#endif - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -#include -#endif - -/* ************************************************************************** */ -/* CMSIS DEFINITIONS FOR SAMV71J20 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71J20_cmsis CMSIS Definitions */ -/*@{*/ - -/**< Interrupt Number Definition */ -typedef enum IRQn -{ -/****** Cortex-M7 Processor Exceptions Numbers ******************************/ - NonMaskableInt_IRQn = -14, /**< 2 Non Maskable Interrupt */ - HardFault_IRQn = -13, /**< 3 HardFault Interrupt */ - MemoryManagement_IRQn = -12, /**< 4 Cortex-M7 Memory Management Interrupt */ - BusFault_IRQn = -11, /**< 5 Cortex-M7 Bus Fault Interrupt */ - UsageFault_IRQn = -10, /**< 6 Cortex-M7 Usage Fault Interrupt */ - SVCall_IRQn = -5, /**< 11 Cortex-M7 SV Call Interrupt */ - DebugMonitor_IRQn = -4, /**< 12 Cortex-M7 Debug Monitor Interrupt */ - PendSV_IRQn = -2, /**< 14 Cortex-M7 Pend SV Interrupt */ - SysTick_IRQn = -1, /**< 15 Cortex-M7 System Tick Interrupt */ -/****** SAMV71J20 specific Interrupt Numbers *********************************/ - - SUPC_IRQn = 0, /**< 0 SAMV71J20 Supply Controller (SUPC) */ - RSTC_IRQn = 1, /**< 1 SAMV71J20 Reset Controller (RSTC) */ - RTC_IRQn = 2, /**< 2 SAMV71J20 Real Time Clock (RTC) */ - RTT_IRQn = 3, /**< 3 SAMV71J20 Real Time Timer (RTT) */ - WDT_IRQn = 4, /**< 4 SAMV71J20 Watchdog Timer (WDT) */ - PMC_IRQn = 5, /**< 5 SAMV71J20 Power Management Controller (PMC) */ - EFC_IRQn = 6, /**< 6 SAMV71J20 Enhanced Embedded Flash Controller (EFC) */ - UART0_IRQn = 7, /**< 7 SAMV71J20 UART 0 (UART0) */ - UART1_IRQn = 8, /**< 8 SAMV71J20 UART 1 (UART1) */ - PIOA_IRQn = 10, /**< 10 SAMV71J20 Parallel I/O Controller A (PIOA) */ - PIOB_IRQn = 11, /**< 11 SAMV71J20 Parallel I/O Controller B (PIOB) */ - USART0_IRQn = 13, /**< 13 SAMV71J20 USART 0 (USART0) */ - USART1_IRQn = 14, /**< 14 SAMV71J20 USART 1 (USART1) */ - USART2_IRQn = 15, /**< 15 SAMV71J20 USART 2 (USART2) */ - PIOD_IRQn = 16, /**< 16 SAMV71J20 Parallel I/O Controller D (PIOD) */ - HSMCI_IRQn = 18, /**< 18 SAMV71J20 Multimedia Card Interface (HSMCI) */ - TWIHS0_IRQn = 19, /**< 19 SAMV71J20 Two Wire Interface 0 HS (TWIHS0) */ - TWIHS1_IRQn = 20, /**< 20 SAMV71J20 Two Wire Interface 1 HS (TWIHS1) */ - SPI0_IRQn = 21, /**< 21 SAMV71J20 Serial Peripheral Interface 0 (SPI0) */ - SSC_IRQn = 22, /**< 22 SAMV71J20 Synchronous Serial Controller (SSC) */ - TC0_IRQn = 23, /**< 23 SAMV71J20 Timer/Counter 0 (TC0) */ - TC1_IRQn = 24, /**< 24 SAMV71J20 Timer/Counter 1 (TC1) */ - TC2_IRQn = 25, /**< 25 SAMV71J20 Timer/Counter 2 (TC2) */ - AFEC0_IRQn = 29, /**< 29 SAMV71J20 Analog Front End 0 (AFEC0) */ - DACC_IRQn = 30, /**< 30 SAMV71J20 Digital To Analog Converter (DACC) */ - PWM0_IRQn = 31, /**< 31 SAMV71J20 Pulse Width Modulation 0 (PWM0) */ - ICM_IRQn = 32, /**< 32 SAMV71J20 Integrity Check Monitor (ICM) */ - ACC_IRQn = 33, /**< 33 SAMV71J20 Analog Comparator (ACC) */ - USBHS_IRQn = 34, /**< 34 SAMV71J20 USB Host / Device Controller (USBHS) */ - MCAN0_IRQn = 35, /**< 35 SAMV71J20 MCAN Controller 0 (MCAN0) */ - MCAN0_LINE1_IRQn = 36, /**< 36 SAMV71Q21 MCAN Controller 0 LINE1 (MCAN0) */ - MCAN1_IRQn = 37, /**< 37 SAMV71J20 MCAN Controller 1 (MCAN1) */ - MCAN1_LINE1_IRQn = 38, /**< 38 SAMV71Q21 MCAN Controller 1 LINE1 (MCAN1) */ - GMAC_IRQn = 39, /**< 39 SAMV71J20 Ethernet MAC (GMAC) */ - AFEC1_IRQn = 40, /**< 40 SAMV71J20 Analog Front End 1 (AFEC1) */ - SPI1_IRQn = 42, /**< 42 SAMV71J20 Serial Peripheral Interface 1 (SPI1) */ - QSPI_IRQn = 43, /**< 43 SAMV71J20 Quad I/O Serial Peripheral Interface (QSPI) */ - UART2_IRQn = 44, /**< 44 SAMV71J20 UART 2 (UART2) */ - UART3_IRQn = 45, /**< 45 SAMV71J20 UART 3 (UART3) */ - UART4_IRQn = 46, /**< 46 SAMV71J20 UART 4 (UART4) */ - TC9_IRQn = 50, /**< 50 SAMV71J20 Timer/Counter 9 (TC9) */ - TC10_IRQn = 51, /**< 51 SAMV71J20 Timer/Counter 10 (TC10) */ - TC11_IRQn = 52, /**< 52 SAMV71J20 Timer/Counter 11 (TC11) */ - MLB_IRQn = 53, /**< 53 SAMV71J20 MediaLB (MLB) */ - AES_IRQn = 56, /**< 56 SAMV71J20 AES (AES) */ - TRNG_IRQn = 57, /**< 57 SAMV71J20 True Random Generator (TRNG) */ - XDMAC_IRQn = 58, /**< 58 SAMV71J20 DMA (XDMAC) */ - ISI_IRQn = 59, /**< 59 SAMV71J20 Camera Interface (ISI) */ - PWM1_IRQn = 60, /**< 60 SAMV71J20 Pulse Width Modulation 1 (PWM1) */ - RSWDT_IRQn = 63, /**< 63 SAMV71J20 Reinforced Secure Watchdog Timer (RSWDT) */ - - PERIPH_COUNT_IRQn = 64 /**< Number of peripheral IDs */ -} IRQn_Type; - -typedef struct _DeviceVectors -{ - /* Stack pointer */ - void* pvStack; - - /* Cortex-M handlers */ - void* pfnReset_Handler; - void* pfnNMI_Handler; - void* pfnHardFault_Handler; - void* pfnMemManage_Handler; - void* pfnBusFault_Handler; - void* pfnUsageFault_Handler; - void* pfnReserved1_Handler; - void* pfnReserved2_Handler; - void* pfnReserved3_Handler; - void* pfnReserved4_Handler; - void* pfnSVC_Handler; - void* pfnDebugMon_Handler; - void* pfnReserved5_Handler; - void* pfnPendSV_Handler; - void* pfnSysTick_Handler; - - /* Peripheral handlers */ - void* pfnSUPC_Handler; /* 0 Supply Controller */ - void* pfnRSTC_Handler; /* 1 Reset Controller */ - void* pfnRTC_Handler; /* 2 Real Time Clock */ - void* pfnRTT_Handler; /* 3 Real Time Timer */ - void* pfnWDT_Handler; /* 4 Watchdog Timer */ - void* pfnPMC_Handler; /* 5 Power Management Controller */ - void* pfnEFC_Handler; /* 6 Enhanced Embedded Flash Controller */ - void* pfnUART0_Handler; /* 7 UART 0 */ - void* pfnUART1_Handler; /* 8 UART 1 */ - void* pvReserved9; - void* pfnPIOA_Handler; /* 10 Parallel I/O Controller A */ - void* pfnPIOB_Handler; /* 11 Parallel I/O Controller B */ - void* pvReserved12; - void* pfnUSART0_Handler; /* 13 USART 0 */ - void* pfnUSART1_Handler; /* 14 USART 1 */ - void* pfnUSART2_Handler; /* 15 USART 2 */ - void* pfnPIOD_Handler; /* 16 Parallel I/O Controller D */ - void* pvReserved17; - void* pfnHSMCI_Handler; /* 18 Multimedia Card Interface */ - void* pfnTWIHS0_Handler; /* 19 Two Wire Interface 0 HS */ - void* pfnTWIHS1_Handler; /* 20 Two Wire Interface 1 HS */ - void* pfnSPI0_Handler; /* 21 Serial Peripheral Interface 0 */ - void* pfnSSC_Handler; /* 22 Synchronous Serial Controller */ - void* pfnTC0_Handler; /* 23 Timer/Counter 0 */ - void* pfnTC1_Handler; /* 24 Timer/Counter 1 */ - void* pfnTC2_Handler; /* 25 Timer/Counter 2 */ - void* pvReserved26; - void* pvReserved27; - void* pvReserved28; - void* pfnAFEC0_Handler; /* 29 Analog Front End 0 */ - void* pfnDACC_Handler; /* 30 Digital To Analog Converter */ - void* pfnPWM0_Handler; /* 31 Pulse Width Modulation 0 */ - void* pfnICM_Handler; /* 32 Integrity Check Monitor */ - void* pfnACC_Handler; /* 33 Analog Comparator */ - void* pfnUSBHS_Handler; /* 34 USB Host / Device Controller */ - void* pfnMCAN0_Handler; /* 35 MCAN Controller 0 */ - void* pfnMCAN0_Line1_Handler; /* 36 MCAN Controller 0 */ - void* pfnMCAN1_Handler; /* 37 MCAN Controller 1 */ - void* pfnMCAN1_Line1_Handler; /* 38 MCAN Controller 1 */ - void* pfnGMAC_Handler; /* 39 Ethernet MAC */ - void* pfnAFEC1_Handler; /* 40 Analog Front End 1 */ - void* pvReserved41; - void* pfnSPI1_Handler; /* 42 Serial Peripheral Interface 1 */ - void* pfnQSPI_Handler; /* 43 Quad I/O Serial Peripheral Interface */ - void* pfnUART2_Handler; /* 44 UART 2 */ - void* pfnUART3_Handler; /* 45 UART 3 */ - void* pfnUART4_Handler; /* 46 UART 4 */ - void* pvReserved47; - void* pvReserved48; - void* pvReserved49; - void* pfnTC9_Handler; /* 50 Timer/Counter 9 */ - void* pfnTC10_Handler; /* 51 Timer/Counter 10 */ - void* pfnTC11_Handler; /* 52 Timer/Counter 11 */ - void* pfnMLB_Handler; /* 53 MediaLB */ - void* pvReserved54; - void* pvReserved55; - void* pfnAES_Handler; /* 56 AES */ - void* pfnTRNG_Handler; /* 57 True Random Generator */ - void* pfnXDMAC_Handler; /* 58 DMA */ - void* pfnISI_Handler; /* 59 Camera Interface */ - void* pfnPWM1_Handler; /* 60 Pulse Width Modulation 1 */ - void* pvReserved61; - void* pvReserved62; - void* pfnRSWDT_Handler; /* 63 Reinforced Secure Watchdog Timer */ -} DeviceVectors; - -/* Cortex-M7 core handlers */ -void Reset_Handler ( void ); -void NMI_Handler ( void ); -void HardFault_Handler ( void ); -void MemManage_Handler ( void ); -void BusFault_Handler ( void ); -void UsageFault_Handler ( void ); -void SVC_Handler ( void ); -void DebugMon_Handler ( void ); -void PendSV_Handler ( void ); -void SysTick_Handler ( void ); - -/* Peripherals handlers */ -void ACC_Handler ( void ); -void AES_Handler ( void ); -void AFEC0_Handler ( void ); -void AFEC1_Handler ( void ); -void DACC_Handler ( void ); -void EFC_Handler ( void ); -void GMAC_Handler ( void ); -void HSMCI_Handler ( void ); -void ICM_Handler ( void ); -void ISI_Handler ( void ); -void MCAN0_Handler ( void ); -void MCAN0_Line1_Handler( void ); -void MCAN1_Handler ( void ); -void MCAN1_Line1_Handler( void ); -void MLB_Handler ( void ); -void PIOA_Handler ( void ); -void PIOB_Handler ( void ); -void PIOD_Handler ( void ); -void PMC_Handler ( void ); -void PWM0_Handler ( void ); -void PWM1_Handler ( void ); -void QSPI_Handler ( void ); -void RSTC_Handler ( void ); -void RSWDT_Handler ( void ); -void RTC_Handler ( void ); -void RTT_Handler ( void ); -void SPI0_Handler ( void ); -void SPI1_Handler ( void ); -void SSC_Handler ( void ); -void SUPC_Handler ( void ); -void TC0_Handler ( void ); -void TC1_Handler ( void ); -void TC2_Handler ( void ); -void TC9_Handler ( void ); -void TC10_Handler ( void ); -void TC11_Handler ( void ); -void TRNG_Handler ( void ); -void TWIHS0_Handler ( void ); -void TWIHS1_Handler ( void ); -void UART0_Handler ( void ); -void UART1_Handler ( void ); -void UART2_Handler ( void ); -void UART3_Handler ( void ); -void UART4_Handler ( void ); -void USART0_Handler ( void ); -void USART1_Handler ( void ); -void USART2_Handler ( void ); -void USBHS_Handler ( void ); -void WDT_Handler ( void ); -void XDMAC_Handler ( void ); - -/** - * \brief Configuration of the Cortex-M7 Processor and Core Peripherals - */ - -#define __CM7_REV 0x0000 /**< SAMV71J20 core revision number ([15:8] revision number, [7:0] patch number) */ -#define __MPU_PRESENT 1 /**< SAMV71J20 does provide a MPU */ -#define __NVIC_PRIO_BITS 3 /**< SAMV71J20 uses 3 Bits for the Priority Levels */ -#define __FPU_PRESENT 1 /**< SAMV71J20 does provide a FPU */ -#define __FPU_DP 1 /**< SAMV71J20 Double precision FPU */ -#define __ICACHE_PRESENT 1 /**< SAMV71J20 does provide an Instruction Cache */ -#define __DCACHE_PRESENT 1 /**< SAMV71J20 does provide a Data Cache */ -#define __DTCM_PRESENT 1 /**< SAMV71J20 does provide a Data TCM */ -#define __ITCM_PRESENT 1 /**< SAMV71J20 does provide an Instruction TCM */ -#define __Vendor_SysTickConfig 0 /**< Set to 1 if different SysTick Config is used */ - -/* - * \brief CMSIS includes - */ - -#include -#if !defined DONT_USE_CMSIS_INIT -#include "system_samv71.h" -#endif /* DONT_USE_CMSIS_INIT */ - -/*@}*/ - -/* ************************************************************************** */ -/** SOFTWARE PERIPHERAL API DEFINITION FOR SAMV71J20 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71J20_api Peripheral Software API */ -/*@{*/ - -#include "component/component_acc.h" -#include "component/component_aes.h" -#include "component/component_afec.h" -#include "component/component_chipid.h" -#include "component/component_dacc.h" -#include "component/component_efc.h" -#include "component/component_gmac.h" -#include "component/component_gpbr.h" -#include "component/component_hsmci.h" -#include "component/component_icm.h" -#include "component/component_isi.h" -#include "component/component_matrix.h" -#include "component/component_mcan.h" -#include "component/component_mlb.h" -#include "component/component_pio.h" -#include "component/component_pmc.h" -#include "component/component_pwm.h" -#include "component/component_qspi.h" -#include "component/component_rstc.h" -#include "component/component_rswdt.h" -#include "component/component_rtc.h" -#include "component/component_rtt.h" -#include "component/component_spi.h" -#include "component/component_ssc.h" -#include "component/component_supc.h" -#include "component/component_tc.h" -#include "component/component_trng.h" -#include "component/component_twihs.h" -#include "component/component_uart.h" -#include "component/component_usart.h" -#include "component/component_usbhs.h" -#include "component/component_utmi.h" -#include "component/component_wdt.h" -#include "component/component_xdmac.h" -/*@}*/ - -/* ************************************************************************** */ -/* REGISTER ACCESS DEFINITIONS FOR SAMV71J20 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71J20_reg Registers Access Definitions */ -/*@{*/ - -#include "instance/instance_hsmci.h" -#include "instance/instance_ssc.h" -#include "instance/instance_spi0.h" -#include "instance/instance_tc0.h" -#include "instance/instance_twihs0.h" -#include "instance/instance_twihs1.h" -#include "instance/instance_pwm0.h" -#include "instance/instance_usart0.h" -#include "instance/instance_usart1.h" -#include "instance/instance_usart2.h" -#include "instance/instance_mcan0.h" -#include "instance/instance_mcan1.h" -#include "instance/instance_usbhs.h" -#include "instance/instance_afec0.h" -#include "instance/instance_dacc.h" -#include "instance/instance_acc.h" -#include "instance/instance_icm.h" -#include "instance/instance_isi.h" -#include "instance/instance_gmac.h" -#include "instance/instance_tc3.h" -#include "instance/instance_spi1.h" -#include "instance/instance_pwm1.h" -#include "instance/instance_afec1.h" -#include "instance/instance_mlb.h" -#include "instance/instance_aes.h" -#include "instance/instance_trng.h" -#include "instance/instance_xdmac.h" -#include "instance/instance_qspi.h" -#include "instance/instance_matrix.h" -#include "instance/instance_utmi.h" -#include "instance/instance_pmc.h" -#include "instance/instance_uart0.h" -#include "instance/instance_chipid.h" -#include "instance/instance_uart1.h" -#include "instance/instance_efc.h" -#include "instance/instance_pioa.h" -#include "instance/instance_piob.h" -#include "instance/instance_piod.h" -#include "instance/instance_rstc.h" -#include "instance/instance_supc.h" -#include "instance/instance_rtt.h" -#include "instance/instance_wdt.h" -#include "instance/instance_rtc.h" -#include "instance/instance_gpbr.h" -#include "instance/instance_rswdt.h" -#include "instance/instance_uart2.h" -#include "instance/instance_uart3.h" -#include "instance/instance_uart4.h" -/*@}*/ - -/* ************************************************************************** */ -/* PERIPHERAL ID DEFINITIONS FOR SAMV71J20 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71J20_id Peripheral Ids Definitions */ -/*@{*/ - -#define ID_SUPC ( 0) /**< \brief Supply Controller (SUPC) */ -#define ID_RSTC ( 1) /**< \brief Reset Controller (RSTC) */ -#define ID_RTC ( 2) /**< \brief Real Time Clock (RTC) */ -#define ID_RTT ( 3) /**< \brief Real Time Timer (RTT) */ -#define ID_WDT ( 4) /**< \brief Watchdog Timer (WDT) */ -#define ID_PMC ( 5) /**< \brief Power Management Controller (PMC) */ -#define ID_EFC ( 6) /**< \brief Enhanced Embedded Flash Controller (EFC) */ -#define ID_UART0 ( 7) /**< \brief UART 0 (UART0) */ -#define ID_UART1 ( 8) /**< \brief UART 1 (UART1) */ -#define ID_PIOA (10) /**< \brief Parallel I/O Controller A (PIOA) */ -#define ID_PIOB (11) /**< \brief Parallel I/O Controller B (PIOB) */ -#define ID_USART0 (13) /**< \brief USART 0 (USART0) */ -#define ID_USART1 (14) /**< \brief USART 1 (USART1) */ -#define ID_USART2 (15) /**< \brief USART 2 (USART2) */ -#define ID_PIOD (16) /**< \brief Parallel I/O Controller D (PIOD) */ -#define ID_HSMCI (18) /**< \brief Multimedia Card Interface (HSMCI) */ -#define ID_TWIHS0 (19) /**< \brief Two Wire Interface 0 HS (TWIHS0) */ -#define ID_TWIHS1 (20) /**< \brief Two Wire Interface 1 HS (TWIHS1) */ -#define ID_SPI0 (21) /**< \brief Serial Peripheral Interface 0 (SPI0) */ -#define ID_SSC (22) /**< \brief Synchronous Serial Controller (SSC) */ -#define ID_TC0 (23) /**< \brief Timer/Counter 0 (TC0) */ -#define ID_TC1 (24) /**< \brief Timer/Counter 1 (TC1) */ -#define ID_TC2 (25) /**< \brief Timer/Counter 2 (TC2) */ -#define ID_AFEC0 (29) /**< \brief Analog Front End 0 (AFEC0) */ -#define ID_DACC (30) /**< \brief Digital To Analog Converter (DACC) */ -#define ID_PWM0 (31) /**< \brief Pulse Width Modulation 0 (PWM0) */ -#define ID_ICM (32) /**< \brief Integrity Check Monitor (ICM) */ -#define ID_ACC (33) /**< \brief Analog Comparator (ACC) */ -#define ID_USBHS (34) /**< \brief USB Host / Device Controller (USBHS) */ -#define ID_MCAN0 (35) /**< \brief MCAN Controller 0 (MCAN0) */ -#define ID_MCAN1 (37) /**< \brief MCAN Controller 1 (MCAN1) */ -#define ID_GMAC (39) /**< \brief Ethernet MAC (GMAC) */ -#define ID_AFEC1 (40) /**< \brief Analog Front End 1 (AFEC1) */ -#define ID_SPI1 (42) /**< \brief Serial Peripheral Interface 1 (SPI1) */ -#define ID_QSPI (43) /**< \brief Quad I/O Serial Peripheral Interface (QSPI) */ -#define ID_UART2 (44) /**< \brief UART 2 (UART2) */ -#define ID_UART3 (45) /**< \brief UART 3 (UART3) */ -#define ID_UART4 (46) /**< \brief UART 4 (UART4) */ -#define ID_TC9 (50) /**< \brief Timer/Counter 9 (TC9) */ -#define ID_TC10 (51) /**< \brief Timer/Counter 10 (TC10) */ -#define ID_TC11 (52) /**< \brief Timer/Counter 11 (TC11) */ -#define ID_MLB (53) /**< \brief MediaLB (MLB) */ -#define ID_AES (56) /**< \brief AES (AES) */ -#define ID_TRNG (57) /**< \brief True Random Generator (TRNG) */ -#define ID_XDMAC (58) /**< \brief DMA (XDMAC) */ -#define ID_ISI (59) /**< \brief Camera Interface (ISI) */ -#define ID_PWM1 (60) /**< \brief Pulse Width Modulation 1 (PWM1) */ -#define ID_RSWDT (63) /**< \brief Reinforced Secure Watchdog Timer (RSWDT) */ - -#define ID_PERIPH_COUNT (64) /**< \brief Number of peripheral IDs */ -/*@}*/ - -/* ************************************************************************** */ -/* BASE ADDRESS DEFINITIONS FOR SAMV71J20 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71J20_base Peripheral Base Address Definitions */ -/*@{*/ - -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -#define HSMCI (0x40000000U) /**< \brief (HSMCI ) Base Address */ -#define SSC (0x40004000U) /**< \brief (SSC ) Base Address */ -#define SPI0 (0x40008000U) /**< \brief (SPI0 ) Base Address */ -#define TC0 (0x4000C000U) /**< \brief (TC0 ) Base Address */ -#define TWIHS0 (0x40018000U) /**< \brief (TWIHS0) Base Address */ -#define TWIHS1 (0x4001C000U) /**< \brief (TWIHS1) Base Address */ -#define PWM0 (0x40020000U) /**< \brief (PWM0 ) Base Address */ -#define USART0 (0x40024000U) /**< \brief (USART0) Base Address */ -#define USART1 (0x40028000U) /**< \brief (USART1) Base Address */ -#define USART2 (0x4002C000U) /**< \brief (USART2) Base Address */ -#define MCAN0 (0x40030000U) /**< \brief (MCAN0 ) Base Address */ -#define MCAN1 (0x40034000U) /**< \brief (MCAN1 ) Base Address */ -#define USBHS (0x40038000U) /**< \brief (USBHS ) Base Address */ -#define AFEC0 (0x4003C000U) /**< \brief (AFEC0 ) Base Address */ -#define DACC (0x40040000U) /**< \brief (DACC ) Base Address */ -#define ACC (0x40044000U) /**< \brief (ACC ) Base Address */ -#define ICM (0x40048000U) /**< \brief (ICM ) Base Address */ -#define ISI (0x4004C000U) /**< \brief (ISI ) Base Address */ -#define GMAC (0x40050000U) /**< \brief (GMAC ) Base Address */ -#define TC3 (0x40054000U) /**< \brief (TC3 ) Base Address */ -#define SPI1 (0x40058000U) /**< \brief (SPI1 ) Base Address */ -#define PWM1 (0x4005C000U) /**< \brief (PWM1 ) Base Address */ -#define AFEC1 (0x40064000U) /**< \brief (AFEC1 ) Base Address */ -#define MLB (0x40068000U) /**< \brief (MLB ) Base Address */ -#define AES (0x4006C000U) /**< \brief (AES ) Base Address */ -#define TRNG (0x40070000U) /**< \brief (TRNG ) Base Address */ -#define XDMAC (0x40078000U) /**< \brief (XDMAC ) Base Address */ -#define QSPI (0x4007C000U) /**< \brief (QSPI ) Base Address */ -#define MATRIX (0x40088000U) /**< \brief (MATRIX) Base Address */ -#define UTMI (0x400E0400U) /**< \brief (UTMI ) Base Address */ -#define PMC (0x400E0600U) /**< \brief (PMC ) Base Address */ -#define UART0 (0x400E0800U) /**< \brief (UART0 ) Base Address */ -#define CHIPID (0x400E0940U) /**< \brief (CHIPID) Base Address */ -#define UART1 (0x400E0A00U) /**< \brief (UART1 ) Base Address */ -#define EFC (0x400E0C00U) /**< \brief (EFC ) Base Address */ -#define PIOA (0x400E0E00U) /**< \brief (PIOA ) Base Address */ -#define PIOB (0x400E1000U) /**< \brief (PIOB ) Base Address */ -#define PIOD (0x400E1400U) /**< \brief (PIOD ) Base Address */ -#define RSTC (0x400E1800U) /**< \brief (RSTC ) Base Address */ -#define SUPC (0x400E1810U) /**< \brief (SUPC ) Base Address */ -#define RTT (0x400E1830U) /**< \brief (RTT ) Base Address */ -#define WDT (0x400E1850U) /**< \brief (WDT ) Base Address */ -#define RTC (0x400E1860U) /**< \brief (RTC ) Base Address */ -#define GPBR (0x400E1890U) /**< \brief (GPBR ) Base Address */ -#define RSWDT (0x400E1900U) /**< \brief (RSWDT ) Base Address */ -#define UART2 (0x400E1A00U) /**< \brief (UART2 ) Base Address */ -#define UART3 (0x400E1C00U) /**< \brief (UART3 ) Base Address */ -#define UART4 (0x400E1E00U) /**< \brief (UART4 ) Base Address */ -#else -#define HSMCI ((Hsmci *)0x40000000U) /**< \brief (HSMCI ) Base Address */ -#define SSC ((Ssc *)0x40004000U) /**< \brief (SSC ) Base Address */ -#define SPI0 ((Spi *)0x40008000U) /**< \brief (SPI0 ) Base Address */ -#define TC0 ((Tc *)0x4000C000U) /**< \brief (TC0 ) Base Address */ -#define TWIHS0 ((Twihs *)0x40018000U) /**< \brief (TWIHS0) Base Address */ -#define TWIHS1 ((Twihs *)0x4001C000U) /**< \brief (TWIHS1) Base Address */ -#define PWM0 ((Pwm *)0x40020000U) /**< \brief (PWM0 ) Base Address */ -#define USART0 ((Usart *)0x40024000U) /**< \brief (USART0) Base Address */ -#define USART1 ((Usart *)0x40028000U) /**< \brief (USART1) Base Address */ -#define USART2 ((Usart *)0x4002C000U) /**< \brief (USART2) Base Address */ -#define MCAN0 ((Mcan *)0x40030000U) /**< \brief (MCAN0 ) Base Address */ -#define MCAN1 ((Mcan *)0x40034000U) /**< \brief (MCAN1 ) Base Address */ -#define USBHS ((Usbhs *)0x40038000U) /**< \brief (USBHS ) Base Address */ -#define AFEC0 ((Afec *)0x4003C000U) /**< \brief (AFEC0 ) Base Address */ -#define DACC ((Dacc *)0x40040000U) /**< \brief (DACC ) Base Address */ -#define ACC ((Acc *)0x40044000U) /**< \brief (ACC ) Base Address */ -#define ICM ((Icm *)0x40048000U) /**< \brief (ICM ) Base Address */ -#define ISI ((Isi *)0x4004C000U) /**< \brief (ISI ) Base Address */ -#define GMAC ((Gmac *)0x40050000U) /**< \brief (GMAC ) Base Address */ -#define TC3 ((Tc *)0x40054000U) /**< \brief (TC3 ) Base Address */ -#define SPI1 ((Spi *)0x40058000U) /**< \brief (SPI1 ) Base Address */ -#define PWM1 ((Pwm *)0x4005C000U) /**< \brief (PWM1 ) Base Address */ -#define AFEC1 ((Afec *)0x40064000U) /**< \brief (AFEC1 ) Base Address */ -#define MLB ((Mlb *)0x40068000U) /**< \brief (MLB ) Base Address */ -#define AES ((Aes *)0x4006C000U) /**< \brief (AES ) Base Address */ -#define TRNG ((Trng *)0x40070000U) /**< \brief (TRNG ) Base Address */ -#define XDMAC ((Xdmac *)0x40078000U) /**< \brief (XDMAC ) Base Address */ -#define QSPI ((Qspi *)0x4007C000U) /**< \brief (QSPI ) Base Address */ -#define MATRIX ((Matrix *)0x40088000U) /**< \brief (MATRIX) Base Address */ -#define UTMI ((Utmi *)0x400E0400U) /**< \brief (UTMI ) Base Address */ -#define PMC ((Pmc *)0x400E0600U) /**< \brief (PMC ) Base Address */ -#define UART0 ((Uart *)0x400E0800U) /**< \brief (UART0 ) Base Address */ -#define CHIPID ((Chipid *)0x400E0940U) /**< \brief (CHIPID) Base Address */ -#define UART1 ((Uart *)0x400E0A00U) /**< \brief (UART1 ) Base Address */ -#define EFC ((Efc *)0x400E0C00U) /**< \brief (EFC ) Base Address */ -#define PIOA ((Pio *)0x400E0E00U) /**< \brief (PIOA ) Base Address */ -#define PIOB ((Pio *)0x400E1000U) /**< \brief (PIOB ) Base Address */ -#define PIOD ((Pio *)0x400E1400U) /**< \brief (PIOD ) Base Address */ -#define RSTC ((Rstc *)0x400E1800U) /**< \brief (RSTC ) Base Address */ -#define SUPC ((Supc *)0x400E1810U) /**< \brief (SUPC ) Base Address */ -#define RTT ((Rtt *)0x400E1830U) /**< \brief (RTT ) Base Address */ -#define WDT ((Wdt *)0x400E1850U) /**< \brief (WDT ) Base Address */ -#define RTC ((Rtc *)0x400E1860U) /**< \brief (RTC ) Base Address */ -#define GPBR ((Gpbr *)0x400E1890U) /**< \brief (GPBR ) Base Address */ -#define RSWDT ((Rswdt *)0x400E1900U) /**< \brief (RSWDT ) Base Address */ -#define UART2 ((Uart *)0x400E1A00U) /**< \brief (UART2 ) Base Address */ -#define UART3 ((Uart *)0x400E1C00U) /**< \brief (UART3 ) Base Address */ -#define UART4 ((Uart *)0x400E1E00U) /**< \brief (UART4 ) Base Address */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/*@}*/ - -/* ************************************************************************** */ -/* PIO DEFINITIONS FOR SAMV71J20 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71J20_pio Peripheral Pio Definitions */ -/*@{*/ - -#include "pio/pio_samv71j20.h" -/*@}*/ - -/* ************************************************************************** */ -/* MEMORY MAPPING DEFINITIONS FOR SAMV71J20 */ -/* ************************************************************************** */ - -#define IFLASH_SIZE (0x100000u) -#define IFLASH_PAGE_SIZE (512u) -#define IFLASH_LOCK_REGION_SIZE (16384u) -#define IFLASH_NB_OF_PAGES (2048u) -#define IFLASH_NB_OF_LOCK_BITS (64u) -#define IRAM_SIZE (0x60000u) - -#define QSPIMEM_ADDR (0x80000000u) /**< QSPI Memory base address */ -#define AXIMX_ADDR (0xA0000000u) /**< AXI Bus Matrix base address */ -#define ITCM_ADDR (0x00000000u) /**< Instruction Tightly Coupled Memory base address */ -#define IFLASH_ADDR (0x00400000u) /**< Internal Flash base address */ -#define IROM_ADDR (0x00800000u) /**< Internal ROM base address */ -#define DTCM_ADDR (0x20000000u) /**< Data Tightly Coupled Memory base address */ -#define IRAM_ADDR (0x20400000u) /**< Internal RAM base address */ -#define EBI_CS0_ADDR (0x60000000u) /**< EBI Chip Select 0 base address */ -#define EBI_CS1_ADDR (0x61000000u) /**< EBI Chip Select 1 base address */ -#define EBI_CS2_ADDR (0x62000000u) /**< EBI Chip Select 2 base address */ -#define EBI_CS3_ADDR (0x63000000u) /**< EBI Chip Select 3 base address */ -#define SDRAM_CS_ADDR (0x70000000u) /**< SDRAM Chip Select base address */ - -/* ************************************************************************** */ -/* MISCELLANEOUS DEFINITIONS FOR SAMV71J20 */ -/* ************************************************************************** */ - -#define CHIP_JTAGID (0x05B3D03FUL) -#define CHIP_CIDR (0xA1220C00UL) -#define CHIP_EXID (0x00000000UL) - -/* ************************************************************************** */ -/* ELECTRICAL DEFINITIONS FOR SAMV71J20 */ -/* ************************************************************************** */ - -/* %ATMEL_ELECTRICAL% */ - -/* Device characteristics */ -#define CHIP_FREQ_SLCK_RC_MIN (20000UL) -#define CHIP_FREQ_SLCK_RC (32000UL) -#define CHIP_FREQ_SLCK_RC_MAX (44000UL) -#define CHIP_FREQ_MAINCK_RC_4MHZ (4000000UL) -#define CHIP_FREQ_MAINCK_RC_8MHZ (8000000UL) -#define CHIP_FREQ_MAINCK_RC_12MHZ (12000000UL) -#define CHIP_FREQ_CPU_MAX (300000000UL) -#define CHIP_FREQ_XTAL_32K (32768UL) -#define CHIP_FREQ_XTAL_12M (12000000UL) - -/* Embedded Flash Read Wait State (VDDCORE set at 1.20V) */ -#define CHIP_FREQ_FWS_0 (26000000UL) /**< \brief Maximum operating frequency when FWS is 0 */ -#define CHIP_FREQ_FWS_1 (52000000UL) /**< \brief Maximum operating frequency when FWS is 1 */ -#define CHIP_FREQ_FWS_2 (78000000UL) /**< \brief Maximum operating frequency when FWS is 2 */ -#define CHIP_FREQ_FWS_3 (104000000UL) /**< \brief Maximum operating frequency when FWS is 3 */ -#define CHIP_FREQ_FWS_4 (131000000UL) /**< \brief Maximum operating frequency when FWS is 4 */ -#define CHIP_FREQ_FWS_5 (150000000UL) /**< \brief Maximum operating frequency when FWS is 5 */ - - -#ifdef __cplusplus -} -#endif - -/*@}*/ - -#endif /* _SAMV71J20_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/samv71j21.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/samv71j21.h deleted file mode 100644 index 4d5c946a..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/samv71j21.h +++ /dev/null @@ -1,639 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71J21_ -#define _SAMV71J21_ - -/** \addtogroup SAMV71J21_definitions SAMV71J21 definitions - This file defines all structures and symbols for SAMV71J21: - - registers and bit-fields - - peripheral base address - - peripheral ID - - PIO definitions -*/ -/*@{*/ - -#ifdef __cplusplus - extern "C" { -#endif - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -#include -#endif - -/* ************************************************************************** */ -/* CMSIS DEFINITIONS FOR SAMV71J21 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71J21_cmsis CMSIS Definitions */ -/*@{*/ - -/**< Interrupt Number Definition */ -typedef enum IRQn -{ -/****** Cortex-M7 Processor Exceptions Numbers ******************************/ - NonMaskableInt_IRQn = -14, /**< 2 Non Maskable Interrupt */ - HardFault_IRQn = -13, /**< 3 HardFault Interrupt */ - MemoryManagement_IRQn = -12, /**< 4 Cortex-M7 Memory Management Interrupt */ - BusFault_IRQn = -11, /**< 5 Cortex-M7 Bus Fault Interrupt */ - UsageFault_IRQn = -10, /**< 6 Cortex-M7 Usage Fault Interrupt */ - SVCall_IRQn = -5, /**< 11 Cortex-M7 SV Call Interrupt */ - DebugMonitor_IRQn = -4, /**< 12 Cortex-M7 Debug Monitor Interrupt */ - PendSV_IRQn = -2, /**< 14 Cortex-M7 Pend SV Interrupt */ - SysTick_IRQn = -1, /**< 15 Cortex-M7 System Tick Interrupt */ -/****** SAMV71J21 specific Interrupt Numbers *********************************/ - - SUPC_IRQn = 0, /**< 0 SAMV71J21 Supply Controller (SUPC) */ - RSTC_IRQn = 1, /**< 1 SAMV71J21 Reset Controller (RSTC) */ - RTC_IRQn = 2, /**< 2 SAMV71J21 Real Time Clock (RTC) */ - RTT_IRQn = 3, /**< 3 SAMV71J21 Real Time Timer (RTT) */ - WDT_IRQn = 4, /**< 4 SAMV71J21 Watchdog Timer (WDT) */ - PMC_IRQn = 5, /**< 5 SAMV71J21 Power Management Controller (PMC) */ - EFC_IRQn = 6, /**< 6 SAMV71J21 Enhanced Embedded Flash Controller (EFC) */ - UART0_IRQn = 7, /**< 7 SAMV71J21 UART 0 (UART0) */ - UART1_IRQn = 8, /**< 8 SAMV71J21 UART 1 (UART1) */ - PIOA_IRQn = 10, /**< 10 SAMV71J21 Parallel I/O Controller A (PIOA) */ - PIOB_IRQn = 11, /**< 11 SAMV71J21 Parallel I/O Controller B (PIOB) */ - USART0_IRQn = 13, /**< 13 SAMV71J21 USART 0 (USART0) */ - USART1_IRQn = 14, /**< 14 SAMV71J21 USART 1 (USART1) */ - USART2_IRQn = 15, /**< 15 SAMV71J21 USART 2 (USART2) */ - PIOD_IRQn = 16, /**< 16 SAMV71J21 Parallel I/O Controller D (PIOD) */ - HSMCI_IRQn = 18, /**< 18 SAMV71J21 Multimedia Card Interface (HSMCI) */ - TWIHS0_IRQn = 19, /**< 19 SAMV71J21 Two Wire Interface 0 HS (TWIHS0) */ - TWIHS1_IRQn = 20, /**< 20 SAMV71J21 Two Wire Interface 1 HS (TWIHS1) */ - SPI0_IRQn = 21, /**< 21 SAMV71J21 Serial Peripheral Interface 0 (SPI0) */ - SSC_IRQn = 22, /**< 22 SAMV71J21 Synchronous Serial Controller (SSC) */ - TC0_IRQn = 23, /**< 23 SAMV71J21 Timer/Counter 0 (TC0) */ - TC1_IRQn = 24, /**< 24 SAMV71J21 Timer/Counter 1 (TC1) */ - TC2_IRQn = 25, /**< 25 SAMV71J21 Timer/Counter 2 (TC2) */ - AFEC0_IRQn = 29, /**< 29 SAMV71J21 Analog Front End 0 (AFEC0) */ - DACC_IRQn = 30, /**< 30 SAMV71J21 Digital To Analog Converter (DACC) */ - PWM0_IRQn = 31, /**< 31 SAMV71J21 Pulse Width Modulation 0 (PWM0) */ - ICM_IRQn = 32, /**< 32 SAMV71J21 Integrity Check Monitor (ICM) */ - ACC_IRQn = 33, /**< 33 SAMV71J21 Analog Comparator (ACC) */ - USBHS_IRQn = 34, /**< 34 SAMV71J21 USB Host / Device Controller (USBHS) */ - MCAN0_IRQn = 35, /**< 35 SAMV71J21 MCAN Controller 0 (MCAN0) */ - MCAN0_LINE1_IRQn = 36, /**< 36 SAMV71Q21 MCAN Controller 0 LINE1 (MCAN0) */ - MCAN1_IRQn = 37, /**< 37 SAMV71J21 MCAN Controller 1 (MCAN1) */ - MCAN1_LINE1_IRQn = 38, /**< 38 SAMV71Q21 MCAN Controller 1 LINE1 (MCAN1) */ - GMAC_IRQn = 39, /**< 39 SAMV71J21 Ethernet MAC (GMAC) */ - AFEC1_IRQn = 40, /**< 40 SAMV71J21 Analog Front End 1 (AFEC1) */ - SPI1_IRQn = 42, /**< 42 SAMV71J21 Serial Peripheral Interface 1 (SPI1) */ - QSPI_IRQn = 43, /**< 43 SAMV71J21 Quad I/O Serial Peripheral Interface (QSPI) */ - UART2_IRQn = 44, /**< 44 SAMV71J21 UART 2 (UART2) */ - UART3_IRQn = 45, /**< 45 SAMV71J21 UART 3 (UART3) */ - UART4_IRQn = 46, /**< 46 SAMV71J21 UART 4 (UART4) */ - TC9_IRQn = 50, /**< 50 SAMV71J21 Timer/Counter 9 (TC9) */ - TC10_IRQn = 51, /**< 51 SAMV71J21 Timer/Counter 10 (TC10) */ - TC11_IRQn = 52, /**< 52 SAMV71J21 Timer/Counter 11 (TC11) */ - MLB_IRQn = 53, /**< 53 SAMV71J21 MediaLB (MLB) */ - AES_IRQn = 56, /**< 56 SAMV71J21 AES (AES) */ - TRNG_IRQn = 57, /**< 57 SAMV71J21 True Random Generator (TRNG) */ - XDMAC_IRQn = 58, /**< 58 SAMV71J21 DMA (XDMAC) */ - ISI_IRQn = 59, /**< 59 SAMV71J21 Camera Interface (ISI) */ - PWM1_IRQn = 60, /**< 60 SAMV71J21 Pulse Width Modulation 1 (PWM1) */ - RSWDT_IRQn = 63, /**< 63 SAMV71J21 Reinforced Secure Watchdog Timer (RSWDT) */ - - PERIPH_COUNT_IRQn = 64 /**< Number of peripheral IDs */ -} IRQn_Type; - -typedef struct _DeviceVectors -{ - /* Stack pointer */ - void* pvStack; - - /* Cortex-M handlers */ - void* pfnReset_Handler; - void* pfnNMI_Handler; - void* pfnHardFault_Handler; - void* pfnMemManage_Handler; - void* pfnBusFault_Handler; - void* pfnUsageFault_Handler; - void* pfnReserved1_Handler; - void* pfnReserved2_Handler; - void* pfnReserved3_Handler; - void* pfnReserved4_Handler; - void* pfnSVC_Handler; - void* pfnDebugMon_Handler; - void* pfnReserved5_Handler; - void* pfnPendSV_Handler; - void* pfnSysTick_Handler; - - /* Peripheral handlers */ - void* pfnSUPC_Handler; /* 0 Supply Controller */ - void* pfnRSTC_Handler; /* 1 Reset Controller */ - void* pfnRTC_Handler; /* 2 Real Time Clock */ - void* pfnRTT_Handler; /* 3 Real Time Timer */ - void* pfnWDT_Handler; /* 4 Watchdog Timer */ - void* pfnPMC_Handler; /* 5 Power Management Controller */ - void* pfnEFC_Handler; /* 6 Enhanced Embedded Flash Controller */ - void* pfnUART0_Handler; /* 7 UART 0 */ - void* pfnUART1_Handler; /* 8 UART 1 */ - void* pvReserved9; - void* pfnPIOA_Handler; /* 10 Parallel I/O Controller A */ - void* pfnPIOB_Handler; /* 11 Parallel I/O Controller B */ - void* pvReserved12; - void* pfnUSART0_Handler; /* 13 USART 0 */ - void* pfnUSART1_Handler; /* 14 USART 1 */ - void* pfnUSART2_Handler; /* 15 USART 2 */ - void* pfnPIOD_Handler; /* 16 Parallel I/O Controller D */ - void* pvReserved17; - void* pfnHSMCI_Handler; /* 18 Multimedia Card Interface */ - void* pfnTWIHS0_Handler; /* 19 Two Wire Interface 0 HS */ - void* pfnTWIHS1_Handler; /* 20 Two Wire Interface 1 HS */ - void* pfnSPI0_Handler; /* 21 Serial Peripheral Interface 0 */ - void* pfnSSC_Handler; /* 22 Synchronous Serial Controller */ - void* pfnTC0_Handler; /* 23 Timer/Counter 0 */ - void* pfnTC1_Handler; /* 24 Timer/Counter 1 */ - void* pfnTC2_Handler; /* 25 Timer/Counter 2 */ - void* pvReserved26; - void* pvReserved27; - void* pvReserved28; - void* pfnAFEC0_Handler; /* 29 Analog Front End 0 */ - void* pfnDACC_Handler; /* 30 Digital To Analog Converter */ - void* pfnPWM0_Handler; /* 31 Pulse Width Modulation 0 */ - void* pfnICM_Handler; /* 32 Integrity Check Monitor */ - void* pfnACC_Handler; /* 33 Analog Comparator */ - void* pfnUSBHS_Handler; /* 34 USB Host / Device Controller */ - void* pfnMCAN0_Handler; /* 35 MCAN Controller 0 */ - void* pfnMCAN0_Line1_Handler; /* 36 MCAN Controller 0 */ - void* pfnMCAN1_Handler; /* 37 MCAN Controller 1 */ - void* pfnMCAN1_Line1_Handler; /* 38 MCAN Controller 1 */ - void* pfnGMAC_Handler; /* 39 Ethernet MAC */ - void* pfnAFEC1_Handler; /* 40 Analog Front End 1 */ - void* pvReserved41; - void* pfnSPI1_Handler; /* 42 Serial Peripheral Interface 1 */ - void* pfnQSPI_Handler; /* 43 Quad I/O Serial Peripheral Interface */ - void* pfnUART2_Handler; /* 44 UART 2 */ - void* pfnUART3_Handler; /* 45 UART 3 */ - void* pfnUART4_Handler; /* 46 UART 4 */ - void* pvReserved47; - void* pvReserved48; - void* pvReserved49; - void* pfnTC9_Handler; /* 50 Timer/Counter 9 */ - void* pfnTC10_Handler; /* 51 Timer/Counter 10 */ - void* pfnTC11_Handler; /* 52 Timer/Counter 11 */ - void* pfnMLB_Handler; /* 53 MediaLB */ - void* pvReserved54; - void* pvReserved55; - void* pfnAES_Handler; /* 56 AES */ - void* pfnTRNG_Handler; /* 57 True Random Generator */ - void* pfnXDMAC_Handler; /* 58 DMA */ - void* pfnISI_Handler; /* 59 Camera Interface */ - void* pfnPWM1_Handler; /* 60 Pulse Width Modulation 1 */ - void* pvReserved61; - void* pvReserved62; - void* pfnRSWDT_Handler; /* 63 Reinforced Secure Watchdog Timer */ -} DeviceVectors; - -/* Cortex-M7 core handlers */ -void Reset_Handler ( void ); -void NMI_Handler ( void ); -void HardFault_Handler ( void ); -void MemManage_Handler ( void ); -void BusFault_Handler ( void ); -void UsageFault_Handler ( void ); -void SVC_Handler ( void ); -void DebugMon_Handler ( void ); -void PendSV_Handler ( void ); -void SysTick_Handler ( void ); - -/* Peripherals handlers */ -void ACC_Handler ( void ); -void AES_Handler ( void ); -void AFEC0_Handler ( void ); -void AFEC1_Handler ( void ); -void DACC_Handler ( void ); -void EFC_Handler ( void ); -void GMAC_Handler ( void ); -void HSMCI_Handler ( void ); -void ICM_Handler ( void ); -void ISI_Handler ( void ); -void MCAN0_Handler ( void ); -void MCAN0_Line1_Handler( void ); -void MCAN1_Handler ( void ); -void MCAN1_Line1_Handler( void ); -void MLB_Handler ( void ); -void PIOA_Handler ( void ); -void PIOB_Handler ( void ); -void PIOD_Handler ( void ); -void PMC_Handler ( void ); -void PWM0_Handler ( void ); -void PWM1_Handler ( void ); -void QSPI_Handler ( void ); -void RSTC_Handler ( void ); -void RSWDT_Handler ( void ); -void RTC_Handler ( void ); -void RTT_Handler ( void ); -void SPI0_Handler ( void ); -void SPI1_Handler ( void ); -void SSC_Handler ( void ); -void SUPC_Handler ( void ); -void TC0_Handler ( void ); -void TC1_Handler ( void ); -void TC2_Handler ( void ); -void TC9_Handler ( void ); -void TC10_Handler ( void ); -void TC11_Handler ( void ); -void TRNG_Handler ( void ); -void TWIHS0_Handler ( void ); -void TWIHS1_Handler ( void ); -void UART0_Handler ( void ); -void UART1_Handler ( void ); -void UART2_Handler ( void ); -void UART3_Handler ( void ); -void UART4_Handler ( void ); -void USART0_Handler ( void ); -void USART1_Handler ( void ); -void USART2_Handler ( void ); -void USBHS_Handler ( void ); -void WDT_Handler ( void ); -void XDMAC_Handler ( void ); - -/** - * \brief Configuration of the Cortex-M7 Processor and Core Peripherals - */ - -#define __CM7_REV 0x0000 /**< SAMV71J21 core revision number ([15:8] revision number, [7:0] patch number) */ -#define __MPU_PRESENT 1 /**< SAMV71J21 does provide a MPU */ -#define __NVIC_PRIO_BITS 3 /**< SAMV71J21 uses 3 Bits for the Priority Levels */ -#define __FPU_PRESENT 1 /**< SAMV71J21 does provide a FPU */ -#define __FPU_DP 1 /**< SAMV71J21 Double precision FPU */ -#define __ICACHE_PRESENT 1 /**< SAMV71J21 does provide an Instruction Cache */ -#define __DCACHE_PRESENT 1 /**< SAMV71J21 does provide a Data Cache */ -#define __DTCM_PRESENT 1 /**< SAMV71J21 does provide a Data TCM */ -#define __ITCM_PRESENT 1 /**< SAMV71J21 does provide an Instruction TCM */ -#define __Vendor_SysTickConfig 0 /**< Set to 1 if different SysTick Config is used */ - -/* - * \brief CMSIS includes - */ - -#include -#if !defined DONT_USE_CMSIS_INIT -#include "system_samv71.h" -#endif /* DONT_USE_CMSIS_INIT */ - -/*@}*/ - -/* ************************************************************************** */ -/** SOFTWARE PERIPHERAL API DEFINITION FOR SAMV71J21 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71J21_api Peripheral Software API */ -/*@{*/ - -#include "component/component_acc.h" -#include "component/component_aes.h" -#include "component/component_afec.h" -#include "component/component_chipid.h" -#include "component/component_dacc.h" -#include "component/component_efc.h" -#include "component/component_gmac.h" -#include "component/component_gpbr.h" -#include "component/component_hsmci.h" -#include "component/component_icm.h" -#include "component/component_isi.h" -#include "component/component_matrix.h" -#include "component/component_mcan.h" -#include "component/component_mlb.h" -#include "component/component_pio.h" -#include "component/component_pmc.h" -#include "component/component_pwm.h" -#include "component/component_qspi.h" -#include "component/component_rstc.h" -#include "component/component_rswdt.h" -#include "component/component_rtc.h" -#include "component/component_rtt.h" -#include "component/component_spi.h" -#include "component/component_ssc.h" -#include "component/component_supc.h" -#include "component/component_tc.h" -#include "component/component_trng.h" -#include "component/component_twihs.h" -#include "component/component_uart.h" -#include "component/component_usart.h" -#include "component/component_usbhs.h" -#include "component/component_utmi.h" -#include "component/component_wdt.h" -#include "component/component_xdmac.h" -/*@}*/ - -/* ************************************************************************** */ -/* REGISTER ACCESS DEFINITIONS FOR SAMV71J21 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71J21_reg Registers Access Definitions */ -/*@{*/ - -#include "instance/instance_hsmci.h" -#include "instance/instance_ssc.h" -#include "instance/instance_spi0.h" -#include "instance/instance_tc0.h" -#include "instance/instance_twihs0.h" -#include "instance/instance_twihs1.h" -#include "instance/instance_pwm0.h" -#include "instance/instance_usart0.h" -#include "instance/instance_usart1.h" -#include "instance/instance_usart2.h" -#include "instance/instance_mcan0.h" -#include "instance/instance_mcan1.h" -#include "instance/instance_usbhs.h" -#include "instance/instance_afec0.h" -#include "instance/instance_dacc.h" -#include "instance/instance_acc.h" -#include "instance/instance_icm.h" -#include "instance/instance_isi.h" -#include "instance/instance_gmac.h" -#include "instance/instance_tc3.h" -#include "instance/instance_spi1.h" -#include "instance/instance_pwm1.h" -#include "instance/instance_afec1.h" -#include "instance/instance_mlb.h" -#include "instance/instance_aes.h" -#include "instance/instance_trng.h" -#include "instance/instance_xdmac.h" -#include "instance/instance_qspi.h" -#include "instance/instance_matrix.h" -#include "instance/instance_utmi.h" -#include "instance/instance_pmc.h" -#include "instance/instance_uart0.h" -#include "instance/instance_chipid.h" -#include "instance/instance_uart1.h" -#include "instance/instance_efc.h" -#include "instance/instance_pioa.h" -#include "instance/instance_piob.h" -#include "instance/instance_piod.h" -#include "instance/instance_rstc.h" -#include "instance/instance_supc.h" -#include "instance/instance_rtt.h" -#include "instance/instance_wdt.h" -#include "instance/instance_rtc.h" -#include "instance/instance_gpbr.h" -#include "instance/instance_rswdt.h" -#include "instance/instance_uart2.h" -#include "instance/instance_uart3.h" -#include "instance/instance_uart4.h" -/*@}*/ - -/* ************************************************************************** */ -/* PERIPHERAL ID DEFINITIONS FOR SAMV71J21 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71J21_id Peripheral Ids Definitions */ -/*@{*/ - -#define ID_SUPC ( 0) /**< \brief Supply Controller (SUPC) */ -#define ID_RSTC ( 1) /**< \brief Reset Controller (RSTC) */ -#define ID_RTC ( 2) /**< \brief Real Time Clock (RTC) */ -#define ID_RTT ( 3) /**< \brief Real Time Timer (RTT) */ -#define ID_WDT ( 4) /**< \brief Watchdog Timer (WDT) */ -#define ID_PMC ( 5) /**< \brief Power Management Controller (PMC) */ -#define ID_EFC ( 6) /**< \brief Enhanced Embedded Flash Controller (EFC) */ -#define ID_UART0 ( 7) /**< \brief UART 0 (UART0) */ -#define ID_UART1 ( 8) /**< \brief UART 1 (UART1) */ -#define ID_PIOA (10) /**< \brief Parallel I/O Controller A (PIOA) */ -#define ID_PIOB (11) /**< \brief Parallel I/O Controller B (PIOB) */ -#define ID_USART0 (13) /**< \brief USART 0 (USART0) */ -#define ID_USART1 (14) /**< \brief USART 1 (USART1) */ -#define ID_USART2 (15) /**< \brief USART 2 (USART2) */ -#define ID_PIOD (16) /**< \brief Parallel I/O Controller D (PIOD) */ -#define ID_HSMCI (18) /**< \brief Multimedia Card Interface (HSMCI) */ -#define ID_TWIHS0 (19) /**< \brief Two Wire Interface 0 HS (TWIHS0) */ -#define ID_TWIHS1 (20) /**< \brief Two Wire Interface 1 HS (TWIHS1) */ -#define ID_SPI0 (21) /**< \brief Serial Peripheral Interface 0 (SPI0) */ -#define ID_SSC (22) /**< \brief Synchronous Serial Controller (SSC) */ -#define ID_TC0 (23) /**< \brief Timer/Counter 0 (TC0) */ -#define ID_TC1 (24) /**< \brief Timer/Counter 1 (TC1) */ -#define ID_TC2 (25) /**< \brief Timer/Counter 2 (TC2) */ -#define ID_AFEC0 (29) /**< \brief Analog Front End 0 (AFEC0) */ -#define ID_DACC (30) /**< \brief Digital To Analog Converter (DACC) */ -#define ID_PWM0 (31) /**< \brief Pulse Width Modulation 0 (PWM0) */ -#define ID_ICM (32) /**< \brief Integrity Check Monitor (ICM) */ -#define ID_ACC (33) /**< \brief Analog Comparator (ACC) */ -#define ID_USBHS (34) /**< \brief USB Host / Device Controller (USBHS) */ -#define ID_MCAN0 (35) /**< \brief MCAN Controller 0 (MCAN0) */ -#define ID_MCAN1 (37) /**< \brief MCAN Controller 1 (MCAN1) */ -#define ID_GMAC (39) /**< \brief Ethernet MAC (GMAC) */ -#define ID_AFEC1 (40) /**< \brief Analog Front End 1 (AFEC1) */ -#define ID_SPI1 (42) /**< \brief Serial Peripheral Interface 1 (SPI1) */ -#define ID_QSPI (43) /**< \brief Quad I/O Serial Peripheral Interface (QSPI) */ -#define ID_UART2 (44) /**< \brief UART 2 (UART2) */ -#define ID_UART3 (45) /**< \brief UART 3 (UART3) */ -#define ID_UART4 (46) /**< \brief UART 4 (UART4) */ -#define ID_TC9 (50) /**< \brief Timer/Counter 9 (TC9) */ -#define ID_TC10 (51) /**< \brief Timer/Counter 10 (TC10) */ -#define ID_TC11 (52) /**< \brief Timer/Counter 11 (TC11) */ -#define ID_MLB (53) /**< \brief MediaLB (MLB) */ -#define ID_AES (56) /**< \brief AES (AES) */ -#define ID_TRNG (57) /**< \brief True Random Generator (TRNG) */ -#define ID_XDMAC (58) /**< \brief DMA (XDMAC) */ -#define ID_ISI (59) /**< \brief Camera Interface (ISI) */ -#define ID_PWM1 (60) /**< \brief Pulse Width Modulation 1 (PWM1) */ -#define ID_RSWDT (63) /**< \brief Reinforced Secure Watchdog Timer (RSWDT) */ - -#define ID_PERIPH_COUNT (64) /**< \brief Number of peripheral IDs */ -/*@}*/ - -/* ************************************************************************** */ -/* BASE ADDRESS DEFINITIONS FOR SAMV71J21 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71J21_base Peripheral Base Address Definitions */ -/*@{*/ - -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -#define HSMCI (0x40000000U) /**< \brief (HSMCI ) Base Address */ -#define SSC (0x40004000U) /**< \brief (SSC ) Base Address */ -#define SPI0 (0x40008000U) /**< \brief (SPI0 ) Base Address */ -#define TC0 (0x4000C000U) /**< \brief (TC0 ) Base Address */ -#define TWIHS0 (0x40018000U) /**< \brief (TWIHS0) Base Address */ -#define TWIHS1 (0x4001C000U) /**< \brief (TWIHS1) Base Address */ -#define PWM0 (0x40020000U) /**< \brief (PWM0 ) Base Address */ -#define USART0 (0x40024000U) /**< \brief (USART0) Base Address */ -#define USART1 (0x40028000U) /**< \brief (USART1) Base Address */ -#define USART2 (0x4002C000U) /**< \brief (USART2) Base Address */ -#define MCAN0 (0x40030000U) /**< \brief (MCAN0 ) Base Address */ -#define MCAN1 (0x40034000U) /**< \brief (MCAN1 ) Base Address */ -#define USBHS (0x40038000U) /**< \brief (USBHS ) Base Address */ -#define AFEC0 (0x4003C000U) /**< \brief (AFEC0 ) Base Address */ -#define DACC (0x40040000U) /**< \brief (DACC ) Base Address */ -#define ACC (0x40044000U) /**< \brief (ACC ) Base Address */ -#define ICM (0x40048000U) /**< \brief (ICM ) Base Address */ -#define ISI (0x4004C000U) /**< \brief (ISI ) Base Address */ -#define GMAC (0x40050000U) /**< \brief (GMAC ) Base Address */ -#define TC3 (0x40054000U) /**< \brief (TC3 ) Base Address */ -#define SPI1 (0x40058000U) /**< \brief (SPI1 ) Base Address */ -#define PWM1 (0x4005C000U) /**< \brief (PWM1 ) Base Address */ -#define AFEC1 (0x40064000U) /**< \brief (AFEC1 ) Base Address */ -#define MLB (0x40068000U) /**< \brief (MLB ) Base Address */ -#define AES (0x4006C000U) /**< \brief (AES ) Base Address */ -#define TRNG (0x40070000U) /**< \brief (TRNG ) Base Address */ -#define XDMAC (0x40078000U) /**< \brief (XDMAC ) Base Address */ -#define QSPI (0x4007C000U) /**< \brief (QSPI ) Base Address */ -#define MATRIX (0x40088000U) /**< \brief (MATRIX) Base Address */ -#define UTMI (0x400E0400U) /**< \brief (UTMI ) Base Address */ -#define PMC (0x400E0600U) /**< \brief (PMC ) Base Address */ -#define UART0 (0x400E0800U) /**< \brief (UART0 ) Base Address */ -#define CHIPID (0x400E0940U) /**< \brief (CHIPID) Base Address */ -#define UART1 (0x400E0A00U) /**< \brief (UART1 ) Base Address */ -#define EFC (0x400E0C00U) /**< \brief (EFC ) Base Address */ -#define PIOA (0x400E0E00U) /**< \brief (PIOA ) Base Address */ -#define PIOB (0x400E1000U) /**< \brief (PIOB ) Base Address */ -#define PIOD (0x400E1400U) /**< \brief (PIOD ) Base Address */ -#define RSTC (0x400E1800U) /**< \brief (RSTC ) Base Address */ -#define SUPC (0x400E1810U) /**< \brief (SUPC ) Base Address */ -#define RTT (0x400E1830U) /**< \brief (RTT ) Base Address */ -#define WDT (0x400E1850U) /**< \brief (WDT ) Base Address */ -#define RTC (0x400E1860U) /**< \brief (RTC ) Base Address */ -#define GPBR (0x400E1890U) /**< \brief (GPBR ) Base Address */ -#define RSWDT (0x400E1900U) /**< \brief (RSWDT ) Base Address */ -#define UART2 (0x400E1A00U) /**< \brief (UART2 ) Base Address */ -#define UART3 (0x400E1C00U) /**< \brief (UART3 ) Base Address */ -#define UART4 (0x400E1E00U) /**< \brief (UART4 ) Base Address */ -#else -#define HSMCI ((Hsmci *)0x40000000U) /**< \brief (HSMCI ) Base Address */ -#define SSC ((Ssc *)0x40004000U) /**< \brief (SSC ) Base Address */ -#define SPI0 ((Spi *)0x40008000U) /**< \brief (SPI0 ) Base Address */ -#define TC0 ((Tc *)0x4000C000U) /**< \brief (TC0 ) Base Address */ -#define TWIHS0 ((Twihs *)0x40018000U) /**< \brief (TWIHS0) Base Address */ -#define TWIHS1 ((Twihs *)0x4001C000U) /**< \brief (TWIHS1) Base Address */ -#define PWM0 ((Pwm *)0x40020000U) /**< \brief (PWM0 ) Base Address */ -#define USART0 ((Usart *)0x40024000U) /**< \brief (USART0) Base Address */ -#define USART1 ((Usart *)0x40028000U) /**< \brief (USART1) Base Address */ -#define USART2 ((Usart *)0x4002C000U) /**< \brief (USART2) Base Address */ -#define MCAN0 ((Mcan *)0x40030000U) /**< \brief (MCAN0 ) Base Address */ -#define MCAN1 ((Mcan *)0x40034000U) /**< \brief (MCAN1 ) Base Address */ -#define USBHS ((Usbhs *)0x40038000U) /**< \brief (USBHS ) Base Address */ -#define AFEC0 ((Afec *)0x4003C000U) /**< \brief (AFEC0 ) Base Address */ -#define DACC ((Dacc *)0x40040000U) /**< \brief (DACC ) Base Address */ -#define ACC ((Acc *)0x40044000U) /**< \brief (ACC ) Base Address */ -#define ICM ((Icm *)0x40048000U) /**< \brief (ICM ) Base Address */ -#define ISI ((Isi *)0x4004C000U) /**< \brief (ISI ) Base Address */ -#define GMAC ((Gmac *)0x40050000U) /**< \brief (GMAC ) Base Address */ -#define TC3 ((Tc *)0x40054000U) /**< \brief (TC3 ) Base Address */ -#define SPI1 ((Spi *)0x40058000U) /**< \brief (SPI1 ) Base Address */ -#define PWM1 ((Pwm *)0x4005C000U) /**< \brief (PWM1 ) Base Address */ -#define AFEC1 ((Afec *)0x40064000U) /**< \brief (AFEC1 ) Base Address */ -#define MLB ((Mlb *)0x40068000U) /**< \brief (MLB ) Base Address */ -#define AES ((Aes *)0x4006C000U) /**< \brief (AES ) Base Address */ -#define TRNG ((Trng *)0x40070000U) /**< \brief (TRNG ) Base Address */ -#define XDMAC ((Xdmac *)0x40078000U) /**< \brief (XDMAC ) Base Address */ -#define QSPI ((Qspi *)0x4007C000U) /**< \brief (QSPI ) Base Address */ -#define MATRIX ((Matrix *)0x40088000U) /**< \brief (MATRIX) Base Address */ -#define UTMI ((Utmi *)0x400E0400U) /**< \brief (UTMI ) Base Address */ -#define PMC ((Pmc *)0x400E0600U) /**< \brief (PMC ) Base Address */ -#define UART0 ((Uart *)0x400E0800U) /**< \brief (UART0 ) Base Address */ -#define CHIPID ((Chipid *)0x400E0940U) /**< \brief (CHIPID) Base Address */ -#define UART1 ((Uart *)0x400E0A00U) /**< \brief (UART1 ) Base Address */ -#define EFC ((Efc *)0x400E0C00U) /**< \brief (EFC ) Base Address */ -#define PIOA ((Pio *)0x400E0E00U) /**< \brief (PIOA ) Base Address */ -#define PIOB ((Pio *)0x400E1000U) /**< \brief (PIOB ) Base Address */ -#define PIOD ((Pio *)0x400E1400U) /**< \brief (PIOD ) Base Address */ -#define RSTC ((Rstc *)0x400E1800U) /**< \brief (RSTC ) Base Address */ -#define SUPC ((Supc *)0x400E1810U) /**< \brief (SUPC ) Base Address */ -#define RTT ((Rtt *)0x400E1830U) /**< \brief (RTT ) Base Address */ -#define WDT ((Wdt *)0x400E1850U) /**< \brief (WDT ) Base Address */ -#define RTC ((Rtc *)0x400E1860U) /**< \brief (RTC ) Base Address */ -#define GPBR ((Gpbr *)0x400E1890U) /**< \brief (GPBR ) Base Address */ -#define RSWDT ((Rswdt *)0x400E1900U) /**< \brief (RSWDT ) Base Address */ -#define UART2 ((Uart *)0x400E1A00U) /**< \brief (UART2 ) Base Address */ -#define UART3 ((Uart *)0x400E1C00U) /**< \brief (UART3 ) Base Address */ -#define UART4 ((Uart *)0x400E1E00U) /**< \brief (UART4 ) Base Address */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/*@}*/ - -/* ************************************************************************** */ -/* PIO DEFINITIONS FOR SAMV71J21 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71J21_pio Peripheral Pio Definitions */ -/*@{*/ - -#include "pio/pio_samv71j21.h" -/*@}*/ - -/* ************************************************************************** */ -/* MEMORY MAPPING DEFINITIONS FOR SAMV71J21 */ -/* ************************************************************************** */ - -#define IFLASH_SIZE (0x200000u) -#define IFLASH_PAGE_SIZE (512u) -#define IFLASH_LOCK_REGION_SIZE (16384u) -#define IFLASH_NB_OF_PAGES (4096u) -#define IFLASH_NB_OF_LOCK_BITS (128u) -#define IRAM_SIZE (0x60000u) - -#define QSPIMEM_ADDR (0x80000000u) /**< QSPI Memory base address */ -#define AXIMX_ADDR (0xA0000000u) /**< AXI Bus Matrix base address */ -#define ITCM_ADDR (0x00000000u) /**< Instruction Tightly Coupled Memory base address */ -#define IFLASH_ADDR (0x00400000u) /**< Internal Flash base address */ -#define IROM_ADDR (0x00800000u) /**< Internal ROM base address */ -#define DTCM_ADDR (0x20000000u) /**< Data Tightly Coupled Memory base address */ -#define IRAM_ADDR (0x20400000u) /**< Internal RAM base address */ -#define EBI_CS0_ADDR (0x60000000u) /**< EBI Chip Select 0 base address */ -#define EBI_CS1_ADDR (0x61000000u) /**< EBI Chip Select 1 base address */ -#define EBI_CS2_ADDR (0x62000000u) /**< EBI Chip Select 2 base address */ -#define EBI_CS3_ADDR (0x63000000u) /**< EBI Chip Select 3 base address */ -#define SDRAM_CS_ADDR (0x70000000u) /**< SDRAM Chip Select base address */ - -/* ************************************************************************** */ -/* MISCELLANEOUS DEFINITIONS FOR SAMV71J21 */ -/* ************************************************************************** */ - -#define CHIP_JTAGID (0x05B3D03FUL) -#define CHIP_CIDR (0xA1220E00UL) -#define CHIP_EXID (0x00000000UL) - -/* ************************************************************************** */ -/* ELECTRICAL DEFINITIONS FOR SAMV71J21 */ -/* ************************************************************************** */ - -/* %ATMEL_ELECTRICAL% */ - -/* Device characteristics */ -#define CHIP_FREQ_SLCK_RC_MIN (20000UL) -#define CHIP_FREQ_SLCK_RC (32000UL) -#define CHIP_FREQ_SLCK_RC_MAX (44000UL) -#define CHIP_FREQ_MAINCK_RC_4MHZ (4000000UL) -#define CHIP_FREQ_MAINCK_RC_8MHZ (8000000UL) -#define CHIP_FREQ_MAINCK_RC_12MHZ (12000000UL) -#define CHIP_FREQ_CPU_MAX (300000000UL) -#define CHIP_FREQ_XTAL_32K (32768UL) -#define CHIP_FREQ_XTAL_12M (12000000UL) - -/* Embedded Flash Read Wait State (VDDCORE set at 1.20V) */ -#define CHIP_FREQ_FWS_0 (26000000UL) /**< \brief Maximum operating frequency when FWS is 0 */ -#define CHIP_FREQ_FWS_1 (52000000UL) /**< \brief Maximum operating frequency when FWS is 1 */ -#define CHIP_FREQ_FWS_2 (78000000UL) /**< \brief Maximum operating frequency when FWS is 2 */ -#define CHIP_FREQ_FWS_3 (104000000UL) /**< \brief Maximum operating frequency when FWS is 3 */ -#define CHIP_FREQ_FWS_4 (131000000UL) /**< \brief Maximum operating frequency when FWS is 4 */ -#define CHIP_FREQ_FWS_5 (150000000UL) /**< \brief Maximum operating frequency when FWS is 5 */ - -#ifdef __cplusplus -} -#endif - -/*@}*/ - -#endif /* _SAMV71J21_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/samv71n19.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/samv71n19.h deleted file mode 100644 index 30abc83f..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/samv71n19.h +++ /dev/null @@ -1,646 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71N19_ -#define _SAMV71N19_ - -/** \addtogroup SAMV71N19_definitions SAMV71N19 definitions - This file defines all structures and symbols for SAMV71N19: - - registers and bit-fields - - peripheral base address - - peripheral ID - - PIO definitions -*/ -/*@{*/ - -#ifdef __cplusplus - extern "C" { -#endif - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -#include -#endif - -/* ************************************************************************** */ -/* CMSIS DEFINITIONS FOR SAMV71N19 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71N19_cmsis CMSIS Definitions */ -/*@{*/ - -/**< Interrupt Number Definition */ -typedef enum IRQn -{ -/****** Cortex-M7 Processor Exceptions Numbers ******************************/ - NonMaskableInt_IRQn = -14, /**< 2 Non Maskable Interrupt */ - HardFault_IRQn = -13, /**< 3 HardFault Interrupt */ - MemoryManagement_IRQn = -12, /**< 4 Cortex-M7 Memory Management Interrupt */ - BusFault_IRQn = -11, /**< 5 Cortex-M7 Bus Fault Interrupt */ - UsageFault_IRQn = -10, /**< 6 Cortex-M7 Usage Fault Interrupt */ - SVCall_IRQn = -5, /**< 11 Cortex-M7 SV Call Interrupt */ - DebugMonitor_IRQn = -4, /**< 12 Cortex-M7 Debug Monitor Interrupt */ - PendSV_IRQn = -2, /**< 14 Cortex-M7 Pend SV Interrupt */ - SysTick_IRQn = -1, /**< 15 Cortex-M7 System Tick Interrupt */ -/****** SAMV71N19 specific Interrupt Numbers *********************************/ - - SUPC_IRQn = 0, /**< 0 SAMV71N19 Supply Controller (SUPC) */ - RSTC_IRQn = 1, /**< 1 SAMV71N19 Reset Controller (RSTC) */ - RTC_IRQn = 2, /**< 2 SAMV71N19 Real Time Clock (RTC) */ - RTT_IRQn = 3, /**< 3 SAMV71N19 Real Time Timer (RTT) */ - WDT_IRQn = 4, /**< 4 SAMV71N19 Watchdog Timer (WDT) */ - PMC_IRQn = 5, /**< 5 SAMV71N19 Power Management Controller (PMC) */ - EFC_IRQn = 6, /**< 6 SAMV71N19 Enhanced Embedded Flash Controller (EFC) */ - UART0_IRQn = 7, /**< 7 SAMV71N19 UART 0 (UART0) */ - UART1_IRQn = 8, /**< 8 SAMV71N19 UART 1 (UART1) */ - PIOA_IRQn = 10, /**< 10 SAMV71N19 Parallel I/O Controller A (PIOA) */ - PIOB_IRQn = 11, /**< 11 SAMV71N19 Parallel I/O Controller B (PIOB) */ - USART0_IRQn = 13, /**< 13 SAMV71N19 USART 0 (USART0) */ - USART1_IRQn = 14, /**< 14 SAMV71N19 USART 1 (USART1) */ - USART2_IRQn = 15, /**< 15 SAMV71N19 USART 2 (USART2) */ - PIOD_IRQn = 16, /**< 16 SAMV71N19 Parallel I/O Controller D (PIOD) */ - HSMCI_IRQn = 18, /**< 18 SAMV71N19 Multimedia Card Interface (HSMCI) */ - TWIHS0_IRQn = 19, /**< 19 SAMV71N19 Two Wire Interface 0 HS (TWIHS0) */ - TWIHS1_IRQn = 20, /**< 20 SAMV71N19 Two Wire Interface 1 HS (TWIHS1) */ - SPI0_IRQn = 21, /**< 21 SAMV71N19 Serial Peripheral Interface 0 (SPI0) */ - SSC_IRQn = 22, /**< 22 SAMV71N19 Synchronous Serial Controller (SSC) */ - TC0_IRQn = 23, /**< 23 SAMV71N19 Timer/Counter 0 (TC0) */ - TC1_IRQn = 24, /**< 24 SAMV71N19 Timer/Counter 1 (TC1) */ - TC2_IRQn = 25, /**< 25 SAMV71N19 Timer/Counter 2 (TC2) */ - AFEC0_IRQn = 29, /**< 29 SAMV71N19 Analog Front End 0 (AFEC0) */ - DACC_IRQn = 30, /**< 30 SAMV71N19 Digital To Analog Converter (DACC) */ - PWM0_IRQn = 31, /**< 31 SAMV71N19 Pulse Width Modulation 0 (PWM0) */ - ICM_IRQn = 32, /**< 32 SAMV71N19 Integrity Check Monitor (ICM) */ - ACC_IRQn = 33, /**< 33 SAMV71N19 Analog Comparator (ACC) */ - USBHS_IRQn = 34, /**< 34 SAMV71N19 USB Host / Device Controller (USBHS) */ - MCAN0_IRQn = 35, /**< 35 SAMV71N19 MCAN Controller 0 (MCAN0) */ - MCAN0_LINE1_IRQn = 36, /**< 36 SAMV71Q21 MCAN Controller 0 LINE1 (MCAN0) */ - MCAN1_IRQn = 37, /**< 37 SAMV71N19 MCAN Controller 1 (MCAN1) */ - MCAN1_LINE1_IRQn = 38, /**< 38 SAMV71Q21 MCAN Controller 1 LINE1 (MCAN1) */ - GMAC_IRQn = 39, /**< 39 SAMV71N19 Ethernet MAC (GMAC) */ - AFEC1_IRQn = 40, /**< 40 SAMV71N19 Analog Front End 1 (AFEC1) */ - TWIHS2_IRQn = 41, /**< 41 SAMV71N19 Two Wire Interface 2 HS (TWIHS2) */ - SPI1_IRQn = 42, /**< 42 SAMV71N19 Serial Peripheral Interface 1 (SPI1) */ - QSPI_IRQn = 43, /**< 43 SAMV71N19 Quad I/O Serial Peripheral Interface (QSPI) */ - UART2_IRQn = 44, /**< 44 SAMV71N19 UART 2 (UART2) */ - UART3_IRQn = 45, /**< 45 SAMV71N19 UART 3 (UART3) */ - UART4_IRQn = 46, /**< 46 SAMV71N19 UART 4 (UART4) */ - TC9_IRQn = 50, /**< 50 SAMV71N19 Timer/Counter 9 (TC9) */ - TC10_IRQn = 51, /**< 51 SAMV71N19 Timer/Counter 10 (TC10) */ - TC11_IRQn = 52, /**< 52 SAMV71N19 Timer/Counter 11 (TC11) */ - MLB_IRQn = 53, /**< 53 SAMV71N19 MediaLB (MLB) */ - AES_IRQn = 56, /**< 56 SAMV71N19 AES (AES) */ - TRNG_IRQn = 57, /**< 57 SAMV71N19 True Random Generator (TRNG) */ - XDMAC_IRQn = 58, /**< 58 SAMV71N19 DMA (XDMAC) */ - ISI_IRQn = 59, /**< 59 SAMV71N19 Camera Interface (ISI) */ - PWM1_IRQn = 60, /**< 60 SAMV71N19 Pulse Width Modulation 1 (PWM1) */ - RSWDT_IRQn = 63, /**< 63 SAMV71N19 Reinforced Secure Watchdog Timer (RSWDT) */ - - PERIPH_COUNT_IRQn = 64 /**< Number of peripheral IDs */ -} IRQn_Type; - -typedef struct _DeviceVectors -{ - /* Stack pointer */ - void* pvStack; - - /* Cortex-M handlers */ - void* pfnReset_Handler; - void* pfnNMI_Handler; - void* pfnHardFault_Handler; - void* pfnMemManage_Handler; - void* pfnBusFault_Handler; - void* pfnUsageFault_Handler; - void* pfnReserved1_Handler; - void* pfnReserved2_Handler; - void* pfnReserved3_Handler; - void* pfnReserved4_Handler; - void* pfnSVC_Handler; - void* pfnDebugMon_Handler; - void* pfnReserved5_Handler; - void* pfnPendSV_Handler; - void* pfnSysTick_Handler; - - /* Peripheral handlers */ - void* pfnSUPC_Handler; /* 0 Supply Controller */ - void* pfnRSTC_Handler; /* 1 Reset Controller */ - void* pfnRTC_Handler; /* 2 Real Time Clock */ - void* pfnRTT_Handler; /* 3 Real Time Timer */ - void* pfnWDT_Handler; /* 4 Watchdog Timer */ - void* pfnPMC_Handler; /* 5 Power Management Controller */ - void* pfnEFC_Handler; /* 6 Enhanced Embedded Flash Controller */ - void* pfnUART0_Handler; /* 7 UART 0 */ - void* pfnUART1_Handler; /* 8 UART 1 */ - void* pvReserved9; - void* pfnPIOA_Handler; /* 10 Parallel I/O Controller A */ - void* pfnPIOB_Handler; /* 11 Parallel I/O Controller B */ - void* pvReserved12; - void* pfnUSART0_Handler; /* 13 USART 0 */ - void* pfnUSART1_Handler; /* 14 USART 1 */ - void* pfnUSART2_Handler; /* 15 USART 2 */ - void* pfnPIOD_Handler; /* 16 Parallel I/O Controller D */ - void* pvReserved17; - void* pfnHSMCI_Handler; /* 18 Multimedia Card Interface */ - void* pfnTWIHS0_Handler; /* 19 Two Wire Interface 0 HS */ - void* pfnTWIHS1_Handler; /* 20 Two Wire Interface 1 HS */ - void* pfnSPI0_Handler; /* 21 Serial Peripheral Interface 0 */ - void* pfnSSC_Handler; /* 22 Synchronous Serial Controller */ - void* pfnTC0_Handler; /* 23 Timer/Counter 0 */ - void* pfnTC1_Handler; /* 24 Timer/Counter 1 */ - void* pfnTC2_Handler; /* 25 Timer/Counter 2 */ - void* pvReserved26; - void* pvReserved27; - void* pvReserved28; - void* pfnAFEC0_Handler; /* 29 Analog Front End 0 */ - void* pfnDACC_Handler; /* 30 Digital To Analog Converter */ - void* pfnPWM0_Handler; /* 31 Pulse Width Modulation 0 */ - void* pfnICM_Handler; /* 32 Integrity Check Monitor */ - void* pfnACC_Handler; /* 33 Analog Comparator */ - void* pfnUSBHS_Handler; /* 34 USB Host / Device Controller */ - void* pfnMCAN0_Handler; /* 35 MCAN Controller 0 */ - void* pfnMCAN0_Line1_Handler; /* 36 MCAN Controller 0 */ - void* pfnMCAN1_Handler; /* 37 MCAN Controller 1 */ - void* pfnMCAN1_Line1_Handler; /* 38 MCAN Controller 1 */ - void* pfnGMAC_Handler; /* 39 Ethernet MAC */ - void* pfnAFEC1_Handler; /* 40 Analog Front End 1 */ - void* pfnTWIHS2_Handler; /* 41 Two Wire Interface 2 HS */ - void* pfnSPI1_Handler; /* 42 Serial Peripheral Interface 1 */ - void* pfnQSPI_Handler; /* 43 Quad I/O Serial Peripheral Interface */ - void* pfnUART2_Handler; /* 44 UART 2 */ - void* pfnUART3_Handler; /* 45 UART 3 */ - void* pfnUART4_Handler; /* 46 UART 4 */ - void* pvReserved47; - void* pvReserved48; - void* pvReserved49; - void* pfnTC9_Handler; /* 50 Timer/Counter 9 */ - void* pfnTC10_Handler; /* 51 Timer/Counter 10 */ - void* pfnTC11_Handler; /* 52 Timer/Counter 11 */ - void* pfnMLB_Handler; /* 53 MediaLB */ - void* pvReserved54; - void* pvReserved55; - void* pfnAES_Handler; /* 56 AES */ - void* pfnTRNG_Handler; /* 57 True Random Generator */ - void* pfnXDMAC_Handler; /* 58 DMA */ - void* pfnISI_Handler; /* 59 Camera Interface */ - void* pfnPWM1_Handler; /* 60 Pulse Width Modulation 1 */ - void* pvReserved61; - void* pvReserved62; - void* pfnRSWDT_Handler; /* 63 Reinforced Secure Watchdog Timer */ -} DeviceVectors; - -/* Cortex-M7 core handlers */ -void Reset_Handler ( void ); -void NMI_Handler ( void ); -void HardFault_Handler ( void ); -void MemManage_Handler ( void ); -void BusFault_Handler ( void ); -void UsageFault_Handler ( void ); -void SVC_Handler ( void ); -void DebugMon_Handler ( void ); -void PendSV_Handler ( void ); -void SysTick_Handler ( void ); - -/* Peripherals handlers */ -void ACC_Handler ( void ); -void AES_Handler ( void ); -void AFEC0_Handler ( void ); -void AFEC1_Handler ( void ); -void DACC_Handler ( void ); -void EFC_Handler ( void ); -void GMAC_Handler ( void ); -void HSMCI_Handler ( void ); -void ICM_Handler ( void ); -void ISI_Handler ( void ); -void MCAN0_Handler ( void ); -void MCAN0_Line1_Handler( void ); -void MCAN1_Handler ( void ); -void MCAN1_Line1_Handler( void ); -void MLB_Handler ( void ); -void PIOA_Handler ( void ); -void PIOB_Handler ( void ); -void PIOD_Handler ( void ); -void PMC_Handler ( void ); -void PWM0_Handler ( void ); -void PWM1_Handler ( void ); -void QSPI_Handler ( void ); -void RSTC_Handler ( void ); -void RSWDT_Handler ( void ); -void RTC_Handler ( void ); -void RTT_Handler ( void ); -void SPI0_Handler ( void ); -void SPI1_Handler ( void ); -void SSC_Handler ( void ); -void SUPC_Handler ( void ); -void TC0_Handler ( void ); -void TC1_Handler ( void ); -void TC2_Handler ( void ); -void TC9_Handler ( void ); -void TC10_Handler ( void ); -void TC11_Handler ( void ); -void TRNG_Handler ( void ); -void TWIHS0_Handler ( void ); -void TWIHS1_Handler ( void ); -void TWIHS2_Handler ( void ); -void UART0_Handler ( void ); -void UART1_Handler ( void ); -void UART2_Handler ( void ); -void UART3_Handler ( void ); -void UART4_Handler ( void ); -void USART0_Handler ( void ); -void USART1_Handler ( void ); -void USART2_Handler ( void ); -void USBHS_Handler ( void ); -void WDT_Handler ( void ); -void XDMAC_Handler ( void ); - -/** - * \brief Configuration of the Cortex-M7 Processor and Core Peripherals - */ - -#define __CM7_REV 0x0000 /**< SAMV71N19 core revision number ([15:8] revision number, [7:0] patch number) */ -#define __MPU_PRESENT 1 /**< SAMV71N19 does provide a MPU */ -#define __NVIC_PRIO_BITS 3 /**< SAMV71N19 uses 3 Bits for the Priority Levels */ -#define __FPU_PRESENT 1 /**< SAMV71N19 does provide a FPU */ -#define __FPU_DP 1 /**< SAMV71N19 Double precision FPU */ -#define __ICACHE_PRESENT 1 /**< SAMV71N19 does provide an Instruction Cache */ -#define __DCACHE_PRESENT 1 /**< SAMV71N19 does provide a Data Cache */ -#define __DTCM_PRESENT 1 /**< SAMV71N19 does provide a Data TCM */ -#define __ITCM_PRESENT 1 /**< SAMV71N19 does provide an Instruction TCM */ -#define __Vendor_SysTickConfig 0 /**< Set to 1 if different SysTick Config is used */ - -/* - * \brief CMSIS includes - */ - -#include -#if !defined DONT_USE_CMSIS_INIT -#include "system_samv71.h" -#endif /* DONT_USE_CMSIS_INIT */ - -/*@}*/ - -/* ************************************************************************** */ -/** SOFTWARE PERIPHERAL API DEFINITION FOR SAMV71N19 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71N19_api Peripheral Software API */ -/*@{*/ - -#include "component/component_acc.h" -#include "component/component_aes.h" -#include "component/component_afec.h" -#include "component/component_chipid.h" -#include "component/component_dacc.h" -#include "component/component_efc.h" -#include "component/component_gmac.h" -#include "component/component_gpbr.h" -#include "component/component_hsmci.h" -#include "component/component_icm.h" -#include "component/component_isi.h" -#include "component/component_matrix.h" -#include "component/component_mcan.h" -#include "component/component_mlb.h" -#include "component/component_pio.h" -#include "component/component_pmc.h" -#include "component/component_pwm.h" -#include "component/component_qspi.h" -#include "component/component_rstc.h" -#include "component/component_rswdt.h" -#include "component/component_rtc.h" -#include "component/component_rtt.h" -#include "component/component_spi.h" -#include "component/component_ssc.h" -#include "component/component_supc.h" -#include "component/component_tc.h" -#include "component/component_trng.h" -#include "component/component_twihs.h" -#include "component/component_uart.h" -#include "component/component_usart.h" -#include "component/component_usbhs.h" -#include "component/component_utmi.h" -#include "component/component_wdt.h" -#include "component/component_xdmac.h" -/*@}*/ - -/* ************************************************************************** */ -/* REGISTER ACCESS DEFINITIONS FOR SAMV71N19 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71N19_reg Registers Access Definitions */ -/*@{*/ - -#include "instance/instance_hsmci.h" -#include "instance/instance_ssc.h" -#include "instance/instance_spi0.h" -#include "instance/instance_tc0.h" -#include "instance/instance_twihs0.h" -#include "instance/instance_twihs1.h" -#include "instance/instance_pwm0.h" -#include "instance/instance_usart0.h" -#include "instance/instance_usart1.h" -#include "instance/instance_usart2.h" -#include "instance/instance_mcan0.h" -#include "instance/instance_mcan1.h" -#include "instance/instance_usbhs.h" -#include "instance/instance_afec0.h" -#include "instance/instance_dacc.h" -#include "instance/instance_acc.h" -#include "instance/instance_icm.h" -#include "instance/instance_isi.h" -#include "instance/instance_gmac.h" -#include "instance/instance_tc3.h" -#include "instance/instance_spi1.h" -#include "instance/instance_pwm1.h" -#include "instance/instance_twihs2.h" -#include "instance/instance_afec1.h" -#include "instance/instance_mlb.h" -#include "instance/instance_aes.h" -#include "instance/instance_trng.h" -#include "instance/instance_xdmac.h" -#include "instance/instance_qspi.h" -#include "instance/instance_matrix.h" -#include "instance/instance_utmi.h" -#include "instance/instance_pmc.h" -#include "instance/instance_uart0.h" -#include "instance/instance_chipid.h" -#include "instance/instance_uart1.h" -#include "instance/instance_efc.h" -#include "instance/instance_pioa.h" -#include "instance/instance_piob.h" -#include "instance/instance_piod.h" -#include "instance/instance_rstc.h" -#include "instance/instance_supc.h" -#include "instance/instance_rtt.h" -#include "instance/instance_wdt.h" -#include "instance/instance_rtc.h" -#include "instance/instance_gpbr.h" -#include "instance/instance_rswdt.h" -#include "instance/instance_uart2.h" -#include "instance/instance_uart3.h" -#include "instance/instance_uart4.h" -/*@}*/ - -/* ************************************************************************** */ -/* PERIPHERAL ID DEFINITIONS FOR SAMV71N19 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71N19_id Peripheral Ids Definitions */ -/*@{*/ - -#define ID_SUPC ( 0) /**< \brief Supply Controller (SUPC) */ -#define ID_RSTC ( 1) /**< \brief Reset Controller (RSTC) */ -#define ID_RTC ( 2) /**< \brief Real Time Clock (RTC) */ -#define ID_RTT ( 3) /**< \brief Real Time Timer (RTT) */ -#define ID_WDT ( 4) /**< \brief Watchdog Timer (WDT) */ -#define ID_PMC ( 5) /**< \brief Power Management Controller (PMC) */ -#define ID_EFC ( 6) /**< \brief Enhanced Embedded Flash Controller (EFC) */ -#define ID_UART0 ( 7) /**< \brief UART 0 (UART0) */ -#define ID_UART1 ( 8) /**< \brief UART 1 (UART1) */ -#define ID_PIOA (10) /**< \brief Parallel I/O Controller A (PIOA) */ -#define ID_PIOB (11) /**< \brief Parallel I/O Controller B (PIOB) */ -#define ID_USART0 (13) /**< \brief USART 0 (USART0) */ -#define ID_USART1 (14) /**< \brief USART 1 (USART1) */ -#define ID_USART2 (15) /**< \brief USART 2 (USART2) */ -#define ID_PIOD (16) /**< \brief Parallel I/O Controller D (PIOD) */ -#define ID_HSMCI (18) /**< \brief Multimedia Card Interface (HSMCI) */ -#define ID_TWIHS0 (19) /**< \brief Two Wire Interface 0 HS (TWIHS0) */ -#define ID_TWIHS1 (20) /**< \brief Two Wire Interface 1 HS (TWIHS1) */ -#define ID_SPI0 (21) /**< \brief Serial Peripheral Interface 0 (SPI0) */ -#define ID_SSC (22) /**< \brief Synchronous Serial Controller (SSC) */ -#define ID_TC0 (23) /**< \brief Timer/Counter 0 (TC0) */ -#define ID_TC1 (24) /**< \brief Timer/Counter 1 (TC1) */ -#define ID_TC2 (25) /**< \brief Timer/Counter 2 (TC2) */ -#define ID_AFEC0 (29) /**< \brief Analog Front End 0 (AFEC0) */ -#define ID_DACC (30) /**< \brief Digital To Analog Converter (DACC) */ -#define ID_PWM0 (31) /**< \brief Pulse Width Modulation 0 (PWM0) */ -#define ID_ICM (32) /**< \brief Integrity Check Monitor (ICM) */ -#define ID_ACC (33) /**< \brief Analog Comparator (ACC) */ -#define ID_USBHS (34) /**< \brief USB Host / Device Controller (USBHS) */ -#define ID_MCAN0 (35) /**< \brief MCAN Controller 0 (MCAN0) */ -#define ID_MCAN1 (37) /**< \brief MCAN Controller 1 (MCAN1) */ -#define ID_GMAC (39) /**< \brief Ethernet MAC (GMAC) */ -#define ID_AFEC1 (40) /**< \brief Analog Front End 1 (AFEC1) */ -#define ID_TWIHS2 (41) /**< \brief Two Wire Interface 2 HS (TWIHS2) */ -#define ID_SPI1 (42) /**< \brief Serial Peripheral Interface 1 (SPI1) */ -#define ID_QSPI (43) /**< \brief Quad I/O Serial Peripheral Interface (QSPI) */ -#define ID_UART2 (44) /**< \brief UART 2 (UART2) */ -#define ID_UART3 (45) /**< \brief UART 3 (UART3) */ -#define ID_UART4 (46) /**< \brief UART 4 (UART4) */ -#define ID_TC9 (50) /**< \brief Timer/Counter 9 (TC9) */ -#define ID_TC10 (51) /**< \brief Timer/Counter 10 (TC10) */ -#define ID_TC11 (52) /**< \brief Timer/Counter 11 (TC11) */ -#define ID_MLB (53) /**< \brief MediaLB (MLB) */ -#define ID_AES (56) /**< \brief AES (AES) */ -#define ID_TRNG (57) /**< \brief True Random Generator (TRNG) */ -#define ID_XDMAC (58) /**< \brief DMA (XDMAC) */ -#define ID_ISI (59) /**< \brief Camera Interface (ISI) */ -#define ID_PWM1 (60) /**< \brief Pulse Width Modulation 1 (PWM1) */ -#define ID_RSWDT (63) /**< \brief Reinforced Secure Watchdog Timer (RSWDT) */ - -#define ID_PERIPH_COUNT (64) /**< \brief Number of peripheral IDs */ -/*@}*/ - -/* ************************************************************************** */ -/* BASE ADDRESS DEFINITIONS FOR SAMV71N19 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71N19_base Peripheral Base Address Definitions */ -/*@{*/ - -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -#define HSMCI (0x40000000U) /**< \brief (HSMCI ) Base Address */ -#define SSC (0x40004000U) /**< \brief (SSC ) Base Address */ -#define SPI0 (0x40008000U) /**< \brief (SPI0 ) Base Address */ -#define TC0 (0x4000C000U) /**< \brief (TC0 ) Base Address */ -#define TWIHS0 (0x40018000U) /**< \brief (TWIHS0) Base Address */ -#define TWIHS1 (0x4001C000U) /**< \brief (TWIHS1) Base Address */ -#define PWM0 (0x40020000U) /**< \brief (PWM0 ) Base Address */ -#define USART0 (0x40024000U) /**< \brief (USART0) Base Address */ -#define USART1 (0x40028000U) /**< \brief (USART1) Base Address */ -#define USART2 (0x4002C000U) /**< \brief (USART2) Base Address */ -#define MCAN0 (0x40030000U) /**< \brief (MCAN0 ) Base Address */ -#define MCAN1 (0x40034000U) /**< \brief (MCAN1 ) Base Address */ -#define USBHS (0x40038000U) /**< \brief (USBHS ) Base Address */ -#define AFEC0 (0x4003C000U) /**< \brief (AFEC0 ) Base Address */ -#define DACC (0x40040000U) /**< \brief (DACC ) Base Address */ -#define ACC (0x40044000U) /**< \brief (ACC ) Base Address */ -#define ICM (0x40048000U) /**< \brief (ICM ) Base Address */ -#define ISI (0x4004C000U) /**< \brief (ISI ) Base Address */ -#define GMAC (0x40050000U) /**< \brief (GMAC ) Base Address */ -#define TC3 (0x40054000U) /**< \brief (TC3 ) Base Address */ -#define SPI1 (0x40058000U) /**< \brief (SPI1 ) Base Address */ -#define PWM1 (0x4005C000U) /**< \brief (PWM1 ) Base Address */ -#define TWIHS2 (0x40060000U) /**< \brief (TWIHS2) Base Address */ -#define AFEC1 (0x40064000U) /**< \brief (AFEC1 ) Base Address */ -#define MLB (0x40068000U) /**< \brief (MLB ) Base Address */ -#define AES (0x4006C000U) /**< \brief (AES ) Base Address */ -#define TRNG (0x40070000U) /**< \brief (TRNG ) Base Address */ -#define XDMAC (0x40078000U) /**< \brief (XDMAC ) Base Address */ -#define QSPI (0x4007C000U) /**< \brief (QSPI ) Base Address */ -#define MATRIX (0x40088000U) /**< \brief (MATRIX) Base Address */ -#define UTMI (0x400E0400U) /**< \brief (UTMI ) Base Address */ -#define PMC (0x400E0600U) /**< \brief (PMC ) Base Address */ -#define UART0 (0x400E0800U) /**< \brief (UART0 ) Base Address */ -#define CHIPID (0x400E0940U) /**< \brief (CHIPID) Base Address */ -#define UART1 (0x400E0A00U) /**< \brief (UART1 ) Base Address */ -#define EFC (0x400E0C00U) /**< \brief (EFC ) Base Address */ -#define PIOA (0x400E0E00U) /**< \brief (PIOA ) Base Address */ -#define PIOB (0x400E1000U) /**< \brief (PIOB ) Base Address */ -#define PIOD (0x400E1400U) /**< \brief (PIOD ) Base Address */ -#define RSTC (0x400E1800U) /**< \brief (RSTC ) Base Address */ -#define SUPC (0x400E1810U) /**< \brief (SUPC ) Base Address */ -#define RTT (0x400E1830U) /**< \brief (RTT ) Base Address */ -#define WDT (0x400E1850U) /**< \brief (WDT ) Base Address */ -#define RTC (0x400E1860U) /**< \brief (RTC ) Base Address */ -#define GPBR (0x400E1890U) /**< \brief (GPBR ) Base Address */ -#define RSWDT (0x400E1900U) /**< \brief (RSWDT ) Base Address */ -#define UART2 (0x400E1A00U) /**< \brief (UART2 ) Base Address */ -#define UART3 (0x400E1C00U) /**< \brief (UART3 ) Base Address */ -#define UART4 (0x400E1E00U) /**< \brief (UART4 ) Base Address */ -#else -#define HSMCI ((Hsmci *)0x40000000U) /**< \brief (HSMCI ) Base Address */ -#define SSC ((Ssc *)0x40004000U) /**< \brief (SSC ) Base Address */ -#define SPI0 ((Spi *)0x40008000U) /**< \brief (SPI0 ) Base Address */ -#define TC0 ((Tc *)0x4000C000U) /**< \brief (TC0 ) Base Address */ -#define TWIHS0 ((Twihs *)0x40018000U) /**< \brief (TWIHS0) Base Address */ -#define TWIHS1 ((Twihs *)0x4001C000U) /**< \brief (TWIHS1) Base Address */ -#define PWM0 ((Pwm *)0x40020000U) /**< \brief (PWM0 ) Base Address */ -#define USART0 ((Usart *)0x40024000U) /**< \brief (USART0) Base Address */ -#define USART1 ((Usart *)0x40028000U) /**< \brief (USART1) Base Address */ -#define USART2 ((Usart *)0x4002C000U) /**< \brief (USART2) Base Address */ -#define MCAN0 ((Mcan *)0x40030000U) /**< \brief (MCAN0 ) Base Address */ -#define MCAN1 ((Mcan *)0x40034000U) /**< \brief (MCAN1 ) Base Address */ -#define USBHS ((Usbhs *)0x40038000U) /**< \brief (USBHS ) Base Address */ -#define AFEC0 ((Afec *)0x4003C000U) /**< \brief (AFEC0 ) Base Address */ -#define DACC ((Dacc *)0x40040000U) /**< \brief (DACC ) Base Address */ -#define ACC ((Acc *)0x40044000U) /**< \brief (ACC ) Base Address */ -#define ICM ((Icm *)0x40048000U) /**< \brief (ICM ) Base Address */ -#define ISI ((Isi *)0x4004C000U) /**< \brief (ISI ) Base Address */ -#define GMAC ((Gmac *)0x40050000U) /**< \brief (GMAC ) Base Address */ -#define TC3 ((Tc *)0x40054000U) /**< \brief (TC3 ) Base Address */ -#define SPI1 ((Spi *)0x40058000U) /**< \brief (SPI1 ) Base Address */ -#define PWM1 ((Pwm *)0x4005C000U) /**< \brief (PWM1 ) Base Address */ -#define TWIHS2 ((Twihs *)0x40060000U) /**< \brief (TWIHS2) Base Address */ -#define AFEC1 ((Afec *)0x40064000U) /**< \brief (AFEC1 ) Base Address */ -#define MLB ((Mlb *)0x40068000U) /**< \brief (MLB ) Base Address */ -#define AES ((Aes *)0x4006C000U) /**< \brief (AES ) Base Address */ -#define TRNG ((Trng *)0x40070000U) /**< \brief (TRNG ) Base Address */ -#define XDMAC ((Xdmac *)0x40078000U) /**< \brief (XDMAC ) Base Address */ -#define QSPI ((Qspi *)0x4007C000U) /**< \brief (QSPI ) Base Address */ -#define MATRIX ((Matrix *)0x40088000U) /**< \brief (MATRIX) Base Address */ -#define UTMI ((Utmi *)0x400E0400U) /**< \brief (UTMI ) Base Address */ -#define PMC ((Pmc *)0x400E0600U) /**< \brief (PMC ) Base Address */ -#define UART0 ((Uart *)0x400E0800U) /**< \brief (UART0 ) Base Address */ -#define CHIPID ((Chipid *)0x400E0940U) /**< \brief (CHIPID) Base Address */ -#define UART1 ((Uart *)0x400E0A00U) /**< \brief (UART1 ) Base Address */ -#define EFC ((Efc *)0x400E0C00U) /**< \brief (EFC ) Base Address */ -#define PIOA ((Pio *)0x400E0E00U) /**< \brief (PIOA ) Base Address */ -#define PIOB ((Pio *)0x400E1000U) /**< \brief (PIOB ) Base Address */ -#define PIOD ((Pio *)0x400E1400U) /**< \brief (PIOD ) Base Address */ -#define RSTC ((Rstc *)0x400E1800U) /**< \brief (RSTC ) Base Address */ -#define SUPC ((Supc *)0x400E1810U) /**< \brief (SUPC ) Base Address */ -#define RTT ((Rtt *)0x400E1830U) /**< \brief (RTT ) Base Address */ -#define WDT ((Wdt *)0x400E1850U) /**< \brief (WDT ) Base Address */ -#define RTC ((Rtc *)0x400E1860U) /**< \brief (RTC ) Base Address */ -#define GPBR ((Gpbr *)0x400E1890U) /**< \brief (GPBR ) Base Address */ -#define RSWDT ((Rswdt *)0x400E1900U) /**< \brief (RSWDT ) Base Address */ -#define UART2 ((Uart *)0x400E1A00U) /**< \brief (UART2 ) Base Address */ -#define UART3 ((Uart *)0x400E1C00U) /**< \brief (UART3 ) Base Address */ -#define UART4 ((Uart *)0x400E1E00U) /**< \brief (UART4 ) Base Address */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/*@}*/ - -/* ************************************************************************** */ -/* PIO DEFINITIONS FOR SAMV71N19 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71N19_pio Peripheral Pio Definitions */ -/*@{*/ - -#include "pio/pio_samv71n19.h" -/*@}*/ - -/* ************************************************************************** */ -/* MEMORY MAPPING DEFINITIONS FOR SAMV71N19 */ -/* ************************************************************************** */ - -#define IFLASH_SIZE (0x80000u) -#define IFLASH_PAGE_SIZE (512u) -#define IFLASH_LOCK_REGION_SIZE (16384u) -#define IFLASH_NB_OF_PAGES (1024u) -#define IFLASH_NB_OF_LOCK_BITS (32u) -#define IRAM_SIZE (0x40000u) - -#define QSPIMEM_ADDR (0x80000000u) /**< QSPI Memory base address */ -#define AXIMX_ADDR (0xA0000000u) /**< AXI Bus Matrix base address */ -#define ITCM_ADDR (0x00000000u) /**< Instruction Tightly Coupled Memory base address */ -#define IFLASH_ADDR (0x00400000u) /**< Internal Flash base address */ -#define IROM_ADDR (0x00800000u) /**< Internal ROM base address */ -#define DTCM_ADDR (0x20000000u) /**< Data Tightly Coupled Memory base address */ -#define IRAM_ADDR (0x20400000u) /**< Internal RAM base address */ -#define EBI_CS0_ADDR (0x60000000u) /**< EBI Chip Select 0 base address */ -#define EBI_CS1_ADDR (0x61000000u) /**< EBI Chip Select 1 base address */ -#define EBI_CS2_ADDR (0x62000000u) /**< EBI Chip Select 2 base address */ -#define EBI_CS3_ADDR (0x63000000u) /**< EBI Chip Select 3 base address */ -#define SDRAM_CS_ADDR (0x70000000u) /**< SDRAM Chip Select base address */ - -/* ************************************************************************** */ -/* MISCELLANEOUS DEFINITIONS FOR SAMV71N19 */ -/* ************************************************************************** */ - -#define CHIP_JTAGID (0x05B3D03FUL) -#define CHIP_CIDR (0xA12D0A00UL) -#define CHIP_EXID (0x00000001UL) - -/* ************************************************************************** */ -/* ELECTRICAL DEFINITIONS FOR SAMV71N19 */ -/* ************************************************************************** */ - -/* %ATMEL_ELECTRICAL% */ - -/* Device characteristics */ -#define CHIP_FREQ_SLCK_RC_MIN (20000UL) -#define CHIP_FREQ_SLCK_RC (32000UL) -#define CHIP_FREQ_SLCK_RC_MAX (44000UL) -#define CHIP_FREQ_MAINCK_RC_4MHZ (4000000UL) -#define CHIP_FREQ_MAINCK_RC_8MHZ (8000000UL) -#define CHIP_FREQ_MAINCK_RC_12MHZ (12000000UL) -#define CHIP_FREQ_CPU_MAX (300000000UL) -#define CHIP_FREQ_XTAL_32K (32768UL) -#define CHIP_FREQ_XTAL_12M (12000000UL) - -/* Embedded Flash Read Wait State (VDDCORE set at 1.20V) */ -#define CHIP_FREQ_FWS_0 (26000000UL) /**< \brief Maximum operating frequency when FWS is 0 */ -#define CHIP_FREQ_FWS_1 (52000000UL) /**< \brief Maximum operating frequency when FWS is 1 */ -#define CHIP_FREQ_FWS_2 (78000000UL) /**< \brief Maximum operating frequency when FWS is 2 */ -#define CHIP_FREQ_FWS_3 (104000000UL) /**< \brief Maximum operating frequency when FWS is 3 */ -#define CHIP_FREQ_FWS_4 (131000000UL) /**< \brief Maximum operating frequency when FWS is 4 */ -#define CHIP_FREQ_FWS_5 (150000000UL) /**< \brief Maximum operating frequency when FWS is 5 */ - - -#ifdef __cplusplus -} -#endif - -/*@}*/ - -#endif /* _SAMV71N19_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/samv71n20.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/samv71n20.h deleted file mode 100644 index 388123d9..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/samv71n20.h +++ /dev/null @@ -1,639 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71N20_ -#define _SAMV71N20_ - -/** \addtogroup SAMV71N20_definitions SAMV71N20 definitions - This file defines all structures and symbols for SAMV71N20: - - registers and bit-fields - - peripheral base address - - peripheral ID - - PIO definitions -*/ -/*@{*/ - -#ifdef __cplusplus - extern "C" { -#endif - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -#include -#endif - -/* ************************************************************************** */ -/* CMSIS DEFINITIONS FOR SAMV71N20 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71N20_cmsis CMSIS Definitions */ -/*@{*/ - -/**< Interrupt Number Definition */ -typedef enum IRQn -{ -/****** Cortex-M7 Processor Exceptions Numbers ******************************/ - NonMaskableInt_IRQn = -14, /**< 2 Non Maskable Interrupt */ - HardFault_IRQn = -13, /**< 3 HardFault Interrupt */ - MemoryManagement_IRQn = -12, /**< 4 Cortex-M7 Memory Management Interrupt */ - BusFault_IRQn = -11, /**< 5 Cortex-M7 Bus Fault Interrupt */ - UsageFault_IRQn = -10, /**< 6 Cortex-M7 Usage Fault Interrupt */ - SVCall_IRQn = -5, /**< 11 Cortex-M7 SV Call Interrupt */ - DebugMonitor_IRQn = -4, /**< 12 Cortex-M7 Debug Monitor Interrupt */ - PendSV_IRQn = -2, /**< 14 Cortex-M7 Pend SV Interrupt */ - SysTick_IRQn = -1, /**< 15 Cortex-M7 System Tick Interrupt */ -/****** SAMV71N20 specific Interrupt Numbers *********************************/ - - SUPC_IRQn = 0, /**< 0 SAMV71N20 Supply Controller (SUPC) */ - RSTC_IRQn = 1, /**< 1 SAMV71N20 Reset Controller (RSTC) */ - RTC_IRQn = 2, /**< 2 SAMV71N20 Real Time Clock (RTC) */ - RTT_IRQn = 3, /**< 3 SAMV71N20 Real Time Timer (RTT) */ - WDT_IRQn = 4, /**< 4 SAMV71N20 Watchdog Timer (WDT) */ - PMC_IRQn = 5, /**< 5 SAMV71N20 Power Management Controller (PMC) */ - EFC_IRQn = 6, /**< 6 SAMV71N20 Enhanced Embedded Flash Controller (EFC) */ - UART0_IRQn = 7, /**< 7 SAMV71N20 UART 0 (UART0) */ - UART1_IRQn = 8, /**< 8 SAMV71N20 UART 1 (UART1) */ - PIOA_IRQn = 10, /**< 10 SAMV71N20 Parallel I/O Controller A (PIOA) */ - PIOB_IRQn = 11, /**< 11 SAMV71N20 Parallel I/O Controller B (PIOB) */ - USART0_IRQn = 13, /**< 13 SAMV71N20 USART 0 (USART0) */ - USART1_IRQn = 14, /**< 14 SAMV71N20 USART 1 (USART1) */ - USART2_IRQn = 15, /**< 15 SAMV71N20 USART 2 (USART2) */ - PIOD_IRQn = 16, /**< 16 SAMV71N20 Parallel I/O Controller D (PIOD) */ - HSMCI_IRQn = 18, /**< 18 SAMV71N20 Multimedia Card Interface (HSMCI) */ - TWIHS0_IRQn = 19, /**< 19 SAMV71N20 Two Wire Interface 0 HS (TWIHS0) */ - TWIHS1_IRQn = 20, /**< 20 SAMV71N20 Two Wire Interface 1 HS (TWIHS1) */ - SPI0_IRQn = 21, /**< 21 SAMV71N20 Serial Peripheral Interface 0 (SPI0) */ - SSC_IRQn = 22, /**< 22 SAMV71N20 Synchronous Serial Controller (SSC) */ - TC0_IRQn = 23, /**< 23 SAMV71N20 Timer/Counter 0 (TC0) */ - TC1_IRQn = 24, /**< 24 SAMV71N20 Timer/Counter 1 (TC1) */ - TC2_IRQn = 25, /**< 25 SAMV71N20 Timer/Counter 2 (TC2) */ - AFEC0_IRQn = 29, /**< 29 SAMV71N20 Analog Front End 0 (AFEC0) */ - PWM0_IRQn = 31, /**< 31 SAMV71N20 Pulse Width Modulation 0 (PWM0) */ - ICM_IRQn = 32, /**< 32 SAMV71N20 Integrity Check Monitor (ICM) */ - ACC_IRQn = 33, /**< 33 SAMV71N20 Analog Comparator (ACC) */ - USBHS_IRQn = 34, /**< 34 SAMV71N20 USB Host / Device Controller (USBHS) */ - MCAN0_IRQn = 35, /**< 35 SAMV71N20 MCAN Controller 0 (MCAN0) */ - MCAN0_LINE1_IRQn = 36, /**< 36 SAMV71Q21 MCAN Controller 0 LINE1 (MCAN0) */ - MCAN1_IRQn = 37, /**< 37 SAMV71N20 MCAN Controller 1 (MCAN1) */ - MCAN1_LINE1_IRQn = 38, /**< 38 SAMV71Q21 MCAN Controller 1 LINE1 (MCAN1) */ - GMAC_IRQn = 39, /**< 39 SAMV71N20 Ethernet MAC (GMAC) */ - AFEC1_IRQn = 40, /**< 40 SAMV71N20 Analog Front End 1 (AFEC1) */ - TWIHS2_IRQn = 41, /**< 41 SAMV71N20 Two Wire Interface 2 HS (TWIHS2) */ - SPI1_IRQn = 42, /**< 42 SAMV71N20 Serial Peripheral Interface 1 (SPI1) */ - QSPI_IRQn = 43, /**< 43 SAMV71N20 Quad I/O Serial Peripheral Interface (QSPI) */ - UART2_IRQn = 44, /**< 44 SAMV71N20 UART 2 (UART2) */ - UART3_IRQn = 45, /**< 45 SAMV71N20 UART 3 (UART3) */ - UART4_IRQn = 46, /**< 46 SAMV71N20 UART 4 (UART4) */ - TC9_IRQn = 50, /**< 50 SAMV71N20 Timer/Counter 9 (TC9) */ - TC10_IRQn = 51, /**< 51 SAMV71N20 Timer/Counter 10 (TC10) */ - TC11_IRQn = 52, /**< 52 SAMV71N20 Timer/Counter 11 (TC11) */ - MLB_IRQn = 53, /**< 53 SAMV71N20 MediaLB (MLB) */ - AES_IRQn = 56, /**< 56 SAMV71N20 AES (AES) */ - TRNG_IRQn = 57, /**< 57 SAMV71N20 True Random Generator (TRNG) */ - XDMAC_IRQn = 58, /**< 58 SAMV71N20 DMA (XDMAC) */ - ISI_IRQn = 59, /**< 59 SAMV71N20 Camera Interface (ISI) */ - PWM1_IRQn = 60, /**< 60 SAMV71N20 Pulse Width Modulation 1 (PWM1) */ - RSWDT_IRQn = 63, /**< 63 SAMV71N20 Reinforced Secure Watchdog Timer (RSWDT) */ - - PERIPH_COUNT_IRQn = 64 /**< Number of peripheral IDs */ -} IRQn_Type; - -typedef struct _DeviceVectors -{ - /* Stack pointer */ - void* pvStack; - - /* Cortex-M handlers */ - void* pfnReset_Handler; - void* pfnNMI_Handler; - void* pfnHardFault_Handler; - void* pfnMemManage_Handler; - void* pfnBusFault_Handler; - void* pfnUsageFault_Handler; - void* pfnReserved1_Handler; - void* pfnReserved2_Handler; - void* pfnReserved3_Handler; - void* pfnReserved4_Handler; - void* pfnSVC_Handler; - void* pfnDebugMon_Handler; - void* pfnReserved5_Handler; - void* pfnPendSV_Handler; - void* pfnSysTick_Handler; - - /* Peripheral handlers */ - void* pfnSUPC_Handler; /* 0 Supply Controller */ - void* pfnRSTC_Handler; /* 1 Reset Controller */ - void* pfnRTC_Handler; /* 2 Real Time Clock */ - void* pfnRTT_Handler; /* 3 Real Time Timer */ - void* pfnWDT_Handler; /* 4 Watchdog Timer */ - void* pfnPMC_Handler; /* 5 Power Management Controller */ - void* pfnEFC_Handler; /* 6 Enhanced Embedded Flash Controller */ - void* pfnUART0_Handler; /* 7 UART 0 */ - void* pfnUART1_Handler; /* 8 UART 1 */ - void* pvReserved9; - void* pfnPIOA_Handler; /* 10 Parallel I/O Controller A */ - void* pfnPIOB_Handler; /* 11 Parallel I/O Controller B */ - void* pvReserved12; - void* pfnUSART0_Handler; /* 13 USART 0 */ - void* pfnUSART1_Handler; /* 14 USART 1 */ - void* pfnUSART2_Handler; /* 15 USART 2 */ - void* pfnPIOD_Handler; /* 16 Parallel I/O Controller D */ - void* pvReserved17; - void* pfnHSMCI_Handler; /* 18 Multimedia Card Interface */ - void* pfnTWIHS0_Handler; /* 19 Two Wire Interface 0 HS */ - void* pfnTWIHS1_Handler; /* 20 Two Wire Interface 1 HS */ - void* pfnSPI0_Handler; /* 21 Serial Peripheral Interface 0 */ - void* pfnSSC_Handler; /* 22 Synchronous Serial Controller */ - void* pfnTC0_Handler; /* 23 Timer/Counter 0 */ - void* pfnTC1_Handler; /* 24 Timer/Counter 1 */ - void* pfnTC2_Handler; /* 25 Timer/Counter 2 */ - void* pvReserved26; - void* pvReserved27; - void* pvReserved28; - void* pfnAFEC0_Handler; /* 29 Analog Front End 0 */ - void* pvReserved30; - void* pfnPWM0_Handler; /* 31 Pulse Width Modulation 0 */ - void* pfnICM_Handler; /* 32 Integrity Check Monitor */ - void* pfnACC_Handler; /* 33 Analog Comparator */ - void* pfnUSBHS_Handler; /* 34 USB Host / Device Controller */ - void* pfnMCAN0_Handler; /* 35 MCAN Controller 0 */ - void* pfnMCAN0_Line1_Handler; /* 36 MCAN Controller 0 */ - void* pfnMCAN1_Handler; /* 37 MCAN Controller 1 */ - void* pfnMCAN1_Line1_Handler; /* 38 MCAN Controller 1 */ - void* pfnGMAC_Handler; /* 39 Ethernet MAC */ - void* pfnAFEC1_Handler; /* 40 Analog Front End 1 */ - void* pfnTWIHS2_Handler; /* 41 Two Wire Interface 2 HS */ - void* pfnSPI1_Handler; /* 42 Serial Peripheral Interface 1 */ - void* pfnQSPI_Handler; /* 43 Quad I/O Serial Peripheral Interface */ - void* pfnUART2_Handler; /* 44 UART 2 */ - void* pfnUART3_Handler; /* 45 UART 3 */ - void* pfnUART4_Handler; /* 46 UART 4 */ - void* pvReserved47; - void* pvReserved48; - void* pvReserved49; - void* pfnTC9_Handler; /* 50 Timer/Counter 9 */ - void* pfnTC10_Handler; /* 51 Timer/Counter 10 */ - void* pfnTC11_Handler; /* 52 Timer/Counter 11 */ - void* pfnMLB_Handler; /* 53 MediaLB */ - void* pvReserved54; - void* pvReserved55; - void* pfnAES_Handler; /* 56 AES */ - void* pfnTRNG_Handler; /* 57 True Random Generator */ - void* pfnXDMAC_Handler; /* 58 DMA */ - void* pfnISI_Handler; /* 59 Camera Interface */ - void* pfnPWM1_Handler; /* 60 Pulse Width Modulation 1 */ - void* pvReserved61; - void* pvReserved62; - void* pfnRSWDT_Handler; /* 63 Reinforced Secure Watchdog Timer */ -} DeviceVectors; - -/* Cortex-M7 core handlers */ -void Reset_Handler ( void ); -void NMI_Handler ( void ); -void HardFault_Handler ( void ); -void MemManage_Handler ( void ); -void BusFault_Handler ( void ); -void UsageFault_Handler ( void ); -void SVC_Handler ( void ); -void DebugMon_Handler ( void ); -void PendSV_Handler ( void ); -void SysTick_Handler ( void ); - -/* Peripherals handlers */ -void ACC_Handler ( void ); -void AES_Handler ( void ); -void AFEC0_Handler ( void ); -void AFEC1_Handler ( void ); -void EFC_Handler ( void ); -void GMAC_Handler ( void ); -void HSMCI_Handler ( void ); -void ICM_Handler ( void ); -void ISI_Handler ( void ); -void MCAN0_Handler ( void ); -void MCAN0_Line1_Handler( void ); -void MCAN1_Handler ( void ); -void MCAN1_Line1_Handler( void ); -void MLB_Handler ( void ); -void PIOA_Handler ( void ); -void PIOB_Handler ( void ); -void PIOD_Handler ( void ); -void PMC_Handler ( void ); -void PWM0_Handler ( void ); -void PWM1_Handler ( void ); -void QSPI_Handler ( void ); -void RSTC_Handler ( void ); -void RSWDT_Handler ( void ); -void RTC_Handler ( void ); -void RTT_Handler ( void ); -void SPI0_Handler ( void ); -void SPI1_Handler ( void ); -void SSC_Handler ( void ); -void SUPC_Handler ( void ); -void TC0_Handler ( void ); -void TC1_Handler ( void ); -void TC2_Handler ( void ); -void TC9_Handler ( void ); -void TC10_Handler ( void ); -void TC11_Handler ( void ); -void TRNG_Handler ( void ); -void TWIHS0_Handler ( void ); -void TWIHS1_Handler ( void ); -void TWIHS2_Handler ( void ); -void UART0_Handler ( void ); -void UART1_Handler ( void ); -void UART2_Handler ( void ); -void UART3_Handler ( void ); -void UART4_Handler ( void ); -void USART0_Handler ( void ); -void USART1_Handler ( void ); -void USART2_Handler ( void ); -void USBHS_Handler ( void ); -void WDT_Handler ( void ); -void XDMAC_Handler ( void ); - -/** - * \brief Configuration of the Cortex-M7 Processor and Core Peripherals - */ - -#define __CM7_REV 0x0000 /**< SAMV71N20 core revision number ([15:8] revision number, [7:0] patch number) */ -#define __MPU_PRESENT 1 /**< SAMV71N20 does provide a MPU */ -#define __NVIC_PRIO_BITS 3 /**< SAMV71N20 uses 3 Bits for the Priority Levels */ -#define __FPU_PRESENT 1 /**< SAMV71N20 does provide a FPU */ -#define __FPU_DP 1 /**< SAMV71N20 Double precision FPU */ -#define __ICACHE_PRESENT 1 /**< SAMV71N20 does provide an Instruction Cache */ -#define __DCACHE_PRESENT 1 /**< SAMV71N20 does provide a Data Cache */ -#define __DTCM_PRESENT 1 /**< SAMV71N20 does provide a Data TCM */ -#define __ITCM_PRESENT 1 /**< SAMV71N20 does provide an Instruction TCM */ -#define __Vendor_SysTickConfig 0 /**< Set to 1 if different SysTick Config is used */ - -/* - * \brief CMSIS includes - */ - -#include -#if !defined DONT_USE_CMSIS_INIT -#include "system_samv71.h" -#endif /* DONT_USE_CMSIS_INIT */ - -/*@}*/ - -/* ************************************************************************** */ -/** SOFTWARE PERIPHERAL API DEFINITION FOR SAMV71N20 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71N20_api Peripheral Software API */ -/*@{*/ - -#include "component/component_acc.h" -#include "component/component_aes.h" -#include "component/component_afec.h" -#include "component/component_chipid.h" -#include "component/component_efc.h" -#include "component/component_gmac.h" -#include "component/component_gpbr.h" -#include "component/component_hsmci.h" -#include "component/component_icm.h" -#include "component/component_isi.h" -#include "component/component_matrix.h" -#include "component/component_mcan.h" -#include "component/component_mlb.h" -#include "component/component_pio.h" -#include "component/component_pmc.h" -#include "component/component_pwm.h" -#include "component/component_qspi.h" -#include "component/component_rstc.h" -#include "component/component_rswdt.h" -#include "component/component_rtc.h" -#include "component/component_rtt.h" -#include "component/component_spi.h" -#include "component/component_ssc.h" -#include "component/component_supc.h" -#include "component/component_tc.h" -#include "component/component_trng.h" -#include "component/component_twihs.h" -#include "component/component_uart.h" -#include "component/component_usart.h" -#include "component/component_usbhs.h" -#include "component/component_utmi.h" -#include "component/component_wdt.h" -#include "component/component_xdmac.h" -/*@}*/ - -/* ************************************************************************** */ -/* REGISTER ACCESS DEFINITIONS FOR SAMV71N20 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71N20_reg Registers Access Definitions */ -/*@{*/ - -#include "instance/instance_hsmci.h" -#include "instance/instance_ssc.h" -#include "instance/instance_spi0.h" -#include "instance/instance_tc0.h" -#include "instance/instance_twihs0.h" -#include "instance/instance_twihs1.h" -#include "instance/instance_pwm0.h" -#include "instance/instance_usart0.h" -#include "instance/instance_usart1.h" -#include "instance/instance_usart2.h" -#include "instance/instance_mcan0.h" -#include "instance/instance_mcan1.h" -#include "instance/instance_usbhs.h" -#include "instance/instance_afec0.h" -#include "instance/instance_acc.h" -#include "instance/instance_icm.h" -#include "instance/instance_isi.h" -#include "instance/instance_gmac.h" -#include "instance/instance_tc3.h" -#include "instance/instance_spi1.h" -#include "instance/instance_pwm1.h" -#include "instance/instance_twihs2.h" -#include "instance/instance_afec1.h" -#include "instance/instance_mlb.h" -#include "instance/instance_aes.h" -#include "instance/instance_trng.h" -#include "instance/instance_xdmac.h" -#include "instance/instance_qspi.h" -#include "instance/instance_matrix.h" -#include "instance/instance_utmi.h" -#include "instance/instance_pmc.h" -#include "instance/instance_uart0.h" -#include "instance/instance_chipid.h" -#include "instance/instance_uart1.h" -#include "instance/instance_efc.h" -#include "instance/instance_pioa.h" -#include "instance/instance_piob.h" -#include "instance/instance_piod.h" -#include "instance/instance_rstc.h" -#include "instance/instance_supc.h" -#include "instance/instance_rtt.h" -#include "instance/instance_wdt.h" -#include "instance/instance_rtc.h" -#include "instance/instance_gpbr.h" -#include "instance/instance_rswdt.h" -#include "instance/instance_uart2.h" -#include "instance/instance_uart3.h" -#include "instance/instance_uart4.h" -/*@}*/ - -/* ************************************************************************** */ -/* PERIPHERAL ID DEFINITIONS FOR SAMV71N20 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71N20_id Peripheral Ids Definitions */ -/*@{*/ - -#define ID_SUPC ( 0) /**< \brief Supply Controller (SUPC) */ -#define ID_RSTC ( 1) /**< \brief Reset Controller (RSTC) */ -#define ID_RTC ( 2) /**< \brief Real Time Clock (RTC) */ -#define ID_RTT ( 3) /**< \brief Real Time Timer (RTT) */ -#define ID_WDT ( 4) /**< \brief Watchdog Timer (WDT) */ -#define ID_PMC ( 5) /**< \brief Power Management Controller (PMC) */ -#define ID_EFC ( 6) /**< \brief Enhanced Embedded Flash Controller (EFC) */ -#define ID_UART0 ( 7) /**< \brief UART 0 (UART0) */ -#define ID_UART1 ( 8) /**< \brief UART 1 (UART1) */ -#define ID_PIOA (10) /**< \brief Parallel I/O Controller A (PIOA) */ -#define ID_PIOB (11) /**< \brief Parallel I/O Controller B (PIOB) */ -#define ID_USART0 (13) /**< \brief USART 0 (USART0) */ -#define ID_USART1 (14) /**< \brief USART 1 (USART1) */ -#define ID_USART2 (15) /**< \brief USART 2 (USART2) */ -#define ID_PIOD (16) /**< \brief Parallel I/O Controller D (PIOD) */ -#define ID_HSMCI (18) /**< \brief Multimedia Card Interface (HSMCI) */ -#define ID_TWIHS0 (19) /**< \brief Two Wire Interface 0 HS (TWIHS0) */ -#define ID_TWIHS1 (20) /**< \brief Two Wire Interface 1 HS (TWIHS1) */ -#define ID_SPI0 (21) /**< \brief Serial Peripheral Interface 0 (SPI0) */ -#define ID_SSC (22) /**< \brief Synchronous Serial Controller (SSC) */ -#define ID_TC0 (23) /**< \brief Timer/Counter 0 (TC0) */ -#define ID_TC1 (24) /**< \brief Timer/Counter 1 (TC1) */ -#define ID_TC2 (25) /**< \brief Timer/Counter 2 (TC2) */ -#define ID_AFEC0 (29) /**< \brief Analog Front End 0 (AFEC0) */ -#define ID_PWM0 (31) /**< \brief Pulse Width Modulation 0 (PWM0) */ -#define ID_ICM (32) /**< \brief Integrity Check Monitor (ICM) */ -#define ID_ACC (33) /**< \brief Analog Comparator (ACC) */ -#define ID_USBHS (34) /**< \brief USB Host / Device Controller (USBHS) */ -#define ID_MCAN0 (35) /**< \brief MCAN Controller 0 (MCAN0) */ -#define ID_MCAN1 (37) /**< \brief MCAN Controller 1 (MCAN1) */ -#define ID_GMAC (39) /**< \brief Ethernet MAC (GMAC) */ -#define ID_AFEC1 (40) /**< \brief Analog Front End 1 (AFEC1) */ -#define ID_TWIHS2 (41) /**< \brief Two Wire Interface 2 HS (TWIHS2) */ -#define ID_SPI1 (42) /**< \brief Serial Peripheral Interface 1 (SPI1) */ -#define ID_QSPI (43) /**< \brief Quad I/O Serial Peripheral Interface (QSPI) */ -#define ID_UART2 (44) /**< \brief UART 2 (UART2) */ -#define ID_UART3 (45) /**< \brief UART 3 (UART3) */ -#define ID_UART4 (46) /**< \brief UART 4 (UART4) */ -#define ID_TC9 (50) /**< \brief Timer/Counter 9 (TC9) */ -#define ID_TC10 (51) /**< \brief Timer/Counter 10 (TC10) */ -#define ID_TC11 (52) /**< \brief Timer/Counter 11 (TC11) */ -#define ID_MLB (53) /**< \brief MediaLB (MLB) */ -#define ID_AES (56) /**< \brief AES (AES) */ -#define ID_TRNG (57) /**< \brief True Random Generator (TRNG) */ -#define ID_XDMAC (58) /**< \brief DMA (XDMAC) */ -#define ID_ISI (59) /**< \brief Camera Interface (ISI) */ -#define ID_PWM1 (60) /**< \brief Pulse Width Modulation 1 (PWM1) */ -#define ID_RSWDT (63) /**< \brief Reinforced Secure Watchdog Timer (RSWDT) */ - -#define ID_PERIPH_COUNT (64) /**< \brief Number of peripheral IDs */ -/*@}*/ - -/* ************************************************************************** */ -/* BASE ADDRESS DEFINITIONS FOR SAMV71N20 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71N20_base Peripheral Base Address Definitions */ -/*@{*/ - -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -#define HSMCI (0x40000000U) /**< \brief (HSMCI ) Base Address */ -#define SSC (0x40004000U) /**< \brief (SSC ) Base Address */ -#define SPI0 (0x40008000U) /**< \brief (SPI0 ) Base Address */ -#define TC0 (0x4000C000U) /**< \brief (TC0 ) Base Address */ -#define TWIHS0 (0x40018000U) /**< \brief (TWIHS0) Base Address */ -#define TWIHS1 (0x4001C000U) /**< \brief (TWIHS1) Base Address */ -#define PWM0 (0x40020000U) /**< \brief (PWM0 ) Base Address */ -#define USART0 (0x40024000U) /**< \brief (USART0) Base Address */ -#define USART1 (0x40028000U) /**< \brief (USART1) Base Address */ -#define USART2 (0x4002C000U) /**< \brief (USART2) Base Address */ -#define MCAN0 (0x40030000U) /**< \brief (MCAN0 ) Base Address */ -#define MCAN1 (0x40034000U) /**< \brief (MCAN1 ) Base Address */ -#define USBHS (0x40038000U) /**< \brief (USBHS ) Base Address */ -#define AFEC0 (0x4003C000U) /**< \brief (AFEC0 ) Base Address */ -#define ACC (0x40044000U) /**< \brief (ACC ) Base Address */ -#define ICM (0x40048000U) /**< \brief (ICM ) Base Address */ -#define ISI (0x4004C000U) /**< \brief (ISI ) Base Address */ -#define GMAC (0x40050000U) /**< \brief (GMAC ) Base Address */ -#define TC3 (0x40054000U) /**< \brief (TC3 ) Base Address */ -#define SPI1 (0x40058000U) /**< \brief (SPI1 ) Base Address */ -#define PWM1 (0x4005C000U) /**< \brief (PWM1 ) Base Address */ -#define TWIHS2 (0x40060000U) /**< \brief (TWIHS2) Base Address */ -#define AFEC1 (0x40064000U) /**< \brief (AFEC1 ) Base Address */ -#define MLB (0x40068000U) /**< \brief (MLB ) Base Address */ -#define AES (0x4006C000U) /**< \brief (AES ) Base Address */ -#define TRNG (0x40070000U) /**< \brief (TRNG ) Base Address */ -#define XDMAC (0x40078000U) /**< \brief (XDMAC ) Base Address */ -#define QSPI (0x4007C000U) /**< \brief (QSPI ) Base Address */ -#define MATRIX (0x40088000U) /**< \brief (MATRIX) Base Address */ -#define UTMI (0x400E0400U) /**< \brief (UTMI ) Base Address */ -#define PMC (0x400E0600U) /**< \brief (PMC ) Base Address */ -#define UART0 (0x400E0800U) /**< \brief (UART0 ) Base Address */ -#define CHIPID (0x400E0940U) /**< \brief (CHIPID) Base Address */ -#define UART1 (0x400E0A00U) /**< \brief (UART1 ) Base Address */ -#define EFC (0x400E0C00U) /**< \brief (EFC ) Base Address */ -#define PIOA (0x400E0E00U) /**< \brief (PIOA ) Base Address */ -#define PIOB (0x400E1000U) /**< \brief (PIOB ) Base Address */ -#define PIOD (0x400E1400U) /**< \brief (PIOD ) Base Address */ -#define RSTC (0x400E1800U) /**< \brief (RSTC ) Base Address */ -#define SUPC (0x400E1810U) /**< \brief (SUPC ) Base Address */ -#define RTT (0x400E1830U) /**< \brief (RTT ) Base Address */ -#define WDT (0x400E1850U) /**< \brief (WDT ) Base Address */ -#define RTC (0x400E1860U) /**< \brief (RTC ) Base Address */ -#define GPBR (0x400E1890U) /**< \brief (GPBR ) Base Address */ -#define RSWDT (0x400E1900U) /**< \brief (RSWDT ) Base Address */ -#define UART2 (0x400E1A00U) /**< \brief (UART2 ) Base Address */ -#define UART3 (0x400E1C00U) /**< \brief (UART3 ) Base Address */ -#define UART4 (0x400E1E00U) /**< \brief (UART4 ) Base Address */ -#else -#define HSMCI ((Hsmci *)0x40000000U) /**< \brief (HSMCI ) Base Address */ -#define SSC ((Ssc *)0x40004000U) /**< \brief (SSC ) Base Address */ -#define SPI0 ((Spi *)0x40008000U) /**< \brief (SPI0 ) Base Address */ -#define TC0 ((Tc *)0x4000C000U) /**< \brief (TC0 ) Base Address */ -#define TWIHS0 ((Twihs *)0x40018000U) /**< \brief (TWIHS0) Base Address */ -#define TWIHS1 ((Twihs *)0x4001C000U) /**< \brief (TWIHS1) Base Address */ -#define PWM0 ((Pwm *)0x40020000U) /**< \brief (PWM0 ) Base Address */ -#define USART0 ((Usart *)0x40024000U) /**< \brief (USART0) Base Address */ -#define USART1 ((Usart *)0x40028000U) /**< \brief (USART1) Base Address */ -#define USART2 ((Usart *)0x4002C000U) /**< \brief (USART2) Base Address */ -#define MCAN0 ((Mcan *)0x40030000U) /**< \brief (MCAN0 ) Base Address */ -#define MCAN1 ((Mcan *)0x40034000U) /**< \brief (MCAN1 ) Base Address */ -#define USBHS ((Usbhs *)0x40038000U) /**< \brief (USBHS ) Base Address */ -#define AFEC0 ((Afec *)0x4003C000U) /**< \brief (AFEC0 ) Base Address */ -#define ACC ((Acc *)0x40044000U) /**< \brief (ACC ) Base Address */ -#define ICM ((Icm *)0x40048000U) /**< \brief (ICM ) Base Address */ -#define ISI ((Isi *)0x4004C000U) /**< \brief (ISI ) Base Address */ -#define GMAC ((Gmac *)0x40050000U) /**< \brief (GMAC ) Base Address */ -#define TC3 ((Tc *)0x40054000U) /**< \brief (TC3 ) Base Address */ -#define SPI1 ((Spi *)0x40058000U) /**< \brief (SPI1 ) Base Address */ -#define PWM1 ((Pwm *)0x4005C000U) /**< \brief (PWM1 ) Base Address */ -#define TWIHS2 ((Twihs *)0x40060000U) /**< \brief (TWIHS2) Base Address */ -#define AFEC1 ((Afec *)0x40064000U) /**< \brief (AFEC1 ) Base Address */ -#define MLB ((Mlb *)0x40068000U) /**< \brief (MLB ) Base Address */ -#define AES ((Aes *)0x4006C000U) /**< \brief (AES ) Base Address */ -#define TRNG ((Trng *)0x40070000U) /**< \brief (TRNG ) Base Address */ -#define XDMAC ((Xdmac *)0x40078000U) /**< \brief (XDMAC ) Base Address */ -#define QSPI ((Qspi *)0x4007C000U) /**< \brief (QSPI ) Base Address */ -#define MATRIX ((Matrix *)0x40088000U) /**< \brief (MATRIX) Base Address */ -#define UTMI ((Utmi *)0x400E0400U) /**< \brief (UTMI ) Base Address */ -#define PMC ((Pmc *)0x400E0600U) /**< \brief (PMC ) Base Address */ -#define UART0 ((Uart *)0x400E0800U) /**< \brief (UART0 ) Base Address */ -#define CHIPID ((Chipid *)0x400E0940U) /**< \brief (CHIPID) Base Address */ -#define UART1 ((Uart *)0x400E0A00U) /**< \brief (UART1 ) Base Address */ -#define EFC ((Efc *)0x400E0C00U) /**< \brief (EFC ) Base Address */ -#define PIOA ((Pio *)0x400E0E00U) /**< \brief (PIOA ) Base Address */ -#define PIOB ((Pio *)0x400E1000U) /**< \brief (PIOB ) Base Address */ -#define PIOD ((Pio *)0x400E1400U) /**< \brief (PIOD ) Base Address */ -#define RSTC ((Rstc *)0x400E1800U) /**< \brief (RSTC ) Base Address */ -#define SUPC ((Supc *)0x400E1810U) /**< \brief (SUPC ) Base Address */ -#define RTT ((Rtt *)0x400E1830U) /**< \brief (RTT ) Base Address */ -#define WDT ((Wdt *)0x400E1850U) /**< \brief (WDT ) Base Address */ -#define RTC ((Rtc *)0x400E1860U) /**< \brief (RTC ) Base Address */ -#define GPBR ((Gpbr *)0x400E1890U) /**< \brief (GPBR ) Base Address */ -#define RSWDT ((Rswdt *)0x400E1900U) /**< \brief (RSWDT ) Base Address */ -#define UART2 ((Uart *)0x400E1A00U) /**< \brief (UART2 ) Base Address */ -#define UART3 ((Uart *)0x400E1C00U) /**< \brief (UART3 ) Base Address */ -#define UART4 ((Uart *)0x400E1E00U) /**< \brief (UART4 ) Base Address */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/*@}*/ - -/* ************************************************************************** */ -/* PIO DEFINITIONS FOR SAMV71N20 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71N20_pio Peripheral Pio Definitions */ -/*@{*/ - -#include "pio/pio_samv71n20.h" -/*@}*/ - -/* ************************************************************************** */ -/* MEMORY MAPPING DEFINITIONS FOR SAMV71N20 */ -/* ************************************************************************** */ - -#define IFLASH_SIZE (0x100000u) -#define IFLASH_PAGE_SIZE (512u) -#define IFLASH_LOCK_REGION_SIZE (16384u) -#define IFLASH_NB_OF_PAGES (2048u) -#define IFLASH_NB_OF_LOCK_BITS (64u) -#define IRAM_SIZE (0x60000u) - -#define QSPIMEM_ADDR (0x80000000u) /**< QSPI Memory base address */ -#define AXIMX_ADDR (0xA0000000u) /**< AXI Bus Matrix base address */ -#define ITCM_ADDR (0x00000000u) /**< Instruction Tightly Coupled Memory base address */ -#define IFLASH_ADDR (0x00400000u) /**< Internal Flash base address */ -#define IROM_ADDR (0x00800000u) /**< Internal ROM base address */ -#define DTCM_ADDR (0x20000000u) /**< Data Tightly Coupled Memory base address */ -#define IRAM_ADDR (0x20400000u) /**< Internal RAM base address */ -#define EBI_CS0_ADDR (0x60000000u) /**< EBI Chip Select 0 base address */ -#define EBI_CS1_ADDR (0x61000000u) /**< EBI Chip Select 1 base address */ -#define EBI_CS2_ADDR (0x62000000u) /**< EBI Chip Select 2 base address */ -#define EBI_CS3_ADDR (0x63000000u) /**< EBI Chip Select 3 base address */ -#define SDRAM_CS_ADDR (0x70000000u) /**< SDRAM Chip Select base address */ - -/* ************************************************************************** */ -/* MISCELLANEOUS DEFINITIONS FOR SAMV71N20 */ -/* ************************************************************************** */ - -#define CHIP_JTAGID (0x05B3D03FUL) -#define CHIP_CIDR (0xA1220C00UL) -#define CHIP_EXID (0x00000001UL) - -/* ************************************************************************** */ -/* ELECTRICAL DEFINITIONS FOR SAMV71N20 */ -/* ************************************************************************** */ - -/* %ATMEL_ELECTRICAL% */ - -/* Device characteristics */ -#define CHIP_FREQ_SLCK_RC_MIN (20000UL) -#define CHIP_FREQ_SLCK_RC (32000UL) -#define CHIP_FREQ_SLCK_RC_MAX (44000UL) -#define CHIP_FREQ_MAINCK_RC_4MHZ (4000000UL) -#define CHIP_FREQ_MAINCK_RC_8MHZ (8000000UL) -#define CHIP_FREQ_MAINCK_RC_12MHZ (12000000UL) -#define CHIP_FREQ_CPU_MAX (300000000UL) -#define CHIP_FREQ_XTAL_32K (32768UL) -#define CHIP_FREQ_XTAL_12M (12000000UL) - -/* Embedded Flash Read Wait State (VDDCORE set at 1.20V) */ -#define CHIP_FREQ_FWS_0 (26000000UL) /**< \brief Maximum operating frequency when FWS is 0 */ -#define CHIP_FREQ_FWS_1 (52000000UL) /**< \brief Maximum operating frequency when FWS is 1 */ -#define CHIP_FREQ_FWS_2 (78000000UL) /**< \brief Maximum operating frequency when FWS is 2 */ -#define CHIP_FREQ_FWS_3 (104000000UL) /**< \brief Maximum operating frequency when FWS is 3 */ -#define CHIP_FREQ_FWS_4 (131000000UL) /**< \brief Maximum operating frequency when FWS is 4 */ -#define CHIP_FREQ_FWS_5 (150000000UL) /**< \brief Maximum operating frequency when FWS is 5 */ - - -#ifdef __cplusplus -} -#endif - -/*@}*/ - -#endif /* _SAMV71N20_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/samv71n21.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/samv71n21.h deleted file mode 100644 index 3159fc34..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/samv71n21.h +++ /dev/null @@ -1,639 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71N21_ -#define _SAMV71N21_ - -/** \addtogroup SAMV71N21_definitions SAMV71N21 definitions - This file defines all structures and symbols for SAMV71N21: - - registers and bit-fields - - peripheral base address - - peripheral ID - - PIO definitions -*/ -/*@{*/ - -#ifdef __cplusplus - extern "C" { -#endif - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -#include -#endif - -/* ************************************************************************** */ -/* CMSIS DEFINITIONS FOR SAMV71N21 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71N21_cmsis CMSIS Definitions */ -/*@{*/ - -/**< Interrupt Number Definition */ -typedef enum IRQn -{ -/****** Cortex-M7 Processor Exceptions Numbers ******************************/ - NonMaskableInt_IRQn = -14, /**< 2 Non Maskable Interrupt */ - HardFault_IRQn = -13, /**< 3 HardFault Interrupt */ - MemoryManagement_IRQn = -12, /**< 4 Cortex-M7 Memory Management Interrupt */ - BusFault_IRQn = -11, /**< 5 Cortex-M7 Bus Fault Interrupt */ - UsageFault_IRQn = -10, /**< 6 Cortex-M7 Usage Fault Interrupt */ - SVCall_IRQn = -5, /**< 11 Cortex-M7 SV Call Interrupt */ - DebugMonitor_IRQn = -4, /**< 12 Cortex-M7 Debug Monitor Interrupt */ - PendSV_IRQn = -2, /**< 14 Cortex-M7 Pend SV Interrupt */ - SysTick_IRQn = -1, /**< 15 Cortex-M7 System Tick Interrupt */ -/****** SAMV71N21 specific Interrupt Numbers *********************************/ - - SUPC_IRQn = 0, /**< 0 SAMV71N21 Supply Controller (SUPC) */ - RSTC_IRQn = 1, /**< 1 SAMV71N21 Reset Controller (RSTC) */ - RTC_IRQn = 2, /**< 2 SAMV71N21 Real Time Clock (RTC) */ - RTT_IRQn = 3, /**< 3 SAMV71N21 Real Time Timer (RTT) */ - WDT_IRQn = 4, /**< 4 SAMV71N21 Watchdog Timer (WDT) */ - PMC_IRQn = 5, /**< 5 SAMV71N21 Power Management Controller (PMC) */ - EFC_IRQn = 6, /**< 6 SAMV71N21 Enhanced Embedded Flash Controller (EFC) */ - UART0_IRQn = 7, /**< 7 SAMV71N21 UART 0 (UART0) */ - UART1_IRQn = 8, /**< 8 SAMV71N21 UART 1 (UART1) */ - PIOA_IRQn = 10, /**< 10 SAMV71N21 Parallel I/O Controller A (PIOA) */ - PIOB_IRQn = 11, /**< 11 SAMV71N21 Parallel I/O Controller B (PIOB) */ - USART0_IRQn = 13, /**< 13 SAMV71N21 USART 0 (USART0) */ - USART1_IRQn = 14, /**< 14 SAMV71N21 USART 1 (USART1) */ - USART2_IRQn = 15, /**< 15 SAMV71N21 USART 2 (USART2) */ - PIOD_IRQn = 16, /**< 16 SAMV71N21 Parallel I/O Controller D (PIOD) */ - HSMCI_IRQn = 18, /**< 18 SAMV71N21 Multimedia Card Interface (HSMCI) */ - TWIHS0_IRQn = 19, /**< 19 SAMV71N21 Two Wire Interface 0 HS (TWIHS0) */ - TWIHS1_IRQn = 20, /**< 20 SAMV71N21 Two Wire Interface 1 HS (TWIHS1) */ - SPI0_IRQn = 21, /**< 21 SAMV71N21 Serial Peripheral Interface 0 (SPI0) */ - SSC_IRQn = 22, /**< 22 SAMV71N21 Synchronous Serial Controller (SSC) */ - TC0_IRQn = 23, /**< 23 SAMV71N21 Timer/Counter 0 (TC0) */ - TC1_IRQn = 24, /**< 24 SAMV71N21 Timer/Counter 1 (TC1) */ - TC2_IRQn = 25, /**< 25 SAMV71N21 Timer/Counter 2 (TC2) */ - AFEC0_IRQn = 29, /**< 29 SAMV71N21 Analog Front End 0 (AFEC0) */ - PWM0_IRQn = 31, /**< 31 SAMV71N21 Pulse Width Modulation 0 (PWM0) */ - ICM_IRQn = 32, /**< 32 SAMV71N21 Integrity Check Monitor (ICM) */ - ACC_IRQn = 33, /**< 33 SAMV71N21 Analog Comparator (ACC) */ - USBHS_IRQn = 34, /**< 34 SAMV71N21 USB Host / Device Controller (USBHS) */ - MCAN0_IRQn = 35, /**< 35 SAMV71N21 MCAN Controller 0 (MCAN0) */ - MCAN0_LINE1_IRQn = 36, /**< 36 SAMV71Q21 MCAN Controller 0 LINE1 (MCAN0) */ - MCAN1_IRQn = 37, /**< 37 SAMV71N21 MCAN Controller 1 (MCAN1) */ - MCAN1_LINE1_IRQn = 38, /**< 38 SAMV71Q21 MCAN Controller 1 LINE1 (MCAN1) */ - GMAC_IRQn = 39, /**< 39 SAMV71N21 Ethernet MAC (GMAC) */ - AFEC1_IRQn = 40, /**< 40 SAMV71N21 Analog Front End 1 (AFEC1) */ - TWIHS2_IRQn = 41, /**< 41 SAMV71N21 Two Wire Interface 2 HS (TWIHS2) */ - SPI1_IRQn = 42, /**< 42 SAMV71N21 Serial Peripheral Interface 1 (SPI1) */ - QSPI_IRQn = 43, /**< 43 SAMV71N21 Quad I/O Serial Peripheral Interface (QSPI) */ - UART2_IRQn = 44, /**< 44 SAMV71N21 UART 2 (UART2) */ - UART3_IRQn = 45, /**< 45 SAMV71N21 UART 3 (UART3) */ - UART4_IRQn = 46, /**< 46 SAMV71N21 UART 4 (UART4) */ - TC9_IRQn = 50, /**< 50 SAMV71N21 Timer/Counter 9 (TC9) */ - TC10_IRQn = 51, /**< 51 SAMV71N21 Timer/Counter 10 (TC10) */ - TC11_IRQn = 52, /**< 52 SAMV71N21 Timer/Counter 11 (TC11) */ - MLB_IRQn = 53, /**< 53 SAMV71N21 MediaLB (MLB) */ - AES_IRQn = 56, /**< 56 SAMV71N21 AES (AES) */ - TRNG_IRQn = 57, /**< 57 SAMV71N21 True Random Generator (TRNG) */ - XDMAC_IRQn = 58, /**< 58 SAMV71N21 DMA (XDMAC) */ - ISI_IRQn = 59, /**< 59 SAMV71N21 Camera Interface (ISI) */ - PWM1_IRQn = 60, /**< 60 SAMV71N21 Pulse Width Modulation 1 (PWM1) */ - RSWDT_IRQn = 63, /**< 63 SAMV71N21 Reinforced Secure Watchdog Timer (RSWDT) */ - - PERIPH_COUNT_IRQn = 64 /**< Number of peripheral IDs */ -} IRQn_Type; - -typedef struct _DeviceVectors -{ - /* Stack pointer */ - void* pvStack; - - /* Cortex-M handlers */ - void* pfnReset_Handler; - void* pfnNMI_Handler; - void* pfnHardFault_Handler; - void* pfnMemManage_Handler; - void* pfnBusFault_Handler; - void* pfnUsageFault_Handler; - void* pfnReserved1_Handler; - void* pfnReserved2_Handler; - void* pfnReserved3_Handler; - void* pfnReserved4_Handler; - void* pfnSVC_Handler; - void* pfnDebugMon_Handler; - void* pfnReserved5_Handler; - void* pfnPendSV_Handler; - void* pfnSysTick_Handler; - - /* Peripheral handlers */ - void* pfnSUPC_Handler; /* 0 Supply Controller */ - void* pfnRSTC_Handler; /* 1 Reset Controller */ - void* pfnRTC_Handler; /* 2 Real Time Clock */ - void* pfnRTT_Handler; /* 3 Real Time Timer */ - void* pfnWDT_Handler; /* 4 Watchdog Timer */ - void* pfnPMC_Handler; /* 5 Power Management Controller */ - void* pfnEFC_Handler; /* 6 Enhanced Embedded Flash Controller */ - void* pfnUART0_Handler; /* 7 UART 0 */ - void* pfnUART1_Handler; /* 8 UART 1 */ - void* pvReserved9; - void* pfnPIOA_Handler; /* 10 Parallel I/O Controller A */ - void* pfnPIOB_Handler; /* 11 Parallel I/O Controller B */ - void* pvReserved12; - void* pfnUSART0_Handler; /* 13 USART 0 */ - void* pfnUSART1_Handler; /* 14 USART 1 */ - void* pfnUSART2_Handler; /* 15 USART 2 */ - void* pfnPIOD_Handler; /* 16 Parallel I/O Controller D */ - void* pvReserved17; - void* pfnHSMCI_Handler; /* 18 Multimedia Card Interface */ - void* pfnTWIHS0_Handler; /* 19 Two Wire Interface 0 HS */ - void* pfnTWIHS1_Handler; /* 20 Two Wire Interface 1 HS */ - void* pfnSPI0_Handler; /* 21 Serial Peripheral Interface 0 */ - void* pfnSSC_Handler; /* 22 Synchronous Serial Controller */ - void* pfnTC0_Handler; /* 23 Timer/Counter 0 */ - void* pfnTC1_Handler; /* 24 Timer/Counter 1 */ - void* pfnTC2_Handler; /* 25 Timer/Counter 2 */ - void* pvReserved26; - void* pvReserved27; - void* pvReserved28; - void* pfnAFEC0_Handler; /* 29 Analog Front End 0 */ - void* pvReserved30; - void* pfnPWM0_Handler; /* 31 Pulse Width Modulation 0 */ - void* pfnICM_Handler; /* 32 Integrity Check Monitor */ - void* pfnACC_Handler; /* 33 Analog Comparator */ - void* pfnUSBHS_Handler; /* 34 USB Host / Device Controller */ - void* pfnMCAN0_Handler; /* 35 MCAN Controller 0 */ - void* pfnMCAN0_Line1_Handler; /* 36 MCAN Controller 0 */ - void* pfnMCAN1_Handler; /* 37 MCAN Controller 1 */ - void* pfnMCAN1_Line1_Handler; /* 38 MCAN Controller 1 */ - void* pfnGMAC_Handler; /* 39 Ethernet MAC */ - void* pfnAFEC1_Handler; /* 40 Analog Front End 1 */ - void* pfnTWIHS2_Handler; /* 41 Two Wire Interface 2 HS */ - void* pfnSPI1_Handler; /* 42 Serial Peripheral Interface 1 */ - void* pfnQSPI_Handler; /* 43 Quad I/O Serial Peripheral Interface */ - void* pfnUART2_Handler; /* 44 UART 2 */ - void* pfnUART3_Handler; /* 45 UART 3 */ - void* pfnUART4_Handler; /* 46 UART 4 */ - void* pvReserved47; - void* pvReserved48; - void* pvReserved49; - void* pfnTC9_Handler; /* 50 Timer/Counter 9 */ - void* pfnTC10_Handler; /* 51 Timer/Counter 10 */ - void* pfnTC11_Handler; /* 52 Timer/Counter 11 */ - void* pfnMLB_Handler; /* 53 MediaLB */ - void* pvReserved54; - void* pvReserved55; - void* pfnAES_Handler; /* 56 AES */ - void* pfnTRNG_Handler; /* 57 True Random Generator */ - void* pfnXDMAC_Handler; /* 58 DMA */ - void* pfnISI_Handler; /* 59 Camera Interface */ - void* pfnPWM1_Handler; /* 60 Pulse Width Modulation 1 */ - void* pvReserved61; - void* pvReserved62; - void* pfnRSWDT_Handler; /* 63 Reinforced Secure Watchdog Timer */ -} DeviceVectors; - -/* Cortex-M7 core handlers */ -void Reset_Handler ( void ); -void NMI_Handler ( void ); -void HardFault_Handler ( void ); -void MemManage_Handler ( void ); -void BusFault_Handler ( void ); -void UsageFault_Handler ( void ); -void SVC_Handler ( void ); -void DebugMon_Handler ( void ); -void PendSV_Handler ( void ); -void SysTick_Handler ( void ); - -/* Peripherals handlers */ -void ACC_Handler ( void ); -void AES_Handler ( void ); -void AFEC0_Handler ( void ); -void AFEC1_Handler ( void ); -void EFC_Handler ( void ); -void GMAC_Handler ( void ); -void HSMCI_Handler ( void ); -void ICM_Handler ( void ); -void ISI_Handler ( void ); -void MCAN0_Handler ( void ); -void MCAN0_Line1_Handler( void ); -void MCAN1_Handler ( void ); -void MCAN1_Line1_Handler( void ); -void MLB_Handler ( void ); -void PIOA_Handler ( void ); -void PIOB_Handler ( void ); -void PIOD_Handler ( void ); -void PMC_Handler ( void ); -void PWM0_Handler ( void ); -void PWM1_Handler ( void ); -void QSPI_Handler ( void ); -void RSTC_Handler ( void ); -void RSWDT_Handler ( void ); -void RTC_Handler ( void ); -void RTT_Handler ( void ); -void SPI0_Handler ( void ); -void SPI1_Handler ( void ); -void SSC_Handler ( void ); -void SUPC_Handler ( void ); -void TC0_Handler ( void ); -void TC1_Handler ( void ); -void TC2_Handler ( void ); -void TC9_Handler ( void ); -void TC10_Handler ( void ); -void TC11_Handler ( void ); -void TRNG_Handler ( void ); -void TWIHS0_Handler ( void ); -void TWIHS1_Handler ( void ); -void TWIHS2_Handler ( void ); -void UART0_Handler ( void ); -void UART1_Handler ( void ); -void UART2_Handler ( void ); -void UART3_Handler ( void ); -void UART4_Handler ( void ); -void USART0_Handler ( void ); -void USART1_Handler ( void ); -void USART2_Handler ( void ); -void USBHS_Handler ( void ); -void WDT_Handler ( void ); -void XDMAC_Handler ( void ); - -/** - * \brief Configuration of the Cortex-M7 Processor and Core Peripherals - */ - -#define __CM7_REV 0x0000 /**< SAMV71N21 core revision number ([15:8] revision number, [7:0] patch number) */ -#define __MPU_PRESENT 1 /**< SAMV71N21 does provide a MPU */ -#define __NVIC_PRIO_BITS 3 /**< SAMV71N21 uses 3 Bits for the Priority Levels */ -#define __FPU_PRESENT 1 /**< SAMV71N21 does provide a FPU */ -#define __FPU_DP 1 /**< SAMV71N21 Double precision FPU */ -#define __ICACHE_PRESENT 1 /**< SAMV71N21 does provide an Instruction Cache */ -#define __DCACHE_PRESENT 1 /**< SAMV71N21 does provide a Data Cache */ -#define __DTCM_PRESENT 1 /**< SAMV71N21 does provide a Data TCM */ -#define __ITCM_PRESENT 1 /**< SAMV71N21 does provide an Instruction TCM */ -#define __Vendor_SysTickConfig 0 /**< Set to 1 if different SysTick Config is used */ - -/* - * \brief CMSIS includes - */ - -#include -#if !defined DONT_USE_CMSIS_INIT -#include "system_samv71.h" -#endif /* DONT_USE_CMSIS_INIT */ - -/*@}*/ - -/* ************************************************************************** */ -/** SOFTWARE PERIPHERAL API DEFINITION FOR SAMV71N21 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71N21_api Peripheral Software API */ -/*@{*/ - -#include "component/component_acc.h" -#include "component/component_aes.h" -#include "component/component_afec.h" -#include "component/component_chipid.h" -#include "component/component_efc.h" -#include "component/component_gmac.h" -#include "component/component_gpbr.h" -#include "component/component_hsmci.h" -#include "component/component_icm.h" -#include "component/component_isi.h" -#include "component/component_matrix.h" -#include "component/component_mcan.h" -#include "component/component_mlb.h" -#include "component/component_pio.h" -#include "component/component_pmc.h" -#include "component/component_pwm.h" -#include "component/component_qspi.h" -#include "component/component_rstc.h" -#include "component/component_rswdt.h" -#include "component/component_rtc.h" -#include "component/component_rtt.h" -#include "component/component_spi.h" -#include "component/component_ssc.h" -#include "component/component_supc.h" -#include "component/component_tc.h" -#include "component/component_trng.h" -#include "component/component_twihs.h" -#include "component/component_uart.h" -#include "component/component_usart.h" -#include "component/component_usbhs.h" -#include "component/component_utmi.h" -#include "component/component_wdt.h" -#include "component/component_xdmac.h" -/*@}*/ - -/* ************************************************************************** */ -/* REGISTER ACCESS DEFINITIONS FOR SAMV71N21 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71N21_reg Registers Access Definitions */ -/*@{*/ - -#include "instance/instance_hsmci.h" -#include "instance/instance_ssc.h" -#include "instance/instance_spi0.h" -#include "instance/instance_tc0.h" -#include "instance/instance_twihs0.h" -#include "instance/instance_twihs1.h" -#include "instance/instance_pwm0.h" -#include "instance/instance_usart0.h" -#include "instance/instance_usart1.h" -#include "instance/instance_usart2.h" -#include "instance/instance_mcan0.h" -#include "instance/instance_mcan1.h" -#include "instance/instance_usbhs.h" -#include "instance/instance_afec0.h" -#include "instance/instance_acc.h" -#include "instance/instance_icm.h" -#include "instance/instance_isi.h" -#include "instance/instance_gmac.h" -#include "instance/instance_tc3.h" -#include "instance/instance_spi1.h" -#include "instance/instance_pwm1.h" -#include "instance/instance_twihs2.h" -#include "instance/instance_afec1.h" -#include "instance/instance_mlb.h" -#include "instance/instance_aes.h" -#include "instance/instance_trng.h" -#include "instance/instance_xdmac.h" -#include "instance/instance_qspi.h" -#include "instance/instance_matrix.h" -#include "instance/instance_utmi.h" -#include "instance/instance_pmc.h" -#include "instance/instance_uart0.h" -#include "instance/instance_chipid.h" -#include "instance/instance_uart1.h" -#include "instance/instance_efc.h" -#include "instance/instance_pioa.h" -#include "instance/instance_piob.h" -#include "instance/instance_piod.h" -#include "instance/instance_rstc.h" -#include "instance/instance_supc.h" -#include "instance/instance_rtt.h" -#include "instance/instance_wdt.h" -#include "instance/instance_rtc.h" -#include "instance/instance_gpbr.h" -#include "instance/instance_rswdt.h" -#include "instance/instance_uart2.h" -#include "instance/instance_uart3.h" -#include "instance/instance_uart4.h" -/*@}*/ - -/* ************************************************************************** */ -/* PERIPHERAL ID DEFINITIONS FOR SAMV71N21 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71N21_id Peripheral Ids Definitions */ -/*@{*/ - -#define ID_SUPC ( 0) /**< \brief Supply Controller (SUPC) */ -#define ID_RSTC ( 1) /**< \brief Reset Controller (RSTC) */ -#define ID_RTC ( 2) /**< \brief Real Time Clock (RTC) */ -#define ID_RTT ( 3) /**< \brief Real Time Timer (RTT) */ -#define ID_WDT ( 4) /**< \brief Watchdog Timer (WDT) */ -#define ID_PMC ( 5) /**< \brief Power Management Controller (PMC) */ -#define ID_EFC ( 6) /**< \brief Enhanced Embedded Flash Controller (EFC) */ -#define ID_UART0 ( 7) /**< \brief UART 0 (UART0) */ -#define ID_UART1 ( 8) /**< \brief UART 1 (UART1) */ -#define ID_PIOA (10) /**< \brief Parallel I/O Controller A (PIOA) */ -#define ID_PIOB (11) /**< \brief Parallel I/O Controller B (PIOB) */ -#define ID_USART0 (13) /**< \brief USART 0 (USART0) */ -#define ID_USART1 (14) /**< \brief USART 1 (USART1) */ -#define ID_USART2 (15) /**< \brief USART 2 (USART2) */ -#define ID_PIOD (16) /**< \brief Parallel I/O Controller D (PIOD) */ -#define ID_HSMCI (18) /**< \brief Multimedia Card Interface (HSMCI) */ -#define ID_TWIHS0 (19) /**< \brief Two Wire Interface 0 HS (TWIHS0) */ -#define ID_TWIHS1 (20) /**< \brief Two Wire Interface 1 HS (TWIHS1) */ -#define ID_SPI0 (21) /**< \brief Serial Peripheral Interface 0 (SPI0) */ -#define ID_SSC (22) /**< \brief Synchronous Serial Controller (SSC) */ -#define ID_TC0 (23) /**< \brief Timer/Counter 0 (TC0) */ -#define ID_TC1 (24) /**< \brief Timer/Counter 1 (TC1) */ -#define ID_TC2 (25) /**< \brief Timer/Counter 2 (TC2) */ -#define ID_AFEC0 (29) /**< \brief Analog Front End 0 (AFEC0) */ -#define ID_PWM0 (31) /**< \brief Pulse Width Modulation 0 (PWM0) */ -#define ID_ICM (32) /**< \brief Integrity Check Monitor (ICM) */ -#define ID_ACC (33) /**< \brief Analog Comparator (ACC) */ -#define ID_USBHS (34) /**< \brief USB Host / Device Controller (USBHS) */ -#define ID_MCAN0 (35) /**< \brief MCAN Controller 0 (MCAN0) */ -#define ID_MCAN1 (37) /**< \brief MCAN Controller 1 (MCAN1) */ -#define ID_GMAC (39) /**< \brief Ethernet MAC (GMAC) */ -#define ID_AFEC1 (40) /**< \brief Analog Front End 1 (AFEC1) */ -#define ID_TWIHS2 (41) /**< \brief Two Wire Interface 2 HS (TWIHS2) */ -#define ID_SPI1 (42) /**< \brief Serial Peripheral Interface 1 (SPI1) */ -#define ID_QSPI (43) /**< \brief Quad I/O Serial Peripheral Interface (QSPI) */ -#define ID_UART2 (44) /**< \brief UART 2 (UART2) */ -#define ID_UART3 (45) /**< \brief UART 3 (UART3) */ -#define ID_UART4 (46) /**< \brief UART 4 (UART4) */ -#define ID_TC9 (50) /**< \brief Timer/Counter 9 (TC9) */ -#define ID_TC10 (51) /**< \brief Timer/Counter 10 (TC10) */ -#define ID_TC11 (52) /**< \brief Timer/Counter 11 (TC11) */ -#define ID_MLB (53) /**< \brief MediaLB (MLB) */ -#define ID_AES (56) /**< \brief AES (AES) */ -#define ID_TRNG (57) /**< \brief True Random Generator (TRNG) */ -#define ID_XDMAC (58) /**< \brief DMA (XDMAC) */ -#define ID_ISI (59) /**< \brief Camera Interface (ISI) */ -#define ID_PWM1 (60) /**< \brief Pulse Width Modulation 1 (PWM1) */ -#define ID_RSWDT (63) /**< \brief Reinforced Secure Watchdog Timer (RSWDT) */ - -#define ID_PERIPH_COUNT (64) /**< \brief Number of peripheral IDs */ -/*@}*/ - -/* ************************************************************************** */ -/* BASE ADDRESS DEFINITIONS FOR SAMV71N21 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71N21_base Peripheral Base Address Definitions */ -/*@{*/ - -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -#define HSMCI (0x40000000U) /**< \brief (HSMCI ) Base Address */ -#define SSC (0x40004000U) /**< \brief (SSC ) Base Address */ -#define SPI0 (0x40008000U) /**< \brief (SPI0 ) Base Address */ -#define TC0 (0x4000C000U) /**< \brief (TC0 ) Base Address */ -#define TWIHS0 (0x40018000U) /**< \brief (TWIHS0) Base Address */ -#define TWIHS1 (0x4001C000U) /**< \brief (TWIHS1) Base Address */ -#define PWM0 (0x40020000U) /**< \brief (PWM0 ) Base Address */ -#define USART0 (0x40024000U) /**< \brief (USART0) Base Address */ -#define USART1 (0x40028000U) /**< \brief (USART1) Base Address */ -#define USART2 (0x4002C000U) /**< \brief (USART2) Base Address */ -#define MCAN0 (0x40030000U) /**< \brief (MCAN0 ) Base Address */ -#define MCAN1 (0x40034000U) /**< \brief (MCAN1 ) Base Address */ -#define USBHS (0x40038000U) /**< \brief (USBHS ) Base Address */ -#define AFEC0 (0x4003C000U) /**< \brief (AFEC0 ) Base Address */ -#define ACC (0x40044000U) /**< \brief (ACC ) Base Address */ -#define ICM (0x40048000U) /**< \brief (ICM ) Base Address */ -#define ISI (0x4004C000U) /**< \brief (ISI ) Base Address */ -#define GMAC (0x40050000U) /**< \brief (GMAC ) Base Address */ -#define TC3 (0x40054000U) /**< \brief (TC3 ) Base Address */ -#define SPI1 (0x40058000U) /**< \brief (SPI1 ) Base Address */ -#define PWM1 (0x4005C000U) /**< \brief (PWM1 ) Base Address */ -#define TWIHS2 (0x40060000U) /**< \brief (TWIHS2) Base Address */ -#define AFEC1 (0x40064000U) /**< \brief (AFEC1 ) Base Address */ -#define MLB (0x40068000U) /**< \brief (MLB ) Base Address */ -#define AES (0x4006C000U) /**< \brief (AES ) Base Address */ -#define TRNG (0x40070000U) /**< \brief (TRNG ) Base Address */ -#define XDMAC (0x40078000U) /**< \brief (XDMAC ) Base Address */ -#define QSPI (0x4007C000U) /**< \brief (QSPI ) Base Address */ -#define MATRIX (0x40088000U) /**< \brief (MATRIX) Base Address */ -#define UTMI (0x400E0400U) /**< \brief (UTMI ) Base Address */ -#define PMC (0x400E0600U) /**< \brief (PMC ) Base Address */ -#define UART0 (0x400E0800U) /**< \brief (UART0 ) Base Address */ -#define CHIPID (0x400E0940U) /**< \brief (CHIPID) Base Address */ -#define UART1 (0x400E0A00U) /**< \brief (UART1 ) Base Address */ -#define EFC (0x400E0C00U) /**< \brief (EFC ) Base Address */ -#define PIOA (0x400E0E00U) /**< \brief (PIOA ) Base Address */ -#define PIOB (0x400E1000U) /**< \brief (PIOB ) Base Address */ -#define PIOD (0x400E1400U) /**< \brief (PIOD ) Base Address */ -#define RSTC (0x400E1800U) /**< \brief (RSTC ) Base Address */ -#define SUPC (0x400E1810U) /**< \brief (SUPC ) Base Address */ -#define RTT (0x400E1830U) /**< \brief (RTT ) Base Address */ -#define WDT (0x400E1850U) /**< \brief (WDT ) Base Address */ -#define RTC (0x400E1860U) /**< \brief (RTC ) Base Address */ -#define GPBR (0x400E1890U) /**< \brief (GPBR ) Base Address */ -#define RSWDT (0x400E1900U) /**< \brief (RSWDT ) Base Address */ -#define UART2 (0x400E1A00U) /**< \brief (UART2 ) Base Address */ -#define UART3 (0x400E1C00U) /**< \brief (UART3 ) Base Address */ -#define UART4 (0x400E1E00U) /**< \brief (UART4 ) Base Address */ -#else -#define HSMCI ((Hsmci *)0x40000000U) /**< \brief (HSMCI ) Base Address */ -#define SSC ((Ssc *)0x40004000U) /**< \brief (SSC ) Base Address */ -#define SPI0 ((Spi *)0x40008000U) /**< \brief (SPI0 ) Base Address */ -#define TC0 ((Tc *)0x4000C000U) /**< \brief (TC0 ) Base Address */ -#define TWIHS0 ((Twihs *)0x40018000U) /**< \brief (TWIHS0) Base Address */ -#define TWIHS1 ((Twihs *)0x4001C000U) /**< \brief (TWIHS1) Base Address */ -#define PWM0 ((Pwm *)0x40020000U) /**< \brief (PWM0 ) Base Address */ -#define USART0 ((Usart *)0x40024000U) /**< \brief (USART0) Base Address */ -#define USART1 ((Usart *)0x40028000U) /**< \brief (USART1) Base Address */ -#define USART2 ((Usart *)0x4002C000U) /**< \brief (USART2) Base Address */ -#define MCAN0 ((Mcan *)0x40030000U) /**< \brief (MCAN0 ) Base Address */ -#define MCAN1 ((Mcan *)0x40034000U) /**< \brief (MCAN1 ) Base Address */ -#define USBHS ((Usbhs *)0x40038000U) /**< \brief (USBHS ) Base Address */ -#define AFEC0 ((Afec *)0x4003C000U) /**< \brief (AFEC0 ) Base Address */ -#define ACC ((Acc *)0x40044000U) /**< \brief (ACC ) Base Address */ -#define ICM ((Icm *)0x40048000U) /**< \brief (ICM ) Base Address */ -#define ISI ((Isi *)0x4004C000U) /**< \brief (ISI ) Base Address */ -#define GMAC ((Gmac *)0x40050000U) /**< \brief (GMAC ) Base Address */ -#define TC3 ((Tc *)0x40054000U) /**< \brief (TC3 ) Base Address */ -#define SPI1 ((Spi *)0x40058000U) /**< \brief (SPI1 ) Base Address */ -#define PWM1 ((Pwm *)0x4005C000U) /**< \brief (PWM1 ) Base Address */ -#define TWIHS2 ((Twihs *)0x40060000U) /**< \brief (TWIHS2) Base Address */ -#define AFEC1 ((Afec *)0x40064000U) /**< \brief (AFEC1 ) Base Address */ -#define MLB ((Mlb *)0x40068000U) /**< \brief (MLB ) Base Address */ -#define AES ((Aes *)0x4006C000U) /**< \brief (AES ) Base Address */ -#define TRNG ((Trng *)0x40070000U) /**< \brief (TRNG ) Base Address */ -#define XDMAC ((Xdmac *)0x40078000U) /**< \brief (XDMAC ) Base Address */ -#define QSPI ((Qspi *)0x4007C000U) /**< \brief (QSPI ) Base Address */ -#define MATRIX ((Matrix *)0x40088000U) /**< \brief (MATRIX) Base Address */ -#define UTMI ((Utmi *)0x400E0400U) /**< \brief (UTMI ) Base Address */ -#define PMC ((Pmc *)0x400E0600U) /**< \brief (PMC ) Base Address */ -#define UART0 ((Uart *)0x400E0800U) /**< \brief (UART0 ) Base Address */ -#define CHIPID ((Chipid *)0x400E0940U) /**< \brief (CHIPID) Base Address */ -#define UART1 ((Uart *)0x400E0A00U) /**< \brief (UART1 ) Base Address */ -#define EFC ((Efc *)0x400E0C00U) /**< \brief (EFC ) Base Address */ -#define PIOA ((Pio *)0x400E0E00U) /**< \brief (PIOA ) Base Address */ -#define PIOB ((Pio *)0x400E1000U) /**< \brief (PIOB ) Base Address */ -#define PIOD ((Pio *)0x400E1400U) /**< \brief (PIOD ) Base Address */ -#define RSTC ((Rstc *)0x400E1800U) /**< \brief (RSTC ) Base Address */ -#define SUPC ((Supc *)0x400E1810U) /**< \brief (SUPC ) Base Address */ -#define RTT ((Rtt *)0x400E1830U) /**< \brief (RTT ) Base Address */ -#define WDT ((Wdt *)0x400E1850U) /**< \brief (WDT ) Base Address */ -#define RTC ((Rtc *)0x400E1860U) /**< \brief (RTC ) Base Address */ -#define GPBR ((Gpbr *)0x400E1890U) /**< \brief (GPBR ) Base Address */ -#define RSWDT ((Rswdt *)0x400E1900U) /**< \brief (RSWDT ) Base Address */ -#define UART2 ((Uart *)0x400E1A00U) /**< \brief (UART2 ) Base Address */ -#define UART3 ((Uart *)0x400E1C00U) /**< \brief (UART3 ) Base Address */ -#define UART4 ((Uart *)0x400E1E00U) /**< \brief (UART4 ) Base Address */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/*@}*/ - -/* ************************************************************************** */ -/* PIO DEFINITIONS FOR SAMV71N21 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71N21_pio Peripheral Pio Definitions */ -/*@{*/ - -#include "pio/pio_samv71n21.h" -/*@}*/ - -/* ************************************************************************** */ -/* MEMORY MAPPING DEFINITIONS FOR SAMV71N21 */ -/* ************************************************************************** */ - -#define IFLASH_SIZE (0x200000u) -#define IFLASH_PAGE_SIZE (512u) -#define IFLASH_LOCK_REGION_SIZE (16384u) -#define IFLASH_NB_OF_PAGES (4096u) -#define IFLASH_NB_OF_LOCK_BITS (128u) -#define IRAM_SIZE (0x60000u) - -#define QSPIMEM_ADDR (0x80000000u) /**< QSPI Memory base address */ -#define AXIMX_ADDR (0xA0000000u) /**< AXI Bus Matrix base address */ -#define ITCM_ADDR (0x00000000u) /**< Instruction Tightly Coupled Memory base address */ -#define IFLASH_ADDR (0x00400000u) /**< Internal Flash base address */ -#define IROM_ADDR (0x00800000u) /**< Internal ROM base address */ -#define DTCM_ADDR (0x20000000u) /**< Data Tightly Coupled Memory base address */ -#define IRAM_ADDR (0x20400000u) /**< Internal RAM base address */ -#define EBI_CS0_ADDR (0x60000000u) /**< EBI Chip Select 0 base address */ -#define EBI_CS1_ADDR (0x61000000u) /**< EBI Chip Select 1 base address */ -#define EBI_CS2_ADDR (0x62000000u) /**< EBI Chip Select 2 base address */ -#define EBI_CS3_ADDR (0x63000000u) /**< EBI Chip Select 3 base address */ -#define SDRAM_CS_ADDR (0x70000000u) /**< SDRAM Chip Select base address */ - -/* ************************************************************************** */ -/* MISCELLANEOUS DEFINITIONS FOR SAMV71N21 */ -/* ************************************************************************** */ - -#define CHIP_JTAGID (0x05B3D03FUL) -#define CHIP_CIDR (0xA1220E00UL) -#define CHIP_EXID (0x00000001UL) - -/* ************************************************************************** */ -/* ELECTRICAL DEFINITIONS FOR SAMV71N21 */ -/* ************************************************************************** */ - -/* %ATMEL_ELECTRICAL% */ - -/* Device characteristics */ -#define CHIP_FREQ_SLCK_RC_MIN (20000UL) -#define CHIP_FREQ_SLCK_RC (32000UL) -#define CHIP_FREQ_SLCK_RC_MAX (44000UL) -#define CHIP_FREQ_MAINCK_RC_4MHZ (4000000UL) -#define CHIP_FREQ_MAINCK_RC_8MHZ (8000000UL) -#define CHIP_FREQ_MAINCK_RC_12MHZ (12000000UL) -#define CHIP_FREQ_CPU_MAX (300000000UL) -#define CHIP_FREQ_XTAL_32K (32768UL) -#define CHIP_FREQ_XTAL_12M (12000000UL) - -/* Embedded Flash Read Wait State (VDDCORE set at 1.20V) */ -#define CHIP_FREQ_FWS_0 (26000000UL) /**< \brief Maximum operating frequency when FWS is 0 */ -#define CHIP_FREQ_FWS_1 (52000000UL) /**< \brief Maximum operating frequency when FWS is 1 */ -#define CHIP_FREQ_FWS_2 (78000000UL) /**< \brief Maximum operating frequency when FWS is 2 */ -#define CHIP_FREQ_FWS_3 (104000000UL) /**< \brief Maximum operating frequency when FWS is 3 */ -#define CHIP_FREQ_FWS_4 (131000000UL) /**< \brief Maximum operating frequency when FWS is 4 */ -#define CHIP_FREQ_FWS_5 (150000000UL) /**< \brief Maximum operating frequency when FWS is 5 */ - - -#ifdef __cplusplus -} -#endif - -/*@}*/ - -#endif /* _SAMV71N21_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/samv71q19.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/samv71q19.h deleted file mode 100644 index a58298f2..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/samv71q19.h +++ /dev/null @@ -1,694 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71Q19_ -#define _SAMV71Q19_ - -/** \addtogroup SAMV71Q19_definitions SAMV71Q19 definitions - This file defines all structures and symbols for SAMV71Q19: - - registers and bit-fields - - peripheral base address - - peripheral ID - - PIO definitions -*/ -/*@{*/ - -#ifdef __cplusplus - extern "C" { -#endif - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -#include -#endif - -/* ************************************************************************** */ -/* CMSIS DEFINITIONS FOR SAMV71Q19 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71Q19_cmsis CMSIS Definitions */ -/*@{*/ - -/**< Interrupt Number Definition */ -typedef enum IRQn -{ -/****** Cortex-M7 Processor Exceptions Numbers ******************************/ - NonMaskableInt_IRQn = -14, /**< 2 Non Maskable Interrupt */ - HardFault_IRQn = -13, /**< 3 HardFault Interrupt */ - MemoryManagement_IRQn = -12, /**< 4 Cortex-M7 Memory Management Interrupt */ - BusFault_IRQn = -11, /**< 5 Cortex-M7 Bus Fault Interrupt */ - UsageFault_IRQn = -10, /**< 6 Cortex-M7 Usage Fault Interrupt */ - SVCall_IRQn = -5, /**< 11 Cortex-M7 SV Call Interrupt */ - DebugMonitor_IRQn = -4, /**< 12 Cortex-M7 Debug Monitor Interrupt */ - PendSV_IRQn = -2, /**< 14 Cortex-M7 Pend SV Interrupt */ - SysTick_IRQn = -1, /**< 15 Cortex-M7 System Tick Interrupt */ -/****** SAMV71Q19 specific Interrupt Numbers *********************************/ - - SUPC_IRQn = 0, /**< 0 SAMV71Q19 Supply Controller (SUPC) */ - RSTC_IRQn = 1, /**< 1 SAMV71Q19 Reset Controller (RSTC) */ - RTC_IRQn = 2, /**< 2 SAMV71Q19 Real Time Clock (RTC) */ - RTT_IRQn = 3, /**< 3 SAMV71Q19 Real Time Timer (RTT) */ - WDT_IRQn = 4, /**< 4 SAMV71Q19 Watchdog Timer (WDT) */ - PMC_IRQn = 5, /**< 5 SAMV71Q19 Power Management Controller (PMC) */ - EFC_IRQn = 6, /**< 6 SAMV71Q19 Enhanced Embedded Flash Controller (EFC) */ - UART0_IRQn = 7, /**< 7 SAMV71Q19 UART 0 (UART0) */ - UART1_IRQn = 8, /**< 8 SAMV71Q19 UART 1 (UART1) */ - PIOA_IRQn = 10, /**< 10 SAMV71Q19 Parallel I/O Controller A (PIOA) */ - PIOB_IRQn = 11, /**< 11 SAMV71Q19 Parallel I/O Controller B (PIOB) */ - PIOC_IRQn = 12, /**< 12 SAMV71Q19 Parallel I/O Controller C (PIOC) */ - USART0_IRQn = 13, /**< 13 SAMV71Q19 USART 0 (USART0) */ - USART1_IRQn = 14, /**< 14 SAMV71Q19 USART 1 (USART1) */ - USART2_IRQn = 15, /**< 15 SAMV71Q19 USART 2 (USART2) */ - PIOD_IRQn = 16, /**< 16 SAMV71Q19 Parallel I/O Controller D (PIOD) */ - PIOE_IRQn = 17, /**< 17 SAMV71Q19 Parallel I/O Controller E (PIOE) */ - HSMCI_IRQn = 18, /**< 18 SAMV71Q19 Multimedia Card Interface (HSMCI) */ - TWIHS0_IRQn = 19, /**< 19 SAMV71Q19 Two Wire Interface 0 HS (TWIHS0) */ - TWIHS1_IRQn = 20, /**< 20 SAMV71Q19 Two Wire Interface 1 HS (TWIHS1) */ - SPI0_IRQn = 21, /**< 21 SAMV71Q19 Serial Peripheral Interface 0 (SPI0) */ - SSC_IRQn = 22, /**< 22 SAMV71Q19 Synchronous Serial Controller (SSC) */ - TC0_IRQn = 23, /**< 23 SAMV71Q19 Timer/Counter 0 (TC0) */ - TC1_IRQn = 24, /**< 24 SAMV71Q19 Timer/Counter 1 (TC1) */ - TC2_IRQn = 25, /**< 25 SAMV71Q19 Timer/Counter 2 (TC2) */ - TC3_IRQn = 26, /**< 26 SAMV71Q19 Timer/Counter 3 (TC3) */ - TC4_IRQn = 27, /**< 27 SAMV71Q19 Timer/Counter 4 (TC4) */ - TC5_IRQn = 28, /**< 28 SAMV71Q19 Timer/Counter 5 (TC5) */ - AFEC0_IRQn = 29, /**< 29 SAMV71Q19 Analog Front End 0 (AFEC0) */ - DACC_IRQn = 30, /**< 30 SAMV71Q19 Digital To Analog Converter (DACC) */ - PWM0_IRQn = 31, /**< 31 SAMV71Q19 Pulse Width Modulation 0 (PWM0) */ - ICM_IRQn = 32, /**< 32 SAMV71Q19 Integrity Check Monitor (ICM) */ - ACC_IRQn = 33, /**< 33 SAMV71Q19 Analog Comparator (ACC) */ - USBHS_IRQn = 34, /**< 34 SAMV71Q19 USB Host / Device Controller (USBHS) */ - MCAN0_IRQn = 35, /**< 35 SAMV71Q19 MCAN Controller 0 (MCAN0) */ - MCAN0_LINE1_IRQn = 36, /**< 36 SAMV71Q21 MCAN Controller 0 LINE1 (MCAN0) */ - MCAN1_IRQn = 37, /**< 37 SAMV71Q19 MCAN Controller 1 (MCAN1) */ - MCAN1_LINE1_IRQn = 38, /**< 38 SAMV71Q21 MCAN Controller 1 LINE1 (MCAN1) */ - GMAC_IRQn = 39, /**< 39 SAMV71Q19 Ethernet MAC (GMAC) */ - AFEC1_IRQn = 40, /**< 40 SAMV71Q19 Analog Front End 1 (AFEC1) */ - TWIHS2_IRQn = 41, /**< 41 SAMV71Q19 Two Wire Interface 2 HS (TWIHS2) */ - SPI1_IRQn = 42, /**< 42 SAMV71Q19 Serial Peripheral Interface 1 (SPI1) */ - QSPI_IRQn = 43, /**< 43 SAMV71Q19 Quad I/O Serial Peripheral Interface (QSPI) */ - UART2_IRQn = 44, /**< 44 SAMV71Q19 UART 2 (UART2) */ - UART3_IRQn = 45, /**< 45 SAMV71Q19 UART 3 (UART3) */ - UART4_IRQn = 46, /**< 46 SAMV71Q19 UART 4 (UART4) */ - TC6_IRQn = 47, /**< 47 SAMV71Q19 Timer/Counter 6 (TC6) */ - TC7_IRQn = 48, /**< 48 SAMV71Q19 Timer/Counter 7 (TC7) */ - TC8_IRQn = 49, /**< 49 SAMV71Q19 Timer/Counter 8 (TC8) */ - TC9_IRQn = 50, /**< 50 SAMV71Q19 Timer/Counter 9 (TC9) */ - TC10_IRQn = 51, /**< 51 SAMV71Q19 Timer/Counter 10 (TC10) */ - TC11_IRQn = 52, /**< 52 SAMV71Q19 Timer/Counter 11 (TC11) */ - MLB_IRQn = 53, /**< 53 SAMV71Q19 MediaLB (MLB) */ - AES_IRQn = 56, /**< 56 SAMV71Q19 AES (AES) */ - TRNG_IRQn = 57, /**< 57 SAMV71Q19 True Random Generator (TRNG) */ - XDMAC_IRQn = 58, /**< 58 SAMV71Q19 DMA (XDMAC) */ - ISI_IRQn = 59, /**< 59 SAMV71Q19 Camera Interface (ISI) */ - PWM1_IRQn = 60, /**< 60 SAMV71Q19 Pulse Width Modulation 1 (PWM1) */ - SDRAMC_IRQn = 62, /**< 62 SAMV71Q19 SDRAM Controller (SDRAMC) */ - RSWDT_IRQn = 63, /**< 63 SAMV71Q19 Reinforced Secure Watchdog Timer (RSWDT) */ - - PERIPH_COUNT_IRQn = 64 /**< Number of peripheral IDs */ -} IRQn_Type; - -typedef struct _DeviceVectors -{ - /* Stack pointer */ - void* pvStack; - - /* Cortex-M handlers */ - void* pfnReset_Handler; - void* pfnNMI_Handler; - void* pfnHardFault_Handler; - void* pfnMemManage_Handler; - void* pfnBusFault_Handler; - void* pfnUsageFault_Handler; - void* pfnReserved1_Handler; - void* pfnReserved2_Handler; - void* pfnReserved3_Handler; - void* pfnReserved4_Handler; - void* pfnSVC_Handler; - void* pfnDebugMon_Handler; - void* pfnReserved5_Handler; - void* pfnPendSV_Handler; - void* pfnSysTick_Handler; - - /* Peripheral handlers */ - void* pfnSUPC_Handler; /* 0 Supply Controller */ - void* pfnRSTC_Handler; /* 1 Reset Controller */ - void* pfnRTC_Handler; /* 2 Real Time Clock */ - void* pfnRTT_Handler; /* 3 Real Time Timer */ - void* pfnWDT_Handler; /* 4 Watchdog Timer */ - void* pfnPMC_Handler; /* 5 Power Management Controller */ - void* pfnEFC_Handler; /* 6 Enhanced Embedded Flash Controller */ - void* pfnUART0_Handler; /* 7 UART 0 */ - void* pfnUART1_Handler; /* 8 UART 1 */ - void* pvReserved9; - void* pfnPIOA_Handler; /* 10 Parallel I/O Controller A */ - void* pfnPIOB_Handler; /* 11 Parallel I/O Controller B */ - void* pfnPIOC_Handler; /* 12 Parallel I/O Controller C */ - void* pfnUSART0_Handler; /* 13 USART 0 */ - void* pfnUSART1_Handler; /* 14 USART 1 */ - void* pfnUSART2_Handler; /* 15 USART 2 */ - void* pfnPIOD_Handler; /* 16 Parallel I/O Controller D */ - void* pfnPIOE_Handler; /* 17 Parallel I/O Controller E */ - void* pfnHSMCI_Handler; /* 18 Multimedia Card Interface */ - void* pfnTWIHS0_Handler; /* 19 Two Wire Interface 0 HS */ - void* pfnTWIHS1_Handler; /* 20 Two Wire Interface 1 HS */ - void* pfnSPI0_Handler; /* 21 Serial Peripheral Interface 0 */ - void* pfnSSC_Handler; /* 22 Synchronous Serial Controller */ - void* pfnTC0_Handler; /* 23 Timer/Counter 0 */ - void* pfnTC1_Handler; /* 24 Timer/Counter 1 */ - void* pfnTC2_Handler; /* 25 Timer/Counter 2 */ - void* pfnTC3_Handler; /* 26 Timer/Counter 3 */ - void* pfnTC4_Handler; /* 27 Timer/Counter 4 */ - void* pfnTC5_Handler; /* 28 Timer/Counter 5 */ - void* pfnAFEC0_Handler; /* 29 Analog Front End 0 */ - void* pfnDACC_Handler; /* 30 Digital To Analog Converter */ - void* pfnPWM0_Handler; /* 31 Pulse Width Modulation 0 */ - void* pfnICM_Handler; /* 32 Integrity Check Monitor */ - void* pfnACC_Handler; /* 33 Analog Comparator */ - void* pfnUSBHS_Handler; /* 34 USB Host / Device Controller */ - void* pfnMCAN0_Handler; /* 35 MCAN Controller 0 */ - void* pfnMCAN0_Line1_Handler; /* 36 MCAN Controller 0 */ - void* pfnMCAN1_Handler; /* 37 MCAN Controller 1 */ - void* pfnMCAN1_Line1_Handler; /* 38 MCAN Controller 1 */ - void* pfnGMAC_Handler; /* 39 Ethernet MAC */ - void* pfnAFEC1_Handler; /* 40 Analog Front End 1 */ - void* pfnTWIHS2_Handler; /* 41 Two Wire Interface 2 HS */ - void* pfnSPI1_Handler; /* 42 Serial Peripheral Interface 1 */ - void* pfnQSPI_Handler; /* 43 Quad I/O Serial Peripheral Interface */ - void* pfnUART2_Handler; /* 44 UART 2 */ - void* pfnUART3_Handler; /* 45 UART 3 */ - void* pfnUART4_Handler; /* 46 UART 4 */ - void* pfnTC6_Handler; /* 47 Timer/Counter 6 */ - void* pfnTC7_Handler; /* 48 Timer/Counter 7 */ - void* pfnTC8_Handler; /* 49 Timer/Counter 8 */ - void* pfnTC9_Handler; /* 50 Timer/Counter 9 */ - void* pfnTC10_Handler; /* 51 Timer/Counter 10 */ - void* pfnTC11_Handler; /* 52 Timer/Counter 11 */ - void* pfnMLB_Handler; /* 53 MediaLB */ - void* pvReserved54; - void* pvReserved55; - void* pfnAES_Handler; /* 56 AES */ - void* pfnTRNG_Handler; /* 57 True Random Generator */ - void* pfnXDMAC_Handler; /* 58 DMA */ - void* pfnISI_Handler; /* 59 Camera Interface */ - void* pfnPWM1_Handler; /* 60 Pulse Width Modulation 1 */ - void* pvReserved61; - void* pfnSDRAMC_Handler; /* 62 SDRAM Controller */ - void* pfnRSWDT_Handler; /* 63 Reinforced Secure Watchdog Timer */ -} DeviceVectors; - -/* Cortex-M7 core handlers */ -void Reset_Handler ( void ); -void NMI_Handler ( void ); -void HardFault_Handler ( void ); -void MemManage_Handler ( void ); -void BusFault_Handler ( void ); -void UsageFault_Handler ( void ); -void SVC_Handler ( void ); -void DebugMon_Handler ( void ); -void PendSV_Handler ( void ); -void SysTick_Handler ( void ); - -/* Peripherals handlers */ -void ACC_Handler ( void ); -void AES_Handler ( void ); -void AFEC0_Handler ( void ); -void AFEC1_Handler ( void ); -void DACC_Handler ( void ); -void EFC_Handler ( void ); -void GMAC_Handler ( void ); -void HSMCI_Handler ( void ); -void ICM_Handler ( void ); -void ISI_Handler ( void ); -void MCAN0_Handler ( void ); -void MCAN0_Line1_Handler( void ); -void MCAN1_Handler ( void ); -void MCAN1_Line1_Handler( void ); -void MLB_Handler ( void ); -void PIOA_Handler ( void ); -void PIOB_Handler ( void ); -void PIOC_Handler ( void ); -void PIOD_Handler ( void ); -void PIOE_Handler ( void ); -void PMC_Handler ( void ); -void PWM0_Handler ( void ); -void PWM1_Handler ( void ); -void QSPI_Handler ( void ); -void RSTC_Handler ( void ); -void RSWDT_Handler ( void ); -void RTC_Handler ( void ); -void RTT_Handler ( void ); -void SDRAMC_Handler ( void ); -void SPI0_Handler ( void ); -void SPI1_Handler ( void ); -void SSC_Handler ( void ); -void SUPC_Handler ( void ); -void TC0_Handler ( void ); -void TC1_Handler ( void ); -void TC2_Handler ( void ); -void TC3_Handler ( void ); -void TC4_Handler ( void ); -void TC5_Handler ( void ); -void TC6_Handler ( void ); -void TC7_Handler ( void ); -void TC8_Handler ( void ); -void TC9_Handler ( void ); -void TC10_Handler ( void ); -void TC11_Handler ( void ); -void TRNG_Handler ( void ); -void TWIHS0_Handler ( void ); -void TWIHS1_Handler ( void ); -void TWIHS2_Handler ( void ); -void UART0_Handler ( void ); -void UART1_Handler ( void ); -void UART2_Handler ( void ); -void UART3_Handler ( void ); -void UART4_Handler ( void ); -void USART0_Handler ( void ); -void USART1_Handler ( void ); -void USART2_Handler ( void ); -void USBHS_Handler ( void ); -void WDT_Handler ( void ); -void XDMAC_Handler ( void ); - -/** - * \brief Configuration of the Cortex-M7 Processor and Core Peripherals - */ - -#define __CM7_REV 0x0000 /**< SAMV71Q19 core revision number ([15:8] revision number, [7:0] patch number) */ -#define __MPU_PRESENT 1 /**< SAMV71Q19 does provide a MPU */ -#define __NVIC_PRIO_BITS 3 /**< SAMV71Q19 uses 3 Bits for the Priority Levels */ -#define __FPU_PRESENT 1 /**< SAMV71Q19 does provide a FPU */ -#define __FPU_DP 1 /**< SAMV71Q19 Double precision FPU */ -#define __ICACHE_PRESENT 1 /**< SAMV71Q19 does provide an Instruction Cache */ -#define __DCACHE_PRESENT 1 /**< SAMV71Q19 does provide a Data Cache */ -#define __DTCM_PRESENT 1 /**< SAMV71Q19 does provide a Data TCM */ -#define __ITCM_PRESENT 1 /**< SAMV71Q19 does provide an Instruction TCM */ -#define __Vendor_SysTickConfig 0 /**< Set to 1 if different SysTick Config is used */ - -/* - * \brief CMSIS includes - */ - -#include -#if !defined DONT_USE_CMSIS_INIT -#include "system_samv71.h" -#endif /* DONT_USE_CMSIS_INIT */ - -/*@}*/ - -/* ************************************************************************** */ -/** SOFTWARE PERIPHERAL API DEFINITION FOR SAMV71Q19 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71Q19_api Peripheral Software API */ -/*@{*/ - -#include "component/component_acc.h" -#include "component/component_aes.h" -#include "component/component_afec.h" -#include "component/component_chipid.h" -#include "component/component_dacc.h" -#include "component/component_efc.h" -#include "component/component_gmac.h" -#include "component/component_gpbr.h" -#include "component/component_hsmci.h" -#include "component/component_icm.h" -#include "component/component_isi.h" -#include "component/component_matrix.h" -#include "component/component_mcan.h" -#include "component/component_mlb.h" -#include "component/component_pio.h" -#include "component/component_pmc.h" -#include "component/component_pwm.h" -#include "component/component_qspi.h" -#include "component/component_rstc.h" -#include "component/component_rswdt.h" -#include "component/component_rtc.h" -#include "component/component_rtt.h" -#include "component/component_sdramc.h" -#include "component/component_smc.h" -#include "component/component_spi.h" -#include "component/component_ssc.h" -#include "component/component_supc.h" -#include "component/component_tc.h" -#include "component/component_trng.h" -#include "component/component_twihs.h" -#include "component/component_uart.h" -#include "component/component_usart.h" -#include "component/component_usbhs.h" -#include "component/component_utmi.h" -#include "component/component_wdt.h" -#include "component/component_xdmac.h" -/*@}*/ - -/* ************************************************************************** */ -/* REGISTER ACCESS DEFINITIONS FOR SAMV71Q19 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71Q19_reg Registers Access Definitions */ -/*@{*/ - -#include "instance/instance_hsmci.h" -#include "instance/instance_ssc.h" -#include "instance/instance_spi0.h" -#include "instance/instance_tc0.h" -#include "instance/instance_tc1.h" -#include "instance/instance_tc2.h" -#include "instance/instance_twihs0.h" -#include "instance/instance_twihs1.h" -#include "instance/instance_pwm0.h" -#include "instance/instance_usart0.h" -#include "instance/instance_usart1.h" -#include "instance/instance_usart2.h" -#include "instance/instance_mcan0.h" -#include "instance/instance_mcan1.h" -#include "instance/instance_usbhs.h" -#include "instance/instance_afec0.h" -#include "instance/instance_dacc.h" -#include "instance/instance_acc.h" -#include "instance/instance_icm.h" -#include "instance/instance_isi.h" -#include "instance/instance_gmac.h" -#include "instance/instance_tc3.h" -#include "instance/instance_spi1.h" -#include "instance/instance_pwm1.h" -#include "instance/instance_twihs2.h" -#include "instance/instance_afec1.h" -#include "instance/instance_mlb.h" -#include "instance/instance_aes.h" -#include "instance/instance_trng.h" -#include "instance/instance_xdmac.h" -#include "instance/instance_qspi.h" -#include "instance/instance_smc.h" -#include "instance/instance_sdramc.h" -#include "instance/instance_matrix.h" -#include "instance/instance_utmi.h" -#include "instance/instance_pmc.h" -#include "instance/instance_uart0.h" -#include "instance/instance_chipid.h" -#include "instance/instance_uart1.h" -#include "instance/instance_efc.h" -#include "instance/instance_pioa.h" -#include "instance/instance_piob.h" -#include "instance/instance_pioc.h" -#include "instance/instance_piod.h" -#include "instance/instance_pioe.h" -#include "instance/instance_rstc.h" -#include "instance/instance_supc.h" -#include "instance/instance_rtt.h" -#include "instance/instance_wdt.h" -#include "instance/instance_rtc.h" -#include "instance/instance_gpbr.h" -#include "instance/instance_rswdt.h" -#include "instance/instance_uart2.h" -#include "instance/instance_uart3.h" -#include "instance/instance_uart4.h" -/*@}*/ - -/* ************************************************************************** */ -/* PERIPHERAL ID DEFINITIONS FOR SAMV71Q19 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71Q19_id Peripheral Ids Definitions */ -/*@{*/ - -#define ID_SUPC ( 0) /**< \brief Supply Controller (SUPC) */ -#define ID_RSTC ( 1) /**< \brief Reset Controller (RSTC) */ -#define ID_RTC ( 2) /**< \brief Real Time Clock (RTC) */ -#define ID_RTT ( 3) /**< \brief Real Time Timer (RTT) */ -#define ID_WDT ( 4) /**< \brief Watchdog Timer (WDT) */ -#define ID_PMC ( 5) /**< \brief Power Management Controller (PMC) */ -#define ID_EFC ( 6) /**< \brief Enhanced Embedded Flash Controller (EFC) */ -#define ID_UART0 ( 7) /**< \brief UART 0 (UART0) */ -#define ID_UART1 ( 8) /**< \brief UART 1 (UART1) */ -#define ID_SMC ( 9) /**< \brief Static Memory Controller (SMC) */ -#define ID_PIOA (10) /**< \brief Parallel I/O Controller A (PIOA) */ -#define ID_PIOB (11) /**< \brief Parallel I/O Controller B (PIOB) */ -#define ID_PIOC (12) /**< \brief Parallel I/O Controller C (PIOC) */ -#define ID_USART0 (13) /**< \brief USART 0 (USART0) */ -#define ID_USART1 (14) /**< \brief USART 1 (USART1) */ -#define ID_USART2 (15) /**< \brief USART 2 (USART2) */ -#define ID_PIOD (16) /**< \brief Parallel I/O Controller D (PIOD) */ -#define ID_PIOE (17) /**< \brief Parallel I/O Controller E (PIOE) */ -#define ID_HSMCI (18) /**< \brief Multimedia Card Interface (HSMCI) */ -#define ID_TWIHS0 (19) /**< \brief Two Wire Interface 0 HS (TWIHS0) */ -#define ID_TWIHS1 (20) /**< \brief Two Wire Interface 1 HS (TWIHS1) */ -#define ID_SPI0 (21) /**< \brief Serial Peripheral Interface 0 (SPI0) */ -#define ID_SSC (22) /**< \brief Synchronous Serial Controller (SSC) */ -#define ID_TC0 (23) /**< \brief Timer/Counter 0 (TC0) */ -#define ID_TC1 (24) /**< \brief Timer/Counter 1 (TC1) */ -#define ID_TC2 (25) /**< \brief Timer/Counter 2 (TC2) */ -#define ID_TC3 (26) /**< \brief Timer/Counter 3 (TC3) */ -#define ID_TC4 (27) /**< \brief Timer/Counter 4 (TC4) */ -#define ID_TC5 (28) /**< \brief Timer/Counter 5 (TC5) */ -#define ID_AFEC0 (29) /**< \brief Analog Front End 0 (AFEC0) */ -#define ID_DACC (30) /**< \brief Digital To Analog Converter (DACC) */ -#define ID_PWM0 (31) /**< \brief Pulse Width Modulation 0 (PWM0) */ -#define ID_ICM (32) /**< \brief Integrity Check Monitor (ICM) */ -#define ID_ACC (33) /**< \brief Analog Comparator (ACC) */ -#define ID_USBHS (34) /**< \brief USB Host / Device Controller (USBHS) */ -#define ID_MCAN0 (35) /**< \brief MCAN Controller 0 (MCAN0) */ -#define ID_MCAN1 (37) /**< \brief MCAN Controller 1 (MCAN1) */ -#define ID_GMAC (39) /**< \brief Ethernet MAC (GMAC) */ -#define ID_AFEC1 (40) /**< \brief Analog Front End 1 (AFEC1) */ -#define ID_TWIHS2 (41) /**< \brief Two Wire Interface 2 HS (TWIHS2) */ -#define ID_SPI1 (42) /**< \brief Serial Peripheral Interface 1 (SPI1) */ -#define ID_QSPI (43) /**< \brief Quad I/O Serial Peripheral Interface (QSPI) */ -#define ID_UART2 (44) /**< \brief UART 2 (UART2) */ -#define ID_UART3 (45) /**< \brief UART 3 (UART3) */ -#define ID_UART4 (46) /**< \brief UART 4 (UART4) */ -#define ID_TC6 (47) /**< \brief Timer/Counter 6 (TC6) */ -#define ID_TC7 (48) /**< \brief Timer/Counter 7 (TC7) */ -#define ID_TC8 (49) /**< \brief Timer/Counter 8 (TC8) */ -#define ID_TC9 (50) /**< \brief Timer/Counter 9 (TC9) */ -#define ID_TC10 (51) /**< \brief Timer/Counter 10 (TC10) */ -#define ID_TC11 (52) /**< \brief Timer/Counter 11 (TC11) */ -#define ID_MLB (53) /**< \brief MediaLB (MLB) */ -#define ID_AES (56) /**< \brief AES (AES) */ -#define ID_TRNG (57) /**< \brief True Random Generator (TRNG) */ -#define ID_XDMAC (58) /**< \brief DMA (XDMAC) */ -#define ID_ISI (59) /**< \brief Camera Interface (ISI) */ -#define ID_PWM1 (60) /**< \brief Pulse Width Modulation 1 (PWM1) */ -#define ID_SDRAMC (62) /**< \brief SDRAM Controller (SDRAMC) */ -#define ID_RSWDT (63) /**< \brief Reinforced Secure Watchdog Timer (RSWDT) */ - -#define ID_PERIPH_COUNT (64) /**< \brief Number of peripheral IDs */ -/*@}*/ - -/* ************************************************************************** */ -/* BASE ADDRESS DEFINITIONS FOR SAMV71Q19 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71Q19_base Peripheral Base Address Definitions */ -/*@{*/ - -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -#define HSMCI (0x40000000U) /**< \brief (HSMCI ) Base Address */ -#define SSC (0x40004000U) /**< \brief (SSC ) Base Address */ -#define SPI0 (0x40008000U) /**< \brief (SPI0 ) Base Address */ -#define TC0 (0x4000C000U) /**< \brief (TC0 ) Base Address */ -#define TC1 (0x40010000U) /**< \brief (TC1 ) Base Address */ -#define TC2 (0x40014000U) /**< \brief (TC2 ) Base Address */ -#define TWIHS0 (0x40018000U) /**< \brief (TWIHS0) Base Address */ -#define TWIHS1 (0x4001C000U) /**< \brief (TWIHS1) Base Address */ -#define PWM0 (0x40020000U) /**< \brief (PWM0 ) Base Address */ -#define USART0 (0x40024000U) /**< \brief (USART0) Base Address */ -#define USART1 (0x40028000U) /**< \brief (USART1) Base Address */ -#define USART2 (0x4002C000U) /**< \brief (USART2) Base Address */ -#define MCAN0 (0x40030000U) /**< \brief (MCAN0 ) Base Address */ -#define MCAN1 (0x40034000U) /**< \brief (MCAN1 ) Base Address */ -#define USBHS (0x40038000U) /**< \brief (USBHS ) Base Address */ -#define AFEC0 (0x4003C000U) /**< \brief (AFEC0 ) Base Address */ -#define DACC (0x40040000U) /**< \brief (DACC ) Base Address */ -#define ACC (0x40044000U) /**< \brief (ACC ) Base Address */ -#define ICM (0x40048000U) /**< \brief (ICM ) Base Address */ -#define ISI (0x4004C000U) /**< \brief (ISI ) Base Address */ -#define GMAC (0x40050000U) /**< \brief (GMAC ) Base Address */ -#define TC3 (0x40054000U) /**< \brief (TC3 ) Base Address */ -#define SPI1 (0x40058000U) /**< \brief (SPI1 ) Base Address */ -#define PWM1 (0x4005C000U) /**< \brief (PWM1 ) Base Address */ -#define TWIHS2 (0x40060000U) /**< \brief (TWIHS2) Base Address */ -#define AFEC1 (0x40064000U) /**< \brief (AFEC1 ) Base Address */ -#define MLB (0x40068000U) /**< \brief (MLB ) Base Address */ -#define AES (0x4006C000U) /**< \brief (AES ) Base Address */ -#define TRNG (0x40070000U) /**< \brief (TRNG ) Base Address */ -#define XDMAC (0x40078000U) /**< \brief (XDMAC ) Base Address */ -#define QSPI (0x4007C000U) /**< \brief (QSPI ) Base Address */ -#define SMC (0x40080000U) /**< \brief (SMC ) Base Address */ -#define SDRAMC (0x40084000U) /**< \brief (SDRAMC) Base Address */ -#define MATRIX (0x40088000U) /**< \brief (MATRIX) Base Address */ -#define UTMI (0x400E0400U) /**< \brief (UTMI ) Base Address */ -#define PMC (0x400E0600U) /**< \brief (PMC ) Base Address */ -#define UART0 (0x400E0800U) /**< \brief (UART0 ) Base Address */ -#define CHIPID (0x400E0940U) /**< \brief (CHIPID) Base Address */ -#define UART1 (0x400E0A00U) /**< \brief (UART1 ) Base Address */ -#define EFC (0x400E0C00U) /**< \brief (EFC ) Base Address */ -#define PIOA (0x400E0E00U) /**< \brief (PIOA ) Base Address */ -#define PIOB (0x400E1000U) /**< \brief (PIOB ) Base Address */ -#define PIOC (0x400E1200U) /**< \brief (PIOC ) Base Address */ -#define PIOD (0x400E1400U) /**< \brief (PIOD ) Base Address */ -#define PIOE (0x400E1600U) /**< \brief (PIOE ) Base Address */ -#define RSTC (0x400E1800U) /**< \brief (RSTC ) Base Address */ -#define SUPC (0x400E1810U) /**< \brief (SUPC ) Base Address */ -#define RTT (0x400E1830U) /**< \brief (RTT ) Base Address */ -#define WDT (0x400E1850U) /**< \brief (WDT ) Base Address */ -#define RTC (0x400E1860U) /**< \brief (RTC ) Base Address */ -#define GPBR (0x400E1890U) /**< \brief (GPBR ) Base Address */ -#define RSWDT (0x400E1900U) /**< \brief (RSWDT ) Base Address */ -#define UART2 (0x400E1A00U) /**< \brief (UART2 ) Base Address */ -#define UART3 (0x400E1C00U) /**< \brief (UART3 ) Base Address */ -#define UART4 (0x400E1E00U) /**< \brief (UART4 ) Base Address */ -#else -#define HSMCI ((Hsmci *)0x40000000U) /**< \brief (HSMCI ) Base Address */ -#define SSC ((Ssc *)0x40004000U) /**< \brief (SSC ) Base Address */ -#define SPI0 ((Spi *)0x40008000U) /**< \brief (SPI0 ) Base Address */ -#define TC0 ((Tc *)0x4000C000U) /**< \brief (TC0 ) Base Address */ -#define TC1 ((Tc *)0x40010000U) /**< \brief (TC1 ) Base Address */ -#define TC2 ((Tc *)0x40014000U) /**< \brief (TC2 ) Base Address */ -#define TWIHS0 ((Twihs *)0x40018000U) /**< \brief (TWIHS0) Base Address */ -#define TWIHS1 ((Twihs *)0x4001C000U) /**< \brief (TWIHS1) Base Address */ -#define PWM0 ((Pwm *)0x40020000U) /**< \brief (PWM0 ) Base Address */ -#define USART0 ((Usart *)0x40024000U) /**< \brief (USART0) Base Address */ -#define USART1 ((Usart *)0x40028000U) /**< \brief (USART1) Base Address */ -#define USART2 ((Usart *)0x4002C000U) /**< \brief (USART2) Base Address */ -#define MCAN0 ((Mcan *)0x40030000U) /**< \brief (MCAN0 ) Base Address */ -#define MCAN1 ((Mcan *)0x40034000U) /**< \brief (MCAN1 ) Base Address */ -#define USBHS ((Usbhs *)0x40038000U) /**< \brief (USBHS ) Base Address */ -#define AFEC0 ((Afec *)0x4003C000U) /**< \brief (AFEC0 ) Base Address */ -#define DACC ((Dacc *)0x40040000U) /**< \brief (DACC ) Base Address */ -#define ACC ((Acc *)0x40044000U) /**< \brief (ACC ) Base Address */ -#define ICM ((Icm *)0x40048000U) /**< \brief (ICM ) Base Address */ -#define ISI ((Isi *)0x4004C000U) /**< \brief (ISI ) Base Address */ -#define GMAC ((Gmac *)0x40050000U) /**< \brief (GMAC ) Base Address */ -#define TC3 ((Tc *)0x40054000U) /**< \brief (TC3 ) Base Address */ -#define SPI1 ((Spi *)0x40058000U) /**< \brief (SPI1 ) Base Address */ -#define PWM1 ((Pwm *)0x4005C000U) /**< \brief (PWM1 ) Base Address */ -#define TWIHS2 ((Twihs *)0x40060000U) /**< \brief (TWIHS2) Base Address */ -#define AFEC1 ((Afec *)0x40064000U) /**< \brief (AFEC1 ) Base Address */ -#define MLB ((Mlb *)0x40068000U) /**< \brief (MLB ) Base Address */ -#define AES ((Aes *)0x4006C000U) /**< \brief (AES ) Base Address */ -#define TRNG ((Trng *)0x40070000U) /**< \brief (TRNG ) Base Address */ -#define XDMAC ((Xdmac *)0x40078000U) /**< \brief (XDMAC ) Base Address */ -#define QSPI ((Qspi *)0x4007C000U) /**< \brief (QSPI ) Base Address */ -#define SMC ((Smc *)0x40080000U) /**< \brief (SMC ) Base Address */ -#define SDRAMC ((Sdramc *)0x40084000U) /**< \brief (SDRAMC) Base Address */ -#define MATRIX ((Matrix *)0x40088000U) /**< \brief (MATRIX) Base Address */ -#define UTMI ((Utmi *)0x400E0400U) /**< \brief (UTMI ) Base Address */ -#define PMC ((Pmc *)0x400E0600U) /**< \brief (PMC ) Base Address */ -#define UART0 ((Uart *)0x400E0800U) /**< \brief (UART0 ) Base Address */ -#define CHIPID ((Chipid *)0x400E0940U) /**< \brief (CHIPID) Base Address */ -#define UART1 ((Uart *)0x400E0A00U) /**< \brief (UART1 ) Base Address */ -#define EFC ((Efc *)0x400E0C00U) /**< \brief (EFC ) Base Address */ -#define PIOA ((Pio *)0x400E0E00U) /**< \brief (PIOA ) Base Address */ -#define PIOB ((Pio *)0x400E1000U) /**< \brief (PIOB ) Base Address */ -#define PIOC ((Pio *)0x400E1200U) /**< \brief (PIOC ) Base Address */ -#define PIOD ((Pio *)0x400E1400U) /**< \brief (PIOD ) Base Address */ -#define PIOE ((Pio *)0x400E1600U) /**< \brief (PIOE ) Base Address */ -#define RSTC ((Rstc *)0x400E1800U) /**< \brief (RSTC ) Base Address */ -#define SUPC ((Supc *)0x400E1810U) /**< \brief (SUPC ) Base Address */ -#define RTT ((Rtt *)0x400E1830U) /**< \brief (RTT ) Base Address */ -#define WDT ((Wdt *)0x400E1850U) /**< \brief (WDT ) Base Address */ -#define RTC ((Rtc *)0x400E1860U) /**< \brief (RTC ) Base Address */ -#define GPBR ((Gpbr *)0x400E1890U) /**< \brief (GPBR ) Base Address */ -#define RSWDT ((Rswdt *)0x400E1900U) /**< \brief (RSWDT ) Base Address */ -#define UART2 ((Uart *)0x400E1A00U) /**< \brief (UART2 ) Base Address */ -#define UART3 ((Uart *)0x400E1C00U) /**< \brief (UART3 ) Base Address */ -#define UART4 ((Uart *)0x400E1E00U) /**< \brief (UART4 ) Base Address */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/*@}*/ - -/* ************************************************************************** */ -/* PIO DEFINITIONS FOR SAMV71Q19 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71Q19_pio Peripheral Pio Definitions */ -/*@{*/ - -#include "pio/pio_samv71q19.h" -/*@}*/ - -/* ************************************************************************** */ -/* MEMORY MAPPING DEFINITIONS FOR SAMV71Q19 */ -/* ************************************************************************** */ - -#define IFLASH_SIZE (0x80000u) -#define IFLASH_PAGE_SIZE (512u) -#define IFLASH_LOCK_REGION_SIZE (16384u) -#define IFLASH_NB_OF_PAGES (1024u) -#define IFLASH_NB_OF_LOCK_BITS (32u) -#define IRAM_SIZE (0x40000u) - -#define QSPIMEM_ADDR (0x80000000u) /**< QSPI Memory base address */ -#define AXIMX_ADDR (0xA0000000u) /**< AXI Bus Matrix base address */ -#define ITCM_ADDR (0x00000000u) /**< Instruction Tightly Coupled Memory base address */ -#define IFLASH_ADDR (0x00400000u) /**< Internal Flash base address */ -#define IROM_ADDR (0x00800000u) /**< Internal ROM base address */ -#define DTCM_ADDR (0x20000000u) /**< Data Tightly Coupled Memory base address */ -#define IRAM_ADDR (0x20400000u) /**< Internal RAM base address */ -#define EBI_CS0_ADDR (0x60000000u) /**< EBI Chip Select 0 base address */ -#define EBI_CS1_ADDR (0x61000000u) /**< EBI Chip Select 1 base address */ -#define EBI_CS2_ADDR (0x62000000u) /**< EBI Chip Select 2 base address */ -#define EBI_CS3_ADDR (0x63000000u) /**< EBI Chip Select 3 base address */ -#define SDRAM_CS_ADDR (0x70000000u) /**< SDRAM Chip Select base address */ - -/* ************************************************************************** */ -/* MISCELLANEOUS DEFINITIONS FOR SAMV71Q19 */ -/* ************************************************************************** */ - -#define CHIP_JTAGID (0x05B3D03FUL) -#define CHIP_CIDR (0xA12D0A00UL) -#define CHIP_EXID (0x00000002UL) - -/* ************************************************************************** */ -/* ELECTRICAL DEFINITIONS FOR SAMV71Q19 */ -/* ************************************************************************** */ - -/* %ATMEL_ELECTRICAL% */ - -/* Device characteristics */ -#define CHIP_FREQ_SLCK_RC_MIN (20000UL) -#define CHIP_FREQ_SLCK_RC (32000UL) -#define CHIP_FREQ_SLCK_RC_MAX (44000UL) -#define CHIP_FREQ_MAINCK_RC_4MHZ (4000000UL) -#define CHIP_FREQ_MAINCK_RC_8MHZ (8000000UL) -#define CHIP_FREQ_MAINCK_RC_12MHZ (12000000UL) -#define CHIP_FREQ_CPU_MAX (300000000UL) -#define CHIP_FREQ_XTAL_32K (32768UL) -#define CHIP_FREQ_XTAL_12M (12000000UL) - -/* Embedded Flash Read Wait State (VDDCORE set at 1.20V) */ -#define CHIP_FREQ_FWS_0 (26000000UL) /**< \brief Maximum operating frequency when FWS is 0 */ -#define CHIP_FREQ_FWS_1 (52000000UL) /**< \brief Maximum operating frequency when FWS is 1 */ -#define CHIP_FREQ_FWS_2 (78000000UL) /**< \brief Maximum operating frequency when FWS is 2 */ -#define CHIP_FREQ_FWS_3 (104000000UL) /**< \brief Maximum operating frequency when FWS is 3 */ -#define CHIP_FREQ_FWS_4 (131000000UL) /**< \brief Maximum operating frequency when FWS is 4 */ -#define CHIP_FREQ_FWS_5 (150000000UL) /**< \brief Maximum operating frequency when FWS is 5 */ - - -#ifdef __cplusplus -} -#endif - -/*@}*/ - -#endif /* _SAMV71Q19_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/samv71q20.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/samv71q20.h deleted file mode 100644 index 34fd275b..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/samv71q20.h +++ /dev/null @@ -1,693 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71Q20_ -#define _SAMV71Q20_ - -/** \addtogroup SAMV71Q20_definitions SAMV71Q20 definitions - This file defines all structures and symbols for SAMV71Q20: - - registers and bit-fields - - peripheral base address - - peripheral ID - - PIO definitions -*/ -/*@{*/ - -#ifdef __cplusplus - extern "C" { -#endif - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -#include -#endif - -/* ************************************************************************** */ -/* CMSIS DEFINITIONS FOR SAMV71Q20 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71Q20_cmsis CMSIS Definitions */ -/*@{*/ - -/**< Interrupt Number Definition */ -typedef enum IRQn -{ -/****** Cortex-M7 Processor Exceptions Numbers ******************************/ - NonMaskableInt_IRQn = -14, /**< 2 Non Maskable Interrupt */ - HardFault_IRQn = -13, /**< 3 HardFault Interrupt */ - MemoryManagement_IRQn = -12, /**< 4 Cortex-M7 Memory Management Interrupt */ - BusFault_IRQn = -11, /**< 5 Cortex-M7 Bus Fault Interrupt */ - UsageFault_IRQn = -10, /**< 6 Cortex-M7 Usage Fault Interrupt */ - SVCall_IRQn = -5, /**< 11 Cortex-M7 SV Call Interrupt */ - DebugMonitor_IRQn = -4, /**< 12 Cortex-M7 Debug Monitor Interrupt */ - PendSV_IRQn = -2, /**< 14 Cortex-M7 Pend SV Interrupt */ - SysTick_IRQn = -1, /**< 15 Cortex-M7 System Tick Interrupt */ -/****** SAMV71Q20 specific Interrupt Numbers *********************************/ - - SUPC_IRQn = 0, /**< 0 SAMV71Q20 Supply Controller (SUPC) */ - RSTC_IRQn = 1, /**< 1 SAMV71Q20 Reset Controller (RSTC) */ - RTC_IRQn = 2, /**< 2 SAMV71Q20 Real Time Clock (RTC) */ - RTT_IRQn = 3, /**< 3 SAMV71Q20 Real Time Timer (RTT) */ - WDT_IRQn = 4, /**< 4 SAMV71Q20 Watchdog Timer (WDT) */ - PMC_IRQn = 5, /**< 5 SAMV71Q20 Power Management Controller (PMC) */ - EFC_IRQn = 6, /**< 6 SAMV71Q20 Enhanced Embedded Flash Controller (EFC) */ - UART0_IRQn = 7, /**< 7 SAMV71Q20 UART 0 (UART0) */ - UART1_IRQn = 8, /**< 8 SAMV71Q20 UART 1 (UART1) */ - PIOA_IRQn = 10, /**< 10 SAMV71Q20 Parallel I/O Controller A (PIOA) */ - PIOB_IRQn = 11, /**< 11 SAMV71Q20 Parallel I/O Controller B (PIOB) */ - PIOC_IRQn = 12, /**< 12 SAMV71Q20 Parallel I/O Controller C (PIOC) */ - USART0_IRQn = 13, /**< 13 SAMV71Q20 USART 0 (USART0) */ - USART1_IRQn = 14, /**< 14 SAMV71Q20 USART 1 (USART1) */ - USART2_IRQn = 15, /**< 15 SAMV71Q20 USART 2 (USART2) */ - PIOD_IRQn = 16, /**< 16 SAMV71Q20 Parallel I/O Controller D (PIOD) */ - PIOE_IRQn = 17, /**< 17 SAMV71Q20 Parallel I/O Controller E (PIOE) */ - HSMCI_IRQn = 18, /**< 18 SAMV71Q20 Multimedia Card Interface (HSMCI) */ - TWIHS0_IRQn = 19, /**< 19 SAMV71Q20 Two Wire Interface 0 HS (TWIHS0) */ - TWIHS1_IRQn = 20, /**< 20 SAMV71Q20 Two Wire Interface 1 HS (TWIHS1) */ - SPI0_IRQn = 21, /**< 21 SAMV71Q20 Serial Peripheral Interface 0 (SPI0) */ - SSC_IRQn = 22, /**< 22 SAMV71Q20 Synchronous Serial Controller (SSC) */ - TC0_IRQn = 23, /**< 23 SAMV71Q20 Timer/Counter 0 (TC0) */ - TC1_IRQn = 24, /**< 24 SAMV71Q20 Timer/Counter 1 (TC1) */ - TC2_IRQn = 25, /**< 25 SAMV71Q20 Timer/Counter 2 (TC2) */ - TC3_IRQn = 26, /**< 26 SAMV71Q20 Timer/Counter 3 (TC3) */ - TC4_IRQn = 27, /**< 27 SAMV71Q20 Timer/Counter 4 (TC4) */ - TC5_IRQn = 28, /**< 28 SAMV71Q20 Timer/Counter 5 (TC5) */ - AFEC0_IRQn = 29, /**< 29 SAMV71Q20 Analog Front End 0 (AFEC0) */ - DACC_IRQn = 30, /**< 30 SAMV71Q20 Digital To Analog Converter (DACC) */ - PWM0_IRQn = 31, /**< 31 SAMV71Q20 Pulse Width Modulation 0 (PWM0) */ - ICM_IRQn = 32, /**< 32 SAMV71Q20 Integrity Check Monitor (ICM) */ - ACC_IRQn = 33, /**< 33 SAMV71Q20 Analog Comparator (ACC) */ - USBHS_IRQn = 34, /**< 34 SAMV71Q20 USB Host / Device Controller (USBHS) */ - MCAN0_IRQn = 35, /**< 35 SAMV71Q20 MCAN Controller 0 (MCAN0) */ - MCAN0_LINE1_IRQn = 36, /**< 36 SAMV71Q21 MCAN Controller 0 LINE1 (MCAN0) */ - MCAN1_IRQn = 37, /**< 37 SAMV71Q20 MCAN Controller 1 (MCAN1) */ - MCAN1_LINE1_IRQn = 38, /**< 38 SAMV71Q21 MCAN Controller 1 LINE1 (MCAN1) */ - GMAC_IRQn = 39, /**< 39 SAMV71Q20 Ethernet MAC (GMAC) */ - AFEC1_IRQn = 40, /**< 40 SAMV71Q20 Analog Front End 1 (AFEC1) */ - TWIHS2_IRQn = 41, /**< 41 SAMV71Q20 Two Wire Interface 2 HS (TWIHS2) */ - SPI1_IRQn = 42, /**< 42 SAMV71Q20 Serial Peripheral Interface 1 (SPI1) */ - QSPI_IRQn = 43, /**< 43 SAMV71Q20 Quad I/O Serial Peripheral Interface (QSPI) */ - UART2_IRQn = 44, /**< 44 SAMV71Q20 UART 2 (UART2) */ - UART3_IRQn = 45, /**< 45 SAMV71Q20 UART 3 (UART3) */ - UART4_IRQn = 46, /**< 46 SAMV71Q20 UART 4 (UART4) */ - TC6_IRQn = 47, /**< 47 SAMV71Q20 Timer/Counter 6 (TC6) */ - TC7_IRQn = 48, /**< 48 SAMV71Q20 Timer/Counter 7 (TC7) */ - TC8_IRQn = 49, /**< 49 SAMV71Q20 Timer/Counter 8 (TC8) */ - TC9_IRQn = 50, /**< 50 SAMV71Q20 Timer/Counter 9 (TC9) */ - TC10_IRQn = 51, /**< 51 SAMV71Q20 Timer/Counter 10 (TC10) */ - TC11_IRQn = 52, /**< 52 SAMV71Q20 Timer/Counter 11 (TC11) */ - MLB_IRQn = 53, /**< 53 SAMV71Q20 MediaLB (MLB) */ - AES_IRQn = 56, /**< 56 SAMV71Q20 AES (AES) */ - TRNG_IRQn = 57, /**< 57 SAMV71Q20 True Random Generator (TRNG) */ - XDMAC_IRQn = 58, /**< 58 SAMV71Q20 DMA (XDMAC) */ - ISI_IRQn = 59, /**< 59 SAMV71Q20 Camera Interface (ISI) */ - PWM1_IRQn = 60, /**< 60 SAMV71Q20 Pulse Width Modulation 1 (PWM1) */ - SDRAMC_IRQn = 62, /**< 62 SAMV71Q20 SDRAM Controller (SDRAMC) */ - RSWDT_IRQn = 63, /**< 63 SAMV71Q20 Reinforced Secure Watchdog Timer (RSWDT) */ - - PERIPH_COUNT_IRQn = 64 /**< Number of peripheral IDs */ -} IRQn_Type; - -typedef struct _DeviceVectors -{ - /* Stack pointer */ - void* pvStack; - - /* Cortex-M handlers */ - void* pfnReset_Handler; - void* pfnNMI_Handler; - void* pfnHardFault_Handler; - void* pfnMemManage_Handler; - void* pfnBusFault_Handler; - void* pfnUsageFault_Handler; - void* pfnReserved1_Handler; - void* pfnReserved2_Handler; - void* pfnReserved3_Handler; - void* pfnReserved4_Handler; - void* pfnSVC_Handler; - void* pfnDebugMon_Handler; - void* pfnReserved5_Handler; - void* pfnPendSV_Handler; - void* pfnSysTick_Handler; - - /* Peripheral handlers */ - void* pfnSUPC_Handler; /* 0 Supply Controller */ - void* pfnRSTC_Handler; /* 1 Reset Controller */ - void* pfnRTC_Handler; /* 2 Real Time Clock */ - void* pfnRTT_Handler; /* 3 Real Time Timer */ - void* pfnWDT_Handler; /* 4 Watchdog Timer */ - void* pfnPMC_Handler; /* 5 Power Management Controller */ - void* pfnEFC_Handler; /* 6 Enhanced Embedded Flash Controller */ - void* pfnUART0_Handler; /* 7 UART 0 */ - void* pfnUART1_Handler; /* 8 UART 1 */ - void* pvReserved9; - void* pfnPIOA_Handler; /* 10 Parallel I/O Controller A */ - void* pfnPIOB_Handler; /* 11 Parallel I/O Controller B */ - void* pfnPIOC_Handler; /* 12 Parallel I/O Controller C */ - void* pfnUSART0_Handler; /* 13 USART 0 */ - void* pfnUSART1_Handler; /* 14 USART 1 */ - void* pfnUSART2_Handler; /* 15 USART 2 */ - void* pfnPIOD_Handler; /* 16 Parallel I/O Controller D */ - void* pfnPIOE_Handler; /* 17 Parallel I/O Controller E */ - void* pfnHSMCI_Handler; /* 18 Multimedia Card Interface */ - void* pfnTWIHS0_Handler; /* 19 Two Wire Interface 0 HS */ - void* pfnTWIHS1_Handler; /* 20 Two Wire Interface 1 HS */ - void* pfnSPI0_Handler; /* 21 Serial Peripheral Interface 0 */ - void* pfnSSC_Handler; /* 22 Synchronous Serial Controller */ - void* pfnTC0_Handler; /* 23 Timer/Counter 0 */ - void* pfnTC1_Handler; /* 24 Timer/Counter 1 */ - void* pfnTC2_Handler; /* 25 Timer/Counter 2 */ - void* pfnTC3_Handler; /* 26 Timer/Counter 3 */ - void* pfnTC4_Handler; /* 27 Timer/Counter 4 */ - void* pfnTC5_Handler; /* 28 Timer/Counter 5 */ - void* pfnAFEC0_Handler; /* 29 Analog Front End 0 */ - void* pfnDACC_Handler; /* 30 Digital To Analog Converter */ - void* pfnPWM0_Handler; /* 31 Pulse Width Modulation 0 */ - void* pfnICM_Handler; /* 32 Integrity Check Monitor */ - void* pfnACC_Handler; /* 33 Analog Comparator */ - void* pfnUSBHS_Handler; /* 34 USB Host / Device Controller */ - void* pfnMCAN0_Handler; /* 35 MCAN Controller 0 */ - void* pfnMCAN0_Line1_Handler; /* 36 MCAN Controller 0 */ - void* pfnMCAN1_Handler; /* 37 MCAN Controller 1 */ - void* pfnMCAN1_Line1_Handler; /* 38 MCAN Controller 1 */ - void* pfnGMAC_Handler; /* 39 Ethernet MAC */ - void* pfnAFEC1_Handler; /* 40 Analog Front End 1 */ - void* pfnTWIHS2_Handler; /* 41 Two Wire Interface 2 HS */ - void* pfnSPI1_Handler; /* 42 Serial Peripheral Interface 1 */ - void* pfnQSPI_Handler; /* 43 Quad I/O Serial Peripheral Interface */ - void* pfnUART2_Handler; /* 44 UART 2 */ - void* pfnUART3_Handler; /* 45 UART 3 */ - void* pfnUART4_Handler; /* 46 UART 4 */ - void* pfnTC6_Handler; /* 47 Timer/Counter 6 */ - void* pfnTC7_Handler; /* 48 Timer/Counter 7 */ - void* pfnTC8_Handler; /* 49 Timer/Counter 8 */ - void* pfnTC9_Handler; /* 50 Timer/Counter 9 */ - void* pfnTC10_Handler; /* 51 Timer/Counter 10 */ - void* pfnTC11_Handler; /* 52 Timer/Counter 11 */ - void* pfnMLB_Handler; /* 53 MediaLB */ - void* pvReserved54; - void* pvReserved55; - void* pfnAES_Handler; /* 56 AES */ - void* pfnTRNG_Handler; /* 57 True Random Generator */ - void* pfnXDMAC_Handler; /* 58 DMA */ - void* pfnISI_Handler; /* 59 Camera Interface */ - void* pfnPWM1_Handler; /* 60 Pulse Width Modulation 1 */ - void* pvReserved61; - void* pfnSDRAMC_Handler; /* 62 SDRAM Controller */ - void* pfnRSWDT_Handler; /* 63 Reinforced Secure Watchdog Timer */ -} DeviceVectors; - -/* Cortex-M7 core handlers */ -void Reset_Handler ( void ); -void NMI_Handler ( void ); -void HardFault_Handler ( void ); -void MemManage_Handler ( void ); -void BusFault_Handler ( void ); -void UsageFault_Handler ( void ); -void SVC_Handler ( void ); -void DebugMon_Handler ( void ); -void PendSV_Handler ( void ); -void SysTick_Handler ( void ); - -/* Peripherals handlers */ -void ACC_Handler ( void ); -void AES_Handler ( void ); -void AFEC0_Handler ( void ); -void AFEC1_Handler ( void ); -void DACC_Handler ( void ); -void EFC_Handler ( void ); -void GMAC_Handler ( void ); -void HSMCI_Handler ( void ); -void ICM_Handler ( void ); -void ISI_Handler ( void ); -void MCAN0_Handler ( void ); -void MCAN0_Line1_Handler( void ); -void MCAN1_Handler ( void ); -void MCAN1_Line1_Handler( void ); -void MLB_Handler ( void ); -void PIOA_Handler ( void ); -void PIOB_Handler ( void ); -void PIOC_Handler ( void ); -void PIOD_Handler ( void ); -void PIOE_Handler ( void ); -void PMC_Handler ( void ); -void PWM0_Handler ( void ); -void PWM1_Handler ( void ); -void QSPI_Handler ( void ); -void RSTC_Handler ( void ); -void RSWDT_Handler ( void ); -void RTC_Handler ( void ); -void RTT_Handler ( void ); -void SDRAMC_Handler ( void ); -void SPI0_Handler ( void ); -void SPI1_Handler ( void ); -void SSC_Handler ( void ); -void SUPC_Handler ( void ); -void TC0_Handler ( void ); -void TC1_Handler ( void ); -void TC2_Handler ( void ); -void TC3_Handler ( void ); -void TC4_Handler ( void ); -void TC5_Handler ( void ); -void TC6_Handler ( void ); -void TC7_Handler ( void ); -void TC8_Handler ( void ); -void TC9_Handler ( void ); -void TC10_Handler ( void ); -void TC11_Handler ( void ); -void TRNG_Handler ( void ); -void TWIHS0_Handler ( void ); -void TWIHS1_Handler ( void ); -void TWIHS2_Handler ( void ); -void UART0_Handler ( void ); -void UART1_Handler ( void ); -void UART2_Handler ( void ); -void UART3_Handler ( void ); -void UART4_Handler ( void ); -void USART0_Handler ( void ); -void USART1_Handler ( void ); -void USART2_Handler ( void ); -void USBHS_Handler ( void ); -void WDT_Handler ( void ); -void XDMAC_Handler ( void ); - -/** - * \brief Configuration of the Cortex-M7 Processor and Core Peripherals - */ - -#define __CM7_REV 0x0000 /**< SAMV71Q20 core revision number ([15:8] revision number, [7:0] patch number) */ -#define __MPU_PRESENT 1 /**< SAMV71Q20 does provide a MPU */ -#define __NVIC_PRIO_BITS 3 /**< SAMV71Q20 uses 3 Bits for the Priority Levels */ -#define __FPU_PRESENT 1 /**< SAMV71Q20 does provide a FPU */ -#define __FPU_DP 1 /**< SAMV71Q20 Double precision FPU */ -#define __ICACHE_PRESENT 1 /**< SAMV71Q20 does provide an Instruction Cache */ -#define __DCACHE_PRESENT 1 /**< SAMV71Q20 does provide a Data Cache */ -#define __DTCM_PRESENT 1 /**< SAMV71Q20 does provide a Data TCM */ -#define __ITCM_PRESENT 1 /**< SAMV71Q20 does provide an Instruction TCM */ -#define __Vendor_SysTickConfig 0 /**< Set to 1 if different SysTick Config is used */ - -/* - * \brief CMSIS includes - */ - -#include -#if !defined DONT_USE_CMSIS_INIT -#include "system_samv71.h" -#endif /* DONT_USE_CMSIS_INIT */ - -/*@}*/ - -/* ************************************************************************** */ -/** SOFTWARE PERIPHERAL API DEFINITION FOR SAMV71Q20 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71Q20_api Peripheral Software API */ -/*@{*/ - -#include "component/component_acc.h" -#include "component/component_aes.h" -#include "component/component_afec.h" -#include "component/component_chipid.h" -#include "component/component_dacc.h" -#include "component/component_efc.h" -#include "component/component_gmac.h" -#include "component/component_gpbr.h" -#include "component/component_hsmci.h" -#include "component/component_icm.h" -#include "component/component_isi.h" -#include "component/component_matrix.h" -#include "component/component_mcan.h" -#include "component/component_mlb.h" -#include "component/component_pio.h" -#include "component/component_pmc.h" -#include "component/component_pwm.h" -#include "component/component_qspi.h" -#include "component/component_rstc.h" -#include "component/component_rswdt.h" -#include "component/component_rtc.h" -#include "component/component_rtt.h" -#include "component/component_sdramc.h" -#include "component/component_smc.h" -#include "component/component_spi.h" -#include "component/component_ssc.h" -#include "component/component_supc.h" -#include "component/component_tc.h" -#include "component/component_trng.h" -#include "component/component_twihs.h" -#include "component/component_uart.h" -#include "component/component_usart.h" -#include "component/component_usbhs.h" -#include "component/component_utmi.h" -#include "component/component_wdt.h" -#include "component/component_xdmac.h" -/*@}*/ - -/* ************************************************************************** */ -/* REGISTER ACCESS DEFINITIONS FOR SAMV71Q20 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71Q20_reg Registers Access Definitions */ -/*@{*/ - -#include "instance/instance_hsmci.h" -#include "instance/instance_ssc.h" -#include "instance/instance_spi0.h" -#include "instance/instance_tc0.h" -#include "instance/instance_tc1.h" -#include "instance/instance_tc2.h" -#include "instance/instance_twihs0.h" -#include "instance/instance_twihs1.h" -#include "instance/instance_pwm0.h" -#include "instance/instance_usart0.h" -#include "instance/instance_usart1.h" -#include "instance/instance_usart2.h" -#include "instance/instance_mcan0.h" -#include "instance/instance_mcan1.h" -#include "instance/instance_usbhs.h" -#include "instance/instance_afec0.h" -#include "instance/instance_dacc.h" -#include "instance/instance_acc.h" -#include "instance/instance_icm.h" -#include "instance/instance_isi.h" -#include "instance/instance_gmac.h" -#include "instance/instance_tc3.h" -#include "instance/instance_spi1.h" -#include "instance/instance_pwm1.h" -#include "instance/instance_twihs2.h" -#include "instance/instance_afec1.h" -#include "instance/instance_mlb.h" -#include "instance/instance_aes.h" -#include "instance/instance_trng.h" -#include "instance/instance_xdmac.h" -#include "instance/instance_qspi.h" -#include "instance/instance_smc.h" -#include "instance/instance_sdramc.h" -#include "instance/instance_matrix.h" -#include "instance/instance_utmi.h" -#include "instance/instance_pmc.h" -#include "instance/instance_uart0.h" -#include "instance/instance_chipid.h" -#include "instance/instance_uart1.h" -#include "instance/instance_efc.h" -#include "instance/instance_pioa.h" -#include "instance/instance_piob.h" -#include "instance/instance_pioc.h" -#include "instance/instance_piod.h" -#include "instance/instance_pioe.h" -#include "instance/instance_rstc.h" -#include "instance/instance_supc.h" -#include "instance/instance_rtt.h" -#include "instance/instance_wdt.h" -#include "instance/instance_rtc.h" -#include "instance/instance_gpbr.h" -#include "instance/instance_rswdt.h" -#include "instance/instance_uart2.h" -#include "instance/instance_uart3.h" -#include "instance/instance_uart4.h" -/*@}*/ - -/* ************************************************************************** */ -/* PERIPHERAL ID DEFINITIONS FOR SAMV71Q20 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71Q20_id Peripheral Ids Definitions */ -/*@{*/ - -#define ID_SUPC ( 0) /**< \brief Supply Controller (SUPC) */ -#define ID_RSTC ( 1) /**< \brief Reset Controller (RSTC) */ -#define ID_RTC ( 2) /**< \brief Real Time Clock (RTC) */ -#define ID_RTT ( 3) /**< \brief Real Time Timer (RTT) */ -#define ID_WDT ( 4) /**< \brief Watchdog Timer (WDT) */ -#define ID_PMC ( 5) /**< \brief Power Management Controller (PMC) */ -#define ID_EFC ( 6) /**< \brief Enhanced Embedded Flash Controller (EFC) */ -#define ID_UART0 ( 7) /**< \brief UART 0 (UART0) */ -#define ID_UART1 ( 8) /**< \brief UART 1 (UART1) */ -#define ID_SMC ( 9) /**< \brief Static Memory Controller (SMC) */ -#define ID_PIOA (10) /**< \brief Parallel I/O Controller A (PIOA) */ -#define ID_PIOB (11) /**< \brief Parallel I/O Controller B (PIOB) */ -#define ID_PIOC (12) /**< \brief Parallel I/O Controller C (PIOC) */ -#define ID_USART0 (13) /**< \brief USART 0 (USART0) */ -#define ID_USART1 (14) /**< \brief USART 1 (USART1) */ -#define ID_USART2 (15) /**< \brief USART 2 (USART2) */ -#define ID_PIOD (16) /**< \brief Parallel I/O Controller D (PIOD) */ -#define ID_PIOE (17) /**< \brief Parallel I/O Controller E (PIOE) */ -#define ID_HSMCI (18) /**< \brief Multimedia Card Interface (HSMCI) */ -#define ID_TWIHS0 (19) /**< \brief Two Wire Interface 0 HS (TWIHS0) */ -#define ID_TWIHS1 (20) /**< \brief Two Wire Interface 1 HS (TWIHS1) */ -#define ID_SPI0 (21) /**< \brief Serial Peripheral Interface 0 (SPI0) */ -#define ID_SSC (22) /**< \brief Synchronous Serial Controller (SSC) */ -#define ID_TC0 (23) /**< \brief Timer/Counter 0 (TC0) */ -#define ID_TC1 (24) /**< \brief Timer/Counter 1 (TC1) */ -#define ID_TC2 (25) /**< \brief Timer/Counter 2 (TC2) */ -#define ID_TC3 (26) /**< \brief Timer/Counter 3 (TC3) */ -#define ID_TC4 (27) /**< \brief Timer/Counter 4 (TC4) */ -#define ID_TC5 (28) /**< \brief Timer/Counter 5 (TC5) */ -#define ID_AFEC0 (29) /**< \brief Analog Front End 0 (AFEC0) */ -#define ID_DACC (30) /**< \brief Digital To Analog Converter (DACC) */ -#define ID_PWM0 (31) /**< \brief Pulse Width Modulation 0 (PWM0) */ -#define ID_ICM (32) /**< \brief Integrity Check Monitor (ICM) */ -#define ID_ACC (33) /**< \brief Analog Comparator (ACC) */ -#define ID_USBHS (34) /**< \brief USB Host / Device Controller (USBHS) */ -#define ID_MCAN0 (35) /**< \brief MCAN Controller 0 (MCAN0) */ -#define ID_MCAN1 (37) /**< \brief MCAN Controller 1 (MCAN1) */ -#define ID_GMAC (39) /**< \brief Ethernet MAC (GMAC) */ -#define ID_AFEC1 (40) /**< \brief Analog Front End 1 (AFEC1) */ -#define ID_TWIHS2 (41) /**< \brief Two Wire Interface 2 HS (TWIHS2) */ -#define ID_SPI1 (42) /**< \brief Serial Peripheral Interface 1 (SPI1) */ -#define ID_QSPI (43) /**< \brief Quad I/O Serial Peripheral Interface (QSPI) */ -#define ID_UART2 (44) /**< \brief UART 2 (UART2) */ -#define ID_UART3 (45) /**< \brief UART 3 (UART3) */ -#define ID_UART4 (46) /**< \brief UART 4 (UART4) */ -#define ID_TC6 (47) /**< \brief Timer/Counter 6 (TC6) */ -#define ID_TC7 (48) /**< \brief Timer/Counter 7 (TC7) */ -#define ID_TC8 (49) /**< \brief Timer/Counter 8 (TC8) */ -#define ID_TC9 (50) /**< \brief Timer/Counter 9 (TC9) */ -#define ID_TC10 (51) /**< \brief Timer/Counter 10 (TC10) */ -#define ID_TC11 (52) /**< \brief Timer/Counter 11 (TC11) */ -#define ID_MLB (53) /**< \brief MediaLB (MLB) */ -#define ID_AES (56) /**< \brief AES (AES) */ -#define ID_TRNG (57) /**< \brief True Random Generator (TRNG) */ -#define ID_XDMAC (58) /**< \brief DMA (XDMAC) */ -#define ID_ISI (59) /**< \brief Camera Interface (ISI) */ -#define ID_PWM1 (60) /**< \brief Pulse Width Modulation 1 (PWM1) */ -#define ID_SDRAMC (62) /**< \brief SDRAM Controller (SDRAMC) */ -#define ID_RSWDT (63) /**< \brief Reinforced Secure Watchdog Timer (RSWDT) */ - -#define ID_PERIPH_COUNT (64) /**< \brief Number of peripheral IDs */ -/*@}*/ - -/* ************************************************************************** */ -/* BASE ADDRESS DEFINITIONS FOR SAMV71Q20 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71Q20_base Peripheral Base Address Definitions */ -/*@{*/ - -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -#define HSMCI (0x40000000U) /**< \brief (HSMCI ) Base Address */ -#define SSC (0x40004000U) /**< \brief (SSC ) Base Address */ -#define SPI0 (0x40008000U) /**< \brief (SPI0 ) Base Address */ -#define TC0 (0x4000C000U) /**< \brief (TC0 ) Base Address */ -#define TC1 (0x40010000U) /**< \brief (TC1 ) Base Address */ -#define TC2 (0x40014000U) /**< \brief (TC2 ) Base Address */ -#define TWIHS0 (0x40018000U) /**< \brief (TWIHS0) Base Address */ -#define TWIHS1 (0x4001C000U) /**< \brief (TWIHS1) Base Address */ -#define PWM0 (0x40020000U) /**< \brief (PWM0 ) Base Address */ -#define USART0 (0x40024000U) /**< \brief (USART0) Base Address */ -#define USART1 (0x40028000U) /**< \brief (USART1) Base Address */ -#define USART2 (0x4002C000U) /**< \brief (USART2) Base Address */ -#define MCAN0 (0x40030000U) /**< \brief (MCAN0 ) Base Address */ -#define MCAN1 (0x40034000U) /**< \brief (MCAN1 ) Base Address */ -#define USBHS (0x40038000U) /**< \brief (USBHS ) Base Address */ -#define AFEC0 (0x4003C000U) /**< \brief (AFEC0 ) Base Address */ -#define DACC (0x40040000U) /**< \brief (DACC ) Base Address */ -#define ACC (0x40044000U) /**< \brief (ACC ) Base Address */ -#define ICM (0x40048000U) /**< \brief (ICM ) Base Address */ -#define ISI (0x4004C000U) /**< \brief (ISI ) Base Address */ -#define GMAC (0x40050000U) /**< \brief (GMAC ) Base Address */ -#define TC3 (0x40054000U) /**< \brief (TC3 ) Base Address */ -#define SPI1 (0x40058000U) /**< \brief (SPI1 ) Base Address */ -#define PWM1 (0x4005C000U) /**< \brief (PWM1 ) Base Address */ -#define TWIHS2 (0x40060000U) /**< \brief (TWIHS2) Base Address */ -#define AFEC1 (0x40064000U) /**< \brief (AFEC1 ) Base Address */ -#define MLB (0x40068000U) /**< \brief (MLB ) Base Address */ -#define AES (0x4006C000U) /**< \brief (AES ) Base Address */ -#define TRNG (0x40070000U) /**< \brief (TRNG ) Base Address */ -#define XDMAC (0x40078000U) /**< \brief (XDMAC ) Base Address */ -#define QSPI (0x4007C000U) /**< \brief (QSPI ) Base Address */ -#define SMC (0x40080000U) /**< \brief (SMC ) Base Address */ -#define SDRAMC (0x40084000U) /**< \brief (SDRAMC) Base Address */ -#define MATRIX (0x40088000U) /**< \brief (MATRIX) Base Address */ -#define UTMI (0x400E0400U) /**< \brief (UTMI ) Base Address */ -#define PMC (0x400E0600U) /**< \brief (PMC ) Base Address */ -#define UART0 (0x400E0800U) /**< \brief (UART0 ) Base Address */ -#define CHIPID (0x400E0940U) /**< \brief (CHIPID) Base Address */ -#define UART1 (0x400E0A00U) /**< \brief (UART1 ) Base Address */ -#define EFC (0x400E0C00U) /**< \brief (EFC ) Base Address */ -#define PIOA (0x400E0E00U) /**< \brief (PIOA ) Base Address */ -#define PIOB (0x400E1000U) /**< \brief (PIOB ) Base Address */ -#define PIOC (0x400E1200U) /**< \brief (PIOC ) Base Address */ -#define PIOD (0x400E1400U) /**< \brief (PIOD ) Base Address */ -#define PIOE (0x400E1600U) /**< \brief (PIOE ) Base Address */ -#define RSTC (0x400E1800U) /**< \brief (RSTC ) Base Address */ -#define SUPC (0x400E1810U) /**< \brief (SUPC ) Base Address */ -#define RTT (0x400E1830U) /**< \brief (RTT ) Base Address */ -#define WDT (0x400E1850U) /**< \brief (WDT ) Base Address */ -#define RTC (0x400E1860U) /**< \brief (RTC ) Base Address */ -#define GPBR (0x400E1890U) /**< \brief (GPBR ) Base Address */ -#define RSWDT (0x400E1900U) /**< \brief (RSWDT ) Base Address */ -#define UART2 (0x400E1A00U) /**< \brief (UART2 ) Base Address */ -#define UART3 (0x400E1C00U) /**< \brief (UART3 ) Base Address */ -#define UART4 (0x400E1E00U) /**< \brief (UART4 ) Base Address */ -#else -#define HSMCI ((Hsmci *)0x40000000U) /**< \brief (HSMCI ) Base Address */ -#define SSC ((Ssc *)0x40004000U) /**< \brief (SSC ) Base Address */ -#define SPI0 ((Spi *)0x40008000U) /**< \brief (SPI0 ) Base Address */ -#define TC0 ((Tc *)0x4000C000U) /**< \brief (TC0 ) Base Address */ -#define TC1 ((Tc *)0x40010000U) /**< \brief (TC1 ) Base Address */ -#define TC2 ((Tc *)0x40014000U) /**< \brief (TC2 ) Base Address */ -#define TWIHS0 ((Twihs *)0x40018000U) /**< \brief (TWIHS0) Base Address */ -#define TWIHS1 ((Twihs *)0x4001C000U) /**< \brief (TWIHS1) Base Address */ -#define PWM0 ((Pwm *)0x40020000U) /**< \brief (PWM0 ) Base Address */ -#define USART0 ((Usart *)0x40024000U) /**< \brief (USART0) Base Address */ -#define USART1 ((Usart *)0x40028000U) /**< \brief (USART1) Base Address */ -#define USART2 ((Usart *)0x4002C000U) /**< \brief (USART2) Base Address */ -#define MCAN0 ((Mcan *)0x40030000U) /**< \brief (MCAN0 ) Base Address */ -#define MCAN1 ((Mcan *)0x40034000U) /**< \brief (MCAN1 ) Base Address */ -#define USBHS ((Usbhs *)0x40038000U) /**< \brief (USBHS ) Base Address */ -#define AFEC0 ((Afec *)0x4003C000U) /**< \brief (AFEC0 ) Base Address */ -#define DACC ((Dacc *)0x40040000U) /**< \brief (DACC ) Base Address */ -#define ACC ((Acc *)0x40044000U) /**< \brief (ACC ) Base Address */ -#define ICM ((Icm *)0x40048000U) /**< \brief (ICM ) Base Address */ -#define ISI ((Isi *)0x4004C000U) /**< \brief (ISI ) Base Address */ -#define GMAC ((Gmac *)0x40050000U) /**< \brief (GMAC ) Base Address */ -#define TC3 ((Tc *)0x40054000U) /**< \brief (TC3 ) Base Address */ -#define SPI1 ((Spi *)0x40058000U) /**< \brief (SPI1 ) Base Address */ -#define PWM1 ((Pwm *)0x4005C000U) /**< \brief (PWM1 ) Base Address */ -#define TWIHS2 ((Twihs *)0x40060000U) /**< \brief (TWIHS2) Base Address */ -#define AFEC1 ((Afec *)0x40064000U) /**< \brief (AFEC1 ) Base Address */ -#define MLB ((Mlb *)0x40068000U) /**< \brief (MLB ) Base Address */ -#define AES ((Aes *)0x4006C000U) /**< \brief (AES ) Base Address */ -#define TRNG ((Trng *)0x40070000U) /**< \brief (TRNG ) Base Address */ -#define XDMAC ((Xdmac *)0x40078000U) /**< \brief (XDMAC ) Base Address */ -#define QSPI ((Qspi *)0x4007C000U) /**< \brief (QSPI ) Base Address */ -#define SMC ((Smc *)0x40080000U) /**< \brief (SMC ) Base Address */ -#define SDRAMC ((Sdramc *)0x40084000U) /**< \brief (SDRAMC) Base Address */ -#define MATRIX ((Matrix *)0x40088000U) /**< \brief (MATRIX) Base Address */ -#define UTMI ((Utmi *)0x400E0400U) /**< \brief (UTMI ) Base Address */ -#define PMC ((Pmc *)0x400E0600U) /**< \brief (PMC ) Base Address */ -#define UART0 ((Uart *)0x400E0800U) /**< \brief (UART0 ) Base Address */ -#define CHIPID ((Chipid *)0x400E0940U) /**< \brief (CHIPID) Base Address */ -#define UART1 ((Uart *)0x400E0A00U) /**< \brief (UART1 ) Base Address */ -#define EFC ((Efc *)0x400E0C00U) /**< \brief (EFC ) Base Address */ -#define PIOA ((Pio *)0x400E0E00U) /**< \brief (PIOA ) Base Address */ -#define PIOB ((Pio *)0x400E1000U) /**< \brief (PIOB ) Base Address */ -#define PIOC ((Pio *)0x400E1200U) /**< \brief (PIOC ) Base Address */ -#define PIOD ((Pio *)0x400E1400U) /**< \brief (PIOD ) Base Address */ -#define PIOE ((Pio *)0x400E1600U) /**< \brief (PIOE ) Base Address */ -#define RSTC ((Rstc *)0x400E1800U) /**< \brief (RSTC ) Base Address */ -#define SUPC ((Supc *)0x400E1810U) /**< \brief (SUPC ) Base Address */ -#define RTT ((Rtt *)0x400E1830U) /**< \brief (RTT ) Base Address */ -#define WDT ((Wdt *)0x400E1850U) /**< \brief (WDT ) Base Address */ -#define RTC ((Rtc *)0x400E1860U) /**< \brief (RTC ) Base Address */ -#define GPBR ((Gpbr *)0x400E1890U) /**< \brief (GPBR ) Base Address */ -#define RSWDT ((Rswdt *)0x400E1900U) /**< \brief (RSWDT ) Base Address */ -#define UART2 ((Uart *)0x400E1A00U) /**< \brief (UART2 ) Base Address */ -#define UART3 ((Uart *)0x400E1C00U) /**< \brief (UART3 ) Base Address */ -#define UART4 ((Uart *)0x400E1E00U) /**< \brief (UART4 ) Base Address */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/*@}*/ - -/* ************************************************************************** */ -/* PIO DEFINITIONS FOR SAMV71Q20 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71Q20_pio Peripheral Pio Definitions */ -/*@{*/ - -#include "pio/pio_samv71q20.h" -/*@}*/ - -/* ************************************************************************** */ -/* MEMORY MAPPING DEFINITIONS FOR SAMV71Q20 */ -/* ************************************************************************** */ - -#define IFLASH_SIZE (0x100000u) -#define IFLASH_PAGE_SIZE (512u) -#define IFLASH_LOCK_REGION_SIZE (16384u) -#define IFLASH_NB_OF_PAGES (2048u) -#define IFLASH_NB_OF_LOCK_BITS (64u) -#define IRAM_SIZE (0x60000u) - -#define QSPIMEM_ADDR (0x80000000u) /**< QSPI Memory base address */ -#define AXIMX_ADDR (0xA0000000u) /**< AXI Bus Matrix base address */ -#define ITCM_ADDR (0x00000000u) /**< Instruction Tightly Coupled Memory base address */ -#define IFLASH_ADDR (0x00400000u) /**< Internal Flash base address */ -#define IROM_ADDR (0x00800000u) /**< Internal ROM base address */ -#define DTCM_ADDR (0x20000000u) /**< Data Tightly Coupled Memory base address */ -#define IRAM_ADDR (0x20400000u) /**< Internal RAM base address */ -#define EBI_CS0_ADDR (0x60000000u) /**< EBI Chip Select 0 base address */ -#define EBI_CS1_ADDR (0x61000000u) /**< EBI Chip Select 1 base address */ -#define EBI_CS2_ADDR (0x62000000u) /**< EBI Chip Select 2 base address */ -#define EBI_CS3_ADDR (0x63000000u) /**< EBI Chip Select 3 base address */ -#define SDRAM_CS_ADDR (0x70000000u) /**< SDRAM Chip Select base address */ - -/* ************************************************************************** */ -/* MISCELLANEOUS DEFINITIONS FOR SAMV71Q20 */ -/* ************************************************************************** */ - -#define CHIP_JTAGID (0x05B3D03FUL) -#define CHIP_CIDR (0xA1220C00UL) -#define CHIP_EXID (0x00000002UL) - -/* ************************************************************************** */ -/* ELECTRICAL DEFINITIONS FOR SAMV71Q20 */ -/* ************************************************************************** */ - -/* %ATMEL_ELECTRICAL% */ - -/* Device characteristics */ -#define CHIP_FREQ_SLCK_RC_MIN (20000UL) -#define CHIP_FREQ_SLCK_RC (32000UL) -#define CHIP_FREQ_SLCK_RC_MAX (44000UL) -#define CHIP_FREQ_MAINCK_RC_4MHZ (4000000UL) -#define CHIP_FREQ_MAINCK_RC_8MHZ (8000000UL) -#define CHIP_FREQ_MAINCK_RC_12MHZ (12000000UL) -#define CHIP_FREQ_CPU_MAX (300000000UL) -#define CHIP_FREQ_XTAL_32K (32768UL) -#define CHIP_FREQ_XTAL_12M (12000000UL) - -/* Embedded Flash Read Wait State (VDDCORE set at 1.20V) */ -#define CHIP_FREQ_FWS_0 (26000000UL) /**< \brief Maximum operating frequency when FWS is 0 */ -#define CHIP_FREQ_FWS_1 (52000000UL) /**< \brief Maximum operating frequency when FWS is 1 */ -#define CHIP_FREQ_FWS_2 (78000000UL) /**< \brief Maximum operating frequency when FWS is 2 */ -#define CHIP_FREQ_FWS_3 (104000000UL) /**< \brief Maximum operating frequency when FWS is 3 */ -#define CHIP_FREQ_FWS_4 (131000000UL) /**< \brief Maximum operating frequency when FWS is 4 */ -#define CHIP_FREQ_FWS_5 (150000000UL) /**< \brief Maximum operating frequency when FWS is 5 */ - -#ifdef __cplusplus -} -#endif - -/*@}*/ - -#endif /* _SAMV71Q20_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/samv71q21.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/samv71q21.h deleted file mode 100644 index 6450c241..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/samv71q21.h +++ /dev/null @@ -1,694 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef _SAMV71Q21_ -#define _SAMV71Q21_ - -/** \addtogroup SAMV71Q21_definitions SAMV71Q21 definitions - This file defines all structures and symbols for SAMV71Q21: - - registers and bit-fields - - peripheral base address - - peripheral ID - - PIO definitions -*/ -/*@{*/ - -#ifdef __cplusplus - extern "C" { -#endif - -#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -#include -#endif - -/* ************************************************************************** */ -/* CMSIS DEFINITIONS FOR SAMV71Q21 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71Q21_cmsis CMSIS Definitions */ -/*@{*/ - -/**< Interrupt Number Definition */ -typedef enum IRQn -{ -/****** Cortex-M7 Processor Exceptions Numbers ******************************/ - NonMaskableInt_IRQn = -14, /**< 2 Non Maskable Interrupt */ - HardFault_IRQn = -13, /**< 3 HardFault Interrupt */ - MemoryManagement_IRQn = -12, /**< 4 Cortex-M7 Memory Management Interrupt */ - BusFault_IRQn = -11, /**< 5 Cortex-M7 Bus Fault Interrupt */ - UsageFault_IRQn = -10, /**< 6 Cortex-M7 Usage Fault Interrupt */ - SVCall_IRQn = -5, /**< 11 Cortex-M7 SV Call Interrupt */ - DebugMonitor_IRQn = -4, /**< 12 Cortex-M7 Debug Monitor Interrupt */ - PendSV_IRQn = -2, /**< 14 Cortex-M7 Pend SV Interrupt */ - SysTick_IRQn = -1, /**< 15 Cortex-M7 System Tick Interrupt */ -/****** SAMV71Q21 specific Interrupt Numbers *********************************/ - - SUPC_IRQn = 0, /**< 0 SAMV71Q21 Supply Controller (SUPC) */ - RSTC_IRQn = 1, /**< 1 SAMV71Q21 Reset Controller (RSTC) */ - RTC_IRQn = 2, /**< 2 SAMV71Q21 Real Time Clock (RTC) */ - RTT_IRQn = 3, /**< 3 SAMV71Q21 Real Time Timer (RTT) */ - WDT_IRQn = 4, /**< 4 SAMV71Q21 Watchdog Timer (WDT) */ - PMC_IRQn = 5, /**< 5 SAMV71Q21 Power Management Controller (PMC) */ - EFC_IRQn = 6, /**< 6 SAMV71Q21 Enhanced Embedded Flash Controller (EFC) */ - UART0_IRQn = 7, /**< 7 SAMV71Q21 UART 0 (UART0) */ - UART1_IRQn = 8, /**< 8 SAMV71Q21 UART 1 (UART1) */ - PIOA_IRQn = 10, /**< 10 SAMV71Q21 Parallel I/O Controller A (PIOA) */ - PIOB_IRQn = 11, /**< 11 SAMV71Q21 Parallel I/O Controller B (PIOB) */ - PIOC_IRQn = 12, /**< 12 SAMV71Q21 Parallel I/O Controller C (PIOC) */ - USART0_IRQn = 13, /**< 13 SAMV71Q21 USART 0 (USART0) */ - USART1_IRQn = 14, /**< 14 SAMV71Q21 USART 1 (USART1) */ - USART2_IRQn = 15, /**< 15 SAMV71Q21 USART 2 (USART2) */ - PIOD_IRQn = 16, /**< 16 SAMV71Q21 Parallel I/O Controller D (PIOD) */ - PIOE_IRQn = 17, /**< 17 SAMV71Q21 Parallel I/O Controller E (PIOE) */ - HSMCI_IRQn = 18, /**< 18 SAMV71Q21 Multimedia Card Interface (HSMCI) */ - TWIHS0_IRQn = 19, /**< 19 SAMV71Q21 Two Wire Interface 0 HS (TWIHS0) */ - TWIHS1_IRQn = 20, /**< 20 SAMV71Q21 Two Wire Interface 1 HS (TWIHS1) */ - SPI0_IRQn = 21, /**< 21 SAMV71Q21 Serial Peripheral Interface 0 (SPI0) */ - SSC_IRQn = 22, /**< 22 SAMV71Q21 Synchronous Serial Controller (SSC) */ - TC0_IRQn = 23, /**< 23 SAMV71Q21 Timer/Counter 0 (TC0) */ - TC1_IRQn = 24, /**< 24 SAMV71Q21 Timer/Counter 1 (TC1) */ - TC2_IRQn = 25, /**< 25 SAMV71Q21 Timer/Counter 2 (TC2) */ - TC3_IRQn = 26, /**< 26 SAMV71Q21 Timer/Counter 3 (TC3) */ - TC4_IRQn = 27, /**< 27 SAMV71Q21 Timer/Counter 4 (TC4) */ - TC5_IRQn = 28, /**< 28 SAMV71Q21 Timer/Counter 5 (TC5) */ - AFEC0_IRQn = 29, /**< 29 SAMV71Q21 Analog Front End 0 (AFEC0) */ - DACC_IRQn = 30, /**< 30 SAMV71Q21 Digital To Analog Converter (DACC) */ - PWM0_IRQn = 31, /**< 31 SAMV71Q21 Pulse Width Modulation 0 (PWM0) */ - ICM_IRQn = 32, /**< 32 SAMV71Q21 Integrity Check Monitor (ICM) */ - ACC_IRQn = 33, /**< 33 SAMV71Q21 Analog Comparator (ACC) */ - USBHS_IRQn = 34, /**< 34 SAMV71Q21 USB Host / Device Controller (USBHS) */ - MCAN0_IRQn = 35, /**< 35 SAMV71Q21 MCAN Controller 0 (MCAN0) */ - MCAN0_LINE1_IRQn = 36, /**< 36 SAMV71Q21 MCAN Controller 0 LINE1 (MCAN0) */ - MCAN1_IRQn = 37, /**< 37 SAMV71Q21 MCAN Controller 1 (MCAN1) */ - MCAN1_LINE1_IRQn = 38, /**< 38 SAMV71Q21 MCAN Controller 1 LINE1 (MCAN1) */ - GMAC_IRQn = 39, /**< 39 SAMV71Q21 Ethernet MAC (GMAC) */ - AFEC1_IRQn = 40, /**< 40 SAMV71Q21 Analog Front End 1 (AFEC1) */ - TWIHS2_IRQn = 41, /**< 41 SAMV71Q21 Two Wire Interface 2 HS (TWIHS2) */ - SPI1_IRQn = 42, /**< 42 SAMV71Q21 Serial Peripheral Interface 1 (SPI1) */ - QSPI_IRQn = 43, /**< 43 SAMV71Q21 Quad I/O Serial Peripheral Interface (QSPI) */ - UART2_IRQn = 44, /**< 44 SAMV71Q21 UART 2 (UART2) */ - UART3_IRQn = 45, /**< 45 SAMV71Q21 UART 3 (UART3) */ - UART4_IRQn = 46, /**< 46 SAMV71Q21 UART 4 (UART4) */ - TC6_IRQn = 47, /**< 47 SAMV71Q21 Timer/Counter 6 (TC6) */ - TC7_IRQn = 48, /**< 48 SAMV71Q21 Timer/Counter 7 (TC7) */ - TC8_IRQn = 49, /**< 49 SAMV71Q21 Timer/Counter 8 (TC8) */ - TC9_IRQn = 50, /**< 50 SAMV71Q21 Timer/Counter 9 (TC9) */ - TC10_IRQn = 51, /**< 51 SAMV71Q21 Timer/Counter 10 (TC10) */ - TC11_IRQn = 52, /**< 52 SAMV71Q21 Timer/Counter 11 (TC11) */ - MLB_IRQn = 53, /**< 53 SAMV71Q21 MediaLB (MLB) */ - AES_IRQn = 56, /**< 56 SAMV71Q21 AES (AES) */ - TRNG_IRQn = 57, /**< 57 SAMV71Q21 True Random Generator (TRNG) */ - XDMAC_IRQn = 58, /**< 58 SAMV71Q21 DMA (XDMAC) */ - ISI_IRQn = 59, /**< 59 SAMV71Q21 Camera Interface (ISI) */ - PWM1_IRQn = 60, /**< 60 SAMV71Q21 Pulse Width Modulation 1 (PWM1) */ - SDRAMC_IRQn = 62, /**< 62 SAMV71Q21 SDRAM Controller (SDRAMC) */ - RSWDT_IRQn = 63, /**< 63 SAMV71Q21 Reinforced Secure Watchdog Timer (RSWDT) */ - - PERIPH_COUNT_IRQn = 64 /**< Number of peripheral IDs */ -} IRQn_Type; - -typedef struct _DeviceVectors -{ - /* Stack pointer */ - void* pvStack; - - /* Cortex-M handlers */ - void* pfnReset_Handler; - void* pfnNMI_Handler; - void* pfnHardFault_Handler; - void* pfnMemManage_Handler; - void* pfnBusFault_Handler; - void* pfnUsageFault_Handler; - void* pfnReserved1_Handler; - void* pfnReserved2_Handler; - void* pfnReserved3_Handler; - void* pfnReserved4_Handler; - void* pfnSVC_Handler; - void* pfnDebugMon_Handler; - void* pfnReserved5_Handler; - void* pfnPendSV_Handler; - void* pfnSysTick_Handler; - - /* Peripheral handlers */ - void* pfnSUPC_Handler; /* 0 Supply Controller */ - void* pfnRSTC_Handler; /* 1 Reset Controller */ - void* pfnRTC_Handler; /* 2 Real Time Clock */ - void* pfnRTT_Handler; /* 3 Real Time Timer */ - void* pfnWDT_Handler; /* 4 Watchdog Timer */ - void* pfnPMC_Handler; /* 5 Power Management Controller */ - void* pfnEFC_Handler; /* 6 Enhanced Embedded Flash Controller */ - void* pfnUART0_Handler; /* 7 UART 0 */ - void* pfnUART1_Handler; /* 8 UART 1 */ - void* pvReserved9; - void* pfnPIOA_Handler; /* 10 Parallel I/O Controller A */ - void* pfnPIOB_Handler; /* 11 Parallel I/O Controller B */ - void* pfnPIOC_Handler; /* 12 Parallel I/O Controller C */ - void* pfnUSART0_Handler; /* 13 USART 0 */ - void* pfnUSART1_Handler; /* 14 USART 1 */ - void* pfnUSART2_Handler; /* 15 USART 2 */ - void* pfnPIOD_Handler; /* 16 Parallel I/O Controller D */ - void* pfnPIOE_Handler; /* 17 Parallel I/O Controller E */ - void* pfnHSMCI_Handler; /* 18 Multimedia Card Interface */ - void* pfnTWIHS0_Handler; /* 19 Two Wire Interface 0 HS */ - void* pfnTWIHS1_Handler; /* 20 Two Wire Interface 1 HS */ - void* pfnSPI0_Handler; /* 21 Serial Peripheral Interface 0 */ - void* pfnSSC_Handler; /* 22 Synchronous Serial Controller */ - void* pfnTC0_Handler; /* 23 Timer/Counter 0 */ - void* pfnTC1_Handler; /* 24 Timer/Counter 1 */ - void* pfnTC2_Handler; /* 25 Timer/Counter 2 */ - void* pfnTC3_Handler; /* 26 Timer/Counter 3 */ - void* pfnTC4_Handler; /* 27 Timer/Counter 4 */ - void* pfnTC5_Handler; /* 28 Timer/Counter 5 */ - void* pfnAFEC0_Handler; /* 29 Analog Front End 0 */ - void* pfnDACC_Handler; /* 30 Digital To Analog Converter */ - void* pfnPWM0_Handler; /* 31 Pulse Width Modulation 0 */ - void* pfnICM_Handler; /* 32 Integrity Check Monitor */ - void* pfnACC_Handler; /* 33 Analog Comparator */ - void* pfnUSBHS_Handler; /* 34 USB Host / Device Controller */ - void* pfnMCAN0_Handler; /* 35 MCAN Controller 0 */ - void* pfnMCAN0_Line1_Handler; /* 36 MCAN Controller 0 */ - void* pfnMCAN1_Handler; /* 37 MCAN Controller 1 */ - void* pfnMCAN1_Line1_Handler; /* 38 MCAN Controller 1 */ - void* pfnGMAC_Handler; /* 39 Ethernet MAC */ - void* pfnAFEC1_Handler; /* 40 Analog Front End 1 */ - void* pfnTWIHS2_Handler; /* 41 Two Wire Interface 2 HS */ - void* pfnSPI1_Handler; /* 42 Serial Peripheral Interface 1 */ - void* pfnQSPI_Handler; /* 43 Quad I/O Serial Peripheral Interface */ - void* pfnUART2_Handler; /* 44 UART 2 */ - void* pfnUART3_Handler; /* 45 UART 3 */ - void* pfnUART4_Handler; /* 46 UART 4 */ - void* pfnTC6_Handler; /* 47 Timer/Counter 6 */ - void* pfnTC7_Handler; /* 48 Timer/Counter 7 */ - void* pfnTC8_Handler; /* 49 Timer/Counter 8 */ - void* pfnTC9_Handler; /* 50 Timer/Counter 9 */ - void* pfnTC10_Handler; /* 51 Timer/Counter 10 */ - void* pfnTC11_Handler; /* 52 Timer/Counter 11 */ - void* pfnMLB_Handler; /* 53 MediaLB */ - void* pvReserved54; - void* pvReserved55; - void* pfnAES_Handler; /* 56 AES */ - void* pfnTRNG_Handler; /* 57 True Random Generator */ - void* pfnXDMAC_Handler; /* 58 DMA */ - void* pfnISI_Handler; /* 59 Camera Interface */ - void* pfnPWM1_Handler; /* 60 Pulse Width Modulation 1 */ - void* pvReserved61; - void* pfnSDRAMC_Handler; /* 62 SDRAM Controller */ - void* pfnRSWDT_Handler; /* 63 Reinforced Secure Watchdog Timer */ -} DeviceVectors; - -/* Cortex-M7 core handlers */ -void Reset_Handler ( void ); -void NMI_Handler ( void ); -void HardFault_Handler ( void ); -void MemManage_Handler ( void ); -void BusFault_Handler ( void ); -void UsageFault_Handler ( void ); -void SVC_Handler ( void ); -void DebugMon_Handler ( void ); -void PendSV_Handler ( void ); -void SysTick_Handler ( void ); - -/* Peripherals handlers */ -void ACC_Handler ( void ); -void AES_Handler ( void ); -void AFEC0_Handler ( void ); -void AFEC1_Handler ( void ); -void DACC_Handler ( void ); -void EFC_Handler ( void ); -void GMAC_Handler ( void ); -void HSMCI_Handler ( void ); -void ICM_Handler ( void ); -void ISI_Handler ( void ); -void MCAN0_Handler ( void ); -void MCAN0_Line1_Handler ( void ); -void MCAN1_Handler ( void ); -void MCAN1_Line1_Handler ( void ); -void MLB_Handler ( void ); -void PIOA_Handler ( void ); -void PIOB_Handler ( void ); -void PIOC_Handler ( void ); -void PIOD_Handler ( void ); -void PIOE_Handler ( void ); -void PMC_Handler ( void ); -void PWM0_Handler ( void ); -void PWM1_Handler ( void ); -void QSPI_Handler ( void ); -void RSTC_Handler ( void ); -void RSWDT_Handler ( void ); -void RTC_Handler ( void ); -void RTT_Handler ( void ); -void SDRAMC_Handler ( void ); -void SPI0_Handler ( void ); -void SPI1_Handler ( void ); -void SSC_Handler ( void ); -void SUPC_Handler ( void ); -void TC0_Handler ( void ); -void TC1_Handler ( void ); -void TC2_Handler ( void ); -void TC3_Handler ( void ); -void TC4_Handler ( void ); -void TC5_Handler ( void ); -void TC6_Handler ( void ); -void TC7_Handler ( void ); -void TC8_Handler ( void ); -void TC9_Handler ( void ); -void TC10_Handler ( void ); -void TC11_Handler ( void ); -void TRNG_Handler ( void ); -void TWIHS0_Handler ( void ); -void TWIHS1_Handler ( void ); -void TWIHS2_Handler ( void ); -void UART0_Handler ( void ); -void UART1_Handler ( void ); -void UART2_Handler ( void ); -void UART3_Handler ( void ); -void UART4_Handler ( void ); -void USART0_Handler ( void ); -void USART1_Handler ( void ); -void USART2_Handler ( void ); -void USBHS_Handler ( void ); -void WDT_Handler ( void ); -void XDMAC_Handler ( void ); - -/** - * \brief Configuration of the Cortex-M7 Processor and Core Peripherals - */ - -#define __CM7_REV 0x0000 /**< SAMV71Q21 core revision number ([15:8] revision number, [7:0] patch number) */ -#define __MPU_PRESENT 1 /**< SAMV71Q21 does provide a MPU */ -#define __NVIC_PRIO_BITS 3 /**< SAMV71Q21 uses 3 Bits for the Priority Levels */ -#define __FPU_PRESENT 1 /**< SAMV71Q21 does provide a FPU */ -#define __FPU_DP 1 /**< SAMV71Q21 Double precision FPU */ -#define __ICACHE_PRESENT 1 /**< SAMV71Q21 does provide an Instruction Cache */ -#define __DCACHE_PRESENT 1 /**< SAMV71Q21 does provide a Data Cache */ -#define __DTCM_PRESENT 1 /**< SAMV71Q21 does provide a Data TCM */ -#define __ITCM_PRESENT 1 /**< SAMV71Q21 does provide an Instruction TCM */ -#define __Vendor_SysTickConfig 0 /**< Set to 1 if different SysTick Config is used */ - -/* - * \brief CMSIS includes - */ - -#include -#if !defined DONT_USE_CMSIS_INIT -#include "system_samv71.h" -#endif /* DONT_USE_CMSIS_INIT */ - -/*@}*/ - -/* ************************************************************************** */ -/** SOFTWARE PERIPHERAL API DEFINITION FOR SAMV71Q21 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71Q21_api Peripheral Software API */ -/*@{*/ - -#include "component/component_acc.h" -#include "component/component_aes.h" -#include "component/component_afec.h" -#include "component/component_chipid.h" -#include "component/component_dacc.h" -#include "component/component_efc.h" -#include "component/component_gmac.h" -#include "component/component_gpbr.h" -#include "component/component_hsmci.h" -#include "component/component_icm.h" -#include "component/component_isi.h" -#include "component/component_matrix.h" -#include "component/component_mcan.h" -#include "component/component_mlb.h" -#include "component/component_pio.h" -#include "component/component_pmc.h" -#include "component/component_pwm.h" -#include "component/component_qspi.h" -#include "component/component_rstc.h" -#include "component/component_rswdt.h" -#include "component/component_rtc.h" -#include "component/component_rtt.h" -#include "component/component_sdramc.h" -#include "component/component_smc.h" -#include "component/component_spi.h" -#include "component/component_ssc.h" -#include "component/component_supc.h" -#include "component/component_tc.h" -#include "component/component_trng.h" -#include "component/component_twihs.h" -#include "component/component_uart.h" -#include "component/component_usart.h" -#include "component/component_usbhs.h" -#include "component/component_utmi.h" -#include "component/component_wdt.h" -#include "component/component_xdmac.h" -/*@}*/ - -/* ************************************************************************** */ -/* REGISTER ACCESS DEFINITIONS FOR SAMV71Q21 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71Q21_reg Registers Access Definitions */ -/*@{*/ - -#include "instance/instance_hsmci.h" -#include "instance/instance_ssc.h" -#include "instance/instance_spi0.h" -#include "instance/instance_tc0.h" -#include "instance/instance_tc1.h" -#include "instance/instance_tc2.h" -#include "instance/instance_twihs0.h" -#include "instance/instance_twihs1.h" -#include "instance/instance_pwm0.h" -#include "instance/instance_usart0.h" -#include "instance/instance_usart1.h" -#include "instance/instance_usart2.h" -#include "instance/instance_mcan0.h" -#include "instance/instance_mcan1.h" -#include "instance/instance_usbhs.h" -#include "instance/instance_afec0.h" -#include "instance/instance_dacc.h" -#include "instance/instance_acc.h" -#include "instance/instance_icm.h" -#include "instance/instance_isi.h" -#include "instance/instance_gmac.h" -#include "instance/instance_tc3.h" -#include "instance/instance_spi1.h" -#include "instance/instance_pwm1.h" -#include "instance/instance_twihs2.h" -#include "instance/instance_afec1.h" -#include "instance/instance_mlb.h" -#include "instance/instance_aes.h" -#include "instance/instance_trng.h" -#include "instance/instance_xdmac.h" -#include "instance/instance_qspi.h" -#include "instance/instance_smc.h" -#include "instance/instance_sdramc.h" -#include "instance/instance_matrix.h" -#include "instance/instance_utmi.h" -#include "instance/instance_pmc.h" -#include "instance/instance_uart0.h" -#include "instance/instance_chipid.h" -#include "instance/instance_uart1.h" -#include "instance/instance_efc.h" -#include "instance/instance_pioa.h" -#include "instance/instance_piob.h" -#include "instance/instance_pioc.h" -#include "instance/instance_piod.h" -#include "instance/instance_pioe.h" -#include "instance/instance_rstc.h" -#include "instance/instance_supc.h" -#include "instance/instance_rtt.h" -#include "instance/instance_wdt.h" -#include "instance/instance_rtc.h" -#include "instance/instance_gpbr.h" -#include "instance/instance_rswdt.h" -#include "instance/instance_uart2.h" -#include "instance/instance_uart3.h" -#include "instance/instance_uart4.h" -/*@}*/ - -/* ************************************************************************** */ -/* PERIPHERAL ID DEFINITIONS FOR SAMV71Q21 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71Q21_id Peripheral Ids Definitions */ -/*@{*/ - -#define ID_SUPC ( 0) /**< \brief Supply Controller (SUPC) */ -#define ID_RSTC ( 1) /**< \brief Reset Controller (RSTC) */ -#define ID_RTC ( 2) /**< \brief Real Time Clock (RTC) */ -#define ID_RTT ( 3) /**< \brief Real Time Timer (RTT) */ -#define ID_WDT ( 4) /**< \brief Watchdog Timer (WDT) */ -#define ID_PMC ( 5) /**< \brief Power Management Controller (PMC) */ -#define ID_EFC ( 6) /**< \brief Enhanced Embedded Flash Controller (EFC) */ -#define ID_UART0 ( 7) /**< \brief UART 0 (UART0) */ -#define ID_UART1 ( 8) /**< \brief UART 1 (UART1) */ -#define ID_SMC ( 9) /**< \brief Static Memory Controller (SMC) */ -#define ID_PIOA (10) /**< \brief Parallel I/O Controller A (PIOA) */ -#define ID_PIOB (11) /**< \brief Parallel I/O Controller B (PIOB) */ -#define ID_PIOC (12) /**< \brief Parallel I/O Controller C (PIOC) */ -#define ID_USART0 (13) /**< \brief USART 0 (USART0) */ -#define ID_USART1 (14) /**< \brief USART 1 (USART1) */ -#define ID_USART2 (15) /**< \brief USART 2 (USART2) */ -#define ID_PIOD (16) /**< \brief Parallel I/O Controller D (PIOD) */ -#define ID_PIOE (17) /**< \brief Parallel I/O Controller E (PIOE) */ -#define ID_HSMCI (18) /**< \brief Multimedia Card Interface (HSMCI) */ -#define ID_TWIHS0 (19) /**< \brief Two Wire Interface 0 HS (TWIHS0) */ -#define ID_TWIHS1 (20) /**< \brief Two Wire Interface 1 HS (TWIHS1) */ -#define ID_SPI0 (21) /**< \brief Serial Peripheral Interface 0 (SPI0) */ -#define ID_SSC (22) /**< \brief Synchronous Serial Controller (SSC) */ -#define ID_TC0 (23) /**< \brief Timer/Counter 0 (TC0) */ -#define ID_TC1 (24) /**< \brief Timer/Counter 1 (TC1) */ -#define ID_TC2 (25) /**< \brief Timer/Counter 2 (TC2) */ -#define ID_TC3 (26) /**< \brief Timer/Counter 3 (TC3) */ -#define ID_TC4 (27) /**< \brief Timer/Counter 4 (TC4) */ -#define ID_TC5 (28) /**< \brief Timer/Counter 5 (TC5) */ -#define ID_AFEC0 (29) /**< \brief Analog Front End 0 (AFEC0) */ -#define ID_DACC (30) /**< \brief Digital To Analog Converter (DACC) */ -#define ID_PWM0 (31) /**< \brief Pulse Width Modulation 0 (PWM0) */ -#define ID_ICM (32) /**< \brief Integrity Check Monitor (ICM) */ -#define ID_ACC (33) /**< \brief Analog Comparator (ACC) */ -#define ID_USBHS (34) /**< \brief USB Host / Device Controller (USBHS) */ -#define ID_MCAN0 (35) /**< \brief MCAN Controller 0 (MCAN0) */ -#define ID_MCAN1 (37) /**< \brief MCAN Controller 1 (MCAN1) */ -#define ID_GMAC (39) /**< \brief Ethernet MAC (GMAC) */ -#define ID_AFEC1 (40) /**< \brief Analog Front End 1 (AFEC1) */ -#define ID_TWIHS2 (41) /**< \brief Two Wire Interface 2 HS (TWIHS2) */ -#define ID_SPI1 (42) /**< \brief Serial Peripheral Interface 1 (SPI1) */ -#define ID_QSPI (43) /**< \brief Quad I/O Serial Peripheral Interface (QSPI) */ -#define ID_UART2 (44) /**< \brief UART 2 (UART2) */ -#define ID_UART3 (45) /**< \brief UART 3 (UART3) */ -#define ID_UART4 (46) /**< \brief UART 4 (UART4) */ -#define ID_TC6 (47) /**< \brief Timer/Counter 6 (TC6) */ -#define ID_TC7 (48) /**< \brief Timer/Counter 7 (TC7) */ -#define ID_TC8 (49) /**< \brief Timer/Counter 8 (TC8) */ -#define ID_TC9 (50) /**< \brief Timer/Counter 9 (TC9) */ -#define ID_TC10 (51) /**< \brief Timer/Counter 10 (TC10) */ -#define ID_TC11 (52) /**< \brief Timer/Counter 11 (TC11) */ -#define ID_MLB (53) /**< \brief MediaLB (MLB) */ -#define ID_AES (56) /**< \brief AES (AES) */ -#define ID_TRNG (57) /**< \brief True Random Generator (TRNG) */ -#define ID_XDMAC (58) /**< \brief DMA (XDMAC) */ -#define ID_ISI (59) /**< \brief Camera Interface (ISI) */ -#define ID_PWM1 (60) /**< \brief Pulse Width Modulation 1 (PWM1) */ -#define ID_SDRAMC (62) /**< \brief SDRAM Controller (SDRAMC) */ -#define ID_RSWDT (63) /**< \brief Reinforced Secure Watchdog Timer (RSWDT) */ - -#define ID_PERIPH_COUNT (64) /**< \brief Number of peripheral IDs */ -/*@}*/ - -/* ************************************************************************** */ -/* BASE ADDRESS DEFINITIONS FOR SAMV71Q21 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71Q21_base Peripheral Base Address Definitions */ -/*@{*/ - -#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) -#define HSMCI (0x40000000U) /**< \brief (HSMCI ) Base Address */ -#define SSC (0x40004000U) /**< \brief (SSC ) Base Address */ -#define SPI0 (0x40008000U) /**< \brief (SPI0 ) Base Address */ -#define TC0 (0x4000C000U) /**< \brief (TC0 ) Base Address */ -#define TC1 (0x40010000U) /**< \brief (TC1 ) Base Address */ -#define TC2 (0x40014000U) /**< \brief (TC2 ) Base Address */ -#define TWIHS0 (0x40018000U) /**< \brief (TWIHS0) Base Address */ -#define TWIHS1 (0x4001C000U) /**< \brief (TWIHS1) Base Address */ -#define PWM0 (0x40020000U) /**< \brief (PWM0 ) Base Address */ -#define USART0 (0x40024000U) /**< \brief (USART0) Base Address */ -#define USART1 (0x40028000U) /**< \brief (USART1) Base Address */ -#define USART2 (0x4002C000U) /**< \brief (USART2) Base Address */ -#define MCAN0 (0x40030000U) /**< \brief (MCAN0 ) Base Address */ -#define MCAN1 (0x40034000U) /**< \brief (MCAN1 ) Base Address */ -#define USBHS (0x40038000U) /**< \brief (USBHS ) Base Address */ -#define AFEC0 (0x4003C000U) /**< \brief (AFEC0 ) Base Address */ -#define DACC (0x40040000U) /**< \brief (DACC ) Base Address */ -#define ACC (0x40044000U) /**< \brief (ACC ) Base Address */ -#define ICM (0x40048000U) /**< \brief (ICM ) Base Address */ -#define ISI (0x4004C000U) /**< \brief (ISI ) Base Address */ -#define GMAC (0x40050000U) /**< \brief (GMAC ) Base Address */ -#define TC3 (0x40054000U) /**< \brief (TC3 ) Base Address */ -#define SPI1 (0x40058000U) /**< \brief (SPI1 ) Base Address */ -#define PWM1 (0x4005C000U) /**< \brief (PWM1 ) Base Address */ -#define TWIHS2 (0x40060000U) /**< \brief (TWIHS2) Base Address */ -#define AFEC1 (0x40064000U) /**< \brief (AFEC1 ) Base Address */ -#define MLB (0x40068000U) /**< \brief (MLB ) Base Address */ -#define AES (0x4006C000U) /**< \brief (AES ) Base Address */ -#define TRNG (0x40070000U) /**< \brief (TRNG ) Base Address */ -#define XDMAC (0x40078000U) /**< \brief (XDMAC ) Base Address */ -#define QSPI (0x4007C000U) /**< \brief (QSPI ) Base Address */ -#define SMC (0x40080000U) /**< \brief (SMC ) Base Address */ -#define SDRAMC (0x40084000U) /**< \brief (SDRAMC) Base Address */ -#define MATRIX (0x40088000U) /**< \brief (MATRIX) Base Address */ -#define UTMI (0x400E0400U) /**< \brief (UTMI ) Base Address */ -#define PMC (0x400E0600U) /**< \brief (PMC ) Base Address */ -#define UART0 (0x400E0800U) /**< \brief (UART0 ) Base Address */ -#define CHIPID (0x400E0940U) /**< \brief (CHIPID) Base Address */ -#define UART1 (0x400E0A00U) /**< \brief (UART1 ) Base Address */ -#define EFC (0x400E0C00U) /**< \brief (EFC ) Base Address */ -#define PIOA (0x400E0E00U) /**< \brief (PIOA ) Base Address */ -#define PIOB (0x400E1000U) /**< \brief (PIOB ) Base Address */ -#define PIOC (0x400E1200U) /**< \brief (PIOC ) Base Address */ -#define PIOD (0x400E1400U) /**< \brief (PIOD ) Base Address */ -#define PIOE (0x400E1600U) /**< \brief (PIOE ) Base Address */ -#define RSTC (0x400E1800U) /**< \brief (RSTC ) Base Address */ -#define SUPC (0x400E1810U) /**< \brief (SUPC ) Base Address */ -#define RTT (0x400E1830U) /**< \brief (RTT ) Base Address */ -#define WDT (0x400E1850U) /**< \brief (WDT ) Base Address */ -#define RTC (0x400E1860U) /**< \brief (RTC ) Base Address */ -#define GPBR (0x400E1890U) /**< \brief (GPBR ) Base Address */ -#define RSWDT (0x400E1900U) /**< \brief (RSWDT ) Base Address */ -#define UART2 (0x400E1A00U) /**< \brief (UART2 ) Base Address */ -#define UART3 (0x400E1C00U) /**< \brief (UART3 ) Base Address */ -#define UART4 (0x400E1E00U) /**< \brief (UART4 ) Base Address */ -#else -#define HSMCI ((Hsmci *)0x40000000U) /**< \brief (HSMCI ) Base Address */ -#define SSC ((Ssc *)0x40004000U) /**< \brief (SSC ) Base Address */ -#define SPI0 ((Spi *)0x40008000U) /**< \brief (SPI0 ) Base Address */ -#define TC0 ((Tc *)0x4000C000U) /**< \brief (TC0 ) Base Address */ -#define TC1 ((Tc *)0x40010000U) /**< \brief (TC1 ) Base Address */ -#define TC2 ((Tc *)0x40014000U) /**< \brief (TC2 ) Base Address */ -#define TWIHS0 ((Twihs *)0x40018000U) /**< \brief (TWIHS0) Base Address */ -#define TWIHS1 ((Twihs *)0x4001C000U) /**< \brief (TWIHS1) Base Address */ -#define PWM0 ((Pwm *)0x40020000U) /**< \brief (PWM0 ) Base Address */ -#define USART0 ((Usart *)0x40024000U) /**< \brief (USART0) Base Address */ -#define USART1 ((Usart *)0x40028000U) /**< \brief (USART1) Base Address */ -#define USART2 ((Usart *)0x4002C000U) /**< \brief (USART2) Base Address */ -#define MCAN0 ((Mcan *)0x40030000U) /**< \brief (MCAN0 ) Base Address */ -#define MCAN1 ((Mcan *)0x40034000U) /**< \brief (MCAN1 ) Base Address */ -#define USBHS ((Usbhs *)0x40038000U) /**< \brief (USBHS ) Base Address */ -#define AFEC0 ((Afec *)0x4003C000U) /**< \brief (AFEC0 ) Base Address */ -#define DACC ((Dacc *)0x40040000U) /**< \brief (DACC ) Base Address */ -#define ACC ((Acc *)0x40044000U) /**< \brief (ACC ) Base Address */ -#define ICM ((Icm *)0x40048000U) /**< \brief (ICM ) Base Address */ -#define ISI ((Isi *)0x4004C000U) /**< \brief (ISI ) Base Address */ -#define GMAC ((Gmac *)0x40050000U) /**< \brief (GMAC ) Base Address */ -#define TC3 ((Tc *)0x40054000U) /**< \brief (TC3 ) Base Address */ -#define SPI1 ((Spi *)0x40058000U) /**< \brief (SPI1 ) Base Address */ -#define PWM1 ((Pwm *)0x4005C000U) /**< \brief (PWM1 ) Base Address */ -#define TWIHS2 ((Twihs *)0x40060000U) /**< \brief (TWIHS2) Base Address */ -#define AFEC1 ((Afec *)0x40064000U) /**< \brief (AFEC1 ) Base Address */ -#define MLB ((Mlb *)0x40068000U) /**< \brief (MLB ) Base Address */ -#define AES ((Aes *)0x4006C000U) /**< \brief (AES ) Base Address */ -#define TRNG ((Trng *)0x40070000U) /**< \brief (TRNG ) Base Address */ -#define XDMAC ((Xdmac *)0x40078000U) /**< \brief (XDMAC ) Base Address */ -#define QSPI ((Qspi *)0x4007C000U) /**< \brief (QSPI ) Base Address */ -#define SMC ((Smc *)0x40080000U) /**< \brief (SMC ) Base Address */ -#define SDRAMC ((Sdramc *)0x40084000U) /**< \brief (SDRAMC) Base Address */ -#define MATRIX ((Matrix *)0x40088000U) /**< \brief (MATRIX) Base Address */ -#define UTMI ((Utmi *)0x400E0400U) /**< \brief (UTMI ) Base Address */ -#define PMC ((Pmc *)0x400E0600U) /**< \brief (PMC ) Base Address */ -#define UART0 ((Uart *)0x400E0800U) /**< \brief (UART0 ) Base Address */ -#define CHIPID ((Chipid *)0x400E0940U) /**< \brief (CHIPID) Base Address */ -#define UART1 ((Uart *)0x400E0A00U) /**< \brief (UART1 ) Base Address */ -#define EFC ((Efc *)0x400E0C00U) /**< \brief (EFC ) Base Address */ -#define PIOA ((Pio *)0x400E0E00U) /**< \brief (PIOA ) Base Address */ -#define PIOB ((Pio *)0x400E1000U) /**< \brief (PIOB ) Base Address */ -#define PIOC ((Pio *)0x400E1200U) /**< \brief (PIOC ) Base Address */ -#define PIOD ((Pio *)0x400E1400U) /**< \brief (PIOD ) Base Address */ -#define PIOE ((Pio *)0x400E1600U) /**< \brief (PIOE ) Base Address */ -#define RSTC ((Rstc *)0x400E1800U) /**< \brief (RSTC ) Base Address */ -#define SUPC ((Supc *)0x400E1810U) /**< \brief (SUPC ) Base Address */ -#define RTT ((Rtt *)0x400E1830U) /**< \brief (RTT ) Base Address */ -#define WDT ((Wdt *)0x400E1850U) /**< \brief (WDT ) Base Address */ -#define RTC ((Rtc *)0x400E1860U) /**< \brief (RTC ) Base Address */ -#define GPBR ((Gpbr *)0x400E1890U) /**< \brief (GPBR ) Base Address */ -#define RSWDT ((Rswdt *)0x400E1900U) /**< \brief (RSWDT ) Base Address */ -#define UART2 ((Uart *)0x400E1A00U) /**< \brief (UART2 ) Base Address */ -#define UART3 ((Uart *)0x400E1C00U) /**< \brief (UART3 ) Base Address */ -#define UART4 ((Uart *)0x400E1E00U) /**< \brief (UART4 ) Base Address */ -#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ -/*@}*/ - -/* ************************************************************************** */ -/* PIO DEFINITIONS FOR SAMV71Q21 */ -/* ************************************************************************** */ -/** \addtogroup SAMV71Q21_pio Peripheral Pio Definitions */ -/*@{*/ - -#include "pio/pio_samv71q21.h" -/*@}*/ - -/* ************************************************************************** */ -/* MEMORY MAPPING DEFINITIONS FOR SAMV71Q21 */ -/* ************************************************************************** */ - -#define IFLASH_SIZE (0x200000u) -#define IFLASH_PAGE_SIZE (512u) -#define IFLASH_LOCK_REGION_SIZE (16384u) -#define IFLASH_NB_OF_PAGES (4096u) -#define IFLASH_NB_OF_LOCK_BITS (128u) -#define IRAM_SIZE (0x60000u) - -#define QSPIMEM_ADDR (0x80000000u) /**< QSPI Memory base address */ -#define AXIMX_ADDR (0xA0000000u) /**< AXI Bus Matrix base address */ -#define ITCM_ADDR (0x00000000u) /**< Instruction Tightly Coupled Memory base address */ -#define IFLASH_ADDR (0x00400000u) /**< Internal Flash base address */ -#define IROM_ADDR (0x00800000u) /**< Internal ROM base address */ -#define DTCM_ADDR (0x20000000u) /**< Data Tightly Coupled Memory base address */ -#define IRAM_ADDR (0x20400000u) /**< Internal RAM base address */ -#define EBI_CS0_ADDR (0x60000000u) /**< EBI Chip Select 0 base address */ -#define EBI_CS1_ADDR (0x61000000u) /**< EBI Chip Select 1 base address */ -#define EBI_CS2_ADDR (0x62000000u) /**< EBI Chip Select 2 base address */ -#define EBI_CS3_ADDR (0x63000000u) /**< EBI Chip Select 3 base address */ -#define SDRAM_CS_ADDR (0x70000000u) /**< SDRAM Chip Select base address */ -#define USBHS_RAM_ADDR (0xA0100000u)/**< USB RAM base address */ - -/* ************************************************************************** */ -/* MISCELLANEOUS DEFINITIONS FOR SAMV71Q21 */ -/* ************************************************************************** */ - -#define CHIP_JTAGID (0x05B3D03FUL) -#define CHIP_CIDR (0xA1220E00UL) -#define CHIP_EXID (0x00000002UL) - -/* ************************************************************************** */ -/* ELECTRICAL DEFINITIONS FOR SAMV71Q21 */ -/* ************************************************************************** */ - -/* %ATMEL_ELECTRICAL% */ - -/* Device characteristics */ -#define CHIP_FREQ_SLCK_RC_MIN (20000UL) -#define CHIP_FREQ_SLCK_RC (32000UL) -#define CHIP_FREQ_SLCK_RC_MAX (44000UL) -#define CHIP_FREQ_MAINCK_RC_4MHZ (4000000UL) -#define CHIP_FREQ_MAINCK_RC_8MHZ (8000000UL) -#define CHIP_FREQ_MAINCK_RC_12MHZ (12000000UL) -#define CHIP_FREQ_CPU_MAX (300000000UL) -#define CHIP_FREQ_XTAL_32K (32768UL) -#define CHIP_FREQ_XTAL_12M (12000000UL) - -/* Embedded Flash Read Wait State (VDDCORE set at 1.20V) */ -#define CHIP_FREQ_FWS_0 (26000000UL) /**< \brief Maximum operating frequency when FWS is 0 */ -#define CHIP_FREQ_FWS_1 (52000000UL) /**< \brief Maximum operating frequency when FWS is 1 */ -#define CHIP_FREQ_FWS_2 (78000000UL) /**< \brief Maximum operating frequency when FWS is 2 */ -#define CHIP_FREQ_FWS_3 (104000000UL) /**< \brief Maximum operating frequency when FWS is 3 */ -#define CHIP_FREQ_FWS_4 (131000000UL) /**< \brief Maximum operating frequency when FWS is 4 */ -#define CHIP_FREQ_FWS_5 (150000000UL) /**< \brief Maximum operating frequency when FWS is 5 */ - -#ifdef __cplusplus -} -#endif - -/*@}*/ - -#endif /* _SAMV71Q21_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/system_samv71.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/system_samv71.h deleted file mode 100644 index 09092957..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/samv7/system_samv71.h +++ /dev/null @@ -1,73 +0,0 @@ -/* ---------------------------------------------------------------------------- */ -/* Atmel Microcontroller Software Support */ -/* SAM Software Package License */ -/* ---------------------------------------------------------------------------- */ -/* Copyright (c) 2014, Atmel Corporation */ -/* */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or without */ -/* modification, are permitted provided that the following condition is met: */ -/* */ -/* - Redistributions of source code must retain the above copyright notice, */ -/* this list of conditions and the disclaimer below. */ -/* */ -/* Atmel's name may not be used to endorse or promote products derived from */ -/* this software without specific prior written permission. */ -/* */ -/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ -/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ -/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ -/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ -/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ -/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ -/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ---------------------------------------------------------------------------- */ - -#ifndef SYSTEM_SAMV71_H_INCLUDED -#define SYSTEM_SAMV71_H_INCLUDED - -/* @cond 0 */ -/**INDENT-OFF**/ -#ifdef __cplusplus -extern "C" { -#endif -/**INDENT-ON**/ -/* @endcond */ - -#include - -extern uint32_t SystemCoreClock; /* System Clock Frequency (Core Clock) */ - -/** - * @brief Setup the microcontroller system. - * Initialize the System and update the SystemCoreClock variable. - */ -void SystemInit(void); - -/** - * @brief Updates the SystemCoreClock with current core Clock - * retrieved from cpu registers. - */ -void SystemCoreClockUpdate(void); - -/** - * Initialize flash. - */ -void system_init_flash(uint32_t dw_clk); - -void sysclk_enable_usb(void); -void sysclk_disable_usb(void); - -/* @cond 0 */ -/**INDENT-OFF**/ -#ifdef __cplusplus -} -#endif -/**INDENT-ON**/ -/* @endcond */ - -#endif /* SYSTEM_SAMV71_H_INCLUDED */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/sdramc.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/sdramc.h deleted file mode 100644 index 0ffb9cd2..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/sdramc.h +++ /dev/null @@ -1,70 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * Definitions and function prototype for SDRAMC. - */ - -// --------------------------------------------------------------------------- -// SDRAM -// --------------------------------------------------------------------------- -/** SDRAMC Configuration */ -#define EBI_SDRAMC_ADDR (0x70000000u) - -/** SDRAM bus width */ -#define BOARD_SDRAM_BUSWIDTH 16 - - -typedef struct _SSdramc_config -{ - uint32_t dwColumnBits ; // Number of Column Bits - uint32_t dwRowBits ; // Number of Row Bits - uint32_t dwBanks ; // Number of Banks - uint32_t dwCAS ; // CAS Latency - uint32_t dwDataBusWidth ; // Data Bus Width - uint32_t dwWriteRecoveryDelay ; // Write Recovery Delay - uint32_t dwRowCycleDelay_RowRefreshCycle ; // Row Cycle Delay and Row Refresh Cycle - uint32_t dwRowPrechargeDelay ; // Row Precharge Delay - uint32_t dwRowColumnDelay ; // Row to Column Delay - uint32_t dwActivePrechargeDelay ; // Active to Precharge Delay - uint32_t dwExitSelfRefreshActiveDelay ; // Exit Self Refresh to Active Delay - uint32_t dwBK1 ; // bk1 addr - -} SSdramc_config ; - -typedef struct _SSdramc_Memory -{ - SSdramc_config cfg ; - -} SSdramc_Memory ; - -extern void SDRAMC_Configure( SSdramc_Memory* pMemory, - uint32_t dwClockFrequency ) ; diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/smc.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/smc.h deleted file mode 100644 index 4bd303b8..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/smc.h +++ /dev/null @@ -1,174 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** -* \file -* -* Definitions and function prototype for SMC module -*/ - -#ifndef _SMC_ -#define _SMC_ - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ -#include "chip.h" - -/*---------------------------------------------------------------------------- - * Types - *----------------------------------------------------------------------------*/ -typedef union _SmcStatus { - uint8_t BStatus; - struct _SmcStatusBits { - uint8_t smcSts:1, /**< NAND Flash Controller Status */ - xfrDone:1, /**< NFC Data Transfer Terminated */ - cmdDone:1, /**< Command Done */ - rbEdge: 1, /**< Ready/Busy Line 3 Edge Detected*/ - hammingReady:1; /**< Hamming ecc ready */ - } bStatus; -} SmcStatus; - -/*---------------------------------------------------------------------------- - * Definitions - *----------------------------------------------------------------------------*/ -/* - * NFC definitions - */ - -/** Base address of NFC SRAM */ -#define NFC_SRAM_BASE_ADDRESS 0x200000 -/** Base address for NFC Address Command */ -#define NFC_CMD_BASE_ADDR 0x70000000 - - -/* -------- NFCADDR_CMD : NFC Address Command -------- */ -#define NFCADDR_CMD_CMD1 (0xFFu << 2) -/* Command Register Value for Cycle 1 */ -#define NFCADDR_CMD_CMD2 (0xFFu << 10) -/* Command Register Value for Cycle 2 */ -#define NFCADDR_CMD_VCMD2 (0x1u << 18) -/* Valid Cycle 2 Command */ -#define NFCADDR_CMD_ACYCLE (0x7u << 19) -/* Number of Address required for the current command */ -#define NFCADDR_CMD_ACYCLE_NONE (0x0u << 19) -/* No address cycle */ -#define NFCADDR_CMD_ACYCLE_ONE (0x1u << 19) -/* One address cycle */ -#define NFCADDR_CMD_ACYCLE_TWO (0x2u << 19) -/* Two address cycles */ -#define NFCADDR_CMD_ACYCLE_THREE (0x3u << 19) -/* Three address cycles */ -#define NFCADDR_CMD_ACYCLE_FOUR (0x4u << 19) -/* Four address cycles */ -#define NFCADDR_CMD_ACYCLE_FIVE (0x5u << 19) -/* Five address cycles */ -#define NFCADDR_CMD_CSID (0x7u << 22) -/* Chip Select Identifier */ -#define NFCADDR_CMD_CSID_0 (0x0u << 22) -/* CS0 */ -#define NFCADDR_CMD_CSID_1 (0x1u << 22) -/* CS1 */ -#define NFCADDR_CMD_CSID_2 (0x2u << 22) -/* CS2 */ -#define NFCADDR_CMD_CSID_3 (0x3u << 22) -/* CS3 */ -#define NFCADDR_CMD_CSID_4 (0x4u << 22) -/* CS4 */ -#define NFCADDR_CMD_CSID_5 (0x5u << 22) -/* CS5 */ -#define NFCADDR_CMD_CSID_6 (0x6u << 22) -/* CS6 */ -#define NFCADDR_CMD_CSID_7 (0x7u << 22) -/* CS7 */ -#define NFCADDR_CMD_DATAEN (0x1u << 25) -/* NFC Data Enable */ -#define NFCADDR_CMD_DATADIS (0x0u << 25) -/* NFC Data disable */ -#define NFCADDR_CMD_NFCRD (0x0u << 26) -/* NFC Read Enable */ -#define NFCADDR_CMD_NFCWR (0x1u << 26) -/* NFC Write Enable */ -#define NFCADDR_CMD_NFCCMD (0x1u << 27) -/* NFC Command Enable */ - -/* - * ECC definitions (Hsiao Code Errors) - */ - -/** A single bit was incorrect but has been recovered. */ -#define Hsiao_ERROR_SINGLEBIT 1 - -/** The original code has been corrupted. */ -#define Hsiao_ERROR_ECC 2 - -/** Multiple bits are incorrect in the data and they cannot be corrected. */ -#define Hsiao_ERROR_MULTIPLEBITS 3 - -/*---------------------------------------------------------------------------- - * Exported functions - *----------------------------------------------------------------------------*/ - -/* - * NFC functions - */ - -extern void SMC_NFC_Configure(uint32_t mode); -extern void SMC_NFC_Reset(void); -extern void SMC_NFC_EnableNfc(void); -extern void SMC_NFC_EnableSpareRead(void); -extern void SMC_NFC_DisableSpareRead(void); -extern void SMC_NFC_EnableSpareWrite(void); -extern void SMC_NFC_DisableSpareWrite(void); -extern uint8_t SMC_NFC_isSpareRead(void); -extern uint8_t SMC_NFC_isSpareWrite(void); -extern uint8_t SMC_NFC_isTransferComplete(void); -extern uint8_t SMC_NFC_isReadyBusy(void); -extern uint8_t SMC_NFC_isNfcBusy(void); -extern uint32_t SMC_NFC_GetStatus(void); - -extern void SMC_NFC_SendCommand(uint32_t cmd, uint32_t addressCycle, - uint32_t cycle0); -extern void SMC_NFC_Wait_CommandDone(void); -extern void SMC_NFC_Wait_XfrDone(void); -extern void SMC_NFC_Wait_RBbusy(void); -extern void SMC_NFC_Wait_HammingReady(void); - -extern void SMC_ECC_Configure(uint32_t type, uint32_t pageSize); -extern uint32_t SMC_ECC_GetCorrectoinType(void); -extern uint8_t SMC_ECC_GetStatus(uint8_t eccNumber); - -extern void SMC_ECC_GetValue(uint32_t *ecc); -extern void SMC_ECC_GetEccParity(uint32_t pageDataSize, uint8_t *code, - uint8_t busWidth); -extern uint8_t SMC_ECC_VerifyHsiao(uint8_t *data, uint32_t size, - const uint8_t *originalCode, const uint8_t *verifyCode, uint8_t busWidth); - -#endif /* #ifndef _SMC_ */ - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/spi.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/spi.h deleted file mode 100644 index 2063c150..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/spi.h +++ /dev/null @@ -1,114 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * Interface for Serial Peripheral Interface (SPI) controller. - * - */ - -#ifndef _SPI_ -#define _SPI_ - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ - -#include "chip.h" - -/*---------------------------------------------------------------------------- - * Macros - *----------------------------------------------------------------------------*/ - -/** - * - * Here are several macros which should be used when configuring a SPI - * peripheral. - * - * \section spi_configuration_macros SPI Configuration Macros - * - \ref SPI_PCS - * - \ref SPI_SCBR - * - \ref SPI_DLYBS - * - \ref SPI_DLYBCT - */ - -/** Calculate the PCS field value given the chip select NPCS value */ -#define SPI_PCS(npcs) SPI_MR_PCS((~(1 << npcs) & 0xF)) - -/** Calculates the value of the CSR SCBR field given the baudrate and MCK. */ -#define SPI_SCBR(baudrate, masterClock) \ - SPI_CSR_SCBR((uint32_t)(masterClock / baudrate)) - -/** Calculates the value of the CSR DLYBS field given the desired delay (in ns) */ -#define SPI_DLYBS(delay, masterClock) \ - SPI_CSR_DLYBS((uint32_t) (((masterClock / 1000000) * delay) / 1000)+1) - -/** Calculates the value of the CSR DLYBCT field given the desired delay (in ns) */ -#define SPI_DLYBCT(delay, masterClock) \ - SPI_CSR_DLYBCT ((uint32_t) (((masterClock / 1000000) * delay) / 32000)+1) - -/*------------------------------------------------------------------------------ */ - -#ifdef __cplusplus - extern "C" { -#endif - -/*---------------------------------------------------------------------------- - * Exported functions - *----------------------------------------------------------------------------*/ - -extern void SPI_Enable( Spi* spi ) ; -extern void SPI_Disable( Spi* spi ) ; - -extern void SPI_EnableIt( Spi* spi, uint32_t dwSources ) ; -extern void SPI_DisableIt( Spi* spi, uint32_t dwSources ) ; - -extern void SPI_Configure( Spi* spi, uint32_t dwId, uint32_t dwConfiguration ) ; -extern void SPI_SetMode( Spi* spi, uint32_t dwConfiguration ); - -extern void SPI_ChipSelect( Spi* spi, uint8_t cS); -extern void SPI_ReleaseCS( Spi* spi ); - -extern void SPI_ConfigureNPCS( Spi* spi, uint32_t dwNpcs, uint32_t dwConfiguration ) ; -extern void SPI_ConfigureCSMode( Spi* spi, uint32_t dwNpcs, uint32_t bReleaseOnLast ); - -extern uint32_t SPI_Read( Spi* spi ) ; -extern void SPI_Write( Spi* spi, uint32_t dwNpcs, uint16_t wData ) ; -extern void SPI_WriteLast( Spi* spi, uint32_t dwNpcs, uint16_t wData ); - -extern uint32_t SPI_GetStatus( Spi* spi ) ; -extern uint32_t SPI_IsFinished( Spi* pSpi ) ; - -#ifdef __cplusplus -} -#endif - -#endif /* #ifndef _SPI_ */ - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/spi_dma.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/spi_dma.h deleted file mode 100644 index d9d8754d..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/spi_dma.h +++ /dev/null @@ -1,148 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * Implementation of SPI driver, transfer data through DMA. - * - */ - -#ifndef _SPI_DMA_ -#define _SPI_DMA_ - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ - -#include "chip.h" - -/*---------------------------------------------------------------------------- - * Definitions - *----------------------------------------------------------------------------*/ - -/** An unspecified error has occurred.*/ -#define SPID_ERROR 1 - -/** SPI driver is currently in use.*/ -#define SPID_ERROR_LOCK 2 - -/*---------------------------------------------------------------------------- - * Macros - *----------------------------------------------------------------------------*/ - -/** Calculates the value of the SCBR field of the Chip Select Register - given MCK and SPCK.*/ -#define SPID_CSR_SCBR(mck, spck) SPI_CSR_SCBR((mck) / (spck)) - -/** Calculates the value of the DLYBS field of the Chip Select Register - given delay in ns and MCK.*/ -#define SPID_CSR_DLYBS(mck, delay) SPI_CSR_DLYBS((((delay) * \ - ((mck) / 1000000)) / 1000) + 1) - -/** Calculates the value of the DLYBCT field of the Chip Select Register - given delay in ns and MCK.*/ -#define SPID_CSR_DLYBCT(mck, delay) SPI_CSR_DLYBCT((((delay) / 32 * \ - ((mck) / 1000000)) / 1000) + 1) - -#ifdef __cplusplus - extern "C" { -#endif - -/*---------------------------------------------------------------------------- - * Types - *----------------------------------------------------------------------------*/ - -/** SPI transfer complete callback. */ -typedef void (*SpidCallback)( uint8_t, void* ) ; - -/** \brief Spi Transfer Request prepared by the application upper layer. - * - * This structure is sent to the SPI_SendCommand function to start the transfer. - * At the end of the transfer, the callback is invoked by the interrupt handler. - */ -typedef struct _SpidCmd -{ - /** Pointer to the Tx data. */ - uint8_t *pTxBuff; - /** Tx size in bytes. */ - uint8_t TxSize; - /** Pointer to the Rx data. */ - uint8_t *pRxBuff; - /** Rx size in bytes. */ - uint16_t RxSize; - /** SPI chip select. */ - uint8_t spiCs; - /** Callback function invoked at the end of transfer. */ - SpidCallback callback; - /** Callback arguments. */ - void *pArgument; -} SpidCmd ; - -/** Constant structure associated with SPI port. This structure prevents - client applications to have access in the same time. */ -typedef struct _Spid -{ - /** Pointer to SPI Hardware registers */ - Spi* pSpiHw ; - /** Current SpiCommand being processed */ - SpidCmd *pCurrentCommand ; - /** Pointer to DMA driver */ - sXdmad* pXdmad; - /** SPI Id as defined in the product datasheet */ - uint8_t spiId ; - /** Mutual exclusion semaphore. */ - volatile int8_t semaphore ; -} Spid ; - -/*---------------------------------------------------------------------------- - * Exported functions - *----------------------------------------------------------------------------*/ - -extern uint32_t SPID_Configure( Spid* pSpid, - Spi* pSpiHw, - uint8_t spiId, - uint32_t SpiMode, - sXdmad* pXdmad ) ; - -extern void SPID_ConfigureCS( Spid* pSpid, uint32_t dwCS, uint32_t dwCsr ) ; - -extern uint32_t SPID_SendCommand( Spid* pSpid, SpidCmd* pCommand ) ; - -extern void SPID_Handler( Spid* pSpid ) ; - -extern void SPID_DmaHandler( Spid *pSpid ); - -extern uint32_t SPID_IsBusy( const Spid* pSpid ) ; - -#ifdef __cplusplus -} -#endif - -#endif /* #ifndef _SPI_DMA_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/ssc.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/ssc.h deleted file mode 100644 index 8fbaf67e..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/ssc.h +++ /dev/null @@ -1,72 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * Interface for Synchronous Serial (SSC) controller. - * - */ - -#ifndef _SSC_ -#define _SSC_ - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ -#include "chip.h" - -#include - -#ifdef __cplusplus - extern "C" { -#endif - -/*---------------------------------------------------------------------------- - * Exported functions - *----------------------------------------------------------------------------*/ -extern void SSC_Configure(Ssc *ssc, uint32_t bitRate, uint32_t masterClock); -extern void SSC_ConfigureTransmitter(Ssc *ssc, uint32_t tcmr, uint32_t tfmr); -extern void SSC_ConfigureReceiver(Ssc *ssc, uint32_t rcmr, uint32_t rfmr); -extern void SSC_EnableTransmitter(Ssc *ssc); -extern void SSC_DisableTransmitter(Ssc *ssc); -extern void SSC_EnableReceiver(Ssc *ssc); -extern void SSC_DisableReceiver(Ssc *ssc ); -extern void SSC_EnableInterrupts(Ssc *ssc, uint32_t sources); -extern void SSC_DisableInterrupts(Ssc *ssc, uint32_t sources); -extern void SSC_Write(Ssc *ssc, uint32_t frame); -extern uint32_t SSC_Read(Ssc *ssc ); -extern uint8_t SSC_IsRxReady(Ssc *ssc); - -#ifdef __cplusplus -} -#endif - -#endif /* #ifndef _SSC_ */ - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/supc.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/supc.h deleted file mode 100644 index 85133033..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/supc.h +++ /dev/null @@ -1,75 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2012, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -#ifndef _SUPC_H_ -#define _SUPC_H_ - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ -#include - - -/*---------------------------------------------------------------------------- - * Definitions - *----------------------------------------------------------------------------*/ - - - -/*---------------------------------------------------------------------------- - * Exported functions - *----------------------------------------------------------------------------*/ - -#ifdef __cplusplus - extern "C" { -#endif - - - -void SUPC_SelectExtCrystal32K(void); -uint8_t SUPC_IsSlowClkExtCrystal32K(void); -uint8_t SUPC_Read_Status(uint32_t status); -void SUPC_DisableSupplyMonitor(void); -void SUPC_DisableVoltageReg(void); -void SUPC_ConfigSupplyMonitor(uint32_t Config); -void SUPC_BrownoutDetectEnable(uint8_t enable); -void SUPC_BrownoutResetEnable(void); -void SUPC_SramBackupMode(uint8_t enable); -void SUPC_BypassXtal32KOsc(void); -void SUPC_EnablesWakeupInput(uint32_t Input, uint8_t enable); -void SUPC_SetLowPowerDebounce(uint8_t period); -void SUPC_SetWakeupDebounce(uint8_t period); -void SUPC_EnablesWakeupMode(uint32_t Regs, uint8_t enable); - -#ifdef __cplusplus -} -#endif - -#endif /* #ifndef _PMC_ */ - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/tc.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/tc.h deleted file mode 100644 index 714f4d2c..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/tc.h +++ /dev/null @@ -1,77 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * \section Purpose - * - * Interface for configuring and using Timer Counter (TC) peripherals. - * - * \section Usage - * -# Optionally, use TC_FindMckDivisor() to let the program find the best - * TCCLKS field value automatically. - * -# Configure a Timer Counter in the desired mode using TC_Configure(). - * -# Start or stop the timer clock using TC_Start() and TC_Stop(). - */ - -#ifndef _TC_ -#define _TC_ - -/*------------------------------------------------------------------------------ - * Headers - *----------------------------------------------------------------------------*/ - -#include "chip.h" - -#include - -/*------------------------------------------------------------------------------ - * Global functions - *----------------------------------------------------------------------------*/ - -#ifdef __cplusplus - extern "C" { -#endif - -extern void TC_Configure( Tc *pTc, uint32_t dwChannel, uint32_t dwMode ) ; - -extern void TC_Start( Tc *pTc, uint32_t dwChannel ) ; - -extern void TC_Stop( Tc *pTc, uint32_t dwChannel ) ; - -extern uint32_t TC_FindMckDivisor( uint32_t dwFreq, uint32_t dwMCk, - uint32_t *dwDiv, uint32_t *dwTcClks, uint32_t dwBoardMCK ) ; - -#ifdef __cplusplus -} -#endif - -#endif /* #ifndef _TC_ */ - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/timetick.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/timetick.h deleted file mode 100644 index 7893a719..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/timetick.h +++ /dev/null @@ -1,103 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * \par Purpose - * - * Methods and definitions for Global time tick and wait functions. - * - * Defines a common and simplest use of Time Tick, to increase tickCount - * every 1ms, the application can get this value through GetTickCount(). - * - * \par Usage - * - * -# Configure the System Tick with TimeTick_Configure() when MCK changed - * \note - * Must be done before any invoke of GetTickCount(), Wait() or Sleep(). - * -# Uses GetTickCount to get current tick value. - * -# Uses Wait to wait several ms. - * -# Uses Sleep to enter wait for interrupt mode to wait several ms. - * - */ - -#ifndef _TIMETICK_ -#define _TIMETICK_ - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ - -#include - -/*---------------------------------------------------------------------------- - * Definitions - *----------------------------------------------------------------------------*/ - -typedef struct -{ - volatile uint32_t *pTimer1; - volatile uint32_t *pTimer2; - volatile uint32_t *pTimer3; - volatile uint32_t *pTimer4; -}SyTickDelayCounter_t; - -/*---------------------------------------------------------------------------- - * Definitions - *----------------------------------------------------------------------------*/ -typedef struct _TimeEvent -{ - uint32_t event; - uint32_t time_tick; - uint32_t time_start; - uint32_t occur; - struct _TimeEvent *pPreEvent; - struct _TimeEvent *pNextEvent; -}TimeEvent; - -/*---------------------------------------------------------------------------- - * Global functions - *----------------------------------------------------------------------------*/ - -uint32_t TimeTick_Configure( void ) ; - -void TimeTick_Increment( uint32_t dwInc ) ; - -uint32_t GetDelayInTicks(uint32_t startTick,uint32_t endTick); - -uint32_t GetTicks(void); - -void Wait( volatile uint32_t dwMs ) ; - -void Sleep( volatile uint32_t dwMs ) ; - -extern void SetTimeEvent(TimeEvent* pEvent); - -#endif /* _TIMETICK_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/trace.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/trace.h deleted file mode 100644 index 9d765d57..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/trace.h +++ /dev/null @@ -1,230 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2012, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * \par Purpose - * - * Standard output methods for reporting debug information, warnings and - * errors, which can be easily be turned on/off. - * - * \par Usage - * -# Initialize the DBGU using TRACE_CONFIGURE() if you intend to eventually - * disable ALL traces; otherwise use DBGU_Configure(). - * -# Uses the TRACE_DEBUG(), TRACE_INFO(), TRACE_WARNING(), TRACE_ERROR() - * TRACE_FATAL() macros to output traces throughout the program. - * -# Each type of trace has a level : Debug 5, Info 4, Warning 3, Error 2 - * and Fatal 1. Disable a group of traces by changing the value of - * TRACE_LEVEL during compilation; traces with a level bigger than TRACE_LEVEL - * are not generated. To generate no trace, use the reserved value 0. - * -# Trace disabling can be static or dynamic. If dynamic disabling is selected - * the trace level can be modified in runtime. If static disabling is selected - * the disabled traces are not compiled. - * - * \par traceLevels Trace level description - * -# TRACE_DEBUG (5): Traces whose only purpose is for debugging the program, - * and which do not produce meaningful information otherwise. - * -# TRACE_INFO (4): Informational trace about the program execution. Should - * enable the user to see the execution flow. - * -# TRACE_WARNING (3): Indicates that a minor error has happened. In most case - * it can be discarded safely; it may even be expected. - * -# TRACE_ERROR (2): Indicates an error which may not stop the program execution, - * but which indicates there is a problem with the code. - * -# TRACE_FATAL (1): Indicates a major error which prevents the program from going - * any further. - */ - -#ifndef _TRACE_ -#define _TRACE_ - -/* - * Headers - */ - -#include "pio.h" - -#include - -/* - * Global Definitions - */ - -/** Softpack Version */ -#define SOFTPACK_VERSION "1.4" - -#define TRACE_LEVEL_DEBUG 5 -#define TRACE_LEVEL_INFO 4 -#define TRACE_LEVEL_WARNING 3 -#define TRACE_LEVEL_ERROR 2 -#define TRACE_LEVEL_FATAL 1 -#define TRACE_LEVEL_NO_TRACE 0 - -/* By default, all traces are output except the debug one. */ -#if !defined(TRACE_LEVEL) -#define TRACE_LEVEL TRACE_LEVEL_INFO -#endif - -/* By default, trace level is static (not dynamic) */ -#if !defined(DYN_TRACES) -#define DYN_TRACES 0 -#endif - -#if defined(NOTRACE) -#error "Error: NOTRACE has to be not defined !" -#endif - -#undef NOTRACE -#if (DYN_TRACES==0) - #if (TRACE_LEVEL == TRACE_LEVEL_NO_TRACE) - #define NOTRACE - #endif -#endif - - - -/* ------------------------------------------------------------------------------ - * Global Macros - * ------------------------------------------------------------------------------ - */ - -extern void TRACE_CONFIGURE( uint32_t dwBaudRate, uint32_t dwMCk ) ; - -/** - * Initializes the DBGU for ISP project - * - * \param mode DBGU mode. - * \param baudrate DBGU baudrate. - * \param mck Master clock frequency. - */ -#ifndef DYNTRACE -#define DYNTRACE 0 -#endif - -#if (TRACE_LEVEL==0) && (DYNTRACE==0) -#define TRACE_CONFIGURE_ISP(mode, baudrate, mck) {} -#else -#define TRACE_CONFIGURE_ISP(mode, baudrate, mck) { \ - const Pin pinsUART0[] = {PINS_UART}; \ - PIO_Configure(pinsUART0, PIO_LISTSIZE(pinsUART0)); \ - UART_Configure( baudrate, mck ) ; \ - } -#endif - -/** - * Outputs a formatted string using 'printf' if the log level is high - * enough. Can be disabled by defining TRACE_LEVEL=0 during compilation. - * \param ... Additional parameters depending on formatted string. - */ -#if defined(NOTRACE) - -/* Empty macro */ -#define TRACE_DEBUG(...) { } -#define TRACE_INFO(...) { } -#define TRACE_WARNING(...) { } -#define TRACE_ERROR(...) { } -#define TRACE_FATAL(...) { while(1); } - -#define TRACE_DEBUG_WP(...) { } -#define TRACE_INFO_WP(...) { } -#define TRACE_WARNING_WP(...) { } -#define TRACE_ERROR_WP(...) { } -#define TRACE_FATAL_WP(...) { while(1); } - -#elif (DYN_TRACES == 1) - -/* Trace output depends on dwTraceLevel value */ -#define TRACE_DEBUG(...) { if (dwTraceLevel >= TRACE_LEVEL_DEBUG) { printf("-D- " __VA_ARGS__); } } -#define TRACE_INFO(...) { if (dwTraceLevel >= TRACE_LEVEL_INFO) { printf("-I- " __VA_ARGS__); } } -#define TRACE_WARNING(...) { if (dwTraceLevel >= TRACE_LEVEL_WARNING) { printf("-W- " __VA_ARGS__); } } -#define TRACE_ERROR(...) { if (dwTraceLevel >= TRACE_LEVEL_ERROR) { printf("-E- " __VA_ARGS__); } } -#define TRACE_FATAL(...) { if (dwTraceLevel >= TRACE_LEVEL_FATAL) { printf("-F- " __VA_ARGS__); while(1); } } - -#define TRACE_DEBUG_WP(...) { if (dwTraceLevel >= TRACE_LEVEL_DEBUG) { printf(__VA_ARGS__); } } -#define TRACE_INFO_WP(...) { if (dwTraceLevel >= TRACE_LEVEL_INFO) { printf(__VA_ARGS__); } } -#define TRACE_WARNING_WP(...) { if (dwTraceLevel >= TRACE_LEVEL_WARNING) { printf(__VA_ARGS__); } } -#define TRACE_ERROR_WP(...) { if (dwTraceLevel >= TRACE_LEVEL_ERROR) { printf(__VA_ARGS__); } } -#define TRACE_FATAL_WP(...) { if (dwTraceLevel >= TRACE_LEVEL_FATAL) { printf(__VA_ARGS__); while(1); } } - -#else - -/* Trace compilation depends on TRACE_LEVEL value */ -#if (TRACE_LEVEL >= TRACE_LEVEL_DEBUG) -#define TRACE_DEBUG(...) { printf("-D- " __VA_ARGS__); } -#define TRACE_DEBUG_WP(...) { printf(__VA_ARGS__); } -#else -#define TRACE_DEBUG(...) { } -#define TRACE_DEBUG_WP(...) { } -#endif - -#if (TRACE_LEVEL >= TRACE_LEVEL_INFO) -#define TRACE_INFO(...) { printf("-I- " __VA_ARGS__); } -#define TRACE_INFO_WP(...) { printf(__VA_ARGS__); } -#else -#define TRACE_INFO(...) { } -#define TRACE_INFO_WP(...) { } -#endif - -#if (TRACE_LEVEL >= TRACE_LEVEL_WARNING) -#define TRACE_WARNING(...) { printf("-W- " __VA_ARGS__); } -#define TRACE_WARNING_WP(...) { printf(__VA_ARGS__); } -#else -#define TRACE_WARNING(...) { } -#define TRACE_WARNING_WP(...) { } -#endif - -#if (TRACE_LEVEL >= TRACE_LEVEL_ERROR) -#define TRACE_ERROR(...) { printf("-E- " __VA_ARGS__); } -#define TRACE_ERROR_WP(...) { printf(__VA_ARGS__); } -#else -#define TRACE_ERROR(...) { } -#define TRACE_ERROR_WP(...) { } -#endif - -#if (TRACE_LEVEL >= TRACE_LEVEL_FATAL) -#define TRACE_FATAL(...) { printf("-F- " __VA_ARGS__); while(1); } -#define TRACE_FATAL_WP(...) { printf(__VA_ARGS__); while(1); } -#else -#define TRACE_FATAL(...) { while(1); } -#define TRACE_FATAL_WP(...) { while(1); } -#endif - -#endif - - -/** - * Exported variables - */ -/** Depending on DYN_TRACES, dwTraceLevel is a modifiable runtime variable or a define */ -#if !defined(NOTRACE) && (DYN_TRACES == 1) - extern uint32_t dwTraceLevel ; -#endif - -#endif //#ifndef TRACE_H - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/trng.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/trng.h deleted file mode 100644 index 29b28314..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/trng.h +++ /dev/null @@ -1,50 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2013, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -#ifndef _TRNG_ -#define _TRNG_ - -/*------------------------------------------------------------------------------ - * Headers - *----------------------------------------------------------------------------*/ - -#include "chip.h" - -/*----------------------------------------------------------------------------*/ -/* Exported functions */ -/*----------------------------------------------------------------------------*/ - -void TRNG_Enable(void); -void TRNG_Disable(void); -void TRNG_EnableIt(void); -void TRNG_DisableIt(void); -uint32_t TRNG_GetStatus(void); -uint32_t TRNG_GetRandData(void); - -#endif /* #ifndef _TRNG_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/twi.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/twi.h deleted file mode 100644 index 6b848e40..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/twi.h +++ /dev/null @@ -1,114 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * Interface for configuration the Two Wire Interface (TWI) peripheral. - * - */ - -#ifndef _TWI_ -#define _TWI_ - -/*------------------------------------------------------------------------------ - * Headers - *----------------------------------------------------------------------------*/ - -#include "chip.h" - -#include - -/*---------------------------------------------------------------------------- - * Macros - *----------------------------------------------------------------------------*/ -/* Returns 1 if the TXRDY bit (ready to transmit data) is set in the given - status register value.*/ -#define TWI_STATUS_TXRDY(status) ((status & TWIHS_SR_TXRDY) == TWIHS_SR_TXRDY) - -/* Returns 1 if the RXRDY bit (ready to receive data) is set in the given - status register value.*/ -#define TWI_STATUS_RXRDY(status) ((status & TWIHS_SR_RXRDY) == TWIHS_SR_RXRDY) - -/* Returns 1 if the TXCOMP bit (transfer complete) is set in the given - status register value.*/ -#define TWI_STATUS_TXCOMP(status) ((status & TWIHS_SR_TXCOMP) == TWIHS_SR_TXCOMP) - -#ifdef __cplusplus - extern "C" { -#endif - -/*---------------------------------------------------------------------------- - * External function - *----------------------------------------------------------------------------*/ - -extern void TWI_ConfigureMaster(Twihs *pTwi, uint32_t twck, uint32_t mck); - -extern void TWI_ConfigureSlave(Twihs *pTwi, uint8_t slaveAddress); - -extern void TWI_Stop(Twihs *pTwi); - -extern void TWI_StartRead( - Twihs *pTwi, - uint8_t address, - uint32_t iaddress, - uint8_t isize); - -extern uint8_t TWI_ReadByte(Twihs *pTwi); - -extern void TWI_WriteByte(Twihs *pTwi, uint8_t byte); - -extern void TWI_StartWrite( - Twihs *pTwi, - uint8_t address, - uint32_t iaddress, - uint8_t isize, - uint8_t byte); - -extern uint8_t TWI_ByteReceived(Twihs *pTwi); - -extern uint8_t TWI_ByteSent(Twihs *pTwi); - -extern uint8_t TWI_TransferComplete(Twihs *pTwi); - -extern void TWI_EnableIt(Twihs *pTwi, uint32_t sources); - -extern void TWI_DisableIt(Twihs *pTwi, uint32_t sources); - -extern uint32_t TWI_GetStatus(Twihs *pTwi); - -extern uint32_t TWI_GetMaskedStatus(Twihs *pTwi); - -extern void TWI_SendSTOPCondition(Twihs *pTwi); - -#ifdef __cplusplus -} -#endif - -#endif /* #ifndef _TWI_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/twid.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/twid.h deleted file mode 100644 index 23015097..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/twid.h +++ /dev/null @@ -1,142 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -#ifndef _TWID_ -#define _TWID_ - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ - -#include "chip.h" - -#include - -/*---------------------------------------------------------------------------- - * Definition - *----------------------------------------------------------------------------*/ - -/** TWI driver is currently busy. */ -#define TWID_ERROR_BUSY 1 - - /** Transfer is still pending.*/ -#define ASYNC_STATUS_PENDING 0xFF -#ifdef __cplusplus - extern "C" { -#endif - -/*---------------------------------------------------------------------------- - * Types - *----------------------------------------------------------------------------*/ - - /*---------------------------------------------------------------------------- - * Type - *----------------------------------------------------------------------------*/ -/** \brief Asynchronous transfer descriptor. */ -typedef struct _Async -{ - /** Asynchronous transfer status.*/ - volatile uint32_t status ; - /** Callback function to invoke when transfer completes or fails.*/ - void *callback ; - /** Driver storage area; do not use.*/ - uint8_t pStorage[9] ; -} Async ; - -/** \brief TWI driver structure. Holds the internal state of the driver.*/ -typedef struct _Twid -{ - /** Pointer to the underlying TWI peripheral.*/ - Twihs *pTwi ; - /** Current asynchronous transfer being processed.*/ - Async *pTransfer ; -} Twid; - -/** \brief TWI driver structure. Holds the internal state of the driver.*/ -typedef struct -{ - uint8_t Twi_id; - /** Pointer to the underlying TWI driver.*/ - Twid *pTwid ; - /** Pointer to the underlying DMA driver for TWI.*/ - sXdmad *pTwiDma; -} TwihsDma; - -/*---------------------------------------------------------------------------- - * Export functions - *----------------------------------------------------------------------------*/ -extern void TWID_Initialize( Twid *pTwid, Twihs *pTwi ) ; -extern void TWID_DmaInitialize(TwihsDma *pTwidma, Twihs *pTwi, uint8_t bPolling); - -extern void TWID_Handler( Twid *pTwid ) ; - -extern uint32_t ASYNC_IsFinished( Async* pAsync ) ; - -extern uint8_t TWID_Read( - Twid *pTwid, - uint8_t address, - uint32_t iaddress, - uint8_t isize, - uint8_t *pData, - uint32_t num, - Async *pAsync); - -extern uint8_t TWID_Write( - Twid *pTwid, - uint8_t address, - uint32_t iaddress, - uint8_t isize, - uint8_t *pData, - uint32_t num, - Async *pAsync); - -extern uint8_t TWID_DmaRead( - TwihsDma *pTwiXdma, - uint8_t address, - uint32_t iaddress, - uint8_t isize, - uint8_t *pData, - uint32_t num, - Async *pAsync); - -extern uint8_t TWID_DmaWrite( - TwihsDma *pTwiXdma, - uint8_t address, - uint32_t iaddress, - uint8_t isize, - uint8_t *pData, - uint32_t num, - Async *pAsync); - -#ifdef __cplusplus -} -#endif - -#endif //#ifndef TWID_H - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/uart.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/uart.h deleted file mode 100644 index aa3de6e6..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/uart.h +++ /dev/null @@ -1,69 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - - -#ifndef UART_H -#define UART_H - - -//------------------------------------------------------------------------------ -// Global functions -//------------------------------------------------------------------------------ - -void UART_Configure(Uart *uart, uint32_t mode, uint32_t baudrate, - uint32_t masterClock); - -void UART_SetTransmitterEnabled(Uart *uart, uint8_t enabled); - -void UART_SetReceiverEnabled(Uart *uart, uint8_t enabled); - -void UART_PutChar( Uart *uart, uint8_t c); - -uint32_t UART_IsRxReady(Uart *uart); - -uint8_t UART_GetChar(Uart *uart); - -uint32_t UART_GetStatus(Uart *uart); - -void UART_EnableIt(Uart *uart,uint32_t mode); - -void UART_DisableIt(Uart *uart,uint32_t mode); - -uint32_t UART_GetItMask(Uart *uart); - -void UART_SendBuffer(Uart *uart, uint8_t *pBuffer, uint32_t BuffLen); - -void UART_ReceiveBuffer(Uart *uart, uint8_t *pBuffer, uint32_t BuffLen); - -void UART_CompareConfig(Uart *uart, uint8_t Val1, uint8_t Val2); - -uint32_t UART_IsTxReady(Uart *uart); - -#endif //#ifndef UART_H - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/uart_dma.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/uart_dma.h deleted file mode 100644 index 9fe9a157..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/uart_dma.h +++ /dev/null @@ -1,139 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * Implementation of UART driver, transfer data through DMA. - * - */ - -#ifndef _UART_DMA_ -#define _UART_DMA_ - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ - -#include "chip.h" - -/*---------------------------------------------------------------------------- - * Definitions - *----------------------------------------------------------------------------*/ - -/** An unspecified error has occurred.*/ -#define UARTD_ERROR 1 - -/** UART driver is currently in use.*/ -#define UARTD_ERROR_LOCK 2 - - -#ifdef __cplusplus - extern "C" { -#endif - -/*---------------------------------------------------------------------------- - * Types - *----------------------------------------------------------------------------*/ - -/** UART transfer complete callback. */ -typedef void (*UartdCallback)( uint8_t, void* ) ; - -/** \brief usart Transfer Request prepared by the application upper layer. - * - * This structure is sent to the UART_Send or UART_Rcv to start the transfer. - * At the end of the transfer, the callback is invoked by the interrupt handler. - */ -typedef struct -{ - /** Pointer to the Buffer. */ - uint8_t *pBuff; - /** Buff size in bytes. */ - uint32_t BuffSize; - /** Dma channel num. */ - uint32_t ChNum; - /** Callback function invoked at the end of transfer. */ - UartdCallback callback; - /** Callback arguments. */ - void *pArgument; - /** flag to indicate the current transfer. */ - volatile uint8_t sempaphore; - /* DMA LLI structure */ - LinkedListDescriporView1 *pLLIview; - /* DMA transfer type */ - eXdmadProgState dmaProgrammingMode; - /* DMA LLI size */ - uint16_t dmaBlockSize; - /* Flag using ring buffer or FiFo*/ - uint8_t dmaRingBuffer; -} UartChannel ; - -/** Constant structure associated with UART port. This structure prevents - client applications to have access in the same time. */ -typedef struct -{ - /** USART Id as defined in the product datasheet */ - uint8_t uartId ; - /** Pointer to DMA driver */ - sXdmad* pXdmad; - /** Pointer to UART Hardware registers */ - Uart* pUartHw ; - /** Current Uart Rx channel */ - UartChannel *pRxChannel ; - /** Current Uart Tx channel */ - UartChannel *pTxChannel ; -} UartDma; - -/*---------------------------------------------------------------------------- - * Exported functions - *----------------------------------------------------------------------------*/ - -uint32_t UARTD_Configure( UartDma *pUartd , - uint8_t uartId, - uint32_t uartMode, - uint32_t baud, - uint32_t clk ); - -uint32_t UARTD_EnableTxChannels( UartDma *pUartd, UartChannel *pTxCh); - -uint32_t UARTD_EnableRxChannels( UartDma *pUartd, UartChannel *pRxCh); - -uint32_t UARTD_DisableTxChannels( UartDma *pUartd, UartChannel *pTxCh); - -uint32_t UARTD_DisableRxChannels( UartDma *pUartd, UartChannel *pRxCh); - -uint32_t UARTD_SendData( UartDma* pUartd ) ; - -uint32_t UARTD_RcvData( UartDma *pUartd); - -#ifdef __cplusplus -} -#endif - -#endif /* #ifndef _UART_DMA_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/usart.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/usart.h deleted file mode 100644 index 8469523a..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/usart.h +++ /dev/null @@ -1,164 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * \par Purpose - * - * This module provides several definitions and methods for using an USART - * peripheral. - * - * \par Usage - * - * -# Enable the USART peripheral clock in the PMC. - * -# Enable the required USART PIOs (see pio.h). - * -# Configure the UART by calling USART_Configure. - * -# Enable the transmitter and/or the receiver of the USART using - * USART_SetTransmitterEnabled and USART_SetReceiverEnabled. - * -# Send data through the USART using the USART_Write methods. - * -# Receive data from the USART using the USART_Read functions; the - * availability of data can be polled - * with USART_IsDataAvailable. - * -# Disable the transmitter and/or the receiver of the USART with - * USART_SetTransmitterEnabled and USART_SetReceiverEnabled. - */ - -#ifndef _USART_ -#define _USART_ - -/*------------------------------------------------------------------------------ - * Headers - *----------------------------------------------------------------------------*/ - -#include "chip.h" - -#include - -/*------------------------------------------------------------------------------ - * Definitions - *----------------------------------------------------------------------------*/ - -/** \section USART_mode USART modes - * This section lists several common operating modes for an USART peripheral. - * - * \b Modes - * - USART_MODE_ASYNCHRONOUS - * - USART_MODE_IRDA - */ - -/** Basic asynchronous mode, i.e. 8 bits no parity.*/ -#define USART_MODE_ASYNCHRONOUS (US_MR_CHRL_8_BIT | US_MR_PAR_NO) - -#define MAX_RX_TIMEOUT 131071 - -/** IRDA mode*/ -#define USART_MODE_IRDA \ - (US_MR_USART_MODE_IRDA | US_MR_CHRL_8_BIT | US_MR_PAR_NO | US_MR_FILTER) - -/** SPI mode*/ -#define AT91C_US_USMODE_SPIM 0xE -#define US_SPI_CPOL_0 (0x0<<16) -#define US_SPI_CPHA_0 (0x0<<8) -#define US_SPI_CPOL_1 (0x1<<16) -#define US_SPI_CPHA_1 (0x1<<8) -#define US_SPI_BPMODE_0 (US_SPI_CPOL_0|US_SPI_CPHA_1) -#define US_SPI_BPMODE_1 (US_SPI_CPOL_0|US_SPI_CPHA_0) -#define US_SPI_BPMODE_2 (US_SPI_CPOL_1|US_SPI_CPHA_1) -#define US_SPI_BPMODE_3 (US_SPI_CPOL_1|US_SPI_CPHA_0) - -#ifdef __cplusplus - extern "C" { -#endif - -/*------------------------------------------------------------------------------*/ -/* Exported functions */ -/*------------------------------------------------------------------------------*/ - - -void USART_Configure( Usart *pUsart, uint32_t mode, uint32_t baudrate, - uint32_t masterClock ) ; - -void USART_SetBaudrate(Usart *pUsart, uint8_t OverSamp, uint32_t baudrate, - uint32_t masterClock); - -uint32_t USART_GetStatus( Usart *usart ) ; - - -void USART_ResetRx(Usart *pUsart); - -void USART_ResetTx(Usart *pUsart); - -void USART_EnableTx(Usart *pUsart); - -void USART_EnableRx(Usart *pUsart); - -void USART_DisableRx(Usart *pUsart); - -void USART_DisableTx(Usart *pUsart); - -void USART_EnableIt( Usart *usart,uint32_t mode ) ; - -void USART_DisableIt( Usart *usart,uint32_t mode ) ; - -uint32_t USART_GetItMask( Usart * usart ) ; - -void USART_SetTransmitterEnabled( Usart *usart, uint8_t enabled ) ; - -void USART_SetReceiverEnabled( Usart *usart, uint8_t enabled ) ; - -void USART_SetRTSEnabled(Usart *usart, uint8_t enabled); - -void USART_Write( Usart *usart, uint16_t data, volatile uint32_t timeOut ) ; - -uint16_t USART_Read( Usart *usart, volatile uint32_t timeOut ) ; - -uint8_t USART_IsDataAvailable( Usart *usart ) ; - -void USART_SetIrdaFilter(Usart *pUsart, uint8_t filter); - -void USART_PutChar( Usart *usart, uint8_t c ) ; - -uint32_t USART_IsRxReady( Usart *usart ) ; - -uint8_t USART_GetChar( Usart *usart ) ; - -void USART_EnableRecvTimeOut(Usart *usart, uint32_t timeout); - -void USART_EnableTxTimeGaurd(Usart *pUsart, uint32_t TimeGaurd); - -void USART_AcknowledgeRxTimeOut(Usart *usart, uint8_t Periodic); - - -#ifdef __cplusplus -} -#endif - -#endif /* #ifndef _USART_ */ - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/usart_dma.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/usart_dma.h deleted file mode 100644 index 105b9578..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/usart_dma.h +++ /dev/null @@ -1,139 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * Implementation of USART driver, transfer data through DMA. - * - */ - -#ifndef _USART_DMA_H_ -#define _USART_DMA_H_ - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ - -#include "chip.h" - -/*---------------------------------------------------------------------------- - * Definitions - *----------------------------------------------------------------------------*/ - -/** An unspecified error has occurred.*/ -#define USARTD_ERROR 1 - -/** USART driver is currently in use.*/ -#define USARTD_ERROR_LOCK 2 - - -#ifdef __cplusplus - extern "C" { -#endif - -/*---------------------------------------------------------------------------- - * Types - *----------------------------------------------------------------------------*/ - -/** USART transfer complete callback. */ -typedef void (*UsartdCallback)( uint8_t, void* ) ; - -/** \brief usart Transfer Request prepared by the application upper layer. - * - * This structure is sent to the USART_Send or USART_Rcv to start the transfer. - * At the end of the transfer, the callback is invoked by the interrupt handler. - */ -typedef struct -{ - /** Pointer to the Buffer. */ - uint8_t *pBuff; - /** Buff size in bytes. */ - uint32_t BuffSize; - /** Dma channel num. */ - uint8_t ChNum; - /** Callback function invoked at the end of transfer. */ - UsartdCallback callback; - /** Callback arguments. */ - void *pArgument; - /** flag to indicate the current transfer progress */ - volatile uint8_t dmaProgress; - /* DMA LLI structure */ - LinkedListDescriporView1 *pLLIview; - /* DMA transfer type */ - eXdmadProgState dmaProgrammingMode; - /* DMA LLI size or num of micro block*/ - uint16_t dmaBlockSize; - /* Flag using ring buffer or FiFo*/ - uint8_t dmaRingBuffer; -} UsartChannel ; - -/** Constant structure associated with USART port. This structure prevents - client applications to have access in the same time. */ -typedef struct -{ - /** USART Id as defined in the product datasheet */ - uint8_t usartId ; - /** Pointer to USART Hardware registers */ - Usart* pUsartHw ; - /** Current Usart Rx channel */ - UsartChannel *pRxChannel ; - /** Current Usart Tx channel */ - UsartChannel *pTxChannel ; - /** Pointer to DMA driver */ - sXdmad* pXdmad; -} UsartDma; - -/*---------------------------------------------------------------------------- - * Exported functions - *----------------------------------------------------------------------------*/ - -uint32_t USARTD_Configure( UsartDma *pUsartd , - uint8_t USARTId, - uint32_t UsartMode, - uint32_t BaudRate, - uint32_t UsartClk); - -uint32_t USARTD_EnableTxChannels( UsartDma *pUsartd, UsartChannel *pTxCh); - -uint32_t USARTD_EnableRxChannels( UsartDma *pUsartd, UsartChannel *pRxCh); - -uint32_t USARTD_DisableTxChannels( UsartDma *pUsartd, UsartChannel *pTxCh); - -uint32_t USARTD_DisableRxChannels( UsartDma *pUsartd, UsartChannel *pTxCh); - -uint32_t USARTD_SendData( UsartDma* pUsartd ) ; - -uint32_t USARTD_RcvData( UsartDma *pUsartd); - -#ifdef __cplusplus -} -#endif - -#endif /* #ifndef _USART_DMA_ */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/usbhs.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/usbhs.h deleted file mode 100644 index 7a65059a..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/usbhs.h +++ /dev/null @@ -1,1687 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2010, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** \file */ - -#ifndef USBHS_H -#define USBHS_H -/** addtogroup usbd_hal - *@{ - */ - -#define USB_DEVICE_HS_SUPPORT - -//! Control endpoint size -#define USB_DEVICE_EP_CTRL_SIZE 64 - -/** Indicates chip has an UDP High Speed. */ -#define CHIP_USB_UDP - -/** Indicates chip has an internal pull-up. */ -#define CHIP_USB_PULLUP_INTERNAL - -/** Number of USB endpoints */ -#define CHIP_USB_NUMENDPOINTS 10 - -/** Endpoints max packet size */ -#define CHIP_USB_ENDPOINTS_MAXPACKETSIZE(ep) \ - ((ep == 0) ? 64 : 1024) - -/** Endpoints Number of Bank */ -#define CHIP_USB_ENDPOINTS_BANKS(ep) ((ep==0)?1:((ep<=2)?3:2)) - - -#define CHIP_USB_ENDPOINTS_HBW(ep) ((((ep)>=1) &&((ep)<=2))?true:false) - -/** Endpoints DMA support */ -#define CHIP_USB_ENDPOINTS_DMA(ep) ((((ep)>=1)&&((ep)<=7))?true:false) - -/** Max size of the FMA FIFO */ -#define DMA_MAX_FIFO_SIZE (65536/1) -/** fifo space size in DW */ -#define EPT_VIRTUAL_SIZE 16384 - - - //! @name USBHS Host IP properties -//! -//! @{ -//! Get maximal number of endpoints -#define uhd_get_pipe_max_nbr() (9) -#define USBHS_EPT_NUM (uhd_get_pipe_max_nbr()+1) - //! Get maximal number of banks of endpoints -#define uhd_get_pipe_bank_max_nbr(ep) ((ep == 0) ? 1 : (( ep <= 2) ? 3 : 2)) - //! Get maximal size of endpoint (3X, 1024/64) -#define uhd_get_pipe_size_max(ep) (((ep) == 0) ? 64 : 1024) - //! Get DMA support of endpoints -#define Is_uhd_pipe_dma_supported(ep) ((((ep) >= 1) && ((ep) <= 6)) ? true : false) - //! Get High Band Width support of endpoints -#define Is_uhd_pipe_high_bw_supported(ep) (((ep) >= 2) ? true : false) -//! @} - -typedef enum -{ - HOST_MODE= 0, - DEVICE_MODE=1 -}USB_Mode_t; - -//! Maximum transfer size on USB DMA -#define UHD_PIPE_MAX_TRANS 0x8000 - -/** -================================= - USBHS_CTRL -================================= -**/ - -/** - * \brief Freeze or unfreeze USB clock - * \param pUsbhs Pointer to an USBHS instance. - * \param Enable Enable or disable - */ -__STATIC_INLINE void USBHS_FreezeClock(Usbhs *pUsbhs) -{ - pUsbhs->USBHS_CTRL |= USBHS_CTRL_FRZCLK; -} - -/** - * \brief Freeze or unfreeze USB clock - * \param pUsbhs Pointer to an USBHS instance. - * \param Enable Enable or disable - */ -__STATIC_INLINE void USBHS_UnFreezeClock(Usbhs *pUsbhs) -{ - pUsbhs->USBHS_CTRL &= ~((uint32_t)USBHS_CTRL_FRZCLK); -} -/** - * \brief Freeze or unfreeze USB clock - * \param pUsbhs Pointer to an USBHS instance. - * \param Enable Enable or disable - */ -__STATIC_INLINE void USBHS_VBusHWC(Usbhs *pUsbhs, uint8_t Enable) -{ - - if(!Enable) { - pUsbhs->USBHS_CTRL |= (1<<8); - } else { - pUsbhs->USBHS_CTRL &= ~((uint32_t)(1<<8)); - } -} - -/** - * \brief Enables or disables USB - * \param pUsbhs Pointer to an USBHS instance. - * \param Enable Enable or disable - */ - -__STATIC_INLINE void USBHS_UsbEnable(Usbhs *pUsbhs, uint8_t Enable) -{ - if(Enable) { - pUsbhs->USBHS_CTRL |= USBHS_CTRL_USBE; - } else { - pUsbhs->USBHS_CTRL &= ~((uint32_t)USBHS_CTRL_USBE); - } -} - - -/** - * \brief Device or Host Mode - * \param pUsbhs Pointer to an USBHS instance. - * \param Mode Device or Host Mode - */ - -__STATIC_INLINE void USBHS_UsbMode(Usbhs *pUsbhs, USB_Mode_t Mode) -{ - if(Mode) { - pUsbhs->USBHS_CTRL |= USBHS_CTRL_UIMOD_DEVICE; - } else { - pUsbhs->USBHS_CTRL &= ~((uint32_t)USBHS_CTRL_UIMOD_DEVICE); - } -} - -/********************* USBHS_SR *****************/ - -/** - * \brief Check if clock is usable or not - * \param pUsbhs Pointer to an USBHS instance. - * \return 1 if USB clock is usable - */ - -__STATIC_INLINE uint8_t USBHS_ISUsableClock(Usbhs *pUsbhs) -{ - return (( pUsbhs->USBHS_SR & USBHS_SR_CLKUSABLE) >> 14); -} - - -/** - * \brief Raise interrupt for endpoint. - * \param pUsbhs Pointer to an USBHS instance. - * \return USB status - */ - -__STATIC_INLINE uint32_t USBHS_ReadStatus(Usbhs *pUsbhs) -{ - return (pUsbhs->USBHS_SR); -} - -/** - * \brief Enable or disable USB address - * \param pUsbhs Pointer to an USBHS instance. - * \return USB speed status - */ - -__STATIC_INLINE uint32_t USBHS_GetUsbSpeed(Usbhs *pUsbhs) -{ - return ( (pUsbhs->USBHS_SR & USBHS_SR_SPEED_Msk) ); -} - - -/** - * \brief Enable or disable USB address - * \param pUsbhs Pointer to an USBHS instance. - * \return USB speed status - */ - -__STATIC_INLINE bool USBHS_IsUsbFullSpeed(Usbhs *pUsbhs) -{ - return ( (pUsbhs->USBHS_SR & USBHS_SR_SPEED_Msk) == USBHS_SR_SPEED_FULL_SPEED) ? true:false; -} - - -/** - * \brief Enable or disable USB address - * \param pUsbhs Pointer to an USBHS instance. - * \return USB speed status - */ - -__STATIC_INLINE bool USBHS_IsUsbHighSpeed(Usbhs *pUsbhs) -{ - return ( (pUsbhs->USBHS_SR & USBHS_SR_SPEED_Msk) == USBHS_SR_SPEED_HIGH_SPEED) ? true:false; -} - -/** - * \brief Enable or disable USB address - * \param pUsbhs Pointer to an USBHS instance. - * \return USB speed status - */ - -__STATIC_INLINE bool USBHS_IsUsbLowSpeed(Usbhs *pUsbhs) -{ - return ( (pUsbhs->USBHS_SR & USBHS_SR_SPEED_Msk) == USBHS_SR_SPEED_LOW_SPEED) ? true:false; -} -/********************* USBHS_SCR *****************/ - -/** - * \brief Raise interrupt for endpoint. - * \param pUsbhs Pointer to an USBHS instance. - * \param AckType Interrupt Acknowledge type - */ - -__STATIC_INLINE void USBHS_Ack(Usbhs *pUsbhs, uint32_t AckType) -{ - pUsbhs->USBHS_SCR |= AckType; -} - -/********************* USBHS_SFR *****************/ - -/** - * \brief Raise interrupt for endpoint. - * \param pUsbhs Pointer to an USBHS instance. - * \param SetStatus Set USB status - */ - -__STATIC_INLINE void USBHS_Set(Usbhs *pUsbhs, uint32_t SetStatus) -{ - pUsbhs->USBHS_SFR |= SetStatus; -} - - - /*-------------------------------------------------------- - * =========== USB Device functions ====================== - *---------------------------------------------------------*/ - -/** - * \brief Enable or disable USB address - * \param pUsbhs Pointer to an USBHS instance. - * \param SetStatus Set USB status - */ - -__STATIC_INLINE void USBHS_EnableAddress(Usbhs *pUsbhs, uint8_t Enable) -{ - if(Enable) { - pUsbhs->USBHS_DEVCTRL |= USBHS_DEVCTRL_ADDEN; - } else { - pUsbhs->USBHS_DEVCTRL &= ~((uint32_t)USBHS_DEVCTRL_ADDEN); - } -} - -/** - * \brief Configure USB address and enable or disable it - * \param pUsbhs Pointer to an USBHS instance. - * \param Addr USB device status - */ - -__STATIC_INLINE void USBHS_SetAddress(Usbhs *pUsbhs, uint8_t Addr) -{ - pUsbhs->USBHS_DEVCTRL |= USBHS_DEVCTRL_UADD(Addr); - pUsbhs->USBHS_DEVCTRL |= USBHS_DEVCTRL_ADDEN; -} - -/** - * \brief Get USB address - * \param pUsbhs Pointer to an USBHS instance. - */ - -__STATIC_INLINE uint8_t USBHS_GetAddress(Usbhs *pUsbhs) -{ - return ( pUsbhs->USBHS_DEVCTRL & USBHS_DEVCTRL_UADD_Msk); -} - -/** - * \brief Attach or detach USB. - * \param pUsbhs Pointer to an USBHS instance. - * \param Enable Attachs or detach USB device - */ - -__STATIC_INLINE void USBHS_DetachUsb(Usbhs *pUsbhs, uint8_t Enable) -{ - if(Enable) { - pUsbhs->USBHS_DEVCTRL |= USBHS_DEVCTRL_DETACH; - } else { - pUsbhs->USBHS_DEVCTRL &= ~((uint32_t)USBHS_DEVCTRL_DETACH); - } - -} - -/** - * \brief Force Low Speed mode - * \param pUsbhs Pointer to an USBHS instance. - * \param Enable Enables the Full speed - */ - -__STATIC_INLINE void USBHS_ForceLowSpeed(Usbhs *pUsbhs, uint8_t Enable) -{ - if(Enable) { - pUsbhs->USBHS_DEVCTRL |= USBHS_DEVCTRL_LS; - } else { - pUsbhs->USBHS_DEVCTRL &= ~((uint32_t)USBHS_DEVCTRL_LS); - } -} - -/** - * \brief Disable/Enables High Speed mode - * \param pUsbhs Pointer to an USBHS instance. - * \param Enable Enables/disable option - */ - -__STATIC_INLINE void USBHS_EnableHighSpeed(Usbhs *pUsbhs, uint8_t Enable) -{ - uint32_t cfg = pUsbhs->USBHS_DEVCTRL; - cfg &= ~((uint32_t)USBHS_DEVCTRL_SPDCONF_Msk); - if(Enable) { - pUsbhs->USBHS_DEVCTRL |= cfg; - } else { - pUsbhs->USBHS_DEVCTRL |= (cfg | USBHS_DEVCTRL_SPDCONF_FORCED_FS); - } - -} - -/** - * \brief Set Remote WakeUp mode - * \param pUsbhs Pointer to an USBHS instance. - */ - -__STATIC_INLINE void USBHS_SetRemoteWakeUp(Usbhs *pUsbhs) -{ - pUsbhs->USBHS_DEVCTRL |= USBHS_DEVCTRL_RMWKUP; -} - -/** - * \brief Disable/Enables Test mode - * \param pUsbhs Pointer to an USBHS instance. - * \param mode Enables/disable option - */ - -__STATIC_INLINE void USBHS_EnableTestMode(Usbhs *pUsbhs, uint32_t mode) -{ - pUsbhs->USBHS_DEVCTRL |= mode; -} - - -/** - * \brief Disable/Enables HS Test mode - * \param pUsbhs Pointer to an USBHS instance. - */ - -__STATIC_INLINE void USBHS_EnableHSTestMode(Usbhs *pUsbhs) -{ - pUsbhs->USBHS_DEVCTRL |= USBHS_DEVCTRL_SPDCONF_HIGH_SPEED; -} - -/** - * \brief Read status for an interrupt - * \param pUsbhs Pointer to an USBHS instance. - * \param IntType Interrupt type - */ - -__STATIC_INLINE uint32_t USBHS_ReadIntStatus(Usbhs *pUsbhs, uint32_t IntType) -{ - return (pUsbhs->USBHS_DEVISR & IntType); -} - -/** - * \brief Read status for an Endpoint - * \param pUsbhs Pointer to an USBHS instance. - * \param EpNum Endpoint - */ - -__STATIC_INLINE uint32_t USBHS_ReadEpIntStatus(Usbhs *pUsbhs, uint8_t EpNum) -{ - return (pUsbhs->USBHS_DEVISR & ( USBHS_DEVISR_PEP_0 << EpNum) ); -} - -/** - * \brief Read status for a DMA Endpoint - * \param pUsbhs Pointer to an USBHS instance. - * \param DmaNum DMA Endpoint - */ -__STATIC_INLINE uint32_t USBHS_ReadDmaIntStatus(Usbhs *pUsbhs, uint8_t DmaNum) -{ - return (pUsbhs->USBHS_DEVISR & ( USBHS_DEVISR_DMA_1 << DmaNum) ); -} - -/** - * \brief Acknowledge interrupt for endpoint. - * \param pUsbhs Pointer to an USBHS instance. - * \param IntType Interrupt Type - */ - -__STATIC_INLINE void USBHS_AckInt(Usbhs *pUsbhs, uint32_t IntType) -{ - pUsbhs->USBHS_DEVICR |= IntType; -} - -/** - * \brief Raise interrupt for endpoint. - * \param pUsbhs Pointer to an USBHS instance. - * \param IntType Interrupt Type - */ - - -__STATIC_INLINE void USBHS_RaiseInt(Usbhs *pUsbhs, uint32_t IntType) -{ - pUsbhs->USBHS_DEVIFR |= IntType; -} - -/** - * \brief Raise DMA interrupt for endpoint. - * \param pUsbhs Pointer to an USBHS instance. - * \param IntType Interrupt Type - */ -__STATIC_INLINE void USBHS_RaiseDmaInt(Usbhs *pUsbhs, uint8_t Dma) -{ - assert(Dma< USBHSDEVDMA_NUMBER); - pUsbhs->USBHS_DEVIFR |= ( USBHS_DEVIFR_DMA_1 << Dma ); -} - -/** - * \brief check for interrupt of endpoint. - * \param pUsbhs Pointer to an USBHS instance. - * \param IntType Interrupt Type - */ - -__STATIC_INLINE uint32_t USBHS_IsIntEnable(Usbhs *pUsbhs, uint32_t IntType) -{ - return (pUsbhs->USBHS_DEVIMR & IntType); -} - -/** - * \brief Check if endpoint's interrupt is enabled for a given endpoint number - * \param pUsbhs Pointer to an USBHS instance. - * \param EpNum Endpoint number - */ - -__STATIC_INLINE uint32_t USBHS_IsIntEnableEP(Usbhs *pUsbhs, uint8_t EpNum) -{ - return (pUsbhs->USBHS_DEVIMR & (USBHS_DEVIMR_PEP_0 << EpNum )); -} - - -/** - * \brief Check if endpoint's DMA interrupt is enabled for a given endpoint - * DMA number - * \param pUsbhs Pointer to an USBHS instance. - * \param DmaNum Endpoint's DMA number - */ - -__STATIC_INLINE uint32_t USBHS_IsDmaIntEnable(Usbhs *pUsbhs, uint8_t DmaNum) -{ - return (pUsbhs->USBHS_DEVIMR & (USBHS_DEVIMR_DMA_1 << DmaNum)); -} - - -/** - * \brief Enables Interrupt - * \param pUsbhs Pointer to an USBHS instance. - * \param IntType Interrupt Type - */ -__STATIC_INLINE void USBHS_EnableInt(Usbhs *pUsbhs, uint32_t IntType) -{ - pUsbhs->USBHS_DEVIER |= IntType; -} - -/** - * \brief Enables interrupt for a given endpoint. - * \param pUsbhs Pointer to an USBHS instance. - * \param DmaNum Endpoint's DMA number - */ -__STATIC_INLINE void USBHS_EnableIntEP(Usbhs *pUsbhs, uint8_t EpNum) -{ - pUsbhs->USBHS_DEVIER |= (USBHS_DEVIER_PEP_0 << EpNum); -} - -/** - * \brief Enables DMA interrupt for a given endpoint. - * \param pUsbhs Pointer to an USBHS instance. - * \param DmaEp Endpoint's DMA interrupt number - */ - -__STATIC_INLINE void USBHS_EnableDMAIntEP(Usbhs *pUsbhs, uint32_t DmaEp) -{ - assert(DmaEp< USBHSDEVDMA_NUMBER); - pUsbhs->USBHS_DEVIER |= (USBHS_DEVIER_DMA_1 << DmaEp); -} - - /** - * \brief Disables interrupt for endpoint. - * \param pUsbhs Pointer to an USBHS instance. - * \param IntType Int type - */ - -__STATIC_INLINE void USBHS_DisableInt(Usbhs *pUsbhs, uint32_t IntType) -{ - pUsbhs->USBHS_DEVIDR |= IntType; -} - - /** - * \brief Disables interrupt for endpoint. - * \param pUsbhs Pointer to an USBHS instance. - * \param Ep Endpoint number - */ - -__STATIC_INLINE void USBHS_DisableIntEP(Usbhs *pUsbhs, uint8_t Ep) -{ - pUsbhs->USBHS_DEVIDR |= (USBHS_DEVIDR_PEP_0 << Ep); -} - - /** - * \brief Disables DMA interrupt for endpoint. - * \param pUsbhs Pointer to an USBHS instance. - * \param DmaEp Endpoint's DMA number - */ -__STATIC_INLINE void USBHS_DisableDMAIntEP(Usbhs *pUsbhs, uint8_t DmaEp) -{ - assert(DmaEp< USBHSDEVDMA_NUMBER); - pUsbhs->USBHS_DEVIDR |= (USBHS_DEVIDR_DMA_1 << DmaEp); -} - - - /** - * \brief Enables or disables endpoint. - * \param pUsbhs Pointer to an USBHS instance. - * \param Enable Enable/disable endpoint - */ - -__STATIC_INLINE void USBHS_EnableEP(Usbhs *pUsbhs, uint8_t Ep, uint8_t Enable) -{ - if(Enable) { - pUsbhs->USBHS_DEVEPT |= (USBHS_DEVEPT_EPEN0 << Ep); - } else { - pUsbhs->USBHS_DEVEPT &= ~(uint32_t)(USBHS_DEVEPT_EPEN0 << Ep); - } - -} - - - /** - * \brief Rests Endpoint - * \param pUsbhs Pointer to an USBHS instance. - * \param Ep Endpoint Number - */ - -__STATIC_INLINE void USBHS_ResetEP(Usbhs *pUsbhs, uint8_t Ep) -{ - pUsbhs->USBHS_DEVEPT |= (USBHS_DEVEPT_EPRST0 << Ep); - //pUsbhs->USBHS_DEVEPT &= ~(uint32_t)(USBHS_DEVEPT_EPRST0 << Ep); -} - - /** - * \brief Checks if Endpoint is enable - * \param pUsbhs Pointer to an USBHS instance. - * \param Ep Endpoint Number - */ - -__STATIC_INLINE uint32_t USBHS_IsEPEnabled(Usbhs *pUsbhs, uint8_t Ep) -{ - return (pUsbhs->USBHS_DEVEPT & (USBHS_DEVEPT_EPEN0 << Ep) ); -} - - /** - * \brief Get MicrFrame number - * \param pUsbhs Pointer to an USBHS instance. - * \retruns Micro frame number - */ -__STATIC_INLINE uint8_t USBHS_GetMicroFrameNum(Usbhs *pUsbhs) -{ - return (pUsbhs->USBHS_DEVFNUM & USBHS_DEVFNUM_MFNUM_Msk); -} - - - /** - * \brief Get Frame number - * \param pUsbhs Pointer to an USBHS instance. - * \retruns frame number - */ -__STATIC_INLINE uint8_t USBHS_GetFrameNum(Usbhs *pUsbhs) -{ - return ( (pUsbhs->USBHS_DEVFNUM & USBHS_DEVFNUM_FNUM_Msk) - >> USBHS_DEVFNUM_FNUM_Pos); -} - - /** - * \brief Get Frame number CRC error - * \param pUsbhs Pointer to an USBHS instance. - * \retruns Frame number error status - */ -__STATIC_INLINE uint8_t USBHS_GetFrameNumCrcErr(Usbhs *pUsbhs) -{ - return ( (pUsbhs->USBHS_DEVFNUM & USBHS_DEVFNUM_FNCERR) >> 15); -} - - /*----------------------------------------- - * =========== USB Device's Endpoint functions ======== - *------------------------------------------*/ - -/** - * Set Endpoints configuration - * Bank size, type and direction - */ -__STATIC_INLINE void USBHS_ConfigureEPs(Usbhs *pUsbhs, const uint8_t Ep, - const uint8_t Type, const uint8_t Dir, - const uint8_t Size, const uint8_t Bank) -{ - - pUsbhs->USBHS_DEVEPTCFG[Ep] |= - ((Size << USBHS_DEVEPTCFG_EPSIZE_Pos) & USBHS_DEVEPTCFG_EPSIZE_Msk); - pUsbhs->USBHS_DEVEPTCFG[Ep] |= - ((Dir << 8 ) & USBHS_DEVEPTCFG_EPDIR); - pUsbhs->USBHS_DEVEPTCFG[Ep] |= - (( (Type) << USBHS_DEVEPTCFG_EPTYPE_Pos) & USBHS_DEVEPTCFG_EPTYPE_Msk); - pUsbhs->USBHS_DEVEPTCFG[Ep] |= - (( (Bank) << USBHS_DEVEPTCFG_EPBK_Pos) & USBHS_DEVEPTCFG_EPBK_Msk); -} - - -/** - * Enable or disable Auto switch of banks - */ -__STATIC_INLINE void USBHS_AutoSwitchBankEnable(Usbhs *pUsbhs, uint8_t Ep, uint8_t Enable) -{ - if(Enable) { - pUsbhs->USBHS_DEVEPTCFG[Ep] |=USBHS_DEVEPTCFG_AUTOSW; - } else { - pUsbhs->USBHS_DEVEPTCFG[Ep] &= ~((uint32_t)USBHS_DEVEPTCFG_AUTOSW); - } -} - - -/** - * Allocate Endpoint memory - */ -__STATIC_INLINE void USBHS_AllocateMemory(Usbhs *pUsbhs, uint8_t Ep) -{ - pUsbhs->USBHS_DEVEPTCFG[Ep] |=USBHS_DEVEPTCFG_ALLOC; -} - - -/** - * Free allocated Endpoint memory - */ -__STATIC_INLINE void USBHS_FreeMemory(Usbhs *pUsbhs, uint8_t Ep) -{ - pUsbhs->USBHS_DEVEPTCFG[Ep] &= ~((uint32_t)USBHS_DEVEPTCFG_ALLOC); -} - - -/** - * Get Endpoint configuration - */ -__STATIC_INLINE uint32_t USBHS_GetConfigureEPs(Usbhs *pUsbhs, uint8_t Ep, - uint32_t IntType) -{ - return ((pUsbhs->USBHS_DEVEPTCFG[Ep] ) & IntType); -} - -/** - * Get Endpoint Type - */ -__STATIC_INLINE uint8_t USBHS_GetEpType(Usbhs *pUsbhs, uint8_t Ep) -{ - return ((pUsbhs->USBHS_DEVEPTCFG[Ep] & USBHS_DEVEPTCFG_EPTYPE_Msk) - >> USBHS_DEVEPTCFG_EPTYPE_Pos); -} - -/** - * Get Endpoint Size - */ -__STATIC_INLINE uint32_t USBHS_GetEpSize(Usbhs *pUsbhs, uint8_t Ep) -{ - return ( 8 << ( (pUsbhs->USBHS_DEVEPTCFG[Ep] & USBHS_DEVEPTCFG_EPSIZE_Msk) - >> USBHS_DEVEPTCFG_EPSIZE_Pos) ); -} - - -/** - * Sets ISO endpoint's Number of Transfer for High Speed - */ -__STATIC_INLINE void USBHS_SetIsoTrans(Usbhs *pUsbhs, uint8_t Ep, - uint8_t nbTrans) -{ - pUsbhs->USBHS_DEVEPTCFG[Ep] |= USBHS_DEVEPTCFG_NBTRANS(nbTrans) ; -} - -/** - * Check for interrupt types enabled for a given endpoint - */ -__STATIC_INLINE uint32_t USBHS_IsEpIntEnable(Usbhs *pUsbhs, uint8_t Ep, - uint32_t EpIntType) -{ - return (pUsbhs->USBHS_DEVEPTIMR[Ep] & EpIntType); -} - - -/** - * Enables an interrupt type for a given endpoint - */ -__STATIC_INLINE void USBHS_EnableEPIntType(Usbhs *pUsbhs, uint8_t Ep, - uint32_t EpInt) -{ - pUsbhs->USBHS_DEVEPTIER[Ep] |= EpInt; -} - -/** - * Enables an interrupt type for a given endpoint - */ -__STATIC_INLINE uint32_t USBHS_IsBankKilled(Usbhs *pUsbhs, uint8_t Ep) -{ - return (pUsbhs->USBHS_DEVEPTIMR[Ep] & USBHS_DEVEPTIMR_KILLBK); -} - -/** - * Enables an interrupt type for a given endpoint - */ -__STATIC_INLINE void USBHS_KillBank(Usbhs *pUsbhs, uint8_t Ep) -{ - pUsbhs->USBHS_DEVEPTIER[Ep] = USBHS_DEVEPTIER_KILLBKS; -} -/** - * Disables an interrupt type for a given endpoint - */ -__STATIC_INLINE void USBHS_DisableEPIntType(Usbhs *pUsbhs, uint8_t Ep, - uint32_t EpInt) -{ - pUsbhs->USBHS_DEVEPTIDR[Ep] |= EpInt; -} - -/** - * Clears register/acknowledge for a given endpoint - */ -__STATIC_INLINE void USBHS_AckEpInterrupt(Usbhs *pUsbhs, uint8_t Ep, uint32_t EpInt) -{ - pUsbhs->USBHS_DEVEPTICR[Ep] |= EpInt; -} - -/** - * Sets/Raise register for a given endpoint - */ -__STATIC_INLINE void USBHS_RaiseEPInt(Usbhs *pUsbhs, uint8_t Ep, uint32_t EpInt) -{ - pUsbhs->USBHS_DEVEPTIFR[Ep] |= EpInt; -} - -/** - * Gets interrupt status for a given EP - */ -__STATIC_INLINE uint32_t USBHS_ReadEPStatus(Usbhs *pUsbhs, uint8_t Ep, - uint32_t EpInt) -{ - return (pUsbhs->USBHS_DEVEPTISR[Ep] & EpInt); -} - -/** - * Check if given endpoint's bank is free - */ -__STATIC_INLINE uint8_t USBHS_IsBankFree(Usbhs *pUsbhs, uint8_t Ep) -{ - if( (pUsbhs->USBHS_DEVEPTISR[Ep] & USBHS_DEVEPTISR_NBUSYBK_Msk)) { - return false; - } else { - return true; - } -} - -/** - * Read endpoint's bank number in use - */ -__STATIC_INLINE uint8_t USBHS_NumOfBanksInUse(Usbhs *pUsbhs, uint8_t Ep) -{ - return ( (pUsbhs->USBHS_DEVEPTISR[Ep] & USBHS_DEVEPTISR_NBUSYBK_Msk) - >> USBHS_DEVEPTISR_NBUSYBK_Pos); -} - - -/** - * Read endpoint's bank number in use - */ -__STATIC_INLINE uint16_t USBHS_ByteCount(Usbhs *pUsbhs, uint8_t Ep) -{ - return (uint16_t)( (pUsbhs->USBHS_DEVEPTISR[Ep] & USBHS_DEVEPTISR_BYCT_Msk) - >> USBHS_DEVEPTISR_BYCT_Pos); -} - - /*-------------------------------------------------------- - * =========== USB Device's Ep's DMA functions ========= - *---------------------------------------------------------*/ - - /** - * \brief Sets DMA next descriptor address - * \param pUsbDma USBHS device DMA instance - * \param Desc NDA address - */ -__STATIC_INLINE void USBHS_SetDmaNDA(UsbhsDevdma *pUsbDma, uint32_t Desc) -{ - pUsbDma->USBHS_DEVDMANXTDSC = Desc; -} - - /** - * \brief Gets DMA next descriptor address - * \param pUsbDma USBHS device DMA instance - * \return Next DMA descriptor - */ -__STATIC_INLINE uint32_t USBHS_GetDmaNDA(UsbhsDevdma *pUsbDma) -{ - return (pUsbDma->USBHS_DEVDMANXTDSC); -} - - /** - * \brief Sets USBHS's DMA Buffer addresse - * \param pUsbDma USBHS device DMA instance - * \param Addr DMA's buffer Addrs - */ -__STATIC_INLINE void USBHS_SetDmaBuffAdd(UsbhsDevdma *pUsbDma, uint32_t Addr) -{ - pUsbDma->USBHS_DEVDMAADDRESS = Addr; -} - - - /** - * \brief Gets USBHS's DMA Buffer addresse - * \param pUsbDma USBHS device DMA instance - * \return DMA addrs - */ -__STATIC_INLINE uint32_t USBHS_GetDmaBuffAdd(UsbhsDevdma *pUsbDma) -{ - return (pUsbDma->USBHS_DEVDMAADDRESS); -} - - /** - * \brief Setup the USBHS DMA - * \param pUsbDma USBHS device DMA instance - * \param Cfg DMA's configuration - */ -__STATIC_INLINE void USBHS_ConfigureDma(UsbhsDevdma *pUsbDma, uint32_t Cfg) -{ - pUsbDma->USBHS_DEVDMACONTROL |= Cfg; -} - - /** - * \brief Get DMA configuration - * \param pUsbDma USBHS device DMA instance - * \return DMA control setup - */ -__STATIC_INLINE uint32_t USBHS_GetDmaConfiguration(UsbhsDevdma *pUsbDma) -{ - return (pUsbDma->USBHS_DEVDMACONTROL); -} - - - /** - * \brief Set DMA status - * \param pUsbDma USBHS device DMA instance - * \Status Set DMA status - */ -__STATIC_INLINE void USBHS_SetDmaStatus(UsbhsDevdma *pUsbDma, uint32_t Status) -{ - pUsbDma->USBHS_DEVDMASTATUS = Status; -} - - - /** - * \brief Get Dma Status - * \param pUsbDma USBHS device DMA instance - * \return Dma status - */ -__STATIC_INLINE uint32_t USBHS_GetDmaStatus(UsbhsDevdma *pUsbDma) -{ - return (pUsbDma->USBHS_DEVDMASTATUS); -} - - - /** - * \brief Get DMA buffer's count - * \param pUsbDma USBHS device DMA instance - * \return Buffer count - */ -__STATIC_INLINE uint16_t USBHS_GetDmaBuffCount(UsbhsDevdma *pUsbDma) -{ - return ( (pUsbDma->USBHS_DEVDMASTATUS & USBHS_DEVDMASTATUS_BUFF_COUNT_Msk) - >> USBHS_DEVDMASTATUS_BUFF_COUNT_Pos); -} - - - /*-------------------------------------------------------- - * =========== USB Host Functions ======================== - *---------------------------------------------------------*/ - -/** Number of USB endpoints */ -#define CHIP_USB_NUMPIPE 10 -/** Number of USB endpoints */ -#define CHIP_USB_DMA_NUMPIPE 7 - -/** Endpoints max paxcket size */ -#define CHIP_USB_PIPE_MAXPACKETSIZE(ep) \ - ((ep == 0) ? 64 : 1024) - -/** Endpoints Number of Bank */ -#define CHIP_USB_PIPE_BANKS(ep) ((ep==0)?1:((ep<=2)?3:2)) - - -#define CHIP_USB_PIPE_HBW(ep) ((((ep)>=1) &&((ep)<=2))?true:false) - -/** Endpoints DMA support */ -#define CHIP_USB_PIPE_DMA(ep) ((((ep)>=1)&&((ep)<=7))?true:false) - - /** - * \brief Sets USB host's speed to Normal , it sets to HS from FS - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE void USBHS_SetHostHighSpeed(Usbhs *pUsbhs) -{ - pUsbhs->USBHS_HSTCTRL &= ~USBHS_HSTCTRL_SPDCONF_Msk; - pUsbhs->USBHS_HSTCTRL |= USBHS_HSTCTRL_SPDCONF_NORMAL; -} - - /** - * \brief Sets USB host's speed to Low speed - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE void USBHS_SetHostLowSpeed(Usbhs *pUsbhs) -{ - pUsbhs->USBHS_HSTCTRL &= ~USBHS_HSTCTRL_SPDCONF_Msk; - pUsbhs->USBHS_HSTCTRL |= USBHS_HSTCTRL_SPDCONF_LOW_POWER; -} - - /** - * \brief Sets USB host's speed to forced Full speed - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE void USBHS_SetHostForcedFullSpeed(Usbhs *pUsbhs) -{ - pUsbhs->USBHS_HSTCTRL &= ~USBHS_HSTCTRL_SPDCONF_Msk; - pUsbhs->USBHS_HSTCTRL |= USBHS_HSTCTRL_SPDCONF_FORCED_FS; -} - - /** - * \brief Sets USB host sends reste signal on USB Bus - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE void USBHS_Reset(void) -{ - USBHS->USBHS_HSTCTRL |= USBHS_HSTCTRL_RESET; -} - - /** - * \brief Sets USB host sends reste signal on USB Bus - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE void USBHS_StopReset(void) -{ - USBHS->USBHS_HSTCTRL &= ~USBHS_HSTCTRL_RESET; -} - - /** - * \brief Sets USB host send Resume on USB bus - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE void USBHS_Resume(void) -{ - USBHS->USBHS_HSTCTRL |= USBHS_HSTCTRL_RESUME; -} - - /** - * \brief Sets USB host Enable the Generation of Start of Frame - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE void USBHS_EnableSOF(Usbhs *pUsbhs) -{ - pUsbhs->USBHS_HSTCTRL |= USBHS_HSTCTRL_SOFE; -} - - /** - * \brief Sets USB host Enable the Generation of Start of Frame - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE uint8_t USBHS_IsEnableSOF(Usbhs *pUsbhs) -{ - return (pUsbhs->USBHS_HSTCTRL & USBHS_HSTCTRL_SOFE) >> 8; -} - /** - * \brief Sets USB host disable the Generation of Start of Frame - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE void USBHS_DisableSOF(void) -{ - USBHS->USBHS_HSTCTRL &= ~USBHS_HSTCTRL_SOFE; -} - - /** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE uint32_t USBHS_GetHostStatus(Usbhs *pUsbhs, uint8_t IntType) -{ - return (pUsbhs->USBHS_HSTISR & IntType); -} - - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE uint32_t USBHS_GetHostPipeStatus(Usbhs *pUsbhs, uint8_t PipeInt) -{ - assert( PipeInt < CHIP_USB_NUMPIPE); - return (pUsbhs->USBHS_HSTISR & ( USBHS_HSTISR_PEP_0 << PipeInt) ); -} - - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE uint32_t USBHS_GetHostDmaPipeStatus(Usbhs *pUsbhs, uint8_t PipeInt) -{ - assert( PipeInt); - assert( PipeInt < CHIP_USB_DMA_NUMPIPE); - return (pUsbhs->USBHS_HSTISR & ( USBHS_HSTISR_DMA_1 << PipeInt) ); -} - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE void USBHS_ClearHostStatus(Usbhs *pUsbhs, uint32_t IntType) -{ - pUsbhs->USBHS_HSTICR = IntType; -} - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE void USBHS_SetHostStatus(Usbhs *pUsbhs, uint32_t IntType) -{ - pUsbhs->USBHS_HSTIFR = IntType; -} - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE void USBHS_SetHostDmaStatus(Usbhs *pUsbhs, uint8_t PipeInt) -{ - assert( PipeInt); - assert( PipeInt < CHIP_USB_DMA_NUMPIPE); - pUsbhs->USBHS_HSTIFR = (USBHS_HSTIFR_DMA_1 << PipeInt) ; -} - -/*** Interrupt Mask ****/ -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE uint8_t USBHS_IsHostIntEnable(Usbhs *pUsbhs, uint8_t IntType) -{ - return (pUsbhs->USBHS_HSTIMR & IntType) ; -} - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE uint32_t USBHS_IsHostPipeIntEnable(Usbhs *pUsbhs, uint8_t PipeInt) -{ - assert( PipeInt < CHIP_USB_NUMPIPE); - return ( pUsbhs->USBHS_HSTIMR & (USBHS_HSTIMR_PEP_0 << PipeInt) ); -} - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE uint32_t USBHS_IsHostDmaIntEnable(Usbhs *pUsbhs, uint8_t PipeInt) -{ - assert( PipeInt); - assert( PipeInt < CHIP_USB_DMA_NUMPIPE); - return ( pUsbhs->USBHS_HSTIMR & (USBHS_HSTIMR_DMA_1 << PipeInt) ); -} - -/*** Interrupt Disable ****/ -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE void USBHS_HostIntDisable(Usbhs *pUsbhs, uint32_t IntType) -{ - pUsbhs->USBHS_HSTIDR = IntType ; -} - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE void USBHS_HostPipeIntDisable(Usbhs *pUsbhs, uint8_t PipeInt) -{ - assert( PipeInt < CHIP_USB_NUMPIPE); - pUsbhs->USBHS_HSTIDR = (USBHS_HSTIDR_PEP_0 << PipeInt); -} - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE void USBHS_HostDmaIntDisable(Usbhs *pUsbhs, uint8_t PipeInt) -{ - assert( PipeInt); - assert( PipeInt < CHIP_USB_DMA_NUMPIPE); - pUsbhs->USBHS_HSTIDR = (USBHS_HSTIDR_DMA_1 << PipeInt) ; -} - -/*** Interrupt Enable ****/ - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE void USBHS_HostIntEnable(Usbhs *pUsbhs, uint32_t IntType) -{ - pUsbhs->USBHS_HSTIER = IntType ; -} - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE void USBHS_HostPipeIntEnable(Usbhs *pUsbhs, uint8_t PipeInt) -{ - assert( PipeInt < CHIP_USB_NUMPIPE); - pUsbhs->USBHS_HSTIER =(USBHS_HSTIER_PEP_0 << PipeInt) ; -} - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE void USBHS_HostDmaIntEnable(Usbhs *pUsbhs, uint8_t PipeInt) -{ - assert( PipeInt < CHIP_USB_DMA_NUMPIPE); - pUsbhs->USBHS_HSTIER |= (USBHS_HSTIER_DMA_1 << PipeInt); -} - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE uint16_t USBHS_HostGetSOF(void) -{ - return ( (USBHS->USBHS_HSTFNUM & USBHS_HSTFNUM_FNUM_Msk) >> USBHS_HSTFNUM_FNUM_Pos); -} - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE uint16_t USBHS_HostGetFramePos(void) -{ - return ( (USBHS->USBHS_HSTFNUM & USBHS_HSTFNUM_FLENHIGH_Msk) >> USBHS_HSTFNUM_FLENHIGH_Pos); -} - - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE uint16_t USBHS_HostGetMSOF(void) -{ - return ( (USBHS->USBHS_HSTFNUM & USBHS_HSTFNUM_MFNUM_Msk) >> USBHS_HSTFNUM_MFNUM_Pos); -} - -__STATIC_INLINE void USBHS_HostSetAddr(Usbhs *pUsbhs, uint8_t Pipe, uint8_t Addr) -{ - assert( Pipe < CHIP_USB_NUMPIPE); - if (Pipe <4) - { - pUsbhs->USBHS_HSTADDR1 |= (Addr << (8*Pipe)); - } - else if( (Pipe <8) && (Pipe >=4)) - { - pUsbhs->USBHS_HSTADDR2 |= (Addr << (8* (Pipe -4))); - } - else - { - pUsbhs->USBHS_HSTADDR3 |= (Addr << (8*(Pipe -8))); - } - -} - -__STATIC_INLINE uint8_t USBHS_HostGetAddr(Usbhs *pUsbhs, uint8_t Pipe) -{ - assert( Pipe < CHIP_USB_NUMPIPE); - if (Pipe <4) - { - return ( pUsbhs->USBHS_HSTADDR1 >> (8*Pipe)) ; - } - else if( (Pipe <8) && (Pipe >=4)) - { - return (pUsbhs->USBHS_HSTADDR2 >> (8*(Pipe -4))); - } - else - { - return (pUsbhs->USBHS_HSTADDR3 >> (8*(Pipe -8))); - } - -} - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE void USBHS_HostPipeEnable(Usbhs *pUsbhs, uint8_t Pipe) -{ - assert( Pipe < CHIP_USB_NUMPIPE); - pUsbhs->USBHS_HSTPIP |= (USBHS_HSTPIP_PEN0 << Pipe); -} - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE void USBHS_HostPipeDisable(Usbhs *pUsbhs, uint8_t Pipe) -{ - assert( Pipe < CHIP_USB_NUMPIPE); - pUsbhs->USBHS_HSTPIP &= ~(USBHS_HSTPIP_PEN0 << Pipe); -} - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE uint32_t USBHS_IsHostPipeEnable(Usbhs *pUsbhs, uint8_t Pipe) -{ - assert( Pipe < CHIP_USB_NUMPIPE); - return (pUsbhs->USBHS_HSTPIP &(USBHS_HSTPIP_PEN0 << Pipe)); -} -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE void USBHS_HostPipeReset(Usbhs *pUsbhs, uint8_t Pipe) -{ - assert( Pipe < CHIP_USB_NUMPIPE); - pUsbhs->USBHS_HSTPIP |= (USBHS_HSTPIP_PRST0 << Pipe); - pUsbhs->USBHS_HSTPIP &= ~(USBHS_HSTPIP_PRST0 << Pipe); -} - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE void USBHS_HostConfigure(Usbhs *pUsbhs, uint8_t Pipe, uint32_t pipeBank, uint8_t pipeSize, uint32_t pipeType, uint32_t pipeToken, uint8_t pipeEpNum, uint8_t PipeIntFreq) -{ - assert( Pipe < CHIP_USB_NUMPIPE); - pUsbhs->USBHS_HSTPIPCFG[Pipe] |= ( pipeBank | pipeToken | USBHS_HSTPIPCFG_PSIZE(pipeSize) | pipeType | USBHS_HSTPIPCFG_PEPNUM(pipeEpNum) | USBHS_HSTPIPCFG_INTFRQ(PipeIntFreq)); -} - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE void USBHS_HostAllocMem(Usbhs *pUsbhs, uint8_t Pipe) -{ - pUsbhs->USBHS_HSTPIPCFG[Pipe] |= USBHS_HSTPIPCFG_ALLOC; - -} - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE void USBHS_HostFreeMem(Usbhs *pUsbhs, uint8_t Pipe) -{ - pUsbhs->USBHS_HSTPIPCFG[Pipe] &= ~USBHS_HSTPIPCFG_ALLOC; - -} - - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE uint16_t USBHS_HostGetSize(Usbhs *pUsbhs, uint8_t Pipe) -{ - return (8 << ((pUsbhs->USBHS_HSTPIPCFG[Pipe] & USBHS_HSTPIPCFG_PSIZE_Msk) >> USBHS_HSTPIPCFG_PSIZE_Pos)) ; - -} - - /** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE void USBHS_HostSetToken(Usbhs *pUsbhs, uint8_t Pipe, uint32_t Token) -{ - pUsbhs->USBHS_HSTPIPCFG[Pipe] &= ~USBHS_HSTPIPCFG_PTOKEN_Msk; - pUsbhs->USBHS_HSTPIPCFG[Pipe] |= Token; - -} - - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE uint32_t USBHS_HostGetToken(Usbhs *pUsbhs, uint8_t Pipe) -{ - return (pUsbhs->USBHS_HSTPIPCFG[Pipe] & USBHS_HSTPIPCFG_PTOKEN_Msk) ; - -} - - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE void USBHS_HostSetPipeType(Usbhs *pUsbhs, uint8_t Pipe, uint8_t PipeType) -{ - pUsbhs->USBHS_HSTPIPCFG[Pipe] &= ~USBHS_HSTPIPCFG_PTYPE_Msk ; - pUsbhs->USBHS_HSTPIPCFG[Pipe] |= PipeType ; - -} - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE uint32_t USBHS_HostGetPipeType(Usbhs *pUsbhs, uint8_t Pipe ) -{ - return (pUsbhs->USBHS_HSTPIPCFG[Pipe] & USBHS_HSTPIPCFG_PTYPE_Msk) ; - -} - -__STATIC_INLINE uint8_t USBHS_GetPipeEpAddr(Usbhs *pUsbhs, uint8_t Pipe) -{ - - if( USBHS_HostGetToken(USBHS, Pipe) == USBHS_HSTPIPCFG_PTOKEN_IN) - { - return ( ((pUsbhs->USBHS_HSTPIPCFG[Pipe] & USBHS_HSTPIPCFG_PEPNUM_Msk) >> USBHS_HSTPIPCFG_PEPNUM_Pos) | 0x80); - } - else - { - return ( ((pUsbhs->USBHS_HSTPIPCFG[Pipe] & USBHS_HSTPIPCFG_PEPNUM_Msk) >> USBHS_HSTPIPCFG_PEPNUM_Pos) | 0x00) ; - } -} - - - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE void USBHS_HostEnableAutoSw(Usbhs *pUsbhs, uint8_t Pipe) -{ - pUsbhs->USBHS_HSTPIPCFG[Pipe] |= USBHS_HSTPIPCFG_AUTOSW; -} - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE void USBHS_HostDisableAutoSw(Usbhs *pUsbhs, uint8_t Pipe) -{ - pUsbhs->USBHS_HSTPIPCFG[Pipe] &= ~USBHS_HSTPIPCFG_AUTOSW; -} - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE void USBHS_HostSetIntFreq(Usbhs *pUsbhs, uint8_t Pipe, uint8_t Freq) -{ - pUsbhs->USBHS_HSTPIPCFG[Pipe] |= USBHS_HSTPIPCFG_BINTERVAL(Freq); -} - - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE void USBHS_HostEnablePing(Usbhs *pUsbhs, uint8_t Pipe) -{ - pUsbhs->USBHS_HSTPIPCFG[Pipe] |= USBHS_HSTPIPCFG_PINGEN; -} - - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE uint8_t USBHS_HostGetDataTogSeq(Usbhs *pUsbhs, uint8_t Pipe) -{ - return ( (pUsbhs->USBHS_HSTPIPISR[Pipe] & USBHS_HSTPIPISR_DTSEQ_Msk) >> USBHS_HSTPIPISR_DTSEQ_Pos ) ; -} - - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE uint8_t USBHS_HostGetNumOfBusyBank(Usbhs *pUsbhs, uint8_t Pipe) -{ - return ( (pUsbhs->USBHS_HSTPIPISR[Pipe] & USBHS_HSTPIPISR_NBUSYBK_Msk) >> USBHS_HSTPIPISR_NBUSYBK_Pos ) ; -} - - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE uint8_t USBHS_HostGetCurrentBank(Usbhs *pUsbhs, uint8_t Pipe) -{ - return ( (pUsbhs->USBHS_HSTPIPISR[Pipe] & USBHS_HSTPIPISR_CURRBK_Msk) >> USBHS_HSTPIPISR_CURRBK_Pos ) ; -} - - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE uint8_t USBHS_HostGetPipeByteCount(Usbhs *pUsbhs, uint8_t Pipe) -{ - return ( (pUsbhs->USBHS_HSTPIPISR[Pipe] & USBHS_HSTPIPISR_PBYCT_Msk) >> USBHS_HSTPIPISR_PBYCT_Pos ) ; -} - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE uint32_t USBHS_IsHostConfigOk(Usbhs *pUsbhs, uint8_t Pipe) -{ - return (pUsbhs->USBHS_HSTPIPISR[Pipe] & USBHS_DEVEPTISR_CFGOK); -} - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE uint32_t USBHS_HostGetIntTypeStatus(Usbhs *pUsbhs, uint8_t Pipe, uint32_t intType) -{ - return (pUsbhs->USBHS_HSTPIPISR[Pipe] & intType); -} - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE void USBHS_HostAckPipeIntType(Usbhs *pUsbhs, uint8_t Pipe, uint32_t intType) -{ - pUsbhs->USBHS_HSTPIPICR[Pipe] = intType; -} - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE void USBHS_HostSetPipeIntType(Usbhs *pUsbhs, uint8_t Pipe, uint32_t intType) -{ - pUsbhs->USBHS_HSTPIPIFR[Pipe] = intType; -} - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE uint32_t USBHS_IsHostPipeIntTypeEnable(Usbhs *pUsbhs, uint8_t Pipe, uint32_t intType) -{ - return ( pUsbhs->USBHS_HSTPIPIMR[Pipe] & intType); -} - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE void USBHS_HostDisablePipeIntType(Usbhs *pUsbhs, uint8_t Pipe, uint32_t intType) -{ - pUsbhs->USBHS_HSTPIPIDR[Pipe] = intType; -} - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE void USBHS_HostEnablePipeIntType(Usbhs *pUsbhs, uint8_t Pipe, uint32_t intType) -{ - pUsbhs->USBHS_HSTPIPIER[Pipe] = intType; -} - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE void USBHS_HostEnableInReq(Usbhs *pUsbhs, uint8_t Pipe) -{ - pUsbhs->USBHS_HSTPIPINRQ[Pipe] |= USBHS_HSTPIPINRQ_INMODE; -} - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE void USBHS_HostDisableInReq(Usbhs *pUsbhs, uint8_t Pipe) -{ - pUsbhs->USBHS_HSTPIPINRQ[Pipe] &= ~USBHS_HSTPIPINRQ_INMODE; -} - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE uint8_t USBHS_IsHostInReqEnable(Usbhs *pUsbhs, uint8_t Pipe) -{ - return ((pUsbhs->USBHS_HSTPIPINRQ[Pipe] & USBHS_HSTPIPINRQ_INMODE) >> 8); -} - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE void USBHS_HostInReq(Usbhs *pUsbhs, uint8_t Pipe, uint8_t InReq) -{ - pUsbhs->USBHS_HSTPIPINRQ[Pipe] = USBHS_HSTPIPINRQ_INRQ(InReq-1); -} - - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE void USBHS_HostSetErr(Usbhs *pUsbhs, uint8_t Pipe, uint8_t Err) -{ - pUsbhs->USBHS_HSTPIPERR[Pipe] |= Err; -} - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE uint8_t USBHS_HostGetErr(Usbhs *pUsbhs, uint8_t Pipe, uint8_t Err) -{ - return (pUsbhs->USBHS_HSTPIPERR[Pipe] & Err); -} - - -/** - * \brief Gets USB host interrupt status - * \param pUsbhs USBHS host instance - */ -__STATIC_INLINE void USBHS_HostClearErr(Usbhs *pUsbhs, uint8_t Pipe, uint8_t Err) -{ - pUsbhs->USBHS_HSTPIPERR[Pipe] = Err; -} - - -__STATIC_INLINE uint8_t USBHS_GetInterruptPipeNum(void) -{ - uint32_t status = USBHS->USBHS_HSTISR; - uint32_t mask = USBHS->USBHS_HSTIMR; - return ctz(((status & mask) >> 8) | (1 << USBHS_EPT_NUM)); -} - -static inline uint8_t USBHS_GetInterruptPipeDmaNum(void) -{ - uint32_t status = USBHS->USBHS_HSTISR; - uint32_t mask = USBHS->USBHS_HSTIMR; - return (ctz(((status & mask) >> 25) | (1 << (USBHS_EPT_NUM-1))) + 1); -} - /*-------------------------------------------------------- - * =========== USB Host's pipe DMA functions ========= - *---------------------------------------------------------*/ - - /** - * \brief Sets DMA next descriptor address - * \param pUsbDma USBHS device DMA instance - * \param Desc NDA addrs - */ -__STATIC_INLINE void USBHS_SetHostDmaNDA(UsbhsHstdma *pUsbDma, uint32_t Desc) -{ - pUsbDma->USBHS_HSTDMANXTDSC = Desc; -} - - /** - * \brief Gets DMA next descriptor address - * \param pUsbDma USBHS device DMA instance - * \return Next DMA descriptor - */ -__STATIC_INLINE uint32_t USBHS_GetHostDmaNDA(UsbhsHstdma *pUsbDma) -{ - return (pUsbDma->USBHS_HSTDMANXTDSC); -} - - /** - * \brief Sets USBHS's DMA Buffer addresse - * \param pUsbDma USBHS device DMA instance - * \param Addr DMA's buffer Addrs - */ -__STATIC_INLINE void USBHS_SetHostDmaBuffAdd(UsbhsHstdma *pUsbDma, uint32_t Addr) -{ - pUsbDma->USBHS_HSTDMAADDRESS = Addr; -} - - - /** - * \brief Gets USBHS's DMA Buffer addresse - * \param pUsbDma USBHS device DMA instance - * \return DMA addrs - */ -__STATIC_INLINE uint32_t USBHS_GetHostDmaBuffAdd(UsbhsHstdma *pUsbDma) -{ - return (pUsbDma->USBHS_HSTDMAADDRESS); -} - - /** - * \brief Setup the USBHS DMA - * \param pUsbDma USBHS device DMA instance - * \param Cfg DMA's configuration - */ -__STATIC_INLINE void USBHS_HostConfigureDma(UsbhsHstdma *pUsbDma, uint32_t Cfg) -{ - pUsbDma->USBHS_HSTDMACONTROL |= Cfg; -} - - /** - * \brief Get DMA configuration - * \param pUsbDma USBHS device DMA instance - * \return DMA control setup - */ -__STATIC_INLINE uint32_t USBHS_GetHostDmaConfiguration(UsbhsHstdma *pUsbDma) -{ - return (pUsbDma->USBHS_HSTDMACONTROL); -} - - - /** - * \brief Set DMA status - * \param pUsbDma USBHS device DMA instance - * \Status Set DMA status - */ -__STATIC_INLINE void USBHS_SetHostPipeDmaStatus(UsbhsHstdma *pUsbDma, uint32_t Status) -{ - pUsbDma->USBHS_HSTDMASTATUS = Status; -} - - - /** - * \brief Get Dma Status - * \param pUsbDma USBHS device DMA instance - * \return Dma status - */ -__STATIC_INLINE uint32_t USBHS_GetHostPipeDmaStatus(UsbhsHstdma *pUsbDma) -{ - return (pUsbDma->USBHS_HSTDMASTATUS); -} - -/**@}*/ -#endif /* #ifndef USBHS_H */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/video.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/video.h deleted file mode 100644 index 6976d0f4..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/video.h +++ /dev/null @@ -1,80 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2013, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -#ifndef _VIDEO_H -#define _VIDEO_H - -/*---------------------------------------------------------------------------- - * Definitions - *----------------------------------------------------------------------------*/ -/** Type of video is YUV */ -#define YUV 0 -/** Type of video is RGB */ -#define RGB 1 - -/*---------------------------------------------------------------------------- - * Type - *----------------------------------------------------------------------------*/ -typedef struct _isi_Video -{ - /** LCD Vertical Size */ - uint32_t lcd_vsize; - /** LCD Horizontal Size*/ - uint32_t lcd_hsize; - /** LCD Number of Bit Per Pixel*/ - uint32_t lcd_nbpp; - /** LCD Frame Buffer Address*/ - uint32_t lcd_fb_addr; - /** Base address for the frame buffer descriptors list*/ - uint32_t Isi_fbd_base; - /** Start of Line Delay*/ - uint32_t Hblank; - /** Start of frame Delay */ - uint32_t Vblank; - /** Vertical size of the Image sensor [0..2047]*/ - uint32_t codec_vsize; - /** Horizontal size of the Image sensor [0..2047]*/ - uint32_t codec_hsize; - /** Base address for codec DMA*/ - uint32_t codec_fb_addr; - /** Base address for the frame buffer descriptors list*/ - uint32_t codec_fbd_base; - /** Buffer index */ - uint32_t IsiPrevBuffIndex; - /** Type of video */ - uint8_t rgb_or_yuv; -}isi_Video, *pIsi_Video; - -/*---------------------------------------------------------------------------- - * Exported functions - *----------------------------------------------------------------------------*/ -extern void VIDEO_Ycc2Rgb(uint8_t *ycc, uint16_t *rgb, uint32_t len); - -#endif - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/wdt.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/wdt.h deleted file mode 100644 index ee5b7d2c..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/wdt.h +++ /dev/null @@ -1,74 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2012, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** - * \file - * - * \section Purpose - * Interface for Watchdog Timer (WDT) controller. - * - * \section Usage - * -# Enable watchdog with given mode using \ref WDT_Enable(). - * -# Disable watchdog using \ref WDT_Disable() - * -# Restart the watchdog using \ref WDT_Restart(). - * -# Get watchdog status using \ref WDT_GetStatus(). - * -# Calculate watchdog period value using \ref WDT_GetPeriod(). - */ - -#ifndef _WDT_ -#define _WDT_ - -#include "chip.h" - -#include - -#ifdef __cplusplus - extern "C" { -#endif - -/*---------------------------------------------------------------------------- - * Exported functions - *----------------------------------------------------------------------------*/ - -extern void WDT_Enable( Wdt* pWDT, uint32_t dwMode ) ; - -extern void WDT_Disable( Wdt* pWDT ) ; - -extern void WDT_Restart( Wdt* pWDT ) ; - -extern uint32_t WDT_GetStatus( Wdt* pWDT ) ; - -extern uint32_t WDT_GetPeriod( uint32_t dwMs ) ; - -#ifdef __cplusplus -} -#endif - -#endif /* #ifndef _WDT_ */ - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/xdma_hardware_interface.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/xdma_hardware_interface.h deleted file mode 100644 index f9e47626..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/xdma_hardware_interface.h +++ /dev/null @@ -1,58 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2013, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -#ifndef _XDMAD_IF_H -#define _XDMAD_IF_H - -/*---------------------------------------------------------------------------- - * Includes - *----------------------------------------------------------------------------*/ - -#include "chip.h" -/*---------------------------------------------------------------------------- - * Types - *----------------------------------------------------------------------------*/ - -/** DMA hardware interface */ -typedef struct _XdmaHardwareInterface { - uint8_t bXdmac; /**< DMA Controller number */ - uint32_t bPeriphID; /**< Peripheral ID */ - uint8_t bTransfer; /**< Transfer type 0: Tx, 1 :Rx*/ - uint8_t bIfID; /**< DMA Interface ID */ -} XdmaHardwareInterface; - -/*---------------------------------------------------------------------------- - * Exported functions - *----------------------------------------------------------------------------*/ - -extern uint8_t XDMAIF_IsValidatedPeripherOnDma( uint8_t bPeriphID); -extern uint8_t XDMAIF_Get_ChannelNumber (uint8_t bPeriphID, uint8_t bTransfer); - -#endif //#ifndef _XDMAD_IF_H - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/xdmac.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/xdmac.h deleted file mode 100644 index ecd3496e..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/xdmac.h +++ /dev/null @@ -1,177 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2014, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/** \file */ - -/** \addtogroup dmac_module Working with DMAC - * - * \section Usage - *
    - *
  • Enable or disable the a DMAC controller with DMAC_Enable() and or - * DMAC_Disable().
  • - *
  • Enable or disable %Dma interrupt using DMAC_EnableIt()or - * DMAC_DisableIt().
  • - *
  • Get %Dma interrupt status by DMAC_GetStatus() and - * DMAC_GetInterruptMask().
  • - *
  • Enable or disable specified %Dma channel with DMAC_EnableChannel() or - * DMAC_DisableChannel().
  • - *
  • Get %Dma channel status by DMAC_GetChannelStatus().
  • - *
  • ControlA and ControlB register is set by DMAC_SetControlA() and - * DMAC_SetControlB().
  • - *
  • Configure source and/or destination start address with - * DMAC_SetSourceAddr() and/or DMAC_SetDestinationAddr().
  • - *
  • Set %Dma descriptor address using DMAC_SetDescriptorAddr().
  • - *
  • Set source transfer buffer size with DMAC_SetBufferSize().
  • - *
  • Configure source and/or destination Picture-In-Picuture mode with - * DMAC_SetSourcePip() and/or DMAC_SetDestPip().
  • - *
- * - * For more accurate information, please look at the DMAC section of the - * Datasheet. - * - * \sa \ref dmad_module - * - * Related files :\n - * \ref dmac.c\n - * \ref dmac.h.\n - * - */ - -#ifndef DMAC_H -#define DMAC_H -/**@{*/ - -/*------------------------------------------------------------------------------ - * Headers - *----------------------------------------------------------------------------*/ - -#include "chip.h" - -#include -#include - -/*------------------------------------------------------------------------------ - * Definitions - *----------------------------------------------------------------------------*/ - -/** \addtogroup dmac_defines DMAC Definitions - * @{ - */ -/** Number of DMA channels */ -#define XDMAC_CONTROLLER_NUM 1 -/** Number of DMA channels */ -#define XDMAC_CHANNEL_NUM 24 -/** Max DMA single transfer size */ -#define XDMAC_MAX_BT_SIZE 0xFFFF -/** @}*/ - -/*---------------------------------------------------------------------------- - * Macro - *----------------------------------------------------------------------------*/ -#define XDMA_GET_DATASIZE(size) ((size==0)? XDMAC_CC_DWIDTH_BYTE : \ - ((size==1)? XDMAC_CC_DWIDTH_HALFWORD : \ - (XDMAC_CC_DWIDTH_WORD ))) -#define XDMA_GET_CC_SAM(s) ((s==0)? XDMAC_CC_SAM_FIXED_AM : \ - ((s==1)? XDMAC_CC_SAM_INCREMENTED_AM : \ - ((s==2)? XDMAC_CC_SAM_UBS_AM : \ - XDMAC_CC_SAM_UBS_DS_AM ))) -#define XDMA_GET_CC_DAM(d) ((d==0)? XDMAC_CC_DAM_FIXED_AM : \ - ((d==1)? XDMAC_CC_DAM_INCREMENTED_AM : \ - ((d==2)? XDMAC_CC_DAM_UBS_AM : \ - XDMAC_CC_DAM_UBS_DS_AM ))) -#define XDMA_GET_CC_MEMSET(m) ((m==0)? XDMAC_CC_MEMSET_NORMAL_MODE : \ - XDMAC_CC_MEMSET_HW_MODE) - -/*------------------------------------------------------------------------------ - * Global functions - *----------------------------------------------------------------------------*/ -/** \addtogroup dmac_functions - * @{ - */ - -#ifdef __cplusplus - extern "C" { -#endif - -extern uint32_t XDMAC_GetType( Xdmac *pXdmac); -extern uint32_t XDMAC_GetConfig( Xdmac *pXdmac); -extern uint32_t XDMAC_GetArbiter( Xdmac *pXdmac); -extern void XDMAC_EnableGIt (Xdmac *pXdmac, uint8_t dwInteruptMask ); -extern void XDMAC_DisableGIt (Xdmac *pXdmac, uint8_t dwInteruptMask ); -extern uint32_t XDMAC_GetGItMask( Xdmac *pXdmac ); -extern uint32_t XDMAC_GetGIsr( Xdmac *pXdmac ); -extern uint32_t XDMAC_GetMaskedGIsr( Xdmac *pXdmac ); -extern void XDMAC_EnableChannel( Xdmac *pXdmac, uint8_t channel ); -extern void XDMAC_EnableChannels( Xdmac *pXdmac, uint32_t bmChannels ); -extern void XDMAC_DisableChannel( Xdmac *pXdmac, uint8_t channel ); -extern void XDMAC_DisableChannels( Xdmac *pXdmac, uint32_t bmChannels ); -extern uint32_t XDMAC_GetGlobalChStatus(Xdmac *pXdmac); -extern void XDMAC_SuspendReadChannel( Xdmac *pXdmac, uint8_t channel ); -extern void XDMAC_SuspendWriteChannel( Xdmac *pXdmac, uint8_t channel ); -extern void XDMAC_SuspendReadWriteChannel( Xdmac *pXdmac, uint8_t channel ); -extern void XDMAC_ResumeReadWriteChannel( Xdmac *pXdmac, uint8_t channel ); -extern void XDMAC_SoftwareTransferReq(Xdmac *pXdmac, uint8_t channel); -extern uint32_t XDMAC_GetSoftwareTransferStatus(Xdmac *pXdmac); -extern void XDMAC_SoftwareFlushReq(Xdmac *pXdmac, uint8_t channel); -extern void XDMAC_EnableChannelIt (Xdmac *pXdmac, uint8_t channel, - uint8_t dwInteruptMask ); -extern void XDMAC_DisableChannelIt (Xdmac *pXdmac, uint8_t channel, - uint8_t dwInteruptMask ); -extern uint32_t XDMAC_GetChannelItMask (Xdmac *pXdmac, uint8_t channel); -extern uint32_t XDMAC_GetChannelIsr (Xdmac *pXdmac, uint8_t channel); -extern uint32_t XDMAC_GetMaskChannelIsr (Xdmac *pXdmac, uint8_t channel); -extern void XDMAC_SetSourceAddr(Xdmac *pXdmac, uint8_t channel, uint32_t addr); -extern void XDMAC_SetDestinationAddr(Xdmac *pXdmac, uint8_t channel, - uint32_t addr); -extern void XDMAC_SetDescriptorAddr(Xdmac *pXdmac, uint8_t channel, - uint32_t addr, uint8_t ndaif); -extern void XDMAC_SetDescriptorControl(Xdmac *pXdmac, uint8_t channel, - uint8_t config); -extern void XDMAC_SetMicroblockControl(Xdmac *pXdmac, uint8_t channel, - uint32_t ublen); -extern void XDMAC_SetBlockControl(Xdmac *pXdmac, uint8_t channel, - uint16_t blen); -extern void XDMAC_SetChannelConfig(Xdmac *pXdmac, uint8_t channel, - uint32_t config); -extern uint32_t XDMAC_GetChannelConfig(Xdmac *pXdmac, uint8_t channel); -extern void XDMAC_SetDataStride_MemPattern(Xdmac *pXdmac, uint8_t channel, - uint32_t dds_msp); -extern void XDMAC_SetSourceMicroBlockStride(Xdmac *pXdmac, uint8_t channel, - uint32_t subs); -extern void XDMAC_SetDestinationMicroBlockStride(Xdmac *pXdmac, uint8_t channel, - uint32_t dubs); -extern uint32_t XDMAC_GetChDestinationAddr(Xdmac *pXdmac, uint8_t channel); -#ifdef __cplusplus -} -#endif - -/** @}*/ -/**@}*/ -#endif //#ifndef DMAC_H - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/xdmad.h b/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/xdmad.h deleted file mode 100644 index 877f20e7..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/libchip_samv7/include/xdmad.h +++ /dev/null @@ -1,260 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2013, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -#ifndef _XDMAD_H -#define _XDMAD_H - - -/*---------------------------------------------------------------------------- - * Includes - *----------------------------------------------------------------------------*/ - -#include "chip.h" -#include - - -/** \addtogroup dmad_defines DMA Driver Defines - @{*/ -/*---------------------------------------------------------------------------- - * Consts - *----------------------------------------------------------------------------*/ -#define XDMAD_TRANSFER_MEMORY 0xFF /**< DMA transfer from or to memory */ -#define XDMAD_ALLOC_FAILED 0xFFFF /**< Channel allocate failed */ - -#define XDMAD_TRANSFER_TX 0 -#define XDMAD_TRANSFER_RX 1 - -/* XDMA_MBR_UBC */ -#define XDMA_UBC_NDE (0x1u << 24) -#define XDMA_UBC_NDE_FETCH_DIS (0x0u << 24) -#define XDMA_UBC_NDE_FETCH_EN (0x1u << 24) -#define XDMA_UBC_NSEN (0x1u << 25) -#define XDMA_UBC_NSEN_UNCHANGED (0x0u << 25) -#define XDMA_UBC_NSEN_UPDATED (0x1u << 25) -#define XDMA_UBC_NDEN (0x1u << 26) -#define XDMA_UBC_NDEN_UNCHANGED (0x0u << 26) -#define XDMA_UBC_NDEN_UPDATED (0x1u << 26) -#define XDMA_UBC_NVIEW_Pos 27 -#define XDMA_UBC_NVIEW_Msk (0x3u << XDMA_UBC_NVIEW_Pos) -#define XDMA_UBC_NVIEW_NDV0 (0x0u << XDMA_UBC_NVIEW_Pos) -#define XDMA_UBC_NVIEW_NDV1 (0x1u << XDMA_UBC_NVIEW_Pos) -#define XDMA_UBC_NVIEW_NDV2 (0x2u << XDMA_UBC_NVIEW_Pos) -#define XDMA_UBC_NVIEW_NDV3 (0x3u << XDMA_UBC_NVIEW_Pos) - -/*---------------------------------------------------------------------------- - * MACRO - *----------------------------------------------------------------------------*/ - -/** @}*/ - -/*---------------------------------------------------------------------------- - * Types - *----------------------------------------------------------------------------*/ -/** \addtogroup dmad_structs DMA Driver Structs - @{*/ - -/** DMA status or return code */ -typedef enum _XdmadStatus { - XDMAD_OK = 0, /**< Operation is successful */ - XDMAD_PARTIAL_DONE, - XDMAD_DONE, - XDMAD_BUSY, /**< Channel occupied or transfer not finished */ - XDMAD_ERROR, /**< Operation failed */ - XDMAD_CANCELED /**< Operation cancelled */ -} eXdmadStatus, eXdmadRC; - -/** DMA state for channel */ -typedef enum _XdmadState { - XDMAD_STATE_FREE = 0, /**< Free channel */ - XDMAD_STATE_ALLOCATED, /**< Allocated to some peripheral */ - XDMAD_STATE_START, /**< DMA started */ - XDMAD_STATE_IN_XFR, /**< DMA in transferring */ - XDMAD_STATE_DONE, /**< DMA transfer done */ - XDMAD_STATE_HALTED, /**< DMA transfer stopped */ -} eXdmadState; - -/** DMA Programming state for channel */ -typedef enum _XdmadProgState { - XDMAD_SINGLE= 0, - XDMAD_MULTI, - XDMAD_LLI, -} eXdmadProgState; - -/** DMA transfer callback */ -typedef void (*XdmadTransferCallback)(uint32_t Channel, void* pArg); - -/** DMA driver channel */ -typedef struct _XdmadChannel { - XdmadTransferCallback fCallback; /**< Callback */ - void* pArg; /**< Callback argument */ - uint8_t bIrqOwner; /**< Uses DMA handler or external one */ - uint8_t bSrcPeriphID; /**< HW ID for source */ - uint8_t bDstPeriphID; /**< HW ID for destination */ - uint8_t bSrcTxIfID; /**< DMA Tx Interface ID for source */ - uint8_t bSrcRxIfID; /**< DMA Rx Interface ID for source */ - uint8_t bDstTxIfID; /**< DMA Tx Interface ID for destination */ - uint8_t bDstRxIfID; /**< DMA Rx Interface ID for destination */ - volatile uint8_t state; /**< DMA channel state */ -} sXdmadChannel; - -/** DMA driver instance */ -typedef struct _Xdmad { - Xdmac *pXdmacs; - sXdmadChannel XdmaChannels[XDMACCHID_NUMBER]; - uint8_t numControllers; - uint8_t numChannels; - uint8_t pollingMode; - uint8_t pollingTimeout; - uint8_t xdmaMutex; -} sXdmad; - -typedef struct _XdmadCfg { - /** Microblock Control Member. */ - uint32_t mbr_ubc; - /** Source Address Member. */ - uint32_t mbr_sa; - /** Destination Address Member. */ - uint32_t mbr_da; - /** Configuration Register. */ - uint32_t mbr_cfg; - /** Block Control Member. */ - uint32_t mbr_bc; - /** Data Stride Member. */ - uint32_t mbr_ds; - /** Source Microblock Stride Member. */ - uint32_t mbr_sus; - /** Destination Microblock Stride Member. */ - uint32_t mbr_dus; -} sXdmadCfg; - -/** \brief Structure for storing parameters for DMA view0 that can be - * performed by the DMA Master transfer.*/ -typedef struct _LinkedListDescriporView0 -{ - /** Next Descriptor Address number. */ - uint32_t mbr_nda; - /** Microblock Control Member. */ - uint32_t mbr_ubc; - /** Transfer Address Member. */ - uint32_t mbr_ta; -}LinkedListDescriporView0; - -/** \brief Structure for storing parameters for DMA view1 that can be - * performed by the DMA Master transfer.*/ -typedef struct _LinkedListDescriporView1 -{ - /** Next Descriptor Address number. */ - uint32_t mbr_nda; - /** Microblock Control Member. */ - uint32_t mbr_ubc; - /** Source Address Member. */ - uint32_t mbr_sa; - /** Destination Address Member. */ - uint32_t mbr_da; -}LinkedListDescriporView1; - -/** \brief Structure for storing parameters for DMA view2 that can be - * performed by the DMA Master transfer.*/ -typedef struct _LinkedListDescriporView2 -{ - /** Next Descriptor Address number. */ - uint32_t mbr_nda; - /** Microblock Control Member. */ - uint32_t mbr_ubc; - /** Source Address Member. */ - uint32_t mbr_sa; - /** Destination Address Member. */ - uint32_t mbr_da; - /** Configuration Register. */ - uint32_t mbr_cfg; -}LinkedListDescriporView2; - -/** \brief Structure for storing parameters for DMA view3 that can be - * performed by the DMA Master transfer.*/ -typedef struct _LinkedListDescriporView3 -{ - /** Next Descriptor Address number. */ - uint32_t mbr_nda; - /** Microblock Control Member. */ - uint32_t mbr_ubc; - /** Source Address Member. */ - uint32_t mbr_sa; - /** Destination Address Member. */ - uint32_t mbr_da; - /** Configuration Register. */ - uint32_t mbr_cfg; - /** Block Control Member. */ - uint32_t mbr_bc; - /** Data Stride Member. */ - uint32_t mbr_ds; - /** Source Microblock Stride Member. */ - uint32_t mbr_sus; - /** Destination Microblock Stride Member. */ - uint32_t mbr_dus; -}LinkedListDescriporView3; - -/** @}*/ - -/*---------------------------------------------------------------------------- - * Exported functions - *----------------------------------------------------------------------------*/ -/** \addtogroup dmad_functions DMA Driver Functions - @{*/ -extern void XDMAD_Initialize( sXdmad *pXdmad, - uint8_t bPollingMode ); - -extern void XDMAD_Handler( sXdmad *pDmad); - -extern uint32_t XDMAD_AllocateChannel( sXdmad *pXdmad, - uint8_t bSrcID, uint8_t bDstID); -extern eXdmadRC XDMAD_FreeChannel( sXdmad *pXdmad, uint32_t dwChannel ); - -extern eXdmadRC XDMAD_ConfigureTransfer( sXdmad *pXdmad, - uint32_t dwChannel, - sXdmadCfg *pXdmaParam, - uint32_t dwXdmaDescCfg, - uint32_t dwXdmaDescAddr, - uint32_t dwXdmaIntEn); - -extern eXdmadRC XDMAD_PrepareChannel( sXdmad *pXdmad, uint32_t dwChannel); - -extern eXdmadRC XDMAD_IsTransferDone( sXdmad *pXdmad, uint32_t dwChannel ); - -extern eXdmadRC XDMAD_StartTransfer( sXdmad *pXdmad, uint32_t dwChannel ); - -extern eXdmadRC XDMAD_SetCallback( sXdmad *pXdmad, - uint32_t dwChannel, - XdmadTransferCallback fCallback, - void* pArg ); - -extern eXdmadRC XDMAD_StopTransfer( sXdmad *pXdmad, uint32_t dwChannel ); -/** @}*/ -/**@}*/ -#endif //#ifndef _XDMAD_H - diff --git a/ports_module/cortex_m7/iar/example_build/libraries/libraries.a b/ports_module/cortex_m7/iar/example_build/libraries/libraries.a deleted file mode 100644 index 1e67e3154c46600edd1fa57de07a31e9b36f1dd5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2478926 zcmeEv31D1Rx&OKM&SY)UbZ=>Crwh=QHqG9YwON{W+NMpDv;~YzCNq;{>||z`nQW{@ zK@bEHQ4m1^dHO`;f!lKd!HuUpL|pOV3i=Sir66iS9{vBmv)p^`O$t+i3jTYOJLi1g z`ObH~@0{+2e->jHr)9wdGn>VUvi-B?ROxOz(% zvzi#&^a1C-_$9_(#cfPIgW31s9n5%*Zg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ports_module/cortex_m7/iar/example_build/libraries/utils/md5/md5.h deleted file mode 100644 index 698c995d..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/utils/md5/md5.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - Copyright (C) 1999, 2002 Aladdin Enterprises. All rights reserved. - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - L. Peter Deutsch - ghost@aladdin.com - - */ -/* $Id: md5.h,v 1.4 2002/04/13 19:20:28 lpd Exp $ */ -/* - Independent implementation of MD5 (RFC 1321). - - This code implements the MD5 Algorithm defined in RFC 1321, whose - text is available at - http://www.ietf.org/rfc/rfc1321.txt - The code is derived from the text of the RFC, including the test suite - (section A.5) but excluding the rest of Appendix A. It does not include - any code or documentation that is identified in the RFC as being - copyrighted. - - The original and principal author of md5.h is L. Peter Deutsch - . Other authors are noted in the change history - that follows (in reverse chronological order): - - 2002-04-13 lpd Removed support for non-ANSI compilers; removed - references to Ghostscript; clarified derivation from RFC 1321; - now handles byte order either statically or dynamically. - 1999-11-04 lpd Edited comments slightly for automatic TOC extraction. - 1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5); - added conditionalization for C++ compilation from Martin - Purschke . - 1999-05-03 lpd Original version. - */ - -#ifndef md5_INCLUDED -# define md5_INCLUDED - -/* - * This package supports both compile-time and run-time determination of CPU - * byte order. If ARCH_IS_BIG_ENDIAN is defined as 0, the code will be - * compiled to run only on little-endian CPUs; if ARCH_IS_BIG_ENDIAN is - * defined as non-zero, the code will be compiled to run only on big-endian - * CPUs; if ARCH_IS_BIG_ENDIAN is not defined, the code will be compiled to - * run on either big- or little-endian CPUs, but will run slightly less - * efficiently on either one than if ARCH_IS_BIG_ENDIAN is defined. - */ - -typedef unsigned char md5_byte_t; /* 8-bit byte */ -typedef unsigned int md5_word_t; /* 32-bit word */ - -/* Define the state of the MD5 Algorithm. */ -typedef struct md5_state_s { - md5_word_t count[2]; /* message length in bits, lsw first */ - md5_word_t abcd[4]; /* digest buffer */ - md5_byte_t buf[64]; /* accumulate block */ -} md5_state_t; - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* Initialize the algorithm. */ -void md5_init(md5_state_t *pms); - -/* Append a string to the message. */ -void md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes); - -/* Finish the message and return the digest. */ -void md5_finish(md5_state_t *pms, md5_byte_t digest[16]); - -#ifdef __cplusplus -} /* end extern "C" */ -#endif - -#endif /* md5_INCLUDED */ diff --git a/ports_module/cortex_m7/iar/example_build/libraries/utils/utility.h b/ports_module/cortex_m7/iar/example_build/libraries/utils/utility.h deleted file mode 100644 index e695376a..00000000 --- a/ports_module/cortex_m7/iar/example_build/libraries/utils/utility.h +++ /dev/null @@ -1,111 +0,0 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2014, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -#ifndef UTILITY_H -#define UTILITY_H - -#include "chip.h" - - - -#define RESET_CYCLE_COUNTER() do { \ - CoreDebug->DEMCR = CoreDebug_DEMCR_TRCENA_Msk; \ - __DSB(); DWT->LAR = 0xC5ACCE55; __DSB(); \ - DWT->CTRL &= ~DWT_CTRL_CYCCNTENA_Msk; \ - DWT->CYCCNT = 0; \ - DWT->CTRL = DWT_CTRL_CYCCNTENA_Msk; \ - }while(0) - -#define GET_CYCLE_COUNTER(x) x=DWT->CYCCNT; - -#define LockMutex(mut, timeout) get_lock(&mut, 1, &timeout) - -#define ReleaseMutex(mut) free_lock(&mut) - -#define GetResource(mut, max, timeout) get_lock(&mut, max, &timeout) - -#define FreeResource(mut) free_lock(&mut) - - -__STATIC_INLINE uint8_t Is_LockFree(volatile uint8_t *Lock_Variable) -{ - /* return Variable value*/ - return __LDREXB(Lock_Variable); - -} - -__STATIC_INLINE uint8_t get_lock(volatile uint8_t *Lock_Variable, const uint8_t maxValue, volatile uint32_t *pTimeout) -{ - while (*pTimeout) - { - if(__LDREXB(Lock_Variable) < maxValue) - { - /* Set the Variable */ - while( __STREXB(((*Lock_Variable) + 1), Lock_Variable) ) - { - if(!(*pTimeout)--) - { - return 1; // quit if timeout - } - } - /* Memory access barrier */ - __DMB(); - TRACE_DEBUG("Mutex locked "); - return 0; - } - - ((*pTimeout)--); - } - return 1; -} - - - -__STATIC_INLINE uint8_t free_lock(volatile uint8_t *Lock_Variable) -{ - /* Memory access barrier Ensure memory operations completed before releasing lock */ - __DSB(); - if(__LDREXB(Lock_Variable)) - { - __STREXB( ((*Lock_Variable) - 1), Lock_Variable); - TRACE_DEBUG("Mutex freed "); - __DSB(); - __DMB(); // Ensure memory operations completed before - return 0; - } - else - { - return 1; - } - - -} - - -#endif /* UTILITY_H */ diff --git a/ports_module/cortex_m7/iar/inc/tx_port.h b/ports_module/cortex_m7/iar/inc/tx_port.h index 4bcad5d2..70975f91 100644 --- a/ports_module/cortex_m7/iar/inc/tx_port.h +++ b/ports_module/cortex_m7/iar/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h Cortex-M7/IAR */ -/* 6.1.9 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -48,6 +48,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 10-15-2021 Scott Larson Initial Version 6.1.9 */ +/* 04-25-2022 Scott Larson Modified comments and added */ +/* volatile to registers, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -127,14 +130,14 @@ typedef unsigned short USHORT; For example, if the time source is at the address 0x0a800024 and is 16-bits in size, the clock source constants would be: -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0x0a800024) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0x0a800024) #define TX_TRACE_TIME_MASK 0x0000FFFFUL */ #ifndef TX_MISRA_ENABLE #ifndef TX_TRACE_TIME_SOURCE -#define TX_TRACE_TIME_SOURCE *((ULONG *) 0xE0001004) +#define TX_TRACE_TIME_SOURCE *((volatile ULONG *) 0xE0001004) #endif #else ULONG _tx_misra_time_stamp_get(VOID); @@ -325,7 +328,7 @@ void _tx_misra_vfp_touch(void); else \ { \ ULONG _tx_fpccr; \ - _tx_fpccr = *((ULONG *) 0xE000EF34); \ + _tx_fpccr = *((volatile ULONG *) 0xE000EF34); \ _tx_fpccr = _tx_fpccr & ((ULONG) 0x01); \ if (_tx_fpccr == ((ULONG) 0x01)) \ { \ @@ -476,7 +479,7 @@ static void _tx_thread_system_return_inline(void) __istate_t interrupt_save; /* Set PendSV to invoke ThreadX scheduler. */ - *((ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); + *((volatile ULONG *) 0xE000ED04) = ((ULONG) 0x10000000); if (__get_IPSR() == 0) { interrupt_save = __get_interrupt_state(); diff --git a/ports_module/cortex_m7/iar/module_manager/src/tx_thread_schedule.s b/ports_module/cortex_m7/iar/module_manager/src/tx_thread_schedule.s index 9162c7ab..2d66551f 100644 --- a/ports_module/cortex_m7/iar/module_manager/src/tx_thread_schedule.s +++ b/ports_module/cortex_m7/iar/module_manager/src/tx_thread_schedule.s @@ -36,7 +36,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_schedule Cortex-M7/IAR */ -/* 6.1.9 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* Scott Larson, Microsoft Corporation */ @@ -63,13 +63,15 @@ /* */ /* _tx_initialize_kernel_enter ThreadX entry function */ /* _tx_thread_system_return Return to system from thread */ -/* _tx_thread_context_restore Restore thread's context */ /* */ /* RELEASE HISTORY */ /* */ /* DATE NAME DESCRIPTION */ /* */ /* 10-15-2021 Scott Larson Initial Version 6.1.9 */ +/* 04-25-2022 Scott Larson Optimized MPU configuration, */ +/* added BASEPRI support, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_schedule(VOID) @@ -125,8 +127,12 @@ __tx_wait_here: MemManage_Handler: BusFault_Handler: UsageFault_Handler: - +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ /* Now pickup and store all the fault related information. */ @@ -209,7 +215,12 @@ UsageFault_Handler: LDR r1, =0x10000000 // Set PENDSVSET bit STR r1, [r0] // Store ICSR DSB // Wait for memory access to complete +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts +#endif MOV lr, #0xFFFFFFFD // Load exception return code BX lr // Return from exception @@ -227,12 +238,22 @@ __tx_ts_handler: #if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) /* Call the thread exit function to indicate the thread is no longer executing. */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif /* TX_PORT_USE_BASEPRI */ PUSH {r0, lr} // Save LR (and r0 just for alignment) BL _tx_execution_thread_exit // Call the thread exit function POP {r0, lr} // Recover LR +#ifdef TX_PORT_USE_BASEPRI + MOV r0, 0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r0 +#else CPSIE i // Enable interrupts -#endif +#endif /* TX_PORT_USE_BASEPRI */ +#endif /* EXECUTION PROFILE */ LDR r0, =_tx_thread_current_ptr // Build current thread pointer address LDR r2, =_tx_thread_execute_ptr // Build execute thread pointer address @@ -277,7 +298,12 @@ __tx_ts_new: /* Now we are looking for a new thread to execute! */ +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Is there another thread ready to execute? CBNZ r1, __tx_ts_restore // Yes, schedule it @@ -286,7 +312,12 @@ __tx_ts_new: are disabled to allow use of WFI for waiting for a thread to arrive. */ __tx_ts_wait: +#ifdef TX_PORT_USE_BASEPRI + LDR r1, =TX_PORT_BASEPRI // Mask interrupt priorities =< TX_PORT_BASEPRI + MSR BASEPRI, r1 +#else CPSID i // Disable interrupts +#endif LDR r1, [r2] // Pickup the next thread to execute pointer CBNZ r1, __tx_ts_ready // If non-NULL, a new thread is ready! #ifdef TX_ENABLE_WFI @@ -294,7 +325,12 @@ __tx_ts_wait: WFI // Wait for interrupt ISB // Ensure pipeline is flushed #endif +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif B __tx_ts_wait // Loop to continue waiting /* At this point, we have a new thread ready to go. Clear any newly pended PendSV - since we are @@ -311,7 +347,12 @@ __tx_ts_restore: and enable interrupts. */ STR r1, [r0] // Setup the current thread pointer to the new thread +#ifdef TX_PORT_USE_BASEPRI + MOV r4, #0 // Disable BASEPRI masking (enable interrupts) + MSR BASEPRI, r4 +#else CPSIE i // Enable interrupts +#endif /* Increment the thread run count. */ @@ -347,27 +388,34 @@ __tx_ts_restore: STR r3, [r0] // Disable MPU LDR r0, [r1, #0x90] // Pickup the module instance pointer CBZ r0, skip_mpu_setup // Is this thread owned by a module? No, skip MPU setup - LDR r1, [r0, #0x64] // Pickup MPU register[0] - CBZ r1, skip_mpu_setup // Is protection required for this module? No, skip MPU setup - LDR r1, =0xE000ED9C // Build address of MPU base register + + LDR r2, [r0, #0x8C] // Pickup MPU region 5 address + CBZ r2, skip_mpu_setup // Is protection required for this module? No, skip MPU setup + + // Is the MPU already set up for this module? + MOV r1, #5 // Select region 5 from MPU + LDR r3, =0xE000ED98 // MPU_RNR register address + STR r1, [r3] // Set region to 5 + LDR r1, =0xE000ED9C // MPU_RBAR register address + LDR r3, [r1] // Load address stored in MPU region 5 + BIC r2, r2, #0x10 // Clear VALID bit + CMP r2, r3 // Is module already loaded? + BEQ _tx_enable_mpu // Yes - skip MPU reconfiguration // Use alias registers to quickly load MPU ADD r0, r0, #100 // Build address of MPU register start in thread control block -#ifdef TXM_MODULE_MANAGER_16_MPU + LDM r0!,{r2-r9} // Load MPU regions 0-3 STM r1,{r2-r9} // Store MPU regions 0-3 LDM r0!,{r2-r9} // Load MPU regions 4-7 STM r1,{r2-r9} // Store MPU regions 4-7 +#ifdef TXM_MODULE_MANAGER_16_MPU LDM r0!,{r2-r9} // Load MPU regions 8-11 STM r1,{r2-r9} // Store MPU regions 8-11 LDM r0,{r2-r9} // Load MPU regions 12-15 STM r1,{r2-r9} // Store MPU regions 12-15 -#else - LDM r0!,{r2-r9} // Load first four MPU regions - STM r1,{r2-r9} // Store first four MPU regions - LDM r0,{r2-r9} // Load second four MPU regions - STM r1,{r2-r9} // Store second four MPU regions #endif +_tx_enable_mpu: LDR r0, =0xE000ED94 // Build MPU control reg address MOV r1, #5 // Build enable value with background region enabled STR r1, [r0] // Enable MPU diff --git a/ports_smp/cortex_a34_smp/ac6/src/tx_thread_context_restore.S b/ports_smp/cortex_a34_smp/ac6/src/tx_thread_context_restore.S index 4df471ac..21deb75d 100644 --- a/ports_smp/cortex_a34_smp/ac6/src/tx_thread_context_restore.S +++ b/ports_smp/cortex_a34_smp/ac6/src/tx_thread_context_restore.S @@ -21,9 +21,6 @@ /**************************************************************************/ -/* Include macros for modifying the wait list. */ -#include "tx_thread_smp_protection_wait_list_macros.h" - .text .align 3 /**************************************************************************/ @@ -31,7 +28,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_context_restore ARMv8-A-SMP */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -63,10 +60,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_context_restore(VOID) @@ -216,74 +216,6 @@ __tx_thread_no_preempt_restore: // { __tx_thread_preempt_restore: - /* Was the thread being preempted waiting for the lock? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] != 0) - // { - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - CMP w3, #0 - BEQ _nobody_waiting_for_lock // Is the core waiting for the lock? - - /* Do we not have the lock? This means the ISR never got the inter-core lock. */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_owned != this_core) - // { - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w8, w3 // Compare our core to the owning core - BEQ _this_core_has_lock // Do we have the lock? - - /* We don't have the lock. This core should be in the list. Remove it. */ - // _tx_thread_smp_protect_wait_list_remove(this_core); - - _tx_thread_smp_protect_wait_list_remove // Call macro to remove core from the list - B _nobody_waiting_for_lock // Leave - - // } - // else - // { - /* We have the lock. This means the ISR got the inter-core lock, but - never released it because it saw that there was someone waiting. - Note this core is not in the list. */ - -_this_core_has_lock: - - /* We're no longer waiting. Note that this should be zero since this happens during thread preemption. */ - // _tx_thread_smp_protect_wait_counts[core]--; - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - SUB w3, w3, #1 // Decrement waiting value. Should be zero now - STR w3, [x2, x8, LSL #2] // Store new waiting value - - /* Now release the inter-core lock. */ - - /* Set protected core as invalid. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_core = 0xFFFFFFFF; - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - MOV w3, #0xFFFFFFFF // Build invalid value - STR w3, [x2, #4] // Mark the protected core as invalid - DMB ISH // Ensure that accesses to shared resource have completed - - /* Release protection. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 0; - - MOV w3, #0 // Build release protection value - STR w3, [x2, #0] // Release the protection - DSB ISH // To ensure update of the protection occurs before other CPUs awake - - /* Wake up waiting processors. Note interrupts are already enabled. */ - -#ifdef TX_ENABLE_WFE - SEV // Send event to other CPUs -#endif - - // } - // } - -_nobody_waiting_for_lock: LDR x4, [x0, #8] // Switch to thread stack pointer MOV sp, x4 // diff --git a/ports_smp/cortex_a34_smp/ac6/src/tx_thread_smp_protect.S b/ports_smp/cortex_a34_smp/ac6/src/tx_thread_smp_protect.S index 9cde3e08..b65af329 100644 --- a/ports_smp/cortex_a34_smp/ac6/src/tx_thread_smp_protect.S +++ b/ports_smp/cortex_a34_smp/ac6/src/tx_thread_smp_protect.S @@ -32,7 +32,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_smp_protect Cortex-A35-SMP/AC6 */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -63,11 +63,14 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ -/* improved SMP code, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ +/* improved SMP code, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_protect @@ -81,293 +84,49 @@ _tx_thread_smp_protect: /* Pickup the CPU ID. */ - MRS x1, MPIDR_EL1 // Pickup the core ID + MRS x2, MPIDR_EL1 // Pickup the core ID #ifdef TX_ARMV8_2 #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID + UBFX x7, x2, #16, #8 // Isolate cluster ID #endif - UBFX x1, x1, #8, #8 // Isolate core ID + UBFX x2, x2, #8, #8 // Isolate core ID #else #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID + UBFX x7, x2, #8, #8 // Isolate cluster ID #endif - UBFX x1, x1, #0, #8 // Isolate core ID + UBFX x2, x2, #0, #8 // Isolate core ID #endif #if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID + ADDS x2, x2, x7, LSL #2 // Calculate CPU ID #endif - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR x2, =_tx_thread_smp_protection // Build address to protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w1, w3 // Is it not this core? - BNE _protection_not_owned // No, the protection is not already owned - - /* We already have protection. */ - - /* Increment the protection count. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_count++; - - LDR w3, [x2, #8] // Pickup ownership count - ADD w3, w3, #1 // Increment ownership count - STR w3, [x2, #8] // Store ownership count - DMB ISH - - B _return - -_protection_not_owned: - - /* Is the lock available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Is the list empty? */ - // if (_tx_thread_smp_protect_wait_list_head == _tx_thread_smp_protect_wait_list_tail) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head - LDR w3, [x3] - LDR x4, =_tx_thread_smp_protect_wait_list_tail - LDR w4, [x4] - CMP w3, w4 - BNE _list_not_empty - - /* Try to get the lock. */ - // if (write_exclusive(&_tx_thread_smp_protection.tx_thread_smp_protect_in_force, 1) == SUCCESS) - // { - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - - /* We got the lock! */ - // _tx_thread_smp_protect_lock_got(); - - DMB ISH // Ensure write to protection finishes - _tx_thread_smp_protect_lock_got // Call the lock got function - - B _return - -_list_not_empty: - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _start_waiting - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _return - -_start_waiting: - - /* For one reason or another, we didn't get the lock. */ - - /* Increment wait count. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value - - /* Have we not added ourselves to the list yet? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 1) - // { - - CMP w4, #1 - BNE _already_in_list0 // Is this core already waiting? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - // } - -_already_in_list0: - - /* Restore interrupts. */ + LDR x1, =_tx_thread_smp_protection // Build address to protection structure + LDR w3, [x1, #4] // Pickup the owning core + CMP w3, w2 // Is it this core? + BEQ _owned // Yes, the protection is already owned + LDAXR w4, [x1, #0] // Pickup the protection flag + CBZ w4, _get_protection // Yes, get the protection MSR DAIF, x0 // Restore interrupts ISB // #ifdef TX_ENABLE_WFE WFE // Go into standby #endif + B _tx_thread_smp_protect // On waking, restart the protection attempt - /* We do this until we have the lock. */ - // while (1) - // { - -_try_to_get_lock: - - /* Disable interrupts so we don't get preempted. */ - - MRS x0, DAIF // Pickup current interrupt posture - MSR DAIFSet, 0x3 // Lockout interrupts - - /* Pickup the CPU ID. */ - - MRS x1, MPIDR_EL1 // Pickup the core ID -#ifdef TX_ARMV8_2 -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #8, #8 // Isolate core ID -#else -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #0, #8 // Isolate core ID -#endif -#if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID -#endif - - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR w3, [x2, #4] // Pickup the owning core - CMP w3, w1 // Is it this core? - BEQ _got_lock_after_waiting // Yes, the protection is already owned. This means - // an ISR preempted us and got protection - - // } - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _did_not_get_lock - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _did_not_get_lock // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _did_not_get_lock // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _got_lock_after_waiting - -_did_not_get_lock: - - /* For one reason or another, we didn't get the lock. */ - - /* Were we removed from the list? This can happen if we're a thread - and we got preempted. */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 0) - // { - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - CMP w4, #0 - BNE _already_in_list1 // Is this core already in the list? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - /* Our waiting count was also reset when we were preempted. Increment it again. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - // } - -_already_in_list1: - - /* Restore interrupts and try again. */ - +_get_protection: + MOV x4, #1 // Build lock value + STXR w5, w4, [x1] // Attempt to get the protection + CBZ w5, _got_protection // Did it succeed? w5 = 0 means success! MSR DAIF, x0 // Restore interrupts - ISB // -#ifdef TX_ENABLE_WFE - WFE // Go into standby -#endif - B _try_to_get_lock // On waking, restart the protection attempt - -_got_lock_after_waiting: - - /* We're no longer waiting. */ - // _tx_thread_smp_protect_wait_counts[this_core]--; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load waiting list - LDR w4, [x3, x1, LSL #2] // Load current wait value - SUB w4, w4, #1 // Decrement wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - /* Restore registers and return. */ - -_return: - + B _tx_thread_smp_protect // Restart the protection attempt + +_got_protection: + DMB ISH // + STR w2, [x1, #4] // Save owning core +_owned: + LDR w5, [x1, #8] // Pickup ownership count + ADD w5, w5, #1 // Increment ownership count + STR w5, [x1, #8] // Store ownership count + DMB ISH // RET diff --git a/ports_smp/cortex_a34_smp/ac6/src/tx_thread_smp_unprotect.S b/ports_smp/cortex_a34_smp/ac6/src/tx_thread_smp_unprotect.S index a783cde6..80159f1b 100644 --- a/ports_smp/cortex_a34_smp/ac6/src/tx_thread_smp_unprotect.S +++ b/ports_smp/cortex_a34_smp/ac6/src/tx_thread_smp_unprotect.S @@ -28,7 +28,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_smp_unprotect Cortex-A35-SMP/AC6 */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -60,10 +60,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_unprotect @@ -105,11 +108,6 @@ _tx_thread_smp_unprotect: CMP w3, #0 // Is the preempt disable flag set? BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protect_wait_counts // Build build address of wait counts - LDR w3, [x2, x1, LSL #2] // Pickup wait list value - CMP w3, #0 // Are any entities on this core waiting? - BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protection // Build address of protection structure MOV w3, #0xFFFFFFFF // Build invalid value STR w3, [x2, #4] // Mark the protected core as invalid diff --git a/ports_smp/cortex_a34_smp/gnu/src/tx_thread_context_restore.S b/ports_smp/cortex_a34_smp/gnu/src/tx_thread_context_restore.S index 4df471ac..21deb75d 100644 --- a/ports_smp/cortex_a34_smp/gnu/src/tx_thread_context_restore.S +++ b/ports_smp/cortex_a34_smp/gnu/src/tx_thread_context_restore.S @@ -21,9 +21,6 @@ /**************************************************************************/ -/* Include macros for modifying the wait list. */ -#include "tx_thread_smp_protection_wait_list_macros.h" - .text .align 3 /**************************************************************************/ @@ -31,7 +28,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_context_restore ARMv8-A-SMP */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -63,10 +60,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_context_restore(VOID) @@ -216,74 +216,6 @@ __tx_thread_no_preempt_restore: // { __tx_thread_preempt_restore: - /* Was the thread being preempted waiting for the lock? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] != 0) - // { - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - CMP w3, #0 - BEQ _nobody_waiting_for_lock // Is the core waiting for the lock? - - /* Do we not have the lock? This means the ISR never got the inter-core lock. */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_owned != this_core) - // { - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w8, w3 // Compare our core to the owning core - BEQ _this_core_has_lock // Do we have the lock? - - /* We don't have the lock. This core should be in the list. Remove it. */ - // _tx_thread_smp_protect_wait_list_remove(this_core); - - _tx_thread_smp_protect_wait_list_remove // Call macro to remove core from the list - B _nobody_waiting_for_lock // Leave - - // } - // else - // { - /* We have the lock. This means the ISR got the inter-core lock, but - never released it because it saw that there was someone waiting. - Note this core is not in the list. */ - -_this_core_has_lock: - - /* We're no longer waiting. Note that this should be zero since this happens during thread preemption. */ - // _tx_thread_smp_protect_wait_counts[core]--; - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - SUB w3, w3, #1 // Decrement waiting value. Should be zero now - STR w3, [x2, x8, LSL #2] // Store new waiting value - - /* Now release the inter-core lock. */ - - /* Set protected core as invalid. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_core = 0xFFFFFFFF; - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - MOV w3, #0xFFFFFFFF // Build invalid value - STR w3, [x2, #4] // Mark the protected core as invalid - DMB ISH // Ensure that accesses to shared resource have completed - - /* Release protection. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 0; - - MOV w3, #0 // Build release protection value - STR w3, [x2, #0] // Release the protection - DSB ISH // To ensure update of the protection occurs before other CPUs awake - - /* Wake up waiting processors. Note interrupts are already enabled. */ - -#ifdef TX_ENABLE_WFE - SEV // Send event to other CPUs -#endif - - // } - // } - -_nobody_waiting_for_lock: LDR x4, [x0, #8] // Switch to thread stack pointer MOV sp, x4 // diff --git a/ports_smp/cortex_a34_smp/gnu/src/tx_thread_smp_protect.S b/ports_smp/cortex_a34_smp/gnu/src/tx_thread_smp_protect.S index 9cde3e08..b65af329 100644 --- a/ports_smp/cortex_a34_smp/gnu/src/tx_thread_smp_protect.S +++ b/ports_smp/cortex_a34_smp/gnu/src/tx_thread_smp_protect.S @@ -32,7 +32,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_smp_protect Cortex-A35-SMP/AC6 */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -63,11 +63,14 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ -/* improved SMP code, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ +/* improved SMP code, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_protect @@ -81,293 +84,49 @@ _tx_thread_smp_protect: /* Pickup the CPU ID. */ - MRS x1, MPIDR_EL1 // Pickup the core ID + MRS x2, MPIDR_EL1 // Pickup the core ID #ifdef TX_ARMV8_2 #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID + UBFX x7, x2, #16, #8 // Isolate cluster ID #endif - UBFX x1, x1, #8, #8 // Isolate core ID + UBFX x2, x2, #8, #8 // Isolate core ID #else #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID + UBFX x7, x2, #8, #8 // Isolate cluster ID #endif - UBFX x1, x1, #0, #8 // Isolate core ID + UBFX x2, x2, #0, #8 // Isolate core ID #endif #if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID + ADDS x2, x2, x7, LSL #2 // Calculate CPU ID #endif - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR x2, =_tx_thread_smp_protection // Build address to protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w1, w3 // Is it not this core? - BNE _protection_not_owned // No, the protection is not already owned - - /* We already have protection. */ - - /* Increment the protection count. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_count++; - - LDR w3, [x2, #8] // Pickup ownership count - ADD w3, w3, #1 // Increment ownership count - STR w3, [x2, #8] // Store ownership count - DMB ISH - - B _return - -_protection_not_owned: - - /* Is the lock available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Is the list empty? */ - // if (_tx_thread_smp_protect_wait_list_head == _tx_thread_smp_protect_wait_list_tail) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head - LDR w3, [x3] - LDR x4, =_tx_thread_smp_protect_wait_list_tail - LDR w4, [x4] - CMP w3, w4 - BNE _list_not_empty - - /* Try to get the lock. */ - // if (write_exclusive(&_tx_thread_smp_protection.tx_thread_smp_protect_in_force, 1) == SUCCESS) - // { - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - - /* We got the lock! */ - // _tx_thread_smp_protect_lock_got(); - - DMB ISH // Ensure write to protection finishes - _tx_thread_smp_protect_lock_got // Call the lock got function - - B _return - -_list_not_empty: - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _start_waiting - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _return - -_start_waiting: - - /* For one reason or another, we didn't get the lock. */ - - /* Increment wait count. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value - - /* Have we not added ourselves to the list yet? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 1) - // { - - CMP w4, #1 - BNE _already_in_list0 // Is this core already waiting? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - // } - -_already_in_list0: - - /* Restore interrupts. */ + LDR x1, =_tx_thread_smp_protection // Build address to protection structure + LDR w3, [x1, #4] // Pickup the owning core + CMP w3, w2 // Is it this core? + BEQ _owned // Yes, the protection is already owned + LDAXR w4, [x1, #0] // Pickup the protection flag + CBZ w4, _get_protection // Yes, get the protection MSR DAIF, x0 // Restore interrupts ISB // #ifdef TX_ENABLE_WFE WFE // Go into standby #endif + B _tx_thread_smp_protect // On waking, restart the protection attempt - /* We do this until we have the lock. */ - // while (1) - // { - -_try_to_get_lock: - - /* Disable interrupts so we don't get preempted. */ - - MRS x0, DAIF // Pickup current interrupt posture - MSR DAIFSet, 0x3 // Lockout interrupts - - /* Pickup the CPU ID. */ - - MRS x1, MPIDR_EL1 // Pickup the core ID -#ifdef TX_ARMV8_2 -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #8, #8 // Isolate core ID -#else -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #0, #8 // Isolate core ID -#endif -#if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID -#endif - - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR w3, [x2, #4] // Pickup the owning core - CMP w3, w1 // Is it this core? - BEQ _got_lock_after_waiting // Yes, the protection is already owned. This means - // an ISR preempted us and got protection - - // } - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _did_not_get_lock - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _did_not_get_lock // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _did_not_get_lock // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _got_lock_after_waiting - -_did_not_get_lock: - - /* For one reason or another, we didn't get the lock. */ - - /* Were we removed from the list? This can happen if we're a thread - and we got preempted. */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 0) - // { - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - CMP w4, #0 - BNE _already_in_list1 // Is this core already in the list? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - /* Our waiting count was also reset when we were preempted. Increment it again. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - // } - -_already_in_list1: - - /* Restore interrupts and try again. */ - +_get_protection: + MOV x4, #1 // Build lock value + STXR w5, w4, [x1] // Attempt to get the protection + CBZ w5, _got_protection // Did it succeed? w5 = 0 means success! MSR DAIF, x0 // Restore interrupts - ISB // -#ifdef TX_ENABLE_WFE - WFE // Go into standby -#endif - B _try_to_get_lock // On waking, restart the protection attempt - -_got_lock_after_waiting: - - /* We're no longer waiting. */ - // _tx_thread_smp_protect_wait_counts[this_core]--; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load waiting list - LDR w4, [x3, x1, LSL #2] // Load current wait value - SUB w4, w4, #1 // Decrement wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - /* Restore registers and return. */ - -_return: - + B _tx_thread_smp_protect // Restart the protection attempt + +_got_protection: + DMB ISH // + STR w2, [x1, #4] // Save owning core +_owned: + LDR w5, [x1, #8] // Pickup ownership count + ADD w5, w5, #1 // Increment ownership count + STR w5, [x1, #8] // Store ownership count + DMB ISH // RET diff --git a/ports_smp/cortex_a34_smp/gnu/src/tx_thread_smp_unprotect.S b/ports_smp/cortex_a34_smp/gnu/src/tx_thread_smp_unprotect.S index a783cde6..80159f1b 100644 --- a/ports_smp/cortex_a34_smp/gnu/src/tx_thread_smp_unprotect.S +++ b/ports_smp/cortex_a34_smp/gnu/src/tx_thread_smp_unprotect.S @@ -28,7 +28,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_smp_unprotect Cortex-A35-SMP/AC6 */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -60,10 +60,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_unprotect @@ -105,11 +108,6 @@ _tx_thread_smp_unprotect: CMP w3, #0 // Is the preempt disable flag set? BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protect_wait_counts // Build build address of wait counts - LDR w3, [x2, x1, LSL #2] // Pickup wait list value - CMP w3, #0 // Are any entities on this core waiting? - BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protection // Build address of protection structure MOV w3, #0xFFFFFFFF // Build invalid value STR w3, [x2, #4] // Mark the protected core as invalid diff --git a/ports_smp/cortex_a35_smp/ac6/example_build/tx/.cproject b/ports_smp/cortex_a35_smp/ac6/example_build/tx/.cproject index 77ab8b02..b9781eea 100644 --- a/ports_smp/cortex_a35_smp/ac6/example_build/tx/.cproject +++ b/ports_smp/cortex_a35_smp/ac6/example_build/tx/.cproject @@ -131,7 +131,7 @@ - + diff --git a/ports_smp/cortex_a35_smp/ac6/src/tx_thread_context_restore.S b/ports_smp/cortex_a35_smp/ac6/src/tx_thread_context_restore.S index 4df471ac..21deb75d 100644 --- a/ports_smp/cortex_a35_smp/ac6/src/tx_thread_context_restore.S +++ b/ports_smp/cortex_a35_smp/ac6/src/tx_thread_context_restore.S @@ -21,9 +21,6 @@ /**************************************************************************/ -/* Include macros for modifying the wait list. */ -#include "tx_thread_smp_protection_wait_list_macros.h" - .text .align 3 /**************************************************************************/ @@ -31,7 +28,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_context_restore ARMv8-A-SMP */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -63,10 +60,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_context_restore(VOID) @@ -216,74 +216,6 @@ __tx_thread_no_preempt_restore: // { __tx_thread_preempt_restore: - /* Was the thread being preempted waiting for the lock? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] != 0) - // { - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - CMP w3, #0 - BEQ _nobody_waiting_for_lock // Is the core waiting for the lock? - - /* Do we not have the lock? This means the ISR never got the inter-core lock. */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_owned != this_core) - // { - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w8, w3 // Compare our core to the owning core - BEQ _this_core_has_lock // Do we have the lock? - - /* We don't have the lock. This core should be in the list. Remove it. */ - // _tx_thread_smp_protect_wait_list_remove(this_core); - - _tx_thread_smp_protect_wait_list_remove // Call macro to remove core from the list - B _nobody_waiting_for_lock // Leave - - // } - // else - // { - /* We have the lock. This means the ISR got the inter-core lock, but - never released it because it saw that there was someone waiting. - Note this core is not in the list. */ - -_this_core_has_lock: - - /* We're no longer waiting. Note that this should be zero since this happens during thread preemption. */ - // _tx_thread_smp_protect_wait_counts[core]--; - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - SUB w3, w3, #1 // Decrement waiting value. Should be zero now - STR w3, [x2, x8, LSL #2] // Store new waiting value - - /* Now release the inter-core lock. */ - - /* Set protected core as invalid. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_core = 0xFFFFFFFF; - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - MOV w3, #0xFFFFFFFF // Build invalid value - STR w3, [x2, #4] // Mark the protected core as invalid - DMB ISH // Ensure that accesses to shared resource have completed - - /* Release protection. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 0; - - MOV w3, #0 // Build release protection value - STR w3, [x2, #0] // Release the protection - DSB ISH // To ensure update of the protection occurs before other CPUs awake - - /* Wake up waiting processors. Note interrupts are already enabled. */ - -#ifdef TX_ENABLE_WFE - SEV // Send event to other CPUs -#endif - - // } - // } - -_nobody_waiting_for_lock: LDR x4, [x0, #8] // Switch to thread stack pointer MOV sp, x4 // diff --git a/ports_smp/cortex_a35_smp/ac6/src/tx_thread_smp_protect.S b/ports_smp/cortex_a35_smp/ac6/src/tx_thread_smp_protect.S index 9cde3e08..b65af329 100644 --- a/ports_smp/cortex_a35_smp/ac6/src/tx_thread_smp_protect.S +++ b/ports_smp/cortex_a35_smp/ac6/src/tx_thread_smp_protect.S @@ -32,7 +32,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_smp_protect Cortex-A35-SMP/AC6 */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -63,11 +63,14 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ -/* improved SMP code, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ +/* improved SMP code, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_protect @@ -81,293 +84,49 @@ _tx_thread_smp_protect: /* Pickup the CPU ID. */ - MRS x1, MPIDR_EL1 // Pickup the core ID + MRS x2, MPIDR_EL1 // Pickup the core ID #ifdef TX_ARMV8_2 #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID + UBFX x7, x2, #16, #8 // Isolate cluster ID #endif - UBFX x1, x1, #8, #8 // Isolate core ID + UBFX x2, x2, #8, #8 // Isolate core ID #else #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID + UBFX x7, x2, #8, #8 // Isolate cluster ID #endif - UBFX x1, x1, #0, #8 // Isolate core ID + UBFX x2, x2, #0, #8 // Isolate core ID #endif #if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID + ADDS x2, x2, x7, LSL #2 // Calculate CPU ID #endif - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR x2, =_tx_thread_smp_protection // Build address to protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w1, w3 // Is it not this core? - BNE _protection_not_owned // No, the protection is not already owned - - /* We already have protection. */ - - /* Increment the protection count. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_count++; - - LDR w3, [x2, #8] // Pickup ownership count - ADD w3, w3, #1 // Increment ownership count - STR w3, [x2, #8] // Store ownership count - DMB ISH - - B _return - -_protection_not_owned: - - /* Is the lock available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Is the list empty? */ - // if (_tx_thread_smp_protect_wait_list_head == _tx_thread_smp_protect_wait_list_tail) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head - LDR w3, [x3] - LDR x4, =_tx_thread_smp_protect_wait_list_tail - LDR w4, [x4] - CMP w3, w4 - BNE _list_not_empty - - /* Try to get the lock. */ - // if (write_exclusive(&_tx_thread_smp_protection.tx_thread_smp_protect_in_force, 1) == SUCCESS) - // { - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - - /* We got the lock! */ - // _tx_thread_smp_protect_lock_got(); - - DMB ISH // Ensure write to protection finishes - _tx_thread_smp_protect_lock_got // Call the lock got function - - B _return - -_list_not_empty: - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _start_waiting - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _return - -_start_waiting: - - /* For one reason or another, we didn't get the lock. */ - - /* Increment wait count. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value - - /* Have we not added ourselves to the list yet? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 1) - // { - - CMP w4, #1 - BNE _already_in_list0 // Is this core already waiting? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - // } - -_already_in_list0: - - /* Restore interrupts. */ + LDR x1, =_tx_thread_smp_protection // Build address to protection structure + LDR w3, [x1, #4] // Pickup the owning core + CMP w3, w2 // Is it this core? + BEQ _owned // Yes, the protection is already owned + LDAXR w4, [x1, #0] // Pickup the protection flag + CBZ w4, _get_protection // Yes, get the protection MSR DAIF, x0 // Restore interrupts ISB // #ifdef TX_ENABLE_WFE WFE // Go into standby #endif + B _tx_thread_smp_protect // On waking, restart the protection attempt - /* We do this until we have the lock. */ - // while (1) - // { - -_try_to_get_lock: - - /* Disable interrupts so we don't get preempted. */ - - MRS x0, DAIF // Pickup current interrupt posture - MSR DAIFSet, 0x3 // Lockout interrupts - - /* Pickup the CPU ID. */ - - MRS x1, MPIDR_EL1 // Pickup the core ID -#ifdef TX_ARMV8_2 -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #8, #8 // Isolate core ID -#else -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #0, #8 // Isolate core ID -#endif -#if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID -#endif - - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR w3, [x2, #4] // Pickup the owning core - CMP w3, w1 // Is it this core? - BEQ _got_lock_after_waiting // Yes, the protection is already owned. This means - // an ISR preempted us and got protection - - // } - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _did_not_get_lock - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _did_not_get_lock // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _did_not_get_lock // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _got_lock_after_waiting - -_did_not_get_lock: - - /* For one reason or another, we didn't get the lock. */ - - /* Were we removed from the list? This can happen if we're a thread - and we got preempted. */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 0) - // { - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - CMP w4, #0 - BNE _already_in_list1 // Is this core already in the list? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - /* Our waiting count was also reset when we were preempted. Increment it again. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - // } - -_already_in_list1: - - /* Restore interrupts and try again. */ - +_get_protection: + MOV x4, #1 // Build lock value + STXR w5, w4, [x1] // Attempt to get the protection + CBZ w5, _got_protection // Did it succeed? w5 = 0 means success! MSR DAIF, x0 // Restore interrupts - ISB // -#ifdef TX_ENABLE_WFE - WFE // Go into standby -#endif - B _try_to_get_lock // On waking, restart the protection attempt - -_got_lock_after_waiting: - - /* We're no longer waiting. */ - // _tx_thread_smp_protect_wait_counts[this_core]--; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load waiting list - LDR w4, [x3, x1, LSL #2] // Load current wait value - SUB w4, w4, #1 // Decrement wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - /* Restore registers and return. */ - -_return: - + B _tx_thread_smp_protect // Restart the protection attempt + +_got_protection: + DMB ISH // + STR w2, [x1, #4] // Save owning core +_owned: + LDR w5, [x1, #8] // Pickup ownership count + ADD w5, w5, #1 // Increment ownership count + STR w5, [x1, #8] // Store ownership count + DMB ISH // RET diff --git a/ports_smp/cortex_a35_smp/ac6/src/tx_thread_smp_unprotect.S b/ports_smp/cortex_a35_smp/ac6/src/tx_thread_smp_unprotect.S index a783cde6..f9d8692a 100644 --- a/ports_smp/cortex_a35_smp/ac6/src/tx_thread_smp_unprotect.S +++ b/ports_smp/cortex_a35_smp/ac6/src/tx_thread_smp_unprotect.S @@ -60,10 +60,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_unprotect @@ -105,11 +108,6 @@ _tx_thread_smp_unprotect: CMP w3, #0 // Is the preempt disable flag set? BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protect_wait_counts // Build build address of wait counts - LDR w3, [x2, x1, LSL #2] // Pickup wait list value - CMP w3, #0 // Are any entities on this core waiting? - BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protection // Build address of protection structure MOV w3, #0xFFFFFFFF // Build invalid value STR w3, [x2, #4] // Mark the protected core as invalid diff --git a/ports_smp/cortex_a35_smp/gnu/src/tx_thread_context_restore.S b/ports_smp/cortex_a35_smp/gnu/src/tx_thread_context_restore.S index 4df471ac..21deb75d 100644 --- a/ports_smp/cortex_a35_smp/gnu/src/tx_thread_context_restore.S +++ b/ports_smp/cortex_a35_smp/gnu/src/tx_thread_context_restore.S @@ -21,9 +21,6 @@ /**************************************************************************/ -/* Include macros for modifying the wait list. */ -#include "tx_thread_smp_protection_wait_list_macros.h" - .text .align 3 /**************************************************************************/ @@ -31,7 +28,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_context_restore ARMv8-A-SMP */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -63,10 +60,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_context_restore(VOID) @@ -216,74 +216,6 @@ __tx_thread_no_preempt_restore: // { __tx_thread_preempt_restore: - /* Was the thread being preempted waiting for the lock? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] != 0) - // { - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - CMP w3, #0 - BEQ _nobody_waiting_for_lock // Is the core waiting for the lock? - - /* Do we not have the lock? This means the ISR never got the inter-core lock. */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_owned != this_core) - // { - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w8, w3 // Compare our core to the owning core - BEQ _this_core_has_lock // Do we have the lock? - - /* We don't have the lock. This core should be in the list. Remove it. */ - // _tx_thread_smp_protect_wait_list_remove(this_core); - - _tx_thread_smp_protect_wait_list_remove // Call macro to remove core from the list - B _nobody_waiting_for_lock // Leave - - // } - // else - // { - /* We have the lock. This means the ISR got the inter-core lock, but - never released it because it saw that there was someone waiting. - Note this core is not in the list. */ - -_this_core_has_lock: - - /* We're no longer waiting. Note that this should be zero since this happens during thread preemption. */ - // _tx_thread_smp_protect_wait_counts[core]--; - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - SUB w3, w3, #1 // Decrement waiting value. Should be zero now - STR w3, [x2, x8, LSL #2] // Store new waiting value - - /* Now release the inter-core lock. */ - - /* Set protected core as invalid. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_core = 0xFFFFFFFF; - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - MOV w3, #0xFFFFFFFF // Build invalid value - STR w3, [x2, #4] // Mark the protected core as invalid - DMB ISH // Ensure that accesses to shared resource have completed - - /* Release protection. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 0; - - MOV w3, #0 // Build release protection value - STR w3, [x2, #0] // Release the protection - DSB ISH // To ensure update of the protection occurs before other CPUs awake - - /* Wake up waiting processors. Note interrupts are already enabled. */ - -#ifdef TX_ENABLE_WFE - SEV // Send event to other CPUs -#endif - - // } - // } - -_nobody_waiting_for_lock: LDR x4, [x0, #8] // Switch to thread stack pointer MOV sp, x4 // diff --git a/ports_smp/cortex_a35_smp/gnu/src/tx_thread_smp_protect.S b/ports_smp/cortex_a35_smp/gnu/src/tx_thread_smp_protect.S index 9cde3e08..b65af329 100644 --- a/ports_smp/cortex_a35_smp/gnu/src/tx_thread_smp_protect.S +++ b/ports_smp/cortex_a35_smp/gnu/src/tx_thread_smp_protect.S @@ -32,7 +32,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_smp_protect Cortex-A35-SMP/AC6 */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -63,11 +63,14 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ -/* improved SMP code, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ +/* improved SMP code, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_protect @@ -81,293 +84,49 @@ _tx_thread_smp_protect: /* Pickup the CPU ID. */ - MRS x1, MPIDR_EL1 // Pickup the core ID + MRS x2, MPIDR_EL1 // Pickup the core ID #ifdef TX_ARMV8_2 #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID + UBFX x7, x2, #16, #8 // Isolate cluster ID #endif - UBFX x1, x1, #8, #8 // Isolate core ID + UBFX x2, x2, #8, #8 // Isolate core ID #else #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID + UBFX x7, x2, #8, #8 // Isolate cluster ID #endif - UBFX x1, x1, #0, #8 // Isolate core ID + UBFX x2, x2, #0, #8 // Isolate core ID #endif #if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID + ADDS x2, x2, x7, LSL #2 // Calculate CPU ID #endif - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR x2, =_tx_thread_smp_protection // Build address to protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w1, w3 // Is it not this core? - BNE _protection_not_owned // No, the protection is not already owned - - /* We already have protection. */ - - /* Increment the protection count. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_count++; - - LDR w3, [x2, #8] // Pickup ownership count - ADD w3, w3, #1 // Increment ownership count - STR w3, [x2, #8] // Store ownership count - DMB ISH - - B _return - -_protection_not_owned: - - /* Is the lock available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Is the list empty? */ - // if (_tx_thread_smp_protect_wait_list_head == _tx_thread_smp_protect_wait_list_tail) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head - LDR w3, [x3] - LDR x4, =_tx_thread_smp_protect_wait_list_tail - LDR w4, [x4] - CMP w3, w4 - BNE _list_not_empty - - /* Try to get the lock. */ - // if (write_exclusive(&_tx_thread_smp_protection.tx_thread_smp_protect_in_force, 1) == SUCCESS) - // { - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - - /* We got the lock! */ - // _tx_thread_smp_protect_lock_got(); - - DMB ISH // Ensure write to protection finishes - _tx_thread_smp_protect_lock_got // Call the lock got function - - B _return - -_list_not_empty: - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _start_waiting - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _return - -_start_waiting: - - /* For one reason or another, we didn't get the lock. */ - - /* Increment wait count. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value - - /* Have we not added ourselves to the list yet? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 1) - // { - - CMP w4, #1 - BNE _already_in_list0 // Is this core already waiting? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - // } - -_already_in_list0: - - /* Restore interrupts. */ + LDR x1, =_tx_thread_smp_protection // Build address to protection structure + LDR w3, [x1, #4] // Pickup the owning core + CMP w3, w2 // Is it this core? + BEQ _owned // Yes, the protection is already owned + LDAXR w4, [x1, #0] // Pickup the protection flag + CBZ w4, _get_protection // Yes, get the protection MSR DAIF, x0 // Restore interrupts ISB // #ifdef TX_ENABLE_WFE WFE // Go into standby #endif + B _tx_thread_smp_protect // On waking, restart the protection attempt - /* We do this until we have the lock. */ - // while (1) - // { - -_try_to_get_lock: - - /* Disable interrupts so we don't get preempted. */ - - MRS x0, DAIF // Pickup current interrupt posture - MSR DAIFSet, 0x3 // Lockout interrupts - - /* Pickup the CPU ID. */ - - MRS x1, MPIDR_EL1 // Pickup the core ID -#ifdef TX_ARMV8_2 -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #8, #8 // Isolate core ID -#else -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #0, #8 // Isolate core ID -#endif -#if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID -#endif - - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR w3, [x2, #4] // Pickup the owning core - CMP w3, w1 // Is it this core? - BEQ _got_lock_after_waiting // Yes, the protection is already owned. This means - // an ISR preempted us and got protection - - // } - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _did_not_get_lock - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _did_not_get_lock // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _did_not_get_lock // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _got_lock_after_waiting - -_did_not_get_lock: - - /* For one reason or another, we didn't get the lock. */ - - /* Were we removed from the list? This can happen if we're a thread - and we got preempted. */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 0) - // { - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - CMP w4, #0 - BNE _already_in_list1 // Is this core already in the list? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - /* Our waiting count was also reset when we were preempted. Increment it again. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - // } - -_already_in_list1: - - /* Restore interrupts and try again. */ - +_get_protection: + MOV x4, #1 // Build lock value + STXR w5, w4, [x1] // Attempt to get the protection + CBZ w5, _got_protection // Did it succeed? w5 = 0 means success! MSR DAIF, x0 // Restore interrupts - ISB // -#ifdef TX_ENABLE_WFE - WFE // Go into standby -#endif - B _try_to_get_lock // On waking, restart the protection attempt - -_got_lock_after_waiting: - - /* We're no longer waiting. */ - // _tx_thread_smp_protect_wait_counts[this_core]--; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load waiting list - LDR w4, [x3, x1, LSL #2] // Load current wait value - SUB w4, w4, #1 // Decrement wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - /* Restore registers and return. */ - -_return: - + B _tx_thread_smp_protect // Restart the protection attempt + +_got_protection: + DMB ISH // + STR w2, [x1, #4] // Save owning core +_owned: + LDR w5, [x1, #8] // Pickup ownership count + ADD w5, w5, #1 // Increment ownership count + STR w5, [x1, #8] // Store ownership count + DMB ISH // RET diff --git a/ports_smp/cortex_a35_smp/gnu/src/tx_thread_smp_unprotect.S b/ports_smp/cortex_a35_smp/gnu/src/tx_thread_smp_unprotect.S index a783cde6..f9d8692a 100644 --- a/ports_smp/cortex_a35_smp/gnu/src/tx_thread_smp_unprotect.S +++ b/ports_smp/cortex_a35_smp/gnu/src/tx_thread_smp_unprotect.S @@ -60,10 +60,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_unprotect @@ -105,11 +108,6 @@ _tx_thread_smp_unprotect: CMP w3, #0 // Is the preempt disable flag set? BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protect_wait_counts // Build build address of wait counts - LDR w3, [x2, x1, LSL #2] // Pickup wait list value - CMP w3, #0 // Are any entities on this core waiting? - BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protection // Build address of protection structure MOV w3, #0xFFFFFFFF // Build invalid value STR w3, [x2, #4] // Mark the protected core as invalid diff --git a/ports_smp/cortex_a53_smp/ac6/example_build/sample_threadx/.cproject b/ports_smp/cortex_a53_smp/ac6/example_build/sample_threadx/.cproject index eb3c1a32..195794e6 100644 --- a/ports_smp/cortex_a53_smp/ac6/example_build/sample_threadx/.cproject +++ b/ports_smp/cortex_a53_smp/ac6/example_build/sample_threadx/.cproject @@ -23,7 +23,7 @@ - + @@ -47,7 +47,7 @@ + + + + + + diff --git a/ports_smp/cortex_a53_smp/gnu/src/tx_thread_context_restore.S b/ports_smp/cortex_a53_smp/gnu/src/tx_thread_context_restore.S index 4df471ac..21deb75d 100644 --- a/ports_smp/cortex_a53_smp/gnu/src/tx_thread_context_restore.S +++ b/ports_smp/cortex_a53_smp/gnu/src/tx_thread_context_restore.S @@ -21,9 +21,6 @@ /**************************************************************************/ -/* Include macros for modifying the wait list. */ -#include "tx_thread_smp_protection_wait_list_macros.h" - .text .align 3 /**************************************************************************/ @@ -31,7 +28,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_context_restore ARMv8-A-SMP */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -63,10 +60,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_context_restore(VOID) @@ -216,74 +216,6 @@ __tx_thread_no_preempt_restore: // { __tx_thread_preempt_restore: - /* Was the thread being preempted waiting for the lock? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] != 0) - // { - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - CMP w3, #0 - BEQ _nobody_waiting_for_lock // Is the core waiting for the lock? - - /* Do we not have the lock? This means the ISR never got the inter-core lock. */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_owned != this_core) - // { - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w8, w3 // Compare our core to the owning core - BEQ _this_core_has_lock // Do we have the lock? - - /* We don't have the lock. This core should be in the list. Remove it. */ - // _tx_thread_smp_protect_wait_list_remove(this_core); - - _tx_thread_smp_protect_wait_list_remove // Call macro to remove core from the list - B _nobody_waiting_for_lock // Leave - - // } - // else - // { - /* We have the lock. This means the ISR got the inter-core lock, but - never released it because it saw that there was someone waiting. - Note this core is not in the list. */ - -_this_core_has_lock: - - /* We're no longer waiting. Note that this should be zero since this happens during thread preemption. */ - // _tx_thread_smp_protect_wait_counts[core]--; - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - SUB w3, w3, #1 // Decrement waiting value. Should be zero now - STR w3, [x2, x8, LSL #2] // Store new waiting value - - /* Now release the inter-core lock. */ - - /* Set protected core as invalid. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_core = 0xFFFFFFFF; - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - MOV w3, #0xFFFFFFFF // Build invalid value - STR w3, [x2, #4] // Mark the protected core as invalid - DMB ISH // Ensure that accesses to shared resource have completed - - /* Release protection. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 0; - - MOV w3, #0 // Build release protection value - STR w3, [x2, #0] // Release the protection - DSB ISH // To ensure update of the protection occurs before other CPUs awake - - /* Wake up waiting processors. Note interrupts are already enabled. */ - -#ifdef TX_ENABLE_WFE - SEV // Send event to other CPUs -#endif - - // } - // } - -_nobody_waiting_for_lock: LDR x4, [x0, #8] // Switch to thread stack pointer MOV sp, x4 // diff --git a/ports_smp/cortex_a53_smp/gnu/src/tx_thread_smp_protect.S b/ports_smp/cortex_a53_smp/gnu/src/tx_thread_smp_protect.S index 9cde3e08..b65af329 100644 --- a/ports_smp/cortex_a53_smp/gnu/src/tx_thread_smp_protect.S +++ b/ports_smp/cortex_a53_smp/gnu/src/tx_thread_smp_protect.S @@ -32,7 +32,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_smp_protect Cortex-A35-SMP/AC6 */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -63,11 +63,14 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ -/* improved SMP code, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ +/* improved SMP code, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_protect @@ -81,293 +84,49 @@ _tx_thread_smp_protect: /* Pickup the CPU ID. */ - MRS x1, MPIDR_EL1 // Pickup the core ID + MRS x2, MPIDR_EL1 // Pickup the core ID #ifdef TX_ARMV8_2 #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID + UBFX x7, x2, #16, #8 // Isolate cluster ID #endif - UBFX x1, x1, #8, #8 // Isolate core ID + UBFX x2, x2, #8, #8 // Isolate core ID #else #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID + UBFX x7, x2, #8, #8 // Isolate cluster ID #endif - UBFX x1, x1, #0, #8 // Isolate core ID + UBFX x2, x2, #0, #8 // Isolate core ID #endif #if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID + ADDS x2, x2, x7, LSL #2 // Calculate CPU ID #endif - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR x2, =_tx_thread_smp_protection // Build address to protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w1, w3 // Is it not this core? - BNE _protection_not_owned // No, the protection is not already owned - - /* We already have protection. */ - - /* Increment the protection count. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_count++; - - LDR w3, [x2, #8] // Pickup ownership count - ADD w3, w3, #1 // Increment ownership count - STR w3, [x2, #8] // Store ownership count - DMB ISH - - B _return - -_protection_not_owned: - - /* Is the lock available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Is the list empty? */ - // if (_tx_thread_smp_protect_wait_list_head == _tx_thread_smp_protect_wait_list_tail) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head - LDR w3, [x3] - LDR x4, =_tx_thread_smp_protect_wait_list_tail - LDR w4, [x4] - CMP w3, w4 - BNE _list_not_empty - - /* Try to get the lock. */ - // if (write_exclusive(&_tx_thread_smp_protection.tx_thread_smp_protect_in_force, 1) == SUCCESS) - // { - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - - /* We got the lock! */ - // _tx_thread_smp_protect_lock_got(); - - DMB ISH // Ensure write to protection finishes - _tx_thread_smp_protect_lock_got // Call the lock got function - - B _return - -_list_not_empty: - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _start_waiting - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _return - -_start_waiting: - - /* For one reason or another, we didn't get the lock. */ - - /* Increment wait count. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value - - /* Have we not added ourselves to the list yet? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 1) - // { - - CMP w4, #1 - BNE _already_in_list0 // Is this core already waiting? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - // } - -_already_in_list0: - - /* Restore interrupts. */ + LDR x1, =_tx_thread_smp_protection // Build address to protection structure + LDR w3, [x1, #4] // Pickup the owning core + CMP w3, w2 // Is it this core? + BEQ _owned // Yes, the protection is already owned + LDAXR w4, [x1, #0] // Pickup the protection flag + CBZ w4, _get_protection // Yes, get the protection MSR DAIF, x0 // Restore interrupts ISB // #ifdef TX_ENABLE_WFE WFE // Go into standby #endif + B _tx_thread_smp_protect // On waking, restart the protection attempt - /* We do this until we have the lock. */ - // while (1) - // { - -_try_to_get_lock: - - /* Disable interrupts so we don't get preempted. */ - - MRS x0, DAIF // Pickup current interrupt posture - MSR DAIFSet, 0x3 // Lockout interrupts - - /* Pickup the CPU ID. */ - - MRS x1, MPIDR_EL1 // Pickup the core ID -#ifdef TX_ARMV8_2 -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #8, #8 // Isolate core ID -#else -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #0, #8 // Isolate core ID -#endif -#if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID -#endif - - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR w3, [x2, #4] // Pickup the owning core - CMP w3, w1 // Is it this core? - BEQ _got_lock_after_waiting // Yes, the protection is already owned. This means - // an ISR preempted us and got protection - - // } - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _did_not_get_lock - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _did_not_get_lock // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _did_not_get_lock // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _got_lock_after_waiting - -_did_not_get_lock: - - /* For one reason or another, we didn't get the lock. */ - - /* Were we removed from the list? This can happen if we're a thread - and we got preempted. */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 0) - // { - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - CMP w4, #0 - BNE _already_in_list1 // Is this core already in the list? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - /* Our waiting count was also reset when we were preempted. Increment it again. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - // } - -_already_in_list1: - - /* Restore interrupts and try again. */ - +_get_protection: + MOV x4, #1 // Build lock value + STXR w5, w4, [x1] // Attempt to get the protection + CBZ w5, _got_protection // Did it succeed? w5 = 0 means success! MSR DAIF, x0 // Restore interrupts - ISB // -#ifdef TX_ENABLE_WFE - WFE // Go into standby -#endif - B _try_to_get_lock // On waking, restart the protection attempt - -_got_lock_after_waiting: - - /* We're no longer waiting. */ - // _tx_thread_smp_protect_wait_counts[this_core]--; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load waiting list - LDR w4, [x3, x1, LSL #2] // Load current wait value - SUB w4, w4, #1 // Decrement wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - /* Restore registers and return. */ - -_return: - + B _tx_thread_smp_protect // Restart the protection attempt + +_got_protection: + DMB ISH // + STR w2, [x1, #4] // Save owning core +_owned: + LDR w5, [x1, #8] // Pickup ownership count + ADD w5, w5, #1 // Increment ownership count + STR w5, [x1, #8] // Store ownership count + DMB ISH // RET diff --git a/ports_smp/cortex_a53_smp/gnu/src/tx_thread_smp_unprotect.S b/ports_smp/cortex_a53_smp/gnu/src/tx_thread_smp_unprotect.S index a783cde6..f9d8692a 100644 --- a/ports_smp/cortex_a53_smp/gnu/src/tx_thread_smp_unprotect.S +++ b/ports_smp/cortex_a53_smp/gnu/src/tx_thread_smp_unprotect.S @@ -60,10 +60,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_unprotect @@ -105,11 +108,6 @@ _tx_thread_smp_unprotect: CMP w3, #0 // Is the preempt disable flag set? BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protect_wait_counts // Build build address of wait counts - LDR w3, [x2, x1, LSL #2] // Pickup wait list value - CMP w3, #0 // Are any entities on this core waiting? - BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protection // Build address of protection structure MOV w3, #0xFFFFFFFF // Build invalid value STR w3, [x2, #4] // Mark the protected core as invalid diff --git a/ports_smp/cortex_a55_smp/ac6/example_build/sample_threadx/.cproject b/ports_smp/cortex_a55_smp/ac6/example_build/sample_threadx/.cproject index 5c025c1c..1413ef4e 100644 --- a/ports_smp/cortex_a55_smp/ac6/example_build/sample_threadx/.cproject +++ b/ports_smp/cortex_a55_smp/ac6/example_build/sample_threadx/.cproject @@ -23,7 +23,7 @@ - + @@ -47,7 +47,7 @@ + + + + + + diff --git a/ports_smp/cortex_a55_smp/gnu/src/tx_thread_context_restore.S b/ports_smp/cortex_a55_smp/gnu/src/tx_thread_context_restore.S index 4df471ac..21deb75d 100644 --- a/ports_smp/cortex_a55_smp/gnu/src/tx_thread_context_restore.S +++ b/ports_smp/cortex_a55_smp/gnu/src/tx_thread_context_restore.S @@ -21,9 +21,6 @@ /**************************************************************************/ -/* Include macros for modifying the wait list. */ -#include "tx_thread_smp_protection_wait_list_macros.h" - .text .align 3 /**************************************************************************/ @@ -31,7 +28,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_context_restore ARMv8-A-SMP */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -63,10 +60,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_context_restore(VOID) @@ -216,74 +216,6 @@ __tx_thread_no_preempt_restore: // { __tx_thread_preempt_restore: - /* Was the thread being preempted waiting for the lock? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] != 0) - // { - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - CMP w3, #0 - BEQ _nobody_waiting_for_lock // Is the core waiting for the lock? - - /* Do we not have the lock? This means the ISR never got the inter-core lock. */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_owned != this_core) - // { - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w8, w3 // Compare our core to the owning core - BEQ _this_core_has_lock // Do we have the lock? - - /* We don't have the lock. This core should be in the list. Remove it. */ - // _tx_thread_smp_protect_wait_list_remove(this_core); - - _tx_thread_smp_protect_wait_list_remove // Call macro to remove core from the list - B _nobody_waiting_for_lock // Leave - - // } - // else - // { - /* We have the lock. This means the ISR got the inter-core lock, but - never released it because it saw that there was someone waiting. - Note this core is not in the list. */ - -_this_core_has_lock: - - /* We're no longer waiting. Note that this should be zero since this happens during thread preemption. */ - // _tx_thread_smp_protect_wait_counts[core]--; - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - SUB w3, w3, #1 // Decrement waiting value. Should be zero now - STR w3, [x2, x8, LSL #2] // Store new waiting value - - /* Now release the inter-core lock. */ - - /* Set protected core as invalid. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_core = 0xFFFFFFFF; - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - MOV w3, #0xFFFFFFFF // Build invalid value - STR w3, [x2, #4] // Mark the protected core as invalid - DMB ISH // Ensure that accesses to shared resource have completed - - /* Release protection. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 0; - - MOV w3, #0 // Build release protection value - STR w3, [x2, #0] // Release the protection - DSB ISH // To ensure update of the protection occurs before other CPUs awake - - /* Wake up waiting processors. Note interrupts are already enabled. */ - -#ifdef TX_ENABLE_WFE - SEV // Send event to other CPUs -#endif - - // } - // } - -_nobody_waiting_for_lock: LDR x4, [x0, #8] // Switch to thread stack pointer MOV sp, x4 // diff --git a/ports_smp/cortex_a55_smp/gnu/src/tx_thread_smp_protect.S b/ports_smp/cortex_a55_smp/gnu/src/tx_thread_smp_protect.S index 9cde3e08..b65af329 100644 --- a/ports_smp/cortex_a55_smp/gnu/src/tx_thread_smp_protect.S +++ b/ports_smp/cortex_a55_smp/gnu/src/tx_thread_smp_protect.S @@ -32,7 +32,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_smp_protect Cortex-A35-SMP/AC6 */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -63,11 +63,14 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ -/* improved SMP code, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ +/* improved SMP code, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_protect @@ -81,293 +84,49 @@ _tx_thread_smp_protect: /* Pickup the CPU ID. */ - MRS x1, MPIDR_EL1 // Pickup the core ID + MRS x2, MPIDR_EL1 // Pickup the core ID #ifdef TX_ARMV8_2 #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID + UBFX x7, x2, #16, #8 // Isolate cluster ID #endif - UBFX x1, x1, #8, #8 // Isolate core ID + UBFX x2, x2, #8, #8 // Isolate core ID #else #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID + UBFX x7, x2, #8, #8 // Isolate cluster ID #endif - UBFX x1, x1, #0, #8 // Isolate core ID + UBFX x2, x2, #0, #8 // Isolate core ID #endif #if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID + ADDS x2, x2, x7, LSL #2 // Calculate CPU ID #endif - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR x2, =_tx_thread_smp_protection // Build address to protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w1, w3 // Is it not this core? - BNE _protection_not_owned // No, the protection is not already owned - - /* We already have protection. */ - - /* Increment the protection count. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_count++; - - LDR w3, [x2, #8] // Pickup ownership count - ADD w3, w3, #1 // Increment ownership count - STR w3, [x2, #8] // Store ownership count - DMB ISH - - B _return - -_protection_not_owned: - - /* Is the lock available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Is the list empty? */ - // if (_tx_thread_smp_protect_wait_list_head == _tx_thread_smp_protect_wait_list_tail) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head - LDR w3, [x3] - LDR x4, =_tx_thread_smp_protect_wait_list_tail - LDR w4, [x4] - CMP w3, w4 - BNE _list_not_empty - - /* Try to get the lock. */ - // if (write_exclusive(&_tx_thread_smp_protection.tx_thread_smp_protect_in_force, 1) == SUCCESS) - // { - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - - /* We got the lock! */ - // _tx_thread_smp_protect_lock_got(); - - DMB ISH // Ensure write to protection finishes - _tx_thread_smp_protect_lock_got // Call the lock got function - - B _return - -_list_not_empty: - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _start_waiting - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _return - -_start_waiting: - - /* For one reason or another, we didn't get the lock. */ - - /* Increment wait count. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value - - /* Have we not added ourselves to the list yet? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 1) - // { - - CMP w4, #1 - BNE _already_in_list0 // Is this core already waiting? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - // } - -_already_in_list0: - - /* Restore interrupts. */ + LDR x1, =_tx_thread_smp_protection // Build address to protection structure + LDR w3, [x1, #4] // Pickup the owning core + CMP w3, w2 // Is it this core? + BEQ _owned // Yes, the protection is already owned + LDAXR w4, [x1, #0] // Pickup the protection flag + CBZ w4, _get_protection // Yes, get the protection MSR DAIF, x0 // Restore interrupts ISB // #ifdef TX_ENABLE_WFE WFE // Go into standby #endif + B _tx_thread_smp_protect // On waking, restart the protection attempt - /* We do this until we have the lock. */ - // while (1) - // { - -_try_to_get_lock: - - /* Disable interrupts so we don't get preempted. */ - - MRS x0, DAIF // Pickup current interrupt posture - MSR DAIFSet, 0x3 // Lockout interrupts - - /* Pickup the CPU ID. */ - - MRS x1, MPIDR_EL1 // Pickup the core ID -#ifdef TX_ARMV8_2 -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #8, #8 // Isolate core ID -#else -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #0, #8 // Isolate core ID -#endif -#if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID -#endif - - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR w3, [x2, #4] // Pickup the owning core - CMP w3, w1 // Is it this core? - BEQ _got_lock_after_waiting // Yes, the protection is already owned. This means - // an ISR preempted us and got protection - - // } - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _did_not_get_lock - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _did_not_get_lock // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _did_not_get_lock // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _got_lock_after_waiting - -_did_not_get_lock: - - /* For one reason or another, we didn't get the lock. */ - - /* Were we removed from the list? This can happen if we're a thread - and we got preempted. */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 0) - // { - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - CMP w4, #0 - BNE _already_in_list1 // Is this core already in the list? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - /* Our waiting count was also reset when we were preempted. Increment it again. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - // } - -_already_in_list1: - - /* Restore interrupts and try again. */ - +_get_protection: + MOV x4, #1 // Build lock value + STXR w5, w4, [x1] // Attempt to get the protection + CBZ w5, _got_protection // Did it succeed? w5 = 0 means success! MSR DAIF, x0 // Restore interrupts - ISB // -#ifdef TX_ENABLE_WFE - WFE // Go into standby -#endif - B _try_to_get_lock // On waking, restart the protection attempt - -_got_lock_after_waiting: - - /* We're no longer waiting. */ - // _tx_thread_smp_protect_wait_counts[this_core]--; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load waiting list - LDR w4, [x3, x1, LSL #2] // Load current wait value - SUB w4, w4, #1 // Decrement wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - /* Restore registers and return. */ - -_return: - + B _tx_thread_smp_protect // Restart the protection attempt + +_got_protection: + DMB ISH // + STR w2, [x1, #4] // Save owning core +_owned: + LDR w5, [x1, #8] // Pickup ownership count + ADD w5, w5, #1 // Increment ownership count + STR w5, [x1, #8] // Store ownership count + DMB ISH // RET diff --git a/ports_smp/cortex_a55_smp/gnu/src/tx_thread_smp_unprotect.S b/ports_smp/cortex_a55_smp/gnu/src/tx_thread_smp_unprotect.S index a783cde6..f9d8692a 100644 --- a/ports_smp/cortex_a55_smp/gnu/src/tx_thread_smp_unprotect.S +++ b/ports_smp/cortex_a55_smp/gnu/src/tx_thread_smp_unprotect.S @@ -60,10 +60,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_unprotect @@ -105,11 +108,6 @@ _tx_thread_smp_unprotect: CMP w3, #0 // Is the preempt disable flag set? BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protect_wait_counts // Build build address of wait counts - LDR w3, [x2, x1, LSL #2] // Pickup wait list value - CMP w3, #0 // Are any entities on this core waiting? - BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protection // Build address of protection structure MOV w3, #0xFFFFFFFF // Build invalid value STR w3, [x2, #4] // Mark the protected core as invalid diff --git a/ports_smp/cortex_a57_smp/ac6/example_build/sample_threadx/.cproject b/ports_smp/cortex_a57_smp/ac6/example_build/sample_threadx/.cproject index 2f75cb03..c5b82669 100644 --- a/ports_smp/cortex_a57_smp/ac6/example_build/sample_threadx/.cproject +++ b/ports_smp/cortex_a57_smp/ac6/example_build/sample_threadx/.cproject @@ -23,7 +23,7 @@ - + @@ -47,7 +47,7 @@ + + + + + + diff --git a/ports_smp/cortex_a57_smp/gnu/src/tx_thread_context_restore.S b/ports_smp/cortex_a57_smp/gnu/src/tx_thread_context_restore.S index 4df471ac..21deb75d 100644 --- a/ports_smp/cortex_a57_smp/gnu/src/tx_thread_context_restore.S +++ b/ports_smp/cortex_a57_smp/gnu/src/tx_thread_context_restore.S @@ -21,9 +21,6 @@ /**************************************************************************/ -/* Include macros for modifying the wait list. */ -#include "tx_thread_smp_protection_wait_list_macros.h" - .text .align 3 /**************************************************************************/ @@ -31,7 +28,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_context_restore ARMv8-A-SMP */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -63,10 +60,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_context_restore(VOID) @@ -216,74 +216,6 @@ __tx_thread_no_preempt_restore: // { __tx_thread_preempt_restore: - /* Was the thread being preempted waiting for the lock? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] != 0) - // { - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - CMP w3, #0 - BEQ _nobody_waiting_for_lock // Is the core waiting for the lock? - - /* Do we not have the lock? This means the ISR never got the inter-core lock. */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_owned != this_core) - // { - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w8, w3 // Compare our core to the owning core - BEQ _this_core_has_lock // Do we have the lock? - - /* We don't have the lock. This core should be in the list. Remove it. */ - // _tx_thread_smp_protect_wait_list_remove(this_core); - - _tx_thread_smp_protect_wait_list_remove // Call macro to remove core from the list - B _nobody_waiting_for_lock // Leave - - // } - // else - // { - /* We have the lock. This means the ISR got the inter-core lock, but - never released it because it saw that there was someone waiting. - Note this core is not in the list. */ - -_this_core_has_lock: - - /* We're no longer waiting. Note that this should be zero since this happens during thread preemption. */ - // _tx_thread_smp_protect_wait_counts[core]--; - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - SUB w3, w3, #1 // Decrement waiting value. Should be zero now - STR w3, [x2, x8, LSL #2] // Store new waiting value - - /* Now release the inter-core lock. */ - - /* Set protected core as invalid. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_core = 0xFFFFFFFF; - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - MOV w3, #0xFFFFFFFF // Build invalid value - STR w3, [x2, #4] // Mark the protected core as invalid - DMB ISH // Ensure that accesses to shared resource have completed - - /* Release protection. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 0; - - MOV w3, #0 // Build release protection value - STR w3, [x2, #0] // Release the protection - DSB ISH // To ensure update of the protection occurs before other CPUs awake - - /* Wake up waiting processors. Note interrupts are already enabled. */ - -#ifdef TX_ENABLE_WFE - SEV // Send event to other CPUs -#endif - - // } - // } - -_nobody_waiting_for_lock: LDR x4, [x0, #8] // Switch to thread stack pointer MOV sp, x4 // diff --git a/ports_smp/cortex_a57_smp/gnu/src/tx_thread_smp_protect.S b/ports_smp/cortex_a57_smp/gnu/src/tx_thread_smp_protect.S index 9cde3e08..b65af329 100644 --- a/ports_smp/cortex_a57_smp/gnu/src/tx_thread_smp_protect.S +++ b/ports_smp/cortex_a57_smp/gnu/src/tx_thread_smp_protect.S @@ -32,7 +32,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_smp_protect Cortex-A35-SMP/AC6 */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -63,11 +63,14 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ -/* improved SMP code, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ +/* improved SMP code, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_protect @@ -81,293 +84,49 @@ _tx_thread_smp_protect: /* Pickup the CPU ID. */ - MRS x1, MPIDR_EL1 // Pickup the core ID + MRS x2, MPIDR_EL1 // Pickup the core ID #ifdef TX_ARMV8_2 #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID + UBFX x7, x2, #16, #8 // Isolate cluster ID #endif - UBFX x1, x1, #8, #8 // Isolate core ID + UBFX x2, x2, #8, #8 // Isolate core ID #else #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID + UBFX x7, x2, #8, #8 // Isolate cluster ID #endif - UBFX x1, x1, #0, #8 // Isolate core ID + UBFX x2, x2, #0, #8 // Isolate core ID #endif #if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID + ADDS x2, x2, x7, LSL #2 // Calculate CPU ID #endif - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR x2, =_tx_thread_smp_protection // Build address to protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w1, w3 // Is it not this core? - BNE _protection_not_owned // No, the protection is not already owned - - /* We already have protection. */ - - /* Increment the protection count. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_count++; - - LDR w3, [x2, #8] // Pickup ownership count - ADD w3, w3, #1 // Increment ownership count - STR w3, [x2, #8] // Store ownership count - DMB ISH - - B _return - -_protection_not_owned: - - /* Is the lock available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Is the list empty? */ - // if (_tx_thread_smp_protect_wait_list_head == _tx_thread_smp_protect_wait_list_tail) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head - LDR w3, [x3] - LDR x4, =_tx_thread_smp_protect_wait_list_tail - LDR w4, [x4] - CMP w3, w4 - BNE _list_not_empty - - /* Try to get the lock. */ - // if (write_exclusive(&_tx_thread_smp_protection.tx_thread_smp_protect_in_force, 1) == SUCCESS) - // { - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - - /* We got the lock! */ - // _tx_thread_smp_protect_lock_got(); - - DMB ISH // Ensure write to protection finishes - _tx_thread_smp_protect_lock_got // Call the lock got function - - B _return - -_list_not_empty: - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _start_waiting - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _return - -_start_waiting: - - /* For one reason or another, we didn't get the lock. */ - - /* Increment wait count. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value - - /* Have we not added ourselves to the list yet? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 1) - // { - - CMP w4, #1 - BNE _already_in_list0 // Is this core already waiting? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - // } - -_already_in_list0: - - /* Restore interrupts. */ + LDR x1, =_tx_thread_smp_protection // Build address to protection structure + LDR w3, [x1, #4] // Pickup the owning core + CMP w3, w2 // Is it this core? + BEQ _owned // Yes, the protection is already owned + LDAXR w4, [x1, #0] // Pickup the protection flag + CBZ w4, _get_protection // Yes, get the protection MSR DAIF, x0 // Restore interrupts ISB // #ifdef TX_ENABLE_WFE WFE // Go into standby #endif + B _tx_thread_smp_protect // On waking, restart the protection attempt - /* We do this until we have the lock. */ - // while (1) - // { - -_try_to_get_lock: - - /* Disable interrupts so we don't get preempted. */ - - MRS x0, DAIF // Pickup current interrupt posture - MSR DAIFSet, 0x3 // Lockout interrupts - - /* Pickup the CPU ID. */ - - MRS x1, MPIDR_EL1 // Pickup the core ID -#ifdef TX_ARMV8_2 -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #8, #8 // Isolate core ID -#else -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #0, #8 // Isolate core ID -#endif -#if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID -#endif - - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR w3, [x2, #4] // Pickup the owning core - CMP w3, w1 // Is it this core? - BEQ _got_lock_after_waiting // Yes, the protection is already owned. This means - // an ISR preempted us and got protection - - // } - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _did_not_get_lock - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _did_not_get_lock // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _did_not_get_lock // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _got_lock_after_waiting - -_did_not_get_lock: - - /* For one reason or another, we didn't get the lock. */ - - /* Were we removed from the list? This can happen if we're a thread - and we got preempted. */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 0) - // { - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - CMP w4, #0 - BNE _already_in_list1 // Is this core already in the list? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - /* Our waiting count was also reset when we were preempted. Increment it again. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - // } - -_already_in_list1: - - /* Restore interrupts and try again. */ - +_get_protection: + MOV x4, #1 // Build lock value + STXR w5, w4, [x1] // Attempt to get the protection + CBZ w5, _got_protection // Did it succeed? w5 = 0 means success! MSR DAIF, x0 // Restore interrupts - ISB // -#ifdef TX_ENABLE_WFE - WFE // Go into standby -#endif - B _try_to_get_lock // On waking, restart the protection attempt - -_got_lock_after_waiting: - - /* We're no longer waiting. */ - // _tx_thread_smp_protect_wait_counts[this_core]--; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load waiting list - LDR w4, [x3, x1, LSL #2] // Load current wait value - SUB w4, w4, #1 // Decrement wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - /* Restore registers and return. */ - -_return: - + B _tx_thread_smp_protect // Restart the protection attempt + +_got_protection: + DMB ISH // + STR w2, [x1, #4] // Save owning core +_owned: + LDR w5, [x1, #8] // Pickup ownership count + ADD w5, w5, #1 // Increment ownership count + STR w5, [x1, #8] // Store ownership count + DMB ISH // RET diff --git a/ports_smp/cortex_a57_smp/gnu/src/tx_thread_smp_unprotect.S b/ports_smp/cortex_a57_smp/gnu/src/tx_thread_smp_unprotect.S index a783cde6..f9d8692a 100644 --- a/ports_smp/cortex_a57_smp/gnu/src/tx_thread_smp_unprotect.S +++ b/ports_smp/cortex_a57_smp/gnu/src/tx_thread_smp_unprotect.S @@ -60,10 +60,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_unprotect @@ -105,11 +108,6 @@ _tx_thread_smp_unprotect: CMP w3, #0 // Is the preempt disable flag set? BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protect_wait_counts // Build build address of wait counts - LDR w3, [x2, x1, LSL #2] // Pickup wait list value - CMP w3, #0 // Are any entities on this core waiting? - BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protection // Build address of protection structure MOV w3, #0xFFFFFFFF // Build invalid value STR w3, [x2, #4] // Mark the protected core as invalid diff --git a/ports_smp/cortex_a5x_smp/ac6/src/tx_thread_context_restore.S b/ports_smp/cortex_a5x_smp/ac6/src/tx_thread_context_restore.S index 10c9b909..67aa5afb 100644 --- a/ports_smp/cortex_a5x_smp/ac6/src/tx_thread_context_restore.S +++ b/ports_smp/cortex_a5x_smp/ac6/src/tx_thread_context_restore.S @@ -21,9 +21,6 @@ /**************************************************************************/ -/* Include macros for modifying the wait list. */ -#include "tx_thread_smp_protection_wait_list_macros.h" - .text .align 3 /**************************************************************************/ @@ -31,7 +28,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_context_restore Cortex-A5x-SMP/AC6 */ -/* 6.1.9 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -63,10 +60,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 10-15-2021 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ -/* resulting in version 6.1.9 */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_context_restore(VOID) @@ -79,7 +79,7 @@ _tx_thread_context_restore: MSR DAIFSet, 0x3 // Lockout interrupts -#ifdef TX_ENABLE_EXECUTION_CHANGE_NOTIFY +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) /* Call the ISR exit function to indicate an ISR is complete. */ @@ -216,74 +216,6 @@ __tx_thread_no_preempt_restore: // { __tx_thread_preempt_restore: - /* Was the thread being preempted waiting for the lock? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] != 0) - // { - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - CMP w3, #0 - BEQ _nobody_waiting_for_lock // Is the core waiting for the lock? - - /* Do we not have the lock? This means the ISR never got the inter-core lock. */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_owned != this_core) - // { - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w8, w3 // Compare our core to the owning core - BEQ _this_core_has_lock // Do we have the lock? - - /* We don't have the lock. This core should be in the list. Remove it. */ - // _tx_thread_smp_protect_wait_list_remove(this_core); - - _tx_thread_smp_protect_wait_list_remove // Call macro to remove core from the list - B _nobody_waiting_for_lock // Leave - - // } - // else - // { - /* We have the lock. This means the ISR got the inter-core lock, but - never released it because it saw that there was someone waiting. - Note this core is not in the list. */ - -_this_core_has_lock: - - /* We're no longer waiting. Note that this should be zero since this happens during thread preemption. */ - // _tx_thread_smp_protect_wait_counts[core]--; - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - SUB w3, w3, #1 // Decrement waiting value. Should be zero now - STR w3, [x2, x8, LSL #2] // Store new waiting value - - /* Now release the inter-core lock. */ - - /* Set protected core as invalid. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_core = 0xFFFFFFFF; - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - MOV w3, #0xFFFFFFFF // Build invalid value - STR w3, [x2, #4] // Mark the protected core as invalid - DMB ISH // Ensure that accesses to shared resource have completed - - /* Release protection. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 0; - - MOV w3, #0 // Build release protection value - STR w3, [x2, #0] // Release the protection - DSB ISH // To ensure update of the protection occurs before other CPUs awake - - /* Wake up waiting processors. Note interrupts are already enabled. */ - -#ifdef TX_ENABLE_WFE - SEV // Send event to other CPUs -#endif - - // } - // } - -_nobody_waiting_for_lock: LDR x4, [x0, #8] // Switch to thread stack pointer MOV sp, x4 // diff --git a/ports_smp/cortex_a5x_smp/ac6/src/tx_thread_smp_protect.S b/ports_smp/cortex_a5x_smp/ac6/src/tx_thread_smp_protect.S index 3c03defd..26ad8d32 100644 --- a/ports_smp/cortex_a5x_smp/ac6/src/tx_thread_smp_protect.S +++ b/ports_smp/cortex_a5x_smp/ac6/src/tx_thread_smp_protect.S @@ -32,7 +32,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_smp_protect Cortex-A5x-SMP/AC6 */ -/* 6.1.9 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -63,11 +63,14 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 10-15-2021 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ -/* improved SMP code, */ -/* resulting in version 6.1.9 */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ +/* improved SMP code, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_protect @@ -81,293 +84,49 @@ _tx_thread_smp_protect: /* Pickup the CPU ID. */ - MRS x1, MPIDR_EL1 // Pickup the core ID + MRS x2, MPIDR_EL1 // Pickup the core ID #ifdef TX_ARMV8_2 #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID + UBFX x7, x2, #16, #8 // Isolate cluster ID #endif - UBFX x1, x1, #8, #8 // Isolate core ID + UBFX x2, x2, #8, #8 // Isolate core ID #else #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID + UBFX x7, x2, #8, #8 // Isolate cluster ID #endif - UBFX x1, x1, #0, #8 // Isolate core ID + UBFX x2, x2, #0, #8 // Isolate core ID #endif #if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID + ADDS x2, x2, x7, LSL #2 // Calculate CPU ID #endif - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR x2, =_tx_thread_smp_protection // Build address to protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w1, w3 // Is it not this core? - BNE _protection_not_owned // No, the protection is not already owned - - /* We already have protection. */ - - /* Increment the protection count. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_count++; - - LDR w3, [x2, #8] // Pickup ownership count - ADD w3, w3, #1 // Increment ownership count - STR w3, [x2, #8] // Store ownership count - DMB ISH - - B _return - -_protection_not_owned: - - /* Is the lock available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Is the list empty? */ - // if (_tx_thread_smp_protect_wait_list_head == _tx_thread_smp_protect_wait_list_tail) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head - LDR w3, [x3] - LDR x4, =_tx_thread_smp_protect_wait_list_tail - LDR w4, [x4] - CMP w3, w4 - BNE _list_not_empty - - /* Try to get the lock. */ - // if (write_exclusive(&_tx_thread_smp_protection.tx_thread_smp_protect_in_force, 1) == SUCCESS) - // { - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - - /* We got the lock! */ - // _tx_thread_smp_protect_lock_got(); - - DMB ISH // Ensure write to protection finishes - _tx_thread_smp_protect_lock_got // Call the lock got function - - B _return - -_list_not_empty: - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _start_waiting - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _return - -_start_waiting: - - /* For one reason or another, we didn't get the lock. */ - - /* Increment wait count. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value - - /* Have we not added ourselves to the list yet? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 1) - // { - - CMP w4, #1 - BNE _already_in_list0 // Is this core already waiting? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - // } - -_already_in_list0: - - /* Restore interrupts. */ + LDR x1, =_tx_thread_smp_protection // Build address to protection structure + LDR w3, [x1, #4] // Pickup the owning core + CMP w3, w2 // Is it this core? + BEQ _owned // Yes, the protection is already owned + LDAXR w4, [x1, #0] // Pickup the protection flag + CBZ w4, _get_protection // Yes, get the protection MSR DAIF, x0 // Restore interrupts ISB // #ifdef TX_ENABLE_WFE WFE // Go into standby #endif + B _tx_thread_smp_protect // On waking, restart the protection attempt - /* We do this until we have the lock. */ - // while (1) - // { - -_try_to_get_lock: - - /* Disable interrupts so we don't get preempted. */ - - MRS x0, DAIF // Pickup current interrupt posture - MSR DAIFSet, 0x3 // Lockout interrupts - - /* Pickup the CPU ID. */ - - MRS x1, MPIDR_EL1 // Pickup the core ID -#ifdef TX_ARMV8_2 -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #8, #8 // Isolate core ID -#else -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #0, #8 // Isolate core ID -#endif -#if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID -#endif - - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR w3, [x2, #4] // Pickup the owning core - CMP w3, w1 // Is it this core? - BEQ _got_lock_after_waiting // Yes, the protection is already owned. This means - // an ISR preempted us and got protection - - // } - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _did_not_get_lock - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _did_not_get_lock // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _did_not_get_lock // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _got_lock_after_waiting - -_did_not_get_lock: - - /* For one reason or another, we didn't get the lock. */ - - /* Were we removed from the list? This can happen if we're a thread - and we got preempted. */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 0) - // { - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - CMP w4, #0 - BNE _already_in_list1 // Is this core already in the list? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - /* Our waiting count was also reset when we were preempted. Increment it again. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - // } - -_already_in_list1: - - /* Restore interrupts and try again. */ - +_get_protection: + MOV x4, #1 // Build lock value + STXR w5, w4, [x1] // Attempt to get the protection + CBZ w5, _got_protection // Did it succeed? w5 = 0 means success! MSR DAIF, x0 // Restore interrupts - ISB // -#ifdef TX_ENABLE_WFE - WFE // Go into standby -#endif - B _try_to_get_lock // On waking, restart the protection attempt - -_got_lock_after_waiting: - - /* We're no longer waiting. */ - // _tx_thread_smp_protect_wait_counts[this_core]--; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load waiting list - LDR w4, [x3, x1, LSL #2] // Load current wait value - SUB w4, w4, #1 // Decrement wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - /* Restore registers and return. */ - -_return: - + B _tx_thread_smp_protect // Restart the protection attempt + +_got_protection: + DMB ISH // + STR w2, [x1, #4] // Save owning core +_owned: + LDR w5, [x1, #8] // Pickup ownership count + ADD w5, w5, #1 // Increment ownership count + STR w5, [x1, #8] // Store ownership count + DMB ISH // RET diff --git a/ports_smp/cortex_a5x_smp/ac6/src/tx_thread_smp_unprotect.S b/ports_smp/cortex_a5x_smp/ac6/src/tx_thread_smp_unprotect.S index 253ae916..30901452 100644 --- a/ports_smp/cortex_a5x_smp/ac6/src/tx_thread_smp_unprotect.S +++ b/ports_smp/cortex_a5x_smp/ac6/src/tx_thread_smp_unprotect.S @@ -28,7 +28,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_smp_unprotect Cortex-A5x-SMP/AC6 */ -/* 6.1.9 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -60,10 +60,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 10-15-2021 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ -/* resulting in version 6.1.9 */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_unprotect @@ -105,11 +108,6 @@ _tx_thread_smp_unprotect: CMP w3, #0 // Is the preempt disable flag set? BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protect_wait_counts // Build build address of wait counts - LDR w3, [x2, x1, LSL #2] // Pickup wait list value - CMP w3, #0 // Are any entities on this core waiting? - BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protection // Build address of protection structure MOV w3, #0xFFFFFFFF // Build invalid value STR w3, [x2, #4] // Mark the protected core as invalid diff --git a/ports_smp/cortex_a5x_smp/gnu/src/tx_thread_context_restore.S b/ports_smp/cortex_a5x_smp/gnu/src/tx_thread_context_restore.S index a604623e..06fbb655 100644 --- a/ports_smp/cortex_a5x_smp/gnu/src/tx_thread_context_restore.S +++ b/ports_smp/cortex_a5x_smp/gnu/src/tx_thread_context_restore.S @@ -21,9 +21,6 @@ /**************************************************************************/ -/* Include macros for modifying the wait list. */ -#include "tx_thread_smp_protection_wait_list_macros.h" - .text .align 3 /**************************************************************************/ @@ -31,7 +28,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_context_restore Cortex-A5x-SMP/GCC */ -/* 6.1.9 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -63,10 +60,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 10-15-2021 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ -/* resulting in version 6.1.9 */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_context_restore(VOID) @@ -79,7 +79,7 @@ _tx_thread_context_restore: MSR DAIFSet, 0x3 // Lockout interrupts -#ifdef TX_ENABLE_EXECUTION_CHANGE_NOTIFY +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) /* Call the ISR exit function to indicate an ISR is complete. */ @@ -216,74 +216,6 @@ __tx_thread_no_preempt_restore: // { __tx_thread_preempt_restore: - /* Was the thread being preempted waiting for the lock? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] != 0) - // { - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - CMP w3, #0 - BEQ _nobody_waiting_for_lock // Is the core waiting for the lock? - - /* Do we not have the lock? This means the ISR never got the inter-core lock. */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_owned != this_core) - // { - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w8, w3 // Compare our core to the owning core - BEQ _this_core_has_lock // Do we have the lock? - - /* We don't have the lock. This core should be in the list. Remove it. */ - // _tx_thread_smp_protect_wait_list_remove(this_core); - - _tx_thread_smp_protect_wait_list_remove // Call macro to remove core from the list - B _nobody_waiting_for_lock // Leave - - // } - // else - // { - /* We have the lock. This means the ISR got the inter-core lock, but - never released it because it saw that there was someone waiting. - Note this core is not in the list. */ - -_this_core_has_lock: - - /* We're no longer waiting. Note that this should be zero since this happens during thread preemption. */ - // _tx_thread_smp_protect_wait_counts[core]--; - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - SUB w3, w3, #1 // Decrement waiting value. Should be zero now - STR w3, [x2, x8, LSL #2] // Store new waiting value - - /* Now release the inter-core lock. */ - - /* Set protected core as invalid. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_core = 0xFFFFFFFF; - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - MOV w3, #0xFFFFFFFF // Build invalid value - STR w3, [x2, #4] // Mark the protected core as invalid - DMB ISH // Ensure that accesses to shared resource have completed - - /* Release protection. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 0; - - MOV w3, #0 // Build release protection value - STR w3, [x2, #0] // Release the protection - DSB ISH // To ensure update of the protection occurs before other CPUs awake - - /* Wake up waiting processors. Note interrupts are already enabled. */ - -#ifdef TX_ENABLE_WFE - SEV // Send event to other CPUs -#endif - - // } - // } - -_nobody_waiting_for_lock: LDR x4, [x0, #8] // Switch to thread stack pointer MOV sp, x4 // diff --git a/ports_smp/cortex_a5x_smp/gnu/src/tx_thread_smp_protect.S b/ports_smp/cortex_a5x_smp/gnu/src/tx_thread_smp_protect.S index 09de5c57..f95083e3 100644 --- a/ports_smp/cortex_a5x_smp/gnu/src/tx_thread_smp_protect.S +++ b/ports_smp/cortex_a5x_smp/gnu/src/tx_thread_smp_protect.S @@ -32,7 +32,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_smp_protect Cortex-A5x-SMP/GCC */ -/* 6.1.9 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -63,11 +63,14 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 10-15-2021 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ -/* improved SMP code, */ -/* resulting in version 6.1.9 */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ +/* improved SMP code, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_protect @@ -81,293 +84,49 @@ _tx_thread_smp_protect: /* Pickup the CPU ID. */ - MRS x1, MPIDR_EL1 // Pickup the core ID + MRS x2, MPIDR_EL1 // Pickup the core ID #ifdef TX_ARMV8_2 #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID + UBFX x7, x2, #16, #8 // Isolate cluster ID #endif - UBFX x1, x1, #8, #8 // Isolate core ID + UBFX x2, x2, #8, #8 // Isolate core ID #else #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID + UBFX x7, x2, #8, #8 // Isolate cluster ID #endif - UBFX x1, x1, #0, #8 // Isolate core ID + UBFX x2, x2, #0, #8 // Isolate core ID #endif #if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID + ADDS x2, x2, x7, LSL #2 // Calculate CPU ID #endif - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR x2, =_tx_thread_smp_protection // Build address to protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w1, w3 // Is it not this core? - BNE _protection_not_owned // No, the protection is not already owned - - /* We already have protection. */ - - /* Increment the protection count. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_count++; - - LDR w3, [x2, #8] // Pickup ownership count - ADD w3, w3, #1 // Increment ownership count - STR w3, [x2, #8] // Store ownership count - DMB ISH - - B _return - -_protection_not_owned: - - /* Is the lock available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Is the list empty? */ - // if (_tx_thread_smp_protect_wait_list_head == _tx_thread_smp_protect_wait_list_tail) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head - LDR w3, [x3] - LDR x4, =_tx_thread_smp_protect_wait_list_tail - LDR w4, [x4] - CMP w3, w4 - BNE _list_not_empty - - /* Try to get the lock. */ - // if (write_exclusive(&_tx_thread_smp_protection.tx_thread_smp_protect_in_force, 1) == SUCCESS) - // { - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - - /* We got the lock! */ - // _tx_thread_smp_protect_lock_got(); - - DMB ISH // Ensure write to protection finishes - _tx_thread_smp_protect_lock_got // Call the lock got function - - B _return - -_list_not_empty: - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _start_waiting - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _return - -_start_waiting: - - /* For one reason or another, we didn't get the lock. */ - - /* Increment wait count. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value - - /* Have we not added ourselves to the list yet? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 1) - // { - - CMP w4, #1 - BNE _already_in_list0 // Is this core already waiting? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - // } - -_already_in_list0: - - /* Restore interrupts. */ + LDR x1, =_tx_thread_smp_protection // Build address to protection structure + LDR w3, [x1, #4] // Pickup the owning core + CMP w3, w2 // Is it this core? + BEQ _owned // Yes, the protection is already owned + LDAXR w4, [x1, #0] // Pickup the protection flag + CBZ w4, _get_protection // Yes, get the protection MSR DAIF, x0 // Restore interrupts ISB // #ifdef TX_ENABLE_WFE WFE // Go into standby #endif + B _tx_thread_smp_protect // On waking, restart the protection attempt - /* We do this until we have the lock. */ - // while (1) - // { - -_try_to_get_lock: - - /* Disable interrupts so we don't get preempted. */ - - MRS x0, DAIF // Pickup current interrupt posture - MSR DAIFSet, 0x3 // Lockout interrupts - - /* Pickup the CPU ID. */ - - MRS x1, MPIDR_EL1 // Pickup the core ID -#ifdef TX_ARMV8_2 -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #8, #8 // Isolate core ID -#else -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #0, #8 // Isolate core ID -#endif -#if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID -#endif - - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR w3, [x2, #4] // Pickup the owning core - CMP w3, w1 // Is it this core? - BEQ _got_lock_after_waiting // Yes, the protection is already owned. This means - // an ISR preempted us and got protection - - // } - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _did_not_get_lock - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _did_not_get_lock // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _did_not_get_lock // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _got_lock_after_waiting - -_did_not_get_lock: - - /* For one reason or another, we didn't get the lock. */ - - /* Were we removed from the list? This can happen if we're a thread - and we got preempted. */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 0) - // { - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - CMP w4, #0 - BNE _already_in_list1 // Is this core already in the list? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - /* Our waiting count was also reset when we were preempted. Increment it again. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - // } - -_already_in_list1: - - /* Restore interrupts and try again. */ - +_get_protection: + MOV x4, #1 // Build lock value + STXR w5, w4, [x1] // Attempt to get the protection + CBZ w5, _got_protection // Did it succeed? w5 = 0 means success! MSR DAIF, x0 // Restore interrupts - ISB // -#ifdef TX_ENABLE_WFE - WFE // Go into standby -#endif - B _try_to_get_lock // On waking, restart the protection attempt - -_got_lock_after_waiting: - - /* We're no longer waiting. */ - // _tx_thread_smp_protect_wait_counts[this_core]--; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load waiting list - LDR w4, [x3, x1, LSL #2] // Load current wait value - SUB w4, w4, #1 // Decrement wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - /* Restore registers and return. */ - -_return: - + B _tx_thread_smp_protect // Restart the protection attempt + +_got_protection: + DMB ISH // + STR w2, [x1, #4] // Save owning core +_owned: + LDR w5, [x1, #8] // Pickup ownership count + ADD w5, w5, #1 // Increment ownership count + STR w5, [x1, #8] // Store ownership count + DMB ISH // RET diff --git a/ports_smp/cortex_a5x_smp/gnu/src/tx_thread_smp_unprotect.S b/ports_smp/cortex_a5x_smp/gnu/src/tx_thread_smp_unprotect.S index 936539be..b4f934ae 100644 --- a/ports_smp/cortex_a5x_smp/gnu/src/tx_thread_smp_unprotect.S +++ b/ports_smp/cortex_a5x_smp/gnu/src/tx_thread_smp_unprotect.S @@ -28,7 +28,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_smp_unprotect Cortex-A5x-SMP/GCC */ -/* 6.1.9 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -60,9 +60,12 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 10-15-2021 Andres Mlinar Updated comments, */ -/* resulting in version 6.1.9 */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 10-15-2021 Andres Mlinar Updated comments, */ +/* resulting in version 6.1.9 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_unprotect @@ -104,11 +107,6 @@ _tx_thread_smp_unprotect: CMP w3, #0 // Is the preempt disable flag set? BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protect_wait_counts // Build build address of wait counts - LDR w3, [x2, x1, LSL #2] // Pickup wait list value - CMP w3, #0 // Are any entities on this core waiting? - BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protection // Build address of protection structure MOV w3, #0xFFFFFFFF // Build invalid value STR w3, [x2, #4] // Mark the protected core as invalid diff --git a/ports_smp/cortex_a5x_smp/iar/src/tx_thread_context_restore.S b/ports_smp/cortex_a5x_smp/iar/src/tx_thread_context_restore.S index 384c1ada..8aa5116b 100644 --- a/ports_smp/cortex_a5x_smp/iar/src/tx_thread_context_restore.S +++ b/ports_smp/cortex_a5x_smp/iar/src/tx_thread_context_restore.S @@ -21,17 +21,6 @@ /**************************************************************************/ -/* #define TX_SOURCE_CODE */ - - -/* Include necessary system files. */ - -/* -#include "tx_api.h" -#include "tx_thread.h" -#include "tx_timer.h" -*/ - EXTERN _tx_thread_system_state EXTERN _tx_thread_current_ptr EXTERN _tx_thread_execute_ptr @@ -54,15 +43,12 @@ SECTION `.text`:CODE:NOROOT(3) CODE -/* Include macros for modifying the wait list. */ -#include "tx_thread_smp_protection_wait_list_macros.h" - /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _tx_thread_context_restore Cortex-A5x-SMP/IAR */ -/* 6.1.9 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -95,10 +81,13 @@ /* DATE NAME DESCRIPTION */ /* */ /* 10-15-2021 William E. Lamie Initial Version 6.1.9 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ -/* VOID _tx_thread_context_restore(VOID) -{ */ +// VOID _tx_thread_context_restore(VOID) +// { PUBLIC _tx_thread_context_restore _tx_thread_context_restore: @@ -106,7 +95,7 @@ _tx_thread_context_restore: MSR DAIFSet, 0x3 // Lockout interrupts -#ifdef TX_ENABLE_EXECUTION_CHANGE_NOTIFY +#if (defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)) /* Call the ISR exit function to indicate an ISR is complete. */ @@ -132,8 +121,8 @@ _tx_thread_context_restore: #endif /* Determine if interrupts are nested. */ - /* if (--_tx_thread_system_state) - { */ + // if (--_tx_thread_system_state) + // { LDR x3, =_tx_thread_system_state // Pickup address of system state var LDR w2, [x3, x8, LSL #2] // Pickup system state @@ -173,13 +162,13 @@ _tx_thread_context_restore: LDP x29, x30, [sp], #16 // Recover x29, x30 ERET // Return to point of interrupt - /* } */ + // } __tx_thread_not_nested_restore: /* Determine if a thread was interrupted and no preemption is required. */ - /* else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr) - || (_tx_thread_preempt_disable)) - { */ + // else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr) + // || (_tx_thread_preempt_disable)) + // { LDR x1, =_tx_thread_current_ptr // Pickup address of current thread ptr LDR x0, [x1, x8, LSL #3] // Pickup actual current thread pointer @@ -205,7 +194,7 @@ __tx_thread_no_preempt_restore: /* Restore interrupted thread or ISR. */ /* Pickup the saved stack pointer. */ - /* sp = _tx_thread_current_ptr -> tx_thread_stack_ptr; */ + // sp = _tx_thread_current_ptr -> tx_thread_stack_ptr; LDR x4, [x0, #8] // Switch to thread stack pointer MOV sp, x4 // @@ -238,80 +227,11 @@ __tx_thread_no_preempt_restore: LDP x29, x30, [sp], #16 // Recover x29, x30 ERET // Return to point of interrupt - /* } - else - { */ + // } + // else + // { __tx_thread_preempt_restore: - /* Was the thread being preempted waiting for the lock? */ - /* if (_tx_thread_smp_protect_wait_counts[this_core] != 0) - { */ - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - CMP w3, #0 - B.EQ _nobody_waiting_for_lock // Is the core waiting for the lock? - - /* Do we not have the lock? This means the ISR never got the inter-core lock. */ - /* if (_tx_thread_smp_protection.tx_thread_smp_protect_owned != this_core) - { */ - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w8, w3 // Compare our core to the owning core - B.EQ _this_core_has_lock // Do we have the lock? - - /* We don't have the lock. This core should be in the list. Remove it. */ - /* _tx_thread_smp_protect_wait_list_remove(this_core); */ - - _tx_thread_smp_protect_wait_list_remove // Call macro to remove core from the list - - B _nobody_waiting_for_lock // Leave - - /* } - else - { */ - /* We have the lock. This means the ISR got the inter-core lock, but - never released it because it saw that there was someone waiting. - Note this core is not in the list. */ - -_this_core_has_lock: - - /* We're no longer waiting. Note that this should be zero since this happens during thread preemption. */ - /* _tx_thread_smp_protect_wait_counts[core]--; */ - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - SUB w3, w3, #1 // Decrement waiting value. Should be zero now - STR w3, [x2, x8, LSL #2] // Store new waiting value - - /* Now release the inter-core lock. */ - - /* Set protected core as invalid. */ - /* _tx_thread_smp_protection.tx_thread_smp_protect_core = 0xFFFFFFFF; */ - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - MOV w3, #0xFFFFFFFF // Build invalid value - STR w3, [x2, #4] // Mark the protected core as invalid - DMB ISH // Ensure that accesses to shared resource have completed - - /* Release protection. */ - /* _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 0; */ - - MOV w3, #0 // Build release protection value - STR w3, [x2, #0] // Release the protection - DSB ISH // To ensure update of the protection occurs before other CPUs awake - - /* Wake up waiting processors. Note interrupts are already enabled. */ - -#ifdef TX_ENABLE_WFE - SEV // Send event to other CPUs -#endif - - /* } - } */ - -_nobody_waiting_for_lock: LDR x4, [x0, #8] // Switch to thread stack pointer MOV sp, x4 // @@ -358,27 +278,27 @@ _skip_fp_save: /* Save the remaining time-slice and disable it. */ - /* if (_tx_timer_time_slice) - { */ + // if (_tx_timer_time_slice) + // { LDR x3, =_tx_timer_time_slice // Pickup time-slice variable address LDR w2, [x3, x8, LSL #2] // Pickup time-slice CMP w2, #0 // Is it active? B.EQ __tx_thread_dont_save_ts // No, don't save it - /* _tx_thread_current_ptr -> tx_thread_time_slice = _tx_timer_time_slice; - _tx_timer_time_slice = 0; */ + // _tx_thread_current_ptr -> tx_thread_time_slice = _tx_timer_time_slice; + // _tx_timer_time_slice = 0; STR w2, [x0, #36] // Save thread's time-slice MOV w2, #0 // Clear value STR w2, [x3, x8, LSL #2] // Disable global time-slice flag - /* } */ + // } __tx_thread_dont_save_ts: /* Clear the current task pointer. */ - /* _tx_thread_current_ptr = TX_NULL; */ + // _tx_thread_current_ptr = TX_NULL; MOV x2, #0 // NULL value STR x2, [x1, x8, LSL #3] // Clear current thread pointer @@ -386,13 +306,13 @@ __tx_thread_dont_save_ts: /* Set bit indicating this thread is ready for execution. */ MOV x2, #1 // Build ready flag - DMB ISH // Ensure that accesses to shared resource have completed STR w2, [x0, #260] // Set thread's ready flag + DMB ISH // Ensure that accesses to shared resource have completed /* Return to the scheduler. */ - /* _tx_thread_schedule(); */ + // _tx_thread_schedule(); - /* } */ + // } __tx_thread_idle_system_restore: @@ -415,5 +335,5 @@ __tx_thread_idle_system_restore: #endif #endif ERET // Return to scheduler -/* } */ +// } END diff --git a/ports_smp/cortex_a5x_smp/iar/src/tx_thread_smp_protect.S b/ports_smp/cortex_a5x_smp/iar/src/tx_thread_smp_protect.S index c5b30d2f..e6f6e62a 100644 --- a/ports_smp/cortex_a5x_smp/iar/src/tx_thread_smp_protect.S +++ b/ports_smp/cortex_a5x_smp/iar/src/tx_thread_smp_protect.S @@ -45,15 +45,13 @@ SECTION `.text`:CODE:NOROOT(3) CODE - /* Include macros for modifying the wait list. */ - #include "tx_thread_smp_protection_wait_list_macros.h" /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _tx_thread_smp_protect Cortex-A5x-SMP/IAR */ -/* 6.1.9 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -85,6 +83,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 10-15-2021 William E. Lamie Initial Version 6.1.9 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ PUBLIC _tx_thread_smp_protect @@ -97,295 +98,51 @@ _tx_thread_smp_protect: /* Pickup the CPU ID. */ - MRS x1, MPIDR_EL1 // Pickup the core ID + MRS x2, MPIDR_EL1 // Pickup the core ID #ifdef TX_ARMV8_2 #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID + UBFX x7, x2, #16, #8 // Isolate cluster ID #endif - UBFX x1, x1, #8, #8 // Isolate core ID + UBFX x2, x2, #8, #8 // Isolate core ID #else #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID + UBFX x7, x2, #8, #8 // Isolate cluster ID #endif - UBFX x1, x1, #0, #8 // Isolate core ID + UBFX x2, x2, #0, #8 // Isolate core ID #endif #if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID + ADDS x2, x2, x7, LSL #2 // Calculate CPU ID #endif - /* Do we already have protection? */ - /* if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - { */ - - LDR x2, =_tx_thread_smp_protection // Build address to protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w1, w3 // Is it not this core? - B.NE _protection_not_owned // No, the protection is not already owned - - /* We already have protection. */ - - /* Increment the protection count. */ - /* _tx_thread_smp_protection.tx_thread_smp_protect_count++; */ - - LDR w3, [x2, #8] // Pickup ownership count - ADD w3, w3, #1 // Increment ownership count - STR w3, [x2, #8] // Store ownership count - DMB ISH - - B _return - -_protection_not_owned: - - /* Is the lock available? */ - /* if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - { */ - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - B.NE _start_waiting // No, protection not available - - /* Is the list empty? */ - /* if (_tx_thread_smp_protect_wait_list_head == _tx_thread_smp_protect_wait_list_tail) - { */ - - LDR x3, =_tx_thread_smp_protect_wait_list_head - LDR w3, [x3] - LDR x4, =_tx_thread_smp_protect_wait_list_tail - LDR w4, [x4] - CMP w3, w4 - B.NE _list_not_empty - - /* Try to get the lock. */ - /* if (write_exclusive(&_tx_thread_smp_protection.tx_thread_smp_protect_in_force, 1) == SUCCESS) - { */ - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - B.NE _start_waiting // Did it fail? - - /* We got the lock! */ - /* _tx_thread_smp_protect_lock_got(); */ - - DMB ISH // Ensure write to protection finishes - _tx_thread_smp_protect_lock_got // Call the lock got function - - B _return - -_list_not_empty: - - /* Are we at the front of the list? */ - /* if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - { */ - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - B.NE _start_waiting - - /* Is the lock still available? */ - /* if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - { */ - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - B.NE _start_waiting // No, protection not available - - /* Get the lock. */ - /* _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; */ - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - B.NE _start_waiting // Did it fail? - DMB ISH // - - /* Got the lock. */ - /* _tx_thread_smp_protect_lock_got(); */ - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - /* _tx_thread_smp_protect_remove_from_front_of_list(); */ - - _tx_thread_smp_protect_remove_from_front_of_list - - B _return - -_start_waiting: - - /* For one reason or another, we didn't get the lock. */ - - /* Increment wait count. */ - /* _tx_thread_smp_protect_wait_counts[this_core]++; */ - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value - - /* Have we not added ourselves to the list yet? */ - /* if (_tx_thread_smp_protect_wait_counts[this_core] == 1) - { */ - - CMP w4, #1 - B.NE _already_in_list0 // Is this core already waiting? - - /* Add ourselves to the list. */ - /* _tx_thread_smp_protect_wait_list_add(this_core); */ - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - /* } */ - -_already_in_list0: - - /* Restore interrupts. */ + LDR x1, =_tx_thread_smp_protection // Build address to protection structure + LDR w3, [x1, #4] // Pickup the owning core + CMP w3, w2 // Is it this core? + B.EQ _owned // Yes, the protection is already owned + LDAXR w4, [x1, #0] // Pickup the protection flag + CBZ w4, _get_protection // Yes, get the protection MSR DAIF, x0 // Restore interrupts ISB // #ifdef TX_ENABLE_WFE WFE // Go into standby #endif + B _tx_thread_smp_protect // On waking, restart the protection attempt - /* We do this until we have the lock. */ - /* while (1) - { */ - -_try_to_get_lock: - - /* Disable interrupts so we don't get preempted. */ - - MRS x0, DAIF // Pickup current interrupt posture - MSR DAIFSet, 0x3 // Lockout interrupts - - /* Pickup the CPU ID. */ - - MRS x1, MPIDR_EL1 // Pickup the core ID -#ifdef TX_ARMV8_2 -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #8, #8 // Isolate core ID -#else -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #0, #8 // Isolate core ID -#endif -#if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID -#endif - - /* Do we already have protection? */ - /* if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - { */ - - LDR w3, [x2, #4] // Pickup the owning core - CMP w3, w1 // Is it this core? - B.EQ _got_lock_after_waiting // Yes, the protection is already owned. This means - // an ISR preempted us and got protection - - /* } */ - - /* Are we at the front of the list? */ - /* if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - { */ - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - B.NE _did_not_get_lock - - /* Is the lock still available? */ - /* if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - { */ - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - B.NE _did_not_get_lock // No, protection not available - - /* Get the lock. */ - /* _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; */ - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - B.NE _did_not_get_lock // Did it fail? - DMB ISH // - - /* Got the lock. */ - /* _tx_thread_smp_protect_lock_got(); */ - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - /* _tx_thread_smp_protect_remove_from_front_of_list(); */ - - _tx_thread_smp_protect_remove_from_front_of_list - - B _got_lock_after_waiting - -_did_not_get_lock: - - /* For one reason or another, we didn't get the lock. */ - - /* Were we removed from the list? This can happen if we're a thread - and we got preempted. */ - /* if (_tx_thread_smp_protect_wait_counts[this_core] == 0) - { */ - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - CMP w4, #0 - B.NE _already_in_list1 // Is this core already in the list? - - /* Add ourselves to the list. */ - /* _tx_thread_smp_protect_wait_list_add(this_core); */ - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - /* Our waiting count was also reset when we were preempted. Increment it again. */ - /* _tx_thread_smp_protect_wait_counts[this_core]++; */ - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - /* } */ - -_already_in_list1: - - /* Restore interrupts and try again. */ - +_get_protection: + MOV x4, #1 // Build lock value + STXR w5, w4, [x1] // Attempt to get the protection + CBZ w5, _got_protection // Did it succeed? w5 = 0 means success! MSR DAIF, x0 // Restore interrupts - ISB // -#ifdef TX_ENABLE_WFE - WFE // Go into standby -#endif - B _try_to_get_lock // On waking, restart the protection attempt - -_got_lock_after_waiting: - - /* We're no longer waiting. */ - /* _tx_thread_smp_protect_wait_counts[this_core]--; */ - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load waiting list - LDR w4, [x3, x1, LSL #2] // Load current wait value - SUB w4, w4, #1 // Decrement wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - /* Restore registers and return. */ - -_return: - + B _tx_thread_smp_protect // Restart the protection attempt + +_got_protection: + DMB ISH // + STR w2, [x1, #4] // Save owning core +_owned: + LDR w5, [x1, #8] // Pickup ownership count + ADD w5, w5, #1 // Increment ownership count + STR w5, [x1, #8] // Store ownership count + DMB ISH // RET END diff --git a/ports_smp/cortex_a5x_smp/iar/src/tx_thread_smp_unprotect.S b/ports_smp/cortex_a5x_smp/iar/src/tx_thread_smp_unprotect.S index 0b99bc7e..0657a439 100644 --- a/ports_smp/cortex_a5x_smp/iar/src/tx_thread_smp_unprotect.S +++ b/ports_smp/cortex_a5x_smp/iar/src/tx_thread_smp_unprotect.S @@ -21,19 +21,6 @@ /**************************************************************************/ -/* -#define TX_SOURCE_CODE -#define TX_THREAD_SMP_SOURCE_CODE -*/ - -/* Include necessary system files. */ - -/* -#include "tx_api.h" -#include "tx_thread.h" -#include "tx_timer.h" -*/ - EXTERN _tx_thread_current_ptr EXTERN _tx_thread_smp_protection EXTERN _tx_thread_preempt_disable @@ -46,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_smp_unprotect Cortex-A5x-SMP/IAR */ -/* 6.1.9 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -79,6 +66,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 10-15-2021 William E. Lamie Initial Version 6.1.9 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ PUBLIC _tx_thread_smp_unprotect @@ -119,11 +109,6 @@ _tx_thread_smp_unprotect: CMP w3, #0 // Is the preempt disable flag set? B.NE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protect_wait_counts // Build build address of wait counts - LDR w3, [x2, x1, LSL #2] // Pickup wait list value - CMP w3, #0 // Are any entities on this core waiting? - B.NE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protection // Build address of protection structure MOV w3, #0xFFFFFFFF // Build invalid value STR w3, [x2, #4] // Mark the protected core as invalid diff --git a/ports_smp/cortex_a65_smp/ac6/example_build/tx/.cproject b/ports_smp/cortex_a65_smp/ac6/example_build/tx/.cproject index 0d5e8570..c23b96cd 100644 --- a/ports_smp/cortex_a65_smp/ac6/example_build/tx/.cproject +++ b/ports_smp/cortex_a65_smp/ac6/example_build/tx/.cproject @@ -129,11 +129,7 @@ - - - - - + diff --git a/ports_smp/cortex_a65_smp/ac6/src/tx_thread_context_restore.S b/ports_smp/cortex_a65_smp/ac6/src/tx_thread_context_restore.S index 4df471ac..21deb75d 100644 --- a/ports_smp/cortex_a65_smp/ac6/src/tx_thread_context_restore.S +++ b/ports_smp/cortex_a65_smp/ac6/src/tx_thread_context_restore.S @@ -21,9 +21,6 @@ /**************************************************************************/ -/* Include macros for modifying the wait list. */ -#include "tx_thread_smp_protection_wait_list_macros.h" - .text .align 3 /**************************************************************************/ @@ -31,7 +28,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_context_restore ARMv8-A-SMP */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -63,10 +60,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_context_restore(VOID) @@ -216,74 +216,6 @@ __tx_thread_no_preempt_restore: // { __tx_thread_preempt_restore: - /* Was the thread being preempted waiting for the lock? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] != 0) - // { - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - CMP w3, #0 - BEQ _nobody_waiting_for_lock // Is the core waiting for the lock? - - /* Do we not have the lock? This means the ISR never got the inter-core lock. */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_owned != this_core) - // { - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w8, w3 // Compare our core to the owning core - BEQ _this_core_has_lock // Do we have the lock? - - /* We don't have the lock. This core should be in the list. Remove it. */ - // _tx_thread_smp_protect_wait_list_remove(this_core); - - _tx_thread_smp_protect_wait_list_remove // Call macro to remove core from the list - B _nobody_waiting_for_lock // Leave - - // } - // else - // { - /* We have the lock. This means the ISR got the inter-core lock, but - never released it because it saw that there was someone waiting. - Note this core is not in the list. */ - -_this_core_has_lock: - - /* We're no longer waiting. Note that this should be zero since this happens during thread preemption. */ - // _tx_thread_smp_protect_wait_counts[core]--; - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - SUB w3, w3, #1 // Decrement waiting value. Should be zero now - STR w3, [x2, x8, LSL #2] // Store new waiting value - - /* Now release the inter-core lock. */ - - /* Set protected core as invalid. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_core = 0xFFFFFFFF; - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - MOV w3, #0xFFFFFFFF // Build invalid value - STR w3, [x2, #4] // Mark the protected core as invalid - DMB ISH // Ensure that accesses to shared resource have completed - - /* Release protection. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 0; - - MOV w3, #0 // Build release protection value - STR w3, [x2, #0] // Release the protection - DSB ISH // To ensure update of the protection occurs before other CPUs awake - - /* Wake up waiting processors. Note interrupts are already enabled. */ - -#ifdef TX_ENABLE_WFE - SEV // Send event to other CPUs -#endif - - // } - // } - -_nobody_waiting_for_lock: LDR x4, [x0, #8] // Switch to thread stack pointer MOV sp, x4 // diff --git a/ports_smp/cortex_a65_smp/ac6/src/tx_thread_smp_protect.S b/ports_smp/cortex_a65_smp/ac6/src/tx_thread_smp_protect.S index 9cde3e08..b65af329 100644 --- a/ports_smp/cortex_a65_smp/ac6/src/tx_thread_smp_protect.S +++ b/ports_smp/cortex_a65_smp/ac6/src/tx_thread_smp_protect.S @@ -32,7 +32,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_smp_protect Cortex-A35-SMP/AC6 */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -63,11 +63,14 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ -/* improved SMP code, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ +/* improved SMP code, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_protect @@ -81,293 +84,49 @@ _tx_thread_smp_protect: /* Pickup the CPU ID. */ - MRS x1, MPIDR_EL1 // Pickup the core ID + MRS x2, MPIDR_EL1 // Pickup the core ID #ifdef TX_ARMV8_2 #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID + UBFX x7, x2, #16, #8 // Isolate cluster ID #endif - UBFX x1, x1, #8, #8 // Isolate core ID + UBFX x2, x2, #8, #8 // Isolate core ID #else #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID + UBFX x7, x2, #8, #8 // Isolate cluster ID #endif - UBFX x1, x1, #0, #8 // Isolate core ID + UBFX x2, x2, #0, #8 // Isolate core ID #endif #if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID + ADDS x2, x2, x7, LSL #2 // Calculate CPU ID #endif - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR x2, =_tx_thread_smp_protection // Build address to protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w1, w3 // Is it not this core? - BNE _protection_not_owned // No, the protection is not already owned - - /* We already have protection. */ - - /* Increment the protection count. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_count++; - - LDR w3, [x2, #8] // Pickup ownership count - ADD w3, w3, #1 // Increment ownership count - STR w3, [x2, #8] // Store ownership count - DMB ISH - - B _return - -_protection_not_owned: - - /* Is the lock available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Is the list empty? */ - // if (_tx_thread_smp_protect_wait_list_head == _tx_thread_smp_protect_wait_list_tail) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head - LDR w3, [x3] - LDR x4, =_tx_thread_smp_protect_wait_list_tail - LDR w4, [x4] - CMP w3, w4 - BNE _list_not_empty - - /* Try to get the lock. */ - // if (write_exclusive(&_tx_thread_smp_protection.tx_thread_smp_protect_in_force, 1) == SUCCESS) - // { - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - - /* We got the lock! */ - // _tx_thread_smp_protect_lock_got(); - - DMB ISH // Ensure write to protection finishes - _tx_thread_smp_protect_lock_got // Call the lock got function - - B _return - -_list_not_empty: - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _start_waiting - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _return - -_start_waiting: - - /* For one reason or another, we didn't get the lock. */ - - /* Increment wait count. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value - - /* Have we not added ourselves to the list yet? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 1) - // { - - CMP w4, #1 - BNE _already_in_list0 // Is this core already waiting? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - // } - -_already_in_list0: - - /* Restore interrupts. */ + LDR x1, =_tx_thread_smp_protection // Build address to protection structure + LDR w3, [x1, #4] // Pickup the owning core + CMP w3, w2 // Is it this core? + BEQ _owned // Yes, the protection is already owned + LDAXR w4, [x1, #0] // Pickup the protection flag + CBZ w4, _get_protection // Yes, get the protection MSR DAIF, x0 // Restore interrupts ISB // #ifdef TX_ENABLE_WFE WFE // Go into standby #endif + B _tx_thread_smp_protect // On waking, restart the protection attempt - /* We do this until we have the lock. */ - // while (1) - // { - -_try_to_get_lock: - - /* Disable interrupts so we don't get preempted. */ - - MRS x0, DAIF // Pickup current interrupt posture - MSR DAIFSet, 0x3 // Lockout interrupts - - /* Pickup the CPU ID. */ - - MRS x1, MPIDR_EL1 // Pickup the core ID -#ifdef TX_ARMV8_2 -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #8, #8 // Isolate core ID -#else -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #0, #8 // Isolate core ID -#endif -#if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID -#endif - - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR w3, [x2, #4] // Pickup the owning core - CMP w3, w1 // Is it this core? - BEQ _got_lock_after_waiting // Yes, the protection is already owned. This means - // an ISR preempted us and got protection - - // } - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _did_not_get_lock - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _did_not_get_lock // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _did_not_get_lock // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _got_lock_after_waiting - -_did_not_get_lock: - - /* For one reason or another, we didn't get the lock. */ - - /* Were we removed from the list? This can happen if we're a thread - and we got preempted. */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 0) - // { - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - CMP w4, #0 - BNE _already_in_list1 // Is this core already in the list? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - /* Our waiting count was also reset when we were preempted. Increment it again. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - // } - -_already_in_list1: - - /* Restore interrupts and try again. */ - +_get_protection: + MOV x4, #1 // Build lock value + STXR w5, w4, [x1] // Attempt to get the protection + CBZ w5, _got_protection // Did it succeed? w5 = 0 means success! MSR DAIF, x0 // Restore interrupts - ISB // -#ifdef TX_ENABLE_WFE - WFE // Go into standby -#endif - B _try_to_get_lock // On waking, restart the protection attempt - -_got_lock_after_waiting: - - /* We're no longer waiting. */ - // _tx_thread_smp_protect_wait_counts[this_core]--; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load waiting list - LDR w4, [x3, x1, LSL #2] // Load current wait value - SUB w4, w4, #1 // Decrement wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - /* Restore registers and return. */ - -_return: - + B _tx_thread_smp_protect // Restart the protection attempt + +_got_protection: + DMB ISH // + STR w2, [x1, #4] // Save owning core +_owned: + LDR w5, [x1, #8] // Pickup ownership count + ADD w5, w5, #1 // Increment ownership count + STR w5, [x1, #8] // Store ownership count + DMB ISH // RET diff --git a/ports_smp/cortex_a65_smp/ac6/src/tx_thread_smp_unprotect.S b/ports_smp/cortex_a65_smp/ac6/src/tx_thread_smp_unprotect.S index a783cde6..f9d8692a 100644 --- a/ports_smp/cortex_a65_smp/ac6/src/tx_thread_smp_unprotect.S +++ b/ports_smp/cortex_a65_smp/ac6/src/tx_thread_smp_unprotect.S @@ -60,10 +60,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_unprotect @@ -105,11 +108,6 @@ _tx_thread_smp_unprotect: CMP w3, #0 // Is the preempt disable flag set? BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protect_wait_counts // Build build address of wait counts - LDR w3, [x2, x1, LSL #2] // Pickup wait list value - CMP w3, #0 // Are any entities on this core waiting? - BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protection // Build address of protection structure MOV w3, #0xFFFFFFFF // Build invalid value STR w3, [x2, #4] // Mark the protected core as invalid diff --git a/ports_smp/cortex_a65_smp/gnu/example_build/tx/.cproject b/ports_smp/cortex_a65_smp/gnu/example_build/tx/.cproject index ec20edd2..3547a1d3 100644 --- a/ports_smp/cortex_a65_smp/gnu/example_build/tx/.cproject +++ b/ports_smp/cortex_a65_smp/gnu/example_build/tx/.cproject @@ -129,6 +129,12 @@ + + + + + + diff --git a/ports_smp/cortex_a65_smp/gnu/src/tx_thread_context_restore.S b/ports_smp/cortex_a65_smp/gnu/src/tx_thread_context_restore.S index 4df471ac..21deb75d 100644 --- a/ports_smp/cortex_a65_smp/gnu/src/tx_thread_context_restore.S +++ b/ports_smp/cortex_a65_smp/gnu/src/tx_thread_context_restore.S @@ -21,9 +21,6 @@ /**************************************************************************/ -/* Include macros for modifying the wait list. */ -#include "tx_thread_smp_protection_wait_list_macros.h" - .text .align 3 /**************************************************************************/ @@ -31,7 +28,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_context_restore ARMv8-A-SMP */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -63,10 +60,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_context_restore(VOID) @@ -216,74 +216,6 @@ __tx_thread_no_preempt_restore: // { __tx_thread_preempt_restore: - /* Was the thread being preempted waiting for the lock? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] != 0) - // { - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - CMP w3, #0 - BEQ _nobody_waiting_for_lock // Is the core waiting for the lock? - - /* Do we not have the lock? This means the ISR never got the inter-core lock. */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_owned != this_core) - // { - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w8, w3 // Compare our core to the owning core - BEQ _this_core_has_lock // Do we have the lock? - - /* We don't have the lock. This core should be in the list. Remove it. */ - // _tx_thread_smp_protect_wait_list_remove(this_core); - - _tx_thread_smp_protect_wait_list_remove // Call macro to remove core from the list - B _nobody_waiting_for_lock // Leave - - // } - // else - // { - /* We have the lock. This means the ISR got the inter-core lock, but - never released it because it saw that there was someone waiting. - Note this core is not in the list. */ - -_this_core_has_lock: - - /* We're no longer waiting. Note that this should be zero since this happens during thread preemption. */ - // _tx_thread_smp_protect_wait_counts[core]--; - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - SUB w3, w3, #1 // Decrement waiting value. Should be zero now - STR w3, [x2, x8, LSL #2] // Store new waiting value - - /* Now release the inter-core lock. */ - - /* Set protected core as invalid. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_core = 0xFFFFFFFF; - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - MOV w3, #0xFFFFFFFF // Build invalid value - STR w3, [x2, #4] // Mark the protected core as invalid - DMB ISH // Ensure that accesses to shared resource have completed - - /* Release protection. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 0; - - MOV w3, #0 // Build release protection value - STR w3, [x2, #0] // Release the protection - DSB ISH // To ensure update of the protection occurs before other CPUs awake - - /* Wake up waiting processors. Note interrupts are already enabled. */ - -#ifdef TX_ENABLE_WFE - SEV // Send event to other CPUs -#endif - - // } - // } - -_nobody_waiting_for_lock: LDR x4, [x0, #8] // Switch to thread stack pointer MOV sp, x4 // diff --git a/ports_smp/cortex_a65_smp/gnu/src/tx_thread_smp_protect.S b/ports_smp/cortex_a65_smp/gnu/src/tx_thread_smp_protect.S index 9cde3e08..b65af329 100644 --- a/ports_smp/cortex_a65_smp/gnu/src/tx_thread_smp_protect.S +++ b/ports_smp/cortex_a65_smp/gnu/src/tx_thread_smp_protect.S @@ -32,7 +32,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_smp_protect Cortex-A35-SMP/AC6 */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -63,11 +63,14 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ -/* improved SMP code, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ +/* improved SMP code, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_protect @@ -81,293 +84,49 @@ _tx_thread_smp_protect: /* Pickup the CPU ID. */ - MRS x1, MPIDR_EL1 // Pickup the core ID + MRS x2, MPIDR_EL1 // Pickup the core ID #ifdef TX_ARMV8_2 #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID + UBFX x7, x2, #16, #8 // Isolate cluster ID #endif - UBFX x1, x1, #8, #8 // Isolate core ID + UBFX x2, x2, #8, #8 // Isolate core ID #else #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID + UBFX x7, x2, #8, #8 // Isolate cluster ID #endif - UBFX x1, x1, #0, #8 // Isolate core ID + UBFX x2, x2, #0, #8 // Isolate core ID #endif #if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID + ADDS x2, x2, x7, LSL #2 // Calculate CPU ID #endif - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR x2, =_tx_thread_smp_protection // Build address to protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w1, w3 // Is it not this core? - BNE _protection_not_owned // No, the protection is not already owned - - /* We already have protection. */ - - /* Increment the protection count. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_count++; - - LDR w3, [x2, #8] // Pickup ownership count - ADD w3, w3, #1 // Increment ownership count - STR w3, [x2, #8] // Store ownership count - DMB ISH - - B _return - -_protection_not_owned: - - /* Is the lock available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Is the list empty? */ - // if (_tx_thread_smp_protect_wait_list_head == _tx_thread_smp_protect_wait_list_tail) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head - LDR w3, [x3] - LDR x4, =_tx_thread_smp_protect_wait_list_tail - LDR w4, [x4] - CMP w3, w4 - BNE _list_not_empty - - /* Try to get the lock. */ - // if (write_exclusive(&_tx_thread_smp_protection.tx_thread_smp_protect_in_force, 1) == SUCCESS) - // { - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - - /* We got the lock! */ - // _tx_thread_smp_protect_lock_got(); - - DMB ISH // Ensure write to protection finishes - _tx_thread_smp_protect_lock_got // Call the lock got function - - B _return - -_list_not_empty: - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _start_waiting - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _return - -_start_waiting: - - /* For one reason or another, we didn't get the lock. */ - - /* Increment wait count. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value - - /* Have we not added ourselves to the list yet? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 1) - // { - - CMP w4, #1 - BNE _already_in_list0 // Is this core already waiting? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - // } - -_already_in_list0: - - /* Restore interrupts. */ + LDR x1, =_tx_thread_smp_protection // Build address to protection structure + LDR w3, [x1, #4] // Pickup the owning core + CMP w3, w2 // Is it this core? + BEQ _owned // Yes, the protection is already owned + LDAXR w4, [x1, #0] // Pickup the protection flag + CBZ w4, _get_protection // Yes, get the protection MSR DAIF, x0 // Restore interrupts ISB // #ifdef TX_ENABLE_WFE WFE // Go into standby #endif + B _tx_thread_smp_protect // On waking, restart the protection attempt - /* We do this until we have the lock. */ - // while (1) - // { - -_try_to_get_lock: - - /* Disable interrupts so we don't get preempted. */ - - MRS x0, DAIF // Pickup current interrupt posture - MSR DAIFSet, 0x3 // Lockout interrupts - - /* Pickup the CPU ID. */ - - MRS x1, MPIDR_EL1 // Pickup the core ID -#ifdef TX_ARMV8_2 -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #8, #8 // Isolate core ID -#else -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #0, #8 // Isolate core ID -#endif -#if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID -#endif - - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR w3, [x2, #4] // Pickup the owning core - CMP w3, w1 // Is it this core? - BEQ _got_lock_after_waiting // Yes, the protection is already owned. This means - // an ISR preempted us and got protection - - // } - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _did_not_get_lock - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _did_not_get_lock // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _did_not_get_lock // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _got_lock_after_waiting - -_did_not_get_lock: - - /* For one reason or another, we didn't get the lock. */ - - /* Were we removed from the list? This can happen if we're a thread - and we got preempted. */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 0) - // { - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - CMP w4, #0 - BNE _already_in_list1 // Is this core already in the list? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - /* Our waiting count was also reset when we were preempted. Increment it again. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - // } - -_already_in_list1: - - /* Restore interrupts and try again. */ - +_get_protection: + MOV x4, #1 // Build lock value + STXR w5, w4, [x1] // Attempt to get the protection + CBZ w5, _got_protection // Did it succeed? w5 = 0 means success! MSR DAIF, x0 // Restore interrupts - ISB // -#ifdef TX_ENABLE_WFE - WFE // Go into standby -#endif - B _try_to_get_lock // On waking, restart the protection attempt - -_got_lock_after_waiting: - - /* We're no longer waiting. */ - // _tx_thread_smp_protect_wait_counts[this_core]--; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load waiting list - LDR w4, [x3, x1, LSL #2] // Load current wait value - SUB w4, w4, #1 // Decrement wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - /* Restore registers and return. */ - -_return: - + B _tx_thread_smp_protect // Restart the protection attempt + +_got_protection: + DMB ISH // + STR w2, [x1, #4] // Save owning core +_owned: + LDR w5, [x1, #8] // Pickup ownership count + ADD w5, w5, #1 // Increment ownership count + STR w5, [x1, #8] // Store ownership count + DMB ISH // RET diff --git a/ports_smp/cortex_a65_smp/gnu/src/tx_thread_smp_unprotect.S b/ports_smp/cortex_a65_smp/gnu/src/tx_thread_smp_unprotect.S index a783cde6..f9d8692a 100644 --- a/ports_smp/cortex_a65_smp/gnu/src/tx_thread_smp_unprotect.S +++ b/ports_smp/cortex_a65_smp/gnu/src/tx_thread_smp_unprotect.S @@ -60,10 +60,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_unprotect @@ -105,11 +108,6 @@ _tx_thread_smp_unprotect: CMP w3, #0 // Is the preempt disable flag set? BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protect_wait_counts // Build build address of wait counts - LDR w3, [x2, x1, LSL #2] // Pickup wait list value - CMP w3, #0 // Are any entities on this core waiting? - BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protection // Build address of protection structure MOV w3, #0xFFFFFFFF // Build invalid value STR w3, [x2, #4] // Mark the protected core as invalid diff --git a/ports_smp/cortex_a65ae_smp/ac6/example_build/tx/.cproject b/ports_smp/cortex_a65ae_smp/ac6/example_build/tx/.cproject index f82c4a12..21738a63 100644 --- a/ports_smp/cortex_a65ae_smp/ac6/example_build/tx/.cproject +++ b/ports_smp/cortex_a65ae_smp/ac6/example_build/tx/.cproject @@ -129,11 +129,7 @@ - - - - - + diff --git a/ports_smp/cortex_a65ae_smp/ac6/src/tx_thread_context_restore.S b/ports_smp/cortex_a65ae_smp/ac6/src/tx_thread_context_restore.S index 4df471ac..21deb75d 100644 --- a/ports_smp/cortex_a65ae_smp/ac6/src/tx_thread_context_restore.S +++ b/ports_smp/cortex_a65ae_smp/ac6/src/tx_thread_context_restore.S @@ -21,9 +21,6 @@ /**************************************************************************/ -/* Include macros for modifying the wait list. */ -#include "tx_thread_smp_protection_wait_list_macros.h" - .text .align 3 /**************************************************************************/ @@ -31,7 +28,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_context_restore ARMv8-A-SMP */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -63,10 +60,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_context_restore(VOID) @@ -216,74 +216,6 @@ __tx_thread_no_preempt_restore: // { __tx_thread_preempt_restore: - /* Was the thread being preempted waiting for the lock? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] != 0) - // { - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - CMP w3, #0 - BEQ _nobody_waiting_for_lock // Is the core waiting for the lock? - - /* Do we not have the lock? This means the ISR never got the inter-core lock. */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_owned != this_core) - // { - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w8, w3 // Compare our core to the owning core - BEQ _this_core_has_lock // Do we have the lock? - - /* We don't have the lock. This core should be in the list. Remove it. */ - // _tx_thread_smp_protect_wait_list_remove(this_core); - - _tx_thread_smp_protect_wait_list_remove // Call macro to remove core from the list - B _nobody_waiting_for_lock // Leave - - // } - // else - // { - /* We have the lock. This means the ISR got the inter-core lock, but - never released it because it saw that there was someone waiting. - Note this core is not in the list. */ - -_this_core_has_lock: - - /* We're no longer waiting. Note that this should be zero since this happens during thread preemption. */ - // _tx_thread_smp_protect_wait_counts[core]--; - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - SUB w3, w3, #1 // Decrement waiting value. Should be zero now - STR w3, [x2, x8, LSL #2] // Store new waiting value - - /* Now release the inter-core lock. */ - - /* Set protected core as invalid. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_core = 0xFFFFFFFF; - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - MOV w3, #0xFFFFFFFF // Build invalid value - STR w3, [x2, #4] // Mark the protected core as invalid - DMB ISH // Ensure that accesses to shared resource have completed - - /* Release protection. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 0; - - MOV w3, #0 // Build release protection value - STR w3, [x2, #0] // Release the protection - DSB ISH // To ensure update of the protection occurs before other CPUs awake - - /* Wake up waiting processors. Note interrupts are already enabled. */ - -#ifdef TX_ENABLE_WFE - SEV // Send event to other CPUs -#endif - - // } - // } - -_nobody_waiting_for_lock: LDR x4, [x0, #8] // Switch to thread stack pointer MOV sp, x4 // diff --git a/ports_smp/cortex_a65ae_smp/ac6/src/tx_thread_smp_protect.S b/ports_smp/cortex_a65ae_smp/ac6/src/tx_thread_smp_protect.S index 9cde3e08..b65af329 100644 --- a/ports_smp/cortex_a65ae_smp/ac6/src/tx_thread_smp_protect.S +++ b/ports_smp/cortex_a65ae_smp/ac6/src/tx_thread_smp_protect.S @@ -32,7 +32,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_smp_protect Cortex-A35-SMP/AC6 */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -63,11 +63,14 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ -/* improved SMP code, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ +/* improved SMP code, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_protect @@ -81,293 +84,49 @@ _tx_thread_smp_protect: /* Pickup the CPU ID. */ - MRS x1, MPIDR_EL1 // Pickup the core ID + MRS x2, MPIDR_EL1 // Pickup the core ID #ifdef TX_ARMV8_2 #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID + UBFX x7, x2, #16, #8 // Isolate cluster ID #endif - UBFX x1, x1, #8, #8 // Isolate core ID + UBFX x2, x2, #8, #8 // Isolate core ID #else #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID + UBFX x7, x2, #8, #8 // Isolate cluster ID #endif - UBFX x1, x1, #0, #8 // Isolate core ID + UBFX x2, x2, #0, #8 // Isolate core ID #endif #if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID + ADDS x2, x2, x7, LSL #2 // Calculate CPU ID #endif - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR x2, =_tx_thread_smp_protection // Build address to protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w1, w3 // Is it not this core? - BNE _protection_not_owned // No, the protection is not already owned - - /* We already have protection. */ - - /* Increment the protection count. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_count++; - - LDR w3, [x2, #8] // Pickup ownership count - ADD w3, w3, #1 // Increment ownership count - STR w3, [x2, #8] // Store ownership count - DMB ISH - - B _return - -_protection_not_owned: - - /* Is the lock available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Is the list empty? */ - // if (_tx_thread_smp_protect_wait_list_head == _tx_thread_smp_protect_wait_list_tail) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head - LDR w3, [x3] - LDR x4, =_tx_thread_smp_protect_wait_list_tail - LDR w4, [x4] - CMP w3, w4 - BNE _list_not_empty - - /* Try to get the lock. */ - // if (write_exclusive(&_tx_thread_smp_protection.tx_thread_smp_protect_in_force, 1) == SUCCESS) - // { - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - - /* We got the lock! */ - // _tx_thread_smp_protect_lock_got(); - - DMB ISH // Ensure write to protection finishes - _tx_thread_smp_protect_lock_got // Call the lock got function - - B _return - -_list_not_empty: - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _start_waiting - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _return - -_start_waiting: - - /* For one reason or another, we didn't get the lock. */ - - /* Increment wait count. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value - - /* Have we not added ourselves to the list yet? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 1) - // { - - CMP w4, #1 - BNE _already_in_list0 // Is this core already waiting? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - // } - -_already_in_list0: - - /* Restore interrupts. */ + LDR x1, =_tx_thread_smp_protection // Build address to protection structure + LDR w3, [x1, #4] // Pickup the owning core + CMP w3, w2 // Is it this core? + BEQ _owned // Yes, the protection is already owned + LDAXR w4, [x1, #0] // Pickup the protection flag + CBZ w4, _get_protection // Yes, get the protection MSR DAIF, x0 // Restore interrupts ISB // #ifdef TX_ENABLE_WFE WFE // Go into standby #endif + B _tx_thread_smp_protect // On waking, restart the protection attempt - /* We do this until we have the lock. */ - // while (1) - // { - -_try_to_get_lock: - - /* Disable interrupts so we don't get preempted. */ - - MRS x0, DAIF // Pickup current interrupt posture - MSR DAIFSet, 0x3 // Lockout interrupts - - /* Pickup the CPU ID. */ - - MRS x1, MPIDR_EL1 // Pickup the core ID -#ifdef TX_ARMV8_2 -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #8, #8 // Isolate core ID -#else -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #0, #8 // Isolate core ID -#endif -#if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID -#endif - - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR w3, [x2, #4] // Pickup the owning core - CMP w3, w1 // Is it this core? - BEQ _got_lock_after_waiting // Yes, the protection is already owned. This means - // an ISR preempted us and got protection - - // } - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _did_not_get_lock - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _did_not_get_lock // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _did_not_get_lock // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _got_lock_after_waiting - -_did_not_get_lock: - - /* For one reason or another, we didn't get the lock. */ - - /* Were we removed from the list? This can happen if we're a thread - and we got preempted. */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 0) - // { - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - CMP w4, #0 - BNE _already_in_list1 // Is this core already in the list? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - /* Our waiting count was also reset when we were preempted. Increment it again. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - // } - -_already_in_list1: - - /* Restore interrupts and try again. */ - +_get_protection: + MOV x4, #1 // Build lock value + STXR w5, w4, [x1] // Attempt to get the protection + CBZ w5, _got_protection // Did it succeed? w5 = 0 means success! MSR DAIF, x0 // Restore interrupts - ISB // -#ifdef TX_ENABLE_WFE - WFE // Go into standby -#endif - B _try_to_get_lock // On waking, restart the protection attempt - -_got_lock_after_waiting: - - /* We're no longer waiting. */ - // _tx_thread_smp_protect_wait_counts[this_core]--; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load waiting list - LDR w4, [x3, x1, LSL #2] // Load current wait value - SUB w4, w4, #1 // Decrement wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - /* Restore registers and return. */ - -_return: - + B _tx_thread_smp_protect // Restart the protection attempt + +_got_protection: + DMB ISH // + STR w2, [x1, #4] // Save owning core +_owned: + LDR w5, [x1, #8] // Pickup ownership count + ADD w5, w5, #1 // Increment ownership count + STR w5, [x1, #8] // Store ownership count + DMB ISH // RET diff --git a/ports_smp/cortex_a65ae_smp/ac6/src/tx_thread_smp_unprotect.S b/ports_smp/cortex_a65ae_smp/ac6/src/tx_thread_smp_unprotect.S index a783cde6..f9d8692a 100644 --- a/ports_smp/cortex_a65ae_smp/ac6/src/tx_thread_smp_unprotect.S +++ b/ports_smp/cortex_a65ae_smp/ac6/src/tx_thread_smp_unprotect.S @@ -60,10 +60,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_unprotect @@ -105,11 +108,6 @@ _tx_thread_smp_unprotect: CMP w3, #0 // Is the preempt disable flag set? BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protect_wait_counts // Build build address of wait counts - LDR w3, [x2, x1, LSL #2] // Pickup wait list value - CMP w3, #0 // Are any entities on this core waiting? - BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protection // Build address of protection structure MOV w3, #0xFFFFFFFF // Build invalid value STR w3, [x2, #4] // Mark the protected core as invalid diff --git a/ports_smp/cortex_a65ae_smp/gnu/example_build/tx/.cproject b/ports_smp/cortex_a65ae_smp/gnu/example_build/tx/.cproject index ec20edd2..3547a1d3 100644 --- a/ports_smp/cortex_a65ae_smp/gnu/example_build/tx/.cproject +++ b/ports_smp/cortex_a65ae_smp/gnu/example_build/tx/.cproject @@ -129,6 +129,12 @@ + + + + + + diff --git a/ports_smp/cortex_a65ae_smp/gnu/src/tx_thread_context_restore.S b/ports_smp/cortex_a65ae_smp/gnu/src/tx_thread_context_restore.S index 4df471ac..21deb75d 100644 --- a/ports_smp/cortex_a65ae_smp/gnu/src/tx_thread_context_restore.S +++ b/ports_smp/cortex_a65ae_smp/gnu/src/tx_thread_context_restore.S @@ -21,9 +21,6 @@ /**************************************************************************/ -/* Include macros for modifying the wait list. */ -#include "tx_thread_smp_protection_wait_list_macros.h" - .text .align 3 /**************************************************************************/ @@ -31,7 +28,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_context_restore ARMv8-A-SMP */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -63,10 +60,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_context_restore(VOID) @@ -216,74 +216,6 @@ __tx_thread_no_preempt_restore: // { __tx_thread_preempt_restore: - /* Was the thread being preempted waiting for the lock? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] != 0) - // { - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - CMP w3, #0 - BEQ _nobody_waiting_for_lock // Is the core waiting for the lock? - - /* Do we not have the lock? This means the ISR never got the inter-core lock. */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_owned != this_core) - // { - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w8, w3 // Compare our core to the owning core - BEQ _this_core_has_lock // Do we have the lock? - - /* We don't have the lock. This core should be in the list. Remove it. */ - // _tx_thread_smp_protect_wait_list_remove(this_core); - - _tx_thread_smp_protect_wait_list_remove // Call macro to remove core from the list - B _nobody_waiting_for_lock // Leave - - // } - // else - // { - /* We have the lock. This means the ISR got the inter-core lock, but - never released it because it saw that there was someone waiting. - Note this core is not in the list. */ - -_this_core_has_lock: - - /* We're no longer waiting. Note that this should be zero since this happens during thread preemption. */ - // _tx_thread_smp_protect_wait_counts[core]--; - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - SUB w3, w3, #1 // Decrement waiting value. Should be zero now - STR w3, [x2, x8, LSL #2] // Store new waiting value - - /* Now release the inter-core lock. */ - - /* Set protected core as invalid. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_core = 0xFFFFFFFF; - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - MOV w3, #0xFFFFFFFF // Build invalid value - STR w3, [x2, #4] // Mark the protected core as invalid - DMB ISH // Ensure that accesses to shared resource have completed - - /* Release protection. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 0; - - MOV w3, #0 // Build release protection value - STR w3, [x2, #0] // Release the protection - DSB ISH // To ensure update of the protection occurs before other CPUs awake - - /* Wake up waiting processors. Note interrupts are already enabled. */ - -#ifdef TX_ENABLE_WFE - SEV // Send event to other CPUs -#endif - - // } - // } - -_nobody_waiting_for_lock: LDR x4, [x0, #8] // Switch to thread stack pointer MOV sp, x4 // diff --git a/ports_smp/cortex_a65ae_smp/gnu/src/tx_thread_smp_protect.S b/ports_smp/cortex_a65ae_smp/gnu/src/tx_thread_smp_protect.S index 9cde3e08..b65af329 100644 --- a/ports_smp/cortex_a65ae_smp/gnu/src/tx_thread_smp_protect.S +++ b/ports_smp/cortex_a65ae_smp/gnu/src/tx_thread_smp_protect.S @@ -32,7 +32,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_smp_protect Cortex-A35-SMP/AC6 */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -63,11 +63,14 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ -/* improved SMP code, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ +/* improved SMP code, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_protect @@ -81,293 +84,49 @@ _tx_thread_smp_protect: /* Pickup the CPU ID. */ - MRS x1, MPIDR_EL1 // Pickup the core ID + MRS x2, MPIDR_EL1 // Pickup the core ID #ifdef TX_ARMV8_2 #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID + UBFX x7, x2, #16, #8 // Isolate cluster ID #endif - UBFX x1, x1, #8, #8 // Isolate core ID + UBFX x2, x2, #8, #8 // Isolate core ID #else #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID + UBFX x7, x2, #8, #8 // Isolate cluster ID #endif - UBFX x1, x1, #0, #8 // Isolate core ID + UBFX x2, x2, #0, #8 // Isolate core ID #endif #if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID + ADDS x2, x2, x7, LSL #2 // Calculate CPU ID #endif - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR x2, =_tx_thread_smp_protection // Build address to protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w1, w3 // Is it not this core? - BNE _protection_not_owned // No, the protection is not already owned - - /* We already have protection. */ - - /* Increment the protection count. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_count++; - - LDR w3, [x2, #8] // Pickup ownership count - ADD w3, w3, #1 // Increment ownership count - STR w3, [x2, #8] // Store ownership count - DMB ISH - - B _return - -_protection_not_owned: - - /* Is the lock available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Is the list empty? */ - // if (_tx_thread_smp_protect_wait_list_head == _tx_thread_smp_protect_wait_list_tail) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head - LDR w3, [x3] - LDR x4, =_tx_thread_smp_protect_wait_list_tail - LDR w4, [x4] - CMP w3, w4 - BNE _list_not_empty - - /* Try to get the lock. */ - // if (write_exclusive(&_tx_thread_smp_protection.tx_thread_smp_protect_in_force, 1) == SUCCESS) - // { - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - - /* We got the lock! */ - // _tx_thread_smp_protect_lock_got(); - - DMB ISH // Ensure write to protection finishes - _tx_thread_smp_protect_lock_got // Call the lock got function - - B _return - -_list_not_empty: - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _start_waiting - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _return - -_start_waiting: - - /* For one reason or another, we didn't get the lock. */ - - /* Increment wait count. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value - - /* Have we not added ourselves to the list yet? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 1) - // { - - CMP w4, #1 - BNE _already_in_list0 // Is this core already waiting? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - // } - -_already_in_list0: - - /* Restore interrupts. */ + LDR x1, =_tx_thread_smp_protection // Build address to protection structure + LDR w3, [x1, #4] // Pickup the owning core + CMP w3, w2 // Is it this core? + BEQ _owned // Yes, the protection is already owned + LDAXR w4, [x1, #0] // Pickup the protection flag + CBZ w4, _get_protection // Yes, get the protection MSR DAIF, x0 // Restore interrupts ISB // #ifdef TX_ENABLE_WFE WFE // Go into standby #endif + B _tx_thread_smp_protect // On waking, restart the protection attempt - /* We do this until we have the lock. */ - // while (1) - // { - -_try_to_get_lock: - - /* Disable interrupts so we don't get preempted. */ - - MRS x0, DAIF // Pickup current interrupt posture - MSR DAIFSet, 0x3 // Lockout interrupts - - /* Pickup the CPU ID. */ - - MRS x1, MPIDR_EL1 // Pickup the core ID -#ifdef TX_ARMV8_2 -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #8, #8 // Isolate core ID -#else -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #0, #8 // Isolate core ID -#endif -#if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID -#endif - - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR w3, [x2, #4] // Pickup the owning core - CMP w3, w1 // Is it this core? - BEQ _got_lock_after_waiting // Yes, the protection is already owned. This means - // an ISR preempted us and got protection - - // } - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _did_not_get_lock - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _did_not_get_lock // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _did_not_get_lock // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _got_lock_after_waiting - -_did_not_get_lock: - - /* For one reason or another, we didn't get the lock. */ - - /* Were we removed from the list? This can happen if we're a thread - and we got preempted. */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 0) - // { - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - CMP w4, #0 - BNE _already_in_list1 // Is this core already in the list? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - /* Our waiting count was also reset when we were preempted. Increment it again. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - // } - -_already_in_list1: - - /* Restore interrupts and try again. */ - +_get_protection: + MOV x4, #1 // Build lock value + STXR w5, w4, [x1] // Attempt to get the protection + CBZ w5, _got_protection // Did it succeed? w5 = 0 means success! MSR DAIF, x0 // Restore interrupts - ISB // -#ifdef TX_ENABLE_WFE - WFE // Go into standby -#endif - B _try_to_get_lock // On waking, restart the protection attempt - -_got_lock_after_waiting: - - /* We're no longer waiting. */ - // _tx_thread_smp_protect_wait_counts[this_core]--; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load waiting list - LDR w4, [x3, x1, LSL #2] // Load current wait value - SUB w4, w4, #1 // Decrement wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - /* Restore registers and return. */ - -_return: - + B _tx_thread_smp_protect // Restart the protection attempt + +_got_protection: + DMB ISH // + STR w2, [x1, #4] // Save owning core +_owned: + LDR w5, [x1, #8] // Pickup ownership count + ADD w5, w5, #1 // Increment ownership count + STR w5, [x1, #8] // Store ownership count + DMB ISH // RET diff --git a/ports_smp/cortex_a65ae_smp/gnu/src/tx_thread_smp_unprotect.S b/ports_smp/cortex_a65ae_smp/gnu/src/tx_thread_smp_unprotect.S index a783cde6..f9d8692a 100644 --- a/ports_smp/cortex_a65ae_smp/gnu/src/tx_thread_smp_unprotect.S +++ b/ports_smp/cortex_a65ae_smp/gnu/src/tx_thread_smp_unprotect.S @@ -60,10 +60,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_unprotect @@ -105,11 +108,6 @@ _tx_thread_smp_unprotect: CMP w3, #0 // Is the preempt disable flag set? BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protect_wait_counts // Build build address of wait counts - LDR w3, [x2, x1, LSL #2] // Pickup wait list value - CMP w3, #0 // Are any entities on this core waiting? - BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protection // Build address of protection structure MOV w3, #0xFFFFFFFF // Build invalid value STR w3, [x2, #4] // Mark the protected core as invalid diff --git a/ports_smp/cortex_a72_smp/ac6/example_build/sample_threadx/.cproject b/ports_smp/cortex_a72_smp/ac6/example_build/sample_threadx/.cproject index 188d23b9..acbfe8ce 100644 --- a/ports_smp/cortex_a72_smp/ac6/example_build/sample_threadx/.cproject +++ b/ports_smp/cortex_a72_smp/ac6/example_build/sample_threadx/.cproject @@ -23,7 +23,7 @@ - + @@ -47,7 +47,7 @@ + + + + + + diff --git a/ports_smp/cortex_a72_smp/gnu/src/tx_thread_context_restore.S b/ports_smp/cortex_a72_smp/gnu/src/tx_thread_context_restore.S index 4df471ac..21deb75d 100644 --- a/ports_smp/cortex_a72_smp/gnu/src/tx_thread_context_restore.S +++ b/ports_smp/cortex_a72_smp/gnu/src/tx_thread_context_restore.S @@ -21,9 +21,6 @@ /**************************************************************************/ -/* Include macros for modifying the wait list. */ -#include "tx_thread_smp_protection_wait_list_macros.h" - .text .align 3 /**************************************************************************/ @@ -31,7 +28,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_context_restore ARMv8-A-SMP */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -63,10 +60,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_context_restore(VOID) @@ -216,74 +216,6 @@ __tx_thread_no_preempt_restore: // { __tx_thread_preempt_restore: - /* Was the thread being preempted waiting for the lock? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] != 0) - // { - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - CMP w3, #0 - BEQ _nobody_waiting_for_lock // Is the core waiting for the lock? - - /* Do we not have the lock? This means the ISR never got the inter-core lock. */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_owned != this_core) - // { - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w8, w3 // Compare our core to the owning core - BEQ _this_core_has_lock // Do we have the lock? - - /* We don't have the lock. This core should be in the list. Remove it. */ - // _tx_thread_smp_protect_wait_list_remove(this_core); - - _tx_thread_smp_protect_wait_list_remove // Call macro to remove core from the list - B _nobody_waiting_for_lock // Leave - - // } - // else - // { - /* We have the lock. This means the ISR got the inter-core lock, but - never released it because it saw that there was someone waiting. - Note this core is not in the list. */ - -_this_core_has_lock: - - /* We're no longer waiting. Note that this should be zero since this happens during thread preemption. */ - // _tx_thread_smp_protect_wait_counts[core]--; - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - SUB w3, w3, #1 // Decrement waiting value. Should be zero now - STR w3, [x2, x8, LSL #2] // Store new waiting value - - /* Now release the inter-core lock. */ - - /* Set protected core as invalid. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_core = 0xFFFFFFFF; - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - MOV w3, #0xFFFFFFFF // Build invalid value - STR w3, [x2, #4] // Mark the protected core as invalid - DMB ISH // Ensure that accesses to shared resource have completed - - /* Release protection. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 0; - - MOV w3, #0 // Build release protection value - STR w3, [x2, #0] // Release the protection - DSB ISH // To ensure update of the protection occurs before other CPUs awake - - /* Wake up waiting processors. Note interrupts are already enabled. */ - -#ifdef TX_ENABLE_WFE - SEV // Send event to other CPUs -#endif - - // } - // } - -_nobody_waiting_for_lock: LDR x4, [x0, #8] // Switch to thread stack pointer MOV sp, x4 // diff --git a/ports_smp/cortex_a72_smp/gnu/src/tx_thread_smp_protect.S b/ports_smp/cortex_a72_smp/gnu/src/tx_thread_smp_protect.S index 9cde3e08..b65af329 100644 --- a/ports_smp/cortex_a72_smp/gnu/src/tx_thread_smp_protect.S +++ b/ports_smp/cortex_a72_smp/gnu/src/tx_thread_smp_protect.S @@ -32,7 +32,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_smp_protect Cortex-A35-SMP/AC6 */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -63,11 +63,14 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ -/* improved SMP code, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ +/* improved SMP code, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_protect @@ -81,293 +84,49 @@ _tx_thread_smp_protect: /* Pickup the CPU ID. */ - MRS x1, MPIDR_EL1 // Pickup the core ID + MRS x2, MPIDR_EL1 // Pickup the core ID #ifdef TX_ARMV8_2 #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID + UBFX x7, x2, #16, #8 // Isolate cluster ID #endif - UBFX x1, x1, #8, #8 // Isolate core ID + UBFX x2, x2, #8, #8 // Isolate core ID #else #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID + UBFX x7, x2, #8, #8 // Isolate cluster ID #endif - UBFX x1, x1, #0, #8 // Isolate core ID + UBFX x2, x2, #0, #8 // Isolate core ID #endif #if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID + ADDS x2, x2, x7, LSL #2 // Calculate CPU ID #endif - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR x2, =_tx_thread_smp_protection // Build address to protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w1, w3 // Is it not this core? - BNE _protection_not_owned // No, the protection is not already owned - - /* We already have protection. */ - - /* Increment the protection count. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_count++; - - LDR w3, [x2, #8] // Pickup ownership count - ADD w3, w3, #1 // Increment ownership count - STR w3, [x2, #8] // Store ownership count - DMB ISH - - B _return - -_protection_not_owned: - - /* Is the lock available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Is the list empty? */ - // if (_tx_thread_smp_protect_wait_list_head == _tx_thread_smp_protect_wait_list_tail) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head - LDR w3, [x3] - LDR x4, =_tx_thread_smp_protect_wait_list_tail - LDR w4, [x4] - CMP w3, w4 - BNE _list_not_empty - - /* Try to get the lock. */ - // if (write_exclusive(&_tx_thread_smp_protection.tx_thread_smp_protect_in_force, 1) == SUCCESS) - // { - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - - /* We got the lock! */ - // _tx_thread_smp_protect_lock_got(); - - DMB ISH // Ensure write to protection finishes - _tx_thread_smp_protect_lock_got // Call the lock got function - - B _return - -_list_not_empty: - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _start_waiting - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _return - -_start_waiting: - - /* For one reason or another, we didn't get the lock. */ - - /* Increment wait count. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value - - /* Have we not added ourselves to the list yet? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 1) - // { - - CMP w4, #1 - BNE _already_in_list0 // Is this core already waiting? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - // } - -_already_in_list0: - - /* Restore interrupts. */ + LDR x1, =_tx_thread_smp_protection // Build address to protection structure + LDR w3, [x1, #4] // Pickup the owning core + CMP w3, w2 // Is it this core? + BEQ _owned // Yes, the protection is already owned + LDAXR w4, [x1, #0] // Pickup the protection flag + CBZ w4, _get_protection // Yes, get the protection MSR DAIF, x0 // Restore interrupts ISB // #ifdef TX_ENABLE_WFE WFE // Go into standby #endif + B _tx_thread_smp_protect // On waking, restart the protection attempt - /* We do this until we have the lock. */ - // while (1) - // { - -_try_to_get_lock: - - /* Disable interrupts so we don't get preempted. */ - - MRS x0, DAIF // Pickup current interrupt posture - MSR DAIFSet, 0x3 // Lockout interrupts - - /* Pickup the CPU ID. */ - - MRS x1, MPIDR_EL1 // Pickup the core ID -#ifdef TX_ARMV8_2 -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #8, #8 // Isolate core ID -#else -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #0, #8 // Isolate core ID -#endif -#if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID -#endif - - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR w3, [x2, #4] // Pickup the owning core - CMP w3, w1 // Is it this core? - BEQ _got_lock_after_waiting // Yes, the protection is already owned. This means - // an ISR preempted us and got protection - - // } - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _did_not_get_lock - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _did_not_get_lock // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _did_not_get_lock // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _got_lock_after_waiting - -_did_not_get_lock: - - /* For one reason or another, we didn't get the lock. */ - - /* Were we removed from the list? This can happen if we're a thread - and we got preempted. */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 0) - // { - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - CMP w4, #0 - BNE _already_in_list1 // Is this core already in the list? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - /* Our waiting count was also reset when we were preempted. Increment it again. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - // } - -_already_in_list1: - - /* Restore interrupts and try again. */ - +_get_protection: + MOV x4, #1 // Build lock value + STXR w5, w4, [x1] // Attempt to get the protection + CBZ w5, _got_protection // Did it succeed? w5 = 0 means success! MSR DAIF, x0 // Restore interrupts - ISB // -#ifdef TX_ENABLE_WFE - WFE // Go into standby -#endif - B _try_to_get_lock // On waking, restart the protection attempt - -_got_lock_after_waiting: - - /* We're no longer waiting. */ - // _tx_thread_smp_protect_wait_counts[this_core]--; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load waiting list - LDR w4, [x3, x1, LSL #2] // Load current wait value - SUB w4, w4, #1 // Decrement wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - /* Restore registers and return. */ - -_return: - + B _tx_thread_smp_protect // Restart the protection attempt + +_got_protection: + DMB ISH // + STR w2, [x1, #4] // Save owning core +_owned: + LDR w5, [x1, #8] // Pickup ownership count + ADD w5, w5, #1 // Increment ownership count + STR w5, [x1, #8] // Store ownership count + DMB ISH // RET diff --git a/ports_smp/cortex_a72_smp/gnu/src/tx_thread_smp_unprotect.S b/ports_smp/cortex_a72_smp/gnu/src/tx_thread_smp_unprotect.S index a783cde6..f9d8692a 100644 --- a/ports_smp/cortex_a72_smp/gnu/src/tx_thread_smp_unprotect.S +++ b/ports_smp/cortex_a72_smp/gnu/src/tx_thread_smp_unprotect.S @@ -60,10 +60,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_unprotect @@ -105,11 +108,6 @@ _tx_thread_smp_unprotect: CMP w3, #0 // Is the preempt disable flag set? BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protect_wait_counts // Build build address of wait counts - LDR w3, [x2, x1, LSL #2] // Pickup wait list value - CMP w3, #0 // Are any entities on this core waiting? - BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protection // Build address of protection structure MOV w3, #0xFFFFFFFF // Build invalid value STR w3, [x2, #4] // Mark the protected core as invalid diff --git a/ports_smp/cortex_a73_smp/ac6/example_build/sample_threadx/.cproject b/ports_smp/cortex_a73_smp/ac6/example_build/sample_threadx/.cproject index eb56d9c0..47d41421 100644 --- a/ports_smp/cortex_a73_smp/ac6/example_build/sample_threadx/.cproject +++ b/ports_smp/cortex_a73_smp/ac6/example_build/sample_threadx/.cproject @@ -23,7 +23,7 @@ - + @@ -47,7 +47,7 @@ + + + + + + diff --git a/ports_smp/cortex_a73_smp/gnu/src/tx_thread_context_restore.S b/ports_smp/cortex_a73_smp/gnu/src/tx_thread_context_restore.S index 4df471ac..21deb75d 100644 --- a/ports_smp/cortex_a73_smp/gnu/src/tx_thread_context_restore.S +++ b/ports_smp/cortex_a73_smp/gnu/src/tx_thread_context_restore.S @@ -21,9 +21,6 @@ /**************************************************************************/ -/* Include macros for modifying the wait list. */ -#include "tx_thread_smp_protection_wait_list_macros.h" - .text .align 3 /**************************************************************************/ @@ -31,7 +28,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_context_restore ARMv8-A-SMP */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -63,10 +60,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_context_restore(VOID) @@ -216,74 +216,6 @@ __tx_thread_no_preempt_restore: // { __tx_thread_preempt_restore: - /* Was the thread being preempted waiting for the lock? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] != 0) - // { - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - CMP w3, #0 - BEQ _nobody_waiting_for_lock // Is the core waiting for the lock? - - /* Do we not have the lock? This means the ISR never got the inter-core lock. */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_owned != this_core) - // { - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w8, w3 // Compare our core to the owning core - BEQ _this_core_has_lock // Do we have the lock? - - /* We don't have the lock. This core should be in the list. Remove it. */ - // _tx_thread_smp_protect_wait_list_remove(this_core); - - _tx_thread_smp_protect_wait_list_remove // Call macro to remove core from the list - B _nobody_waiting_for_lock // Leave - - // } - // else - // { - /* We have the lock. This means the ISR got the inter-core lock, but - never released it because it saw that there was someone waiting. - Note this core is not in the list. */ - -_this_core_has_lock: - - /* We're no longer waiting. Note that this should be zero since this happens during thread preemption. */ - // _tx_thread_smp_protect_wait_counts[core]--; - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - SUB w3, w3, #1 // Decrement waiting value. Should be zero now - STR w3, [x2, x8, LSL #2] // Store new waiting value - - /* Now release the inter-core lock. */ - - /* Set protected core as invalid. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_core = 0xFFFFFFFF; - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - MOV w3, #0xFFFFFFFF // Build invalid value - STR w3, [x2, #4] // Mark the protected core as invalid - DMB ISH // Ensure that accesses to shared resource have completed - - /* Release protection. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 0; - - MOV w3, #0 // Build release protection value - STR w3, [x2, #0] // Release the protection - DSB ISH // To ensure update of the protection occurs before other CPUs awake - - /* Wake up waiting processors. Note interrupts are already enabled. */ - -#ifdef TX_ENABLE_WFE - SEV // Send event to other CPUs -#endif - - // } - // } - -_nobody_waiting_for_lock: LDR x4, [x0, #8] // Switch to thread stack pointer MOV sp, x4 // diff --git a/ports_smp/cortex_a73_smp/gnu/src/tx_thread_smp_protect.S b/ports_smp/cortex_a73_smp/gnu/src/tx_thread_smp_protect.S index 9cde3e08..b65af329 100644 --- a/ports_smp/cortex_a73_smp/gnu/src/tx_thread_smp_protect.S +++ b/ports_smp/cortex_a73_smp/gnu/src/tx_thread_smp_protect.S @@ -32,7 +32,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_smp_protect Cortex-A35-SMP/AC6 */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -63,11 +63,14 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ -/* improved SMP code, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ +/* improved SMP code, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_protect @@ -81,293 +84,49 @@ _tx_thread_smp_protect: /* Pickup the CPU ID. */ - MRS x1, MPIDR_EL1 // Pickup the core ID + MRS x2, MPIDR_EL1 // Pickup the core ID #ifdef TX_ARMV8_2 #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID + UBFX x7, x2, #16, #8 // Isolate cluster ID #endif - UBFX x1, x1, #8, #8 // Isolate core ID + UBFX x2, x2, #8, #8 // Isolate core ID #else #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID + UBFX x7, x2, #8, #8 // Isolate cluster ID #endif - UBFX x1, x1, #0, #8 // Isolate core ID + UBFX x2, x2, #0, #8 // Isolate core ID #endif #if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID + ADDS x2, x2, x7, LSL #2 // Calculate CPU ID #endif - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR x2, =_tx_thread_smp_protection // Build address to protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w1, w3 // Is it not this core? - BNE _protection_not_owned // No, the protection is not already owned - - /* We already have protection. */ - - /* Increment the protection count. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_count++; - - LDR w3, [x2, #8] // Pickup ownership count - ADD w3, w3, #1 // Increment ownership count - STR w3, [x2, #8] // Store ownership count - DMB ISH - - B _return - -_protection_not_owned: - - /* Is the lock available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Is the list empty? */ - // if (_tx_thread_smp_protect_wait_list_head == _tx_thread_smp_protect_wait_list_tail) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head - LDR w3, [x3] - LDR x4, =_tx_thread_smp_protect_wait_list_tail - LDR w4, [x4] - CMP w3, w4 - BNE _list_not_empty - - /* Try to get the lock. */ - // if (write_exclusive(&_tx_thread_smp_protection.tx_thread_smp_protect_in_force, 1) == SUCCESS) - // { - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - - /* We got the lock! */ - // _tx_thread_smp_protect_lock_got(); - - DMB ISH // Ensure write to protection finishes - _tx_thread_smp_protect_lock_got // Call the lock got function - - B _return - -_list_not_empty: - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _start_waiting - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _return - -_start_waiting: - - /* For one reason or another, we didn't get the lock. */ - - /* Increment wait count. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value - - /* Have we not added ourselves to the list yet? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 1) - // { - - CMP w4, #1 - BNE _already_in_list0 // Is this core already waiting? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - // } - -_already_in_list0: - - /* Restore interrupts. */ + LDR x1, =_tx_thread_smp_protection // Build address to protection structure + LDR w3, [x1, #4] // Pickup the owning core + CMP w3, w2 // Is it this core? + BEQ _owned // Yes, the protection is already owned + LDAXR w4, [x1, #0] // Pickup the protection flag + CBZ w4, _get_protection // Yes, get the protection MSR DAIF, x0 // Restore interrupts ISB // #ifdef TX_ENABLE_WFE WFE // Go into standby #endif + B _tx_thread_smp_protect // On waking, restart the protection attempt - /* We do this until we have the lock. */ - // while (1) - // { - -_try_to_get_lock: - - /* Disable interrupts so we don't get preempted. */ - - MRS x0, DAIF // Pickup current interrupt posture - MSR DAIFSet, 0x3 // Lockout interrupts - - /* Pickup the CPU ID. */ - - MRS x1, MPIDR_EL1 // Pickup the core ID -#ifdef TX_ARMV8_2 -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #8, #8 // Isolate core ID -#else -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #0, #8 // Isolate core ID -#endif -#if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID -#endif - - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR w3, [x2, #4] // Pickup the owning core - CMP w3, w1 // Is it this core? - BEQ _got_lock_after_waiting // Yes, the protection is already owned. This means - // an ISR preempted us and got protection - - // } - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _did_not_get_lock - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _did_not_get_lock // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _did_not_get_lock // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _got_lock_after_waiting - -_did_not_get_lock: - - /* For one reason or another, we didn't get the lock. */ - - /* Were we removed from the list? This can happen if we're a thread - and we got preempted. */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 0) - // { - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - CMP w4, #0 - BNE _already_in_list1 // Is this core already in the list? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - /* Our waiting count was also reset when we were preempted. Increment it again. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - // } - -_already_in_list1: - - /* Restore interrupts and try again. */ - +_get_protection: + MOV x4, #1 // Build lock value + STXR w5, w4, [x1] // Attempt to get the protection + CBZ w5, _got_protection // Did it succeed? w5 = 0 means success! MSR DAIF, x0 // Restore interrupts - ISB // -#ifdef TX_ENABLE_WFE - WFE // Go into standby -#endif - B _try_to_get_lock // On waking, restart the protection attempt - -_got_lock_after_waiting: - - /* We're no longer waiting. */ - // _tx_thread_smp_protect_wait_counts[this_core]--; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load waiting list - LDR w4, [x3, x1, LSL #2] // Load current wait value - SUB w4, w4, #1 // Decrement wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - /* Restore registers and return. */ - -_return: - + B _tx_thread_smp_protect // Restart the protection attempt + +_got_protection: + DMB ISH // + STR w2, [x1, #4] // Save owning core +_owned: + LDR w5, [x1, #8] // Pickup ownership count + ADD w5, w5, #1 // Increment ownership count + STR w5, [x1, #8] // Store ownership count + DMB ISH // RET diff --git a/ports_smp/cortex_a73_smp/gnu/src/tx_thread_smp_unprotect.S b/ports_smp/cortex_a73_smp/gnu/src/tx_thread_smp_unprotect.S index a783cde6..f9d8692a 100644 --- a/ports_smp/cortex_a73_smp/gnu/src/tx_thread_smp_unprotect.S +++ b/ports_smp/cortex_a73_smp/gnu/src/tx_thread_smp_unprotect.S @@ -60,10 +60,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_unprotect @@ -105,11 +108,6 @@ _tx_thread_smp_unprotect: CMP w3, #0 // Is the preempt disable flag set? BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protect_wait_counts // Build build address of wait counts - LDR w3, [x2, x1, LSL #2] // Pickup wait list value - CMP w3, #0 // Are any entities on this core waiting? - BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protection // Build address of protection structure MOV w3, #0xFFFFFFFF // Build invalid value STR w3, [x2, #4] // Mark the protected core as invalid diff --git a/ports_smp/cortex_a75_smp/ac6/example_build/sample_threadx/.cproject b/ports_smp/cortex_a75_smp/ac6/example_build/sample_threadx/.cproject index 55342a4b..ee87537f 100644 --- a/ports_smp/cortex_a75_smp/ac6/example_build/sample_threadx/.cproject +++ b/ports_smp/cortex_a75_smp/ac6/example_build/sample_threadx/.cproject @@ -23,7 +23,7 @@ - + @@ -47,7 +47,7 @@ + + + + + + diff --git a/ports_smp/cortex_a75_smp/gnu/src/tx_thread_context_restore.S b/ports_smp/cortex_a75_smp/gnu/src/tx_thread_context_restore.S index 4df471ac..21deb75d 100644 --- a/ports_smp/cortex_a75_smp/gnu/src/tx_thread_context_restore.S +++ b/ports_smp/cortex_a75_smp/gnu/src/tx_thread_context_restore.S @@ -21,9 +21,6 @@ /**************************************************************************/ -/* Include macros for modifying the wait list. */ -#include "tx_thread_smp_protection_wait_list_macros.h" - .text .align 3 /**************************************************************************/ @@ -31,7 +28,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_context_restore ARMv8-A-SMP */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -63,10 +60,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_context_restore(VOID) @@ -216,74 +216,6 @@ __tx_thread_no_preempt_restore: // { __tx_thread_preempt_restore: - /* Was the thread being preempted waiting for the lock? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] != 0) - // { - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - CMP w3, #0 - BEQ _nobody_waiting_for_lock // Is the core waiting for the lock? - - /* Do we not have the lock? This means the ISR never got the inter-core lock. */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_owned != this_core) - // { - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w8, w3 // Compare our core to the owning core - BEQ _this_core_has_lock // Do we have the lock? - - /* We don't have the lock. This core should be in the list. Remove it. */ - // _tx_thread_smp_protect_wait_list_remove(this_core); - - _tx_thread_smp_protect_wait_list_remove // Call macro to remove core from the list - B _nobody_waiting_for_lock // Leave - - // } - // else - // { - /* We have the lock. This means the ISR got the inter-core lock, but - never released it because it saw that there was someone waiting. - Note this core is not in the list. */ - -_this_core_has_lock: - - /* We're no longer waiting. Note that this should be zero since this happens during thread preemption. */ - // _tx_thread_smp_protect_wait_counts[core]--; - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - SUB w3, w3, #1 // Decrement waiting value. Should be zero now - STR w3, [x2, x8, LSL #2] // Store new waiting value - - /* Now release the inter-core lock. */ - - /* Set protected core as invalid. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_core = 0xFFFFFFFF; - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - MOV w3, #0xFFFFFFFF // Build invalid value - STR w3, [x2, #4] // Mark the protected core as invalid - DMB ISH // Ensure that accesses to shared resource have completed - - /* Release protection. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 0; - - MOV w3, #0 // Build release protection value - STR w3, [x2, #0] // Release the protection - DSB ISH // To ensure update of the protection occurs before other CPUs awake - - /* Wake up waiting processors. Note interrupts are already enabled. */ - -#ifdef TX_ENABLE_WFE - SEV // Send event to other CPUs -#endif - - // } - // } - -_nobody_waiting_for_lock: LDR x4, [x0, #8] // Switch to thread stack pointer MOV sp, x4 // diff --git a/ports_smp/cortex_a75_smp/gnu/src/tx_thread_smp_protect.S b/ports_smp/cortex_a75_smp/gnu/src/tx_thread_smp_protect.S index 9cde3e08..b65af329 100644 --- a/ports_smp/cortex_a75_smp/gnu/src/tx_thread_smp_protect.S +++ b/ports_smp/cortex_a75_smp/gnu/src/tx_thread_smp_protect.S @@ -32,7 +32,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_smp_protect Cortex-A35-SMP/AC6 */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -63,11 +63,14 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ -/* improved SMP code, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ +/* improved SMP code, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_protect @@ -81,293 +84,49 @@ _tx_thread_smp_protect: /* Pickup the CPU ID. */ - MRS x1, MPIDR_EL1 // Pickup the core ID + MRS x2, MPIDR_EL1 // Pickup the core ID #ifdef TX_ARMV8_2 #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID + UBFX x7, x2, #16, #8 // Isolate cluster ID #endif - UBFX x1, x1, #8, #8 // Isolate core ID + UBFX x2, x2, #8, #8 // Isolate core ID #else #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID + UBFX x7, x2, #8, #8 // Isolate cluster ID #endif - UBFX x1, x1, #0, #8 // Isolate core ID + UBFX x2, x2, #0, #8 // Isolate core ID #endif #if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID + ADDS x2, x2, x7, LSL #2 // Calculate CPU ID #endif - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR x2, =_tx_thread_smp_protection // Build address to protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w1, w3 // Is it not this core? - BNE _protection_not_owned // No, the protection is not already owned - - /* We already have protection. */ - - /* Increment the protection count. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_count++; - - LDR w3, [x2, #8] // Pickup ownership count - ADD w3, w3, #1 // Increment ownership count - STR w3, [x2, #8] // Store ownership count - DMB ISH - - B _return - -_protection_not_owned: - - /* Is the lock available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Is the list empty? */ - // if (_tx_thread_smp_protect_wait_list_head == _tx_thread_smp_protect_wait_list_tail) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head - LDR w3, [x3] - LDR x4, =_tx_thread_smp_protect_wait_list_tail - LDR w4, [x4] - CMP w3, w4 - BNE _list_not_empty - - /* Try to get the lock. */ - // if (write_exclusive(&_tx_thread_smp_protection.tx_thread_smp_protect_in_force, 1) == SUCCESS) - // { - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - - /* We got the lock! */ - // _tx_thread_smp_protect_lock_got(); - - DMB ISH // Ensure write to protection finishes - _tx_thread_smp_protect_lock_got // Call the lock got function - - B _return - -_list_not_empty: - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _start_waiting - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _return - -_start_waiting: - - /* For one reason or another, we didn't get the lock. */ - - /* Increment wait count. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value - - /* Have we not added ourselves to the list yet? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 1) - // { - - CMP w4, #1 - BNE _already_in_list0 // Is this core already waiting? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - // } - -_already_in_list0: - - /* Restore interrupts. */ + LDR x1, =_tx_thread_smp_protection // Build address to protection structure + LDR w3, [x1, #4] // Pickup the owning core + CMP w3, w2 // Is it this core? + BEQ _owned // Yes, the protection is already owned + LDAXR w4, [x1, #0] // Pickup the protection flag + CBZ w4, _get_protection // Yes, get the protection MSR DAIF, x0 // Restore interrupts ISB // #ifdef TX_ENABLE_WFE WFE // Go into standby #endif + B _tx_thread_smp_protect // On waking, restart the protection attempt - /* We do this until we have the lock. */ - // while (1) - // { - -_try_to_get_lock: - - /* Disable interrupts so we don't get preempted. */ - - MRS x0, DAIF // Pickup current interrupt posture - MSR DAIFSet, 0x3 // Lockout interrupts - - /* Pickup the CPU ID. */ - - MRS x1, MPIDR_EL1 // Pickup the core ID -#ifdef TX_ARMV8_2 -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #8, #8 // Isolate core ID -#else -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #0, #8 // Isolate core ID -#endif -#if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID -#endif - - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR w3, [x2, #4] // Pickup the owning core - CMP w3, w1 // Is it this core? - BEQ _got_lock_after_waiting // Yes, the protection is already owned. This means - // an ISR preempted us and got protection - - // } - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _did_not_get_lock - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _did_not_get_lock // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _did_not_get_lock // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _got_lock_after_waiting - -_did_not_get_lock: - - /* For one reason or another, we didn't get the lock. */ - - /* Were we removed from the list? This can happen if we're a thread - and we got preempted. */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 0) - // { - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - CMP w4, #0 - BNE _already_in_list1 // Is this core already in the list? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - /* Our waiting count was also reset when we were preempted. Increment it again. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - // } - -_already_in_list1: - - /* Restore interrupts and try again. */ - +_get_protection: + MOV x4, #1 // Build lock value + STXR w5, w4, [x1] // Attempt to get the protection + CBZ w5, _got_protection // Did it succeed? w5 = 0 means success! MSR DAIF, x0 // Restore interrupts - ISB // -#ifdef TX_ENABLE_WFE - WFE // Go into standby -#endif - B _try_to_get_lock // On waking, restart the protection attempt - -_got_lock_after_waiting: - - /* We're no longer waiting. */ - // _tx_thread_smp_protect_wait_counts[this_core]--; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load waiting list - LDR w4, [x3, x1, LSL #2] // Load current wait value - SUB w4, w4, #1 // Decrement wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - /* Restore registers and return. */ - -_return: - + B _tx_thread_smp_protect // Restart the protection attempt + +_got_protection: + DMB ISH // + STR w2, [x1, #4] // Save owning core +_owned: + LDR w5, [x1, #8] // Pickup ownership count + ADD w5, w5, #1 // Increment ownership count + STR w5, [x1, #8] // Store ownership count + DMB ISH // RET diff --git a/ports_smp/cortex_a75_smp/gnu/src/tx_thread_smp_unprotect.S b/ports_smp/cortex_a75_smp/gnu/src/tx_thread_smp_unprotect.S index a783cde6..f9d8692a 100644 --- a/ports_smp/cortex_a75_smp/gnu/src/tx_thread_smp_unprotect.S +++ b/ports_smp/cortex_a75_smp/gnu/src/tx_thread_smp_unprotect.S @@ -60,10 +60,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_unprotect @@ -105,11 +108,6 @@ _tx_thread_smp_unprotect: CMP w3, #0 // Is the preempt disable flag set? BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protect_wait_counts // Build build address of wait counts - LDR w3, [x2, x1, LSL #2] // Pickup wait list value - CMP w3, #0 // Are any entities on this core waiting? - BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protection // Build address of protection structure MOV w3, #0xFFFFFFFF // Build invalid value STR w3, [x2, #4] // Mark the protected core as invalid diff --git a/ports_smp/cortex_a76_smp/ac6/example_build/sample_threadx/.cproject b/ports_smp/cortex_a76_smp/ac6/example_build/sample_threadx/.cproject index 590d7745..c896ea80 100644 --- a/ports_smp/cortex_a76_smp/ac6/example_build/sample_threadx/.cproject +++ b/ports_smp/cortex_a76_smp/ac6/example_build/sample_threadx/.cproject @@ -23,7 +23,7 @@ - + @@ -47,7 +47,7 @@ + + + + + + diff --git a/ports_smp/cortex_a76_smp/gnu/src/tx_thread_context_restore.S b/ports_smp/cortex_a76_smp/gnu/src/tx_thread_context_restore.S index 4df471ac..21deb75d 100644 --- a/ports_smp/cortex_a76_smp/gnu/src/tx_thread_context_restore.S +++ b/ports_smp/cortex_a76_smp/gnu/src/tx_thread_context_restore.S @@ -21,9 +21,6 @@ /**************************************************************************/ -/* Include macros for modifying the wait list. */ -#include "tx_thread_smp_protection_wait_list_macros.h" - .text .align 3 /**************************************************************************/ @@ -31,7 +28,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_context_restore ARMv8-A-SMP */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -63,10 +60,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_context_restore(VOID) @@ -216,74 +216,6 @@ __tx_thread_no_preempt_restore: // { __tx_thread_preempt_restore: - /* Was the thread being preempted waiting for the lock? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] != 0) - // { - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - CMP w3, #0 - BEQ _nobody_waiting_for_lock // Is the core waiting for the lock? - - /* Do we not have the lock? This means the ISR never got the inter-core lock. */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_owned != this_core) - // { - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w8, w3 // Compare our core to the owning core - BEQ _this_core_has_lock // Do we have the lock? - - /* We don't have the lock. This core should be in the list. Remove it. */ - // _tx_thread_smp_protect_wait_list_remove(this_core); - - _tx_thread_smp_protect_wait_list_remove // Call macro to remove core from the list - B _nobody_waiting_for_lock // Leave - - // } - // else - // { - /* We have the lock. This means the ISR got the inter-core lock, but - never released it because it saw that there was someone waiting. - Note this core is not in the list. */ - -_this_core_has_lock: - - /* We're no longer waiting. Note that this should be zero since this happens during thread preemption. */ - // _tx_thread_smp_protect_wait_counts[core]--; - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - SUB w3, w3, #1 // Decrement waiting value. Should be zero now - STR w3, [x2, x8, LSL #2] // Store new waiting value - - /* Now release the inter-core lock. */ - - /* Set protected core as invalid. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_core = 0xFFFFFFFF; - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - MOV w3, #0xFFFFFFFF // Build invalid value - STR w3, [x2, #4] // Mark the protected core as invalid - DMB ISH // Ensure that accesses to shared resource have completed - - /* Release protection. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 0; - - MOV w3, #0 // Build release protection value - STR w3, [x2, #0] // Release the protection - DSB ISH // To ensure update of the protection occurs before other CPUs awake - - /* Wake up waiting processors. Note interrupts are already enabled. */ - -#ifdef TX_ENABLE_WFE - SEV // Send event to other CPUs -#endif - - // } - // } - -_nobody_waiting_for_lock: LDR x4, [x0, #8] // Switch to thread stack pointer MOV sp, x4 // diff --git a/ports_smp/cortex_a76_smp/gnu/src/tx_thread_smp_protect.S b/ports_smp/cortex_a76_smp/gnu/src/tx_thread_smp_protect.S index 9cde3e08..b65af329 100644 --- a/ports_smp/cortex_a76_smp/gnu/src/tx_thread_smp_protect.S +++ b/ports_smp/cortex_a76_smp/gnu/src/tx_thread_smp_protect.S @@ -32,7 +32,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_smp_protect Cortex-A35-SMP/AC6 */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -63,11 +63,14 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ -/* improved SMP code, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ +/* improved SMP code, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_protect @@ -81,293 +84,49 @@ _tx_thread_smp_protect: /* Pickup the CPU ID. */ - MRS x1, MPIDR_EL1 // Pickup the core ID + MRS x2, MPIDR_EL1 // Pickup the core ID #ifdef TX_ARMV8_2 #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID + UBFX x7, x2, #16, #8 // Isolate cluster ID #endif - UBFX x1, x1, #8, #8 // Isolate core ID + UBFX x2, x2, #8, #8 // Isolate core ID #else #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID + UBFX x7, x2, #8, #8 // Isolate cluster ID #endif - UBFX x1, x1, #0, #8 // Isolate core ID + UBFX x2, x2, #0, #8 // Isolate core ID #endif #if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID + ADDS x2, x2, x7, LSL #2 // Calculate CPU ID #endif - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR x2, =_tx_thread_smp_protection // Build address to protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w1, w3 // Is it not this core? - BNE _protection_not_owned // No, the protection is not already owned - - /* We already have protection. */ - - /* Increment the protection count. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_count++; - - LDR w3, [x2, #8] // Pickup ownership count - ADD w3, w3, #1 // Increment ownership count - STR w3, [x2, #8] // Store ownership count - DMB ISH - - B _return - -_protection_not_owned: - - /* Is the lock available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Is the list empty? */ - // if (_tx_thread_smp_protect_wait_list_head == _tx_thread_smp_protect_wait_list_tail) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head - LDR w3, [x3] - LDR x4, =_tx_thread_smp_protect_wait_list_tail - LDR w4, [x4] - CMP w3, w4 - BNE _list_not_empty - - /* Try to get the lock. */ - // if (write_exclusive(&_tx_thread_smp_protection.tx_thread_smp_protect_in_force, 1) == SUCCESS) - // { - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - - /* We got the lock! */ - // _tx_thread_smp_protect_lock_got(); - - DMB ISH // Ensure write to protection finishes - _tx_thread_smp_protect_lock_got // Call the lock got function - - B _return - -_list_not_empty: - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _start_waiting - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _return - -_start_waiting: - - /* For one reason or another, we didn't get the lock. */ - - /* Increment wait count. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value - - /* Have we not added ourselves to the list yet? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 1) - // { - - CMP w4, #1 - BNE _already_in_list0 // Is this core already waiting? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - // } - -_already_in_list0: - - /* Restore interrupts. */ + LDR x1, =_tx_thread_smp_protection // Build address to protection structure + LDR w3, [x1, #4] // Pickup the owning core + CMP w3, w2 // Is it this core? + BEQ _owned // Yes, the protection is already owned + LDAXR w4, [x1, #0] // Pickup the protection flag + CBZ w4, _get_protection // Yes, get the protection MSR DAIF, x0 // Restore interrupts ISB // #ifdef TX_ENABLE_WFE WFE // Go into standby #endif + B _tx_thread_smp_protect // On waking, restart the protection attempt - /* We do this until we have the lock. */ - // while (1) - // { - -_try_to_get_lock: - - /* Disable interrupts so we don't get preempted. */ - - MRS x0, DAIF // Pickup current interrupt posture - MSR DAIFSet, 0x3 // Lockout interrupts - - /* Pickup the CPU ID. */ - - MRS x1, MPIDR_EL1 // Pickup the core ID -#ifdef TX_ARMV8_2 -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #8, #8 // Isolate core ID -#else -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #0, #8 // Isolate core ID -#endif -#if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID -#endif - - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR w3, [x2, #4] // Pickup the owning core - CMP w3, w1 // Is it this core? - BEQ _got_lock_after_waiting // Yes, the protection is already owned. This means - // an ISR preempted us and got protection - - // } - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _did_not_get_lock - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _did_not_get_lock // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _did_not_get_lock // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _got_lock_after_waiting - -_did_not_get_lock: - - /* For one reason or another, we didn't get the lock. */ - - /* Were we removed from the list? This can happen if we're a thread - and we got preempted. */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 0) - // { - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - CMP w4, #0 - BNE _already_in_list1 // Is this core already in the list? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - /* Our waiting count was also reset when we were preempted. Increment it again. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - // } - -_already_in_list1: - - /* Restore interrupts and try again. */ - +_get_protection: + MOV x4, #1 // Build lock value + STXR w5, w4, [x1] // Attempt to get the protection + CBZ w5, _got_protection // Did it succeed? w5 = 0 means success! MSR DAIF, x0 // Restore interrupts - ISB // -#ifdef TX_ENABLE_WFE - WFE // Go into standby -#endif - B _try_to_get_lock // On waking, restart the protection attempt - -_got_lock_after_waiting: - - /* We're no longer waiting. */ - // _tx_thread_smp_protect_wait_counts[this_core]--; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load waiting list - LDR w4, [x3, x1, LSL #2] // Load current wait value - SUB w4, w4, #1 // Decrement wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - /* Restore registers and return. */ - -_return: - + B _tx_thread_smp_protect // Restart the protection attempt + +_got_protection: + DMB ISH // + STR w2, [x1, #4] // Save owning core +_owned: + LDR w5, [x1, #8] // Pickup ownership count + ADD w5, w5, #1 // Increment ownership count + STR w5, [x1, #8] // Store ownership count + DMB ISH // RET diff --git a/ports_smp/cortex_a76_smp/gnu/src/tx_thread_smp_unprotect.S b/ports_smp/cortex_a76_smp/gnu/src/tx_thread_smp_unprotect.S index a783cde6..f9d8692a 100644 --- a/ports_smp/cortex_a76_smp/gnu/src/tx_thread_smp_unprotect.S +++ b/ports_smp/cortex_a76_smp/gnu/src/tx_thread_smp_unprotect.S @@ -60,10 +60,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_unprotect @@ -105,11 +108,6 @@ _tx_thread_smp_unprotect: CMP w3, #0 // Is the preempt disable flag set? BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protect_wait_counts // Build build address of wait counts - LDR w3, [x2, x1, LSL #2] // Pickup wait list value - CMP w3, #0 // Are any entities on this core waiting? - BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protection // Build address of protection structure MOV w3, #0xFFFFFFFF // Build invalid value STR w3, [x2, #4] // Mark the protected core as invalid diff --git a/ports_smp/cortex_a76ae_smp/ac6/example_build/sample_threadx/.cproject b/ports_smp/cortex_a76ae_smp/ac6/example_build/sample_threadx/.cproject index 4a1565ae..b3292001 100644 --- a/ports_smp/cortex_a76ae_smp/ac6/example_build/sample_threadx/.cproject +++ b/ports_smp/cortex_a76ae_smp/ac6/example_build/sample_threadx/.cproject @@ -23,7 +23,7 @@ - + @@ -47,7 +47,7 @@ + + + + + + diff --git a/ports_smp/cortex_a76ae_smp/gnu/src/tx_thread_context_restore.S b/ports_smp/cortex_a76ae_smp/gnu/src/tx_thread_context_restore.S index 4df471ac..21deb75d 100644 --- a/ports_smp/cortex_a76ae_smp/gnu/src/tx_thread_context_restore.S +++ b/ports_smp/cortex_a76ae_smp/gnu/src/tx_thread_context_restore.S @@ -21,9 +21,6 @@ /**************************************************************************/ -/* Include macros for modifying the wait list. */ -#include "tx_thread_smp_protection_wait_list_macros.h" - .text .align 3 /**************************************************************************/ @@ -31,7 +28,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_context_restore ARMv8-A-SMP */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -63,10 +60,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_context_restore(VOID) @@ -216,74 +216,6 @@ __tx_thread_no_preempt_restore: // { __tx_thread_preempt_restore: - /* Was the thread being preempted waiting for the lock? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] != 0) - // { - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - CMP w3, #0 - BEQ _nobody_waiting_for_lock // Is the core waiting for the lock? - - /* Do we not have the lock? This means the ISR never got the inter-core lock. */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_owned != this_core) - // { - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w8, w3 // Compare our core to the owning core - BEQ _this_core_has_lock // Do we have the lock? - - /* We don't have the lock. This core should be in the list. Remove it. */ - // _tx_thread_smp_protect_wait_list_remove(this_core); - - _tx_thread_smp_protect_wait_list_remove // Call macro to remove core from the list - B _nobody_waiting_for_lock // Leave - - // } - // else - // { - /* We have the lock. This means the ISR got the inter-core lock, but - never released it because it saw that there was someone waiting. - Note this core is not in the list. */ - -_this_core_has_lock: - - /* We're no longer waiting. Note that this should be zero since this happens during thread preemption. */ - // _tx_thread_smp_protect_wait_counts[core]--; - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - SUB w3, w3, #1 // Decrement waiting value. Should be zero now - STR w3, [x2, x8, LSL #2] // Store new waiting value - - /* Now release the inter-core lock. */ - - /* Set protected core as invalid. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_core = 0xFFFFFFFF; - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - MOV w3, #0xFFFFFFFF // Build invalid value - STR w3, [x2, #4] // Mark the protected core as invalid - DMB ISH // Ensure that accesses to shared resource have completed - - /* Release protection. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 0; - - MOV w3, #0 // Build release protection value - STR w3, [x2, #0] // Release the protection - DSB ISH // To ensure update of the protection occurs before other CPUs awake - - /* Wake up waiting processors. Note interrupts are already enabled. */ - -#ifdef TX_ENABLE_WFE - SEV // Send event to other CPUs -#endif - - // } - // } - -_nobody_waiting_for_lock: LDR x4, [x0, #8] // Switch to thread stack pointer MOV sp, x4 // diff --git a/ports_smp/cortex_a76ae_smp/gnu/src/tx_thread_smp_protect.S b/ports_smp/cortex_a76ae_smp/gnu/src/tx_thread_smp_protect.S index 9cde3e08..b65af329 100644 --- a/ports_smp/cortex_a76ae_smp/gnu/src/tx_thread_smp_protect.S +++ b/ports_smp/cortex_a76ae_smp/gnu/src/tx_thread_smp_protect.S @@ -32,7 +32,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_smp_protect Cortex-A35-SMP/AC6 */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -63,11 +63,14 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ -/* improved SMP code, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ +/* improved SMP code, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_protect @@ -81,293 +84,49 @@ _tx_thread_smp_protect: /* Pickup the CPU ID. */ - MRS x1, MPIDR_EL1 // Pickup the core ID + MRS x2, MPIDR_EL1 // Pickup the core ID #ifdef TX_ARMV8_2 #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID + UBFX x7, x2, #16, #8 // Isolate cluster ID #endif - UBFX x1, x1, #8, #8 // Isolate core ID + UBFX x2, x2, #8, #8 // Isolate core ID #else #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID + UBFX x7, x2, #8, #8 // Isolate cluster ID #endif - UBFX x1, x1, #0, #8 // Isolate core ID + UBFX x2, x2, #0, #8 // Isolate core ID #endif #if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID + ADDS x2, x2, x7, LSL #2 // Calculate CPU ID #endif - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR x2, =_tx_thread_smp_protection // Build address to protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w1, w3 // Is it not this core? - BNE _protection_not_owned // No, the protection is not already owned - - /* We already have protection. */ - - /* Increment the protection count. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_count++; - - LDR w3, [x2, #8] // Pickup ownership count - ADD w3, w3, #1 // Increment ownership count - STR w3, [x2, #8] // Store ownership count - DMB ISH - - B _return - -_protection_not_owned: - - /* Is the lock available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Is the list empty? */ - // if (_tx_thread_smp_protect_wait_list_head == _tx_thread_smp_protect_wait_list_tail) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head - LDR w3, [x3] - LDR x4, =_tx_thread_smp_protect_wait_list_tail - LDR w4, [x4] - CMP w3, w4 - BNE _list_not_empty - - /* Try to get the lock. */ - // if (write_exclusive(&_tx_thread_smp_protection.tx_thread_smp_protect_in_force, 1) == SUCCESS) - // { - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - - /* We got the lock! */ - // _tx_thread_smp_protect_lock_got(); - - DMB ISH // Ensure write to protection finishes - _tx_thread_smp_protect_lock_got // Call the lock got function - - B _return - -_list_not_empty: - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _start_waiting - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _return - -_start_waiting: - - /* For one reason or another, we didn't get the lock. */ - - /* Increment wait count. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value - - /* Have we not added ourselves to the list yet? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 1) - // { - - CMP w4, #1 - BNE _already_in_list0 // Is this core already waiting? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - // } - -_already_in_list0: - - /* Restore interrupts. */ + LDR x1, =_tx_thread_smp_protection // Build address to protection structure + LDR w3, [x1, #4] // Pickup the owning core + CMP w3, w2 // Is it this core? + BEQ _owned // Yes, the protection is already owned + LDAXR w4, [x1, #0] // Pickup the protection flag + CBZ w4, _get_protection // Yes, get the protection MSR DAIF, x0 // Restore interrupts ISB // #ifdef TX_ENABLE_WFE WFE // Go into standby #endif + B _tx_thread_smp_protect // On waking, restart the protection attempt - /* We do this until we have the lock. */ - // while (1) - // { - -_try_to_get_lock: - - /* Disable interrupts so we don't get preempted. */ - - MRS x0, DAIF // Pickup current interrupt posture - MSR DAIFSet, 0x3 // Lockout interrupts - - /* Pickup the CPU ID. */ - - MRS x1, MPIDR_EL1 // Pickup the core ID -#ifdef TX_ARMV8_2 -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #8, #8 // Isolate core ID -#else -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #0, #8 // Isolate core ID -#endif -#if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID -#endif - - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR w3, [x2, #4] // Pickup the owning core - CMP w3, w1 // Is it this core? - BEQ _got_lock_after_waiting // Yes, the protection is already owned. This means - // an ISR preempted us and got protection - - // } - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _did_not_get_lock - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _did_not_get_lock // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _did_not_get_lock // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _got_lock_after_waiting - -_did_not_get_lock: - - /* For one reason or another, we didn't get the lock. */ - - /* Were we removed from the list? This can happen if we're a thread - and we got preempted. */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 0) - // { - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - CMP w4, #0 - BNE _already_in_list1 // Is this core already in the list? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - /* Our waiting count was also reset when we were preempted. Increment it again. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - // } - -_already_in_list1: - - /* Restore interrupts and try again. */ - +_get_protection: + MOV x4, #1 // Build lock value + STXR w5, w4, [x1] // Attempt to get the protection + CBZ w5, _got_protection // Did it succeed? w5 = 0 means success! MSR DAIF, x0 // Restore interrupts - ISB // -#ifdef TX_ENABLE_WFE - WFE // Go into standby -#endif - B _try_to_get_lock // On waking, restart the protection attempt - -_got_lock_after_waiting: - - /* We're no longer waiting. */ - // _tx_thread_smp_protect_wait_counts[this_core]--; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load waiting list - LDR w4, [x3, x1, LSL #2] // Load current wait value - SUB w4, w4, #1 // Decrement wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - /* Restore registers and return. */ - -_return: - + B _tx_thread_smp_protect // Restart the protection attempt + +_got_protection: + DMB ISH // + STR w2, [x1, #4] // Save owning core +_owned: + LDR w5, [x1, #8] // Pickup ownership count + ADD w5, w5, #1 // Increment ownership count + STR w5, [x1, #8] // Store ownership count + DMB ISH // RET diff --git a/ports_smp/cortex_a76ae_smp/gnu/src/tx_thread_smp_unprotect.S b/ports_smp/cortex_a76ae_smp/gnu/src/tx_thread_smp_unprotect.S index a783cde6..f9d8692a 100644 --- a/ports_smp/cortex_a76ae_smp/gnu/src/tx_thread_smp_unprotect.S +++ b/ports_smp/cortex_a76ae_smp/gnu/src/tx_thread_smp_unprotect.S @@ -60,10 +60,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_unprotect @@ -105,11 +108,6 @@ _tx_thread_smp_unprotect: CMP w3, #0 // Is the preempt disable flag set? BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protect_wait_counts // Build build address of wait counts - LDR w3, [x2, x1, LSL #2] // Pickup wait list value - CMP w3, #0 // Are any entities on this core waiting? - BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protection // Build address of protection structure MOV w3, #0xFFFFFFFF // Build invalid value STR w3, [x2, #4] // Mark the protected core as invalid diff --git a/ports_smp/cortex_a77_smp/ac6/example_build/sample_threadx/.cproject b/ports_smp/cortex_a77_smp/ac6/example_build/sample_threadx/.cproject index 552e0f6e..4b7a0722 100644 --- a/ports_smp/cortex_a77_smp/ac6/example_build/sample_threadx/.cproject +++ b/ports_smp/cortex_a77_smp/ac6/example_build/sample_threadx/.cproject @@ -23,7 +23,7 @@ - + @@ -47,7 +47,7 @@ + + + + + + diff --git a/ports_smp/cortex_a77_smp/gnu/src/tx_thread_context_restore.S b/ports_smp/cortex_a77_smp/gnu/src/tx_thread_context_restore.S index 4df471ac..21deb75d 100644 --- a/ports_smp/cortex_a77_smp/gnu/src/tx_thread_context_restore.S +++ b/ports_smp/cortex_a77_smp/gnu/src/tx_thread_context_restore.S @@ -21,9 +21,6 @@ /**************************************************************************/ -/* Include macros for modifying the wait list. */ -#include "tx_thread_smp_protection_wait_list_macros.h" - .text .align 3 /**************************************************************************/ @@ -31,7 +28,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_context_restore ARMv8-A-SMP */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -63,10 +60,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ // VOID _tx_thread_context_restore(VOID) @@ -216,74 +216,6 @@ __tx_thread_no_preempt_restore: // { __tx_thread_preempt_restore: - /* Was the thread being preempted waiting for the lock? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] != 0) - // { - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - CMP w3, #0 - BEQ _nobody_waiting_for_lock // Is the core waiting for the lock? - - /* Do we not have the lock? This means the ISR never got the inter-core lock. */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_owned != this_core) - // { - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w8, w3 // Compare our core to the owning core - BEQ _this_core_has_lock // Do we have the lock? - - /* We don't have the lock. This core should be in the list. Remove it. */ - // _tx_thread_smp_protect_wait_list_remove(this_core); - - _tx_thread_smp_protect_wait_list_remove // Call macro to remove core from the list - B _nobody_waiting_for_lock // Leave - - // } - // else - // { - /* We have the lock. This means the ISR got the inter-core lock, but - never released it because it saw that there was someone waiting. - Note this core is not in the list. */ - -_this_core_has_lock: - - /* We're no longer waiting. Note that this should be zero since this happens during thread preemption. */ - // _tx_thread_smp_protect_wait_counts[core]--; - - LDR x2, =_tx_thread_smp_protect_wait_counts // Load waiting count list - LDR w3, [x2, x8, LSL #2] // Load waiting value for this core - SUB w3, w3, #1 // Decrement waiting value. Should be zero now - STR w3, [x2, x8, LSL #2] // Store new waiting value - - /* Now release the inter-core lock. */ - - /* Set protected core as invalid. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_core = 0xFFFFFFFF; - - LDR x2, =_tx_thread_smp_protection // Load address of protection structure - MOV w3, #0xFFFFFFFF // Build invalid value - STR w3, [x2, #4] // Mark the protected core as invalid - DMB ISH // Ensure that accesses to shared resource have completed - - /* Release protection. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 0; - - MOV w3, #0 // Build release protection value - STR w3, [x2, #0] // Release the protection - DSB ISH // To ensure update of the protection occurs before other CPUs awake - - /* Wake up waiting processors. Note interrupts are already enabled. */ - -#ifdef TX_ENABLE_WFE - SEV // Send event to other CPUs -#endif - - // } - // } - -_nobody_waiting_for_lock: LDR x4, [x0, #8] // Switch to thread stack pointer MOV sp, x4 // diff --git a/ports_smp/cortex_a77_smp/gnu/src/tx_thread_smp_protect.S b/ports_smp/cortex_a77_smp/gnu/src/tx_thread_smp_protect.S index 9cde3e08..b65af329 100644 --- a/ports_smp/cortex_a77_smp/gnu/src/tx_thread_smp_protect.S +++ b/ports_smp/cortex_a77_smp/gnu/src/tx_thread_smp_protect.S @@ -32,7 +32,7 @@ /* FUNCTION RELEASE */ /* */ /* _tx_thread_smp_protect Cortex-A35-SMP/AC6 */ -/* 6.1.10 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -63,11 +63,14 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ -/* improved SMP code, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ +/* improved SMP code, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_protect @@ -81,293 +84,49 @@ _tx_thread_smp_protect: /* Pickup the CPU ID. */ - MRS x1, MPIDR_EL1 // Pickup the core ID + MRS x2, MPIDR_EL1 // Pickup the core ID #ifdef TX_ARMV8_2 #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID + UBFX x7, x2, #16, #8 // Isolate cluster ID #endif - UBFX x1, x1, #8, #8 // Isolate core ID + UBFX x2, x2, #8, #8 // Isolate core ID #else #if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID + UBFX x7, x2, #8, #8 // Isolate cluster ID #endif - UBFX x1, x1, #0, #8 // Isolate core ID + UBFX x2, x2, #0, #8 // Isolate core ID #endif #if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID + ADDS x2, x2, x7, LSL #2 // Calculate CPU ID #endif - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR x2, =_tx_thread_smp_protection // Build address to protection structure - LDR w3, [x2, #4] // Pickup the owning core - CMP w1, w3 // Is it not this core? - BNE _protection_not_owned // No, the protection is not already owned - - /* We already have protection. */ - - /* Increment the protection count. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_count++; - - LDR w3, [x2, #8] // Pickup ownership count - ADD w3, w3, #1 // Increment ownership count - STR w3, [x2, #8] // Store ownership count - DMB ISH - - B _return - -_protection_not_owned: - - /* Is the lock available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Is the list empty? */ - // if (_tx_thread_smp_protect_wait_list_head == _tx_thread_smp_protect_wait_list_tail) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head - LDR w3, [x3] - LDR x4, =_tx_thread_smp_protect_wait_list_tail - LDR w4, [x4] - CMP w3, w4 - BNE _list_not_empty - - /* Try to get the lock. */ - // if (write_exclusive(&_tx_thread_smp_protection.tx_thread_smp_protect_in_force, 1) == SUCCESS) - // { - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - - /* We got the lock! */ - // _tx_thread_smp_protect_lock_got(); - - DMB ISH // Ensure write to protection finishes - _tx_thread_smp_protect_lock_got // Call the lock got function - - B _return - -_list_not_empty: - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _start_waiting - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _start_waiting // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _start_waiting // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _return - -_start_waiting: - - /* For one reason or another, we didn't get the lock. */ - - /* Increment wait count. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value - - /* Have we not added ourselves to the list yet? */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 1) - // { - - CMP w4, #1 - BNE _already_in_list0 // Is this core already waiting? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - // } - -_already_in_list0: - - /* Restore interrupts. */ + LDR x1, =_tx_thread_smp_protection // Build address to protection structure + LDR w3, [x1, #4] // Pickup the owning core + CMP w3, w2 // Is it this core? + BEQ _owned // Yes, the protection is already owned + LDAXR w4, [x1, #0] // Pickup the protection flag + CBZ w4, _get_protection // Yes, get the protection MSR DAIF, x0 // Restore interrupts ISB // #ifdef TX_ENABLE_WFE WFE // Go into standby #endif + B _tx_thread_smp_protect // On waking, restart the protection attempt - /* We do this until we have the lock. */ - // while (1) - // { - -_try_to_get_lock: - - /* Disable interrupts so we don't get preempted. */ - - MRS x0, DAIF // Pickup current interrupt posture - MSR DAIFSet, 0x3 // Lockout interrupts - - /* Pickup the CPU ID. */ - - MRS x1, MPIDR_EL1 // Pickup the core ID -#ifdef TX_ARMV8_2 -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #16, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #8, #8 // Isolate core ID -#else -#if TX_THREAD_SMP_CLUSTERS > 1 - UBFX x7, x1, #8, #8 // Isolate cluster ID -#endif - UBFX x1, x1, #0, #8 // Isolate core ID -#endif -#if TX_THREAD_SMP_CLUSTERS > 1 - ADDS x1, x1, x7, LSL #2 // Calculate CPU ID -#endif - - /* Do we already have protection? */ - // if (this_core == _tx_thread_smp_protection.tx_thread_smp_protect_core) - // { - - LDR w3, [x2, #4] // Pickup the owning core - CMP w3, w1 // Is it this core? - BEQ _got_lock_after_waiting // Yes, the protection is already owned. This means - // an ISR preempted us and got protection - - // } - - /* Are we at the front of the list? */ - // if (this_core == _tx_thread_smp_protect_wait_list[_tx_thread_smp_protect_wait_list_head]) - // { - - LDR x3, =_tx_thread_smp_protect_wait_list_head // Get the address of the head - LDR w3, [x3] // Get the value of the head - LDR x4, =_tx_thread_smp_protect_wait_list // Get the address of the list - LDR w4, [x4, x3, LSL #2] // Get the value at the head index - - CMP w1, w4 - BNE _did_not_get_lock - - /* Is the lock still available? */ - // if (_tx_thread_smp_protection.tx_thread_smp_protect_in_force == 0) - // { - - LDAXR w3, [x2, #0] // Pickup the protection flag - CMP w3, #0 - BNE _did_not_get_lock // No, protection not available - - /* Get the lock. */ - // _tx_thread_smp_protection.tx_thread_smp_protect_in_force = 1; - - MOV w3, #1 // Build lock value - STXR w4, w3, [x2, #0] // Attempt to get the protection - CMP w4, #0 - BNE _did_not_get_lock // Did it fail? - DMB ISH // - - /* Got the lock. */ - // _tx_thread_smp_protect_lock_got(); - - _tx_thread_smp_protect_lock_got - - /* Remove this core from the wait list. */ - // _tx_thread_smp_protect_remove_from_front_of_list(); - - _tx_thread_smp_protect_remove_from_front_of_list - - B _got_lock_after_waiting - -_did_not_get_lock: - - /* For one reason or another, we didn't get the lock. */ - - /* Were we removed from the list? This can happen if we're a thread - and we got preempted. */ - // if (_tx_thread_smp_protect_wait_counts[this_core] == 0) - // { - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - CMP w4, #0 - BNE _already_in_list1 // Is this core already in the list? - - /* Add ourselves to the list. */ - // _tx_thread_smp_protect_wait_list_add(this_core); - - _tx_thread_smp_protect_wait_list_add // Call macro to add ourselves to the list - - /* Our waiting count was also reset when we were preempted. Increment it again. */ - // _tx_thread_smp_protect_wait_counts[this_core]++; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load wait list counts - LDR w4, [x3, x1, LSL #2] // Load waiting value for this core - ADD w4, w4, #1 // Increment wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - // } - -_already_in_list1: - - /* Restore interrupts and try again. */ - +_get_protection: + MOV x4, #1 // Build lock value + STXR w5, w4, [x1] // Attempt to get the protection + CBZ w5, _got_protection // Did it succeed? w5 = 0 means success! MSR DAIF, x0 // Restore interrupts - ISB // -#ifdef TX_ENABLE_WFE - WFE // Go into standby -#endif - B _try_to_get_lock // On waking, restart the protection attempt - -_got_lock_after_waiting: - - /* We're no longer waiting. */ - // _tx_thread_smp_protect_wait_counts[this_core]--; - - LDR x3, =_tx_thread_smp_protect_wait_counts // Load waiting list - LDR w4, [x3, x1, LSL #2] // Load current wait value - SUB w4, w4, #1 // Decrement wait value - STR w4, [x3, x1, LSL #2] // Store new wait value value - - /* Restore registers and return. */ - -_return: - + B _tx_thread_smp_protect // Restart the protection attempt + +_got_protection: + DMB ISH // + STR w2, [x1, #4] // Save owning core +_owned: + LDR w5, [x1, #8] // Pickup ownership count + ADD w5, w5, #1 // Increment ownership count + STR w5, [x1, #8] // Store ownership count + DMB ISH // RET diff --git a/ports_smp/cortex_a77_smp/gnu/src/tx_thread_smp_unprotect.S b/ports_smp/cortex_a77_smp/gnu/src/tx_thread_smp_unprotect.S index a783cde6..f9d8692a 100644 --- a/ports_smp/cortex_a77_smp/gnu/src/tx_thread_smp_unprotect.S +++ b/ports_smp/cortex_a77_smp/gnu/src/tx_thread_smp_unprotect.S @@ -60,10 +60,13 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ -/* 01-31-2022 Andres Mlinar Updated comments, */ -/* added ARMv8.2-A support, */ +/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* 01-31-2022 Andres Mlinar Updated comments, */ +/* added ARMv8.2-A support, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comments, removed */ +/* FIFO queueing, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ .global _tx_thread_smp_unprotect @@ -105,11 +108,6 @@ _tx_thread_smp_unprotect: CMP w3, #0 // Is the preempt disable flag set? BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protect_wait_counts // Build build address of wait counts - LDR w3, [x2, x1, LSL #2] // Pickup wait list value - CMP w3, #0 // Are any entities on this core waiting? - BNE _still_protected // Yes, skip the protection release - LDR x2,=_tx_thread_smp_protection // Build address of protection structure MOV w3, #0xFFFFFFFF // Build invalid value STR w3, [x2, #4] // Mark the protected core as invalid diff --git a/utility/execution_profile_kit/tx_execution_profile.c b/utility/execution_profile_kit/tx_execution_profile.c index 5ec6dd5e..7928a237 100644 --- a/utility/execution_profile_kit/tx_execution_profile.c +++ b/utility/execution_profile_kit/tx_execution_profile.c @@ -28,27 +28,27 @@ #include "tx_api.h" #include "tx_execution_profile.h" -/* Note to developers upgrading from ThreadX version 5: In ThreadX 5, the instruction was to +/* Note to developers upgrading from ThreadX version 5: In ThreadX 5, the instruction was to modify TX_THREAD_EXTENSION_3, and to define the symbol TX_ENABLE_EXECUTION_CHANGE_NOTIFY. For ThreadX 6, user no long need to modify TX_THREAD_EXTENSION_3, and shall use the symbol - TX_EXECUTION_PROFILE_ENABLE instead of TX_ENABLE_EXECUTION_CHANGE_NOTIFY. + TX_EXECUTION_PROFILE_ENABLE instead of TX_ENABLE_EXECUTION_CHANGE_NOTIFY. For backward compatibiliy reasons, project upgraded from ThreadX 5 may still be able to use - Execution Profile without changes to existing project, users are strongly recommended to + Execution Profile without changes to existing project, users are strongly recommended to make the change. */ #if defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE) -/* The thread execution profile kit is designed to track thread execution time - based on the hardware timer defined by TX_EXECUTION_TIME_SOURCE and - TX_EXECUTION_MAX_TIME_SOURCE below. When the thread's total time reaches +/* The thread execution profile kit is designed to track thread execution time + based on the hardware timer defined by TX_EXECUTION_TIME_SOURCE and + TX_EXECUTION_MAX_TIME_SOURCE below. When the thread's total time reaches the maximum value, it remains there until the time is reset to 0 via a call - to tx_thread_execution_time_reset. There are several assumptions to the + to tx_thread_execution_time_reset. There are several assumptions to the operation of this kit, as follows: - 1. The TX_EXECUTION_TIME_SOURCE and TX_EXECUTION_MAX_TIME_SOURCE macros are + 1. The TX_EXECUTION_TIME_SOURCE and TX_EXECUTION_MAX_TIME_SOURCE macros are defined to utilize a local hardware time source. 2. ThreadX 5.4 (or later) is being used, with the assembly code enabled to @@ -59,9 +59,9 @@ VOID _tx_execution_isr_enter(void); VOID _tx_execution_isr_exit(void); - 3. The ThreadX library assembly code must be rebuilt with TX_EXECUTION_PROFILE_ENABLE so - that these macros are expanded in the TX_THREAD structure and so the assembly code macros - are enabled to call the execution profile routines. + 3. The ThreadX library assembly code must be rebuilt with TX_EXECUTION_PROFILE_ENABLE so + that these macros are expanded in the TX_THREAD structure and so the assembly code macros + are enabled to call the execution profile routines. 4. Add tx_execution_profile.c to the application build. */ @@ -86,7 +86,7 @@ EXECUTION_TIME _tx_execution_thread_time_total; and _tx_thread_context_restore are tracked by this utility. */ EXECUTION_TIME _tx_execution_isr_time_total; -EXECUTION_TIME_SOURCE_TYPE _tx_execution_isr_time_last_start; +EXECUTION_TIME_SOURCE_TYPE _tx_execution_isr_time_last_start; /* Define the system idle time gathering information. For idle time that exceeds the range of the timer @@ -95,19 +95,67 @@ EXECUTION_TIME_SOURCE_TYPE _tx_execution_isr_time_last_start; EXECUTION_TIME _tx_execution_idle_time_total; EXECUTION_TIME_SOURCE_TYPE _tx_execution_idle_time_last_start; - +UINT _tx_execution_idle_active; /* For Cortex-M targets, we need to keep track of nested interrupts internally. */ #ifdef TX_CORTEX_M_EPK ULONG _tx_execution_isr_nest_counter = 0; #endif + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_execution_initialize PORTABLE C */ +/* 6.1.11 */ +/* AUTHOR */ +/* */ +/* Scott Larson, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function is called at initialization. */ +/* */ +/* INPUT */ +/* */ +/* None */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* xxx xxx */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 04-25-2022 Scott Larson Initial Version 6.1.11 */ +/* */ +/**************************************************************************/ +VOID _tx_execution_initialize(void) +{ + /* In idle mode until a thread is scheduled or ISR occurs. */ + _tx_execution_idle_active = TX_TRUE; + + /* Pickup the start of idle time. */ + _tx_execution_idle_time_last_start = TX_EXECUTION_TIME_SOURCE; +} + + /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _tx_execution_thread_enter PORTABLE C */ -/* 6.1.7 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -137,6 +185,9 @@ ULONG _tx_execution_isr_nest_counter = 0; /* DATE NAME DESCRIPTION */ /* */ /* 06-02-2021 William E. Lamie Initial Version 6.1.7 */ +/* 04-25-2022 Scott Larson Modified comments and fixed */ +/* wrap-around calculation, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ VOID _tx_execution_thread_enter(void) @@ -164,7 +215,7 @@ EXECUTION_TIME new_total_time; last_start_time = _tx_execution_idle_time_last_start; /* Determine if idle time is being measured. */ - if (last_start_time) + if (_tx_execution_idle_active) { /* Determine how to calculate the difference. */ @@ -173,12 +224,12 @@ EXECUTION_TIME new_total_time; /* Simply subtract. */ delta_time = (EXECUTION_TIME) (current_time - last_start_time); - } + } else { /* Timer wrapped, compute the delta assuming incrementing time counter. */ - delta_time = (EXECUTION_TIME) (current_time + (((EXECUTION_TIME_SOURCE_TYPE) TX_EXECUTION_MAX_TIME_SOURCE) - last_start_time)); + delta_time = (EXECUTION_TIME) (current_time + ((((EXECUTION_TIME_SOURCE_TYPE) TX_EXECUTION_MAX_TIME_SOURCE) + 1) - last_start_time)); } /* Pickup the total time. */ @@ -196,10 +247,10 @@ EXECUTION_TIME new_total_time; } /* Now store back the total idle time. */ - _tx_execution_idle_time_total = new_total_time; + _tx_execution_idle_time_total = new_total_time; /* Disable the idle time measurement. */ - _tx_execution_idle_time_last_start = 0; + _tx_execution_idle_active = TX_FALSE; } } @@ -209,7 +260,7 @@ EXECUTION_TIME new_total_time; /* FUNCTION RELEASE */ /* */ /* _tx_execution_thread_exit PORTABLE C */ -/* 6.1.7 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -239,6 +290,9 @@ EXECUTION_TIME new_total_time; /* DATE NAME DESCRIPTION */ /* */ /* 06-02-2021 William E. Lamie Initial Version 6.1.7 */ +/* 04-25-2022 Scott Larson Modified comments and fixed */ +/* wrap-around calculation, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ VOID _tx_execution_thread_exit(void) @@ -283,7 +337,7 @@ EXECUTION_TIME delta_time; { /* Timer wrapped, compute the delta assuming incrementing time counter. */ - delta_time = (EXECUTION_TIME) (current_time + (((EXECUTION_TIME_SOURCE_TYPE) TX_EXECUTION_MAX_TIME_SOURCE) - last_start_time)); + delta_time = (EXECUTION_TIME) (current_time + ((((EXECUTION_TIME_SOURCE_TYPE) TX_EXECUTION_MAX_TIME_SOURCE) + 1) - last_start_time)); } /* Pickup the total time. */ @@ -303,7 +357,7 @@ EXECUTION_TIME delta_time; /* Store back the new total time. */ thread_ptr -> tx_thread_execution_time_total = new_total_time; - /* Now accumulate this thread's execution time into the total thread execution time. */ + /* Now accumulate this thread's execution time into the total thread execution time. */ new_total_time = _tx_execution_thread_time_total + delta_time; /* Determine if a rollover on the total time is present. */ @@ -312,18 +366,18 @@ EXECUTION_TIME delta_time; /* Rollover. Set the total time to max value. */ new_total_time = (EXECUTION_TIME) TX_EXECUTION_MAX_TIME_SOURCE; - } + } /* Store back the new total time. */ _tx_execution_thread_time_total = new_total_time; } - + /* Is the system now idle? */ if (_tx_thread_execute_ptr == TX_NULL) { - /* Yes, idle system. Pickup the start of idle time. */ _tx_execution_idle_time_last_start = TX_EXECUTION_TIME_SOURCE; + _tx_execution_idle_active = TX_TRUE; } } } @@ -334,7 +388,7 @@ EXECUTION_TIME delta_time; /* FUNCTION RELEASE */ /* */ /* _tx_execution_isr_enter PORTABLE C */ -/* 6.1.7 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -364,6 +418,9 @@ EXECUTION_TIME delta_time; /* DATE NAME DESCRIPTION */ /* */ /* 06-02-2021 William E. Lamie Initial Version 6.1.7 */ +/* 04-25-2022 Scott Larson Modified comments and fixed */ +/* wrap-around calculation, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ VOID _tx_execution_isr_enter(void) @@ -381,7 +438,7 @@ EXECUTION_TIME delta_time; _tx_execution_isr_nest_counter++; #endif - /* Determine if this is the first interrupt. Nested interrupts are all treated as + /* Determine if this is the first interrupt. Nested interrupts are all treated as general interrupt processing. */ #ifdef TX_CORTEX_M_EPK if ((TX_THREAD_GET_SYSTEM_STATE()) && (_tx_execution_isr_nest_counter == 1)) @@ -420,7 +477,7 @@ EXECUTION_TIME delta_time; { /* Timer wrapped, compute the delta assuming incrementing time counter. */ - delta_time = (EXECUTION_TIME) (current_time + (((EXECUTION_TIME_SOURCE_TYPE) TX_EXECUTION_MAX_TIME_SOURCE) - last_start_time)); + delta_time = (EXECUTION_TIME) (current_time + ((((EXECUTION_TIME_SOURCE_TYPE) TX_EXECUTION_MAX_TIME_SOURCE) + 1) - last_start_time)); } /* Pickup the total time. */ @@ -440,7 +497,7 @@ EXECUTION_TIME delta_time; /* Store back the new total time. */ thread_ptr -> tx_thread_execution_time_total = new_total_time; - /* Now accumulate this thread's execution time into the total thread execution time. */ + /* Now accumulate this thread's execution time into the total thread execution time. */ new_total_time = _tx_execution_thread_time_total + delta_time; /* Determine if a rollover on the total time is present. */ @@ -457,7 +514,7 @@ EXECUTION_TIME delta_time; } /* Has idle time started? */ - else if (_tx_execution_idle_time_last_start) + else if (_tx_execution_idle_active) { /* Pickup the last idle start time. */ @@ -474,7 +531,7 @@ EXECUTION_TIME delta_time; { /* Timer wrapped, compute the delta assuming incrementing time counter. */ - delta_time = (EXECUTION_TIME) (current_time + (((EXECUTION_TIME_SOURCE_TYPE) TX_EXECUTION_MAX_TIME_SOURCE) - last_start_time)); + delta_time = (EXECUTION_TIME) (current_time + ((((EXECUTION_TIME_SOURCE_TYPE) TX_EXECUTION_MAX_TIME_SOURCE) + 1) - last_start_time)); } /* Pickup the total time. */ @@ -495,7 +552,7 @@ EXECUTION_TIME delta_time; _tx_execution_idle_time_total = new_total_time; /* Disable the idle time measurement. */ - _tx_execution_idle_time_last_start = 0; + _tx_execution_idle_active = TX_FALSE; } /* Save the ISR start time. */ @@ -509,7 +566,7 @@ EXECUTION_TIME delta_time; /* FUNCTION RELEASE */ /* */ /* _tx_execution_isr_exit PORTABLE C */ -/* 6.1.7 */ +/* 6.1.11 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ @@ -539,6 +596,9 @@ EXECUTION_TIME delta_time; /* DATE NAME DESCRIPTION */ /* */ /* 06-02-2021 William E. Lamie Initial Version 6.1.7 */ +/* 04-25-2022 Scott Larson Modified comments and fixed */ +/* wrap-around calculation, */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ VOID _tx_execution_isr_exit(void) @@ -620,6 +680,7 @@ EXECUTION_TIME delta_time; /* Yes, idle system. Pickup the start of idle time. */ _tx_execution_idle_time_last_start = TX_EXECUTION_TIME_SOURCE; + _tx_execution_idle_active = TX_TRUE; } } diff --git a/utility/execution_profile_kit/tx_execution_profile.h b/utility/execution_profile_kit/tx_execution_profile.h index 09ca91a9..9973c22d 100644 --- a/utility/execution_profile_kit/tx_execution_profile.h +++ b/utility/execution_profile_kit/tx_execution_profile.h @@ -58,20 +58,21 @@ typedef unsigned long EXECUTION_TIME_SOURCE_TYPE; /* Example for Cortex-M targets: */ #ifndef TX_EXECUTION_TIME_SOURCE -#define TX_EXECUTION_TIME_SOURCE (EXECUTION_TIME_SOURCE_TYPE) *((ULONG *) 0xE0001004) +#define TX_EXECUTION_TIME_SOURCE (EXECUTION_TIME_SOURCE_TYPE) *((volatile ULONG *) 0xE0001004) #endif #ifndef TX_EXECUTION_MAX_TIME_SOURCE #define TX_EXECUTION_MAX_TIME_SOURCE 0xFFFFFFFF #endif /* For 64-bit time source, the constant would be: */ -/*#define TX_EXECUTION_TIME_SOURCE (EXECUTION_TIME_SOURCE_TYPE) *((unsigned long long *) 0xE0001004) */ +/*#define TX_EXECUTION_TIME_SOURCE (EXECUTION_TIME_SOURCE_TYPE) *((volatile unsigned long long *) 0xE0001004) */ /*#define TX_EXECUTION_MAX_TIME_SOURCE 0xFFFFFFFFFFFFFFFF */ /* Define APIs of the execution profile kit. */ struct TX_THREAD_STRUCT; +VOID _tx_execution_initialize(void); VOID _tx_execution_thread_enter(void); VOID _tx_execution_thread_exit(void); VOID _tx_execution_isr_enter(void);