Reference

This article serves as a reference guide for GNSS and RTC libraries applicable to Arduino and PlatformIO development environments, detailing installation instructions, API descriptions, and usage examples to help optimize GNSS timing and RTC calibration.

Library

Library files applicable to development environments such as Arduino/PlatformIO; including usage examples and installation instructions. Download and install DFRobot_GNSS and RTC library

API Description

  /**
   * @fn calibRTC(void)
   * @brief Calibrate RTC immediately with GNSS
   * @note This is a single calibration;
   * @n If the GNSS module signal is weak, time calibration may encounter issues.
   * @return None
   */
      void calibRTC(void);

  /**
   * @fn calibRTC(uint8_t hour)
   * @brief The loop automatically performs GNSS timing based on the set interval
   * @param hour Automatic calibration of the time interval. range: 0~255, unit: hour.
   * @note When set to zero, automatic time calibration is disabled.
   * @n Enabling it will trigger an immediate calibration.
   * @n If the GNSS module signal is weak, time calibration may encounter issues.
   * @return None
   */
      void calibRTC(uint8_t hour);
    
  /**
   * @fn calibStatus
   * @brief Current clock calibration status
   * @param mode By default, it is set to true, indicating access to the calibration status only.
   * @n  If continuous calibration for one minute does not return a successful calibration,
   * @n  you can pass in false to manually terminate this calibration session.
   * @return uint8_t type, indicates current clock calibration status
   * @retval 0 Not calibrated
   * @retval 1 Calibration complete
   * @retval 2 Under calibration
   * @note Note: To avoid affecting subsequent calibration status,
   * @n    "Calibration completed Status (1)" is automatically zeroed after a successful read
   */
     uint8_t calibStatus(bool mode = true);
    
  /**
   * @fn setAlarm
   * @brief set an Alarm
   * @param year 2000~2099
   * @param month 1~12
   * @param day 1~31
   * @return None
   */
    void setAlarm(uint16_t year, uint8_t month, uint8_t day);
     
  /**
   * @brief clearAlarm
   */
    void clearAlarm(void);
    
  /**
   * @fn enable32k
   * @brief enable the 32.768kHz output of the Mdule
   * @return None
   */
   void enable32k();
   
   
  /**
   * @fn disable32k
   * @brief disable the 32.768kHz output of the Mdule
   * @return None
   */
   void disable32k();
    
  /**
   * @fn countDown
   * @brief CountDown
   * @param second  countdown time 0-0xffffff
   */
   void countDown(uint32_t second);
    
  /**
   * @fn getUTC
   * @brief Get utc standard time
   * @return sTim_t type, represents the returned hour, minute and second
   * @retval sTim_t.hour hour
   * @retval sTim_t.minute minute
   * @retval sTim_t.second second
   */
    sTim_t getUTC(void);
    
    
  /**
   * @fn enablePower
   * @brief Enable gnss power
   * @return null
   */
   void enablePower(void);
    
  /**
   * @fn disablePower
   * @brief Disable gnss power
   * @return null
   */
   void disablePower(void);

Was this article helpful?

ON THIS PAGE

TOP