#ifndef hal_phy_defs_h #define hal_phy_defs_h /* Cesar project {{{ * * Copyright (C) 2007 Spidcom * * <<>> * * }}} */ /** * \file hal/phy/defs.h * \brief HAL Phy types and defines. * \ingroup hal_phy */ /** Number of OFDM carrier, defined by the hardware. */ #define PHY_CARRIER_NB 1155 /** Number of first OFDM carrier, defined by the hardware. */ #define PHY_CARRIER_OFFSET 74 /** Number of words needed to define a tonemask. */ #define PHY_TONEMASK_WORDS ((PHY_CARRIER_NB + 32 - 1) / 32) /** Number of bytes needed to define a tonemask. */ #define PHY_TONEMASK_SIZE (PHY_TONEMASK_WORDS * 4) /** Number of words needed to define a tonemap. */ #define PHY_TONEMAP_WORDS ((PHY_CARRIER_NB + 8 - 1) / 8) /** Number of bytes needed to define a tonemap. */ #define PHY_TONEMAP_SIZE (PHY_TONEMAP_WORDS * 4) /** Delay to detect a preamble, defined by the hardware, not precise. * \todo Get a real value from hardware team. */ #define PHY_PREAMBLE_DETECTION_DELAY_TCK (20 * 25) /** Delay for FC 1.0 preparation. */ #define PHY_FC_10_PREPARATION_DELAY_TCK (30 * 25) /** Noise energy type.*/ typedef unsigned short int phy_noise_energy_t; /** Spectrum type.*/ typedef unsigned int phy_spectrum_t; /** Number of noise storable in a block */ #define PHY_NOISE_NB_PER_BLK (BLK_SIZE/(sizeof(phy_noise_energy_t))) /** Number of spectrum storable in a block */ #define PHY_SPECTRUM_NB_PER_BLK (BLK_SIZE/(sizeof(phy_spectrum_t))) /** Modulation mode. */ enum phy_mod_t { PHY_MOD_ROBO, /*< ROBO mode. */ PHY_MOD_HS_ROBO, /*< HIGH-SPEED ROBO mode. */ PHY_MOD_MINI_ROBO, /*< MINI ROBO mode. */ PHY_MOD_TM, /*< Tone map modulation. */ PHY_MOD_NONE, /*< Invalid mode. */ PHY_MOD_ROBO_NB = PHY_MOD_TM, /*< Number of ROBO modes. */ }; typedef enum phy_mod_t phy_mod_t; /** Forward Error Correction puncturing rate. */ enum phy_fecrate_t { PHY_FEC_RATE_1_2, /*< FEC rate 1/2. */ PHY_FEC_RATE_16_21, /*< FEC rate 16/21. */ PHY_FEC_RATE_NONE /*< Invalid FEC rate. */ }; typedef enum phy_fecrate_t phy_fecrate_t; /** PB size. */ enum phy_pb_size_t { PHY_PB_SIZE_136, /*< PB size 136 bytes, only one PB. */ PHY_PB_SIZE_520, /*< PB size 520 bytes. */ PHY_PB_SIZE_NONE /*< Invalid PB size. */ }; typedef enum phy_pb_size_t phy_pb_size_t; /** FC mode. */ enum phy_fc_mode_t { PHY_FC_MODE_HYBRID_1, /*< Hybrid FC, 1 symbol. */ PHY_FC_MODE_HYBRID_2, /*< Hybrid FC, 2 symbol. */ PHY_FC_MODE_AV_1, /*< AV FC, 1 symbol. */ PHY_FC_MODE_AV_2, /*< AV FC, 2 symbol. */ PHY_FC_MODE_NB, /*< Number of defined FC mode. */ PHY_FC_MODE_NONE = PHY_FC_MODE_NB /*< Invalid FC mode. */ }; typedef enum phy_fc_mode_t phy_fc_mode_t; /** Is it a hybrid mode. */ #define PHY_FC_MODE_IS_HYBRID(m) (!((m) & 0x2)) /** Make FC mode. */ #define PHY_FC_MODE(hybrid, fc_symb_nb) (((hybrid) ? 0 : 2) \ | ((fc_symb_nb == 1) ? 0 : 1)) /** Guard interval length. */ enum phy_gil_t { PHY_GIL_417, /*< Guard interval 417 samples. */ PHY_GIL_567, /*< Guard interval 567 samples. */ PHY_GIL_3534, /*< Guard interval 3534 samples. */ PHY_GIL_NB, /*< Number of defined guard intervals. */ PHY_GIL_NONE = PHY_GIL_NB /*< Invalid guard interval. */ }; typedef enum phy_gil_t phy_gil_t; #endif /* hal_phy_defs_h */