mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-25 14:33:52 +01:00
boards - msbiot: prepare msbiot for new cc110x driver
This commit is contained in:
parent
eebfd5011a
commit
dc658f8be0
@ -1,4 +1,5 @@
|
||||
# tell the Makefile.base which module to build
|
||||
MODULE = $(BOARD)_base
|
||||
INCLUDES += -I$(RIOTBASE)/drivers/cc110x
|
||||
|
||||
include $(RIOTBASE)/Makefile.base
|
||||
|
||||
@ -1,2 +1,3 @@
|
||||
FEATURES_PROVIDED += cpp
|
||||
FEATURES_PROVIDED += periph_gpio
|
||||
FEATURES_PROVIDED += transceiver
|
||||
|
||||
@ -52,3 +52,10 @@ endif
|
||||
|
||||
# export board specific includes to the global includes-listing
|
||||
export INCLUDES += -I$(RIOTBOARD)/$(BOARD)/include
|
||||
|
||||
ifneq (,$(filter defaulttransceiver,$(USEMODULE)))
|
||||
USEMODULE += cc110x
|
||||
ifeq (,$(filter netdev_base,$(USEMODULE)))
|
||||
USEMODULE += transceiver
|
||||
endif
|
||||
endif
|
||||
|
||||
@ -23,6 +23,8 @@
|
||||
|
||||
#include "cpu.h"
|
||||
#include "periph_conf.h"
|
||||
#include "periph/gpio.h"
|
||||
#include "periph/spi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -38,6 +40,19 @@ extern "C" {
|
||||
*/
|
||||
#define HW_TIMER TIMER_0
|
||||
|
||||
/**
|
||||
* @name Configure connected CC1101 (radio) device
|
||||
* @{
|
||||
*/
|
||||
#define CC110X_SPI SPI_0
|
||||
#define CC110X_CS GPIO_7
|
||||
#define CC110X_GDO0 GPIO_11
|
||||
#define CC110X_GDO1 GPIO_2
|
||||
#define CC110X_GDO2 GPIO_12
|
||||
|
||||
typedef uint8_t radio_packet_length_t;
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @name Define UART device and baudrate for stdio
|
||||
* @{
|
||||
|
||||
@ -124,6 +124,35 @@ extern "C" {
|
||||
#define UART_2_AF 7
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @name SPI configuration
|
||||
* @{
|
||||
*/
|
||||
#define SPI_NUMOF 1
|
||||
#define SPI_0_EN 1
|
||||
#define SPI_1_EN 0
|
||||
#define SPI_IRQ_PRIO 1
|
||||
|
||||
/* SPI 0 device config */
|
||||
#define SPI_0_DEV SPI1
|
||||
#define SPI_0_CLKEN() (RCC->APB2ENR |= RCC_APB2ENR_SPI1EN)
|
||||
#define SPI_0_CLKDIS() (RCC->APB2ENR &= ~RCC_APB2ENR_SPI1EN)
|
||||
#define SPI_0_IRQ SPI1_IRQn
|
||||
#define SPI_0_IRQ_HANDLER isr_spi1
|
||||
/* SPI 0 pin configuration */
|
||||
#define SPI_0_SCK_PORT GPIOA
|
||||
#define SPI_0_SCK_PIN 5
|
||||
#define SPI_0_SCK_AF 5
|
||||
#define SPI_0_MISO_PORT GPIOA
|
||||
#define SPI_0_MISO_PIN 6
|
||||
#define SPI_0_MISO_AF 5
|
||||
#define SPI_0_MOSI_PORT GPIOA
|
||||
#define SPI_0_MOSI_PIN 7
|
||||
#define SPI_0_MOSI_AF 5
|
||||
#define SPI_0_SCK_PORT_CLKEN() (RCC->AHB1ENR |= RCC_AHB1ENR_GPIOAEN)
|
||||
#define SPI_0_MISO_PORT_CLKEN() (RCC->AHB1ENR |= RCC_AHB1ENR_GPIOAEN)
|
||||
#define SPI_0_MOSI_PORT_CLKEN() (RCC->AHB1ENR |= RCC_AHB1ENR_GPIOAEN)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @name GPIO configuration
|
||||
@ -153,9 +182,9 @@ extern "C" {
|
||||
#define GPIO_IRQ_1 GPIO_1 /* alternatively GPIO_10 could be used here */
|
||||
#define GPIO_IRQ_2 GPIO_15
|
||||
#define GPIO_IRQ_3 -1/* not configured */
|
||||
#define GPIO_IRQ_4 GPIO_2 /* alternatively GPIO_11 could be used here */
|
||||
#define GPIO_IRQ_4 GPIO_11
|
||||
#define GPIO_IRQ_5 GPIO_12
|
||||
#define GPIO_IRQ_6 -1/* not configured */
|
||||
#define GPIO_IRQ_6 GPIO_2
|
||||
#define GPIO_IRQ_7 -1/* not configured */
|
||||
#define GPIO_IRQ_8 GPIO_13
|
||||
#define GPIO_IRQ_9 GPIO_5
|
||||
@ -179,11 +208,11 @@ extern "C" {
|
||||
#define GPIO_1_EXTI_CFG() (SYSCFG->EXTICR[0] |= SYSCFG_EXTICR1_EXTI1_PA)
|
||||
#define GPIO_1_IRQ EXTI1_IRQn
|
||||
/* GPIO channel 2 config */
|
||||
#define GPIO_2_PORT GPIOA
|
||||
#define GPIO_2_PIN 4
|
||||
#define GPIO_2_PORT GPIOA /* CC1101 GDO1 */
|
||||
#define GPIO_2_PIN 6
|
||||
#define GPIO_2_CLKEN() (RCC->AHB1ENR |= RCC_AHB1ENR_GPIOAEN)
|
||||
#define GPIO_2_EXTI_CFG() (SYSCFG->EXTICR[1] |= SYSCFG_EXTICR2_EXTI4_PA)
|
||||
#define GPIO_2_IRQ EXTI4_IRQn
|
||||
#define GPIO_2_EXTI_CFG() (SYSCFG->EXTICR[1] |= SYSCFG_EXTICR2_EXTI6_PA)
|
||||
#define GPIO_2_IRQ EXTI9_5_IRQn
|
||||
/* GPIO channel 3 config */
|
||||
#define GPIO_3_PORT GPIOA /* CC3000 SPI_IRQ */
|
||||
#define GPIO_3_PIN 10
|
||||
|
||||
@ -53,6 +53,16 @@
|
||||
#endif
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @name CC110X buffer size definitions for the stm32f4
|
||||
* @{
|
||||
*/
|
||||
#ifdef MODULE_CC110X
|
||||
#define TRANSCEIVER_BUFFER_SIZE (10)
|
||||
#define RX_BUF_SIZE (10)
|
||||
#endif
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user