📄 libr.h
字号:
/***************************************************************************
Project : TDA7540 Jig board
Compiler : ST7 HiCross C (HiWARE)
Module : Libr.h
Version : V 1.0
Created :
Author : Jerry HE / ST-ShenZhen
Description
- common routine
Modified
- Jan.24th,2005
***************************************************************************/
/**************************************************************************
Constants/Macro Definitions for Common Use
***************************************************************************/
#include "lib_wait.h"
#define SetBit(VAR,Place) ( VAR |= (1<<Place) )
#define ClrBit(VAR,Place) ( VAR &= ((1<<Place)^255) )
#define ChgBit(VAR,Place) ( VAR ^= (1<<Place) )
#define AffBit(VAR,Place,Value) (( Value) ? ( VAR |= (1<<Place) ) : \
( VAR &= ( (1<<Place)^255) ) )
#define MskBit(Dest,Msk,Src) ( Dest = (Msk & Src) | ((~Msk) & Dest) )
#define ValBit(VAR,Place) ( VAR & (1<<Place) )
#define AREA 0x00
#define BitClr(BIT) ( *((volatile char *) (AREA+BIT/8)) &= (~(1<<(7-BIT%8))) )
#define BitSet(BIT) ( *((volatile char *) (AREA+BIT/8)) |= (1<<(7-BIT%8)) )
#define BitVal(BIT) ( *((volatile char *) (AREA+BIT/8)) & (1<<(7-BIT%8)) )
#define EnaCdcInt() (PB_OR |= 0x80) /* enable Cdc Interrupt */
#define DisCdcInt() (PB_OR &= 0x7F) /* disable Cdc Interrupt */
#define EnaCdpInt() (PB_OR |= 0x08) /* enable Cdp Interrupt */
#define DisCdpInt() (PB_OR &= 0xF7) /* disable Cdp Interrupt */
#define PIN_Beep05K() (MCCBCR |= 0x03) /* Start 2KHz beep on pin PB7.*/
#define PIN_Beep1K() (MCCBCR |= 0x02) /* Start 2KHz beep on pin PB7.*/
#define PIN_Beep2K() (MCCBCR |= 0x01) /* Start 2KHz beep on pin PB7.*/
#define PIN_BeepOff() (MCCBCR = 0x00) /* Stop beep on pin PB7.*/
#define lcd_do 4 /* [PC4] */
#define lcd_ce 3 /* [PC3] */
#define lcd_cl 6 /* [PC6] */
#define lcd_di 5 /* [PC5] */
/**************************************************************************
Declaration of Public Variables/Functions
***************************************************************************/
/**************************************************************************
Declaration of Public Variables/Functions
***************************************************************************/
extern void WAIT_m10ms (char contatore);
extern void WAIT_Delay (unsigned char, unsigned char);
extern void FCT_Call (unsigned char, unsigned char);
extern void PIN_CdcOut (void);
extern void PIN_CdcIn (void);
extern void PIN_CdpOut (void);
extern void PIN_CdpIn (void);
/*** (c) 2005 STMicroelectronics ****************** END OF FILE ***/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -