43 static void _putc(
void* p,
char c)
51 uint8_t magic_BE = 0xBE;
52 uint8_t big_array[2048];
53 uint8_t magic_AC = 0xAC;
54 uint8_t big_array2[2048];
55 uint8_t magic_D3 = 0xD3;
62 static uint8_t config_buffer[
sizeof(
config_t)];
73 for (
int i = 0;
i < 2048;
i++)
75 config_file.
big_array[
i] = (uint8_t)std::rand();
92 for (uint8_t* p = (uint8_t*)&config_file; p < (uint8_t*)&config_file +
sizeof(config_file); p++)
96 config_file.
crc = crc;
100 bool success =
false;
113 for (uint8_t* p = (uint8_t*)config_ptr; p < (uint8_t*)config_ptr +
sizeof(config_file); p++)
131 uint32_t size =
sizeof(config_file);
135 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(const spi_hardware_struct_t *conf)
const spi_hardware_struct_t spi_config[NUM_SPI]
void init_printf(void *putp, void(*putf)(void *, char))