IISC provides a 5-wire, bidirectional, synchronous, digital audio link with off-chip audio devices: ISDI, ISDO, IWS, ISCK and IMCK pins.
#define IISC_DATALENGTH |
( |
|
x | ) |
|
Value:(AVR32_IISC_MR_DATALENGTH##x \
<< AVR32_IISC_MR_DATALENGTH_OFFSET)
!
IISC data length configuration macro
Set datalength to 16 bits compact stereo (left sample in bits 15 through 0 and right samples in bits 31 through 16 of the same word)
Set datalength to 8 bits.
Set datalength to 16 bits.
Set datalength to 18 bits.
Set datalength to 20 bits.
Set datalength to 24 bits.
Set datalength to 32 bits
Set datalength to 8 bits compact stereo (left sample in bits 7 through 0 and right samples in bits 15 through 8 of the same word)
#define IISC_FORMAT_LJ AVR32_IISC_MR_FORMAT_LJ |
#define IISC_FORMAT_TDM_LJ AVR32_IISC_MR_FORMAT_TDM_LJ |
#define IISC_OVERSAMPLING |
( |
|
x | ) |
|
Value:(AVR32_IISC_MR_IMCKFS##x \
<< AVR32_IISC_MR_IMCKFS_OFFSET)
#define IISC_RETRY_VALUE 10000 |
#define IISC_RXDMA_MULTIPLE |
Value:(AVR32_IISC_MR_RXDMA_MULTIPLE << \
AVR32_IISC_MR_RXDMA_OFFSET)
#define IISC_RXDMA_SINGLE |
Value:(AVR32_IISC_MR_RXDMA_SINGLE << \
AVR32_IISC_MR_RXDMA_OFFSET)
#define IISC_TXDMA_MULTIPLE |
Value:(AVR32_IISC_MR_TXDMA_MULTIPLE << \
AVR32_IISC_MR_TXDMA_OFFSET)
#define IISC_TXDMA_SINGLE |
Value:(AVR32_IISC_MR_TXDMA_SINGLE << \
AVR32_IISC_MR_TXDMA_OFFSET)
IISC modes.
Enumerator |
---|
IISC_MODE_MASTER |
|
IISC_MODE_SLAVE |
|
IISC_MODE_TDM_MASTER |
|
IISC_MODE_TDM_SLAVE |
|
void iisc_disable |
( |
volatile avr32_iisc_t * |
iisc | ) |
|
static void iisc_disable_clocks |
( |
volatile avr32_iisc_t * |
iisc | ) |
|
|
inlinestatic |
Disable the clocks for the IISC module.
- Parameters
-
iisc | pointer to the correct volatile avr32_iisc_t struct |
Referenced by iisc_disable().
void iisc_disable_interrupts |
( |
volatile avr32_iisc_t * |
iisc, |
|
|
unsigned long |
int_mask |
|
) |
| |
Disables the specified IISC interrupts.
- Parameters
-
iisc | Base address of the IISC instance. |
int_mask | Bit-mask of IISC interrupts (AVR32_IDR_x_MASK ). |
References cpu_irq_restore(), and cpu_irq_save().
static void iisc_disable_reception |
( |
volatile avr32_iisc_t * |
iisc | ) |
|
|
inlinestatic |
Disable the IISC module in reception.
- Parameters
-
iisc | pointer to the correct volatile avr32_iisc_t struct |
Referenced by iisc_disable().
static void iisc_disable_transmission |
( |
volatile avr32_iisc_t * |
iisc | ) |
|
|
inlinestatic |
Disable the IISC module in transmission.
- Parameters
-
iisc | pointer to the correct volatile avr32_iisc_t struct |
Referenced by iisc_disable().
void iisc_enable |
( |
volatile avr32_iisc_t * |
iisc | ) |
|
static void iisc_enable_clocks |
( |
volatile avr32_iisc_t * |
iisc | ) |
|
|
inlinestatic |
Enable the clocks for the IISC module.
- Parameters
-
iisc | pointer to the correct volatile avr32_iisc_t struct |
Referenced by iisc_enable().
void iisc_enable_interrupts |
( |
volatile avr32_iisc_t * |
iisc, |
|
|
unsigned long |
int_mask |
|
) |
| |
Enables the specified IISC interrupts.
- Parameters
-
iisc | Base address of the IISC instance. |
int_mask | Bit-mask of IISC interrupts (AVR32_IER_x_MASK ). |
static void iisc_enable_reception |
( |
volatile avr32_iisc_t * |
iisc | ) |
|
|
inlinestatic |
Enable the IISC module in reception.
- Parameters
-
iisc | pointer to the correct volatile avr32_iisc_t struct |
Referenced by iisc_enable().
static void iisc_enable_transmission |
( |
volatile avr32_iisc_t * |
iisc | ) |
|
|
inlinestatic |
Enable the IISC module in transmission.
- Parameters
-
iisc | pointer to the correct volatile avr32_iisc_t struct |
Referenced by iisc_enable().
unsigned long iisc_get_status |
( |
volatile avr32_iisc_t * |
iisc | ) |
|
Returns the IISC status.
- Parameters
-
iisc | Base address of the IISC instance. |
- Returns
- The IISC Status Register.
Sets up registers and initializes IISC for use as I2S.
- Parameters
-
iisc | Pointer to the correct volatile avr32_iisc_t struct |
iisc_opt | Option structure for IISC Configuration. |
- Returns
- Status
- Return values
-
IISC_OK | when no error occurred. |
IISC_ERROR_ARGUMENT | when invalid arguments are passed |
References ERR_INVALID_ARG, if(), IISC_MODE_MASTER, IISC_MODE_SLAVE, IISC_MODE_TDM_MASTER, iisc_reset(), iisc_opt_t::mode, iisc_opt_t::num_rx_channels, iisc_opt_t::num_tx_channels, iisc_opt_t::option, rx_is_enabled, STATUS_OK, and tx_is_enabled.
status_code_t iisc_read |
( |
volatile avr32_iisc_t * |
iisc, |
|
|
uint32_t * |
data |
|
) |
| |
Read a single message of data.
- Parameters
-
iisc | Pointer to the correct volatile avr32_iisc_t struct |
*data | The data to read |
- Returns
- Status
- Return values
-
IISC_OK | when no error occurred. |
IISC_TIMEOUT | when a timeout occurred while trying to transfer |
References ERR_TIMEOUT, IISC_RETRY_VALUE, and STATUS_OK.
static void iisc_reset |
( |
volatile avr32_iisc_t * |
iisc | ) |
|
|
inlinestatic |
Resets the IISC module.
- Parameters
-
iisc | pointer to the correct volatile avr32_iisc_t struct |
Referenced by iisc_init().
status_code_t iisc_write |
( |
volatile avr32_iisc_t * |
iisc, |
|
|
uint32_t |
data |
|
) |
| |
Write a single message of data.
- Parameters
-
iisc | Pointer to the correct volatile avr32_iisc_t struct |
data | The data to write |
- Returns
- Status
- Return values
-
IISC_OK | when no error occurred. |
IISC_TIMEOUT | when a timeout occurred while trying to transfer |
References data, ERR_TIMEOUT, IISC_RETRY_VALUE, and STATUS_OK.