RTE_PWM_OUT.c 1.58 KB
Newer Older
hu's avatar
hu committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
#include "RTE_PWM_OUT.h"
#include "TimerB.h"

void RTE_PWM_Init(void)
{
    TimerB_PWM_Init();
}

void RTE_PWM_Start(void)
{

}
void RTE_PWM_Stop(void)
{

}

/*指针背光,设置亮度*/
void RTE_PWM_Set_Point(uint16_t m_Cycle, uint16_t m_Duty)
{

}
/*指针背光,开启输出*/
void RTE_PWM_Point_Start(void)
{

}
/*指针背光,关闭输出*/
void RTE_PWM_Point_Stop(void)
{

}

/*表盘背光更新亮度*/
void RTE_PWM_Set_Panel(uint16_t m_Cycle, uint16_t m_Duty)
{

}
/*表盘背光关闭输出*/
void RTE_PWM_Panel_Stop(void)
{

}
/*表盘背光开启输出*/
void RTE_PWM_Panel_Start(void)
{

}


/*LCD设置背光*/
void RTE_PWM_Set_LCD(uint16_t m_Cycle, uint16_t m_Duty)
{

}
/*LCD关闭*/
void RTE_PWM_LCD_Stop(void)
{

}
/*LCD开启*/
void RTE_PWM_LCD_Start(void)
{

}

67
/*车速频率输出*/
hu's avatar
hu committed
68 69
void RTE_PWM_Set_Speed_Out(uint16_t m_Cycle, uint16_t m_Duty)
{
hu's avatar
hu committed
70
    uint32_t ActSetFreq = 0u;;
hu's avatar
hu committed
71 72 73 74 75
    uint16_t Fre_8_pulse = 0 ;

    Fre_8_pulse = m_Cycle ;
    Fre_8_pulse *= 25 ;
    Fre_8_pulse /= 8 ;
hu's avatar
hu committed
76

77 78
    /*A16-25  A17-8 A18-8*/
    /*车速1  8脉冲*/
hu's avatar
hu committed
79 80
    ActSetFreq = TimerB_PWM_Channel_Fre_Set(TIMERB_2_CH10 , Fre_8_pulse , m_Duty);

81
    /*车速2  25脉冲*/
hu's avatar
hu committed
82
    ActSetFreq = TimerB_PWM_Channel_Fre_Set(TIMERB_2_CH13 , m_Cycle , m_Duty);
hu's avatar
hu committed
83

84
    /*车速3  25脉冲*/
hu's avatar
hu committed
85
    ActSetFreq = TimerB_PWM_Channel_Fre_Set(TIMERB_2_CH15 , m_Cycle , m_Duty);
hu's avatar
hu committed
86 87
}

88
/*转速频率输出*/
hu's avatar
hu committed
89 90 91
void RTE_PWM_Set_Tacho_Out(uint16_t m_Cycle, uint16_t m_Duty)
{
    uint32_t ActSetFreq;
92
    /*342  10.2  以4脉冲/发动机1转向A39端子输出 */
hu's avatar
hu committed
93
    ActSetFreq = TimerB_PWM_Channel_Fre_Set(TIMERB_0_CH7 , m_Cycle , m_Duty);
hu's avatar
hu committed
94 95

}