Upload
huy-tran
View
245
Download
0
Embed Size (px)
Citation preview
8/11/2019 Report Lab2
1/20
BO CO LABLP TRNH H THNG
Nhm :Phan Vn ChuL Minh Hong
Trn Quc Huy
8/11/2019 Report Lab2
2/20
Ni dung:Bo co Lab1
Bo co Lab2
8/11/2019 Report Lab2
3/20
8/11/2019 Report Lab2
4/20
Application 1Lab1
S dng cc kin thc hc hin th A BC D nhp nhy trn mn hnh OLED vi tns 1s
8/11/2019 Report Lab2
5/20
Application 2Lab1
Tapp 1, salichngtrnh thchinyu
cusau:- HinthA B C D nhpnhy vitns1s- Xa cc k ttheo lnltA -> B -> C -> D
8/11/2019 Report Lab2
6/20
Application 3Lab1
Tapp 1, salichngtrnh thchinyu
cusau:- HinthA C nhpnhy vitns 1s- HinthB D nhpnhy vitns 2s
8/11/2019 Report Lab2
7/20
Code v Demo app1, app2, app3 trn kit
8/11/2019 Report Lab2
8/20
Lab 2
Learning the Development Environment
8/11/2019 Report Lab2
9/20
Introduction
Bi lab 2 hng dn 5 bc thit k1 hthngnhng
Xc nh yu cu ca hthng
Nhn bit cc nhm lm r yu cu cho hthng
Phn chia cc yu cu thnh cc hm ring thit k
Kt hp cc modun vi nhau thnh hthng hon chnh
Thit kv kim tra
8/11/2019 Report Lab2
10/20
System Requirements Specification
Measurements
Temperature
Flow Rate
Concentration of several different pollutants or other chemical elements
Status
Battery state
Alarms
Temperature, flow rate or pollutant concentration too high
Warning
Temperature, flow rate, or pollutant concentration out of range
8/11/2019 Report Lab2
11/20
System Requirements Specification
Yu cu
user
environmental monitoring and analysis system.
8/11/2019 Report Lab2
12/20
Software Design Specification
Hthng sc phn chia thnh cc khi(hm):
Schedule, Measure, Compute, Display, Annunciate v Status
Schedule
Measure Status DisplayComputeWaring &
Alarm
8/11/2019 Report Lab2
13/20
8/11/2019 Report Lab2
14/20
Software Design Specification
Mi task sc biu din l 1 Task Control Block (TCB).
Cc thnh phn trong Struct c gi l Trng ca Struct
struct MyStruct
{
void (*myTask)(void*);
void* taskDataPtr;};
typedef struct MyStruct TCB;
8/11/2019 Report Lab2
15/20
Software Design Specification
Data Structures:
taskDataPtr tham chiu ti cc dliu ca tt ccc Tasktrong chng trnh
Global
int data; typedef struct DataStruct TaskData;
struct DataStruct TaskData myTaskData;
{ myTaskData.taskDataPtr = &data;
int* taskDataPtr;
};
8/11/2019 Report Lab2
16/20
Software Design Specification// MeasureData structure
typedef struct MeasureData
{
uint* temperatureRawPtr;
uint* flowRateRawPtr;
uint* carbonLevelRawPtr;
uint* salinityLevelRawPtr;
} MD;
MD MeasureDataST;
// ComputeData structure
typedef struct ComputeData
{
uint* temperatureRawPtr;
uint* flowRateRawPtr;
uint* carbonLevelRawPtr;
uint* salinityLevelRawPtr;
uint* tempCorrectedPtr;
uint* flowRateCorrectedPtr;
uint* carbonLevelCorrectedPtr;
uint* salinityLevelCorrectedPtr;
}CD;
CD ComputeDataST;
// DisplayData structuretypedef struct DisplayData
{
uint* tempCorrectedPtr;
uint* flowRateCorrectedPtr;
uint* carbonLevelCorrectedPtr;
uint*
salinityLevelCorrectedPtr;
ushort* batteryStatePtr;
}DD; DD DisplayDataST;// WarningAlarmData structure
typedef struct WarningAlarmData
{
uint* temperatureRawPtr;
uint* flowRateRawPtr;
uint* carbonLevelRawPtr;
uint* salinityLevelRawPtr;
ushort* batteryStatePtr;
} WD; WD WarAlDataST;// Status structure
typedef struct Status
{
ushort* batteryStatePtr;
}ST;
ST StatusST;
8/11/2019 Report Lab2
17/20
Software Design Specification
Squ trnh iu khin ca hthng:
Sche Comp Status Display War&AlarmMeas
Measure()
Start
Status()
Compute()
Display()
WaringAlarm(
)
8/11/2019 Report Lab2
18/20
Software Design Specification
Performance:
Local
Software DelayGlobal Counter
System Time BaseTime Base Reference
System Time
10ms
8/11/2019 Report Lab2
19/20
8/11/2019 Report Lab2
20/20
Copyright @ DAD