www.pudn.com > the-zynq-book-tutorial-sources.zip > adventures_with_ip.h, change:2013-10-30,size:2666b


/* 
 * adventures_with_ip.h 
 * 
 * Main header file. 
 */ 
 
#ifndef ADVENTURES_WITH_IP_H_ 
#define ADVENTURES_WITH_IP_H_ 
 
/* ---------------------------------------------------------------------------- * 
 * 								Header Files									* 
 * ---------------------------------------------------------------------------- */ 
#include <stdio.h> 
#include <xil_io.h> 
#include <sleep.h> 
#include "xiicps.h" 
#include <xil_printf.h> 
#include <xparameters.h> 
#include "xgpio.h" 
#include "xuartps.h" 
#include "stdlib.h" 
 
/* ---------------------------------------------------------------------------- * 
 * 							Custom IP Header Files								* 
 * ---------------------------------------------------------------------------- */ 
#include "audio.h" 
#include "lms_pcore_addr.h" 
#include "xnco.h" 
 
/* ---------------------------------------------------------------------------- * 
 * 							Prototype Functions									* 
 * ---------------------------------------------------------------------------- */ 
void menu(); 
void tonal_noise(); 
void audio_stream(); 
void lms_filter(); 
unsigned char gpio_init(); 
void nco_init(void *InstancePtr); 
 
/* ---------------------------------------------------------------------------- * 
 * 						Redefinitions from xparameters.h 						* 
 * ---------------------------------------------------------------------------- */ 
#define NCO_ID XPAR_NCO_0_DEVICE_ID 
 
#define LMS_LOC XPAR_LMS_PCORE_0_BASEADDR 
#define LMS_X LMS_LOC + x_k__Data_lms_pcore 
#define LMS_D LMS_LOC + d_k__Data_lms_pcore 
#define LMS_E LMS_LOC + e_k__Data_lms_pcore 
#define LMS_STROBE LMS_LOC + IPCore_Strobe_lms_pcore 
 
#define UART_BASEADDR XPAR_PS7_UART_1_BASEADDR 
 
#define BUTTON_SWITCH_BASE XPAR_GPIO_1_BASEADDR 
#define LED_BASE XPAR_LED_CONTROLLER_0_S00_AXI_BASEADDR 
#define BUTTON_SWITCH_ID XPAR_GPIO_1_DEVICE_ID 
 
/* ---------------------------------------------------------------------------- * 
 * 							Define GPIO Channels								* 
 * ---------------------------------------------------------------------------- */ 
#define BUTTON_CHANNEL 1 
#define SWITCH_CHANNEL 2 
 
/* ---------------------------------------------------------------------------- * 
 * 							Audio Scaling Factor								* 
 * ---------------------------------------------------------------------------- */ 
#define SCALE 6 
 
/* ---------------------------------------------------------------------------- * 
 * 							Global Variables									* 
 * ---------------------------------------------------------------------------- */ 
XIicPs Iic; 
XGpio Gpio; // Gpio instance for buttons and switches 
XNco Nco; 
 
 
#endif /* ADVENTURES_WITH_IP_H_ */