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.
Dependents: modem_ref_helper_for_v5_3_217
Diff: include/alp_spec.h
- Revision:
- 47:cf4519ba56d9
- Parent:
- 42:87bf0654cb7b
--- a/include/alp_spec.h Wed Jul 31 16:48:48 2019 +0000
+++ b/include/alp_spec.h Mon May 25 15:43:37 2020 +0000
@@ -179,6 +179,7 @@
ALP_QCOMP_GTE = 5
} alp_q_comp_t;
#define ALP_QCOMP(v) (((v) & 7) << 0)
+#define ALP_QSTR_PARAM(v) (((v) & 0x0F) << 0)
typedef enum {
// This is not matching ALP's spec on purpose...
@@ -188,6 +189,7 @@
ALP_QLOGIC_NOR = 3,
ALP_QLOGIC_NAND = 4,
} alp_q_logic_t;
+#define ALP_QLOGIC(v) (((v-1) & 0x03) << 6)
typedef enum {
ALP_QDATA_SIGNED = 0,
@@ -392,7 +394,7 @@
#define ALP_ACTION_FORWARD_SIZE(s) (1+(s))
#define ALP_ACTION_FORWARD(p,itf,itfs) do {\
- *(p)++ = ALP_OPCODE_FORWARD;\
+ *(p)++ = ALP_OPCODE_FORWARD | ALP_OPCODE_RESP;\
memcpy((p),(itf),(itfs));(p) += (itfs);\
} while(0)
@@ -423,8 +425,8 @@
#define ALP_ACTION_RSP_TAG_SIZE (2)
#define ALP_ACTION_RSP_TAG(_p,_val,_eop,_err) do {\
u8 tmp = ALP_OPCODE_RSP_TAG;\
- tmp += (_eop)?ALP_OPCODE_EOP:0;\
- tmp += (_err)?ALP_OPCODE_ERR:0;\
+ tmp |= (_eop)?ALP_OPCODE_EOP:0;\
+ tmp |= (_err)?ALP_OPCODE_ERR:0;\
*(_p)++ = tmp;\
*(_p)++ = (_val);\
} while(0)
@@ -482,11 +484,13 @@
// Query with break actions
/// Match immediate value to file value
-#define ALP_ACTION_QBREAK_EQVAL_SIZE(_o,_l,_mbit) (4+ALP_LFIELD_SIZE(_o)+(1+(_mbit))*(_l))
-#define ALP_ACTION_QBREAK_EQVAL(_p,_m,_v,_fid,_o,_l) do {\
+#define ALP_ACTION_QBREAK_SIZE(_o,_l,_mbit) (4+ALP_LFIELD_SIZE(_o)+(1+(_mbit))*(_l))
+
+/// Compare immediate value to file value
+#define ALP_ACTION_QBREAK_COMP(_p,_m,_v,_c,_fid,_o,_l,_g) do {\
u8 _mbit = (_m) ? 1 : 0;\
- *(_p)++ = ALP_OPCODE_QBREAK;\
- *(_p)++ = ALP_QCOMP(ALP_QCOMP_EQ) | ALP_QDATA(ALP_QDATA_UNSIGNED) | ALP_QMASK(_mbit) | ALP_QTYPE(ALP_QTYPE_ACOMP_IMMEDIATE);\
+ *(_p)++ = ALP_OPCODE_QBREAK | ((_g)? ALP_OPCODE_GROUP: 0);\
+ *(_p)++ = ALP_QCOMP(_c) | ALP_QDATA(ALP_QDATA_UNSIGNED) | ALP_QMASK(_mbit) | ALP_QTYPE(ALP_QTYPE_ACOMP_IMMEDIATE);\
*(_p)++ = _l;\
if (_mbit) {memcpy((_p),&(_m),_l);(_p) += (_l);}\
memcpy((_p),&(_v),_l);(_p) += (_l);\
@@ -494,5 +498,20 @@
(_p) += alp_encode_length(_p,_o);\
} while(0)
+#define ALP_ACTION_QBREAK_STRTOK(_p,_m,_v,_fid,_o,_l,_g) do {\
+ u8 _mbit = (_m) ? 1 : 0;\
+ *(_p)++ = ALP_OPCODE_QBREAK | ((_g)? ALP_OPCODE_GROUP: 0);\
+ *(_p)++ = ALP_QMASK(_mbit) | ALP_QTYPE(ALP_QTYPE_STR_TOKEN) | ALP_QSTR_PARAM(0);\
+ *(_p)++ = _l;\
+ if (_mbit) {memcpy((_p),&(_m),_l);(_p) += (_l);}\
+ memcpy((_p),&(_v),_l);(_p) += (_l);\
+ *(_p)++ = _fid;\
+ (_p) += alp_encode_length(_p,_o);\
+ } while(0)
+
+#define ALP_ACTION_QLOGIC_SIZE 1
+#define ALP_ACTION_QLOGIC(_p,_l) do {\
+ *(_p)++ = ALP_OPCODE_LOGIC | ALP_QLOGIC(_l);\
+ } while(0)
+
#endif // __ALP_SPEC_H__
-