| 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2003-2011, Broadcom Corporation |
|---|
| 3 | * All Rights Reserved |
|---|
| 4 | * Confidential Property of Broadcom Corporation |
|---|
| 5 | * |
|---|
| 6 | * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE |
|---|
| 7 | * AGREEMENT BETWEEN THE USER AND BROADCOM. YOU HAVE NO RIGHT TO USE OR |
|---|
| 8 | * EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. |
|---|
| 9 | * |
|---|
| 10 | * $brcm_Workfile: bpwm.h $ |
|---|
| 11 | * $brcm_Revision: Hydra_Software_Devel/22 $ |
|---|
| 12 | * $brcm_Date: 6/7/11 1:16p $ |
|---|
| 13 | * |
|---|
| 14 | * Module Description: |
|---|
| 15 | * |
|---|
| 16 | * Revision History: |
|---|
| 17 | * |
|---|
| 18 | * $brcm_Log: /magnum/portinginterface/pwm/7038/bpwm.h $ |
|---|
| 19 | * |
|---|
| 20 | * Hydra_Software_Devel/22 6/7/11 1:16p nickh |
|---|
| 21 | * SW7425-685: Increase PWM channels for 7425 |
|---|
| 22 | * |
|---|
| 23 | * Hydra_Software_Devel/21 3/14/11 2:33p jhaberf |
|---|
| 24 | * SW35330-13: replaced 35330 support with 35233 support |
|---|
| 25 | * |
|---|
| 26 | * Hydra_Software_Devel/20 2/23/11 3:21p nickh |
|---|
| 27 | * SW7422-286: Increase PWM channels to match HW |
|---|
| 28 | * |
|---|
| 29 | * Hydra_Software_Devel/19 11/5/10 7:47p jhaberf |
|---|
| 30 | * SW35125-1: Added 35125 DTV chip support |
|---|
| 31 | * |
|---|
| 32 | * Hydra_Software_Devel/18 5/17/10 3:00p brianlee |
|---|
| 33 | * SW35230-239: Added new APIs to select open drain/totem pole output. |
|---|
| 34 | * Also fixed a previous bug with setting totem pole output. |
|---|
| 35 | * |
|---|
| 36 | * Hydra_Software_Devel/17 4/26/10 11:20a brianlee |
|---|
| 37 | * SW35230-195: Added support for multiple PWM cores. Also added new APIs |
|---|
| 38 | * to set/get output polarity. |
|---|
| 39 | * |
|---|
| 40 | * Hydra_Software_Devel/16 2/10/10 3:10p farshidf |
|---|
| 41 | * SW3548-2779: add BPWM_GetOnInterval_isr |
|---|
| 42 | * |
|---|
| 43 | * Hydra_Software_Devel/15 11/24/09 5:39p brianlee |
|---|
| 44 | * SW35230-23: Added new APIs for 35230 (stubs). |
|---|
| 45 | * |
|---|
| 46 | * Hydra_Software_Devel/14 8/4/09 1:27p erickson |
|---|
| 47 | * PR57259: add BPWM_RampOnInterval and related settings |
|---|
| 48 | * |
|---|
| 49 | * Hydra_Software_Devel/13 12/3/08 10:16a kaushikb |
|---|
| 50 | * PR49867: Adding support for 7420 |
|---|
| 51 | * |
|---|
| 52 | * Hydra_Software_Devel/12 8/27/08 1:34p farshidf |
|---|
| 53 | * PR45894: BPWM_SetOnInterval_isr which is safe ro call under isr since |
|---|
| 54 | * we just write to the register the value passed |
|---|
| 55 | * |
|---|
| 56 | * Hydra_Software_Devel/10 1/22/07 1:45p farshidf |
|---|
| 57 | * PR27084: remove the warning |
|---|
| 58 | * |
|---|
| 59 | * Hydra_Software_Devel/9 1/15/07 6:02p farshidf |
|---|
| 60 | * PR27084: change FreqModeType to BPWM_FreqModeType |
|---|
| 61 | * |
|---|
| 62 | * Hydra_Software_Devel/8 1/15/07 2:32p farshidf |
|---|
| 63 | * PR27084: add example of how to use the new APIs |
|---|
| 64 | * |
|---|
| 65 | * Hydra_Software_Devel/7 1/15/07 11:10a farshidf |
|---|
| 66 | * PR27084: add PWM Freq and contant modes. Add also the On and Period |
|---|
| 67 | * intervals functions |
|---|
| 68 | * |
|---|
| 69 | * Hydra_Software_Devel/6 10/20/03 6:04p brianlee |
|---|
| 70 | * Added #define for number of PWM channels. |
|---|
| 71 | * |
|---|
| 72 | * Hydra_Software_Devel/5 10/1/03 11:41a brianlee |
|---|
| 73 | * Fixed sample code. |
|---|
| 74 | * |
|---|
| 75 | * Hydra_Software_Devel/4 9/25/03 12:13p brianlee |
|---|
| 76 | * Fixed tags for Midas service generator. |
|---|
| 77 | * |
|---|
| 78 | * Hydra_Software_Devel/3 9/17/03 9:53a brianlee |
|---|
| 79 | * Fixed sample code. Add error code. |
|---|
| 80 | * |
|---|
| 81 | * Hydra_Software_Devel/1 7/24/03 5:28p brianlee |
|---|
| 82 | * Initial version. |
|---|
| 83 | * |
|---|
| 84 | ***************************************************************************/ |
|---|
| 85 | |
|---|
| 86 | |
|---|
| 87 | /*= Module Overview ********************************************************* |
|---|
| 88 | <verbatim> |
|---|
| 89 | |
|---|
| 90 | Overview |
|---|
| 91 | The PWM PI module controls the PWM core within the BCM7038. |
|---|
| 92 | There are two independent PWM generators, each with programmable |
|---|
| 93 | control word (duty cycle). |
|---|
| 94 | |
|---|
| 95 | Design |
|---|
| 96 | The design for BPWM PI API is broken into two parts. |
|---|
| 97 | Part 1 (open/close/configuration): |
|---|
| 98 | These APIs are used for opening and closing BPWM device/device channel. |
|---|
| 99 | Part 2 (setting control word): |
|---|
| 100 | These APIs are used to program the control word. |
|---|
| 101 | Part 3 (start/stop PWM generation): |
|---|
| 102 | These APIs are used to start and stop PWM signal generation. |
|---|
| 103 | |
|---|
| 104 | Usage |
|---|
| 105 | The usage of BPWM involves the following: |
|---|
| 106 | * Configure/Open of BPWM |
|---|
| 107 | * Configure BPWM device for the target system |
|---|
| 108 | * Open BPWM device |
|---|
| 109 | * Configure BPWM device channel for the target system |
|---|
| 110 | * Open BPWM device channel |
|---|
| 111 | * Set the Frequency mode |
|---|
| 112 | * Program the desired frequency mode : Variable or constant mode |
|---|
| 113 | * Set control word |
|---|
| 114 | * Program the desired duty cycle through control word |
|---|
| 115 | * Set the On and Period interval in case of constant frequency mode |
|---|
| 116 | * Program the desired duty cycle with the on and period intervals |
|---|
| 117 | * Controlling PWM generation |
|---|
| 118 | * Starting and stopping PWM signal generation. |
|---|
| 119 | |
|---|
| 120 | sample code |
|---|
| 121 | void main( void ) |
|---|
| 122 | { |
|---|
| 123 | BPWM_Handle hPwm; |
|---|
| 124 | BPWM_ChannelHandle hPwmChan; |
|---|
| 125 | BREG_Handle hReg; |
|---|
| 126 | BCHP_Handle hChip; |
|---|
| 127 | BPWM_ChannelSettings defChnSettings; |
|---|
| 128 | unsigned int ChanNo; |
|---|
| 129 | |
|---|
| 130 | // Do other initialization, i.e. for BREG, BCHP, etc. |
|---|
| 131 | |
|---|
| 132 | BPWM_Open( &hPwm, hChip, hReg, (BPWM_Settings *)NULL ); |
|---|
| 133 | |
|---|
| 134 | ChanNo = 0; // example for channel 0 |
|---|
| 135 | BPWM_GetChannelDefaultSettings( hPwm, ChanNo, &defChnSettings ); |
|---|
| 136 | |
|---|
| 137 | // Make any changes required from the default values |
|---|
| 138 | defChnSettings.openDrainb = false; |
|---|
| 139 | defChnSettings.BPWM_FreqModeType= Variable_Freq_Mode; |
|---|
| 140 | |
|---|
| 141 | BPWM_OpenChannel( hPwm, &hPwmChan, ChanNo, &defChnSettings ); |
|---|
| 142 | |
|---|
| 143 | // in case you want to change the frequncy mode to contant mode to be able to control the duty cycle |
|---|
| 144 | BPWM_SetFreqMode (hPwmChan, Constant_Freq_Mode); |
|---|
| 145 | |
|---|
| 146 | // 50% duty cycle |
|---|
| 147 | BPWM_SetControlWord (hPwmChan, 0x8000); |
|---|
| 148 | |
|---|
| 149 | // set the On interval to 0x40 and the period interval to 0x80, that will keep the duty cycle at 50 |
|---|
| 150 | // you can change the duty cycle by chaaging the ratio of On and period intervals in case of contant frequency mode |
|---|
| 151 | // in case of variable frequency mode the On and period interval values will not have any impact. |
|---|
| 152 | BPWM_SetOnAndPeriodInterval (hPwmChan, 0x40, 0x80); |
|---|
| 153 | |
|---|
| 154 | // Now start pwm generation |
|---|
| 155 | BPWM_Start (hPwmChan); |
|---|
| 156 | |
|---|
| 157 | // Stop pwm generation |
|---|
| 158 | BPWM_Stop (hPwmChan); |
|---|
| 159 | |
|---|
| 160 | } |
|---|
| 161 | </verbatim> |
|---|
| 162 | ***************************************************************************/ |
|---|
| 163 | |
|---|
| 164 | |
|---|
| 165 | #ifndef BPWM_H__ |
|---|
| 166 | #define BPWM_H__ |
|---|
| 167 | |
|---|
| 168 | #include "bchp.h" |
|---|
| 169 | #include "breg_mem.h" |
|---|
| 170 | #include "bint.h" |
|---|
| 171 | #include "bkni.h" |
|---|
| 172 | #include "berr_ids.h" |
|---|
| 173 | |
|---|
| 174 | #ifdef __cplusplus |
|---|
| 175 | extern "C" { |
|---|
| 176 | #endif |
|---|
| 177 | |
|---|
| 178 | /*************************************************************************** |
|---|
| 179 | Summary: |
|---|
| 180 | Number of PWM channels supported |
|---|
| 181 | |
|---|
| 182 | Description: |
|---|
| 183 | |
|---|
| 184 | See Also: |
|---|
| 185 | |
|---|
| 186 | ****************************************************************************/ |
|---|
| 187 | #if ((BCHP_CHIP==35230) || (BCHP_CHIP==35125) || (BCHP_CHIP==35233)) |
|---|
| 188 | #define MAX_PWM_CHANNELS 10 |
|---|
| 189 | #elif ((BCHP_CHIP==7420) || (BCHP_CHIP==7422) || (BCHP_CHIP==7425)) |
|---|
| 190 | #define MAX_PWM_CHANNELS 4 |
|---|
| 191 | #else |
|---|
| 192 | #define MAX_PWM_CHANNELS 2 |
|---|
| 193 | #endif |
|---|
| 194 | |
|---|
| 195 | /*************************************************************************** |
|---|
| 196 | Summary: |
|---|
| 197 | Error Codes specific to BPWM |
|---|
| 198 | |
|---|
| 199 | Description: |
|---|
| 200 | |
|---|
| 201 | See Also: |
|---|
| 202 | |
|---|
| 203 | ****************************************************************************/ |
|---|
| 204 | #define BPWM_ERR_NOTAVAIL_CHN_NO BERR_MAKE_CODE(BERR_PWM_ID, 0) |
|---|
| 205 | |
|---|
| 206 | /*************************************************************************** |
|---|
| 207 | Summary: |
|---|
| 208 | The handles for pwm module. |
|---|
| 209 | |
|---|
| 210 | Description: |
|---|
| 211 | Since BPWM is a device channel, it has main device handle as well |
|---|
| 212 | as a device channel handle. |
|---|
| 213 | |
|---|
| 214 | See Also: |
|---|
| 215 | BPWM_Open(), BPWM_OpenChannel() |
|---|
| 216 | |
|---|
| 217 | ****************************************************************************/ |
|---|
| 218 | typedef struct BPWM_P_Handle *BPWM_Handle; |
|---|
| 219 | typedef struct BPWM_P_ChannelHandle *BPWM_ChannelHandle; |
|---|
| 220 | |
|---|
| 221 | /*************************************************************************** |
|---|
| 222 | Summary: |
|---|
| 223 | Required default settings structure for PWM module. |
|---|
| 224 | |
|---|
| 225 | Description: |
|---|
| 226 | The default setting structure defines the default configure of |
|---|
| 227 | PWM when the device is opened. Since BPWM is a device |
|---|
| 228 | channel, it also has default settings for a device channel. |
|---|
| 229 | Currently there are no parameters for device setting. |
|---|
| 230 | |
|---|
| 231 | See Also: |
|---|
| 232 | BPWM_Open(), BPWM_OpenChannel() |
|---|
| 233 | |
|---|
| 234 | ****************************************************************************/ |
|---|
| 235 | typedef struct BPWM_Settings |
|---|
| 236 | { |
|---|
| 237 | BINT_Handle hInterrupt; /* only required if using BPWM_RampOnInterval */ |
|---|
| 238 | } BPWM_Settings; |
|---|
| 239 | |
|---|
| 240 | typedef enum BPWM_FreqModeType |
|---|
| 241 | { |
|---|
| 242 | Variable_Freq_Mode = 0, |
|---|
| 243 | Constant_Freq_Mode = 1 |
|---|
| 244 | }BPWM_FreqModeType; |
|---|
| 245 | |
|---|
| 246 | /*************************************************************************** |
|---|
| 247 | Summary: |
|---|
| 248 | Enumeration for PWM open drain configuration |
|---|
| 249 | |
|---|
| 250 | Description: |
|---|
| 251 | This enumeration defines open drain config vs. totem pole output |
|---|
| 252 | |
|---|
| 253 | See Also: |
|---|
| 254 | None. |
|---|
| 255 | |
|---|
| 256 | ****************************************************************************/ |
|---|
| 257 | typedef enum BPWM_OpenDrainOutput |
|---|
| 258 | { |
|---|
| 259 | PwmOutOpenDrain = 0, |
|---|
| 260 | PwmOutTotemPole |
|---|
| 261 | } BPWM_OpenDrainOutput; |
|---|
| 262 | |
|---|
| 263 | typedef struct BPWM_ChannelSettings |
|---|
| 264 | { |
|---|
| 265 | bool openDrainb; /* open drain enable */ |
|---|
| 266 | BPWM_FreqModeType FreqMode; /* Variable Freq mode or Constant Freq mode */ |
|---|
| 267 | |
|---|
| 268 | unsigned maxChangesPerInterrupt; /* maximum number of register writes per interrupt when using BPWM_RampOnInterval */ |
|---|
| 269 | BINT_Id interruptId; /* interrupt ID which BPWM_RampOnInterval will use to ramp */ |
|---|
| 270 | BINT_Id secondaryInterruptId; /* additional interrupt ID which BPWM_RampOnInterval will use to ramp */ |
|---|
| 271 | } BPWM_ChannelSettings; |
|---|
| 272 | |
|---|
| 273 | /*************************************************************************** |
|---|
| 274 | Summary: |
|---|
| 275 | This function opens PWM module. |
|---|
| 276 | |
|---|
| 277 | Description: |
|---|
| 278 | This function is responsible for opening BPWM module. When BPWM is |
|---|
| 279 | opened, it will create a module handle and configure the module based |
|---|
| 280 | on the default settings. Once the device is opened, it must be closed |
|---|
| 281 | before it can be opened again. |
|---|
| 282 | |
|---|
| 283 | Returns: |
|---|
| 284 | TODO: |
|---|
| 285 | |
|---|
| 286 | See Also: |
|---|
| 287 | BPWM_Close(), BPWM_OpenChannel(), BPWM_CloseChannel(), |
|---|
| 288 | BPWM_GetDefaultSettings() |
|---|
| 289 | |
|---|
| 290 | ****************************************************************************/ |
|---|
| 291 | BERR_Code BPWM_Open( |
|---|
| 292 | BPWM_Handle *pPWM, /* [out] Returns handle */ |
|---|
| 293 | BCHP_Handle hChip, /* [in] Chip handle */ |
|---|
| 294 | BREG_Handle hRegister, /* [in] Register handle */ |
|---|
| 295 | const BPWM_Settings *pDefSettings /* [in] Default settings */ |
|---|
| 296 | ); |
|---|
| 297 | |
|---|
| 298 | /*************************************************************************** |
|---|
| 299 | Summary: |
|---|
| 300 | This function closes PWM module. |
|---|
| 301 | |
|---|
| 302 | Description: |
|---|
| 303 | This function is responsible for closing BPWM module. Closing BPWM |
|---|
| 304 | will free main BPWM handle. It is required that all opened |
|---|
| 305 | BPWM channels must be closed before calling this function. If this |
|---|
| 306 | is not done, the results will be unpredicable. |
|---|
| 307 | |
|---|
| 308 | Returns: |
|---|
| 309 | TODO: |
|---|
| 310 | |
|---|
| 311 | See Also: |
|---|
| 312 | BPWM_Open(), BPWM_CloseChannel() |
|---|
| 313 | |
|---|
| 314 | ****************************************************************************/ |
|---|
| 315 | BERR_Code BPWM_Close( |
|---|
| 316 | BPWM_Handle hDev /* [in] Device handle */ |
|---|
| 317 | ); |
|---|
| 318 | |
|---|
| 319 | /*************************************************************************** |
|---|
| 320 | Summary: |
|---|
| 321 | This function returns the default settings for PWM module. |
|---|
| 322 | |
|---|
| 323 | Description: |
|---|
| 324 | This function is responsible for returns the default setting for |
|---|
| 325 | BPWM module. The returning default setting should be when |
|---|
| 326 | opening the device. |
|---|
| 327 | |
|---|
| 328 | Returns: |
|---|
| 329 | TODO: |
|---|
| 330 | |
|---|
| 331 | See Also: |
|---|
| 332 | BPWM_Open() |
|---|
| 333 | |
|---|
| 334 | ****************************************************************************/ |
|---|
| 335 | BERR_Code BPWM_GetDefaultSettings( |
|---|
| 336 | BPWM_Settings *pDefSettings, /* [out] Returns default setting */ |
|---|
| 337 | BCHP_Handle hChip /* [in] Chip handle */ |
|---|
| 338 | ); |
|---|
| 339 | |
|---|
| 340 | /*************************************************************************** |
|---|
| 341 | Summary: |
|---|
| 342 | This function returns the total number of channels supported by |
|---|
| 343 | PWM module. |
|---|
| 344 | |
|---|
| 345 | Description: |
|---|
| 346 | This function is responsible for getting total number of channels |
|---|
| 347 | supported by BPWM module, since BPWM device is implemented as a |
|---|
| 348 | device channel. |
|---|
| 349 | |
|---|
| 350 | Returns: |
|---|
| 351 | TODO: |
|---|
| 352 | |
|---|
| 353 | See Also: |
|---|
| 354 | BPWM_OpenChannel(), BPWM_ChannelDefaultSettings() |
|---|
| 355 | |
|---|
| 356 | ****************************************************************************/ |
|---|
| 357 | BERR_Code BPWM_GetTotalChannels( |
|---|
| 358 | BPWM_Handle hDev, /* [in] Device handle */ |
|---|
| 359 | unsigned int *totalChannels /* [out] Returns total number downstream channels supported */ |
|---|
| 360 | ); |
|---|
| 361 | |
|---|
| 362 | /*************************************************************************** |
|---|
| 363 | Summary: |
|---|
| 364 | This function gets default setting for a PWM module channel. |
|---|
| 365 | |
|---|
| 366 | Description: |
|---|
| 367 | This function is responsible for returning the default setting for |
|---|
| 368 | channel of BPWM. The return default setting is used when opening |
|---|
| 369 | a channel. |
|---|
| 370 | |
|---|
| 371 | Returns: |
|---|
| 372 | TODO: |
|---|
| 373 | |
|---|
| 374 | See Also: |
|---|
| 375 | BPWM_OpenChannel() |
|---|
| 376 | |
|---|
| 377 | ****************************************************************************/ |
|---|
| 378 | BERR_Code BPWM_GetChannelDefaultSettings( |
|---|
| 379 | BPWM_Handle hDev, /* [in] Device handle */ |
|---|
| 380 | unsigned int channelNo, /* [in] Channel number to default setting for */ |
|---|
| 381 | BPWM_ChannelSettings *pChnDefSettings /* [out] Returns channel default setting */ |
|---|
| 382 | ); |
|---|
| 383 | |
|---|
| 384 | /*************************************************************************** |
|---|
| 385 | Summary: |
|---|
| 386 | This function opens PWM module channel. |
|---|
| 387 | |
|---|
| 388 | Description: |
|---|
| 389 | This function is responsible for opening BPWM module channel. When a |
|---|
| 390 | BPWM channel is opened, it will create a module channel handle and |
|---|
| 391 | configure the module based on the channel default settings. Once a |
|---|
| 392 | channel is opened, it must be closed before it can be opened again. |
|---|
| 393 | |
|---|
| 394 | Returns: |
|---|
| 395 | TODO: |
|---|
| 396 | |
|---|
| 397 | See Also: |
|---|
| 398 | BPWM_CloseChannel(), BPWM_GetChannelDefaultSettings() |
|---|
| 399 | |
|---|
| 400 | ****************************************************************************/ |
|---|
| 401 | BERR_Code BPWM_OpenChannel( |
|---|
| 402 | BPWM_Handle hDev, /* [in] Device handle */ |
|---|
| 403 | BPWM_ChannelHandle *phChn, /* [out] Returns channel handle */ |
|---|
| 404 | unsigned int channelNo, /* [in] Channel number to open */ |
|---|
| 405 | const BPWM_ChannelSettings *pChnDefSettings /* [in] Channel default setting */ |
|---|
| 406 | ); |
|---|
| 407 | |
|---|
| 408 | /*************************************************************************** |
|---|
| 409 | Summary: |
|---|
| 410 | This function closes PWM module channel. |
|---|
| 411 | |
|---|
| 412 | Description: |
|---|
| 413 | This function is responsible for closing BPWM module channel. Closing |
|---|
| 414 | BPWM channel it will free BPWM channel handle. It is required that all |
|---|
| 415 | opened BPWM channels must be closed before closing BPWM. |
|---|
| 416 | |
|---|
| 417 | Returns: |
|---|
| 418 | TODO: |
|---|
| 419 | |
|---|
| 420 | See Also: |
|---|
| 421 | BPWM_OpenChannel(), BPWM_CloseChannel() |
|---|
| 422 | |
|---|
| 423 | ****************************************************************************/ |
|---|
| 424 | BERR_Code BPWM_CloseChannel( |
|---|
| 425 | BPWM_ChannelHandle hChn /* [in] Device channel handle */ |
|---|
| 426 | ); |
|---|
| 427 | |
|---|
| 428 | /*************************************************************************** |
|---|
| 429 | Summary: |
|---|
| 430 | This function gets PWM module device handle based on |
|---|
| 431 | the device channel handle. |
|---|
| 432 | |
|---|
| 433 | Description: |
|---|
| 434 | This function is responsible returning BPWM module handle based on the |
|---|
| 435 | BPWM module channel. |
|---|
| 436 | |
|---|
| 437 | Returns: |
|---|
| 438 | TODO: |
|---|
| 439 | |
|---|
| 440 | See Also: |
|---|
| 441 | |
|---|
| 442 | ****************************************************************************/ |
|---|
| 443 | BERR_Code BPWM_GetDevice( |
|---|
| 444 | BPWM_ChannelHandle hChn, /* [in] Device channel handle */ |
|---|
| 445 | BPWM_Handle *pPWM /* [out] Returns Device handle */ |
|---|
| 446 | ); |
|---|
| 447 | |
|---|
| 448 | /*************************************************************************** |
|---|
| 449 | Summary: |
|---|
| 450 | This function sets the control word |
|---|
| 451 | |
|---|
| 452 | Description: |
|---|
| 453 | This function is used to program the desired control word before |
|---|
| 454 | PWM generation. |
|---|
| 455 | |
|---|
| 456 | Returns: |
|---|
| 457 | TODO: |
|---|
| 458 | |
|---|
| 459 | See Also: |
|---|
| 460 | |
|---|
| 461 | |
|---|
| 462 | ****************************************************************************/ |
|---|
| 463 | BERR_Code BPWM_SetControlWord( |
|---|
| 464 | BPWM_ChannelHandle hChn, /* [in] Device channel handle */ |
|---|
| 465 | uint16_t cWord /* [in] control word to program */ |
|---|
| 466 | ); |
|---|
| 467 | |
|---|
| 468 | /*************************************************************************** |
|---|
| 469 | Summary: |
|---|
| 470 | This function gets the control word |
|---|
| 471 | |
|---|
| 472 | Description: |
|---|
| 473 | This function is used to get the control word for a PWM channel. |
|---|
| 474 | |
|---|
| 475 | Returns: |
|---|
| 476 | TODO: |
|---|
| 477 | |
|---|
| 478 | See Also: |
|---|
| 479 | |
|---|
| 480 | |
|---|
| 481 | ****************************************************************************/ |
|---|
| 482 | BERR_Code BPWM_GetControlWord( |
|---|
| 483 | BPWM_ChannelHandle hChn, /* [in] Device channel handle */ |
|---|
| 484 | uint16_t *cWord /* [out] control word to program */ |
|---|
| 485 | ); |
|---|
| 486 | |
|---|
| 487 | |
|---|
| 488 | /*************************************************************************** |
|---|
| 489 | Summary: |
|---|
| 490 | This function sets the Freq Model |
|---|
| 491 | |
|---|
| 492 | Description: |
|---|
| 493 | This function is used to program the desired Freq Mode before |
|---|
| 494 | PWM generation. |
|---|
| 495 | |
|---|
| 496 | Returns: |
|---|
| 497 | TODO: |
|---|
| 498 | |
|---|
| 499 | See Also: |
|---|
| 500 | |
|---|
| 501 | ***************************************************************************/ |
|---|
| 502 | BERR_Code BPWM_SetFreqMode( |
|---|
| 503 | BPWM_ChannelHandle hChn, /* Device channel handle */ |
|---|
| 504 | BPWM_FreqModeType Frequeny_Mode /* Frequency mode to program */ |
|---|
| 505 | ); |
|---|
| 506 | |
|---|
| 507 | |
|---|
| 508 | /*************************************************************************** |
|---|
| 509 | Summary: |
|---|
| 510 | This function gets the Freq Model |
|---|
| 511 | |
|---|
| 512 | Description: |
|---|
| 513 | This function is used to read the Freq Mode |
|---|
| 514 | |
|---|
| 515 | Returns: |
|---|
| 516 | TODO: |
|---|
| 517 | |
|---|
| 518 | See Also: |
|---|
| 519 | |
|---|
| 520 | ***************************************************************************/ |
|---|
| 521 | BERR_Code BPWM_GetFreqMode( |
|---|
| 522 | BPWM_ChannelHandle hChn, /* Device channel handle */ |
|---|
| 523 | BPWM_FreqModeType *Frequeny_Mode /* Frequency mode read */ |
|---|
| 524 | ); |
|---|
| 525 | |
|---|
| 526 | /*************************************************************************** |
|---|
| 527 | Summary: |
|---|
| 528 | This function sets the On Interval |
|---|
| 529 | |
|---|
| 530 | Description: |
|---|
| 531 | This function is used to program the desired On Interval before |
|---|
| 532 | PWM generation. |
|---|
| 533 | |
|---|
| 534 | Returns: |
|---|
| 535 | TODO: |
|---|
| 536 | |
|---|
| 537 | See Also: |
|---|
| 538 | ****************************************************************************/ |
|---|
| 539 | BERR_Code BPWM_SetOnInterval( |
|---|
| 540 | BPWM_ChannelHandle hChn, /* [in] Device channel handle */ |
|---|
| 541 | uint16_t OnInterval /* [out] control word to program */ |
|---|
| 542 | ); |
|---|
| 543 | |
|---|
| 544 | #define BPWM_SetOnInterval_isr BPWM_SetOnInterval |
|---|
| 545 | |
|---|
| 546 | /*************************************************************************** |
|---|
| 547 | Summary: |
|---|
| 548 | This function sets the On Interval by making incremental changes (ie. a ramp function) at interrupt time |
|---|
| 549 | |
|---|
| 550 | Description: |
|---|
| 551 | This function is used to program the desired On Interval before |
|---|
| 552 | PWM generation. |
|---|
| 553 | |
|---|
| 554 | You must set BPWM_Settings.hInterrupt and BPWM_ChannelSettings.interruptId to use this function. |
|---|
| 555 | Set BPWM_ChannelSettings.maxChangesPerInterrupt to control the number of changes per interrupt. |
|---|
| 556 | ****************************************************************************/ |
|---|
| 557 | BERR_Code BPWM_RampOnInterval( |
|---|
| 558 | BPWM_ChannelHandle hChn, /* Device channel handle */ |
|---|
| 559 | uint16_t OnInterval |
|---|
| 560 | ); |
|---|
| 561 | |
|---|
| 562 | /*************************************************************************** |
|---|
| 563 | Summary: |
|---|
| 564 | isr variation of BPWM_RampOnInterval. |
|---|
| 565 | ****************************************************************************/ |
|---|
| 566 | BERR_Code BPWM_RampOnInterval_isr( |
|---|
| 567 | BPWM_ChannelHandle hChn, /* Device channel handle */ |
|---|
| 568 | uint16_t OnInterval |
|---|
| 569 | ); |
|---|
| 570 | |
|---|
| 571 | /*************************************************************************** |
|---|
| 572 | Summary: |
|---|
| 573 | This function gets the On Interval |
|---|
| 574 | |
|---|
| 575 | Description: |
|---|
| 576 | This function is used to get the On Interval |
|---|
| 577 | |
|---|
| 578 | Returns: |
|---|
| 579 | TODO: |
|---|
| 580 | |
|---|
| 581 | See Also: |
|---|
| 582 | |
|---|
| 583 | |
|---|
| 584 | |
|---|
| 585 | ****************************************************************************/ |
|---|
| 586 | BERR_Code BPWM_GetOnInterval( |
|---|
| 587 | BPWM_ChannelHandle hChn, /* [in] Device channel handle */ |
|---|
| 588 | uint16_t *OnInterval /* [out] On interval to read */ |
|---|
| 589 | ); |
|---|
| 590 | |
|---|
| 591 | /*************************************************************************** |
|---|
| 592 | Summary: |
|---|
| 593 | This function sets the Period Interval |
|---|
| 594 | |
|---|
| 595 | Description: |
|---|
| 596 | This function is used to program the desired Period Interval before |
|---|
| 597 | PWM generation. |
|---|
| 598 | |
|---|
| 599 | Returns: |
|---|
| 600 | TODO: |
|---|
| 601 | |
|---|
| 602 | See Also: |
|---|
| 603 | |
|---|
| 604 | |
|---|
| 605 | |
|---|
| 606 | ****************************************************************************/ |
|---|
| 607 | BERR_Code BPWM_SetPeriodInterval( |
|---|
| 608 | BPWM_ChannelHandle hChn, /* Device channel handle */ |
|---|
| 609 | uint16_t PeriodInterval /* Period Interval to program */ |
|---|
| 610 | ); |
|---|
| 611 | |
|---|
| 612 | /*************************************************************************** |
|---|
| 613 | Summary: |
|---|
| 614 | This function gets the Period Interval |
|---|
| 615 | |
|---|
| 616 | Description: |
|---|
| 617 | This function is used to get the period Interval |
|---|
| 618 | |
|---|
| 619 | Returns: |
|---|
| 620 | TODO: |
|---|
| 621 | |
|---|
| 622 | See Also: |
|---|
| 623 | |
|---|
| 624 | |
|---|
| 625 | |
|---|
| 626 | ****************************************************************************/ |
|---|
| 627 | BERR_Code BPWM_GetPeriodInterval( |
|---|
| 628 | BPWM_ChannelHandle hChn, /* [in] Device channel handle */ |
|---|
| 629 | uint16_t *PeriodInterval /* [out] Period interval to read */ |
|---|
| 630 | ); |
|---|
| 631 | |
|---|
| 632 | #define BPWM_GetPeriodInterval_isr BPWM_GetPeriodInterval |
|---|
| 633 | |
|---|
| 634 | /*************************************************************************** |
|---|
| 635 | Summary: |
|---|
| 636 | This function sets the On and Period Interval |
|---|
| 637 | |
|---|
| 638 | Description: |
|---|
| 639 | This function is used to program the desired On and Period Interval before |
|---|
| 640 | PWM generation. |
|---|
| 641 | |
|---|
| 642 | Returns: |
|---|
| 643 | TODO: |
|---|
| 644 | |
|---|
| 645 | See Also: |
|---|
| 646 | |
|---|
| 647 | |
|---|
| 648 | |
|---|
| 649 | ****************************************************************************/ |
|---|
| 650 | BERR_Code BPWM_SetOnAndPeriodInterval( |
|---|
| 651 | BPWM_ChannelHandle hChn, /* Device channel handle */ |
|---|
| 652 | uint16_t OnInterval, /* OnInterval to program */ |
|---|
| 653 | uint16_t PeriodInterval /* Period Interval to program */ |
|---|
| 654 | ); |
|---|
| 655 | |
|---|
| 656 | /*************************************************************************** |
|---|
| 657 | Summary: |
|---|
| 658 | This function gets the On and Period Interval |
|---|
| 659 | |
|---|
| 660 | Description: |
|---|
| 661 | This function is used to get the On and Period Interval |
|---|
| 662 | |
|---|
| 663 | Returns: |
|---|
| 664 | TODO: |
|---|
| 665 | |
|---|
| 666 | See Also: |
|---|
| 667 | |
|---|
| 668 | |
|---|
| 669 | |
|---|
| 670 | ****************************************************************************/ |
|---|
| 671 | BERR_Code BPWM_GetOnAndPeriodInterval( |
|---|
| 672 | BPWM_ChannelHandle hChn, /* Device channel handle */ |
|---|
| 673 | uint16_t *OnInterval, /* OnInterval to program */ |
|---|
| 674 | uint16_t *PeriodInterval /* Period Interval to program */ |
|---|
| 675 | ); |
|---|
| 676 | |
|---|
| 677 | /*************************************************************************** |
|---|
| 678 | Summary: |
|---|
| 679 | This function starts PWM generation |
|---|
| 680 | |
|---|
| 681 | Description: |
|---|
| 682 | This function is used to start the PWM generation. |
|---|
| 683 | |
|---|
| 684 | Returns: |
|---|
| 685 | TODO: |
|---|
| 686 | |
|---|
| 687 | See Also: |
|---|
| 688 | |
|---|
| 689 | |
|---|
| 690 | ****************************************************************************/ |
|---|
| 691 | BERR_Code BPWM_Start( |
|---|
| 692 | BPWM_ChannelHandle hChn /* [in] Device channel handle */ |
|---|
| 693 | ); |
|---|
| 694 | |
|---|
| 695 | /*************************************************************************** |
|---|
| 696 | Summary: |
|---|
| 697 | This function stops PWM generation |
|---|
| 698 | |
|---|
| 699 | Description: |
|---|
| 700 | This function is used to stop the PWM generation. |
|---|
| 701 | |
|---|
| 702 | Returns: |
|---|
| 703 | TODO: |
|---|
| 704 | |
|---|
| 705 | See Also: |
|---|
| 706 | |
|---|
| 707 | |
|---|
| 708 | ****************************************************************************/ |
|---|
| 709 | BERR_Code BPWM_Stop( |
|---|
| 710 | BPWM_ChannelHandle hChn /* [in] Device channel handle */ |
|---|
| 711 | ); |
|---|
| 712 | |
|---|
| 713 | |
|---|
| 714 | /*************************************************************************** |
|---|
| 715 | Summary: |
|---|
| 716 | This function selects open drain vs. totem pole output |
|---|
| 717 | |
|---|
| 718 | Description: |
|---|
| 719 | This function is used to select open drain vs. totem pole output |
|---|
| 720 | |
|---|
| 721 | Returns: |
|---|
| 722 | TODO: |
|---|
| 723 | |
|---|
| 724 | See Also: |
|---|
| 725 | |
|---|
| 726 | |
|---|
| 727 | ****************************************************************************/ |
|---|
| 728 | BERR_Code BPWM_SetOpenDrainConfig( |
|---|
| 729 | BPWM_ChannelHandle hChn, /* [in] Device channel handle */ |
|---|
| 730 | BPWM_OpenDrainOutput type /* [in] open drain/totem pole select */ |
|---|
| 731 | ); |
|---|
| 732 | |
|---|
| 733 | /*************************************************************************** |
|---|
| 734 | Summary: |
|---|
| 735 | This function gets the open drain configuration |
|---|
| 736 | |
|---|
| 737 | Description: |
|---|
| 738 | This function is used to get the open drain vs. totem pole output selection type. |
|---|
| 739 | |
|---|
| 740 | Returns: |
|---|
| 741 | TODO: |
|---|
| 742 | |
|---|
| 743 | See Also: |
|---|
| 744 | |
|---|
| 745 | |
|---|
| 746 | ****************************************************************************/ |
|---|
| 747 | BERR_Code BPWM_GetOpenDrainConfig( |
|---|
| 748 | BPWM_ChannelHandle hChn, /* [in] Device channel handle */ |
|---|
| 749 | BPWM_OpenDrainOutput *type /* [out] open drain/totem pole select */ |
|---|
| 750 | ); |
|---|
| 751 | |
|---|
| 752 | |
|---|
| 753 | #if ((BCHP_CHIP==35230) || (BCHP_CHIP==35125) || (BCHP_CHIP==35233)) |
|---|
| 754 | /*************************************************************************** |
|---|
| 755 | Summary: |
|---|
| 756 | Enumeration for PWM output polarity |
|---|
| 757 | |
|---|
| 758 | Description: |
|---|
| 759 | This enumeration defines output polarity selection |
|---|
| 760 | |
|---|
| 761 | See Also: |
|---|
| 762 | None. |
|---|
| 763 | |
|---|
| 764 | ****************************************************************************/ |
|---|
| 765 | typedef enum BPWM_OutPolaritySel |
|---|
| 766 | { |
|---|
| 767 | OutPolarityHigh = 0, |
|---|
| 768 | OutPolarityLow = 1 |
|---|
| 769 | } BPWM_OutPolaritySel; |
|---|
| 770 | |
|---|
| 771 | /*************************************************************************** |
|---|
| 772 | Summary: |
|---|
| 773 | Enumeration for PWM Sync Edge Select |
|---|
| 774 | |
|---|
| 775 | Description: |
|---|
| 776 | This enumeration defines sync signal edge selector |
|---|
| 777 | |
|---|
| 778 | See Also: |
|---|
| 779 | None. |
|---|
| 780 | |
|---|
| 781 | ****************************************************************************/ |
|---|
| 782 | typedef enum BPWM_SyncEdgeSel |
|---|
| 783 | { |
|---|
| 784 | SyncEdgeNeg = 0, |
|---|
| 785 | SyncEdgePos = 1 |
|---|
| 786 | } BPWM_SyncEdgeSel; |
|---|
| 787 | |
|---|
| 788 | /*************************************************************************** |
|---|
| 789 | Summary: |
|---|
| 790 | Enumeration for PWM double buffer mode control |
|---|
| 791 | |
|---|
| 792 | Description: |
|---|
| 793 | This enumeration defines PWM double buffer mode control: disable, period, |
|---|
| 794 | or sync. |
|---|
| 795 | |
|---|
| 796 | See Also: |
|---|
| 797 | None. |
|---|
| 798 | |
|---|
| 799 | ****************************************************************************/ |
|---|
| 800 | typedef enum BPWM_DblBufMode |
|---|
| 801 | { |
|---|
| 802 | DblBufMode_Disabled = 0, |
|---|
| 803 | DblBufMode_Reserved = 1, |
|---|
| 804 | DblBufMode_Period = 2, |
|---|
| 805 | DblBufMode_Sync = 3 |
|---|
| 806 | } BPWM_DblBufMode; |
|---|
| 807 | |
|---|
| 808 | /*************************************************************************** |
|---|
| 809 | Summary: |
|---|
| 810 | Enumeration for PWM two-input sync |
|---|
| 811 | |
|---|
| 812 | Description: |
|---|
| 813 | This enumeration defines two-input sync type if sync is enabled. |
|---|
| 814 | |
|---|
| 815 | See Also: |
|---|
| 816 | None. |
|---|
| 817 | |
|---|
| 818 | ****************************************************************************/ |
|---|
| 819 | typedef enum BPWM_TwoInputSyncType |
|---|
| 820 | { |
|---|
| 821 | TwoInputSync_Vsync = 0, |
|---|
| 822 | TwoInputSync_Vsync2 |
|---|
| 823 | } BPWM_TwoInputSyncType; |
|---|
| 824 | |
|---|
| 825 | /*************************************************************************** |
|---|
| 826 | Summary: |
|---|
| 827 | This function sets the control word in register set 1 |
|---|
| 828 | |
|---|
| 829 | Description: |
|---|
| 830 | This function is used to program the desired control word in register |
|---|
| 831 | set 1 for two-input sync. |
|---|
| 832 | |
|---|
| 833 | Returns: |
|---|
| 834 | TODO: |
|---|
| 835 | |
|---|
| 836 | See Also: |
|---|
| 837 | |
|---|
| 838 | |
|---|
| 839 | ****************************************************************************/ |
|---|
| 840 | BERR_Code BPWM_SetControlWordSet1 |
|---|
| 841 | ( |
|---|
| 842 | BPWM_ChannelHandle hChn, /* [in] Device channel handle */ |
|---|
| 843 | uint16_t cWord /* [in] control word to program for register set 1 */ |
|---|
| 844 | ); |
|---|
| 845 | |
|---|
| 846 | /*************************************************************************** |
|---|
| 847 | Summary: |
|---|
| 848 | This function gets the control word in register set 1 |
|---|
| 849 | |
|---|
| 850 | Description: |
|---|
| 851 | This function is used to get the value of the control word in |
|---|
| 852 | register set 1 for two-input sync. |
|---|
| 853 | |
|---|
| 854 | Returns: |
|---|
| 855 | TODO: |
|---|
| 856 | |
|---|
| 857 | See Also: |
|---|
| 858 | |
|---|
| 859 | |
|---|
| 860 | ****************************************************************************/ |
|---|
| 861 | BERR_Code BPWM_GetControlWordSet1 |
|---|
| 862 | ( |
|---|
| 863 | BPWM_ChannelHandle hChn, /* [in] Device channel handle */ |
|---|
| 864 | uint16_t *cWord /* [out] control word to program for register set 1 */ |
|---|
| 865 | ); |
|---|
| 866 | |
|---|
| 867 | /*************************************************************************** |
|---|
| 868 | Summary: |
|---|
| 869 | This function sets the On and Period values in register set 1 |
|---|
| 870 | |
|---|
| 871 | Description: |
|---|
| 872 | This function is used to program the on interval and cycle period in |
|---|
| 873 | register set 1 for two-input sync. |
|---|
| 874 | |
|---|
| 875 | Returns: |
|---|
| 876 | TODO: |
|---|
| 877 | |
|---|
| 878 | See Also: |
|---|
| 879 | |
|---|
| 880 | |
|---|
| 881 | ****************************************************************************/ |
|---|
| 882 | BERR_Code BPWM_SetOnAndPeriodIntervalSet1 |
|---|
| 883 | ( |
|---|
| 884 | BPWM_ChannelHandle hChn, /* [in] Device channel handle */ |
|---|
| 885 | uint16_t OnInterval, /* [in] OnInterval to program */ |
|---|
| 886 | uint16_t PeriodInterval /* [in] Period Interval to program */ |
|---|
| 887 | ); |
|---|
| 888 | |
|---|
| 889 | /*************************************************************************** |
|---|
| 890 | Summary: |
|---|
| 891 | This function gets the On and Period values in register set 1 |
|---|
| 892 | |
|---|
| 893 | Description: |
|---|
| 894 | This function is used to get the values of on interval and cycle period in |
|---|
| 895 | register set 1 for two-input sync. |
|---|
| 896 | |
|---|
| 897 | Returns: |
|---|
| 898 | TODO: |
|---|
| 899 | |
|---|
| 900 | See Also: |
|---|
| 901 | |
|---|
| 902 | |
|---|
| 903 | ****************************************************************************/ |
|---|
| 904 | BERR_Code BPWM_GetOnAndPeriodIntervalSet1 |
|---|
| 905 | ( |
|---|
| 906 | BPWM_ChannelHandle hChn, /* [in] Device channel handle */ |
|---|
| 907 | uint16_t *OnInterval, /* [out] OnInterval to program */ |
|---|
| 908 | uint16_t *PeriodInterval /* [out] Period Interval to program */ |
|---|
| 909 | ); |
|---|
| 910 | |
|---|
| 911 | /*************************************************************************** |
|---|
| 912 | Summary: |
|---|
| 913 | This function enables or disables sync mode |
|---|
| 914 | |
|---|
| 915 | Description: |
|---|
| 916 | This function is used to enable or disable PWM sync mode. |
|---|
| 917 | |
|---|
| 918 | Returns: |
|---|
| 919 | TODO: |
|---|
| 920 | |
|---|
| 921 | See Also: |
|---|
| 922 | |
|---|
| 923 | |
|---|
| 924 | ****************************************************************************/ |
|---|
| 925 | BERR_Code BPWM_EnableSyncMode |
|---|
| 926 | ( |
|---|
| 927 | BPWM_ChannelHandle hChn, /* [in] Device channel handle */ |
|---|
| 928 | bool enable /* [in] sync enable */ |
|---|
| 929 | ); |
|---|
| 930 | |
|---|
| 931 | /*************************************************************************** |
|---|
| 932 | Summary: |
|---|
| 933 | This function sets double buffer mode |
|---|
| 934 | |
|---|
| 935 | Description: |
|---|
| 936 | This function is used to set the PWM double buffer mode control. |
|---|
| 937 | |
|---|
| 938 | Returns: |
|---|
| 939 | TODO: |
|---|
| 940 | |
|---|
| 941 | See Also: |
|---|
| 942 | |
|---|
| 943 | |
|---|
| 944 | ****************************************************************************/ |
|---|
| 945 | BERR_Code BPWM_SetDblBufMode |
|---|
| 946 | ( |
|---|
| 947 | BPWM_ChannelHandle hChn, /* [in] Device channel handle */ |
|---|
| 948 | BPWM_DblBufMode dblBufMode /* [in] double buffer mode type */ |
|---|
| 949 | ); |
|---|
| 950 | |
|---|
| 951 | /*************************************************************************** |
|---|
| 952 | Summary: |
|---|
| 953 | This function gets double buffer mode |
|---|
| 954 | |
|---|
| 955 | Description: |
|---|
| 956 | This function is used to get the PWM double buffer mode control. |
|---|
| 957 | |
|---|
| 958 | Returns: |
|---|
| 959 | TODO: |
|---|
| 960 | |
|---|
| 961 | See Also: |
|---|
| 962 | |
|---|
| 963 | |
|---|
| 964 | ****************************************************************************/ |
|---|
| 965 | BERR_Code BPWM_GetDblBufMode |
|---|
| 966 | ( |
|---|
| 967 | BPWM_ChannelHandle hChn, /* [in] Device channel handle */ |
|---|
| 968 | BPWM_DblBufMode *dblBufMode /* [out] double buffer mode type */ |
|---|
| 969 | ); |
|---|
| 970 | |
|---|
| 971 | /*************************************************************************** |
|---|
| 972 | Summary: |
|---|
| 973 | This function sets the sync edge type |
|---|
| 974 | |
|---|
| 975 | Description: |
|---|
| 976 | This function is used to select the sync signal edge |
|---|
| 977 | |
|---|
| 978 | Returns: |
|---|
| 979 | TODO: |
|---|
| 980 | |
|---|
| 981 | See Also: |
|---|
| 982 | |
|---|
| 983 | |
|---|
| 984 | ****************************************************************************/ |
|---|
| 985 | BERR_Code BPWM_SetSyncEdge |
|---|
| 986 | ( |
|---|
| 987 | BPWM_ChannelHandle hChn, /* [in] Device channel handle */ |
|---|
| 988 | BPWM_SyncEdgeSel SyncEdgeSel /* [in] edge type */ |
|---|
| 989 | ); |
|---|
| 990 | |
|---|
| 991 | /*************************************************************************** |
|---|
| 992 | Summary: |
|---|
| 993 | This function gets the sync edge type |
|---|
| 994 | |
|---|
| 995 | Description: |
|---|
| 996 | This function is used to get the sync signal edge select type |
|---|
| 997 | |
|---|
| 998 | Returns: |
|---|
| 999 | TODO: |
|---|
| 1000 | |
|---|
| 1001 | See Also: |
|---|
| 1002 | |
|---|
| 1003 | |
|---|
| 1004 | ****************************************************************************/ |
|---|
| 1005 | BERR_Code BPWM_GetSyncEdge |
|---|
| 1006 | ( |
|---|
| 1007 | BPWM_ChannelHandle hChn, /* [in] Device channel handle */ |
|---|
| 1008 | BPWM_SyncEdgeSel *SyncEdgeSel /* [out] edge type */ |
|---|
| 1009 | ); |
|---|
| 1010 | |
|---|
| 1011 | /*************************************************************************** |
|---|
| 1012 | Summary: |
|---|
| 1013 | This function sets the two-input sync type |
|---|
| 1014 | |
|---|
| 1015 | Description: |
|---|
| 1016 | This function is used to select the two-input sync type |
|---|
| 1017 | |
|---|
| 1018 | Returns: |
|---|
| 1019 | TODO: |
|---|
| 1020 | |
|---|
| 1021 | See Also: |
|---|
| 1022 | |
|---|
| 1023 | |
|---|
| 1024 | ****************************************************************************/ |
|---|
| 1025 | BERR_Code BPWM_SetTwoInputSync |
|---|
| 1026 | ( |
|---|
| 1027 | BPWM_ChannelHandle hChn, /* [in] Device channel handle */ |
|---|
| 1028 | BPWM_TwoInputSyncType type /* [in] two-input sync type */ |
|---|
| 1029 | ); |
|---|
| 1030 | |
|---|
| 1031 | /*************************************************************************** |
|---|
| 1032 | Summary: |
|---|
| 1033 | This function gets the two-input sync type |
|---|
| 1034 | |
|---|
| 1035 | Description: |
|---|
| 1036 | This function is used to get the two-input sync type |
|---|
| 1037 | |
|---|
| 1038 | Returns: |
|---|
| 1039 | TODO: |
|---|
| 1040 | |
|---|
| 1041 | See Also: |
|---|
| 1042 | |
|---|
| 1043 | |
|---|
| 1044 | ****************************************************************************/ |
|---|
| 1045 | BERR_Code BPWM_GetTwoInputSync |
|---|
| 1046 | ( |
|---|
| 1047 | BPWM_ChannelHandle hChn, /* [in] Device channel handle */ |
|---|
| 1048 | BPWM_TwoInputSyncType *type /* [out] two-input sync type */ |
|---|
| 1049 | ); |
|---|
| 1050 | |
|---|
| 1051 | /*************************************************************************** |
|---|
| 1052 | Summary: |
|---|
| 1053 | This function sets the output polarity |
|---|
| 1054 | |
|---|
| 1055 | Description: |
|---|
| 1056 | This function is used to set the polarity of the PWM output |
|---|
| 1057 | |
|---|
| 1058 | Returns: |
|---|
| 1059 | TODO: |
|---|
| 1060 | |
|---|
| 1061 | See Also: |
|---|
| 1062 | |
|---|
| 1063 | |
|---|
| 1064 | ****************************************************************************/ |
|---|
| 1065 | BERR_Code BPWM_SetOutputPolarity |
|---|
| 1066 | ( |
|---|
| 1067 | BPWM_ChannelHandle hChn, /* [in] Device channel handle */ |
|---|
| 1068 | BPWM_OutPolaritySel OutPolSel /* [in] output polarity */ |
|---|
| 1069 | ); |
|---|
| 1070 | |
|---|
| 1071 | /*************************************************************************** |
|---|
| 1072 | Summary: |
|---|
| 1073 | This function gets the output polarity |
|---|
| 1074 | |
|---|
| 1075 | Description: |
|---|
| 1076 | This function is used to get the value of the polarity of the PWM output |
|---|
| 1077 | |
|---|
| 1078 | Returns: |
|---|
| 1079 | TODO: |
|---|
| 1080 | |
|---|
| 1081 | See Also: |
|---|
| 1082 | |
|---|
| 1083 | |
|---|
| 1084 | ****************************************************************************/ |
|---|
| 1085 | BERR_Code BPWM_GetOutputPolarity |
|---|
| 1086 | ( |
|---|
| 1087 | BPWM_ChannelHandle hChn, /* [in] Device channel handle */ |
|---|
| 1088 | BPWM_OutPolaritySel *OutPolSel /* [out] output polarity */ |
|---|
| 1089 | ); |
|---|
| 1090 | |
|---|
| 1091 | |
|---|
| 1092 | |
|---|
| 1093 | #endif |
|---|
| 1094 | |
|---|
| 1095 | #ifdef __cplusplus |
|---|
| 1096 | } |
|---|
| 1097 | #endif |
|---|
| 1098 | |
|---|
| 1099 | #endif |
|---|
| 1100 | |
|---|
| 1101 | |
|---|
| 1102 | |
|---|