Update to v086r04 release.
byuu says:
There will probably be a series of small WIPs as I experiment here.
snes/controller/serial is now snes/controller/uart. Asynchronous serial
communications, typically capped at 57,600 baud.
snes/controller/usart is new. It aims to emulate the SNES connected to
a Teensy++ board, and can easily handle 524,288 baud.
And much more importantly, it's synchronous, so there are no timing
issues anymore. Just bit-bang as fast as you can.
Right now, the USART code is just enough for SNES->PC to transfer data
to ... well, nothing yet.
Unless anyone is actually using the UART stuff, I'll be removing it once
the USART is totally up and running.
No sense maintaining code that is 10x slower, more error prone, and used
by nobody.
Note: this is all thanks to blargg being absolutely amazing.
2012-02-25 08:49:27 +00:00
|
|
|
struct USART : Controller, public library {
|
2012-02-25 08:52:42 +00:00
|
|
|
void enter();
|
2012-03-10 12:47:19 +00:00
|
|
|
|
|
|
|
bool quit();
|
2012-02-25 08:52:42 +00:00
|
|
|
void usleep(unsigned milliseconds);
|
2012-03-10 12:47:19 +00:00
|
|
|
bool readable();
|
2012-02-25 08:52:42 +00:00
|
|
|
uint8 read();
|
2012-03-10 12:47:19 +00:00
|
|
|
bool writable();
|
2012-02-25 08:52:42 +00:00
|
|
|
void write(uint8 data);
|
|
|
|
|
Update to v086r04 release.
byuu says:
There will probably be a series of small WIPs as I experiment here.
snes/controller/serial is now snes/controller/uart. Asynchronous serial
communications, typically capped at 57,600 baud.
snes/controller/usart is new. It aims to emulate the SNES connected to
a Teensy++ board, and can easily handle 524,288 baud.
And much more importantly, it's synchronous, so there are no timing
issues anymore. Just bit-bang as fast as you can.
Right now, the USART code is just enough for SNES->PC to transfer data
to ... well, nothing yet.
Unless anyone is actually using the UART stuff, I'll be removing it once
the USART is totally up and running.
No sense maintaining code that is 10x slower, more error prone, and used
by nobody.
Note: this is all thanks to blargg being absolutely amazing.
2012-02-25 08:49:27 +00:00
|
|
|
uint2 data();
|
|
|
|
void latch(bool data);
|
2012-02-25 08:52:42 +00:00
|
|
|
|
Update to v086r04 release.
byuu says:
There will probably be a series of small WIPs as I experiment here.
snes/controller/serial is now snes/controller/uart. Asynchronous serial
communications, typically capped at 57,600 baud.
snes/controller/usart is new. It aims to emulate the SNES connected to
a Teensy++ board, and can easily handle 524,288 baud.
And much more importantly, it's synchronous, so there are no timing
issues anymore. Just bit-bang as fast as you can.
Right now, the USART code is just enough for SNES->PC to transfer data
to ... well, nothing yet.
Unless anyone is actually using the UART stuff, I'll be removing it once
the USART is totally up and running.
No sense maintaining code that is 10x slower, more error prone, and used
by nobody.
Note: this is all thanks to blargg being absolutely amazing.
2012-02-25 08:49:27 +00:00
|
|
|
USART(bool port);
|
|
|
|
~USART();
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool latched;
|
|
|
|
bool data1;
|
|
|
|
bool data2;
|
2012-03-10 12:37:36 +00:00
|
|
|
unsigned counter;
|
Update to v086r04 release.
byuu says:
There will probably be a series of small WIPs as I experiment here.
snes/controller/serial is now snes/controller/uart. Asynchronous serial
communications, typically capped at 57,600 baud.
snes/controller/usart is new. It aims to emulate the SNES connected to
a Teensy++ board, and can easily handle 524,288 baud.
And much more importantly, it's synchronous, so there are no timing
issues anymore. Just bit-bang as fast as you can.
Right now, the USART code is just enough for SNES->PC to transfer data
to ... well, nothing yet.
Unless anyone is actually using the UART stuff, I'll be removing it once
the USART is totally up and running.
No sense maintaining code that is 10x slower, more error prone, and used
by nobody.
Note: this is all thanks to blargg being absolutely amazing.
2012-02-25 08:49:27 +00:00
|
|
|
|
|
|
|
uint8 rxlength;
|
|
|
|
uint8 rxdata;
|
2012-02-25 08:52:42 +00:00
|
|
|
vector<uint8> rxbuffer;
|
Update to v086r04 release.
byuu says:
There will probably be a series of small WIPs as I experiment here.
snes/controller/serial is now snes/controller/uart. Asynchronous serial
communications, typically capped at 57,600 baud.
snes/controller/usart is new. It aims to emulate the SNES connected to
a Teensy++ board, and can easily handle 524,288 baud.
And much more importantly, it's synchronous, so there are no timing
issues anymore. Just bit-bang as fast as you can.
Right now, the USART code is just enough for SNES->PC to transfer data
to ... well, nothing yet.
Unless anyone is actually using the UART stuff, I'll be removing it once
the USART is totally up and running.
No sense maintaining code that is 10x slower, more error prone, and used
by nobody.
Note: this is all thanks to blargg being absolutely amazing.
2012-02-25 08:49:27 +00:00
|
|
|
|
|
|
|
uint8 txlength;
|
|
|
|
uint8 txdata;
|
2012-02-25 08:52:42 +00:00
|
|
|
vector<uint8> txbuffer;
|
|
|
|
|
2012-03-10 12:47:19 +00:00
|
|
|
function<void (
|
|
|
|
function<bool ()>, //quit
|
|
|
|
function<void (unsigned)>, //usleep
|
|
|
|
function<bool ()>, //readable
|
|
|
|
function<uint8 ()>, //read
|
|
|
|
function<bool ()>, //writable
|
|
|
|
function<void (uint8)> //write
|
|
|
|
)> init;
|
2012-02-25 09:12:08 +00:00
|
|
|
function<void ()> main;
|
Update to v086r04 release.
byuu says:
There will probably be a series of small WIPs as I experiment here.
snes/controller/serial is now snes/controller/uart. Asynchronous serial
communications, typically capped at 57,600 baud.
snes/controller/usart is new. It aims to emulate the SNES connected to
a Teensy++ board, and can easily handle 524,288 baud.
And much more importantly, it's synchronous, so there are no timing
issues anymore. Just bit-bang as fast as you can.
Right now, the USART code is just enough for SNES->PC to transfer data
to ... well, nothing yet.
Unless anyone is actually using the UART stuff, I'll be removing it once
the USART is totally up and running.
No sense maintaining code that is 10x slower, more error prone, and used
by nobody.
Note: this is all thanks to blargg being absolutely amazing.
2012-02-25 08:49:27 +00:00
|
|
|
};
|