pwm
pwm
* File: pwm.c
* Author: Sanket
*/
#include "pwm.h"
/*
* Global variables
*/
/*
* Private function prototypes
*/
/*
* Function definitions
*/
void init_pwm_1(void) {
// Set PWM 1 pin direction as Output
PWM_1_DIR = DIR_OP;
PWM_1_OFF();
void init_pwm_2(void) {
// Set PWM 2 pin direction as Output
PWM_2_DIR = DIR_OP;
PWM_2_OFF();
void pwm_2_start(void) {
// Enable the Timer2, hence enable the PWM.
T2CONbits.TMR2ON = BIT_SET;
}
void pwm_2_stop(void) {
// Disable the Timer2, hence disable the PWM.
T2CONbits.TMR2ON = BIT_CLR;
}