/*******************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only
* intended for use with Renesas products. No other uses are authorized. This
* software is owned by Renesas Electronics Corporation and is protected under
* all applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
* LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
* AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
* TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
* ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
* FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
* ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software
* and to discontinue the availability of this software. By using this software,
* you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
*
* Copyright (C) 2014 Renesas Electronics Corporation. All rights reserved.
*******************************************************************************/
/*******************************************************************************
* File Name : main.c
* Version : 1.00
* Device(s) : R7F0C807
* Tool-Chain : IDE-Cubesuite+(V2.01.00), Compiler-CA78K0R(V1.60)
* H/W Platform : YCB14RTIOW02B
* Description : This program is used for wireless charging transmitter
* Operation : 1. Compile and download the sample code. Click 'Reset Go'
* to start the software.
******************************************************************************/
/******************************************************************************
* History : DD.MM.YYYY Version Description
* 14.07.2014 1.00 First Release
******************************************************************************/
/* Option byte:0x85FCF3F9, watchdog timer counts and its overflow interval is 949ms */
/***********************************************************************************
Includes <System Includes> , "Project Includes"
***********************************************************************************/
/* Interface of hardware driver */
#include "driver.h"
/* Interface of application program */
#include "app.h"
/***********************************************************************************
Macro definitions
***********************************************************************************/
/***********************************************************************************
Typedef definitions
***********************************************************************************/
/***********************************************************************************
Exported global variables (to be accessed by other files)
***********************************************************************************/
/***********************************************************************************
Private global variables and functions
***********************************************************************************/
/* Private functions */
static uint8_t Voltage_Check(void);
static void Servo_Handle(uint8_t * p_flag);
static void Power_transfer_Handle(uint8_t * p_flag);
static void Over_current_Handle(uint8_t * p_flag);
static void Over_temperature_Handle(uint8_t * p_flag);
static void Default_Handle(uint8_t * p_flag);
/************************************************************************************
* Function Name : main
* Description : This is main function
* Arguments : None
* Return Value : None
************************************************************************************/
void main(void)
{
uint8_t mode_flag;
__disable_interrupt();
/* Initialize clock module */
Clock_Init();
/* Initialize PWM related module */
PWM_Init();
PWM_Stop();
/* Initialize AD module */
AD_Init();
/* Initialize TAU module */
TAU_Init();
/* Initialize led */
LED_Init();
LED_Show(OFF);
__enable_interrupt();
/* Initialize variable */
mode_flag = SERVO;
if (!Voltage_Check())
{
/* Led blinks indicating some errors happen */
while (1)
{
LED_Show(ON);
/* Delay for 50ms */
Delay_1ms(50);
LED_Show(OFF);
/* Delay for 50ms */
Delay_1ms(50);
WDT_Restart();
}
}
else
{
while (1)
{
switch (mode_flag)
{
case SERVO:
Servo_Handle(&mode_flag);
break;
case POWER_TRANSFER:
Power_transfer_Handle(&mode_flag);
break;
case OVER_CURRENT:
Over_current_Handle(&mode_flag);
break;
case OVER_TEMPERATURE:
Over_temperature_Handle(&mode_flag);
break;
default:
Default_Handle(&mode_flag);
break;
}
WDT_Restart();
}
}
}
/************************************************************************************
End of function main
************************************************************************************/
/************************************************************************************
* Function Name : Voltage_Check
* Description : This function checks voltage whether is normal
* Arguments : None
* Return Value : VOLTAGE_ABNORMAL -
* Voltage is abnormal
* VOLTAGE_NORMAL -
* Voltage is normal
************************************************************************************/
static uint8_t Voltage_Check(void)
{
uint8_t i;
/* Voltage monitor result */
uint16_t voltage_result[VOLTAGE_N], voltage;
/* Check original voltage of VIN_LOAD */
for (i = 0; i < VOLTAGE_N; i++)
{
voltage_result[i] = Monitor_Result_Get(VOLTAGE_CHANNEL); /* Take about 3.4us */
/* delay for 10ms */
Delay_1ms(10);
}
/* Execute average filer */
voltage = AverageFilter(voltage_result, VOLTAGE_N);
if ( voltage > VOLTAGE_THRESHOLD_HIGH || voltage < VOLTAGE_THRESHOLD_LOW)
{
return VOLTAGE_ABNORMAL;
}
else
{
return VOLTAGE_NORMAL;
}
}
/************************************************************************************
End of function Voltage_Check
************************************************************************************/
/************************************************************************************
* Function Name : Servo_Handle
* Description : This is servo mode handling function
* Arguments : p_flag -
* Pointer to mode flag
* Return Value : None
************************************************************************************/
static void Servo_Handle(uint8_t * p_flag)
{
uint8_t i;
/* Current monitor result */
uint16_t current_result[CURRENT_N], c
没有合适的资源?快使用搜索试试~ 我知道了~
基于瑞萨R7F0C807无线充电发送器开发评估硬件(原理图+PCB)+软件源码+技术文档资料.zip
共16个文件
c:6个
pdf:3个
h:2个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 127 浏览量
2024-04-28
09:43:07
上传
评论
收藏 4.42MB ZIP 举报
温馨提示
基于瑞萨R7F0C807无线充电发送器开发评估硬件(原理图+PCB)+软件源码+技术文档资料,硬件采用2层板设计,大小为85x32mm, 可做为你的学习设计参考。 static uint8_t Voltage_Check(void); static void Servo_Handle(uint8_t * p_flag); static void Power_transfer_Handle(uint8_t * p_flag); static void Over_current_Handle(uint8_t * p_flag); static void Over_temperature_Handle(uint8_t * p_flag); static void Default_Handle(uint8_t * p_flag);
资源推荐
资源详情
资源评论
收起资源包目录
基于瑞萨R7F0C807无线充电发送器开发评估硬件(原理图+PCB)+软件源码+技术文档资料.zip (16个子文件)
R7F0C807+无线充电发送器控制源代码
R7F0C807 Wireless Charging Transmitter Software
app.h 4KB
app.c 5KB
miscellaneous.c 10KB
DefaultBuild
pwm.c 6KB
r7f0c807_wireless_charging_transmitter.mtpj 86KB
led.c 4KB
ad.c 7KB
driver.h 4KB
main.c 14KB
R7F0C807+无线充电发送器控制BOM列表
R01AN2356CC0100_R7F0C807.pdf 20KB
R7F0C807 无线充电发送器控制用户手册
R01AN2353CC0100_R7F0C807.pdf 4.48MB
R7F0C807 无线充电发送器控制PCB原理图
R7F0C807 无线充电发送器控制电路图
R7F0C807 Wireless Charging Transmitter Schematics
R7F0C807 Wireless Charging Transmitter_SCH.pdf 302KB
R7F0C807 Wireless Charging Transmitter_SCH.SchDoc 195KB
R7F0C807 无线充电发送器控制PCB原理图
R7F0C807 Wireless Charging Transmitter PCB.PcbDocPreview 37KB
R7F0C807 Wireless Charging Transmitter PCB.PcbDoc.htm 4KB
R7F0C807 Wireless Charging Transmitter PCB.PcbDoc 373KB
共 16 条
- 1
资源评论
GJZGRB
- 粉丝: 1353
- 资源: 6158
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功