📄 cyan_base_driver.h
字号:
/******************************************************************************
MODE: AML--#GPS+accelerator+compass
MCU: Cyan eCOG1k
COMPILER: CyanIDE v1.41
FILE NAME: cyan_base_driver head files
******************************************************************************/
#ifndef cyan_base_driver_h
#define cyan_base_driver_h
//----------------------------------------------------------------------------
#ifndef cyan_base_driver_code
#define cyan_base_driver_ext extern
#else
#define cyan_base_driver_ext
#endif //cyan_base_driver_code
/******************************************************************************
include all head files
******************************************************************************/
#include <ecog.h>
#include <ecog1.h>
#include <stdio.h>
#include <assert.h>
#include <string.h>
#include <math.h>
/******************************************************************************
Private constants and types.
******************************************************************************/
#define TIMER2_ENABLE fd.tim.ctrl_en.cnt2_cnt
#define TIMER2_DISABLE fd.tim.ctrl_dis.cnt2_cnt //disable Timer2.
#define TIMER2_LOADING fd.tim.cmd.cnt2_ld //loading value to timer2.
#define T2_LOAD_VALUE 4999 //int time = 5ms
#define TIMER2OUT 4
#define sim300C_RTS_En fd.io.gp24_27_out.en26
#define sim300C_RTS_Dis fd.io.gp24_27_out.dis26
#define sim300C_RTS_Set fd.io.gp24_27_out.set26
#define sim300C_RTS_Clr fd.io.gp24_27_out.clr26
#define sim300C_RTS_Sts fd.io.gp24_28_sts.sts26
//input pin CTS
#define sim300C_CTS_En fd.io.gp24_27_out.en27
#define sim300C_CTS_Dis fd.io.gp24_27_out.dis27
#define sim300C_CTS_Set fd.io.gp24_27_out.set27
#define sim300C_CTS_Clr fd.io.gp24_27_out.clr27
#define sim300C_CTS_Sts fd.io.gp24_28_sts.sts27
#define CTS_INACTIVE 0
#define CTS_ACTIVE 1
/******************************************************************************
bitfield define.
******************************************************************************/
struct
{
unsigned int MOVE_flag;
unsigned int Key_down_flag;
unsigned int bit13;
unsigned int bit12;
}cyan_base_driver_ext Algorithm_flag;
#define MOVE_flag Algorithm_flag.MOVE_flag
#define Key_down_flag Algorithm_flag.Key_down_flag
/******************************************************************************
Global variables.
******************************************************************************/
struct
{
unsigned int GPS_RECEIVE_DONE_FLAG : 4;
unsigned int ACC_RECEIVE_DONE_FLAG : 4;
unsigned int COM_RECEIVE_DONE_FLAG : 4;
unsigned int GPS_error_flag : 4;
}cyan_base_driver_ext routing_flag;
#define GPS_RECEIVE_DONE_FLAG routing_flag.GPS_RECEIVE_DONE_FLAG
#define ACC_RECEIVE_DONE_FLAG routing_flag.ACC_RECEIVE_DONE_FLAG
#define COM_RECEIVE_DONE_FLAG routing_flag.COM_RECEIVE_DONE_FLAG
#define GPS_error_flag routing_flag.GPS_error_flag
/******************************************************************************
Extern function define.
******************************************************************************/
cyan_base_driver_ext void delay_2us(unsigned int us_reg);
cyan_base_driver_ext void delay_ms(unsigned int ms_reg);
cyan_base_driver_ext int putchar(int c);
cyan_base_driver_ext void uart_initialization(void);
cyan_base_driver_ext void timer_initialization(void);
cyan_base_driver_ext char *_fcvt_(char *str_save,double float_data);
cyan_base_driver_ext int getchar_a(void);
/******************************************************************************
end
******************************************************************************/
#endif //cyan_base_driver_h
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -