4.9.1 CWG

Complementary Waveform Generator

4.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.

4.9.1.2 Supported Device Families

PIC12/16F150x PIC12/16F157x PIC16F145x

4.9.1.3 Required Header Files:


#include "mcc_generated_files/cwg/cwg.h"

4.9.1.4 Module Documentation

4.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.

Version: CWG Driver Version 1.0.0
Definitions
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.

Precondition:

Initialize the CWG with CWG_Initialize() before calling this API.

Parameters:
None.
Returns:

None.

CWG_AutoShutdownEventSet()

void CWG_AutoShutdownEventSet (void )

Puts the CWG outputs into the Auto-Shutdown state.

Precondition:

Initialize the CWG with CWG_Initialize() before calling this API.

Parameters:
None.
Returns:

None.

CWG_Initialize()

void CWG_Initialize (void )

Initializes the CWG module. This is called only once before calling other CWG APIs.

Parameters:
None.
Returns:

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.

Precondition:

Initialize the CWG with CWG_Initialize() before calling this API.

Parameters:
dutyValue

- Duty cycle value

Returns:

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.

Precondition:

Initialize the CWG with CWG_Initialize() before calling this API.

Parameters:
dutyValue

- Duty cycle value

Returns:

None.

4.9.1.5 File Documentation

4.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.

Version: CWG Driver Version 1.0.0

4.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

Detailed Description

CWG Generated Driver API Header File.