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

Files | Macros | Enumerations | Functions
Buzzer

## Overview

Buzzer module implements functions to control a DC buzzer using PWM.

## Files
file | buzzer_driver.h

## Macros
#define | BUZZER_DRIVER_PWM_CHANNEL
#define | BUZZER_DRIVER_TPM_MODULE
#define | BUZZER_DRIVER_FREQUENCY_HZ

## Enumerations
enum | buzzer_driver_status_t { kBuzzerDriverOk, kBuzzerDriverInitError, kBuzzerPwmStartError }

## Functions
buzzer_driver_status_t | buzzer_driver_init (void)
buzzer_driver_status_t | buzzer_driver_change_buzzer_status (uint8_t buzzerStatus)

## Macro Definition Documentation

#define BUZZER_DRIVER_PWM_CHANNEL

TPM PWM channel to use.

#define BUZZER_DRIVER_TPM_MODULE

TPM module to use.

#define BUZZER_DRIVER_FREQUENCY_HZ

Buzzer signal frequency in Hz.

## Enumeration Type Documentation

enum buzzer_driver_status_t

Buzzer driver status.

Enumerator
kBuzzerDriverOk | No error.
kBuzzerDriverInitError | Error during initialization.
kBuzzerPwmStartError | Error starting the PWM channel.

## Function Documentation

buzzer_driver_status_t buzzer_driver_init | ( | void |  | ) |

Initializes the Buzzer driver

Parameters

  [in] | None |

Returns
  buzzer_driver_status_t Error status

buzzer_driver_status_t buzzer_driver_change_buzzer_status | ( | uint8_t | buzzerStatus | ) |

Change the current buzzer status

Parameters

  [in] | buzzerStatus | The buzzer status to set (0: Off, 1: On)

Returns
  buzzer_driver_status_t Error status