![]() |
LibDriver TM1638
|
driver tm1638 header file More...
#include <stdio.h>#include <stdint.h>#include <string.h>Go to the source code of this file.
Data Structures | |
| struct | tm1638_handle_s |
| tm1638 handle structure definition More... | |
| struct | tm1638_info_s |
| tm1638 information structure definition More... | |
Macros | |
| #define | DRIVER_TM1638_LINK_INIT(HANDLE, STRUCTURE) |
| initialize tm1638_handle_t structure | |
| #define | DRIVER_TM1638_LINK_SPI_INIT(HANDLE, FUC) |
| link spi_init function | |
| #define | DRIVER_TM1638_LINK_SPI_DEINIT(HANDLE, FUC) |
| link spi_deinit function | |
| #define | DRIVER_TM1638_LINK_SPI_WRITE(HANDLE, FUC) |
| link spi_write function | |
| #define | DRIVER_TM1638_LINK_SPI_READ(HANDLE, FUC) |
| link spi_read function | |
| #define | DRIVER_TM1638_LINK_DELAY_MS(HANDLE, FUC) |
| link delay_ms function | |
| #define | DRIVER_TM1638_LINK_DEBUG_PRINT(HANDLE, FUC) |
| link debug_print function | |
Typedefs | |
| typedef struct tm1638_handle_s | tm1638_handle_t |
| tm1638 handle structure definition | |
| typedef struct tm1638_info_s | tm1638_info_t |
| tm1638 information structure definition | |
Enumerations | |
| enum | tm1638_address_mode_t { TM1638_ADDRESS_MODE_INC = 0x00 , TM1638_ADDRESS_MODE_FIX = 0x01 } |
| tm1638 address mode enumeration definition More... | |
| enum | tm1638_bool_t { TM1638_BOOL_FALSE = 0x00 , TM1638_BOOL_TRUE = 0x01 } |
| tm1638 bool enumeration definition More... | |
| enum | tm1638_pulse_width_t { TM1638_PULSE_WIDTH_1_DIV_16 = 0x00 , TM1638_PULSE_WIDTH_2_DIV_16 = 0x01 , TM1638_PULSE_WIDTH_4_DIV_16 = 0x02 , TM1638_PULSE_WIDTH_10_DIV_16 = 0x03 , TM1638_PULSE_WIDTH_11_DIV_16 = 0x04 , TM1638_PULSE_WIDTH_12_DIV_16 = 0x05 , TM1638_PULSE_WIDTH_13_DIV_16 = 0x06 , TM1638_PULSE_WIDTH_14_DIV_16 = 0x07 } |
| tm1638 pulse width enumeration definition More... | |
| enum | tm1638_number_t { TM1638_NUMBER_0 = 0x003F , TM1638_NUMBER_1 = 0x0006 , TM1638_NUMBER_2 = 0x005B , TM1638_NUMBER_3 = 0x004F , TM1638_NUMBER_4 = 0x0066 , TM1638_NUMBER_5 = 0x006D , TM1638_NUMBER_6 = 0x007D , TM1638_NUMBER_7 = 0x0007 , TM1638_NUMBER_8 = 0x007F , TM1638_NUMBER_9 = 0x006F } |
| tm1638 number enumeration definition More... | |
Functions | |
| uint8_t | tm1638_info (tm1638_info_t *info) |
| get chip's information | |
| uint8_t | tm1638_init (tm1638_handle_t *handle) |
| initialize the chip | |
| uint8_t | tm1638_clear_segment (tm1638_handle_t *handle) |
| clear segment | |
| uint8_t | tm1638_deinit (tm1638_handle_t *handle) |
| close the chip | |
| uint8_t | tm1638_write_segment (tm1638_handle_t *handle, uint8_t addr, uint16_t *data, uint8_t len) |
| write segment | |
| uint8_t | tm1638_read_segment (tm1638_handle_t *handle, uint8_t segk[4]) |
| read segment | |
| uint8_t | tm1638_set_pulse_width (tm1638_handle_t *handle, tm1638_pulse_width_t width) |
| set pulse width | |
| uint8_t | tm1638_get_pulse_width (tm1638_handle_t *handle, tm1638_pulse_width_t *width) |
| get pulse width | |
| uint8_t | tm1638_set_display (tm1638_handle_t *handle, tm1638_bool_t enable) |
| enable or disable display | |
| uint8_t | tm1638_get_display (tm1638_handle_t *handle, tm1638_bool_t *enable) |
| get display status | |
| uint8_t | tm1638_set_address_mode (tm1638_handle_t *handle, tm1638_address_mode_t mode) |
| set address mode | |
| uint8_t | tm1638_get_address_mode (tm1638_handle_t *handle, tm1638_address_mode_t *mode) |
| get address mode | |
| uint8_t | tm1638_set_test_mode (tm1638_handle_t *handle, tm1638_bool_t enable) |
| enable or disable test mode | |
| uint8_t | tm1638_get_test_mode (tm1638_handle_t *handle, tm1638_bool_t *enable) |
| get test mode status | |
| uint8_t | tm1638_set_reg (tm1638_handle_t *handle, uint8_t cmd, uint8_t *data, uint8_t len) |
| set the chip register | |
| uint8_t | tm1638_get_reg (tm1638_handle_t *handle, uint8_t cmd, uint8_t *data, uint8_t len) |
| get the chip register | |
driver tm1638 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 |
|---|---|---|---|
| 2024/03/31 | 1.0 | Shifeng Li | first upload |
Definition in file driver_tm1638.h.