class done

This commit is contained in:
Trevor Barnes
2019-11-24 23:51:24 -06:00
parent 454bed8831
commit ecd65b11b4
50 changed files with 9495 additions and 2088 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -3,6 +3,22 @@
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
S_SRCS += \
../Src/delay.s \
../Src/keypad.s \
../Src/lcd.s \
../Src/main.s \
../Src/timer.s
OBJS += \
./Src/delay.o \
./Src/keypad.o \
./Src/lcd.o \
./Src/main.o \
./Src/timer.o
# Each subdirectory must supply rules for building sources it contributes
Src/%.o: ../Src/%.s
arm-none-eabi-gcc -mcpu=cortex-m4 -g3 -c -x assembler-with-cpp --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "$@" "$<"

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -24,6 +24,15 @@ Discarded input sections
.ARM.exidx 0x0000000000000000 0x8 c:/st/stm32cubeide_1.1.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard/crt0.o
.ARM.attributes
0x0000000000000000 0x20 c:/st/stm32cubeide_1.1.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard/crt0.o
.data 0x0000000000000000 0x0 Src/delay.o
.bss 0x0000000000000000 0x0 Src/delay.o
.data 0x0000000000000000 0x0 Src/keypad.o
.bss 0x0000000000000000 0x0 Src/keypad.o
.bss 0x0000000000000000 0x0 Src/lcd.o
.data 0x0000000000000000 0x0 Src/main.o
.bss 0x0000000000000000 0x0 Src/main.o
.data 0x0000000000000000 0x0 Src/timer.o
.bss 0x0000000000000000 0x0 Src/timer.o
.text 0x0000000000000000 0x14 Startup/startup_stm32f446retx.o
.data 0x0000000000000000 0x0 Startup/startup_stm32f446retx.o
.bss 0x0000000000000000 0x0 Startup/startup_stm32f446retx.o
@@ -84,6 +93,11 @@ Linker script and memory map
LOAD c:/st/stm32cubeide_1.1.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crti.o
LOAD c:/st/stm32cubeide_1.1.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtbegin.o
LOAD c:/st/stm32cubeide_1.1.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard/crt0.o
LOAD Src/delay.o
LOAD Src/keypad.o
LOAD Src/lcd.o
LOAD Src/main.o
LOAD Src/timer.o
LOAD Startup/startup_stm32f446retx.o
START GROUP
LOAD c:/st/stm32cubeide_1.1.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard\libc_nano.a
@@ -116,216 +130,241 @@ LOAD c:/st/stm32cubeide_1.1.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.exte
0x0000000008000000 g_pfnVectors
0x00000000080001c4 . = ALIGN (0x4)
.text 0x00000000080001c4 0xf4
.text 0x00000000080001c4 0x5cc
0x00000000080001c4 . = ALIGN (0x4)
*(.text)
.text 0x00000000080001c4 0x40 c:/st/stm32cubeide_1.1.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtbegin.o
.text 0x0000000008000204 0x38 Src/delay.o
0x0000000008000204 msDelay
0x000000000800022c usDelay
.text 0x000000000800023c 0x164 Src/keypad.o
0x000000000800023c KeyInit
0x000000000800025c KeyGetKeyNoblock
0x00000000080002f2 KeyGetKey
0x000000000800032a KeyGetChar
.text 0x00000000080003a0 0x304 Src/lcd.o
0x0000000008000474 lcdInit
0x00000000080004d4 lcdClear
0x00000000080004e8 lcdHome
0x00000000080004fc lcdSetPosition
0x000000000800051c lcdPrintString
0x0000000008000536 lcdPrintNum
0x000000000800057c lcdCursorLocation
0x0000000008000622 lcdBusyWait
.text 0x00000000080006a4 0xc Src/main.o
0x00000000080006a4 main
0x00000000080006b0 EXTI_BUTTON_PUSH
.text 0x00000000080006b0 0x2a Src/timer.o
0x00000000080006b0 timerInit
*(.text*)
*fill* 0x00000000080006da 0x2
.text.Reset_Handler
0x0000000008000204 0x50 Startup/startup_stm32f446retx.o
0x0000000008000204 Reset_Handler
0x00000000080006dc 0x50 Startup/startup_stm32f446retx.o
0x00000000080006dc Reset_Handler
.text.Default_Handler
0x0000000008000254 0x2 Startup/startup_stm32f446retx.o
0x0000000008000254 RTC_Alarm_IRQHandler
0x0000000008000254 EXTI2_IRQHandler
0x0000000008000254 TIM8_CC_IRQHandler
0x0000000008000254 SPDIF_Rx_IRQHandler
0x0000000008000254 DebugMon_Handler
0x0000000008000254 SPI4_IRQHandler
0x0000000008000254 TIM1_CC_IRQHandler
0x0000000008000254 QuadSPI_IRQHandler
0x0000000008000254 DMA2_Stream5_IRQHandler
0x0000000008000254 HardFault_Handler
0x0000000008000254 DMA1_Stream5_IRQHandler
0x0000000008000254 SysTick_Handler
0x0000000008000254 PVD_IRQHandler
0x0000000008000254 SDIO_IRQHandler
0x0000000008000254 TAMP_STAMP_IRQHandler
0x0000000008000254 PendSV_Handler
0x0000000008000254 NMI_Handler
0x0000000008000254 CAN2_RX1_IRQHandler
0x0000000008000254 EXTI3_IRQHandler
0x0000000008000254 TIM8_TRG_COM_TIM14_IRQHandler
0x0000000008000254 TIM1_UP_TIM10_IRQHandler
0x0000000008000254 FMPI2C1_error_IRQHandler
0x0000000008000254 TIM8_UP_TIM13_IRQHandler
0x0000000008000254 I2C3_ER_IRQHandler
0x0000000008000254 EXTI0_IRQHandler
0x0000000008000254 I2C2_EV_IRQHandler
0x0000000008000254 DMA1_Stream2_IRQHandler
0x0000000008000254 CAN1_RX0_IRQHandler
0x0000000008000254 FPU_IRQHandler
0x0000000008000254 OTG_HS_WKUP_IRQHandler
0x0000000008000254 UsageFault_Handler
0x0000000008000254 CAN2_SCE_IRQHandler
0x0000000008000254 DMA2_Stream2_IRQHandler
0x0000000008000254 SPI1_IRQHandler
0x0000000008000254 TIM6_DAC_IRQHandler
0x0000000008000254 TIM1_BRK_TIM9_IRQHandler
0x0000000008000254 DCMI_IRQHandler
0x0000000008000254 CAN2_RX0_IRQHandler
0x0000000008000254 DMA2_Stream3_IRQHandler
0x0000000008000254 FMPI2C1_IRQHandler
0x0000000008000254 SAI2_IRQHandler
0x0000000008000254 USART6_IRQHandler
0x0000000008000254 USART3_IRQHandler
0x0000000008000254 CAN1_RX1_IRQHandler
0x0000000008000254 UART5_IRQHandler
0x0000000008000254 DMA2_Stream0_IRQHandler
0x0000000008000254 TIM4_IRQHandler
0x0000000008000254 I2C1_EV_IRQHandler
0x0000000008000254 HDMI_CEC_IRQHandler
0x0000000008000254 DMA1_Stream6_IRQHandler
0x0000000008000254 DMA1_Stream1_IRQHandler
0x0000000008000254 UART4_IRQHandler
0x0000000008000254 TIM3_IRQHandler
0x0000000008000254 RCC_IRQHandler
0x0000000008000254 TIM8_BRK_TIM12_IRQHandler
0x0000000008000254 Default_Handler
0x0000000008000254 EXTI15_10_IRQHandler
0x0000000008000254 ADC_IRQHandler
0x0000000008000254 DMA1_Stream7_IRQHandler
0x0000000008000254 TIM7_IRQHandler
0x0000000008000254 CAN2_TX_IRQHandler
0x0000000008000254 TIM5_IRQHandler
0x0000000008000254 DMA2_Stream7_IRQHandler
0x0000000008000254 I2C3_EV_IRQHandler
0x0000000008000254 EXTI9_5_IRQHandler
0x0000000008000254 RTC_WKUP_IRQHandler
0x0000000008000254 SPI2_IRQHandler
0x0000000008000254 OTG_HS_EP1_IN_IRQHandler
0x0000000008000254 MemManage_Handler
0x0000000008000254 DMA1_Stream0_IRQHandler
0x0000000008000254 CAN1_TX_IRQHandler
0x0000000008000254 SVC_Handler
0x0000000008000254 EXTI4_IRQHandler
0x0000000008000254 OTG_HS_EP1_OUT_IRQHandler
0x0000000008000254 WWDG_IRQHandler
0x0000000008000254 TIM2_IRQHandler
0x0000000008000254 OTG_FS_WKUP_IRQHandler
0x0000000008000254 TIM1_TRG_COM_TIM11_IRQHandler
0x0000000008000254 OTG_HS_IRQHandler
0x0000000008000254 EXTI1_IRQHandler
0x0000000008000254 USART2_IRQHandler
0x0000000008000254 I2C2_ER_IRQHandler
0x0000000008000254 DMA2_Stream1_IRQHandler
0x0000000008000254 CAN1_SCE_IRQHandler
0x0000000008000254 FLASH_IRQHandler
0x0000000008000254 DMA2_Stream4_IRQHandler
0x0000000008000254 BusFault_Handler
0x0000000008000254 USART1_IRQHandler
0x0000000008000254 OTG_FS_IRQHandler
0x0000000008000254 SPI3_IRQHandler
0x0000000008000254 DMA1_Stream4_IRQHandler
0x0000000008000254 I2C1_ER_IRQHandler
0x0000000008000254 FMC_IRQHandler
0x0000000008000254 DMA2_Stream6_IRQHandler
0x0000000008000254 SAI1_IRQHandler
0x0000000008000254 DMA1_Stream3_IRQHandler
*fill* 0x0000000008000256 0x2
0x000000000800072c 0x2 Startup/startup_stm32f446retx.o
0x000000000800072c RTC_Alarm_IRQHandler
0x000000000800072c EXTI2_IRQHandler
0x000000000800072c TIM8_CC_IRQHandler
0x000000000800072c SPDIF_Rx_IRQHandler
0x000000000800072c DebugMon_Handler
0x000000000800072c SPI4_IRQHandler
0x000000000800072c TIM1_CC_IRQHandler
0x000000000800072c QuadSPI_IRQHandler
0x000000000800072c DMA2_Stream5_IRQHandler
0x000000000800072c HardFault_Handler
0x000000000800072c DMA1_Stream5_IRQHandler
0x000000000800072c SysTick_Handler
0x000000000800072c PVD_IRQHandler
0x000000000800072c SDIO_IRQHandler
0x000000000800072c TAMP_STAMP_IRQHandler
0x000000000800072c PendSV_Handler
0x000000000800072c NMI_Handler
0x000000000800072c CAN2_RX1_IRQHandler
0x000000000800072c EXTI3_IRQHandler
0x000000000800072c TIM8_TRG_COM_TIM14_IRQHandler
0x000000000800072c TIM1_UP_TIM10_IRQHandler
0x000000000800072c FMPI2C1_error_IRQHandler
0x000000000800072c TIM8_UP_TIM13_IRQHandler
0x000000000800072c I2C3_ER_IRQHandler
0x000000000800072c EXTI0_IRQHandler
0x000000000800072c I2C2_EV_IRQHandler
0x000000000800072c DMA1_Stream2_IRQHandler
0x000000000800072c CAN1_RX0_IRQHandler
0x000000000800072c FPU_IRQHandler
0x000000000800072c OTG_HS_WKUP_IRQHandler
0x000000000800072c UsageFault_Handler
0x000000000800072c CAN2_SCE_IRQHandler
0x000000000800072c DMA2_Stream2_IRQHandler
0x000000000800072c SPI1_IRQHandler
0x000000000800072c TIM6_DAC_IRQHandler
0x000000000800072c TIM1_BRK_TIM9_IRQHandler
0x000000000800072c DCMI_IRQHandler
0x000000000800072c CAN2_RX0_IRQHandler
0x000000000800072c DMA2_Stream3_IRQHandler
0x000000000800072c FMPI2C1_IRQHandler
0x000000000800072c SAI2_IRQHandler
0x000000000800072c USART6_IRQHandler
0x000000000800072c USART3_IRQHandler
0x000000000800072c CAN1_RX1_IRQHandler
0x000000000800072c UART5_IRQHandler
0x000000000800072c DMA2_Stream0_IRQHandler
0x000000000800072c TIM4_IRQHandler
0x000000000800072c I2C1_EV_IRQHandler
0x000000000800072c HDMI_CEC_IRQHandler
0x000000000800072c DMA1_Stream6_IRQHandler
0x000000000800072c DMA1_Stream1_IRQHandler
0x000000000800072c UART4_IRQHandler
0x000000000800072c TIM3_IRQHandler
0x000000000800072c RCC_IRQHandler
0x000000000800072c TIM8_BRK_TIM12_IRQHandler
0x000000000800072c Default_Handler
0x000000000800072c EXTI15_10_IRQHandler
0x000000000800072c ADC_IRQHandler
0x000000000800072c DMA1_Stream7_IRQHandler
0x000000000800072c TIM7_IRQHandler
0x000000000800072c CAN2_TX_IRQHandler
0x000000000800072c TIM5_IRQHandler
0x000000000800072c DMA2_Stream7_IRQHandler
0x000000000800072c I2C3_EV_IRQHandler
0x000000000800072c EXTI9_5_IRQHandler
0x000000000800072c RTC_WKUP_IRQHandler
0x000000000800072c SPI2_IRQHandler
0x000000000800072c OTG_HS_EP1_IN_IRQHandler
0x000000000800072c MemManage_Handler
0x000000000800072c DMA1_Stream0_IRQHandler
0x000000000800072c CAN1_TX_IRQHandler
0x000000000800072c SVC_Handler
0x000000000800072c EXTI4_IRQHandler
0x000000000800072c OTG_HS_EP1_OUT_IRQHandler
0x000000000800072c WWDG_IRQHandler
0x000000000800072c TIM2_IRQHandler
0x000000000800072c OTG_FS_WKUP_IRQHandler
0x000000000800072c TIM1_TRG_COM_TIM11_IRQHandler
0x000000000800072c OTG_HS_IRQHandler
0x000000000800072c EXTI1_IRQHandler
0x000000000800072c USART2_IRQHandler
0x000000000800072c I2C2_ER_IRQHandler
0x000000000800072c DMA2_Stream1_IRQHandler
0x000000000800072c CAN1_SCE_IRQHandler
0x000000000800072c FLASH_IRQHandler
0x000000000800072c DMA2_Stream4_IRQHandler
0x000000000800072c BusFault_Handler
0x000000000800072c USART1_IRQHandler
0x000000000800072c OTG_FS_IRQHandler
0x000000000800072c SPI3_IRQHandler
0x000000000800072c DMA1_Stream4_IRQHandler
0x000000000800072c I2C1_ER_IRQHandler
0x000000000800072c FMC_IRQHandler
0x000000000800072c DMA2_Stream6_IRQHandler
0x000000000800072c SAI1_IRQHandler
0x000000000800072c DMA1_Stream3_IRQHandler
*fill* 0x000000000800072e 0x2
.text.__libc_init_array
0x0000000008000258 0x48 c:/st/stm32cubeide_1.1.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard\libc_nano.a(lib_a-init.o)
0x0000000008000258 __libc_init_array
0x0000000008000730 0x48 c:/st/stm32cubeide_1.1.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard\libc_nano.a(lib_a-init.o)
0x0000000008000730 __libc_init_array
*(.glue_7)
.glue_7 0x00000000080002a0 0x0 linker stubs
.glue_7 0x0000000008000778 0x0 linker stubs
*(.glue_7t)
.glue_7t 0x00000000080002a0 0x0 linker stubs
.glue_7t 0x0000000008000778 0x0 linker stubs
*(.eh_frame)
.eh_frame 0x00000000080002a0 0x0 c:/st/stm32cubeide_1.1.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtbegin.o
.eh_frame 0x0000000008000778 0x0 c:/st/stm32cubeide_1.1.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtbegin.o
*(.init)
.init 0x00000000080002a0 0x4 c:/st/stm32cubeide_1.1.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crti.o
0x00000000080002a0 _init
.init 0x00000000080002a4 0x8 c:/st/stm32cubeide_1.1.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtn.o
.init 0x0000000008000778 0x4 c:/st/stm32cubeide_1.1.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crti.o
0x0000000008000778 _init
.init 0x000000000800077c 0x8 c:/st/stm32cubeide_1.1.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtn.o
*(.fini)
.fini 0x00000000080002ac 0x4 c:/st/stm32cubeide_1.1.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crti.o
0x00000000080002ac _fini
.fini 0x00000000080002b0 0x8 c:/st/stm32cubeide_1.1.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtn.o
0x00000000080002b8 . = ALIGN (0x4)
0x00000000080002b8 _etext = .
.fini 0x0000000008000784 0x4 c:/st/stm32cubeide_1.1.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crti.o
0x0000000008000784 _fini
.fini 0x0000000008000788 0x8 c:/st/stm32cubeide_1.1.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtn.o
0x0000000008000790 . = ALIGN (0x4)
0x0000000008000790 _etext = .
.vfp11_veneer 0x00000000080002b8 0x0
.vfp11_veneer 0x00000000080002b8 0x0 linker stubs
.vfp11_veneer 0x0000000008000790 0x0
.vfp11_veneer 0x0000000008000790 0x0 linker stubs
.v4_bx 0x00000000080002b8 0x0
.v4_bx 0x00000000080002b8 0x0 linker stubs
.v4_bx 0x0000000008000790 0x0
.v4_bx 0x0000000008000790 0x0 linker stubs
.iplt 0x00000000080002b8 0x0
.iplt 0x00000000080002b8 0x0 c:/st/stm32cubeide_1.1.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtbegin.o
.iplt 0x0000000008000790 0x0
.iplt 0x0000000008000790 0x0 c:/st/stm32cubeide_1.1.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtbegin.o
.rel.dyn 0x00000000080002b8 0x0
.rel.iplt 0x00000000080002b8 0x0 c:/st/stm32cubeide_1.1.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtbegin.o
.rodata 0x00000000080002b8 0x0
0x00000000080002b8 . = ALIGN (0x4)
.rodata 0x0000000008000790 0x14
0x0000000008000790 . = ALIGN (0x4)
*(.rodata)
.rodata 0x0000000008000790 0x11 Src/keypad.o
*(.rodata*)
0x00000000080002b8 . = ALIGN (0x4)
0x00000000080007a4 . = ALIGN (0x4)
*fill* 0x00000000080007a1 0x3
.ARM.extab 0x00000000080002b8 0x0
0x00000000080002b8 . = ALIGN (0x4)
.rel.dyn 0x00000000080007a4 0x0
.rel.iplt 0x00000000080007a4 0x0 c:/st/stm32cubeide_1.1.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtbegin.o
.ARM.extab 0x00000000080007a4 0x0
0x00000000080007a4 . = ALIGN (0x4)
*(.ARM.extab* .gnu.linkonce.armextab.*)
0x00000000080002b8 . = ALIGN (0x4)
0x00000000080007a4 . = ALIGN (0x4)
.ARM 0x00000000080002b8 0x0
0x00000000080002b8 . = ALIGN (0x4)
0x00000000080002b8 __exidx_start = .
.ARM 0x00000000080007a4 0x0
0x00000000080007a4 . = ALIGN (0x4)
0x00000000080007a4 __exidx_start = .
*(.ARM.exidx*)
0x00000000080002b8 __exidx_end = .
0x00000000080002b8 . = ALIGN (0x4)
0x00000000080007a4 __exidx_end = .
0x00000000080007a4 . = ALIGN (0x4)
.preinit_array 0x00000000080002b8 0x0
0x00000000080002b8 . = ALIGN (0x4)
0x00000000080002b8 PROVIDE (__preinit_array_start = .)
.preinit_array 0x00000000080007a4 0x0
0x00000000080007a4 . = ALIGN (0x4)
0x00000000080007a4 PROVIDE (__preinit_array_start = .)
*(.preinit_array*)
0x00000000080002b8 PROVIDE (__preinit_array_end = .)
0x00000000080002b8 . = ALIGN (0x4)
0x00000000080007a4 PROVIDE (__preinit_array_end = .)
0x00000000080007a4 . = ALIGN (0x4)
.init_array 0x00000000080002b8 0x4
0x00000000080002b8 . = ALIGN (0x4)
0x00000000080002b8 PROVIDE (__init_array_start = .)
.init_array 0x00000000080007a4 0x4
0x00000000080007a4 . = ALIGN (0x4)
0x00000000080007a4 PROVIDE (__init_array_start = .)
*(SORT_BY_NAME(.init_array.*))
*(.init_array*)
.init_array 0x00000000080002b8 0x4 c:/st/stm32cubeide_1.1.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtbegin.o
0x00000000080002bc PROVIDE (__init_array_end = .)
0x00000000080002bc . = ALIGN (0x4)
.init_array 0x00000000080007a4 0x4 c:/st/stm32cubeide_1.1.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtbegin.o
0x00000000080007a8 PROVIDE (__init_array_end = .)
0x00000000080007a8 . = ALIGN (0x4)
.fini_array 0x00000000080002bc 0x4
0x00000000080002bc . = ALIGN (0x4)
.fini_array 0x00000000080007a8 0x4
0x00000000080007a8 . = ALIGN (0x4)
[!provide] PROVIDE (__fini_array_start = .)
*(SORT_BY_NAME(.fini_array.*))
*(.fini_array*)
.fini_array 0x00000000080002bc 0x4 c:/st/stm32cubeide_1.1.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtbegin.o
.fini_array 0x00000000080007a8 0x4 c:/st/stm32cubeide_1.1.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtbegin.o
[!provide] PROVIDE (__fini_array_end = .)
0x00000000080002c0 . = ALIGN (0x4)
0x00000000080002c0 _sidata = LOADADDR (.data)
0x00000000080007ac . = ALIGN (0x4)
0x00000000080007ac _sidata = LOADADDR (.data)
.data 0x0000000020000000 0x0 load address 0x00000000080002c0
.data 0x0000000020000000 0x4 load address 0x00000000080007ac
0x0000000020000000 . = ALIGN (0x4)
0x0000000020000000 _sdata = .
*(.data)
.data 0x0000000020000000 0x4 Src/lcd.o
*(.data*)
0x0000000020000000 . = ALIGN (0x4)
0x0000000020000000 _edata = .
0x0000000020000004 . = ALIGN (0x4)
0x0000000020000004 _edata = .
.igot.plt 0x0000000020000000 0x0 load address 0x00000000080002c0
.igot.plt 0x0000000020000000 0x0 c:/st/stm32cubeide_1.1.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtbegin.o
0x0000000020000000 . = ALIGN (0x4)
.igot.plt 0x0000000020000004 0x0 load address 0x00000000080007b0
.igot.plt 0x0000000020000004 0x0 c:/st/stm32cubeide_1.1.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtbegin.o
0x0000000020000004 . = ALIGN (0x4)
.bss 0x0000000020000000 0x1c load address 0x00000000080002c0
0x0000000020000000 _sbss = .
0x0000000020000000 __bss_start__ = _sbss
.bss 0x0000000020000004 0x1c load address 0x00000000080007b0
0x0000000020000004 _sbss = .
0x0000000020000004 __bss_start__ = _sbss
*(.bss)
.bss 0x0000000020000000 0x1c c:/st/stm32cubeide_1.1.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtbegin.o
.bss 0x0000000020000004 0x1c c:/st/stm32cubeide_1.1.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtbegin.o
*(.bss*)
*(COMMON)
0x000000002000001c . = ALIGN (0x4)
0x000000002000001c _ebss = .
0x000000002000001c __bss_end__ = _ebss
0x0000000020000020 . = ALIGN (0x4)
0x0000000020000020 _ebss = .
0x0000000020000020 __bss_end__ = _ebss
._user_heap_stack
0x000000002000001c 0x604 load address 0x00000000080002c0
0x0000000020000020 0x600 load address 0x00000000080007b0
0x0000000020000020 . = ALIGN (0x8)
*fill* 0x000000002000001c 0x4
[!provide] PROVIDE (end = .)
[!provide] PROVIDE (_end = .)
0x0000000020000220 . = (. + _Min_Heap_Size)
@@ -347,28 +386,73 @@ LOAD c:/st/stm32cubeide_1.1.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.exte
.ARM.attributes
0x0000000000000022 0x34 c:/st/stm32cubeide_1.1.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtbegin.o
.ARM.attributes
0x0000000000000056 0x21 Startup/startup_stm32f446retx.o
0x0000000000000056 0x25 Src/delay.o
.ARM.attributes
0x0000000000000077 0x34 c:/st/stm32cubeide_1.1.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard\libc_nano.a(lib_a-init.o)
0x000000000000007b 0x25 Src/keypad.o
.ARM.attributes
0x00000000000000ab 0x22 c:/st/stm32cubeide_1.1.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtn.o
0x00000000000000a0 0x25 Src/lcd.o
.ARM.attributes
0x00000000000000c5 0x25 Src/main.o
.ARM.attributes
0x00000000000000ea 0x25 Src/timer.o
.ARM.attributes
0x000000000000010f 0x21 Startup/startup_stm32f446retx.o
.ARM.attributes
0x0000000000000130 0x34 c:/st/stm32cubeide_1.1.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard\libc_nano.a(lib_a-init.o)
.ARM.attributes
0x0000000000000164 0x22 c:/st/stm32cubeide_1.1.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtn.o
OUTPUT(lab7interrupts.elf elf32-littlearm)
.debug_line 0x0000000000000000 0x84
.debug_line 0x0000000000000000 0x84 Startup/startup_stm32f446retx.o
.debug_line 0x0000000000000000 0x36b
.debug_line 0x0000000000000000 0x52 Src/delay.o
.debug_line 0x0000000000000052 0xcf Src/keypad.o
.debug_line 0x0000000000000121 0x13c Src/lcd.o
.debug_line 0x000000000000025d 0x3f Src/main.o
.debug_line 0x000000000000029c 0x4b Src/timer.o
.debug_line 0x00000000000002e7 0x84 Startup/startup_stm32f446retx.o
.debug_info 0x0000000000000000 0x22
.debug_info 0x0000000000000000 0x22 Startup/startup_stm32f446retx.o
.debug_info 0x0000000000000000 0xe0
.debug_info 0x0000000000000000 0x26 Src/delay.o
.debug_info 0x0000000000000026 0x26 Src/keypad.o
.debug_info 0x000000000000004c 0x26 Src/lcd.o
.debug_info 0x0000000000000072 0x26 Src/main.o
.debug_info 0x0000000000000098 0x26 Src/timer.o
.debug_info 0x00000000000000be 0x22 Startup/startup_stm32f446retx.o
.debug_abbrev 0x0000000000000000 0x12
.debug_abbrev 0x0000000000000000 0x12 Startup/startup_stm32f446retx.o
.debug_abbrev 0x0000000000000000 0x76
.debug_abbrev 0x0000000000000000 0x14 Src/delay.o
.debug_abbrev 0x0000000000000014 0x14 Src/keypad.o
.debug_abbrev 0x0000000000000028 0x14 Src/lcd.o
.debug_abbrev 0x000000000000003c 0x14 Src/main.o
.debug_abbrev 0x0000000000000050 0x14 Src/timer.o
.debug_abbrev 0x0000000000000064 0x12 Startup/startup_stm32f446retx.o
.debug_aranges 0x0000000000000000 0x28
.debug_aranges 0x0000000000000000 0xc8
.debug_aranges
0x0000000000000000 0x28 Startup/startup_stm32f446retx.o
0x0000000000000000 0x20 Src/delay.o
.debug_aranges
0x0000000000000020 0x20 Src/keypad.o
.debug_aranges
0x0000000000000040 0x20 Src/lcd.o
.debug_aranges
0x0000000000000060 0x20 Src/main.o
.debug_aranges
0x0000000000000080 0x20 Src/timer.o
.debug_aranges
0x00000000000000a0 0x28 Startup/startup_stm32f446retx.o
.debug_str 0x0000000000000000 0x73
.debug_str 0x0000000000000000 0x73 Startup/startup_stm32f446retx.o
.debug_str 0x0000000000000000 0xbc
.debug_str 0x0000000000000000 0x5f Src/delay.o
.debug_str 0x000000000000005f 0x10 Src/keypad.o
0x60 (size before relaxing)
.debug_str 0x000000000000006f 0xd Src/lcd.o
0x5d (size before relaxing)
.debug_str 0x000000000000007c 0xe Src/main.o
0x5e (size before relaxing)
.debug_str 0x000000000000008a 0xf Src/timer.o
0x5f (size before relaxing)
.debug_str 0x0000000000000099 0x23 Startup/startup_stm32f446retx.o
0x73 (size before relaxing)
.debug_ranges 0x0000000000000000 0x20
.debug_ranges 0x0000000000000000 0x20 Startup/startup_stm32f446retx.o

View File

@@ -1 +1,6 @@
"Src/delay.o"
"Src/keypad.o"
"Src/lcd.o"
"Src/main.o"
"Src/timer.o"
"Startup/startup_stm32f446retx.o"

View File

@@ -16,6 +16,6 @@ C_DEPS :=
# Every subdirectory with source files must be described here
SUBDIRS := \
Startup \
Src \
Startup \

View File

@@ -0,0 +1,59 @@
# delay.s
# Trevor Barnes
# CE2801-031
# Description: A file for handling delay routines
.syntax unified
.cpu cortex-m4
.thumb
.section .text
.global msDelay
# A subroutine to create a delay of a certain number of milliseconds
# Input:
# r0: Length of delay (ms)
msDelay:
push {r1,r2,r3,lr}
mov r3,r0
ms_delay:
# 250 iterations = 1/16 of a millisecond
mov r2, #0x10
# Loop 16 times
1:
# 250
mov r1, #0xFA
# Loop 250 times
2:
sub r1, #1
cmp r1, #0
bne 2b
sub r2, #1
cmp r2, #0
bne 1b
sub r0, #1
cmp r0, #0
bne ms_delay
mov r0,r3
pop {r1,r2,r3,pc}
.global usDelay
# about r1 mircoseonds
usDelay:
# stack
push {lr}
lsl r1, r1, #3
1:
sub r1, r1, #1
cmp r1, #0
bne 1b
# return
pop {pc}

259
lab7interrupts/Src/keypad.s Normal file
View File

@@ -0,0 +1,259 @@
# keypad.s
# Trevor Barnes
# CE2801-031
# Description: Contains routines for the keypad component
.syntax unified
.cpu cortex-m4
.thumb
.section .text
.equ RCC_BASE, 0x40023800
.equ RCC_AHB1ENR, 0x30
.equ RCC_GPIOCEN, 1<<2
.equ GPIOC_BASE, 0x40020800
.equ GPIO_MODER, 0x00
.equ GPIO_ODR, 0x14
.equ GPIO_IDR, 0x10
.equ GPIO_PUPDR, 0x0C
.equ GPIO_BSRR, 0x18
# Row 1
.equ k1, 0xEE
.equ k2, 0xED
.equ k3, 0xEB
.equ k4, 0xE7
# Row 2
.equ k5, 0xDE
.equ k6, 0xDD
.equ k7, 0xDB
.equ k8, 0xD7
# Row 3
.equ k9, 0xBE
.equ k10, 0xBD
.equ k11, 0xBB
.equ k12, 0xB7
# Row 4
.equ k13, 0x7E
.equ k14, 0x7D
.equ k15, 0x7B
.equ k16, 0x77
.global KeyInit
# Initialize the keypad GPIO port.  
# Depending on your scanning algorithm,
# there may not be any work to do in this method
KeyInit:
push {r0,r1,r2,lr}
ldr r1, =RCC_BASE
ldr r2, [r1, #RCC_AHB1ENR]
orr r2, r2, #RCC_GPIOCEN
str r2, [r1, #RCC_AHB1ENR]
# Read current PUPDR state
ldr r1, =GPIOC_BASE
ldr r2, [r1, #GPIO_PUPDR]
# Modify and write rows and columns to be "Pull-Up"
bfc r2, #0, #16
ldr r0, =0x5555
orr r2, r2, r0
str r2, [r1, #GPIO_PUPDR]
pop {r0,r1,r2,pc}
.global KeyGetKeyNoblock
# Returns in r0 a numeric code representing
# the button on the keypad that was pressed (1 to 16),
# or 0 if no button is pressed
KeyGetKeyNoblock:
push {r1,r2,lr}
bl keypadScan
mov r1, #0
ubfx r2, r0, #4, #4
cmp r2, #0xF
beq 1f
add r1, #1
cmp r0, #k1
beq 1f
add r1, #1
cmp r0, #k2
beq 1f
add r1, #1
cmp r0, #k3
beq 1f
add r1, #1
cmp r0, #k4
beq 1f
add r1, #1
cmp r0, #k5
beq 1f
add r1, #1
cmp r0, #k6
beq 1f
add r1, #1
cmp r0, #k7
beq 1f
add r1, #1
cmp r0, #k8
beq 1f
add r1, #1
cmp r0, #k9
beq 1f
add r1, #1
cmp r0, #k10
beq 1f
add r1, #1
cmp r0, #k11
beq 1f
add r1, #1
cmp r0, #k12
beq 1f
add r1, #1
cmp r0, #k13
beq 1f
add r1, #1
cmp r0, #k14
beq 1f
add r1, #1
cmp r0, #k15
beq 1f
add r1, #1
cmp r0, #k16
beq 1f
1:
mov r0, r1
pop {r1,r2,pc}
.global KeyGetKey
# Same as KeyGetkeyNoblock, but blocks that is,
# waits until a key is pressed and then returns the key code.  
# Per discussion in lecture, you may wish to return after said key
# is released
KeyGetKey:
push {r1,r2,r3,lr}
mov r0, #0
1:
mov r1, #10
bl usDelay
bl KeyGetKeyNoblock
cmp r0, #0
beq 1b
2:
# Row = Input | Col = Output
ldr r1, =GPIOC_BASE
ldr r2, [r1, #GPIO_MODER]
mov r3, #0x0055
bfi r2, r3, #0, #16
str r2, [r1, #GPIO_MODER]
# "0000" -> ODR (Col)
ldrb r2, [r1, #GPIO_ODR]
mov r3, #0x0
bfi r2, r3, #0, #4
strb r2, [r1, #GPIO_ODR]
# Store input data in r3
ldrb r3, [r1, #GPIO_IDR]
cmp r3, #0xF0
bne 2b
pop {r1,r2,r3,pc}
.global KeyGetChar
# Similar to KeyGetkey, but returns the ASCII code corresponding
# to the key press. 
# This method blocks. You should use a data structure in .rodata
# to map keys to characters
KeyGetChar:
push {r1,r2,lr}
bl KeyGetKey
sub r0, #1
mov r2, r0
ldr r1, =keyChars
ldrb r0, [r1, r2]
pop {r1,r2,pc}
# Waits for input on keypad and returns that value in r0
keypadScan:
push {r1,r2,r3,lr}
2:
# Row = Input | Col = Output
ldr r1, =GPIOC_BASE
ldr r2, [r1, #GPIO_MODER]
mov r0, #0x0055
bfi r2, r0, #0, #16
str r2, [r1, #GPIO_MODER]
# "0000" -> ODR (Col)
ldrb r2, [r1, #GPIO_ODR]
mov r3, #0x0
bfi r2, r3, #0, #4
strb r2, [r1, #GPIO_ODR]
# Store input data in r3
mov r0, r1
mov r1, #5
bl usDelay
mov r1, r0
ldrb r3, [r1, #GPIO_IDR]
# Row = Output | Col = Input
ldr r1, =GPIOC_BASE
ldr r2, [r1, #GPIO_MODER]
mov r0, #0x5500
bfi r2, r0, #0, #16
str r2, [r1, #GPIO_MODER]
# "0000" -> ODR (Row)
ldrb r2, [r1, #GPIO_ODR]
mov r0, #0x0
bfi r2, r0, #0, #4
strb r2, [r1, #GPIO_ODR]
mov r0, r1
mov r1, #5
bl usDelay
mov r1, r0
# Read IDR (Row & Col)
ldrb r0, [r1, #GPIO_IDR]
orr r0, r0, r3
pop {r1,r2,r3,pc}
.section .rodata
keyChars:
.asciz "123A456B789C*0#D"

476
lab7interrupts/Src/lcd.s Normal file
View File

@@ -0,0 +1,476 @@
# lcd.s
# Trevor Barnes
# CE2801-031
# Description: Contains routines for the LCD component
.syntax unified
.cpu cortex-m4
.thumb
.section .text
#Fill in addresses
.equ RCC_BASE, 0x40023800
.equ RCC_AHB1ENR, 0x30
.equ RCC_GPIOAEN, 1<<0
.equ RCC_GPIOCEN, 1<<2
.equ GPIOA_BASE, 0x40020000
.equ GPIOC_BASE, 0x40020800
.equ GPIO_MODER, 0x00
.equ GPIO_ODR, 0x14
.equ GPIO_IDR, 0x10
.equ GPIO_BSRR, 0x18
#What pin is each of these?
.equ RS, 8 // PC8
.equ RW, 9 // PC9
.equ E, 10 // PC10
#Commands for BSRR
.equ RS_SET, 1<<RS
.equ RS_CLR, 1<<(RS+16)
.equ RW_SET, 1<<RW
.equ RW_CLR, 1<<(RW+16)
.equ E_SET, 1<<E
.equ E_CLR, 1<<(E+16)
#Globally exposed functions
.global lcdInit
#Local helper function
PortSetup:
push {r1,r2,r3}
#Turn on Ports in RCC
ldr r1, =RCC_BASE
ldr r2, [r1, #RCC_AHB1ENR]
orr r2, r2, #RCC_GPIOAEN
str r2, [r1, #RCC_AHB1ENR]
ldr r2, [r1, #RCC_AHB1ENR]
orr r2, r2, #RCC_GPIOCEN
str r2, [r1, #RCC_AHB1ENR]
#Set DB Pins to Outputs
ldr r1, =GPIOA_BASE
ldr r2, [r1, #GPIO_MODER]
movw r3, 0x5500
movt r3, 0x0055
orr r2,r2, r3
movw r3, 0xAA00
movt r3, 0x00AA
bic r2, r2, r3
str r2, [r1, #GPIO_MODER]
#Set RS RW E Pins to Outputs
ldr r1, =GPIOC_BASE
ldr r2, [r1, #GPIO_MODER]
movw r3, 0x0000
movt r3, 0x0015
orr r2,r2, r3
movw r3, 0x0000
movt r3, 0x00EA
bic r2, r2, r3
str r2, [r1, #GPIO_MODER]
pop {r1,r2,r3}
bx lr
#Writes instruction
#RS=0 RW=0 R1-Arg
#No returns
WriteInstruction:
push {r2,r3,lr}
#Set RS=0,RW=0,E=0
ldr r2, =GPIOC_BASE
mov r3, RS_CLR
str r3, [r2, #GPIO_BSRR]
mov r3, RW_CLR
str r3, [r2, #GPIO_BSRR]
mov r3, E_CLR
str r3, [r2, #GPIO_BSRR]
#Set E=1
mov r3, E_SET
str r3, [r2, #GPIO_BSRR]
#Set R1 -> DataBus
lsl r1, #4
ldr r3, =GPIOA_BASE
ldr r2, [r3, #GPIO_ODR]
bfc r2, #4, #8
orr r2, r2, r1
str r2, [r3, #GPIO_ODR ]
#Set E=0
ldr r2, =GPIOC_BASE
mov r3, E_CLR
str r3, [r2, #GPIO_BSRR]
#Wait for appropriate delay
mov r1, #37
bl usDelay
pop {r2,r3,pc}
#Writes data
#RS=0 RW=0 R1-Arg
#No returns
WriteData:
push {r1,r2,r3,r4,lr}
#Set RS=1,RW=0,E=0
ldr r2, =GPIOC_BASE
mov r3, #RS_SET
str r3, [r2, #GPIO_BSRR]
mov r3, #RW_CLR
str r3, [r2, #GPIO_BSRR]
mov r3, #E_CLR
str r3, [r2, #GPIO_BSRR]
#Set E=1
mov r3, #E_SET
str r3, [r2, #GPIO_BSRR]
#Set R1 -> DataBus
lsl r1, #4
ldr r3, =GPIOA_BASE
ldr r2, [r3, #GPIO_ODR]
bfc r2, #4, #8
orr r2, r2, r1
str r2, [r3, #GPIO_ODR ]
#Set E=0
ldr r2, =GPIOC_BASE
mov r3, #E_CLR
str r3, [r2, #GPIO_BSRR]
#Wait for appropriate delay
mov r1, #37
bl usDelay
pop {r1,r2,r3,r4,pc}
#Code to intialize the lcd
lcdInit:
push {r0,r1,lr}
#Set up Ports
bl PortSetup
#Wait 40ms
mov r0, #40
bl msDelay
#Write Function Set (0x38)
mov r1, 0x38
bl WriteInstruction
mov r1, #37
bl usDelay
#Write Function Set (0x38)
mov r1, 0x38
bl WriteInstruction
mov r1, #37
bl usDelay
#Write Display On/Off(0x0F)
mov r1, 0x0F
bl WriteInstruction
mov r1, #37
bl usDelay
#Write Display Clear (0x01)
mov r1, 0x01
bl WriteInstruction
mov r1, #2
bl msDelay
#Write Entry Mode Set (0x06)
mov r1, 0x06
bl WriteInstruction
mov r1, #37
bl usDelay
pop {r0,r1,pc}
.global lcdClear
# clears the display
# no arguments or return
# includes necessary delay
lcdClear:
push {r0,r1,lr}
mov r1, 0x01
bl WriteInstruction
# Delay for at least 1.52ms
mov r0, #2
bl msDelay
pop {r0,r1,pc}
.global lcdHome
# moves cursor to the home position
# no arguments or return
# includes necessary delay
lcdHome:
push {r1,lr}
mov r1, #0x02
bl WriteInstruction
mov r0, #2
bl msDelay
pop {r1,pc}
.global lcdSetPosition
# moves cursor to the position indicated
# r0 is the zero-based row and r1 is the zero-based column, no return value
# includes necessary delay
lcdSetPosition:
push {r0,r1,lr}
# Sub values to "actual" positions
sub r0, r0, #1
sub r1, r1, #1
# Shift row to actual
lsl r0, r0, #6
orr r0, r0, r1
mov r1, #0x80
orr r1, r1, r0
bl WriteInstruction
pop {r0,r1,pc}
.global lcdPrintString
# prints a null terminated string to the display
# r0 contains the address of the null terminated string (usually located in .data or .rodata), returns the number of characters written to display in r0
# includes necessary delay
lcdPrintString:
push {r0,r1,r2,r3,lr}
mov r2, #0
loop:
ldrb r1, [r0, r2]
cmp r1, #0x00
beq done
bl WriteData
add r2, r2, #1
b loop
done:
mov r0, r1
pop {r0,r1,r2,r3,pc}
.global lcdPrintNum
# prints a (decimal) number to the display
# the number to be printed is in r0, values of 0 to 9999 will print, anything above 9999 should print Err.
# includes necessary delay
lcdPrintNum:
push {r0,r1,r2,r3,r4,lr}
bl num_to_ASCII
# Store num in memory
ldr r2, =numToPrint
str r0, [r2]
# Move cursor to right-most position
mov r1, #16
writeByte:
mov r0, #1
bl lcdSetPosition
mov r4, r0
mov r0, #1
bl msDelay
mov r0, r4
mov r0, r1
ldrb r1, [r2, r3]
bl WriteData
mov r4, r0
mov r0, #1
bl msDelay
mov r0, r4
add r3, r3, #1
cmp r3, #4
sub r1, r0, #1
cmp r3, #4
bne writeByte
pop {r0,r1,r2,r3,r4,pc}
.global lcdCursorLocation
# Returns the location of the cursor on the LCD (1-32)
# Location of cursor is returned in r0
lcdCursorLocation:
push {r1,lr}
pop {r1,pc}
# Takes in a value from 0-9999 and converts it to ASCII
# Input:
# r0: Input binary value
num_to_ASCII:
# If outside of range, return ASCII "Err."
push {r1,r2,r3,lr}
cmp r0,#0
blt out_of_range
# cmp r0,#9999
# bgt out_of_range
# Normal conversion behavior
mov r1, #16
lsl r0, #3
sub r1, #3
shift_cycle:
lsl r0, #1
sub r1, #1
cmp r1, #0
# Branch to encode section if shifted 16 times
beq encode
# Verify Each Nibble is less than or equal to 4
ubfx r2, r0, #16, #4
# If value is less than or equal to 4, then skip to next nibble
cmp r2, #4
ble 2f
add r2, #3
bfi r0, r2, #16, #4
2: ubfx r2, r0, #20, #4
# If value is less than or equal to 4, then skip to next nibble
cmp r2, #4
ble 3f
add r2, #3
bfi r0, r2, #20, #4
3: ubfx r2, r0, #24, #4
# If value is less than or equal to 4, then skip to next nibble
cmp r2, #4
ble 4f
add r2, #3
bfi r0, r2, #24, #4
4: ubfx r2, r0, #28, #4
# If value is less than or equal to 4 skip to end
cmp r2, #4
ble end_verify_nibbles
add r2, #3
bfi r0, r2, #28, #4
end_verify_nibbles:
b shift_cycle
encode:
mov r3, #3
# Encode BCD numbers to ASCII
# Extract ones nibble
ubfx r2, r0, #16, #4
# Insert ones nibble
bfi r1, r2, #0, #4
# Insert 3 in front of nibble for ASCII encoding
bfi r1, r3, #4, #4
# Extract tens nibble
ubfx r2, r0, #20, #4
# Insert tens nibble
bfi r1, r2, #8, #4
# Insert 3 in front of nibble for ASCII encoding
bfi r1, r3, #12, #4
# Extract hundreds nibble
ubfx r2, r0, #24, #4
# Insert hundreds nibble
bfi r1, r2, #16, #4
# Insert 3 in front of nibble for ASCII encoding
bfi r1, r3, #20, #4
# Extract thousands nibble
ubfx r2, r0, #28, #4
# Insert thousands nibble
bfi r1, r2, #24, #4
# Insert 3 in front of nibble for ASCII encoding
bfi r1, r3, #28, #4
b end_ASCII
out_of_range:
# Insert ASCII "Err."
movw r1, #0x722E
movt r1, #0x4572
end_ASCII:
# Return value in r0
mov r0, r1
pop {r1,r2,r3,pc}
.global lcdBusyWait
# Loops until the busy flag is 0
lcdBusyWait:
push {r0,r1,r2,r3,lr}
ldr r1, =GPIOA_BASE
ldr r2, [r1, #GPIO_MODER]
mov r3, #0
orr r2, r2, r3
movw r3, 0xFF00
movt r3, 0x00FF
bic r2, r2, r3
str r2, [r1, #GPIO_MODER]
#Set RS=0, RW=1, E=1
ldr r2, =GPIOC_BASE
mov r3, #RS_CLR
str r3, [r2, #GPIO_BSRR]
mov r3, #RW_SET
str r3, [r2, #GPIO_BSRR]
mov r3, #E_SET
str r3, [r2, #GPIO_BSRR]
busy:
#Set E=
mov r3, #E_SET
str r3, [r2, #GPIO_BSRR]
#Set Databus -> R1
ldr r3, =GPIOA_BASE
ldr r1, [r3, #GPIO_IDR]
#Set E=0
ldr r2, =GPIOC_BASE
mov r3, #E_CLR
str r3, [r2, #GPIO_BSRR]
mov r2, #0x0010
and r1, r2
lsr r1, #4
# Are we still busy?
cmp r1, #1
beq busy
# Return DB port to original mode
ldr r1, =GPIOA_BASE
ldr r2, [r1, #GPIO_MODER]
movw r3, 0x5500
movt r3, 0x0055
orr r2,r2, r3
movw r3, 0xAA00
movt r3, 0x00AA
bic r2, r2, r3
str r2, [r1, #GPIO_MODER]
pop {r0,r1,r2,r3,pc}
.section .data
numToPrint:
.word 0

67
lab7interrupts/Src/main.s Normal file
View File

@@ -0,0 +1,67 @@
# main.s
# Trevor Barnes
# CE2801-031
.syntax unified
.cpu cortex-m4
.thumb
.section .text
.global main
main:
bl lcdInit
bl KeyInit
bl timerInit
# Round count
mov r6, #0
mainLoop:
add r6, #1
beq showFastest
# Start timer
# Prompt user to push button to start (for random seed)
# Store random hex value
# Count down on lcd
# Print random hex value
# Start Timer
# Wait for button push interrupt
# Compare time with previous time, if faster than store it
b mainLoop
showFastest:
# Load fastTime
# Print the fastest time on LCD
# Wait for button push back to go back to reset round counter and branch back to mainLoop
mov r6, #0
.global EXTI_BUTTON_PUSH
.thumb_func
EXTI_BUTTON_PUSH:
# Compare button pushed value and stored random
# If they are equal, stop timer else branch past
bx lr
.section .data
fastTime:
.word 0

View File

@@ -0,0 +1,40 @@
# main.s
# Trevor Barnes
# CE2801-031
.syntax unified
.cpu cortex-m4
.thumb
.section .text
.equ CCMR_OCC1M_PWM, 0x18
.equ CCMR_OC1PE, 1<<4
.equ AFRL_TIM3_CH1_EN, 1<<4
.equ AFRL_OFFSET, 0x20
.equ CCMR_OFFSET, 0x18
.equ TIM3_BASE, 0x24
.global timerInit
timerInit:
push {r0-r4, lr}
#Alt func low reg for TIM3
ldr r1, [r0, #AFRL_OFFSET]
bfc r1, #16, #4
orr r1, r1, #AFRL_TIM3_CH1_EN
str r1, [r0, #AFRL_OFFSET]
#Enable CCMR1 for preload and set pwm
#Allows for the modification of the pulse
ldr r0, =TIM3_BASE
ldr r1, [r0, #CCMR_OFFSET]
bfc r1, #4, #3
mov r2, #CCMR_OCC1M_PWM
orr r2, r2, #CCMR_OC1PE
orr r1, r1, r2
str r1, [r0, #CCMR_OFFSET]
#Enable CCER to for TIM3 (TIC)
#Every 10 seconds, sample
pop {r0, r4}
bx lr

View File

@@ -59,4 +59,5 @@
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
</launchConfiguration>