1.1 --- a/Display_Hardware_Driver.c Sun May 19 22:06:40 2013 +0000
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,190 +0,0 @@
1.4 -// Copyright 2013 Pervasive Displays, Inc.
1.5 -//
1.6 -// Licensed under the Apache License, Version 2.0 (the "License");
1.7 -// you may not use this file except in compliance with the License.
1.8 -// You may obtain a copy of the License at:
1.9 -//
1.10 -// http://www.apache.org/licenses/LICENSE-2.0
1.11 -//
1.12 -// Unless required by applicable law or agreed to in writing,
1.13 -// software distributed under the License is distributed on an
1.14 -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
1.15 -// express or implied. See the License for the specific language
1.16 -// governing permissions and limitations under the License.
1.17 -
1.18 -/******************************************************************************
1.19 - * Includes
1.20 - *****************************************************************************/
1.21 -#include "Display_Hardware_Driver.h"
1.22 -#include <ubb/ubb.h>
1.23 -
1.24 -
1.25 -/******************************************************************************
1.26 - * Public functions
1.27 - *****************************************************************************/
1.28 -void epd_cs_high(void)
1.29 -{
1.30 - // CS_SET_HIGH;
1.31 - SET(EPD_SSEL);
1.32 -}
1.33 -
1.34 -void epd_cs_low(void)
1.35 -{
1.36 - // CS_SET_LOW;
1.37 - CLR(EPD_SSEL);
1.38 -}
1.39 -
1.40 -void epd_rst_high(void)
1.41 -{
1.42 - // RST_SET_HIGH;
1.43 - SET(EPD_RESET);
1.44 -}
1.45 -
1.46 -void epd_rst_low(void)
1.47 -{
1.48 - // RST_SET_LOW;
1.49 - CLR(EPD_RESET);
1.50 -}
1.51 -
1.52 -void epd_delay_ms(uint32_t Time)
1.53 -{
1.54 - bsp_delayMs(Time);
1.55 -}
1.56 -
1.57 -int16_t epd_get_temperature(void)
1.58 -{
1.59 - return bsp_getTemp();
1.60 -}
1.61 -
1.62 -uint32_t epd_GetCurrentTimeTick(void)
1.63 -{
1.64 - return bsp_getMsTicks();
1.65 -}
1.66 -
1.67 -//******************************************************************
1.68 -//PWM Configuration/Control
1.69 -//******************************************************************
1.70 -#if 0
1.71 -volatile uint32_t period = 500; //96Khz PWM frequency
1.72 -
1.73 -void epd_pwm_disable(void)
1.74 -{
1.75 - disable_timer16(1);
1.76 - LPC_IOCON->PIO1_9 &= 0xFC;//Disable PWM,set general IO
1.77 - PWM_DIR_OUT();
1.78 - PWM_SET_LOW();
1.79 -}
1.80 -
1.81 -void epd_pwm_active(void)
1.82 -{
1.83 - PWM_SET_HIGH();
1.84 - /* Initialize the PWM in timer32_1 enabling match0 output */
1.85 - init_timer16PWM(1, period, MATCH0,0);
1.86 - setMatch_timer16PWM (1, 1, period/8);
1.87 - enable_timer16(1);
1.88 -}
1.89 -#endif
1.90 -void epd_pwm_active(uint16_t delayInMs)
1.91 -{
1.92 - bsp_pwm_active(delayInMs);
1.93 -}
1.94 -
1.95 -
1.96 -//******************************************************************
1.97 -//SPI Configuration
1.98 -//******************************************************************
1.99 -void epd_spi_detach(void)
1.100 -{
1.101 -#if 0
1.102 - LPC_IOCON->PIO0_8 &= 0xFC;; /* SSP I/O config */
1.103 - SPIMISO_DIR_OUT();
1.104 - SPIMISO_Set(Low);
1.105 -
1.106 - LPC_IOCON->PIO0_9 &= 0xFC; /* SSP MOSI */
1.107 - SPIMOSI_DIR_OUT();
1.108 - SPIMOSI_Set(Low);
1.109 -
1.110 - LPC_IOCON->PIO2_11 &= 0xFC;
1.111 - SPICLK_DIR_OUT();
1.112 - SPICLK_Set(Low);
1.113 -#endif
1.114 -}
1.115 -void epd_spi_init (void)
1.116 -{
1.117 - bsp_spiInit();
1.118 -//SSP_IOConfig( SSP_PORT ); /* initialize SSP port */
1.119 -//SSP_Init( SSP_PORT );
1.120 -}
1.121 -
1.122 -void epd_SPI_Send (unsigned char Register, unsigned char *Data, unsigned Length)
1.123 -{
1.124 - uint8_t buf[2];
1.125 -
1.126 - epd_cs_low();
1.127 - buf[0] = 0x70;
1.128 - buf[1] = Register;
1.129 - bsp_writeToDisplay(buf, 2);
1.130 - epd_cs_high();
1.131 - bsp_delayUs(10);
1.132 -
1.133 - epd_cs_low();
1.134 - buf[0] = 0x72;
1.135 - bsp_writeToDisplay(buf, 1);
1.136 - bsp_writeToDisplay(Data, Length);
1.137 - epd_cs_high();
1.138 - bsp_delayUs(10);
1.139 -}
1.140 -
1.141 -
1.142 -
1.143 -void epd_SPI_Send_Byte (uint8_t Register, uint8_t Data)
1.144 -{
1.145 - uint8_t buf[2];
1.146 -
1.147 - epd_cs_low();
1.148 - buf[0] = 0x70;
1.149 - buf[1] = Register;
1.150 - bsp_writeToDisplay(buf, 2);
1.151 - epd_cs_high();
1.152 - bsp_delayUs(10);
1.153 -
1.154 - epd_cs_low();
1.155 - buf[0] = 0x72;
1.156 - buf[1] = Data;
1.157 - bsp_writeToDisplay(buf, 2);
1.158 - epd_cs_high();
1.159 - bsp_delayUs(10);
1.160 -}
1.161 -
1.162 -void epd_InitDisplayHardware(void)
1.163 -{
1.164 - bsp_InitDisplayHardware();
1.165 -}
1.166 -
1.167 -//************************************************************************
1.168 -void TestPinLow(void)
1.169 -{
1.170 -// TESTPin_Set(0);
1.171 -}
1.172 -void TestPinHigh(void)
1.173 -{
1.174 -// TESTPin_Set(1);
1.175 -}
1.176 -void TestPinTrigger(void)
1.177 -{
1.178 -// if(TESTPin_Get())TestPinLow();
1.179 -// else TestPinHigh();
1.180 -}
1.181 -void TestPin2Low(void)
1.182 -{
1.183 -// TESTPin2_Set(0);
1.184 -}
1.185 -void TestPin2High(void)
1.186 -{
1.187 -// TESTPin2_Set(1);
1.188 -}
1.189 -void TestPin2Trigger(void)
1.190 -{
1.191 -// if(TESTPin2_Get())TestPin2Low();
1.192 -// else TestPin2High();
1.193 -}