53 lines
2.1 KiB
C
53 lines
2.1 KiB
C
/**
|
|
* @file ad9102_device.h
|
|
* @brief AD9102 waveform-generation device driver.
|
|
*
|
|
* Architectural note:
|
|
* The driver owns all AD9102 register tables and safe mode switching rules.
|
|
* High-level services describe *what* waveform to apply, while this module
|
|
* owns the register-level details of *how* to enter, verify, and leave each
|
|
* mode without cross-coupling to UART or storage logic.
|
|
*/
|
|
|
|
#ifndef AD9102_DEVICE_H
|
|
#define AD9102_DEVICE_H
|
|
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
|
|
#include "app_types.h"
|
|
|
|
#define AD9102_SRAM_DEFAULT_HOLD 1u
|
|
#define AD9102_SRAM_DEFAULT_AMPLITUDE 8191u
|
|
#define AD9102_SRAM_DEFAULT_SAMPLE_COUNT 16u
|
|
#define AD9102_SRAM_MAX_SAMPLE_COUNT 4096u
|
|
|
|
void ad9102_init(void);
|
|
void ad9102_stop_output(void);
|
|
uint16_t ad9102_apply_saw(uint8_t saw_type,
|
|
uint8_t enabled,
|
|
uint8_t saw_step,
|
|
uint8_t pat_period_base,
|
|
uint16_t pat_period);
|
|
uint16_t ad9102_apply_generated_sram(uint8_t enabled,
|
|
uint16_t sample_count,
|
|
uint8_t hold_cycles,
|
|
uint8_t triangle_mode,
|
|
uint16_t amplitude);
|
|
bool ad9102_begin_custom_upload(uint16_t sample_count);
|
|
bool ad9102_write_custom_chunk(const uint16_t *samples, uint16_t chunk_count);
|
|
uint16_t ad9102_commit_custom_upload(bool *out_ok);
|
|
void ad9102_cancel_custom_upload(void);
|
|
uint8_t ad9102_check_saw_configuration(uint16_t pat_status,
|
|
uint8_t expect_run,
|
|
uint8_t saw_type,
|
|
uint8_t saw_step,
|
|
uint8_t pat_period_base,
|
|
uint16_t pat_period);
|
|
uint8_t ad9102_check_sram_configuration(uint16_t pat_status,
|
|
uint8_t expect_run,
|
|
uint16_t sample_count,
|
|
uint8_t hold_cycles);
|
|
|
|
#endif /* AD9102_DEVICE_H */
|