You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
219 lines
5.1 KiB
219 lines
5.1 KiB
4 months ago
|
/**
|
||
|
******************************************************************************
|
||
|
* @copyright Copyright (C), 2016-2022, ConvenientPower. Co., Ltd.
|
||
|
* @file comp_config.h
|
||
|
* @version 1.0
|
||
|
* @author qing.cheng
|
||
|
* @date 2022-10-24
|
||
|
* @brief Header file of COMP_CONFIG_H module.
|
||
|
******************************************************************************
|
||
|
*/
|
||
|
#ifndef _COMP_CONFIG_H_
|
||
|
#define _COMP_CONFIG_H_
|
||
|
|
||
|
|
||
|
#include "core_comm.h"
|
||
|
#include "drv_comm.h"
|
||
|
#include "comp_uart.h"
|
||
|
#include "comp_clock.h"
|
||
|
#define TRUE 1
|
||
|
#define FALSE 0
|
||
|
#define SYSTICK_CLOCK 6000000
|
||
|
#define UART_BAUD_RATE 256000
|
||
|
|
||
|
|
||
|
|
||
|
/*************VOLTAGE************************************/
|
||
|
#define VOLTAGE_DEFAULT 5000
|
||
|
#define CURRENT_DEFAULT 3300
|
||
|
|
||
|
#define VOLTAGE_0P1V 100
|
||
|
#define VOLTAGE_0P2V 200
|
||
|
#define VOLTAGE_0P3V 300
|
||
|
#define VOLTAGE_0P24V 240
|
||
|
#define VOLTAGE_0P4V 400
|
||
|
#define VOLTAGE_0P5V 500
|
||
|
#define VOLTAGE_0P6V 600
|
||
|
#define VOLTAGE_1V 1000
|
||
|
#define VOLTAGE_2V 2000
|
||
|
#define VOLTAGE_3V 3000
|
||
|
#define VOLTAGE_3P1V 3100
|
||
|
#define VOLTAGE_3P2V 3200
|
||
|
#define VOLTAGE_3P3V 3300
|
||
|
#define VOLTAGE_3P4V 3400
|
||
|
#define VOLTAGE_3P8V 3800
|
||
|
#define VOLTAGE_4V 4000
|
||
|
#define VOLTAGE_4P2V 4200
|
||
|
#define VOLTAGE_4P5V 4500
|
||
|
#define VOLTAGE_5V 5000
|
||
|
#define VOLTAGE_5P1V 5100
|
||
|
#define VOLTAGE_5P2V 5200
|
||
|
#define VOLTAGE_5P3V 5300
|
||
|
#define VOLTAGE_5P25V 5250
|
||
|
#define VOLTAGE_5P5V 5500
|
||
|
#define VOLTAGE_5P9V 5900
|
||
|
#define VOLTAGE_6V 6000
|
||
|
#define VOLTAGE_7V 7000
|
||
|
#define VOLTAGE_8V 8000
|
||
|
#define VOLTAGE_9V 9000
|
||
|
#define VOLTAGE_10V 10000
|
||
|
#define VOLTAGE_10P5V 10500
|
||
|
#define VOLTAGE_11V 11000
|
||
|
#define VOLTAGE_12V 12000
|
||
|
#define VOLTAGE_13V 13000
|
||
|
#define VOLTAGE_14V 14000
|
||
|
#define VOLTAGE_15V 15000
|
||
|
#define VOLTAGE_16V 16000
|
||
|
#define VOLTAGE_17V 17000
|
||
|
#define VOLTAGE_18V 18000
|
||
|
#define VOLTAGE_20V 20000
|
||
|
#define VOLTAGE_20P5V 20500
|
||
|
#define VOLTAGE_21V 21000
|
||
|
#define VOLTAGE_24V 24000
|
||
|
#define VOLTAGE_28V 28000
|
||
|
|
||
|
/**************CUR DEFINE **********************/
|
||
|
#define CURRENT_0P1A 100
|
||
|
#define CURRENT_0P15A 150
|
||
|
#define CURRENT_0P2A 200
|
||
|
#define CURRENT_0P25A 250
|
||
|
#define CURRENT_0P3A 300
|
||
|
#define CURRENT_0P35A 350
|
||
|
#define CURRENT_0P5A 500
|
||
|
#define CURRENT_0P6A 600
|
||
|
#define CURRENT_0P7A 700
|
||
|
#define CURRENT_0P75A 750
|
||
|
#define CURRENT_0P8A 800
|
||
|
#define CURRENT_1A 1000
|
||
|
#define CURRENT_1P2A 1200
|
||
|
#define CURRENT_1P25A 1250
|
||
|
#define CURRENT_1P5A 1500
|
||
|
#define CURRENT_1P65A 1650
|
||
|
#define CURRENT_1P7A 1700
|
||
|
#define CURRENT_1P75A 1750
|
||
|
#define CURRENT_1P8A 1800
|
||
|
#define CURRENT_2A 2000
|
||
|
|
||
|
#define CURRENT_2P2A 2200
|
||
|
#define CURRENT_2P25A 2250
|
||
|
#define CURRENT_2P3A 2300
|
||
|
#define CURRENT_2P33A 2330
|
||
|
|
||
|
#define CURRENT_2P35A 2350
|
||
|
#define CURRENT_2P4A 2400
|
||
|
#define CURRENT_2P45A 2450
|
||
|
#define CURRENT_2P5A 2500
|
||
|
#define CURRENT_2P55A 2550
|
||
|
#define CURRENT_2P6A 2600
|
||
|
#define CURRENT_2P7A 2700
|
||
|
#define CURRENT_2P75A 2750
|
||
|
#define CURRENT_2P8A 2800
|
||
|
#define CURRENT_2P85A 2850
|
||
|
#define CURRENT_2P9A 2900
|
||
|
|
||
|
#define CURRENT_3P2A 3200
|
||
|
|
||
|
#define CURRENT_3A 3000
|
||
|
#define CURRENT_3P2A 3200
|
||
|
#define CURRENT_3P25A 3250
|
||
|
#define CURRENT_3P3A 3300
|
||
|
#define CURRENT_3P35A 3350
|
||
|
#define CURRENT_3P45A 3450
|
||
|
#define CURRENT_3P5A 3500
|
||
|
#define CURRENT_3P8A 3800
|
||
|
#define CURRENT_4A 4000
|
||
|
#define CURRENT_4P2A 4200
|
||
|
#define CURRENT_4P25A 4250
|
||
|
#define CURRENT_4P35A 4350
|
||
|
#define CURRENT_4P4A 4400
|
||
|
#define CURRENT_4P5A 4500
|
||
|
#define CURRENT_4P6A 4600
|
||
|
#define CURRENT_5A 5000
|
||
|
#define CURRENT_5P2A 5200
|
||
|
#define CURRENT_5P3A 5300
|
||
|
#define CURRENT_5P5A 5500
|
||
|
#define CURRENT_6A 6000
|
||
|
#define CURRENT_6P2A 6200
|
||
|
#define CURRENT_6P35A 6350
|
||
|
#define CURRENT_6P5A 6500
|
||
|
#define CURRENT_6P6A 6600
|
||
|
#define CURRENT_6P8A 6800
|
||
|
#define CURRENT_6P95A 6950
|
||
|
#define CURRENT_7A 7000
|
||
|
#define CURRENT_7P15A 7150
|
||
|
#define CURRENT_8A 8000
|
||
|
#define CURRENT_9A 9000
|
||
|
#define CURRENT_10A 10000
|
||
|
|
||
|
/********delay timer*************/
|
||
|
#define DELAY_1MS 1
|
||
|
#define DELAY_2MS 2
|
||
|
#define DELAY_3MS 3
|
||
|
#define DELAY_4MS 4
|
||
|
#define DELAY_5MS 5
|
||
|
#define DELAY_6MS 6
|
||
|
#define DELAY_7MS 7
|
||
|
#define DELAY_10MS 10
|
||
|
#define DELAY_20MS 20
|
||
|
#define DELAY_30MS 30
|
||
|
#define DELAY_38MS 38
|
||
|
#define DELAY_50MS 50
|
||
|
#define DELAY_60MS 60
|
||
|
#define DELAY_70MS 70
|
||
|
#define DELAY_100MS 100
|
||
|
#define DELAY_130MS 130
|
||
|
#define DELAY_150MS 150
|
||
|
#define DELAY_200MS 200
|
||
|
#define DELAY_220MS 220
|
||
|
#define DELAY_250MS 250
|
||
|
#define DELAY_300MS 300
|
||
|
#define DELAY_500MS 500
|
||
|
#define DELAY_600MS 600
|
||
|
#define DELAY_610MS 610
|
||
|
#define DELAY_650MS 650
|
||
|
#define DELAY_700MS 700
|
||
|
#define DELAY_950MS 950
|
||
|
#define DELAY_0S 0
|
||
|
#define DELAY_1S 1000
|
||
|
#define DELAY_1050MS 1050
|
||
|
#define DELAY_1P5S 1500
|
||
|
#define DELAY_3S 3000
|
||
|
#define DELAY_5S 5000
|
||
|
#define DELAY_10S 10000
|
||
|
#define DELAY_5500MS 5500
|
||
|
#define DELAY_2M 120000
|
||
|
#define DELAY_10M 600000
|
||
|
|
||
|
|
||
|
#define PWR_IDLE_TIMER 5000
|
||
|
|
||
|
|
||
|
#define REG_ADDR_WRD(x)\
|
||
|
(*((uint32_t *)(x)))
|
||
|
|
||
|
|
||
|
#define RD_REG_WORD(x)\
|
||
|
(*((uint32_t *)(x)))
|
||
|
|
||
|
|
||
|
#define WR_REG_WORD(x,y)\
|
||
|
((*(uint32_t *)(x)) = y)
|
||
|
|
||
|
|
||
|
|
||
|
#define SCALE_COEFF1024_CALC(x,y)\
|
||
|
(((x) * (y)) >> 10)
|
||
|
|
||
|
|
||
|
#define SCALE_COEFF2048_CALC(x,y)\
|
||
|
(((x) * (y)) >> 11)
|
||
|
|
||
|
|
||
|
#define ARRY_LEN(x)\
|
||
|
(sizeof(x) / sizeof(x[0]))
|
||
|
|
||
|
|
||
|
#endif
|
||
|
/*********************************************/
|
||
|
|