/*
* Copyright (c) 2011 Jonathan A. Kollasch.
* All rights reserved.
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 SLSA_RV_SET_MHS_DTR __BIT(0)
#define SLSA_RV_SET_MHS_RTS __BIT(1)
/* AN571 calls these next two masks, they're more like change-enables */
#define SLSA_RV_SET_MHS_DTR_MASK __BIT(8)
#define SLSA_RV_SET_MHS_RTS_MASK __BIT(9)
#define SLSA_RL_GET_MDMSTS 1
/* data in uint8_t returned from GET_MDMSTS */
#define SLSA_MDMSTS_DTR __BIT(0)
#define SLSA_MDMSTS_RTS __BIT(1)
#define SLSA_MDMSTS_CTS __BIT(4)
#define SLSA_MDMSTS_DSR __BIT(5)
#define SLSA_MDMSTS_RI __BIT(6)
#define SLSA_MDMSTS_DCD __BIT(7)
#define SLSA_RL_SET_EVENTMASK 0
#define SLSA_RL_GET_EVENTMASK 2
#define SLSA_RL_GET_EVENTSTATE 2
#define SLSA_EVENT_TERI __BIT(0) /* RI trailing edge */
#define SLSA_EVENT_RB80 __BIT(2) /* Rx buf 80% full */
#define SLSA_EVENT_CR __BIT(8) /* char received */
#define SLSA_EVENT_SCR __BIT(9) /* special char received */
#define SLSA_EVENT_TQE __BIT(10) /* Tx queue empty */
#define SLSA_EVENT_DCTS __BIT(11) /* CTS changed */
#define SLSA_EVENT_DDSR __BIT(12) /* DSR changed */
#define SLSA_EVENT_DDCD __BIT(13) /* DCD changed */
#define SLSA_EVENT_BI __BIT(14) /* line break received */
#define SLSA_EVENT_LSE __BIT(15) /* line status error */
#define SLSA_RV_VENDOR_SPECIFIC_WRITE_LATCH 0x37e1
/*
* on CP2103/CP2104 the latch state and latch mask are
* written in the high and low bytes of wIndex respectively
*
* on CP2105, wIndex is the interface number, and the same
* latch/mask is written as data instead.
*/
#define SLSA_RL_VENDOR_SPECIFIC_WRITE_LATCH_CP2103 0
#define SLSA_RL_VENDOR_SPECIFIC_WRITE_LATCH_CP2105 2