Project 3  Seven-Segment Display
Neff Site
Macros | Functions
pwm.h File Reference

This module implements a PWM driver. More...

Go to the source code of this file.

Macros

#define PWM_PORT   PORTF
 
#define PWM_CCEN   TC0_CCCEN_bm
 
#define PWM_CCREG   CCC
 
#define PWM_MODULE   TCF0
 
#define PWM_PIN_bm   PIN2_bm
 

Functions

void pwm_init (void)
 Initialize PWM module. More...
 
void pwm_stop (void)
 Stop the modulation. More...
 
void pwm_start (void)
 Start the modulation. More...
 
void pwm_duty (uint8_t duty)
 Set the duty cycle. More...
 

Detailed Description

This module implements a PWM driver.

Author
Wolfgang Neff
Version
2.0
Date
2018-03-10
History
Created: 2017-07-06 Modified: 2018-03-10

Macro Definition Documentation

◆ PWM_CCEN

#define PWM_CCEN   TC0_CCCEN_bm

◆ PWM_CCREG

#define PWM_CCREG   CCC

◆ PWM_MODULE

#define PWM_MODULE   TCF0

◆ PWM_PIN_bm

#define PWM_PIN_bm   PIN2_bm

◆ PWM_PORT

#define PWM_PORT   PORTF

Function Documentation

◆ pwm_duty()

void pwm_duty ( uint8_t  duty)

Set the duty cycle.

Sets the duty cycle of the pulse width modulated signal.

Parameters
dutyThe duty cycle per cent.

◆ pwm_init()

void pwm_init ( void  )

Initialize PWM module.

Initializes the PWM module but does not yet start the modulation.

◆ pwm_start()

void pwm_start ( void  )

Start the modulation.

Start the modulation on the oscillator pin.

◆ pwm_stop()

void pwm_stop ( void  )

Stop the modulation.

Stops the modulations, clears the oscillator pin and resets the PWM timer.

Contact