1 /*
2 * Copyright (c) 2016, Texas Instruments Incorporated
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 *
12 * * Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 *
16 * * Neither the name of Texas Instruments Incorporated nor the names of
17 * its contributors may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 *
32 */
34 /**
35 *
36 * \file icek2g_oled.h
37 *
38 * \brief This contains oled specific structure, typedefs, function prototypes
39 *
40 ******************************************************************************/
41 #ifndef _ICEK2G_OLED_H_
42 #define _ICEK2G_OLED_H_
44 /************************
45 * Include Files
46 ************************/
47 #include "icek2g_oledbitmapDb.h"
49 /************************
50 * Defines and Macros
51 ************************/
52 /** Macros for I2C slave address and instance */
53 #define OLED_SLAVE_ADDR (0x3C)
54 #define OLED_I2C_INSTANCE (1U)
56 /** Macros definitons for return types */
57 #define OLED_ERR (-1)
58 #define OLED_SUCCESS (0)
60 typedef int16_t OLED_RET;
62 /************************
63 * Function declarations
64 ************************/
66 OLED_RET oledInit(void);
67 OLED_RET init(void);
68 OLED_RET clear(void);
69 uint8_t printchar(uint8_t a);
70 OLED_RET printstr(int8_t string[]);
71 void noDisplay(void);
72 void display(void);
73 OLED_RET scrollDisplayLeft(void);
74 OLED_RET scrollDisplayLeftLine(uint8_t line);
75 OLED_RET scrollDisplayRight(void);
76 OLED_RET scrollDisplayRightLine(uint8_t line);
77 OLED_RET flip(void);
78 OLED_RET setOrientation(uint8_t newDir);
79 OLED_RET autoscroll(void);
80 OLED_RET noAutoscroll(void);
81 OLED_RET setline(uint8_t line);
82 OLED_RET setRolling(uint8_t row, uint8_t status);
83 OLED_RET resetCursor(uint8_t line);
85 #endif /* _ICEK2G_OLED_H_ */