update docs to indicate that SIPO works also for 595
This commit is contained in:
+8
-1
@@ -1,10 +1,17 @@
|
|||||||
/* Config for SIPO PWM */
|
/* Config for SIPO PWM */
|
||||||
|
|
||||||
// PWM pin aliases
|
// --- PWM pin aliases ---
|
||||||
|
|
||||||
|
// Store signal
|
||||||
#define SPWM_STR D2
|
#define SPWM_STR D2
|
||||||
|
// Shift/clock signal
|
||||||
#define SPWM_CLK D3
|
#define SPWM_CLK D3
|
||||||
|
// Data signal
|
||||||
#define SPWM_DATA D4
|
#define SPWM_DATA D4
|
||||||
|
|
||||||
|
|
||||||
|
// --- Other settings ---
|
||||||
|
|
||||||
// Number of PWM levels (color depth)
|
// Number of PWM levels (color depth)
|
||||||
#define SPWM_COLOR_DEPTH 256
|
#define SPWM_COLOR_DEPTH 256
|
||||||
|
|
||||||
+11
-6
@@ -2,23 +2,28 @@
|
|||||||
|
|
||||||
// --- SIPO PWM Module ---
|
// --- 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".
|
// This module lets you use SIPO outputs as a "software PWM".
|
||||||
//
|
//
|
||||||
// Tested on 74HC4094,
|
// Tested to work on 74hc4094 and 74hc595
|
||||||
// should also work on 74HC595 (may need some small changes)
|
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
// Your file with configs
|
// Your file with configs
|
||||||
#include "sipo_pwm_config.h"
|
#include "sipo_pwm_config.h"
|
||||||
/*
|
/*
|
||||||
// PWM pin aliases
|
// --- PWM pin aliases ---
|
||||||
|
|
||||||
|
// Store signal
|
||||||
#define SPWM_STR D2
|
#define SPWM_STR D2
|
||||||
|
// Shift/clock signal
|
||||||
#define SPWM_CLK D3
|
#define SPWM_CLK D3
|
||||||
|
// Data signal
|
||||||
#define SPWM_DATA D4
|
#define SPWM_DATA D4
|
||||||
|
|
||||||
|
// --- Other settings ---
|
||||||
|
|
||||||
// Number of PWM levels (color depth)
|
// Number of PWM levels (color depth)
|
||||||
#define SPWM_COLOR_DEPTH 256
|
#define SPWM_COLOR_DEPTH 256
|
||||||
|
|
||||||
@@ -38,7 +43,7 @@ extern uint8_t spwm_levels[SPWM_CHANNELS];
|
|||||||
void spwm_init();
|
void spwm_init();
|
||||||
|
|
||||||
|
|
||||||
/** Display PWM channels.
|
/** Perform one PWM cycle.
|
||||||
* This could be called in a Timer ISR.
|
* This should be called in a Timer ISR or a loop.
|
||||||
*/
|
*/
|
||||||
void spwm_send();
|
void spwm_send();
|
||||||
|
|||||||
Reference in New Issue
Block a user