Microchip® Advanced Software Framework

Quick Start Guide for the HMATRIX driver

This is the quick start guide for the HSB BUS Matrix (HMATRIX), with step-by-step instructions on how to configure and use the driver for a specific use case.The code examples can be copied into e.g the main application loop or any other function that will need to control the HMATRIX module.

Use cases

HMATRIX Basic Usage

This use case will demonstrate how to configurate the HMATRIX module to set the slave with different default master type.

Setup steps

Prerequisites

This module requires the following service

Code

Add this to the main loop or a setup function:

Workflow

  1. Enable the HMATRIX module
  2. Get the default slave channel setting

Usage steps

Code

  1. We can set slave with Round-Robin arbitration and without default master
  2. Or Set slave with Round-Robin arbitration and with last access master

We can set priority of each master for one slave by

HmatrixbPrs prio;
prio.HMATRIXB_PRAS = 0x00111111;
prio.HMATRIXB_PRBS = 0x00000000;
hmatrix_set_slave_priority(ul_slave_id, &prio);