📄 mx21_max.h
字号:
/**********************************************************************
*
* (C) COPYRIGHT 2004 FREESCALE, INC.
* ALL RIGHTS RESERVED
*
*
* Group/Division: WMSG/MMDO
*
* Description:
*
* Related Specifications:
*
* Errata:
*
* File Name: MX21_MAX.h
* Revision Number: 0.1
* Author(s): Sharad Kumar
* Date created: 30Apr2004
* Revision History:
* Date Rev Description
* ---- --- -----------
* 30Apr04 0.1 First draft
*
**********************************************************************/
#ifndef _MX21_MAX_H
#define _MX21_MAX_H
#include "MX21_DataTypes.h"
#include "MX21_Macros.h"
#include "MX21_MemMap.h"
#include "MX21_Common.h"
/********************************************************************
M A C R O S
*********************************************************************/
#define MAX_NO_MASTERS 6
#define MAX_NO_SLAVES 4
// 3 bit mask for master priority
// fields in MAX_MPRx and MAX_AMPRx fields
#define MAX_MSTR_MASK 0x7
// offsets for master priority
// fields in MAX_MPRx and MAX_AMPRx
#define MAX_MSTR0_OFFSET 0
#define MAX_MSTR1_OFFSET 4
#define MAX_MSTR2_OFFSET 8
#define MAX_MSTR3_OFFSET 12
#define MAX_MSTR4_OFFSET 16
#define MAX_MSTR5_OFFSET 20
// typedef for MAX masters
typedef enum
{
MAX_MASTER0 = 0,
MAX_MASTER1 = 1,
MAX_MASTER2 = 2,
MAX_MASTER3 = 3,
MAX_MASTER4 = 4,
MAX_MASTER5 = 5
} max_masters;
// typedef for MAX slaves
typedef enum
{
MAX_SLAVE0 = 0,
MAX_SLAVE1 = 1,
MAX_SLAVE2 = 2,
MAX_SLAVE3 = 3
} max_slaves;
// structure to specify a slave,
// and the master priority order
// associated with it
typedef struct
{
const max_slaves SlaveName;
const max_masters* MasterPriority;
} max_slave_config;
// typedef for arbitration modes
typedef enum
{
MAX_ARB_PAGE = 0,
MAX_ARB_1 = 1,
MAX_ARB_4 = 2,
MAX_ARB_8 = 3,
MAX_ARB_16 = 4
} max_arb_modes;
/********************************************************************
M A X F U N C T I O N S
*********************************************************************/
//---------------------------------------------------
// configure master priority for a single MAX Slave port,
// MAX_SLV0_MPR0 - MAX_SLV3_MPR3. Specify the MAX slave port
// as the first argument, and a priority list of masters as the
// second parameter. Refer to the typedef declaration for
// max_slaves and max_masters
//---------------------------------------------------
void
MAX_ConfigSlv(max_slaves, // slave port
max_masters*); // master priority for slave
//---------------------------------------------------
// Configure slave port control vector (SGPCR0-SGPCR3)
//---------------------------------------------------
void
MAX_ConfigSlvControl (max_slaves, // slave port
uint32_t); // control vector
//---------------------------------------------------
// configure all MAX Slave ports. Uses the
// following functions:
// MAX_ConfigSlvControl (...);
// MAX_ConfigSlv(...);
//---------------------------------------------------
void
MAX_ConfigAll_Slv(max_masters*, // master priority
uint32_t*); // slave control vector array
//---------------------------------------------------
// configure alternate master priority for a single MAX Slave port,
// MAX_SLV0_AMPR0 - MAX_SLV3_AMPR3. Specify the MAX slave port
// as the first argument, and a priority list of masters as the
// second parameter. Refer to the typedef declaration for
// max_slaves and max_masters
//---------------------------------------------------
void
MAX_ConfigAltSlv(max_slaves, // slave port
max_masters*); // master priority for slave
//---------------------------------------------------
// configure alternate slave port (ASGPCR0-ASGPCR3)
// control vector
//---------------------------------------------------
void
MAX_ConfigAltSlvControl (max_slaves, // alt slave port
uint32_t); // control vector
//---------------------------------------------------
// configure all alternate MAX Slave ports. Uses the
// following functions:
// MAX_ConfigAltSlvControl (...)
// MAX_ConfigAltSlv(...)
//---------------------------------------------------
void
MAX_ConfigAll_AltSlv(max_masters*, // alt master priority
uint32_t*); // alt slave control vector array
//---------------------------------------------------
// configure arbitration modes for a master, MGPCRx
//---------------------------------------------------
void
MAX_ConfigArbMode(max_masters, // master
max_arb_modes); // arbitration mode
//---------------------------------------------------
// configure MAX arbitration modes
// for all masters. max_arb_mode[i] corresponds
// to master(i), MGPCR0-MGPCR5
//---------------------------------------------------
void
MAX_ConfigAll_ArbModes(max_arb_modes*);
//---------------------------------------------------
// configure MAX
//---------------------------------------------------
void
MAX_Configure(max_masters*, // master priority
max_masters*, // alt master priority
uint32_t*, // slave control vector
uint32_t*, // alt slave control vector
max_arb_modes*); // master arbitration modes
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -