summaryrefslogtreecommitdiff
path: root/hal/phy/phy.h
diff options
context:
space:
mode:
authorschodet2007-04-17 09:51:02 +0000
committerschodet2007-04-17 09:51:02 +0000
commit8cd1c51298bea2bf05147ea92f0c9687a4f3442b (patch)
tree6df0a80d744b4b7213687364beaccb12c98e9b93 /hal/phy/phy.h
parent88571ba1700d79bbe7631df20b45d70903e1bb16 (diff)
HAL Phy interface update, more to come.
git-svn-id: svn+ssh://pessac/svn/cesar/trunk@44 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'hal/phy/phy.h')
-rw-r--r--hal/phy/phy.h97
1 files changed, 88 insertions, 9 deletions
diff --git a/hal/phy/phy.h b/hal/phy/phy.h
index bd36f41efd..063366603e 100644
--- a/hal/phy/phy.h
+++ b/hal/phy/phy.h
@@ -12,6 +12,13 @@
* \brief HAL Phy public interface.
* \ingroup hal_phy
*/
+#include "lib/blk.h"
+
+/* Forward declaration. */
+typedef struct phy_t phy_t;
+
+#include "hal/phy/access.h"
+#include "hal/phy/pbdma.h"
/** Modulation mode. */
enum phy_mod_t
@@ -50,7 +57,7 @@ enum phy_fc_mode_t
typedef enum phy_fc_mode_t phy_fc_mode_t;
/**
- * Access confirm event callback.
+ * ACCESS CONFIRM event callback.
* \param user user data
*/
typedef void (*phy_access_conf_cb_t) (void *user);
@@ -63,35 +70,107 @@ typedef void (*phy_rx_fc_cb_t) (void *user);
BEGIN_DECLS
+/**
+ * Initialise the HAL Phy.
+ * \param user_data User data passed to any callback
+ * \param rx_fc_cb RX FC event callback
+ * \param access_cb ACCESS event callback
+ * \param access_conf_cb ACCESS CONFIRM event callback
+ * \param pbdma_cb PB DMA callback
+ * \return the newly created context
+ */
phy_t *
-phy_init (void);
+phy_init (void *user_data, phy_rx_fc_cb_t rx_fc_cb, phy_access_cb_t access_cb,
+ phy_access_conf_cb_t access_conf_cb, phy_pbdma_cb_t pbdma_cb);
+/**
+ * Reset the hardware to a known sane state.
+ * \param ctx phy context
+ */
void
phy_reset (phy_t *ctx);
+/**
+ * Set the tone mask and its related parameters.
+ * \param ctx phy context
+ * \param tonemask tonemask blocks first descriptor
+ * \param robo_param ROBO parameters
+ */
void
-phy_set_tonemask (phy_t *ctx, phy_robo_param_t *robo_param);
+phy_set_tonemask (phy_t *ctx, blk_t *tonemask,
+ const phy_robo_param_t *robo_param);
+/**
+ * Reset an uninitialise the HAL Phy.
+ * \param ctx phy context
+ */
void
phy_uninit (phy_t *ctx);
+/**
+ * Start Homeplug 1.0 frame control encoding.
+ * \param ctx phy context
+ * \param fc_10 Homeplug 1.0 frame control
+ */
void
phy_tx_fc10 (phy_t *ctx, u32 fc_10);
+/**
+ * Transfer tone map to hardware using the TM DMA.
+ * \param ctx phy context
+ * \param mod modulation type
+ * \param fecrate TCC rate
+ * \param gil guard interval for third symbol and following symbols
+ * \param tonemap_index tonemap index where to store tonemap
+ * \param tonemap tonemap blocks first descriptor
+ *
+ * When modulation type is a ROBO mode, other arguments are ignored.
+ */
+void
+phy_set_tonemap (phy_t *ctx, phy_mod_t mod, phy_fecrate_t fecrate, uint gil,
+ uint tonemap_index, blk_t *tonemap);
+
+/**
+ * Schedule a TX start.
+ * \param ctx phy context
+ * \param date hardware date when the transmission should begin
+ * \param want_conf request an ACCESS CONF interrupt
+ * \param stop_tx_on_prp_lost abort TX if PRP was lost
+ * \param fc_av frame control
+ * \param tonemap_index tone map index
+ * \param pb_size PB size
+ * \param fc_mode frame control mode
+ */
void
-phy_tx_tonemap (phy_t *ctx, phy_mod_t mod, phy_fecrate_t fecrate,
- uint gil, list_desc_t tonemap);
+phy_tx_frame (phy_t *ctx, u32 date, bool want_conf, bool stop_tx_on_prp_lost,
+ const u32 fc_av[4], uint tonemap_index, phy_pb_size_t pb_size,
+ phy_fc_mode_t fc_mode);
+/**
+ * Set the phy clock used for RX or TX.
+ * \param phy_clock TBD
+ */
void
-phy_tx_frame (phy_t *ctx, u32 date, u32 *fc_av, bool want_conf,
- bool stop_rx, uint tonemap_index, phy_pb_size_t pb_size,
- phy_clock_t phy_clock, phy_fc_mode_t fc_mode);
+phy_clock_set (phy_clock_t phy_clock);
+/**
+ * Activate or deactivate preamble detection.
+ * \param ctx phy context
+ * \param flag true to activate
+ *
+ * A pending interrupt is not cancelled.
+ */
void
phy_rx_activate (phy_t *ctx, bool flag);
+/**
+ * Set parameter for frame payload reception.
+ * \param ctx phy context
+ * \param tonemap_index tone map index
+ * \param pb_size PB size
+ */
void
-phy_rx_prepare (phy_t *ctx, );
+phy_rx_prepare (phy_t *ctx, uint tonemap_index, phy_pb_size_t pb_size);
END_DECLS