Module 328.pwm.arch
 Pulse Width Modulation boardspecific helper functions for the ATmega328
Pulse Width Modulation boardspecific helper functions for the ATmega328.
Index

Function
pwm16.ICRn.lookup
 Lookup FUNCTION for finding the appropriate Input Capture Register for the given 16bit , AVR pin being used for PWM operations 
Function
pwm16.TCCRnB.helper
 Helper function that modifies the TCCRnB.bits BYTE initially found in pwm16.lookup 
Function
pwm16.compare.lookup
 Lookup FUNCTION for finding the appropriate Output Compare Register 
Function
pwm16.lookup
 Lookup function that returns a variety of useful numbers involved with the operation of Pulse Width Modulation on 16 bit timers 
Function
pwm8.TCCRnB.helper
 Helper function that modifies the TCCRnB.bits BYTE initially found in pwm8.lookup 
Function
pwm8.compare.lookup
 Lookup FUNCTION for finding the appropriate Output Compare Register 
Function
pwm8.lookup
 Lookup function that returns a variety of useful numbers involved with the operation of Pulse Width Modulation on 8 bit timers
Declarations
pwm.arch.module
:37Function pwm8.lookup
INT, INT, INT, BYTE, BYTE FUNCTION pwm8.lookup (VAL INT avr.pin)
Lookup function that returns a variety of useful numbers involved with the operation of Pulse Width Modulation on 8 bit timers.
Parameters:
VAL INT 
avr.pin 
The AVR pin connected to the PWM operations. 
Returns:
INT 
TCCRnA 
Timer/Counter Control Register A for the given PWM pin. 
INT 
TCCRnB 
Timer/Counter Control Register B for the given PWM pin. 
INT 
OCRnx 
Output Compare Register for the given PWM pin. 
BYTE 
TCCRnA.bit 
The BYTE to be written into TCCRnA. Might be modified by aditional FUNCTIONs. 
BYTE 
TCCRnB.bit 
The BYTE to be written into TCCRnB. Might be modified by aditional FUNCTIONs. 
pwm.arch.module
:98Function pwm16.lookup
INT, INT, INT, BYTE, BYTE FUNCTION pwm16.lookup (VAL INT avr.pin)
Lookup function that returns a variety of useful numbers involved with the operation of Pulse Width Modulation on 16 bit timers.
Parameters:
VAL INT 
avr.pin 
The AVR pin connected to the PWM operations. 
Returns:
INT 
TCCRnA 
Timer/Counter Control Register A for the given PWM pin. 
INT 
TCCRnB 
Timer/Counter Control Register B for the given PWM pin. 
INT 
OCRnx 
Output Compare Register for the given PWM pin. 
BYTE 
TCCRnA.bit 
The BYTE to be written into TCCRnA. Might be modified by aditional FUNCTIONs. 
BYTE 
TCCRnB.bit 
The BYTE to be written into TCCRnB. Might be modified by aditional FUNCTIONs. 
pwm.arch.module
:131Function pwm8.TCCRnB.helper
BYTE FUNCTION pwm8.TCCRnB.helper (VAL BYTE TCCRnB.bits, VAL INT prescale)
Helper function that modifies the TCCRnB.bits BYTE initially found in pwm8.lookup. The modifications are based on the desired prescale value to be used with the PWM operations.
Parameters:
VAL BYTE 
TCCRnB.bits 
The TCCRnB.bits BYTE initially found in pwm8.lookup. 
VAL INT 
prescale 
The desired prescale value. 
Returns:
BYTE 
TCCRnB.bits 
The modified TCCRnB.bits BYTE to be written into TCCRnB. 
pwm.arch.module
:162Function pwm16.TCCRnB.helper
BYTE FUNCTION pwm16.TCCRnB.helper (VAL BYTE TCCRnB.bits, VAL INT prescale)
Helper function that modifies the TCCRnB.bits BYTE initially found in pwm16.lookup. The modifications are based on the desired prescale value to be used with the PWM operations.
Parameters:
VAL BYTE 
TCCRnB.bits 
The TCCRnB.bits BYTE initially found in pwm16.lookup. 
VAL INT 
prescale 
The desired prescale value. 
Returns:
BYTE 
TCCRnB.bits 
The modified TCCRnB.bits BYTE to be written into TCCRnB. 
pwm.arch.module
:187Function pwm8.compare.lookup
INT FUNCTION pwm8.compare.lookup (VAL INT avr.pin)
Lookup FUNCTION for finding the appropriate Output Compare Register.
Parameters:
VAL INT 
avr.pin 
The AVR pin being used for PWM operations. 
Returns:
INT 
OCRnx 
The Output Compare Register for the given PWM pin. 
pwm.arch.module
:214Function pwm16.compare.lookup
INT FUNCTION pwm16.compare.lookup (VAL INT avr.pin)
Lookup FUNCTION for finding the appropriate Output Compare Register.
Parameters:
VAL INT 
avr.pin 
The AVR pin being used for PWM operations. 
Returns:
INT 
OCRnx 
The Output Compare Register for the given PWM pin. 
pwm.arch.module
:234Function pwm16.ICRn.lookup
INT FUNCTION pwm16.ICRn.lookup (VAL INT avr.pin)
Lookup FUNCTION for finding the appropriate Input Capture Register for the given 16bit, AVR pin being used for PWM operations.
Parameters:
VAL INT 
avr.pin 
The AVR pin being used for PWM operations. 
Returns:
INT 
ICRn 
The Input Capture Register for the given PWM pin. 