Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Diff of /cp_group.h [000000] .. [a1785f] Maximize Restore

  Switch to side-by-side view

--- a
+++ b/cp_group.h
@@ -0,0 +1,46 @@
+/* cp_group.h - CP group library header */
+
+/* Copyright (c) 2010, Lantronix, Inc. All rights reserved. */
+
+/*
+modification history
+--------------------
+01a,05aug08,nss  written.
+*/
+
+#ifndef _CP_GROUP_H
+#define _CP_GROUP_H
+
+#include "cp_config.h"
+
+#define	CP_GROUP_NAME_LEN	64
+#define	CP_GROUP_BITS		32
+
+/* CP group table */
+struct  cp_group_t {
+	struct  cp_group_t  *next;			/* link to next */
+	char name[CP_GROUP_NAME_LEN];		/* group name  */
+	unsigned char type;					/* type 0:input 1:output */
+	unsigned char state;				/* state 0:dis 1:ena */
+	unsigned char bits[CP_GROUP_BITS];	/* CP pin assign */
+};
+
+/* function declarations */
+extern int cp_group_init (void);
+extern void cp_group_exit (void);
+extern int cp_group_create (char *name);
+extern int cp_group_delete (char *name);
+extern int cp_group_delete_all (void);
+extern int cp_group_type_set (char *name, int value);
+extern int cp_group_state_set (char *name, int value);
+extern int cp_group_add  (char *name, int bit_num, int cp_num);
+extern int cp_group_remove (char *name, int bit_num);
+extern int cp_group_level_input (char *name, unsigned long *pValue);
+extern int cp_group_data_input (char *name, unsigned long *pValue);
+extern int cp_group_data_output (char *name, unsigned long value);
+
+extern int cp_group_read (char *name, struct cp_group_t *pTable);
+extern int cp_group_read_by_index (int index, 
+							struct cp_group_t *pTable);
+
+#endif	/* _CPM_H */