Library to control the EM027BS013 ePaper display from Pervasive Display.

Dependencies:   LM75B

Dependents:   app_epaper_EM027BS013_LPC1549 lpc4088_ebb_epaper EaEpaper_EM027BS013 app_epaper_EM027BS013 ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers EPD_hardware_driver.h Source File

EPD_hardware_driver.h

Go to the documentation of this file.
00001 /**
00002 * \file
00003 *
00004 * \brief The SPI, PWM, Temperature definitions of COG hardware driver
00005 *
00006 * Copyright (c) 2012-2014 Pervasive Displays Inc. All rights reserved.
00007 *
00008 *  Authors: Pervasive Displays Inc.
00009 *
00010 *  Redistribution and use in source and binary forms, with or without
00011 *  modification, are permitted provided that the following conditions
00012 *  are met:
00013 *
00014 *  1. Redistributions of source code must retain the above copyright
00015 *     notice, this list of conditions and the following disclaimer.
00016 *  2. Redistributions in binary form must reproduce the above copyright
00017 *     notice, this list of conditions and the following disclaimer in
00018 *     the documentation and/or other materials provided with the
00019 *     distribution.
00020 *
00021 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00022 *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00023 *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00024 *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
00025 *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00026 *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00027 *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00028 *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00029 *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00030 *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00031 *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00032 */
00033 
00034 #ifndef     DISPLAY_HARDWARE_DRIVCE_H_INCLUDED_
00035 #define     DISPLAY_HARDWARE_DRIVCE_H_INCLUDED_
00036 
00037 #include "Pervasive_Displays_small_EPD.h"
00038 
00039 #define SMCLK_FREQ          (16000000)
00040 #define __External_Temperature_Sensor
00041 
00042 /**SPI Defines ****************************************************************/
00043 #define SPISEL              P1SEL
00044 #define SPISEL2             P1SEL2
00045 #define SPIIE               IE2
00046 #define SPICTL0             UCB0CTL0
00047 #define SPICTL1             UCB0CTL1
00048 #define SPIBR0              UCB0BR0
00049 #define SPIBR1              UCB0BR1
00050 #define SPIMCTL             UCA0MCTL
00051 #define SPIIFG              IFG2
00052 #define SPIRXBUF            UCB0RXBUF
00053 #define SPIRXIFG            UCB0RXIFG
00054 #define SPITXBUF            UCB0TXBUF
00055 #define SPITXIFG            UCB0TXIFG
00056 #define SPISTAT             UCB0STAT
00057 #define SPI_baudrate        (SMCLK_FREQ/COG_SPI_baudrate)           /**< the baud rate of SPI */
00058 
00059 void epd_spi_init (void);
00060 void epd_spi_attach (void);
00061 void epd_spi_detach (void);
00062 void epd_spi_send (unsigned char Register, unsigned char *Data, unsigned Length);
00063 void epd_spi_send_byte (uint8_t Register, uint8_t Data);
00064 uint8_t epd_spi_read(unsigned char RDATA);
00065 void epd_spi_write (unsigned char Data);
00066 uint8_t epd_spi_write_ex (unsigned char Data);
00067 void sys_delay_ms(unsigned int ms);
00068 void start_EPD_timer(void);
00069 void stop_EPD_timer(void);
00070 uint32_t get_current_time_tick(void);
00071 void set_current_time_tick(uint32_t count);
00072 void PWM_start_toggle(void);
00073 void PWM_stop_toggle(void);
00074 void PWM_run(uint16_t time);
00075 void initialize_temperature(void);
00076 int16_t get_temperature(void);
00077 void EPD_display_hardware_init (void);
00078 
00079 #if (defined COG_V230_G2)
00080 uint8_t SPI_R(uint8_t Register, uint8_t Data);
00081 #endif
00082 #endif  //DISPLAY_HARDWARE_DRIVCE_H_INCLUDED_
00083 
00084