/**
 * \file   osdrv_oledlcd.h
 *
 *  \brief 
 *
*/
/*
 * Copyright (c) 2012 Texas Instruments Incorporated ALL RIGHTS RESERVED
 */

#ifndef _OSDRV_OLEDLCD_H
#define _OSDRV_OLEDLCD_H

#ifdef __cplusplus
extern "C" {
#endif

/* ========================================================================== */
/*                             Include Files                                  */
/* ========================================================================== */
#include <stdio.h>
#include "hw_types.h"
#include "delay.h"
#include "hsi2c.h"
/* ========================================================================== */
/*                           Macros & Typedefs                                */
/* ========================================================================== */
/** \brief I2C instance used for OLED LCD. */
#define OLEDLCD_I2C_ADDR         	0x3C
/** \brief I2C Channel number for  OLED LCD*/
#define OLEDLCD_I2C_BUS_NUM			0

/** \brief */
#define XLevelL		0x00
/** \brief */
#define XLevelH		0x10
/** \brief */
#define XLevel		((XLevelH&0x0F)*16+XLevelL)
/** \brief */
#define Max_Column	128
/** \brief */
#define Max_Row		16
/** \brief */
#define	Brightness	0x3F
/* ========================================================================== */
/*                         Structures and Enums                               */
/* ========================================================================== */

/* ========================================================================== */
/*                            Global Variables Declarations                   */
/* ========================================================================== */

/* ========================================================================== */
/*                          Function Declarations                             */
/* ========================================================================== */
/**
 * \brief   Routine to impose delay in between OLED operations
 *
 * \param   n       Delay value
 *
 *
 * \return  None.
 *
 **/
void OLEDDelay(unsigned char n);
/**
 * \brief   Routine to initializes the I2C OLED LCD
 *
 *
 *
 * \return 
 *   SUCCESS for success 
 *   FAIL for error   
 *
 **/
short OLEDInit(void);
/**
 * \brief   This routine  sets the LCD Display off
 *
 * \param   d   ON/OFF - 1 or 0    
 *
 *
 * \return  None.
 *
 **/
short OLEDSetDisplayOnOff(unsigned char d);
/**
 * \brief   Routine to fade out the diaplay contents
 *
 *
 * \return  None.
 *
 **/
void OLEDFadeOut(void);
/**
 * \brief   Routine to fade in the diaplay contents
 *
 *
 * \return  None.
 *
 **/
void OLEDFadeIn(void);
/**
 * \brief   Scrolling (Full Screen)
 *
 * \param     a: Scrolling Direction
 *              "0x00" (Vertical & Rightward)
 *              "0x01" (Vertical & Leftward)
 * \param    b: Define Start Row Address (Horizontal / Diagonal Scrolling)
 * \param    c: Define End Page Address (Horizontal / Diagonal Scrolling)
 * \param    d: Set Top Fixed Area (Vertical Scrolling)
 * \param    e: Set Vertical Scroll Area (Vertical Scrolling)
 * \param    f: Set Numbers of Row Scroll per Step (Vertical / Diagonal Scrolling)
 * \param    g: Set Time Interval between Each Scroll Step in Terms of Frame Frequency
 * \param    h: Delay Time
 * \param    * d+e must be less than or equal to the Multiplex Ratio...*
 *
 * \return  None.
 *
 **/
void OLEDContinuousScroll(unsigned char a, unsigned char b, unsigned char c, unsigned char d, 
                       unsigned char e, unsigned char f, unsigned char g, unsigned char h);
                       

/**
 * \brief   Routine to do Vertical / Fade Scrolling (Partial or Full Screen)
 *
 * \param    a: Scrolling Direction
 *              "0x00" (Upward)
 *              "0x01" (Downward)
 * \param    b: Set Top Fixed Area
 * \param    c: Set Vertical Scroll Area
 * \param    d: Set Numbers of Row Scroll per Step
 * \param    e: Set Time Interval between Each Scroll Step
 *
 * \return  None.
 *
 **/
void OLEDVerticalScroll(unsigned char a, unsigned char b, 
                        unsigned char c, unsigned char d, unsigned char e);
                       
                       
/**
 * \brief   Routine to fill LCD RAM with specified data
 *
 * \param   Data    Byte value to be filled     
 *
 *
 * \return  None.
 *
 **/
void OLEDFillRAM(unsigned char Data);
/**
 * \brief   Routine to draw check
 *
 *
 *
 * \return  None.
 *
 **/
void OLEDCheckerboard(void);
/**
 * \brief   Routine to draw a frame in LCD
 *
 *
 *
 * \return  None.
 *
 **/
void OLEDFrame(void);
/**
 * \brief   Routine to Deactivate the scrolling property
 *
 *
 *
 * \return  None.
 *
 **/
void OLEDDeactivateScroll(void);
/**
 * \brief   Routine to Show a string in LCD panel
 *
 * \param   a    
 * \param   Data_Pointer
 * \param   b
 * \param   c
 *
 *
 * \return  None.
 *
 **/
void OLEDShowString(unsigned char a, unsigned char *Data_Pointer, unsigned char b, unsigned char c);
#ifdef __cplusplus
}
#endif 

#endif      //_OSDRV_OLEDLCD_H

