Skip to content
Merged
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
42 changes: 15 additions & 27 deletions src/SparkFun_Toolkit.h
Original file line number Diff line number Diff line change
@@ -1,27 +1,15 @@

/*
SparkFun_Toolkit.h

The MIT License (MIT)

Copyright (c) 2023 SparkFun Electronics

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions: The
above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED
"AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

*/
/**
* @file SparkFun_Toolkit.h
* @brief Arduino style header file for the SparkFun Toolkit
*
* This file contains the Arduino style header for the SparkFun Toolkit library
*
* @author SparkFun Electronics
* @date 2024-2025
* @copyright Copyright (c) 2024-2025, SparkFun Electronics Inc. This project is released under the MIT License.
*
* SPDX-License-Identifier: MIT
*/

#pragma once

Expand All @@ -31,6 +19,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// Arduino Libraries.

// Just include the toolkit headers
#include "sfeTkArdI2C.h"
#include "sfeTkArdSPI.h"
#include "sfeTkArduino.h"
#include "sfTkArdI2C.h"
#include "sfTkArdSPI.h"
#include "sfTkArduino.h"
52 changes: 52 additions & 0 deletions src/sfTk/sfTkError.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/**
* @file sfTkError.h
* @brief Header file for the SparkFun Toolkit - Base Error Code defines.
*
* This file contains the base error code definitions for the SparkFun Toolkit library.
*
* @author SparkFun Electronics
* @date 2024-2025
* @copyright Copyright (c) 2024-2025, SparkFun Electronics Inc. This project is released under the MIT License.
*
* SPDX-License-Identifier: MIT
*/


#pragma once

#include <stdint.h>

/**
* General Concept
* A SparkFun Toolkit error system. The goal is to keep this simple.
*
* This mimics a variety of systems, using an int type for error codes,
* where:
* 0 = okay
* -1 = general failure
* >0 = an informative error
*
* Since *subsystems* in the toolkit can have their own errors,
* A start range for these errors are defined. Values > than this value
* define the errors for the set subsystem. These start ranges are set
* in this file, with actual error values defined in the the respective
* subsystem header files.
*
*/
typedef int32_t sfTkError_t;

// General errors

/**
* @brief General error code for a failure. Note all errors are negative.
*/
const sfTkError_t ksfTkErrFail = -1; // general fail
/**
* @brief The error code value for success. This is always 0.
*/
const sfTkError_t ksfTkErrOk = 0; // success

/**
* @brief A base value for bus errors. All bus errors are greater than this value, in the 1000 range
*/
const sfTkError_t ksfTkErrBaseBus = 0x1000;
Loading