| M480 BSP V3.05.001 The Board Support Package for M480 Series

Macros | Functions
EBI Exported Functions
Standard Driver » EBI Driver

## Macros
#define | EBI0_READ_DATA8(u32Addr)
| Read 8-bit data on EBI bank0. More...
#define | EBI0_WRITE_DATA8(u32Addr, u32Data)
| Write 8-bit data to EBI bank0. More...
#define | EBI0_READ_DATA16(u32Addr)
| Read 16-bit data on EBI bank0. More...
#define | EBI0_WRITE_DATA16(u32Addr, u32Data)
| Write 16-bit data to EBI bank0. More...
#define | EBI0_READ_DATA32(u32Addr)
| Read 32-bit data on EBI bank0. More...
#define | EBI0_WRITE_DATA32(u32Addr, u32Data)
| Write 32-bit data to EBI bank0. More...
#define | EBI1_READ_DATA8(u32Addr)
| Read 8-bit data on EBI bank1. More...
#define | EBI1_WRITE_DATA8(u32Addr, u32Data)
| Write 8-bit data to EBI bank1. More...
#define | EBI1_READ_DATA16(u32Addr)
| Read 16-bit data on EBI bank1. More...
#define | EBI1_WRITE_DATA16(u32Addr, u32Data)
| Write 16-bit data to EBI bank1. More...
#define | EBI1_READ_DATA32(u32Addr)
| Read 32-bit data on EBI bank1. More...
#define | EBI1_WRITE_DATA32(u32Addr, u32Data)
| Write 32-bit data to EBI bank1. More...
#define | EBI2_READ_DATA8(u32Addr)
| Read 8-bit data on EBI bank2. More...
#define | EBI2_WRITE_DATA8(u32Addr, u32Data)
| Write 8-bit data to EBI bank2. More...
#define | EBI2_READ_DATA16(u32Addr)
| Read 16-bit data on EBI bank2. More...
#define | EBI2_WRITE_DATA16(u32Addr, u32Data)
| Write 16-bit data to EBI bank2. More...
#define | EBI2_READ_DATA32(u32Addr)
| Read 32-bit data on EBI bank2. More...
#define | EBI2_WRITE_DATA32(u32Addr, u32Data)
| Write 32-bit data to EBI bank2. More...
#define | EBI_ENABLE_WRITE_BUFFER()
| Enable EBI Write Buffer. More...
#define | EBI_DISABLE_WRITE_BUFFER()
| Disable EBI Write Buffer. More...

## Functions
void | EBI_Open (uint32_t u32Bank, uint32_t u32DataWidth, uint32_t u32TimingClass, uint32_t u32BusMode, uint32_t u32CSActiveLevel)
| Initialize EBI for specify Bank. More...
void | EBI_Close (uint32_t u32Bank)
| Disable EBI on specify Bank. More...
void | EBI_SetBusTiming (uint32_t u32Bank, uint32_t u32TimingConfig, uint32_t u32MclkDiv)
| Set EBI Bus Timing for specify Bank. More...

## Detailed Description

## Macro Definition Documentation

## ◆ EBI0_READ_DATA16

#define EBI0_READ_DATA16 | ( |  | u32Addr | ) |

Read 16-bit data on EBI bank0.

Parameters

  [in] | u32Addr | The data address on EBI bank0.

Returns
  16-bit Data

This macro is used to read 16-bit data from specify address on EBI bank0.

Definition at line 122 of file ebi.h.

## ◆ EBI0_READ_DATA32

#define EBI0_READ_DATA32 | ( |  | u32Addr | ) |

Read 32-bit data on EBI bank0.

Parameters

  [in] | u32Addr | The data address on EBI bank0.

Returns
  32-bit Data

This macro is used to read 32-bit data from specify address on EBI bank0.

Definition at line 147 of file ebi.h.

## ◆ EBI0_READ_DATA8

#define EBI0_READ_DATA8 | ( |  | u32Addr | ) |

Read 8-bit data on EBI bank0.

Parameters

  [in] | u32Addr | The data address on EBI bank0.

Returns
  8-bit Data

This macro is used to read 8-bit data from specify address on EBI bank0.

Definition at line 97 of file ebi.h.

## ◆ EBI0_WRITE_DATA16

#define EBI0_WRITE_DATA16 | ( |  | u32Addr,
|  |  | u32Data
| ) |  |

Write 16-bit data to EBI bank0.

Parameters

  [in] | u32Addr | The data address on EBI bank0.
  [in] | u32Data | Specify data to be written.

Returns
  None

This macro is used to write 16-bit data to specify address on EBI bank0.

Definition at line 135 of file ebi.h.

## ◆ EBI0_WRITE_DATA32

#define EBI0_WRITE_DATA32 | ( |  | u32Addr,
|  |  | u32Data
| ) |  |

Write 32-bit data to EBI bank0.

Parameters

  [in] | u32Addr | The data address on EBI bank0.
  [in] | u32Data | Specify data to be written.

Returns
  None

This macro is used to write 32-bit data to specify address on EBI bank0.

Definition at line 160 of file ebi.h.

## ◆ EBI0_WRITE_DATA8

#define EBI0_WRITE_DATA8 | ( |  | u32Addr,
|  |  | u32Data
| ) |  |

Write 8-bit data to EBI bank0.

Parameters

  [in] | u32Addr | The data address on EBI bank0.
  [in] | u32Data | Specify data to be written.

Returns
  None

This macro is used to write 8-bit data to specify address on EBI bank0.

Definition at line 110 of file ebi.h.

## ◆ EBI1_READ_DATA16

#define EBI1_READ_DATA16 | ( |  | u32Addr | ) |

Read 16-bit data on EBI bank1.

Parameters

  [in] | u32Addr | The data address on EBI bank1.

Returns
  16-bit Data

This macro is used to read 16-bit data from specify address on EBI bank1.

Definition at line 197 of file ebi.h.

## ◆ EBI1_READ_DATA32

#define EBI1_READ_DATA32 | ( |  | u32Addr | ) |

Read 32-bit data on EBI bank1.

Parameters

  [in] | u32Addr | The data address on EBI bank1.

Returns
  32-bit Data

This macro is used to read 32-bit data from specify address on EBI bank1.

Definition at line 222 of file ebi.h.

## ◆ EBI1_READ_DATA8

#define EBI1_READ_DATA8 | ( |  | u32Addr | ) |

Read 8-bit data on EBI bank1.

Parameters

  [in] | u32Addr | The data address on EBI bank1.

Returns
  8-bit Data

This macro is used to read 8-bit data from specify address on EBI bank1.

Definition at line 172 of file ebi.h.

## ◆ EBI1_WRITE_DATA16

#define EBI1_WRITE_DATA16 | ( |  | u32Addr,
|  |  | u32Data
| ) |  |

Write 16-bit data to EBI bank1.

Parameters

  [in] | u32Addr | The data address on EBI bank1.
  [in] | u32Data | Specify data to be written.

Returns
  None

This macro is used to write 16-bit data to specify address on EBI bank1.

Definition at line 210 of file ebi.h.

## ◆ EBI1_WRITE_DATA32

#define EBI1_WRITE_DATA32 | ( |  | u32Addr,
|  |  | u32Data
| ) |  |

Write 32-bit data to EBI bank1.

Parameters

  [in] | u32Addr | The data address on EBI bank1.
  [in] | u32Data | Specify data to be written.

Returns
  None

This macro is used to write 32-bit data to specify address on EBI bank1.

Definition at line 235 of file ebi.h.

## ◆ EBI1_WRITE_DATA8

#define EBI1_WRITE_DATA8 | ( |  | u32Addr,
|  |  | u32Data
| ) |  |

Write 8-bit data to EBI bank1.

Parameters

  [in] | u32Addr | The data address on EBI bank1.
  [in] | u32Data | Specify data to be written.

Returns
  None

This macro is used to write 8-bit data to specify address on EBI bank1.

Definition at line 185 of file ebi.h.

## ◆ EBI2_READ_DATA16

#define EBI2_READ_DATA16 | ( |  | u32Addr | ) |

Read 16-bit data on EBI bank2.

Parameters

  [in] | u32Addr | The data address on EBI bank2.

Returns
  16-bit Data

This macro is used to read 16-bit data from specify address on EBI bank2.

Definition at line 272 of file ebi.h.

## ◆ EBI2_READ_DATA32

#define EBI2_READ_DATA32 | ( |  | u32Addr | ) |

Read 32-bit data on EBI bank2.

Parameters

  [in] | u32Addr | The data address on EBI bank2.

Returns
  32-bit Data

This macro is used to read 32-bit data from specify address on EBI bank2.

Definition at line 297 of file ebi.h.

## ◆ EBI2_READ_DATA8

#define EBI2_READ_DATA8 | ( |  | u32Addr | ) |

Read 8-bit data on EBI bank2.

Parameters

  [in] | u32Addr | The data address on EBI bank2.

Returns
  8-bit Data

This macro is used to read 8-bit data from specify address on EBI bank2.

Definition at line 247 of file ebi.h.

## ◆ EBI2_WRITE_DATA16

#define EBI2_WRITE_DATA16 | ( |  | u32Addr,
|  |  | u32Data
| ) |  |

Write 16-bit data to EBI bank2.

Parameters

  [in] | u32Addr | The data address on EBI bank2.
  [in] | u32Data | Specify data to be written.

Returns
  None

This macro is used to write 16-bit data to specify address on EBI bank2.

Definition at line 285 of file ebi.h.

## ◆ EBI2_WRITE_DATA32

#define EBI2_WRITE_DATA32 | ( |  | u32Addr,
|  |  | u32Data
| ) |  |

Write 32-bit data to EBI bank2.

Parameters

  [in] | u32Addr | The data address on EBI bank2.
  [in] | u32Data | Specify data to be written.

Returns
  None

This macro is used to write 32-bit data to specify address on EBI bank2.

Definition at line 310 of file ebi.h.

## ◆ EBI2_WRITE_DATA8

#define EBI2_WRITE_DATA8 | ( |  | u32Addr,
|  |  | u32Data
| ) |  |

Write 8-bit data to EBI bank2.

Parameters

  [in] | u32Addr | The data address on EBI bank2.
  [in] | u32Data | Specify data to be written.

Returns
  None

This macro is used to write 8-bit data to specify address on EBI bank2.

Definition at line 260 of file ebi.h.

## ◆ EBI_DISABLE_WRITE_BUFFER

#define EBI_DISABLE_WRITE_BUFFER | ( |  | ) |

Disable EBI Write Buffer.

Parameters

  None |

Returns
  None

This macro is used to disable EBI write buffer function.

Definition at line 334 of file ebi.h.

## ◆ EBI_ENABLE_WRITE_BUFFER

#define EBI_ENABLE_WRITE_BUFFER | ( |  | ) |

Enable EBI Write Buffer.

Parameters

  None |

Returns
  None

This macro is used to improve EBI write operation for all EBI banks.

Definition at line 322 of file ebi.h.

## Function Documentation

## ◆ EBI_Close()

void EBI_Close | ( | uint32_t | u32Bank | ) |

Disable EBI on specify Bank.

Parameters

  [in] | u32Bank | Bank number for EBI. Valid values are: EBI_BANK0 EBI_BANK1 EBI_BANK2

Returns
  None

This function is used to close specify EBI function.

Definition at line 148 of file ebi.c.

## ◆ EBI_Open()

void EBI_Open | ( | uint32_t | u32Bank,
|  | uint32_t | u32DataWidth,
|  | uint32_t | u32TimingClass,
|  | uint32_t | u32BusMode,
|  | uint32_t | u32CSActiveLevel
| ) |  |

Initialize EBI for specify Bank.

Parameters

  [in] | u32Bank | Bank number for EBI. Valid values are: EBI_BANK0 EBI_BANK1 EBI_BANK2
  [in] | u32DataWidth | Data bus width. Valid values are: EBI_BUSWIDTH_8BIT EBI_BUSWIDTH_16BIT
  [in] | u32TimingClass | Default timing configuration. Valid values are: EBI_TIMING_FASTEST EBI_TIMING_VERYFAST EBI_TIMING_FAST EBI_TIMING_NORMAL EBI_TIMING_SLOW EBI_TIMING_VERYSLOW EBI_TIMING_SLOWEST
  [in] | u32BusMode | Set EBI bus operate mode. Valid values are: EBI_OPMODE_NORMAL EBI_OPMODE_CACCESS EBI_OPMODE_ADSEPARATE
  [in] | u32CSActiveLevel | CS is active High/Low. Valid values are: EBI_CS_ACTIVE_HIGH EBI_CS_ACTIVE_LOW

Returns
  None

This function is used to open specify EBI bank with different bus width, timing setting and
active level of CS pin to access EBI device.

Note
  Write Buffer Enable(WBUFEN) and Extend Time Of ALE(TALE) are only available in EBI bank0 control register.

Definition at line 56 of file ebi.c.

## ◆ EBI_SetBusTiming()

void EBI_SetBusTiming | ( | uint32_t | u32Bank,
|  | uint32_t | u32TimingConfig,
|  | uint32_t | u32MclkDiv
| ) |  |

Set EBI Bus Timing for specify Bank.

Parameters

  [in] | u32Bank | Bank number for EBI. Valid values are: EBI_BANK0 EBI_BANK1 EBI_BANK2
  [in] | u32TimingConfig | Configure EBI timing settings, includes TACC, TAHD, W2X and R2R setting.
  [in] | u32MclkDiv | Divider for MCLK. Valid values are: EBI_MCLKDIV_1 EBI_MCLKDIV_2 EBI_MCLKDIV_4 EBI_MCLKDIV_8 EBI_MCLKDIV_16 EBI_MCLKDIV_32 EBI_MCLKDIV_64 EBI_MCLKDIV_128

Returns
  None

This function is used to configure specify EBI bus timing for access EBI device.

Definition at line 178 of file ebi.c.