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.
 
 
 
 

140 lines
6.0 KiB

////////////////////////////////////////////////////////////////////////////
///@copyright Copyright (c) 2017, ���ؿƼ� All rights reserved.
///-------------------------------------------------------------------------
/// @file hard_config.h
/// @brief hard config include
/// @info FILE FOR HARDWARE SETUP AND SOFTWARE SETUP///FOR EXAMPLE: BAORD ,MCU,IDE
/// @info YOU CAN CHANGE OR ADD THE DEFINE IF YOU NEED
/// @info ����Ƕ��ʽ��Ŀ����� ������ȷ�ϵ�·�� Ȼ��ȷ��cpu оƬ�ͺ� Ȼ��ȷ�ϱ����� ֮����������� �����Ӧ�ó���
/// @info bsp_CONFIG Ϊ����ͷ�ļ���ʼ�� TYPE_BOARD_xx
///-------------------------------------------------------------------------
/// @version 1.1
/// @author CC
/// @date 20180308
/// @note
//////////////////////////////////////////////////////////////////////////////
/// @version 5.1
/// @author CC
/// @date 20200301
/// @note
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
#ifndef _BSP_CONFIG_H
#define _BSP_CONFIG_H
#include <INTRINS.H>
#include "../clib/type.h"
#include "../clib/bit.h"
#include "bsp_config0.h"
#define D_version_v 'L'
//STEP 1 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>TYPE_UASER_BOARD SELECT
#define TYPE_UASER_BOARD TYPE_BOARD_WEIGH_0B
//STEP 1 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<YPE_UASER_BOARD SELECT End
//STEP 2 TYPE_UASER_BOARD CONFIG >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
#if(TYPE_UASER_BOARD == TYPE_BOARD_WEIGH_0B)
#define D_version_h 0x37
#define D_version_L 0x38
#define TYPE_IDE TYPE_IDE_KEIL
#define TYPE_MCU TYPE_MCU_STC_8H
#include <stdio.h>
#include <string.h>
#include <intrins.h>
#include "../cpu/stc_stc8hxx.h"
#include "../cpu/stc_macro.h"
#define D_sys_MainFre MainFre_11M
#define D_uart0_BRT BRT_115200
#define D_uart0_SBIT SBIT_1
#define D_MCU_NAME "STC8H3K48S4"
//存储器特殊参数地址配置
#define D_MCU_SPEC_PARAM_CHIPID 0xBFF9
//...其他参数
//EEP存储地址定义
#define D_EEP_SECTOR_SIZE 0x200 //每个扇区0x200==512bytes
#define D_EEP_SECTOR_BLOCK_SIZE 0x80 //扇区中每个数据块0x40==64bytes,可选值[32,64,128]等
#define D_EEP_SECTOR_BLOCK_NUM (D_EEP_SECTOR_SIZE / D_EEP_PARAM_BLOCK_SIZE) //每个扇区数据块的数量
#define D_EEP_BLOCK_FILTER0 0xAA //扇区中每个数据块的Filter字段值
#define D_EEP_BLOCK_FILTER1 0x55
//EEP User Defined 参数区存储配置
#define D_EEP_PARAM_IN_SECTOR 1 //eeprom参数区扇区地址,从0开始
#define D_EEP_PARAM_IN_BLOCK 0 //eeprom参数区数据块地址,从0开始
//#define D_EEP_PARAM_BLOCK_SIZE (D_EEP_SECTOR_BLOCK_SIZE) //参数区每个块大小,必须:D_EEP_PARAM_BLOCK_SIZE<=D_EEP_SECTOR_BLOCK_SIZE!!!,因为eeprom.h中是按照D_EEP_SECTOR_BLOCK_SIZE分配的buf
//#define D_EEP_PARAM_BLOCK_NUM (D_EEP_SECTOR_SIZE / D_EEP_PARAM_BLOCK_SIZE) //每个扇区数据块的数量
//EEP 加密区存储配置
#define D_EEP_ENC_IN_SECTOR 0 //eeprom加密区扇区地址,从0开始
#define D_EEP_ENC_IN_BLOCK 0 //eeprom加密区数据块地址,从0开始
//#define D_EEP_ENC_BLOCK_SIZE 0x20 //ENC_BLOCK_SIZE必须与加密程序中的ENC_BLOCK_SIZE匹配,此处不建议修改,如需修改,请同时修改加密程序
#elif(TYPE_UASER_BOARD == TYPE_BOARD_SMMM_MB_VH032_0E)
xx
#endif
//Step3: >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>IRQ Config
#if ((TYPE_MCU & TYPE_MCU_VENDOR_MSK) == TYPE_MCU_VENDOR_STC)
#define D_SERVE_INT0 interrupt 0
#define D_SERVE_TIMER0 interrupt 1
#define D_SERVE_INT1 interrupt 2
#define D_SERVE_TIMER1 interrupt 3
#define D_SERVE_UART interrupt 4
#define D_SERVE_ADC interrupt 5
#define D_SERVE_LVD interrupt 6
#define D_SERVE_PCA interrupt 7
#define D_SERVE_UART2 interrupt 8
#define D_SERVE_SPI interrupt 9
#define D_SERVE_INT2 interrupt 10
#define D_SERVE_INT3 interrupt 11
#define D_SERVE_TIMER2 interrupt 12
#define D_SERVE_INT4 interrupt 16
#define D_SERVE_UART3 interrupt 17
#define D_SERVE_UART4 interrupt 18
#define D_SERVE_TIMER3 interrupt 19
#define D_SERVE_TIMER4 interrupt 20
#define D_SERVE_CMP interrupt 21
#define D_SERVE_PWM interrupt 22
#define D_SERVE_PWMFD interrupt 23
#define D_SERVE_I2C interrupt 24
#endif
//STEP 3 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<IRQ Config End
//STEP 4 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Cdelay CONFIG
#if(MainFre_5M == D_sys_MainFre)
#define D_Cdelay_200us 20
#define D_Cdelay_1us 1 ////while p21翻转时测定 500k 2us 一个指令
#elif(MainFre_22M == D_sys_MainFre)
#define D_Cdelay_200us 20
#define D_Cdelay_1us 1 ////while p21翻转时测定 500k 2us 一个指令
#define D_Cdelay_1us 1 ////while p21翻转时测定 500k 2us 一个指令
#define L0_delay_1us() Lc_delay_nop(0) // 5个nop() 100ns 50个nop() 1us (20)=10us (2)1.5us
#define L0_delay_10us() Lc_delay_nop(4) // 5个nop() 100ns 50个nop() 1us (20)=10us (2)1.5us
#define L0_delay_40us() Lc_delay_nop(18) // 5个nop() 100ns 50个nop() 1us (20)=10us (2)1.5us
#elif(MainFre_27M == D_sys_MainFre)
#define D_Cdelay_200us 20
#define D_Cdelay_1us 1 ////while p21翻转时测定 500k 2us 一个指令
#else ///MainFre_11M
#define D_Cdelay_200us 20
#define D_Cdelay_1us 1 ////while p21翻转时测定 500k 2us 一个指令
#define L0_delay_1us() Lc_delay_nop(0) // 5个nop() 100ns 50个nop() 1us (20)=10us (2)1.5us
#define L0_delay_10us() Lc_delay_nop(4) // 5个nop() 100ns 50个nop() 1us (20)=10us (2)1.5us
#define L0_delay_40us() Lc_delay_nop(18) // 5个nop() 100ns 50个nop() 1us (20)=10us (2)1.5us
//xx
#endif//D_sys_MainFre)
//STEP 4 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<Cdelay CONFIG End
#endif//_BSP_CONFIG_H
/*********************************end file*********************************************/