#include "stm32f4xx.h"
#include "system_stm32f4xx.h"
#include "stm32f4xx_rcc.h"
#include "stm32f4xx_gpio.h"
#include "delay.h"
#include "spi_sd.h"
#include "ff.h"
#include "diskio.h"
#include "mp3codec.h"
#include "mp3_config_pins.h"
#include "vs1011_rejestry.h"
#include "typy_zmiennych.h"
#include "integer.h" //typy zmiennych dla fatfs
FATFS fatfs; ///* Work area (file system object) for logical drive */
FIL plik; ///* File object */
FRESULT fresult; /* FatFs return code */
UINT zapisanych_bajtow = 0;
UINT odczytanych_bajtow = 0;
char * buffor = "123456789abcdefghijklmnoprstuwxyz\r\n";
u_int8 buffor2[56000];
//u_int8 buffor3[56000];
u_int8 i=0,k=0;
int main( void )
{
SystemInit();
SPI_SD_Init();
MP3_CONFIG_PIN();
GPIO_InitTypeDef gpio; // obiekt gpio z konfiguracja portow GPIO
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOD,ENABLE); // uruchomienie zegara modulu GPIO
GPIO_StructInit(&gpio); // domyslna konfiguracja
gpio.GPIO_Pin = GPIO_Pin_12 | GPIO_Pin_13; // konfigurujemy pin 5
gpio.GPIO_PuPd = GPIO_PuPd_NOPULL;
gpio.GPIO_Mode = GPIO_Mode_OUT;
gpio.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOD, &gpio); // inicjalizacja modulu GPIOA
delay_init( 168 );
delay_ms(10);
fresult = f_mount( 0, &fatfs );
if (fresult == FR_OK)
{
GPIO_SetBits(GPIOD, GPIO_Pin_12); // zapalenie diody sygnalizuje ze nastapilo poprawne zamontowanie karty
}
fresult = f_open( &plik, "odpal.wav",FA_READ);
fresult = f_read(&plik, buffor2, sizeof buffor2, &odczytanych_bajtow); /* Read a chunk of source file */
fresult = f_close(&plik);
ustaw_dekoder_mp3();
while(1)
{
SendStreamForDecode(buffor2,odczytanych_bajtow);
}
ResetSDIMode();
return 0;
}
void SysTick_Handler()
{
disk_timerproc();
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}