本OLED程序例程包含了K60_4WIRE_SPI例程,使用keil软件开发环境,程序注释完整详细,可作为学习及参考的样本
代码片段和文件信息
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2015-07-12 11:12 K60_4WIRE_SPI
文件 191 2013-05-25 16:53 K60_4WIRE_SPIDemo_OLED.eww
目录 0 2015-07-12 11:12 K60_4WIRE_SPIuild
目录 0 2015-07-12 11:12 K60_4WIRE_SPIuildiar
目录 0 2015-07-12 11:12 K60_4WIRE_SPIuildiarconfig files
文件 2030 2010-10-27 14:30 K60_4WIRE_SPIuildiarconfig files128KB_Pflash.icf
文件 2206 2010-11-11 14:41 K60_4WIRE_SPIuildiarconfig files128KB_Pflash_128KB_Dflash.icf
文件 2034 2010-10-27 14:30 K60_4WIRE_SPIuildiarconfig files128KB_Ram.icf
文件 2030 2010-10-27 14:30 K60_4WIRE_SPIuildiarconfig files256KB_Pflash.icf
文件 2214 2010-11-11 14:41 K60_4WIRE_SPIuildiarconfig files256KB_Pflash_256KB_Dflash.icf
文件 2024 2010-10-27 14:30 K60_4WIRE_SPIuildiarconfig files32KB_Ram.icf
文件 2041 2010-10-27 14:30 K60_4WIRE_SPIuildiarconfig files512KB_Pflash.icf
文件 2217 2010-11-11 14:41 K60_4WIRE_SPIuildiarconfig files64KB_Pflash_64KB_Dflash.icf
文件 2024 2010-10-27 14:30 K60_4WIRE_SPIuildiarconfig files64KB_Ram.icf
目录 0 2015-07-12 11:12 K60_4WIRE_SPIuildiarhello_world
目录 0 2015-07-12 11:12 K60_4WIRE_SPIuildiarhello_worldFLASH_512KB_PFLASH
目录 0 2015-07-12 11:12 K60_4WIRE_SPIuildiarhello_worldFLASH_512KB_PFLASHExe
文件 195912 2014-06-26 09:42 K60_4WIRE_SPIuildiarhello_worldFLASH_512KB_PFLASHExehello_world_K60.out
文件 23296 2014-06-26 09:42 K60_4WIRE_SPIuildiarhello_worldFLASH_512KB_PFLASHExehello_world_K60.srec
目录 0 2015-07-12 11:12 K60_4WIRE_SPIuildiarhello_worldFLASH_512KB_PFLASHList
文件 34505 2014-06-26 09:41 K60_4WIRE_SPIuildiarhello_worldFLASH_512KB_PFLASHListCRC.lst
文件 22901 2014-06-26 09:41 K60_4WIRE_SPIuildiarhello_worldFLASH_512KB_PFLASHListCRC.s
文件 29979 2014-06-26 09:41 K60_4WIRE_SPIuildiarhello_worldFLASH_512KB_PFLASHListHAL_SPI.lst
文件 23213 2014-06-26 09:41 K60_4WIRE_SPIuildiarhello_worldFLASH_512KB_PFLASHListHAL_SPI.s
文件 31263 2014-05-04 15:25 K60_4WIRE_SPIuildiarhello_worldFLASH_512KB_PFLASHListOled_Printf.lst
文件 22061 2014-05-04 15:25 K60_4WIRE_SPIuildiarhello_worldFLASH_512KB_PFLASHListOled_Printf.s
文件 107529 2014-05-04 15:25 K60_4WIRE_SPIuildiarhello_worldFLASH_512KB_PFLASHListOled_SSD1306.lst
文件 44249 2014-05-04 15:25 K60_4WIRE_SPIuildiarhello_worldFLASH_512KB_PFLASHListOled_SSD1306.s
文件 67363 2014-06-26 09:41 K60_4WIRE_SPIuildiarhello_worldFLASH_512KB_PFLASHListSPI_FLASH.lst
文件 43925 2014-06-26 09:41 K60_4WIRE_SPIuildiarhello_worldFLASH_512KB_PFLASHListSPI_FLASH.s
文件 20539 2014-06-26 09:41 K60_4WIRE_SPIuildiarhello_worldFLASH_512KB_PFLASHListadc16.lst
............此处省略1077个文件信息
/*
* File: alloc.c
* Purpose: generic malloc() and free() engine
*
* Notes: 99% of this code stolen/borrowed from the K&R C
* examples.
*
*/
#include “common.h“
#include “stdlib.h“
#pragma section = “HEAP“
/********************************************************************/
/*
* This struct forms the minimum block size which is allocated and
* also forms the linked list for the memory space used with alloc()
* and free(). It is padded so that on a 32-bit machine all malloc‘ed
* pointers are 16-byte aligned.
*/
typedef struct ALLOC_HDR
{
struct
{
struct ALLOC_HDR *ptr;
unsigned int size;
} s;
unsigned int align;
unsigned int pad;
} ALLOC_HDR;
static ALLOC_HDR base;
static ALLOC_HDR *freep = NULL;
/********************************************************************/
void
free (void *ap)
{
ALLOC_HDR *bp *p;
bp = (ALLOC_HDR *)ap - 1; /* point to block header */
for (p = freep; !((bp > p) && (bp < p->s.ptr)) ; p = p->s.ptr)
{
if ((p >= p->s.ptr) && ((bp > p) || (bp < p->s.ptr)))
{
break; /* freed block at start or end of arena */
}
}
if ((bp + bp->s.size) == p->s.ptr)
{
bp->s.size += p->s.ptr->s.size;
bp->s.ptr = p->s.ptr->s.ptr;
}
else
{
bp->s.ptr = p->s.ptr;
}
if ((p + p->s.size) == bp)
{
p->s.size += bp->s.size;
p->s.ptr = bp->s.ptr;
}
else
{
p->s.ptr = bp;
}
freep = p;
}
/********************************************************************/
void *
malloc (unsigned nbytes)
{
/* Get addresses for the HEAP start and end */
#if (defined(CW))
extern char __HEAP_START;
extern char __HEAP_END[];
#elif (defined(IAR))
char* __HEAP_START = __section_begin(“HEAP“);
char* __HEAP_END = __section_end(“HEAP“);
#endif
ALLOC_HDR *p *prevp;
unsigned nunits;
nunits = ((nbytes+sizeof(ALLOC_HDR)-1) / sizeof(ALLOC_HDR)) + 1;
if ((prevp = freep) == NULL)
{
p = (ALLOC_HDR *)__HEAP_START;
p->s.size = ( ((uint32)__HEAP_END - (uint32)__HEAP_START)
/ sizeof(ALLOC_HDR) );
p->s.ptr = &base;
base.s.ptr = p;
base.s.size = 0;
prevp = freep = &base;
}
for (p = prevp->s.ptr; ; prevp = p p = p->s.ptr)
{
if (p->s.size >= nunits)
{
if (p->s.size == nunits)
{
prevp->s.ptr = p->s.ptr;
}
else
{
p->s.size -= nunits;
p += p->s.size;
p->s.size = nunits;
}
freep = prevp;
return (void *)(p + 1);
}
if (p == freep)
return NULL;
}
}
/*******************************************
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2015-07-12 11:12 K60_4WIRE_SPI
文件 191 2013-05-25 16:53 K60_4WIRE_SPIDemo_OLED.eww
目录 0 2015-07-12 11:12 K60_4WIRE_SPIuild
目录 0 2015-07-12 11:12 K60_4WIRE_SPIuildiar
目录 0 2015-07-12 11:12 K60_4WIRE_SPIuildiarconfig files
文件 2030 2010-10-27 14:30 K60_4WIRE_SPIuildiarconfig files128KB_Pflash.icf
文件 2206 2010-11-11 14:41 K60_4WIRE_SPIuildiarconfig files128KB_Pflash_128KB_Dflash.icf
文件 2034 2010-10-27 14:30 K60_4WIRE_SPIuildiarconfig files128KB_Ram.icf
文件 2030 2010-10-27 14:30 K60_4WIRE_SPIuildiarconfig files256KB_Pflash.icf
文件 2214 2010-11-11 14:41 K60_4WIRE_SPIuildiarconfig files256KB_Pflash_256KB_Dflash.icf
文件 2024 2010-10-27 14:30 K60_4WIRE_SPIuildiarconfig files32KB_Ram.icf
文件 2041 2010-10-27 14:30 K60_4WIRE_SPIuildiarconfig files512KB_Pflash.icf
文件 2217 2010-11-11 14:41 K60_4WIRE_SPIuildiarconfig files64KB_Pflash_64KB_Dflash.icf
文件 2024 2010-10-27 14:30 K60_4WIRE_SPIuildiarconfig files64KB_Ram.icf
目录 0 2015-07-12 11:12 K60_4WIRE_SPIuildiarhello_world
目录 0 2015-07-12 11:12 K60_4WIRE_SPIuildiarhello_worldFLASH_512KB_PFLASH
目录 0 2015-07-12 11:12 K60_4WIRE_SPIuildiarhello_worldFLASH_512KB_PFLASHExe
文件 195912 2014-06-26 09:42 K60_4WIRE_SPIuildiarhello_worldFLASH_512KB_PFLASHExehello_world_K60.out
文件 23296 2014-06-26 09:42 K60_4WIRE_SPIuildiarhello_worldFLASH_512KB_PFLASHExehello_world_K60.srec
目录 0 2015-07-12 11:12 K60_4WIRE_SPIuildiarhello_worldFLASH_512KB_PFLASHList
文件 34505 2014-06-26 09:41 K60_4WIRE_SPIuildiarhello_worldFLASH_512KB_PFLASHListCRC.lst
文件 22901 2014-06-26 09:41 K60_4WIRE_SPIuildiarhello_worldFLASH_512KB_PFLASHListCRC.s
文件 29979 2014-06-26 09:41 K60_4WIRE_SPIuildiarhello_worldFLASH_512KB_PFLASHListHAL_SPI.lst
文件 23213 2014-06-26 09:41 K60_4WIRE_SPIuildiarhello_worldFLASH_512KB_PFLASHListHAL_SPI.s
文件 31263 2014-05-04 15:25 K60_4WIRE_SPIuildiarhello_worldFLASH_512KB_PFLASHListOled_Printf.lst
文件 22061 2014-05-04 15:25 K60_4WIRE_SPIuildiarhello_worldFLASH_512KB_PFLASHListOled_Printf.s
文件 107529 2014-05-04 15:25 K60_4WIRE_SPIuildiarhello_worldFLASH_512KB_PFLASHListOled_SSD1306.lst
文件 44249 2014-05-04 15:25 K60_4WIRE_SPIuildiarhello_worldFLASH_512KB_PFLASHListOled_SSD1306.s
文件 67363 2014-06-26 09:41 K60_4WIRE_SPIuildiarhello_worldFLASH_512KB_PFLASHListSPI_FLASH.lst
文件 43925 2014-06-26 09:41 K60_4WIRE_SPIuildiarhello_worldFLASH_512KB_PFLASHListSPI_FLASH.s
文件 20539 2014-06-26 09:41 K60_4WIRE_SPIuildiarhello_worldFLASH_512KB_PFLASHListadc16.lst
............此处省略1077个文件信息
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。
评论列表(条)