35 if (h->enx_gpio_dev) {
37 enx_gpio_dev->
set(enable);
39 return RFFCX07X_NO_ERROR;
45 return RFFCX07X_NO_ERROR;
51 if (h->rst_gpio_dev) {
53 rst_gpio_dev->
set(enable);
55 return RFFCX07X_NO_ERROR;
61 return RFFCX07X_NO_ERROR;
71 return RFFCX07X_NO_ERROR;
77 if (h->sda_gpio_dev) {
79 sda_gpio_dev->
set(enable);
81 return RFFCX07X_NO_ERROR;
87 if (h->sda_gpio_dev) {
89 return sda_gpio_dev->
get();
91 return -RFFCX07X_NOT_IMPL;
97 if (h->sda_gpio_dev) {
99 if (dir == RFFCX07X_SDA_RX) {
105 return RFFCX07X_NO_ERROR;
137 m_mixer.clk_dev = &
io.mixer_clk;
138 m_mixer.rst_gpio_dev = &
io.mixer_rst;
139 m_mixer.enx_gpio_dev = &
io.mixer_enx;
140 m_mixer.sda_gpio_dev = &
io.mixer_sda;
141 m_mixer.user_dev0 = &
io.chrono;
161 ret = rffcx07x_init(&m_mixer, 26000000, 2000000, RFFCX07X_HD);
162 ret += rffcx07x_set_gate(&m_mixer, 1);
163 ret += rffcx07x_set_lock_gpo(&m_mixer, 1);
200 ret += rffcx07x_enable(&m_mixer, 0, RFFCX07X_PATH2, 1);
201 ret += rffcx07x_set_mix_current(&m_mixer, 2, RFFCX07X_PATH1);
202 ret += rffcx07x_set_freq(&m_mixer, lo_freq, RFFCX07X_PATH1);
203 ret += rffcx07x_enable(&m_mixer, 1, RFFCX07X_PATH1, 1);
216 ret += rffcx07x_enable(&m_mixer, 0, RFFCX07X_PATH1, 1);
217 ret = rffcx07x_set_mix_current(&m_mixer, 2, RFFCX07X_PATH2);
218 ret += rffcx07x_set_freq(&m_mixer, lo_freq, RFFCX07X_PATH2);
219 ret += rffcx07x_enable(&m_mixer, 1, RFFCX07X_PATH2, 1);
249 uint8_t lock =
false;
250 int ret = rffcx07x_get_lock(&m_mixer, &lock);
251 return lock && ret == RFFCX07X_NO_ERROR;
Chrono device abstraction.
virtual void delay_us(size_t us)=0
Delays the execution of the active task for at least us microseconds.
virtual void set(bool s)=0
Sets the logical output of the pin. For example, if the pin has been configured as active low,...
virtual bool get()=0
Gets the logical level of the GPIO pin. For example, if the pin has been configured as active low,...
@ OUTPUT
GPIO pin is configured as output.
@ INPUT
GPIO pin is configured as input.
virtual void set_direction(direction dir)=0
Set the direction of the GPIO.
Generic exception indicating an invalid argument.
Exception occurred when the RF mixer fails to lock.
Manages power supplies and monitors subsystem status.
IO configuration for controlling the various peripherals of the S-Band frontend.
Exception for the S-Band RF-frontend.
void set_direction(dir d, uint64_t lo_freq)
rf_frontend24(const params &init_params, const io_conf &io, power &pwr)
Construct a new rf frontend24::rf frontend24 object that controls the S-Band RF frontend interface.
bool mixer_lock()
Checks if the RF mixer has acquired a lock.
void enable(bool set=true)
bool enabled() const
Checks if the S-Band RF frontend is enabled.
RF frontend initialization settings.
rf_frontend(const params &init_params, io_conf &&io, power &pwr)
int rffcx07x_set_sda_dir(struct rffcx07x *h, rffcx07x_sda_dir_t dir)
int rffcx07x_set_mode(struct rffcx07x *h, uint8_t enable)
void rffcx07x_en_irq(struct rffcx07x *h, uint8_t enable)
int rffcx07x_set_clk(struct rffcx07x *h, uint8_t enable)
void rffcx07x_delay_us(struct rffcx07x *h, uint32_t us)
int rffcx07x_set_enbl(struct rffcx07x *h, uint8_t enable)
int rffcx07x_set_enx(struct rffcx07x *h, uint8_t enable)
int rffcx07x_get_sda(struct rffcx07x *h)
int rffcx07x_set_sda(struct rffcx07x *h, uint8_t enable)
int rffcx07x_set_resetx(struct rffcx07x *h, uint8_t enable)