mirror of
https://github.com/oopuuu/zTC1.git
synced 2025-12-17 07:28:14 +08:00
修改了Web后台的部分界面,增加了HAmqtt中的总电量传感器,后台新增mqtt上报频率设置
This commit is contained in:
42
mico-os/libraries/drivers/motor/dc_motor/dc_motor.c
Normal file
42
mico-os/libraries/drivers/motor/dc_motor/dc_motor.c
Normal file
@@ -0,0 +1,42 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file dc_motor.c
|
||||
* @author Eshen Wang
|
||||
* @version V1.0.0
|
||||
* @date 1-May-2015
|
||||
* @brief dc motor operation.
|
||||
******************************************************************************
|
||||
* UNPUBLISHED PROPRIETARY SOURCE CODE
|
||||
* Copyright (c) 2016 MXCHIP Inc.
|
||||
*
|
||||
* The contents of this file may not be disclosed to third parties, copied or
|
||||
* duplicated in any form, in whole or in part, without the prior written
|
||||
* permission of MXCHIP Corporation.
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#include "mico_platform.h"
|
||||
#include "dc_motor.h"
|
||||
|
||||
#define dc_motor_log(M, ...) custom_log("DC_MOTOR", M, ##__VA_ARGS__)
|
||||
#define dc_motor_log_trace() custom_log_trace("DC_MOTOR")
|
||||
|
||||
|
||||
/*------------------------------ USER INTERFACES -----------------------------*/
|
||||
|
||||
int dc_motor_init(void)
|
||||
{
|
||||
return MicoGpioInitialize( DC_MOTOR, OUTPUT_PUSH_PULL );
|
||||
}
|
||||
|
||||
int dc_motor_set(int value)
|
||||
{
|
||||
if (0 == value) {
|
||||
MicoGpioOutputLow( DC_MOTOR );
|
||||
}
|
||||
else {
|
||||
MicoGpioOutputHigh( DC_MOTOR );
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
82
mico-os/libraries/drivers/motor/dc_motor/dc_motor.h
Normal file
82
mico-os/libraries/drivers/motor/dc_motor/dc_motor.h
Normal file
@@ -0,0 +1,82 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file dc_motor.h
|
||||
* @author Eshen Wang
|
||||
* @version V1.0.0
|
||||
* @date 1-May-2015
|
||||
* @brief dc motor operation.
|
||||
******************************************************************************
|
||||
* UNPUBLISHED PROPRIETARY SOURCE CODE
|
||||
* Copyright (c) 2016 MXCHIP Inc.
|
||||
*
|
||||
* The contents of this file may not be disclosed to third parties, copied or
|
||||
* duplicated in any form, in whole or in part, without the prior written
|
||||
* permission of MXCHIP Corporation.
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef __DC_MOTOR_H_
|
||||
#define __DC_MOTOR_H_
|
||||
|
||||
#include "platform.h"
|
||||
|
||||
/** @addtogroup MICO_Drivers_interface
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup MiCO_Motor_Driver MiCO Motor Driver
|
||||
* @brief Provide driver interface for Motor Devices
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup MiCO_Motor_Driver
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup MiCO_DC_Motor_Driver MiCO DC Motor Driver
|
||||
* @brief Provide driver interface for DC Motor
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef DC_MOTOR
|
||||
#define DC_MOTOR (MICO_GPIO_NONE)
|
||||
#endif
|
||||
|
||||
|
||||
//------------------------------ user interfaces -------------------------------
|
||||
|
||||
|
||||
/**
|
||||
* @brief Initialize motor device.
|
||||
*
|
||||
* @return 0 : on success.
|
||||
* @return error code : if an error occurred
|
||||
*/
|
||||
int dc_motor_init(void);
|
||||
|
||||
/**
|
||||
* @brief Set motor state, ON or OFF.
|
||||
*
|
||||
* @param value: 0,motor OFF; others<72><73>motor ON
|
||||
*
|
||||
* @return 0 : on success.
|
||||
* @return error code : if an error occurred
|
||||
*/
|
||||
int dc_motor_set(int value);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
#endif // __DC_MOTOR_H_
|
||||
16
mico-os/libraries/drivers/motor/dc_motor/dc_motor.mk
Normal file
16
mico-os/libraries/drivers/motor/dc_motor/dc_motor.mk
Normal file
@@ -0,0 +1,16 @@
|
||||
#
|
||||
# UNPUBLISHED PROPRIETARY SOURCE CODE
|
||||
# Copyright (c) 2016 MXCHIP Inc.
|
||||
#
|
||||
# The contents of this file may not be disclosed to third parties, copied or
|
||||
# duplicated in any form, in whole or in part, without the prior written
|
||||
# permission of MXCHIP Corporation.
|
||||
#
|
||||
|
||||
NAME := Lib_dc_motor_$(PLATFORM)
|
||||
|
||||
$(NAME)_SOURCES := dc_motor.c
|
||||
|
||||
GLOBAL_INCLUDES := .
|
||||
|
||||
#$(NAME)_CFLAGS = $(COMPILER_SPECIFIC_PEDANTIC_CFLAGS)
|
||||
Reference in New Issue
Block a user