国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看

合肥生活安徽新聞合肥交通合肥房產(chǎn)生活服務(wù)合肥教育合肥招聘合肥旅游文化藝術(shù)合肥美食合肥地圖合肥社保合肥醫(yī)院企業(yè)服務(wù)合肥法律

代做CEG3136、代寫C/C++程序語(yǔ)言

時(shí)間:2023-11-13  來(lái)源:合肥網(wǎng)hfw.cc  作者:hfw.cc 我要糾錯(cuò)



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.

請(qǐng)加QQ:99515681 或郵箱:99515681@qq.com   WX:codehelp

掃一掃在手機(jī)打開當(dāng)前頁(yè)
  • 上一篇:代做comp3511、代寫Python/Java編程
  • 下一篇:COMP3230代寫、代做python語(yǔ)言程序
  • 無(wú)相關(guān)信息
    合肥生活資訊

    合肥圖文信息
    流體仿真外包多少錢_專業(yè)CFD分析代做_友商科技CAE仿真
    流體仿真外包多少錢_專業(yè)CFD分析代做_友商科
    CAE仿真分析代做公司 CFD流體仿真服務(wù) 管路流場(chǎng)仿真外包
    CAE仿真分析代做公司 CFD流體仿真服務(wù) 管路
    流體CFD仿真分析_代做咨詢服務(wù)_Fluent 仿真技術(shù)服務(wù)
    流體CFD仿真分析_代做咨詢服務(wù)_Fluent 仿真
    結(jié)構(gòu)仿真分析服務(wù)_CAE代做咨詢外包_剛強(qiáng)度疲勞振動(dòng)
    結(jié)構(gòu)仿真分析服務(wù)_CAE代做咨詢外包_剛強(qiáng)度疲
    流體cfd仿真分析服務(wù) 7類仿真分析代做服務(wù)40個(gè)行業(yè)
    流體cfd仿真分析服務(wù) 7類仿真分析代做服務(wù)4
    超全面的拼多多電商運(yùn)營(yíng)技巧,多多開團(tuán)助手,多多出評(píng)軟件徽y1698861
    超全面的拼多多電商運(yùn)營(yíng)技巧,多多開團(tuán)助手
    CAE有限元仿真分析團(tuán)隊(duì),2026仿真代做咨詢服務(wù)平臺(tái)
    CAE有限元仿真分析團(tuán)隊(duì),2026仿真代做咨詢服
    釘釘簽到打卡位置修改神器,2026怎么修改定位在范圍內(nèi)
    釘釘簽到打卡位置修改神器,2026怎么修改定
  • 短信驗(yàn)證碼 豆包網(wǎng)頁(yè)版入口 破天一劍 目錄網(wǎng) 排行網(wǎng)

    關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責(zé)聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網(wǎng) 版權(quán)所有
    ICP備06013414號(hào)-3 公安備 42010502001045

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    国产精品网站视频| 国产免费亚洲高清| 午夜精品免费视频| 国产熟女高潮视频| 国产精品沙发午睡系列| 国产精品久久久久久久久久久久久| 亚洲天堂电影网| 国产一区二区中文字幕免费看| 国产精品99久久久久久人| 久久电影一区二区| 欧美日韩亚洲一区二区三区四区| 国产精品av在线| 亚洲一区二区三区毛片| 欧美一级爱爱视频| 国产成人97精品免费看片| 一级特黄妇女高潮| 成人久久一区二区| 一区二区三区四区久久| 毛片一区二区三区四区| www.日本久久久久com.| 日本黄网站色大片免费观看| 欧美日韩亚洲免费| 国产精品无码电影在线观看| 日韩尤物视频| 777精品久无码人妻蜜桃| 久久成年人视频| 国产综合免费视频| 国产精品第8页| 狠狠久久综合婷婷不卡| 色噜噜国产精品视频一区二区| 亚洲免费av网| 99精品视频播放| 国产一区视频在线播放| 国产精品精品久久久久久| 欧美在线免费观看| 精品国内产的精品视频在线观看| 日本亚洲导航| 日韩中文字幕视频在线| 日韩欧美一区二区视频在线播放| 久久九九视频| 日韩久久久久久久| 国产精品视频色| 国产一区二区久久久| 国产精品欧美日韩久久| 欧美精品99久久| 久久五月情影视| 官网99热精品| 亚洲国产精品www| 久久99国产精品一区| 热99精品里视频精品| 日韩视频―中文字幕| 欧美日韩亚洲在线 | 91免费国产网站| 日韩成人av电影在线| 久久精品综合一区| 欧美理论一区二区| 欧美激情日韩图片| 久久综合毛片| 欧美黄色直播| 亚洲最大福利视频| 色噜噜亚洲精品中文字幕| 欧美成人综合一区| 在线观看一区欧美| 久久久久久久久久久久久9999| 欧美精品欧美精品系列c| 久久亚洲影音av资源网| 国产精品综合不卡av| 亚洲a∨日韩av高清在线观看| 国产www精品| 精品人伦一区二区三区| 久久资源免费视频| 久久亚洲国产成人精品无码区| 欧美在线亚洲一区| 亚洲专区中文字幕| 国产精品久久久久久久久久99| 成人免费午夜电影| 欧美不卡在线播放| 天天干天天色天天爽| 久久精品免费播放| 欧美一区亚洲一区| 欧美激情乱人伦| 欧美日韩成人在线播放| 黄色一级片国产| 欧美精品国产精品久久久| 亚洲尤物视频网| 91精品国产91久久久久| 亚洲v日韩v综合v精品v| 激情六月丁香婷婷| 亚洲综合视频1区| 国产精品乱码久久久久| 国产亚洲欧美一区二区| 午夜精品一区二区三区四区| 日韩在线观看a| 久久免费精品视频| www亚洲国产| 久久躁狠狠躁夜夜爽| 高清av免费一区中文字幕| 日韩av免费在线播放| 国产欧美中文字幕| 日日摸天天爽天天爽视频| 久久香蕉国产线看观看网| 国产成人永久免费视频| 国产欧美在线播放| 欧美一区二三区| 国产精品免费视频xxxx| 69av视频在线播放| 国产午夜精品一区| 免费一级特黄毛片| 欧美日韩国产精品激情在线播放| 亚洲精品视频一区二区三区| 日韩中文字幕免费| 国产伦精品一区二区三区四区视频| 热门国产精品亚洲第一区在线 | 国产va免费精品高清在线观看| 国产日产亚洲精品| 国产在线一区二区三区四区| 欧美一区二区色| 亚洲国产精品久久久久爰色欲| 国产精品久久久久久久久| 久久国产精品一区二区三区四区| 成人国产一区二区| 国产精品影院在线观看| 蜜桃成人在线| 免费观看亚洲视频| 欧美 日韩 国产在线观看| 人人妻人人添人人爽欧美一区 | 国产精品一区二区av| 精品欧美一区二区久久久伦| 无码人妻精品一区二区三区66| 久久久久久国产精品久久| 国产精品久久久久久久久久新婚| 俺去亚洲欧洲欧美日韩| 日韩中文在线中文网三级| 久久精品丝袜高跟鞋| 久久免费成人精品视频| 国产精品91久久久久久| 97久久伊人激情网| 成人国产精品色哟哟| 国产玖玖精品视频| www.com毛片| 国产精品18久久久久久麻辣 | 亚洲精品免费av| 午夜欧美不卡精品aaaaa| 亚洲福利av| 日韩av不卡在线| 欧美日本韩国在线| 国产在线精品日韩| 成人福利网站在线观看11| 国产美女作爱全过程免费视频| 国产三级精品在线不卡| 国产亚洲福利社区| 91蜜桃网站免费观看| 久久男人av资源网站| 久久精品xxx| 久久视频中文字幕| 欧美区在线播放| 无码人妻aⅴ一区二区三区日本| 欧美一级黄色网| 黄色三级中文字幕| 国产欧美精品va在线观看| www.欧美日本| 久久久久亚洲精品| 欧美成年人视频网站| 欧美成人精品一区| 亚洲一区二区免费| 青青青青在线视频| 国产日韩亚洲精品| 国产成人一区二区三区别| 日日骚久久av| 欧美精品在线观看| 色播亚洲婷婷| 精品少妇人妻av免费久久洗澡| 国产精品一区二区三区精品 | 久久精品视频在线播放| 操91在线视频| 日韩一级在线免费观看| 欧美性一区二区三区| 欧美凹凸一区二区三区视频| 国产自产在线视频一区| www国产无套内射com| 久久精品久久精品国产大片| 爽爽爽爽爽爽爽成人免费观看| 欧美xxxx做受欧美.88| 欧美一区二区三区综合 | 午夜精品一区二区三区av| 欧美在线亚洲一区| 超碰97人人人人人蜜桃| 国产成+人+综合+亚洲欧洲 | 欧美日韩国产综合在线| 国产日韩欧美综合精品| 久久精品女人的天堂av| 久久777国产线看观看精品| 亚洲免费av网| 麻豆精品视频| 久久福利电影| 亚洲一区二区三区四区视频| 日韩免费观看网站| 91久久精品日日躁夜夜躁国产| 国产精品日韩在线一区| 动漫一区二区在线|