SparkFun Toolkit  v1.0.5-6-g34ffa30
Core Functionality Library
Loading...
Searching...
No Matches
sfToolkit.h
Go to the documentation of this file.
1
16#pragma once
17
18#include <stdint.h>
19
23#include "sfTkError.h"
24
25// byte order types/enum
26enum class sfTkByteOrder : uint8_t
27{
28 BigEndian = 0x01,
29 LittleEndian = 0x02
30};
31
32// Note - toolkit *functions* start with sftk_ to avoid name collisions
33
34// Function to determine the byte order of the system
36
37uint8_t sftk_byte_swap(uint8_t i);
38uint16_t sftk_byte_swap(uint16_t i);
39uint32_t sftk_byte_swap(uint32_t i);
40int16_t sftk_byte_swap(int16_t i);
41int32_t sftk_byte_swap(int32_t i);
42
43// Area for platform specific implementations. The interface/functions are
44// defined here, with the expectation that the platform provides the implementation.
45
46// delay in milliseconds
47void sftk_delay_ms(uint32_t ms);
48
49// ticks in milliseconds
50uint32_t sftk_ticks_ms(void);
51
61#define SFTK_CHECK_BITS_SET(__value__, __bitmask__) (((__value__) & (__bitmask__)) == __bitmask__)
62
72#define SFTK_CHECK_BITS_CLEARED(__value__, __bitmask__) (((__value__) & (__bitmask__)) == 0)
Header file for the SparkFun Toolkit - Base Error Code defines.
sfTkByteOrder
Common include file for the core of the SparkFun Electronics Toolkit.
Definition: sfToolkit.h:27
sfTkByteOrder sftk_system_byteorder(void)
C function - Runtime check for system byte order.
Definition: sfToolkit.cpp:24
void sftk_delay_ms(uint32_t ms)
Definition: sfTkArduino.cpp:18
uint8_t sftk_byte_swap(uint8_t i)
to catch 8 bit calls for byte swap
Definition: sfToolkit.cpp:35
uint32_t sftk_ticks_ms(void)
Definition: sfTkArduino.cpp:23