コード例 #1
0
ファイル: audiotest1.cpp プロジェクト: cilver/mediacenter
void AudioTest1::init()
{
    uart = Uart::getInstance();
    uart->init((volatile uint32_t *)UART_BASE);
    uart->puts("AudioTest1 StartUp...\r\n");
    i2cBus = new I2C((volatile uint32_t *)SND_I2C_SCL_BASE, (volatile uint32_t *)SND_I2C_SDA_BASE);
    soundCard = new SoundCard(i2cBus, (volatile uint32_t *)AUDIO_IF_0_BASE);
    soundCard->init();
}
コード例 #2
0
ファイル: camera.c プロジェクト: NESIBoard/nesi-source
static CameraError retrievePic(String imgName)
{
    setPowerOutput(ON);
    /**
     * Increasing Power On Period
     *
     * Although the data sheet says that the camera needs ~1.5 sec to start-up,
     * in practice 2 sec makes for a much more reliable situation.
     */
    wait(2000);//1500);

    // initialize camera and image storage
    cameraComPort.init();
    cameraComPort.baudrate(14400);
    //imageFile = getFileStream();
    imageFile = FSfopen(imgName, "w");
    CameraError error = NO_FILE;

    //if(imageFile.open)
    if(imageFile)
    {
        //FSfclose(FSfopen(imgName, "w")); // erase file
        //imageFile.open(imgName); // open file
        error = getPicture();
        FSfclose(imageFile);
        imageFile = NullPtr;
        //imageFile.close();
    }

    //imageFile.free();

    setPowerOutput(OFF);
    wait(1000);

    return error;
}