Tuesday, 12 November 2013

DEVICE TREE STRUCTURE(.dts file)USING PINMUX FOR BEAGLEBONE BLACK


THE PINMUX SETTING,BEAGLEBONE BLACK MODE AND PIN NO SELECTION CAN BE DONE  WHICH WILL BE LATER CONVERTED TO THE OBJECT FILE USING THIS SOURCE FILE.SO BASED ON THE REQUIREMENT IN UR PROJECT YOU USE THE PINS.AND RUN THE CODE IN TERMINAL WHICH SHOULD BE SAVED IN .dts EXTENTION,HERE IN DOWN WE USED IT FOR THE LED GLOWING A SIMPLE PROGRAM WE USED ONLY 5 GPIO PINS THOSE ARE GPIO15,GPIO45.GPIO60,GPIO44 AND GPIO23.



/*

* Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Purpose License Version 2 as
* published by the Free Software Foundation
*
* Original from: github.com/jadonk/validation-scripts/blob/master/test-capemgr/
*
* Modified by ABHISHEK GOWDA for the example 
* that maps GPIO pins for the example(HERE WE WILL BE USING THE REQUIRED PIN WITH GIVING THE INPUT MODE AND THE PIN NO)
*/

/dts-v1/;

/plugin/;

/{

       compatible = "ti,beaglebone", "ti,beaglebone-black";
       part-number = "DM-GPIO-Test";
       version = "00A0";

       fragment@0 {

             target = <&am33xx_pinmux>;
            
             __overlay__ {
                  pinctrl_test: DM_GPIO_Test_Pins {
pinctrl-single,pins = <


//the required pin address can be given here which u gonna use in ur project


0x078 0x07 /* P9_12 60 OUTPUT MODE7 - The LED Output */

0x184 0x07 /* P9_24 15 INPUT MODE7 none - The Button Input */
0x034 0x07 /* P8_11 45 INPUT MODE7 (37)pullup - Yellow Wire */
0x030 0x27 /* P8_12 44 INPUT MODE7 (27)pulldown - Green Wire */
0x024 0x2f /* P8_13 23 INPUT MODE7 (2f)none - White Wire */
                       
                              
>;
};
             };
       };

       fragment@1 {

target = <&ocp>;
__overlay__ {
test_helper: helper {
compatible = "bone-pinmux-helper";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_test>;
status = "okay";
};
};
};
};

No comments:

Post a Comment