2.18 Pulse Output Driver
2.18.1 Introduction
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.
The following waveform represents effect Trigger source on Pulse generation.
2.18.2 Module Documentation
2.18.2.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.2.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.
2.18.2.1.1.1 Data structures
struct PULSEOUTPUT_INTERFACE
Structure containing the function pointers of PULSEOUTPUT pulse generator driver.
2.18.2.1.1.2 Functions
void MCCP9_PulseOutput_Initialize (void)
Iitializes the MCCP9 PulseOutput driver. This function must be called before any other MCCP9 function is called.
void MCCP9_PulseOutput_Deinitialize (void)
Deinitializes the MCCP9 to POR values.
void MCCP9_PulseOutput_Enable (void)
Enables the MCCP9 module with the corresponding operation mode.
void MCCP9_PulseOutput_Disable (void)
Disables the MCCP9 module.
void MCCP9_PulseOutput_CountSet (uint16_t onTime, uint16_t pulseCount)
Sets the ON delay and pulse width.
void MCCP9_PulseOutput_SoftwareTriggerSet (void)
This function sets the manual trigger.
void MCCP9_PulseOutput_CallbackRegister (void(*handler)(void))
This function can be used to override default callback and to define custom callback for MCCP9 PulseOutput event.
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.
void MCCP9_PulseOutput_Tasks (void)
This function is used to implement the tasks for polled implementations.
2.18.2.1.1.3 Variables
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.
2.18.2.1.2 Function Documentation
2.18.2.1.2.1 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.
none |
none |
2.18.2.1.2.2 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.
in | handler |
- Address of the callback function |
none |
2.18.2.1.2.3 MCCP9_PulseOutput_CountSet()
void MCCP9_PulseOutput_CountSet (uint16_t onTime, uint16_t pulseCount)
Sets the ON delay and pulse width.
in | onTime |
- 16 bit pulse on time wait value |
in | pulseCount |
- 16 bit pulse width value |
none |
2.18.2.1.2.4 MCCP9_PulseOutput_Deinitialize()
void MCCP9_PulseOutput_Deinitialize (void )
Deinitializes the MCCP9 to POR values.
none |
none |
2.18.2.1.2.5 MCCP9_PulseOutput_Disable()
void MCCP9_PulseOutput_Disable (void )
Disables the MCCP9 module.
none |
none |
2.18.2.1.2.6 MCCP9_PulseOutput_Enable()
void MCCP9_PulseOutput_Enable (void )
Enables the MCCP9 module with the corresponding operation mode.
none |
none |
2.18.2.1.2.7 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.
none |
none |
2.18.2.1.2.8 MCCP9_PulseOutput_SoftwareTriggerSet()
void MCCP9_PulseOutput_SoftwareTriggerSet (void )
This function sets the manual trigger.
none |
none |
2.18.2.1.2.9 MCCP9_PulseOutput_Tasks()
void MCCP9_PulseOutput_Tasks (void )
This function is used to implement the tasks for polled implementations.
none |
none |
2.18.2.1.3 Variable Documentation
2.18.2.1.3.1 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.3 Class Documentation
2.18.3.1 PULSEOUTPUT_INTERFACE Struct Reference
Structure containing the function pointers of PULSEOUTPUT pulse generator driver.
2.18.3.1.1 Detailed Description
Structure containing the function pointers of PULSEOUTPUT pulse generator driver.
#include <pulseoutput_interface.h>
2.18.3.1.1.1 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.3.1.2 Member Data Documentation
The documentation for this struct was generated from the following file:
source/
2.18.3.1.2.1 CallbackRegister
void(* CallbackRegister) (void(*handler)(void))
Pointer to SCCPx_PulseOutput_CallbackRegister e.g. SCCP1_PulseOutput_CallbackRegister.
2.18.3.1.2.2 CountSet
void(* CountSet) (uint16_t onTime, uint16_t pulseCount)
Pointer to SCCPx_PulseOutput_CountSet e.g. SCCP1_PulseOutput_CountSet.
2.18.3.1.2.3 Deinitialize
void(* Deinitialize) (void)
Pointer to SCCPx_PulseOutput_Deinitialize e.g. SCCP1_PulseOutput_Deinitialize.
2.18.3.1.2.4 Disable
void(* Disable) (void)
Pointer to SCCPx_PulseOutput_Disable e.g. SCCP1_PulseOutput_Disable.
2.18.3.1.2.5 Enable
void(* Enable) (void)
Pointer to SCCPx_PulseOutput_Enable e.g. SCCP1_PulseOutput_Enable.
2.18.3.1.2.6 Initialize
void(* Initialize) (void)
Pointer to SCCPx_PulseOutput_Initialize e.g. SCCP1_PulseOutput_Initialize.
2.18.3.1.2.7 SoftwareTriggerSet
void(* SoftwareTriggerSet) (void)
Pointer to SCCPx_PulseOutput_SoftwareTriggerSet e.g. SCCP1_PulseOutput_SoftwareTriggerSet.
2.18.3.1.2.8 Tasks
void(* Tasks) (void)
Pointer to SCCPx_PulseOutput_Tasks e.g. SCCP1_PulseOutput_Tasks (Supported only in polling mode)
2.18.4 File Documentation
2.18.4.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.4.1.1 Functions
void MCCP9_PulseOutput_Initialize (void)
Iitializes the MCCP9 PulseOutput driver. This function must be called before any other MCCP9 function is called.
void MCCP9_PulseOutput_Deinitialize (void)
Deinitializes the MCCP9 to POR values.
void MCCP9_PulseOutput_Enable (void)
Enables the MCCP9 module with the corresponding operation mode.
void MCCP9_PulseOutput_Disable (void)
Disables the MCCP9 module.
void MCCP9_PulseOutput_CountSet (uint16_t onTime, uint16_t pulseCount)
Sets the ON delay and pulse width.
void MCCP9_PulseOutput_SoftwareTriggerSet (void)
This function sets the manual trigger.
void MCCP9_PulseOutput_CallbackRegister (void(*handler)(void))
This function can be used to override default callback and to define custom callback for MCCP9 PulseOutput event.
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.
void MCCP9_PulseOutput_Tasks (void)
This function is used to implement the tasks for polled implementations.
2.18.4.1.2 Variables
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.
2.18.4.1.3 Detailed Description
This is the generated driver header file for the MCCP9 driver.
MCCP9 Generated Driver Header File
2.18.4.2 source/pulseoutput_interface.h File Reference
#include <stdint.h>
2.18.4.2.1 Data structures
struct PULSEOUTPUT_INTERFACE
Structure containing the function pointers of PULSEOUTPUT pulse generator driver.
2.18.4.2.2 Detailed Description
PULSEOUTPUT Generated Driver Interface Header File