- Main Page
- Related Pages
- Files

# ssc_i2s.h

Go to the documentation of this file.

    00001 /*This file has been prepared for Doxygen automatic documentation generation.*/
    00019 /* Copyright (C) 2006-2008, Atmel Corporation All rights reserved.
    00020  *
    00021  * Redistribution and use in source and binary forms, with or without
    00022  * modification, are permitted provided that the following conditions are met:
    00023  *
    00024  * 1. Redistributions of source code must retain the above copyright notice,
    00025  * this list of conditions and the following disclaimer.
    00026  *
    00027  * 2. Redistributions in binary form must reproduce the above copyright notice,
    00028  * this list of conditions and the following disclaimer in the documentation
    00029  * and/or other materials provided with the distribution.
    00030  *
    00031  * 3. The name of ATMEL may not be used to endorse or promote products derived
    00032  * from this software without specific prior written permission.
    00033  *
    00034  * THIS SOFTWARE IS PROVIDED BY ATMEL ``AS IS'' AND ANY EXPRESS OR IMPLIED
    00035  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    00036  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND
    00037  * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT,
    00038  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
    00039  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
    00040  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    00041  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    00042  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
    00043  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    00044  */
    00045
    00046
    00047 #ifndef _SSC_I2S_H_
    00048 #define _SSC_I2S_H_
    00049
    00050 #include <avr32/io.h>
    00051
    00052
    00053 #define SSC_I2S_TIMEOUT_VALUE   10000
    00054
    00055
    00057 enum
    00058 {
    00059   SSC_I2S_ERROR = -1,
    00060   SSC_I2S_OK = 0,
    00061   SSC_I2S_TIMEOUT = 1,
    00062   SSC_I2S_ERROR_ARGUMENT,
    00063   SSC_I2S_ERROR_RX,
    00064   SSC_I2S_ERROR_TX
    00065 };
    00066
    00068 enum
    00069 {
    00070   SSC_I2S_MODE_STEREO_OUT = 1,
    00071   SSC_I2S_MODE_SLAVE_STEREO_OUT,
    00072   SSC_I2S_MODE_STEREO_OUT_MONO_IN,
    00073   SSC_I2S_MODE_RIGHT_IN,
    00074   SSC_I2S_MODE_STEREO_IN,
    00075   SSC_I2S_MODE_STEREO_OUT_STEREO_IN
    00076 };
    00077
    00078
    00083 extern void ssc_i2s_reset(volatile avr32_ssc_t *ssc);
    00084
    00104 extern int ssc_i2s_init(volatile avr32_ssc_t *ssc,
    00105                         unsigned int sample_frequency,
    00106                         unsigned int data_bit_res,
    00107                         unsigned int frame_bit_res,
    00108                         unsigned char mode,
    00109                         unsigned int pba_hz);
    00110
    00120 extern int ssc_i2s_transfer(volatile avr32_ssc_t *ssc, unsigned int data);
    00121
    00127 extern void ssc_i2s_disable_interrupts(volatile avr32_ssc_t *ssc, unsigned long int_mask);
    00128
    00134 extern void ssc_i2s_enable_interrupts(volatile avr32_ssc_t *ssc, unsigned long int_mask);
    00135
    00142 extern unsigned long ssc_i2s_get_status(volatile avr32_ssc_t *ssc);
    00143
    00144
    00145 #endif  // _SSC_I2S_H_