diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-12-15 13:33:15 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-12-15 13:33:15 +0000 |
commit | 27c16edcc1befe9afeb4a1996c3b22bc9acd8380 (patch) | |
tree | 2c95c90c6c7c7a4e31f44d11a9d18df3c1bd9538 /nuttx/arch/arm/src/stm32/stm32_dac.c | |
parent | b7c5ab3982dc862b8e72d45a3121e43b2ba325e6 (diff) | |
download | px4-nuttx-27c16edcc1befe9afeb4a1996c3b22bc9acd8380.tar.gz px4-nuttx-27c16edcc1befe9afeb4a1996c3b22bc9acd8380.tar.bz2 px4-nuttx-27c16edcc1befe9afeb4a1996c3b22bc9acd8380.zip |
Update to STM32 DAC and ADC drivers
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4185 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/arm/src/stm32/stm32_dac.c')
-rw-r--r-- | nuttx/arch/arm/src/stm32/stm32_dac.c | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/nuttx/arch/arm/src/stm32/stm32_dac.c b/nuttx/arch/arm/src/stm32/stm32_dac.c index 79a8178da..a7d46707c 100644 --- a/nuttx/arch/arm/src/stm32/stm32_dac.c +++ b/nuttx/arch/arm/src/stm32/stm32_dac.c @@ -58,18 +58,33 @@ #include "stm32_internal.h" #include "stm32_dac.h" -#if defined(CONFIG_DAC) && defined(CONFIG_STM32_DAC) +#ifdef CONFIG_DAC /**************************************************************************** * Private Types ****************************************************************************/ +/* Configuration ************************************************************/ +/* Up to 2 DAC interfaces are supported */ + +#if STM32_NDAC < 2 +# undef CONFIG_STM32_DAC2 +#endif + +#if STM32_NDAC < 1 +# undef CONFIG_STM32_DAC1 +#endif + +#if defined(CONFIG_STM32_DAC1) || defined(CONFIG_STM32_DAC2) + /**************************************************************************** * Private Function Prototypes ****************************************************************************/ /* Interrupt handler */ +#ifdef CONFIG_STM32_STM32F40XX static int dac_interrupt(int irq, void *context); +#endif /* DAC methods */ @@ -108,7 +123,8 @@ static struct dac_dev_s g_dacdev = * Name: dac_interrupt * * Description: - * DAC interrupt handler. + * DAC interrupt handler. The STM32 F4 family supports a only a DAC + * underrun interrupt. * * Input Parameters: * @@ -116,10 +132,12 @@ static struct dac_dev_s g_dacdev = * ****************************************************************************/ +#ifdef CONFIG_STM32_STM32F40XX static int dac_interrupt(int irq, void *context) { return OK; } +#endif /**************************************************************************** * Name: dac_reset @@ -242,20 +260,23 @@ static int dac_ioctl(FAR struct dac_dev_s *dev, int cmd, unsigned long arg) ****************************************************************************/ /**************************************************************************** - * Name: up_dacinitialize + * Name: stm32_dacinitialize * * Description: * Initialize the DAC * + * Input Parameters: + * intf - The DAC interface number. + * * Returned Value: * Valid dac device structure reference on succcess; a NULL on failure * ****************************************************************************/ -FAR struct dac_dev_s *up_dacinitialize(int channel) +FAR struct dac_dev_s *stm32_dacinitialize(int intf) { return &g_dacdev; } -#endif /* CONFIG_DAC && CONFIG_STM32_DAC */ - +#endif /* CONFIG_STM32_DAC1 || CONFIG_STM32_DAC2 */ +#endif /* CONFIG_DAC */ |