From 287fa598c581ba3e7746e3155bc34a076a328953 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Fri, 28 Aug 2015 16:23:17 +0200 Subject: [PATCH] update docs to indicate that SIPO works also for 595 --- .../Makefile | 0 .../lib | 0 .../main.c | 0 .../sipo_pwm_config.h | 9 +++++++- lib/sipo_pwm.h | 23 +++++++++++-------- 5 files changed, 22 insertions(+), 10 deletions(-) rename examples/{sipo_pwm_74HC4094 => sipo_pwm_74xx4094_595}/Makefile (100%) rename examples/{sipo_pwm_74HC4094 => sipo_pwm_74xx4094_595}/lib (100%) rename examples/{sipo_pwm_74HC4094 => sipo_pwm_74xx4094_595}/main.c (100%) rename examples/{sipo_pwm_74HC4094 => sipo_pwm_74xx4094_595}/sipo_pwm_config.h (71%) diff --git a/examples/sipo_pwm_74HC4094/Makefile b/examples/sipo_pwm_74xx4094_595/Makefile similarity index 100% rename from examples/sipo_pwm_74HC4094/Makefile rename to examples/sipo_pwm_74xx4094_595/Makefile diff --git a/examples/sipo_pwm_74HC4094/lib b/examples/sipo_pwm_74xx4094_595/lib similarity index 100% rename from examples/sipo_pwm_74HC4094/lib rename to examples/sipo_pwm_74xx4094_595/lib diff --git a/examples/sipo_pwm_74HC4094/main.c b/examples/sipo_pwm_74xx4094_595/main.c similarity index 100% rename from examples/sipo_pwm_74HC4094/main.c rename to examples/sipo_pwm_74xx4094_595/main.c diff --git a/examples/sipo_pwm_74HC4094/sipo_pwm_config.h b/examples/sipo_pwm_74xx4094_595/sipo_pwm_config.h similarity index 71% rename from examples/sipo_pwm_74HC4094/sipo_pwm_config.h rename to examples/sipo_pwm_74xx4094_595/sipo_pwm_config.h index d238917..4082de7 100644 --- a/examples/sipo_pwm_74HC4094/sipo_pwm_config.h +++ b/examples/sipo_pwm_74xx4094_595/sipo_pwm_config.h @@ -1,10 +1,17 @@ /* Config for SIPO PWM */ -// PWM pin aliases +// --- PWM pin aliases --- + +// Store signal #define SPWM_STR D2 +// Shift/clock signal #define SPWM_CLK D3 +// Data signal #define SPWM_DATA D4 + +// --- Other settings --- + // Number of PWM levels (color depth) #define SPWM_COLOR_DEPTH 256 diff --git a/lib/sipo_pwm.h b/lib/sipo_pwm.h index ed6a3df..f825f2f 100644 --- a/lib/sipo_pwm.h +++ b/lib/sipo_pwm.h @@ -2,29 +2,34 @@ // --- SIPO PWM Module --- // -// SIPO = Serial IN, Parallel OUT +// SIPO = shift register with paralel output. // // This module lets you use SIPO outputs as a "software PWM". // -// Tested on 74HC4094, -// should also work on 74HC595 (may need some small changes) +// Tested to work on 74hc4094 and 74hc595 #include // Your file with configs #include "sipo_pwm_config.h" /* - // PWM pin aliases + // --- PWM pin aliases --- + + // Store signal #define SPWM_STR D2 + // Shift/clock signal #define SPWM_CLK D3 + // Data signal #define SPWM_DATA D4 - + + // --- Other settings --- + // Number of PWM levels (color depth) #define SPWM_COLOR_DEPTH 256 - + // Number of SIPO channels #define SPWM_CHANNELS 24 - + // Invert outputs (for Common Anode LEDs) #define SPWM_INVERT 1 */ @@ -38,7 +43,7 @@ extern uint8_t spwm_levels[SPWM_CHANNELS]; void spwm_init(); -/** Display PWM channels. - * This could be called in a Timer ISR. +/** Perform one PWM cycle. + * This should be called in a Timer ISR or a loop. */ void spwm_send();