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