Freescale Semiconductor Inc.
    Regional Technical Application Center

 

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

Emios.h File Reference

This file contains all timebase definitions for Multi-Thread Scheduler. More...

#include "Derivative.h"
#include "Pwm_ReportError.h"

Go to the source code of this file.

Defines

#define EMIOS_MCB_MODE   ((uint8_t)0x50)
#define eMIOS_GLOBAL_PRESCALER   ((uint8_t)128)
#define eMIOS_ENABLE_GLOBAL_TIMEBASE()   (EMIOS.MCR.B.GTBE = (uint8_t)(1))
#define eMIOS_ENABLE_GLOBAL_PRESCALER()   (EMIOS.MCR.B.GPREN = (uint8_t)(1))
#define eMIOS_SET_GLOBAL_PRESCALER_VALUE(value)   (EMIOS.MCR.B.GPRE = (uint8_t)(value))
#define eMIOS_ENABLE_GLOBAL_FREEZE_IN_DEBUG()   (EMIOS.MCR.B.FRZ = (uint8_t)1)
#define eMIOS_SET_COUNT_A(channel, count)   (EMIOS.CH[channel].CADR.R = (uint16_t)(count))
#define eMIOS_SET_COUNT_B(channel, count)   (EMIOS.CH[channel].CBDR.R = (uint16_t)(count))
#define eMIOS_STATUS_FLAG(channel)   EMIOS.CH[channel].CSR.B.FLAG
#define eMIOS_TIMER_COUNT(channel)   EMIOS.CH[channel].CCNTR.R
#define eMIOS_ENABLE_LOCAL_PRESCALER(channel)   (EMIOS.CH[channel].CCR.B.UCPEN = (uint8_t)(1))
#define eMIOS_SET_PRESCALER(channel, value)   (EMIOS.CH[channel].CCR.B.UCPRE = (uint8_t)(value))
#define eMIOS_ENABLE_CHANNEL_INTERRUPT(channel)   (EMIOS.CH[channel].CCR.B.FEN = (uint8_t)(1))
#define eMIOS_CLEAR_COUNTER(channel)   (eMIOS_TIMER_COUNT(channel) = (uint8_t)(0))
#define eMIOS_CLEAR_STATUS_FLAG(channel)   (eMIOS_STATUS_FLAG(channel) = (uint8_t)(1))
#define eMIOS_FREEZE_IN_DEBUG(channel)   (EMIOS.CH[channel].CCR.B.FREN = (uint8_t)(1))
#define eMIOS_SET_INTERNAL_TIME_BASE(channel)   (EMIOS.CH[channel].CCR.B.BSL = (uint8_t)(3))
#define eMIOS_SET_EDGE_POLARITY(channel, pol)   (EMIOS.CH[channel].CCR.B.EDPOL = (uint8_t)(pol))
#define eMIOS_MATCH_EVENT_FLAG(channel)   EMIOS.CH[channel].CSR.B.FLAG
#define eMIOS_SET_MODULUS_UP_COUNTER(channel)   EMIOS.CH[channel].CCR.B.MODE = EMIOS_MCB_MODE
#define SCHEDULER_EMIOS_CHANNEL   ((uint8_t)0)
#define INTERRUPT_EMIOS_0   ((uint8_t)58)
#define eMIOS_TM_LOCAL_PRESCALER   ((uint8_t)4)

Typedefs

typedef void(* Emios_CallbackType )(void)

Functions

void Emios_Scheduler_Isr (void)
 Emios Channel 0 Interrupt Handler.
void vfnEmios_Set_Callback_Fnc (Emios_CallbackType Callback_Fnc)
 Sets the function to which the emios interrupt shall
jump once interrupt occurs.


Detailed Description

This file contains all timebase definitions for Multi-Thread Scheduler.

Copyright (c) 2008 Freescale Semiconductor Freescale Confidential Proprietary

Author:
Freescale Semiconductor

Guadalajara Applications Laboratory RTAC Americas

R01160

Version:
0.1
Date:
5/23/2008

Define Documentation

#define eMIOS_CLEAR_COUNTER channel   )     (eMIOS_TIMER_COUNT(channel) = (uint8_t)(0))
 

Clear counter of specified channel

#define eMIOS_CLEAR_STATUS_FLAG channel   )     (eMIOS_STATUS_FLAG(channel) = (uint8_t)(1))
 

Clear counter flag

#define eMIOS_ENABLE_CHANNEL_INTERRUPT channel   )     (EMIOS.CH[channel].CCR.B.FEN = (uint8_t)(1))
 

Allow unified channel to set interrupt

 
#define eMIOS_ENABLE_GLOBAL_FREEZE_IN_DEBUG  )     (EMIOS.MCR.B.FRZ = (uint8_t)1)
 

Globally enable freeze mode

 
#define eMIOS_ENABLE_GLOBAL_PRESCALER  )     (EMIOS.MCR.B.GPREN = (uint8_t)(1))
 

Global prescaler enabled

 
#define eMIOS_ENABLE_GLOBAL_TIMEBASE  )     (EMIOS.MCR.B.GTBE = (uint8_t)(1))
 

Global Timebase enabled

#define eMIOS_ENABLE_LOCAL_PRESCALER channel   )     (EMIOS.CH[channel].CCR.B.UCPEN = (uint8_t)(1))
 

Local Prescaler enabled

#define eMIOS_FREEZE_IN_DEBUG channel   )     (EMIOS.CH[channel].CCR.B.FREN = (uint8_t)(1))
 

Stop (freeze) channel registers when in debug mode

#define eMIOS_GLOBAL_PRESCALER   ((uint8_t)128)
 

Global eMIOS prescaler: SysClk -> Global Pres -> Local Prescaler

#define eMIOS_MATCH_EVENT_FLAG channel   )     EMIOS.CH[channel].CSR.B.FLAG
 

Indicator of input capture or a match event in the comparators occurred

#define EMIOS_MCB_MODE   ((uint8_t)0x50)
 

emios Operation Mode

#define eMIOS_SET_COUNT_A channel,
count   )     (EMIOS.CH[channel].CADR.R = (uint16_t)(count))
 

Load eMIOS counter register A with a 24-bit value

#define eMIOS_SET_COUNT_B channel,
count   )     (EMIOS.CH[channel].CBDR.R = (uint16_t)(count))
 

Load eMIOS counter register B with a 24-bit value

#define eMIOS_SET_EDGE_POLARITY channel,
pol   )     (EMIOS.CH[channel].CCR.B.EDPOL = (uint8_t)(pol))
 

Set edge polarity accordingly

#define eMIOS_SET_GLOBAL_PRESCALER_VALUE value   )     (EMIOS.MCR.B.GPRE = (uint8_t)(value))
 

Set global prescaler value accordingly

#define eMIOS_SET_INTERNAL_TIME_BASE channel   )     (EMIOS.CH[channel].CCR.B.BSL = (uint8_t)(3))
 

Choose internal time base for channel

#define eMIOS_SET_PRESCALER channel,
value   )     (EMIOS.CH[channel].CCR.B.UCPRE = (uint8_t)(value))
 

Set local prescaler value

#define eMIOS_STATUS_FLAG channel   )     EMIOS.CH[channel].CSR.B.FLAG
 

Definition of eMIOS status flag

#define eMIOS_TIMER_COUNT channel   )     EMIOS.CH[channel].CCNTR.R
 

Define timer count register

#define eMIOS_TM_LOCAL_PRESCALER   ((uint8_t)4)
 

Task Manager channel eMIOS prescaler

#define INTERRUPT_EMIOS_0   ((uint8_t)58)
 

Define interrupt assigned to Timer channel

#define SCHEDULER_EMIOS_CHANNEL   ((uint8_t)0)
 

emios channel assigned to generate Scheduler Timebase


Function Documentation

void Emios_Scheduler_Isr void   ) 
 

Emios Channel 0 Interrupt Handler.

Author:
R01160
Parameters:
none 
Returns:
none

void vfnEmios_Set_Callback_Fnc Emios_CallbackType  Callback_Fnc  ) 
 

Sets the function to which the emios interrupt shall
jump once interrupt occurs.

Author:
R01160
Parameters:
Emios_CallbackType - Callback type definition
Returns:
none
Warning:
this function will skip any null pointer parameter passed
as a input parameter.