Hello Hesam,
Welcome to Freescale MCUs :smileyhappy:.
I think you are going to find very useful the blog of my colleague Erich Styger: www.mcuoneclipse.com
Freescale provides a tool integrated in CodeWarrior called Processor Expert. It is a visual way of configuring each peripheral of the microcontroller, and the tool generates the code for you, so after configuring the peripheral with the visual tool you can examine the code and of course modify or reuse it. It also creates functions to use the peripherals (Get the value from an ADC measurement, send a block of characters from the UART...). It's a really useful tool!
We also have source code examples, you can download the examples for the FRDM-KL46 here:
|
KL46_SC: FRDM-KL46Z and TWR-KL46Z48M Sample Code Package. Size (K): 29476 Format: exe Rev #: 1 Modified: 10/29/2013 | FREESCALE | |  |
If you are interested in processor expert, those are some interesting post from Erich's blog (But he has a lot more!):
MCUs registers watched with Processor Expert
http://mcuoneclipse.com/2013/02/17/processor-expert-configuration-registers-view/
Pins and signals with PEx
http://mcuoneclipse.com/2012/12/29/pin-and-signal-list-with-processor-expert/
How to use PEx components, with examples and descriptions of each function and parameter.
http://mcuoneclipse.com/2012/11/12/getting-help-on-processor-expert-components/