9
0
Fork 0

PIC32MX: Copy some of the configuration updates from PIC32MZ

This commit is contained in:
Gregory Nutt 2015-03-03 13:16:58 -06:00
parent 93b35db978
commit 2057a12dc1
2 changed files with 42 additions and 13 deletions

View File

@ -466,6 +466,10 @@ config PIC32MX_MVEC
bool
default n
config PIC32MX_SPI
bool
default n
config PIC32MX_T1
bool
default y
@ -555,18 +559,22 @@ config PIC32MX_I2C5
config PIC32MX_SPI1
bool "SPI1"
default n
select PIC32MX_SPI
config PIC32MX_SPI2
bool "SPI2"
default n
select PIC32MX_SPI
config PIC32MX_SPI3
bool "SPI3"
default n
select PIC32MX_SPI
config PIC32MX_SPI4
bool "SPI4"
default n
select PIC32MX_SPI
config PIC32MX_UART1
bool "UART1"
@ -1010,6 +1018,29 @@ config PIC32MX_GPIOIRQ
---help---
Build in support for interrupts based on GPIO inputs from IOPorts
menu "SPI Driver Configuration"
depends on PIC32MX_SPI
config PIC32MX_SPI_INTERRUPTS
bool "SPI Interrupt Driven"
default n
depends on EXPERIMENTAL
config PIC32MX_SPI_ENHBUF
bool "SPI Enhanced Buffer Mode"
default n
depends on EXPERIMENTAL
config PIC32MX_SPI_REGDEBUG
bool "SPI Register level debug"
depends on DEBUG
default n
---help---
Output detailed register-level SPI device debug information.
Requires also DEBUG.
endmenu # SPI Driver Configuration
menu "PIC32MX PHY/Ethernet device driver settings"
depends on PIC32MX_ETHERNET

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/mips/src/pic32mx/pic32mx-spi.c
*
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
* Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -63,18 +63,16 @@
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Enables non-standard debug output from this file.
*
* CONFIG_SPI_DEBUG && CONFIG_DEBUG - Define to enable basic SPI debug
* CONFIG_DEBUG_VERBOSE - Define to enable verbose SPI debug
*/
/* Configuration */
#ifndef CONFIG_DEBUG
# undef CONFIG_DEBUG_SPI
# undef CONFIG_DEBUG_VERBOSE
# undef CONFIG_SPI_REGDEBUG
#ifndef CONFIG_SPI_EXCHANGE
/* See arch/mips/src/pic32mz/pic32mz-spi.c for an implementation */
# error CONFIG_SPI_EXCHANGE not supported by this driver
#endif
/* Debug */
#ifdef CONFIG_DEBUG_SPI
# define spidbg lldbg
# ifdef CONFIG_DEBUG_VERBOSE
@ -91,7 +89,7 @@
* Private Types
****************************************************************************/
/* This structure descibes the state of the SSP driver */
/* This structure describes the state of the SSP driver */
struct pic32mx_dev_s
{
@ -310,7 +308,7 @@ static struct pic32mx_dev_s g_spi4dev =
*
****************************************************************************/
#ifdef CONFIG_SPI_REGDEBUG
#ifdef CONFIG_PIC32MX_SPI_REGDEBUG
static uint32_t spi_getreg(FAR struct pic32mx_dev_s *priv, unsigned int offset)
{
/* Last address, value, and count */
@ -393,7 +391,7 @@ static uint32_t spi_getreg(FAR struct pic32mx_dev_s *priv, unsigned int offset)
*
****************************************************************************/
#ifdef CONFIG_SPI_REGDEBUG
#ifdef CONFIG_PIC32MX_SPI_REGDEBUG
static void spi_putreg(FAR struct pic32mx_dev_s *priv, unsigned int offset,
uint32_t value)
{