![]() |
LibDriver TM1622
|
driver tm1622 header file More...
#include <stdio.h>#include <stdint.h>#include <string.h>Go to the source code of this file.
Data Structures | |
| struct | tm1622_handle_s |
| tm1622 handle structure definition More... | |
| struct | tm1622_info_s |
| tm1622 information structure definition More... | |
Macros | |
| #define | TM1622_COMMAND_DATA_DELAY 3 |
| tm1622 command data delay definition | |
| #define | DRIVER_TM1622_LINK_INIT(HANDLE, STRUCTURE) |
| initialize tm1622_handle_t structure | |
| #define | DRIVER_TM1622_LINK_DATA_GPIO_INIT(HANDLE, FUC) |
| link data_gpio_init function | |
| #define | DRIVER_TM1622_LINK_DATA_GPIO_DEINIT(HANDLE, FUC) |
| link data_gpio_deinit function | |
| #define | DRIVER_TM1622_LINK_DATA_GPIO_WRITE(HANDLE, FUC) |
| link data_gpio_write function | |
| #define | DRIVER_TM1622_LINK_DATA_GPIO_READ(HANDLE, FUC) |
| link data_gpio_read function | |
| #define | DRIVER_TM1622_LINK_WR_GPIO_INIT(HANDLE, FUC) |
| link wr_gpio_init function | |
| #define | DRIVER_TM1622_LINK_WR_GPIO_DEINIT(HANDLE, FUC) |
| link wr_gpio_deinit function | |
| #define | DRIVER_TM1622_LINK_WR_GPIO_WRITE(HANDLE, FUC) |
| link wr_gpio_write function | |
| #define | DRIVER_TM1622_LINK_RD_GPIO_INIT(HANDLE, FUC) |
| link rd_gpio_init function | |
| #define | DRIVER_TM1622_LINK_RD_GPIO_DEINIT(HANDLE, FUC) |
| link rd_gpio_deinit function | |
| #define | DRIVER_TM1622_LINK_RD_GPIO_WRITE(HANDLE, FUC) |
| link rd_gpio_write function | |
| #define | DRIVER_TM1622_LINK_CS_GPIO_INIT(HANDLE, FUC) |
| link cs_gpio_init function | |
| #define | DRIVER_TM1622_LINK_CS_GPIO_DEINIT(HANDLE, FUC) |
| link cs_gpio_deinit function | |
| #define | DRIVER_TM1622_LINK_CS_GPIO_WRITE(HANDLE, FUC) |
| link cs_gpio_write function | |
| #define | DRIVER_TM1622_LINK_DELAY_US(HANDLE, FUC) |
| link delay_us function | |
| #define | DRIVER_TM1622_LINK_DELAY_MS(HANDLE, FUC) |
| link delay_ms function | |
| #define | DRIVER_TM1622_LINK_DEBUG_PRINT(HANDLE, FUC) |
| link debug_print function | |
Typedefs | |
| typedef struct tm1622_handle_s | tm1622_handle_t |
| tm1622 handle structure definition | |
| typedef struct tm1622_info_s | tm1622_info_t |
| tm1622 information structure definition | |
Enumerations | |
| enum | tm1622_bool_t { TM1622_BOOL_FALSE = 0x00 , TM1622_BOOL_TRUE = 0x01 } |
| tm1622 bool enumeration definition More... | |
| enum | tm1622_mode_t { TM1622_MODE_NORMAL = 0x00 , TM1622_MODE_TEST = 0x01 } |
| tm1622 mode enumeration definition More... | |
| enum | tm1622_clock_t { TM1622_CLOCK_RC_32K = 0x01 , TM1622_CLOCK_EXT_32K = 0x02 } |
| tm1622 clock enumeration definition More... | |
| enum | tm1622_tone_freq_t { TM1622_TONE_FREQ_2K = 0x00 , TM1622_TONE_FREQ_4K = 0x01 } |
| tm1622 tone freq enumeration definition More... | |
| enum | tm1622_freq_t { TM1622_FREQ_F1 = 0x00 , TM1622_FREQ_F2 = 0x01 , TM1622_FREQ_F4 = 0x02 , TM1622_FREQ_F8 = 0x03 , TM1622_FREQ_F16 = 0x04 , TM1622_FREQ_F32 = 0x05 , TM1622_FREQ_F64 = 0x06 , TM1622_FREQ_F128 = 0x07 } |
| tm1622 freq enumeration definition More... | |
Functions | |
| uint8_t | tm1622_info (tm1622_info_t *info) |
| get chip's information | |
| uint8_t | tm1622_init (tm1622_handle_t *handle) |
| initialize the chip | |
| uint8_t | tm1622_deinit (tm1622_handle_t *handle) |
| close the chip | |
| uint8_t | tm1622_write_segment (tm1622_handle_t *handle, uint8_t addr, uint8_t *data, uint8_t len) |
| write segment | |
| uint8_t | tm1622_clear_segment (tm1622_handle_t *handle) |
| clear segment | |
| uint8_t | tm1622_set_oscillator (tm1622_handle_t *handle, tm1622_bool_t enable) |
| enable or disable oscillator | |
| uint8_t | tm1622_set_lcd_bias (tm1622_handle_t *handle, tm1622_bool_t enable) |
| enable or disable lcd bias | |
| uint8_t | tm1622_set_mode (tm1622_handle_t *handle, tm1622_mode_t mode) |
| set mode | |
| uint8_t | tm1622_set_clock (tm1622_handle_t *handle, tm1622_clock_t clk) |
| set clock | |
| uint8_t | tm1622_set_freq (tm1622_handle_t *handle, tm1622_freq_t freq) |
| set freq | |
| uint8_t | tm1622_set_tone_freq (tm1622_handle_t *handle, tm1622_tone_freq_t freq) |
| set tone freq | |
| uint8_t | tm1622_set_timer (tm1622_handle_t *handle, tm1622_bool_t enable) |
| enable or disable timer | |
| uint8_t | tm1622_set_watchdog (tm1622_handle_t *handle, tm1622_bool_t enable) |
| enable or disable watchdog | |
| uint8_t | tm1622_set_tone (tm1622_handle_t *handle, tm1622_bool_t enable) |
| enable or disable tone | |
| uint8_t | tm1622_set_irq (tm1622_handle_t *handle, tm1622_bool_t enable) |
| enable or disable irq | |
| uint8_t | tm1622_clear_timer (tm1622_handle_t *handle) |
| clear timer | |
| uint8_t | tm1622_clear_watchdog (tm1622_handle_t *handle) |
| clear watchdog | |
| uint8_t | tm1622_set_command (tm1622_handle_t *handle, uint16_t cmd) |
| set command | |
| uint8_t | tm1622_set_data (tm1622_handle_t *handle, uint8_t addr, uint8_t *data, uint8_t len) |
| set data | |
| uint8_t | tm1622_get_data (tm1622_handle_t *handle, uint8_t addr, uint8_t *data, uint8_t len) |
| get data | |
| uint8_t | tm1622_read_modify_write (tm1622_handle_t *handle, uint8_t addr, void(*and_or)(uint8_t addr, uint8_t lsb_msb, uint8_t input, uint8_t *output), uint8_t len) |
| read modify write | |
driver tm1622 header file
Copyright (c) 2015 - present LibDriver All rights reserved
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
| Date | Version | Author | Description |
|---|---|---|---|
| 2026/05/31 | 1.0 | Shifeng Li | first upload |
Definition in file driver_tm1622.h.