EFM32 Gecko Software Documentation
efm32g-doc-5.1.2
|
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 (int setupCycles, int holdCycles) |
Configure timing values of address latch bus accesses. More... | |
uint32_t | EBI_BankAddress (uint32_t bank) |
Return base address of EBI bank. More... | |
void | EBI_BankEnable (uint32_t banks, bool enable) |
Enable or disable EBI Bank. More... | |
void | EBI_ChipSelectEnable (uint32_t cs, bool enable) |
Enable or disable EBI Chip Select. More... | |
void | EBI_Disable (void) |
Disable External Bus Interface. | |
void | EBI_Init (const EBI_Init_TypeDef *ebiInit) |
Configure and enable External Bus Interface. More... | |
void | EBI_PolaritySet (EBI_Line_TypeDef line, EBI_Polarity_TypeDef polarity) |
Configure EBI pin polarity. More... | |
void | EBI_ReadTimingSet (int setupCycles, int strobeCycles, int holdCycles) |
Configure timing values of read bus accesses. More... | |
void | EBI_WriteTimingSet (int setupCycles, int strobeCycles, int holdCycles) |
Configure timing values of write bus accesses. More... | |
#define EBI_BANK0 (uint32_t)(1 << 1) |
* * --------- --------- * | | /| |\ | Ext. | * | EBI | / --------- \ | Async | * | | \ --------- / | Device| * | | \| |/ | | * --------- --------- * Parallel interface * *
EBI address bank 0
Definition at line 75 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 76 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 77 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 78 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 80 of file em_ebi.h.
Referenced by EBI_ChipSelectEnable().
#define EBI_CS1 (uint32_t)(1 << 2) |
EBI chip select line 1
Definition at line 81 of file em_ebi.h.
Referenced by EBI_ChipSelectEnable().
#define EBI_CS2 (uint32_t)(1 << 3) |
EBI chip select line 2
Definition at line 82 of file em_ebi.h.
Referenced by EBI_ChipSelectEnable().
#define EBI_CS3 (uint32_t)(1 << 4) |
EBI chip select line 3
Definition at line 83 of file em_ebi.h.
Referenced by EBI_ChipSelectEnable().
#define EBI_INIT_DEFAULT |
Default config for EBI init structures
enum EBI_Line_TypeDef |
enum EBI_Mode_TypeDef |
enum EBI_Polarity_TypeDef |
void EBI_AddressTimingSet | ( | int | setupCycles, |
int | holdCycles | ||
) |
Configure timing values of address latch bus accesses.
[in] | setupCycles | Sets the number of cycles the address is held after ALE is asserted |
[in] | holdCycles | Sets the number of cycles the address is driven onto the ADDRDAT bus before ALE is asserted. If set 0, 1 cycle is inserted by HW |
Definition at line 547 of file em_ebi.c.
References _EBI_ADDRTIMING_ADDRHOLD_MASK, _EBI_ADDRTIMING_ADDRHOLD_SHIFT, _EBI_ADDRTIMING_ADDRSETUP_MASK, _EBI_ADDRTIMING_ADDRSETUP_SHIFT, and EBI.
Referenced by EBI_Init().
uint32_t EBI_BankAddress | ( | uint32_t | bank | ) |
Return base address of EBI bank.
[in] | bank | Bank to return start address for |
Definition at line 330 of file em_ebi.c.
References EBI, EBI_BANK0, EBI_BANK1, EBI_BANK2, EBI_BANK3, and EBI_MEM_BASE.
Referenced by TFT_DirectInit().
void EBI_BankEnable | ( | uint32_t | banks, |
bool | enable | ||
) |
Enable or disable EBI Bank.
[in] | banks | Banks to reconfigure, mask of EBI_BANK<n> flags |
[in] | enable | True to enable, false to disable |
Definition at line 299 of file em_ebi.c.
References _EBI_CTRL_BANK0EN_SHIFT, _EBI_CTRL_BANK1EN_SHIFT, _EBI_CTRL_BANK2EN_SHIFT, _EBI_CTRL_BANK3EN_SHIFT, BUS_RegBitWrite(), EBI, EBI_BANK0, EBI_BANK1, EBI_BANK2, and EBI_BANK3.
void EBI_ChipSelectEnable | ( | uint32_t | cs, |
bool | enable | ||
) |
Enable or disable EBI Chip Select.
[in] | cs | ChipSelect lines to reconfigure, mask of EBI_CS<n> flags |
[in] | enable | True to enable, false to disable |
Definition at line 387 of file em_ebi.c.
References _EBI_ROUTE_CS0PEN_SHIFT, _EBI_ROUTE_CS1PEN_SHIFT, _EBI_ROUTE_CS2PEN_SHIFT, _EBI_ROUTE_CS3PEN_SHIFT, BUS_RegBitWrite(), EBI, EBI_CS0, EBI_CS1, EBI_CS2, and EBI_CS3.
Referenced by EBI_Init().
void EBI_Init | ( | const EBI_Init_TypeDef * | ebiInit | ) |
Configure and enable External Bus Interface.
[in] | ebiInit | EBI configuration structure |
Definition at line 64 of file em_ebi.c.
References _EBI_CTRL_ARDYEN_MASK, _EBI_CTRL_ARDYEN_SHIFT, _EBI_CTRL_ARDYTODIS_MASK, _EBI_CTRL_ARDYTODIS_SHIFT, _EBI_CTRL_BANK0EN_MASK, _EBI_CTRL_BANK1EN_MASK, _EBI_CTRL_BANK2EN_MASK, _EBI_CTRL_BANK3EN_MASK, _EBI_CTRL_MODE_MASK, _EBI_CTRL_MODE_SHIFT, _EBI_ROUTE_ALEPEN_SHIFT, _EBI_ROUTE_EBIPEN_SHIFT, EBI_Init_TypeDef::addrHoldCycles, EBI_Init_TypeDef::addrSetupCycles, EBI_Init_TypeDef::alePolarity, EBI_Init_TypeDef::ardyDisableTimeout, EBI_Init_TypeDef::ardyEnable, EBI_Init_TypeDef::ardyPolarity, EBI_Init_TypeDef::banks, BUS_RegBitWrite(), EBI_Init_TypeDef::csLines, EBI_Init_TypeDef::csPolarity, EBI, EBI_AddressTimingSet(), EBI_BANK0, EBI_BANK1, EBI_BANK2, EBI_BANK3, EBI_ChipSelectEnable(), EBI_CTRL_BANK0EN, EBI_CTRL_BANK1EN, EBI_CTRL_BANK2EN, EBI_CTRL_BANK3EN, EBI_PolaritySet(), EBI_ReadTimingSet(), EBI_WriteTimingSet(), ebiLineALE, ebiLineARDY, ebiLineCS, ebiLineRE, ebiLineWE, ebiModeD16A16ALE, ebiModeD8A24ALE, ebiModeD8A8, EBI_Init_TypeDef::enable, EBI_Init_TypeDef::mode, EBI_Init_TypeDef::readHoldCycles, EBI_Init_TypeDef::readSetupCycles, EBI_Init_TypeDef::readStrobeCycles, EBI_Init_TypeDef::rePolarity, EBI_Init_TypeDef::wePolarity, EBI_Init_TypeDef::writeHoldCycles, EBI_Init_TypeDef::writeSetupCycles, and EBI_Init_TypeDef::writeStrobeCycles.
Referenced by BSP_EbiInit().
void EBI_PolaritySet | ( | EBI_Line_TypeDef | line, |
EBI_Polarity_TypeDef | polarity | ||
) |
Configure EBI pin polarity.
[in] | line | Which pin/line to configure |
[in] | polarity | Active high, or active low |
Definition at line 418 of file em_ebi.c.
References _EBI_POLARITY_ALEPOL_SHIFT, _EBI_POLARITY_ARDYPOL_SHIFT, _EBI_POLARITY_CSPOL_SHIFT, _EBI_POLARITY_REPOL_SHIFT, _EBI_POLARITY_WEPOL_SHIFT, BUS_RegBitWrite(), EBI, ebiLineALE, ebiLineARDY, ebiLineCS, ebiLineRE, and ebiLineWE.
Referenced by EBI_Init().
void EBI_ReadTimingSet | ( | int | setupCycles, |
int | strobeCycles, | ||
int | holdCycles | ||
) |
Configure timing values of read bus accesses.
[in] | setupCycles | Number of clock cycles for address setup before REn is asserted |
[in] | strobeCycles | The 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 HW |
[in] | holdCycles | The number of cycles CSn is held active after the REn is dessarted |
Definition at line 478 of file em_ebi.c.
References _EBI_RDTIMING_RDHOLD_MASK, _EBI_RDTIMING_RDHOLD_SHIFT, _EBI_RDTIMING_RDSETUP_MASK, _EBI_RDTIMING_RDSETUP_SHIFT, _EBI_RDTIMING_RDSTRB_MASK, _EBI_RDTIMING_RDSTRB_SHIFT, and EBI.
Referenced by EBI_Init().
void EBI_WriteTimingSet | ( | int | setupCycles, |
int | strobeCycles, | ||
int | holdCycles | ||
) |
Configure timing values of write bus accesses.
[in] | setupCycles | Number of clock cycles for address setup before WEn is asserted |
[in] | strobeCycles | Number of cycles WEn is held active. If set to 0, 1 cycle is inserted by HW |
[in] | holdCycles | Number of cycles CSn is held active after the WEn is deasserted |
Definition at line 514 of file em_ebi.c.
References _EBI_WRTIMING_WRHOLD_MASK, _EBI_WRTIMING_WRHOLD_SHIFT, _EBI_WRTIMING_WRSETUP_MASK, _EBI_WRTIMING_WRSETUP_SHIFT, _EBI_WRTIMING_WRSTRB_MASK, _EBI_WRTIMING_WRSTRB_SHIFT, and EBI.
Referenced by EBI_Init().