#ifndef hal_phy_maximus_inc_maximus_phy_access_h #define hal_phy_maximus_inc_maximus_phy_access_h /* Cesar project {{{ * * Copyright (C) 2007 Spidcom * * <<>> * * }}} */ /** * \file hal/phy/maximus/inc/maximus_phy_access.h * \brief HAL Phy access declarations for Maximus. * \ingroup hal_phy_maximus */ /** Delay to detect a Priority Resolution Symbol, not precise. */ #define MAXIMUS_PHY_PRS_DETECTION_DELAY_TCK (30 * 25) // 30 microseconds * 25 ticks per microsecond /** * Maximus access backoff start callback called when the corresponding netclock message is received. * \param data pointer to phy_t structure. * set errno to: * - EINVAL if data is null * - EPROTO if medium state is not idle * if 'netclock_schedule()' fails, it sets errno */ void maximus_phy_access_backoff_cb (void *data); /** * Maximus access slot count callback called when the corresponding netclock message is received. * \param data pointer to phy_t structure. * set errno to: * - EINVAL if data is null * - EPROTO if medium state is not PRS0, PRS1 or CW * if 'netclock_schedule()' fails, it sets errno */ void maximus_phy_access_slot_count_cb (void *data); /** * Maximus access PRS0 callback called when the corresponding netclock message is received, * i.e. when the PRS0 must be sent. * \param data pointer to phy_t structure. * set errno to: * - EINVAL if data is null * if 'sci_send()' fails, it sets errno */ void maximus_phy_access_prs0_cb (void *data); /** * Maximus access PRS0 result callback called when the corresponding netclock message is received, * i.e. at the end of the PRS0. * \param data pointer to phy_t structure. * set errno to: * - EINVAL if data is null * if 'netclock_schedule()' fails, it sets errno */ void maximus_phy_access_prs0_result_cb (void *data); /** * Maximus access PRS1 callback called when the corresponding netclock message is received, * i.e. when the PRS1 must be sent. * \param data pointer to phy_t structure. * set errno to: * - EINVAL if data is null * if 'sci_send()' or 'netclock_schedule()' fails, it sets errno */ void maximus_phy_access_prs1_cb (void *data); /** * Maximus access PRP result callback called when the corresponding netclock message is received, * i.e. at the end of the PRS1. * \param data pointer to phy_t structure. * set errno to: * - EINVAL if data is null */ void maximus_phy_access_prp_result_cb (void *data); /** * Maximus access timer program callback called when the corresponding netclock message is received. * \param data pointer to phy_t structure. * set errno to: * - EINVAL if data or ctx->control.access_cb are null */ void maximus_phy_access_timer_cb (void *data); /** * Cancel the backoff procedure. * \param ctx phy context. * set errno to: * - EINVAL if ctx is null */ void maximus_phy_access_backoff_cancel (phy_t *ctx); /** * Reset the slot count. * \param ctx phy context. * set errno to: * - EINVAL if ctx is null */ void maximus_phy_access_slot_count_reset (phy_t *ctx); #endif /* hal_phy_maximus_inc_maximus_phy_access_h */