added Embest-STM32-DMSTF4BB base board

This commit is contained in:
Joel Bodenmann 2013-11-10 21:52:55 +01:00
parent 48c2c7125b
commit 932f4881bc
9 changed files with 2628 additions and 46 deletions

View File

@ -0,0 +1,108 @@
/*
ChibiOS/RT - Copyright (C) 2006-2013 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#include "ch.h"
#include "hal.h"
#if HAL_USE_PAL || defined(__DOXYGEN__)
/**
* @brief PAL setup.
* @details Digital I/O ports static configuration as defined in @p board.h.
* This variable is used by the HAL when initializing the PAL driver.
*/
const PALConfig pal_default_config =
{
{VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR,
VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH},
{VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR,
VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH},
{VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR,
VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH},
{VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR,
VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH},
{VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR,
VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH},
{VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR,
VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH},
{VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR,
VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH},
{VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR,
VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH},
{VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR,
VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH}
};
#endif
/**
* @brief Early initialization code.
* @details This initialization must be performed just after stack setup
* and before any other initialization.
*/
void __early_init(void) {
stm32_clock_init();
}
#if HAL_USE_SDC || defined(__DOXYGEN__)
/**
* @brief SDC card detection.
*/
bool_t sdc_lld_is_card_inserted(SDCDriver *sdcp) {
(void)sdcp;
return !palReadPad(GPIOB, GPIOB_SD_DETECT);
}
/**
* @brief SDC card write protection detection.
*/
bool_t sdc_lld_is_write_protected(SDCDriver *sdcp) {
(void)sdcp;
return FALSE;
}
#endif /* HAL_USE_SDC */
#if HAL_USE_MMC_SPI || defined(__DOXYGEN__)
/**
* @brief MMC_SPI card detection.
*/
bool_t mmc_lld_is_card_inserted(MMCDriver *mmcp) {
(void)mmcp;
return !palReadPad(GPIOB, GPIOB_SD_DETECT);
}
/**
* @brief MMC_SPI card write protection detection.
*/
bool_t mmc_lld_is_write_protected(MMCDriver *mmcp) {
(void)mmcp;
return FALSE;
}
#endif
/**
* @brief Board-specific initialization code.
* @todo Add your board-specific code, if any.
*/
void boardInit(void) {
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,5 @@
# List of all the board related files.
BOARDSRC = ${CHIBIOS}/boards/EMBEST_DMSTF4BB/board.c
# Required include directories
BOARDINC = ${CHIBIOS}/boards/EMBEST_DMSTF4BB

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
GFXINC += $(GFXLIB)/boards/base/Embest-STM32-DMSTF4BB
GFXSRC +=
GFXDEFS += -DGFX_USE_CHIBIOS=TRUE
include $(GFXLIB)/drivers/gdisp/SSD2119/gdisp_lld.mk
include $(GFXLIB)/drivers/ginput/touch/STMPE811/ginput_lld.mk

View File

@ -5,11 +5,6 @@
* http://ugfx.org/license.html
*/
/**
* @file drivers/gdisp/SSD2119/board_SSD2119_embest_dmstf4bb.h
* @brief GDISP Graphic Driver subsystem board FSMC interface for the SSD2119 display.
*/
#ifndef _GDISP_LLD_BOARD_H
#define _GDISP_LLD_BOARD_H

View File

@ -5,15 +5,6 @@
* http://ugfx.org/license.html
*/
/**
* @file drivers/ginput/touch/STMPE811/ginput_lld_mouse_board_embest_dmstf4bb.h
* @brief GINPUT Touch low level driver source for the STMPE811 on the Embest DM-STF4BB board.
*
* @defgroup Mouse Mouse
* @ingroup GINPUT
* @{
*/
#ifndef _GINPUT_LLD_MOUSE_BOARD_H
#define _GINPUT_LLD_MOUSE_BOARD_H
@ -23,11 +14,6 @@ static const I2CConfig i2ccfg = {
FAST_DUTY_CYCLE_2,
};
/**
* @brief Initialise the board for the touch.
*
* @notapi
*/
static void init_board(void)
{
palSetPadMode(GPIOC, 13, PAL_MODE_INPUT | PAL_STM32_PUDR_FLOATING); /* TP IRQ */
@ -37,25 +23,11 @@ static void init_board(void)
i2cStart(&I2CD1, &i2ccfg);
}
/**
* @brief Check whether an interrupt is raised
* @return TRUE if there is an interrupt signal present
*
* @notapi
*/
static inline bool_t getpin_irq(void) {
static inline bool_t getpin_irq(void)
{
return (!(palReadPad(GPIOC, 13)));
}
/**
* @brief Write a value into a certain register
*
* @param[in] reg The register address
* @param[in] n The amount of bytes (one or two)
* @param[in] val The value
*
* @notapi
*/
static void write_reg(uint8_t reg, uint8_t n, uint16_t val)
{
uint8_t txbuf[3];
@ -76,16 +48,6 @@ static void write_reg(uint8_t reg, uint8_t n, uint16_t val)
i2cReleaseBus(&I2CD1);
}
/**
* @brief Read the value of a certain register
*
* @param[in] reg The register address
* @param[in] n The amount of bytes (one or two)
*
* @return Data read from device (one byte or two depending on n param)
*
* @notapi
*/
static uint16_t read_reg(uint8_t reg, uint8_t n)
{
uint8_t txbuf[1], rxbuf[2];
@ -123,4 +85,4 @@ static void read_reg_n(uint8_t reg, uint8_t n, uint8_t *rxbuf)
}
#endif /* _GINPUT_LLD_MOUSE_BOARD_H */
/** @} */

View File

@ -0,0 +1,22 @@
/*
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
*/
#ifndef _LLD_GINPUT_MOUSE_CONFIG_H
#define _LLD_GINPUT_MOUSE_CONFIG_H
#define GINPUT_MOUSE_EVENT_TYPE GEVENT_TOUCH
#define GINPUT_MOUSE_NEED_CALIBRATION TRUE
#define GINPUT_MOUSE_LLD_CALIBRATION_LOADSAVE FALSE
#define GINPUT_MOUSE_MAX_CALIBRATION_ERROR 12
#define GINPUT_MOUSE_READ_CYCLES 4
#define GINPUT_MOUSE_POLL_PERIOD 3
#define GINPUT_MOUSE_MAX_CLICK_JITTER 2
#define GINPUT_MOUSE_MAX_MOVE_JITTER 2
#define GINPUT_MOUSE_CLICK_TIME 500
#endif /* _LLD_GINPUT_MOUSE_CONFIG_H */