MAX32665 Peripheral Driver API
Peripheral Driver API for the MAX32665
spixf.h
1 
6 /* *****************************************************************************
7  * Copyright (C) 2015 Maxim Integrated Products, Inc., All Rights Reserved.
8  *
9  * Permission is hereby granted, free of charge, to any person obtaining a
10  * copy of this software and associated documentation files (the "Software"),
11  * to deal in the Software without restriction, including without limitation
12  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13  * and/or sell copies of the Software, and to permit persons to whom the
14  * Software is furnished to do so, subject to the following conditions:
15  *
16  * The above copyright notice and this permission notice shall be included
17  * in all copies or substantial portions of the Software.
18  *
19  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22  * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
23  * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25  * OTHER DEALINGS IN THE SOFTWARE.
26  *
27  * Except as contained in this notice, the name of Maxim Integrated
28  * Products, Inc. shall not be used except as stated in the Maxim Integrated
29  * Products, Inc. Branding Policy.
30  *
31  * The mere transfer of this software does not imply any licenses
32  * of trade secrets, proprietary technology, copyrights, patents,
33  * trademarks, maskwork rights, or any other form of intellectual
34  * property whatsoever. Maxim Integrated Products, Inc. retains all
35  * ownership rights.
36  *
37  **************************************************************************** */
38 
39 /* Define to prevent redundant inclusion */
40 #ifndef _MXC_SPIXF_H_
41 #define _MXC_SPIXF_H_
42 
43 /* **** Includes **** */
44 #include "mxc_device.h"
45 #include "mxc_sys.h"
46 #include "spixfc_regs.h"
47 #include "spixfm_regs.h"
48 #include "spixfc_fifo_regs.h"
49 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
60 /* **** Definitions **** */
64 typedef enum {
65  MXC_SPIXF_SSEL0_HIGH = (0x1 << 0),
66  MXC_SPIXF_SSEL0_LOW = 0,
67  MXC_SPIXF_SSEL1_HIGH = (0x1 << 1),
68  MXC_SPIXF_SSEL1_LOW = 0,
69  MXC_SPIXF_SSEL2_HIGH = (0x1 << 2),
70  MXC_SPIXF_SSEL2_LOW = 0,
71  MXC_SPIXF_SSEL3_HIGH = (0x1 << 3),
72  MXC_SPIXF_SSEL3_LOW = 0
73 }
75 
79 typedef enum {
80  MXC_SPIXF_HEADER_DIR_NONE,
81  MXC_SPIXF_HEADER_DIR_TX,
82  MXC_SPIXF_HEADER_DIR_RX,
83  MXC_SPIXF_HEADER_DIR_BOTH,
85 
89 typedef enum {
90  MXC_SPIXF_ACTIVE_LOW,
91  MXC_SPIF_ACTIVE_HIGH,
93 
97 typedef enum {
98  MXC_SPIXF_CMD_EVERY_TRANS,
99  MXC_SPIXF_CMD_FIRST_TRANS,
101 
106 typedef enum {
107  MXC_SPIXF_MODE_0 =0,
108  MXC_SPIXF_MODE_3 =3,
110 
114 typedef enum {
115  MXC_SPIXF_4B,
116  MXC_SPIXF_8B,
117  MXC_SPIXF_16B,
118  MXC_SPIXF_32B,
120 
124 typedef enum {
125  MXC_SPIXF_HEADER_UNITS_BITS,
126  MXC_SPIXF_HEADER_UNITS_BYTES,
127  MXC_SPIXF_HEADER_UNITS_PAGES,
129 
133 typedef enum {
138 
142 typedef struct {
145  uint32_t hz;
147 
151 typedef enum {
152  MXC_SPIXF_SYS_CLOCKS_0,
153  MXC_SPIXF_SYS_CLOCKS_2,
154  MXC_SPIXF_SYS_CLOCKS_4,
155  MXC_SPIXF_SYS_CLOCKS_8,
157 
161 typedef enum {
167 
171 typedef enum {
172  MXC_SPIXF_SINGLE_SDIO,
173  MXC_SPIXF_DUAL_SDIO,
174  MXC_SPIXF_QUAD_SDIO,
175  MXC_SPIXF_INVALID,
177 
181 typedef enum {
182  MXC_SPIXF_TRISTATE = MXC_S_SPIXFM_IO_CTRL_PU_PD_CTRL_TRI_STATE,
183  MXC_SPIXF_PULL_UP = MXC_S_SPIXFM_IO_CTRL_PU_PD_CTRL_PULL_UP,
184  MXC_SPIXF_PULL_DOWN = MXC_S_SPIXFM_IO_CTRL_PU_PD_CTRL_PULL_DOWN,
186 
191 typedef enum {
192  MXC_SPIXF_LOW =0,
193  MXC_SPIXF_HIGH
195 
199 typedef struct mxc_spixf_req mxc_spixf_req_t;
200 
206 typedef void (*spixr_complete_cb_t) (mxc_spixf_req_t*, int);
207 
209  uint8_t deass;
210  uint8_t wait_tx;
211  const uint8_t *tx_data;
212  uint8_t *rx_data;
214  unsigned len;
215  unsigned read_num;
216  unsigned write_num;
218 };
219 
220 /***** Globals *****/
221 
222 /***** Function Prototypes *****/
231 int MXC_SPIXF_Init (uint32_t cmdval, uint32_t frequency);
232 
236 void MXC_SPIXF_Shutdown (void);
237 
247 
257 int MXC_SPIXF_Clocks (uint32_t len, uint8_t deass);
258 
269 int MXC_SPIXF_Transaction (mxc_spixf_req_t *req);
270 
279 int MXC_SPIXF_TransactionAsync (mxc_spixf_req_t *req);
280 
288 int MXC_SPIXF_AbortAsync (mxc_spixf_req_t *req);
289 
297 void MXC_SPIXF_Handler (void);
298 
305 
313 int MXC_SPIXF_EnableInt (uint32_t mask);
314 
322 int MXC_SPIXF_DisableInt (uint32_t mask);
323 
331 int MXC_SPIXF_ClearFlags (uint32_t flags);
332 
339 
340 //Low level
341 
350 
357 
364 
371 
378 
386 int MXC_SPIXF_SetSPIFrequency (unsigned int hz);
387 
394 
405 
413 
424 
432 
441 
448 
457 
464 
473 
480 
487 
494 
500 unsigned int MXC_SPIXF_GetBytesPerAddr (void);
501 
510 int MXC_SPIXF_SetModeClk (uint8_t mdclk);
511 
518 uint8_t MXC_SPIXF_GetModeClk (void);
519 
527 int MXC_SPIXF_SetCmdValue (uint8_t cmdval);
528 
536 
541 
548 
557 int MXC_SPIXF_BBDataOutputEnable (uint8_t mask);
558 
567 int MXC_SPIXF_BBDataOutputDisable (uint8_t mask);
568 
576 
583 
590 
598 int MXC_SPIXF_SetModeData (uint16_t data);
599 
605 uint16_t MXC_SPIXF_GetModeData (void);
606 
613 
620 
627 
634 
641 
648 
657 int MXC_SPIXF_SetSCKSampleDelay (uint8_t delay);
658 
665 
673 
680 
687 
694 
701 
708 
715 
722 
731 int MXC_SPIXF_SampleOutputEnable (uint8_t mask);
732 
741 int MXC_SPIXF_SampleOutputDisable (uint8_t mask);
742 
750 
758 
763 
768 
774 uint8_t MXC_SPIXF_GetSCKDrive (void);
775 
780 
785 
792 
799 
806 
813 
820 
827 
834 
841 
848 
855 
861 int MXC_SPIXF_Enable (void);
862 
868 int MXC_SPIXF_Disable (void);
869 
876 
881 
886 
893 
898 
903 
910 
915 
920 
927 
934 
940 uint8_t MXC_SPIXF_GetPuPdCtrl (void);
941 
949 int MXC_SPIXF_SetBusIdle (unsigned int busidle);
950 
956 unsigned int MXC_SPIXF_GetBusIdle (void);
957 
980 #ifdef __cplusplus
981 }
982 #endif
983 
984 #endif /* _MXC_SPIXF_H_ */
MXC_SPIXF_GetSampleOutputValue
uint8_t MXC_SPIXF_GetSampleOutputValue(void)
Get bit bang sample output value.
MXC_SPIXF_GetModeClk
uint8_t MXC_SPIXF_GetModeClk(void)
Get number of SPI clocks being used for the mode/dummy phase of fetch.
MXC_SPIXF_DisableInt
int MXC_SPIXF_DisableInt(uint32_t mask)
Disable Interrupts.
MXC_SPIXF_Transaction
int MXC_SPIXF_Transaction(mxc_spixf_req_t *req)
Read/write MXC_SPIXF data. Will block until transaction is complete.
MXC_SPIXF_SetSSDriveOutputHigh
void MXC_SPIXF_SetSSDriveOutputHigh(void)
Set Slave select in bit bang mode to a 1.
MXC_SPIXF_GetPageSize
mxc_spixf_page_size_t MXC_SPIXF_GetPageSize(void)
Get the current page size for a transaction.
MXC_SPIXF_SYS_CLOCKS_3
@ MXC_SPIXF_SYS_CLOCKS_3
3 system clocks
Definition: spixf.h:163
MXC_SPIXF_Clocks
int MXC_SPIXF_Clocks(uint32_t len, uint8_t deass)
Send Clock cycles on SCK without reading or writing.
MXC_SPIXF_SetModeClk
int MXC_SPIXF_SetModeClk(uint8_t mdclk)
Set number of SPI clocks needed during the mode/dummy phase of fetch.
MXC_SPIXF_BBDataOutputIsEnabled
uint8_t MXC_SPIXF_BBDataOutputIsEnabled(void)
Get if bit bang output mode is enabled or disabled for all bits.
MXC_S_SPIXFM_IO_CTRL_PU_PD_CTRL_TRI_STATE
#define MXC_S_SPIXFM_IO_CTRL_PU_PD_CTRL_TRI_STATE
Definition: spixfm_regs.h:282
mxc_spixf_mode_t
mxc_spixf_mode_t
SPIXF mode.
Definition: spixf.h:106
MXC_SPIXF_GetIoctrlSSDrive
uint8_t MXC_SPIXF_GetIoctrlSSDrive(void)
Get IOCTRL SS Drive.
MXC_SPIXF_ClearFlags
int MXC_SPIXF_ClearFlags(uint32_t flags)
Clear Flags that have been set.
MXC_SPIXF_EnableInt
int MXC_SPIXF_EnableInt(uint32_t mask)
Enable Interrupts.
MXC_SPIXF_SetIoctrlSSDriveLow
void MXC_SPIXF_SetIoctrlSSDriveLow()
Set IOCTRL SS Drive to Low.
MXC_SPIXF_BitBangModeEnable
int MXC_SPIXF_BitBangModeEnable(void)
Enable bit bang mode.
MXC_SPIXF_SCKFeebackDisable
int MXC_SPIXF_SCKFeebackDisable(void)
Disable SCK Feedback.
MXC_SPIXF_GetSPIFrequency
uint32_t MXC_SPIXF_GetSPIFrequency(void)
Get the current SPI Frequency.
MXC_SPIXF_SetSCKSampleDelay
int MXC_SPIXF_SetSCKSampleDelay(uint8_t delay)
Set SPI clock periods to delay before sampling SDIO input. This value must be less than or equal to H...
mxc_spixf_req::wait_tx
uint8_t wait_tx
Wait for the TX FIFO to be empty before returning.
Definition: spixf.h:210
MXC_SPIXF_IsEnabled
int MXC_SPIXF_IsEnabled(void)
Is SPIXF Enabled or Disabled.
MXC_SPIXF_GetBBDataOutputValue
uint8_t MXC_SPIXF_GetBBDataOutputValue(void)
Get Output data value.
MXC_SPIXF_SYS_CLOCKS_5
@ MXC_SPIXF_SYS_CLOCKS_5
5 system clocks
Definition: spixf.h:164
mxc_spixf_cfg_t
MXC_SPIXF configuration type.
Definition: spixf.h:142
mxc_spixf_req::deass
uint8_t deass
De-assert slave select at the end of the transaction.
Definition: spixf.h:209
MXC_SPIXF_RXFIFOIsEnabled
int MXC_SPIXF_RXFIFOIsEnabled(void)
Is RX FIFO (results fifo) enabled or disabled.
MXC_SPIXF_TXFIFODisable
int MXC_SPIXF_TXFIFODisable(void)
TX FIFO (Transaction FIFO) disable.
MXC_SPIXF_BitBangModeIsEnabled
int MXC_SPIXF_BitBangModeIsEnabled(void)
Is Bit bang mode enabled or disabled.
MXC_S_SPIXFM_IO_CTRL_PU_PD_CTRL_PULL_UP
#define MXC_S_SPIXFM_IO_CTRL_PU_PD_CTRL_PULL_UP
Definition: spixfm_regs.h:284
MXC_SPIXF_Shutdown
void MXC_SPIXF_Shutdown(void)
Shutdown MXC_SPIXF module.
MXC_SPIXF_Set3ByteAddr
int MXC_SPIXF_Set3ByteAddr(void)
Set address mode to be 3 byte address.
MXC_SPIXF_SetPuPdCtrl
void MXC_SPIXF_SetPuPdCtrl(mxc_spixf_pup_t pupd)
Set pull up pull down.
MXC_SPIXF_WIDTH_2
@ MXC_SPIXF_WIDTH_2
2 Data Lines (x2).
Definition: spixf.h:135
mxc_spixf_ssiact_t
mxc_spixf_ssiact_t
Slave select Inactive timing.
Definition: spixf.h:161
MXC_SPIXF_RXFIFODisable
int MXC_SPIXF_RXFIFODisable(void)
RX FIFO (results fifo) disable.
mxc_spixf_req::len
unsigned len
Number of bytes to send.
Definition: spixf.h:214
mxc_spixf_req::rx_data
uint8_t * rx_data
RX buffer.
Definition: spixf.h:212
MXC_SPIXF_SCKFeebackIsEnabled
int MXC_SPIXF_SCKFeebackIsEnabled(void)
Get if SCK Feedback is enabled or disabled.
MXC_SPIXF_SetDataWidth
int MXC_SPIXF_SetDataWidth(mxc_spixf_spiwidth_t width)
Set Number of data I/O used to send data.
MXC_SPIXF_SetPageSize
void MXC_SPIXF_SetPageSize(mxc_spixf_page_size_t size)
Set Page Size for transactions.
MXC_SPIXF_SetSSInactiveTime
int MXC_SPIXF_SetSSInactiveTime(mxc_spixf_ssiact_t ssiact)
Set slave select inactive timing to delay from de-assertion of slave select to re-assertion of slave ...
MXC_SPIXF_GetFlags
int MXC_SPIXF_GetFlags(void)
Get Flags of Interrupts of Flags that have been set.
MXC_SPIXF_GetIoctrlSCLKDrive
uint8_t MXC_SPIXF_GetIoctrlSCLKDrive(void)
Get IOCTRL SCLK Drive.
mxc_spixf_cfg_t::ssel_pol
mxc_spixf_sspol_t ssel_pol
Mask of active levels for slave select signals, use mxc_spixf_ssel_t.
Definition: spixf.h:144
MXC_SPIXF_SimpleRXDisable
int MXC_SPIXF_SimpleRXDisable(void)
Set to Receive only in simple mode.
MXC_SPIXF_GetBytesPerAddr
unsigned int MXC_SPIXF_GetBytesPerAddr(void)
Get number of bytes in address.
MXC_SPIXF_BitBangModeDisable
int MXC_SPIXF_BitBangModeDisable(void)
Disable bit bang mode.
MXC_SPIXF_SetSCKNonInverted
int MXC_SPIXF_SetSCKNonInverted(void)
Set SCK to be non-inverted.
MXC_SPIXF_SetIoctrlSDIODriveHigh
void MXC_SPIXF_SetIoctrlSDIODriveHigh()
Set IOCTRL SDIO Drive to High.
MXC_SPIXF_SetSSActiveTime
int MXC_SPIXF_SetSSActiveTime(mxc_spixf_ssact_t ssact)
Set the slave select active timing. This will control the delay from assertion of slave select to sta...
MXC_SPIXF_SetIoctrlSCLKDriveHigh
void MXC_SPIXF_SetIoctrlSCLKDriveHigh()
Set IOCTRL SCLK Drive to High.
MXC_SPIXF_GetIoctrlSDIODrive
uint8_t MXC_SPIXF_GetIoctrlSDIODrive(void)
Get IOCTRL SDIO Drive.
MXC_SPIXF_GetBBDataInputValue
uint8_t MXC_SPIXF_GetBBDataInputValue(void)
Get Input data value.
MXC_SPIXF_SetSCKDriveLow
void MXC_SPIXF_SetSCKDriveLow(void)
Drive SCK Low.
MXC_SPIXF_SetCmdValue
int MXC_SPIXF_SetCmdValue(uint8_t cmdval)
Set command value for spi transaction.
mxc_spixf_hdr_units_t
mxc_spixf_hdr_units_t
Header units.
Definition: spixf.h:124
mxc_spixf_cfg_t::hz
uint32_t hz
SPI Frequency in Hz.
Definition: spixf.h:145
mxc_spixf_req
MXC_SPIXF Transaction request.
Definition: spixf.h:208
spixr_complete_cb_t
void(* spixr_complete_cb_t)(mxc_spixf_req_t *, int)
Callback for asynchronous request.
Definition: spixf.h:206
MXC_SPIXF_SampleOutputDisable
int MXC_SPIXF_SampleOutputDisable(uint8_t mask)
Disable bit bang sample output mode on spefic bits.
MXC_SPIXF_SetCmdWidth
int MXC_SPIXF_SetCmdWidth(mxc_spixf_spiwidth_t width)
Set Number of data I/O used to send commands.
MXC_SPIXF_SetSCKDriveHigh
void MXC_SPIXF_SetSCKDriveHigh(void)
Drive SCK High.
MXC_SPIXF_SetSPIFrequency
int MXC_SPIXF_SetSPIFrequency(unsigned int hz)
Set SPI Frequency.
MXC_SPIXF_GetBusIdle
unsigned int MXC_SPIXF_GetBusIdle(void)
Get Bus Idle time.
MXC_SPIXF_SCKFeedbackEnable
int MXC_SPIXF_SCKFeedbackEnable(void)
Enable SCK Feedback.
mxc_spixf_ssact_t
mxc_spixf_ssact_t
Slave select active timing.
Definition: spixf.h:151
MXC_S_SPIXFM_IO_CTRL_PU_PD_CTRL_PULL_DOWN
#define MXC_S_SPIXFM_IO_CTRL_PU_PD_CTRL_PULL_DOWN
Definition: spixfm_regs.h:286
mxc_spixf_width_t
mxc_spixf_width_t
Number of data lines to use.
Definition: spixf.h:133
MXC_SPIXF_SimpleRXIsEnabled
int MXC_SPIXF_SimpleRXIsEnabled(void)
Get Receive only mode setting.
MXC_SPIXF_SetIoctrlSDIODriveLow
void MXC_SPIXF_SetIoctrlSDIODriveLow()
Set IOCTRL SDIO Drive to Low.
mxc_spixf_req::tx_data
const uint8_t * tx_data
TX buffer.
Definition: spixf.h:211
MXC_SPIXF_RXFIFOEnable
int MXC_SPIXF_RXFIFOEnable(void)
RX FIFO (results fifo) enable.
MXC_SPIXF_TXFIFOEnable
int MXC_SPIXF_TXFIFOEnable(void)
TX FIFO (Transaction FIFO) enable.
MXC_SPIXF_SetIoctrlSSDriveHigh
void MXC_SPIXF_SetIoctrlSSDriveHigh()
Set IOCTRL SS Drive to High.
MXC_SPIXF_SetBusIdle
int MXC_SPIXF_SetBusIdle(unsigned int busidle)
Set bus idle to a time where ss will be deactivated if timer runs out.
MXC_SPIXF_SetSCKInverted
int MXC_SPIXF_SetSCKInverted(void)
Set SCK to be inverted.
mxc_spixf_pup_t
mxc_spixf_pup_t
IO pullup/pulldown Control.
Definition: spixf.h:181
MXC_SPIXF_IOCtrl
void MXC_SPIXF_IOCtrl(mxc_spixf_ds_t sclk_ds, mxc_spixf_ds_t ss_ds, mxc_spixf_ds_t sdio_ds, mxc_spixf_pup_t pupdctrl)
Setup Drive Strength on the I/O pins.
MXC_SPIXF_GetModeData
uint16_t MXC_SPIXF_GetModeData(void)
Get the data that is supposed to send with the dummy clocks.
MXC_SPIXF_Disable
int MXC_SPIXF_Disable(void)
Disables SPIXF but doesnt change any configurations.
MXC_SPIXF_SetSSPolActiveHigh
int MXC_SPIXF_SetSSPolActiveHigh(void)
Set the slave select polarity to high or low.
mxc_spixf_hdr_direction_t
mxc_spixf_hdr_direction_t
Header direction.
Definition: spixf.h:79
MXC_SPIXF_WIDTH_1
@ MXC_SPIXF_WIDTH_1
1 Data Line.
Definition: spixf.h:134
mxc_spixf_req::width
mxc_spixf_width_t width
Number of data lines to use
Definition: spixf.h:213
MXC_SPIXF_SimpleModeIsEnabled
int MXC_SPIXF_SimpleModeIsEnabled(void)
Get if Simple mode is enabled or disabled.
MXC_SPIXF_Enable
int MXC_SPIXF_Enable(void)
Enables SPIXF but doesnt change any configurations.
MXC_SPIXF_SYS_CLOCKS_1
@ MXC_SPIXF_SYS_CLOCKS_1
1 system clocks
Definition: spixf.h:162
MXC_SPIXF_GetMode
mxc_spixf_mode_t MXC_SPIXF_GetMode(void)
Get which mode that spixf is currently set for.
MXC_SPIXF_GetCmdMode
mxc_spixf_cmd_t MXC_SPIXF_GetCmdMode(void)
Get Command mode.
MXC_SPIXF_WIDTH_4
@ MXC_SPIXF_WIDTH_4
4 Data Lines (x4).
Definition: spixf.h:136
MXC_SPIXF_GetSCKDrive
uint8_t MXC_SPIXF_GetSCKDrive(void)
Get if SCK is high or low.
mxc_spixf_cfg_t::mode
mxc_spixf_mode_t mode
MXC_SPIXF mode to use, 0-3.
Definition: spixf.h:143
mxc_spixf_spiwidth_t
mxc_spixf_spiwidth_t
Data Width, # of data I/O used to rcv data.
Definition: spixf.h:171
mxc_spixf_page_size_t
mxc_spixf_page_size_t
Select page size.
Definition: spixf.h:114
MXC_SPIXF_SetAddrWidth
int MXC_SPIXF_SetAddrWidth(mxc_spixf_spiwidth_t width)
Set Number of data I/O used to send address.
MXC_SPIXF_AbortAsync
int MXC_SPIXF_AbortAsync(mxc_spixf_req_t *req)
Abort asynchronous request.
MXC_SPIXF_GetPuPdCtrl
uint8_t MXC_SPIXF_GetPuPdCtrl(void)
Get what setting the pull up pull down is set to.
MXC_SPIXF_TransactionAsync
int MXC_SPIXF_TransactionAsync(mxc_spixf_req_t *req)
Asynchronously read/write MXC_SPIXF data.
MXC_SPIXF_GetSCKInverted
int MXC_SPIXF_GetSCKInverted(void)
Get weather SCK is inverted or non-inverted.
MXC_SPIXF_GetSSDriveOutput
uint8_t MXC_SPIXF_GetSSDriveOutput(void)
Get current slave select output.
MXC_SPIXF_SimpleRXEnabled
int MXC_SPIXF_SimpleRXEnabled(void)
Set to Receive only in simple mode.
mxc_spixf_req::read_num
unsigned read_num
Number of bytes read.
Definition: spixf.h:215
MXC_SPIXF_SetSSPolActiveLow
int MXC_SPIXF_SetSSPolActiveLow(void)
Set the slave select polarity to high or low.
MXC_SPIXF_GetSCKSampleDelay
uint8_t MXC_SPIXF_GetSCKSampleDelay(void)
Get the Number of clocks being delayed before sampling SDIO.
MXC_SPIXF_GetCmdWidth
mxc_spixf_spiwidth_t MXC_SPIXF_GetCmdWidth(void)
Get number of data I/O expected to be used for commands.
MXC_SPIXF_SampleOutputIsEnabled
uint8_t MXC_SPIXF_SampleOutputIsEnabled(void)
Get if sample output bit bang is enabled or disabled.
MXC_SPIXF_Handler
void MXC_SPIXF_Handler(void)
MXC_SPIXF interrupt handler.
MXC_SPIXF_SYS_CLOCKS_9
@ MXC_SPIXF_SYS_CLOCKS_9
9 system clocks
Definition: spixf.h:165
MXC_SPIXF_BBDataOutputEnable
int MXC_SPIXF_BBDataOutputEnable(uint8_t mask)
Enable bits to be in bit bang output mode.
MXC_SPIXF_GetDataWidth
mxc_spixf_spiwidth_t MXC_SPIXF_GetDataWidth(void)
Get number of data I/O expected to be used for data.
MXC_SPIXF_Init
int MXC_SPIXF_Init(uint32_t cmdval, uint32_t frequency)
Setup MXC_SPIXF for Execute in Place.
MXC_SPIXF_SetCmdModeFirstTrans
int MXC_SPIXF_SetCmdModeFirstTrans(void)
Set command mode to send a read a command the first transaction.
mxc_spixf_ssel_t
mxc_spixf_ssel_t
Active levels for slave select lines.
Definition: spixf.h:64
MXC_SPIXF_Set4ByteAddr
int MXC_SPIXF_Set4ByteAddr(void)
Set address mode to be 4 byte address.
MXC_SPIXF_BBDataOutputDisable
int MXC_SPIXF_BBDataOutputDisable(uint8_t mask)
Disable bits to not be in bit bang output mode.
MXC_SPIXF_SampleOutputEnable
int MXC_SPIXF_SampleOutputEnable(uint8_t mask)
Enable bit bang sample output mode on spefic bits.
MXC_SPIXF_SimpleModeDisable
int MXC_SPIXF_SimpleModeDisable(void)
Disable Simple Mode.
MXC_SPIXF_TXFIFOIsEnabled
int MXC_SPIXF_TXFIFOIsEnabled(void)
Is TX FIFO (Transaction FIFO) Enabled or Disabled.
mxc_spixf_req::callback
spixr_complete_cb_t callback
callback function
Definition: spixf.h:217
MXC_SPIXF_SetModeData
int MXC_SPIXF_SetModeData(uint16_t data)
Set the data to send with the dummy clocks.
mxc_spixf_sspol_t
mxc_spixf_sspol_t
SPIXF Pin mode.
Definition: spixf.h:89
MXC_SPIXF_GetSSInactiveTime
mxc_spixf_ssiact_t MXC_SPIXF_GetSSInactiveTime(void)
Get slave select inactive timing to delay from de-assertion of slave select to re-assertion of slave ...
MXC_SPIXF_GetAddrWidth
mxc_spixf_spiwidth_t MXC_SPIXF_GetAddrWidth(void)
Get number of data I/O expected to be used for address.
MXC_SPIXF_ReadyForSleep
int MXC_SPIXF_ReadyForSleep(void)
Attempt to prepare the MXC_SPIXF for sleep.
mxc_spixf_cmd_t
mxc_spixf_cmd_t
SPIXF set command.
Definition: spixf.h:97
MXC_SPIXF_SetIoctrlSCLKDriveLow
void MXC_SPIXF_SetIoctrlSCLKDriveLow()
Set IOCTRL SCLK Drive to Low.
MXC_SPIXF_SimpleModeEnable
int MXC_SPIXF_SimpleModeEnable(void)
Enable Simple Mode.
mxc_spixf_req::write_num
unsigned write_num
Number of bytes written.
Definition: spixf.h:216
mxc_spixf_ds_t
mxc_spixf_ds_t
SPIXF drive strentgh.
Definition: spixf.h:191
MXC_SPIXF_GetSSActiveTime
mxc_spixf_ssact_t MXC_SPIXF_GetSSActiveTime(void)
Get the slave select active timing setting.
MXC_SPIXF_SetCmdModeEveryTrans
int MXC_SPIXF_SetCmdModeEveryTrans(void)
Set command mode to send read a command every time a spi transaction is initiated.
MXC_SPIXF_SetSSDriveOutputLow
void MXC_SPIXF_SetSSDriveOutputLow(void)
Set Slave select in bit bang mode to a 0.
MXC_SPIXF_GetSSPolarity
int MXC_SPIXF_GetSSPolarity(void)
Get the current slave select polarity.
MXC_SPIXF_SetMode
int MXC_SPIXF_SetMode(mxc_spixf_mode_t mode)
Sets the SPI Mode.