From 029a3babe19bc65c47c03626045aa5ec6abaf462 Mon Sep 17 00:00:00 2001 From: Aaron Roth <16aroth6@gmail.com> Date: Fri, 9 Aug 2024 00:51:23 -0600 Subject: [PATCH 1/4] File structure reorg to Arduino Library Reference --- .development | 0 keywords.txt | 11 + library.properties | 10 + src/ArTICL.cpp | 0 src/ArTICL.h | 8 + CBL2.cpp => src/CBL2.cpp | 0 CBL2.h => src/CBL2.h | 0 TICL.cpp => src/TICL.cpp | 616 ++++++++++++++++++------------------- TICL.h => src/TICL.h | 192 ++++++------ TIVar.cpp => src/TIVar.cpp | 0 TIVar.h => src/TIVar.h | 0 11 files changed, 433 insertions(+), 404 deletions(-) create mode 100644 .development create mode 100644 keywords.txt create mode 100644 library.properties create mode 100644 src/ArTICL.cpp create mode 100644 src/ArTICL.h rename CBL2.cpp => src/CBL2.cpp (100%) mode change 100755 => 100644 rename CBL2.h => src/CBL2.h (100%) rename TICL.cpp => src/TICL.cpp (96%) rename TICL.h => src/TICL.h (95%) rename TIVar.cpp => src/TIVar.cpp (100%) mode change 100755 => 100644 rename TIVar.h => src/TIVar.h (100%) mode change 100755 => 100644 diff --git a/.development b/.development new file mode 100644 index 0000000..e69de29 diff --git a/keywords.txt b/keywords.txt new file mode 100644 index 0000000..7bc8fec --- /dev/null +++ b/keywords.txt @@ -0,0 +1,11 @@ +# Syntax Coloring Map for ArTICL + +# Datatypes (KEYWORD1) + +# Methods and Functions (KEYWORD2) + +# Instances (KEYWORD2) + +# Structures (KEYWORD3) + +# Constants (LITERAL1) \ No newline at end of file diff --git a/library.properties b/library.properties new file mode 100644 index 0000000..9e2844f --- /dev/null +++ b/library.properties @@ -0,0 +1,10 @@ +name=ArTICL +version=0.0.1 +author=KermMartian +maintainer=KermMartian +sentance=Arduino TI Calculator Linking Library (ArTICL) for interfacing with TI-8x/9x calculators over the TI Link Protocol +paragraph=Support for the TI graphing calculators with the 2.5mm I/O port. +category=Communication +url=https://github.com/KermMartian/ArTICL +architectures=* +includes=ArTICL.h \ No newline at end of file diff --git a/src/ArTICL.cpp b/src/ArTICL.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/ArTICL.h b/src/ArTICL.h new file mode 100644 index 0000000..f6fbd1c --- /dev/null +++ b/src/ArTICL.h @@ -0,0 +1,8 @@ +#ifndef ARTCIL_H +#define ARTCIL_H + +#include "CBL2.h" +#include "TICL.h" +#include "TIVar.h" + +#endif // ARTICL_H \ No newline at end of file diff --git a/CBL2.cpp b/src/CBL2.cpp old mode 100755 new mode 100644 similarity index 100% rename from CBL2.cpp rename to src/CBL2.cpp diff --git a/CBL2.h b/src/CBL2.h similarity index 100% rename from CBL2.h rename to src/CBL2.h diff --git a/TICL.cpp b/src/TICL.cpp similarity index 96% rename from TICL.cpp rename to src/TICL.cpp index 9e45305..44578b7 100644 --- a/TICL.cpp +++ b/src/TICL.cpp @@ -1,308 +1,308 @@ -/************************************************* - * TICL.cpp - Core of ArTICL library for linking * - * TI calculators and Arduinos. * - * Created by Christopher Mitchell, * - * 2011-2019, all rights reserved. * - *************************************************/ - -#include "Arduino.h" -#include "TICL.h" - -// Constructor with default communication lines -TICL::TICL() { - setLines(DEFAULT_TIP, DEFAULT_RING); - serial_ = NULL; -} - -// Constructor with custom communication lines. Fun -// fact: You can use this and multiple TICL objects to -// talk to multiple endpoints at the same time. -TICL::TICL(int tip, int ring) { - setLines(tip, ring); - serial_ = NULL; -} - -// This should be called during the setup() function -// to set the communication lines to their initial values -void TICL::begin() { - resetLines(); -} - -// Determine whether debug printing is enabled -void TICL::setVerbosity(bool verbose, HardwareSerial* serial) { - if (verbose) { - serial_ = serial; - } else { - serial_ = NULL; - } -} - -// Change the lines after construction -void TICL::setLines(int tip, int ring) { - tip_ = tip; - ring_ = ring; -} - -// Send an entire message from the Arduino to -// the attached TI device, byte by byte -int TICL::send(uint8_t* header, uint8_t* data, int datalength, uint8_t(*data_callback)(int)) { - if (serial_) { - serial_->print("snd type 0x"); - serial_->print(header[1], HEX); - serial_->print(" as EP 0x"); - serial_->print(header[0], HEX); - serial_->print(" len "); - serial_->println(datalength); - } - - // Send all of the bytes in the header - for(int idx = 0; idx < 4; idx++) { - int rval = sendByte(header[idx]); - if (rval != 0) { - return rval; - } - } - - // If no data, we're done - if (datalength == 0) { - return 0; - } - - // These also indicate that there are - // no data bytes to be sent - if (header[1] == CTS || - header[1] == VER || - header[1] == ACK || - header[1] == ERR || - header[1] == RDY || - header[1] == SCR || - header[1] == KEY || - header[1] == EOT) - { - return 0; - } - - // Send all of the bytes in the data buffer - uint16_t checksum = 0; - for(int idx = 0; idx < datalength; idx++) { - uint8_t outbyte; - // Get a byte if we need - if (data_callback != NULL) { - outbyte = data_callback(idx); - } else { - outbyte = data[idx]; - } - // Try to send this byte - int rval = sendByte(outbyte); - if (rval != 0) { - return rval; - } - checksum += outbyte; - } - - // Send the checksum - int rval = sendByte(checksum & 0x00ff); - if (rval != 0) { - return rval; - } - rval = sendByte((checksum >> 8) & 0x00ff); - return rval; -} - -// Send a single byte from the Arduino to the attached -// TI device, returning nonzero if a failure occurred. -int TICL::sendByte(uint8_t byte) { - unsigned long previousMicros; - if (serial_) { - serial_->print("Sending byte "); - serial_->println(byte); - } - - // Send all of the bits in this byte - for(int bit = 0; bit < 8; bit++) { - - // Wait for both lines to be high before sending the bit - previousMicros = micros(); - while (digitalRead(ring_) == LOW || digitalRead(tip_) == LOW) { - if (micros() - previousMicros > TIMEOUT) { - resetLines(); - return ERR_WRITE_TIMEOUT; - } - } - - // Pull one line low to indicate a new bit is going out - bool bitval = (byte & 1); - int line = (bitval)?ring_:tip_; - pinMode(line, OUTPUT); - digitalWrite(line, LOW); - - // Wait for peer to acknowledge by pulling opposite line low - line = (bitval)?tip_:ring_; - previousMicros = micros(); - while (digitalRead(line) == HIGH) { - if (micros() - previousMicros > TIMEOUT) { - resetLines(); - return ERR_WRITE_TIMEOUT; - } - } - - // Wait for peer to indicate readiness by releasing that line - resetLines(); - previousMicros = micros(); - while (digitalRead(line) == LOW) { - if (micros() - previousMicros > TIMEOUT) { - resetLines(); - return ERR_WRITE_TIMEOUT; - } - } - resetLines(); - - // Rotate the next bit to send into the low bit of the byte - byte >>= 1; - } - - return 0; -} - -// Returns 0 for a successfully-read message or non-zero -// for failure. If return value is 0 and datalength is zero, -// then the message is just a 4-byte message in the header -// buffer. If the -int TICL::get(uint8_t* header, uint8_t* data, int* datalength, - int maxlength, int timeout) -{ - int rval; - - // Get the 4-byte header: sender, message, length - for(int idx = 0; idx < 4; idx++) { - rval = getByte(&header[idx], timeout); - if (rval) { - return rval; - } - } - *datalength = (int)header[2] | ((int)header[3] << 8); - - if (serial_) { - serial_->print("Recv typ 0x"); - serial_->print(header[1], HEX); - serial_->print(" from EP 0x"); - serial_->print(header[0], HEX); - serial_->print(" len "); - serial_->println(*datalength); - } - - if (*datalength == 0) { - return 0; - } - - // These also indicate that there are - // no data bytes to be received - if (header[1] == CTS || - header[1] == VER || - header[1] == ACK || - header[1] == ERR || - header[1] == RDY || - header[1] == SCR || - header[1] == KEY || - header[1] == EOT) - { - return 0; - } - - // Check if this is a data-free message - if (*datalength > maxlength) { - if (serial_) { - serial_->print("Msg buf ovfl: "); - serial_->print(*datalength); - serial_->print(" > "); - serial_->println(maxlength); - } - return ERR_BUFFER_OVERFLOW; - } - - // Get the data bytes, if there are any. - uint16_t checksum = 0; - for(int idx = 0; idx < *datalength; idx++) { - // Try to get all the bytes, or fail if any of the - // individual byte reads fail - rval = getByte(&data[idx]); - if (rval != 0) { - return rval; - } - - // Update checksum - checksum += data[idx]; - } - - // Receive and check the checksum - uint8_t recv_checksum[2]; - for(int idx = 0; idx < 2; idx++) { - rval = getByte(&recv_checksum[idx]); - if (rval) - return rval; - } - - // Die on a bad checksum - if (checksum != - (uint16_t)(((int)recv_checksum[1] << 8) | (int)recv_checksum[0])) - { - return ERR_BAD_CHECKSUM; - } - - return 0; -} - -// Receive a single byte from the attached TI device, -// returning nonzero if a failure occurred. -int TICL::getByte(uint8_t* byte, int timeout) { - unsigned long previousMicros = 0; - *byte = 0; - - // Pull down each bit and store it - for (int bit = 0; bit < 8; bit++) { - int linevals; - - previousMicros = micros(); - while ((linevals = ((digitalRead(ring_) << 1) | digitalRead(tip_))) == 0x03) { - if (micros() - previousMicros > timeout) { - resetLines(); - if (serial_) { - serial_->print("died waiting for bit "); serial_->println(bit); - } - return ERR_READ_ENTER_TIMEOUT; - } - } - - // Store the bit, then acknowledge it - *byte = (*byte >> 1) | ((linevals == 0x01)?0x80:0x00); - int line = (linevals == 0x01)?tip_:ring_; - pinMode(line, OUTPUT); - digitalWrite(line, LOW); - - // Wait for the peer to indicate readiness - line = (linevals == 0x01)?ring_:tip_; - previousMicros = micros(); - while (digitalRead(line) == LOW) { //wait for the other one to go high again - if (micros() - previousMicros > TIMEOUT) { - resetLines(); - if (serial_) { - serial_->print("died waiting for bit ack "); serial_->println(bit); - } - return ERR_READ_TIMEOUT; - } - } - - // Now set them both high and to input - resetLines(); - } - if (serial_) { - serial_->print("Got byte "); - serial_->println(*byte); - } - return 0; -} - -void TICL::resetLines(void) { - pinMode(ring_, INPUT_PULLUP); // set pin to input with pullups - pinMode(tip_, INPUT_PULLUP); // set pin to input with pullups -} +/************************************************* + * TICL.cpp - Core of ArTICL library for linking * + * TI calculators and Arduinos. * + * Created by Christopher Mitchell, * + * 2011-2019, all rights reserved. * + *************************************************/ + +#include "Arduino.h" +#include "TICL.h" + +// Constructor with default communication lines +TICL::TICL() { + setLines(DEFAULT_TIP, DEFAULT_RING); + serial_ = NULL; +} + +// Constructor with custom communication lines. Fun +// fact: You can use this and multiple TICL objects to +// talk to multiple endpoints at the same time. +TICL::TICL(int tip, int ring) { + setLines(tip, ring); + serial_ = NULL; +} + +// This should be called during the setup() function +// to set the communication lines to their initial values +void TICL::begin() { + resetLines(); +} + +// Determine whether debug printing is enabled +void TICL::setVerbosity(bool verbose, HardwareSerial* serial) { + if (verbose) { + serial_ = serial; + } else { + serial_ = NULL; + } +} + +// Change the lines after construction +void TICL::setLines(int tip, int ring) { + tip_ = tip; + ring_ = ring; +} + +// Send an entire message from the Arduino to +// the attached TI device, byte by byte +int TICL::send(uint8_t* header, uint8_t* data, int datalength, uint8_t(*data_callback)(int)) { + if (serial_) { + serial_->print("snd type 0x"); + serial_->print(header[1], HEX); + serial_->print(" as EP 0x"); + serial_->print(header[0], HEX); + serial_->print(" len "); + serial_->println(datalength); + } + + // Send all of the bytes in the header + for(int idx = 0; idx < 4; idx++) { + int rval = sendByte(header[idx]); + if (rval != 0) { + return rval; + } + } + + // If no data, we're done + if (datalength == 0) { + return 0; + } + + // These also indicate that there are + // no data bytes to be sent + if (header[1] == CTS || + header[1] == VER || + header[1] == ACK || + header[1] == ERR || + header[1] == RDY || + header[1] == SCR || + header[1] == KEY || + header[1] == EOT) + { + return 0; + } + + // Send all of the bytes in the data buffer + uint16_t checksum = 0; + for(int idx = 0; idx < datalength; idx++) { + uint8_t outbyte; + // Get a byte if we need + if (data_callback != NULL) { + outbyte = data_callback(idx); + } else { + outbyte = data[idx]; + } + // Try to send this byte + int rval = sendByte(outbyte); + if (rval != 0) { + return rval; + } + checksum += outbyte; + } + + // Send the checksum + int rval = sendByte(checksum & 0x00ff); + if (rval != 0) { + return rval; + } + rval = sendByte((checksum >> 8) & 0x00ff); + return rval; +} + +// Send a single byte from the Arduino to the attached +// TI device, returning nonzero if a failure occurred. +int TICL::sendByte(uint8_t byte) { + unsigned long previousMicros; + if (serial_) { + serial_->print("Sending byte "); + serial_->println(byte); + } + + // Send all of the bits in this byte + for(int bit = 0; bit < 8; bit++) { + + // Wait for both lines to be high before sending the bit + previousMicros = micros(); + while (digitalRead(ring_) == LOW || digitalRead(tip_) == LOW) { + if (micros() - previousMicros > TIMEOUT) { + resetLines(); + return ERR_WRITE_TIMEOUT; + } + } + + // Pull one line low to indicate a new bit is going out + bool bitval = (byte & 1); + int line = (bitval)?ring_:tip_; + pinMode(line, OUTPUT); + digitalWrite(line, LOW); + + // Wait for peer to acknowledge by pulling opposite line low + line = (bitval)?tip_:ring_; + previousMicros = micros(); + while (digitalRead(line) == HIGH) { + if (micros() - previousMicros > TIMEOUT) { + resetLines(); + return ERR_WRITE_TIMEOUT; + } + } + + // Wait for peer to indicate readiness by releasing that line + resetLines(); + previousMicros = micros(); + while (digitalRead(line) == LOW) { + if (micros() - previousMicros > TIMEOUT) { + resetLines(); + return ERR_WRITE_TIMEOUT; + } + } + resetLines(); + + // Rotate the next bit to send into the low bit of the byte + byte >>= 1; + } + + return 0; +} + +// Returns 0 for a successfully-read message or non-zero +// for failure. If return value is 0 and datalength is zero, +// then the message is just a 4-byte message in the header +// buffer. If the +int TICL::get(uint8_t* header, uint8_t* data, int* datalength, + int maxlength, int timeout) +{ + int rval; + + // Get the 4-byte header: sender, message, length + for(int idx = 0; idx < 4; idx++) { + rval = getByte(&header[idx], timeout); + if (rval) { + return rval; + } + } + *datalength = (int)header[2] | ((int)header[3] << 8); + + if (serial_) { + serial_->print("Recv typ 0x"); + serial_->print(header[1], HEX); + serial_->print(" from EP 0x"); + serial_->print(header[0], HEX); + serial_->print(" len "); + serial_->println(*datalength); + } + + if (*datalength == 0) { + return 0; + } + + // These also indicate that there are + // no data bytes to be received + if (header[1] == CTS || + header[1] == VER || + header[1] == ACK || + header[1] == ERR || + header[1] == RDY || + header[1] == SCR || + header[1] == KEY || + header[1] == EOT) + { + return 0; + } + + // Check if this is a data-free message + if (*datalength > maxlength) { + if (serial_) { + serial_->print("Msg buf ovfl: "); + serial_->print(*datalength); + serial_->print(" > "); + serial_->println(maxlength); + } + return ERR_BUFFER_OVERFLOW; + } + + // Get the data bytes, if there are any. + uint16_t checksum = 0; + for(int idx = 0; idx < *datalength; idx++) { + // Try to get all the bytes, or fail if any of the + // individual byte reads fail + rval = getByte(&data[idx]); + if (rval != 0) { + return rval; + } + + // Update checksum + checksum += data[idx]; + } + + // Receive and check the checksum + uint8_t recv_checksum[2]; + for(int idx = 0; idx < 2; idx++) { + rval = getByte(&recv_checksum[idx]); + if (rval) + return rval; + } + + // Die on a bad checksum + if (checksum != + (uint16_t)(((int)recv_checksum[1] << 8) | (int)recv_checksum[0])) + { + return ERR_BAD_CHECKSUM; + } + + return 0; +} + +// Receive a single byte from the attached TI device, +// returning nonzero if a failure occurred. +int TICL::getByte(uint8_t* byte, int timeout) { + unsigned long previousMicros = 0; + *byte = 0; + + // Pull down each bit and store it + for (int bit = 0; bit < 8; bit++) { + int linevals; + + previousMicros = micros(); + while ((linevals = ((digitalRead(ring_) << 1) | digitalRead(tip_))) == 0x03) { + if (micros() - previousMicros > timeout) { + resetLines(); + if (serial_) { + serial_->print("died waiting for bit "); serial_->println(bit); + } + return ERR_READ_ENTER_TIMEOUT; + } + } + + // Store the bit, then acknowledge it + *byte = (*byte >> 1) | ((linevals == 0x01)?0x80:0x00); + int line = (linevals == 0x01)?tip_:ring_; + pinMode(line, OUTPUT); + digitalWrite(line, LOW); + + // Wait for the peer to indicate readiness + line = (linevals == 0x01)?ring_:tip_; + previousMicros = micros(); + while (digitalRead(line) == LOW) { //wait for the other one to go high again + if (micros() - previousMicros > TIMEOUT) { + resetLines(); + if (serial_) { + serial_->print("died waiting for bit ack "); serial_->println(bit); + } + return ERR_READ_TIMEOUT; + } + } + + // Now set them both high and to input + resetLines(); + } + if (serial_) { + serial_->print("Got byte "); + serial_->println(*byte); + } + return 0; +} + +void TICL::resetLines(void) { + pinMode(ring_, INPUT_PULLUP); // set pin to input with pullups + pinMode(tip_, INPUT_PULLUP); // set pin to input with pullups +} diff --git a/TICL.h b/src/TICL.h similarity index 95% rename from TICL.h rename to src/TICL.h index 1599792..783af98 100644 --- a/TICL.h +++ b/src/TICL.h @@ -1,97 +1,97 @@ -/************************************************* - * TICL.h - Core of ArTICL library for linking * - * TI calculators and Arduinos. * - * Created by Christopher Mitchell, * - * 2011-2019, all rights reserved. * - *************************************************/ - -#ifndef TICL_H -#define TICL_H - -#include "Arduino.h" -#include "HardwareSerial.h" - -#define TIMEOUT 100000l // microseconds (100ms) -#define GET_ENTER_TIMEOUT 1000000l // microseconds (1s) - -#if defined(__MSP432P401R__) // MSP432 target -#define DEFAULT_TIP 17 // Tip = red wire (GPIO 5.7) -#define DEFAULT_RING 37 // Ring = white wire (GPIO 5.6) -#else // Arduino target -#define DEFAULT_TIP 2 // Tip = red wire -#define DEFAULT_RING 3 // Ring = white wire -#endif - -enum TICLErrors { - ERR_READ_TIMEOUT = -1, - ERR_WRITE_TIMEOUT = -2, - ERR_BAD_CHECKSUM = -3, - ERR_BUFFER_OVERFLOW = -4, - ERR_INVALID = -5, - ERR_READ_ENTER_TIMEOUT = -6 -}; - -enum Endpoint { - COMP82 = 0x02, - COMP83 = 0x03, - COMP85 = 0x05, - COMP86 = 0x06, - COMP89 = 0x09, - COMP92 = 0x09, - CBL82 = 0x12, - CBL85 = 0x15, - CBL89 = 0x19, - CBL92 = 0x19, - COMP83P = 0x23, - CALC83P = 0x73, - CALC82 = 0x82, - CALC83 = 0x83, - CALC85a = 0x85, - CALC89 = 0x89, - CALC92 = 0x89, - CALC85b = 0x95, -}; - -enum CommandID { - VAR = 0x06, - CTS = 0x09, - DATA = 0x15, - VER = 0x2D, - SKIP = 0x36, - EXIT = 0x36, - ACK = 0x56, - ERR = 0x5A, - RDY = 0x68, - SCR = 0x6D, - KEY = 0x87, - DEL = 0x88, - EOT = 0x92, - REQ = 0xA2, - RTS = 0xC9, -}; - -class TICL { - public: - TICL(); - TICL(int tip, int ring); - void begin(); - void setLines(int tip, int ring); - void setVerbosity(bool verbose, HardwareSerial* serial = NULL); - - int send(uint8_t* header, uint8_t* data, int datalength, uint8_t(*data_callback)(int) = NULL); - int get(uint8_t* header, uint8_t* data, int* datalength, int maxlength, int timeout = GET_ENTER_TIMEOUT); - void resetLines(); - - protected: - HardwareSerial* serial_; - - private: - int sendByte(uint8_t byte); - int getByte(uint8_t* byte, int timeout = GET_ENTER_TIMEOUT); - int digitalSafeRead(int pin); - - int tip_; - int ring_; -}; - +/************************************************* + * TICL.h - Core of ArTICL library for linking * + * TI calculators and Arduinos. * + * Created by Christopher Mitchell, * + * 2011-2019, all rights reserved. * + *************************************************/ + +#ifndef TICL_H +#define TICL_H + +#include "Arduino.h" +#include "HardwareSerial.h" + +#define TIMEOUT 100000l // microseconds (100ms) +#define GET_ENTER_TIMEOUT 1000000l // microseconds (1s) + +#if defined(__MSP432P401R__) // MSP432 target +#define DEFAULT_TIP 17 // Tip = red wire (GPIO 5.7) +#define DEFAULT_RING 37 // Ring = white wire (GPIO 5.6) +#else // Arduino target +#define DEFAULT_TIP 2 // Tip = red wire +#define DEFAULT_RING 3 // Ring = white wire +#endif + +enum TICLErrors { + ERR_READ_TIMEOUT = -1, + ERR_WRITE_TIMEOUT = -2, + ERR_BAD_CHECKSUM = -3, + ERR_BUFFER_OVERFLOW = -4, + ERR_INVALID = -5, + ERR_READ_ENTER_TIMEOUT = -6 +}; + +enum Endpoint { + COMP82 = 0x02, + COMP83 = 0x03, + COMP85 = 0x05, + COMP86 = 0x06, + COMP89 = 0x09, + COMP92 = 0x09, + CBL82 = 0x12, + CBL85 = 0x15, + CBL89 = 0x19, + CBL92 = 0x19, + COMP83P = 0x23, + CALC83P = 0x73, + CALC82 = 0x82, + CALC83 = 0x83, + CALC85a = 0x85, + CALC89 = 0x89, + CALC92 = 0x89, + CALC85b = 0x95, +}; + +enum CommandID { + VAR = 0x06, + CTS = 0x09, + DATA = 0x15, + VER = 0x2D, + SKIP = 0x36, + EXIT = 0x36, + ACK = 0x56, + ERR = 0x5A, + RDY = 0x68, + SCR = 0x6D, + KEY = 0x87, + DEL = 0x88, + EOT = 0x92, + REQ = 0xA2, + RTS = 0xC9, +}; + +class TICL { + public: + TICL(); + TICL(int tip, int ring); + void begin(); + void setLines(int tip, int ring); + void setVerbosity(bool verbose, HardwareSerial* serial = NULL); + + int send(uint8_t* header, uint8_t* data, int datalength, uint8_t(*data_callback)(int) = NULL); + int get(uint8_t* header, uint8_t* data, int* datalength, int maxlength, int timeout = GET_ENTER_TIMEOUT); + void resetLines(); + + protected: + HardwareSerial* serial_; + + private: + int sendByte(uint8_t byte); + int getByte(uint8_t* byte, int timeout = GET_ENTER_TIMEOUT); + int digitalSafeRead(int pin); + + int tip_; + int ring_; +}; + #endif // TICL_H \ No newline at end of file diff --git a/TIVar.cpp b/src/TIVar.cpp old mode 100755 new mode 100644 similarity index 100% rename from TIVar.cpp rename to src/TIVar.cpp diff --git a/TIVar.h b/src/TIVar.h old mode 100755 new mode 100644 similarity index 100% rename from TIVar.h rename to src/TIVar.h From 01e04bb080287ca0f18b4d46633e2f478ec2fe61 Mon Sep 17 00:00:00 2001 From: Aaron Roth <16aroth6@gmail.com> Date: Fri, 9 Aug 2024 21:48:45 -0600 Subject: [PATCH 2/4] Remove .development for Arduino Library release --- .development | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .development diff --git a/.development b/.development deleted file mode 100644 index e69de29..0000000 From 435ddcceb06e06810030b098f85b7840ff3a9e9d Mon Sep 17 00:00:00 2001 From: Aaron Roth <16aroth6@gmail.com> Date: Fri, 9 Aug 2024 22:47:30 -0600 Subject: [PATCH 3/4] Fixed typo --- library.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.properties b/library.properties index 9e2844f..e91cd61 100644 --- a/library.properties +++ b/library.properties @@ -2,7 +2,7 @@ name=ArTICL version=0.0.1 author=KermMartian maintainer=KermMartian -sentance=Arduino TI Calculator Linking Library (ArTICL) for interfacing with TI-8x/9x calculators over the TI Link Protocol +sentence=Arduino TI Calculator Linking Library (ArTICL) for interfacing with TI-8x/9x calculators over the TI Link Protocol paragraph=Support for the TI graphing calculators with the 2.5mm I/O port. category=Communication url=https://github.com/KermMartian/ArTICL From d4f277f80ec6dfdbe33ade510bcbbd4a246a627c Mon Sep 17 00:00:00 2001 From: 16aroth6 <74440979+16aroth6@users.noreply.github.com> Date: Sat, 10 Aug 2024 11:11:07 -0600 Subject: [PATCH 4/4] Apply suggestions from code review Co-authored-by: Christopher Mitchell, Ph.D. --- library.properties | 6 +++--- src/ArTICL.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/library.properties b/library.properties index e91cd61..e60d4c8 100644 --- a/library.properties +++ b/library.properties @@ -1,9 +1,9 @@ name=ArTICL -version=0.0.1 +version=1.0.0 author=KermMartian maintainer=KermMartian -sentence=Arduino TI Calculator Linking Library (ArTICL) for interfacing with TI-8x/9x calculators over the TI Link Protocol -paragraph=Support for the TI graphing calculators with the 2.5mm I/O port. +sentence=Arduino TI Calculator Linking Library (ArTICL) for interfacing with TI-8x/9x calculators over the TI Link Protocol. +paragraph=This library provides support for communicating with TI graphing calculators via the 2.5mm I/O ("DBUS") port. Supported operations including transferring variables, injecting remote keypresses, and taking screenshots. Supported calculators include the TI-82, TI-83, TI-83 Plus family, and TI-84 Plus family, with rudimentary support for the TI-89 family and TI-92 family. category=Communication url=https://github.com/KermMartian/ArTICL architectures=* diff --git a/src/ArTICL.h b/src/ArTICL.h index f6fbd1c..197777f 100644 --- a/src/ArTICL.h +++ b/src/ArTICL.h @@ -1,5 +1,5 @@ -#ifndef ARTCIL_H -#define ARTCIL_H +#ifndef ARTICL_H +#define ARTICL_H #include "CBL2.h" #include "TICL.h"