Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 54 additions & 52 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,52 +1,54 @@
# Prerequisites
*.d

# Object files
*.o
*.ko
*.obj
*.elf

# Linker output
*.ilk
*.map
*.exp

# Precompiled Headers
*.gch
*.pch

# Libraries
*.lib
*.a
*.la
*.lo

# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib

# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex

# Debug files
*.dSYM/
*.su
*.idb
*.pdb

# Kernel Module Compile Results
*.mod*
*.cmd
.tmp_versions/
modules.order
Module.symvers
Mkfile.old
dkms.conf
# Prerequisites
*.d

# Object files
*.o
*.ko
*.obj
*.elf

# Linker output
*.ilk
*.map
*.exp

# Precompiled Headers
*.gch
*.pch

# Libraries
*.lib
*.a
*.la
*.lo

# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib

# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex

# Debug files
*.dSYM/
*.su
*.idb
*.pdb

# Kernel Module Compile Results
*.mod*
*.cmd
.tmp_versions/
modules.order
Module.symvers
Mkfile.old
dkms.conf

.vscode/
16 changes: 16 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
]
}
],
"version": 4
}
173 changes: 173 additions & 0 deletions GPS_DRIVERS/.cproject

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions GPS_DRIVERS/.mxproject
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[PreviousLibFiles]
LibFiles=Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_hal_i2c.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_ll_i2c.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_hal.h;Drivers\STM32L1xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_hal_def.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_hal_rcc.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_hal_rcc_ex.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_ll_bus.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_ll_rcc.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_ll_crs.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_ll_system.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_ll_utils.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_hal_flash.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_hal_flash_ex.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_hal_flash_ramfunc.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_hal_gpio.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_hal_gpio_ex.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_ll_gpio.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_hal_dma_ex.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_hal_dma.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_ll_dma.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_hal_pwr.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_hal_pwr_ex.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_ll_pwr.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_hal_cortex.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_ll_cortex.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_hal_exti.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_ll_exti.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_hal_tim.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_hal_tim_ex.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_hal_uart.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_ll_usart.h;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_i2c.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_rcc.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_rcc_ex.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_flash.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_flash_ex.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_flash_ramfunc.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_gpio.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_dma.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_pwr.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_pwr_ex.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_cortex.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_exti.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_tim.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_tim_ex.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_uart.c;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_hal_i2c.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_ll_i2c.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_hal.h;Drivers\STM32L1xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_hal_def.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_hal_rcc.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_hal_rcc_ex.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_ll_bus.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_ll_rcc.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_ll_crs.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_ll_system.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_ll_utils.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_hal_flash.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_hal_flash_ex.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_hal_flash_ramfunc.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_hal_gpio.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_hal_gpio_ex.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_ll_gpio.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_hal_dma_ex.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_hal_dma.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_ll_dma.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_hal_pwr.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_hal_pwr_ex.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_ll_pwr.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_hal_cortex.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_ll_cortex.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_hal_exti.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_ll_exti.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_hal_tim.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_hal_tim_ex.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_hal_uart.h;Drivers\STM32L1xx_HAL_Driver\Inc\stm32l1xx_ll_usart.h;Drivers\CMSIS\Device\ST\STM32L1xx\Include\stm32l152xe.h;Drivers\CMSIS\Device\ST\STM32L1xx\Include\stm32l1xx.h;Drivers\CMSIS\Device\ST\STM32L1xx\Include\system_stm32l1xx.h;Drivers\CMSIS\Device\ST\STM32L1xx\Source\Templates\system_stm32l1xx.c;Drivers\CMSIS\Include\cmsis_armcc.h;Drivers\CMSIS\Include\cmsis_armclang.h;Drivers\CMSIS\Include\cmsis_compiler.h;Drivers\CMSIS\Include\cmsis_gcc.h;Drivers\CMSIS\Include\cmsis_iccarm.h;Drivers\CMSIS\Include\cmsis_version.h;Drivers\CMSIS\Include\core_armv8mbl.h;Drivers\CMSIS\Include\core_armv8mml.h;Drivers\CMSIS\Include\core_cm0.h;Drivers\CMSIS\Include\core_cm0plus.h;Drivers\CMSIS\Include\core_cm1.h;Drivers\CMSIS\Include\core_cm23.h;Drivers\CMSIS\Include\core_cm3.h;Drivers\CMSIS\Include\core_cm33.h;Drivers\CMSIS\Include\core_cm4.h;Drivers\CMSIS\Include\core_cm7.h;Drivers\CMSIS\Include\core_sc000.h;Drivers\CMSIS\Include\core_sc300.h;Drivers\CMSIS\Include\mpu_armv7.h;Drivers\CMSIS\Include\mpu_armv8.h;Drivers\CMSIS\Include\tz_context.h;

[PreviousUsedCubeIDEFiles]
SourceFiles=Core\Src\main.c;Core\Src\stm32l1xx_it.c;Core\Src\stm32l1xx_hal_msp.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_i2c.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_rcc.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_rcc_ex.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_flash.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_flash_ex.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_flash_ramfunc.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_gpio.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_dma.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_pwr.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_pwr_ex.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_cortex.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_exti.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_tim.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_tim_ex.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_uart.c;Drivers\CMSIS\Device\ST\STM32L1xx\Source\Templates\system_stm32l1xx.c;Core\Src\system_stm32l1xx.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_i2c.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_rcc.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_rcc_ex.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_flash.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_flash_ex.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_flash_ramfunc.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_gpio.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_dma.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_pwr.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_pwr_ex.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_cortex.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_exti.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_tim.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_tim_ex.c;Drivers\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_uart.c;Drivers\CMSIS\Device\ST\STM32L1xx\Source\Templates\system_stm32l1xx.c;Core\Src\system_stm32l1xx.c;;;
HeaderPath=Drivers\STM32L1xx_HAL_Driver\Inc;Drivers\STM32L1xx_HAL_Driver\Inc\Legacy;Drivers\CMSIS\Device\ST\STM32L1xx\Include;Drivers\CMSIS\Include;Core\Inc;
CDefines=USE_HAL_DRIVER;STM32L152xE;USE_HAL_DRIVER;USE_HAL_DRIVER;

[PreviousGenFiles]
AdvancedFolderStructure=true
HeaderFileListSize=3
HeaderFiles#0=..\Core\Inc\stm32l1xx_it.h
HeaderFiles#1=..\Core\Inc\stm32l1xx_hal_conf.h
HeaderFiles#2=..\Core\Inc\main.h
HeaderFolderListSize=1
HeaderPath#0=..\Core\Inc
HeaderFiles=;
SourceFileListSize=3
SourceFiles#0=..\Core\Src\stm32l1xx_it.c
SourceFiles#1=..\Core\Src\stm32l1xx_hal_msp.c
SourceFiles#2=..\Core\Src\main.c
SourceFolderListSize=1
SourcePath#0=..\Core\Src
SourceFiles=;

32 changes: 32 additions & 0 deletions GPS_DRIVERS/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>GPS_DRIVERS</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.st.stm32cube.ide.mcu.MCUProjectNature</nature>
<nature>com.st.stm32cube.ide.mcu.MCUCubeProjectNature</nature>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>com.st.stm32cube.ide.mcu.MCUCubeIdeServicesRevAev2ProjectNature</nature>
<nature>com.st.stm32cube.ide.mcu.MCUAdvancedStructureProjectNature</nature>
<nature>com.st.stm32cube.ide.mcu.MCUSingleCpuProjectNature</nature>
<nature>com.st.stm32cube.ide.mcu.MCURootProjectNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
</projectDescription>
2 changes: 2 additions & 0 deletions GPS_DRIVERS/.settings/com.st.stm32cube.ide.mcu.sfrview.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
sfrviewstate={"fFavorites"\:{"fLists"\:{}},"fProperties"\:{"fNodeProperties"\:{}}}
25 changes: 25 additions & 0 deletions GPS_DRIVERS/.settings/language.settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project>
<configuration id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.68605761" name="Debug">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="1466955137373753251" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
</extension>
</configuration>
<configuration id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.release.1375633609" name="Release">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="1466955137373753251" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
</extension>
</configuration>
</project>
5 changes: 5 additions & 0 deletions GPS_DRIVERS/.settings/stm32cubeide.project.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
635E684B79701B039C64EA45C3F84D30=1A939CABBB88A3663958E56CF4748F57
66BE74F758C12D739921AEA421D593D3=0
8DF89ED150041C4CBC7CB9A9CAA90856=C9D8D67AD006D7107F8B5EB7AA47F88D
DC22A860405A8BF2F2C095E5B6529F12=9FA0E749C26A7524EBA32EE38D54C304
eclipse.preferences.version=1
103 changes: 103 additions & 0 deletions GPS_DRIVERS/Core/Inc/M8N.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
/*
* M8N.h
*
* Created on: Oct 13, 2023
* Author: Nathan Ante
*/


#ifndef INC_M8N_H_
#define INC_M8N_H_

#include<stdint.h>

/*-------------- Private Macros --------------*/
#define GPS_DEVICE_ADDRESS (0x42 << 1) // GPS device address is 0x42, left-shifted for STM32 uses 7-bit address
#define GPS_DATA_REGISTER 0xFF // register address for GPS data stream

// In case for "random access" read from i2c (refer to page 38 of data sheet)
#define GPS_DATA_LENGTH_HIGH 0xFD // register address for GPS data length (high byte)
#define GPS_DATA_LENGTH_LOW 0xFE // register address for GPS data length (low byte)

/*
* This struct consists of the values parsed from the message rectrieved from the receiver.
* Created an identifier called NavData for ease of use
*/
typedef struct UBX_M8N_NAV_POSLLH {
uint32_t iTOW; // GPS time of week of the navigation epoch (ms)
int32_t lon; // Longitude (deg)
int32_t lat; // Latitude (deg)
int32_t height; // Height above ellipsoid (mm)
int32_t hMSL; // Height above mean sea level (mm)
uint32_t hAcc; // Horizontal accuracy estimate (mm)
uint32_t vAcc; // Vertical accuracy estimate (mm)
} NavData;

/* This function parses the payload retreived from the NAV_POSLLH message and
* stores the values in the NAV_POSLLH_Data struct object. These are real world values,
* description and units for these values are commented in the struct declaration above.
*
* Arguments:
* pointer to buffer
*
* Refer to U-Blox 8 / U-Blox M8 Receiver desciption and protocol specification
* Section 32.17.16 UBX-NAV-POSLLH (0x01 0x02)
* Page 374
*/
void UBX_M8N_NAV_POSLLH_Parsing(uint8_t *buffer, NavData* data);

/* This function validates the data retrieved from the GPS receiver using a checksum.
* Checksum is calculated over the message, starting and including CLASS field byte up
* until but not including the Checksum field bytes. After calculating the checksum from
* the message payload, compare with CHECKSUM fields in buffer, if equal then data from
* message is valid.
*
* Arguments:
* pointer to buffer(message)
* length of buffer
*
* Returns:
* 16 bit unsigned integer / 2 byte checksum
* i.e. [CK_A][CK_B] where CK_A and CK_B are 8 bit unsigned integers / byte
*
* Refer to U-Blox 8 / U-Blox M8 Receiver desciption and protocol specification
* Section 32.4 UBX Checksum
* Page 171
*/
uint16_t UBX_M8N_CHECKSUM(uint8_t *buffer, uint8_t buflen);


/* This function sets a desired configuration in the GPS receiver, it does this by transmitting
* a UBX-CFG message to the receiver, upon receiving, the receiver will transmit either a
* UBX-ACK-ACK message upon successful configuration, or a UBX-ACK-NAK message upon unsuccessful
* configuration.
*
* Arguments:
* pointer to buffer(config message)
* length of buffer
*
* No returns, function will terminate program upon unsuccessful configuration
*
* Refer to U-Blox 8 / U-Blox M8 Receiver desciption and protocol specification
*/
void CONFIG_Transmit(uint8_t *buffer, uint16_t buflen);

/* Initialize GPS with our desired configs
* i.e. i2c communication with UBX message protocol
*/
void GPS_Initialization(void);

/* After writing to the GPS Data Stream Register (i.e. configs and such),
* the receiver should store its response in the same register. It also stores
* the length of the response on registers 0xFD (high-byte) abd 0xFE (low-byte).
*
* This function retrieves the length from registers 0xFD and 0xFE and returns it as a uint16_t
*/
uint16_t UBX_GET_LENGTH(void);


void UBX_Transmit(uint8_t *buffer, uint16_t buflen);

void UBX_Receive(uint8_t *buffer, uint16_t buflen);

#endif /* INC_M8N_H_ */
72 changes: 72 additions & 0 deletions GPS_DRIVERS/Core/Inc/main.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file : main.h
* @brief : Header for main.c file.
* This file contains the common defines of the application.
******************************************************************************
* @attention
*
* Copyright (c) 2023 STMicroelectronics.
* All rights reserved.
*
* This software is licensed under terms that can be found in the LICENSE file
* in the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
******************************************************************************
*/
/* USER CODE END Header */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MAIN_H
#define __MAIN_H

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "stm32l1xx_hal.h"

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */

/* USER CODE END Includes */

/* Exported types ------------------------------------------------------------*/
/* USER CODE BEGIN ET */

/* USER CODE END ET */

/* Exported constants --------------------------------------------------------*/
/* USER CODE BEGIN EC */

/* USER CODE END EC */

/* Exported macro ------------------------------------------------------------*/
/* USER CODE BEGIN EM */

/* USER CODE END EM */

/* Exported functions prototypes ---------------------------------------------*/
void Error_Handler(void);

/* USER CODE BEGIN EFP */

/* USER CODE END EFP */

/* Private defines -----------------------------------------------------------*/
#define B1_Pin GPIO_PIN_13
#define B1_GPIO_Port GPIOC
#define B1_EXTI_IRQn EXTI15_10_IRQn

/* USER CODE BEGIN Private defines */

/* USER CODE END Private defines */

#ifdef __cplusplus
}
#endif

#endif /* __MAIN_H */
Loading