Group utility¶
CPU load metering. More...
Namespaces¶
Type | Name |
---|---|
namespace | daisy Hardware defines and helpers for daisy field platform. |
Classes¶
Type | Name |
---|---|
struct | DSY_SD_CardInfoTypeDef |
struct | FontDef |
class | daisy::Color |
class | daisy::Random True Random Number Generator access. |
class | daisy::RingBuffer <typename T, size> |
class | daisy::RingBuffer< T, 0 > <typename T> |
Public Attributes¶
Type | Name |
---|---|
FontDef | Font_11x18 |
FontDef | Font_16x26 |
FontDef | Font_4x6 |
FontDef | Font_4x8 |
FontDef | Font_5x8 |
FontDef | Font_6x7 |
FontDef | Font_6x8 |
FontDef | Font_7x10 |
Public Functions¶
Type | Name |
---|---|
void | BSP_SD_AbortCallback (void) |
uint8_t | BSP_SD_Erase (uint32_t StartAddr, uint32_t EndAddr) |
void | BSP_SD_GetCardInfo (DSY_SD_CardInfoTypeDef * CardInfo) |
uint8_t | BSP_SD_GetCardState (void) |
uint8_t | BSP_SD_ITConfig (void) |
uint8_t | BSP_SD_Init (void) |
uint8_t | BSP_SD_IsDetected (void) |
uint8_t | BSP_SD_ReadBlocks (uint32_t * pData, uint32_t ReadAddr, uint32_t NumOfBlocks, uint32_t Timeout) |
uint8_t | BSP_SD_ReadBlocks_DMA (uint32_t * pData, uint32_t ReadAddr, uint32_t NumOfBlocks) |
void | BSP_SD_ReadCpltCallback (void) |
uint8_t | BSP_SD_WriteBlocks (uint32_t * pData, uint32_t WriteAddr, uint32_t NumOfBlocks, uint32_t Timeout) |
uint8_t | BSP_SD_WriteBlocks_DMA (uint32_t * pData, uint32_t WriteAddr, uint32_t NumOfBlocks) |
void | BSP_SD_WriteCpltCallback (void) |
FORCE_INLINE float | cube (float x) |
void | dsy_get_unique_id (uint32_t * w0, uint32_t * w1, uint32_t * w2) |
FORCE_INLINE int16_t | f2s16 (float x) |
FORCE_INLINE int32_t | f2s24 (float x) |
FORCE_INLINE int32_t | f2s32 (float x) |
FORCE_INLINE int8_t | f2s8 (float x) |
FORCE_INLINE uint8_t | f2u8 (float x) |
FORCE_INLINE float | s162f (int16_t x) |
FORCE_INLINE float | s242f (int32_t x) |
FORCE_INLINE float | s322f (int32_t x) |
FORCE_INLINE float | s82f (int8_t x) |
FORCE_INLINE float | u82f (uint8_t x) |
Macros¶
Type | Name |
---|---|
define | BSP_SD_CardInfo [**DSY\_SD\_CardInfoTypeDef**](structDSY__SD__CardInfoTypeDef.md) |
define | DMA_BUFFER_MEM_SECTION \_\_attribute\_\_((section(".sram1\_bss"))) |
define | DTCM_MEM_SECTION \_\_attribute\_\_((section(".dtcmram\_bss"))) |
define | F2S16_SCALE 32767.0f |
define | F2S24_SCALE 8388608.0f |
define | F2S32_SCALE 2147483647.f |
define | F2S8_SCALE 127.0f |
define | F2U8_SCALE 127.0f |
define | FBIPMAX 0.999985f |
define | FBIPMIN (-[**FBIPMAX**](group__utility.md#define-fbipmax)) |
define | IN_L in[0] |
define | IN_R in[1] |
define | MSD_ERROR ((uint8\_t)0x01) |
define | MSD_ERROR_SD_NOT_PRESENT ((uint8\_t)0x02) |
define | MSD_OK ((uint8\_t)0x00) |
define | OUT_L out[0] |
define | OUT_R out[1] |
define | S162F_SCALE 3.0517578125e-05f |
define | S242F_SCALE 1.192092896e-07f |
define | S24SIGN 0x800000 |
define | S322F_SCALE 4.6566129e-10f |
define | S82F_SCALE 0.0078125f |
define | SD_DATATIMEOUT ((uint32\_t)100000000) |
define | SD_NOT_PRESENT ((uint8\_t)0x00) |
define | SD_PRESENT ((uint8\_t)0x01) |
define | SD_TRANSFER_BUSY ((uint8\_t)0x01) |
define | SD_TRANSFER_OK ((uint8\_t)0x00) |
define | U82F_SCALE 0.0078740f |
Detailed Description¶
A MappedValue
that maps an list of strings linearly.
A MappedValue
that maps an int value linearly.
A MappedValue
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.
Author:
jelliesen
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.
Author:
jelliesen
This string class is statically allocated. All of its functions can be evaluated at compile time through the power of constexpr.
Author:
jelliesen
Public Attributes Documentation¶
variable Font_11x18¶
&
variable Font_16x26¶
&
variable Font_4x6¶
These are the different sizes of fonts (width x height in pixels per character)
variable Font_4x8¶
variable Font_5x8¶
variable Font_6x7¶
variable Font_6x8¶
variable Font_7x10¶
&
Public Functions Documentation¶
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_Erase¶
Erase a section of memory
Parameters:
StartAddr
Address to start erasing atEndAddr
Address to stop erasing at
Returns:
card state, ERROR, etc.
function BSP_SD_GetCardInfo¶
Parameters:
*CardInfo
Pointer to write card info to
function BSP_SD_GetCardState¶
Returns:
card state, ERROR, etc.
function BSP_SD_ITConfig¶
Returns:
card state, ERROR, etc.
function BSP_SD_Init¶
Returns:
card state, ERROR, etc.
function BSP_SD_IsDetected¶
Returns:
Is card detected
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 fromNumOfBlocks
Number of blocks to be readTimeout
Timeout len in ms
Returns:
OK ERROR, etc.
function BSP_SD_ReadBlocks_DMA¶
No timeout
Parameters:
*pData
&ReadAddr
Address to read fromNumOfBlocks
Number of blocks to be read
Returns:
card state, ERROR, etc.
function BSP_SD_ReadCpltCallback¶
Write complete callback
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 toNumOfBlocks
Number of blocks to be writtenTimeout
Timeout len in ms
Returns:
card state, ERROR, etc.
function BSP_SD_WriteBlocks_DMA¶
No timeout
Parameters:
*pData
&WriteAddr
Address to write toNumOfBlocks
Number of blocks to be read
Returns:
card state, ERROR, etc.
function BSP_SD_WriteCpltCallback¶
Read complete callback
function cube¶
Computes cube.
Parameters:
x
Number to be cubed
Returns:
x ^ 3
function dsy_get_unique_id¶
Returns 96-bit Unique ID of the MCU
Author:
shensley
Date:
May 2020 fills the three pointer arguments with the unique ID of the MCU.
Parameters:
*w0
First pointer*w1
Second pointer*w2
Third pointer
function f2s16¶
Converts float to Signed 16-bit
function f2s24¶
Converts float to Signed 24-bit
function f2s32¶
Converts float to Signed 24-bit
function f2s8¶
Converts float to Signed 8-bit
function f2u8¶
Converts float to unsigned 8-bit
function s162f¶
Converts Signed 16-bit to float
Parameters:
x
Number to be scaled.
Returns:
Scaled number.
function s242f¶
Converts Signed 24-bit to float
function s322f¶
Converts Signed 32-bit to float
function s82f¶
Converts Signed 8-bit to float
Parameters:
x
Number to be scaled.
Returns:
Scaled number.
function u82f¶
Converts unsigned 8-bit to float
Parameters:
x
Number to be scaled.
Returns:
Scaled number.
Macro Definition Documentation¶
define BSP_SD_CardInfo¶
&
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 F2S16_SCALE¶
(2 ** 15) - 1
define F2S24_SCALE¶
2 ** 23
define F2S32_SCALE¶
(2 ** 31) - 1
define F2S8_SCALE¶
(2 ** 7) - 1
define F2U8_SCALE¶
128 - 1
define FBIPMAX¶
close to 1.0f-LSB at 16 bit
define FBIPMIN¶
- (1 - LSB)
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 MSD_ERROR¶
&
define MSD_ERROR_SD_NOT_PRESENT¶
&
define MSD_OK¶
&
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 S162F_SCALE¶
1 / (2** 15)
define S242F_SCALE¶
1 / (2 ** 23)
define S24SIGN¶
2 ** 23
define S322F_SCALE¶
1 / (2** 31)
define S82F_SCALE¶
1 / (2**7)
define SD_DATATIMEOUT¶
&
define SD_NOT_PRESENT¶
&
define SD_PRESENT¶
&
define SD_TRANSFER_BUSY¶
&
define SD_TRANSFER_OK¶
&
define U82F_SCALE¶
1 / 127