static void matrix_init(void) { // The ATSAM sram is in a "no default master" state at reset // (despite the specs). That typically adds 1 wait cycle to every // memory access. Set it to "last access master" to avoid that. MATRIX->MATRIX_SCFG[0] = (MATRIX_SCFG_SLOT_CYCLE(64) | MATRIX_SCFG_DEFMSTR_TYPE(1)); }
/** * \brief Set slot cycle of the specified slave. * * \param ul_id Slave index. * \param ul_slot_cycle Number of slot cycle. */ void matrix_set_slave_slot_cycle(uint32_t ul_id, uint32_t ul_slot_cycle) { Matrix *p_matrix = MATRIX; volatile uint32_t ul_reg; ul_reg = p_matrix->MATRIX_SCFG[ul_id] & (~MATRIX_SCFG_SLOT_CYCLE_Msk); p_matrix->MATRIX_SCFG[ul_id] = ul_reg | MATRIX_SCFG_SLOT_CYCLE( ul_slot_cycle); }