commit
71cb34b181
@ -0,0 +1,16 @@
|
||||
#include "muxer.h"
|
||||
#include <avr/io.h>
|
||||
|
||||
void muxer_init(){
|
||||
DDRC |= (_BV(0)|_BV(1)|_BV(2)|_BV(3)); // conf as outputs
|
||||
PORTC |= _BV(3); // inhibit
|
||||
}
|
||||
|
||||
void muxer_set(uint8_t channel){
|
||||
PORTC |= _BV(3); // engage inhibit
|
||||
PORTC &= ~(0x07); //mask
|
||||
PORTC |= channel & 0x07; //set
|
||||
PORTC &= ~(_BV(3)); // disengage inhibit
|
||||
//TODO: delays, check everything, mask in register
|
||||
}
|
||||
|
||||
@ -0,0 +1,6 @@
|
||||
//TODO:guards
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
void muxer_init();
|
||||
void muxer_set(uint8_t channel);
|
||||
Loading…
Reference in new issue