00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00040 #ifndef __sure_2416_h
00041 #define __sure_2416_h
00042
00043 #include "config.h"
00044 #include "pic_utils.h"
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069 #define SURE_2416_CMD_SYS_DISABLE 0b00000000
00070 #define SURE_2416_CMD_SYS_ENABLE 0b00000001
00071
00072 #define SURE_2416_CMD_NMOS_8_COMMON 0b00100000
00073 #define SURE_2416_CMD_NMOS_16_COMMON 0b00100100
00074 #define SURE_2416_CMD_PMOS_8_COMMON 0b00101000
00075 #define SURE_2416_CMD_PMOS_16_COMMON 0b00101100
00076
00077 #define SURE_2416_CMD_CLK_MASTER_MODE 0b00010100
00078 #define SURE_2416_CMD_CLK_SLAVE_MODE 0b00010000
00079
00080 #define SURE_2416_CMD_CLK_SOURCE_INT_RC 0b00011000
00081 #define SURE_2416_CMD_CLK_SOURCE_EXT 0b00011100
00082
00083 #define SURE_2416_CMD_LEDS_OFF 0b00000010
00084 #define SURE_2416_CMD_LEDS_ON 0b00000011
00085
00086 #define SURE_2416_CMD_BLINK_OFF 0b00001000
00087 #define SURE_2416_CMD_BLINK_ON 0b00001001
00088
00089
00090 void sure_2416_setup();
00091 void sure_2416_init();
00092 void sure_2416_write(uns8 mem_addr, uns8 data);
00093 void sure_2416_send_command(uns8 command);
00094
00095 void sure_2416_set_brightness(uns8 brightness);
00096
00097 void sure_2416_set_pixel(uns8 x, uns8 y, uns8 colour);
00098 uns8 sure_2416_get_pixel(uns8 x, uns8 y);
00099 void sure_2416_horizontal_line(uns8 x, uns8 y, uns8 length, uns8 colour);
00100 void sure_2416_vertical_line(uns8 x, uns8 y, uns8 length, uns8 colour);
00101 void sure_2416_clear();
00102 void sure_2416_fill(uns8 colour);
00103 void sure_2416_fill2(uns8 colour);
00104
00105
00106 #ifdef fix_this_later
00107
00108 #ifndef i2c_scl_port
00109 #error "You haven't defined i2c_scl_port in your config.h!"
00110 #endif
00111
00112 #ifndef i2c_sda_port
00113 #error "You haven't defined i2c_sda_port in your config.h!"
00114 #endif
00115
00116 #ifndef i2c_scl_pin
00117 #error "You haven't defined i2c_scl_pin in your config.h!"
00118 #endif
00119
00120 #ifndef i2c_sda_pin
00121 #error "You haven't defined i2c_sda_pin in your config.h!"
00122 #endif
00123 #endif
00124
00125
00126 #endif