sm1.h
来自「用freescale 8bitMCU做的触摸屏软件」· C头文件 代码 · 共 177 行
H
177 行
/** ###################################################################
** THIS BEAN MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
** Filename : SM1.H
** Project : touchpanal
** Processor : MC9S08QG8CDT
** Beantype : SynchroMaster
** Version : Bean 02.264, Driver 01.17, CPU db: 2.87.115
** Compiler : CodeWarrior HCS08 C Compiler
** Date/Time : 2007-10-10, 13:20
** Abstract :
** This bean "SynchroMaster" implements MASTER part of synchronous
** serial master-slave communication.
** Settings :
** Synchro type : MASTER
**
** Serial channel : SPI
**
** Protocol
** Init baud rate : 22_936us
** Clock edge : falling
** Width : 8 bits (always)
** Empty character : 0
** Empty char. on input : RECEIVED
**
** Registers
** Input buffer : SPID [$002D]
** Output buffer : SPID [$002D]
** Control register : SPIC1 [$0028]
** Mode register : SPIC2 [$0029]
** Baud setting reg. : SPIBR [$002A]
**
** Priority : undef
**
** Priority : undef
**
** Used pins :
** ----------------------------------------------------------
** Function | On package | Name
** ----------------------------------------------------------
** Input | 8 | PTB4_MISO
** Output | 9 | PTB3_KBIP7_MOSI_ADP7
** Clock | 10 | PTB2_KBIP6_SPSCK_ADP6
** ----------------------------------------------------------
**
** Contents :
** RecvChar - byte SM1_RecvChar(SM1_TComData *Chr);
** SendChar - byte SM1_SendChar(SM1_TComData Chr);
**
** (c) Copyright UNIS, spol. s r.o. 1997-2006
** UNIS, spol. s r.o.
** Jundrovska 33
** 624 00 Brno
** Czech Republic
** http : www.processorexpert.com
** mail : info@processorexpert.com
** ###################################################################*/
#ifndef __SM1
#define __SM1
/* MODULE SM1. */
#include "Cpu.h"
#define SM1_EOF 0 /* Empty character */
#ifndef __BWUserType_SM1_TComData
#define __BWUserType_SM1_TComData
typedef byte SM1_TComData; /* User type for communication. */
#endif
#ifndef __BWUserType_SM1_TError
#define __BWUserType_SM1_TError
typedef union {
byte err;
struct {
bool OverRun : 1; /* OverRun error flag - the data overflow on the input has been detected. Both hardware detection (if supported) and software detection (when the value of Input buffer size property is 0) is used. */
bool RxBufOvf : 1; /* Rx buffer full error flag - the input circular buffer defined by the Input buffer size property has overrun. */
bool FaultErr : 1; /* Fault mode error flag - only if supported by hardware */
}errName;
} SM1_TError; /* Error flags. For languages which don't support bit access is byte access only to error flags possible. */
#endif
byte SM1_RecvChar(SM1_TComData *Chr);
/*
** ===================================================================
** Method : SM1_RecvChar (bean SynchroMaster)
**
** Description :
** If any data is received, this method returns one
** character, otherwise it returns an error code (it does
** not wait for data).
** Parameters :
** NAME - DESCRIPTION
** * Chr - A pointer to the 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 was detected
** from the last char or block received. In
** polling mode, this error code is
** returned only when the hardware supports
** detection of the overrun error.
** ERR_FAULT - Fault error was detected
** from the last char or block received.
** This error may not be supported on some
** CPUs (see generated code).
** ===================================================================
*/
byte SM1_SendChar(SM1_TComData Chr);
/*
** ===================================================================
** Method : SM1_SendChar (bean SynchroMaster)
**
** Description :
** Sends one character to the channel.
** 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_DISABLED - Device is disabled (only
** if output DMA is supported and enabled)
** ERR_TXFULL - Transmitter is full
** ===================================================================
*/
__interrupt void SM1_Interrupt(void);
/*
** ===================================================================
** Method : SM1_Interrupt (bean SynchroMaster)
**
** Description :
** The method services the error interrupt of the selected
** peripheral(s) and eventually invokes the bean's event(s).
** This method is internal. It is used by Processor Expert only.
** ===================================================================
*/
void SM1_Init(void);
/*
** ===================================================================
** Method : SM1_Init (bean SynchroMaster)
**
** Description :
** Initializes the associated peripheral(s) and the bean 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 SM1. */
#endif /* ifndef __SM1 */
/*
** ###################################################################
**
** This file was created by UNIS Processor Expert 3.00 [03.89]
** for the Freescale HCS08 series of microcontrollers.
**
** ###################################################################
*/
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?