Freescale Semiconductor Inc.
    Regional Technical Application Center

 

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

Port.h File Reference

This file contains all Port Configuration structures as well as
definitions to initialize GPIO pins as outputs. More...

#include "Pwm_Cfg.h"
#include "Derivative.h"

Go to the source code of this file.

Defines

#define SET_AS_OUTPUT   (0x020C)
#define SIU_PCR_ADDR(PCR_OFFSET)   (SIU_PCR(PCR_OFFSET) = (SET_AS_OUTPUT))
#define SIU_GPDO_ADDR(GPDO_OFFSET, u8OutputState)   (SIU_GPDO(GPDO_OFFSET) = (uint8_t)(u8OutputState))
#define TOGGLE_PIN(GPDO_OFFSET)   (SIU_GPDO(GPDO_OFFSET) = ((1) ^ (SIU_GPDO(GPDO_OFFSET))))
#define SET_PIN_HIGH(GPDO_OFFSET)   (SIU_GPDO(GPDO_OFFSET) = (uint8_t)(1))
#define SET_PIN_LOW(GPDO_OFFSET)   (SIU_GPDO(GPDO_OFFSET) = (uint8_t)(0))

Functions

void vfnPort_Init (const Pwm_ChannelConfigType *PortCfgPtr)
 Initialize all GPIO pins contained in Port Configuration
structure as Outputs.


Detailed Description

This file contains all Port Configuration structures as well as
definitions to initialize GPIO pins as outputs.

Copyright (c) 2008 Freescale Semiconductor Freescale Confidential Proprietary

Author:
Freescale Semiconductor

r01160

Guadalajara Applications Laboratory RTAC Americas

Version:
0.1
Date:
4/14/2008 5:37:45 PM
Warning:
User must be aware about which GPIO pins shall be used as Pwm channels.
History:

Define Documentation

#define SET_AS_OUTPUT   (0x020C)
 

Set pins as Outputs with Maximum Slew Rate

#define SET_PIN_HIGH GPDO_OFFSET   )     (SIU_GPDO(GPDO_OFFSET) = (uint8_t)(1))
 

Set pin to ON state

#define SET_PIN_LOW GPDO_OFFSET   )     (SIU_GPDO(GPDO_OFFSET) = (uint8_t)(0))
 

Clear current pin state

#define SIU_GPDO_ADDR GPDO_OFFSET,
u8OutputState   )     (SIU_GPDO(GPDO_OFFSET) = (uint8_t)(u8OutputState))
 

This macro helps to SET or CLEAR the passed GPDO pin. Violates MISRA 2004 rule 11.3 because addressing memory mapped registers

#define SIU_PCR_ADDR PCR_OFFSET   )     (SIU_PCR(PCR_OFFSET) = (SET_AS_OUTPUT))
 

MPC551x SIU PCR Address. Violates MISRA 2004 rule 11.3 because addressing memory mapped registers

#define TOGGLE_PIN GPDO_OFFSET   )     (SIU_GPDO(GPDO_OFFSET) = ((1) ^ (SIU_GPDO(GPDO_OFFSET))))
 

Toggle Port Pin


Function Documentation

void vfnPort_Init const Pwm_ChannelConfigType PortCfgPtr  ) 
 

Initialize all GPIO pins contained in Port Configuration
structure as Outputs.

Author:
R01160
Parameters:
\return none
Todo:
Warning:
Only pins contained in Pwm_ChannelConfig structure will be configured.
Used to count the amount of Port pins to configure

Used to get Port pin offset

Is current Port last in the Configuration Structure?