mirror of
https://gitee.com/moluo-tech/CodeBrick.git
synced 2025-01-30 04:42:53 +08:00
44 lines
1.2 KiB
C
44 lines
1.2 KiB
C
/******************************************************************************
|
||
* @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
|