BSP430
20141115
Board Support Package for MSP430 microcontrollers
|
Interface for Sharp Memory LCD displays. More...
Go to the source code of this file.
Data Structures | |
struct | sBSP430sharplcd |
Typedefs | |
typedef struct sBSP430sharplcd | sBSP430sharplcd |
typedef sBSP430sharplcd * | hBSP430sharplcd |
Functions | |
hBSP430sharplcd | hBSP430sharplcdInitializePlatformDevice (hBSP430sharplcd dev) |
int | iBSP430sharplcdSetEnabled_ni (hBSP430sharplcd dev, int enablep) |
int | iBSP430sharplcdClearDisplay_rh (hBSP430sharplcd dev) |
int | iBSP430sharplcdRefreshDisplay_rh (hBSP430sharplcd dev) |
int | iBSP430sharplcdUpdateDisplayLines_rh (hBSP430sharplcd dev, int start_line, int num_lines, const uint8_t *line_data) |
Interface for Sharp Memory LCD displays.
This display may be used natively, or in conjunction with configBSP430_UTILITY_U8GLIB.
#define BSP430_PLATFORM_BOOSTERPACK_SHARP96 include <bsp430/platform.h> |
Indicate that a Sharp Microelectronics LCD display is available on the platform through a 430BOOST-SHARP96 booster pack. The macro is undefined or false if the boosterpack is not requested or its required resources have not been defined for the platform.
#define BSP430_PLATFORM_SHARPLCD include <bsp430/platform.h> |
Indicate that a Sharp Microelectronics LCD display is available on the platform. This is set by the platform-specific header when configBSP430_PLATFORM_BOOSTERPACK_SHARP96 is true and the platform has resource mappings for the device, or on platforms that natively contain a Sharp Memory LCD display.
#define BSP430_PLATFORM_SHARPLCD_BYTES_PER_LINE ((7 + BSP430_PLATFORM_SHARPLCD_COLUMNS) / 8) |
The width of the display in bytes
#define BSP430_PLATFORM_SHARPLCD_COLUMNS include <bsp430/platform.h> |
The width of the display in pixels
#define BSP430_PLATFORM_SHARPLCD_CS_PORT_BIT include <bsp430/platform.h> |
Port bit on BSP430_PLATFORM_SHARPLCD_CS_PORT_PERIPH_HANDLE that controls the display chip select.
#define BSP430_PLATFORM_SHARPLCD_CS_PORT_PERIPH_HANDLE include <bsp430/platform.h> |
BSP430 peripheral handle for the port that controls the display chip select line.
#define BSP430_PLATFORM_SHARPLCD_LCD_EN_PORT_BIT include <bsp430/platform.h> |
Port bit on BSP430_PLATFORM_SHARPLCD_LCD_EN_PORT_PERIPH_HANDLE that turns the display on or off. The signal is active-high.
#define BSP430_PLATFORM_SHARPLCD_LCD_EN_PORT_PERIPH_HANDLE include <bsp430/platform.h> |
BSP430 peripheral handle for the port that controls the display DISP on/off line.
#define BSP430_PLATFORM_SHARPLCD_PWR_EN_PORT_BIT include <bsp430/platform.h> |
Port bit on BSP430_PLATFORM_SHARPLCD_PWR_EN_PORT_PERIPH_HANDLE that provides display power. The signal is active-high.
#define BSP430_PLATFORM_SHARPLCD_PWR_EN_PORT_PERIPH_HANDLE include <bsp430/platform.h> |
BSP430 peripheral handle for the port that provides display power.
#define BSP430_PLATFORM_SHARPLCD_ROWS include <bsp430/platform.h> |
The height of the display in pixels.
#define BSP430_PLATFORM_SHARPLCD_SPI_BUS_HZ 1000000UL |
The desired SPI bus speed for the device.
For LS013B4DN04 the maximum value is 1 MHz. For other models it may be up to 2 MHz.
#define BSP430_PLATFORM_SHARPLCD_SPI_PERIPH_HANDLE include <bsp430/platform.h> |
BSP430 peripheral handle for the SPI interface to the device.
#define BSP430_SHARPLCD_CLEAR_ALL 0x20 |
The command bit pattern to clear all flags in the display.
This may be set in a static mode command to reset the display.
#define BSP430_SHARPLCD_CS_ASSERT | ( | _dev | ) |
Assert the CS signal in preparation for interacting with the device.
#define BSP430_SHARPLCD_CS_DEASSERT | ( | _dev | ) |
De-assert the CS signal after interacting with the device
#define BSP430_SHARPLCD_CTL0_INITIALIZER BSP430_SERIAL_ADJUST_CTL0_INITIALIZER(UCCKPH | UCMSB | UCMST) |
Parameter to pass to hBSP430serialOpenSPI() as the ctl0_byte
.
#define BSP430_SHARPLCD_MODE_DYNAMIC 0x80 |
The command bit pattern set for dynamic mode.
This is what's used to update pixels. Absence of this bit indicates a static mode command.
#define BSP430_SHARPLCD_REFRESH_INTERVAL_MS 1000 |
The interval at which the VCOM signal must be toggled, using iBSP430sharplcdRefreshDisplay_rh(), in order to avoid DC bias build-up. 1 Hz is good; maximum rate is 30 Hz, some devices allow 0.5 Hz.
#define BSP430_SHARPLCD_VCOM 0x40 |
The command bit pattern that controls VCOM.
This bit may be combined with BSP430_SHARPLCD_MODE_DYNAMIC or used in static mode. To eliminate DC bias build-up a command should be sent to the display at a minimum frequency of 1Hz (maximum 30 Hz) while the display is active. This bit should alternate in those commands using a 50% duty cycle.
#define configBSP430_PLATFORM_BOOSTERPACK_SHARP96 0 |
Define to a true value to request that platform enable an interface to the 430BOOST-SHARP96 booster pack.
#define configBSP430_PLATFORM_SHARPLCD 0 |
Define to a true value to request that platform enable its Sharp Microelectronics Memory LCD display.
typedef sBSP430sharplcd* hBSP430sharplcd |
Handle for a Sharp Memory LCD device
typedef struct sBSP430sharplcd sBSP430sharplcd |
A structure holding resource references and state required to manipulate a Sharp Memory LCD.
hBSP430sharplcd hBSP430sharplcdInitializePlatformDevice | ( | hBSP430sharplcd | dev | ) |
Initialize dev
using the platform device constants (viz., BSP430_PLATFORM_SHARPLCD_SPI_PERIPH_HANDLE, BSP430_PLATFORM_SHARPLCD_CS_PORT_PERIPH_HANDLE, BSP430_PLATFORM_SHARPLCD_ROWS, etc.)
This only initializes the device structure and configures the SPI interface. It does not configure any required GPIOs nor does it power-up the device. See iBSP430sharplcdSetEnabled_ni().
dev | pointer to an sBSP430sharplcd structure that will be used to hold the device state. |
dev
if successful, a null pointer if a critical resource could not be obtained. int iBSP430sharplcdClearDisplay_rh | ( | hBSP430sharplcd | dev | ) |
Issue the command to quickly clear the display.
dev | device with display to be cleared |
int iBSP430sharplcdRefreshDisplay_rh | ( | hBSP430sharplcd | dev | ) |
Issue the command to refresh the display.
This sends a static-mode command that toggles the VCOM signal to the screen, preventing DC bias build-up. It should be invoked once per second while the display is powered.
dev | device with display to be refreshed |
int iBSP430sharplcdSetEnabled_ni | ( | hBSP430sharplcd | dev, |
int | enablep | ||
) |
Enable or disable the display.
If enablep
is true, this enables power to the device and executes its startup sequence. If enablep
is false this executes the device shutdown sequence and removes power from it.
dev | device to be powered |
enablep | nonzero to enable device, zero to disable it |
int iBSP430sharplcdUpdateDisplayLines_rh | ( | hBSP430sharplcd | dev, |
int | start_line, | ||
int | num_lines, | ||
const uint8_t * | line_data | ||
) |
Replace lines in the display with new content.
dev | device to be updated |
start_line | the first line to be updated. Lines are numbered starting with 1; values less than this result in an error return. |
num_lines | the number of lines to be updated. A negative value is interpreted to mean all lines starting with start_line . |
line_data | the monochrome pixel values to be used. Each line requires dev->line_size bytes. |