资源简介
STM32L0XX 低功耗程序源码,低功耗时,芯片功耗达到uA级别。
代码片段和文件信息
/* Includes ------------------------------------------------------------------*/
#include “BSP_debug.h“
#include “string.h“
#include “stdio.h“
#include “main.h“
__IO uint8_t SYSTEM_DEBUG = 0;
#ifdef DEBUG_USE_RTT //=================================== use RTT
#pragma message(“//=========================== DEBUG use RTT“)
static char _acUpBuffer1 [BUFFER_SIZE_UP];
static char _acDownBuffer1[BUFFER_SIZE_DOWN];
void RTT_Init()
{
SEGGER_RTT_ConfigUpBuffer(1“Log“ &_acUpBuffer1[0] BUFFER_SIZE_UP SEGGER_RTT_MODE_NO_BLOCK_SKIP);
SEGGER_RTT_ConfigUpBuffer(1“Log“ &_acDownBuffer1[0]BUFFER_SIZE_DOWNSEGGER_RTT_MODE_NO_BLOCK_SKIP);
}
#else
#ifdef DEBUG_USE_SWO //=================================== use SWO
// SWO Initializing variables
#if defined(__STM32L0xx_HAL_H) || defined(__STM32F0xx_HAL_H)
#error “STM32L0 & STM32F0 SWO not supported“
#endif
#define ITM_Port8(n) (*((volatile unsigned char *)(0xE0000000+4*n)))
#define ITM_Port16(n) (*((volatile unsigned short*)(0xE0000000+4*n)))
#define ITM_Port32(n) (*((volatile unsigned long *)(0xE0000000+4*n)))
#define DEMCR (*((volatile unsigned long *)(0xE000EDFC)))
#define TRCENA 0x01000000
#if defined ( __ICCARM__ ) /*!< IAR Compiler */
#elif defined(__ARMCC_VERSION) /*!< MDK Compiler */
struct __FILE {
int handle; /* Add whatever needed */
};
#endif
FILE __stdout;
FILE __stdin;
volatile int32_t ITM_RxBuffer=ITM_RXBUFFER_EMPTY;
#else //=================================== use UART
#include “usart.h“
#endif
//=========================== PutChar
#ifdef __GNUC__
/* With GCC/RAISONANCE small printf (option LD linker->Libraries->Small printf
set to ‘Yes‘) calls __io_putchar() */
#define PUTCHAR_PROTOTYPE int __io_putchar(int ch)
#else
#define PUTCHAR_PROTOTYPE int fputc(int ch FILE *f)
#endif
PUTCHAR_PROTOTYPE
{
#ifdef DEBUG_USE_SWO
#pragma message(“//=========================== DEBUG use SWO“)
if (DEMCR & TRCENA) {
while (ITM_Port32(0) == 0);
ITM_Port8(0) = ch;
}
#else
#if defined (__BSP_UART_H)
#pragma message(“//=========================== DEBUG use UART interrupt“)
huart1.pTxBuffPtr[huart1.TxXferSize]=ch;
huart1.TxXferSize++;
if( huart1.TxXferSize >= USART_MAX_LEN ) huart1.TxXferSize=0;
__HAL_UART_ENABLE_IT(&huart1 UART_IT_TXE);
#else
#pragma message(“//======================== DEBUG use UART poll“)
while(__HAL_UART_GET_FLAG(&huart1 UART_FLAG_TC) == RESET);
// Cortex-M3
#if defined (__STM32F1xx_HAL_H) || defined (__STM32L1xx_HAL_H)
huart1.Instance->DR = (uint8_t)ch;
#endif
// Cortex-M0
#if defined (__STM32F0xx_HAL_H) || defined (__STM32L0xx_HAL_H)
huart1.Instance->TDR = (uint8_t)ch;
#endif
#endif
#endif
return ch;
}
//=========================== PopChar
#ifdef __GNUC__
#define POPCHAR_PROTOTYPE int __io_getchar(int ch)
#else
#define POPCHAR_PROTOTYPE int fgetc(FILE *f)
#endif
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 6143 2018-03-19 13:21 LP_STANDBY-EXT_1\.mxproject
文件 3296 2018-05-08 12:00 LP_STANDBY-EXT_1\BSP\BSP_debug.c
文件 2372 2018-05-08 11:49 LP_STANDBY-EXT_1\BSP\BSP_debug.h
文件 6146 2018-08-22 13:02 LP_STANDBY-EXT_1\BSP\BSP_pwr.c
文件 2432 2018-03-19 12:20 LP_STANDBY-EXT_1\BSP\BSP_pwr.h
文件 629237 2018-01-22 16:18 LP_STANDBY-EXT_1\Drivers\CMSIS\Device\ST\STM32L0xx\Include\stm32l053xx.h
文件 8341 2018-01-22 16:18 LP_STANDBY-EXT_1\Drivers\CMSIS\Device\ST\STM32L0xx\Include\stm32l0xx.h
文件 3870 2018-01-22 16:18 LP_STANDBY-EXT_1\Drivers\CMSIS\Device\ST\STM32L0xx\Include\system_stm32l0xx.h
文件 7265 2018-01-22 16:18 LP_STANDBY-EXT_1\Drivers\CMSIS\Include\arm_common_tables.h
文件 3942 2018-01-22 16:18 LP_STANDBY-EXT_1\Drivers\CMSIS\Include\arm_const_structs.h
文件 252339 2018-01-22 16:18 LP_STANDBY-EXT_1\Drivers\CMSIS\Include\arm_math.h
文件 24423 2018-01-22 16:18 LP_STANDBY-EXT_1\Drivers\CMSIS\Include\cmsis_armcc.h
文件 55083 2018-01-22 16:18 LP_STANDBY-EXT_1\Drivers\CMSIS\Include\cmsis_armcc_V6.h
文件 41435 2018-01-22 16:18 LP_STANDBY-EXT_1\Drivers\CMSIS\Include\cmsis_gcc.h
文件 37218 2018-01-22 16:18 LP_STANDBY-EXT_1\Drivers\CMSIS\Include\core_cm0.h
文件 44796 2018-01-22 16:18 LP_STANDBY-EXT_1\Drivers\CMSIS\Include\core_cm0plus.h
文件 103909 2018-01-22 16:18 LP_STANDBY-EXT_1\Drivers\CMSIS\Include\core_cm3.h
文件 114498 2018-01-22 16:18 LP_STANDBY-EXT_1\Drivers\CMSIS\Include\core_cm4.h
文件 139660 2018-01-22 16:18 LP_STANDBY-EXT_1\Drivers\CMSIS\Include\core_cm7.h
文件 3620 2018-01-22 16:18 LP_STANDBY-EXT_1\Drivers\CMSIS\Include\core_cmFunc.h
文件 3636 2018-01-22 16:18 LP_STANDBY-EXT_1\Drivers\CMSIS\Include\core_cmInstr.h
文件 3662 2018-01-22 16:18 LP_STANDBY-EXT_1\Drivers\CMSIS\Include\core_cmSimd.h
文件 45262 2018-01-22 16:18 LP_STANDBY-EXT_1\Drivers\CMSIS\Include\core_sc000.h
文件 102809 2018-01-22 16:18 LP_STANDBY-EXT_1\Drivers\CMSIS\Include\core_sc300.h
文件 181869 2018-01-22 16:18 LP_STANDBY-EXT_1\Drivers\STM32L0xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h
文件 13605 2018-05-08 10:45 LP_STANDBY-EXT_1\Drivers\STM32L0xx_HAL_Driver\Inc\stm32l0xx_hal.h
文件 17163 2018-01-22 16:18 LP_STANDBY-EXT_1\Drivers\STM32L0xx_HAL_Driver\Inc\stm32l0xx_hal_cortex.h
文件 8448 2018-01-22 16:18 LP_STANDBY-EXT_1\Drivers\STM32L0xx_HAL_Driver\Inc\stm32l0xx_hal_def.h
文件 31734 2018-01-22 16:18 LP_STANDBY-EXT_1\Drivers\STM32L0xx_HAL_Driver\Inc\stm32l0xx_hal_dma.h
文件 14158 2018-01-22 16:18 LP_STANDBY-EXT_1\Drivers\STM32L0xx_HAL_Driver\Inc\stm32l0xx_hal_flash.h
............此处省略182个文件信息
相关资源
- 基于STM32F4x9的LCD显示
- VS1053B编解码器的VDR分布式声音采集卡
- stm32的DAC播放音乐文件
- STM32+TMC5160代码电路图.rar
- AdS-Maxwell-power-Yang-Mills理论中的复杂性
- 基于STM32的深海钻机甲板控制系统
- stm32f103.SchDoc
- STM32F103 USART+DMA
- DMA+stm32 407.zip
- 4_USART串口通信(空闲中断+DMA.zip
- stm32f105-usart-DMA收发demo
- STM32F042F6P6 Uart12DMA;发送中断接收
- 基于STM32的嵌入式双目图像采集系统设
- USB Power Delivery 2.0与3.0区别
-
Hollow fibre ba
sed Liquid-liquid-liquid mic - 基于STM32F103C8单片机的晶联讯电子JL
- 基于STM32的温湿度检测系统实现
- stm32F4+w5300
- PowerBuilder安装包及教程大礼包
- TensorFlow1.4 官方手册
- 14284969_《STM32单片机应用与全案例实践
-
ST-li
nk-V2的SWD仿真使用方法.docx - 安富莱STM32开发板资料
- Investigation of the Lower Resistance Meridian
- Investigation of the Lower Resistance Meridian
- 一张精美的PowerPoint甘特图模板.rar
- power bi官网教程
- PowerDesigner16.6 破解补丁
- PowerPoint2000支持库
- PowerPCB(PADS)常见问题集合汇总(下
评论
共有 条评论