view src/g23m-aci/gdd_dio/gdd_dio.h @ 600:8f50b202e81f

board preprocessor conditionals: prep for more FC hw in the future This change eliminates the CONFIG_TARGET_FCDEV3B preprocessor symbol and all preprocessor conditionals throughout the code base that tested for it, replacing them with CONFIG_TARGET_FCFAM or CONFIG_TARGET_FCMODEM. These new symbols are specified as follows: CONFIG_TARGET_FCFAM is intended to cover all hardware designs created by Mother Mychaela under the FreeCalypso trademark. This family will include modem products (repackagings of the FCDEV3B, possibly with RFFE or even RF transceiver changes), and also my desired FreeCalypso handset product. CONFIG_TARGET_FCMODEM is intended to cover all FreeCalypso modem products (which will be firmware-compatible with the FCDEV3B if they use TI Rita transceiver, or will require a different fw build if we switch to one of Silabs Aero transceivers), but not the handset product. Right now this CONFIG_TARGET_FCMODEM preprocessor symbol is used to conditionalize everything dealing with MCSI. At the present moment the future of FC hardware evolution is still unknown: it is not known whether we will ever have any beyond-FCDEV3B hardware at all (contingent on uncertain funding), and if we do produce further FC hardware designs, it is not known whether they will retain the same FIC modem core (triband), if we are going to have a quadband design that still retains the classic Rita transceiver, or if we are going to switch to Silabs Aero II or some other transceiver. If we produce a quadband modem that still uses Rita, it will run exactly the same fw as the FCDEV3B thanks to the way we define TSPACT signals for the RF_FAM=12 && CONFIG_TARGET_FCFAM combination, and the current fcdev3b build target will be renamed to fcmodem. OTOH, if that putative quadband modem will be Aero-based, then it will require a different fw build target, the fcdev3b target will stay as it is, and the two targets will both define CONFIG_TARGET_FCFAM and CONFIG_TARGET_FCMODEM, but will have different RF_FAM numbers. But no matter which way we are going to evolve, it is not right to have conditionals on CONFIG_TARGET_FCDEV3B in places like ACI, and the present change clears the way for future evolution.
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 01 Apr 2019 01:05:24 +0000
parents 53929b40109c
children
line wrap: on
line source

/* 
+------------------------------------------------------------------------------
|  File:       gdd_dio.h
+------------------------------------------------------------------------------
|  Copyright 2002 Texas Instruments Berlin, AG 
|                 All rights reserved. 
| 
|                 This file is confidential and a trade secret of Texas 
|                 Instruments Berlin, AG 
|                 The receipt of or possession of this file does not convey 
|                 any rights to reproduce or disclose its contents or to 
|                 manufacture, use, or sell anything it may describe, in 
|                 whole, or in part, without the specific written consent of 
|                 Texas Instruments Berlin, AG. 
+----------------------------------------------------------------------------- 
|  Purpose :  Definitions for the Protocol Stack Entity gdd_dio.
+----------------------------------------------------------------------------- 
*/ 

#ifndef GDD_DIO_H
#define GDD_DIO_H

/*==== INCLUDES =============================================================*/

#include "gdd_dio_data.h"

/*==== CONSTS ===============================================================*/

#define VSI_CALLER       GDD_DIO_handle,
#define ENTITY_DATA      gdd_dio_data

#define ENCODE_OFFSET    0             /* Bitoffset for encoding/decoding */
#define hCommGDD_DIO         gdd_dio_hCommGDD_DIO  /* Communication handle */

/* Timer definitions */
#define T001             0
#define T002             1

/* Timer durations */
#define T001_VALUE       1000          /* 1 second */
#define T002_VALUE       3000          /* 3 seconds */

/* --------------  Trace classes specific to GDD_DIO entity -----------------*/

/* Trace class user 1 is used for tracing GDD and DIO signals */
#define TC_SIGNALS           TC_USER1
/* Trace class user 2 is used for function traces of the function which are
   involved in the actual data flow. Since we expect these to be hit
   frequently, this special trace class has been created. */
#define TC_FUNC_DATA_FLOW    TC_USER2

/* Trace class user 3 is for all functions in the "gdd_sys.h" header */
#define TC_SYS_INTERFACE     TC_USER3


/* Set the following #define if a context switch in DTX is to be made.
   (i.e. a context switch to avoid calling a client into PSI */
/*#define GDD_MAKE_DTX_CONTEXT_SWITCH*/

#ifdef GDD_MAKE_DTX_CONTEXT_SWITCH
/** Signals (internal to this entity)
 * The signal must also carry the connection handle, which is stored
 * in bit 7. This means that we currently limit our device range to 0..127
 */
#define GDD_DIO_SIGNAL_SEND_DATA       0x00000000
#define GDD_DIO_SIGNAL_RECEIVE_DATA    0x00000080

#define GDD_DIO_SIGNAL_MASK            0x00000080
#define GDD_DIO_SIGNAL_CON_HANDLE_MASK 0xFFFFFF7F
#endif /* GDD_MAKE_DTX_CONTEXT_SWITCH */

typedef struct
{
  T_GDD_BUF        * buf;
  T_GDD_CON_HANDLE   con_handle;
} T_GDD_DIO_SIGNAL_DATA;


/*==== TYPES =================================================================*/

/* GDD_DIO global typedefs */

typedef struct                         /* T_GDD_DIO_DATA */
{
  /* Kernel service data */  
  T_GDD_DIO_KER_DATA    ker;

  /** Connection service data array (one structure for each connection) */
  T_GDD_DIO_CON_DATA  * con_arr;

  /** Flag set when the con_arr memory was allocated in this entity */
  BOOL                  con_arr_mem_allocated;

  /** Max number of connections that client wishes to open */
  U16                   max_con;

  /** External instnace id - passed in when calling gdd_init. */
  T_GDD_INST_ID         inst_id;

  /** DIO driver number */
  T_GDD_DIO_DRV_NUM     drv_num;

  /** DIO device range start (0 if not yet initialized by DIO IL) */
  U32                   device_range_start;

  /** DIO device range end (0 if not yet initialized by DIO IL) */
  U32                   device_range_end;

  /** DIO driver handle */
  U16                   drv_handle;

  /** DIO callback */
  T_DRV_CB_FUNC         signal_callback;


} T_GDD_DIO_DATA;

/*==== EXPORTS ===============================================================*/

short pei_create (T_PEI_INFO **info);

#ifdef GDD_DIO_PEI_C

/* Entity data base */
T_GDD_DIO_DATA           gdd_dio_data_base [GDD_NUM_INSTS];
BOOL                     gdd_dio_init_flag [GDD_NUM_INSTS];

/* Communication handles */
T_HANDLE                 hCommGDD_DIO = VSI_ERROR;
T_HANDLE                 GDD_DIO_handle;

#else  /* GDD_DIO_PEI_C */

extern T_GDD_DIO_DATA    gdd_dio_data_base [];
extern BOOL              gdd_dio_init_flag [];
extern T_HANDLE          hCommGDD_DIO;
extern T_HANDLE          GDD_DIO_handle;

#endif /* GDD_DIO_PEI_C */

#endif /* !GDD_DIO_H */