UTILITY¶
Module: LIBDAISY
General Utilities (Ringbuffers, FIFOs, LED Colors, etc.) More...
Classes¶
Name | |
---|---|
struct | dsy_gpio_pin |
class | daisy::Random True Random Number Generator access. |
struct | DSY_SD_CardInfoTypeDef |
class | daisy::Color |
struct | FontDef |
class | daisy::RingBuffer |
class | daisy::RingBuffer< T, 0 > |
Types¶
Name | |
---|---|
enum | dsy_gpio_port |
Functions¶
Name | |
---|---|
FORCE_INLINE float | cube(float x) |
FORCE_INLINE float | u82f(uint8_t x) |
FORCE_INLINE uint8_t | f2u8(float x) |
FORCE_INLINE float | s82f(int8_t x) |
FORCE_INLINE int8_t | f2s8(float x) |
FORCE_INLINE float | s162f(int16_t x) |
FORCE_INLINE int16_t | f2s16(float x) |
FORCE_INLINE float | s242f(int32_t x) |
FORCE_INLINE int32_t | f2s24(float x) |
FORCE_INLINE float | s322f(int32_t x) |
FORCE_INLINE int32_t | f2s32(float x) |
FORCE_INLINE dsy_gpio_pin | dsy_pin(dsy_gpio_port port, uint8_t pin) |
FORCE_INLINE uint8_t | dsy_pin_cmp(dsy_gpio_pin * a, dsy_gpio_pin * b) |
uint8_t | BSP_SD_Init(void ) |
uint8_t | BSP_SD_ITConfig(void ) |
uint8_t | BSP_SD_ReadBlocks(uint32_t * pData, uint32_t ReadAddr, uint32_t NumOfBlocks, uint32_t Timeout) |
uint8_t | BSP_SD_WriteBlocks(uint32_t * pData, uint32_t WriteAddr, uint32_t NumOfBlocks, uint32_t Timeout) |
uint8_t | BSP_SD_ReadBlocks_DMA(uint32_t * pData, uint32_t ReadAddr, uint32_t NumOfBlocks) |
uint8_t | BSP_SD_WriteBlocks_DMA(uint32_t * pData, uint32_t WriteAddr, uint32_t NumOfBlocks) |
uint8_t | BSP_SD_Erase(uint32_t StartAddr, uint32_t EndAddr) |
uint8_t | BSP_SD_GetCardState(void ) |
void | BSP_SD_GetCardInfo(DSY_SD_CardInfoTypeDef * CardInfo) |
uint8_t | BSP_SD_IsDetected(void ) |
void | BSP_SD_AbortCallback(void ) |
void | BSP_SD_WriteCpltCallback(void ) |
void | BSP_SD_ReadCpltCallback(void ) |
GPIO_TypeDef * | dsy_hal_map_get_port(const dsy_gpio_pin * p) |
uint16_t | dsy_hal_map_get_pin(const dsy_gpio_pin * p) |
void | dsy_hal_map_gpio_clk_enable(dsy_gpio_port port) |
void | dsy_get_unique_id(uint32_t * w0, uint32_t * w1, uint32_t * w2) |
Attributes¶
Name | |
---|---|
FontDef | Font_6x8 |
FontDef | Font_7x10 |
FontDef | Font_11x18 |
FontDef | Font_16x26 |
Defines¶
Detailed Description¶
General Utilities (Ringbuffers, FIFOs, LED Colors, etc.)
Author:
- jelliesen
- jelliesen
- jelliesen
A [MappedValue](/libDaisy/Classes/classdaisy_1_1_mapped_value/)
that maps an list of strings linearly.
A [MappedValue](/libDaisy/Classes/classdaisy_1_1_mapped_value/)
that maps an int value linearly.
A [MappedValue](/libDaisy/Classes/classdaisy_1_1_mapped_value/)
that maps a float value using various mapping functions.
Abstract base class for a value that is mapped to a 0..1 normalized range.
A safe and convenient statically allocated string with constexpr powers.
CPU load metering.
To measure the CPU load of your audio processing, create a CpuLoadMeter and initialize it with your block size and sample rate. Then at the beginning of the audio callback, call OnBlockStart()
, and at the end of the audio callback, call OnBlockEnd()
. You can then read out the minimum, maximum and average CPU load.
This string class is statically allocated. All of its functions can be evaluated at compile time through the power of constexpr.
Types Documentation¶
enum dsy_gpio_port¶
Enumerator | Value | Description |
---|---|---|
DSY_GPIOA | & | |
DSY_GPIOB | & | |
DSY_GPIOC | & | |
DSY_GPIOD | & | |
DSY_GPIOE | & | |
DSY_GPIOF | & | |
DSY_GPIOG | & | |
DSY_GPIOH | & | |
DSY_GPIOI | & | |
DSY_GPIOJ | & | |
DSY_GPIOK | & | |
DSY_GPIOX | ||
DSY_GPIO_LAST | This is a non-existant port for unsupported bits of hardware. |
Enums and a simple struct for defining a hardware pin on the MCU These correlate with the stm32 datasheet, and are used to configure the hardware.
This along with the dsy_gpio_pin class should no longer be used. They are available for backwards compatability.
Please use GPIOPort enum and the Pin struct instead.
Functions Documentation¶
function cube¶
Parameters:
- x Number to be cubed
Return: x ^ 3
Computes cube.
function u82f¶
Parameters:
- x Number to be scaled.
Return: Scaled number.
Converts unsigned 8-bit to float
< 1 / 127
function f2u8¶
Converts float to unsigned 8-bit
< close to 1.0f-LSB at 16 bit
< - (1 - LSB)
< close to 1.0f-LSB at 16 bit
< - (1 - LSB)
< close to 1.0f-LSB at 16 bit
< close to 1.0f-LSB at 16 bit
< 128 - 1
< 128 - 1
function s82f¶
Parameters:
- x Number to be scaled.
Return: Scaled number.
Converts Signed 8-bit to float
< 1 / (2**7)
function f2s8¶
Converts float to Signed 8-bit
< close to 1.0f-LSB at 16 bit
< - (1 - LSB)
< close to 1.0f-LSB at 16 bit
< - (1 - LSB)
< close to 1.0f-LSB at 16 bit
< close to 1.0f-LSB at 16 bit
< (2 ** 7) - 1
function s162f¶
Parameters:
- x Number to be scaled.
Return: Scaled number.
Converts Signed 16-bit to float
< 1 / (2** 15)
function f2s16¶
Converts float to Signed 16-bit
< close to 1.0f-LSB at 16 bit
< - (1 - LSB)
< close to 1.0f-LSB at 16 bit
< - (1 - LSB)
< close to 1.0f-LSB at 16 bit
< close to 1.0f-LSB at 16 bit
< (2 ** 15) - 1
function s242f¶
Converts Signed 24-bit to float
< 2 ** 23
< 2 ** 23
< 1 / (2 ** 23)
function f2s24¶
Converts float to Signed 24-bit
< close to 1.0f-LSB at 16 bit
< - (1 - LSB)
< close to 1.0f-LSB at 16 bit
< - (1 - LSB)
< close to 1.0f-LSB at 16 bit
< close to 1.0f-LSB at 16 bit
< 2 ** 23
function s322f¶
Converts Signed 32-bit to float
< 1 / (2** 31)
function f2s32¶
Converts float to Signed 24-bit
< close to 1.0f-LSB at 16 bit
< - (1 - LSB)
< close to 1.0f-LSB at 16 bit
< - (1 - LSB)
< close to 1.0f-LSB at 16 bit
< close to 1.0f-LSB at 16 bit
< (2 ** 31) - 1
function dsy_pin¶
Helper for creating pins from port/pin combos easily
The dsy_gpio_pin struct should no longer be used, and is only available for backwards compatability.
Please use Pin struct instead.
function dsy_pin_cmp¶
Return: 1 if same, 0 if different
Helper for testing sameness of two dsy_gpio_pins The dsy_gpio_pin struct should no longer be used, and is only available for backwards compatability.
Please use Pin struct instead.
function BSP_SD_Init¶
Return: card state, ERROR, etc.
function BSP_SD_ITConfig¶
Return: card state, ERROR, etc.
function BSP_SD_ReadBlocks¶
uint8_t BSP_SD_ReadBlocks(
uint32_t * pData,
uint32_t ReadAddr,
uint32_t NumOfBlocks,
uint32_t Timeout
)
Parameters:
- ***pData** &
- ReadAddr Address to read from
- NumOfBlocks Number of blocks to be read
- Timeout Timeout len in ms
Return: OK ERROR, etc.
function BSP_SD_WriteBlocks¶
uint8_t BSP_SD_WriteBlocks(
uint32_t * pData,
uint32_t WriteAddr,
uint32_t NumOfBlocks,
uint32_t Timeout
)
Parameters:
- ***pData** &
- WriteAddr Address to write to
- NumOfBlocks Number of blocks to be written
- Timeout Timeout len in ms
Return: card state, ERROR, etc.
function BSP_SD_ReadBlocks_DMA¶
Parameters:
- ***pData** &
- ReadAddr Address to read from
- NumOfBlocks Number of blocks to be read
Return: card state, ERROR, etc.
No timeout
function BSP_SD_WriteBlocks_DMA¶
Parameters:
- ***pData** &
- WriteAddr Address to write to
- NumOfBlocks Number of blocks to be read
Return: card state, ERROR, etc.
No timeout
function BSP_SD_Erase¶
Parameters:
- StartAddr Address to start erasing at
- EndAddr Address to stop erasing at
Return: card state, ERROR, etc.
Erase a section of memory
function BSP_SD_GetCardState¶
Return: card state, ERROR, etc.
function BSP_SD_GetCardInfo¶
Parameters:
- ***CardInfo** Pointer to write card info to
function BSP_SD_IsDetected¶
Return: Is card detected
function BSP_SD_AbortCallback¶
These functions can be modified in case the current settings (e.g. DMA stream) need to be changed for specific application needs /n
Abort the callback
function BSP_SD_WriteCpltCallback¶
Read complete callback
function BSP_SD_ReadCpltCallback¶
Write complete callback
function dsy_hal_map_get_port¶
Parameters:
- ***p** Pin pin to get
Return: HAL GPIO_TypeDef as used in the HAL from a dsy_gpio_pin input.
global structs, and helper functions for interfacing with the stm32 HAL library while it remains a dependancy. This file should only be included from source files (c/cpp) Including it from a header within libdaisy would expose the entire HAL to the users. This should be an option for users, but should not be required.
function dsy_hal_map_get_pin¶
Parameters:
- ***p** Pin pin to get
Return: HAL GPIO Pin as used in the HAL from a dsy_gpio_pin input.
function dsy_hal_map_gpio_clk_enable¶
Parameters:
- port port clock to enable
function dsy_get_unique_id¶
Parameters:
- ***w0** First pointer
- ***w1** Second pointer
- ***w2** Third pointer
Author: shensley
Date: May 2020 fills the three pointer arguments with the unique ID of the MCU.
Returns 96-bit Unique ID of the MCU
Attributes Documentation¶
variable Font_6x8¶
These are the different sizes of fonts (width x height in pixels per character)
variable Font_7x10¶
&
variable Font_11x18¶
&
variable Font_16x26¶
&
Macros Documentation¶
define DMA_BUFFER_MEM_SECTION¶
Macro for area of memory that is configured as cacheless This should be used primarily for DMA buffers, and the like.
define DTCM_MEM_SECTION¶
THE DTCM RAM section is also non-cached. However, is not suitable for DMA transfers. Performance is on par with internal SRAM w/ cache enabled.
define FBIPMAX¶
close to 1.0f-LSB at 16 bit
define FBIPMIN¶
- (1 - LSB)
define U82F_SCALE¶
1 / 127
define F2U8_SCALE¶
128 - 1
define S82F_SCALE¶
1 / (2**7)
define F2S8_SCALE¶
(2 ** 7) - 1
define S162F_SCALE¶
1 / (2** 15)
define F2S16_SCALE¶
(2 ** 15) - 1
define F2S24_SCALE¶
2 ** 23
define S242F_SCALE¶
1 / (2 ** 23)
define S24SIGN¶
2 ** 23
define S322F_SCALE¶
1 / (2** 31)
define F2S32_SCALE¶
(2 ** 31) - 1
define OUT_L¶
shorthand macro for simplifying the reading of the left channel of a non-interleaved output buffer named out
define OUT_R¶
shorthand macro for simplifying the reading of the right channel of a non-interleaved output buffer named out
define IN_L¶
shorthand macro for simplifying the reading of the left channel of a non-interleaved input buffer named in
define IN_R¶
shorthand macro for simplifying the reading of the right channel of a non-interleaved input buffer named in
define BSP_SD_CardInfo¶
&
define MSD_OK¶
&
define MSD_ERROR¶
&
define MSD_ERROR_SD_NOT_PRESENT¶
&
define SD_TRANSFER_OK¶
&
define SD_TRANSFER_BUSY¶
&
define SD_PRESENT¶
&
define SD_NOT_PRESENT¶
&
define SD_DATATIMEOUT¶
&
Updated on 2024-01-03 at 19:41:01 +0000