Driver of ST X-NUCLEO-OUT01A1 Industrial Digital output expansion board based on ISO8200BQ component.
Dependents: HelloWorld_OUT01A1
ISO8200BQ/ISO8200BQ.h@0:c77427077cff, 2018-02-12 (annotated)
- Committer:
- nikapov
- Date:
- Mon Feb 12 17:22:42 2018 +0000
- Revision:
- 0:c77427077cff
Initial revision.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
nikapov | 0:c77427077cff | 1 | /** |
nikapov | 0:c77427077cff | 2 | ****************************************************************************** |
nikapov | 0:c77427077cff | 3 | * @file ISO8200BQ.h |
nikapov | 0:c77427077cff | 4 | * @author ST CLab |
nikapov | 0:c77427077cff | 5 | * @version V1.0.0 |
nikapov | 0:c77427077cff | 6 | * @date 1 February 2018 |
nikapov | 0:c77427077cff | 7 | * @brief Abstract class of a ISO8200BQ octal smart power solid state-relay |
nikapov | 0:c77427077cff | 8 | ****************************************************************************** |
nikapov | 0:c77427077cff | 9 | * @attention |
nikapov | 0:c77427077cff | 10 | * |
nikapov | 0:c77427077cff | 11 | * <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2> |
nikapov | 0:c77427077cff | 12 | * |
nikapov | 0:c77427077cff | 13 | * Redistribution and use in source and binary forms, with or without modification, |
nikapov | 0:c77427077cff | 14 | * are permitted provided that the following conditions are met: |
nikapov | 0:c77427077cff | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
nikapov | 0:c77427077cff | 16 | * this list of conditions and the following disclaimer. |
nikapov | 0:c77427077cff | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
nikapov | 0:c77427077cff | 18 | * this list of conditions and the following disclaimer in the documentation |
nikapov | 0:c77427077cff | 19 | * and/or other materials provided with the distribution. |
nikapov | 0:c77427077cff | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
nikapov | 0:c77427077cff | 21 | * may be used to endorse or promote products derived from this software |
nikapov | 0:c77427077cff | 22 | * without specific prior written permission. |
nikapov | 0:c77427077cff | 23 | * |
nikapov | 0:c77427077cff | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
nikapov | 0:c77427077cff | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
nikapov | 0:c77427077cff | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
nikapov | 0:c77427077cff | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
nikapov | 0:c77427077cff | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
nikapov | 0:c77427077cff | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
nikapov | 0:c77427077cff | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
nikapov | 0:c77427077cff | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
nikapov | 0:c77427077cff | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
nikapov | 0:c77427077cff | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
nikapov | 0:c77427077cff | 34 | * |
nikapov | 0:c77427077cff | 35 | ****************************************************************************** |
nikapov | 0:c77427077cff | 36 | */ |
nikapov | 0:c77427077cff | 37 | |
nikapov | 0:c77427077cff | 38 | |
nikapov | 0:c77427077cff | 39 | /* Prevent recursive inclusion -----------------------------------------------*/ |
nikapov | 0:c77427077cff | 40 | |
nikapov | 0:c77427077cff | 41 | #ifndef __ISO8200BQ_H__ |
nikapov | 0:c77427077cff | 42 | #define __ISO8200BQ_H__ |
nikapov | 0:c77427077cff | 43 | |
nikapov | 0:c77427077cff | 44 | |
nikapov | 0:c77427077cff | 45 | /* Includes ------------------------------------------------------------------*/ |
nikapov | 0:c77427077cff | 46 | |
nikapov | 0:c77427077cff | 47 | #include <mbed.h> |
nikapov | 0:c77427077cff | 48 | #include <assert.h> |
nikapov | 0:c77427077cff | 49 | #include "Component.h" |
nikapov | 0:c77427077cff | 50 | |
nikapov | 0:c77427077cff | 51 | |
nikapov | 0:c77427077cff | 52 | /* Class Declaration ---------------------------------------------------------*/ |
nikapov | 0:c77427077cff | 53 | |
nikapov | 0:c77427077cff | 54 | /** |
nikapov | 0:c77427077cff | 55 | * Abstract class of a ISO8200BQ octal smart power solid state-relay. |
nikapov | 0:c77427077cff | 56 | */ |
nikapov | 0:c77427077cff | 57 | class ISO8200BQ : public Component |
nikapov | 0:c77427077cff | 58 | { |
nikapov | 0:c77427077cff | 59 | public: |
nikapov | 0:c77427077cff | 60 | ISO8200BQ (PinName OUT_EN, PinName N_SYNC, |
nikapov | 0:c77427077cff | 61 | PinName N_LOAD); |
nikapov | 0:c77427077cff | 62 | virtual int init(void *init); |
nikapov | 0:c77427077cff | 63 | virtual int read_id(uint8_t *id); |
nikapov | 0:c77427077cff | 64 | void enable_outputs(bool enable); |
nikapov | 0:c77427077cff | 65 | bool are_outputs_enabled (void); |
nikapov | 0:c77427077cff | 66 | void sync_mode_load_inputs (void); |
nikapov | 0:c77427077cff | 67 | void sync_mode_update_outputs(void); |
nikapov | 0:c77427077cff | 68 | void direct_mode (void); |
nikapov | 0:c77427077cff | 69 | |
nikapov | 0:c77427077cff | 70 | private: |
nikapov | 0:c77427077cff | 71 | DigitalOut _out_en; |
nikapov | 0:c77427077cff | 72 | DigitalOut _n_sync; |
nikapov | 0:c77427077cff | 73 | DigitalOut _n_load; |
nikapov | 0:c77427077cff | 74 | }; |
nikapov | 0:c77427077cff | 75 | |
nikapov | 0:c77427077cff | 76 | #endif |