• 大小: 57KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-17
  • 语言: 其他
  • 标签: si1153  EFM8BB3  代码  

资源简介

基于EFM8BB3的si1153应用,含有整个项目的代码。详情请看资料。

资源截图

代码片段和文件信息

/**************************************************************************//**
 * Copyright (c) 2015 by Silicon Laboratories Inc. All rights reserved.
 *
 * http://developer.silabs.com/legal/version/v11/Silicon_Labs_Software_License_Agreement.txt
 *****************************************************************************/
/////////////////////////////////////////////////////////////////////////////
// Tick.c
/////////////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////////////
// Includes
/////////////////////////////////////////////////////////////////////////////

#include “bsp.h“
#include “tick.h“

/////////////////////////////////////////////////////////////////////////////
// Globals
/////////////////////////////////////////////////////////////////////////////

static uint16_t Ticks = 0;

/////////////////////////////////////////////////////////////////////////////
// Functions
/////////////////////////////////////////////////////////////////////////////

//---------------------------------------------------------------------------
// GetTickCount
//---------------------------------------------------------------------------
//
// Description - Return the system up time in milliseconds
//
// return - Number of milliseconds since system start.
//
uint16_t GetTickCount()
{
    uint16_t ticks;
    uint8_t save_page = SFRPAGE;

    // Disable Timer 4 interrupts
    SFRPAGE = 0x10;
    EIE2 &= ~EIE2_ET4__BMASK;

    ticks = Ticks;

    // Enable Timer 4 interrupts
    EIE2 |= EIE2_ET4__BMASK;
    SFRPAGE = save_page;

    return ticks;
}

//---------------------------------------------------------------------------
// Wait
//---------------------------------------------------------------------------
//
// Description - Wait the specified number of milliseconds
//
// ms - The number of milliseconds to wait
//
void Wait(uint16_t ms)
{
    uint16_t ticks = GetTickCount();

    while ((GetTickCount() - ticks) < ms);
}

//-----------------------------------------------------------------------------
// TIMER4_ISR
//-----------------------------------------------------------------------------
//
// TIMER4 ISR Content goes here. Remember to clear flag bits:
// TMR4CN::TF3H (Timer # High Byte Overflow Flag)
// TMR4CN::TF3L (Timer # Low Byte Overflow Flag)
//
// SFRPAGE automatically pushed/popped and set to 0x10
//
//-----------------------------------------------------------------------------
SI_INTERRUPT (TIMER4_ISR TIMER4_IRQn)
{
    // Overflows every 1 ms
    TMR4CN0 &= ~TMR4CN0_TF4H__BMASK;

    Ticks++;
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2016-04-29 02:42  OpticalSensorSi1153\
     文件       10455  2016-02-12 01:59  OpticalSensorSi1153\EFM8BB3_OpticalSensorSi1153.hwconf
     文件        3077  2016-04-29 02:41  OpticalSensorSi1153\EFM8BB3_OpticalSensorSi1153.slsproj
     目录           0  2016-02-17 04:52  OpticalSensorSi1153\inc\
     目录           0  2016-02-17 04:51  OpticalSensorSi1153\inc\config\
     文件         882  2016-01-20 04:34  OpticalSensorSi1153\inc\config\efm8_config.h
     文件        1072  2016-01-19 04:36  OpticalSensorSi1153\inc\config\memory_lcd_config.h
     文件         688  2016-02-12 07:21  OpticalSensorSi1153\inc\demo.h
     目录           0  2016-02-17 04:52  OpticalSensorSi1153\inc\graphics\
     文件        4206  2016-02-11 12:28  OpticalSensorSi1153\inc\graphics\lightbulb.h
     文件        4188  2016-02-11 12:48  OpticalSensorSi1153\inc\graphics\sun.h
     文件        1713  2016-02-12 01:59  OpticalSensorSi1153\inc\InitDevice.h
     文件        1070  2016-02-12 07:50  OpticalSensorSi1153\inc\lux.h
     文件        2693  2016-02-12 07:23  OpticalSensorSi1153\inc\main.h
     文件        8158  2016-02-12 07:43  OpticalSensorSi1153\inc\si115x_functions.h
     目录           0  2016-02-17 04:52  OpticalSensorSi1153\lib\
     目录           0  2016-02-17 04:52  OpticalSensorSi1153\lib\efm8bb3\
     目录           0  2016-02-17 04:51  OpticalSensorSi1153\lib\efm8bb3\bsp\
     目录           0  2016-02-17 04:51  OpticalSensorSi1153\lib\efm8bb3\bsp\efm8_memory_lcd\
     目录           0  2016-02-17 04:51  OpticalSensorSi1153\lib\efm8bb3\bsp\efm8_memory_lcd\src\
     目录           0  2016-02-17 04:55  OpticalSensorSi1153\lib\efm8bb3\bsp\efm8_memory_lcd\src\source\
     文件        2725  2016-01-20 05:06  OpticalSensorSi1153\lib\efm8bb3\bsp\efm8_memory_lcd\src\source\tick_timer4.c
     文件        1081  2016-04-29 02:57  OpticalSensorSi1153\Readme.txt
     目录           0  2016-02-17 04:58  OpticalSensorSi1153\Release\
     文件       40207  2016-02-17 04:57  OpticalSensorSi1153\Release\EFM8BB3_OpticalSensorSi1153.hex
     目录           0  2016-02-17 04:53  OpticalSensorSi1153\scripts\
     文件        3463  2016-02-11 12:27  OpticalSensorSi1153\scripts\lightbulb.png
     文件        2891  2016-01-19 04:36  OpticalSensorSi1153\scripts\png_black_background.py
     文件        2276  2016-02-11 12:48  OpticalSensorSi1153\scripts\sun.png
     文件        2807  2016-01-19 04:36  OpticalSensorSi1153\scripts\xbm_black_background.py
     目录           0  2016-02-17 04:53  OpticalSensorSi1153\src\
............此处省略9个文件信息

评论

共有 条评论