Module 1280.pwm.arch - Pulse Width Modulation board-specific helper functions for the ATmega1280

Pulse Width Modulation board-specific helper functions for the ATmega1280

Index

Declarations

pwm.arch.module:36Function 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:151Function 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 Pluse 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:258Function 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:289Function 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:315Function 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:360Function 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:401Function 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.