日韩精品一区二区三区高清_久久国产热这里只有精品8_天天做爽夜夜做爽_一本岛在免费一二三区

合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫院企業服務合肥法律

代做CEG3136、代寫C/C++程序語言

時間:2023-11-13  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯



CEG3136 – Lab3
Complex State    machine (C)
Objectives
To implement a state machine for an alarm system monitoring. The system consists of the following
components: - Keypad UI - Alarm sensors
- Alarm Bells (Alarms) - Central control
Introduction
In this lab we’re going to use the architecture flow shown next. The flow start by the system and
peripheral initialization. Then it goes into a continuous loop with a background task handling mainly
the user interface (UI). At the forefront there are 3 interrupt service routines responsible for
monitoring the sensors and firing the alarms when necessary.
Hereafter is the description of the system software components – note that software components
represent low level hardware components at the low (physical) level, then more complex virtual
(software) components handle the control/processing of the system data. - Console Application: this is the main function of the c-program. It initialize the Alarm System, followed by a background task of handling user input. User input is operator login to
Arm/Disarm the system and to quit the application at the end of simulation. - Alarm System Central Control: this is a data structure (class) that include the low level systemcomponents and manages the system state machine
- Sensor: is a structure holding the state of a physical sensor component. The system supports
up to 64 sensors. Sensors can be in one of the following states: {INACTIVE, IDLE, TRIGGERED,
MALFUNCTION}
- Alarm: is a data structure holding the state of a physical alarm bell component. The system
supports up to 64 alarms. Alarms can be in one of the following states: { ALARM_OFF,
ALARM_ON} - User: represent the database record of a system user, including the name, passcode of the
user, and weather it has the privilege of a super user
- Super User: is a class extension of the user class, it contain an instance of the user class that
has the super flag set.
The high level class diagram is shown below:
The User Interface
The user interface has two components: input and output
- UI Output: provide the system logging of all interesting events taking place at all times
- UI Input: is always ready for user login, if a valid passcode is entered the login event triggers an
interrupt (EXTI1). EXTI1 interrupt handler notifies the central control of the login even to take
proper actions
During initialization 8 users are initialized and 8 super-users are initialized. The passcodes are
hardwired for simplicity as follows: - User1: passcode user123
- User2: passcode user234
- etc. - User7: passcode user789
- Super1: passcode super12
- Super2: passcode super23
- etc. - Super 7: passcode super78
State Machine
As explained earlier, the system’s behavior is described/developed using a state machine. The
behavior of the system changes based on the current system state as well as the external events that
takes place and are monitored by the system. The state diagram of the central control is shown
below.
TickCount<50
The external events are listed below: - Sensor triggering an interrupt (EXTI0), it represent an alarm sensor detecting a risk event, e.g.
window or door open, motion detected, etc. - User login: triggers user input like arming and disarming the system
- Time delay: used to adjust the system timing, e.g. in transition from Arming to Armed states
The actions performed by the system (see state diagram) are: - Set the alarm ON when switching from ARMED state to TRIGGERED state
- Set the alarm OFF when moving from TRIGGERED state to IDLE state
- Reset TickCount on exit from Idle state
The SysTick timer
Refer to “The Definitive Guide to ARM Cortex-M3 and Cortex-M4 Processors”, chapter 9.5: The
SysTick timer.
The Cortex-M processors have a small integrated timer called the SysTick (System Tick) timer. It is
integrated as part of the nested vector interrupt controller (NVIC). It can generate the SysTick
exception (#15). The SysTick timer is a simple decrement 24-bit counter and can run on either
processor clock or a reference clock. The reason for having the timer inside the processor is to help
software portability between Cortex-M processor systems. The SysTick timer can be used as a simple
timer peripheral for periodic interrupt generation, delay generation, or timing measurement.
Using the SysTick timer
If you only want to generate s periodic SysTick interrupt, the easiest way is to use a CMSIS-Core
function: uint**_t SysTick_Config (uint**_t ticks). For example for a 1 millisecond interval, you can use: SysTick_Config ( systemCoreClock / 1000 ). That
means when we divide the core clock frequency in Hz by 1000, we get the number of clocks per
millisecond. The timer interrupt handler: void SysTick_Handler(void), will be invoked every 1
millisecod.
In this lab the SysTick_Handler is used for: - Monitor the signaled sensor triggers and induce EXTI0_IRQn interrupt
- Call system_update_state function
- Induce EXTI2_IRQn periodically to print the ^beep^ message to indicate alarms when the
system is in Alarmed state
Interrupt Vector
Reference startup_stm**f417xx.s the vendor specified interrupt table is as follows. We’ll be using
external interrupt ports 0 & 1 in our development. EXTI0 is connected to the sensors and is ORed,
which means any sensor (or group of sensors) will trigger the interrupt if they are tripped. EXTI1 is
connected to the keypad, which detects a legitimate user login. EXTI2 is used to display “^beep^”
message when the system is in ALARMED state.
; Vector Table Mapped to Address 0 at Reset
AREA RESET, DATA, READONLY
EXPORT __Vectors
EXPORT __Vectors_End
EXPORT __Vectors_Size
__Vectors DCD __initial_sp ; Top of Stack
DCD Reset_Handler ; Reset Handler
DCD NMI_Handler ; NMI Handler
DCD HardFault_Handler ; Hard Fault Handler
DCD MemManage_Handler ; MPU Fault Handler
DCD BusFault_Handler ; Bus Fault Handler
DCD UsageFault_Handler ; Usage Fault Handler
DCD 0 ; Reserved
DCD 0 ; Reserved
DCD 0 ; Reserved
DCD 0 ; Reserved
DCD SVC_Handler ; SVCall Handler
DCD DebugMon_Handler ; Debug Monitor Handler
DCD 0 ; Reserved
DCD PendSV_Handler ; PendSV Handler
DCD SysTick_Handler ; SysTick Handler
; External Interrupts
DCD WWDG_IRQHandler ; Window WatchDog
DCD PVD_IRQHandler ; PVD through EXTI Line detection
DCD TAMP_STAMP_IRQHandler ; Tamper and TimeStamps through the EXTI line
DCD RTC_WKUP_IRQHandler ; RTC Wakeup through the EXTI line
DCD FLASH_IRQHandler ; FLASH
DCD RCC_IRQHandler ; RCC
DCD EXTI0_IRQHandler ; EXTI Line0
DCD EXTI1_IRQHandler ; EXTI Line1
DCD EXTI2_IRQHandler ; EXTI Line2
DCD EXTI3_IRQHandler ; EXTI Line3
DCD EXTI4_IRQHandler ; EXTI Line4
DCD DMA1_Stream0_IRQHandler ; DMA1 Stream 0
DCD DMA1_Stream1_IRQHandler ; DMA1 Stream 1
DCD DMA1_Stream2_IRQHandler ; DMA1 Stream 2
DCD DMA1_Stream3_IRQHandler ; DMA1 Stream 3
DCD DMA1_Stream4_IRQHandler ; DMA1 Stream 4
DCD DMA1_Stream5_IRQHandler ; DMA1 Stream 5
DCD DMA1_Stream6_IRQHandler ; DMA1 Stream 6
DCD ADC_IRQHandler ; ADC1, ADC2 and ADC3s
DCD CAN1_TX_IRQHandler ; CAN1 TX
DCD CAN1_RX0_IRQHandler ; CAN1 RX0
DCD CAN1_RX1_IRQHandler ; CAN1 RX1
DCD CAN1_SCE_IRQHandler ; CAN1 SCE
DCD EXTI9_5_IRQHandler ; External Line[9:5]s
DCD TIM1_BRK_TIM9_IRQHandler ; TIM1 Break and TIM9
DCD TIM1_UP_TIM10_IRQHandler ; TIM1 Update and TIM10
DCD TIM1_TRG_COM_TIM11_IRQHandler ; TIM1 Trigger and Commutation and
TIM11
DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare
DCD TIM2_IRQHandler ; TIM2
DCD TIM3_IRQHandler ; TIM3
DCD TIM4_IRQHandler ; TIM4
DCD I2C1_EV_IRQHandler ; I2C1 Event
DCD I2C1_ER_IRQHandler ; I2C1 Error
DCD I2C2_EV_IRQHandler ; I2C2 Event
DCD I2C2_ER_IRQHandler ; I2C2 Error
DCD SPI1_IRQHandler ; SPI1
DCD SPI2_IRQHandler ; SPI2
DCD USART1_IRQHandler ; USART1
DCD USART2_IRQHandler ; USART2
DCD USART3_IRQHandler ; USART3
DCD EXTI15_10_IRQHandler ; External Line[15:10]s
DCD RTC_Alarm_IRQHandler ; RTC Alarm (A and B) through EXTI Line
DCD OTG_FS_WKUP_IRQHandler ; USB OTG FS Wakeup through EXTI line
DCD TIM8_BRK_TIM12_IRQHandler ; TIM8 Break and TIM12
DCD TIM8_UP_TIM13_IRQHandler ; TIM8 Update and TIM13
DCD TIM8_TRG_COM_TIM14_IRQHandler ; TIM8 Trigger and Commutation and
TIM14
DCD TIM8_CC_IRQHandler ; TIM8 Capture Compare
DCD DMA1_Stream7_IRQHandler ; DMA1 Stream7
DCD FMC_IRQHandler ; FMC
DCD SDIO_IRQHandler ; SDIO
DCD TIM5_IRQHandler ; TIM5
DCD SPI3_IRQHandler ; SPI3
DCD UART4_IRQHandler ; UART4
DCD UART5_IRQHandler ; UART5
DCD TIM6_DAC_IRQHandler ; TIM6 and DAC1&2 underrun errors
DCD TIM7_IRQHandler ; TIM7
DCD DMA2_Stream0_IRQHandler ; DMA2 Stream 0
DCD DMA2_Stream1_IRQHandler ; DMA2 Stream 1
DCD DMA2_Stream2_IRQHandler ; DMA2 Stream 2
DCD DMA2_Stream3_IRQHandler ; DMA2 Stream 3
DCD DMA2_Stream4_IRQHandler ; DMA2 Stream 4
DCD ETH_IRQHandler ; Ethernet
DCD ETH_WKUP_IRQHandler ; Ethernet Wakeup through EXTI line
DCD CAN2_TX_IRQHandler ; CAN2 TX
DCD CAN2_RX0_IRQHandler ; CAN2 RX0
DCD CAN2_RX1_IRQHandler ; CAN2 RX1
DCD CAN2_SCE_IRQHandler ; CAN2 SCE
DCD OTG_FS_IRQHandler ; USB OTG FS
DCD DMA2_Stream5_IRQHandler ; DMA2 Stream 5
DCD DMA2_Stream6_IRQHandler ; DMA2 Stream 6
DCD DMA2_Stream7_IRQHandler ; DMA2 Stream 7
DCD USART6_IRQHandler ; USART6
DCD I2C3_EV_IRQHandler ; I2C3 event
DCD I2C3_ER_IRQHandler ; I2C3 error
DCD OTG_HS_EP1_OUT_IRQHandler ; USB OTG HS End Point 1 Out
DCD OTG_HS_EP1_IN_IRQHandler ; USB OTG HS End Point 1 In
DCD OTG_HS_WKUP_IRQHandler ; USB OTG HS Wakeup through EXTI
DCD OTG_HS_IRQHandler ; USB OTG HS
DCD DCMI_IRQHandler ; DCMI
DCD CRYP_IRQHandler ; CRYPTO
DCD HASH_RNG_IRQHandler ; Hash and Rng
DCD FPU_IRQHandler ; FPU
__Vectors_End
Class Diagram
The detailed class diagram of the alarm system is shown below:
The following global (shared) variables are used to pass data from UI and Signal function (to be
discussed next) to the alarm system: - uint64_t sensor_states: represet updated sensor state, to be set from a signal function
- user_t *logged_in_user: the user object that was last sussesfuly loged in the system, used to
check if it is a super user
Signal File
ARM-Keil allows the simulation of external events using what is known as signal function. This is a clike function that is able to read/write to memory and wait on CPU clock among other things. We use
it to simulate sensor triggering during testing of the system state machine.
The source cod of the signal function is shown below:
signal void set_sensors (unsigned long status1, unsigned long
status2) {
{
printf("wait started \n");
_WDWORD(&sensor_states, status1);
_WDWORD(&sensor_states+4, status2);
twatch (0xFFFFF);
printf("wait is done \n");
_WDWORD(&sensor_states, 0);
_WDWORD(&sensor_states+4, 0);
}
}
The signal function set_sensors takes 2 arguments of unsigned long (**b) that represent the 64
sensors of the system. It writes the status arguments directly into the global uint64_t sensor_states
variable (address 0x20000000, 0x20000004). Then it waits for some time using twatch function and
then reset the sensor states back to 0 (IDLE). This way we can emulate sensor tripping during our
simulation – more details later.
Running Simulation
To run the simulation, first compile the code and then press on the debugger button (magnifier on a
d). Before you start the simulation, click on the debug menu and select “Function Editor”
Open the signal.ini file (include in zip file) and then press compile button – it should compile with no
errors. You can then close the function editor window. Later you can call the signal function during
simulation from the command line argument (at the bottom left) to induce sensor events – see
below:
Your Tasks
The provided code include the console application and all the above mentioned classes: - sensor: sensor.h, sensor.c
- alarm: alarm.h, alarm.c
- user: user.h, user.c
- super user: super_user.h, super_user.c
- alarm system: alarm_system.h, alarm_system.c
The state machine implemented in the system_update_state() function is left as skeleton, your task is
to implement the system state machine according to the state diagram provided. You should test the system behavior and make sure all states are visited and all transitions are tested.
At the end of the test if enter ‘q’ the UI loop is broken and the coverage for the FSM is displayedas
shown below.
FSM State Coverage:
UNARMED ARMING ARMED ALARMED
UNARMED 1 0 0 0
ARMING 0 0 0 0
ARMED 0 0 0 0
ALARMED 0 0 0 0
Make sure that all the above highlighted States & Transitions have non-zero coverage.
Report
The Lab report should include the following:
1) Code snip-it of the system_update_state() function. 2) You simulation log, showing all FSM cover points highlighted above covered with non-zero
coverage value.
3) The source code of the whole project (after cleaning all targets)
Zip all of the above in one zip file and submit t Bright Space.

請加QQ:99515681 或郵箱:99515681@qq.com   WX:codehelp

掃一掃在手機打開當前頁
  • 上一篇:代做comp3511、代寫Python/Java編程
  • 下一篇:COMP3230代寫、代做python語言程序
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發動機性能
    挖掘機濾芯提升發動機性能
    海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
    海信羅馬假日洗衣機亮相AWE 復古美學與現代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
    合肥機場巴士2號線
    合肥機場巴士2號線
    合肥機場巴士1號線
    合肥機場巴士1號線
  • 短信驗證碼 酒店vi設計 deepseek 幣安下載 AI生圖 AI寫作 aippt AI生成PPT 阿里商辦

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    日韩精品一区二区三区高清_久久国产热这里只有精品8_天天做爽夜夜做爽_一本岛在免费一二三区

      <em id="rw4ev"></em>

        <tr id="rw4ev"></tr>

        <nav id="rw4ev"></nav>
        <strike id="rw4ev"><pre id="rw4ev"></pre></strike>
        麻豆91精品91久久久的内涵| 亚洲在线视频网站| 亚洲日本欧美| 国产精品自在在线| 国产精品网站在线观看| 久久手机精品视频| 亚洲日本成人女熟在线观看| 最新亚洲视频| 精品9999| 欧美影院午夜播放| 亚洲国产精品久久久久婷婷884| 99这里只有精品| 亚洲激精日韩激精欧美精品| 国产精品乱人伦一区二区| 国产亚洲视频在线观看| 亚洲五月六月| 韩国久久久久| 亚洲第一精品夜夜躁人人躁| 亚洲精品资源| 亚洲图中文字幕| 亚洲国产天堂久久国产91| 亚洲欧美日韩天堂一区二区| 亚洲欧美精品一区| 国产精品区免费视频| 美日韩精品免费| 亚洲欧美精品伊人久久| 亚洲性线免费观看视频成熟| 99亚洲一区二区| 久久精品亚洲热| 国产精品狠色婷| 亚洲一卡二卡三卡四卡五卡| 亚洲国产日韩美| 亚洲蜜桃精久久久久久久| 伊人精品在线| 久久天堂精品| 国产精品都在这里| 亚洲性图久久| 一区二区三区不卡视频在线观看| 欧美国产在线视频| 国产在线观看91精品一区| 久久久久久夜精品精品免费| 一区二区在线视频| 在线成人黄色| 亚洲国产天堂久久综合网| 一个色综合导航| 久久久久九九视频| 国产精品久久一区二区三区| 国产人成精品一区二区三| 欧美日韩中文字幕精品| 欧美资源在线观看| 国产精品日韩久久久| 美女主播精品视频一二三四| 免费视频亚洲| 日韩视频免费观看高清完整版| 国产精品视频久久一区| 国产精品自拍视频| 在线激情影院一区| 免费在线成人av| 亚洲一区二区三区免费观看| 欧美一级日韩一级| 亚洲欧美另类在线观看| 欧美人与禽猛交乱配视频| 欧美国产日韩在线观看| 久久精品一区二区三区中文字幕| 久久久久综合网| 亚洲欧美中文在线视频| 欧美大片一区| 亚洲在线一区二区| 欧美a级片网站| 国产一区二区三区四区hd| 亚洲图片欧洲图片日韩av| 欧美一级黄色录像| 欧美成人精品在线视频| 亚洲永久免费av| 亚洲午夜精品一区二区三区他趣| 亚洲欧洲一区二区三区| 在线播放中文字幕一区| 久久久久久亚洲精品中文字幕| 黄色成人片子| 欧美体内she精视频在线观看| 亚洲无玛一区| 久久青草久久| 国产一区二区三区精品欧美日韩一区二区三区| 久久精品日韩一区二区三区| 久久久国产成人精品| 欧美一区二区三区成人| 亚洲人成毛片在线播放| 国产精品国产一区二区| 一区福利视频| 久久深夜福利免费观看| 狠狠色丁香婷综合久久| 欧美日韩一区二区三| 韩日精品中文字幕| 久久午夜电影| 1024国产精品| 欧美国产日韩二区| 欧美成人综合在线| 国产欧美日本在线| 美日韩精品视频免费看| 久久久久一本一区二区青青蜜月| 亚洲福利视频在线| 国产精品久久久久久久一区探花| 亚洲一区视频在线| 欧美日韩国产123| 亚洲欧美日韩在线播放| 欧美黑人多人双交| 久久久久久亚洲精品杨幂换脸| 免费看黄裸体一级大秀欧美| 欧美区高清在线| 一区二区三区成人精品| 伊人久久大香线| 久久一区二区三区超碰国产精品| 久久久国产一区二区| 亚洲精品色图| 久久久午夜精品| 久久国产福利| 精品动漫一区| 老司机一区二区| 免费在线亚洲| 亚洲欧美日韩直播| 久久er精品视频| 欧美日韩免费观看中文| 亚洲精品欧美极品| 一区免费观看| 一本久久a久久免费精品不卡| 欧美精品三级日韩久久| 欧美三级视频在线播放| 在线亚洲+欧美+日本专区| 国产精品久久久久影院亚瑟| 亚洲精品极品| 免费黄网站欧美| 国产免费观看久久黄| 亚洲国产欧美不卡在线观看| 国产精品美女久久| 国产精品国产三级国产aⅴ9色| 性做久久久久久久久| 久久久久久欧美| 国产一区在线免费观看| 欧美日韩国产综合久久| 欧美日韩视频第一区| 欧美主播一区二区三区| 国产伦精品一区二区三区免费| 欧美高清视频在线播放| 老色鬼久久亚洲一区二区| 欧美视频专区一二在线观看| 精品动漫3d一区二区三区免费版| 欧美偷拍一区二区| 欧美亚州一区二区三区| 国产精品激情偷乱一区二区∴| 亚洲日本成人女熟在线观看| 亚洲素人一区二区| 亚洲第一精品福利| 国内精品**久久毛片app| 欧美系列精品| 欧美丰满高潮xxxx喷水动漫| 久久久水蜜桃av免费网站| 亚洲第一中文字幕在线观看| 麻豆精品一区二区综合av| 亚洲一区二区三区精品视频| 免费看的黄色欧美网站| 欧美成人中文字幕| 欧美系列电影免费观看| 欧美在线观看www| 99精品欧美一区二区三区|