-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Zendt tonen uit via de i2s2 module van digilent via de fpga aangestuurd vanuit de zynq PS
- Loading branch information
Showing
141 changed files
with
160,233 additions
and
2,961 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2,956 changes: 2,117 additions & 839 deletions
2,956
I2S_Audioplayer/AudioplayerC/.metadata/.plugins/org.eclipse.cdt.make.core/Synthesiser.sc
Large diffs are not rendered by default.
Oops, something went wrong.
129 changes: 129 additions & 0 deletions
129
....metadata/.plugins/org.eclipse.core.resources/.history/0/204bdd7a7bb5001b1b78ee76e3b8036d
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
|
||
|
||
#include "xstatus.h" | ||
#include "AudioPlayer.h" | ||
#include "xparameters.h" | ||
#include "xgpio.h" | ||
#include "xil_printf.h" | ||
#include "xil_types.h" | ||
|
||
#define GPIO_BASE 0x41200000; | ||
#define GPIO_OUTPUT_DEVICE_ID XPAR_GPIO_0_DEVICE_ID | ||
#define GPIO_INPUT_DEVICE_ID XPAR_GPIO_0_DEVICE_ID | ||
|
||
#define BIT0 0x01 | ||
#define BIT1 0x02 | ||
#define BIT2 0x04 | ||
#define BIT3 0x08 | ||
|
||
void GpioInputExample(u16 DeviceId, u32 *DataRead); | ||
XGpio gpioOutput; | ||
XGpio GpioInput; | ||
|
||
int main(void) | ||
{ | ||
u32 InputData = 0; | ||
u32 InputData2 = 0; | ||
u32 InputData3 = 0; | ||
u32 InputData4 = 0; | ||
int Status; | ||
|
||
if(AudioPlayer_Init() != XST_SUCCESS) | ||
{ | ||
|
||
return XST_FAILURE; | ||
} | ||
char octaveCounter = 1; | ||
char soundType = 1; | ||
XGpio_Initialize(&gpioOutput, GPIO_OUTPUT_DEVICE_ID); | ||
XGpio_SetDataDirection(&gpioOutput, 2, 0x00000000); | ||
|
||
XGpio_Initialize(&GpioInput, GPIO_OUTPUT_DEVICE_ID); | ||
/* Set the direction for all signals to be inputs */ | ||
XGpio_SetDataDirection(&GpioInput, 1, 0xFFFFFFFF); | ||
|
||
while(1) | ||
{ | ||
char counter = 0; | ||
if(counter == 0 ){ | ||
|
||
XGpio_DiscreteWrite(&gpioOutput, 2, BIT0); | ||
GpioInputExample(GPIO_INPUT_DEVICE_ID, &InputData); | ||
if (Status != XST_SUCCESS) { | ||
|
||
} | ||
switch(InputData) | ||
{ | ||
case 14: AudioPlayer_SendTestSignal(4000,soundType,octaveCounter,1); break; | ||
case 13: AudioPlayer_SendTestSignal(4000,soundType,octaveCounter,2); break; | ||
case 12: AudioPlayer_SendTestSignal(4000,soundType,octaveCounter,3); break; | ||
case 7: AudioPlayer_SendTestSignal(4000,soundType,octaveCounter,4); break; | ||
default: break; | ||
} | ||
counter++; | ||
} | ||
|
||
if(counter == 1){ | ||
XGpio_DiscreteWrite(&gpioOutput, 2, BIT1); | ||
GpioInputExample(GPIO_INPUT_DEVICE_ID, &InputData2); | ||
if (Status != XST_SUCCESS) {} | ||
switch(InputData2) | ||
{ | ||
case 14: AudioPlayer_SendTestSignal(4000,soundType,octaveCounter,5); break; | ||
case 13: AudioPlayer_SendTestSignal(4000,soundType,octaveCounter,6); break; | ||
case 12: AudioPlayer_SendTestSignal(4000,soundType,octaveCounter,7); break; | ||
case 7: AudioPlayer_SendTestSignal(4000,soundType,octaveCounter,8); break; | ||
default: break; | ||
} | ||
counter++; | ||
} | ||
|
||
|
||
|
||
if(counter == 2){ | ||
XGpio_DiscreteWrite(&gpioOutput, 2, BIT2); | ||
GpioInputExample(GPIO_INPUT_DEVICE_ID, &InputData3); | ||
if (Status != XST_SUCCESS) { | ||
|
||
} | ||
switch(InputData3) | ||
{ | ||
case 14: AudioPlayer_SendTestSignal(4000,soundType,octaveCounter+1,1); break; | ||
case 13: AudioPlayer_SendTestSignal(4000,soundType,octaveCounter+1,2); break; | ||
case 12: AudioPlayer_SendTestSignal(4000,soundType,octaveCounter+1,3); break; | ||
case 7: AudioPlayer_SendTestSignal(4000,soundType,octaveCounter+1,4); break; | ||
default: break; | ||
} | ||
counter++; | ||
} | ||
|
||
if(counter == 3){ | ||
XGpio_DiscreteWrite(&gpioOutput, 2, BIT2); | ||
GpioInputExample(GPIO_INPUT_DEVICE_ID, &InputData4); | ||
if (Status != XST_SUCCESS) { | ||
|
||
} | ||
switch(InputData4) | ||
{ | ||
case 14: octaveCounter++; if (octaveCounter >2){octaveCounter = 1;} break; | ||
case 13: octaveCounter--; if (octaveCounter <1 ){octaveCounter = 2;} break; | ||
case 12: soundType++; if (soundType >4){soundType = 0;} break; | ||
case 7: soundType--; if (soundType <1){soundType = 4;} break; | ||
default: break; | ||
} | ||
counter++; | ||
} | ||
|
||
} | ||
return XST_FAILURE; | ||
|
||
} | ||
|
||
|
||
void GpioInputExample(u16 DeviceId, u32 *DataRead) | ||
{ | ||
|
||
/* Read the state of the data so that it can be verified */ | ||
*DataRead = XGpio_DiscreteRead(&GpioInput, 1); | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
...metadata/.plugins/org.eclipse.core.resources/.history/10/b035533175b5001b1b78ee76e3b8036d
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="ASCII"?> | ||
<sdkproject:SdkProject xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sdkproject="http://www.xilinx.com/sdkproject" name="Synthesiser" location="D:/GIT/SoCMyCock_Project/I2S_Audioplayer/AudioplayerC/Synthesiser" platform="D:/GIT/SoCMyCock_Project/I2S_Audioplayer/AudioplayerC/LowerFreqButtons/export/LowerFreqButtons/LowerFreqButtons.xpfm" platformUID="xilinx:minized::0.0(custom)" systemProject="Synthesiser_system" sysConfig="LowerFreqButtons" runtime="cpp" cpu="standalone_ps7_cortexa9_0" cpuInstance="ps7_cortexa9_0" os="standalone" mssSignature="4c7735b8b457fc535fc28f9c19fb1099"> | ||
<configuration name="Debug" id="xilinx.gnu.armv7.exe.debug.1758778525"> | ||
<configBuildOptions xsi:type="sdkproject:SdkOptions"/> | ||
<lastBuildOptions xsi:type="sdkproject:SdkOptions"/> | ||
</configuration> | ||
<configuration name="Release" id="xilinx.gnu.armv7.exe.release.1510637539" dirty="true"> | ||
<configBuildOptions xsi:type="sdkproject:SdkOptions"/> | ||
</configuration> | ||
<template appTemplateName="hello_world"/> | ||
</sdkproject:SdkProject> |
116 changes: 116 additions & 0 deletions
116
...metadata/.plugins/org.eclipse.core.resources/.history/10/c0fe254975b5001b1b78ee76e3b8036d
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
|
||
|
||
#include "xstatus.h" | ||
#include "AudioPlayer.h" | ||
#include "xparameters.h" | ||
#include "xgpio.h" | ||
#include "xil_printf.h" | ||
#include "xil_types.h" | ||
|
||
#define GPIO_BASE 0x41200000; | ||
#define GPIO_OUTPUT_DEVICE_ID XPAR_GPIO_0_DEVICE_ID | ||
#define GPIO_INPUT_DEVICE_ID XPAR_GPIO_0_DEVICE_ID | ||
|
||
#define BIT0 0x01 | ||
#define BIT1 0x02 | ||
#define BIT2 0x04 | ||
#define BIT3 0x08 | ||
|
||
void GpioInputExample(u16 DeviceId, u32 *DataRead); | ||
XGpio gpioOutput; | ||
XGpio GpioInput; | ||
|
||
int main(void) | ||
{ | ||
u32 InputData = 0; | ||
u32 InputData2 = 0; | ||
u32 InputData3 = 0; | ||
u32 InputData4 = 0; | ||
int Status; | ||
|
||
if(AudioPlayer_Init() != XST_SUCCESS) | ||
{ | ||
|
||
return XST_FAILURE; | ||
} | ||
char octaveCounter = 1; | ||
char soundType = 1; | ||
XGpio_Initialize(&gpioOutput, GPIO_OUTPUT_DEVICE_ID); | ||
XGpio_SetDataDirection(&gpioOutput, 2, 0x00000000); | ||
|
||
XGpio_Initialize(&GpioInput, GPIO_OUTPUT_DEVICE_ID); | ||
/* Set the direction for all signals to be inputs */ | ||
XGpio_SetDataDirection(&GpioInput, 1, 0xFFFFFFFF); | ||
|
||
while(1) | ||
{ | ||
if(XGpio_DiscreteWrite(&gpioOutput, 2, BIT0)) | ||
GpioInputExample(GPIO_INPUT_DEVICE_ID, &InputData); | ||
if (Status != XST_SUCCESS) { | ||
|
||
} | ||
switch(InputData) | ||
{ | ||
case 14: AudioPlayer_SendTestSignal(4000,soundType,octaveCounter,1); break; | ||
case 13: AudioPlayer_SendTestSignal(4000,soundType,octaveCounter,2); break; | ||
case 12: AudioPlayer_SendTestSignal(4000,soundType,octaveCounter,3); break; | ||
case 7: AudioPlayer_SendTestSignal(4000,soundType,octaveCounter,4); break; | ||
default: break; | ||
} | ||
|
||
if( XGpio_DiscreteWrite(&gpioOutput, 2, BIT1)){ | ||
|
||
if (Status != XST_SUCCESS) {} | ||
switch(InputData2) | ||
{ | ||
case 14: AudioPlayer_SendTestSignal(4000,soundType,octaveCounter,5); break; | ||
case 13: AudioPlayer_SendTestSignal(4000,soundType,octaveCounter,6); break; | ||
case 12: AudioPlayer_SendTestSignal(4000,soundType,octaveCounter,7); break; | ||
case 7: AudioPlayer_SendTestSignal(4000,soundType,octaveCounter,8); break; | ||
default: break; | ||
} | ||
} | ||
GpioInputExample(GPIO_INPUT_DEVICE_ID, &InputData2); | ||
|
||
|
||
XGpio_DiscreteWrite(&gpioOutput, 2, BIT2); | ||
GpioInputExample(GPIO_INPUT_DEVICE_ID, &InputData3); | ||
if (Status != XST_SUCCESS) { | ||
|
||
} | ||
switch(InputData3) | ||
{ | ||
case 14: AudioPlayer_SendTestSignal(4000,soundType,octaveCounter+1,1); break; | ||
case 13: AudioPlayer_SendTestSignal(4000,soundType,octaveCounter+1,2); break; | ||
case 12: AudioPlayer_SendTestSignal(4000,soundType,octaveCounter+1,3); break; | ||
case 7: AudioPlayer_SendTestSignal(4000,soundType,octaveCounter+1,4); break; | ||
default: break; | ||
} | ||
|
||
XGpio_DiscreteWrite(&gpioOutput, 2, BIT3); | ||
GpioInputExample(GPIO_INPUT_DEVICE_ID, &InputData4); | ||
if (Status != XST_SUCCESS) { | ||
|
||
} | ||
switch(InputData4) | ||
{ | ||
case 14: octaveCounter++; if (octaveCounter >2){octaveCounter = 1;} break; | ||
case 13: octaveCounter--; if (octaveCounter <1 ){octaveCounter = 2;} break; | ||
case 12: soundType++; if (soundType >4){soundType = 0;} break; | ||
case 7: soundType--; if (soundType <1){soundType = 4;} break; | ||
default: break; | ||
} | ||
|
||
} | ||
return XST_FAILURE; | ||
|
||
} | ||
|
||
|
||
void GpioInputExample(u16 DeviceId, u32 *DataRead) | ||
{ | ||
|
||
/* Read the state of the data so that it can be verified */ | ||
*DataRead = XGpio_DiscreteRead(&GpioInput, 1); | ||
|
||
} |
121 changes: 121 additions & 0 deletions
121
...metadata/.plugins/org.eclipse.core.resources/.history/11/90365d8374b5001b1b78ee76e3b8036d
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
|
||
|
||
#include "xstatus.h" | ||
#include "AudioPlayer.h" | ||
#include "xparameters.h" | ||
#include "xgpio.h" | ||
#include "xil_printf.h" | ||
#include "xil_types.h" | ||
|
||
#define GPIO_BASE 0x41200000; | ||
#define GPIO_OUTPUT_DEVICE_ID XPAR_GPIO_0_DEVICE_ID | ||
#define GPIO_INPUT_DEVICE_ID XPAR_GPIO_0_DEVICE_ID | ||
|
||
#define BIT0 0x01 | ||
#define BIT1 0x02 | ||
#define BIT2 0x04 | ||
#define BIT3 0x08 | ||
|
||
void GpioInputExample(u16 DeviceId, u32 *DataRead); | ||
XGpio gpioOutput; | ||
XGpio GpioInput; | ||
|
||
int main(void) | ||
{ | ||
u32 InputData = 0; | ||
u32 InputData2 = 0; | ||
u32 InputData3 = 0; | ||
u32 InputData4 = 0; | ||
int Status; | ||
|
||
if(AudioPlayer_Init() != XST_SUCCESS) | ||
{ | ||
|
||
return XST_FAILURE; | ||
} | ||
char octaveCounter = 1; | ||
char soundType = 1; | ||
XGpio_Initialize(&gpioOutput, GPIO_OUTPUT_DEVICE_ID); | ||
XGpio_SetDataDirection(&gpioOutput, 2, 0x00000000); | ||
|
||
XGpio_Initialize(&GpioInput, GPIO_OUTPUT_DEVICE_ID); | ||
/* Set the direction for all signals to be inputs */ | ||
XGpio_SetDataDirection(&GpioInput, 1, 0xFFFFFFFF); | ||
|
||
while(1) | ||
{ | ||
for(int i = 1; i< 9; i = i*2){ | ||
if(i == 1) | ||
{ | ||
|
||
} | ||
} | ||
XGpio_DiscreteWrite(&gpioOutput, 2, BIT0); | ||
GpioInputExample(GPIO_INPUT_DEVICE_ID, &InputData); | ||
if (Status != XST_SUCCESS) { | ||
|
||
} | ||
switch(InputData) | ||
{ | ||
case 14: AudioPlayer_SendTestSignal(4000,soundType,octaveCounter,1); break; | ||
case 13: AudioPlayer_SendTestSignal(4000,soundType,octaveCounter,2); break; | ||
case 12: AudioPlayer_SendTestSignal(4000,soundType,octaveCounter,3); break; | ||
case 7: AudioPlayer_SendTestSignal(4000,soundType,octaveCounter,4); break; | ||
default: break; | ||
} | ||
|
||
XGpio_DiscreteWrite(&gpioOutput, 2, BIT1); | ||
GpioInputExample(GPIO_INPUT_DEVICE_ID, &InputData2); | ||
if (Status != XST_SUCCESS) { | ||
|
||
} | ||
switch(InputData2) | ||
{ | ||
case 14: AudioPlayer_SendTestSignal(4000,soundType,octaveCounter,5); break; | ||
case 13: AudioPlayer_SendTestSignal(4000,soundType,octaveCounter,6); break; | ||
case 12: AudioPlayer_SendTestSignal(4000,soundType,octaveCounter,7); break; | ||
case 7: AudioPlayer_SendTestSignal(4000,soundType,octaveCounter,8); break; | ||
default: break; | ||
} | ||
|
||
XGpio_DiscreteWrite(&gpioOutput, 2, BIT2); | ||
GpioInputExample(GPIO_INPUT_DEVICE_ID, &InputData3); | ||
if (Status != XST_SUCCESS) { | ||
|
||
} | ||
switch(InputData3) | ||
{ | ||
case 14: AudioPlayer_SendTestSignal(4000,soundType,octaveCounter+1,1); break; | ||
case 13: AudioPlayer_SendTestSignal(4000,soundType,octaveCounter+1,2); break; | ||
case 12: AudioPlayer_SendTestSignal(4000,soundType,octaveCounter+1,3); break; | ||
case 7: AudioPlayer_SendTestSignal(4000,soundType,octaveCounter+1,4); break; | ||
default: break; | ||
} | ||
|
||
XGpio_DiscreteWrite(&gpioOutput, 2, BIT3); | ||
GpioInputExample(GPIO_INPUT_DEVICE_ID, &InputData4); | ||
if (Status != XST_SUCCESS) { | ||
|
||
} | ||
switch(InputData4) | ||
{ | ||
case 14: octaveCounter++; if (octaveCounter >2){octaveCounter = 1;} break; | ||
case 13: octaveCounter--; if (octaveCounter <1 ){octaveCounter = 2;} break; | ||
case 12: soundType++; if (soundType >4){soundType = 0;} break; | ||
case 7: soundType--; if (soundType <1){soundType = 4;} break; | ||
default: break; | ||
} | ||
|
||
} | ||
return XST_FAILURE; | ||
|
||
} | ||
|
||
|
||
void GpioInputExample(u16 DeviceId, u32 *DataRead) | ||
{ | ||
|
||
/* Read the state of the data so that it can be verified */ | ||
*DataRead = XGpio_DiscreteRead(&GpioInput, 1); | ||
|
||
} |
Oops, something went wrong.