📄 evmdrv.h
字号:
/*******************************************************************************
*
* Motorola Inc.
* (c) Copyright 2002 Motorola, Inc.
* ALL RIGHTS RESERVED.
*
* $Element: /project/dsp568_sdk/sdk/src/dsp56838evm/nos/bsp/evmdrv.h $
* $Author: saa $
* $Revision: /main/2 $
* $VOB: /project/dsp568_sdk $
* $OS: solaris $
*
* Description: header file for the 56838/36 EVM device drive
*
* Notes:
*
******************************************************************************/
#ifndef EVMDRV_H
#define EVMDRV_H
#include "port.h"
#include "periph.h"
#include "arch.h"
#include "io.h"
#include "timer.h"
#include "evm.h"
#include "evmdrv.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef const struct
{
ssize_t (*pRead)(handle_t hndl, void *buf, size_t);
ssize_t (*pWrite)(handle_t hndl, const void *buf, size_t len);
int (*pClose)(handle_t hndl);
UWord16 (*pIoctl[4])(handle_t hndl, unsigned long params );
} io_sLEDInterface;
/* Define the specific LED supported by this driver */
typedef struct
{
io_sInterface * pInterface;
volatile arch_sPort* port;
UWord16 pin;
}led_Config;
/* Define the specific LED supported by this driver */
typedef struct
{
io_sInterface * pInterface;
volatile arch_sPWM* pPwm;
UWord16 flags;
}led_PWM_Config;
/*****************************************************************************
* Prototypes - See source file for functional descriptions
******************************************************************************/
handle_t ledOpen(const char * pName, int OFlags, ...);
handle_t ledPWMOpen(const char * pName, int OFlags, ...);
size_t ledWrite( handle_t hndl, const void *buf, size_t len );
size_t ledBarWrite( handle_t hndl, const void *buf, size_t len );
size_t ledPWMWrite( handle_t hndl, const void *buf, size_t len );
size_t ledPWMBarWrite( handle_t hndl, const void *buf, size_t len );
UWord16 ledIoctlLED_ON( handle_t hndl, unsigned long params);
UWord16 ledIoctlLED_OFF( handle_t hndl, unsigned long params );
UWord16 ledIoctlLED_TOGGLE( handle_t hndl, unsigned long params);
UWord16 ledIoctlGLED_ON( handle_t hndl, unsigned long params);
UWord16 ledIoctlGLED_OFF( handle_t hndl, unsigned long params );
UWord16 ledIoctlGLED_TOGGLE( handle_t hndl, unsigned long params);
UWord16 ledIoctlINVERT_DIRECTION( handle_t hndl, unsigned long params );
UWord16 ledPWMIoctlINVERT_DIRECTION( handle_t hndl, unsigned long params );
UWord16 ledIoctlPWMLED_ON( handle_t hndl, unsigned long params );
UWord16 ledIoctlPWMLED_OFF( handle_t hndl, unsigned long params );
/*****************************************************************************
*
* switchdrv.h - header file for the Switch driver
*
*****************************************************************************/
#define ledClose(FD) (0)
/* EXPORT Result ledCreate(const char * pName) */
#define ledCreate(name) (PASS)
#define RUN_STOP_SWITCH_PIN gpioPin(D,5)
struct switch_sConfig{
io_sInterface * pInterface;
volatile arch_sPort* port;
UWord16 pin;
};
const struct io_sSwitchInterface
{
ssize_t (*pRead)(handle_t hndl, void *buf, size_t);
ssize_t (*pWrite)(handle_t hndl, const void *buf, size_t len);
int (*pClose)(handle_t hndl);
UWord16 (*pIoctl[1])(handle_t hndl, void *pParams );
};
/*****************************************************************************
* Prototypes - See documentation for functional descriptions
******************************************************************************/
handle_t switchOpen (const char * pName, int OFlags,...);
int switchClose (handle_t FileDesc);
UWord16 switchIoctllSWITCH_GET_STATE( handle_t hndl, void* pParams );
void ledPWMSetValue( unsigned int val, unsigned int num );
struct button_sButton{
io_sInterface * pInterface;
struct timespec DebounceTimeExp;
};
void buttonISR(void *, struct button_sButton * pButtonTable, button_tCallback Callback);
extern struct button_sButton ButtonADeviceContext;
extern struct button_sButton ButtonBDeviceContext;
handle_t buttonOpen (const char * pName, int OFlags, ...);
int buttonClose (handle_t FileDesc);
#ifdef __cplusplus
}
#endif
#endif /* EVMDRV_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -