Microchip® Advanced Software Framework

ebi.h File Reference

External bus interface (EBI) functions.

Copyright (c) 2010-2018 Microchip Technology Inc. and its subsidiaries.

#include "compiler.h"
#include "sleepmgr.h"

Data Structures

struct  ebi_cs_config
 External bus interface chip select configuration. More...
 
struct  ebi_sdram_config
 External bus interface SDRAM configuration. More...
 

Macros

#define EBI_CS_ASPACE_128KB_gc   EBI_CS_ASIZE_128KB_gc
 
#define EBI_CS_ASPACE_16KB_gc   EBI_CS_ASIZE_16KB_gc
 
#define EBI_CS_ASPACE_16M_gc   EBI_CS_ASIZE_16M_gc
 
#define EBI_CS_ASPACE_1KB_gc   EBI_CS_ASIZE_1KB_gc
 
#define EBI_CS_ASPACE_1MB_gc   EBI_CS_ASIZE_1MB_gc
 
#define EBI_CS_ASPACE_256B_gc   EBI_CS_ASIZE_256B_gc
 
#define EBI_CS_ASPACE_256KB_gc   EBI_CS_ASIZE_256KB_gc
 
#define EBI_CS_ASPACE_2KB_gc   EBI_CS_ASIZE_2KB_gc
 
#define EBI_CS_ASPACE_2MB_gc   EBI_CS_ASIZE_2MB_gc
 
#define EBI_CS_ASPACE_32KB_gc   EBI_CS_ASIZE_32KB_gc
 
#define EBI_CS_ASPACE_4KB_gc   EBI_CS_ASIZE_4KB_gc
 
#define EBI_CS_ASPACE_4MB_gc   EBI_CS_ASIZE_4MB_gc
 
#define EBI_CS_ASPACE_512B_gc   EBI_CS_ASIZE_512B_gc
 
#define EBI_CS_ASPACE_512KB_gc   EBI_CS_ASIZE_512KB_gc
 
#define EBI_CS_ASPACE_64KB_gc   EBI_CS_ASIZE_64KB_gc
 
#define EBI_CS_ASPACE_8KB_gc   EBI_CS_ASIZE_8KB_gc
 
#define EBI_CS_ASPACE_8MB_gc   EBI_CS_ASIZE_8MB_gc
 
#define EBI_CS_ASPACE_gm   EBI_CS_ASIZE_gm
 
#define EBI_CS_ASPACE_t   EBI_CS_ASIZE_t
 
#define EBI_SDRAM_CS   3
 Chip select on the EBI that can be configured for SDRAM operation. More...
 

Functions

External Bus Interface management
void ebi_cs_write_config (const uint8_t cs, const struct ebi_cs_config *config)
 Write EBI chip select configuration to hardware. More...
 
void ebi_cs_read_config (const uint8_t cs, struct ebi_cs_config *config)
 Read EBI chip select configuration from hardware. More...
 
void ebi_sdram_write_config (const struct ebi_sdram_config *config)
 Write EBI SDRAM configuration to hardware. More...
 
void ebi_sdram_read_config (struct ebi_sdram_config *config)
 Read EBI SDRAM configuration from hardware. More...
 
void ebi_enable_cs (const uint8_t cs, const struct ebi_cs_config *config)
 Enable an EBI chip select. More...
 
void ebi_disable_cs (const uint8_t cs)
 Disable an EBI chip select. More...
 
static bool ebi_sdram_is_ready (void)
 Check if SDRAM is ready for access. More...
 
External Bus Interface Chip Select configuration helper functions
static void ebi_cs_set_mode (struct ebi_cs_config *config, EBI_CS_MODE_t mode)
 Set chip select mode. More...
 
static void ebi_cs_set_address_size (struct ebi_cs_config *config, EBI_CS_ASPACE_t size)
 Set chip select address size. More...
 
static void ebi_cs_set_sram_wait_states (struct ebi_cs_config *config, EBI_CS_SRWS_t cycles)
 Set chip select SRAM wait states. More...
 
static void ebi_cs_set_base_address (struct ebi_cs_config *config, uint32_t address)
 Set chip select base address. More...
 
External Bus Interface SDRAM configuration helper functions
static void ebi_sdram_set_mode (struct ebi_cs_config *config, EBI_CS_SDMODE_t mode)
 Set SDRAM mode. More...
 
static void ebi_sdram_set_cas_latency (struct ebi_sdram_config *config, const uint8_t cas)
 Set SDRAM CAS latency. More...
 
static void ebi_sdram_set_row_bits (struct ebi_sdram_config *config, const uint8_t bits)
 Set number of SDRAM row bits. More...
 
static void ebi_sdram_set_col_bits (struct ebi_sdram_config *config, const uint8_t bits)
 Set number of SDRAM column bits. More...
 
static void ebi_sdram_set_refresh_period (struct ebi_sdram_config *config, const uint16_t period)
 Set SDRAM refresh period. More...
 
static void ebi_sdram_set_initialization_delay (struct ebi_sdram_config *config, const uint16_t delay)
 Set SDRAM initialization delay. More...
 
static void ebi_sdram_set_mode_delay (struct ebi_sdram_config *config, const EBI_MRDLY_t delay)
 Set SDRAM mode delay. More...
 
static void ebi_sdram_set_row_cycle_delay (struct ebi_sdram_config *config, const EBI_ROWCYCDLY_t delay)
 Set SDRAM row cycle delay. More...
 
static void ebi_sdram_set_row_to_precharge_delay (struct ebi_sdram_config *config, const EBI_RPDLY_t delay)
 Set SDRAM row to pre-charge delay. More...
 
static void ebi_sdram_set_write_recovery_delay (struct ebi_sdram_config *config, const EBI_WRDLY_t delay)
 Set SDRAM write recovery delay. More...
 
static void ebi_sdram_set_self_refresh_to_active_delay (struct ebi_sdram_config *config, const EBI_ESRDLY_t delay)
 Set SDRAM exit self refresh to active delay. More...
 
static void ebi_sdram_set_row_to_col_delay (struct ebi_sdram_config *config, const EBI_ROWCOLDLY_t delay)
 Set SDRAM row to column delay. More...
 
External Bus Interface SDRAM power management
static void ebi_sdram_enable_self_refresh (void)
 Enable SDRAM self refresh mode. More...
 
static void ebi_sdram_disable_self_refresh (void)
 Disable SDRAM self refresh mode. More...
 

#define EBI_CS_ASPACE_128KB_gc   EBI_CS_ASIZE_128KB_gc

Referenced by main().

#define EBI_CS_ASPACE_16KB_gc   EBI_CS_ASIZE_16KB_gc
#define EBI_CS_ASPACE_16M_gc   EBI_CS_ASIZE_16M_gc
#define EBI_CS_ASPACE_1KB_gc   EBI_CS_ASIZE_1KB_gc
#define EBI_CS_ASPACE_1MB_gc   EBI_CS_ASIZE_1MB_gc
#define EBI_CS_ASPACE_256B_gc   EBI_CS_ASIZE_256B_gc
#define EBI_CS_ASPACE_256KB_gc   EBI_CS_ASIZE_256KB_gc
#define EBI_CS_ASPACE_2KB_gc   EBI_CS_ASIZE_2KB_gc
#define EBI_CS_ASPACE_2MB_gc   EBI_CS_ASIZE_2MB_gc
#define EBI_CS_ASPACE_32KB_gc   EBI_CS_ASIZE_32KB_gc
#define EBI_CS_ASPACE_4KB_gc   EBI_CS_ASIZE_4KB_gc
#define EBI_CS_ASPACE_4MB_gc   EBI_CS_ASIZE_4MB_gc
#define EBI_CS_ASPACE_512B_gc   EBI_CS_ASIZE_512B_gc
#define EBI_CS_ASPACE_512KB_gc   EBI_CS_ASIZE_512KB_gc
#define EBI_CS_ASPACE_64KB_gc   EBI_CS_ASIZE_64KB_gc
#define EBI_CS_ASPACE_8KB_gc   EBI_CS_ASIZE_8KB_gc
#define EBI_CS_ASPACE_8MB_gc   EBI_CS_ASIZE_8MB_gc

Referenced by main(), and memories_initialization().

#define EBI_CS_ASPACE_gm   EBI_CS_ASIZE_gm

Referenced by ebi_cs_set_address_size().

#define EBI_CS_ASPACE_t   EBI_CS_ASIZE_t