#ifndef IR_SEND_H
#define IR_SEND_H

/**
 * @file ir_send.h
 * @brief Infrared transmission library for laser tag system.
 */

#include <stdint.h>

/**
 * @brief Initialize IR output hardware (PWM backend).
 * @return 0 on success, negative error code otherwise.
 */
int ir_send_init(void);

/**
 * @brief Send a single IR pulse (carrier burst).
 * @param duration_us Pulse duration in microseconds.
 * @return 0 on success.
 */
int ir_send_pulse(uint32_t duration_us);

/**
 * @brief Send a carrier burst of given duration (us) at configured frequency.
 * @param burst_us Duration in microseconds.
 * @return 0 on success.
 */
int ir_send_burst_us(uint32_t burst_us);

/**
 * @brief Send IR message (sequence of pulses and gaps).
 * @param data IR payload (e.g., shooter ID, power-up type).
 * @param len Length of data in bytes.
 * @return 0 on success.
 */
int ir_send_message(const uint8_t *data, uint8_t len);

/**
 * @brief Set IR carrier frequency.
 * @param freq_hz Carrier frequency in Hz (typically 38000 Hz).
 */
void ir_send_set_frequency(uint32_t freq_hz);

#endif /* IR_SEND_H */
