Microchip® Advanced Software Framework

hmatrixb.h File Reference

HMATRIX driver for SAM.

Copyright (c) 2012-2018 Microchip Technology Inc. and its subsidiaries.

#include "compiler.h"

Data Structures

struct  hmatrix_master_ch_conf
 HMatrix Master Channel configuration structure. More...
 
struct  hmatrix_slave_ch_conf
 HMatrix Slave Channel configuration structure. More...
 

Macros

#define hmatrix_prs   HmatrixbPrs
 

Enumerations

enum  hmatrix_arbitration_type {
  HMATRIX_ARBITRATION_ROUND_ROBIN = HMATRIXB_SCFG_ARBT_ROUND_ROBIN,
  HMATRIX_ARBITRATION_FIXED_PRIORITY = HMATRIXB_SCFG_ARBT_FIXED_PRIORITY
}
 HMATRIX slave: arbitration type. More...
 
enum  hmatrix_burst_type {
  HMATRIX_BURST_INFINITE_LENGTH = HMATRIXB_MCFG_ULBT(0),
  HMATRIX_BURST_SINGLE_ACCESS = HMATRIXB_MCFG_ULBT(1),
  HMATRIX_BURST_FOUR_BEAT = HMATRIXB_MCFG_ULBT(2),
  HMATRIX_BURST_EIGHT_BEAT = HMATRIXB_MCFG_ULBT(3),
  HMATRIX_BURST_SIXTEEN_BEAT = HMATRIXB_MCFG_ULBT(4)
}
 HMATRIX master: undefined length burst type. More...
 
enum  hmatrix_def_master_type {
  HMATRIX_DEFAULT_MASTER_NONE = HMATRIXB_SCFG_DEFMSTR_TYPE(0),
  HMATRIX_DEFAULT_MASTER_PREVIOUS = HMATRIXB_SCFG_DEFMSTR_TYPE(1),
  HMATRIX_DEFAULT_MASTER_FIXED = HMATRIXB_SCFG_DEFMSTR_TYPE(2)
}
 HMATRIX slave: default master type. More...
 
enum  hmatrix_master_id {
  HMATRIX_MASTER_ID_CPU_IDCORE = HMATRIX_MASTER_CPU_IDCODE,
  HMATRIX_MASTER_ID_CPU_SYS = HMATRIX_MASTER_CPU_SYS,
  HMATRIX_MASTER_ID_SMAP = HMATRIX_MASTER_SMAP,
  HMATRIX_MASTER_ID_PDC = HMATRIX_MASTER_PDCA,
  HMATRIX_MASTER_ID_USB = HMATRIX_MASTER_USBC_MASTER,
  HMATRIX_MASTER_ID_CRCCU = HMATRIX_MASTER_CRCCU,
  HMATRIX_MASTER_ID_NUM
}
 Master identifier. More...
 
enum  hmatrix_slave_id {
  HMATRIX_SLAVE_ID_FLASH = HMATRIX_SLAVE_FLASH,
  HMATRIX_SLAVE_ID_PBA = HMATRIX_SLAVE_HTOP0,
  HMATRIX_SLAVE_ID_PBB = HMATRIX_SLAVE_HTOP1,
  HMATRIX_SLAVE_ID_PBC = HMATRIX_SLAVE_HTOP2,
  HMATRIX_SLAVE_ID_PBD = HMATRIX_SLAVE_HTOP3,
  HMATRIX_SLAVE_ID_HRAMC0 = HMATRIX_SLAVE_HRAMC0,
  HMATRIX_SLAVE_ID_HRAMC1 = HMATRIX_SLAVE_HRAMC1,
  HMATRIX_SLAVE_ID_AES = HMATRIX_SLAVE_AESA,
  HMATRIX_SLAVE_ID_NUM
}
 Slave identifier. More...
 

Functions

void hmatrix_disable (void)
 Disables the HMatrix. More...
 
void hmatrix_enable (void)
 Enables the HMatrix. More...
 
void hmatrix_get_slave_priority (enum hmatrix_slave_id slave_id, hmatrix_prs *p_prio)
 Get priority for the specified slave access. More...
 
void hmatrix_init (void)
 Initializes the HMatrix. More...
 
static void hmatrix_master_ch_get_config_defaults (struct hmatrix_master_ch_conf *const config)
 Initializes an HMatrix Master configuration structure to defaults. More...
 
void hmatrix_master_ch_set_config (const enum hmatrix_master_id master_id, struct hmatrix_master_ch_conf *const config)
 Writes an HMatrix Master channel configuration to the hardware module. More...
 
void hmatrix_set_slave_priority (enum hmatrix_slave_id slave_id, hmatrix_prs *p_prio)
 Set priority for the specified slave access. More...
 
static void hmatrix_slave_ch_get_config_defaults (struct hmatrix_slave_ch_conf *const config)
 Initializes an HMatrix Slave configuration structure to defaults. More...
 
void hmatrix_slave_ch_set_config (const enum hmatrix_slave_id slave_id, struct hmatrix_slave_ch_conf *const config)
 Writes an HMatrix Slave channel configuration to the hardware module. More...
 

#define hmatrix_prs   HmatrixbPrs

HMATRIX slave: arbitration type.

Enumerator
HMATRIX_ARBITRATION_ROUND_ROBIN 
HMATRIX_ARBITRATION_FIXED_PRIORITY 

HMATRIX master: undefined length burst type.

Enumerator
HMATRIX_BURST_INFINITE_LENGTH 
HMATRIX_BURST_SINGLE_ACCESS 
HMATRIX_BURST_FOUR_BEAT 
HMATRIX_BURST_EIGHT_BEAT 
HMATRIX_BURST_SIXTEEN_BEAT 

HMATRIX slave: default master type.

Enumerator
HMATRIX_DEFAULT_MASTER_NONE 
HMATRIX_DEFAULT_MASTER_PREVIOUS 
HMATRIX_DEFAULT_MASTER_FIXED 

Master identifier.

Enumerator
HMATRIX_MASTER_ID_CPU_IDCORE 
HMATRIX_MASTER_ID_CPU_SYS 
HMATRIX_MASTER_ID_SMAP 
HMATRIX_MASTER_ID_PDC 
HMATRIX_MASTER_ID_USB 
HMATRIX_MASTER_ID_CRCCU 
HMATRIX_MASTER_ID_NUM 

Slave identifier.

Enumerator
HMATRIX_SLAVE_ID_FLASH 
HMATRIX_SLAVE_ID_PBA 
HMATRIX_SLAVE_ID_PBB 
HMATRIX_SLAVE_ID_PBC 
HMATRIX_SLAVE_ID_PBD 
HMATRIX_SLAVE_ID_HRAMC0 
HMATRIX_SLAVE_ID_HRAMC1 
HMATRIX_SLAVE_ID_AES 
HMATRIX_SLAVE_ID_NUM 

static void hmatrix_master_ch_get_config_defaults ( struct hmatrix_master_ch_conf *const  config)
inlinestatic

Initializes an HMatrix Master configuration structure to defaults.

Initializes a given HMatrix Master channel configuration structure to a set of known default values. This function should be called on all new instances of these configuration structures before being modified by the user application.

The default configuration is as follows:

  • Master channel Undefined Length Burst type is split into a sixteen-beat burst, allowing re-arbitration at each sixteen-beat burst end
Parameters
configConfiguration structure to initialize to default values

References Assert, hmatrix_master_ch_conf::burst_type, and HMATRIX_BURST_FOUR_BEAT.

Referenced by run_hmatrix_test_arbitration(), run_hmatrix_test_master(), and run_hmatrix_test_slave().

static void hmatrix_slave_ch_get_config_defaults ( struct hmatrix_slave_ch_conf *const  config)
inlinestatic

Initializes an HMatrix Slave configuration structure to defaults.

Initializes a given HMatrix Slave channel configuration structure to a set of known default values. This function should be called on all new instances of these configuration structures before being modified by the user application.

The default configuration is as follows:

  • Slave channel arbitration is round robin
  • Slave channel is configured on last default master
  • Slave channel slot cycle is 16
Parameters
configConfiguration structure to initialize to default values

References hmatrix_slave_ch_conf::arbitration_type, Assert, hmatrix_slave_ch_conf::def_master_type, hmatrix_slave_ch_conf::fixed_def_master_number, HMATRIX_ARBITRATION_ROUND_ROBIN, HMATRIX_DEFAULT_MASTER_PREVIOUS, HMATRIX_MASTER_ID_CPU_IDCORE, and hmatrix_slave_ch_conf::slot_cycle.

Referenced by run_hmatrix_test_arbitration(), run_hmatrix_test_master(), and run_hmatrix_test_slave().