初始化仓库
This commit is contained in:
89
Header/stc32_stc8_usb.h
Normal file
89
Header/stc32_stc8_usb.h
Normal file
@@ -0,0 +1,89 @@
|
||||
#ifndef __STC32_STC8_USB_H__
|
||||
#define __STC32_STC8_USB_H__
|
||||
|
||||
#include "common.h"
|
||||
|
||||
//使用串口“printf”打印信息需屏蔽以下两个定义
|
||||
//#define PRINTF_SEGLED //printf输出重定向到ISP下载软件中的7段数码管
|
||||
//#define PRINTF_HID //printf输出直接重定向到USB HID接口
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL ((void *) 0)
|
||||
#endif
|
||||
|
||||
#define DEVSTATE_ATTACHED 0
|
||||
#define DEVSTATE_POWERED 1
|
||||
#define DEVSTATE_DEFAULT 2
|
||||
#define DEVSTATE_ADDRESS 3
|
||||
#define DEVSTATE_CONFIGURED 4
|
||||
#define DEVSTATE_SUSPENDED 5
|
||||
|
||||
void usb_init();
|
||||
//void usb_IN(); //USB HID
|
||||
//void usb_IN(uint16 size); //USB CDC
|
||||
void usb_OUT_done();
|
||||
void USB_SendData(uint8 *dat, int size);
|
||||
|
||||
BOOL usb_OUT_callback(); //包含中断模式的CDC库时,需要编写此回调函数代码,查询模式则不需要
|
||||
|
||||
int SEG7_ShowString(const char *fmt, ...);
|
||||
void SEG7_ShowLong(long n, char radix);
|
||||
void SEG7_ShowFloat(float f);
|
||||
void SEG7_ShowCode(uint8 *cod);
|
||||
|
||||
void LED40_SendData(uint8 *dat, uint8 size);
|
||||
void LED64_SendData(uint8 *dat, uint8 size);
|
||||
|
||||
void LCD12864_DisplayOff();
|
||||
void LCD12864_DisplayOn();
|
||||
void LCD12864_CursorOff();
|
||||
void LCD12864_CursorOn();
|
||||
void LCD12864_CursorMoveLeft();
|
||||
void LCD12864_CursorMoveRight();
|
||||
void LCD12864_CursorReturnHome();
|
||||
void LCD12864_ScrollLeft();
|
||||
void LCD12864_ScrollRight();
|
||||
void LCD12864_ScrollUp(uint8 line);
|
||||
void LCD12864_AutoWrapOff();
|
||||
void LCD12864_AutoWrapOn();
|
||||
void LCD12864_ReverseLine(uint8 line);
|
||||
void LCD12864_DisplayClear();
|
||||
void LCD12864_ShowString(uint8 x, uint8 y, char *str);
|
||||
void LCD12864_ShowPicture(uint8 x, uint8 y, uint8 cx, uint8 cy, uint8 *dat);
|
||||
|
||||
void OLED12864_DisplayOff();
|
||||
void OLED12864_DisplayOn();
|
||||
void OLED12864_DisplayContent();
|
||||
void OLED12864_DisplayEntire();
|
||||
void OLED12864_HorizontalMirror();
|
||||
void OLED12864_VerticalMirror();
|
||||
void OLED12864_DisplayReverse();
|
||||
void OLED12864_SetContrast(uint8 bContrast);
|
||||
void OLED12864_SetAddressMode(uint8 bMode);
|
||||
void OLED12864_ScrollLeft(uint8 bPageStart, uint8 bPageEnd, uint16 nInterval);
|
||||
void OLED12864_ScrollRight(uint8 bPageStart, uint8 bPageEnd, uint16 nInterval);
|
||||
void OLED12864_ScrollUp(uint8 bPageStart, uint8 bPageEnd, uint16 nInterval);
|
||||
void OLED12864_ScrollStart();
|
||||
void OLED12864_ScrollStop();
|
||||
void OLED12864_ShowPicture(uint8 x, uint8 y, uint8 cx, uint8 cy, uint8 *dat);
|
||||
|
||||
int printf_hid (const char *fmt, ...);
|
||||
|
||||
#if defined PRINTF_SEGLED
|
||||
#define printf SEG7_ShowString
|
||||
#elif defined PRINTF_HID
|
||||
#define printf printf_hid
|
||||
#endif
|
||||
|
||||
|
||||
extern uint8 xdata UsbFeatureBuffer[64];
|
||||
extern uint8 xdata UsbInBuffer[64];
|
||||
extern uint8 xdata UsbOutBuffer[64];
|
||||
extern BOOL bUsbFeatureReady;
|
||||
extern BOOL bUsbInBusy;
|
||||
extern BOOL bUsbOutReady;
|
||||
extern uint8 DeviceState;
|
||||
extern uint8 OutNumber;
|
||||
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user