Ray Liu
/
NuMaker-mbed-NuBrick-example
Modify the file main.cpp for M487
Diff: NuMaker-mbed-NuBrick/NuBrickMasterBuzzer.h
- Revision:
- 0:a67fc999dd68
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/NuMaker-mbed-NuBrick/NuBrickMasterBuzzer.h Fri Sep 29 05:44:02 2017 +0000 @@ -0,0 +1,54 @@ +/* mbed Microcontroller Library + * Copyright (c) 2016 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef NUBRICK_MASTER_BUZZER_H +#define NUBRICK_MASTER_BUZZER_H + +#include "mbed.h" +#include "NuBrickMaster.h" + + +/** A NuMaker Brick I2C master, used for communicating with NuMaker Brick I2C slave module Buzzer + * + * @Note Synchronization level: Thread safe + * + * @details Support fields for access through [] operator: + * - feature.sleep_period + * - feature.volume + * - feature.tone + * - feature.song + * - feature.period + * - feature.duty + * - feature.latency + * - input.execute_flag + * - output.start_flag + * - output.stop_flag + */ +class NuBrickMasterBuzzer : public NuBrickMaster { + +public: + + /** Create an I2C interface, connected to the specified pins + * + * @param i2c I2C object + */ + NuBrickMasterBuzzer(I2C &i2c, bool debug); + + virtual ~NuBrickMasterBuzzer() { + // Do nothing + } +}; + +#endif