Statistics
| Branch: | Tag: | Revision:

mongoose / examples / PIC32 / mqtt_client / firmware / src / system_config / mx795_CC3100_e16 / framework / driver / spi / static / drv_spi_static.h @ eaef5bd1

History | View | Annotate | Download (6.86 KB)

1
/* clang-format off */
2
/*******************************************************************************
3
  SPI Driver Interface Declarations for Static Single Instance Driver
4

5
  Company:
6
    Microchip Technology Inc.
7

8
  File Name:
9
    drv_spi_static.h
10

11
  Summary:
12
    SPI driver interface declarations for the static single instance driver.
13

14
  Description:
15
    The SPI device driver provides a simple interface to manage the SPI
16
    modules on Microchip microcontrollers. This file defines the interface
17
    Declarations for the SPI static driver.
18

19
  Remarks:
20
    Static interfaces incorporate the driver instance number within the names
21
    of the routines, eliminating the need for an object ID or object handle.
22

23
    Static single-open interfaces also eliminate the need for the open handle.
24
*******************************************************************************/
25

    
26
//DOM-IGNORE-BEGIN
27
/*******************************************************************************
28
Copyright (c) 2015 released Microchip Technology Inc.  All rights reserved.
29

30
Microchip licenses to you the right to use, modify, copy and distribute
31
Software only when embedded on a Microchip microcontroller or digital signal
32
controller that is integrated into your product or third party product
33
(pursuant to the sublicense terms in the accompanying license agreement).
34

35
You should refer to the license agreement accompanying this Software for
36
additional information regarding your rights and obligations.
37

38
SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
39
EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
40
MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
41
IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
42
CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
43
OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
44
INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
45
CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
46
SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
47
(INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
48
*******************************************************************************/
49
//DOM-IGNORE-END
50

    
51
#ifndef _DRV_SPI_STATIC_H
52
#define _DRV_SPI_STATIC_H
53

    
54
// *****************************************************************************
55
// *****************************************************************************
56
// Section: Included Files
57
// *****************************************************************************
58
// *****************************************************************************
59

    
60
#include "driver/spi/static/src/drv_spi_static_local.h"
61

    
62
// DOM-IGNORE-BEGIN
63
#ifdef __cplusplus  // Provide C++ Compatibility
64

    
65
    extern "C" {
66

    
67
#endif
68
// DOM-IGNORE-END
69

    
70
// *********************************************************************************************
71
// *********************************************************************************************
72
// Section: System Interface Headers for the Instance 0 of SPI static driver
73
// *********************************************************************************************
74
// *********************************************************************************************
75

    
76
SYS_MODULE_OBJ DRV_SPI0_Initialize( void );
77
void DRV_SPI0_Deinitialize ( void );
78
SYS_STATUS DRV_SPI0_Status ( void );
79
void DRV_SPI0_Tasks ( void );
80

    
81
// *********************************************************************************************
82
// *********************************************************************************************
83
// Section: General Client Interface Headers for the Instance 0 of SPI static driver
84
// *********************************************************************************************
85
// *********************************************************************************************
86

    
87
DRV_HANDLE DRV_SPI0_Open ( const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT ioIntent );
88
void DRV_SPI0_Close ( void );
89
int32_t DRV_SPI0_ClientConfigure ( const DRV_SPI_CLIENT_DATA * cfgData );
90

    
91
// *********************************************************************************************
92
// *********************************************************************************************
93
// Section: Read & Write Client Interface Headers for the Instance 0 of SPI static driver
94
// *********************************************************************************************
95
// *********************************************************************************************
96

    
97
DRV_SPI_BUFFER_HANDLE DRV_SPI0_BufferAddRead ( void *rxBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void * context);
98

    
99
DRV_SPI_BUFFER_HANDLE DRV_SPI0_BufferAddWrite ( void *txBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void * context );
100

    
101
DRV_SPI_BUFFER_HANDLE DRV_SPI0_BufferAddRead2 ( void *rxBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void * context, DRV_SPI_BUFFER_HANDLE * jobHandle);
102

    
103
DRV_SPI_BUFFER_HANDLE DRV_SPI0_BufferAddWrite2 ( void *txBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void * context, DRV_SPI_BUFFER_HANDLE * jobHandle );
104

    
105
DRV_SPI_BUFFER_HANDLE DRV_SPI0_BufferAddWriteRead2 ( void *txBuffer, size_t txSize,void *rxBuffer, size_t rxSize, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void * context,  DRV_SPI_BUFFER_HANDLE * jobHandle);
106

    
107
DRV_SPI_BUFFER_EVENT DRV_SPI0_BufferStatus ( DRV_SPI_BUFFER_HANDLE bufferHandle );
108

    
109
/* This API name was present in the old static driver which is maintained for compatibility.
110
   So, giving a new name for the new static driver which is taken care of while mapping */
111
#define  DRV_SPI0_BufferAddWriteReadNew(txbuff, txsize, rxbuff, rxsize, cb, ct ) \
112
    DRV_SPI0_BufferAddWriteRead2((txbuff), (txsize), (rxbuff), (rxsize), (cb), (ct), NULL)
113

    
114

    
115

    
116
// *********************************************************************************************
117
// *********************************************************************************************
118
// Section: Old static driver compatibility APIs, these will be deprecated.
119
// *********************************************************************************************
120
// *********************************************************************************************
121
bool DRV_SPI0_ReceiverBufferIsFull( void );
122
bool DRV_SPI0_TransmitterBufferIsFull( void );
123
int32_t DRV_SPI0_BufferAddWriteRead(const void * txBuffer, void * rxBuffer, uint32_t size);
124
// *********************************************************************************************
125

    
126

    
127

    
128
// DOM-IGNORE-BEGIN
129
#ifdef __cplusplus
130
}
131
#endif
132
// DOM-IGNORE-END
133

    
134
#endif // #ifndef _DRV_SPI_STATIC_H
135
/*******************************************************************************
136
 End of File
137
*/