Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // export to HAL
- hm2->hm2dpll.pins = hal_malloc(sizeof(hm2_hm2dpll_pins_t));
- ...
- r += hal_pin_float_newf(HAL_IN, &(hm2->hm2dpll.pins->base_freq),
- hm2->llio->comp_id, "%s.hm2dpll.base-freq", hm2->llio->name);
- ...
- r += hal_pin_u32_newf(HAL_IN, &(hm2->hm2dpll.pins->ddssize),
- hm2->llio->comp_id, "%s.hm2dpll.ddsize", hm2->llio->name);
- r += hal_pin_u32_newf(HAL_IN, &(hm2->hm2dpll.pins->prescale),
- hm2->llio->comp_id, "%s.hm2dpll.prescale", hm2->llio->name);
- ...
- void hm2_hm2dpll_write(hostmot2_t *hm2, long period) {
- hm2_hm2dpll_pins_t *pins;
- double period_ms = period / 1000;
- u32 buff;
- if (hm2->hm2dpll.num_instances == 0) return;
- pins = hm2->hm2dpll.pins;
- buff = (u32)(*hm2->hm2dpll.pins->base_freq * period * 1e-6)
- / (( 1 << *pins->ddssize) * *pins->prescale);
- if (buff != hm2->hm2dpll.base_rate_written){
- hm2->llio->write(hm2->llio,
- hm2->hm2dpll.base_rate_addr,
- &buff,
- sizeof(u32));
- HM2_PRINT("setting base rate to %08x\n", buff);
- hm2->hm2dpll.base_rate_written= buff;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement