1.1 --- a/Display_Hardware_Driver.c Sun Apr 07 18:35:52 2013 +0000
1.2 +++ b/Display_Hardware_Driver.c Sun May 19 21:18:16 2013 +0000
1.3 @@ -16,6 +16,7 @@
1.4 * Includes
1.5 *****************************************************************************/
1.6 #include "Display_Hardware_Driver.h"
1.7 +#include <ubb/ubb.h>
1.8
1.9
1.10 /******************************************************************************
1.11 @@ -24,59 +25,25 @@
1.12 void epd_cs_high(void)
1.13 {
1.14 // CS_SET_HIGH;
1.15 - bsp_pinOut(BSP_PIN_6, 1);
1.16 + SET(EPD_SSEL);
1.17 }
1.18
1.19 void epd_cs_low(void)
1.20 {
1.21 // CS_SET_LOW;
1.22 - bsp_pinOut(BSP_PIN_6, 0);
1.23 + CLR(EPD_SSEL);
1.24 }
1.25
1.26 void epd_rst_high(void)
1.27 {
1.28 // RST_SET_HIGH;
1.29 - bsp_pinOut(BSP_PIN_12, 1);
1.30 + SET(EPD_RESET);
1.31 }
1.32
1.33 void epd_rst_low(void)
1.34 {
1.35 // RST_SET_LOW;
1.36 - bsp_pinOut(BSP_PIN_12, 0);
1.37 -}
1.38 -
1.39 -void epd_discharge_high(void)
1.40 -{
1.41 - // DISCHARGE_SET_HIGH;
1.42 - bsp_pinOut(BSP_PIN_14, 1);
1.43 -}
1.44 -
1.45 -void epd_discharge_low(void)
1.46 -{
1.47 - // DISCHARGE_SET_LOW;
1.48 - bsp_pinOut(BSP_PIN_14, 0);
1.49 -}
1.50 -
1.51 -void epd_panelon_off(void)
1.52 -{
1.53 - // PANELON_SET_LOW;
1.54 - bsp_pinOut(BSP_PIN_13, 0);
1.55 -}
1.56 -
1.57 -void epd_panelon_on(void)
1.58 -{
1.59 - // PANELON_SET_HIGH;
1.60 - bsp_pinOut(BSP_PIN_13, 1);
1.61 -}
1.62 -
1.63 -void epd_border_high(void)
1.64 -{
1.65 - // BORDER_SET_HIGH;
1.66 -}
1.67 -
1.68 -void epd_border_low(void)
1.69 -{
1.70 - // BORDER_SET_LOW;
1.71 + CLR(EPD_RESET);
1.72 }
1.73
1.74 void epd_delay_ms(uint32_t Time)
1.75 @@ -119,20 +86,7 @@
1.76 #endif
1.77 void epd_pwm_active(uint16_t delayInMs)
1.78 {
1.79 - uint16_t numOfIterations;
1.80 -
1.81 - numOfIterations = delayInMs * 100;
1.82 - // PWM_DIR_OUT;
1.83 - bsp_pinMode(BSP_PIN_11, BSP_PINMODE_OUTPUT);
1.84 - for(; numOfIterations > 0; numOfIterations--)
1.85 - {
1.86 - // PWM_SET_HIGH;
1.87 - bsp_pinOut(BSP_PIN_11, 1);
1.88 - bsp_delayUs(5); //100kHz (96kHz ideal)
1.89 - // PWM_SET_LOW;
1.90 - bsp_pinOut(BSP_PIN_11, 0);
1.91 - bsp_delayUs(5);
1.92 - }
1.93 + bsp_pwm_active(delayInMs);
1.94 }
1.95
1.96
1.97 @@ -204,29 +158,7 @@
1.98
1.99 void epd_InitDisplayHardware(void)
1.100 {
1.101 - // RST_DIR_OUT;
1.102 - bsp_pinMode(BSP_PIN_12, BSP_PINMODE_OUTPUT);
1.103 - // DISCHARGE_DIR_OUT;
1.104 - bsp_pinMode(BSP_PIN_14, BSP_PINMODE_OUTPUT);
1.105 - // CS_DIR_OUT;
1.106 - bsp_pinMode(BSP_PIN_6, BSP_PINMODE_OUTPUT);
1.107 - // PANELON_DIR_OUT;
1.108 - bsp_pinMode(BSP_PIN_13, BSP_PINMODE_OUTPUT);
1.109 - // DRIVERBUSY_DIR_IN;
1.110 - bsp_pinMode(BSP_PIN_7, BSP_PINMODE_INPUT);
1.111 - // BORDER_DIR_OUT;
1.112 -
1.113 -
1.114 - epd_panelon_off();
1.115 - epd_spi_init();
1.116 - epd_cs_low();
1.117 - // epd_pwm_low();
1.118 - epd_pwm_active(0); //set output low
1.119 - epd_rst_low();
1.120 - epd_discharge_low();
1.121 -
1.122 -// TESTPin_DIR_OUT();
1.123 -// TESTPin2_DIR_OUT();
1.124 + bsp_InitDisplayHardware();
1.125 }
1.126
1.127 //************************************************************************