113 uint16_t page_len = 256;
114 if (
i == num_pages_for_config_ - 1)
115 page_len = len % 256;
119 uint8_t
addr[4] = {
PAGE_PROGRAM,
static_cast<uint8_t
>(
i >> 8), static_cast<uint8_t>(
i & 0xFF), 0};
bool transfer(uint8_t *out_data, uint32_t num_bytes, uint8_t *in_data, GPIO *cs=NULL, void(*cb)(void)=NULL)
bool write(const uint8_t *out_data, uint32_t num_bytes, GPIO *cs=NULL)
static volatile uint8_t * status
uint32_t num_pages_for_config_
void init(GPIO_TypeDef *BasePort, uint16_t pin, gpio_mode_t mode)
bool read_config(uint8_t *data, uint32_t len)
static volatile uint8_t addr
bool write_config(const uint8_t *data, const uint32_t len)
uint8_t transfer_byte(uint8_t data, GPIO *cs=NULL)
void set_divisor(uint16_t new_divisor)