/* Return the pointer to register settings of specific SERCOM.  */
static const struct sercomspi_regs_cfg* _spi_get_regs(const uint32_t hw_addr)
/* Return the pointer to register settings of specific SERCOM.  */
static const struct sercomspi_regs_cfg* _spi_get_regs(const uint32_t hw_addr)
{
	uint8_t n = _sercom_get_hardware_index((const void *)hw_addr);
	uint8_t i;
	for (i = 0; i < sizeof(sercomspi_regs) / sizeof(struct sercomspi_regs_cfg); i++) {
		if (sercomspi_regs[i].n == n) {
			return &sercomspi_regs[i];
		}
	}
	return NULL;
}