图标主题 AwOken 2.5 发布 – 支持 Ubuntu 13.04 并新增新图标

无论使用的文本编辑器,视频编辑器,电子书阅读器,文件管理器等,用户总是面临各种图标,视觉上的项目,有潜力的桌面美化包。AwOken是一款有趣的图标主题,非常具有现代感,好看的形状、颜色、图案,为用户桌面提供一个优雅,整洁的外观和感觉。

awoken 25

AwOken已更新到新版本 2.5版本,这是一个很有意义的版本,引入无数的变化和改进,如:

超过500个图标重新修改,更加具有风韵
新的Ubuntu One图标
新的聊天表情符号
支持新的应用,如GNOME文件,Gnometris,GNOME游戏,GNOME Boxes,GNOME Disks等
超过200个新的符号图标
超过400个图标重新设计,并刷新
此外,新发布的AwOken配备了期待已久Ubuntu 13.04和Ubuntu12.10支持,因此,用户在多个Ubuntu的版本中安装该图标。

安装图标主题:
添加官方 PPA (支持Oneiric, Precise, Quantal, Raring用户)

sudo add-apt-repository ppa:alecive/antigone
sudo apt-get update
sudo apt-get install awoken-icon-theme



转载地址:http://imcn.me/html/y2013/13875.html

/* * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: CC0-1.0 */ #include <stdio.h> #include <inttypes.h> #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "freertos/queue.h" #include "esp_log.h" #include "driver/touch_pad.h" static const char *TAG = "Touch pad"; static QueueHandle_t que_touch = NULL; typedef struct touch_msg { touch_pad_intr_mask_t intr_mask; uint32_t pad_num; uint32_t pad_status; uint32_t pad_val; } touch_event_t; #define TOUCH_BUTTON_NUM 4 #define TOUCH_BUTTON_WATERPROOF_ENABLE 1 #define TOUCH_BUTTON_DENOISE_ENABLE 1 #define TOUCH_CHANGE_CONFIG 0 static const touch_pad_t button[TOUCH_BUTTON_NUM] = { TOUCH_PAD_NUM7, // 'SELECT' button. TOUCH_PAD_NUM9, // 'MENU' button. TOUCH_PAD_NUM11, // 'BACK' button. TOUCH_PAD_NUM13, // Guard ring for waterproof design. // If this pad be touched, other pads no response. }; /* * Touch threshold. The threshold determines the sensitivity of the touch. * This threshold is derived by testing changes in readings from different touch channels. * If (raw_data - benchmark) > benchmark * threshold, the pad be activated. * If (raw_data - benchmark) < benchmark * threshold, the pad be inactivated. */ static const float button_threshold[TOUCH_BUTTON_NUM] = { 0.2, // 20%. 0.2, // 20%. 0.2, // 20%. 0.1, // 10%. }; /* Handle an interrupt triggered when a pad is touched. Recognize what pad has been touched and save it in a table. */ static void touchsensor_interrupt_cb(void *arg) { int task_awoken = pdFALSE; touch_event_t evt; evt.intr_mask = touch_pad_read_intr_status_mask(); evt.pad_status = touch_pad_get_status(); evt.pad_num = touch_pad_get_current_meas_channel(); xQueueSendFromISR(que_touch, &evt, &task_awoken); if (task_awoken == pdTRUE) { portYIELD_FROM_ISR(); } } static void tp_example_set_thresholds(void) { uint32_t touch_value; for (int i = 0; i < TOUCH_BUTTON_NUM; i++) { //read benchmark value touch_pad_read_benchmark(button[i], &touch_value); //set interrupt threshold. touch_pad_set_thresh(button[i], touch_value * button_threshold[i]); ESP_LOGI(TAG, "touch pad [%d] base %"PRIu32", thresh %"PRIu32, \ button[i], touch_value, (uint32_t)(touch_value * button_threshold[i])); } } static void touchsensor_filter_set(touch_filter_mode_t mode) { /* Filter function */ touch_filter_config_t filter_info = { .mode = mode, // Test jitter and filter 1/4. .debounce_cnt = 1, // 1 time count. .noise_thr = 0, // 50% .jitter_step = 4, // use for jitter mode. .smh_lvl = TOUCH_PAD_SMOOTH_IIR_2, }; touch_pad_filter_set_config(&filter_info); touch_pad_filter_enable(); ESP_LOGI(TAG, "touch pad filter init"); } static void tp_example_read_task(void *pvParameter) { touch_event_t evt = {0}; static uint8_t guard_mode_flag = 0; /* Wait touch sensor init done */ vTaskDelay(50 / portTICK_PERIOD_MS); tp_example_set_thresholds(); while (1) { int ret = xQueueReceive(que_touch, &evt, (TickType_t)portMAX_DELAY); if (ret != pdTRUE) { continue; } if (evt.intr_mask & TOUCH_PAD_INTR_MASK_ACTIVE) { /* if guard pad be touched, other pads no response. */ if (evt.pad_num == button[3]) { guard_mode_flag = 1; ESP_LOGW(TAG, "TouchSensor [%"PRIu32"] be activated, enter guard mode", evt.pad_num); } else { if (guard_mode_flag == 0) { ESP_LOGI(TAG, "TouchSensor [%"PRIu32"] be activated, status mask 0x%"PRIu32"", evt.pad_num, evt.pad_status); } else { ESP_LOGW(TAG, "In guard mode. No response"); } } } if (evt.intr_mask & TOUCH_PAD_INTR_MASK_INACTIVE) { /* if guard pad be touched, other pads no response. */ if (evt.pad_num == button[3]) { guard_mode_flag = 0; ESP_LOGW(TAG, "TouchSensor [%"PRIu32"] be inactivated, exit guard mode", evt.pad_num); } else { if (guard_mode_flag == 0) { ESP_LOGI(TAG, "TouchSensor [%"PRIu32"] be inactivated, status mask 0x%"PRIu32, evt.pad_num, evt.pad_status); } } } if (evt.intr_mask & TOUCH_PAD_INTR_MASK_SCAN_DONE) { ESP_LOGI(TAG, "The touch sensor group measurement is done [%"PRIu32"].", evt.pad_num); } if (evt.intr_mask & TOUCH_PAD_INTR_MASK_TIMEOUT) { /* Add your exception handling in here. */ ESP_LOGI(TAG, "Touch sensor channel %"PRIu32" measure timeout. Skip this exception channel!!", evt.pad_num); touch_pad_timeout_resume(); // Point on the next channel to measure. } } } void app_main(void) { if (que_touch == NULL) { que_touch = xQueueCreate(TOUCH_BUTTON_NUM, sizeof(touch_event_t)); } // Initialize touch pad peripheral, it will start a timer to run a filter ESP_LOGI(TAG, "Initializing touch pad"); /* Initialize touch pad peripheral. */ touch_pad_init(); for (int i = 0; i < TOUCH_BUTTON_NUM; i++) { touch_pad_config(button[i]); } #if TOUCH_CHANGE_CONFIG /* If you want change the touch sensor default setting, please write here(after initialize). There are examples: */ touch_pad_set_measurement_interval(TOUCH_PAD_SLEEP_CYCLE_DEFAULT); touch_pad_set_charge_discharge_times(TOUCH_PAD_MEASURE_CYCLE_DEFAULT); touch_pad_set_voltage(TOUCH_PAD_HIGH_VOLTAGE_THRESHOLD, TOUCH_PAD_LOW_VOLTAGE_THRESHOLD, TOUCH_PAD_ATTEN_VOLTAGE_THRESHOLD); touch_pad_set_idle_channel_connect(TOUCH_PAD_IDLE_CH_CONNECT_DEFAULT); for (int i = 0; i < TOUCH_BUTTON_NUM; i++) { touch_pad_set_cnt_mode(button[i], TOUCH_PAD_SLOPE_DEFAULT, TOUCH_PAD_TIE_OPT_DEFAULT); } #endif #if TOUCH_BUTTON_DENOISE_ENABLE /* Denoise setting at TouchSensor 0. */ touch_pad_denoise_t denoise = { /* The bits to be cancelled are determined according to the noise level. */ .grade = TOUCH_PAD_DENOISE_BIT4, /* By adjusting the parameters, the reading of T0 should be approximated to the reading of the measured channel. */ .cap_level = TOUCH_PAD_DENOISE_CAP_L4, }; touch_pad_denoise_set_config(&denoise); touch_pad_denoise_enable(); ESP_LOGI(TAG, "Denoise function init"); #endif #if TOUCH_BUTTON_WATERPROOF_ENABLE /* Waterproof function */ touch_pad_waterproof_t waterproof = { .guard_ring_pad = button[3], // If no ring pad, set 0; /* It depends on the number of the parasitic capacitance of the shield pad. Based on the touch readings of T14 and T0, estimate the size of the parasitic capacitance on T14 and set the parameters of the appropriate hardware. */ .shield_driver = TOUCH_PAD_SHIELD_DRV_L2, }; touch_pad_waterproof_set_config(&waterproof); touch_pad_waterproof_enable(); ESP_LOGI(TAG, "touch pad waterproof init"); #endif /* Filter setting */ touchsensor_filter_set(TOUCH_PAD_FILTER_IIR_16); touch_pad_timeout_set(true, TOUCH_PAD_THRESHOLD_MAX); /* Register touch interrupt ISR, enable intr type. */ touch_pad_isr_register(touchsensor_interrupt_cb, NULL, TOUCH_PAD_INTR_MASK_ALL); /* If you have other touch algorithm, you can get the measured value after the `TOUCH_PAD_INTR_MASK_SCAN_DONE` interrupt is generated. */ touch_pad_intr_enable(TOUCH_PAD_INTR_MASK_ACTIVE | TOUCH_PAD_INTR_MASK_INACTIVE | TOUCH_PAD_INTR_MASK_TIMEOUT); /* Enable touch sensor clock. Work mode is "timer trigger". */ touch_pad_set_fsm_mode(TOUCH_FSM_MODE_TIMER); touch_pad_fsm_start(); // Start a task to show what pads have been touched xTaskCreate(&tp_example_read_task, "touch_pad_read_task", 4096, NULL, 5, NULL); esp_sleep_enable_touchpad_wakeup(); // 启用触摸唤醒 esp_deep_sleep_start(); } 如何真正实现触摸唤醒
07-29
<think>我们正在讨论ESP32的触摸感应器在深度睡眠模式下唤醒系统的配置。用户希望看到一个代码示例,理解如何实现真正的触摸唤醒。 根据ESP-IDF的文档,ESP32支持通过触摸传感器从深度睡眠中唤醒。配置步骤括: 1. 初始化触摸板 2. 配置触摸引脚作为唤醒源 3. 进入深度睡眠 注意:触摸唤醒功能在深度睡眠模式下需要正确配置触摸传感器的阈值。当触摸值变化超过阈值时,芯片会被唤醒。 以下是一个简单的代码示例(基于ESP-IDF框架):</think>### ESP32触摸感应器深度睡眠唤醒配置 ESP32支持通过触摸传感器从深度睡眠状态唤醒系统,以下是实现方法和代码示例: #### 核心配置步骤 1. **初始化触摸传感器**: - 配置触摸引脚和阈值 - 设置触摸传感器滤波参数 2. **配置唤醒源**: - 使能触摸唤醒功能 - 设置触摸中断触发方式 3. **进入深度睡眠**: - 保存必要状态 - 启动深度睡眠模式 4. **唤醒处理**: - 检测唤醒原因 - 执行唤醒后初始化 #### 代码示例 ```c #include "driver/touch_pad.h" #include "esp_sleep.h" #define TOUCH_PAD GPIO_NUM_4 // 使用GPIO4作为触摸引脚 #define TOUCH_THRESHOLD 40 // 触摸触发阈值 void setup_touch_wakeup() { // 1. 初始化触摸传感器 touch_pad_init(); touch_pad_set_fsm_mode(TOUCH_FSM_MODE_TIMER); touch_pad_set_voltage(TOUCH_HVOLT_2V7, TOUCH_LVOLT_0V5, TOUCH_HVOLT_ATTEN_1V); // 2. 配置触摸引脚 touch_pad_config(TOUCH_PAD, 0); // 3. 设置唤醒阈值 touch_pad_set_thresh(TOUCH_PAD, TOUCH_THRESHOLD); // 4. 启用触摸中断唤醒 touch_pad_intr_enable(); esp_sleep_enable_touchpad_wakeup(); } void app_main() { setup_touch_wakeup(); printf("进入深度睡眠,触摸GPIO%d唤醒\n", TOUCH_PAD); fflush(stdout); esp_deep_sleep_start(); // 进入深度睡眠 } // 唤醒后执行(复位后执行app_main) ``` #### 关键参数说明 1. **阈值设置**: - 通过`touch_pad_read()`获取基准值 - 阈值 = 基准值 - 灵敏度值(典型20-50) - 公式:$阈值 = 基准值 - \Delta$,其中$\Delta$为灵敏度 2. **滤波配置**(可选): ```c touch_pad_filter_start(10); // 设置滤波采样周期(ms) touch_pad_set_filter_read(TOUCH_PAD); // 启用滤波 ``` 3. **唤醒检测**: ```c void print_wakeup_reason(){ esp_sleep_wakeup_cause_t cause = esp_sleep_get_wakeup_cause(); if(cause == ESP_SLEEP_WAKEUP_TOUCHPAD){ touch_pad_t pin_num; touch_pad_get_wakeup_status(&pin_num); printf("通过触摸引脚GPIO%d唤醒\n", pin_num); } } ``` #### 注意事项 1. **硬件要求**: - 使用支持触摸功能的GPIO(GPIO0-15) - 添加10nF-100nF滤波电容到触摸引脚[^1] - 触摸走线长度建议<15cm 2. **功耗优化**: - 深度睡眠电流约5μA - 唤醒后及时关闭触摸传感器: ```c touch_pad_deinit(); // 唤醒后释放触摸模块 ``` 3. **阈值校准**: ```c uint16_t baseline; touch_pad_read_benchmark(TOUCH_PAD, &baseline); touch_pad_set_thresh(TOUCH_PAD, baseline * 0.7); // 设置70%基准值作为阈值 ``` > **调试提示**:使用`touch_pad_read_filtered()`获取滤波后的实时触摸值,通过串口输出调试最佳阈值。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值