2 files removed
This commit is contained in:
@@ -112,6 +112,8 @@ UADEFS =
|
||||
|
||||
ifeq ($(PCB), TARANIS)
|
||||
SRC = system_stm32f2xx.c \
|
||||
../src/targets/taranis/i2c.c \
|
||||
../src/targets/taranis/delays.c \
|
||||
../src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_rcc.c \
|
||||
../src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_gpio.c \
|
||||
../src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_spi.c \
|
||||
@@ -128,17 +130,16 @@ SRC = system_stm32f2xx.c \
|
||||
../src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_bot.c \
|
||||
../src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_core.c \
|
||||
../src/targets/taranis/usbd_desc.c \
|
||||
../src/targets/taranis/aspi.c \
|
||||
../src/targets/taranis/usb_bsp.c
|
||||
|
||||
CPPSRC = ../src/targets/taranis/aspi.cpp \
|
||||
lcd_driver.cpp \
|
||||
CPPSRC = lcd_driver.cpp \
|
||||
driversboot.cpp \
|
||||
logicioboot.cpp \
|
||||
ff.cpp \
|
||||
x9ddiskio.cpp \
|
||||
../src/targets/taranis/usbd_usr.cpp \
|
||||
usbd_storage_msd.cpp \
|
||||
i2c_ee.cpp \
|
||||
lcdboot.cpp \
|
||||
power.cpp \
|
||||
boot.cpp
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
#ifdef PCBTARANIS
|
||||
#include "stm32f2xx.h"
|
||||
#include "stm32f2xx_flash.h"
|
||||
#include "i2c_ee.h"
|
||||
#include "../src/targets/taranis/i2c.h"
|
||||
#include "hal.h"
|
||||
#include "timers.h"
|
||||
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file Project/spi/spi.h
|
||||
* @author X9D Application Team
|
||||
* @Hardware version V0.2
|
||||
* @date 11-July-2012
|
||||
* @brief spi.c' Header file.
|
||||
* *
|
||||
******************************************************************************
|
||||
*/
|
||||
#ifndef _ASPI_H_
|
||||
#define _ASPI_H_
|
||||
|
||||
#include "stm32f2xx.h"
|
||||
|
||||
#define LCD_NCS_HIGH() (GPIO_LCD->BSRRL = PIN_LCD_NCS)
|
||||
#define LCD_NCS_LOW() (GPIO_LCD->BSRRH = PIN_LCD_NCS)
|
||||
|
||||
#define LCD_A0_HIGH() (GPIO_LCD->BSRRL = PIN_LCD_A0)
|
||||
#define LCD_A0_LOW() (GPIO_LCD->BSRRH = PIN_LCD_A0)
|
||||
|
||||
#define LCD_RST_HIGH() (GPIO_LCD->BSRRL = PIN_LCD_RST)
|
||||
#define LCD_RST_LOW() (GPIO_LCD->BSRRH = PIN_LCD_RST)
|
||||
|
||||
#define LCD_CLK_HIGH() (GPIO_LCD->BSRRL = PIN_LCD_CLK)
|
||||
#define LCD_CLK_LOW() (GPIO_LCD->BSRRH = PIN_LCD_CLK)
|
||||
|
||||
#define LCD_MOSI_HIGH() (GPIO_LCD->BSRRL = PIN_LCD_MOSI)
|
||||
#define LCD_MOSI_LOW() (GPIO_LCD->BSRRH = PIN_LCD_MOSI)
|
||||
|
||||
|
||||
void AspiCmd(u8 Command_Byte);
|
||||
void AspiData(u8 Para_data);
|
||||
//u16 spiRegAccess(u8 addrByte, u8 writeValue);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file Project/ee_drivers/i2c_ee.h
|
||||
* @author X9D Application Team
|
||||
* @version V 0.2
|
||||
* @date 12-JLY-2012
|
||||
* @brief Header for i2c_ee.c module
|
||||
******************************************************************************
|
||||
* @copy
|
||||
*
|
||||
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
|
||||
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
|
||||
* TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
|
||||
* FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
|
||||
* CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
|
||||
*
|
||||
* <h2><center>© COPYRIGHT 2009 STMicroelectronics</center></h2>
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion ------------------------------------ */
|
||||
#ifndef __I2C_EE_H
|
||||
#define __I2C_EE_H
|
||||
|
||||
#define EE_CMD_WRITE (0)
|
||||
#define EE_CMD_READ (1)
|
||||
//#define I2C_delay() //do { delayUsec(5); } while(0)
|
||||
|
||||
#define SCL_H do{I2C_EE_GPIO->BSRRL = I2C_EE_SCL;}while(0)
|
||||
#define SCL_L do{I2C_EE_GPIO->BSRRH = I2C_EE_SCL;}while(0)
|
||||
#define SDA_H do{I2C_EE_GPIO->BSRRL = I2C_EE_SDA;}while(0)
|
||||
#define SDA_L do{I2C_EE_GPIO->BSRRH = I2C_EE_SDA;}while(0)
|
||||
#define SCL_read (I2C_EE_GPIO->IDR & I2C_EE_SCL)
|
||||
#define SDA_read (I2C_EE_GPIO->IDR & I2C_EE_SDA)
|
||||
#define WP_H do{I2C_EE_WP_GPIO->BSRRL = I2C_EE_WP;}while(0)
|
||||
#define WP_L do{I2C_EE_WP_GPIO->BSRRH = I2C_EE_WP;}while(0)
|
||||
|
||||
|
||||
/* Exported functions ------------------------------------------------------- */
|
||||
void I2C_EE_Init(void);
|
||||
void I2C_EE_ByteWrite(uint8_t* pBuffer, uint16_t WriteAddr);
|
||||
void I2C_EE_PageWrite(uint8_t* pBuffer, uint16_t WriteAddr, uint8_t NumByteToWrite);
|
||||
void I2C_EE_BufferWrite(uint8_t* pBuffer, uint16_t WriteAddr, uint16_t NumByteToWrite);
|
||||
void I2C_EE_BufferRead(uint8_t* pBuffer, uint16_t ReadAddr, uint16_t NumByteToRead);
|
||||
void I2C_EE_WaitEepromStandbyState(void);
|
||||
void I2C_set_volume( uint8_t volume ) ;
|
||||
uint8_t I2C_read_volume( void ) ;
|
||||
|
||||
#endif /* __I2C_EE_H */
|
||||
|
||||
/******************* (C) COPYRIGHT 2009 STMicroelectronics *****END OF FILE****/
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include "stm32f2xx_gpio.h"
|
||||
#include "stm32f2xx_rcc.h"
|
||||
#include "hal.h"
|
||||
#include "aspi.h"
|
||||
#include "../src/targets/taranis/aspi.h"
|
||||
|
||||
#include "timers.h"
|
||||
#include "lcd.h"
|
||||
@@ -268,7 +268,7 @@ static void LCD_Init()
|
||||
AspiCmd(0xF7); //ending row address of RAM program window.
|
||||
AspiCmd(0x9F);
|
||||
|
||||
AspiCmd(0xAF); //dc2=1,IC into exit SLEEP MODE, dc3=1 gray=ON ¿ª»Ò½× ,dc4=1 Green Enhanc mode disabled ÂÌÉ«Ôöǿģʽ¹Ø
|
||||
AspiCmd(0xAF); //dc2=1,IC into exit SLEEP MODE, dc3=1 gray=ON ���ҽ� ,dc4=1 Green Enhanc mode disabled ��ɫ��ǿģʽ��
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include <string.h>
|
||||
//#include <stdlib.h>
|
||||
#include "drivers.h"
|
||||
#include "i2c_ee.h"
|
||||
#include "../src/targets/taranis/i2c.h"
|
||||
|
||||
#include "diskio.h"
|
||||
//#include "board_taranis.h"
|
||||
|
||||
+2
-2
@@ -636,12 +636,12 @@ ifeq ($(PCB), TARANIS)
|
||||
EXTRAINCDIRS += targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc
|
||||
EXTRAINCDIRS += targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/inc targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/hid/inc
|
||||
BOARDSRC = targets/taranis/board_taranis.cpp
|
||||
EXTRABOARDSRC += targets/taranis/lcd_driver.cpp targets/taranis/aspi.cpp targets/taranis/i2c.c
|
||||
EXTRABOARDSRC += targets/taranis/lcd_driver.cpp targets/taranis/aspi.c targets/taranis/i2c.c targets/taranis/delays.c
|
||||
SRC += CoOS/kernel/core.c CoOS/kernel/hook.c CoOS/kernel/task.c CoOS/kernel/event.c CoOS/kernel/time.c CoOS/kernel/timer.c CoOS/kernel/flag.c CoOS/kernel/mutex.c CoOS/kernel/serviceReq.c CoOS/portable/GCC/port.c CoOS/portable/arch.c
|
||||
EEPROMSRC = eeprom_common.cpp eeprom_rlc.cpp eeprom_conversions.cpp
|
||||
PULSESSRC = protocols/pulses_arm.cpp protocols/ppm_arm.cpp protocols/pxx_arm.cpp
|
||||
CPPSRC += audio_arm.cpp
|
||||
CPPSRC += targets/taranis/pwr_driver.cpp targets/taranis/pulses_driver.cpp targets/taranis/keys_driver.cpp targets/taranis/adc_driver.cpp targets/taranis/trainer_driver.cpp targets/taranis/audio_driver.cpp targets/taranis/delays.cpp targets/taranis/uart3_driver.cpp targets/taranis/sport_driver.cpp
|
||||
CPPSRC += targets/taranis/pwr_driver.cpp targets/taranis/pulses_driver.cpp targets/taranis/keys_driver.cpp targets/taranis/adc_driver.cpp targets/taranis/trainer_driver.cpp targets/taranis/audio_driver.cpp targets/taranis/uart3_driver.cpp targets/taranis/sport_driver.cpp
|
||||
CPPSRC += bmp.cpp gui/view_channels.cpp gui/view_about.cpp gui/view_text.cpp
|
||||
SRC += targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Device/ST/STM32F2xx/Source/Templates/system_stm32f2xx.c
|
||||
SRC += targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/misc.c
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#include "../../opentx.h"
|
||||
#include "./STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_gpio.h"
|
||||
#include "board_taranis.h"
|
||||
|
||||
/**
|
||||
**********send command to lcd**************
|
||||
@@ -11,6 +11,10 @@
|
||||
#ifndef _ASPI_H_
|
||||
#define _ASPI_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "./STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Device/ST/STM32F2xx/Include/stm32f2xx.h"
|
||||
|
||||
#define __no_operation __NOP
|
||||
@@ -33,5 +37,9 @@
|
||||
void AspiCmd(u8 Command_Byte);
|
||||
void AspiData(u8 Para_data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -45,17 +45,28 @@
|
||||
#include "STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_dma.h"
|
||||
#include "STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_usart.h"
|
||||
#include "STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Device/ST/STM32F2xx/Include/stm32f2xx.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/inc/usbd_msc_core.h"
|
||||
#include "STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc/usbd_usr.h"
|
||||
#include "usbd_desc.h"
|
||||
#include "usb_conf.h"
|
||||
#include "usbd_conf.h"
|
||||
}
|
||||
|
||||
#include "hal.h"
|
||||
#include "aspi.h"
|
||||
#include "i2c.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(BOOT)
|
||||
#include "audio_driver.h"
|
||||
#endif
|
||||
|
||||
#define PERI1_FREQUENCY 30000000
|
||||
#define PERI2_FREQUENCY 60000000
|
||||
@@ -97,11 +108,11 @@ void delay_01us(uint16_t nb);
|
||||
#define SD_GET_SIZE_MB() (0)
|
||||
#define SD_GET_BLOCKNR() (0)
|
||||
#define SD_GET_SPEED() (0)
|
||||
void sdInit();
|
||||
void sdDone();
|
||||
void sdPoll10ms();
|
||||
void sdInit(void);
|
||||
void sdDone(void);
|
||||
void sdPoll10ms(void);
|
||||
#define sdMountPoll()
|
||||
uint32_t sdMounted();
|
||||
uint32_t sdMounted(void);
|
||||
#define SD_CARD_PRESENT() (~SD_PRESENT_GPIO->IDR & SD_PRESENT_GPIO_Pin)
|
||||
#endif
|
||||
|
||||
@@ -116,15 +127,15 @@ void init_dsm2( uint32_t module_index );
|
||||
void disable_dsm2( uint32_t module_index );
|
||||
|
||||
// Trainer driver
|
||||
void init_trainer_ppm();
|
||||
void stop_trainer_ppm();
|
||||
void init_trainer_capture();
|
||||
void stop_trainer_capture();
|
||||
void init_trainer_ppm(void);
|
||||
void stop_trainer_ppm(void);
|
||||
void init_trainer_capture(void);
|
||||
void stop_trainer_capture(void);
|
||||
|
||||
// Keys driver
|
||||
void keysInit();
|
||||
uint32_t readKeys();
|
||||
uint32_t readTrims();
|
||||
void keysInit(void);
|
||||
uint32_t readKeys(void);
|
||||
uint32_t readTrims(void);
|
||||
#define TRIMS_PRESSED() (readTrims())
|
||||
#define KEYS_PRESSED() (~readKeys())
|
||||
#define DBLKEYS_PRESSED_RGT_LFT(i) ((in & ((2<<KEY_PLUS) + (2<<KEY_MINUS))) == ((2<<KEY_PLUS) + (2<<KEY_MINUS)))
|
||||
@@ -141,8 +152,8 @@ void watchdogInit(unsigned int duration);
|
||||
#endif
|
||||
|
||||
// ADC driver
|
||||
void adcInit();
|
||||
void adcRead();
|
||||
void adcInit(void);
|
||||
void adcRead(void);
|
||||
extern volatile uint16_t Analog_values[];
|
||||
#if defined(REV3)
|
||||
#define BATT_SCALE 120
|
||||
@@ -151,9 +162,9 @@ extern volatile uint16_t Analog_values[];
|
||||
#endif
|
||||
|
||||
// Power driver
|
||||
void pwrInit();
|
||||
uint32_t pwrCheck();
|
||||
void pwrOff();
|
||||
void pwrInit(void);
|
||||
uint32_t pwrCheck(void);
|
||||
void pwrOff(void);
|
||||
#define UNEXPECTED_SHUTDOWN() (g_eeGeneral.unexpectedShutdown)
|
||||
#define INTERNAL_RF_ON() GPIO_SetBits(GPIOPWR, PIN_INT_RF_PWR)
|
||||
#define INTERNAL_RF_OFF() GPIO_ResetBits(GPIOPWR, PIN_INT_RF_PWR)
|
||||
@@ -166,12 +177,14 @@ void pwrOff();
|
||||
#define __BACKLIGHT_OFF TIM10->CCR1 = 0
|
||||
#define IS_BACKLIGHT_ON() (TIM10->CCR1 != 0)
|
||||
|
||||
#if !defined(BOOT)
|
||||
// USB driver
|
||||
#define BOOTLOADER_REQUEST() (0)
|
||||
#define usbBootloader()
|
||||
void usbInit(void);
|
||||
void usbStart(void);
|
||||
bool usbPlugged(void);
|
||||
#endif
|
||||
|
||||
// EEPROM driver
|
||||
#if !defined(SIMU)
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../opentx.h"
|
||||
#include "board_taranis.h"
|
||||
|
||||
void delaysInit(void)
|
||||
{
|
||||
@@ -10,7 +10,7 @@
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#include "../opentx.h"
|
||||
#include "board_taranis.h"
|
||||
|
||||
#define I2C_delay() delay_01us(100);
|
||||
|
||||
@@ -44,7 +44,7 @@ static void I2C_GPIO_Configuration(void)
|
||||
SCL_H;
|
||||
}
|
||||
|
||||
short I2C_START()
|
||||
short I2C_START(void)
|
||||
{
|
||||
SDA_H;
|
||||
I2C_delay();
|
||||
@@ -59,7 +59,7 @@ short I2C_START()
|
||||
return 1;
|
||||
}
|
||||
|
||||
void I2C_STOP()
|
||||
void I2C_STOP(void)
|
||||
{
|
||||
SCL_L;
|
||||
I2C_delay();
|
||||
@@ -71,7 +71,7 @@ void I2C_STOP()
|
||||
I2C_delay();
|
||||
}
|
||||
|
||||
void I2C_ACK()
|
||||
void I2C_ACK(void)
|
||||
{
|
||||
SCL_L;
|
||||
I2C_delay();
|
||||
@@ -82,7 +82,8 @@ void I2C_ACK()
|
||||
SCL_L;
|
||||
I2C_delay();
|
||||
}
|
||||
void I2C_NO_ACK()
|
||||
|
||||
void I2C_NO_ACK(void)
|
||||
{
|
||||
SCL_L;
|
||||
I2C_delay();
|
||||
@@ -94,7 +95,7 @@ void I2C_NO_ACK()
|
||||
I2C_delay();
|
||||
}
|
||||
|
||||
short I2C_WAIT_ACK()
|
||||
short I2C_WAIT_ACK(void)
|
||||
{
|
||||
short i=50;
|
||||
SCL_L;
|
||||
@@ -103,7 +104,7 @@ short I2C_WAIT_ACK()
|
||||
I2C_delay();
|
||||
SCL_H;
|
||||
I2C_delay();
|
||||
while(i) {
|
||||
while (i) {
|
||||
if(SDA_read) {
|
||||
I2C_delay();
|
||||
i--;
|
||||
@@ -138,7 +139,7 @@ void I2C_SEND_DATA(char SendByte)
|
||||
I2C_delay();
|
||||
}
|
||||
|
||||
char I2C_READ()
|
||||
char I2C_READ(void)
|
||||
{
|
||||
short i=8;
|
||||
char ReceiveByte=0;
|
||||
@@ -158,7 +159,7 @@ char I2C_READ()
|
||||
return ReceiveByte;
|
||||
}
|
||||
|
||||
void I2C_EE_Init()
|
||||
void I2C_EE_Init(void)
|
||||
{
|
||||
/* GPIO Periph clock enable */
|
||||
RCC_AHB1PeriphClockCmd(I2C_EE_GPIO_CLK, ENABLE);
|
||||
|
||||
@@ -33,6 +33,10 @@
|
||||
#define WP_H do{I2C_EE_WP_GPIO->BSRRL = I2C_EE_WP;}while(0)
|
||||
#define WP_L do{I2C_EE_WP_GPIO->BSRRH = I2C_EE_WP;}while(0)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported functions ------------------------------------------------------- */
|
||||
void I2C_EE_Init(void);
|
||||
void I2C_EE_ByteWrite(uint8_t* pBuffer, uint16_t WriteAddr);
|
||||
@@ -42,7 +46,11 @@ void I2C_EE_BufferRead(uint8_t* pBuffer, uint16_t ReadAddr, uint16_t NumByteToRe
|
||||
void I2C_EE_WaitEepromStandbyState(void);
|
||||
|
||||
void I2C_set_volume(register uint8_t volume);
|
||||
uint8_t I2C_read_volume();
|
||||
uint8_t I2C_read_volume(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __I2C_EE_H */
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ extern "C" {
|
||||
#include "usbd_msc_mem.h"
|
||||
#include "usb_conf.h"
|
||||
|
||||
void eeprom_read_block (void *pointer_ram, uint16_t pointer_eeprom, size_t size);
|
||||
// void eeprom_read_block (void *pointer_ram, uint16_t pointer_eeprom, size_t size);
|
||||
|
||||
#define STORAGE_LUN_NBR 2
|
||||
#define BLOCKSIZE 512
|
||||
|
||||
Reference in New Issue
Block a user