main_ubi_sdk v 0.1.3
This is UBI4 documentation
a_protocol.h File Reference
Include dependency graph for a_protocol.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  device_address_struct
 
union  u_device_address
 
struct  var_len_payload_struct
 
union  u_bus_res_payload
 
struct  base_bus_transmit_settings_struct
 
struct  bus_main_module_header
 
struct  base_protocol_data_segment_struct
 
struct  ubi4_bus_package_info_struct
 
struct  ubi4_bridge_request_info_struct
 
struct  bridge_protocol_info_struct
 
struct  base_protocol_queue_segment_struct
 
struct  ubi4_bus_protocol_obj_struct
 
struct  ubi4_bus_protocol_init_struct
 

Typedefs

typedef void(* receive_data_func_t) (void *protocol_str)
 
typedef void(* receive_bridge_func_t) (void *port_str, uint8_t *buf, uint32_t size)
 
typedef void(* slave_answer_func_t) (void *protocol_str, uint8_t *buf, uint32_t size)
 
typedef void(* remove_pack_info_t) (void *protocol_str, void *pack_info)
 
typedef base_protocol_data_segment_struct *(* get_data_segment_func_t) (void *protocol_str, uint16_t size)
 
typedef protocol_parce_status_enum(* get_data_from_package_t) (void *protocol, uint8_t *buf, uint32_t size, ubi4_bus_package_info_struct *pack_info_out, uint8_t **buf_out, uint32_t *len)
 
typedef void(* receive_to_current_device_func_t) (void *protocol_str, uint8_t *buf, uint32_t size)
 
typedef void(* receive_to_another_device_func_t) (void *protocol_str, uint8_t *buf, uint32_t size)
 
typedef void(* protocol_answer_func_t) (void *protocol_str, void *pack_info, uint8_t *data_buf, uint16_t size)
 
typedef void(* protocol_answer_obj_data_func_t) (void *protocol_str, void *pack_info, base_protocol_data_segment_struct *data_segment)
 
typedef void(* device_main_receiver_t) (void *protocol_str, protocol_receive_struct receive_str)
 
typedef void(* protocol_bridge_receive_callback_t) (void *protocol_str, protocol_receive_struct receive_str)
 
typedef void(* transmit_data_segment_to_master_t) (void *protocol_str, uint8_t command, base_protocol_data_segment_struct *data_segment)
 
typedef void(* transmit_to_slave_t) (void *protocol_str, uint8_t address, uint8_t command, base_bus_transmit_settings_struct *tx_settings, uint8_t *data_buf, uint16_t size)
 
typedef int(* request_from_slave_blocked_t) (void *protocol_str, uint8_t address, uint8_t command, base_bus_transmit_settings_struct *tx_settings, uint8_t *tx_data_buf, uint16_t tx_size, uint32_t wait_rx_size, uint32_t wait_time_ms, ubi4_bus_package_info_struct *pack_info_out, uint8_t **buf_out, uint32_t *len)
 
typedef int(* request_handler_blocked_t) (void *protocol_str, uint8_t address, uint8_t command, base_bus_transmit_settings_struct *tx_settings, uint8_t *tx_data_buf, uint16_t tx_size, uint32_t wait_rx_size, uint32_t wait_time_ms)
 
typedef void(* transmit_bridge_to_slave_t) (void *protocol_str, uint8_t address, uint8_t command, bool last_package, void *source_protocol_str, void *source_pack_info, base_protocol_data_segment_struct *data_segment)
 
typedef void(* transmit_bridge_to_slave_queue_t) (void *protocol_str, uint8_t address, uint8_t command, bool last_package, void *source_protocol_str, void *source_pack_info, base_protocol_data_segment_struct *data_segment)
 
typedef void *(* get_specific_pack_info_t) (void *protocol_str, void *pack_info, pack_info_specificator_enum specificator, uint8_t *status)
 
typedef uint8_t(* get_specific_byte_pack_info_t) (void *protocol_str, void *pack_info, pack_info_specificator_enum specificator, uint8_t *status)
 
typedef void(* parce_preamble_t) (void *protocol_str, uint8_t *data, uint16_t size)
 
typedef void(* protocol_close_port_callback_t) (void *protocol_str)
 
typedef void(* receiver_typedef) (void *protocol_str, protocol_receive_struct receive_str)
 

Enumerations

enum  package_type_enum { PACKAGE_TYPE_FIX_LEN = 0 , PACKAGE_TYPE_VAR_LEN , PE_RES1 , PE_RES2 }
 
enum  simple_device_type_enum {
  SDT_DRIVER = 0x00 , SDT_SENSORE = 0x01 , SDT_HID = 0x02 , SDT_ALL_DEVICES = 0x03 ,
  SDT_NUM
}
 
enum  bus_protocol_package_type_enum { BPPT_FIX_LEN_PACKAGE = 0x00 , BPPT_FLOAT_LEN_PACKAGE = 0x01 , BPPT_RES1 = 0x02 , BPPT_RES2 = 0x03 }
 
enum  bus_protocol_request_type_enum { BPRT_COMMAND = 0x00 , BPRT_PARAMETERS = 0x01 }
 
enum  package_info_slot_status_enum { PSSE_FREE = 0x00 , PSSE_BUSY }
 
enum  protocol_data_segment_status_enum { PDSSE_FREE = 0x00 , PDSSE_BUSY }
 
enum  protocol_parce_status_enum { PPSE_PARCE_OK = 0x00 , PPSE_SHORT_PACKAGE , PPSE_CRC_FAIL }
 
enum  pack_info_specificator_enum {
  PISE_ID = 0x00 , PISE_BRIGE , PISE_WAIT_ANSWER , PISE_PACKAGE_CODE ,
  PISE_PACKAGE_ID , PISE_PACKAGE_SIZE , PISE_PACKAGE_CRC , PISE_ADDRESS ,
  PISE_REQUEST_TYPE
}
 
enum  queue_transmit_type_enum { QTTE_UNKNOW = 0x00 , QTTE_DIRECT , QTTE_BRIDGE }
 
enum  protocol_receive_mode_enum { PRME_RECEIVE_IRQ = 0x00 , PRME_RECEIVE_FULL_BUFFER }
 

Functions

void parce (uint8_t *Buf, uint16_t size, ports_enum port)
 
int ubi4_bus_receive_data_full_buffer (base_port_struct *port_str)
 
int ubi4_bus_receive_data_rx_irq_exec (ubi4_bus_protocol_obj_struct *protocol_str)
 
void protocol_tx_complete (ubi4_bus_protocol_obj_struct *protocol_str)
 
void ubi4_master_receiver_init (base_port_struct *port, ubi4_bus_protocol_obj_struct **protocol_obj_str)
 
void ubi4_remove_pack_info (ubi4_bus_protocol_obj_struct *protocol_str, ubi4_bus_package_info_struct *pack_info)
 
void ubi4_slave_receiver_reset (ubi4_bus_protocol_obj_struct *protocol_str)
 
void ubi4_slave_receiver_init (base_port_struct *port, ubi4_bus_protocol_init_struct init_struct, ubi4_bus_protocol_obj_struct **protocol_obj_str)
 
void ubi4_spi_slave_receiver_init (base_port_struct *port, ubi4_bus_protocol_init_struct init_struct, ubi4_bus_protocol_obj_struct **protocol_obj_str)
 
void ubi4_slave_receiver_start (ubi4_bus_protocol_obj_struct *protocol_obj_str)
 
void protocol_set_receiver (ubi4_bus_protocol_obj_struct *protocol_str, receiver_typedef receiver)
 
void protocol_set_bridge_callback (ubi4_bus_protocol_obj_struct *protocol_str, void(*receiver)(void *protocol_str, protocol_receive_struct receive_str))
 
bridge_protocol_info_struct Check_Device_Bridge_Info (void *port_device_manager, uint8_t Address)
 
uint8_t Get_Device_Address (uint8_t *status)
 
void protocol_delay (uint32_t time_ms)
 

Typedef Documentation

◆ device_main_receiver_t

typedef void(* device_main_receiver_t) (void *protocol_str, protocol_receive_struct receive_str)

◆ get_data_from_package_t

typedef protocol_parce_status_enum(* get_data_from_package_t) (void *protocol, uint8_t *buf, uint32_t size, ubi4_bus_package_info_struct *pack_info_out, uint8_t **buf_out, uint32_t *len)

◆ get_data_segment_func_t

typedef base_protocol_data_segment_struct *(* get_data_segment_func_t) (void *protocol_str, uint16_t size)

◆ get_specific_byte_pack_info_t

typedef uint8_t(* get_specific_byte_pack_info_t) (void *protocol_str, void *pack_info, pack_info_specificator_enum specificator, uint8_t *status)

◆ get_specific_pack_info_t

typedef void *(* get_specific_pack_info_t) (void *protocol_str, void *pack_info, pack_info_specificator_enum specificator, uint8_t *status)

◆ parce_preamble_t

typedef void(* parce_preamble_t) (void *protocol_str, uint8_t *data, uint16_t size)

◆ protocol_answer_func_t

typedef void(* protocol_answer_func_t) (void *protocol_str, void *pack_info, uint8_t *data_buf, uint16_t size)

◆ protocol_answer_obj_data_func_t

typedef void(* protocol_answer_obj_data_func_t) (void *protocol_str, void *pack_info, base_protocol_data_segment_struct *data_segment)

◆ protocol_bridge_receive_callback_t

typedef void(* protocol_bridge_receive_callback_t) (void *protocol_str, protocol_receive_struct receive_str)

◆ protocol_close_port_callback_t

typedef void(* protocol_close_port_callback_t) (void *protocol_str)

◆ receive_bridge_func_t

typedef void(* receive_bridge_func_t) (void *port_str, uint8_t *buf, uint32_t size)

◆ receive_data_func_t

typedef void(* receive_data_func_t) (void *protocol_str)

◆ receive_to_another_device_func_t

typedef void(* receive_to_another_device_func_t) (void *protocol_str, uint8_t *buf, uint32_t size)

◆ receive_to_current_device_func_t

typedef void(* receive_to_current_device_func_t) (void *protocol_str, uint8_t *buf, uint32_t size)

◆ receiver_typedef

typedef void(* receiver_typedef) (void *protocol_str, protocol_receive_struct receive_str)

◆ remove_pack_info_t

typedef void(* remove_pack_info_t) (void *protocol_str, void *pack_info)

◆ request_from_slave_blocked_t

typedef int(* request_from_slave_blocked_t) (void *protocol_str, uint8_t address, uint8_t command, base_bus_transmit_settings_struct *tx_settings, uint8_t *tx_data_buf, uint16_t tx_size, uint32_t wait_rx_size, uint32_t wait_time_ms, ubi4_bus_package_info_struct *pack_info_out, uint8_t **buf_out, uint32_t *len)

◆ request_handler_blocked_t

typedef int(* request_handler_blocked_t) (void *protocol_str, uint8_t address, uint8_t command, base_bus_transmit_settings_struct *tx_settings, uint8_t *tx_data_buf, uint16_t tx_size, uint32_t wait_rx_size, uint32_t wait_time_ms)

◆ slave_answer_func_t

typedef void(* slave_answer_func_t) (void *protocol_str, uint8_t *buf, uint32_t size)

◆ transmit_bridge_to_slave_queue_t

typedef void(* transmit_bridge_to_slave_queue_t) (void *protocol_str, uint8_t address, uint8_t command, bool last_package, void *source_protocol_str, void *source_pack_info, base_protocol_data_segment_struct *data_segment)

◆ transmit_bridge_to_slave_t

typedef void(* transmit_bridge_to_slave_t) (void *protocol_str, uint8_t address, uint8_t command, bool last_package, void *source_protocol_str, void *source_pack_info, base_protocol_data_segment_struct *data_segment)

◆ transmit_data_segment_to_master_t

typedef void(* transmit_data_segment_to_master_t) (void *protocol_str, uint8_t command, base_protocol_data_segment_struct *data_segment)

◆ transmit_to_slave_t

typedef void(* transmit_to_slave_t) (void *protocol_str, uint8_t address, uint8_t command, base_bus_transmit_settings_struct *tx_settings, uint8_t *data_buf, uint16_t size)

Enumeration Type Documentation

◆ bus_protocol_package_type_enum

Enumerator
BPPT_FIX_LEN_PACKAGE 
BPPT_FLOAT_LEN_PACKAGE 
BPPT_RES1 
BPPT_RES2 

◆ bus_protocol_request_type_enum

Enumerator
BPRT_COMMAND 
BPRT_PARAMETERS 

◆ pack_info_specificator_enum

Enumerator
PISE_ID 
PISE_BRIGE 
PISE_WAIT_ANSWER 
PISE_PACKAGE_CODE 
PISE_PACKAGE_ID 
PISE_PACKAGE_SIZE 
PISE_PACKAGE_CRC 
PISE_ADDRESS 
PISE_REQUEST_TYPE 

◆ package_info_slot_status_enum

Enumerator
PSSE_FREE 
PSSE_BUSY 

◆ package_type_enum

Enumerator
PACKAGE_TYPE_FIX_LEN 
PACKAGE_TYPE_VAR_LEN 
PE_RES1 
PE_RES2 

◆ protocol_data_segment_status_enum

Enumerator
PDSSE_FREE 
PDSSE_BUSY 

◆ protocol_parce_status_enum

Enumerator
PPSE_PARCE_OK 
PPSE_SHORT_PACKAGE 
PPSE_CRC_FAIL 

◆ protocol_receive_mode_enum

Enumerator
PRME_RECEIVE_IRQ 
PRME_RECEIVE_FULL_BUFFER 

◆ queue_transmit_type_enum

Enumerator
QTTE_UNKNOW 
QTTE_DIRECT 
QTTE_BRIDGE 

◆ simple_device_type_enum

Enumerator
SDT_DRIVER 
SDT_SENSORE 
SDT_HID 
SDT_ALL_DEVICES 
SDT_NUM 

Function Documentation

◆ Check_Device_Bridge_Info()

bridge_protocol_info_struct Check_Device_Bridge_Info ( void * port_device_manager,
uint8_t Address )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Get_Device_Address()

uint8_t Get_Device_Address ( uint8_t * status)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ parce()

void parce ( uint8_t * Buf,
uint16_t size,
ports_enum port )

◆ protocol_delay()

void protocol_delay ( uint32_t time_ms)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ protocol_set_bridge_callback()

void protocol_set_bridge_callback ( ubi4_bus_protocol_obj_struct * protocol_str,
void(* receiver )(void *protocol_str, protocol_receive_struct receive_str) )

◆ protocol_set_receiver()

void protocol_set_receiver ( ubi4_bus_protocol_obj_struct * protocol_str,
receiver_typedef receiver )

◆ protocol_tx_complete()

void protocol_tx_complete ( ubi4_bus_protocol_obj_struct * protocol_str)
Here is the call graph for this function:

◆ ubi4_bus_receive_data_full_buffer()

int ubi4_bus_receive_data_full_buffer ( base_port_struct * port_str)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ubi4_bus_receive_data_rx_irq_exec()

int ubi4_bus_receive_data_rx_irq_exec ( ubi4_bus_protocol_obj_struct * protocol_str)
Here is the call graph for this function:

◆ ubi4_master_receiver_init()

void ubi4_master_receiver_init ( base_port_struct * port,
ubi4_bus_protocol_obj_struct ** protocol_obj_str )
Here is the call graph for this function:

◆ ubi4_remove_pack_info()

void ubi4_remove_pack_info ( ubi4_bus_protocol_obj_struct * protocol_str,
ubi4_bus_package_info_struct * pack_info )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ubi4_slave_receiver_init()

void ubi4_slave_receiver_init ( base_port_struct * port,
ubi4_bus_protocol_init_struct init_struct,
ubi4_bus_protocol_obj_struct ** protocol_obj_str )
Here is the call graph for this function:

◆ ubi4_slave_receiver_reset()

void ubi4_slave_receiver_reset ( ubi4_bus_protocol_obj_struct * protocol_str)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ubi4_slave_receiver_start()

void ubi4_slave_receiver_start ( ubi4_bus_protocol_obj_struct * protocol_obj_str)
Here is the call graph for this function:

◆ ubi4_spi_slave_receiver_init()

void ubi4_spi_slave_receiver_init ( base_port_struct * port,
ubi4_bus_protocol_init_struct init_struct,
ubi4_bus_protocol_obj_struct ** protocol_obj_str )
Here is the call graph for this function: