43 lines
852 B
C
43 lines
852 B
C
#include <avr/eeprom.h>
|
|
#include <avr/io.h>
|
|
|
|
#include "aht20.h"
|
|
#include "eeprom.h"
|
|
#include "i2c.h"
|
|
#include "mystd.h"
|
|
#include "uart.h"
|
|
#include "utils.h"
|
|
|
|
int main(void) {
|
|
uart_init();
|
|
|
|
uint8_t eeprom_row[0x10];
|
|
|
|
for (uint16_t eeprom_addr = 0; eeprom_addr < 1024; eeprom_addr += 0x0010) {
|
|
// send addr
|
|
uart_send_u16_hex(0);
|
|
uart_send_u16_hex(eeprom_addr);
|
|
uart_tx(' ');
|
|
|
|
eeprom_read(eeprom_addr, eeprom_row, sizeof(eeprom_row));
|
|
|
|
for (uint8_t i = 0; i < sizeof(eeprom_row) / sizeof(eeprom_row[0]); i++) {
|
|
uart_send_u8_hex(eeprom_row[i]);
|
|
uart_tx(' ');
|
|
}
|
|
|
|
uart_tx('|');
|
|
for (uint8_t i = 0; i < sizeof(eeprom_row) / sizeof(eeprom_row[0]); i++) {
|
|
if (eeprom_row[i] < ' ' || eeprom_row[i] > '~')
|
|
uart_tx('.');
|
|
else
|
|
uart_tx(eeprom_row[i]);
|
|
}
|
|
uart_tx('|');
|
|
|
|
uart_sendstring("\r\n");
|
|
}
|
|
|
|
while (true) {
|
|
}
|
|
}
|