aboutsummaryrefslogtreecommitdiff
path: root/src/peripherals/twi.ts (follow)
Commit message (Collapse)AuthorAgeFilesLines
* fix(twi): fails on repeated start conditionUri Shaked2021-12-131-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | reproduction: https://wokwi.com/arduino/projects/306115576172905024 minimal reproduction code: ```cpp #include <Wire.h> void setup() { Serial.begin(115200); Wire.begin(); Wire.beginTransmission(0x68); Wire.write( 0x3B); Wire.endTransmission( false); // <---- Fails after this auto n = Wire.requestFrom(0x68, 6); if (n == 6) { int16_t AcX = Wire.read() << 8 | Wire.read(); // 0x3B (ACCEL_XOUT_H) & 0x3C (ACCEL_XOUT_L) int16_t AcY = Wire.read() << 8 | Wire.read(); // 0x3D (ACCEL_YOUT_H) & 0x3E (ACCEL_YOUT_L) int16_t AcZ = Wire.read() << 8 | Wire.read(); // 0x3F (ACCEL_ZOUT_H) & 0x40 (ACCEL_ZOUT_L) Serial.print( "AcX = "); Serial.print( AcX); Serial.print( " | AcY = "); Serial.print( AcY); Serial.print( " | AcZ = "); Serial.print( AcZ); Serial.println(); } else { Serial.println( "--------- ERROR ---------"); } } void loop() {} ```
* fix(twi): broken repeated start #91Uri Shaked2021-04-151-1/+1
| | | | fix #91
* fix: typo in parameter nameUri Shaked2021-01-021-2/+2
| | | | | freqMHz → freqHz in SPI, TWI, and USART: they all expect the frequency in hertz, not mega-hertz.
* perf!: centeral timekeepingUri Shaked2020-12-091-11/+2
| | | | | | | | | This should improve performance, especially when running simulations with multiple peripherals. For instance, the demo project now runs at ~322%, up from ~185% in AVR8js 0.13.1. BREAKING CHANGE: `tick()` methods were removed from individual peripherals. You now need to call `cpu.tick()` instead.
* refactor: central interrupt handling #38Uri Shaked2020-12-091-15/+15
|
* style: reformat code with prettier 2.xUri Shaked2020-04-271-1/+1
| | | | prettier rules have changed since we upgraded to 2.x
* refactor: added peripherals and cpu feature folderslironh2020-03-221-0/+200