| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- #include "includes.h"
- #ifndef __7HC595_H_
- #define __7HC595_H_
- #define HC595_SCLR_PIN GPIO_Pin_5
- #define HC595_SCLR_PORT GPIOA
- #define HC595_SCK_PIN GPIO_Pin_6
- #define HC595_SCK_PORT GPIOA
- #define HC595_RCK_PIN GPIO_Pin_4
- #define HC595_RCK_PORT GPIOA
- #define HC595_DATA_PIN GPIO_Pin_7
- #define HC595_DATA_PORT GPIOA
- #define HC165_READ_PIN GPIO_Pin_1 //9
- #define HC165_READ_PORT GPIOA
- #define HC165_CP_PIN GPIO_Pin_2 //10
- #define HC165_CP_PORT GPIOA
- #define HC165_PL_PIN GPIO_Pin_3 //13
- #define HC165_PL_PORT GPIOA
- #define HC165_DATA_READ GPIO_ReadInputDataBit(GPIOA,HC165_READ_PIN) //9
- #define HC165_CP_HIGH HC165_CP_PORT->BSRR = HC165_CP_PIN
- #define HC165_CP_LOW HC165_CP_PORT->BRR = HC165_CP_PIN
- #define HC165_PL_HIGH HC165_PL_PORT->BSRR= HC165_PL_PIN
- #define HC165_PL_LOW HC165_PL_PORT->BRR= HC165_PL_PIN
- #define HOLDINGREG 0x03 //读取寄存器
- #define WRITESINGLEREG 0x06 //写寄存器
- #define BROADCAST 0x09 //广播
- #define ERROR 0XEE
- extern unsigned char LastRxbuffer[13];
- void SetRecvProcess(unsigned char *rxbuffer);
- void QueryRecvProcess(unsigned char *rxbuffer);
- void Write_74HC595(unsigned char ChipNum,unsigned char *DataBuf);
- unsigned char Read_74HC165(void);
- #endif
|