2020-07-11 10:18:03 +08:00

44 lines
1.2 KiB
C
Raw 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.

/******************************************************************************
* @brief <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˸<EFBFBD><CBB8><EFBFBD><EFBFBD>(dev, motor, buzzer)<29><><EFBFBD>豸(dev, motor, buzzer)<29><><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