Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
RT_RMR42E
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
时昊
RT_RMR42E
Commits
579e0ae3
Commit
579e0ae3
authored
Jun 26, 2024
by
郑萍
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🎉
init:删除光感模块
parent
4dacfeaa
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
1870 additions
and
287 deletions
+1870
-287
RMR42E.uvguix.Administrator
...t/Cmsemicon/BAT32A239/MDK_ARM/RMR42E.uvguix.Administrator
+1865
-97
RMR42E.uvprojx
Firmware/Project/Cmsemicon/BAT32A239/MDK_ARM/RMR42E.uvprojx
+0
-20
BackLight.c
Firmware/Source/Application/BackLight/BackLight.c
+2
-63
BackLight.h
Firmware/Source/Application/BackLight/BackLight.h
+0
-10
Components.h
Firmware/Source/Component/Components.h
+2
-2
Light_Sensor.h
Firmware/Source/Component/Light_Sensor/Light_Sensor.h
+0
-45
Light_Sensor_Interface.c
...re/Source/Component/Light_Sensor/Light_Sensor_Interface.c
+0
-35
Light_Sensor_Interface.h
...re/Source/Component/Light_Sensor/Light_Sensor_Interface.h
+0
-8
Light_Sensor_V1.0.lib
Firmware/Source/Component/Light_Sensor/Light_Sensor_V1.0.lib
+0
-0
PowerManag_user.c
Firmware/Source/Component/PowerManagement/PowerManag_user.c
+0
-6
Sys_Task_List.c
Firmware/Source/System/Sys_Task_List.c
+1
-1
No files found.
Firmware/Project/Cmsemicon/BAT32A239/MDK_ARM/RMR42E.uvguix.Administrator
View file @
579e0ae3
This source diff could not be displayed because it is too large. You can
view the blob
instead.
Firmware/Project/Cmsemicon/BAT32A239/MDK_ARM/RMR42E.uvprojx
View file @
579e0ae3
...
...
@@ -608,26 +608,6 @@
<FileType>
5
</FileType>
<FilePath>
..\..\..\..\Source\Component\Analog\Analog_Signals.h
</FilePath>
</File>
<File>
<FileName>
Light_Sensor.h
</FileName>
<FileType>
5
</FileType>
<FilePath>
..\..\..\..\Source\Component\Light_Sensor\Light_Sensor.h
</FilePath>
</File>
<File>
<FileName>
Light_Sensor_Interface.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\..\..\..\Source\Component\Light_Sensor\Light_Sensor_Interface.c
</FilePath>
</File>
<File>
<FileName>
Light_Sensor_Interface.h
</FileName>
<FileType>
5
</FileType>
<FilePath>
..\..\..\..\Source\Component\Light_Sensor\Light_Sensor_Interface.h
</FilePath>
</File>
<File>
<FileName>
Light_Sensor_V1.0.lib
</FileName>
<FileType>
4
</FileType>
<FilePath>
..\..\..\..\Source\Component\Light_Sensor\Light_Sensor_V1.0.lib
</FilePath>
</File>
<File>
<FileName>
CAN_Lib.h
</FileName>
<FileType>
5
</FileType>
...
...
Firmware/Source/Application/BackLight/BackLight.c
View file @
579e0ae3
...
...
@@ -6,51 +6,15 @@
#define BACK_LIGHT_DAY 50
#define BACK_LIGHT_NIGHT 200
_Light
g_Light
;
_Light
interact_Light
;
uint8_t
interact_PWM_Low_Duty
=
0
;
void
BackLight_Init
(
void
)
{
g_Light
.
Light_Day
=
0XFFFF
;
g_Light
.
Light_Night
=
0XFFFF
;
interact_Light
.
Light_Day
=
0XFFFF
;
interact_Light
.
Light_Night
=
0XFFFF
;
}
void
BackLight_Process
(
void
)
{
if
(
SYS_OPR_STAT_IGN_ON
)
{
if
(
ALS_Get_Data1
()
>
200
)
//data1 500以内,data0 3000以内
{
if
(
g_Light
.
Light_Day
<
15
)
//1.5s 1500ms
{
g_Light
.
Light_Day
++
;
//100ms
}
else
{
g_Light
.
Light_Night
=
0
;
TimerM_PWM_set_duty
(
TIMERM_COUNTER1
,
TIMERM_CHB
,
BACK_LIGHT_DAY
);
}
}
else
{
if
(
g_Light
.
Light_Night
<
15
)
{
g_Light
.
Light_Night
++
;
}
else
{
g_Light
.
Light_Day
=
0
;
TimerM_PWM_set_duty
(
TIMERM_COUNTER1
,
TIMERM_CHB
,
BACK_LIGHT_NIGHT
);
}
}
TimerM_PWM_set_duty
(
TIMERM_COUNTER1
,
TIMERM_CHB
,
BACK_LIGHT_DAY
);
}
else
{
g_Light
.
Light_Day
=
0
;
g_Light
.
Light_Night
=
0
;
TimerM_PWM_set_duty
(
TIMERM_COUNTER1
,
TIMERM_CHB
,
0
);
}
}
...
...
@@ -59,35 +23,10 @@ void Interact_Light_Process(void)
{
if
(
SYS_OPR_STAT_IGN_ON
)
{
if
(
ALS_Get_Data1
()
>
200
)
//data1 500以内,data0 3000以内
{
if
(
interact_Light
.
Light_Day
<
15
)
//1.5s 1500ms
{
interact_Light
.
Light_Day
++
;
//100ms
}
else
{
interact_Light
.
Light_Night
=
0
;
TimerM_PWM_set_duty
(
TIMERM_COUNTER0
,
TIMERM_CHD
,
interact_PWM_Low_Duty
*
10
);
}
}
else
{
if
(
interact_Light
.
Light_Night
<
15
)
{
interact_Light
.
Light_Night
++
;
}
else
{
interact_Light
.
Light_Day
=
0
;
TimerM_PWM_set_duty
(
TIMERM_COUNTER0
,
TIMERM_CHD
,
BACK_LIGHT_NIGHT
);
}
}
TimerM_PWM_set_duty
(
TIMERM_COUNTER0
,
TIMERM_CHD
,
interact_PWM_Low_Duty
*
10
);
}
else
{
interact_Light
.
Light_Day
=
0
;
interact_Light
.
Light_Night
=
0
;
TimerM_PWM_set_duty
(
TIMERM_COUNTER0
,
TIMERM_CHD
,
0
);
}
}
Firmware/Source/Application/BackLight/BackLight.h
View file @
579e0ae3
...
...
@@ -2,17 +2,7 @@
#define _BACKLIGHT_H_
#include "common.h"
typedef
struct
{
uint8_t
Duty
;
uint8_t
Cycle
;
uint16_t
Light_Night
;
uint16_t
Light_Day
;
}
_Light
;
extern
_Light
g_Light
;
extern
uint8_t
interact_PWM_Low_Duty
;
void
BackLight_Init
(
void
);
void
BackLight_Process
(
void
);
void
Interact_Light_Process
(
void
);
...
...
Firmware/Source/Component/Components.h
View file @
579e0ae3
...
...
@@ -20,8 +20,8 @@
#include "LED_Driver\Simulated_IIC_2_Master.h"
#include "LED_Driver\LED_Driver_Interface.h"
#include "LED_Driver\LED_Driver.h"
#include "Light_Sensor\Light_Sensor.h"
#include "Light_Sensor\Light_Sensor_Interface.h"
//
#include "Light_Sensor\Light_Sensor.h"
//
#include "Light_Sensor\Light_Sensor_Interface.h"
#include "Analog\Analog_Signals.h"
#include "Analog\Analog_Circuits.h"
#include "common.h"
...
...
Firmware/Source/Component/Light_Sensor/Light_Sensor.h
deleted
100644 → 0
View file @
4dacfeaa
#ifndef LIGHT_SENSOR_H__
#define LIGHT_SENSOR_H__
/*-------------------------------------------------------------------------------------------*/
// #define LIGHT_SENSOR_PLATFORM_16BIT
#ifdef LIGHT_SENSOR_PLATFORM_16BIT
typedef
unsigned
char
ALS_uint8_t
;
typedef
unsigned
int
ALS_uint16_t
;
typedef
unsigned
long
ALS_uint32_t
;
#else
typedef
unsigned
char
ALS_uint8_t
;
typedef
unsigned
short
ALS_uint16_t
;
typedef
unsigned
int
ALS_uint32_t
;
#endif
/*-------------------------------------------------------------------------------------------*/
#define ALS_VERSIONS 0X01U
typedef
void
(
*
ALS_Hanle
)(
void
);
typedef
void
(
*
ALS_Hanle_Write
)(
ALS_uint8_t
u8ALSData
);
typedef
ALS_uint8_t
(
*
ALS_Hanle_Read
)(
void
);
typedef
struct
{
ALS_Hanle_Write
pfnALSDelay100usCB
;
/*100us 延时函数*/
ALS_Hanle
pfnALSIICStartCB
;
/*start 函数接口*/
ALS_Hanle
pfnALSIICStopCB
;
/*stop 函数接口*/
ALS_Hanle_Write
pfnALSIICTxDataCB
;
/*发送数据 函数接口*/
ALS_Hanle_Write
pfnALSIICTxACKCB
;
/*发送ACK 函数接口*/
ALS_Hanle_Read
pfnALSIICRxDataCB
;
/*接收数据 函数接口*/
ALS_Hanle_Read
pfnALSIICRxACKCB
;
/*接收ACK 函数接口*/
}
Light_Sensor_Par_st_t
;
/*-------------------------------------------------------------------------------------------*/
/*
返回0:初始化成功
返回1:初始化失败
*/
extern
ALS_uint8_t
ALS_Init
(
Light_Sensor_Par_st_t
*
pstALSInitPar
);
/*根据需要的数据更新频率进行调用*/
extern
void
ALS_Service
(
void
);
extern
ALS_uint16_t
ALS_Get_Data0
(
void
);
extern
ALS_uint16_t
ALS_Get_Data1
(
void
);
/*-------------------------------------------------------------------------------------------*/
#endif
Firmware/Source/Component/Light_Sensor/Light_Sensor_Interface.c
deleted
100644 → 0
View file @
4dacfeaa
#include "Light_Sensor.h"
#include "Light_Sensor_Interface.h"
#include "Simulated_IIC_2_Master.h"
void
ALS_Delay_100us
(
ALS_uint8_t
u8ALSData
)
{
ALS_uint32_t
ALSDelayCount
=
0
;
ALS_uint32_t
i
=
0
;
ALS_uint32_t
j
=
0
;
for
(
j
=
0
;
j
<
u8ALSData
;
j
++
)
{
for
(
i
=
0
;
i
<
1000
;
i
++
)
{
ALSDelayCount
++
;
}
}
}
/****************初始化函数调用示例*************/
void
Light_Sensor_Init_Example
(
void
)
{
Light_Sensor_Par_st_t
stALSInitPar
;
stALSInitPar
.
pfnALSDelay100usCB
=
ALS_Delay_100us
;
stALSInitPar
.
pfnALSIICStartCB
=
Simulated_IIC_2_Start
;
stALSInitPar
.
pfnALSIICStopCB
=
Simulated_IIC_2_Stop
;
stALSInitPar
.
pfnALSIICTxDataCB
=
Simulated_IIC_2_Transmit_Data
;
stALSInitPar
.
pfnALSIICTxACKCB
=
Simulated_IIC_2_Transmit_ACK
;
stALSInitPar
.
pfnALSIICRxDataCB
=
Simulated_IIC_2_Receive_Data
;
stALSInitPar
.
pfnALSIICRxACKCB
=
Simulated_IIC_2_Receive_ACK
;
ALS_Init
(
&
stALSInitPar
);
}
Firmware/Source/Component/Light_Sensor/Light_Sensor_Interface.h
deleted
100644 → 0
View file @
4dacfeaa
#ifndef LIGHT_SENSOR_INTERFACE_H__
#define LIGHT_SENSOR_INTERFACE_H__
/*-----------------------------------------------------------*/
extern
void
Light_Sensor_Init_Example
(
void
);
#endif
Firmware/Source/Component/Light_Sensor/Light_Sensor_V1.0.lib
deleted
100644 → 0
View file @
4dacfeaa
File deleted
Firmware/Source/Component/PowerManagement/PowerManag_user.c
View file @
579e0ae3
...
...
@@ -49,11 +49,9 @@ static void Power_KL30_Init(void)
DFlash_init
();
Analog_Signal_Conv_Init
();
BU98R10_Init
();
BackLight_Init
();
Sys_KL30_Init
();
Checkself_Init
();
LINE_IN_Init
();
Light_Sensor_Init_Example
();
//注意顺序1
LED_Driver_Init_Example
();
//注意顺序2
Data_User_Mileage_KL30Init
();
TimerM_PWM_counter_Output_Init
(
TIMERM_COUNTER0
,
400
,
64000000
);
...
...
@@ -84,12 +82,9 @@ static void Power_Wakeup_Init(void)
Analog_Signal_Conv_Init
();
Data_User_Mileage_WakeupInit
();
BU98R10_Init
();
BackLight_Init
();
Sys_WakeUp_Init
();
LINE_IN_Init
();
Line_In_KL15_ON_Init
();
Light_Sensor_Init_Example
();
//注意顺序1
LED_Driver_Init_Example
();
//注意顺序2
TimerM_PWM_counter_Output_Init
(
TIMERM_COUNTER0
,
400
,
64000000
);
TimerM_PWM_counter_Output_Init
(
TIMERM_COUNTER1
,
400
,
64000000
);
TimerM_PWM_CH_Output_init
(
TIMERM_COUNTER0
,
TIMERM_CHB
,
ActiveLevel_High
);
...
...
@@ -117,7 +112,6 @@ static void Power_IG_OFF_Init(void)
static
void
Power_IG_ON_Init
(
void
)
{
BackLight_Init
();
Checkself_Init
();
Line_In_KL15_ON_Init
();
Telltales_KL15_Init
();
...
...
Firmware/Source/System/Sys_Task_List.c
View file @
579e0ae3
...
...
@@ -82,7 +82,7 @@ void Sys_100ms_Tasks(void)
u8LEDDriverCheckCount
=
0U
;
LED_Driver_Work_Check
();
LED_Driver_Service_Immediate
();
//注意顺序1
ALS_Service
();
//注意顺序2
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment