/**
******************************************************************************
* @file buzzer.c
* @author AMG Energy Solution Team
* @version V1.0.0
* @date 07-Feb-2022
* @brief This file provides all the codes of buzzer control functions.
******************************************************************************
* @attention
*
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
* TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
* DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
* FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
* CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
*
*
© COPYRIGHT 2022 AMG
******************************************************************************
*/
/** @addtogroup mBMS2
* @{
*/
/* Includes ------------------------------------------------------------------*/
#include "buzzer.h"
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Define port and pin for device address */
#define BUZZER_PORT (PortE)
#define BUZZER_PIN (Pin02)
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
//Relay IO Initialize
void Buzzer_Init(void)
{
stc_port_init_t stcPortInit;
/* configuration structure initialization */
MEM_ZERO_STRUCT(stcPortInit);
stcPortInit.enPinMode = Pin_Mode_Out;
stcPortInit.enExInt = Disable;
stcPortInit.enPullUp = Disable;
/* LED Port/Pin initialization */
PORT_Init(BUZZER_PORT, BUZZER_PIN, &stcPortInit);
PORT_ResetBits(BUZZER_PORT, BUZZER_PIN);
}
void Buzzer(uint8_t onoff)
{
if (onoff) PORT_SetBits(BUZZER_PORT, BUZZER_PIN);
else PORT_ResetBits(BUZZER_PORT, BUZZER_PIN);
}
/*******************(C)COPYRIGHT 2022 AMG ********************END OF FILE******/