1. 有的。
2. OpenDCI 有支援I2S 模式,請看 C:\Program Files\Microchip\MPLAB C30\docs\16-bit Peripheral Libraries.htm 的說明
3.5 OpenDCI
Function Prototype
void OpenDCI(unsigned int config1,
unsigned int config2,
unsigned int config3,
unsigned int trans_mask,
unsigned int recv_mask);
Include
dci.h
Description
This function configures the DCI module.
Arguments
config1 - The parameters to be configured in the DCION1 register as defined below:
Module On/Off
DCI_EN
DCI_DIS
Idle Mode Operation
DCI_IDLE_CON
DCI_IDLE_STOP
DCI Loopback Mode Enable
DCI_DIGI_LPBACK_EN
DCI_DIGI_LPBACK_DIS
CSCK pin direction select
DCI_SCKD_INP
DCI_SCKD_OUP
DCI sampling edge selection
DCI_SAMP_CLK_RIS
DCI_SAMP_CLK_FAL
FS pin direction select
DCI_FSD_INP
DCI_FSD_OUP
Data to be transmitted during underflow
DCI_TX_LASTVAL_UNF
DCI_TX_ZERO_UNF
SDO pin status during transmit disable
DCI_SDO_TRISTAT
DCI_SDO_ZERO
Data justification control
DCI_DJST_ON
DCI_DJST_OFF
Frame Sync mode select
DCI_FSM_ACLINK_20BIT
DCI_FSM_ACLINK_16BIT
DCI_FSM_I2S
DCI_FSM_MULTI
config2 - This contains the parameters to be configured in
the DCICON2 register as defined below:
DCI Buffer length
DCI_BUFF_LEN_4
DCI_BUFF_LEN_3
DCI_BUFF_LEN_2
DCI_BUFF_LEN_1
DCI Frame sync generator control
DCI_FRAME_LEN_16
DCI_FRAME_LEN_15
DCI_FRAME_LEN_14
.....
DCI_FRAME_LEN_1
DCI data word size
DCI_DATA_WORD_16
DCI_DATA_WORD_15
DCI_DATA_WORD_14
.....
DCI_DATA_WORD_5
DCI_DATA_WORD_4
config3 - The bit clock generator value to be configured in the DCICON3 register.
trans_mask - The transmit / receive slot.
recv_mask - Enable bits to be configured into the TSCON / RSCON register as defined below:
DCI_DIS_SLOT_15
DCI_DIS_SLOT_14
.....
DCI_DIS_SLOT_1
DCI_DIS_SLOT_0
DCI_EN_SLOT_ALL
DCI_DIS_SLOT_ALL
Return Value
None
Remarks:
This routine configures the following parameters:
1. DCICON1 register: Enable bit, Frame Sync mode, Data Justification, Sample Clock Direction, Sample Clock, Edge Control, Output Frame Synchronization Directions Control, Continuous Transmit/Receive mode, Underflow mode.
2. DCICON2 register: Frame Sync Generator Control, Data Word Size bits, Buffer Length Control bits.
3. DCICON3 register: Clock Generator Control bits
4. TSCON register: Transmit Time Slot Enable Control bits.
5. RSCON register: Receive Time Slot Enable Control bits.
Source File:
OpenDCI.c