-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
59 changed files
with
14,622 additions
and
2,461 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
-O | ||
-Wall | ||
-std=c++14 | ||
-I.. | ||
-I../.pio/libdeps/teensy41/libcli/src | ||
-I../.pio/libdeps/teensy41/libasm/src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#include "devs_i8048.h" | ||
#include <string.h> | ||
#include "debugger.h" | ||
#include "i8251.h" | ||
|
||
namespace debugger { | ||
namespace i8048 { | ||
|
||
DevsI8048 Devs; | ||
|
||
void DevsI8048::reset() { | ||
USART.reset(); | ||
USART.setBaseAddr(USART_BASE); | ||
} | ||
|
||
void DevsI8048::begin() { | ||
enableDevice(USART); | ||
} | ||
|
||
void DevsI8048::loop() { | ||
USART.loop(); | ||
} | ||
|
||
bool DevsI8048::isSelected(uint32_t addr) const { | ||
return USART.isSelected(addr); | ||
} | ||
|
||
uint16_t DevsI8048::read(uint32_t addr) const { | ||
return USART.read(addr); | ||
} | ||
|
||
void DevsI8048::write(uint32_t addr, uint16_t data) const { | ||
USART.write(addr, data); | ||
} | ||
|
||
Device &DevsI8048::parseDevice(const char *name) const { | ||
if (strcasecmp(name, USART.name()) == 0) | ||
return USART; | ||
return Devs::nullDevice(); | ||
} | ||
|
||
void DevsI8048::enableDevice(Device &dev) { | ||
USART.enable(&dev == &USART); | ||
} | ||
|
||
void DevsI8048::printDevices() const { | ||
printDevice(USART); | ||
} | ||
|
||
} // namespace i8048 | ||
} // namespace debugger | ||
|
||
// Local Variables: | ||
// mode: c++ | ||
// c-basic-offset: 4 | ||
// tab-width: 4 | ||
// End: | ||
// vim: set ft=cpp et ts=4 sw=4: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#ifndef __DEVS_I8048_H__ | ||
#define __DEVS_I8048_H__ | ||
|
||
#include "devs.h" | ||
|
||
#define USART_BASE 0xFC | ||
|
||
namespace debugger { | ||
namespace i8048 { | ||
|
||
struct DevsI8048 final : Devs { | ||
void begin() override; | ||
void reset() override; | ||
void loop() override; | ||
bool isSelected(uint32_t addr) const override; | ||
uint16_t read(uint32_t addr) const override; | ||
void write(uint32_t addr, uint16_t data) const override; | ||
|
||
Device &parseDevice(const char *name) const override; | ||
void enableDevice(Device &dev) override; | ||
void printDevices() const override; | ||
}; | ||
|
||
extern struct DevsI8048 Devs; | ||
|
||
} // namespace i8048 | ||
} // namespace debugger | ||
#endif /* __DEVS_I8048H__ */ | ||
|
||
// Local Variables: | ||
// mode: c++ | ||
// c-basic-offset: 4 | ||
// tab-width: 4 | ||
// End: | ||
// vim: set ft=cpp et ts=4 sw=4: |
Oops, something went wrong.