##// END OF EJS Templates
Added STM32F4 target, improved rules files, added additional Include folder var...
Added STM32F4 target, improved rules files, added additional Include folder var for project files.

File last commit:

r14:c6ae61909bfd default
r14:c6ae61909bfd default
Show More
bsp.c
124 lines | 2.5 KiB | text/x-c | CLexer
/*------------------------------------------------------------------------------
-- 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@gmail.com
-------------------------------------------------------------------------------*/
#include "bsp.h"
unsigned int OSC0 =12000000;
unsigned int INTOSC =4000000;
unsigned int RTCOSC =32768;
unsigned int currentCpuFreq=0;
float VREF0 =(float)3.3;
int bsp_init()
{
bsp_GPIO_init();
bsp_uart_init();
return 0;
}
void bsp_GPIO_init()
{
RCC->AHB1ENR |= (1<<3); //Enable CLK for GPIO port D
GPIOD->MODER |= (1<<(12*2));
GPIOD->MODER &= ~(2<<(12*2)); //GREEN LED ON PD12
GPIOD->MODER |= (1<<(13*2));
GPIOD->MODER &= ~(2<<(13*2)); //ORANGE LED ON PD13
GPIOD->MODER |= (1<<(14*2));
GPIOD->MODER &= ~(2<<(14*2)); //RED LED ON PD14
GPIOD->MODER |= (1<<(15*2));
GPIOD->MODER &= ~(2<<(15*2)); //BLUE LED ON PD15
GREENLEDOFF;
ORANGELEDOFF;
REDLEDOFF;
BLUELEDOFF;
}
void bsp_uart_init()
{
RCC->APB1ENR |= (1<<17); //Enable Clk for UART2
GPIOA->MODER |= (2<<(2*2));
GPIOA->MODER &= ~(1<<(2*2)); //UART2 TX ON PA2
GPIOA->AFRL &= ~(7<<(4*2)); //Set alternate function AF0 on PA2 for uart2 tx
}
void bsp_ssp_init()
{
}
void bsp_iic_init()
{
}
void bsp_SD_init()
{
}
void consoleputc(char c)
{
}
char consolegetc()
{
return ' ';
}
void vs10XXclearXCS(){}
void vs10XXsetXCS(){}
int vs10XXDREQ()
{
return 1;
}
void bsppowersdcard(char onoff) //always ON
{
}
char bspsdcardpresent()
{
return 0;
}
char bspsdcardwriteprotected()
{
return 0;
}
void bspsdcardselect(char YESNO)
{
}