William Kane / Generic

Dependents:   LaserioLib

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers abcc_sys_adapt_spi.h Source File

abcc_sys_adapt_spi.h

00001 /*******************************************************************************
00002 ********************************************************************************
00003 **                                                                            **
00004 ** ABCC Driver version 4.01.01 (2015-12-14)                                   **
00005 **                                                                            **
00006 ** Delivered with:                                                            **
00007 **    ABP         7.16.01 (2015-10-14)                                        **
00008 **                                                                            */
00009 /*******************************************************************************
00010 ********************************************************************************
00011 ** COPYRIGHT NOTIFICATION (c) 2013 HMS Industrial Networks AB                 **
00012 **                                                                            **
00013 ** This code is the property of HMS Industrial Networks AB.                   **
00014 ** The source code may not be reproduced, distributed, or used without        **
00015 ** permission. When used together with a product from HMS, permission is      **
00016 ** granted to modify, reproduce and distribute the code in binary form        **
00017 ** without any restrictions.                                                  **
00018 **                                                                            **
00019 ** THE CODE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. HMS DOES NOT    **
00020 ** WARRANT THAT THE FUNCTIONS OF THE CODE WILL MEET YOUR REQUIREMENTS, OR     **
00021 ** THAT THE OPERATION OF THE CODE WILL BE UNINTERRUPTED OR ERROR-FREE, OR     **
00022 ** THAT DEFECTS IN IT CAN BE CORRECTED.                                       **
00023 ********************************************************************************
00024 ********************************************************************************
00025 ** File Description:
00026 ** Defines system specific interface for SPI
00027 ********************************************************************************
00028 ********************************************************************************
00029 ** Services:
00030 ** ABCC_SYS_SpiRegDataReceived() - MISO received
00031 ** ABCC_SYS_SpiSendReceive()          - Start transaction
00032 ********************************************************************************
00033 ********************************************************************************
00034 */
00035 
00036 #ifndef ABCC_SYS_ADAPT_SPI_
00037 #define ABCC_SYS_ADAPT_SPI_
00038 #include "abcc_drv_cfg.h"
00039 #include "abcc_td.h"
00040 
00041 /*******************************************************************************
00042 ** Constants
00043 ********************************************************************************
00044 */
00045 
00046 /*******************************************************************************
00047 ** Typedefs
00048 ********************************************************************************
00049 */
00050 
00051 /*------------------------------------------------------------------------------
00052 ** Function pointer type for MISO frame ready callback.
00053 ** ------------------------------------------------------------------------------
00054 */
00055 typedef void ( *ABCC_SYS_SpiDataReceivedCbfType )( void );
00056 
00057 /*******************************************************************************
00058 ** Public Globals
00059 ********************************************************************************
00060 */
00061 
00062 /*******************************************************************************
00063 ** Public Services()
00064 ********************************************************************************
00065 */
00066 
00067 /*------------------------------------------------------------------------------
00068 ** ABCC_SYS_SpiRegDataReceived()
00069 ** As soon as the MISO frame is received by the low level SPI hardware driver,
00070 ** this registered function shall be called to indicate to the SPI driver that
00071 ** the MISO frame could be processed.
00072 **------------------------------------------------------------------------------
00073 ** Arguments:
00074 **    pnDataReceived Function to call when MISO frame is received.
00075 **
00076 ** Returns:
00077 **
00078 **------------------------------------------------------------------------------
00079 */
00080 EXTFUNC void ABCC_SYS_SpiRegDataReceived( ABCC_SYS_SpiDataReceivedCbfType pnDataReceived );
00081 
00082 /*------------------------------------------------------------------------------
00083 ** ABCC_SYS_SpiSendReceive()
00084 ** This function is called by the SPI driver when the MOSI frame shall be sent.
00085 ** Two buffers are provided, one with MOSI data frame to be sent and one buffer
00086 ** to store the received MISO frame.
00087 ** If the callback registered by ABCC_SYS_SpiRegDataReceived() is invoked within
00088 ** this function, indicating that the MISO frame is already received ,the MISO
00089 ** frame will be processed by the SPI driver on return of this function.
00090 ** Otherwise the MISO frame will be processed the next time the driver is polled
00091 ** (ABCC_RunDriver() ) after the MISO frame received callback is invoked.
00092 **------------------------------------------------------------------------------
00093 ** Arguments:
00094 **             pxSendDataBuffer     Pointer to MOSI Buffer to send
00095 **             pxReceiveDataBuffer  Pointer to MISO Buffer.
00096 **             iLength              Length of SPI frame ( in bytes )
00097 ** Returns:
00098 **          None.
00099 **------------------------------------------------------------------------------
00100 */
00101 EXTFUNC void ABCC_SYS_SpiSendReceive( void* pxSendDataBuffer, void* pxReceiveDataBuffer, UINT16 iLength );
00102 
00103 #endif  /* inclusion lock */