arch/arm/src/max326xx/max32660: Fix some confusion. SPI0 and SPI1 are not the same type of peripheral. SPI0 is SPI17Y; SPI1 is SPIMMS. Add basic SPI0 interrupt handling logic.

This commit is contained in:
Gregory Nutt
2018-11-29 18:32:40 -06:00
parent 9203815e4c
commit 6d285cfed1
3 changed files with 177 additions and 216 deletions
+5
View File
@@ -165,8 +165,13 @@ endif
ifeq ($(CONFIG_MAX326XX_HAVE_SPIM),y) ifeq ($(CONFIG_MAX326XX_HAVE_SPIM),y)
ifeq ($(CONFIG_ARCH_FAMILY_MAX32660),y) ifeq ($(CONFIG_ARCH_FAMILY_MAX32660),y)
ifeq ($(CONFIG_MAX326XX_SPIM0),y)
CHIP_CSRCS += max32660_spim.c CHIP_CSRCS += max32660_spim.c
endif endif
ifeq ($(CONFIG_MAX326XX_SPIM1),y)
CHIP_CSRCS += max32660_spimssm.c
endif
endif
endif endif
# Paths to source files # Paths to source files
@@ -156,7 +156,7 @@ static int max326_setup(struct uart_dev_s *dev);
static void max326_shutdown(struct uart_dev_s *dev); static void max326_shutdown(struct uart_dev_s *dev);
static int max326_attach(struct uart_dev_s *dev); static int max326_attach(struct uart_dev_s *dev);
static void max326_detach(struct uart_dev_s *dev); static void max326_detach(struct uart_dev_s *dev);
static int max326_interrupt(int irq, void *context, FAR void *arg); static int max326_interrupt(int irq, void *context, void *arg);
static int max326_ioctl(struct file *filep, int cmd, unsigned long arg); static int max326_ioctl(struct file *filep, int cmd, unsigned long arg);
static int max326_receive(struct uart_dev_s *dev, uint32_t *status); static int max326_receive(struct uart_dev_s *dev, uint32_t *status);
static void max326_rxint(struct uart_dev_s *dev, bool enable); static void max326_rxint(struct uart_dev_s *dev, bool enable);
@@ -496,13 +496,11 @@ static void max326_detach(struct uart_dev_s *dev)
* Description: * Description:
* This is the UART status interrupt handler. It will be invoked when an * This is the UART status interrupt handler. It will be invoked when an
* interrupt received on the 'irq' It should call uart_transmitchars or * interrupt received on the 'irq' It should call uart_transmitchars or
* uart_receivechar to perform the appropriate data transfers. The * uart_receivechar to perform the appropriate data transfers.
* interrupt handling logic must be able to map the 'irq' number into the
* approprite uart_dev_s structure in order to call these functions.
* *
****************************************************************************/ ****************************************************************************/
static int max326_interrupt(int irq, void *context, FAR void *arg) static int max326_interrupt(int irq, void *context, void *arg)
{ {
struct uart_dev_s *dev = (struct uart_dev_s *)arg; struct uart_dev_s *dev = (struct uart_dev_s *)arg;
struct max326_dev_s *priv; struct max326_dev_s *priv;
@@ -541,7 +539,6 @@ static int max326_interrupt(int irq, void *context, FAR void *arg)
* Check if the Rx FIFO level interrupt is enabled and the Rx FIFO is * Check if the Rx FIFO level interrupt is enabled and the Rx FIFO is
* not empty. * not empty.
*/ */
#if 0 #if 0
if ((intfl & UART_INT_RX) != 0) /* Should work too */ if ((intfl & UART_INT_RX) != 0) /* Should work too */
#else #else
File diff suppressed because it is too large Load Diff