HPM SDK
HPMicro Software Development Kit
hpm_pwmv2_drv.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2023 HPMicro
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 
8 #ifndef HPM_PWMV2_DRV_H
9 #define HPM_PWMV2_DRV_H
10 
11 #include "hpm_common.h"
12 #include "hpm_pwmv2_regs.h"
13 #include "hpm_soc_feature.h"
14 
15 
23 #define PWM_UNLOCK_KEY (0xB0382607UL)
24 #define PWM_CMP_UNABLE_OUTPUT_INDEX (16)
25 
26 /* IRQ enable bit mask */
27 #define PWM_IRQ_FAULT PWM_IRQEN_FAULTIRQE_MASK
28 #define PWM_IRQ_EX_RELOAD PWM_IRQEN_XRLDIRQE_MASK
29 #define PWM_IRQ_HALF_RELOAD PWM_IRQEN_HALFRLDIRQE_MASK
30 #define PWM_IRQ_RELOAD PWM_IRQEN_RLDIRQE_MASK
31 #define PWM_IRQ_CMP(x) PWM_IRQEN_CMPIRQEX_SET((1 << x))
32 
33 /* PWM force output mask */
34 #define PWM_FORCE_OUTPUT(pwm_index, force_output) \
35  (force_output << (pwm_index << 1))
36 
37 #define PWM_DUTY_CYCLE_FP_MAX ((1U << 24) - 1)
38 
39 #ifndef PWMV2_SOC_CAL_COUNT_MAX
40  #define PWMV2_SOC_CAL_COUNT_MAX 8
41 #endif
42 
43 #define PWMV2_SHADOW_INDEX(x) PWMV2_SHADOW_VAL_##x
44 #define PWMV2_CMP_INDEX(x) PWMV2_CMP_VAL_WORK_##x
45 #define PWMV2_CALCULATE_INDEX(x) PWMV2_CAL_##x
46 #define PWMV2_CAL_SHADOW_OFFSET_ZERO (31)
47 
48 typedef enum {
54 
55 typedef enum {
65 
66 
67 typedef enum {
73 
74 
79 typedef enum {
85 
86 typedef enum {
91 
92 typedef enum {
96 
97 typedef enum {
101 
102 typedef enum {
108 
109 typedef enum {
115 
116 
117 typedef enum {
123 
128 typedef enum {
134 
135 typedef enum {
141 
142 typedef enum {
146 
147 typedef enum {
152 } pwm_dma_chn_t;
153 
154 typedef enum {
163 
164 typedef enum {
170  cmp_value_ffffff00 = 0x3f
172 
177 typedef struct pwmv2_cmp_config {
178  uint32_t cmp;
184  uint8_t mode;
187  uint8_t hrcmp;
189 
198 
203 typedef struct pwmv2_config {
212  uint8_t update_trigger;
213  uint8_t fault_mode;
222 
227 typedef struct pwmv2_pair_config {
230 
231 typedef struct pwmv2_cmp_calculate_cfg {
232  uint8_t counter_index;
233  uint8_t in_index;
234  uint8_t in_offset_index;
235  int8_t t_param;
236  int8_t d_param;
244 
245 
246 #ifdef __cplusplus
247 extern "C" {
248 #endif
249 
256 void pwmv2_deinit(PWMV2_Type *pwm_x);
257 
264 {
266 }
267 
273 static inline void pwmv2_shadow_register_lock(PWMV2_Type *pwm_x)
274 {
276 }
277 
285 static inline void pwmv2_set_counter_reload_trigmux_index(PWMV2_Type *pwm_x, pwm_counter_t counter, uint8_t trig_index)
286 {
287  pwm_x->CNT[counter].CFG2 = (pwm_x->CNT[counter].CFG2 & ~PWMV2_CNT_CFG2_CNT_RELOAD_TRIG_MASK) | PWMV2_CNT_CFG2_CNT_RELOAD_TRIG_SET(trig_index);
288 }
289 
296 static inline void pwmv2_enable_multi_counter_sync(PWMV2_Type *pwm_x, uint8_t mask)
297 {
299  fencerw();
301 }
302 
309 static inline void pwmv2_start_pwm_output_sync(PWMV2_Type *pwm_x, uint8_t mask)
310 {
312 }
313 
319 static inline void pwmv2_shadow_register_unlock(PWMV2_Type *pwm_x)
320 {
321  pwm_x->WORK_CTRL0 = PWM_UNLOCK_KEY;
322 }
323 
330 static inline void pwmv2_shadow_unlock_bit_mask(PWMV2_Type *pwm_x, uint32_t mask)
331 {
332  pwm_x->UNLOCK = mask;
333 }
334 
344 static inline void pwmv2_set_shadow_val(PWMV2_Type *pwm_x, uint8_t index, uint32_t value, uint8_t high_resolution_tick, bool enable_half_cycle)
345 {
346  pwm_x->SHADOW_VAL[index] = PWMV2_SHADOW_VAL_VALUE_SET(((value << 8) | (enable_half_cycle << 7) | (high_resolution_tick)));
347 }
348 
357 static inline void pwmv2_force_output(PWMV2_Type *pwm_x, pwm_channel_t chn, pwm_force_mode_t mode, bool invert)
358 {
359  pwm_x->FORCE_MODE = (pwm_x->FORCE_MODE & ~(PWMV2_FORCE_MODE_POLARITY_SET((1 << (chn << 1))) | PWMV2_FORCE_MODE_FORCE_MODE_SET((3 << (chn << 1))))) |
360  PWMV2_FORCE_MODE_POLARITY_SET((invert << (chn << 1))) |
361  PWMV2_FORCE_MODE_FORCE_MODE_SET((mode << (chn << 1)));
362 }
363 
370 static inline void pwmv2_enable_four_cmp(PWMV2_Type *pwm_x, pwm_channel_t chn)
371 {
372  pwm_x->PWM[chn].CFG0 |= PWMV2_PWM_CFG0_TRIG_SEL4_MASK;
373 }
374 
381 static inline void pwmv2_disable_four_cmp(PWMV2_Type *pwm_x, pwm_channel_t chn)
382 {
383  pwm_x->PWM[chn].CFG0 &= ~PWMV2_PWM_CFG0_TRIG_SEL4_MASK;
384 }
385 
393 static inline void pwmv2_fault_signal_select_from_pad(PWMV2_Type *pwm_x, pwm_channel_t chn, uint8_t pad_index)
394 {
395  pwm_x->PWM[chn].CFG0 = (pwm_x->PWM[chn].CFG0 & ~PWMV2_PWM_CFG0_FAULT_SEL_ASYNC_MASK) | PWMV2_PWM_CFG0_FAULT_SEL_ASYNC_SET(pad_index);
396 }
397 
406 {
407  pwm_x->PWM[chn].CFG0 = (pwm_x->PWM[chn].CFG0 & ~PWMV2_PWM_CFG0_FAULT_POL_ASYNC_MASK) | PWMV2_PWM_CFG0_FAULT_POL_ASYNC_SET(polarity);
408 }
409 
416 static inline void pwmv2_enable_fault_from_pad(PWMV2_Type *pwm_x, pwm_channel_t chn)
417 {
419 }
420 
428 {
430 }
431 
439 {
441 }
442 
450 {
452 }
453 
460 static inline void pwmv2_enable_output_invert(PWMV2_Type *pwm_x, pwm_channel_t chn)
461 {
463 }
464 
471 static inline void pwmv2_disable_output_invert(PWMV2_Type *pwm_x, pwm_channel_t chn)
472 {
473  pwm_x->PWM[chn].CFG0 &= ~PWMV2_PWM_CFG0_OUT_POLARITY_MASK;
474 }
475 
484 {
486  pwm_x->PWM[chn].CFG0 = (pwm_x->PWM[chn].CFG0 & ~PWMV2_PWM_CFG0_POL_UPDATE_SEL_MASK) | PWMV2_PWM_CFG0_POL_UPDATE_SEL_SET(update_select);
487 }
488 
496 {
498 }
499 
506 static inline void pwmv2_channel_enable_output(PWMV2_Type *pwm_x, pwm_channel_t chn)
507 {
508  pwm_x->PWM[chn].CFG1 |= PWMV2_PWM_CFG1_HIGHZ_EN_N_MASK;
509 }
510 
518 {
519  pwm_x->PWM[chn].CFG1 &= ~PWMV2_PWM_CFG1_HIGHZ_EN_N_MASK;
520 }
521 
530 {
531  pwm_x->PWM[chn].CFG1 = (pwm_x->PWM[chn].CFG1 & ~PWMV2_PWM_CFG1_FORCE_UPDATE_TIME_MASK) | PWMV2_PWM_CFG1_FORCE_UPDATE_TIME_SET(update_time);
532 }
533 
541 static inline void pwmv2_set_fault_mode(PWMV2_Type *pwm_x, pwm_channel_t chn, pwm_fault_mode_t mode)
542 {
543  pwm_x->PWM[chn].CFG1 = (pwm_x->PWM[chn].CFG1 & ~PWMV2_PWM_CFG1_FAULT_MODE_MASK) | PWMV2_PWM_CFG1_FAULT_MODE_SET(mode);
544 }
545 
554 {
556 }
557 
565 {
566  pwm_x->PWM[chn].CFG1 &= ~PWMV2_PWM_CFG1_SW_FORCE_EN_MASK;
567 }
568 
576 {
578 }
579 
587 {
588  pwm_x->PWM[chn].CFG1 &= ~PWMV2_PWM_CFG1_SW_FORCE_EN_MASK;
589 }
590 
597 static inline void pwmv2_enable_pair_mode(PWMV2_Type *pwm_x, pwm_channel_t chn)
598 {
599  pwm_x->PWM[chn].CFG1 |= PWMV2_PWM_CFG1_PAIR_MODE_MASK;
600 }
601 
608 static inline void pwmv2_disable_pair_mode(PWMV2_Type *pwm_x, pwm_channel_t chn)
609 {
610  pwm_x->PWM[chn].CFG1 &= ~PWMV2_PWM_CFG1_PAIR_MODE_MASK;
611 }
612 
621 {
622  pwm_x->PWM[chn].CFG1 = (pwm_x->PWM[chn].CFG1 & ~PWMV2_PWM_CFG1_PWM_LOGIC_MASK) | PWMV2_PWM_CFG1_PWM_LOGIC_SET(logic);
623 }
624 
633 {
634  pwm_x->PWM[chn].CFG1 = (pwm_x->PWM[chn].CFG1 & ~PWMV2_PWM_CFG1_FORCE_TIME_MASK) | PWMV2_PWM_CFG1_FORCE_TIME_SET(time);
635 }
636 
644 static inline void pwmv2_trig_force_mode_select_trigmux_index(PWMV2_Type *pwm_x, pwm_channel_t chn, uint8_t trigmux_index)
645 {
646  pwm_x->PWM[chn].CFG1 = (pwm_x->PWM[chn].CFG1 & ~PWMV2_PWM_CFG1_FORCE_TRIG_SEL_MASK) | PWMV2_PWM_CFG1_FORCE_TRIG_SEL_SET(trigmux_index);
647 }
648 
656 static inline void pwmv2_trig_force_hardware_or_software_select_trigmux_index(PWMV2_Type *pwm_x, pwm_channel_t chn, uint8_t trigmux_index)
657 {
658  pwm_x->PWM[chn].CFG1 = (pwm_x->PWM[chn].CFG1 & ~PWMV2_PWM_CFG1_FORCE_ACT_SEL_MASK) | PWMV2_PWM_CFG1_FORCE_ACT_SEL_SET(trigmux_index);
659 }
660 
668 static inline void pwmv2_select_force_trigmux_index(PWMV2_Type *pwm_x, pwm_channel_t chn, uint8_t trigmux_index)
669 {
670  pwm_x->PWM[chn].CFG1 = (pwm_x->PWM[chn].CFG1 & ~PWMV2_PWM_CFG1_PWM_FORCE_SEL_MASK) | PWMV2_PWM_CFG1_PWM_FORCE_SEL_SET(trigmux_index);
671 }
672 
680 static inline void pwmv2_select_recovery_fault_trigmux_index(PWMV2_Type *pwm_x, pwm_channel_t chn, uint8_t trigmux_index)
681 {
682  pwm_x->PWM[chn].CFG1 = (pwm_x->PWM[chn].CFG1 & ~PWMV2_PWM_CFG1_FAULT_REC_SEL_MASK) | PWMV2_PWM_CFG1_FAULT_REC_SEL_SET(trigmux_index);
683 }
684 
692 static inline void pwmv2_set_dead_area(PWMV2_Type *pwm_x, pwm_channel_t chn, uint32_t dead)
693 {
694  pwm_x->PWM[chn].DEAD_AREA = PWMV2_PWM_DEAD_AREA_DEAD_AREA_SET((dead << 8));
695 }
696 
704 static inline void pwmv2_set_trigout_cmp_index(PWMV2_Type *pwm_x, pwm_channel_t trigmux_chn, uint8_t cmp_index)
705 {
706  pwm_x->TRIGGER_CFG[trigmux_chn] = (pwm_x->TRIGGER_CFG[trigmux_chn] & ~PWMV2_TRIGGER_CFG_TRIGGER_OUT_SEL_MASK) | PWMV2_TRIGGER_CFG_TRIGGER_OUT_SEL_SET(cmp_index);
707 }
708 
715 static inline void pwmv2_enable_software_force(PWMV2_Type *pwm_x, pwm_channel_t chn)
716 {
717  pwm_x->GLB_CTRL |= PWMV2_GLB_CTRL_SW_FORCE_SET((1 << chn));
718 }
719 
727 {
728  pwm_x->GLB_CTRL &= ~(PWMV2_GLB_CTRL_SW_FORCE_SET((1 << chn)));
729 }
730 
731 #ifdef PWM_SOC_HRPWM_SUPPORT
732 
739 static inline void pwmv2_add_delay_tick_after_dead_area(PWMV2_Type *pwm_x, uint8_t delay_tick)
740 {
742 }
743 
749 static inline void pwmv2_enable_hrpwm(PWMV2_Type *pwm_x)
750 {
752 }
753 
759 static inline void pwmv2_disable_hrpwm(PWMV2_Type *pwm_x)
760 {
762 }
763 
764 #endif
765 
772 static inline void pwmv2_enable_software_dac_mode(PWMV2_Type *pwm_x, pwm_dac_channel_t dac_index)
773 {
774  pwm_x->GLB_CTRL2 |= PWMV2_GLB_CTRL2_DAC_SW_MODE_SET((1 << dac_index));
775 }
776 
783 static inline void pwmv2_disable_software_dac_mode(PWMV2_Type *pwm_x, pwm_dac_channel_t dac_index)
784 {
785  pwm_x->GLB_CTRL2 &= ~PWMV2_GLB_CTRL2_DAC_SW_MODE_SET((1 << dac_index));
786 }
787 
793 static inline void pwmv2_enable_debug_mode(PWMV2_Type *pwm_x)
794 {
796 }
797 
798 
804 static inline void pwmv2_disable_debug_mode(PWMV2_Type *pwm_x)
805 {
807 }
808 
815 static inline void pwmv2_clear_fault_event(PWMV2_Type *pwm_x, pwm_channel_t chn)
816 {
818 }
819 
826 {
828 }
829 
836 {
838 }
839 
847 static inline uint32_t pwmv2_get_counter_working_status(PWMV2_Type *pwm_x, pwm_counter_t counter_index)
848 {
849  return PWMV2_CNT_RELOAD_WORK_VALUE_GET(pwm_x->CNT_RELOAD_WORK[counter_index]);
850 }
851 
859 static inline uint32_t pwmv2_get_cmp_working_status(PWMV2_Type *pwm_x, uint8_t cmp_index)
860 {
861  return PWMV2_CMP_VAL_WORK_VALUE_GET(pwm_x->CMP_VAL_WORK[cmp_index]);
862 }
863 
870 static inline uint32_t pwmv2_get_force_working_status(PWMV2_Type *pwm_x)
871 {
873 }
874 
882 {
884 }
885 
893 static inline uint32_t pwmv2_get_counter_value(PWMV2_Type *pwm_x, pwm_counter_t counter_index)
894 {
895  return PWMV2_CNT_VAL_VALUE_GET(pwm_x->CNT_VAL[counter_index]);
896 }
897 
905 static inline void pwmv2_set_dac_value(PWMV2_Type *pwm_x, pwm_dac_channel_t dac_index, uint32_t value)
906 {
907  pwm_x->DAC_VALUE_SV[dac_index] = PWMV2_DAC_VALUE_SV_VALUE_SET(value);
908 }
909 
917 static inline uint32_t pwmv2_get_capture_posedge_value(PWMV2_Type *pwm_x, pwm_channel_t chn)
918 {
920 }
921 
930 {
931  pwm_x->CAPTURE_POS[chn] = (pwm_x->CAPTURE_POS[chn] & ~PWMV2_CAPTURE_POS_CAPTURE_SELGPIO_MASK) |
933 }
934 
942 static inline void pwmv2_set_capture_counter_index(PWMV2_Type *pwm_x, pwm_channel_t chn, uint8_t counter_index)
943 {
944  pwm_x->CAPTURE_POS[chn] = (pwm_x->CAPTURE_POS[chn] & ~PWMV2_CAPTURE_POS_CNT_INDEX_MASK) |
945  PWMV2_CAPTURE_POS_CNT_INDEX_SET(counter_index);
946 }
947 
955 static inline uint32_t pwmv2_get_capture_negedge_value(PWMV2_Type *pwm_x, pwm_channel_t chn)
956 {
958 }
959 
966 static inline uint32_t pwmv2_get_irq_status_all(PWMV2_Type *pwm_x)
967 {
968  return pwm_x->IRQ_STS;
969 }
970 
977 {
979 }
980 
987 {
989 }
990 
997 {
999 }
1000 
1007 static inline uint32_t pwmv2_get_cmp_irq_status(PWMV2_Type *pwm_x)
1008 {
1010 }
1011 
1018 static inline void pwmv2_clear_cmp_irq_status(PWMV2_Type *pwm_x, uint32_t mask)
1019 {
1021 }
1022 
1029 static inline uint32_t pwmv2_get_reload_irq_status(PWMV2_Type *pwm_x)
1030 {
1032 }
1033 
1040 static inline void pwmv2_clear_reload_irq_status(PWMV2_Type *pwm_x, uint32_t mask)
1041 {
1043 }
1044 
1051 static inline uint32_t pwmv2_get_capture_posedge_irq_status(PWMV2_Type *pwm_x)
1052 {
1054 }
1055 
1062 static inline void pwmv2_clear_capture_posedge_irq_status(PWMV2_Type *pwm_x, uint32_t mask)
1063 {
1065 }
1066 
1073 static inline uint32_t pwmv2_get_capture_negedge_irq_status(PWMV2_Type *pwm_x)
1074 {
1076 }
1077 
1084 static inline void pwmv2_clear_capture_negedge_irq_status(PWMV2_Type *pwm_x, uint32_t mask)
1085 {
1087 }
1088 
1095 static inline uint32_t pwmv2_get_fault_irq_status(PWMV2_Type *pwm_x)
1096 {
1098 }
1099 
1106 static inline void pwmv2_clear_fault_irq_status(PWMV2_Type *pwm_x, uint32_t mask)
1107 {
1109 }
1110 
1117 static inline uint32_t pwmv2_get_burstend_irq_status(PWMV2_Type *pwm_x)
1118 {
1120 }
1121 
1128 static inline void pwmv2_clear_burstend__irq_status(PWMV2_Type *pwm_x, uint32_t mask)
1129 {
1131 }
1132 
1139 static inline void pwmv2_enable_cmp_irq(PWMV2_Type *pwm_x, uint8_t cmp_index)
1140 {
1141  pwm_x->IRQ_EN_CMP |= PWMV2_IRQ_EN_CMP_IRQ_EN_CMP_SET(1 << cmp_index);
1142 }
1143 
1150 static inline void pwmv2_disable_cmp_irq(PWMV2_Type *pwm_x, uint8_t cmp_index)
1151 {
1152  pwm_x->IRQ_EN_CMP &= ~PWMV2_IRQ_EN_CMP_IRQ_EN_CMP_SET(1 << cmp_index);
1153 }
1154 
1161 static inline void pwmv2_enable_reload_irq(PWMV2_Type *pwm_x, pwm_counter_t counter_index)
1162 {
1163  pwm_x->IRQ_EN_RELOAD |= PWMV2_IRQ_EN_RELOAD_IRQ_EN_RELOAD_SET(1 << counter_index);
1164 }
1165 
1172 static inline void pwmv2_disable_reload_irq(PWMV2_Type *pwm_x, pwm_counter_t counter_index)
1173 {
1174  pwm_x->IRQ_EN_RELOAD &= ~PWMV2_IRQ_EN_RELOAD_IRQ_EN_RELOAD_SET(1 << counter_index);
1175 }
1176 
1183 static inline void pwmv2_enable_capture_posedge_irq(PWMV2_Type *pwm_x, pwm_channel_t channel_index)
1184 {
1185  pwm_x->IRQ_EN_CAP_POS |= PWMV2_IRQ_EN_CAP_POS_IRQ_EN_CAP_POS_SET(1 << channel_index);
1186 }
1187 
1194 static inline void pwmv2_disable_capture_posedge_irq(PWMV2_Type *pwm_x, pwm_channel_t channel_index)
1195 {
1196  pwm_x->IRQ_EN_CAP_POS &= ~PWMV2_IRQ_EN_CAP_POS_IRQ_EN_CAP_POS_SET(1 << channel_index);
1197 }
1198 
1205 static inline void pwmv2_enable_capture_nededge_irq(PWMV2_Type *pwm_x, pwm_channel_t channel_index)
1206 {
1207  pwm_x->IRQ_EN_CAP_NEG |= PWMV2_IRQ_EN_CAP_NEG_IRQ_EN_CAP_NEG_SET(1 << channel_index);
1208 }
1209 
1216 static inline void pwmv2_disable_capture_nededge_irq(PWMV2_Type *pwm_x, pwm_channel_t channel_index)
1217 {
1218  pwm_x->IRQ_EN_CAP_NEG &= ~PWMV2_IRQ_EN_CAP_NEG_IRQ_EN_CAP_NEG_SET(1 << channel_index);
1219 }
1220 
1227 static inline void pwmv2_enable_fault_irq(PWMV2_Type *pwm_x, pwm_channel_t channel_index)
1228 {
1229  pwm_x->IRQ_EN_FAULT |= PWMV2_IRQ_EN_FAULT_IRQ_EN_FAULT_SET(1 << channel_index);
1230 }
1231 
1238 static inline void pwmv2_disable_fault_irq(PWMV2_Type *pwm_x, pwm_channel_t channel_index)
1239 {
1240  pwm_x->IRQ_EN_FAULT &= ~PWMV2_IRQ_EN_FAULT_IRQ_EN_FAULT_SET(1 << channel_index);
1241 }
1242 
1249 static inline void pwmv2_enable_burstend_irq(PWMV2_Type *pwm_x, pwm_counter_t counter_index)
1250 {
1251  pwm_x->IRQ_EN_BURSTEND |= PWMV2_IRQ_EN_FAULT_IRQ_EN_FAULT_SET(1 << counter_index);
1252 }
1253 
1260 static inline void pwmv2_disable_burstend_irq(PWMV2_Type *pwm_x, pwm_counter_t counter_index)
1261 {
1262  pwm_x->IRQ_EN_BURSTEND &= ~PWMV2_IRQ_EN_FAULT_IRQ_EN_FAULT_SET(1 << counter_index);
1263 }
1264 
1272 static inline void pwmv2_enable_dma_at_compare_point(PWMV2_Type *pwm_x, pwm_dma_chn_t dma_channel, uint8_t cmp_index)
1273 {
1274  pwm_x->DMA_EN = (pwm_x->DMA_EN & ~((PWMV2_DMA_EN_DMA0_SEL_MASK | PWMV2_DMA_EN_DMA0_EN_MASK) << (PWMV2_DMA_EN_DMA1_SEL_SHIFT * dma_channel))) |
1276 }
1277 
1284 static inline void pwmv2_disable_dma_at_compare_point(PWMV2_Type *pwm_x, pwm_dma_chn_t dma_channel)
1285 {
1287 }
1288 
1296 static inline void pwmv2_enable_dma_at_reload_point(PWMV2_Type *pwm_x, pwm_dma_chn_t dma_channel, pwm_counter_t reload_index)
1297 {
1298  pwm_x->DMA_EN = (pwm_x->DMA_EN & ~((PWMV2_DMA_EN_DMA0_SEL_MASK | PWMV2_DMA_EN_DMA0_EN_MASK) << (PWMV2_DMA_EN_DMA1_SEL_SHIFT * dma_channel))) |
1299  ((PWMV2_DMA_EN_DMA0_SEL_SET(reload_index + 24) | PWMV2_DMA_EN_DMA0_EN_MASK) << (PWMV2_DMA_EN_DMA1_SEL_SHIFT * dma_channel));
1300 }
1301 
1308 static inline void pwmv2_disable_dma_at_reload_point(PWMV2_Type *pwm_x, pwm_dma_chn_t dma_channel)
1309 {
1311 }
1312 
1320 static inline void pwmv2_reload_select_compare_point0_index(PWMV2_Type *pwm_x, pwm_counter_t counter, uint8_t cmp_index)
1321 {
1322  pwm_x->CNT[counter].CFG0 = (pwm_x->CNT[counter].CFG0 & ~(PWMV2_CNT_CFG0_RLD_CMP_SEL0_MASK)) | PWMV2_CNT_CFG0_RLD_CMP_SEL0_SET(cmp_index);
1323 }
1324 
1332 static inline void pwmv2_reload_select_compare_point1_index(PWMV2_Type *pwm_x, pwm_counter_t counter, uint8_t cmp_index)
1333 {
1334  pwm_x->CNT[counter].CFG0 = (pwm_x->CNT[counter].CFG0 & ~(PWMV2_CNT_CFG0_RLD_CMP_SEL1_MASK)) | PWMV2_CNT_CFG0_RLD_CMP_SEL1_SET(cmp_index);
1335 }
1336 
1344 static inline void pwmv2_reload_select_input_trigger(PWMV2_Type *pwm_x, pwm_counter_t counter, uint8_t trig_index)
1345 {
1346  pwm_x->CNT[counter].CFG0 = (pwm_x->CNT[counter].CFG0 & ~(PWMV2_CNT_CFG0_RLD_TRIG_SEL_MASK)) | PWMV2_CNT_CFG0_RLD_TRIG_SEL_SET(trig_index);
1347 }
1348 
1357 {
1358  pwm_x->CNT[counter].CFG0 = (pwm_x->CNT[counter].CFG0 & ~(PWMV2_CNT_CFG0_RLD_UPDATE_TIME_MASK)) | PWMV2_CNT_CFG0_RLD_UPDATE_TIME_SET(update);
1359 }
1360 
1368 static inline void pwmv2_counter_set_dac_data_parameter(PWMV2_Type *pwm_x, pwm_counter_t counter, uint8_t dac_parameter)
1369 {
1370  pwm_x->CNT[counter].CFG0 = (pwm_x->CNT[counter].CFG0 & ~PWMV2_CNT_CFG0_CNT_D_PARAM_MASK) | PWMV2_CNT_CFG0_CNT_D_PARAM_SET(dac_parameter);
1371 }
1372 
1380 static inline void pwmv2_conuter_select_dac_index(PWMV2_Type *pwm_x, pwm_counter_t counter, pwm_dac_channel_t dac_index)
1381 {
1382  pwm_x->CNT[counter].CFG1 = (pwm_x->CNT[counter].CFG1 & ~PWMV2_CNT_CFG1_CNT_DAC_INDEX_MASK) | PWMV2_CNT_CFG1_CNT_DAC_INDEX_SET(dac_index);
1383 }
1384 
1391 static inline void pwmv2_counter_up_limit_enable(PWMV2_Type *pwm_x, pwm_counter_t counter)
1392 {
1393  pwm_x->CNT[counter].CFG1 |= PWMV2_CNT_CFG1_CNT_LU_EN_MASK;
1394 }
1395 
1402 static inline void pwmv2_counter_up_limit_disable(PWMV2_Type *pwm_x, pwm_counter_t counter)
1403 {
1404  pwm_x->CNT[counter].CFG1 &= ~PWMV2_CNT_CFG1_CNT_LU_EN_MASK;
1405 }
1406 
1414 static inline void pwmv2_counter_select_up_limit_from_shadow_value(PWMV2_Type *pwm_x, pwm_counter_t counter, uint8_t index)
1415 {
1416  pwm_x->CNT[counter].CFG1 = (pwm_x->CNT[counter].CFG1 & ~PWMV2_CNT_CFG1_CNT_LIM_UP_MASK) | PWMV2_CNT_CFG1_CNT_LIM_UP_SET(index);
1417 }
1418 
1425 static inline void pwmv2_counter_low_limit_enable(PWMV2_Type *pwm_x, pwm_counter_t counter)
1426 {
1427  pwm_x->CNT[counter].CFG1 |= PWMV2_CNT_CFG1_CNT_LL_EN_MASK;
1428 }
1429 
1430 
1437 static inline void pwmv2_counter_low_limit_disable(PWMV2_Type *pwm_x, pwm_counter_t counter)
1438 {
1439  pwm_x->CNT[counter].CFG1 &= ~PWMV2_CNT_CFG1_CNT_LL_EN_MASK;
1440 }
1441 
1449 static inline void pwmv2_counter_select_low_limit_from_shadow_value(PWMV2_Type *pwm_x, pwm_counter_t counter, uint8_t index)
1450 {
1451  pwm_x->CNT[counter].CFG1 = (pwm_x->CNT[counter].CFG1 & ~PWMV2_CNT_CFG1_CNT_LIM_LO_MASK) | PWMV2_CNT_CFG1_CNT_LIM_LO_SET(index);
1452 }
1453 
1461 static inline void pwmv2_counter_select_data_offset_from_shadow_value(PWMV2_Type *pwm_x, pwm_counter_t counter, uint8_t index)
1462 {
1463  pwm_x->CNT[counter].CFG1 = (pwm_x->CNT[counter].CFG1 & ~PWMV2_CNT_CFG1_CNT_IN_OFF_MASK) | PWMV2_CNT_CFG1_CNT_IN_OFF_SET(index);
1464 }
1465 
1473 {
1474  pwm_x->CNT[counter].CFG2 |= PWMV2_CNT_CFG2_CNT_RELOAD_EN_MASK;
1475 }
1476 
1484 {
1485  pwm_x->CNT[counter].CFG2 &= ~PWMV2_CNT_CFG2_CNT_RELOAD_EN_MASK;
1486 }
1487 
1495 static inline void pwmv2_counter_update_trig1(PWMV2_Type *pwm_x, pwm_counter_t counter, uint8_t trig_index)
1496 {
1497  pwm_x->CNT[counter].CFG2 = (pwm_x->CNT[counter].CFG2 & ~PWMV2_CNT_CFG2_CNT_UPDATE_TRIG1_MASK) | PWMV2_CNT_CFG2_CNT_UPDATE_TRIG1_SET(trig_index);
1498 }
1499 
1507 {
1508  pwm_x->CNT[counter].CFG2 |= PWMV2_CNT_CFG2_CNT_UPDATE_EN1_MASK;
1509 }
1510 
1518 {
1519  pwm_x->CNT[counter].CFG2 &= ~PWMV2_CNT_CFG2_CNT_UPDATE_EN1_MASK;
1520 }
1521 
1529 static inline void pwmv2_counter_set_trig1_calculate_cell_index(PWMV2_Type *pwm_x, pwm_counter_t counter, uint8_t cal_index)
1530 {
1531  pwm_x->CNT[counter].CFG2 = (pwm_x->CNT[counter].CFG2 & ~PWMV2_CNT_CFG2_CNT_TRIG1_MASK) | PWMV2_CNT_CFG2_CNT_TRIG1_SET(cal_index);
1532 }
1533 
1541 static inline void pwmv2_counter_update_trig0(PWMV2_Type *pwm_x, pwm_counter_t counter, uint8_t trig_index)
1542 {
1543  pwm_x->CNT[counter].CFG2 = (pwm_x->CNT[counter].CFG2 & ~PWMV2_CNT_CFG2_CNT_UPDATE_TRIG0_MASK) | PWMV2_CNT_CFG2_CNT_UPDATE_TRIG0_SET(trig_index);
1544 }
1545 
1553 {
1554  pwm_x->CNT[counter].CFG2 |= PWMV2_CNT_CFG2_CNT_UPDATE_EN0_MASK;
1555 }
1556 
1564 {
1565  pwm_x->CNT[counter].CFG2 &= ~PWMV2_CNT_CFG2_CNT_UPDATE_EN0_MASK;
1566 }
1567 
1575 static inline void pwmv2_counter_set_trig0_calculate_cell_index(PWMV2_Type *pwm_x, pwm_counter_t counter, uint8_t cal_index)
1576 {
1577  pwm_x->CNT[counter].CFG2 = (pwm_x->CNT[counter].CFG2 & ~PWMV2_CNT_CFG2_CNT_TRIG0_MASK) | PWMV2_CNT_CFG2_CNT_TRIG0_SET(cal_index);
1578 }
1579 
1587 static inline void pwmv2_counter_start_select_trigger_index(PWMV2_Type *pwm_x, pwm_counter_t counter, uint8_t trig_index)
1588 {
1589  pwm_x->CNT[counter].CFG3 = (pwm_x->CNT[counter].CFG3 & ~PWMV2_CNT_CFG3_CNT_START_SEL_MASK) | PWMV2_CNT_CFG3_CNT_START_SEL_SET(trig_index);
1590 }
1591 
1599 {
1600  pwm_x->CNT[counter].CFG3 |= PWMV2_CNT_CFG3_CNT_HW_START_EN_MASK;
1601 }
1602 
1610 {
1611  pwm_x->CNT[counter].CFG3 &= ~PWMV2_CNT_CFG3_CNT_HW_START_EN_MASK;
1612 }
1613 
1621 static inline void pwmv2_set_counter_burst(PWMV2_Type *pwm_x, pwm_counter_t counter, uint16_t burst)
1622 {
1623  pwm_x->CNT[counter].CFG3 = (pwm_x->CNT[counter].CFG3 & ~PWMV2_CNT_CFG3_CNT_BURST_MASK) | PWMV2_CNT_CFG3_CNT_BURST_SET(burst);
1624 }
1625 
1632 static inline void pwmv2_counter_burst_disable(PWMV2_Type *pwm_x, pwm_counter_t counter)
1633 {
1634  pwm_x->CNT[counter].CFG3 |= PWMV2_CNT_CFG3_CNT_BURST_MASK;
1635 }
1636 
1643 static inline void pwmv2_start_pwm_output(PWMV2_Type *pwm_x, pwm_counter_t counter)
1644 {
1645  pwm_x->CNT_GLBCFG |= PWMV2_CNT_GLBCFG_CNT_SW_START_SET((1 << counter));
1646 }
1647 
1654 static inline void pwmv2_reset_counter(PWMV2_Type *pwm_x, pwm_counter_t counter)
1655 {
1656  pwm_x->CNT_GLBCFG |= PWMV2_CNT_GLBCFG_TIMER_RESET_SET((1 << counter));
1657 }
1658 
1665 static inline void pwmv2_enable_counter(PWMV2_Type *pwm_x, pwm_counter_t counter)
1666 {
1667  pwm_x->CNT_GLBCFG |= PWMV2_CNT_GLBCFG_TIMER_ENABLE_SET((1 << counter));
1668 }
1669 
1676 static inline void pwmv2_disable_counter(PWMV2_Type *pwm_x, pwm_counter_t counter)
1677 {
1678  pwm_x->CNT_GLBCFG &= ~PWMV2_CNT_GLBCFG_TIMER_ENABLE_SET((1 << counter));
1679 }
1680 
1688 static inline void pwmv2_calculate_set_up_limit_parameter(PWMV2_Type *pwm_x, uint8_t cal_index, uint8_t value)
1689 {
1690  pwm_x->CAL[cal_index].CFG0 = (pwm_x->CAL[cal_index].CFG0 & ~PWMV2_CAL_CFG0_CAL_LU_PARAM_MASK) | PWMV2_CAL_CFG0_CAL_LU_PARAM_SET(value);
1691 }
1692 
1700 static inline void pwmv2_calculate_set_low_limit_parameter(PWMV2_Type *pwm_x, uint8_t cal_index, uint8_t value)
1701 {
1702  pwm_x->CAL[cal_index].CFG0 = (pwm_x->CAL[cal_index].CFG0 & ~PWMV2_CAL_CFG0_CAL_LL_PARAM_MASK) | PWMV2_CAL_CFG0_CAL_LL_PARAM_SET(value);
1703 }
1704 
1712 static inline void pwmv2_calculate_set_period_parameter(PWMV2_Type *pwm_x, uint8_t cal_index, uint8_t value)
1713 {
1714  pwm_x->CAL[cal_index].CFG0 = (pwm_x->CAL[cal_index].CFG0 & ~PWMV2_CAL_CFG0_CAL_T_PARAM_MASK) | PWMV2_CAL_CFG0_CAL_T_PARAM_SET(value);
1715 }
1716 
1724 static inline void pwmv2_calculate_set_dac_value_parameter(PWMV2_Type *pwm_x, uint8_t cal_index, uint8_t value)
1725 {
1726  pwm_x->CAL[cal_index].CFG0 = (pwm_x->CAL[cal_index].CFG0 & ~PWMV2_CAL_CFG0_CAL_D_PARAM_MASK) | PWMV2_CAL_CFG0_CAL_D_PARAM_SET(value);
1727 }
1728 
1736 static inline void pwmv2_calculate_select_counter_calculate_index(PWMV2_Type *pwm_x, uint8_t cal_index, uint8_t counter_calculate)
1737 {
1738  pwm_x->CAL[cal_index].CFG1 = (pwm_x->CAL[cal_index].CFG1 & ~PWMV2_CAL_CFG1_CAL_T_INDEX_MASK) | PWMV2_CAL_CFG1_CAL_T_INDEX_SET(counter_calculate);
1739 }
1740 
1748 static inline void pwmv2_calculate_select_in_value(PWMV2_Type *pwm_x, uint8_t cal_index, uint8_t index)
1749 {
1750  pwm_x->CAL[cal_index].CFG1 = (pwm_x->CAL[cal_index].CFG1 & ~PWMV2_CAL_CFG1_CAL_IN_INDEX_MASK) | PWMV2_CAL_CFG1_CAL_IN_INDEX_SET(index);
1751 }
1752 
1759 static inline void pwmv2_calculate_enable_up_limit(PWMV2_Type *pwm_x, uint8_t cal_index)
1760 {
1761  pwm_x->CAL[cal_index].CFG1 |= PWMV2_CAL_CFG1_CAL_LU_EN_MASK;
1762 }
1763 
1770 static inline void pwmv2_calculate_disable_up_limit(PWMV2_Type *pwm_x, uint8_t cal_index)
1771 {
1772  pwm_x->CAL[cal_index].CFG1 &= ~PWMV2_CAL_CFG1_CAL_LU_EN_MASK;
1773 }
1774 
1782 static inline void pwmv2_calculate_select_up_limit_offset(PWMV2_Type *pwm_x, uint8_t cal_index, uint8_t shadow_index)
1783 {
1784  pwm_x->CAL[cal_index].CFG1 = (pwm_x->CAL[cal_index].CFG1 & ~PWMV2_CAL_CFG1_CAL_LIM_UP_MASK) | PWMV2_CAL_CFG1_CAL_LIM_UP_SET(shadow_index);
1785 }
1786 
1794 static inline void pwmv2_calculate_select_low_limit_offset(PWMV2_Type *pwm_x, uint8_t cal_index, uint8_t shadow_index)
1795 {
1796  pwm_x->CAL[cal_index].CFG1 = (pwm_x->CAL[cal_index].CFG1 & ~PWMV2_CAL_CFG1_CAL_LIM_LO_MASK) | PWMV2_CAL_CFG1_CAL_LIM_LO_SET(shadow_index);
1797 }
1798 
1806 static inline void pwmv2_calculate_select_in_offset(PWMV2_Type *pwm_x, uint8_t cal_index, uint8_t shadow_index)
1807 {
1808  pwm_x->CAL[cal_index].CFG1 = (pwm_x->CAL[cal_index].CFG1 & ~PWMV2_CAL_CFG1_CAL_IN_OFF_MASK) | PWMV2_CAL_CFG1_CAL_IN_OFF_SET(shadow_index);
1809 }
1810 
1817 static inline void pwmv2_calculate_enable_low_limit(PWMV2_Type *pwm_x, uint8_t cal_index)
1818 {
1819  pwm_x->CAL[cal_index].CFG1 |= PWMV2_CAL_CFG1_CAL_LL_EN_MASK;
1820 }
1821 
1828 static inline void pwmv2_calculate_disable_low_limit(PWMV2_Type *pwm_x, uint8_t cal_index)
1829 {
1830  pwm_x->CAL[cal_index].CFG1 &= ~PWMV2_CAL_CFG1_CAL_LL_EN_MASK;
1831 }
1832 
1840 static inline void pwmv2_select_cmp_trigmux(PWMV2_Type *pwm_x, uint8_t cmp_index, uint8_t trig_index)
1841 {
1842  pwm_x->CMP[cmp_index].CFG = (pwm_x->CMP[cmp_index].CFG & ~PWMV2_CMP_CFG_CMP_TRIG_SEL_MASK) | PWMV2_CMP_CFG_CMP_TRIG_SEL_SET(trig_index);
1843 }
1844 
1852 static inline void pwmv2_cmp_update_trig_time(PWMV2_Type *pwm_x, uint8_t cmp_index, pwm_cmp_shadow_register_update_trigger_t trig_time)
1853 {
1854  pwm_x->CMP[cmp_index].CFG = (pwm_x->CMP[cmp_index].CFG & ~PWMV2_CMP_CFG_CMP_UPDATE_TIME_MASK) | PWMV2_CMP_CFG_CMP_UPDATE_TIME_SET(trig_time);
1855 }
1856 
1865 static inline void pwmv2_select_cmp_source(PWMV2_Type *pwm_x, uint8_t cmp_index, pwm_cmp_source_t cmp_sel, uint8_t index)
1866 {
1867  pwm_x->CMP[cmp_index].CFG = (pwm_x->CMP[cmp_index].CFG & ~PWMV2_CMP_CFG_CMP_IN_SEL_MASK) | PWMV2_CMP_CFG_CMP_IN_SEL_SET((cmp_sel + index));
1868 }
1869 
1877 static inline void pwmv2_cmp_select_counter(PWMV2_Type *pwm_x, uint8_t cmp_index, pwm_counter_t counter_index)
1878 {
1879  if (cmp_index >= 16) {
1880  pwm_x->CMP[cmp_index].CFG = (pwm_x->CMP[cmp_index].CFG & ~PWMV2_CMP_CFG_CMP_CNT_MASK) | PWMV2_CMP_CFG_CMP_CNT_SET((counter_index));
1881  }
1882 }
1883 
1891 void pwmv2_config_cmp(PWMV2_Type *pwm_x, uint8_t index, pwmv2_cmp_config_t *config);
1892 
1901 
1910 void pwmv2_config_pwm(PWMV2_Type *pwm_x, pwm_channel_t index, pwmv2_config_t *config, bool enable_pair_mode);
1911 
1925  uint8_t cmp_start_index, pwmv2_cmp_config_t *cmp, uint8_t cmp_num);
1926 
1939  pwmv2_pair_config_t *pwm_pair_config, uint8_t cmp_start_index,
1940  pwmv2_cmp_config_t *cmp, uint8_t cmp_num);
1941 
1949 void pwmv2_setup_cmp_calculate(PWMV2_Type *pwm_x, uint8_t cal_index, pwmv2_cmp_calculate_cfg_t *cal);
1950 
1951 #ifdef __cplusplus
1952 }
1953 #endif
1957 #endif /* HPM_PWMV2_DRV_H */
uint32_t hpm_stat_t
Definition: hpm_common.h:123
static uint32_t pwmv2_get_cmp_irq_status(PWMV2_Type *pwm_x)
Get cmp irq status.
Definition: hpm_pwmv2_drv.h:1007
static void pwmv2_disable_dma_at_reload_point(PWMV2_Type *pwm_x, pwm_dma_chn_t dma_channel)
disable dma at reload point
Definition: hpm_pwmv2_drv.h:1308
static void pwmv2_enable_capture_posedge_irq(PWMV2_Type *pwm_x, pwm_channel_t channel_index)
enable capture posedge irq
Definition: hpm_pwmv2_drv.h:1183
static uint32_t pwmv2_get_capture_posedge_value(PWMV2_Type *pwm_x, pwm_channel_t chn)
get capture posedge value
Definition: hpm_pwmv2_drv.h:917
static void pwmv2_set_capture_counter_index(PWMV2_Type *pwm_x, pwm_channel_t chn, uint8_t counter_index)
Set the counter to be used for the capture channel.
Definition: hpm_pwmv2_drv.h:942
static void pwmv2_enable_output_invert(PWMV2_Type *pwm_x, pwm_channel_t chn)
Enable pwm output invert.
Definition: hpm_pwmv2_drv.h:460
pwm_counter_t
Definition: hpm_pwmv2_drv.h:48
static void pwmv2_shadow_register_lock(PWMV2_Type *pwm_x)
lock all shawdow register
Definition: hpm_pwmv2_drv.h:273
pwm_cmp_source_t
Definition: hpm_pwmv2_drv.h:164
static void pwmv2_reload_select_compare_point0_index(PWMV2_Type *pwm_x, pwm_counter_t counter, uint8_t cmp_index)
select compare point 0 index
Definition: hpm_pwmv2_drv.h:1320
static void pwmv2_disable_fault_from_pad(PWMV2_Type *pwm_x, pwm_channel_t chn)
Disable the fault signal from the pin.
Definition: hpm_pwmv2_drv.h:427
static void pwmv2_disable_burstend_irq(PWMV2_Type *pwm_x, pwm_counter_t counter_index)
disable burstend irq
Definition: hpm_pwmv2_drv.h:1260
static void pwmv2_enable_software_dac_mode(PWMV2_Type *pwm_x, pwm_dac_channel_t dac_index)
Enable the software dac mode.
Definition: hpm_pwmv2_drv.h:772
static void pwmv2_counter_set_trig1_calculate_cell_index(PWMV2_Type *pwm_x, pwm_counter_t counter, uint8_t cal_index)
Enable change counter value to one of the calculation cell output when cnt_update_triger1 issued.
Definition: hpm_pwmv2_drv.h:1529
static void pwmv2_select_cmp_source(PWMV2_Type *pwm_x, uint8_t cmp_index, pwm_cmp_source_t cmp_sel, uint8_t index)
Select cmp source.
Definition: hpm_pwmv2_drv.h:1865
void pwmv2_config_cmp(PWMV2_Type *pwm_x, uint8_t index, pwmv2_cmp_config_t *config)
config pwm cmp
Definition: hpm_pwmv2_drv.c:50
static void pwmv2_enable_fault_from_trigmux(PWMV2_Type *pwm_x, pwm_channel_t chn)
Enable the fault signal from the trigmux.
Definition: hpm_pwmv2_drv.h:438
static void pwmv2_clear_cmp_irq_status(PWMV2_Type *pwm_x, uint32_t mask)
Clear cmp irq status.
Definition: hpm_pwmv2_drv.h:1018
static void pwmv2_counter_select_low_limit_from_shadow_value(PWMV2_Type *pwm_x, pwm_counter_t counter, uint8_t index)
Select the lower limit from the shadow register.
Definition: hpm_pwmv2_drv.h:1449
static uint32_t pwmv2_get_counter_value(PWMV2_Type *pwm_x, pwm_counter_t counter_index)
Getting the value of a counter.
Definition: hpm_pwmv2_drv.h:893
static void pwmv2_set_four_cmp_logic(PWMV2_Type *pwm_x, pwm_channel_t chn, pwm_logic_four_cmp_cfg_t logic)
Configure the logic between the 4 cmp, valid only if the 4 cmp output is enabled.
Definition: hpm_pwmv2_drv.h:620
static void pwmv2_enable_force_by_software(PWMV2_Type *pwm_x, pwm_channel_t chn)
Enable force mode triggered by software.
Definition: hpm_pwmv2_drv.h:575
static void pwmv2_set_dac_value(PWMV2_Type *pwm_x, pwm_dac_channel_t dac_index, uint32_t value)
set dac value
Definition: hpm_pwmv2_drv.h:905
static void pwmv2_set_fault_recovery_time(PWMV2_Type *pwm_x, pwm_channel_t chn, pwm_fault_recovery_trigger_t trig)
Set the fault mode recovery time.
Definition: hpm_pwmv2_drv.h:553
static void pwmv2_enable_calculate_overflow_irq(PWMV2_Type *pwm_x)
enable calculate overflow irq
Definition: hpm_pwmv2_drv.h:986
static uint32_t pwmv2_get_capture_negedge_irq_status(PWMV2_Type *pwm_x)
Get capture negedge irq status.
Definition: hpm_pwmv2_drv.h:1073
static void pwmv2_shadow_register_unlock(PWMV2_Type *pwm_x)
unlock all shadow register
Definition: hpm_pwmv2_drv.h:319
static void pwmv2_enable_force_by_hardware(PWMV2_Type *pwm_x, pwm_channel_t chn)
Trigger forced mode by hardware signal.
Definition: hpm_pwmv2_drv.h:564
struct pwmv2_cmp_config pwmv2_cmp_config_t
pwm compare config
static void pwmv2_calculate_enable_low_limit(PWMV2_Type *pwm_x, uint8_t cal_index)
enable low limit
Definition: hpm_pwmv2_drv.h:1817
void pwmv2_config_pwm(PWMV2_Type *pwm_x, pwm_channel_t index, pwmv2_config_t *config, bool enable_pair_mode)
config pwm
Definition: hpm_pwmv2_drv.c:78
static void pwmv2_start_pwm_output_sync(PWMV2_Type *pwm_x, uint8_t mask)
Multiple pwm out at the same time.
Definition: hpm_pwmv2_drv.h:309
static uint32_t pwmv2_get_force_working_status(PWMV2_Type *pwm_x)
Get force mode work status.
Definition: hpm_pwmv2_drv.h:870
static void pwmv2_set_trigout_cmp_index(PWMV2_Type *pwm_x, pwm_channel_t trigmux_chn, uint8_t cmp_index)
Setting the comparator as an input to trigmux.
Definition: hpm_pwmv2_drv.h:704
static void pwmv2_counter_burst_disable(PWMV2_Type *pwm_x, pwm_counter_t counter)
Disable counter burst function.
Definition: hpm_pwmv2_drv.h:1632
static void pwmv2_disable_dma_at_compare_point(PWMV2_Type *pwm_x, pwm_dma_chn_t dma_channel)
disable dma at compare point
Definition: hpm_pwmv2_drv.h:1284
static void pwmv2_disable_calculate_overflow_irq(PWMV2_Type *pwm_x)
Disable calculate overflow irq.
Definition: hpm_pwmv2_drv.h:996
void pwmv2_setup_cmp_calculate(PWMV2_Type *pwm_x, uint8_t cal_index, pwmv2_cmp_calculate_cfg_t *cal)
Configure the cmp calculate unit.
Definition: hpm_pwmv2_drv.c:131
static void pwmv2_counter_set_trig0_calculate_cell_index(PWMV2_Type *pwm_x, pwm_counter_t counter, uint8_t cal_index)
Enable change counter value to one of the calculation cell output when cnt_update_triger0 issued.
Definition: hpm_pwmv2_drv.h:1575
static void pwmv2_disable_invert_by_shadow(PWMV2_Type *pwm_x, pwm_channel_t chn)
Disable invert operations via shadow registers.
Definition: hpm_pwmv2_drv.h:495
static uint32_t pwmv2_get_burstend_irq_status(PWMV2_Type *pwm_x)
Get burstend irq status.
Definition: hpm_pwmv2_drv.h:1117
static void pwmv2_enable_pair_mode(PWMV2_Type *pwm_x, pwm_channel_t chn)
Enable pwm complementary mode.
Definition: hpm_pwmv2_drv.h:597
static void pwmv2_clear_burstend__irq_status(PWMV2_Type *pwm_x, uint32_t mask)
Clear burstend irq status.
Definition: hpm_pwmv2_drv.h:1128
static void pwmv2_cmp_update_trig_time(PWMV2_Type *pwm_x, uint8_t cmp_index, pwm_cmp_shadow_register_update_trigger_t trig_time)
Select cmp update trigmux time.
Definition: hpm_pwmv2_drv.h:1852
void pwmv2_deinit(PWMV2_Type *pwm_x)
pwm deinitialize function
Definition: hpm_pwmv2_drv.c:11
static void pwmv2_channel_enable_output(PWMV2_Type *pwm_x, pwm_channel_t chn)
Enable pwm output.
Definition: hpm_pwmv2_drv.h:506
pwm_dac_channel_t
Definition: hpm_pwmv2_drv.h:135
static void pwmv2_enable_cmp_irq(PWMV2_Type *pwm_x, uint8_t cmp_index)
enable cmp irq
Definition: hpm_pwmv2_drv.h:1139
static void pwmv2_counter_disable_update_trig1(PWMV2_Type *pwm_x, pwm_counter_t counter)
Disable counter update by trigmux1.
Definition: hpm_pwmv2_drv.h:1517
static void pwmv2_counter_low_limit_disable(PWMV2_Type *pwm_x, pwm_counter_t counter)
Disable the lower limit of the calculation unit.
Definition: hpm_pwmv2_drv.h:1437
pwm_channel_t
Definition: hpm_pwmv2_drv.h:55
static uint32_t pwmv2_get_counter_working_status(PWMV2_Type *pwm_x, pwm_counter_t counter_index)
Get counter work status.
Definition: hpm_pwmv2_drv.h:847
static void pwmv2_counter_start_select_trigger_index(PWMV2_Type *pwm_x, pwm_counter_t counter, uint8_t trig_index)
Set trigmux index to start counter.
Definition: hpm_pwmv2_drv.h:1587
static void pwmv2_conuter_select_dac_index(PWMV2_Type *pwm_x, pwm_counter_t counter, pwm_dac_channel_t dac_index)
Select dac index.
Definition: hpm_pwmv2_drv.h:1380
static void pwmv2_counter_select_up_limit_from_shadow_value(PWMV2_Type *pwm_x, pwm_counter_t counter, uint8_t index)
Select the upper limit from the shadow register.
Definition: hpm_pwmv2_drv.h:1414
static void pwmv2_disable_software_force(PWMV2_Type *pwm_x, pwm_channel_t chn)
Disable software forced output.
Definition: hpm_pwmv2_drv.h:726
static void pwmv2_disable_four_cmp(PWMV2_Type *pwm_x, pwm_channel_t chn)
disable four pwm outputs
Definition: hpm_pwmv2_drv.h:381
static void pwmv2_capture_selection_input_source(PWMV2_Type *pwm_x, pwm_channel_t chn, pwm_capture_input_select_t select)
Select the input source for the captured signal.
Definition: hpm_pwmv2_drv.h:929
pwm_force_trigger_t
Definition: hpm_pwmv2_drv.h:109
static uint32_t pwmv2_get_fault_irq_status(PWMV2_Type *pwm_x)
Get fault irq status.
Definition: hpm_pwmv2_drv.h:1095
static void pwmv2_disable_capture_nededge_irq(PWMV2_Type *pwm_x, pwm_channel_t channel_index)
disable capture nedege irq
Definition: hpm_pwmv2_drv.h:1216
static void pwmv2_counter_update_trig1(PWMV2_Type *pwm_x, pwm_counter_t counter, uint8_t trig_index)
Select counter update by trigmux1.
Definition: hpm_pwmv2_drv.h:1495
static void pwmv2_calculate_set_up_limit_parameter(PWMV2_Type *pwm_x, uint8_t cal_index, uint8_t value)
Set calculate up limit parameter.
Definition: hpm_pwmv2_drv.h:1688
pwm_shadow_register_output_polarity_t
Definition: hpm_pwmv2_drv.h:97
static void pwmv2_disable_output_invert(PWMV2_Type *pwm_x, pwm_channel_t chn)
Disable pwm output invert.
Definition: hpm_pwmv2_drv.h:471
static void pwmv2_reset_counter(PWMV2_Type *pwm_x, pwm_counter_t counter)
Reset pwm counter.
Definition: hpm_pwmv2_drv.h:1654
static void pwmv2_disable_debug_mode(PWMV2_Type *pwm_x)
Disable debug mode.
Definition: hpm_pwmv2_drv.h:804
static void pwmv2_select_force_trigmux_index(PWMV2_Type *pwm_x, pwm_channel_t chn, uint8_t trigmux_index)
Select the trigger source that forces the output to take effect.
Definition: hpm_pwmv2_drv.h:668
static void pwmv2_enable_multi_counter_sync(PWMV2_Type *pwm_x, uint8_t mask)
Multiple counters are enabled at the same time.
Definition: hpm_pwmv2_drv.h:296
pwm_capture_input_select_t
Definition: hpm_pwmv2_drv.h:142
static void pwmv2_disable_shadow_lock_feature(PWMV2_Type *pwm_x)
Do not use the shadow register function.
Definition: hpm_pwmv2_drv.h:835
static void pwmv2_set_shadow_val(PWMV2_Type *pwm_x, uint8_t index, uint32_t value, uint8_t high_resolution_tick, bool enable_half_cycle)
Set the value of the shadow register.
Definition: hpm_pwmv2_drv.h:344
static void pwmv2_set_fault_mode(PWMV2_Type *pwm_x, pwm_channel_t chn, pwm_fault_mode_t mode)
set the fault mode
Definition: hpm_pwmv2_drv.h:541
static void pwmv2_disable_force_by_software(PWMV2_Type *pwm_x, pwm_channel_t chn)
Disable force mode triggered by software.
Definition: hpm_pwmv2_drv.h:586
static void pwmv2_calculate_disable_low_limit(PWMV2_Type *pwm_x, uint8_t cal_index)
disable low limit
Definition: hpm_pwmv2_drv.h:1828
static void pwmv2_calculate_disable_up_limit(PWMV2_Type *pwm_x, uint8_t cal_index)
disable calculate up limit
Definition: hpm_pwmv2_drv.h:1770
static uint32_t pwmv2_get_capture_posedge_irq_status(PWMV2_Type *pwm_x)
Get capture posedge irq status.
Definition: hpm_pwmv2_drv.h:1051
static void pwmv2_cmp_select_counter(PWMV2_Type *pwm_x, uint8_t cmp_index, pwm_counter_t counter_index)
Select cmp use counter.
Definition: hpm_pwmv2_drv.h:1877
struct pwmv2_config pwmv2_config_t
pwm config data
static void pwmv2_enable_fault_from_pad(PWMV2_Type *pwm_x, pwm_channel_t chn)
Enable the fault signal from the pin.
Definition: hpm_pwmv2_drv.h:416
static void pwmv2_enable_dma_at_reload_point(PWMV2_Type *pwm_x, pwm_dma_chn_t dma_channel, pwm_counter_t reload_index)
enable dma at reload point
Definition: hpm_pwmv2_drv.h:1296
static uint32_t pwmv2_get_force_work_out_polarity_status(PWMV2_Type *pwm_x)
Get the status of the output polarity.
Definition: hpm_pwmv2_drv.h:881
static uint32_t pwmv2_get_capture_negedge_value(PWMV2_Type *pwm_x, pwm_channel_t chn)
get capture negedge value
Definition: hpm_pwmv2_drv.h:955
static void pwmv2_counter_set_dac_data_parameter(PWMV2_Type *pwm_x, pwm_counter_t counter, uint8_t dac_parameter)
Set dac data parameter.
Definition: hpm_pwmv2_drv.h:1368
static void pwmv2_set_counter_reload_trigmux_index(PWMV2_Type *pwm_x, pwm_counter_t counter, uint8_t trig_index)
select one trigger from 8, set to use input signal(selected by cnt_reload_trig) to reload timer
Definition: hpm_pwmv2_drv.h:285
static void pwmv2_disable_capture_posedge_irq(PWMV2_Type *pwm_x, pwm_channel_t channel_index)
disable capture posedge irq
Definition: hpm_pwmv2_drv.h:1194
static void pwmv2_counter_enable_update_trig0(PWMV2_Type *pwm_x, pwm_counter_t counter)
Enable counter update by trigmux0.
Definition: hpm_pwmv2_drv.h:1552
static void pwmv2_counter_disable_update_trig0(PWMV2_Type *pwm_x, pwm_counter_t counter)
Disable counter update by trigmux0.
Definition: hpm_pwmv2_drv.h:1563
static void pwmv2_reload_select_input_trigger(PWMV2_Type *pwm_x, pwm_counter_t counter, uint8_t trig_index)
Select the input trigger source for the reload point.
Definition: hpm_pwmv2_drv.h:1344
static void pwmv2_select_cmp_trigmux(PWMV2_Type *pwm_x, uint8_t cmp_index, uint8_t trig_index)
Select cmp trigmux index.
Definition: hpm_pwmv2_drv.h:1840
pwm_dma_chn_t
Definition: hpm_pwmv2_drv.h:147
static void pwmv2_set_dead_area(PWMV2_Type *pwm_x, pwm_channel_t chn, uint32_t dead)
set pwm dead area
Definition: hpm_pwmv2_drv.h:692
static void pwmv2_enable_burstend_irq(PWMV2_Type *pwm_x, pwm_counter_t counter_index)
enable burstend irq
Definition: hpm_pwmv2_drv.h:1249
static void pwmv2_trig_force_hardware_or_software_select_trigmux_index(PWMV2_Type *pwm_x, pwm_channel_t chn, uint8_t trigmux_index)
Selection of trigger signals for software or hardware trigmux.
Definition: hpm_pwmv2_drv.h:656
static void pwmv2_counter_start_trigger_enable(PWMV2_Type *pwm_x, pwm_counter_t counter)
Enable trigmux to trigger counter initiation.
Definition: hpm_pwmv2_drv.h:1598
static uint32_t pwmv2_get_cmp_working_status(PWMV2_Type *pwm_x, uint8_t cmp_index)
Get cmp work status.
Definition: hpm_pwmv2_drv.h:859
static void pwmv2_enable_four_cmp(PWMV2_Type *pwm_x, pwm_channel_t chn)
enable four pwm outputs
Definition: hpm_pwmv2_drv.h:370
static void pwmv2_enable_reload_irq(PWMV2_Type *pwm_x, pwm_counter_t counter_index)
enable reload irq
Definition: hpm_pwmv2_drv.h:1161
static void pwmv2_disable_pair_mode(PWMV2_Type *pwm_x, pwm_channel_t chn)
Disable pwm complementary mode.
Definition: hpm_pwmv2_drv.h:608
static void pwmv2_disable_software_dac_mode(PWMV2_Type *pwm_x, pwm_dac_channel_t dac_index)
Disable the software dac mode.
Definition: hpm_pwmv2_drv.h:783
static void pwmv2_issue_shadow_register_lock_event(PWMV2_Type *pwm_x)
issue all shawdow register
Definition: hpm_pwmv2_drv.h:263
static void pwmv2_enable_software_force(PWMV2_Type *pwm_x, pwm_channel_t chn)
Enable software forced output.
Definition: hpm_pwmv2_drv.h:715
static void pwmv2_counter_start_trigger_disable(PWMV2_Type *pwm_x, pwm_counter_t counter)
Disable trigmux to trigger counter initiation.
Definition: hpm_pwmv2_drv.h:1609
static void pwmv2_clear_capture_posedge_irq_status(PWMV2_Type *pwm_x, uint32_t mask)
Clear capture posedge irq status.
Definition: hpm_pwmv2_drv.h:1062
static uint32_t pwmv2_get_irq_status_all(PWMV2_Type *pwm_x)
Get all interrupt status.
Definition: hpm_pwmv2_drv.h:966
static void pwmv2_force_output(PWMV2_Type *pwm_x, pwm_channel_t chn, pwm_force_mode_t mode, bool invert)
force pwm output
Definition: hpm_pwmv2_drv.h:357
static void pwmv2_trig_force_mode_select_trigmux_index(PWMV2_Type *pwm_x, pwm_channel_t chn, uint8_t trigmux_index)
Selecting trigmux's signal as a forced mode trigger source.
Definition: hpm_pwmv2_drv.h:644
pwm_force_shadow_trigger_t
Definition: hpm_pwmv2_drv.h:102
static void pwmv2_shadow_unlock_bit_mask(PWMV2_Type *pwm_x, uint32_t mask)
The shadow registers can be updated only when related unlock_bit is set.
Definition: hpm_pwmv2_drv.h:330
static uint32_t pwmv2_get_reload_irq_status(PWMV2_Type *pwm_x)
Get reload irq status.
Definition: hpm_pwmv2_drv.h:1029
pwm_logic_four_cmp_cfg_t
Definition: hpm_pwmv2_drv.h:117
static void pwmv2_counter_select_data_offset_from_shadow_value(PWMV2_Type *pwm_x, pwm_counter_t counter, uint8_t index)
Select data offset from shadow register.
Definition: hpm_pwmv2_drv.h:1461
static void pwmv2_set_counter_burst(PWMV2_Type *pwm_x, pwm_counter_t counter, uint16_t burst)
Set counter burst value.
Definition: hpm_pwmv2_drv.h:1621
static void pwmv2_enable_capture_nededge_irq(PWMV2_Type *pwm_x, pwm_channel_t channel_index)
enable capture nedege irq
Definition: hpm_pwmv2_drv.h:1205
static void pwmv2_start_pwm_output(PWMV2_Type *pwm_x, pwm_counter_t counter)
start pwm output
Definition: hpm_pwmv2_drv.h:1643
static void pwmv2_fault_signal_polarity(PWMV2_Type *pwm_x, pwm_channel_t chn, pwm_fault_pad_polarity_t polarity)
Configure the polarity of the fail signal.
Definition: hpm_pwmv2_drv.h:405
hpm_stat_t pwmv2_setup_waveform(PWMV2_Type *pwm_x, pwm_channel_t chn, pwmv2_config_t *pwm_config, uint8_t cmp_start_index, pwmv2_cmp_config_t *cmp, uint8_t cmp_num)
Set pwm waveform.
Definition: hpm_pwmv2_drv.c:102
static void pwmv2_calculate_set_period_parameter(PWMV2_Type *pwm_x, uint8_t cal_index, uint8_t value)
Set calculate period parameter.
Definition: hpm_pwmv2_drv.h:1712
struct pwmv2_async_fault_source_config pwmv2_async_fault_source_config_t
pwm fault source config
static void pwmv2_channel_disable_output(PWMV2_Type *pwm_x, pwm_channel_t chn)
Disable pwm output.
Definition: hpm_pwmv2_drv.h:517
static void pwmv2_disable_fault_from_trigmux(PWMV2_Type *pwm_x, pwm_channel_t chn)
Disable the fault signal from the trigmux.
Definition: hpm_pwmv2_drv.h:449
static void pwmv2_calculate_set_dac_value_parameter(PWMV2_Type *pwm_x, uint8_t cal_index, uint8_t value)
Set calculate dac value parameter.
Definition: hpm_pwmv2_drv.h:1724
static void pwmv2_enable_shadow_lock_feature(PWMV2_Type *pwm_x)
Using the Shadow Register Function.
Definition: hpm_pwmv2_drv.h:825
static void pwmv2_counter_enable_update_trig1(PWMV2_Type *pwm_x, pwm_counter_t counter)
Enable counter update by trigmux1.
Definition: hpm_pwmv2_drv.h:1506
static void pwmv2_calculate_select_in_offset(PWMV2_Type *pwm_x, uint8_t cal_index, uint8_t shadow_index)
Select offset from shadow index.
Definition: hpm_pwmv2_drv.h:1806
static void pwmv2_clear_capture_negedge_irq_status(PWMV2_Type *pwm_x, uint32_t mask)
Clear capture negedge irq status.
Definition: hpm_pwmv2_drv.h:1084
static void pwmv2_counter_low_limit_enable(PWMV2_Type *pwm_x, pwm_counter_t counter)
Enable the lower limit of the calculation unit.
Definition: hpm_pwmv2_drv.h:1425
static void pwmv2_calculate_enable_up_limit(PWMV2_Type *pwm_x, uint8_t cal_index)
enable calculate up limit
Definition: hpm_pwmv2_drv.h:1759
static void pwmv2_disable_reload_irq(PWMV2_Type *pwm_x, pwm_counter_t counter_index)
disable reload irq
Definition: hpm_pwmv2_drv.h:1172
static void pwmv2_disable_cmp_irq(PWMV2_Type *pwm_x, uint8_t cmp_index)
disable cmp irq
Definition: hpm_pwmv2_drv.h:1150
static void pwmv2_counter_up_limit_disable(PWMV2_Type *pwm_x, pwm_counter_t counter)
Disable the upper limit of the calculation unit.
Definition: hpm_pwmv2_drv.h:1402
static void pwmv2_clear_fault_irq_status(PWMV2_Type *pwm_x, uint32_t mask)
Clear fault irq status.
Definition: hpm_pwmv2_drv.h:1106
static void pwmv2_clear_reload_irq_status(PWMV2_Type *pwm_x, uint32_t mask)
Clear reload irq status.
Definition: hpm_pwmv2_drv.h:1040
pwm_reload_update_time_t
Definition: hpm_pwmv2_drv.h:67
static void pwmv2_fault_signal_select_from_pad(PWMV2_Type *pwm_x, pwm_channel_t chn, uint8_t pad_index)
Direct selection of the fail signal from the pin.
Definition: hpm_pwmv2_drv.h:393
static void pwmv2_counter_up_limit_enable(PWMV2_Type *pwm_x, pwm_counter_t counter)
Enable the upper limit of the calculation unit.
Definition: hpm_pwmv2_drv.h:1391
static void pwmv2_reload_select_compare_point1_index(PWMV2_Type *pwm_x, pwm_counter_t counter, uint8_t cmp_index)
select compare point 1 index
Definition: hpm_pwmv2_drv.h:1332
static void pwmv2_calculate_select_low_limit_offset(PWMV2_Type *pwm_x, uint8_t cal_index, uint8_t shadow_index)
Select low limit offset from shadow index.
Definition: hpm_pwmv2_drv.h:1794
static void pwmv2_enable_counter(PWMV2_Type *pwm_x, pwm_counter_t counter)
Enable pwm counter.
Definition: hpm_pwmv2_drv.h:1665
static void pwmv2_enable_fault_irq(PWMV2_Type *pwm_x, pwm_channel_t channel_index)
enable fault irq
Definition: hpm_pwmv2_drv.h:1227
pwm_force_mode_t
pwm output type
Definition: hpm_pwmv2_drv.h:79
pwm_fault_mode_t
Definition: hpm_pwmv2_drv.h:86
static void pwmv2_enable_dma_at_compare_point(PWMV2_Type *pwm_x, pwm_dma_chn_t dma_channel, uint8_t cmp_index)
enable dma at compare point
Definition: hpm_pwmv2_drv.h:1272
hpm_stat_t pwmv2_setup_waveform_in_pair(PWMV2_Type *pwm_x, pwm_channel_t chn, pwmv2_pair_config_t *pwm_pair_config, uint8_t cmp_start_index, pwmv2_cmp_config_t *cmp, uint8_t cmp_num)
set the pwm waveform complementary mode
Definition: hpm_pwmv2_drv.c:116
static void pwmv2_set_force_update_time(PWMV2_Type *pwm_x, pwm_channel_t chn, pwm_force_trigger_t time)
Setting the effective time of forced output.
Definition: hpm_pwmv2_drv.h:632
static void pwmv2_enable_debug_mode(PWMV2_Type *pwm_x)
Enable debug mode.
Definition: hpm_pwmv2_drv.h:793
static void pwmv2_counter_disable_reload_by_trig(PWMV2_Type *pwm_x, pwm_counter_t counter)
disable counter reload by trigmux
Definition: hpm_pwmv2_drv.h:1483
static void pwmv2_calculate_select_up_limit_offset(PWMV2_Type *pwm_x, uint8_t cal_index, uint8_t shadow_index)
Select up limit offset from shadow index.
Definition: hpm_pwmv2_drv.h:1782
static void pwmv2_disable_counter(PWMV2_Type *pwm_x, pwm_counter_t counter)
Disable pwm counter.
Definition: hpm_pwmv2_drv.h:1676
struct pwmv2_pair_config pwmv2_pair_config_t
pair pwm config
static void pwmv2_counter_enable_reload_by_trig(PWMV2_Type *pwm_x, pwm_counter_t counter)
enable counter reload by trigmux
Definition: hpm_pwmv2_drv.h:1472
static void pwmv2_counter_update_trig0(PWMV2_Type *pwm_x, pwm_counter_t counter, uint8_t trig_index)
Select counter update by trigmux0.
Definition: hpm_pwmv2_drv.h:1541
pwm_fault_recovery_trigger_t
select when to recover PWM output after fault
Definition: hpm_pwmv2_drv.h:128
pwm_fault_pad_polarity_t
Definition: hpm_pwmv2_drv.h:92
struct pwmv2_cmp_calculate_cfg pwmv2_cmp_calculate_cfg_t
static void pwmv2_clear_fault_event(PWMV2_Type *pwm_x, pwm_channel_t chn)
Clear fault event.
Definition: hpm_pwmv2_drv.h:815
static void pwmv2_select_recovery_fault_trigmux_index(PWMV2_Type *pwm_x, pwm_channel_t chn, uint8_t trigmux_index)
Selection of trigger signal for fault recovery.
Definition: hpm_pwmv2_drv.h:680
static void pwmv2_calculate_set_low_limit_parameter(PWMV2_Type *pwm_x, uint8_t cal_index, uint8_t value)
Set calculate low limit parameter.
Definition: hpm_pwmv2_drv.h:1700
static void pwmv2_disable_fault_irq(PWMV2_Type *pwm_x, pwm_channel_t channel_index)
disable fault irq
Definition: hpm_pwmv2_drv.h:1238
#define PWM_UNLOCK_KEY
Definition: hpm_pwmv2_drv.h:23
pwm_cmp_shadow_register_update_trigger_t
Definition: hpm_pwmv2_drv.h:154
static void pwmv2_set_reload_update_time(PWMV2_Type *pwm_x, pwm_counter_t counter, pwm_reload_update_time_t update)
Set reload update time.
Definition: hpm_pwmv2_drv.h:1356
static void pwmv2_calculate_select_in_value(PWMV2_Type *pwm_x, uint8_t cal_index, uint8_t index)
Select calculate input value.
Definition: hpm_pwmv2_drv.h:1748
static void pwmv2_clear_calculate_overflow_irq_status(PWMV2_Type *pwm_x)
clear calculate overflow irq status
Definition: hpm_pwmv2_drv.h:976
static void pwmv2_calculate_select_counter_calculate_index(PWMV2_Type *pwm_x, uint8_t cal_index, uint8_t counter_calculate)
Select calculate index to counter.
Definition: hpm_pwmv2_drv.h:1736
static void pwmv2_enable_invert_by_shadow(PWMV2_Type *pwm_x, pwm_channel_t chn, pwm_shadow_register_output_polarity_t update_select)
Enable invert operations via shadow registers.
Definition: hpm_pwmv2_drv.h:483
static void pwmv2_force_update_time_by_shadow(PWMV2_Type *pwm_x, pwm_channel_t chn, pwm_force_shadow_trigger_t update_time)
Forces the output configuration to be updated from the time shadow hosting takes effect.
Definition: hpm_pwmv2_drv.h:529
void pwmv2_config_async_fault_source(PWMV2_Type *pwm_x, pwm_channel_t index, pwmv2_async_fault_source_config_t *config)
config async fault source
Definition: hpm_pwmv2_drv.c:71
@ pwm_counter_1
Definition: hpm_pwmv2_drv.h:50
@ pwm_counter_0
Definition: hpm_pwmv2_drv.h:49
@ pwm_counter_2
Definition: hpm_pwmv2_drv.h:51
@ pwm_counter_3
Definition: hpm_pwmv2_drv.h:52
@ cmp_value_fffff000
Definition: hpm_pwmv2_drv.h:169
@ cmp_value_ffffff00
Definition: hpm_pwmv2_drv.h:170
@ cmp_value_from_calculate
Definition: hpm_pwmv2_drv.h:166
@ cmp_value_from_capture_posedge
Definition: hpm_pwmv2_drv.h:167
@ cmp_value_from_counters
Definition: hpm_pwmv2_drv.h:168
@ cmp_value_from_shadow_val
Definition: hpm_pwmv2_drv.h:165
@ pwm_dac_channel_2
Definition: hpm_pwmv2_drv.h:138
@ pwm_dac_channel_1
Definition: hpm_pwmv2_drv.h:137
@ pwm_dac_channel_3
Definition: hpm_pwmv2_drv.h:139
@ pwm_dac_channel_0
Definition: hpm_pwmv2_drv.h:136
@ pwm_channel_2
Definition: hpm_pwmv2_drv.h:58
@ pwm_channel_7
Definition: hpm_pwmv2_drv.h:63
@ pwm_channel_1
Definition: hpm_pwmv2_drv.h:57
@ pwm_channel_4
Definition: hpm_pwmv2_drv.h:60
@ pwm_channel_6
Definition: hpm_pwmv2_drv.h:62
@ pwm_channel_5
Definition: hpm_pwmv2_drv.h:61
@ pwm_channel_3
Definition: hpm_pwmv2_drv.h:59
@ pwm_channel_0
Definition: hpm_pwmv2_drv.h:56
@ pwm_force_at_trigmux
Definition: hpm_pwmv2_drv.h:112
@ pwm_force_none
Definition: hpm_pwmv2_drv.h:113
@ pwm_force_immediately
Definition: hpm_pwmv2_drv.h:110
@ pwm_force_at_reload
Definition: hpm_pwmv2_drv.h:111
@ pwm_shadow_register_output_polarity_on_reload
Definition: hpm_pwmv2_drv.h:99
@ pwm_shadow_register_output_polarity_on_shlk
Definition: hpm_pwmv2_drv.h:98
@ pwm_capture_from_trigmux
Definition: hpm_pwmv2_drv.h:143
@ pwm_capture_from_gpio
Definition: hpm_pwmv2_drv.h:144
@ pwm_dma_0
Definition: hpm_pwmv2_drv.h:148
@ pwm_dma_1
Definition: hpm_pwmv2_drv.h:149
@ pwm_dma_2
Definition: hpm_pwmv2_drv.h:150
@ pwm_dma_3
Definition: hpm_pwmv2_drv.h:151
@ pwm_force_update_shadow_at_reload
Definition: hpm_pwmv2_drv.h:105
@ pwm_force_update_shadow_immediately
Definition: hpm_pwmv2_drv.h:103
@ pwm_force_update_shadow_at_cmp_point
Definition: hpm_pwmv2_drv.h:104
@ pwm_force_update_shadow_none
Definition: hpm_pwmv2_drv.h:106
@ pwm_logic_four_cmp_xor
Definition: hpm_pwmv2_drv.h:120
@ pwm_logic_four_cmp_or
Definition: hpm_pwmv2_drv.h:118
@ pwm_logic_four_cmp_and
Definition: hpm_pwmv2_drv.h:119
@ pwm_logic_four_cmp_cd
Definition: hpm_pwmv2_drv.h:121
@ pwm_reload_update_on_reload
Definition: hpm_pwmv2_drv.h:70
@ pwm_reload_update_on_compare_point
Definition: hpm_pwmv2_drv.h:69
@ pwm_reload_update_on_trigger
Definition: hpm_pwmv2_drv.h:71
@ pwm_reload_update_on_shlk
Definition: hpm_pwmv2_drv.h:68
@ pwm_force_output_no_force
Definition: hpm_pwmv2_drv.h:83
@ pwm_force_output_1
Definition: hpm_pwmv2_drv.h:81
@ pwm_force_output_high_z
Definition: hpm_pwmv2_drv.h:82
@ pwm_force_output_0
Definition: hpm_pwmv2_drv.h:80
@ pwm_fault_output_high_z
Definition: hpm_pwmv2_drv.h:89
@ pwm_fault_output_0
Definition: hpm_pwmv2_drv.h:87
@ pwm_fault_output_1
Definition: hpm_pwmv2_drv.h:88
@ pwm_fault_recovery_on_hw_event
Definition: hpm_pwmv2_drv.h:131
@ pwm_fault_recovery_on_fault_clear
Definition: hpm_pwmv2_drv.h:132
@ pwm_fault_recovery_immediately
Definition: hpm_pwmv2_drv.h:129
@ pwm_fault_recovery_on_reload
Definition: hpm_pwmv2_drv.h:130
@ pad_fault_active_high
Definition: hpm_pwmv2_drv.h:94
@ pad_fault_active_low
Definition: hpm_pwmv2_drv.h:93
@ pwm_shadow_register_update_on_trigmux
Definition: hpm_pwmv2_drv.h:158
@ pwm_shadow_register_update_on_shlk
Definition: hpm_pwmv2_drv.h:155
@ pwm_shadow_register_update_on_rld_cmp_select1
Definition: hpm_pwmv2_drv.h:160
@ pwm_shadow_register_update_on_reload
Definition: hpm_pwmv2_drv.h:157
@ pwm_shadow_register_update_on_modify
Definition: hpm_pwmv2_drv.h:156
@ pwm_shadow_register_update_on_none
Definition: hpm_pwmv2_drv.h:161
@ pwm_shadow_register_update_on_rld_cmp_select0
Definition: hpm_pwmv2_drv.h:159
#define PWMV2_CNT_CFG2_CNT_RELOAD_TRIG_SET(x)
Definition: hpm_pwmv2_regs.h:1030
#define PWMV2_GLB_CTRL2_DAC_SW_MODE_SET(x)
Definition: hpm_pwmv2_regs.h:469
#define PWMV2_CNT_CFG3_CNT_HW_START_EN_MASK
Definition: hpm_pwmv2_regs.h:1109
#define PWMV2_CNT_CFG1_CNT_LU_EN_MASK
Definition: hpm_pwmv2_regs.h:967
#define PWMV2_IRQ_STS_CMP_IRQ_STS_CMP_GET(x)
Definition: hpm_pwmv2_regs.h:691
#define PWMV2_FORCE_WORK_OUT_POLARITY_GET(x)
Definition: hpm_pwmv2_regs.h:532
#define PWMV2_CNT_CFG0_CNT_D_PARAM_MASK
Definition: hpm_pwmv2_regs.h:946
#define PWMV2_CAL_CFG1_CAL_LIM_UP_MASK
Definition: hpm_pwmv2_regs.h:1237
#define PWMV2_CAPTURE_POS_CAPTURE_SELGPIO_SET(x)
Definition: hpm_pwmv2_regs.h:583
#define PWMV2_CNT_CFG3_CNT_START_SEL_MASK
Definition: hpm_pwmv2_regs.h:1099
#define PWMV2_IRQ_EN_CAP_POS_IRQ_EN_CAP_POS_SET(x)
Definition: hpm_pwmv2_regs.h:778
#define PWMV2_PWM_CFG0_POL_UPDATE_SEL_SET(x)
Definition: hpm_pwmv2_regs.h:225
#define PWMV2_IRQ_STS_BURSTEND_IRQ_STS_BURSTEND_SET(x)
Definition: hpm_pwmv2_regs.h:745
#define PWMV2_IRQ_STS_IRQ_CAL_OVERFLOW_MASK
Definition: hpm_pwmv2_regs.h:612
#define PWMV2_CAL_CFG1_CAL_IN_INDEX_SET(x)
Definition: hpm_pwmv2_regs.h:1219
#define PWMV2_CNT_CFG1_CNT_IN_OFF_SET(x)
Definition: hpm_pwmv2_regs.h:1009
#define PWMV2_PWM_CFG0_TRIG_SEL4_MASK
Definition: hpm_pwmv2_regs.h:171
#define PWMV2_CMP_VAL_WORK_VALUE_GET(x)
Definition: hpm_pwmv2_regs.h:522
#define PWMV2_PWM_CFG1_PAIR_MODE_MASK
Definition: hpm_pwmv2_regs.h:321
#define PWMV2_CMP_CFG_CMP_CNT_MASK
Definition: hpm_pwmv2_regs.h:1322
#define PWMV2_GLB_CTRL_HR_PWM_EN_MASK
Definition: hpm_pwmv2_regs.h:446
#define PWMV2_FORCE_MODE_FORCE_MODE_SET(x)
Definition: hpm_pwmv2_regs.h:144
#define PWMV2_CNT_CFG2_CNT_UPDATE_TRIG0_MASK
Definition: hpm_pwmv2_regs.h:1068
#define PWMV2_DMA_EN_DMA0_SEL_SET(x)
Definition: hpm_pwmv2_regs.h:892
#define PWMV2_GLB_CTRL2_DEBUG_IN_EN_MASK
Definition: hpm_pwmv2_regs.h:477
#define PWMV2_CAL_CFG0_CAL_LU_PARAM_MASK
Definition: hpm_pwmv2_regs.h:1166
#define PWMV2_SHADOW_VAL_VALUE_SET(x)
Definition: hpm_pwmv2_regs.h:117
#define PWMV2_IRQ_EN_FAULT_IRQ_EN_FAULT_SET(x)
Definition: hpm_pwmv2_regs.h:800
#define PWMV2_IRQ_STS_FAULT_IRQ_STS_FAULT_SET(x)
Definition: hpm_pwmv2_regs.h:734
#define PWMV2_GLB_CTRL2_FAULT_CLEAR_SET(x)
Definition: hpm_pwmv2_regs.h:491
#define PWMV2_CAPTURE_POS_CNT_INDEX_SET(x)
Definition: hpm_pwmv2_regs.h:593
#define PWMV2_PWM_CFG1_FAULT_REC_SEL_MASK
Definition: hpm_pwmv2_regs.h:390
#define PWMV2_PWM_CFG1_FORCE_TIME_MASK
Definition: hpm_pwmv2_regs.h:350
#define PWMV2_IRQ_STS_CAP_POS_IRQ_STS_CAP_POS_GET(x)
Definition: hpm_pwmv2_regs.h:713
#define PWMV2_CAPTURE_POS_CAPTURE_SELGPIO_MASK
Definition: hpm_pwmv2_regs.h:581
#define PWMV2_CNT_CFG3_CNT_BURST_MASK
Definition: hpm_pwmv2_regs.h:1122
#define PWMV2_CAL_CFG0_CAL_T_PARAM_MASK
Definition: hpm_pwmv2_regs.h:1186
#define PWMV2_WORK_CTRL1_SHADOW_LOCK_MASK
Definition: hpm_pwmv2_regs.h:154
#define PWMV2_CNT_CFG1_CNT_LIM_LO_SET(x)
Definition: hpm_pwmv2_regs.h:999
#define PWMV2_PWM_CFG1_FORCE_UPDATE_TIME_SET(x)
Definition: hpm_pwmv2_regs.h:274
#define PWMV2_CNT_CFG0_RLD_UPDATE_TIME_MASK
Definition: hpm_pwmv2_regs.h:936
#define PWMV2_IRQ_STS_RELOAD_IRQ_STS_RELOAD_SET(x)
Definition: hpm_pwmv2_regs.h:701
#define PWMV2_CAL_CFG1_CAL_LL_EN_MASK
Definition: hpm_pwmv2_regs.h:1247
#define PWMV2_IRQ_STS_BURSTEND_IRQ_STS_BURSTEND_GET(x)
Definition: hpm_pwmv2_regs.h:746
#define PWMV2_CAPTURE_POS_CNT_INDEX_MASK
Definition: hpm_pwmv2_regs.h:591
#define PWMV2_CMP_CFG_CMP_IN_SEL_SET(x)
Definition: hpm_pwmv2_regs.h:1313
#define PWMV2_CNT_CFG2_CNT_TRIG0_MASK
Definition: hpm_pwmv2_regs.h:1088
#define PWMV2_CNT_CFG1_CNT_IN_OFF_MASK
Definition: hpm_pwmv2_regs.h:1007
#define PWMV2_CAL_CFG1_CAL_LIM_LO_MASK
Definition: hpm_pwmv2_regs.h:1257
#define PWMV2_PWM_CFG1_FAULT_REC_TIME_SET(x)
Definition: hpm_pwmv2_regs.h:299
#define PWMV2_PWM_CFG1_FORCE_TRIG_SEL_MASK
Definition: hpm_pwmv2_regs.h:360
#define PWMV2_PWM_CFG0_FAULT_EN_SYNC_MASK
Definition: hpm_pwmv2_regs.h:211
#define PWMV2_FORCE_MODE_POLARITY_SET(x)
Definition: hpm_pwmv2_regs.h:129
#define PWMV2_PWM_CFG1_FORCE_TIME_SET(x)
Definition: hpm_pwmv2_regs.h:352
#define PWMV2_CMP_CFG_CMP_CNT_SET(x)
Definition: hpm_pwmv2_regs.h:1324
#define PWMV2_PWM_CFG0_POLARITY_OPT0_MASK
Definition: hpm_pwmv2_regs.h:245
#define PWMV2_CMP_CFG_CMP_TRIG_SEL_SET(x)
Definition: hpm_pwmv2_regs.h:1280
#define PWMV2_CNT_CFG2_CNT_RELOAD_EN_MASK
Definition: hpm_pwmv2_regs.h:1018
#define PWMV2_PWM_CFG1_PWM_FORCE_SEL_MASK
Definition: hpm_pwmv2_regs.h:380
#define PWMV2_PWM_CFG0_OUT_POLARITY_MASK
Definition: hpm_pwmv2_regs.h:235
#define PWMV2_CNT_CFG2_CNT_TRIG1_MASK
Definition: hpm_pwmv2_regs.h:1058
#define PWMV2_IRQ_STS_CAP_POS_IRQ_STS_CAP_POS_SET(x)
Definition: hpm_pwmv2_regs.h:712
#define PWMV2_CAL_CFG1_CAL_T_INDEX_MASK
Definition: hpm_pwmv2_regs.h:1207
#define PWMV2_CNT_CFG2_CNT_UPDATE_EN0_MASK
Definition: hpm_pwmv2_regs.h:1078
#define PWMV2_DMA_EN_DMA0_SEL_MASK
Definition: hpm_pwmv2_regs.h:890
#define PWMV2_IRQ_EN_CMP_IRQ_EN_CMP_SET(x)
Definition: hpm_pwmv2_regs.h:756
#define PWMV2_IRQ_STS_CAP_NEG_IRQ_STS_CAP_NEG_GET(x)
Definition: hpm_pwmv2_regs.h:724
#define PWMV2_PWM_CFG0_FAULT_POL_ASYNC_SET(x)
Definition: hpm_pwmv2_regs.h:193
#define PWMV2_CMP_CFG_CMP_IN_SEL_MASK
Definition: hpm_pwmv2_regs.h:1311
#define PWMV2_CNT_CFG1_CNT_DAC_INDEX_SET(x)
Definition: hpm_pwmv2_regs.h:959
#define PWMV2_CNT_GLBCFG_TIMER_RESET_SET(x)
Definition: hpm_pwmv2_regs.h:1146
#define PWMV2_CMP_CFG_CMP_TRIG_SEL_MASK
Definition: hpm_pwmv2_regs.h:1278
#define PWMV2_PWM_CFG1_FAULT_MODE_SET(x)
Definition: hpm_pwmv2_regs.h:286
#define PWMV2_CAL_CFG1_CAL_IN_INDEX_MASK
Definition: hpm_pwmv2_regs.h:1217
#define PWMV2_PWM_CFG1_FAULT_REC_SEL_SET(x)
Definition: hpm_pwmv2_regs.h:392
#define PWMV2_PWM_CFG1_FORCE_TRIG_SEL_SET(x)
Definition: hpm_pwmv2_regs.h:362
#define PWMV2_PWM_CFG1_FORCE_ACT_SEL_MASK
Definition: hpm_pwmv2_regs.h:370
#define PWMV2_GLB_CTRL2_FAULT_CLEAR_MASK
Definition: hpm_pwmv2_regs.h:489
#define PWMV2_CAL_CFG0_CAL_LU_PARAM_SET(x)
Definition: hpm_pwmv2_regs.h:1168
#define PWMV2_CNT_GLBCFG_TIMER_ENABLE_SET(x)
Definition: hpm_pwmv2_regs.h:1157
#define PWMV2_CNT_CFG3_CNT_BURST_SET(x)
Definition: hpm_pwmv2_regs.h:1124
#define PWMV2_GLB_CTRL_OUTPUT_DELAY_SET(x)
Definition: hpm_pwmv2_regs.h:438
#define PWMV2_IRQ_STS_CMP_IRQ_STS_CMP_SET(x)
Definition: hpm_pwmv2_regs.h:690
#define PWMV2_IRQ_EN_RELOAD_IRQ_EN_RELOAD_SET(x)
Definition: hpm_pwmv2_regs.h:767
#define PWMV2_CNT_CFG0_RLD_CMP_SEL0_SET(x)
Definition: hpm_pwmv2_regs.h:913
#define PWMV2_TRIGGER_CFG_TRIGGER_OUT_SEL_MASK
Definition: hpm_pwmv2_regs.h:415
#define PWMV2_GLB_CTRL2_SHADOW_LOCK_EN_MASK
Definition: hpm_pwmv2_regs.h:499
#define PWMV2_PWM_CFG1_PWM_LOGIC_MASK
Definition: hpm_pwmv2_regs.h:335
#define PWMV2_CAL_CFG1_CAL_LU_EN_MASK
Definition: hpm_pwmv2_regs.h:1227
#define PWMV2_CNT_CFG0_CNT_D_PARAM_SET(x)
Definition: hpm_pwmv2_regs.h:948
#define PWMV2_TRIGGER_CFG_TRIGGER_OUT_SEL_SET(x)
Definition: hpm_pwmv2_regs.h:417
#define PWMV2_CNT_CFG1_CNT_LL_EN_MASK
Definition: hpm_pwmv2_regs.h:987
#define PWMV2_CAL_CFG0_CAL_D_PARAM_SET(x)
Definition: hpm_pwmv2_regs.h:1198
#define PWMV2_CAPTURE_NEG_CAPTURE_NEG_GET(x)
Definition: hpm_pwmv2_regs.h:604
#define PWMV2_CNT_CFG1_CNT_DAC_INDEX_MASK
Definition: hpm_pwmv2_regs.h:957
#define PWMV2_CAL_CFG0_CAL_LL_PARAM_SET(x)
Definition: hpm_pwmv2_regs.h:1178
#define PWMV2_CNT_CFG2_CNT_UPDATE_EN1_MASK
Definition: hpm_pwmv2_regs.h:1048
#define PWMV2_CNT_CFG2_CNT_TRIG0_SET(x)
Definition: hpm_pwmv2_regs.h:1090
#define PWMV2_CNT_CFG0_RLD_CMP_SEL1_SET(x)
Definition: hpm_pwmv2_regs.h:903
#define PWMV2_CNT_GLBCFG_CNT_SW_START_SET(x)
Definition: hpm_pwmv2_regs.h:1136
#define PWMV2_CNT_CFG0_RLD_TRIG_SEL_MASK
Definition: hpm_pwmv2_regs.h:921
#define PWMV2_FORCE_WORK_FORCE_MODE_GET(x)
Definition: hpm_pwmv2_regs.h:541
#define PWMV2_DMA_EN_DMA1_SEL_SHIFT
Definition: hpm_pwmv2_regs.h:871
#define PWMV2_PWM_CFG1_HIGHZ_EN_N_MASK
Definition: hpm_pwmv2_regs.h:256
#define PWMV2_CNT_CFG0_RLD_TRIG_SEL_SET(x)
Definition: hpm_pwmv2_regs.h:923
#define PWMV2_CNT_CFG0_RLD_CMP_SEL1_MASK
Definition: hpm_pwmv2_regs.h:901
#define PWMV2_CNT_CFG1_CNT_LIM_UP_MASK
Definition: hpm_pwmv2_regs.h:977
#define PWMV2_PWM_CFG1_PWM_FORCE_SEL_SET(x)
Definition: hpm_pwmv2_regs.h:382
#define PWMV2_IRQ_EN_CAP_NEG_IRQ_EN_CAP_NEG_SET(x)
Definition: hpm_pwmv2_regs.h:789
#define PWMV2_IRQ_STS_RELOAD_IRQ_STS_RELOAD_GET(x)
Definition: hpm_pwmv2_regs.h:702
#define PWMV2_CAL_CFG1_CAL_LIM_LO_SET(x)
Definition: hpm_pwmv2_regs.h:1259
#define PWMV2_CNT_RELOAD_WORK_VALUE_GET(x)
Definition: hpm_pwmv2_regs.h:512
#define PWMV2_IRQ_STS_FAULT_IRQ_STS_FAULT_GET(x)
Definition: hpm_pwmv2_regs.h:735
#define PWMV2_CNT_CFG0_RLD_UPDATE_TIME_SET(x)
Definition: hpm_pwmv2_regs.h:938
#define PWMV2_DAC_VALUE_SV_VALUE_SET(x)
Definition: hpm_pwmv2_regs.h:562
#define PWMV2_CNT_VAL_VALUE_GET(x)
Definition: hpm_pwmv2_regs.h:551
#define PWMV2_PWM_CFG0_FAULT_EN_ASYNC_MASK
Definition: hpm_pwmv2_regs.h:201
#define PWMV2_PWM_CFG0_FAULT_SEL_ASYNC_SET(x)
Definition: hpm_pwmv2_regs.h:183
#define PWMV2_CAL_CFG0_CAL_T_PARAM_SET(x)
Definition: hpm_pwmv2_regs.h:1188
#define PWMV2_CAL_CFG1_CAL_IN_OFF_MASK
Definition: hpm_pwmv2_regs.h:1267
#define PWMV2_IRQ_EN_IRQ_EN_OVERFLOW_MASK
Definition: hpm_pwmv2_regs.h:677
#define PWMV2_PWM_CFG0_FAULT_POL_ASYNC_MASK
Definition: hpm_pwmv2_regs.h:191
#define PWMV2_PWM_CFG1_FORCE_UPDATE_TIME_MASK
Definition: hpm_pwmv2_regs.h:272
#define PWMV2_CAPTURE_POS_CAPTURE_POS_GET(x)
Definition: hpm_pwmv2_regs.h:573
#define PWMV2_CAL_CFG0_CAL_D_PARAM_MASK
Definition: hpm_pwmv2_regs.h:1196
#define PWMV2_IRQ_STS_CAP_NEG_IRQ_STS_CAP_NEG_SET(x)
Definition: hpm_pwmv2_regs.h:723
#define PWMV2_CMP_CFG_CMP_UPDATE_TIME_MASK
Definition: hpm_pwmv2_regs.h:1295
#define PWMV2_CAL_CFG1_CAL_T_INDEX_SET(x)
Definition: hpm_pwmv2_regs.h:1209
#define PWMV2_CAL_CFG1_CAL_IN_OFF_SET(x)
Definition: hpm_pwmv2_regs.h:1269
#define PWMV2_PWM_CFG1_FORCE_ACT_SEL_SET(x)
Definition: hpm_pwmv2_regs.h:372
#define PWMV2_PWM_CFG1_FAULT_MODE_MASK
Definition: hpm_pwmv2_regs.h:284
#define PWMV2_PWM_CFG1_SW_FORCE_EN_MASK
Definition: hpm_pwmv2_regs.h:308
#define PWMV2_CAL_CFG1_CAL_LIM_UP_SET(x)
Definition: hpm_pwmv2_regs.h:1239
#define PWMV2_CMP_CFG_CMP_UPDATE_TIME_SET(x)
Definition: hpm_pwmv2_regs.h:1297
#define PWMV2_PWM_CFG0_FAULT_SEL_ASYNC_MASK
Definition: hpm_pwmv2_regs.h:181
#define PWMV2_PWM_DEAD_AREA_DEAD_AREA_SET(x)
Definition: hpm_pwmv2_regs.h:406
#define PWMV2_CNT_CFG3_CNT_START_SEL_SET(x)
Definition: hpm_pwmv2_regs.h:1101
#define PWMV2_CNT_CFG1_CNT_LIM_UP_SET(x)
Definition: hpm_pwmv2_regs.h:979
#define PWMV2_CNT_CFG2_CNT_UPDATE_TRIG1_MASK
Definition: hpm_pwmv2_regs.h:1038
#define PWMV2_GLB_CTRL_OUTPUT_DELAY_MASK
Definition: hpm_pwmv2_regs.h:436
#define PWMV2_CNT_CFG2_CNT_UPDATE_TRIG1_SET(x)
Definition: hpm_pwmv2_regs.h:1040
#define PWMV2_CNT_CFG2_CNT_RELOAD_TRIG_MASK
Definition: hpm_pwmv2_regs.h:1028
#define PWMV2_PWM_CFG1_FAULT_REC_TIME_MASK
Definition: hpm_pwmv2_regs.h:297
#define PWMV2_CAL_CFG0_CAL_LL_PARAM_MASK
Definition: hpm_pwmv2_regs.h:1176
#define PWMV2_PWM_CFG0_POL_UPDATE_SEL_MASK
Definition: hpm_pwmv2_regs.h:223
#define PWMV2_CNT_CFG2_CNT_UPDATE_TRIG0_SET(x)
Definition: hpm_pwmv2_regs.h:1070
#define PWMV2_CNT_CFG2_CNT_TRIG1_SET(x)
Definition: hpm_pwmv2_regs.h:1060
#define PWMV2_CNT_CFG0_RLD_CMP_SEL0_MASK
Definition: hpm_pwmv2_regs.h:911
#define PWMV2_DMA_EN_DMA0_EN_MASK
Definition: hpm_pwmv2_regs.h:880
#define PWMV2_PWM_CFG1_PWM_LOGIC_SET(x)
Definition: hpm_pwmv2_regs.h:337
#define PWMV2_CNT_CFG1_CNT_LIM_LO_MASK
Definition: hpm_pwmv2_regs.h:997
#define PWMV2_GLB_CTRL_SW_FORCE_SET(x)
Definition: hpm_pwmv2_regs.h:428
#define fencerw()
execute fence rw
Definition: riscv_core.h:94
Definition: hpm_pwmv2_regs.h:12
__RW uint32_t IRQ_EN_CAP_POS
Definition: hpm_pwmv2_regs.h:54
__RW uint32_t GLB_CTRL2
Definition: hpm_pwmv2_regs.h:28
__RW uint32_t WORK_CTRL0
Definition: hpm_pwmv2_regs.h:13
__R uint32_t CAPTURE_NEG[8]
Definition: hpm_pwmv2_regs.h:40
__W uint32_t IRQ_STS_RELOAD
Definition: hpm_pwmv2_regs.h:46
__RW uint32_t IRQ_EN_BURSTEND
Definition: hpm_pwmv2_regs.h:57
__R uint32_t CNT_RELOAD_WORK[4]
Definition: hpm_pwmv2_regs.h:30
__R uint32_t CNT_VAL[4]
Definition: hpm_pwmv2_regs.h:35
__RW uint32_t CFG2
Definition: hpm_pwmv2_regs.h:64
__RW uint32_t DEAD_AREA
Definition: hpm_pwmv2_regs.h:22
__W uint32_t IRQ_STS_FAULT
Definition: hpm_pwmv2_regs.h:49
__RW uint32_t IRQ_EN_CMP
Definition: hpm_pwmv2_regs.h:52
__RW uint32_t CAPTURE_POS[8]
Definition: hpm_pwmv2_regs.h:38
struct PWMV2_Type::@694 CNT[4]
__RW uint32_t TRIGGER_CFG[8]
Definition: hpm_pwmv2_regs.h:25
__W uint32_t IRQ_STS_BURSTEND
Definition: hpm_pwmv2_regs.h:50
__RW uint32_t UNLOCK
Definition: hpm_pwmv2_regs.h:14
__RW uint32_t CFG0
Definition: hpm_pwmv2_regs.h:20
__RW uint32_t SHADOW_VAL[28]
Definition: hpm_pwmv2_regs.h:15
__W uint32_t IRQ_STS_CMP
Definition: hpm_pwmv2_regs.h:45
__RW uint32_t CNT_GLBCFG
Definition: hpm_pwmv2_regs.h:67
__RW uint32_t WORK_CTRL1
Definition: hpm_pwmv2_regs.h:17
__W uint32_t IRQ_STS_CAP_POS
Definition: hpm_pwmv2_regs.h:47
__R uint32_t CMP_VAL_WORK[24]
Definition: hpm_pwmv2_regs.h:31
__RW uint32_t IRQ_EN_RELOAD
Definition: hpm_pwmv2_regs.h:53
__RW uint32_t CFG
Definition: hpm_pwmv2_regs.h:76
__RW uint32_t DMA_EN
Definition: hpm_pwmv2_regs.h:59
struct PWMV2_Type::@693 PWM[8]
__R uint32_t FORCE_WORK
Definition: hpm_pwmv2_regs.h:33
__RW uint32_t IRQ_EN
Definition: hpm_pwmv2_regs.h:43
__RW uint32_t IRQ_STS
Definition: hpm_pwmv2_regs.h:42
__RW uint32_t GLB_CTRL
Definition: hpm_pwmv2_regs.h:27
__RW uint32_t IRQ_EN_CAP_NEG
Definition: hpm_pwmv2_regs.h:55
__RW uint32_t IRQ_EN_FAULT
Definition: hpm_pwmv2_regs.h:56
__RW uint32_t DAC_VALUE_SV[4]
Definition: hpm_pwmv2_regs.h:36
struct PWMV2_Type::@696 CMP[24]
__RW uint32_t CFG1
Definition: hpm_pwmv2_regs.h:21
__RW uint32_t FORCE_MODE
Definition: hpm_pwmv2_regs.h:16
__W uint32_t IRQ_STS_CAP_NEG
Definition: hpm_pwmv2_regs.h:48
__RW uint32_t CFG3
Definition: hpm_pwmv2_regs.h:65
struct PWMV2_Type::@695 CAL[16]
pwm config data
Definition: hpm_pwm_drv.h:175
pair pwm config
Definition: hpm_pwm_drv.h:192
pwm fault source config
Definition: hpm_pwmv2_drv.h:194
uint8_t async_signal_from_pad_index
Definition: hpm_pwmv2_drv.h:195
pwm_fault_pad_polarity_t fault_async_pad_level
Definition: hpm_pwmv2_drv.h:196
Definition: hpm_pwmv2_drv.h:231
uint8_t up_limit_offset_index
Definition: hpm_pwmv2_drv.h:238
uint8_t low_limit_offset_index
Definition: hpm_pwmv2_drv.h:240
int8_t d_param
Definition: hpm_pwmv2_drv.h:236
bool enable_up_limit
Definition: hpm_pwmv2_drv.h:241
int8_t t_param
Definition: hpm_pwmv2_drv.h:235
int8_t up_limit_param
Definition: hpm_pwmv2_drv.h:237
uint8_t counter_index
Definition: hpm_pwmv2_drv.h:232
int8_t low_limit_param
Definition: hpm_pwmv2_drv.h:239
uint8_t in_offset_index
Definition: hpm_pwmv2_drv.h:234
bool enbale_low_limit
Definition: hpm_pwmv2_drv.h:242
uint8_t in_index
Definition: hpm_pwmv2_drv.h:233
pwm compare config
Definition: hpm_pwmv2_drv.h:177
pwm_cmp_shadow_register_update_trigger_t update_trigger
Definition: hpm_pwmv2_drv.h:185
uint32_t cmp
Definition: hpm_pwmv2_drv.h:178
pwm_counter_t cmp_use_counter
Definition: hpm_pwmv2_drv.h:182
bool enable_half_cmp
Definition: hpm_pwmv2_drv.h:179
uint8_t update_trigger_index
Definition: hpm_pwmv2_drv.h:186
uint8_t cmp_source_index
Definition: hpm_pwmv2_drv.h:183
uint8_t mode
Definition: hpm_pwmv2_drv.h:184
uint8_t hrcmp
Definition: hpm_pwmv2_drv.h:187
pwm_cmp_source_t cmp_source
Definition: hpm_pwmv2_drv.h:181
bool enable_hrcmp
Definition: hpm_pwmv2_drv.h:180
pwm config data
Definition: hpm_pwmv2_drv.h:203
pwm_logic_four_cmp_cfg_t logic
Definition: hpm_pwmv2_drv.h:211
uint8_t force_shadow_trigmux_index
Definition: hpm_pwmv2_drv.h:216
bool enable_async_fault
Definition: hpm_pwmv2_drv.h:205
uint8_t force_trigmux_index
Definition: hpm_pwmv2_drv.h:218
bool enable_four_cmp
Definition: hpm_pwmv2_drv.h:208
pwm_force_shadow_trigger_t force_shadow_trigger
Definition: hpm_pwmv2_drv.h:217
pwm_fault_recovery_trigger_t fault_recovery_trigger
Definition: hpm_pwmv2_drv.h:214
uint8_t fault_mode
Definition: hpm_pwmv2_drv.h:213
pwmv2_async_fault_source_config_t async_fault_source
Definition: hpm_pwmv2_drv.h:209
uint32_t dead_zone_in_half_cycle
Definition: hpm_pwmv2_drv.h:220
bool enable_sync_fault
Definition: hpm_pwmv2_drv.h:206
uint8_t fault_recovery_trigmux_index
Definition: hpm_pwmv2_drv.h:215
bool enable_output
Definition: hpm_pwmv2_drv.h:204
pwm_shadow_register_output_polarity_t update_polarity_time
Definition: hpm_pwmv2_drv.h:210
bool invert_output
Definition: hpm_pwmv2_drv.h:207
pwm_force_trigger_t force_trigger
Definition: hpm_pwmv2_drv.h:219
uint8_t update_trigger
Definition: hpm_pwmv2_drv.h:212
pair pwm config
Definition: hpm_pwmv2_drv.h:227
pwmv2_config_t pwm[2]
Definition: hpm_pwmv2_drv.h:228