LibDriver TM1637
Loading...
Searching...
No Matches
driver_tm1637.h File Reference

driver tm1637 header file More...

#include <stdio.h>
#include <stdint.h>
#include <string.h>
Include dependency graph for driver_tm1637.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  tm1637_handle_s
 tm1637 handle structure definition More...
struct  tm1637_info_s
 tm1637 information structure definition More...

Macros

#define DRIVER_TM1637_LINK_INIT(HANDLE, STRUCTURE)
 initialize tm1637_handle_t structure
#define DRIVER_TM1637_LINK_IIC_INIT(HANDLE, FUC)
 link iic_init function
#define DRIVER_TM1637_LINK_IIC_DEINIT(HANDLE, FUC)
 link iic_deinit function
#define DRIVER_TM1637_LINK_IIC_WRITE_COMMAND_CUSTOM(HANDLE, FUC)
 link iic_write_cmd_custom function
#define DRIVER_TM1637_LINK_IIC_READ_COMMAND_CUSTOM(HANDLE, FUC)
 link iic_read_cmd_custom function
#define DRIVER_TM1637_LINK_DELAY_MS(HANDLE, FUC)
 link delay_ms function
#define DRIVER_TM1637_LINK_DEBUG_PRINT(HANDLE, FUC)
 link debug_print function

Typedefs

typedef struct tm1637_handle_s tm1637_handle_t
 tm1637 handle structure definition
typedef struct tm1637_info_s tm1637_info_t
 tm1637 information structure definition

Enumerations

enum  tm1637_address_mode_t { TM1637_ADDRESS_MODE_INC = 0x00 , TM1637_ADDRESS_MODE_FIX = 0x01 }
 tm1637 address mode enumeration definition More...
enum  tm1637_bool_t { TM1637_BOOL_FALSE = 0x00 , TM1637_BOOL_TRUE = 0x01 }
 tm1637 bool enumeration definition More...
enum  tm1637_pulse_width_t {
  TM1637_PULSE_WIDTH_1_DIV_16 = 0x00 , TM1637_PULSE_WIDTH_2_DIV_16 = 0x01 , TM1637_PULSE_WIDTH_4_DIV_16 = 0x02 , TM1637_PULSE_WIDTH_10_DIV_16 = 0x03 ,
  TM1637_PULSE_WIDTH_11_DIV_16 = 0x04 , TM1637_PULSE_WIDTH_12_DIV_16 = 0x05 , TM1637_PULSE_WIDTH_13_DIV_16 = 0x06 , TM1637_PULSE_WIDTH_14_DIV_16 = 0x07
}
 tm1637 pulse width enumeration definition More...
enum  tm1637_number_t {
  TM1637_NUMBER_0 = 0x3F , TM1637_NUMBER_1 = 0x06 , TM1637_NUMBER_2 = 0x5B , TM1637_NUMBER_3 = 0x4F ,
  TM1637_NUMBER_4 = 0x66 , TM1637_NUMBER_5 = 0x6D , TM1637_NUMBER_6 = 0x7D , TM1637_NUMBER_7 = 0x07 ,
  TM1637_NUMBER_8 = 0x7F , TM1637_NUMBER_9 = 0x6F
}
 tm1637 number enumeration definition More...

Functions

uint8_t tm1637_info (tm1637_info_t *info)
 get chip's information
uint8_t tm1637_init (tm1637_handle_t *handle)
 initialize the chip
uint8_t tm1637_deinit (tm1637_handle_t *handle)
 close the chip
uint8_t tm1637_clear_segment (tm1637_handle_t *handle)
 clear segment
uint8_t tm1637_write_segment (tm1637_handle_t *handle, uint8_t addr, uint8_t *data, uint8_t len)
 write segment
uint8_t tm1637_read_segment (tm1637_handle_t *handle, uint8_t *seg, uint8_t *k)
 read segment
uint8_t tm1637_set_pulse_width (tm1637_handle_t *handle, tm1637_pulse_width_t width)
 set pulse width
uint8_t tm1637_get_pulse_width (tm1637_handle_t *handle, tm1637_pulse_width_t *width)
 get pulse width
uint8_t tm1637_set_display (tm1637_handle_t *handle, tm1637_bool_t enable)
 enable or disable display
uint8_t tm1637_get_display (tm1637_handle_t *handle, tm1637_bool_t *enable)
 get display status
uint8_t tm1637_set_address_mode (tm1637_handle_t *handle, tm1637_address_mode_t mode)
 set address mode
uint8_t tm1637_get_address_mode (tm1637_handle_t *handle, tm1637_address_mode_t *mode)
 get address mode
uint8_t tm1637_set_test_mode (tm1637_handle_t *handle, tm1637_bool_t enable)
 enable or disable test mode
uint8_t tm1637_get_test_mode (tm1637_handle_t *handle, tm1637_bool_t *enable)
 get test mode status
uint8_t tm1637_set_reg (tm1637_handle_t *handle, uint8_t cmd, uint8_t *data, uint8_t len)
 set the chip register
uint8_t tm1637_get_reg (tm1637_handle_t *handle, uint8_t cmd, uint8_t *data, uint8_t len)
 get the chip register

Detailed Description

driver tm1637 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.

Version
1.0.0
Author
Shifeng Li
Date
2024-03-31

history

Date Version Author Description
2024/03/31 1.0 Shifeng Li first upload

Definition in file driver_tm1637.h.