Freescale Semiconductor Inc.
    Regional Technical Application Center

 

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

Pwm.c File Reference

This file Initialize all PIT Hw resources to emulate Pwm signals
and handles all initialization parameters to operate correctly the
emulated Pwm module. More...

#include "Pwm.h"

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 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.
void vfnSetDuty_Cycle (uint8_t u8PwmChannel, uint32_t u32DutyCyle)
 Change PWM Duty Cycle during runtime.
void Pwm_Generation_Fnc (void)
 Generate signals for all Pwm channels properly configured in Pwm_Cfg.h file.

Variables

Pwm_ChannelConfigTypecurrent_chp = NULL_PTR
const uint32_t IntcIsrVectorTable_p1 []
const Pwm_ChannelConfigTypePwm_Cfg_Ptr = NULL_PTR


Detailed Description

This file Initialize all PIT Hw resources to emulate Pwm signals
and handles all initialization parameters to operate correctly the
emulated 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:51:45 AM
Warning:
History:

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.


Variable Documentation

Pwm_ChannelConfigType* current_chp = NULL_PTR
 

This pointer shall access to Pwm configuration structure

const uint32_t IntcIsrVectorTable_p1[]
 

External Interrupt table

const Pwm_ChannelConfigType* Pwm_Cfg_Ptr = NULL_PTR
 

Holds the last state of the Pwm module