Search code examples
system

Can't understand this code — is it C?


Can anyone help me understand this snippet? Is it even C?

lcd_bl: backlight {
    compatible = "pwm";
    level = <8>;
};

Specifically:

  1. What is lcd_bl?

    I am assuming that lcd_bl is a label, but there is no goto lcd_bl. lcd_bl is referenced in this snippet which is in the same file as the one above

    lcd0: display {
        back = <&lcd_bl>;
    };
    
  2. What data structure is backlight?

  3. Why are <> used when assigning a number to a variable?

  4. What is happening in the second snippet?

Any help on this would be appreciated.


Solution

  • Yes, this code is C programming language. It's used for the development of the board AM437x. more info about the board

    take a look at am4372.dtsi,dt-bindings/pinctrl/am43x and pwm C libraries to understand this code if you are a senior C developer otherwise forget about it it's not novice level.