Compare commits

..

No commits in common. 'master' and 'dev' have entirely different histories.
master ... dev

  1. 10
      README.md
  2. 0
      examples/sipo_pwm_74HC4094/Makefile
  3. 0
      examples/sipo_pwm_74HC4094/lib
  4. 0
      examples/sipo_pwm_74HC4094/main.c
  5. 9
      examples/sipo_pwm_74HC4094/sipo_pwm_config.h
  6. 23
      lib/sipo_pwm.h

@ -1,9 +1,3 @@
**This library is very old and unmaintained.**
There may be some good bits worth salvaging, but for new projects I recommend the [avr-c-boilerplate](https://github.com/MightyPork/avr-c-boilerplate) as a base instead. Copy and port good modules from this library if you like.
---
# "porklib", MightyPork's Arduino Library # "porklib", MightyPork's Arduino Library
This library aims to make development for AVR in C easy and fun. This library aims to make development for AVR in C easy and fun.
@ -18,12 +12,12 @@ Pull requests to add new modules are welcome, please go ahead!
## Makefile ## Makefile
You can use the provided Makefile to build your project with this library. You can use the provided Makefile to boild your project with this library.
A project typically consists of one `main.c` file, and some `*_config.c` files where the A project typically consists of one `main.c` file, and some `*_config.c` files where the
library headers request it (those define eg. IO pin mapping). library headers request it (those define eg. IO pin mapping).
Adjust the Makefile to your needs! Adjust the Makefile to yoru needs!
## License ## License

@ -1,17 +1,10 @@
/* 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

@ -2,34 +2,29 @@
// --- SIPO PWM Module --- // --- SIPO PWM Module ---
// //
// SIPO = shift register with paralel output. // SIPO = Serial IN, Parallel OUT
// //
// This module lets you use SIPO outputs as a "software PWM". // This module lets you use SIPO outputs as a "software PWM".
// //
// Tested to work on 74hc4094 and 74hc595 // Tested on 74HC4094,
// 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
// Number of SIPO channels // Number of SIPO channels
#define SPWM_CHANNELS 24 #define SPWM_CHANNELS 24
// Invert outputs (for Common Anode LEDs) // Invert outputs (for Common Anode LEDs)
#define SPWM_INVERT 1 #define SPWM_INVERT 1
*/ */
@ -43,7 +38,7 @@ extern uint8_t spwm_levels[SPWM_CHANNELS];
void spwm_init(); void spwm_init();
/** Perform one PWM cycle. /** Display PWM channels.
* This should be called in a Timer ISR or a loop. * This could be called in a Timer ISR.
*/ */
void spwm_send(); void spwm_send();

Loading…
Cancel
Save