📄 as1.h
字号:
/** ###################################################################
** THIS BEAN MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
** Filename : AS1.H
** Project : text
** Processor : 56F8346
** Beantype : AsynchroSerial
** Version : Bean 02.333, Driver 01.21, CPU db: 2.87.097
** Compiler : Metrowerks DSP C Compiler
** Date/Time : 2009-1-10, 11:18
** 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 : SCI0
**
** Protocol
** Init baud rate : 9600baud
** Width : 8 bits
** Stop bits : 1
** Parity : none
** Breaks : Disabled
**
** Registers
** Input buffer : SCI0_SCIDR [62084]
** Output buffer : SCI0_SCIDR [62084]
** Control register : SCI0_SCICR [62081]
** Mode register : SCI0_SCICR [62081]
** Baud setting reg. : SCI0_SCIBR [62080]
**
**
**
** Used pins:
** ----------------------------------------------------------
** Function | On package | Name
** ----------------------------------------------------------
** Input | 5 | GPIOE1_RxD0
** Output | 4 | GPIOE0_TxD0
** ----------------------------------------------------------
**
**
**
** Contents :
** RecvChar - byte AS1_RecvChar(AS1_TComData *Chr);
** SendChar - byte AS1_SendChar(AS1_TComData Chr);
** GetCharsInRxBuf - word AS1_GetCharsInRxBuf(void);
** GetCharsInTxBuf - word AS1_GetCharsInTxBuf(void);
**
** (c) Copyright UNIS, spol. s r.o. 1997-2005
** 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"
#ifndef __BWUserType_tItem
#define __BWUserType_tItem
typedef struct { /* Item of the index table for possible baudrates */
word div; /* divisior */
byte val; /* values of the prescalers */
} tItem;
#endif
#ifndef __BWUserType_AS1_TError
#define __BWUserType_AS1_TError
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 flag */
bool Break : 1; /* Break detect */
bool LINSync : 1; /* LIN synchronization error */
} errName;
} AS1_TError; /* Error flags. For languages which don't support bit access is byte access only to error flags possible. */
#endif
#ifndef __BWUserType_AS1_TComData
#define __BWUserType_AS1_TComData
typedef byte AS1_TComData; /* User type for communication. Size of this type depends on the communication data witdh */
#endif
byte AS1_RecvChar(AS1_TComData *Chr);
/*
** ===================================================================
** Method : AS1_RecvChar (bean AsynchroSerial)
**
** Description :
** If any data is received, this method returns one
** character, otherwise it returns an error code (it does
** not wait for data). This method is enabled only if the
** receiver property is enabled.
** DMA mode:
** If DMA controller is available on the selected CPU and
** the receiver is configured to use DMA controller then
** this method only sets the selected DMA channel. Then the
** status of the DMA transfer can be checked using
** GetCharsInRxBuf method. See an example of a typical usage
** for details about the communication using DMA.
** Parameters :
** NAME - DESCRIPTION
** * Chr - Pointer to a 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_BREAK - Break character is detected(only when <Interrupt service> property
** is disabled)
** ERR_COMMON - common error occurred (the
** GetError method can be used for error
** specification)
** DMA mode:
** If DMA controller is available on the
** selected CPU and the receiver is
** configured to use DMA controller then
** only ERR_OK, ERR_RXEMPTY, and ERR_SPEED
** error code can be returned from this
** method.
** ===================================================================
*/
byte AS1_SendChar(AS1_TComData Chr);
/*
** ===================================================================
** Method : AS1_SendChar (bean AsynchroSerial)
**
** Description :
** Sends one character to the channel. If the bean is
** temporarily disabled (Disable method) SendChar method
** only stores data into an output buffer. In case of a zero
** output buffer size, only one character can be stored.
** Enabling the bean (Enable method) starts the transmission
** of the stored data. This method is available only if the
** transmitter property is enabled.
** DMA mode:
** If DMA controller is available on the selected CPU and
** the transmitter is configured to use DMA controller then
** this method only sets selected DMA channel. Then the
** status of the DMA transfer can be checked using
** GetCharsInTxBuf method. See an example of a typical usage
** for details about communication using DMA.
** 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 :
** Returns the number of characters in the input buffer.
** This method is available only if the receiver property is
** enabled.
** DMA mode:
** If DMA controller is available on the selected CPU and
** the receiver is configured to use DMA controller then
** this method returns the number of characters in the
** receive buffer.
** Parameters : None
** Returns :
** --- - The number of characters in the input
** buffer.
** ===================================================================
*/
word AS1_GetCharsInTxBuf(void);
/*
** ===================================================================
** Method : AS1_GetCharsInTxBuf (bean AsynchroSerial)
**
** Description :
** Returns the number of characters in the output buffer.
** This method is available only if the transmitter property
** is enabled.
** DMA mode:
** If DMA controller is available on the selected CPU and
** the transmitter is configured to use DMA controller then
** this method returns the number of characters in the
** transmit buffer.
** Parameters : None
** Returns :
** --- - The number of characters in the output
** buffer.
** ===================================================================
*/
void AS1_Init(void);
/*
** ===================================================================
** Method : AS1_Init (bean AsynchroSerial)
**
** Description :
** Initializes the associated peripheral(s) and the beans
** internal variables. The method is called automatically as a
** part of the application initialization code.
** This method is internal. It is used by Processor Expert only.
** ===================================================================
*/
/* END AS1. */
/*
** ###################################################################
**
** This file was created by UNIS Processor Expert 2.97 [03.74]
** for the Freescale 56800 series of microcontrollers.
**
** ###################################################################
*/
#endif /* ifndef __AS1 */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -