44 lines
1.2 KiB
C
Raw Normal View History

2020-07-11 10:18:03 +08:00
/******************************************************************************
* @brief <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˸<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(dev, motor, buzzer)<EFBFBD><EFBFBD><EFBFBD>(dev, motor, buzzer)<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*
* Copyright (c) 2019, <master_roger@sina.com>
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2019-04-01 Morro Initial version
******************************************************************************/
#ifndef _BLINK_H_
#define _BLINK_H_
#include "module.h"
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
/*Blink <20><EFBFBD><E8B1B8><EFBFBD><EFBFBD>*/
typedef struct blink_dev {
unsigned short ontime; /*<2A><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>*/
unsigned short offtime; /*<2A>ر<EFBFBD>ʱ<EFBFBD><CAB1>*/
unsigned short repeats; /*<2A>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD>*/
unsigned char count;
unsigned char enable;
unsigned int tick;
void (*ioctrl)(bool enable); /*io<69><6F><EFBFBD>ƽӿ<C6BD>*/
struct blink_dev *next;
}blink_dev_t;
void blink_dev_create(blink_dev_t *dev, void (*ioctrl)(bool enable));
void blink_dev_ctrl(blink_dev_t *dev, int ontime, int offtime, int repeat);
void blink_dev_process(void);
#ifdef __cplusplus
}
#endif
#endif