source: svn/newcon3bcm2_21bu/magnum/portinginterface/pwm/7552/bpwm.h @ 69

Last change on this file since 69 was 69, checked in by phkim, 10 years ago

1.phkim

  1. 광주방송
  2. 변경내용
    • VBI 캡션 disabled
  • Property svn:executable set to *
File size: 29.5 KB
Line 
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
90Overview
91The PWM PI module controls the PWM core within the BCM7038.
92There are two independent PWM generators, each with programmable
93control word (duty cycle).
94
95Design
96The 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
104Usage
105The 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
120sample code
121void 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
175extern "C" {
176#endif
177
178/***************************************************************************
179Summary:
180        Number of PWM channels supported
181
182Description:
183
184See 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/***************************************************************************
196Summary:
197        Error Codes specific to BPWM
198
199Description:
200
201See Also:
202
203****************************************************************************/
204#define BPWM_ERR_NOTAVAIL_CHN_NO                BERR_MAKE_CODE(BERR_PWM_ID, 0)
205
206/***************************************************************************
207Summary:
208        The handles for pwm module.
209
210Description:
211        Since BPWM is a device channel, it has main device handle as well
212        as a device channel handle.
213
214See Also:
215        BPWM_Open(), BPWM_OpenChannel()
216
217****************************************************************************/
218typedef struct BPWM_P_Handle                            *BPWM_Handle;
219typedef struct BPWM_P_ChannelHandle                     *BPWM_ChannelHandle;
220
221/***************************************************************************
222Summary:
223        Required default settings structure for PWM module.
224
225Description:
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
231See Also:
232        BPWM_Open(), BPWM_OpenChannel()
233
234****************************************************************************/
235typedef struct BPWM_Settings
236{
237        BINT_Handle hInterrupt; /* only required if using BPWM_RampOnInterval */
238} BPWM_Settings;
239
240typedef enum BPWM_FreqModeType
241{
242        Variable_Freq_Mode = 0,
243        Constant_Freq_Mode = 1
244}BPWM_FreqModeType;
245
246/***************************************************************************
247Summary:
248        Enumeration for PWM open drain configuration
249
250Description:
251        This enumeration defines open drain config vs. totem pole output
252
253See Also:
254        None.
255
256****************************************************************************/
257typedef enum BPWM_OpenDrainOutput
258{
259        PwmOutOpenDrain = 0,
260        PwmOutTotemPole
261} BPWM_OpenDrainOutput;
262
263typedef 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/***************************************************************************
274Summary:
275        This function opens PWM module.
276
277Description:
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
283Returns:
284        TODO:
285
286See Also:
287        BPWM_Close(), BPWM_OpenChannel(), BPWM_CloseChannel(),
288        BPWM_GetDefaultSettings()
289
290****************************************************************************/
291BERR_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/***************************************************************************
299Summary:
300        This function closes PWM module.
301
302Description:
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
308Returns:
309        TODO:
310
311See Also:
312        BPWM_Open(), BPWM_CloseChannel()
313
314****************************************************************************/
315BERR_Code BPWM_Close(
316        BPWM_Handle hDev                                        /* [in] Device handle */
317        );
318
319/***************************************************************************
320Summary:
321        This function returns the default settings for PWM module.
322
323Description:
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
328Returns:
329        TODO:
330
331See Also:
332        BPWM_Open()
333
334****************************************************************************/
335BERR_Code BPWM_GetDefaultSettings(
336        BPWM_Settings *pDefSettings,            /* [out] Returns default setting */
337        BCHP_Handle hChip                                       /* [in] Chip handle */
338        );
339
340/***************************************************************************
341Summary:
342        This function returns the total number of channels supported by
343        PWM module.
344
345Description:
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
350Returns:
351        TODO:
352
353See Also:
354        BPWM_OpenChannel(), BPWM_ChannelDefaultSettings()
355
356****************************************************************************/
357BERR_Code BPWM_GetTotalChannels(
358        BPWM_Handle hDev,                                       /* [in] Device handle */
359        unsigned int *totalChannels                     /* [out] Returns total number downstream channels supported */
360        );
361
362/***************************************************************************
363Summary:
364        This function gets default setting for a PWM module channel.
365
366Description:
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
371Returns:
372        TODO:
373
374See Also:
375        BPWM_OpenChannel()
376
377****************************************************************************/
378BERR_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/***************************************************************************
385Summary:
386        This function opens PWM module channel.
387
388Description:
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
394Returns:
395        TODO:
396
397See Also:
398        BPWM_CloseChannel(), BPWM_GetChannelDefaultSettings()
399
400****************************************************************************/
401BERR_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/***************************************************************************
409Summary:
410        This function closes PWM module channel.
411
412Description:
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
417Returns:
418        TODO:
419
420See Also:
421        BPWM_OpenChannel(), BPWM_CloseChannel()
422
423****************************************************************************/
424BERR_Code BPWM_CloseChannel(
425        BPWM_ChannelHandle hChn                         /* [in] Device channel handle */
426        );
427
428/***************************************************************************
429Summary:
430        This function gets PWM module device handle based on
431        the device channel handle.
432
433Description:
434        This function is responsible returning BPWM module handle based on the
435        BPWM module channel.
436
437Returns:
438        TODO:
439
440See Also:
441
442****************************************************************************/
443BERR_Code BPWM_GetDevice(
444        BPWM_ChannelHandle hChn,                        /* [in] Device channel handle */
445        BPWM_Handle *pPWM                                       /* [out] Returns Device handle */
446        );
447
448/***************************************************************************
449Summary:
450        This function sets the control word
451
452Description:
453        This function is used to program the desired control word before
454        PWM generation.
455
456Returns:
457        TODO:
458
459See Also:
460
461
462****************************************************************************/
463BERR_Code BPWM_SetControlWord(
464        BPWM_ChannelHandle      hChn,                   /* [in] Device channel handle */
465        uint16_t                        cWord                   /* [in] control word to program */
466        );
467
468/***************************************************************************
469Summary:
470        This function gets the control word
471
472Description:
473        This function is used to get the control word for a PWM channel.
474
475Returns:
476        TODO:
477
478See Also:
479
480
481****************************************************************************/
482BERR_Code BPWM_GetControlWord(
483        BPWM_ChannelHandle      hChn,                   /* [in] Device channel handle */
484        uint16_t                        *cWord                  /* [out] control word to program */
485        );
486
487
488/***************************************************************************
489Summary:
490        This function sets the Freq Model
491
492Description:
493        This function is used to program the desired Freq Mode before
494        PWM generation.
495
496Returns:
497        TODO:
498
499See Also:
500
501***************************************************************************/
502BERR_Code BPWM_SetFreqMode(
503        BPWM_ChannelHandle      hChn,           /* Device channel handle */
504        BPWM_FreqModeType        Frequeny_Mode          /* Frequency mode  to program */
505        );
506
507
508/***************************************************************************
509Summary:
510        This function gets the Freq Model
511
512Description:
513        This function is used to read the  Freq Mode
514
515Returns:
516        TODO:
517
518See Also:
519
520***************************************************************************/
521BERR_Code BPWM_GetFreqMode(
522        BPWM_ChannelHandle      hChn,                          /* Device channel handle */
523        BPWM_FreqModeType                       *Frequeny_Mode          /* Frequency mode  read */
524        );
525
526/***************************************************************************
527Summary:
528        This function sets the On Interval
529
530Description:
531        This function is used to program the desired On Interval before
532        PWM generation.
533
534Returns:
535        TODO:
536
537See Also:
538****************************************************************************/
539BERR_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/***************************************************************************
547Summary:
548        This function sets the On Interval by making incremental changes (ie. a ramp function) at interrupt time
549
550Description:
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****************************************************************************/
557BERR_Code BPWM_RampOnInterval(
558        BPWM_ChannelHandle  hChn,           /* Device channel handle */
559        uint16_t OnInterval
560        );
561
562/***************************************************************************
563Summary:
564        isr variation of BPWM_RampOnInterval.
565****************************************************************************/
566BERR_Code BPWM_RampOnInterval_isr(
567        BPWM_ChannelHandle  hChn,           /* Device channel handle */
568        uint16_t OnInterval
569        );
570
571/***************************************************************************
572Summary:
573        This function gets the On Interval
574
575Description:
576        This function is used to get  the On Interval
577
578Returns:
579        TODO:
580
581See Also:
582
583
584
585****************************************************************************/
586BERR_Code BPWM_GetOnInterval(
587        BPWM_ChannelHandle      hChn,                   /* [in] Device channel handle */
588        uint16_t                        *OnInterval                     /* [out] On interval to read */
589        );
590
591/***************************************************************************
592Summary:
593        This function sets the Period Interval
594
595Description:
596        This function is used to program the desired Period Interval before
597        PWM generation.
598
599Returns:
600        TODO:
601
602See Also:
603
604
605
606****************************************************************************/
607BERR_Code BPWM_SetPeriodInterval(
608        BPWM_ChannelHandle      hChn,                   /* Device channel handle */
609        uint16_t                        PeriodInterval                  /* Period Interval  to program */
610        );
611
612/***************************************************************************
613Summary:
614        This function gets the Period Interval
615
616Description:
617        This function is used to get  the period Interval
618
619Returns:
620        TODO:
621
622See Also:
623
624
625
626****************************************************************************/
627BERR_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/***************************************************************************
635Summary:
636        This function sets the On and Period Interval
637
638Description:
639        This function is used to program the desired On and Period Interval before
640        PWM generation.
641
642Returns:
643        TODO:
644
645See Also:
646
647
648
649****************************************************************************/
650BERR_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/***************************************************************************
657Summary:
658        This function gets the On and Period Interval
659
660Description:
661        This function is used to get the  On and Period Interval
662
663Returns:
664        TODO:
665
666See Also:
667
668
669
670****************************************************************************/
671BERR_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/***************************************************************************
678Summary:
679        This function starts PWM generation
680
681Description:
682        This function is used to start the PWM generation.
683
684Returns:
685        TODO:
686
687See Also:
688
689
690****************************************************************************/
691BERR_Code BPWM_Start(
692        BPWM_ChannelHandle hChn                 /* [in] Device channel handle */
693        );
694
695/***************************************************************************
696Summary:
697        This function stops PWM generation
698
699Description:
700        This function is used to stop the PWM generation.
701
702Returns:
703        TODO:
704
705See Also:
706
707
708****************************************************************************/
709BERR_Code BPWM_Stop(
710        BPWM_ChannelHandle hChn                 /* [in] Device channel handle */
711        );
712
713
714/***************************************************************************
715Summary:
716        This function selects open drain vs. totem pole output
717
718Description:
719        This function is used to select open drain vs. totem pole output
720
721Returns:
722        TODO:
723
724See Also:
725
726
727****************************************************************************/
728BERR_Code BPWM_SetOpenDrainConfig(
729        BPWM_ChannelHandle              hChn,                   /* [in] Device channel handle */
730        BPWM_OpenDrainOutput    type                    /* [in] open drain/totem pole select */
731        );
732
733/***************************************************************************
734Summary:
735        This function gets the open drain configuration
736
737Description:
738        This function is used to get the open drain vs. totem pole output selection type.
739
740Returns:
741        TODO:
742
743See Also:
744
745
746****************************************************************************/
747BERR_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/***************************************************************************
755Summary:
756        Enumeration for PWM output polarity
757
758Description:
759        This enumeration defines output polarity selection
760
761See Also:
762        None.
763
764****************************************************************************/
765typedef enum BPWM_OutPolaritySel
766{
767        OutPolarityHigh = 0,
768        OutPolarityLow = 1
769} BPWM_OutPolaritySel;
770
771/***************************************************************************
772Summary:
773        Enumeration for PWM Sync Edge Select
774
775Description:
776        This enumeration defines sync signal edge selector
777
778See Also:
779        None.
780
781****************************************************************************/
782typedef enum BPWM_SyncEdgeSel
783{
784        SyncEdgeNeg = 0,
785        SyncEdgePos = 1
786} BPWM_SyncEdgeSel;
787
788/***************************************************************************
789Summary:
790        Enumeration for PWM double buffer mode control
791
792Description:
793        This enumeration defines PWM double buffer mode control: disable, period,
794        or sync.
795
796See Also:
797        None.
798
799****************************************************************************/
800typedef 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/***************************************************************************
809Summary:
810        Enumeration for PWM two-input sync
811
812Description:
813        This enumeration defines two-input sync type if sync is enabled.
814
815See Also:
816        None.
817
818****************************************************************************/
819typedef enum BPWM_TwoInputSyncType
820{
821        TwoInputSync_Vsync = 0,
822        TwoInputSync_Vsync2
823} BPWM_TwoInputSyncType;
824
825/***************************************************************************
826Summary:
827        This function sets the control word in register set 1
828
829Description:
830        This function is used to program the desired control word in register
831        set 1 for two-input sync.
832
833Returns:
834        TODO:
835
836See Also:
837
838
839****************************************************************************/
840BERR_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/***************************************************************************
847Summary:
848        This function gets the control word in register set 1
849
850Description:
851        This function is used to get the value of the control word in
852        register set 1 for two-input sync.
853
854Returns:
855        TODO:
856
857See Also:
858
859
860****************************************************************************/
861BERR_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/***************************************************************************
868Summary:
869        This function sets the On and Period values in register set 1
870
871Description:
872        This function is used to program the on interval and cycle period in
873        register set 1 for two-input sync.
874
875Returns:
876        TODO:
877
878See Also:
879
880
881****************************************************************************/
882BERR_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/***************************************************************************
890Summary:
891        This function gets the On and Period values in register set 1
892
893Description:
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
897Returns:
898        TODO:
899
900See Also:
901
902
903****************************************************************************/
904BERR_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/***************************************************************************
912Summary:
913        This function enables or disables sync mode
914
915Description:
916        This function is used to enable or disable PWM sync mode.
917
918Returns:
919        TODO:
920
921See Also:
922
923
924****************************************************************************/
925BERR_Code BPWM_EnableSyncMode
926(
927        BPWM_ChannelHandle      hChn,                           /* [in] Device channel handle */
928        bool                            enable                          /* [in] sync enable */
929);
930
931/***************************************************************************
932Summary:
933        This function sets double buffer mode
934
935Description:
936        This function is used to set the PWM double buffer mode control.
937
938Returns:
939        TODO:
940
941See Also:
942
943
944****************************************************************************/
945BERR_Code BPWM_SetDblBufMode
946(
947        BPWM_ChannelHandle      hChn,                           /* [in] Device channel handle */
948        BPWM_DblBufMode         dblBufMode                      /* [in] double buffer mode type */
949);
950
951/***************************************************************************
952Summary:
953        This function gets double buffer mode
954
955Description:
956        This function is used to get the PWM double buffer mode control.
957
958Returns:
959        TODO:
960
961See Also:
962
963
964****************************************************************************/
965BERR_Code BPWM_GetDblBufMode
966(
967        BPWM_ChannelHandle      hChn,                           /* [in] Device channel handle */
968        BPWM_DblBufMode         *dblBufMode                     /* [out] double buffer mode type */
969);
970
971/***************************************************************************
972Summary:
973        This function sets the sync edge type
974
975Description:
976        This function is used to select the sync signal edge
977
978Returns:
979        TODO:
980
981See Also:
982
983
984****************************************************************************/
985BERR_Code BPWM_SetSyncEdge
986(
987        BPWM_ChannelHandle      hChn,                           /* [in] Device channel handle */
988        BPWM_SyncEdgeSel        SyncEdgeSel                     /* [in] edge type */
989);
990
991/***************************************************************************
992Summary:
993        This function gets the sync edge type
994
995Description:
996        This function is used to get the sync signal edge select type
997
998Returns:
999        TODO:
1000
1001See Also:
1002
1003
1004****************************************************************************/
1005BERR_Code BPWM_GetSyncEdge
1006(
1007        BPWM_ChannelHandle      hChn,                           /* [in] Device channel handle */
1008        BPWM_SyncEdgeSel        *SyncEdgeSel            /* [out] edge type */
1009);
1010
1011/***************************************************************************
1012Summary:
1013        This function sets the two-input sync type
1014
1015Description:
1016        This function is used to select the two-input sync type
1017
1018Returns:
1019        TODO:
1020
1021See Also:
1022
1023
1024****************************************************************************/
1025BERR_Code BPWM_SetTwoInputSync
1026(
1027        BPWM_ChannelHandle              hChn,                   /* [in] Device channel handle */
1028        BPWM_TwoInputSyncType   type                    /* [in] two-input sync type */
1029);
1030
1031/***************************************************************************
1032Summary:
1033        This function gets the two-input sync type
1034
1035Description:
1036        This function is used to get the two-input sync type
1037
1038Returns:
1039        TODO:
1040
1041See Also:
1042
1043
1044****************************************************************************/
1045BERR_Code BPWM_GetTwoInputSync
1046(
1047        BPWM_ChannelHandle              hChn,                   /* [in] Device channel handle */
1048        BPWM_TwoInputSyncType   *type                   /* [out] two-input sync type */
1049);
1050
1051/***************************************************************************
1052Summary:
1053        This function sets the output polarity
1054
1055Description:
1056        This function is used to set the polarity of the PWM output
1057
1058Returns:
1059        TODO:
1060
1061See Also:
1062
1063
1064****************************************************************************/
1065BERR_Code BPWM_SetOutputPolarity
1066(
1067        BPWM_ChannelHandle      hChn,                           /* [in] Device channel handle */
1068        BPWM_OutPolaritySel     OutPolSel                       /* [in] output polarity */
1069);
1070
1071/***************************************************************************
1072Summary:
1073        This function gets the output polarity
1074
1075Description:
1076        This function is used to get the value of the polarity of the PWM output
1077
1078Returns:
1079        TODO:
1080
1081See Also:
1082
1083
1084****************************************************************************/
1085BERR_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
Note: See TracBrowser for help on using the repository browser.