nm_bus_wrapper.h
Go to the documentation of this file.
1 
35 #ifndef _NM_BUS_WRAPPER_H_
36 #define _NM_BUS_WRAPPER_H_
37 
39 
43 #define NM_BUS_TYPE_I2C ((uint8)0)
44 #define NM_BUS_TYPE_SPI ((uint8)1)
45 #define NM_BUS_TYPE_UART ((uint8)2)
46 
49 #define NM_BUS_IOCTL_R ((uint8)0)
50 #define NM_BUS_IOCTL_W ((uint8)1)
51 #define NM_BUS_IOCTL_W_SPECIAL ((uint8)2)
53 #define NM_BUS_IOCTL_RW ((uint8)3)
55 #define NM_BUS_IOCTL_WR_RESTART ((uint8)4)
61 typedef struct
62 {
63  uint16 u16MaxTrxSz;
65 
71 typedef struct
72 {
73  uint8 u8SlaveAdr;
74  uint8 *pu8Buf;
75  uint16 u16Sz;
77 
83 typedef struct
84 {
85  uint8 u8SlaveAdr;
86  uint8 *pu8Buf1;
87  uint8 *pu8Buf2;
88  uint16 u16Sz1;
89  uint16 u16Sz2;
91 
97 typedef struct
98 {
99  uint8 *pu8InBuf;
101  uint8 *pu8OutBuf;
103  uint16 u16Sz;
105 
106 
112 typedef struct
113 {
114  uint8 *pu8Buf;
115  uint16 u16Sz;
119 
120 
121 #ifdef __cplusplus
122  extern "C" {
123  #endif
124 
134 sint8 nm_bus_init(uint8 *req_com_port, uint32 req_serial_number);
135 
146 sint8 nm_bus_ioctl(uint8 u8Cmd, void* pvParameter);
147 
153 sint8 nm_bus_deinit(void);
154 
155 /*
156 * @fn nm_bus_reinit
157 * @brief re-initialize the bus wrapper
158 * @param [in] void *config
159 * re-init configuration data
160 * @return ZERO in case of success and M2M_ERR_BUS_FAIL in case of failure
161 */
162 sint8 nm_bus_reinit(void *);
163 /*
164 * @fn nm_bus_get_chip_type
165 * @brief get chip type
166 * @return ZERO in case of success and M2M_ERR_BUS_FAIL in case of failure
167 */
168 #ifdef CONF_WINC_USE_UART
169 uint8 nm_bus_get_chip_type(void);
170 uint8 nm_bus_get_sb_type(void);
171 #endif
172 
173 /*
174 * @fn spi_rw
175 * @brief Process SPI Read/Write operation
176 * @param pu8Mosi TX Data buffer
177 * @param pu8Miso RX Data buffer
178 * @param u16Sz Transfer length
179 * @return ZERO in case of success and M2M_ERR_BUS_FAIL in case of failure
180 */
181 #ifdef CONF_WINC_USE_SPI
182 sint8 nm_spi_rw(uint8* pu8Mosi, uint8* pu8Miso, uint16 u16Sz);
183 #endif
184 
185 #ifdef __cplusplus
186  }
187  #endif
188 
189 #endif /*_NM_BUS_WRAPPER_H_*/
Structure holding SPI R/W parameters.
Structure holding I2C special operation parameters.
This module contains common APIs declarations.
signed char sint8
Range of values between -128 to 127.
Definition: nm_bsp.h:111
Structure holding bus capabilities information.
unsigned short uint16
Range of values between 0 to 65535.
Definition: nm_bsp.h:96
sint8 nm_bus_init(uint8 *req_com_port, uint32 req_serial_number)
sint8 nm_bus_reinit(void *)
tstrNmBusCapabilities egstrNmBusCapabilities
unsigned long uint32
Range of values between 0 to 4294967295.
Definition: nm_bsp.h:103
unsigned char uint8
Range of values between 0 to 255.
Definition: nm_bsp.h:89
sint8 nm_bus_ioctl(uint8 u8Cmd, void *pvParameter)
sint8 nm_bus_deinit(void)
De-initialize the bus wrapper.
Structure holding UART default operation parameters.
Structure holding I2C default operation parameters.


inertial_sense_ros
Author(s):
autogenerated on Sat Sep 19 2020 03:19:04