/*
** ###################################################################
**
**     THIS BEAN MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
**
**     Filename  : AS1.H
**
**     Project   : Full1
** 
**     Processor : MC68HC908AZ60MFU
**
**     Beantype  : AsynchroSerial
**
**     Version   : Bean 02.133, Driver 01.02, CPU db: 2.81.019
**
**     Compiler  : Metrowerks HC08 C Compiler V-5.0.13
**
**     Date/Time : 2.4.2002, 9:36
**
**     Abstract  :
**
**         This bean "AsynchroSerial" implements an asynchronous serial
**         communication. The bean supports different settings of 
**         parity, word width, stop-bit and communication speed,
**         user can select interrupt or polling handler.
**         Communication speed can be changed also in runtime.
**         The bean requires one on-chip asynchronous serial channel.
**
**     Settings  :
**
**         Serial channel              : SCI
**
**         Protocol
**             Init baud rate          : 2400baud
**             Width                   : 8 bits
**             Stop bits               : 1
**             Parity                  : none
**             Breaks                  : Disabled
**
**         Registers
**             Input buffer            : SCDR      [24]
**             Output buffer           : SCDR      [24]
**             Control register        : SCC1      [19]
**             Mode register           : SCC2      [20]
**             Baud setting reg.       : SCBR      [25]
**             Special register        : SCS1      [22]
**
**
**
**         Used pins                   : 
**             ----------------------------------------------------
**               Function | On package |    Name
**             ----------------------------------------------------
**                Input   |     14     |  PTE1_RxD
**                Output  |     13     |  PTE0_TxD
**             ----------------------------------------------------
**
**
**
**     Contents  :
**
**         RecvChar        - byte AS1_RecvChar(word *Chr);
**         SendChar        - byte AS1_SendChar(word Chr);
**         GetCharsInRxBuf - word AS1_GetCharsInRxBuf(void);
**         GetCharsInTxBuf - word AS1_GetCharsInTxBuf(void);
**         GetError        - byte AS1_GetError(byte *Err);
**
**
**     (c) Copyright UNIS, spol. s r.o. 1997-2002
**
**     UNIS, spol. s r.o.
**     Jundrovska 33
**     624 00 Brno
**     Czech Republic
**
**     http      : www.processorexpert.com
**     mail      : info@processorexpert.com
**
** ###################################################################
*/

#ifndef __AS1
#define __AS1

/* MODULE AS1. */

#include "Cpu.h"

typedef union {
  byte err;
  struct {
    bool OverRun  : 1;                 /* OverRun error flag */
    bool Framing  : 1;                 /* Framing error flag */
    bool Parity   : 1;                 /* Parity error flag */
    bool RxBufOvf : 1;                 /* Rx buffer full error flag */
    bool Noise    : 1;                 /* Noise error */
    bool Break    : 1;                 /* Break detect */
    bool Idle     : 1;                 /* Idle characted */
  }errName;
} AS1_TError;



byte AS1_RecvChar(byte *Chr);
/*
** ===================================================================
**     Method      :  AS1_RecvChar (bean AsynchroSerial)
**
**     Description :
**         If any data received, this method returns one character,
**         otherwise it returns error code (it does not wait for
**         data). This method is enabled only if the receiver
**         property is enabled.
**     Parameters  :
**         NAME            - DESCRIPTION
**       * Chr             - Pointer to received character
**     Returns     :
**         ---             - Error code, possible codes:
**                           ERR_OK - OK
**                           ERR_SPEED - This device does not work in
**                           the active speed mode
**                           ERR_RXEMPTY - No data in receiver
**                           ERR_OVERRUN - Overrun error is detected
**                           ERR_FRAMING - Framing error is detected
**                           ERR_PARITY - Parity error is detected
** ===================================================================
*/

byte AS1_SendChar(byte Chr);
/*
** ===================================================================
**     Method      :  AS1_SendChar (bean AsynchroSerial)
**
**     Description :
**         Send one character to the channel. This method is
**         available only if the transmitter property is enabled.
**     Parameters  :
**         NAME            - DESCRIPTION
**         Chr             - Character to send
**     Returns     :
**         ---             - Error code, possible codes:
**                           ERR_OK - OK
**                           ERR_SPEED - This device does not work in
**                           the active speed mode
**                           ERR_TXFULL - Transmitter is full
** ===================================================================
*/

word AS1_GetCharsInRxBuf(void);
/*
** ===================================================================
**     Method      :  AS1_GetCharsInRxBuf (bean AsynchroSerial)
**
**     Description :
**         Return number of characters in the input buffer. This
**         method is available only if the receiver property is
**         enabled.
**     Parameters  : None
**     Returns     :
**         ---             - Number of characters in the input
**                           buffer.
** ===================================================================
*/

word AS1_GetCharsInTxBuf(void);
/*
** ===================================================================
**     Method      :  AS1_GetCharsInTxBuf (bean AsynchroSerial)
**
**     Description :
**         Return number of characters in the output buffer. This
**         method is available only if the transmitter property is
**         enabled.
**     Parameters  : None
**     Returns     :
**         ---             - Number of characters in the output
**                           buffer.
** ===================================================================
*/

byte AS1_GetError(AS1_TError *Err);
/*
** ===================================================================
**     Method      :  AS1_GetError (bean AsynchroSerial)
**
**     Description :
**         Return a set of errors on the channel (errors that cannot
**         be returned in given methods). The errors accumulate in a
**         set; after calling GetError this set is returned and
**         cleared.
**     Parameters  :
**         NAME            - DESCRIPTION
**       * Err             - Pointer to returned set of errors
**     Returns     :
**         ---             - Error code (if GetError did not succeed),
**                           possible codes:
**                           ERR_OK - OK
**                           ERR_SPEED - This device does not work in
**                           the active speed mode
** ===================================================================
*/

void AS1_Init(void);
/*
** ===================================================================
**     Method      :  AS1_Init (bean AsynchroSerial)
**
**     Description :
**         This method is internal. It is used by Processor Expert
**         only.
** ===================================================================
*/


/* END AS1. */

/*
** ###################################################################
**
**     This file was created by UNIS Processor Expert 02.84 for 
**     the Motorola HC08 series of microcontrollers.
**
** ###################################################################
*/

#endif /* ifndef __AS1 */
