📄 controllbuttons.c
字号:
lastmsgU403.BYTES.lsB = (lastmsgU403.BYTES.lsB & U403_LIGHTS1_OFF_AND);
temp16 = ReadWriteSPI16bit(lastmsgU403);
CSB_U403 = 1;
}
/******************************************************************************
* Module : cabin_lights_1_on
* Description : switch on the cabin lights
* Global Data : none
* Static Global Data: none
* Returns : none
* Arguments : none
* Special Issues : none
******************************************************************************/
void Cabin_lights_1_on(void)
{
Byte temp8;
UNION16 temp16;
SPI24 temp24;
CSB_U403 = 0; // Chipselect COSS MC33880 U403 - PAD13
lastmsgU403.BYTES.msB = U403_OPEN_LOAD_ON;
lastmsgU403.BYTES.lsB = (lastmsgU403.BYTES.lsB | U403_LIGHTS1_ON_AND);
temp16 = ReadWriteSPI16bit(lastmsgU403);
CSB_U403 = 1;
}
/******************************************************************************
* Module : cabin_lights_2_off
* Description : switch off the cabin lights
* Global Data : none
* Static Global Data: none
* Returns : none
* Arguments : none
* Special Issues : none
******************************************************************************/
void Cabin_lights2_off(void)
{
Byte temp8;
UNION16 temp16;
SPI24 temp24;
CSB_U403 = 0; // Chipselect COSS MC33880 U403 - PAD13
lastmsgU403.BYTES.msB = U403_OPEN_LOAD_ON;
lastmsgU403.BYTES.lsB = (lastmsgU403.BYTES.lsB & U403_LIGHTS2_OFF_AND);
temp16 = ReadWriteSPI16bit(lastmsgU403);
CSB_U403 = 1;
}
/******************************************************************************
* Module : cabin_lights_2_on
* Description : switch on the 55W lights
* Global Data : none
* Static Global Data: none
* Returns : none
* Arguments : none
* Special Issues : none
******************************************************************************/
void Cabin_lights2_on(void)
{
Byte temp8;
UNION16 temp16;
SPI24 temp24;
CSB_U403 = 0; // Chipselect COSS MC33880 U403 - PAD13
lastmsgU403.BYTES.msB = U403_OPEN_LOAD_ON;
lastmsgU403.BYTES.lsB = (lastmsgU403.BYTES.lsB | U403_LIGHTS2_ON_AND);
temp16 = ReadWriteSPI16bit(lastmsgU403);
CSB_U403 = 1;
}
/******************************************************************************
* Module : dash_board_lights_off
* Description : switch off dash board lights
* Global Data : none
* Static Global Data: none
* Returns : none
* Arguments : none
* Special Issues : none
******************************************************************************/
void Dash_board_lights_off(void)
{
Byte temp8;
UNION16 temp16;
SPI24 temp24;
CSB_U405 = 0;
lastmsgU405.comm = U405_TRISTATE_COMMAND_SG;
lastmsgU405.data.w = U405_DASH_OFF;
temp24 = ReadWriteSPI24bit(lastmsgU405);
CSB_U405 = 1;
}
/******************************************************************************
* Module : dash_board_lights_on
* Description : switch on dash board lights
* Global Data : none
* Static Global Data: none
* Returns : none
* Arguments : none
* Special Issues : none
******************************************************************************/
void Dash_board_lights_on(void)
{
Byte temp8;
UNION16 temp16;
SPI24 temp24;
CSB_U405 = 0;
lastmsgU405.comm = U405_TRISTATE_COMMAND_SG;
lastmsgU405.data.w = U405_DASH_ON;
temp24 = ReadWriteSPI24bit(lastmsgU405);
CSB_U405 = 1;
}
/******************************************************************************
* Module : washer_pump_off
* Description : switch off washer pump
* Global Data : none
* Static Global Data: none
* Returns : none
* Arguments : none
* Special Issues : none
******************************************************************************/
void Washer_pump_off(void)
{
Byte temp8;
UNION16 temp16;
SPI24 temp24;
CSB_U401 = 0; // Chipselect e-Switch MC33580 U401 - PORTB3
lastmsgU401.BYTES.msB = U401_OCR0;
if (fm_action2)
lastmsgU401.BYTES.lsB = (U401_HS0 | U401_HS1);
else
lastmsgU401.BYTES.lsB = U401_NO_HS;
temp16 = ReadWriteSPI16bit(lastmsgU401);
CSB_U401 = 1;
}
/******************************************************************************
* Module : washer_pump_on
* Description : switch on washer pump
* Global Data : none
* Static Global Data: none
* Returns : none
* Arguments : none
* Special Issues : none
******************************************************************************/
void Washer_pump_on(void)
{
Byte temp8;
UNION16 temp16;
SPI24 temp24;
CSB_U401 = 0; // Chipselect e-Switch MC33580 U401 - PORTB3
lastmsgU401.BYTES.msB = U401_OCR0;
if (fm_action2)
lastmsgU401.BYTES.lsB = (U401_HS0 | U401_HS1 | U401_HS2 | U401_HS3);
else
lastmsgU401.BYTES.lsB = (U401_HS2 | U401_HS3);
temp16 = ReadWriteSPI16bit(lastmsgU401);
CSB_U401 = 1;
}
/******************************************************************************
* Module : msdi_off
* Description : tristate all output pins
* Global Data : none
* Static Global Data: none
* Returns : none
* Arguments : none
* Special Issues : none
******************************************************************************/
void Msdi_off(void)
{
Byte temp8;
UNION16 temp16;
SPI24 temp24;
CSB_U404 = 0;
lastmsgU404.comm = U404_TRISTATE_COMMAND_SP;
lastmsgU404.data.w = U404_TRISTATE_OFF;
temp24 = ReadWriteSPI24bit(lastmsgU404);
CSB_U404 = 1;
}
/******************************************************************************
* Module : msdi_sink_current
* Description : switch output pins to sink current, Red leds schine
* Global Data : none
* Static Global Data: none
* Returns : none
* Arguments : none
* Special Issues : none
******************************************************************************/
void Msdi_sink_current(void)
{
Byte temp8;
UNION16 temp16;
SPI24 temp24;
CSB_U404 = 0; // Enable U404 - PTS7
temp24.comm = U404_TRISTATE_COMMAND_SP;
temp24.data.w = U404_TRISTATE_OFF;
temp24 = ReadWriteSPI24bit(temp24);
CSB_U404 = 1;
CSB_U404 = 0;
temp24.comm = U404_SETTING_COMMAND;
temp24.data.w = U404_SETTING_SINK;
temp24 = ReadWriteSPI24bit(temp24);
CSB_U404 = 1;
for (temp8=0; temp8 < WAIT_5; temp8++);
CSB_U404 = 0;
lastmsgU404.comm = U404_TRISTATE_COMMAND_SP;
lastmsgU404.data.w = U404_TRISTATE_SINK;
temp24 = ReadWriteSPI24bit(lastmsgU404);
CSB_U404 = 1;
}
/******************************************************************************
* Module : msdi_source_current
* Description : switch output pins to source current, Green leds schine
* Global Data : none
* Static Global Data: none
* Returns : none
* Arguments : none
* Special Issues : none
******************************************************************************/
void Msdi_source_current(void)
{
Byte temp8;
UNION16 temp16;
SPI24 temp24;
CSB_U404 = 0; // Enable U404 - PTS7
temp24.comm = U404_TRISTATE_COMMAND_SP;
temp24.data.w = U404_TRISTATE_OFF;
temp24 = ReadWriteSPI24bit(temp24);
CSB_U404 = 1;
CSB_U404 = 0;
temp24.comm = U404_SETTING_COMMAND;
temp24.data.w = U404_SETTING_SOURCE;
temp24 = ReadWriteSPI24bit(temp24);
CSB_U404 = 1;
for (temp8=0; temp8 < WAIT_5; temp8++);
CSB_U404 = 0;
lastmsgU404.comm = U404_TRISTATE_COMMAND_SP;
lastmsgU404.data.w = U404_TRISTATE_SOURCE;
temp24 = ReadWriteSPI24bit(lastmsgU404);
CSB_U404 = 1;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -