//*****************************************************************************
//*****************************************************************************
//  FILENAME: PWM16_LOWBAT.h
//   Version: 2.4, Updated on 2004/10/27 at 18:26:14
//  Generated by PSoC Designer ver 4.2  b1013 : 02 September, 2004
//
//  DESCRIPTION: PWM16 User Module C Language interface file
//               for the 22/24/27/29xxx PSoC family of devices
//-----------------------------------------------------------------------------
//  Copyright (c) Cypress MicroSystems 2000-2004. All Rights Reserved.
//*****************************************************************************
//*****************************************************************************

#include <m8c.h>

#pragma fastcall16 PWM16_LOWBAT_EnableInt
#pragma fastcall16 PWM16_LOWBAT_DisableInt
#pragma fastcall16 PWM16_LOWBAT_Start
#pragma fastcall16 PWM16_LOWBAT_Stop
#pragma fastcall16 PWM16_LOWBAT_wReadCounter              // Read  DR0
#pragma fastcall16 PWM16_LOWBAT_WritePeriod               // Write DR1
#pragma fastcall16 PWM16_LOWBAT_wReadPulseWidth           // Read  DR2
#pragma fastcall16 PWM16_LOWBAT_WritePulseWidth           // Write DR2

// The following symbols are deprecated.
// They may be omitted in future releases
//
#pragma fastcall16 wPWM16_LOWBAT_ReadCounter              // Read  DR0 (Deprecated)
#pragma fastcall16 wPWM16_LOWBAT_ReadPulseWidth           // Read  DR2 (Deprecated)


//-------------------------------------------------
// Prototypes of the PWM16_LOWBAT API.
//-------------------------------------------------

extern void PWM16_LOWBAT_EnableInt(void);                  // Proxy Class 1
extern void PWM16_LOWBAT_DisableInt(void);                 // Proxy Class 1
extern void PWM16_LOWBAT_Start(void);                      // Proxy Class 1
extern void PWM16_LOWBAT_Stop(void);                       // Proxy Class 1
extern WORD PWM16_LOWBAT_wReadCounter(void);               // Proxy Class 2
extern void PWM16_LOWBAT_WritePeriod(WORD wPeriod);        // Proxy Class 1
extern WORD PWM16_LOWBAT_wReadPulseWidth(void);            // Proxy Class 1
extern void PWM16_LOWBAT_WritePulseWidth(WORD wPulseWidth);// Proxy Class 1

// The following functions are deprecated.
// They may be omitted in future releases
//
extern WORD wPWM16_LOWBAT_ReadCounter(void);            // Deprecated
extern WORD wPWM16_LOWBAT_ReadPulseWidth(void);         // Deprecated


//-------------------------------------------------
// Constants for PWM16_LOWBAT API's.
//-------------------------------------------------

#define PWM16_LOWBAT_CONTROL_REG_START_BIT     ( 0x01 )
#define PWM16_LOWBAT_INT_REG_ADDR              ( 0x0e1 )
#define PWM16_LOWBAT_INT_MASK                  ( 0x20 )


//--------------------------------------------------
// Constants for PWM16_LOWBAT user defined values
//--------------------------------------------------

#define PWM16_LOWBAT_PERIOD                    ( 0x8000 )
#define PWM16_LOWBAT_PULSE_WIDTH               ( 0x3e8 )


//-------------------------------------------------
// Register Addresses for PWM16_LOWBAT
//-------------------------------------------------

#pragma ioport  PWM16_LOWBAT_COUNTER_LSB_REG:   0x030      //DR0 Count register LSB
BYTE            PWM16_LOWBAT_COUNTER_LSB_REG;
#pragma ioport  PWM16_LOWBAT_COUNTER_MSB_REG:   0x034      //DR0 Count register MSB
BYTE            PWM16_LOWBAT_COUNTER_MSB_REG;
#pragma ioport  PWM16_LOWBAT_PERIOD_LSB_REG:    0x031      //DR1 Period register LSB
BYTE            PWM16_LOWBAT_PERIOD_LSB_REG;
#pragma ioport  PWM16_LOWBAT_PERIOD_MSB_REG:    0x035      //DR1 Period register MSB
BYTE            PWM16_LOWBAT_PERIOD_MSB_REG;
#pragma ioport  PWM16_LOWBAT_COMPARE_LSB_REG:   0x032      //DR2 Compare register LSB
BYTE            PWM16_LOWBAT_COMPARE_LSB_REG;
#pragma ioport  PWM16_LOWBAT_COMPARE_MSB_REG:   0x036      //DR2 Compare register MSB
BYTE            PWM16_LOWBAT_COMPARE_MSB_REG;
#pragma ioport  PWM16_LOWBAT_CONTROL_LSB_REG:   0x033      //Control register LSB
BYTE            PWM16_LOWBAT_CONTROL_LSB_REG;
#pragma ioport  PWM16_LOWBAT_CONTROL_MSB_REG:   0x037      //Control register MSB
BYTE            PWM16_LOWBAT_CONTROL_MSB_REG;
#pragma ioport  PWM16_LOWBAT_FUNC_LSB_REG:  0x130          //Function register LSB
BYTE            PWM16_LOWBAT_FUNC_LSB_REG;
#pragma ioport  PWM16_LOWBAT_FUNC_MSB_REG:  0x134          //Function register MSB
BYTE            PWM16_LOWBAT_FUNC_MSB_REG;
#pragma ioport  PWM16_LOWBAT_INPUT_LSB_REG: 0x131          //Input register LSB
BYTE            PWM16_LOWBAT_INPUT_LSB_REG;
#pragma ioport  PWM16_LOWBAT_INPUT_MSB_REG: 0x135          //Input register MSB
BYTE            PWM16_LOWBAT_INPUT_MSB_REG;
#pragma ioport  PWM16_LOWBAT_OUTPUT_LSB_REG:    0x132      //Output register LSB
BYTE            PWM16_LOWBAT_OUTPUT_LSB_REG;
#pragma ioport  PWM16_LOWBAT_OUTPUT_MSB_REG:    0x136      //Output register MSB
BYTE            PWM16_LOWBAT_OUTPUT_MSB_REG;
#pragma ioport  PWM16_LOWBAT_INT_REG:       0x0e1          //Interrupt Mask Register
BYTE            PWM16_LOWBAT_INT_REG;


//-------------------------------------------------
// PWM16_LOWBAT Macro 'Functions'
//-------------------------------------------------

#define PWM16_LOWBAT_Start_M \
   ( PWM16_LOWBAT_CONTROL_LSB_REG |=  PWM16_LOWBAT_CONTROL_REG_START_BIT )

#define PWM16_LOWBAT_Stop_M  \
   ( PWM16_LOWBAT_CONTROL_LSB_REG &= ~PWM16_LOWBAT_CONTROL_REG_START_BIT )

#define PWM16_LOWBAT_EnableInt_M   \
   M8C_EnableIntMask(  PWM16_LOWBAT_INT_REG, PWM16_LOWBAT_INT_MASK )

#define PWM16_LOWBAT_DisableInt_M  \
   M8C_DisableIntMask( PWM16_LOWBAT_INT_REG, PWM16_LOWBAT_INT_MASK )

// end of file PWM16_LOWBAT.h
