This commit is contained in:
42
app/by_buzzer.c
Normal file
42
app/by_buzzer.c
Normal file
@@ -0,0 +1,42 @@
|
||||
#include "by_buzzer.h"
|
||||
#include "by_rt_button.h"
|
||||
|
||||
#include "zf_common_headfile.h"
|
||||
#include <string.h>
|
||||
|
||||
uint16_t queue_long = 0;
|
||||
const uint32_t max_long = 40;
|
||||
uint32_t a[40];
|
||||
void queue_init(void)
|
||||
{
|
||||
memset(a, 0, sizeof(a));
|
||||
}
|
||||
|
||||
void queue_add_element(int element)
|
||||
{
|
||||
if (queue_long < max_long) {
|
||||
a[queue_long] = element;
|
||||
queue_long += 1;
|
||||
}
|
||||
}
|
||||
void queue_pop_element(void)
|
||||
{
|
||||
memmove(a, &a[1], queue_long * sizeof(a));
|
||||
if (queue_long > 0) {
|
||||
queue_long--;
|
||||
}
|
||||
}
|
||||
void queue_pop_read(void)
|
||||
{
|
||||
while (queue_long != 0) {
|
||||
pwm_init(TIM8_PWM_MAP0_CH1_C6, a[0], 5000);
|
||||
queue_pop_element();
|
||||
system_delay_ms(100);
|
||||
pwm_set_duty(TIM8_PWM_MAP0_CH1_C6, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void by_buzzer_init(void)
|
||||
{
|
||||
pwm_init(TIM8_PWM_MAP0_CH1_C6, 2000, 0);
|
||||
}
|
||||
24
app/by_buzzer.h
Normal file
24
app/by_buzzer.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef _BY_BUZZER_H__
|
||||
#define _BY_BUZZER_H__
|
||||
|
||||
#include "by_rt_button.h"
|
||||
|
||||
#include "stdio.h"
|
||||
#include "ch32v30x.h"
|
||||
|
||||
#define BY_PRESS_SHORT 2000
|
||||
#define BY_PRESS_LONG 2500
|
||||
#define BY_FORWARD 1500
|
||||
#define BY_BACKWARD 1800
|
||||
|
||||
extern void by_buzzer_init(void);
|
||||
extern void queue_init(void);
|
||||
extern void queue_add_element(int element);
|
||||
extern void queue_pop_element(void);
|
||||
extern void queue_pop_read(void);
|
||||
|
||||
extern uint32_t a[40];
|
||||
extern uint16_t queue_long;
|
||||
extern const uint32_t max_long;
|
||||
extern uint8_t queue_flag;
|
||||
#endif
|
||||
12
app/isr.c
12
app/isr.c
@@ -36,6 +36,9 @@
|
||||
#include "zf_common_headfile.h"
|
||||
#include "by_rt_button.h"
|
||||
#include "by_imu.h"
|
||||
#include "jj_blueteeth.h"
|
||||
#include "by_buzzer.h"
|
||||
#include "jj_blueteeth.h"
|
||||
|
||||
void NMI_Handler(void) __attribute__((interrupt()));
|
||||
void HardFault_Handler(void) __attribute__((interrupt()));
|
||||
@@ -90,7 +93,8 @@ void USART1_IRQHandler(void)
|
||||
void USART2_IRQHandler(void)
|
||||
{
|
||||
if (USART_GetITStatus(USART2, USART_IT_RXNE) != RESET) {
|
||||
|
||||
uart_query_byte(UART_2, &bt_buffer);
|
||||
bt_rx_flag = true;
|
||||
USART_ClearITPendingBit(USART2, USART_IT_RXNE);
|
||||
}
|
||||
}
|
||||
@@ -199,9 +203,10 @@ void EXTI9_5_IRQHandler(void)
|
||||
|
||||
if (SET == gpio_get_level(E10)) {
|
||||
rotate_button = rotate_button_backward;
|
||||
|
||||
queue_add_element(BY_BACKWARD);
|
||||
} else {
|
||||
rotate_button = rotate_button_forward;
|
||||
queue_add_element(BY_FORWARD);
|
||||
}
|
||||
EXTI_ClearITPendingBit(EXTI_Line9);
|
||||
}
|
||||
@@ -227,8 +232,11 @@ void EXTI15_10_IRQHandler(void)
|
||||
time_via = system_get_tick() - time_via;
|
||||
if (time_via > LONG_PRESS_THRESHOLD_TICK) {
|
||||
rotate_button = rotate_button_press_long;
|
||||
queue_add_element(BY_PRESS_LONG);
|
||||
|
||||
} else {
|
||||
rotate_button = rotate_button_press_short;
|
||||
queue_add_element(BY_PRESS_SHORT);
|
||||
}
|
||||
time_via = 0;
|
||||
EXTI_ClearITPendingBit(EXTI_Line11);
|
||||
|
||||
51
app/jj_blueteeth.c
Normal file
51
app/jj_blueteeth.c
Normal file
@@ -0,0 +1,51 @@
|
||||
#include "jj_blueteeth.h"
|
||||
|
||||
bool bt_rx_flag = false;
|
||||
uint8 bt_buffer;//接收字符存入
|
||||
|
||||
enum bt_order {
|
||||
Start_work = 0x01,
|
||||
Turn_Left = 0x02,
|
||||
Turn_Right = 0x03,
|
||||
Speed_up = 0x04,
|
||||
Speed_down = 0x05,
|
||||
};
|
||||
/**
|
||||
* @brief 蓝牙初始化
|
||||
* @retval 无
|
||||
*/
|
||||
void jj_bt_init()
|
||||
{
|
||||
uart_init(UART_2, 115200, UART2_MAP1_TX_D5, UART2_MAP1_RX_D6);
|
||||
// uart_tx_interrupt(UART_2, 1);
|
||||
uart_rx_interrupt(UART_2, ENABLE);
|
||||
}
|
||||
/**
|
||||
*@brief 蓝牙中断回调函数
|
||||
*/
|
||||
void jj_bt_run()
|
||||
{
|
||||
if (bt_rx_flag) {
|
||||
switch (bt_buffer) {
|
||||
case Start_work:
|
||||
printf("1\r\n");
|
||||
break;
|
||||
case Turn_Left:
|
||||
printf("2\r\n");
|
||||
break;
|
||||
case Turn_Right:
|
||||
printf("3\r\n");
|
||||
break;
|
||||
case Speed_down:
|
||||
printf("5\r\n");
|
||||
break;
|
||||
case Speed_up:
|
||||
printf("4\r\n");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
uart_write_byte(UART_2,bt_buffer);
|
||||
bt_rx_flag = false;
|
||||
}
|
||||
}
|
||||
12
app/jj_blueteeth.h
Normal file
12
app/jj_blueteeth.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#ifndef _JJ_BLUETEETH_H_
|
||||
#define _JJ_BLUETEETH_H_
|
||||
|
||||
#include "zf_common_headfile.h"
|
||||
#include "zf_driver_uart.h"
|
||||
|
||||
extern bool bt_rx_flag;
|
||||
extern uint8 bt_buffer;
|
||||
void jj_bt_init();
|
||||
void jj_bt_run();
|
||||
|
||||
#endif
|
||||
72
app/jj_param.c
Normal file
72
app/jj_param.c
Normal file
@@ -0,0 +1,72 @@
|
||||
#include "jj_param.h"
|
||||
#include "./page/page_ui_widget.h"
|
||||
#include "./page/page.h"
|
||||
|
||||
PARAM_INFO Param_Data[DATA_NUM];
|
||||
soft_iic_info_struct eeprom_param;
|
||||
TYPE_UNION iic_buffer[DATA_IN_FLASH_NUM];
|
||||
|
||||
float data0 = 10.0f;
|
||||
float data1 = 10.0f;
|
||||
float data2 = 15;
|
||||
float data3 = 100.01f;
|
||||
float data4 = 1.04f;
|
||||
float data5 = 4.0f;
|
||||
float data6 = 5.1f;
|
||||
void jj_param_eeprom_init()
|
||||
{
|
||||
soft_iic_init(&eeprom_param, K24C02_DEV_ADDR, K24C02_SOFT_IIC_DELAY, K24C02_SCL_PIN, K24C02_SDA_PIN); // eeprom初始化
|
||||
PARAM_REG(DATA0, &data0, EFLOAT, 1, "m0_p"); // 注冊
|
||||
PARAM_REG(DATA1, &data1, EFLOAT, 1, "m1_p"); // 注冊
|
||||
PARAM_REG(DATA2, &data2, EFLOAT, 1, "m1_i"); // 注冊
|
||||
PARAM_REG(DATA3, &data3, EFLOAT, 1, "m1_d"); // 注冊
|
||||
PARAM_REG(DATA4, &data4, EFLOAT, 1, "m2_p"); // 注冊
|
||||
PARAM_REG(DATA5, &data5, EFLOAT, 1, "m2_i"); // 注冊
|
||||
PARAM_REG(DATA6, &data6, EFLOAT, 1, "m2_d"); // 注冊
|
||||
|
||||
for (uint8 i = 0; i < DATA_IN_FLASH_NUM ; i++) {
|
||||
|
||||
soft_iic_read_8bit_registers(&eeprom_param, 4*i, (uint8 *)&iic_buffer[i], 4);
|
||||
switch (Param_Data[i].type) {
|
||||
case EFLOAT:
|
||||
*((float *)(Param_Data[i].p_data)) =
|
||||
iic_buffer[i].f32;
|
||||
break;
|
||||
case EUINT32:
|
||||
*((uint32 *)(Param_Data[i].p_data)) =
|
||||
iic_buffer[i].u32;
|
||||
break;
|
||||
case EINT32:
|
||||
*((int32 *)(Param_Data[i].p_data)) =
|
||||
iic_buffer[i].s32;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
system_delay_ms(10);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @brief 参数更新
|
||||
*
|
||||
*/
|
||||
void jj_param_update()
|
||||
{
|
||||
for (uint8 i = 0; i < DATA_IN_FLASH_NUM; i++) {
|
||||
switch (Param_Data[i].type) {
|
||||
case EFLOAT:
|
||||
iic_buffer[i].f32 = *((float *)(Param_Data[i].p_data));
|
||||
break;
|
||||
case EUINT32:
|
||||
iic_buffer[i].u32 = *((uint32 *)(Param_Data[i].p_data));
|
||||
break;
|
||||
case EINT32:
|
||||
iic_buffer[i].s32 = *((int32 *)(Param_Data[i].p_data));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
soft_iic_write_8bit_registers(&eeprom_param, 4*i , (uint8 *)&iic_buffer[i], 4);
|
||||
system_delay_ms(10);
|
||||
}
|
||||
}
|
||||
57
app/jj_param.h
Normal file
57
app/jj_param.h
Normal file
@@ -0,0 +1,57 @@
|
||||
#ifndef _JJ_PARAM_H_
|
||||
#define _JJ_PARAM_H_
|
||||
|
||||
#include "zf_common_headfile.h"
|
||||
/**
|
||||
* @brief 注册需调参数
|
||||
*
|
||||
*/
|
||||
#define PARAM_REG(_data_tag_, _p_data_, _type_, _cmd_,_text_) \
|
||||
Param_Data[_data_tag_].p_data = (void *)_p_data_; \
|
||||
Param_Data[_data_tag_].type = _type_; \
|
||||
Param_Data[_data_tag_].cmd = _cmd_; \
|
||||
Param_Data[_data_tag_].text = _text_;
|
||||
|
||||
typedef enum {
|
||||
DATA_HEAD = -1,
|
||||
DATA0,
|
||||
DATA1,
|
||||
DATA2,
|
||||
DATA3,
|
||||
DATA4,
|
||||
|
||||
//
|
||||
DATA5,
|
||||
DATA6,
|
||||
DATA_IN_FLASH_NUM,
|
||||
DATA_NUM,
|
||||
} data_tag_t;
|
||||
|
||||
typedef enum {
|
||||
EUINT32,
|
||||
EINT32,
|
||||
EFLOAT,
|
||||
}ENUM_TYPE;
|
||||
|
||||
typedef union{
|
||||
uint32 u32;
|
||||
int32 s32;
|
||||
float f32;
|
||||
uint8 u8;
|
||||
}TYPE_UNION;
|
||||
|
||||
typedef struct {
|
||||
void *p_data;
|
||||
ENUM_TYPE type;
|
||||
uint8 cmd;
|
||||
char *text;
|
||||
}PARAM_INFO;
|
||||
|
||||
extern soft_iic_info_struct eeprom_param;
|
||||
extern PARAM_INFO Param_Data[DATA_NUM];
|
||||
extern TYPE_UNION iic_buffer[DATA_IN_FLASH_NUM];
|
||||
extern float data1;
|
||||
void jj_param_eeprom_init();
|
||||
void jj_param_update();
|
||||
void jj_param_show();
|
||||
#endif
|
||||
19
app/main.c
19
app/main.c
@@ -21,12 +21,14 @@
|
||||
* 许可证副本在 libraries 文件夹下 即该文件夹下的 LICENSE 文件
|
||||
* 欢迎各位使用并传播本程序 但修改内容时必须保留逐飞科技的版权声明(即本声明)
|
||||
********************************************************************************************************************/
|
||||
#include "zf_common_headfile.h"
|
||||
#include "gl_headfile.h"
|
||||
#include "by_rt_button.h"
|
||||
#include "by_fan_control.h"
|
||||
#include "./page/cw_page.h"
|
||||
#include "./page/cw_page_ui_widget.h"
|
||||
#include "./page/page.h"
|
||||
#include "jj_blueteeth.h"
|
||||
#include "jj_param.h"
|
||||
#include "./page/page_ui_widget.h"
|
||||
#include "by_buzzer.h"
|
||||
|
||||
int main(void)
|
||||
{
|
||||
@@ -39,16 +41,19 @@ int main(void)
|
||||
by_gpio_init();
|
||||
by_exit_init();
|
||||
by_pwm_init();
|
||||
jj_bt_init();
|
||||
by_buzzer_init();
|
||||
// while (imu660ra_init())
|
||||
// ;
|
||||
|
||||
// system_delay_ms(2000);
|
||||
// gyroOffset_init();
|
||||
// pit_ms_init(TIM6_PIT, 2);
|
||||
jj_param_eeprom_init();
|
||||
Page_Init();
|
||||
|
||||
while (1) {
|
||||
|
||||
Page_Run();
|
||||
jj_bt_run();
|
||||
queue_pop_read();
|
||||
|
||||
if (mt9v03x_finish_flag) {
|
||||
// 该操作消耗大概 1970 个 tick,折合约 110us
|
||||
memcpy(mt9v03x_image_copy[0], mt9v03x_image[0], (sizeof(mt9v03x_image_copy) / sizeof(uint8_t)));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "cw_page.h"
|
||||
#include "page.h"
|
||||
|
||||
#include "by_rt_button.h"
|
||||
|
||||
@@ -89,7 +89,7 @@ uint8_t Page_GetStatus(void)
|
||||
*/
|
||||
void Page_Run(void)
|
||||
{
|
||||
uint8_t temp_status = by_get_rb_status(); // 轮询旋钮状态
|
||||
uint8_t temp_status = by_get_rb_status(); // 轮询旋钮状态
|
||||
if(temp_status){
|
||||
pagelist[now_page].EventCallback(temp_status);
|
||||
}
|
||||
@@ -118,13 +118,14 @@ void Page_Run(void)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 页面初始化(注册,构建) //ATTENTION 在此处添加新加入的页面
|
||||
* @brief 页面初始化(注册,构建) ATTENTION 在此处添加新加入的页面
|
||||
*
|
||||
*/
|
||||
void Page_Init(void)
|
||||
{
|
||||
PAGE_REG(page_menu);
|
||||
PAGE_REG(page_rtcam);
|
||||
PAGE_REG(page_param);
|
||||
// PAGE_REG(page_argv);
|
||||
// PAGE_REG(page_sys);
|
||||
// PAGE_REG(page_run);
|
||||
@@ -20,6 +20,7 @@ enum PageID {
|
||||
//......
|
||||
page_menu,
|
||||
page_rtcam,
|
||||
page_param,
|
||||
// page_argv,
|
||||
// page_sys,
|
||||
// page_run,
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "zf_common_headfile.h"
|
||||
#include "cw_page_ui_widget.h"
|
||||
#include "cw_page.h"
|
||||
#include "page_ui_widget.h"
|
||||
#include "page.h"
|
||||
|
||||
#define LINE_HEAD 1
|
||||
#define LINE_END 7
|
||||
@@ -25,7 +25,7 @@ static void Setup()
|
||||
{
|
||||
ips200_clear();
|
||||
Print_Menu_p();
|
||||
Print_Curser(Curser, Curser_Last);
|
||||
Print_Curser(Curser, Curser_Last,RGB565_PURPLE);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -72,7 +72,7 @@ static void Event(page_event event)
|
||||
Curser = LINE_HEAD;
|
||||
}
|
||||
|
||||
Print_Curser(Curser, Curser_Last);
|
||||
Print_Curser(Curser, Curser_Last,RGB565_PURPLE);
|
||||
}
|
||||
|
||||
/**
|
||||
126
app/page/page_param.c
Normal file
126
app/page/page_param.c
Normal file
@@ -0,0 +1,126 @@
|
||||
#include "jj_param.h"
|
||||
#include "page_ui_widget.h"
|
||||
#include "page.h"
|
||||
|
||||
#define LINE_HEAD 0
|
||||
#define LINE_END DATA_NUM - 2
|
||||
static char Text[] = "RealTime Param";
|
||||
int event_flag = 0;
|
||||
static int8_t Curser = LINE_HEAD; // 定义光标位置
|
||||
static int8_t Curser_Last = LINE_HEAD; // 定义光标位置
|
||||
void jj_param_show();
|
||||
/***************************************************************************************
|
||||
*
|
||||
* 以下为页面模板函数
|
||||
*
|
||||
***************************************************************************************/
|
||||
/**
|
||||
* @brief 页面初始化事件
|
||||
* @param 无
|
||||
* @retval 无
|
||||
*/
|
||||
static void Setup()
|
||||
{
|
||||
ips200_clear();
|
||||
Print_Curser(Curser, Curser_Last, RGB565_PURPLE);
|
||||
for (int16 i = 0; i < DATA_NUM - 1; i++) {
|
||||
ips200_show_string(10, i * 18 + 2, Param_Data[i].text);
|
||||
if (Param_Data[i].type == EINT32)
|
||||
ips200_show_int(50, i * 18 + 2, *((int32 *)(Param_Data[i].p_data)), 5);
|
||||
else if (Param_Data[i].type == EFLOAT)
|
||||
ips200_show_float(50, i * 18 + 2, *((float *)(Param_Data[i].p_data)), 4, 5);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 页面退出事件
|
||||
* @param 无
|
||||
* @retval 无
|
||||
*/
|
||||
static void Exit()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 页面循环执行的内容
|
||||
* @param 无
|
||||
* @retval 无
|
||||
*/
|
||||
static void Loop()
|
||||
{
|
||||
}
|
||||
/**
|
||||
* @brief 页面事件
|
||||
* @param btn:发出事件的按键
|
||||
* @param event:事件编号
|
||||
* @retval 无
|
||||
*/
|
||||
static void Event(page_event event)
|
||||
{
|
||||
|
||||
if (0 == event_flag) {
|
||||
|
||||
Curser_Last = Curser;
|
||||
if (page_event_forward == event) {
|
||||
Curser--; // 光标上移
|
||||
} else if (page_event_backward == event) {
|
||||
Curser++; // 光标下移
|
||||
} else if (page_event_press_short == event) {
|
||||
event_flag = 1; // 选中参数
|
||||
Print_Curser(Curser, Curser_Last, RGB565_RED);
|
||||
return;
|
||||
} else if (page_event_press_long == event) {
|
||||
jj_param_update();
|
||||
Page_Shift(page_menu);
|
||||
return;
|
||||
}
|
||||
if (Curser < LINE_HEAD) {
|
||||
Curser = LINE_END;
|
||||
} else if (Curser > LINE_END) {
|
||||
Curser = LINE_HEAD;
|
||||
}
|
||||
Print_Curser(Curser, Curser_Last, RGB565_PURPLE);
|
||||
} else if (1 == event_flag) {
|
||||
if (page_event_forward == event) {
|
||||
if (Param_Data[Curser].type == EFLOAT) {
|
||||
*((float *)(Param_Data[Curser].p_data)) += 0.01f;
|
||||
} else if (Param_Data[Curser].type == EINT32) {
|
||||
*((int32 *)(Param_Data[Curser].p_data)) += 1;
|
||||
} else if (Param_Data[Curser].type == EUINT32) {
|
||||
*((uint32 *)(Param_Data[Curser].p_data)) += 1;
|
||||
}
|
||||
} else if (page_event_backward == event) {
|
||||
if (Param_Data[Curser].type == EFLOAT) {
|
||||
*((float *)(Param_Data[Curser].p_data)) -= 0.01f;
|
||||
} else if (Param_Data[Curser].type == EINT32) {
|
||||
*((int32 *)(Param_Data[Curser].p_data)) -= 1;
|
||||
} else if (Param_Data[Curser].type == EUINT32) {
|
||||
*((uint32 *)(Param_Data[Curser].p_data)) -= 1;
|
||||
}
|
||||
} else if (page_event_press_short == event) {
|
||||
|
||||
} else if (page_event_press_long == event) {
|
||||
event_flag = 0;
|
||||
Print_Curser(Curser, Curser_Last, RGB565_PURPLE);
|
||||
}
|
||||
jj_param_show();
|
||||
}
|
||||
}
|
||||
void jj_param_show()
|
||||
{
|
||||
if (EINT32 == Param_Data[Curser].type)
|
||||
ips200_show_int(50, Curser * 18 + 2, *((int32 *)(Param_Data[Curser].p_data)), 5);
|
||||
else if (EUINT32 == Param_Data[Curser].type)
|
||||
ips200_show_uint(50, Curser * 18 + 2, *((int32 *)(Param_Data[Curser].p_data)), 5);
|
||||
else if (EFLOAT == Param_Data[Curser].type)
|
||||
ips200_show_float(50, Curser * 18 + 2, *((float *)(Param_Data[Curser].p_data)), 4, 5);
|
||||
}
|
||||
/**
|
||||
* @brief 页面注册函数
|
||||
*
|
||||
* @param pageID
|
||||
*/
|
||||
void PageRegister_page_param(unsigned char pageID)
|
||||
{
|
||||
Page_Register(pageID, Text, Setup, Loop, Exit, Event);
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "zf_common_headfile.h"
|
||||
#include "cw_page_ui_widget.h"
|
||||
#include "cw_page.h"
|
||||
#include "page_ui_widget.h"
|
||||
#include "page.h"
|
||||
|
||||
#define LINE_HEAD 11
|
||||
#define LINE_END 16
|
||||
@@ -23,7 +23,7 @@ static int8_t Curser_Last = LINE_HEAD; // 定义光标位置
|
||||
static void Setup()
|
||||
{
|
||||
ips200_clear();
|
||||
Print_Curser(Curser, Curser_Last);
|
||||
Print_Curser(Curser, Curser_Last,RGB565_PURPLE);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -71,7 +71,7 @@ static void Event(page_event event)
|
||||
Curser = LINE_HEAD;
|
||||
}
|
||||
|
||||
Print_Curser(Curser, Curser_Last);
|
||||
Print_Curser(Curser, Curser_Last,RGB565_PURPLE);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "cw_page_ui_widget.h"
|
||||
#include "page_ui_widget.h"
|
||||
#include "zf_common_headfile.h"
|
||||
#include "gl_data.h"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* @param Curser_In 当前光标位置
|
||||
* @param Curser_Last_In 上一时刻光标位置
|
||||
*/
|
||||
void Print_Curser(uint8_t Curser_In, uint8_t Curser_Last_In)
|
||||
void Print_Curser(uint8_t Curser_In, uint8_t Curser_Last_In,uint16_t color)
|
||||
{
|
||||
// ips200_show_string(0, Curser_Last_In * 18, " ");
|
||||
// ips200_show_string(0, Curser_In * 18, ">");
|
||||
@@ -20,7 +20,7 @@ void Print_Curser(uint8_t Curser_In, uint8_t Curser_Last_In)
|
||||
|
||||
ips200_draw_rect(10, Curser_Last_In * 18 + 19, 170, Curser_Last_In * 18 + 19, IPS200_DEFAULT_BGCOLOR);
|
||||
for (uint8_t i = 0; i < 160; i++) {
|
||||
ips200_draw_point(10 + i, Curser_In * 18 + 19, RGB565_PURPLE);
|
||||
ips200_draw_point(10 + i, Curser_In * 18 + 19, color);
|
||||
system_delay_ms(1);
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ typedef struct {
|
||||
uint8_t data_tag; // 变量结构体
|
||||
} ITEM;
|
||||
|
||||
void Print_Curser(uint8_t Curser_In, uint8_t Curser_Last_In);
|
||||
void Print_Curser(uint8_t Curser_In, uint8_t Curser_Last_In,uint16_t color);
|
||||
void Print_Menu(const ITEM *item, uint8_t item_sum);
|
||||
void Print_Value(const ITEM *item, uint8_t item_sum);
|
||||
void Set_Vaule(ITEM *item, uint8_t item_num, float step);
|
||||
@@ -54,8 +54,8 @@
|
||||
#if K24C02_USE_SOFT_IIC // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD><EFBFBD><EFBFBD>ȷ<EFBFBD><C8B7> <20><>ɫ<EFBFBD>ҵľ<D2B5><C4BE><EFBFBD>û<EFBFBD><C3BB><EFBFBD>õ<EFBFBD>
|
||||
//====================================================<3D><><EFBFBD><EFBFBD> IIC <20><><EFBFBD><EFBFBD>====================================================
|
||||
#define K24C02_SOFT_IIC_DELAY (500) // <20><><EFBFBD><EFBFBD> IIC <20><>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD> <20><>ֵԽС IIC ͨ<><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Խ<EFBFBD><D4BD>
|
||||
#define K24C02_SCL_PIN (B10 ) // <20><><EFBFBD><EFBFBD> IIC SCL <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> K24C02 <20><> SCL <20><><EFBFBD><EFBFBD>
|
||||
#define K24C02_SDA_PIN (B11 ) // <20><><EFBFBD><EFBFBD> IIC SDA <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> K24C02 <20><> SDA <20><><EFBFBD><EFBFBD>
|
||||
#define K24C02_SCL_PIN (E3) // <20><><EFBFBD><EFBFBD> IIC SCL <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> K24C02 <20><> SCL <20><><EFBFBD><EFBFBD>
|
||||
#define K24C02_SDA_PIN (E2 ) // <20><><EFBFBD><EFBFBD> IIC SDA <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> K24C02 <20><> SDA <20><><EFBFBD><EFBFBD>
|
||||
//====================================================<3D><><EFBFBD><EFBFBD> IIC <20><><EFBFBD><EFBFBD>====================================================
|
||||
#else
|
||||
//====================================================Ӳ<><D3B2> IIC <20><><EFBFBD><EFBFBD>====================================================
|
||||
|
||||
Reference in New Issue
Block a user