| FRDM-KW40Z Demo Software Reference Manual Rev 0.0 NXP Semiconductors |

Files | Macros | Enumerations | Functions
LED Control

## Overview

This module provides the functions to control the FRDM-KW40Z board LED functionality.

The available actions are:

- Initialize the LED module
- Turn the LEDs On/Off
- Toggle the LEDs

## Files
file | led_control.h

## Macros
#define | LED_CONTROL_NUMBER_OF_LEDS

## Enumerations
enum | led_control_status_t { kStatusOk, kStatusLedNumberOutOfRange, kStatusInvalidCommand, kStatusUnexpectedError }
enum | led_control_command_t { kLedControlOff, kLedControlOn, kLedControlToggle, kLedControlInvalidCommand }

## Functions
void | led_control_init (void)
led_control_status_t | led_control_update_led (uint8_t ledNumber, led_control_command_t command)

## Macro Definition Documentation

#define LED_CONTROL_NUMBER_OF_LEDS

Number of LEDs on the board.

## Enumeration Type Documentation

enum led_control_status_t

Enumeration of all possible return status for the LED Control functions.

Enumerator
kStatusOk | No errors.
kStatusLedNumberOutOfRange | LED number is out of range.
kStatusInvalidCommand | Invalid Command.
kStatusUnexpectedError | Unexpected error.

enum led_control_command_t

Enumeration of all available commands.

Enumerator
kLedControlOff | Turn off the LED.
kLedControlOn | Turn on the LED.
kLedControlToggle | Toggle the LED.
kLedControlInvalidCommand | Invalid command.

## Function Documentation

void led_control_init | ( | void |  | ) |

Initializes all hardware required for the LED control

Parameters

  [in] | Void |

Returns
  Void

led_control_status_t led_control_update_led | ( | uint8_t | ledNumber,
|  | led_control_command_t | command
| ) |  |

Updates the LED with the provided data

Parameters

  [in] | ledNumber | The number of LEDs to update
  [in] | command | The action to apply

Returns
  led_control_status_t Error status for the operation.