mirror of
https://github.com/DashyFox/StackSport.git
synced 2025-05-04 07:10:17 +00:00
30 lines
762 B
C
30 lines
762 B
C
/*
|
|
* ShiftReg.h
|
|
*
|
|
* Created on: Aug 25, 2024
|
|
* Author: DashyFox
|
|
*/
|
|
|
|
#ifndef SRC_SHIFTREG_H_
|
|
#define SRC_SHIFTREG_H_
|
|
|
|
#include "stm32f1xx_hal.h"
|
|
|
|
#define NUMLEDS 10
|
|
|
|
#define SHIFT_REG_DATA_PORT GPIOA
|
|
#define SHIFT_REG_DATA_PIN GPIO_PIN_4
|
|
|
|
#define SHIFT_REG_CLOCK_PORT GPIOA
|
|
#define SHIFT_REG_CLOCK_PIN GPIO_PIN_5
|
|
|
|
// Минимальные задержки для правильной работы
|
|
#define DATA_SETUP_TIME 20 // Время установки данных в нс
|
|
#define CLOCK_PULSE_WIDTH 20 // Длительность импульса тактирования в нс
|
|
|
|
void SetShiftReg_inline (unsigned char b1, unsigned char b2, unsigned char b3);
|
|
void SetShiftReg (unsigned char shiftreg[3]);
|
|
|
|
|
|
#endif /* SRC_SHIFTREG_H_ */
|