1 /* 2 * Ben NanoNote and EM027AS012 E-Paper Display Adapter Board communication. 3 * 4 * Copyright (C) 2013 Paul Boddie 5 * 6 * SPI functions derived from those in lib/atben.c by Werner Almesberger: 7 * 8 * Copyright (C) 2010-2011 Werner Almesberger 9 * 10 * This program is free software; you can redistribute it and/or modify it under 11 * the terms of the GNU General Public License as published by the Free Software 12 * Foundation; either version 3 of the License, or (at your option) any later 13 * version. 14 * 15 * This program is distributed in the hope that it will be useful, but WITHOUT 16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 17 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 18 * details. 19 * 20 * You should have received a copy of the GNU General Public License along with 21 * this program. If not, see <http://www.gnu.org/licenses/>. 22 */ 23 24 #ifndef __BSP_H__ 25 #define __BSP_H__ 26 27 #include <ubb/ubb.h> 28 29 /* Pin assignments: 30 * 31 * Sniffer UBB EM027AS012 32 * ------- ---- ----------- 33 * DAT2 DAT2 4 (MOSI) 34 * CD DAT3 6 (SSEL) 35 * CMD CMD 11 (PWM) 36 * VCC VDD 13 (PANEL) 37 * CLK CLK 3 (SCK) 38 * GND GND 39 * DAT0 DAT0 12 (RESET) 40 * DAT1 DAT1 14 (DIS) 41 * 42 * Remember that the pin numbering is "mirrored" on the end of a cable: 43 * 44 * Socket __ 45 * -------------------- --------- --------- 46 * 2 4 6 8 10 12 14 1 3 5 7 9 11 13 47 * 1 3 5 7 9 11 13 2 4 6 8 10 12 14 48 * ---------__--------- -------------------- 49 * Cable 50 * 51 * General connections: 52 * 53 * 3.3V Supply EM027AS012 54 * ----------- ---------- 55 * GND 1 (GND) 56 * 3V3 2 (3V3) 57 */ 58 59 #define EPD_MOSI UBB_DAT2 60 #define EPD_SSEL UBB_DAT3 61 #define EPD_PWM UBB_CMD 62 #define EPD_SCK UBB_CLK 63 #define EPD_RESET UBB_DAT0 64 #define EPD_DIS UBB_DAT1 65 66 /* Board-specific interface functions. */ 67 68 void bsp_init(); 69 void bsp_spiInit(); 70 void bsp_writeToDisplay(uint8_t *data, uint16_t len); 71 void bsp_delayMs(uint32_t ms); 72 void bsp_delayUs(uint32_t us); 73 uint32_t bsp_getMsTicks(); 74 int16_t bsp_getTemp(); 75 76 #endif /* __BSP_H__ */