| Electronic Components Datasheet Search |
|
AN3350 Datasheet(PDF) 177 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN3350 Datasheet(HTML) 177 Page - STMicroelectronics |
|
177 / 185 page ![]() AN3350 eTPU specific features Doc ID 018512 Rev 2 177/185 23.3 eTPU functions structure eTPU functions have a special structure. An eTPU function consists of several threads. A thread is executed when the eTPU scheduler assigns execution to it. Using the special structure the programmer can associate each thread's code with different conditions in the entry table. The special structure of an eTPU function inludes the following elements: ● A #pragma ETPU_function declaration. ● A void function. ● In the main scope of the function, a series of if()/else statements, each testing one or more elements of the channel condition see restrictions below. – - hsr - Host service request 0..7 – - lsr - Link service request 0/1 – - m1 - Match1/Transition2 0/1 – - m2 - Match2/Transition1 0/1 – - pin - Input pin 0/1 – - flag0 0/1 – - flag1 0/1 The threads code itself resides between these if then elses. Using the conditions the compiler associates the thread's code with the correct entry points. A final else (without if) should be present at the end of this structure to collect all the unused entry points. A warning shall be issued if that else shall be omitted by the user. In the thread's condition expression, usage of constants is allowed as well as the following operators: ==, !=, &&, ||, !. There are restrictions on both possible conditions and the order in which they may occur. The following notes give details: ● In expressions that do not explicitly test hsr, an implicit test of hsr==0 is assumed. ● The compiler would issue an error message if the condition expression is not valid given the entry table that was chosen in the ETPU_function pragma. If there is an x in the column of a condition in the table in all qualified entries, the condition cannot be tested in that expression. For example the statement – if (lsr && pin) is legal because after evaluating lsr==1 we have entries 10,11,24-31 qualified and in some of them pin has a specific value. ● But, if (lsr && m1 && pin) is not valid since lsr && m1 qualifies 10,11,30,31 and in all of them pin has an X value and therefore none of them might be selected. ● The order of the conditions and events should be as follows. There are 3 groups. Identifiers from a lower group number should appear first. There is no order that should be enforced within the group: a) hsr b) lsr, m1,m2 c) pin, flag0, flag1 An error should be generated when appropriate. The order of the if then else blocks counts: |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |