Microchip® Advanced Software Framework

mass_storage_example.c File Reference
#include "nlao_cpu.h"
#include "compiler.h"
#include "preprocessor.h"
#include "mass_storage_example.h"
#include "board.h"
#include "print_funcs.h"
#include "intc.h"
#include "power_clocks_lib.h"
#include "gpio.h"
#include "ctrl_access.h"
#include "spi.h"
#include "conf_at45dbx.h"
#include "conf_sd_mmc_spi.h"
#include "conf_usb.h"
#include "usb_task.h"
#include "device_mass_storage_task.h"
#include "host_mass_storage_task.h"
#include "ushell_task.h"

Macros

#define AT45DBX_ENABLE_NPCS_PIN(NPCS, unused)   {AT45DBX_SPI_NPCS##NPCS##_PIN, AT45DBX_SPI_NPCS##NPCS##_FUNCTION},
 

Functions

Hmatrix bus configuration
void init_hmatrix (void)
 
int _init_startup (void)
 Low-level initialization routine called during startup, before the main function. More...
 
static void at45dbx_resources_init (void)
 Initializes AT45DBX resources: GPIO, SPI and AT45DBX. More...
 
static void sd_mmc_spi_resources_init (void)
 Initializes SD/MMC resources: GPIO, SPI and SD/MMC. More...
 
int main (void)
 Main function. Execution starts here. More...
 

Variables

System Clock Frequencies
static pcl_freq_param_t pcl_freq_param
 

#define AT45DBX_ENABLE_NPCS_PIN (   NPCS,
  unused 
)    {AT45DBX_SPI_NPCS##NPCS##_PIN, AT45DBX_SPI_NPCS##NPCS##_FUNCTION},

Referenced by at45dbx_resources_init().

int _init_startup ( void  )

Low-level initialization routine called during startup, before the main function.

This version comes in replacement to the default one provided by the Newlib add-ons library. Newlib add-ons' _init_startup only calls init_exceptions, but Newlib add-ons' exception and interrupt vectors are defined in the same section and Newlib add-ons' interrupt vectors are not compatible with the interrupt management of the INTC module. More low-level initializations are besides added here.

References _evba, Enable_global_exception, INTC_init_interrupts(), pcl_freq_param, set_cpu_hz(), and Set_system_register.

void init_hmatrix ( void  )

Referenced by main().

pcl_freq_param_t pcl_freq_param
static
Initial value:
=
{
.cpu_f = FCPU_HZ,
.pba_f = FPBA_HZ,
.osc0_f = FOSC0,
.osc0_startup = OSC0_STARTUP
}
#define FPBA_HZ
Definition: mass_storage_example.h:54
#define FOSC0
Osc0 frequency: Hz.
Definition: evk1105.h:63
#define OSC0_STARTUP
Osc0 startup time: RCOsc periods.
Definition: evk1105.h:64
#define FCPU_HZ
Definition: mass_storage_example.h:51

Referenced by _init_startup(), at45dbx_resources_init(), main(), and sd_mmc_spi_resources_init().