Commit 988f933d authored by Projects's avatar Projects

Added display driver (not tested).

parent c2ff44a0
This diff is collapsed.
/**************************************************************************//**
* @file display.h
* @brief Display device interface
* @version 3.20.5
******************************************************************************
* @section License
* <b>(C) Copyright 2014 Silicon Labs, http://www.silabs.com</b>
*******************************************************************************
*
* This file is licensensed under the Silabs License Agreement. See the file
* "Silabs_License_Agreement.txt" for details. Before using this software for
* any purpose, you must agree to the terms of that agreement.
*
******************************************************************************/
#ifndef _DISPLAY_H_
#define _DISPLAY_H_
#include <stdbool.h>
#include <stdint.h>
#include "emstatus.h"
#include "displayconfigall.h"
/***************************************************************************//**
* @addtogroup Drivers
* @{
******************************************************************************/
/***************************************************************************//**
* @addtogroup Display
* @brief Display device driver stack library. See @ref display_doc for
* more information.
* @{
******************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
/*******************************************************************************
******************************** DEFINES ************************************
******************************************************************************/
/** EMSTATUS codes of the display interface. */
#define DISPLAY_EMSTATUS_OK (0) /**< Operation successful. */
#define DISPLAY_EMSTATUS_NOT_ENOUGH_MEMORY (DISPLAY_EMSTATUS_BASE | 1) /**< Not enough memory. */
#define DISPLAY_EMSTATUS_OUT_OF_RANGE (DISPLAY_EMSTATUS_BASE | 2) /**< Parameters out of range. */
#define DISPLAY_EMSTATUS_INVALID_PARAMETER (DISPLAY_EMSTATUS_BASE | 3) /**< Invalid parameter. */
#define DISPLAY_EMSTATUS_NOT_SUPPORTED (DISPLAY_EMSTATUS_BASE | 4) /**< Feature/option not supported. */
#define DISPLAY_EMSTATUS_NOT_INITIALIZED (DISPLAY_EMSTATUS_BASE | 5) /**< Feature/option not supported. */
/*******************************************************************************
******************************** ENUMS ************************************
******************************************************************************/
/** Display device colour modes. */
typedef enum DISPLAY_ColourMode_t
{
DISPLAY_COLOUR_MODE_MONOCHROME, /**< White = pixel bit value = 0,
Black = pixel bit value = 1 */
DISPLAY_COLOUR_MODE_MONOCHROME_INVERSE, /**< Black = pixel bit value = 0,
White = pixel bit value = 1 */
} DISPLAY_ColourMode_t;
/** Display device address modes. */
typedef enum DISPLAY_AddressMode_t
{
DISPLAY_ADDRESSING_BY_ROWS_ONLY, /**< Display device is addressed by
rows only. I.e. a full line of
pixel data is required to update
a single pixel. */
DISPLAY_ADDRESSING_BY_ROWS_AND_COLUMNS /**< Display device is addressed by
both rows and columns. I.e. single
pixel updates is supported. */
} DISPLAY_AddressMode_t;
/** Pixel matrix handle. */
typedef void* DISPLAY_PixelMatrix_t;
/*******************************************************************************
******************************* STRUCTS ***********************************
******************************************************************************/
/** Display geometry specification. */
typedef struct DISPLAY_Geometry_t
{
unsigned int width; /**< Pixel width of display. */
unsigned int stride; /**< Total line width of display including pixels and
controls words. */
unsigned int height; /**< Pixel height of display. */
} DISPLAY_Geometry_t;
/* Forward declaration of struct DISPLAY_Device_t in order to reference it
inside the typdef. */
struct DISPLAY_Device_t;
/**
* Display device data structure, including a specification of how the
* display device behaves.
*/
typedef struct DISPLAY_Device_t
{
char* name; /**< Name of the display device. */
DISPLAY_Geometry_t geometry; /**< Geometry of the display device. */
DISPLAY_ColourMode_t colourMode; /**< Colour mode of the display device. */
DISPLAY_AddressMode_t addressMode; /**< Address mode of the display device. */
/** Turn power on display on or off. */
EMSTATUS (*pDisplayPowerOn) (struct DISPLAY_Device_t* device,
bool on);
/** Allocates a pixelMatrix buffer in the format specified by the geometry
(DISPLAY_Geometry_t) of the display device. */
EMSTATUS (*pPixelMatrixAllocate) (struct DISPLAY_Device_t* device,
unsigned int width,
#ifdef EMWIN_WORKAROUND
unsigned int userStride,
#endif
unsigned int height,
DISPLAY_PixelMatrix_t *pixelMatrix
);
/** Frees a pixelMatrix buffer */
EMSTATUS (*pPixelMatrixFree) (struct DISPLAY_Device_t* device,
DISPLAY_PixelMatrix_t pixelMatrix);
/** Copies the contents of the specified pixelMatrix buffer to the display
device. */
EMSTATUS (*pPixelMatrixDraw) (struct DISPLAY_Device_t* device,
DISPLAY_PixelMatrix_t pixelMatrix,
unsigned int startColumn,
unsigned int width,
#ifdef EMWIN_WORKAROUND
unsigned int userStride,
#endif
unsigned int startRow,
unsigned int height);
/** Clears a pixelMatrix buffer by setting all pixels to black. */
EMSTATUS (*pPixelMatrixClear) (struct DISPLAY_Device_t* device,
DISPLAY_PixelMatrix_t pixelMatrix,
unsigned int width,
unsigned int height
);
/** Refreshes the display device driver after system change, like changing
a clock frequency of some related device. */
EMSTATUS (*pDriverRefresh) (struct DISPLAY_Device_t* device);
} DISPLAY_Device_t;
/**
* Display device driver init function pointer type.
* The displayconfig.h file includes a table that contains the default
* display devices to initialize.
*/
typedef EMSTATUS (*pDisplayDeviceDriverInitFunction_t) (void);
/*******************************************************************************
************************** FUNCTION PROTOTYPES **************************
******************************************************************************/
EMSTATUS DISPLAY_Init (void);
EMSTATUS DISPLAY_DriverRefresh (void);
EMSTATUS DISPLAY_DeviceGet (int displayDeviceNo,
DISPLAY_Device_t* device);
#ifdef __cplusplus
}
#endif
/** @} (end group Display) */
/** @} (end group Drivers) */
#endif /* _DISPLAY_H_ */
/**************************************************************************//**
* @file displaybackend.h
* @brief Display device backend interface
* @version 3.20.5
******************************************************************************
* @section License
* <b>(C) Copyright 2014 Silicon Labs, http://www.silabs.com</b>
*******************************************************************************
*
* This file is licensensed under the Silabs License Agreement. See the file
* "Silabs_License_Agreement.txt" for details. Before using this software for
* any purpose, you must agree to the terms of that agreement.
*
******************************************************************************/
#ifndef _DISPLAY_BACKEND_H_
#define _DISPLAY_BACKEND_H_
#include "display.h"
/***************************************************************************//**
* @addtogroup Drivers
* @{
******************************************************************************/
/***************************************************************************//**
* @addtogroup Display
* @{
******************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
/*******************************************************************************
************************** FUNCTION PROTOTYPES **************************
******************************************************************************/
EMSTATUS DISPLAY_DeviceRegister(DISPLAY_Device_t *device);
#ifdef __cplusplus
}
#endif
/** @} (end group Display) */
/** @} (end group Drivers) */
#endif /* _DISPLAY_BACKEND_H_ */
/*
* Copyright (C) 2014 Julian Lewis
* @author Maciej Suminski <maciej.suminski@cern.ch>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @brief Display configuration file.
*/
#ifndef DISPLAYCONFIG_H
#define DISPLAYCONFIG_H
#include "displayls013b7dh03.h"
#define DISPLAY_DEVICES_MAX 1
#define INCLUDE_DISPLAY_SHARP_LS013B7DH03
// Define all display device driver initialization functions here.
#define DISPLAY_DEVICE_DRIVER_INIT_FUNCTIONS \
{ \
DISPLAY_Ls013b7dh03Init, \
NULL \
}
#endif /* DISPLAYCONFIG_H */
/***************************************************************************//**
* @file displayconfigall.h
* @brief Main configuration file for the DISPLAY driver software stack.
* @version 3.20.5
*******************************************************************************
* @section License
* <b>(C) Copyright 2014 Silicon Labs, http://www.silabs.com</b>
*******************************************************************************
*
* This file is licensensed under the Silabs License Agreement. See the file
* "Silabs_License_Agreement.txt" for details. Before using this software for
* any purpose, you must agree to the terms of that agreement.
*
******************************************************************************/
#ifndef __DISPLAYCONFIGALL_H
#define __DISPLAYCONFIGALL_H
/*
* First, we list the default INCLUDE_XXX #defines which may be excluded later
* by the kit or application specific configuration files.
*/
#define INCLUDE_PAL_GPIO_PIN_AUTO_TOGGLE
/* Then include the kit specific display configuration files which also includes
the application specific configuration file and further selects which modules
modules to include below. */
#include "displayconfig.h"
#ifdef INCLUDE_DISPLAY_SHARP_LS013B7DH03
#include "displaypalconfig.h"
#include "displayls013b7dh03config.h"
#endif
#ifdef INCLUDE_TEXTDISPLAY_SUPPORT
#include "textdisplayconfig.h"
#include "retargettextdisplayconfig.h"
#endif
#endif /* __DISPLAYCONFIGALL_H */
/***************************************************************************//**
* @file displayfont16x20.h
* @brief 16x20 font with only number characters and the colon':' and
* space ' ' signs.
* @version 3.20.5
*******************************************************************************
* @section License
* <b>(C) Copyright 2014 Silicon Labs, http://www.silabs.com</b>
*******************************************************************************
*
* This file is licensensed under the Silabs License Agreement. See the file
* "Silabs_License_Agreement.txt" for details. Before using this software for
* any purpose, you must agree to the terms of that agreement.
*
******************************************************************************/
/** @cond DO_NOT_INCLUDE_WITH_DOXYGEN */
#define NUMBERS_FONT_16x20_WIDTH (16)
#define NUMBERS_FONT_16x20_HEIGHT (20)
typedef uint16_t FontBits_t;
static const FontBits_t numbers_16x20_bits[] =
{ /* 0 1 2 3 4 5 6 7 8 9 : ' ' */
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x03c0, 0x0300, 0x07c0, 0x03e0, 0x0f00, 0x1ff8, 0x1f00, 0x1ffc, 0x07e0, 0x03e0, 0x0000, 0x0000,
0x0ff0, 0x03e0, 0x0fe0, 0x0ff0, 0x0f80, 0x1ff8, 0x3fc0, 0x1ffc, 0x0ff8, 0x07f0, 0x0000, 0x0000,
0x1e78, 0x03fc, 0x1c70, 0x0e38, 0x0f80, 0x0038, 0x31e0, 0x1c0c, 0x1c38, 0x0e38, 0x0180, 0x0000,
0x1c38, 0x03bc, 0x3838, 0x1c18, 0x0fc0, 0x0038, 0x0070, 0x1c0c, 0x381c, 0x1c1c, 0x03c0, 0x0000,
0x381c, 0x0380, 0x3838, 0x1c00, 0x0ee0, 0x0038, 0x0038, 0x0e00, 0x381c, 0x181c, 0x03c0, 0x0000,
0x381c, 0x0380, 0x3838, 0x1c00, 0x0ee0, 0x07b8, 0x0038, 0x0e00, 0x381c, 0x381c, 0x0180, 0x0000,
0x381c, 0x0380, 0x3c00, 0x0e00, 0x0e70, 0x0ff8, 0x07dc, 0x0e00, 0x1c38, 0x381c, 0x0000, 0x0000,
0x381c, 0x0380, 0x1c00, 0x07c0, 0x0e70, 0x1c38, 0x0ffc, 0x0700, 0x0ff0, 0x3c1c, 0x0000, 0x0000,
0x381c, 0x0380, 0x0e00, 0x07c0, 0x0e38, 0x3818, 0x1c7c, 0x0700, 0x0ff0, 0x3e38, 0x0000, 0x0000,
0x381c, 0x0380, 0x0700, 0x1e00, 0x0e1c, 0x3800, 0x3c3c, 0x0700, 0x1c38, 0x3ff0, 0x0000, 0x0000,
0x381c, 0x0380, 0x0380, 0x3c00, 0x3ffc, 0x3800, 0x383c, 0x0780, 0x381c, 0x3be0, 0x0180, 0x0000,
0x381c, 0x0380, 0x01c0, 0x3800, 0x3ffc, 0x3800, 0x381c, 0x0380, 0x381c, 0x3c00, 0x03c0, 0x0000,
0x381c, 0x0380, 0x00e0, 0x3800, 0x0e00, 0x3800, 0x381c, 0x0380, 0x381c, 0x1c00, 0x03c0, 0x0000,
0x1c38, 0x0380, 0x0070, 0x3800, 0x0e00, 0x3800, 0x3838, 0x0380, 0x381c, 0x0e00, 0x0180, 0x0000,
0x1e78, 0x0380, 0x0038, 0x1c0c, 0x0e00, 0x1c0c, 0x1c38, 0x01c0, 0x1c38, 0x0f8c, 0x0000, 0x0000,
0x0ff0, 0x7ffc, 0x3ffc, 0x1ffc, 0x3fc0, 0x0ffc, 0x1ff0, 0x01c0, 0x1ff8, 0x03fc, 0x0000, 0x0000,
0x03c0, 0x7ffc, 0x3ffc, 0x07f0, 0x3fc0, 0x07f0, 0x07c0, 0x01c0, 0x07e0, 0x00f8, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
};
/** @endcond */
/***************************************************************************//**
* @file displayfont6x8.h
* @brief 6x8 font with all characters
*
* @version 3.20.5
*******************************************************************************
* @section License
* <b>(C) Copyright 2014 Silicon Labs, http://www.silabs.com</b>
*******************************************************************************
*
* This file is licensensed under the Silabs License Agreement. See the file
* "Silabs_License_Agreement.txt" for details. Before using this software for
* any purpose, you must agree to the terms of that agreement.
*
******************************************************************************/
/** @cond DO_NOT_INCLUDE_WITH_DOXYGEN */
#define CHARS_FONT_6x8_WIDTH (6)
#define CHARS_FONT_6x8_HEIGHT (8)
typedef uint8_t FontBits_t;
static const FontBits_t chars_6x8_bits[] =
{
0x00, 0x04, 0x0a, 0x0a, 0x04, 0x03, 0x06, 0x06, 0x08, 0x02, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x0e, 0x04, 0x0e, 0x1f, 0x08, 0x1f, 0x0c, 0x1f,
0x0e, 0x0e, 0x00, 0x00, 0x10, 0x00, 0x01, 0x0e, 0x0e, 0x0e, 0x0f, 0x0e,
0x07, 0x1f, 0x1f, 0x0e, 0x11, 0x0e, 0x1c, 0x11, 0x01, 0x11, 0x11, 0x0e,
0x0f, 0x0e, 0x0f, 0x1e, 0x1f, 0x11, 0x11, 0x11, 0x11, 0x11, 0x1f, 0x0e,
0x00, 0x0e, 0x04, 0x00, 0x02, 0x00, 0x01, 0x00, 0x10, 0x00, 0x0c, 0x00,
0x01, 0x04, 0x08, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x04, 0x06, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x0a, 0x0a, 0x1e, 0x13, 0x09, 0x04,
0x04, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x11, 0x06, 0x11, 0x08,
0x0c, 0x01, 0x02, 0x10, 0x11, 0x11, 0x06, 0x06, 0x08, 0x00, 0x02, 0x11,
0x10, 0x11, 0x11, 0x11, 0x09, 0x01, 0x01, 0x11, 0x11, 0x04, 0x08, 0x09,
0x01, 0x1b, 0x11, 0x11, 0x11, 0x11, 0x11, 0x01, 0x04, 0x11, 0x11, 0x11,
0x11, 0x11, 0x10, 0x02, 0x00, 0x08, 0x0a, 0x00, 0x04, 0x00, 0x01, 0x00,
0x10, 0x00, 0x12, 0x1e, 0x01, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x04, 0x08, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x0a, 0x1f,
0x01, 0x08, 0x05, 0x02, 0x02, 0x08, 0x15, 0x04, 0x00, 0x00, 0x00, 0x10,
0x19, 0x04, 0x10, 0x04, 0x0a, 0x0f, 0x01, 0x08, 0x11, 0x11, 0x06, 0x06,
0x04, 0x1f, 0x04, 0x10, 0x10, 0x11, 0x11, 0x01, 0x11, 0x01, 0x01, 0x01,
0x11, 0x04, 0x08, 0x05, 0x01, 0x15, 0x13, 0x11, 0x11, 0x11, 0x11, 0x01,
0x04, 0x11, 0x11, 0x11, 0x0a, 0x11, 0x08, 0x02, 0x01, 0x08, 0x11, 0x00,
0x08, 0x0e, 0x0d, 0x0e, 0x16, 0x0e, 0x02, 0x11, 0x0d, 0x06, 0x0c, 0x09,
0x04, 0x0b, 0x0d, 0x0e, 0x0f, 0x16, 0x0d, 0x0e, 0x07, 0x11, 0x11, 0x11,
0x11, 0x11, 0x1f, 0x02, 0x04, 0x08, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x04, 0x00, 0x0a, 0x0e, 0x04, 0x02, 0x00, 0x02, 0x08, 0x0e, 0x1f,
0x00, 0x1f, 0x00, 0x08, 0x15, 0x04, 0x08, 0x08, 0x09, 0x10, 0x0f, 0x04,
0x0e, 0x1e, 0x00, 0x00, 0x02, 0x00, 0x08, 0x08, 0x16, 0x11, 0x0f, 0x01,
0x11, 0x0f, 0x0f, 0x1d, 0x1f, 0x04, 0x08, 0x03, 0x01, 0x15, 0x15, 0x11,
0x0f, 0x11, 0x0f, 0x0e, 0x04, 0x11, 0x11, 0x15, 0x04, 0x0a, 0x04, 0x02,
0x02, 0x08, 0x00, 0x00, 0x00, 0x10, 0x13, 0x01, 0x19, 0x11, 0x07, 0x11,
0x13, 0x04, 0x08, 0x05, 0x04, 0x15, 0x13, 0x11, 0x11, 0x19, 0x13, 0x01,
0x02, 0x11, 0x11, 0x11, 0x0a, 0x11, 0x08, 0x01, 0x04, 0x10, 0x08, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x10, 0x02, 0x15, 0x00,
0x02, 0x08, 0x15, 0x04, 0x06, 0x00, 0x00, 0x04, 0x13, 0x04, 0x04, 0x10,
0x1f, 0x10, 0x11, 0x02, 0x11, 0x10, 0x06, 0x06, 0x04, 0x1f, 0x04, 0x04,
0x15, 0x1f, 0x11, 0x01, 0x11, 0x01, 0x01, 0x11, 0x11, 0x04, 0x08, 0x05,
0x01, 0x11, 0x19, 0x11, 0x01, 0x15, 0x05, 0x10, 0x04, 0x11, 0x11, 0x15,
0x0a, 0x04, 0x02, 0x02, 0x04, 0x08, 0x00, 0x00, 0x00, 0x1e, 0x11, 0x01,
0x11, 0x1f, 0x02, 0x1e, 0x11, 0x04, 0x08, 0x03, 0x04, 0x15, 0x11, 0x11,
0x0f, 0x1e, 0x01, 0x0e, 0x02, 0x11, 0x11, 0x15, 0x04, 0x1e, 0x04, 0x02,
0x04, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a,
0x0f, 0x19, 0x09, 0x00, 0x04, 0x04, 0x04, 0x04, 0x04, 0x00, 0x06, 0x02,
0x11, 0x04, 0x02, 0x11, 0x08, 0x11, 0x11, 0x02, 0x11, 0x08, 0x06, 0x04,
0x08, 0x00, 0x02, 0x00, 0x15, 0x11, 0x11, 0x11, 0x09, 0x01, 0x01, 0x11,
0x11, 0x04, 0x09, 0x09, 0x01, 0x11, 0x11, 0x11, 0x01, 0x09, 0x09, 0x10,
0x04, 0x11, 0x0a, 0x15, 0x11, 0x04, 0x01, 0x02, 0x08, 0x08, 0x00, 0x00,
0x00, 0x11, 0x11, 0x11, 0x11, 0x01, 0x02, 0x10, 0x11, 0x04, 0x09, 0x05,
0x04, 0x11, 0x11, 0x11, 0x01, 0x10, 0x01, 0x10, 0x12, 0x19, 0x0a, 0x15,
0x0a, 0x10, 0x02, 0x02, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x04, 0x00, 0x0a, 0x04, 0x18, 0x16, 0x00, 0x08, 0x02, 0x00, 0x00,
0x02, 0x00, 0x06, 0x01, 0x0e, 0x0e, 0x1f, 0x0e, 0x08, 0x0e, 0x0e, 0x02,
0x0e, 0x06, 0x00, 0x02, 0x10, 0x00, 0x01, 0x04, 0x0e, 0x11, 0x0f, 0x0e,
0x07, 0x1f, 0x01, 0x0e, 0x11, 0x0e, 0x06, 0x11, 0x1f, 0x11, 0x11, 0x0e,
0x01, 0x16, 0x11, 0x0f, 0x04, 0x0e, 0x04, 0x0a, 0x11, 0x04, 0x1f, 0x0e,
0x10, 0x0e, 0x00, 0x1f, 0x00, 0x1e, 0x0f, 0x0e, 0x1e, 0x0e, 0x02, 0x0e,
0x11, 0x0e, 0x06, 0x09, 0x0e, 0x11, 0x11, 0x0e, 0x01, 0x10, 0x01, 0x0f,
0x0c, 0x16, 0x04, 0x0a, 0x11, 0x0e, 0x1f, 0x0c, 0x04, 0x06, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/** @endcond */
/***************************************************************************//**
* @file displayfont8x8.h
* @brief 8x8 font with all characters
*
* @version 3.20.5
*******************************************************************************
* @section License
* <b>(C) Copyright 2014 Silicon Labs, http://www.silabs.com</b>
*******************************************************************************
*
* This file is licensensed under the Silabs License Agreement. See the file
* "Silabs_License_Agreement.txt" for details. Before using this software for
* any purpose, you must agree to the terms of that agreement.
*
******************************************************************************/
/** @cond DO_NOT_INCLUDE_WITH_DOXYGEN */
#define NUMBERS_FONT_8x8_WIDTH (8)
#define NUMBERS_FONT_8x8_HEIGHT (8)
typedef uint8_t FontBits_t;
static const FontBits_t chars_8x8_bits[] =
{
0x00, 0x18, 0x6c, 0x6c, 0x10, 0xce, 0x38, 0x08, 0x60, 0x0c, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x7c, 0x30, 0x7c, 0x7c, 0xc6, 0xfe, 0x7c, 0xfe,
0x7c, 0x7c, 0x00, 0x00, 0x70, 0x00, 0x1c, 0x7c, 0x7c, 0x7c, 0x7e, 0x7c,
0x7e, 0xfe, 0xfe, 0x7c, 0xc6, 0x3c, 0x78, 0xc6, 0x06, 0xc6, 0xc6, 0x7c,
0x7e, 0x7c, 0x7e, 0x7c, 0x7e, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xfe, 0x7c,
0x00, 0x7c, 0x10, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x60, 0x00, 0x38, 0x00,
0x06, 0x00, 0x00, 0x06, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x18, 0x18, 0x8c, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x6c, 0xfe, 0xfc, 0x6a, 0x2c, 0x18,
0x30, 0x18, 0x6c, 0x18, 0x00, 0x00, 0x00, 0xc0, 0xc6, 0x38, 0xc6, 0xc6,
0xc6, 0x06, 0xc6, 0xc0, 0xc6, 0xc6, 0x18, 0x18, 0x38, 0x7c, 0x38, 0xc6,
0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x06, 0x06, 0xc6, 0xc6, 0x18, 0x30, 0x66,
0x06, 0xee, 0xce, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x18, 0xc6, 0xc6, 0xc6,
0xc6, 0xc6, 0xc0, 0x0c, 0x06, 0x60, 0x38, 0x00, 0x0c, 0x00, 0x06, 0x00,
0x60, 0x00, 0x0c, 0x00, 0x06, 0x18, 0x30, 0x06, 0x0c, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
0x18, 0x30, 0xd6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x48, 0xfe,
0x16, 0x2e, 0x2c, 0x18, 0x18, 0x30, 0x38, 0x18, 0x00, 0x00, 0x00, 0x60,
0xc6, 0x30, 0x60, 0xc0, 0xc6, 0x06, 0x06, 0x60, 0xc6, 0xc6, 0x18, 0x18,
0x1c, 0x7c, 0x70, 0xc6, 0xf6, 0xc6, 0xc6, 0x06, 0xc6, 0x06, 0x06, 0x06,
0xc6, 0x18, 0x30, 0x36, 0x06, 0xfe, 0xde, 0xc6, 0xc6, 0xc6, 0xc6, 0x06,
0x18, 0xc6, 0xc6, 0xc6, 0x6c, 0xc6, 0x60, 0x0c, 0x0c, 0x60, 0x6c, 0x00,
0x04, 0x3c, 0x3e, 0x3c, 0x7c, 0x3c, 0x3c, 0x3c, 0x3e, 0x00, 0x00, 0x66,
0x0c, 0x6e, 0x3e, 0x3c, 0x3e, 0x3c, 0x36, 0x3c, 0x18, 0x66, 0x66, 0xc6,
0x66, 0x66, 0x7e, 0x18, 0x18, 0x30, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x18, 0x00, 0x6c, 0x7c, 0x10, 0xdc, 0x00, 0x18, 0x30, 0xfe, 0x7e,
0x1c, 0x7e, 0x00, 0x30, 0xc6, 0x30, 0x30, 0x70, 0xfe, 0x7e, 0x7e, 0x30,
0x7c, 0xfc, 0x00, 0x00, 0x0e, 0x00, 0xe0, 0x70, 0xf6, 0xfe, 0x7e, 0x06,
0xc6, 0x1e, 0x1e, 0xf6, 0xfe, 0x18, 0x30, 0x1e, 0x06, 0xd6, 0xf6, 0xc6,
0x7e, 0xc6, 0x7e, 0x7c, 0x18, 0xc6, 0xc6, 0xd6, 0x38, 0xfc, 0x30, 0x0c,
0x18, 0x60, 0xc6, 0x00, 0x00, 0x60, 0x66, 0x06, 0x66, 0x66, 0x0c, 0x66,
0x66, 0x18, 0x30, 0x36, 0x0c, 0xd6, 0x66, 0x66, 0x66, 0x66, 0x6e, 0x06,
0x7c, 0x66, 0x66, 0xc6, 0x3c, 0x66, 0x30, 0x0c, 0x00, 0x60, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xd0, 0xe8, 0x66, 0x00,
0x18, 0x30, 0x38, 0x7e, 0x1c, 0x7e, 0x1c, 0x18, 0xc6, 0x30, 0x18, 0xc0,
0xc0, 0xc0, 0xc6, 0x18, 0xc6, 0xc0, 0x18, 0x18, 0x1c, 0x7c, 0x70, 0x30,
0x76, 0xc6, 0xc6, 0x06, 0xc6, 0x06, 0x06, 0xc6, 0xc6, 0x18, 0x30, 0x36,
0x06, 0xc6, 0xe6, 0xc6, 0x06, 0xb6, 0xc6, 0xc0, 0x18, 0xc6, 0xc6, 0xfe,
0x6c, 0xc0, 0x18, 0x0c, 0x30, 0x60, 0x00, 0x00, 0x00, 0x7c, 0x66, 0x06,
0x66, 0x7e, 0x0c, 0x7c, 0x66, 0x18, 0x30, 0x1e, 0x0c, 0xd6, 0x66, 0x66,
0x3e, 0x56, 0x06, 0x3c, 0x18, 0x66, 0x66, 0xd6, 0x18, 0x7c, 0x18, 0x18,
0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0xfe,
0x7e, 0xac, 0x66, 0x00, 0x30, 0x18, 0x6c, 0x18, 0x18, 0x00, 0x1c, 0x0c,
0xc6, 0x30, 0x0c, 0xc6, 0xc0, 0xc6, 0xc6, 0x0c, 0xc6, 0xc6, 0x18, 0x18,
0x38, 0x7c, 0x38, 0x00, 0x06, 0xc6, 0xc6, 0xc6, 0xc6, 0x06, 0x06, 0xc6,
0xc6, 0x18, 0x36, 0x66, 0x06, 0xc6, 0xc6, 0xc6, 0x06, 0x66, 0xc6, 0xc6,
0x18, 0xc6, 0x6c, 0xee, 0xc6, 0xc0, 0x0c, 0x0c, 0x60, 0x60, 0x00, 0xfe,
0x00, 0x66, 0x66, 0x06, 0x66, 0x06, 0x0c, 0x60, 0x66, 0x18, 0x36, 0x36,
0x0c, 0xc6, 0x66, 0x66, 0x06, 0x26, 0x06, 0x60, 0x18, 0x66, 0x3c, 0xd6,
0x3c, 0x60, 0x0c, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x18, 0x00, 0x6c, 0x10, 0xe6, 0xdc, 0x00, 0x60, 0x0c, 0x00, 0x18,
0x0c, 0x00, 0x1c, 0x06, 0x7c, 0x78, 0xfe, 0x7c, 0xc0, 0x7c, 0x7c, 0x06,
0x7c, 0x7c, 0x00, 0x0c, 0x70, 0x00, 0x1c, 0x30, 0x7c, 0xc6, 0x7e, 0x7c,
0x7e, 0xfe, 0x06, 0xfc, 0xc6, 0x3c, 0x1c, 0xc6, 0xfe, 0xc6, 0xc6, 0x7c,
0x06, 0xdc, 0xc6, 0x7c, 0x18, 0x7c, 0x38, 0xc6, 0xc6, 0x7e, 0xfe, 0x7c,
0xc0, 0x7c, 0x00, 0xfe, 0x00, 0x7c, 0x3e, 0x3c, 0x7c, 0x3c, 0x0c, 0x3e,
0x66, 0x70, 0x1c, 0x66, 0x38, 0xc6, 0x66, 0x3c, 0x06, 0x5c, 0x06, 0x3e,
0x70, 0x7c, 0x18, 0xfc, 0x66, 0x3e, 0x7e, 0x30, 0x18, 0x18, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/** @endcond */
This diff is collapsed.
/**************************************************************************//**
* @file displayls013b7dh03.h
* @brief Configuration for the display driver for the Sharp Memory LCD
* LS013B7DH03
* @version 3.20.5
******************************************************************************
* @section License
* <b>(C) Copyright 2014 Silicon Labs, http://www.silabs.com</b>
*******************************************************************************
*
* This file is licensensed under the Silabs License Agreement. See the file
* "Silabs_License_Agreement.txt" for details. Before using this software for
* any purpose, you must agree to the terms of that agreement.
*
******************************************************************************/
#ifndef _DISPLAY_LS013B7DH03_H_
#define _DISPLAY_LS013B7DH03_H_
#include "emstatus.h"
/** @cond DO_NOT_INCLUDE_WITH_DOXYGEN */
#ifdef __cplusplus
extern "C" {
#endif
/*******************************************************************************
******************************** DEFINES ************************************
******************************************************************************/
/* Display geometry */
#define LS013B7DH03_WIDTH (128)
#define LS013B7DH03_HEIGHT (128)
/*******************************************************************************
************************** FUNCTION PROTOTYPES **************************
******************************************************************************/
/* Initialization function for the LS013B7DH03 device driver. */
EMSTATUS DISPLAY_Ls013b7dh03Init(void);
#ifdef __cplusplus
}
#endif
/** @endcond */
#endif /* _DISPLAY_LS013B7DH03_H_ */
/*
* Copyright (C) 2014 Julian Lewis
* @author Maciej Suminski <maciej.suminski@cern.ch>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef DISPLAYLS013B7DH03CONFIG_H
#define DISPLAYLS013B7DH03CONFIG_H
#include "em_gpio.h"
#define SHARP_MEMLCD_DEVICE_NAME "lcd"
#define LCD_PORT_SCLK gpioPortC
#define LCD_PIN_SCLK 4
#define LCD_PORT_SI gpioPortC
#define LCD_PIN_SI 2
#define LCD_PORT_SCS gpioPortC
#define LCD_PIN_SCS 5
#define LCD_PORT_EXTCOMIN gpioPortA
#define LCD_PIN_EXTCOMIN 2
#define LCD_PORT_DISP_SEL gpioPortC
#define LCD_PIN_DISP_SEL 0
#define LCD_PORT_DISP_PWR gpioPortC
#define LCD_PIN_DISP_PWR 1
// This is hardwired
//#define LCD_PORT_EXTMODE gpioPortC
//#define LCD_PIN_EXTMODE 1
// Select how LCD polarity inversion should be handled.
// If POLARITY_INVERSION_EXTCOMIN is defined, the EXTMODE pin is set to HIGH,
// and the polarity inversion is armed for every rising edge of the EXTCOMIN
// pin. The actual polarity inversion is triggered at the next transision of
// SCS. This mode is recommended because it causes less CPU and SPI load
// than the alternative mode, see below.
// If POLARITY_INVERSION_EXTCOMIN is undefined, the EXTMODE pin is set to
// LOW, and the polarity inversion is toggled by sending an SPI command.
// This mode causes more CPU and SPI load than using the EXTCOMIN pin mode.
#define POLARITY_INVERSION_EXTCOMIN
// Define POLARITY_INVERSION_EXTCOMIN_PAL_AUTO_TOGGLE if you want the PAL
// (Platform Abstraction Layer interface) to automatically toggle the
// EXTCOMIN pin.
// If the PAL_TIMER_REPEAT function is defined the EXTCOMIN toggling is
// handled by a timer repeat system, then
// POLARITY_INVERSION_EXTCOMIN_PAL_AUTO_TOGGLE should be undefined.
#define POLARITY_INVERSION_EXTCOMIN_PAL_AUTO_TOGGLE
#endif /* DISPLAYLS013B7DH03CONFIG_H */
/**************************************************************************//**
* @file displaypal.h
* @brief Platform Abstraction Layer (PAL) interface for DISPLAY driver.
* @version 3.20.5
******************************************************************************
* @section License
* <b>(C) Copyright 2014 Silicon Labs, http://www.silabs.com</b>
*******************************************************************************
*
* This file is licensensed under the Silabs License Agreement. See the file
* "Silabs_License_Agreement.txt" for details. Before using this software for
* any purpose, you must agree to the terms of that agreement.
*
******************************************************************************/
#ifndef _DISPLAY_PAL_H_
#define _DISPLAY_PAL_H_
#include "emstatus.h"
#ifdef __cplusplus
extern "C" {
#endif
/*******************************************************************************
******************************** DEFINES ************************************
******************************************************************************/
/** EMSTATUS codes of the PAL interface. */
#define PAL_EMSTATUS_OK (0) /**< Operation successful. */
#define PAL_EMSTATUS_INVALID_PARAM (PAL_EMSTATUS_BASE | 1) /**< Invalid parameter. */
#define PAL_EMSTATUS_REPEAT_FAILED (PAL_EMSTATUS_BASE | 2) /**< Repeat failed. */
/** @cond DO_NOT_INCLUDE_WITH_DOXYGEN */
/*******************************************************************************
******************************** ENUMS ************************************
******************************************************************************/
/** PAL GPIO Pin modes. */
typedef enum
{
/** Push-pull output */
palGpioModePushPull
} PAL_GpioMode_t;
/*******************************************************************************
************************** FUNCTION PROTOTYPES **************************
******************************************************************************/
/**************************************************************************//**
* @brief Initialize the PAL GPIO interface
*
* @detail This function initializes all resources required to support the
* PAL GPIO interface functions.
*
* @return EMSTATUS code of the operation.
*****************************************************************************/
EMSTATUS PAL_GpioInit (void);
/**************************************************************************//**
* @brief Shutdown the PAL GPIO interface
*
* @detail This function releases/stops all resources used by the
* PAL GPIO interface functions.
*
* @return EMSTATUS code of the operation.
*****************************************************************************/
EMSTATUS PAL_GpioShutdown (void);
/***************************************************************************//**
* @brief
* Set the mode for a GPIO pin.
*
* @param[in] port
* The GPIO port to access.
*
* @param[in] pin
* The pin number in the port.
*
* @param[in] mode
* The desired pin mode.
*
* @param[in] platformSpecific
* Platform specific value which may need to be set.
* For EFM32:
* Value to set for pin in DOUT register. The DOUT setting is important for
* even some input mode configurations, determining pull-up/down direction.
******************************************************************************/
EMSTATUS PAL_GpioPinModeSet(unsigned int port,
unsigned int pin,
PAL_GpioMode_t mode,
unsigned int platformSpecific);
/***************************************************************************//**
* @brief
* Set a single pin in GPIO data out register to 1.
*
* @note
* In order for the setting to take effect on the output pad, the pin must
* have been configured properly. If not, it will take effect whenever the
* pin has been properly configured.
*
* @param[in] port
* The GPIO port to access.
*
* @param[in] pin
* The pin to set.
******************************************************************************/
EMSTATUS PAL_GpioPinOutSet(unsigned int port, unsigned int pin);
/***************************************************************************//**
* @brief
* Set a single pin in GPIO data out port register to 0.
*
* @note
* In order for the setting to take effect on the output pad, the pin must
* have been configured properly. If not, it will take effect whenever the
* pin has been properly configured.
*
* @param[in] port
* The GPIO port to access.
*
* @param[in] pin
* The pin to set.
******************************************************************************/
EMSTATUS PAL_GpioPinOutClear(unsigned int port, unsigned int pin);
/***************************************************************************//**
* @brief
* Toggle a single pin in GPIO port data out register.
*
* @note
* In order for the setting to take effect on the output pad, the pin must
* have been configured properly. If not, it will take effect whenever the
* pin has been properly configured.
*
* @param[in] port
* The GPIO port to access.
*
* @param[in] pin
* The pin to toggle.
******************************************************************************/
EMSTATUS PAL_GpioPinOutToggle(unsigned int port, unsigned int pin);
/**************************************************************************//**
* @brief Toggle a GPIO pin automatically at the given frequency.
*
* @param[in] gpioPort GPIO port number of GPIO ping to toggle.
* @param[in] gpioPin GPIO pin number.
*
* @return EMSTATUS code of the operation.
*****************************************************************************/
EMSTATUS PAL_GpioPinAutoToggle (unsigned int gpioPort,
unsigned int gpioPin,
unsigned int frequency);
/**************************************************************************//**
* @brief Initialize the PAL SPI interface
*
* @detail This function initializes all resources required to support the
* PAL SPI interface functions.
*
* @return EMSTATUS code of the operation.
*****************************************************************************/
EMSTATUS PAL_SpiInit (void);
/**************************************************************************//**
* @brief Shutdown the PAL SPI interface
*
* @detail This function releases/stops all resources used by the
* PAL SPI interface functions.
*
* @return EMSTATUS code of the operation.
*****************************************************************************/
EMSTATUS PAL_SpiShutdown (void);
/**************************************************************************//**
* @brief Transmit data on the SPI interface.
*
* @param[in] data Pointer to the data to be transmitted.
* @param[in] len Length of data to transmit.
*
* @return EMSTATUS code of the operation.
*****************************************************************************/
EMSTATUS PAL_SpiTransmit (uint8_t* data, unsigned int len);
/**************************************************************************//**
* @brief Initialize the PAL Timer interface
*
* @detail This function initializes all resources required to support the
* PAL Timer interface functions.
*
* @return EMSTATUS code of the operation.
*****************************************************************************/
EMSTATUS PAL_TimerInit (void);
/**************************************************************************//**
* @brief Shutdown the PAL Timer interface
*
* @detail This function releases/stops all resources used by the
* PAL Timer interface functions.
*
* @return EMSTATUS code of the operation.
*****************************************************************************/
EMSTATUS PAL_TimerShutdown (void);
/**************************************************************************//**
* @brief Delay for the specified number of micro seconds.
*
* @param[in] usecs Number of micro seconds to delay.
*
* @return EMSTATUS code of the operation.
*****************************************************************************/
EMSTATUS PAL_TimerMicroSecondsDelay(unsigned int usecs);
#ifdef PAL_TIMER_REPEAT_FUNCTION
/**************************************************************************//**
* @brief Call a callback function at the given frequency.
*
* @param[in] pFunction Pointer to function that should be called at the
* given frequency.
* @param[in] argument Argument to be given to the function.
* @param[in] frequency Frequency at which to call function at.
*
* @return EMSTATUS code of the operation.
*****************************************************************************/
EMSTATUS PAL_TimerRepeat (void(*pFunction)(void*),
void* argument,
unsigned int frequency);
#endif
#ifdef __cplusplus
}
#endif
/** @endcond */
#endif /* _DISPLAY_PAL_H_ */
/*
* Copyright (C) 2014 Julian Lewis
* @author Maciej Suminski <maciej.suminski@cern.ch>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @brief Display Platform Abstraction Layer configuration file.
*/
#ifndef DISPLAYPALCONFIG_H
#define DISPLAYPALCONFIG_H
#include "em_usart.h"
#include "em_cmu.h"
// The user should select one of the following as RTC clock source.
// Selects the LFXO oscillator as source for the RTC clock.
#define PAL_RTC_CLOCK_LFXO
// Selects the LFRCO oscillator as source for the RTC clock.
//#define PAL_RTC_CLOCK_LFRCO
// Selects the ULFRCO oscillator as source for the RTC clock.
//#define PAL_RTC_CLOCK_ULFRCO
// Select which USART device to use as SPI interface.
#define PAL_SPI_USART_UNIT USART2
// Select which USART clock is used to clock the SPI interface.
#define PAL_SPI_USART_CLOCK cmuClock_HFPER
// Route location of the USART/SPI pins.
#define PAL_SPI_USART_LOCATION 0
// Specifies the SPI baud rate.
#define PAL_SPI_BAUDRATE 500000
#endif /* DISPLAYPALCONFIG_H */
This diff is collapsed.
/**************************************************************************//**
* @file emstatus.h
* @brief EMSTATUS definitions.
* @version 3.20.5
******************************************************************************
* @section License
* <b>(C) Copyright 2014 Silicon Labs, http://www.silabs.com</b>
*******************************************************************************
*
* This file is licensensed under the Silabs License Agreement. See the file
* "Silabs_License_Agreement.txt" for details. Before using this software for
* any purpose, you must agree to the terms of that agreement.
*
******************************************************************************/
#ifndef _EMSTATUS_H_
#define _EMSTATUS_H_
#include <stdint.h>
#include "em_types.h" /* typedef uint32_t EMSTATUS; */
/** Common EMSTATUS codes: */
#define EMSTATUS_OK (0) /**< Operation successful. */
/** EMSTATUS base codes for display modules. */
#define DISPLAY_EMSTATUS_BASE (0x8011UL<<16) /**< EMSTATUS base code of DISPLAY driver interface. */
#define TEXTDISPLAY_EMSTATUS_BASE (0x8012UL<<16) /**< EMSTATUS base code of TEXTDISPLAY module. */
#define PAL_EMSTATUS_BASE (0x8013UL<<16) /**< EMSTATUS base code of PAL interface. */
#endif /* _EMSTATUS_H_ */
This diff is collapsed.
/**************************************************************************//**
* @file udelay.h
* @brief Microsecond delay routine.
* @version 3.20.5
******************************************************************************
* @section License
* <b>(C) Copyright 2014 Silicon Labs, http://www.silabs.com</b>
*******************************************************************************
*
* This file is licensensed under the Silabs License Agreement. See the file
* "Silabs_License_Agreement.txt" for details. Before using this software for
* any purpose, you must agree to the terms of that agreement.
*
******************************************************************************/
#ifndef __UDELAY_H
#define __UDELAY_H
#include <stdint.h>
/***************************************************************************//**
* @addtogroup Drivers
* @{
******************************************************************************/
/***************************************************************************//**
* @addtogroup Udelay
* @{
******************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
void UDELAY_Calibrate(void);
void UDELAY_Delay(uint32_t usecs);
#ifdef __cplusplus
}
#endif
/** @} (end group Udelay) */
/** @} (end group Drivers) */
#endif
......@@ -111,7 +111,10 @@ LIBS = -Wl,--start-group -lgcc -lc -lnosys -Wl,--end-group
INCLUDEPATHS += \
-I../common/CMSIS/Include \
-I../common/Device/EnergyMicro/EFM32GG/Include \
-I../common/emlib/inc
-I../common/emlib/inc \
-I../common/drivers \
-I../common/glib \
-I../common
####################################################################
# Files #
......@@ -119,10 +122,18 @@ INCLUDEPATHS += \
C_SRC += \
../common/Device/EnergyMicro/EFM32GG/Source/system_efm32gg.c \
../common/emlib/src/em_system.c \
../common/emlib/src/em_cmu.c \
../common/drivers/display.c \
../common/drivers/displayls013b7dh03.c \
../common/drivers/displaypalemlib.c \
../common/emlib/src/em_assert.c \
../common/emlib/src/em_cmu.c \
../common/emlib/src/em_emu.c \
../common/emlib/src/em_gpio.c \
../common/emlib/src/em_int.c \
../common/emlib/src/em_system.c \
../common/emlib/src/em_rtc.c \
../common/emlib/src/em_usart.c \
../common/udelay.c \
blink.c
s_SRC +=
......
......@@ -35,6 +35,7 @@
#include "em_device.h"
#include "em_cmu.h"
#include "em_gpio.h"
#include "display.h"
/* Counts 1ms timeTicks */
volatile uint32_t msTicks;
......@@ -80,6 +81,8 @@ int main(void)
GPIO_PinModeSet(gpioPortD, i, gpioModePushPull, 0);
}
DISPLAY_Init();
/* Infinite blink loop */
while (1) {
for (i = 1; i < 5; ++i) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment