UART0的HART可以数据收发
This commit is contained in:
parent
b626cbb446
commit
8a52221917
|
@ -5,6 +5,7 @@
|
||||||
"string.h": "c",
|
"string.h": "c",
|
||||||
"user_fmsc.h": "c",
|
"user_fmsc.h": "c",
|
||||||
"fsmc.h": "c",
|
"fsmc.h": "c",
|
||||||
"ch438q.h": "c"
|
"ch438q.h": "c",
|
||||||
|
"ht1200m.h": "c"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -176,10 +176,13 @@ void start_ch438_task(void const *argument)
|
||||||
{
|
{
|
||||||
/* USER CODE BEGIN start_ch438_task */
|
/* USER CODE BEGIN start_ch438_task */
|
||||||
/* Infinite loop */
|
/* Infinite loop */
|
||||||
|
ch438_init();
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
|
uint8_t data[5] = {0xFF, 0x34, 0x56, 0x78, 0x9a};
|
||||||
ch438_test();
|
ch438_test();
|
||||||
osDelay(1);
|
ch438_send_data(CH438_UART0, data, 5);
|
||||||
|
osDelay(1000);
|
||||||
}
|
}
|
||||||
/* USER CODE END start_ch438_task */
|
/* USER CODE END start_ch438_task */
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
/* Private includes ----------------------------------------------------------*/
|
/* Private includes ----------------------------------------------------------*/
|
||||||
/* USER CODE BEGIN Includes */
|
/* USER CODE BEGIN Includes */
|
||||||
|
#include "ht1200m.h"
|
||||||
/* USER CODE END Includes */
|
/* USER CODE END Includes */
|
||||||
|
|
||||||
/* Private typedef -----------------------------------------------------------*/
|
/* Private typedef -----------------------------------------------------------*/
|
||||||
|
@ -64,9 +64,9 @@ void MX_FREERTOS_Init(void);
|
||||||
/* USER CODE END 0 */
|
/* USER CODE END 0 */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The application entry point.
|
* @brief The application entry point.
|
||||||
* @retval int
|
* @retval int
|
||||||
*/
|
*/
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
/* USER CODE BEGIN 1 */
|
/* USER CODE BEGIN 1 */
|
||||||
|
@ -95,7 +95,8 @@ int main(void)
|
||||||
MX_SPI1_Init();
|
MX_SPI1_Init();
|
||||||
MX_FSMC_Init();
|
MX_FSMC_Init();
|
||||||
/* USER CODE BEGIN 2 */
|
/* USER CODE BEGIN 2 */
|
||||||
|
hart_ht1200m_reset(); // 初始化HT1200M模块
|
||||||
|
HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_4); // PWM输出,用于驱动HT1200M模块
|
||||||
/* USER CODE END 2 */
|
/* USER CODE END 2 */
|
||||||
|
|
||||||
/* Call init function for freertos objects (in freertos.c) */
|
/* Call init function for freertos objects (in freertos.c) */
|
||||||
|
@ -116,22 +117,22 @@ int main(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief System Clock Configuration
|
* @brief System Clock Configuration
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
void SystemClock_Config(void)
|
void SystemClock_Config(void)
|
||||||
{
|
{
|
||||||
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
|
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
|
||||||
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
|
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
|
||||||
|
|
||||||
/** Configure the main internal regulator output voltage
|
/** Configure the main internal regulator output voltage
|
||||||
*/
|
*/
|
||||||
__HAL_RCC_PWR_CLK_ENABLE();
|
__HAL_RCC_PWR_CLK_ENABLE();
|
||||||
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
|
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
|
||||||
|
|
||||||
/** Initializes the RCC Oscillators according to the specified parameters
|
/** Initializes the RCC Oscillators according to the specified parameters
|
||||||
* in the RCC_OscInitTypeDef structure.
|
* in the RCC_OscInitTypeDef structure.
|
||||||
*/
|
*/
|
||||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
|
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
|
||||||
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
|
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
|
||||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||||
|
@ -146,9 +147,8 @@ void SystemClock_Config(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Initializes the CPU, AHB and APB buses clocks
|
/** Initializes the CPU, AHB and APB buses clocks
|
||||||
*/
|
*/
|
||||||
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
|
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;
|
||||||
|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
|
|
||||||
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
|
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
|
||||||
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
|
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
|
||||||
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4;
|
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4;
|
||||||
|
@ -165,19 +165,20 @@ void SystemClock_Config(void)
|
||||||
/* USER CODE END 4 */
|
/* USER CODE END 4 */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Period elapsed callback in non blocking mode
|
* @brief Period elapsed callback in non blocking mode
|
||||||
* @note This function is called when TIM4 interrupt took place, inside
|
* @note This function is called when TIM4 interrupt took place, inside
|
||||||
* HAL_TIM_IRQHandler(). It makes a direct call to HAL_IncTick() to increment
|
* HAL_TIM_IRQHandler(). It makes a direct call to HAL_IncTick() to increment
|
||||||
* a global variable "uwTick" used as application time base.
|
* a global variable "uwTick" used as application time base.
|
||||||
* @param htim : TIM handle
|
* @param htim : TIM handle
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
|
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
|
||||||
{
|
{
|
||||||
/* USER CODE BEGIN Callback 0 */
|
/* USER CODE BEGIN Callback 0 */
|
||||||
|
|
||||||
/* USER CODE END Callback 0 */
|
/* USER CODE END Callback 0 */
|
||||||
if (htim->Instance == TIM4) {
|
if (htim->Instance == TIM4)
|
||||||
|
{
|
||||||
HAL_IncTick();
|
HAL_IncTick();
|
||||||
}
|
}
|
||||||
/* USER CODE BEGIN Callback 1 */
|
/* USER CODE BEGIN Callback 1 */
|
||||||
|
@ -186,9 +187,9 @@ void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This function is executed in case of error occurrence.
|
* @brief This function is executed in case of error occurrence.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
void Error_Handler(void)
|
void Error_Handler(void)
|
||||||
{
|
{
|
||||||
/* USER CODE BEGIN Error_Handler_Debug */
|
/* USER CODE BEGIN Error_Handler_Debug */
|
||||||
|
@ -200,14 +201,14 @@ void Error_Handler(void)
|
||||||
/* USER CODE END Error_Handler_Debug */
|
/* USER CODE END Error_Handler_Debug */
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_FULL_ASSERT
|
#ifdef USE_FULL_ASSERT
|
||||||
/**
|
/**
|
||||||
* @brief Reports the name of the source file and the source line number
|
* @brief Reports the name of the source file and the source line number
|
||||||
* where the assert_param error has occurred.
|
* where the assert_param error has occurred.
|
||||||
* @param file: pointer to the source file name
|
* @param file: pointer to the source file name
|
||||||
* @param line: assert_param error line source number
|
* @param line: assert_param error line source number
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
void assert_failed(uint8_t *file, uint32_t line)
|
void assert_failed(uint8_t *file, uint32_t line)
|
||||||
{
|
{
|
||||||
/* USER CODE BEGIN 6 */
|
/* USER CODE BEGIN 6 */
|
||||||
|
|
|
@ -148,19 +148,41 @@
|
||||||
<Name>-U090F00028316303030303032 -O2254 -SF10000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP (ARM Core") -D00(2BA01477) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC800 -FN1 -FF0STM32F4xx_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F407ZGTx$CMSIS\Flash\STM32F4xx_1024.FLM)</Name>
|
<Name>-U090F00028316303030303032 -O2254 -SF10000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP (ARM Core") -D00(2BA01477) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC800 -FN1 -FF0STM32F4xx_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F407ZGTx$CMSIS\Flash\STM32F4xx_1024.FLM)</Name>
|
||||||
</SetRegEntry>
|
</SetRegEntry>
|
||||||
</TargetDriverDllRegistry>
|
</TargetDriverDllRegistry>
|
||||||
<Breakpoint/>
|
<Breakpoint>
|
||||||
|
<Bp>
|
||||||
|
<Number>0</Number>
|
||||||
|
<Type>0</Type>
|
||||||
|
<LineNumber>184</LineNumber>
|
||||||
|
<EnabledFlag>1</EnabledFlag>
|
||||||
|
<Address>134258924</Address>
|
||||||
|
<ByteObject>0</ByteObject>
|
||||||
|
<HtxType>0</HtxType>
|
||||||
|
<ManyObjects>0</ManyObjects>
|
||||||
|
<SizeOfObject>0</SizeOfObject>
|
||||||
|
<BreakByAccess>0</BreakByAccess>
|
||||||
|
<BreakIfRCount>1</BreakIfRCount>
|
||||||
|
<Filename>../Core/Src/freertos.c</Filename>
|
||||||
|
<ExecCommand></ExecCommand>
|
||||||
|
<Expression>\\valve_debugging\../Core/Src/freertos.c\184</Expression>
|
||||||
|
</Bp>
|
||||||
|
</Breakpoint>
|
||||||
<WatchWindow1>
|
<WatchWindow1>
|
||||||
<Ww>
|
<Ww>
|
||||||
<count>0</count>
|
<count>0</count>
|
||||||
<WinNumber>1</WinNumber>
|
<WinNumber>1</WinNumber>
|
||||||
<ItemText>reg_data</ItemText>
|
<ItemText>reg_data</ItemText>
|
||||||
</Ww>
|
</Ww>
|
||||||
|
<Ww>
|
||||||
|
<count>1</count>
|
||||||
|
<WinNumber>1</WinNumber>
|
||||||
|
<ItemText>pSrcBuffer</ItemText>
|
||||||
|
</Ww>
|
||||||
</WatchWindow1>
|
</WatchWindow1>
|
||||||
<MemoryWindow1>
|
<MemoryWindow1>
|
||||||
<Mm>
|
<Mm>
|
||||||
<WinNumber>1</WinNumber>
|
<WinNumber>1</WinNumber>
|
||||||
<SubType>0</SubType>
|
<SubType>0</SubType>
|
||||||
<ItemText>0x60000000</ItemText>
|
<ItemText>pSrcBuffer</ItemText>
|
||||||
<AccSizeX>0</AccSizeX>
|
<AccSizeX>0</AccSizeX>
|
||||||
</Mm>
|
</Mm>
|
||||||
</MemoryWindow1>
|
</MemoryWindow1>
|
||||||
|
@ -180,7 +202,7 @@
|
||||||
<periodic>1</periodic>
|
<periodic>1</periodic>
|
||||||
<aLwin>1</aLwin>
|
<aLwin>1</aLwin>
|
||||||
<aCover>0</aCover>
|
<aCover>0</aCover>
|
||||||
<aSer1>1</aSer1>
|
<aSer1>0</aSer1>
|
||||||
<aSer2>0</aSer2>
|
<aSer2>0</aSer2>
|
||||||
<aPa>0</aPa>
|
<aPa>0</aPa>
|
||||||
<viewmode>1</viewmode>
|
<viewmode>1</viewmode>
|
||||||
|
@ -1806,7 +1828,7 @@
|
||||||
<GroupNumber>10</GroupNumber>
|
<GroupNumber>10</GroupNumber>
|
||||||
<FileNumber>126</FileNumber>
|
<FileNumber>126</FileNumber>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<tvExp>1</tvExp>
|
<tvExp>0</tvExp>
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
<bDave2>0</bDave2>
|
<bDave2>0</bDave2>
|
||||||
<PathWithFileName>..\User\driver\ch438q.c</PathWithFileName>
|
<PathWithFileName>..\User\driver\ch438q.c</PathWithFileName>
|
||||||
|
@ -1814,6 +1836,18 @@
|
||||||
<RteFlg>0</RteFlg>
|
<RteFlg>0</RteFlg>
|
||||||
<bShared>0</bShared>
|
<bShared>0</bShared>
|
||||||
</File>
|
</File>
|
||||||
|
<File>
|
||||||
|
<GroupNumber>10</GroupNumber>
|
||||||
|
<FileNumber>127</FileNumber>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<tvExp>0</tvExp>
|
||||||
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
|
<bDave2>0</bDave2>
|
||||||
|
<PathWithFileName>..\User\driver\ht1200m.c</PathWithFileName>
|
||||||
|
<FilenameWithoutPath>ht1200m.c</FilenameWithoutPath>
|
||||||
|
<RteFlg>0</RteFlg>
|
||||||
|
<bShared>0</bShared>
|
||||||
|
</File>
|
||||||
</Group>
|
</Group>
|
||||||
|
|
||||||
<Group>
|
<Group>
|
||||||
|
@ -1824,7 +1858,7 @@
|
||||||
<RteFlg>0</RteFlg>
|
<RteFlg>0</RteFlg>
|
||||||
<File>
|
<File>
|
||||||
<GroupNumber>11</GroupNumber>
|
<GroupNumber>11</GroupNumber>
|
||||||
<FileNumber>127</FileNumber>
|
<FileNumber>128</FileNumber>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<tvExp>0</tvExp>
|
<tvExp>0</tvExp>
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
|
|
|
@ -6605,6 +6605,11 @@
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<FilePath>..\User\driver\ch438q.c</FilePath>
|
<FilePath>..\User\driver\ch438q.c</FilePath>
|
||||||
</File>
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>ht1200m.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\User\driver\ht1200m.c</FilePath>
|
||||||
|
</File>
|
||||||
</Files>
|
</Files>
|
||||||
</Group>
|
</Group>
|
||||||
<Group>
|
<Group>
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +1,6 @@
|
||||||
#include "ch438q.h"
|
#include "ch438q.h"
|
||||||
#include "fsmc.h"
|
#include "fsmc.h"
|
||||||
|
#include "ht1200m.h"
|
||||||
#define CH438_CLK 1843200 /* CH438的内部时钟频率,默认外部晶振的12分频 */
|
#define CH438_CLK 1843200 /* CH438的内部时钟频率,默认外部晶振的12分频 */
|
||||||
|
|
||||||
const uint8_t offsetadd[] = {
|
const uint8_t offsetadd[] = {
|
||||||
|
@ -113,7 +113,7 @@ void ch438_test(void)
|
||||||
|
|
||||||
reg_data[2] = ch438_read_reg(offsetadd[0] | REG_IER_ADDR, 1);
|
reg_data[2] = ch438_read_reg(offsetadd[0] | REG_IER_ADDR, 1);
|
||||||
reg_data[3] = ch438_read_reg(offsetadd[0] | REG_IIR_ADDR, 1);
|
reg_data[3] = ch438_read_reg(offsetadd[0] | REG_IIR_ADDR, 1);
|
||||||
reg_data[4] = ch438_read_reg(offsetadd[0] | REG_LSR_ADDR, 1);
|
reg_data[4] = ch438_read_reg(offsetadd[0] | REG_LCR_ADDR, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -203,7 +203,11 @@ void ch438_init_config(uint8_t uart_num)
|
||||||
|
|
||||||
void ch438_send_data(uint8_t uart_num, uint8_t *data, uint16_t len)
|
void ch438_send_data(uint8_t uart_num, uint8_t *data, uint16_t len)
|
||||||
{
|
{
|
||||||
ch438_write_reg(offsetadd[uart_num] | REG_THR_ADDR, data[0], len);
|
HART1_RTS_SEND;
|
||||||
|
for (uint8_t i = 0; i < len; i++)
|
||||||
|
{
|
||||||
|
ch438_write_reg(offsetadd[uart_num] | REG_THR_ADDR, data[i], 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t ch438_recv_data(uint8_t uart_num, uint8_t *data)
|
uint8_t ch438_recv_data(uint8_t uart_num, uint8_t *data)
|
||||||
|
@ -258,6 +262,7 @@ void ch438_interrupt_handler(void)
|
||||||
case INT_NOINT: /* 没有中断 */
|
case INT_NOINT: /* 没有中断 */
|
||||||
break;
|
break;
|
||||||
case INT_THR_EMPTY: /* THR空中断 */
|
case INT_THR_EMPTY: /* THR空中断 */
|
||||||
|
HART1_RTS_RECEIVE;
|
||||||
break;
|
break;
|
||||||
case INT_RCV_OVERTIME: /* 接收超时中断 */
|
case INT_RCV_OVERTIME: /* 接收超时中断 */
|
||||||
receive_data_len = ch438_recv_data(i, receive_data_buff);
|
receive_data_len = ch438_recv_data(i, receive_data_buff);
|
||||||
|
@ -279,3 +284,11 @@ void ch438_interrupt_handler(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ch438_init(void)
|
||||||
|
{
|
||||||
|
ch438_reset_all_uart();
|
||||||
|
HAL_Delay(250);
|
||||||
|
ch438_init_uart(CH438_UART0, 1200);
|
||||||
|
ch438_init_config(CH438_UART0);
|
||||||
|
}
|
||||||
|
|
|
@ -133,4 +133,5 @@ void ch438_init_config(uint8_t uart_num);
|
||||||
void ch438_send_data(uint8_t uart_num, uint8_t *data, uint16_t len);
|
void ch438_send_data(uint8_t uart_num, uint8_t *data, uint16_t len);
|
||||||
uint8_t ch438_recv_data(uint8_t uart_num, uint8_t *data);
|
uint8_t ch438_recv_data(uint8_t uart_num, uint8_t *data);
|
||||||
void ch438_interrupt_handler(void);
|
void ch438_interrupt_handler(void);
|
||||||
|
void ch438_init(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -13,11 +13,8 @@
|
||||||
*/
|
*/
|
||||||
extern void hart_ht1200m_reset(void)
|
extern void hart_ht1200m_reset(void)
|
||||||
{
|
{
|
||||||
HART1_RESET_ON;
|
HART_RESET_ON;
|
||||||
HART2_RESET_ON;
|
|
||||||
HAL_Delay(10);
|
HAL_Delay(10);
|
||||||
HART1_RESET_OFF;
|
HART_RESET_OFF;
|
||||||
HART2_RESET_OFF;
|
|
||||||
HART1_RTS_RECEIVE;
|
HART1_RTS_RECEIVE;
|
||||||
HART2_RTS_RECEIVE;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,17 +3,14 @@
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
||||||
#define HART1_RESET_ON HAL_GPIO_WritePin(HART1_RST_GPIO_Port, HART1_RST_Pin, GPIO_PIN_RESET) // 拉低引脚复位模块
|
#define HART_RESET_ON HAL_GPIO_WritePin(HART_ALL_RST_GPIO_Port, HART_ALL_RST_Pin, GPIO_PIN_RESET) // 拉低引脚复位模块
|
||||||
#define HART1_RESET_OFF HAL_GPIO_WritePin(HART1_RST_GPIO_Port, HART1_RST_Pin, GPIO_PIN_SET)
|
#define HART_RESET_OFF HAL_GPIO_WritePin(HART_ALL_RST_GPIO_Port, HART_ALL_RST_Pin, GPIO_PIN_SET)
|
||||||
|
|
||||||
#define HART2_RESET_ON HAL_GPIO_WritePin(HART2_RST_GPIO_Port, HART2_RST_Pin, GPIO_PIN_RESET) // 拉低引脚复位模块
|
|
||||||
#define HART2_RESET_OFF HAL_GPIO_WritePin(HART2_RST_GPIO_Port, HART2_RST_Pin, GPIO_PIN_SET)
|
|
||||||
|
|
||||||
#define HART1_RTS_RECEIVE HAL_GPIO_WritePin(HART1_RTS_GPIO_Port, HART1_RTS_Pin, GPIO_PIN_SET)
|
#define HART1_RTS_RECEIVE HAL_GPIO_WritePin(HART1_RTS_GPIO_Port, HART1_RTS_Pin, GPIO_PIN_SET)
|
||||||
#define HART1_RTS_SEND HAL_GPIO_WritePin(HART1_RTS_GPIO_Port, HART1_RTS_Pin, GPIO_PIN_RESET) // 拉低引脚发送
|
#define HART1_RTS_SEND HAL_GPIO_WritePin(HART1_RTS_GPIO_Port, HART1_RTS_Pin, GPIO_PIN_RESET) // 拉低引脚发送
|
||||||
|
|
||||||
#define HART2_RTS_RECEIVE HAL_GPIO_WritePin(HART2_RTS_GPIO_Port, HART2_RTS_Pin, GPIO_PIN_SET)
|
// #define HART2_RTS_RECEIVE HAL_GPIO_WritePin(HART2_RTS_GPIO_Port, HART2_RTS_Pin, GPIO_PIN_SET)
|
||||||
#define HART2_RTS_SEND HAL_GPIO_WritePin(HART2_RTS_GPIO_Port, HART2_RTS_Pin, GPIO_PIN_RESET) // 拉低引脚发送
|
// #define HART2_RTS_SEND HAL_GPIO_WritePin(HART2_RTS_GPIO_Port, HART2_RTS_Pin, GPIO_PIN_RESET) // 拉低引脚发送
|
||||||
|
|
||||||
extern void hart_ht1200m_reset(void);
|
extern void hart_ht1200m_reset(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue