-
大小: 242KB文件类型: .rar金币: 1下载: 0 次发布日期: 2021-06-15
- 语言: 其他
- 标签: STM8L151C8T6
资源简介
STM8L151C8T6的6中低功耗模式测试程序,IAR工程,通过修改宏定义,可对各种模式下的功耗进行测试。
代码片段和文件信息
/*
************************************************************************************************
* Filename : main.c
* Programmer : JiangJun
* Description : Test low power of STM8L151C8T6 based on RimeLoRaNode
* Date : 2015-07-28
* Copyright : (c) Rimelink (www.rimelink.com)
************************************************************************************************
*/
/*
*********************************************************************************************************
* INCLUDE FILES
*********************************************************************************************************
*/
#include
#include “stm8l15x_clk.h“
#include “stm8l15x_gpio.h“
#include “stm8l15x_pwr.h“
#include “stm8l15x_flash.h“
/*
*********************************************************************************************************
* COMPILE SWITCH
*********************************************************************************************************
*/
#define iWL880A 1 /* 20 pins */
#define iWL881A 2 /* 8 pins */
#define CUR_PRODUCT iWL881A
/* For test power of MCU */
#define IS_ENABLE_LSI 0 /* 0=Disable 1=Enable */
#define MODE_WAIT 0
#define MODE_LOW_POWER_RUN 1
#define MODE_LOW_POWER_WAIT 2
#define MODE_ACTIVE_HALT 3
#define MODE_HALT 4
#define MODE_RUN 5
#define MCU_MODE MODE_HALT
/*
*********************************************************************************************************
* MACRO DEFINITION
*********************************************************************************************************
*/
#if (iWL880A == CUR_PRODUCT)
#define LED_IOPORT GPIOD
#define LED_PIN GPIO_Pin_7
#define LED2_IOPORT GPIOC
#define LED2_PIN GPIO_Pin_7
#else
#define LED_IOPORT GPIOD
#define LED_PIN GPIO_Pin_0
#define LED2_IOPORT GPIOA
#define LED2_PIN GPIO_Pin_3
#endif
/* Start address of device ID in FLASH */
#define DEV_ID_START_ADDR 0x4926
#define ASM_NOP() nop()
/* Interrupt Macros */
#define HAL_ENABLE_INTERRUPTS() __enable_interrupt()
#define HAL_DISABLE_INTERRUPTS() __disable_interrupt()
/*
*********************************************************************************************************
* DEFINITIONS / TYPEDEFS
*********************************************************************************************************
*/
/**
* @brief Configure of MCU GPIO.
*/
typedef struct
{
uint8_t byNum; /* 1~48 */
GPIO_TypeDef *p_byPort; /* A~F */
uint8_t byPin; /* 0~7 */
bool bNeedSWMode; /* TRUE=Switch mode when enter low power FALSE=otherwise */
GPIO_Mo
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3342 2013-06-27 14:01 TestSTM8LPwr\Driver\Include\stm8l15x_conf.h
文件 4049 2013-06-27 14:42 TestSTM8LPwr\Driver\Include\stm8l15x_it.h
..A.SHR 345 2016-04-25 09:57 TestSTM8LPwr\Driver\Include\vssver2.scc
文件 9775 2016-12-05 16:05 TestSTM8LPwr\Driver\Source\stm8l15x_it.c
..A.SHR 336 2016-09-24 15:08 TestSTM8LPwr\Driver\Source\vssver2.scc
文件 123088 2015-04-03 12:01 TestSTM8LPwr\Driver\STM8L15x_StdPeriph_Driver\inc\stm8l15x.h
文件 16750 2010-09-24 09:15 TestSTM8LPwr\Driver\STM8L15x_StdPeriph_Driver\inc\stm8l15x_adc.h
文件 5141 2010-09-24 09:15 TestSTM8LPwr\Driver\STM8L15x_StdPeriph_Driver\inc\stm8l15x_aes.h
文件 3608 2010-09-24 09:15 TestSTM8LPwr\Driver\STM8L15x_StdPeriph_Driver\inc\stm8l15x_beep.h
文件 18574 2010-09-24 09:15 TestSTM8LPwr\Driver\STM8L15x_StdPeriph_Driver\inc\stm8l15x_clk.h
文件 9885 2010-09-24 09:15 TestSTM8LPwr\Driver\STM8L15x_StdPeriph_Driver\inc\stm8l15x_comp.h
文件 10672 2010-09-24 09:15 TestSTM8LPwr\Driver\STM8L15x_StdPeriph_Driver\inc\stm8l15x_dac.h
文件 13622 2010-09-24 09:15 TestSTM8LPwr\Driver\STM8L15x_StdPeriph_Driver\inc\stm8l15x_dma.h
文件 9471 2010-09-24 09:15 TestSTM8LPwr\Driver\STM8L15x_StdPeriph_Driver\inc\stm8l15x_exti.h
文件 13028 2010-12-17 16:08 TestSTM8LPwr\Driver\STM8L15x_StdPeriph_Driver\inc\stm8l15x_flash.h
文件 6453 2010-09-24 09:15 TestSTM8LPwr\Driver\STM8L15x_StdPeriph_Driver\inc\stm8l15x_gpio.h
文件 34960 2010-09-24 09:15 TestSTM8LPwr\Driver\STM8L15x_StdPeriph_Driver\inc\stm8l15x_i2c.h
文件 2195 2010-09-24 09:15 TestSTM8LPwr\Driver\STM8L15x_StdPeriph_Driver\inc\stm8l15x_irtim.h
文件 11129 2010-09-24 09:15 TestSTM8LPwr\Driver\STM8L15x_StdPeriph_Driver\inc\stm8l15x_itc.h
文件 4737 2010-09-24 09:15 TestSTM8LPwr\Driver\STM8L15x_StdPeriph_Driver\inc\stm8l15x_iwdg.h
文件 21917 2010-09-24 09:15 TestSTM8LPwr\Driver\STM8L15x_StdPeriph_Driver\inc\stm8l15x_lcd.h
文件 4331 2010-09-24 09:15 TestSTM8LPwr\Driver\STM8L15x_StdPeriph_Driver\inc\stm8l15x_pwr.h
文件 3198 2010-09-24 09:15 TestSTM8LPwr\Driver\STM8L15x_StdPeriph_Driver\inc\stm8l15x_rst.h
文件 34974 2010-09-24 09:15 TestSTM8LPwr\Driver\STM8L15x_StdPeriph_Driver\inc\stm8l15x_rtc.h
文件 13908 2010-09-24 09:15 TestSTM8LPwr\Driver\STM8L15x_StdPeriph_Driver\inc\stm8l15x_spi.h
文件 19304 2010-09-24 09:15 TestSTM8LPwr\Driver\STM8L15x_StdPeriph_Driver\inc\stm8l15x_syscfg.h
文件 34971 2010-09-24 09:15 TestSTM8LPwr\Driver\STM8L15x_StdPeriph_Driver\inc\stm8l15x_tim1.h
文件 27956 2010-09-24 09:15 TestSTM8LPwr\Driver\STM8L15x_StdPeriph_Driver\inc\stm8l15x_tim2.h
文件 27900 2010-09-24 09:15 TestSTM8LPwr\Driver\STM8L15x_StdPeriph_Driver\inc\stm8l15x_tim3.h
文件 11145 2010-09-24 09:15 TestSTM8LPwr\Driver\STM8L15x_StdPeriph_Driver\inc\stm8l15x_tim4.h
............此处省略70个文件信息
评论
共有 条评论