/** * @file fhss.h * @brief FHSS channel sequencer based on AES-128-ECB. * * Both link endpoints derive the same hopping sequence independently from a * shared 128-bit key and a monotonically increasing slot counter. No * synchronisation traffic is required as long as both sides start from the * same slot. */ #pragma once #include /** Dwell time per channel in milliseconds. */ #define FHSS_DWELL_MS 2u /** Number of channels in the hopping sequence. */ #define FHSS_CHANNELS 40u /** @brief Reset the slot counter to zero. */ void fhss_init(void); /** * @brief Return the next channel in the hopping sequence and advance the slot. * @return Channel index in [0, 39]. */ uint8_t fhss_next_channel(void); /** @brief Advance the slot counter by one (receiver side, no packet received). */ void fhss_sync_tick(void); /** * @brief Force the slot counter to a specific value for RX synchronisation. * @param s New slot value. */ void fhss_set_slot(uint32_t s); /** @brief Return the current slot counter value. */ uint32_t fhss_get_slot(void);