feat: KT mBMS 펌웨어 3종(HW1/2/3) 및 통합 빌드 환경 초기 커밋 (V4.0.0.1)
This commit is contained in:
65
APP_R3323/App/Hardware/buzzer.c
Normal file
65
APP_R3323/App/Hardware/buzzer.c
Normal file
@@ -0,0 +1,65 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @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.
|
||||
*
|
||||
* <h2><center>© COPYRIGHT 2022 AMG</center></h2>
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/** @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******/
|
||||
Reference in New Issue
Block a user