📄 helper.h
字号:
//undefined RMtypes that I need#define RMvoid void/* #define TPRINT(y, x) { if(y) printk x }*/#define DMSG 1#define MPRINT(x) { DMSG ?printf x:0; }#ifdef _DEBUG#define DEBUG#endif#ifdef DEBUG#define DPRINT(x) printf x#else#define DPRINT(x)#endif#ifndef assert#define assert(exp) ((exp)?1: (MPRINT(("**** ASSERT failed: line %d in %s\r\n", __LINE__, __FILE__)) ))#endif// enum ranges 65535 each range#define TUNER_ENUM 0x10000#define MSP34X5G_ENUM 0x20000#define VPC323XD_ENUM 0x30000#define GPIO_ENUM 0x40000//provided functionsRMvoid mum_exit( RMvoid* pGBus, struct llad* pLLAD );RMstatus mum_init( RMuint8 nChip, struct llad** ppLLAD, RMvoid** ppGBus);//RMstatus mum_i2c_sendtable( struct i2c *pI2c, RMuint8 *pData, RMuint32 uByteCount);RMstatus mum_sleep(RMuint32 uSeconds);RMstatus mum_usleep(RMuint32 uMicroSeconds);// UART0 and 1 as GPIO require special kernel which writes to the UART mode register// Tango only!typedef enum { GpioCfg_None=GPIO_ENUM, GpioCfg_Gpio, GpioCfg_Uart0, GpioCfg_Uart1, GpioCfg_Last } GPIO_CFG_N;//gpio functionstypedef struct tagGPIO_CONFIG{ RMvoid* pGBus; GPIO_CFG_N nGpioCfg; } GPIO_CONFIG;RMstatus mum_gpioSet(GPIO_CONFIG* pC, RMuint8 pin, RMuint8 high);RMstatus mum_gpioGet(GPIO_CONFIG* pC, RMuint8 pin, RMuint8* pData);RMstatus mum_gpioSetDir(GPIO_CONFIG* pC, RMuint8 pin, RMuint8 out);// I2Cal functions#define I2C_WR_ADDR(x) ((x) & 0xFE)#define I2C_RD_ADDR(x) ((x) | 0x01)#define I2CAL_CONTEXT RMuint32RMstatus I2Cal_Read_Subaddress( I2CAL_CONTEXT* pContext, RMuint8 uSlaveAddress, RMuint8 uSubAddress, RMuint8* pData, RMuint32 *pByteCount );RMstatus I2Cal_Write_Subaddress( I2CAL_CONTEXT* pContext, RMuint8 uSlaveAddress, RMuint8 uSubAddress, RMuint8* pData, RMuint32 *pByteCount );RMstatus I2Cal_Read( I2CAL_CONTEXT* pContext, RMuint8 uSlaveAddress, RMuint8* pData, RMuint32 *pByteCount );RMstatus I2Cal_Write( I2CAL_CONTEXT* pContext, RMuint8 uSlaveAddress, RMuint8* pData, RMuint32 *pByteCount );
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -