paul@1 | 1 | #ifndef __BSP_H__ |
paul@1 | 2 | #define __BSP_H__ |
paul@1 | 3 | |
paul@1 | 4 | #include <ubb/ubb.h> |
paul@4 | 5 | #include "EPD.h" |
paul@1 | 6 | |
paul@4 | 7 | /* Pin assignments: |
paul@1 | 8 | * |
paul@4 | 9 | * Sniffer UBB EM027AS012 |
paul@4 | 10 | * ------- ---- ----------- |
paul@4 | 11 | * DAT2 DAT2 4 (MOSI) |
paul@4 | 12 | * CD DAT3 6 (SSEL) |
paul@4 | 13 | * CMD CMD 11 (PWM) |
paul@4 | 14 | * VCC VDD 13 (PANEL) |
paul@4 | 15 | * CLK CLK 3 (SCK) |
paul@4 | 16 | * GND GND |
paul@4 | 17 | * DAT0 DAT0 12 (RESET) |
paul@4 | 18 | * DAT1 DAT1 14 (DIS) |
paul@1 | 19 | * |
paul@1 | 20 | * General connections: |
paul@1 | 21 | * |
paul@4 | 22 | * EM027AS012 |
paul@4 | 23 | * ---------- |
paul@4 | 24 | * 1 (GND) |
paul@4 | 25 | * 2 (3V3) |
paul@1 | 26 | */ |
paul@1 | 27 | |
paul@4 | 28 | #define EPD_MOSI UBB_DAT2 |
paul@4 | 29 | #define EPD_SSEL UBB_DAT3 |
paul@4 | 30 | #define EPD_PWM UBB_CMD |
paul@4 | 31 | #define EPD_SCK UBB_CLK |
paul@4 | 32 | #define EPD_RESET UBB_DAT0 |
paul@4 | 33 | #define EPD_DIS UBB_DAT1 |
paul@1 | 34 | |
paul@1 | 35 | /* Board-specific interface functions. */ |
paul@1 | 36 | |
paul@4 | 37 | void EPD_Pin_init(); |
paul@4 | 38 | void EPD_Pin_EPD_CS(EPD_pinstate pin); |
paul@4 | 39 | void EPD_Pin_RESET(EPD_pinstate pin); |
paul@4 | 40 | void EPD_Pin_PANEL_ON(EPD_pinstate pin); |
paul@4 | 41 | void EPD_Pin_DISCHARGE(EPD_pinstate pin); |
paul@4 | 42 | void EPD_Pin_BORDER(EPD_pinstate pin); |
paul@4 | 43 | void EPD_Pin_PWM(EPD_pinstate pin); |
paul@4 | 44 | EPD_pinstate epd_get_busy(); |
paul@4 | 45 | |
paul@4 | 46 | void bsp_spiWrite(uint8_t *buffer, uint16_t length); |
paul@1 | 47 | void bsp_delayMs(uint32_t ms); |
paul@1 | 48 | void bsp_delayUs(uint32_t us); |
paul@1 | 49 | uint32_t bsp_getMsTicks(); |
paul@4 | 50 | uint32_t bsp_getUsTicks(); |
paul@1 | 51 | int16_t bsp_getTemp(); |
paul@1 | 52 | |
paul@1 | 53 | #endif /* __BSP_H__ */ |