Skip to content

Commit

Permalink
[bsp][nxp][rsoc] Fix compilation issues with bsp of nxp/lxp series
Browse files Browse the repository at this point in the history
  • Loading branch information
hydevcode committed Sep 27, 2024
1 parent 68c856d commit 00d52b2
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 33 deletions.
30 changes: 15 additions & 15 deletions components/drivers/include/drivers/adc.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2023, RT-Thread Development Team
* Copyright (c) 2006-2024 RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
Expand All @@ -22,39 +22,39 @@
*
* <b>Example</b>
* @code {.c}
* #define ADC_DEV_NAME "adc1"
* #define ADC_DEV_CHANNEL 5
* #define REFER_VOLTAGE 330
* #define CONVERT_BITS (1 << 12)
*
* #define ADC_DEV_NAME "adc1"
* #define ADC_DEV_CHANNEL 5
* #define REFER_VOLTAGE 330
* #define CONVERT_BITS (1 << 12)
*
* static int adc_vol_sample(int argc, char *argv[])
* {
* rt_adc_device_t adc_dev;
* rt_uint32_t value, vol;
*
*
* rt_err_t ret = RT_EOK;
*
*
* adc_dev = (rt_adc_device_t)rt_device_find(ADC_DEV_NAME);
* if (adc_dev == RT_NULL)
* {
* rt_kprintf("adc sample run failed! can't find %s device!\n", ADC_DEV_NAME);
* return RT_ERROR;
* return -RT_ERROR;
* }
*
*
* ret = rt_adc_enable(adc_dev, ADC_DEV_CHANNEL);
*
*
* value = rt_adc_read(adc_dev, ADC_DEV_CHANNEL);
* rt_kprintf("the value is :%d \n", value);
*
*
* vol = value * REFER_VOLTAGE / CONVERT_BITS;
* rt_kprintf("the voltage is :%d.%02d \n", vol / 100, vol % 100);
*
*
* ret = rt_adc_disable(adc_dev, ADC_DEV_CHANNEL);
*
*
* return ret;
* }
* MSH_CMD_EXPORT(adc_vol_sample, adc voltage convert sample);
*
*
* @endcode
*
* @ingroup Drivers
Expand Down
36 changes: 18 additions & 18 deletions components/drivers/include/drivers/dac.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2023, RT-Thread Development Team
* Copyright (c) 2006-2024 RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
Expand All @@ -19,47 +19,47 @@
*
* <b>Example</b>
* @code {.c}
*
*
* #include <rtthread.h>
* #include <rtdevice.h>
* #include <stdlib.h>
* #define DAC_DEV_NAME "dac1"
* #define DAC_DEV_CHANNEL 1
* #define REFER_VOLTAGE 330
* #define CONVERT_BITS (1 << 12)
*
* #define DAC_DEV_NAME "dac1"
* #define DAC_DEV_CHANNEL 1
* #define REFER_VOLTAGE 330
* #define CONVERT_BITS (1 << 12)
*
* static int dac_vol_sample(int argc, char *argv[])
* {
* rt_dac_device_t dac_dev;
* rt_uint32_t value, vol;
* rt_err_t ret = RT_EOK;
*
*
* dac_dev = (rt_dac_device_t)rt_device_find(DAC_DEV_NAME);
* if (dac_dev == RT_NULL)
* {
* rt_kprintf("dac sample run failed! can't find %s device!\n", DAC_DEV_NAME);
* return RT_ERROR;
* return -RT_ERROR;
* }
*
*
* ret = rt_dac_enable(dac_dev, DAC_DEV_CHANNEL);
*
*
* value = atoi(argv[1]);
* rt_dac_write(dac_dev, DAC_DEV_NAME, DAC_DEV_CHANNEL, value);
* rt_kprintf("the value is :%d \n", value);
*
*
* vol = value * REFER_VOLTAGE / CONVERT_BITS;
* rt_kprintf("the voltage is :%d.%02d \n", vol / 100, vol % 100);
*
*
* rt_thread_mdelay(500);
*
*
* ret = rt_dac_disable(dac_dev, DAC_DEV_CHANNEL);
*
*
* return ret;
* }
* MSH_CMD_EXPORT(dac_vol_sample, dac voltage convert sample);
*
*
* @endcode
*
*
* @ingroup Drivers
*/

Expand All @@ -80,7 +80,7 @@ struct rt_dac_ops
};
/**
* @brief DAC device structure
*
*
*/
struct rt_dac_device
{
Expand Down

0 comments on commit 00d52b2

Please sign in to comment.