Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: Components/Common/plc.h
- Revision:
- 0:b66a560b6618
- Child:
- 2:1ec0dea195f8
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Components/Common/plc.h Fri Feb 19 10:56:30 2016 +0000
@@ -0,0 +1,147 @@
+/**
+ ******************************************************************************
+ * @file plc.h
+ * @author System Lab Noida
+ * @version V1.0.0
+ * @date 08-July-2015
+ * @brief This header file contains the functions prototypes for the
+ * plc driver.
+ ******************************************************************************
+ * @attention
+ *
+ * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * 3. Neither the name of STMicroelectronics nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ ******************************************************************************
+ */
+
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __PLC_H
+#define __PLC_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+#include <stdint.h>
+
+/** @addtogroup BSP
+ * @{
+ */
+
+/** @addtogroup Components
+ * @{
+ */
+
+/** @addtogroup PLC
+ * @{
+ */
+
+/** @defgroup PLC_Exported_Constants
+ * @{
+ */
+#define MAX_NUMBER_OF_PLC_INPUT_COMPONENTS 1
+#define MAX_NUMBER_OF_PLC_OUTPUT_COMPONENTS 1
+
+#define NB_BYTES 2
+#define BUFFERSIZE 1
+
+/** @defgroup PLC_Exported_Types
+ * @{
+ */
+
+/** @defgroup PLC_Exported_variables plc Exported variables
+ * @{
+ * @brief Exported variables
+ */
+
+/**
+ * @brief Component's Status enumerator definition.
+ */
+typedef enum
+{
+ COMPONENT_OK = 0,
+ COMPONENT_ERROR,
+ COMPONENT_TIMEOUT,
+ COMPONENT_NOT_IMPLEMENTED
+} DrvStatusTypeDef;
+
+/**
+ * @brief SSRELAY driver structure definition
+ */
+typedef struct
+{
+ void (*SetChannels) (uint8_t Out_array);
+ uint8_t (*ManageFault)(void);
+ uint8_t (*CheckDCDCStatus)(void);
+ uint8_t (*TemperatureWarning)(void);
+ uint8_t (*CheckParity)(void);
+ uint8_t (*CheckPowerGood)(void);
+ uint8_t (*CheckCommError)(void);
+ void (*Ssrelay_SetOutput)(uint8_t *TxBuff, uint8_t *RxBuff);
+} SSRELAY_DrvTypeDef;
+
+
+/**
+ * @brief DIGITALINPUTARRAY driver structure definition
+ */
+typedef struct
+{
+ uint8_t (*GetReadStatus)(void);
+ void (*SetReadStatus)(uint8_t status);
+ uint8_t (*GetInputData)(void);
+ uint8_t (*OverTempAlarm)(void);
+ uint8_t (*CheckParity)(void);
+ uint8_t (*UnderVoltAlarm)(void);
+ void (*DigInpArray_GetInput)(uint8_t *TxBuff, uint8_t *RxBuff);
+} DIGITALINPUTARRAY_DrvTypeDef;
+
+
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __PLC_H */
+/**
+ * @} // end plc Exported Function
+ */
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/