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

Committer:
embeddedartists
Date:
Tue Jul 22 11:59:06 2014 +0000
Revision:
0:9297e33f50cf
First version of library for the EM027BS013 ePaper display.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
embeddedartists 0:9297e33f50cf 1 /**
embeddedartists 0:9297e33f50cf 2 * \file
embeddedartists 0:9297e33f50cf 3 *
embeddedartists 0:9297e33f50cf 4 * \brief The SPI, PWM, Temperature definitions of COG hardware driver
embeddedartists 0:9297e33f50cf 5 *
embeddedartists 0:9297e33f50cf 6 * Copyright (c) 2012-2014 Pervasive Displays Inc. All rights reserved.
embeddedartists 0:9297e33f50cf 7 *
embeddedartists 0:9297e33f50cf 8 * Authors: Pervasive Displays Inc.
embeddedartists 0:9297e33f50cf 9 *
embeddedartists 0:9297e33f50cf 10 * Redistribution and use in source and binary forms, with or without
embeddedartists 0:9297e33f50cf 11 * modification, are permitted provided that the following conditions
embeddedartists 0:9297e33f50cf 12 * are met:
embeddedartists 0:9297e33f50cf 13 *
embeddedartists 0:9297e33f50cf 14 * 1. Redistributions of source code must retain the above copyright
embeddedartists 0:9297e33f50cf 15 * notice, this list of conditions and the following disclaimer.
embeddedartists 0:9297e33f50cf 16 * 2. Redistributions in binary form must reproduce the above copyright
embeddedartists 0:9297e33f50cf 17 * notice, this list of conditions and the following disclaimer in
embeddedartists 0:9297e33f50cf 18 * the documentation and/or other materials provided with the
embeddedartists 0:9297e33f50cf 19 * distribution.
embeddedartists 0:9297e33f50cf 20 *
embeddedartists 0:9297e33f50cf 21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
embeddedartists 0:9297e33f50cf 22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
embeddedartists 0:9297e33f50cf 23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
embeddedartists 0:9297e33f50cf 24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
embeddedartists 0:9297e33f50cf 25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
embeddedartists 0:9297e33f50cf 26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
embeddedartists 0:9297e33f50cf 27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
embeddedartists 0:9297e33f50cf 28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
embeddedartists 0:9297e33f50cf 29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
embeddedartists 0:9297e33f50cf 30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
embeddedartists 0:9297e33f50cf 31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
embeddedartists 0:9297e33f50cf 32 */
embeddedartists 0:9297e33f50cf 33
embeddedartists 0:9297e33f50cf 34 #ifndef DISPLAY_HARDWARE_DRIVCE_H_INCLUDED_
embeddedartists 0:9297e33f50cf 35 #define DISPLAY_HARDWARE_DRIVCE_H_INCLUDED_
embeddedartists 0:9297e33f50cf 36
embeddedartists 0:9297e33f50cf 37 #include "Pervasive_Displays_small_EPD.h"
embeddedartists 0:9297e33f50cf 38
embeddedartists 0:9297e33f50cf 39 #define SMCLK_FREQ (16000000)
embeddedartists 0:9297e33f50cf 40 #define __External_Temperature_Sensor
embeddedartists 0:9297e33f50cf 41
embeddedartists 0:9297e33f50cf 42 /**SPI Defines ****************************************************************/
embeddedartists 0:9297e33f50cf 43 #define SPISEL P1SEL
embeddedartists 0:9297e33f50cf 44 #define SPISEL2 P1SEL2
embeddedartists 0:9297e33f50cf 45 #define SPIIE IE2
embeddedartists 0:9297e33f50cf 46 #define SPICTL0 UCB0CTL0
embeddedartists 0:9297e33f50cf 47 #define SPICTL1 UCB0CTL1
embeddedartists 0:9297e33f50cf 48 #define SPIBR0 UCB0BR0
embeddedartists 0:9297e33f50cf 49 #define SPIBR1 UCB0BR1
embeddedartists 0:9297e33f50cf 50 #define SPIMCTL UCA0MCTL
embeddedartists 0:9297e33f50cf 51 #define SPIIFG IFG2
embeddedartists 0:9297e33f50cf 52 #define SPIRXBUF UCB0RXBUF
embeddedartists 0:9297e33f50cf 53 #define SPIRXIFG UCB0RXIFG
embeddedartists 0:9297e33f50cf 54 #define SPITXBUF UCB0TXBUF
embeddedartists 0:9297e33f50cf 55 #define SPITXIFG UCB0TXIFG
embeddedartists 0:9297e33f50cf 56 #define SPISTAT UCB0STAT
embeddedartists 0:9297e33f50cf 57 #define SPI_baudrate (SMCLK_FREQ/COG_SPI_baudrate) /**< the baud rate of SPI */
embeddedartists 0:9297e33f50cf 58
embeddedartists 0:9297e33f50cf 59 void epd_spi_init (void);
embeddedartists 0:9297e33f50cf 60 void epd_spi_attach (void);
embeddedartists 0:9297e33f50cf 61 void epd_spi_detach (void);
embeddedartists 0:9297e33f50cf 62 void epd_spi_send (unsigned char Register, unsigned char *Data, unsigned Length);
embeddedartists 0:9297e33f50cf 63 void epd_spi_send_byte (uint8_t Register, uint8_t Data);
embeddedartists 0:9297e33f50cf 64 uint8_t epd_spi_read(unsigned char RDATA);
embeddedartists 0:9297e33f50cf 65 void epd_spi_write (unsigned char Data);
embeddedartists 0:9297e33f50cf 66 uint8_t epd_spi_write_ex (unsigned char Data);
embeddedartists 0:9297e33f50cf 67 void sys_delay_ms(unsigned int ms);
embeddedartists 0:9297e33f50cf 68 void start_EPD_timer(void);
embeddedartists 0:9297e33f50cf 69 void stop_EPD_timer(void);
embeddedartists 0:9297e33f50cf 70 uint32_t get_current_time_tick(void);
embeddedartists 0:9297e33f50cf 71 void set_current_time_tick(uint32_t count);
embeddedartists 0:9297e33f50cf 72 void PWM_start_toggle(void);
embeddedartists 0:9297e33f50cf 73 void PWM_stop_toggle(void);
embeddedartists 0:9297e33f50cf 74 void PWM_run(uint16_t time);
embeddedartists 0:9297e33f50cf 75 void initialize_temperature(void);
embeddedartists 0:9297e33f50cf 76 int16_t get_temperature(void);
embeddedartists 0:9297e33f50cf 77 void EPD_display_hardware_init (void);
embeddedartists 0:9297e33f50cf 78
embeddedartists 0:9297e33f50cf 79 #if (defined COG_V230_G2)
embeddedartists 0:9297e33f50cf 80 uint8_t SPI_R(uint8_t Register, uint8_t Data);
embeddedartists 0:9297e33f50cf 81 #endif
embeddedartists 0:9297e33f50cf 82 #endif //DISPLAY_HARDWARE_DRIVCE_H_INCLUDED_
embeddedartists 0:9297e33f50cf 83
embeddedartists 0:9297e33f50cf 84