#ifndef __DEFINEALL_H__
|
#define __DEFINEALL_H__
|
|
//¶¨Òå³£Á¿, ³£Êý
|
|
//ϵͳʱÖÓĬÈÏʹÓÃRCHF
|
#define RCHFCLKCFG 8 //8, 16, 24,32MHZ
|
|
//define_all.hÖÐRCHFCLKCFG¿ØÖÆÏµÍ³Ê±ÖÓ
|
#if( RCHFCLKCFG == 8 )//8.0MHz
|
#define clkmode 1
|
#define SYSCLKdef CMU_RCHFCR_FSEL_8MHZ//RCHFÖÐÐÄÆµÂÊ8MHz
|
#elif( RCHFCLKCFG == 16 )//16.0MHz
|
#define clkmode 2
|
#define SYSCLKdef CMU_RCHFCR_FSEL_16MHZ//RCHFÖÐÐÄÆµÂÊ16MHz
|
#elif( RCHFCLKCFG == 24 )//24.0MHz
|
#define clkmode 3
|
#define SYSCLKdef CMU_RCHFCR_FSEL_24MHZ//RCHFÖÐÐÄÆµÂÊ24MHz
|
#elif( RCHFCLKCFG == 32 )//32.0MHz
|
#define clkmode 4
|
#define SYSCLKdef CMU_RCHFCR_FSEL_32MHZ//RCHFÖÐÐÄÆµÂÊ32MHz
|
#elif( RCHFCLKCFG == 40 )//40.0MHz
|
#define clkmode 5
|
#define SYSCLKdef CMU_RCHFCR_FSEL_40MHZ//RCHFÖÐÐÄÆµÂÊ40MHz
|
#elif( RCHFCLKCFG == 48 )//48.0MHz
|
#define clkmode 6
|
#define SYSCLKdef CMU_RCHFCR_FSEL_48MHZ//RCHFÖÐÐÄÆµÂÊ48MHz
|
#endif
|
|
/*±äÁ¿ÀàÐͶ¨Òå*/
|
typedef union
|
{
|
unsigned char B08;
|
struct
|
{
|
unsigned char bit0:1;
|
unsigned char bit1:1;
|
unsigned char bit2:1;
|
unsigned char bit3:1;
|
unsigned char bit4:1;
|
unsigned char bit5:1;
|
unsigned char bit6:1;
|
unsigned char bit7:1;
|
}Bit;
|
}B08_Bit;
|
|
typedef enum
|
{
|
SUCCESS_0 = 0U,
|
ERROR_1 = !SUCCESS_0
|
} ErrorStatus_STM32;
|
|
#define uint08 uint8_t
|
#define uint16 uint16_t
|
#define uint32 uint32_t
|
#define int08 int8_t
|
#define int16 int16_t
|
#define int32 int32_t
|
|
|
/* GPIOÅäÖú¯Êý²ÎÊýºê¶¨Òå */
|
//IOÊäÈë¿ÚÅäÖÃ
|
//type 0 = ÆÕͨ
|
//type 1 = ÉÏÀ
|
#define IN_NORMAL 0
|
#define IN_PULLUP 1
|
|
//IOÊä³ö¿ÚÅäÖÃ
|
//type 0 = ÆÕͨ
|
//type 1 = OD
|
#define OUT_PUSHPULL 0
|
#define OUT_OPENDRAIN 1
|
|
//IOÊý×ÖÌØÊ⹦ÄÜ¿Ú
|
//type 0 = ÆÕͨ
|
//type 1 = OD (OD¹¦Äܽö²¿·ÖÌØÊ⹦ÄÜÖ§³Ö)
|
//type 2 = ÆÕͨ+ÉÏÀ
|
//type 3 = OD+ÉÏÀ
|
#define ALTFUN_NORMAL 0
|
#define ALTFUN_OPENDRAIN 1
|
#define ALTFUN_PULLUP 2
|
#define ALTFUN_OPENDRAIN_PULLUP 3
|
|
|
/*include*/
|
#include "FM33A0XXEV.h"
|
#include "fm33a0xxev_include_all.h"
|
#include <stdio.h>
|
#include <stdint.h>
|
#include <stdlib.h>
|
#include <string.h>
|
#include "bintohex.h"
|
#include "user_init.h"
|
#include "delay.h"
|
|
#endif
|