eecs-bsp-test-code-2/inc/hall.h

24 lines
1.4 KiB
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**********************************hall V2.0 说明 ************************************************************************
Hall模块用于获取“STC-B学习板”上hall传感器状态。hall模块共提供1个加载函数、1个应用函数一个Hall事件enumEventHall
1HallInit()hall模块初始化函数
2unsigned char GetHallAct(void)获取hall事件。
函数返回值:
enumHallNull无变化
enumHallGetClose磁场接近
enumHallGetAway磁场离开
查询一次后,事件值变成enumEventHall (仅查询一次有效)
3hall传感器事件
当Hall检测到有"磁场接近"或"磁场离开"事件时将产生一个Hall传感器事件(enumEventHall).响应事件的用户处理函数由用户编写, 并有sys中提供的SetEventCallBack()函数设置事件响应函数.
编写徐成电话18008400450 2021年3月15日设计 2021年3月26日修改
*/
#ifndef _hall_H_
#define _hall_H_
extern void HallInit(void); //加载hall模块
extern unsigned char GetHallAct(void); //获取hall事件
enum HallActName {enumHallNull,enumHallGetClose,enumHallGetAway}; //返回值enumHallNull——无enumHallGetClose——下降沿磁场接近enumHallGetAway——上升沿磁场离开
#endif