|
|
/*------------------------------------------------------------------------------
|
|
|
-- This file is a part of the libuc, microcontroler library
|
|
|
-- Copyright (C) 2011, Alexis Jeandet
|
|
|
--
|
|
|
-- This program is free software; you can redistribute it and/or modify
|
|
|
-- it under the terms of the GNU General Public License as published by
|
|
|
-- the Free Software Foundation; either version 3 of the License, or
|
|
|
-- (at your option) any later version.
|
|
|
--
|
|
|
-- This program is distributed in the hope that it will be useful,
|
|
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
-- GNU General Public License for more details.
|
|
|
--
|
|
|
-- You should have received a copy of the GNU General Public License
|
|
|
-- along with this program; if not, write to the Free Software
|
|
|
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
-------------------------------------------------------------------------------
|
|
|
-- Author : Alexis Jeandet
|
|
|
-- Mail : alexis.jeandet@member.fsf.org
|
|
|
-------------------------------------------------------------------------------*/
|
|
|
#ifndef BSP_H
|
|
|
#define BSP_H
|
|
|
#include <stm32f4xx.h>
|
|
|
#include <stm32f4xx_gpio.h>
|
|
|
#include <stm32f4xx_rcc.h>
|
|
|
#include <gpio.h>
|
|
|
#include <ili9328.h>
|
|
|
#include <D51E5TA7601.h>
|
|
|
#include <genericLCD_Controler.h>
|
|
|
|
|
|
#define __MAX_OPENED_FILES__ 4
|
|
|
#define __FS_ROOT_SIZE__ 4
|
|
|
/*
|
|
|
#ifndef PD8
|
|
|
#define PD8
|
|
|
#endif
|
|
|
#ifndef PD9
|
|
|
#define PD9
|
|
|
#endif
|
|
|
*/
|
|
|
|
|
|
|
|
|
#define LED1 PF6
|
|
|
#define LED2 PF7
|
|
|
#define LED3 PF8
|
|
|
|
|
|
#define PSU_DISABLE PH2
|
|
|
#define DCIN_ALERT PH12
|
|
|
#define PSU_ALERT_5V PH9
|
|
|
#define PSU_ALERT_1_5V PH10
|
|
|
#define PSU_ALERT_3_3V PH11
|
|
|
|
|
|
#define LCD_RESET PE2
|
|
|
#define LCD_BACKLIGHT PE6
|
|
|
#define BP1 PI1
|
|
|
#define BP2 PI2
|
|
|
#define BP3 PD2
|
|
|
#define BP4 PD3
|
|
|
|
|
|
#define TC_IRQ PA3
|
|
|
#define TC_CS PA4
|
|
|
#define TC_CLK PA5
|
|
|
#define TC_DOUT PA6
|
|
|
#define TC_DIN PA7
|
|
|
#define TC_BUSY PB0
|
|
|
|
|
|
|
|
|
|
|
|
//LCD Signals
|
|
|
#define LCD_CS PD7 //FSMC_NE1
|
|
|
#define LCD_RS PE4 //FSMC_A20
|
|
|
#define LCD_WR PD5 //FSMC_NWE
|
|
|
#define LCD_RD PD4 //FSMC_NOE
|
|
|
#define LCD_RST PE2
|
|
|
|
|
|
#define LCD_D0 PD14
|
|
|
#define LCD_D1 PD15
|
|
|
#define LCD_D2 PD0
|
|
|
#define LCD_D3 PD1
|
|
|
#define LCD_D4 PE7
|
|
|
#define LCD_D5 PE8
|
|
|
#define LCD_D6 PE9
|
|
|
#define LCD_D7 PE10
|
|
|
#define LCD_D8 PE11
|
|
|
#define LCD_D9 PE12
|
|
|
#define LCD_D10 PE13
|
|
|
#define LCD_D11 PE14
|
|
|
#define LCD_D12 PE15
|
|
|
#define LCD_D13 PD8
|
|
|
#define LCD_D14 PD9
|
|
|
#define LCD_D15 PD10
|
|
|
|
|
|
//SSRAM Signals
|
|
|
#define SRAM_NBL0 PE0 //FSMC_NBL0
|
|
|
#define SRAM_NBL1 PE1 //FSMC_NBL1
|
|
|
#define SRAM_NOE PD4 //FSMC_NOE
|
|
|
#define SRAM_NWE PD5 //FSMC_NWE
|
|
|
#define SRAM_NCE PG9 //FSMC_NE2
|
|
|
|
|
|
#define SRAM_A0 PF0 //FSMC_A0
|
|
|
#define SRAM_A1 PF1 //FSMC_A1
|
|
|
#define SRAM_A2 PF2 //FSMC_A2
|
|
|
#define SRAM_A3 PF3 //FSMC_A3
|
|
|
#define SRAM_A4 PF4 //FSMC_A4
|
|
|
#define SRAM_A5 PF5 //FSMC_A5
|
|
|
#define SRAM_A6 PF12 //FSMC_A6
|
|
|
#define SRAM_A7 PF13 //FSMC_A7
|
|
|
#define SRAM_A8 PF14 //FSMC_A8
|
|
|
#define SRAM_A9 PF15 //FSMC_A9
|
|
|
#define SRAM_A10 PG0 //FSMC_A10
|
|
|
#define SRAM_A11 PG1 //FSMC_A11
|
|
|
#define SRAM_A12 PG2 //FSMC_A12
|
|
|
#define SRAM_A13 PG3 //FSMC_A13
|
|
|
#define SRAM_A14 PG4 //FSMC_A14
|
|
|
#define SRAM_A15 PG5 //FSMC_A15
|
|
|
#define SRAM_A16 PD11 //FSMC_A16
|
|
|
#define SRAM_A17 PD12 //FSMC_A17
|
|
|
#define SRAM_A18 PD13 //FSMC_A18
|
|
|
#define SRAM_A19 PE3 //FSMC_A19
|
|
|
|
|
|
#define SRAM_D0 PD14
|
|
|
#define SRAM_D1 PD15
|
|
|
#define SRAM_D2 PD0
|
|
|
#define SRAM_D3 PD1
|
|
|
#define SRAM_D4 PE7
|
|
|
#define SRAM_D5 PE8
|
|
|
#define SRAM_D6 PE9
|
|
|
#define SRAM_D7 PE10
|
|
|
#define SRAM_D8 PE11
|
|
|
#define SRAM_D9 PE12
|
|
|
#define SRAM_D10 PE13
|
|
|
#define SRAM_D11 PE14
|
|
|
#define SRAM_D12 PE15
|
|
|
#define SRAM_D13 PD8
|
|
|
#define SRAM_D14 PD9
|
|
|
#define SRAM_D15 PD10
|
|
|
|
|
|
|
|
|
extern float VREF0;
|
|
|
|
|
|
extern uint32_t currentCpuFreq;
|
|
|
extern LCD_t lcd0;
|
|
|
|
|
|
extern LCD_t* FRAME_BUFFER;
|
|
|
extern LCD_t FRAME_BUFFER0;
|
|
|
extern LCD_t FRAME_BUFFER1;
|
|
|
|
|
|
|
|
|
extern int bsp_init();
|
|
|
|
|
|
extern void bsp_GPIO_init();
|
|
|
extern void bsp_uart_init();
|
|
|
extern void bsp_iic_init();
|
|
|
extern void bsp_spi_init();
|
|
|
extern void bsp_SD_init();
|
|
|
extern void bsp_TC_init();
|
|
|
extern void bsp_GTerm_init();
|
|
|
extern int bsp_FSMC_init();
|
|
|
|
|
|
extern void TC_setnCS(char val);
|
|
|
extern int TC_busy();
|
|
|
|
|
|
/* VS1053 */
|
|
|
extern void clearXCS();
|
|
|
extern void setXCS();
|
|
|
extern int vs10XXDREQ();
|
|
|
|
|
|
/* SD CARD */
|
|
|
void bsppowersdcard(char onoff);
|
|
|
char bspsdcardpresent();
|
|
|
void bspsdcardselect(char YESNO);
|
|
|
char bspsdcardwriteprotected();
|
|
|
|
|
|
|
|
|
void bsp_lcd0_write_reg(uint32_t reg,uint32_t data);
|
|
|
uint32_t bsp_lcd0_read_reg(uint32_t reg);
|
|
|
void bsp_lcd0_writeGRAM(void *buffer, uint32_t count);
|
|
|
void bsp_lcd0_readGRAM(void *buffer, uint32_t count);
|
|
|
uint32_t bsp_lcd0_status();
|
|
|
void bsp_lcd0_setGRAM();
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|