EBI - External Bus Interface

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
EBI Initialization structure.
struct EBI_TFTInit_TypeDef
TFT Initialization structure.

Functions

void EBI_Init (const EBI_Init_TypeDef *ebiInit)
Configure and enable the External Bus Interface.
void EBI_Disable (void)
Disable External Bus Interface.
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_NANDFlashEnable (uint32_t banks, bool enable)
Enable or disable EBI NAND Flash Support.
void EBI_TFTInit (const EBI_TFTInit_TypeDef *ebiTFTInit)
Configure and initialize TFT Direct Drive.
void EBI_TFTSizeSet (uint32_t horizontal, uint32_t vertical)
Configure and initialize TFT size settings.
void EBI_TFTHPorchSet (uint32_t front, uint32_t back, uint32_t pulseWidth)
Configure and initialize Horizontal Porch Settings.
void EBI_TFTVPorchSet (uint32_t front, uint32_t back, uint32_t pulseWidth)
Configure Vertical Porch Settings.
void EBI_TFTTimingSet (uint32_t dclkPeriod, uint32_t start, uint32_t setup, uint32_t hold)
Configure TFT Direct Drive Timing Settings.
void EBI_BankReadTimingSet (uint32_t banks, uint32_t setupCycles, uint32_t strobeCycles, uint32_t holdCycles)
Configure timing values of read bus accesses.
void EBI_BankReadTimingConfig (uint32_t banks, bool pageMode, bool prefetch, bool halfRE)
Configure read operation parameters for a selected bank.
void EBI_BankWriteTimingSet (uint32_t banks, uint32_t setupCycles, uint32_t strobeCycles, uint32_t holdCycles)
Configure timing values of write bus accesses.
void EBI_BankWriteTimingConfig (uint32_t banks, bool writeBufDisable, bool halfWE)
Configure write operation parameters for a selected bank.
void EBI_BankAddressTimingSet (uint32_t banks, uint32_t setupCycles, uint32_t holdCycles)
Configure timing values of address latch bus accesses.
void EBI_BankAddressTimingConfig (uint32_t banks, bool halfALE)
Configure address operation parameters for a selected bank.
void EBI_BankPolaritySet (uint32_t banks, EBI_Line_TypeDef line, EBI_Polarity_TypeDef polarity)
Configure EBI pin polarity for selected bank(s) for devices with individual timing support.
void EBI_BankByteLaneEnable (uint32_t banks, bool enable)
Configure Byte Lane Enable for select banks timing support.
void EBI_AltMapEnable (bool enable)
Configure the Alternate Address Map support.
void EBI_TFTEnable ( EBI_TFTDDMode_TypeDef mode)
Enable or disable TFT Direct Drive.
void EBI_TFTFrameBaseSet (uint32_t address)
Configure frame buffer pointer.
void EBI_TFTPixelSet (int pixel, uint32_t color)
Set TFT Pixel Color 0 or 1.
void EBI_TFTDDSet (uint32_t color)
Set TFT Direct Drive Data from Internal Memory.
void EBI_TFTMaskBlendMode ( EBI_TFTMaskBlend_TypeDef maskBlend)
Masking and Blending Mode Set.
void EBI_TFTColorSrcSet ( EBI_TFTColorSrc_TypeDef colorSrc)
Masking and Blending Color1 Source Set.
void EBI_TFTAlphaBlendSet (uint8_t alpha)
Set TFT Alpha Blending Factor.
void EBI_TFTMaskSet (uint32_t mask)
Set TFT mask value.
uint32_t EBI_TFTVCount (void)
Get current vertical position counter.
uint32_t EBI_TFTHCount (void)
Get current horizontal position counter.
void EBI_TFTFBTriggerSet ( EBI_TFTFrameBufTrigger_TypeDef sync)
Set Frame Buffer Trigger.
void EBI_TFTHStrideSet (uint32_t nbytes)
Set horizontal TFT stride value in number of bytes.
void EBI_IntClear (uint32_t flags)
Clear one or more pending EBI interrupts.
void EBI_IntSet (uint32_t flags)
Set one or more pending EBI interrupts.
void EBI_IntDisable (uint32_t flags)
Disable one or more EBI interrupts.
void EBI_IntEnable (uint32_t flags)
Enable one or more EBI interrupts.
uint32_t EBI_IntGet (void)
Get pending EBI interrupt flags.
uint32_t EBI_IntGetEnabled (void)
Get enabled and pending EBI interrupt flags.
void EBI_StartNandEccGen (void)
Start ECC generator on NAND flash transfers.
uint32_t EBI_StopNandEccGen (void)
Stop NAND flash ECC generator and return generated ECC.
void EBI_ChipSelectEnable (uint32_t cs, bool enable)
Enable or disable EBI Chip Select.
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.
void EBI_AddressTimingSet (uint32_t setupCycles, uint32_t holdCycles)
Configure timing values of address latch bus accesses.
void EBI_PolaritySet ( EBI_Line_TypeDef line, EBI_Polarity_TypeDef polarity)
Configure EBI pin polarity.

Macros

#define EBI_BANK0 (uint32_t)(1 << 1)
EBI address bank 0.
#define EBI_BANK1 (uint32_t)(1 << 2)
EBI address bank 1.
#define EBI_BANK2 (uint32_t)(1 << 3)
EBI address bank 2.
#define EBI_BANK3 (uint32_t)(1 << 4)
EBI address bank 3.
#define EBI_CS0 (uint32_t)(1 << 1)
EBI chip select line 0.
#define EBI_CS1 (uint32_t)(1 << 2)
EBI chip select line 1.
#define EBI_CS2 (uint32_t)(1 << 3)
EBI chip select line 2.
#define EBI_CS3 (uint32_t)(1 << 4)
EBI chip select line 3.
#define EBI_GENERIC_ALB_A0 EBI_ROUTE_ALB_A0
Pin Enable Lower Bound EBI_A[0] and upwards.
#define EBI_GENERIC_ALB_A8 EBI_ROUTE_ALB_A8
Pin Enable Lower Bound EBI_A[8] and upwards.
#define EBI_GENERIC_ALB_A16 EBI_ROUTE_ALB_A16
Pin Enable Lower Bound EBI_A[16] and upwards.
#define EBI_GENERIC_ALB_A24 EBI_ROUTE_ALB_A24
Pin Enable Lower Bound EBI_A[24] and upwards.
#define EBI_GENERIC_APEN_A0 EBI_ROUTE_APEN_A0
All EBI_A pins enabled.
#define EBI_GENERIC_APEN_A5 EBI_ROUTE_APEN_A5
EBI_A[4:L] pins enabled.
#define EBI_GENERIC_APEN_A6 EBI_ROUTE_APEN_A6
EBI_A[5:L] pins enabled.
#define EBI_GENERIC_APEN_A7 EBI_ROUTE_APEN_A7
EBI_A[6:L] pins enabled.
#define EBI_GENERIC_APEN_A8 EBI_ROUTE_APEN_A8
EBI_A[7:L] pins enabled.
#define EBI_GENERIC_APEN_A9 EBI_ROUTE_APEN_A9
EBI_A[8:L] pins enabled.
#define EBI_GENERIC_APEN_A10 EBI_ROUTE_APEN_A10
EBI_A[9:L] pins enabled.
#define EBI_GENERIC_APEN_A11 EBI_ROUTE_APEN_A11
EBI_A[10:L] pins enabled.
#define EBI_GENERIC_APEN_A12 EBI_ROUTE_APEN_A12
EBI_A[11:L] pins enabled.
#define EBI_GENERIC_APEN_A13 EBI_ROUTE_APEN_A13
EBI_A[12:L] pins enabled.
#define EBI_GENERIC_APEN_A14 EBI_ROUTE_APEN_A14
EBI_A[13:L] pins enabled.
#define EBI_GENERIC_APEN_A15 EBI_ROUTE_APEN_A15
EBI_A[14:L] pins enabled.
#define EBI_GENERIC_APEN_A16 EBI_ROUTE_APEN_A16
EBI_A[15:L] pins enabled.
#define EBI_GENERIC_APEN_A17 EBI_ROUTE_APEN_A17
EBI_A[16:L] pins enabled.
#define EBI_GENERIC_APEN_A18 EBI_ROUTE_APEN_A18
EBI_A[17:L] pins enabled.
#define EBI_GENERIC_APEN_A19 EBI_ROUTE_APEN_A19
EBI_A[18:L] pins enabled.
#define EBI_GENERIC_APEN_A20 EBI_ROUTE_APEN_A20
EBI_A[19:L] pins enabled.
#define EBI_GENERIC_APEN_A21 EBI_ROUTE_APEN_A21
EBI_A[20:L] pins enabled.
#define EBI_GENERIC_APEN_A22 EBI_ROUTE_APEN_A22
EBI_A[21:L] pins enabled.
#define EBI_GENERIC_APEN_A23 EBI_ROUTE_APEN_A23
EBI_A[22:L] pins enabled.
#define EBI_GENERIC_APEN_A24 EBI_ROUTE_APEN_A24
EBI_A[23:L] pins enabled.
#define EBI_GENERIC_APEN_A25 EBI_ROUTE_APEN_A25
EBI_A[24:L] pins enabled.
#define EBI_GENERIC_APEN_A26 EBI_ROUTE_APEN_A26
EBI_A[25:L] pins enabled.
#define EBI_GENERIC_APEN_A27 EBI_ROUTE_APEN_A27
EBI_A[26:L] pins enabled.
#define EBI_GENERIC_APEN_A28 EBI_ROUTE_APEN_A28
EBI_A[27:L] pins enabled.
#define EBI_INIT_DEFAULT
Default configuration for EBI initialization structures.
#define EBI_TFTINIT_DEFAULT
Default configuration for EBI TFT initialization structure.

Enumerations

enum EBI_Mode_TypeDef {
ebiModeD8A8 = EBI_CTRL_MODE_D8A8,
ebiModeD16A16ALE = EBI_CTRL_MODE_D16A16ALE,
ebiModeD8A24ALE = EBI_CTRL_MODE_D8A24ALE,
ebiModeD16 = EBI_CTRL_MODE_D16
}
EBI Mode of operation.
enum EBI_Polarity_TypeDef {
ebiActiveLow = 0,
ebiActiveHigh = 1
}
EBI Polarity configuration.
enum EBI_Line_TypeDef {
ebiLineARDY ,
ebiLineALE ,
ebiLineWE ,
ebiLineRE ,
ebiLineCS ,
ebiLineBL ,
ebiLineTFTVSync ,
ebiLineTFTHSync ,
ebiLineTFTDataEn ,
ebiLineTFTDClk ,
ebiLineTFTCS
}
EBI Pin Line types.
enum EBI_ALow_TypeDef {
ebiALowA0 = EBI_GENERIC_ALB_A0,
ebiALowA8 = EBI_GENERIC_ALB_A8,
ebiALowA16 = EBI_GENERIC_ALB_A16,
ebiALowA24 = EBI_GENERIC_ALB_A24
}
Address Pin Enable, lower limit - lower range of pins to enable.
enum EBI_AHigh_TypeDef {
ebiAHighA0 = EBI_GENERIC_APEN_A0,
ebiAHighA5 = EBI_GENERIC_APEN_A5,
ebiAHighA6 = EBI_GENERIC_APEN_A6,
ebiAHighA7 = EBI_GENERIC_APEN_A7,
ebiAHighA8 = EBI_GENERIC_APEN_A8,
ebiAHighA9 = EBI_GENERIC_APEN_A9,
ebiAHighA10 = EBI_GENERIC_APEN_A10,
ebiAHighA11 = EBI_GENERIC_APEN_A11,
ebiAHighA12 = EBI_GENERIC_APEN_A12,
ebiAHighA13 = EBI_GENERIC_APEN_A13,
ebiAHighA14 = EBI_GENERIC_APEN_A14,
ebiAHighA15 = EBI_GENERIC_APEN_A15,
ebiAHighA16 = EBI_GENERIC_APEN_A16,
ebiAHighA17 = EBI_GENERIC_APEN_A17,
ebiAHighA18 = EBI_GENERIC_APEN_A18,
ebiAHighA19 = EBI_GENERIC_APEN_A19,
ebiAHighA20 = EBI_GENERIC_APEN_A20,
ebiAHighA21 = EBI_GENERIC_APEN_A21,
ebiAHighA22 = EBI_GENERIC_APEN_A22,
ebiAHighA23 = EBI_GENERIC_APEN_A23,
ebiAHighA24 = EBI_GENERIC_APEN_A24,
ebiAHighA25 = EBI_GENERIC_APEN_A25,
ebiAHighA26 = EBI_GENERIC_APEN_A26,
ebiAHighA27 = EBI_GENERIC_APEN_A27,
ebiAHighA28 = EBI_GENERIC_APEN_A28
}
Address Pin Enable, high limit - higher limit of pins to enable.
enum EBI_Location_TypeDef {
ebiLocation0 = EBI_ROUTE_LOCATION_LOC0,
ebiLocation1 = EBI_ROUTE_LOCATION_LOC1,
ebiLocation2 = EBI_ROUTE_LOCATION_LOC2
}
EBI I/O Alternate Pin Location.
enum EBI_TFTBank_TypeDef {
ebiTFTBank0 = EBI_TFTCTRL_BANKSEL_BANK0,
ebiTFTBank1 = EBI_TFTCTRL_BANKSEL_BANK1,
ebiTFTBank2 = EBI_TFTCTRL_BANKSEL_BANK2,
ebiTFTBank3 = EBI_TFTCTRL_BANKSEL_BANK3
}
EBI TFT Graphics Bank Select.
enum EBI_TFTColorSrc_TypeDef {
ebiTFTColorSrcMem = EBI_TFTCTRL_COLOR1SRC_MEM,
ebiTFTColorSrcPixel1 = EBI_TFTCTRL_COLOR1SRC_PIXEL1
}
Masking and Alpha blending source color.
enum EBI_TFTInterleave_TypeDef {
ebiTFTInterleaveUnlimited = EBI_TFTCTRL_INTERLEAVE_UNLIMITED,
ebiTFTInterleaveOnePerDClk = EBI_TFTCTRL_INTERLEAVE_ONEPERDCLK,
ebiTFTInterleavePorch = EBI_TFTCTRL_INTERLEAVE_PORCH
}
Bus Data Interleave Mode.
enum EBI_TFTFrameBufTrigger_TypeDef {
ebiTFTFrameBufTriggerVSync = EBI_TFTCTRL_FBCTRIG_VSYNC,
ebiTFTFrameBufTriggerHSync = EBI_TFTCTRL_FBCTRIG_HSYNC
}
Control frame base pointer copy.
enum EBI_TFTMaskBlend_TypeDef {
ebiTFTMBDisabled = EBI_TFTCTRL_MASKBLEND_DISABLED,
ebiTFTMBIMask = EBI_TFTCTRL_MASKBLEND_IMASK,
ebiTFTMBIAlpha = EBI_TFTCTRL_MASKBLEND_IALPHA,
ebiTFTMBIMaskAlpha = EBI_TFTCTRL_MASKBLEND_IMASKIALPHA,
ebiTFTMBEMask = EBI_TFTCTRL_MASKBLEND_EMASK,
ebiTFTMBEAlpha = EBI_TFTCTRL_MASKBLEND_EALPHA,
ebiTFTMBEMaskAlpha = EBI_TFTCTRL_MASKBLEND_EMASKEALPHA
}
Control of mask and alpha blending mode.
enum EBI_TFTDDMode_TypeDef {
ebiTFTDDModeDisabled = EBI_TFTCTRL_DD_DISABLED,
ebiTFTDDModeInternal = EBI_TFTCTRL_DD_INTERNAL,
ebiTFTDDModeExternal = EBI_TFTCTRL_DD_EXTERNAL
}
TFT Direct Drive mode.
enum EBI_TFTWidth_TypeDef {
ebiTFTWidthByte = EBI_TFTCTRL_WIDTH_BYTE,
ebiTFTWidthHalfWord = EBI_TFTCTRL_WIDTH_HALFWORD
}
TFT Data Increment Width.

Function Documentation

EBI_Init()

void EBI_Init ( const EBI_Init_TypeDef * ebiInit )

Configure and enable the External Bus Interface.

Parameters
[in] ebiInit The EBI configuration structure.
Note
GPIO lines must be configured as a PUSH_PULL for the correct operation. GPIO and EBI clocks must be enabled in the CMU.

EBI_Disable()

void EBI_Disable ( void )

Disable External Bus Interface.

EBI_BankAddress()

uint32_t EBI_BankAddress ( uint32_t bank )

Return the base address of the EBI bank.

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

EBI_BankEnable()

void EBI_BankEnable ( uint32_t banks,
bool enable
)

Enable or disable EBI Bank.

Parameters
[in] banks Banks to reconfigure, mask of EBI_BANK<n> flags.
[in] enable True to enable, false to disable.

EBI_NANDFlashEnable()

void EBI_NANDFlashEnable ( uint32_t banks, </