Library to control the EM027BS013 ePaper display from Pervasive Display.
Dependents: app_epaper_EM027BS013_LPC1549 lpc4088_ebb_epaper EaEpaper_EM027BS013 app_epaper_EM027BS013 ... more
EPD_hardware_gpio.h@0:9297e33f50cf, 2014-07-22 (annotated)
- 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?
User | Revision | Line number | New contents of line |
---|---|---|---|
embeddedartists | 0:9297e33f50cf | 1 | /** |
embeddedartists | 0:9297e33f50cf | 2 | * \file |
embeddedartists | 0:9297e33f50cf | 3 | * |
embeddedartists | 0:9297e33f50cf | 4 | * \brief The definition of EPD GPIO pins |
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 | #include "Pervasive_Displays_small_EPD.h" |
embeddedartists | 0:9297e33f50cf | 35 | |
embeddedartists | 0:9297e33f50cf | 36 | #ifndef DISPLAY_HARDWARE_GPIO_H_INCLUDED |
embeddedartists | 0:9297e33f50cf | 37 | #define DISPLAY_HARDWARE_GPIO_H_INCLUDED |
embeddedartists | 0:9297e33f50cf | 38 | |
embeddedartists | 0:9297e33f50cf | 39 | #define _BV(bit) (1 << (bit)) /**< left shift 1 bit */ |
embeddedartists | 0:9297e33f50cf | 40 | #define _HIGH 1 /**< signal high */ |
embeddedartists | 0:9297e33f50cf | 41 | #define _LOW !_HIGH /**< signal low */ |
embeddedartists | 0:9297e33f50cf | 42 | |
embeddedartists | 0:9297e33f50cf | 43 | ////FOR MSP430 |
embeddedartists | 0:9297e33f50cf | 44 | //#define DIR_(x) x ## DIR |
embeddedartists | 0:9297e33f50cf | 45 | //#define DIR(x) (DIR_(x)) |
embeddedartists | 0:9297e33f50cf | 46 | //#define OUT_(x) x ## OUT |
embeddedartists | 0:9297e33f50cf | 47 | //#define OUTPORT(x) (OUT_(x)) |
embeddedartists | 0:9297e33f50cf | 48 | //#define SEL_(x) x ## SEL |
embeddedartists | 0:9297e33f50cf | 49 | //#define SEL(x) (SEL_(x)) |
embeddedartists | 0:9297e33f50cf | 50 | //#define SEL2_(x) x ## SEL2 |
embeddedartists | 0:9297e33f50cf | 51 | //#define SEL2(x) (SEL2_(x)) |
embeddedartists | 0:9297e33f50cf | 52 | //#define IN_(x) x ## IN |
embeddedartists | 0:9297e33f50cf | 53 | //#define INPORT(x) (IN_(x)) |
embeddedartists | 0:9297e33f50cf | 54 | //#define REN_(x) x ## REN |
embeddedartists | 0:9297e33f50cf | 55 | //#define REN(x) (REN_(x)) |
embeddedartists | 0:9297e33f50cf | 56 | //#define BITSET(x,y) ((x) |= (y)) |
embeddedartists | 0:9297e33f50cf | 57 | //#define BITCLR(x,y) ((x) &= ~(y)) |
embeddedartists | 0:9297e33f50cf | 58 | //#define BITINV(x,y) ((x) ^= (y)) |
embeddedartists | 0:9297e33f50cf | 59 | |
embeddedartists | 0:9297e33f50cf | 60 | //#define config_gpio_dir_o(Port,Pin) BITSET(DIR (Port), Pin) /**< set output direction for an IOPORT pin */ |
embeddedartists | 0:9297e33f50cf | 61 | //#define config_gpio_dir_i(Port,Pin) BITCLR(DIR (Port), Pin) /**< set input direction for an IOPORT pin */ |
embeddedartists | 0:9297e33f50cf | 62 | //#define set_gpio_high(Port,Pin) BITSET (OUTPORT (Port), Pin) /**< set HIGH for an IOPORT pin */ |
embeddedartists | 0:9297e33f50cf | 63 | //#define set_gpio_low(Port,Pin) BITCLR (OUTPORT (Port), Pin) /**< set LOW for an IOPORT pin */ |
embeddedartists | 0:9297e33f50cf | 64 | //#define set_gpio_invert(Port,Pin) BITINV(OUTPORT (Port),Pin) /**< toggle the value of an IOPORT pin */ |
embeddedartists | 0:9297e33f50cf | 65 | //#define input_get(Port,Pin) (INPORT (Port) & Pin ) /**< get current value of an IOPORT pin */ |
embeddedartists | 0:9297e33f50cf | 66 | |
embeddedartists | 0:9297e33f50cf | 67 | /****************************************************************************** |
embeddedartists | 0:9297e33f50cf | 68 | * GPIO Defines |
embeddedartists | 0:9297e33f50cf | 69 | *****************************************************************************/ |
embeddedartists | 0:9297e33f50cf | 70 | //#define Temper_PIN BIT4 |
embeddedartists | 0:9297e33f50cf | 71 | //#define Temper_PORT P1 /**< LaunchPad P1.4 */ |
embeddedartists | 0:9297e33f50cf | 72 | //#define SPICLK_PIN BIT5 |
embeddedartists | 0:9297e33f50cf | 73 | //#define SPICLK_PORT P1 /**< LaunchPad P1.5 */ |
embeddedartists | 0:9297e33f50cf | 74 | //#define EPD_BUSY_PIN BIT0 |
embeddedartists | 0:9297e33f50cf | 75 | //#define EPD_BUSY_PORT P2 /**< LaunchPad P2.0 */ |
embeddedartists | 0:9297e33f50cf | 76 | //#define PWM_PIN BIT1 |
embeddedartists | 0:9297e33f50cf | 77 | //#define PWM_PORT P2 /**< LaunchPad P2.1 */ |
embeddedartists | 0:9297e33f50cf | 78 | //#define EPD_RST_PIN BIT2 |
embeddedartists | 0:9297e33f50cf | 79 | //#define EPD_RST_PORT P2 /**< LaunchPad P2.2 */ |
embeddedartists | 0:9297e33f50cf | 80 | //#define EPD_PANELON_PIN BIT3 |
embeddedartists | 0:9297e33f50cf | 81 | //#define EPD_PANELON_PORT P2 /**< LaunchPad P2.3 */ |
embeddedartists | 0:9297e33f50cf | 82 | //#define EPD_DISCHARGE_PIN BIT4 |
embeddedartists | 0:9297e33f50cf | 83 | //#define EPD_DISCHARGE_PORT P2 /**< LaunchPad P2.4 */ |
embeddedartists | 0:9297e33f50cf | 84 | //#define EPD_BORDER_PIN BIT5 |
embeddedartists | 0:9297e33f50cf | 85 | //#define EPD_BORDER_PORT P2 /**< LaunchPad P2.5 */ |
embeddedartists | 0:9297e33f50cf | 86 | //#define SPIMISO_PIN BIT6 |
embeddedartists | 0:9297e33f50cf | 87 | //#define SPIMISO_PORT P1 /**< LaunchPad P1.6 */ |
embeddedartists | 0:9297e33f50cf | 88 | //#define SPIMOSI_PIN BIT7 |
embeddedartists | 0:9297e33f50cf | 89 | //#define SPIMOSI_PORT P1 /**< LaunchPad P1.7 */ |
embeddedartists | 0:9297e33f50cf | 90 | //#define Flash_CS_PIN BIT7 |
embeddedartists | 0:9297e33f50cf | 91 | //#define Flash_CS_PORT P2 /**< LaunchPad P2.7 */ |
embeddedartists | 0:9297e33f50cf | 92 | //#define Flash_CS_PORT_SEL (SEL (Flash_CS_PORT)) |
embeddedartists | 0:9297e33f50cf | 93 | //#define Flash_CS_PORT_SEL2 (SEL2(Flash_CS_PORT)) |
embeddedartists | 0:9297e33f50cf | 94 | //#define EPD_CS_PIN BIT6 |
embeddedartists | 0:9297e33f50cf | 95 | //#define EPD_CS_PORT P2 /**< LaunchPad P2.6 */ |
embeddedartists | 0:9297e33f50cf | 96 | //#define CS_PORT_SEL (SEL (EPD_CS_PORT)) |
embeddedartists | 0:9297e33f50cf | 97 | //#define CS_PORT_SEL2 (SEL2(EPD_CS_PORT)) |
embeddedartists | 0:9297e33f50cf | 98 | |
embeddedartists | 0:9297e33f50cf | 99 | bool EPD_IsBusy(void); |
embeddedartists | 0:9297e33f50cf | 100 | void EPD_cs_high (void); |
embeddedartists | 0:9297e33f50cf | 101 | void EPD_cs_low (void); |
embeddedartists | 0:9297e33f50cf | 102 | void EPD_flash_cs_high(void); |
embeddedartists | 0:9297e33f50cf | 103 | void EPD_flash_cs_low (void); |
embeddedartists | 0:9297e33f50cf | 104 | void EPD_rst_high (void); |
embeddedartists | 0:9297e33f50cf | 105 | void EPD_rst_low (void); |
embeddedartists | 0:9297e33f50cf | 106 | void EPD_discharge_high (void); |
embeddedartists | 0:9297e33f50cf | 107 | void EPD_discharge_low (void); |
embeddedartists | 0:9297e33f50cf | 108 | void EPD_Vcc_turn_off (void); |
embeddedartists | 0:9297e33f50cf | 109 | void EPD_Vcc_turn_on (void); |
embeddedartists | 0:9297e33f50cf | 110 | void EPD_border_high(void); |
embeddedartists | 0:9297e33f50cf | 111 | void EPD_border_low (void); |
embeddedartists | 0:9297e33f50cf | 112 | void EPD_pwm_low (void); |
embeddedartists | 0:9297e33f50cf | 113 | void EPD_pwm_high(void); |
embeddedartists | 0:9297e33f50cf | 114 | void SPIMISO_low(void); |
embeddedartists | 0:9297e33f50cf | 115 | void SPIMOSI_low(void); |
embeddedartists | 0:9297e33f50cf | 116 | void SPICLK_low(void); |
embeddedartists | 0:9297e33f50cf | 117 | void EPD_initialize_gpio(void); |
embeddedartists | 0:9297e33f50cf | 118 | |
embeddedartists | 0:9297e33f50cf | 119 | #endif //DISPLAY_HARDWARE_GPIO_H_INCLUDED |
embeddedartists | 0:9297e33f50cf | 120 | |
embeddedartists | 0:9297e33f50cf | 121 | |
embeddedartists | 0:9297e33f50cf | 122 | |
embeddedartists | 0:9297e33f50cf | 123 |