2015-06-03 18:24:08 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2015 Freie Universität Berlin
|
|
|
|
*
|
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser
|
|
|
|
* General Public License v2.1. See the file LICENSE in the top level
|
|
|
|
* directory for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @ingroup cpu_cc2538
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @brief CPU specific definitions for internal peripheral handling
|
|
|
|
*
|
|
|
|
* @author Hauke Petersen <hauke.peterse@fu-berlin.de>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PERIPH_CPU_H_
|
|
|
|
#define PERIPH_CPU_H_
|
|
|
|
|
2016-03-07 23:25:20 +01:00
|
|
|
#include <stdint.h>
|
|
|
|
|
2015-09-17 21:11:42 +02:00
|
|
|
#include "cc2538_ssi.h"
|
2016-06-08 20:36:54 +02:00
|
|
|
#include "cc2538_gpio.h"
|
2015-09-17 21:11:42 +02:00
|
|
|
|
2015-06-03 18:24:08 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2016-02-07 20:35:27 +01:00
|
|
|
/**
|
|
|
|
* @brief Length of the CPU_ID in octets
|
|
|
|
*/
|
|
|
|
#define CPUID_LEN (8U)
|
2015-06-03 18:24:08 +02:00
|
|
|
|
2016-03-03 17:04:39 +01:00
|
|
|
/**
|
|
|
|
* @brief Define a custom type for GPIO pins
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
#define HAVE_GPIO_T
|
|
|
|
typedef uint32_t gpio_t;
|
2016-06-08 20:36:54 +02:00
|
|
|
|
|
|
|
#define GPIO_PIN(port_num, bit_num) GPIO_PXX_TO_NUM(port_num, bit_num)
|
2016-03-03 17:04:39 +01:00
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Definition of a fitting UNDEF value
|
|
|
|
*/
|
|
|
|
#define GPIO_UNDEF (0xffffffff)
|
|
|
|
|
2015-09-17 21:11:42 +02:00
|
|
|
/**
|
|
|
|
* @brief declare needed generic SPI functions
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
#define PERIPH_SPI_NEEDS_TRANSFER_REG
|
|
|
|
#define PERIPH_SPI_NEEDS_TRANSFER_REGS
|
|
|
|
/** @} */
|
|
|
|
|
2016-03-03 17:04:39 +01:00
|
|
|
typedef struct {
|
|
|
|
gpio_t scl_pin; /**< pin used for SCL */
|
|
|
|
gpio_t sda_pin; /**< pin used for SDA */
|
|
|
|
} i2c_conf_t;
|
|
|
|
|
2015-09-17 21:11:42 +02:00
|
|
|
/**
|
|
|
|
* @brief SPI configuration data structure
|
|
|
|
*/
|
|
|
|
#define HAVE_PERIPH_SPI_CONF_T
|
|
|
|
typedef struct {
|
|
|
|
cc2538_ssi_t *dev; /**< SSI device */
|
|
|
|
gpio_t mosi_pin; /**< pin used for MOSI */
|
|
|
|
gpio_t miso_pin; /**< pin used for MISO */
|
|
|
|
gpio_t sck_pin; /**< pin used for SCK */
|
|
|
|
gpio_t cs_pin; /**< pin used for CS */
|
|
|
|
} periph_spi_conf_t;
|
|
|
|
|
2015-06-03 18:24:08 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2016-03-03 17:04:39 +01:00
|
|
|
#include "periph/dev_enums.h"
|
|
|
|
|
2015-06-03 18:24:08 +02:00
|
|
|
#endif /* PERIPH_CPU_H_ */
|
|
|
|
/** @} */
|