Holtek LED matrix display routines, used in Sure 2416 display and others. More...
#include "config.h"
#include "pic_utils.h"
Go to the source code of this file.
Defines | |
#define | HT1632_CMD_BLINK_OFF 0b00001000 |
#define | HT1632_CMD_BLINK_ON 0b00001001 |
#define | HT1632_CMD_CLK_MASTER_MODE 0b00010100 |
#define | HT1632_CMD_CLK_SLAVE_MODE 0b00010000 |
#define | HT1632_CMD_CLK_SOURCE_EXT 0b00011100 |
#define | HT1632_CMD_CLK_SOURCE_INT_RC 0b00011000 |
#define | HT1632_CMD_LEDS_OFF 0b00000010 |
#define | HT1632_CMD_LEDS_ON 0b00000011 |
#define | HT1632_CMD_NMOS_16_COMMON 0b00100100 |
#define | HT1632_CMD_NMOS_8_COMMON 0b00100000 |
#define | HT1632_CMD_PMOS_16_COMMON 0b00101100 |
#define | HT1632_CMD_PMOS_8_COMMON 0b00101000 |
#define | HT1632_CMD_SYS_DISABLE 0b00000000 |
#define | HT1632_CMD_SYS_ENABLE 0b00000001 |
Functions | |
void | ht1632_clear () |
void | ht1632_fill (uns8 colour) |
void | ht1632_fill2 (uns8 colour) |
uns8 | ht1632_get_pixel (uns8 x, uns8 y) |
void | ht1632_horizontal_line (uns8 x, uns8 y, uns8 length, uns8 colour) |
void | ht1632_init (uns8 hw_config) |
void | ht1632_send_command (uns8 command) |
void | ht1632_set_brightness (uns8 brightness) |
void | ht1632_set_pixel (uns8 x, uns8 y, uns8 colour) |
void | ht1632_setup_io () |
void | ht1632_vertical_line (uns8 x, uns8 y, uns8 length, uns8 colour) |
void | ht1632_write (uns8 mem_addr, uns8 data) |
Routines to communicate with Holtek HT1632 led matrix display chip
Definition in file ht1632.h.
#define HT1632_CMD_CLK_MASTER_MODE 0b00010100 |
Definition at line 95 of file ht1632.h.
Referenced by ht1632_init().
#define HT1632_CMD_LEDS_OFF 0b00000010 |
Definition at line 101 of file ht1632.h.
Referenced by ht1632_fill2().
#define HT1632_CMD_LEDS_ON 0b00000011 |
Definition at line 102 of file ht1632.h.
Referenced by ht1632_fill2(), and ht1632_init().
#define HT1632_CMD_PMOS_16_COMMON 0b00101100 |
Definition at line 93 of file ht1632.h.
Referenced by drv_init().
#define HT1632_CMD_SYS_DISABLE 0b00000000 |
Definition at line 87 of file ht1632.h.
Referenced by ht1632_init().
#define HT1632_CMD_SYS_ENABLE 0b00000001 |
Definition at line 88 of file ht1632.h.
Referenced by ht1632_init().
void ht1632_clear | ( | ) |
void ht1632_fill | ( | uns8 | colour | ) |
Definition at line 326 of file ht1632.c.
References ht1632_write(), and uns8.
void ht1632_fill2 | ( | uns8 | colour | ) |
Definition at line 341 of file ht1632.c.
References clear_pin, HT1632_CMD_LEDS_OFF, HT1632_CMD_LEDS_ON, ht1632_send_command(), set_pin, and uns16.
uns8 ht1632_get_pixel | ( | uns8 | x, | |
uns8 | y | |||
) |
void ht1632_horizontal_line | ( | uns8 | x, | |
uns8 | y, | |||
uns8 | length, | |||
uns8 | colour | |||
) |
void ht1632_init | ( | uns8 | hw_config | ) |
Definition at line 75 of file ht1632.c.
References HT1632_CMD_CLK_MASTER_MODE, HT1632_CMD_LEDS_ON, HT1632_CMD_SYS_DISABLE, HT1632_CMD_SYS_ENABLE, and ht1632_send_command().
Referenced by drv_init().
void ht1632_send_command | ( | uns8 | command | ) |
Definition at line 86 of file ht1632.c.
References clear_pin, set_pin, and uns8.
Referenced by ht1632_fill2(), ht1632_init(), and ht1632_set_brightness().
void ht1632_set_brightness | ( | uns8 | brightness | ) |
Definition at line 206 of file ht1632.c.
References ht1632_send_command().
void ht1632_set_pixel | ( | uns8 | x, | |
uns8 | y, | |||
uns8 | colour | |||
) |
Definition at line 211 of file ht1632.c.
References clear_pin, make_input, make_output, set_pin, test_pin, and uns8.
void ht1632_setup_io | ( | ) |
Definition at line 41 of file ht1632.c.
References make_output, and set_pin.
Referenced by drv_setup_io().
void ht1632_vertical_line | ( | uns8 | x, | |
uns8 | y, | |||
uns8 | length, | |||
uns8 | colour | |||
) |
void ht1632_write | ( | uns8 | mem_addr, | |
uns8 | data | |||
) |
Definition at line 142 of file ht1632.c.
References change_pin_var, clear_pin, set_pin, and uns8.
Referenced by ht1632_fill().