Microchip® Advanced Software Framework

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EBI port/pin configuration

This is a driver for configuring the external bus interface port.

Setting up the GPIO lines depending on the mode the user has selected.

Dependencies

The EBI port depends on the following modules:

Macros

#define EBI_PORT_CS_ALL
 

Functions

static void ebi_setup_port (uint8_t addr_bits, uint8_t sram_ale, uint8_t lpc_ale, uint8_t flags)
 Set up the I/O ports for use by the EBI. More...
 

EBI Address Latch Configuration Flags

#define EBI_ALE1   0x01
 Enable ALE1 only. More...
 
#define EBI_ALE12   0x03
 Enable both ALE1 and ALE2. More...
 

EBI Port Configuration Flags

#define EBI_PORT_3PORT   (1 << 0)
 3-port interface (default is 2-port) More...
 
#define EBI_PORT_SDRAM   (1 << 1)
 Enable SDRAM interface. More...
 
#define EBI_PORT_SRAM   (1 << 2)
 Enable SRAM interface. More...
 
#define EBI_PORT_LPC   (1 << 3)
 Enable LPC interface. More...
 
#define EBI_PORT_CS0   (1 << 4)
 Enable SRAM Chip Select 0. More...
 
#define EBI_PORT_CS1   (1 << 5)
 Enable SRAM Chip Select 1. More...
 
#define EBI_PORT_CS2   (1 << 6)
 Enable SRAM Chip Select 2. More...
 
#define EBI_PORT_CS3   (1 << 7)
 Enable SRAM Chip Select 3. More...
 

#define EBI_ALE1   0x01

Enable ALE1 only.

#define EBI_ALE12   0x03

Enable both ALE1 and ALE2.

#define EBI_PORT_3PORT   (1 << 0)

3-port interface (default is 2-port)

Referenced by ebi_setup_port(), main(), and memories_initialization().

#define EBI_PORT_CS0   (1 << 4)

Enable SRAM Chip Select 0.

Referenced by ebi_setup_port(), and main().

#define EBI_PORT_CS1   (1 << 5)

Enable SRAM Chip Select 1.

Referenced by ebi_setup_port().

#define EBI_PORT_CS2   (1 << 6)

Enable SRAM Chip Select 2.

Referenced by ebi_setup_port().

#define EBI_PORT_CS3   (1 << 7)

Enable SRAM Chip Select 3.

Referenced by ebi_setup_port().

#define EBI_PORT_CS_ALL
Value:
#define EBI_PORT_CS3
Enable SRAM Chip Select 3.
Definition: ebi_port.h:79
#define EBI_PORT_CS1
Enable SRAM Chip Select 1.
Definition: ebi_port.h:77
#define EBI_PORT_CS2
Enable SRAM Chip Select 2.
Definition: ebi_port.h:78
#define EBI_PORT_CS0
Enable SRAM Chip Select 0.
Definition: ebi_port.h:76

Referenced by ebi_setup_port().

#define EBI_PORT_LPC   (1 << 3)

Enable LPC interface.

Referenced by ebi_setup_port().

#define EBI_PORT_SDRAM   (1 << 1)

Enable SDRAM interface.

Referenced by ebi_setup_port(), main(), and memories_initialization().

#define EBI_PORT_SRAM   (1 << 2)

Enable SRAM interface.

Referenced by ebi_setup_port(), and main().

static void ebi_setup_port ( uint8_t  addr_bits,
uint8_t  sram_ale,
uint8_t  lpc_ale,
uint8_t  flags 
)
inlinestatic

Set up the I/O ports for use by the EBI.

This function is meant to be called with constant parameters, in which case it will generate a minimal amount of machine code.

Note
In SDRAM mode the sram_ale and lpc_ale parameters are ignored by the hardware.
Parameters
addr_bitsNumber of address lines to be used for SRAM/LPC.
sram_aleNumber of address latches to enable for SRAM mode, 0 to 2.
lpc_aleNumber of address latches to enable for LPC mode, 0 to 2
flagsA bitwise combination of the EBI Port Configuration Flags.

References Assert, EBI_PORT_3PORT, EBI_PORT_CS0, EBI_PORT_CS1, EBI_PORT_CS2, EBI_PORT_CS3, EBI_PORT_CS_ALL, EBI_PORT_LPC, EBI_PORT_SDRAM, EBI_PORT_SRAM, sysclk_disable_module(), SYSCLK_EBI, sysclk_enable_module(), sysclk_module_is_enabled(), and SYSCLK_PORT_GEN.

Referenced by main(), and memories_initialization().