TMPM4G(1) Group Peripheral Driver User Manual  V1.0.0.0
txz_i2c_api_dma.h
Go to the documentation of this file.
1 
13 /*------------------------------------------------------------------------------*/
14 /* Define to prevent recursive inclusion */
15 /*------------------------------------------------------------------------------*/
16 #ifndef __I2C_API_DMA_H
17 #define __I2C_API_DMA_H
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 /*------------------------------------------------------------------------------*/
24 /* Includes */
25 /*------------------------------------------------------------------------------*/
26 #include "txz_i2c_api.h"
27 #include "txz_dma_ex.h"
28 
38 /*------------------------------------------------------------------------------*/
39 /* Macro Function */
40 /*------------------------------------------------------------------------------*/
46 /* no define */
47  /* End of group UTILITIES_Exported_macro */
51 
52 
53 /*------------------------------------------------------------------------------*/
54 /* Configuration */
55 /*------------------------------------------------------------------------------*/
61 /* no define */
62  /* End of group UTILITIES_Exported_define */
66 
67 
68 /*------------------------------------------------------------------------------*/
69 /* Macro Definition */
70 /*------------------------------------------------------------------------------*/
76 /* no define */
77  /* End of group UTILITIES_Exported_define */
81 
82 
83 /*------------------------------------------------------------------------------*/
84 /* Enumerated Type Definition */
85 /*------------------------------------------------------------------------------*/
91 /* no define*/
92  /* End of group UTILITIES_Exported_define */
96 
97 /*------------------------------------------------------------------------------*/
98 /* Structure Definition */
99 /*------------------------------------------------------------------------------*/
105 /*----------------------------------*/
109 /*----------------------------------*/
110 typedef struct
111 {
112  uint32_t event;
113  uint32_t rxch;
114  uint32_t txch;
116 
117 /*----------------------------------*/
121 /*----------------------------------*/
122 typedef struct
123 {
124  struct
125  {
126  dma_t *p_obj;
131  } dma;
132  struct
133  {
134  i2c_port_t sda;
136  i2c_port_t scl;
138  } port;
139  uint32_t frequency;
142 
143 /*----------------------------------*/
147 /*----------------------------------*/
148 typedef struct
149 {
150  i2c_t super;
154 } i2c_dma_t;
155  /* End of group UTILITIES_Exported_typedef */
159 
160 
161 /*------------------------------------------------------------------------------*/
162 /* Functions */
163 /*------------------------------------------------------------------------------*/
169 /* For DMA Master */
171 int32_t i2c_read_dma(i2c_dma_t *p_obj, uint8_t *p_rx, int32_t rx_length, int32_t address, int32_t stop);
172 int32_t i2c_write_dma(i2c_dma_t *p_obj, uint8_t *p_tx, int32_t tx_length, int32_t address, int32_t stop);
173 uint32_t i2c_irq_handler_dma(i2c_dma_t *p_obj);
174 void i2c_abort_dma(i2c_dma_t *p_obj);
175 
176 /* For DMA Slave */
177 TXZ_Result i2c_slave_init_dma(i2c_dma_t *p_obj, int32_t address);
178 int32_t i2c_slave_read_dma(i2c_dma_t *p_obj, uint8_t *p_rx, int32_t rx_length);
179 int32_t i2c_slave_write_dma(i2c_dma_t *p_obj, uint8_t *p_tx, int32_t tx_length);
180 uint32_t i2c_slave_irq_handler_dma(i2c_dma_t *p_obj);
181 void i2c_slave_abort_dma(i2c_dma_t *p_obj);
182  /* End of group UTILITIES_Exported_functions */
186  /* End of group UTILITIES */
190  /* End of group Example */
194 
195 #ifdef __cplusplus
196 }
197 #endif /* __cplusplus */
198 #endif /* __I2C_API_DMA_H */
199 
I2C DMA initial setting structure definition.
Definition: txz_i2c_api_dma.h:122
TXZ_Result i2c_init_dma(i2c_dma_t *p_obj)
TXZ_Result
Definition: txz_driver_def.h:43
TXZ_Result i2c_slave_init_dma(i2c_dma_t *p_obj, int32_t address)
i2c_dma_initial_setting_t init
Definition: txz_i2c_api_dma.h:151
i2c_dma_internal_info_t info
Definition: txz_i2c_api_dma.h:153
int32_t i2c_slave_read_dma(i2c_dma_t *p_obj, uint8_t *p_rx, int32_t rx_length)
I2C DMA handle structure definition.
Definition: txz_i2c_api_dma.h:148
i2c_port_t scl
Definition: txz_i2c_api_dma.h:136
TXZ_FunctionalState
Definition: txz_driver_def.h:53
uint32_t i2c_irq_handler_dma(i2c_dma_t *p_obj)
uint32_t rxch
Definition: txz_i2c_api_dma.h:113
TXZ_FunctionalState tx
Definition: txz_i2c_api_dma.h:129
void i2c_slave_abort_dma(i2c_dma_t *p_obj)
void i2c_abort_dma(i2c_dma_t *p_obj)
uint32_t i2c_slave_irq_handler_dma(i2c_dma_t *p_obj)
int32_t i2c_slave_write_dma(i2c_dma_t *p_obj, uint8_t *p_tx, int32_t tx_length)
i2c_t super
Definition: txz_i2c_api_dma.h:150
TXZ_FunctionalState rx
Definition: txz_i2c_api_dma.h:127
I2C DMA internal information structure definition.
Definition: txz_i2c_api_dma.h:110
int32_t i2c_read_dma(i2c_dma_t *p_obj, uint8_t *p_rx, int32_t rx_length, int32_t address, int32_t stop)
int32_t i2c_write_dma(i2c_dma_t *p_obj, uint8_t *p_tx, int32_t tx_length, int32_t address, int32_t stop)
uint32_t event
Definition: txz_i2c_api_dma.h:112
dma_t * p_obj
Definition: txz_i2c_api_dma.h:126
i2c_port_t sda
Definition: txz_i2c_api_dma.h:134
uint32_t frequency
Definition: txz_i2c_api_dma.h:139
uint32_t txch
Definition: txz_i2c_api_dma.h:114