(date)
| 80 | } |
| 81 | |
| 82 | _setDate(date) { |
| 83 | let buf = new ArrayBuffer(7*1); |
| 84 | let bytes = new Uint8Array(buf); |
| 85 | |
| 86 | bytes[0] = this.decToBcd(date.seconds); |
| 87 | bytes[1] = this.decToBcd(date.minutes); |
| 88 | bytes[2] = this.decToBcd(date.hours); |
| 89 | bytes[3] = this.decToBcd(date.dow); |
| 90 | bytes[4] = this.decToBcd(date.date); |
| 91 | bytes[5] = this.decToBcd(date.month) | ((date.year > 2000) ? DS3231_CENTURY_BIT : 0); |
| 92 | bytes[6] = this.decToBcd(date.year % 100); |
| 93 | |
| 94 | super.writeBlock(DS3231_TIME_CAL_ADDR, buf); |
| 95 | } |
| 96 | static probe() { |
| 97 | const i = new I2C({address: DS3231_ADDR, throw: false}); |
| 98 | const result = i.read(1); |
nothing calls this directly
no test coverage detected