This project serves as a template for work with the Freescale FRDM-KL46 board. Support will be added to all on-board peripherals, sensors and I/O.
Dependencies: FRDM_MMA8451Q MAG3110 TSI mbed
Project Information:
Theory
This project has been created to serve as a template for those who wish to use the Freescale Freedom FRDM-KL46Z board. Existing drivers within mbed have been brought together and board specific configurations for certain inputs and outputs have included.
Libraries
- TSI (source: http://mbed.org/users/emilmont/code/TSI/ ) Capacitive Touch library to support the on-board Touch-Slider
- FRDM_MMA8451Q (source: http://mbed.org/users/clemente/code/FRDM_MMA8451Q/ ) Freescale MMA8451 Accelerometer connected on I2C0
- MAG3110 (source: http://mbed.org/users/mmaas/code/MAG3110/) (based on: http://mbed.org/users/SomeRandomBloke/code/MAG3110/)
TODOs
- Add support for Segment LCD - intend to use driver in example code: http://cache.freescale.com/files/32bit/software/KL46_SC.exe
Hardware Information:
FRDM-KL46Z Information
- User Guide Guide: http://cache.freescale.com/files/microcontrollers/doc/user_guide/FRDM-KL46Z_UM.pdf
- Schematics: http://cache.freescale.com/files/microcontrollers/hardware_tools/schematics/FRDM-KL46Z_SCH.pdf
Freescale Kinetis L-Series Microcontroller Information
- Kinetis KL46 Drop Page: http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=KL4x
- Kinetis KL46 Fact Sheet: http://cache.freescale.com/files/microcontrollers/doc/fact_sheet/LSERIESKL4FS.pdf
- Kinetis KL46 Reference Manual: http://cache.freescale.com/files/microcontrollers/doc/ref_manual/KL46P121M48SF4RM.pdf
- Kinetis KL46 Data Sheet: http://cache.freescale.com/files/microcontrollers/doc/data_sheet/KL46P121M48SF4.pdf
Freescale Sensor Information
MMA8451Q
MAG3110
main.cpp
- Committer:
- mmaas
- Date:
- 2013-12-19
- Revision:
- 2:48ac01f5024d
- Parent:
- 1:28c81db67f50
- Child:
- 3:1e85b49a3e18
File content as of revision 2:48ac01f5024d:
#include "mbed.h" // Include support for USB Serial console Serial pc(USBTX, USBRX); // Include support for on-board green and red LEDs DigitalOut greenLED(LED_GREEN); DigitalOut redLED(LED_RED); // Definitions for LED states (logic inverted output value 0 = O) #define LED_ON 0 #define LED_OFF 1 int main() { // Ensure LEDs are off greenLED = LED_OFF; redLED = LED_OFF; // Set Serial Port data rate and say Hello pc.baud( 230400 ); pc.printf("Hello World\r\n"); // Quick blink LEDs redLED = LED_ON; wait(.05); greenLED = LED_ON; wait(.05); greenLED = LED_OFF; redLED = LED_OFF; wait(1); // Blink LEDs - green first while(1) { greenLED = LED_ON; redLED = LED_OFF; wait(1); greenLED = LED_OFF; redLED = LED_ON; wait(1); } }