|
| 1 | +/**************************************************************************** |
| 2 | + * apps/netutils/plcatool/oa_tc14.h |
| 3 | + * |
| 4 | + * SPDX-License-Identifier: Apache-2.0 |
| 5 | + * |
| 6 | + * Licensed to the Apache Software Foundation (ASF) under one or more |
| 7 | + * contributor license agreements. See the NOTICE file distributed with |
| 8 | + * this work for additional information regarding copyright ownership. The |
| 9 | + * ASF licenses this file to you under the Apache License, Version 2.0 (the |
| 10 | + * "License"); you may not use this file except in compliance with the |
| 11 | + * License. You may obtain a copy of the License at |
| 12 | + * |
| 13 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 14 | + * |
| 15 | + * Unless required by applicable law or agreed to in writing, software |
| 16 | + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 17 | + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 18 | + * License for the specific language governing permissions and limitations |
| 19 | + * under the License. |
| 20 | + * |
| 21 | + ****************************************************************************/ |
| 22 | + |
| 23 | +#ifndef __APPS_NETUTILS_PLCATOOL_OA_TC14_H |
| 24 | +#define __APPS_NETUTILS_PLCATOOL_OA_TC14_H |
| 25 | + |
| 26 | +/**************************************************************************** |
| 27 | + * Included Files |
| 28 | + ****************************************************************************/ |
| 29 | + |
| 30 | +#include <nuttx/bits.h> |
| 31 | + |
| 32 | +/**************************************************************************** |
| 33 | + * Pre-processor Definitions |
| 34 | + ****************************************************************************/ |
| 35 | + |
| 36 | +#define OA_TC14_PLCA_MMD 31 |
| 37 | + |
| 38 | +#define OA_TC14_IDVER_ADDR 0xCA00 |
| 39 | +#define OA_TC14_IDVER_IDM_MASK GENMASK(15, 8) |
| 40 | +#define OA_TC14_IDVER_IDM_POS 8 |
| 41 | +#define OA_TC14_IDVER_VER_MASK GENMASK(7, 0) |
| 42 | +#define OA_TC14_IDVER_VER_POS 0 |
| 43 | +#define OA_TC14_IDVER_VAL 0x0A10 |
| 44 | + |
| 45 | +#define OA_TC14_CTRL0_ADDR 0xCA01 |
| 46 | +#define OA_TC14_CTRL0_EN_MASK BIT(15) |
| 47 | +#define OA_TC14_CTRL0_EN_POS 15 |
| 48 | +#define OA_TC14_CTRL0_RST_MASK BIT(14) |
| 49 | +#define OA_TC14_CTRL0_RST_POS 14 |
| 50 | + |
| 51 | +#define OA_TC14_CTRL1_ADDR 0xCA02 |
| 52 | +#define OA_TC14_CTRL1_NCNT_MASK GENMASK(15, 8) |
| 53 | +#define OA_TC14_CTRL1_NCNT_POS 8 |
| 54 | +#define OA_TC14_CTRL1_ID_MASK GENMASK(7, 0) |
| 55 | +#define OA_TC14_CTRL1_ID_POS 0 |
| 56 | + |
| 57 | +#define OA_TC14_STATUS_ADDR 0xCA03 |
| 58 | +#define OA_TC14_STATUS_PST_MASK BIT(15) |
| 59 | +#define OA_TC14_STATUS_PST_POS 15 |
| 60 | + |
| 61 | +#define OA_TC14_TOTMR_ADDR 0xCA04 |
| 62 | +#define OA_TC14_TOTMR_TOT_MASK GENMASK(7, 0) |
| 63 | +#define OA_TC14_TOTMR_TOT_POS 0 |
| 64 | + |
| 65 | +#define OA_TC14_BURST_ADDR 0xCA05 |
| 66 | +#define OA_TC14_BURST_MAXBC_MASK GENMASK(15, 8) |
| 67 | +#define OA_TC14_BURST_MAXBC_POS 8 |
| 68 | +#define OA_TC14_BURST_BTMR_MASK GENMASK(7, 0) |
| 69 | +#define OA_TC14_BURST_BTMR_POS 0 |
| 70 | + |
| 71 | +#define OA_TC14_DIAG_ADDR 0xCA06 |
| 72 | +#define OA_TC14_DIAG_RXINTO_MASK BIT(2) |
| 73 | +#define OA_TC14_DIAG_RXINTO_POS 2 |
| 74 | +#define OA_TC14_DIAG_UNEXPB_MASK BIT(1) |
| 75 | +#define OA_TC14_DIAG_UNEXPB_POS 1 |
| 76 | +#define OA_TC14_DIAG_BCNBFTO_MASK BIT(0) |
| 77 | +#define OA_TC14_DIAG_BCNBFTO_POS 0 |
| 78 | + |
| 79 | +#define oa_tc14_get_field(r, fieldname) \ |
| 80 | + (((r) & OA_TC14_##fieldname##_MASK) >> OA_TC14_##fieldname##_POS) |
| 81 | + |
| 82 | +#define oa_tc14_field(val, fieldname) \ |
| 83 | + ((val << OA_TC14_##fieldname##_POS) & OA_TC14_##fieldname##_MASK) |
| 84 | + |
| 85 | +#endif /* __APPS_NETUTILS_PLCATOOL_OA_TC14_H */ |
0 commit comments