MAX32665 SDK Documentation  0.2
Software Development Kit Overview and API Documentation
spixr.h
1 
6 /* ****************************************************************************
7  * Copyright (C) 2017 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  * $Date: 2018-09-10 16:20:17 -0500 (Mon, 10 Sep 2018) $
38  * $Revision: 37771 $
39  *
40  *************************************************************************** */
41 
42 /* Define to prevent redundant inclusion */
43 #ifndef _SPIXR_H_
44 #define _SPIXR_H_
45 
46 /* **** Includes **** */
47 #include "spixr_regs.h"
48 #include "mxc_sys.h"
49 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
54 
61 /* **** Definitions **** */
65 typedef enum {
70 
74 typedef struct {
75  uint32_t ssel;
77  uint32_t numbits;
78  spixr_width_t data_width;
80  uint32_t ssel_act_1;
81  uint32_t ssel_act_2;
82  uint32_t ssel_inact;
84  uint32_t baud_freq;
85  uint32_t baud_scale;
86 } spixr_cfg_t;
87 
88 
89 /* **** Function Prototypes **** */
90 
97 int SPIXR_Config(const spixr_cfg_t* cfg) ;
98 
103 void SPIXR_Enable(const sys_cfg_spixr_t* sys_cfg);
104 
111 void SPIXR_Send_Command(uint8_t* cmd, uint32_t length, uint32_t tx_num_char);
112 
116 void SPIXR_Disable(void);
117 
125 int SPIXR_Busy(void);
126 
127 #ifdef __cplusplus
128 }
129 #endif
130 
132 #endif /* _SPIXR_H_ */
SPIXR Configuration Object.
Definition: mxc_sys.h:193
void SPIXR_Enable(const sys_cfg_spixr_t *sys_cfg)
Enable the SPI RAM XIP Data module.
#define MXC_V_SPIXR_CTRL3_DATA_WIDTH_DUAL
CTRL3_DATA_WIDTH_DUAL Value.
Definition: spixr_regs.h:253
uint32_t baud_freq
Desired baud rate duty cycle control.
Definition: spixr.h:84
uint32_t numbits
Number of Bits per character.
Definition: spixr.h:77
uint32_t ssel_act_2
Slave Select Action delay 2.
Definition: spixr.h:81
uint32_t ssel_inact
Slave Select Inactive delay.
Definition: spixr.h:82
void SPIXR_Send_Command(uint8_t *cmd, uint32_t length, uint32_t tx_num_char)
Send a SPI formatted instruction to external RAM.
void SPIXR_Disable(void)
Disable the SPI RAM XIP Data module.
spixr_width_t data_width
SPI Data width.
Definition: spixr.h:78
#define MXC_V_SPIXR_CTRL3_DATA_WIDTH_MONO
CTRL3_DATA_WIDTH_MONO Value.
Definition: spixr_regs.h:251
int SPIXR_Config(const spixr_cfg_t *cfg)
Initialize the SPI RAM XIP Data module.
int SPIXR_Busy(void)
SPI active status.
Structure type for configuring a SPIXR port.
Definition: spixr.h:74
uint32_t ssel
Slave Select, in Master mode selects which Slave devices are selected.
Definition: spixr.h:75
spixr_width_t
Enum to define SPIXR data width.
Definition: spixr.h:65
uint32_t ssel_act_1
Slave Select Action delay 1.
Definition: spixr.h:80
uint32_t baud_scale
System Clock scale factor.
Definition: spixr.h:85
#define MXC_V_SPIXR_CTRL3_DATA_WIDTH_QUAD
CTRL3_DATA_WIDTH_QUAD Value.
Definition: spixr_regs.h:255