[X9D] Backlight support on simu

This commit is contained in:
bsongis
2012-12-28 08:20:22 +00:00
parent 7eae709938
commit 3d92371570
10 changed files with 27 additions and 62 deletions
-27
View File
@@ -1,27 +0,0 @@
/**
******************************************************************************
* @file Project/Macro_define.h
* @author X9D Application Team
* @Hardware version V0.2
* @date 11-July-2012
* @brief This file provides Macro defines for testing or working.
* *
******************************************************************************
*/
#ifndef _Macro_Define_H_
#define _Macro_Define_H_
#include "stm32f2xx.h"
#define assert(x) do{ if(!(x)) while(1);}while(0);
#define udelay(x) do{ uint32_t temp; temp=((x+0)<<3); while(--temp);}while(0)
#define delayUsec(x) udelay(x)
#define LCD_TEST
#define AUDIO_TEST
//#define I2C_TEST
//#define ADC_TEST
#endif
+4 -1
View File
@@ -109,6 +109,9 @@ uint32_t check_soft_power();
#define setBacklight(xx)
#define __BACKLIGHT_ON GPIO_SetBits(GPIOB, GPIO_Pin_BL)
#define __BACKLIGHT_OFF GPIO_ResetBits(GPIOB, GPIO_Pin_BL)
#define IS_BACKLIGHT_ON() (GPIOB & GPIO_Pin_BL)
#define IS_BACKLIGHT_ON() GPIO_IsSet(GPIOB, GPIO_Pin_BL)
#define udelay(x) do { uint32_t temp; temp=((x+0)<<3); while(--temp); } while (0)
#define delayUsec(x) udelay(x)
#endif
+4 -1
View File
@@ -33,8 +33,11 @@
#include "../open9x.h"
void init_spi()
void eepromInit()
{
#if !defined(SIMU)
I2C_EE_Init();
#endif
}
void eeprom_write_enable()
+3 -6
View File
@@ -10,10 +10,7 @@
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include "i2c_ee.h"
#include "hal.h"
#include "Macro_define.h"
#include "../open9x.h"
uint16_t EEPROM_ADDRESS;
@@ -136,11 +133,11 @@ void I2C_SEND_DATA(char SendByte)
while (i--) {
SCL_L;
I2C_delay();
if (SendByte&0x80)
if (SendByte & 0x80)
SDA_H;
else
SDA_L;
SendByte<<=1;
SendByte <<= 1;
I2C_delay();
SCL_H;
I2C_delay();