1. Trang chủ
  2. » Cao đẳng - Đại học

Introduction to uCOS II v2 6 m7

18 277 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 18
Dung lượng 370 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Amr Ali Abdel-Naby@2010 Introduction to uCOS-II V2.6Event Flags • Used for synchronization of tasks with the occurrence of multiples of events • Events are grouped o 8, 16 or 32 bits per

Trang 1

Introduction to uCOS-II V2.6

Trang 2

Amr Ali Abdel-Naby@2010 Introduction to uCOS-II V2.6

About SwiftACT

• A Technology services startup company

o Under establishment

• Areas of specialties:

o Mobile telecommunication services development

o Embedded systems development

• Types of services:

o Consultation

o Managed services

o Sourcing

o Training

Trang 3

Amr Ali Abdel-Naby@2010 Introduction to uCOS-II V2.6

About Me

• Graduated 2004

o ECE, ASU: 5 yrs distinction

• 5+ years in embedded systems development

o SDLC, Apps, MW, DD, Porting,

• 3+ years in SW engineering

o PSP, CMMI, Systematic reuse,

• 3+ years in SW testing

o IBM certified, ISTQB certified,

Trang 4

Amr Ali Abdel-Naby@2010 Introduction to uCOS-II V2.6

Copyright

• Materials in this course is the property of Amr Ali Abdel-Naby

• Reproduction or transmission of the materials in any manner without the copyright owner permission is a law violation

Trang 5

Amr Ali Abdel-Naby@2010 Introduction to uCOS-II V2.6

Course References

• MicroC/OS-II The Real-Time Kernel, 2nd Edition, by Jean J Labrosse

Trang 6

Amr Ali Abdel-Naby@2010 Introduction to uCOS-II V2.6

Outline

• Introduction to µC/OS-II

• Kernel Structure

• Task Management

• Time Management

• Semaphore Management

• Mutual Exclusion Semaphores

• Event Flag Management

• Message Mailbox Management

• Message Queue Management

• Memory Management

Trang 7

Amr Ali Abdel-Naby@2010 Introduction to uCOS-II V2.6

Outline

• Introduction to µC/OS-II

• Kernel Structure

• Task Management

• Time Management

• Semaphore Management

• Mutual Exclusion Semaphores

• Event Flag Management

• Message Mailbox Management

• Message Queue Management

• Memory Management

Trang 8

Amr Ali Abdel-Naby@2010 Introduction to uCOS-II V2.6

Event Flags

• Used for synchronization of tasks with the occurrence of multiples of events

• Events are grouped

o 8, 16 or 32 bits per group

• Types of synchronization

o ORed: Any event occurred

o ANDed: All events occured

Trang 9

Amr Ali Abdel-Naby@2010 Introduction to uCOS-II V2.6

Event Flags cont’d

Trang 10

Amr Ali Abdel-Naby@2010 Introduction to uCOS-II V2.6

Event Flags Management APIs

OSFlagPost()

OSFlagCreate () OSFlagDel() OSFlagPost () OSFlagAccept ()

OSFlagPend () OSQFlagQuery ()

ISR

Task

ISR

Task

OSFlagAccept () OSQFlagQuery ()

Trang 11

Amr Ali Abdel-Naby@2010 Introduction to uCOS-II V2.6

Creating an Event Flag Group, OSFlagCreate

OS_FLAG_GRP *OSFlagCreate (OS_FLAGS flags, INT8U *err)

• flags: A bit pattern that contains the initial values

• err:

• Return value:

Trang 12

Amr Ali Abdel-Naby@2010 Introduction to uCOS-II V2.6

Deleting an Event Flag Group, OSFlagDel

OS_FLAG_GRP *OSFlagDel (OS_FLAG_GRP *pgrp, INT8U opt, INT8U *err)

• pgrp: A pointer to the desired event flag group to be deleted

• opt: Delete options

• err:

Trang 13

Amr Ali Abdel-Naby@2010 Introduction to uCOS-II V2.6

Deleting an Event Flag Group, OSFlagDel cont’d

OS_FLAG_GRP *OSFlagDel (OS_FLAG_GRP *pgrp, INT8U opt, INT8U *err)

• Return value: Null if successful

Trang 14

Amr Ali Abdel-Naby@2010 Introduction to uCOS-II V2.6

Waiting for Events of an Event Flag Group, OSFlagPend

OS_FLAGS OSFlagPend (OS_FLAG_GRP *pgrp, OS_FLAGS flags, INT8U wait_type, INT16U timeout, INT8U *err)

• pgrp: A pointer to the desired event flag group to pend to

• flags: A bit pattern that indicates which flags we will wait for

• wait_type: Specifies whether you want ALL bits to be set/cleared or ANY of the bits to be set/cleared as well as flags consumptions or not

• timeout:

Trang 15

Amr Ali Abdel-Naby@2010 Introduction to uCOS-II V2.6

Waiting for Events of an Event Flag Group, OSFlagPend cont’d

OS_FLAGS OSFlagPend (OS_FLAG_GRP *pgrp, OS_FLAGS flags, INT8U wait_type, INT16U timeout, INT8U *err)

• err:

• Return value: Final flag group state

Trang 16

Amr Ali Abdel-Naby@2010 Introduction to uCOS-II V2.6

Setting or Clearing Events in an Event Flag Group, OSFlagPost

OS_FLAGS OSFlagPost (OS_FLAG_GRP *pgrp, OS_FLAGS flags, INT8U opt, INT8U *err)

• pgrp: A pointer to the desired event flag group to post to

• flags: A bit pattern that indicates which flags will be changed

• opt: Indicates whether flags are set or cleared

• err:

• Return value: Final flag group state

Trang 17

Amr Ali Abdel-Naby@2010 Introduction to uCOS-II V2.6

Looking for Events of an Event Flag Group, OSFlagAccept

OS_FLAGS OSFlagAccept (OS_FLAG_GRP *pgrp, OS_FLAGS flags, INT8U wait_type, INT8U *err)

• pgrp: A pointer to the desired event flag group to pend to

• flags: A bit pattern that indicates which flags we will wait for

• wait_type: Specifies whether you want ALL bits to be set/cleared or ANY of the bits to be set/cleared

• err:

• Return value: Final flag group state

Trang 18

Amr Ali Abdel-Naby@2010 Introduction to uCOS-II V2.6

Querying an Event Flag Group, OSFlagQuery

OS_FLAGS OSFlagQuery (OS_FLAG_GRP *pgrp, INT8U *err)

• pgrp: A pointer to the desired event flag group

• err:

• Return value: current value of the flag group

Ngày đăng: 10/08/2016, 09:56

TÀI LIỆU CÙNG NGƯỜI DÙNG

  • Đang cập nhật ...

TÀI LIỆU LIÊN QUAN