Added gitignore. First version of the tester script.
This commit is contained in:
parent
d5a27c630f
commit
59a9758a63
3 changed files with 196 additions and 7 deletions
165
.gitignore
vendored
Normal file
165
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,165 @@
|
||||||
|
# Created by https://www.toptal.com/developers/gitignore/api/vim,python
|
||||||
|
# Edit at https://www.toptal.com/developers/gitignore?templates=vim,python
|
||||||
|
|
||||||
|
### Python ###
|
||||||
|
# Byte-compiled / optimized / DLL files
|
||||||
|
__pycache__/
|
||||||
|
*.py[cod]
|
||||||
|
*$py.class
|
||||||
|
|
||||||
|
# C extensions
|
||||||
|
*.so
|
||||||
|
|
||||||
|
# Distribution / packaging
|
||||||
|
.Python
|
||||||
|
build/
|
||||||
|
develop-eggs/
|
||||||
|
dist/
|
||||||
|
downloads/
|
||||||
|
eggs/
|
||||||
|
.eggs/
|
||||||
|
lib/
|
||||||
|
lib64/
|
||||||
|
parts/
|
||||||
|
sdist/
|
||||||
|
var/
|
||||||
|
wheels/
|
||||||
|
pip-wheel-metadata/
|
||||||
|
share/python-wheels/
|
||||||
|
*.egg-info/
|
||||||
|
.installed.cfg
|
||||||
|
*.egg
|
||||||
|
MANIFEST
|
||||||
|
|
||||||
|
# PyInstaller
|
||||||
|
# Usually these files are written by a python script from a template
|
||||||
|
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
||||||
|
*.manifest
|
||||||
|
*.spec
|
||||||
|
|
||||||
|
# Installer logs
|
||||||
|
pip-log.txt
|
||||||
|
pip-delete-this-directory.txt
|
||||||
|
|
||||||
|
# Unit test / coverage reports
|
||||||
|
htmlcov/
|
||||||
|
.tox/
|
||||||
|
.nox/
|
||||||
|
.coverage
|
||||||
|
.coverage.*
|
||||||
|
.cache
|
||||||
|
nosetests.xml
|
||||||
|
coverage.xml
|
||||||
|
*.cover
|
||||||
|
*.py,cover
|
||||||
|
.hypothesis/
|
||||||
|
.pytest_cache/
|
||||||
|
pytestdebug.log
|
||||||
|
|
||||||
|
# Translations
|
||||||
|
*.mo
|
||||||
|
*.pot
|
||||||
|
|
||||||
|
# Django stuff:
|
||||||
|
*.log
|
||||||
|
local_settings.py
|
||||||
|
db.sqlite3
|
||||||
|
db.sqlite3-journal
|
||||||
|
|
||||||
|
# Flask stuff:
|
||||||
|
instance/
|
||||||
|
.webassets-cache
|
||||||
|
|
||||||
|
# Scrapy stuff:
|
||||||
|
.scrapy
|
||||||
|
|
||||||
|
# Sphinx documentation
|
||||||
|
docs/_build/
|
||||||
|
doc/_build/
|
||||||
|
|
||||||
|
# PyBuilder
|
||||||
|
target/
|
||||||
|
|
||||||
|
# Jupyter Notebook
|
||||||
|
.ipynb_checkpoints
|
||||||
|
|
||||||
|
# IPython
|
||||||
|
profile_default/
|
||||||
|
ipython_config.py
|
||||||
|
|
||||||
|
# pyenv
|
||||||
|
.python-version
|
||||||
|
|
||||||
|
# pipenv
|
||||||
|
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
||||||
|
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
||||||
|
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
||||||
|
# install all needed dependencies.
|
||||||
|
#Pipfile.lock
|
||||||
|
|
||||||
|
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
||||||
|
__pypackages__/
|
||||||
|
|
||||||
|
# Celery stuff
|
||||||
|
celerybeat-schedule
|
||||||
|
celerybeat.pid
|
||||||
|
|
||||||
|
# SageMath parsed files
|
||||||
|
*.sage.py
|
||||||
|
|
||||||
|
# Environments
|
||||||
|
.env
|
||||||
|
.venv
|
||||||
|
env/
|
||||||
|
venv/
|
||||||
|
ENV/
|
||||||
|
env.bak/
|
||||||
|
venv.bak/
|
||||||
|
pythonenv*
|
||||||
|
|
||||||
|
# Spyder project settings
|
||||||
|
.spyderproject
|
||||||
|
.spyproject
|
||||||
|
|
||||||
|
# Rope project settings
|
||||||
|
.ropeproject
|
||||||
|
|
||||||
|
# mkdocs documentation
|
||||||
|
/site
|
||||||
|
|
||||||
|
# mypy
|
||||||
|
.mypy_cache/
|
||||||
|
.dmypy.json
|
||||||
|
dmypy.json
|
||||||
|
|
||||||
|
# Pyre type checker
|
||||||
|
.pyre/
|
||||||
|
|
||||||
|
# pytype static type analyzer
|
||||||
|
.pytype/
|
||||||
|
|
||||||
|
# profiling data
|
||||||
|
.prof
|
||||||
|
|
||||||
|
### Vim ###
|
||||||
|
# Swap
|
||||||
|
[._]*.s[a-v][a-z]
|
||||||
|
!*.svg # comment out if you don't need vector files
|
||||||
|
[._]*.sw[a-p]
|
||||||
|
[._]s[a-rt-v][a-z]
|
||||||
|
[._]ss[a-gi-z]
|
||||||
|
[._]sw[a-p]
|
||||||
|
|
||||||
|
# Session
|
||||||
|
Session.vim
|
||||||
|
Sessionx.vim
|
||||||
|
|
||||||
|
# Temporary
|
||||||
|
.netrwhist
|
||||||
|
*~
|
||||||
|
# Auto-generated tag files
|
||||||
|
tags
|
||||||
|
# Persistent undo
|
||||||
|
[._]*.un~
|
||||||
|
|
||||||
|
# End of https://www.toptal.com/developers/gitignore/api/vim,python
|
||||||
|
|
@ -17,6 +17,7 @@
|
||||||
// Digital pins 8 to 13 correspond to PB0 to PB5
|
// Digital pins 8 to 13 correspond to PB0 to PB5
|
||||||
|
|
||||||
byte lastOp;
|
byte lastOp;
|
||||||
|
static char printBuff[128];
|
||||||
|
|
||||||
void latchOutput() {
|
void latchOutput() {
|
||||||
static byte latchMask = 0b00010000;
|
static byte latchMask = 0b00010000;
|
||||||
|
|
@ -52,7 +53,7 @@ void setBusMode(bool busMode) {
|
||||||
|
|
||||||
void setAddress(int address, bool outputEnable) {
|
void setAddress(int address, bool outputEnable) {
|
||||||
// Position of the output enable bit withing the data to be shifted out.
|
// Position of the output enable bit withing the data to be shifted out.
|
||||||
static byte outputEnableMask = 0x8000;
|
static int outputEnableMask = 0x8000;
|
||||||
// Position of the data bit within PORTD.
|
// Position of the data bit within PORTD.
|
||||||
static byte dataMask = 0b00000100;
|
static byte dataMask = 0b00000100;
|
||||||
// Position of the clock bit within PORTD.
|
// Position of the clock bit within PORTD.
|
||||||
|
|
@ -68,7 +69,6 @@ void setAddress(int address, bool outputEnable) {
|
||||||
|
|
||||||
// Make sure the clock pin is low.
|
// Make sure the clock pin is low.
|
||||||
PORTD &= ~clockMask;
|
PORTD &= ~clockMask;
|
||||||
|
|
||||||
// Shift the data out LSB first.
|
// Shift the data out LSB first.
|
||||||
for (uint8_t i = 0; i < 16; i++, address >>= 1) {
|
for (uint8_t i = 0; i < 16; i++, address >>= 1) {
|
||||||
if (address & 1) {
|
if (address & 1) {
|
||||||
|
|
@ -148,7 +148,8 @@ void setup() {
|
||||||
|
|
||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
|
|
||||||
|
writeEEPROM(0x1234, 0x55, true);
|
||||||
|
writeEEPROM(0x4321, 0x7E, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,31 @@
|
||||||
#define ADDRESS_0 22
|
#define ADDRESS_0 22
|
||||||
#define ADDRESS_15 50
|
#define ADDRESS_15 50
|
||||||
|
|
||||||
void setup() {
|
#define ADDRESS_CLOCK 18
|
||||||
|
#define WRITE_CLOCK 19
|
||||||
|
|
||||||
|
void setup() {
|
||||||
|
Serial.begin(9600);
|
||||||
|
attachInterrupt(digitalPinToInterrupt(ADDRESS_CLOCK), onAddressClock, RISING);
|
||||||
|
attachInterrupt(digitalPinToInterrupt(WRITE_CLOCK), onWriteClock, FALLING);
|
||||||
|
}
|
||||||
|
|
||||||
|
void onAddressClock() {
|
||||||
|
delayMicroseconds(1);
|
||||||
|
Serial.print("Address: 0b");
|
||||||
|
Serial.print(digitalRead(OUTPUT_ENABLE));
|
||||||
|
for (int pin = ADDRESS_15; pin >= ADDRESS_0; pin -= 2) {
|
||||||
|
Serial.print(digitalRead(pin));
|
||||||
|
}
|
||||||
|
Serial.println();
|
||||||
|
}
|
||||||
|
|
||||||
|
void onWriteClock() {
|
||||||
|
Serial.print("Data: 0b");
|
||||||
|
for (int pin = DATA_7; pin >= DATA_0; pin--) {
|
||||||
|
Serial.print(digitalRead(pin));
|
||||||
|
}
|
||||||
|
Serial.println();
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue