1 /*
2  * Copyright (c) 2017-2018 Arm Limited
3  * Copyright (c) 2020, Cypress Semiconductor Corporation. All rights reserved.
4  *
5  * Licensed under the Apache License Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing software
12  * distributed under the License is distributed on an "AS IS" BASIS
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 /**
19  * \file device_definition.h
20  * \brief The structure definitions in this file are exported based on the peripheral
21  * definitions from device_cfg.h.
22  * This retarget file is meant to be used as a helper for baremetal
23  * applications and/or as an example of how to configure the generic
24  * driver structures.
25  */
26 
27 #ifndef __DEVICE_DEFINITION_H__
28 #define __DEVICE_DEFINITION_H__
29 
30 #include "cy_scb_uart.h"
31 #include "device_cfg.h"
32 
33 
34 /* ======= Defines peripheral configuration structures ======= */
35 /* ======= and includes generic driver headers if necessary ======= */
36 /* UART config */
37 extern const cy_stc_scb_uart_config_t KITPROG_UART_config;
38 
39 /* CMSDK Timer driver structures */
40 #ifdef CMSDK_TIMER0_S
41 #include "timer_cmsdk_drv.h"
42 extern struct timer_cmsdk_dev_t CMSDK_TIMER0_DEV_S;
43 #endif
44 #ifdef CMSDK_TIMER0_NS
45 #include "timer_cmsdk_drv.h"
46 extern struct timer_cmsdk_dev_t CMSDK_TIMER0_DEV_NS;
47 #endif
48 
49 #ifdef CMSDK_TIMER1_S
50 #include "timer_cmsdk_drv.h"
51 extern struct timer_cmsdk_dev_t CMSDK_TIMER1_DEV_S;
52 #endif
53 #ifdef CMSDK_TIMER1_NS
54 #include "timer_cmsdk_drv.h"
55 extern struct timer_cmsdk_dev_t CMSDK_TIMER1_DEV_NS;
56 #endif
57 
58 #if defined(CY_TCPWM0_TIMER0_S) || defined(CY_TCPWM0_TIMER1_NS)
59 #include "cy_tcpwm_counter.h"
60 typedef struct tfm_timer_irq_test_dev {
61     bool        is_initialized;
62     TCPWM_Type *tcpwm_base;
63     uint32_t    tcpwm_counter_num;
64     uint32_t    timer_match_value;
65     cy_stc_tcpwm_counter_config_t   *tcpwm_config;
66 } tfm_timer_irq_test_dev_t;
67 #endif
68 #ifdef CY_TCPWM0_TIMER0_S
69 #include "cy_sysint.h"
70 extern cy_stc_sysint_t CY_TCPWM_NVIC_CFG_S;
71 extern void TFM_TIMER0_IRQ_Handler(void);
72 extern tfm_timer_irq_test_dev_t CY_TCPWM0_TIMER0_DEV_S;
73 #define TIMER0_MATCH (1000000 / 8)  /* About 1 seconds (CM0+: 50MHz) */
74 #endif
75 #ifdef CY_TCPWM0_TIMER1_NS
76 extern tfm_timer_irq_test_dev_t CY_TCPWM0_TIMER1_DEV_NS;
77 #define TIMER1_MATCH (1000000 / 8)  /* About 2 seconds (CM4: 100MHz) */
78 #endif
79 
80 #endif  /* __DEVICE_DEFINITION_H__ */
81