typedef struct { uint8_t cmd_sum; //命令总数 uint8_t cmd_index; //当前命令号 uint8_t resend_sum; //重发次数 uint8_t resend_index; //当前重发次数 } SLAVE_STRUCT_TYPEDEF;
typedef struct { uint32_t uart_base; uint32_t uart_irq_ic_id; uint8_t uart_irq; uint16_t irq_mask; void *uart_irq_isr; uint32_t bps; //波特率 uint32_t timeout_period ; //接收超时时间 uint16_t MDP_period_cnt; uint8_t MDP_period_cnt_en; uint8_t slave_index; //串口当前操作的设备编号 uint8_t slave_sum; //串口所挂的设备总数 uint8_t uart_rx_status; //串口收状态 uint8_t uart_tx_status; //串口发状态 uint8_t uart_tx_fifo_len; //串口发送fifo指针长度 uint8_t uart_rx_fifo_len; //串口接收fifo指针长度 uint8_t uart_rx_fifo_len_temp; //串口接收fifo指针长度缓存 uint8_t uart_rx_fifo[256]; //接收fifo uint8_t uart_tx_fifo[256]; //发送fifo SLAVE_STRUCT_TYPEDEF slave[16]; } MDPORT_STRUCT_TYPEDEF; |