⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 davincievm_msp430.h

📁 I2C control file (TI DSP in CCS)
💻 H
字号:
/*
 *  Copyright 2005 by Spectrum Digital Incorporated.
 *  All rights reserved. Property of Spectrum Digital Incorporated.
 *
 *  Not for distribution.
 */

/*
 *  ======== davincievm_msp430.h ========
 *
 */

#ifndef MSP430_
#define MSP430_

#ifdef __cplusplus
extern "C" {
#endif

#include "davincievm_i2c.h"

/* ------------------------------------------------------------------------ *
 *                                                                          *
 *  Definitions                                                             *
 *                                                                          *
 * ------------------------------------------------------------------------ */
#define MSP430_I2CADDR          0x23        // I2C address

#define SET_RTC_PARAMS          0           // Message IDs
#define GET_RTC_PARAMS          1
#define GET_IR_DATA             2
#define GET_IR_VALUE            3
#define GET_INPUT_STATE         4
#define GET_EVENT               5
#define SET_OUTPUT_STATE        6

#define EVENT_STATE_CHANGE      1           // Event IDs
#define EVENT_IR                2

/* ------------------------------------------------------------------------ *
 *                                                                          *
 *  Structures                                                              *
 *                                                                          *
 * ------------------------------------------------------------------------ */
typedef int MSP430_Handle;                  // MSP430 handle

typedef struct                              // RTC structure
{
    Uint16 year;
    Uint8 month;
    Uint8 day;
    Uint8 hour;
    Uint8 minute;
    Uint8 second;
} RTC_Time;

/* ------------------------------------------------------------------------ *
 *                                                                          *
 *  Prototypes                                                              *
 *                                                                          *
 * ------------------------------------------------------------------------ */

/* Open/Close MSP430 */
Int16 DAVINCIEVM_MSP430_open            ( );
void  DAVINCIEVM_MSP430_close           ( );

/* Get/Set MSP430 registers */
Uint16 DAVINCIEVM_MSP430_send           ( Uint8* msg, Uint16  len );
Uint16 DAVINCIEVM_MSP430_recv           ( Uint8* msg, Uint16  len );
Uint16 DAVINCIEVM_MSP430_recv_variable  ( Uint8* msg, Uint16* len );

/* RTC functions */
Uint16 DAVINCIEVM_MSP430_setRtc         ( RTC_Time* time );
Uint16 DAVINCIEVM_MSP430_getRtc         ( RTC_Time* time );

/* IR functions */
Uint16 DAVINCIEVM_MSP430_getIrData      ( Uint16* ir_data, Uint8* len );
Uint16 DAVINCIEVM_MSP430_getIrValue     ( Uint16* ir_value );

/* GPIO functions */
Uint16 DAVINCIEVM_MSP430_getInput       ( Uint8* port2, Uint8* port3 );
Uint16 DAVINCIEVM_MSP430_setOutput      ( Uint8  port2, Uint8  port3 );

/* Interrupt and Event notification */
Uint16 DAVINCIEVM_MSP430_getIntrState   ( );
Uint16 DAVINCIEVM_MSP430_getEvent       ( Uint8* event );

#ifdef __cplusplus
}
#endif

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -