26 lines
538 B
C
26 lines
538 B
C
#ifndef __HC595_H__
|
|
#define __HC595_H__
|
|
|
|
#include "main.h"
|
|
|
|
|
|
typedef struct
|
|
{
|
|
GPIO_TypeDef* sck_port;
|
|
uint16_t sck_pin;
|
|
GPIO_TypeDef* data_port;
|
|
uint16_t data_pin;
|
|
GPIO_TypeDef* rck_port;
|
|
uint16_t rck_pin;
|
|
GPIO_TypeDef* en_port;
|
|
uint16_t en_pin;
|
|
} T_HC595_PIN;
|
|
|
|
extern const T_HC595_PIN hc595;
|
|
|
|
void hc595_init(const T_HC595_PIN *pin);
|
|
void hc595_deInit(const T_HC595_PIN *pin);
|
|
void hc595_writeStr(const T_HC595_PIN *pin, uint8_t *data, uint16_t length);
|
|
void io_output(void);
|
|
#endif
|