1 /***********************************************************************************************//**
2  * \file cyabs_rtos_impl_cat5.h
3  *
4  * \brief
5  * Internal definitions for RTOS abstraction layer specific to CAT5.
6  ***************************************************************************************************
7  * \copyright
8  * Copyright 2018-2022 Cypress Semiconductor Corporation (an Infineon company) or
9  * an affiliate of Cypress Semiconductor Corporation
10  *
11  * SPDX-License-Identifier: Apache-2.0
12  *
13  * Licensed under the Apache License, Version 2.0 (the "License");
14  * you may not use this file except in compliance with the License.
15  * You may obtain a copy of the License at
16  *
17  *     http://www.apache.org/licenses/LICENSE-2.0
18  *
19  * Unless required by applicable law or agreed to in writing, software
20  * distributed under the License is distributed on an "AS IS" BASIS,
21  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22  * See the License for the specific language governing permissions and
23  * limitations under the License.
24  **************************************************************************************************/
25 
26 #pragma once
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 #include <stdbool.h>
33 #include "tx_api.h"
34 #include "cyhal_system.h"
35 
36 
37 /******************************************************
38 *                 Type Definitions
39 ******************************************************/
40 #if defined (CYW55500A0)
41 // RTOS thread priority. Main thread priority is 24.
42 typedef enum
43 {
44     CY_RTOS_PRIORITY_MIN         = 0,   /**< Minimum allowable Thread priority */
45     CY_RTOS_PRIORITY_LOW         = 1,   /**< A low priority Thread */
46     CY_RTOS_PRIORITY_BELOWNORMAL = 2,   /**< A slightly below normal Thread priority */
47     CY_RTOS_PRIORITY_NORMAL      = 3,   /**< The normal Thread priority */
48     CY_RTOS_PRIORITY_ABOVENORMAL = 4,   /**< A slightly elevated Thread priority */
49     CY_RTOS_PRIORITY_HIGH        = 5,   /**< A high priority Thread */
50     CY_RTOS_PRIORITY_REALTIME    = 6,   /**< Realtime Thread priority */
51     CY_RTOS_PRIORITY_MAX         = 7    /**< Maximum allowable Thread priority */
52 } cy_thread_priority_t;
53 #else // if defined (CYW55500A0)
54 #if defined (CYW55500A1) //Main thread priority is 24.Range from 24-31
55 #define MULTIPLY_FACTOR     (1U)
56 #else
57 #define MULTIPLY_FACTOR     (3U) //Main thread priority is 10.Range from 10-31
58 #endif
59 // RTOS thread priority.
60 typedef enum
61 {
62     CY_RTOS_PRIORITY_MIN         = (TX_MAX_PRIORITIES-1),                           /**< Minimum
63                                                                                        allowable
64                                                                                        Thread
65                                                                                         priority */
66     CY_RTOS_PRIORITY_LOW         = ((TX_MAX_PRIORITIES-1) - (MULTIPLY_FACTOR*1)),   /**< A low
67                                                                                        priority
68                                                                                        Thread */
69     CY_RTOS_PRIORITY_BELOWNORMAL = ((TX_MAX_PRIORITIES-1) - (MULTIPLY_FACTOR*2)),   /**< A slightly
70                                                                                        below normal
71                                                                                         Thread
72                                                                                            priority
73                                                                                      */
74     CY_RTOS_PRIORITY_NORMAL      = ((TX_MAX_PRIORITIES-1) - (MULTIPLY_FACTOR*3)),   /**< The normal
75                                                                                        Thread
76                                                                                         priority */
77     CY_RTOS_PRIORITY_ABOVENORMAL = ((TX_MAX_PRIORITIES-1) - (MULTIPLY_FACTOR*4)),   /**< A slightly
78                                                                                        elevated
79                                                                                         Thread
80                                                                                            priority
81                                                                                      */
82     CY_RTOS_PRIORITY_HIGH        = ((TX_MAX_PRIORITIES-1) - (MULTIPLY_FACTOR*5)),   /**< A high
83                                                                                        priority
84                                                                                        Thread */
85     CY_RTOS_PRIORITY_REALTIME    = ((TX_MAX_PRIORITIES-1) - (MULTIPLY_FACTOR*6)),   /**< Realtime
86                                                                                        Thread
87                                                                                        priority
88                                                                                      */
89     CY_RTOS_PRIORITY_MAX         = ((TX_MAX_PRIORITIES-1) - (MULTIPLY_FACTOR*7))    /**< Maximum
90                                                                                        allowable
91                                                                                        Thread
92                                                                                         priority */
93 } cy_thread_priority_t;
94 #endif // if defined (CYW55500)
95 
96 #if defined(__cplusplus)
97 }
98 #endif
99