gus.h
Go to the documentation of this file.
1
61 #ifndef __GUS_H__
62 #define __GUS_H__
63
64 #include "gr55xx_sys.h"
65 #include "custom_config.h"
66
71 #define GUS_CONNECTION_MAX (10 < CFG_MAX_CONNECTIONS ?\
72 10 : CFG_MAX_CONNECTIONS)
73 #define FLOW_ON 0x01
74 #define FLOW_OFF 0x00
75 #define GUS_MAX_DATA_LEN 247
76 #define GUS_FLOW_CTRL_LEN 1
77 #define GUS_SERVICE_UUID 0x1B, 0xD7, 0x90, 0xEC, 0xE8, 0xB9, 0x75, 0x80,\
78 0x0A, 0x46, 0x44, 0xD3, 0x01, 0x02, 0xED, 0xA6
86 typedef enum
87 {
88 GUS_EVT_INVALID,
89 GUS_EVT_RX_DATA_RECEIVED,
90 GUS_EVT_TX_DATA_SENT,
91 GUS_EVT_TX_PORT_OPENED,
92 GUS_EVT_TX_PORT_CLOSED,
93 GUS_EVT_FLOW_CTRL_ENABLE,
94 GUS_EVT_FLOW_CTRL_DISABLE,
95 GUS_EVT_TX_FLOW_OFF,
96 GUS_EVT_TX_FLOW_ON,
97 } gus_evt_type_t;
105 typedef struct
106 {
107 gus_evt_type_t evt_type;
108 uint8_t conn_idx;
109 uint8_t *p_data;
110 uint16_t length;
111 } gus_evt_t;
119 typedef void (*gus_evt_handler_t)(gus_evt_t *p_evt);
127 typedef struct
128 {
129 gus_evt_handler_t evt_handler;
130 } gus_init_t;
146 sdk_err_t gus_service_init(gus_init_t *p_gus_init);
147
159 sdk_err_t gus_tx_data_send(uint8_t conn_idx, uint8_t *p_data, uint16_t length);
160
171 sdk_err_t gus_rx_flow_ctrl_set(uint8_t conn_idx, uint8_t flow_ctrl);
174 #endif
175
gus_init_t
Goodix UART Service init stucture. This contains all option and data needed for initialization of the...
Definition: gus.h:128
GUS_EVT_TX_FLOW_OFF
@ GUS_EVT_TX_FLOW_OFF
Definition: gus.h:95
GUS_EVT_TX_DATA_SENT
@ GUS_EVT_TX_DATA_SENT
Definition: gus.h:90
GUS_EVT_TX_PORT_OPENED
@ GUS_EVT_TX_PORT_OPENED
Definition: gus.h:91
gus_evt_handler_t
void(* gus_evt_handler_t)(gus_evt_t *p_evt)
Goodix UART Service event handler type.
Definition: gus.h:119
gus_init_t::evt_handler
gus_evt_handler_t evt_handler
Definition: gus.h:129
gr55xx_sys.h
GR55XX System API.
GUS_EVT_FLOW_CTRL_ENABLE
@ GUS_EVT_FLOW_CTRL_ENABLE
Definition: gus.h:93
GUS_EVT_RX_DATA_RECEIVED
@ GUS_EVT_RX_DATA_RECEIVED
Definition: gus.h:89
GUS_EVT_TX_PORT_CLOSED
@ GUS_EVT_TX_PORT_CLOSED
Definition: gus.h:92
gus_evt_type_t
gus_evt_type_t
Goodix UART Service event types.
Definition: gus.h:87
gus_evt_t::length
uint16_t length
Definition: gus.h:110
GUS_EVT_INVALID
@ GUS_EVT_INVALID
Definition: gus.h:88
gus_service_init
sdk_err_t gus_service_init(gus_init_t *p_gus_init)
Initialize a Goodix UART Service instance and add in the database.
GUS_EVT_TX_FLOW_ON
@ GUS_EVT_TX_FLOW_ON
Definition: gus.h:96
sdk_err_t
uint16_t sdk_err_t
SDK API result type.
Definition: ble_error.h:243
gus_rx_flow_ctrl_set
sdk_err_t gus_rx_flow_ctrl_set(uint8_t conn_idx, uint8_t flow_ctrl)
Send GUS Rx flow control state to peer device.
gus_evt_t::evt_type
gus_evt_type_t evt_type
Definition: gus.h:107
gus_evt_t
Goodix UART Service event.
Definition: gus.h:106
gus_evt_t::conn_idx
uint8_t conn_idx
Definition: gus.h:108
GUS_EVT_FLOW_CTRL_DISABLE
@ GUS_EVT_FLOW_CTRL_DISABLE
Definition: gus.h:94
gus_tx_data_send
sdk_err_t gus_tx_data_send(uint8_t conn_idx, uint8_t *p_data, uint16_t length)
Send data to peer device.
gus_evt_t::p_data
uint8_t * p_data
Definition: gus.h:109