44 static void _putc(
void *p,
char c)
52 uint8_t magic_BE = 0xBE;
53 uint8_t big_array[2048];
54 uint8_t magic_AC = 0xAC;
55 uint8_t big_array2[2048];
56 uint8_t magic_D3 = 0xD3;
65 static uint8_t config_buffer[
sizeof(
config_t)];
76 for (
int i = 0;
i < 2048;
i++)
78 config_file.
big_array[
i] = (uint8_t)std::rand();
95 for (uint8_t *p = (uint8_t *)&config_file; p < (uint8_t *)&config_file +
sizeof(config_file); p++)
99 config_file.
crc = crc;
103 bool success =
false;
116 for (uint8_t *p = (uint8_t *) config_ptr; p < (uint8_t *)config_ptr +
sizeof(config_file); p++)
137 uint32_t size =
sizeof(config_file);
141 printf(
"successfully wrote, read and validated %d.%dKB worth of data\n", size/1000, size%1000);
void init(GPIO_TypeDef *gpio_port, uint16_t pin)
static void _putc(void *p, char c)
bool read_config(uint8_t *data, uint32_t len)
bool write_config(const uint8_t *data, const uint32_t len)
void put_byte(uint8_t ch) override
void init_printf(void *putp, void(*putf)(void *, char))
void init(const spi_hardware_struct_t *conf)
const spi_hardware_struct_t spi_config[NUM_SPI]