1 // Copyright 2019 Espressif Systems (Shanghai) PTE LTD
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //     http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #pragma once
16 
17 #include "soc/soc_caps.h"
18 #include "soc/mcpwm_reg.h"
19 #include "soc/mcpwm_struct.h"
20 #include "soc/periph_defs.h"
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 typedef struct {
27     struct {
28         const periph_module_t module; // Peripheral module
29         const int irq_id;
30         struct {
31             struct {
32                 const uint32_t pwm_sig;
33             } generators[SOC_MCPWM_GENERATORS_PER_OPERATOR];
34         } operators[SOC_MCPWM_OPERATORS_PER_GROUP];
35         struct {
36             const uint32_t fault_sig;
37         } gpio_faults[SOC_MCPWM_GPIO_FAULTS_PER_GROUP];
38         struct {
39             const uint32_t cap_sig;
40         } captures[SOC_MCPWM_CAPTURE_CHANNELS_PER_TIMER];
41         struct {
42             const uint32_t sync_sig;
43         } gpio_synchros[SOC_MCPWM_GPIO_SYNCHROS_PER_GROUP];
44     } groups[SOC_MCPWM_GROUPS];
45 } mcpwm_signal_conn_t;
46 
47 extern const mcpwm_signal_conn_t mcpwm_periph_signals;
48 
49 #ifdef __cplusplus
50 }
51 #endif
52