Freescale Semiconductor Inc.
    Regional Technical Application Center

 

Main Page | Class List | Directories | File List | File Members | Related Pages

Pwm.h File Reference

This file contains all initialization and function statements to handle the
emualted Pwm module. More...

#include "Pwm_Cfg.h"
#include "Port.h"
#include "Derivative.h"
#include "Pit.h"
#include "Pwm_ReportError.h"

Go to the source code of this file.

Defines

#define SET_33US_TIMEBASE   ((uint32_t)0x00000840)

Functions

void vfnPwm_Init (const Pwm_ChannelConfigType *PwmCfgPtr)
 Initialize all Pwm resources to operate correctly.
Intialization includes GPIO setup, Pit timer setup
to generate the desired Pwm period and Pwm parameters.
void vfnCoreInterruptHandling (uint8_t u8InterruptType)
 Configure HVEN register to let MCU know which Core will handle Pit Interrupts.
void vfnSetDuty_Cycle (uint8_t u8PwmChannel, uint32_t u32DutyCyle)
 Change PWM Duty Cycle during runtime.
void vfnSetPeriodAndDuty (uint8_t u8PwmChannel, uint32_t u32Period, uint32_t u32DutyCyle)
 Change PWM Period and Duty Cycle during runtime. Period and Duty Cycle
shall be refresed once the last period ends.
void Pwm_Generation_Fnc (void)
 Generate signals for all Pwm channels properly configured in Pwm_Cfg.h file.


Detailed Description

This file contains all initialization and function statements to handle the
emualted Pwm module.

Copyright (c) 2008 Freescale Semiconductor Freescale Confidential Proprietary

Author:
Freescale Semiconductor

r01160

Guadalajara Applications Laboratory RTAC Americas

Version:
0.1
Date:
4/16/2008 9:55:45 AM
Warning:
History:

Define Documentation

#define SET_33US_TIMEBASE   ((uint32_t)0x00000840)
 

Pit Interrupt period


Function Documentation

void Pwm_Generation_Fnc void   ) 
 

Generate signals for all Pwm channels properly configured in Pwm_Cfg.h file.

Author:
R01160
Parameters:
none 
Returns:
none

void vfnCoreInterruptHandling uint8_t  u8InterruptType  ) 
 

Configure HVEN register to let MCU know which Core will handle Pit Interrupts.

Author:
R01160
Parameters:
Interrupt Type (Hw or Sw)
Returns:
none
Todo:
Warning:
Only two choices are allowed to operate within the specification on this
function. Z1 core OR Z0 core (Z1 or Z0 values).

void vfnPwm_Init const Pwm_ChannelConfigType PwmCfgPtr  ) 
 

Initialize all Pwm resources to operate correctly.
Intialization includes GPIO setup, Pit timer setup
to generate the desired Pwm period and Pwm parameters.

Author:
R01160
Parameters:
const Pwm_ChannelConfigType *PortCfgPtr
Returns:
none
Todo:
Warning:
Only pins contained in Pwm_ChannelConfig structure will be configured.
if Report Error Layer (PWM_ERROR_DETECT == OFF) is turned off, none Pwm
parameters shall be analyzed and possible corrupt data might be generated.

void vfnSetDuty_Cycle uint8_t  u8PwmChannel,
uint32_t  u32DutyCyle
 

Change PWM Duty Cycle during runtime.

Author:
R01160
Parameters:
Pwm channel, Duty Cycle value
Returns:
none
Todo:
Warning:
User must be aware to pass only valid configured Pwm Channels.
PWM Channel values MUST START from 0-up to configured Pwm
channels. i.e. Pwm_Chan_0 = 0, Pwm_Chan_1 = 1, etc.

void vfnSetPeriodAndDuty uint8_t  u8PwmChannel,
uint32_t  u32Period,
uint32_t  u32DutyCycle
 

Change PWM Period and Duty Cycle during runtime. Period and Duty Cycle
shall be refresed once the last period ends.

Author:
R01160
Parameters:
Pwm channel,Pwm Period , Duty Cycle value
Returns:
none
Todo:
Warning:
User must be aware to pass only valid configured Pwm Channels.