1 /*
2  * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef _HARDWARE_STRUCTS_PWM_H
8 #define _HARDWARE_STRUCTS_PWM_H
9 
10 #include "hardware/address_mapped.h"
11 #include "hardware/platform_defs.h"
12 #include "hardware/regs/pwm.h"
13 
14 typedef struct pwm_slice_hw {
15     io_rw_32 csr;
16     io_rw_32 div;
17     io_rw_32 ctr;
18     io_rw_32 cc;
19     io_rw_32 top;
20 } pwm_slice_hw_t;
21 
22 typedef struct {
23     pwm_slice_hw_t slice[NUM_PWM_SLICES];
24     io_rw_32 en;
25     io_rw_32 intr;
26     io_rw_32 inte;
27     io_rw_32 intf;
28     io_rw_32 ints;
29 } pwm_hw_t;
30 
31 #define pwm_hw ((pwm_hw_t *const)PWM_BASE)
32 
33 #endif
34