GadgetSeed  0.9.6
tim3_buzzer.c ファイル

圧電ブザードライバ [詳解]

#include "sysconfig.h"
#include "device.h"
#include "device/buzzer_ioctl.h"
#include "timer.h"
#include "tkprintf.h"
#include "stm32f4xx_hal.h"
tim3_buzzer.c の依存先関係図:

[ソースコード]

関数

void MX_TIM3_Init (void)
 
void HAL_TIM_Base_MspInit (TIM_HandleTypeDef *htim_base)
 
void start_tim3 (void)
 
void on_buzzer (long cycle)
 
void off_buzzer (void)
 
static int buzzer_register (struct st_device *dev, char *param)
 
static int buzzer_unregister (struct st_device *dev)
 
static int buzzer_open (struct st_device *dev)
 
static int buzzer_close (struct st_device *dev)
 
static int buzzer_ioctl (struct st_device *dev, unsigned int com, unsigned int arg, void *param)
 
static int buzzer_suspend (struct st_device *dev)
 
static int buzzer_resume (struct st_device *dev)
 

変数

TIM_HandleTypeDef htim3
 
const struct st_device buzzer_device
 

詳解

圧電ブザードライバ

日付
2015.08.23
著者
Takashi SHUDO

接続

圧電ブザー STM32F4(CPU PIN)


DIN PB1(27pin)

ブザー音のパルスはTIM3で作成

使用方法

ioctl(0:Off/1:On, 周波数(Hz))

tim3_buzzer.c に定義があります。

変数詳解

◆ buzzer_device

const struct st_device buzzer_device
初期値:
= {
.explan = "STM32F4 TIM3 buzzer",
.register_dev = buzzer_register,
.unregister_dev = buzzer_unregister,
.open = buzzer_open,
.close = buzzer_close,
.ioctl = buzzer_ioctl,
.suspend = buzzer_suspend,
.resume = buzzer_resume,
}
#define DEF_DEV_NAME_BUZZER
標準ブザーデバイス名
Definition: buzzer_ioctl.h:15

tim3_buzzer.c166 行目に定義があります。