HC164的C程序,希望对有兴趣的朋友有用
时间:10-02
整理:3721RD
点击:
#ifdef _HC164_C_
#include "C8051F330.h"
#define HC164_CLR_H( ) { P1 |= ( 1<<6 ); P1MDOUT |= ( 1<<6 ); }
#define HC164_CLR_L( ) { P1 &= ~( 1<<6 ); P1MDOUT |= ( 1<<6 ); }
#define HC164_A_H( ) ;
#define HC164_A_L( ) ;
#define HC164_B_H( ) { P1 |= ( 1<<5 ); P1MDOUT |= ( 1<<5 ); }
#define HC164_B_L( ) { P1 &= ~( 1<<5 ); P1MDOUT |= ( 1<<5 ); }
#define HC164_CLK_H( ) { P1 |= ( 1<<7 ); P1MDOUT |= ( 1<<7 ); }
#define HC164_CLK_L( ) { P1 &= ~( 1<<7 ); P1MDOUT |= ( 1<<7 ); }
#endif //_HC164_C_
/*
================================================================================
-----------------------------------Functions------------------------------------
================================================================================
*/
/*Output a data to HC164*/
void HC164_Output( char value );
/*Output 0x00 to HC164*/
void HC164_Clear( void );
/*
================================================================================
-----------------------------------End of file----------------------------------
================================================================================
*/
#include "C8051F330.h"
#define HC164_CLR_H( ) { P1 |= ( 1<<6 ); P1MDOUT |= ( 1<<6 ); }
#define HC164_CLR_L( ) { P1 &= ~( 1<<6 ); P1MDOUT |= ( 1<<6 ); }
#define HC164_A_H( ) ;
#define HC164_A_L( ) ;
#define HC164_B_H( ) { P1 |= ( 1<<5 ); P1MDOUT |= ( 1<<5 ); }
#define HC164_B_L( ) { P1 &= ~( 1<<5 ); P1MDOUT |= ( 1<<5 ); }
#define HC164_CLK_H( ) { P1 |= ( 1<<7 ); P1MDOUT |= ( 1<<7 ); }
#define HC164_CLK_L( ) { P1 &= ~( 1<<7 ); P1MDOUT |= ( 1<<7 ); }
#endif //_HC164_C_
/*
================================================================================
-----------------------------------Functions------------------------------------
================================================================================
*/
/*Output a data to HC164*/
void HC164_Output( char value );
/*Output 0x00 to HC164*/
void HC164_Clear( void );
/*
================================================================================
-----------------------------------End of file----------------------------------
================================================================================
*/