This commit is contained in:
parent
f2a2e82330
commit
2e23a89034
|
@ -66,6 +66,12 @@ extern uint8_t setting_window_num[5];
|
|||
#define TEXT_MODBUS 2
|
||||
#define TEXT_MODBUS_CONFIG 3
|
||||
|
||||
//HART连接模式
|
||||
#define HART_DISABLE 0
|
||||
#define HART_LISTEN 1
|
||||
#define HART_INTERNAL_24V 2
|
||||
#define HART_INTERNAL_250OHM 3
|
||||
|
||||
//设置菜单数据初始化
|
||||
void tab_data_init(void);
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#define ITEM1_CONTENT_MAX 4
|
||||
#define ITEM2_CONTENT_MAX 4
|
||||
#define ITEM2_COMMUNICATION_MAX 4
|
||||
#define ITEM2_COMMUNICATION_VALUE_MAX 4
|
||||
#define ITEM2_COMMUNICATION_VALUE_MAX 7
|
||||
#define ITEM2_PROGRAM_OUT_CONFIG1_MAX 4
|
||||
#define ITEM2_PROGRAM_OUT_CONFIG1_VALUE_MAX 2
|
||||
#define ITEM2_PROGRAM_OUT_CONFIG2_MAX 8
|
||||
|
|
|
@ -824,24 +824,66 @@ void set_communication_text(uint8_t con)
|
|||
{
|
||||
if(tabdata.content_focus == 0)
|
||||
{
|
||||
if(tabdata.hart_enable)
|
||||
switch (tabdata.hart_enable)
|
||||
{
|
||||
lv_label_set_text(guider_ui.screen_setting_label_01, text_pack.item_2_com_val[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
lv_label_set_text(guider_ui.screen_setting_label_01, text_pack.item_2_com_val[1]);
|
||||
case HART_DISABLE:
|
||||
{
|
||||
lv_label_set_text(guider_ui.screen_setting_label_01, text_pack.item_2_com_val[1]);
|
||||
}
|
||||
break;
|
||||
|
||||
case HART_LISTEN:
|
||||
{
|
||||
lv_label_set_text(guider_ui.screen_setting_label_01, text_pack.item_2_com_val[4]);
|
||||
}
|
||||
break;
|
||||
|
||||
case HART_INTERNAL_24V:
|
||||
{
|
||||
lv_label_set_text(guider_ui.screen_setting_label_01, text_pack.item_2_com_val[5]);
|
||||
}
|
||||
break;
|
||||
|
||||
case HART_INTERNAL_250OHM:
|
||||
{
|
||||
lv_label_set_text(guider_ui.screen_setting_label_01, text_pack.item_2_com_val[6]);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(tabdata.hart_enable)
|
||||
switch (tabdata.hart_enable)
|
||||
{
|
||||
sprintf(str_temp,"< %s >",text_pack.item_2_com_val[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(str_temp,"< %s >",text_pack.item_2_com_val[1]);
|
||||
case HART_DISABLE:
|
||||
{
|
||||
sprintf(str_temp,"< %s >",text_pack.item_2_com_val[1]);
|
||||
}
|
||||
break;
|
||||
|
||||
case HART_LISTEN:
|
||||
{
|
||||
sprintf(str_temp,"< %s >",text_pack.item_2_com_val[4]);
|
||||
}
|
||||
break;
|
||||
|
||||
case HART_INTERNAL_24V:
|
||||
{
|
||||
sprintf(str_temp,"< %s >",text_pack.item_2_com_val[5]);
|
||||
}
|
||||
break;
|
||||
|
||||
case HART_INTERNAL_250OHM:
|
||||
{
|
||||
sprintf(str_temp,"< %s >",text_pack.item_2_com_val[6]);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
lv_label_set_text(guider_ui.screen_setting_label_01, str_temp);
|
||||
|
@ -974,7 +1016,8 @@ void set_communication_modify(uint8_t con, int8_t step)
|
|||
{
|
||||
case TEXT_HART:
|
||||
{
|
||||
tabdata.hart_enable = !tabdata.hart_enable;
|
||||
tabdata.hart_enable += step;
|
||||
if(tabdata.hart_enable > 3) tabdata.hart_enable = 0;
|
||||
|
||||
//通讯方式互斥
|
||||
if(tabdata.hart_enable)
|
||||
|
|
|
@ -125,14 +125,20 @@ static char item2_communication_switch_value_chinese[ITEM2_COMMUNICATION_VALUE_M
|
|||
"开",
|
||||
"关",
|
||||
"主",
|
||||
"从"
|
||||
"从",
|
||||
"监听",
|
||||
"24V",
|
||||
"250Ω"
|
||||
};
|
||||
static char item2_communication_switch_value_english[ITEM2_COMMUNICATION_VALUE_MAX][TEXT_LENGTH_MAX] =
|
||||
{
|
||||
"ON",
|
||||
"OFF",
|
||||
"Master",
|
||||
"Slave"
|
||||
"Slave",
|
||||
"Listen",
|
||||
"24V",
|
||||
"250Ω"
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -71,9 +71,11 @@ void fun_dac7811_operate(float32 *data_sv)
|
|||
}
|
||||
else
|
||||
{
|
||||
DAC7811_CS(GPIO_PIN_RESET);
|
||||
HAL_SPI_Transmit(&hspi1, (uint8_t *)(®_data), 1, 1000);
|
||||
DAC7811_CS(GPIO_PIN_SET);
|
||||
DAC7811_CS(GPIO_PIN_RESET);
|
||||
vTaskDelay(100);
|
||||
HAL_SPI_Transmit(&hspi1, (uint8_t *)(®_data), 1, 1000);
|
||||
vTaskDelay(100);
|
||||
DAC7811_CS(GPIO_PIN_SET);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -62,8 +62,14 @@ void Error_Handler(void);
|
|||
#define PWR_EN_GPIO_Port GPIOE
|
||||
#define PWR_IN_Pin GPIO_PIN_3
|
||||
#define PWR_IN_GPIO_Port GPIOE
|
||||
#define RS_EN_Pin GPIO_PIN_4
|
||||
#define RS_EN_GPIO_Port GPIOE
|
||||
#define Vout_EN_Pin GPIO_PIN_5
|
||||
#define Vout_EN_GPIO_Port GPIOE
|
||||
#define light_Pin GPIO_PIN_14
|
||||
#define light_GPIO_Port GPIOC
|
||||
#define RP_EN_Pin GPIO_PIN_15
|
||||
#define RP_EN_GPIO_Port GPIOC
|
||||
#define BUZZER_Pin GPIO_PIN_0
|
||||
#define BUZZER_GPIO_Port GPIOC
|
||||
#define KEY_KP_Pin GPIO_PIN_1
|
||||
|
|
|
@ -53,12 +53,12 @@ void MX_GPIO_Init(void)
|
|||
__HAL_RCC_GPIOD_CLK_ENABLE();
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOE, PWR_EN_Pin|PWR_IN_Pin|LCD_DB4_Pin|LCD_DB5_Pin
|
||||
|LCD_DB6_Pin|LCD_DB7_Pin|RELAY_IN1_Pin|INPUT_A2_Pin
|
||||
|INPUT_A0_Pin, GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(GPIOE, PWR_EN_Pin|PWR_IN_Pin|RS_EN_Pin|Vout_EN_Pin
|
||||
|LCD_DB4_Pin|LCD_DB5_Pin|LCD_DB6_Pin|LCD_DB7_Pin
|
||||
|RELAY_IN1_Pin|INPUT_A2_Pin|INPUT_A0_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOC, light_Pin|BUZZER_Pin|RELAY_IN3_Pin, GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(GPIOC, light_Pin|RP_EN_Pin|BUZZER_Pin|RELAY_IN3_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOC, ADS1220_CS_Pin|BLE_RSTN_Pin, GPIO_PIN_SET);
|
||||
|
@ -81,8 +81,8 @@ void MX_GPIO_Init(void)
|
|||
/*Configure GPIO pin Output Level */
|
||||
HAL_GPIO_WritePin(GPIOA, TEMP_Pin|HART_RTS_Pin|DAC_CS_Pin, GPIO_PIN_RESET);
|
||||
|
||||
/*Configure GPIO pins : PEPin PEPin */
|
||||
GPIO_InitStruct.Pin = PWR_EN_Pin|PWR_IN_Pin;
|
||||
/*Configure GPIO pins : PEPin PEPin PEPin PEPin */
|
||||
GPIO_InitStruct.Pin = PWR_EN_Pin|PWR_IN_Pin|RS_EN_Pin|Vout_EN_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
|
@ -95,8 +95,8 @@ void MX_GPIO_Init(void)
|
|||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(light_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
/*Configure GPIO pins : PCPin PCPin PCPin */
|
||||
GPIO_InitStruct.Pin = BUZZER_Pin|ADS1220_CS_Pin|BLE_RSTN_Pin;
|
||||
/*Configure GPIO pins : PCPin PCPin PCPin PCPin */
|
||||
GPIO_InitStruct.Pin = RP_EN_Pin|BUZZER_Pin|ADS1220_CS_Pin|BLE_RSTN_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
|
@ -131,83 +131,86 @@ Mcu.Name=STM32F407V(E-G)Tx
|
|||
Mcu.Package=LQFP100
|
||||
Mcu.Pin0=PE2
|
||||
Mcu.Pin1=PE3
|
||||
Mcu.Pin10=PA1
|
||||
Mcu.Pin11=PA2
|
||||
Mcu.Pin12=PA3
|
||||
Mcu.Pin13=PA4
|
||||
Mcu.Pin14=PA5
|
||||
Mcu.Pin15=PA6
|
||||
Mcu.Pin16=PA7
|
||||
Mcu.Pin17=PC4
|
||||
Mcu.Pin18=PC5
|
||||
Mcu.Pin19=PB0
|
||||
Mcu.Pin2=PC14-OSC32_IN
|
||||
Mcu.Pin20=PB1
|
||||
Mcu.Pin21=PB2
|
||||
Mcu.Pin22=PE7
|
||||
Mcu.Pin23=PE8
|
||||
Mcu.Pin24=PE9
|
||||
Mcu.Pin25=PE10
|
||||
Mcu.Pin26=PE11
|
||||
Mcu.Pin27=PE12
|
||||
Mcu.Pin28=PE13
|
||||
Mcu.Pin29=PE14
|
||||
Mcu.Pin3=PH0-OSC_IN
|
||||
Mcu.Pin30=PE15
|
||||
Mcu.Pin31=PB10
|
||||
Mcu.Pin32=PB11
|
||||
Mcu.Pin33=PB12
|
||||
Mcu.Pin34=PB13
|
||||
Mcu.Pin35=PB14
|
||||
Mcu.Pin36=PB15
|
||||
Mcu.Pin37=PD8
|
||||
Mcu.Pin38=PD10
|
||||
Mcu.Pin39=PD11
|
||||
Mcu.Pin4=PH1-OSC_OUT
|
||||
Mcu.Pin40=PD12
|
||||
Mcu.Pin41=PD13
|
||||
Mcu.Pin42=PD14
|
||||
Mcu.Pin43=PD15
|
||||
Mcu.Pin44=PC6
|
||||
Mcu.Pin45=PC7
|
||||
Mcu.Pin46=PC8
|
||||
Mcu.Pin47=PC9
|
||||
Mcu.Pin48=PA8
|
||||
Mcu.Pin49=PA9
|
||||
Mcu.Pin5=PC0
|
||||
Mcu.Pin50=PA10
|
||||
Mcu.Pin51=PA11
|
||||
Mcu.Pin52=PA12
|
||||
Mcu.Pin53=PA13
|
||||
Mcu.Pin54=PA14
|
||||
Mcu.Pin55=PA15
|
||||
Mcu.Pin56=PC10
|
||||
Mcu.Pin57=PC11
|
||||
Mcu.Pin58=PC12
|
||||
Mcu.Pin59=PD0
|
||||
Mcu.Pin6=PC1
|
||||
Mcu.Pin60=PD1
|
||||
Mcu.Pin61=PD4
|
||||
Mcu.Pin62=PD5
|
||||
Mcu.Pin63=PD6
|
||||
Mcu.Pin64=PD7
|
||||
Mcu.Pin65=PB3
|
||||
Mcu.Pin66=PB4
|
||||
Mcu.Pin67=PB5
|
||||
Mcu.Pin68=PB6
|
||||
Mcu.Pin69=PB7
|
||||
Mcu.Pin7=PC2
|
||||
Mcu.Pin70=PB9
|
||||
Mcu.Pin71=VP_FREERTOS_VS_CMSIS_V1
|
||||
Mcu.Pin72=VP_SYS_VS_tim7
|
||||
Mcu.Pin73=VP_TIM1_VS_ClockSourceINT
|
||||
Mcu.Pin74=VP_TIM2_VS_ClockSourceINT
|
||||
Mcu.Pin75=VP_TIM3_VS_ClockSourceINT
|
||||
Mcu.Pin76=VP_TIM6_VS_ClockSourceINT
|
||||
Mcu.Pin77=VP_TIM8_VS_ClockSourceINT
|
||||
Mcu.Pin8=PC3
|
||||
Mcu.Pin9=PA0-WKUP
|
||||
Mcu.PinsNb=78
|
||||
Mcu.Pin10=PC2
|
||||
Mcu.Pin11=PC3
|
||||
Mcu.Pin12=PA0-WKUP
|
||||
Mcu.Pin13=PA1
|
||||
Mcu.Pin14=PA2
|
||||
Mcu.Pin15=PA3
|
||||
Mcu.Pin16=PA4
|
||||
Mcu.Pin17=PA5
|
||||
Mcu.Pin18=PA6
|
||||
Mcu.Pin19=PA7
|
||||
Mcu.Pin2=PE4
|
||||
Mcu.Pin20=PC4
|
||||
Mcu.Pin21=PC5
|
||||
Mcu.Pin22=PB0
|
||||
Mcu.Pin23=PB1
|
||||
Mcu.Pin24=PB2
|
||||
Mcu.Pin25=PE7
|
||||
Mcu.Pin26=PE8
|
||||
Mcu.Pin27=PE9
|
||||
Mcu.Pin28=PE10
|
||||
Mcu.Pin29=PE11
|
||||
Mcu.Pin3=PE5
|
||||
Mcu.Pin30=PE12
|
||||
Mcu.Pin31=PE13
|
||||
Mcu.Pin32=PE14
|
||||
Mcu.Pin33=PE15
|
||||
Mcu.Pin34=PB10
|
||||
Mcu.Pin35=PB11
|
||||
Mcu.Pin36=PB12
|
||||
Mcu.Pin37=PB13
|
||||
Mcu.Pin38=PB14
|
||||
Mcu.Pin39=PB15
|
||||
Mcu.Pin4=PC14-OSC32_IN
|
||||
Mcu.Pin40=PD8
|
||||
Mcu.Pin41=PD10
|
||||
Mcu.Pin42=PD11
|
||||
Mcu.Pin43=PD12
|
||||
Mcu.Pin44=PD13
|
||||
Mcu.Pin45=PD14
|
||||
Mcu.Pin46=PD15
|
||||
Mcu.Pin47=PC6
|
||||
Mcu.Pin48=PC7
|
||||
Mcu.Pin49=PC8
|
||||
Mcu.Pin5=PC15-OSC32_OUT
|
||||
Mcu.Pin50=PC9
|
||||
Mcu.Pin51=PA8
|
||||
Mcu.Pin52=PA9
|
||||
Mcu.Pin53=PA10
|
||||
Mcu.Pin54=PA11
|
||||
Mcu.Pin55=PA12
|
||||
Mcu.Pin56=PA13
|
||||
Mcu.Pin57=PA14
|
||||
Mcu.Pin58=PA15
|
||||
Mcu.Pin59=PC10
|
||||
Mcu.Pin6=PH0-OSC_IN
|
||||
Mcu.Pin60=PC11
|
||||
Mcu.Pin61=PC12
|
||||
Mcu.Pin62=PD0
|
||||
Mcu.Pin63=PD1
|
||||
Mcu.Pin64=PD4
|
||||
Mcu.Pin65=PD5
|
||||
Mcu.Pin66=PD6
|
||||
Mcu.Pin67=PD7
|
||||
Mcu.Pin68=PB3
|
||||
Mcu.Pin69=PB4
|
||||
Mcu.Pin7=PH1-OSC_OUT
|
||||
Mcu.Pin70=PB5
|
||||
Mcu.Pin71=PB6
|
||||
Mcu.Pin72=PB7
|
||||
Mcu.Pin73=PB9
|
||||
Mcu.Pin74=VP_FREERTOS_VS_CMSIS_V1
|
||||
Mcu.Pin75=VP_SYS_VS_tim7
|
||||
Mcu.Pin76=VP_TIM1_VS_ClockSourceINT
|
||||
Mcu.Pin77=VP_TIM2_VS_ClockSourceINT
|
||||
Mcu.Pin78=VP_TIM3_VS_ClockSourceINT
|
||||
Mcu.Pin79=VP_TIM6_VS_ClockSourceINT
|
||||
Mcu.Pin8=PC0
|
||||
Mcu.Pin80=VP_TIM8_VS_ClockSourceINT
|
||||
Mcu.Pin9=PC1
|
||||
Mcu.PinsNb=81
|
||||
Mcu.ThirdPartyNb=0
|
||||
Mcu.UserConstants=xx,xx
|
||||
Mcu.UserName=STM32F407VGTx
|
||||
|
@ -417,6 +420,10 @@ PC14-OSC32_IN.GPIO_PuPd=GPIO_PULLDOWN
|
|||
PC14-OSC32_IN.Locked=true
|
||||
PC14-OSC32_IN.PinState=GPIO_PIN_RESET
|
||||
PC14-OSC32_IN.Signal=GPIO_Output
|
||||
PC15-OSC32_OUT.GPIOParameters=GPIO_Label
|
||||
PC15-OSC32_OUT.GPIO_Label=RP_EN
|
||||
PC15-OSC32_OUT.Locked=true
|
||||
PC15-OSC32_OUT.Signal=GPIO_Output
|
||||
PC2.GPIOParameters=GPIO_Label
|
||||
PC2.GPIO_Label=EM_MISO
|
||||
PC2.Locked=true
|
||||
|
@ -561,6 +568,14 @@ PE3.GPIOParameters=GPIO_Label
|
|||
PE3.GPIO_Label=PWR_IN
|
||||
PE3.Locked=true
|
||||
PE3.Signal=GPIO_Output
|
||||
PE4.GPIOParameters=GPIO_Label
|
||||
PE4.GPIO_Label=RS_EN
|
||||
PE4.Locked=true
|
||||
PE4.Signal=GPIO_Output
|
||||
PE5.GPIOParameters=GPIO_Label
|
||||
PE5.GPIO_Label=Vout_EN
|
||||
PE5.Locked=true
|
||||
PE5.Signal=GPIO_Output
|
||||
PE7.GPIOParameters=GPIO_Speed,GPIO_Label
|
||||
PE7.GPIO_Label=LCD_DB4
|
||||
PE7.GPIO_Speed=GPIO_SPEED_FREQ_VERY_HIGH
|
||||
|
|
Loading…
Reference in New Issue