📄 moto_flash_a.h
字号:
/**********************************************************************/
/* File: moto_flash_a.h */
/* */
/* (C) Copyright Motorola Inc, 2000. All rights reserved. */
/* */
/* $RCSfile: moto_flash_a.h,v $ */
/* $Revision: 1.2 $ */
/* $Date: 2000/06/23 23:12:14 $ */
/* $Author: jeffk $ */
/* */
/**********************************************************************/
/**********************************************************************/
/* Changes made 06/05/00 by twagner: */
/* - added MOTO_FLASH_A_Boolean_t enum type */
/* - added MOTO_FLASH_A_ReturnCode_t enum type */
/* - references to ddBoolean changed to MOTO_FLASH_A_Boolean_t */
/* (prototypes to GetHighVoltageEnableStatus and GetPulseStatus */
/* changed) */
/* - MOTO_FLASH_A_RegisterSwitch_t changed to MOTO_FLASH_A_Register_t*/
/* (prototypes and macros to SetRegister and GetRegister changed) */
/* - common (DD) return codes changed to MOTO_FLASH_A return codes */
/* (changed all macros) */
/* - ddErr_t changed to MOTO_FLASH_A_ReturnCode_t in all prototypes */
/**********************************************************************/
#ifndef _MOTO_FLASH_A_H
#define _MOTO_FLASH_A_H
#include "mcore.h"
#define MOTO_FLASH_A_ERR_HIGH_VOLTAGE_OPERATIONS_DISABLED 0xFFFF
/* MOTO_FLASH_A_t - CMFR Register Definition */
typedef struct {
volatile UINT32 CMFRMCR; /* Module Configuration Register */
volatile UINT32 CMFRMTR; /* Module Test Register */
volatile UINT32 CMFRCTL; /* High Voltage Control Register */
} MOTO_FLASH_A_t, *pMOTO_FLASH_A_t;
/* MOTO_FLASH_A_Data_t Flash Data Array Element Definition */
typedef UINT32 MOTO_FLASH_A_Data_t; /* Flash Data Element */
/* MOTO_FLASH_A_Address_t Flash Address Element Definition */
typedef UINT32 pMOTO_FLASH_A_Address_t;
/* MOTO_FLASH_A_PulseWidth_t - CMFR Pulse Width Data Type */
typedef UINT32 MOTO_FLASH_A_PulseWidth_t;
/* MOTO_FLASH_A_SystemClock_t - CMFR System Clock Data Type */
typedef UINT32 MOTO_FLASH_A_SystemClock_t;
/* Enumerated Data Types */
/* MOTO_FLASH_A_RegisterSwitch_t - MOTO Flash Register Selection */
typedef enum
{
MOTO_FLASH_A_CMFRMCR, /* Select CMFR Module Config Reg */
MOTO_FLASH_A_CMFRMTR, /* Select CMFR Module Test Register */
MOTO_FLASH_A_CMFRCTL /* Select CMFR Control Register */
} MOTO_FLASH_A_Register_t;
/* MOTO_FLASH_A_Control_t - MOTO_FLASH_A Action Selection */
typedef enum {
MOTO_FLASH_A_ENABLE,
MOTO_FLASH_A_DISABLE
}MOTO_FLASH_A_Control_t;
/* MOTO_FLASH_A_ShadowBlock_t - MOTO_FLASH_A Shadow Block Selection */
typedef enum {
MOTO_FLASH_A_LOW_FILL_SHADOW_BLOCK = 0,
MOTO_FLASH_A_HIGH_FILL_SHADOW_BLOCK = 2
}MOTO_FLASH_A_ShadowBlock_t;
/* MOTO_FLASH_A_ShadowStartOffset_t - MOTO_FLASH_A Shadow Start Offset Selection */
typedef enum {
MOTO_FLASH_A_SHADOW_START_OFFSET_0_BYTES = 0,
MOTO_FLASH_A_SHADOW_START_OFFSET_16_BYTES = 16
}MOTO_FLASH_A_ShadowStartOffset_t;
/* MOTO_FLASH_A_ShadowEndOffset_t - MOTO_FLASH_A Shadow End Offset Selection */
typedef enum {
MOTO_FLASH_A_SHADOW_END_OFFSET_256_BYTES = 256
}MOTO_FLASH_A_ShadowEndOffset_t;
/* MOTO_FLASH_A_DataWidth_t - MOTO_FLASH_A Data Width Selection */
typedef enum {
MOTO_FLASH_A_2_BYTES, /*16 bit memory data width */
MOTO_FLASH_A_4_BYTES /* 32 bit memory data width */
} MOTO_FLASH_A_DataWidth_t;
/* MOTO_FLASH_A_BlockSize_t - MOTO_FLASH_A Block Size Selection */
typedef enum {
MOTO_FLASH_A_16K_BYTES=16384, /* 16 K memory block length */
MOTO_FLASH_A_32K_BYTES=32768 /* 32 K memory block length */
} MOTO_FLASH_A_BlockSize_t;
/* MOTO_FLASH_A_Sequence_t - MOTO_FLASH_A Sequence Start/End Selection*/
typedef enum {
MOTO_FLASH_A_START,
MOTO_FLASH_A_END
}MOTO_FLASH_A_Sequence_t;
/* MOTO_FLASH_A_Lock_t - MOTO_FLASH_A Lock Selection */
typedef enum {
MOTO_FLASH_A_LOCK,
MOTO_FLASH_A_UNLOCK
}MOTO_FLASH_A_Lock_t;
/* MOTO_FLASH_A_CycleType_t - MOTO_FLASH_A Cycle Type Selection */
typedef enum {
MOTO_FLASH_A_PROGRAM,
MOTO_FLASH_A_ERASE,
MOTO_FLASH_A_READ
}MOTO_FLASH_A_CycleType_t;
/* MOTO_FLASH_A_BlockSelect_t - MOTO_FLASH_A Block Selection */
typedef enum {
MOTO_FLASH_A_NO_BLOCK_SELECTED = 0x00, /* Nothing Selected */
MOTO_FLASH_A_BLOCK_0=0x01, /* Select BLOCK 0 */
MOTO_FLASH_A_BLOCK_1=0x02, /* Select BLOCK 1 */
MOTO_FLASH_A_BLOCK_2=0x04, /* Select BLOCK 2 */
MOTO_FLASH_A_BLOCK_3=0x08, /* Select BLOCK 3 */
MOTO_FLASH_A_BLOCK_4=0x10, /* Select BLOCK 4 */
MOTO_FLASH_A_BLOCK_5=0x20, /* Select BLOCK 5 */
MOTO_FLASH_A_BLOCK_6=0x40, /* Select BLOCK 6 */
MOTO_FLASH_A_BLOCK_7=0x80 /* Select BLOCK 7 */
} MOTO_FLASH_A_BlockSelect_t;
/* Priviledge Protection */
typedef enum {
MOTO_FLASH_A_USER_ACCESS,
MOTO_FLASH_A_SUPERVISOR_ACCESS,
MOTO_FLASH_A_NO_PRIVILEGE_CHANGE
} MOTO_FLASH_A_PrivilegeProtection_t;
/* Code/Text Protection */
typedef enum {
MOTO_FLASH_A_DATA_ACCESS,
MOTO_FLASH_A_TEXT_AND_DATA_ACCESS,
MOTO_FLASH_A_NO_TEXT_DATA_PROTECTION_CHANGE
} MOTO_FLASH_A_TextDataProtection_t;
/* Read/Write Protection */
typedef enum {
MOTO_FLASH_A_READ_ONLY,
MOTO_FLASH_A_READ_WRITE,
MOTO_FLASH_A_NO_READ_WRITE_PROTECTION_CHANGE
} MOTO_FLASH_A_ReadWriteProtection_t;
/* MOTO_FLASH_A_MaxPulses_t - Maximum Number of Program or Erase Pulses */
typedef enum {
MOTO_FLASH_A_MAX_NUMBER_PROGRAM_PULSES = 450,
MOTO_FLASH_A_MAX_NUMBER_ERASE_PULSES = 1
}MOTO_FLASH_A_MaxPulses_t;
/* MOTO_FLASH_A_Boolean_t -- Boolean Type */
typedef enum {
MOTO_FLASH_A_FALSE,
MOTO_FLASH_A_TRUE
} MOTO_FLASH_A_Boolean_t;
/* MOTO_FLASH_A_ReturnCode_t -- return codes for MOTO_FLASH_A */
typedef enum {
MOTO_FLASH_A_ERR_NONE = 0x0L, /* No error */
MOTO_FLASH_A_ERR_INVALID_HANDLE, /* Invalid device handle */
MOTO_FLASH_A_ERR_BAD_RESULT_ADDR, /* Bad result address */
MOTO_FLASH_A_ERR_INVALID_ADDRESS, /* Invalid address */
MOTO_FLASH_A_ERR_INVALID_REGISTER, /* register selection not valid */
MOTO_FLASH_A_ERR_HIGH_VOLTAGE_OPERATION_DISABLED, /* VPP Supply not available */
MOTO_FLASH_A_ERR_INVALID_BLOCK_CONFIG, /* Invalid block selected */
MOTO_FLASH_A_ERR_INVALID_BLOCK_SIZE, /* Invalid block dimension */
MOTO_FLASH_A_ERR_INVALID_SYSTEM_CLOCK, /* System clock out of range */
MOTO_FLASH_A_ERR_INVALID_PULSE_WIDTH, /* Pulse width out of range */
MOTO_FLASH_A_ERR_PULSE_ACTIVE, /* High voltage pulse is active */
MOTO_FLASH_A_ERR_INVALID_DATA_WIDTH, /* Unsupported data width */
MOTO_FLASH_A_ERR_INVALID_DATA_LENGTH, /* Unsupported data length */
MOTO_FLASH_A_ERR_INVALID_CYCLE_TYPE, /* Cycle type specified is invalid */
MOTO_FLASH_A_ERR_INVALID_PROTECTION, /* Access protection specified is invalid */
MOTO_FLASH_A_ERR_INVALID_SHADOW_BLOCK, /* Shadow Block number specified is invalid */
MOTO_FLASH_A_ERR_INVALID_SHADOW_OFFSET, /* invalid shadow information start or end offset */
MOTO_FLASH_A_ERR_INVALID_MAX_PULSES, /* Number of high voltage pulses out of range */
MOTO_FLASH_A_ERR_INVALID_DEVICE_COUNT, /* Number of parallel arrays present is out of range */
MOTO_FLASH_A_ERR_ARRAY_ERASE_FAILURE, /* Margin read verify failed during array erase */
MOTO_FLASH_A_ERR_SHADOW_ERASE_FAILURE, /* Margin read verify failed during shadow erase */
MOTO_FLASH_A_ERR_PROGRAM_FAILURE, /* Margin read verify failed during programming */
MOTO_FLASH_A_ERR_DEVICE_NOT_BLANK, /* The device isn't blank */
MOTO_FLASH_A_ERR_PROGRAMMING_FUSES, /* Could not reprogram fuses */
MOTO_FLASH_A_ERR_INVALID_MODE /* Invalid mode specified */
} MOTO_FLASH_A_ReturnCode_t;
/* Register Macros */
/* CMFR Module Configuration Register (CMFRMCR) */
#define CMFR_BLOCK_FIELD_MAX 255
#define CMFRMCR_PROTECT_BITNO 0 /* Read Only/Write Blk Protection */
#define CMFRMCR_PROTECT_MASK (CMFR_BLOCK_FIELD_MAX <<CMFRMCR_PROTECT_BITNO)
#define CMFRMCR_DATA_BITNO 8 /* Text/DataText Blk Protection */
#define CMFRMCR_DATA_MASK (CMFR_BLOCK_FIELD_MAX << CMFRMCR_DATA_BITNO)
#define CMFRMCR_SUPV_BITNO 16 /* Supervisor/User Blk Protection */
#define CMFRMCR_SUPV_MASK (CMFR_BLOCK_FIELD_MAX << CMFRMCR_SUPV_BITNO)
#define CMFRMCR_BOOT_BITNO 24 /* Bootstrap Enable */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -