1.1 --- a/bsp.h Sun May 19 22:06:40 2013 +0000
1.2 +++ b/bsp.h Tue May 21 15:08:07 2013 +0000
1.3 @@ -2,111 +2,52 @@
1.4 #define __BSP_H__
1.5
1.6 #include <ubb/ubb.h>
1.7 +#include "EPD.h"
1.8
1.9 -/* Pin assignments (74HC4052):
1.10 - *
1.11 - * Sniffer UBB 74HC4052 #1 74HC4052 #2 10K Resistor M74HC595B1R EM027AS012
1.12 - * ------- ---- ----------- ----------- ------------ ----------- ----------
1.13 - * DAT2 DAT2 13 (1Z)
1.14 - * CD DAT3 3 (2Z)
1.15 - * CMD CMD 10 (S0) 10 (S0) IN OUT 10 (SCLR#)
1.16 - * VCC VDD 16 (VCC) 16 (VCC) 16 (VCC) 2 (3V3)
1.17 - * CLK CLK 3 (SCK)
1.18 - * GND GND 8 (GND) 8 (GND) 8 (GND) 1 (GND)
1.19 - * DAT0 DAT0 13 (1Z)
1.20 - * DAT1 DAT1 3 (2Z)
1.21 - *
1.22 - * Multiplexer pin selection:
1.23 - *
1.24 - * {Z}Y{S1/S0}
1.25 - *
1.26 - * 1Z with S1=0, S0=0 => 1Y0 (output 1, channel 0)
1.27 - * 2Z with S1=0, S0=0 => 2Y0 (output 2, channel 0)
1.28 - *
1.29 - * 1Z with S1=0, S0=1 => 1Y1 (output 1, channel 1)
1.30 - * 2Z with S1=0, S0=1 => 2Y1 (output 2, channel 1)
1.31 - *
1.32 - * Connections to the shift register (channel 0):
1.33 +/* Pin assignments:
1.34 *
1.35 - * Sniffer UBB 74HC4052 #1 M74HC595B1R
1.36 - * ------- --- ----------- -----------
1.37 - * DAT2 DAT2 12 (1Y0) 12 (RCK)
1.38 - * CD DAT3 1 (2Y0) 14 (SI)
1.39 - *
1.40 - * 74HC4052 #2
1.41 - * -----------
1.42 - * DAT0 DAT0 12 (1Y0) 10 (SCLR#)
1.43 - * DAT1 DAT1 1 (2Y0) 11 (SCK)
1.44 - *
1.45 - * Connections to the display board (channel 1):
1.46 - *
1.47 - * Sniffer UBB 74HC4052 #1 EM027AS012
1.48 - * ------- --- ----------- ----------
1.49 - * DAT2 DAT2 14 (1Y1) 4 (MOSI)
1.50 - * CD DAT3 5 (2Y1) 6 (SSEL)
1.51 - *
1.52 - * 74HC4052 #2
1.53 - * -----------
1.54 - * DAT0 DAT0 14 (1Y1) 11 (PWM)
1.55 - * DAT1 DAT1 5 (2Y1) 12 (RESET)
1.56 - *
1.57 - * Connections from the shift register (providing persistent outputs for
1.58 - * channel 0):
1.59 - *
1.60 - * M74HC595B1R EM027AS012
1.61 - * ----------- ----------
1.62 - * 15 (QA) 13 (PANEL)
1.63 - * 1 (QB) 14 (DIS)
1.64 + * Sniffer UBB EM027AS012
1.65 + * ------- ---- -----------
1.66 + * DAT2 DAT2 4 (MOSI)
1.67 + * CD DAT3 6 (SSEL)
1.68 + * CMD CMD 11 (PWM)
1.69 + * VCC VDD 13 (PANEL)
1.70 + * CLK CLK 3 (SCK)
1.71 + * GND GND
1.72 + * DAT0 DAT0 12 (RESET)
1.73 + * DAT1 DAT1 14 (DIS)
1.74 *
1.75 * General connections:
1.76 *
1.77 - * Sniffer UBB 74HC4052 M74HC595B1R
1.78 - * ------- ---- -------- -----------
1.79 - * GND GND 6 (E#) 13 (G#)
1.80 - * 7 (VEE)
1.81 - * 9 (S1)
1.82 + * EM027AS012
1.83 + * ----------
1.84 + * 1 (GND)
1.85 + * 2 (3V3)
1.86 */
1.87
1.88 -/* CMD/S0 = 0 */
1.89 -
1.90 -#define SHIFT_SCLR UBB_DAT0
1.91 -#define SHIFT_SCK UBB_DAT1
1.92 -#define SHIFT_RCK UBB_DAT2
1.93 -#define SHIFT_SI UBB_DAT3
1.94 -
1.95 -/* CMD/S1 = 1 */
1.96 -
1.97 -#define EPD_PWM UBB_DAT0
1.98 -#define EPD_RESET UBB_DAT1
1.99 -#define EPD_MOSI UBB_DAT2
1.100 -#define EPD_SSEL UBB_DAT3
1.101 -
1.102 -/* Channel-insensitive. */
1.103 -
1.104 -#define MUX_S0 UBB_CMD
1.105 -#define EPD_SCK UBB_CLK
1.106 -
1.107 -/* NanoNote-specific functions. */
1.108 -
1.109 -void shift_select();
1.110 -void shift_update();
1.111 -void shift_init();
1.112 -void shift_reinit();
1.113 -void shift_in(uint8_t v);
1.114 -void epd_select();
1.115 +#define EPD_MOSI UBB_DAT2
1.116 +#define EPD_SSEL UBB_DAT3
1.117 +#define EPD_PWM UBB_CMD
1.118 +#define EPD_SCK UBB_CLK
1.119 +#define EPD_RESET UBB_DAT0
1.120 +#define EPD_DIS UBB_DAT1
1.121
1.122 /* Board-specific interface functions. */
1.123
1.124 -void bsp_init();
1.125 -void bsp_InitDisplayHardware();
1.126 -void bsp_PowerOn();
1.127 -void bsp_pwm_active(uint16_t delayInMs);
1.128 -void bsp_Shutdown();
1.129 -void bsp_spiInit();
1.130 -void bsp_writeToDisplay(uint8_t *data, uint16_t len);
1.131 +void EPD_Pin_init();
1.132 +void EPD_Pin_EPD_CS(EPD_pinstate pin);
1.133 +void EPD_Pin_RESET(EPD_pinstate pin);
1.134 +void EPD_Pin_PANEL_ON(EPD_pinstate pin);
1.135 +void EPD_Pin_DISCHARGE(EPD_pinstate pin);
1.136 +void EPD_Pin_BORDER(EPD_pinstate pin);
1.137 +void EPD_Pin_PWM(EPD_pinstate pin);
1.138 +EPD_pinstate epd_get_busy();
1.139 +
1.140 +void bsp_spiWrite(uint8_t *buffer, uint16_t length);
1.141 void bsp_delayMs(uint32_t ms);
1.142 void bsp_delayUs(uint32_t us);
1.143 uint32_t bsp_getMsTicks();
1.144 +uint32_t bsp_getUsTicks();
1.145 int16_t bsp_getTemp();
1.146
1.147 #endif /* __BSP_H__ */