In progress changes for OLED display work
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2669 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
89d45ed6ab
commit
24074567f9
@ -327,6 +327,13 @@ defconfig -- This is a configuration file similar to the Linux
|
||||
CONFIG_FAT_SECTORSIZE - Max supported sector size
|
||||
CONFIG_FS_ROMFS - Enable ROMFS filesystem support
|
||||
|
||||
SPI driver
|
||||
CONFIG_SPI_OWNBUS - Set if there is only one active device
|
||||
on the SPI bus. No locking or SPI configuration will be performed.
|
||||
It is not necessary for clients to lock, re-configure, etc..
|
||||
CONFIG_SPI_EXCHANGE - Driver supports a single exchange method
|
||||
(vs a recvblock() and sndblock ()methods)
|
||||
|
||||
SPI-based MMC/SD driver
|
||||
CONFIG_MMCSD_NSLOTS - Number of MMC/SD slots supported by the
|
||||
driver. Default is one.
|
||||
@ -343,6 +350,29 @@ defconfig -- This is a configuration file similar to the Linux
|
||||
CONFIG_MMCSD_HAVECARDDETECT - SDIO driver card detection is
|
||||
100% accurate
|
||||
|
||||
RiT P14201 OLED driver
|
||||
CONFIG_LCD_P14201 - Enable P14201 support
|
||||
CONFIG_P14201_SPIMODE - Controls the SPI mode
|
||||
CONFIG_P14201_FREQUENCY - Define to use a different bus frequency
|
||||
CONFIG_P14201_NINTERFACES - Specifies the number of physical P14201
|
||||
devices that will be supported.
|
||||
CONFIG_P14201_FRAMEBUFFER - If defined, accesses will be performed
|
||||
using an in-memory copy of the OLEDs GDDRAM. This cost of this
|
||||
buffer is 128 * 96 / 2 = 6Kb. If this is defined, then the driver
|
||||
will be fully functioned. If not, then it will have the following
|
||||
limitations:
|
||||
- Reading graphics memory cannot be supported, and
|
||||
- All pixel writes must be aligned to byte boundaries.
|
||||
|
||||
ENC28J60 Ethernet Driver Configuration Settings:
|
||||
CONFIG_NET_ENC28J60 - Enabled ENC28J60 support
|
||||
CONFIG_ENC28J60_SPIMODE - Controls the SPI mode
|
||||
CONFIG_ENC28J60_FREQUENCY - Define to use a different bus frequency
|
||||
CONFIG_ENC28J60_NINTERFACES - Specifies the number of physical ENC28J60
|
||||
devices that will be supported.
|
||||
CONFIG_ENC28J60_STATS - Collect network statistics
|
||||
CONFIG_ENC28J60_HALFDUPPLEX - Default is full duplex
|
||||
|
||||
TCP/IP and UDP support via uIP
|
||||
CONFIG_NET - Enable or disable all network features
|
||||
CONFIG_NET_IPv6 - Build in support for IPv6
|
||||
|
@ -2,7 +2,7 @@
|
||||
* config/mcu123-lpc214x/src/up_spi.c
|
||||
* arch/arm/src/board/up_spi.c
|
||||
*
|
||||
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2008-2010 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -123,6 +123,9 @@
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_SPI_OWNBUS
|
||||
static int spi_lock(FAR struct spi_dev_s *dev, bool lock);
|
||||
#endif
|
||||
static void spi_select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected);
|
||||
static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency);
|
||||
static uint8_t spi_status(FAR struct spi_dev_s *dev, enum spi_dev_e devid);
|
||||
@ -136,7 +139,9 @@ static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t
|
||||
|
||||
static const struct spi_ops_s g_spiops =
|
||||
{
|
||||
.lock = 0, /* Not yet implemented */
|
||||
#ifndef CONFIG_SPI_OWNBUS
|
||||
.lock = spi_lock,
|
||||
#endif
|
||||
.select = spi_select,
|
||||
.setfrequency = spi_setfrequency,
|
||||
.status = spi_status,
|
||||
@ -156,6 +161,36 @@ static struct spi_dev_s g_spidev = { &g_spiops };
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: spi_lock
|
||||
*
|
||||
* Description:
|
||||
* On SPI busses where there are multiple devices, it will be necessary to
|
||||
* lock SPI to have exclusive access to the busses for a sequence of
|
||||
* transfers. The bus should be locked before the chip is selected. After
|
||||
* locking the SPI bus, the caller should then also call the setfrequency,
|
||||
* setbits, and setmode methods to make sure that the SPI is properly
|
||||
* configured for the device. If the SPI buss is being shared, then it
|
||||
* may have been left in an incompatible state.
|
||||
*
|
||||
* Input Parameters:
|
||||
* dev - Device-specific state data
|
||||
* lock - true: Lock spi bus, false: unlock SPI bus
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_SPI_OWNBUS
|
||||
static int spi_lock(FAR struct spi_dev_s *dev, bool lock)
|
||||
{
|
||||
/* Not implemented */
|
||||
|
||||
return -ENOSYS;
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: spi_select
|
||||
*
|
||||
|
@ -432,9 +432,6 @@ CONFIG_FS_ROMFS=n
|
||||
# ENC28J60 configuration
|
||||
#
|
||||
# CONFIG_NET_ENC28J60 - Enabled ENC28J60 support
|
||||
# CONFIG_ENC28J60_OWNBUS - Set if the ENC28J60 is the only active device on
|
||||
# the SPI bus. No locking or SPI configuration will be performed. All
|
||||
# transfers will be performed from the ENC2J60 interrupt handler.
|
||||
# CONFIG_ENC28J60_SPIMODE - Controls the SPI mode
|
||||
# CONFIG_ENC28J60_FREQUENCY - Define to use a different bus frequency
|
||||
# CONFIG_ENC28J60_NINTERFACES - Specifies the number of physical ENC28J60
|
||||
@ -442,7 +439,6 @@ CONFIG_FS_ROMFS=n
|
||||
# CONFIG_ENC28J60_STATS - Collect network statistics
|
||||
# CONFOG_ENC28J60_HALFDUPPLEX - Default is full duplex
|
||||
CONFIG_NET_ENC28J60=y
|
||||
CONFIG_ENC28J60_OWNBUS=n
|
||||
#CONFIG_ENC28J60_SPIMODE
|
||||
CONFIG_ENC28J60_FREQUENCY=20000000
|
||||
CONFIG_ENC28J60_NINTERFACES=1
|
||||
|
@ -390,6 +390,9 @@ static inline void spi_drain(FAR struct str71x_spidev_s *priv);
|
||||
|
||||
/* SPI methods */
|
||||
|
||||
#ifndef CONFIG_SPI_OWNBUS
|
||||
static int spi_lock(FAR struct spi_dev_s *dev, bool lock);
|
||||
#endif
|
||||
static void spi_select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected);
|
||||
static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency);
|
||||
static uint8_t spi_status(FAR struct spi_dev_s *dev, enum spi_dev_e devid);
|
||||
@ -403,7 +406,9 @@ static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t
|
||||
|
||||
static const struct spi_ops_s g_spiops =
|
||||
{
|
||||
.lock = 0, /* Not yet implemented */
|
||||
#ifndef CONFIG_SPI_OWNBUS
|
||||
.lock = spi_lock,
|
||||
#endif
|
||||
.select = spi_select,
|
||||
.setfrequency = spi_setfrequency,
|
||||
.status = spi_status,
|
||||
@ -526,6 +531,36 @@ static inline void spi_drain(FAR struct str71x_spidev_s *priv)
|
||||
while ((spi_getreg(priv, STR71X_BSPI_CSR2_OFFSET) & STR71X_BSPICSR2_RFNE) != 0);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: spi_lock
|
||||
*
|
||||
* Description:
|
||||
* On SPI busses where there are multiple devices, it will be necessary to
|
||||
* lock SPI to have exclusive access to the busses for a sequence of
|
||||
* transfers. The bus should be locked before the chip is selected. After
|
||||
* locking the SPI bus, the caller should then also call the setfrequency,
|
||||
* setbits, and setmode methods to make sure that the SPI is properly
|
||||
* configured for the device. If the SPI buss is being shared, then it
|
||||
* may have been left in an incompatible state.
|
||||
*
|
||||
* Input Parameters:
|
||||
* dev - Device-specific state data
|
||||
* lock - true: Lock spi bus, false: unlock SPI bus
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_SPI_OWNBUS
|
||||
static int spi_lock(FAR struct spi_dev_s *dev, bool lock)
|
||||
{
|
||||
/* Not implemented */
|
||||
|
||||
return -ENOSYS;
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: spi_select
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user