12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271 |
- /**
- * @file IxSspAcc.h
- *
- * @brief Header file for the IXP400 SSP Serial Port Access (IxSspAcc)
- *
- * @version $Revision: 0.1 $
- *
- * @par
- * IXP400 SW Release version 2.0
- *
- * -- Copyright Notice --
- *
- * @par
- * Copyright 2001-2005, Intel Corporation.
- * All rights reserved.
- *
- * @par
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the Intel Corporation nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * @par
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @par
- * -- End of Copyright Notice --
- */
- /**
- * @defgroup IxSspAcc IXP400 SSP Serial Port Access (IxSspAcc) API
- *
- * @brief IXP400 SSP Serial Port Access Public API
- *
- * @{
- */
- #ifndef IXSSPACC_H
- #define IXSSPACC_H
- #ifdef __ixp46X
- #include "IxOsal.h"
- /*
- * Section for enum
- */
- /**
- * @ingroup IxSspAcc
- *
- * @enum IxSspAccDataSize
- *
- * @brief The data sizes in bits that are supported by the protocol
- */
- typedef enum
- {
- DATA_SIZE_TOO_SMALL = 0x2,
- DATA_SIZE_4 = 0x3,
- DATA_SIZE_5,
- DATA_SIZE_6,
- DATA_SIZE_7,
- DATA_SIZE_8,
- DATA_SIZE_9,
- DATA_SIZE_10,
- DATA_SIZE_11,
- DATA_SIZE_12,
- DATA_SIZE_13,
- DATA_SIZE_14,
- DATA_SIZE_15,
- DATA_SIZE_16,
- DATA_SIZE_TOO_BIG
- } IxSspAccDataSize;
- /**
- * @ingroup IxSspAcc
- *
- * @enum IxSspAccPortStatus
- *
- * @brief The status of the SSP port to be set to enable/disable
- */
- typedef enum
- {
- SSP_PORT_DISABLE = 0x0,
- SSP_PORT_ENABLE,
- INVALID_SSP_PORT_STATUS
- } IxSspAccPortStatus;
- /**
- * @ingroup IxSspAcc
- *
- * @enum IxSspAccFrameFormat
- *
- * @brief The frame format that is to be used - SPI, SSP, or Microwire
- */
- typedef enum
- {
- SPI_FORMAT = 0x0,
- SSP_FORMAT,
- MICROWIRE_FORMAT,
- INVALID_FORMAT
- } IxSspAccFrameFormat;
- /**
- * @ingroup IxSspAcc
- *
- * @enum IxSspAccClkSource
- *
- * @brief The source to produce the SSP serial clock
- */
- typedef enum
- {
- ON_CHIP_CLK = 0x0,
- EXTERNAL_CLK,
- INVALID_CLK_SOURCE
- } IxSspAccClkSource;
- /**
- * @ingroup IxSspAcc
- *
- * @enum IxSspAccSpiSclkPhase
- *
- * @brief The SPI SCLK Phase:
- * 0 - SCLK is inactive one cycle at the start of a frame and 1/2 cycle at the
- * end of a frame.
- * 1 - SCLK is inactive 1/2 cycle at the start of a frame and one cycle at the
- * end of a frame.
- */
- typedef enum
- {
- START_ONE_END_HALF = 0x0,
- START_HALF_END_ONE,
- INVALID_SPI_PHASE
- } IxSspAccSpiSclkPhase;
- /**
- * @ingroup IxSspAcc
- *
- * @enum IxSspAccSpiSclkPolarity
- *
- * @brief The SPI SCLK Polarity can be set to either low or high.
- */
- typedef enum
- {
- SPI_POLARITY_LOW = 0x0,
- SPI_POLARITY_HIGH,
- INVALID_SPI_POLARITY
- } IxSspAccSpiSclkPolarity;
- /**
- * @ingroup IxSspAcc
- *
- * @enum IxSspAccMicrowireCtlWord
- *
- * @brief The Microwire control word can be either 8 or 16 bit.
- */
- typedef enum
- {
- MICROWIRE_8_BIT = 0x0,
- MICROWIRE_16_BIT,
- INVALID_MICROWIRE_CTL_WORD
- } IxSspAccMicrowireCtlWord;
- /**
- * @ingroup IxSspAcc
- *
- * @enum IxSspAccFifoThreshold
- *
- * @brief The threshold in frames (each frame is defined by IxSspAccDataSize)
- * that can be set for the FIFO to trigger a threshold exceed when
- * checking with the ExceedThresholdCheck functions or an interrupt
- * when it is enabled.
- */
- typedef enum
- {
- FIFO_TSHLD_1 = 0x0,
- FIFO_TSHLD_2,
- FIFO_TSHLD_3,
- FIFO_TSHLD_4,
- FIFO_TSHLD_5,
- FIFO_TSHLD_6,
- FIFO_TSHLD_7,
- FIFO_TSHLD_8,
- FIFO_TSHLD_9,
- FIFO_TSHLD_10,
- FIFO_TSHLD_11,
- FIFO_TSHLD_12,
- FIFO_TSHLD_13,
- FIFO_TSHLD_14,
- FIFO_TSHLD_15,
- FIFO_TSHLD_16,
- INVALID_FIFO_TSHLD
- } IxSspAccFifoThreshold;
- /**
- * @ingroup IxSspAcc
- *
- * @enum IX_SSP_STATUS
- *
- * @brief The statuses that can be returned in a SSP Serial Port Access
- */
- typedef enum
- {
- IX_SSP_SUCCESS = IX_SUCCESS, /**< Success status */
- IX_SSP_FAIL, /**< Fail status */
- IX_SSP_RX_FIFO_OVERRUN_HANDLER_MISSING, /**<
- Rx FIFO Overrun handler is NULL. */
- IX_SSP_RX_FIFO_HANDLER_MISSING, /**<
- Rx FIFO threshold hit or above handler is NULL
- */
- IX_SSP_TX_FIFO_HANDLER_MISSING, /**<
- Tx FIFO threshold hit or below handler is NULL
- */
- IX_SSP_FIFO_NOT_EMPTY_FOR_SETTING_CTL_CMD, /**<
- Tx FIFO not empty and therefore microwire
- control command size setting 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, /**<
- source clock selected is invalid. */
- IX_SSP_INVALID_TX_FIFO_THRESHOLD_ENUM_VALUE, /**<
- Tx FIFO threshold selected is invalid. */
- IX_SSP_INVALID_RX_FIFO_THRESHOLD_ENUM_VALUE, /**<
- Rx FIFO threshold 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 selected is invalid
- */
- IX_SSP_INT_UNBIND_FAIL, /**< Interrupt unbind fail to unbind SSP
- interrupt */
- IX_SSP_INT_BIND_FAIL, /**< Interrupt bind fail during init */
- IX_SSP_RX_FIFO_NOT_EMPTY, /**<
- Rx FIFO not empty while trying to change data
- size. */
- IX_SSP_TX_FIFO_NOT_EMPTY, /**<
- Rx FIFO not empty while trying to change data
- size or microwire control command size. */
- IX_SSP_POLL_MODE_BLOCKING, /**<
- poll mode selected blocks interrupt mode from
- being selected. */
- 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_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_BUSY, /**< SSP is busy. */
- IX_SSP_IDLE, /**< SSP is idle. */
- IX_SSP_OVERRUN_OCCURRED, /**<
- SSP has experienced an overrun. */
- IX_SSP_NO_OVERRUN, /**<
- SSP did not experience an overrun. */
- IX_SSP_NOT_SUPORTED, /**< hardware does not support SSP */
- IX_SSP_NOT_INIT, /**< SSP Access not intialized */
- IX_SSP_NULL_POINTER /**< parameter passed in is NULL */
- } IX_SSP_STATUS;
- /**
- * @ingroup IxSspAcc
- *
- * @brief SSP Rx FIFO Overrun handler
- *
- * This function is called for the client to handle Rx FIFO Overrun that occurs
- * in the SSP hardware
- */
- typedef void (*RxFIFOOverrunHandler)(void);
- /**
- * @ingroup IxSspAcc
- *
- * @brief SSP Rx FIFO Threshold hit or above handler
- *
- * This function is called for the client to handle Rx FIFO threshold hit or
- * or above that occurs in the SSP hardware
- */
- typedef void (*RxFIFOThresholdHandler)(void);
- /**
- * @ingroup IxSspAcc
- *
- * @brief SSP Tx FIFO Threshold hit or below handler
- *
- * This function is called for the client to handle Tx FIFO threshold hit or
- * or below that occurs in the SSP hardware
- */
- typedef void (*TxFIFOThresholdHandler)(void);
- /*
- * Section for struct
- */
- /**
- * @ingroup IxSspAcc
- *
- * @brief contains all the variables required to initialize the SSP serial port
- * hardware.
- *
- * Structure to be filled and used for calling initialization
- */
- typedef struct
- {
- IxSspAccFrameFormat FrameFormatSelected;/**<Select between SPI, SSP and
- Microwire. */
- IxSspAccDataSize DataSizeSelected; /**<Select between 4 and 16. */
- IxSspAccClkSource ClkSourceSelected; /**<Select clock source to be
- on-chip or external. */
- IxSspAccFifoThreshold TxFIFOThresholdSelected;
- /**<Select Tx FIFO threshold
- between 1 to 16. */
- IxSspAccFifoThreshold RxFIFOThresholdSelected;
- /**<Select Rx FIFO threshold
- between 1 to 16. */
- BOOL RxFIFOIntrEnable; /**<Enable/disable Rx FIFO
- threshold interrupt. Disabling
- this interrupt will require
- the use of the polling function
- RxFIFOExceedThresholdCheck. */
- BOOL TxFIFOIntrEnable; /**<Enable/disable Tx FIFO
- threshold interrupt. Disabling
- this interrupt will require
- the use of the polling function
- TxFIFOExceedThresholdCheck. */
- RxFIFOThresholdHandler RxFIFOThsldHdlr; /**<Pointer to function to handle
- a Rx FIFO interrupt. */
- TxFIFOThresholdHandler TxFIFOThsldHdlr; /**<Pointer to function to handle
- a Tx FIFO interrupt. */
- RxFIFOOverrunHandler RxFIFOOverrunHdlr; /**<Pointer to function to handle
- a Rx FIFO overrun interrupt. */
- BOOL LoopbackEnable; /**<Select operation mode to be
- normal or loopback mode. */
- IxSspAccSpiSclkPhase SpiSclkPhaseSelected;
- /**<Select SPI SCLK phase to start
- with one inactive cycle and end
- with 1/2 inactive cycle or
- start with 1/2 inactive cycle
- and end with one inactive
- cycle. (Only used in
- SPI format). */
- IxSspAccSpiSclkPolarity SpiSclkPolaritySelected;
- /**<Select SPI SCLK idle state
- to be low or high. (Only used in
- SPI format). */
- IxSspAccMicrowireCtlWord MicrowireCtlWordSelected;
- /**<Select Microwire control
- format to be 8 or 16-bit. (Only
- used in Microwire format). */
- UINT8 SerialClkRateSelected; /**<Select between 0 (1.8432Mbps)
- and 255 (7.2Kbps). The
- formula used is Bit rate =
- 3.6864x10^6 /
- (2 x (SerialClkRateSelect + 1))
- */
- } IxSspInitVars;
- /**
- * @ingroup IxSspAcc
- *
- * @brief contains counters of the SSP statistics
- *
- * Structure contains all values of counters and associated overflows.
- */
- typedef struct
- {
- UINT32 ixSspRcvCounter; /**<Total frames received. */
- UINT32 ixSspXmitCounter; /**<Total frames transmitted. */
- UINT32 ixSspOverflowCounter;/**<Total occurrences of overflow. */
- } IxSspAccStatsCounters;
- /*
- * Section for prototypes interface functions
- */
- /**
- * @ingroup IxSspAcc
- *
- * @fn ixSspAccInit (
- IxSspInitVars *initVarsSelected);
- *
- * @brief Initializes the SSP Access module.
- *
- * @param "IxSspAccInitVars [in] *initVarsSelected" - struct containing required
- * variables for initialization
- *
- * Global Data :
- * - None.
- *
- * This API will initialize the SSP Serial Port hardware to the user specified
- * configuration. Then it will enable the SSP Serial Port.
- * *NOTE*: Once interrupt or polling mode is selected, the mode cannot be
- * changed via the interrupt enable/disable function but the init needs to be
- * called again to change it.
- *
- * @return
- * - IX_SSP_SUCCESS - Successfully initialize and enable the SSP
- * serial port.
- * - IX_SSP_RX_FIFO_HANDLER_MISSING - interrupt mode is selected but RX FIFO
- * handler pointer is NULL
- * - IX_SSP_TX_FIFO_HANDLER_MISSING - interrupt mode is selected but TX FIFO
- * handler pointer is NULL
- * - IX_SSP_RX_FIFO_OVERRUN_HANDLER_MISSING - interrupt mode is selected but
- * RX FIFO Overrun handler pointer is NULL
- * - 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_STATUS
- ixSspAccInit (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_STATUS
- ixSspAccUninit (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_STATUS
- ixSspAccFIFODataSubmit (
- 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_STATUS
- ixSspAccFIFODataReceive (
- 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_STATUS
- ixSspAccTxFIFOHitOrBelowThresholdCheck (
- 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_STATUS
- ixSspAccRxFIFOHitOrAboveThresholdCheck (
- 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_STATUS
- ixSspAccSSPPortStatusSet (
- 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_STATUS
- ixSspAccFrameFormatSelect (
- 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_STATUS
- ixSspAccDataSizeSelect (
- 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_STATUS
- ixSspAccClockSourceSelect (
- 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_STATUS
- ixSspAccSerialClockRateConfigure (
- 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_STATUS
- ixSspAccRxFIFOIntEnable (
- 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_STATUS
- ixSspAccRxFIFOIntDisable (
- 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.
- *
- * This API will enable the service request interrupt of the Tx FIFO.
- *
- * @return
- * - IX_SSP_SUCCESS - Tx FIFO level interrupt enabled successfully
- * - IX_SSP_TX_FIFO_HANDLER_MISSING - missing handler for Tx 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_STATUS
- ixSspAccTxFIFOIntEnable (
- TxFIFOThresholdHandler txFIFOIntrHandler);
- /**
- * @ingroup IxSspAcc
- *
- * @fn ixSspAccTxFIFOIntDisable (
- void)
- *
- * @brief Disables service request interrupt of the Tx FIFO
- *
- * @param - None
- *
- * Global Data :
- * - None.
- *
- * This API will disable the service request interrupt of the Tx FIFO
- *
- * @return
- * - IX_SSP_SUCCESS - Tx FIFO Interrupt disabled successfuly.
- * - IX_SSP_NOT_INIT - SSP not initialized. SSP init needs to be called.
- *
- * @li Reentrant : yes
- * @li ISR Callable : yes
- *
- */
- PUBLIC IX_SSP_STATUS
- ixSspAccTxFIFOIntDisable (
- void);
- /**
- * @ingroup IxSspAcc
- *
- * @fn ixSspAccLoopbackEnable (
- BOOL loopbackEnable)
- *
- * @brief Enables/disables the loopback mode
- *
- * @param "BOOL [in] loopbackEnable" - True to enable and false to disable.
- *
- * Global Data :
- * - None.
- *
- * This API will set the mode of operation to either loopback or normal mode
- * according to the user input.
- *
- * @return
- * - IX_SSP_SUCCESS - Loopback enabled successfully
- * - IX_SSP_NOT_INIT - SSP not initialized. SSP init needs to be called.
- *
- * @li Reentrant : yes
- * @li ISR Callable : yes
- *
- */
- PUBLIC IX_SSP_STATUS
- ixSspAccLoopbackEnable (
- BOOL loopbackEnable);
- /**
- * @ingroup IxSspAcc
- *
- * @fn ixSspAccSpiSclkPolaritySet (
- IxSspAccSpiSclkPolarity spiSclkPolaritySelected)
- *
- * @brief Sets the SPI SCLK Polarity to Low or High
- *
- * @param - "IxSspAccSpiSclkPolarity [in] spiSclkPolaritySelected" - SPI SCLK
- * polarity that can be selected to either high or low
- *
- * Global Data :
- * - None.
- *
- * This API is only used for the SPI frame format and will set the SPI SCLK polarity
- * to either low or high
- *
- * @return
- * - IX_SSP_SUCCESS - SPI Sclk polarity set with valid enum value
- * - IX_SSP_INVALID_SPI_POLARITY_ENUM_VALUE - invalid SPI polarity value
- * - IX_SSP_NOT_INIT - SSP not initialized. SSP init needs to be called.
- *
- * @li Reentrant : yes
- * @li ISR Callable : yes
- *
- */
- PUBLIC IX_SSP_STATUS
- ixSspAccSpiSclkPolaritySet (
- IxSspAccSpiSclkPolarity spiSclkPolaritySelected);
- /**
- * @ingroup IxSspAcc
- *
- * @fn ixSspAccSpiSclkPhaseSet (
- IxSspAccSpiSclkPhase spiSclkPhaseSelected)
- *
- * @brief Sets the SPI SCLK Phase
- *
- * @param "IxSspAccSpiSclkPhase [in] spiSclkPhaseSelected" - Phase of either
- * the SCLK is inactive one cycle at the start of a frame and 1/2
- * cycle at the end of a frame, OR
- * the SCLK is inactive 1/2 cycle at the start of a frame and one
- * cycle at the end of a frame.
- *
- * Global Data :
- * - IX_SSP_SUCCESS - SPI Sclk phase set with valid enum value
- * - IX_SSP_INVALID_SPI_PHASE_ENUM_VALUE - invalid SPI phase value
- * - IX_SSP_NOT_INIT - SSP not initialized. SSP init needs to be called.
- *
- * This API is only used for the SPI frame format and will set the SPI SCLK
- * phase according to user input.
- *
- * @return
- * - None
- *
- * @li Reentrant : yes
- * @li ISR Callable : yes
- *
- */
- PUBLIC IX_SSP_STATUS
- ixSspAccSpiSclkPhaseSet (
- IxSspAccSpiSclkPhase spiSclkPhaseSelected);
- /**
- * @ingroup IxSspAcc
- *
- * @fn ixSspAccMicrowireControlWordSet (
- IxSspAccMicrowireCtlWord microwireCtlWordSelected)
- *
- * @brief Sets the Microwire control word to 8 or 16 bit format
- *
- * @param "IxSspAccMicrowireCtlWord [in] microwireCtlWordSelected" - Microwire
- * control word format can be either 8 or 16 bit format
- *
- * Global Data :
- * - None.
- *
- * This API is only used for the Microwire frame format and will set the
- * control word to 8 or 16 bit format
- *
- * @return
- * - IX_SSP_SUCCESS - Microwire Control Word set with valid enum value
- * - IX_SSP_TX_FIFO_NOT_EMPTY - Tx FIFO not empty, data size change is not
- * allowed.
- * - IX_SSP_INVALID_MICROWIRE_CTL_CMD_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_STATUS
- ixSspAccMicrowireControlWordSet (
- IxSspAccMicrowireCtlWord microwireCtlWordSelected);
- /**
- * @ingroup IxSspAcc
- *
- * @fn ixSspAccTxFIFOThresholdSet (
- IxSspAccFifoThreshold txFIFOThresholdSelected)
- *
- * @brief Sets the Tx FIFO Threshold.
- *
- * @param "IxSspAccFifoThreshold [in] txFIFOThresholdSelected" - Threshold that
- * is set for a Tx FIFO service request to be triggered
- *
- * Global Data :
- * - None.
- *
- * This API will set the threshold for a Tx FIFO threshold to be triggered
- *
- * @return
- * - IX_SSP_SUCCESS - Tx FIFO Threshold set with valid enum value
- * - IX_SSP_INVALID_TX_FIFO_THRESHOLD_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_STATUS
- ixSspAccTxFIFOThresholdSet (
- IxSspAccFifoThreshold txFIFOThresholdSelected);
- /**
- * @ingroup IxSspAcc
- *
- * @fn ixSspAccRxFIFOThresholdSet (
- IxSspAccFifoThreshold rxFIFOThresholdSelected)
- *
- * @brief Sets the Rx FIFO Threshold.
- *
- * @param "IxSspAccFifoThreshold [in] rxFIFOThresholdSelected" - Threshold that
- * is set for a Tx FIFO service request to be triggered
- *
- * Global Data :
- * - None.
- *
- * This API will will set the threshold for a Rx FIFO threshold to be triggered
- *
- * @return
- * - IX_SSP_SUCCESS - Rx FIFO Threshold set with valid enum value
- * - IX_SSP_INVALID_RX_FIFO_THRESHOLD_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_STATUS
- ixSspAccRxFIFOThresholdSet (
- IxSspAccFifoThreshold rxFIFOThresholdSelected);
- /**
- * Debug functions
- */
- /**
- * @ingroup IxSspAcc
- *
- * @fn ixSspAccStatsGet (
- IxSspAccStatsCounters *sspStats)
- *
- * @brief Returns the SSP Statistics through the pointer passed in
- *
- * @param "IxSspAccStatsCounters [in] *sspStats" - SSP statistics counter will
- * be read and written to the location pointed by this pointer.
- *
- * Global Data :
- * - None.
- *
- * This API will return the statistics counters of the SSP transfers.
- *
- * @return
- * - IX_SSP_SUCCESS - Stats obtained into the pointer provided successfully
- * - IX_SSP_FAIL - client provided pointer is NULL
- *
- * @li Reentrant : yes
- * @li ISR Callable : yes
- *
- */
- PUBLIC IX_SSP_STATUS
- ixSspAccStatsGet (
- IxSspAccStatsCounters *sspStats);
- /**
- * @ingroup IxSspAcc
- *
- * @fn ixSspAccStatsReset (
- void)
- *
- * @brief Resets the SSP Statistics
- *
- * @param - None
- *
- * Global Data :
- * - None.
- *
- * This API will reset the SSP statistics counters.
- *
- * @return
- * - None
- *
- * @li Reentrant : yes
- * @li ISR Callable : yes
- *
- */
- PUBLIC void
- ixSspAccStatsReset (
- void);
- /**
- * @ingroup IxSspAcc
- *
- * @fn ixSspAccShow (
- void)
- *
- * @brief Display SSP status registers and statistics counters.
- *
- * @param - None
- *
- * Global Data :
- * - None.
- *
- * This API will display the status registers of the SSP and the statistics
- * counters.
- *
- * @return
- * - IX_SSP_SUCCESS - SSP show called successfully.
- * - IX_SSP_NOT_INIT - SSP not initialized. SSP init needs to be called.
- *
- * @li Reentrant : yes
- * @li ISR Callable : yes
- *
- */
- PUBLIC IX_SSP_STATUS
- ixSspAccShow (
- void);
- /**
- * @ingroup IxSspAcc
- *
- * @fn ixSspAccSSPBusyCheck (
- void)
- *
- * @brief Determine the state of the SSP serial port hardware.
- *
- * @param - None
- *
- * Global Data :
- * - None.
- *
- * This API will return the state of the SSP serial port hardware - busy or
- * idle
- *
- * @return
- * - IX_SSP_BUSY - SSP is busy
- * - IX_SSP_IDLE - SSP is idle.
- * - IX_SSP_NOT_INIT - SSP not initialized. SSP init needs to be called.
- *
- * @li Reentrant : yes
- * @li ISR Callable : yes
- *
- */
- PUBLIC IX_SSP_STATUS
- ixSspAccSSPBusyCheck (
- void);
- /**
- * @ingroup IxSspAcc
- *
- * @fn ixSspAccTxFIFOLevelGet (
- void)
- *
- * @brief Obtain the Tx FIFO's level
- *
- * @param - None
- *
- * Global Data :
- * - None.
- *
- * This API will return the level of the Tx FIFO
- *
- * @return
- * - 0..16; 0 can also mean SSP not initialized and will need to be init.
- *
- * @li Reentrant : yes
- * @li ISR Callable : yes
- *
- */
- PUBLIC UINT8
- ixSspAccTxFIFOLevelGet (
- void);
- /**
- * @ingroup IxSspAcc
- *
- * @fn ixSspAccRxFIFOLevelGet (
- void)
- *
- * @brief Obtain the Rx FIFO's level
- *
- * @param - None
- *
- * Global Data :
- * - None.
- *
- * This API will return the level of the Rx FIFO
- *
- * @return
- * - 0..16; 0 can also mean SSP not initialized and will need to be init.
- *
- * @li Reentrant : yes
- * @li ISR Callable : yes
- *
- */
- PUBLIC UINT8
- ixSspAccRxFIFOLevelGet (
- void);
- /**
- * @ingroup IxSspAcc
- *
- * @fn ixSspAccRxFIFOOverrunCheck (
- void)
- *
- * @brief Check if the Rx FIFO has overrun its FIFOs
- *
- * @param - None
- *
- * Global Data :
- * - None.
- *
- * This API will return whether the Rx FIFO has overrun its 16 FIFOs
- *
- * @return
- * - IX_SSP_OVERRUN_OCCURRED - Rx FIFO overrun occurred
- * - IX_SSP_NO_OVERRUN - Rx FIFO did not overrun
- * - IX_SSP_NOT_INIT - SSP not initialized. SSP init needs to be called.
- *
- * @li Reentrant : yes
- * @li ISR Callable : yes
- *
- */
- PUBLIC IX_SSP_STATUS
- ixSspAccRxFIFOOverrunCheck (
- void);
- #endif /* __ixp46X */
- #endif /* IXSSPACC_H */
|