📄 hpi.h
字号:
/*********************************************************************/
/* hpi.h v0.00 */
/* Copyright (c) 2000 Texas Instruments Incorporated */
/*********************************************************************/
/*********************************************************************/
/* This header defines the macros, symbols, fuctions that are needed */
/* for accessing functions of the Host Port Interface (HPI). */
/* The MACROS defined here are dependent on the symbol definitions */
/* contained in regs.h. */
/*********************************************************************/
#include <stdlib.h>
#include <limits.h>
/*********************************************************************/
/* INCLUDE MEMORY-MAPPED REGISTER DEFINITIONS */
/*********************************************************************/
#include "regs54xx.h"
/*********************************************************************/
/* Define HPI interface constants */
/* */
/* NO_HPI_PINS - Number of configurable HPI pins */
/*********************************************************************/
#define NO_HPI_PINS 16
/*********************************************************************/
/* ENABLE_HPI_MEM - enables C54x cpu access to shared host memory */
/*********************************************************************/
#define ENABLE_HPI_MEM\
HPIC |= MASK_BIT(SMOD)
/*********************************************************************/
/* DISABLE_HPI_MEM - disables C54x cpu access to shared host memory */
/*********************************************************************/
#define DISABLE_HPI_MEM\
HPIC &= ~MASK_BIT(SMOD)
/*********************************************************************/
/* HOST_INTERRUPT - posts interrupt to host */
/*********************************************************************/
#define HOST_INTERRUPT\
HPIC |= MASK_BIT(HINT)
/*********************************************************************/
/* Function Prototypes */
/* */
/* reset_hpi_config - initialize HPI config data structures */
/* config_host_ctrl_pin - configure HPI host control pin */
/* config_host_data_bus - configure HPI HD0-HD7 data bus */
/* init_hpi - initialize HPI interface */
/*********************************************************************/
void reset_hpi_config(unsigned int max);
int config_host_ctrl_pin(short pin, void *addr, short bit, short rw,
short inv, unsigned int delay);
int config_host_data_bus(void *addr, short bit);
int init_hpi(short bob, void *hpi_addr);
int write_hpi_data(char *val, void *hpi_addr, unsigned int no_items,
unsigned int size, short autoinc);
int get_hpi_data(char *val, void *hpi_addr, unsigned int no_items,
unsigned int size, short autoinc);
int client_interrupt();
int clear_client_interrupt();
int set_hpi_addr(void *addr);
static void write_hpi_ctrl(unsigned short ctrl);
unsigned int read_data(void);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -