Update ChangeLog; add ADS1242 driver to build system; fix some typos; eliminate some warning

This commit is contained in:
Gregory Nutt 2016-01-29 07:55:39 -06:00
parent dc8c14aa53
commit ca792558bf
4 changed files with 26 additions and 18 deletions

View File

@ -11407,3 +11407,10 @@
errno value. Noted by Freddie Chopin.
7.15 2016-xx-xx Gregory Nutt <gnutt@nuttx.org>
* drivers/analog/adc1242.c and include/nuttx/analog/adc1242.h: Driver
for the 24-Bit Differential Input ADC ADS1242 that communicates via
SPI with a MCU. Reading the ADC conversion result as well as configuring
the ADC, setting the input channel, etc. is implemented via ioctl calls.
However, it does not yet implement the standard ADC interface. From
Alexander Entinger (2014-01-29).

View File

@ -30,6 +30,18 @@ config ADC_NO_STARTUP_CONV
---help---
Do not start conversion when opening ADC device.
config ADC_ADS1242
bool "TI ADS1242 support"
default n
select SPI
---help---
Enable driver support for the ADS1242 24-Bit SPI powered ADC.
This driver supports reading the ADC conversion result as well as
configuring the ADC, setting the input channel, etc. is implemented
via ioctl calls. However, it does not yet implement the standard ADC
interface.
config ADC_ADS125X
bool "TI ADS1255/ADS1256 support"
default n
@ -43,13 +55,6 @@ config ADS1255_FREQUENCY
endif # ADC_ADS125X
config ADC_ADS1242
bool "ADS1242"
default n
select SPI
---help---
Enable driver support for the ADS1242 24-Bit SPI powered ADC.
config ADC_PGA11X
bool "TI PGA112/3/6/7 support"
default n

View File

@ -66,6 +66,10 @@ endif
# Include ADC device drivers
ifeq ($(CONFIG_ADC_ADS1242),y)
CSRCS += ads1242.c
endif
ifeq ($(CONFIG_ADC_ADS125X),y)
CSRCS += ads1255.c
endif

View File

@ -95,7 +95,7 @@ static bool ads1242_is_data_ready(FAR struct ads1242_dev_s *dev);
#if defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_VERBOSE)
static void ads1242_print_regs(FAR struct ads1242_dev_s *dev, char const *msg);
#endif / defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_VERBOSE) */
#endif /* CONFIG_DEBUG && CONFIG_DEBUG_VERBOSE */
/* Character driver methods */
@ -335,11 +335,9 @@ static void ads1242_set_negative_input(FAR struct ads1242_dev_s *dev,
static bool ads1242_is_data_ready(FAR struct ads1242_dev_s *dev)
{
uint8_t acr_reg_value = 0xFF;
bool const is_data_ready;
ads1242_read_reg(dev, ADS1242_REG_ACR, &acr_reg_value);
is_data_ready = (acr_reg_value & ADS1242_REG_ACR_BIT_nDRDY) == 0;
return is_data_ready;
return (acr_reg_value & ADS1242_REG_ACR_BIT_nDRDY) == 0;
}
/****************************************************************************
@ -363,7 +361,7 @@ static void ads1242_print_regs(FAR struct ads1242_dev_s *dev, char const *msg)
dbg("MUX %02X\n", mux_reg_value);
dbg("ACR %02X\n", acr_reg_value);
}
#endif /* defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_VERBOSE) */
#endif /* CONFIG_DEBUG && CONFIG_DEBUG_VERBOSE */
/****************************************************************************
* Name: ads1242_open
@ -419,9 +417,6 @@ static int ads1242_close(FAR struct file *filep)
static ssize_t ads1242_read(FAR struct file *filep,
FAR char *buffer, size_t buflen)
{
FAR struct inode *inode = filep->f_inode;
FAR struct ads1242_dev_s *priv = inode->i_private;
return -ENOSYS;
}
@ -432,9 +427,6 @@ static ssize_t ads1242_read(FAR struct file *filep,
static ssize_t ads1242_write(FAR struct file *filep,
FAR const char *buffer, size_t buflen)
{
FAR struct inode *inode = filep->f_inode;
FAR struct ads1242_dev_s *priv = inode->i_private;
return -ENOSYS;
}