1 /* 2 * Copyright (c) 2021 Chipsea Technologies (Shenzhen) Corp., Ltd. All rights reserved. 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 #ifndef _CS1000AUD_LED_PWM_H_ 16 #define _CS1000AUD_LED_PWM_H_ 17 18 #include "chip.h" 19 20 // ============================================================================= 21 // MACROS 22 // ============================================================================= 23 24 // ============================================================================= 25 // TYPES 26 // ============================================================================= 27 28 // ============================================================================= 29 // CS1000AUD_LED_PWM_T 30 // ----------------------------------------------------------------------------- 31 /// 32 // ============================================================================= 33 #define REG_CS1000AUD_LED_PWM_BASE 0x50014000 34 35 typedef struct { 36 __IO uint32_t tmr0_ld_value; //0x00000000 37 __IO uint32_t Reserved_00000004; //0x00000004 38 __IO uint32_t tmr0_cnt_value; //0x00000008 39 __IO uint32_t Reserved_0000000C; //0x0000000C 40 __IO uint32_t tmr0_cfg; //0x00000010 41 __IO uint32_t tmr0_int_ctrl; //0x00000014 42 __IO uint32_t tmr0_cnt_read; //0x00000018 43 __IO uint32_t Reserved_0000001C; //0x0000001C 44 __IO uint32_t tmr1_ld_value; //0x00000020 45 __IO uint32_t Reserved_00000024; //0x00000024 46 __IO uint32_t tmr1_cnt_value; //0x00000028 47 __IO uint32_t Reserved_0000002C; //0x0000002C 48 __IO uint32_t tmr1_cfg; //0x00000030 49 __IO uint32_t tmr1_int_ctrl; //0x00000034 50 __IO uint32_t tmr1_cnt_read; //0x00000038 51 __IO uint32_t Reserved_0000003C[49]; //0x0000003C 52 __IO uint32_t pwm0_sta_val; //0x00000100 53 __IO uint32_t pwm0_end_val; //0x00000104 54 __IO uint32_t pwm0_step_cfg0; //0x00000108 55 __IO uint32_t pwm0_step_cfg1; //0x0000010C 56 __IO uint32_t pwm0_cfg; //0x00000110 57 __IO uint32_t pwm0_int_ctrl; //0x00000114 58 __IO uint32_t pwm0_end_val_use; //0x00000118 59 __IO uint32_t pwm0_step_cnt; //0x0000011C 60 __IO uint32_t pwm1_sta_val; //0x00000120 61 __IO uint32_t pwm1_end_val; //0x00000124 62 __IO uint32_t pwm1_step_cfg0; //0x00000128 63 __IO uint32_t pwm1_step_cfg1; //0x0000012C 64 __IO uint32_t pwm1_cfg; //0x00000130 65 __IO uint32_t pwm1_int_ctrl; //0x00000134 66 __IO uint32_t pwm1_end_val_use; //0x00000138 67 __IO uint32_t pwm1_step_cnt; //0x0000013C 68 } HWP_CS1000AUD_LED_PWM_T; 69 70 static HWP_CS1000AUD_LED_PWM_T * const cs1000audLedPwm = ((HWP_CS1000AUD_LED_PWM_T *)REG_CS1000AUD_LED_PWM_BASE); 71 72 73 //tmr0_ld_value 74 #define CS1000AUD_LED_PWM_TMR_LD_VALUE(n) (((n)&0xFFFFFFFF)<<0) 75 76 //tmr0_cnt_value 77 #define CS1000AUD_LED_PWM_TMR_CNT_VALUE(n) (((n)&0xFFFFFFFF)<<0) 78 79 //tmr0_cfg 80 #define CS1000AUD_LED_PWM_TMR_MODE (1<<0) 81 #define CS1000AUD_LED_PWM_TMR_RUN (1<<1) 82 83 //tmr0_int_ctrl 84 #define CS1000AUD_LED_PWM_TMR_INT_EN (1<<0) 85 #define CS1000AUD_LED_PWM_TMR_INT_RAW (1<<1) 86 #define CS1000AUD_LED_PWM_TMR_INT_STATUS (1<<2) 87 #define CS1000AUD_LED_PWM_TMR_INT_CLR (1<<3) 88 89 //tmr0_cnt_read 90 #define CS1000AUD_LED_PWM_TMR_CNT_READ(n) (((n)&0xFFFFFFFF)<<0) 91 92 //tmr1_ld_value 93 //#define CS1000AUD_LED_PWM_TMR_LD_VALUE(n) (((n)&0xFFFFFFFF)<<0) 94 95 //tmr1_cnt_value 96 //#define CS1000AUD_LED_PWM_TMR_CNT_VALUE(n) (((n)&0xFFFFFFFF)<<0) 97 98 //tmr1_cfg 99 //#define CS1000AUD_LED_PWM_TMR_MODE (1<<0) 100 //#define CS1000AUD_LED_PWM_TMR_RUN (1<<1) 101 102 //tmr1_int_ctrl 103 //#define CS1000AUD_LED_PWM_TMR_INT_EN (1<<0) 104 //#define CS1000AUD_LED_PWM_TMR_INT_RAW (1<<1) 105 //#define CS1000AUD_LED_PWM_TMR_INT_STATUS (1<<2) 106 //#define CS1000AUD_LED_PWM_TMR_INT_CLR (1<<3) 107 108 //tmr1_cnt_read 109 //#define CS1000AUD_LED_PWM_TMR_CNT_READ(n) (((n)&0xFFFFFFFF)<<0) 110 111 //pwm0_sta_val 112 #define CS1000AUD_LED_PWM_PWM_STA_VAL(n) (((n)&0xFFFFFFFF)<<0) 113 114 //pwm0_end_val 115 #define CS1000AUD_LED_PWM_PWM_END_VAL(n) (((n)&0xFFFFFFFF)<<0) 116 117 //pwm0_step_cfg0 118 #define CS1000AUD_LED_PWM_PWM_STEP_CYC(n) (((n)&0xFFFF)<<0) 119 #define CS1000AUD_LED_PWM_PWM_STEP_NUM(n) (((n)&0xFFFF)<<16) 120 121 //pwm0_step_cfg1 122 #define CS1000AUD_LED_PWM_PWM_STEP_VALUE(n) (((n)&0xFFFFFFFF)<<0) 123 124 //pwm0_cfg 125 #define CS1000AUD_LED_PWM_PWM_RUN (1<<0) 126 #define CS1000AUD_LED_PWM_PWM_INC_MODE (1<<1) 127 #define CS1000AUD_LED_PWM_PWM_DEFAULT_VAL (1<<2) 128 #define CS1000AUD_LED_PWM_PWM_TMR_SEL(n) (((n)&3)<<16) 129 #define CS1000AUD_LED_PWM_PWM_UPDATE (1<<31) 130 131 //pwm0_int_ctrl 132 #define CS1000AUD_LED_PWM_PWM_INT_EN (1<<0) 133 #define CS1000AUD_LED_PWM_PWM_INT_RAW (1<<1) 134 #define CS1000AUD_LED_PWM_PWM_INT_STATUS (1<<2) 135 #define CS1000AUD_LED_PWM_PWM_INT_CLR (1<<3) 136 137 //pwm0_end_val_use 138 #define CS1000AUD_LED_PWM_PWM_END_VAL_USE(n) (((n)&0xFFFFFFFF)<<0) 139 140 //pwm0_step_cnt 141 #define CS1000AUD_LED_PWM_PWM_STEP_CYC_CNT(n) (((n)&0xFFFF)<<0) 142 #define CS1000AUD_LED_PWM_PWM_STEP_NUM_CNT(n) (((n)&0xFFFF)<<16) 143 144 //pwm1_sta_val 145 //#define CS1000AUD_LED_PWM_PWM_STA_VAL(n) (((n)&0xFFFFFFFF)<<0) 146 147 //pwm1_end_val 148 //#define CS1000AUD_LED_PWM_PWM_END_VAL(n) (((n)&0xFFFFFFFF)<<0) 149 150 //pwm1_step_cfg0 151 //#define CS1000AUD_LED_PWM_PWM_STEP_CYC(n) (((n)&0xFFFF)<<0) 152 //#define CS1000AUD_LED_PWM_PWM_STEP_NUM(n) (((n)&0xFFFF)<<16) 153 154 //pwm1_step_cfg1 155 //#define CS1000AUD_LED_PWM_PWM_STEP_VALUE(n) (((n)&0xFFFFFFFF)<<0) 156 157 //pwm1_cfg 158 //#define CS1000AUD_LED_PWM_PWM_RUN (1<<0) 159 //#define CS1000AUD_LED_PWM_PWM_INC_MODE (1<<1) 160 //#define CS1000AUD_LED_PWM_PWM_DEFAULT_VAL (1<<2) 161 //#define CS1000AUD_LED_PWM_PWM_TMR_SEL(n) (((n)&3)<<16) 162 //#define CS1000AUD_LED_PWM_PWM_UPDATE (1<<31) 163 164 //pwm1_int_ctrl 165 //#define CS1000AUD_LED_PWM_PWM_INT_EN (1<<0) 166 //#define CS1000AUD_LED_PWM_PWM_INT_RAW (1<<1) 167 //#define CS1000AUD_LED_PWM_PWM_INT_STATUS (1<<2) 168 //#define CS1000AUD_LED_PWM_PWM_INT_CLR (1<<3) 169 170 //pwm1_end_val_use 171 //#define CS1000AUD_LED_PWM_PWM_END_VAL_USE(n) (((n)&0xFFFFFFFF)<<0) 172 173 //pwm1_step_cnt 174 //#define CS1000AUD_LED_PWM_PWM_STEP_CYC_CNT(n) (((n)&0xFFFF)<<0) 175 //#define CS1000AUD_LED_PWM_PWM_STEP_NUM_CNT(n) (((n)&0xFFFF)<<16) 176 177 #endif 178