Azure Sphere MT3620 M4 API Reference Manual
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
os_hal_pwm.h
1 /*
2  * (C) 2005-2020 MediaTek Inc. All rights reserved.
3  *
4  * Copyright Statement:
5  *
6  * This MT3620 driver software/firmware and related documentation
7  * ("MediaTek Software") are protected under relevant copyright laws.
8  * The information contained herein is confidential and proprietary to
9  * MediaTek Inc. ("MediaTek"). You may only use, reproduce, modify, or
10  * distribute (as applicable) MediaTek Software if you have agreed to and been
11  * bound by this Statement and the applicable license agreement with MediaTek
12  * ("License Agreement") and been granted explicit permission to do so within
13  * the License Agreement ("Permitted User"). If you are not a Permitted User,
14  * please cease any access or use of MediaTek Software immediately.
15  *
16  * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
17  * THAT MEDIATEK SOFTWARE RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE
18  * PROVIDED TO RECEIVER ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS
19  * ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
21  * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
22  * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
23  * INCORPORATED IN, OR SUPPLIED WITH MEDIATEK SOFTWARE, AND RECEIVER AGREES TO
24  * LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
25  * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
26  * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
27  * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
28  * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
29  * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
30  * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO MEDIATEK SOFTWARE RELEASED
31  * HEREUNDER WILL BE ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY
32  * RECEIVER TO MEDIATEK DURING THE PRECEDING TWELVE (12) MONTHS FOR SUCH
33  * MEDIATEK SOFTWARE AT ISSUE.
34  */
35 
36 #ifndef __OS_HAL_PWM_H__
37 #define __OS_HAL_PWM_H__
38 
39 #include "mhal_pwm.h"
198 #define MAX_CHANNEL_NUM 4
199 
214 typedef enum {
223 } pwm_groups;
224 
226 typedef enum {
237 } pwms_bit_map;
251 #ifdef __cplusplus
252 extern "C" {
253 #endif
254 
269 int mtk_os_hal_pwm_ctlr_init(pwm_groups group_num, u32 channel_bit_map);
285 int mtk_os_hal_pwm_ctlr_deinit(pwm_groups group_num, u32 channel_bit_map);
304  pwm_channels pwm_num, u32 frequency, u32 duty_cycle);
305 
326  pwm_channels pwm_num,
327  bool global_kick_enable,
328  bool io_ctrl_sel,
329  bool polarity_set);
330 
345  pwm_channels pwm_num,
346  struct mtk_com_pwm_data state_config);
361  pwm_channels pwm_num,
362  struct mtk_com_pwm_data state_config);
376  pwm_channels pwm_num,
390  pwm_channels pwm_num);
403  pwm_channels pwm_num);
404 
405 #ifdef __cplusplus
406 }
407 #endif
408 
418 #endif
419 
PWM channel2 bit map.
Definition: os_hal_pwm.h:231
int mtk_os_hal_pwm_config_stay_cycle_2_state(pwm_groups group_num, pwm_channels pwm_num, struct mtk_com_pwm_data state_config)
Config 2-state stay cycle.
int mtk_os_hal_pwm_ctlr_init(pwm_groups group_num, u32 channel_bit_map)
Init PWM controller.
int mtk_os_hal_pwm_start_normal(pwm_groups group_num, pwm_channels pwm_num)
Start PWM controller.
pwms_bit_map
Defines the PWM channel bit map.
Definition: os_hal_pwm.h:226
PWM max channel bit map<invalid>
Definition: os_hal_pwm.h:235
PWM max group <invalid>
Definition: os_hal_pwm.h:221
int mtk_os_hal_pwm_ctlr_deinit(pwm_groups group_num, u32 channel_bit_map)
Deinit PWM controller.
PWM channel1 bit map.
Definition: os_hal_pwm.h:229
int mtk_os_hal_pwm_stop_normal(pwm_groups group_num, pwm_channels pwm_num)
Stop PWM controller.
PWM channel3 bit map.
Definition: os_hal_pwm.h:233
PWM group0.
Definition: os_hal_pwm.h:215
int mtk_os_hal_pwm_feature_enable(pwm_groups group_num, pwm_channels pwm_num, bool global_kick_enable, bool io_ctrl_sel, bool polarity_set)
PWM feature enable.
pwm_channels
Defines the PWM channel number.
Definition: mhal_pwm.h:180
pwm_groups
Defines the PWM group number.
Definition: os_hal_pwm.h:214
PWM group1.
Definition: os_hal_pwm.h:217
int mtk_os_hal_pwm_config_freq_duty_2_state(pwm_groups group_num, pwm_channels pwm_num, struct mtk_com_pwm_data state_config)
Config 2-state freq & duty.
int mtk_os_hal_pwm_config_freq_duty_normal(pwm_groups group_num, pwm_channels pwm_num, u32 frequency, u32 duty_cycle)
Config freq & duty.
int mtk_os_hal_pwm_config_dpsel(pwm_groups group_num, pwm_channels pwm_num, pwm_differential_select mode)
Config dpsel.
PWM group2.
Definition: os_hal_pwm.h:219
pwm_differential_select
Defines the PWM channel's differential mode.
Definition: mhal_pwm.h:166
PWM channel0 bit map.
Definition: os_hal_pwm.h:227
Used to store the PWM base address, group number, clock source, pwm channel common structure informat...
Definition: mhal_pwm.h:226