image/svg+xml
Brteve's API for EveApps
Version 0.0.1
The reference document for common folder of EveApps project.
 
Loading...
Searching...
No Matches
libMPSSE_spi.h
Go to the documentation of this file.
1
41#ifndef LIBMPSSE_SPI_H
42#define LIBMPSSE_SPI_H
43
44#include "ftd2xx.h"
45
46/******************************************************************************/
47/* Macro defines */
48/******************************************************************************/
49
50#ifdef __cplusplus
51#define FTDI_API extern "C"
52#else
53#define FTDI_API
54#endif
55
58
60#define SPI_TRANSFER_OPTIONS_SIZE_IN_BYTES 0x00000000
62#define SPI_TRANSFER_OPTIONS_SIZE_IN_BITS 0x00000001
64#define SPI_TRANSFER_OPTIONS_CHIPSELECT_ENABLE 0x00000002
66#define SPI_TRANSFER_OPTIONS_CHIPSELECT_DISABLE 0x00000004
68
71#define SPI_CONFIG_OPTION_MODE_MASK 0x00000003
72#define SPI_CONFIG_OPTION_MODE0 0x00000000
73#define SPI_CONFIG_OPTION_MODE1 0x00000001
74#define SPI_CONFIG_OPTION_MODE2 0x00000002
75#define SPI_CONFIG_OPTION_MODE3 0x00000003
76
77#define SPI_CONFIG_OPTION_CS_MASK 0x0000001C
78#define SPI_CONFIG_OPTION_CS_DBUS3 0x00000000
79#define SPI_CONFIG_OPTION_CS_DBUS4 0x00000004
80#define SPI_CONFIG_OPTION_CS_DBUS5 0x00000008
81#define SPI_CONFIG_OPTION_CS_DBUS6 0x0000000C
82#define SPI_CONFIG_OPTION_CS_DBUS7 0x00000010
84#define SPI_CONFIG_OPTION_CS_ACTIVELOW 0x00000020
86
87/******************************************************************************/
88/* Type defines */
89/******************************************************************************/
90
91#ifndef _FTDI_LIB_FT4222_H_
92typedef unsigned char uint8;
93typedef unsigned short uint16;
94typedef unsigned long long uint64;
95
96typedef signed char int8;
97typedef signed short int16;
98typedef signed long long int64;
99
100#ifdef __x86_64__
101/*20111025: 64bit linux doesn't work is uint32 is unsigned long*/
102typedef unsigned int uint32;
103typedef signed int int32;
104#else
105typedef unsigned long uint32;
106typedef signed long int32;
107#endif
108#endif
109
117
145
146/******************************************************************************/
147/* External variables */
148/******************************************************************************/
149
150/******************************************************************************/
151/* Function declarations */
152/******************************************************************************/
155 FT_DEVICE_LIST_INFO_NODE *chanInfo);
160 uint32 sizeToTransfer, uint32 *sizeTransfered, uint32 options);
162 uint32 sizeToTransfer, uint32 *sizeTransfered, uint32 options);
164 uint8 *outBuffer, uint32 sizeToTransfer, uint32 *sizeTransferred,
165 uint32 transferOptions);
166FTDI_API FT_STATUS SPI_IsBusy(FT_HANDLE handle, unsigned char *state);
172FTDI_API FT_STATUS SPI_ToggleCS(FT_HANDLE handle, unsigned char state);
173
174/******************************************************************************/
175
176#endif /*LIBMPSSE_SPI_H*/
static ft_uint32_t ft_uint8_t * buffer
Definition FT_Gpu_Hal.h:139
uint8_t uint8
Definition LibFT4222.h:66
uint32_t uint32
Definition LibFT4222.h:68
Native USB device driver for FTDI FT232x, FT245x, FT2232x and FT4232x devices FTD2XX library definiti...
ULONG FT_STATUS
Definition ftd2xx.h:69
PVOID FT_HANDLE
Definition ftd2xx.h:68
I2C_ClockRate_t
@ I2C_CLOCK_STANDARD_MODE
@ I2C_CLOCK_FAST_MODE
@ I2C_CLOCK_HIGH_SPEED_MODE
@ I2C_CLOCK_FAST_MODE_PLUS
FTDI_API FT_STATUS SPI_Write(FT_HANDLE handle, uint8 *buffer, uint32 sizeToTransfer, uint32 *sizeTransfered, uint32 options)
unsigned short uint16
FTDI_API FT_STATUS SPI_GetNumChannels(uint32 *numChannels)
signed char int8
signed short int16
unsigned long long uint64
#define FTDI_API
FTDI_API FT_STATUS FT_ReadGPIO(FT_HANDLE handle, uint8 *value)
unsigned long uint32
FTDI_API FT_STATUS SPI_IsBusy(FT_HANDLE handle, unsigned char *state)
FTDI_API FT_STATUS SPI_ChangeCS(FT_HANDLE handle, uint32 configOptions)
FTDI_API FT_STATUS SPI_CloseChannel(FT_HANDLE handle)
signed long long int64
enum I2C_ClockRate_t I2C_CLOCKRATE
FTDI_API void Init_libMPSSE(void)
FTDI_API FT_STATUS SPI_InitChannel(FT_HANDLE handle, ChannelConfig *config)
FTDI_API FT_STATUS FT_WriteGPIO(FT_HANDLE handle, uint8 dir, uint8 value)
FTDI_API FT_STATUS SPI_Read(FT_HANDLE handle, uint8 *buffer, uint32 sizeToTransfer, uint32 *sizeTransfered, uint32 options)
FTDI_API FT_STATUS SPI_OpenChannel(uint32 index, FT_HANDLE *handle)
struct ChannelConfig_t ChannelConfig
FTDI_API void Cleanup_libMPSSE(void)
signed long int32
FTDI_API FT_STATUS SPI_GetChannelInfo(uint32 index, FT_DEVICE_LIST_INFO_NODE *chanInfo)
FTDI_API FT_STATUS SPI_ToggleCS(FT_HANDLE handle, unsigned char state)
unsigned char uint8
FTDI_API FT_STATUS SPI_ReadWrite(FT_HANDLE handle, uint8 *inBuffer, uint8 *outBuffer, uint32 sizeToTransfer, uint32 *sizeTransferred, uint32 transferOptions)