EBI

Detailed Description

EBI External Bus Interface (EBI) Peripheral API.

This module contains functions to control the EBI peripheral of Silicon Labs 32-bit MCUs and SoCs. The EBI is used for accessing external parallel devices. The devices appear as part of the internal memory map of the MCU.

Data Structures

struct  EBI_Init_TypeDef
 

Macros

#define EBI_BANK0   (uint32_t)(1 << 1)
 
#define EBI_BANK1   (uint32_t)(1 << 2)
 
#define EBI_BANK2   (uint32_t)(1 << 3)
 
#define EBI_BANK3   (uint32_t)(1 << 4)
 
#define EBI_CS0   (uint32_t)(1 << 1)
 
#define EBI_CS1   (uint32_t)(1 << 2)
 
#define EBI_CS2   (uint32_t)(1 << 3)
 
#define EBI_CS3   (uint32_t)(1 << 4)
 
#define EBI_INIT_DEFAULT
 

Enumerations

enum  EBI_Line_TypeDef {
  ebiLineARDY,
  ebiLineALE,
  ebiLineWE,
  ebiLineRE,
  ebiLineCS
}
 
enum  EBI_Mode_TypeDef {
  ebiModeD8A8 = EBI_CTRL_MODE_D8A8,
  ebiModeD16A16ALE = EBI_CTRL_MODE_D16A16ALE,
  ebiModeD8A24ALE = EBI_CTRL_MODE_D8A24ALE
}
 
enum  EBI_Polarity_TypeDef {
  ebiActiveLow = 0,
  ebiActiveHigh = 1
}
 

Functions

void EBI_AddressTimingSet (uint32_t setupCycles, uint32_t holdCycles)
 Configure timing values of address latch bus accesses.
 
uint32_t EBI_BankAddress (uint32_t bank)
 Return the base address of the EBI bank.
 
void EBI_BankEnable (uint32_t banks, bool enable)
 Enable or disable EBI Bank.
 
void EBI_ChipSelectEnable (uint32_t cs, bool enable)
 Enable or disable EBI Chip Select.
 
void EBI_Disable (void)
 Disable External Bus Interface.
 
void EBI_Init (const EBI_Init_TypeDef *ebiInit)
 Configure and enable the External Bus Interface.
 
void EBI_PolaritySet (EBI_Line_TypeDef line, EBI_Polarity_TypeDef polarity)
 Configure EBI pin polarity.
 
void EBI_ReadTimingSet (uint32_t setupCycles, uint32_t strobeCycles, uint32_t holdCycles)
 Configure timing values of read bus accesses.
 
void EBI_WriteTimingSet (uint32_t setupCycles, uint32_t strobeCycles, uint32_t holdCycles)
 Configure timing values of write bus accesses.
 

Macro Definition Documentation

#define EBI_BANK0   (uint32_t)(1 << 1)
*
* ---------               ---------
* |       |  /|       |\  | Ext.  |
* |  EBI  | / --------- \ | Async |
* |       | \ --------- / | Device|
* |       |  \|       |/  |       |
* ---------               ---------
*         Parallel interface
*
* 

EBI address bank 0.

Definition at line 73 of file em_ebi.h.

Referenced by BSP_EbiInit(), EBI_BankAddress(), EBI_BankEnable(), and EBI_Init().

#define EBI_BANK1   (uint32_t)(1 << 2)

EBI address bank 1.

Definition at line 74 of file em_ebi.h.

Referenced by EBI_BankAddress(), EBI_BankEnable(), and EBI_Init().

#define EBI_BANK2   (uint32_t)(1 << 3)

EBI address bank 2.

Definition at line 75 of file em_ebi.h.

Referenced by EBI_BankAddress(), EBI_BankEnable(), EBI_Init(), and TFT_DirectInit().

#define EBI_BANK3   (uint32_t)(1 << 4)

EBI address bank 3.

Definition at line 76 of file em_ebi.h.

Referenced by EBI_BankAddress(), EBI_BankEnable(), and EBI_Init().

#define EBI_CS0   (uint32_t)(1 << 1)

EBI chip select line 0.

Definition at line 78 of file em_ebi.h.

Referenced by EBI_ChipSelectEnable().

#define EBI_CS1   (uint32_t)(1 << 2)

EBI chip select line 1.

Definition at line 79 of file em_ebi.h.

Referenced by EBI_ChipSelectEnable().

#define EBI_CS2   (uint32_t)(1 << 3)

EBI chip select line 2.

Definition at line 80 of file em_ebi.h.

Referenced by EBI_ChipSelectEnable().

#define EBI_CS3   (uint32_t)(1 << 4)

EBI chip select line 3.

Definition at line 81 of file em_ebi.h.

Referenced by EBI_ChipSelectEnable().

#define EBI_INIT_DEFAULT
Value:
{ \
ebiModeD8A8, /* 8 bit address, 8 bit data. */ \
ebiActiveLow, /* ARDY polarity. */ \
ebiActiveLow, /* ALE polarity. */ \
ebiActiveLow, /* WE polarity. */ \
ebiActiveLow, /* RE polarity. */ \
ebiActiveLow, /* CS polarity. */ \
false, /* Enable ARDY. */ \
false, /* Do not disable ARDY timeout. */ \
EBI_BANK0, /* Enable bank 0. */ \
EBI_CS0, /* Enable chip select 0. */ \
0, /* Address setup cycles. */ \
1, /* Address hold cycles. */ \
0, /* Read setup cycles. */ \
0, /* Read strobe cycles. */ \
0, /* Read hold cycles. */ \
0, /* Write setup cycles. */ \
0, /* Write strobe cycles. */ \
1, /* Write hold cycles. */ \
true, /* Enable EBI. */ \
}

Default configuration for EBI initialization structures.

Definition at line 561 of file em_ebi.h.

Enumeration Type Documentation

EBI Pin Line types.

Enumerator
ebiLineARDY 

Address Ready line.

ebiLineALE 

Address Latch Enable line.

ebiLineWE 

Write Enable line.

ebiLineRE 

Read Enable line.

ebiLineCS 

Chip Select line.

Definition at line 172 of file em_ebi.h.

EBI Mode of operation.

Enumerator
ebiModeD8A8 

8 data bits, 8 address bits.

ebiModeD16A16ALE 

16 data bits, 16 address bits, using address latch enable.

ebiModeD8A24ALE 

8 data bits, 24 address bits, using address latch enable.

Definition at line 150 of file em_ebi.h.

EBI Polarity configuration.

Enumerator
ebiActiveLow 

Active Low.

ebiActiveHigh 

Active High.

Definition at line 164 of file em_ebi.h.

Function Documentation

void EBI_AddressTimingSet ( uint32_t  setupCycles,
uint32_t  holdCycles 
)

Configure timing values of address latch bus accesses.

Parameters
[in]setupCyclesSets the number of cycles the address is held after ALE is asserted.
[in]holdCyclesSets the number of cycles the address is driven onto the ADDRDAT bus before ALE is asserted. If set 0, 1 cycle is inserted by hardware.

Definition at line 594 of file em_ebi.c.

Referenced by EBI_Init().

uint32_t EBI_BankAddress ( uint32_t  bank)

Return the base address of the EBI bank.

Parameters
[in]bankA bank to return the start address for.
Returns
an absolute address of the bank.

Definition at line 360 of file em_ebi.c.

References EBI_BANK0, EBI_BANK1, EBI_BANK2, and EBI_BANK3.

Referenced by BSP_getTftSRAMDirectDriveBaseAddress(), BSP_setTftSRAMDirectDriveBaseAddress(), and TFT_DirectInit().

void EBI_BankEnable ( uint32_t  banks,
bool  enable 
)

Enable or disable EBI Bank.

Parameters
[in]banksBanks to reconfigure, mask of EBI_BANK<n> flags.
[in]enableTrue to enable, false to disable.

Definition at line 334 of file em_ebi.c.

References BUS_RegBitWrite(), EBI_BANK0, EBI_BANK1, EBI_BANK2, and EBI_BANK3.

void EBI_ChipSelectEnable ( uint32_t  cs,
bool  enable 
)

Enable or disable EBI Chip Select.

Parameters
[in]csChipSelect lines to reconfigure, mask of EBI_CS<n> flags.
[in]enableTrue to enable, false to disable.

Definition at line 442 of file em_ebi.c.

References EBI_CS0, EBI_CS1, EBI_CS2, and EBI_CS3.

Referenced by EBI_Init().

void EBI_PolaritySet ( EBI_Line_TypeDef  line,
EBI_Polarity_TypeDef  polarity 
)

Configure EBI pin polarity.

Parameters
[in]lineWhich pin/line to configure.
[in]polarityActive high or active low.

Definition at line 468 of file em_ebi.c.

References BUS_RegBitWrite(), ebiLineALE, ebiLineARDY, ebiLineCS, ebiLineRE, and ebiLineWE.

Referenced by EBI_Init().

void EBI_ReadTimingSet ( uint32_t  setupCycles,
uint32_t  strobeCycles,
uint32_t  holdCycles 
)

Configure timing values of read bus accesses.

Parameters
[in]setupCyclesA number of clock cycles for the address setup before REn is asserted.
[in]strobeCyclesThe number of cycles the REn is held active. After the specified number of cycles, data is read. If set to 0, 1 cycle is inserted by hardware.
[in]holdCyclesThe number of cycles CSn is held active after the REn is deasserted.

Definition at line 528 of file em_ebi.c.

Referenced by EBI_Init().

void EBI_WriteTimingSet ( uint32_t  setupCycles,
uint32_t  strobeCycles,
uint32_t  holdCycles 
)

Configure timing values of write bus accesses.

Parameters
[in]setupCyclesA number of clock cycles for the address setup before WEn is asserted.
[in]strobeCyclesA number of cycles WEn is held active. If set to 0, 1 cycle is inserted by hardware.
[in]holdCyclesA number of cycles CSn is held active after the WEn is deasserted.

Definition at line 562 of file em_ebi.c.

Referenced by EBI_Init().