Skip to content

Commit b575efa

Browse files
committed
Add MuxTo sources and binaries
1 parent e8a2736 commit b575efa

19 files changed

+2446
-0
lines changed

firmwares/MuxTO/JICE_io.cpp

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
stk_io.cpp
3+
4+
Created: 18-11-2017 15:20:29
5+
Author: JMR_2
6+
*/
7+
8+
// Includes
9+
#include <Arduino.h>
10+
#include "JICE_io.h"
11+
#include "sys.h"
12+
13+
namespace {
14+
// *** Baud rate lookup table for UBRR0 register ***
15+
// Indexed by valid values for PARAM_BAUD_RATE_VAL (defined in JTAG2.h)
16+
uint16_t baud_tbl[8] = {baud(2400), baud(4800), baud(9600), baud(19200), baud(38400), baud(57600), baud(115200), baud(14400)};
17+
}
18+
19+
// Functions
20+
uint8_t JICE_io::put(char c) {
21+
SERIALCOM.write(c);
22+
return c;
23+
}
24+
25+
uint8_t JICE_io::get(void) {
26+
//while (!SERIALCOM.available());
27+
uint8_t c = SERIALCOM.read();
28+
return c;
29+
}
30+
31+
void JICE_io::init(void) {
32+
SERIALCOM.begin(115200);
33+
}
34+
35+
void JICE_io::flush(void) {
36+
SERIALCOM.flush();
37+
}
38+
39+
void JICE_io::set_baud(JTAG2::baud_rate rate) {
40+
41+
}

firmwares/MuxTO/JICE_io.h

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
stk_io.h
3+
4+
Created: 18-11-2017 14:55:53
5+
Author: JMR_2
6+
*/
7+
8+
9+
#ifndef JICE_IO_H_
10+
#define JICE_IO_H_
11+
12+
#include <stdint.h>
13+
#include "JTAG2.h"
14+
15+
#warning "modify this to match your USB serial port name"
16+
#define SERIALCOM SerialUSB
17+
18+
namespace JICE_io {
19+
// Function prototypes
20+
uint8_t put(char c);
21+
uint8_t get(void);
22+
void init(void);
23+
void flush(void);
24+
void set_baud(JTAG2::baud_rate rate);
25+
}
26+
27+
#endif /* JICE_IO_H_ */

0 commit comments

Comments
 (0)