• 大小: 3.44MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-09-14
  • 语言: 其他
  • 标签: 热敏打印  ARM  

资源简介

微型热敏打印头的驱动例程,实现了打印头加热控制,电机PWM控制,缺纸检测等功能。

资源截图

代码片段和文件信息

/*---------------------------------------------------------------------------------------------------------*/
/*                                                                                                         */
/* Copyright (c) 2008 by Nuvoton Technology Corporation                                                    */
/* All rights reserved                                                                                     */
/*                                                                                                         */
/*---------------------------------------------------------------------------------------------------------*/

/*---------------------------------------------------------------------------------------------------------*/
/* Check semihosting function. For standalone application                                                  */
/*---------------------------------------------------------------------------------------------------------*/
#if 1
#pragma import(__use_no_semihosting_swi)
#endif
#include 
#include 

extern void DrvSIO_PutChar(char ch);

#define USE_SERIAL_PORT
#define uputchar DrvSIO_PutChar
#define ugetchar DrvSIO_GetChar

struct __FILE { int handle;   /* Add whatever you need here */};

FILE __stdout;


__value_in_regs struct __initial_stackheap __user_initial_stackheap (
    unsigned R0
    unsigned SP
    unsigned R2
    unsigned SL
    )
{
    struct __initial_stackheap config;

    extern __weak unsigned int Image$$ZI$$Limit;
    extern __weak unsigned int Image$$RAM$$ZI$$Limit;

    if((unsigned int)&Image$$ZI$$Limit)
        config.heap_base = (unsigned int)&Image$$ZI$$Limit;
    else if((unsigned int)&Image$$RAM$$ZI$$Limit)
        config.heap_base = (unsigned int)&Image$$RAM$$ZI$$Limit;
    else
        config.heap_base = 0x4000;
    config.heap_limit = SP;
    config.stack_base = SP;
    config.stack_limit = SL;

    return config;
}


//unsigned int aaaa;

int fputc(int ch FILE *f)
{
    /* Place your implementation of fputc here     */
    /* e.g. write a character to a UART or to the */
    /* debugger console with SWI WriteC            */

    char tempch = ch;
#ifdef USE_SERIAL_PORT
    extern void uputchar(char ch);
uputchar(tempch); // output to UART
#else
    WriteC( &tempch );
#endif
    return ch;
}


int ferror(FILE *f)
{   /* Your implementation of ferror */
    return EOF;
}



void _ttywrch(int ch)
{
    char tempch = ch;
#ifdef USE_SERIAL_PORT
    DrvSIO_PutChar( tempch );
#else
    WriteC( &tempch );
#endif
}


// Returns the number of characters transmitted.
int print_sys_buf(unsigned int count unsigned char *stream_ptr)
{
    do
    {
DrvSIO_PutChar(*(char *)stream_ptr);
count--;
stream_ptr++;
    }while (count != 0);
    return count;
}


// Routine to fill the stream buffer from the com port.
// Returns the first character read.
i

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-01-24 16:47  HW\
     目录           0  2017-01-24 16:47  HW\Include\
     文件        6684  2009-11-10 17:14  HW\Include\ADC.h
     文件        3105  2009-11-10 17:14  HW\Include\AIC.h
     文件        3257  2009-11-10 17:14  HW\Include\APU.h
     文件        2027  2009-11-10 17:14  HW\Include\base.h
     文件        3523  2009-11-10 17:14  HW\Include\CLK.h
     文件        4357  2009-11-10 17:14  HW\Include\GCR.h
     文件       13128  2009-11-10 17:14  HW\Include\GPIO.h
     文件        2193  2009-11-10 17:14  HW\Include\I2C.h
     文件        2311  2009-11-10 17:14  HW\Include\NVTChipDef.h
     文件        7496  2009-11-10 17:14  HW\Include\PWM.h
     文件        3903  2009-11-10 17:14  HW\Include\RTC.h
     文件        1246  2009-11-10 17:14  HW\Include\SFR.h
     文件        4955  2009-11-10 17:14  HW\Include\SPIM.h
     文件        2225  2009-11-10 17:14  HW\Include\SPIMS.h
     文件        1830  2009-11-10 17:14  HW\Include\SRAM.h
     文件         668  2009-11-10 17:14  HW\Include\SYS.h
     文件        2514  2009-11-10 17:14  HW\Include\Timer.h
     文件        4602  2009-11-10 17:14  HW\Include\UART.h
     文件        8037  2009-11-10 17:14  HW\Include\USB.h
     目录           0  2017-01-24 16:47  NuvotonPlatform_ADS\
     目录           0  2017-01-24 16:47  NuvotonPlatform_ADS\Include\
     目录           0  2017-01-24 16:47  NuvotonPlatform_ADS\Include\Driver\
     文件        9133  2009-11-10 17:14  NuvotonPlatform_ADS\Include\Driver\DrvADC.h
     文件        4947  2009-11-10 17:14  NuvotonPlatform_ADS\Include\Driver\DrvAIC.h
     文件        4192  2009-11-10 17:14  NuvotonPlatform_ADS\Include\Driver\DrvAPU.h
     文件        2058  2011-01-06 17:10  NuvotonPlatform_ADS\Include\Driver\DrvAUDIO.h
     文件        6630  2009-11-10 17:14  NuvotonPlatform_ADS\Include\Driver\DrvGPIO.h
     文件        4183  2009-11-10 17:14  NuvotonPlatform_ADS\Include\Driver\DrvI2C.h
     文件        7460  2009-11-10 17:14  NuvotonPlatform_ADS\Include\Driver\DrvPWM.h
............此处省略136个文件信息

评论

共有 条评论