boards/quark_se: Add an spi/gpio configuration for TI CC1200 15.4 chip

quark_se_c1000_devboard already embeds a cc2520 which is a 2.4Ghz 15.4
radio chip. But if one want to try a sub-Ghz radio chip such as the
cc1200 on it, it will require to wire as this configuration expects it
to be done.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
Tomasz Bursztyka 2017-08-21 15:42:45 +02:00 committed by Jukka Rissanen
parent 8ded57d3a2
commit 4a713aa824
3 changed files with 70 additions and 0 deletions

View file

@ -60,4 +60,39 @@ endif
endif # IEEE802154_CC2520
if IEEE802154_CC1200
config SPI
def_bool y
config SPI_QMSI
def_bool n
config SPI_DW
def_bool y
config GPIO
def_bool y
config IEEE802154_CC1200_SPI_DRV_NAME
default SPI_1_NAME
config IEEE802154_CC1200_SPI_FREQ
default 8000000
config IEEE802154_CC1200_SPI_SLAVE
default 2
config IEEE802154_CC1200_GPIO_SPI_CS
def_bool y
config IEEE802154_CC1200_GPIO_SPI_CS_DRV_NAME
default GPIO_QMSI_0_NAME
config IEEE802154_CC1200_GPIO_SPI_CS_PIN
default 13
config IEEE802154_CC1200_GPIO_0_NAME
string
default GPIO_QMSI_0_NAME
config IEEE802154_CC1200_GPIO_1_NAME
string
default GPIO_QMSI_1_NAME
endif # IEEE802154_CC1200
endif # BOARD_QUARK_SE_C1000_DEVBOARD

View file

@ -60,3 +60,31 @@ struct cc2520_gpio_configuration *cc2520_configure_gpios(void)
}
#endif /* CONFIG_IEEE802154_CC2520 */
#if defined(CONFIG_IEEE802154_CC1200)
#include <ieee802154/cc1200.h>
#include <gpio.h>
static struct cc1200_gpio_configuration cc1200_gpios[CC1200_GPIO_IDX_MAX] = {
{ .dev = NULL, .pin = CC1200_GPIO_GPIO0, },
};
struct cc1200_gpio_configuration *cc1200_configure_gpios(void)
{
const int flags_int_in = (GPIO_DIR_IN | GPIO_INT |
GPIO_INT_EDGE |
GPIO_INT_DOUBLE_EDGE |
GPIO_INT_DEBOUNCE);
struct device *gpio;
gpio = device_get_binding(CONFIG_IEEE802154_CC1200_GPIO_0_NAME);
gpio_pin_configure(gpio, cc1200_gpios[CC1200_GPIO_IDX_GPIO0].pin,
flags_int_in);
cc1200_gpios[CC1200_GPIO_IDX_GPIO0].dev = gpio;
return cc1200_gpios;
}
#endif /* CONFIG_IEEE802154_CC1200 */

View file

@ -33,6 +33,13 @@
#endif /* CONFIG_IEEE802154_CC2520 */
#if defined(CONFIG_IEEE802154_CC1200)
/* GPIO numbers where the TI cc1200 chip is connected to */
#define CC1200_GPIO_GPIO0 18 /* GPIO18 (in) */
#endif /* CONFIG_IEEE802154_CC1200 */
#if defined(CONFIG_USB)
/* GPIO driver name */
#define USB_GPIO_DRV_NAME CONFIG_GPIO_QMSI_0_NAME