Difference between revisions of "Component: PWM Free (Peripheral CAL)"

From Flowcode Help
Jump to navigationJump to search
Line 78: Line 78:
  
 
Example showing how to build a component using a CAL component [[Using_CAL_Components|Using CAL Components]].
 
Example showing how to build a component using a CAL component [[Using_CAL_Components|Using CAL Components]].
 +
 +
  
  
Line 84: Line 86:
 
==Macro reference==
 
==Macro reference==
  
 +
===GetValue===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 102: Line 105:
  
  
 +
===ChangePeriod===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 125: Line 129:
  
  
 +
===Disable===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 138: Line 143:
  
  
 +
===SetDuty8Bit===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 156: Line 162:
  
  
 +
===Enable===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 169: Line 176:
  
  
 +
===SetValue===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 192: Line 200:
  
  
 +
===SetDuty10Bit===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 210: Line 219:
  
  
 +
===GetList===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-

Revision as of 11:51, 3 February 2023

Author Matrix Ltd
Version 1.3
Category Peripheral CAL


PWM Free component

A low level implementation giving direct access to the CAL

Component Source Code

Please click here to download the component source project: FC_Comp_Source_PWM_Free.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_PWM_Free.fcfx

Detailed description

No detailed description exists yet for this component

Examples

Example showing how to build a component using a CAL component Using CAL Components.




Macro reference

GetValue

Fc9-comp-macro.png GetValue
Returns Named property Value  
Fc9-string-icon.png - STRING Name
 
Fc9-string-icon.png - STRING Return


ChangePeriod

Fc9-comp-macro.png ChangePeriod
Change the Period (and prescaler) for this PWM Channel 
Fc9-u16-icon.png - UINT period
period value PIC/AVR: 0-255 16-bit PIC: 0-65535 
Fc9-u16-icon.png - UINT prescaler
prescaler 1,4,16,64 
Fc9-void-icon.png - VOID Return


Disable

Fc9-comp-macro.png Disable
Disable this PWM Channel 
Fc9-void-icon.png - VOID Return


SetDuty8Bit

Fc9-comp-macro.png SetDuty8Bit
Set the Duty cycle (0-255) for this PWM Channel 
Fc9-u8-icon.png - BYTE duty
duty value 0 - 255 
Fc9-void-icon.png - VOID Return


Enable

Fc9-comp-macro.png Enable
Enable this PWM Channel 
Fc9-void-icon.png - VOID Return


SetValue

Fc9-comp-macro.png SetValue
Sets the Value of the property PERIOD, PRESCALE or CHANNEL (if CHANNEL also updates the PORT from FCD)  
Fc9-string-icon.png - STRING Name
 
Fc9-string-icon.png - STRING Value
 
Fc9-void-icon.png - VOID Return


SetDuty10Bit

Fc9-comp-macro.png SetDuty10Bit
Set the Duty Cycle for this PWM Channel. PIC/AVR - Range: 0-1023 16-bit PIC - Range: 0-65535 
Fc9-u16-icon.png - UINT duty
Duty value 0 - 1023 
Fc9-void-icon.png - VOID Return


GetList

Fc9-comp-macro.png GetList
Returns CHANNEL or PRESCALE list from the FCD and updates the internal property  
Fc9-string-icon.png - STRING Name
 
Fc9-string-icon.png - STRING Return



Property reference

Fc9-prop-icon.png Properties
Fc9-type-16-icon.png Channel
PWM Channel selector 
Fc9-type-16-icon.png Alt Pin Enable
Alternative Pin Enable (if available on target device) 
Fc9-type-5-icon.png Port
 
Fc9-type-14-icon.png Period Register
PWM Period Register value 
Fc9-type-16-icon.png Prescaler Divide
Prescaler Divider value 
Fc9-type-16-icon.png PWM Timer
Timer associated with PWM to drive the output. Warning - All PWM channels linked to the same timer will share the same period and prescaler settings. 
Fc9-type-14-icon.png Clock Speed
 
Fc9-type-15-icon.png Period (uS)
 
Fc9-type-15-icon.png Frequency (KHz)
 
Fc9-type-14-icon.png Master Divider