54 #define USE_HARDWARE_TWI 61 #if defined(USE_SOFTWARE_TWI) 63 #include "Software/TWI.h" 64 Software::TWI<BOARD::D18, BOARD::D19>
twi;
65 #elif defined(USE_HARDWARE_TWI) 66 #include "Hardware/TWI.h" 98 for (
int i = 0; i <
BUF_MAX; i++)
buf[i] = n + i;
101 Serial.print(F(
"twi.FREQ(kHz) = "));
102 Serial.println(
FREQ / 1000);
103 Serial.print(F(
"eeprom.SIZE(kbyte) = "));
108 Serial.println(F(
"write(N, us, us/byte, kbyte/s)"));
110 for (
int i = 0; i <
N_MAX; i++) {
113 us = micros() - start;
114 uspb = ((float) us) /
N[i];
116 Serial.print(F(
", "));
118 Serial.print(F(
", "));
120 Serial.print(F(
", "));
121 Serial.println(1000 / uspb);
129 Serial.println(F(
"read(N, us, us/byte, kbyte/s)"));
131 for (
int i = 0; i <
N_MAX; i++) {
134 us = micros() - start;
135 uspb = ((float) us) /
N[i];
137 Serial.print(F(
", "));
139 Serial.print(F(
", "));
141 Serial.print(F(
", "));
142 Serial.println(1000 / uspb);
146 for (
int i = 0; i <
BUF_MAX; i++) {
147 if (
buf[i] != ((n + i) & 0xff)) {
149 Serial.println(F(
": verification error"));
virtual int read(void *dst, uint32_t src, size_t count)
virtual int write(uint32_t dst, const void *src, size_t count)
const unsigned int N[N_MAX]