3.9.1 CWG
Complementary Waveform Generator
3.9.1.1 Introduction
The Complementary Waveform Generator (CWG) produces a complementary waveform with dead-band delay from a selection of input sources. The CWG comes with features like selectable clock sources, input sources, output enable control, and selectable dead-band customization. Its auto-shutdown feature and pin override control enhance system efficiency and flexibility.
3.9.1.2 Supported Device Families
PIC12/16F150x | PIC12/16F157x | PIC16F145x |
3.9.1.3 Required Header Files:
#include "mcc_generated_files/cwg/cwg.h"
3.9.1.4 Module Documentation
3.9.1.4.1 CWG
This file contains the API prototypes for the CWG driver.
Module description
This file contains the API prototypes for the CWG driver.
Definitions
#define CWG_Initialize CWG_Initialize
Defines the Custom Name for the CWG_Initialize API.
#define CWG_LoadRiseDeadbandCount CWG_LoadRiseDeadbandCount
Defines the Custom Name for the CWG_LoadRiseDeadbandCount API.
#define CWG_LoadFallDeadbandCount CWG_LoadFallDeadbandCount
Defines the Custom Name for the CWG_LoadFallDeadbandCount API.
#define CWG_AutoShutdownEventSet CWG_AutoShutdownEventSet
Defines the Custom Name for the CWG_AutoShutdownEventSet API.
#define CWG_AutoShutdownEventClear CWG_AutoShutdownEventClear
Defines the Custom Name for the CWG_AutoShutdownEventClear API.
Functions
void CWG_Initialize (void)
Initializes the CWG module. This is called only once before calling other CWG APIs.
void CWG_LoadRiseDeadbandCount (uint8_t dutyValue)
Sets the duration of the dead-band interval on the rising edge of the input source signal.
void CWG_LoadFallDeadbandCount (uint8_t dutyValue)
Sets the duration of the dead-band interval on the falling edge of the input source signal.
void CWG_AutoShutdownEventSet (void)
Puts the CWG outputs into the Auto-Shutdown state.
void CWG_AutoShutdownEventClear (void)
Resumes the operation of the CWG when the Auto-Shutdown state is disabled.
Definition Documentation
CWG_AutoShutdownEventClear
#define CWG_AutoShutdownEventClear CWG_AutoShutdownEventClear
Defines the Custom Name for the CWG_AutoShutdownEventClear API.
CWG_AutoShutdownEventSet
#define CWG_AutoShutdownEventSet CWG_AutoShutdownEventSet
Defines the Custom Name for the CWG_AutoShutdownEventSet API.
CWG_Initialize
#define CWG_Initialize CWG_Initialize
Defines the Custom Name for the CWG_Initialize API.
CWG_LoadFallDeadbandCount
#define CWG_LoadFallDeadbandCount CWG_LoadFallDeadbandCount
Defines the Custom Name for the CWG_LoadFallDeadbandCount API.
CWG_LoadRiseDeadbandCount
#define CWG_LoadRiseDeadbandCount CWG_LoadRiseDeadbandCount
Defines the Custom Name for the CWG_LoadRiseDeadbandCount API.
Function Documentation
CWG_AutoShutdownEventClear()
void CWG_AutoShutdownEventClear (void )
Resumes the operation of the CWG when the Auto-Shutdown state is disabled.
Initialize the CWG with CWG_Initialize() before calling this API. |
None. |
None. |
CWG_AutoShutdownEventSet()
void CWG_AutoShutdownEventSet (void )
Puts the CWG outputs into the Auto-Shutdown state.
Initialize the CWG with CWG_Initialize() before calling this API. |
None. |
None. |
CWG_Initialize()
void CWG_Initialize (void )
Initializes the CWG module. This is called only once before calling other CWG APIs.
None. |
None. |
CWG_LoadFallDeadbandCount()
void CWG_LoadFallDeadbandCount (uint8_t dutyValue)
Sets the duration of the dead-band interval on the falling edge of the input source signal.
Initialize the CWG with CWG_Initialize() before calling this API. |
dutyValue |
- Duty cycle value |
None. |
CWG_LoadRiseDeadbandCount()
void CWG_LoadRiseDeadbandCount (uint8_t dutyValue)
Sets the duration of the dead-band interval on the rising edge of the input source signal.
Initialize the CWG with CWG_Initialize() before calling this API. |
dutyValue |
- Duty cycle value |
None. |
3.9.1.5 File Documentation
3.9.1.5.1 source/cwg.c File Reference
This file contains the API implementations for the CWG driver.
#include <xc.h> #include "../cwg.h"
Functions
void CWG_Initialize (void)
Initializes the CWG module. This is called only once before calling other CWG APIs.
void CWG_LoadRiseDeadbandCount (uint8_t dutyValue)
Sets the duration of the dead-band interval on the rising edge of the input source signal.
void CWG_LoadFallDeadbandCount (uint8_t dutyValue)
Sets the duration of the dead-band interval on the falling edge of the input source signal.
void CWG_AutoShutdownEventSet (void)
Puts the CWG outputs into the Auto-Shutdown state.
void CWG_AutoShutdownEventClear (void)
Resumes the operation of the CWG when the Auto-Shutdown state is disabled.
Detailed Description
This file contains the API implementations for the CWG driver.
CWG Generated Driver File.
3.9.1.5.2 source/cwg.h File Reference
#include <stdint.h> #include <stdbool.h>
Functions
void CWG_Initialize (void)
Initializes the CWG module. This is called only once before calling other CWG APIs.
void CWG_LoadRiseDeadbandCount (uint8_t dutyValue)
Sets the duration of the dead-band interval on the rising edge of the input source signal.
void CWG_LoadFallDeadbandCount (uint8_t dutyValue)
Sets the duration of the dead-band interval on the falling edge of the input source signal.
void CWG_AutoShutdownEventSet (void)
Puts the CWG outputs into the Auto-Shutdown state.
void CWG_AutoShutdownEventClear (void)
Resumes the operation of the CWG when the Auto-Shutdown state is disabled.
Macros
#define CWG_Initialize CWG_Initialize
Defines the Custom Name for the CWG_Initialize API.
#define CWG_LoadRiseDeadbandCount CWG_LoadRiseDeadbandCount
Defines the Custom Name for the CWG_LoadRiseDeadbandCount API.
#define CWG_LoadFallDeadbandCount CWG_LoadFallDeadbandCount
Defines the Custom Name for the CWG_LoadFallDeadbandCount API.
#define CWG_AutoShutdownEventSet CWG_AutoShutdownEventSet
Defines the Custom Name for the CWG_AutoShutdownEventSet API.
#define CWG_AutoShutdownEventClear CWG_AutoShutdownEventClear
Defines the Custom Name for the CWG_AutoShutdownEventClear API.
Detailed Description
CWG Generated Driver API Header File.