完成tft基础功能

This commit is contained in:
forbelief 2016-04-17 10:30:23 +08:00
parent 91399c2e8f
commit b2a5002742
21 changed files with 1036 additions and 480 deletions

View file

@ -1,5 +1,5 @@
/*
* config.h -
* config.h -
*
*/
@ -10,20 +10,20 @@
/*
* 使
* 使
*/
#define SIMULAT_TIMER_PITX PIT1
/*
*
*
*/
#define DEBUG_UARTX UART1
/*
*
*
*/
#define UP_KEY_PINX PTE20
#define DOWN_KEY_PINX PTA17
@ -35,16 +35,16 @@
#define MB_KEY_PINX PTA16
#define MUVB_KEY_PINX PTD6
#define KNOB_A_PINX PTD3
#define KNOB_B_PINX PTD4
#define KNOB_KEY_PINX PTD5
#define KNOB_A_PINX PTD6
#define KNOB_B_PINX PTD7
#define KNOB_KEY_PINX PTD4 // PTD5
/*
*
*
*/
#define TFT_UARTX UART2
#define TFT_UARTX UART2 // PTD2,PTD3

View file

@ -1,5 +1,5 @@
/*
* debug.h -
* debug.h -
*/
#ifndef DEBUG_H
@ -23,21 +23,21 @@ extern volatile float recval_debug_uart[26];
/*
* debug_init() -
* debug_init() -
*/
void debug_init(void);
/*
* str_to_fp() -
* @str:
* @len:
* str_to_fp() -
* @str:
* @len:
*
* c语言标准浮点格式'\0'
* c语言标准浮点格式'\0'
*/
float str_to_fp(char str[], uint8_t len);
/*
* rec_debug_uart() - uart传入的调试信息
* rec_debug_uart() - uart传入的调试信息
*
*/
void rec_debug_uart(void);

View file

@ -1,6 +1,6 @@
/*
* input.h
*
* input.h
*
*/
#ifndef INPUT_H

View file

@ -1,6 +1,6 @@
/* key.h - 监测并采集按键的输入
*
* 使10ms采集一次io状态来实现的
/* key.h - 监测并采集按键的输入
*
* 使10ms采集一次io状态来实现的
*/
#ifndef KEY_H
@ -15,7 +15,7 @@ typedef enum key_mean_
/*
* key_type -
* key_type -
*/
typedef enum key_type_
{
@ -25,31 +25,32 @@ typedef enum key_type_
/*
* key_init() -
* key_init() -
*
*/
void key_init(void);
/*
* key_detect() -
* key_detect() -
*
* 10ms调用一次
* 10ms调用一次
*/
void key_detect(void);
/*
* get_key_mean() -
* get_key_mean() -
*
* N_KEY
* N_KEY
*/
key_mean get_key_mean(key_type key_t);
void clear_key_m(void);

View file

@ -1,7 +1,7 @@
/*
* knob.h -
* knob.h -
*
* 使
* 使
*/
#ifndef KNOB_H
@ -14,41 +14,41 @@
/*
* knob_init() -
* knob_init() -
*
*
*
*/
void knob_init(void);
/*
* knob_enable() - 使
* knob_enable() - 使
*/
void knob_enable(void);
/*
* knob_disable() -
* knob_disable() -
*/
void knob_disable(void);
/*
* knob_clear() -
* knob_clear() -
*/
void knob_clear(void);
/*
* get_knob_val() -
* get_knob_val() -
*/
int32_t get_knob_val(void);
/*
* knob_detect() -
* knob_detect() -
*
* A相输出发生沿跳变时调用沿
* A相输出发生沿跳变时调用沿
*/
void knob_detect(void);

View file

@ -1,9 +1,9 @@
/*
* pm_init.h -
* pm_init.h -
*/
/*
* pm_init() -
* pm_init() -
*/
void pm_init(void);

View file

@ -1,5 +1,5 @@
/*
* simulat_timer.h -
* simulat_timer.h -
*/
#ifndef SIMULAT_TIMER_H
@ -8,7 +8,7 @@
#include <stdint.h>
/*
*
*
*/
#define SIMULAT_TIMER_NUM 3
@ -16,14 +16,14 @@
typedef struct st_register_
{
uint8_t count; // 定时器计数
uint32_t cmr; // 比较寄存器
uint8_t count; // 定时器计数
uint32_t cmr; // 比较寄存器
struct
{
uint8_t ten : 1; // 使能标志
uint8_t tov : 1; // 溢出标志
uint8_t tfc : 1; // 自由运行标志
uint8_t tcf : 1; // 比较标志
uint8_t ten : 1; // 使能标志
uint8_t tov : 1; // 溢出标志
uint8_t tfc : 1; // 自由运行标志
uint8_t tcf : 1; // 比较标志
} flag;
} st_register;
@ -35,55 +35,55 @@ typedef enum st_mode_
} st_mode;
/*
* st_init() - pit定时器
* st_init() - pit定时器
*
* 1ms
* 1ms
*/
void st_base_init(void);
/*
* st_init() -
* @n:
* @st_m:
* @cmr_v:
* st_init() -
* @n:
* @st_m:
* @cmr_v:
*
* 0~0
* 0~0
*/
uint8_t st_init(uint8_t n, st_mode st_m, uint32_t cmr_v);
/*
* st_close() -
* @n:
* st_close() -
* @n:
*/
void st_close(uint8_t n);
/*
* st_tcf() - tcf位返回
* @n:
* st_tcf() - tcf位返回
* @n:
*
* 01
* 01
*/
uint8_t st_tcf(uint8_t n);
/*
* st_tov() - tov位返回
* @n:
* st_tov() - tov位返回
* @n:
*
* 01
* 01
*/
uint8_t st_tov(uint8_t n);
/*
* st_count() -
* @n:
* st_count() -
* @n:
*
*
*
*/
uint32_t st_count(uint8_t n);
@ -92,9 +92,9 @@ uint32_t st_count(uint8_t n);
/********************ISR******************/
/*
* st_base() -N路定时器
* st_base() -N路定时器
*
*
*
*/
void st_base(void);

View file

@ -1,5 +1,5 @@
/*
* tft.h - tft接口
* tft.h - tft½Ó¿Ú
*/
@ -7,8 +7,20 @@
#define TFT_H
typedef struct input_limit_
{
int16_t max;
int16_t min;
} input_limit;
void tft_init(void);
void tft_send_cmd(const char *cmd);
void tft_left(void);
void tft_right(void);
void tft_up(void);
void tft_down(void);
@ -18,6 +30,10 @@ void tft_ok(void);
void tft_ret(void);
int16_t get_value_of_kvp(char *name);
input_limit tft_input_limit(char *name);

View file

@ -0,0 +1,11 @@
/*
* time.h -
*/
#include <stdint.h>
uint8_t is_leapyear(uint16_t year);
uint8_t get_month_days(uint16_t year, uint8_t month);