Skip to content

Commit 085a64d

Browse files
committed
cleanup headers
1 parent 22de7b1 commit 085a64d

File tree

3 files changed

+44
-62
lines changed

3 files changed

+44
-62
lines changed

src/SparkFun_TMAG5273_Arduino_Library.cpp

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
1-
/******************************************************************************
2-
SparkFunTMAG5273.cpp
3-
SparkFunTMAG5273 Library Source File
4-
Madison Chodikov @ SparkFun Electronics
5-
Original Creation Date: May 1st, 2023
6-
https://github.com/sparkfun/SparkFun_TMAG5273_Arduino_Library
7-
8-
This file implements all functions of the TMAG5273. Functions here range
9-
from reading the X, Y,and Z Magnetic Fields, to reading and writing various
10-
settings in the sensor.
11-
12-
Development environment specifics:
13-
IDE: Arduino 2.1.0
14-
Hardware Platform: Arduino Uno
15-
TMAG5273 Breakout Version: 1.0.1
16-
Distributed as-is; no warranty is given.
17-
******************************************************************************/
18-
1+
/**
2+
* @file SparkFun_TMAG5273_Arduino_Library.cpp
3+
* @brief Arduino library implementation for the SparkFun TMAG5273 Magnetic Sensor.
4+
*
5+
* Library repository: https://github.com/sparkfun/SparkFun_TMAG5273_Arduino_Library
6+
*
7+
* @author SparkFun Electronics
8+
* @date 2025
9+
* @copyright Copyright (c) 2023-2025 SparkFun Electronics Inc.
10+
*
11+
* SPDX-License-Identifier: MIT
12+
*
13+
*/
1914
#include "SparkFun_TMAG5273_Arduino_Library.h"
2015
#include <Arduino.h>
2116
#include <Wire.h>

src/SparkFun_TMAG5273_Arduino_Library.h

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,18 @@
1-
/******************************************************************************
2-
SparkFun_TMAG5273_Arduino_Library.h
3-
SparkFunTMAG5273 Library Source File
4-
Madison Chodikov @ SparkFun Electronics
5-
Original Creation Date: May 1st, 2023
6-
https://github.com/sparkfun/SparkFun_TMAG5273_Arduino_Library
7-
8-
This header file implements all functions of the TMAG5273. Functions here range
9-
from reading the X, Y,and Z Magnetic Fields, to reading and writing various
10-
settings in the sensor.
11-
12-
Development environment specifics:
13-
IDE: Arduino 2.1.0
14-
Hardware Platform: Arduino Uno
15-
TMAG5273 Breakout Version: 1.0.1
16-
Distributed as-is; no warranty is given.
17-
******************************************************************************/
18-
19-
#ifndef __SparkFun_TMAG5273_Arduino_Library_H__
20-
#define __SparkFun_TMAG5273_Arduino_Library_H__
1+
/**
2+
* @file SparkFun_TMAG5273_Arduino_Library.h
3+
* @brief Arduino library header for the SparkFun TMAG5273 Magnetic Sensor.
4+
*
5+
* Library repository: https://github.com/sparkfun/SparkFun_TMAG5273_Arduino_Library
6+
*
7+
* @author SparkFun Electronics
8+
* @date 2025
9+
* @copyright Copyright (c) 2023-2025 SparkFun Electronics Inc. This project is released under the MIT License.
10+
*
11+
* SPDX-License-Identifier: MIT
12+
*
13+
*/
14+
15+
#pragma once
2116

2217
#include <Arduino.h>
2318
#include <Wire.h>
@@ -194,5 +189,3 @@ class TMAG5273
194189
*/
195190
sfTkArdI2C _theI2CBus;
196191
};
197-
198-
#endif

src/SparkFun_TMAG5273_Arduino_Library_Defs.h

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
1-
/******************************************************************************
2-
SparkFun_TMAG5273_Arduino_Library_Defs.h
3-
SparkFunTMAG5273 Library Definitions Header File
4-
Madison Chodikov @ SparkFun Electronics
5-
Original Creation Date: May 1st, 2023
6-
https://github.com/sparkfun/SparkFun_TMAG5273_Arduino_Library
7-
8-
This file defines all of the constants used in the device library,
9-
along with defining the registers used.
10-
11-
Development environment specifics:
12-
IDE: Arduino 2.1.0
13-
Hardware Platform: Arduino Uno
14-
TMAG5273 Breakout Version: 1.0.1
15-
Distributed as-is; no warranty is given.
16-
******************************************************************************/
171

2+
/**
3+
* @file SparkFun_TMAG5273_Arduino_Library_Defs.h
4+
* @brief Arduino library definition header for the SparkFun TMAG5273 Magnetic Sensor.
5+
*
6+
* Library repository: https://github.com/sparkfun/SparkFun_TMAG5273_Arduino_Library
7+
*
8+
* @author SparkFun Electronics
9+
* @date 2025
10+
* @copyright Copyright (c) 2023-2025 SparkFun Electronics Inc.
11+
*
12+
* SPDX-License-Identifier: MIT
13+
*
14+
*/
1815
/*
1916
Features as per datasheet
2017
- ±40mT on the X, Y linear magnetic range
@@ -25,14 +22,13 @@ Features as per datasheet
2522
- ±3 µT Offset Drift
2623
*/
2724

28-
#ifndef __SparkFun_TMAG5273_Arduino_Library_Defs_H__
29-
#define __SparkFun_TMAG5273_Arduino_Library_Defs_H__
25+
#pragma once
3026

3127
/********************************** Constant Variable Definitions **********************************/
3228
#define TMAG5273_DEVICE_ID_VALUE 0x5449 // Value found in the device ID register
3329
#define TMAG5273_I2C_ADDRESS_INITIAL 0x22 // Initial I2C address value - can be changed using functions as seen below
3430
#define TMAG5273_TSENSE_T0 25.0f // Reference temperature for TADC_T0
35-
#define TMAG5273_TADC_T0 17508 // Temp result in decimal value (from 16-buit format)
31+
#define TMAG5273_TADC_T0 17508 // Temp result in decimal value (from 16-bit format)
3632
#define TMAG5273_TADC_RES 60.1f // Temperature sensing resolution (in 16-bit format)
3733

3834
#define TMAG5273_CRC_MODE_BITS 0x80 // Bit 7
@@ -84,7 +80,7 @@ Features as per datasheet
8480

8581
#define TMAG5273_OPERATING_MODE_BITS 0x03 // Bits 1-0
8682
#define TMAG5273_OPERATING_MODE_LSB 0
87-
#define TMAG5273_STANDY_BY_MODE 0x0 // Stand-by mode
83+
#define TMAG5273_STANDBY_BY_MODE 0x0 // Stand-by mode
8884
#define TMAG5273_SLEEP_MODE 0x1 // Sleep mode
8985
#define TMAG5273_CONTINUOUS_MEASURE_MODE 0x2 // Continuous measure mode
9086
#define TMAG5273_WAKE_UP_AND_SLEEP_MODE 0x3 // Wake-up and sleep mode
@@ -271,5 +267,3 @@ const uint8_t TMAG5273_REG_ANGLE_RESULT_MSB = 0x19;
271267
const uint8_t TMAG5273_REG_ANGLE_RESULT_LSB = 0x1A;
272268
const uint8_t TMAG5273_REG_MAGNITUDE_RESULT = 0x1B;
273269
const uint8_t TMAG5273_REG_DEVICE_STATUS = 0x1C;
274-
275-
#endif

0 commit comments

Comments
 (0)