40 lines
958 B
C
40 lines
958 B
C
#include "serial_port.h"
|
|
#include "main.h"
|
|
#include "usart.h"
|
|
#include "string.h"
|
|
#include "app.h"
|
|
|
|
// HAL_UART_Transmit( &huartx, &data, timeout )//不带中断,不连续传输
|
|
// HAL_UART_Receive( &huartx, &data, timeout )
|
|
// HAL_UART_Transmit_IT( &huartx, &data, data_size )//带中断,连续传输
|
|
// HAL_UART_Receive_IT( &huartx, &data, data_size )
|
|
|
|
// HAL_SPI_Transmit( &hspix, &data, data_size,timeout )//不带中断,不连续传输
|
|
// HAL_SPI_Receive( &hspix, &data, data_size,timeout )
|
|
// HAL_SPI_Transmit_IT( &hspix, &data, data_size )//带中断,连续传输
|
|
// HAL_SPI_Receive_IT( &hspix, &data, data_size )
|
|
|
|
|
|
|
|
// 使用LP-300-SP的Type-A接口与计算机进行通信
|
|
|
|
//char text_r[20] = {0};
|
|
//char text_t[20] = {0};
|
|
|
|
|
|
//void uart_test(void)
|
|
//{
|
|
|
|
// if( it_1000ms_flag == 1)
|
|
// {
|
|
// it_1000ms_flag = 0;
|
|
//
|
|
// strcpy(text_t," Hello World! ");
|
|
// //HAL_UART_Receive_IT( &huart1, (uint8_t*)text_r, 20);
|
|
|
|
// HAL_UART_Transmit_IT( &huart1, (uint8_t *)text_t, 20);
|
|
// }
|
|
//
|
|
//}
|
|
|