BSP430  20141115
Board Support Package for MSP430 microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Macros | Functions | Variables
u8glib.h File Reference

Declarations related to platform-specific u8glib support. More...

#include <bsp430/core.h>
#include <bsp430/serial.h>

Go to the source code of this file.

Macros

#define configBSP430_UTILITY_U8GLIB   0
 
#define BSP430_UTILITY_U8GLIB   include <bsp430/platform.h>
 
#define BSP430_U8GLIB_REFRESH_INTERVAL_MS   0
 

Functions

int iBSP430u8gRefresh (u8g_t *u8g)
 
hBSP430halSERIAL hBSP430u8gSPI (void)
 

Variables

u8g_dev_t xBSP430u8gDevice
 

Detailed Description

Declarations related to platform-specific u8glib support.

Universal Graphics Library for 8 Bit Embedded Systems is portable library with text and graphical support for LCDs commonly used on microcontroller platforms.

u8glib is highly influenced by Arduino, and adding another target platform to the library itself would be messy; however, it's fairly easy to create bridge support in each platform to provide the interface from hardware to the library. This module defines the shared material related to the BSP430-provided interfaces.

The majority of the peripheral resource identifiers and constants are platform-specific; e.g. BSP430_PLATFORM_TRXEB_LCD_SPI_PERIPH_HANDLE. The interface for u8glib does not required that these be abstracted and made available generically.

Access to the platform-specific interface requires adding u8g_bsp430.c to the set of source files compiled into the program, along with the necessary pieces of u8glib itself including any desired fonts. Also include $(PLATFORM_U8G_PB_C) which is defined in the platform-specific Makefile.common to select the correct low-level implementation based on the display orientation and color support.

See also
U8GLIB LCD Text and Graphics
Homepage
http://github.com/pabigot/bsp430

Macro Definition Documentation

#define BSP430_U8GLIB_REFRESH_INTERVAL_MS   0

Define to an interval, in milliseconds, at which iBSP430u8gRefresh() should be invoked to keep the display stable.

If the value is zero, there is no need to periodically refresh the display.

Defaulted:
The value here is superseded by previously encountered definitions.
Platform-Based Value:
Undefined here; include <bsp430/platform.h> to obtain the correct value of this macro.
Examples:
utility/u8glib/main.c.
#define BSP430_UTILITY_U8GLIB   include <bsp430/platform.h>

Indicate that an U8GLIB LCD interface is available on the platform. This is set by the platform-specific header when configBSP430_UTILITY_U8GLIB is true and the platform supports an U8GLIB device.

If this define evaluates to false either the u8glib adaptation was not requested, or there is none provided by the platform.

See U8GLIB LCD Text and Graphics for an example of use.

C Preprocessor Only:
This macro may have a value that restricts its use to C preprocessor conditional directives.
Dependency:
configBSP430_UTILITY_U8GLIB
Defaulted:
The value here is superseded by previously encountered definitions.
#define configBSP430_UTILITY_U8GLIB   0

Define to request that platform enable its U8GLIB adaptation.

Some platforms have an on-board LCD for which a bridge to u8glib is available. Defining this macro in your <bsp430_config.h> will register a request for that device.

C Preprocessor Only:
This macro may have a value that restricts its use to C preprocessor conditional directives.
Affects:
BSP430_UTILITY_U8GLIB
Defaulted:
The value here is superseded by previously encountered definitions.

Function Documentation

hBSP430halSERIAL hBSP430u8gSPI ( void  )

Provide access to the SPI device used to communicate with the u8glib device.

Returns
The SPI device for LCD communication. Only valid after u8g_Init() has been invoked. If null is returned, the device is not usable.
Examples:
utility/u8glib/main.c.
int iBSP430u8gRefresh ( u8g_t *  u8g)

A function that should be invoked at BSP430_U8GLIB_REFRESH_INTERVAL_MS milliseconds to keep the display functioning.

For example, this is required for the Sharp Memory LCD to toggle VCOM so that DC bias does not build up within the display.

Note
This function is suitable to be invoked from an interrupt handler. The return value conforms to the expectations of Interrupt Callback Return Values.
Parameters
u8gthe u8glib handle for the display
Returns
Generally zero, or a value as described in Interrupt Callback Return Values.
Examples:
utility/u8glib/main.c.

Variable Documentation

u8g_dev_t xBSP430u8gDevice

The platform-provided device for the on-board LCD.

Dependency:
BSP430_UTILITY_U8GLIB
Examples:
utility/u8glib/main.c.