Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
resources:tools-software:uc-drivers:hmc7044 [07 Feb 2020 09:09] – config Darius Bresources:tools-software:uc-drivers:hmc7044 [07 Feb 2020 12:15] (current) – doxygen Darius B
Line 30: Line 30:
 [[https://github.com/analogdevicesinc/no-OS/blob/master/drivers/frequency/hmc7044/hmc7044.h|drivers/frequency/hmc7044/hmc7044.h]] [[https://github.com/analogdevicesinc/no-OS/blob/master/drivers/frequency/hmc7044/hmc7044.h|drivers/frequency/hmc7044/hmc7044.h]]
  
 +===== Source Code Documentation =====
 +[[http://analogdevicesinc.github.io/no-OS/hmc7044_8c.html|drivers/frequency/hmc7044/hmc7044.c]]
 +
 +[[http://analogdevicesinc.github.io/no-OS/hmc7044_8h.html|drivers/frequency/hmc7044/hmc7044.h]]
 ===== Driver Description ===== ===== Driver Description =====
 The driver implements the necessary routines for managing the device and communicates with the device over an SPI interface. The SPI communication layer is not implemented by the driver and has to be provided by the user at the driver initialization phase. The driver implements the necessary routines for managing the device and communicates with the device over an SPI interface. The SPI communication layer is not implemented by the driver and has to be provided by the user at the driver initialization phase.
Line 50: Line 54:
 ==== Example usage ==== ==== Example usage ====
 <code> <code>
 +        #include "hmc7044.h"
 +
 +        int status;
 +        struct hmc7044_dev* hmc7044_device;
 +
  struct spi_init_param example_spi_init_param = {  struct spi_init_param example_spi_init_param = {
  .max_speed_hz = 10000000,  .max_speed_hz = 10000000,
Line 63: Line 72:
  .coarse_delay = 15  .coarse_delay = 15
  },  },
- /* OUTPUT3 */+ /* OUTPUT1 */
  {  {
- .disable = 0, .num = 3, .divider = 3840, .driver_mode = 1,+ .disable = 0, .num = 1, .divider = 3840, .driver_mode = 1,
  .start_up_mode_dynamic_enable = true,  .start_up_mode_dynamic_enable = true,
  .high_performance_mode_dis = true,  .high_performance_mode_dis = true,
Line 92: Line 101:
  .channels = chan_spec  .channels = chan_spec
  };  };
 +
 + status = hmc7044_init(&hmc7044_device, &hmc7044_param);
 + if (status != SUCCESS) {
 + // ...
 + }
 +
 +        // hmc7044 is now initialized according to the hmc7044_param structure.
 +        // you may use the remainder of the driver interface to control the device:
 +        //         hmc7044_clk_set_rate()
 +        //         hmc7044_clk_round_rate()
 +        //         hmc7044_clk_recalc_rate()
 +        
 +        // This example sets the outputs 0 and 1 to explicit clock values.
 +        // The driver will try its best to select appropriate dividers so as to 
 +        // obtain the desired frequency.
 +        hmc7044_clk_set_rate(hmc7044_device, 0, 245760000);
 +        hmc7044_clk_set_rate(hmc7044_device, 1, 768000);
 +
 +        hmc7044_remove(hmc7044_device);
 +
 </code> </code>
  
resources/tools-software/uc-drivers/hmc7044.1581062957.txt.gz · Last modified: 07 Feb 2020 09:09 by Darius B