SparkFun Toolkit  v1.0.5-6-g34ffa30
Core Functionality Library
Loading...
Searching...
No Matches
sfToolkit.h File Reference

Header file for the SparkFun Toolkit. More...

#include <stdint.h>
#include "sfTkError.h"
Include dependency graph for sfToolkit.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SFTK_CHECK_BITS_SET(__value__, __bitmask__)   (((__value__) & (__bitmask__)) == __bitmask__)
 Check if specific bits are set in a value. More...
 
#define SFTK_CHECK_BITS_CLEARED(__value__, __bitmask__)   (((__value__) & (__bitmask__)) == 0)
 Check if specific bits are cleared in a value. More...
 

Enumerations

enum class  sfTkByteOrder : uint8_t { BigEndian = 0x01 , LittleEndian = 0x02 }
 Common include file for the core of the SparkFun Electronics Toolkit. More...
 

Functions

sfTkByteOrder sftk_system_byteorder (void)
 C function - Runtime check for system byte order. More...
 
uint8_t sftk_byte_swap (uint8_t i)
 to catch 8 bit calls for byte swap More...
 
uint16_t sftk_byte_swap (uint16_t i)
 function - Byte swap a 16 bit value More...
 
uint32_t sftk_byte_swap (uint32_t i)
 function - Byte swap a 32 bit value More...
 
int16_t sftk_byte_swap (int16_t i)
 function - Byte swap an int 16 More...
 
int32_t sftk_byte_swap (int32_t i)
 function - Byte swap an int 32 More...
 
void sftk_delay_ms (uint32_t ms)
 
uint32_t sftk_ticks_ms (void)
 

Detailed Description

Header file for the SparkFun Toolkit.

This file contains the declarations of various utility functions and types for the SparkFun Toolkit library.

Author
SparkFun Electronics
Date
2024-2025

SPDX-License-Identifier: MIT

Macro Definition Documentation

◆ SFTK_CHECK_BITS_CLEARED

#define SFTK_CHECK_BITS_CLEARED (   __value__,
  __bitmask__ 
)    (((__value__) & (__bitmask__)) == 0)

Check if specific bits are cleared in a value.

This macro checks if the bits specified by the bitmask are cleared in the given value.

Parameters
__value__The value to check.
__bitmask__The bitmask specifying which bits to check.
Returns
True if all bits specified by the bitmask are cleared, false otherwise.

◆ SFTK_CHECK_BITS_SET

#define SFTK_CHECK_BITS_SET (   __value__,
  __bitmask__ 
)    (((__value__) & (__bitmask__)) == __bitmask__)

Check if specific bits are set in a value.

This macro checks if the bits specified by the bitmask are set in the given value.

Parameters
__value__The value to check.
__bitmask__The bitmask specifying which bits to check.
Returns
True if all bits specified by the bitmask are set, false otherwise.

Enumeration Type Documentation

◆ sfTkByteOrder

enum class sfTkByteOrder : uint8_t
strong

Common include file for the core of the SparkFun Electronics Toolkit.

Enumerator
BigEndian 
LittleEndian 

Function Documentation

◆ sftk_byte_swap() [1/5]

int16_t sftk_byte_swap ( int16_t  i)

function - Byte swap an int 16

◆ sftk_byte_swap() [2/5]

int32_t sftk_byte_swap ( int32_t  i)

function - Byte swap an int 32

◆ sftk_byte_swap() [3/5]

uint16_t sftk_byte_swap ( uint16_t  i)

function - Byte swap a 16 bit value

◆ sftk_byte_swap() [4/5]

uint32_t sftk_byte_swap ( uint32_t  i)

function - Byte swap a 32 bit value

◆ sftk_byte_swap() [5/5]

uint8_t sftk_byte_swap ( uint8_t  i)

to catch 8 bit calls for byte swap

◆ sftk_delay_ms()

void sftk_delay_ms ( uint32_t  ms)

◆ sftk_system_byteorder()

sfTkByteOrder sftk_system_byteorder ( void  )

C function - Runtime check for system byte order.

◆ sftk_ticks_ms()

uint32_t sftk_ticks_ms ( void  )