Zephyr API Documentation 4.3.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
hl78xx_apis.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2025 Netfeasa Ltd.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6#ifndef ZEPHYR_INCLUDE_DRIVERS_HL78XX_APIS_H_
7#define ZEPHYR_INCLUDE_DRIVERS_HL78XX_APIS_H_
8
9#include <zephyr/types.h>
10#include <zephyr/device.h>
11#include <errno.h>
12#include <stddef.h>
13#include <zephyr/modem/chat.h>
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
24
26#define CSQ_RSSI_UNKNOWN (99)
28#define CESQ_RSRP_UNKNOWN (255)
30#define CESQ_RSRQ_UNKNOWN (255)
31
37#define CSQ_RSSI_TO_DB(v) (-113 + (2 * (v)))
43#define CESQ_RSRP_TO_DB(v) (-140 + (v))
49#define CESQ_RSRQ_TO_DB(v) (-20 + ((v) / 2))
50
52#define PAUSED 1
54#define ACTIVE 0
55
57#define MDM_MANUFACTURER_LENGTH 20
59#define MDM_MODEL_LENGTH 32
61#define MDM_REVISION_LENGTH 64
63#define MDM_IMEI_LENGTH 16
65#define MDM_IMSI_LENGTH 23
67#define MDM_ICCID_LENGTH 22
69#define MDM_APN_MAX_LENGTH 64
71#define MDM_MAX_CERT_LENGTH 4096
73#define MDM_MAX_HOSTNAME_LEN 128
75#define MDM_SERIAL_NUMBER_LENGTH 32
76
78
87#define HL78XX_EVT_MONITOR(name, _handler, ...) \
88 static STRUCT_SECTION_ITERABLE(hl78xx_evt_monitor_entry, name) = { \
89 .handler = _handler, \
90 .next = NULL, \
91 .flags.direct = false, \
92 COND_CODE_1(__VA_ARGS__, (.flags.paused = __VA_ARGS__,), ()) }
93
104#ifdef CONFIG_MODEM_HL78XX_12
106 HL78XX_RAT_GSM,
107#ifdef CONFIG_MODEM_HL78XX_12_FW_R6
109 HL78XX_RAT_NBNTN,
110#endif
111#endif
112#ifdef CONFIG_MODEM_HL78XX_AUTORAT
114 HL78XX_RAT_MODE_AUTO,
115#endif
120};
121
135
157
175
199
200#if defined(CONFIG_HL78XX_GNSS_SUPPORT_ASSISTED_MODE) || defined(__DOXYGEN__)
212
233
250#endif /* CONFIG_HL78XX_GNSS_SUPPORT_ASSISTED_MODE */
251
269
286#ifdef CONFIG_HL78XX_GNSS
288 HL78XX_GNSS_ENGINE_READY,
290 HL78XX_GNSS_EVENT_INIT,
292 HL78XX_GNSS_EVENT_START,
294 HL78XX_GNSS_EVENT_STOP,
296 HL78XX_GNSS_EVENT_POSITION,
298 HL78XX_GNSS_EVENT_START_BLOCKED,
300 HL78XX_GNSS_EVENT_SEARCH_TIMEOUT,
302 HL78XX_GNSS_EVENT_MODE_EXITED,
303#endif /* CONFIG_HL78XX_GNSS */
304};
305#ifdef CONFIG_MODEM_HL78XX_AIRVANTAGE
311enum wdsi_indication {
313 WDSI_BOOTSTRAP_CREDENTIALS_PRESENT = 0,
315 WDSI_USER_AGREEMENT_REQUEST = 1,
317 WDSI_FIRMWARE_DOWNLOAD_REQUEST = 2,
319 WDSI_FIRMWARE_INSTALL_REQUEST = 3,
321 WDSI_AUTHENTICATION_START = 4,
323 WDSI_AUTHENTICATION_FAILED = 5,
325 WDSI_AUTHENTICATION_SUCCESS = 6,
327 WDSI_CONNECTION_DENIED = 7,
329 WDSI_DM_SESSION_CLOSED = 8,
331 WDSI_FIRMWARE_AVAILABLE = 9,
333 WDSI_FIRMWARE_DOWNLOADED = 10,
335 WDSI_FIRMWARE_DOWNLOAD_ISSUE = 11,
337 WDSI_PACKAGE_VERIFIED_CERTIFIED = 12,
339 WDSI_PACKAGE_VERIFIED_NOT_CERTIFIED = 13,
341 WDSI_FIRMWARE_UPDATE_START = 14,
343 WDSI_FIRMWARE_UPDATE_FAILED = 15,
345 WDSI_FIRMWARE_UPDATE_SUCCESS = 16,
347 WDSI_DOWNLOAD_IN_PROGRESS = 18,
349 WDSI_SESSION_STARTED = 23
350};
351#endif /* CONFIG_MODEM_HL78XX_AIRVANTAGE */
352
353#ifdef CONFIG_HL78XX_GNSS
359enum hl78xx_gnss_event_type {
361 HL78XX_GNSSEV_INITIALISATION = 0,
363 HL78XX_GNSSEV_START = 1,
365 HL78XX_GNSSEV_STOP = 2,
367 HL78XX_GNSSEV_POSITION = 3
368};
374enum hl78xx_event_status {
376 HL78XX_STATUS_FAILED = 0,
378 HL78XX_STATUS_SUCCESS = 1
379};
385enum gnss_position_events {
387 GNSS_FIX_LOST_OR_UNAVAILABLE = 0,
389 GNSS_ESTIMATED_POSITION_AVAILABLE = 1,
391 GNSS_2D_POSITION_AVAILABLE = 2,
393 GNSS_3D_POSITION_AVAILABLE = 3,
395 GNSS_FIX_CHANGED_TO_INVALID = 4
396};
397#endif /* CONFIG_HL78XX_GNSS */
398
408
410 union {
415#ifdef CONFIG_MODEM_HL78XX_AIRVANTAGE
417 enum wdsi_indication wdsi_indication;
418#endif /* CONFIG_MODEM_HL78XX_AIRVANTAGE */
419#ifdef CONFIG_HL78XX_GNSS
421 enum hl78xx_event_status event_status;
423 enum gnss_position_events position_event;
424#endif /* CONFIG_HL78XX_GNSS */
426 bool status;
428 int value;
430};
431
432#if defined(CONFIG_HL78XX_GNSS_AUX_DATA_PARSER) || defined(__DOXYGEN__)
449
476
508
523
531typedef void (*hl78xx_gnss_aux_data_callback_t)(const struct device *dev,
532 const struct hl78xx_gnss_nmea_aux_data *aux_data,
533 uint16_t size);
534
546
553#define GNSS_AUX_DATA_CALLBACK_DEFINE(_dev, _callback) \
554 static const STRUCT_SECTION_ITERABLE(hl78xx_gnss_aux_data_callback, \
555 _hl78xx_gnss_aux_data_callback__##_callback) = { \
556 .dev = _dev, \
557 .callback = _callback, \
558 }
559
565#define GNSS_DT_AUX_DATA_CALLBACK_DEFINE(_node_id, _callback) \
566 static const STRUCT_SECTION_ITERABLE(hl78xx_gnss_aux_data_callback, \
567 _CONCAT_4(_hl78xx_gnss_aux_data_callback_, \
568 DT_DEP_ORD(_node_id), _, _callback)) = { \
569 .dev = DEVICE_DT_GET(_node_id), \
570 .callback = _callback, \
571 }
572#else
579#define GNSS_AUX_DATA_CALLBACK_DEFINE(_dev, _callback)
586#define GNSS_DT_AUX_DATA_CALLBACK_DEFINE(_node_id, _callback)
587#endif
596typedef int (*hl78xx_api_configure_networks)(const struct device *dev,
597 const struct hl78xx_network *networks, uint8_t size);
598
607typedef int (*hl78xx_api_get_supported_networks)(const struct device *dev,
608 const struct hl78xx_network **networks,
609 uint8_t *size);
610
612typedef int (*hl78xx_api_get_signal)(const struct device *dev, const enum cellular_signal_type type,
613 int16_t *value);
614
624typedef int (*hl78xx_api_get_modem_info)(const struct device *dev,
625 const enum cellular_modem_info_type type, char *info,
626 size_t size);
627
629typedef int (*hl78xx_api_get_registration_status)(const struct device *dev,
631 enum cellular_registration_status *status);
632
641typedef int (*hl78xx_api_set_phone_functionality)(const struct device *dev,
642 enum hl78xx_phone_functionality functionality,
643 bool reset);
644
646typedef int (*hl78xx_api_get_phone_functionality)(const struct device *dev,
647 enum hl78xx_phone_functionality *functionality);
648
650typedef int (*hl78xx_api_send_at_cmd)(const struct device *dev, const char *cmd, uint16_t cmd_size,
651 const struct modem_chat_match *response_matches,
652 uint16_t matches_size);
653
658
666typedef void (*hl78xx_evt_monitor_dispatcher_t)(struct hl78xx_evt *notif);
667
676typedef void (*hl78xx_evt_monitor_handler_t)(struct hl78xx_evt *notif,
677 struct hl78xx_evt_monitor_entry *mon);
678
697
710 enum hl78xx_phone_functionality functionality,
711 bool reset);
712
724 enum hl78xx_phone_functionality *functionality);
725
737int hl78xx_api_func_get_signal(const struct device *dev, const enum cellular_signal_type type,
738 int16_t *value);
739
753 enum hl78xx_modem_info_type type, void *info,
754 size_t size);
755
769int hl78xx_api_func_modem_dynamic_cmd_send(const struct device *dev, const char *cmd,
770 uint16_t cmd_size,
771 const struct modem_chat_match *response_matches,
772 uint16_t matches_size);
786static inline int hl78xx_get_modem_info(const struct device *dev,
787 const enum hl78xx_modem_info_type type, void *info,
788 size_t size)
789{
790 return hl78xx_api_func_get_modem_info_vendor(dev, type, info, size);
791}
792
807static inline int hl78xx_set_phone_functionality(const struct device *dev,
808 enum hl78xx_phone_functionality functionality,
809 bool reset)
810{
811 return hl78xx_api_func_set_phone_functionality(dev, functionality, reset);
812}
813
827static inline int hl78xx_get_phone_functionality(const struct device *dev,
828 enum hl78xx_phone_functionality *functionality)
829{
830 return hl78xx_api_func_get_phone_functionality(dev, functionality);
831}
832
850static inline int hl78xx_modem_cmd_send(const struct device *dev, const char *cmd,
851 uint16_t cmd_size,
852 const struct modem_chat_match *response_matches,
853 uint16_t matches_size)
854{
855
856 return hl78xx_api_func_modem_dynamic_cmd_send(dev, cmd, cmd_size, response_matches,
857 matches_size);
858}
859
871static inline int hl78xx_parse_rssi(uint8_t rssi, int16_t *value)
872{
873 /* AT+CSQ returns a response +CSQ: <rssi>,<ber> where:
874 * - rssi is a integer from 0 to 31 whose values describes a signal strength
875 * between -113 dBm for 0 and -51dbM for 31 or unknown for 99
876 * - ber is an integer from 0 to 7 that describes the error rate, it can also
877 * be 99 for an unknown error rate
878 */
879 if (rssi == CSQ_RSSI_UNKNOWN) {
880 return -EINVAL;
881 }
882
883 *value = (int16_t)CSQ_RSSI_TO_DB(rssi);
884 return 0;
885}
886
899static inline int hl78xx_parse_rsrp(uint8_t rsrp, int16_t *value)
900{
901 /* AT+CESQ returns a response
902 * +CESQ: <rxlev>,<ber>,<rscp>,<ecn0>,<rsrq>,<rsrp> where:
903 * rsrq is a integer from 0 to 34 whose values describes the Reference
904 * Signal Receive Quality between -20 dB for 0 and -3 dB for 34
905 * (0.5 dB steps), or unknown for 255
906 * rsrp is an integer from 0 to 97 that describes the Reference Signal
907 * Receive Power between -140 dBm for 0 and -44 dBm for 97 (1 dBm steps),
908 * or unknown for 255
909 */
910 if (rsrp == CESQ_RSRP_UNKNOWN) {
911 return -EINVAL;
912 }
913
914 *value = (int16_t)CESQ_RSRP_TO_DB(rsrp);
915 return 0;
916}
917
930static inline int hl78xx_parse_rsrq(uint8_t rsrq, int16_t *value)
931{
932 if (rsrq == CESQ_RSRQ_UNKNOWN) {
933 return -EINVAL;
934 }
935
936 *value = (int16_t)CESQ_RSRQ_TO_DB(rsrq);
937 return 0;
938}
939
947{
948 mon->flags.paused = true;
949}
950
958{
959 mon->flags.paused = false;
960}
961
975
986
996
1007#ifdef CONFIG_MODEM_HL78XX_AIRVANTAGE
1017int hl78xx_start_airvantage_dm_session(const struct device *dev);
1018
1027int hl78xx_stop_airvantage_dm_session(const struct device *dev);
1028#endif /* CONFIG_MODEM_HL78XX_AIRVANTAGE */
1029
1030#ifdef CONFIG_HL78XX_GNSS
1044int hl78xx_enter_gnss_mode(const struct device *dev);
1045
1057int hl78xx_exit_gnss_mode(const struct device *dev);
1058
1068int hl78xx_queue_gnss_search(const struct device *dev);
1069
1077int hl78xx_gnss_set_nmea_output(const struct device *dev, enum nmea_output_port port);
1078
1086int hl78xx_gnss_set_search_timeout(const struct device *dev, uint32_t timeout_ms);
1087
1097int hl78xx_gnss_get_latest_known_fix(const struct device *dev);
1098
1099#ifdef CONFIG_HL78XX_GNSS_SUPPORT_ASSISTED_MODE
1110int hl78xx_gnss_assist_data_get_status(const struct device *dev,
1111 struct hl78xx_agnss_status *status);
1112
1124int hl78xx_gnss_assist_data_download(const struct device *dev, enum hl78xx_agnss_days days);
1125
1135int hl78xx_gnss_assist_data_delete(const struct device *dev);
1136#endif /* CONFIG_HL78XX_GNSS_SUPPORT_ASSISTED_MODE */
1137
1138#endif /* CONFIG_HL78XX_GNSS */
1139
1140#ifdef __cplusplus
1141}
1142#endif
1143
1144#endif /* ZEPHYR_INCLUDE_DRIVERS_HL78XX_APIS_H_ */
Main header file for cellular modem driver API.
System error numbers.
cellular_access_technology
Cellular access technologies (3GPP TS 27.007 AcT).
Definition cellular.h:33
cellular_registration_status
Cellular registration status (3GPP TS 27.007).
Definition cellular.h:109
cellular_signal_type
Cellular signal type.
Definition cellular.h:86
cellular_modem_info_type
Cellular modem info type.
Definition cellular.h:93
static void cmd(uint32_t command)
Execute a display list command by co-processor engine.
Definition ft8xx_reference_api.h:153
#define CESQ_RSRP_UNKNOWN
Unknown RSRP value returned by AT+CESQ command.
Definition hl78xx_apis.h:28
#define CESQ_RSRP_TO_DB(v)
Convert CESQ RSRP value to dBm.
Definition hl78xx_apis.h:43
#define CESQ_RSRQ_TO_DB(v)
Convert CESQ RSRQ value to dB.
Definition hl78xx_apis.h:49
#define CSQ_RSSI_TO_DB(v)
Convert CSQ RSSI value to dBm.
Definition hl78xx_apis.h:37
#define CSQ_RSSI_UNKNOWN
Unknown RSSI value returned by AT+CSQ command.
Definition hl78xx_apis.h:26
#define CESQ_RSRQ_UNKNOWN
Unknown RSRQ value returned by AT+CESQ command.
Definition hl78xx_apis.h:30
#define EINVAL
Invalid argument.
Definition errno.h:60
int(* hl78xx_api_configure_networks)(const struct device *dev, const struct hl78xx_network *networks, uint8_t size)
API function pointer for configuring networks.
Definition hl78xx_apis.h:596
static int hl78xx_parse_rsrq(uint8_t rsrq, int16_t *value)
Convert raw RSRQ value from the modem to dB.
Definition hl78xx_apis.h:930
hl78xx_cell_rat_mode
Cellular radio access technologies.
Definition hl78xx_apis.h:99
@ HL78XX_RAT_MODE_NONE
No RAT mode.
Definition hl78xx_apis.h:117
@ HL78XX_RAT_COUNT
Number of valid RAT modes.
Definition hl78xx_apis.h:119
@ HL78XX_RAT_NB1
NB-IoT radio access technology.
Definition hl78xx_apis.h:103
@ HL78XX_RAT_CAT_M1
LTE Cat-M1 radio access technology.
Definition hl78xx_apis.h:101
hl78xx_phone_functionality
Phone functionality modes.
Definition hl78xx_apis.h:127
@ HL78XX_SIM_POWER_OFF
SIM and modem powered off (minimum functionality).
Definition hl78xx_apis.h:129
@ HL78XX_AIRPLANE
Airplane mode, RF transmitters disabled.
Definition hl78xx_apis.h:133
@ HL78XX_FULLY_FUNCTIONAL
Full functionality, modem operational.
Definition hl78xx_apis.h:131
int(* hl78xx_api_get_registration_status)(const struct device *dev, enum cellular_access_technology tech, enum cellular_registration_status *status)
API for getting registration status.
Definition hl78xx_apis.h:629
int hl78xx_evt_monitor_register(struct hl78xx_evt_monitor_entry *mon)
Register an event monitor to receive HL78xx modem event notifications.
int(* hl78xx_api_get_supported_networks)(const struct device *dev, const struct hl78xx_network **networks, uint8_t *size)
API function pointer for getting supported networks.
Definition hl78xx_apis.h:607
int(* hl78xx_api_get_signal)(const struct device *dev, const enum cellular_signal_type type, int16_t *value)
API for getting network signal strength.
Definition hl78xx_apis.h:612
int(* hl78xx_api_set_phone_functionality)(const struct device *dev, enum hl78xx_phone_functionality functionality, bool reset)
API function pointer for setting phone functionality.
Definition hl78xx_apis.h:641
hl78xx_agnss_mode
A-GNSS assistance data validity mode.
Definition hl78xx_apis.h:206
@ HL78XX_AGNSS_MODE_INVALID
Data is not valid (read) / Delete data (write).
Definition hl78xx_apis.h:208
@ HL78XX_AGNSS_MODE_VALID
Data is valid (read) / Download data (write).
Definition hl78xx_apis.h:210
int(* hl78xx_api_send_at_cmd)(const struct device *dev, const char *cmd, uint16_t cmd_size, const struct modem_chat_match *response_matches, uint16_t matches_size)
API for get phone functionality.
Definition hl78xx_apis.h:650
int hl78xx_evt_notif_handler_set(hl78xx_evt_monitor_dispatcher_t handler)
Set the event notification handler for HL78xx modem events.
hl78xx_evt_type
HL78xx event types.
Definition hl78xx_apis.h:275
@ HL78XX_LTE_REGISTRATION_STAT_UPDATE
LTE network registration status changed.
Definition hl78xx_apis.h:279
@ HL78XX_LTE_RAT_UPDATE
LTE Radio Access Technology changed.
Definition hl78xx_apis.h:277
@ HL78XX_LTE_FOTA_UPDATE_STATUS
FOTA update status changed.
Definition hl78xx_apis.h:285
@ HL78XX_LTE_MODEM_STARTUP
Modem startup completed.
Definition hl78xx_apis.h:283
@ HL78XX_LTE_SIM_REGISTRATION
SIM registration status changed.
Definition hl78xx_apis.h:281
static int hl78xx_parse_rsrp(uint8_t rsrp, int16_t *value)
Convert raw RSRP value from the modem to dBm.
Definition hl78xx_apis.h:899
void(* hl78xx_gnss_aux_data_callback_t)(const struct device *dev, const struct hl78xx_gnss_nmea_aux_data *aux_data, uint16_t size)
GNSS auxiliary data callback function type.
Definition hl78xx_apis.h:531
static int hl78xx_parse_rssi(uint8_t rssi, int16_t *value)
Convert raw RSSI value from the modem to dBm.
Definition hl78xx_apis.h:871
void(* hl78xx_evt_monitor_handler_t)(struct hl78xx_evt *notif, struct hl78xx_evt_monitor_entry *mon)
Event monitor handler function type.
Definition hl78xx_apis.h:676
int(* hl78xx_api_get_modem_info)(const struct device *dev, const enum cellular_modem_info_type type, char *info, size_t size)
API function pointer for getting modem information.
Definition hl78xx_apis.h:624
int hl78xx_api_func_set_phone_functionality(const struct device *dev, enum hl78xx_phone_functionality functionality, bool reset)
Set phone functionality mode (internal implementation).
hl78xx_modem_info_type
Cellular modem info type.
Definition hl78xx_apis.h:163
@ HL78XX_MODEM_INFO_CURRENT_BAUD_RATE
Current Baud Rate.
Definition hl78xx_apis.h:173
@ HL78XX_MODEM_INFO_SERIAL_NUMBER
Modem Serial Number.
Definition hl78xx_apis.h:171
@ HL78XX_MODEM_INFO_APN
Access Point Name.
Definition hl78xx_apis.h:165
@ HL78XX_MODEM_INFO_CURRENT_RAT
Current Radio Access Technology.
Definition hl78xx_apis.h:167
@ HL78XX_MODEM_INFO_NETWORK_OPERATOR
Network Operator name.
Definition hl78xx_apis.h:169
static void hl78xx_evt_monitor_resume(struct hl78xx_evt_monitor_entry *mon)
Resume monitor.
Definition hl78xx_apis.h:957
int(* hl78xx_api_get_phone_functionality)(const struct device *dev, enum hl78xx_phone_functionality *functionality)
API for get phone functionality.
Definition hl78xx_apis.h:646
hl78xx_module_status
Module status codes.
Definition hl78xx_apis.h:141
@ HL78XX_MODULE_SIM_NOT_PRESENT
SIM card is not present.
Definition hl78xx_apis.h:147
@ HL78XX_MODULE_READY
Module is ready to receive commands for the TE.
Definition hl78xx_apis.h:143
@ HL78XX_MODULE_UNRECOVERABLE_ERROR
Unrecoverable error.
Definition hl78xx_apis.h:151
@ HL78XX_MODULE_INACTIVE_SIM
Inactive SIM.
Definition hl78xx_apis.h:155
@ HL78XX_MODULE_WAITING_FOR_ACCESS_CODE
Module is waiting for an access code.
Definition hl78xx_apis.h:145
@ HL78XX_MODULE_UNKNOWN_STATE
Unknown state.
Definition hl78xx_apis.h:153
@ HL78XX_MODULE_SIMLOCK
Module is in "SIMlock" state.
Definition hl78xx_apis.h:149
nmea_output_port
NMEA output port options.
Definition hl78xx_apis.h:181
@ NMEA_OUTPUT_CMUX_DLC2
0x06 — NMEA frames are output on CMUX DLC2
Definition hl78xx_apis.h:193
@ NMEA_OUTPUT_CMUX_DLC4
0x08 — NMEA frames are output on CMUX DLC4
Definition hl78xx_apis.h:197
@ NMEA_OUTPUT_SAME_PORT
0x04 — NMEA frames are output on the same port the +GNSSNMEA was received on
Definition hl78xx_apis.h:189
@ NMEA_OUTPUT_NONE
0x00 — NMEA frames are not output
Definition hl78xx_apis.h:183
@ NMEA_OUTPUT_UART1
0x03 — NMEA frames are output on UART1
Definition hl78xx_apis.h:187
@ NMEA_OUTPUT_CMUX_DLC1
0x05 — NMEA frames are output on CMUX DLC1
Definition hl78xx_apis.h:191
@ NMEA_OUTPUT_USB_NMEA_PORT
0x01 — NMEA frames are output on dedicated NMEA port over USB
Definition hl78xx_apis.h:185
@ NMEA_OUTPUT_CMUX_DLC3
0x07 — NMEA frames are output on CMUX DLC3
Definition hl78xx_apis.h:195
static int hl78xx_get_modem_info(const struct device *dev, const enum hl78xx_modem_info_type type, void *info, size_t size)
Get modem info for the device.
Definition hl78xx_apis.h:786
int hl78xx_api_func_get_phone_functionality(const struct device *dev, enum hl78xx_phone_functionality *functionality)
Get phone functionality mode (internal implementation).
int hl78xx_api_func_get_modem_info_vendor(const struct device *dev, enum hl78xx_modem_info_type type, void *info, size_t size)
Get vendor-specific modem information (internal implementation).
void(* hl78xx_evt_monitor_dispatcher_t)(struct hl78xx_evt *notif)
Event monitor dispatcher function type.
Definition hl78xx_apis.h:666
static void hl78xx_evt_monitor_pause(struct hl78xx_evt_monitor_entry *mon)
Pause monitor.
Definition hl78xx_apis.h:946
int hl78xx_api_func_modem_dynamic_cmd_send(const struct device *dev, const char *cmd, uint16_t cmd_size, const struct modem_chat_match *response_matches, uint16_t matches_size)
Send dynamic AT command (internal implementation).
int hl78xx_api_func_get_signal(const struct device *dev, const enum cellular_signal_type type, int16_t *value)
Get network signal strength (internal implementation).
static int hl78xx_modem_cmd_send(const struct device *dev, const char *cmd, uint16_t cmd_size, const struct modem_chat_match *response_matches, uint16_t matches_size)
Send an AT command to the modem and wait for a matched response.
Definition hl78xx_apis.h:850
hl78xx_agnss_days
Number of days of predicted assistance data to download (write command) or number of days before it e...
Definition hl78xx_apis.h:219
@ HL78XX_AGNSS_DAYS_1
Request 1 day of A-GNSS assistance data.
Definition hl78xx_apis.h:221
@ HL78XX_AGNSS_DAYS_3
Request 3 days of A-GNSS assistance data.
Definition hl78xx_apis.h:225
@ HL78XX_AGNSS_DAYS_7
Request 7 days of A-GNSS assistance data.
Definition hl78xx_apis.h:227
@ HL78XX_AGNSS_DAYS_14
Request 14 days of A-GNSS assistance data.
Definition hl78xx_apis.h:229
@ HL78XX_AGNSS_DAYS_28
Request 28 days of A-GNSS assistance data.
Definition hl78xx_apis.h:231
@ HL78XX_AGNSS_DAYS_2
Request 2 days of A-GNSS assistance data.
Definition hl78xx_apis.h:223
static int hl78xx_set_phone_functionality(const struct device *dev, enum hl78xx_phone_functionality functionality, bool reset)
Set the modem phone functionality mode.
Definition hl78xx_apis.h:807
int hl78xx_evt_monitor_unregister(struct hl78xx_evt_monitor_entry *mon)
Unregister an event monitor from receiving HL78xx modem event notifications.
static int hl78xx_get_phone_functionality(const struct device *dev, enum hl78xx_phone_functionality *functionality)
Get the current phone functionality mode of the modem.
Definition hl78xx_apis.h:827
enum cellular_access_technology hl78xx_rat_to_access_tech(enum hl78xx_cell_rat_mode rat_mode)
Convert HL78xx RAT mode to standard cellular API.
flags
Definition parser.h:97
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__INT32_TYPE__ int32_t
Definition stdint.h:74
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
__INT64_TYPE__ int64_t
Definition stdint.h:75
__INT16_TYPE__ int16_t
Definition stdint.h:73
Runtime device structure (in ROM) per driver instance.
Definition device.h:513
A-GNSS assistance data status structure.
Definition hl78xx_apis.h:240
uint8_t days
Days remaining before expiry (1-28), valid only when mode=1.
Definition hl78xx_apis.h:244
uint8_t hours
Hours remaining before expiry (0-23), valid only when mode=1.
Definition hl78xx_apis.h:246
uint8_t minutes
Minutes remaining before expiry (0-59), valid only when mode=1.
Definition hl78xx_apis.h:248
enum hl78xx_agnss_mode mode
Validity mode: 0 = invalid/empty, 1 = valid.
Definition hl78xx_apis.h:242
Event monitor entry structure.
Definition hl78xx_apis.h:684
uint8_t direct
Dispatch in ISR context.
Definition hl78xx_apis.h:694
uint8_t paused
Monitor is paused.
Definition hl78xx_apis.h:692
struct hl78xx_evt_monitor_entry * next
Link for runtime list.
Definition hl78xx_apis.h:688
struct hl78xx_evt_monitor_entry::@123314375256277045305202074155231060013037303316 flags
Monitor flags.
const hl78xx_evt_monitor_handler_t handler
Monitor callback function.
Definition hl78xx_apis.h:686
HL78xx event structure.
Definition hl78xx_apis.h:405
enum hl78xx_evt_type type
Event type.
Definition hl78xx_apis.h:407
bool status
Boolean status value.
Definition hl78xx_apis.h:426
union hl78xx_evt::@245116247166211205273371261316135324040054344202 content
Event content (depends on type).
int value
Integer value.
Definition hl78xx_apis.h:428
enum hl78xx_cell_rat_mode rat_mode
Radio access technology mode (for HL78XX_LTE_RAT_UPDATE).
Definition hl78xx_apis.h:414
enum cellular_registration_status reg_status
Network registration status (for HL78XX_LTE_REGISTRATION_STAT_UPDATE).
Definition hl78xx_apis.h:412
GNSS auxiliary data callback structure.
Definition hl78xx_apis.h:540
hl78xx_gnss_aux_data_callback_t callback
Callback called when GNSS auxiliary data is published.
Definition hl78xx_apis.h:544
const struct device * dev
Filter callback to GNSS data from this device if not NULL.
Definition hl78xx_apis.h:542
Container for all GNSS auxiliary NMEA data.
Definition hl78xx_apis.h:515
struct nmea_match_epu_data epu
EPU sentence data (HL78xx proprietary position/velocity error).
Definition hl78xx_apis.h:521
struct nmea_match_gsa_data gsa
GSA sentence data (DOP and fix type).
Definition hl78xx_apis.h:517
struct nmea_match_gst_data gst
GST sentence data (pseudorange error statistics).
Definition hl78xx_apis.h:519
Cellular network structure.
Definition hl78xx_apis.h:257
enum hl78xx_cell_rat_mode technology
Cellular access technology.
Definition hl78xx_apis.h:259
uint16_t * bands
List of bands to enable.
Definition hl78xx_apis.h:265
uint16_t size
Size of bands array.
Definition hl78xx_apis.h:267
Modem chat match.
Definition chat.h:47
Parsed EPU sentence data (HL78xx proprietary position error).
Definition hl78xx_apis.h:484
int64_t vel_east
East velocity error estimate (m/s).
Definition hl78xx_apis.h:502
int64_t vel_hdg
Heading velocity error estimate (m/s).
Definition hl78xx_apis.h:500
int64_t pos_alt
Altitude position error estimate (meters).
Definition hl78xx_apis.h:494
int64_t pos_2d
2D (horizontal) position error estimate (meters)
Definition hl78xx_apis.h:488
int64_t vel_2d
2D (horizontal) velocity error estimate (m/s)
Definition hl78xx_apis.h:498
int64_t vel_north
North velocity error estimate (m/s).
Definition hl78xx_apis.h:504
int64_t pos_lon
Longitude position error estimate (meters).
Definition hl78xx_apis.h:492
int64_t vel_up
Up (vertical) velocity error estimate (m/s).
Definition hl78xx_apis.h:506
int64_t vel_3d
3D velocity error estimate (m/s)
Definition hl78xx_apis.h:496
int64_t pos_3d
3D position error estimate (meters)
Definition hl78xx_apis.h:486
int64_t pos_lat
Latitude position error estimate (meters).
Definition hl78xx_apis.h:490
Parsed GSA sentence data (GNSS DOP and Active Satellites).
Definition hl78xx_apis.h:439
int64_t vdop
Vertical Dilution of Precision (scaled).
Definition hl78xx_apis.h:447
int64_t hdop
Horizontal Dilution of Precision (scaled).
Definition hl78xx_apis.h:445
int64_t pdop
Position Dilution of Precision (scaled).
Definition hl78xx_apis.h:443
int32_t fix_type
Fix type: 1=no fix, 2=2D fix, 3=3D fix.
Definition hl78xx_apis.h:441
Parsed GST sentence data (GNSS Pseudorange Error Statistics).
Definition hl78xx_apis.h:456
int64_t lat_err
Standard deviation of latitude error (meters).
Definition hl78xx_apis.h:470
int64_t alt_err
Standard deviation of altitude error (meters).
Definition hl78xx_apis.h:474
int64_t sd_major
Standard deviation of semi-major axis of error ellipse (meters).
Definition hl78xx_apis.h:464
int64_t lon_err
Standard deviation of longitude error (meters).
Definition hl78xx_apis.h:472
int64_t rms
RMS value of standard deviation of range inputs.
Definition hl78xx_apis.h:462
int64_t orient
Orientation of semi-major axis of error ellipse (degrees from true north).
Definition hl78xx_apis.h:468
uint32_t gst_utc
UTC time of associated position fix (HHMMSS format).
Definition hl78xx_apis.h:460
int64_t sd_minor
Standard deviation of semi-minor axis of error ellipse (meters).
Definition hl78xx_apis.h:466
int32_t i32
Reserved for internal use.
Definition hl78xx_apis.h:458