LibDriver TM1622
Loading...
Searching...
No Matches
tm1622 basic driver function

tm1622 basic driver modules More...

Collaboration diagram for tm1622 basic driver function:

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

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

Detailed Description

tm1622 basic driver modules

Macro Definition Documentation

◆ TM1622_COMMAND_DATA_DELAY

#define TM1622_COMMAND_DATA_DELAY   3

tm1622 command data delay definition

3us

Definition at line 63 of file driver_tm1622.h.

Typedef Documentation

◆ tm1622_handle_t

tm1622 handle structure definition

◆ tm1622_info_t

typedef struct tm1622_info_s tm1622_info_t

tm1622 information structure definition

Enumeration Type Documentation

◆ tm1622_bool_t

tm1622 bool enumeration definition

Enumerator
TM1622_BOOL_FALSE 

false

TM1622_BOOL_TRUE 

true

Definition at line 69 of file driver_tm1622.h.

◆ tm1622_clock_t

tm1622 clock enumeration definition

Enumerator
TM1622_CLOCK_RC_32K 

rc 32k

TM1622_CLOCK_EXT_32K 

ext 32k

Definition at line 87 of file driver_tm1622.h.

◆ tm1622_freq_t

tm1622 freq enumeration definition

Enumerator
TM1622_FREQ_F1 

clock 1hz, wdt 4s

TM1622_FREQ_F2 

clock 2hz, wdt 2s

TM1622_FREQ_F4 

clock 4hz, wdt 1s

TM1622_FREQ_F8 

clock 8hz, wdt 1/2s

TM1622_FREQ_F16 

clock 16hz, wdt 1/4s

TM1622_FREQ_F32 

clock 32hz, wdt 1/8s

TM1622_FREQ_F64 

clock 64hz, wdt 1/16s

TM1622_FREQ_F128 

clock 128hz, wdt 1/32s

Definition at line 105 of file driver_tm1622.h.

◆ tm1622_mode_t

tm1622 mode enumeration definition

Enumerator
TM1622_MODE_NORMAL 

normal mode

TM1622_MODE_TEST 

test mode

Definition at line 78 of file driver_tm1622.h.

◆ tm1622_tone_freq_t

tm1622 tone freq enumeration definition

Enumerator
TM1622_TONE_FREQ_2K 

tone 2k

TM1622_TONE_FREQ_4K 

tone 4k

Definition at line 96 of file driver_tm1622.h.

Function Documentation

◆ tm1622_clear_segment()

uint8_t tm1622_clear_segment ( tm1622_handle_t * handle)

clear segment

Parameters
[in]*handlepointer to a tm1622 handle structure
Returns
status code
  • 0 success
  • 1 clear segment failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1338 of file driver_tm1622.c.

◆ tm1622_clear_timer()

uint8_t tm1622_clear_timer ( tm1622_handle_t * handle)

clear timer

Parameters
[in]*handlepointer to a tm1622 handle structure
Returns
status code
  • 0 success
  • 1 clear timer failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 729 of file driver_tm1622.c.

◆ tm1622_clear_watchdog()

uint8_t tm1622_clear_watchdog ( tm1622_handle_t * handle)

clear watchdog

Parameters
[in]*handlepointer to a tm1622 handle structure
Returns
status code
  • 0 success
  • 1 clear watchdog failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 761 of file driver_tm1622.c.

◆ tm1622_deinit()

uint8_t tm1622_deinit ( tm1622_handle_t * handle)

close the chip

Parameters
[in]*handlepointer to a tm1622 handle structure
Returns
status code
  • 0 success
  • 1 gpio deinit failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 power down failed
Note
none

Definition at line 1234 of file driver_tm1622.c.

◆ tm1622_info()

uint8_t tm1622_info ( tm1622_info_t * info)

get chip's information

Parameters
[out]*infopointer to a tm1622 info structure
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 1508 of file driver_tm1622.c.

◆ tm1622_init()

uint8_t tm1622_init ( tm1622_handle_t * handle)

initialize the chip

Parameters
[in]*handlepointer to a tm1622 handle structure
Returns
status code
  • 0 success
  • 1 gpio initialization failed
  • 2 handle is NULL
  • 3 linked functions is NULL
Note
none

Definition at line 1037 of file driver_tm1622.c.

◆ tm1622_set_clock()

uint8_t tm1622_set_clock ( tm1622_handle_t * handle,
tm1622_clock_t clk )

set clock

Parameters
[in]*handlepointer to a tm1622 handle structure
[in]clkchip clock
Returns
status code
  • 0 success
  • 1 set clock failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 840 of file driver_tm1622.c.

◆ tm1622_set_freq()

uint8_t tm1622_set_freq ( tm1622_handle_t * handle,
tm1622_freq_t freq )

set freq

Parameters
[in]*handlepointer to a tm1622 handle structure
[in]freqoutput freq
Returns
status code
  • 0 success
  • 1 set freq failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 886 of file driver_tm1622.c.

◆ tm1622_set_irq()

uint8_t tm1622_set_irq ( tm1622_handle_t * handle,
tm1622_bool_t enable )

enable or disable irq

Parameters
[in]*handlepointer to a tm1622 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set irq failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 684 of file driver_tm1622.c.

◆ tm1622_set_lcd_bias()

uint8_t tm1622_set_lcd_bias ( tm1622_handle_t * handle,
tm1622_bool_t enable )

enable or disable lcd bias

Parameters
[in]*handlepointer to a tm1622 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set lcd bias failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 500 of file driver_tm1622.c.

◆ tm1622_set_mode()

uint8_t tm1622_set_mode ( tm1622_handle_t * handle,
tm1622_mode_t mode )

set mode

Parameters
[in]*handlepointer to a tm1622 handle structure
[in]modeinput mode
Returns
status code
  • 0 success
  • 1 set mode failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 794 of file driver_tm1622.c.

◆ tm1622_set_oscillator()

uint8_t tm1622_set_oscillator ( tm1622_handle_t * handle,
tm1622_bool_t enable )

enable or disable oscillator

Parameters
[in]*handlepointer to a tm1622 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set oscillator failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 454 of file driver_tm1622.c.

◆ tm1622_set_timer()

uint8_t tm1622_set_timer ( tm1622_handle_t * handle,
tm1622_bool_t enable )

enable or disable timer

Parameters
[in]*handlepointer to a tm1622 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set timer failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 546 of file driver_tm1622.c.

◆ tm1622_set_tone()

uint8_t tm1622_set_tone ( tm1622_handle_t * handle,
tm1622_bool_t enable )

enable or disable tone

Parameters
[in]*handlepointer to a tm1622 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set tone failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 638 of file driver_tm1622.c.

◆ tm1622_set_tone_freq()

uint8_t tm1622_set_tone_freq ( tm1622_handle_t * handle,
tm1622_tone_freq_t freq )

set tone freq

Parameters
[in]*handlepointer to a tm1622 handle structure
[in]freqtone freq
Returns
status code
  • 0 success
  • 1 set tone freq failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 992 of file driver_tm1622.c.

◆ tm1622_set_watchdog()

uint8_t tm1622_set_watchdog ( tm1622_handle_t * handle,
tm1622_bool_t enable )

enable or disable watchdog

Parameters
[in]*handlepointer to a tm1622 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set watchdog failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 592 of file driver_tm1622.c.

◆ tm1622_write_segment()

uint8_t tm1622_write_segment ( tm1622_handle_t * handle,
uint8_t addr,
uint8_t * data,
uint8_t len )

write segment

Parameters
[in]*handlepointer to a tm1622 handle structure
[in]addraddress
[in]*datapointer to an input data buffer
[in]leninput data length
Returns
status code
  • 0 success
  • 1 write segment failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 addr + len > 32
Note
none

Definition at line 1300 of file driver_tm1622.c.