?? ixsspacc.h
字號:
* - IX_SSP_RX_FIFO_NOT_EMPTY - Rx FIFO not empty, data size change is not * allowed. * - IX_SSP_TX_FIFO_NOT_EMPTY - Tx FIFO not empty, data size change is not * allowed. * - IX_SSP_INVALID_FRAME_FORMAT_ENUM_VALUE - frame format selected is invalid * - IX_SSP_INVALID_DATA_SIZE_ENUM_VALUE - data size selected is invalid * - IX_SSP_INVALID_CLOCK_SOURCE_ENUM_VALUE - clock source selected is invalid * - IX_SSP_INVALID_TX_FIFO_THRESHOLD_ENUM_VALUE - Tx FIFO threshold level * selected is invalid * - IX_SSP_INVALID_RX_FIFO_THRESHOLD_ENUM_VALUE - Rx FIFO threshold level * selected is invalid * - IX_SSP_INVALID_SPI_PHASE_ENUM_VALUE - SPI phase selected is invalid * - IX_SSP_INVALID_SPI_POLARITY_ENUM_VALUE - SPI polarity selected is invalid * - IX_SSP_INVALID_MICROWIRE_CTL_CMD_ENUM_VALUE - microwire control command * size is invalid * - IX_SSP_INT_UNBIND_FAIL - interrupt handler failed to unbind SSP interrupt * - IX_SSP_INT_BIND_FAIL - interrupt handler failed to bind to SSP interrupt * hardware trigger * - IX_SSP_NOT_SUPORTED - hardware does not support SSP * - IX_SSP_NULL_POINTER - parameter passed in is NULL * * @li Reentrant : yes * @li ISR Callable : yes * */PUBLIC IX_SSP_STATUSixSspAccInit (IxSspInitVars *initVarsSelected);/** * @ingroup IxSspAcc * * @fn ixSspAccUninit ( void) * * @brief Un-initializes the SSP Serial Port Access component * * @param - None * * Global Data : * - None. * * This API will disable the SSP Serial Port hardware. The client can call the * init function again if they wish to enable the SSP. * * @return * - IX_SSP_SUCCESS - successfully uninit SSP component * - IX_SSP_INT_UNBIND_FAIL - interrupt handler failed to unbind SSP interrupt * * @li Reentrant : yes * @li ISR Callable : yes * */PUBLIC IX_SSP_STATUSixSspAccUninit (void);/** * @ingroup IxSspAcc * * @fn ixSspAccFIFODataSubmit ( UINT16 *data, UINT32 amtOfData) * * @brief Inserts data into the SSP Serial Port's FIFO * * @param "UINT16 [in] *data" - pointer to the location to transmit the data * from * "UINT32 [in] amtOfData" - number of data to be transmitted. * * Global Data : * - None. * * This API will insert the amount of data specified by "amtOfData" from buffer * pointed to by "data" into the FIFO to be transmitted by the hardware. * * @return * - IX_SSP_SUCCESS - Data inserted successfully into FIFO * - IX_SSP_FAIL - FIFO insufficient space * - IX_SSP_NULL_POINTER - data pointer passed by client is NULL * - IX_SSP_NOT_INIT - SSP not initialized. SSP init needs to be called. * * @li Reentrant : yes * @li ISR Callable : yes * */PUBLIC IX_SSP_STATUSixSspAccFIFODataSubmit ( UINT16* data, UINT32 amtOfData);/** * @ingroup IxSspAcc * * @fn ixSspAccFIFODataReceive ( UINT16 *data, UINT32 amtOfData) * * @brief Extract data from the SSP Serial Port's FIFO * * @param "UINT16 [in] *data" - pointer to the location to receive the data into * "UINT32 [in] amtOfData" - number of data to be received. * * Global Data : * - None. * * This API will extract the amount of data specified by "amtOfData" from the * FIFO already received by the hardware into the buffer pointed to by "data". * * @return * - IX_SSP_SUCCESS - Data extracted successfully from FIFO * - IX_SSP_FAIL - FIFO has no data * - IX_SSP_NULL_POINTER - data pointer passed by client is NULL * - IX_SSP_NOT_INIT - SSP not initialized. SSP init needs to be called. * * @li Reentrant : yes * @li ISR Callable : yes * */PUBLIC IX_SSP_STATUSixSspAccFIFODataReceive ( UINT16* data, UINT32 amtOfData);/** * Polling Functions *//** * @ingroup IxSspAcc * * @fn ixSspAccTxFIFOHitOrBelowThresholdCheck ( void) * * @brief Check if the Tx FIFO threshold has been hit or fallen below. * * @param - None * * Global Data : * - None. * * This API will return whether the Tx FIFO threshold has been exceeded or not * * @return * - IX_SSP_TX_FIFO_HIT_BELOW_THRESHOLD - Tx FIFO level hit or below threshold . * - IX_SSP_TX_FIFO_EXCEED_THRESHOLD - Tx FIFO level exceeded threshold. * - IX_SSP_NOT_INIT - SSP not initialized. SSP init needs to be called. * * @li Reentrant : yes * @li ISR Callable : yes * */PUBLIC IX_SSP_STATUSixSspAccTxFIFOHitOrBelowThresholdCheck ( void);/** * @ingroup IxSspAcc * * @fn ixSspAccRxFIFOHitOrAboveThresholdCheck ( void) * * @brief Check if the Rx FIFO threshold has been hit or exceeded. * * @param - None * * Global Data : * - None. * * This API will return whether the Rx FIFO level is below threshold or not * * @return * - IX_SSP_RX_FIFO_HIT_ABOVE_THRESHOLD - Rx FIFO level hit or exceeded threshold * - IX_SSP_RX_FIFO_BELOW_THRESHOLD - Rx FIFO level below threshold * - IX_SSP_NOT_INIT - SSP not initialized. SSP init needs to be called. * * @li Reentrant : yes * @li ISR Callable : yes * */PUBLIC IX_SSP_STATUSixSspAccRxFIFOHitOrAboveThresholdCheck ( void);/** * Configuration functions * * NOTE: These configurations are not required to be called once init is called * unless configurations need to be changed on the fly. *//** * @ingroup IxSspAcc * * @fn ixSspAccSSPPortStatusSet ( IxSspAccPortStatus portStatusSelected) * * @brief Enables/disables the SSP Serial Port hardware. * * @param "IxSspAccPortStatus [in] portStatusSelected" - Set the SSP port to * enable or disable * * Global Data : * - None. * * This API will enable/disable the SSP Serial Port hardware. * NOTE: This function is called by init to enable the SSP after setting up the * configurations and by uninit to disable the SSP. * * @return * - IX_SSP_SUCCESS - Port status set with valid enum value * - IX_SSP_FAIL - invalid enum value * - IX_SSP_NOT_INIT - SSP not initialized. SSP init needs to be called. * * @li Reentrant : yes * @li ISR Callable : yes * */PUBLIC IX_SSP_STATUSixSspAccSSPPortStatusSet ( IxSspAccPortStatus portStatusSelected);/** * @ingroup IxSspAcc * * @fn ixSspAccFrameFormatSelect ( IxSspAccFrameFormat frameFormatSelected) * * @brief Sets the frame format for the SSP Serial Port hardware * * @param "IxSspAccFrameFormat [in] frameFormatSelected" - The frame format of * SPI, SSP or Microwire can be selected as the format * * Global Data : * - None. * * This API will set the format for the transfers via user input. * *NOTE*: The SSP hardware will be disabled to clear the FIFOs. Then its * previous state (enabled/disabled) restored after changing the format. * * @return * - IX_SSP_SUCCESS - frame format set with valid enum value * - IX_SSP_INVALID_FRAME_FORMAT_ENUM_VALUE - invalid frame format value * - IX_SSP_NOT_INIT - SSP not initialized. SSP init needs to be called. * * @li Reentrant : yes * @li ISR Callable : yes * */PUBLIC IX_SSP_STATUSixSspAccFrameFormatSelect ( IxSspAccFrameFormat frameFormatSelected);/** * @ingroup IxSspAcc * * @fn ixSspAccDataSizeSelect ( IxSspAccDataSize dataSizeSelected) * * @brief Sets the data size for transfers * * @param "IxSspAccDataSize [in] dataSizeSelected" - The data size between 4 * and 16 that can be selected for data transfers * * Global Data : * - None. * * This API will set the data size for the transfers via user input. It will * disallow the change of the data size if either of the Rx/Tx FIFO is not * empty to prevent data loss. * *NOTE*: The SSP port will be disabled if the FIFOs are found to be empty and * if between the check and disabling of the SSP (which clears the * FIFOs) data is received into the FIFO, it might be lost. * *NOTE*: The FIFOs can be cleared by disabling the SSP Port if necessary to * force the data size change. * * @return * - IX_SSP_SUCCESS - data size set with valid enum value * - IX_SSP_RX_FIFO_NOT_EMPTY - Rx FIFO not empty, data size change is not * allowed. * - IX_SSP_TX_FIFO_NOT_EMPTY - Tx FIFO not empty, data size change is not * allowed. * - IX_SSP_INVALID_DATA_SIZE_ENUM_VALUE - invalid enum value * - IX_SSP_NOT_INIT - SSP not initialized. SSP init needs to be called. * * @li Reentrant : yes * @li ISR Callable : yes * */PUBLIC IX_SSP_STATUSixSspAccDataSizeSelect ( IxSspAccDataSize dataSizeSelected);/** * @ingroup IxSspAcc * * @fn ixSspAccClockSourceSelect( IxSspAccClkSource clkSourceSelected) * * @brief Sets the clock source of the SSP Serial Port hardware * * @param "IxSspAccClkSource [in] clkSourceSelected" - The clock source from * either external source on on-chip can be selected as the source * * Global Data : * - None. * * This API will set the clock source for the transfers via user input. * * @return * - IX_SSP_SUCCESS - clock source set with valid enum value * - IX_SSP_INVALID_CLOCK_SOURCE_ENUM_VALUE - invalid enum value * - IX_SSP_NOT_INIT - SSP not initialized. SSP init needs to be called. * * @li Reentrant : yes * @li ISR Callable : yes * */PUBLIC IX_SSP_STATUSixSspAccClockSourceSelect ( IxSspAccClkSource clkSourceSelected);/** * @ingroup IxSspAcc * * @fn ixSspAccSerialClockRateConfigure ( UINT8 serialClockRateSelected) * * @brief Sets the on-chip Serial Clock Rate of the SSP Serial Port hardware. * * @param "UINT8 [in] serialClockRateSelected" - The serial clock rate that can * be set is between 7.2Kbps and 1.8432Mbps. The formula used is * Bit rate = 3.6864x10^6 / (2 x (SerialClockRateSelected + 1)) * * Global Data : * - None. * * This API will set the serial clock rate for the transfers via user input. * * @return * - IX_SSP_SUCCESS - Serial clock rate configured successfully * - IX_SSP_NOT_INIT - SSP not initialized. SSP init needs to be called. * * @li Reentrant : yes * @li ISR Callable : yes * */PUBLIC IX_SSP_STATUSixSspAccSerialClockRateConfigure ( UINT8 serialClockRateSelected);/** * @ingroup IxSspAcc * * @fn ixSspAccRxFIFOIntEnable ( RxFIFOThresholdHandler rxFIFOIntrHandler) * * @brief Enables service request interrupt whenever the Rx FIFO hits its * threshold * * @param "void [in] *rxFIFOIntrHandler(UINT32)" - function pointer to the * interrupt handler for the Rx FIFO exceeded. * * Global Data : * - None. * * This API will enable the service request interrupt for the Rx FIFO * * @return * - IX_SSP_SUCCESS - Rx FIFO level interrupt enabled successfully * - IX_SSP_RX_FIFO_HANDLER_MISSING - missing handler for Rx FIFO level interrupt * - IX_SSP_POLL_MODE_BLOCKING - poll mode is selected at init, interrupt not * allowed to be enabled. Use init to enable interrupt mode. * - IX_SSP_NOT_INIT - SSP not initialized. SSP init needs to be called. * * @li Reentrant : yes * @li ISR Callable : yes * */PUBLIC IX_SSP_STATUSixSspAccRxFIFOIntEnable ( RxFIFOThresholdHandler rxFIFOIntrHandler);/** * @ingroup IxSspAcc * * @fn ixSspAccRxFIFOIntDisable ( void) * * @brief Disables service request interrupt of the Rx FIFO. * * @param - None * * Global Data : * - None. * * This API will disable the service request interrupt of the Rx FIFO. * * @return * - IX_SSP_SUCCESS - Rx FIFO Interrupt disabled successfully * - IX_SSP_NOT_INIT - SSP not initialized. SSP init needs to be called. * * @li Reentrant : yes * @li ISR Callable : yes * */PUBLIC IX_SSP_STATUSixSspAccRxFIFOIntDisable ( void);/** * @ingroup IxSspAcc * * @fn ixSspAccTxFIFOIntEnable ( TxFIFOThresholdHandler txFIFOIntrHandler) * * @brief Enables service request interrupt of the Tx FIFO. * * @param "void [in] *txFIFOIntrHandler(UINT32)" - function pointer to the * interrupt handler for the Tx FIFO exceeded. * * Global Data : * - None. *
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -