![]() |
miniFOC 1.0.3
This open-source project aims to accomplish a FOC(Field Oriented Control) scheme that is operatable with minimum costs in China.
|
this file contains the code implementation of UART interface initialization function and medium capacity transmission protocol transceiver function. More...
Go to the source code of this file.
Functions | |
void | mdtp_receive_handler (unsigned char data) |
medium capacity data transmission protocol unpacking handler More... | |
void | mdtp_data_transmit (unsigned char pid, const unsigned char *buffer) |
medium capacity data transmission protocol packing function More... | |
void | uart_config (void) |
configure uart0 periph and its gpios More... | |
Variables | |
static volatile unsigned char | mdtp_receive_status = 0 |
medium capacity transport protocol receive state variable 0 idle state and waiting for start of package 1 receive status trying to receive a complete packet. 2 end status processing the received data More... | |
static volatile unsigned char | mdtp_receive_number_counter = 0 |
medium capacity transport protocol receive character counter More... | |
static unsigned char | mdtp_receive_data_buffer [10] = {0} |
medium capacity transport protocol receive buffer array More... | |
this file contains the code implementation of UART interface initialization function and medium capacity transmission protocol transceiver function.
Definition in file uart.c.
void mdtp_data_transmit | ( | unsigned char | pid, |
const unsigned char * | buffer | ||
) |
medium capacity data transmission protocol packing function
[in] | pid | medium capacity transport protocol package id |
[in] | buffer | transmit data array of size 8 bytes |
Definition at line 113 of file uart.c.
References uart_sendbyte.
Referenced by report_angle_speed(), and report_local_variable().
void mdtp_receive_handler | ( | unsigned char | data | ) |
medium capacity data transmission protocol unpacking handler
[in] | data | data received from UART peripheral |
Definition at line 36 of file uart.c.
References mdtp_callback_handler(), mdtp_receive_data_buffer, mdtp_receive_number_counter, mdtp_receive_status, and user_memset().
Referenced by USART0_IRQHandler().
void uart_config | ( | void | ) |
configure uart0 periph and its gpios
Definition at line 143 of file uart.c.
References UART_BAUDRATE, and UART_PRIORITY.
Referenced by main().
|
static |
medium capacity transport protocol receive buffer array
Definition at line 30 of file uart.c.
Referenced by mdtp_receive_handler().
|
static |
medium capacity transport protocol receive character counter
Definition at line 26 of file uart.c.
Referenced by mdtp_receive_handler().
|
static |
medium capacity transport protocol receive state variable 0 idle state and waiting for start of package
1 receive status trying to receive a complete packet.
2 end status processing the received data
Definition at line 22 of file uart.c.
Referenced by mdtp_receive_handler().