资源简介
STM32L0XX 低功耗程序源码,低功耗时,芯片功耗达到uA级别。
![](http://www.nz998.com/pic/70363.jpg)
代码片段和文件信息
/* 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个文件信息
相关资源
- stm32f407上的两个can发送和接收例程
- STM32 led 时钟
- STM32 2.4G通信例程
- 直流无刷电机方波驱动 stm32 例程代码
- STM32中文资料
- STM32蓝牙和串口程序
- STM32f103超声波模块例程
- stm32f103c8t6 4 oled.rar
- stm32f030 IAP Demo(原创)
- PowerBuilder*图书馆管理系统*需求分析
- 十以内加减法练习 powerbuilder源码
- pb 实现仿BS界面 dw菜单 powerbuild
- STM32基于rt_thread操作系统的SDHC卡文件
- NRF24L01实现51与STM32双向通讯
- STM32F103 串口程序(完整版)
- stm32 ds18b20 温度传感器 测试通过
- stm32官方例程
- STM32F103定时器中断程序
- [免费]基于stm32f103ze 的OLED驱动代码
- STM32F103RBT6驱动UC1698控制芯片的160160黑
- STM32F103 DS18B20 V3.5.0固件库驱动程序工
- STM32定时器使用入门。看了这个程序会
- SIM908 SDIO FSMC STM32 FIFO
- blowfish的vc2008工程.rar
- powerbuilder获取本地IP地址或主机名
- STM32F103 CC2500完整驱动(模拟SPI)
- AD7606采集程序
- pb (powerbuilder) 编写的自动转台控制
- stm32 用SPI 方式读写 SDHC
- stm32通过DMA方式采集ADC数据
评论
共有 条评论