2.18 Pulse Output Driver

Overview

Pulse Output Driver can be used to generate One shot Pulse or a series of output Pulses.Pulse Output Driver can be used to generate One shot Pulse or a series of output Pulses.

Features

  • User configurable Pulse ON time.
  • User configurable time interval between two consecutive Pulse to generate series of Output Pulses.
  • Pulse ON time and Pulse interval time value range varies based on the clock source selected from Hardware Dependency module (PLIB).
  • Pulse Output depends on Synchronization (Sync) and Trigger source.
    • In Sync operation, the Timer resets or clear occurs when the input selected by Sync is asserted.
    • In Trigger operation, the Timer is held in reset until the input selected by Trigger is asserted.

The following waveform represents effect Sync source on Pulse generation.The following waveform represents effect Sync source on Pulse generation.

Figure . 

The following waveform represents effect Trigger source on Pulse generation.

Figure . 

2.18.1 Module Documentation

2.18.1.1 Pulse Output Driver

Pulse Generator Driver is used to generate a one shot Pulse or series of Pulse on a Output Pin using dsPIC MCUs.

2.18.1.1.1 Module description

Pulse Generator Driver is used to generate a one shot Pulse or series of Pulse on a Output Pin using dsPIC MCUs.

Data structures
  • struct PULSEOUTPUT_INTERFACE

    Structure containing the function pointers of PULSEOUTPUT pulse generator driver.

Functions

2.18.1.1.2 Function Documentation

MCCP9_PulseOutput_Callback()

void MCCP9_PulseOutput_Callback (void )

This is the default callback with weak attribute. The user can override and implement the default callback without weak attribute or can register a custom callback function using MCCP9_PulseOutput_CallbackRegister.

Parameters:
none
Returns:

none

MCCP9_PulseOutput_CallbackRegister()

void MCCP9_PulseOutput_CallbackRegister (void(*)(void) handler)

This function can be used to override default callback and to define custom callback for MCCP9 PulseOutput event.

Parameters:
in handler

- Address of the callback function

Returns:

none

MCCP9_PulseOutput_CountSet()

void MCCP9_PulseOutput_CountSet (uint16_t onTime, uint16_t pulseCount)

Sets the ON delay and pulse width.

Parameters:
in onTime

- 16 bit pulse on time wait value

in pulseCount

- 16 bit pulse width value

Returns:

none

MCCP9_PulseOutput_Deinitialize()

void MCCP9_PulseOutput_Deinitialize (void )

Deinitializes the MCCP9 to POR values.

Parameters:
none
Returns:

none

MCCP9_PulseOutput_Disable()

void MCCP9_PulseOutput_Disable (void )

Disables the MCCP9 module.

Parameters:
none
Returns:

none

MCCP9_PulseOutput_Enable()

void MCCP9_PulseOutput_Enable (void )

Enables the MCCP9 module with the corresponding operation mode.

Parameters:
none
Returns:

none

MCCP9_PulseOutput_Initialize()

void MCCP9_PulseOutput_Initialize (void )

Iitializes the MCCP9 PulseOutput driver. This function must be called before any other MCCP9 function is called.

Parameters:
none
Returns:

none

MCCP9_PulseOutput_SoftwareTriggerSet()

void MCCP9_PulseOutput_SoftwareTriggerSet (void )

This function sets the manual trigger.

Parameters:
none
Returns:

none

MCCP9_PulseOutput_Tasks()

void MCCP9_PulseOutput_Tasks (void )

This function is used to implement the tasks for polled implementations.

Parameters:
none
Returns:

none

2.18.1.1.3 Variable Documentation

Pulse_Output9

const struct PULSEOUTPUT_INTERFACE Pulse_Output9

Structure object of type PULSEOUTPUT_INTERFACE with the custom name given by the user in the Melody Driver User interface.

The default name e.g. Pulse_Output1 can be changed by the user in the MCCP user interface. This allows defining a structure with application specific name using the 'Custom Name' field. Application specific name allows the API Portability.

2.18.2 Class Documentation

2.18.2.1 PULSEOUTPUT_INTERFACE Struct Reference

Structure containing the function pointers of PULSEOUTPUT pulse generator driver.

2.18.2.1.1 Detailed Description

Structure containing the function pointers of PULSEOUTPUT pulse generator driver.

#include <pulseoutput_interface.h>

Public Attributes
  • void(* Initialize )(void)

    Pointer to SCCPx_PulseOutput_Initialize e.g. SCCP1_PulseOutput_Initialize.

  • void(* Deinitialize )(void)

    Pointer to SCCPx_PulseOutput_Deinitialize e.g. SCCP1_PulseOutput_Deinitialize.

  • void(* Enable )(void)

    Pointer to SCCPx_PulseOutput_Enable e.g. SCCP1_PulseOutput_Enable.

  • void(* Disable )(void)

    Pointer to SCCPx_PulseOutput_Disable e.g. SCCP1_PulseOutput_Disable.

  • void(* CountSet )(uint16_t onTime, uint16_t pulseCount)

    Pointer to SCCPx_PulseOutput_CountSet e.g. SCCP1_PulseOutput_CountSet.

  • void(* SoftwareTriggerSet )(void)

    Pointer to SCCPx_PulseOutput_SoftwareTriggerSet e.g. SCCP1_PulseOutput_SoftwareTriggerSet.

  • void(* CallbackRegister )(void(*handler)(void))

    Pointer to SCCPx_PulseOutput_CallbackRegister e.g. SCCP1_PulseOutput_CallbackRegister.

  • void(* Tasks )(void)

    Pointer to SCCPx_PulseOutput_Tasks e.g. SCCP1_PulseOutput_Tasks (Supported only in polling mode)

2.18.2.1.2 Member Data Documentation

The documentation for this struct was generated from the following file:

source/

pulseoutput_interface.h

CallbackRegister

void(* CallbackRegister) (void(*handler)(void))

Pointer to SCCPx_PulseOutput_CallbackRegister e.g. SCCP1_PulseOutput_CallbackRegister.

CountSet

void(* CountSet) (uint16_t onTime, uint16_t pulseCount)

Pointer to SCCPx_PulseOutput_CountSet e.g. SCCP1_PulseOutput_CountSet.

Deinitialize

void(* Deinitialize) (void)

Pointer to SCCPx_PulseOutput_Deinitialize e.g. SCCP1_PulseOutput_Deinitialize.

Disable

void(* Disable) (void)

Pointer to SCCPx_PulseOutput_Disable e.g. SCCP1_PulseOutput_Disable.

Enable

void(* Enable) (void)

Pointer to SCCPx_PulseOutput_Enable e.g. SCCP1_PulseOutput_Enable.

Initialize

void(* Initialize) (void)

Pointer to SCCPx_PulseOutput_Initialize e.g. SCCP1_PulseOutput_Initialize.

SoftwareTriggerSet

void(* SoftwareTriggerSet) (void)

Pointer to SCCPx_PulseOutput_SoftwareTriggerSet e.g. SCCP1_PulseOutput_SoftwareTriggerSet.

Tasks

void(* Tasks) (void)

Pointer to SCCPx_PulseOutput_Tasks e.g. SCCP1_PulseOutput_Tasks (Supported only in polling mode)

2.18.3 File Documentation

2.18.3.1 source/mccp9.h File Reference

This is the generated driver header file for the MCCP9 driver.

#include <stdint.h>
#include "pulseoutput_interface.h"

2.18.3.1.1 Functions

2.18.3.1.3 Detailed Description

This is the generated driver header file for the MCCP9 driver.

MCCP9 Generated Driver Header File

2.18.3.2 source/pulseoutput_interface.h File Reference

#include <stdint.h>

2.18.3.2.1 Data structures

  • struct PULSEOUTPUT_INTERFACE

    Structure containing the function pointers of PULSEOUTPUT pulse generator driver.

2.18.3.2.2 Detailed Description

PULSEOUTPUT Generated Driver Interface Header File