Other

项目介绍

nimaltd/gsm_v5 是一个托管在 GitHub 上的开源项目,主要使用 C 编写,采用 Other 许可证,目前获得 253 个 Star、91 次 Fork。

仓库全名
nimaltd/gsm_v5
开源许可证
Other
Star 数
253
Fork 数
91
未关闭 Issue
17

README 摘要

gsm module library for STM32 LL Author: Nima Askari WebSite: https://www.github.com/NimaLTD Instagram: https://www.instagram.com/github.NimaLTD LinkedIn: https://www.linkedin.com/in/NimaLTD Youtube: https://www.youtube.com/@nimaltd This library using my 'atc' library, please download 'http://github.com/nimaltd/atc'. [x] NONE RTOS Supported. [x] RTOS V1 Supported. [x] RTOS V2 Supported. [x] SIM800C tested. [ ] SIM800…

完整内容见 GitHub 原始 README 或本页 。

常见问题

gsm_v5 用什么语言开发?

主要使用 C 编写,采用 Other 许可证,目前有 253 个 Star。

gsm_v5 可以免费商用吗?

仓库标注的许可证为 Other,商用前请先阅读仓库 LICENSE 文件确认授权范围。

如何获取 gsm_v5 的源码?

可以直接克隆仓库:git clone https://github.com/nimaltd/gsm_v5.git;安装与运行步骤见仓库 README。

gsm_v5 最近还在维护吗?

仓库最近一次更新为 2025年3月17日,当前有 17 个未关闭 Issue;Star 数为 253,可作为社区活跃度的参考。

关于

gsm module library for STM32 LL

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

语言占比

C

README

gsm module library for STM32 LL



  • NONE RTOS Supported.
  • RTOS V1 Supported.
  • RTOS V2 Supported.

  • SIM800C tested.
  • SIM800 tested.
  • SIM800H tested.

  • Enable USART (LL Library) and RX interrupt.
  • Enable a gpio as output and open drain to connect gsm power button.
  • Add gsm and atc library to your project.
  • Configure gsmConfig.h and atcConfig.h files.
  • Add ‘gsm_rxCallback()’ to selected usart interrupt.
  • Add ‘gsm_callback_simDetectorISR()’ to sim detector interrupt. //if use sim detector
  • Call gsm_init().
  • Call gsm_loop() in infinit loop.
  • If using FREERTOS, please create a task for gsm with at least 512 word heap size.

None RTOS example:

  • file atcConfig.h
#define	_ATC_DEBUG            0       //  use printf debug
#define	_ATC_RTOS             0       //  0: no rtos    1: cmsis_os v1    2: cmsis_os v2
#define	_ATC_RXSIZE           1024    //  at-command rx buffer size
#define	_ATC_SEARCH_CMD_MAX   5       //  maximum of answer in at-command
#define	_ATC_SEARCH_MAX       10      //  maximum	of always search in buffer
#define	_ATC_RXTIMEOUT_MS     50      //  rx timeout to get new packet
  • file main.c
#include "gsm.h"

int main()
{
  gsm_init();
  gsm_power(true);
  gsm_waitForRegister(30);
  gsm_msg_send("+98xxxxxxx", "TEST MSG 1");
  while (1)
  {
    gsm_loop();
  }  
}

RTOS example:

  • file atcConfig.h
#define	_ATC_DEBUG            0       //  use printf debug
#define	_ATC_RTOS             1       //  0: no rtos    1: cmsis_os v1    2: cmsis_os v2
#define	_ATC_RXSIZE           1024    //  at-command rx buffer size
#define	_ATC_SEARCH_CMD_MAX   5       //  maximum of answer in at-command
#define	_ATC_SEARCH_MAX       10      //  maximum	of always search in buffer
#define	_ATC_RXTIMEOUT_MS     50      //  rx timeout to get new packet
  • file main.c
#include "gsm.h"

int main()
{
  ...  
}

void task_gsm(void const * argument)
{
  #if (_GSM_MAIN_POWER == 1)
    HAL_GPIO_WritePin(_GSM_PWR_CTRL_GPIO, _GSM_PWR_CTRL_PIN, GPIO_PIN_RESET);
    gsm_delay(1000);
  #endif
  gsm_init();
  gsm_power(true);
  #if(_GSM_SIM_DETECTOR == 1)
    if(HAL_GPIO_ReadPin(_GSM_SIM_DET_GPIO, _GSM_SIM_DET_PIN))
    {
      gsm_power(false);
      #if(_GSM_RTOS != 0)
        vTaskSuspend(NULL);
      #endif
    }
  #endif
  while (1)
  {
    gsm_loop();
  }
}

void task_other(void const * argument)
{
  //gsm_waitForRegister(30);
  gsm_msg_send("+98xxxxxxx", "TEST MSG 1");
  while (1)
  {    
    osDelay(10000);
  }
}

#if(_GSM_SIM_DETECTOR == 1)
void gsm_callback_simDetectorISR()
{
  gsm.status.simDetCangeInterruptFlag = 1;
  #if(_GSM_RTOS != 0)
    xTaskResumeFromISR(task_gsm);
  #endif
}
#endif

评论

暂无评论