kinetis: Refactor PWM periph implementation
kinetis: Refactor PWM periph implementation

 - Set the proper prescaler value depending on requested frequency
 - Return the actual achieved frequency in pwm_init
 - Handle 1-8 channels depending on periph_conf.h instead of 4 fixed
 - Perform function argument verification before touching the hardware
 - Turn on PORT clock gate before touching PORT registers
 - Eliminate some magic numbers

rajma996/RIOT,mtausig/RIOT,biboc/RIOT,msolters/RIOT,ThanhVic/RIOT,toonst/RIOT,rakendrathapa/RIOT,mziegert/RIOT,adrianghc/RIOT,foss-for-synopsys-dwc-arc-processors/RIOT,MohmadAyman/RIOT,thiagohd/RIOT,asanka-code/RIOT,herrfz/RIOT,JensErdmann/RIOT,Lexandro92/RIOT-CoAP,jbeyerstedt/RIOT-OTA-update,ThanhVic/RIOT,gbarnett/RIOT,kaspar030/RIOT,RIOT-OS/RIOT,miri64/RIOT,basilfx/RIOT,zhuoshuguo/RIOT,lazytech-org/RIOT,rfuentess/RIOT,dkm/RIOT,neumodisch/RIOT,msolters/RIOT,yogo1212/RIOT,l3nko/RIOT,d00616/RIOT,toonst/RIOT,JensErdmann/RIOT,Ell-i/RIOT,roberthartung/RIOT,avmelnikoff/RIOT,JensErdmann/RIOT,mtausig/RIOT,ks156/RIOT,A-Paul/RIOT,stevenj/RIOT,kaleb-himes/RIOT,RubikonAlpha/RIOT,wentaoshang/RIOT,LudwigKnuepfer/RIOT,gebart/RIOT,MarkXYang/RIOT,lebrush/RIOT,kushalsingh007/RIOT,OTAkeys/RIOT,rousselk/RIOT,MonsterCode8000/RIOT,openkosmosorg/RIOT,smlng/RIOT,MarkXYang/RIOT,gebart/RIOT,gautric/RIOT,lebrush/RIOT,d00616/RIOT,thomaseichinger/RIOT,TobiasFredersdorf/RIOT,ant9000/RIOT,TobiasFredersdorf/RIOT,biboc/RIOT,EmuxEvans/RIOT,lazytech-org/RIOT,cladmi/RIOT,l3nko/RIOT,PSHIVANI/Riot-Code,altairpearl/RIOT,openkosmosorg/RIOT,katezilla/RIOT,latsku/RIOT,miri64/RIOT,stevenj/RIOT,dailab/RIOT,malosek/RIOT,msolters/RIOT,kaspar030/RIOT,dailab/RIOT,cladmi/RIOT,altairpearl/RIOT,kYc0o/RIOT,ant9000/RIOT,rakendrathapa/RIOT,dhruvvyas90/RIOT,neiljay/RIOT,LudwigOrtmann/RIOT,basilfx/RIOT,patkan/RIOT,khhhh/RIOT,herrfz/RIOT,immesys/RiSyn,binarylemon/RIOT,ntrtrung/RIOT,d00616/RIOT,neiljay/RIOT,authmillenon/RIOT,bartfaizoltan/RIOT,foss-for-synopsys-dwc-arc-processors/RIOT,syin2/RIOT,Darredevil/RIOT,attdona/RIOT,haoyangyu/RIOT,jremmert-phytec-iot/RIOT,Yonezawa-T2/RIOT,yogo1212/RIOT,RubikonAlpha/RIOT,kaspar030/RIOT,yogo1212/RIOT,sgso/RIOT,kb2ma/RIOT,ximus/RIOT,cladmi/RIOT,kYc0o/RIOT,changbiao/RIOT,biboc/RIOT,rajma996/RIOT,beurdouche/RIOT,josephnoir/RIOT,thiagohd/RIOT,jfischer-phytec-iot/RIOT,tfar/RIOT,centurysys/RIOT,ThanhVic/RIOT,attdona/RIOT,RBartz/RIOT,openkosmosorg/RIOT,alex1818/RIOT,khhhh/RIOT,sgso/RIOT,Josar/RIOT,gautric/RIOT,Darredevil/RIOT,phiros/RIOT,DipSwitch/RIOT,avmelnikoff/RIOT,BytesGalore/RIOT,jasonatran/RIOT,mtausig/RIOT,dhruvvyas90/RIOT,chris-wood/RIOT,abp719/RIOT,beurdouche/RIOT,rfswarm/RIOT,MonsterCode8000/RIOT,ks156/RIOT,DipSwitch/RIOT,shady33/RIOT,mziegert/RIOT,gbarnett/RIOT,lebrush/RIOT,RIOT-OS/RIOT,authmillenon/RIOT,zhuoshuguo/RIOT,jferreir/RIOT,gautric/RIOT,rfswarm/RIOT,koenning/RIOT,LudwigOrtmann/RIOT,ximus/RIOT,kerneltask/RIOT,immesys/RiSyn,kushalsingh007/RIOT,thiagohd/RIOT,LudwigOrtmann/RIOT,tfar/RIOT,adjih/RIOT,koenning/RIOT,BytesGalore/RIOT,TobiasFredersdorf/RIOT,avmelnikoff/RIOT,PSHIVANI/Riot-Code,tdautc19841202/RIOT,dhruvvyas90/RIOT,BytesGalore/RIOT,Yonezawa-T2/RIOT,adjih/RIOT,kaspar030/RIOT,shady33/RIOT,FrancescoErmini/RIOT,khhhh/RIOT,EmuxEvans/RIOT,fnack/RIOT,LudwigOrtmann/RIOT,RIOT-OS/RIOT,LudwigKnuepfer/RIOT,josephnoir/RIOT,msolters/RIOT,haoyangyu/RIOT,benoit-canet/RIOT,centurysys/RIOT,ThanhVic/RIOT,zhuoshuguo/RIOT,jbeyerstedt/RIOT-OTA-update,brettswann/RIOT,koenning/RIOT,luciotorre/RIOT,arvindpdmn/RIOT,herrfz/RIOT,latsku/RIOT,ntrtrung/RIOT,OlegHahm/RIOT,rfswarm/RIOT,gbarnett/RIOT,OTAkeys/RIOT,kushalsingh007/RIOT,aeneby/RIOT,authmillenon/RIOT,josephnoir/RIOT,neumodisch/RIOT,Josar/RIOT,FrancescoErmini/RIOT,roberthartung/RIOT,automote/RIOT,jfischer-phytec-iot/RIOT,DipSwitch/RIOT,altairpearl/RIOT,thiagohd/RIOT,Lexandro92/RIOT-CoAP,l3nko/RIOT,sgso/RIOT,rfuentess/RIOT,changbiao/RIOT,kYc0o/RIOT,roberthartung/RIOT,wentaoshang/RIOT,abp719/RIOT,phiros/RIOT,brettswann/RIOT,tdautc19841202/RIOT,LudwigKnuepfer/RIOT,BytesGalore/RIOT,centurysys/RIOT,PSHIVANI/Riot-Code,authmillenon/RIOT,d00616/RIOT,kaleb-himes/RIOT,chris-wood/RIOT,marcosalm/RIOT,RubikonAlpha/RIOT,automote/RIOT,immesys/RiSyn,abkam07/RIOT,OlegHahm/RIOT,stevenj/RIOT,robixnai/RIOT,benoit-canet/RIOT,jasonatran/RIOT,phiros/RIOT,MohmadAyman/RIOT,x3ro/RIOT,abkam07/RIOT,latsku/RIOT,ximus/RIOT,tfar/RIOT,dkm/RIOT,PSHIVANI/Riot-Code,haoyangyu/RIOT,kaspar030/RIOT,malosek/RIOT,FrancescoErmini/RIOT,Ell-i/RIOT,RIOT-OS/RIOT,Ell-i/RIOT,smlng/RIOT,Darredevil/RIOT,daniel-k/RIOT,zhuoshuguo/RIOT,Osblouf/RIOT,aeneby/RIOT,Hyungsin/RIOT-OS,dailab/RIOT,alignan/RIOT,MarkXYang/RIOT,daniel-k/RIOT,wentaoshang/RIOT,abp719/RIOT,lebrush/RIOT,MonsterCode8000/RIOT,mfrey/RIOT,ks156/RIOT,Hyungsin/RIOT-OS,shady33/RIOT,Osblouf/RIOT,syin2/RIOT,tdautc19841202/RIOT,MohmadAyman/RIOT,LudwigOrtmann/RIOT,automote/RIOT,DipSwitch/RIOT,koenning/RIOT,josephnoir/RIOT,altairpearl/RIOT,jferreir/RIOT,kb2ma/RIOT,thomaseichinger/RIOT,foss-for-synopsys-dwc-arc-processors/RIOT,adjih/RIOT,kerneltask/RIOT,hamilton-mote/RIOT-OS,rfswarm/RIOT,benoit-canet/RIOT,khhhh/RIOT,gbarnett/RIOT,watr-li/RIOT,biboc/RIOT,aeneby/RIOT,syin2/RIOT,phiros/RIOT,mtausig/RIOT,Osblouf/RIOT,haoyangyu/RIOT,A-Paul/RIOT,Hyungsin/RIOT-OS,neumodisch/RIOT,bartfaizoltan/RIOT,RBartz/RIOT,watr-li/RIOT,patkan/RIOT,khhhh/RIOT,DipSwitch/RIOT,EmuxEvans/RIOT,neumodisch/RIOT,jremmert-phytec-iot/RIOT,watr-li/RIOT,neumodisch/RIOT,hamilton-mote/RIOT-OS,RBartz/RIOT,d00616/RIOT,marcosalm/RIOT,Lexandro92/RIOT-CoAP,sumanpanchal/RIOT,A-Paul/RIOT,chris-wood/RIOT,miri64/RIOT,kaleb-himes/RIOT,automote/RIOT,jferreir/RIOT,sgso/RIOT,miri64/RIOT,rousselk/RIOT,mfrey/RIOT,benoit-canet/RIOT,immesys/RiSyn,robixnai/RIOT,smlng/RIOT,ThanhVic/RIOT,thomaseichinger/RIOT,jferreir/RIOT,Hyungsin/RIOT-OS,shady33/RIOT,adjih/RIOT,A-Paul/RIOT,kushalsingh007/RIOT,changbiao/RIOT,phiros/RIOT,EmuxEvans/RIOT,benoit-canet/RIOT,sumanpanchal/RIOT,fnack/RIOT,patkan/RIOT,marcosalm/RIOT,JensErdmann/RIOT,toonst/RIOT,malosek/RIOT,daniel-k/RIOT,rakendrathapa/RIOT,wentaoshang/RIOT,jfischer-phytec-iot/RIOT,MohmadAyman/RIOT,jferreir/RIOT,bartfaizoltan/RIOT,kushalsingh007/RIOT,neiljay/RIOT,RubikonAlpha/RIOT,FrancescoErmini/RIOT,asanka-code/RIOT,kaleb-himes/RIOT,plushvoxel/RIOT,attdona/RIOT,patkan/RIOT,arvindpdmn/RIOT,FrancescoErmini/RIOT,jasonatran/RIOT,neiljay/RIOT,dhruvvyas90/RIOT,haoyangyu/RIOT,immesys/RiSyn,foss-for-synopsys-dwc-arc-processors/RIOT,rfuentess/RIOT,rfswarm/RIOT,TobiasFredersdorf/RIOT,gebart/RIOT,RubikonAlpha/RIOT,abp719/RIOT,mfrey/RIOT,brettswann/RIOT,binarylemon/RIOT,haoyangyu/RIOT,rakendrathapa/RIOT,patkan/RIOT,smlng/RIOT,jbeyerstedt/RIOT-OTA-update,jferreir/RIOT,kYc0o/RIOT,openkosmosorg/RIOT,l3nko/RIOT,rousselk/RIOT,khhhh/RIOT,kerneltask/RIOT,gbarnett/RIOT,kb2ma/RIOT,MarkXYang/RIOT,zhuoshuguo/RIOT,hamilton-mote/RIOT-OS,d00616/RIOT,abkam07/RIOT,rfuentess/RIOT,dhruvvyas90/RIOT,tdautc19841202/RIOT,rousselk/RIOT,Lexandro92/RIOT-CoAP,backenklee/RIOT,jremmert-phytec-iot/RIOT,x3ro/RIOT,shady33/RIOT,backenklee/RIOT,Yonezawa-T2/RIOT,Darredevil/RIOT,tdautc19841202/RIOT,Ell-i/RIOT,jasonatran/RIOT,toonst/RIOT,adrianghc/RIOT,sumanpanchal/RIOT,alignan/RIOT,backenklee/RIOT,stevenj/RIOT,OlegHahm/RIOT,EmuxEvans/RIOT,rfswarm/RIOT,jbeyerstedt/RIOT-OTA-update,sumanpanchal/RIOT,adrianghc/RIOT,BytesGalore/RIOT,plushvoxel/RIOT,x3ro/RIOT,kbumsik/RIOT,stevenj/RIOT,syin2/RIOT,malosek/RIOT,rfuentess/RIOT,wentaoshang/RIOT,arvindpdmn/RIOT,toonst/RIOT,zhuoshuguo/RIOT,abkam07/RIOT,OTAkeys/RIOT,ximus/RIOT,PSHIVANI/Riot-Code,kbumsik/RIOT,bartfaizoltan/RIOT,marcosalm/RIOT,OlegHahm/RIOT,Darredevil/RIOT,roberthartung/RIOT,luciotorre/RIOT,luciotorre/RIOT,hamilton-mote/RIOT-OS,LudwigKnuepfer/RIOT,adrianghc/RIOT,alex1818/RIOT,JensErdmann/RIOT,Yonezawa-T2/RIOT,altairpearl/RIOT,fnack/RIOT,marcosalm/RIOT,abkam07/RIOT,gebart/RIOT,aeneby/RIOT,plushvoxel/RIOT,malosek/RIOT,sgso/RIOT,yogo1212/RIOT,mfrey/RIOT,chris-wood/RIOT,thiagohd/RIOT,jremmert-phytec-iot/RIOT,brettswann/RIOT,avmelnikoff/RIOT,smlng/RIOT,herrfz/RIOT,dhruvvyas90/RIOT,alignan/RIOT,lazytech-org/RIOT,tfar/RIOT,mziegert/RIOT,mtausig/RIOT,gbarnett/RIOT,attdona/RIOT,brettswann/RIOT,OTAkeys/RIOT,RBartz/RIOT,phiros/RIOT,rousselk/RIOT,brettswann/RIOT,Osblouf/RIOT,centurysys/RIOT,mfrey/RIOT,ks156/RIOT,l3nko/RIOT,fnack/RIOT,abkam07/RIOT,ks156/RIOT,alignan/RIOT,alignan/RIOT,rajma996/RIOT,centurysys/RIOT,Darredevil/RIOT,plushvoxel/RIOT,watr-li/RIOT,x3ro/RIOT,marcosalm/RIOT,kerneltask/RIOT,patkan/RIOT,adjih/RIOT,RBartz/RIOT,adrianghc/RIOT,rousselk/RIOT,mziegert/RIOT,changbiao/RIOT,foss-for-synopsys-dwc-arc-processors/RIOT,dkm/RIOT,bartfaizoltan/RIOT,rajma996/RIOT,Lexandro92/RIOT-CoAP,robixnai/RIOT,Osblouf/RIOT,asanka-code/RIOT,abp719/RIOT,sgso/RIOT,kushalsingh007/RIOT,latsku/RIOT,jremmert-phytec-iot/RIOT,Yonezawa-T2/RIOT,wentaoshang/RIOT,katezilla/RIOT,chris-wood/RIOT,daniel-k/RIOT,syin2/RIOT,ThanhVic/RIOT,centurysys/RIOT,kb2ma/RIOT,basilfx/RIOT,beurdouche/RIOT,MohmadAyman/RIOT,ant9000/RIOT,miri64/RIOT,ntrtrung/RIOT,ant9000/RIOT,yogo1212/RIOT,alex1818/RIOT,kbumsik/RIOT,MonsterCode8000/RIOT,Josar/RIOT,lazytech-org/RIOT,lazytech-org/RIOT,attdona/RIOT,Hyungsin/RIOT-OS,roberthartung/RIOT,jfischer-phytec-iot/RIOT,kbumsik/RIOT,tdautc19841202/RIOT,arvindpdmn/RIOT,EmuxEvans/RIOT,avmelnikoff/RIOT,attdona/RIOT,kaleb-himes/RIOT,authmillenon/RIOT,kbumsik/RIOT,MonsterCode8000/RIOT,JensErdmann/RIOT,x3ro/RIOT,binarylemon/RIOT,ximus/RIOT,ntrtrung/RIOT,jfischer-phytec-iot/RIOT,benoit-canet/RIOT,binarylemon/RIOT,jremmert-phytec-iot/RIOT,josephnoir/RIOT,katezilla/RIOT,fnack/RIOT,TobiasFredersdorf/RIOT,tfar/RIOT,watr-li/RIOT,beurdouche/RIOT,fnack/RIOT,cladmi/RIOT,sumanpanchal/RIOT,rakendrathapa/RIOT,koenning/RIOT,MohmadAyman/RIOT,binarylemon/RIOT,herrfz/RIOT,abp719/RIOT,bartfaizoltan/RIOT,lebrush/RIOT,mziegert/RIOT,openkosmosorg/RIOT,binarylemon/RIOT,jbeyerstedt/RIOT-OTA-update,katezilla/RIOT,robixnai/RIOT,mziegert/RIOT,OTAkeys/RIOT,stevenj/RIOT,basilfx/RIOT,asanka-code/RIOT,alex1818/RIOT,gautric/RIOT,openkosmosorg/RIOT,DipSwitch/RIOT,Josar/RIOT,MarkXYang/RIOT,msolters/RIOT,backenklee/RIOT,beurdouche/RIOT,LudwigOrtmann/RIOT,RIOT-OS/RIOT,plushvoxel/RIOT,FrancescoErmini/RIOT,sumanpanchal/RIOT,gautric/RIOT,automote/RIOT,katezilla/RIOT,MarkXYang/RIOT,neiljay/RIOT,asanka-code/RIOT,latsku/RIOT,luciotorre/RIOT,robixnai/RIOT,neumodisch/RIOT,dkm/RIOT,authmillenon/RIOT,hamilton-mote/RIOT-OS,asanka-code/RIOT,lebrush/RIOT,chris-wood/RIOT,kb2ma/RIOT,RubikonAlpha/RIOT,ant9000/RIOT,gebart/RIOT,herrfz/RIOT,automote/RIOT,shady33/RIOT,thomaseichinger/RIOT,LudwigKnuepfer/RIOT,alex1818/RIOT,arvindpdmn/RIOT,Osblouf/RIOT,changbiao/RIOT,thomaseichinger/RIOT,ntrtrung/RIOT,daniel-k/RIOT,ntrtrung/RIOT,biboc/RIOT,basilfx/RIOT,Lexandro92/RIOT-CoAP,Josar/RIOT,luciotorre/RIOT,RBartz/RIOT,changbiao/RIOT,PSHIVANI/Riot-Code,kerneltask/RIOT,thiagohd/RIOT,malosek/RIOT,OlegHahm/RIOT,robixnai/RIOT,daniel-k/RIOT,koenning/RIOT,rajma996/RIOT,msolters/RIOT,cladmi/RIOT,Ell-i/RIOT,dailab/RIOT,MonsterCode8000/RIOT,altairpearl/RIOT,backenklee/RIOT,ximus/RIOT,yogo1212/RIOT,immesys/RiSyn,alex1818/RIOT,latsku/RIOT,aeneby/RIOT,Yonezawa-T2/RIOT,rakendrathapa/RIOT,jasonatran/RIOT,rajma996/RIOT,l3nko/RIOT,luciotorre/RIOT,watr-li/RIOT,arvindpdmn/RIOT,A-Paul/RIOT,kYc0o/RIOT,dkm/RIOT,dailab/RIOT