6#ifndef ZEPHYR_INCLUDE_DRIVERS_HL78XX_APIS_H_
7#define ZEPHYR_INCLUDE_DRIVERS_HL78XX_APIS_H_
21#define CSQ_RSSI_UNKNOWN (99)
22#define CESQ_RSRP_UNKNOWN (255)
23#define CESQ_RSRQ_UNKNOWN (255)
25#define CSQ_RSSI_TO_DB(v) (-113 + (2 * (v)))
26#define CESQ_RSRP_TO_DB(v) (-140 + (v))
27#define CESQ_RSRQ_TO_DB(v) (-20 + ((v) / 2))
32#define MDM_MANUFACTURER_LENGTH 20
33#define MDM_MODEL_LENGTH 32
34#define MDM_REVISION_LENGTH 64
35#define MDM_IMEI_LENGTH 16
36#define MDM_IMSI_LENGTH 23
37#define MDM_ICCID_LENGTH 22
38#define MDM_APN_MAX_LENGTH 64
39#define MDM_MAX_CERT_LENGTH 4096
40#define MDM_MAX_HOSTNAME_LEN 128
41#define MDM_SERIAL_NUMBER_LENGTH 32
51#define HL78XX_EVT_MONITOR(name, _handler, ...) \
52 static STRUCT_SECTION_ITERABLE(hl78xx_evt_monitor_entry, name) = { \
53 .handler = _handler, \
55 .flags.direct = false, \
56 COND_CODE_1(__VA_ARGS__, (.flags.paused = __VA_ARGS__,), ()) }
62#ifdef CONFIG_MODEM_HL78XX_12
64#ifdef CONFIG_MODEM_HL78XX_12_FW_R6
68#ifdef CONFIG_MODEM_HL78XX_AUTORAT
131#ifdef CONFIG_MODEM_HL78XX_AIRVANTAGE
135enum wdsi_indication {
137 WDSI_BOOTSTRAP_CREDENTIALS_PRESENT = 0,
139 WDSI_USER_AGREEMENT_REQUEST = 1,
141 WDSI_FIRMWARE_DOWNLOAD_REQUEST = 2,
143 WDSI_FIRMWARE_INSTALL_REQUEST = 3,
145 WDSI_AUTHENTICATION_START = 4,
147 WDSI_AUTHENTICATION_FAILED = 5,
149 WDSI_AUTHENTICATION_SUCCESS = 6,
151 WDSI_CONNECTION_DENIED = 7,
153 WDSI_DM_SESSION_CLOSED = 8,
155 WDSI_FIRMWARE_AVAILABLE = 9,
157 WDSI_FIRMWARE_DOWNLOADED = 10,
159 WDSI_FIRMWARE_DOWNLOAD_ISSUE = 11,
161 WDSI_PACKAGE_VERIFIED_CERTIFIED = 12,
163 WDSI_PACKAGE_VERIFIED_NOT_CERTIFIED = 13,
165 WDSI_FIRMWARE_UPDATE_START = 14,
167 WDSI_FIRMWARE_UPDATE_FAILED = 15,
169 WDSI_FIRMWARE_UPDATE_SUCCESS = 16,
171 WDSI_DOWNLOAD_IN_PROGRESS = 18,
174 WDSI_SESSION_STARTED = 23
184#ifdef CONFIG_MODEM_HL78XX_AIRVANTAGE
185 enum wdsi_indication wdsi_indication;
514#ifdef CONFIG_MODEM_HL78XX_AIRVANTAGE
516int hl78xx_start_airvantage_dm_session(
const struct device *dev);
518int hl78xx_stop_airvantage_dm_session(
const struct device *dev);
Main header file for cellular modem driver API.
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 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 for configuring networks.
Definition hl78xx_apis.h:192
#define CESQ_RSRP_UNKNOWN
Definition hl78xx_apis.h:22
static int hl78xx_parse_rsrq(uint8_t rsrq, int16_t *value)
Convert raw RSRQ value from the modem to dB.
Definition hl78xx_apis.h:457
hl78xx_cell_rat_mode
Cellular radio access technologies.
Definition hl78xx_apis.h:59
@ HL78XX_RAT_MODE_NONE
Definition hl78xx_apis.h:71
@ HL78XX_RAT_COUNT
Definition hl78xx_apis.h:72
@ HL78XX_RAT_NB1
Definition hl78xx_apis.h:61
@ HL78XX_RAT_CAT_M1
Definition hl78xx_apis.h:60
#define CESQ_RSRP_TO_DB(v)
Definition hl78xx_apis.h:26
hl78xx_phone_functionality
Phone functionality modes.
Definition hl78xx_apis.h:76
@ HL78XX_SIM_POWER_OFF
Definition hl78xx_apis.h:77
@ HL78XX_AIRPLANE
Definition hl78xx_apis.h:79
@ HL78XX_FULLY_FUNCTIONAL
Definition hl78xx_apis.h:78
#define CESQ_RSRQ_TO_DB(v)
Definition hl78xx_apis.h:27
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:210
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 for getting supported networks.
Definition hl78xx_apis.h:196
#define CSQ_RSSI_TO_DB(v)
Definition hl78xx_apis.h:25
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:201
int(* hl78xx_api_set_phone_functionality)(const struct device *dev, enum hl78xx_phone_functionality functionality, bool reset)
API for set phone functionality.
Definition hl78xx_apis.h:218
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:227
int hl78xx_evt_notif_handler_set(hl78xx_evt_monitor_dispatcher_t handler)
Set the event notification handler for HL78xx modem events.
hl78xx_evt_type
Definition hl78xx_apis.h:124
@ HL78XX_LTE_REGISTRATION_STAT_UPDATE
Definition hl78xx_apis.h:126
@ HL78XX_LTE_RAT_UPDATE
Definition hl78xx_apis.h:125
@ HL78XX_LTE_FOTA_UPDATE_STATUS
Definition hl78xx_apis.h:129
@ HL78XX_LTE_MODEM_STARTUP
Definition hl78xx_apis.h:128
@ HL78XX_LTE_SIM_REGISTRATION
Definition hl78xx_apis.h:127
static int hl78xx_parse_rsrp(uint8_t rsrp, int16_t *value)
Convert raw RSRP value from the modem to dBm.
Definition hl78xx_apis.h:426
#define CSQ_RSSI_UNKNOWN
Definition hl78xx_apis.h:21
#define CESQ_RSRQ_UNKNOWN
Definition hl78xx_apis.h:23
static int hl78xx_parse_rssi(uint8_t rssi, int16_t *value)
Convert raw RSSI value from the modem to dBm.
Definition hl78xx_apis.h:398
void(* hl78xx_evt_monitor_handler_t)(struct hl78xx_evt *notif, struct hl78xx_evt_monitor_entry *mon)
Definition hl78xx_apis.h:236
int(* hl78xx_api_get_modem_info)(const struct device *dev, const enum cellular_modem_info_type type, char *info, size_t size)
API for getting modem information.
Definition hl78xx_apis.h:205
int hl78xx_api_func_set_phone_functionality(const struct device *dev, enum hl78xx_phone_functionality functionality, bool reset)
hl78xx_api_func_set_phone_functionality
int(* hl78xx_api_set_apn)(const struct device *dev, const char *apn, uint16_t size)
API for setting apn.
Definition hl78xx_apis.h:215
hl78xx_modem_info_type
Cellular modem info type.
Definition hl78xx_apis.h:100
@ HL78XX_MODEM_INFO_SERIAL_NUMBER
Definition hl78xx_apis.h:108
@ HL78XX_MODEM_INFO_APN
Definition hl78xx_apis.h:102
@ HL78XX_MODEM_INFO_CURRENT_RAT
Definition hl78xx_apis.h:104
@ HL78XX_MODEM_INFO_NETWORK_OPERATOR
Definition hl78xx_apis.h:106
static void hl78xx_evt_monitor_resume(struct hl78xx_evt_monitor_entry *mon)
Resume monitor.
Definition hl78xx_apis.h:484
int(* hl78xx_api_get_phone_functionality)(const struct device *dev, enum hl78xx_phone_functionality *functionality)
API for get phone functionality.
Definition hl78xx_apis.h:223
hl78xx_module_status
Module status codes.
Definition hl78xx_apis.h:82
@ HL78XX_MODULE_SIM_NOT_PRESENT
SIM card is not present.
Definition hl78xx_apis.h:88
@ HL78XX_MODULE_READY
Module is ready to receive commands for the TE.
Definition hl78xx_apis.h:84
@ HL78XX_MODULE_UNRECOVERABLE_ERROR
Unrecoverable error.
Definition hl78xx_apis.h:92
@ HL78XX_MODULE_INACTIVE_SIM
Inactive SIM.
Definition hl78xx_apis.h:96
@ HL78XX_MODULE_WAITING_FOR_ACCESS_CODE
Module is waiting for an access code.
Definition hl78xx_apis.h:86
@ HL78XX_MODULE_UNKNOWN_STATE
Unknown state.
Definition hl78xx_apis.h:94
@ HL78XX_MODULE_SIMLOCK
Module is in “SIMlock” state.
Definition hl78xx_apis.h:90
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:313
int hl78xx_api_func_get_phone_functionality(const struct device *dev, enum hl78xx_phone_functionality *functionality)
hl78xx_api_func_get_phone_functionality
int hl78xx_api_func_get_modem_info_vendor(const struct device *dev, enum hl78xx_modem_info_type type, void *info, size_t size)
hl78xx_api_func_get_modem_info_vendor - Brief description of the function.
void(* hl78xx_evt_monitor_dispatcher_t)(struct hl78xx_evt *notif)
Definition hl78xx_apis.h:234
static void hl78xx_evt_monitor_pause(struct hl78xx_evt_monitor_entry *mon)
Pause monitor.
Definition hl78xx_apis.h:473
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)
hl78xx_api_func_modem_dynamic_cmd_send - Brief description of the function.
int hl78xx_api_func_get_signal(const struct device *dev, const enum cellular_signal_type type, int16_t *value)
hl78xx_api_func_get_signal - Brief description of the function.
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:377
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:334
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:354
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
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
__INT16_TYPE__ int16_t
Definition stdint.h:73
Runtime device structure (in ROM) per driver instance.
Definition device.h:513
Definition hl78xx_apis.h:239
uint8_t direct
Definition hl78xx_apis.h:246
uint8_t paused
Definition hl78xx_apis.h:245
struct hl78xx_evt_monitor_entry * next
Definition hl78xx_apis.h:243
struct hl78xx_evt_monitor_entry::@123314375256277045305202074155231060013037303316 flags
const hl78xx_evt_monitor_handler_t handler
Monitor callback.
Definition hl78xx_apis.h:241
Definition hl78xx_apis.h:178
enum hl78xx_evt_type type
Definition hl78xx_apis.h:179
bool status
Definition hl78xx_apis.h:187
union hl78xx_evt::@245116247166211205273371261316135324040054344202 content
int value
Definition hl78xx_apis.h:188
enum hl78xx_cell_rat_mode rat_mode
Definition hl78xx_apis.h:183
enum cellular_registration_status reg_status
Definition hl78xx_apis.h:182
Cellular network structure.
Definition hl78xx_apis.h:112
enum hl78xx_cell_rat_mode technology
Cellular access technology.
Definition hl78xx_apis.h:114
uint16_t * bands
List of bands, as defined by the specified cellular access technology, to enables.
Definition hl78xx_apis.h:119
uint16_t size
Size of bands.
Definition hl78xx_apis.h:121
Modem chat match.
Definition chat.h:47