text: /****************************************************************************
   * Copyright (C) 2012 - 2015 Digi International Inc, All Rights Reserved.
   *
   * This software is provided as instructional material without charge 
   * by Digi International for use by its employees and customers
   * subject to the following terms.
   *
   * PERMISSION
   * Permission is hereby granted, free of charge, to any person obtaining 
   * a copy of this software, to deal with it without restriction, 
   * including without limitation the rights to use, copy,  modify, merge, publish, 
   * distribute, sublicense, and/or sell copies of it, and to permit persons to 
   * whom it is furnished to do so, provided the above copyright notice 
   * and this permission notice are included in all derived works
   * and the use of this software is restricted to Digi products.
   *
   * WARRANTY
   * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
   * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   * FITNESS FOR A PARTICULAR PURPOSE, OR NONINFRINGEMENT.  
   *
   * LIABILITY
   * IN NO EVENT SHALL DIGI INTERNATIONAL BE LIABLE FOR ANY CLAIM, DAMAGES, 
   * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, 
   * ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE, OR THE USE 
   * OR OTHER DEALINGS WITH THE SOFTWARE.
   *
   ****************************************************************************/
  
  #ifndef __PWM_H_
  #define __PWM_H_
  
  #include <tpm.h>
  #include <hardware.h>
  
  int pwm_config(xpin_t pin, bool_t enable, uint32_t ton, uint32_t period);
  int pwm_enable(xpin_t pin, bool_t enable);
  uint32_t pwm_get_period(xpin_t pin);
  uint32_t pwm_get_ton(xpin_t pin);
  uint32_t pwm_set_ton(xpin_t pin, uint32_t ton);
  #endif /* __PWM_H_ */
  