AnsweredAssumed Answered

KSDK-1.1 SAI documentation error

Question asked by Ole Asbjorn Fadum on Jan 21, 2015
Latest reply on Jan 25, 2015 by likong

In the KSDK v-1.1 API Reference Manual Rev. 0 (file:///C:/Freescale/KSDK_1.1.0/doc/Kinetis%20SDK%20v.1.1%20API%20Reference%20Manual/group__sai__driver.html)

the steps to use SAI is as follows:

 

1. Initialize the SAI module by calling the SAI_DRV_TxInit() function.
2. Configure the audio data features of SAI by calling the SAI_DRV_TxConfigDataFormat() function.
3. Send/receive data by calling the SAI_DRV_SendData() or the SAI_DRV_ReceiveData() functions.
4. Start Tx or Rx by calling the SAI_DRV_TxStartModule() or the SAI_DRV_RxStartModule() function.

5. Shut down the SAI module by calling the SAI_DRV_TxDeinit() function.

But when I investigate the source (KSDK_1.1.0\platform\sai\fsl_sai_driver.c)

 

The Send/Receive_Data looks like this:

 

/*FUNCTION**********************************************************************

*

* Function Name : SAI_DRV_SendData

* Description   : The function would tell sai driver to start send a period of

* data to sai tx fifo.

*END**************************************************************************/

uint32_t SAI_DRV_SendData(uint32_t instance, uint8_t *addr, uint32_t len)

{

    sai_state_ids[instance][0]->len = len;

    sai_state_ids[instance][0]->address= addr;

    SAI_DRV_TxStartModule(instance);

    return len;

}

 

/*FUNCTION**********************************************************************

*

* Function Name : SAI_DRV_ReceiveData

* Description   : The function would tell sai driver to start receive a period of

* data from sai rx fifo.

*END**************************************************************************/

uint32_t SAI_DRV_ReceiveData(uint32_t instance, uint8_t *addr, uint32_t len)

{

    sai_state_ids[instance][1]->len = len;

    sai_state_ids[instance][1]->address= addr;

    SAI_DRV_RxStartModule(instance);

    return len;

}

 

The #4 (SAI_DRV_TxStartModule() / SAI_DRV_RxStartModule()) is performed by SAI_DRV_SendData() / SAI_DRV_ReceiveData() and are not necessary to call again.

Outcomes