The Datasheet Archive - 100 Million Datasheets from 7500 Manufacturers.    


Datasheet Search Engine   
 
Part # or Description: • 5V RS232 Driver • 2SC5066* • "Real Time Clock" • "USB connector" • "blue led" 5mm • 10 watt zener diode • 2N3055* motorola
 
Search Tip: Try entering the part number only. Include a wildcard (eg. lm317* or 1n4148*)

 

 

Cautions Keep safety first your circuit designs! Renesas Technolo


Datasheet Thumbnail

  

Download PDF



Top Searches for this datasheet




Cautions
Keep safety first your circuit designs! Renesas Technology Corporation puts maximum effort into making semiconductor products better more reliable, there always possibility that trouble occur with them. Trouble with semiconductors lead personal injury, fire property damage. Remember give consideration safety when making your circuit designs, with appropriate measures such placement substitutive, auxiliary circuits, (ii) nonflammable material (iii) prevention against malfunction mishap. Notes regarding these materials These materials intended reference assist customers selection Renesas Technology Corporation product best suited customer's application; they convey license under intellectual property rights, other rights, belonging Renesas Technology Corporation third party. Renesas Technology Corporation assumes responsibility damage, infringement third-party's rights, originating product data, diagrams, charts, programs, algorithms, circuit application examples contained these materials. information contained these materials, including product data, diagrams, charts, programs algorithms represents information products time publication these materials, subject change Renesas Technology Corporation without notice product improvements other reasons. therefore recommended that customers contact Renesas Technology Corporation authorized Renesas Technology Corporation product distributor latest product information before purchasing product listed herein. information described here contain technical inaccuracies typographical errors. Renesas Technology Corporation assumes responsibility damage, liability, other loss rising from these inaccuracies errors. Please also attention information published Renesas Technology Corporation various means, including Renesas Technology Corporation Semiconductor home page (http://www.renesas.com). When using information contained these materials, including product data, diagrams, charts, programs, algorithms, please sure evaluate information total system before making final decision applicability information products. Renesas Technology Corporation assumes responsibility damage, liability other loss resulting from information contained herein. Renesas Technology Corporation semiconductors designed manufactured device system that used under circumstances which human life potentially stake. Please contact Renesas Technology Corporation authorized Renesas Technology Corporation product distributor when considering product contained herein specific purposes, such apparatus systems transportation, vehicular, medical, aerospace, nuclear, undersea repeater use. prior written approval Renesas Technology Corporation necessary reprint reproduce whole part these materials. these products technologies subject Japanese export control restrictions, they must exported under license from Japanese government cannot imported into country other than approved destination. diversion reexport contrary export control laws regulations Japan and/or country destination prohibited. Please contact Renesas Technology Corporation further details these materials products contained therein.
Ho7055 Operating System Manual
ADE-702-256
Cautions
PLEASE READ FOLLOWING CAREFULLY BEFORE THIS PRODUCT. enclosed software product related software products (hereafter referred "PRODUCT"), before exporting taking such PRODUCT other countries states, must comply with applicable export control laws regulations Japan other countries with jurisdiction applicable states provinces within Japan such other countries. Please advised that Hitachi neither warrants grants licenses rights patents, copyrights, trademarks, other intellectual property rights owned Hitachi third party PRODUCT, unless otherwise expressly granted Hitachi contract other document including without limitation warranty license included user's manual PRODUCT (hereinafter referred "CONTRACTS"). Please further advised that Hitachi bears responsibility problems that arise with third party's rights, including intellectual property rights, connection with PRODUCT. PRODUCT, specifications and/or description user's manual subject change future without prior notice. Confirm that have received latest standards and/or specification PRODUCT (including user's manual) before make your final design, purchase use. Please advised that Hitachi will have liability whatsoever damages, including indirect consequential damages, arising your PRODUCT (including based descriptions user's manual). Hitachi shall liable damages caused equipment media used delivery PRODUCT. PRODUCT designed for, PRODUCT for, applications that demand especially high quality reliability, where failure malfunction directly threaten human life cause risk bodily injury, such equipment used aerospace, aeronautics, nuclear power, combustion control, transportation, traffic, safety equipment medical equipment life support. have questions regarding whether your intended PRODUCT permitted Hitachi,, please contact your local Hitachi's sales office. time designing planning your system using PRODUCT, please consider normally foreseeable failure rates failure modes employ sufficient systematic measures such failsafe systems that equipment incorporating PRODUCT does cause accident other consequential damage operation PRODUCT. This manual PRODUCT copyrighted Hitachi. Under circumstances, copy, analyze, reverse engineer, and/or modify, whole part, PRODUCT, except extent expressly provided CONTRACTS. copy, whole part, user's manual PRODUCT without prior written consent Hitachi, except extent expressly provided CONTRACTS. PRODUCT just computer. transfer, lease otherwise assign PRODUCT third party parties, except extent expressly provided CONTRACTS.
Please contact your local Hitachi's sales office questions regarding PRODUCT, Hitachi semiconductor products related products.
Table Contents
OVERVIEW INTRODUCTION FEATURES
APPLICATION BUILDING. OPERATING SYSTEM FUNCTION PROCESSING LEVELS FEATURES APPLICATION MODES. CONFORMANCE CLASSES MAXIMUM PARAMETERS
TASK MANAGEMENT TASK CONCEPT TASK STATE 4.2.1 Introduction. 4.2.2 Basic Tasks. 4.2.3 Extended Tasks. COMPARISON TASK TYPES TASK ACTIVATION TERMINATION TASK PRIORITY TASK PREEMPTABILITY. TASK STACKS TASK SYSTEM SERVICES
SCHEDULER INTRODUCTION NON-PREEMPTIVE SCHEDULING FULL PREEMPTIVE SCHEDULING MIXED PREEMPTIVE SCHEDULING INTERRUPT MASK LEVEL TASK PREEMPTION
INTERRUPT MANAGEMENT INTERRUPT CATEGORIES INTERRUPT CONTROL. 6.2.1 Interrupt Mask Level Method. 6.2.2 Interrupt Source Method INTERRUPT SOURCE CLASSIFICATION 6.3.1 Non-Maskable Interrupt. 6.3.2 Other Interrupts. INTERRUPT STACKS 6.4.1 Interrupts Category 6.4.2 Interrupts Category 6.4.3 Interrupts. EXCEPTIONS INTERRUPT SYSTEM SERVICES
RESOURCE MANAGEMENT.
INTRODUCTION PRIORITY RESOURCE MANAGEMENT NESTED RESOURCE OCCUPATION RESOURCE OCCUPATION TASK TERMINATION SCHEDULER RESOURCE. RESOURCE PRIORITY CEILING ECC1 CONFORMANCE RESTRICTIONS WHEN USING RESOURCES. RESOURCE SYSTEM SERVICES. INTRODUCTION EVENT OPERATION EVENT EVENT SYSTEM SERVICES
EVENT MANAGEMENT
ALARM COUNTER MANAGEMENT INTRODUCTION COUNTERS 9.2.1 Counter Handler 9.2.2 System Timer 9.2.3 Non-Variant Alarm Timer 9.2.4 Counter Properties. ALARMS 9.3.1 Introduction. 9.3.2 Alarm Parameters EXAMPLE USING COUNTER ALARM COUNTER ALARM SYSTEM SERVICES.
SYSTEM CONTROL
10.1 SYSTEM START-UP. 10.2 SYSTEM SHUTDOWN 10.3 HOOK ROUTINES 10.4 ERROR HANDLING 10.4.1 Error Status. 10.4.2 Shutdown Errors 10.5 ERRORHOOK RE-ENTRY. PROGRAMMING 11.1 REGISTERS 11.2 DECLARATION OSEK PROCESSES 11.2.1 Initiation. 11.2.2 Tasks 11.2.3 ISR. 11.3 SYSTEM CONFIGURATION FILES 11.3.1 Header Files. 11.4 DECLARING SYSTEM OBJECTS THROUGH SYSTEM SERVICES 11.5 REFERRING SYSTEM OBJECTS. 11.6 CALLING SYSTEM SERVICE FROM ASSEMBLER ROUTINE. 11.7 ASSEMBLER 11.7.1 Interrupt Category 11.7.2 Interrupt Category
11.8 11.9
REGISTERING ISRS INTERRUPTS
SYSTEM SERVICES
12.1 INTRODUCTION 12.2 TASK MANAGEMENT SERVICES 12.2.1 Data Types 12.2.2 System Services 12.2.3 Constants data type TaskStateType 12.3 INTERRUPT MANAGEMENT SERVICES 12.3.1 DataTypes 12.3.2 System Services 12.3.3 Constants IntDescriptorType Data Type 12.3.4 Interrupt Sources Settings 12.3.5 Functions Used Control Interrupts from User-Defined Sources. 12.4 RESOURCE MANAGEMENT SERVICES 12.4.1 Data Types 12.4.2 System Services 12.5 EVENT MANAGEMENT SERVICES 12.5.1 Data Types 12.5.2 System Services 12.6 COUNTER ALARM MANAGEMENT SERVICES. 12.6.1 Data Types 12.6.2 System Services 12.7 OPERATING SYSTEM EXECUTION CONTROL 12.7.1 Data Types 12.7.2 System Services 12.8 HOOK ROUTINES 12.8.1 System Services APPENDIX SYSTEM SERVICE RETURN CODES. A.2.1 Return Code IDs. A.2.2 System Service A.2.3 Context IDs. SYSTEM SERVICE CALLS DATA TYPES
Overview Introduction
This document defines operation Operating System V2.1 (hereafter referred which conforms OSEK/VDX (hereafter referred OSEK) open standard operating systems, Specification Version revision This document described assumption that OSEK specification understood. Read this document carefully understand contents following documents before using "OSEK/VDX Operating System", Version revision (OSEK/VDX steering committee) Release Notes this product SuperH RISC engine C/C++ Compiler Package Manual Programming Manual Hardware Manual target microprocessor
Features
configured scaled statically. number system objects (see
Section 3.3), such tasks resources required statically specified user.
supports portability application providing standardised application
program interface that defined according ANSI standard.
provides following features real-time, multi-tasking operation
applications.
Task Management Scheduling Policies Interrupt Management Resource Management Event Management Counter Alarm Management Error Handling
Application Building
following files required building application. Kernel library. kernel library object files implementing functionality core functionality (task management, scheduler, etc.) always included, non-essential features (resource management, event management, etc.) automatically combined linkage editor. configuration files. These files register information about system objects such tasks resources. files automatically generated Configurator. Application program files. user application code written language assembly language. Figure shows procedure building application.
USER INPUT CONFIGURATOR
CONFIG. DEFINITION FILE
File Tool
CONFIG.FILE
KERNEL LIBRARY
APPLICATION PROGRAM FILES
LINKAGE EDITOR
COMPILER ASSEMBLER
LOAD MODULE Figure Application Building Flow
configurator generates configuration files kernel library files determined user input configuration definition file. Along with application program files, these files compiled, assembled linked generate load module. There formats configuration definition file: format which describes application using OSEK format, format which describes application using internal format.
user referred help file Configurator information generate configuration files.
Operating System Function Processing Levels
There three types processes:
Interrupt service routines (hereafter referred ISRs) Tasks
highest processing priority assigned interrupt level, where ISRs executed. This interrupt level also includes cases where interrupt-mask level within task non-zero. This method specification original feature this system. processing level operating system priority immediately below interrupt level. lowest task level which application executed. This illustrated Figure
rity
Figure OSEK Processing Levels
Features
provides following features application.
Scheduling Kernel. Provides mechanism whereby tasks allocated under
control CPU.
Task Management. Provides system services controlling tasks. Interrupt Management. Provides system services controlling interrupts. Resource Management. Provides system services controlling synchronisation
access shared resources between tasks.
Event Management. Provides system services controlling events. Counter Management. Provides system services controlling counters. Alarm Management. Provides system services controlling alarms. Error Handlers Hook Routines. Provides mechanism error handling
controlling hook routines called specific timing.
Application Modes
Application modes designed allow start different modes. This feature intended modes operation that totally mutually exclusive. example, application modes used distinguish between normal running mode, service maintenance mode. Each following system objects selected whether valid each application mode.
Task Resource Alarm Counter
Additionally, system object depends another one, user must ensure that both system objects valid application modes that have been selected. example, when task uses resource certain application mode, resource should also valid application mode. Note that objects which defined application, used, will still subject object validation error checking time configuration file generation. Once operating system started, allowed change application mode.
Conformance Classes
Various requirements application software system various capabilities specific system demand different features operating system. provides "conformance classes" which offer implementations with varying functionality. Conformance classes determined following attributes: number times queuing task activation (multiple requesting) type task (Basic Extended) number tasks priority kind conformance class shown below.
BCC1 (only basic tasks, limited request task task priority,
while tasks have different priorities)
BCC2 (more than task priority multiple requesting task activation
added BCC1)
ECC1 (extended tasks added BCC1) ECC2 (extended tasks added BCC2)
asks
rity ltip rity ltip
Figure Conformance Classes
Maximum Parameters
Table shows maximum parameters Table Maximum Parameters Item Maximum number BCC1 BCC2 ECC1 ECC2 1023 1023 (max. basic tasks) 1023 1023
Number tasks Number active tasks Number priorities Number tasks priority Upper limit number task activations (must extended tasks) Number events task Number alarm objects Number counter objects Number resources* Number application modes Number interrupt service routines Note: Includes RES_SCHEDULER resource (resource provided
Task Management Task Concept
Complex control software conveniently subdivided into parts executed according their real-time requirements. These parts implemented means tasks. uses task scheduler provide concurrent asynchronous execution tasks. task either activated start-up, other tasks. task then terminate, endless loop. Once terminated, task will re-started when activated another task, through alarm expiry. different task types provided
Basic tasks Extended tasks
Basic tasks only release processor,
They being terminated, executing higher-priority tasks, Interrupts occur which cause processor switch ISR.
addition above, Extended tasks release processor waiting event. More than Extended tasks cannot activated same time.
Task State
4.2.1 Introduction
task must able change between several states, processor only execute task time. Several tasks competing processor same time. following sections explain task states basic extended tasks.
4.2.2 Basic Tasks
Basic tasks have three task states:
running
processor assigned task, that instructions executed. Only task this state point time, while other states adopted simultaneously several tasks.
ready
functional prerequisites transition into running state exist, task only waits allocation processor. scheduler decides which ready task executed next.
suspended
suspended state task passive activated.
running
terminate
preempt
start
suspended
activate
ready
Figure Basic Task State
Table States Transitions Basic Tasks Transition activate Former state suspended state ready1 Description task entered into ready queue system service. operating system ensures that execution task will start with first instruction. ready task selected scheduler executed. scheduler decides start another task. running task into ready state. running task causes transition into suspended state system service.
start preempt terminate
ready running running
running ready suspended
4.2.3 Extended Tasks
Extended tasks have four task states:
running
processor assigned task, that instructions executed. Only task this state point time, while other states adopted simultaneously several tasks.
ready
functional prerequisites transition into running state exist, task only waits allocation processor. scheduler decides which ready task executed next.
waiting
task cannot continue execution because wait least event.
suspended
suspended state task passive activated.
Activation task will immediately change state task case multiple requesting. task suspended, activation will only recorded performed later.
running
wait
terminate
waiting
preempt
start
suspended
release
activate
ready
Figure Extended Task State
Table States Transitions Extended Tasks Transition activate Former state suspended state ready Description task entered into ready queue system service. operating system ensures that execution task will start with first instruction. ready task selected scheduler executed. running task requires event. causes transition into waiting state using system service. least event occurred which task waited scheduler decides start another task. running task into ready state. running task causes transition into suspended state system service.
start wait
ready running
running waiting
release preempt terminate
waiting running running
ready ready suspended
Comparison Task Types
Basic tasks have waiting state, thus only comprise synchronisation points beginning task. Parts application with internal synchronisation points have implemented synchronise more than basic task. Extended tasks synchronise using event.
Task Activation Termination
Task activation performed using automatic activation time initialisation, calling system services. Depending conformance class, basic task activated once multiple times. maximum number multiple requests parallel defined time system generation. maximum number multiple requests been reached, request basic task queued First-In-First-Out (FIFO) queue priority preserve activation order. task only terminate itself. also provides system service that activate task upon termination current task. When task terminated, sure issue TerminateTask ChainTask system service.
Task Priority
Each task priority, which number from 127; priority level lowest priority level highest. This priority assigned statically time system generation, used scheduler determine next task execute. Dynamic priority management scheme supported. However, priority resource management function, treat task with defined higher priority. Please refer Section more information.
Task Preemptability
Each task option being preemptive non-preemptive. task that permits preemption preemptive task. task that does permit preemption non-preemptive task. task preemptive, then higher priority task becomes ready execute whilst preemptive task running, scheduler will pass control that task. task non-preemptive, then higher priority task becomes ready execute whilst preemptive task running, task switching does occurred. scheduler
only passes control that task current task terminated, current task explicitly calls scheduler, current task enters waiting state.
Task Stacks
Stacks allocated tasks depending their types. stack allocation method each task type described below.
Basic tasks
basic tasks share single stack. basic task preempted another basic task, next task execute will current stack pointer value preempted task. There will conflict with task stack overwriting, basic tasks higher priority will execute before preempted task will execute again. Note: basic task stack size depends function number priorities. application uses less priorities, basic task stack size will also decreased.
Extended tasks
Each extended task executes stack. They cannot share stacks possible them enter WAITING state (this possible with basic tasks).
Task System Services
Table shows system services supplied manipulate tasks. Table Task System Services System Service ActivateTask TerminateTask ChainTask Schedule GetTaskID GetTaskState Function Activates task Terminates current task Activates task terminate current task Calls scheduler switch higher priority task exist) Gets task current task Gets task state task
Scheduler Introduction
provides task scheduling based task priority task preemption. This contrast other operating systems that time-sliced algorithms (round-robin scheduling, example). uses ready queues, each task priority which exists application keep track tasks which ready running states. Each ready queue implemented First First (FIFO) queue preserve activation order. Figure shows example using FIFO queues each priority level.
queue
Figure Ready Queues scheduler performs following steps determine next task processed.
From tasks ready state, scheduler determines tasks
with highest priority. Within tasks ready state highest priority, scheduler finds oldest task. When there tasks ready queue, enters IDLE mode. task, which released from waiting state, treated newest task ready queue priority. OSEK provides three scheduling algorithms. Non-Preemptive scheduling Full Preemptive scheduling Mixed Preemptive scheduling These explained following sections.
Non-Preemptive Scheduling
tasks non-preemptive, then scheduling policy selected non-preemptive scheduling. non-preemptive task block execution higher-priority task which ready execute. case non-preemptive task, rescheduling will take place exactly following cases:
Successful termination task Explicit call scheduler (Schedule system service issue) transition into waiting state takes place
high
Task
suspended
ready
running transit waiting
Task
suspended
ready
running
waiting
issue Schedule system service priority
Task
suspended
ready
running terminate task
ready
Task
running
suspended
Figure Non-Preemptive Scheduling
Full Preemptive Scheduling
Full preemptive scheduling adopted when tasks preemptive. soon higher priority task ready, current task will swapped out. With full preemptive scheduling, latency time independent time lower priority tasks. each task rescheduled location, access data, which used jointly with other tasks, must synchronised. Figure 5.3, task with lower priority does delay scheduling task with higher priority.
read
read
Figure Full-Preemptive Scheduling task fragment must preempted, this achieved blocking scheduler temporarily system service GetResource. Summarised, rescheduling could performed following cases:
successful termination task transition into waiting state takes place activating higher priority task setting event waiting task alarm expiry, when higher priority task activation event setting defined this alarm releasing resource return from
Mixed Preemptive Scheduling
both preemptive non-preemptive tasks used same system, then "mixed preemptive" scheduling used. preemptive task running then full preemptive scheduling employed; non-preemptive scheduling used nonpreemptive task running.
high
Task Preemptive
ready suspended running
ready
Task Non-Preemptive
suspended preempted higher priority
running
waiting
priority
Task Preemptive
suspended
ready
running terminate task
ready
running
ready
Task Non-Preemptive
running
suspended
Figure Mixed-Preemptive Scheduling
Interrupt Mask Level Task Preemption
Preemption task independent interrupt mask level status register). When interrupt-mask level non-zero, task switching does take place. When interrupt-mask level zero, preemption that task another task possible.
Interrupt Management Interrupt Categories
functions processing interrupt divided into three categories: Interrupt Category interrupt category does system services. After finished, processing continues exactly instruction where interrupt occurred. Category interrupts execute under control Therefore, interrupt occurs, program execution will branch immediately. Interrupts this category fastest. Interrupt Category intervenes time interrupt occurence. interrupt occurs, processing level switched interrupt processing level stack frame changed. This mechanism called interrupt preamble. After finishes processing, control then passes interrupt handler. Within ISR, system services restricted according "Appendix System Service Calls". Interrupt Category These interrupts same interrupts category they have same structure operate same those category They used compatibility with earlier version Although EnterISR LeaveISR system service available, they processed executed, there point calling these routines. further information, description under interrupt category Note: This mode operation original feature this system.
Figure shows flow interrupt category
Task
Interrupt occur
Interrupt processing
Interrupt termination
Figure Flow Interrupt Category
Figure shows flow interrupt category
Task Interrupt preamble Switch interrupt processing level Interrupt occur Dispatch Return from interrupt processing level Interrupt disposal Interrupt termination Interrupt processing
Figure Flow Interrupt Category
Figure shows contents description each category.
Category Category Interrupt preamble processing switch interrupt level stack change jump
code without system service call
code with system service call
Figure Description Each Category Inside ISR, rescheduling take place. Rescheduling only take place termination category preemptive task been interrupted, scheduler been locked, other interrupt been active.
Interrupt Control
system services EnableInterrupt DisableInterrupt provided manipulate servicing interrupts. When interrupt-mask level selected interrupt control method, i.e., "Use mask level" selected page configurator, these system services modify interrupt mask status register (SR), thus providing interrupt enabling disabling based interrupt priority level. interrupts disabled (other than zero), tasks switched. this case, interrupts enabled EnableInterrupt preempted (zero). When interrupt source selected interrupt control method, i.e., "Use source" selected page configurator, these system services make interrupt valid invalid changing CPU's interrupt-request enable bit, values interrupt priority-level setting register (IPR).
6.2.1 Interrupt Mask Level Method EnableInterrupt(<Descriptor>)
enables interrupts with priority level <Descriptor> higher. values <Descriptor> range from H'00000000
H'000000f0 that multiples When H'00000000 specified, performs rescheduling.
DisableInterrupt(<Descriptor>)
disables interrupts with priority level <Descriptor> lower. values <Descriptor> range from H'00000000 H'000000f0 that multiples interrupts enabled when H'00000000 specified. interrupt mask before interrupt been disabled returned return value.
Note: These system services comply with OSEK Operating System specification Version revision Processing always performed E_OK returns. error code E_OS_NOFUNC will returned.
6.2.2 Interrupt Source Method EnableInterrupt(<Descriptor>) sets interrupt-request enable enable
interrupt source that corresponds specified <Descriptor> makes value interrupt priority-level setting register (IPR) valid.
DisableInterrupt(<Descriptor>) sets interrupt-request enable disable
interrupt source that corresponds specified <Descriptor> makes value interrupt priority-level setting register (IPR) valid. <Descriptor> (ISR specified adding "_ID" name. interrupt source each interrupt configurator. values select interrupt sources that provided standard, refer section 12.3.4. also possible select interrupt source defined user (CUSTOM0 CUSTOM31). this case, interrupt control using user-defined source function (refer section 12.3.5).
Note: These system services comply with Version 2.0, revision OSEK Operating System Specification. interrupt mask level must lowered time interrupt occurring level during execution ISR. task change interrupt mask level. When interrupt-mask level non-zero during execution task, task increase their mask level during task execution exceed mask level, will illegal call system services.
interrupt mask level category must have least same, higher interrupt level, mask level2. This because interrupts category outside control operating system. Figure shows interrupt level.
Interrupt level high Category interrupts Tasks Category interrupts
mask level
Figure Interrupt Level
interrupt mask level highest interrupt level interrupt category configurator automatically.
Interrupt Source Classification
Interrupt sources classified into classes: other interrupts (the external interrupt internal peripheral module interrupt). software trap handled exception interrupt. following sections explain interrupt source classifications.
6.3.1 Non-Maskable Interrupt
non-maskable interrupt (NMI) cannot masked always accepted. only category
6.3.2 Other Interrupts
Other interrupt causes internal peripheral module interrupt external interrupt other than above.
Interrupt Stacks
Stacks allocated interrupts described below. stack size used each interrupt specified configurator.
6.4.1 Interrupts Category
ISRs category share stacks same area basic task stack. stack size specified configurator reserved basic task stack. When interrupt this category serviced, swaps stack interrupt. nested interrupt category occurs, will change stack.
6.4.2 Interrupts Category
Each interrupt category will share stack with those same interrupt mask level. Note: control over handling interrupts category performance reasons, thus shared stack used other interrupt categories cannot used.
6.4.3 Interrupts
will same stack interrupted program.
Exceptions
following exceptions Table classified fatal errors operating system, thus handled operating system. Table Exceptions Exception Unhandled exception General illegal instruction Slot illegal instruction address error Handler Name _OSEKUnhandledExceptionError _OSEKIllegalInstructionError _OSEKIllegalCPUAddressError
These exceptions inserted into vector table entry that does have vector. these exceptions occur, will perform shutdown processing. Exceptions other than above also inserted into vector table entry. this case, user must prepare handler exception. This exception will same stack interrupted program.
Interrupt System Services
Table shows system services supplied manipulate interrupts. Table Interrupt System Services System Service EnableInterrupt EnableInterruptMask EnableInterrupt EnableInterruptSource DisableInterrupt DisableInterruptMask DisableInterrupt DisableInterruptSource GetInterruptDescriptor GetInterruptDescriptorMask GetInterruptDescriptor GetInterruptDescriptorSource Function Enables interrupts (Interrupt Mask Level Method) Enables interrupts (Interrupt Source Method) Disables interrupts (Interrupt Mask Level Method) Disables interrupts (Interrupt Source Method) state interrupts (Interrupt Mask Level Method) state interrupts (Interrupt Source Method)
Resource Management Introduction
Resource management used co-ordinate concurrent accesses several preemptive tasks different priorities shared resources. priority task becomes high temporarily during resource occupation. more tasks cannot occupy same resource same time.
Priority Resource Management
When task requests resource, priority task raised priority ceiling corresponding resource. This method excludes possibility more tasks occupying same resource simultaneously. resource priority determined system generation, calculated Identical higher than highest task priority with access resource, Lower than other tasks with higher priority than highest priority task accessing resource. Figure illustrates priority assignment. Task highest priority, task lowest. Tasks share same resource. When these tasks resource, priority raised higher value than same value task lower value than same value task Tasks share resource.
task release resource
Resource priority
suspended release resource running running ready ready ready running running suspended suspended running suspended running
running suspended suspended suspended
running
task task task task
ready
request resource
request resource
Figure Resource Priority Assignment
Nested Resource Occupation
Nested resources must occupied released using Last-In-First-Out (LIFO) principle. When inner resource priority that lower than current task priority obtained, OSEK specification, task priority lowered E_OK returns. However, this version does change task priority. This provides secure mechanism whereby deadlocks priority inversion will never occur. error will returned system service extended error status. Note: This behavior deviates from OSEK Specification.
Resource Occupation Task Termination
Resources must released before task terminated. extended error status, will return error resources still occupied. normal error status, system operation cannot guaranteed there will error reporting.
Scheduler Resource
task prevent itself from being preempted during execution critical section deactivate scheduler. standard resource with defined name RES_SCHEDULER provided used task. following points must noted. When task requests RES_SCHEDULER resource, task priority changed. RES_SCHEDULER resource release timing influenced other resources. Before terminating task, always release resource. When task requests RES_SCHEDULER resource, task changed even Schedule system service issued.
Resource Priority Ceiling ECC1 Conformance
ECC1 conformance class, configurator will automatically shift task priorities order accommodate resource priorities. That priority specified user changed. priority shifted task checked configurator. This function makes feature ECC1 conformance class, which restriction task resource single activation priority, high performance therefore drawn out.
Restrictions when Using Resources
Neither waiting state task termination admissible while resource
occupied. task does switch waiting state resource acquisition. When resource cannot obtained since other task under resource occupancy, resource acquisition needs required again. BCC1 conformance class only RES_SCHEDULER resource.
Resource System Services
Table shows system services supplied operating system manipulate resources. Table Resource System Services System Service GetResource ReleaseResource Function Occupies resource Releases resource
Event Management Introduction
Events objects used extended tasks. synchronise execution extended tasks means "events".
Event Operation
Several events assigned extended task. task event extended task. Only appropriate extended task able clear events wait setting events. wait more than event. extended task waiting state released ready state least event which task waiting occurred. running extended task tries wait event this event already occurred, task remains running state. Events belonging extended task cleared upon task activation. Figure Figure show synchronisation extended tasks event setting.
Event extended task clear clear
ready Extended task Extended task waiting running
event
running
reset event
wait event
waiting running
ready
Figure Synchronisation Full Preemptive Extended Tasks
Event extended task
clear clear
ready Extended task Extended task waiting running
event
running
suspended
reset event
wait event
waiting running
ready
Figure Synchronisation Non-Preemptive Extended Tasks above example, extended task highest priority. Task waits event. Task sets this event Subsequently, transferred from waiting state into ready state. case full-preemptive scheduling Figure 8.1, highest priority this results task switch, preempted Thereafter waits this event again, continues execution. case non-preemptive scheduling Figure 8.2, Task will swapped until next scheduling point (until enters suspended state).
Event
Each extended task have eight events; such sets events represented 8-bit units. Each represents state event; indicates that event occurred been cleared, indicates that event occurred. events given based position each event bit-mask, shown Figure 8.3.
8-bit event bit-mask
Event ID's: 0x80 0x40 0x20 0x10 0x08 0x04 0x02 0x01 Figure Event event used manipulate event states; more than event referenced using bit-wise operator time. example, clear event 0x01 0x80, ClearEvent(0x01 0x80) executed. event specified user automatically determined configurator. event used each task configurator must defined. event defined task must used that task.
Event System Services
Table shows system services supplied operating system manipulate events. Table Event System Services System Service SetEvent WaitEvent ClearEvent GetEvent Function Sets event events referenced task Makes task wait event events Clear event events Returns current state events referenced task
Alarm Counter Management Introduction
provides services processing recurring events. provides two-stage concept alarms counters, shown Figure 9.1.
counter handler
counters single alarms defined system configuration
cyclic alarms
Figure Layered Model Alarm Management
Recurring events, such timers that provide interrupts regular intervals, considered sources counters. Each counter represented counter value, measured "ticks". count incremented each time event attached that counter occurs using IncrementCounter system service. Based counters, offers alarm mechanisms application software. Alarms used, example, monitor number timer interrupts, specific angular position. Upon alarm expiry, tasks activated, events set.
Counters
9.2.1 Counter Handler
Counter handlers used increment counter dynamic (variant) alarms. application needs increment counter calling IncrementCounter system service. There timer interrupt service routine, etc. example counter source. Please create these application. example, interrupt might generated timer. interrupt handler timer would then system service increment appropriate counter's count.
9.2.2 System Timer
offers system timer, called SYSTEM_TIMER, dynamic (variant) alarm. reserves on-chip Compare Match Timer Channel system timer. system timer, supplied then responsibility incrementing system timer. Please refer Section 11.9 name used system timer.
9.2.3 Non-Variant Alarm Timer
allows user define static (non-variant) alarms. These alarms only non-variant alarm timer, called NonVariantAlarmTimer, provided reserves on-chip Compare Match Timer Channel timer. non-variant alarm timer, supplied then responsibility incrementing timer. Please refer Section 11.9 name used non-variant alarm timer.
9.2.4 Counter Properties
Each counter following properties, time system generation:
maxallowedvalue ticksperbase mincycle
following sections explain these properties. 9.2.4.1 maxallowedvalue maxallowedvalue property used determine range count values counter. Note: maxallowedvalue count value cannot reached. When counter reaches count value (maxallowedvalue next increment will cause counter roll over count value
counter maxallowedvalue count values will range from shown Figure 9.2.
Count value
Figure Range Count Values Counter with 'maxallowedvalue' When counter reaches count value next increment will force counter roll over cyclic alarm with cycle value maxallowedvalue, alarm will always expire same count value. count value expressed unsigned integer. Therefore, cycle counter microsecond, will correspond about days.
9.2.4.2 ticksperbase ticksperbase property this property user defined; controlled (used) 9.2.4.3 mincycle mincycle value used when setting minimum cycle cyclic alarms. When cyclic alarm set, cycle period compared with mincycle value determine within acceptable limits.
Alarms
9.3.1 Introduction
provides services start tasks events when alarm expires. alarm will expire when predefined counter value reached. Figure shows different kinds alarms that used.
alarms
Static alarms
Only cyclic
Dynamic alarms
Selection single-shot alarm cyclic alarm possible. Dynamic specification expiration count possible absolute value relative value specification).
Absolute-value specification cycle possible time configuration.
Figure Alarm Classification Alarms classified into static alarm dynamic alarm. Dynamic alarms' parameters during application run-time. user allowed change count value that alarm expires whether alarm cyclic, through system service. Dynamic alarms connected counter. Dynamic alarm active from SetAbsAlarm SetRelAlarm system service CancelAlarm system service. Dynamic alarms have following properties that run-time: Absolute count relative count expiry Starting canceling alarm
Single cyclic system-timer counter user-defined counter selected
Static (non-variant) alarms used activate periodic tasks, events periodically. period time system generation, cannot altered. Static alarms cannot cancelled. attachment alarms counters defined time system generation. Static alarms automatically started time initialisation. Static alarms cannot suspended. Please note following points.
Static alarms only attached non-variant alarms timer counter (cannot
changed). user cannot start cancel static alarms. Static alarms only cyclic. alarm expiry period system generation time cannot altered. Static alarms carry smaller overhead than dynamic alarms
9.3.2 Alarm Parameters
9.3.2.1 Expiry Count Dynamic alarms expire absolute count value, count value relative current count value corresponding counter. This parameter run-time using system services, thus allowing user decide whether alarm should absolute relative run-time. When absolute count value, alarm will expire when counter reaches that value. When relative count value, alarm will expire count value relative counter's current count value. following points should noted:
absolute alarm which expiry count value same
counter's current count value, alarm will expire immediately. Instead, alarm will expire when counter rolls over reaches expiry count.
relative alarm with relative count alarm's expiry count will
current count value counter. alarm will expire when counter rolls over reaches expiry count.
absolute alarm with expiry count value maxallowedvalue
counter, expiry count will
relative alarm with relative count maxallowedvalue, expiry
count will current count value counter.
9.3.2.2 Cyclic Single Alarms Alarms either single alarms, cyclic alarms run-time system services. Single alarms expire particular count, then stop. Cyclic alarms restarted upon expiry with count value relative current counter count. system service provided cancelling single cyclic alarms.
Example Using Counter Alarm
Figure shows example using counter alarm.
Task
Alarm setting (dynamic, relative)
Alarm
Alarm processing Counter: used Cycle: counts Action: Activate Task
SetRelAlarm SetAbsAlarm
Alarm setting (dynamic, absolute)
Task activation 10-count cycle
Timer Timer interrupt occur (1-ms cycle) Counter increment IncrementCounter
Alarm
Counter processing Event counts Counter: used Single: counts Action: Event 0x01 Task
Interrupt termination
Figure Example Using Counter Alarm Alarm Alarm share Counter Alarm been cyclic alarm. Alarm expires every counts activates Task Alarm been single alarm. Alarm expires after counts sets event Task
Counter Alarm System Services
Table shows system services supplied manipulate counters alarms. Table Counter Alarm System Services System Service InitialiseCounter IncrementCounter GetAlarmBase GetAlarm SetRelAlarm SetAbsAlarm CancelAlarm Function Initialises counter Increments counter Returns attached counter's properties Returns remaining counts alarm expiry Sets relative alarm Sets absolute alarm Cancels alarm
System Control 10.1 System Start-up
Figure 10.1 shows start-up method
reset
Hardware initialisation
Call StartOS
Figure 10.1 Start user responsibility initialising hardware required. system service StartOS provided initialise start application mode must specified argument. this valid, system service returns. called successfully, system service starts During execution StartOS, interrupts except category masked; interrupts accepted when scheduler started. scheduler then decides which task execute from tasks which have been defined auto-start tasks, from tasks activated from StartupHook routine. program that issues StartOS system service must reserve 8-byte stack area.
10.2 System Shutdown
provides system service, ShutdownOS, provide shutdown facilities. This either called application, requested exception. When ShutdownOS called, system will shutdown regardless whether incorrect error code passed system service. During shutdown, interrupts masked. shutdown processing completed, will return program that issued StartOS system service. When returned, recovered other register values become undefined.
10.3 Hook Routines
provides system-specific hook routines allow user-defined actions within internal processing. Hook routines used for:
system startup.
corresponding hook routine (StartupHook) called after start-up before scheduler called. This called after automatic activation selected tasks.
system shutdown.
corresponding hook routine (ShutdownHook) called system shutdown. does necessarily need return from hook routine. example, also possible issue StartOS system service start again.
task switching.
hook routines (PreTaskHook PostTaskHook) called task context switching. PreTaskHook called after selected task made transition running state, before task switching occurs. PostTaskHook called before current task exited running state.
error handling.
corresponding hook routine (ErrorHook) called system service called correctly (and returns with error code other than E_OK). following points must noted: Hook routines system optional. user choice including some, excluding others.
Hook routines only sub-set system services. These shown Appendix System Service Calls.
Only interrupts category accepted when executing hook routines. Therefore, execution times these hooks should short possible reduce interrupt latency times. user should lower interrupt mask level when executing hook routines. Operation system guaranteed when interrupt mask level lowered.
10.4 Error Handling
10.4.1 Error Status
operate error modes. This shown below. Standard Error Status Minimal parameter checking Faster operation Less memory efficient Extended Error Status More thorough parameter checking Slower operation More memory efficient operating system with extended error status used development debugging applications; operating system with standard error status used fully debugged systems. Appendix System Service Return Codes gives summary error codes returned system services.
10.4.2 Shutdown Errors
Table 10.1 shows shutdown errors. Table 10.1 Shutdown Errors Error Illegal instruction executed Undefined exception Illegal slot instruction executed address error Error Code E_OS_SYS_ILLEGAL E_OS_SYS_EXCEPTION E_OS_SYS_ILLEGAL_SLOT E_OS_SYS_CPU_ADDRESS
shutdown error occurs, ShutdownOS system service executed. However, error hook called this case.
10.5 ErrorHook Re-Entry
system service incorrectly called from ErrorHook routine, ErrorHook will called. this case, ErrorHook routine called processing continued error code returns). user must aware that centralised error handling system service calls will occur ErrorHook level. This original function.
Programming 11.1 Registers
initial value usage register shown Table 11.1.
Table 11.1 Initial Value Usage Register Register Processing level Task Hook routine Task Hook routine Task Hook routine R0-R7, FR0-FR11, FPUL, FPSCR3 R8-R14, MACH, MACL, GBR, FR12-FR15 Task Hook routine Task Contents Starting address task Starting address Starting address hook routine used freely. occurred interrupt level. lower interrupt level. mask level. lower interrupt level. stack area task. change another stack area. stack area ISR. change another stack area. stack area change another stack area. Unknown. used freely. Unknown. used freely. Unknown. used freely. Unknown. used freely. Those value before interrupt occurring. values registers that used saved restored code generated compiler. Unknown. values registers that used saved restored code generated compiler.
Hook routine
program which issues StartOS system service should specify #pragma noregalloc instrinsic function, #pragma gbr_base #pragma gbr_base1. contents Table 11.1 changed version update etc. When they differ from present condition, please design present-condition specification priority.
11.2 Declaration OSEK Processes
11.2.1 Initiation
Within application, program activating defined according following syntax:
FR0-FR15, FPUL FPSCR registers only valid processor with Floating Point Unit (FPU).
#include "sysserv.h" #pragma noregalloc (function name) type-function name (argument) StartOS (application mode ID);
11.2.2 Tasks
Within application, task defined according following syntax: #include "osekos.h" TASK (Task name) TerminateTask(); ChainTask (task name);
11.2.3
Within application, interrupt handler defined according following syntax: #include "osekos.h" (ISR name)
macro definition TASK defined file "OSEKtype.h"
11.3 System Configuration Files
following gives list main header files generated configurator.
11.3.1 Header Files
Table 11.2 Header Files File name size.h defsapp.h sysobjid.h OSEKtype.h errcodes.h intdecl.h sysserv.h Api_id.h osekos.h Comment Machine word sizes OSEK state definitions Gives ID's system objects Defines OSEK abstract type mapping Error code Interrupt declaration OSEK system service declarations System service Header file that includes above
program, task, activating include "osekos.h".
11.4 Declaring System Objects Through System Services
system services Table 11.3 system object declaration required used. macro define these system services file "sysserv.h". Table 11.3 Declaration System Objects System Service DeclareTask DeclareResource DeclareEvent DeclareAlarm EnterISR LeaveISR Comment Declares task object Declares resource object Declares event object Declares alarm object Enters interrupt service routine Resumes from interrupt service routine
11.5 Referring System Objects
System object ID's declared file "sysobjid.h". This file declares enumerated type system objects. system object same system object names. Note, however, that added names. They referred specifying object name follows: #include "osekos.h" TASK(Task2) ActivateTask(Task1);
DisableInterrupt(Isr1_ID):
11.6 Calling System Service From Assembler Routine
System services called from assembler routines. this case application programmer must branch address each system service using instruction. Follow rules Table 11.4. Refer Table C-language header file configuration files information parameter types. Table 11.4 Argument Convention Register Argument Number First argument Second argument Third argument Fourth argument
general register used return value. Registers FR11, FPUL FPSCR guaranteed before after calling system service. These registers must saved before call, restored after call. R14, MACH, MACL, GBR, FR12 FR15, FPUL, FPSCR program that issues StartOS system service.
11.7 Assembler
11.7.1 Interrupt Category
11.7.1.1
registers that routine uses must saved upon entry, restored upon exit. instruction exit ISR. 11.7.1.2 Other Interrupts
11.7.1.2.1 Interrupt Stack Change
Change stack beginning ISR. corresponding interrupt stack that interrupt level must used.
11.7.1.2.2 Return
instruction must used exit ISR.
11.7.1.2.3 Register Used
registers that routine uses must saved upon entry, restored upon exit.
11.7.1.2.4 Example
Figure 11.1 shows ISR, interrupt level should implemented. addition, case language, since configurator generates automatically, does need conscious application.
.IMPORT _f1: MOV.L R0,@-R15 MOV.L _IntLev4,R0 MOV.L @R0,R0 MOV.L R15,@-R0 MOV.L R0,R15 interrupt handler body MOV.L @R15,R15 MOV.L @R15,R0 .ALIGN _IntLev4: .DATA.L _INTERRUPT_LEVEL_4_STACK_START _INTERRUPT_LEVEL_4_STACK_START
Figure 11.1 Implementation Assembler
Description: this case, start interrupt stack level interrupts must referenced. Fifteen symbols imported. These are: Table 11.5 Stack Start Symbol Interrupt Category Symbol
_INTERRUPT_LEVEL_1_STACK_START _INTERRUPT_LEVEL_2_STACK_START _INTERRUPT_LEVEL_3_STACK_START _INTERRUPT_LEVEL_4_STACK_START _INTERRUPT_LEVEL_5_STACK_START _INTERRUPT_LEVEL_6_STACK_START _INTERRUPT_LEVEL_7_STACK_START _INTERRUPT_LEVEL_8_STACK_START _INTERRUPT_LEVEL_9_STACK_START _INTERRUPT_LEVEL_10_STACK_START _INTERRUPT_LEVEL_11_STACK_START _INTERRUPT_LEVEL_12_STACK_START _INTERRUPT_LEVEL_13_STACK_START _INTERRUPT_LEVEL_14_STACK_START _INTERRUPT_LEVEL_15_STACK_START
Meaning Stack interrupt level Stack interrupt level Stack interrupt level Stack interrupt level Stack interrupt level Stack interrupt level Stack interrupt level Stack interrupt level Stack interrupt level Stack interrupt level Stack interrupt level Stack interrupt level Stack interrupt level Stack interrupt level Stack interrupt level
These statements provide stack change into interrupt stack before execution ISR. These statements provide exit from ISR, stack change back interrupt process. These provide references stack start address
11.7.2 Interrupt Category
registers that routine uses must saved upon entry, restored upon exit. instruction exit ISR. stack needed changed ISR.
11.8 Registering ISRs
must register their starting addresses vector table. Figure 11.2 shows relationship between vector table category
Vector table Vector number H'00 Vector number H'01 Vector number H'02 Vector number Return from interrupt processing Interrupt processing vector number
Figure 11.2 Relationship between Vector Table Category interrupts category control must first passed Preambles used transfer control before calling interrupt handler. Figure 11.3 shows operation preamble.
Vector table Vector number H'00 Vector number H'01 Vector number H'02 Vector number Return from interrupt processing interrupt preamble (shifts interrupt processing level.) vector number
Interrupt processing
Figure 11.3 Relationship between Vector Table Category
Each interrupt category preamble which must registered vector table. These preambles automatically generated configurator. preamble name generated adding "_ISR" name. Thus, example, "ATUTimer1" becomes "ATUTimer1_ISR". interrupt mask level same value defined configurator interrupt priority level setting register (IPR) CPU. Then, don't change IPR.
11.9 Interrupts
reserves interrupts Table 11.7: Table 11.7 Interrupt Interrupt Compare Match Timer Interrupt Compare Match Timer Interrupt Vector number Interrupt handler (Assembler name) _SysTimer_ISR _NonVarTimer_ISR
System Services 12.1 Introduction
functional details each system service will described using following fields. System Service Description Syntax Interface Parameter (In): List input parameters. Parameter (Out): List output parameters. Description: Explanation functionality system service. Particularities: Detail explanation functionality system service. Error Status: List return values. Standard List error codes provided operating system's standard version. Extended List additional error codes operating system's extended version Conformance Specifies conformance classes where operating system Class: service provided. specification operating system services uses following naming conventions data types: .Type: .RefType: Describes values individual data. Describes pointer .Type.
12.2 Task Management Services
12.2.1 Data Types StatusType
This data type used status information returned operating system service.
TaskType
This data type identifies task.
TaskRefType
This data type points variable data type TaskType.
TaskStateType
This data type identifies state task.
TaskStateRefType
This data type points variable data type TaskStateType.
12.2.2 System Services
12.2.2.1 ActivateTask StatusType ActivateTask(TaskType <TaskID>) Activation task name) None task <TaskID> transferred from suspended state into ready state4. ensures that task will start executing from first statement task. service called from interrupt level, from task level hook routine StartupHook.
Syntax Parameter (In): TaskID Parameter (Out): Description:
Particularities: Error Status: Standard
error, E_OK many activations <TaskID>, E_OS_LIMIT (original
function
Extended
Called from invalid processing level, E_OS_CALLEVEL <TaskID> invalid, E_OS_ID many multiple activations, E_OS_LIMIT
Conformance Class: BCC1, BCC2, ECC1, ECC2
ActivateTask system service will immediately change state task case multiple requests. task suspended, activation will only recorded performed later.
12.2.2.2
TerminateTask StatusType TerminateTask(void) None None This service causes termination calling task. calling task transferred from running state into suspended state5. resources occupied task must released before call TerminateTask. Undefined behaviour will result resources still occupied task termination standard error status mode. version with standard error status used, system service does return. version with extended status used, service returns case error. When there error, system service does return. This service only called from task. When task terminated, sure issue this system service ChainTask system service.
Syntax Parameter (In): Parameter (Out): Description:
Particularities:
Error Status: Standard Extended Conformance Class:
return call level Call non-task level, E_OS_CALLEVEL Task still occupies resources, E_OS_RESOURCE
BCC1, BCC2, ECC1, ECC2
case tasks with multiple activations, suspended state task transferred ready state.
12.2.2.3
ChainTask StatusType ChainTask(TaskType <TaskID>) Reference sequential succeeding task name) activated. None This service causes termination calling task. After termination, succeeding task <TaskID> activated sequentially. succeeding task identical current task, this situation will result multiple requests. activated after task termination. resources occupied task must released before call ChainTask. Undefined behaviour will result resources still occupied task termination standard error status mode. version with standard error status used, system service does return. version with extended status used, service returns case error. When error, system service does return. This service only called from task. When task terminated, sure issue this system service TerminateTask system service.
Syntax Parameter(In): TaskID Parameter(Out): Description:
Particularities:
Error Status: Standard
return call level many activations <TaskID>, E_OS_LIMIT (original
function
Extended
Conformance Class:
Call non-task level, E_OS_CALLEVEL <TaskID> invalid, E_OS_ID Task still occupies resources, E_OS_RESOURCE many multiple activations, E_OS_LIMIT BCC1, BCC2, ECC1, ECC2
12.2.2.4
Schedule StatusType Schedule(void) None None higher-priority task ready, current task into ready state, higher priority task executed. Otherwise, calling task continues execution. This system service allows non-preemptive tasks enforce reschedule. scheduler locked (RES_SCHEDULER occupied), reschedule will occur. This service only called from task.
Syntax Parameter (In): Parameter (Out): Description:
Particularities:
Error Status: Standard Extended Conformance Class: 12.2.2.5
error, E_OK Call non-task level, E_OS_CALLEVEL
BCC1, BCC2, ECC1, ECC2
GetTaskID StatusType GetTaskID(TaskRefType <TaskID>) Task storage area addresses Reference task which currently active This service returns currently active task. This service allowed task level, from several hook routines.
Syntax Parameter (In): TaskID Parameter (Out): *TaskID Description: Particularities:
task currently active, task ID_INVALID_TASK returned. Error Status: Standard Extended Conformance Class:
error, E_OK Call from invalid processing level, E_OS_CALLEVEL
BCC1, BCC2, ECC1, ECC2
12.2.2.6 Syntax
GetTaskState StatusType GetTaskState(TaskType <TaskID>, TaskStateRefType <State>) Task name) reference State storage area addresses Reference state task <TaskID> This service returns state task <TaskID> time calling system service. This service called from task level, interrupt level, some hook routines.
Parameter (In): TaskID State Parameter (Out): *State Description: Particularities: Error Status: Standard Extended Conformance Class:
error, E_OK Call from invalid processing level, E_OS_CALLEVEL <TaskID> invalid, E_OS_ID
BCC1, BCC2, ECC1, ECC2
12.2.3 Constants data type TaskStateType
Constant SUSPENDED (D'0) WAITING (D'1) READY (D'2) RUNNING (D'3) Description task state suspended task state waiting task state ready task state running
12.3 Interrupt Management Services
12.3.1 DataTypes IntDescriptorType
Data type logical interrupt masks.
12.3.2 System Services
12.3.2.1 EnableInterrupt
Interrupt-Mask Level (when "Use mask level" selected page configurator) Syntax void <Descriptor>) void <Descriptor>)
Parameter (In): Descriptor
status register value with interrupt-mask level made valid. Parameter (Out): None Description: This service enables interrupts above, interrupt level given <Descriptor>. Particularities: <Descriptor> values must multiples range from H'00000000 H'000000f0. some other value specified, system operation cannot guaranteed. When H'00000000 specified, performs rescheduling. This service called from task level interrupt level. allowed from hook routines, error will returned this error condition. this case, operation guaranteed. Note: operation this system service original function. Error Status: Standard Extended Conformance Class: None (original function) None (original function) BCC1, BCC2, ECC1, ECC2
Interrupt Source (when "Use source" selected page configurator) Syntax StatusType <Descriptor>) StatusType <Descriptor>)
Parameter (In): Descriptor
name ending with "_ID") which interrupts enabled. Parameter (Out): None Description: This service enables interrupts from source that corresponds given <Descriptor>. Particularities: interrupt enabled setting CPU's interruptrequest enable interrupt priority-level setting register (IPR). information values each interrupt source, Section 12.3.4. user-defined sources (CUSTOM0 CUSTOM31), Section 12.3.5. This service called from task level interrupt level. allowed from hook routines, error will returned this error condition. this case, operation guaranteed. This service does call error-hook routine even when error occurs. Note: operation this system service original function. Error Status: Standard Extended Conformance Class: error, E_OK specified interrupt enabled: E_OS_NOFUNC BCC1, BCC2, ECC1, ECC2
12.3.2.2 DisableInterrupt Interrupt-Mask Level (when "Use mask level" selected page configurator) Syntax IntDescriptorType <Descriptor>) IntDescriptorType <Descriptor>) status register value with interrupt-mask level made invalid.
Parameter (In): Descriptor
Parameter (Out): value interrupt-mask level status register which before issued DisableInterrupt. Description: This service disables interrupts below, interrupt level given <Descriptor>. Particularities: <Descriptor> values must multiples range from H'00000000 H'000000f0. some other value specified, system operation cannot guaranteed. When H'00000000 specified, interrupts enabled. specified interruptmask level already been disabled (i.e., when specified interrupt-mask level lower than level before invalid), specified value status register. This service called from task level interrupt level. allowed from hook routines, error will returned this error condition. this case, operation guaranteed. Note: operation this system service original function. Error Status: Standard Extended Conformance Class: None (original function) None (original function) BCC1, BCC2, ECC1, ECC2
Interrupt Source (when "Use source" selected page configurator) Syntax StatusType <Descriptor>) StatusType <Descriptor>)
Parameter (In): Descriptor
name ending with "_ID") which interrupts disabled. Parameter (Out): None Description: This service disables interrupts from source that corresponds given <Descriptor>. Particularities: interrupt disabled setting CPU's interruptrequest enable interrupt priority-level setting register (IPR). information values each interrupt source, Section 12.3.4. user-defined sources (CUSTOM0 CUSTOM31), Section 12.3.5. This service called from task level interrupt level. allowed from hook routines, error will returned this error condition. this case, operation guaranteed. This service does call error-hook routine even when error occurs. Note: operation this system service original function. Error Status: Standard Extended Conformance Class: error, E_OK specified interrupt been disabled: E_OS_NOFUNC BCC1, BCC2, ECC1, ECC2
12.3.2.3 GetInterruptDescriptor Interrupt-Mask Level (when "Use mask level" selected page configurator) Syntax IntDescriptiorType GetInterruptDescriptor(void) IntDescriptiorType None
Parameter (In): Parameter (Out): Status register value with current interrupt-mask level. Description: This service gets current interrupt mask level. Particularities: This service called from task level, interrupt level, some hook routines. Calls allowed from certain hook routines, error will returned such calls made. this case, operation guaranteed. Note: operation this system service original function. Error Status: Standard Extended Conformance Class: None (original function) None BCC1, BCC2, ECC1, ECC2
Interrupt Source (when "Use source" selected page configurator) Syntax StatusType <Descriptor>) StatusType <Descriptor>)
Parameter (In): Descriptor
name ending with "_ID") that acquires interrupt state. Parameter (Out): None Description: This service gets state interrupt source that corresponds given <Descriptor>. Particularities: Refers CPU's interrupt-request enable value interrupt priority-level setting register (IPR). list values that enable disable each interrupt source, Section 12.3.4. interrupt source method refer IPR, only value defined configurator valid. userdefined sources (CUSTOM0 CUSTOM31), Section 12.3.5. This service called from task level, interrupt level, some hook routines. Calls allowed from certain hook routines, error will returned such calls made. this case, operation guaranteed. This service does call error hook routine even when error occurs. Note: operation this system service original function. Error Status: Standard Extended Conformance Class: When interrupt enabled: When interrupt disabled: BCC1, BCC2, ECC1, ECC2
12.3.3 Constants IntDescriptorType Data Type
constants IntDescriptorType data type used when interrupt mask level method selected (i.e., when "Usr mask level" selected page configurator). Table 12.1 IntDescriptorType Data Constant SR_IMS00 (H'00000000) SR_IMS01 (H'00000010) SR_IMS02 (H'00000020) SR_IMS03 (H'00000030) SR_IMS04 (H'00000040) SR_IMS05 (H'00000050) SR_IMS06 (H'00000060) SR_IMS07 (H'00000070) SR_IMS08 (H'00000080) SR_IMS09 (H'00000090) SR_IMS10 (H'000000a0) SR_IMS11 (H'000000b0) SR_IMS12 (H'000000c0) SR_IMS13 (H'000000d0) SR_IMS14 (H'000000e0) SR_IMS15 (H'000000f0) Description Interrupt mask level Interrupt mask level Interrupt mask level Interrupt mask level Interrupt mask level Interrupt mask level Interrupt mask level Interrupt mask level Interrupt mask level Interrupt mask level Interrupt mask level Interrupt mask level Interrupt mask level Interrupt mask level Interrupt mask level Interrupt mask level
12.3.4 Interrupt Sources Settings
These interrupt sources settings used when interrupt source method selected (i.e., when "User source" selected page configurator). Table 12.2 Interrupt Sources Settings
Interrupt cause Vector IRQ0 IRQ1 IRQ2 IRQ3 IRQ4 IRQ5 IRQ6 IRQ7 DMAC0 DEI0 DMAC1 DEI1 DMAC2 DEI2 DMAC3 DEI3 ATU0 ITV1(ITVE6) ATU0 ITV1(ITVE7) ATU0 ITV1(ITVE8) ATU0 ITV1(ITVE9) ATU0 ITV2A(ITVE10A) ATU0 ITV2A(ITVE11A) ATU0 ITV2A(ITVE12A) ATU0 ITV2A(ITVE13A) ATU0 ITV2B(ITVE10B) ATU0 ITV2B(ITVE11B) ATU0 ITV2B(ITVE12B) ATU0 ITV2B(ITVE13B) ATU0 ICI0A ATU0 ICI0B ATU0 ICI0C ATU0 ICI0D ATU0 OVI0 ATU1 IMI1A ATU1 CMI1 ATU1 IMI1B ATU1 IMI1C ATU1 IMI1D ATU1 IMI1E ATU1 IMI1F ATU1 IMI1G ATU1 IMI1H IPRA IPRA IPRA IPRA IPRB IPRB IPRB IPRB CHCR0 CHCR1 CHCR2 CHCR3 ITVRR1 ITVRR1 ITVRR1 ITVRR1 ITVRR2A ITVRR2A ITVRR2A ITVRR2A ITVRR2B ITVRR2B ITVRR2B ITVRR2B TIER0 TIER0 TIER0 TIER0 TIER0 TIER1A TIER1B TIER1A TIER1A TIER1A TIER1A TIER1A TIER1A TIER1A Bits Bits Bits Bits Bits Bits Bits Bits (bit (bit (bit (bit ITVE6 (bit ITVE7 (bit ITVE8 (bit ITVE9 (bit ITVE10A (bit ITVE11A (bit ITVE12A (bit ITVE13A (bit ITVE10B (bit ITVE11B (bit ITVE12B (bit ITVE13B (bit ICE0A (bit ICE0B (bit ICE0C (bit ICE0D (bit OVE0 (bit IME1A (bit CME1 (bit IME1B (bit IME1C (bit IME1D (bit IME1E (bit IME1F (bit IME1G (bit IME1H (bit Register Invalid value Valid value
Table 12.2 Interrupt Sources Settings (continue)
Interrupt cause Vector ATU1 OVI1A ATU1 OVI1B ATU2 IMI2A ATU2 CMI2A ATU2 IMI2B ATU2 CMI2B ATU2 IMI2C ATU2 CMI2C ATU2 IMI2D ATU2 CMI2D ATU2 IMI2E ATU2 CMI2E ATU2 IMI2F ATU2 CMI2F ATU2 IMI2G ATU2 CMI2G ATU2 IMI2H ATU2 CMI2H ATU2 OVI2A ATU2 OVI2B ATU3 IMI3A ATU3 IMI3B ATU3 IMI3C ATU3 IMI3D ATU3 OVI3 ATU4 IMI4A ATU4 IMI4B ATU4 IMI4C ATU4 IMI4D ATU4 OVI4 ATU5 IMI5A ATU5 IMI5B ATU5 IMI5C ATU5 IMI5D ATU5 OVI5 ATU6 CMI6A ATU6 CMI6B ATU6 CMI6C ATU6 CMI6D ATU7 CMI7A ATU7 CMI7B ATU7 CMI7C ATU7 CMI7D ATU8 OSI8A ATU8 OSI8B ATU8 OSI8C TIER1A TIER1B TIER2A TIER2B TIER2A TIER2B TIER2A TIER2B TIER2A TIER2B TIER2A TIER2B TIER2A TIER2B TIER2A TIER2B TIER2A TIER2B TIER2A TIER2B TIER3 TIER3 TIER3 TIER3 TIER3 TIER3 TIER3 TIER3 TIER3 TIER3 TIER3 TIER3 TIER3 TIER3 TIER3 TIER6 TIER6 TIER6 TIER6 TIER7 TIER7 TIER7 TIER7 TIER8 TIER8 TIER8 OVE1A (bit OVE1B (bit8) IME2A (bit CME2A (bit IME2B (bit CME2B (bit IME2C (bit CME2C (bit IME2D (bit CME2D (bit IME2E (bit CME2E (bit IME2F (bit CME2F (bit IME2G (bit CME2G (bit IME2H (bit CME2H (bit OVE2A (bit OVE2B (bit IME3A (bit IME3B (bit IME3C (bit IME3D (bit OVE3 (bit IME4A (bit IME4B (bit IME4C (bit IME4D (bit OVE4 (bit IME5A (bit IME5B (bit IME5C (bit IME5D (bit OVE5 (bit CME6A (bit CME6B (bit CME6C (bit CME6D (bit CME7A (bit CME7B (bit CME7C (bit CME7D (bit OSE8A (bit OSE8B (bit OSE8C (bit Register Invalid value Valid value
Table 12.2 Interrupt Sources Settings (continue)
Interrupt cause Vector ATU8 OSI8D ATU8 OSI8E ATU8 OSI8F ATU8 OSI8G ATU8 OSI8H ATU8 OSI8I ATU8 OSI8J ATU8 OSI8K ATU8 OSI8L ATU8 OSI8M ATU8 OSI8N ATU8 OSI8O ATU8 OSI8P ATU9 CMI9A ATU9 CMI9B ATU9 CMI9C ATU9 CMI9D ATU9 CMI9E ATU9 CMI9F ATU10 CMI10A ATU10 CMI10B ATU10 ICI10A ATU10 CMI10G ATU11 IMI11A ATU11 IMI11B ATU11 OVI11 CMT0 CMTI0 A/D0 ADI0 CMT1 CMTI1 A/D1 ADI1 A/D2 ADI2 SCI0 ERI0 SCI0 RXI0 SCI0 TXI0 SCI0 TEI0 SCI1 ERI1 SCI1 RXI1 SCI1 TXI1 SCI1 TEI1 SCI2 ERI2 SCI2 RXI2 SCI2 TXI2 SCI2 TEI2 SCI3 ERI3 SCI3 RXI3 SCI3 TXI3 TIER8 TIER8 TIER8 TIER8 TIER8 TIER8 TIER8 TIER8 TIER8 TIER8 TIER8 TIER8 TIER8 TIER9 TIER9 TIER9 TIER9 TIER9 TIER9 TIER10 TIER10 TIER10 TIER10 TIER11 TIER11 TIER11 CMCSR0 ADCSR0 CMCSR1 ADCSR1 ADCSR2 SCR0 SCR0 SCR0 SCR0 SCR1 SCR1 SCR1 SCR1 SCR2 SCR2 SCR2 SCR2 SCR3 SCR3 SCR3 OSE8D (bit OSE8E (bit OSE8F (bit OSE8G (bit OSE8H (bit OSE8I (bit OSE8J (bit OSE8K (bit OSE8L (bit OSE8M (bit OSE8N (bit OSE8O (bit OSE8P (bit CME9A (bit CME9B (bit CME9C (bit CME9D (bit CME9E (bit CME9F (bit CME10A (bit CME10B (bit ICE10A (bit CME10G (bit IME11A (bit IME11B (bit OVE11 (bit CMIE (bit ADIE (bit CMIE (bit ADIE (bit ADIE (bit (bit (bit (bit TEIE (bit (bit (bit (bit TEIE (bit (bit (bit (bit TEIE (bit (bit (bit (bit Register Invalid value Valid value
Table 12.2 Interrupt Sources Settings (continue)
Interrupt cause Vector SCI3 TEI3 SCI4 ERI4 SCI4 RXI4 SCI4 TXI4 SCI4 TEI4 HCAN0 ERS0(IRR5) HCAN0 ERS0(IRR6) HCAN0 OVR0(IRR2) HCAN0 OVR0(IRR3) HCAN0 OVR0(IRR4) HCAN0 OVR0(IRR7) HCAN0 OVR0(IRR9) HCAN0 OVR0(IRR12) HCAN0 RM0(IRR1) HCAN0 SLE0(IRR8) HCAN1 ERS1(IRR5) HCAN1 ERS1(IRR6) HCAN1 OVR1(IRR2) HCAN1 OVR1(IRR3) HCAN1 OVR1(IRR4) HCAN1 OVR1(IRR7) HCAN1 OVR1(IRR9) HCAN1 OVR1(IRR12) HCAN1 RM1(IRR1) SCR3 SCR4 SCR4 SCR4 SCR4 IMR0 IMR0 IMR0 IMR0 IMR0 IMR0 IMR0 IMR0 IMR0 IMR0 TCSR IMR1 IMR1 IMR1 IMR1 IMR1 IMR1 IMR1 IMR1 IMR1 TEIE (bit (bit (bit (bit TEIE (bit IMR5 (bit IMR6 (bit IMR2 (bit IMR3 (bit IMR4 (bit IMR7 (bit IMR9 (bit IMR12 (bit IMR1 (bit IMR8 (bit (bit IMR5 (bit IMR6 (bit IMR2 (bit IMR3 (bit IMR4 (bit IMR7 (bit IMR9 (bit IMR12 (bit IMR1 (bit Register Invalid value Valid value
HCAN1 SLE1(IRR8) IMR1 IMR8 (bit Notes: Supported only SH7055 (not supported SH7052, SH7053, SH7054). interrupt level that specified page configurator.
12.3.5Functions Used Control Interrupts from User-Defined Sources
user-defined source (CUSTOM0 CUSTOM31), processing enable disable interrupts interrupt status provided normally. Therefore, when user-defined source used, processing enable interrupts EnableInterruptSource EnableInterrupt) system service _OSEKInterrupt_CUSTOMxx function interrupt Example\OSEKisc.c file. Also, processing disable interrupts DisableInterruptSource DisableInterrupt) system service processing interrupt status GetInterruptDescriptorSource GetInterruptDescriptor) system service. input parameter user-defined source function passed other hand, output parameter needs user. error code (E_OK E_OS_NOFUNC) EnableInterruptSource EnableInterrupt) DisableInterruptSource DisableInterrupt) system services, interrupt status value GetInterruptDescriptorSource GetInterruptDescriptor) system service. output parameter that been returned systemservice calling program return code each system service: EnableInterruptSource EnableInterrupt), DisableInterruptSource DisableInterrupt), GetInterruptDescriptorSource GetInterruptDescriptor).
Table 12.3 Functions Used Control Interrupts from User-Defined Source Cause name CUSTOM0 CUSTOM1 CUSTOM2 CUSTOM3 CUSTOM4 CUSTOM5 CUSTOM6 CUSTOM7 CUSTOM8 CUSTOM9 CUSTOM10 CUSTOM11 CUSTOM12 CUSTOM13 CUSTOM14 CUSTOM15 CUSTOM16 CUSTOM17 CUSTOM18 CUSTOM19 CUSTOM20 CUSTOM21 CUSTOM22 CUSTOM23 CUSTOM24 CUSTOM25 CUSTOM26 CUSTOM27 CUSTOM28 CUSTOM29 CUSTOM30 CUSTOM31 Function name _OSEKInterrupt_CUSTOM0 _OSEKInterrupt_CUSTOM1 _OSEKInterrupt_CUSTOM2 _OSEKInterrupt_CUSTOM3 _OSEKInterrupt_CUSTOM4 _OSEKInterrupt_CUSTOM5 _OSEKInterrupt_CUSTOM6 _OSEKInterrupt_CUSTOM7 _OSEKInterrupt_CUSTOM8 _OSEKInterrupt_CUSTOM9 _OSEKInterrupt_CUSTOM10 _OSEKInterrupt_CUSTOM11 _OSEKInterrupt_CUSTOM12 _OSEKInterrupt_CUSTOM13 _OSEKInterrupt_CUSTOM14 _OSEKInterrupt_CUSTOM15 _OSEKInterrupt_CUSTOM16 _OSEKInterrupt_CUSTOM17 _OSEKInterrupt_CUSTOM18 _OSEKInterrupt_CUSTOM19 _OSEKInterrupt_CUSTOM20 _OSEKInterrupt_CUSTOM21 _OSEKInterrupt_CUSTOM22 _OSEKInterrupt_CUSTOM23 _OSEKInterrupt_CUSTOM24 _OSEKInterrupt_CUSTOM25 _OSEKInterrupt_CUSTOM26 _OSEKInterrupt_CUSTOM27 _OSEKInterrupt_CUSTOM28 _OSEKInterrupt_CUSTOM29 _OSEKInterrupt_CUSTOM30 _OSEKInterrupt_CUSTOM31
specifications user-defined source function listed below. Syntax Parameter (In*): Descriptor Service StatusType <Descriptor>, DWORD<Service>)
specified this interrupt service System service (EnableInterruptSource_ID, DisableInterruptSource_ID, Parameter (Out): None Description: Carries processing various kinds user-defined interrupt sources, such enabling disabling interrupts, acquiring their status. Particularities: This service called when user-defined source specified interrupt-system service call interrupt source method. issue system service from this routine. Only category interrupts accepted during execution this routine. Therefore, execution time should kept short possible reduce period interrupt masking. reduce interrupt-mask level during execution this routine. When interrupt system-service issued with that corresponds given user-defined source, stack size used this routine should added stack size calling program (task, ISR, hook routine). error, E_OK (EnableInterruptSource_ID DisableInterruptSource_ID) When interrupt enabled: When interrupt disabled: Extended When specified interrupt enabled disabled: E_OS_NOFUNC (EnableInterruptSource_ID DisableInterruptSource_ID) BCC1, BCC2, ECC1, ECC2
Error Status: Standard
Conformance Class:
Note: sets input parameters.
12.4 Resource Management Services
12.4.1 Data Types ResourceType
Resource
12.4.2 System Services
12.4.2.1 GetResource StatusType GetResource(ResourceType <ResID>) Resource name) None This service gets <ResID> increases priority task. Services, which running task into suspended waiting state, must used while resource occupied (i.e. TerminateTask, ChainTask, WaitEvent). This service only allowed task level. Nested resource occupation must follow LIFO principle. Note: nested resource lower resource priority than outer resource, error will returned (except case RES_SCHEDULER resource). This behaviour original function. system service still executed this case. Error Status: Standard Extended
Syntax Parameter (In): ResID Parameter (Out): Description: Particularities:
error, E_OK Call from non-task level, E_OS_CALLEVEL <ResID> invalid, E_OS_ID Under <ResID> <ResID> using definition outside,
E_OS_ACCESS Incorrect nesting resource priority, E_OS_INVALID_NEST (original function) BCC1, BCC2, ECC1, ECC2
Conformance Class:
12.4.2.2
ReleaseResource StatusType ReleaseResource(ResourceType <ResID>) Resource name) None <ResID> released returned original priority. information nesting conditions, particularities GetResource. This service only allowed task level.
Syntax Parameter (In): ResID Parameter (Out): Description: Particularities:
Error Status: Standard Extended
error, E_OK Call from non-task level, E_OS_CALLEVEL <ResID> invalid, E_OS_ID Attempt release resource which occupied,
another resource released first, E_OS_NOFUNC BCC1, BCC2, ECC1, ECC2
Conformance Class:
12.5 Event Management Services
12.5.1 Data Types EventMaskType
Event mask value.
EventMaskRefType
Pointer data type EventMaskType.
12.5.2 System Services
12.5.2.1 Syntax Parameter (In): TaskID Mask Parameter (Out): Description: SetEvent StatusType SetEvent(TaskType <TaskID>, EventMaskType <Mask>) Task name) setting several events. Mask value name) events set. None event <TaskID>. <TaskID> transferred ready state waiting least event specified <Mask>. task more than event. example, task wishes event ID's 0x01 0x80, SetEvent(<TaskID>, 0x01 0x80) executed. Particularities: events event mask remain unchanged. referenced task <TaskID> must extended task. service called from tasks interrupts. Error Status: Standard Extended
error, E_OK
Call from invalid processing level, E_OS_CALLEVEL <TaskID> invalid, E_OS_ID <TaskID> extended task, E_OS_ACCESS <TaskID> suspended state, E_OS_STATE ECC1, ECC2
Conformance Class:
12.5.2.2
ClearEvent StatusType ClearEvent(EventMaskType <Mask>) Mask value name) events cleared. None events extended task calling ClearEvent cleared according event mask <Mask>. task clear more than event. example, task wishes clear event ID's 0x01 0x80, ClearEvent(0x01 0x80) executed. system service ClearEvent restricted extended tasks. service only called task level.
Syntax Parameter (In): Mask Parameter (Out): Description:
Particularities:
Error Status: Standard Extended Conformance Class:
error, E_OK. Call from non-task level, E_OS_CALLEVEL. Call from basic task, E_OS_ACCESS
ECC1, ECC2
12.5.2.3 Syntax
GetEvent StatusType GetEvent(TaskType <TaskID>, EventMaskRefType <Mask>) Task name) event reference. Event mask storage area addresses Current event mask value. This service gets current event mask value task <TaskID>. This service called from task level, interrupt level, some hook routines. referenced task <TaskID> must extended task.
Parameter (In): TaskID Mask Parameter (Out): *Mask Description: Particularities:
Error Status: Standard Extended
error, E_OK. Call from invalid processing level, E_OS_CALLEVEL <TaskID> invalid, E_OS_ID <TaskID> extended task, <TaskID> suspended state,
E_OS_ACCESS E_OS_STATE
Conformance Class:
ECC1, ECC2
12.5.2.4 WaitEvent Syntax StatusType WaitEvent(EventMaskType <Mask>) Parameter (In): Mask Mask value name) events waited for. Parameter (Out): None Description: state calling task waiting, unless least events specified <Mask> already been set. event already set, task state does change. task wait more than event. example, task waiting event ID's 0x01 0x80 occur, WaitEvent(0x01 0x80) executed. Rescheduling occurs task enters waiting state. When task occupies resource, resource needs released before calling WaitEvent system service. standard error status, when waiting event during resource occupancy, operation guaranteed. This service only called extended tasks. Error Status: Standard Extended
Particularities:
error, E_OK. Call from non-task level, E_OS_CALLEVEL Call from basic task, E_OS_ACCESS Occupying resource, E_OS_RESOURCE
ECC1, ECC2
Conformance Class:
12.6 Counter Alarm Management Services
12.6.1 Data Types TickType
Counter value.
TickRefType
Pointer data type TickType.
AlarmBaseType
Elements counter characteristics. individual elements structure are: maximum count value TickType maxallowedvalue: number counts required reach TickType ticksperbase: counter-specific unit (Not used minimum allowed number counts TickType mincycle: cyclic alarm
AlarmBaseRefType
Pointer data type AlarmBaseType.
AlarmType
Alarm
12.6.2 System Services
12.6.2.1 Syntax GetAlarmBase StatusType GetAlarmBase(AlarmType <AlarmID>, AlarmBaseRefType <Info>) Parameter (In): AlarmID Reference alarm name) Info Counter characteristics storage area addresses Parameter (Out): *Info Counter characteristics Description: service gets counter characteristics. information data type AlarmBaseType (maximum count value, number counts required reach counter-specific unit, minimum allowed number counts cyclic alarm) stored. Particularities: Allowed task level, interrupt level, some hook routines. allowed non-variant alarms. Error Status: Standard Extended Conformance Class:
error, E_OK. Call from invalid processing level, E_OS_CALLEVEL <AlarmID> invalid, E_OS_ID
BCC1, BCC2, ECC1, ECC2
12.6.2.2 Syntax
GetAlarm StatusType GetAlarm(AlarmType <AlarmID>, TickRefType <Tick>) Parameter (In): AlarmID Reference alarm name) Tick Count value storage area addresses Parameter (Out): *Tick Relative value counts before alarm <AlarmID> expires. Description: This service gets relative value counts before alarm <AlarmID> expires. Particularities: <AlarmID> use, <Tick> defined. Allowed task level, interrupt level, some hook routines. allowed non-variant alarms. Error Status: Standard
error, E_OK. <AlarmID> used, E_OS_NOFUNC Call from invalid processing level, E_OS_CALLEVEL <AlarmID> invalid, E_OS_ID
BCC1, BCC2, ECC1, ECC2
Extended Conformance Class:
12.6.2.3 Syntax
SetRelAlarm StatusType SetRelAlarm(AlarmType <AlarmID>, TickType <increment>, TickType <cycle>) Parameter (In): AlarmID Alarm name) increment Relative count value counts alarm expiration first cycle time Cycle value case cyclic alarm setting Parameter (Out): None Description: This service activates alarm <AlarmID>. After <increment> counts have elapsed, associated action (task activation event setting) executed. Particularities: single alarm set, <cycle> value must zero (0). When <increment> expiration count present count value. Alarm expiry will occur immediately; alarm will expire once counter rolled-over reached present counter value. cyclic alarm setting <cycle> value some non-zero value), alarm re-activated after expiry with relative value <cycle>. alarm already use, call will ignored error E_OS_STATE returned. Allowed task level interrupt level. allowed non-variant alarms. Error Status: Standard
error, E_OK. <AlarmID> already use, E_OS_STATE Call from invalid processing level, E_OS_CALLEVEL <AlarmID> invalid, E_OS_ID Value <increment> illegal (lower than zero, greater
than maxallowedvalue), E_OS_VALUE Value <cycle> illegal (lower than mincycle greater than maxallowedvalue), E_OS_VALUE BCC1, BCC2, ECC1, ECC2 (When alarm sets event, only ECC1 ECC2 used.)
Extended
Conformance Class:
12.6.2.4 Syntax
SetAbsAlarm StatusType SetAbsAlarm(AlarmType <AlarmID>, TickType <start>, TickType <cycle>) Parameter(In): AlarmID Alarm name) start Absolute count value counts alarm expiration first cycle time Cycle value case cyclic alarm setting Parameter(Out): None Description: This service activates alarm <AlarmID>. When <start> counts reached, associated action (task activation event setting) executed. Particularities: single alarm set, <cycle> value must zero (0). cyclic alarm setting <cycle> value some non-zero value), alarm re-activated after expiry with relative value <cycle>. alarm already use, call will ignored error E_OS_STATE returned. Allowed task level interrupt level. allowed non-variant alarms. Error Status: Standard
error, E_OK. <AlarmID> already use, E_OS_STATE Call from invalid processing level, E_OS_CALLEVEL <AlarmID> invalid, E_OS_ID Value <start> illegal (lower than zero, greater than
maxallowedvalue), E_OS_VALUE Value <cycle> illegal (lower than mincycle greater than maxallowedvalue), E_OS_VALUE BCC1, BCC2, ECC1, ECC2 (When alarm sets event, only ECC1 ECC2 used.)
Extended
Conformance Class:
12.6.2.5 CancelAlarm Syntax StatusType CancelAlarm(AlarmType <AlarmID>) Parameter (In): AlarmID Alarm name) Parameter (Out): None Description: This service cancels alarm <AlarmID> Particularities: Allowed task level interrupt level. allowed non-variant alarms. Error Status: Standard
error, E_OK. <AlarmID> used, E_OS_NOFUNC Call from invalid processing level, E_OS_CALLEVEL <AlarmID> invalid, E_OS_ID
BCC1, BCC2, ECC1, ECC2
Extended Conformance Class: 12.6.2.6 Syntax
InitialiseCounter StatusType InitialiseCounter(CounterType <CounterID>, TickType <tick>) Parameter (In): CounterID Counter name) tick Counter initial value Parameter (Out): None Description: This service initialises counter with <tick> value. Particularities: Allowed task level interrupt level. initialised, count will incremented alarm does operate. counter re-initialised. allowed non-variant alarm timer counter. Note: This system service original function. Error Status: Standard Extended
error, E_OK. Call from invalid processing level, E_OS_CALLEVEL <CounterID> invalid, E_OS_ID <tick> invalid (lower than zero greater than
maxallowedvalue), E_OS_VALUE BCC1, BCC2, ECC1, ECC2
Conformance Class:
12.6.2.7 IncrementCounter Syntax StatusType IncrementCounter(CounterType <CounterID>) Parameter (In): CounterID Counter name) Parameter (Out): None Description: This service advances count counter <CounterID> alarms expire count, actions associated with expiring alarm will performed. Particularities: Allowed task level interrupt level. call this parameter from other levels. extended error status, multiple errors occur, E_OS_MULTIPLE error returns. error detected while performing associated actions expiring alarms, service will cancel current action, will continue service execution. counter initialised, then count value will incremented. allowed non-variant alarm timer counter. issue this system service same counter from task ISR. issue this system service same counter from different interrupt mask level. system operation cannot guaranteed. Note: This system service original function. Error Status: Standard
error, E_OK. Multiple task activations, E_OS_LIMIT E_OS_STATE E_OS_LIMIT occurs more times,
E_OS_MULTIPLE
Extended
Call from invalid processing level, E_OS_CALLEVEL <CounterID> invalid, E_OS_ID Events cannot task associated with expiring
alarm suspended state, E_OS_STATE BCC1, BCC2, ECC1, ECC2
Conformance Class:
12.7 Operating System Execution Control
12.7.1 Data Types AppModeType
Application mode
12.7.2 System Services
12.7.2.1 GetActiveApplicationMode Syntax AppModeType GetActiveApplicationMode(void) Parameter (In): None Parameter (Out): Return value Application mode Description: This service gets current application mode Conformance BCC1, BCC2, ECC1, ECC2 Class: 12.7.2.2 StartOS Syntax void StartOS(AppModeType <Mode>) Parameter (In): Mode Application mode name) Parameter (Out): None Description: This service starts specific application mode. Particularities: this service called with illegal application mode, will cancel initialisation return original call. Call this system service after initialising CPU, etc. BCC1, BCC2, ECC1, ECC2
Conformance Class:
12.7.2.3 ShutdownOS Syntax StatusType ShutdownOS(StatusType <Error>) Parameter (In): Error Error classification Parameter (Out): None Description: This service shuts down Particularities: Returns StartOS call origin. This service only called from task level. Error Status: Standard return original call Extended Conformance Class:
Call from invalid processing level, E_OS_CALLEVEL
(original function) BCC1, BCC2, ECC1, ECC2
12.8 Hook Routines
12.8.1 System Services
12.8.1.1 Syntax ErrorHook void ErrorHook (StatusType <Error>, APICall <APICallId>, ContextType <ContextId>) Parameter (In*): Error Error code that occurred APICall System service which returned error (original function; refer Table A.3) ContextID Context calling program (original function; refer Table A.4) Parameter (Out): None Description: system service error occurs, this hook routine called system service. called before returning calling program. Particularities: Section 10.3 general description hook routines. Conformance BCC1, BCC2, ECC1, ECC2 Class: 12.8.1.2 PreTaskHook Syntax void PreTaskHook (void) Parameter (In*): None Parameter (Out): None Description: This hook routine called before task switch running. task running state when this hook routine called task GetTaskID). Particularities: Section 10.3 general description hook routines. Conformance BCC1, BCC2, ECC1, ECC2 Class: 12.8.1.3 PostTaskHook Syntax void PostTaskHook (TaskStateType <State>) Parameter (In*): State Reference task state (original function; refer section 12.2.3) Parameter (Out): None Description: This hook routine called after task switch ready, suspended waiting. task running state when this hook routine called task GetTaskID). Particularities: Section 10.3 general description hook routines. Conformance BCC1, BCC2, ECC1, ECC2 Class:
12.8.1.4 StartupHook Syntax void StartupHook (void) Parameter (In*): None Parameter (Out): None Description: This hook routine called initialisation before scheduler running. this time application start tasks, alarms, initialise device drivers, etc. Particularities: Section 10.3 general description hook routines. Conformance BCC1, BCC2, ECC1, ECC2 Class: 12.8.1.5 ShutdownHook Syntax void ShutdownHook (StatusType <Error>) Parameter (In*): Error Error classification Parameter (Out): None Description: This hook routine called when system service ShutdownOS been called shutdown. Particularities: Section 10.3. Conformance BCC1, BCC2, ECC1, ECC2 Class: Note: sets input parameters.
Appendix System Service Return Codes
Table System Service Return Codes System Service ActivateTask TerminateTask ChainTask Schedule GetTaskID GetTaskState EnterISR LeaveISR EnableInterrupt EnableInterruptMask (Interrupt Mask Level Method)* DisableInterrupt DsiableInterruptMask (Interrupt Mask Level Method)* GetInterruptDescriptor GetIterruptDescriptorMask (Interrupt Mask Level Method)* EnableInterrupt EnableInterruptSource (Interrupt Source Method)* DisableInterrupt DsiableInterruptSource (Interrupt Source Method)* GetInterruptDescriptor GetInterruptDescriptorSource (Interrupt Source Method)* GetResource Standard Error Status E_OK, E_OS_LIMIT* -E_OS_LIMIT* E_OK E_OK E_OK -Additional Codes Extended Error E_OS_ID,E_OS_CALLEVEL E_OS_RESOURCE, E_OS_CALLEVEL E_OS_ID, E_OS_RESOURCE, E_OS_CALLEVEL E_OS_CALLEVEL E_OS_CALLEVEL E_OS_ID, E_OS_CALLEVEL
E_OK
E_OS_NOFUNC
E_OK
E_OS_NOFUNC
E_OK
ReleaseResource SetEvent
E_OK E_OK
ClearEvent GetEvent
E_OK E_OK
E_OS_ID, E_OS_ACCESS, E_OS_CALLEVEL, E_OS_INVALID_NEST* E_OS_ID, E_OS_NOFUNC, E_OS_CALLEVEL, E_OS_ID, E_OS_ACCESS, E_OS_STATE, E_OS_CALLEVEL E_OS_ACCESS, E_OS_CALLEVEL E_OS_ID, E_OS_ACCESS, E_OS_STATE, E_OS_CALLEVEL
Table System Service Return Codes (continue) System Service Standard Error Status Additional Codes Extended Error WaitEvent E_OK E_OS_ACCESS, E_OS_RESOURCE, E_OS_CALLEVEL GetAlarmBase E_OK E_OS_ID, E_OS_CALLEVEL GetAlarm E_OK, E_OS_NOFUNC E_OS_ID, E_OS_CALLEVEL SetRelAlarm E_OK, E_OS_STATE E_OS_ID, E_OS_VALUE, E_OS_CALLEVEL SetAbsAlarm E_OK, E_OS_STATE E_OS_ID, E_OS_VALUE, E_OS_CALLEVEL CancelAlarm E_OK, E_OS_NOFUNC E_OS_ID, E_OS_CALLEVEL InitialiseCounter* E_OK E_OS_ID, E_OS_CALLEVEL, E_OS_VALUE IncrementCounter* E_OK, E_OS_LIMIT, E_OS_ID, E_OS_STATE, E_OS_MULTIPLE E_OS_CALLEVEL GetActiveApplicationMode -StartOS -ShutdownOS -E_OS_CALLEVEL* Note: Original function.
A.2.1 Return Code
Table Return Codes Error E_OK E_OS_ACCESS Description error Inadmissible access resource Referenced task extended task Call from basic task Call from invalid level invalid Multiple task activations Object resource been illegal resource release order (another resource released first) interrupt already whichever state requested (enabled disabled) Task still occupies resources Task suspended state Alarm Illegal count value (lower than zero, greater than maxallowedvalue) Illegal cycle (lower than mincycle greater than maxallowedvalue) Illegal resource nest E_OS_STATE E_OS_LIMIT occurs more times Undefined exception Illegal general instruction Illegal slot instruction address error (H'0) (H'1)
E_OS_CALLEVEL E_OS_ID E_OS_LIMIT* E_OS_NOFUNC
(H'2) (H'3) (H'4) (H'5)
E_OS_RESOURCE E_OS_STATE E_OS_VALUE
(H'6) (H'7) (H'8)
E_OS_INVALID_NEST* E_OS_MULTIPLE* E_OS_SYS_EXCEPTION* E_OS_SYS_ILLEGAL* E_OS_SYS_ILLEGAL_SLOT* E_OS_SYS_CPU_ADDRESS* Note: Original function.
(H'9) (H'a) (H'64) (H'65) (H'66) (H'67)
A.2.2 System Service
Table System Service System Service DeclareTask ActivateTask TerminateTask ChainTask Schedule GetTaskID GetTaskState EnterISR LeaveISR EnableInterrupt DisableInterrupt GetInterruptDescriptor DeclareResource GetResource ReleaseResource DeclareEvent SetEvent ClearEvent GetEvent WaitEvent DeclareAlarm GetAlarmBase GetAlarm SetRelAlarm SetAbsAlarm CancelAlarm GetActiveApplicationMode StartOS ShutdownOS InitialiseCounter* IncrementCounter* NonVariant (Non-variant alarm timer counter) EnableInterruptMask* DisableInterruptMask* GetInterruptDescriptorMask* EnableInterruptSource* DisableInterruptSource* GetInterruptDescriptorSource* Note: Original function. (H'0) (H'1) (H'2) (H'3) (H'4) (H'5) (H'6) (H'7) (H'8) (H'9) (H'a) (H'b) (H'c) (H'd) (H'e) (H'f) (H'10) (H'11) (H'12) (H'13) (H'14) (H'15) (H'16) (H'17) (H'18) (H'19) (H'1a) (H'1b) (H'1c) (H'1d) (H'1e) (H'1f) (H'20) (H'21) (H'22) (H'23) (H'24) (H'25)
A.2.3 Context
Table Context Context OS_IDLE TASK ERRORHOOK PRETASKHOOK POSTTASKHOOK SHUTDOWNHOOK STARTUPHOOK (H'0) (H'1) (H'2) (H'3) (H'4) (H'5) (H'6) (H'7) (H'8)
System Service Calls
System service that issued shown task, ISR, hook routine.
Table System Service Calls Service
ActivateTask TerminateTask ChainTask Schedule GetTaskID GetTaskState EnableInterrupt DisableInterrupt GetInterruptDescriptor GetResource ReleaseResource SetEvent ClearEvent GetEvent WaitEvent GetAlarmBase GetAlarm SetRelAlarm SetAbsAlarm CancelAlarm InitialiseCounter IncrementCounter GetActiveApplicationMode StartOS ShutdownOS EnableInterruptMask DisableInterruptMask GetInterruptDescriptorMask EnableInterruptSource DsiableInterruptSource GetInterruptDescriptorSource
Task Level
Level
Error Hook
PreTask Hook
PostTask Hook
Startup Hook
Shutdown Hook
calling program
Data Types
Table Data Types Name StatusType TaskType TaskRefType TaskStateType TaskStateRefType IntDescriptorType IntDescriptorRefType ResourceType EventMaskType EventMaskRefType TickType TickRefType AlarmBaseType AlarmBaseRefType AlarmType AppModeType CounterType APICall ContextType Data Type (size) unsigned long bytes) signed short bytes) TaskType bytes) signed char byte) TaskStateType bytes) unsigned long bytes) IntDescriptorType bytes) signed char byte) signed char byte) EventMaskType bytes) unsigned long bytes) TickType bytes) struct AlarmBase bytes) AlarmBaseType bytes) signed char byte) signed char byte) signed char byte) unsigned long bytes) unsigned long bytes) Description Return value Task Pointer TaskType Task status Pointer TaskStateType Status register value Pointer IntDescriptorType Resource Event mask value Pointer EventMaskType Counter value Pointer TickType Element counter characteristics Pointer AlarmBaseType Alarm Application mode Counter System service Context
Ho7055 Operating System Manual Publication date: Edition, 2001 Copyright Hitachi, Ltd., 1999. rights reserved. Printed Japan.

Other recent searches


ZP-5X - ZP-5X   ZP-5X Datasheet
ST7066 - ST7066   ST7066 Datasheet
PRX800 - PRX800   PRX800 Datasheet
PRX1200 - PRX1200   PRX1200 Datasheet
PRX1800 - PRX1800   PRX1800 Datasheet
PRX3000 - PRX3000   PRX3000 Datasheet
pmR209 - pmR209   pmR209 Datasheet
NE6510379A - NE6510379A   NE6510379A Datasheet
LT1464 - LT1464   LT1464 Datasheet
LT1465 - LT1465   LT1465 Datasheet
LQ150X1LGN2A - LQ150X1LGN2A   LQ150X1LGN2A Datasheet
EPT26 - EPT26   EPT26 Datasheet

 

Privacy Policy | Disclaimer
© 2012 Datasheet Archive