![]() |
PDL for FM4
Version1.2
Peripheral Driverl Library for FM4
|
Data Structures | |
| struct | stc_extif_arrays |
| Definition of MODE, TIM, AREA, ATIM register arrays. More... | |
| struct | stc_extif_area_config |
| Extif area configuration. More... | |
| struct | stc_extif_intern_data |
| EXTIF Error Interrupt Callback Pointers. More... | |
Macros | |
| #define | EXTIF (*((stc_extif_arrays_t *) FM4_EXBUS_BASE)) |
| #define | EXITIF_NAND_ALE_OFFSET 0x00003000ul |
| Address offset for MNALE assert until write. More... | |
| #define | EXITIF_NAND_ADDR_OFFSET 0x00002000ul |
| Address offset for address cycle (+ MNALE) More... | |
| #define | EXITIF_NAND_CMD_OFFSET 0x00001000ul |
| Address offset for command cycle (+ MNCLE) More... | |
| #define | EXITIF_NAND_DATA_OFFSET 0x00000000ul |
| Address offset for data read/write. More... | |
| #define | Extif_Nand_SetCommand(base, cmd) {*(volatile unsigned char*)((base) + EXITIF_NAND_CMD_OFFSET) = (unsigned char)(cmd);} |
| Sets a NAND command cycle. More... | |
| #define | Extif_Nand_SetAddress(base, addr) {*(volatile unsigned char*)((base) + EXITIF_NAND_ADDR_OFFSET) = (unsigned char)(addr);} |
| Sets a NAND address cycle. More... | |
| #define | Extif_Nand_ReadData(base) (*(volatile unsigned char*)((base) + EXITIF_NAND_DATA_OFFSET)) |
| Reads NAND data. More... | |
| #define | Extif_Nand_WriteData(base, data) {*(volatile unsigned char*)((base) + EXITIF_NAND_DATA_OFFSET) = (unsigned char)(data);} |
| Writes NAND data. More... | |
| #define | Extif_Nand_ClearAle(base) {*(volatile unsigned char*)((base) + EXITIF_NAND_ALE_OFFSET) = (unsigned char)0;} |
| De-asserts MNALE signal. More... | |
Typedefs | |
| typedef struct stc_extif_arrays | stc_extif_arrays_t |
| Definition of MODE, TIM, AREA, ATIM register arrays. More... | |
| typedef enum en_extif_width | en_extif_width_t |
| Extif data width. More... | |
| typedef enum en_extif_cycle | en_extif_cycle_t |
| Extif cycle defintion. More... | |
| typedef enum en_extif_mask | en_extif_mask_t |
| Extif mask setup (area size) More... | |
| typedef enum en_extif_cas | en_extif_cas_t |
| Extif CAS address select. More... | |
| typedef enum en_extif_ras | en_extif_ras_t |
| Extif RAS address select. More... | |
| typedef enum en_extif_bas | en_extif_bas_t |
| Extif BAS address select. More... | |
| typedef struct stc_extif_area_config | stc_extif_area_config_t |
| Extif area configuration. More... | |
| typedef struct stc_extif_intern_data | stc_extif_intern_data_t |
| EXTIF Error Interrupt Callback Pointers. More... | |
Functions | |
| void | ExtifIrqHandler (void) |
| External Bus Interface Error Interrupt Service Routine. More... | |
| en_result_t | Extif_InitArea (uint8_t u8Area, stc_extif_area_config_t *pstcConfig) |
| Setup (init) an EXT-I/F area. More... | |
| en_result_t | Extif_ReadErrorStatus (void) |
| Read Error Status Register. More... | |
| uint32_t | Extif_ReadErrorAddress (void) |
| Read Error Address Register. More... | |
| en_result_t | Extif_ClearErrorStatus (void) |
| Clear Error Status Register. More... | |
| en_result_t | Extif_CheckSdcmdReady (void) |
| Check SDRAM command register is ready. More... | |
| en_result_t | Extif_SetSdramCommand (uint16_t u16Address, boolean_t bMsdwex, boolean_t bMcasx, boolean_t bMrasx, boolean_t bMcsx8, boolean_t bMadcke) |
| Set a SDRAM command. More... | |
Variables | |
| stc_extif_intern_data_t | stcExtifInternData |
Provided functions of EXTIF module:
Extif_InitArea() initializes an area according the user configuration. Extif_ReadErrorStatus() reads out the error status of the Error Status Register (EST). Extif_ReadErrorAddress() reads out the address were the error occurred. Extif_ClearErrorStatus() clears the error status. Extif_CheckSdcmdReady() checks, if it is allowed to set a SDRAM command. Extif_SetSdramCommand() set the SDRAM command (calls Extif_CheckSdcmdReady() ).
| #define EXITIF_NAND_ADDR_OFFSET 0x00002000ul |
| #define EXITIF_NAND_ALE_OFFSET 0x00003000ul |
| #define EXITIF_NAND_CMD_OFFSET 0x00001000ul |
| #define EXITIF_NAND_DATA_OFFSET 0x00000000ul |
| #define EXTIF (*((stc_extif_arrays_t *) FM4_EXBUS_BASE)) |
Definition at line 93 of file extif.h.
Referenced by Extif_InitArea().
| #define Extif_Nand_ClearAle | ( | base | ) | {*(volatile unsigned char*)((base) + EXITIF_NAND_ALE_OFFSET) = (unsigned char)0;} |
| #define Extif_Nand_ReadData | ( | base | ) | (*(volatile unsigned char*)((base) + EXITIF_NAND_DATA_OFFSET)) |
| #define Extif_Nand_SetAddress | ( | base, | |
| addr | |||
| ) | {*(volatile unsigned char*)((base) + EXITIF_NAND_ADDR_OFFSET) = (unsigned char)(addr);} |
| #define Extif_Nand_SetCommand | ( | base, | |
| cmd | |||
| ) | {*(volatile unsigned char*)((base) + EXITIF_NAND_CMD_OFFSET) = (unsigned char)(cmd);} |
| #define Extif_Nand_WriteData | ( | base, | |
| data | |||
| ) | {*(volatile unsigned char*)((base) + EXITIF_NAND_DATA_OFFSET) = (unsigned char)(data);} |
| typedef enum en_extif_bas en_extif_bas_t |
Extif BAS address select.
Select the address for the Bank Address Select
| typedef enum en_extif_cas en_extif_cas_t |
Extif CAS address select.
Select the address for the Column Address Select
| typedef enum en_extif_cycle en_extif_cycle_t |
Extif cycle defintion.
To select the bus mode of the interface.
| typedef enum en_extif_mask en_extif_mask_t |
Extif mask setup (area size)
To select the Mask Setup value for the address area per chip select.
| typedef enum en_extif_ras en_extif_ras_t |
Extif RAS address select.
Select the address for the Row Address Select
| typedef enum en_extif_width en_extif_width_t |
Extif data width.
To select the data bus width
| typedef struct stc_extif_area_config stc_extif_area_config_t |
Extif area configuration.
The WDG configuration is done on a per area (Chip select) basis
| typedef struct stc_extif_arrays stc_extif_arrays_t |
Definition of MODE, TIM, AREA, ATIM register arrays.
To select the data bus width
| typedef struct stc_extif_intern_data stc_extif_intern_data_t |
EXTIF Error Interrupt Callback Pointers.
| enum en_extif_bas |
Extif BAS address select.
Select the address for the Bank Address Select
| enum en_extif_cas |
Extif CAS address select.
Select the address for the Column Address Select
| Enumerator | |
|---|---|
| ExtifCas16Bit |
MAD[9:0] = Internal address [10:1], 16-Bit width. |
| ExtifCas32Bit |
MAD[9:0] = Internal address [11:2], 32-Bit width. |
| enum en_extif_cycle |
Extif cycle defintion.
To select the bus mode of the interface.
| enum en_extif_mask |
Extif mask setup (area size)
To select the Mask Setup value for the address area per chip select.
| enum en_extif_ras |
Extif RAS address select.
Select the address for the Row Address Select
| enum en_extif_width |
| en_result_t Extif_CheckSdcmdReady | ( | void | ) |
Check SDRAM command register is ready.
| Ok | Writing to SDCMD register is possible |
| ErrorNotReady | Access to SDCMD register not possible |
Definition at line 468 of file extif.c.
References ErrorNotReady, Ok, and TRUE.
Referenced by Extif_SetSdramCommand().

| en_result_t Extif_ClearErrorStatus | ( | void | ) |
| en_result_t Extif_InitArea | ( | uint8_t | u8Area, |
| stc_extif_area_config_t * | pstcConfig | ||
| ) |
Setup (init) an EXT-I/F area.
| u8Area | Extbus I/F area (chip select) number |
| pstcConfig | Pointer to area configuration |
| Ok | Setup successful |
| ErrorInvalidParameter | pstcConfig == NULL, Area number wrong, other invalid setting. |
| ErrorInvalidMode | SDMODE is set for area different from 8 |
Definition at line 137 of file extif.c.
References stc_extif_area_config::bAddrOnDataLinesOff, stc_extif_area_config::bAleInvert, stc_extif_area_config::bMclkoutEnable, stc_extif_area_config::bMoexWidthAsFradc, stc_extif_area_config::bMpxcsOff, stc_extif_area_config::bMultiplexMode, stc_extif_area_config::bNandFlash, stc_extif_area_config::bPageAccess, stc_extif_area_config::bPrecedReadContinuousWrite, stc_extif_area_config::bRdyOn, stc_extif_area_config::bReadByteMask, stc_extif_area_config::bRefreshEnable, stc_extif_area_config::bSdramEnable, stc_extif_area_config::bSdramErrorInterruptEnable, stc_extif_intern_data::bSdramErrorInterruptEnable, stc_extif_area_config::bSdramPowerDownMode, stc_extif_area_config::bSdramRefreshOff, stc_extif_area_config::bSramFlashErrorInterruptEnable, stc_extif_intern_data::bSramFlashErrorInterruptEnable, stc_extif_area_config::bStopDataOutAtFirstIdle, stc_extif_area_config::bWriteEnableOff, stc_extif_area_config::enAddressLatchCycle, stc_extif_area_config::enAddressLatchWidthCycle, stc_extif_area_config::enAreaMask, stc_extif_area_config::enBasel, stc_extif_area_config::enCasel, stc_extif_area_config::enFirstReadAddressCycle, stc_extif_area_config::enRasel, stc_extif_area_config::enReadAccessCycle, stc_extif_area_config::enReadAddressSetupCycle, stc_extif_area_config::enReadIdleCycle, stc_extif_area_config::enSdramCasLatencyCycle, stc_extif_area_config::enSdramPrechargeCycle, stc_extif_area_config::enSdramRasActiveCycle, stc_extif_area_config::enSdramRasCasDelayCycle, stc_extif_area_config::enSdramRasCycle, stc_extif_area_config::enSdramRasPrechargeCycle, stc_extif_area_config::enSdramRefreshCycle, stc_extif_area_config::enWidth, stc_extif_area_config::enWriteAccessCycle, stc_extif_area_config::enWriteAddressSetupCycle, stc_extif_area_config::enWriteEnableCycle, stc_extif_area_config::enWriteIdleCycle, ErrorInvalidMode, ErrorInvalidParameter, EXTIF, Extif0Cycle, Extif16Bit, Extif16Cycle, Extif1Cycle, Extif2Cycle, Extif8Bit, ExtifCas16Bit, ExtifCas32Bit, ExtifDisabled, FALSE, Ok, PDL_IRQ_LEVEL_EXTIF, PDL_ZERO_STRUCT, stc_extif_area_config::pfnSdramErrorCallback, stc_extif_intern_data::pfnSdramErrorCallback, stc_extif_area_config::pfnSramFlashErrorCallback, stc_extif_intern_data::pfnSramFlashErrorCallback, TRUE, stc_extif_area_config::u16PowerDownCount, stc_extif_area_config::u16RefreshCount, stc_extif_area_config::u8AreaAddress, stc_extif_area_config::u8MclkDivision, and stc_extif_area_config::u8RefreshNumber.
| uint32_t Extif_ReadErrorAddress | ( | void | ) |
| en_result_t Extif_ReadErrorStatus | ( | void | ) |
| en_result_t Extif_SetSdramCommand | ( | uint16_t | u16Address, |
| boolean_t | bMsdwex, | ||
| boolean_t | bMcasx, | ||
| boolean_t | bMrasx, | ||
| boolean_t | bMcsx8, | ||
| boolean_t | bMadcke | ||
| ) |
Set a SDRAM command.
| u16Address | SDRAM address (MAD[15:00] pin values) |
| bMsdwex | MDSWEX pin value |
| bMcasx | MCASX pin value |
| bMrasx | MRASX pin value |
| bMcsx8 | MCSX8 pin value |
| bMadcke | MADCKE pin value |
| Ok | Writing to SDCMD register was successful |
| ErrorNotReady | Access to SDCMD register was not possible |
Definition at line 494 of file extif.c.
References ErrorNotReady, Extif_CheckSdcmdReady(), and Ok.

| void ExtifIrqHandler | ( | void | ) |
External Bus Interface Error Interrupt Service Routine.
This function provides the user callback functions, if defined.
Definition at line 102 of file extif.c.
References stc_extif_intern_data::bSdramErrorInterruptEnable, stc_extif_intern_data::bSramFlashErrorInterruptEnable, stc_extif_intern_data::pfnSdramErrorCallback, stc_extif_intern_data::pfnSramFlashErrorCallback, and TRUE.
| stc_extif_intern_data_t stcExtifInternData |