diff options
| author | onelife.real <[email protected]> | 2011-07-08 07:13:20 +0000 |
|---|---|---|
| committer | onelife.real <[email protected]> | 2011-07-08 07:13:20 +0000 |
| commit | ef6bbc34fa2c49433e6b2fe6516ae288daf8d351 (patch) | |
| tree | 89052e21a48b8f5b809a636e380622a73289dcc0 /bsp/efm32/dev_misc.c | |
| parent | 7121ca6467f76d187f59e32a84e3b9dbbeabedf4 (diff) | |
*** EFM32 branch ***
1. Add ENC28J60 Ethernet controller driver
2. Add lwIP support (Please read "Readme.txt")
3. Add simple Http server demo application
4. Modify USART device write function to avoid sleep in ISR
5. Fix a bug in USART driver when using compiler optimization
6. Modify to make use the start-up code in libraries
7. Change the default build option for squeezing the executable file size
8. Modify source code alignment
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1622 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'bsp/efm32/dev_misc.c')
| -rw-r--r-- | bsp/efm32/dev_misc.c | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/bsp/efm32/dev_misc.c b/bsp/efm32/dev_misc.c index 5345d06f14..f1031342a0 100644 --- a/bsp/efm32/dev_misc.c +++ b/bsp/efm32/dev_misc.c @@ -1,47 +1,47 @@ -/******************************************************************//**
- * @file dev_misc.c
+/***************************************************************************//**
+ * @file dev_misc.c
* @brief Miscellaneous drivers of RT-Thread RTOS for EFM32
* COPYRIGHT (C) 2011, RT-Thread Development Team
* @author onelife
- * @version 0.4 beta
- **********************************************************************
+ * @version 0.4 beta
+ *******************************************************************************
* @section License
- * The license and distribution terms for this file may be found in the file LICENSE in this
- * distribution or at http://www.rt-thread.org/license/LICENSE
- **********************************************************************
+ * The license and distribution terms for this file may be found in the file
+ * LICENSE in this distribution or at http://www.rt-thread.org/license/LICENSE
+ *******************************************************************************
* @section Change Logs
* Date Author Notes
* 2011-02-22 onelife Initial creation for EFM32
- *********************************************************************/
+ ******************************************************************************/
-/******************************************************************//**
+/***************************************************************************//**
* @addtogroup efm32
* @{
-*********************************************************************/
+ ******************************************************************************/
-/* Includes -------------------------------------------------------------------*/
+/* Includes ------------------------------------------------------------------*/
#include "board.h"
#include "drv_adc.h"
-/* Private typedef -------------------------------------------------------------*/
-/* Private define --------------------------------------------------------------*/
-/* Private macro --------------------------------------------------------------*/
+/* Private typedef -----------------------------------------------------------*/
+/* Private define ------------------------------------------------------------*/
+/* Private macro -------------------------------------------------------------*/
#ifdef RT_MISC_DEBUG
#define misc_debug(format,args...) rt_kprintf(format, ##args)
#else
#define misc_debug(format,args...)
#endif
-/* Private constants -----------------------------------------------------------*/
+/* Private constants ---------------------------------------------------------*/
static rt_device_t adc0;
static struct efm32_adc_control_t control = {ADC_MODE_SINGLE};
-/* Private variables ------------------------------------------------------------*/
-/* Private function prototypes ---------------------------------------------------*/
+/* Private variables ---------------------------------------------------------*/
+/* Private function prototypes -----------------------------------------------*/
rt_int32_t efm32_misc_getCelsius(rt_uint32_t adcSample);
-/* Private functions ------------------------------------------------------------*/
-/******************************************************************//**
+/* Private functions ---------------------------------------------------------*/
+/***************************************************************************//**
* @brief
* Get current temperature value in degree celsius
*
@@ -52,14 +52,14 @@ rt_int32_t efm32_misc_getCelsius(rt_uint32_t adcSample); * @return
* Temperature value (signed integer) in degree celsius times 100
*
- *********************************************************************/
+ ******************************************************************************/
rt_int32_t rt_hw_get_temp(void)
{
ADC_InitSingle_TypeDef singleInit = ADC_INITSINGLE_DEFAULT;
rt_uint32_t temp;
- /* Set input to temperature sensor. Acquisition time must be 256 cycles. Reference must
- be 1.25V */
+ /* Set input to temperature sensor. Acquisition time must be 256 cycles.
+ Reference must be 1.25V */
singleInit.acqTime = adcAcqTime32;
singleInit.reference = adcRef1V25;
singleInit.input = adcSingleInpTemp;
@@ -72,7 +72,7 @@ rt_int32_t rt_hw_get_temp(void) return efm32_misc_getCelsius(temp);
}
-/******************************************************************//**
+/***************************************************************************//**
* @brief
* Get current VDD value in volt
*
@@ -83,7 +83,7 @@ rt_int32_t rt_hw_get_temp(void) * @return
* VDD value (unsigned integer) in volt times 100
*
- *********************************************************************/
+ ******************************************************************************/
rt_uint32_t rt_hw_get_vdd(void)
{
ADC_InitSingle_TypeDef singleInit = ADC_INITSINGLE_DEFAULT;
@@ -102,7 +102,7 @@ rt_uint32_t rt_hw_get_vdd(void) return (vdd * 125 * 3) / 4096;
}
-/******************************************************************//**
+/***************************************************************************//**
* @brief
* Initialize all the miscellaneous drivers
*
@@ -112,7 +112,7 @@ rt_uint32_t rt_hw_get_vdd(void) *
* @return
* Error code
- *********************************************************************/
+ ******************************************************************************/
rt_err_t rt_hw_misc_init(void)
{
adc0 = rt_device_find(RT_ADC0_NAME);
@@ -129,7 +129,7 @@ MISC_INIT_ERROR: }
-/**************************************************************************//**
+/***************************************************************************//**
* @brief
* Convert ADC result to degree celsius.
*
@@ -144,7 +144,7 @@ MISC_INIT_ERROR: * @return
* The temperature value (signed integer) in degrees celsius times 100
*
- *****************************************************************************/
+ ******************************************************************************/
rt_int32_t efm32_misc_getCelsius(rt_uint32_t adcResult)
{
/* Factory calibration temperature from device information page. */
@@ -161,9 +161,9 @@ rt_int32_t efm32_misc_getCelsius(rt_uint32_t adcResult) return (cal_temp - (cal_value - (rt_int32_t)adcResult * 10000) / t_grad);
}
-/*********************************************************************
-* Export to FINSH
-*********************************************************************/
+/***************************************************************************//**
+ * Export to FINSH
+ ******************************************************************************/
#ifdef RT_USING_FINSH
#include <finsh.h>
@@ -185,6 +185,6 @@ FINSH_FUNCTION_EXPORT(list_vdd, list current VDD value.) #endif
-/******************************************************************//**
+/***************************************************************************//**
* @}
-*********************************************************************/
+ ******************************************************************************/
|
