| 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2003-2006, Broadcom Corporation |
|---|
| 3 | * All Rights Reserved |
|---|
| 4 | * Confidential Property of Broadcom Corporation |
|---|
| 5 | * |
|---|
| 6 | * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE |
|---|
| 7 | * AGREEMENT BETWEEN THE USER AND BROADCOM. YOU HAVE NO RIGHT TO USE OR |
|---|
| 8 | * EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. |
|---|
| 9 | * |
|---|
| 10 | * $brcm_Workfile: $ |
|---|
| 11 | * $brcm_Revision: $ |
|---|
| 12 | * $brcm_Date: $ |
|---|
| 13 | * |
|---|
| 14 | * Module Description: |
|---|
| 15 | * |
|---|
| 16 | * Revision History: |
|---|
| 17 | * |
|---|
| 18 | * $brcm_Log: $ |
|---|
| 19 | * |
|---|
| 20 | ***************************************************************************/ |
|---|
| 21 | #ifndef XDS_CTRL_H__ |
|---|
| 22 | #define XDS_CTRL_H__ |
|---|
| 23 | |
|---|
| 24 | /* XDS state */ |
|---|
| 25 | typedef enum xds_state_t |
|---|
| 26 | { |
|---|
| 27 | eXDS_IDLE, |
|---|
| 28 | eXDS_ACTIVE |
|---|
| 29 | }xds_state_t; |
|---|
| 30 | |
|---|
| 31 | /* XDS class */ |
|---|
| 32 | typedef enum xds_class_t |
|---|
| 33 | { |
|---|
| 34 | eXDS_CLASS_CURRENT, |
|---|
| 35 | eXDS_CLASS_FUTURE, |
|---|
| 36 | eXDS_CLASS_CHANNEL, |
|---|
| 37 | eXDS_CLASS_MISC, |
|---|
| 38 | eXDS_CLASS_PUBLIC, |
|---|
| 39 | eXDS_CLASS_RESERVED, |
|---|
| 40 | eXDS_CLASS_PRIVATE |
|---|
| 41 | }xds_class_t; |
|---|
| 42 | |
|---|
| 43 | /* XDS current class types */ |
|---|
| 44 | typedef enum xds_type_t |
|---|
| 45 | { |
|---|
| 46 | eXDS_TYPE_PROG_ID = 0x01, |
|---|
| 47 | eXDS_TYPE_PROG_TIME = 0x02, |
|---|
| 48 | eXDS_TYPE_PROG_NAME = 0x03, |
|---|
| 49 | eXDS_TYPE_PROG_TYPE = 0x04, |
|---|
| 50 | eXDS_TYPE_PROG_CONT = 0x05, |
|---|
| 51 | eXDS_TYPE_PROG_AUDIO = 0x06, |
|---|
| 52 | eXDS_TYPE_PROG_CC = 0x07, |
|---|
| 53 | eXDS_TYPE_PROG_CGMS = 0x08, |
|---|
| 54 | eXDS_TYPE_PROG_AR = 0x09, |
|---|
| 55 | eXDS_TYPE_PROG_COMP1 = 0x0C, |
|---|
| 56 | eXDS_TYPE_PROG_COMP2 = 0x0D, |
|---|
| 57 | eXDS_TYPE_PROG_DESC = 0x10, |
|---|
| 58 | }xds_type_t; |
|---|
| 59 | |
|---|
| 60 | /* XDS channel class types */ |
|---|
| 61 | typedef enum xds_ch_type_t |
|---|
| 62 | { |
|---|
| 63 | eXDS_CH_NETWORK = 0x01, |
|---|
| 64 | eXDS_CH_CALL_LETTERS = 0x02, |
|---|
| 65 | eXDS_CH_TAPE_DELAY = 0x03, |
|---|
| 66 | eXDS_CH_TSID = 0x04, |
|---|
| 67 | }xds_ch_type_t; |
|---|
| 68 | |
|---|
| 69 | /* XDS misc class types */ |
|---|
| 70 | typedef enum xds_misc_type_t |
|---|
| 71 | { |
|---|
| 72 | eXDS_MISC_TIME = 0x01, |
|---|
| 73 | eXDS_MISC_IMPULSE = 0x02, |
|---|
| 74 | eXDS_MISC_SUP_DATA = 0x03, |
|---|
| 75 | eXDS_MISC_TIME_ZONE = 0x04, |
|---|
| 76 | }xds_misc_type_t; |
|---|
| 77 | |
|---|
| 78 | /* XDS public service class types */ |
|---|
| 79 | typedef enum xds_pub_type_t |
|---|
| 80 | { |
|---|
| 81 | eXDS_PUB_SERV_WRSAME = 0x01, |
|---|
| 82 | eXDS_PUB_SERV_MSG = 0x02, |
|---|
| 83 | }xds_pub_type_t; |
|---|
| 84 | |
|---|
| 85 | /* Event callback type */ |
|---|
| 86 | typedef void (*xds_callback_t)( xds_class_t xds_class, int xds_type, unsigned char* data, int data_len ); |
|---|
| 87 | |
|---|
| 88 | /* XDS control type */ |
|---|
| 89 | #define MAX_MSG_LEN 32 |
|---|
| 90 | |
|---|
| 91 | typedef struct xds_ctrl_t |
|---|
| 92 | { |
|---|
| 93 | xds_state_t xds_state; |
|---|
| 94 | xds_class_t xds_class; |
|---|
| 95 | int xds_type; /* value depends on xds_class */ |
|---|
| 96 | unsigned char xds_data[MAX_MSG_LEN]; /* message buffer to handle information */ |
|---|
| 97 | int xds_len; /* current message length */ |
|---|
| 98 | xds_callback_t xds_callback; |
|---|
| 99 | unsigned int xds_checksum; /* running 7 bit checksum value */ |
|---|
| 100 | }xds_ctrl_t; |
|---|
| 101 | |
|---|
| 102 | |
|---|
| 103 | /* |
|---|
| 104 | Summary: |
|---|
| 105 | Initialize XDS processing. |
|---|
| 106 | Description: |
|---|
| 107 | Setup XDS processing state. A callback can be specified or NULL if no callback is needed |
|---|
| 108 | */ |
|---|
| 109 | void xds_ctrl_init(xds_ctrl_t * p_xds); /* XDS callback or NULL */ |
|---|
| 110 | void xds_ctrl_set_cb(xds_ctrl_t * p_xds, /* initialized XDS reference */ |
|---|
| 111 | xds_callback_t cb); /* XDS callback or NULL */ |
|---|
| 112 | void xds_ctrl_feed(xds_ctrl_t * p_xds, /* initialized XDS reference */ |
|---|
| 113 | unsigned char xds_char_0, /* Character pair */ |
|---|
| 114 | unsigned char xds_char_1); |
|---|
| 115 | |
|---|
| 116 | #endif /* XDS_CTRL_H__ */ |
|---|
| 117 | |
|---|
| 118 | |
|---|