TI-RTOS for SimpleLink Wireless MCUs  2.14.02.22
SDSPI.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
109 #ifndef ti_drivers_SDSPI__include
110 #define ti_drivers_SDSPI__include
111 
112 #ifdef __cplusplus
113 extern "C" {
114 #endif
115 
116 #include <stdint.h>
117 
129 #define SDSPI_CMD_RESERVED 32
130 
143 #define SDSPI_STATUS_RESERVED -32
144 
151 #define SDSPI_STATUS_SUCCESS 0
152 
159 #define SDSPI_STATUS_ERROR -1
160 
168 #define SDSPI_STATUS_UNDEFINEDCMD -2
169 
173 typedef struct SDSPI_Config *SDSPI_Handle;
174 
175 
184 typedef struct SDSPI_Params {
185  uint32_t bitRate;
186  void *custom;
187 } SDSPI_Params;
188 
193 typedef void (*SDSPI_InitFxn) (SDSPI_Handle handle);
194 
199 typedef SDSPI_Handle (*SDSPI_OpenFxn) (SDSPI_Handle handle,
200  unsigned char drv,
201  SDSPI_Params *params);
202 
207 typedef void (*SDSPI_CloseFxn) (SDSPI_Handle handle);
208 
213 typedef int (*SDSPI_ControlFxn) (SDSPI_Handle handle,
214  unsigned int cmd,
215  void *arg);
216 
222 typedef struct SDSPI_FxnTable {
225 
228 
231 
235 
247 typedef struct SDSPI_Config {
250 
252  void *object;
253 
255  void const *hwAttrs;
256 } SDSPI_Config;
257 
269 extern void SDSPI_close(SDSPI_Handle handle);
270 
290 extern int SDSPI_control(SDSPI_Handle handle, unsigned int cmd, void *arg);
291 
300 extern void SDSPI_init(void);
301 
324 extern SDSPI_Handle SDSPI_open(unsigned int index, unsigned char drv,
325  SDSPI_Params *params);
326 
336 extern void SDSPI_Params_init(SDSPI_Params *params);
337 
338 #ifdef __cplusplus
339 }
340 #endif
341 
342 #endif /* ti_drivers_SDSPI__include */
SDSPI Global configuration.
Definition: SDSPI.h:247
void * object
Definition: SDSPI.h:252
struct SDSPI_Config * SDSPI_Handle
A handle that is returned from a SDSPI_open() call.
Definition: SDSPI.h:173
int(* SDSPI_ControlFxn)(SDSPI_Handle handle, unsigned int cmd, void *arg)
A function pointer to a driver specific implementation of SDSPI_control().
Definition: SDSPI.h:213
SDSPI_OpenFxn openFxn
Definition: SDSPI.h:227
SDSPI_FxnTable const * fxnTablePtr
Definition: SDSPI.h:249
The definition of a SDSPI function table that contains the required set of functions to control a spe...
Definition: SDSPI.h:222
SDSPI_Handle SDSPI_open(unsigned int index, unsigned char drv, SDSPI_Params *params)
This function registers the SDSPI driver with BIOS' FatFs module and mounts the FatFs file system...
void(* SDSPI_InitFxn)(SDSPI_Handle handle)
A function pointer to a driver specific implementation of SDSPI_init().
Definition: SDSPI.h:193
struct SDSPI_FxnTable SDSPI_FxnTable
The definition of a SDSPI function table that contains the required set of functions to control a spe...
struct SDSPI_Config SDSPI_Config
SDSPI Global configuration.
SDSPI Parameters.
Definition: SDSPI.h:184
uint32_t bitRate
Definition: SDSPI.h:185
void const * hwAttrs
Definition: SDSPI.h:255
void SDSPI_init(void)
This function initializes the SDSPI driver module.
int SDSPI_control(SDSPI_Handle handle, unsigned int cmd, void *arg)
Function performs implementation specific features on a given SDSPI_Handle.
SDSPI_Handle(* SDSPI_OpenFxn)(SDSPI_Handle handle, unsigned char drv, SDSPI_Params *params)
A function pointer to a driver specific implementation of SDSPI_open().
Definition: SDSPI.h:199
void * custom
Definition: SDSPI.h:186
void(* SDSPI_CloseFxn)(SDSPI_Handle handle)
A function pointer to a driver specific implementation of SDSPI_close().
Definition: SDSPI.h:207
void SDSPI_Params_init(SDSPI_Params *params)
Function to initialize the SDSPI_Params struct to its defaults.
SDSPI_InitFxn initFxn
Definition: SDSPI.h:224
struct SDSPI_Params SDSPI_Params
SDSPI Parameters.
void SDSPI_close(SDSPI_Handle handle)
Function to close a SDSPI peripheral specified by the SDSPI handle. This function unmounts the file s...
SDSPI_ControlFxn controlFxn
Definition: SDSPI.h:233
SDSPI_CloseFxn closeFxn
Definition: SDSPI.h:230
Copyright 2015, Texas Instruments Incorporated