Unified · Split
Binary file not shown.
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1,50 @@ | ||
| 1 | +/* | |
| 2 | + * MIDI_application.h | |
| 3 | + * Created on: 6 d�c. 2014 | |
| 4 | + * Author: Xavier Halgand | |
| 5 | + * | |
| 6 | + * Modified on: 9/12/16 by C.P. to handle the MIDI_IDLE state properly, and | |
| 7 | + * added required code to be compatible with "NucleoSynth" | |
| 8 | + * | |
| 9 | + */ | |
| 10 | + | |
| 11 | +#ifndef MIDI_APPLICATION_H_ | |
| 12 | +#define MIDI_APPLICATION_H_ | |
| 13 | + | |
| 14 | +/* Includes ------------------------------------------------------------------*/ | |
| 15 | + | |
| 16 | +#include "stdio.h" | |
| 17 | +#include "usbh_core.h" | |
| 18 | +#include "usbh_MIDI.h" | |
| 19 | +#include "main.h" | |
| 20 | + | |
| 21 | +#include <math.h> | |
| 22 | +#include <stdint.h> | |
| 23 | +#include <stdbool.h> | |
| 24 | + | |
| 25 | +/*------------------------------------------------------------------------------*/ | |
| 26 | +typedef enum | |
| 27 | +{ | |
| 28 | + MIDI_APPLICATION_IDLE = 0, | |
| 29 | + MIDI_APPLICATION_START, | |
| 30 | + MIDI_APPLICATION_READY, | |
| 31 | + MIDI_APPLICATION_RUNNING, | |
| 32 | + MIDI_APPLICATION_DISCONNECT | |
| 33 | +} | |
| 34 | +MIDI_ApplicationTypeDef; | |
| 35 | + | |
| 36 | + | |
| 37 | +#define RX_BUFF_SIZE 64 /* Max Received data 64 bytes */ | |
| 38 | + | |
| 39 | +extern uint8_t MIDI_RX_Buffer[RX_BUFF_SIZE];// __ATTR_RAM_D2; // MIDI reception buffer | |
| 40 | +extern uint8_t CCs[128]; | |
| 41 | + | |
| 42 | +extern uint8_t MIDIStartOfFrame; | |
| 43 | + | |
| 44 | +/* Exported functions ------------------------------------------------------- */ | |
| 45 | +void MIDI_Application(void); | |
| 46 | +void LocalMidiHandler(uint8_t param, uint8_t data); | |
| 47 | +void ProcessReceivedMidiDatas(uint32_t myLength); | |
| 48 | + | |
| 49 | +/*------------------------------------------------------------------------------*/ | |
| 50 | +#endif /* MIDI_APPLICATION_H_ */ | |
| @@ -0,0 +1,58 @@ | ||
| 1 | +/** | |
| 2 | + ****************************************************************************** | |
| 3 | + * File Name : ADC.h | |
| 4 | + * Description : This file provides code for the configuration | |
| 5 | + * of the ADC instances. | |
| 6 | + ****************************************************************************** | |
| 7 | + * @attention | |
| 8 | + * | |
| 9 | + * <h2><center>© Copyright (c) 2020 STMicroelectronics. | |
| 10 | + * All rights reserved.</center></h2> | |
| 11 | + * | |
| 12 | + * This software component is licensed by ST under Ultimate Liberty license | |
| 13 | + * SLA0044, the "License"; You may not use this file except in compliance with | |
| 14 | + * the License. You may obtain a copy of the License at: | |
| 15 | + * www.st.com/SLA0044 | |
| 16 | + * | |
| 17 | + ****************************************************************************** | |
| 18 | + */ | |
| 19 | +/* Define to prevent recursive inclusion -------------------------------------*/ | |
| 20 | +#ifndef __adc_H | |
| 21 | +#define __adc_H | |
| 22 | +#ifdef __cplusplus | |
| 23 | + extern "C" { | |
| 24 | +#endif | |
| 25 | + | |
| 26 | +/* Includes ------------------------------------------------------------------*/ | |
| 27 | +#include "main.h" | |
| 28 | + | |
| 29 | +/* USER CODE BEGIN Includes */ | |
| 30 | + | |
| 31 | +/* USER CODE END Includes */ | |
| 32 | + | |
| 33 | +extern ADC_HandleTypeDef hadc1; | |
| 34 | + | |
| 35 | +/* USER CODE BEGIN Private defines */ | |
| 36 | + | |
| 37 | +/* USER CODE END Private defines */ | |
| 38 | + | |
| 39 | +void MX_ADC1_Init(void); | |
| 40 | + | |
| 41 | +/* USER CODE BEGIN Prototypes */ | |
| 42 | + | |
| 43 | +/* USER CODE END Prototypes */ | |
| 44 | + | |
| 45 | +#ifdef __cplusplus | |
| 46 | +} | |
| 47 | +#endif | |
| 48 | +#endif /*__ adc_H */ | |
| 49 | + | |
| 50 | +/** | |
| 51 | + * @} | |
| 52 | + */ | |
| 53 | + | |
| 54 | +/** | |
| 55 | + * @} | |
| 56 | + */ | |
| 57 | + | |
| 58 | +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |
| @@ -0,0 +1,93 @@ | ||
| 1 | +/** | |
| 2 | + ****************************************************************************** | |
| 3 | + * @file Audio_playback_and_record/inc/waveplayer.h | |
| 4 | + * @author MCD Application Team | |
| 5 | + * @version V1.1.0 | |
| 6 | + * @date 26-June-2014 | |
| 7 | + * @brief Header for waveplayer.c module. | |
| 8 | + ****************************************************************************** | |
| 9 | + * @attention | |
| 10 | + * | |
| 11 | + * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2> | |
| 12 | + * | |
| 13 | + * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); | |
| 14 | + * You may not use this file except in compliance with the License. | |
| 15 | + * You may obtain a copy of the License at: | |
| 16 | + * | |
| 17 | + * http://www.st.com/software_license_agreement_liberty_v2 | |
| 18 | + * | |
| 19 | + * Unless required by applicable law or agreed to in writing, software | |
| 20 | + * distributed under the License is distributed on an "AS IS" BASIS, | |
| 21 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 22 | + * See the License for the specific language governing permissions and | |
| 23 | + * limitations under the License. | |
| 24 | + * | |
| 25 | + ****************************************************************************** | |
| 26 | + */ | |
| 27 | +/* Define to prevent recursive inclusion -------------------------------------*/ | |
| 28 | +#ifndef __AUDIOSTREAM_H | |
| 29 | +#define __AUDIOSTREAM_H | |
| 30 | + | |
| 31 | +/* Includes ------------------------------------------------------------------*/ | |
| 32 | +#include "stm32h7xx_hal.h" | |
| 33 | +#include "leaf.h" | |
| 34 | +#include "main.h" | |
| 35 | + | |
| 36 | +#define AUDIO_FRAME_SIZE 128 | |
| 37 | +#define HALF_BUFFER_SIZE AUDIO_FRAME_SIZE * 2 //number of samples per half of the "double-buffer" (twice the audio frame size because there are interleaved samples for both left and right channels) | |
| 38 | +#define AUDIO_BUFFER_SIZE AUDIO_FRAME_SIZE * 4 //number of samples in the whole data structure (four times the audio frame size because of stereo and also double-buffering/ping-ponging) | |
| 39 | + | |
| 40 | + | |
| 41 | +extern int32_t audioOutBuffer[AUDIO_BUFFER_SIZE]; | |
| 42 | +extern int32_t audioInBuffer[AUDIO_BUFFER_SIZE]; | |
| 43 | +extern tMempool smallPool; | |
| 44 | +extern tMempool largePool; | |
| 45 | +extern uint8_t codecReady; | |
| 46 | +extern float sample; | |
| 47 | +extern float rightOut; | |
| 48 | +extern float rightIn; | |
| 49 | +extern tRamp adc[6]; | |
| 50 | +extern float smoothedADC[6]; | |
| 51 | +extern float audioDisplayBuffer[128]; | |
| 52 | +extern uint8_t displayBufferIndex; | |
| 53 | + | |
| 54 | +/* Exported types ------------------------------------------------------------*/ | |
| 55 | +typedef enum | |
| 56 | +{ | |
| 57 | + BUFFER_OFFSET_NONE = 0, | |
| 58 | + BUFFER_OFFSET_HALF, | |
| 59 | + BUFFER_OFFSET_FULL, | |
| 60 | +}BUFFER_StateTypeDef; | |
| 61 | + | |
| 62 | +#ifdef SAMPLERATE96K | |
| 63 | +#define SAMPLE_RATE 96000.f | |
| 64 | +#else | |
| 65 | +#define SAMPLE_RATE 48000.f | |
| 66 | +#endif | |
| 67 | + | |
| 68 | +typedef enum BOOL { | |
| 69 | + FALSE = 0, | |
| 70 | + TRUE | |
| 71 | +} BOOL; | |
| 72 | + | |
| 73 | +#define INV_SAMPLE_RATE 1.f/SAMPLE_RATE | |
| 74 | +#define SAMPLE_RATE_MS (SAMPLE_RATE / 1000.f) | |
| 75 | +#define INV_SR_MS 1.f/SAMPLE_RATE_MS | |
| 76 | +#define SAMPLE_RATE_DIV_PARAMS SAMPLE_RATE / 3 | |
| 77 | +#define SAMPLE_RATE_DIV_PARAMS_MS (SAMPLE_RATE_DIV_PARAMS / 1000.f) | |
| 78 | +#define INV_SR_DIV_PARAMS_MS 1.f/SAMPLE_RATE_DIV_PARAMS_MS | |
| 79 | + | |
| 80 | +/* Exported macro ------------------------------------------------------------*/ | |
| 81 | +/* Exported functions ------------------------------------------------------- */ | |
| 82 | +void audioInit(I2C_HandleTypeDef* hi2c, SAI_HandleTypeDef* hsaiOut, SAI_HandleTypeDef* hsaiIn); | |
| 83 | + | |
| 84 | +void initFunctionPointers(void); | |
| 85 | + | |
| 86 | +void audioFrame(uint16_t buffer_offset); | |
| 87 | + | |
| 88 | +void DMA1_TransferCpltCallback(DMA_HandleTypeDef *hdma); | |
| 89 | +void DMA1_HalfTransferCpltCallback(DMA_HandleTypeDef *hdma); | |
| 90 | + | |
| 91 | +#endif /* __AUDIOSTREAM_H */ | |
| 92 | + | |
| 93 | +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |
| @@ -0,0 +1,56 @@ | ||
| 1 | +/** | |
| 2 | + ****************************************************************************** | |
| 3 | + * File Name : dma.h | |
| 4 | + * Description : This file contains all the function prototypes for | |
| 5 | + * the dma.c file | |
| 6 | + ****************************************************************************** | |
| 7 | + * @attention | |
| 8 | + * | |
| 9 | + * <h2><center>© Copyright (c) 2020 STMicroelectronics. | |
| 10 | + * All rights reserved.</center></h2> | |
| 11 | + * | |
| 12 | + * This software component is licensed by ST under Ultimate Liberty license | |
| 13 | + * SLA0044, the "License"; You may not use this file except in compliance with | |
| 14 | + * the License. You may obtain a copy of the License at: | |
| 15 | + * www.st.com/SLA0044 | |
| 16 | + * | |
| 17 | + ****************************************************************************** | |
| 18 | + */ | |
| 19 | +/* Define to prevent recursive inclusion -------------------------------------*/ | |
| 20 | +#ifndef __bdma_H | |
| 21 | +#define __bdma_H | |
| 22 | + | |
| 23 | +#ifdef __cplusplus | |
| 24 | + extern "C" { | |
| 25 | +#endif | |
| 26 | + | |
| 27 | +/* Includes ------------------------------------------------------------------*/ | |
| 28 | +#include "main.h" | |
| 29 | + | |
| 30 | +/* DMA memory to memory transfer handles -------------------------------------*/ | |
| 31 | + | |
| 32 | +/* USER CODE BEGIN Includes */ | |
| 33 | + | |
| 34 | +/* USER CODE END Includes */ | |
| 35 | + | |
| 36 | +/* USER CODE BEGIN Private defines */ | |
| 37 | + | |
| 38 | +/* USER CODE END Private defines */ | |
| 39 | + | |
| 40 | +void MX_BDMA_Init(void); | |
| 41 | + | |
| 42 | +/* USER CODE BEGIN Prototypes */ | |
| 43 | + | |
| 44 | +/* USER CODE END Prototypes */ | |
| 45 | + | |
| 46 | +#ifdef __cplusplus | |
| 47 | +} | |
| 48 | +#endif | |
| 49 | + | |
| 50 | +#endif /* __bdma_H */ | |
| 51 | + | |
| 52 | +/** | |
| 53 | + * @} | |
| 54 | + */ | |
| 55 | + | |
| 56 | +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |
| @@ -0,0 +1,84 @@ | ||
| 1 | +/** | |
| 2 | + ****************************************************************************** | |
| 3 | + * @file bsp_driver_sd.h (based on stm32h743i_eval_sd.h) | |
| 4 | + * @brief This file contains the common defines and functions prototypes for | |
| 5 | + * the bsp_driver_sd.c driver. | |
| 6 | + ****************************************************************************** | |
| 7 | + * @attention | |
| 8 | + * | |
| 9 | + * <h2><center>© Copyright (c) 2020 STMicroelectronics. | |
| 10 | + * All rights reserved.</center></h2> | |
| 11 | + * | |
| 12 | + * This software component is licensed by ST under Ultimate Liberty license | |
| 13 | + * SLA0044, the "License"; You may not use this file except in compliance with | |
| 14 | + * the License. You may obtain a copy of the License at: | |
| 15 | + * www.st.com/SLA0044 | |
| 16 | + * | |
| 17 | + ****************************************************************************** | |
| 18 | + */ | |
| 19 | + | |
| 20 | +/* Define to prevent recursive inclusion -------------------------------------*/ | |
| 21 | +#ifndef __STM32H7_SD_H | |
| 22 | +#define __STM32H7_SD_H | |
| 23 | + | |
| 24 | +#ifdef __cplusplus | |
| 25 | + extern "C" { | |
| 26 | +#endif | |
| 27 | + | |
| 28 | +/* Includes ------------------------------------------------------------------*/ | |
| 29 | +#include "stm32h7xx_hal.h" | |
| 30 | +#include "fatfs_platform.h" | |
| 31 | + | |
| 32 | +/* Exported types --------------------------------------------------------*/ | |
| 33 | +/** | |
| 34 | + * @brief SD Card information structure | |
| 35 | + */ | |
| 36 | +#define BSP_SD_CardInfo HAL_SD_CardInfoTypeDef | |
| 37 | + | |
| 38 | +/* Exported constants --------------------------------------------------------*/ | |
| 39 | +/** | |
| 40 | + * @brief SD status structure definition | |
| 41 | + */ | |
| 42 | +#define MSD_OK ((uint8_t)0x00) | |
| 43 | +#define MSD_ERROR ((uint8_t)0x01) | |
| 44 | +#define MSD_ERROR_SD_NOT_PRESENT ((uint8_t)0x02) | |
| 45 | + | |
| 46 | +/** | |
| 47 | + * @brief SD transfer state definition | |
| 48 | + */ | |
| 49 | +#define SD_TRANSFER_OK ((uint8_t)0x00) | |
| 50 | +#define SD_TRANSFER_BUSY ((uint8_t)0x01) | |
| 51 | + | |
| 52 | +#define SD_PRESENT ((uint8_t)0x01) | |
| 53 | +#define SD_NOT_PRESENT ((uint8_t)0x00) | |
| 54 | +#define SD_DATATIMEOUT ((uint32_t)100000000) | |
| 55 | + | |
| 56 | +/* USER CODE BEGIN BSP_H_CODE */ | |
| 57 | +#define SD_DetectIRQHandler() HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_8) | |
| 58 | + | |
| 59 | +/* Exported functions --------------------------------------------------------*/ | |
| 60 | +uint8_t BSP_SD_Init(void); | |
| 61 | +uint8_t BSP_SD_ITConfig(void); | |
| 62 | +uint8_t BSP_SD_ReadBlocks(uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks, uint32_t Timeout); | |
| 63 | +uint8_t BSP_SD_WriteBlocks(uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks, uint32_t Timeout); | |
| 64 | +uint8_t BSP_SD_ReadBlocks_DMA(uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks); | |
| 65 | +uint8_t BSP_SD_WriteBlocks_DMA(uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks); | |
| 66 | +uint8_t BSP_SD_Erase(uint32_t StartAddr, uint32_t EndAddr); | |
| 67 | +uint8_t BSP_SD_GetCardState(void); | |
| 68 | +void BSP_SD_GetCardInfo(BSP_SD_CardInfo *CardInfo); | |
| 69 | +uint8_t BSP_SD_IsDetected(void); | |
| 70 | + | |
| 71 | +/* These functions can be modified in case the current settings (e.g. DMA stream) | |
| 72 | + need to be changed for specific application needs */ | |
| 73 | +void BSP_SD_AbortCallback(void); | |
| 74 | +void BSP_SD_WriteCpltCallback(void); | |
| 75 | +void BSP_SD_ReadCpltCallback(void); | |
| 76 | +/* USER CODE END BSP_H_CODE */ | |
| 77 | + | |
| 78 | +#ifdef __cplusplus | |
| 79 | +} | |
| 80 | +#endif | |
| 81 | + | |
| 82 | +#endif /* __STM32H7_SD_H */ | |
| 83 | + | |
| 84 | +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |
| @@ -0,0 +1,162 @@ | ||
| 1 | +#include "stm32h7xx_hal.h" | |
| 2 | + | |
| 3 | +#define CODEC_I2C_ADDRESS (0x10 << 1) // 7-bit address goes one bit over to the left to make room for R/W bit | |
| 4 | + | |
| 5 | +void AudioCodec_init(I2C_HandleTypeDef* hi2c); | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | +//Settings for CS4271 | |
| 13 | +// translated from the datasheet by JS | |
| 14 | + | |
| 15 | +// 01h mode control 1 | |
| 16 | +// | |
| 17 | +// M1 M0 ratio1 ratio0 m/s dac_dif2 dac_dif1 dac_dif0 // unsure if setting bit selects master means 1 | |
| 18 | +// for 48k == 0 1 0 0 0 0 0 1 ( ratio bit chosen as 0 0 based on assumption of 256X master clock) | |
| 19 | +// == 0x41 | |
| 20 | +// for 96k == 1 0 0 0 0 0 0 1 ( ratio bit chosen as 0 0 based on assumption of <= 256X master clock) | |
| 21 | +// == 0x81 | |
| 22 | +// for 192k == 1 1 1 0 0 0 0 1 ( ratio bit chosen as 1 0 based on assumption of 256X master clock, choose 0 0 (full word would be 0xc1 instead of 0xe1) instead if using something like 64X) | |
| 23 | +// == 0xe1 | |
| 24 | + | |
| 25 | +// 02h DAC control | |
| 26 | +// AMUTE, FILT_SEL, DEM1, DEM0, RMP_UP, RMP_DN, INV_A, INV_B | |
| 27 | +// 0 0 0 0 1 1 0 0 | |
| 28 | +// == 0x0c | |
| 29 | + | |
| 30 | +// 03h dac volume and mixing | |
| 31 | +// (NA) B=A soft zerocross ATAPI3 ATAPI2 ATAPI1 ATAPI0 (B=A makes channel volumes not independent) | |
| 32 | +// 0 1 1 1 1 0 0 1 (the last four bits set channel L to go to output A and channel R to go to output B, but this is easily changed with mixing or reversal) | |
| 33 | +// == 0x79 | |
| 34 | + | |
| 35 | +// 04h Volume A | |
| 36 | +// MUTE vol6 vol5 vol4 vol3 vol2 vol1 vol0 | |
| 37 | +// 0 0 0 0 0 0 0 0 | |
| 38 | +// == 0x00 | |
| 39 | + | |
| 40 | +// 05h Volume B | |
| 41 | +// MUTE vol6 vol5 vol4 vol3 vol2 vol1 vol0 | |
| 42 | +// 0 0 0 0 0 0 0 0 | |
| 43 | +// == 0x00 | |
| 44 | + | |
| 45 | +// 06h ADC control | |
| 46 | +// (NA) (NA) Dither16 ADC_DIF MUTEA MUTEB HPFDisableA HPFDisableB | |
| 47 | +// 0 0 0 1 0 0 0 0 | |
| 48 | +// ==0x10 | |
| 49 | + | |
| 50 | +// 07h mode control 2 | |
| 51 | +// (NA) (NA) (NA) LOOP MUTECA=B FREEZE CPEN PDN | |
| 52 | +// for power down version == 0 0 0 0 0 1 1 1 | |
| 53 | +// == 0x07 | |
| 54 | +// to send dry ADC input into DAC == 0 0 0 1 0 0 1 0 | |
| 55 | +// == 0x12 | |
| 56 | +// for normal operation == 0 0 0 0 0 0 1 0 | |
| 57 | +// == 0x02 | |
| 58 | + | |
| 59 | +/* | |
| 60 | + | |
| 61 | + | |
| 62 | +#ifndef ADCHPD | |
| 63 | + #define ADCHPD 0 | |
| 64 | +#elif (ADCHPD == 0)||(ADCHPD == 1) | |
| 65 | +#else | |
| 66 | + #error ADCHPD value not defined | |
| 67 | +#endif | |
| 68 | + | |
| 69 | +#ifndef ADCS | |
| 70 | + #define ADCS 2 | |
| 71 | +#elif (ADCS >=0)&&(ADCS <= 2) | |
| 72 | +#else | |
| 73 | + #error ADCS value not defined | |
| 74 | +#endif | |
| 75 | + | |
| 76 | +#ifndef HYST | |
| 77 | + #define HYST 32 | |
| 78 | +#elif (HYST >= 0)&&(HYST <= 255) | |
| 79 | +#else | |
| 80 | + #error HYST value not defined | |
| 81 | +#endif | |
| 82 | + | |
| 83 | +#ifndef LINVOL | |
| 84 | + #define LINVOL 0x17 | |
| 85 | +#elif (LINVOL >= 0) && (LINVOL <= 0x1f) | |
| 86 | +#else | |
| 87 | + #error LINVOL value not defined | |
| 88 | +#endif | |
| 89 | + | |
| 90 | +#ifndef RINVOL | |
| 91 | + #define RINVOL 0x17 | |
| 92 | +#elif (RINVOL >= 0) && (RINVOL <= 0x1f) | |
| 93 | +#else | |
| 94 | + #error RINVOL value not defined | |
| 95 | +#endif | |
| 96 | + | |
| 97 | +#ifndef LHPVOL | |
| 98 | + #define LHPVOL 127 | |
| 99 | +#elif (LHPVOL == 0) || ((LHPVOL >= 0x30) && (LHPVOL <= 0x7f)) | |
| 100 | +#else | |
| 101 | + #error LHPVOL value not defined | |
| 102 | +#endif | |
| 103 | + | |
| 104 | +#ifndef RHPVOL | |
| 105 | + #define RHPVOL 127 | |
| 106 | +#elif (RHPVOL == 0) || ((RHPVOL >= 0x30) && (RHPVOL <= 0x7f)) | |
| 107 | +#else | |
| 108 | + #error RHPVOL value not defined | |
| 109 | +#endif | |
| 110 | + | |
| 111 | +#ifndef MICBOOST | |
| 112 | + #define MICBOOST 0 | |
| 113 | +#elif (MICBOOST == 0)||(MICBOOST == 1) | |
| 114 | +#else | |
| 115 | + #error MICBOOST value not defined | |
| 116 | +#endif | |
| 117 | + | |
| 118 | + // 1 = muted | |
| 119 | +#ifndef MUTEMIC | |
| 120 | + #define MUTEMIC 1 | |
| 121 | +#elif (MUTEMIC == 0)||(MUTEMIC == 1) | |
| 122 | +#else | |
| 123 | + #error MUTEMIC value not defined | |
| 124 | +#endif | |
| 125 | + | |
| 126 | + // 0 = line inputs, 1 = mic in | |
| 127 | +#ifndef INSEL | |
| 128 | + #define INSEL 0 | |
| 129 | +#elif (INSEL == 0)||(INSEL == 1) | |
| 130 | +#else | |
| 131 | + #error INSEL value not defined | |
| 132 | +#endif | |
| 133 | + | |
| 134 | +#ifndef BYPASS | |
| 135 | + #define BYPASS 0 //setting this to 1 passes the line input straight to the line output | |
| 136 | +#elif (BYPASS == 0)||(BYPASS == 1) | |
| 137 | +#else | |
| 138 | + #error BYPASS value not defined | |
| 139 | +#endif | |
| 140 | + | |
| 141 | +#ifndef DACSEL | |
| 142 | + #define DACSEL 1 | |
| 143 | +#elif (DACSEL == 0)||(DACSEL == 1) | |
| 144 | +#else | |
| 145 | + #error DACSEL value not defined | |
| 146 | +#endif | |
| 147 | + | |
| 148 | +#ifndef SIDETONE | |
| 149 | + #define SIDETONE 0 // setting this to 1 passes the mic input straight to the line output | |
| 150 | +#elif (SIDETONE == 0)||(SIDETONE == 1) | |
| 151 | +#else | |
| 152 | + #error SIDETONE value not defined | |
| 153 | +#endif | |
| 154 | + | |
| 155 | +#ifndef SIDEATT | |
| 156 | + #define SIDEATT 0 | |
| 157 | +#elif (SIDEATT >= 0)&&(SIDEATT <= 3) | |
| 158 | +#else | |
| 159 | + #error SIDEATT value not defined | |
| 160 | +#endif | |
| 161 | + | |
| 162 | +*/ | |
| @@ -0,0 +1,6894 @@ | ||
| 1 | +/* | |
| 2 | + * gothic_font.h | |
| 3 | + * | |
| 4 | + * Created on: Jul 8, 2018 | |
| 5 | + * Author: jeffsnyder | |
| 6 | + */ | |
| 7 | + | |
| 8 | +#ifndef CUSTOM_FONTS_H_ | |
| 9 | +#define CUSTOM_FONTS_H_ | |
| 10 | + | |
| 11 | +#include "stm32h7xx_hal.h" | |
| 12 | +#include "gfx_font.h" | |
| 13 | + | |
| 14 | + | |
| 15 | +#define PROGMEM | |
| 16 | + | |
| 17 | +// Created by http://oleddisplay.squix.ch/ Consider a donation | |
| 18 | +// In case of problems make sure that you are using the font file with the correct version! | |
| 19 | +const uint8_t Monospaced_plain_18Bitmaps[] PROGMEM = { | |
| 20 | + | |
| 21 | + // Bitmap Data: | |
| 22 | + 0x00, // ' ' | |
| 23 | + 0xFF,0xFF,0xC3,0xC0, // '!' | |
| 24 | + 0xCF,0x3C,0xF3,0xCC, // '"' | |
| 25 | + 0x04,0xC1,0x90,0x32,0x04,0xC7,0xFE,0xFF,0xC6,0x40,0x98,0xFF,0xDF,0xF8,0xC8,0x11,0x02,0x60,0xCC,0x00, // '#' | |
| 26 | + 0x08,0x04,0x0F,0x8F,0xEC,0x96,0x43,0x20,0xF0,0x0F,0x04,0xC2,0x71,0x3F,0xF3,0xF0,0x20,0x10,0x08,0x00, // '$' | |
| 27 | + 0x78,0x19,0x83,0x30,0x66,0x0C,0xC0,0xF3,0x83,0x83,0x9E,0x06,0x60,0xCC,0x19,0x83,0x30,0x3C, // '%' | |
| 28 | + 0x1F,0x0F,0xC3,0x00,0xC0,0x18,0x0F,0x06,0xCF,0x3B,0xC7,0xF0,0xEE,0x31,0xF6,0x3D,0xC0, // '&' | |
| 29 | + 0xFF,0xC0, // ''' | |
| 30 | + 0x32,0x66,0x4C,0xCC,0xCC,0xC4,0x66,0x23, // '(' | |
| 31 | + 0xC4,0x66,0x23,0x33,0x33,0x32,0x66,0x4C, // ')' | |
| 32 | + 0x11,0x25,0x51,0xC3,0x8A,0xA4,0x88, // '*' | |
| 33 | + 0x0C,0x03,0x00,0xC0,0x30,0xFF,0xFF,0xF0,0xC0,0x30,0x0C,0x03,0x00, // '+' | |
| 34 | + 0x6D,0xE8, // ',' | |
| 35 | + 0xFF,0xC0, // '-' | |
| 36 | + 0xFC, // '.' | |
| 37 | + 0x01,0x81,0x80,0xC0,0xC0,0x60,0x60,0x30,0x38,0x18,0x0C,0x0C,0x06,0x06,0x03,0x03,0x00, // '/' | |
| 38 | + 0x3E,0x3F,0x98,0xD8,0x3C,0x1E,0x6F,0x37,0x83,0xC1,0xE0,0xD8,0xCF,0xE3,0xE0, // '0' | |
| 39 | + 0x38,0xF8,0xD8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0xFF, // '1' | |
| 40 | + 0x7E,0x7F,0xA0,0xE0,0x30,0x18,0x1C,0x0C,0x1C,0x1C,0x1C,0x18,0x1F,0xFF,0xF8, // '2' | |
| 41 | + 0x7E,0x7F,0xA0,0xE0,0x30,0x39,0xF8,0xFC,0x07,0x01,0x80,0xE0,0xFF,0xE7,0xE0, // '3' | |
| 42 | + 0x06,0x07,0x03,0x82,0xC3,0x61,0x31,0x99,0x8C,0xFF,0xFF,0xC1,0x80,0xC0,0x60, // '4' | |
| 43 | + 0x7F,0x3F,0x98,0x0C,0x07,0xE3,0xF9,0x0E,0x03,0x01,0x80,0xE0,0xFF,0xE7,0xE0, // '5' | |
| 44 | + 0x1E,0x3F,0x9C,0x5C,0x0C,0x06,0xF3,0xFD,0xC7,0xC1,0xE0,0xD8,0xEF,0xE3,0xE0, // '6' | |
| 45 | + 0xFF,0xFF,0xC0,0xC0,0x60,0x70,0x30,0x18,0x18,0x0C,0x0E,0x06,0x03,0x03,0x00, // '7' | |
| 46 | + 0x3E,0x3F,0xB0,0x78,0x3C,0x1B,0xF9,0xFD,0xC7,0xC1,0xE0,0xF8,0xEF,0xE3,0xE0, // '8' | |
| 47 | + 0x3E,0x3F,0xB8,0xD8,0x3C,0x1F,0x1D,0xFE,0x7B,0x01,0x81,0xD1,0xCF,0xE3,0xC0, // '9' | |
| 48 | + 0xFC,0x0F,0xC0, // ':' | |
| 49 | + 0x6D,0x80,0x1B,0x7A,0x00, // ';' | |
| 50 | + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0xc0, 0x1c, 0x03, 0xc0, 0x7c, 0x0f, | |
| 51 | + 0xc1, 0xfc, 0x0f, 0xc0, 0x7c, 0x03, 0xc0, 0x1c, 0x00, 0xc0, 0x04, // '<' | |
| 52 | + 0xFF,0xFF,0xC0,0x00,0x0F,0xFF,0xFC, // '=' | |
| 53 | + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x60, 0x07, 0x00, 0x78, 0x07, 0xc0, 0x7e, | |
| 54 | + 0x07, 0xf0, 0x7e, 0x07, 0xc0, 0x78, 0x07, 0x00, 0x60, 0x04, 0x00, // '>' | |
| 55 | + 0x7D,0xFE,0x18,0x30,0xE3,0x8E,0x18,0x30,0x60,0x01,0x83,0x00, // '?' | |
| 56 | + 0x1E,0x19,0x98,0x6C,0xFC,0xDE,0x6F,0x37,0x9B,0xCD,0xE6,0xF1,0xEC,0x06,0x01,0x80,0x78, // '@' | |
| 57 | + 0x1C,0x0E,0x07,0x03,0x83,0x61,0xB0,0xD8,0x6C,0x7F,0x3F,0x98,0xD8,0x3C,0x18, // 'A' | |
| 58 | + 0xFE,0x7F,0xB0,0x78,0x3C,0x1F,0xFB,0xFD,0x87,0xC1,0xE0,0xF0,0xFF,0xEF,0xE0, // 'B' | |
| 59 | + 0x1F,0x1F,0xDC,0x3C,0x0C,0x06,0x03,0x01,0x80,0xC0,0x70,0x1C,0x27,0xF1,0xF0, // 'C' | |
| 60 | + 0xFC,0x7F,0x31,0xD8,0x7C,0x1E,0x0F,0x07,0x83,0xC1,0xE1,0xF1,0xDF,0xCF,0xC0, // 'D' | |
| 61 | + 0xFF,0xFF,0xF0,0x18,0x0C,0x07,0xFF,0xFF,0x80,0xC0,0x60,0x30,0x1F,0xFF,0xF8, // 'E' | |
| 62 | + 0xFF,0xFF,0xF0,0x18,0x0C,0x07,0xFB,0xFD,0x80,0xC0,0x60,0x30,0x18,0x0C,0x00, // 'F' | |
| 63 | + 0x1F,0x1F,0xDC,0x3C,0x0C,0x06,0x3F,0x1F,0x83,0xC1,0xF0,0xD8,0x67,0xF1,0xE0, // 'G' | |
| 64 | + 0xC1,0xE0,0xF0,0x78,0x3C,0x1F,0xFF,0xFF,0x83,0xC1,0xE0,0xF0,0x78,0x3C,0x18, // 'H' | |
| 65 | + 0xFF,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0xFF, // 'I' | |
| 66 | + 0x3E,0x7C,0x18,0x30,0x60,0xC1,0x83,0x06,0x0E,0x1F,0xE7,0x80, // 'J' | |
| 67 | + 0xC1,0xB0,0xCC,0x63,0x30,0xD8,0x3E,0x0F,0x83,0x30,0xCE,0x31,0x8C,0x33,0x0E,0xC1,0x80, // 'K' | |
| 68 | + 0xC0,0x60,0x30,0x18,0x0C,0x06,0x03,0x01,0x80,0xC0,0x60,0x30,0x1F,0xFF,0xF8, // 'L' | |
| 69 | + 0xE3,0xF1,0xF8,0xFE,0xFD,0x5E,0xAF,0x77,0x93,0xC1,0xE0,0xF0,0x78,0x3C,0x18, // 'M' | |
| 70 | + 0xE1,0xF0,0xFC,0x7A,0x3D,0x1E,0xCF,0x27,0x9B,0xC5,0xE2,0xF1,0xF8,0x7C,0x38, // 'N' | |
| 71 | + 0x3E,0x3F,0x98,0xD8,0x3C,0x1E,0x0F,0x07,0x83,0xC1,0xE0,0xD8,0xCF,0xE3,0xE0, // 'O' | |
| 72 | + 0xFE,0x7F,0xB0,0xF8,0x3C,0x1E,0x1F,0xFD,0xFC,0xC0,0x60,0x30,0x18,0x0C,0x00, // 'P' | |
| 73 | + 0x3E,0x3F,0x98,0xD8,0x3C,0x1E,0x0F,0x07,0x83,0xC1,0xE0,0xD8,0xCF,0xE3,0xE0,0x38,0x0C, // 'Q' | |
| 74 | + 0xFE,0x3F,0xCC,0x3B,0x06,0xC1,0xB0,0xEF,0xF3,0xF8,0xC3,0x30,0xEC,0x1B,0x06,0xC0,0xC0, // 'R' | |
| 75 | + 0x3E,0x3F,0xB8,0x58,0x0C,0x03,0xE0,0xFC,0x07,0x01,0x80,0xE0,0xFF,0xE7,0xE0, // 'S' | |
| 76 | + 0xFF,0xFF,0xF0,0xC0,0x30,0x0C,0x03,0x00,0xC0,0x30,0x0C,0x03,0x00,0xC0,0x30,0x0C,0x00, // 'T' | |
| 77 | + 0xC1,0xE0,0xF0,0x78,0x3C,0x1E,0x0F,0x07,0x83,0xC1,0xE0,0xF8,0xEF,0xE3,0xE0, // 'U' | |
| 78 | + 0xC1,0xE0,0xD8,0xCC,0x66,0x33,0xB8,0xD8,0x6C,0x36,0x0E,0x07,0x03,0x81,0xC0, // 'V' | |
| 79 | + 0xC0,0x78,0x0F,0x01,0xB0,0x66,0xEC,0xDD,0x9A,0xB3,0x56,0x6A,0xCF,0x78,0xC6,0x18,0xC3,0x18, // 'W' | |
| 80 | + 0xE3,0xB1,0x9D,0x86,0xC1,0xC0,0xE0,0x70,0x38,0x3E,0x1B,0x1D,0xCC,0x6E,0x38, // 'X' | |
| 81 | + 0xE1,0xD8,0x67,0x38,0xCC,0x1E,0x07,0x80,0xC0,0x30,0x0C,0x03,0x00,0xC0,0x30,0x0C,0x00, // 'Y' | |
| 82 | + 0xFF,0xFF,0xC0,0xC0,0xE0,0x60,0x60,0x70,0x30,0x38,0x38,0x18,0x1F,0xFF,0xF8, // 'Z' | |
| 83 | + 0xFF,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xFF, // '[' | |
| 84 | + 0xC0,0x30,0x18,0x06,0x03,0x00,0xC0,0x60,0x38,0x0C,0x06,0x01,0x80,0xC0,0x30,0x18,0x06, // '\' | |
| 85 | + 0xFF,0x33,0x33,0x33,0x33,0x33,0x33,0xFF, // ']' | |
| 86 | + 0x0C,0x07,0x83,0x31,0x86,0xC0,0xC0, // '^' | |
| 87 | + 0xFF,0xFF,0xFC, // '_' | |
| 88 | + 0xC6,0x30, // '`' | |
| 89 | + 0x3E,0x3F,0x90,0xE0,0x33,0xFF,0xFF,0x07,0x87,0xFF,0xBE,0xC0, // 'a' | |
| 90 | + 0xC0,0x60,0x30,0x18,0x0D,0xE7,0xFB,0x8F,0x83,0xC1,0xE0,0xF0,0x7C,0x7F,0xF6,0xF0, // 'b' | |
| 91 | + 0x1E,0x7F,0x61,0xC0,0xC0,0xC0,0xC0,0x61,0x7F,0x1E, // 'c' | |
| 92 | + 0x01,0x80,0xC0,0x60,0x33,0xDB,0xFF,0x8F,0x83,0xC1,0xE0,0xF0,0x7C,0x77,0xF9,0xEC, // 'd' | |
| 93 | + 0x3E,0x3F,0x98,0xF8,0x3F,0xFF,0xFF,0x00,0xC1,0x7F,0x8F,0x80, // 'e' | |
| 94 | + 0x0F,0x1F,0x18,0x18,0xFF,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 'f' | |
| 95 | + 0x3D,0xBF,0xF8,0xF8,0x3C,0x1E,0x0F,0x07,0xC7,0x7F,0x9E,0xC0,0x68,0x77,0xF1,0xF0, // 'g' | |
| 96 | + 0xC0,0x60,0x30,0x18,0x0C,0xE7,0xFB,0x8F,0x83,0xC1,0xE0,0xF0,0x78,0x3C,0x1E,0x0C, // 'h' | |
| 97 | + 0x18,0x18,0x00,0x00,0xF8,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0xFF, // 'i' | |
| 98 | + 0x0C,0x30,0x00,0x7D,0xF0,0xC3,0x0C,0x30,0xC3,0x0C,0x30,0xC3,0xFB,0xC0, // 'j' | |
| 99 | + 0xC0,0x60,0x30,0x18,0x0C,0x3E,0x3B,0x39,0xB8,0xF8,0x7E,0x33,0x18,0xCC,0x76,0x1C, // 'k' | |
| 100 | + 0xF8,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x0F,0x0F, // 'l' | |
| 101 | + 0xDB,0xBF,0xFC,0xCF,0x33,0xCC,0xF3,0x3C,0xCF,0x33,0xCC,0xF3,0x30, // 'm' | |
| 102 | + 0xCE,0x7F,0xB8,0xF8,0x3C,0x1E,0x0F,0x07,0x83,0xC1,0xE0,0xC0, // 'n' | |
| 103 | + 0x3E,0x3F,0xB8,0xF8,0x3C,0x1E,0x0F,0x07,0xC7,0x7F,0x1F,0x00, // 'o' | |
| 104 | + 0xDE,0x7F,0xB8,0xF8,0x3C,0x1E,0x0F,0x07,0xC7,0xFF,0x6F,0x30,0x18,0x0C,0x06,0x00, // 'p' | |
| 105 | + 0x3D,0xBF,0xF8,0xF8,0x3C,0x1E,0x0F,0x07,0xC7,0x7F,0x9E,0xC0,0x60,0x30,0x18,0x0C, // 'q' | |
| 106 | + 0xDD,0xBF,0x8E,0x0C,0x18,0x30,0x60,0xC1,0x80, // 'r' | |
| 107 | + 0x3F,0x7F,0xF0,0x3F,0x07,0xF0,0x3C,0x07,0x03,0xFF,0xBF,0x00, // 's' | |
| 108 | + 0x18,0x0C,0x06,0x1F,0xFF,0xF8,0xC0,0x60,0x30,0x18,0x0C,0x06,0x03,0xF0,0xF8, // 't' | |
| 109 | + 0xC1,0xE0,0xF0,0x78,0x3C,0x1E,0x0F,0x07,0xC7,0x7F,0x9C,0xC0, // 'u' | |
| 110 | + 0xC1,0xB1,0x98,0xCC,0x63,0x61,0xB0,0xD8,0x38,0x1C,0x0E,0x00, // 'v' | |
| 111 | + 0xC0,0x78,0x0D,0x83,0x32,0x66,0xEC,0xD5,0x8E,0xE1,0xDC,0x31,0x86,0x30, // 'w' | |
| 112 | + 0xE3,0xBB,0x8D,0x83,0x81,0xC0,0xE0,0xF8,0x6C,0x63,0x71,0xC0, // 'x' | |
| 113 | + 0xC1,0xB1,0x98,0xCE,0x63,0x61,0xB0,0x78,0x38,0x0C,0x0E,0x06,0x03,0x07,0x83,0x80, // 'y' | |
| 114 | + 0xFF,0xFF,0xC1,0xC1,0xC1,0xC0,0xC0,0xC0,0xE0,0xFF,0xFF,0xC0, // 'z' | |
| 115 | + 0x0F,0x1F,0x18,0x18,0x18,0x18,0x18,0xF0,0xF0,0x38,0x18,0x18,0x18,0x18,0x18,0x1F,0x0F, // '{' | |
| 116 | + 0xFF,0xFF,0xFF,0xFF,0xF0, // '|' | |
| 117 | + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x81, 0x98, 0x19, 0x81, 0x98, 0x7f, | |
| 118 | + 0xe7, 0xfe, 0x7f, 0xe7, 0xfe, 0x7f, 0xe7, 0xfe, 0x7f, 0xe0, 0x00// lock icon | |
| 119 | + //0xF0,0xF8,0x18,0x18,0x18,0x18,0x18,0x0F,0x0F,0x1C,0x18,0x18,0x18,0x18,0x18,0xF8,0xF0 // '}' | |
| 120 | +}; | |
| 121 | +const GFXglyph Monospaced_plain_18Glyphs[] PROGMEM = { | |
| 122 | +// bitmapOffset, width, height, xAdvance, xOffset, yOffset | |
| 123 | + { 0, 1, 1, 12, 0, 0 }, // ' ' | |
| 124 | + { 1, 2, 13, 12, 5, -13 }, // '!' | |
| 125 | + { 5, 6, 5, 12, 3, -13 }, // '"' | |
| 126 | + { 9, 11, 14, 12, 0, -14 }, // '#' | |
| 127 | + { 29, 9, 17, 12, 1, -14 }, // '$' | |
| 128 | + { 49, 11, 13, 12, 0, -13 }, // '%' | |
| 129 | + { 67, 10, 13, 12, 1, -13 }, // '&' | |
| 130 | + { 84, 2, 5, 12, 5, -13 }, // ''' | |
| 131 | + { 86, 4, 16, 12, 4, -14 }, // '(' | |
| 132 | + { 94, 4, 16, 12, 3, -14 }, // ')' | |
| 133 | + { 102, 7, 8, 12, 2, -13 }, // '*' | |
| 134 | + { 109, 10, 10, 12, 1, -11 }, // '+' | |
| 135 | + { 122, 3, 5, 12, 3, -3 }, // ',' | |
| 136 | + { 124, 5, 2, 12, 3, -6 }, // '-' | |
| 137 | + { 126, 2, 3, 12, 4, -3 }, // '.' | |
| 138 | + { 127, 9, 15, 12, 1, -13 }, // '/' | |
| 139 | + { 144, 9, 13, 12, 1, -13 }, // '0' | |
| 140 | + { 159, 8, 13, 12, 2, -13 }, // '1' | |
| 141 | + { 172, 9, 13, 12, 1, -13 }, // '2' | |
| 142 | + { 187, 9, 13, 12, 1, -13 }, // '3' | |
| 143 | + { 202, 9, 13, 12, 1, -13 }, // '4' | |
| 144 | + { 217, 9, 13, 12, 1, -13 }, // '5' | |
| 145 | + { 232, 9, 13, 12, 1, -13 }, // '6' | |
| 146 | + { 247, 9, 13, 12, 1, -13 }, // '7' | |
| 147 | + { 262, 9, 13, 12, 1, -13 }, // '8' | |
| 148 | + { 277, 9, 13, 12, 1, -13 }, // '9' | |
| 149 | + { 292, 2, 9, 12, 4, -9 }, // ':' | |
| 150 | + { 295, 3, 11, 12, 3, -9 }, // ';' | |
| 151 | + { 300, 12, 18, 12, 0, -18 }, // '<' | |
| 152 | + { 327, 9, 6, 12, 1, -9 }, // '=' | |
| 153 | + { 334, 12, 18, 12, 0, -18 }, // '>' | |
| 154 | + { 361, 7, 13, 12, 2, -13 }, // '?' | |
| 155 | + { 373, 9, 15, 12, 1, -12 }, // '@' | |
| 156 | + { 390, 9, 13, 12, 1, -13 }, // 'A' | |
| 157 | + { 405, 9, 13, 12, 1, -13 }, // 'B' | |
| 158 | + { 420, 9, 13, 12, 1, -13 }, // 'C' | |
| 159 | + { 435, 9, 13, 12, 1, -13 }, // 'D' | |
| 160 | + { 450, 9, 13, 12, 1, -13 }, // 'E' | |
| 161 | + { 465, 9, 13, 12, 1, -13 }, // 'F' | |
| 162 | + { 480, 9, 13, 12, 1, -13 }, // 'G' | |
| 163 | + { 495, 9, 13, 12, 1, -13 }, // 'H' | |
| 164 | + { 510, 8, 13, 12, 2, -13 }, // 'I' | |
| 165 | + { 524, 7, 13, 12, 1, -13 }, // 'J' | |
| 166 | + { 535, 10, 13, 12, 1, -13 }, // 'K' | |
| 167 | + { 552, 9, 13, 12, 1, -13 }, // 'L' | |
| 168 | + { 567, 9, 13, 12, 1, -13 }, // 'M' | |
| 169 | + { 582, 9, 13, 12, 1, -13 }, // 'N' | |
| 170 | + { 597, 9, 13, 12, 1, -13 }, // 'O' | |
| 171 | + { 612, 9, 13, 12, 1, -13 }, // 'P' | |
| 172 | + { 627, 9, 15, 12, 1, -13 }, // 'Q' | |
| 173 | + { 644, 10, 13, 12, 1, -13 }, // 'R' | |
| 174 | + { 661, 9, 13, 12, 1, -13 }, // 'S' | |
| 175 | + { 676, 10, 13, 12, 1, -13 }, // 'T' | |
| 176 | + { 693, 9, 13, 12, 1, -13 }, // 'U' | |
| 177 | + { 708, 9, 13, 12, 1, -13 }, // 'V' | |
| 178 | + { 723, 11, 13, 12, 0, -13 }, // 'W' | |
| 179 | + { 741, 9, 13, 12, 1, -13 }, // 'X' | |
| 180 | + { 756, 10, 13, 12, 1, -13 }, // 'Y' | |
| 181 | + { 773, 9, 13, 12, 1, -13 }, // 'Z' | |
| 182 | + { 788, 4, 16, 12, 4, -14 }, // '[' | |
| 183 | + { 796, 9, 15, 12, 1, -13 }, // '\' | |
| 184 | + { 813, 4, 16, 12, 3, -14 }, // ']' | |
| 185 | + { 821, 10, 5, 12, 1, -13 }, // '^' | |
| 186 | + { 828, 11, 2, 12, 0, 2 }, // '_' | |
| 187 | + { 831, 4, 3, 12, 2, -14 }, // '`' | |
| 188 | + { 833, 9, 10, 12, 1, -10 }, // 'a' | |
| 189 | + { 845, 9, 14, 12, 1, -14 }, // 'b' | |
| 190 | + { 861, 8, 10, 12, 1, -10 }, // 'c' | |
| 191 | + { 871, 9, 14, 12, 1, -14 }, // 'd' | |
| 192 | + { 887, 9, 10, 12, 1, -10 }, // 'e' | |
| 193 | + { 899, 8, 14, 12, 1, -14 }, // 'f' | |
| 194 | + { 913, 9, 14, 12, 1, -10 }, // 'g' | |
| 195 | + { 929, 9, 14, 12, 1, -14 }, // 'h' | |
| 196 | + { 945, 8, 14, 12, 2, -14 }, // 'i' | |
| 197 | + { 959, 6, 18, 12, 1, -14 }, // 'j' | |
| 198 | + { 973, 9, 14, 12, 1, -14 }, // 'k' | |
| 199 | + { 989, 8, 14, 12, 1, -14 }, // 'l' | |
| 200 | + { 1003, 10, 10, 12, 1, -10 }, // 'm' | |
| 201 | + { 1017, 9, 10, 12, 1, -10 }, // 'n' | |
| 202 | + { 1028, 9, 10, 12, 1, -10 }, // 'o' | |
| 203 | + { 1040, 9, 14, 12, 1, -10 }, // 'p' | |
| 204 | + { 1056, 9, 14, 12, 1, -10 }, // 'q' | |
| 205 | + { 1072, 7, 10, 12, 3, -10 }, // 'r' | |
| 206 | + { 1081, 9, 10, 12, 1, -10 }, // 's' | |
| 207 | + { 1093, 9, 13, 12, 1, -13 }, // 't' | |
| 208 | + { 1108, 9, 10, 12, 1, -10 }, // 'u' | |
| 209 | + { 1120, 9, 10, 12, 1, -10 }, // 'v' | |
| 210 | + { 1132, 11, 10, 12, 0, -10 }, // 'w' | |
| 211 | + { 1146, 9, 10, 12, 1, -10 }, // 'x' | |
| 212 | + { 1158, 9, 14, 12, 1, -10 }, // 'y' | |
| 213 | + { 1174, 9, 10, 12, 1, -10 }, // 'z' | |
| 214 | + { 1186, 8, 17, 12, 2, -14 }, // '{' | |
| 215 | + { 1203, 2, 18, 12, 5, -14 }, // '|' | |
| 216 | + { 1208, 12, 18, 12, 0, -18 } // lock icon | |
| 217 | + //{ 1176, 8, 17, 12, 2, -14 } // '}' | |
| 218 | +}; | |
| 219 | +const GFXfont Monospaced_plain_18 PROGMEM = { | |
| 220 | +(uint8_t *)Monospaced_plain_18Bitmaps,(GFXglyph *)Monospaced_plain_18Glyphs,0x20, 0x7E, 16}; | |
| 221 | + | |
| 222 | + | |
| 223 | +const uint8_t FreeMono9pt7bBitmaps[] = { | |
| 224 | + 0xAA, 0xA8, 0x0C, 0xED, 0x24, 0x92, 0x48, 0x24, 0x48, 0x91, 0x2F, 0xE4, | |
| 225 | + 0x89, 0x7F, 0x28, 0x51, 0x22, 0x40, 0x08, 0x3E, 0x62, 0x40, 0x30, 0x0E, | |
| 226 | + 0x01, 0x81, 0xC3, 0xBE, 0x08, 0x08, 0x71, 0x12, 0x23, 0x80, 0x23, 0xB8, | |
| 227 | + 0x0E, 0x22, 0x44, 0x70, 0x38, 0x81, 0x02, 0x06, 0x1A, 0x65, 0x46, 0xC8, | |
| 228 | + 0xEC, 0xE9, 0x24, 0x5A, 0xAA, 0xA9, 0x40, 0xA9, 0x55, 0x5A, 0x80, 0x10, | |
| 229 | + 0x22, 0x4B, 0xE3, 0x05, 0x11, 0x00, 0x10, 0x20, 0x47, 0xF1, 0x02, 0x04, | |
| 230 | + 0x00, 0x6B, 0x48, 0xFF, 0x00, 0xF0, 0x02, 0x08, 0x10, 0x60, 0x81, 0x04, | |
| 231 | + 0x08, 0x20, 0x41, 0x02, 0x08, 0x00, 0x38, 0x8A, 0x0C, 0x18, 0x30, 0x60, | |
| 232 | + 0xC1, 0x82, 0x88, 0xE0, 0x27, 0x28, 0x42, 0x10, 0x84, 0x21, 0x3E, 0x38, | |
| 233 | + 0x8A, 0x08, 0x10, 0x20, 0x82, 0x08, 0x61, 0x03, 0xF8, 0x7C, 0x06, 0x02, | |
| 234 | + 0x02, 0x1C, 0x06, 0x01, 0x01, 0x01, 0x42, 0x3C, 0x18, 0xA2, 0x92, 0x8A, | |
| 235 | + 0x28, 0xBF, 0x08, 0x21, 0xC0, 0x7C, 0x81, 0x03, 0xE4, 0x40, 0x40, 0x81, | |
| 236 | + 0x03, 0x88, 0xE0, 0x1E, 0x41, 0x04, 0x0B, 0x98, 0xB0, 0xC1, 0xC2, 0x88, | |
| 237 | + 0xE0, 0xFE, 0x04, 0x08, 0x20, 0x40, 0x82, 0x04, 0x08, 0x20, 0x40, 0x38, | |
| 238 | + 0x8A, 0x0C, 0x14, 0x47, 0x11, 0x41, 0x83, 0x8C, 0xE0, 0x38, 0x8A, 0x1C, | |
| 239 | + 0x18, 0x68, 0xCE, 0x81, 0x04, 0x13, 0xC0, 0xF0, 0x0F, 0x6C, 0x00, 0xD2, | |
| 240 | + 0xD2, 0x00, 0x03, 0x04, 0x18, 0x60, 0x60, 0x18, 0x04, 0x03, 0xFF, 0x80, | |
| 241 | + 0x00, 0x1F, 0xF0, 0x40, 0x18, 0x03, 0x00, 0x60, 0x20, 0x60, 0xC0, 0x80, | |
| 242 | + 0x3D, 0x84, 0x08, 0x30, 0xC2, 0x00, 0x00, 0x00, 0x30, 0x3C, 0x46, 0x82, | |
| 243 | + 0x8E, 0xB2, 0xA2, 0xA2, 0x9F, 0x80, 0x80, 0x40, 0x3C, 0x3C, 0x01, 0x40, | |
| 244 | + 0x28, 0x09, 0x01, 0x10, 0x42, 0x0F, 0xC1, 0x04, 0x40, 0x9E, 0x3C, 0xFE, | |
| 245 | + 0x21, 0x90, 0x48, 0x67, 0xE2, 0x09, 0x02, 0x81, 0x41, 0xFF, 0x80, 0x3E, | |
| 246 | + 0xB0, 0xF0, 0x30, 0x08, 0x04, 0x02, 0x00, 0x80, 0x60, 0x8F, 0x80, 0xFE, | |
| 247 | + 0x21, 0x90, 0x68, 0x14, 0x0A, 0x05, 0x02, 0x83, 0x43, 0x7F, 0x00, 0xFF, | |
| 248 | + 0x20, 0x90, 0x08, 0x87, 0xC2, 0x21, 0x00, 0x81, 0x40, 0xFF, 0xC0, 0xFF, | |
| 249 | + 0xA0, 0x50, 0x08, 0x87, 0xC2, 0x21, 0x00, 0x80, 0x40, 0x78, 0x00, 0x1E, | |
| 250 | + 0x98, 0x6C, 0x0A, 0x00, 0x80, 0x20, 0xF8, 0x0B, 0x02, 0x60, 0x87, 0xC0, | |
| 251 | + 0xE3, 0xA0, 0x90, 0x48, 0x27, 0xF2, 0x09, 0x04, 0x82, 0x41, 0x71, 0xC0, | |
| 252 | + 0xF9, 0x08, 0x42, 0x10, 0x84, 0x27, 0xC0, 0x1F, 0x02, 0x02, 0x02, 0x02, | |
| 253 | + 0x02, 0x82, 0x82, 0xC6, 0x78, 0xE3, 0xA1, 0x11, 0x09, 0x05, 0x83, 0x21, | |
| 254 | + 0x08, 0x84, 0x41, 0x70, 0xC0, 0xE0, 0x40, 0x40, 0x40, 0x40, 0x40, 0x41, | |
| 255 | + 0x41, 0x41, 0xFF, 0xE0, 0xEC, 0x19, 0x45, 0x28, 0xA4, 0xA4, 0x94, 0x91, | |
| 256 | + 0x12, 0x02, 0x40, 0x5C, 0x1C, 0xC3, 0xB0, 0x94, 0x4A, 0x24, 0x92, 0x49, | |
| 257 | + 0x14, 0x8A, 0x43, 0x70, 0x80, 0x1E, 0x31, 0x90, 0x50, 0x18, 0x0C, 0x06, | |
| 258 | + 0x02, 0x82, 0x63, 0x0F, 0x00, 0xFE, 0x43, 0x41, 0x41, 0x42, 0x7C, 0x40, | |
| 259 | + 0x40, 0x40, 0xF0, 0x1C, 0x31, 0x90, 0x50, 0x18, 0x0C, 0x06, 0x02, 0x82, | |
| 260 | + 0x63, 0x1F, 0x04, 0x07, 0x92, 0x30, 0xFE, 0x21, 0x90, 0x48, 0x24, 0x23, | |
| 261 | + 0xE1, 0x10, 0x84, 0x41, 0x70, 0xC0, 0x3A, 0xCD, 0x0A, 0x03, 0x01, 0x80, | |
| 262 | + 0xC1, 0xC7, 0x78, 0xFF, 0xC4, 0x62, 0x21, 0x00, 0x80, 0x40, 0x20, 0x10, | |
| 263 | + 0x08, 0x1F, 0x00, 0xE3, 0xA0, 0x90, 0x48, 0x24, 0x12, 0x09, 0x04, 0x82, | |
| 264 | + 0x22, 0x0E, 0x00, 0xF1, 0xE8, 0x10, 0x82, 0x10, 0x42, 0x10, 0x22, 0x04, | |
| 265 | + 0x80, 0x50, 0x0C, 0x00, 0x80, 0xF1, 0xE8, 0x09, 0x11, 0x25, 0x44, 0xA8, | |
| 266 | + 0x55, 0x0C, 0xA1, 0x8C, 0x31, 0x84, 0x30, 0xE3, 0xA0, 0x88, 0x82, 0x80, | |
| 267 | + 0x80, 0xC0, 0x90, 0x44, 0x41, 0x71, 0xC0, 0xE3, 0xA0, 0x88, 0x82, 0x81, | |
| 268 | + 0x40, 0x40, 0x20, 0x10, 0x08, 0x1F, 0x00, 0xFD, 0x0A, 0x20, 0x81, 0x04, | |
| 269 | + 0x10, 0x21, 0x83, 0xFC, 0xEA, 0xAA, 0xAA, 0xC0, 0x80, 0x81, 0x03, 0x02, | |
| 270 | + 0x04, 0x04, 0x08, 0x08, 0x10, 0x10, 0x20, 0x20, 0xD5, 0x55, 0x55, 0xC0, | |
| 271 | + 0x10, 0x51, 0x22, 0x28, 0x20, 0xFF, 0xE0, 0x88, 0x80, 0x7E, 0x00, 0x80, | |
| 272 | + 0x47, 0xEC, 0x14, 0x0A, 0x0C, 0xFB, 0xC0, 0x20, 0x10, 0x0B, 0xC6, 0x12, | |
| 273 | + 0x05, 0x02, 0x81, 0x40, 0xB0, 0xB7, 0x80, 0x3A, 0x8E, 0x0C, 0x08, 0x10, | |
| 274 | + 0x10, 0x9E, 0x03, 0x00, 0x80, 0x47, 0xA4, 0x34, 0x0A, 0x05, 0x02, 0x81, | |
| 275 | + 0x21, 0x8F, 0x60, 0x3C, 0x43, 0x81, 0xFF, 0x80, 0x80, 0x61, 0x3E, 0x3D, | |
| 276 | + 0x04, 0x3E, 0x41, 0x04, 0x10, 0x41, 0x0F, 0x80, 0x3D, 0xA1, 0xA0, 0x50, | |
| 277 | + 0x28, 0x14, 0x09, 0x0C, 0x7A, 0x01, 0x01, 0x87, 0x80, 0xC0, 0x20, 0x10, | |
| 278 | + 0x0B, 0xC6, 0x32, 0x09, 0x04, 0x82, 0x41, 0x20, 0xB8, 0xE0, 0x10, 0x01, | |
| 279 | + 0xC0, 0x81, 0x02, 0x04, 0x08, 0x11, 0xFC, 0x10, 0x3E, 0x10, 0x84, 0x21, | |
| 280 | + 0x08, 0x42, 0x3F, 0x00, 0xC0, 0x40, 0x40, 0x4F, 0x44, 0x58, 0x70, 0x48, | |
| 281 | + 0x44, 0x42, 0xC7, 0x70, 0x20, 0x40, 0x81, 0x02, 0x04, 0x08, 0x10, 0x23, | |
| 282 | + 0xF8, 0xB7, 0x64, 0x62, 0x31, 0x18, 0x8C, 0x46, 0x23, 0x91, 0x5E, 0x31, | |
| 283 | + 0x90, 0x48, 0x24, 0x12, 0x09, 0x05, 0xC7, 0x3E, 0x31, 0xA0, 0x30, 0x18, | |
| 284 | + 0x0C, 0x05, 0x8C, 0x7C, 0xDE, 0x30, 0x90, 0x28, 0x14, 0x0A, 0x05, 0x84, | |
| 285 | + 0xBC, 0x40, 0x20, 0x38, 0x00, 0x3D, 0xA1, 0xA0, 0x50, 0x28, 0x14, 0x09, | |
| 286 | + 0x0C, 0x7A, 0x01, 0x00, 0x80, 0xE0, 0xCE, 0xA1, 0x82, 0x04, 0x08, 0x10, | |
| 287 | + 0x7C, 0x3A, 0x8D, 0x0B, 0x80, 0xF0, 0x70, 0xDE, 0x40, 0x40, 0xFC, 0x40, | |
| 288 | + 0x40, 0x40, 0x40, 0x40, 0x41, 0x3E, 0xC3, 0x41, 0x41, 0x41, 0x41, 0x41, | |
| 289 | + 0x43, 0x3D, 0xE3, 0xA0, 0x90, 0x84, 0x42, 0x20, 0xA0, 0x50, 0x10, 0xE3, | |
| 290 | + 0xC0, 0x92, 0x4B, 0x25, 0x92, 0xA9, 0x98, 0x44, 0xE3, 0x31, 0x05, 0x01, | |
| 291 | + 0x01, 0x41, 0x11, 0x05, 0xC7, 0xE3, 0xA0, 0x90, 0x84, 0x42, 0x40, 0xA0, | |
| 292 | + 0x60, 0x10, 0x10, 0x08, 0x3E, 0x00, 0xFD, 0x08, 0x20, 0x82, 0x08, 0x10, | |
| 293 | + 0xBF, 0x29, 0x24, 0xA2, 0x49, 0x26, 0xFF, 0xF8, 0x89, 0x24, 0x8A, 0x49, | |
| 294 | + 0x2C, 0x61, 0x24, 0x30 }; | |
| 295 | + | |
| 296 | +const GFXglyph FreeMono9pt7bGlyphs[] = { | |
| 297 | + { 0, 0, 0, 11, 0, 1 }, // 0x20 ' ' | |
| 298 | + { 0, 2, 11, 11, 4, -10 }, // 0x21 '!' | |
| 299 | + { 3, 6, 5, 11, 2, -10 }, // 0x22 '"' | |
| 300 | + { 7, 7, 12, 11, 2, -10 }, // 0x23 '#' | |
| 301 | + { 18, 8, 12, 11, 1, -10 }, // 0x24 '$' | |
| 302 | + { 30, 7, 11, 11, 2, -10 }, // 0x25 '%' | |
| 303 | + { 40, 7, 10, 11, 2, -9 }, // 0x26 '&' | |
| 304 | + { 49, 3, 5, 11, 4, -10 }, // 0x27 ''' | |
| 305 | + { 51, 2, 13, 11, 5, -10 }, // 0x28 '(' | |
| 306 | + { 55, 2, 13, 11, 4, -10 }, // 0x29 ')' | |
| 307 | + { 59, 7, 7, 11, 2, -10 }, // 0x2A '*' | |
| 308 | + { 66, 7, 7, 11, 2, -8 }, // 0x2B '+' | |
| 309 | + { 73, 3, 5, 11, 2, -1 }, // 0x2C ',' | |
| 310 | + { 75, 9, 1, 11, 1, -5 }, // 0x2D '-' | |
| 311 | + { 77, 2, 2, 11, 4, -1 }, // 0x2E '.' | |
| 312 | + { 78, 7, 13, 11, 2, -11 }, // 0x2F '/' | |
| 313 | + { 90, 7, 11, 11, 2, -10 }, // 0x30 '0' | |
| 314 | + { 100, 5, 11, 11, 3, -10 }, // 0x31 '1' | |
| 315 | + { 107, 7, 11, 11, 2, -10 }, // 0x32 '2' | |
| 316 | + { 117, 8, 11, 11, 1, -10 }, // 0x33 '3' | |
| 317 | + { 128, 6, 11, 11, 3, -10 }, // 0x34 '4' | |
| 318 | + { 137, 7, 11, 11, 2, -10 }, // 0x35 '5' | |
| 319 | + { 147, 7, 11, 11, 2, -10 }, // 0x36 '6' | |
| 320 | + { 157, 7, 11, 11, 2, -10 }, // 0x37 '7' | |
| 321 | + { 167, 7, 11, 11, 2, -10 }, // 0x38 '8' | |
| 322 | + { 177, 7, 11, 11, 2, -10 }, // 0x39 '9' | |
| 323 | + { 187, 2, 8, 11, 4, -7 }, // 0x3A ':' | |
| 324 | + { 189, 3, 11, 11, 3, -7 }, // 0x3B ';' | |
| 325 | + { 194, 8, 8, 11, 1, -8 }, // 0x3C '<' | |
| 326 | + { 202, 9, 4, 11, 1, -6 }, // 0x3D '=' | |
| 327 | + { 207, 9, 8, 11, 1, -8 }, // 0x3E '>' | |
| 328 | + { 216, 7, 10, 11, 2, -9 }, // 0x3F '?' | |
| 329 | + { 225, 8, 12, 11, 2, -10 }, // 0x40 '@' | |
| 330 | + { 237, 11, 10, 11, 0, -9 }, // 0x41 'A' | |
| 331 | + { 251, 9, 10, 11, 1, -9 }, // 0x42 'B' | |
| 332 | + { 263, 9, 10, 11, 1, -9 }, // 0x43 'C' | |
| 333 | + { 275, 9, 10, 11, 1, -9 }, // 0x44 'D' | |
| 334 | + { 287, 9, 10, 11, 1, -9 }, // 0x45 'E' | |
| 335 | + { 299, 9, 10, 11, 1, -9 }, // 0x46 'F' | |
| 336 | + { 311, 10, 10, 11, 1, -9 }, // 0x47 'G' | |
| 337 | + { 324, 9, 10, 11, 1, -9 }, // 0x48 'H' | |
| 338 | + { 336, 5, 10, 11, 3, -9 }, // 0x49 'I' | |
| 339 | + { 343, 8, 10, 11, 2, -9 }, // 0x4A 'J' | |
| 340 | + { 353, 9, 10, 11, 1, -9 }, // 0x4B 'K' | |
| 341 | + { 365, 8, 10, 11, 2, -9 }, // 0x4C 'L' | |
| 342 | + { 375, 11, 10, 11, 0, -9 }, // 0x4D 'M' | |
| 343 | + { 389, 9, 10, 11, 1, -9 }, // 0x4E 'N' | |
| 344 | + { 401, 9, 10, 11, 1, -9 }, // 0x4F 'O' | |
| 345 | + { 413, 8, 10, 11, 1, -9 }, // 0x50 'P' | |
| 346 | + { 423, 9, 13, 11, 1, -9 }, // 0x51 'Q' | |
| 347 | + { 438, 9, 10, 11, 1, -9 }, // 0x52 'R' | |
| 348 | + { 450, 7, 10, 11, 2, -9 }, // 0x53 'S' | |
| 349 | + { 459, 9, 10, 11, 1, -9 }, // 0x54 'T' | |
| 350 | + { 471, 9, 10, 11, 1, -9 }, // 0x55 'U' | |
| 351 | + { 483, 11, 10, 11, 0, -9 }, // 0x56 'V' | |
| 352 | + { 497, 11, 10, 11, 0, -9 }, // 0x57 'W' | |
| 353 | + { 511, 9, 10, 11, 1, -9 }, // 0x58 'X' | |
| 354 | + { 523, 9, 10, 11, 1, -9 }, // 0x59 'Y' | |
| 355 | + { 535, 7, 10, 11, 2, -9 }, // 0x5A 'Z' | |
| 356 | + { 544, 2, 13, 11, 5, -10 }, // 0x5B '[' | |
| 357 | + { 548, 7, 13, 11, 2, -11 }, // 0x5C '\' | |
| 358 | + { 560, 2, 13, 11, 4, -10 }, // 0x5D ']' | |
| 359 | + { 564, 7, 5, 11, 2, -10 }, // 0x5E '^' | |
| 360 | + { 569, 11, 1, 11, 0, 2 }, // 0x5F '_' | |
| 361 | + { 571, 3, 3, 11, 3, -11 }, // 0x60 '`' | |
| 362 | + { 573, 9, 8, 11, 1, -7 }, // 0x61 'a' | |
| 363 | + { 582, 9, 11, 11, 1, -10 }, // 0x62 'b' | |
| 364 | + { 595, 7, 8, 11, 2, -7 }, // 0x63 'c' | |
| 365 | + { 602, 9, 11, 11, 1, -10 }, // 0x64 'd' | |
| 366 | + { 615, 8, 8, 11, 1, -7 }, // 0x65 'e' | |
| 367 | + { 623, 6, 11, 11, 3, -10 }, // 0x66 'f' | |
| 368 | + { 632, 9, 11, 11, 1, -7 }, // 0x67 'g' | |
| 369 | + { 645, 9, 11, 11, 1, -10 }, // 0x68 'h' | |
| 370 | + { 658, 7, 10, 11, 2, -9 }, // 0x69 'i' | |
| 371 | + { 667, 5, 13, 11, 3, -9 }, // 0x6A 'j' | |
| 372 | + { 676, 8, 11, 11, 2, -10 }, // 0x6B 'k' | |
| 373 | + { 687, 7, 11, 11, 2, -10 }, // 0x6C 'l' | |
| 374 | + { 697, 9, 8, 11, 1, -7 }, // 0x6D 'm' | |
| 375 | + { 706, 9, 8, 11, 1, -7 }, // 0x6E 'n' | |
| 376 | + { 715, 9, 8, 11, 1, -7 }, // 0x6F 'o' | |
| 377 | + { 724, 9, 11, 11, 1, -7 }, // 0x70 'p' | |
| 378 | + { 737, 9, 11, 11, 1, -7 }, // 0x71 'q' | |
| 379 | + { 750, 7, 8, 11, 3, -7 }, // 0x72 'r' | |
| 380 | + { 757, 7, 8, 11, 2, -7 }, // 0x73 's' | |
| 381 | + { 764, 8, 10, 11, 2, -9 }, // 0x74 't' | |
| 382 | + { 774, 8, 8, 11, 1, -7 }, // 0x75 'u' | |
| 383 | + { 782, 9, 8, 11, 1, -7 }, // 0x76 'v' | |
| 384 | + { 791, 9, 8, 11, 1, -7 }, // 0x77 'w' | |
| 385 | + { 800, 9, 8, 11, 1, -7 }, // 0x78 'x' | |
| 386 | + { 809, 9, 11, 11, 1, -7 }, // 0x79 'y' | |
| 387 | + { 822, 7, 8, 11, 2, -7 }, // 0x7A 'z' | |
| 388 | + { 829, 3, 13, 11, 4, -10 }, // 0x7B '{' | |
| 389 | + { 834, 1, 13, 11, 5, -10 }, // 0x7C '|' | |
| 390 | + { 836, 3, 13, 11, 4, -10 }, // 0x7D '}' | |
| 391 | + { 841, 7, 3, 11, 2, -6 } }; // 0x7E '~' | |
| 392 | + | |
| 393 | +const GFXfont FreeMono9pt7b = { | |
| 394 | + (uint8_t *)FreeMono9pt7bBitmaps, | |
| 395 | + (GFXglyph *)FreeMono9pt7bGlyphs, | |
| 396 | + 0x20, 0x7E, 18 }; | |
| 397 | +const uint8_t FreeSans12pt7bBitmaps[] PROGMEM = { | |
| 398 | + 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xCF, 0x3C, 0xF3, 0x8A, 0x20, 0x06, 0x30, | |
| 399 | + 0x31, 0x03, 0x18, 0x18, 0xC7, 0xFF, 0xBF, 0xFC, 0x31, 0x03, 0x18, 0x18, | |
| 400 | + 0xC7, 0xFF, 0xBF, 0xFC, 0x31, 0x01, 0x18, 0x18, 0xC0, 0xC6, 0x06, 0x30, | |
| 401 | + 0x04, 0x03, 0xE1, 0xFF, 0x72, 0x6C, 0x47, 0x88, 0xF1, 0x07, 0x20, 0x7E, | |
| 402 | + 0x03, 0xF0, 0x17, 0x02, 0x3C, 0x47, 0x88, 0xF1, 0x1B, 0x26, 0x7F, 0xC3, | |
| 403 | + 0xE0, 0x10, 0x02, 0x00, 0x00, 0x06, 0x03, 0xC0, 0x40, 0x7E, 0x0C, 0x0E, | |
| 404 | + 0x70, 0x80, 0xC3, 0x18, 0x0C, 0x31, 0x00, 0xE7, 0x30, 0x07, 0xE6, 0x00, | |
| 405 | + 0x3C, 0x40, 0x00, 0x0C, 0x7C, 0x00, 0x8F, 0xE0, 0x19, 0xC7, 0x01, 0x18, | |
| 406 | + 0x30, 0x31, 0x83, 0x02, 0x1C, 0x70, 0x40, 0xFE, 0x04, 0x07, 0xC0, 0x0F, | |
| 407 | + 0x00, 0x7E, 0x03, 0x9C, 0x0C, 0x30, 0x30, 0xC0, 0xE7, 0x01, 0xF8, 0x03, | |
| 408 | + 0x80, 0x3E, 0x01, 0xCC, 0x6E, 0x19, 0xB0, 0x7C, 0xC0, 0xF3, 0x03, 0xCE, | |
| 409 | + 0x1F, 0x9F, 0xE6, 0x1E, 0x1C, 0xFF, 0xA0, 0x08, 0x8C, 0x66, 0x31, 0x98, | |
| 410 | + 0xC6, 0x31, 0x8C, 0x63, 0x08, 0x63, 0x08, 0x61, 0x0C, 0x20, 0x82, 0x18, | |
| 411 | + 0xC3, 0x18, 0xC3, 0x18, 0xC6, 0x31, 0x8C, 0x62, 0x31, 0x88, 0xC4, 0x62, | |
| 412 | + 0x00, 0x10, 0x23, 0x5B, 0xE3, 0x8D, 0x91, 0x00, 0x0C, 0x03, 0x00, 0xC0, | |
| 413 | + 0x30, 0xFF, 0xFF, 0xF0, 0xC0, 0x30, 0x0C, 0x03, 0x00, 0xC0, 0xF5, 0x60, | |
| 414 | + 0xFF, 0xF0, 0xF0, 0x02, 0x0C, 0x10, 0x20, 0xC1, 0x02, 0x0C, 0x10, 0x20, | |
| 415 | + 0xC1, 0x02, 0x0C, 0x10, 0x20, 0xC1, 0x00, 0x1F, 0x07, 0xF1, 0xC7, 0x30, | |
| 416 | + 0x6E, 0x0F, 0x80, 0xF0, 0x1E, 0x03, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x3C, | |
| 417 | + 0x0E, 0xC1, 0x9C, 0x71, 0xFC, 0x1F, 0x00, 0x08, 0xCF, 0xFF, 0x8C, 0x63, | |
| 418 | + 0x18, 0xC6, 0x31, 0x8C, 0x63, 0x18, 0x1F, 0x0F, 0xF9, 0x87, 0x60, 0x7C, | |
| 419 | + 0x06, 0x00, 0xC0, 0x18, 0x07, 0x01, 0xC0, 0xF0, 0x78, 0x1C, 0x06, 0x00, | |
| 420 | + 0x80, 0x30, 0x07, 0xFF, 0xFF, 0xE0, 0x3F, 0x0F, 0xF3, 0x87, 0x60, 0x6C, | |
| 421 | + 0x0C, 0x01, 0x80, 0x70, 0x7C, 0x0F, 0x80, 0x18, 0x01, 0x80, 0x3C, 0x07, | |
| 422 | + 0x80, 0xD8, 0x73, 0xFC, 0x1F, 0x00, 0x01, 0x80, 0x70, 0x0E, 0x03, 0xC0, | |
| 423 | + 0xD8, 0x1B, 0x06, 0x61, 0x8C, 0x21, 0x8C, 0x33, 0x06, 0x7F, 0xFF, 0xFE, | |
| 424 | + 0x03, 0x00, 0x60, 0x0C, 0x01, 0x80, 0x3F, 0xCF, 0xF9, 0x80, 0x30, 0x06, | |
| 425 | + 0x00, 0xDE, 0x1F, 0xE7, 0x0E, 0x00, 0xE0, 0x0C, 0x01, 0x80, 0x30, 0x07, | |
| 426 | + 0x81, 0xF8, 0x73, 0xFC, 0x1F, 0x00, 0x0F, 0x07, 0xF9, 0xC3, 0x30, 0x74, | |
| 427 | + 0x01, 0x80, 0x33, 0xC7, 0xFE, 0xF0, 0xDC, 0x1F, 0x01, 0xE0, 0x3C, 0x06, | |
| 428 | + 0xC1, 0xDC, 0x71, 0xFC, 0x1F, 0x00, 0xFF, 0xFF, 0xFC, 0x01, 0x00, 0x60, | |
| 429 | + 0x18, 0x02, 0x00, 0xC0, 0x30, 0x06, 0x01, 0x80, 0x30, 0x04, 0x01, 0x80, | |
| 430 | + 0x30, 0x06, 0x01, 0x80, 0x30, 0x00, 0x1F, 0x07, 0xF1, 0xC7, 0x30, 0x66, | |
| 431 | + 0x0C, 0xC1, 0x8C, 0x61, 0xFC, 0x3F, 0x8E, 0x3B, 0x01, 0xE0, 0x3C, 0x07, | |
| 432 | + 0x80, 0xD8, 0x31, 0xFC, 0x1F, 0x00, 0x1F, 0x07, 0xF1, 0xC7, 0x70, 0x6C, | |
| 433 | + 0x07, 0x80, 0xF0, 0x1E, 0x07, 0x61, 0xEF, 0xFC, 0x79, 0x80, 0x30, 0x05, | |
| 434 | + 0x81, 0x98, 0x73, 0xFC, 0x1E, 0x00, 0xF0, 0x00, 0x03, 0xC0, 0xF0, 0x00, | |
| 435 | + 0x0F, 0x56, 0x00, 0x00, 0x07, 0x01, 0xE0, 0xF8, 0x3C, 0x0F, 0x00, 0xE0, | |
| 436 | + 0x07, 0xC0, 0x0F, 0x00, 0x3C, 0x00, 0xF0, 0x01, 0xFF, 0xFF, 0xFF, 0x00, | |
| 437 | + 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x0E, 0x00, 0x78, 0x01, 0xF0, 0x07, | |
| 438 | + 0xC0, 0x0F, 0x00, 0x70, 0x1E, 0x0F, 0x03, 0xC0, 0xF0, 0x08, 0x00, 0x1F, | |
| 439 | + 0x1F, 0xEE, 0x1B, 0x03, 0xC0, 0xC0, 0x30, 0x0C, 0x06, 0x03, 0x81, 0xC0, | |
| 440 | + 0xE0, 0x30, 0x0C, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x03, 0x00, 0x00, 0xFE, | |
| 441 | + 0x00, 0x0F, 0xFE, 0x00, 0xF0, 0x3E, 0x07, 0x00, 0x3C, 0x38, 0x00, 0x30, | |
| 442 | + 0xC1, 0xE0, 0x66, 0x0F, 0xD9, 0xD8, 0x61, 0xC3, 0xC3, 0x07, 0x0F, 0x1C, | |
| 443 | + 0x1C, 0x3C, 0x60, 0x60, 0xF1, 0x81, 0x83, 0xC6, 0x06, 0x1B, 0x18, 0x38, | |
| 444 | + 0xEE, 0x71, 0xE7, 0x18, 0xFD, 0xF8, 0x71, 0xE7, 0xC0, 0xE0, 0x00, 0x01, | |
| 445 | + 0xE0, 0x00, 0x01, 0xFF, 0xC0, 0x01, 0xFC, 0x00, 0x03, 0xC0, 0x03, 0xC0, | |
| 446 | + 0x03, 0xC0, 0x07, 0xE0, 0x06, 0x60, 0x06, 0x60, 0x0E, 0x70, 0x0C, 0x30, | |
| 447 | + 0x0C, 0x30, 0x1C, 0x38, 0x18, 0x18, 0x1F, 0xF8, 0x3F, 0xFC, 0x30, 0x1C, | |
| 448 | + 0x30, 0x0C, 0x70, 0x0E, 0x60, 0x06, 0x60, 0x06, 0xFF, 0xC7, 0xFF, 0x30, | |
| 449 | + 0x19, 0x80, 0x6C, 0x03, 0x60, 0x1B, 0x00, 0xD8, 0x0C, 0xFF, 0xC7, 0xFF, | |
| 450 | + 0x30, 0x0D, 0x80, 0x3C, 0x01, 0xE0, 0x0F, 0x00, 0x78, 0x06, 0xFF, 0xF7, | |
| 451 | + 0xFE, 0x00, 0x07, 0xE0, 0x3F, 0xF0, 0xE0, 0x73, 0x80, 0x66, 0x00, 0x6C, | |
| 452 | + 0x00, 0x30, 0x00, 0x60, 0x00, 0xC0, 0x01, 0x80, 0x03, 0x00, 0x06, 0x00, | |
| 453 | + 0x06, 0x00, 0x6C, 0x00, 0xDC, 0x03, 0x1E, 0x0E, 0x1F, 0xF8, 0x0F, 0xC0, | |
| 454 | + 0xFF, 0x83, 0xFF, 0x8C, 0x07, 0x30, 0x0E, 0xC0, 0x1B, 0x00, 0x7C, 0x00, | |
| 455 | + 0xF0, 0x03, 0xC0, 0x0F, 0x00, 0x3C, 0x00, 0xF0, 0x03, 0xC0, 0x1F, 0x00, | |
| 456 | + 0x6C, 0x03, 0xB0, 0x1C, 0xFF, 0xE3, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xC0, | |
| 457 | + 0x0C, 0x00, 0xC0, 0x0C, 0x00, 0xC0, 0x0C, 0x00, 0xFF, 0xEF, 0xFE, 0xC0, | |
| 458 | + 0x0C, 0x00, 0xC0, 0x0C, 0x00, 0xC0, 0x0C, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, | |
| 459 | + 0xFF, 0xFF, 0x00, 0x60, 0x0C, 0x01, 0x80, 0x30, 0x06, 0x00, 0xFF, 0xDF, | |
| 460 | + 0xFB, 0x00, 0x60, 0x0C, 0x01, 0x80, 0x30, 0x06, 0x00, 0xC0, 0x18, 0x00, | |
| 461 | + 0x07, 0xF0, 0x1F, 0xFC, 0x3C, 0x1E, 0x70, 0x06, 0x60, 0x03, 0xE0, 0x00, | |
| 462 | + 0xC0, 0x00, 0xC0, 0x00, 0xC0, 0x7F, 0xC0, 0x7F, 0xC0, 0x03, 0xC0, 0x03, | |
| 463 | + 0x60, 0x03, 0x60, 0x07, 0x30, 0x0F, 0x3C, 0x1F, 0x1F, 0xFB, 0x07, 0xE1, | |
| 464 | + 0xC0, 0x1E, 0x00, 0xF0, 0x07, 0x80, 0x3C, 0x01, 0xE0, 0x0F, 0x00, 0x78, | |
| 465 | + 0x03, 0xFF, 0xFF, 0xFF, 0xF0, 0x07, 0x80, 0x3C, 0x01, 0xE0, 0x0F, 0x00, | |
| 466 | + 0x78, 0x03, 0xC0, 0x1E, 0x00, 0xC0, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x01, | |
| 467 | + 0x80, 0xC0, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x03, 0x01, 0x80, 0xC0, 0x60, | |
| 468 | + 0x3C, 0x1E, 0x0F, 0x07, 0xC7, 0x7F, 0x1F, 0x00, 0xC0, 0x3B, 0x01, 0xCC, | |
| 469 | + 0x0E, 0x30, 0x70, 0xC3, 0x83, 0x1C, 0x0C, 0xE0, 0x33, 0x80, 0xDE, 0x03, | |
| 470 | + 0xDC, 0x0E, 0x38, 0x30, 0x60, 0xC1, 0xC3, 0x03, 0x8C, 0x06, 0x30, 0x1C, | |
| 471 | + 0xC0, 0x3B, 0x00, 0x60, 0xC0, 0x30, 0x0C, 0x03, 0x00, 0xC0, 0x30, 0x0C, | |
| 472 | + 0x03, 0x00, 0xC0, 0x30, 0x0C, 0x03, 0x00, 0xC0, 0x30, 0x0C, 0x03, 0x00, | |
| 473 | + 0xFF, 0xFF, 0xF0, 0xE0, 0x07, 0xE0, 0x07, 0xF0, 0x0F, 0xF0, 0x0F, 0xD0, | |
| 474 | + 0x0F, 0xD8, 0x1B, 0xD8, 0x1B, 0xD8, 0x1B, 0xCC, 0x33, 0xCC, 0x33, 0xCC, | |
| 475 | + 0x33, 0xC6, 0x63, 0xC6, 0x63, 0xC6, 0x63, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, | |
| 476 | + 0xC3, 0xC1, 0x83, 0xE0, 0x1F, 0x00, 0xFC, 0x07, 0xE0, 0x3D, 0x81, 0xEE, | |
| 477 | + 0x0F, 0x30, 0x79, 0xC3, 0xC6, 0x1E, 0x18, 0xF0, 0xE7, 0x83, 0x3C, 0x1D, | |
| 478 | + 0xE0, 0x6F, 0x01, 0xF8, 0x0F, 0xC0, 0x3E, 0x01, 0xC0, 0x03, 0xE0, 0x0F, | |
| 479 | + 0xFC, 0x0F, 0x07, 0x86, 0x00, 0xC6, 0x00, 0x33, 0x00, 0x1B, 0x00, 0x07, | |
| 480 | + 0x80, 0x03, 0xC0, 0x01, 0xE0, 0x00, 0xF0, 0x00, 0x78, 0x00, 0x36, 0x00, | |
| 481 | + 0x33, 0x00, 0x18, 0xC0, 0x18, 0x78, 0x3C, 0x1F, 0xFC, 0x03, 0xF8, 0x00, | |
| 482 | + 0xFF, 0x8F, 0xFE, 0xC0, 0x6C, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x3C, 0x07, | |
| 483 | + 0xFF, 0xEF, 0xFC, 0xC0, 0x0C, 0x00, 0xC0, 0x0C, 0x00, 0xC0, 0x0C, 0x00, | |
| 484 | + 0xC0, 0x0C, 0x00, 0x03, 0xE0, 0x0F, 0xFC, 0x0F, 0x07, 0x86, 0x00, 0xC6, | |
| 485 | + 0x00, 0x33, 0x00, 0x1B, 0x00, 0x07, 0x80, 0x03, 0xC0, 0x01, 0xE0, 0x00, | |
| 486 | + 0xF0, 0x00, 0x78, 0x00, 0x36, 0x00, 0x33, 0x01, 0x98, 0xC0, 0xFC, 0x78, | |
| 487 | + 0x3C, 0x1F, 0xFF, 0x03, 0xF9, 0x80, 0x00, 0x40, 0xFF, 0xC3, 0xFF, 0xCC, | |
| 488 | + 0x03, 0xB0, 0x06, 0xC0, 0x1B, 0x00, 0x6C, 0x01, 0xB0, 0x0C, 0xFF, 0xE3, | |
| 489 | + 0xFF, 0xCC, 0x03, 0xB0, 0x06, 0xC0, 0x1B, 0x00, 0x6C, 0x01, 0xB0, 0x06, | |
| 490 | + 0xC0, 0x1B, 0x00, 0x70, 0x0F, 0xE0, 0x7F, 0xC3, 0x83, 0x9C, 0x07, 0x60, | |
| 491 | + 0x0D, 0x80, 0x06, 0x00, 0x1E, 0x00, 0x3F, 0x80, 0x3F, 0xC0, 0x0F, 0x80, | |
| 492 | + 0x07, 0xC0, 0x0F, 0x00, 0x3E, 0x00, 0xDE, 0x0E, 0x3F, 0xF0, 0x3F, 0x80, | |
| 493 | + 0xFF, 0xFF, 0xFF, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, | |
| 494 | + 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, | |
| 495 | + 0x06, 0x00, 0x60, 0xC0, 0x1E, 0x00, 0xF0, 0x07, 0x80, 0x3C, 0x01, 0xE0, | |
| 496 | + 0x0F, 0x00, 0x78, 0x03, 0xC0, 0x1E, 0x00, 0xF0, 0x07, 0x80, 0x3C, 0x01, | |
| 497 | + 0xE0, 0x0F, 0x80, 0xEE, 0x0E, 0x3F, 0xE0, 0x7C, 0x00, 0x60, 0x06, 0xC0, | |
| 498 | + 0x1D, 0xC0, 0x31, 0x80, 0x63, 0x01, 0xC7, 0x03, 0x06, 0x06, 0x0C, 0x1C, | |
| 499 | + 0x1C, 0x30, 0x18, 0x60, 0x31, 0xC0, 0x73, 0x00, 0x66, 0x00, 0xDC, 0x01, | |
| 500 | + 0xF0, 0x01, 0xE0, 0x03, 0xC0, 0x07, 0x00, 0xE0, 0x30, 0x1D, 0x80, 0xE0, | |
| 501 | + 0x76, 0x07, 0x81, 0xD8, 0x1E, 0x06, 0x70, 0x7C, 0x18, 0xC1, 0xB0, 0xE3, | |
| 502 | + 0x0C, 0xC3, 0x8C, 0x33, 0x0C, 0x38, 0xC6, 0x30, 0x67, 0x18, 0xC1, 0x98, | |
| 503 | + 0x67, 0x06, 0x61, 0xD8, 0x1D, 0x83, 0x60, 0x3C, 0x0D, 0x80, 0xF0, 0x3E, | |
| 504 | + 0x03, 0xC0, 0x70, 0x0F, 0x01, 0xC0, 0x18, 0x07, 0x00, 0x70, 0x0E, 0x60, | |
| 505 | + 0x38, 0xE0, 0x60, 0xE1, 0xC0, 0xC3, 0x01, 0xCC, 0x01, 0xF8, 0x01, 0xE0, | |
| 506 | + 0x03, 0x80, 0x07, 0x80, 0x1F, 0x00, 0x33, 0x00, 0xE7, 0x03, 0x86, 0x06, | |
| 507 | + 0x0E, 0x1C, 0x0E, 0x70, 0x0C, 0xC0, 0x1C, 0x60, 0x06, 0x70, 0x0E, 0x30, | |
| 508 | + 0x1C, 0x38, 0x18, 0x1C, 0x38, 0x0C, 0x30, 0x0E, 0x70, 0x06, 0x60, 0x03, | |
| 509 | + 0xC0, 0x03, 0xC0, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, | |
| 510 | + 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0xFF, 0xFF, 0xFF, 0xC0, 0x0E, | |
| 511 | + 0x00, 0xE0, 0x0E, 0x00, 0x60, 0x07, 0x00, 0x70, 0x07, 0x00, 0x30, 0x03, | |
| 512 | + 0x80, 0x38, 0x03, 0x80, 0x18, 0x01, 0xC0, 0x1C, 0x00, 0xFF, 0xFF, 0xFF, | |
| 513 | + 0xC0, 0xFF, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCF, | |
| 514 | + 0xF0, 0x81, 0x81, 0x02, 0x06, 0x04, 0x08, 0x18, 0x10, 0x20, 0x60, 0x40, | |
| 515 | + 0x81, 0x81, 0x02, 0x06, 0x04, 0xFF, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, | |
| 516 | + 0x33, 0x33, 0x33, 0x3F, 0xF0, 0x0C, 0x0E, 0x05, 0x86, 0xC3, 0x21, 0x19, | |
| 517 | + 0x8C, 0x83, 0xC1, 0x80, 0xFF, 0xFE, 0xE3, 0x8C, 0x30, 0x3F, 0x07, 0xF8, | |
| 518 | + 0xE1, 0xCC, 0x0C, 0x00, 0xC0, 0x1C, 0x3F, 0xCF, 0x8C, 0xC0, 0xCC, 0x0C, | |
| 519 | + 0xE3, 0xC7, 0xEF, 0x3C, 0x70, 0xC0, 0x0C, 0x00, 0xC0, 0x0C, 0x00, 0xC0, | |
| 520 | + 0x0C, 0xF8, 0xDF, 0xCF, 0x0E, 0xE0, 0x7C, 0x03, 0xC0, 0x3C, 0x03, 0xC0, | |
| 521 | + 0x3C, 0x03, 0xE0, 0x6F, 0x0E, 0xDF, 0xCC, 0xF8, 0x1F, 0x0F, 0xE7, 0x1B, | |
| 522 | + 0x83, 0xC0, 0x30, 0x0C, 0x03, 0x00, 0xC0, 0x38, 0x37, 0x1C, 0xFE, 0x1F, | |
| 523 | + 0x00, 0x00, 0x60, 0x0C, 0x01, 0x80, 0x30, 0x06, 0x3C, 0xCF, 0xFB, 0x8F, | |
| 524 | + 0xE0, 0xF8, 0x0F, 0x01, 0xE0, 0x3C, 0x07, 0x80, 0xF8, 0x3B, 0x8F, 0x3F, | |
| 525 | + 0x63, 0xCC, 0x1F, 0x07, 0xF1, 0xC7, 0x70, 0x3C, 0x07, 0xFF, 0xFF, 0xFE, | |
| 526 | + 0x00, 0xC0, 0x1C, 0x0D, 0xC3, 0x1F, 0xE1, 0xF0, 0x3B, 0xD8, 0xC6, 0x7F, | |
| 527 | + 0xEC, 0x63, 0x18, 0xC6, 0x31, 0x8C, 0x63, 0x00, 0x1E, 0x67, 0xFD, 0xC7, | |
| 528 | + 0xF0, 0x7C, 0x07, 0x80, 0xF0, 0x1E, 0x03, 0xC0, 0x7C, 0x1D, 0xC7, 0x9F, | |
| 529 | + 0xB1, 0xE6, 0x00, 0xC0, 0x3E, 0x0E, 0x7F, 0xC7, 0xE0, 0xC0, 0x30, 0x0C, | |
| 530 | + 0x03, 0x00, 0xC0, 0x33, 0xCD, 0xFB, 0xC7, 0xE0, 0xF0, 0x3C, 0x0F, 0x03, | |
| 531 | + 0xC0, 0xF0, 0x3C, 0x0F, 0x03, 0xC0, 0xF0, 0x30, 0xF0, 0x3F, 0xFF, 0xFF, | |
| 532 | + 0xF0, 0x33, 0x00, 0x03, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x3F, | |
| 533 | + 0xE0, 0xC0, 0x18, 0x03, 0x00, 0x60, 0x0C, 0x01, 0x83, 0x30, 0xC6, 0x30, | |
| 534 | + 0xCC, 0x1B, 0x83, 0xF0, 0x77, 0x0C, 0x61, 0x8E, 0x30, 0xE6, 0x0C, 0xC1, | |
| 535 | + 0xD8, 0x18, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xCF, 0x1F, 0x6F, 0xDF, 0xFC, | |
| 536 | + 0x78, 0xFC, 0x18, 0x3C, 0x0C, 0x1E, 0x06, 0x0F, 0x03, 0x07, 0x81, 0x83, | |
| 537 | + 0xC0, 0xC1, 0xE0, 0x60, 0xF0, 0x30, 0x78, 0x18, 0x3C, 0x0C, 0x18, 0xCF, | |
| 538 | + 0x37, 0xEF, 0x1F, 0x83, 0xC0, 0xF0, 0x3C, 0x0F, 0x03, 0xC0, 0xF0, 0x3C, | |
| 539 | + 0x0F, 0x03, 0xC0, 0xC0, 0x1F, 0x07, 0xF1, 0xC7, 0x70, 0x7C, 0x07, 0x80, | |
| 540 | + 0xF0, 0x1E, 0x03, 0xC0, 0x7C, 0x1D, 0xC7, 0x1F, 0xC1, 0xF0, 0xCF, 0x8D, | |
| 541 | + 0xFC, 0xF0, 0xEE, 0x06, 0xC0, 0x3C, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x3E, | |
| 542 | + 0x07, 0xF0, 0xEF, 0xFC, 0xCF, 0x8C, 0x00, 0xC0, 0x0C, 0x00, 0xC0, 0x00, | |
| 543 | + 0x1E, 0x67, 0xFD, 0xC7, 0xF0, 0x7C, 0x07, 0x80, 0xF0, 0x1E, 0x03, 0xC0, | |
| 544 | + 0x7C, 0x1D, 0xC7, 0x9F, 0xF1, 0xE6, 0x00, 0xC0, 0x18, 0x03, 0x00, 0x60, | |
| 545 | + 0xCF, 0x7F, 0x38, 0xC3, 0x0C, 0x30, 0xC3, 0x0C, 0x30, 0xC0, 0x3E, 0x1F, | |
| 546 | + 0xEE, 0x1B, 0x00, 0xC0, 0x3C, 0x07, 0xF0, 0x3E, 0x01, 0xF0, 0x3E, 0x1D, | |
| 547 | + 0xFE, 0x3E, 0x00, 0x63, 0x19, 0xFF, 0xB1, 0x8C, 0x63, 0x18, 0xC6, 0x31, | |
| 548 | + 0xE7, 0xC0, 0xF0, 0x3C, 0x0F, 0x03, 0xC0, 0xF0, 0x3C, 0x0F, 0x03, 0xC0, | |
| 549 | + 0xF0, 0x7E, 0x3D, 0xFB, 0x3C, 0xC0, 0xE0, 0x66, 0x06, 0x60, 0x67, 0x0C, | |
| 550 | + 0x30, 0xC3, 0x0C, 0x39, 0x81, 0x98, 0x19, 0x81, 0xF0, 0x0F, 0x00, 0xE0, | |
| 551 | + 0x0E, 0x00, 0xC1, 0xC1, 0xB0, 0xE1, 0xD8, 0x70, 0xCC, 0x2C, 0x66, 0x36, | |
| 552 | + 0x31, 0x9B, 0x18, 0xCD, 0x98, 0x64, 0x6C, 0x16, 0x36, 0x0F, 0x1A, 0x07, | |
| 553 | + 0x8F, 0x03, 0x83, 0x80, 0xC1, 0xC0, 0x60, 0xEE, 0x18, 0xC6, 0x0C, 0xC1, | |
| 554 | + 0xF0, 0x1C, 0x01, 0x80, 0x78, 0x1B, 0x03, 0x30, 0xC7, 0x30, 0x66, 0x06, | |
| 555 | + 0xE0, 0x6C, 0x0D, 0x83, 0x38, 0x63, 0x0C, 0x63, 0x0E, 0x60, 0xCC, 0x1B, | |
| 556 | + 0x03, 0x60, 0x3C, 0x07, 0x00, 0xE0, 0x18, 0x03, 0x00, 0xE0, 0x78, 0x0E, | |
| 557 | + 0x00, 0xFF, 0xFF, 0xF0, 0x18, 0x0C, 0x07, 0x03, 0x81, 0xC0, 0x60, 0x30, | |
| 558 | + 0x18, 0x0E, 0x03, 0xFF, 0xFF, 0xC0, 0x19, 0xCC, 0x63, 0x18, 0xC6, 0x31, | |
| 559 | + 0x99, 0x86, 0x18, 0xC6, 0x31, 0x8C, 0x63, 0x1C, 0x60, 0xFF, 0xFF, 0xFF, | |
| 560 | + 0xFF, 0xFF, 0xFC, 0xC7, 0x18, 0xC6, 0x31, 0x8C, 0x63, 0x0C, 0x33, 0x31, | |
| 561 | + 0x8C, 0x63, 0x18, 0xC6, 0x73, 0x00, 0x70, 0x3E, 0x09, 0xE4, 0x1F, 0x03, | |
| 562 | + 0x80 }; | |
| 563 | + | |
| 564 | +const GFXglyph FreeSans12pt7bGlyphs[] PROGMEM = { | |
| 565 | + { 0, 0, 0, 6, 0, 1 }, // 0x20 ' ' | |
| 566 | + { 0, 2, 18, 8, 3, -17 }, // 0x21 '!' | |
| 567 | + { 5, 6, 6, 8, 1, -16 }, // 0x22 '"' | |
| 568 | + { 10, 13, 16, 13, 0, -15 }, // 0x23 '#' | |
| 569 | + { 36, 11, 20, 13, 1, -17 }, // 0x24 '$' | |
| 570 | + { 64, 20, 17, 21, 1, -16 }, // 0x25 '%' | |
| 571 | + { 107, 14, 17, 16, 1, -16 }, // 0x26 '&' | |
| 572 | + { 137, 2, 6, 5, 1, -16 }, // 0x27 ''' | |
| 573 | + { 139, 5, 23, 8, 2, -17 }, // 0x28 '(' | |
| 574 | + { 154, 5, 23, 8, 1, -17 }, // 0x29 ')' | |
| 575 | + { 169, 7, 7, 9, 1, -17 }, // 0x2A '*' | |
| 576 | + { 176, 10, 11, 14, 2, -10 }, // 0x2B '+' | |
| 577 | + { 190, 2, 6, 7, 2, -1 }, // 0x2C ',' | |
| 578 | + { 192, 6, 2, 8, 1, -7 }, // 0x2D '-' | |
| 579 | + { 194, 2, 2, 6, 2, -1 }, // 0x2E '.' | |
| 580 | + { 195, 7, 18, 7, 0, -17 }, // 0x2F '/' | |
| 581 | + { 211, 11, 17, 13, 1, -16 }, // 0x30 '0' | |
| 582 | + { 235, 5, 17, 13, 3, -16 }, // 0x31 '1' | |
| 583 | + { 246, 11, 17, 13, 1, -16 }, // 0x32 '2' | |
| 584 | + { 270, 11, 17, 13, 1, -16 }, // 0x33 '3' | |
| 585 | + { 294, 11, 17, 13, 1, -16 }, // 0x34 '4' | |
| 586 | + { 318, 11, 17, 13, 1, -16 }, // 0x35 '5' | |
| 587 | + { 342, 11, 17, 13, 1, -16 }, // 0x36 '6' | |
| 588 | + { 366, 11, 17, 13, 1, -16 }, // 0x37 '7' | |
| 589 | + { 390, 11, 17, 13, 1, -16 }, // 0x38 '8' | |
| 590 | + { 414, 11, 17, 13, 1, -16 }, // 0x39 '9' | |
| 591 | + { 438, 2, 13, 6, 2, -12 }, // 0x3A ':' | |
| 592 | + { 442, 2, 16, 6, 2, -11 }, // 0x3B ';' | |
| 593 | + { 446, 12, 12, 14, 1, -11 }, // 0x3C '<' | |
| 594 | + { 464, 12, 6, 14, 1, -8 }, // 0x3D '=' | |
| 595 | + { 473, 12, 12, 14, 1, -11 }, // 0x3E '>' | |
| 596 | + { 491, 10, 18, 13, 2, -17 }, // 0x3F '?' | |
| 597 | + { 514, 22, 21, 24, 1, -17 }, // 0x40 '@' | |
| 598 | + { 572, 16, 18, 16, 0, -17 }, // 0x41 'A' | |
| 599 | + { 608, 13, 18, 16, 2, -17 }, // 0x42 'B' | |
| 600 | + { 638, 15, 18, 17, 1, -17 }, // 0x43 'C' | |
| 601 | + { 672, 14, 18, 17, 2, -17 }, // 0x44 'D' | |
| 602 | + { 704, 12, 18, 15, 2, -17 }, // 0x45 'E' | |
| 603 | + { 731, 11, 18, 14, 2, -17 }, // 0x46 'F' | |
| 604 | + { 756, 16, 18, 18, 1, -17 }, // 0x47 'G' | |
| 605 | + { 792, 13, 18, 17, 2, -17 }, // 0x48 'H' | |
| 606 | + { 822, 2, 18, 7, 2, -17 }, // 0x49 'I' | |
| 607 | + { 827, 9, 18, 13, 1, -17 }, // 0x4A 'J' | |
| 608 | + { 848, 14, 18, 16, 2, -17 }, // 0x4B 'K' | |
| 609 | + { 880, 10, 18, 14, 2, -17 }, // 0x4C 'L' | |
| 610 | + { 903, 16, 18, 20, 2, -17 }, // 0x4D 'M' | |
| 611 | + { 939, 13, 18, 18, 2, -17 }, // 0x4E 'N' | |
| 612 | + { 969, 17, 18, 19, 1, -17 }, // 0x4F 'O' | |
| 613 | + { 1008, 12, 18, 16, 2, -17 }, // 0x50 'P' | |
| 614 | + { 1035, 17, 19, 19, 1, -17 }, // 0x51 'Q' | |
| 615 | + { 1076, 14, 18, 17, 2, -17 }, // 0x52 'R' | |
| 616 | + { 1108, 14, 18, 16, 1, -17 }, // 0x53 'S' | |
| 617 | + { 1140, 12, 18, 15, 1, -17 }, // 0x54 'T' | |
| 618 | + { 1167, 13, 18, 17, 2, -17 }, // 0x55 'U' | |
| 619 | + { 1197, 15, 18, 15, 0, -17 }, // 0x56 'V' | |
| 620 | + { 1231, 22, 18, 22, 0, -17 }, // 0x57 'W' | |
| 621 | + { 1281, 15, 18, 16, 0, -17 }, // 0x58 'X' | |
| 622 | + { 1315, 16, 18, 16, 0, -17 }, // 0x59 'Y' | |
| 623 | + { 1351, 13, 18, 15, 1, -17 }, // 0x5A 'Z' | |
| 624 | + { 1381, 4, 23, 7, 2, -17 }, // 0x5B '[' | |
| 625 | + { 1393, 7, 18, 7, 0, -17 }, // 0x5C '\' | |
| 626 | + { 1409, 4, 23, 7, 1, -17 }, // 0x5D ']' | |
| 627 | + { 1421, 9, 9, 11, 1, -16 }, // 0x5E '^' | |
| 628 | + { 1432, 15, 1, 13, -1, 4 }, // 0x5F '_' | |
| 629 | + { 1434, 5, 4, 6, 1, -17 }, // 0x60 '`' | |
| 630 | + { 1437, 12, 13, 13, 1, -12 }, // 0x61 'a' | |
| 631 | + { 1457, 12, 18, 13, 1, -17 }, // 0x62 'b' | |
| 632 | + { 1484, 10, 13, 12, 1, -12 }, // 0x63 'c' | |
| 633 | + { 1501, 11, 18, 13, 1, -17 }, // 0x64 'd' | |
| 634 | + { 1526, 11, 13, 13, 1, -12 }, // 0x65 'e' | |
| 635 | + { 1544, 5, 18, 7, 1, -17 }, // 0x66 'f' | |
| 636 | + { 1556, 11, 18, 13, 1, -12 }, // 0x67 'g' | |
| 637 | + { 1581, 10, 18, 13, 1, -17 }, // 0x68 'h' | |
| 638 | + { 1604, 2, 18, 5, 2, -17 }, // 0x69 'i' | |
| 639 | + { 1609, 4, 23, 6, 0, -17 }, // 0x6A 'j' | |
| 640 | + { 1621, 11, 18, 12, 1, -17 }, // 0x6B 'k' | |
| 641 | + { 1646, 2, 18, 5, 1, -17 }, // 0x6C 'l' | |
| 642 | + { 1651, 17, 13, 19, 1, -12 }, // 0x6D 'm' | |
| 643 | + { 1679, 10, 13, 13, 1, -12 }, // 0x6E 'n' | |
| 644 | + { 1696, 11, 13, 13, 1, -12 }, // 0x6F 'o' | |
| 645 | + { 1714, 12, 17, 13, 1, -12 }, // 0x70 'p' | |
| 646 | + { 1740, 11, 17, 13, 1, -12 }, // 0x71 'q' | |
| 647 | + { 1764, 6, 13, 8, 1, -12 }, // 0x72 'r' | |
| 648 | + { 1774, 10, 13, 12, 1, -12 }, // 0x73 's' | |
| 649 | + { 1791, 5, 16, 7, 1, -15 }, // 0x74 't' | |
| 650 | + { 1801, 10, 13, 13, 1, -12 }, // 0x75 'u' | |
| 651 | + { 1818, 12, 13, 12, 0, -12 }, // 0x76 'v' | |
| 652 | + { 1838, 17, 13, 17, 0, -12 }, // 0x77 'w' | |
| 653 | + { 1866, 11, 13, 11, 0, -12 }, // 0x78 'x' | |
| 654 | + { 1884, 11, 18, 11, 0, -12 }, // 0x79 'y' | |
| 655 | + { 1909, 10, 13, 12, 1, -12 }, // 0x7A 'z' | |
| 656 | + { 1926, 5, 23, 8, 1, -17 }, // 0x7B '{' | |
| 657 | + { 1941, 2, 23, 6, 2, -17 }, // 0x7C '|' | |
| 658 | + { 1947, 5, 23, 8, 2, -17 }, // 0x7D '}' | |
| 659 | + { 1962, 10, 5, 12, 1, -10 } }; // 0x7E '~' | |
| 660 | + | |
| 661 | +const GFXfont FreeSans12pt7b PROGMEM = { | |
| 662 | + (uint8_t *)FreeSans12pt7bBitmaps, | |
| 663 | + (GFXglyph *)FreeSans12pt7bGlyphs, | |
| 664 | + 0x20, 0x7E, 29 }; | |
| 665 | + | |
| 666 | +// Approx. 2641 bytes | |
| 667 | +const uint8_t FreeSans9pt7bBitmaps[] PROGMEM = { | |
| 668 | + 0xFF, 0xFF, 0xF8, 0xC0, 0xDE, 0xF7, 0x20, 0x09, 0x86, 0x41, 0x91, 0xFF, | |
| 669 | + 0x13, 0x04, 0xC3, 0x20, 0xC8, 0xFF, 0x89, 0x82, 0x61, 0x90, 0x10, 0x1F, | |
| 670 | + 0x14, 0xDA, 0x3D, 0x1E, 0x83, 0x40, 0x78, 0x17, 0x08, 0xF4, 0x7A, 0x35, | |
| 671 | + 0x33, 0xF0, 0x40, 0x20, 0x38, 0x10, 0xEC, 0x20, 0xC6, 0x20, 0xC6, 0x40, | |
| 672 | + 0xC6, 0x40, 0x6C, 0x80, 0x39, 0x00, 0x01, 0x3C, 0x02, 0x77, 0x02, 0x63, | |
| 673 | + 0x04, 0x63, 0x04, 0x77, 0x08, 0x3C, 0x0E, 0x06, 0x60, 0xCC, 0x19, 0x81, | |
| 674 | + 0xE0, 0x18, 0x0F, 0x03, 0x36, 0xC2, 0xD8, 0x73, 0x06, 0x31, 0xE3, 0xC4, | |
| 675 | + 0xFE, 0x13, 0x26, 0x6C, 0xCC, 0xCC, 0xC4, 0x66, 0x23, 0x10, 0x8C, 0x46, | |
| 676 | + 0x63, 0x33, 0x33, 0x32, 0x66, 0x4C, 0x80, 0x25, 0x7E, 0xA5, 0x00, 0x30, | |
| 677 | + 0xC3, 0x3F, 0x30, 0xC3, 0x0C, 0xD6, 0xF0, 0xC0, 0x08, 0x44, 0x21, 0x10, | |
| 678 | + 0x84, 0x42, 0x11, 0x08, 0x00, 0x3C, 0x66, 0x42, 0xC3, 0xC3, 0xC3, 0xC3, | |
| 679 | + 0xC3, 0xC3, 0xC3, 0x42, 0x66, 0x3C, 0x11, 0x3F, 0x33, 0x33, 0x33, 0x33, | |
| 680 | + 0x30, 0x3E, 0x31, 0xB0, 0x78, 0x30, 0x18, 0x1C, 0x1C, 0x1C, 0x18, 0x18, | |
| 681 | + 0x10, 0x08, 0x07, 0xF8, 0x3C, 0x66, 0xC3, 0xC3, 0x03, 0x06, 0x1C, 0x07, | |
| 682 | + 0x03, 0xC3, 0xC3, 0x66, 0x3C, 0x0C, 0x18, 0x71, 0x62, 0xC9, 0xA3, 0x46, | |
| 683 | + 0xFE, 0x18, 0x30, 0x60, 0xC0, 0x7F, 0x20, 0x10, 0x08, 0x08, 0x07, 0xF3, | |
| 684 | + 0x8C, 0x03, 0x01, 0x80, 0xF0, 0x6C, 0x63, 0xE0, 0x1E, 0x31, 0x98, 0x78, | |
| 685 | + 0x0C, 0x06, 0xF3, 0x8D, 0x83, 0xC1, 0xE0, 0xD0, 0x6C, 0x63, 0xE0, 0xFF, | |
| 686 | + 0x03, 0x02, 0x06, 0x04, 0x0C, 0x08, 0x18, 0x18, 0x18, 0x10, 0x30, 0x30, | |
| 687 | + 0x3E, 0x31, 0xB0, 0x78, 0x3C, 0x1B, 0x18, 0xF8, 0xC6, 0xC1, 0xE0, 0xF0, | |
| 688 | + 0x6C, 0x63, 0xE0, 0x3C, 0x66, 0xC2, 0xC3, 0xC3, 0xC3, 0x67, 0x3B, 0x03, | |
| 689 | + 0x03, 0xC2, 0x66, 0x3C, 0xC0, 0x00, 0x30, 0xC0, 0x00, 0x00, 0x64, 0xA0, | |
| 690 | + 0x00, 0x81, 0xC7, 0x8E, 0x0C, 0x07, 0x80, 0x70, 0x0E, 0x01, 0x80, 0xFF, | |
| 691 | + 0x80, 0x00, 0x1F, 0xF0, 0x00, 0x70, 0x0E, 0x01, 0xC0, 0x18, 0x38, 0x71, | |
| 692 | + 0xC0, 0x80, 0x00, 0x3E, 0x31, 0xB0, 0x78, 0x30, 0x18, 0x18, 0x38, 0x18, | |
| 693 | + 0x18, 0x0C, 0x00, 0x00, 0x01, 0x80, 0x03, 0xF0, 0x06, 0x0E, 0x06, 0x01, | |
| 694 | + 0x86, 0x00, 0x66, 0x1D, 0xBB, 0x31, 0xCF, 0x18, 0xC7, 0x98, 0x63, 0xCC, | |
| 695 | + 0x31, 0xE6, 0x11, 0xB3, 0x99, 0xCC, 0xF7, 0x86, 0x00, 0x01, 0x80, 0x00, | |
| 696 | + 0x70, 0x40, 0x0F, 0xE0, 0x06, 0x00, 0xF0, 0x0F, 0x00, 0x90, 0x19, 0x81, | |
| 697 | + 0x98, 0x10, 0x83, 0x0C, 0x3F, 0xC2, 0x04, 0x60, 0x66, 0x06, 0xC0, 0x30, | |
| 698 | + 0xFF, 0x18, 0x33, 0x03, 0x60, 0x6C, 0x0D, 0x83, 0x3F, 0xC6, 0x06, 0xC0, | |
| 699 | + 0x78, 0x0F, 0x01, 0xE0, 0x6F, 0xF8, 0x1F, 0x86, 0x19, 0x81, 0xA0, 0x3C, | |
| 700 | + 0x01, 0x80, 0x30, 0x06, 0x00, 0xC0, 0x68, 0x0D, 0x83, 0x18, 0x61, 0xF0, | |
| 701 | + 0xFF, 0x18, 0x33, 0x03, 0x60, 0x3C, 0x07, 0x80, 0xF0, 0x1E, 0x03, 0xC0, | |
| 702 | + 0x78, 0x0F, 0x03, 0x60, 0xCF, 0xF0, 0xFF, 0xE0, 0x30, 0x18, 0x0C, 0x06, | |
| 703 | + 0x03, 0xFD, 0x80, 0xC0, 0x60, 0x30, 0x18, 0x0F, 0xF8, 0xFF, 0xC0, 0xC0, | |
| 704 | + 0xC0, 0xC0, 0xC0, 0xFE, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x0F, 0x83, | |
| 705 | + 0x0E, 0x60, 0x66, 0x03, 0xC0, 0x0C, 0x00, 0xC1, 0xFC, 0x03, 0xC0, 0x36, | |
| 706 | + 0x03, 0x60, 0x73, 0x0F, 0x0F, 0x10, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x3C, | |
| 707 | + 0x07, 0x80, 0xFF, 0xFE, 0x03, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x3C, 0x06, | |
| 708 | + 0xFF, 0xFF, 0xFF, 0xC0, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0x83, 0x07, | |
| 709 | + 0x8F, 0x1E, 0x27, 0x80, 0xC0, 0xD8, 0x33, 0x0C, 0x63, 0x0C, 0xC1, 0xB8, | |
| 710 | + 0x3F, 0x07, 0x30, 0xC3, 0x18, 0x63, 0x06, 0x60, 0x6C, 0x0C, 0xC0, 0xC0, | |
| 711 | + 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xFF, 0xE0, | |
| 712 | + 0x3F, 0x01, 0xFC, 0x1F, 0xE0, 0xFD, 0x05, 0xEC, 0x6F, 0x63, 0x79, 0x13, | |
| 713 | + 0xCD, 0x9E, 0x6C, 0xF1, 0x47, 0x8E, 0x3C, 0x71, 0x80, 0xE0, 0x7C, 0x0F, | |
| 714 | + 0xC1, 0xE8, 0x3D, 0x87, 0x98, 0xF1, 0x1E, 0x33, 0xC3, 0x78, 0x6F, 0x07, | |
| 715 | + 0xE0, 0x7C, 0x0E, 0x0F, 0x81, 0x83, 0x18, 0x0C, 0xC0, 0x6C, 0x01, 0xE0, | |
| 716 | + 0x0F, 0x00, 0x78, 0x03, 0xC0, 0x1B, 0x01, 0x98, 0x0C, 0x60, 0xC0, 0xF8, | |
| 717 | + 0x00, 0xFF, 0x30, 0x6C, 0x0F, 0x03, 0xC0, 0xF0, 0x6F, 0xF3, 0x00, 0xC0, | |
| 718 | + 0x30, 0x0C, 0x03, 0x00, 0xC0, 0x00, 0x0F, 0x81, 0x83, 0x18, 0x0C, 0xC0, | |
| 719 | + 0x6C, 0x01, 0xE0, 0x0F, 0x00, 0x78, 0x03, 0xC0, 0x1B, 0x01, 0x98, 0x6C, | |
| 720 | + 0x60, 0xC0, 0xFB, 0x00, 0x08, 0xFF, 0x8C, 0x0E, 0xC0, 0x6C, 0x06, 0xC0, | |
| 721 | + 0x6C, 0x0C, 0xFF, 0x8C, 0x0E, 0xC0, 0x6C, 0x06, 0xC0, 0x6C, 0x06, 0xC0, | |
| 722 | + 0x70, 0x3F, 0x18, 0x6C, 0x0F, 0x03, 0xC0, 0x1E, 0x01, 0xF0, 0x0E, 0x00, | |
| 723 | + 0xF0, 0x3C, 0x0D, 0x86, 0x3F, 0x00, 0xFF, 0x86, 0x03, 0x01, 0x80, 0xC0, | |
| 724 | + 0x60, 0x30, 0x18, 0x0C, 0x06, 0x03, 0x01, 0x80, 0xC0, 0xC0, 0x78, 0x0F, | |
| 725 | + 0x01, 0xE0, 0x3C, 0x07, 0x80, 0xF0, 0x1E, 0x03, 0xC0, 0x78, 0x0F, 0x01, | |
| 726 | + 0xB0, 0x61, 0xF0, 0xC0, 0x6C, 0x0D, 0x81, 0x10, 0x63, 0x0C, 0x61, 0x04, | |
| 727 | + 0x60, 0xCC, 0x19, 0x01, 0x60, 0x3C, 0x07, 0x00, 0x60, 0xC1, 0x81, 0x30, | |
| 728 | + 0xE1, 0x98, 0x70, 0xCC, 0x28, 0x66, 0x26, 0x21, 0x13, 0x30, 0xC8, 0x98, | |
| 729 | + 0x6C, 0x4C, 0x14, 0x34, 0x0A, 0x1A, 0x07, 0x07, 0x03, 0x03, 0x80, 0x81, | |
| 730 | + 0x80, 0x60, 0x63, 0x0C, 0x30, 0xC1, 0x98, 0x0F, 0x00, 0xE0, 0x06, 0x00, | |
| 731 | + 0xF0, 0x19, 0x01, 0x98, 0x30, 0xC6, 0x0E, 0x60, 0x60, 0xC0, 0x36, 0x06, | |
| 732 | + 0x30, 0xC3, 0x0C, 0x19, 0x81, 0xD8, 0x0F, 0x00, 0x60, 0x06, 0x00, 0x60, | |
| 733 | + 0x06, 0x00, 0x60, 0x06, 0x00, 0xFF, 0xC0, 0x60, 0x30, 0x0C, 0x06, 0x03, | |
| 734 | + 0x01, 0xC0, 0x60, 0x30, 0x18, 0x06, 0x03, 0x00, 0xFF, 0xC0, 0xFB, 0x6D, | |
| 735 | + 0xB6, 0xDB, 0x6D, 0xB6, 0xE0, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84, | |
| 736 | + 0x10, 0x80, 0xED, 0xB6, 0xDB, 0x6D, 0xB6, 0xDB, 0xE0, 0x30, 0x60, 0xA2, | |
| 737 | + 0x44, 0xD8, 0xA1, 0x80, 0xFF, 0xC0, 0xC6, 0x30, 0x7E, 0x71, 0xB0, 0xC0, | |
| 738 | + 0x60, 0xF3, 0xDB, 0x0D, 0x86, 0xC7, 0x3D, 0xC0, 0xC0, 0x60, 0x30, 0x1B, | |
| 739 | + 0xCE, 0x36, 0x0F, 0x07, 0x83, 0xC1, 0xE0, 0xF0, 0x7C, 0x6D, 0xE0, 0x3C, | |
| 740 | + 0x66, 0xC3, 0xC0, 0xC0, 0xC0, 0xC0, 0xC3, 0x66, 0x3C, 0x03, 0x03, 0x03, | |
| 741 | + 0x3B, 0x67, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0x67, 0x3B, 0x3C, 0x66, | |
| 742 | + 0xC3, 0xC3, 0xFF, 0xC0, 0xC0, 0xC3, 0x66, 0x3C, 0x36, 0x6F, 0x66, 0x66, | |
| 743 | + 0x66, 0x66, 0x60, 0x3B, 0x67, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0x67, | |
| 744 | + 0x3B, 0x03, 0x03, 0xC6, 0x7C, 0xC0, 0xC0, 0xC0, 0xDE, 0xE3, 0xC3, 0xC3, | |
| 745 | + 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xFF, 0xFF, 0xC0, 0x30, 0x03, | |
| 746 | + 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0xE0, 0xC0, 0x60, 0x30, 0x18, 0x4C, | |
| 747 | + 0x46, 0x63, 0x61, 0xF0, 0xEC, 0x62, 0x31, 0x98, 0x6C, 0x30, 0xFF, 0xFF, | |
| 748 | + 0xFF, 0xC0, 0xDE, 0xF7, 0x1C, 0xF0, 0xC7, 0x86, 0x3C, 0x31, 0xE1, 0x8F, | |
| 749 | + 0x0C, 0x78, 0x63, 0xC3, 0x1E, 0x18, 0xC0, 0xDE, 0xE3, 0xC3, 0xC3, 0xC3, | |
| 750 | + 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0x3C, 0x66, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, | |
| 751 | + 0xC3, 0x66, 0x3C, 0xDE, 0x71, 0xB0, 0x78, 0x3C, 0x1E, 0x0F, 0x07, 0x83, | |
| 752 | + 0xE3, 0x6F, 0x30, 0x18, 0x0C, 0x00, 0x3B, 0x67, 0xC3, 0xC3, 0xC3, 0xC3, | |
| 753 | + 0xC3, 0xC3, 0x67, 0x3B, 0x03, 0x03, 0x03, 0xDF, 0x31, 0x8C, 0x63, 0x18, | |
| 754 | + 0xC6, 0x00, 0x3E, 0xE3, 0xC0, 0xC0, 0xE0, 0x3C, 0x07, 0xC3, 0xE3, 0x7E, | |
| 755 | + 0x66, 0xF6, 0x66, 0x66, 0x66, 0x67, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, | |
| 756 | + 0xC3, 0xC3, 0xC7, 0x7B, 0xC1, 0xA0, 0x98, 0xCC, 0x42, 0x21, 0xB0, 0xD0, | |
| 757 | + 0x28, 0x1C, 0x0C, 0x00, 0xC6, 0x1E, 0x38, 0x91, 0xC4, 0xCA, 0x66, 0xD3, | |
| 758 | + 0x16, 0xD0, 0xA6, 0x87, 0x1C, 0x38, 0xC0, 0xC6, 0x00, 0x43, 0x62, 0x36, | |
| 759 | + 0x1C, 0x18, 0x1C, 0x3C, 0x26, 0x62, 0x43, 0xC1, 0x21, 0x98, 0xCC, 0x42, | |
| 760 | + 0x61, 0xB0, 0xD0, 0x38, 0x1C, 0x0C, 0x06, 0x03, 0x01, 0x03, 0x00, 0xFE, | |
| 761 | + 0x0C, 0x30, 0xC1, 0x86, 0x18, 0x20, 0xC1, 0xFC, 0x36, 0x66, 0x66, 0x6E, | |
| 762 | + 0xCE, 0x66, 0x66, 0x66, 0x30, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0xC6, 0x66, | |
| 763 | + 0x66, 0x67, 0x37, 0x66, 0x66, 0x66, 0xC0, 0x61, 0x24, 0x38 }; | |
| 764 | + | |
| 765 | +const GFXglyph FreeSans9pt7bGlyphs[] PROGMEM = { | |
| 766 | + { 0, 0, 0, 5, 0, 1 }, // 0x20 ' ' | |
| 767 | + { 0, 2, 13, 6, 2, -12 }, // 0x21 '!' | |
| 768 | + { 4, 5, 4, 6, 1, -12 }, // 0x22 '"' | |
| 769 | + { 7, 10, 12, 10, 0, -11 }, // 0x23 '#' | |
| 770 | + { 22, 9, 16, 10, 1, -13 }, // 0x24 '$' | |
| 771 | + { 40, 16, 13, 16, 1, -12 }, // 0x25 '%' | |
| 772 | + { 66, 11, 13, 12, 1, -12 }, // 0x26 '&' | |
| 773 | + { 84, 2, 4, 4, 1, -12 }, // 0x27 ''' | |
| 774 | + { 85, 4, 17, 6, 1, -12 }, // 0x28 '(' | |
| 775 | + { 94, 4, 17, 6, 1, -12 }, // 0x29 ')' | |
| 776 | + { 103, 5, 5, 7, 1, -12 }, // 0x2A '*' | |
| 777 | + { 107, 6, 8, 11, 3, -7 }, // 0x2B '+' | |
| 778 | + { 113, 2, 4, 5, 2, 0 }, // 0x2C ',' | |
| 779 | + { 114, 4, 1, 6, 1, -4 }, // 0x2D '-' | |
| 780 | + { 115, 2, 1, 5, 1, 0 }, // 0x2E '.' | |
| 781 | + { 116, 5, 13, 5, 0, -12 }, // 0x2F '/' | |
| 782 | + { 125, 8, 13, 10, 1, -12 }, // 0x30 '0' | |
| 783 | + { 138, 4, 13, 10, 3, -12 }, // 0x31 '1' | |
| 784 | + { 145, 9, 13, 10, 1, -12 }, // 0x32 '2' | |
| 785 | + { 160, 8, 13, 10, 1, -12 }, // 0x33 '3' | |
| 786 | + { 173, 7, 13, 10, 2, -12 }, // 0x34 '4' | |
| 787 | + { 185, 9, 13, 10, 1, -12 }, // 0x35 '5' | |
| 788 | + { 200, 9, 13, 10, 1, -12 }, // 0x36 '6' | |
| 789 | + { 215, 8, 13, 10, 0, -12 }, // 0x37 '7' | |
| 790 | + { 228, 9, 13, 10, 1, -12 }, // 0x38 '8' | |
| 791 | + { 243, 8, 13, 10, 1, -12 }, // 0x39 '9' | |
| 792 | + { 256, 2, 10, 5, 1, -9 }, // 0x3A ':' | |
| 793 | + { 259, 3, 12, 5, 1, -8 }, // 0x3B ';' | |
| 794 | + { 264, 9, 9, 11, 1, -8 }, // 0x3C '<' | |
| 795 | + { 275, 9, 4, 11, 1, -5 }, // 0x3D '=' | |
| 796 | + { 280, 9, 9, 11, 1, -8 }, // 0x3E '>' | |
| 797 | + { 291, 9, 13, 10, 1, -12 }, // 0x3F '?' | |
| 798 | + { 306, 17, 16, 18, 1, -12 }, // 0x40 '@' | |
| 799 | + { 340, 12, 13, 12, 0, -12 }, // 0x41 'A' | |
| 800 | + { 360, 11, 13, 12, 1, -12 }, // 0x42 'B' | |
| 801 | + { 378, 11, 13, 13, 1, -12 }, // 0x43 'C' | |
| 802 | + { 396, 11, 13, 13, 1, -12 }, // 0x44 'D' | |
| 803 | + { 414, 9, 13, 11, 1, -12 }, // 0x45 'E' | |
| 804 | + { 429, 8, 13, 11, 1, -12 }, // 0x46 'F' | |
| 805 | + { 442, 12, 13, 14, 1, -12 }, // 0x47 'G' | |
| 806 | + { 462, 11, 13, 13, 1, -12 }, // 0x48 'H' | |
| 807 | + { 480, 2, 13, 5, 2, -12 }, // 0x49 'I' | |
| 808 | + { 484, 7, 13, 10, 1, -12 }, // 0x4A 'J' | |
| 809 | + { 496, 11, 13, 12, 1, -12 }, // 0x4B 'K' | |
| 810 | + { 514, 8, 13, 10, 1, -12 }, // 0x4C 'L' | |
| 811 | + { 527, 13, 13, 15, 1, -12 }, // 0x4D 'M' | |
| 812 | + { 549, 11, 13, 13, 1, -12 }, // 0x4E 'N' | |
| 813 | + { 567, 13, 13, 14, 1, -12 }, // 0x4F 'O' | |
| 814 | + { 589, 10, 13, 12, 1, -12 }, // 0x50 'P' | |
| 815 | + { 606, 13, 14, 14, 1, -12 }, // 0x51 'Q' | |
| 816 | + { 629, 12, 13, 13, 1, -12 }, // 0x52 'R' | |
| 817 | + { 649, 10, 13, 12, 1, -12 }, // 0x53 'S' | |
| 818 | + { 666, 9, 13, 11, 1, -12 }, // 0x54 'T' | |
| 819 | + { 681, 11, 13, 13, 1, -12 }, // 0x55 'U' | |
| 820 | + { 699, 11, 13, 12, 0, -12 }, // 0x56 'V' | |
| 821 | + { 717, 17, 13, 17, 0, -12 }, // 0x57 'W' | |
| 822 | + { 745, 12, 13, 12, 0, -12 }, // 0x58 'X' | |
| 823 | + { 765, 12, 13, 12, 0, -12 }, // 0x59 'Y' | |
| 824 | + { 785, 10, 13, 11, 1, -12 }, // 0x5A 'Z' | |
| 825 | + { 802, 3, 17, 5, 1, -12 }, // 0x5B '[' | |
| 826 | + { 809, 5, 13, 5, 0, -12 }, // 0x5C '\' | |
| 827 | + { 818, 3, 17, 5, 0, -12 }, // 0x5D ']' | |
| 828 | + { 825, 7, 7, 8, 1, -12 }, // 0x5E '^' | |
| 829 | + { 832, 10, 1, 10, 0, 3 }, // 0x5F '_' | |
| 830 | + { 834, 4, 3, 5, 0, -12 }, // 0x60 '`' | |
| 831 | + { 836, 9, 10, 10, 1, -9 }, // 0x61 'a' | |
| 832 | + { 848, 9, 13, 10, 1, -12 }, // 0x62 'b' | |
| 833 | + { 863, 8, 10, 9, 1, -9 }, // 0x63 'c' | |
| 834 | + { 873, 8, 13, 10, 1, -12 }, // 0x64 'd' | |
| 835 | + { 886, 8, 10, 10, 1, -9 }, // 0x65 'e' | |
| 836 | + { 896, 4, 13, 5, 1, -12 }, // 0x66 'f' | |
| 837 | + { 903, 8, 14, 10, 1, -9 }, // 0x67 'g' | |
| 838 | + { 917, 8, 13, 10, 1, -12 }, // 0x68 'h' | |
| 839 | + { 930, 2, 13, 4, 1, -12 }, // 0x69 'i' | |
| 840 | + { 934, 4, 17, 4, 0, -12 }, // 0x6A 'j' | |
| 841 | + { 943, 9, 13, 9, 1, -12 }, // 0x6B 'k' | |
| 842 | + { 958, 2, 13, 4, 1, -12 }, // 0x6C 'l' | |
| 843 | + { 962, 13, 10, 15, 1, -9 }, // 0x6D 'm' | |
| 844 | + { 979, 8, 10, 10, 1, -9 }, // 0x6E 'n' | |
| 845 | + { 989, 8, 10, 10, 1, -9 }, // 0x6F 'o' | |
| 846 | + { 999, 9, 13, 10, 1, -9 }, // 0x70 'p' | |
| 847 | + { 1014, 8, 13, 10, 1, -9 }, // 0x71 'q' | |
| 848 | + { 1027, 5, 10, 6, 1, -9 }, // 0x72 'r' | |
| 849 | + { 1034, 8, 10, 9, 1, -9 }, // 0x73 's' | |
| 850 | + { 1044, 4, 12, 5, 1, -11 }, // 0x74 't' | |
| 851 | + { 1050, 8, 10, 10, 1, -9 }, // 0x75 'u' | |
| 852 | + { 1060, 9, 10, 9, 0, -9 }, // 0x76 'v' | |
| 853 | + { 1072, 13, 10, 13, 0, -9 }, // 0x77 'w' | |
| 854 | + { 1089, 8, 10, 9, 0, -9 }, // 0x78 'x' | |
| 855 | + { 1099, 9, 14, 9, 0, -9 }, // 0x79 'y' | |
| 856 | + { 1115, 7, 10, 9, 1, -9 }, // 0x7A 'z' | |
| 857 | + { 1124, 4, 17, 6, 1, -12 }, // 0x7B '{' | |
| 858 | + { 1133, 2, 17, 4, 2, -12 }, // 0x7C '|' | |
| 859 | + { 1138, 4, 17, 6, 1, -12 }, // 0x7D '}' | |
| 860 | + { 1147, 7, 3, 9, 1, -7 } }; // 0x7E '~' | |
| 861 | + | |
| 862 | +const GFXfont FreeSans9pt7b PROGMEM = { | |
| 863 | + (uint8_t *)FreeSans9pt7bBitmaps, | |
| 864 | + (GFXglyph *)FreeSans9pt7bGlyphs, | |
| 865 | + 0x20, 0x7E, 22 }; | |
| 866 | + | |
| 867 | +// Approx. 1822 bytes | |
| 868 | +// Created by http://oleddisplay.squix.ch/ Consider a donation | |
| 869 | +// In case of problems make sure that you are using the font file with the correct version! | |
| 870 | +const uint8_t URW_Gothic_L_Book_16Bitmaps[] PROGMEM = { | |
| 871 | + | |
| 872 | + // Bitmap Data: | |
| 873 | + 0x00, // ' ' | |
| 874 | + 0xFF,0xB0, // '!' | |
| 875 | + 0xB6,0xD0, // '"' | |
| 876 | + 0x11,0x08,0x84,0x82,0x4F,0xF9,0x10,0x89,0xFF,0x24,0x22,0x11,0x08,0x80, // '#' | |
| 877 | + 0x21,0xCC,0xA1,0x83,0x07,0x06,0x04,0x18,0x72,0x70,0x80, // '$' | |
| 878 | + 0x78,0x8C,0xD8,0x85,0x08,0x70,0xCE,0x07,0xA0,0x06,0x00,0x5E,0x0F,0x30,0xA1,0x0B,0x31,0x1E, // '%' | |
| 879 | + 0x3C,0x08,0xC1,0x08,0x21,0x03,0xC4,0xF1,0x13,0x64,0x38,0x83,0x10,0x71,0x1B,0x1E,0x30, // '&' | |
| 880 | + 0xF0, // ''' | |
| 881 | + 0x13,0x64,0x88,0x88,0x8C,0x46,0x30, // '(' | |
| 882 | + 0x8C,0x62,0x11,0x11,0x13,0x26,0xC8, // ')' | |
| 883 | + 0x52,0xBE,0x45,0x00, // '*' | |
| 884 | + 0x10,0x20,0x40,0x8F,0xE2,0x04,0x08, // '+' | |
| 885 | + 0x29,0x00, // ',' | |
| 886 | + 0xF0, // '-' | |
| 887 | + 0xC0, // '.' | |
| 888 | + 0x08,0x46,0x21,0x18,0x84,0x62,0x11,0x88,0x40, // '/' | |
| 889 | + 0x38,0x8A,0x0C,0x18,0x30,0x60,0xC1,0x83,0x05,0x11,0xC0, // '0' | |
| 890 | + 0xE4,0x92,0x49,0x24,0x90, // '1' | |
| 891 | + 0x79,0x8A,0x0C,0x10,0x20,0x83,0x0C,0x30,0xC3,0x07,0xF0, // '2' | |
| 892 | + 0x3C,0x26,0x42,0x02,0x06,0x1C,0x02,0x01,0xC1,0x41,0x62,0x3C, // '3' | |
| 893 | + 0x06,0x06,0x0A,0x0A,0x12,0x32,0x22,0x42,0xC2,0xFF,0x02,0x02, // '4' | |
| 894 | + 0x3E,0x20,0x60,0x40,0x7C,0x62,0x01,0x01,0x81,0xC1,0x62,0x3C, // '5' | |
| 895 | + 0x08,0x18,0x10,0x20,0x7C,0x42,0x81,0x81,0x81,0x81,0x42,0x3C, // '6' | |
| 896 | + 0xFE,0x0C,0x10,0x20,0x81,0x04,0x08,0x30,0x41,0x82,0x00, // '7' | |
| 897 | + 0x38,0x89,0x12,0x26,0x47,0x11,0x41,0x83,0x05,0x11,0xC0, // '8' | |
| 898 | + 0x3C,0x42,0x81,0x81,0x81,0x81,0x42,0x3E,0x04,0x08,0x18,0x10, // '9' | |
| 899 | + 0xC3, // ':' | |
| 900 | + 0x50,0x07,0x80, // ';' | |
| 901 | + 0x01,0x06,0x38,0xE0,0xC0,0x70,0x0C,0x03, // '<' | |
| 902 | + 0xFF,0x00,0x00,0xFF, // '=' | |
| 903 | + 0x80,0xE0,0x38,0x06,0x03,0x1C,0x70,0xC0, // '>' | |
| 904 | + 0x38,0x8A,0x0C,0x10,0x20,0x82,0x08,0x10,0x00,0x40,0x80, // '?' | |
| 905 | + 0x0F,0x83,0x04,0x67,0xA4,0xC9,0x88,0x99,0x09,0x91,0x19,0x12,0x53,0x64,0xDC,0x30,0x60,0xF8, // '@' | |
| 906 | + 0x06,0x00,0x60,0x0B,0x00,0x90,0x19,0x01,0x08,0x30,0x83,0xFC,0x20,0x46,0x06,0x40,0x2C,0x02, // 'A' | |
| 907 | + 0xFC,0x86,0x82,0x82,0x86,0xFC,0x82,0x81,0x81,0x81,0x82,0xFC, // 'B' | |
| 908 | + 0x0F,0x86,0x19,0x00,0xA0,0x08,0x01,0x00,0x20,0x04,0x00,0x40,0x08,0x04,0xC3,0x07,0xC0, // 'C' | |
| 909 | + 0xFC,0x20,0xC8,0x0A,0x03,0x80,0x60,0x18,0x06,0x01,0x80,0xE0,0x28,0x33,0xF0, // 'D' | |
| 910 | + 0xFE,0x08,0x20,0x82,0x0F,0xE0,0x82,0x08,0x3F, // 'E' | |
| 911 | + 0xFE,0x08,0x20,0x82,0x0F,0xE0,0x82,0x08,0x20, // 'F' | |
| 912 | + 0x0F,0x83,0x0C,0x40,0x24,0x00,0x80,0x08,0x00,0x80,0x08,0xFF,0x40,0x14,0x02,0x30,0x60,0xF8, // 'G' | |
| 913 | + 0x80,0xC0,0x60,0x30,0x18,0x0F,0xFE,0x03,0x01,0x80,0xC0,0x60,0x30,0x10, // 'H' | |
| 914 | + 0xFF,0xF0, // 'I' | |
| 915 | + 0x04,0x10,0x41,0x04,0x10,0x41,0x06,0x1C,0xDE, // 'J' | |
| 916 | + 0x83,0x86,0x8C,0x88,0x90,0xB0,0xF0,0xD8,0x88,0x84,0x86,0x83, // 'K' | |
| 917 | + 0x82,0x08,0x20,0x82,0x08,0x20,0x82,0x08,0x3F, // 'L' | |
| 918 | + 0xC0,0x3C,0x03,0xE0,0x7A,0x05,0xB0,0xD9,0x09,0x90,0x98,0x91,0x89,0x18,0xF1,0x86,0x18,0x61, // 'M' | |
| 919 | + 0xC0,0x78,0x1A,0x06,0x41,0x98,0x63,0x18,0x46,0x09,0x83,0x60,0x78,0x0E,0x01, // 'N' | |
| 920 | + 0x0F,0x03,0x0C,0x40,0x24,0x02,0x80,0x18,0x01,0x80,0x18,0x01,0x40,0x24,0x02,0x30,0xC0,0xF0, // 'O' | |
| 921 | + 0xFC,0x82,0x81,0x81,0x81,0x82,0xFC,0x80,0x80,0x80,0x80,0x80, // 'P' | |
| 922 | + 0x0F,0x83,0x0C,0x40,0x24,0x03,0x80,0x18,0x01,0x80,0x1F,0xC1,0x43,0x36,0x0A,0x30,0xC0,0xFB, // 'Q' | |
| 923 | + 0xFC,0x82,0x81,0x81,0x81,0x83,0x9E,0x98,0x88,0x84,0x86,0x82, // 'R' | |
| 924 | + 0x7B,0x38,0x60,0xC1,0xC1,0x81,0x06,0x1C,0xDE, // 'S' | |
| 925 | + 0xFE,0x20,0x40,0x81,0x02,0x04,0x08,0x10,0x20,0x40,0x80, // 'T' | |
| 926 | + 0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x42,0x3C, // 'U' | |
| 927 | + 0xC0,0x28,0x09,0x01,0x10,0x62,0x08,0x61,0x04,0x40,0x88,0x0B,0x01,0x40,0x38,0x02,0x00, // 'V' | |
| 928 | + 0xC1,0x02,0x83,0x05,0x0E,0x12,0x14,0x26,0x28,0x44,0x49,0x89,0x92,0x12,0x24,0x14,0x68,0x28,0x70,0x60,0xC0,0xC1,0x80, // 'W' | |
| 929 | + 0x40,0x98,0x42,0x30,0x48,0x1C,0x03,0x00,0xC0,0x58,0x32,0x08,0x44,0x1B,0x02, // 'X' | |
| 930 | + 0x80,0xA0,0x90,0x44,0x42,0x20,0xA0,0x50,0x10,0x08,0x04,0x02,0x01,0x00, // 'Y' | |
| 931 | + 0xFE,0x02,0x06,0x04,0x08,0x18,0x10,0x30,0x20,0x40,0x40,0xFF, // 'Z' | |
| 932 | + 0x2E,0x49,0x24,0x92,0x66,0x40, // '[' | |
| 933 | + 0x41,0x06,0x08,0x20,0x41,0x06,0x08,0x20,0x41, // '\' | |
| 934 | + 0x99,0x92,0x49,0x24,0x9D,0x00, // ']' | |
| 935 | + 0x0C,0x06,0x05,0x82,0x42,0x21,0x09,0x84,0x81,0xC0,0x80, // '^' | |
| 936 | + 0xFF, // '_' | |
| 937 | + 0xC3, // '`' | |
| 938 | + 0x3E,0xB1,0xF0,0x70,0x18,0x0C,0x07,0x06,0xC7,0x3E,0x80, // 'a' | |
| 939 | + 0x80,0x40,0x20,0x17,0xCE,0x36,0x0E,0x03,0x01,0x80,0xE0,0xF8,0xD7,0xC0, // 'b' | |
| 940 | + 0x3E,0x31,0xB0,0x70,0x08,0x04,0x03,0x06,0xC6,0x3E,0x00, // 'c' | |
| 941 | + 0x00,0x80,0x40,0x27,0xD6,0x3E,0x0E,0x03,0x01,0x80,0xE0,0xD8,0xE3,0xD0, // 'd' | |
| 942 | + 0x3C,0x21,0xA0,0x50,0x3F,0xFC,0x02,0x04,0x86,0x3C,0x00, // 'e' | |
| 943 | + 0x34,0x4F,0x44,0x44,0x44,0x44, // 'f' | |
| 944 | + 0x3E,0xB1,0xF0,0x70,0x18,0x0C,0x07,0x06,0xC7,0x3E,0xE0,0x58,0x47,0xC0, // 'g' | |
| 945 | + 0x80,0x80,0x80,0xBC,0xC2,0x81,0x81,0x81,0x81,0x81,0x81,0x81, // 'h' | |
| 946 | + 0xDF,0xF0, // 'i' | |
| 947 | + 0x24,0x12,0x49,0x24,0x92,0xF0, // 'j' | |
| 948 | + 0x81,0x02,0x04,0x28,0xD3,0x24,0x50,0xF1,0xB2,0x34,0x20, // 'k' | |
| 949 | + 0xFF,0xF0, // 'l' | |
| 950 | + 0xB8,0xE6,0x28,0xA0,0x83,0x04,0x18,0x20,0xC1,0x06,0x08,0x30,0x41,0x82,0x08, // 'm' | |
| 951 | + 0xBC,0xC2,0x81,0x81,0x81,0x81,0x81,0x81,0x81, // 'n' | |
| 952 | + 0x3E,0x31,0xB0,0x70,0x18,0x0C,0x07,0x06,0xC6,0x3E,0x00, // 'o' | |
| 953 | + 0xBE,0x71,0xB0,0x70,0x18,0x0C,0x07,0x07,0xC6,0xBE,0x40,0x20,0x10,0x00, // 'p' | |
| 954 | + 0x3E,0xB1,0xF0,0x70,0x18,0x0C,0x07,0x06,0xC7,0x3E,0x80,0x40,0x20,0x10, // 'q' | |
| 955 | + 0xBA,0x49,0x24,0x80, // 'r' | |
| 956 | + 0x74,0x61,0x87,0x06,0x31,0x70, // 's' | |
| 957 | + 0x21,0x09,0xF2,0x10,0x84,0x21,0x08,0x40, // 't' | |
| 958 | + 0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x43,0x3D, // 'u' | |
| 959 | + 0xC1,0xA0,0x90,0xC4,0x42,0x21,0xA0,0x50,0x38,0x08,0x00, // 'v' | |
| 960 | + 0x80,0x0A,0x10,0xD0,0xC4,0xCA,0x22,0x52,0x12,0xD0,0x72,0x83,0x18,0x18,0xC0, // 'w' | |
| 961 | + 0xC2,0x46,0x2C,0x18,0x18,0x38,0x24,0x46,0xC2, // 'x' | |
| 962 | + 0xC1,0x41,0x42,0x22,0x26,0x34,0x1C,0x18,0x18,0x10,0x10,0x30, // 'y' | |
| 963 | + 0xFC,0x08,0x20,0xC1,0x04,0x18,0x20,0xFE, // 'z' | |
| 964 | + 0x69,0x24,0xB6,0x49,0x24,0x40, // '{' | |
| 965 | + 0xFF,0xF0, // '|' | |
| 966 | + 0xC9,0x24,0x8B,0x49,0x25,0x00 // '}' | |
| 967 | +}; | |
| 968 | +const GFXglyph URW_Gothic_L_Book_16Glyphs[] PROGMEM = { | |
| 969 | +// bitmapOffset, width, height, xAdvance, xOffset, yOffset | |
| 970 | + { 0, 1, 1, 5, 0, 0 }, // ' ' | |
| 971 | + { 1, 1, 12, 6, 2, -12 }, // '!' | |
| 972 | + { 3, 3, 4, 6, 1, -12 }, // '"' | |
| 973 | + { 5, 9, 12, 10, 0, -12 }, // '#' | |
| 974 | + { 19, 6, 14, 10, 2, -13 }, // '$' | |
| 975 | + { 30, 12, 12, 13, 0, -12 }, // '%' | |
| 976 | + { 48, 11, 12, 13, 1, -12 }, // '&' | |
| 977 | + { 65, 1, 4, 4, 1, -12 }, // ''' | |
| 978 | + { 66, 4, 14, 7, 1, -12 }, // '(' | |
| 979 | + { 73, 4, 14, 7, 1, -12 }, // ')' | |
| 980 | + { 80, 5, 5, 8, 1, -12 }, // '*' | |
| 981 | + { 84, 7, 8, 11, 1, -9 }, // '+' | |
| 982 | + { 91, 3, 3, 5, 1, -2 }, // ',' | |
| 983 | + { 93, 4, 1, 6, 1, -5 }, // '-' | |
| 984 | + { 94, 1, 2, 5, 2, -2 }, // '.' | |
| 985 | + { 95, 5, 14, 8, 1, -12 }, // '/' | |
| 986 | + { 104, 7, 12, 10, 1, -12 }, // '0' | |
| 987 | + { 115, 3, 12, 10, 3, -12 }, // '1' | |
| 988 | + { 120, 7, 12, 10, 1, -12 }, // '2' | |
| 989 | + { 131, 8, 12, 10, 0, -12 }, // '3' | |
| 990 | + { 143, 8, 12, 10, 0, -12 }, // '4' | |
| 991 | + { 155, 8, 12, 10, 0, -12 }, // '5' | |
| 992 | + { 167, 8, 12, 10, 0, -12 }, // '6' | |
| 993 | + { 179, 7, 12, 10, 1, -12 }, // '7' | |
| 994 | + { 190, 7, 12, 10, 1, -12 }, // '8' | |
| 995 | + { 201, 8, 12, 10, 0, -12 }, // '9' | |
| 996 | + { 213, 1, 8, 5, 2, -8 }, // ':' | |
| 997 | + { 214, 2, 9, 5, 1, -8 }, // ';' | |
| 998 | + { 217, 8, 8, 11, 1, -9 }, // '<' | |
| 999 | + { 225, 8, 4, 11, 1, -7 }, // '=' | |
| 1000 | + { 229, 8, 8, 11, 1, -9 }, // '>' | |
| 1001 | + { 237, 7, 12, 10, 1, -12 }, // '?' | |
| 1002 | + { 248, 12, 12, 15, 1, -12 }, // '@' | |
| 1003 | + { 266, 12, 12, 13, 0, -12 }, // 'A' | |
| 1004 | + { 284, 8, 12, 10, 1, -12 }, // 'B' | |
| 1005 | + { 296, 11, 12, 14, 1, -12 }, // 'C' | |
| 1006 | + { 313, 10, 12, 13, 1, -12 }, // 'D' | |
| 1007 | + { 328, 6, 12, 10, 1, -12 }, // 'E' | |
| 1008 | + { 337, 6, 12, 9, 1, -12 }, // 'F' | |
| 1009 | + { 346, 12, 12, 15, 1, -12 }, // 'G' | |
| 1010 | + { 364, 9, 12, 12, 1, -12 }, // 'H' | |
| 1011 | + { 378, 1, 12, 5, 1, -12 }, // 'I' | |
| 1012 | + { 380, 6, 12, 9, 0, -12 }, // 'J' | |
| 1013 | + { 389, 8, 12, 10, 1, -12 }, // 'K' | |
| 1014 | + { 401, 6, 12, 8, 1, -12 }, // 'L' | |
| 1015 | + { 410, 12, 12, 16, 1, -12 }, // 'M' | |
| 1016 | + { 428, 10, 12, 13, 1, -12 }, // 'N' | |
| 1017 | + { 443, 12, 12, 15, 1, -12 }, // 'O' | |
| 1018 | + { 461, 8, 12, 10, 1, -12 }, // 'P' | |
| 1019 | + { 473, 12, 12, 15, 1, -12 }, // 'Q' | |
| 1020 | + { 491, 8, 12, 11, 1, -12 }, // 'R' | |
| 1021 | + { 503, 6, 12, 9, 1, -12 }, // 'S' | |
| 1022 | + { 512, 7, 12, 8, 0, -12 }, // 'T' | |
| 1023 | + { 523, 8, 12, 11, 1, -12 }, // 'U' | |
| 1024 | + { 535, 11, 12, 12, 0, -12 }, // 'V' | |
| 1025 | + { 552, 15, 12, 16, 0, -12 }, // 'W' | |
| 1026 | + { 575, 10, 12, 11, 0, -12 }, // 'X' | |
| 1027 | + { 590, 9, 12, 10, 0, -12 }, // 'Y' | |
| 1028 | + { 604, 8, 12, 9, 0, -12 }, // 'Z' | |
| 1029 | + { 616, 3, 14, 7, 2, -12 }, // '[' | |
| 1030 | + { 622, 6, 12, 11, 1, -12 }, // '\' | |
| 1031 | + { 631, 3, 14, 7, 1, -12 }, // ']' | |
| 1032 | + { 637, 9, 9, 11, 0, -12 }, // '^' | |
| 1033 | + { 648, 8, 1, 9, 0, 1 }, // '_' | |
| 1034 | + { 649, 4, 2, 7, 1, -12 }, // '`' | |
| 1035 | + { 650, 9, 9, 12, 1, -9 }, // 'a' | |
| 1036 | + { 661, 9, 12, 12, 1, -12 }, // 'b' | |
| 1037 | + { 675, 9, 9, 11, 1, -9 }, // 'c' | |
| 1038 | + { 686, 9, 12, 12, 1, -12 }, // 'd' | |
| 1039 | + { 700, 9, 9, 11, 1, -9 }, // 'e' | |
| 1040 | + { 711, 4, 12, 6, 1, -12 }, // 'f' | |
| 1041 | + { 717, 9, 12, 12, 1, -9 }, // 'g' | |
| 1042 | + { 731, 8, 12, 11, 1, -12 }, // 'h' | |
| 1043 | + { 743, 1, 12, 4, 1, -12 }, // 'i' | |
| 1044 | + { 745, 3, 15, 4, -1, -12 }, // 'j' | |
| 1045 | + { 751, 7, 12, 9, 1, -12 }, // 'k' | |
| 1046 | + { 762, 1, 12, 4, 1, -12 }, // 'l' | |
| 1047 | + { 764, 13, 9, 16, 1, -9 }, // 'm' | |
| 1048 | + { 779, 8, 9, 11, 1, -9 }, // 'n' | |
| 1049 | + { 788, 9, 9, 11, 1, -9 }, // 'o' | |
| 1050 | + { 799, 9, 12, 12, 1, -9 }, // 'p' | |
| 1051 | + { 813, 9, 12, 12, 1, -9 }, // 'q' | |
| 1052 | + { 827, 3, 9, 6, 1, -9 }, // 'r' | |
| 1053 | + { 831, 5, 9, 7, 1, -9 }, // 's' | |
| 1054 | + { 837, 5, 12, 6, 0, -12 }, // 't' | |
| 1055 | + { 845, 8, 9, 11, 1, -9 }, // 'u' | |
| 1056 | + { 854, 9, 9, 10, 0, -9 }, // 'v' | |
| 1057 | + { 865, 13, 9, 14, 0, -9 }, // 'w' | |
| 1058 | + { 880, 8, 9, 9, 0, -9 }, // 'x' | |
| 1059 | + { 889, 8, 12, 10, 0, -9 }, // 'y' | |
| 1060 | + { 901, 7, 9, 8, 0, -9 }, // 'z' | |
| 1061 | + { 909, 3, 14, 7, 1, -12 }, // '{' | |
| 1062 | + { 915, 1, 12, 12, 5, -12 }, // '|' | |
| 1063 | + { 917, 3, 14, 7, 1, -12 } // '}' | |
| 1064 | +}; | |
| 1065 | +const GFXfont URW_Gothic_L_Book_16 PROGMEM = { | |
| 1066 | +(uint8_t *)URW_Gothic_L_Book_16Bitmaps,(GFXglyph *)URW_Gothic_L_Book_16Glyphs,0x20, 0x7E, 20}; | |
| 1067 | + | |
| 1068 | +// Created by http://oleddisplay.squix.ch/ Consider a donation | |
| 1069 | +// In case of problems make sure that you are using the font file with the correct version! | |
| 1070 | +const uint8_t Open_Sans_Condensed_Light_16Bitmaps[] PROGMEM = { | |
| 1071 | + | |
| 1072 | + // Bitmap Data: | |
| 1073 | + 0x00, // ' ' | |
| 1074 | + 0xAA,0xAA,0x0A, // '!' | |
| 1075 | + 0xB6,0xD0, // '"' | |
| 1076 | + 0x24,0x48,0x91,0x27,0xE5,0x0A,0x7E,0x48,0x91,0x22,0x40, // '#' | |
| 1077 | + 0x22,0x7A,0xAA,0xC3,0x33,0x3E,0x22, // '$' | |
| 1078 | + 0xC5,0x52,0xA5,0x4B,0x16,0xF6,0x8D,0x2A,0x54,0xAA,0x30, // '%' | |
| 1079 | + 0x62,0x49,0x24,0x61,0x0A,0x29,0x9A,0x29,0xB9, // '&' | |
| 1080 | + 0xF0, // ''' | |
| 1081 | + 0x5A,0xAA,0xAA,0x94, // '(' | |
| 1082 | + 0xA5,0x55,0x55,0x68, // ')' | |
| 1083 | + 0x22,0xF6,0x90, // '*' | |
| 1084 | + 0x10,0x41,0x3F,0x10,0x41,0x00, // '+' | |
| 1085 | + 0xF0, // ',' | |
| 1086 | + 0xF0, // '-' | |
| 1087 | + 0xC0, // '.' | |
| 1088 | + 0x04,0x20,0x84,0x10,0x42,0x08,0x21,0x04,0x20, // '/' | |
| 1089 | + 0x69,0x99,0x99,0x99,0x99,0x96, // '0' | |
| 1090 | + 0x2E,0x92,0x49,0x24,0x90, // '1' | |
| 1091 | + 0xE1,0x11,0x11,0x22,0x48,0x8F, // '2' | |
| 1092 | + 0xE1,0x11,0x16,0x11,0x11,0x1E, // '3' | |
| 1093 | + 0x08,0x61,0x8A,0x29,0x24,0x92,0x8B,0xF0,0x82, // '4' | |
| 1094 | + 0xF8,0x88,0x8E,0x11,0x11,0x1E, // '5' | |
| 1095 | + 0x74,0x88,0x8E,0x99,0x99,0x96, // '6' | |
| 1096 | + 0xF8,0x42,0x10,0x88,0x42,0x21,0x08,0x80, // '7' | |
| 1097 | + 0x64,0xA5,0x29,0x32,0x92,0x8C,0x64,0xC0, // '8' | |
| 1098 | + 0x69,0x99,0x99,0xF1,0x11,0x2C, // '9' | |
| 1099 | + 0xC1,0x80, // ':' | |
| 1100 | + 0xC1,0xE0, // ';' | |
| 1101 | + 0x04,0x66,0x20,0x60,0x60,0x40, // '<' | |
| 1102 | + 0xFC,0x00,0x3F, // '=' | |
| 1103 | + 0x81,0x81,0x81,0x19,0x88,0x00, // '>' | |
| 1104 | + 0x70,0x82,0x11,0x08,0x84,0x40,0x18,0xC0, // '?' | |
| 1105 | + 0x3C,0x62,0x41,0x9D,0xA5,0xA5,0xA5,0xA5,0xAD,0x9E,0x80,0x40,0x38, // '@' | |
| 1106 | + 0x20,0xC3,0x0C,0x51,0x24,0x9E,0x4A,0x18,0x61, // 'A' | |
| 1107 | + 0xF4,0x63,0x18,0xFA,0x31,0x8C,0x63,0xE0, // 'B' | |
| 1108 | + 0x39,0x08,0x20,0x82,0x08,0x20,0x82,0x04,0x0E, // 'C' | |
| 1109 | + 0xF2,0x28,0x61,0x86,0x18,0x61,0x86,0x18,0xBC, // 'D' | |
| 1110 | + 0xF8,0x88,0x8F,0x88,0x88,0x8F, // 'E' | |
| 1111 | + 0xFC,0x21,0x08,0x43,0xF0,0x84,0x21,0x00, // 'F' | |
| 1112 | + 0x39,0x18,0x20,0x82,0x08,0xE1,0x86,0x14,0x4F, // 'G' | |
| 1113 | + 0x86,0x18,0x61,0x87,0xF8,0x61,0x86,0x18,0x61, // 'H' | |
| 1114 | + 0xFF,0xF0, // 'I' | |
| 1115 | + 0x24,0x92,0x49,0x24,0x92,0x70, // 'J' | |
| 1116 | + 0x8C,0xA5,0x4A,0x62,0x94,0x94,0xA5,0x10, // 'K' | |
| 1117 | + 0x84,0x21,0x08,0x42,0x10,0x84,0x21,0xF0, // 'L' | |
| 1118 | + 0xC1,0xE0,0xF0,0x74,0x5A,0x2D,0x16,0x8B,0x29,0x94,0xCA,0x66,0x31,0x10, // 'M' | |
| 1119 | + 0xC3,0x86,0x8D,0x1A,0x32,0x64,0xC5,0x8B,0x0E,0x1C,0x30, // 'N' | |
| 1120 | + 0x79,0x28,0x61,0x86,0x18,0x61,0x86,0x14,0x9E, // 'O' | |
| 1121 | + 0xF4,0x63,0x18,0xC7,0xD0,0x84,0x21,0x00, // 'P' | |
| 1122 | + 0x79,0x28,0x61,0x86,0x18,0x61,0x86,0x14,0x9E,0x08,0x20,0x80, // 'Q' | |
| 1123 | + 0xF2,0x28,0xA2,0x8A,0x2F,0x24,0x92,0x28,0xA1, // 'R' | |
| 1124 | + 0x78,0x88,0x84,0x31,0x11,0x1E, // 'S' | |
| 1125 | + 0xFC,0x82,0x08,0x20,0x82,0x08,0x20,0x82,0x08, // 'T' | |
| 1126 | + 0x86,0x18,0x61,0x86,0x18,0x61,0x86,0x14,0x9E, // 'U' | |
| 1127 | + 0x86,0x18,0x52,0x49,0x24,0x94,0x30,0xC3,0x0C, // 'V' | |
| 1128 | + 0x84,0x30,0x86,0x28,0xA5,0x24,0xA4,0x94,0x92,0x92,0x8C,0x31,0x86,0x30,0xC6,0x18,0xC0, // 'W' | |
| 1129 | + 0x45,0x24,0x8A,0x30,0x43,0x0C,0x49,0x24,0xA1, // 'X' | |
| 1130 | + 0x8C,0x54,0xA5,0x28,0x84,0x21,0x08,0x40, // 'Y' | |
| 1131 | + 0xF8,0x84,0x21,0x10,0x84,0x42,0x11,0xF0, // 'Z' | |
| 1132 | + 0xF2,0x49,0x24,0x92,0x49,0x38, // '[' | |
| 1133 | + 0x81,0x04,0x08,0x20,0x81,0x04,0x10,0x20,0x81, // '\' | |
| 1134 | + 0xE4,0x92,0x49,0x24,0x92,0x78, // ']' | |
| 1135 | + 0x20,0xC4,0x92,0x84, // '^' | |
| 1136 | + 0xFE, // '_' | |
| 1137 | + 0x48,0x80, // '`' | |
| 1138 | + 0x61,0x11,0x79,0x99,0xF0, // 'a' | |
| 1139 | + 0x84,0x21,0x0F,0x66,0x31,0x8C,0x63,0x9B,0x00, // 'b' | |
| 1140 | + 0x78,0x88,0x88,0x88,0x70, // 'c' | |
| 1141 | + 0x08,0x42,0x16,0xCE,0x31,0x8C,0x63,0x36,0x80, // 'd' | |
| 1142 | + 0x69,0x99,0xF8,0x88,0x70, // 'e' | |
| 1143 | + 0x34,0x44,0xF4,0x44,0x44,0x44,0x40, // 'f' | |
| 1144 | + 0x3D,0x24,0x92,0x48,0xC4,0x10,0x39,0x18,0x61,0x78, // 'g' | |
| 1145 | + 0x84,0x21,0x0B,0x66,0x31,0x8C,0x63,0x18,0x80, // 'h' | |
| 1146 | + 0xDF,0xF0, // 'i' | |
| 1147 | + 0x51,0x55,0x55,0x56, // 'j' | |
| 1148 | + 0x84,0x21,0x09,0x4A,0x94,0xE4,0xA5,0x28,0x80, // 'k' | |
| 1149 | + 0xFF,0xF8, // 'l' | |
| 1150 | + 0xF6,0x99,0x89,0x89,0x89,0x89,0x89,0x89,0x89, // 'm' | |
| 1151 | + 0xB6,0x63,0x18,0xC6,0x31,0x88, // 'n' | |
| 1152 | + 0x74,0x63,0x18,0xC6,0x31,0x70, // 'o' | |
| 1153 | + 0xB6,0x63,0x18,0xC6,0x39,0xB4,0x21,0x08,0x00, // 'p' | |
| 1154 | + 0x7C,0xE3,0x18,0xC6,0x33,0x68,0x42,0x10,0x80, // 'q' | |
| 1155 | + 0xF2,0x49,0x24,0x80, // 'r' | |
| 1156 | + 0xF2,0x44,0x49,0xE0, // 's' | |
| 1157 | + 0x44,0xF4,0x44,0x44,0x44,0x30, // 't' | |
| 1158 | + 0x8C,0x63,0x18,0xC6,0x33,0x68, // 'u' | |
| 1159 | + 0x8C,0x62,0xA5,0x29,0x44,0x20, // 'v' | |
| 1160 | + 0x88,0xC4,0x55,0x4A,0xA5,0x52,0xA9,0x54,0x44,0x22,0x00, // 'w' | |
| 1161 | + 0x8A,0x94,0x42,0x11,0x4A,0x88, // 'x' | |
| 1162 | + 0x8C,0x54,0xA5,0x29,0x44,0x21,0x08,0x8C,0x00, // 'y' | |
| 1163 | + 0x72,0x22,0x44,0x44,0xF0, // 'z' | |
| 1164 | + 0x32,0x44,0x44,0x48,0x44,0x44,0x42,0x10, // '{' | |
| 1165 | + 0x55,0x55,0x55,0x55,0x40, // '|' | |
| 1166 | + 0x84,0x22,0x22,0x21,0x22,0x22,0x24,0x80 // '}' | |
| 1167 | +}; | |
| 1168 | +const GFXglyph Open_Sans_Condensed_Light_16Glyphs[] PROGMEM = { | |
| 1169 | +// bitmapOffset, width, height, xAdvance, xOffset, yOffset | |
| 1170 | + { 0, 1, 1, 4, 0, 0 }, // ' ' | |
| 1171 | + { 1, 2, 12, 5, 1, -12 }, // '!' | |
| 1172 | + { 4, 3, 4, 6, 1, -12 }, // '"' | |
| 1173 | + { 6, 7, 12, 8, 0, -12 }, // '#' | |
| 1174 | + { 17, 4, 14, 7, 1, -13 }, // '$' | |
| 1175 | + { 24, 7, 12, 10, 1, -12 }, // '%' | |
| 1176 | + { 35, 6, 12, 8, 1, -12 }, // '&' | |
| 1177 | + { 44, 1, 4, 4, 1, -12 }, // ''' | |
| 1178 | + { 45, 2, 15, 5, 1, -12 }, // '(' | |
| 1179 | + { 49, 2, 15, 5, 1, -12 }, // ')' | |
| 1180 | + { 53, 4, 5, 7, 1, -13 }, // '*' | |
| 1181 | + { 56, 6, 7, 7, 0, -10 }, // '+' | |
| 1182 | + { 62, 1, 4, 4, 1, -2 }, // ',' | |
| 1183 | + { 63, 4, 1, 5, 0, -5 }, // '-' | |
| 1184 | + { 64, 1, 2, 4, 1, -2 }, // '.' | |
| 1185 | + { 65, 6, 12, 7, 0, -12 }, // '/' | |
| 1186 | + { 74, 4, 12, 7, 1, -12 }, // '0' | |
| 1187 | + { 80, 3, 12, 7, 1, -12 }, // '1' | |
| 1188 | + { 85, 4, 12, 7, 1, -12 }, // '2' | |
| 1189 | + { 91, 4, 12, 7, 1, -12 }, // '3' | |
| 1190 | + { 97, 6, 12, 7, 0, -12 }, // '4' | |
| 1191 | + { 106, 4, 12, 7, 1, -12 }, // '5' | |
| 1192 | + { 112, 4, 12, 7, 1, -12 }, // '6' | |
| 1193 | + { 118, 5, 12, 7, 0, -12 }, // '7' | |
| 1194 | + { 126, 5, 12, 7, 1, -12 }, // '8' | |
| 1195 | + { 134, 4, 12, 7, 1, -12 }, // '9' | |
| 1196 | + { 140, 1, 9, 4, 1, -9 }, // ':' | |
| 1197 | + { 142, 1, 11, 4, 1, -9 }, // ';' | |
| 1198 | + { 144, 6, 7, 7, 0, -10 }, // '<' | |
| 1199 | + { 150, 6, 4, 7, 0, -8 }, // '=' | |
| 1200 | + { 153, 6, 7, 7, 0, -10 }, // '>' | |
| 1201 | + { 159, 5, 12, 6, 0, -12 }, // '?' | |
| 1202 | + { 167, 8, 13, 11, 1, -12 }, // '@' | |
| 1203 | + { 180, 6, 12, 7, 0, -12 }, // 'A' | |
| 1204 | + { 189, 5, 12, 8, 1, -12 }, // 'B' | |
| 1205 | + { 197, 6, 12, 8, 1, -12 }, // 'C' | |
| 1206 | + { 206, 6, 12, 9, 1, -12 }, // 'D' | |
| 1207 | + { 215, 4, 12, 7, 1, -12 }, // 'E' | |
| 1208 | + { 221, 5, 12, 7, 1, -12 }, // 'F' | |
| 1209 | + { 229, 6, 12, 9, 1, -12 }, // 'G' | |
| 1210 | + { 238, 6, 12, 9, 1, -12 }, // 'H' | |
| 1211 | + { 247, 1, 12, 4, 1, -12 }, // 'I' | |
| 1212 | + { 249, 3, 15, 4, -1, -12 }, // 'J' | |
| 1213 | + { 255, 5, 12, 7, 1, -12 }, // 'K' | |
| 1214 | + { 263, 5, 12, 7, 1, -12 }, // 'L' | |
| 1215 | + { 271, 9, 12, 12, 1, -12 }, // 'M' | |
| 1216 | + { 285, 7, 12, 10, 1, -12 }, // 'N' | |
| 1217 | + { 296, 6, 12, 9, 1, -12 }, // 'O' | |
| 1218 | + { 305, 5, 12, 8, 1, -12 }, // 'P' | |
| 1219 | + { 313, 6, 15, 9, 1, -12 }, // 'Q' | |
| 1220 | + { 325, 6, 12, 8, 1, -12 }, // 'R' | |
| 1221 | + { 334, 4, 12, 7, 1, -12 }, // 'S' | |
| 1222 | + { 340, 6, 12, 7, 0, -12 }, // 'T' | |
| 1223 | + { 349, 6, 12, 9, 1, -12 }, // 'U' | |
| 1224 | + { 358, 6, 12, 7, 0, -12 }, // 'V' | |
| 1225 | + { 367, 11, 12, 12, 0, -12 }, // 'W' | |
| 1226 | + { 384, 6, 12, 7, 0, -12 }, // 'X' | |
| 1227 | + { 393, 5, 12, 6, 0, -12 }, // 'Y' | |
| 1228 | + { 401, 5, 12, 6, 0, -12 }, // 'Z' | |
| 1229 | + { 409, 3, 15, 6, 1, -12 }, // '[' | |
| 1230 | + { 415, 6, 12, 7, 0, -12 }, // '\' | |
| 1231 | + { 424, 3, 15, 6, 1, -12 }, // ']' | |
| 1232 | + { 430, 6, 5, 7, 0, -12 }, // '^' | |
| 1233 | + { 434, 7, 1, 8, 0, 1 }, // '_' | |
| 1234 | + { 435, 3, 3, 10, 3, -13 }, // '`' | |
| 1235 | + { 437, 4, 9, 7, 1, -9 }, // 'a' | |
| 1236 | + { 442, 5, 13, 8, 1, -13 }, // 'b' | |
| 1237 | + { 451, 4, 9, 6, 1, -9 }, // 'c' | |
| 1238 | + { 456, 5, 13, 8, 1, -13 }, // 'd' | |
| 1239 | + { 465, 4, 9, 7, 1, -9 }, // 'e' | |
| 1240 | + { 470, 4, 13, 5, 0, -13 }, // 'f' | |
| 1241 | + { 477, 6, 13, 7, 0, -9 }, // 'g' | |
| 1242 | + { 487, 5, 13, 8, 1, -13 }, // 'h' | |
| 1243 | + { 496, 1, 12, 4, 1, -12 }, // 'i' | |
| 1244 | + { 498, 2, 16, 4, 0, -12 }, // 'j' | |
| 1245 | + { 502, 5, 13, 7, 1, -13 }, // 'k' | |
| 1246 | + { 511, 1, 13, 4, 1, -13 }, // 'l' | |
| 1247 | + { 513, 8, 9, 11, 1, -9 }, // 'm' | |
| 1248 | + { 522, 5, 9, 8, 1, -9 }, // 'n' | |
| 1249 | + { 528, 5, 9, 8, 1, -9 }, // 'o' | |
| 1250 | + { 534, 5, 13, 8, 1, -9 }, // 'p' | |
| 1251 | + { 543, 5, 13, 8, 1, -9 }, // 'q' | |
| 1252 | + { 552, 3, 9, 5, 1, -9 }, // 'r' | |
| 1253 | + { 556, 3, 9, 6, 1, -9 }, // 's' | |
| 1254 | + { 560, 4, 11, 5, 0, -11 }, // 't' | |
| 1255 | + { 566, 5, 9, 8, 1, -9 }, // 'u' | |
| 1256 | + { 572, 5, 9, 6, 0, -9 }, // 'v' | |
| 1257 | + { 578, 9, 9, 10, 0, -9 }, // 'w' | |
| 1258 | + { 589, 5, 9, 6, 0, -9 }, // 'x' | |
| 1259 | + { 595, 5, 13, 6, 0, -9 }, // 'y' | |
| 1260 | + { 604, 4, 9, 5, 0, -9 }, // 'z' | |
| 1261 | + { 609, 4, 15, 7, 1, -12 }, // '{' | |
| 1262 | + { 617, 2, 17, 7, 2, -13 }, // '|' | |
| 1263 | + { 622, 4, 15, 7, 1, -12 } // '}' | |
| 1264 | +}; | |
| 1265 | +const GFXfont Open_Sans_Condensed_Light_16 PROGMEM = { | |
| 1266 | +(uint8_t *)Open_Sans_Condensed_Light_16Bitmaps,(GFXglyph *)Open_Sans_Condensed_Light_16Glyphs,0x20, 0x7E, 23}; | |
| 1267 | + | |
| 1268 | + | |
| 1269 | +// Created by http://oleddisplay.squix.ch/ Consider a donation | |
| 1270 | +// In case of problems make sure that you are using the font file with the correct version! | |
| 1271 | +const uint8_t Open_Sans_Condensed_Light_19Bitmaps[] PROGMEM = { | |
| 1272 | + | |
| 1273 | + // Bitmap Data: | |
| 1274 | + 0x00, // ' ' | |
| 1275 | + 0xF5,0x55,0x50,0xF0, // '!' | |
| 1276 | + 0x99,0x99,0x90, // '"' | |
| 1277 | + 0x12,0x12,0x14,0x24,0x7F,0x24,0x24,0x24,0x24,0xFE,0x24,0x28,0x48,0x48, // '#' | |
| 1278 | + 0x20,0x87,0xF9,0xA2,0x8A,0x18,0x18,0x92,0x49,0x2F,0xE2,0x08, // '$' | |
| 1279 | + 0x62,0x51,0x25,0x12,0x89,0x44,0xDA,0x6B,0x59,0x6C,0x8A,0x45,0x22,0x92,0x29,0x18, // '%' | |
| 1280 | + 0x70,0xA1,0x42,0x85,0x0A,0x08,0x30,0x95,0x2A,0x34,0x28,0xCE,0x40, // '&' | |
| 1281 | + 0xAA,0x80, // ''' | |
| 1282 | + 0x25,0x29,0x24,0x92,0x48,0x92,0x20, // '(' | |
| 1283 | + 0x89,0x22,0x49,0x24,0x92,0x92,0x80, // ')' | |
| 1284 | + 0x21,0x3E,0xA5,0x00, // '*' | |
| 1285 | + 0x20,0x82,0x08,0xFC,0x82,0x08,0x00, // '+' | |
| 1286 | + 0x6A, // ',' | |
| 1287 | + 0xE0, // '-' | |
| 1288 | + 0xF0, // '.' | |
| 1289 | + 0x08,0x20,0x84,0x10,0x42,0x08,0x21,0x04,0x20,0x82,0x00, // '/' | |
| 1290 | + 0x31,0x28,0x61,0x86,0x18,0x61,0x86,0x18,0x61,0x49,0xC0, // '0' | |
| 1291 | + 0x13,0xD1,0x11,0x11,0x11,0x11,0x11, // '1' | |
| 1292 | + 0x7A,0x20,0x41,0x04,0x10,0x82,0x10,0x82,0x10,0x83,0xF0, // '2' | |
| 1293 | + 0x7A,0x20,0x41,0x04,0x27,0x02,0x04,0x10,0x41,0x0B,0xC0, // '3' | |
| 1294 | + 0x04,0x0C,0x0C,0x14,0x14,0x24,0x24,0x44,0x44,0x44,0xFF,0x04,0x04,0x04, // '4' | |
| 1295 | + 0xFA,0x08,0x20,0x82,0x0F,0x83,0x04,0x10,0x41,0x0B,0xC0, // '5' | |
| 1296 | + 0x39,0x84,0x20,0x82,0xEC,0xE1,0x86,0x18,0x61,0x48,0xE0, // '6' | |
| 1297 | + 0xFC,0x10,0x42,0x08,0x21,0x04,0x10,0x82,0x08,0x41,0x00, // '7' | |
| 1298 | + 0x7B,0x38,0x61,0x85,0x23,0x16,0x86,0x18,0x61,0xC5,0xE0, // '8' | |
| 1299 | + 0x73,0x28,0x61,0x86,0x18,0x73,0x74,0x10,0x82,0x1B,0xC0, // '9' | |
| 1300 | + 0xF0,0x00,0xF0, // ':' | |
| 1301 | + 0xF0,0x00,0x6A, // ';' | |
| 1302 | + 0x04,0x23,0x30,0xC0,0xC0,0x81, // '<' | |
| 1303 | + 0xFC,0x00,0x00,0xFC, // '=' | |
| 1304 | + 0x81,0x03,0x03,0x0C,0xC4,0x20, // '>' | |
| 1305 | + 0x70,0x82,0x11,0x08,0x84,0x22,0x00,0x06,0x30, // '?' | |
| 1306 | + 0x1E,0x11,0x90,0x48,0x18,0xCC,0xA6,0x53,0x29,0x94,0xCA,0x65,0x33,0x68,0x02,0x01,0x80,0x78, // '@' | |
| 1307 | + 0x18,0x18,0x18,0x18,0x24,0x24,0x24,0x24,0x7E,0x42,0x42,0x42,0x81,0x81, // 'A' | |
| 1308 | + 0xFA,0x38,0x61,0x86,0x2F,0x23,0x86,0x18,0x61,0x87,0xE0, // 'B' | |
| 1309 | + 0x1C,0xC1,0x04,0x08,0x10,0x20,0x40,0x81,0x02,0x02,0x06,0x03,0x80, // 'C' | |
| 1310 | + 0xF9,0x1A,0x14,0x18,0x30,0x60,0xC1,0x83,0x06,0x0C,0x28,0xDF,0x00, // 'D' | |
| 1311 | + 0xFC,0x21,0x08,0x43,0xF0,0x84,0x21,0x08,0x7C, // 'E' | |
| 1312 | + 0xFC,0x21,0x08,0x42,0x1E,0x84,0x21,0x08,0x40, // 'F' | |
| 1313 | + 0x1E,0x21,0x40,0xC0,0x80,0x80,0x80,0x87,0x81,0x81,0xC1,0x41,0x21,0x1F, // 'G' | |
| 1314 | + 0x86,0x18,0x61,0x86,0x1F,0xE1,0x86,0x18,0x61,0x86,0x10, // 'H' | |
| 1315 | + 0xAA,0xAA,0xAA,0xA0, // 'I' | |
| 1316 | + 0x24,0x92,0x49,0x24,0x92,0x49,0xE0, // 'J' | |
| 1317 | + 0x8A,0x29,0x24,0xA2,0x8C,0x28,0xA2,0x49,0x22,0x8A,0x10, // 'K' | |
| 1318 | + 0x84,0x21,0x08,0x42,0x10,0x84,0x21,0x08,0x7C, // 'L' | |
| 1319 | + 0xC0,0x78,0x0E,0x82,0xD0,0x5A,0x0B,0x42,0x64,0x4C,0x89,0x91,0x31,0x46,0x28,0xC5,0x18,0xA3,0x08,0x40, // 'M' | |
| 1320 | + 0xC1,0xC1,0xA1,0xA1,0x91,0x91,0x91,0x89,0x89,0x85,0x85,0x85,0x83,0x83, // 'N' | |
| 1321 | + 0x3C,0x66,0x42,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x42,0x66,0x3C, // 'O' | |
| 1322 | + 0xF4,0xE3,0x18,0xC6,0x7E,0x84,0x21,0x08,0x40, // 'P' | |
| 1323 | + 0x3C,0x66,0x42,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x42,0x66,0x3C,0x04,0x04,0x02, // 'Q' | |
| 1324 | + 0xF9,0x1A,0x14,0x28,0x50,0xA3,0x78,0x91,0x12,0x24,0x28,0x50,0x80, // 'R' | |
| 1325 | + 0x3F,0x18,0x20,0x83,0x06,0x06,0x04,0x10,0x41,0x0F,0xC0, // 'S' | |
| 1326 | + 0xFE,0x20,0x40,0x81,0x02,0x04,0x08,0x10,0x20,0x40,0x81,0x02,0x00, // 'T' | |
| 1327 | + 0x83,0x06,0x0C,0x18,0x30,0x60,0xC1,0x83,0x06,0x0A,0x24,0x47,0x00, // 'U' | |
| 1328 | + 0x83,0x06,0x12,0x24,0x48,0x91,0x14,0x28,0x50,0xA1,0x41,0x02,0x00, // 'V' | |
| 1329 | + 0x82,0x0C,0x10,0x51,0x44,0x8A,0x24,0x51,0x22,0x89,0x14,0x45,0x14,0x28,0xA1,0x45,0x0A,0x28,0x51,0x41,0x0C,0x08,0x20, // 'W' | |
| 1330 | + 0x42,0x88,0x91,0x22,0x83,0x04,0x0C,0x28,0x50,0x92,0x24,0x50,0x40, // 'X' | |
| 1331 | + 0x86,0x14,0x92,0x48,0xC3,0x0C,0x10,0x41,0x04,0x10,0x40, // 'Y' | |
| 1332 | + 0xF8,0x84,0x22,0x10,0x88,0x42,0x21,0x08,0x7C, // 'Z' | |
| 1333 | + 0xF2,0x49,0x24,0x92,0x49,0x24,0xE0, // '[' | |
| 1334 | + 0x82,0x08,0x10,0x41,0x02,0x08,0x10,0x41,0x02,0x08,0x20, // '\' | |
| 1335 | + 0xE4,0x92,0x49,0x24,0x92,0x49,0xE0, // ']' | |
| 1336 | + 0x18,0x18,0x24,0x24,0x42,0x42,0x42, // '^' | |
| 1337 | + 0xFF, // '_' | |
| 1338 | + 0x88,0x80, // '`' | |
| 1339 | + 0x70,0xC2,0x17,0xC6,0x31,0x9B,0x40, // 'a' | |
| 1340 | + 0x82,0x08,0x20,0x82,0xEC,0xE1,0x86,0x18,0x61,0x87,0x3B,0x80, // 'b' | |
| 1341 | + 0x7A,0x21,0x08,0x42,0x10,0x43,0xC0, // 'c' | |
| 1342 | + 0x04,0x10,0x41,0x05,0xDC,0xE1,0x86,0x18,0x61,0x87,0x37,0x40, // 'd' | |
| 1343 | + 0x74,0x63,0x1F,0xC2,0x10,0x43,0xC0, // 'e' | |
| 1344 | + 0x39,0x10,0x84,0x79,0x08,0x42,0x10,0x84,0x21,0x00, // 'f' | |
| 1345 | + 0x3E,0x89,0x12,0x24,0x48,0x8E,0x10,0x40,0x79,0x0C,0x18,0x28,0x9E,0x00, // 'g' | |
| 1346 | + 0x82,0x08,0x20,0x82,0xEC,0xA1,0x86,0x18,0x61,0x86,0x18,0x40, // 'h' | |
| 1347 | + 0xA0,0xAA,0xAA,0xA0, // 'i' | |
| 1348 | + 0x48,0x04,0x92,0x49,0x24,0x92,0x4B,0x00, // 'j' | |
| 1349 | + 0x82,0x08,0x20,0x82,0x28,0xA4,0xA2,0xCD,0x24,0x8A,0x28,0x40, // 'k' | |
| 1350 | + 0xAA,0xAA,0xAA,0xA8, // 'l' | |
| 1351 | + 0xBB,0xB3,0x28,0x46,0x11,0x84,0x61,0x18,0x46,0x11,0x84,0x61,0x10, // 'm' | |
| 1352 | + 0xBB,0x28,0x61,0x86,0x18,0x61,0x86,0x10, // 'n' | |
| 1353 | + 0x79,0x28,0x61,0x86,0x18,0x61,0x49,0xE0, // 'o' | |
| 1354 | + 0xBB,0x38,0x61,0x86,0x18,0x61,0xCE,0xE8,0x20,0x82,0x08,0x00, // 'p' | |
| 1355 | + 0x77,0x38,0x61,0x86,0x18,0x61,0xCD,0xD0,0x41,0x04,0x10,0x40, // 'q' | |
| 1356 | + 0xBC,0xC8,0x88,0x88,0x88, // 'r' | |
| 1357 | + 0x78,0x88,0x43,0x11,0x1E, // 's' | |
| 1358 | + 0x44,0xF4,0x44,0x44,0x44,0x43, // 't' | |
| 1359 | + 0x86,0x18,0x61,0x86,0x18,0x61,0x4D,0xD0, // 'u' | |
| 1360 | + 0x86,0x14,0x92,0x49,0x23,0x0C,0x30,0xC0, // 'v' | |
| 1361 | + 0x8C,0x63,0x14,0xC9,0x32,0x4C,0x94,0xA5,0x28,0xCC,0x33,0x08,0x40, // 'w' | |
| 1362 | + 0x49,0x24,0x8C,0x30,0xC3,0x12,0x4A,0x10, // 'x' | |
| 1363 | + 0x86,0x14,0x92,0x49,0x23,0x0C,0x30,0xC2,0x08,0x20,0x8C,0x00, // 'y' | |
| 1364 | + 0xE2,0x22,0x44,0x88,0x8F, // 'z' | |
| 1365 | + 0x19,0x08,0x42,0x10,0x84,0xC1,0x08,0x42,0x10,0x84,0x18, // '{' | |
| 1366 | + 0xAA,0xAA,0xAA,0xAA,0xAA, // '|' | |
| 1367 | + 0xC1,0x08,0x42,0x10,0x84,0x19,0x08,0x42,0x10,0x84,0xC0 // '}' | |
| 1368 | +}; | |
| 1369 | +const GFXglyph Open_Sans_Condensed_Light_19Glyphs[] PROGMEM = { | |
| 1370 | +// bitmapOffset, width, height, xAdvance, xOffset, yOffset | |
| 1371 | + { 0, 1, 1, 5, 0, 0 }, // ' ' | |
| 1372 | + { 1, 2, 14, 5, 1, -14 }, // '!' | |
| 1373 | + { 5, 4, 5, 7, 1, -14 }, // '"' | |
| 1374 | + { 8, 8, 14, 9, 0, -14 }, // '#' | |
| 1375 | + { 22, 6, 16, 9, 1, -15 }, // '$' | |
| 1376 | + { 34, 9, 14, 12, 1, -14 }, // '%' | |
| 1377 | + { 50, 7, 14, 9, 1, -14 }, // '&' | |
| 1378 | + { 63, 2, 5, 5, 1, -14 }, // ''' | |
| 1379 | + { 65, 3, 17, 6, 1, -14 }, // '(' | |
| 1380 | + { 72, 3, 17, 6, 1, -14 }, // ')' | |
| 1381 | + { 79, 5, 5, 8, 1, -15 }, // '*' | |
| 1382 | + { 83, 6, 9, 9, 1, -12 }, // '+' | |
| 1383 | + { 90, 2, 4, 5, 1, -2 }, // ',' | |
| 1384 | + { 91, 3, 1, 6, 1, -6 }, // '-' | |
| 1385 | + { 92, 2, 2, 5, 1, -2 }, // '.' | |
| 1386 | + { 93, 6, 14, 8, 1, -14 }, // '/' | |
| 1387 | + { 104, 6, 14, 9, 1, -14 }, // '0' | |
| 1388 | + { 115, 4, 14, 9, 1, -14 }, // '1' | |
| 1389 | + { 122, 6, 14, 9, 1, -14 }, // '2' | |
| 1390 | + { 133, 6, 14, 9, 1, -14 }, // '3' | |
| 1391 | + { 144, 8, 14, 9, 0, -14 }, // '4' | |
| 1392 | + { 158, 6, 14, 9, 1, -14 }, // '5' | |
| 1393 | + { 169, 6, 14, 9, 1, -14 }, // '6' | |
| 1394 | + { 180, 6, 14, 9, 1, -14 }, // '7' | |
| 1395 | + { 191, 6, 14, 9, 1, -14 }, // '8' | |
| 1396 | + { 202, 6, 14, 9, 1, -14 }, // '9' | |
| 1397 | + { 213, 2, 10, 5, 1, -10 }, // ':' | |
| 1398 | + { 216, 2, 12, 5, 1, -10 }, // ';' | |
| 1399 | + { 219, 6, 8, 9, 1, -11 }, // '<' | |
| 1400 | + { 225, 6, 5, 9, 1, -10 }, // '=' | |
| 1401 | + { 229, 6, 8, 9, 1, -11 }, // '>' | |
| 1402 | + { 235, 5, 14, 6, 0, -14 }, // '?' | |
| 1403 | + { 244, 9, 16, 12, 1, -14 }, // '@' | |
| 1404 | + { 262, 8, 14, 9, 0, -14 }, // 'A' | |
| 1405 | + { 276, 6, 14, 9, 1, -14 }, // 'B' | |
| 1406 | + { 287, 7, 14, 9, 1, -14 }, // 'C' | |
| 1407 | + { 300, 7, 14, 10, 1, -14 }, // 'D' | |
| 1408 | + { 313, 5, 14, 8, 1, -14 }, // 'E' | |
| 1409 | + { 322, 5, 14, 8, 2, -14 }, // 'F' | |
| 1410 | + { 331, 8, 14, 11, 1, -14 }, // 'G' | |
| 1411 | + { 345, 6, 14, 11, 2, -14 }, // 'H' | |
| 1412 | + { 356, 2, 14, 5, 1, -14 }, // 'I' | |
| 1413 | + { 360, 3, 17, 5, -1, -14 }, // 'J' | |
| 1414 | + { 367, 6, 14, 9, 2, -14 }, // 'K' | |
| 1415 | + { 378, 5, 14, 8, 2, -14 }, // 'L' | |
| 1416 | + { 387, 11, 14, 14, 1, -14 }, // 'M' | |
| 1417 | + { 407, 8, 14, 11, 1, -14 }, // 'N' | |
| 1418 | + { 421, 8, 14, 11, 1, -14 }, // 'O' | |
| 1419 | + { 435, 5, 14, 9, 2, -14 }, // 'P' | |
| 1420 | + { 444, 8, 17, 11, 1, -14 }, // 'Q' | |
| 1421 | + { 461, 7, 14, 9, 1, -14 }, // 'R' | |
| 1422 | + { 474, 6, 14, 9, 1, -14 }, // 'S' | |
| 1423 | + { 485, 7, 14, 8, 0, -14 }, // 'T' | |
| 1424 | + { 498, 7, 14, 10, 1, -14 }, // 'U' | |
| 1425 | + { 511, 7, 14, 8, 0, -14 }, // 'V' | |
| 1426 | + { 524, 13, 14, 14, 0, -14 }, // 'W' | |
| 1427 | + { 547, 7, 14, 8, 0, -14 }, // 'X' | |
| 1428 | + { 560, 6, 14, 7, 0, -14 }, // 'Y' | |
| 1429 | + { 571, 5, 14, 7, 1, -14 }, // 'Z' | |
| 1430 | + { 580, 3, 17, 7, 2, -14 }, // '[' | |
| 1431 | + { 587, 6, 14, 8, 1, -14 }, // '\' | |
| 1432 | + { 598, 3, 17, 7, 1, -14 }, // ']' | |
| 1433 | + { 605, 8, 7, 9, 0, -14 }, // '^' | |
| 1434 | + { 612, 8, 1, 9, 0, 2 }, // '_' | |
| 1435 | + { 613, 3, 3, 11, 4, -15 }, // '`' | |
| 1436 | + { 615, 5, 10, 8, 1, -10 }, // 'a' | |
| 1437 | + { 622, 6, 15, 9, 1, -15 }, // 'b' | |
| 1438 | + { 634, 5, 10, 7, 1, -10 }, // 'c' | |
| 1439 | + { 641, 6, 15, 9, 1, -15 }, // 'd' | |
| 1440 | + { 653, 5, 10, 8, 1, -10 }, // 'e' | |
| 1441 | + { 660, 5, 15, 5, 0, -15 }, // 'f' | |
| 1442 | + { 670, 7, 15, 8, 0, -10 }, // 'g' | |
| 1443 | + { 684, 6, 15, 9, 1, -15 }, // 'h' | |
| 1444 | + { 696, 2, 14, 5, 1, -14 }, // 'i' | |
| 1445 | + { 700, 3, 19, 5, 0, -14 }, // 'j' | |
| 1446 | + { 708, 6, 15, 8, 1, -15 }, // 'k' | |
| 1447 | + { 720, 2, 15, 5, 1, -15 }, // 'l' | |
| 1448 | + { 724, 10, 10, 13, 1, -10 }, // 'm' | |
| 1449 | + { 737, 6, 10, 9, 1, -10 }, // 'n' | |
| 1450 | + { 745, 6, 10, 9, 1, -10 }, // 'o' | |
| 1451 | + { 753, 6, 15, 9, 1, -10 }, // 'p' | |
| 1452 | + { 765, 6, 15, 9, 1, -10 }, // 'q' | |
| 1453 | + { 777, 4, 10, 6, 1, -10 }, // 'r' | |
| 1454 | + { 782, 4, 10, 7, 1, -10 }, // 's' | |
| 1455 | + { 787, 4, 12, 5, 0, -12 }, // 't' | |
| 1456 | + { 793, 6, 10, 9, 1, -10 }, // 'u' | |
| 1457 | + { 801, 6, 10, 7, 0, -10 }, // 'v' | |
| 1458 | + { 809, 10, 10, 11, 0, -10 }, // 'w' | |
| 1459 | + { 822, 6, 10, 7, 0, -10 }, // 'x' | |
| 1460 | + { 830, 6, 15, 7, 0, -10 }, // 'y' | |
| 1461 | + { 842, 4, 10, 6, 1, -10 }, // 'z' | |
| 1462 | + { 847, 5, 17, 8, 1, -14 }, // '{' | |
| 1463 | + { 858, 2, 20, 9, 3, -15 }, // '|' | |
| 1464 | + { 863, 5, 17, 8, 1, -14 } // '}' | |
| 1465 | +}; | |
| 1466 | +const GFXfont Open_Sans_Condensed_Light_19 PROGMEM = { | |
| 1467 | +(uint8_t *)Open_Sans_Condensed_Light_19Bitmaps,(GFXglyph *)Open_Sans_Condensed_Light_19Glyphs,0x20, 0x7E, 27}; | |
| 1468 | + | |
| 1469 | +// Created by http://oleddisplay.squix.ch/ Consider a donation | |
| 1470 | +// In case of problems make sure that you are using the font file with the correct version! | |
| 1471 | +const uint8_t Open_Sans_Condensed_Light_22Bitmaps[] PROGMEM = { | |
| 1472 | + | |
| 1473 | + // Bitmap Data: | |
| 1474 | + 0x00, // ' ' | |
| 1475 | + 0xFF,0xF3, // '!' | |
| 1476 | + 0xDE,0xD6,0xA4,0xA4, // '"' | |
| 1477 | + 0x12,0x09,0x04,0x82,0x41,0x23,0xFC,0x48,0x44,0x22,0x12,0x3F,0xC4,0x82,0x41,0x20,0x90,0x48, // '#' | |
| 1478 | + 0x10,0x20,0xF2,0x89,0x12,0x24,0x28,0x70,0x30,0x50,0x91,0x22,0x45,0x7C,0x10,0x20,0x40, // '$' | |
| 1479 | + 0x61,0x12,0x22,0x44,0x49,0x09,0x21,0x24,0x25,0x34,0xA9,0x95,0x2C,0xA4,0x24,0x84,0x90,0x92,0x22,0x44,0x48,0x86, // '%' | |
| 1480 | + 0x30,0x48,0x48,0x48,0x48,0x48,0x30,0x20,0x50,0x92,0x8A,0x8A,0x86,0x86,0x8A,0x71, // '&' | |
| 1481 | + 0xF5,0x50, // ''' | |
| 1482 | + 0x12,0x24,0x44,0xC8,0x88,0x88,0x84,0x44,0x22,0x10, // '(' | |
| 1483 | + 0x84,0x42,0x22,0x31,0x11,0x11,0x12,0x22,0x44,0x80, // ')' | |
| 1484 | + 0x30,0x4D,0xCC,0x79,0x20, // '*' | |
| 1485 | + 0x10,0x20,0x40,0x81,0x1F,0xC4,0x08,0x10,0x20,0x40, // '+' | |
| 1486 | + 0x49,0x48, // ',' | |
| 1487 | + 0xF0, // '-' | |
| 1488 | + 0xC0, // '.' | |
| 1489 | + 0x04,0x08,0x10,0x40,0x83,0x04,0x08,0x20,0x40,0x82,0x04,0x08,0x20,0x40, // '/' | |
| 1490 | + 0x38,0x89,0x14,0x18,0x30,0x60,0xC1,0x83,0x06,0x0C,0x18,0x28,0x91,0x1C, // '0' | |
| 1491 | + 0x35,0x91,0x11,0x11,0x11,0x11,0x11,0x11, // '1' | |
| 1492 | + 0x79,0x08,0x10,0x10,0x20,0x81,0x02,0x08,0x10,0x41,0x02,0x08,0x20,0x7F, // '2' | |
| 1493 | + 0x79,0x08,0x18,0x10,0x20,0x83,0x18,0x0C,0x0C,0x08,0x10,0x20,0xC1,0x7C, // '3' | |
| 1494 | + 0x06,0x03,0x02,0x81,0x40,0xA0,0x90,0x48,0x44,0x22,0x21,0x10,0x9F,0xF0,0x20,0x10,0x08,0x04, // '4' | |
| 1495 | + 0x7C,0x82,0x04,0x08,0x10,0x3E,0x02,0x02,0x04,0x08,0x10,0x20,0xA3,0x7C, // '5' | |
| 1496 | + 0x1C,0x41,0x02,0x04,0x10,0x2E,0x62,0x83,0x06,0x0C,0x18,0x28,0x51,0x1C, // '6' | |
| 1497 | + 0xFE,0x04,0x08,0x20,0x40,0x82,0x04,0x08,0x20,0x40,0x82,0x04,0x08,0x20, // '7' | |
| 1498 | + 0x38,0x8A,0x0C,0x18,0x28,0x99,0x1C,0x69,0x8A,0x0C,0x18,0x30,0x51,0x9C, // '8' | |
| 1499 | + 0x38,0x8A,0x14,0x38,0x30,0x60,0xC3,0x46,0x74,0x08,0x20,0x40,0x82,0x38, // '9' | |
| 1500 | + 0xC0,0x30, // ':' | |
| 1501 | + 0x48,0x00,0x00,0x01,0x25,0x20, // ';' | |
| 1502 | + 0x02,0x08,0x63,0x08,0x0C,0x06,0x03,0x02, // '<' | |
| 1503 | + 0xFE,0x00,0x00,0x00,0x1F,0xC0, // '=' | |
| 1504 | + 0x80,0x80,0xC0,0x60,0x21,0x8C,0x60,0x80, // '>' | |
| 1505 | + 0x70,0x20,0x83,0x08,0x20,0x84,0x10,0x82,0x08,0x00,0x02,0x08, // '?' | |
| 1506 | + 0x0F,0x02,0x30,0x83,0x20,0x24,0x74,0x92,0x62,0x4C,0x99,0x93,0x32,0x46,0x48,0xC9,0x18,0xB4,0x9B,0x90,0x03,0x00,0x31,0x03,0xC0, // '@' | |
| 1507 | + 0x08,0x04,0x05,0x02,0x81,0x40,0xA0,0x88,0x44,0x22,0x1F,0x10,0x48,0x24,0x12,0x0A,0x03,0x01, // 'A' | |
| 1508 | + 0xF9,0x0A,0x0C,0x18,0x30,0xE1,0x7C,0x85,0x06,0x0C,0x18,0x30,0x61,0x7C, // 'B' | |
| 1509 | + 0x1E,0x41,0x02,0x04,0x10,0x20,0x40,0x81,0x02,0x02,0x04,0x0C,0x08,0x0F, // 'C' | |
| 1510 | + 0xF8,0x8C,0x86,0x82,0x82,0x81,0x81,0x81,0x81,0x81,0x81,0x82,0x82,0x86,0x8C,0xF8, // 'D' | |
| 1511 | + 0xFC,0x21,0x08,0x42,0x1F,0x84,0x21,0x08,0x42,0x1F, // 'E' | |
| 1512 | + 0xFE,0x08,0x20,0x82,0x08,0x20,0xFA,0x08,0x20,0x82,0x08,0x20, // 'F' | |
| 1513 | + 0x0F,0x8C,0x26,0x01,0x00,0x40,0x30,0x08,0x02,0x00,0x83,0xE0,0x1C,0x05,0x01,0x40,0x58,0x13,0x04,0x3E, // 'G' | |
| 1514 | + 0x83,0x06,0x0C,0x18,0x30,0x60,0xFF,0x83,0x06,0x0C,0x18,0x30,0x60,0xC1, // 'H' | |
| 1515 | + 0xFF,0xFF, // 'I' | |
| 1516 | + 0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x32,0x2E, // 'J' | |
| 1517 | + 0x85,0x0A,0x24,0x49,0x16,0x28,0x70,0xE1,0x22,0x44,0x48,0x90,0xA1,0x41, // 'K' | |
| 1518 | + 0x82,0x08,0x20,0x82,0x08,0x20,0x82,0x08,0x20,0x82,0x08,0x3F, // 'L' | |
| 1519 | + 0x80,0x38,0x0F,0x01,0xE0,0x3A,0x0B,0x41,0x68,0x2D,0x05,0x91,0x32,0x26,0x44,0xC5,0x18,0xA3,0x14,0x62,0x8C,0x21, // 'M' | |
| 1520 | + 0x81,0xC1,0xC1,0xA1,0xA1,0xA1,0x91,0x91,0x89,0x89,0x85,0x85,0x87,0x83,0x83,0x81, // 'N' | |
| 1521 | + 0x1C,0x11,0x10,0x48,0x2C,0x1C,0x06,0x03,0x01,0x80,0xC0,0x60,0x38,0x34,0x12,0x08,0x88,0x38, // 'O' | |
| 1522 | + 0xF2,0x38,0x61,0x86,0x18,0x62,0xF2,0x08,0x20,0x82,0x08,0x20, // 'P' | |
| 1523 | + 0x1C,0x11,0x10,0x48,0x2C,0x1C,0x06,0x03,0x01,0x80,0xC0,0x60,0x38,0x34,0x12,0x08,0x88,0x38,0x04,0x01,0x00,0x80,0x20, // 'Q' | |
| 1524 | + 0xF1,0x12,0x14,0x28,0x50,0xA1,0x44,0xF1,0x22,0x44,0x48,0x91,0xA1,0x42, // 'R' | |
| 1525 | + 0x3E,0x82,0x04,0x08,0x10,0x10,0x18,0x0C,0x08,0x08,0x10,0x20,0x41,0x7C, // 'S' | |
| 1526 | + 0xFF,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, // 'T' | |
| 1527 | + 0x83,0x06,0x0C,0x18,0x30,0x60,0xC1,0x83,0x06,0x0C,0x18,0x30,0x51,0x9E, // 'U' | |
| 1528 | + 0x80,0xC0,0x50,0x48,0x24,0x12,0x08,0x88,0x44,0x22,0x11,0x05,0x02,0x81,0x40,0xA0,0x20,0x10, // 'V' | |
| 1529 | + 0x81,0x03,0x82,0x0D,0x0A,0x12,0x14,0x24,0x28,0x48,0x50,0x98,0xA3,0x12,0x24,0x24,0x48,0x48,0x90,0x91,0x20,0xA2,0x81,0x83,0x03,0x06,0x06,0x0C,0x0C,0x18, // 'W' | |
| 1530 | + 0x41,0x42,0x22,0x24,0x24,0x14,0x18,0x08,0x18,0x18,0x24,0x24,0x26,0x42,0x42,0x81, // 'X' | |
| 1531 | + 0x83,0x8D,0x12,0x24,0x45,0x0A,0x14,0x10,0x20,0x40,0x81,0x02,0x04,0x08, // 'Y' | |
| 1532 | + 0xF8,0x20,0x86,0x10,0x43,0x08,0x21,0x84,0x10,0xC2,0x08,0x3F, // 'Z' | |
| 1533 | + 0xF8,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0xF0, // '[' | |
| 1534 | + 0x81,0x01,0x02,0x04,0x04,0x08,0x10,0x10,0x20,0x60,0x40,0x80,0x81,0x02, // '\' | |
| 1535 | + 0xF1,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0xF0, // ']' | |
| 1536 | + 0x08,0x0A,0x05,0x04,0x82,0x21,0x11,0x04,0x82, // '^' | |
| 1537 | + 0xFF,0x80, // '_' | |
| 1538 | + 0x99,0x10, // '`' | |
| 1539 | + 0x78,0x20,0x81,0x04,0xFC,0x61,0x8E,0x38,0xDD, // 'a' | |
| 1540 | + 0x81,0x02,0x04,0x08,0x17,0x31,0x43,0x83,0x06,0x0C,0x18,0x30,0x61,0x62,0xB8, // 'b' | |
| 1541 | + 0x3D,0x04,0x20,0x82,0x08,0x20,0x81,0x04,0x0E, // 'c' | |
| 1542 | + 0x02,0x04,0x08,0x10,0x27,0x51,0xA1,0x83,0x06,0x0C,0x18,0x30,0x70,0xA3,0x3A, // 'd' | |
| 1543 | + 0x38,0x89,0x1C,0x18,0x3F,0xE0,0x40,0x80,0x81,0x89,0xE0, // 'e' | |
| 1544 | + 0x19,0x08,0x42,0x7C,0x84,0x21,0x08,0x42,0x10,0x84,0x20, // 'f' | |
| 1545 | + 0x3F,0x24,0x42,0x42,0x42,0x42,0x24,0x38,0x20,0x20,0x3E,0x43,0x41,0x81,0x81,0x42,0x3C, // 'g' | |
| 1546 | + 0x82,0x08,0x20,0x82,0xE4,0xA2,0x86,0x18,0x61,0x86,0x18,0x61,0x84, // 'h' | |
| 1547 | + 0xF0,0xFF,0xFF,0xFF, // 'i' | |
| 1548 | + 0x6C,0x06,0xDB,0x6D,0xB6,0xDB,0x6D,0x2C, // 'j' | |
| 1549 | + 0x82,0x08,0x20,0x82,0x28,0xA4,0xA2,0x8E,0x24,0x92,0x48,0xA2,0x84, // 'k' | |
| 1550 | + 0xFF,0xFF,0x80, // 'l' | |
| 1551 | + 0xF3,0xA3,0x18,0xC6,0x11,0x84,0x61,0x18,0x46,0x11,0x84,0x61,0x18,0x46,0x11, // 'm' | |
| 1552 | + 0x39,0x28,0xA1,0x86,0x18,0x61,0x86,0x18,0x61, // 'n' | |
| 1553 | + 0x38,0x8B,0x1C,0x18,0x30,0x60,0xC1,0x83,0x8D,0x11,0xC0, // 'o' | |
| 1554 | + 0xB9,0x8A,0x1C,0x18,0x30,0x60,0xC1,0x83,0x0B,0x15,0xC8,0x10,0x20,0x40,0x80, // 'p' | |
| 1555 | + 0x3A,0x8D,0x0C,0x18,0x30,0x60,0xC1,0x83,0x85,0x19,0xD0,0x20,0x40,0x81,0x02, // 'q' | |
| 1556 | + 0xBC,0x88,0x88,0x88,0x88,0x88, // 'r' | |
| 1557 | + 0x7C,0x21,0x08,0x30,0x41,0x08,0x43,0xE0, // 's' | |
| 1558 | + 0x21,0x09,0xF2,0x10,0x84,0x21,0x08,0x42,0x10,0xE0, // 't' | |
| 1559 | + 0x85,0x0A,0x14,0x28,0x50,0xA1,0x43,0x86,0x8D,0x29,0x90, // 'u' | |
| 1560 | + 0x83,0x05,0x12,0x24,0x48,0x8A,0x14,0x28,0x50,0xC0,0x80, // 'v' | |
| 1561 | + 0x86,0x14,0x62,0x46,0x24,0x62,0x4A,0x24,0x92,0x29,0x42,0x94,0x29,0x42,0x94,0x30,0xC1,0x08, // 'w' | |
| 1562 | + 0x44,0x88,0xA1,0x42,0x82,0x04,0x14,0x28,0x89,0x12,0x20, // 'x' | |
| 1563 | + 0x83,0x05,0x12,0x24,0x48,0x8A,0x14,0x28,0x50,0x40,0x81,0x02,0x08,0x10,0xC0, // 'y' | |
| 1564 | + 0xF1,0x12,0x22,0x44,0x48,0x8F, // 'z' | |
| 1565 | + 0x0C,0x43,0x08,0x20,0x82,0x08,0x23,0x02,0x08,0x20,0x82,0x08,0x10,0x40,0xC0, // '{' | |
| 1566 | + 0xFF,0xFF,0xFC, // '|' | |
| 1567 | + 0xC0,0x83,0x04,0x10,0x41,0x04,0x10,0x31,0x04,0x10,0x41,0x04,0x20,0x8C,0x00 // '}' | |
| 1568 | +}; | |
| 1569 | +const GFXglyph Open_Sans_Condensed_Light_22Glyphs[] PROGMEM = { | |
| 1570 | +// bitmapOffset, width, height, xAdvance, xOffset, yOffset | |
| 1571 | + { 0, 1, 1, 5, 0, 0 }, // ' ' | |
| 1572 | + { 1, 1, 16, 6, 2, -16 }, // '!' | |
| 1573 | + { 3, 5, 6, 8, 1, -16 }, // '"' | |
| 1574 | + { 7, 9, 16, 10, 0, -16 }, // '#' | |
| 1575 | + { 25, 7, 19, 10, 1, -17 }, // '$' | |
| 1576 | + { 42, 11, 16, 14, 1, -16 }, // '%' | |
| 1577 | + { 64, 8, 16, 10, 1, -16 }, // '&' | |
| 1578 | + { 80, 2, 6, 5, 1, -16 }, // ''' | |
| 1579 | + { 82, 4, 19, 7, 1, -16 }, // '(' | |
| 1580 | + { 92, 4, 19, 7, 1, -16 }, // ')' | |
| 1581 | + { 102, 6, 6, 9, 1, -17 }, // '*' | |
| 1582 | + { 107, 7, 11, 10, 1, -14 }, // '+' | |
| 1583 | + { 117, 3, 5, 6, 1, -2 }, // ',' | |
| 1584 | + { 119, 4, 1, 7, 1, -6 }, // '-' | |
| 1585 | + { 120, 1, 2, 6, 2, -2 }, // '.' | |
| 1586 | + { 121, 7, 16, 9, 1, -16 }, // '/' | |
| 1587 | + { 135, 7, 16, 10, 1, -16 }, // '0' | |
| 1588 | + { 149, 4, 16, 10, 2, -16 }, // '1' | |
| 1589 | + { 157, 7, 16, 10, 1, -16 }, // '2' | |
| 1590 | + { 171, 7, 16, 10, 1, -16 }, // '3' | |
| 1591 | + { 185, 9, 16, 10, 0, -16 }, // '4' | |
| 1592 | + { 203, 7, 16, 10, 1, -16 }, // '5' | |
| 1593 | + { 217, 7, 16, 10, 1, -16 }, // '6' | |
| 1594 | + { 231, 7, 16, 10, 1, -16 }, // '7' | |
| 1595 | + { 245, 7, 16, 10, 1, -16 }, // '8' | |
| 1596 | + { 259, 7, 16, 10, 1, -16 }, // '9' | |
| 1597 | + { 273, 1, 12, 6, 2, -12 }, // ':' | |
| 1598 | + { 275, 3, 15, 6, 1, -12 }, // ';' | |
| 1599 | + { 281, 7, 9, 10, 1, -13 }, // '<' | |
| 1600 | + { 289, 7, 6, 10, 1, -11 }, // '=' | |
| 1601 | + { 295, 7, 9, 10, 1, -13 }, // '>' | |
| 1602 | + { 303, 6, 16, 7, 0, -16 }, // '?' | |
| 1603 | + { 315, 11, 18, 14, 1, -16 }, // '@' | |
| 1604 | + { 340, 9, 16, 10, 0, -16 }, // 'A' | |
| 1605 | + { 358, 7, 16, 11, 2, -16 }, // 'B' | |
| 1606 | + { 372, 7, 16, 10, 1, -16 }, // 'C' | |
| 1607 | + { 386, 8, 16, 12, 2, -16 }, // 'D' | |
| 1608 | + { 402, 5, 16, 9, 2, -16 }, // 'E' | |
| 1609 | + { 412, 6, 16, 9, 2, -16 }, // 'F' | |
| 1610 | + { 424, 10, 16, 13, 1, -16 }, // 'G' | |
| 1611 | + { 444, 7, 16, 12, 2, -16 }, // 'H' | |
| 1612 | + { 458, 1, 16, 5, 2, -16 }, // 'I' | |
| 1613 | + { 460, 4, 20, 5, -1, -16 }, // 'J' | |
| 1614 | + { 470, 7, 16, 10, 2, -16 }, // 'K' | |
| 1615 | + { 484, 6, 16, 9, 2, -16 }, // 'L' | |
| 1616 | + { 496, 11, 16, 16, 2, -16 }, // 'M' | |
| 1617 | + { 518, 8, 16, 13, 2, -16 }, // 'N' | |
| 1618 | + { 534, 9, 16, 12, 1, -16 }, // 'O' | |
| 1619 | + { 552, 6, 16, 10, 2, -16 }, // 'P' | |
| 1620 | + { 564, 9, 20, 12, 1, -16 }, // 'Q' | |
| 1621 | + { 587, 7, 16, 10, 2, -16 }, // 'R' | |
| 1622 | + { 601, 7, 16, 10, 1, -16 }, // 'S' | |
| 1623 | + { 615, 8, 16, 9, 0, -16 }, // 'T' | |
| 1624 | + { 631, 7, 16, 12, 2, -16 }, // 'U' | |
| 1625 | + { 645, 9, 16, 10, 0, -16 }, // 'V' | |
| 1626 | + { 663, 15, 16, 16, 0, -16 }, // 'W' | |
| 1627 | + { 693, 8, 16, 9, 0, -16 }, // 'X' | |
| 1628 | + { 709, 7, 16, 8, 0, -16 }, // 'Y' | |
| 1629 | + { 723, 6, 16, 8, 1, -16 }, // 'Z' | |
| 1630 | + { 735, 4, 19, 8, 2, -16 }, // '[' | |
| 1631 | + { 745, 7, 16, 9, 1, -16 }, // '\' | |
| 1632 | + { 759, 4, 19, 8, 1, -16 }, // ']' | |
| 1633 | + { 769, 9, 8, 10, 0, -16 }, // '^' | |
| 1634 | + { 778, 9, 1, 10, 0, 2 }, // '_' | |
| 1635 | + { 780, 3, 4, 13, 5, -17 }, // '`' | |
| 1636 | + { 782, 6, 12, 9, 1, -12 }, // 'a' | |
| 1637 | + { 791, 7, 17, 11, 2, -17 }, // 'b' | |
| 1638 | + { 806, 6, 12, 8, 1, -12 }, // 'c' | |
| 1639 | + { 815, 7, 17, 11, 1, -17 }, // 'd' | |
| 1640 | + { 830, 7, 12, 10, 1, -12 }, // 'e' | |
| 1641 | + { 841, 5, 17, 6, 0, -17 }, // 'f' | |
| 1642 | + { 852, 8, 17, 9, 0, -12 }, // 'g' | |
| 1643 | + { 869, 6, 17, 10, 2, -17 }, // 'h' | |
| 1644 | + { 882, 2, 16, 5, 1, -16 }, // 'i' | |
| 1645 | + { 886, 3, 21, 5, 0, -16 }, // 'j' | |
| 1646 | + { 894, 6, 17, 9, 2, -17 }, // 'k' | |
| 1647 | + { 907, 1, 17, 5, 2, -17 }, // 'l' | |
| 1648 | + { 910, 10, 12, 15, 2, -12 }, // 'm' | |
| 1649 | + { 925, 6, 12, 10, 2, -12 }, // 'n' | |
| 1650 | + { 934, 7, 12, 10, 1, -12 }, // 'o' | |
| 1651 | + { 945, 7, 17, 11, 2, -12 }, // 'p' | |
| 1652 | + { 960, 7, 17, 11, 1, -12 }, // 'q' | |
| 1653 | + { 975, 4, 12, 7, 2, -12 }, // 'r' | |
| 1654 | + { 981, 5, 12, 8, 1, -12 }, // 's' | |
| 1655 | + { 989, 5, 15, 6, 0, -15 }, // 't' | |
| 1656 | + { 999, 7, 12, 10, 1, -12 }, // 'u' | |
| 1657 | + { 1010, 7, 12, 8, 0, -12 }, // 'v' | |
| 1658 | + { 1021, 12, 12, 13, 0, -12 }, // 'w' | |
| 1659 | + { 1039, 7, 12, 8, 0, -12 }, // 'x' | |
| 1660 | + { 1050, 7, 17, 8, 0, -12 }, // 'y' | |
| 1661 | + { 1065, 4, 12, 7, 1, -12 }, // 'z' | |
| 1662 | + { 1071, 6, 19, 9, 1, -16 }, // '{' | |
| 1663 | + { 1086, 1, 22, 10, 4, -17 }, // '|' | |
| 1664 | + { 1089, 6, 19, 9, 1, -16 } // '}' | |
| 1665 | +}; | |
| 1666 | +const GFXfont Open_Sans_Condensed_Light_22 PROGMEM = { | |
| 1667 | +(uint8_t *)Open_Sans_Condensed_Light_22Bitmaps,(GFXglyph *)Open_Sans_Condensed_Light_22Glyphs,0x20, 0x7E, 31}; | |
| 1668 | + | |
| 1669 | +// Created by http://oleddisplay.squix.ch/ Consider a donation | |
| 1670 | +// In case of problems make sure that you are using the font file with the correct version! | |
| 1671 | +const uint8_t Roboto_Condensed_19Bitmaps[] PROGMEM = { | |
| 1672 | + | |
| 1673 | + // Bitmap Data: | |
| 1674 | + 0x00, // ' ' | |
| 1675 | + 0xFF,0xCC, // '!' | |
| 1676 | + 0xDD,0x99, // '"' | |
| 1677 | + 0x09,0x0D,0x84,0xCF,0xF1,0x20,0x90,0xC8,0x6C,0xFF,0x12,0x09,0x04,0x82,0x43,0x20, // '#' | |
| 1678 | + 0x10,0x20,0xF3,0x2C,0x78,0xF0,0x20,0x70,0x38,0x18,0x38,0x38,0xF1,0xBE,0x10,0x20, // '$' | |
| 1679 | + 0x70,0x26,0x08,0x92,0x24,0x9A,0x1D,0x80,0x40,0x30,0x0B,0x86,0x91,0x64,0xD9,0x22,0x40,0xE0, // '%' | |
| 1680 | + 0x38,0x32,0x11,0x08,0x86,0xC3,0xC0,0xC0,0xF0,0xD9,0x66,0xA1,0xD8,0xCC,0x71,0xCC, // '&' | |
| 1681 | + 0xF0, // ''' | |
| 1682 | + 0x11,0x26,0x64,0x4C,0xCC,0xCC,0x44,0x66,0x21,0x10, // '(' | |
| 1683 | + 0x82,0x08,0x43,0x08,0x43,0x18,0xC6,0x31,0x08,0xC6,0x22,0x20, // ')' | |
| 1684 | + 0x18,0x18,0x99,0xFF,0x18,0x3C,0x26,0x64, // '*' | |
| 1685 | + 0x18,0x18,0x18,0x18,0xFF,0x18,0x18,0x18,0x18, // '+' | |
| 1686 | + 0x6D,0xAC, // ',' | |
| 1687 | + 0xF0, // '-' | |
| 1688 | + 0xF0, // '.' | |
| 1689 | + 0x04,0x10,0xC2,0x08,0x61,0x04,0x30,0x82,0x18,0x41,0x0C,0x00, // '/' | |
| 1690 | + 0x3C,0xCB,0x1E,0x1C,0x38,0x70,0xE1,0xC3,0x87,0x0A,0x36,0x47,0x80, // '0' | |
| 1691 | + 0x09,0xF6,0x31,0x8C,0x63,0x18,0xC6,0x31,0x8C, // '1' | |
| 1692 | + 0x3C,0x46,0xC6,0xC6,0x06,0x06,0x04,0x0C,0x18,0x18,0x30,0x60,0x40,0xFF, // '2' | |
| 1693 | + 0x79,0x8B,0x18,0x30,0x61,0x8E,0x02,0x06,0x0C,0x1C,0x3C,0x4F,0x00, // '3' | |
| 1694 | + 0x06,0x03,0x03,0x83,0xC1,0x61,0xB0,0x98,0xCC,0x46,0x7F,0xC1,0x80,0xC0,0x60,0x30, // '4' | |
| 1695 | + 0x7E,0x60,0x60,0x60,0x40,0x7C,0x66,0x02,0x03,0x03,0xC3,0x42,0x66,0x3C, // '5' | |
| 1696 | + 0x1C,0x61,0x82,0x0C,0x1F,0xB9,0xE3,0xC3,0x87,0x0E,0x36,0x47,0x00, // '6' | |
| 1697 | + 0xFF,0x02,0x06,0x06,0x04,0x0C,0x0C,0x18,0x18,0x10,0x30,0x30,0x20,0x60, // '7' | |
| 1698 | + 0x38,0x8B,0x1E,0x3C,0x68,0x8E,0x22,0xC7,0x8F,0x1E,0x34,0x47,0x00, // '8' | |
| 1699 | + 0x38,0x9B,0x14,0x38,0x70,0xF1,0xE7,0x7E,0x0C,0x10,0x20,0x8E,0x00, // '9' | |
| 1700 | + 0xF0,0x00,0xF0, // ':' | |
| 1701 | + 0x6C,0x00,0x00,0x6D,0xAC, // ';' | |
| 1702 | + 0x04,0x77,0x30,0xC1,0xC1,0xC1, // '<' | |
| 1703 | + 0xFE,0x00,0x00,0x0F,0xE0, // '=' | |
| 1704 | + 0x81,0xC0,0xE0,0x70,0xE7,0x38,0x40, // '>' | |
| 1705 | + 0x7B,0x38,0x41,0x0C,0x31,0x8C,0x30,0xC0,0x00,0x30,0xC0, // '?' | |
| 1706 | + 0x07,0x80,0xC3,0x0C,0x0C,0x40,0x24,0x39,0x22,0x45,0x32,0x39,0x11,0xC8,0x8E,0x44,0x72,0x27,0x93,0x24,0xEE,0x20,0x00,0x80,0x06,0x10,0x0F,0x80, // '@' | |
| 1707 | + 0x04,0x01,0xC0,0x28,0x05,0x01,0xB0,0x36,0x04,0x41,0x8C,0x31,0x87,0xF0,0x83,0x30,0x66,0x0D,0x80,0xC0, // 'A' | |
| 1708 | + 0xFE,0xC3,0xC3,0xC3,0xC3,0xC2,0xFC,0xC3,0xC3,0xC1,0xC1,0xC3,0xC3,0xFE, // 'B' | |
| 1709 | + 0x1E,0x11,0x98,0x68,0x3C,0x06,0x03,0x01,0x80,0xC0,0x60,0x10,0x6C,0x32,0x30,0xF0, // 'C' | |
| 1710 | + 0xF8,0x84,0x86,0x82,0x83,0x83,0x83,0x83,0x83,0x83,0x82,0x86,0x84,0xF8, // 'D' | |
| 1711 | + 0xFF,0xC0,0xC0,0xC0,0xC0,0xC0,0xFE,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xFF, // 'E' | |
| 1712 | + 0xFF,0x83,0x06,0x0C,0x18,0x3F,0xE0,0xC1,0x83,0x06,0x0C,0x18,0x00, // 'F' | |
| 1713 | + 0x3E,0x31,0x90,0x78,0x3C,0x06,0x03,0x01,0x8F,0xC1,0xE0,0xF0,0x68,0x36,0x30,0xF0, // 'G' | |
| 1714 | + 0x81,0x81,0x81,0x81,0x81,0x81,0xFF,0x81,0x81,0x81,0x81,0x81,0x81,0x81, // 'H' | |
| 1715 | + 0xFF,0xFC, // 'I' | |
| 1716 | + 0x06,0x0C,0x18,0x30,0x60,0xC1,0x83,0x06,0x0E,0x1C,0x3C,0xCF,0x00, // 'J' | |
| 1717 | + 0xC3,0xE1,0xB1,0x99,0x8C,0xC6,0xC3,0xE1,0xF0,0xEC,0x66,0x31,0x98,0x6C,0x36,0x0C, // 'K' | |
| 1718 | + 0xC1,0x83,0x06,0x0C,0x18,0x30,0x60,0xC1,0x83,0x06,0x0C,0x1F,0xC0, // 'L' | |
| 1719 | + 0xE0,0x3E,0x07,0xE0,0x7F,0x07,0xF0,0xFD,0x0F,0xD8,0xBD,0x9B,0xC9,0xBC,0xD3,0xCF,0x3C,0x73,0xC6,0x3C,0x63, // 'M' | |
| 1720 | + 0xC1,0xC1,0xE1,0xE1,0xB1,0xB1,0x99,0x99,0x8D,0x8D,0x87,0x87,0x83,0x83, // 'N' | |
| 1721 | + 0x3E,0x31,0x90,0x58,0x3C,0x1E,0x0F,0x07,0x83,0xC1,0xE0,0xF0,0x68,0x26,0x31,0xF0, // 'O' | |
| 1722 | + 0xFC,0x86,0x83,0x83,0x83,0x83,0x86,0xFC,0x80,0x80,0x80,0x80,0x80,0x80, // 'P' | |
| 1723 | + 0x3E,0x31,0xB0,0x58,0x3C,0x1E,0x0F,0x07,0x83,0xC1,0xE0,0xF0,0x78,0x26,0x31,0xF8,0x0E,0x03, // 'Q' | |
| 1724 | + 0xFC,0x61,0xB0,0xD8,0x6C,0x36,0x1B,0x09,0xF8,0xC4,0x63,0x31,0x98,0x6C,0x36,0x0C, // 'R' | |
| 1725 | + 0x3C,0x63,0xC3,0xC3,0xC0,0x60,0x38,0x1E,0x07,0x03,0xC3,0xC3,0xC3,0x3C, // 'S' | |
| 1726 | + 0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 'T' | |
| 1727 | + 0xC1,0xE0,0xF0,0x78,0x3C,0x1E,0x0F,0x07,0x83,0xC1,0xE0,0xF0,0x68,0x26,0x31,0xF0, // 'U' | |
| 1728 | + 0xC1,0xE0,0xF0,0x68,0x26,0x33,0x18,0x8C,0x44,0x36,0x1B,0x05,0x03,0x81,0xC0,0x40, // 'V' | |
| 1729 | + 0x82,0x1E,0x30,0xF1,0xC5,0x8E,0x24,0x51,0x26,0x99,0x34,0xCD,0x36,0x68,0xA3,0x45,0x0E,0x28,0x61,0xC3,0x0E,0x18,0x20, // 'W' | |
| 1730 | + 0xC1,0xE1,0x98,0xCC,0xC3,0x60,0xE0,0x60,0x38,0x3C,0x1B,0x19,0x8C,0x6C,0x36,0x0C, // 'X' | |
| 1731 | + 0xC0,0xD8,0x66,0x18,0xCC,0x33,0x04,0x81,0xE0,0x30,0x0C,0x03,0x00,0xC0,0x30,0x0C,0x03,0x00, // 'Y' | |
| 1732 | + 0xFF,0x03,0x06,0x06,0x0C,0x0C,0x18,0x18,0x30,0x30,0x60,0x40,0xC0,0xFF, // 'Z' | |
| 1733 | + 0xFB,0x6D,0xB6,0xDB,0x6D,0xB6,0xDC, // '[' | |
| 1734 | + 0xC0,0x81,0x81,0x02,0x06,0x04,0x08,0x18,0x30,0x20,0x60,0xC0,0x81,0x80, // '\' | |
| 1735 | + 0xE4,0x92,0x49,0x24,0x92,0x49,0x3C, // ']' | |
| 1736 | + 0x23,0x94,0xAD,0xEE,0x20, // '^' | |
| 1737 | + 0xFE, // '_' | |
| 1738 | + 0xCC,0x80, // '`' | |
| 1739 | + 0x3C,0x8B,0x18,0x33,0xF8,0xF1,0xE3,0xCE,0xEC, // 'a' | |
| 1740 | + 0xC1,0x83,0x06,0x0F,0xD8,0xF1,0xE1,0xC3,0x87,0x0E,0x3C,0x7F,0x80, // 'b' | |
| 1741 | + 0x3C,0x8F,0x0E,0x1C,0x18,0x30,0x61,0x46,0x78, // 'c' | |
| 1742 | + 0x06,0x0C,0x18,0x37,0xF8,0xF1,0xC3,0x87,0x0E,0x1E,0x3C,0x6F,0xC0, // 'd' | |
| 1743 | + 0x3C,0x8F,0x1E,0x1F,0xF8,0x30,0x60,0x66,0x78, // 'e' | |
| 1744 | + 0x3B,0x18,0xCF,0x31,0x8C,0x63,0x18,0xC6,0x30, // 'f' | |
| 1745 | + 0x7F,0x8F,0x1C,0x38,0x70,0xE1,0xE3,0xC6,0xFC,0x1C,0x3C,0x4F,0x00, // 'g' | |
| 1746 | + 0xC1,0x83,0x06,0x0F,0xD8,0xF1,0xE3,0xC7,0x8F,0x1E,0x3C,0x78,0xC0, // 'h' | |
| 1747 | + 0xF0,0xFF,0xFF,0xF0, // 'i' | |
| 1748 | + 0x6C,0x06,0xDB,0x6D,0xB6,0xDB,0x78, // 'j' | |
| 1749 | + 0xC0,0xC0,0xC0,0xC0,0xC6,0xCC,0xD8,0xD8,0xF0,0xF8,0xC8,0xCC,0xC6,0xC7, // 'k' | |
| 1750 | + 0xFF,0xFF,0xFF,0xF0, // 'l' | |
| 1751 | + 0xFD,0xEC,0x63,0xC6,0x3C,0x63,0xC6,0x3C,0x63,0xC6,0x3C,0x63,0xC6,0x3C,0x63, // 'm' | |
| 1752 | + 0xDD,0xCF,0x1E,0x3C,0x78,0xF1,0xE3,0xC7,0x8C, // 'n' | |
| 1753 | + 0x3C,0x66,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0x66,0x3C, // 'o' | |
| 1754 | + 0xFD,0x8F,0x1E,0x1C,0x38,0x70,0xE3,0xC7,0xFB,0x06,0x0C,0x18,0x00, // 'p' | |
| 1755 | + 0x3A,0xCF,0x0E,0x1C,0x38,0x70,0xE1,0x66,0x74,0x08,0x10,0x20,0x40, // 'q' | |
| 1756 | + 0xFE,0xCC,0xCC,0xCC,0xCC, // 'r' | |
| 1757 | + 0x3C,0x8B,0x1A,0x07,0x03,0x81,0xE3,0x46,0x78, // 's' | |
| 1758 | + 0x31,0xBE,0x63,0x18,0xC6,0x31,0x8C,0x30, // 't' | |
| 1759 | + 0xC7,0x8F,0x1E,0x3C,0x78,0xF1,0xE3,0xC6,0xFC, // 'u' | |
| 1760 | + 0xC3,0x42,0x66,0x66,0x24,0x24,0x3C,0x18,0x18,0x18, // 'v' | |
| 1761 | + 0xC6,0x34,0x62,0x46,0x26,0xF6,0x6F,0x62,0x94,0x29,0x43,0x9C,0x30,0xC1,0x08, // 'w' | |
| 1762 | + 0x63,0x66,0x34,0x3C,0x18,0x18,0x3C,0x34,0x66,0xE3, // 'x' | |
| 1763 | + 0xC3,0x66,0x66,0x66,0x24,0x3C,0x3C,0x18,0x18,0x18,0x18,0x10,0x30,0x60, // 'y' | |
| 1764 | + 0xFC,0x18,0x20,0xC3,0x06,0x18,0x30,0xC1,0xFC, // 'z' | |
| 1765 | + 0x11,0xC8,0xC6,0x31,0x8C,0xC3,0x18,0xC6,0x31,0x84,0x30,0xC0, // '{' | |
| 1766 | + 0xFF,0xFF,0x80, // '|' | |
| 1767 | + 0x47,0x08,0x63,0x18,0xC6,0x19,0x8C,0x63,0x18,0xC4,0x66,0x00 // '}' | |
| 1768 | +}; | |
| 1769 | +const GFXglyph Roboto_Condensed_19Glyphs[] PROGMEM = { | |
| 1770 | +// bitmapOffset, width, height, xAdvance, xOffset, yOffset | |
| 1771 | + { 0, 1, 1, 5, 0, 0 }, // ' ' | |
| 1772 | + { 1, 1, 14, 6, 2, -14 }, // '!' | |
| 1773 | + { 3, 4, 4, 7, 1, -14 }, // '"' | |
| 1774 | + { 5, 9, 14, 11, 1, -14 }, // '#' | |
| 1775 | + { 21, 7, 18, 10, 1, -16 }, // '$' | |
| 1776 | + { 37, 10, 14, 13, 1, -14 }, // '%' | |
| 1777 | + { 55, 9, 14, 11, 1, -14 }, // '&' | |
| 1778 | + { 71, 1, 4, 4, 1, -14 }, // ''' | |
| 1779 | + { 72, 4, 19, 7, 1, -15 }, // '(' | |
| 1780 | + { 82, 5, 19, 7, 0, -15 }, // ')' | |
| 1781 | + { 94, 8, 8, 9, 0, -14 }, // '*' | |
| 1782 | + { 102, 8, 9, 10, 1, -11 }, // '+' | |
| 1783 | + { 111, 3, 5, 5, 0, -2 }, // ',' | |
| 1784 | + { 113, 4, 1, 6, 0, -6 }, // '-' | |
| 1785 | + { 114, 2, 2, 6, 1, -2 }, // '.' | |
| 1786 | + { 115, 6, 15, 8, 0, -14 }, // '/' | |
| 1787 | + { 127, 7, 14, 10, 1, -14 }, // '0' | |
| 1788 | + { 140, 5, 14, 10, 1, -14 }, // '1' | |
| 1789 | + { 149, 8, 14, 10, 1, -14 }, // '2' | |
| 1790 | + { 163, 7, 14, 10, 1, -14 }, // '3' | |
| 1791 | + { 176, 9, 14, 10, 0, -14 }, // '4' | |
| 1792 | + { 192, 8, 14, 10, 1, -14 }, // '5' | |
| 1793 | + { 206, 7, 14, 10, 1, -14 }, // '6' | |
| 1794 | + { 219, 8, 14, 10, 1, -14 }, // '7' | |
| 1795 | + { 233, 7, 14, 10, 1, -14 }, // '8' | |
| 1796 | + { 246, 7, 14, 10, 1, -14 }, // '9' | |
| 1797 | + { 259, 2, 10, 5, 1, -10 }, // ':' | |
| 1798 | + { 262, 3, 13, 5, 0, -10 }, // ';' | |
| 1799 | + { 267, 6, 8, 9, 1, -10 }, // '<' | |
| 1800 | + { 273, 7, 5, 10, 1, -9 }, // '=' | |
| 1801 | + { 278, 7, 8, 10, 1, -10 }, // '>' | |
| 1802 | + { 285, 6, 14, 9, 1, -14 }, // '?' | |
| 1803 | + { 296, 13, 17, 16, 1, -13 }, // '@' | |
| 1804 | + { 324, 11, 14, 12, 0, -14 }, // 'A' | |
| 1805 | + { 344, 8, 14, 11, 1, -14 }, // 'B' | |
| 1806 | + { 358, 9, 14, 12, 1, -14 }, // 'C' | |
| 1807 | + { 374, 8, 14, 12, 2, -14 }, // 'D' | |
| 1808 | + { 388, 8, 14, 10, 1, -14 }, // 'E' | |
| 1809 | + { 402, 7, 14, 10, 1, -14 }, // 'F' | |
| 1810 | + { 415, 9, 14, 12, 1, -14 }, // 'G' | |
| 1811 | + { 431, 8, 14, 13, 2, -14 }, // 'H' | |
| 1812 | + { 445, 1, 14, 6, 2, -14 }, // 'I' | |
| 1813 | + { 447, 7, 14, 10, 1, -14 }, // 'J' | |
| 1814 | + { 460, 9, 14, 11, 1, -14 }, // 'K' | |
| 1815 | + { 476, 7, 14, 10, 1, -14 }, // 'L' | |
| 1816 | + { 489, 12, 14, 15, 1, -14 }, // 'M' | |
| 1817 | + { 510, 8, 14, 13, 2, -14 }, // 'N' | |
| 1818 | + { 524, 9, 14, 12, 1, -14 }, // 'O' | |
| 1819 | + { 540, 8, 14, 12, 2, -14 }, // 'P' | |
| 1820 | + { 554, 9, 16, 12, 1, -14 }, // 'Q' | |
| 1821 | + { 572, 9, 14, 11, 1, -14 }, // 'R' | |
| 1822 | + { 588, 8, 14, 11, 1, -14 }, // 'S' | |
| 1823 | + { 602, 8, 14, 11, 1, -14 }, // 'T' | |
| 1824 | + { 616, 9, 14, 12, 1, -14 }, // 'U' | |
| 1825 | + { 632, 9, 14, 12, 1, -14 }, // 'V' | |
| 1826 | + { 648, 13, 14, 15, 1, -14 }, // 'W' | |
| 1827 | + { 671, 9, 14, 11, 1, -14 }, // 'X' | |
| 1828 | + { 687, 10, 14, 11, 0, -14 }, // 'Y' | |
| 1829 | + { 705, 8, 14, 11, 1, -14 }, // 'Z' | |
| 1830 | + { 719, 3, 18, 6, 1, -15 }, // '[' | |
| 1831 | + { 726, 7, 15, 8, 0, -14 }, // '\' | |
| 1832 | + { 740, 3, 18, 6, 0, -15 }, // ']' | |
| 1833 | + { 747, 5, 7, 8, 1, -14 }, // '^' | |
| 1834 | + { 752, 7, 1, 9, 0, 0 }, // '_' | |
| 1835 | + { 753, 3, 3, 7, 1, -15 }, // '`' | |
| 1836 | + { 755, 7, 10, 10, 1, -10 }, // 'a' | |
| 1837 | + { 764, 7, 14, 10, 1, -14 }, // 'b' | |
| 1838 | + { 777, 7, 10, 10, 1, -10 }, // 'c' | |
| 1839 | + { 786, 7, 14, 10, 1, -14 }, // 'd' | |
| 1840 | + { 799, 7, 10, 10, 1, -10 }, // 'e' | |
| 1841 | + { 808, 5, 14, 7, 1, -14 }, // 'f' | |
| 1842 | + { 817, 7, 14, 10, 1, -10 }, // 'g' | |
| 1843 | + { 830, 7, 14, 10, 1, -14 }, // 'h' | |
| 1844 | + { 843, 2, 14, 5, 1, -14 }, // 'i' | |
| 1845 | + { 847, 3, 18, 5, 0, -14 }, // 'j' | |
| 1846 | + { 854, 8, 14, 10, 1, -14 }, // 'k' | |
| 1847 | + { 868, 2, 14, 5, 1, -14 }, // 'l' | |
| 1848 | + { 872, 12, 10, 15, 1, -10 }, // 'm' | |
| 1849 | + { 887, 7, 10, 10, 1, -10 }, // 'n' | |
| 1850 | + { 896, 8, 10, 11, 1, -10 }, // 'o' | |
| 1851 | + { 906, 7, 14, 10, 1, -10 }, // 'p' | |
| 1852 | + { 919, 7, 14, 11, 1, -10 }, // 'q' | |
| 1853 | + { 932, 4, 10, 7, 1, -10 }, // 'r' | |
| 1854 | + { 937, 7, 10, 10, 1, -10 }, // 's' | |
| 1855 | + { 946, 5, 12, 7, 0, -12 }, // 't' | |
| 1856 | + { 954, 7, 10, 10, 1, -10 }, // 'u' | |
| 1857 | + { 963, 8, 10, 9, 0, -10 }, // 'v' | |
| 1858 | + { 973, 12, 10, 13, 0, -10 }, // 'w' | |
| 1859 | + { 988, 8, 10, 9, 0, -10 }, // 'x' | |
| 1860 | + { 998, 8, 14, 9, 0, -10 }, // 'y' | |
| 1861 | + { 1012, 7, 10, 9, 1, -10 }, // 'z' | |
| 1862 | + { 1021, 5, 18, 7, 1, -15 }, // '{' | |
| 1863 | + { 1033, 1, 17, 6, 2, -14 }, // '|' | |
| 1864 | + { 1036, 5, 18, 7, 0, -15 } // '}' | |
| 1865 | +}; | |
| 1866 | +const GFXfont Roboto_Condensed_19 PROGMEM = { | |
| 1867 | +(uint8_t *)Roboto_Condensed_19Bitmaps,(GFXglyph *)Roboto_Condensed_19Glyphs,0x20, 0x7E, 23}; | |
| 1868 | + | |
| 1869 | + | |
| 1870 | +// Created by http://oleddisplay.squix.ch/ Consider a donation | |
| 1871 | +// In case of problems make sure that you are using the font file with the correct version! | |
| 1872 | +const uint8_t URW_Palladio_L_Roman_18Bitmaps[] PROGMEM = { | |
| 1873 | + | |
| 1874 | + // Bitmap Data: | |
| 1875 | + 0x00, // ' ' | |
| 1876 | + 0x7F,0x55,0x0F, // '!' | |
| 1877 | + 0x9C,0xA5,0x20, // '"' | |
| 1878 | + 0x13,0x09,0x04,0x82,0x47,0xF9,0x10,0x89,0xFE,0x24,0x12,0x09,0x08,0x80, // '#' | |
| 1879 | + 0x10,0xFA,0x54,0x89,0x1A,0x1F,0x0F,0x12,0x26,0x4C,0xA7,0x82,0x04,0x00, // '$' | |
| 1880 | + 0x70,0x44,0x44,0x22,0x21,0x12,0x08,0x90,0x39,0x00,0x09,0xC0,0x99,0x04,0x88,0x44,0x42,0x22,0x21,0x31,0x07,0x00, // '%' | |
| 1881 | + 0x1C,0x02,0x40,0x24,0x02,0x80,0x28,0x03,0x3F,0x50,0x89,0x88,0x8C,0x88,0x70,0xC3,0x07,0xCE, // '&' | |
| 1882 | + 0xEA, // ''' | |
| 1883 | + 0x12,0x44,0x88,0x88,0x88,0x88,0x44,0x42,0x10, // '(' | |
| 1884 | + 0x84,0x22,0x21,0x11,0x11,0x11,0x22,0x44,0x80, // ')' | |
| 1885 | + 0x04,0xB8,0x7E,0xD0,0x40, // '*' | |
| 1886 | + 0x08,0x04,0x02,0x01,0x0F,0xF8,0x40,0x20,0x10,0x08,0x00, // '+' | |
| 1887 | + 0x32,0x64,0x80, // ',' | |
| 1888 | + 0x78, // '-' | |
| 1889 | + 0xF0, // '.' | |
| 1890 | + 0x02,0x08,0x10,0x20,0x81,0x04,0x08,0x20,0x40,0x82,0x04,0x10,0x20,0x00, // '/' | |
| 1891 | + 0x38,0x8A,0x1C,0x18,0x30,0x60,0xC1,0x83,0x07,0x12,0x23,0x80, // '0' | |
| 1892 | + 0x13,0xC1,0x04,0x10,0x41,0x04,0x10,0x41,0x1F, // '1' | |
| 1893 | + 0x3C,0x46,0x82,0x02,0x02,0x04,0x04,0x08,0x10,0x20,0x43,0xFF, // '2' | |
| 1894 | + 0x3C,0x8D,0x08,0x10,0x43,0x81,0x81,0x03,0x05,0x13,0xC0, // '3' | |
| 1895 | + 0x04,0x0C,0x1C,0x14,0x24,0x24,0x44,0x44,0xFF,0x04,0x04,0x1F, // '4' | |
| 1896 | + 0x7E,0x81,0x02,0x0B,0xC8,0xC0,0x81,0x03,0x0A,0x13,0xC0, // '5' | |
| 1897 | + 0x04,0x30,0x82,0x04,0x17,0xB1,0xC1,0x83,0x05,0x11,0xC0, // '6' | |
| 1898 | + 0xFF,0x82,0x86,0x04,0x08,0x08,0x10,0x10,0x20,0x60,0x40,0xC0, // '7' | |
| 1899 | + 0x3C,0x8E,0x0C,0x1C,0x4F,0x0F,0x23,0x83,0x06,0x0E,0x27,0x80, // '8' | |
| 1900 | + 0x3C,0x42,0x81,0x81,0x81,0x81,0x43,0x3D,0x02,0x02,0x04,0x08,0x70, // '9' | |
| 1901 | + 0xF0,0x0F, // ':' | |
| 1902 | + 0x50,0x05,0xA8, // ';' | |
| 1903 | + 0x01,0x83,0x06,0x0C,0x0C,0x01,0x80,0x30,0x06,0x00,0x80, // '<' | |
| 1904 | + 0xFF,0x80,0x00,0x00,0x0F,0xF8, // '=' | |
| 1905 | + 0xC0,0x18,0x03,0x00,0x60,0x18,0x30,0x60,0xC0,0x80,0x00, // '>' | |
| 1906 | + 0x7A,0x30,0x41,0x08,0x43,0x08,0x00,0x02,0x08, // '?' | |
| 1907 | + 0x0F,0xC1,0x83,0x18,0x04,0x85,0x98,0xDC,0xCC,0x46,0x46,0x32,0x32,0x53,0xB3,0x66,0xCC,0x0C,0x1F,0x80, // '@' | |
| 1908 | + 0x02,0x00,0x18,0x01,0x40,0x0B,0x00,0x88,0x04,0x60,0x43,0x03,0xFC,0x10,0x61,0x01,0x88,0x0D,0xE0,0xF0, // 'A' | |
| 1909 | + 0xFE,0x11,0x88,0x44,0x22,0x21,0xF0,0x86,0x41,0x20,0x90,0x48,0x4F,0xC0, // 'B' | |
| 1910 | + 0x0F,0x86,0x09,0x01,0x20,0x08,0x01,0x00,0x20,0x04,0x00,0xC0,0x08,0x00,0xC1,0x07,0xC0, // 'C' | |
| 1911 | + 0xFF,0x82,0x06,0x20,0x22,0x01,0x20,0x12,0x01,0x20,0x12,0x01,0x20,0x22,0x02,0x20,0xC7,0xF0, // 'D' | |
| 1912 | + 0xFF,0x90,0x48,0x24,0x02,0x11,0xF8,0x84,0x42,0x20,0x10,0x48,0x3F,0xF0, // 'E' | |
| 1913 | + 0xFF,0x90,0x88,0x04,0x02,0x11,0xF8,0x84,0x42,0x20,0x10,0x08,0x1F,0x00, // 'F' | |
| 1914 | + 0x0F,0xE1,0x80,0x90,0x00,0x80,0x08,0x00,0x40,0x02,0x00,0x10,0x1F,0xC0,0x13,0x00,0x8E,0x04,0x1F,0xC0, // 'G' | |
| 1915 | + 0x70,0x38,0x80,0x42,0x01,0x08,0x04,0x20,0x10,0xFF,0xC2,0x01,0x08,0x04,0x20,0x10,0x80,0x42,0x01,0x3E,0x1F, // 'H' | |
| 1916 | + 0xF9,0x08,0x42,0x10,0x84,0x21,0x09,0xF0, // 'I' | |
| 1917 | + 0xF9,0x08,0x42,0x10,0x84,0x21,0x08,0x42,0x11,0x10, // 'J' | |
| 1918 | + 0xF8,0xE2,0x08,0x21,0x02,0x20,0x24,0x03,0x80,0x2C,0x02,0x60,0x23,0x02,0x18,0x20,0xEF,0x87, // 'K' | |
| 1919 | + 0xF8,0x08,0x02,0x00,0x80,0x20,0x08,0x02,0x00,0x80,0x20,0x08,0x22,0x09,0xFE, // 'L' | |
| 1920 | + 0xF0,0x07,0x38,0x0C,0x38,0x0C,0x2C,0x14,0x2C,0x14,0x26,0x24,0x26,0x24,0x23,0x44,0x23,0x44,0x21,0x84,0x21,0x84,0xF9,0x0F, // 'M' | |
| 1921 | + 0xF0,0x3E,0x70,0x10,0xF0,0x21,0x70,0x42,0x60,0x84,0x61,0x08,0x62,0x10,0x64,0x20,0x68,0x40,0xF0,0x80,0xE7,0xC0,0xC0, // 'N' | |
| 1922 | + 0x0F,0xC1,0x83,0x10,0x05,0x00,0x38,0x00,0xC0,0x06,0x00,0x30,0x01,0xC0,0x13,0x00,0x8C,0x18,0x1F,0x00, // 'O' | |
| 1923 | + 0xFF,0x88,0x32,0x04,0x81,0x20,0x8B,0xC2,0x00,0x80,0x20,0x08,0x02,0x03,0xE0, // 'P' | |
| 1924 | + 0x0F,0xC1,0x83,0x10,0x05,0x00,0x38,0x00,0xC0,0x06,0x00,0x30,0x01,0xC0,0x12,0x00,0x8C,0x08,0x3F,0x80,0x70,0x04,0xFC,0x00,0xC0, // 'Q' | |
| 1925 | + 0xFF,0x04,0x30,0x82,0x10,0x42,0x10,0x4C,0x0B,0x81,0x30,0x23,0x04,0x30,0x87,0x7C,0x70, // 'R' | |
| 1926 | + 0x3E,0x42,0x82,0x80,0x80,0x78,0x06,0x01,0x01,0x81,0x82,0x7C, // 'S' | |
| 1927 | + 0xFF,0xC4,0x42,0x01,0x00,0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x07,0xC0, // 'T' | |
| 1928 | + 0xF8,0x7C,0x80,0x42,0x01,0x08,0x04,0x20,0x10,0x80,0x42,0x01,0x08,0x04,0x20,0x10,0x80,0x41,0x06,0x03,0xF0, // 'U' | |
| 1929 | + 0xF8,0x76,0x02,0x30,0x23,0x04,0x18,0x41,0x84,0x08,0x80,0xC8,0x05,0x00,0x70,0x06,0x00,0x20, // 'V' | |
| 1930 | + 0xF8,0x43,0xB0,0x60,0x88,0x30,0x46,0x2C,0x23,0x16,0x21,0x89,0x10,0x48,0xC8,0x34,0x68,0x1C,0x14,0x0E,0x0E,0x02,0x02,0x01,0x01,0x00, // 'W' | |
| 1931 | + 0x70,0x66,0x08,0x62,0x0C,0x80,0xD0,0x0C,0x01,0x80,0x58,0x11,0x82,0x30,0x83,0x20,0x30, // 'X' | |
| 1932 | + 0xE0,0x44,0x18,0xC2,0x08,0x80,0xA0,0x14,0x01,0x00,0x20,0x04,0x00,0x80,0x10,0x0F,0x80, // 'Y' | |
| 1933 | + 0x7F,0xE8,0x19,0x03,0x00,0xC0,0x30,0x0C,0x03,0x00,0x60,0x18,0x06,0x05,0x80,0xFF,0xF0, // 'Z' | |
| 1934 | + 0xF2,0x49,0x24,0x92,0x49,0x27, // '[' | |
| 1935 | + 0x40,0x40,0x20,0x20,0x10,0x10,0x08,0x08,0x04,0x04,0x02,0x02,0x01, // '\' | |
| 1936 | + 0xE4,0x92,0x49,0x24,0x92,0x4F, // ']' | |
| 1937 | + 0x18,0x0A,0x09,0x04,0x44,0x32,0x0A,0x06, // '^' | |
| 1938 | + 0xFF,0x80, // '_' | |
| 1939 | + 0x84,0x20, // '`' | |
| 1940 | + 0x39,0x98,0x10,0xE6,0x50,0xA3,0x3B, // 'a' | |
| 1941 | + 0x00,0xC0,0x40,0x40,0x40,0x5E,0x63,0x41,0x41,0x41,0x42,0x42,0x3C, // 'b' | |
| 1942 | + 0x1D,0x98,0x20,0x82,0x04,0x0F, // 'c' | |
| 1943 | + 0x00,0x06,0x02,0x02,0x02,0x1E,0x66,0x82,0x82,0x82,0x82,0x82,0x46,0x3B, // 'd' | |
| 1944 | + 0x1C,0x62,0x43,0x43,0xFF,0x40,0x40,0x61,0x3E, // 'e' | |
| 1945 | + 0x1B,0x10,0x84,0x79,0x08,0x42,0x10,0x8E,0x00, // 'f' | |
| 1946 | + 0x1C,0x33,0xD0,0x88,0x46,0x41,0xC1,0x00,0x80,0x7F,0x20,0x60,0x30,0x1C,0x31,0xE0, // 'g' | |
| 1947 | + 0x00,0xC0,0x40,0x40,0x40,0x5C,0x66,0x42,0x42,0x42,0x42,0x42,0xE3, // 'h' | |
| 1948 | + 0x48,0x2C,0x92,0x49,0x70, // 'i' | |
| 1949 | + 0x22,0x03,0x51,0x11,0x11,0x11,0x11,0x12,0xC0, // 'j' | |
| 1950 | + 0xC0,0x40,0x40,0x40,0x43,0x44,0x48,0x50,0x70,0x58,0x4C,0x46,0xE3, // 'k' | |
| 1951 | + 0xC9,0x24,0x92,0x49,0x2E, // 'l' | |
| 1952 | + 0xDC,0xE3,0x38,0x90,0x84,0x84,0x24,0x21,0x21,0x09,0x08,0x5D,0xF3, // 'm' | |
| 1953 | + 0xDC,0x66,0x42,0x42,0x42,0x42,0x42,0xE3, // 'n' | |
| 1954 | + 0x38,0x8A,0x1C,0x18,0x30,0x70,0xA2,0x38, // 'o' | |
| 1955 | + 0xDC,0x62,0x41,0x41,0x41,0x42,0x62,0x7C,0x40,0x40,0x40,0x40,0xE0, // 'p' | |
| 1956 | + 0x1C,0x62,0x82,0x82,0x82,0x82,0x82,0x46,0x3A,0x02,0x02,0x02,0x02,0x0F, // 'q' | |
| 1957 | + 0x5E,0xD8,0x84,0x21,0x08,0xF0, // 'r' | |
| 1958 | + 0x7A,0x28,0x30,0x78,0x10,0x63,0xF0, // 's' | |
| 1959 | + 0x44,0x47,0xC4,0x44,0x44,0x70, // 't' | |
| 1960 | + 0x42,0xC6,0x42,0x42,0x42,0x42,0x42,0x46,0x3B, // 'u' | |
| 1961 | + 0x71,0x88,0x43,0x20,0xC8,0x12,0x07,0x00,0xC0,0x20, // 'v' | |
| 1962 | + 0xF1,0x1D,0x84,0x22,0x38,0x88,0xE4,0x34,0x90,0x53,0x81,0x8E,0x06,0x18,0x18,0x40, // 'w' | |
| 1963 | + 0xE1,0x19,0x0D,0x03,0x00,0x80,0xE0,0x98,0xC6,0xC3,0x80, // 'x' | |
| 1964 | + 0xF3,0xD8,0x42,0x10,0xC8,0x12,0x07,0x01,0xC0,0x30,0x08,0x02,0x01,0x00,0x40,0x60,0x00, // 'y' | |
| 1965 | + 0x7F,0x42,0x04,0x0C,0x18,0x30,0x61,0xFF, // 'z' | |
| 1966 | + 0x49,0x24,0x92,0x89,0x24,0x92, // '{' | |
| 1967 | + 0xFF,0xF8, // '|' | |
| 1968 | + 0x89,0x24,0x92,0x29,0x24,0x92 // '}' | |
| 1969 | +}; | |
| 1970 | +const GFXglyph URW_Palladio_L_Roman_18Glyphs[] PROGMEM = { | |
| 1971 | +// bitmapOffset, width, height, xAdvance, xOffset, yOffset | |
| 1972 | + { 0, 1, 1, 6, 0, 0 }, // ' ' | |
| 1973 | + { 1, 2, 12, 6, 2, -12 }, // '!' | |
| 1974 | + { 4, 5, 4, 8, 1, -12 }, // '"' | |
| 1975 | + { 7, 9, 12, 10, 0, -12 }, // '#' | |
| 1976 | + { 21, 7, 15, 10, 1, -13 }, // '$' | |
| 1977 | + { 35, 13, 13, 16, 1, -13 }, // '%' | |
| 1978 | + { 57, 12, 12, 15, 1, -12 }, // '&' | |
| 1979 | + { 75, 2, 4, 5, 1, -12 }, // ''' | |
| 1980 | + { 76, 4, 17, 7, 1, -13 }, // '(' | |
| 1981 | + { 85, 4, 17, 7, 0, -13 }, // ')' | |
| 1982 | + { 94, 5, 7, 8, 1, -13 }, // '*' | |
| 1983 | + { 99, 9, 9, 12, 1, -9 }, // '+' | |
| 1984 | + { 110, 4, 5, 6, 0, -2 }, // ',' | |
| 1985 | + { 113, 6, 1, 7, 0, -5 }, // '-' | |
| 1986 | + { 114, 2, 2, 6, 1, -2 }, // '.' | |
| 1987 | + { 115, 7, 15, 12, 2, -13 }, // '/' | |
| 1988 | + { 129, 7, 13, 10, 1, -13 }, // '0' | |
| 1989 | + { 141, 6, 12, 10, 1, -12 }, // '1' | |
| 1990 | + { 150, 8, 12, 10, 0, -12 }, // '2' | |
| 1991 | + { 162, 7, 12, 10, 0, -12 }, // '3' | |
| 1992 | + { 173, 8, 12, 10, 0, -12 }, // '4' | |
| 1993 | + { 185, 7, 12, 10, 1, -12 }, // '5' | |
| 1994 | + { 196, 7, 12, 10, 1, -12 }, // '6' | |
| 1995 | + { 207, 8, 12, 10, 1, -12 }, // '7' | |
| 1996 | + { 219, 7, 13, 10, 1, -13 }, // '8' | |
| 1997 | + { 231, 8, 13, 10, 0, -13 }, // '9' | |
| 1998 | + { 244, 2, 8, 6, 1, -8 }, // ':' | |
| 1999 | + { 246, 2, 11, 6, 1, -8 }, // ';' | |
| 2000 | + { 249, 9, 9, 12, 1, -9 }, // '<' | |
| 2001 | + { 260, 9, 5, 12, 1, -7 }, // '=' | |
| 2002 | + { 266, 9, 9, 12, 1, -9 }, // '>' | |
| 2003 | + { 277, 6, 12, 9, 0, -12 }, // '?' | |
| 2004 | + { 286, 13, 12, 14, 0, -12 }, // '@' | |
| 2005 | + { 306, 13, 12, 15, 0, -12 }, // 'A' | |
| 2006 | + { 326, 9, 12, 12, 0, -12 }, // 'B' | |
| 2007 | + { 340, 11, 12, 14, 0, -12 }, // 'C' | |
| 2008 | + { 357, 12, 12, 15, 0, -12 }, // 'D' | |
| 2009 | + { 375, 9, 12, 12, 0, -12 }, // 'E' | |
| 2010 | + { 389, 9, 12, 11, 0, -12 }, // 'F' | |
| 2011 | + { 403, 13, 12, 15, 0, -12 }, // 'G' | |
| 2012 | + { 423, 14, 12, 16, 0, -12 }, // 'H' | |
| 2013 | + { 444, 5, 12, 7, 0, -12 }, // 'I' | |
| 2014 | + { 452, 5, 16, 7, 0, -12 }, // 'J' | |
| 2015 | + { 462, 12, 12, 14, 0, -12 }, // 'K' | |
| 2016 | + { 480, 10, 12, 12, 0, -12 }, // 'L' | |
| 2017 | + { 495, 16, 12, 18, 0, -12 }, // 'M' | |
| 2018 | + { 519, 15, 12, 16, 0, -12 }, // 'N' | |
| 2019 | + { 542, 13, 12, 15, 0, -12 }, // 'O' | |
| 2020 | + { 562, 10, 12, 12, 0, -12 }, // 'P' | |
| 2021 | + { 577, 13, 15, 15, 0, -12 }, // 'Q' | |
| 2022 | + { 602, 11, 12, 13, 0, -12 }, // 'R' | |
| 2023 | + { 619, 8, 12, 10, 0, -12 }, // 'S' | |
| 2024 | + { 631, 9, 12, 12, 1, -12 }, // 'T' | |
| 2025 | + { 645, 14, 12, 15, 0, -12 }, // 'U' | |
| 2026 | + { 666, 12, 12, 14, 0, -12 }, // 'V' | |
| 2027 | + { 684, 17, 12, 19, 0, -12 }, // 'W' | |
| 2028 | + { 710, 11, 12, 13, 0, -12 }, // 'X' | |
| 2029 | + { 727, 11, 12, 13, 0, -12 }, // 'Y' | |
| 2030 | + { 744, 11, 12, 13, 0, -12 }, // 'Z' | |
| 2031 | + { 761, 3, 16, 7, 2, -14 }, // '[' | |
| 2032 | + { 767, 8, 13, 12, 1, -13 }, // '\' | |
| 2033 | + { 780, 3, 16, 7, 1, -14 }, // ']' | |
| 2034 | + { 786, 9, 7, 12, 1, -12 }, // '^' | |
| 2035 | + { 794, 9, 1, 10, 0, 1 }, // '_' | |
| 2036 | + { 796, 4, 3, 7, 1, -12 }, // '`' | |
| 2037 | + { 798, 7, 8, 10, 1, -8 }, // 'a' | |
| 2038 | + { 805, 8, 13, 11, 0, -13 }, // 'b' | |
| 2039 | + { 818, 6, 8, 9, 1, -8 }, // 'c' | |
| 2040 | + { 824, 8, 14, 12, 1, -14 }, // 'd' | |
| 2041 | + { 838, 8, 9, 10, 0, -9 }, // 'e' | |
| 2042 | + { 847, 5, 13, 7, 1, -13 }, // 'f' | |
| 2043 | + { 856, 9, 14, 11, 0, -9 }, // 'g' | |
| 2044 | + { 872, 8, 13, 11, 1, -13 }, // 'h' | |
| 2045 | + { 885, 3, 12, 6, 1, -12 }, // 'i' | |
| 2046 | + { 890, 4, 17, 5, -2, -12 }, // 'j' | |
| 2047 | + { 899, 8, 13, 11, 1, -13 }, // 'k' | |
| 2048 | + { 912, 3, 13, 6, 1, -13 }, // 'l' | |
| 2049 | + { 917, 13, 8, 17, 1, -8 }, // 'm' | |
| 2050 | + { 930, 8, 8, 11, 1, -8 }, // 'n' | |
| 2051 | + { 938, 7, 9, 11, 1, -9 }, // 'o' | |
| 2052 | + { 946, 8, 13, 12, 1, -8 }, // 'p' | |
| 2053 | + { 959, 8, 14, 11, 1, -9 }, // 'q' | |
| 2054 | + { 973, 5, 9, 8, 1, -9 }, // 'r' | |
| 2055 | + { 979, 6, 9, 9, 1, -9 }, // 's' | |
| 2056 | + { 986, 4, 11, 7, 1, -11 }, // 't' | |
| 2057 | + { 992, 8, 9, 12, 1, -9 }, // 'u' | |
| 2058 | + { 1001, 10, 8, 11, 0, -8 }, // 'v' | |
| 2059 | + { 1011, 14, 9, 16, 0, -9 }, // 'w' | |
| 2060 | + { 1027, 9, 9, 10, 0, -9 }, // 'x' | |
| 2061 | + { 1038, 10, 13, 11, 0, -8 }, // 'y' | |
| 2062 | + { 1055, 8, 8, 10, 0, -8 }, // 'z' | |
| 2063 | + { 1063, 3, 16, 7, 1, -13 }, // '{' | |
| 2064 | + { 1069, 1, 13, 12, 5, -13 }, // '|' | |
| 2065 | + { 1071, 3, 16, 7, 1, -13 } // '}' | |
| 2066 | +}; | |
| 2067 | +const GFXfont URW_Palladio_L_Roman_18 PROGMEM = { | |
| 2068 | +(uint8_t *)URW_Palladio_L_Roman_18Bitmaps,(GFXglyph *)URW_Palladio_L_Roman_18Glyphs,0x20, 0x7E, 24}; | |
| 2069 | + | |
| 2070 | +// Created by http://oleddisplay.squix.ch/ Consider a donation | |
| 2071 | +// In case of problems make sure that you are using the font file with the correct version! | |
| 2072 | +const uint8_t URW_Palladio_L_Bold_18Bitmaps[] PROGMEM = { | |
| 2073 | + | |
| 2074 | + // Bitmap Data: | |
| 2075 | + 0x00, // ' ' | |
| 2076 | + 0x7F,0xB4,0x92,0x0F,0xF0, // '!' | |
| 2077 | + 0x67,0xDD,0x9A,0x24,0x48,0x80, // '"' | |
| 2078 | + 0x13,0x09,0x84,0x82,0x47,0xF9,0x90,0xD9,0xFE,0x24,0x12,0x09,0x0C,0x80, // '#' | |
| 2079 | + 0x10,0x7E,0xD2,0xD2,0xD0,0xF0,0xFE,0x3F,0x17,0x93,0x93,0x96,0xFC,0x10,0x10, // '$' | |
| 2080 | + 0x78,0x43,0x31,0x0C,0xC8,0x33,0x20,0xCD,0x01,0xE4,0x00,0x27,0x81,0x33,0x04,0xCC,0x23,0x30,0x8C,0xC4,0x1E, // '%' | |
| 2081 | + 0x0E,0x00,0x98,0x0C,0xC0,0x64,0x03,0xC0,0x1C,0x7D,0xF1,0x19,0xC8,0xC7,0x47,0x1C,0x1C,0x7E,0x7C,0xE0, // '&' | |
| 2082 | + 0xFF,0xC0, // ''' | |
| 2083 | + 0x12,0x64,0xCC,0xCC,0xCC,0xC4,0x62,0x10, // '(' | |
| 2084 | + 0x84,0x62,0x33,0x33,0x33,0x32,0x64,0x80, // ')' | |
| 2085 | + 0x1B,0x43,0xF4,0x18, // '*' | |
| 2086 | + 0x0C,0x03,0x00,0xC0,0x30,0xFF,0xFF,0xF0,0xC0,0x30,0x0C,0x03,0x00, // '+' | |
| 2087 | + 0x07,0x66,0xC8, // ',' | |
| 2088 | + 0x7F,0xE0, // '-' | |
| 2089 | + 0xDF,0x00, // '.' | |
| 2090 | + 0x08,0xC6,0x23,0x18,0x84,0x63,0x11,0x8C,0x00, // '/' | |
| 2091 | + 0x38,0xDB,0x1E,0x3C,0x78,0xF1,0xE3,0xC7,0x8D,0xB1,0xC0, // '0' | |
| 2092 | + 0x19,0xF2,0x60,0xC1,0x83,0x06,0x0C,0x18,0x30,0x63,0xF0, // '1' | |
| 2093 | + 0x78,0x7E,0xCE,0x86,0x06,0x04,0x0C,0x18,0x10,0x20,0x7F,0xFF, // '2' | |
| 2094 | + 0x3C,0x7E,0x46,0x86,0x04,0x3C,0x3F,0x03,0x03,0x83,0xC6,0xF8, // '3' | |
| 2095 | + 0x02,0x07,0x03,0x82,0xC3,0x61,0x31,0x18,0x8C,0x7F,0x83,0x01,0x83,0xF0, // '4' | |
| 2096 | + 0x7F,0x7F,0x40,0x40,0x5E,0x7F,0x47,0x03,0x03,0x82,0x46,0x78, // '5' | |
| 2097 | + 0x04,0x31,0x82,0x0D,0xDF,0xF3,0xE3,0xC7,0x8D,0x91,0xC0, // '6' | |
| 2098 | + 0xFF,0xFE,0x82,0x84,0x04,0x08,0x08,0x10,0x30,0x30,0x60,0x60, // '7' | |
| 2099 | + 0x3C,0xCF,0x9F,0x3F,0x47,0x8B,0xA3,0xC7,0x8F,0x93,0xC0, // '8' | |
| 2100 | + 0x38,0x9B,0x1E,0x3C,0x7C,0xFF,0xBB,0x0C,0x18,0x63,0x80, // '9' | |
| 2101 | + 0xDF,0x01,0xBE, // ':' | |
| 2102 | + 0x6D,0x80,0x1B,0x5A,0x00, // ';' | |
| 2103 | + 0x00,0x81,0xC3,0xC7,0x8E,0x07,0x01,0xE0,0x1C,0x03,0x80,0x40, // '<' | |
| 2104 | + 0xFF,0xFF,0xC0,0x00,0x0F,0xFF,0xFC, // '=' | |
| 2105 | + 0x00,0x70,0x1E,0x03,0xC0,0x38,0x1C,0x3C,0x70,0xE0,0x40,0x00, // '>' | |
| 2106 | + 0x7B,0xF8,0xC3,0x08,0x42,0x08,0x00,0x86,0x18, // '?' | |
| 2107 | + 0x0F,0x83,0x04,0x40,0x24,0x69,0x99,0x9B,0x99,0xB1,0x9B,0x32,0x75,0x65,0xDF,0x30,0x60,0xF8, // '@' | |
| 2108 | + 0x03,0x00,0x0C,0x00,0x78,0x01,0xE0,0x09,0xC0,0x27,0x01,0x8E,0x07,0xF8,0x10,0x60,0x81,0xC2,0x07,0x3E,0x3F, // 'A' | |
| 2109 | + 0xFF,0x0C,0x63,0x18,0xC6,0x33,0x0F,0xE3,0x1C,0xC3,0x30,0xCC,0x33,0x19,0xFC, // 'B' | |
| 2110 | + 0x0F,0xC6,0x0D,0x80,0xE0,0x1C,0x01,0x80,0x30,0x06,0x00,0x60,0x0C,0x00,0xE0,0x87,0xE0, // 'C' | |
| 2111 | + 0xFF,0xE0,0xC1,0xE3,0x01,0x8C,0x03,0x30,0x0C,0xC0,0x33,0x00,0xCC,0x03,0x30,0x18,0xC0,0x63,0x06,0x1F,0xE0, // 'D' | |
| 2112 | + 0xFF,0x8C,0x23,0x00,0xC0,0x31,0x0F,0xC3,0x10,0xC0,0x30,0x0C,0x13,0x05,0xFE, // 'E' | |
| 2113 | + 0xFF,0x98,0x4C,0x26,0x03,0x11,0xF8,0xC4,0x62,0x30,0x18,0x0C,0x1F,0x80, // 'F' | |
| 2114 | + 0x0F,0xE1,0x81,0x98,0x05,0x80,0x2C,0x00,0x60,0x03,0x00,0x18,0x1F,0x60,0x33,0x01,0x8E,0x0C,0x1F,0x80, // 'G' | |
| 2115 | + 0xFC,0xFC,0xC0,0xC3,0x03,0x0C,0x0C,0x30,0x30,0xFF,0xC3,0x03,0x0C,0x0C,0x30,0x30,0xC0,0xC3,0x03,0x3F,0x3F, // 'H' | |
| 2116 | + 0xFC,0xC3,0x0C,0x30,0xC3,0x0C,0x30,0xC3,0x3F, // 'I' | |
| 2117 | + 0xFC,0xC3,0x0C,0x30,0xC3,0x0C,0x30,0xC3,0x0C,0x30,0x82,0x30, // 'J' | |
| 2118 | + 0xFC,0x79,0x83,0x0C,0x20,0x62,0x03,0x20,0x1F,0x00,0xDC,0x06,0xF0,0x33,0xC1,0x8F,0x0C,0x3D,0xF8,0xF0, // 'K' | |
| 2119 | + 0xFC,0x0C,0x03,0x00,0xC0,0x30,0x0C,0x03,0x00,0xC0,0x30,0x0C,0x13,0x05,0xFE, // 'L' | |
| 2120 | + 0xF8,0x07,0x9C,0x07,0x0F,0x03,0x85,0x82,0xC2,0xE1,0x61,0x31,0x30,0x9C,0x98,0x46,0x8C,0x23,0xC6,0x10,0xC3,0x08,0x61,0x9F,0x33,0xF0, // 'M' | |
| 2121 | + 0xF8,0x3C,0xE0,0x23,0xC0,0x8B,0x82,0x27,0x08,0x9E,0x22,0x3C,0x88,0x7A,0x20,0xF8,0x81,0xE2,0x03,0xBE,0x06, // 'N' | |
| 2122 | + 0x0F,0xC1,0x83,0x18,0x0D,0x80,0x7C,0x01,0xE0,0x0F,0x00,0x78,0x03,0xE0,0x1B,0x01,0x8C,0x18,0x3F,0x00, // 'O' | |
| 2123 | + 0xFF,0x8C,0x73,0x0C,0xC3,0x31,0x8D,0xC3,0x00,0xC0,0x30,0x0C,0x03,0x03,0xF0, // 'P' | |
| 2124 | + 0x0F,0xC1,0x83,0x18,0x0D,0x80,0x7C,0x01,0xE0,0x0F,0x00,0x78,0x03,0xE0,0x1B,0x01,0x8C,0x18,0x3F,0x00,0xF0,0x1F,0xF4,0x01,0xC0, // 'Q' | |
| 2125 | + 0xFF,0x83,0x1C,0x30,0xC3,0x0C,0x30,0x83,0x30,0x37,0x03,0x38,0x33,0xC3,0x1C,0x30,0xEF,0xCF, // 'R' | |
| 2126 | + 0x3F,0x31,0xB0,0x58,0x0F,0x03,0xF0,0x7E,0x07,0x81,0xC0,0xF0,0xCF,0xC0, // 'S' | |
| 2127 | + 0xFF,0xE3,0x18,0xC4,0x30,0x0C,0x03,0x00,0xC0,0x30,0x0C,0x03,0x00,0xC0,0xFC, // 'T' | |
| 2128 | + 0xFC,0x7C,0xC0,0x43,0x01,0x0C,0x04,0x30,0x10,0xC0,0x43,0x01,0x0C,0x04,0x30,0x10,0xC0,0x41,0x82,0x03,0xF0, // 'U' | |
| 2129 | + 0xFC,0x3C,0xE0,0x43,0x81,0x07,0x0C,0x1C,0x20,0x30,0x80,0xE4,0x01,0x90,0x07,0x80,0x1E,0x00,0x30,0x00,0xC0, // 'V' | |
| 2130 | + 0xFC,0x43,0xDC,0x18,0x63,0x0E,0x10,0xE3,0xC4,0x39,0xF1,0x0E,0x4C,0x81,0x93,0xA0,0x78,0xE8,0x1E,0x1E,0x07,0x07,0x00,0xC0,0xC0,0x30,0x30, // 'W' | |
| 2131 | + 0xF0,0x73,0x84,0x1C,0x81,0xD8,0x0F,0x00,0x60,0x07,0x00,0xB8,0x1B,0x81,0x1C,0x21,0xCE,0x0F, // 'X' | |
| 2132 | + 0xF0,0x6E,0x08,0xE3,0x0C,0x40,0xD0,0x1A,0x01,0x80,0x30,0x06,0x00,0xC0,0x18,0x0F,0xC0, // 'Y' | |
| 2133 | + 0x7F,0xE8,0x39,0x07,0x01,0xC0,0x70,0x0E,0x03,0x80,0xE0,0x1C,0x07,0x05,0xC0,0xFF,0xF0, // 'Z' | |
| 2134 | + 0xFC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xF0, // '[' | |
| 2135 | + 0x40,0x30,0x08,0x06,0x01,0x00,0xC0,0x20,0x18,0x04,0x03,0x00,0x80,0x60,0x10, // '\' | |
| 2136 | + 0xF3,0x33,0x33,0x33,0x33,0x33,0x33,0xF0, // ']' | |
| 2137 | + 0x1C,0x0E,0x0D,0x86,0xC6,0x32,0x1B,0x06, // '^' | |
| 2138 | + 0xFF,0x80, // '_' | |
| 2139 | + 0xC3,0x0C, // '`' | |
| 2140 | + 0x78,0x18,0x31,0xEC,0xD9,0xBF,0x37, // 'a' | |
| 2141 | + 0xE0,0x30,0x18,0x0D,0xE7,0xF3,0x1D,0x86,0xC3,0x61,0xB0,0x98,0x8F,0x80, // 'b' | |
| 2142 | + 0x1C,0xCB,0x16,0x0C,0x18,0x18,0x1E, // 'c' | |
| 2143 | + 0x07,0x01,0x80,0xC0,0x61,0xF3,0x3B,0x0D,0x86,0xC3,0x71,0x9F,0xC7,0x70, // 'd' | |
| 2144 | + 0x3C,0x8F,0x1F,0xFC,0x18,0x38,0x1F, // 'e' | |
| 2145 | + 0x0C,0xF6,0x18,0x63,0xE6,0x18,0x61,0x86,0x18,0xF8, // 'f' | |
| 2146 | + 0x3C,0x23,0xF1,0x98,0xCC,0x63,0xC1,0x01,0xFE,0xFF,0xA0,0xF0,0x78,0x3E,0x33,0xE0, // 'g' | |
| 2147 | + 0xE0,0x30,0x18,0x0D,0xC7,0xF3,0x19,0x8C,0xC6,0x63,0x31,0x98,0xDE,0x70, // 'h' | |
| 2148 | + 0x66,0x60,0x2E,0x66,0x66,0x66,0xF0, // 'i' | |
| 2149 | + 0x33,0x30,0x17,0x33,0x33,0x33,0x33,0x33,0x2C, // 'j' | |
| 2150 | + 0xE0,0x18,0x06,0x01,0x80,0x63,0x99,0x86,0xC1,0xF0,0x6E,0x1B,0xC6,0x7B,0xCF, // 'k' | |
| 2151 | + 0xE6,0x66,0x66,0x66,0x66,0x6F, // 'l' | |
| 2152 | + 0x6E,0x73,0xFF,0xE6,0x31,0x98,0xC6,0x63,0x19,0x8C,0x66,0x31,0x98,0xC6,0xF7,0x9C, // 'm' | |
| 2153 | + 0x2E,0x7F,0x98,0xCC,0x66,0x33,0x19,0x8C,0xC6,0xF3,0x80, // 'n' | |
| 2154 | + 0x3C,0x66,0xC3,0xC3,0xC3,0xC3,0xC3,0x66,0x3C, // 'o' | |
| 2155 | + 0x2F,0x7F,0x98,0xEC,0x36,0x1B,0x0D,0x84,0xC4,0x7C,0x30,0x18,0x0C,0x06,0x07,0x80, // 'p' | |
| 2156 | + 0x1F,0x33,0xB0,0xD8,0x6C,0x37,0x19,0xFC,0xF6,0x03,0x01,0x80,0xC0,0x60,0x78, // 'q' | |
| 2157 | + 0x2F,0xF6,0x58,0x61,0x86,0x18,0xF8, // 'r' | |
| 2158 | + 0x7B,0x2C,0x3C,0x7C,0x78,0xE3,0xF8, // 's' | |
| 2159 | + 0x23,0x18,0xCF,0xB1,0x8C,0x63,0x1E,0x60, // 't' | |
| 2160 | + 0x21,0x73,0x98,0xCC,0x66,0x33,0x19,0x8C,0xFE,0x3B,0x80, // 'u' | |
| 2161 | + 0x71,0x8C,0x43,0x10,0xEC,0x1A,0x07,0x81,0xC0,0x30, // 'v' | |
| 2162 | + 0xF9,0x9E,0x63,0x18,0xC7,0x21,0x96,0x43,0xAD,0x83,0x9E,0x07,0x1C,0x0C,0x38,0x18,0x20, // 'w' | |
| 2163 | + 0xE1,0x99,0x0F,0x03,0x81,0xC0,0xF0,0xD8,0x4E,0xC3,0x80, // 'x' | |
| 2164 | + 0xF3,0xB0,0x9C,0x46,0x43,0x21,0xE0,0x70,0x30,0x08,0x04,0x04,0x12,0x0E,0x00, // 'y' | |
| 2165 | + 0x7F,0x46,0x0E,0x1C,0x18,0x30,0x71,0xFF, // 'z' | |
| 2166 | + 0x18,0xC3,0x0C,0x30,0xC3,0x10,0x30,0xC3,0x0C,0x30,0xC1,0x80, // '{' | |
| 2167 | + 0xFF,0xFF,0xFF,0xC0, // '|' | |
| 2168 | + 0x60,0xC3,0x0C,0x30,0xC3,0x02,0x30,0xC3,0x0C,0x30,0xC6,0x00 // '}' | |
| 2169 | +}; | |
| 2170 | +const GFXglyph URW_Palladio_L_Bold_18Glyphs[] PROGMEM = { | |
| 2171 | +// bitmapOffset, width, height, xAdvance, xOffset, yOffset | |
| 2172 | + { 0, 1, 1, 6, 0, 0 }, // ' ' | |
| 2173 | + { 1, 3, 12, 6, 1, -12 }, // '!' | |
| 2174 | + { 6, 7, 6, 8, 0, -12 }, // '"' | |
| 2175 | + { 12, 9, 12, 10, 0, -12 }, // '#' | |
| 2176 | + { 26, 8, 15, 10, 1, -13 }, // '$' | |
| 2177 | + { 41, 14, 12, 17, 1, -12 }, // '%' | |
| 2178 | + { 62, 13, 12, 16, 1, -12 }, // '&' | |
| 2179 | + { 82, 2, 6, 5, 1, -12 }, // ''' | |
| 2180 | + { 84, 4, 15, 7, 1, -13 }, // '(' | |
| 2181 | + { 92, 4, 15, 7, 1, -13 }, // ')' | |
| 2182 | + { 100, 6, 5, 9, 1, -12 }, // '*' | |
| 2183 | + { 104, 10, 10, 12, 1, -10 }, // '+' | |
| 2184 | + { 117, 4, 6, 6, 0, -3 }, // ',' | |
| 2185 | + { 120, 6, 2, 7, 0, -6 }, // '-' | |
| 2186 | + { 122, 3, 3, 6, 1, -3 }, // '.' | |
| 2187 | + { 124, 5, 13, 6, 0, -13 }, // '/' | |
| 2188 | + { 133, 7, 12, 10, 1, -12 }, // '0' | |
| 2189 | + { 144, 7, 12, 10, 1, -12 }, // '1' | |
| 2190 | + { 155, 8, 12, 10, 1, -12 }, // '2' | |
| 2191 | + { 167, 8, 12, 10, 0, -12 }, // '3' | |
| 2192 | + { 179, 9, 12, 10, 0, -12 }, // '4' | |
| 2193 | + { 193, 8, 12, 10, 0, -12 }, // '5' | |
| 2194 | + { 205, 7, 12, 10, 1, -12 }, // '6' | |
| 2195 | + { 216, 8, 12, 10, 1, -12 }, // '7' | |
| 2196 | + { 228, 7, 12, 10, 1, -12 }, // '8' | |
| 2197 | + { 239, 7, 12, 10, 1, -12 }, // '9' | |
| 2198 | + { 250, 3, 8, 6, 1, -8 }, // ':' | |
| 2199 | + { 253, 3, 11, 6, 0, -8 }, // ';' | |
| 2200 | + { 258, 9, 10, 12, 1, -10 }, // '<' | |
| 2201 | + { 270, 9, 6, 12, 1, -8 }, // '=' | |
| 2202 | + { 277, 9, 10, 12, 1, -10 }, // '>' | |
| 2203 | + { 289, 6, 12, 9, 1, -12 }, // '?' | |
| 2204 | + { 298, 12, 12, 14, 1, -12 }, // '@' | |
| 2205 | + { 316, 14, 12, 15, 0, -12 }, // 'A' | |
| 2206 | + { 337, 10, 12, 13, 0, -12 }, // 'B' | |
| 2207 | + { 352, 11, 12, 14, 1, -12 }, // 'C' | |
| 2208 | + { 369, 14, 12, 16, 0, -12 }, // 'D' | |
| 2209 | + { 390, 10, 12, 12, 0, -12 }, // 'E' | |
| 2210 | + { 405, 9, 12, 11, 0, -12 }, // 'F' | |
| 2211 | + { 419, 13, 12, 16, 1, -12 }, // 'G' | |
| 2212 | + { 439, 14, 12, 16, 0, -12 }, // 'H' | |
| 2213 | + { 460, 6, 12, 8, 0, -12 }, // 'I' | |
| 2214 | + { 469, 6, 16, 8, 0, -12 }, // 'J' | |
| 2215 | + { 481, 13, 12, 15, 0, -12 }, // 'K' | |
| 2216 | + { 501, 10, 12, 12, 0, -12 }, // 'L' | |
| 2217 | + { 516, 17, 12, 19, 0, -12 }, // 'M' | |
| 2218 | + { 542, 14, 12, 16, 0, -12 }, // 'N' | |
| 2219 | + { 563, 13, 12, 16, 1, -12 }, // 'O' | |
| 2220 | + { 583, 10, 12, 12, 0, -12 }, // 'P' | |
| 2221 | + { 598, 13, 15, 16, 1, -12 }, // 'Q' | |
| 2222 | + { 623, 12, 12, 14, 0, -12 }, // 'R' | |
| 2223 | + { 641, 9, 12, 12, 1, -12 }, // 'S' | |
| 2224 | + { 655, 10, 12, 13, 1, -12 }, // 'T' | |
| 2225 | + { 670, 14, 12, 15, 0, -12 }, // 'U' | |
| 2226 | + { 691, 14, 12, 15, 0, -12 }, // 'V' | |
| 2227 | + { 712, 18, 12, 19, 0, -12 }, // 'W' | |
| 2228 | + { 739, 12, 12, 13, 0, -12 }, // 'X' | |
| 2229 | + { 757, 11, 12, 13, 0, -12 }, // 'Y' | |
| 2230 | + { 774, 11, 12, 13, 0, -12 }, // 'Z' | |
| 2231 | + { 791, 4, 15, 7, 1, -13 }, // '[' | |
| 2232 | + { 799, 9, 13, 12, 1, -13 }, // '\' | |
| 2233 | + { 814, 4, 15, 7, 1, -13 }, // ']' | |
| 2234 | + { 822, 9, 7, 12, 1, -12 }, // '^' | |
| 2235 | + { 830, 9, 1, 10, 0, 1 }, // '_' | |
| 2236 | + { 832, 5, 3, 7, 0, -12 }, // '`' | |
| 2237 | + { 834, 7, 8, 10, 1, -8 }, // 'a' | |
| 2238 | + { 841, 9, 12, 12, 1, -12 }, // 'b' | |
| 2239 | + { 855, 7, 8, 9, 1, -8 }, // 'c' | |
| 2240 | + { 862, 9, 12, 12, 1, -12 }, // 'd' | |
| 2241 | + { 876, 7, 8, 10, 1, -8 }, // 'e' | |
| 2242 | + { 883, 6, 13, 8, 1, -13 }, // 'f' | |
| 2243 | + { 893, 9, 14, 11, 1, -9 }, // 'g' | |
| 2244 | + { 909, 9, 12, 12, 1, -12 }, // 'h' | |
| 2245 | + { 923, 4, 13, 7, 1, -13 }, // 'i' | |
| 2246 | + { 930, 4, 18, 7, 0, -13 }, // 'j' | |
| 2247 | + { 939, 10, 12, 12, 1, -12 }, // 'k' | |
| 2248 | + { 954, 4, 12, 7, 1, -12 }, // 'l' | |
| 2249 | + { 960, 14, 9, 17, 1, -9 }, // 'm' | |
| 2250 | + { 976, 9, 9, 12, 1, -9 }, // 'n' | |
| 2251 | + { 987, 8, 9, 11, 1, -9 }, // 'o' | |
| 2252 | + { 996, 9, 14, 12, 1, -9 }, // 'p' | |
| 2253 | + { 1012, 9, 13, 12, 1, -8 }, // 'q' | |
| 2254 | + { 1027, 6, 9, 8, 1, -9 }, // 'r' | |
| 2255 | + { 1034, 6, 9, 9, 1, -9 }, // 's' | |
| 2256 | + { 1041, 5, 12, 7, 1, -12 }, // 't' | |
| 2257 | + { 1049, 9, 9, 12, 1, -9 }, // 'u' | |
| 2258 | + { 1060, 10, 8, 11, 0, -8 }, // 'v' | |
| 2259 | + { 1070, 15, 9, 16, 0, -9 }, // 'w' | |
| 2260 | + { 1087, 9, 9, 10, 0, -9 }, // 'x' | |
| 2261 | + { 1098, 9, 13, 11, 0, -8 }, // 'y' | |
| 2262 | + { 1113, 8, 8, 10, 0, -8 }, // 'z' | |
| 2263 | + { 1121, 6, 15, 7, 0, -14 }, // '{' | |
| 2264 | + { 1133, 2, 13, 12, 5, -13 }, // '|' | |
| 2265 | + { 1137, 6, 15, 7, 0, -14 } // '}' | |
| 2266 | +}; | |
| 2267 | +const GFXfont URW_Palladio_L_Bold_18 PROGMEM = { | |
| 2268 | +(uint8_t *)URW_Palladio_L_Bold_18Bitmaps,(GFXglyph *)URW_Palladio_L_Bold_18Glyphs,0x20, 0x7E, 24}; | |
| 2269 | + | |
| 2270 | +// Created by http://oleddisplay.squix.ch/ Consider a donation | |
| 2271 | +// In case of problems make sure that you are using the font file with the correct version! | |
| 2272 | +const uint8_t Lato_Hairline_16Bitmaps[] PROGMEM = { | |
| 2273 | + | |
| 2274 | + // Bitmap Data: | |
| 2275 | + 0x00, // ' ' | |
| 2276 | + 0x55,0x55,0x07, // '!' | |
| 2277 | + 0xB6,0xDA, // '"' | |
| 2278 | + 0x12,0x12,0x12,0xFF,0x24,0x24,0x24,0x24,0xFF,0x48,0x48,0x48, // '#' | |
| 2279 | + 0x08,0x08,0x1C,0x6A,0x48,0x48,0x48,0x30,0x0E,0x12,0x11,0x12,0xD2,0x3C,0x10,0x10, // '$' | |
| 2280 | + 0x60,0x53,0x12,0x22,0x44,0x88,0xA1,0xA8,0x09,0x70,0x51,0x12,0x24,0x44,0x88,0xA0,0xE0, // '%' | |
| 2281 | + 0x1C,0x04,0x40,0x88,0x10,0x02,0x00,0x60,0x12,0x24,0x24,0x82,0x90,0x23,0x0A,0x1E,0x30, // '&' | |
| 2282 | + 0xF8, // ''' | |
| 2283 | + 0x25,0x29,0x24,0x92,0x24,0x88, // '(' | |
| 2284 | + 0x91,0x24,0x49,0x25,0x25,0x20, // ')' | |
| 2285 | + 0x27,0x4D,0xD2,0x00, // '*' | |
| 2286 | + 0x10,0x10,0x10,0x10,0xFF,0x10,0x10,0x10, // '+' | |
| 2287 | + 0x76, // ',' | |
| 2288 | + 0xF0, // '-' | |
| 2289 | + 0x70, // '.' | |
| 2290 | + 0x04,0x20,0x82,0x10,0x42,0x08,0x41,0x04,0x20,0x80, // '/' | |
| 2291 | + 0x18,0x66,0x82,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x42,0x3C, // '0' | |
| 2292 | + 0x10,0xC5,0x24,0x10,0x41,0x04,0x10,0x41,0x3F, // '1' | |
| 2293 | + 0x18,0x66,0x42,0x81,0x02,0x02,0x04,0x08,0x10,0x20,0x40,0xFF, // '2' | |
| 2294 | + 0x18,0x66,0x42,0x82,0x02,0x06,0x1E,0x02,0x01,0x81,0x42,0x3C, // '3' | |
| 2295 | + 0x02,0x01,0x01,0x81,0x41,0x21,0x10,0x88,0x84,0xFF,0x81,0x00,0x80,0x40, // '4' | |
| 2296 | + 0x3E,0x41,0x02,0x04,0x0F,0x80,0x81,0x02,0x06,0x0B,0xE0, // '5' | |
| 2297 | + 0x04,0x08,0x08,0x10,0x20,0x7E,0x42,0x81,0x81,0x81,0x42,0x3C, // '6' | |
| 2298 | + 0xFF,0x01,0x02,0x02,0x04,0x04,0x08,0x08,0x10,0x10,0x20,0x60, // '7' | |
| 2299 | + 0x18,0x66,0x42,0x82,0x42,0x66,0x7E,0x82,0x81,0x81,0x42,0x3C, // '8' | |
| 2300 | + 0x18,0x66,0x82,0x81,0x83,0x66,0x1E,0x04,0x08,0x18,0x10,0x20, // '9' | |
| 2301 | + 0x70,0x01,0xC0, // ':' | |
| 2302 | + 0x70,0x01,0xD8, // ';' | |
| 2303 | + 0x06,0x30,0x86,0x03,0x01,0x80,0x80, // '<' | |
| 2304 | + 0xFF,0x00,0xFF, // '=' | |
| 2305 | + 0xC0,0xC0,0x81,0x19,0x88,0x00, // '>' | |
| 2306 | + 0x74,0x42,0x10,0x88,0x84,0x00,0x08,0xC0, // '?' | |
| 2307 | + 0x1F,0x82,0x06,0x40,0x24,0x79,0x88,0x99,0x11,0x91,0x19,0x12,0x93,0x24,0xCC,0x20,0x01,0x8E,0x07,0x00, // '@' | |
| 2308 | + 0x04,0x00,0x80,0x28,0x05,0x01,0x20,0x22,0x04,0x41,0x04,0x3F,0x88,0x09,0x01,0x40,0x30, // 'A' | |
| 2309 | + 0xF9,0x0A,0x0C,0x18,0x30,0xBF,0x41,0x83,0x06,0x0F,0xE0, // 'B' | |
| 2310 | + 0x0E,0x0C,0x74,0x01,0x00,0x80,0x20,0x08,0x02,0x00,0x80,0x10,0x02,0x0C,0x7C, // 'C' | |
| 2311 | + 0xFC,0x20,0xC8,0x0A,0x02,0x80,0x60,0x18,0x06,0x01,0x80,0xA0,0x28,0x13,0xF8, // 'D' | |
| 2312 | + 0xFF,0x02,0x04,0x08,0x10,0x3F,0x40,0x81,0x02,0x07,0xF0, // 'E' | |
| 2313 | + 0xFF,0x02,0x04,0x08,0x10,0x3F,0x40,0x81,0x02,0x04,0x00, // 'F' | |
| 2314 | + 0x0F,0x0C,0x34,0x01,0x00,0x80,0x20,0x08,0x02,0x07,0x80,0x50,0x12,0x04,0x7E, // 'G' | |
| 2315 | + 0x80,0xC0,0x60,0x30,0x18,0x0C,0x07,0xFF,0x01,0x80,0xC0,0x60,0x30,0x10, // 'H' | |
| 2316 | + 0xFF,0xF0, // 'I' | |
| 2317 | + 0x08,0x42,0x10,0x84,0x21,0x08,0x43,0xE0, // 'J' | |
| 2318 | + 0x81,0x41,0x21,0x11,0x09,0x05,0x03,0x81,0x20,0x88,0x42,0x20,0x90,0x30, // 'K' | |
| 2319 | + 0x82,0x08,0x20,0x82,0x08,0x20,0x82,0x08,0x3F, // 'L' | |
| 2320 | + 0x80,0x30,0x07,0x01,0xD0,0x5A,0x0B,0x22,0x64,0x4C,0x51,0x8A,0x30,0x86,0x00,0xC0,0x10, // 'M' | |
| 2321 | + 0x80,0xC0,0x70,0x34,0x19,0x0C,0x86,0x23,0x09,0x84,0xC1,0x60,0x70,0x10, // 'N' | |
| 2322 | + 0x0E,0x06,0x31,0x01,0x20,0x18,0x03,0x00,0x60,0x0C,0x01,0x80,0x28,0x08,0x82,0x0F,0x80, // 'O' | |
| 2323 | + 0xF1,0x1A,0x0C,0x18,0x30,0xA3,0x78,0x81,0x02,0x04,0x00, // 'P' | |
| 2324 | + 0x0E,0x03,0x18,0x40,0x44,0x02,0x80,0x28,0x02,0x80,0x28,0x02,0x80,0x24,0x04,0x20,0xC1,0xF8,0x00,0x40,0x02,0x00,0x30, // 'Q' | |
| 2325 | + 0xF8,0x84,0x82,0x82,0x82,0x8C,0xF0,0x90,0x88,0x84,0x82,0x81, // 'R' | |
| 2326 | + 0x38,0x8E,0x04,0x04,0x06,0x03,0x01,0x02,0x06,0x1B,0xC0, // 'S' | |
| 2327 | + 0xFF,0xC2,0x00,0x80,0x20,0x08,0x02,0x00,0x80,0x20,0x08,0x02,0x00,0x80,0x20, // 'T' | |
| 2328 | + 0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x42,0x3C, // 'U' | |
| 2329 | + 0x80,0x28,0x09,0x01,0x20,0x42,0x08,0x41,0x04,0x40,0x88,0x0A,0x01,0x40,0x30,0x02,0x00, // 'V' | |
| 2330 | + 0x80,0x81,0x40,0x81,0x41,0x81,0x41,0x42,0x22,0x42,0x22,0x22,0x22,0x24,0x14,0x24,0x14,0x14,0x14,0x18,0x08,0x18,0x08,0x08, // 'W' | |
| 2331 | + 0x80,0x50,0x22,0x10,0x44,0x12,0x03,0x00,0xC0,0x28,0x11,0x08,0x44,0x0B,0x01, // 'X' | |
| 2332 | + 0x80,0x50,0x24,0x10,0x84,0x12,0x05,0x00,0xC0,0x20,0x08,0x02,0x00,0x80,0x20, // 'Y' | |
| 2333 | + 0xFF,0x01,0x02,0x06,0x04,0x08,0x10,0x10,0x20,0x40,0x80,0xFF, // 'Z' | |
| 2334 | + 0xF2,0x49,0x24,0x92,0x49,0x38, // '[' | |
| 2335 | + 0x82,0x08,0x10,0x40,0x82,0x04,0x10,0x40,0x82,0x04, // '\' | |
| 2336 | + 0xE4,0x92,0x49,0x24,0x92,0x78, // ']' | |
| 2337 | + 0x10,0x30,0x61,0x24,0x58,0x40, // '^' | |
| 2338 | + 0xFE, // '_' | |
| 2339 | + 0x89,0x80, // '`' | |
| 2340 | + 0x33,0x20,0x41,0x7E,0x18,0x63,0x74, // 'a' | |
| 2341 | + 0x81,0x02,0x04,0xCE,0x78,0x60,0xC1,0x83,0x07,0x0D,0xE0, // 'b' | |
| 2342 | + 0x38,0x8A,0x04,0x08,0x10,0x20,0x23,0x3C, // 'c' | |
| 2343 | + 0x02,0x04,0x09,0xD4,0x70,0x60,0xC1,0x83,0x05,0x19,0xD0, // 'd' | |
| 2344 | + 0x38,0x8A,0x0C,0x1F,0xF0,0x20,0x21,0x3C, // 'e' | |
| 2345 | + 0x1C,0x82,0x3F,0x20,0x82,0x08,0x20,0x82,0x08, // 'f' | |
| 2346 | + 0x3E,0x8A,0x14,0x24,0xCE,0x20,0x20,0xFF,0x06,0x0B,0xE0, // 'g' | |
| 2347 | + 0x81,0x02,0x04,0xCE,0x58,0x60,0xC1,0x83,0x06,0x0C,0x10, // 'h' | |
| 2348 | + 0xB2,0xAA,0xAA, // 'i' | |
| 2349 | + 0x23,0x02,0x22,0x22,0x22,0x22,0x22,0xE0, // 'j' | |
| 2350 | + 0x81,0x02,0x04,0x38,0x92,0x28,0x70,0xB1,0x32,0x34,0x30, // 'k' | |
| 2351 | + 0xAA,0xAA,0xAA, // 'l' | |
| 2352 | + 0x91,0x9D,0xCA,0x10,0xC2,0x18,0x43,0x08,0x61,0x0C,0x21,0x84,0x20, // 'm' | |
| 2353 | + 0x99,0xCB,0x0C,0x18,0x30,0x60,0xC1,0x82, // 'n' | |
| 2354 | + 0x38,0x8A,0x0C,0x18,0x30,0x60,0xA1,0x3C, // 'o' | |
| 2355 | + 0x99,0xCF,0x0C,0x18,0x30,0x60,0xE1,0xFD,0x02,0x04,0x00, // 'p' | |
| 2356 | + 0x3A,0x8E,0x0C,0x18,0x30,0x60,0xA3,0x3A,0x04,0x08,0x10, // 'q' | |
| 2357 | + 0x9F,0x31,0x08,0x42,0x10,0x80, // 'r' | |
| 2358 | + 0x36,0x61,0x07,0x04,0x31,0x70, // 's' | |
| 2359 | + 0x42,0x11,0xE4,0x21,0x08,0x42,0x12,0xE0, // 't' | |
| 2360 | + 0x83,0x06,0x0C,0x18,0x30,0x60,0xA3,0x3A, // 'u' | |
| 2361 | + 0x81,0x41,0x42,0x22,0x24,0x24,0x14,0x18,0x08, // 'v' | |
| 2362 | + 0x82,0x14,0x21,0x46,0x14,0x52,0x25,0x22,0x92,0x28,0xC1,0x0C,0x10,0x80, // 'w' | |
| 2363 | + 0x82,0x42,0x24,0x28,0x10,0x18,0x24,0x42,0xC3, // 'x' | |
| 2364 | + 0x81,0x41,0x42,0x22,0x22,0x24,0x14,0x18,0x08,0x10,0x10,0x30, // 'y' | |
| 2365 | + 0xFC,0x10,0x84,0x20,0x84,0x20,0xFC, // 'z' | |
| 2366 | + 0x74,0x44,0x44,0x4C,0x44,0x44,0x44,0x30, // '{' | |
| 2367 | + 0xFF,0xFF, // '|' | |
| 2368 | + 0xC2,0x22,0x44,0x43,0x44,0x22,0x24,0x80 // '}' | |
| 2369 | +}; | |
| 2370 | +const GFXglyph Lato_Hairline_16Glyphs[] PROGMEM = { | |
| 2371 | +// bitmapOffset, width, height, xAdvance, xOffset, yOffset | |
| 2372 | + { 0, 1, 1, 7, 0, 0 }, // ' ' | |
| 2373 | + { 1, 2, 12, 6, 1, -12 }, // '!' | |
| 2374 | + { 4, 3, 5, 7, 1, -12 }, // '"' | |
| 2375 | + { 6, 8, 12, 11, 1, -12 }, // '#' | |
| 2376 | + { 18, 8, 16, 11, 1, -14 }, // '$' | |
| 2377 | + { 34, 11, 12, 14, 1, -12 }, // '%' | |
| 2378 | + { 51, 11, 12, 13, 1, -12 }, // '&' | |
| 2379 | + { 68, 1, 5, 5, 1, -12 }, // ''' | |
| 2380 | + { 69, 3, 15, 6, 1, -13 }, // '(' | |
| 2381 | + { 75, 3, 15, 6, 1, -13 }, // ')' | |
| 2382 | + { 81, 5, 5, 9, 1, -12 }, // '*' | |
| 2383 | + { 85, 8, 8, 11, 1, -10 }, // '+' | |
| 2384 | + { 93, 2, 4, 5, 1, -2 }, // ',' | |
| 2385 | + { 94, 4, 1, 8, 1, -5 }, // '-' | |
| 2386 | + { 95, 2, 2, 6, 1, -2 }, // '.' | |
| 2387 | + { 96, 6, 13, 9, 1, -12 }, // '/' | |
| 2388 | + { 106, 8, 12, 11, 1, -12 }, // '0' | |
| 2389 | + { 118, 6, 12, 11, 2, -12 }, // '1' | |
| 2390 | + { 127, 8, 12, 11, 1, -12 }, // '2' | |
| 2391 | + { 139, 8, 12, 11, 1, -12 }, // '3' | |
| 2392 | + { 151, 9, 12, 11, 0, -12 }, // '4' | |
| 2393 | + { 165, 7, 12, 11, 1, -12 }, // '5' | |
| 2394 | + { 176, 8, 12, 11, 1, -12 }, // '6' | |
| 2395 | + { 188, 8, 12, 11, 1, -12 }, // '7' | |
| 2396 | + { 200, 8, 12, 11, 1, -12 }, // '8' | |
| 2397 | + { 212, 8, 12, 11, 1, -12 }, // '9' | |
| 2398 | + { 224, 2, 9, 6, 1, -9 }, // ':' | |
| 2399 | + { 227, 2, 11, 6, 1, -9 }, // ';' | |
| 2400 | + { 230, 7, 7, 11, 1, -9 }, // '<' | |
| 2401 | + { 237, 8, 3, 11, 1, -7 }, // '=' | |
| 2402 | + { 240, 6, 7, 11, 2, -9 }, // '>' | |
| 2403 | + { 246, 5, 12, 9, 1, -12 }, // '?' | |
| 2404 | + { 254, 12, 13, 15, 1, -11 }, // '@' | |
| 2405 | + { 274, 11, 12, 12, 0, -12 }, // 'A' | |
| 2406 | + { 291, 7, 12, 12, 2, -12 }, // 'B' | |
| 2407 | + { 302, 10, 12, 13, 1, -12 }, // 'C' | |
| 2408 | + { 317, 10, 12, 14, 2, -12 }, // 'D' | |
| 2409 | + { 332, 7, 12, 11, 2, -12 }, // 'E' | |
| 2410 | + { 343, 7, 12, 11, 2, -12 }, // 'F' | |
| 2411 | + { 354, 10, 12, 14, 1, -12 }, // 'G' | |
| 2412 | + { 369, 9, 12, 14, 2, -12 }, // 'H' | |
| 2413 | + { 383, 1, 12, 6, 2, -12 }, // 'I' | |
| 2414 | + { 385, 5, 12, 9, 0, -12 }, // 'J' | |
| 2415 | + { 393, 9, 12, 12, 2, -12 }, // 'K' | |
| 2416 | + { 407, 6, 12, 10, 2, -12 }, // 'L' | |
| 2417 | + { 416, 11, 12, 16, 2, -12 }, // 'M' | |
| 2418 | + { 433, 9, 12, 14, 2, -12 }, // 'N' | |
| 2419 | + { 447, 11, 12, 15, 1, -12 }, // 'O' | |
| 2420 | + { 464, 7, 12, 11, 2, -12 }, // 'P' | |
| 2421 | + { 475, 12, 15, 15, 1, -12 }, // 'Q' | |
| 2422 | + { 498, 8, 12, 11, 2, -12 }, // 'R' | |
| 2423 | + { 510, 7, 12, 10, 1, -12 }, // 'S' | |
| 2424 | + { 521, 10, 12, 11, 0, -12 }, // 'T' | |
| 2425 | + { 536, 8, 12, 14, 2, -12 }, // 'U' | |
| 2426 | + { 548, 11, 12, 12, 0, -12 }, // 'V' | |
| 2427 | + { 565, 16, 12, 18, 0, -12 }, // 'W' | |
| 2428 | + { 589, 10, 12, 12, 0, -12 }, // 'X' | |
| 2429 | + { 604, 10, 12, 11, 0, -12 }, // 'Y' | |
| 2430 | + { 619, 8, 12, 12, 1, -12 }, // 'Z' | |
| 2431 | + { 631, 3, 15, 7, 2, -13 }, // '[' | |
| 2432 | + { 637, 6, 13, 9, 1, -12 }, // '\' | |
| 2433 | + { 647, 3, 15, 7, 1, -13 }, // ']' | |
| 2434 | + { 653, 7, 6, 11, 1, -12 }, // '^' | |
| 2435 | + { 659, 7, 1, 9, 0, 1 }, // '_' | |
| 2436 | + { 660, 3, 3, 8, 2, -12 }, // '`' | |
| 2437 | + { 662, 6, 9, 10, 1, -9 }, // 'a' | |
| 2438 | + { 669, 7, 12, 11, 1, -12 }, // 'b' | |
| 2439 | + { 680, 7, 9, 9, 1, -9 }, // 'c' | |
| 2440 | + { 688, 7, 12, 11, 1, -12 }, // 'd' | |
| 2441 | + { 699, 7, 9, 10, 1, -9 }, // 'e' | |
| 2442 | + { 707, 6, 12, 7, 0, -12 }, // 'f' | |
| 2443 | + { 716, 7, 12, 10, 1, -9 }, // 'g' | |
| 2444 | + { 727, 7, 12, 11, 1, -12 }, // 'h' | |
| 2445 | + { 738, 2, 12, 5, 1, -12 }, // 'i' | |
| 2446 | + { 741, 4, 15, 5, -1, -12 }, // 'j' | |
| 2447 | + { 749, 7, 12, 9, 1, -12 }, // 'k' | |
| 2448 | + { 760, 2, 12, 5, 1, -12 }, // 'l' | |
| 2449 | + { 763, 11, 9, 15, 1, -9 }, // 'm' | |
| 2450 | + { 776, 7, 9, 11, 1, -9 }, // 'n' | |
| 2451 | + { 784, 7, 9, 11, 1, -9 }, // 'o' | |
| 2452 | + { 792, 7, 12, 11, 1, -9 }, // 'p' | |
| 2453 | + { 803, 7, 12, 11, 1, -9 }, // 'q' | |
| 2454 | + { 814, 5, 9, 8, 1, -9 }, // 'r' | |
| 2455 | + { 820, 5, 9, 9, 1, -9 }, // 's' | |
| 2456 | + { 826, 5, 12, 7, 1, -12 }, // 't' | |
| 2457 | + { 834, 7, 9, 11, 1, -9 }, // 'u' | |
| 2458 | + { 842, 8, 9, 10, 0, -9 }, // 'v' | |
| 2459 | + { 851, 12, 9, 14, 0, -9 }, // 'w' | |
| 2460 | + { 865, 8, 9, 9, 0, -9 }, // 'x' | |
| 2461 | + { 874, 8, 12, 10, 0, -9 }, // 'y' | |
| 2462 | + { 886, 6, 9, 9, 1, -9 }, // 'z' | |
| 2463 | + { 893, 4, 15, 7, 1, -13 }, // '{' | |
| 2464 | + { 901, 1, 16, 6, 2, -13 }, // '|' | |
| 2465 | + { 903, 4, 15, 7, 1, -13 } // '}' | |
| 2466 | +}; | |
| 2467 | +const GFXfont Lato_Hairline_16 PROGMEM = { | |
| 2468 | +(uint8_t *)Lato_Hairline_16Bitmaps,(GFXglyph *)Lato_Hairline_16Glyphs,0x20, 0x7E, 20}; | |
| 2469 | + | |
| 2470 | + | |
| 2471 | + | |
| 2472 | +const uint8_t sourcesans8pt7bBitmaps[] PROGMEM = { | |
| 2473 | + 0x00, 0xFF, 0x60, 0x99, 0x99, 0x12, 0x12, 0x3F, 0x24, 0x24, 0x24, 0xFC, | |
| 2474 | + 0x24, 0x48, 0x48, 0x10, 0x47, 0xB1, 0x83, 0x07, 0x06, 0x04, 0x18, 0x5E, | |
| 2475 | + 0x10, 0x60, 0x89, 0x10, 0x91, 0x09, 0x20, 0x92, 0xE9, 0x5B, 0x69, 0x10, | |
| 2476 | + 0x91, 0x11, 0x11, 0x11, 0x20, 0xE0, 0x30, 0x48, 0x48, 0x58, 0x70, 0x61, | |
| 2477 | + 0xF3, 0x9A, 0x8E, 0xCE, 0x79, 0xF0, 0x09, 0x29, 0x24, 0x92, 0x24, 0x88, | |
| 2478 | + 0x09, 0x22, 0x49, 0x24, 0xA4, 0xA0, 0x25, 0x5C, 0xE5, 0x00, 0x21, 0x09, | |
| 2479 | + 0xF2, 0x10, 0x80, 0xD8, 0xE0, 0xC0, 0x00, 0x44, 0x21, 0x08, 0x84, 0x22, | |
| 2480 | + 0x10, 0x84, 0x42, 0x00, 0x79, 0x28, 0x61, 0x86, 0x18, 0x61, 0x49, 0xE0, | |
| 2481 | + 0xE1, 0x08, 0x42, 0x10, 0x84, 0x27, 0xC0, 0x79, 0x98, 0x10, 0x20, 0xC1, | |
| 2482 | + 0x04, 0x10, 0x41, 0xFC, 0x79, 0x10, 0x43, 0x30, 0x30, 0x41, 0x8D, 0xE0, | |
| 2483 | + 0x18, 0x62, 0x8A, 0x4A, 0x2F, 0xC2, 0x08, 0x20, 0x7E, 0x08, 0x20, 0xF8, | |
| 2484 | + 0x30, 0x41, 0x8D, 0xE0, 0x39, 0x0C, 0x20, 0xBB, 0x18, 0x61, 0x4C, 0xE0, | |
| 2485 | + 0xFC, 0x20, 0x84, 0x10, 0x42, 0x08, 0x20, 0x80, 0x39, 0x14, 0x51, 0x39, | |
| 2486 | + 0x28, 0x61, 0xC5, 0xE0, 0x73, 0x28, 0x61, 0x8D, 0xD0, 0x43, 0x09, 0xC0, | |
| 2487 | + 0xC3, 0xC1, 0xC0, 0x00, 0x37, 0x20, 0xE0, 0x70, 0x40, 0xFC, 0x00, 0x00, | |
| 2488 | + 0xFC, 0x03, 0x03, 0x81, 0x1F, 0x88, 0x00, 0x74, 0x42, 0x11, 0x10, 0x84, | |
| 2489 | + 0x01, 0x08, 0x0F, 0x83, 0x06, 0x60, 0x24, 0x71, 0x89, 0x19, 0x11, 0x91, | |
| 2490 | + 0x19, 0x32, 0x8D, 0xC4, 0x00, 0x60, 0x01, 0xF0, 0x18, 0x18, 0x1C, 0x24, | |
| 2491 | + 0x24, 0x24, 0x66, 0x7E, 0x42, 0xC3, 0x81, 0xF9, 0x1A, 0x14, 0x28, 0xDF, | |
| 2492 | + 0x21, 0xC1, 0x83, 0x0F, 0xF0, 0x3C, 0xC7, 0x04, 0x08, 0x10, 0x20, 0x40, | |
| 2493 | + 0xC0, 0xC4, 0xF0, 0xF8, 0x86, 0x82, 0x81, 0x81, 0x81, 0x81, 0x81, 0x82, | |
| 2494 | + 0x86, 0xF8, 0xFE, 0x08, 0x20, 0x83, 0xE8, 0x20, 0x82, 0x0F, 0xC0, 0xFE, | |
| 2495 | + 0x08, 0x20, 0x83, 0xE8, 0x20, 0x82, 0x08, 0x00, 0x1E, 0x61, 0x40, 0x80, | |
| 2496 | + 0x80, 0x87, 0x81, 0x81, 0x41, 0x61, 0x1E, 0x81, 0x81, 0x81, 0x81, 0x81, | |
| 2497 | + 0xFF, 0x81, 0x81, 0x81, 0x81, 0x81, 0xFF, 0xE0, 0x08, 0x42, 0x10, 0x84, | |
| 2498 | + 0x21, 0x0C, 0x5C, 0x87, 0x1A, 0x64, 0x8B, 0x1E, 0x36, 0x44, 0x85, 0x0E, | |
| 2499 | + 0x08, 0x84, 0x21, 0x08, 0x42, 0x10, 0x84, 0x3E, 0xC1, 0xE0, 0xF0, 0x74, | |
| 2500 | + 0x5A, 0x2D, 0x16, 0x53, 0x29, 0x88, 0xC4, 0x60, 0x20, 0x81, 0xC1, 0xE1, | |
| 2501 | + 0xA1, 0x91, 0x99, 0x89, 0x85, 0x87, 0x83, 0x81, 0x3C, 0x42, 0x42, 0x81, | |
| 2502 | + 0x81, 0x81, 0x81, 0x81, 0x42, 0x42, 0x3C, 0xFD, 0x0E, 0x0C, 0x18, 0x7F, | |
| 2503 | + 0x20, 0x40, 0x81, 0x02, 0x00, 0x3C, 0x42, 0x42, 0x81, 0x81, 0x81, 0x81, | |
| 2504 | + 0x81, 0xC3, 0x42, 0x3C, 0x18, 0x0C, 0x07, 0xFC, 0x86, 0x82, 0x82, 0x86, | |
| 2505 | + 0xFC, 0x88, 0x8C, 0x84, 0x86, 0x82, 0x3E, 0x63, 0x40, 0x40, 0x30, 0x1E, | |
| 2506 | + 0x07, 0x01, 0x01, 0xC3, 0x3C, 0xFE, 0x20, 0x40, 0x81, 0x02, 0x04, 0x08, | |
| 2507 | + 0x10, 0x20, 0x40, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, | |
| 2508 | + 0x42, 0x3C, 0x81, 0x81, 0x42, 0x42, 0x42, 0x24, 0x24, 0x24, 0x38, 0x18, | |
| 2509 | + 0x18, 0x86, 0x18, 0x61, 0x86, 0x14, 0xD2, 0x4D, 0x24, 0x92, 0x49, 0x25, | |
| 2510 | + 0x8A, 0x38, 0xC3, 0x0C, 0x30, 0xC0, 0x43, 0x62, 0x24, 0x34, 0x18, 0x18, | |
| 2511 | + 0x1C, 0x24, 0x26, 0x42, 0x43, 0x82, 0x89, 0x13, 0x62, 0x85, 0x04, 0x08, | |
| 2512 | + 0x10, 0x20, 0x40, 0xFE, 0x08, 0x30, 0x41, 0x82, 0x08, 0x30, 0x41, 0x83, | |
| 2513 | + 0xF8, 0xF2, 0x49, 0x24, 0x92, 0x49, 0xC0, 0x81, 0x04, 0x10, 0x20, 0x82, | |
| 2514 | + 0x04, 0x10, 0x20, 0x82, 0x04, 0x00, 0xE4, 0x92, 0x49, 0x24, 0x93, 0xC0, | |
| 2515 | + 0x30, 0xC3, 0x12, 0x4A, 0x30, 0xFF, 0xCC, 0x78, 0x10, 0x4F, 0xC6, 0x18, | |
| 2516 | + 0xDD, 0x81, 0x02, 0x05, 0xEC, 0x50, 0x60, 0xC1, 0x83, 0x8A, 0xE0, 0x79, | |
| 2517 | + 0x08, 0x20, 0x82, 0x04, 0x1E, 0x04, 0x10, 0x5F, 0x46, 0x18, 0x61, 0x87, | |
| 2518 | + 0x37, 0x40, 0x39, 0x38, 0x7F, 0x82, 0x04, 0x0E, 0x34, 0x44, 0xE4, 0x44, | |
| 2519 | + 0x44, 0x44, 0x7F, 0x9A, 0x14, 0x2C, 0xCF, 0x20, 0x3E, 0x83, 0x07, 0x13, | |
| 2520 | + 0xC0, 0x82, 0x08, 0x2E, 0xC6, 0x18, 0x61, 0x86, 0x18, 0x40, 0xBF, 0xC0, | |
| 2521 | + 0x20, 0x92, 0x49, 0x24, 0x9E, 0x82, 0x08, 0x22, 0x9A, 0xCA, 0x34, 0x9A, | |
| 2522 | + 0x28, 0xC0, 0xAA, 0xAA, 0xAC, 0xB9, 0xD8, 0xC6, 0x10, 0xC2, 0x18, 0x43, | |
| 2523 | + 0x08, 0x61, 0x0C, 0x21, 0xBB, 0x18, 0x61, 0x86, 0x18, 0x61, 0x38, 0x8A, | |
| 2524 | + 0x0C, 0x18, 0x30, 0x51, 0x1C, 0xBD, 0x8A, 0x0C, 0x18, 0x30, 0x71, 0x5C, | |
| 2525 | + 0x81, 0x02, 0x00, 0x7D, 0x18, 0x61, 0x86, 0x1C, 0xDD, 0x04, 0x10, 0x40, | |
| 2526 | + 0xBC, 0x88, 0x88, 0x88, 0x74, 0x20, 0xC3, 0x86, 0x3E, 0x44, 0xF4, 0x44, | |
| 2527 | + 0x44, 0x43, 0x86, 0x18, 0x61, 0x86, 0x18, 0xDD, 0xC2, 0x8D, 0x13, 0x22, | |
| 2528 | + 0x45, 0x0E, 0x0C, 0x86, 0x30, 0xC5, 0x29, 0x25, 0x24, 0x94, 0x52, 0x8A, | |
| 2529 | + 0x61, 0x8C, 0x44, 0xC8, 0xA0, 0xC3, 0x85, 0x11, 0x23, 0xC2, 0x89, 0x11, | |
| 2530 | + 0x22, 0x87, 0x06, 0x08, 0x10, 0x61, 0x80, 0x7C, 0x30, 0x84, 0x30, 0x84, | |
| 2531 | + 0x3F, 0x69, 0x24, 0x94, 0x49, 0x24, 0xC0, 0xFF, 0xFF, 0xC9, 0x24, 0x91, | |
| 2532 | + 0x49, 0x25, 0x80, 0xE0, 0x70 }; | |
| 2533 | + | |
| 2534 | +const GFXglyph sourcesans8pt7bGlyphs[] PROGMEM = { | |
| 2535 | + { 0, 1, 1, 3, 0, 0 }, // 0x20 ' ' | |
| 2536 | + { 1, 1, 11, 5, 1, -10 }, // 0x21 '!' | |
| 2537 | + { 3, 4, 4, 7, 1, -10 }, // 0x22 '"' | |
| 2538 | + { 5, 8, 10, 8, 0, -9 }, // 0x23 '#' | |
| 2539 | + { 15, 6, 13, 8, 1, -11 }, // 0x24 '$' | |
| 2540 | + { 25, 12, 11, 13, 1, -10 }, // 0x25 '%' | |
| 2541 | + { 42, 8, 11, 10, 1, -10 }, // 0x26 '&' | |
| 2542 | + { 53, 1, 4, 4, 1, -10 }, // 0x27 ''' | |
| 2543 | + { 54, 3, 15, 5, 1, -11 }, // 0x28 '(' | |
| 2544 | + { 60, 3, 15, 5, 0, -11 }, // 0x29 ')' | |
| 2545 | + { 66, 5, 5, 7, 1, -11 }, // 0x2A '*' | |
| 2546 | + { 70, 5, 7, 8, 1, -8 }, // 0x2B '+' | |
| 2547 | + { 75, 2, 4, 4, 1, 0 }, // 0x2C ',' | |
| 2548 | + { 76, 3, 1, 5, 1, -4 }, // 0x2D '-' | |
| 2549 | + { 77, 1, 2, 4, 1, -1 }, // 0x2E '.' | |
| 2550 | + { 78, 5, 15, 6, 0, -11 }, // 0x2F '/' | |
| 2551 | + { 88, 6, 10, 8, 1, -9 }, // 0x30 '0' | |
| 2552 | + { 96, 5, 10, 8, 2, -9 }, // 0x31 '1' | |
| 2553 | + { 103, 7, 10, 8, 0, -9 }, // 0x32 '2' | |
| 2554 | + { 112, 6, 10, 8, 1, -9 }, // 0x33 '3' | |
| 2555 | + { 120, 6, 10, 8, 1, -9 }, // 0x34 '4' | |
| 2556 | + { 128, 6, 10, 8, 1, -9 }, // 0x35 '5' | |
| 2557 | + { 136, 6, 10, 8, 1, -9 }, // 0x36 '6' | |
| 2558 | + { 144, 6, 10, 8, 1, -9 }, // 0x37 '7' | |
| 2559 | + { 152, 6, 10, 8, 1, -9 }, // 0x38 '8' | |
| 2560 | + { 160, 6, 10, 8, 1, -9 }, // 0x39 '9' | |
| 2561 | + { 168, 1, 8, 4, 1, -7 }, // 0x3A ':' | |
| 2562 | + { 169, 1, 11, 4, 1, -7 }, // 0x3B ';' | |
| 2563 | + { 171, 6, 7, 8, 1, -8 }, // 0x3C '<' | |
| 2564 | + { 177, 6, 5, 8, 1, -7 }, // 0x3D '=' | |
| 2565 | + { 181, 6, 7, 8, 1, -8 }, // 0x3E '>' | |
| 2566 | + { 187, 5, 11, 7, 1, -10 }, // 0x3F '?' | |
| 2567 | + { 194, 12, 12, 14, 1, -9 }, // 0x40 '@' | |
| 2568 | + { 212, 8, 11, 9, 0, -10 }, // 0x41 'A' | |
| 2569 | + { 223, 7, 11, 9, 1, -10 }, // 0x42 'B' | |
| 2570 | + { 233, 7, 11, 9, 1, -10 }, // 0x43 'C' | |
| 2571 | + { 243, 8, 11, 10, 1, -10 }, // 0x44 'D' | |
| 2572 | + { 254, 6, 11, 8, 1, -10 }, // 0x45 'E' | |
| 2573 | + { 263, 6, 11, 8, 1, -10 }, // 0x46 'F' | |
| 2574 | + { 272, 8, 11, 10, 1, -10 }, // 0x47 'G' | |
| 2575 | + { 283, 8, 11, 10, 1, -10 }, // 0x48 'H' | |
| 2576 | + { 294, 1, 11, 4, 1, -10 }, // 0x49 'I' | |
| 2577 | + { 296, 5, 11, 8, 1, -10 }, // 0x4A 'J' | |
| 2578 | + { 303, 7, 11, 9, 1, -10 }, // 0x4B 'K' | |
| 2579 | + { 313, 5, 11, 8, 1, -10 }, // 0x4C 'L' | |
| 2580 | + { 320, 9, 11, 12, 1, -10 }, // 0x4D 'M' | |
| 2581 | + { 333, 8, 11, 10, 1, -10 }, // 0x4E 'N' | |
| 2582 | + { 344, 8, 11, 11, 1, -10 }, // 0x4F 'O' | |
| 2583 | + { 355, 7, 11, 9, 1, -10 }, // 0x50 'P' | |
| 2584 | + { 365, 8, 14, 11, 1, -10 }, // 0x51 'Q' | |
| 2585 | + { 379, 8, 11, 9, 1, -10 }, // 0x52 'R' | |
| 2586 | + { 390, 8, 11, 9, 0, -10 }, // 0x53 'S' | |
| 2587 | + { 401, 7, 11, 9, 1, -10 }, // 0x54 'T' | |
| 2588 | + { 411, 8, 11, 10, 1, -10 }, // 0x55 'U' | |
| 2589 | + { 422, 8, 11, 8, 0, -10 }, // 0x56 'V' | |
| 2590 | + { 433, 12, 11, 13, 0, -10 }, // 0x57 'W' | |
| 2591 | + { 450, 8, 11, 8, 0, -10 }, // 0x58 'X' | |
| 2592 | + { 461, 7, 11, 8, 0, -10 }, // 0x59 'Y' | |
| 2593 | + { 471, 7, 11, 9, 1, -10 }, // 0x5A 'Z' | |
| 2594 | + { 481, 3, 14, 5, 2, -11 }, // 0x5B '[' | |
| 2595 | + { 487, 6, 14, 6, 0, -10 }, // 0x5C '\' | |
| 2596 | + { 498, 3, 14, 5, 1, -11 }, // 0x5D ']' | |
| 2597 | + { 504, 6, 6, 8, 1, -10 }, // 0x5E '^' | |
| 2598 | + { 509, 8, 1, 8, 0, 2 }, // 0x5F '_' | |
| 2599 | + { 510, 3, 2, 9, 3, -10 }, // 0x60 '`' | |
| 2600 | + { 511, 6, 8, 8, 1, -7 }, // 0x61 'a' | |
| 2601 | + { 517, 7, 11, 9, 1, -10 }, // 0x62 'b' | |
| 2602 | + { 527, 6, 8, 7, 1, -7 }, // 0x63 'c' | |
| 2603 | + { 533, 6, 11, 9, 1, -10 }, // 0x64 'd' | |
| 2604 | + { 542, 6, 8, 8, 1, -7 }, // 0x65 'e' | |
| 2605 | + { 548, 4, 12, 5, 1, -11 }, // 0x66 'f' | |
| 2606 | + { 554, 7, 12, 8, 1, -7 }, // 0x67 'g' | |
| 2607 | + { 565, 6, 11, 9, 1, -10 }, // 0x68 'h' | |
| 2608 | + { 574, 1, 10, 4, 1, -9 }, // 0x69 'i' | |
| 2609 | + { 576, 3, 13, 4, -1, -9 }, // 0x6A 'j' | |
| 2610 | + { 581, 6, 11, 8, 1, -10 }, // 0x6B 'k' | |
| 2611 | + { 590, 2, 11, 4, 1, -10 }, // 0x6C 'l' | |
| 2612 | + { 593, 11, 8, 13, 1, -7 }, // 0x6D 'm' | |
| 2613 | + { 604, 6, 8, 9, 1, -7 }, // 0x6E 'n' | |
| 2614 | + { 610, 7, 8, 9, 1, -7 }, // 0x6F 'o' | |
| 2615 | + { 617, 7, 11, 9, 1, -7 }, // 0x70 'p' | |
| 2616 | + { 627, 6, 11, 9, 1, -7 }, // 0x71 'q' | |
| 2617 | + { 636, 4, 8, 6, 1, -7 }, // 0x72 'r' | |
| 2618 | + { 640, 5, 8, 7, 1, -7 }, // 0x73 's' | |
| 2619 | + { 645, 4, 10, 5, 1, -9 }, // 0x74 't' | |
| 2620 | + { 650, 6, 8, 9, 1, -7 }, // 0x75 'u' | |
| 2621 | + { 656, 7, 8, 7, 0, -7 }, // 0x76 'v' | |
| 2622 | + { 663, 11, 8, 11, 0, -7 }, // 0x77 'w' | |
| 2623 | + { 674, 7, 8, 7, 0, -7 }, // 0x78 'x' | |
| 2624 | + { 681, 7, 11, 7, 0, -7 }, // 0x79 'y' | |
| 2625 | + { 691, 6, 8, 7, 0, -7 }, // 0x7A 'z' | |
| 2626 | + { 697, 3, 14, 5, 1, -11 }, // 0x7B '{' | |
| 2627 | + { 703, 1, 16, 4, 1, -11 }, // 0x7C '|' | |
| 2628 | + { 705, 3, 14, 5, 1, -11 }, // 0x7D '}' | |
| 2629 | + { 711, 6, 2, 8, 1, -5 } }; // 0x7E '~' | |
| 2630 | + | |
| 2631 | +const GFXfont sourcesans8pt7b PROGMEM = { | |
| 2632 | + (uint8_t *)sourcesans8pt7bBitmaps, | |
| 2633 | + (GFXglyph *)sourcesans8pt7bGlyphs, | |
| 2634 | + 0x20, 0x7E, 21 }; | |
| 2635 | + | |
| 2636 | + | |
| 2637 | +const uint8_t sourcesans10pt7bBitmaps[] PROGMEM = { | |
| 2638 | + 0x00, 0xFF, 0xFF, 0xCF, 0xC0, 0xDE, 0xF7, 0xBD, 0x80, 0x22, 0x22, 0xFF, | |
| 2639 | + 0xFF, 0x22, 0x22, 0xFF, 0xFF, 0x44, 0x44, 0x44, 0x44, 0x30, 0x61, 0xF6, | |
| 2640 | + 0x2C, 0x18, 0x38, 0x38, 0x1C, 0x1C, 0x18, 0x38, 0xFF, 0x9E, 0x18, 0x78, | |
| 2641 | + 0x10, 0xFC, 0x20, 0xCC, 0x20, 0xCC, 0x40, 0xCC, 0x9C, 0xCC, 0xBE, 0xCD, | |
| 2642 | + 0x77, 0x7A, 0x63, 0x32, 0x63, 0x04, 0x63, 0x08, 0x63, 0x08, 0x7F, 0x10, | |
| 2643 | + 0x3E, 0x1E, 0x03, 0xE0, 0xCC, 0x19, 0x83, 0x60, 0x38, 0x0E, 0x1B, 0x62, | |
| 2644 | + 0xC6, 0xD8, 0x73, 0x8F, 0x3F, 0xB3, 0xC2, 0xFF, 0xC0, 0x11, 0x22, 0x64, | |
| 2645 | + 0xCC, 0xCC, 0xCC, 0xC4, 0x62, 0x21, 0x00, 0x88, 0x44, 0x62, 0x33, 0x33, | |
| 2646 | + 0x33, 0x32, 0x64, 0x48, 0x00, 0x10, 0x21, 0xF1, 0xC2, 0x88, 0x80, 0x30, | |
| 2647 | + 0xC3, 0x3F, 0xFC, 0xC3, 0x0C, 0x33, 0x36, 0xC0, 0xFF, 0xFC, 0x00, 0x03, | |
| 2648 | + 0x06, 0x06, 0x06, 0x0C, 0x0C, 0x0C, 0x18, 0x18, 0x18, 0x30, 0x30, 0x30, | |
| 2649 | + 0x60, 0x60, 0x60, 0xC0, 0x00, 0x3C, 0x7E, 0x66, 0xC3, 0xC3, 0xC3, 0xC3, | |
| 2650 | + 0xC3, 0xC3, 0xC3, 0xC3, 0x66, 0x7E, 0x3C, 0x71, 0xC3, 0x0C, 0x30, 0xC3, | |
| 2651 | + 0x0C, 0x30, 0xC3, 0x3F, 0xFC, 0x3C, 0x3F, 0x31, 0xC0, 0x60, 0x30, 0x18, | |
| 2652 | + 0x0C, 0x0C, 0x06, 0x06, 0x06, 0x06, 0x03, 0x03, 0xFC, 0x1E, 0x1F, 0x98, | |
| 2653 | + 0xE0, 0x30, 0x18, 0x1C, 0x38, 0x1E, 0x03, 0x80, 0xC0, 0x60, 0x3C, 0x31, | |
| 2654 | + 0xF0, 0x06, 0x0E, 0x16, 0x16, 0x26, 0x46, 0x86, 0xFF, 0xFF, 0x06, 0x06, | |
| 2655 | + 0x06, 0x06, 0x3F, 0x18, 0x0C, 0x07, 0xC3, 0xF1, 0x1C, 0x06, 0x03, 0x01, | |
| 2656 | + 0x80, 0xF0, 0xC7, 0x80, 0x1F, 0x18, 0x98, 0x18, 0x0C, 0xE6, 0xFB, 0x8F, | |
| 2657 | + 0x83, 0xC1, 0xF0, 0xD8, 0xEF, 0xE1, 0xE0, 0xFE, 0x0C, 0x10, 0x60, 0x83, | |
| 2658 | + 0x06, 0x08, 0x30, 0x60, 0xC1, 0x80, 0x1C, 0x3E, 0x63, 0x63, 0x63, 0x32, | |
| 2659 | + 0x1C, 0x2E, 0xC3, 0xC3, 0xC3, 0xE3, 0x7E, 0x3C, 0x3C, 0x7E, 0xE6, 0xC3, | |
| 2660 | + 0xC3, 0xC3, 0xE7, 0x7F, 0x3B, 0x03, 0x02, 0x06, 0x44, 0x78, 0xFC, 0x03, | |
| 2661 | + 0xF0, 0xFC, 0x00, 0xFF, 0x80, 0x00, 0x07, 0x1C, 0xF0, 0xC0, 0x70, 0x1E, | |
| 2662 | + 0x03, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0xE0, 0x38, 0x0F, 0x03, | |
| 2663 | + 0x0E, 0x70, 0xC0, 0x7D, 0x0C, 0x18, 0x30, 0xC3, 0x04, 0x18, 0x00, 0x00, | |
| 2664 | + 0xC1, 0x83, 0x00, 0x03, 0xF0, 0x0F, 0xF8, 0x1C, 0x1C, 0x38, 0x06, 0x70, | |
| 2665 | + 0x06, 0x63, 0x83, 0xE7, 0xA3, 0xC6, 0x63, 0xCC, 0x63, 0xCC, 0x63, 0xCC, | |
| 2666 | + 0x66, 0xCF, 0xFE, 0xE7, 0x38, 0x70, 0x00, 0x38, 0x00, 0x1F, 0xE0, 0x07, | |
| 2667 | + 0xC0, 0x0E, 0x01, 0x40, 0x28, 0x0D, 0x81, 0xB0, 0x22, 0x0C, 0x61, 0x8C, | |
| 2668 | + 0x3F, 0x8F, 0xF9, 0x83, 0x30, 0x6C, 0x06, 0xFC, 0x7F, 0xB0, 0xD8, 0x6C, | |
| 2669 | + 0x37, 0xE3, 0xFD, 0x87, 0xC1, 0xE0, 0xF0, 0xFF, 0xEF, 0xE0, 0x0F, 0x0F, | |
| 2670 | + 0xE7, 0x09, 0x80, 0xC0, 0x30, 0x0C, 0x03, 0x00, 0xC0, 0x18, 0x07, 0x0C, | |
| 2671 | + 0xFE, 0x0F, 0x00, 0xFE, 0x3F, 0xCC, 0x3B, 0x07, 0xC0, 0xF0, 0x3C, 0x0F, | |
| 2672 | + 0x03, 0xC0, 0xF0, 0x6C, 0x3B, 0xFC, 0xFC, 0x00, 0xFF, 0x83, 0x06, 0x0C, | |
| 2673 | + 0x18, 0x3F, 0x60, 0xC1, 0x83, 0x06, 0x0F, 0xE0, 0xFF, 0x83, 0x06, 0x0C, | |
| 2674 | + 0x18, 0x3F, 0x60, 0xC1, 0x83, 0x06, 0x0C, 0x00, 0x1F, 0x0F, 0xE7, 0x0B, | |
| 2675 | + 0x80, 0xC0, 0x30, 0x0C, 0x3F, 0x03, 0xC0, 0xD8, 0x37, 0x0C, 0xFF, 0x1F, | |
| 2676 | + 0x00, 0xC0, 0xF0, 0x3C, 0x0F, 0x03, 0xC0, 0xFF, 0xFF, 0xFF, 0x03, 0xC0, | |
| 2677 | + 0xF0, 0x3C, 0x0F, 0x03, 0xC0, 0xC0, 0xFF, 0xFF, 0xFF, 0xC0, 0x03, 0x03, | |
| 2678 | + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0xC7, 0x7E, 0x3C, 0xC1, | |
| 2679 | + 0xB0, 0xCC, 0x63, 0x18, 0xCC, 0x37, 0x0F, 0xC3, 0x98, 0xC2, 0x30, 0xCC, | |
| 2680 | + 0x1B, 0x06, 0xC0, 0xC0, 0xC1, 0x83, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC1, | |
| 2681 | + 0x83, 0x06, 0x0F, 0xE0, 0xE0, 0xFC, 0x1F, 0x83, 0xF8, 0x7D, 0x17, 0xA2, | |
| 2682 | + 0xF4, 0x5E, 0x53, 0xCA, 0x79, 0x4F, 0x11, 0xE2, 0x3C, 0x06, 0xC0, 0xF8, | |
| 2683 | + 0x3F, 0x0F, 0x43, 0xD8, 0xF2, 0x3C, 0xCF, 0x13, 0xC6, 0xF0, 0xBC, 0x3F, | |
| 2684 | + 0x07, 0xC0, 0xC0, 0x1F, 0x83, 0xFC, 0x70, 0xE6, 0x06, 0xC0, 0x3C, 0x03, | |
| 2685 | + 0xC0, 0x3C, 0x03, 0xC0, 0x36, 0x06, 0x70, 0xE3, 0xFC, 0x1F, 0x80, 0xFE, | |
| 2686 | + 0x7F, 0xB0, 0xF8, 0x3C, 0x1E, 0x1F, 0xF9, 0x80, 0xC0, 0x60, 0x30, 0x18, | |
| 2687 | + 0x0C, 0x00, 0x0F, 0x03, 0xFC, 0x70, 0xE6, 0x06, 0xC0, 0x3C, 0x03, 0xC0, | |
| 2688 | + 0x3C, 0x03, 0xC0, 0x3C, 0x03, 0x60, 0x67, 0x0E, 0x1F, 0x80, 0x60, 0x03, | |
| 2689 | + 0x00, 0x1F, 0xFE, 0x7F, 0xB0, 0xF8, 0x3C, 0x1E, 0x1B, 0xF9, 0x98, 0xC6, | |
| 2690 | + 0x63, 0x30, 0xD8, 0x6C, 0x18, 0x1F, 0x0F, 0xE7, 0x09, 0x80, 0x60, 0x0E, | |
| 2691 | + 0x00, 0xF0, 0x0E, 0x00, 0xC0, 0x36, 0x1D, 0xFE, 0x1F, 0x00, 0xFF, 0x18, | |
| 2692 | + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xC0, | |
| 2693 | + 0xF0, 0x3C, 0x0F, 0x03, 0xC0, 0xF0, 0x3C, 0x0F, 0x03, 0xC0, 0xF0, 0x36, | |
| 2694 | + 0x19, 0xFE, 0x3F, 0x00, 0xC0, 0x68, 0x0D, 0x83, 0x30, 0x62, 0x0C, 0x63, | |
| 2695 | + 0x0C, 0x60, 0x8C, 0x19, 0x03, 0x60, 0x2C, 0x07, 0x00, 0xE0, 0xC1, 0x03, | |
| 2696 | + 0xC1, 0x83, 0x43, 0x86, 0x62, 0x86, 0x62, 0x86, 0x62, 0x46, 0x66, 0x4C, | |
| 2697 | + 0x24, 0x4C, 0x34, 0x4C, 0x34, 0x2C, 0x3C, 0x38, 0x38, 0x38, 0x18, 0x38, | |
| 2698 | + 0x60, 0x98, 0x63, 0x10, 0x4C, 0x1A, 0x03, 0x80, 0xC0, 0x78, 0x12, 0x0C, | |
| 2699 | + 0xC2, 0x19, 0x86, 0x40, 0xC0, 0xC0, 0xD8, 0x26, 0x18, 0x84, 0x33, 0x04, | |
| 2700 | + 0x81, 0xE0, 0x30, 0x0C, 0x03, 0x00, 0xC0, 0x30, 0x0C, 0x00, 0x7F, 0x81, | |
| 2701 | + 0x80, 0xC0, 0xC0, 0x60, 0x60, 0x60, 0x30, 0x30, 0x10, 0x18, 0x18, 0x0F, | |
| 2702 | + 0xF8, 0xFB, 0x6D, 0xB6, 0xDB, 0x6D, 0xB6, 0xE0, 0x80, 0x80, 0x40, 0x40, | |
| 2703 | + 0x20, 0x20, 0x10, 0x10, 0x10, 0x08, 0x08, 0x04, 0x04, 0x04, 0x02, 0x02, | |
| 2704 | + 0x01, 0xED, 0xB6, 0xDB, 0x6D, 0xB6, 0xDB, 0xE0, 0x18, 0x38, 0x24, 0x24, | |
| 2705 | + 0x66, 0x42, 0x42, 0xFF, 0xFF, 0xF0, 0xC8, 0x80, 0x3C, 0x7E, 0x03, 0x1F, | |
| 2706 | + 0x7F, 0xE3, 0xC3, 0xC7, 0xFF, 0x7B, 0xC0, 0xC0, 0xC0, 0xC0, 0xDC, 0xE6, | |
| 2707 | + 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xE6, 0xFC, 0x1E, 0x3F, 0x60, 0xC0, | |
| 2708 | + 0xC0, 0xC0, 0xC0, 0xC0, 0x61, 0x1E, 0x01, 0x80, 0xC0, 0x60, 0x33, 0xFB, | |
| 2709 | + 0x1D, 0x87, 0x83, 0xC1, 0xE0, 0xF0, 0x78, 0x36, 0x39, 0xEC, 0x3E, 0x3F, | |
| 2710 | + 0xB0, 0x7F, 0xFF, 0xFE, 0x03, 0x00, 0xC2, 0x7F, 0x0F, 0x00, 0x3D, 0xF6, | |
| 2711 | + 0x18, 0x63, 0xCF, 0x18, 0x61, 0x86, 0x18, 0x61, 0x86, 0x00, 0x3F, 0x9F, | |
| 2712 | + 0xEE, 0x63, 0x0C, 0xC3, 0x39, 0xC7, 0xE3, 0x70, 0xFF, 0x9F, 0xFC, 0x0F, | |
| 2713 | + 0x07, 0xFF, 0x9F, 0x80, 0xC0, 0xC0, 0xC0, 0xC0, 0xDE, 0xE3, 0xC3, 0xC3, | |
| 2714 | + 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xF0, 0xFF, 0xFF, 0xF0, 0x33, 0x00, | |
| 2715 | + 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0xFE, 0xC0, 0xC0, 0xC0, 0xC0, 0xC3, | |
| 2716 | + 0xC6, 0xCC, 0xD8, 0xD8, 0xFC, 0xE4, 0xC6, 0xC3, 0xC3, 0xDB, 0x6D, 0xB6, | |
| 2717 | + 0xDB, 0x6C, 0xC0, 0xDE, 0x77, 0x3C, 0xF0, 0xC7, 0x86, 0x3C, 0x31, 0xE1, | |
| 2718 | + 0x8F, 0x0C, 0x78, 0x63, 0xC3, 0x1E, 0x18, 0xC0, 0xDE, 0xE3, 0xC3, 0xC3, | |
| 2719 | + 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0x1C, 0x3F, 0x98, 0xD8, 0x3C, 0x1E, | |
| 2720 | + 0x0F, 0x07, 0x83, 0x63, 0x1F, 0x00, 0xDC, 0xE6, 0xC3, 0xC3, 0xC3, 0xC3, | |
| 2721 | + 0xC3, 0xC3, 0xE6, 0xFC, 0xC0, 0xC0, 0xC0, 0xC0, 0x3D, 0xB1, 0xD8, 0x78, | |
| 2722 | + 0x3C, 0x1E, 0x0F, 0x07, 0x83, 0x63, 0x9E, 0xC0, 0x60, 0x30, 0x18, 0x0C, | |
| 2723 | + 0xDF, 0xEE, 0x30, 0xC3, 0x0C, 0x30, 0xC3, 0x00, 0x79, 0xFB, 0x16, 0x07, | |
| 2724 | + 0x03, 0x81, 0xC3, 0xFC, 0xF0, 0x61, 0x8F, 0xBE, 0x61, 0x86, 0x18, 0x61, | |
| 2725 | + 0x87, 0xCF, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC7, 0x7B, | |
| 2726 | + 0xC1, 0xA0, 0xD8, 0x4C, 0x62, 0x31, 0x90, 0x58, 0x2C, 0x1C, 0x06, 0x00, | |
| 2727 | + 0xC7, 0x0F, 0x1C, 0x36, 0x78, 0x99, 0xA6, 0x66, 0x98, 0x9A, 0x43, 0x6D, | |
| 2728 | + 0x0F, 0x14, 0x3C, 0x60, 0x71, 0x80, 0x63, 0x31, 0x8D, 0x82, 0x81, 0xC0, | |
| 2729 | + 0xE0, 0xD0, 0x4C, 0x63, 0x20, 0x80, 0xC1, 0xE0, 0x90, 0xCC, 0x62, 0x21, | |
| 2730 | + 0x30, 0xD8, 0x28, 0x1C, 0x0E, 0x06, 0x07, 0x0F, 0x07, 0x00, 0xFF, 0xFC, | |
| 2731 | + 0x30, 0x41, 0x06, 0x18, 0x20, 0xFF, 0xFC, 0x19, 0x8C, 0x63, 0x18, 0xDC, | |
| 2732 | + 0xE1, 0x8C, 0x63, 0x18, 0xC6, 0x18, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC3, | |
| 2733 | + 0x18, 0xC6, 0x31, 0x87, 0x3B, 0x18, 0xC6, 0x31, 0x8C, 0xC0, 0x60, 0xF1, | |
| 2734 | + 0x8F, 0x06 }; | |
| 2735 | + | |
| 2736 | +const GFXglyph sourcesans10pt7bGlyphs[] PROGMEM = { | |
| 2737 | + { 0, 1, 1, 4, 0, 0 }, // 0x20 ' ' | |
| 2738 | + { 1, 2, 13, 6, 2, -12 }, // 0x21 '!' | |
| 2739 | + { 5, 5, 5, 9, 2, -13 }, // 0x22 '"' | |
| 2740 | + { 9, 8, 12, 10, 1, -11 }, // 0x23 '#' | |
| 2741 | + { 21, 7, 16, 10, 2, -14 }, // 0x24 '$' | |
| 2742 | + { 35, 16, 13, 16, 1, -12 }, // 0x25 '%' | |
| 2743 | + { 61, 11, 13, 12, 1, -12 }, // 0x26 '&' | |
| 2744 | + { 79, 2, 5, 5, 2, -13 }, // 0x27 ''' | |
| 2745 | + { 81, 4, 19, 6, 2, -14 }, // 0x28 '(' | |
| 2746 | + { 91, 4, 19, 6, 1, -14 }, // 0x29 ')' | |
| 2747 | + { 101, 7, 6, 8, 1, -13 }, // 0x2A '*' | |
| 2748 | + { 107, 6, 8, 10, 2, -10 }, // 0x2B '+' | |
| 2749 | + { 113, 4, 5, 5, 1, -1 }, // 0x2C ',' | |
| 2750 | + { 116, 4, 2, 6, 1, -5 }, // 0x2D '-' | |
| 2751 | + { 117, 2, 3, 5, 1, -2 }, // 0x2E '.' | |
| 2752 | + { 118, 8, 19, 7, 0, -14 }, // 0x2F '/' | |
| 2753 | + { 137, 8, 14, 10, 1, -13 }, // 0x30 '0' | |
| 2754 | + { 151, 6, 13, 10, 3, -12 }, // 0x31 '1' | |
| 2755 | + { 161, 9, 14, 10, 1, -13 }, // 0x32 '2' | |
| 2756 | + { 177, 9, 14, 10, 0, -13 }, // 0x33 '3' | |
| 2757 | + { 193, 8, 13, 10, 1, -12 }, // 0x34 '4' | |
| 2758 | + { 206, 9, 12, 10, 0, -11 }, // 0x35 '5' | |
| 2759 | + { 220, 9, 13, 10, 1, -12 }, // 0x36 '6' | |
| 2760 | + { 235, 7, 12, 10, 2, -11 }, // 0x37 '7' | |
| 2761 | + { 246, 8, 14, 10, 1, -13 }, // 0x38 '8' | |
| 2762 | + { 260, 8, 14, 10, 1, -13 }, // 0x39 '9' | |
| 2763 | + { 274, 2, 10, 5, 1, -9 }, // 0x3A ':' | |
| 2764 | + { 277, 2, 13, 4, 1, -9 }, // 0x3B ';' | |
| 2765 | + { 281, 8, 8, 10, 1, -10 }, // 0x3C '<' | |
| 2766 | + { 289, 8, 6, 10, 1, -9 }, // 0x3D '=' | |
| 2767 | + { 295, 8, 8, 10, 1, -10 }, // 0x3E '>' | |
| 2768 | + { 303, 7, 13, 8, 1, -12 }, // 0x3F '?' | |
| 2769 | + { 315, 16, 17, 17, 1, -13 }, // 0x40 '@' | |
| 2770 | + { 349, 11, 13, 11, 0, -12 }, // 0x41 'A' | |
| 2771 | + { 367, 9, 13, 12, 2, -12 }, // 0x42 'B' | |
| 2772 | + { 382, 10, 13, 11, 1, -12 }, // 0x43 'C' | |
| 2773 | + { 399, 10, 13, 12, 2, -12 }, // 0x44 'D' | |
| 2774 | + { 416, 7, 13, 11, 2, -12 }, // 0x45 'E' | |
| 2775 | + { 428, 7, 13, 10, 2, -12 }, // 0x46 'F' | |
| 2776 | + { 440, 10, 13, 12, 1, -12 }, // 0x47 'G' | |
| 2777 | + { 457, 10, 13, 13, 2, -12 }, // 0x48 'H' | |
| 2778 | + { 474, 2, 13, 5, 2, -12 }, // 0x49 'I' | |
| 2779 | + { 478, 8, 13, 10, 0, -12 }, // 0x4A 'J' | |
| 2780 | + { 491, 10, 13, 12, 2, -12 }, // 0x4B 'K' | |
| 2781 | + { 508, 7, 13, 10, 2, -12 }, // 0x4C 'L' | |
| 2782 | + { 520, 11, 13, 15, 2, -12 }, // 0x4D 'M' | |
| 2783 | + { 538, 10, 13, 13, 2, -12 }, // 0x4E 'N' | |
| 2784 | + { 555, 12, 13, 13, 1, -12 }, // 0x4F 'O' | |
| 2785 | + { 575, 9, 13, 12, 2, -12 }, // 0x50 'P' | |
| 2786 | + { 590, 12, 16, 13, 1, -12 }, // 0x51 'Q' | |
| 2787 | + { 614, 9, 13, 12, 2, -12 }, // 0x52 'R' | |
| 2788 | + { 629, 10, 13, 11, 0, -12 }, // 0x53 'S' | |
| 2789 | + { 646, 8, 13, 11, 2, -12 }, // 0x54 'T' | |
| 2790 | + { 659, 10, 13, 13, 2, -12 }, // 0x55 'U' | |
| 2791 | + { 676, 11, 13, 10, 0, -12 }, // 0x56 'V' | |
| 2792 | + { 694, 16, 13, 16, 0, -12 }, // 0x57 'W' | |
| 2793 | + { 720, 10, 13, 10, 0, -12 }, // 0x58 'X' | |
| 2794 | + { 737, 10, 13, 10, 0, -12 }, // 0x59 'Y' | |
| 2795 | + { 754, 9, 13, 11, 1, -12 }, // 0x5A 'Z' | |
| 2796 | + { 769, 3, 17, 6, 2, -13 }, // 0x5B '[' | |
| 2797 | + { 776, 8, 17, 7, 0, -13 }, // 0x5C '\' | |
| 2798 | + { 793, 3, 17, 6, 1, -13 }, // 0x5D ']' | |
| 2799 | + { 800, 8, 7, 10, 1, -12 }, // 0x5E '^' | |
| 2800 | + { 807, 10, 2, 10, 0, 2 }, // 0x5F '_' | |
| 2801 | + { 810, 3, 3, 11, 3, -13 }, // 0x60 '`' | |
| 2802 | + { 812, 8, 10, 10, 1, -9 }, // 0x61 'a' | |
| 2803 | + { 822, 8, 14, 11, 2, -13 }, // 0x62 'b' | |
| 2804 | + { 836, 8, 10, 9, 1, -9 }, // 0x63 'c' | |
| 2805 | + { 846, 9, 14, 11, 1, -13 }, // 0x64 'd' | |
| 2806 | + { 862, 9, 10, 10, 1, -9 }, // 0x65 'e' | |
| 2807 | + { 874, 6, 15, 6, 1, -14 }, // 0x66 'f' | |
| 2808 | + { 886, 10, 14, 10, 1, -9 }, // 0x67 'g' | |
| 2809 | + { 904, 8, 14, 11, 2, -13 }, // 0x68 'h' | |
| 2810 | + { 918, 2, 14, 5, 1, -13 }, // 0x69 'i' | |
| 2811 | + { 922, 4, 18, 5, 0, -13 }, // 0x6A 'j' | |
| 2812 | + { 931, 8, 14, 10, 2, -13 }, // 0x6B 'k' | |
| 2813 | + { 945, 3, 14, 5, 2, -13 }, // 0x6C 'l' | |
| 2814 | + { 951, 13, 10, 17, 2, -9 }, // 0x6D 'm' | |
| 2815 | + { 968, 8, 10, 11, 2, -9 }, // 0x6E 'n' | |
| 2816 | + { 978, 9, 10, 11, 1, -9 }, // 0x6F 'o' | |
| 2817 | + { 990, 8, 14, 11, 2, -9 }, // 0x70 'p' | |
| 2818 | + { 1004, 9, 14, 11, 1, -9 }, // 0x71 'q' | |
| 2819 | + { 1020, 6, 10, 7, 2, -9 }, // 0x72 'r' | |
| 2820 | + { 1028, 7, 10, 8, 1, -9 }, // 0x73 's' | |
| 2821 | + { 1037, 6, 12, 7, 1, -11 }, // 0x74 't' | |
| 2822 | + { 1046, 8, 10, 11, 2, -9 }, // 0x75 'u' | |
| 2823 | + { 1056, 9, 10, 9, 0, -9 }, // 0x76 'v' | |
| 2824 | + { 1068, 14, 10, 14, 0, -9 }, // 0x77 'w' | |
| 2825 | + { 1086, 9, 10, 9, 0, -9 }, // 0x78 'x' | |
| 2826 | + { 1098, 9, 14, 9, 1, -9 }, // 0x79 'y' | |
| 2827 | + { 1114, 7, 10, 8, 1, -9 }, // 0x7A 'z' | |
| 2828 | + { 1123, 5, 17, 6, 0, -13 }, // 0x7B '{' | |
| 2829 | + { 1134, 2, 20, 5, 2, -14 }, // 0x7C '|' | |
| 2830 | + { 1139, 5, 17, 6, 2, -13 }, // 0x7D '}' | |
| 2831 | + { 1150, 8, 4, 10, 1, -8 } }; // 0x7E '~' | |
| 2832 | + | |
| 2833 | +const GFXfont sourcesans10pt7b PROGMEM = { | |
| 2834 | + (uint8_t *)sourcesans10pt7bBitmaps, | |
| 2835 | + (GFXglyph *)sourcesans10pt7bGlyphs, | |
| 2836 | + 0x20, 0x7E, 26 }; | |
| 2837 | + | |
| 2838 | +const uint8_t sourcesans9pt7bBitmaps[] PROGMEM = { | |
| 2839 | + 0x00, 0xFF, 0xFF, 0x0F, 0xDE, 0xF7, 0xBD, 0x80, 0x24, 0x48, 0x97, 0xF2, | |
| 2840 | + 0x4D, 0xBF, 0xA4, 0x48, 0x91, 0x20, 0x18, 0x31, 0xF7, 0x2C, 0x18, 0x18, | |
| 2841 | + 0x0C, 0x0E, 0x0C, 0x1C, 0x37, 0xC3, 0x00, 0x78, 0x43, 0x21, 0x0C, 0xC8, | |
| 2842 | + 0x33, 0x20, 0xCD, 0x03, 0x35, 0xE7, 0xAC, 0xC1, 0x33, 0x04, 0xCC, 0x23, | |
| 2843 | + 0x30, 0x84, 0x84, 0x1E, 0x1E, 0x06, 0x60, 0xCC, 0x19, 0x81, 0x60, 0x30, | |
| 2844 | + 0x1E, 0x1F, 0x22, 0xC2, 0xD8, 0x71, 0x8F, 0x1F, 0x30, 0xFF, 0xC0, 0x12, | |
| 2845 | + 0x26, 0x4C, 0xCC, 0xCC, 0xC4, 0x62, 0x21, 0x84, 0x46, 0x23, 0x33, 0x33, | |
| 2846 | + 0x32, 0x64, 0x48, 0x21, 0x3E, 0xED, 0x80, 0x30, 0xC3, 0x3F, 0x30, 0xC3, | |
| 2847 | + 0x00, 0x33, 0x64, 0xF0, 0xF0, 0x00, 0x08, 0x10, 0x20, 0x81, 0x02, 0x08, | |
| 2848 | + 0x10, 0x40, 0x81, 0x04, 0x08, 0x20, 0x00, 0x3C, 0x66, 0x42, 0xC3, 0xC3, | |
| 2849 | + 0xC3, 0xC3, 0xC3, 0xC3, 0x42, 0x66, 0x3C, 0x71, 0x8C, 0x63, 0x18, 0xC6, | |
| 2850 | + 0x31, 0xBE, 0x78, 0x8C, 0x06, 0x06, 0x06, 0x06, 0x0C, 0x0C, 0x18, 0x30, | |
| 2851 | + 0x20, 0x7F, 0x3C, 0x66, 0x03, 0x03, 0x03, 0x06, 0x0C, 0x03, 0x03, 0x03, | |
| 2852 | + 0xC6, 0x7C, 0x0C, 0x18, 0xF1, 0x64, 0xD1, 0xA3, 0x7F, 0x0C, 0x18, 0x30, | |
| 2853 | + 0x7E, 0x60, 0x60, 0x40, 0xFC, 0x46, 0x03, 0x03, 0x03, 0xC6, 0x7C, 0x3E, | |
| 2854 | + 0x62, 0x60, 0xC0, 0xDC, 0xE7, 0xC3, 0xC3, 0x43, 0x66, 0x3C, 0xFC, 0x21, | |
| 2855 | + 0x84, 0x30, 0xC2, 0x18, 0x61, 0x86, 0x00, 0x3E, 0x63, 0x63, 0x63, 0x32, | |
| 2856 | + 0x1C, 0x2E, 0xC3, 0xC3, 0xC3, 0x63, 0x3C, 0x3C, 0x66, 0xC6, 0xC3, 0xC3, | |
| 2857 | + 0xC3, 0x67, 0x3B, 0x03, 0x06, 0x46, 0x7C, 0xF0, 0x0F, 0xF0, 0x03, 0xF8, | |
| 2858 | + 0x00, 0x0C, 0xE6, 0x0C, 0x07, 0x03, 0x80, 0xFE, 0x00, 0x00, 0x0F, 0xE0, | |
| 2859 | + 0x01, 0x80, 0xE0, 0x30, 0x67, 0x38, 0x00, 0x7B, 0x30, 0xC3, 0x08, 0x41, | |
| 2860 | + 0x0C, 0x00, 0x03, 0x0C, 0x07, 0xC0, 0x60, 0xC3, 0x01, 0x98, 0x07, 0x67, | |
| 2861 | + 0x0F, 0x32, 0x3D, 0x88, 0xF6, 0x23, 0xD8, 0x8B, 0x66, 0x6C, 0xEF, 0x18, | |
| 2862 | + 0x00, 0x60, 0x00, 0xE0, 0x00, 0xF8, 0x00, 0x0C, 0x03, 0x01, 0xE0, 0x48, | |
| 2863 | + 0x12, 0x0C, 0xC3, 0x30, 0xFC, 0x61, 0x98, 0x64, 0x0B, 0x03, 0xFC, 0xC6, | |
| 2864 | + 0xC6, 0xC6, 0xC4, 0xF8, 0xC6, 0xC3, 0xC3, 0xC3, 0xC6, 0xFC, 0x1F, 0x18, | |
| 2865 | + 0xD8, 0x08, 0x0C, 0x06, 0x03, 0x01, 0x80, 0xC0, 0x30, 0x0C, 0x63, 0xE0, | |
| 2866 | + 0xFC, 0x63, 0x30, 0xD8, 0x3C, 0x1E, 0x0F, 0x07, 0x83, 0xC1, 0xE1, 0xB1, | |
| 2867 | + 0x9F, 0x80, 0xFF, 0x0C, 0x30, 0xC3, 0xEC, 0x30, 0xC3, 0x0C, 0x3F, 0xFF, | |
| 2868 | + 0x0C, 0x30, 0xC3, 0x0F, 0xF0, 0xC3, 0x0C, 0x30, 0x1F, 0x8C, 0x26, 0x03, | |
| 2869 | + 0x00, 0xC0, 0x30, 0x0C, 0x1F, 0x03, 0xC0, 0xD8, 0x33, 0x0C, 0x7E, 0xC1, | |
| 2870 | + 0xE0, 0xF0, 0x78, 0x3C, 0x1F, 0xFF, 0x07, 0x83, 0xC1, 0xE0, 0xF0, 0x78, | |
| 2871 | + 0x30, 0xFF, 0xFF, 0xFF, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0x83, 0x06, | |
| 2872 | + 0x0F, 0x33, 0xC0, 0xC1, 0x61, 0x31, 0x99, 0x8D, 0x87, 0xE3, 0xB1, 0xCC, | |
| 2873 | + 0xC2, 0x61, 0xB0, 0x58, 0x30, 0xC3, 0x0C, 0x30, 0xC3, 0x0C, 0x30, 0xC3, | |
| 2874 | + 0x0C, 0x3F, 0xC0, 0xF8, 0x7E, 0x1F, 0x87, 0xD2, 0xF4, 0xBD, 0x2F, 0x33, | |
| 2875 | + 0xCC, 0xF3, 0x3C, 0x0F, 0x03, 0xC1, 0xF0, 0xF8, 0x7A, 0x3D, 0x1E, 0x4F, | |
| 2876 | + 0x27, 0x8B, 0xC5, 0xE1, 0xF0, 0xF8, 0x30, 0x1E, 0x1C, 0xE6, 0x1B, 0x03, | |
| 2877 | + 0xC0, 0xF0, 0x3C, 0x0F, 0x03, 0xC0, 0xD8, 0x63, 0x30, 0x78, 0xFC, 0xC7, | |
| 2878 | + 0xC3, 0xC3, 0xC3, 0xC6, 0xFC, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x1E, 0x1C, | |
| 2879 | + 0xE6, 0x1B, 0x03, 0xC0, 0xF0, 0x3C, 0x0F, 0x03, 0xC0, 0xD8, 0x66, 0x18, | |
| 2880 | + 0xFC, 0x0C, 0x01, 0x80, 0x3C, 0xFC, 0xC7, 0xC3, 0xC3, 0xC3, 0xC6, 0xFC, | |
| 2881 | + 0xC8, 0xCC, 0xC6, 0xC6, 0xC3, 0x3C, 0xE2, 0xC0, 0xC0, 0x60, 0x38, 0x0E, | |
| 2882 | + 0x07, 0x03, 0x03, 0xC6, 0x7C, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, | |
| 2883 | + 0x18, 0x18, 0x18, 0x18, 0x18, 0xC1, 0xE0, 0xF0, 0x78, 0x3C, 0x1E, 0x0F, | |
| 2884 | + 0x07, 0x83, 0xC1, 0xE0, 0xD8, 0xC7, 0xC0, 0xC0, 0xD0, 0x36, 0x19, 0x86, | |
| 2885 | + 0x21, 0x8C, 0xC3, 0x30, 0x4C, 0x16, 0x07, 0x80, 0xE0, 0x30, 0xC3, 0x0F, | |
| 2886 | + 0x0C, 0x34, 0x30, 0x99, 0xC6, 0x64, 0x99, 0x92, 0x66, 0x49, 0x09, 0x24, | |
| 2887 | + 0x38, 0x70, 0xE1, 0xC3, 0x86, 0x0E, 0x18, 0x41, 0x31, 0x88, 0x86, 0xC1, | |
| 2888 | + 0xC0, 0x60, 0x70, 0x28, 0x36, 0x11, 0x98, 0xC8, 0x30, 0x40, 0x98, 0x62, | |
| 2889 | + 0x10, 0xCC, 0x12, 0x07, 0x80, 0xC0, 0x30, 0x0C, 0x03, 0x00, 0xC0, 0x30, | |
| 2890 | + 0xFF, 0x02, 0x06, 0x04, 0x0C, 0x18, 0x10, 0x30, 0x60, 0x60, 0xC0, 0xFF, | |
| 2891 | + 0xFB, 0x6D, 0xB6, 0xDB, 0x6D, 0xB7, 0x01, 0x02, 0x02, 0x04, 0x04, 0x08, | |
| 2892 | + 0x08, 0x10, 0x20, 0x20, 0x40, 0x40, 0x81, 0x01, 0xED, 0xB6, 0xDB, 0x6D, | |
| 2893 | + 0xB6, 0xDF, 0x10, 0x50, 0xA3, 0x64, 0x48, 0xB1, 0x80, 0xFF, 0x80, 0xC8, | |
| 2894 | + 0x80, 0x7C, 0x8C, 0x18, 0xF6, 0x78, 0xF1, 0xE7, 0x76, 0xC0, 0x60, 0x30, | |
| 2895 | + 0x18, 0x0D, 0xE7, 0x1B, 0x07, 0x83, 0xC1, 0xE0, 0xF0, 0x7C, 0x6D, 0xE0, | |
| 2896 | + 0x1E, 0xC5, 0x06, 0x0C, 0x18, 0x30, 0x31, 0x1E, 0x03, 0x03, 0x03, 0x03, | |
| 2897 | + 0x3F, 0x63, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0x67, 0x3B, 0x3C, 0x66, 0xC3, | |
| 2898 | + 0xC3, 0xFF, 0xC0, 0xC0, 0x62, 0x3E, 0x39, 0x86, 0x18, 0xF1, 0x86, 0x18, | |
| 2899 | + 0x61, 0x86, 0x18, 0x60, 0x7F, 0x62, 0x31, 0x98, 0xCE, 0xC3, 0xC3, 0x01, | |
| 2900 | + 0x80, 0x7F, 0x60, 0xF0, 0x78, 0x67, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xDE, | |
| 2901 | + 0xE3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xFF, 0xFF, 0x30, | |
| 2902 | + 0x03, 0x33, 0x33, 0x33, 0x33, 0x33, 0x3E, 0xC0, 0xC0, 0xC0, 0xC0, 0xC6, | |
| 2903 | + 0xC4, 0xC8, 0xD8, 0xF8, 0xEC, 0xC4, 0xC6, 0xC3, 0xDB, 0x6D, 0xB6, 0xDB, | |
| 2904 | + 0x6E, 0xDE, 0x77, 0x1C, 0xF0, 0xC7, 0x86, 0x3C, 0x31, 0xE1, 0x8F, 0x0C, | |
| 2905 | + 0x78, 0x63, 0xC3, 0x18, 0xDE, 0xE3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, | |
| 2906 | + 0xC3, 0x3C, 0x66, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0x66, 0x3C, 0xDE, 0x71, | |
| 2907 | + 0xB0, 0x78, 0x3C, 0x1E, 0x0F, 0x07, 0xC6, 0xDE, 0x60, 0x30, 0x18, 0x0C, | |
| 2908 | + 0x00, 0x3F, 0x63, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0x67, 0x3B, 0x03, 0x03, | |
| 2909 | + 0x03, 0xDF, 0x31, 0x8C, 0x63, 0x18, 0xC0, 0x7D, 0x8B, 0x07, 0x03, 0xC1, | |
| 2910 | + 0xC1, 0xC3, 0x7C, 0x61, 0x8F, 0x18, 0x61, 0x86, 0x18, 0x61, 0x83, 0xC0, | |
| 2911 | + 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC7, 0x7B, 0xC1, 0x43, 0x62, | |
| 2912 | + 0x62, 0x26, 0x34, 0x34, 0x1C, 0x18, 0xC2, 0x1E, 0x38, 0xD9, 0x4C, 0xCA, | |
| 2913 | + 0x66, 0x53, 0x14, 0xD0, 0xE2, 0x87, 0x1C, 0x38, 0xC0, 0x42, 0x66, 0x34, | |
| 2914 | + 0x1C, 0x18, 0x3C, 0x24, 0x66, 0x42, 0x41, 0xA0, 0x98, 0xC4, 0x62, 0x21, | |
| 2915 | + 0xB0, 0x58, 0x28, 0x0C, 0x06, 0x06, 0x02, 0x06, 0x00, 0xFC, 0x31, 0x84, | |
| 2916 | + 0x31, 0x84, 0x30, 0xFC, 0x19, 0x8C, 0x63, 0x18, 0xD8, 0x31, 0x8C, 0x63, | |
| 2917 | + 0x18, 0xC3, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xC3, 0x18, 0xC6, 0x31, 0x83, | |
| 2918 | + 0x63, 0x18, 0xC6, 0x31, 0x98, 0xE3, 0x3C }; | |
| 2919 | + | |
| 2920 | +const GFXglyph sourcesans9pt7bGlyphs[] PROGMEM = { | |
| 2921 | + { 0, 1, 1, 4, 0, 0 }, // 0x20 ' ' | |
| 2922 | + { 1, 2, 12, 5, 2, -11 }, // 0x21 '!' | |
| 2923 | + { 4, 5, 5, 8, 2, -12 }, // 0x22 '"' | |
| 2924 | + { 8, 7, 11, 9, 1, -10 }, // 0x23 '#' | |
| 2925 | + { 18, 7, 14, 9, 1, -12 }, // 0x24 '$' | |
| 2926 | + { 31, 14, 12, 15, 1, -11 }, // 0x25 '%' | |
| 2927 | + { 52, 11, 12, 11, 1, -11 }, // 0x26 '&' | |
| 2928 | + { 69, 2, 5, 4, 2, -12 }, // 0x27 ''' | |
| 2929 | + { 71, 4, 16, 5, 1, -12 }, // 0x28 '(' | |
| 2930 | + { 79, 4, 16, 5, 1, -12 }, // 0x29 ')' | |
| 2931 | + { 87, 5, 5, 8, 1, -12 }, // 0x2A '*' | |
| 2932 | + { 91, 6, 7, 9, 2, -8 }, // 0x2B '+' | |
| 2933 | + { 97, 4, 4, 4, 0, 0 }, // 0x2C ',' | |
| 2934 | + { 99, 4, 1, 6, 1, -4 }, // 0x2D '-' | |
| 2935 | + { 100, 2, 2, 4, 1, -1 }, // 0x2E '.' | |
| 2936 | + { 101, 7, 16, 6, 0, -12 }, // 0x2F '/' | |
| 2937 | + { 115, 8, 12, 9, 1, -11 }, // 0x30 '0' | |
| 2938 | + { 127, 5, 11, 9, 2, -10 }, // 0x31 '1' | |
| 2939 | + { 134, 8, 12, 9, 1, -11 }, // 0x32 '2' | |
| 2940 | + { 146, 8, 12, 9, 1, -11 }, // 0x33 '3' | |
| 2941 | + { 158, 7, 11, 9, 1, -10 }, // 0x34 '4' | |
| 2942 | + { 168, 8, 11, 9, 1, -10 }, // 0x35 '5' | |
| 2943 | + { 179, 8, 11, 9, 1, -10 }, // 0x36 '6' | |
| 2944 | + { 190, 6, 11, 9, 2, -10 }, // 0x37 '7' | |
| 2945 | + { 199, 8, 12, 9, 1, -11 }, // 0x38 '8' | |
| 2946 | + { 211, 8, 12, 9, 1, -11 }, // 0x39 '9' | |
| 2947 | + { 223, 2, 8, 4, 1, -7 }, // 0x3A ':' | |
| 2948 | + { 225, 2, 11, 4, 1, -7 }, // 0x3B ';' | |
| 2949 | + { 228, 7, 8, 9, 1, -9 }, // 0x3C '<' | |
| 2950 | + { 235, 7, 5, 9, 1, -7 }, // 0x3D '=' | |
| 2951 | + { 240, 7, 8, 9, 1, -9 }, // 0x3E '>' | |
| 2952 | + { 247, 6, 12, 8, 1, -11 }, // 0x3F '?' | |
| 2953 | + { 256, 14, 15, 15, 1, -11 }, // 0x40 '@' | |
| 2954 | + { 283, 10, 12, 10, 0, -11 }, // 0x41 'A' | |
| 2955 | + { 298, 8, 12, 11, 2, -11 }, // 0x42 'B' | |
| 2956 | + { 310, 9, 12, 10, 1, -11 }, // 0x43 'C' | |
| 2957 | + { 324, 9, 12, 11, 2, -11 }, // 0x44 'D' | |
| 2958 | + { 338, 6, 12, 9, 2, -11 }, // 0x45 'E' | |
| 2959 | + { 347, 6, 12, 9, 2, -11 }, // 0x46 'F' | |
| 2960 | + { 356, 10, 12, 11, 1, -11 }, // 0x47 'G' | |
| 2961 | + { 371, 9, 12, 12, 2, -11 }, // 0x48 'H' | |
| 2962 | + { 385, 2, 12, 5, 2, -11 }, // 0x49 'I' | |
| 2963 | + { 388, 7, 12, 9, 1, -11 }, // 0x4A 'J' | |
| 2964 | + { 399, 9, 12, 10, 2, -11 }, // 0x4B 'K' | |
| 2965 | + { 413, 6, 12, 9, 2, -11 }, // 0x4C 'L' | |
| 2966 | + { 422, 10, 12, 13, 2, -11 }, // 0x4D 'M' | |
| 2967 | + { 437, 9, 12, 12, 2, -11 }, // 0x4E 'N' | |
| 2968 | + { 451, 10, 12, 12, 1, -11 }, // 0x4F 'O' | |
| 2969 | + { 466, 8, 12, 10, 2, -11 }, // 0x50 'P' | |
| 2970 | + { 478, 10, 15, 12, 1, -11 }, // 0x51 'Q' | |
| 2971 | + { 497, 8, 12, 10, 2, -11 }, // 0x52 'R' | |
| 2972 | + { 509, 8, 12, 10, 1, -11 }, // 0x53 'S' | |
| 2973 | + { 521, 8, 12, 10, 1, -11 }, // 0x54 'T' | |
| 2974 | + { 533, 9, 12, 12, 2, -11 }, // 0x55 'U' | |
| 2975 | + { 547, 10, 12, 9, 0, -11 }, // 0x56 'V' | |
| 2976 | + { 562, 14, 12, 14, 0, -11 }, // 0x57 'W' | |
| 2977 | + { 583, 9, 12, 9, 0, -11 }, // 0x58 'X' | |
| 2978 | + { 597, 10, 12, 9, 0, -11 }, // 0x59 'Y' | |
| 2979 | + { 612, 8, 12, 10, 1, -11 }, // 0x5A 'Z' | |
| 2980 | + { 624, 3, 16, 5, 2, -12 }, // 0x5B '[' | |
| 2981 | + { 630, 7, 16, 6, 0, -12 }, // 0x5C '\' | |
| 2982 | + { 644, 3, 16, 5, 1, -12 }, // 0x5D ']' | |
| 2983 | + { 650, 7, 7, 9, 1, -11 }, // 0x5E '^' | |
| 2984 | + { 657, 9, 1, 9, 0, 2 }, // 0x5F '_' | |
| 2985 | + { 659, 3, 3, 10, 3, -12 }, // 0x60 '`' | |
| 2986 | + { 661, 7, 9, 9, 1, -8 }, // 0x61 'a' | |
| 2987 | + { 669, 9, 13, 10, 1, -12 }, // 0x62 'b' | |
| 2988 | + { 684, 7, 9, 8, 1, -8 }, // 0x63 'c' | |
| 2989 | + { 692, 8, 13, 10, 1, -12 }, // 0x64 'd' | |
| 2990 | + { 705, 8, 9, 9, 1, -8 }, // 0x65 'e' | |
| 2991 | + { 714, 6, 13, 5, 1, -12 }, // 0x66 'f' | |
| 2992 | + { 724, 9, 13, 9, 1, -8 }, // 0x67 'g' | |
| 2993 | + { 739, 8, 13, 10, 1, -12 }, // 0x68 'h' | |
| 2994 | + { 752, 2, 12, 4, 1, -11 }, // 0x69 'i' | |
| 2995 | + { 755, 4, 16, 4, 0, -11 }, // 0x6A 'j' | |
| 2996 | + { 763, 8, 13, 9, 1, -12 }, // 0x6B 'k' | |
| 2997 | + { 776, 3, 13, 5, 1, -12 }, // 0x6C 'l' | |
| 2998 | + { 781, 13, 9, 15, 1, -8 }, // 0x6D 'm' | |
| 2999 | + { 796, 8, 9, 10, 1, -8 }, // 0x6E 'n' | |
| 3000 | + { 805, 8, 9, 10, 1, -8 }, // 0x6F 'o' | |
| 3001 | + { 814, 9, 13, 10, 1, -8 }, // 0x70 'p' | |
| 3002 | + { 829, 8, 12, 10, 1, -8 }, // 0x71 'q' | |
| 3003 | + { 841, 5, 9, 6, 1, -8 }, // 0x72 'r' | |
| 3004 | + { 847, 7, 9, 8, 1, -8 }, // 0x73 's' | |
| 3005 | + { 855, 6, 11, 6, 1, -10 }, // 0x74 't' | |
| 3006 | + { 864, 8, 9, 10, 1, -8 }, // 0x75 'u' | |
| 3007 | + { 873, 8, 9, 8, 0, -8 }, // 0x76 'v' | |
| 3008 | + { 882, 13, 9, 13, 0, -8 }, // 0x77 'w' | |
| 3009 | + { 897, 8, 9, 8, 0, -8 }, // 0x78 'x' | |
| 3010 | + { 906, 9, 13, 8, 0, -8 }, // 0x79 'y' | |
| 3011 | + { 921, 6, 9, 8, 1, -8 }, // 0x7A 'z' | |
| 3012 | + { 928, 5, 16, 5, 0, -12 }, // 0x7B '{' | |
| 3013 | + { 938, 2, 19, 4, 2, -13 }, // 0x7C '|' | |
| 3014 | + { 943, 5, 16, 5, 1, -12 }, // 0x7D '}' | |
| 3015 | + { 953, 7, 2, 9, 1, -6 } }; // 0x7E '~' | |
| 3016 | + | |
| 3017 | +const GFXfont sourcesans9pt7b PROGMEM = { | |
| 3018 | + (uint8_t *)sourcesans9pt7bBitmaps, | |
| 3019 | + (GFXglyph *)sourcesans9pt7bGlyphs, | |
| 3020 | + 0x20, 0x7E, 24 }; | |
| 3021 | + | |
| 3022 | +// Approx. 1627 bytes | |
| 3023 | +const uint8_t sourcesans_semi9pt7bBitmaps[] PROGMEM = { | |
| 3024 | + 0x00, 0xFF, 0xD5, 0x3F, 0xCF, 0x3C, 0xF3, 0xCC, 0x24, 0x4B, 0xFF, 0xF2, | |
| 3025 | + 0x5F, 0xFF, 0xA4, 0x48, 0x91, 0x20, 0x18, 0x31, 0xFE, 0x2C, 0x1C, 0x1E, | |
| 3026 | + 0x0E, 0x0E, 0x0E, 0x1F, 0xF7, 0xC3, 0x00, 0x78, 0x43, 0xF1, 0x0C, 0xC8, | |
| 3027 | + 0x33, 0x20, 0xCD, 0x7B, 0x35, 0xE7, 0xAC, 0xDE, 0xB3, 0x04, 0xCC, 0x13, | |
| 3028 | + 0x30, 0x8F, 0xC2, 0x1E, 0x3C, 0x1F, 0x86, 0x61, 0x98, 0x6C, 0x0E, 0x07, | |
| 3029 | + 0x8F, 0x76, 0xCF, 0x31, 0xE7, 0xFC, 0xF3, 0xFF, 0xC0, 0x32, 0x66, 0xCC, | |
| 3030 | + 0xCC, 0xCC, 0xCC, 0x66, 0x23, 0xC4, 0x66, 0x33, 0x33, 0x33, 0x33, 0x66, | |
| 3031 | + 0x4C, 0x10, 0x21, 0xF1, 0xC2, 0x85, 0x00, 0x30, 0xCF, 0xFF, 0x30, 0xC0, | |
| 3032 | + 0x33, 0x36, 0xC0, 0xFF, 0xFC, 0x00, 0x10, 0x82, 0x18, 0x41, 0x0C, 0x30, | |
| 3033 | + 0x82, 0x18, 0x41, 0x08, 0x00, 0x3C, 0x7E, 0x66, 0xC3, 0xC3, 0xC3, 0xC3, | |
| 3034 | + 0xC3, 0xC3, 0x66, 0x7E, 0x3C, 0xF3, 0xC3, 0x0C, 0x30, 0xC3, 0x0C, 0x33, | |
| 3035 | + 0xFF, 0xC0, 0x78, 0xFC, 0xCE, 0x06, 0x06, 0x06, 0x0C, 0x18, 0x30, 0x70, | |
| 3036 | + 0xFF, 0xFF, 0x3E, 0x7F, 0x23, 0x03, 0x07, 0x1E, 0x1E, 0x03, 0x03, 0x43, | |
| 3037 | + 0xFE, 0x3C, 0x0E, 0x1E, 0x1E, 0x36, 0x66, 0x46, 0xFF, 0xFF, 0x06, 0x06, | |
| 3038 | + 0x06, 0x3E, 0x3E, 0x30, 0x60, 0x6C, 0x7E, 0x07, 0x03, 0x03, 0x47, 0x7E, | |
| 3039 | + 0x3C, 0x1E, 0x7F, 0x62, 0xC0, 0xDC, 0xFE, 0xE3, 0xC3, 0xC3, 0x67, 0x7E, | |
| 3040 | + 0x3C, 0xFF, 0xFC, 0x10, 0x60, 0x83, 0x06, 0x08, 0x30, 0x60, 0xC1, 0x80, | |
| 3041 | + 0x38, 0xFB, 0x1E, 0x3E, 0x6F, 0x9F, 0x63, 0xC7, 0x8D, 0xF1, 0xC0, 0x38, | |
| 3042 | + 0xFB, 0x36, 0x3C, 0x79, 0xDF, 0xBB, 0x06, 0x1B, 0xF3, 0xC0, 0xFC, 0x0F, | |
| 3043 | + 0xC0, 0xFC, 0x03, 0xFE, 0x01, 0x0F, 0x3C, 0xE0, 0xE0, 0x7C, 0x0F, 0x01, | |
| 3044 | + 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0xE0, 0x7C, 0x0F, 0x0F, 0x7C, | |
| 3045 | + 0xE0, 0x80, 0x79, 0xFD, 0x18, 0x30, 0xE3, 0x86, 0x18, 0x30, 0x00, 0xC1, | |
| 3046 | + 0x83, 0x00, 0x07, 0xC0, 0xFF, 0x8E, 0x0C, 0xE6, 0xB6, 0x7C, 0xE7, 0x67, | |
| 3047 | + 0x33, 0x39, 0x91, 0xCC, 0x9E, 0x7F, 0xB9, 0x98, 0xC0, 0x07, 0x84, 0x1F, | |
| 3048 | + 0xE0, 0x3E, 0x00, 0x0C, 0x07, 0x81, 0xE0, 0x48, 0x33, 0x0C, 0xC3, 0x31, | |
| 3049 | + 0xFE, 0x7F, 0x98, 0x6C, 0x0F, 0x03, 0xFC, 0xFE, 0xC6, 0xC6, 0xFC, 0xFE, | |
| 3050 | + 0xC7, 0xC3, 0xC3, 0xC7, 0xFE, 0xFC, 0x1E, 0x1F, 0xDC, 0x5C, 0x0C, 0x06, | |
| 3051 | + 0x03, 0x01, 0x80, 0xE0, 0x30, 0x9F, 0xE3, 0xC0, 0xF8, 0xFE, 0xC6, 0xC3, | |
| 3052 | + 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC6, 0xFE, 0xF8, 0xFF, 0xFF, 0x06, 0x0C, | |
| 3053 | + 0x1F, 0xBF, 0x60, 0xC1, 0x83, 0xFF, 0xF0, 0xFF, 0xFF, 0x06, 0x0C, 0x1F, | |
| 3054 | + 0xBF, 0x60, 0xC1, 0x83, 0x06, 0x00, 0x1E, 0x1F, 0xDC, 0x4C, 0x0C, 0x06, | |
| 3055 | + 0x03, 0x1F, 0x8F, 0xC1, 0xB0, 0xDF, 0xE3, 0xE0, 0xC3, 0xC3, 0xC3, 0xC3, | |
| 3056 | + 0xC3, 0xFF, 0xFF, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xFF, 0xFF, 0xFF, 0x06, | |
| 3057 | + 0x0C, 0x18, 0x30, 0x60, 0xC1, 0x83, 0x06, 0x8D, 0xF1, 0xE0, 0xC3, 0x63, | |
| 3058 | + 0x33, 0x99, 0x8D, 0x87, 0xC3, 0xF1, 0xDC, 0xC6, 0x63, 0xB0, 0xD8, 0x30, | |
| 3059 | + 0xC3, 0x0C, 0x30, 0xC3, 0x0C, 0x30, 0xC3, 0x0F, 0xFF, 0xE0, 0xF8, 0x7E, | |
| 3060 | + 0x1F, 0xC7, 0xF3, 0xF4, 0xBD, 0x2F, 0x7B, 0xCC, 0xF3, 0x3C, 0xCF, 0x03, | |
| 3061 | + 0xC3, 0xE3, 0xE3, 0xF3, 0xD3, 0xDB, 0xDB, 0xCB, 0xCF, 0xC7, 0xC7, 0xC3, | |
| 3062 | + 0x1E, 0x1F, 0xE6, 0x1B, 0x87, 0xC0, 0xF0, 0x3C, 0x0F, 0x03, 0xE1, 0xD8, | |
| 3063 | + 0x67, 0xF0, 0x78, 0xFC, 0xFE, 0xC3, 0xC3, 0xC3, 0xC7, 0xFE, 0xFC, 0xC0, | |
| 3064 | + 0xC0, 0xC0, 0xC0, 0x1E, 0x0F, 0xF1, 0x86, 0x70, 0xEC, 0x0D, 0x81, 0xB0, | |
| 3065 | + 0x36, 0x06, 0xC0, 0xCC, 0x30, 0xFC, 0x0F, 0x00, 0xE0, 0x0F, 0x80, 0xF8, | |
| 3066 | + 0xFC, 0x7F, 0x31, 0xD8, 0x6C, 0x36, 0x3B, 0xF9, 0xF8, 0xCC, 0x63, 0x31, | |
| 3067 | + 0xD8, 0x60, 0x1E, 0x1F, 0xD8, 0x4C, 0x07, 0x01, 0xF0, 0x3C, 0x07, 0x01, | |
| 3068 | + 0xB0, 0xDF, 0xC7, 0xC0, 0xFF, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, | |
| 3069 | + 0x18, 0x18, 0x18, 0x18, 0xC1, 0xE0, 0xF0, 0x78, 0x3C, 0x1E, 0x0F, 0x07, | |
| 3070 | + 0x83, 0xC1, 0xF1, 0xDF, 0xC7, 0xC0, 0xC0, 0xF0, 0x36, 0x19, 0x86, 0x61, | |
| 3071 | + 0x8C, 0xC3, 0x30, 0xCC, 0x1E, 0x07, 0x81, 0xE0, 0x70, 0xC3, 0x8F, 0x0E, | |
| 3072 | + 0x3E, 0x38, 0xD8, 0xE2, 0x66, 0xD9, 0x9B, 0x66, 0x4D, 0x9D, 0x36, 0x3C, | |
| 3073 | + 0xD0, 0xF1, 0xC3, 0xC7, 0x0E, 0x1C, 0x61, 0x98, 0xC3, 0x30, 0xD8, 0x1E, | |
| 3074 | + 0x07, 0x01, 0xC0, 0x78, 0x37, 0x0C, 0xC6, 0x39, 0x86, 0x61, 0x98, 0x63, | |
| 3075 | + 0x30, 0xCC, 0x1A, 0x07, 0x80, 0xC0, 0x30, 0x0C, 0x03, 0x00, 0xC0, 0x30, | |
| 3076 | + 0xFF, 0xFF, 0x06, 0x0E, 0x0C, 0x18, 0x38, 0x30, 0x60, 0xE0, 0xFF, 0xFF, | |
| 3077 | + 0xFB, 0x6D, 0xB6, 0xDB, 0x6D, 0xB7, 0x01, 0x01, 0x02, 0x02, 0x04, 0x0C, | |
| 3078 | + 0x08, 0x10, 0x30, 0x20, 0x40, 0x40, 0x81, 0x01, 0xED, 0xB6, 0xDB, 0x6D, | |
| 3079 | + 0xB6, 0xDF, 0x18, 0x70, 0xA3, 0x66, 0x48, 0xF1, 0x80, 0xFF, 0xFF, 0xC0, | |
| 3080 | + 0xC9, 0x80, 0x3D, 0xFC, 0x18, 0xF7, 0xFC, 0xF1, 0xFF, 0x76, 0xC0, 0xC0, | |
| 3081 | + 0xC0, 0xDC, 0xFE, 0xC7, 0xC3, 0xC3, 0xC3, 0xC7, 0xFE, 0xDC, 0x3C, 0xFF, | |
| 3082 | + 0x86, 0x0C, 0x18, 0x38, 0x3F, 0x3C, 0x03, 0x03, 0x03, 0x3B, 0x7F, 0xE3, | |
| 3083 | + 0xC3, 0xC3, 0xC3, 0xE3, 0x7F, 0x3B, 0x3C, 0xFE, 0x1F, 0xFF, 0xF0, 0x30, | |
| 3084 | + 0x3E, 0x3C, 0x3B, 0xD8, 0xCF, 0x79, 0x8C, 0x63, 0x18, 0xC6, 0x00, 0x7F, | |
| 3085 | + 0xFF, 0xC6, 0xC6, 0x7E, 0x7C, 0xC0, 0xFE, 0x7F, 0xC3, 0xC3, 0xFE, 0x7C, | |
| 3086 | + 0xC0, 0xC0, 0xC0, 0xDE, 0xFF, 0xE3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, | |
| 3087 | + 0xF3, 0xFF, 0xFF, 0x33, 0x03, 0x33, 0x33, 0x33, 0x33, 0x33, 0xFE, 0xC0, | |
| 3088 | + 0xC0, 0xC0, 0xC0, 0xC6, 0xCC, 0xDC, 0xD8, 0xF8, 0xEC, 0xCC, 0xC6, 0xC7, | |
| 3089 | + 0xDB, 0x6D, 0xB6, 0xDB, 0xB0, 0xDE, 0x77, 0xFF, 0xF8, 0xE7, 0x86, 0x3C, | |
| 3090 | + 0x31, 0xE1, 0x8F, 0x0C, 0x78, 0x63, 0xC3, 0x18, 0xDE, 0xFF, 0xE3, 0xC3, | |
| 3091 | + 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0x3C, 0x7E, 0xE7, 0xC3, 0xC3, 0xC3, 0xE7, | |
| 3092 | + 0x7E, 0x3C, 0xDC, 0xFE, 0xC7, 0xC3, 0xC3, 0xC3, 0xC7, 0xFE, 0xDC, 0xC0, | |
| 3093 | + 0xC0, 0xC0, 0x3B, 0x7F, 0xE3, 0xC3, 0xC3, 0xC3, 0xE3, 0x7F, 0x3B, 0x03, | |
| 3094 | + 0x03, 0xDF, 0xF9, 0x8C, 0x63, 0x18, 0xC0, 0x7B, 0xFC, 0x38, 0x78, 0x38, | |
| 3095 | + 0xFF, 0x78, 0x61, 0x8F, 0xBE, 0x61, 0x86, 0x18, 0x61, 0xE3, 0xC0, 0xC3, | |
| 3096 | + 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC7, 0xFF, 0x7B, 0xC1, 0xB1, 0x98, 0xCC, | |
| 3097 | + 0x63, 0x61, 0xB0, 0xD8, 0x38, 0x1C, 0x00, 0xC3, 0x1E, 0x1C, 0xD9, 0xE4, | |
| 3098 | + 0xCB, 0x66, 0x5B, 0x3A, 0xD8, 0xF3, 0x87, 0x1C, 0x38, 0xE0, 0x63, 0x76, | |
| 3099 | + 0x36, 0x1C, 0x1C, 0x3C, 0x36, 0x66, 0x63, 0xC3, 0xC3, 0xC6, 0x66, 0x66, | |
| 3100 | + 0x2C, 0x3C, 0x3C, 0x18, 0x18, 0x30, 0xF0, 0xE0, 0xFD, 0xF8, 0x70, 0xC3, | |
| 3101 | + 0x0C, 0x38, 0x7F, 0xFE, 0x19, 0x8C, 0x63, 0x18, 0xDC, 0xE1, 0x8C, 0x63, | |
| 3102 | + 0x18, 0xC3, 0xFF, 0xFF, 0xE0, 0xC3, 0x18, 0xC6, 0x31, 0x87, 0x3B, 0x18, | |
| 3103 | + 0xC6, 0x31, 0x98, 0x60, 0xF2, 0x9E, 0x0C }; | |
| 3104 | + | |
| 3105 | +const GFXglyph sourcesans_semi9pt7bGlyphs[] PROGMEM = { | |
| 3106 | + { 0, 1, 1, 4, 0, 0 }, // 0x20 ' ' | |
| 3107 | + { 1, 2, 12, 6, 2, -11 }, // 0x21 '!' | |
| 3108 | + { 4, 6, 5, 9, 1, -11 }, // 0x22 '"' | |
| 3109 | + { 8, 7, 11, 9, 1, -10 }, // 0x23 '#' | |
| 3110 | + { 18, 7, 14, 9, 1, -12 }, // 0x24 '$' | |
| 3111 | + { 31, 14, 12, 15, 1, -11 }, // 0x25 '%' | |
| 3112 | + { 52, 10, 12, 12, 1, -11 }, // 0x26 '&' | |
| 3113 | + { 67, 2, 5, 5, 1, -11 }, // 0x27 ''' | |
| 3114 | + { 69, 4, 16, 6, 1, -12 }, // 0x28 '(' | |
| 3115 | + { 77, 4, 16, 6, 1, -12 }, // 0x29 ')' | |
| 3116 | + { 85, 7, 6, 8, 0, -12 }, // 0x2A '*' | |
| 3117 | + { 91, 6, 6, 9, 2, -8 }, // 0x2B '+' | |
| 3118 | + { 96, 4, 5, 5, 1, -1 }, // 0x2C ',' | |
| 3119 | + { 99, 4, 2, 6, 1, -5 }, // 0x2D '-' | |
| 3120 | + { 100, 2, 3, 5, 1, -2 }, // 0x2E '.' | |
| 3121 | + { 101, 6, 16, 6, 0, -12 }, // 0x2F '/' | |
| 3122 | + { 113, 8, 12, 9, 1, -11 }, // 0x30 '0' | |
| 3123 | + { 125, 6, 11, 9, 2, -10 }, // 0x31 '1' | |
| 3124 | + { 134, 8, 12, 9, 1, -11 }, // 0x32 '2' | |
| 3125 | + { 146, 8, 12, 9, 0, -11 }, // 0x33 '3' | |
| 3126 | + { 158, 8, 11, 9, 0, -10 }, // 0x34 '4' | |
| 3127 | + { 169, 8, 12, 9, 0, -11 }, // 0x35 '5' | |
| 3128 | + { 181, 8, 12, 9, 1, -11 }, // 0x36 '6' | |
| 3129 | + { 193, 7, 12, 9, 1, -11 }, // 0x37 '7' | |
| 3130 | + { 204, 7, 12, 9, 1, -11 }, // 0x38 '8' | |
| 3131 | + { 215, 7, 12, 9, 1, -11 }, // 0x39 '9' | |
| 3132 | + { 226, 2, 9, 5, 1, -8 }, // 0x3A ':' | |
| 3133 | + { 229, 2, 12, 4, 1, -8 }, // 0x3B ';' | |
| 3134 | + { 232, 8, 8, 9, 1, -9 }, // 0x3C '<' | |
| 3135 | + { 240, 8, 6, 9, 1, -8 }, // 0x3D '=' | |
| 3136 | + { 246, 8, 8, 9, 1, -9 }, // 0x3E '>' | |
| 3137 | + { 254, 7, 13, 8, 0, -12 }, // 0x3F '?' | |
| 3138 | + { 266, 13, 15, 16, 1, -11 }, // 0x40 '@' | |
| 3139 | + { 291, 10, 12, 10, 0, -11 }, // 0x41 'A' | |
| 3140 | + { 306, 8, 12, 11, 2, -11 }, // 0x42 'B' | |
| 3141 | + { 318, 9, 12, 10, 1, -11 }, // 0x43 'C' | |
| 3142 | + { 332, 8, 12, 11, 2, -11 }, // 0x44 'D' | |
| 3143 | + { 344, 7, 12, 10, 2, -11 }, // 0x45 'E' | |
| 3144 | + { 355, 7, 12, 9, 2, -11 }, // 0x46 'F' | |
| 3145 | + { 366, 9, 12, 11, 1, -11 }, // 0x47 'G' | |
| 3146 | + { 380, 8, 12, 12, 2, -11 }, // 0x48 'H' | |
| 3147 | + { 392, 2, 12, 5, 2, -11 }, // 0x49 'I' | |
| 3148 | + { 395, 7, 12, 9, 0, -11 }, // 0x4A 'J' | |
| 3149 | + { 406, 9, 12, 11, 2, -11 }, // 0x4B 'K' | |
| 3150 | + { 420, 6, 12, 9, 2, -11 }, // 0x4C 'L' | |
| 3151 | + { 429, 10, 12, 13, 2, -11 }, // 0x4D 'M' | |
| 3152 | + { 444, 8, 12, 12, 2, -11 }, // 0x4E 'N' | |
| 3153 | + { 456, 10, 12, 12, 1, -11 }, // 0x4F 'O' | |
| 3154 | + { 471, 8, 12, 11, 2, -11 }, // 0x50 'P' | |
| 3155 | + { 483, 11, 15, 12, 1, -11 }, // 0x51 'Q' | |
| 3156 | + { 504, 9, 12, 11, 2, -11 }, // 0x52 'R' | |
| 3157 | + { 518, 9, 12, 10, 0, -11 }, // 0x53 'S' | |
| 3158 | + { 532, 8, 12, 10, 1, -11 }, // 0x54 'T' | |
| 3159 | + { 544, 9, 12, 12, 1, -11 }, // 0x55 'U' | |
| 3160 | + { 558, 10, 12, 10, 0, -11 }, // 0x56 'V' | |
| 3161 | + { 573, 14, 12, 14, 0, -11 }, // 0x57 'W' | |
| 3162 | + { 594, 10, 12, 10, 0, -11 }, // 0x58 'X' | |
| 3163 | + { 609, 10, 12, 9, -1, -11 }, // 0x59 'Y' | |
| 3164 | + { 624, 8, 12, 10, 1, -11 }, // 0x5A 'Z' | |
| 3165 | + { 636, 3, 16, 6, 2, -12 }, // 0x5B '[' | |
| 3166 | + { 642, 7, 16, 6, 0, -12 }, // 0x5C '\' | |
| 3167 | + { 656, 3, 16, 6, 1, -12 }, // 0x5D ']' | |
| 3168 | + { 662, 7, 7, 9, 1, -11 }, // 0x5E '^' | |
| 3169 | + { 669, 9, 2, 9, 0, 1 }, // 0x5F '_' | |
| 3170 | + { 672, 3, 3, 10, 3, -12 }, // 0x60 '`' | |
| 3171 | + { 674, 7, 9, 9, 1, -8 }, // 0x61 'a' | |
| 3172 | + { 682, 8, 12, 10, 1, -11 }, // 0x62 'b' | |
| 3173 | + { 694, 7, 9, 8, 1, -8 }, // 0x63 'c' | |
| 3174 | + { 702, 8, 12, 10, 1, -11 }, // 0x64 'd' | |
| 3175 | + { 714, 7, 9, 9, 2, -8 }, // 0x65 'e' | |
| 3176 | + { 722, 5, 13, 6, 1, -12 }, // 0x66 'f' | |
| 3177 | + { 731, 8, 13, 9, 1, -8 }, // 0x67 'g' | |
| 3178 | + { 744, 8, 12, 10, 1, -11 }, // 0x68 'h' | |
| 3179 | + { 756, 2, 12, 5, 1, -11 }, // 0x69 'i' | |
| 3180 | + { 759, 4, 16, 5, -1, -11 }, // 0x6A 'j' | |
| 3181 | + { 767, 8, 13, 9, 1, -12 }, // 0x6B 'k' | |
| 3182 | + { 780, 3, 12, 5, 1, -11 }, // 0x6C 'l' | |
| 3183 | + { 785, 13, 9, 15, 1, -8 }, // 0x6D 'm' | |
| 3184 | + { 800, 8, 9, 10, 1, -8 }, // 0x6E 'n' | |
| 3185 | + { 809, 8, 9, 10, 1, -8 }, // 0x6F 'o' | |
| 3186 | + { 818, 8, 12, 10, 1, -8 }, // 0x70 'p' | |
| 3187 | + { 830, 8, 11, 10, 1, -8 }, // 0x71 'q' | |
| 3188 | + { 841, 5, 9, 7, 1, -8 }, // 0x72 'r' | |
| 3189 | + { 847, 6, 9, 8, 1, -8 }, // 0x73 's' | |
| 3190 | + { 854, 6, 11, 6, 1, -10 }, // 0x74 't' | |
| 3191 | + { 863, 8, 9, 10, 1, -8 }, // 0x75 'u' | |
| 3192 | + { 872, 9, 9, 9, 0, -8 }, // 0x76 'v' | |
| 3193 | + { 883, 13, 9, 13, 0, -8 }, // 0x77 'w' | |
| 3194 | + { 898, 8, 9, 9, 0, -8 }, // 0x78 'x' | |
| 3195 | + { 907, 8, 13, 9, 1, -8 }, // 0x79 'y' | |
| 3196 | + { 920, 7, 9, 8, 1, -8 }, // 0x7A 'z' | |
| 3197 | + { 928, 5, 16, 6, 0, -12 }, // 0x7B '{' | |
| 3198 | + { 938, 1, 19, 5, 2, -13 }, // 0x7C '|' | |
| 3199 | + { 941, 5, 16, 6, 1, -12 }, // 0x7D '}' | |
| 3200 | + { 951, 8, 4, 9, 1, -7 } }; // 0x7E '~' | |
| 3201 | + | |
| 3202 | +const GFXfont sourcesans_semi9pt7b PROGMEM = { | |
| 3203 | + (uint8_t *)sourcesans_semi9pt7bBitmaps, | |
| 3204 | + (GFXglyph *)sourcesans_semi9pt7bGlyphs, | |
| 3205 | + 0x20, 0x7E, 24 }; | |
| 3206 | + | |
| 3207 | +// Approx. 1627 bytes | |
| 3208 | +const uint8_t sourcesans_bold9pt7bBitmaps[] PROGMEM = { | |
| 3209 | + 0x00, 0xFF, 0xFF, 0xFF, 0x1F, 0xF0, 0xE7, 0xE7, 0xE7, 0xE7, 0xE7, 0x42, | |
| 3210 | + 0x24, 0x4B, 0xFF, 0xF2, 0x4D, 0xBF, 0xFF, 0x48, 0x91, 0x20, 0x18, 0x18, | |
| 3211 | + 0x7E, 0xFF, 0xE2, 0xE0, 0xF0, 0x7C, 0x1E, 0x0F, 0x07, 0xC7, 0xFE, 0x7C, | |
| 3212 | + 0x18, 0x18, 0x78, 0x21, 0xF8, 0xC3, 0x31, 0x06, 0x66, 0x0C, 0xC9, 0x99, | |
| 3213 | + 0xB7, 0x9E, 0xD9, 0x99, 0x33, 0x06, 0x66, 0x08, 0xCC, 0x31, 0xF8, 0x41, | |
| 3214 | + 0xE0, 0x0E, 0x01, 0xF0, 0x3B, 0x03, 0xB0, 0x3E, 0x01, 0xC7, 0x7C, 0x7F, | |
| 3215 | + 0x6E, 0xE7, 0xCE, 0x3E, 0x7F, 0xF3, 0xE3, 0xFF, 0xFE, 0x80, 0x19, 0x9C, | |
| 3216 | + 0xE6, 0x73, 0x9C, 0xE7, 0x38, 0xC7, 0x38, 0xC3, 0xC3, 0x1C, 0xE3, 0x1C, | |
| 3217 | + 0xE7, 0x39, 0xCE, 0x67, 0x39, 0x98, 0x10, 0x23, 0xFB, 0xE3, 0x8D, 0x80, | |
| 3218 | + 0x00, 0x18, 0x18, 0x18, 0xFF, 0xFF, 0x18, 0x18, 0x18, 0xDF, 0x97, 0xA0, | |
| 3219 | + 0xFF, 0xFF, 0x80, 0x00, 0x86, 0x31, 0x8C, 0x46, 0x31, 0x88, 0x46, 0x31, | |
| 3220 | + 0x88, 0x46, 0x31, 0x88, 0x00, 0x3C, 0x7E, 0x66, 0xE7, 0xE7, 0xE7, 0xE7, | |
| 3221 | + 0xE7, 0xE7, 0x66, 0x7E, 0x3C, 0x79, 0xE3, 0x8E, 0x38, 0xE3, 0x8E, 0x3B, | |
| 3222 | + 0xFF, 0xC0, 0x3C, 0x7F, 0x11, 0xC0, 0xE0, 0x70, 0x38, 0x38, 0x3C, 0x1C, | |
| 3223 | + 0x1C, 0x1F, 0xEF, 0xF0, 0x1E, 0x3F, 0x88, 0xE0, 0x70, 0x78, 0xF0, 0x7C, | |
| 3224 | + 0x07, 0x03, 0xA1, 0xFF, 0xC7, 0xC0, 0x0E, 0x1E, 0x3E, 0x2E, 0x6E, 0xCE, | |
| 3225 | + 0xFF, 0xFF, 0x0E, 0x0E, 0x0E, 0x3F, 0x1F, 0x9C, 0x0E, 0x07, 0xE3, 0xF8, | |
| 3226 | + 0x0E, 0x07, 0x43, 0xFF, 0x8F, 0x80, 0x1E, 0x7F, 0x72, 0xE0, 0xE0, 0xEE, | |
| 3227 | + 0xFF, 0xE7, 0xE7, 0xE7, 0x7E, 0x3C, 0xFF, 0xF0, 0x86, 0x18, 0xC3, 0x1C, | |
| 3228 | + 0x71, 0xC7, 0x00, 0x3C, 0x7E, 0xE7, 0xE7, 0xF7, 0x7C, 0x7E, 0xE7, 0xE7, | |
| 3229 | + 0xE7, 0x7E, 0x3C, 0x3C, 0x7E, 0xE6, 0xE7, 0xE7, 0xE7, 0x7F, 0x37, 0x07, | |
| 3230 | + 0x0E, 0xFE, 0x7C, 0xFF, 0x80, 0x3F, 0xE0, 0xFF, 0x80, 0x3F, 0xE5, 0xE8, | |
| 3231 | + 0x03, 0x0F, 0x7E, 0xF0, 0xF0, 0x7E, 0x0F, 0x03, 0xFF, 0xFF, 0x00, 0x00, | |
| 3232 | + 0xFF, 0xFF, 0x80, 0xF0, 0x7C, 0x0F, 0x0F, 0x7C, 0xF0, 0x80, 0x3C, 0xFF, | |
| 3233 | + 0x47, 0x07, 0x0E, 0x1C, 0x38, 0x38, 0x00, 0x38, 0x38, 0x38, 0x07, 0xE0, | |
| 3234 | + 0x7F, 0xC3, 0xC1, 0x9C, 0x02, 0x63, 0xE7, 0x9F, 0x9C, 0xEC, 0x73, 0x31, | |
| 3235 | + 0xCC, 0xCF, 0x3D, 0xEE, 0x77, 0x18, 0x00, 0x78, 0x00, 0xFF, 0x00, 0xFC, | |
| 3236 | + 0x00, 0x0E, 0x03, 0xE0, 0x6C, 0x0D, 0x83, 0xB8, 0x77, 0x0C, 0x63, 0xFE, | |
| 3237 | + 0x7F, 0xCE, 0x3B, 0x83, 0xF0, 0x70, 0xFE, 0x3F, 0xEE, 0x3B, 0x8E, 0xE3, | |
| 3238 | + 0xBF, 0xCF, 0xFB, 0x87, 0xE1, 0xF8, 0x7F, 0xFB, 0xFC, 0x1F, 0x0F, 0xE7, | |
| 3239 | + 0x11, 0xC0, 0xE0, 0x38, 0x0E, 0x03, 0x80, 0xF0, 0x1C, 0x63, 0xFC, 0x7C, | |
| 3240 | + 0xFE, 0x3F, 0xCE, 0x3B, 0x87, 0xE1, 0xF8, 0x7E, 0x1F, 0x87, 0xE3, 0xF8, | |
| 3241 | + 0xEF, 0xF3, 0xF8, 0xFF, 0xFF, 0x87, 0x0E, 0x1F, 0xBF, 0x70, 0xE1, 0xC3, | |
| 3242 | + 0xFF, 0xF0, 0xFF, 0xFF, 0x87, 0x0E, 0x1F, 0xBF, 0x70, 0xE1, 0xC3, 0x87, | |
| 3243 | + 0x00, 0x1F, 0x0F, 0xF7, 0x13, 0x80, 0xE0, 0x38, 0xFE, 0x3F, 0x87, 0xF1, | |
| 3244 | + 0xDC, 0x73, 0xFC, 0x7E, 0xE1, 0xF8, 0x7E, 0x1F, 0x87, 0xE1, 0xFF, 0xFF, | |
| 3245 | + 0xFF, 0x87, 0xE1, 0xF8, 0x7E, 0x1F, 0x87, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, | |
| 3246 | + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x47, 0xFE, 0x3C, | |
| 3247 | + 0xE3, 0xB8, 0xCE, 0x73, 0xB8, 0xFC, 0x3F, 0x0F, 0xE3, 0xDC, 0xE7, 0x38, | |
| 3248 | + 0xEE, 0x3B, 0x87, 0xE1, 0xC3, 0x87, 0x0E, 0x1C, 0x38, 0x70, 0xE1, 0xC3, | |
| 3249 | + 0xFF, 0xF0, 0xF0, 0xFF, 0x0F, 0xF0, 0xFF, 0x9F, 0xF9, 0xFF, 0x9F, 0xEF, | |
| 3250 | + 0x7E, 0xF7, 0xE6, 0x7E, 0x67, 0xE6, 0x7E, 0x07, 0xE1, 0xFC, 0x7F, 0x1F, | |
| 3251 | + 0xE7, 0xF9, 0xFB, 0x7E, 0xDF, 0x9F, 0xE7, 0xF8, 0xFE, 0x3F, 0x87, 0x1F, | |
| 3252 | + 0x07, 0xF1, 0xC7, 0x70, 0x7E, 0x0F, 0xC1, 0xF8, 0x3F, 0x07, 0xE0, 0xEE, | |
| 3253 | + 0x38, 0xFE, 0x0F, 0x80, 0xFF, 0x3F, 0xEE, 0x3F, 0x87, 0xE1, 0xF8, 0xFF, | |
| 3254 | + 0xFB, 0xFC, 0xE0, 0x38, 0x0E, 0x03, 0x80, 0x1F, 0x07, 0xF1, 0xC7, 0x70, | |
| 3255 | + 0x7E, 0x0F, 0xC1, 0xF8, 0x3F, 0x07, 0xE0, 0xEE, 0x38, 0xFE, 0x0F, 0x80, | |
| 3256 | + 0x70, 0x0F, 0xC0, 0x78, 0xFF, 0x3F, 0xEE, 0x3F, 0x87, 0xE1, 0xF8, 0xFF, | |
| 3257 | + 0xFB, 0xFC, 0xE7, 0x38, 0xEE, 0x3B, 0x87, 0x3E, 0x3F, 0xB8, 0xDC, 0x0F, | |
| 3258 | + 0x83, 0xF0, 0xFC, 0x0F, 0x03, 0xA1, 0xFF, 0xCF, 0xC0, 0xFF, 0xFC, 0xE1, | |
| 3259 | + 0xC3, 0x87, 0x0E, 0x1C, 0x38, 0x70, 0xE1, 0xC0, 0xE1, 0xF8, 0x7E, 0x1F, | |
| 3260 | + 0x87, 0xE1, 0xF8, 0x7E, 0x1F, 0x87, 0xE1, 0xDC, 0xE7, 0xF8, 0xFC, 0xE1, | |
| 3261 | + 0xF8, 0x77, 0x39, 0xCE, 0x73, 0x8C, 0xC3, 0x30, 0xFC, 0x1E, 0x07, 0x81, | |
| 3262 | + 0xE0, 0x70, 0xE3, 0x8F, 0xC7, 0x1F, 0x8E, 0x33, 0x1C, 0xE7, 0x7D, 0xCE, | |
| 3263 | + 0xDB, 0x9D, 0xB7, 0x3B, 0x6C, 0x34, 0xD8, 0x79, 0xF0, 0xF1, 0xE1, 0xE3, | |
| 3264 | + 0xC0, 0x71, 0xDC, 0xE3, 0x38, 0xEC, 0x1F, 0x07, 0x81, 0xE0, 0x7C, 0x3F, | |
| 3265 | + 0x0C, 0xE7, 0x3B, 0x87, 0x60, 0xCE, 0x38, 0xC6, 0x1D, 0xC1, 0xB0, 0x3E, | |
| 3266 | + 0x07, 0xC0, 0x70, 0x0E, 0x01, 0xC0, 0x38, 0x07, 0x00, 0xFF, 0xFF, 0x06, | |
| 3267 | + 0x0E, 0x1C, 0x1C, 0x38, 0x30, 0x70, 0xE0, 0xFF, 0xFF, 0xFF, 0xCC, 0xCC, | |
| 3268 | + 0xCC, 0xCC, 0xCC, 0xCC, 0xFF, 0x08, 0x8C, 0xCC, 0x44, 0x46, 0x66, 0x62, | |
| 3269 | + 0x22, 0x33, 0x31, 0x20, 0xFF, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0xFF, | |
| 3270 | + 0x38, 0x38, 0x3C, 0x6C, 0x66, 0x66, 0xC6, 0xFF, 0xFF, 0xC0, 0x63, 0x3C, | |
| 3271 | + 0x7E, 0x47, 0x1F, 0x7F, 0xE7, 0xE7, 0xFF, 0x7F, 0xE0, 0x70, 0x38, 0x1C, | |
| 3272 | + 0x0E, 0xE7, 0xFB, 0x8F, 0xC7, 0xE3, 0xF1, 0xF9, 0xFF, 0xED, 0xE0, 0x1E, | |
| 3273 | + 0x7E, 0xF0, 0xE0, 0xE0, 0xE0, 0xF2, 0x7E, 0x3E, 0x07, 0x07, 0x07, 0x07, | |
| 3274 | + 0x3F, 0x7F, 0xE7, 0xE7, 0xE7, 0xE7, 0xE7, 0x7F, 0x3F, 0x3C, 0x7E, 0xC7, | |
| 3275 | + 0xFF, 0xFF, 0xC0, 0xE0, 0x7E, 0x3E, 0x1D, 0xF7, 0x1C, 0xFB, 0xE7, 0x1C, | |
| 3276 | + 0x71, 0xC7, 0x1C, 0x70, 0x3F, 0xFF, 0xF9, 0xDC, 0xE7, 0xF3, 0xE1, 0x80, | |
| 3277 | + 0xFE, 0x7F, 0xF1, 0xF8, 0xFF, 0xE7, 0xE0, 0xE0, 0x70, 0x38, 0x1C, 0x0E, | |
| 3278 | + 0xF7, 0xFF, 0x8F, 0xC7, 0xE3, 0xF1, 0xF8, 0xFC, 0x7E, 0x38, 0xFC, 0x7F, | |
| 3279 | + 0xFF, 0xFF, 0xF0, 0x39, 0xC0, 0x73, 0x9C, 0xE7, 0x39, 0xCE, 0x73, 0x9F, | |
| 3280 | + 0xFE, 0xE0, 0x70, 0x38, 0x1C, 0x0E, 0x77, 0x3B, 0xB9, 0xF8, 0xFC, 0x7F, | |
| 3281 | + 0x39, 0x9C, 0xEE, 0x38, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEF, 0x70, 0xFE, | |
| 3282 | + 0x7B, 0xFF, 0xFE, 0x71, 0xF9, 0xC7, 0xE7, 0x1F, 0x9C, 0x7E, 0x71, 0xF9, | |
| 3283 | + 0xC7, 0xE7, 0x1C, 0xEF, 0x7F, 0xF8, 0xFC, 0x7E, 0x3F, 0x1F, 0x8F, 0xC7, | |
| 3284 | + 0xE3, 0x80, 0x3E, 0x3F, 0xB8, 0xFC, 0x7E, 0x3F, 0x1F, 0x8E, 0xFE, 0x3E, | |
| 3285 | + 0x00, 0xFE, 0x7F, 0xB8, 0xFC, 0x7E, 0x3F, 0x1F, 0x9F, 0xFE, 0xFE, 0x70, | |
| 3286 | + 0x38, 0x1C, 0x00, 0x3B, 0x7F, 0xE7, 0xE7, 0xE7, 0xE7, 0xE7, 0x7F, 0x3F, | |
| 3287 | + 0x07, 0x07, 0x07, 0xEF, 0xFF, 0x38, 0xE3, 0x8E, 0x38, 0xE0, 0x7D, 0xFF, | |
| 3288 | + 0x97, 0x87, 0xC3, 0xD3, 0xFF, 0x7C, 0x71, 0xCF, 0xBE, 0x71, 0xC7, 0x1C, | |
| 3289 | + 0x71, 0xF3, 0xC0, 0xE7, 0xE7, 0xE7, 0xE7, 0xE7, 0xE7, 0xE7, 0xFF, 0x7F, | |
| 3290 | + 0xC3, 0xF1, 0xB9, 0xCC, 0xE6, 0x63, 0xB0, 0xF8, 0x78, 0x3C, 0x00, 0xE3, | |
| 3291 | + 0x1F, 0x8E, 0x77, 0x79, 0x9D, 0xEE, 0x77, 0xB8, 0xD3, 0xC3, 0xCF, 0x0F, | |
| 3292 | + 0x3C, 0x3C, 0xF0, 0x73, 0xBB, 0x8F, 0x87, 0xC1, 0xC1, 0xF0, 0xD8, 0xEE, | |
| 3293 | + 0x63, 0x80, 0xE3, 0xB1, 0xDC, 0xC6, 0x63, 0x71, 0xF0, 0x78, 0x38, 0x0C, | |
| 3294 | + 0x0E, 0x1E, 0x0E, 0x00, 0xFF, 0xFC, 0x71, 0xC3, 0x8E, 0x38, 0x7F, 0xFE, | |
| 3295 | + 0x3B, 0xDC, 0xE3, 0x18, 0xDE, 0xF1, 0x8C, 0xE7, 0x39, 0xE7, 0xFF, 0xFF, | |
| 3296 | + 0xE0, 0xE7, 0x9C, 0xE6, 0x31, 0x8F, 0x7B, 0x18, 0xC7, 0x3B, 0xDC, 0x72, | |
| 3297 | + 0xFF, 0x8E }; | |
| 3298 | + | |
| 3299 | +const GFXglyph sourcesans_bold9pt7bGlyphs[] PROGMEM = { | |
| 3300 | + { 0, 1, 1, 4, 0, 0 }, // 0x20 ' ' | |
| 3301 | + { 1, 3, 12, 6, 1, -11 }, // 0x21 '!' | |
| 3302 | + { 6, 8, 6, 10, 1, -11 }, // 0x22 '"' | |
| 3303 | + { 12, 7, 11, 10, 1, -10 }, // 0x23 '#' | |
| 3304 | + { 22, 8, 16, 9, 1, -13 }, // 0x24 '$' | |
| 3305 | + { 38, 15, 12, 15, 0, -11 }, // 0x25 '%' | |
| 3306 | + { 61, 12, 12, 12, 0, -11 }, // 0x26 '&' | |
| 3307 | + { 79, 3, 6, 5, 1, -11 }, // 0x27 ''' | |
| 3308 | + { 82, 5, 16, 6, 1, -12 }, // 0x28 '(' | |
| 3309 | + { 92, 5, 16, 6, 1, -12 }, // 0x29 ')' | |
| 3310 | + { 102, 7, 7, 8, 0, -12 }, // 0x2A '*' | |
| 3311 | + { 109, 8, 8, 9, 1, -9 }, // 0x2B '+' | |
| 3312 | + { 117, 3, 7, 5, 1, -2 }, // 0x2C ',' | |
| 3313 | + { 120, 4, 2, 6, 1, -5 }, // 0x2D '-' | |
| 3314 | + { 121, 3, 3, 5, 1, -2 }, // 0x2E '.' | |
| 3315 | + { 123, 5, 22, 6, 0, -15 }, // 0x2F '/' | |
| 3316 | + { 137, 8, 12, 10, 1, -11 }, // 0x30 '0' | |
| 3317 | + { 149, 6, 11, 9, 2, -10 }, // 0x31 '1' | |
| 3318 | + { 158, 9, 12, 9, 1, -11 }, // 0x32 '2' | |
| 3319 | + { 172, 9, 12, 9, 0, -11 }, // 0x33 '3' | |
| 3320 | + { 186, 8, 11, 9, 1, -10 }, // 0x34 '4' | |
| 3321 | + { 197, 9, 11, 9, 0, -10 }, // 0x35 '5' | |
| 3322 | + { 210, 8, 12, 10, 1, -11 }, // 0x36 '6' | |
| 3323 | + { 222, 6, 11, 9, 2, -10 }, // 0x37 '7' | |
| 3324 | + { 231, 8, 12, 10, 1, -11 }, // 0x38 '8' | |
| 3325 | + { 243, 8, 12, 10, 1, -11 }, // 0x39 '9' | |
| 3326 | + { 255, 3, 9, 5, 1, -8 }, // 0x3A ':' | |
| 3327 | + { 259, 3, 13, 5, 1, -8 }, // 0x3B ';' | |
| 3328 | + { 264, 8, 8, 10, 1, -9 }, // 0x3C '<' | |
| 3329 | + { 272, 8, 6, 9, 1, -8 }, // 0x3D '=' | |
| 3330 | + { 278, 8, 8, 10, 1, -9 }, // 0x3E '>' | |
| 3331 | + { 286, 8, 12, 8, 0, -11 }, // 0x3F '?' | |
| 3332 | + { 298, 14, 15, 16, 1, -11 }, // 0x40 '@' | |
| 3333 | + { 325, 11, 12, 10, 0, -11 }, // 0x41 'A' | |
| 3334 | + { 342, 10, 12, 11, 1, -11 }, // 0x42 'B' | |
| 3335 | + { 357, 10, 12, 10, 1, -11 }, // 0x43 'C' | |
| 3336 | + { 372, 10, 12, 11, 1, -11 }, // 0x44 'D' | |
| 3337 | + { 387, 7, 12, 10, 1, -11 }, // 0x45 'E' | |
| 3338 | + { 398, 7, 12, 9, 1, -11 }, // 0x46 'F' | |
| 3339 | + { 409, 10, 12, 11, 1, -11 }, // 0x47 'G' | |
| 3340 | + { 424, 10, 12, 12, 1, -11 }, // 0x48 'H' | |
| 3341 | + { 439, 3, 12, 5, 1, -11 }, // 0x49 'I' | |
| 3342 | + { 444, 8, 12, 9, 0, -11 }, // 0x4A 'J' | |
| 3343 | + { 456, 10, 12, 11, 1, -11 }, // 0x4B 'K' | |
| 3344 | + { 471, 7, 12, 9, 1, -11 }, // 0x4C 'L' | |
| 3345 | + { 482, 12, 12, 14, 1, -11 }, // 0x4D 'M' | |
| 3346 | + { 500, 10, 12, 12, 1, -11 }, // 0x4E 'N' | |
| 3347 | + { 515, 11, 12, 12, 1, -11 }, // 0x4F 'O' | |
| 3348 | + { 532, 10, 12, 11, 1, -11 }, // 0x50 'P' | |
| 3349 | + { 547, 11, 15, 12, 1, -11 }, // 0x51 'Q' | |
| 3350 | + { 568, 10, 12, 11, 1, -11 }, // 0x52 'R' | |
| 3351 | + { 583, 9, 12, 10, 1, -11 }, // 0x53 'S' | |
| 3352 | + { 597, 7, 12, 10, 2, -11 }, // 0x54 'T' | |
| 3353 | + { 608, 10, 12, 12, 1, -11 }, // 0x55 'U' | |
| 3354 | + { 623, 10, 12, 10, 0, -11 }, // 0x56 'V' | |
| 3355 | + { 638, 15, 12, 15, 0, -11 }, // 0x57 'W' | |
| 3356 | + { 661, 10, 12, 10, 0, -11 }, // 0x58 'X' | |
| 3357 | + { 676, 11, 12, 9, -1, -11 }, // 0x59 'Y' | |
| 3358 | + { 693, 8, 12, 10, 1, -11 }, // 0x5A 'Z' | |
| 3359 | + { 705, 4, 16, 6, 2, -12 }, // 0x5B '[' | |
| 3360 | + { 713, 4, 22, 6, 1, -15 }, // 0x5C '\' | |
| 3361 | + { 724, 4, 16, 6, 1, -12 }, // 0x5D ']' | |
| 3362 | + { 732, 8, 7, 10, 1, -11 }, // 0x5E '^' | |
| 3363 | + { 739, 9, 2, 9, 0, 2 }, // 0x5F '_' | |
| 3364 | + { 742, 4, 2, 10, 2, -11 }, // 0x60 '`' | |
| 3365 | + { 743, 8, 9, 10, 1, -8 }, // 0x61 'a' | |
| 3366 | + { 752, 9, 13, 10, 1, -12 }, // 0x62 'b' | |
| 3367 | + { 767, 8, 9, 8, 1, -8 }, // 0x63 'c' | |
| 3368 | + { 776, 8, 13, 10, 1, -12 }, // 0x64 'd' | |
| 3369 | + { 789, 8, 9, 9, 1, -8 }, // 0x65 'e' | |
| 3370 | + { 798, 6, 13, 6, 1, -12 }, // 0x66 'f' | |
| 3371 | + { 808, 9, 13, 10, 1, -8 }, // 0x67 'g' | |
| 3372 | + { 823, 9, 13, 10, 1, -12 }, // 0x68 'h' | |
| 3373 | + { 838, 3, 12, 5, 1, -11 }, // 0x69 'i' | |
| 3374 | + { 843, 5, 16, 5, -1, -11 }, // 0x6A 'j' | |
| 3375 | + { 853, 9, 13, 10, 1, -12 }, // 0x6B 'k' | |
| 3376 | + { 868, 4, 13, 5, 1, -12 }, // 0x6C 'l' | |
| 3377 | + { 875, 14, 9, 15, 1, -8 }, // 0x6D 'm' | |
| 3378 | + { 891, 9, 9, 10, 1, -8 }, // 0x6E 'n' | |
| 3379 | + { 902, 9, 9, 10, 1, -8 }, // 0x6F 'o' | |
| 3380 | + { 913, 9, 12, 10, 1, -8 }, // 0x70 'p' | |
| 3381 | + { 927, 8, 12, 10, 1, -8 }, // 0x71 'q' | |
| 3382 | + { 939, 6, 9, 7, 1, -8 }, // 0x72 'r' | |
| 3383 | + { 946, 7, 9, 8, 1, -8 }, // 0x73 's' | |
| 3384 | + { 954, 6, 11, 7, 1, -10 }, // 0x74 't' | |
| 3385 | + { 963, 8, 9, 10, 1, -8 }, // 0x75 'u' | |
| 3386 | + { 972, 9, 9, 9, 1, -8 }, // 0x76 'v' | |
| 3387 | + { 983, 14, 9, 14, 0, -8 }, // 0x77 'w' | |
| 3388 | + { 999, 9, 9, 9, 0, -8 }, // 0x78 'x' | |
| 3389 | + { 1010, 9, 12, 9, 0, -8 }, // 0x79 'y' | |
| 3390 | + { 1024, 7, 9, 8, 1, -8 }, // 0x7A 'z' | |
| 3391 | + { 1032, 5, 16, 6, 1, -12 }, // 0x7B '{' | |
| 3392 | + { 1042, 1, 19, 5, 2, -13 }, // 0x7C '|' | |
| 3393 | + { 1045, 5, 16, 6, 1, -12 }, // 0x7D '}' | |
| 3394 | + { 1055, 8, 3, 9, 1, -6 } }; // 0x7E '~' | |
| 3395 | + | |
| 3396 | +const GFXfont sourcesans_bold9pt7b PROGMEM = { | |
| 3397 | + (uint8_t *)sourcesans_bold9pt7bBitmaps, | |
| 3398 | + (GFXglyph *)sourcesans_bold9pt7bGlyphs, | |
| 3399 | + 0x20, 0x7E, 24 }; | |
| 3400 | + | |
| 3401 | +const uint8_t DINAlternateBold9pt7bBitmaps[] PROGMEM = { | |
| 3402 | + 0x00, 0xFF, 0xFF, 0xCF, 0xFF, 0xF0, 0x32, 0x32, 0x36, 0xFF, 0x26, 0x24, | |
| 3403 | + 0x64, 0xFF, 0x64, 0x4C, 0x4C, 0x4C, 0x08, 0x08, 0x3E, 0x7E, 0x68, 0x68, | |
| 3404 | + 0x68, 0x3C, 0x1E, 0x0B, 0x0B, 0x4B, 0xFE, 0x3C, 0x08, 0x08, 0xE3, 0x4A, | |
| 3405 | + 0x97, 0x40, 0x82, 0x04, 0x17, 0x2A, 0x95, 0x2C, 0x70, 0x3C, 0x0F, 0xC1, | |
| 3406 | + 0x98, 0x33, 0x03, 0xC0, 0x70, 0x13, 0x06, 0x36, 0xC3, 0x9C, 0x71, 0xFF, | |
| 3407 | + 0x1E, 0x60, 0xFC, 0x22, 0x64, 0xCC, 0xCC, 0xCC, 0x46, 0x22, 0x84, 0x62, | |
| 3408 | + 0x33, 0x33, 0x33, 0x26, 0x48, 0x27, 0xC9, 0xF2, 0x00, 0x18, 0x0C, 0x06, | |
| 3409 | + 0x03, 0x0F, 0xFF, 0xFC, 0x60, 0x30, 0x18, 0x00, 0xF8, 0xFF, 0xC0, 0xF0, | |
| 3410 | + 0x0C, 0x21, 0x86, 0x10, 0xC2, 0x08, 0x61, 0x04, 0x30, 0x39, 0xFF, 0x1E, | |
| 3411 | + 0x3C, 0x78, 0xF1, 0xE3, 0xC7, 0x8F, 0xF9, 0xC0, 0x7F, 0xB3, 0x33, 0x33, | |
| 3412 | + 0x33, 0x33, 0x38, 0xFB, 0x1E, 0x30, 0x61, 0x86, 0x18, 0x70, 0xC3, 0xFF, | |
| 3413 | + 0xF0, 0x79, 0xFF, 0x18, 0x33, 0xC7, 0x83, 0x83, 0x07, 0x9F, 0xF3, 0xC0, | |
| 3414 | + 0x0C, 0x18, 0x18, 0x30, 0x30, 0x66, 0x66, 0xC6, 0xFF, 0xFF, 0x06, 0x06, | |
| 3415 | + 0xFF, 0xFF, 0x07, 0xEF, 0xD8, 0xC1, 0x83, 0x07, 0x8F, 0xF1, 0xC0, 0x18, | |
| 3416 | + 0x30, 0xC1, 0x86, 0x0F, 0x3F, 0x63, 0xC7, 0x8F, 0x3F, 0xE3, 0x00, 0xFF, | |
| 3417 | + 0xFF, 0x1E, 0x60, 0xC1, 0x86, 0x0C, 0x30, 0x60, 0xC3, 0x00, 0x7D, 0xFF, | |
| 3418 | + 0x1E, 0x37, 0xCF, 0xBB, 0xE3, 0xC7, 0xDD, 0xF1, 0xC0, 0x7D, 0xCF, 0x1E, | |
| 3419 | + 0x3C, 0x7F, 0xDF, 0x06, 0x18, 0x30, 0xC1, 0x80, 0xF0, 0xF0, 0xF0, 0xF8, | |
| 3420 | + 0x00, 0x81, 0xC7, 0x8E, 0x0C, 0x03, 0x80, 0x70, 0x0F, 0x00, 0x80, 0xFF, | |
| 3421 | + 0xFF, 0xC0, 0x1F, 0xFF, 0xF8, 0x80, 0x70, 0x0F, 0x00, 0xE0, 0x18, 0x38, | |
| 3422 | + 0x71, 0xE0, 0x80, 0x00, 0x7B, 0xFC, 0xF3, 0x0C, 0x63, 0x8C, 0x30, 0x03, | |
| 3423 | + 0x0C, 0x0F, 0xC1, 0xFF, 0x1F, 0xDD, 0xF1, 0xFF, 0x89, 0xF8, 0x4F, 0xC6, | |
| 3424 | + 0x7E, 0x26, 0x7F, 0xC3, 0x83, 0x8F, 0xF8, 0x1F, 0x00, 0x0C, 0x01, 0xC0, | |
| 3425 | + 0x38, 0x0D, 0x81, 0xB0, 0x62, 0x0C, 0x61, 0xFC, 0x7F, 0x8C, 0x19, 0x83, | |
| 3426 | + 0x60, 0x30, 0xFE, 0x7F, 0xF0, 0x78, 0x3C, 0x3F, 0xFB, 0xFD, 0x83, 0xC1, | |
| 3427 | + 0xE0, 0xFF, 0xDF, 0xC0, 0x3E, 0x3F, 0xB8, 0xF8, 0x3C, 0x06, 0x03, 0x01, | |
| 3428 | + 0x80, 0xC1, 0xF1, 0xDF, 0xC7, 0xC0, 0xFE, 0x7F, 0xB0, 0xF8, 0x3C, 0x1E, | |
| 3429 | + 0x0F, 0x07, 0x83, 0xC1, 0xE1, 0xFF, 0xDF, 0xC0, 0xFF, 0xFF, 0xC0, 0xC0, | |
| 3430 | + 0xC0, 0xFE, 0xFE, 0xC0, 0xC0, 0xC0, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0xC0, | |
| 3431 | + 0xC0, 0xFE, 0xFE, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x3E, 0x3F, 0xB8, 0xF8, | |
| 3432 | + 0x0C, 0x06, 0x3F, 0x1F, 0x83, 0xC1, 0xF1, 0xDF, 0xC7, 0xC0, 0xC1, 0xE0, | |
| 3433 | + 0xF0, 0x78, 0x3C, 0x1F, 0xFF, 0xFF, 0x83, 0xC1, 0xE0, 0xF0, 0x78, 0x30, | |
| 3434 | + 0xFF, 0xFF, 0xFF, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0x83, 0x06, 0x1F, | |
| 3435 | + 0xF3, 0xC0, 0xC1, 0xB0, 0xCC, 0x63, 0x30, 0xDC, 0x37, 0x0F, 0xE3, 0x98, | |
| 3436 | + 0xC3, 0x30, 0xCC, 0x1B, 0x07, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, | |
| 3437 | + 0xC0, 0xC0, 0xC0, 0xFF, 0xFF, 0xC0, 0x7C, 0x1F, 0x83, 0xF0, 0xFF, 0x1F, | |
| 3438 | + 0xE3, 0xF6, 0xDE, 0xDB, 0xCE, 0x79, 0xCF, 0x01, 0xE0, 0x30, 0xC1, 0xF0, | |
| 3439 | + 0xF8, 0x7E, 0x3D, 0x9E, 0xCF, 0x37, 0x9B, 0xC7, 0xE1, 0xF0, 0xF8, 0x30, | |
| 3440 | + 0x3E, 0x3F, 0xB8, 0xF8, 0x3C, 0x1E, 0x0F, 0x07, 0x83, 0xC1, 0xF1, 0xDF, | |
| 3441 | + 0xC7, 0xC0, 0xFE, 0x7F, 0xB0, 0xF8, 0x3C, 0x3F, 0xFB, 0xF9, 0x80, 0xC0, | |
| 3442 | + 0x60, 0x30, 0x18, 0x00, 0x3E, 0x1F, 0xCE, 0x3B, 0x06, 0xC1, 0xB0, 0x6C, | |
| 3443 | + 0x1B, 0x16, 0xCF, 0xB8, 0xE7, 0xFC, 0xFB, 0xFE, 0x3F, 0xCC, 0x1B, 0x06, | |
| 3444 | + 0xC3, 0xBF, 0xCF, 0xE3, 0x18, 0xC6, 0x30, 0xCC, 0x3B, 0x06, 0x1F, 0x0F, | |
| 3445 | + 0xF7, 0x09, 0x80, 0x60, 0x0F, 0x80, 0xF8, 0x03, 0x00, 0xD8, 0x77, 0xF8, | |
| 3446 | + 0x7C, 0xFF, 0xFF, 0xC6, 0x03, 0x01, 0x80, 0xC0, 0x60, 0x30, 0x18, 0x0C, | |
| 3447 | + 0x06, 0x03, 0x00, 0xC1, 0xE0, 0xF0, 0x78, 0x3C, 0x1E, 0x0F, 0x07, 0x83, | |
| 3448 | + 0xC1, 0xF1, 0xDF, 0xC7, 0xC0, 0xC0, 0xD0, 0x66, 0x19, 0x86, 0x23, 0x0C, | |
| 3449 | + 0xC3, 0x30, 0x58, 0x1E, 0x07, 0x80, 0xC0, 0x30, 0xC3, 0x0D, 0x8C, 0x36, | |
| 3450 | + 0x38, 0xD8, 0xE3, 0x66, 0x98, 0x9B, 0x63, 0x4D, 0x8F, 0x36, 0x3C, 0x70, | |
| 3451 | + 0x71, 0xC1, 0x87, 0x06, 0x08, 0xE1, 0x98, 0xC3, 0x30, 0xD8, 0x1E, 0x07, | |
| 3452 | + 0x01, 0xC0, 0x78, 0x36, 0x1C, 0xC6, 0x1B, 0x06, 0xE1, 0xD8, 0x63, 0x30, | |
| 3453 | + 0xCC, 0x1E, 0x07, 0x80, 0xC0, 0x30, 0x0C, 0x03, 0x00, 0xC0, 0x30, 0xFF, | |
| 3454 | + 0xFF, 0x06, 0x06, 0x0C, 0x18, 0x18, 0x30, 0x60, 0xE0, 0xFF, 0xFF, 0xFC, | |
| 3455 | + 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCF, 0xC1, 0x04, 0x18, 0x20, 0x83, 0x04, | |
| 3456 | + 0x18, 0x60, 0x83, 0xF3, 0x33, 0x33, 0x33, 0x33, 0x33, 0x3F, 0x08, 0x0C, | |
| 3457 | + 0x05, 0x06, 0x82, 0x63, 0x11, 0x0D, 0x82, 0xFF, 0x80, 0xE6, 0x30, 0x3C, | |
| 3458 | + 0xFC, 0x1B, 0xFF, 0xF8, 0xF1, 0xFF, 0x7E, 0xC1, 0x83, 0x06, 0xEF, 0xF8, | |
| 3459 | + 0xF1, 0xC3, 0xC7, 0x8F, 0xFE, 0xE0, 0x3C, 0xFF, 0x8E, 0x0C, 0x18, 0x38, | |
| 3460 | + 0x3F, 0x3C, 0x06, 0x0C, 0x1B, 0xBF, 0xF8, 0xF1, 0xE3, 0xC7, 0x8F, 0xFB, | |
| 3461 | + 0xB0, 0x38, 0xFB, 0x1F, 0xFF, 0xF8, 0x39, 0x3F, 0x3C, 0x3B, 0xD9, 0xFF, | |
| 3462 | + 0xB1, 0x8C, 0x63, 0x18, 0xC0, 0x77, 0xFF, 0x1E, 0x3C, 0x78, 0xF1, 0xFF, | |
| 3463 | + 0x76, 0x0D, 0x3F, 0xE7, 0x80, 0xC1, 0x83, 0x06, 0xEF, 0xF8, 0xF1, 0xE3, | |
| 3464 | + 0xC7, 0x8F, 0x1E, 0x30, 0xF3, 0xFF, 0xFF, 0x33, 0x03, 0x33, 0x33, 0x33, | |
| 3465 | + 0x33, 0x33, 0xFE, 0xC0, 0xC0, 0xC0, 0xC6, 0xCC, 0xD8, 0xD8, 0xF8, 0xEC, | |
| 3466 | + 0xCC, 0xC6, 0xC3, 0xDB, 0x6D, 0xB6, 0xDB, 0xB0, 0xDD, 0xEF, 0xFF, 0xC6, | |
| 3467 | + 0x3C, 0x63, 0xC6, 0x3C, 0x63, 0xC6, 0x3C, 0x63, 0xC6, 0x30, 0xDD, 0xFF, | |
| 3468 | + 0x1E, 0x3C, 0x78, 0xF1, 0xE3, 0xC6, 0x38, 0xFB, 0x1E, 0x3C, 0x78, 0xF1, | |
| 3469 | + 0xBE, 0x38, 0xDD, 0xFF, 0x1E, 0x38, 0x78, 0xF1, 0xFF, 0xDD, 0x83, 0x06, | |
| 3470 | + 0x0C, 0x00, 0x77, 0xFF, 0x1E, 0x3C, 0x78, 0xF1, 0xFF, 0x76, 0x0C, 0x18, | |
| 3471 | + 0x30, 0x60, 0xDF, 0xFC, 0x30, 0xC3, 0x0C, 0x30, 0xC0, 0x3E, 0x7F, 0x62, | |
| 3472 | + 0x60, 0x3E, 0x03, 0x43, 0x7F, 0x3E, 0x66, 0x6F, 0xF6, 0x66, 0x66, 0x73, | |
| 3473 | + 0xC7, 0x8F, 0x1E, 0x3C, 0x78, 0xF1, 0xFF, 0x76, 0xC3, 0xC2, 0x66, 0x66, | |
| 3474 | + 0x24, 0x3C, 0x3C, 0x18, 0x18, 0xC2, 0x1A, 0x31, 0x99, 0xCC, 0xCA, 0x66, | |
| 3475 | + 0xD2, 0x16, 0xF0, 0xE7, 0x87, 0x18, 0x18, 0xC0, 0x63, 0x66, 0x3E, 0x1C, | |
| 3476 | + 0x18, 0x3C, 0x36, 0x66, 0xE3, 0xC3, 0xC2, 0x66, 0x66, 0x24, 0x3C, 0x3C, | |
| 3477 | + 0x18, 0x18, 0x18, 0x30, 0x70, 0x60, 0xFF, 0xF0, 0x86, 0x31, 0x84, 0x3F, | |
| 3478 | + 0xFC, 0x1C, 0xC3, 0x0C, 0x30, 0xCC, 0x1C, 0x30, 0xC3, 0x0C, 0x30, 0x70, | |
| 3479 | + 0xFF, 0xFF, 0xFF, 0xE1, 0x8C, 0x63, 0x18, 0x63, 0x31, 0x8C, 0x63, 0x70, | |
| 3480 | + 0x71, 0xFF, 0x8E }; | |
| 3481 | + | |
| 3482 | +const GFXglyph DINAlternateBold9pt7bGlyphs[] PROGMEM = { | |
| 3483 | + { 0, 1, 1, 4, 0, 0 }, // 0x20 ' ' | |
| 3484 | + { 1, 2, 12, 4, 1, -11 }, // 0x21 '!' | |
| 3485 | + { 4, 4, 3, 6, 1, -11 }, // 0x22 '"' | |
| 3486 | + { 6, 8, 12, 10, 1, -11 }, // 0x23 '#' | |
| 3487 | + { 18, 8, 16, 9, 0, -13 }, // 0x24 '$' | |
| 3488 | + { 34, 7, 12, 9, 1, -11 }, // 0x25 '%' | |
| 3489 | + { 45, 11, 12, 12, 1, -11 }, // 0x26 '&' | |
| 3490 | + { 62, 2, 3, 4, 1, -11 }, // 0x27 ''' | |
| 3491 | + { 63, 4, 14, 5, 1, -11 }, // 0x28 '(' | |
| 3492 | + { 70, 4, 14, 5, 0, -11 }, // 0x29 ')' | |
| 3493 | + { 77, 5, 5, 7, 1, -11 }, // 0x2A '*' | |
| 3494 | + { 81, 9, 9, 11, 1, -8 }, // 0x2B '+' | |
| 3495 | + { 92, 2, 3, 4, 1, -1 }, // 0x2C ',' | |
| 3496 | + { 93, 5, 2, 7, 1, -5 }, // 0x2D '-' | |
| 3497 | + { 95, 2, 2, 4, 1, -1 }, // 0x2E '.' | |
| 3498 | + { 96, 6, 12, 6, 0, -11 }, // 0x2F '/' | |
| 3499 | + { 105, 7, 12, 8, 1, -11 }, // 0x30 '0' | |
| 3500 | + { 116, 4, 12, 8, 2, -11 }, // 0x31 '1' | |
| 3501 | + { 122, 7, 12, 8, 1, -11 }, // 0x32 '2' | |
| 3502 | + { 133, 7, 12, 8, 1, -11 }, // 0x33 '3' | |
| 3503 | + { 144, 8, 12, 8, 1, -11 }, // 0x34 '4' | |
| 3504 | + { 156, 7, 12, 8, 1, -11 }, // 0x35 '5' | |
| 3505 | + { 167, 7, 13, 8, 1, -11 }, // 0x36 '6' | |
| 3506 | + { 179, 7, 12, 8, 1, -11 }, // 0x37 '7' | |
| 3507 | + { 190, 7, 12, 8, 1, -11 }, // 0x38 '8' | |
| 3508 | + { 201, 7, 12, 8, 1, -11 }, // 0x39 '9' | |
| 3509 | + { 212, 2, 6, 4, 1, -5 }, // 0x3A ':' | |
| 3510 | + { 214, 2, 7, 4, 1, -5 }, // 0x3B ';' | |
| 3511 | + { 216, 9, 9, 11, 1, -8 }, // 0x3C '<' | |
| 3512 | + { 227, 9, 5, 11, 1, -6 }, // 0x3D '=' | |
| 3513 | + { 233, 9, 9, 11, 1, -8 }, // 0x3E '>' | |
| 3514 | + { 244, 6, 12, 8, 1, -11 }, // 0x3F '?' | |
| 3515 | + { 253, 13, 12, 15, 1, -11 }, // 0x40 '@' | |
| 3516 | + { 273, 11, 12, 11, 0, -11 }, // 0x41 'A' | |
| 3517 | + { 290, 9, 12, 11, 1, -11 }, // 0x42 'B' | |
| 3518 | + { 304, 9, 12, 10, 1, -11 }, // 0x43 'C' | |
| 3519 | + { 318, 9, 12, 11, 1, -11 }, // 0x44 'D' | |
| 3520 | + { 332, 8, 12, 10, 1, -11 }, // 0x45 'E' | |
| 3521 | + { 344, 8, 12, 10, 1, -11 }, // 0x46 'F' | |
| 3522 | + { 356, 9, 12, 11, 1, -11 }, // 0x47 'G' | |
| 3523 | + { 370, 9, 12, 11, 1, -11 }, // 0x48 'H' | |
| 3524 | + { 384, 2, 12, 4, 1, -11 }, // 0x49 'I' | |
| 3525 | + { 387, 7, 12, 8, 0, -11 }, // 0x4A 'J' | |
| 3526 | + { 398, 10, 12, 11, 1, -11 }, // 0x4B 'K' | |
| 3527 | + { 413, 8, 12, 10, 1, -11 }, // 0x4C 'L' | |
| 3528 | + { 425, 11, 12, 13, 1, -11 }, // 0x4D 'M' | |
| 3529 | + { 442, 9, 12, 11, 1, -11 }, // 0x4E 'N' | |
| 3530 | + { 456, 9, 12, 11, 1, -11 }, // 0x4F 'O' | |
| 3531 | + { 470, 9, 12, 11, 1, -11 }, // 0x50 'P' | |
| 3532 | + { 484, 10, 12, 11, 1, -11 }, // 0x51 'Q' | |
| 3533 | + { 499, 10, 12, 11, 1, -11 }, // 0x52 'R' | |
| 3534 | + { 514, 10, 12, 11, 0, -11 }, // 0x53 'S' | |
| 3535 | + { 529, 9, 12, 11, 1, -11 }, // 0x54 'T' | |
| 3536 | + { 543, 9, 12, 11, 1, -11 }, // 0x55 'U' | |
| 3537 | + { 557, 10, 12, 10, 0, -11 }, // 0x56 'V' | |
| 3538 | + { 572, 14, 12, 15, 0, -11 }, // 0x57 'W' | |
| 3539 | + { 593, 10, 12, 9, 0, -11 }, // 0x58 'X' | |
| 3540 | + { 608, 10, 12, 10, 0, -11 }, // 0x59 'Y' | |
| 3541 | + { 623, 8, 12, 10, 1, -11 }, // 0x5A 'Z' | |
| 3542 | + { 635, 4, 14, 5, 1, -11 }, // 0x5B '[' | |
| 3543 | + { 642, 6, 12, 6, 0, -11 }, // 0x5C '\' | |
| 3544 | + { 651, 4, 14, 5, 0, -11 }, // 0x5D ']' | |
| 3545 | + { 658, 9, 8, 11, 1, -12 }, // 0x5E '^' | |
| 3546 | + { 667, 9, 1, 9, 0, 2 }, // 0x5F '_' | |
| 3547 | + { 669, 4, 3, 4, -1, -12 }, // 0x60 '`' | |
| 3548 | + { 671, 7, 9, 9, 1, -8 }, // 0x61 'a' | |
| 3549 | + { 679, 7, 12, 9, 1, -11 }, // 0x62 'b' | |
| 3550 | + { 690, 7, 9, 9, 1, -8 }, // 0x63 'c' | |
| 3551 | + { 698, 7, 12, 9, 1, -11 }, // 0x64 'd' | |
| 3552 | + { 709, 7, 9, 9, 1, -8 }, // 0x65 'e' | |
| 3553 | + { 717, 5, 12, 6, 1, -11 }, // 0x66 'f' | |
| 3554 | + { 725, 7, 13, 9, 1, -8 }, // 0x67 'g' | |
| 3555 | + { 737, 7, 12, 9, 1, -11 }, // 0x68 'h' | |
| 3556 | + { 748, 2, 12, 4, 1, -11 }, // 0x69 'i' | |
| 3557 | + { 751, 4, 16, 4, -1, -11 }, // 0x6A 'j' | |
| 3558 | + { 759, 8, 12, 9, 1, -11 }, // 0x6B 'k' | |
| 3559 | + { 771, 3, 12, 5, 1, -11 }, // 0x6C 'l' | |
| 3560 | + { 776, 12, 9, 14, 1, -8 }, // 0x6D 'm' | |
| 3561 | + { 790, 7, 9, 9, 1, -8 }, // 0x6E 'n' | |
| 3562 | + { 798, 7, 9, 9, 1, -8 }, // 0x6F 'o' | |
| 3563 | + { 806, 7, 13, 9, 1, -8 }, // 0x70 'p' | |
| 3564 | + { 818, 7, 13, 9, 1, -8 }, // 0x71 'q' | |
| 3565 | + { 830, 6, 9, 7, 1, -8 }, // 0x72 'r' | |
| 3566 | + { 837, 8, 9, 9, 0, -8 }, // 0x73 's' | |
| 3567 | + { 846, 4, 12, 6, 1, -11 }, // 0x74 't' | |
| 3568 | + { 852, 7, 9, 9, 1, -8 }, // 0x75 'u' | |
| 3569 | + { 860, 8, 9, 8, 0, -8 }, // 0x76 'v' | |
| 3570 | + { 869, 13, 9, 13, 0, -8 }, // 0x77 'w' | |
| 3571 | + { 884, 8, 9, 8, 0, -8 }, // 0x78 'x' | |
| 3572 | + { 893, 8, 13, 8, 0, -8 }, // 0x79 'y' | |
| 3573 | + { 906, 6, 9, 8, 1, -8 }, // 0x7A 'z' | |
| 3574 | + { 913, 6, 14, 6, 0, -11 }, // 0x7B '{' | |
| 3575 | + { 924, 2, 12, 4, 1, -11 }, // 0x7C '|' | |
| 3576 | + { 927, 5, 14, 6, 0, -11 }, // 0x7D '}' | |
| 3577 | + { 936, 8, 3, 11, 1, -5 } }; // 0x7E '~' | |
| 3578 | + | |
| 3579 | +const GFXfont DINAlternateBold9pt7b PROGMEM = { | |
| 3580 | + (uint8_t *)DINAlternateBold9pt7bBitmaps, | |
| 3581 | + (GFXglyph *)DINAlternateBold9pt7bGlyphs, | |
| 3582 | + 0x20, 0x7E, 21 }; | |
| 3583 | + | |
| 3584 | +// Approx. 1611 bytes | |
| 3585 | +const uint8_t DINCondensedBold9pt7bBitmaps[] PROGMEM = { | |
| 3586 | + 0x00, 0xFF, 0xFF, 0xCF, 0xFF, 0xF0, 0x25, 0x96, 0xFF, 0x49, 0x24, 0xBF, | |
| 3587 | + 0xDB, 0x69, 0x24, 0x10, 0xE7, 0xF7, 0xDF, 0x4F, 0x0F, 0x1C, 0x7D, 0xF7, | |
| 3588 | + 0x7C, 0x41, 0x00, 0xEE, 0xAE, 0x86, 0x10, 0x42, 0x08, 0x7D, 0x55, 0x77, | |
| 3589 | + 0x78, 0xFC, 0xCC, 0xCC, 0x78, 0x30, 0x70, 0xDB, 0xCE, 0xCE, 0xFE, 0x73, | |
| 3590 | + 0xFC, 0x2D, 0x2D, 0xB6, 0xD9, 0x26, 0x40, 0x99, 0x26, 0xDB, 0x6D, 0x2D, | |
| 3591 | + 0x00, 0x25, 0x5C, 0xEA, 0x90, 0x18, 0x0C, 0x06, 0x03, 0x0F, 0xFF, 0xFC, | |
| 3592 | + 0x60, 0x30, 0x18, 0x00, 0xF8, 0xFF, 0xC0, 0xF0, 0x33, 0x22, 0x26, 0x64, | |
| 3593 | + 0x44, 0xCC, 0x77, 0xF7, 0xBD, 0xEF, 0x7B, 0xDE, 0xFE, 0xE0, 0x7F, 0xB3, | |
| 3594 | + 0x33, 0x33, 0x33, 0x33, 0x77, 0xF7, 0xB1, 0x98, 0xCC, 0x66, 0x3F, 0xF0, | |
| 3595 | + 0x77, 0xF6, 0x33, 0x98, 0x63, 0xDE, 0xFE, 0xE0, 0x30, 0xC6, 0x18, 0x61, | |
| 3596 | + 0x6D, 0xB6, 0xFF, 0xF1, 0x86, 0xFF, 0xF1, 0x8F, 0x7E, 0x63, 0x1E, 0xFE, | |
| 3597 | + 0xE0, 0x31, 0x88, 0xC6, 0x7F, 0x7B, 0xDE, 0xFE, 0xE0, 0xFF, 0xFC, 0x86, | |
| 3598 | + 0x18, 0x63, 0x0C, 0x31, 0x86, 0x18, 0x77, 0xF7, 0xBF, 0xFF, 0x7B, 0xDE, | |
| 3599 | + 0xFE, 0xE0, 0x77, 0xF7, 0xBD, 0xEF, 0xE6, 0x31, 0x18, 0xC0, 0xF0, 0xF0, | |
| 3600 | + 0xF0, 0xF8, 0x00, 0x81, 0xC7, 0x8E, 0x0C, 0x03, 0x80, 0x70, 0x0E, 0x00, | |
| 3601 | + 0x80, 0xFF, 0xFF, 0xC0, 0x1F, 0xFF, 0xF8, 0x80, 0x70, 0x0F, 0x00, 0xE0, | |
| 3602 | + 0x18, 0x38, 0x70, 0xE0, 0x80, 0x00, 0x77, 0xF3, 0x90, 0x8C, 0xC6, 0x30, | |
| 3603 | + 0x0C, 0x60, 0x0F, 0x81, 0xC3, 0x1B, 0xDC, 0xFE, 0xBD, 0x89, 0xF8, 0x4F, | |
| 3604 | + 0xC6, 0xFE, 0x26, 0x7F, 0xF3, 0xE7, 0x8E, 0x18, 0x1F, 0x00, 0x10, 0x70, | |
| 3605 | + 0xE1, 0x42, 0x85, 0x9B, 0x3E, 0x7C, 0x8F, 0x1E, 0x30, 0xFB, 0xFC, 0xF3, | |
| 3606 | + 0xFB, 0xEC, 0xF3, 0xCF, 0x3F, 0xFE, 0x7B, 0xFC, 0xF3, 0xC3, 0x0C, 0x30, | |
| 3607 | + 0xCF, 0x3F, 0xDE, 0xFB, 0xFC, 0xF3, 0xCF, 0x3C, 0xF3, 0xCF, 0x3F, 0xFE, | |
| 3608 | + 0xFF, 0xFC, 0x30, 0xC3, 0xEF, 0xB0, 0xC3, 0x0F, 0xFF, 0xFF, 0xFC, 0x30, | |
| 3609 | + 0xC3, 0xEF, 0xB0, 0xC3, 0x0C, 0x30, 0x7B, 0xFC, 0xF0, 0xC3, 0x7D, 0xF3, | |
| 3610 | + 0xCF, 0x3F, 0xDE, 0xCF, 0x3C, 0xF3, 0xCF, 0xFF, 0xF3, 0xCF, 0x3C, 0xF3, | |
| 3611 | + 0xFF, 0xFF, 0xFF, 0x0C, 0x30, 0xC3, 0x0C, 0x30, 0xC3, 0x0C, 0x37, 0xDE, | |
| 3612 | + 0xCD, 0x9B, 0x66, 0xCF, 0x1E, 0x3E, 0x7C, 0xCD, 0x9B, 0x36, 0x30, 0xC3, | |
| 3613 | + 0x0C, 0x30, 0xC3, 0x0C, 0x30, 0xC3, 0x0F, 0xFF, 0xC3, 0xC3, 0xE7, 0xE7, | |
| 3614 | + 0xE7, 0xFF, 0xDB, 0xDB, 0xDB, 0xDB, 0xC3, 0xC3, 0xCF, 0x3E, 0xFB, 0xEF, | |
| 3615 | + 0xBD, 0xF7, 0xDF, 0x7C, 0xF3, 0x7B, 0xFC, 0xF3, 0xCF, 0x3C, 0xF3, 0xCF, | |
| 3616 | + 0x3F, 0xDE, 0xFB, 0xFC, 0xF3, 0xCF, 0xFF, 0xB0, 0xC3, 0x0C, 0x30, 0x79, | |
| 3617 | + 0xFB, 0x36, 0x6C, 0xD9, 0xB3, 0x66, 0xDD, 0xBB, 0xF3, 0xA0, 0xFB, 0xFC, | |
| 3618 | + 0xF3, 0xCF, 0xFF, 0x36, 0xDB, 0x2C, 0xF3, 0x7B, 0xFC, 0xF3, 0xC1, 0xC1, | |
| 3619 | + 0xC3, 0xCF, 0x3F, 0xDE, 0xFF, 0xF3, 0x0C, 0x30, 0xC3, 0x0C, 0x30, 0xC3, | |
| 3620 | + 0x0C, 0xCF, 0x3C, 0xF3, 0xCF, 0x3C, 0xF3, 0xCF, 0x3F, 0xDE, 0xC6, 0x8D, | |
| 3621 | + 0x93, 0x66, 0xCD, 0x8B, 0x14, 0x38, 0x70, 0xE0, 0x80, 0xCC, 0xD3, 0x34, | |
| 3622 | + 0xCD, 0xBB, 0x6E, 0x9F, 0xA7, 0xA9, 0xEE, 0x33, 0x8C, 0xE3, 0x38, 0xC4, | |
| 3623 | + 0xC6, 0xD9, 0xB1, 0xC3, 0x86, 0x0E, 0x1C, 0x68, 0xD9, 0x36, 0x30, 0xCF, | |
| 3624 | + 0x3C, 0xDE, 0x79, 0xE3, 0x0C, 0x30, 0xC3, 0x0C, 0xFF, 0xC6, 0x23, 0x19, | |
| 3625 | + 0x8C, 0x46, 0x3F, 0xF0, 0xFB, 0x6D, 0xB6, 0xDB, 0x6D, 0xC0, 0xCC, 0x44, | |
| 3626 | + 0x46, 0x62, 0x22, 0x33, 0xED, 0xB6, 0xDB, 0x6D, 0xB7, 0xC0, 0x08, 0x0C, | |
| 3627 | + 0x07, 0x06, 0x82, 0x23, 0x11, 0x05, 0x82, 0xFF, 0x80, 0xC6, 0x20, 0x7B, | |
| 3628 | + 0xF0, 0xDF, 0xFF, 0x3C, 0xFF, 0x6C, 0xC6, 0x31, 0xFF, 0xEF, 0x7B, 0xDE, | |
| 3629 | + 0xFF, 0xF0, 0x73, 0xEC, 0xB0, 0xC3, 0x0C, 0xBE, 0x70, 0x18, 0xC7, 0xFF, | |
| 3630 | + 0xEF, 0x7B, 0xDE, 0xFF, 0xF0, 0x77, 0xF7, 0xFF, 0xE3, 0x7F, 0x70, 0x37, | |
| 3631 | + 0x6F, 0xF6, 0x66, 0x66, 0x66, 0xFF, 0xF7, 0xBD, 0xEF, 0x7F, 0xF8, 0xF7, | |
| 3632 | + 0xF7, 0x00, 0xC6, 0x31, 0xFF, 0xEF, 0x7B, 0xDE, 0xF7, 0xB0, 0xF3, 0xFF, | |
| 3633 | + 0xFF, 0x6C, 0x36, 0xDB, 0x6D, 0xB6, 0xFE, 0xC3, 0x0C, 0x33, 0xDB, 0x6F, | |
| 3634 | + 0x3C, 0xFB, 0x6C, 0xF3, 0xDB, 0x6D, 0xB6, 0xDB, 0xB0, 0xF6, 0xFF, 0xDB, | |
| 3635 | + 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xFF, 0xF7, 0xBD, 0xEF, 0x7B, 0xD8, | |
| 3636 | + 0x77, 0xF7, 0xBD, 0xEF, 0x7F, 0x70, 0xFF, 0xF7, 0xBD, 0xEF, 0x7F, 0xFE, | |
| 3637 | + 0x31, 0x8C, 0x00, 0xFF, 0xF7, 0xBD, 0xEF, 0x7F, 0xF8, 0xC6, 0x31, 0x80, | |
| 3638 | + 0xDF, 0xCC, 0xCC, 0xCC, 0xC0, 0x77, 0xF7, 0x87, 0x0F, 0x7F, 0x70, 0x66, | |
| 3639 | + 0x6F, 0xF6, 0x66, 0x66, 0x73, 0xDE, 0xF7, 0xBD, 0xEF, 0x7F, 0xF8, 0xCF, | |
| 3640 | + 0x34, 0xDA, 0x79, 0xE3, 0x8C, 0x30, 0xCD, 0xE6, 0xD3, 0x6F, 0xB7, 0xD3, | |
| 3641 | + 0xB8, 0xDC, 0x6E, 0x32, 0x00, 0xCD, 0x67, 0x8C, 0x31, 0xC7, 0x96, 0xCC, | |
| 3642 | + 0xC4, 0xD9, 0xB3, 0x62, 0x85, 0x0E, 0x1C, 0x18, 0x20, 0xC3, 0x86, 0x00, | |
| 3643 | + 0xFF, 0xC6, 0x62, 0x33, 0x1F, 0xF8, 0x36, 0x66, 0x66, 0x68, 0x66, 0x66, | |
| 3644 | + 0x63, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0xC6, 0x66, 0x66, 0x61, 0x66, 0x66, | |
| 3645 | + 0x6C, 0x71, 0xFF, 0x8E }; | |
| 3646 | + | |
| 3647 | +const GFXglyph DINCondensedBold9pt7bGlyphs[] PROGMEM = { | |
| 3648 | + { 0, 1, 1, 3, 0, 0 }, // 0x20 ' ' | |
| 3649 | + { 1, 2, 12, 4, 1, -11 }, // 0x21 '!' | |
| 3650 | + { 4, 4, 3, 6, 1, -11 }, // 0x22 '"' | |
| 3651 | + { 6, 6, 12, 8, 1, -11 }, // 0x23 '#' | |
| 3652 | + { 15, 6, 15, 8, 1, -12 }, // 0x24 '$' | |
| 3653 | + { 27, 6, 12, 8, 1, -11 }, // 0x25 '%' | |
| 3654 | + { 36, 8, 12, 9, 1, -11 }, // 0x26 '&' | |
| 3655 | + { 48, 2, 3, 4, 1, -11 }, // 0x27 ''' | |
| 3656 | + { 49, 3, 14, 4, 1, -11 }, // 0x28 '(' | |
| 3657 | + { 55, 3, 14, 4, 0, -11 }, // 0x29 ')' | |
| 3658 | + { 61, 5, 6, 7, 1, -11 }, // 0x2A '*' | |
| 3659 | + { 65, 9, 9, 11, 1, -8 }, // 0x2B '+' | |
| 3660 | + { 76, 2, 3, 4, 1, -1 }, // 0x2C ',' | |
| 3661 | + { 77, 5, 2, 7, 1, -5 }, // 0x2D '-' | |
| 3662 | + { 79, 2, 2, 4, 1, -1 }, // 0x2E '.' | |
| 3663 | + { 80, 4, 12, 4, 0, -11 }, // 0x2F '/' | |
| 3664 | + { 86, 5, 12, 7, 1, -11 }, // 0x30 '0' | |
| 3665 | + { 94, 4, 12, 7, 1, -11 }, // 0x31 '1' | |
| 3666 | + { 100, 5, 12, 7, 1, -11 }, // 0x32 '2' | |
| 3667 | + { 108, 5, 12, 7, 1, -11 }, // 0x33 '3' | |
| 3668 | + { 116, 6, 12, 7, 1, -11 }, // 0x34 '4' | |
| 3669 | + { 125, 5, 12, 7, 1, -11 }, // 0x35 '5' | |
| 3670 | + { 133, 5, 12, 7, 1, -11 }, // 0x36 '6' | |
| 3671 | + { 141, 6, 12, 7, 1, -11 }, // 0x37 '7' | |
| 3672 | + { 150, 5, 12, 7, 1, -11 }, // 0x38 '8' | |
| 3673 | + { 158, 5, 12, 7, 1, -11 }, // 0x39 '9' | |
| 3674 | + { 166, 2, 6, 4, 1, -5 }, // 0x3A ':' | |
| 3675 | + { 168, 2, 7, 4, 1, -5 }, // 0x3B ';' | |
| 3676 | + { 170, 9, 9, 11, 1, -8 }, // 0x3C '<' | |
| 3677 | + { 181, 9, 5, 11, 1, -6 }, // 0x3D '=' | |
| 3678 | + { 187, 9, 9, 11, 1, -8 }, // 0x3E '>' | |
| 3679 | + { 198, 5, 12, 7, 1, -11 }, // 0x3F '?' | |
| 3680 | + { 206, 13, 12, 15, 1, -11 }, // 0x40 '@' | |
| 3681 | + { 226, 7, 12, 7, 0, -11 }, // 0x41 'A' | |
| 3682 | + { 237, 6, 12, 8, 1, -11 }, // 0x42 'B' | |
| 3683 | + { 246, 6, 12, 8, 1, -11 }, // 0x43 'C' | |
| 3684 | + { 255, 6, 12, 8, 1, -11 }, // 0x44 'D' | |
| 3685 | + { 264, 6, 12, 7, 1, -11 }, // 0x45 'E' | |
| 3686 | + { 273, 6, 12, 7, 1, -11 }, // 0x46 'F' | |
| 3687 | + { 282, 6, 12, 8, 1, -11 }, // 0x47 'G' | |
| 3688 | + { 291, 6, 12, 8, 1, -11 }, // 0x48 'H' | |
| 3689 | + { 300, 2, 12, 4, 1, -11 }, // 0x49 'I' | |
| 3690 | + { 303, 6, 12, 6, -1, -11 }, // 0x4A 'J' | |
| 3691 | + { 312, 7, 12, 8, 1, -11 }, // 0x4B 'K' | |
| 3692 | + { 323, 6, 12, 7, 1, -11 }, // 0x4C 'L' | |
| 3693 | + { 332, 8, 12, 10, 1, -11 }, // 0x4D 'M' | |
| 3694 | + { 344, 6, 12, 8, 1, -11 }, // 0x4E 'N' | |
| 3695 | + { 353, 6, 12, 8, 1, -11 }, // 0x4F 'O' | |
| 3696 | + { 362, 6, 12, 8, 1, -11 }, // 0x50 'P' | |
| 3697 | + { 371, 7, 12, 8, 1, -11 }, // 0x51 'Q' | |
| 3698 | + { 382, 6, 12, 8, 1, -11 }, // 0x52 'R' | |
| 3699 | + { 391, 6, 12, 8, 1, -11 }, // 0x53 'S' | |
| 3700 | + { 400, 6, 12, 6, 0, -11 }, // 0x54 'T' | |
| 3701 | + { 409, 6, 12, 8, 1, -11 }, // 0x55 'U' | |
| 3702 | + { 418, 7, 12, 7, 0, -11 }, // 0x56 'V' | |
| 3703 | + { 429, 10, 12, 10, 0, -11 }, // 0x57 'W' | |
| 3704 | + { 444, 7, 12, 7, 0, -11 }, // 0x58 'X' | |
| 3705 | + { 455, 6, 12, 8, 1, -11 }, // 0x59 'Y' | |
| 3706 | + { 464, 5, 12, 7, 1, -11 }, // 0x5A 'Z' | |
| 3707 | + { 472, 3, 14, 4, 1, -11 }, // 0x5B '[' | |
| 3708 | + { 478, 4, 12, 4, 0, -11 }, // 0x5C '\' | |
| 3709 | + { 484, 3, 14, 4, 0, -11 }, // 0x5D ']' | |
| 3710 | + { 490, 9, 8, 11, 1, -12 }, // 0x5E '^' | |
| 3711 | + { 499, 9, 1, 9, 0, 2 }, // 0x5F '_' | |
| 3712 | + { 501, 4, 3, 3, -1, -12 }, // 0x60 '`' | |
| 3713 | + { 503, 6, 9, 8, 1, -8 }, // 0x61 'a' | |
| 3714 | + { 510, 5, 12, 7, 1, -11 }, // 0x62 'b' | |
| 3715 | + { 518, 6, 9, 7, 1, -8 }, // 0x63 'c' | |
| 3716 | + { 525, 5, 12, 7, 1, -11 }, // 0x64 'd' | |
| 3717 | + { 533, 5, 9, 7, 1, -8 }, // 0x65 'e' | |
| 3718 | + { 539, 4, 12, 5, 1, -11 }, // 0x66 'f' | |
| 3719 | + { 545, 5, 13, 7, 1, -8 }, // 0x67 'g' | |
| 3720 | + { 554, 5, 12, 7, 1, -11 }, // 0x68 'h' | |
| 3721 | + { 562, 2, 12, 4, 1, -11 }, // 0x69 'i' | |
| 3722 | + { 565, 3, 16, 4, 0, -11 }, // 0x6A 'j' | |
| 3723 | + { 571, 6, 12, 7, 1, -11 }, // 0x6B 'k' | |
| 3724 | + { 580, 3, 12, 4, 1, -11 }, // 0x6C 'l' | |
| 3725 | + { 585, 8, 9, 10, 1, -8 }, // 0x6D 'm' | |
| 3726 | + { 594, 5, 9, 7, 1, -8 }, // 0x6E 'n' | |
| 3727 | + { 600, 5, 9, 7, 1, -8 }, // 0x6F 'o' | |
| 3728 | + { 606, 5, 13, 7, 1, -8 }, // 0x70 'p' | |
| 3729 | + { 615, 5, 13, 7, 1, -8 }, // 0x71 'q' | |
| 3730 | + { 624, 4, 9, 5, 1, -8 }, // 0x72 'r' | |
| 3731 | + { 629, 5, 9, 7, 1, -8 }, // 0x73 's' | |
| 3732 | + { 635, 4, 12, 4, 0, -11 }, // 0x74 't' | |
| 3733 | + { 641, 5, 9, 7, 1, -8 }, // 0x75 'u' | |
| 3734 | + { 647, 6, 9, 6, 0, -8 }, // 0x76 'v' | |
| 3735 | + { 654, 9, 9, 9, 0, -8 }, // 0x77 'w' | |
| 3736 | + { 665, 6, 9, 6, 0, -8 }, // 0x78 'x' | |
| 3737 | + { 672, 7, 13, 6, 0, -8 }, // 0x79 'y' | |
| 3738 | + { 684, 5, 9, 7, 1, -8 }, // 0x7A 'z' | |
| 3739 | + { 690, 4, 14, 5, 1, -11 }, // 0x7B '{' | |
| 3740 | + { 697, 2, 17, 4, 1, -12 }, // 0x7C '|' | |
| 3741 | + { 702, 4, 14, 4, 0, -11 }, // 0x7D '}' | |
| 3742 | + { 709, 8, 3, 11, 1, -5 } }; // 0x7E '~' | |
| 3743 | + | |
| 3744 | +const GFXfont DINCondensedBold9pt7b PROGMEM = { | |
| 3745 | + (uint8_t *)DINCondensedBold9pt7bBitmaps, | |
| 3746 | + (GFXglyph *)DINCondensedBold9pt7bGlyphs, | |
| 3747 | + 0x20, 0x7E, 21 }; | |
| 3748 | + | |
| 3749 | +// Approx. 1384 bytes | |
| 3750 | +const uint8_t EuphemiaCAS9pt7bBitmaps[] PROGMEM = { | |
| 3751 | + 0x00, 0xFF, 0xFF, 0xF0, 0x40, 0xDE, 0xD2, 0x0C, 0x20, 0x20, 0x80, 0x82, | |
| 3752 | + 0x1F, 0xFF, 0x08, 0x60, 0x21, 0x01, 0x84, 0x06, 0x10, 0x10, 0x40, 0x41, | |
| 3753 | + 0x0F, 0xFF, 0x84, 0x30, 0x10, 0x80, 0xC2, 0x03, 0x08, 0x00, 0x08, 0x1E, | |
| 3754 | + 0x3B, 0x4A, 0x48, 0x48, 0x68, 0x3C, 0x0E, 0x0B, 0x09, 0x09, 0x49, 0xEA, | |
| 3755 | + 0x3E, 0x08, 0x08, 0x70, 0x14, 0x41, 0x22, 0x19, 0x10, 0x88, 0x88, 0x44, | |
| 3756 | + 0x82, 0x2C, 0x0E, 0xDE, 0x05, 0x08, 0x48, 0x46, 0x42, 0x62, 0x12, 0x19, | |
| 3757 | + 0xA0, 0x7B, 0x00, 0x00, 0x3C, 0x0C, 0x41, 0x08, 0x21, 0x02, 0x40, 0x70, | |
| 3758 | + 0x1E, 0x06, 0x63, 0x84, 0x50, 0x5A, 0x06, 0x21, 0xE3, 0xE6, 0xF4, 0x12, | |
| 3759 | + 0x44, 0xC8, 0x88, 0x88, 0x84, 0x44, 0x21, 0x84, 0x22, 0x31, 0x11, 0x11, | |
| 3760 | + 0x12, 0x22, 0x48, 0x11, 0xAC, 0xE0, 0x83, 0x9A, 0xC4, 0x00, 0x08, 0x04, | |
| 3761 | + 0x02, 0x01, 0x0F, 0xF8, 0x40, 0x20, 0x10, 0x08, 0x00, 0xD6, 0xF8, 0xC0, | |
| 3762 | + 0x00, 0x80, 0x40, 0x40, 0x60, 0x20, 0x30, 0x10, 0x10, 0x08, 0x08, 0x04, | |
| 3763 | + 0x04, 0x02, 0x02, 0x01, 0x01, 0x00, 0x80, 0x00, 0x3C, 0x42, 0x42, 0x81, | |
| 3764 | + 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x42, 0x42, 0x3C, 0x33, 0xC9, 0x04, | |
| 3765 | + 0x10, 0x41, 0x04, 0x10, 0x41, 0x04, 0x7C, 0x3E, 0x63, 0x01, 0x01, 0x01, | |
| 3766 | + 0x03, 0x06, 0x0C, 0x10, 0x60, 0x40, 0x80, 0xFE, 0x7C, 0x82, 0x01, 0x02, | |
| 3767 | + 0x02, 0x1C, 0x02, 0x01, 0x01, 0x01, 0x01, 0x82, 0xFC, 0x02, 0x06, 0x0A, | |
| 3768 | + 0x0A, 0x12, 0x22, 0x62, 0x42, 0xFF, 0x02, 0x02, 0x02, 0x02, 0xFD, 0x02, | |
| 3769 | + 0x04, 0x0F, 0x90, 0x80, 0x81, 0x02, 0x04, 0x0C, 0x2F, 0x80, 0x1F, 0x22, | |
| 3770 | + 0x40, 0xC0, 0xFC, 0xC2, 0x81, 0x81, 0x81, 0x81, 0xC1, 0x42, 0x3C, 0xFF, | |
| 3771 | + 0x01, 0x03, 0x02, 0x06, 0x04, 0x0C, 0x08, 0x08, 0x18, 0x10, 0x30, 0x20, | |
| 3772 | + 0x3C, 0xC3, 0x81, 0x81, 0xC3, 0x3C, 0x3C, 0x42, 0x81, 0x81, 0x81, 0x42, | |
| 3773 | + 0x3C, 0x3C, 0x42, 0x81, 0x81, 0x81, 0x81, 0x43, 0x3F, 0x03, 0x03, 0x02, | |
| 3774 | + 0x84, 0xF8, 0xC0, 0x03, 0xC0, 0x03, 0x58, 0x04, 0x1C, 0x61, 0x82, 0x08, | |
| 3775 | + 0x20, 0x20, 0x20, 0x60, 0x60, 0x60, 0x60, 0xFF, 0x80, 0x00, 0x1F, 0xF0, | |
| 3776 | + 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x86, 0x18, 0x61, 0x86, 0x08, 0x00, | |
| 3777 | + 0xFA, 0x20, 0x41, 0x04, 0x10, 0x8C, 0x21, 0x86, 0x00, 0x40, 0x07, 0xE0, | |
| 3778 | + 0x18, 0x18, 0x30, 0x04, 0x60, 0x02, 0x40, 0x02, 0x87, 0xE1, 0x88, 0x21, | |
| 3779 | + 0x90, 0x21, 0x90, 0x21, 0x90, 0x21, 0x90, 0x22, 0x88, 0x62, 0x47, 0xBC, | |
| 3780 | + 0x60, 0x00, 0x30, 0x00, 0x18, 0x00, 0x07, 0xC0, 0x04, 0x01, 0x40, 0x28, | |
| 3781 | + 0x05, 0x81, 0x10, 0x22, 0x04, 0x61, 0xFC, 0x20, 0x84, 0x19, 0x03, 0x20, | |
| 3782 | + 0x2C, 0x06, 0xFD, 0x0E, 0x0C, 0x18, 0x5F, 0x21, 0x41, 0x83, 0x06, 0x0C, | |
| 3783 | + 0x2F, 0x80, 0x1F, 0x30, 0xD0, 0x18, 0x08, 0x04, 0x02, 0x01, 0x00, 0x80, | |
| 3784 | + 0x60, 0x10, 0x2C, 0x31, 0xF0, 0xFC, 0x20, 0xC8, 0x0A, 0x03, 0x80, 0x60, | |
| 3785 | + 0x18, 0x06, 0x01, 0x80, 0x60, 0x28, 0x1A, 0x0C, 0xFC, 0x00, 0xFF, 0x02, | |
| 3786 | + 0x04, 0x08, 0x1F, 0xA0, 0x40, 0x81, 0x02, 0x04, 0x0F, 0xE0, 0xFF, 0x02, | |
| 3787 | + 0x04, 0x08, 0x1F, 0xA0, 0x40, 0x81, 0x02, 0x04, 0x08, 0x00, 0x1F, 0x88, | |
| 3788 | + 0x34, 0x01, 0x00, 0x80, 0x20, 0x08, 0x02, 0x01, 0x80, 0x50, 0x14, 0x04, | |
| 3789 | + 0xC1, 0x1F, 0x80, 0x80, 0x60, 0x18, 0x06, 0x01, 0x80, 0x60, 0x1F, 0xFE, | |
| 3790 | + 0x01, 0x80, 0x60, 0x18, 0x06, 0x01, 0x80, 0x40, 0xFF, 0xF8, 0x02, 0x04, | |
| 3791 | + 0x08, 0x10, 0x20, 0x40, 0x81, 0x02, 0x07, 0x0E, 0x37, 0xC0, 0x83, 0x43, | |
| 3792 | + 0x23, 0x13, 0x0B, 0x07, 0x03, 0x01, 0xC0, 0xB0, 0x4C, 0x23, 0x10, 0xC8, | |
| 3793 | + 0x38, 0x81, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x81, 0x02, 0x04, 0x0F, | |
| 3794 | + 0xE0, 0x80, 0x1C, 0x03, 0xC0, 0x3E, 0x07, 0xA0, 0x5A, 0x05, 0xB0, 0xD9, | |
| 3795 | + 0x09, 0x99, 0x98, 0x91, 0x8F, 0x18, 0x61, 0x86, 0x10, 0x80, 0x70, 0x1E, | |
| 3796 | + 0x06, 0xC1, 0x90, 0x66, 0x18, 0xC6, 0x19, 0x86, 0x60, 0xD8, 0x1E, 0x07, | |
| 3797 | + 0x80, 0xC0, 0x0F, 0x83, 0x0C, 0x40, 0x24, 0x02, 0x80, 0x18, 0x01, 0x80, | |
| 3798 | + 0x18, 0x01, 0x80, 0x14, 0x02, 0x40, 0x23, 0x0C, 0x1F, 0x00, 0xFC, 0x82, | |
| 3799 | + 0x81, 0x81, 0x81, 0x86, 0xFC, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x0F, | |
| 3800 | + 0x83, 0x0C, 0x40, 0x24, 0x02, 0x80, 0x18, 0x01, 0x80, 0x18, 0x01, 0x80, | |
| 3801 | + 0x14, 0x03, 0x40, 0x23, 0x0C, 0x1F, 0x80, 0x10, 0x01, 0x80, 0x0C, 0x00, | |
| 3802 | + 0x60, 0xFC, 0x41, 0x20, 0x50, 0x28, 0x14, 0x33, 0xF1, 0x18, 0x84, 0x43, | |
| 3803 | + 0x20, 0x90, 0x68, 0x18, 0x1F, 0x10, 0xD0, 0x08, 0x06, 0x01, 0xC0, 0x38, | |
| 3804 | + 0x06, 0x00, 0x80, 0x50, 0x3C, 0x23, 0xE0, 0xFF, 0x84, 0x02, 0x01, 0x00, | |
| 3805 | + 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01, 0x00, 0x80, 0x80, 0x30, | |
| 3806 | + 0x06, 0x00, 0xC0, 0x18, 0x03, 0x00, 0x60, 0x0C, 0x01, 0x80, 0x30, 0x06, | |
| 3807 | + 0x00, 0xB0, 0x63, 0xF8, 0xC0, 0x50, 0x36, 0x0D, 0x82, 0x21, 0x8C, 0x43, | |
| 3808 | + 0x10, 0x4C, 0x1A, 0x06, 0x80, 0xE0, 0x30, 0x0C, 0x00, 0xC1, 0x06, 0x83, | |
| 3809 | + 0x0D, 0x06, 0x13, 0x14, 0x26, 0x28, 0xC4, 0x59, 0x89, 0x92, 0x1A, 0x24, | |
| 3810 | + 0x34, 0x68, 0x28, 0xF0, 0x70, 0xC0, 0xC1, 0x81, 0x83, 0x00, 0x60, 0xC4, | |
| 3811 | + 0x10, 0xC6, 0x0D, 0x80, 0xA0, 0x18, 0x03, 0x80, 0x50, 0x1B, 0x02, 0x20, | |
| 3812 | + 0x82, 0x30, 0x6C, 0x06, 0xC1, 0xA0, 0x98, 0xC4, 0x41, 0x40, 0xA0, 0x20, | |
| 3813 | + 0x10, 0x08, 0x04, 0x02, 0x01, 0x00, 0x80, 0x7F, 0x80, 0xC0, 0x40, 0x40, | |
| 3814 | + 0x60, 0x20, 0x20, 0x30, 0x10, 0x18, 0x18, 0x08, 0x0F, 0xF8, 0xF2, 0x49, | |
| 3815 | + 0x24, 0x92, 0x49, 0x24, 0xE0, 0x80, 0x40, 0x10, 0x08, 0x02, 0x01, 0x00, | |
| 3816 | + 0x40, 0x20, 0x08, 0x04, 0x01, 0x00, 0xC0, 0x20, 0x18, 0x04, 0x03, 0x00, | |
| 3817 | + 0x80, 0xE4, 0x92, 0x49, 0x24, 0x92, 0x49, 0xE0, 0x08, 0x05, 0x01, 0x20, | |
| 3818 | + 0x88, 0x61, 0x10, 0x68, 0x0C, 0xFF, 0x80, 0x4C, 0x21, 0x3C, 0x31, 0x00, | |
| 3819 | + 0x80, 0x47, 0xE6, 0x12, 0x09, 0x0C, 0x7B, 0x80, 0x80, 0x80, 0x80, 0x80, | |
| 3820 | + 0xBC, 0xC2, 0x81, 0x81, 0x81, 0x81, 0x83, 0x86, 0xFC, 0x3E, 0x43, 0x80, | |
| 3821 | + 0x80, 0x80, 0x80, 0xC0, 0x63, 0x3E, 0x01, 0x01, 0x01, 0x01, 0x3F, 0x41, | |
| 3822 | + 0xC1, 0x81, 0x81, 0x81, 0xC1, 0x41, 0x3F, 0x3C, 0x8E, 0x0F, 0xF8, 0x10, | |
| 3823 | + 0x30, 0x23, 0x3C, 0x3D, 0x04, 0x10, 0xF1, 0x04, 0x10, 0x41, 0x04, 0x10, | |
| 3824 | + 0x40, 0x3F, 0xE3, 0x20, 0x90, 0x4C, 0x63, 0xE2, 0x01, 0x00, 0x7C, 0x43, | |
| 3825 | + 0x20, 0x90, 0xC7, 0xC0, 0x80, 0x80, 0x80, 0x80, 0xBE, 0xC3, 0x81, 0x81, | |
| 3826 | + 0x81, 0x81, 0x81, 0x81, 0x81, 0xC0, 0x55, 0x55, 0x40, 0x30, 0x00, 0x22, | |
| 3827 | + 0x22, 0x22, 0x22, 0x22, 0x26, 0xC0, 0x81, 0x02, 0x04, 0x08, 0x73, 0x2C, | |
| 3828 | + 0x70, 0xB1, 0x32, 0x24, 0x68, 0x60, 0x92, 0x49, 0x24, 0x92, 0x4E, 0xB9, | |
| 3829 | + 0xD8, 0xC6, 0x10, 0xC2, 0x18, 0x43, 0x08, 0x61, 0x0C, 0x21, 0x84, 0x20, | |
| 3830 | + 0xBE, 0xC3, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x3E, 0x30, 0xB0, | |
| 3831 | + 0x70, 0x18, 0x0C, 0x07, 0x06, 0xC6, 0x3E, 0x00, 0xBC, 0xC2, 0x81, 0x81, | |
| 3832 | + 0x81, 0x81, 0x81, 0x82, 0xFC, 0x80, 0x80, 0x80, 0x80, 0x3F, 0x41, 0x81, | |
| 3833 | + 0x81, 0x81, 0x81, 0xC1, 0x41, 0x3F, 0x01, 0x01, 0x01, 0x01, 0xBE, 0x21, | |
| 3834 | + 0x08, 0x42, 0x10, 0x80, 0x7D, 0x0E, 0x06, 0x03, 0x80, 0xC0, 0xE1, 0x7C, | |
| 3835 | + 0x42, 0x11, 0xE4, 0x21, 0x08, 0x42, 0x10, 0xF0, 0x83, 0x06, 0x0C, 0x18, | |
| 3836 | + 0x30, 0x60, 0xC3, 0x7A, 0x81, 0x83, 0x82, 0x46, 0x46, 0x24, 0x2C, 0x2C, | |
| 3837 | + 0x18, 0xC4, 0x34, 0x62, 0x46, 0x66, 0xA6, 0x29, 0x42, 0x94, 0x29, 0xC1, | |
| 3838 | + 0x18, 0x10, 0x80, 0x43, 0x26, 0x24, 0x18, 0x18, 0x1C, 0x24, 0x66, 0xC3, | |
| 3839 | + 0xC1, 0xA0, 0x98, 0xC4, 0x43, 0x20, 0xA0, 0x50, 0x38, 0x08, 0x04, 0x06, | |
| 3840 | + 0x02, 0x0E, 0x00, 0xFE, 0x08, 0x30, 0xC3, 0x04, 0x10, 0x60, 0xFE, 0x19, | |
| 3841 | + 0x08, 0x42, 0x10, 0x84, 0xC1, 0x08, 0x42, 0x10, 0x84, 0x18, 0xFF, 0xFF, | |
| 3842 | + 0x80, 0xC1, 0x08, 0x42, 0x10, 0x84, 0x19, 0x08, 0x42, 0x10, 0x84, 0xC0, | |
| 3843 | + 0x70, 0xC7, 0x80 }; | |
| 3844 | + | |
| 3845 | +const GFXglyph EuphemiaCAS9pt7bGlyphs[] PROGMEM = { | |
| 3846 | + { 0, 1, 1, 9, 0, 0 }, // 0x20 ' ' | |
| 3847 | + { 1, 2, 13, 4, 1, -12 }, // 0x21 '!' | |
| 3848 | + { 5, 5, 3, 7, 1, -12 }, // 0x22 '"' | |
| 3849 | + { 7, 14, 15, 16, 1, -13 }, // 0x23 '#' | |
| 3850 | + { 34, 8, 17, 10, 1, -14 }, // 0x24 '$' | |
| 3851 | + { 51, 13, 15, 17, 2, -13 }, // 0x25 '%' | |
| 3852 | + { 76, 11, 13, 13, 1, -12 }, // 0x26 '&' | |
| 3853 | + { 94, 2, 3, 4, 1, -12 }, // 0x27 ''' | |
| 3854 | + { 95, 4, 16, 6, 1, -14 }, // 0x28 '(' | |
| 3855 | + { 103, 4, 16, 6, 1, -14 }, // 0x29 ')' | |
| 3856 | + { 111, 7, 7, 9, 1, -14 }, // 0x2A '*' | |
| 3857 | + { 118, 9, 9, 11, 1, -9 }, // 0x2B '+' | |
| 3858 | + { 129, 2, 4, 4, 1, 0 }, // 0x2C ',' | |
| 3859 | + { 130, 5, 1, 7, 1, -6 }, // 0x2D '-' | |
| 3860 | + { 131, 2, 1, 4, 1, 0 }, // 0x2E '.' | |
| 3861 | + { 132, 9, 17, 11, 1, -14 }, // 0x2F '/' | |
| 3862 | + { 152, 8, 13, 10, 1, -12 }, // 0x30 '0' | |
| 3863 | + { 165, 6, 13, 10, 2, -12 }, // 0x31 '1' | |
| 3864 | + { 175, 8, 13, 10, 1, -12 }, // 0x32 '2' | |
| 3865 | + { 188, 8, 13, 10, 1, -12 }, // 0x33 '3' | |
| 3866 | + { 201, 8, 13, 10, 1, -12 }, // 0x34 '4' | |
| 3867 | + { 214, 7, 13, 10, 2, -12 }, // 0x35 '5' | |
| 3868 | + { 226, 8, 13, 10, 1, -12 }, // 0x36 '6' | |
| 3869 | + { 239, 8, 13, 10, 1, -12 }, // 0x37 '7' | |
| 3870 | + { 252, 8, 13, 10, 1, -12 }, // 0x38 '8' | |
| 3871 | + { 265, 8, 13, 10, 1, -12 }, // 0x39 '9' | |
| 3872 | + { 278, 2, 8, 4, 1, -7 }, // 0x3A ':' | |
| 3873 | + { 280, 2, 11, 4, 1, -7 }, // 0x3B ';' | |
| 3874 | + { 283, 7, 13, 9, 1, -12 }, // 0x3C '<' | |
| 3875 | + { 295, 9, 4, 11, 1, -8 }, // 0x3D '=' | |
| 3876 | + { 300, 7, 13, 9, 1, -12 }, // 0x3E '>' | |
| 3877 | + { 312, 6, 13, 9, 1, -12 }, // 0x3F '?' | |
| 3878 | + { 322, 16, 17, 18, 1, -12 }, // 0x40 '@' | |
| 3879 | + { 356, 11, 13, 11, 0, -12 }, // 0x41 'A' | |
| 3880 | + { 374, 7, 13, 11, 2, -12 }, // 0x42 'B' | |
| 3881 | + { 386, 9, 13, 12, 1, -12 }, // 0x43 'C' | |
| 3882 | + { 401, 10, 13, 12, 1, -12 }, // 0x44 'D' | |
| 3883 | + { 418, 7, 13, 10, 2, -12 }, // 0x45 'E' | |
| 3884 | + { 430, 7, 13, 9, 2, -12 }, // 0x46 'F' | |
| 3885 | + { 442, 10, 13, 12, 1, -12 }, // 0x47 'G' | |
| 3886 | + { 459, 10, 13, 12, 1, -12 }, // 0x48 'H' | |
| 3887 | + { 476, 1, 13, 4, 2, -12 }, // 0x49 'I' | |
| 3888 | + { 478, 7, 13, 9, 1, -12 }, // 0x4A 'J' | |
| 3889 | + { 490, 9, 13, 11, 2, -12 }, // 0x4B 'K' | |
| 3890 | + { 505, 7, 13, 9, 2, -12 }, // 0x4C 'L' | |
| 3891 | + { 517, 12, 13, 14, 1, -12 }, // 0x4D 'M' | |
| 3892 | + { 537, 10, 13, 12, 1, -12 }, // 0x4E 'N' | |
| 3893 | + { 554, 12, 13, 14, 1, -12 }, // 0x4F 'O' | |
| 3894 | + { 574, 8, 13, 10, 1, -12 }, // 0x50 'P' | |
| 3895 | + { 587, 12, 17, 14, 1, -12 }, // 0x51 'Q' | |
| 3896 | + { 613, 9, 13, 11, 1, -12 }, // 0x52 'R' | |
| 3897 | + { 628, 9, 13, 11, 0, -12 }, // 0x53 'S' | |
| 3898 | + { 643, 9, 13, 11, 1, -12 }, // 0x54 'T' | |
| 3899 | + { 658, 11, 13, 13, 1, -12 }, // 0x55 'U' | |
| 3900 | + { 676, 10, 13, 11, 0, -12 }, // 0x56 'V' | |
| 3901 | + { 693, 15, 13, 16, 0, -12 }, // 0x57 'W' | |
| 3902 | + { 718, 11, 13, 11, 0, -12 }, // 0x58 'X' | |
| 3903 | + { 736, 9, 13, 10, 1, -12 }, // 0x59 'Y' | |
| 3904 | + { 751, 9, 13, 10, 0, -12 }, // 0x5A 'Z' | |
| 3905 | + { 766, 3, 17, 5, 1, -14 }, // 0x5B '[' | |
| 3906 | + { 773, 9, 17, 11, 1, -14 }, // 0x5C '\' | |
| 3907 | + { 793, 3, 17, 5, 1, -14 }, // 0x5D ']' | |
| 3908 | + { 800, 10, 7, 11, 1, -13 }, // 0x5E '^' | |
| 3909 | + { 809, 9, 1, 9, 0, 3 }, // 0x5F '_' | |
| 3910 | + { 811, 4, 4, 0, -2, -13 }, // 0x60 '`' | |
| 3911 | + { 813, 9, 9, 10, 1, -8 }, // 0x61 'a' | |
| 3912 | + { 824, 8, 13, 10, 1, -12 }, // 0x62 'b' | |
| 3913 | + { 837, 8, 9, 9, 1, -8 }, // 0x63 'c' | |
| 3914 | + { 846, 8, 13, 11, 1, -12 }, // 0x64 'd' | |
| 3915 | + { 859, 7, 9, 10, 1, -8 }, // 0x65 'e' | |
| 3916 | + { 867, 6, 13, 6, 1, -12 }, // 0x66 'f' | |
| 3917 | + { 877, 9, 13, 10, 1, -8 }, // 0x67 'g' | |
| 3918 | + { 892, 8, 13, 10, 1, -12 }, // 0x68 'h' | |
| 3919 | + { 905, 2, 13, 4, 1, -12 }, // 0x69 'i' | |
| 3920 | + { 909, 4, 17, 4, -1, -12 }, // 0x6A 'j' | |
| 3921 | + { 918, 7, 13, 9, 1, -12 }, // 0x6B 'k' | |
| 3922 | + { 930, 3, 13, 4, 1, -12 }, // 0x6C 'l' | |
| 3923 | + { 935, 11, 9, 13, 1, -8 }, // 0x6D 'm' | |
| 3924 | + { 948, 8, 9, 10, 1, -8 }, // 0x6E 'n' | |
| 3925 | + { 957, 9, 9, 11, 1, -8 }, // 0x6F 'o' | |
| 3926 | + { 968, 8, 13, 10, 1, -8 }, // 0x70 'p' | |
| 3927 | + { 981, 8, 13, 10, 1, -8 }, // 0x71 'q' | |
| 3928 | + { 994, 5, 9, 7, 1, -8 }, // 0x72 'r' | |
| 3929 | + { 1000, 7, 9, 9, 1, -8 }, // 0x73 's' | |
| 3930 | + { 1008, 5, 12, 6, 1, -11 }, // 0x74 't' | |
| 3931 | + { 1016, 7, 9, 10, 1, -8 }, // 0x75 'u' | |
| 3932 | + { 1024, 8, 9, 8, -1, -8 }, // 0x76 'v' | |
| 3933 | + { 1033, 12, 9, 12, 0, -8 }, // 0x77 'w' | |
| 3934 | + { 1047, 8, 9, 8, 0, -8 }, // 0x78 'x' | |
| 3935 | + { 1056, 9, 13, 9, 0, -8 }, // 0x79 'y' | |
| 3936 | + { 1071, 7, 9, 9, 1, -8 }, // 0x7A 'z' | |
| 3937 | + { 1079, 5, 17, 6, 0, -13 }, // 0x7B '{' | |
| 3938 | + { 1090, 1, 17, 9, 4, -12 }, // 0x7C '|' | |
| 3939 | + { 1093, 5, 17, 6, 1, -13 }, // 0x7D '}' | |
| 3940 | + { 1104, 9, 2, 11, 1, -5 } }; // 0x7E '~' | |
| 3941 | + | |
| 3942 | +const GFXfont EuphemiaCAS9pt7b PROGMEM = { | |
| 3943 | + (uint8_t *)EuphemiaCAS9pt7bBitmaps, | |
| 3944 | + (GFXglyph *)EuphemiaCAS9pt7bGlyphs, | |
| 3945 | + 0x20, 0x7E, 24 }; | |
| 3946 | + | |
| 3947 | +// Approx. 1779 bytes | |
| 3948 | +const uint8_t Futura9pt7bBitmaps[] PROGMEM = { | |
| 3949 | + 0x00, 0xFF, 0xFF, 0xFC, 0xF0, 0xDE, 0xF7, 0xBD, 0x80, 0x11, 0x84, 0x61, | |
| 3950 | + 0x18, 0xC6, 0xFF, 0xFF, 0xF3, 0x30, 0xCC, 0xFF, 0xFF, 0xF2, 0x31, 0x8C, | |
| 3951 | + 0x62, 0x18, 0x80, 0x0C, 0x06, 0x0F, 0xCE, 0x76, 0x03, 0x01, 0xC0, 0x78, | |
| 3952 | + 0x1F, 0x03, 0xC0, 0x68, 0x3C, 0x1B, 0x1D, 0xFC, 0x7C, 0x0C, 0x06, 0x00, | |
| 3953 | + 0x38, 0x30, 0xF8, 0x43, 0x19, 0x86, 0x32, 0x0C, 0x6C, 0x0F, 0x90, 0x0E, | |
| 3954 | + 0x40, 0x00, 0x9C, 0x02, 0x7C, 0x05, 0x8C, 0x13, 0x18, 0x66, 0x30, 0x87, | |
| 3955 | + 0xC3, 0x07, 0x00, 0x1E, 0x03, 0xF0, 0x33, 0x03, 0x30, 0x3F, 0x01, 0xE0, | |
| 3956 | + 0x3C, 0x07, 0xE0, 0xE7, 0x6C, 0x3C, 0xC1, 0x8E, 0x3C, 0x7E, 0xE3, 0xC6, | |
| 3957 | + 0xFF, 0xC0, 0x76, 0x66, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xE6, 0x66, 0x20, | |
| 3958 | + 0xC6, 0x66, 0x33, 0x33, 0x33, 0x33, 0x33, 0x76, 0x66, 0x40, 0x18, 0x18, | |
| 3959 | + 0x7E, 0x7E, 0x3C, 0x66, 0x24, 0x0C, 0x06, 0x03, 0x1F, 0xFF, 0xF8, 0x60, | |
| 3960 | + 0x30, 0x18, 0x0C, 0x00, 0x23, 0x26, 0x6C, 0xFF, 0xF0, 0x01, 0x80, 0xC0, | |
| 3961 | + 0xC0, 0x60, 0x60, 0x30, 0x18, 0x18, 0x0C, 0x0C, 0x06, 0x02, 0x03, 0x01, | |
| 3962 | + 0x81, 0x80, 0xC0, 0xC0, 0x60, 0x10, 0x00, 0x1C, 0x1F, 0x18, 0xDC, 0x6C, | |
| 3963 | + 0x1E, 0x0F, 0x07, 0x83, 0xC1, 0xE0, 0xF8, 0xCC, 0x63, 0xE0, 0xE0, 0x7F, | |
| 3964 | + 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x1E, 0x3F, 0x98, 0xEC, 0x30, 0x18, | |
| 3965 | + 0x0C, 0x0C, 0x0E, 0x0E, 0x06, 0x06, 0x06, 0x07, 0xFF, 0xFC, 0x3C, 0x7E, | |
| 3966 | + 0xE7, 0x03, 0x03, 0x1E, 0x1E, 0x07, 0x03, 0x03, 0xC3, 0xC7, 0x7E, 0x3C, | |
| 3967 | + 0x00, 0x00, 0x10, 0x06, 0x00, 0xC0, 0x38, 0x0F, 0x01, 0xE0, 0x6C, 0x1D, | |
| 3968 | + 0x83, 0x30, 0xC6, 0x3F, 0xF7, 0xFE, 0x03, 0x00, 0x60, 0x1F, 0x8F, 0xC6, | |
| 3969 | + 0x06, 0x03, 0xE1, 0xF9, 0x8C, 0x03, 0x01, 0x80, 0xD0, 0x7C, 0x67, 0xF1, | |
| 3970 | + 0xE0, 0x00, 0x03, 0x03, 0x81, 0x81, 0x81, 0xC0, 0xF8, 0xFE, 0xE3, 0xE0, | |
| 3971 | + 0xF0, 0x78, 0x3E, 0x33, 0xF8, 0x78, 0xFF, 0xFF, 0xE0, 0x30, 0x0C, 0x06, | |
| 3972 | + 0x01, 0x80, 0xC0, 0x70, 0x18, 0x0C, 0x03, 0x01, 0x80, 0xE0, 0x30, 0x00, | |
| 3973 | + 0x3C, 0x7E, 0xE7, 0xC3, 0xC3, 0xE7, 0x7E, 0x7E, 0xE7, 0xC3, 0xC3, 0xE7, | |
| 3974 | + 0x7E, 0x3C, 0x3C, 0x3F, 0xB8, 0xF8, 0x3C, 0x1E, 0x0F, 0x8E, 0xFE, 0x3E, | |
| 3975 | + 0x07, 0x03, 0x03, 0x03, 0x81, 0x80, 0x00, 0xF0, 0x03, 0xC0, 0x33, 0x00, | |
| 3976 | + 0x00, 0x32, 0x66, 0x44, 0x01, 0x83, 0xC7, 0x8F, 0x0E, 0x07, 0x01, 0xE0, | |
| 3977 | + 0x3C, 0x07, 0x80, 0xC0, 0xFF, 0xFF, 0xC0, 0x1F, 0xFF, 0xF8, 0xC0, 0x78, | |
| 3978 | + 0x0E, 0x01, 0xC0, 0x38, 0x3C, 0x78, 0xF0, 0xE0, 0x40, 0x00, 0x38, 0xFB, | |
| 3979 | + 0x1E, 0x30, 0xE7, 0xBC, 0x60, 0xCD, 0xF9, 0xE0, 0x03, 0x06, 0x00, 0x0F, | |
| 3980 | + 0xC0, 0x61, 0xC3, 0x01, 0x99, 0xD6, 0xCF, 0xCF, 0x73, 0x3D, 0x84, 0xF6, | |
| 3981 | + 0x33, 0xD8, 0xDB, 0xBD, 0xE7, 0x77, 0x0E, 0x00, 0x3F, 0xE0, 0x3F, 0x00, | |
| 3982 | + 0x02, 0x00, 0x10, 0x01, 0xC0, 0x0E, 0x00, 0xF8, 0x06, 0xC0, 0x73, 0x03, | |
| 3983 | + 0x18, 0x18, 0xE1, 0xFF, 0x0F, 0xF8, 0xC0, 0x66, 0x03, 0x60, 0x0C, 0xF8, | |
| 3984 | + 0xFC, 0xCE, 0xC6, 0xC6, 0xCE, 0xFC, 0xFE, 0xC7, 0xC3, 0xC3, 0xC7, 0xFE, | |
| 3985 | + 0xFC, 0x0F, 0x83, 0xFC, 0xE1, 0xB0, 0x0E, 0x01, 0x80, 0x30, 0x06, 0x00, | |
| 3986 | + 0xC0, 0x1C, 0x01, 0x80, 0x9C, 0x31, 0xFE, 0x1F, 0x00, 0xFC, 0x3F, 0xCC, | |
| 3987 | + 0x7B, 0x06, 0xC1, 0xF0, 0x3C, 0x0F, 0x03, 0xC0, 0xF0, 0x7C, 0x1B, 0x1E, | |
| 3988 | + 0xFF, 0x3F, 0x00, 0xFF, 0xFF, 0x06, 0x0C, 0x1F, 0xFF, 0xE0, 0xC1, 0x83, | |
| 3989 | + 0x06, 0x0F, 0xFF, 0xC0, 0xFF, 0xFF, 0x06, 0x0C, 0x1F, 0xFF, 0xE0, 0xC1, | |
| 3990 | + 0x83, 0x06, 0x0C, 0x18, 0x00, 0x0F, 0x80, 0xFF, 0x0E, 0x1C, 0xC0, 0x4E, | |
| 3991 | + 0x00, 0x60, 0x03, 0x07, 0xF8, 0x3F, 0xC0, 0x1F, 0x01, 0xD8, 0x0C, 0x71, | |
| 3992 | + 0xE1, 0xFE, 0x07, 0xC0, 0xC0, 0xF0, 0x3C, 0x0F, 0x03, 0xC0, 0xFF, 0xFF, | |
| 3993 | + 0xFF, 0x03, 0xC0, 0xF0, 0x3C, 0x0F, 0x03, 0xC0, 0xF0, 0x30, 0xFF, 0xFF, | |
| 3994 | + 0xFF, 0xF0, 0x0C, 0x30, 0xC3, 0x0C, 0x30, 0xC3, 0x0C, 0x30, 0xC7, 0xFB, | |
| 3995 | + 0xC0, 0xC1, 0xB0, 0xCC, 0x73, 0x38, 0xDC, 0x3E, 0x0F, 0x03, 0xE0, 0xDC, | |
| 3996 | + 0x33, 0x0C, 0x63, 0x1C, 0xC3, 0xB0, 0x70, 0xC3, 0x0C, 0x30, 0xC3, 0x0C, | |
| 3997 | + 0x30, 0xC3, 0x0C, 0x30, 0xFF, 0xF0, 0x00, 0x00, 0x20, 0x20, 0xC0, 0x61, | |
| 3998 | + 0x80, 0xC3, 0x83, 0x87, 0x07, 0x0F, 0x1E, 0x16, 0x34, 0x6C, 0xEC, 0xCD, | |
| 3999 | + 0x99, 0x9B, 0x33, 0x1C, 0x66, 0x38, 0xD8, 0x21, 0xB0, 0x41, 0x80, 0x80, | |
| 4000 | + 0x00, 0x08, 0x03, 0xC0, 0x3E, 0x03, 0xF0, 0x3F, 0x83, 0xDC, 0x3C, 0xE3, | |
| 4001 | + 0xC7, 0x3C, 0x3B, 0xC1, 0xFC, 0x0F, 0xC0, 0x7C, 0x03, 0xC0, 0x10, 0x00, | |
| 4002 | + 0x0F, 0xC0, 0x7F, 0x83, 0x87, 0x18, 0x06, 0xE0, 0x1F, 0x00, 0x3C, 0x00, | |
| 4003 | + 0xF0, 0x03, 0xC0, 0x0F, 0x80, 0x76, 0x01, 0x8E, 0x1C, 0x1F, 0xE0, 0x3F, | |
| 4004 | + 0x00, 0xF9, 0xFB, 0x3E, 0x3C, 0x79, 0xFF, 0x7C, 0xC1, 0x83, 0x06, 0x0C, | |
| 4005 | + 0x18, 0x00, 0x0F, 0xC0, 0x7F, 0x83, 0x87, 0x18, 0x06, 0xE0, 0x1F, 0x00, | |
| 4006 | + 0x3C, 0x00, 0xF0, 0x03, 0xC3, 0x8F, 0x87, 0x76, 0x0F, 0x8E, 0x1C, 0x1F, | |
| 4007 | + 0xF8, 0x3E, 0x70, 0xF8, 0xFC, 0xCE, 0xC6, 0xC6, 0xCE, 0xFC, 0xF8, 0xD0, | |
| 4008 | + 0xD8, 0xCC, 0xCC, 0xC6, 0xC7, 0x1E, 0x1F, 0x9C, 0xCC, 0x06, 0x01, 0xC0, | |
| 4009 | + 0x78, 0x0E, 0x01, 0x80, 0xF8, 0x6C, 0x77, 0xF0, 0xF0, 0xFF, 0xFF, 0x18, | |
| 4010 | + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xC0, | |
| 4011 | + 0xF0, 0x3C, 0x0F, 0x03, 0xC0, 0xF0, 0x3C, 0x0F, 0x03, 0xC0, 0xF0, 0x3C, | |
| 4012 | + 0x0D, 0x86, 0x7F, 0x87, 0x80, 0xC0, 0x76, 0x06, 0x60, 0x67, 0x0C, 0x30, | |
| 4013 | + 0xC3, 0x0C, 0x19, 0x81, 0x98, 0x1F, 0x00, 0xF0, 0x0F, 0x00, 0x60, 0x06, | |
| 4014 | + 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x18, 0x08, 0x19, 0x81, 0x03, 0x30, | |
| 4015 | + 0x60, 0xE7, 0x0E, 0x18, 0x63, 0xC3, 0x0C, 0x78, 0xC0, 0xCD, 0x98, 0x1B, | |
| 4016 | + 0x37, 0x03, 0x63, 0xC0, 0x3C, 0x78, 0x07, 0x0E, 0x00, 0xE0, 0xC0, 0x0C, | |
| 4017 | + 0x18, 0x01, 0x02, 0x00, 0x00, 0x00, 0x60, 0xC6, 0x38, 0xC6, 0x0D, 0xC1, | |
| 4018 | + 0xB0, 0x1C, 0x03, 0x80, 0x70, 0x1F, 0x03, 0x60, 0xC6, 0x18, 0xC6, 0x0D, | |
| 4019 | + 0xC1, 0x80, 0xC0, 0xF8, 0x76, 0x18, 0xCC, 0x33, 0x07, 0x81, 0xE0, 0x30, | |
| 4020 | + 0x0C, 0x03, 0x00, 0xC0, 0x30, 0x0C, 0x03, 0x00, 0x7F, 0x9F, 0xE0, 0x30, | |
| 4021 | + 0x0C, 0x06, 0x03, 0x80, 0xC0, 0x70, 0x18, 0x0E, 0x03, 0x01, 0x80, 0x7F, | |
| 4022 | + 0xFF, 0xF0, 0xFF, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCF, 0xF0, | |
| 4023 | + 0xC0, 0x20, 0x18, 0x0C, 0x03, 0x01, 0x80, 0x40, 0x30, 0x18, 0x06, 0x03, | |
| 4024 | + 0x00, 0xC0, 0x60, 0x30, 0x0C, 0x06, 0x01, 0x80, 0xC0, 0x00, 0xFF, 0x33, | |
| 4025 | + 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x3F, 0xF0, 0x0C, 0x07, 0x81, 0xE0, | |
| 4026 | + 0xCC, 0x33, 0x18, 0x66, 0x18, 0xFF, 0xFF, 0xF0, 0xCE, 0x62, 0x3D, 0xBF, | |
| 4027 | + 0xF8, 0xF8, 0x3C, 0x1E, 0x0F, 0x8E, 0xFF, 0x3D, 0x80, 0xC0, 0x60, 0x30, | |
| 4028 | + 0x18, 0x0C, 0x06, 0x03, 0x79, 0xFE, 0xE3, 0xE0, 0xF0, 0x78, 0x3E, 0x3F, | |
| 4029 | + 0xFB, 0x78, 0x3E, 0xFF, 0x8E, 0x0C, 0x18, 0x38, 0xBF, 0x3E, 0x01, 0x80, | |
| 4030 | + 0xC0, 0x60, 0x30, 0x18, 0x0C, 0xF6, 0xFF, 0xE3, 0xE0, 0xF0, 0x78, 0x3E, | |
| 4031 | + 0x3B, 0xFC, 0xF6, 0x3C, 0x7E, 0xE3, 0xFF, 0xFF, 0xC0, 0xE3, 0x7E, 0x3C, | |
| 4032 | + 0x3B, 0xD8, 0xC6, 0x33, 0xFF, 0x63, 0x18, 0xC6, 0x31, 0x80, 0x3D, 0xBF, | |
| 4033 | + 0xF8, 0xF8, 0x3C, 0x1E, 0x0F, 0x8E, 0xFF, 0x3D, 0x80, 0xF0, 0x6C, 0x77, | |
| 4034 | + 0xF0, 0xF0, 0xC1, 0x83, 0x06, 0x0C, 0x18, 0x37, 0x7F, 0xE7, 0x8F, 0x1E, | |
| 4035 | + 0x3C, 0x78, 0xF1, 0x80, 0xF0, 0x3F, 0xFF, 0xF0, 0xF0, 0x3F, 0xFF, 0xFF, | |
| 4036 | + 0xFC, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xCE, 0xDC, 0xF8, 0xF0, 0xF0, | |
| 4037 | + 0xD8, 0xDC, 0xCC, 0xC6, 0xFF, 0xFF, 0xFF, 0xFC, 0xDD, 0xEF, 0xFF, 0xE7, | |
| 4038 | + 0x3C, 0x63, 0xC6, 0x3C, 0x63, 0xC6, 0x3C, 0x63, 0xC6, 0x30, 0xDD, 0xFF, | |
| 4039 | + 0x1E, 0x3C, 0x78, 0xF1, 0xE3, 0xC6, 0x3E, 0x3F, 0xB8, 0xF8, 0x3C, 0x1E, | |
| 4040 | + 0x0F, 0x8E, 0xFE, 0x3E, 0x00, 0xDE, 0x7F, 0xB8, 0xF8, 0x3C, 0x1E, 0x0F, | |
| 4041 | + 0x8F, 0xFE, 0xDE, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x00, 0x3D, 0xBF, 0xF8, | |
| 4042 | + 0xF8, 0x3C, 0x1E, 0x0F, 0x8E, 0xFF, 0x3D, 0x80, 0xC0, 0x60, 0x30, 0x18, | |
| 4043 | + 0x0C, 0xFB, 0xEE, 0x30, 0xC3, 0x0C, 0x30, 0xC0, 0x73, 0xEC, 0x38, 0x38, | |
| 4044 | + 0x3C, 0xFF, 0x78, 0x66, 0x6F, 0xF6, 0x66, 0x66, 0x66, 0xC7, 0x8F, 0x1E, | |
| 4045 | + 0x3C, 0x78, 0xF1, 0xBE, 0x38, 0xC3, 0xB1, 0x99, 0xC6, 0xC3, 0x60, 0xE0, | |
| 4046 | + 0x70, 0x10, 0x08, 0x00, 0x00, 0x03, 0x08, 0x66, 0x31, 0x99, 0xCC, 0x37, | |
| 4047 | + 0xB0, 0xDF, 0x81, 0xCE, 0x07, 0x38, 0x08, 0xC0, 0x21, 0x00, 0x61, 0x8C, | |
| 4048 | + 0xC1, 0xE0, 0x78, 0x0C, 0x07, 0x83, 0x31, 0xCE, 0xE1, 0x80, 0xE1, 0xB0, | |
| 4049 | + 0xDC, 0xC6, 0x63, 0xE0, 0xF0, 0x70, 0x18, 0x18, 0x0C, 0x0C, 0x06, 0x07, | |
| 4050 | + 0x03, 0x00, 0x7F, 0xBF, 0x81, 0x81, 0x81, 0xC1, 0xC0, 0xC0, 0xFF, 0xFF, | |
| 4051 | + 0x80, 0x3B, 0xD8, 0xC6, 0x31, 0x8C, 0xE6, 0x38, 0xC6, 0x31, 0x8C, 0x63, | |
| 4052 | + 0xCE, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0xE7, 0x8C, 0x63, 0x18, 0xC6, 0x38, | |
| 4053 | + 0xCE, 0x63, 0x18, 0xC6, 0x37, 0xB8, 0x78, 0xFF, 0xE3, 0xC0 }; | |
| 4054 | + | |
| 4055 | +const GFXglyph Futura9pt7bGlyphs[] PROGMEM = { | |
| 4056 | + { 0, 1, 1, 5, 0, 0 }, // 0x20 ' ' | |
| 4057 | + { 1, 2, 14, 6, 2, -13 }, // 0x21 '!' | |
| 4058 | + { 5, 5, 5, 7, 1, -13 }, // 0x22 '"' | |
| 4059 | + { 9, 10, 14, 12, 1, -13 }, // 0x23 '#' | |
| 4060 | + { 27, 9, 18, 11, 1, -15 }, // 0x24 '$' | |
| 4061 | + { 48, 15, 14, 17, 1, -13 }, // 0x25 '%' | |
| 4062 | + { 75, 12, 14, 13, 1, -13 }, // 0x26 '&' | |
| 4063 | + { 96, 2, 5, 4, 1, -13 }, // 0x27 ''' | |
| 4064 | + { 98, 4, 19, 7, 2, -14 }, // 0x28 '(' | |
| 4065 | + { 108, 4, 19, 7, 1, -14 }, // 0x29 ')' | |
| 4066 | + { 118, 8, 7, 12, 2, -14 }, // 0x2A '*' | |
| 4067 | + { 125, 9, 9, 11, 1, -11 }, // 0x2B '+' | |
| 4068 | + { 136, 4, 6, 5, 0, -2 }, // 0x2C ',' | |
| 4069 | + { 139, 4, 2, 4, 0, -5 }, // 0x2D '-' | |
| 4070 | + { 140, 2, 2, 6, 2, -1 }, // 0x2E '.' | |
| 4071 | + { 141, 9, 19, 9, 0, -14 }, // 0x2F '/' | |
| 4072 | + { 163, 9, 14, 11, 1, -13 }, // 0x30 '0' | |
| 4073 | + { 179, 4, 14, 11, 3, -13 }, // 0x31 '1' | |
| 4074 | + { 186, 9, 14, 11, 0, -13 }, // 0x32 '2' | |
| 4075 | + { 202, 8, 14, 11, 1, -13 }, // 0x33 '3' | |
| 4076 | + { 216, 11, 15, 11, 0, -14 }, // 0x34 '4' | |
| 4077 | + { 237, 9, 14, 11, 1, -13 }, // 0x35 '5' | |
| 4078 | + { 253, 9, 15, 11, 1, -14 }, // 0x36 '6' | |
| 4079 | + { 270, 10, 14, 11, 1, -13 }, // 0x37 '7' | |
| 4080 | + { 288, 8, 14, 11, 1, -13 }, // 0x38 '8' | |
| 4081 | + { 302, 9, 15, 11, 1, -13 }, // 0x39 '9' | |
| 4082 | + { 319, 2, 9, 6, 2, -8 }, // 0x3A ':' | |
| 4083 | + { 322, 4, 12, 5, 0, -8 }, // 0x3B ';' | |
| 4084 | + { 328, 9, 10, 11, 1, -11 }, // 0x3C '<' | |
| 4085 | + { 340, 9, 5, 11, 1, -9 }, // 0x3D '=' | |
| 4086 | + { 346, 9, 10, 11, 1, -11 }, // 0x3E '>' | |
| 4087 | + { 358, 7, 14, 9, 1, -13 }, // 0x3F '?' | |
| 4088 | + { 371, 14, 14, 16, 1, -13 }, // 0x40 '@' | |
| 4089 | + { 396, 13, 14, 13, 0, -13 }, // 0x41 'A' | |
| 4090 | + { 419, 8, 14, 11, 2, -13 }, // 0x42 'B' | |
| 4091 | + { 433, 11, 14, 12, 1, -13 }, // 0x43 'C' | |
| 4092 | + { 453, 10, 14, 13, 2, -13 }, // 0x44 'D' | |
| 4093 | + { 471, 7, 14, 10, 2, -13 }, // 0x45 'E' | |
| 4094 | + { 484, 7, 14, 9, 2, -13 }, // 0x46 'F' | |
| 4095 | + { 497, 13, 14, 15, 1, -13 }, // 0x47 'G' | |
| 4096 | + { 520, 10, 14, 14, 2, -13 }, // 0x48 'H' | |
| 4097 | + { 538, 2, 14, 6, 2, -13 }, // 0x49 'I' | |
| 4098 | + { 542, 6, 14, 8, 0, -13 }, // 0x4A 'J' | |
| 4099 | + { 553, 10, 14, 12, 2, -13 }, // 0x4B 'K' | |
| 4100 | + { 571, 6, 14, 9, 2, -13 }, // 0x4C 'L' | |
| 4101 | + { 582, 15, 16, 17, 1, -14 }, // 0x4D 'M' | |
| 4102 | + { 612, 12, 16, 16, 2, -14 }, // 0x4E 'N' | |
| 4103 | + { 636, 14, 14, 16, 1, -13 }, // 0x4F 'O' | |
| 4104 | + { 661, 7, 14, 10, 2, -13 }, // 0x50 'P' | |
| 4105 | + { 674, 14, 14, 16, 1, -13 }, // 0x51 'Q' | |
| 4106 | + { 699, 8, 14, 11, 2, -13 }, // 0x52 'R' | |
| 4107 | + { 713, 9, 14, 11, 1, -13 }, // 0x53 'S' | |
| 4108 | + { 729, 8, 14, 10, 1, -13 }, // 0x54 'T' | |
| 4109 | + { 743, 10, 14, 14, 2, -13 }, // 0x55 'U' | |
| 4110 | + { 761, 12, 15, 12, 0, -13 }, // 0x56 'V' | |
| 4111 | + { 784, 19, 16, 19, 0, -14 }, // 0x57 'W' | |
| 4112 | + { 822, 11, 14, 11, 0, -13 }, // 0x58 'X' | |
| 4113 | + { 842, 10, 14, 10, 0, -13 }, // 0x59 'Y' | |
| 4114 | + { 860, 10, 14, 11, 1, -13 }, // 0x5A 'Z' | |
| 4115 | + { 878, 4, 19, 6, 2, -14 }, // 0x5B '[' | |
| 4116 | + { 888, 9, 19, 9, 0, -14 }, // 0x5C '\' | |
| 4117 | + { 910, 4, 19, 6, 0, -14 }, // 0x5D ']' | |
| 4118 | + { 920, 10, 7, 10, 0, -13 }, // 0x5E '^' | |
| 4119 | + { 929, 10, 2, 10, 0, 2 }, // 0x5F '_' | |
| 4120 | + { 932, 4, 4, 10, 2, -13 }, // 0x60 '`' | |
| 4121 | + { 934, 9, 9, 11, 1, -8 }, // 0x61 'a' | |
| 4122 | + { 945, 9, 15, 11, 1, -14 }, // 0x62 'b' | |
| 4123 | + { 962, 7, 9, 9, 1, -8 }, // 0x63 'c' | |
| 4124 | + { 970, 9, 15, 11, 1, -14 }, // 0x64 'd' | |
| 4125 | + { 987, 8, 9, 10, 1, -8 }, // 0x65 'e' | |
| 4126 | + { 996, 5, 15, 6, 1, -14 }, // 0x66 'f' | |
| 4127 | + { 1006, 9, 14, 11, 1, -8 }, // 0x67 'g' | |
| 4128 | + { 1022, 7, 15, 9, 1, -14 }, // 0x68 'h' | |
| 4129 | + { 1036, 2, 14, 4, 1, -13 }, // 0x69 'i' | |
| 4130 | + { 1040, 2, 19, 4, 1, -13 }, // 0x6A 'j' | |
| 4131 | + { 1045, 8, 15, 9, 1, -14 }, // 0x6B 'k' | |
| 4132 | + { 1060, 2, 15, 4, 1, -14 }, // 0x6C 'l' | |
| 4133 | + { 1064, 12, 9, 14, 1, -8 }, // 0x6D 'm' | |
| 4134 | + { 1078, 7, 9, 9, 1, -8 }, // 0x6E 'n' | |
| 4135 | + { 1086, 9, 9, 11, 1, -8 }, // 0x6F 'o' | |
| 4136 | + { 1097, 9, 14, 11, 1, -8 }, // 0x70 'p' | |
| 4137 | + { 1113, 9, 14, 11, 1, -8 }, // 0x71 'q' | |
| 4138 | + { 1129, 6, 9, 6, 1, -8 }, // 0x72 'r' | |
| 4139 | + { 1136, 6, 9, 8, 1, -8 }, // 0x73 's' | |
| 4140 | + { 1143, 4, 12, 6, 1, -11 }, // 0x74 't' | |
| 4141 | + { 1149, 7, 9, 9, 1, -8 }, // 0x75 'u' | |
| 4142 | + { 1157, 9, 9, 9, 0, -8 }, // 0x76 'v' | |
| 4143 | + { 1168, 14, 10, 14, 0, -9 }, // 0x77 'w' | |
| 4144 | + { 1186, 10, 9, 10, 0, -8 }, // 0x78 'x' | |
| 4145 | + { 1198, 9, 14, 10, 0, -8 }, // 0x79 'y' | |
| 4146 | + { 1214, 9, 9, 9, 0, -8 }, // 0x7A 'z' | |
| 4147 | + { 1225, 5, 19, 6, 1, -14 }, // 0x7B '{' | |
| 4148 | + { 1237, 2, 17, 10, 4, -13 }, // 0x7C '|' | |
| 4149 | + { 1242, 5, 19, 6, 0, -14 }, // 0x7D '}' | |
| 4150 | + { 1254, 9, 3, 13, 2, -14 } }; // 0x7E '~' | |
| 4151 | + | |
| 4152 | +const GFXfont Futura9pt7b PROGMEM = { | |
| 4153 | + (uint8_t *)Futura9pt7bBitmaps, | |
| 4154 | + (GFXglyph *)Futura9pt7bGlyphs, | |
| 4155 | + 0x20, 0x7E, 23 }; | |
| 4156 | + | |
| 4157 | +// Approx. 1930 bytes | |
| 4158 | +const uint8_t GillSans9pt7bBitmaps[] PROGMEM = { | |
| 4159 | + 0x00, 0xFF, 0xFE, 0x0F, 0xDE, 0xF7, 0xBD, 0x80, 0x08, 0x82, 0x10, 0x42, | |
| 4160 | + 0x7F, 0xF1, 0x08, 0x42, 0x08, 0x47, 0xFF, 0x21, 0x0C, 0x21, 0x08, 0x21, | |
| 4161 | + 0x00, 0x18, 0x3C, 0xFE, 0xDA, 0xD8, 0xF8, 0x7C, 0x1E, 0x1B, 0x9B, 0xFF, | |
| 4162 | + 0x7E, 0x18, 0x18, 0x70, 0x5F, 0x13, 0x64, 0x7C, 0x87, 0x20, 0x08, 0x01, | |
| 4163 | + 0x00, 0x4E, 0x13, 0xE2, 0x6C, 0x8F, 0xA0, 0xE0, 0x1E, 0x07, 0xE0, 0xCC, | |
| 4164 | + 0x19, 0x83, 0xE0, 0x30, 0x0F, 0x3B, 0x3E, 0xC3, 0x98, 0xF3, 0xF3, 0x3C, | |
| 4165 | + 0x70, 0xFF, 0xC0, 0x18, 0x88, 0xC4, 0x63, 0x18, 0xC6, 0x30, 0x86, 0x10, | |
| 4166 | + 0xC3, 0xC3, 0x08, 0x61, 0x0C, 0x63, 0x18, 0xC6, 0x23, 0x11, 0x18, 0x10, | |
| 4167 | + 0x23, 0x5B, 0xE1, 0x0F, 0xB5, 0x88, 0x10, 0x08, 0x04, 0x02, 0x01, 0x0F, | |
| 4168 | + 0xF8, 0x40, 0x20, 0x10, 0x08, 0x00, 0xF6, 0xFF, 0xF0, 0x08, 0x44, 0x21, | |
| 4169 | + 0x10, 0x88, 0x42, 0x21, 0x00, 0x38, 0xF9, 0xB6, 0x3C, 0x78, 0xF1, 0xE3, | |
| 4170 | + 0xC6, 0xD9, 0xF1, 0xC0, 0xFF, 0xFF, 0xFF, 0x78, 0xFC, 0xCE, 0x86, 0x06, | |
| 4171 | + 0x04, 0x0C, 0x18, 0x10, 0x20, 0x7F, 0xFF, 0x7B, 0xF8, 0xC3, 0x0C, 0xE3, | |
| 4172 | + 0xC3, 0x0E, 0x3F, 0x9C, 0x06, 0x06, 0x0E, 0x1E, 0x36, 0x26, 0x66, 0xFF, | |
| 4173 | + 0xFF, 0x06, 0x06, 0x06, 0x7C, 0xF9, 0x83, 0x07, 0x8F, 0x83, 0x83, 0x07, | |
| 4174 | + 0x1F, 0xF3, 0xC0, 0x10, 0x70, 0xC3, 0x86, 0x1F, 0xBF, 0xE3, 0xC7, 0x8D, | |
| 4175 | + 0xF1, 0xC0, 0xFF, 0xFE, 0x06, 0x0C, 0x0C, 0x0C, 0x18, 0x18, 0x30, 0x30, | |
| 4176 | + 0x60, 0x60, 0x38, 0xFB, 0x1E, 0x3C, 0x67, 0x1F, 0x63, 0xC7, 0x8D, 0xF1, | |
| 4177 | + 0xC0, 0x38, 0xFB, 0x1E, 0x3C, 0x6F, 0xCF, 0x86, 0x1C, 0x71, 0xC1, 0x00, | |
| 4178 | + 0xF0, 0x0F, 0xF0, 0x0F, 0x60, 0x00, 0x83, 0xCF, 0xDF, 0x0C, 0x07, 0xC0, | |
| 4179 | + 0xFC, 0x0F, 0x00, 0x80, 0xFF, 0x80, 0x00, 0x1F, 0xF0, 0x80, 0x78, 0x1F, | |
| 4180 | + 0x81, 0xF0, 0x18, 0x7D, 0xF9, 0xE0, 0x80, 0x00, 0x6F, 0x33, 0x37, 0x66, | |
| 4181 | + 0x20, 0x66, 0x07, 0xF0, 0x0F, 0xF8, 0x3C, 0x1C, 0x30, 0x06, 0x63, 0x9F, | |
| 4182 | + 0x67, 0xF3, 0xC6, 0x73, 0xCC, 0x33, 0xCC, 0x33, 0xCC, 0x66, 0xCC, 0x6E, | |
| 4183 | + 0xCF, 0xFC, 0x67, 0x78, 0x70, 0x03, 0x3C, 0x0E, 0x1F, 0xFC, 0x07, 0xF0, | |
| 4184 | + 0x02, 0x00, 0x38, 0x01, 0xC0, 0x1B, 0x00, 0xD8, 0x0C, 0x60, 0x63, 0x07, | |
| 4185 | + 0xFC, 0x3F, 0xE3, 0x01, 0x98, 0x0D, 0x80, 0x30, 0xFC, 0xFE, 0xC6, 0xC6, | |
| 4186 | + 0xC6, 0xFC, 0xFE, 0xC3, 0xC3, 0xC3, 0xFE, 0xFC, 0x0F, 0xC7, 0xFD, 0xC0, | |
| 4187 | + 0xB0, 0x0C, 0x01, 0x80, 0x30, 0x06, 0x00, 0x60, 0x0E, 0x04, 0xFF, 0x87, | |
| 4188 | + 0xE0, 0xFF, 0x0F, 0xFC, 0xC0, 0xEC, 0x06, 0xC0, 0x3C, 0x03, 0xC0, 0x3C, | |
| 4189 | + 0x03, 0xC0, 0x6C, 0x0E, 0xFF, 0xCF, 0xF0, 0xFF, 0xFF, 0x06, 0x0C, 0x1F, | |
| 4190 | + 0xFF, 0xE0, 0xC1, 0x83, 0xFF, 0xF0, 0xFF, 0xFC, 0x30, 0xC3, 0xFF, 0xF0, | |
| 4191 | + 0xC3, 0x0C, 0x30, 0x0F, 0xC7, 0xFD, 0xC0, 0xB0, 0x0C, 0x01, 0x80, 0x30, | |
| 4192 | + 0x7E, 0x0F, 0xE0, 0x6E, 0x0C, 0xFF, 0x87, 0xC0, 0xC0, 0x78, 0x0F, 0x01, | |
| 4193 | + 0xE0, 0x3C, 0x07, 0xFF, 0xFF, 0xFE, 0x03, 0xC0, 0x78, 0x0F, 0x01, 0xE0, | |
| 4194 | + 0x30, 0xFF, 0xFF, 0xFF, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0xFE, | |
| 4195 | + 0xC1, 0xB0, 0xCC, 0x63, 0x30, 0xD8, 0x3C, 0x0D, 0x83, 0x30, 0xC6, 0x30, | |
| 4196 | + 0xCC, 0x1B, 0x03, 0xC1, 0x83, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0x83, | |
| 4197 | + 0xFF, 0xF0, 0xC0, 0xFC, 0x1F, 0xC7, 0xED, 0xBD, 0xF7, 0x9C, 0xF1, 0x1E, | |
| 4198 | + 0x03, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x30, 0xC0, 0x3E, 0x03, 0xF0, 0x3D, | |
| 4199 | + 0x83, 0xCC, 0x3C, 0x63, 0xC6, 0x3C, 0x33, 0xC1, 0xBC, 0x0F, 0xC0, 0x7C, | |
| 4200 | + 0x03, 0x0F, 0x81, 0xFF, 0x1C, 0x1C, 0xC0, 0x6C, 0x01, 0xE0, 0x0F, 0x00, | |
| 4201 | + 0x78, 0x03, 0x60, 0x33, 0x83, 0x8F, 0xF8, 0x1F, 0x00, 0xFC, 0xFE, 0xC3, | |
| 4202 | + 0xC3, 0xC3, 0xFE, 0xFC, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x0F, 0x81, 0xFF, | |
| 4203 | + 0x1C, 0x1C, 0xC0, 0x6C, 0x01, 0xE0, 0x0F, 0x00, 0x78, 0x03, 0xE0, 0x33, | |
| 4204 | + 0x83, 0x8F, 0xF8, 0x3F, 0x00, 0x3F, 0x80, 0x78, 0xF8, 0x7E, 0x31, 0x98, | |
| 4205 | + 0xCC, 0x67, 0xE3, 0xE1, 0x98, 0xC6, 0x63, 0x30, 0xD8, 0x30, 0x7B, 0xFC, | |
| 4206 | + 0x70, 0xC1, 0xC3, 0x83, 0x0E, 0x3F, 0xDE, 0xFF, 0xFF, 0xF0, 0xC0, 0x30, | |
| 4207 | + 0x0C, 0x03, 0x00, 0xC0, 0x30, 0x0C, 0x03, 0x00, 0xC0, 0x30, 0xC0, 0x78, | |
| 4208 | + 0x0F, 0x01, 0xE0, 0x3C, 0x07, 0x80, 0xF0, 0x1E, 0x03, 0xC0, 0x7C, 0x1D, | |
| 4209 | + 0xFF, 0x0F, 0x80, 0xC0, 0x6C, 0x19, 0x83, 0x30, 0x63, 0x18, 0x63, 0x06, | |
| 4210 | + 0xC0, 0xD8, 0x0E, 0x01, 0xC0, 0x38, 0x02, 0x00, 0xC0, 0xE0, 0x6C, 0x1C, | |
| 4211 | + 0x19, 0x86, 0x83, 0x38, 0xD8, 0xE3, 0x1B, 0x18, 0x66, 0x33, 0x06, 0xC6, | |
| 4212 | + 0xC0, 0xD8, 0xD8, 0x0E, 0x0E, 0x01, 0xC1, 0xC0, 0x38, 0x38, 0x02, 0x02, | |
| 4213 | + 0x00, 0xC0, 0x1B, 0x01, 0x8C, 0x18, 0x31, 0x80, 0xD8, 0x03, 0x80, 0x1C, | |
| 4214 | + 0x01, 0xB0, 0x18, 0xC1, 0x83, 0x18, 0x0D, 0x80, 0x70, 0xC0, 0x6C, 0x18, | |
| 4215 | + 0xC6, 0x0C, 0xC0, 0xF0, 0x0C, 0x01, 0x80, 0x30, 0x06, 0x00, 0xC0, 0x18, | |
| 4216 | + 0x03, 0x00, 0x7F, 0xEF, 0xF8, 0x06, 0x01, 0x80, 0x70, 0x0C, 0x03, 0x00, | |
| 4217 | + 0xC0, 0x18, 0x06, 0x01, 0xFF, 0xFF, 0xF0, 0xFF, 0xCC, 0xCC, 0xCC, 0xCC, | |
| 4218 | + 0xCC, 0xCC, 0xFF, 0x84, 0x10, 0x84, 0x10, 0x82, 0x10, 0x82, 0x10, 0xFF, | |
| 4219 | + 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0xFF, 0x38, 0x71, 0xB3, 0x66, 0xD8, | |
| 4220 | + 0xF1, 0x80, 0xFF, 0xC0, 0xCC, 0x80, 0x79, 0xFA, 0x30, 0xE6, 0xD9, 0xB3, | |
| 4221 | + 0x3F, 0xC1, 0x83, 0x06, 0x0D, 0xDF, 0xB3, 0xE3, 0xC7, 0x9F, 0xF7, 0xC0, | |
| 4222 | + 0x3D, 0xFE, 0x30, 0xC3, 0x87, 0xCF, 0x06, 0x0C, 0x18, 0x33, 0xEF, 0xF9, | |
| 4223 | + 0xE3, 0xC7, 0x8D, 0xF9, 0xF0, 0x38, 0xFB, 0x1F, 0xFC, 0x1C, 0x1F, 0x9F, | |
| 4224 | + 0x3B, 0xD8, 0xCF, 0x79, 0x8C, 0x63, 0x18, 0xC0, 0x7F, 0x9F, 0x36, 0x67, | |
| 4225 | + 0x98, 0x3C, 0x3E, 0xCF, 0x0F, 0x3B, 0xE0, 0xC1, 0x83, 0x06, 0x0D, 0xDF, | |
| 4226 | + 0xF9, 0xE3, 0xC7, 0x8F, 0x1E, 0x30, 0xF3, 0xFF, 0xFC, 0x6C, 0x36, 0xDB, | |
| 4227 | + 0x6D, 0xB7, 0xF0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC6, 0xCC, 0xD8, 0xF0, 0xD8, | |
| 4228 | + 0xCC, 0xC6, 0xC3, 0xFF, 0xFF, 0xFF, 0xDC, 0xEF, 0xFF, 0xC6, 0x3C, 0x63, | |
| 4229 | + 0xC6, 0x3C, 0x63, 0xC6, 0x3C, 0x63, 0xDD, 0xFF, 0x1E, 0x3C, 0x78, 0xF1, | |
| 4230 | + 0xE3, 0x3C, 0x7E, 0xE7, 0xC3, 0xC3, 0xE7, 0x7E, 0x3C, 0xF9, 0xFB, 0x3E, | |
| 4231 | + 0x3C, 0x79, 0xFF, 0x7C, 0xC1, 0x83, 0x06, 0x00, 0x3E, 0xFF, 0x9E, 0x3C, | |
| 4232 | + 0x7C, 0xDF, 0x9F, 0x06, 0x0C, 0x18, 0x30, 0xDB, 0xFE, 0xB0, 0xC3, 0x0C, | |
| 4233 | + 0x30, 0x77, 0xF2, 0xC3, 0x4F, 0xEE, 0x00, 0x87, 0xFF, 0x61, 0x86, 0x18, | |
| 4234 | + 0x7C, 0xF0, 0xC7, 0x8F, 0x1E, 0x3C, 0x78, 0xFF, 0xBB, 0xC7, 0x8D, 0xB3, | |
| 4235 | + 0x66, 0xC7, 0x8E, 0x1C, 0xC7, 0x1E, 0x38, 0xD9, 0xCC, 0xDB, 0x66, 0xDB, | |
| 4236 | + 0x1C, 0x70, 0xE3, 0x86, 0x0C, 0xC1, 0xB1, 0x8D, 0x83, 0x81, 0xC1, 0xB1, | |
| 4237 | + 0x8D, 0x83, 0xC3, 0x66, 0x66, 0x3C, 0x3C, 0x18, 0x18, 0x30, 0x30, 0x60, | |
| 4238 | + 0x60, 0xC0, 0xFF, 0xF8, 0x70, 0xC3, 0x0E, 0x1F, 0xFF, 0x1C, 0xF3, 0x0C, | |
| 4239 | + 0x30, 0xC3, 0x18, 0x83, 0x87, 0x0C, 0x30, 0xC3, 0x0F, 0x1C, 0xFF, 0xFF, | |
| 4240 | + 0xE3, 0xC3, 0x0C, 0x30, 0xC3, 0x06, 0x04, 0x73, 0x8C, 0x30, 0xC3, 0x3C, | |
| 4241 | + 0xE0, 0xF8, 0xC7, 0xC0 }; | |
| 4242 | + | |
| 4243 | +const GFXglyph GillSans9pt7bGlyphs[] PROGMEM = { | |
| 4244 | + { 0, 1, 1, 5, 0, 0 }, // 0x20 ' ' | |
| 4245 | + { 1, 2, 12, 5, 1, -11 }, // 0x21 '!' | |
| 4246 | + { 4, 5, 5, 6, 1, -11 }, // 0x22 '"' | |
| 4247 | + { 8, 11, 12, 11, 0, -11 }, // 0x23 '#' | |
| 4248 | + { 25, 8, 14, 10, 1, -11 }, // 0x24 '$' | |
| 4249 | + { 39, 11, 12, 12, 0, -11 }, // 0x25 '%' | |
| 4250 | + { 56, 11, 12, 11, 1, -11 }, // 0x26 '&' | |
| 4251 | + { 73, 2, 5, 3, 1, -11 }, // 0x27 ''' | |
| 4252 | + { 75, 5, 16, 6, 1, -11 }, // 0x28 '(' | |
| 4253 | + { 85, 5, 16, 6, 0, -11 }, // 0x29 ')' | |
| 4254 | + { 95, 7, 9, 8, 0, -12 }, // 0x2A '*' | |
| 4255 | + { 103, 9, 9, 11, 1, -10 }, // 0x2B '+' | |
| 4256 | + { 114, 2, 4, 4, 1, -1 }, // 0x2C ',' | |
| 4257 | + { 115, 4, 2, 6, 1, -4 }, // 0x2D '-' | |
| 4258 | + { 116, 2, 2, 4, 1, -1 }, // 0x2E '.' | |
| 4259 | + { 117, 5, 12, 5, 0, -11 }, // 0x2F '/' | |
| 4260 | + { 125, 7, 12, 9, 1, -11 }, // 0x30 '0' | |
| 4261 | + { 136, 2, 12, 9, 3, -11 }, // 0x31 '1' | |
| 4262 | + { 139, 8, 12, 9, 1, -11 }, // 0x32 '2' | |
| 4263 | + { 151, 6, 12, 9, 1, -11 }, // 0x33 '3' | |
| 4264 | + { 160, 8, 12, 9, 0, -11 }, // 0x34 '4' | |
| 4265 | + { 172, 7, 12, 9, 1, -11 }, // 0x35 '5' | |
| 4266 | + { 183, 7, 12, 9, 1, -11 }, // 0x36 '6' | |
| 4267 | + { 194, 8, 12, 9, 1, -11 }, // 0x37 '7' | |
| 4268 | + { 206, 7, 12, 9, 1, -11 }, // 0x38 '8' | |
| 4269 | + { 217, 7, 12, 9, 1, -11 }, // 0x39 '9' | |
| 4270 | + { 228, 2, 8, 4, 1, -7 }, // 0x3A ':' | |
| 4271 | + { 230, 2, 10, 4, 1, -7 }, // 0x3B ';' | |
| 4272 | + { 233, 9, 9, 11, 1, -10 }, // 0x3C '<' | |
| 4273 | + { 244, 9, 4, 11, 1, -8 }, // 0x3D '=' | |
| 4274 | + { 249, 9, 9, 11, 1, -10 }, // 0x3E '>' | |
| 4275 | + { 260, 4, 12, 6, 1, -11 }, // 0x3F '?' | |
| 4276 | + { 266, 16, 17, 18, 1, -12 }, // 0x40 '@' | |
| 4277 | + { 300, 13, 12, 12, 0, -11 }, // 0x41 'A' | |
| 4278 | + { 320, 8, 12, 10, 1, -11 }, // 0x42 'B' | |
| 4279 | + { 332, 11, 12, 13, 1, -11 }, // 0x43 'C' | |
| 4280 | + { 349, 12, 12, 14, 1, -11 }, // 0x44 'D' | |
| 4281 | + { 367, 7, 12, 9, 1, -11 }, // 0x45 'E' | |
| 4282 | + { 378, 6, 12, 8, 1, -11 }, // 0x46 'F' | |
| 4283 | + { 387, 11, 12, 13, 1, -11 }, // 0x47 'G' | |
| 4284 | + { 404, 11, 12, 13, 1, -11 }, // 0x48 'H' | |
| 4285 | + { 421, 2, 12, 5, 1, -11 }, // 0x49 'I' | |
| 4286 | + { 424, 4, 16, 5, -1, -11 }, // 0x4A 'J' | |
| 4287 | + { 432, 10, 12, 12, 1, -11 }, // 0x4B 'K' | |
| 4288 | + { 447, 7, 12, 9, 1, -11 }, // 0x4C 'L' | |
| 4289 | + { 458, 11, 12, 14, 1, -11 }, // 0x4D 'M' | |
| 4290 | + { 475, 12, 12, 14, 1, -11 }, // 0x4E 'N' | |
| 4291 | + { 493, 13, 12, 15, 1, -11 }, // 0x4F 'O' | |
| 4292 | + { 513, 8, 12, 9, 1, -11 }, // 0x50 'P' | |
| 4293 | + { 525, 13, 14, 15, 1, -11 }, // 0x51 'Q' | |
| 4294 | + { 548, 9, 12, 11, 1, -11 }, // 0x52 'R' | |
| 4295 | + { 562, 6, 12, 8, 1, -11 }, // 0x53 'S' | |
| 4296 | + { 571, 10, 12, 11, 0, -11 }, // 0x54 'T' | |
| 4297 | + { 586, 11, 12, 13, 1, -11 }, // 0x55 'U' | |
| 4298 | + { 603, 11, 12, 11, 0, -11 }, // 0x56 'V' | |
| 4299 | + { 620, 19, 12, 19, 0, -11 }, // 0x57 'W' | |
| 4300 | + { 649, 13, 12, 13, 0, -11 }, // 0x58 'X' | |
| 4301 | + { 669, 11, 12, 11, 0, -11 }, // 0x59 'Y' | |
| 4302 | + { 686, 11, 12, 12, 0, -11 }, // 0x5A 'Z' | |
| 4303 | + { 703, 4, 16, 6, 2, -11 }, // 0x5B '[' | |
| 4304 | + { 711, 5, 12, 5, 0, -11 }, // 0x5C '\' | |
| 4305 | + { 719, 4, 16, 6, 0, -11 }, // 0x5D ']' | |
| 4306 | + { 727, 7, 7, 8, 0, -11 }, // 0x5E '^' | |
| 4307 | + { 734, 10, 1, 10, 0, 4 }, // 0x5F '_' | |
| 4308 | + { 736, 3, 3, 6, 1, -12 }, // 0x60 '`' | |
| 4309 | + { 738, 7, 8, 8, 1, -7 }, // 0x61 'a' | |
| 4310 | + { 745, 7, 12, 9, 1, -11 }, // 0x62 'b' | |
| 4311 | + { 756, 6, 8, 8, 1, -7 }, // 0x63 'c' | |
| 4312 | + { 762, 7, 12, 9, 1, -11 }, // 0x64 'd' | |
| 4313 | + { 773, 7, 8, 9, 1, -7 }, // 0x65 'e' | |
| 4314 | + { 780, 5, 12, 5, 0, -11 }, // 0x66 'f' | |
| 4315 | + { 788, 7, 12, 8, 1, -7 }, // 0x67 'g' | |
| 4316 | + { 799, 7, 12, 9, 1, -11 }, // 0x68 'h' | |
| 4317 | + { 810, 2, 11, 4, 1, -10 }, // 0x69 'i' | |
| 4318 | + { 813, 3, 15, 4, 0, -10 }, // 0x6A 'j' | |
| 4319 | + { 819, 8, 12, 9, 1, -11 }, // 0x6B 'k' | |
| 4320 | + { 831, 2, 12, 4, 1, -11 }, // 0x6C 'l' | |
| 4321 | + { 834, 12, 8, 14, 1, -7 }, // 0x6D 'm' | |
| 4322 | + { 846, 7, 8, 9, 1, -7 }, // 0x6E 'n' | |
| 4323 | + { 853, 8, 8, 10, 1, -7 }, // 0x6F 'o' | |
| 4324 | + { 861, 7, 12, 9, 1, -7 }, // 0x70 'p' | |
| 4325 | + { 872, 7, 12, 9, 1, -7 }, // 0x71 'q' | |
| 4326 | + { 883, 6, 8, 7, 1, -7 }, // 0x72 'r' | |
| 4327 | + { 889, 5, 8, 7, 1, -7 }, // 0x73 's' | |
| 4328 | + { 894, 6, 10, 6, 0, -9 }, // 0x74 't' | |
| 4329 | + { 902, 7, 8, 9, 1, -7 }, // 0x75 'u' | |
| 4330 | + { 909, 7, 8, 8, 0, -7 }, // 0x76 'v' | |
| 4331 | + { 916, 13, 8, 13, 0, -7 }, // 0x77 'w' | |
| 4332 | + { 929, 9, 8, 9, 0, -7 }, // 0x78 'x' | |
| 4333 | + { 938, 8, 12, 8, 0, -7 }, // 0x79 'y' | |
| 4334 | + { 950, 7, 8, 8, 0, -7 }, // 0x7A 'z' | |
| 4335 | + { 957, 6, 17, 6, 0, -12 }, // 0x7B '{' | |
| 4336 | + { 970, 1, 16, 5, 2, -11 }, // 0x7C '|' | |
| 4337 | + { 972, 6, 17, 6, 0, -12 }, // 0x7D '}' | |
| 4338 | + { 985, 9, 2, 11, 1, -6 } }; // 0x7E '~' | |
| 4339 | + | |
| 4340 | +const GFXfont GillSans9pt7b PROGMEM = { | |
| 4341 | + (uint8_t *)GillSans9pt7bBitmaps, | |
| 4342 | + (GFXglyph *)GillSans9pt7bGlyphs, | |
| 4343 | + 0x20, 0x7E, 20 }; | |
| 4344 | + | |
| 4345 | +// Approx. 1660 bytes | |
| 4346 | +const uint8_t ptmono9pt7bBitmaps[] PROGMEM = { | |
| 4347 | + 0x00, 0xFF, 0xFF, 0xCF, 0xC0, 0xCF, 0x3C, 0xF3, 0xCE, 0x20, 0x1D, 0xC6, | |
| 4348 | + 0x61, 0x99, 0xFF, 0x7F, 0xCC, 0xC3, 0x33, 0xFE, 0xFF, 0x8C, 0xC6, 0x61, | |
| 4349 | + 0x98, 0x18, 0x18, 0x3E, 0x7E, 0xCA, 0xC8, 0xE8, 0x78, 0x7E, 0x1F, 0x17, | |
| 4350 | + 0x13, 0x93, 0xFE, 0xFC, 0x18, 0x18, 0x70, 0x5F, 0x0F, 0x63, 0x6C, 0xCF, | |
| 4351 | + 0xB0, 0xEC, 0x01, 0x00, 0x6E, 0x1B, 0xE6, 0x6D, 0x8D, 0xE1, 0xF4, 0x1C, | |
| 4352 | + 0x3C, 0x1F, 0x86, 0x61, 0x98, 0x3C, 0x0E, 0x07, 0x8F, 0x33, 0xC6, 0xF0, | |
| 4353 | + 0xEE, 0x39, 0xFF, 0x3C, 0x40, 0xFF, 0xE0, 0x06, 0x3C, 0xE3, 0x86, 0x1C, | |
| 4354 | + 0x30, 0x60, 0xC1, 0x83, 0x07, 0x06, 0x0E, 0x0E, 0x0F, 0x06, 0xC1, 0xE0, | |
| 4355 | + 0xE0, 0xE0, 0xC1, 0xC1, 0x83, 0x06, 0x0C, 0x18, 0x70, 0xC3, 0x8E, 0x78, | |
| 4356 | + 0xC0, 0x22, 0x3B, 0x85, 0x1F, 0xFF, 0xF8, 0xA1, 0xD8, 0x46, 0x18, 0x18, | |
| 4357 | + 0x18, 0x18, 0xFF, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x67, 0x71, 0x2C, 0xFF, | |
| 4358 | + 0xC0, 0xFF, 0x80, 0x02, 0x03, 0x06, 0x06, 0x0C, 0x0C, 0x0C, 0x18, 0x18, | |
| 4359 | + 0x30, 0x30, 0x70, 0x60, 0x60, 0xC0, 0x40, 0x3E, 0x3F, 0x98, 0xD8, 0x3C, | |
| 4360 | + 0x7E, 0x7F, 0x77, 0xF3, 0xE1, 0xE0, 0xD8, 0xCF, 0xE3, 0xE0, 0x18, 0x38, | |
| 4361 | + 0x78, 0xD8, 0x98, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xFF, 0xFF, 0x7C, | |
| 4362 | + 0xFE, 0x47, 0x03, 0x03, 0x03, 0x06, 0x0C, 0x18, 0x38, 0x60, 0xFF, 0xFF, | |
| 4363 | + 0xFE, 0xFE, 0x0C, 0x1C, 0x18, 0x3E, 0x3F, 0x07, 0x03, 0x03, 0x87, 0xFE, | |
| 4364 | + 0xFC, 0x03, 0x01, 0xC0, 0xF0, 0x7C, 0x3B, 0x0C, 0xC6, 0x33, 0xFF, 0xFF, | |
| 4365 | + 0xC0, 0xC0, 0x30, 0x0C, 0x03, 0x00, 0x7F, 0x7F, 0x60, 0x60, 0x60, 0x7C, | |
| 4366 | + 0x7E, 0x07, 0x03, 0x03, 0x87, 0xFE, 0xFC, 0x06, 0x0F, 0x0E, 0x0E, 0x06, | |
| 4367 | + 0x06, 0xF3, 0xFD, 0xC7, 0xC1, 0xE0, 0xF8, 0xEF, 0xE3, 0xE0, 0xFF, 0xFF, | |
| 4368 | + 0x07, 0x06, 0x0E, 0x0C, 0x0C, 0x18, 0x18, 0x30, 0x30, 0x60, 0xE0, 0x3E, | |
| 4369 | + 0x3F, 0xF8, 0xF8, 0x3E, 0x31, 0xF0, 0xFC, 0xCF, 0xC1, 0xE0, 0xF8, 0xEF, | |
| 4370 | + 0xE3, 0xE0, 0x3E, 0x3F, 0xB8, 0xF8, 0x3C, 0x1F, 0x0D, 0xFE, 0x7B, 0x03, | |
| 4371 | + 0x01, 0x83, 0x87, 0x83, 0x80, 0xFF, 0x80, 0x07, 0xFC, 0x77, 0x70, 0x00, | |
| 4372 | + 0x06, 0x77, 0x12, 0xC0, 0x01, 0x01, 0xC3, 0xC7, 0x87, 0x07, 0x01, 0xE0, | |
| 4373 | + 0x78, 0x0F, 0x01, 0xC0, 0x40, 0xFF, 0xFF, 0xC0, 0x00, 0x0F, 0xFF, 0xFC, | |
| 4374 | + 0x40, 0x70, 0x1E, 0x03, 0xC0, 0x70, 0x1C, 0x3C, 0x3C, 0x78, 0x70, 0x10, | |
| 4375 | + 0x00, 0x3E, 0x3F, 0xF0, 0x60, 0x30, 0x38, 0x38, 0x38, 0x30, 0x18, 0x00, | |
| 4376 | + 0x06, 0x03, 0x81, 0x80, 0x0F, 0x07, 0xF1, 0xC3, 0x30, 0x6E, 0x0D, 0x9F, | |
| 4377 | + 0xB7, 0xF6, 0xC6, 0xD8, 0xDB, 0xFF, 0xBB, 0xB0, 0x07, 0x88, 0x7F, 0x83, | |
| 4378 | + 0xF0, 0x0C, 0x03, 0x01, 0xE0, 0x78, 0x1E, 0x0C, 0xC3, 0x30, 0xCC, 0x7F, | |
| 4379 | + 0x9F, 0xE6, 0x1B, 0x03, 0xC0, 0xC0, 0xFE, 0x7F, 0xF0, 0x78, 0x3C, 0x37, | |
| 4380 | + 0xF3, 0xFD, 0x87, 0xC1, 0xE0, 0xF0, 0xFF, 0xEF, 0xE0, 0x1F, 0x9F, 0xDC, | |
| 4381 | + 0x6C, 0x3C, 0x06, 0x03, 0x01, 0x80, 0xC0, 0x70, 0xDC, 0x67, 0xF1, 0xF0, | |
| 4382 | + 0xFC, 0x7F, 0xB0, 0xD8, 0x7C, 0x1E, 0x0F, 0x07, 0x83, 0xC1, 0xE1, 0xF1, | |
| 4383 | + 0xDF, 0xCF, 0xC0, 0xFF, 0xFF, 0xC0, 0xC0, 0xC0, 0xFE, 0xFE, 0xC0, 0xC0, | |
| 4384 | + 0xC0, 0xC0, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0xC0, 0xC0, 0xFF, 0xFF, 0xC0, | |
| 4385 | + 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x1F, 0x9F, 0xDC, 0x6C, 0x3C, 0x06, 0x03, | |
| 4386 | + 0x1F, 0x8F, 0xC1, 0xB0, 0xDC, 0x67, 0xF1, 0xF0, 0xC1, 0xE0, 0xF0, 0x78, | |
| 4387 | + 0x3C, 0x1F, 0xFF, 0xFF, 0x83, 0xC1, 0xE0, 0xF0, 0x78, 0x3C, 0x18, 0xFF, | |
| 4388 | + 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xFF, 0xFF, | |
| 4389 | + 0xFF, 0xFF, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x87, 0xFE, | |
| 4390 | + 0x7C, 0xC1, 0xF0, 0xEC, 0x73, 0x1C, 0xCE, 0x3F, 0x0F, 0xC3, 0x38, 0xC6, | |
| 4391 | + 0x31, 0xCC, 0x3B, 0x0E, 0xC1, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, | |
| 4392 | + 0xC0, 0xC0, 0xC3, 0xC3, 0xC3, 0xFF, 0xFF, 0xC1, 0xF1, 0xFD, 0xFE, 0xFF, | |
| 4393 | + 0xFE, 0xEF, 0x27, 0x83, 0xC1, 0xE0, 0xF0, 0x78, 0x3C, 0x18, 0xC1, 0xF0, | |
| 4394 | + 0xF8, 0x7E, 0x3F, 0x9F, 0xCF, 0x77, 0xBF, 0xCF, 0xE3, 0xF1, 0xF8, 0x7C, | |
| 4395 | + 0x18, 0x1E, 0x1F, 0xE6, 0x1B, 0x03, 0xC0, 0xF0, 0x3C, 0x0F, 0x03, 0xC0, | |
| 4396 | + 0xF0, 0x36, 0x19, 0xFE, 0x1E, 0x00, 0xFE, 0x7F, 0xB0, 0xF8, 0x3C, 0x1E, | |
| 4397 | + 0x0F, 0x0F, 0xFE, 0xFC, 0x60, 0x30, 0x18, 0x0C, 0x00, 0x1E, 0x1F, 0xE6, | |
| 4398 | + 0x1B, 0x03, 0xC0, 0xF0, 0x3C, 0x0F, 0x03, 0xC0, 0xF0, 0x36, 0x19, 0xFE, | |
| 4399 | + 0x1E, 0x03, 0x00, 0x7C, 0x0F, 0xFC, 0x7F, 0x31, 0xD8, 0x6C, 0x36, 0x3B, | |
| 4400 | + 0xF9, 0xF8, 0xCE, 0x67, 0x31, 0xD8, 0xEC, 0x38, 0x3F, 0xBF, 0xF0, 0x78, | |
| 4401 | + 0x3E, 0x03, 0xC0, 0xF8, 0x1F, 0x01, 0xE0, 0xF0, 0xFF, 0xE7, 0xE0, 0xFF, | |
| 4402 | + 0xFF, 0xFC, 0xCF, 0x33, 0x0C, 0x03, 0x00, 0xC0, 0x30, 0x0C, 0x03, 0x00, | |
| 4403 | + 0xC0, 0xFC, 0x3F, 0x00, 0xC1, 0xE0, 0xF0, 0x78, 0x3C, 0x1E, 0x0F, 0x07, | |
| 4404 | + 0x83, 0xC1, 0xE0, 0xF8, 0xEF, 0xE3, 0xE0, 0xE1, 0xF8, 0x76, 0x19, 0xC6, | |
| 4405 | + 0x73, 0x8C, 0xC3, 0x30, 0xEC, 0x3F, 0x07, 0x81, 0xE0, 0x78, 0x0E, 0x00, | |
| 4406 | + 0xC0, 0x78, 0x0F, 0x01, 0xF0, 0x3E, 0x66, 0xDD, 0x9B, 0xB3, 0x5E, 0x7B, | |
| 4407 | + 0xCF, 0x79, 0xC7, 0x38, 0xE7, 0x1C, 0xE0, 0xEE, 0x38, 0xE6, 0x1D, 0xC1, | |
| 4408 | + 0xF0, 0x3E, 0x03, 0x80, 0xF8, 0x1B, 0x07, 0x71, 0xC7, 0x38, 0xEE, 0x0E, | |
| 4409 | + 0xE1, 0xD8, 0x67, 0x38, 0xCC, 0x3F, 0x07, 0x81, 0xE0, 0x30, 0x0C, 0x03, | |
| 4410 | + 0x00, 0xC0, 0x30, 0x0C, 0x00, 0xFF, 0xFF, 0xC0, 0xE0, 0xE0, 0xE0, 0x60, | |
| 4411 | + 0x70, 0x70, 0x70, 0x38, 0x38, 0x1F, 0xFF, 0xF8, 0xFF, 0xFF, 0x06, 0x0C, | |
| 4412 | + 0x18, 0x30, 0x60, 0xC1, 0x83, 0x06, 0x0C, 0x18, 0x30, 0x7F, 0xFE, 0x40, | |
| 4413 | + 0xC0, 0x60, 0x60, 0x30, 0x30, 0x30, 0x18, 0x18, 0x0C, 0x0C, 0x0C, 0x06, | |
| 4414 | + 0x06, 0x03, 0x02, 0xFF, 0xFC, 0x18, 0x30, 0x60, 0xC1, 0x83, 0x06, 0x0C, | |
| 4415 | + 0x18, 0x30, 0x60, 0xC1, 0xFF, 0xFE, 0x0C, 0x03, 0x81, 0xE0, 0xCC, 0x33, | |
| 4416 | + 0x18, 0x6E, 0x1C, 0xFF, 0xFF, 0xE7, 0x30, 0x7E, 0x3F, 0x80, 0xC7, 0xEF, | |
| 4417 | + 0xF6, 0x1B, 0x0D, 0xFF, 0x7B, 0x80, 0xE0, 0x38, 0x06, 0x01, 0x80, 0x6F, | |
| 4418 | + 0x1F, 0xE7, 0x1D, 0x83, 0x60, 0xD8, 0x36, 0x1D, 0xFE, 0x3E, 0x00, 0x1F, | |
| 4419 | + 0x3F, 0xF8, 0x78, 0x3C, 0x06, 0x03, 0x84, 0xFF, 0x3F, 0x00, 0x03, 0x80, | |
| 4420 | + 0xE0, 0x18, 0x06, 0x1F, 0x9F, 0xEE, 0x1B, 0x06, 0xC1, 0xB0, 0x6E, 0x39, | |
| 4421 | + 0xFF, 0x3C, 0xC0, 0x3E, 0x3F, 0xB0, 0x7F, 0xFF, 0xFE, 0x03, 0x84, 0xFF, | |
| 4422 | + 0x3F, 0x00, 0x0F, 0x8F, 0xCC, 0x46, 0x0F, 0xF7, 0xF8, 0xC0, 0x60, 0x30, | |
| 4423 | + 0x18, 0x0C, 0x1F, 0xEF, 0xF0, 0x3F, 0xBF, 0xF8, 0x78, 0x3C, 0x1E, 0x0F, | |
| 4424 | + 0x8E, 0xFF, 0x3F, 0x80, 0xC8, 0xEF, 0xE3, 0xE0, 0xE0, 0x70, 0x18, 0x0C, | |
| 4425 | + 0x06, 0xF3, 0xFD, 0xC6, 0xC3, 0x61, 0xB0, 0xD8, 0x6C, 0x36, 0x18, 0x1C, | |
| 4426 | + 0x1C, 0x1C, 0x00, 0xF8, 0xF8, 0x18, 0x18, 0x18, 0x18, 0x18, 0xFF, 0xFF, | |
| 4427 | + 0x0E, 0x1C, 0x38, 0x07, 0xEF, 0xC1, 0x83, 0x06, 0x0C, 0x18, 0x30, 0x60, | |
| 4428 | + 0xE3, 0xFE, 0x78, 0xE0, 0x38, 0x06, 0x01, 0x80, 0x63, 0x99, 0xC6, 0xE1, | |
| 4429 | + 0xB0, 0x7C, 0x1B, 0x86, 0x71, 0x9F, 0x63, 0xC0, 0xF0, 0xF0, 0x30, 0x30, | |
| 4430 | + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x3F, 0x1E, 0xFB, 0xBF, 0xFC, | |
| 4431 | + 0xCF, 0x33, 0xCC, 0xF3, 0x3C, 0xCF, 0x33, 0xCC, 0xC0, 0xEF, 0x7F, 0xDC, | |
| 4432 | + 0xEC, 0x36, 0x1B, 0x0D, 0x86, 0xC3, 0x61, 0x80, 0x3F, 0x1F, 0xEE, 0x1F, | |
| 4433 | + 0x03, 0xC0, 0xF0, 0x3E, 0x1D, 0xFE, 0x3F, 0x00, 0xEF, 0x3F, 0xE7, 0x1D, | |
| 4434 | + 0x83, 0x60, 0xD8, 0x36, 0x1D, 0xFE, 0x7F, 0x18, 0x06, 0x01, 0x80, 0x60, | |
| 4435 | + 0x00, 0x1F, 0xBF, 0xF8, 0x78, 0x3C, 0x1E, 0x0F, 0x8E, 0xFF, 0x3D, 0x80, | |
| 4436 | + 0xC0, 0x60, 0x30, 0x18, 0xF7, 0x7F, 0xCE, 0x66, 0x03, 0x01, 0x80, 0xC1, | |
| 4437 | + 0xFE, 0xFF, 0x00, 0x7E, 0xFF, 0xC2, 0xF0, 0x7E, 0x07, 0x43, 0xFF, 0x3E, | |
| 4438 | + 0x10, 0x0C, 0x03, 0x03, 0xFE, 0xFF, 0x8C, 0x03, 0x00, 0xC0, 0x30, 0x0E, | |
| 4439 | + 0x21, 0xFC, 0x3C, 0xE3, 0xB8, 0xE6, 0x19, 0x86, 0x61, 0x98, 0x66, 0x39, | |
| 4440 | + 0xFF, 0x3C, 0xC0, 0xE1, 0xD8, 0x67, 0x18, 0xCE, 0x3B, 0x0E, 0xC1, 0xE0, | |
| 4441 | + 0x78, 0x0E, 0x00, 0xC0, 0x7C, 0x0D, 0x9B, 0x37, 0x66, 0xEC, 0xDF, 0x9E, | |
| 4442 | + 0xF1, 0xDC, 0x39, 0x80, 0xE3, 0xB9, 0x8D, 0x87, 0xC1, 0xC1, 0xF1, 0xDC, | |
| 4443 | + 0xC6, 0xE3, 0x80, 0xE1, 0xD8, 0x76, 0x19, 0xC6, 0x33, 0x8E, 0xC1, 0xB0, | |
| 4444 | + 0x7C, 0x0E, 0x01, 0x84, 0xE1, 0xF0, 0x38, 0x00, 0xFF, 0xFF, 0x06, 0x0C, | |
| 4445 | + 0x18, 0x30, 0x60, 0xFF, 0xFF, 0x0F, 0x1F, 0x18, 0x18, 0x18, 0x18, 0x18, | |
| 4446 | + 0x38, 0xF0, 0xF0, 0x38, 0x18, 0x18, 0x18, 0x18, 0x1F, 0x0F, 0xFF, 0xFF, | |
| 4447 | + 0xFF, 0xFC, 0xF0, 0xF8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1C, 0x0F, 0x0F, | |
| 4448 | + 0x1C, 0x18, 0x18, 0x18, 0x18, 0xF8, 0xF0, 0x72, 0xFF, 0x8F }; | |
| 4449 | + | |
| 4450 | +const GFXglyph ptmono9pt7bGlyphs[] PROGMEM = { | |
| 4451 | + { 0, 1, 1, 11, 0, 0 }, // 0x20 ' ' | |
| 4452 | + { 1, 2, 13, 11, 4, -12 }, // 0x21 '!' | |
| 4453 | + { 5, 6, 6, 11, 2, -12 }, // 0x22 '"' | |
| 4454 | + { 10, 10, 12, 11, 0, -11 }, // 0x23 '#' | |
| 4455 | + { 25, 8, 17, 11, 1, -14 }, // 0x24 '$' | |
| 4456 | + { 42, 11, 13, 11, 0, -12 }, // 0x25 '%' | |
| 4457 | + { 60, 10, 13, 11, 0, -12 }, // 0x26 '&' | |
| 4458 | + { 77, 2, 6, 11, 4, -12 }, // 0x27 ''' | |
| 4459 | + { 79, 7, 17, 11, 2, -12 }, // 0x28 '(' | |
| 4460 | + { 94, 7, 17, 11, 2, -12 }, // 0x29 ')' | |
| 4461 | + { 109, 9, 8, 11, 1, -12 }, // 0x2A '*' | |
| 4462 | + { 118, 8, 10, 11, 1, -10 }, // 0x2B '+' | |
| 4463 | + { 128, 4, 6, 11, 3, -2 }, // 0x2C ',' | |
| 4464 | + { 131, 5, 2, 11, 3, -5 }, // 0x2D '-' | |
| 4465 | + { 133, 3, 3, 11, 4, -2 }, // 0x2E '.' | |
| 4466 | + { 135, 8, 16, 11, 1, -12 }, // 0x2F '/' | |
| 4467 | + { 151, 9, 13, 11, 1, -12 }, // 0x30 '0' | |
| 4468 | + { 166, 8, 13, 11, 2, -12 }, // 0x31 '1' | |
| 4469 | + { 179, 8, 13, 11, 1, -12 }, // 0x32 '2' | |
| 4470 | + { 192, 8, 13, 11, 2, -12 }, // 0x33 '3' | |
| 4471 | + { 205, 10, 13, 11, 0, -12 }, // 0x34 '4' | |
| 4472 | + { 222, 8, 13, 11, 1, -12 }, // 0x35 '5' | |
| 4473 | + { 235, 9, 13, 11, 1, -12 }, // 0x36 '6' | |
| 4474 | + { 250, 8, 13, 11, 1, -12 }, // 0x37 '7' | |
| 4475 | + { 263, 9, 13, 11, 1, -12 }, // 0x38 '8' | |
| 4476 | + { 278, 9, 13, 11, 1, -12 }, // 0x39 '9' | |
| 4477 | + { 293, 3, 10, 11, 4, -9 }, // 0x3A ':' | |
| 4478 | + { 297, 4, 13, 11, 3, -9 }, // 0x3B ';' | |
| 4479 | + { 304, 9, 11, 11, 1, -10 }, // 0x3C '<' | |
| 4480 | + { 317, 9, 6, 11, 1, -8 }, // 0x3D '=' | |
| 4481 | + { 324, 9, 11, 11, 1, -10 }, // 0x3E '>' | |
| 4482 | + { 337, 9, 13, 11, 1, -12 }, // 0x3F '?' | |
| 4483 | + { 352, 11, 15, 11, 0, -10 }, // 0x40 '@' | |
| 4484 | + { 373, 10, 13, 11, 0, -12 }, // 0x41 'A' | |
| 4485 | + { 390, 9, 13, 11, 1, -12 }, // 0x42 'B' | |
| 4486 | + { 405, 9, 13, 11, 1, -12 }, // 0x43 'C' | |
| 4487 | + { 420, 9, 13, 11, 1, -12 }, // 0x44 'D' | |
| 4488 | + { 435, 8, 13, 11, 1, -12 }, // 0x45 'E' | |
| 4489 | + { 448, 8, 13, 11, 2, -12 }, // 0x46 'F' | |
| 4490 | + { 461, 9, 13, 11, 1, -12 }, // 0x47 'G' | |
| 4491 | + { 476, 9, 13, 11, 1, -12 }, // 0x48 'H' | |
| 4492 | + { 491, 8, 13, 11, 1, -12 }, // 0x49 'I' | |
| 4493 | + { 504, 8, 13, 11, 1, -12 }, // 0x4A 'J' | |
| 4494 | + { 517, 10, 13, 11, 1, -12 }, // 0x4B 'K' | |
| 4495 | + { 534, 8, 13, 11, 2, -12 }, // 0x4C 'L' | |
| 4496 | + { 547, 9, 13, 11, 1, -12 }, // 0x4D 'M' | |
| 4497 | + { 562, 9, 13, 11, 1, -12 }, // 0x4E 'N' | |
| 4498 | + { 577, 10, 13, 11, 0, -12 }, // 0x4F 'O' | |
| 4499 | + { 594, 9, 13, 11, 1, -12 }, // 0x50 'P' | |
| 4500 | + { 609, 10, 16, 11, 0, -12 }, // 0x51 'Q' | |
| 4501 | + { 629, 9, 13, 11, 1, -12 }, // 0x52 'R' | |
| 4502 | + { 644, 9, 13, 11, 1, -12 }, // 0x53 'S' | |
| 4503 | + { 659, 10, 13, 11, 0, -12 }, // 0x54 'T' | |
| 4504 | + { 676, 9, 13, 11, 1, -12 }, // 0x55 'U' | |
| 4505 | + { 691, 10, 13, 11, 0, -12 }, // 0x56 'V' | |
| 4506 | + { 708, 11, 13, 11, 0, -12 }, // 0x57 'W' | |
| 4507 | + { 726, 11, 13, 11, 0, -12 }, // 0x58 'X' | |
| 4508 | + { 744, 10, 13, 11, 0, -12 }, // 0x59 'Y' | |
| 4509 | + { 761, 9, 13, 11, 1, -12 }, // 0x5A 'Z' | |
| 4510 | + { 776, 7, 17, 11, 2, -12 }, // 0x5B '[' | |
| 4511 | + { 791, 8, 16, 11, 1, -12 }, // 0x5C '\' | |
| 4512 | + { 807, 7, 17, 11, 2, -12 }, // 0x5D ']' | |
| 4513 | + { 822, 10, 7, 11, 0, -12 }, // 0x5E '^' | |
| 4514 | + { 831, 8, 2, 11, 1, 3 }, // 0x5F '_' | |
| 4515 | + { 833, 4, 3, 11, 3, -12 }, // 0x60 '`' | |
| 4516 | + { 835, 9, 9, 11, 1, -8 }, // 0x61 'a' | |
| 4517 | + { 846, 10, 13, 11, 0, -12 }, // 0x62 'b' | |
| 4518 | + { 863, 9, 9, 11, 1, -8 }, // 0x63 'c' | |
| 4519 | + { 874, 10, 13, 11, 0, -12 }, // 0x64 'd' | |
| 4520 | + { 891, 9, 9, 11, 1, -8 }, // 0x65 'e' | |
| 4521 | + { 902, 9, 13, 11, 1, -12 }, // 0x66 'f' | |
| 4522 | + { 917, 9, 13, 11, 1, -8 }, // 0x67 'g' | |
| 4523 | + { 932, 9, 13, 11, 0, -12 }, // 0x68 'h' | |
| 4524 | + { 947, 8, 13, 11, 1, -12 }, // 0x69 'i' | |
| 4525 | + { 960, 7, 17, 11, 1, -12 }, // 0x6A 'j' | |
| 4526 | + { 975, 10, 13, 11, 1, -12 }, // 0x6B 'k' | |
| 4527 | + { 992, 8, 13, 11, 1, -12 }, // 0x6C 'l' | |
| 4528 | + { 1005, 10, 9, 11, 0, -8 }, // 0x6D 'm' | |
| 4529 | + { 1017, 9, 9, 11, 1, -8 }, // 0x6E 'n' | |
| 4530 | + { 1028, 10, 9, 11, 0, -8 }, // 0x6F 'o' | |
| 4531 | + { 1040, 10, 13, 11, 0, -8 }, // 0x70 'p' | |
| 4532 | + { 1057, 9, 13, 11, 1, -8 }, // 0x71 'q' | |
| 4533 | + { 1072, 9, 9, 11, 1, -8 }, // 0x72 'r' | |
| 4534 | + { 1083, 8, 9, 11, 1, -8 }, // 0x73 's' | |
| 4535 | + { 1092, 10, 12, 11, 0, -11 }, // 0x74 't' | |
| 4536 | + { 1107, 10, 9, 11, 0, -8 }, // 0x75 'u' | |
| 4537 | + { 1119, 10, 9, 11, 0, -8 }, // 0x76 'v' | |
| 4538 | + { 1131, 11, 9, 11, 0, -8 }, // 0x77 'w' | |
| 4539 | + { 1144, 9, 9, 11, 1, -8 }, // 0x78 'x' | |
| 4540 | + { 1155, 10, 13, 11, 0, -8 }, // 0x79 'y' | |
| 4541 | + { 1172, 8, 9, 11, 1, -8 }, // 0x7A 'z' | |
| 4542 | + { 1181, 8, 17, 11, 1, -12 }, // 0x7B '{' | |
| 4543 | + { 1198, 2, 15, 11, 4, -12 }, // 0x7C '|' | |
| 4544 | + { 1202, 8, 17, 11, 2, -12 }, // 0x7D '}' | |
| 4545 | + { 1219, 8, 3, 11, 1, -7 } }; // 0x7E '~' | |
| 4546 | + | |
| 4547 | +const GFXfont ptmono9pt7b PROGMEM = { | |
| 4548 | + (uint8_t *)ptmono9pt7bBitmaps, | |
| 4549 | + (GFXglyph *)ptmono9pt7bGlyphs, | |
| 4550 | + 0x20, 0x7E, 20 }; | |
| 4551 | + | |
| 4552 | +// Approx. 1894 bytes | |
| 4553 | +const uint8_t SourceCodePro_Regular9pt7bBitmaps[] PROGMEM = { | |
| 4554 | + 0x00, 0x49, 0x24, 0x90, 0x1B, 0xE0, 0xCF, 0x34, 0x51, 0x45, 0x10, 0x24, | |
| 4555 | + 0x48, 0x97, 0xF4, 0x48, 0xBF, 0xA4, 0x48, 0x91, 0x20, 0x10, 0x21, 0xF6, | |
| 4556 | + 0x38, 0x18, 0x1E, 0x0E, 0x06, 0x06, 0x1B, 0xE1, 0x02, 0x04, 0x00, 0x38, | |
| 4557 | + 0x13, 0x14, 0x4D, 0x16, 0x4D, 0x0E, 0x80, 0x38, 0x13, 0x14, 0x49, 0x16, | |
| 4558 | + 0x4F, 0x0E, 0x38, 0x32, 0x11, 0x0D, 0x83, 0x81, 0x85, 0xC3, 0xB3, 0x8D, | |
| 4559 | + 0x43, 0x31, 0xEF, 0x10, 0xF5, 0x50, 0x11, 0xD8, 0x8C, 0x42, 0x10, 0x84, | |
| 4560 | + 0x21, 0x84, 0x30, 0xC3, 0xC3, 0x08, 0x21, 0x0C, 0x21, 0x08, 0x46, 0x21, | |
| 4561 | + 0x11, 0x98, 0x10, 0x22, 0x4B, 0xE3, 0x8D, 0x11, 0x00, 0x10, 0x20, 0x40, | |
| 4562 | + 0x8F, 0xE2, 0x04, 0x08, 0x10, 0xFF, 0x97, 0xA0, 0xFC, 0xFF, 0x80, 0x02, | |
| 4563 | + 0x08, 0x10, 0x60, 0x81, 0x06, 0x08, 0x10, 0x60, 0x83, 0x04, 0x08, 0x30, | |
| 4564 | + 0x40, 0x3C, 0x31, 0x10, 0x58, 0x2D, 0x96, 0xEF, 0x05, 0x82, 0x41, 0x31, | |
| 4565 | + 0x0F, 0x00, 0x38, 0x78, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, | |
| 4566 | + 0xFF, 0x3C, 0xC2, 0x03, 0x03, 0x03, 0x06, 0x04, 0x08, 0x30, 0x60, 0xFF, | |
| 4567 | + 0x3C, 0xC3, 0x03, 0x03, 0x06, 0x1C, 0x03, 0x01, 0x01, 0xC3, 0x7E, 0x06, | |
| 4568 | + 0x05, 0x06, 0x82, 0x42, 0x22, 0x13, 0x09, 0xFF, 0x02, 0x01, 0x00, 0x80, | |
| 4569 | + 0x7F, 0x60, 0x60, 0x40, 0x7E, 0x43, 0x01, 0x01, 0x01, 0xC3, 0x7C, 0x1F, | |
| 4570 | + 0x10, 0x98, 0x08, 0x0D, 0xE7, 0x1B, 0x06, 0x83, 0x41, 0x31, 0x87, 0x80, | |
| 4571 | + 0xFF, 0x81, 0x80, 0x80, 0x80, 0x40, 0x40, 0x20, 0x30, 0x18, 0x0C, 0x06, | |
| 4572 | + 0x00, 0x3E, 0x31, 0x90, 0x4C, 0x23, 0x31, 0xF1, 0x99, 0x82, 0xC1, 0xA1, | |
| 4573 | + 0x8F, 0x80, 0x3C, 0x42, 0xC1, 0xC1, 0x41, 0x3F, 0x01, 0x01, 0x03, 0x46, | |
| 4574 | + 0xFC, 0xFF, 0x80, 0x3F, 0xE0, 0xFF, 0x80, 0x3F, 0xE5, 0xE8, 0x02, 0x18, | |
| 4575 | + 0x63, 0x08, 0x0C, 0x06, 0x06, 0x02, 0xFE, 0x00, 0x00, 0x0F, 0xE0, 0x80, | |
| 4576 | + 0x80, 0xC0, 0x60, 0x61, 0x8C, 0x20, 0x80, 0x79, 0x88, 0x18, 0x20, 0x82, | |
| 4577 | + 0x0C, 0x00, 0x00, 0x60, 0xC1, 0x80, 0x1E, 0x10, 0x90, 0x38, 0x18, 0x7C, | |
| 4578 | + 0xC6, 0x43, 0x23, 0x8E, 0xC0, 0x30, 0x08, 0x02, 0x10, 0xF0, 0x18, 0x0A, | |
| 4579 | + 0x05, 0x06, 0x82, 0x61, 0x11, 0x88, 0xFE, 0x41, 0x60, 0xB0, 0x70, 0x10, | |
| 4580 | + 0xFC, 0x86, 0x82, 0x82, 0x86, 0xF8, 0x86, 0x83, 0x83, 0x83, 0x86, 0xFC, | |
| 4581 | + 0x1F, 0x18, 0xD8, 0x08, 0x0C, 0x06, 0x03, 0x01, 0x80, 0x40, 0x30, 0x0C, | |
| 4582 | + 0x63, 0xE0, 0xF8, 0x8C, 0x82, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x86, | |
| 4583 | + 0x8C, 0xF8, 0xFE, 0xC0, 0xC0, 0xC0, 0xC0, 0xFC, 0xC0, 0xC0, 0xC0, 0xC0, | |
| 4584 | + 0xC0, 0xFF, 0xFF, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xFE, 0xC0, 0xC0, 0xC0, | |
| 4585 | + 0xC0, 0xC0, 0x1F, 0x10, 0x90, 0x18, 0x0C, 0x06, 0x03, 0x1F, 0x83, 0xC1, | |
| 4586 | + 0xA0, 0xD8, 0x63, 0xC0, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xFF, 0xC1, 0xC1, | |
| 4587 | + 0xC1, 0xC1, 0xC1, 0xC1, 0xFE, 0x20, 0x40, 0x81, 0x02, 0x04, 0x08, 0x10, | |
| 4588 | + 0x20, 0x47, 0xF0, 0x7F, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, | |
| 4589 | + 0x83, 0x42, 0x3C, 0x83, 0x86, 0x8C, 0x98, 0x90, 0xB8, 0xE8, 0xCC, 0x84, | |
| 4590 | + 0x86, 0x83, 0x83, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, | |
| 4591 | + 0xC0, 0xC0, 0xFF, 0xC1, 0xE3, 0xE3, 0xE5, 0xD5, 0xD5, 0xD9, 0xC9, 0xC1, | |
| 4592 | + 0xC1, 0xC1, 0xC1, 0xC1, 0xE1, 0xE1, 0xD1, 0xD1, 0xD9, 0xC9, 0xCD, 0xC5, | |
| 4593 | + 0xC3, 0xC3, 0xC1, 0x3C, 0x31, 0x90, 0x58, 0x3C, 0x1C, 0x0E, 0x07, 0x83, | |
| 4594 | + 0xC1, 0xA0, 0x98, 0xC7, 0x80, 0xFC, 0x82, 0x83, 0x83, 0x83, 0x86, 0xFC, | |
| 4595 | + 0x80, 0x80, 0x80, 0x80, 0x80, 0x3C, 0x31, 0x90, 0x58, 0x3C, 0x1C, 0x0E, | |
| 4596 | + 0x07, 0x83, 0xC1, 0xA0, 0x98, 0xC7, 0x80, 0x80, 0x60, 0x0E, 0xFC, 0x86, | |
| 4597 | + 0x83, 0x83, 0x82, 0x86, 0xFC, 0x88, 0x8C, 0x84, 0x86, 0x83, 0x3E, 0x30, | |
| 4598 | + 0x90, 0x08, 0x06, 0x01, 0xE0, 0x3C, 0x06, 0x01, 0x80, 0xF0, 0xC7, 0xC0, | |
| 4599 | + 0xFF, 0x84, 0x02, 0x01, 0x00, 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, | |
| 4600 | + 0x01, 0x00, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0x41, | |
| 4601 | + 0x63, 0x3E, 0x81, 0xE0, 0xD0, 0x48, 0x26, 0x33, 0x10, 0x88, 0x4C, 0x34, | |
| 4602 | + 0x0A, 0x05, 0x03, 0x00, 0xC0, 0x78, 0x09, 0x01, 0x20, 0x24, 0x44, 0x98, | |
| 4603 | + 0x92, 0xB3, 0x56, 0x6A, 0x86, 0x30, 0xC6, 0x18, 0xC0, 0xC1, 0xB1, 0x88, | |
| 4604 | + 0x86, 0xC1, 0x40, 0xE0, 0x70, 0x28, 0x26, 0x31, 0x10, 0xD8, 0x30, 0xC1, | |
| 4605 | + 0xE0, 0x98, 0xCC, 0x43, 0x60, 0xA0, 0x70, 0x10, 0x08, 0x04, 0x02, 0x01, | |
| 4606 | + 0x00, 0x7F, 0x81, 0x80, 0x80, 0xC0, 0x40, 0x60, 0x60, 0x20, 0x30, 0x30, | |
| 4607 | + 0x10, 0x1F, 0xF0, 0xFC, 0x21, 0x08, 0x42, 0x10, 0x84, 0x21, 0x08, 0x42, | |
| 4608 | + 0x1F, 0x81, 0x81, 0x02, 0x06, 0x04, 0x0C, 0x08, 0x10, 0x30, 0x20, 0x40, | |
| 4609 | + 0xC0, 0x81, 0x01, 0xF8, 0x42, 0x10, 0x84, 0x21, 0x08, 0x42, 0x10, 0x84, | |
| 4610 | + 0x3F, 0x10, 0x70, 0xA3, 0x44, 0x48, 0xA1, 0x80, 0xFF, 0x80, 0xC6, 0x30, | |
| 4611 | + 0x3E, 0x43, 0x01, 0x0F, 0x71, 0x41, 0xC1, 0x43, 0x3D, 0x80, 0x80, 0x80, | |
| 4612 | + 0x80, 0xBC, 0xC6, 0x82, 0x83, 0x83, 0x83, 0x82, 0xC6, 0xBC, 0x1F, 0x10, | |
| 4613 | + 0xD8, 0x08, 0x0C, 0x02, 0x01, 0x00, 0xC2, 0x1F, 0x80, 0x01, 0x01, 0x01, | |
| 4614 | + 0x01, 0x3D, 0x63, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0x63, 0x3D, 0x1E, 0x31, | |
| 4615 | + 0x90, 0x58, 0x3F, 0xFE, 0x01, 0x00, 0xC2, 0x1F, 0x00, 0x0F, 0x10, 0x30, | |
| 4616 | + 0x30, 0xFE, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x3F, 0xB1, | |
| 4617 | + 0x10, 0xC8, 0x66, 0x21, 0xE1, 0x00, 0x80, 0x3F, 0x20, 0x70, 0x28, 0x33, | |
| 4618 | + 0xE0, 0x81, 0x02, 0x04, 0x09, 0xDC, 0xE0, 0xC1, 0x83, 0x06, 0x0C, 0x18, | |
| 4619 | + 0x20, 0x18, 0xC0, 0x0F, 0x84, 0x21, 0x08, 0x42, 0x10, 0x80, 0x0C, 0x30, | |
| 4620 | + 0x00, 0x7C, 0x10, 0x41, 0x04, 0x10, 0x41, 0x04, 0x10, 0x43, 0xF8, 0x80, | |
| 4621 | + 0x80, 0x80, 0x80, 0x83, 0x84, 0x88, 0x98, 0xB8, 0xCC, 0x84, 0x82, 0x83, | |
| 4622 | + 0xF8, 0x0C, 0x06, 0x03, 0x01, 0x80, 0xC0, 0x60, 0x30, 0x18, 0x0C, 0x06, | |
| 4623 | + 0x01, 0x00, 0x78, 0xBB, 0x66, 0xF2, 0x39, 0x1C, 0x8E, 0x47, 0x23, 0x91, | |
| 4624 | + 0xC8, 0x80, 0x9D, 0xCE, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0x82, 0x3C, 0x31, | |
| 4625 | + 0xB0, 0x58, 0x3C, 0x1E, 0x0F, 0x04, 0xC6, 0x3C, 0x00, 0xBC, 0xC6, 0x82, | |
| 4626 | + 0x83, 0x83, 0x83, 0x82, 0xC6, 0xBC, 0x80, 0x80, 0x80, 0x80, 0x3D, 0x63, | |
| 4627 | + 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0x63, 0x3D, 0x01, 0x01, 0x01, 0x01, 0x9F, | |
| 4628 | + 0x43, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x3E, 0x61, 0x40, 0x70, 0x1E, | |
| 4629 | + 0x03, 0x01, 0x43, 0xBE, 0x10, 0x08, 0x3F, 0xC2, 0x01, 0x00, 0x80, 0x40, | |
| 4630 | + 0x20, 0x10, 0x0C, 0x03, 0xE0, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC3, | |
| 4631 | + 0x45, 0x39, 0xC1, 0xA0, 0x90, 0xCC, 0x42, 0x21, 0xB0, 0x50, 0x28, 0x18, | |
| 4632 | + 0x00, 0xC4, 0x78, 0x89, 0x29, 0x25, 0x26, 0xAC, 0xD5, 0x8C, 0xA1, 0x8C, | |
| 4633 | + 0x31, 0x80, 0xC3, 0x31, 0x0D, 0x82, 0x81, 0x80, 0xE0, 0x98, 0xC6, 0xC1, | |
| 4634 | + 0x80, 0xC1, 0xA0, 0x90, 0x4C, 0x62, 0x21, 0xB0, 0x50, 0x38, 0x0C, 0x04, | |
| 4635 | + 0x06, 0x02, 0x0E, 0x00, 0x7F, 0x01, 0x81, 0x81, 0x81, 0x80, 0x80, 0xC0, | |
| 4636 | + 0xC0, 0xFF, 0x80, 0x1E, 0x20, 0x40, 0x81, 0x02, 0x0C, 0x60, 0x30, 0x20, | |
| 4637 | + 0x40, 0x81, 0x02, 0x04, 0x0F, 0xFF, 0xFF, 0xC0, 0xE0, 0x20, 0x40, 0x81, | |
| 4638 | + 0x02, 0x04, 0x07, 0x18, 0x20, 0x40, 0x81, 0x02, 0x04, 0x70, 0x31, 0x49, | |
| 4639 | + 0x86 }; | |
| 4640 | + | |
| 4641 | +const GFXglyph SourceCodePro_Regular9pt7bGlyphs[] PROGMEM = { | |
| 4642 | + { 0, 1, 1, 11, 0, 0 }, // 0x20 ' ' | |
| 4643 | + { 1, 3, 12, 11, 4, -11 }, // 0x21 '!' | |
| 4644 | + { 6, 6, 6, 11, 2, -11 }, // 0x22 '"' | |
| 4645 | + { 11, 7, 11, 11, 2, -10 }, // 0x23 '#' | |
| 4646 | + { 21, 7, 15, 11, 2, -12 }, // 0x24 '$' | |
| 4647 | + { 35, 10, 12, 11, 0, -11 }, // 0x25 '%' | |
| 4648 | + { 50, 9, 12, 11, 1, -11 }, // 0x26 '&' | |
| 4649 | + { 64, 2, 6, 11, 4, -11 }, // 0x27 ''' | |
| 4650 | + { 66, 5, 16, 11, 4, -12 }, // 0x28 '(' | |
| 4651 | + { 76, 5, 16, 11, 2, -12 }, // 0x29 ')' | |
| 4652 | + { 86, 7, 7, 11, 2, -12 }, // 0x2A '*' | |
| 4653 | + { 93, 7, 9, 11, 2, -9 }, // 0x2B '+' | |
| 4654 | + { 101, 3, 7, 11, 4, -2 }, // 0x2C ',' | |
| 4655 | + { 104, 6, 1, 11, 2, -5 }, // 0x2D '-' | |
| 4656 | + { 105, 3, 3, 11, 4, -2 }, // 0x2E '.' | |
| 4657 | + { 107, 7, 16, 11, 2, -12 }, // 0x2F '/' | |
| 4658 | + { 121, 9, 11, 11, 1, -10 }, // 0x30 '0' | |
| 4659 | + { 134, 8, 11, 11, 2, -10 }, // 0x31 '1' | |
| 4660 | + { 145, 8, 11, 11, 1, -10 }, // 0x32 '2' | |
| 4661 | + { 156, 8, 11, 11, 1, -10 }, // 0x33 '3' | |
| 4662 | + { 167, 9, 11, 11, 1, -10 }, // 0x34 '4' | |
| 4663 | + { 180, 8, 11, 11, 1, -10 }, // 0x35 '5' | |
| 4664 | + { 191, 9, 11, 11, 1, -10 }, // 0x36 '6' | |
| 4665 | + { 204, 9, 11, 11, 1, -10 }, // 0x37 '7' | |
| 4666 | + { 217, 9, 11, 11, 1, -10 }, // 0x38 '8' | |
| 4667 | + { 230, 8, 11, 11, 1, -10 }, // 0x39 '9' | |
| 4668 | + { 241, 3, 9, 11, 4, -8 }, // 0x3A ':' | |
| 4669 | + { 245, 3, 13, 11, 4, -8 }, // 0x3B ';' | |
| 4670 | + { 250, 7, 9, 11, 2, -9 }, // 0x3C '<' | |
| 4671 | + { 258, 7, 5, 11, 2, -7 }, // 0x3D '=' | |
| 4672 | + { 263, 7, 9, 11, 2, -9 }, // 0x3E '>' | |
| 4673 | + { 271, 7, 12, 11, 2, -11 }, // 0x3F '?' | |
| 4674 | + { 282, 9, 14, 11, 1, -10 }, // 0x40 '@' | |
| 4675 | + { 298, 9, 12, 11, 1, -11 }, // 0x41 'A' | |
| 4676 | + { 312, 8, 12, 11, 2, -11 }, // 0x42 'B' | |
| 4677 | + { 324, 9, 12, 11, 1, -11 }, // 0x43 'C' | |
| 4678 | + { 338, 8, 12, 11, 2, -11 }, // 0x44 'D' | |
| 4679 | + { 350, 8, 12, 11, 2, -11 }, // 0x45 'E' | |
| 4680 | + { 362, 8, 12, 11, 2, -11 }, // 0x46 'F' | |
| 4681 | + { 374, 9, 12, 11, 1, -11 }, // 0x47 'G' | |
| 4682 | + { 388, 8, 12, 11, 1, -11 }, // 0x48 'H' | |
| 4683 | + { 400, 7, 12, 11, 2, -11 }, // 0x49 'I' | |
| 4684 | + { 411, 8, 12, 11, 1, -11 }, // 0x4A 'J' | |
| 4685 | + { 423, 8, 12, 11, 2, -11 }, // 0x4B 'K' | |
| 4686 | + { 435, 8, 12, 11, 2, -11 }, // 0x4C 'L' | |
| 4687 | + { 447, 8, 12, 11, 1, -11 }, // 0x4D 'M' | |
| 4688 | + { 459, 8, 12, 11, 1, -11 }, // 0x4E 'N' | |
| 4689 | + { 471, 9, 12, 11, 1, -11 }, // 0x4F 'O' | |
| 4690 | + { 485, 8, 12, 11, 2, -11 }, // 0x50 'P' | |
| 4691 | + { 497, 9, 15, 11, 1, -11 }, // 0x51 'Q' | |
| 4692 | + { 514, 8, 12, 11, 2, -11 }, // 0x52 'R' | |
| 4693 | + { 526, 9, 12, 11, 1, -11 }, // 0x53 'S' | |
| 4694 | + { 540, 9, 12, 11, 1, -11 }, // 0x54 'T' | |
| 4695 | + { 554, 8, 12, 11, 1, -11 }, // 0x55 'U' | |
| 4696 | + { 566, 9, 12, 11, 1, -11 }, // 0x56 'V' | |
| 4697 | + { 580, 11, 12, 11, 0, -11 }, // 0x57 'W' | |
| 4698 | + { 597, 9, 12, 11, 1, -11 }, // 0x58 'X' | |
| 4699 | + { 611, 9, 12, 11, 1, -11 }, // 0x59 'Y' | |
| 4700 | + { 625, 9, 12, 11, 1, -11 }, // 0x5A 'Z' | |
| 4701 | + { 639, 5, 16, 11, 4, -12 }, // 0x5B '[' | |
| 4702 | + { 649, 7, 16, 11, 2, -12 }, // 0x5C '\' | |
| 4703 | + { 663, 5, 16, 11, 2, -12 }, // 0x5D ']' | |
| 4704 | + { 673, 7, 7, 11, 2, -11 }, // 0x5E '^' | |
| 4705 | + { 680, 9, 1, 11, 1, 2 }, // 0x5F '_' | |
| 4706 | + { 682, 4, 3, 11, 3, -12 }, // 0x60 '`' | |
| 4707 | + { 684, 8, 9, 11, 1, -8 }, // 0x61 'a' | |
| 4708 | + { 693, 8, 13, 11, 2, -12 }, // 0x62 'b' | |
| 4709 | + { 706, 9, 9, 11, 1, -8 }, // 0x63 'c' | |
| 4710 | + { 717, 8, 13, 11, 1, -12 }, // 0x64 'd' | |
| 4711 | + { 730, 9, 9, 11, 1, -8 }, // 0x65 'e' | |
| 4712 | + { 741, 8, 13, 11, 2, -12 }, // 0x66 'f' | |
| 4713 | + { 754, 9, 13, 11, 1, -8 }, // 0x67 'g' | |
| 4714 | + { 769, 7, 13, 11, 2, -12 }, // 0x68 'h' | |
| 4715 | + { 781, 5, 13, 11, 2, -12 }, // 0x69 'i' | |
| 4716 | + { 790, 6, 17, 11, 1, -12 }, // 0x6A 'j' | |
| 4717 | + { 803, 8, 13, 11, 2, -12 }, // 0x6B 'k' | |
| 4718 | + { 816, 9, 13, 11, 1, -12 }, // 0x6C 'l' | |
| 4719 | + { 831, 9, 9, 11, 1, -8 }, // 0x6D 'm' | |
| 4720 | + { 842, 7, 9, 11, 2, -8 }, // 0x6E 'n' | |
| 4721 | + { 850, 9, 9, 11, 1, -8 }, // 0x6F 'o' | |
| 4722 | + { 861, 8, 13, 11, 2, -8 }, // 0x70 'p' | |
| 4723 | + { 874, 8, 13, 11, 1, -8 }, // 0x71 'q' | |
| 4724 | + { 887, 7, 9, 11, 3, -8 }, // 0x72 'r' | |
| 4725 | + { 895, 8, 9, 11, 1, -8 }, // 0x73 's' | |
| 4726 | + { 904, 9, 11, 11, 1, -10 }, // 0x74 't' | |
| 4727 | + { 917, 8, 9, 11, 1, -8 }, // 0x75 'u' | |
| 4728 | + { 926, 9, 9, 11, 1, -8 }, // 0x76 'v' | |
| 4729 | + { 937, 11, 9, 11, 0, -8 }, // 0x77 'w' | |
| 4730 | + { 950, 9, 9, 11, 1, -8 }, // 0x78 'x' | |
| 4731 | + { 961, 9, 13, 11, 1, -8 }, // 0x79 'y' | |
| 4732 | + { 976, 9, 9, 11, 1, -8 }, // 0x7A 'z' | |
| 4733 | + { 987, 7, 16, 11, 2, -12 }, // 0x7B '{' | |
| 4734 | + { 1001, 1, 18, 11, 5, -12 }, // 0x7C '|' | |
| 4735 | + { 1004, 7, 16, 11, 2, -12 }, // 0x7D '}' | |
| 4736 | + { 1018, 8, 3, 11, 1, -6 } }; // 0x7E '~' | |
| 4737 | + | |
| 4738 | +const GFXfont SourceCodePro_Regular9pt7b PROGMEM = { | |
| 4739 | + (uint8_t *)SourceCodePro_Regular9pt7bBitmaps, | |
| 4740 | + (GFXglyph *)SourceCodePro_Regular9pt7bGlyphs, | |
| 4741 | + 0x20, 0x7E, 22 }; | |
| 4742 | + | |
| 4743 | +// Approx. 1693 bytes | |
| 4744 | +const uint8_t SourceCodePro_SemiBold9pt7bBitmaps[] PROGMEM = { | |
| 4745 | + 0x00, 0xDB, 0x64, 0x92, 0x1F, 0xF0, 0xEF, 0xDF, 0xBE, 0x64, 0x48, 0x80, | |
| 4746 | + 0x12, 0x12, 0x7F, 0x7F, 0x22, 0x26, 0xFF, 0xFF, 0x24, 0x24, 0x64, 0x08, | |
| 4747 | + 0x08, 0x3E, 0x7F, 0x62, 0x70, 0x3C, 0x0F, 0x03, 0x43, 0xFF, 0x3E, 0x08, | |
| 4748 | + 0x08, 0x08, 0x38, 0x1F, 0x14, 0xCD, 0x36, 0x7F, 0x0E, 0x00, 0x38, 0x1F, | |
| 4749 | + 0x14, 0xCD, 0x36, 0x7F, 0x0E, 0x38, 0x3E, 0x1B, 0x0D, 0x87, 0xC1, 0xCF, | |
| 4750 | + 0xC7, 0xB3, 0xCF, 0x63, 0xBF, 0xEF, 0x10, 0xFF, 0xE4, 0x80, 0x08, 0x73, | |
| 4751 | + 0x08, 0x61, 0x84, 0x30, 0xC1, 0x06, 0x18, 0x20, 0xC1, 0x83, 0x47, 0x0C, | |
| 4752 | + 0x61, 0x8C, 0x61, 0x08, 0xC6, 0x33, 0x19, 0x98, 0x10, 0x23, 0x5F, 0xF3, | |
| 4753 | + 0x87, 0x1B, 0x22, 0x08, 0x08, 0x08, 0xFF, 0xFF, 0x08, 0x08, 0x08, 0x77, | |
| 4754 | + 0x71, 0x36, 0xC0, 0xFF, 0xF0, 0xFF, 0xF0, 0x06, 0x0C, 0x10, 0x60, 0xC3, | |
| 4755 | + 0x06, 0x08, 0x30, 0x60, 0x83, 0x06, 0x18, 0x30, 0x60, 0x3C, 0x3F, 0x98, | |
| 4756 | + 0xDB, 0x6D, 0xDE, 0xCF, 0x07, 0x86, 0x63, 0x3F, 0x8F, 0x00, 0xF8, 0xF8, | |
| 4757 | + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xFF, 0xFF, 0x3C, 0x3F, 0x30, | |
| 4758 | + 0xC0, 0x60, 0x30, 0x30, 0x30, 0x30, 0x30, 0x7F, 0xFF, 0xE0, 0x3E, 0x7F, | |
| 4759 | + 0xC3, 0x03, 0x1E, 0x1E, 0x03, 0x03, 0xC3, 0xFF, 0x3E, 0x0E, 0x07, 0x07, | |
| 4760 | + 0x86, 0xC6, 0x66, 0x33, 0xFF, 0xFF, 0x06, 0x03, 0x01, 0x80, 0x7F, 0x7F, | |
| 4761 | + 0x60, 0x7E, 0x7F, 0x63, 0x03, 0x03, 0xC3, 0xFF, 0x3C, 0x1E, 0x1F, 0x98, | |
| 4762 | + 0x6C, 0x0D, 0xE7, 0xFB, 0x8F, 0x83, 0x63, 0xBF, 0x87, 0x80, 0xFF, 0xFF, | |
| 4763 | + 0xC0, 0xC0, 0xC0, 0x40, 0x60, 0x20, 0x30, 0x18, 0x0C, 0x06, 0x00, 0x3E, | |
| 4764 | + 0x3F, 0x98, 0xCC, 0x63, 0xE1, 0xF1, 0x9D, 0x83, 0xC3, 0xBF, 0x8F, 0x80, | |
| 4765 | + 0x3C, 0x3F, 0x30, 0xD8, 0x2C, 0x3B, 0xFC, 0xE4, 0x06, 0x47, 0x7F, 0x0F, | |
| 4766 | + 0x00, 0xFF, 0xF0, 0x3F, 0xFC, 0x77, 0x77, 0x00, 0x07, 0x77, 0x13, 0x6C, | |
| 4767 | + 0x02, 0x0C, 0x31, 0xC7, 0x18, 0x30, 0x38, 0x38, 0x18, 0x18, 0x10, 0xFF, | |
| 4768 | + 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x81, 0x83, 0x81, 0xC1, 0xC1, 0xC3, 0x8E, | |
| 4769 | + 0x39, 0xC3, 0x04, 0x00, 0x79, 0xF9, 0x38, 0x30, 0xC3, 0x0C, 0x18, 0x00, | |
| 4770 | + 0x60, 0xE1, 0x80, 0x1E, 0x1F, 0x98, 0x78, 0x3C, 0x0C, 0x3E, 0x3F, 0x33, | |
| 4771 | + 0x99, 0xCF, 0xF3, 0xB8, 0x06, 0x11, 0xF8, 0x78, 0x0E, 0x03, 0x81, 0xA0, | |
| 4772 | + 0x6C, 0x1B, 0x0C, 0xC3, 0x18, 0xFE, 0x7F, 0x98, 0x76, 0x0F, 0x83, 0xFC, | |
| 4773 | + 0xFE, 0xC6, 0xC6, 0xFC, 0xFE, 0xC7, 0xC3, 0xC3, 0xC7, 0xFE, 0xFC, 0x1E, | |
| 4774 | + 0x1F, 0xDC, 0x5C, 0x0C, 0x06, 0x03, 0x01, 0x80, 0xE0, 0x38, 0xCF, 0xE3, | |
| 4775 | + 0xE0, 0xFC, 0x7F, 0x31, 0xD8, 0x7C, 0x1E, 0x0F, 0x07, 0x83, 0xC3, 0xE3, | |
| 4776 | + 0xBF, 0x9F, 0x80, 0xFE, 0xFE, 0xC0, 0xC0, 0xC0, 0xFE, 0xFE, 0xC0, 0xC0, | |
| 4777 | + 0xC0, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0xC0, 0xC0, 0xFE, 0xFE, 0xC0, 0xC0, | |
| 4778 | + 0xC0, 0xC0, 0xC0, 0x1E, 0x3F, 0x9C, 0x7C, 0x0C, 0x06, 0x3F, 0x1F, 0x83, | |
| 4779 | + 0xE1, 0xB0, 0xDF, 0xE3, 0xC0, 0xC3, 0xE1, 0xF0, 0xF8, 0x7C, 0x3F, 0xFF, | |
| 4780 | + 0xFF, 0x87, 0xC3, 0xE1, 0xF0, 0xF8, 0x70, 0xFF, 0xFC, 0xC1, 0x83, 0x06, | |
| 4781 | + 0x0C, 0x18, 0x30, 0x63, 0xFF, 0xF0, 0x7F, 0x7F, 0x03, 0x03, 0x03, 0x03, | |
| 4782 | + 0x03, 0x03, 0x03, 0x47, 0xFE, 0x3C, 0xE3, 0xB8, 0xCE, 0x63, 0xB0, 0xFC, | |
| 4783 | + 0x3F, 0x0F, 0xE3, 0x98, 0xE7, 0x38, 0xCE, 0x3B, 0x87, 0xC0, 0xC0, 0xC0, | |
| 4784 | + 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xFF, 0xFF, 0xE3, 0xE3, 0xE3, | |
| 4785 | + 0xE7, 0xF5, 0xD5, 0xD5, 0xD9, 0xC9, 0xC1, 0xC1, 0xC1, 0xE3, 0xE3, 0xF3, | |
| 4786 | + 0xD3, 0xDB, 0xDB, 0xCB, 0xCD, 0xC5, 0xC7, 0xC3, 0xC3, 0x3C, 0x3F, 0xB8, | |
| 4787 | + 0xD8, 0x7C, 0x1E, 0x0F, 0x07, 0x83, 0xC3, 0xB1, 0x9F, 0xC7, 0x80, 0xFC, | |
| 4788 | + 0xFE, 0xC7, 0xC3, 0xC3, 0xC7, 0xFE, 0xFC, 0xC0, 0xC0, 0xC0, 0xC0, 0x3C, | |
| 4789 | + 0x3F, 0xB8, 0xD8, 0x7C, 0x1E, 0x0F, 0x07, 0x83, 0xC3, 0xF1, 0x9F, 0xC7, | |
| 4790 | + 0xC0, 0xC0, 0x7C, 0x1E, 0xFC, 0xFE, 0xC7, 0xC3, 0xC7, 0xFE, 0xFC, 0xCC, | |
| 4791 | + 0xCC, 0xC6, 0xC6, 0xC3, 0x3E, 0x3F, 0x98, 0x4C, 0x07, 0x01, 0xE0, 0x7C, | |
| 4792 | + 0x07, 0x01, 0xA1, 0xFF, 0xC7, 0xC0, 0xFF, 0xFF, 0xC6, 0x03, 0x01, 0x80, | |
| 4793 | + 0xC0, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x03, 0x00, 0xC3, 0xE1, 0xF0, 0xF8, | |
| 4794 | + 0x7C, 0x3E, 0x1F, 0x0F, 0x86, 0xE3, 0x31, 0x9F, 0xC7, 0xC0, 0xE0, 0xD8, | |
| 4795 | + 0x36, 0x1C, 0xC6, 0x31, 0x8C, 0x63, 0x30, 0x6C, 0x1B, 0x06, 0x80, 0xE0, | |
| 4796 | + 0x38, 0xC0, 0x78, 0x0B, 0x03, 0x32, 0x66, 0xEC, 0xD5, 0x9A, 0xB3, 0x56, | |
| 4797 | + 0x7B, 0xCF, 0x70, 0xC6, 0x18, 0xC0, 0xC3, 0xB1, 0x99, 0xC6, 0xC3, 0x40, | |
| 4798 | + 0xE0, 0x70, 0x7C, 0x36, 0x33, 0xB8, 0xD8, 0x30, 0xE0, 0xD8, 0x73, 0x18, | |
| 4799 | + 0xC6, 0x1B, 0x06, 0xC0, 0xE0, 0x38, 0x0C, 0x03, 0x00, 0xC0, 0x30, 0x7F, | |
| 4800 | + 0xBF, 0xC0, 0xC0, 0xC0, 0xE0, 0x60, 0x60, 0x60, 0x30, 0x30, 0x3F, 0xFF, | |
| 4801 | + 0xF0, 0xFF, 0xE1, 0x08, 0x42, 0x10, 0x84, 0x21, 0x08, 0x43, 0xFF, 0xC1, | |
| 4802 | + 0x83, 0x03, 0x06, 0x04, 0x0C, 0x18, 0x10, 0x30, 0x60, 0x60, 0xC0, 0x81, | |
| 4803 | + 0x83, 0xFF, 0xC6, 0x31, 0x8C, 0x63, 0x18, 0xC6, 0x31, 0x8F, 0xFF, 0x30, | |
| 4804 | + 0x70, 0xA3, 0x64, 0xD8, 0xB1, 0x80, 0xFF, 0xFF, 0xC0, 0xC6, 0x30, 0x3E, | |
| 4805 | + 0x7F, 0x43, 0x1F, 0x7F, 0xE3, 0xC3, 0x7F, 0x79, 0xE0, 0x70, 0x38, 0x1C, | |
| 4806 | + 0x0F, 0xE7, 0xFB, 0x8F, 0xC3, 0xE1, 0xF0, 0xF8, 0xDF, 0xED, 0xE0, 0x1E, | |
| 4807 | + 0x3F, 0xDC, 0x5C, 0x0C, 0x07, 0x01, 0xC4, 0xFF, 0x1E, 0x00, 0x03, 0x03, | |
| 4808 | + 0x03, 0x03, 0x3F, 0x7F, 0xE3, 0xC3, 0xC3, 0xC3, 0xE3, 0x7F, 0x39, 0x1E, | |
| 4809 | + 0x3F, 0x98, 0x7F, 0xFF, 0xFE, 0x01, 0x84, 0xFE, 0x1E, 0x00, 0x0F, 0x1F, | |
| 4810 | + 0x38, 0x30, 0xFF, 0xFF, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x3F, | |
| 4811 | + 0xBF, 0xD8, 0x8C, 0x67, 0xE3, 0xE1, 0x00, 0xFE, 0x7F, 0xE0, 0xFF, 0xEF, | |
| 4812 | + 0xC0, 0xE0, 0x70, 0x38, 0x1C, 0x0C, 0xE7, 0xFB, 0xCD, 0xC7, 0xE3, 0xF1, | |
| 4813 | + 0xF8, 0xFC, 0x7E, 0x38, 0x18, 0x71, 0x80, 0x03, 0xEF, 0x86, 0x18, 0x61, | |
| 4814 | + 0x86, 0x18, 0x60, 0x0C, 0x1C, 0x30, 0x00, 0x0F, 0x9F, 0x06, 0x0C, 0x18, | |
| 4815 | + 0x30, 0x60, 0xC1, 0x83, 0x7E, 0xF8, 0xC0, 0xC0, 0xC0, 0xC0, 0xC7, 0xCE, | |
| 4816 | + 0xDC, 0xF8, 0xF8, 0xEC, 0xCE, 0xC6, 0xC3, 0xF8, 0x7C, 0x06, 0x03, 0x01, | |
| 4817 | + 0x80, 0xC0, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x03, 0xE0, 0xF8, 0xFB, 0x7F, | |
| 4818 | + 0xF3, 0x79, 0x3C, 0x9E, 0x4F, 0x27, 0x93, 0xC9, 0x80, 0xCE, 0x7F, 0xBC, | |
| 4819 | + 0xDC, 0x7E, 0x3F, 0x1F, 0x8F, 0xC7, 0xE3, 0x80, 0x3E, 0x3F, 0xB8, 0xD8, | |
| 4820 | + 0x3C, 0x1E, 0x0F, 0x8C, 0xFE, 0x3E, 0x00, 0xDE, 0x7F, 0xB8, 0xFC, 0x3E, | |
| 4821 | + 0x1F, 0x0F, 0x8D, 0xFE, 0xFE, 0x70, 0x38, 0x1C, 0x00, 0x3D, 0x7F, 0xE3, | |
| 4822 | + 0xC3, 0xC3, 0xC3, 0xE3, 0x7F, 0x3B, 0x03, 0x03, 0x03, 0xCF, 0xDF, 0xF0, | |
| 4823 | + 0xE0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x3E, 0x3F, 0x98, 0x4E, 0x03, 0xE0, | |
| 4824 | + 0x39, 0x07, 0xFE, 0x3E, 0x00, 0x10, 0x08, 0x3F, 0xFF, 0xF3, 0x01, 0x80, | |
| 4825 | + 0xC0, 0x70, 0x18, 0x0F, 0xC3, 0xE0, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, | |
| 4826 | + 0xE7, 0x7F, 0x79, 0xC1, 0xE0, 0x98, 0xCC, 0x67, 0x61, 0xB0, 0xD8, 0x38, | |
| 4827 | + 0x1C, 0x00, 0xC4, 0x79, 0xC9, 0xBB, 0x35, 0x66, 0xAC, 0xD5, 0x9E, 0xB1, | |
| 4828 | + 0xDC, 0x31, 0x80, 0xE3, 0xB1, 0x8D, 0x83, 0x81, 0xC1, 0xE0, 0xD8, 0xC6, | |
| 4829 | + 0xC3, 0x80, 0xC1, 0xE0, 0x98, 0xCC, 0x63, 0x21, 0xB0, 0x50, 0x38, 0x1C, | |
| 4830 | + 0x0C, 0x3E, 0x1C, 0x00, 0x7F, 0xBF, 0x81, 0x81, 0xC1, 0xC1, 0xC1, 0xC1, | |
| 4831 | + 0xFF, 0xFF, 0x80, 0x1E, 0x3C, 0xC1, 0x81, 0x02, 0x0C, 0x78, 0xF0, 0x60, | |
| 4832 | + 0x40, 0x83, 0x06, 0x07, 0x8F, 0xFF, 0xFF, 0xC0, 0xF1, 0xE0, 0x40, 0x81, | |
| 4833 | + 0x02, 0x06, 0x0F, 0x1E, 0x30, 0x40, 0x81, 0x02, 0x3C, 0x78, 0x79, 0xBF, | |
| 4834 | + 0xB3, 0x80 }; | |
| 4835 | + | |
| 4836 | +const GFXglyph SourceCodePro_SemiBold9pt7bGlyphs[] PROGMEM = { | |
| 4837 | + { 0, 1, 1, 11, 0, 0 }, // 0x20 ' ' | |
| 4838 | + { 1, 3, 12, 11, 4, -11 }, // 0x21 '!' | |
| 4839 | + { 6, 7, 6, 11, 2, -11 }, // 0x22 '"' | |
| 4840 | + { 12, 8, 11, 11, 1, -10 }, // 0x23 '#' | |
| 4841 | + { 23, 8, 15, 11, 1, -12 }, // 0x24 '$' | |
| 4842 | + { 38, 10, 12, 11, 0, -11 }, // 0x25 '%' | |
| 4843 | + { 53, 9, 12, 11, 1, -11 }, // 0x26 '&' | |
| 4844 | + { 67, 3, 6, 11, 4, -11 }, // 0x27 ''' | |
| 4845 | + { 70, 6, 16, 11, 3, -12 }, // 0x28 '(' | |
| 4846 | + { 82, 5, 16, 11, 2, -12 }, // 0x29 ')' | |
| 4847 | + { 92, 7, 8, 11, 2, -12 }, // 0x2A '*' | |
| 4848 | + { 99, 8, 8, 11, 1, -9 }, // 0x2B '+' | |
| 4849 | + { 107, 4, 7, 11, 3, -2 }, // 0x2C ',' | |
| 4850 | + { 111, 6, 2, 11, 2, -5 }, // 0x2D '-' | |
| 4851 | + { 113, 3, 4, 11, 4, -3 }, // 0x2E '.' | |
| 4852 | + { 115, 7, 16, 11, 2, -12 }, // 0x2F '/' | |
| 4853 | + { 129, 9, 11, 11, 1, -10 }, // 0x30 '0' | |
| 4854 | + { 142, 8, 11, 11, 2, -10 }, // 0x31 '1' | |
| 4855 | + { 153, 9, 11, 11, 1, -10 }, // 0x32 '2' | |
| 4856 | + { 166, 8, 11, 11, 1, -10 }, // 0x33 '3' | |
| 4857 | + { 177, 9, 11, 11, 1, -10 }, // 0x34 '4' | |
| 4858 | + { 190, 8, 11, 11, 1, -10 }, // 0x35 '5' | |
| 4859 | + { 201, 9, 11, 11, 1, -10 }, // 0x36 '6' | |
| 4860 | + { 214, 9, 11, 11, 1, -10 }, // 0x37 '7' | |
| 4861 | + { 227, 9, 11, 11, 1, -10 }, // 0x38 '8' | |
| 4862 | + { 240, 9, 11, 11, 1, -10 }, // 0x39 '9' | |
| 4863 | + { 253, 3, 10, 11, 4, -9 }, // 0x3A ':' | |
| 4864 | + { 257, 4, 14, 11, 3, -9 }, // 0x3B ';' | |
| 4865 | + { 264, 7, 12, 11, 2, -11 }, // 0x3C '<' | |
| 4866 | + { 275, 8, 6, 11, 1, -8 }, // 0x3D '=' | |
| 4867 | + { 281, 7, 12, 11, 2, -11 }, // 0x3E '>' | |
| 4868 | + { 292, 7, 12, 11, 2, -11 }, // 0x3F '?' | |
| 4869 | + { 303, 9, 15, 11, 1, -11 }, // 0x40 '@' | |
| 4870 | + { 320, 10, 12, 11, 0, -11 }, // 0x41 'A' | |
| 4871 | + { 335, 8, 12, 11, 2, -11 }, // 0x42 'B' | |
| 4872 | + { 347, 9, 12, 11, 1, -11 }, // 0x43 'C' | |
| 4873 | + { 361, 9, 12, 11, 1, -11 }, // 0x44 'D' | |
| 4874 | + { 375, 8, 12, 11, 2, -11 }, // 0x45 'E' | |
| 4875 | + { 387, 8, 12, 11, 2, -11 }, // 0x46 'F' | |
| 4876 | + { 399, 9, 12, 11, 1, -11 }, // 0x47 'G' | |
| 4877 | + { 413, 9, 12, 11, 1, -11 }, // 0x48 'H' | |
| 4878 | + { 427, 7, 12, 11, 2, -11 }, // 0x49 'I' | |
| 4879 | + { 438, 8, 12, 11, 1, -11 }, // 0x4A 'J' | |
| 4880 | + { 450, 10, 12, 11, 1, -11 }, // 0x4B 'K' | |
| 4881 | + { 465, 8, 12, 11, 2, -11 }, // 0x4C 'L' | |
| 4882 | + { 477, 8, 12, 11, 1, -11 }, // 0x4D 'M' | |
| 4883 | + { 489, 8, 12, 11, 1, -11 }, // 0x4E 'N' | |
| 4884 | + { 501, 9, 12, 11, 1, -11 }, // 0x4F 'O' | |
| 4885 | + { 515, 8, 12, 11, 2, -11 }, // 0x50 'P' | |
| 4886 | + { 527, 9, 15, 11, 1, -11 }, // 0x51 'Q' | |
| 4887 | + { 544, 8, 12, 11, 2, -11 }, // 0x52 'R' | |
| 4888 | + { 556, 9, 12, 11, 1, -11 }, // 0x53 'S' | |
| 4889 | + { 570, 9, 12, 11, 1, -11 }, // 0x54 'T' | |
| 4890 | + { 584, 9, 12, 11, 1, -11 }, // 0x55 'U' | |
| 4891 | + { 598, 10, 12, 11, 0, -11 }, // 0x56 'V' | |
| 4892 | + { 613, 11, 12, 11, 0, -11 }, // 0x57 'W' | |
| 4893 | + { 630, 9, 12, 11, 1, -11 }, // 0x58 'X' | |
| 4894 | + { 644, 10, 12, 11, 0, -11 }, // 0x59 'Y' | |
| 4895 | + { 659, 9, 12, 11, 1, -11 }, // 0x5A 'Z' | |
| 4896 | + { 673, 5, 16, 11, 4, -12 }, // 0x5B '[' | |
| 4897 | + { 683, 7, 16, 11, 2, -12 }, // 0x5C '\' | |
| 4898 | + { 697, 5, 16, 11, 2, -12 }, // 0x5D ']' | |
| 4899 | + { 707, 7, 7, 11, 2, -11 }, // 0x5E '^' | |
| 4900 | + { 714, 9, 2, 11, 1, 2 }, // 0x5F '_' | |
| 4901 | + { 717, 4, 3, 11, 3, -12 }, // 0x60 '`' | |
| 4902 | + { 719, 8, 9, 11, 1, -8 }, // 0x61 'a' | |
| 4903 | + { 728, 9, 13, 11, 1, -12 }, // 0x62 'b' | |
| 4904 | + { 743, 9, 9, 11, 1, -8 }, // 0x63 'c' | |
| 4905 | + { 754, 8, 13, 11, 1, -12 }, // 0x64 'd' | |
| 4906 | + { 767, 9, 9, 11, 1, -8 }, // 0x65 'e' | |
| 4907 | + { 778, 8, 13, 11, 2, -12 }, // 0x66 'f' | |
| 4908 | + { 791, 9, 12, 11, 1, -8 }, // 0x67 'g' | |
| 4909 | + { 805, 9, 13, 11, 1, -12 }, // 0x68 'h' | |
| 4910 | + { 820, 6, 14, 11, 2, -13 }, // 0x69 'i' | |
| 4911 | + { 831, 7, 17, 11, 1, -13 }, // 0x6A 'j' | |
| 4912 | + { 846, 8, 13, 11, 2, -12 }, // 0x6B 'k' | |
| 4913 | + { 859, 9, 13, 11, 1, -12 }, // 0x6C 'l' | |
| 4914 | + { 874, 9, 9, 11, 1, -8 }, // 0x6D 'm' | |
| 4915 | + { 885, 9, 9, 11, 1, -8 }, // 0x6E 'n' | |
| 4916 | + { 896, 9, 9, 11, 1, -8 }, // 0x6F 'o' | |
| 4917 | + { 907, 9, 12, 11, 1, -8 }, // 0x70 'p' | |
| 4918 | + { 921, 8, 12, 11, 1, -8 }, // 0x71 'q' | |
| 4919 | + { 933, 8, 9, 11, 2, -8 }, // 0x72 'r' | |
| 4920 | + { 942, 9, 9, 11, 1, -8 }, // 0x73 's' | |
| 4921 | + { 953, 9, 11, 11, 1, -10 }, // 0x74 't' | |
| 4922 | + { 966, 8, 9, 11, 1, -8 }, // 0x75 'u' | |
| 4923 | + { 975, 9, 9, 11, 1, -8 }, // 0x76 'v' | |
| 4924 | + { 986, 11, 9, 11, 0, -8 }, // 0x77 'w' | |
| 4925 | + { 999, 9, 9, 11, 1, -8 }, // 0x78 'x' | |
| 4926 | + { 1010, 9, 12, 11, 1, -8 }, // 0x79 'y' | |
| 4927 | + { 1024, 9, 9, 11, 1, -8 }, // 0x7A 'z' | |
| 4928 | + { 1035, 7, 16, 11, 2, -12 }, // 0x7B '{' | |
| 4929 | + { 1049, 1, 18, 11, 5, -12 }, // 0x7C '|' | |
| 4930 | + { 1052, 7, 16, 11, 2, -12 }, // 0x7D '}' | |
| 4931 | + { 1066, 9, 3, 11, 1, -6 } }; // 0x7E '~' | |
| 4932 | + | |
| 4933 | +const GFXfont SourceCodePro_SemiBold9pt7b PROGMEM = { | |
| 4934 | + (uint8_t *)SourceCodePro_SemiBold9pt7bBitmaps, | |
| 4935 | + (GFXglyph *)SourceCodePro_SemiBold9pt7bGlyphs, | |
| 4936 | + 0x20, 0x7E, 22 }; | |
| 4937 | + | |
| 4938 | +// Approx. 1742 bytes | |
| 4939 | +const uint8_t Shree7149pt7bBitmaps[] PROGMEM = { | |
| 4940 | + 0x00, 0xFF, 0xEA, 0x80, 0xC0, 0x99, 0x99, 0x04, 0x20, 0x21, 0x01, 0x10, | |
| 4941 | + 0x77, 0xE0, 0x84, 0x04, 0x40, 0x42, 0x1F, 0xFE, 0x11, 0x01, 0x08, 0x08, | |
| 4942 | + 0x40, 0x04, 0x07, 0x82, 0x59, 0x13, 0x44, 0x51, 0x06, 0x40, 0xF0, 0x07, | |
| 4943 | + 0x01, 0x30, 0x45, 0x11, 0x44, 0x59, 0x21, 0xF0, 0x10, 0x04, 0x00, 0x00, | |
| 4944 | + 0x09, 0xE0, 0x44, 0x42, 0x20, 0x90, 0x82, 0x41, 0x12, 0x03, 0x90, 0x00, | |
| 4945 | + 0x80, 0x02, 0xF0, 0x12, 0x20, 0x90, 0x44, 0x42, 0x10, 0x88, 0x81, 0xC0, | |
| 4946 | + 0x00, 0x03, 0xC0, 0x84, 0x11, 0x01, 0x20, 0x28, 0x06, 0x01, 0x20, 0x42, | |
| 4947 | + 0x50, 0x2A, 0x05, 0x20, 0x44, 0x14, 0x7C, 0x40, 0xEA, 0x12, 0x44, 0x44, | |
| 4948 | + 0x88, 0x88, 0x84, 0x44, 0x21, 0x04, 0x22, 0x21, 0x11, 0x11, 0x12, 0x22, | |
| 4949 | + 0x40, 0x18, 0x18, 0xF3, 0x24, 0x24, 0x53, 0x18, 0x18, 0x08, 0x04, 0x02, | |
| 4950 | + 0x01, 0x0F, 0xF8, 0x40, 0x20, 0x10, 0x08, 0x00, 0xD4, 0x7E, 0xC0, 0x01, | |
| 4951 | + 0x01, 0x02, 0x02, 0x04, 0x04, 0x08, 0x08, 0x10, 0x10, 0x20, 0x20, 0x40, | |
| 4952 | + 0x40, 0x3E, 0x20, 0x90, 0x50, 0x28, 0x14, 0x06, 0x03, 0x01, 0x81, 0x40, | |
| 4953 | + 0x90, 0x48, 0x43, 0xC0, 0x11, 0xF1, 0x11, 0x11, 0x11, 0x11, 0x10, 0x3E, | |
| 4954 | + 0x41, 0x41, 0x01, 0x01, 0x01, 0x02, 0x0C, 0x30, 0x40, 0x40, 0x80, 0xFF, | |
| 4955 | + 0x7E, 0x20, 0xA0, 0x40, 0x20, 0x10, 0x10, 0x78, 0x02, 0x01, 0x40, 0x60, | |
| 4956 | + 0x48, 0x23, 0xE0, 0x06, 0x03, 0x02, 0x82, 0x41, 0x21, 0x11, 0x08, 0x84, | |
| 4957 | + 0x82, 0x7F, 0xC0, 0x80, 0x40, 0x20, 0x7E, 0x20, 0x10, 0x08, 0x04, 0x03, | |
| 4958 | + 0xF1, 0x04, 0x02, 0x00, 0x80, 0x60, 0x48, 0x23, 0xE0, 0x3E, 0x30, 0x90, | |
| 4959 | + 0x30, 0x08, 0x05, 0xF3, 0x05, 0x82, 0x80, 0xC0, 0x50, 0x48, 0x23, 0xE0, | |
| 4960 | + 0x7F, 0x02, 0x02, 0x04, 0x08, 0x08, 0x10, 0x10, 0x10, 0x10, 0x20, 0x20, | |
| 4961 | + 0x20, 0x3E, 0x20, 0x90, 0x48, 0x24, 0x11, 0xB0, 0xB8, 0x82, 0x81, 0x40, | |
| 4962 | + 0x60, 0x48, 0x23, 0xE0, 0x7E, 0x21, 0xA0, 0x50, 0x28, 0x14, 0x0D, 0x0A, | |
| 4963 | + 0x79, 0x01, 0x00, 0xA0, 0x48, 0x43, 0xC0, 0xF0, 0x00, 0x30, 0xF0, 0x00, | |
| 4964 | + 0x35, 0x00, 0x02, 0x18, 0xC2, 0x0C, 0x04, 0x06, 0x03, 0x00, 0xFF, 0x00, | |
| 4965 | + 0x00, 0x00, 0xFF, 0x00, 0x80, 0xC0, 0x60, 0x20, 0x43, 0x18, 0x41, 0x00, | |
| 4966 | + 0x18, 0x66, 0x41, 0x81, 0x01, 0x01, 0x02, 0x04, 0x08, 0x08, 0x00, 0x00, | |
| 4967 | + 0x00, 0x08, 0x07, 0xF8, 0x06, 0x01, 0x82, 0x00, 0x11, 0x00, 0x02, 0x40, | |
| 4968 | + 0x00, 0xA0, 0xFA, 0x18, 0x41, 0x86, 0x10, 0x21, 0x84, 0x08, 0x61, 0x02, | |
| 4969 | + 0x18, 0x40, 0x86, 0x08, 0x62, 0x41, 0x6C, 0x90, 0x20, 0xC2, 0x00, 0x00, | |
| 4970 | + 0x60, 0x08, 0x07, 0xFC, 0x00, 0x06, 0x00, 0x60, 0x09, 0x00, 0x90, 0x09, | |
| 4971 | + 0x01, 0x08, 0x10, 0x82, 0x04, 0x3F, 0xC2, 0x04, 0x40, 0x24, 0x02, 0x80, | |
| 4972 | + 0x10, 0xFF, 0xA0, 0x28, 0x06, 0x02, 0x80, 0xA0, 0x6F, 0xFA, 0x01, 0x80, | |
| 4973 | + 0x60, 0x18, 0x06, 0x02, 0xFF, 0x00, 0x06, 0x07, 0x31, 0x81, 0x20, 0x18, | |
| 4974 | + 0x01, 0x00, 0x20, 0x04, 0x00, 0x80, 0x10, 0x02, 0x00, 0xA0, 0x12, 0x04, | |
| 4975 | + 0x3F, 0x00, 0xFF, 0x10, 0x12, 0x01, 0x40, 0x28, 0x03, 0x00, 0x60, 0x0C, | |
| 4976 | + 0x01, 0x80, 0x50, 0x0A, 0x01, 0x40, 0x4F, 0xF0, 0xFF, 0xC0, 0x20, 0x10, | |
| 4977 | + 0x08, 0x04, 0x03, 0xFD, 0x00, 0x80, 0x40, 0x20, 0x10, 0x0F, 0xF8, 0xFF, | |
| 4978 | + 0xC0, 0x20, 0x10, 0x08, 0x04, 0x03, 0xFD, 0x00, 0x80, 0x40, 0x20, 0x10, | |
| 4979 | + 0x08, 0x00, 0x06, 0x03, 0x31, 0x81, 0x20, 0x18, 0x01, 0x00, 0x20, 0x04, | |
| 4980 | + 0x1F, 0x80, 0x30, 0x06, 0x00, 0xA0, 0x32, 0x06, 0x3F, 0x40, 0x80, 0x60, | |
| 4981 | + 0x18, 0x06, 0x01, 0x80, 0x60, 0x1F, 0xFE, 0x01, 0x80, 0x60, 0x18, 0x06, | |
| 4982 | + 0x01, 0x80, 0x40, 0xFF, 0xF8, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x81, | |
| 4983 | + 0x03, 0x06, 0x0A, 0x13, 0xC0, 0x80, 0xE0, 0x48, 0x22, 0x10, 0x88, 0x26, | |
| 4984 | + 0x0A, 0x83, 0x10, 0x82, 0x20, 0x48, 0x1A, 0x02, 0x80, 0x40, 0x80, 0x80, | |
| 4985 | + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xFF, 0xC0, | |
| 4986 | + 0x1D, 0x00, 0xE8, 0x0B, 0x40, 0x59, 0x02, 0xC8, 0x26, 0x21, 0x31, 0x11, | |
| 4987 | + 0x88, 0x8C, 0x24, 0x61, 0x43, 0x06, 0x18, 0x20, 0x80, 0xC0, 0x34, 0x06, | |
| 4988 | + 0x80, 0xC8, 0x18, 0x83, 0x10, 0x61, 0x0C, 0x11, 0x82, 0x30, 0x26, 0x02, | |
| 4989 | + 0xC0, 0x58, 0x06, 0x0E, 0x03, 0x18, 0x40, 0x44, 0x02, 0x80, 0x28, 0x02, | |
| 4990 | + 0x80, 0x28, 0x01, 0x80, 0x28, 0x02, 0x80, 0x24, 0x04, 0x20, 0xC1, 0xF0, | |
| 4991 | + 0xFF, 0x20, 0x28, 0x0A, 0x01, 0x80, 0xA0, 0x2F, 0xF2, 0x00, 0x80, 0x20, | |
| 4992 | + 0x08, 0x02, 0x00, 0x80, 0x00, 0x06, 0x07, 0x31, 0x81, 0x20, 0x28, 0x03, | |
| 4993 | + 0x00, 0x60, 0x0C, 0x01, 0x80, 0x30, 0x06, 0x00, 0xA0, 0xB2, 0x0C, 0x37, | |
| 4994 | + 0xC1, 0x08, 0xFF, 0xA0, 0x18, 0x06, 0x01, 0x80, 0x60, 0x2F, 0xF2, 0x02, | |
| 4995 | + 0x80, 0x60, 0x18, 0x06, 0x01, 0x80, 0x40, 0x18, 0x33, 0xA0, 0x50, 0x18, | |
| 4996 | + 0x04, 0x01, 0x80, 0x3C, 0x01, 0x00, 0x60, 0x30, 0x1C, 0x13, 0xF0, 0xFF, | |
| 4997 | + 0xC1, 0x00, 0x40, 0x10, 0x04, 0x01, 0x00, 0x40, 0x10, 0x04, 0x01, 0x00, | |
| 4998 | + 0x40, 0x10, 0x04, 0x00, 0x80, 0x60, 0x18, 0x06, 0x01, 0x80, 0x60, 0x18, | |
| 4999 | + 0x06, 0x01, 0x80, 0x60, 0x14, 0x05, 0x02, 0x3F, 0x00, 0xC0, 0x48, 0x09, | |
1895 more lines aren’t shown here.
| @@ -0,0 +1,56 @@ | ||
| 1 | +/** | |
| 2 | + ****************************************************************************** | |
| 3 | + * File Name : DEBUG.h | |
| 4 | + * Description : This file provides code for the configuration | |
| 5 | + * of the DEBUG instances. | |
| 6 | + ****************************************************************************** | |
| 7 | + * @attention | |
| 8 | + * | |
| 9 | + * <h2><center>© Copyright (c) 2020 STMicroelectronics. | |
| 10 | + * All rights reserved.</center></h2> | |
| 11 | + * | |
| 12 | + * This software component is licensed by ST under Ultimate Liberty license | |
| 13 | + * SLA0044, the "License"; You may not use this file except in compliance with | |
| 14 | + * the License. You may obtain a copy of the License at: | |
| 15 | + * www.st.com/SLA0044 | |
| 16 | + * | |
| 17 | + ****************************************************************************** | |
| 18 | + */ | |
| 19 | +/* Define to prevent recursive inclusion -------------------------------------*/ | |
| 20 | +#ifndef __debug_H | |
| 21 | +#define __debug_H | |
| 22 | +#ifdef __cplusplus | |
| 23 | + extern "C" { | |
| 24 | +#endif | |
| 25 | + | |
| 26 | +/* Includes ------------------------------------------------------------------*/ | |
| 27 | +#include "main.h" | |
| 28 | + | |
| 29 | +/* USER CODE BEGIN Includes */ | |
| 30 | + | |
| 31 | +/* USER CODE END Includes */ | |
| 32 | + | |
| 33 | +/* USER CODE BEGIN Private defines */ | |
| 34 | + | |
| 35 | +/* USER CODE END Private defines */ | |
| 36 | + | |
| 37 | +void MX_DEBUG_Init(void); | |
| 38 | + | |
| 39 | +/* USER CODE BEGIN Prototypes */ | |
| 40 | + | |
| 41 | +/* USER CODE END Prototypes */ | |
| 42 | + | |
| 43 | +#ifdef __cplusplus | |
| 44 | +} | |
| 45 | +#endif | |
| 46 | +#endif /*__ debug_H */ | |
| 47 | + | |
| 48 | +/** | |
| 49 | + * @} | |
| 50 | + */ | |
| 51 | + | |
| 52 | +/** | |
| 53 | + * @} | |
| 54 | + */ | |
| 55 | + | |
| 56 | +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |
| @@ -0,0 +1,56 @@ | ||
| 1 | +/** | |
| 2 | + ****************************************************************************** | |
| 3 | + * File Name : dma.h | |
| 4 | + * Description : This file contains all the function prototypes for | |
| 5 | + * the dma.c file | |
| 6 | + ****************************************************************************** | |
| 7 | + * @attention | |
| 8 | + * | |
| 9 | + * <h2><center>© Copyright (c) 2020 STMicroelectronics. | |
| 10 | + * All rights reserved.</center></h2> | |
| 11 | + * | |
| 12 | + * This software component is licensed by ST under Ultimate Liberty license | |
| 13 | + * SLA0044, the "License"; You may not use this file except in compliance with | |
| 14 | + * the License. You may obtain a copy of the License at: | |
| 15 | + * www.st.com/SLA0044 | |
| 16 | + * | |
| 17 | + ****************************************************************************** | |
| 18 | + */ | |
| 19 | +/* Define to prevent recursive inclusion -------------------------------------*/ | |
| 20 | +#ifndef __dma_H | |
| 21 | +#define __dma_H | |
| 22 | + | |
| 23 | +#ifdef __cplusplus | |
| 24 | + extern "C" { | |
| 25 | +#endif | |
| 26 | + | |
| 27 | +/* Includes ------------------------------------------------------------------*/ | |
| 28 | +#include "main.h" | |
| 29 | + | |
| 30 | +/* DMA memory to memory transfer handles -------------------------------------*/ | |
| 31 | + | |
| 32 | +/* USER CODE BEGIN Includes */ | |
| 33 | + | |
| 34 | +/* USER CODE END Includes */ | |
| 35 | + | |
| 36 | +/* USER CODE BEGIN Private defines */ | |
| 37 | + | |
| 38 | +/* USER CODE END Private defines */ | |
| 39 | + | |
| 40 | +void MX_DMA_Init(void); | |
| 41 | + | |
| 42 | +/* USER CODE BEGIN Prototypes */ | |
| 43 | + | |
| 44 | +/* USER CODE END Prototypes */ | |
| 45 | + | |
| 46 | +#ifdef __cplusplus | |
| 47 | +} | |
| 48 | +#endif | |
| 49 | + | |
| 50 | +#endif /* __dma_H */ | |
| 51 | + | |
| 52 | +/** | |
| 53 | + * @} | |
| 54 | + */ | |
| 55 | + | |
| 56 | +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |
| @@ -0,0 +1,125 @@ | ||
| 1 | + | |
| 2 | + | |
| 3 | +/** | |
| 4 | + ****************************************************************************** | |
| 5 | + * @file EEPROM_Emulation/inc/eeprom.h | |
| 6 | + * @author MCD Application Team | |
| 7 | + * @brief This file contains all the functions prototypes for the EEPROM | |
| 8 | + * emulation firmware library. | |
| 9 | + ****************************************************************************** | |
| 10 | + * @attention | |
| 11 | + * | |
| 12 | + * <h2><center>© Copyright (c) 2017 STMicroelectronics. | |
| 13 | + * All rights reserved.</center></h2> | |
| 14 | + * | |
| 15 | + * This software component is licensed by ST under Ultimate Liberty license | |
| 16 | + * SLA0044, the "License"; You may not use this file except in compliance with | |
| 17 | + * the License. You may obtain a copy of the License at: | |
| 18 | + * www.st.com/SLA0044 | |
| 19 | + * | |
| 20 | + ****************************************************************************** | |
| 21 | + */ | |
| 22 | + | |
| 23 | +/* Define to prevent recursive inclusion -------------------------------------*/ | |
| 24 | +#ifndef __EEPROM_H | |
| 25 | +#define __EEPROM_H | |
| 26 | + | |
| 27 | +/* Includes ------------------------------------------------------------------*/ | |
| 28 | +#include "stm32h7xx_hal.h" | |
| 29 | +#include "main.h" | |
| 30 | + | |
| 31 | +/* Exported constants --------------------------------------------------------*/ | |
| 32 | +/* EEPROM emulation firmware error codes */ | |
| 33 | +#define EE_OK (uint32_t)HAL_OK | |
| 34 | +#define EE_ERROR (uint32_t)HAL_ERROR | |
| 35 | +#define EE_BUSY (uint32_t)HAL_BUSY | |
| 36 | +#define EE_TIMEOUT (uint32_t)HAL_TIMEOUT | |
| 37 | + | |
| 38 | + | |
| 39 | +#define FLASH_BASE_ADDR (uint32_t)(FLASH_BASE) | |
| 40 | +#define FLASH_END_ADDR (uint32_t)(0x081FFFFF) | |
| 41 | + | |
| 42 | +/* Base address of the Flash sectors Bank 1 */ | |
| 43 | +#define ADDR_FLASH_SECTOR_0_BANK1 ((uint32_t)0x08000000) /* Base @ of Sector 0, 128 Kbytes */ | |
| 44 | +#define ADDR_FLASH_SECTOR_1_BANK1 ((uint32_t)0x08020000) /* Base @ of Sector 1, 128 Kbytes */ | |
| 45 | +#define ADDR_FLASH_SECTOR_2_BANK1 ((uint32_t)0x08040000) /* Base @ of Sector 2, 128 Kbytes */ | |
| 46 | +#define ADDR_FLASH_SECTOR_3_BANK1 ((uint32_t)0x08060000) /* Base @ of Sector 3, 128 Kbytes */ | |
| 47 | +#define ADDR_FLASH_SECTOR_4_BANK1 ((uint32_t)0x08080000) /* Base @ of Sector 4, 128 Kbytes */ | |
| 48 | +#define ADDR_FLASH_SECTOR_5_BANK1 ((uint32_t)0x080A0000) /* Base @ of Sector 5, 128 Kbytes */ | |
| 49 | +#define ADDR_FLASH_SECTOR_6_BANK1 ((uint32_t)0x080C0000) /* Base @ of Sector 6, 128 Kbytes */ | |
| 50 | +#define ADDR_FLASH_SECTOR_7_BANK1 ((uint32_t)0x080E0000) /* Base @ of Sector 7, 128 Kbytes */ | |
| 51 | + | |
| 52 | +/* Base address of the Flash sectors Bank 2 */ | |
| 53 | +#define ADDR_FLASH_SECTOR_0_BANK2 ((uint32_t)0x08100000) /* Base @ of Sector 0, 128 Kbytes */ | |
| 54 | +#define ADDR_FLASH_SECTOR_1_BANK2 ((uint32_t)0x08120000) /* Base @ of Sector 1, 128 Kbytes */ | |
| 55 | +#define ADDR_FLASH_SECTOR_2_BANK2 ((uint32_t)0x08140000) /* Base @ of Sector 2, 128 Kbytes */ | |
| 56 | +#define ADDR_FLASH_SECTOR_3_BANK2 ((uint32_t)0x08160000) /* Base @ of Sector 3, 128 Kbytes */ | |
| 57 | +#define ADDR_FLASH_SECTOR_4_BANK2 ((uint32_t)0x08180000) /* Base @ of Sector 4, 128 Kbytes */ | |
| 58 | +#define ADDR_FLASH_SECTOR_5_BANK2 ((uint32_t)0x081A0000) /* Base @ of Sector 5, 128 Kbytes */ | |
| 59 | +#define ADDR_FLASH_SECTOR_6_BANK2 ((uint32_t)0x081C0000) /* Base @ of Sector 6, 128 Kbytes */ | |
| 60 | +#define ADDR_FLASH_SECTOR_7_BANK2 ((uint32_t)0x081E0000) /* Base @ of Sector 7, 128 Kbytes */ | |
| 61 | + | |
| 62 | + | |
| 63 | +/* Define the size of the sectors to be used */ | |
| 64 | + | |
| 65 | + #define PAGE_SIZE (uint32_t)0x20000 /* Page size = 128KByte */ | |
| 66 | + | |
| 67 | + | |
| 68 | +/* Device voltage range supposed to be [2.7V to 3.6V], the operation will | |
| 69 | + be done by word */ | |
| 70 | +#define VOLTAGE_RANGE (uint8_t)VOLTAGE_RANGE_3 | |
| 71 | + | |
| 72 | +/* EEPROM emulation start address in Flash */ | |
| 73 | + | |
| 74 | + #define EEPROM_START_ADDRESS ADDR_FLASH_SECTOR_6_BANK2 /* sector6 of bank 2 */ | |
| 75 | + | |
| 76 | + | |
| 77 | +/* Pages 0 and 1 base and end addresses */ | |
| 78 | +#define PAGE0_BASE_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS + 0x0000)) | |
| 79 | +#define PAGE0_END_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS + (PAGE_SIZE - 1))) | |
| 80 | + | |
| 81 | + #define PAGE0_ID FLASH_SECTOR_6 | |
| 82 | + | |
| 83 | + | |
| 84 | +#define PAGE1_BASE_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS + PAGE_SIZE)) | |
| 85 | +#define PAGE1_END_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS + (2 * PAGE_SIZE - 1))) | |
| 86 | + | |
| 87 | + #define PAGE1_ID FLASH_SECTOR_7 | |
| 88 | + | |
| 89 | + | |
| 90 | +/* Used Flash pages for EEPROM emulation */ | |
| 91 | +#define PAGE0 ((uint16_t)0x0000) | |
| 92 | +#define PAGE1 ((uint16_t)0x0001) /* Page nb between PAGE0_BASE_ADDRESS & PAGE1_BASE_ADDRESS*/ | |
| 93 | + | |
| 94 | +/* No valid page define */ | |
| 95 | +#define NO_VALID_PAGE ((uint16_t)0x00AB) | |
| 96 | + | |
| 97 | +/* Page status definitions */ | |
| 98 | +#define ERASED ((uint16_t)0xFFFF) /* Page is empty */ | |
| 99 | +#define RECEIVE_DATA ((uint16_t)0xEEEE) /* Page is marked to receive data */ | |
| 100 | +#define VALID_PAGE ((uint16_t)0x0000) /* Page containing valid data */ | |
| 101 | + | |
| 102 | +/* Valid pages in read and write defines */ | |
| 103 | +#define READ_FROM_VALID_PAGE ((uint8_t)0x00) | |
| 104 | +#define WRITE_IN_VALID_PAGE ((uint8_t)0x01) | |
| 105 | + | |
| 106 | +/* Page full define */ | |
| 107 | +#define PAGE_FULL ((uint8_t)0x80) | |
| 108 | + | |
| 109 | +/* Variables' number */ | |
| 110 | +#define NB_OF_VAR ((uint8_t)0x03) | |
| 111 | + | |
| 112 | +/* Exported types ------------------------------------------------------------*/ | |
| 113 | +/* Exported macro ------------------------------------------------------------*/ | |
| 114 | +/* Exported functions ------------------------------------------------------- */ | |
| 115 | + | |
| 116 | +/* Virtual address defined by the user: 0xFFFF value is prohibited */ | |
| 117 | +extern uint16_t VirtAddVarTab[NB_OF_VAR]; | |
| 118 | +uint16_t EE_Init(void); | |
| 119 | +uint16_t EE_ReadVariable(uint16_t VirtAddress, uint16_t* Data); | |
| 120 | +uint16_t EE_WriteVariable(uint16_t VirtAddress, uint16_t Data); | |
| 121 | + | |
| 122 | +#endif /* __EEPROM_H */ | |
| 123 | + | |
| 124 | +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |
| 125 | + | |
| @@ -0,0 +1,49 @@ | ||
| 1 | +/** | |
| 2 | + ****************************************************************************** | |
| 3 | + * @file fatfs.h | |
| 4 | + * @brief Header for fatfs applications | |
| 5 | + ****************************************************************************** | |
| 6 | + * @attention | |
| 7 | + * | |
| 8 | + * <h2><center>© Copyright (c) 2020 STMicroelectronics. | |
| 9 | + * All rights reserved.</center></h2> | |
| 10 | + * | |
| 11 | + * This software component is licensed by ST under Ultimate Liberty license | |
| 12 | + * SLA0044, the "License"; You may not use this file except in compliance with | |
| 13 | + * the License. You may obtain a copy of the License at: | |
| 14 | + * www.st.com/SLA0044 | |
| 15 | + * | |
| 16 | + ****************************************************************************** | |
| 17 | + */ | |
| 18 | + | |
| 19 | +/* Define to prevent recursive inclusion -------------------------------------*/ | |
| 20 | +#ifndef __fatfs_H | |
| 21 | +#define __fatfs_H | |
| 22 | +#ifdef __cplusplus | |
| 23 | + extern "C" { | |
| 24 | +#endif | |
| 25 | + | |
| 26 | +#include "ff.h" | |
| 27 | +#include "ff_gen_drv.h" | |
| 28 | +#include "sd_diskio.h" /* defines SD_Driver as external */ | |
| 29 | + | |
| 30 | +/* USER CODE BEGIN Includes */ | |
| 31 | + | |
| 32 | +/* USER CODE END Includes */ | |
| 33 | + | |
| 34 | +extern uint8_t retSD; /* Return value for SD */ | |
| 35 | +extern char SDPath[4]; /* SD logical drive path */ | |
| 36 | +extern FATFS SDFatFS; /* File system object for SD logical drive */ | |
| 37 | +extern FIL SDFile; /* File object for SD */ | |
| 38 | + | |
| 39 | +void MX_FATFS_Init(void); | |
| 40 | + | |
| 41 | +/* USER CODE BEGIN Prototypes */ | |
| 42 | + | |
| 43 | +/* USER CODE END Prototypes */ | |
| 44 | +#ifdef __cplusplus | |
| 45 | +} | |
| 46 | +#endif | |
| 47 | +#endif /*__fatfs_H */ | |
| 48 | + | |
| 49 | +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |
| @@ -0,0 +1,26 @@ | ||
| 1 | +/** | |
| 2 | + ****************************************************************************** | |
| 3 | + * @file : fatfs_platform.h | |
| 4 | + * @brief : fatfs_platform header file | |
| 5 | + ****************************************************************************** | |
| 6 | + * @attention | |
| 7 | + * | |
| 8 | + * <h2><center>© Copyright (c) 2020 STMicroelectronics. | |
| 9 | + * All rights reserved.</center></h2> | |
| 10 | + * | |
| 11 | + * This software component is licensed by ST under Ultimate Liberty license | |
| 12 | + * SLA0044, the "License"; You may not use this file except in compliance with | |
| 13 | + * the License. You may obtain a copy of the License at: | |
| 14 | + * www.st.com/SLA0044 | |
| 15 | + * | |
| 16 | + ****************************************************************************** | |
| 17 | +*/ | |
| 18 | +/* Includes ------------------------------------------------------------------*/ | |
| 19 | +#include "stm32h7xx_hal.h" | |
| 20 | +/* Defines ------------------------------------------------------------------*/ | |
| 21 | +#define SD_PRESENT ((uint8_t)0x01) /* also in bsp_driver_sd.h */ | |
| 22 | +#define SD_NOT_PRESENT ((uint8_t)0x00) /* also in bsp_driver_sd.h */ | |
| 23 | +#define SD_DETECT_PIN GPIO_PIN_13 | |
| 24 | +#define SD_DETECT_GPIO_PORT GPIOC | |
| 25 | +/* Prototypes ---------------------------------------------------------------*/ | |
| 26 | +uint8_t BSP_PlatformIsDetected(void); | |
| @@ -0,0 +1,269 @@ | ||
| 1 | +/* USER CODE BEGIN Header */ | |
| 2 | +/** | |
| 3 | + ****************************************************************************** | |
| 4 | + * FatFs - Generic FAT file system module R0.12c (C)ChaN, 2017 | |
| 5 | + ****************************************************************************** | |
| 6 | + * @attention | |
| 7 | + * | |
| 8 | + * <h2><center>© Copyright (c) 2019 STMicroelectronics. | |
| 9 | + * All rights reserved.</center></h2> | |
| 10 | + * | |
| 11 | + * This software component is licensed by ST under Ultimate Liberty license | |
| 12 | + * SLA0044, the "License"; You may not use this file except in compliance with | |
| 13 | + * the License. You may obtain a copy of the License at: | |
| 14 | + * www.st.com/SLA0044 | |
| 15 | + * | |
| 16 | + ****************************************************************************** | |
| 17 | + */ | |
| 18 | +/* USER CODE END Header */ | |
| 19 | + | |
| 20 | +#ifndef _FFCONF | |
| 21 | +#define _FFCONF 68300 /* Revision ID */ | |
| 22 | + | |
| 23 | +/*-----------------------------------------------------------------------------/ | |
| 24 | +/ Additional user header to be used | |
| 25 | +/-----------------------------------------------------------------------------*/ | |
| 26 | +#include "main.h" | |
| 27 | +#include "stm32h7xx_hal.h" | |
| 28 | +#include "bsp_driver_sd.h" | |
| 29 | + | |
| 30 | +/*-----------------------------------------------------------------------------/ | |
| 31 | +/ Function Configurations | |
| 32 | +/-----------------------------------------------------------------------------*/ | |
| 33 | + | |
| 34 | +#define _FS_READONLY 0 /* 0:Read/Write or 1:Read only */ | |
| 35 | +/* This option switches read-only configuration. (0:Read/Write or 1:Read-only) | |
| 36 | +/ Read-only configuration removes writing API functions, f_write(), f_sync(), | |
| 37 | +/ f_unlink(), f_mkdir(), f_chmod(), f_rename(), f_truncate(), f_getfree() | |
| 38 | +/ and optional writing functions as well. */ | |
| 39 | + | |
| 40 | +#define _FS_MINIMIZE 0 /* 0 to 3 */ | |
| 41 | +/* This option defines minimization level to remove some basic API functions. | |
| 42 | +/ | |
| 43 | +/ 0: All basic functions are enabled. | |
| 44 | +/ 1: f_stat(), f_getfree(), f_unlink(), f_mkdir(), f_truncate() and f_rename() | |
| 45 | +/ are removed. | |
| 46 | +/ 2: f_opendir(), f_readdir() and f_closedir() are removed in addition to 1. | |
| 47 | +/ 3: f_lseek() function is removed in addition to 2. */ | |
| 48 | + | |
| 49 | +#define _USE_STRFUNC 2 /* 0:Disable or 1-2:Enable */ | |
| 50 | +/* This option switches string functions, f_gets(), f_putc(), f_puts() and | |
| 51 | +/ f_printf(). | |
| 52 | +/ | |
| 53 | +/ 0: Disable string functions. | |
| 54 | +/ 1: Enable without LF-CRLF conversion. | |
| 55 | +/ 2: Enable with LF-CRLF conversion. */ | |
| 56 | + | |
| 57 | +#define _USE_FIND 0 | |
| 58 | +/* This option switches filtered directory read functions, f_findfirst() and | |
| 59 | +/ f_findnext(). (0:Disable, 1:Enable 2:Enable with matching altname[] too) */ | |
| 60 | + | |
| 61 | +#define _USE_MKFS 1 | |
| 62 | +/* This option switches f_mkfs() function. (0:Disable or 1:Enable) */ | |
| 63 | + | |
| 64 | +#define _USE_FASTSEEK 1 | |
| 65 | +/* This option switches fast seek feature. (0:Disable or 1:Enable) */ | |
| 66 | + | |
| 67 | +#define _USE_EXPAND 0 | |
| 68 | +/* This option switches f_expand function. (0:Disable or 1:Enable) */ | |
| 69 | + | |
| 70 | +#define _USE_CHMOD 0 | |
| 71 | +/* This option switches attribute manipulation functions, f_chmod() and f_utime(). | |
| 72 | +/ (0:Disable or 1:Enable) Also _FS_READONLY needs to be 0 to enable this option. */ | |
| 73 | + | |
| 74 | +#define _USE_LABEL 0 | |
| 75 | +/* This option switches volume label functions, f_getlabel() and f_setlabel(). | |
| 76 | +/ (0:Disable or 1:Enable) */ | |
| 77 | + | |
| 78 | +#define _USE_FORWARD 0 | |
| 79 | +/* This option switches f_forward() function. (0:Disable or 1:Enable) */ | |
| 80 | + | |
| 81 | +/*-----------------------------------------------------------------------------/ | |
| 82 | +/ Locale and Namespace Configurations | |
| 83 | +/-----------------------------------------------------------------------------*/ | |
| 84 | + | |
| 85 | +#define _CODE_PAGE 850 | |
| 86 | +/* This option specifies the OEM code page to be used on the target system. | |
| 87 | +/ Incorrect setting of the code page can cause a file open failure. | |
| 88 | +/ | |
| 89 | +/ 1 - ASCII (No extended character. Non-LFN cfg. only) | |
| 90 | +/ 437 - U.S. | |
| 91 | +/ 720 - Arabic | |
| 92 | +/ 737 - Greek | |
| 93 | +/ 771 - KBL | |
| 94 | +/ 775 - Baltic | |
| 95 | +/ 850 - Latin 1 | |
| 96 | +/ 852 - Latin 2 | |
| 97 | +/ 855 - Cyrillic | |
| 98 | +/ 857 - Turkish | |
| 99 | +/ 860 - Portuguese | |
| 100 | +/ 861 - Icelandic | |
| 101 | +/ 862 - Hebrew | |
| 102 | +/ 863 - Canadian French | |
| 103 | +/ 864 - Arabic | |
| 104 | +/ 865 - Nordic | |
| 105 | +/ 866 - Russian | |
| 106 | +/ 869 - Greek 2 | |
| 107 | +/ 932 - Japanese (DBCS) | |
| 108 | +/ 936 - Simplified Chinese (DBCS) | |
| 109 | +/ 949 - Korean (DBCS) | |
| 110 | +/ 950 - Traditional Chinese (DBCS) | |
| 111 | +*/ | |
| 112 | + | |
| 113 | +#define _USE_LFN 0 /* 0 to 3 */ | |
| 114 | +#define _MAX_LFN 255 /* Maximum LFN length to handle (12 to 255) */ | |
| 115 | +/* The _USE_LFN switches the support of long file name (LFN). | |
| 116 | +/ | |
| 117 | +/ 0: Disable support of LFN. _MAX_LFN has no effect. | |
| 118 | +/ 1: Enable LFN with static working buffer on the BSS. Always NOT thread-safe. | |
| 119 | +/ 2: Enable LFN with dynamic working buffer on the STACK. | |
| 120 | +/ 3: Enable LFN with dynamic working buffer on the HEAP. | |
| 121 | +/ | |
| 122 | +/ To enable the LFN, Unicode handling functions (option/unicode.c) must be added | |
| 123 | +/ to the project. The working buffer occupies (_MAX_LFN + 1) * 2 bytes and | |
| 124 | +/ additional 608 bytes at exFAT enabled. _MAX_LFN can be in range from 12 to 255. | |
| 125 | +/ It should be set 255 to support full featured LFN operations. | |
| 126 | +/ When use stack for the working buffer, take care on stack overflow. When use heap | |
| 127 | +/ memory for the working buffer, memory management functions, ff_memalloc() and | |
| 128 | +/ ff_memfree(), must be added to the project. */ | |
| 129 | + | |
| 130 | +#define _LFN_UNICODE 0 /* 0:ANSI/OEM or 1:Unicode */ | |
| 131 | +/* This option switches character encoding on the API. (0:ANSI/OEM or 1:UTF-16) | |
| 132 | +/ To use Unicode string for the path name, enable LFN and set _LFN_UNICODE = 1. | |
| 133 | +/ This option also affects behavior of string I/O functions. */ | |
| 134 | + | |
| 135 | +#define _STRF_ENCODE 3 | |
| 136 | +/* When _LFN_UNICODE == 1, this option selects the character encoding ON THE FILE to | |
| 137 | +/ be read/written via string I/O functions, f_gets(), f_putc(), f_puts and f_printf(). | |
| 138 | +/ | |
| 139 | +/ 0: ANSI/OEM | |
| 140 | +/ 1: UTF-16LE | |
| 141 | +/ 2: UTF-16BE | |
| 142 | +/ 3: UTF-8 | |
| 143 | +/ | |
| 144 | +/ This option has no effect when _LFN_UNICODE == 0. */ | |
| 145 | + | |
| 146 | +#define _FS_RPATH 0 /* 0 to 2 */ | |
| 147 | +/* This option configures support of relative path. | |
| 148 | +/ | |
| 149 | +/ 0: Disable relative path and remove related functions. | |
| 150 | +/ 1: Enable relative path. f_chdir() and f_chdrive() are available. | |
| 151 | +/ 2: f_getcwd() function is available in addition to 1. | |
| 152 | +*/ | |
| 153 | + | |
| 154 | +/*---------------------------------------------------------------------------/ | |
| 155 | +/ Drive/Volume Configurations | |
| 156 | +/----------------------------------------------------------------------------*/ | |
| 157 | + | |
| 158 | +#define _VOLUMES 1 | |
| 159 | +/* Number of volumes (logical drives) to be used. */ | |
| 160 | + | |
| 161 | +/* USER CODE BEGIN Volumes */ | |
| 162 | +#define _STR_VOLUME_ID 0 /* 0:Use only 0-9 for drive ID, 1:Use strings for drive ID */ | |
| 163 | +#define _VOLUME_STRS "RAM","NAND","CF","SD1","SD2","USB1","USB2","USB3" | |
| 164 | +/* _STR_VOLUME_ID switches string support of volume ID. | |
| 165 | +/ When _STR_VOLUME_ID is set to 1, also pre-defined strings can be used as drive | |
| 166 | +/ number in the path name. _VOLUME_STRS defines the drive ID strings for each | |
| 167 | +/ logical drives. Number of items must be equal to _VOLUMES. Valid characters for | |
| 168 | +/ the drive ID strings are: A-Z and 0-9. */ | |
| 169 | +/* USER CODE END Volumes */ | |
| 170 | + | |
| 171 | +#define _MULTI_PARTITION 0 /* 0:Single partition, 1:Multiple partition */ | |
| 172 | +/* This option switches support of multi-partition on a physical drive. | |
| 173 | +/ By default (0), each logical drive number is bound to the same physical drive | |
| 174 | +/ number and only an FAT volume found on the physical drive will be mounted. | |
| 175 | +/ When multi-partition is enabled (1), each logical drive number can be bound to | |
| 176 | +/ arbitrary physical drive and partition listed in the VolToPart[]. Also f_fdisk() | |
| 177 | +/ funciton will be available. */ | |
| 178 | +#define _MIN_SS 512 /* 512, 1024, 2048 or 4096 */ | |
| 179 | +#define _MAX_SS 512 /* 512, 1024, 2048 or 4096 */ | |
| 180 | +/* These options configure the range of sector size to be supported. (512, 1024, | |
| 181 | +/ 2048 or 4096) Always set both 512 for most systems, all type of memory cards and | |
| 182 | +/ harddisk. But a larger value may be required for on-board flash memory and some | |
| 183 | +/ type of optical media. When _MAX_SS is larger than _MIN_SS, FatFs is configured | |
| 184 | +/ to variable sector size and GET_SECTOR_SIZE command must be implemented to the | |
| 185 | +/ disk_ioctl() function. */ | |
| 186 | + | |
| 187 | +#define _USE_TRIM 0 | |
| 188 | +/* This option switches support of ATA-TRIM. (0:Disable or 1:Enable) | |
| 189 | +/ To enable Trim function, also CTRL_TRIM command should be implemented to the | |
| 190 | +/ disk_ioctl() function. */ | |
| 191 | + | |
| 192 | +#define _FS_NOFSINFO 0 /* 0,1,2 or 3 */ | |
| 193 | +/* If you need to know correct free space on the FAT32 volume, set bit 0 of this | |
| 194 | +/ option, and f_getfree() function at first time after volume mount will force | |
| 195 | +/ a full FAT scan. Bit 1 controls the use of last allocated cluster number. | |
| 196 | +/ | |
| 197 | +/ bit0=0: Use free cluster count in the FSINFO if available. | |
| 198 | +/ bit0=1: Do not trust free cluster count in the FSINFO. | |
| 199 | +/ bit1=0: Use last allocated cluster number in the FSINFO if available. | |
| 200 | +/ bit1=1: Do not trust last allocated cluster number in the FSINFO. | |
| 201 | +*/ | |
| 202 | + | |
| 203 | +/*---------------------------------------------------------------------------/ | |
| 204 | +/ System Configurations | |
| 205 | +/----------------------------------------------------------------------------*/ | |
| 206 | + | |
| 207 | +#define _FS_TINY 0 /* 0:Normal or 1:Tiny */ | |
| 208 | +/* This option switches tiny buffer configuration. (0:Normal or 1:Tiny) | |
| 209 | +/ At the tiny configuration, size of file object (FIL) is reduced _MAX_SS bytes. | |
| 210 | +/ Instead of private sector buffer eliminated from the file object, common sector | |
| 211 | +/ buffer in the file system object (FATFS) is used for the file data transfer. */ | |
| 212 | + | |
| 213 | +#define _FS_EXFAT 0 | |
| 214 | +/* This option switches support of exFAT file system. (0:Disable or 1:Enable) | |
| 215 | +/ When enable exFAT, also LFN needs to be enabled. (_USE_LFN >= 1) | |
| 216 | +/ Note that enabling exFAT discards C89 compatibility. */ | |
| 217 | + | |
| 218 | +#define _FS_NORTC 0 | |
| 219 | +#define _NORTC_MON 6 | |
| 220 | +#define _NORTC_MDAY 4 | |
| 221 | +#define _NORTC_YEAR 2015 | |
| 222 | +/* The option _FS_NORTC switches timestamp functiton. If the system does not have | |
| 223 | +/ any RTC function or valid timestamp is not needed, set _FS_NORTC = 1 to disable | |
| 224 | +/ the timestamp function. All objects modified by FatFs will have a fixed timestamp | |
| 225 | +/ defined by _NORTC_MON, _NORTC_MDAY and _NORTC_YEAR in local time. | |
| 226 | +/ To enable timestamp function (_FS_NORTC = 0), get_fattime() function need to be | |
| 227 | +/ added to the project to get current time form real-time clock. _NORTC_MON, | |
| 228 | +/ _NORTC_MDAY and _NORTC_YEAR have no effect. | |
| 229 | +/ These options have no effect at read-only configuration (_FS_READONLY = 1). */ | |
| 230 | + | |
| 231 | +#define _FS_LOCK 2 /* 0:Disable or >=1:Enable */ | |
| 232 | +/* The option _FS_LOCK switches file lock function to control duplicated file open | |
| 233 | +/ and illegal operation to open objects. This option must be 0 when _FS_READONLY | |
| 234 | +/ is 1. | |
| 235 | +/ | |
| 236 | +/ 0: Disable file lock function. To avoid volume corruption, application program | |
| 237 | +/ should avoid illegal open, remove and rename to the open objects. | |
| 238 | +/ >0: Enable file lock function. The value defines how many files/sub-directories | |
| 239 | +/ can be opened simultaneously under file lock control. Note that the file | |
| 240 | +/ lock control is independent of re-entrancy. */ | |
| 241 | + | |
| 242 | +#define _FS_REENTRANT 0 /* 0:Disable or 1:Enable */ | |
| 243 | +#define _FS_TIMEOUT 1000 /* Timeout period in unit of time ticks */ | |
| 244 | +#define _SYNC_t NULL | |
| 245 | +/* The option _FS_REENTRANT switches the re-entrancy (thread safe) of the FatFs | |
| 246 | +/ module itself. Note that regardless of this option, file access to different | |
| 247 | +/ volume is always re-entrant and volume control functions, f_mount(), f_mkfs() | |
| 248 | +/ and f_fdisk() function, are always not re-entrant. Only file/directory access | |
| 249 | +/ to the same volume is under control of this function. | |
| 250 | +/ | |
| 251 | +/ 0: Disable re-entrancy. _FS_TIMEOUT and _SYNC_t have no effect. | |
| 252 | +/ 1: Enable re-entrancy. Also user provided synchronization handlers, | |
| 253 | +/ ff_req_grant(), ff_rel_grant(), ff_del_syncobj() and ff_cre_syncobj() | |
| 254 | +/ function, must be added to the project. Samples are available in | |
| 255 | +/ option/syscall.c. | |
| 256 | +/ | |
| 257 | +/ The _FS_TIMEOUT defines timeout period in unit of time tick. | |
| 258 | +/ The _SYNC_t defines O/S dependent sync object type. e.g. HANDLE, ID, OS_EVENT*, | |
| 259 | +/ SemaphoreHandle_t and etc.. A header file for O/S definitions needs to be | |
| 260 | +/ included somewhere in the scope of ff.h. */ | |
| 261 | + | |
| 262 | +/* define the ff_malloc ff_free macros as standard malloc free */ | |
| 263 | +#if !defined(ff_malloc) && !defined(ff_free) | |
| 264 | +#include <stdlib.h> | |
| 265 | +#define ff_malloc malloc | |
| 266 | +#define ff_free free | |
| 267 | +#endif | |
| 268 | + | |
| 269 | +#endif /* _FFCONF */ | |
| @@ -0,0 +1,60 @@ | ||
| 1 | +/** | |
| 2 | + ****************************************************************************** | |
| 3 | + * File Name : FMC.h | |
| 4 | + * Description : This file provides code for the configuration | |
| 5 | + * of the FMC peripheral. | |
| 6 | + ****************************************************************************** | |
| 7 | + * @attention | |
| 8 | + * | |
| 9 | + * <h2><center>© Copyright (c) 2020 STMicroelectronics. | |
| 10 | + * All rights reserved.</center></h2> | |
| 11 | + * | |
| 12 | + * This software component is licensed by ST under Ultimate Liberty license | |
| 13 | + * SLA0044, the "License"; You may not use this file except in compliance with | |
| 14 | + * the License. You may obtain a copy of the License at: | |
| 15 | + * www.st.com/SLA0044 | |
| 16 | + * | |
| 17 | + ****************************************************************************** | |
| 18 | + */ | |
| 19 | +/* Define to prevent recursive inclusion -------------------------------------*/ | |
| 20 | +#ifndef __FMC_H | |
| 21 | +#define __FMC_H | |
| 22 | +#ifdef __cplusplus | |
| 23 | + extern "C" { | |
| 24 | +#endif | |
| 25 | + | |
| 26 | +/* Includes ------------------------------------------------------------------*/ | |
| 27 | +#include "main.h" | |
| 28 | + | |
| 29 | +/* USER CODE BEGIN Includes */ | |
| 30 | + | |
| 31 | +/* USER CODE END Includes */ | |
| 32 | + | |
| 33 | +extern SDRAM_HandleTypeDef hsdram1; | |
| 34 | + | |
| 35 | +/* USER CODE BEGIN Private defines */ | |
| 36 | + | |
| 37 | +/* USER CODE END Private defines */ | |
| 38 | + | |
| 39 | +void MX_FMC_Init(void); | |
| 40 | +void HAL_SDRAM_MspInit(SDRAM_HandleTypeDef* hsdram); | |
| 41 | +void HAL_SDRAM_MspDeInit(SDRAM_HandleTypeDef* hsdram); | |
| 42 | + | |
| 43 | +/* USER CODE BEGIN Prototypes */ | |
| 44 | + | |
| 45 | +/* USER CODE END Prototypes */ | |
| 46 | + | |
| 47 | +#ifdef __cplusplus | |
| 48 | +} | |
| 49 | +#endif | |
| 50 | +#endif /*__FMC_H */ | |
| 51 | + | |
| 52 | +/** | |
| 53 | + * @} | |
| 54 | + */ | |
| 55 | + | |
| 56 | +/** | |
| 57 | + * @} | |
| 58 | + */ | |
| 59 | + | |
| 60 | +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |
| @@ -0,0 +1,120 @@ | ||
| 1 | +/* | |
| 2 | + * gfx.h | |
| 3 | + * | |
| 4 | + * Created on: Jul 8, 2018 | |
| 5 | + * Author: jeffsnyder | |
| 6 | + */ | |
| 7 | + | |
| 8 | +#ifndef GFX_H_ | |
| 9 | +#define GFX_H_ | |
| 10 | + | |
| 11 | + | |
| 12 | +#include "gfx_font.h" | |
| 13 | +#include "ssd1306.h" | |
| 14 | + | |
| 15 | +typedef struct _GFX | |
| 16 | +{ | |
| 17 | + int16_t WIDTH; | |
| 18 | + int16_t HEIGHT; | |
| 19 | + uint16_t _width; | |
| 20 | + uint16_t _height; | |
| 21 | + uint16_t rotation; | |
| 22 | + uint16_t cursor_y; | |
| 23 | + uint16_t cursor_x; | |
| 24 | + uint16_t textsize; | |
| 25 | + uint16_t textcolor; | |
| 26 | + uint16_t textbgcolor; | |
| 27 | + uint16_t wrap; | |
| 28 | + uint16_t _cp437; | |
| 29 | + GFXfont *gfxFont; | |
| 30 | +} GFX; | |
| 31 | + | |
| 32 | +void GFXinit(GFX* myGfx, int16_t w, int16_t h); // Constructor | |
| 33 | + | |
| 34 | + // This MUST be defined by the subclass: | |
| 35 | +void GFXdrawPixel(GFX* myGfx, int16_t x, int16_t y, uint16_t color); | |
| 36 | + | |
| 37 | + // TRANSACTION API / CORE DRAW API | |
| 38 | + // These MAY be overridden by the subclass to provide device-specific | |
| 39 | + // optimized code. Otherwise 'generic' versions are used. | |
| 40 | +void GFXstartWrite(GFX* myGfx); | |
| 41 | +void GFXwritePixel(GFX* myGfx, int16_t x, int16_t y, uint16_t color); | |
| 42 | +void GFXwriteFillRect(GFX* myGfx, int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color); | |
| 43 | +void GFXwriteFastVLine(GFX* myGfx, int16_t x, int16_t y, int16_t h, uint16_t color); | |
| 44 | +void GFXwriteFastHLine(GFX* myGfx, int16_t x, int16_t y, int16_t w, uint16_t color); | |
| 45 | +void GFXwriteLine(GFX* myGfx, int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color); | |
| 46 | +void GFXendWrite(GFX* myGfx); | |
| 47 | + | |
| 48 | + // CONTROL API | |
| 49 | + // These MAY be overridden by the subclass to provide device-specific | |
| 50 | + // optimized code. Otherwise 'generic' versions are used. | |
| 51 | +void GFXsetRotation(GFX* myGfx, uint8_t r); | |
| 52 | +void GFXinvertDisplay(GFX* myGfx, uint8_t i); | |
| 53 | + | |
| 54 | + // BASIC DRAW API | |
| 55 | + // These MAY be overridden by the subclass to provide device-specific | |
| 56 | + // optimized code. Otherwise 'generic' versions are used. | |
| 57 | + | |
| 58 | + // It's good to implement those, even if using transaction API | |
| 59 | +void GFXdrawFastVLine(GFX* myGfx, int16_t x, int16_t y, int16_t h, uint16_t color); | |
| 60 | +void GFXdrawFastHLine(GFX* myGfx, int16_t x, int16_t y, int16_t w, uint16_t color); | |
| 61 | +void GFXfillRect(GFX* myGfx, int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color); | |
| 62 | +void GFXfillScreen(GFX* myGfx, uint16_t color); | |
| 63 | + // Optional and probably not necessary to change | |
| 64 | +void GFXdrawLine(GFX* myGfx, int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color); | |
| 65 | +void GFXdrawRect(GFX* myGfx, int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color); | |
| 66 | + | |
| 67 | + // These exist only with Adafruit_GFX (no subclass overrides) | |
| 68 | + | |
| 69 | +void GFXdrawCircle(GFX* myGfx, int16_t x0, int16_t y0, int16_t r, uint16_t color); | |
| 70 | +void GFXdrawCircleHelper(GFX* myGfx, int16_t x0, int16_t y0, int16_t r, uint8_t cornername, | |
| 71 | + uint16_t color); | |
| 72 | +void GFXfillCircle(GFX* myGfx, int16_t x0, int16_t y0, int16_t r, uint16_t color); | |
| 73 | +void GFXfillCircleHelper(GFX* myGfx, int16_t x0, int16_t y0, int16_t r, uint8_t cornername, | |
| 74 | + int16_t delta, uint16_t color); | |
| 75 | +void GFXdrawTriangle(GFX* myGfx, int16_t x0, int16_t y0, int16_t x1, int16_t y1, | |
| 76 | + int16_t x2, int16_t y2, uint16_t color); | |
| 77 | +void GFXfillTriangle(GFX* myGfx, int16_t x0, int16_t y0, int16_t x1, int16_t y1, | |
| 78 | + int16_t x2, int16_t y2, uint16_t color); | |
| 79 | +void GFXdrawRoundRect(GFX* myGfx, int16_t x0, int16_t y0, int16_t w, int16_t h, | |
| 80 | + int16_t radius, uint16_t color); | |
| 81 | +void GFXfillRoundRect(GFX* myGfx, int16_t x0, int16_t y0, int16_t w, int16_t h, | |
| 82 | + int16_t radius, uint16_t color); | |
| 83 | +void GFXdrawBitmap(GFX* myGfx, int16_t x, int16_t y, uint8_t *bitmap, | |
| 84 | + int16_t w, int16_t h, uint16_t color, uint16_t bg); | |
| 85 | +void GFXdrawChar(GFX* myGfx, int16_t x, int16_t y, unsigned char c, uint16_t color, | |
| 86 | + uint16_t bg, uint8_t size); | |
| 87 | +void GFXsetCursor(GFX* myGfx, int16_t x, int16_t y); | |
| 88 | +void GFXsetTextColor(GFX* myGfx, uint16_t c, uint16_t bg); | |
| 89 | +void GFXsetTextSize(GFX* myGfx, uint8_t s); | |
| 90 | +void GFXsetTextWrap(GFX* myGfx, uint8_t w); | |
| 91 | +void GFXcp437(GFX* myGfx, uint8_t x); | |
| 92 | +void GFXsetFont(GFX* myGfx, const GFXfont *f); | |
| 93 | +void GFXgetTextBounds(GFX* myGfx, char *string, int16_t x, int16_t y, | |
| 94 | + int16_t *x1, int16_t *y1, uint16_t *w, uint16_t *h); | |
| 95 | + | |
| 96 | + | |
| 97 | +void GFXwrite(GFX* myGfx, uint8_t); | |
| 98 | + | |
| 99 | + | |
| 100 | + int16_t GFXheight(GFX* myGfx ); | |
| 101 | + int16_t GFXwidth(GFX* myGfx ); | |
| 102 | + | |
| 103 | + uint8_t GFXgetRotation(GFX* myGfx ); | |
| 104 | + | |
| 105 | + // get current cursor position (get rotation safe maximum values, using: width() for x, height() for y) | |
| 106 | + int16_t GFXgetCursorX(GFX* myGfx); | |
| 107 | + int16_t GFXgetCursorY(GFX* myGfx ); | |
| 108 | + | |
| 109 | + void GFXcharBounds(GFX* myGfx, char c, int16_t *x, int16_t *y, | |
| 110 | + int16_t *minx, int16_t *miny, int16_t *maxx, int16_t *maxy); | |
| 111 | + | |
| 112 | +int OLEDparseInt(char* buffer, uint32_t myNumber, uint8_t numDigits); | |
| 113 | + | |
| 114 | +int OLEDparsePitch(char* buffer, float midi); | |
| 115 | + | |
| 116 | +int OLEDparsePitchClass(char* buffer, float midi); | |
| 117 | + | |
| 118 | +int OLEDparseFixedFloat(char* buffer, float input, uint8_t numDigits, uint8_t numDecimal); | |
| 119 | + | |
| 120 | +#endif /* GFX_H_ */ | |
| @@ -0,0 +1,24 @@ | ||
| 1 | +// Font structures for newer Adafruit_GFX (1.1 and later). | |
| 2 | +// Example fonts are included in 'Fonts' directory. | |
| 3 | +// To use a font in your Arduino sketch, #include the corresponding .h | |
| 4 | +// file and pass address of GFXfont struct to setFont(). Pass NULL to | |
| 5 | +// revert to 'classic' fixed-space bitmap font. | |
| 6 | + | |
| 7 | +#ifndef _GFXFONT_H_ | |
| 8 | +#define _GFXFONT_H_ | |
| 9 | + | |
| 10 | +typedef struct { // Data stored PER GLYPH | |
| 11 | + uint16_t bitmapOffset; // Pointer into GFXfont->bitmap | |
| 12 | + uint8_t width, height; // Bitmap dimensions in pixels | |
| 13 | + uint8_t xAdvance; // Distance to advance cursor (x axis) | |
| 14 | + int8_t xOffset, yOffset; // Dist from cursor pos to UL corner | |
| 15 | +} GFXglyph; | |
| 16 | + | |
| 17 | +typedef struct { // Data stored for FONT AS A WHOLE: | |
| 18 | + uint8_t *bitmap; // Glyph bitmaps, concatenated | |
| 19 | + GFXglyph *glyph; // Glyph array | |
| 20 | + uint8_t first, last; // ASCII extents | |
| 21 | + uint8_t yAdvance; // Newline distance (y axis) | |
| 22 | +} GFXfont; | |
| 23 | + | |
| 24 | +#endif // _GFXFONT_H_ | |
| @@ -0,0 +1,57 @@ | ||
| 1 | +/** | |
| 2 | + ****************************************************************************** | |
| 3 | + * File Name : gpio.h | |
| 4 | + * Description : This file contains all the functions prototypes for | |
| 5 | + * the gpio | |
| 6 | + ****************************************************************************** | |
| 7 | + * @attention | |
| 8 | + * | |
| 9 | + * <h2><center>© Copyright (c) 2020 STMicroelectronics. | |
| 10 | + * All rights reserved.</center></h2> | |
| 11 | + * | |
| 12 | + * This software component is licensed by ST under Ultimate Liberty license | |
| 13 | + * SLA0044, the "License"; You may not use this file except in compliance with | |
| 14 | + * the License. You may obtain a copy of the License at: | |
| 15 | + * www.st.com/SLA0044 | |
| 16 | + * | |
| 17 | + ****************************************************************************** | |
| 18 | + */ | |
| 19 | + | |
| 20 | +/* Define to prevent recursive inclusion -------------------------------------*/ | |
| 21 | +#ifndef __gpio_H | |
| 22 | +#define __gpio_H | |
| 23 | +#ifdef __cplusplus | |
| 24 | + extern "C" { | |
| 25 | +#endif | |
| 26 | + | |
| 27 | +/* Includes ------------------------------------------------------------------*/ | |
| 28 | +#include "main.h" | |
| 29 | + | |
| 30 | +/* USER CODE BEGIN Includes */ | |
| 31 | + | |
| 32 | +/* USER CODE END Includes */ | |
| 33 | + | |
| 34 | +/* USER CODE BEGIN Private defines */ | |
| 35 | + | |
| 36 | +/* USER CODE END Private defines */ | |
| 37 | + | |
| 38 | +void MX_GPIO_Init(void); | |
| 39 | + | |
| 40 | +/* USER CODE BEGIN Prototypes */ | |
| 41 | + | |
| 42 | +/* USER CODE END Prototypes */ | |
| 43 | + | |
| 44 | +#ifdef __cplusplus | |
| 45 | +} | |
| 46 | +#endif | |
| 47 | +#endif /*__ pinoutConfig_H */ | |
| 48 | + | |
| 49 | +/** | |
| 50 | + * @} | |
| 51 | + */ | |
| 52 | + | |
| 53 | +/** | |
| 54 | + * @} | |
| 55 | + */ | |
| 56 | + | |
| 57 | +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |
| @@ -0,0 +1,60 @@ | ||
| 1 | +/** | |
| 2 | + ****************************************************************************** | |
| 3 | + * File Name : I2C.h | |
| 4 | + * Description : This file provides code for the configuration | |
| 5 | + * of the I2C instances. | |
| 6 | + ****************************************************************************** | |
| 7 | + * @attention | |
| 8 | + * | |
| 9 | + * <h2><center>© Copyright (c) 2020 STMicroelectronics. | |
| 10 | + * All rights reserved.</center></h2> | |
| 11 | + * | |
| 12 | + * This software component is licensed by ST under Ultimate Liberty license | |
| 13 | + * SLA0044, the "License"; You may not use this file except in compliance with | |
| 14 | + * the License. You may obtain a copy of the License at: | |
| 15 | + * www.st.com/SLA0044 | |
| 16 | + * | |
| 17 | + ****************************************************************************** | |
| 18 | + */ | |
| 19 | +/* Define to prevent recursive inclusion -------------------------------------*/ | |
| 20 | +#ifndef __i2c_H | |
| 21 | +#define __i2c_H | |
| 22 | +#ifdef __cplusplus | |
| 23 | + extern "C" { | |
| 24 | +#endif | |
| 25 | + | |
| 26 | +/* Includes ------------------------------------------------------------------*/ | |
| 27 | +#include "main.h" | |
| 28 | + | |
| 29 | +/* USER CODE BEGIN Includes */ | |
| 30 | + | |
| 31 | +/* USER CODE END Includes */ | |
| 32 | + | |
| 33 | +extern I2C_HandleTypeDef hi2c2; | |
| 34 | +extern I2C_HandleTypeDef hi2c4; | |
| 35 | + | |
| 36 | +/* USER CODE BEGIN Private defines */ | |
| 37 | + | |
| 38 | +/* USER CODE END Private defines */ | |
| 39 | + | |
| 40 | +void MX_I2C2_Init(void); | |
| 41 | +void MX_I2C4_Init(void); | |
| 42 | + | |
| 43 | +/* USER CODE BEGIN Prototypes */ | |
| 44 | + | |
| 45 | +/* USER CODE END Prototypes */ | |
| 46 | + | |
| 47 | +#ifdef __cplusplus | |
| 48 | +} | |
| 49 | +#endif | |
| 50 | +#endif /*__ i2c_H */ | |
| 51 | + | |
| 52 | +/** | |
| 53 | + * @} | |
| 54 | + */ | |
| 55 | + | |
| 56 | +/** | |
| 57 | + * @} | |
| 58 | + */ | |
| 59 | + | |
| 60 | +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |
| @@ -1,258 +0,0 @@ | ||
| 1 | −/*============================================================================== | |
| 2 | − | |
| 3 | − leaf-analysis.h | |
| 4 | − Created: 25 Oct 2019 10:30:52am | |
| 5 | − Author: Matthew Wang | |
| 6 | − | |
| 7 | − ==============================================================================*/ | |
| 8 | − | |
| 9 | −#ifndef LEAF_ANALYSIS_H_INCLUDED | |
| 10 | −#define LEAF_ANALYSIS_H_INCLUDED | |
| 11 | − | |
| 12 | −#ifdef __cplusplus | |
| 13 | −extern "C" { | |
| 14 | −#endif | |
| 15 | − | |
| 16 | − //============================================================================== | |
| 17 | − | |
| 18 | −#include "leaf-global.h" | |
| 19 | −#include "leaf-mempool.h" | |
| 20 | −#include "leaf-math.h" | |
| 21 | −#include "leaf-filters.h" | |
| 22 | −#include "leaf-envelopes.h" | |
| 23 | − | |
| 24 | − //============================================================================== | |
| 25 | − | |
| 26 | − /* Envelope Follower */ | |
| 27 | − typedef struct _tEnvelopeFollower | |
| 28 | − { | |
| 29 | − float y; | |
| 30 | − float a_thresh; | |
| 31 | − float d_coeff; | |
| 32 | − | |
| 33 | − } _tEnvelopeFollower; | |
| 34 | − | |
| 35 | − typedef _tEnvelopeFollower* tEnvelopeFollower; | |
| 36 | − | |
| 37 | − void tEnvelopeFollower_init (tEnvelopeFollower* const, float attackThreshold, float decayCoeff); | |
| 38 | − void tEnvelopeFollower_free (tEnvelopeFollower* const); | |
| 39 | − void tEnvelopeFollower_initToPool (tEnvelopeFollower* const, float attackThreshold, float decayCoeff, tMempool* const); | |
| 40 | − void tEnvelopeFollower_freeFromPool (tEnvelopeFollower* const, tMempool* const); | |
| 41 | − | |
| 42 | − float tEnvelopeFollower_tick (tEnvelopeFollower* const, float x); | |
| 43 | − int tEnvelopeFollower_decayCoeff (tEnvelopeFollower* const, float decayCoeff); | |
| 44 | − int tEnvelopeFollower_attackThresh (tEnvelopeFollower* const, float attackThresh); | |
| 45 | − | |
| 46 | − // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | |
| 47 | − | |
| 48 | − /* PowerEnvelopeFollower */ | |
| 49 | − typedef struct _tPowerFollower { | |
| 50 | − float factor, oneminusfactor; | |
| 51 | − float curr; | |
| 52 | − | |
| 53 | − } _tPowerFollower; | |
| 54 | − | |
| 55 | − typedef _tPowerFollower* tPowerFollower; | |
| 56 | − | |
| 57 | − void tPowerFollower_init (tPowerFollower* const, float factor); | |
| 58 | − void tPowerFollower_free (tPowerFollower* const); | |
| 59 | − void tPowerFollower_initToPool (tPowerFollower* const, float factor, tMempool* const); | |
| 60 | − void tPowerFollower_freeFromPool (tPowerFollower* const, tMempool* const); | |
| 61 | − | |
| 62 | − float tPowerFollower_tick (tPowerFollower* const, float input); | |
| 63 | − float tPowerFollower_sample (tPowerFollower* const); | |
| 64 | − int tPowerFollower_setFactor (tPowerFollower* const, float factor); | |
| 65 | − | |
| 66 | − // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | |
| 67 | − | |
| 68 | − // ENV~ from PD, modified for LEAF | |
| 69 | −#define MAXOVERLAP 32 | |
| 70 | −#define INITVSTAKEN 64 | |
| 71 | −#define ENV_WINDOW_SIZE 1024 | |
| 72 | −#define ENV_HOP_SIZE 256 | |
| 73 | − | |
| 74 | − typedef struct _tEnvPD | |
| 75 | − { | |
| 76 | − float buf[ENV_WINDOW_SIZE + INITVSTAKEN]; | |
| 77 | − uint16_t x_phase; /* number of points since last output */ | |
| 78 | − uint16_t x_period; /* requested period of output */ | |
| 79 | − uint16_t x_realperiod; /* period rounded up to vecsize multiple */ | |
| 80 | − uint16_t x_npoints; /* analysis window size in samples */ | |
| 81 | − float x_result; /* result to output */ | |
| 82 | − float x_sumbuf[MAXOVERLAP]; /* summing buffer */ | |
| 83 | − float x_f; | |
| 84 | − uint16_t windowSize, hopSize, blockSize; | |
| 85 | − uint16_t x_allocforvs; /* extra buffer for DSP vector size */ | |
| 86 | − } _tEnvPD; | |
| 87 | − | |
| 88 | − typedef _tEnvPD* tEnvPD; | |
| 89 | − | |
| 90 | − void tEnvPD_init (tEnvPD* const, int windowSize, int hopSize, int blockSize); | |
| 91 | − void tEnvPD_free (tEnvPD* const); | |
| 92 | − void tEnvPD_initToPool (tEnvPD* const, int windowSize, int hopSize, int blockSize, tMempool* const); | |
| 93 | − void tEnvPD_freeFromPool (tEnvPD* const, tMempool* const); | |
| 94 | − | |
| 95 | − float tEnvPD_tick (tEnvPD* const); | |
| 96 | − void tEnvPD_processBlock (tEnvPD* const, float* in); | |
| 97 | − | |
| 98 | − // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | |
| 99 | − | |
| 100 | − /* tAttackDetection */ | |
| 101 | −#define DEFBLOCKSIZE 1024 | |
| 102 | −#define DEFTHRESHOLD 6 | |
| 103 | −#define DEFATTACK 10 | |
| 104 | −#define DEFRELEASE 10 | |
| 105 | − | |
| 106 | − typedef struct _tAttackDetection | |
| 107 | − { | |
| 108 | − float env; | |
| 109 | − | |
| 110 | − //Attack & Release times in msec | |
| 111 | − int atk; | |
| 112 | − int rel; | |
| 113 | − | |
| 114 | − //Attack & Release coefficients based on times | |
| 115 | − float atk_coeff; | |
| 116 | − float rel_coeff; | |
| 117 | − | |
| 118 | − int blocksize; | |
| 119 | − int samplerate; | |
| 120 | − | |
| 121 | − //RMS amplitude of previous block - used to decide if attack is present | |
| 122 | − float prevAmp; | |
| 123 | − | |
| 124 | − float threshold; | |
| 125 | − } _tAttackDetection; | |
| 126 | − | |
| 127 | − typedef _tAttackDetection* tAttackDetection; | |
| 128 | − | |
| 129 | − void tAttackDetection_init (tAttackDetection* const, int blocksize, int atk, int rel); | |
| 130 | − void tAttackDetection_free (tAttackDetection* const); | |
| 131 | − void tAttackDetection_initToPool (tAttackDetection* const, int blocksize, int atk, int rel, tMempool* const); | |
| 132 | − void tAttackDetection_freeFromPool (tAttackDetection* const, tMempool* const); | |
| 133 | − | |
| 134 | − // set expected input blocksize | |
| 135 | − void tAttackDetection_setBlocksize (tAttackDetection* const, int size); | |
| 136 | − | |
| 137 | − // change atkDetector sample rate | |
| 138 | − void tAttackDetection_setSamplerate (tAttackDetection* const, int inRate); | |
| 139 | − | |
| 140 | − // set attack time and coeff | |
| 141 | − void tAttackDetection_setAttack (tAttackDetection* const, int inAtk); | |
| 142 | − | |
| 143 | − // set release time and coeff | |
| 144 | − void tAttackDetection_setRelease (tAttackDetection* const, int inRel); | |
| 145 | − | |
| 146 | − // set level above which values are identified as attacks | |
| 147 | − void tAttackDetection_setThreshold (tAttackDetection* const, float thres); | |
| 148 | − | |
| 149 | − // find largest transient in input block, return index of attack | |
| 150 | − int tAttackDetection_detect (tAttackDetection* const, float *in); | |
| 151 | − | |
| 152 | − //============================================================================== | |
| 153 | − | |
| 154 | − // tSNAC: period detector | |
| 155 | − // from Katja Vetters http://www.katjaas.nl/helmholtz/helmholtz.html | |
| 156 | −#define SNAC_FRAME_SIZE 1024 // default analysis framesize // should be the same as (or smaller than?) PS_FRAME_SIZE | |
| 157 | −#define DEFOVERLAP 1 // default overlap | |
| 158 | −#define DEFBIAS 0.2f // default bias | |
| 159 | −#define DEFMINRMS 0.003f // default minimum RMS | |
| 160 | −#define SEEK 0.85f // seek-length as ratio of framesize | |
| 161 | − | |
| 162 | − typedef struct _tSNAC | |
| 163 | − { | |
| 164 | − float* inputbuf; | |
| 165 | − float* processbuf; | |
| 166 | − float* spectrumbuf; | |
| 167 | − float* biasbuf; | |
| 168 | − uint16_t timeindex; | |
| 169 | − uint16_t framesize; | |
| 170 | − uint16_t overlap; | |
| 171 | − uint16_t periodindex; | |
| 172 | − | |
| 173 | − float periodlength; | |
| 174 | − float fidelity; | |
| 175 | − float biasfactor; | |
| 176 | − float minrms; | |
| 177 | − | |
| 178 | − } _tSNAC; | |
| 179 | − | |
| 180 | − typedef _tSNAC* tSNAC; | |
| 181 | − | |
| 182 | − void tSNAC_init (tSNAC* const, int overlaparg); | |
| 183 | − void tSNAC_free (tSNAC* const); | |
| 184 | − void tSNAC_initToPool (tSNAC* const, int overlaparg, tMempool* const); | |
| 185 | − void tSNAC_freeFromPool (tSNAC* const, tMempool* const); | |
| 186 | − | |
| 187 | − void tSNAC_ioSamples (tSNAC *s, float *in, float *out, int size); | |
| 188 | − void tSNAC_setOverlap (tSNAC *s, int lap); | |
| 189 | − void tSNAC_setBias (tSNAC *s, float bias); | |
| 190 | − void tSNAC_setMinRMS (tSNAC *s, float rms); | |
| 191 | − | |
| 192 | − /*To get freq, perform SAMPLE_RATE/snac_getperiod() */ | |
| 193 | − float tSNAC_getPeriod (tSNAC *s); | |
| 194 | − float tSNAC_getFidelity (tSNAC *s); | |
| 195 | − | |
| 196 | −#define DEFPITCHRATIO 2.0f | |
| 197 | −#define DEFTIMECONSTANT 100.0f | |
| 198 | −#define DEFHOPSIZE 64 | |
| 199 | −#define DEFWINDOWSIZE 64 | |
| 200 | −#define FBA 20 | |
| 201 | −#define HPFREQ 40.0f | |
| 202 | − | |
| 203 | − // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | |
| 204 | − // Period detection | |
| 205 | − typedef struct _tPeriodDetection | |
| 206 | − { | |
| 207 | − tEnvPD env; | |
| 208 | − tSNAC snac; | |
| 209 | − float* inBuffer; | |
| 210 | − float* outBuffer; | |
| 211 | − int frameSize; | |
| 212 | − int bufSize; | |
| 213 | − int framesPerBuffer; | |
| 214 | − int curBlock; | |
| 215 | − int lastBlock; | |
| 216 | − int i; | |
| 217 | − int indexstore; | |
| 218 | − int iLast; | |
| 219 | − int index; | |
| 220 | − float period; | |
| 221 | − | |
| 222 | − uint16_t hopSize; | |
| 223 | − uint16_t windowSize; | |
| 224 | − uint8_t fba; | |
| 225 | − | |
| 226 | − float timeConstant; | |
| 227 | − float radius; | |
| 228 | − float max; | |
| 229 | − float lastmax; | |
| 230 | − float deltamax; | |
| 231 | − | |
| 232 | − float fidelityThreshold; | |
| 233 | − | |
| 234 | − } _tPeriodDetection; | |
| 235 | − | |
| 236 | − typedef _tPeriodDetection* tPeriodDetection; | |
| 237 | − | |
| 238 | − void tPeriodDetection_init (tPeriodDetection* const, float* in, float* out, int bufSize, int frameSize); | |
| 239 | − void tPeriodDetection_free (tPeriodDetection* const); | |
| 240 | − void tPeriodDetection_initToPool (tPeriodDetection* const, float* in, float* out, int bufSize, int frameSize, tMempool* const); | |
| 241 | − void tPeriodDetection_freeFromPool (tPeriodDetection* const, tMempool* const); | |
| 242 | − | |
| 243 | − float tPeriodDetection_tick (tPeriodDetection* const, float sample); | |
| 244 | − float tPeriodDetection_getPeriod (tPeriodDetection* const); | |
| 245 | − void tPeriodDetection_setHopSize (tPeriodDetection* const, int hs); | |
| 246 | − void tPeriodDetection_setWindowSize (tPeriodDetection* const, int ws); | |
| 247 | − void tPeriodDetection_setFidelityThreshold(tPeriodDetection* const, float threshold); | |
| 248 | − | |
| 249 | − //============================================================================== | |
| 250 | − | |
| 251 | −#ifdef __cplusplus | |
| 252 | −} | |
| 253 | −#endif | |
| 254 | − | |
| 255 | −#endif // LEAF_ANALYSIS_H_INCLUDED | |
| 256 | − | |
| 257 | −//============================================================================== | |
| 258 | − | |
| @@ -1,221 +0,0 @@ | ||
| 1 | −/*============================================================================== | |
| 2 | − | |
| 3 | − leaf-delay.h | |
| 4 | − Created: 20 Jan 2017 12:01:24pm | |
| 5 | − Author: Michael R Mulshine | |
| 6 | − | |
| 7 | − ==============================================================================*/ | |
| 8 | − | |
| 9 | −#ifndef LEAF_DELAY_H_INCLUDED | |
| 10 | −#define LEAF_DELAY_H_INCLUDED | |
| 11 | − | |
| 12 | −#ifdef __cplusplus | |
| 13 | −extern "C" { | |
| 14 | −#endif | |
| 15 | − | |
| 16 | − //============================================================================== | |
| 17 | − | |
| 18 | −#include "leaf-math.h" | |
| 19 | −#include "leaf-mempool.h" | |
| 20 | − | |
| 21 | − //============================================================================== | |
| 22 | − | |
| 23 | − /* Non-interpolating delay, reimplemented from STK (Cook and Scavone). */ | |
| 24 | − typedef struct _tDelay | |
| 25 | − { | |
| 26 | − float gain; | |
| 27 | − float* buff; | |
| 28 | − | |
| 29 | − float lastOut, lastIn; | |
| 30 | − | |
| 31 | − uint32_t inPoint, outPoint; | |
| 32 | − | |
| 33 | − uint32_t delay, maxDelay; | |
| 34 | − | |
| 35 | − } _tDelay; | |
| 36 | − | |
| 37 | − typedef _tDelay* tDelay; | |
| 38 | − | |
| 39 | − void tDelay_init (tDelay* const, uint32_t delay, uint32_t maxDelay); | |
| 40 | − void tDelay_free (tDelay* const); | |
| 41 | − void tDelay_initToPool (tDelay* const, uint32_t delay, uint32_t maxDelay, tMempool* const); | |
| 42 | − void tDelay_freeFromPool (tDelay* const, tMempool* const); | |
| 43 | − | |
| 44 | − void tDelay_clear (tDelay* const); | |
| 45 | − int tDelay_setDelay (tDelay* const, uint32_t delay); | |
| 46 | − uint32_t tDelay_getDelay (tDelay* const); | |
| 47 | − void tDelay_tapIn (tDelay* const, float in, uint32_t tapDelay); | |
| 48 | − float tDelay_tapOut (tDelay* const, uint32_t tapDelay); | |
| 49 | − float tDelay_addTo (tDelay* const, float value, uint32_t tapDelay); | |
| 50 | − float tDelay_tick (tDelay* const, float sample); | |
| 51 | − float tDelay_getLastOut (tDelay* const); | |
| 52 | − float tDelay_getLastIn (tDelay* const); | |
| 53 | − | |
| 54 | − //============================================================================== | |
| 55 | − | |
| 56 | − /* Linearly-interpolating delay, reimplemented from STK (Cook and Scavone). */ | |
| 57 | − typedef struct _tLinearDelay | |
| 58 | − { | |
| 59 | − float gain; | |
| 60 | − float* buff; | |
| 61 | − | |
| 62 | − float lastOut, lastIn; | |
| 63 | − | |
| 64 | − uint32_t inPoint, outPoint; | |
| 65 | − | |
| 66 | − uint32_t maxDelay; | |
| 67 | − | |
| 68 | − float delay; | |
| 69 | − | |
| 70 | − float alpha, omAlpha; | |
| 71 | − | |
| 72 | − } _tLinearDelay; | |
| 73 | − | |
| 74 | − typedef _tLinearDelay* tLinearDelay; | |
| 75 | − | |
| 76 | − void tLinearDelay_init (tLinearDelay* const, float delay, uint32_t maxDelay); | |
| 77 | − void tLinearDelay_free (tLinearDelay* const); | |
| 78 | − void tLinearDelay_initToPool (tLinearDelay* const, float delay, uint32_t maxDelay, tMempool* const); | |
| 79 | − void tLinearDelay_freeFromPool(tLinearDelay* const, tMempool* const); | |
| 80 | − void tLinearDelay_clear (tLinearDelay* const dl); | |
| 81 | − int tLinearDelay_setDelay (tLinearDelay* const, float delay); | |
| 82 | − float tLinearDelay_getDelay (tLinearDelay* const); | |
| 83 | − void tLinearDelay_tapIn (tLinearDelay* const, float in, uint32_t tapDelay); | |
| 84 | − float tLinearDelay_tapOut (tLinearDelay* const, uint32_t tapDelay); | |
| 85 | − float tLinearDelay_addTo (tLinearDelay* const, float value, uint32_t tapDelay); | |
| 86 | − float tLinearDelay_tick (tLinearDelay* const, float sample); | |
| 87 | − void tLinearDelay_tickIn (tLinearDelay* const, float input); | |
| 88 | − float tLinearDelay_tickOut (tLinearDelay* const); | |
| 89 | − float tLinearDelay_getLastOut (tLinearDelay* const); | |
| 90 | − float tLinearDelay_getLastIn (tLinearDelay* const); | |
| 91 | − | |
| 92 | − | |
| 93 | − | |
| 94 | − //============================================================================== | |
| 95 | − | |
| 96 | − /* Hermite-interpolating delay, created by adapting STK linear delay with Hermite interpolation */ | |
| 97 | − typedef struct _tHermiteDelay | |
| 98 | − { | |
| 99 | − float gain; | |
| 100 | − float* buff; | |
| 101 | − | |
| 102 | − float lastOut, lastIn; | |
| 103 | − | |
| 104 | − uint32_t inPoint, outPoint; | |
| 105 | − | |
| 106 | − uint32_t maxDelay; | |
| 107 | − | |
| 108 | − float delay; | |
| 109 | − | |
| 110 | − float alpha, omAlpha; | |
| 111 | − | |
| 112 | − } _tHermiteDelay; | |
| 113 | − | |
| 114 | − typedef _tHermiteDelay* tHermiteDelay; | |
| 115 | − | |
| 116 | − void tHermiteDelay_init (tHermiteDelay* const dl, float delay, uint32_t maxDelay); | |
| 117 | − void tHermiteDelay_free (tHermiteDelay* const dl); | |
| 118 | − void tHermiteDelay_initToPool (tHermiteDelay* const dl, float delay, uint32_t maxDelay, tMempool* const mp); | |
| 119 | − void tHermiteDelay_freeFromPool (tHermiteDelay* const dl, tMempool* const mp); | |
| 120 | − void tHermiteDelay_clear (tHermiteDelay* const dl); | |
| 121 | − float tHermiteDelay_tick (tHermiteDelay* const dl, float input); | |
| 122 | − void tHermiteDelay_tickIn (tHermiteDelay* const dl, float input); | |
| 123 | − float tHermiteDelay_tickOut (tHermiteDelay* const dl); | |
| 124 | − int tHermiteDelay_setDelay (tHermiteDelay* const dl, float delay); | |
| 125 | − float tHermiteDelay_tapOut (tHermiteDelay* const dl, uint32_t tapDelay); | |
| 126 | − void tHermiteDelay_tapIn (tHermiteDelay* const dl, float value, uint32_t tapDelay); | |
| 127 | − float tHermiteDelay_addTo (tHermiteDelay* const dl, float value, uint32_t tapDelay); | |
| 128 | − float tHermiteDelay_getDelay (tHermiteDelay* const dl); | |
| 129 | − float tHermiteDelay_getLastOut (tHermiteDelay* const dl); | |
| 130 | − float tHermiteDelay_getLastIn (tHermiteDelay* const dl); | |
| 131 | − void tHermiteDelay_setGain (tHermiteDelay* const dl, float gain); | |
| 132 | − float tHermiteDelay_getGain (tHermiteDelay* const dl); | |
| 133 | − | |
| 134 | − | |
| 135 | − //============================================================================== | |
| 136 | − | |
| 137 | − /* Allpass-interpolating delay, reimplemented from STK (Cook and Scavone). */ | |
| 138 | − typedef struct _tAllpassDelay | |
| 139 | − { | |
| 140 | − float gain; | |
| 141 | − float* buff; | |
| 142 | − | |
| 143 | − float lastOut, lastIn; | |
| 144 | − | |
| 145 | − uint32_t inPoint, outPoint; | |
| 146 | − | |
| 147 | − uint32_t maxDelay; | |
| 148 | − | |
| 149 | − float delay; | |
| 150 | − | |
| 151 | − float alpha, omAlpha, coeff; | |
| 152 | − | |
| 153 | − float apInput; | |
| 154 | − | |
| 155 | − } _tAllpassDelay; | |
| 156 | − | |
| 157 | − typedef _tAllpassDelay* tAllpassDelay; | |
| 158 | − | |
| 159 | − void tAllpassDelay_init (tAllpassDelay* const, float delay, uint32_t maxDelay); | |
| 160 | − void tAllpassDelay_free (tAllpassDelay* const); | |
| 161 | − void tAllpassDelay_initToPool (tAllpassDelay* const, float delay, uint32_t maxDelay, tMempool* const); | |
| 162 | − void tAllpassDelay_freeFromPool(tAllpassDelay* const, tMempool* const); | |
| 163 | − | |
| 164 | − void tAllpassDelay_clear (tAllpassDelay* const); | |
| 165 | − int tAllpassDelay_setDelay (tAllpassDelay* const, float delay); | |
| 166 | − float tAllpassDelay_getDelay (tAllpassDelay* const); | |
| 167 | − void tAllpassDelay_tapIn (tAllpassDelay* const, float in, uint32_t tapDelay); | |
| 168 | − float tAllpassDelay_tapOut (tAllpassDelay* const, uint32_t tapDelay); | |
| 169 | − float tAllpassDelay_addTo (tAllpassDelay* const, float value, uint32_t tapDelay); | |
| 170 | − float tAllpassDelay_tick (tAllpassDelay* const, float sample); | |
| 171 | − float tAllpassDelay_getLastOut (tAllpassDelay* const); | |
| 172 | − float tAllpassDelay_getLastIn (tAllpassDelay* const); | |
| 173 | − | |
| 174 | − //============================================================================== | |
| 175 | − | |
| 176 | − /* Linear interpolating delay with fixed read and write pointers, variable rate. */ | |
| 177 | − typedef struct _tTapeDelay | |
| 178 | − { | |
| 179 | − float gain; | |
| 180 | − float* buff; | |
| 181 | − | |
| 182 | − float lastOut, lastIn; | |
| 183 | − | |
| 184 | − uint32_t inPoint; | |
| 185 | − | |
| 186 | − uint32_t maxDelay; | |
| 187 | − | |
| 188 | − float delay, inc, idx; | |
| 189 | − | |
| 190 | − float apInput; | |
| 191 | − | |
| 192 | − } _tTapeDelay; | |
| 193 | − | |
| 194 | − typedef _tTapeDelay* tTapeDelay; | |
| 195 | − | |
| 196 | − void tTapeDelay_init (tTapeDelay* const, float delay, uint32_t maxDelay); | |
| 197 | − void tTapeDelay_free (tTapeDelay* const); | |
| 198 | − void tTapeDelay_initToPool (tTapeDelay* const, float delay, uint32_t maxDelay, tMempool* const); | |
| 199 | − void tTapeDelay_freeFromPool(tTapeDelay* const, tMempool* const); | |
| 200 | − | |
| 201 | − void tTapeDelay_clear (tTapeDelay* const); | |
| 202 | − void tTapeDelay_setDelay (tTapeDelay* const, float delay); | |
| 203 | − float tTapeDelay_getDelay (tTapeDelay* const); | |
| 204 | − void tTapeDelay_tapIn (tTapeDelay* const, float in, uint32_t tapDelay); | |
| 205 | − float tTapeDelay_tapOut (tTapeDelay* const d, float tapDelay); | |
| 206 | − float tTapeDelay_addTo (tTapeDelay* const, float value, uint32_t tapDelay); | |
| 207 | − float tTapeDelay_tick (tTapeDelay* const, float sample); | |
| 208 | − void tTapeDelay_incrementInPoint(tTapeDelay* const dl); | |
| 209 | − float tTapeDelay_getLastOut (tTapeDelay* const); | |
| 210 | − float tTapeDelay_getLastIn (tTapeDelay* const); | |
| 211 | − | |
| 212 | − //============================================================================== | |
| 213 | − | |
| 214 | −#ifdef __cplusplus | |
| 215 | −} | |
| 216 | −#endif | |
| 217 | − | |
| 218 | −#endif // LEAF_DELAY_H_INCLUDED | |
| 219 | − | |
| 220 | −//============================================================================== | |
| 221 | − | |
| @@ -1,148 +0,0 @@ | ||
| 1 | −/*============================================================================== | |
| 2 | − | |
| 3 | − leaf-distortion.h | |
| 4 | − Created: 25 Oct 2019 10:23:28am | |
| 5 | − Author: Matthew Wang | |
| 6 | − | |
| 7 | − ==============================================================================*/ | |
| 8 | − | |
| 9 | −#ifndef LEAF_DISTORTION_H_INCLUDED | |
| 10 | −#define LEAF_DISTORTION_H_INCLUDED | |
| 11 | − | |
| 12 | −#ifdef __cplusplus | |
| 13 | −extern "C" { | |
| 14 | −#endif | |
| 15 | − | |
| 16 | − //============================================================================== | |
| 17 | − | |
| 18 | −#include "leaf-global.h" | |
| 19 | −#include "leaf-mempool.h" | |
| 20 | −#include "leaf-math.h" | |
| 21 | − | |
| 22 | − //============================================================================== | |
| 23 | − | |
| 24 | − typedef struct _tSampleReducer | |
| 25 | − { | |
| 26 | − float invRatio; | |
| 27 | − float hold; | |
| 28 | − uint32_t count; | |
| 29 | − } _tSampleReducer; | |
| 30 | − | |
| 31 | − typedef _tSampleReducer* tSampleReducer; | |
| 32 | − | |
| 33 | − void tSampleReducer_init (tSampleReducer* const); | |
| 34 | − void tSampleReducer_free (tSampleReducer* const); | |
| 35 | − void tSampleReducer_initToPool (tSampleReducer* const, tMempool* const); | |
| 36 | − void tSampleReducer_freeFromPool (tSampleReducer* const, tMempool* const); | |
| 37 | − | |
| 38 | − float tSampleReducer_tick (tSampleReducer* const, float input); | |
| 39 | − | |
| 40 | − // sampling ratio | |
| 41 | − void tSampleReducer_setRatio (tSampleReducer* const, float ratio); | |
| 42 | − | |
| 43 | − //============================================================================== | |
| 44 | − | |
| 45 | − typedef struct _tOversampler | |
| 46 | − { | |
| 47 | − int ratio; | |
| 48 | − float* pCoeffs; | |
| 49 | − float* upState; | |
| 50 | − float* downState; | |
| 51 | − int numTaps; | |
| 52 | − int phaseLength; | |
| 53 | − } _tOversampler; | |
| 54 | − | |
| 55 | − typedef _tOversampler* tOversampler; | |
| 56 | − | |
| 57 | − void tOversampler_init (tOversampler* const, int order, oBool extraQuality); | |
| 58 | − void tOversampler_free (tOversampler* const); | |
| 59 | − void tOversampler_initToPool (tOversampler* const, int order, oBool extraQuality, tMempool* const); | |
| 60 | − void tOversampler_freeFromPool (tOversampler* const, tMempool* const); | |
| 61 | − | |
| 62 | − void tOversampler_upsample (tOversampler* const, float input, float* output); | |
| 63 | − float tOversampler_downsample (tOversampler* const os, float* input); | |
| 64 | − float tOversampler_tick (tOversampler* const, float input, float (*effectTick)(float)); | |
| 65 | − int tOversampler_getLatency (tOversampler* const os); | |
| 66 | − | |
| 67 | − //============================================================================== | |
| 68 | − | |
| 69 | − /* tLockhartWavefolder */ | |
| 70 | − | |
| 71 | − typedef struct _tLockhartWavefolder | |
| 72 | − { | |
| 73 | − double Ln1; | |
| 74 | − double Fn1; | |
| 75 | − float xn1; | |
| 76 | − | |
| 77 | − double RL; | |
| 78 | − double R; | |
| 79 | − double VT; | |
| 80 | − double Is; | |
| 81 | − | |
| 82 | − double a; | |
| 83 | − double b; | |
| 84 | − double d; | |
| 85 | − | |
| 86 | − // Antialiasing error threshold | |
| 87 | − double thresh; | |
| 88 | − double half_a; | |
| 89 | − double longthing; | |
| 90 | − | |
| 91 | − } _tLockhartWavefolder; | |
| 92 | − | |
| 93 | − typedef _tLockhartWavefolder* tLockhartWavefolder; | |
| 94 | − | |
| 95 | − void tLockhartWavefolder_init (tLockhartWavefolder* const); | |
| 96 | − void tLockhartWavefolder_free (tLockhartWavefolder* const); | |
| 97 | − void tLockhartWavefolder_initToPool (tLockhartWavefolder* const, tMempool* const); | |
| 98 | − void tLockhartWavefolder_freeFromPool (tLockhartWavefolder* const, tMempool* const); | |
| 99 | − | |
| 100 | − float tLockhartWavefolder_tick (tLockhartWavefolder* const, float samp); | |
| 101 | − | |
| 102 | − //============================================================================== | |
| 103 | − | |
| 104 | − typedef struct _tCrusher | |
| 105 | − { | |
| 106 | − float srr; | |
| 107 | − float mult, div; | |
| 108 | − float rnd; | |
| 109 | − | |
| 110 | − uint32_t op; //which bitwise operation (0-7) | |
| 111 | − | |
| 112 | − float gain; | |
| 113 | − tSampleReducer sReducer; | |
| 114 | − | |
| 115 | − } _tCrusher; | |
| 116 | − | |
| 117 | − typedef _tCrusher* tCrusher; | |
| 118 | − | |
| 119 | − void tCrusher_init (tCrusher* const); | |
| 120 | − void tCrusher_free (tCrusher* const); | |
| 121 | − void tCrusher_initToPool (tCrusher* const, tMempool* const); | |
| 122 | − void tCrusher_freeFromPool (tCrusher* const, tMempool* const); | |
| 123 | − | |
| 124 | − float tCrusher_tick (tCrusher* const, float input); | |
| 125 | − | |
| 126 | − // 0.0 - 1.0 | |
| 127 | − void tCrusher_setOperation (tCrusher* const, float op); | |
| 128 | − | |
| 129 | − // 0.0 - 1.0 | |
| 130 | − void tCrusher_setQuality (tCrusher* const, float val); | |
| 131 | − | |
| 132 | − // what division to round to | |
| 133 | − void tCrusher_setRound (tCrusher* const, float rnd); | |
| 134 | − | |
| 135 | − // sampling ratio | |
| 136 | − void tCrusher_setSamplingRatio (tCrusher* const, float ratio); | |
| 137 | − | |
| 138 | − //============================================================================== | |
| 139 | − | |
| 140 | −#ifdef __cplusplus | |
| 141 | −} | |
| 142 | −#endif | |
| 143 | − | |
| 144 | −#endif // LEAF_DISTORTION_H_INCLUDED | |
| 145 | − | |
| 146 | −//============================================================================== | |
| 147 | − | |
| 148 | − | |
| @@ -1,90 +0,0 @@ | ||
| 1 | −/*============================================================================== | |
| 2 | − | |
| 3 | − leaf-dynamics.h | |
| 4 | − Created: 30 Nov 2018 11:57:05am | |
| 5 | − Author: airship | |
| 6 | − | |
| 7 | − ==============================================================================*/ | |
| 8 | − | |
| 9 | −#ifndef LEAF_DYNAMICS_H_INCLUDED | |
| 10 | −#define LEAF_DYNAMICS_H_INCLUDED | |
| 11 | − | |
| 12 | − | |
| 13 | −#ifdef __cplusplus | |
| 14 | −extern "C" { | |
| 15 | −#endif | |
| 16 | − | |
| 17 | − //============================================================================== | |
| 18 | − | |
| 19 | −#include "leaf-global.h" | |
| 20 | −#include "leaf-math.h" | |
| 21 | −#include "leaf-mempool.h" | |
| 22 | −#include "leaf-analysis.h" | |
| 23 | − | |
| 24 | − //============================================================================== | |
| 25 | − | |
| 26 | − // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | |
| 27 | − | |
| 28 | − /* Compressor */ | |
| 29 | − typedef struct _tCompressor | |
| 30 | − { | |
| 31 | − float tauAttack, tauRelease; | |
| 32 | − float T, R, W, M; // Threshold, compression Ratio, decibel Width of knee transition, decibel Make-up gain | |
| 33 | − | |
| 34 | − float x_G[2], y_G[2], x_T[2], y_T[2]; | |
| 35 | − | |
| 36 | − oBool isActive; | |
| 37 | − | |
| 38 | − } _tCompressor; | |
| 39 | − | |
| 40 | − typedef _tCompressor* tCompressor; | |
| 41 | − | |
| 42 | − void tCompressor_init (tCompressor* const); | |
| 43 | − void tCompressor_free (tCompressor* const); | |
| 44 | − void tCompressor_initToPool (tCompressor* const, tMempool* const); | |
| 45 | − void tCompressor_freeFromPool(tCompressor* const, tMempool* const); | |
| 46 | − | |
| 47 | − float tCompressor_tick (tCompressor* const, float input); | |
| 48 | − | |
| 49 | − /// | |
| 50 | − /* Feedback leveller */ | |
| 51 | − // An auto VCA that you put into a feedback circuit to make it stay at the same level. | |
| 52 | − // It can enforce level bidirectionally (amplifying and attenuating as needed) or | |
| 53 | − // just attenutating. The former option allows for infinite sustain strings, for example, while | |
| 54 | − // The latter option allows for decaying strings, which can never exceed | |
| 55 | − // a specific level. | |
| 56 | − | |
| 57 | − typedef struct _tFeedbackLeveler { | |
| 58 | − float targetLevel; // target power level | |
| 59 | − float strength; // how strongly level difference affects the VCA | |
| 60 | − int mode; // 0 for upwards limiting only, 1 for biderctional limiting | |
| 61 | − float curr; | |
| 62 | − tPowerFollower pwrFlw; // internal power follower needed for level tracking | |
| 63 | − | |
| 64 | − } _tFeedbackLeveler; | |
| 65 | − | |
| 66 | − typedef _tFeedbackLeveler* tFeedbackLeveler; | |
| 67 | − | |
| 68 | − void tFeedbackLeveler_init (tFeedbackLeveler* const, float targetLevel, float factor, float strength, int mode); | |
| 69 | − void tFeedbackLeveler_free (tFeedbackLeveler* const); | |
| 70 | − void tFeedbackLeveler_initToPool (tFeedbackLeveler* const, float targetLevel, float factor, float strength, int mode, tMempool* const); | |
| 71 | − void tFeedbackLeveler_freeFromPool (tFeedbackLeveler* const, tMempool* const); | |
| 72 | − | |
| 73 | − float tFeedbackLeveler_tick (tFeedbackLeveler* const, float input); | |
| 74 | − float tFeedbackLeveler_sample (tFeedbackLeveler* const); | |
| 75 | − void tFeedbackLeveler_setTargetLevel (tFeedbackLeveler* const, float TargetLevel); | |
| 76 | − void tFeedbackLeveler_setFactor (tFeedbackLeveler* const, float factor); | |
| 77 | − void tFeedbackLeveler_setMode (tFeedbackLeveler* const, int mode); // 0 for upwards limiting only, 1 for biderctional limiting | |
| 78 | − void tFeedbackLeveler_setStrength (tFeedbackLeveler* const, float strength); | |
| 79 | − | |
| 80 | − | |
| 81 | − //============================================================================== | |
| 82 | − | |
| 83 | −#ifdef __cplusplus | |
| 84 | −} | |
| 85 | −#endif | |
| 86 | − | |
| 87 | −#endif // LEAF_DYNAMICS_H_INCLUDED | |
| 88 | − | |
| 89 | −//============================================================================== | |
| 90 | − | |
| @@ -1,316 +0,0 @@ | ||
| 1 | −/*============================================================================== | |
| 2 | − | |
| 3 | − leaf-effects.h | |
| 4 | − Created: 20 Jan 2017 12:01:54pm | |
| 5 | − Author: Michael R Mulshine | |
| 6 | − | |
| 7 | − ==============================================================================*/ | |
| 8 | − | |
| 9 | −#ifndef LEAF_EFFECTS_H_INCLUDED | |
| 10 | −#define LEAF_EFFECTS_H_INCLUDED | |
| 11 | − | |
| 12 | −#ifdef __cplusplus | |
| 13 | −extern "C" { | |
| 14 | −#endif | |
| 15 | − | |
| 16 | − //============================================================================== | |
| 17 | −#include "leaf-global.h" | |
| 18 | −#include "leaf-math.h" | |
| 19 | −#include "leaf-mempool.h" | |
| 20 | −#include "leaf-dynamics.h" | |
| 21 | −#include "leaf-analysis.h" | |
| 22 | −#include "leaf-envelopes.h" | |
| 23 | − | |
| 24 | − //============================================================================== | |
| 25 | − | |
| 26 | − /* tTalkbox */ | |
| 27 | −#define NUM_TALKBOX_PARAM 4 | |
| 28 | − | |
| 29 | − typedef struct _tTalkbox | |
| 30 | − { | |
| 31 | − float param[NUM_TALKBOX_PARAM]; | |
| 32 | − | |
| 33 | − int bufsize; | |
| 34 | − float* car0; | |
| 35 | − float* car1; | |
| 36 | − float* window; | |
| 37 | − float* buf0; | |
| 38 | − float* buf1; | |
| 39 | − | |
| 40 | − float emphasis; | |
| 41 | − int32_t K, N, O, pos; | |
| 42 | − float wet, dry, FX; | |
| 43 | − float d0, d1, d2, d3, d4; | |
| 44 | − float u0, u1, u2, u3, u4; | |
| 45 | − | |
| 46 | − } _tTalkbox; | |
| 47 | − | |
| 48 | − typedef _tTalkbox* tTalkbox; | |
| 49 | − | |
| 50 | − void tTalkbox_init (tTalkbox* const, int bufsize); | |
| 51 | − void tTalkbox_free (tTalkbox* const); | |
| 52 | − void tTalkbox_initToPool (tTalkbox* const, int bufsize, tMempool* const); | |
| 53 | − void tTalkbox_freeFromPool (tTalkbox* const, tMempool* const); | |
| 54 | − | |
| 55 | − float tTalkbox_tick (tTalkbox* const, float synth, float voice); | |
| 56 | − void tTalkbox_update (tTalkbox* const); | |
| 57 | − void tTalkbox_suspend (tTalkbox* const); | |
| 58 | − void tTalkbox_lpcDurbin (float *r, int p, float *k, float *g); | |
| 59 | − void tTalkbox_lpc (float *buf, float *car, int32_t n, int32_t o); | |
| 60 | − void tTalkbox_setQuality (tTalkbox* const, float quality); | |
| 61 | − | |
| 62 | − //============================================================================== | |
| 63 | − | |
| 64 | − /* tVocoder */ | |
| 65 | −#define NUM_VOCODER_PARAM 8 | |
| 66 | −#define NBANDS 16 | |
| 67 | − | |
| 68 | − typedef struct _tVocoder | |
| 69 | − { | |
| 70 | − float param[NUM_VOCODER_PARAM]; | |
| 71 | − | |
| 72 | − float gain; //output level | |
| 73 | − float thru, high; //hf thru | |
| 74 | − float kout; //downsampled output | |
| 75 | − int32_t kval; //downsample counter | |
| 76 | − int32_t nbnd; //number of bands | |
| 77 | − | |
| 78 | − //filter coeffs and buffers - seems it's faster to leave this global than make local copy | |
| 79 | − float f[NBANDS][13]; //[0-8][0 1 2 | 0 1 2 3 | 0 1 2 3 | val rate] | |
| 80 | − | |
| 81 | − } _tVocoder; | |
| 82 | − | |
| 83 | − typedef _tVocoder* tVocoder; | |
| 84 | − | |
| 85 | − void tVocoder_init (tVocoder* const); | |
| 86 | − void tVocoder_free (tVocoder* const); | |
| 87 | − void tVocoder_initToPool (tVocoder* const, tMempool* const); | |
| 88 | − void tVocoder_freeFromPool (tVocoder* const, tMempool* const); | |
| 89 | − | |
| 90 | − float tVocoder_tick (tVocoder* const, float synth, float voice); | |
| 91 | − void tVocoder_update (tVocoder* const); | |
| 92 | − void tVocoder_suspend (tVocoder* const); | |
| 93 | − | |
| 94 | − //============================================================================== | |
| 95 | − | |
| 96 | − | |
| 97 | − //============================================================================== | |
| 98 | − | |
| 99 | − // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | |
| 100 | − | |
| 101 | − /* tSOLAD : pitch shifting algorithm that underlies tRetune etc */ | |
| 102 | − // from Katja Vetters http://www.katjaas.nl/pitchshiftlowlatency/pitchshiftlowlatency.html | |
| 103 | −#define LOOPSIZE (2048*2) // (4096*2) // loop size must be power of two | |
| 104 | −#define LOOPMASK (LOOPSIZE - 1) | |
| 105 | −#define PITCHFACTORDEFAULT 1.0f | |
| 106 | −#define INITPERIOD 64.0f | |
| 107 | −#define MAXPERIOD (float)((LOOPSIZE - w->blocksize) * 0.8f) | |
| 108 | −#define MINPERIOD 8.0f | |
| 109 | − | |
| 110 | − typedef struct _tSOLAD | |
| 111 | − { | |
| 112 | − uint16_t timeindex; // current reference time, write index | |
| 113 | − uint16_t blocksize; // signal input / output block size | |
| 114 | − float pitchfactor; // pitch factor between 0.25 and 4 | |
| 115 | − float readlag; // read pointer's lag behind write pointer | |
| 116 | − float period; // period length in input signal | |
| 117 | − float jump; // read pointer jump length and direction | |
| 118 | − float xfadelength; // crossfade length expressed at input sample rate | |
| 119 | − float xfadevalue; // crossfade phase and value | |
| 120 | − | |
| 121 | − float* delaybuf; | |
| 122 | − | |
| 123 | − } _tSOLAD; | |
| 124 | − | |
| 125 | − typedef _tSOLAD* tSOLAD; | |
| 126 | − | |
| 127 | − void tSOLAD_init (tSOLAD* const); | |
| 128 | − void tSOLAD_free (tSOLAD* const); | |
| 129 | − void tSOLAD_initToPool (tSOLAD* const, tMempool* const); | |
| 130 | − void tSOLAD_freeFromPool (tSOLAD* const, tMempool* const); | |
| 131 | − | |
| 132 | − // send one block of input samples, receive one block of output samples | |
| 133 | − void tSOLAD_ioSamples (tSOLAD *w, float* in, float* out, int blocksize); | |
| 134 | − // set periodicity analysis data | |
| 135 | − void tSOLAD_setPeriod (tSOLAD *w, float period); | |
| 136 | − // set pitch factor between 0.25 and 4 | |
| 137 | − void tSOLAD_setPitchFactor (tSOLAD *w, float pitchfactor); | |
| 138 | − // force readpointer lag | |
| 139 | − void tSOLAD_setReadLag (tSOLAD *w, float readlag); | |
| 140 | − // reset state variables | |
| 141 | − void tSOLAD_resetState (tSOLAD *w); | |
| 142 | − | |
| 143 | − // Pitch shift | |
| 144 | − typedef struct _tPitchShift | |
| 145 | − { | |
| 146 | − tSOLAD sola; | |
| 147 | − tHighpass hp; | |
| 148 | − tPeriodDetection* p; | |
| 149 | − | |
| 150 | − float* outBuffer; | |
| 151 | − int frameSize; | |
| 152 | − int bufSize; | |
| 153 | − | |
| 154 | − int framesPerBuffer; | |
| 155 | − int curBlock; | |
| 156 | − int lastBlock; | |
| 157 | − int index; | |
| 158 | − | |
| 159 | − float pitchFactor; | |
| 160 | − float timeConstant; | |
| 161 | − float radius; | |
| 162 | − } _tPitchShift; | |
| 163 | − | |
| 164 | − typedef _tPitchShift* tPitchShift; | |
| 165 | − | |
| 166 | − void tPitchShift_init (tPitchShift* const, tPeriodDetection* const, float* out, int bufSize); | |
| 167 | − void tPitchShift_free (tPitchShift* const); | |
| 168 | − void tPitchShift_initToPool (tPitchShift* const, tPeriodDetection* const, float* out, int bufSize, tMempool* const); | |
| 169 | − void tPitchShift_freeFromPool (tPitchShift* const, tMempool* const); | |
| 170 | − | |
| 171 | − float tPitchShift_shift (tPitchShift* const); | |
| 172 | − float tPitchShift_shiftToFunc (tPitchShift* const, float (*fun)(float)); | |
| 173 | − float tPitchShift_shiftToFreq (tPitchShift* const, float freq); | |
| 174 | − void tPitchShift_setPitchFactor (tPitchShift* const, float pf); | |
| 175 | − | |
| 176 | − // Retune | |
| 177 | − typedef struct _tRetune | |
| 178 | − { | |
| 179 | − tPeriodDetection pd; | |
| 180 | − tPitchShift* ps; | |
| 181 | − | |
| 182 | − float* inBuffer; | |
| 183 | − float** outBuffers; | |
| 184 | − float* tickOutput; | |
| 185 | − int frameSize; | |
| 186 | − int bufSize; | |
| 187 | − | |
| 188 | − uint16_t hopSize; | |
| 189 | − uint16_t windowSize; | |
| 190 | − uint8_t fba; | |
| 191 | − | |
| 192 | − float* pitchFactor; | |
| 193 | − float timeConstant; | |
| 194 | − float radius; | |
| 195 | − | |
| 196 | − float inputPeriod; | |
| 197 | − | |
| 198 | − int numVoices; | |
| 199 | − } _tRetune; | |
| 200 | − | |
| 201 | − typedef _tRetune* tRetune; | |
| 202 | − | |
| 203 | − void tRetune_init (tRetune* const, int numVoices, int bufSize, int frameSize); | |
| 204 | − void tRetune_free (tRetune* const); | |
| 205 | − void tRetune_initToPool (tRetune* const, int numVoices, int bufSize, int frameSize, tMempool* const); | |
| 206 | − void tRetune_freeFromPool (tRetune* const, tMempool* const); | |
| 207 | − | |
| 208 | − float* tRetune_tick (tRetune* const, float sample); | |
| 209 | − void tRetune_setNumVoices (tRetune* const, int numVoices); | |
| 210 | − void tRetune_setPitchFactors (tRetune* const, float pf); | |
| 211 | − void tRetune_setPitchFactor (tRetune* const, float pf, int voice); | |
| 212 | − void tRetune_setTimeConstant (tRetune* const, float tc); | |
| 213 | − void tRetune_setHopSize (tRetune* const, int hs); | |
| 214 | − void tRetune_setWindowSize (tRetune* const, int ws); | |
| 215 | − void tRetune_setFidelityThreshold(tRetune* const, float threshold); | |
| 216 | − float tRetune_getInputPeriod (tRetune* const); | |
| 217 | − float tRetune_getInputFreq (tRetune* const); | |
| 218 | − | |
| 219 | − // Autotune | |
| 220 | − typedef struct _tAutotune | |
| 221 | − { | |
| 222 | − tPeriodDetection pd; | |
| 223 | − tPitchShift* ps; | |
| 224 | − | |
| 225 | − float* inBuffer; | |
| 226 | − float** outBuffers; | |
| 227 | − float* tickOutput; | |
| 228 | − int frameSize; | |
| 229 | − int bufSize; | |
| 230 | − | |
| 231 | − uint16_t hopSize; | |
| 232 | − uint16_t windowSize; | |
| 233 | − uint8_t fba; | |
| 234 | − | |
| 235 | − float* freq; | |
| 236 | − float timeConstant; | |
| 237 | − float radius; | |
| 238 | − | |
| 239 | − float inputPeriod; | |
| 240 | − | |
| 241 | − int numVoices; | |
| 242 | − } _tAutotune; | |
| 243 | − | |
| 244 | − typedef _tAutotune* tAutotune; | |
| 245 | − | |
| 246 | − void tAutotune_init (tAutotune* const, int numVoices, int bufSize, int frameSize); | |
| 247 | − void tAutotune_free (tAutotune* const); | |
| 248 | − void tAutotune_initToPool (tAutotune* const, int numVoices, int bufSize, int frameSize, tMempool* const); | |
| 249 | − void tAutotune_freeFromPool (tAutotune* const, tMempool* const); | |
| 250 | − | |
| 251 | − float* tAutotune_tick (tAutotune* const, float sample); | |
| 252 | − void tAutotune_setNumVoices (tAutotune* const, int numVoices); | |
| 253 | − void tAutotune_setFreqs (tAutotune* const, float f); | |
| 254 | − void tAutotune_setFreq (tAutotune* const, float f, int voice); | |
| 255 | − void tAutotune_setTimeConstant (tAutotune* const, float tc); | |
| 256 | − void tAutotune_setHopSize (tAutotune* const, int hs); | |
| 257 | − void tAutotune_setWindowSize (tAutotune* const, int ws); | |
| 258 | − void tAutotune_setFidelityThreshold (tAutotune* const, float threshold); | |
| 259 | − float tAutotune_getInputPeriod (tAutotune* const); | |
| 260 | − float tAutotune_getInputFreq (tAutotune* const); | |
| 261 | − | |
| 262 | − //============================================================================== | |
| 263 | − | |
| 264 | − | |
| 265 | − typedef struct _tFormantShifter | |
| 266 | − { | |
| 267 | − int ford; | |
| 268 | − float falph; | |
| 269 | − float flamb; | |
| 270 | − float* fk; | |
| 271 | − float* fb; | |
| 272 | − float* fc; | |
| 273 | − float* frb; | |
| 274 | − float* frc; | |
| 275 | − float* fsig; | |
| 276 | − float* fsmooth; | |
| 277 | − float fhp; | |
| 278 | − float flp; | |
| 279 | − float flpa; | |
| 280 | − float* fbuff; | |
| 281 | − float* ftvec; | |
| 282 | − float fmute; | |
| 283 | − float fmutealph; | |
| 284 | − unsigned int cbi; | |
| 285 | − float shiftFactor; | |
| 286 | − float intensity, invIntensity; | |
| 287 | − tHighpass hp; | |
| 288 | − tHighpass hp2; | |
| 289 | − tFeedbackLeveler fbl1; | |
| 290 | − tFeedbackLeveler fbl2; | |
| 291 | − | |
| 292 | − } _tFormantShifter; | |
| 293 | − | |
| 294 | − typedef _tFormantShifter* tFormantShifter; | |
| 295 | − | |
| 296 | − void tFormantShifter_init (tFormantShifter* const, int order); | |
| 297 | − void tFormantShifter_free (tFormantShifter* const); | |
| 298 | − void tFormantShifter_initToPool (tFormantShifter* const, int order, tMempool* const); | |
| 299 | − void tFormantShifter_freeFromPool (tFormantShifter* const, tMempool* const); | |
| 300 | − | |
| 301 | − float tFormantShifter_tick (tFormantShifter* const, float input); | |
| 302 | − float tFormantShifter_remove (tFormantShifter* const, float input); | |
| 303 | − float tFormantShifter_add (tFormantShifter* const, float input); | |
| 304 | − void tFormantShifter_ioSamples (tFormantShifter* const, float* in, float* out, int size, float fwarp); | |
| 305 | − void tFormantShifter_setShiftFactor (tFormantShifter* const, float shiftFactor); | |
| 306 | − void tFormantShifter_setIntensity (tFormantShifter* const, float intensity); | |
| 307 | − | |
| 308 | − //============================================================================== | |
| 309 | − | |
| 310 | −#ifdef __cplusplus | |
| 311 | −} | |
| 312 | −#endif | |
| 313 | − | |
| 314 | −#endif // LEAF_EFFECTS_H_INCLUDED | |
| 315 | − | |
| 316 | −//============================================================================== | |
| @@ -1,95 +0,0 @@ | ||
| 1 | −/* | |
| 2 | − * leaf-electrical.h | |
| 3 | − * | |
| 4 | − * Created on: Sep 25, 2019 | |
| 5 | − * Author: jeffsnyder | |
| 6 | − */ | |
| 7 | − | |
| 8 | −#ifndef LEAF_INC_LEAF_ELECTRICAL_H_ | |
| 9 | −#define LEAF_INC_LEAF_ELECTRICAL_H_ | |
| 10 | − | |
| 11 | −#ifdef __cplusplus | |
| 12 | −extern "C" { | |
| 13 | −#endif | |
| 14 | − | |
| 15 | − //============================================================================== | |
| 16 | − | |
| 17 | −#include "leaf-global.h" | |
| 18 | −#include "leaf-math.h" | |
| 19 | −#include "leaf-mempool.h" | |
| 20 | − | |
| 21 | − //============================================================================== | |
| 22 | − | |
| 23 | − typedef enum WDFComponentType | |
| 24 | − { | |
| 25 | − SeriesAdaptor = 0, | |
| 26 | − ParallelAdaptor, | |
| 27 | − Resistor, | |
| 28 | − Capacitor, | |
| 29 | − Inductor, | |
| 30 | − Inverter, | |
| 31 | − ResistiveSource, | |
| 32 | − IdealSource, | |
| 33 | − Diode, | |
| 34 | − DiodePair, | |
| 35 | − RootNil, | |
| 36 | − WDFComponentNil | |
| 37 | − } WDFComponentType; | |
| 38 | − | |
| 39 | − typedef struct _tWDF _tWDF; // needed to allow tWDF pointers in struct | |
| 40 | − typedef _tWDF* tWDF; | |
| 41 | − struct _tWDF | |
| 42 | − { | |
| 43 | − WDFComponentType type; | |
| 44 | − float port_resistance_up; | |
| 45 | − float port_resistance_left; | |
| 46 | − float port_resistance_right; | |
| 47 | − float port_conductance_up; | |
| 48 | − float port_conductance_left; | |
| 49 | − float port_conductance_right; | |
| 50 | − float incident_wave_up; | |
| 51 | − float incident_wave_left; | |
| 52 | − float incident_wave_right; | |
| 53 | − float reflected_wave_up; | |
| 54 | − float reflected_wave_left; | |
| 55 | − float reflected_wave_right; | |
| 56 | − float gamma_zero; | |
| 57 | − float sample_rate; | |
| 58 | − float value; | |
| 59 | − tWDF* child_left; | |
| 60 | − tWDF* child_right; | |
| 61 | − float (*get_port_resistance)(tWDF* const); | |
| 62 | − float (*get_reflected_wave_up)(tWDF* const, float); | |
| 63 | − float (*get_reflected_wave_down)(tWDF* const, float, float); | |
| 64 | − void (*set_incident_wave)(tWDF* const, float, float); | |
| 65 | − }; | |
| 66 | − | |
| 67 | − //WDF Linear Components | |
| 68 | − void tWDF_init (tWDF* const, WDFComponentType type, float value, tWDF* const rL, tWDF* const rR); | |
| 69 | − void tWDF_free (tWDF* const); | |
| 70 | − void tWDF_initToPool (tWDF* const, WDFComponentType type, float value, tWDF* const rL, tWDF* const rR, tMempool* const); | |
| 71 | − void tWDF_freeFromPool (tWDF* const, tMempool* const); | |
| 72 | − | |
| 73 | − float tWDF_tick (tWDF* const, float sample, tWDF* const outputPoint, uint8_t paramsChanged); | |
| 74 | − | |
| 75 | − void tWDF_setValue (tWDF* const, float value); | |
| 76 | − void tWDF_setSampleRate (tWDF* const, float sample_rate); | |
| 77 | − uint8_t tWDF_isLeaf (tWDF* const); | |
| 78 | − | |
| 79 | − float tWDF_getPortResistance (tWDF* const); | |
| 80 | − float tWDF_getReflectedWaveUp (tWDF* const, float input); //for tree, only uses input for resistive source | |
| 81 | − float tWDF_getReflectedWaveDown (tWDF* const, float input, float incident_wave); //for roots | |
| 82 | − void tWDF_setIncidentWave (tWDF* const, float incident_wave, float input); | |
| 83 | − | |
| 84 | − float tWDF_getVoltage (tWDF* const); | |
| 85 | − float tWDF_getCurrent (tWDF* const); | |
| 86 | − | |
| 87 | − | |
| 88 | − //============================================================================== | |
| 89 | − | |
| 90 | −#ifdef __cplusplus | |
| 91 | −} | |
| 92 | −#endif | |
| 93 | − | |
| 94 | −#endif /* LEAF_INC_LEAF_ELECTRICAL_H_ */ | |
| 95 | − | |
| @@ -1,154 +0,0 @@ | ||
| 1 | −/* | |
| 2 | − ============================================================================== | |
| 3 | − | |
| 4 | − leaf-envelopes.h | |
| 5 | − Created: 20 Jan 2017 12:02:17pm | |
| 6 | − Author: Michael R Mulshine | |
| 7 | − | |
| 8 | − ============================================================================== | |
| 9 | − */ | |
| 10 | − | |
| 11 | −#ifndef LEAF_ENVELOPES_H_INCLUDED | |
| 12 | −#define LEAF_ENVELOPES_H_INCLUDED | |
| 13 | − | |
| 14 | −#ifdef __cplusplus | |
| 15 | −extern "C" { | |
| 16 | −#endif | |
| 17 | − | |
| 18 | − // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | |
| 19 | − | |
| 20 | −#include "leaf-math.h" | |
| 21 | −#include "leaf-mempool.h" | |
| 22 | −#include "leaf-filters.h" | |
| 23 | −#include "leaf-delay.h" | |
| 24 | − | |
| 25 | − // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | |
| 26 | − | |
| 27 | − /* Attack-Decay envelope */ | |
| 28 | − typedef struct _tEnvelope { | |
| 29 | − | |
| 30 | − const float *exp_buff; | |
| 31 | − const float *inc_buff; | |
| 32 | − uint32_t buff_size; | |
| 33 | − | |
| 34 | − float next; | |
| 35 | − | |
| 36 | − float attackInc, decayInc, rampInc; | |
| 37 | − | |
| 38 | − oBool inAttack, inDecay, inRamp; | |
| 39 | − | |
| 40 | − oBool loop; | |
| 41 | − | |
| 42 | − float gain, rampPeak; | |
| 43 | − | |
| 44 | − float attackPhase, decayPhase, rampPhase; | |
| 45 | − | |
| 46 | − } _tEnvelope; | |
| 47 | − | |
| 48 | − typedef _tEnvelope* tEnvelope; | |
| 49 | − | |
| 50 | − void tEnvelope_init (tEnvelope* const, float attack, float decay, oBool loop); | |
| 51 | − void tEnvelope_free (tEnvelope* const); | |
| 52 | − void tEnvelope_initToPool (tEnvelope* const, float attack, float decay, oBool loop, tMempool* const); | |
| 53 | − void tEnvelope_freeFromPool (tEnvelope* const, tMempool* const); | |
| 54 | − | |
| 55 | − float tEnvelope_tick (tEnvelope* const); | |
| 56 | − void tEnvelope_setAttack (tEnvelope* const, float attack); | |
| 57 | − void tEnvelope_setDecay (tEnvelope* const, float decay); | |
| 58 | − void tEnvelope_loop (tEnvelope* const, oBool loop); | |
| 59 | − void tEnvelope_on (tEnvelope* const, float velocity); | |
| 60 | − | |
| 61 | − // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | |
| 62 | − | |
| 63 | − /* ADSR */ | |
| 64 | − typedef struct _tADSR | |
| 65 | − { | |
| 66 | − const float *exp_buff; | |
| 67 | − const float *inc_buff; | |
| 68 | − uint32_t buff_size; | |
| 69 | − | |
| 70 | − float next; | |
| 71 | − | |
| 72 | − float attackInc, decayInc, releaseInc, rampInc; | |
| 73 | − | |
| 74 | − oBool inAttack, inDecay, inSustain, inRelease, inRamp; | |
| 75 | − | |
| 76 | − float sustain, gain, rampPeak, releasePeak; | |
| 77 | − | |
| 78 | − float attackPhase, decayPhase, releasePhase, rampPhase; | |
| 79 | − | |
| 80 | − } _tADSR; | |
| 81 | − | |
| 82 | − typedef _tADSR* tADSR; | |
| 83 | − | |
| 84 | − void tADSR_init (tADSR* const, float attack, float decay, float sustain, float release); | |
| 85 | − void tADSR_free (tADSR* const); | |
| 86 | − void tADSR_initToPool (tADSR* const, float attack, float decay, float sustain, float release, tMempool* const); | |
| 87 | − void tADSR_freeFromPool (tADSR* const, tMempool* const); | |
| 88 | − | |
| 89 | − float tADSR_tick (tADSR* const); | |
| 90 | − void tADSR_setAttack (tADSR* const, float attack); | |
| 91 | − void tADSR_setDecay (tADSR* const, float decay); | |
| 92 | − void tADSR_setSustain (tADSR* const, float sustain); | |
| 93 | − void tADSR_setRelease (tADSR* const, float release); | |
| 94 | − void tADSR_on (tADSR* const, float velocity); | |
| 95 | − void tADSR_off (tADSR* const); | |
| 96 | − | |
| 97 | − // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | |
| 98 | − | |
| 99 | − // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | |
| 100 | − | |
| 101 | − /* Ramp */ | |
| 102 | − typedef struct _tRamp { | |
| 103 | − float inc; | |
| 104 | − float inv_sr_ms; | |
| 105 | − float minimum_time; | |
| 106 | − float curr,dest; | |
| 107 | − float time; | |
| 108 | − int samples_per_tick; | |
| 109 | − | |
| 110 | − } _tRamp; | |
| 111 | − | |
| 112 | − typedef _tRamp* tRamp; | |
| 113 | − | |
| 114 | − void tRamp_init (tRamp* const, float time, int samplesPerTick); | |
| 115 | − void tRamp_free (tRamp* const); | |
| 116 | − void tRamp_initToPool (tRamp* const, float time, int samplesPerTick, tMempool* const); | |
| 117 | − void tRamp_freeFromPool (tRamp* const, tMempool* const); | |
| 118 | − | |
| 119 | − float tRamp_tick (tRamp* const); | |
| 120 | − float tRamp_sample (tRamp* const); | |
| 121 | − void tRamp_setTime (tRamp* const, float time); | |
| 122 | − void tRamp_setDest (tRamp* const, float dest); | |
| 123 | − void tRamp_setVal (tRamp* const, float val); | |
| 124 | − | |
| 125 | − // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | |
| 126 | − | |
| 127 | − /* Exponential Smoother */ | |
| 128 | − typedef struct _tExpSmooth { | |
| 129 | − float factor, oneminusfactor; | |
| 130 | − float curr,dest; | |
| 131 | − | |
| 132 | − } _tExpSmooth; | |
| 133 | − | |
| 134 | − typedef _tExpSmooth* tExpSmooth; | |
| 135 | − | |
| 136 | − void tExpSmooth_init (tExpSmooth* const, float val, float factor); | |
| 137 | − void tExpSmooth_free (tExpSmooth* const); | |
| 138 | − void tExpSmooth_initToPool (tExpSmooth* const, float val, float factor, tMempool* const); | |
| 139 | − void tExpSmooth_freeFromPool (tExpSmooth* const, tMempool* const); | |
| 140 | − | |
| 141 | − float tExpSmooth_tick (tExpSmooth* const); | |
| 142 | − float tExpSmooth_sample (tExpSmooth* const); | |
| 143 | − void tExpSmooth_setFactor (tExpSmooth* const, float factor); | |
| 144 | − void tExpSmooth_setDest (tExpSmooth* const, float dest); | |
| 145 | − void tExpSmooth_setVal (tExpSmooth* const, float val); | |
| 146 | − | |
| 147 | −#ifdef __cplusplus | |
| 148 | −} | |
| 149 | −#endif | |
| 150 | − | |
| 151 | −#endif // LEAF_ENVELOPES_H_INCLUDED | |
| 152 | − | |
| 153 | − | |
| 154 | − | |
| @@ -1,358 +0,0 @@ | ||
| 1 | −/*============================================================================== | |
| 2 | − | |
| 3 | − leaf-filters.h | |
| 4 | − Created: 20 Jan 2017 12:01:10pm | |
| 5 | − Author: Michael R Mulshine | |
| 6 | − | |
| 7 | − ==============================================================================*/ | |
| 8 | − | |
| 9 | −#ifndef LEAF_FILTERS_H_INCLUDED | |
| 10 | −#define LEAF_FILTERS_H_INCLUDED | |
| 11 | − | |
| 12 | −#ifdef __cplusplus | |
| 13 | −extern "C" { | |
| 14 | −#endif | |
| 15 | − | |
| 16 | − //============================================================================== | |
| 17 | − | |
| 18 | −#include "leaf-math.h" | |
| 19 | −#include "leaf-mempool.h" | |
| 20 | −#include "leaf-delay.h" | |
| 21 | −#include "leaf-tables.h" | |
| 22 | − | |
| 23 | − //============================================================================== | |
| 24 | − | |
| 25 | − /* tAllpass: Schroeder allpass. Comb-filter with feedforward and feedback. */ | |
| 26 | − typedef struct _tAllpass | |
| 27 | − { | |
| 28 | − float gain; | |
| 29 | − | |
| 30 | − tLinearDelay delay; | |
| 31 | − | |
| 32 | − float lastOut; | |
| 33 | − | |
| 34 | − } _tAllpass; | |
| 35 | − | |
| 36 | − typedef _tAllpass* tAllpass; | |
| 37 | − | |
| 38 | − void tAllpass_init (tAllpass* const, float initDelay, uint32_t maxDelay); | |
| 39 | − void tAllpass_free (tAllpass* const); | |
| 40 | − void tAllpass_initToPool (tAllpass* const, float initDelay, uint32_t maxDelay, tMempool* const); | |
| 41 | − void tAllpass_freeFromPool (tAllpass* const, tMempool* const); | |
| 42 | − | |
| 43 | − float tAllpass_tick (tAllpass* const, float input); | |
| 44 | − void tAllpass_setGain (tAllpass* const, float gain); | |
| 45 | − void tAllpass_setDelay (tAllpass* const, float delay); | |
| 46 | − | |
| 47 | − | |
| 48 | − //============================================================================== | |
| 49 | − | |
| 50 | − /* tOnePole: OnePole filter, reimplemented from STK (Cook and Scavone). */ | |
| 51 | − typedef struct _tOnePole | |
| 52 | − { | |
| 53 | − float gain; | |
| 54 | − float a0,a1; | |
| 55 | − float b0,b1; | |
| 56 | − float lastIn, lastOut; | |
| 57 | − | |
| 58 | − | |
| 59 | − } _tOnePole; | |
| 60 | − | |
| 61 | − typedef _tOnePole* tOnePole; | |
| 62 | − | |
| 63 | − void tOnePole_init (tOnePole* const, float thePole); | |
| 64 | − void tOnePole_free (tOnePole* const); | |
| 65 | − void tOnePole_initToPool (tOnePole* const, float thePole, tMempool* const); | |
| 66 | − void tOnePole_freeFromPool (tOnePole* const, tMempool* const); | |
| 67 | − | |
| 68 | − float tOnePole_tick (tOnePole* const, float input); | |
| 69 | − void tOnePole_setB0 (tOnePole* const, float b0); | |
| 70 | − void tOnePole_setA1 (tOnePole* const, float a1); | |
| 71 | − void tOnePole_setPole (tOnePole* const, float thePole); | |
| 72 | − void tOnePole_setFreq (tOnePole* const, float freq); | |
| 73 | − void tOnePole_setCoefficients(tOnePole* const, float b0, float a1); | |
| 74 | − void tOnePole_setGain (tOnePole* const, float gain); | |
| 75 | − | |
| 76 | − //============================================================================== | |
| 77 | − | |
| 78 | − /* TwoPole filter, reimplemented from STK (Cook and Scavone). */ | |
| 79 | − typedef struct _tTwoPole | |
| 80 | − { | |
| 81 | − float gain; | |
| 82 | − float a0, a1, a2; | |
| 83 | − float b0; | |
| 84 | − | |
| 85 | − float radius, frequency; | |
| 86 | − oBool normalize; | |
| 87 | − | |
| 88 | − float lastOut[2]; | |
| 89 | − | |
| 90 | − } _tTwoPole; | |
| 91 | − | |
| 92 | − typedef _tTwoPole* tTwoPole; | |
| 93 | − | |
| 94 | − void tTwoPole_init (tTwoPole* const); | |
| 95 | − void tTwoPole_free (tTwoPole* const); | |
| 96 | − void tTwoPole_initToPool (tTwoPole* const, tMempool* const); | |
| 97 | − void tTwoPole_freeFromPool (tTwoPole* const, tMempool* const); | |
| 98 | − | |
| 99 | − float tTwoPole_tick (tTwoPole* const, float input); | |
| 100 | − void tTwoPole_setB0 (tTwoPole* const, float b0); | |
| 101 | − void tTwoPole_setA1 (tTwoPole* const, float a1); | |
| 102 | − void tTwoPole_setA2 (tTwoPole* const, float a2); | |
| 103 | − void tTwoPole_setResonance (tTwoPole* const, float freq, float radius, oBool normalize); | |
| 104 | − void tTwoPole_setCoefficients(tTwoPole* const, float b0, float a1, float a2); | |
| 105 | − void tTwoPole_setGain (tTwoPole* const, float gain); | |
| 106 | − | |
| 107 | − //============================================================================== | |
| 108 | − | |
| 109 | − /* OneZero filter, reimplemented from STK (Cook and Scavone). */ | |
| 110 | − typedef struct _tOneZero | |
| 111 | − { | |
| 112 | − float gain; | |
| 113 | − float b0,b1; | |
| 114 | − float lastIn, lastOut, frequency; | |
| 115 | − | |
| 116 | − } _tOneZero; | |
| 117 | − | |
| 118 | − typedef _tOneZero* tOneZero; | |
| 119 | − | |
| 120 | − void tOneZero_init (tOneZero* const, float theZero); | |
| 121 | − void tOneZero_free (tOneZero* const); | |
| 122 | − void tOneZero_initToPool (tOneZero* const, float theZero, tMempool* const); | |
| 123 | − void tOneZero_freeFromPool (tOneZero* const, tMempool* const); | |
| 124 | − | |
| 125 | − float tOneZero_tick (tOneZero* const, float input); | |
| 126 | − void tOneZero_setB0 (tOneZero* const, float b0); | |
| 127 | − void tOneZero_setB1 (tOneZero* const, float b1); | |
| 128 | − void tOneZero_setZero (tOneZero* const, float theZero); | |
| 129 | − void tOneZero_setCoefficients(tOneZero* const, float b0, float b1); | |
| 130 | − void tOneZero_setGain (tOneZero* const, float gain); | |
| 131 | − float tOneZero_getPhaseDelay (tOneZero *f, float frequency ); | |
| 132 | − | |
| 133 | − //============================================================================== | |
| 134 | − | |
| 135 | − /* TwoZero filter, reimplemented from STK (Cook and Scavone). */ | |
| 136 | − typedef struct _tTwoZero | |
| 137 | − { | |
| 138 | − float gain; | |
| 139 | − float b0, b1, b2; | |
| 140 | − | |
| 141 | − float frequency, radius; | |
| 142 | − | |
| 143 | − float lastIn[2]; | |
| 144 | − | |
| 145 | − } _tTwoZero; | |
| 146 | − | |
| 147 | − typedef _tTwoZero* tTwoZero; | |
| 148 | − | |
| 149 | − void tTwoZero_init (tTwoZero* const); | |
| 150 | − void tTwoZero_free (tTwoZero* const); | |
| 151 | − void tTwoZero_initToPool (tTwoZero* const, tMempool* const); | |
| 152 | − void tTwoZero_freeFromPool (tTwoZero* const, tMempool* const); | |
| 153 | − | |
| 154 | − float tTwoZero_tick (tTwoZero* const, float input); | |
| 155 | − void tTwoZero_setB0 (tTwoZero* const, float b0); | |
| 156 | − void tTwoZero_setB1 (tTwoZero* const, float b1); | |
| 157 | − void tTwoZero_setB2 (tTwoZero* const, float b2); | |
| 158 | − void tTwoZero_setNotch (tTwoZero* const, float frequency, float radius); | |
| 159 | − void tTwoZero_setCoefficients(tTwoZero* const, float b0, float b1, float b2); | |
| 160 | − void tTwoZero_setGain (tTwoZero* const, float gain); | |
| 161 | − | |
| 162 | − //============================================================================== | |
| 163 | − | |
| 164 | − /* PoleZero filter, reimplemented from STK (Cook and Scavone). */ | |
| 165 | − typedef struct _tPoleZero | |
| 166 | − { | |
| 167 | − float gain; | |
| 168 | − float a0,a1; | |
| 169 | − float b0,b1; | |
| 170 | − | |
| 171 | − float lastIn, lastOut; | |
| 172 | − | |
| 173 | − } _tPoleZero; | |
| 174 | − | |
| 175 | − typedef _tPoleZero* tPoleZero; | |
| 176 | − | |
| 177 | − void tPoleZero_init (tPoleZero* const); | |
| 178 | − void tPoleZero_free (tPoleZero* const); | |
| 179 | − void tPoleZero_initToPool (tPoleZero* const, tMempool* const); | |
| 180 | − void tPoleZero_freeFromPool (tPoleZero* const, tMempool* const); | |
| 181 | − | |
| 182 | − float tPoleZero_tick (tPoleZero* const, float input); | |
| 183 | − void tPoleZero_setB0 (tPoleZero* const, float b0); | |
| 184 | − void tPoleZero_setB1 (tPoleZero* const, float b1); | |
| 185 | − void tPoleZero_setA1 (tPoleZero* const, float a1); | |
| 186 | − void tPoleZero_setCoefficients (tPoleZero* const, float b0, float b1, float a1); | |
| 187 | − void tPoleZero_setAllpass (tPoleZero* const, float coeff); | |
| 188 | − void tPoleZero_setBlockZero (tPoleZero* const, float thePole); | |
| 189 | − void tPoleZero_setGain (tPoleZero* const, float gain); | |
| 190 | − | |
| 191 | − //============================================================================== | |
| 192 | − | |
| 193 | − /* BiQuad filter, reimplemented from STK (Cook and Scavone). */ | |
| 194 | − typedef struct _tBiQuad | |
| 195 | − { | |
| 196 | − float gain; | |
| 197 | − float a0, a1, a2; | |
| 198 | − float b0, b1, b2; | |
| 199 | − | |
| 200 | − float lastIn[2]; | |
| 201 | − float lastOut[2]; | |
| 202 | − | |
| 203 | − float frequency, radius; | |
| 204 | − oBool normalize; | |
| 205 | − } _tBiQuad; | |
| 206 | − | |
| 207 | − typedef _tBiQuad* tBiQuad; | |
| 208 | − | |
| 209 | − void tBiQuad_init (tBiQuad* const); | |
| 210 | − void tBiQuad_free (tBiQuad* const); | |
| 211 | − void tBiQuad_initToPool (tBiQuad* const, tMempool* const); | |
| 212 | − void tBiQuad_freeFromPool (tBiQuad* const, tMempool* const); | |
| 213 | − | |
| 214 | − float tBiQuad_tick (tBiQuad* const, float input); | |
| 215 | − void tBiQuad_setB0 (tBiQuad* const, float b0); | |
| 216 | − void tBiQuad_setB1 (tBiQuad* const, float b1); | |
| 217 | − void tBiQuad_setB2 (tBiQuad* const, float b2); | |
| 218 | − void tBiQuad_setA1 (tBiQuad* const, float a1); | |
| 219 | − void tBiQuad_setA2 (tBiQuad* const, float a2); | |
| 220 | − void tBiQuad_setNotch (tBiQuad* const, float freq, float radius); | |
| 221 | − void tBiQuad_setResonance (tBiQuad* const, float freq, float radius, oBool normalize); | |
| 222 | − void tBiQuad_setCoefficients(tBiQuad* const, float b0, float b1, float b2, float a1, float a2); | |
| 223 | − void tBiQuad_setGain (tBiQuad* const, float gain); | |
| 224 | − | |
| 225 | − //============================================================================== | |
| 226 | − | |
| 227 | − /* State Variable Filter, algorithm from Andy Simper. */ | |
| 228 | − typedef enum SVFType | |
| 229 | − { | |
| 230 | − SVFTypeHighpass = 0, | |
| 231 | − SVFTypeLowpass, | |
| 232 | − SVFTypeBandpass, | |
| 233 | − SVFTypeNotch, | |
| 234 | − SVFTypePeak, | |
| 235 | − } SVFType; | |
| 236 | − | |
| 237 | − typedef struct _tSVF | |
| 238 | − { | |
| 239 | − SVFType type; | |
| 240 | − float cutoff, Q; | |
| 241 | − float ic1eq,ic2eq; | |
| 242 | − float g,k,a1,a2,a3; | |
| 243 | − | |
| 244 | − } _tSVF; | |
| 245 | − | |
| 246 | − typedef _tSVF* tSVF; | |
| 247 | − | |
| 248 | − void tSVF_init (tSVF* const, SVFType type, float freq, float Q); | |
| 249 | − void tSVF_free (tSVF* const); | |
| 250 | − void tSVF_initToPool (tSVF* const, SVFType type, float freq, float Q, tMempool* const); | |
| 251 | − void tSVF_freeFromPool (tSVF* const, tMempool* const); | |
| 252 | − | |
| 253 | − float tSVF_tick (tSVF* const, float v0); | |
| 254 | − void tSVF_setFreq (tSVF* const, float freq); | |
| 255 | − void tSVF_setQ (tSVF* const, float Q); | |
| 256 | − | |
| 257 | − //============================================================================== | |
| 258 | − | |
| 259 | − /* Efficient State Variable Filter for 14-bit control input, [0, 4096). */ | |
| 260 | − typedef struct _tEfficientSVF | |
| 261 | − { | |
| 262 | − SVFType type; | |
| 263 | − float cutoff, Q; | |
| 264 | − float ic1eq,ic2eq; | |
| 265 | − float g,k,a1,a2,a3; | |
| 266 | − | |
| 267 | − } _tEfficientSVF; | |
| 268 | − | |
| 269 | − typedef _tEfficientSVF* tEfficientSVF; | |
| 270 | − | |
| 271 | − void tEfficientSVF_init (tEfficientSVF* const, SVFType type, uint16_t input, float Q); | |
| 272 | − void tEfficientSVF_free (tEfficientSVF* const); | |
| 273 | − void tEfficientSVF_initToPool (tEfficientSVF* const, SVFType type, uint16_t input, float Q, tMempool* const); | |
| 274 | − void tEfficientSVF_freeFromPool (tEfficientSVF* const, tMempool* const); | |
| 275 | − | |
| 276 | − float tEfficientSVF_tick (tEfficientSVF* const, float v0); | |
| 277 | − void tEfficientSVF_setFreq (tEfficientSVF* const, uint16_t controlFreq); | |
| 278 | − void tEfficientSVF_setQ (tEfficientSVF* const, float Q); | |
| 279 | − | |
| 280 | − //============================================================================== | |
| 281 | − | |
| 282 | − /* Simple Highpass filter. */ | |
| 283 | − typedef struct _tHighpass | |
| 284 | − { | |
| 285 | − float xs, ys, R; | |
| 286 | − float frequency; | |
| 287 | − | |
| 288 | − } _tHighpass; | |
| 289 | − | |
| 290 | − typedef _tHighpass* tHighpass; | |
| 291 | − | |
| 292 | − void tHighpass_init (tHighpass* const, float freq); | |
| 293 | − void tHighpass_free (tHighpass* const); | |
| 294 | − void tHighpass_initToPool (tHighpass* const, float freq, tMempool* const); | |
| 295 | − void tHighpass_freeFromPool (tHighpass* const, tMempool* const); | |
| 296 | − | |
| 297 | − float tHighpass_tick (tHighpass* const, float x); | |
| 298 | − void tHighpass_setFreq (tHighpass* const, float freq); | |
| 299 | − float tHighpass_getFreq (tHighpass* const); | |
| 300 | − | |
| 301 | − //============================================================================== | |
| 302 | − | |
| 303 | − // Butterworth Filter | |
| 304 | −#define NUM_SVF_BW 16 | |
| 305 | − typedef struct _tButterworth | |
| 306 | − { | |
| 307 | − float gain; | |
| 308 | − | |
| 309 | − int N; | |
| 310 | − | |
| 311 | − tSVF low[NUM_SVF_BW]; | |
| 312 | − tSVF high[NUM_SVF_BW]; | |
| 313 | − | |
| 314 | − float f1,f2; | |
| 315 | − | |
| 316 | − } _tButterworth; | |
| 317 | − | |
| 318 | − typedef _tButterworth* tButterworth; | |
| 319 | − | |
| 320 | − void tButterworth_init (tButterworth* const, int N, float f1, float f2); | |
| 321 | − void tButterworth_free (tButterworth* const); | |
| 322 | − void tButterworth_initToPool (tButterworth* const, int N, float f1, float f2, tMempool* const); | |
| 323 | − void tButterworth_freeFromPool (tButterworth* const, tMempool* const); | |
| 324 | − | |
| 325 | − float tButterworth_tick (tButterworth* const, float input); | |
| 326 | − void tButterworth_setF1 (tButterworth* const, float in); | |
| 327 | − void tButterworth_setF2 (tButterworth* const, float in); | |
| 328 | − void tButterworth_setFreqs (tButterworth* const, float f1, float f2); | |
| 329 | − | |
| 330 | − //============================================================================== | |
| 331 | − | |
| 332 | − typedef struct _tFIR | |
| 333 | − { | |
| 334 | − float* past; | |
| 335 | − float* coeff; | |
| 336 | − int numTaps; | |
| 337 | − } _tFIR; | |
| 338 | − | |
| 339 | − typedef _tFIR* tFIR; | |
| 340 | − | |
| 341 | − void tFIR_init (tFIR* const, float* coeffs, int numTaps); | |
| 342 | − void tFIR_free (tFIR* const); | |
| 343 | − void tFIR_initToPool (tFIR* const, float* coeffs, int numTaps, tMempool* const); | |
| 344 | − void tFIR_freeFromPool (tFIR* const, tMempool* const); | |
| 345 | − | |
| 346 | − float tFIR_tick (tFIR* const, float input); | |
| 347 | − void tFIR_coeffs (tFIR* const, float in); | |
| 348 | − | |
| 349 | − //============================================================================== | |
| 350 | − | |
| 351 | −#ifdef __cplusplus | |
| 352 | −} | |
| 353 | −#endif | |
| 354 | − | |
| 355 | −#endif // LEAF_FILTERS_H_INCLUDED | |
| 356 | − | |
| 357 | −//============================================================================== | |
| 358 | − | |
| @@ -1,39 +0,0 @@ | ||
| 1 | −/* | |
| 2 | − ============================================================================== | |
| 3 | − | |
| 4 | − leaf-global.h | |
| 5 | − Created: 24 Oct 2019 2:24:38pm | |
| 6 | − Author: Matthew Wang | |
| 7 | − | |
| 8 | − ============================================================================== | |
| 9 | − */ | |
| 10 | − | |
| 11 | −#ifndef LEAF_GLOBAL_H_INCLUDED | |
| 12 | −#define LEAF_GLOBAL_H_INCLUDED | |
| 13 | − | |
| 14 | −#ifdef __cplusplus | |
| 15 | −extern "C" { | |
| 16 | −#endif | |
| 17 | − | |
| 18 | − typedef struct _LEAF | |
| 19 | − { | |
| 20 | − float sampleRate; | |
| 21 | − float invSampleRate; | |
| 22 | − int blockSize; | |
| 23 | − float twoPiTimesInvSampleRate; | |
| 24 | − float (*random)(void); | |
| 25 | − int clearOnAllocation; | |
| 26 | − } LEAF; | |
| 27 | − | |
| 28 | − extern LEAF leaf; // The global instance of LEAF. | |
| 29 | − | |
| 30 | − //============================================================================== | |
| 31 | − | |
| 32 | −#ifdef __cplusplus | |
| 33 | −} | |
| 34 | −#endif | |
| 35 | − | |
| 36 | −#endif // LEAF_GLOBAL_H_INCLUDED | |
| 37 | − | |
| 38 | −//============================================================================== | |
| 39 | − | |
| @@ -1,201 +0,0 @@ | ||
| 1 | −/*============================================================================== | |
| 2 | − | |
| 3 | − leaf-instruments.h | |
| 4 | − Created: 30 Nov 2018 10:24:44am | |
| 5 | − Author: airship | |
| 6 | − | |
| 7 | − ==============================================================================*/ | |
| 8 | − | |
| 9 | −#ifndef LEAF_INSTRUMENTS_H_INCLUDED | |
| 10 | −#define LEAF_INSTRUMENTS_H_INCLUDED | |
| 11 | − | |
| 12 | −#ifdef __cplusplus | |
| 13 | −extern "C" { | |
| 14 | −#endif | |
| 15 | − | |
| 16 | − //============================================================================== | |
| 17 | − | |
| 18 | −#include "leaf-math.h" | |
| 19 | −#include "leaf-mempool.h" | |
| 20 | −#include "leaf-oscillators.h" | |
| 21 | −#include "leaf-filters.h" | |
| 22 | −#include "leaf-envelopes.h" | |
| 23 | − | |
| 24 | − //============================================================================== | |
| 25 | − | |
| 26 | − // 808 Cowbell | |
| 27 | − typedef struct _t808Cowbell { | |
| 28 | − | |
| 29 | − tSquare p[2]; | |
| 30 | − tNoise stick; | |
| 31 | − tSVF bandpassOsc; | |
| 32 | − tSVF bandpassStick; | |
| 33 | − tEnvelope envGain; | |
| 34 | − tEnvelope envStick; | |
| 35 | − tEnvelope envFilter; | |
| 36 | − tHighpass highpass; | |
| 37 | − float oscMix; | |
| 38 | − float filterCutoff; | |
| 39 | − oBool useStick; | |
| 40 | − | |
| 41 | − } _t808Cowbell; | |
| 42 | − | |
| 43 | − typedef _t808Cowbell* t808Cowbell; | |
| 44 | − | |
| 45 | − void t808Cowbell_init (t808Cowbell* const, int useStick); | |
| 46 | − void t808Cowbell_free (t808Cowbell* const); | |
| 47 | − void t808Cowbell_initToPool (t808Cowbell* const, int useStick, tMempool* const); | |
| 48 | − void t808Cowbell_freeFromPool (t808Cowbell* const, tMempool* const); | |
| 49 | − | |
| 50 | − float t808Cowbell_tick (t808Cowbell* const); | |
| 51 | − void t808Cowbell_on (t808Cowbell* const, float vel); | |
| 52 | − void t808Cowbell_setDecay (t808Cowbell* const, float decay); | |
| 53 | − void t808Cowbell_setHighpassFreq (t808Cowbell* const, float freq); | |
| 54 | − void t808Cowbell_setBandpassFreq (t808Cowbell* const, float freq); | |
| 55 | − void t808Cowbell_setFreq (t808Cowbell* const, float freq); | |
| 56 | − void t808Cowbell_setOscMix (t808Cowbell* const, float oscMix); | |
| 57 | − void t808Cowbell_setStick (t808Cowbell* const, int useStick); | |
| 58 | − | |
| 59 | − //============================================================================== | |
| 60 | − | |
| 61 | − // 808 Hihat | |
| 62 | − typedef struct _t808Hihat { | |
| 63 | − | |
| 64 | − // 6 Square waves | |
| 65 | − tSquare p[6]; | |
| 66 | − tNoise n; | |
| 67 | − tSVF bandpassOsc; | |
| 68 | − tSVF bandpassStick; | |
| 69 | − tEnvelope envGain; | |
| 70 | − tEnvelope envStick; | |
| 71 | − tEnvelope noiseFMGain; | |
| 72 | − tHighpass highpass; | |
| 73 | − tNoise stick; | |
| 74 | − | |
| 75 | − float freq; | |
| 76 | − float stretch; | |
| 77 | − float FM_amount; | |
| 78 | − float oscNoiseMix; | |
| 79 | − | |
| 80 | − } _t808Hihat; | |
| 81 | − | |
| 82 | − typedef _t808Hihat* t808Hihat; | |
| 83 | − | |
| 84 | − void t808Hihat_init (t808Hihat* const); | |
| 85 | − void t808Hihat_free (t808Hihat* const); | |
| 86 | − void t808Hihat_initToPool (t808Hihat* const, tMempool* const); | |
| 87 | − void t808Hihat_freeFromPool (t808Hihat* const, tMempool* const); | |
| 88 | − | |
| 89 | − float t808Hihat_tick (t808Hihat* const); | |
| 90 | − void t808Hihat_on (t808Hihat* const, float vel); | |
| 91 | − void t808Hihat_setOscNoiseMix (t808Hihat* const, float oscNoiseMix); | |
| 92 | − void t808Hihat_setDecay (t808Hihat* const, float decay); | |
| 93 | − void t808Hihat_setHighpassFreq (t808Hihat* const, float freq); | |
| 94 | − void t808Hihat_setOscBandpassFreq (t808Hihat* const, float freq); | |
| 95 | − void t808Hihat_setOscBandpassQ (t808Hihat* const hihat, float Q); | |
| 96 | − void t808Hihat_setStickBandPassFreq (t808Hihat* const, float freq); | |
| 97 | − void t808Hihat_setStickBandPassQ (t808Hihat* const hihat, float Q); | |
| 98 | − void t808Hihat_setOscFreq (t808Hihat* const, float freq); | |
| 99 | − void t808Hihat_setStretch (t808Hihat* const hihat, float stretch); | |
| 100 | − void t808Hihat_setFM (t808Hihat* const hihat, float FM_amount); | |
| 101 | − | |
| 102 | − //============================================================================== | |
| 103 | − | |
| 104 | − // 808 Snare | |
| 105 | − typedef struct _t808Snare { | |
| 106 | − | |
| 107 | − // Tone 1, Tone 2, Noise | |
| 108 | − tTriangle tone[2]; // Tri (not yet antialiased or wavetabled) | |
| 109 | − tNoise noiseOsc; | |
| 110 | − tSVF toneLowpass[2]; | |
| 111 | − tSVF noiseLowpass; // Lowpass from SVF filter | |
| 112 | − tEnvelope toneEnvOsc[2]; | |
| 113 | − tEnvelope toneEnvGain[2]; | |
| 114 | − tEnvelope noiseEnvGain; | |
| 115 | − tEnvelope toneEnvFilter[2]; | |
| 116 | − tEnvelope noiseEnvFilter; | |
| 117 | − | |
| 118 | − float toneGain[2]; | |
| 119 | − float noiseGain; | |
| 120 | − | |
| 121 | − float toneNoiseMix; | |
| 122 | − | |
| 123 | − float tone1Freq, tone2Freq; | |
| 124 | − | |
| 125 | − float noiseFilterFreq; | |
| 126 | − | |
| 127 | − } _t808Snare; | |
| 128 | − | |
| 129 | − typedef _t808Snare* t808Snare; | |
| 130 | − | |
| 131 | − void t808Snare_init (t808Snare* const); | |
| 132 | − void t808Snare_free (t808Snare* const); | |
| 133 | − void t808Snare_initToPool (t808Snare* const, tMempool* const); | |
| 134 | − void t808Snare_freeFromPool (t808Snare* const, tMempool* const); | |
| 135 | − | |
| 136 | − float t808Snare_tick (t808Snare* const); | |
| 137 | − void t808Snare_on (t808Snare* const, float vel); | |
| 138 | − void t808Snare_setTone1Freq (t808Snare* const, float freq); | |
| 139 | − void t808Snare_setTone2Freq (t808Snare* const, float freq); | |
| 140 | − void t808Snare_setTone1Decay (t808Snare* const, float decay); | |
| 141 | − void t808Snare_setTone2Decay (t808Snare* const, float decay); | |
| 142 | − void t808Snare_setNoiseDecay (t808Snare* const, float decay); | |
| 143 | − void t808Snare_setToneNoiseMix (t808Snare* const, float toneNoiseMix); | |
| 144 | − void t808Snare_setNoiseFilterFreq (t808Snare* const, float noiseFilterFreq); | |
| 145 | − void t808Snare_setNoiseFilterQ (t808Snare* const, float noiseFilterQ); | |
| 146 | − | |
| 147 | − //============================================================================== | |
| 148 | − | |
| 149 | − // 808 Kick | |
| 150 | − typedef struct _t808Kick { | |
| 151 | − | |
| 152 | − | |
| 153 | − tCycle tone; // Tri | |
| 154 | − tNoise noiseOsc; | |
| 155 | − tSVF toneLowpass; | |
| 156 | − tEnvelope toneEnvOscChirp; | |
| 157 | − tEnvelope toneEnvOscSigh; | |
| 158 | − tEnvelope toneEnvGain; | |
| 159 | − tEnvelope noiseEnvGain; | |
| 160 | − tEnvelope toneEnvFilter; | |
| 161 | − | |
| 162 | − float toneGain; | |
| 163 | − float noiseGain; | |
| 164 | − | |
| 165 | − float toneInitialFreq; | |
| 166 | − float sighAmountInHz; | |
| 167 | − float chirpRatioMinusOne; | |
| 168 | − float noiseFilterFreq; | |
| 169 | − | |
| 170 | − } _t808Kick; | |
| 171 | − | |
| 172 | − typedef _t808Kick* t808Kick; | |
| 173 | − | |
| 174 | − void t808Kick_init (t808Kick* const); | |
| 175 | − void t808Kick_free (t808Kick* const); | |
| 176 | − void t808Kick_initToPool (t808Kick* const, tMempool* const); | |
| 177 | − void t808Kick_freeFromPool (t808Kick* const, tMempool* const); | |
| 178 | − | |
| 179 | − float t808Kick_tick (t808Kick* const); | |
| 180 | − void t808Kick_on (t808Kick* const, float vel); | |
| 181 | − void t808Kick_setToneFreq (t808Kick* const, float freq); | |
| 182 | − void t808Kick_setToneDecay (t808Kick* const, float decay); | |
| 183 | − void t808Kick_setNoiseDecay (t808Kick* const, float decay); | |
| 184 | − void t808Kick_setSighAmount (t808Kick* const, float sigh); | |
| 185 | − void t808Kick_setChirpAmount (t808Kick* const, float chirp); | |
| 186 | − void t808Kick_setToneNoiseMix (t808Kick* const, float toneNoiseMix); | |
| 187 | − void t808Kick_setNoiseFilterFreq (t808Kick* const, float noiseFilterFreq); | |
| 188 | − void t808Kick_setNoiseFilterQ (t808Kick* const, float noiseFilterQ); | |
| 189 | − | |
| 190 | − //============================================================================== | |
| 191 | − | |
| 192 | −#ifdef __cplusplus | |
| 193 | −} | |
| 194 | −#endif | |
| 195 | − | |
| 196 | −#endif // LEAF_INSTRUMENTS_H_INCLUDED | |
| 197 | − | |
| 198 | −//============================================================================== | |
| 199 | − | |
| 200 | − | |
| 201 | − | |
| @@ -1,179 +0,0 @@ | ||
| 1 | −/*============================================================================== | |
| 2 | − | |
| 3 | − leaf-math.h | |
| 4 | − Created: 22 Jan 2017 7:02:56pm | |
| 5 | − Author: Michael R Mulshine | |
| 6 | − | |
| 7 | − ==============================================================================*/ | |
| 8 | − | |
| 9 | −#ifndef LEAF_MATH_H_INCLUDED | |
| 10 | −#define LEAF_MATH_H_INCLUDED | |
| 11 | − | |
| 12 | −#ifdef __cplusplus | |
| 13 | −extern "C" { | |
| 14 | −#endif | |
| 15 | − | |
| 16 | −#include "leaf-global.h" | |
| 17 | −#include "math.h" | |
| 18 | −#include "stdint.h" | |
| 19 | −#include "stdlib.h" | |
| 20 | − | |
| 21 | − //============================================================================== | |
| 22 | − | |
| 23 | − //============================================================================== | |
| 24 | − | |
| 25 | − typedef enum oBool | |
| 26 | − { | |
| 27 | − OTRUE = 1, | |
| 28 | − OFALSE = 0 | |
| 29 | − }oBool; | |
| 30 | − | |
| 31 | − // Allows for bitwise operations on floats | |
| 32 | − union unholy_t { /* a union between a float and an integer */ | |
| 33 | − float f; | |
| 34 | − int i; | |
| 35 | − }; | |
| 36 | − | |
| 37 | −#define SQRT8 2.82842712475f | |
| 38 | −#define WSCALE 1.30612244898f | |
| 39 | −#define PI (3.14159265358979f) | |
| 40 | −#define TWO_PI (2 * PI) | |
| 41 | − | |
| 42 | −#define VSF 1.0e-38f | |
| 43 | − | |
| 44 | −#define MAX_DELAY 8192 | |
| 45 | −#define INV_128 0.0078125f | |
| 46 | − | |
| 47 | −#define INV_20 0.05f | |
| 48 | −#define INV_40 0.025f | |
| 49 | −#define INV_80 0.0125f | |
| 50 | −#define INV_160 0.00625f | |
| 51 | −#define INV_320 0.003125f | |
| 52 | −#define INV_640 0.0015625f | |
| 53 | −#define INV_1280 0.00078125f | |
| 54 | −#define INV_2560 0.000390625f | |
| 55 | −#define INV_5120 0.0001953125f | |
| 56 | −#define INV_10240 0.00009765625f | |
| 57 | −#define INV_20480 0.000048828125f | |
| 58 | − | |
| 59 | − | |
| 60 | −#define INV_TWELVE 0.0833333333f | |
| 61 | −#define INV_440 0.0022727273f | |
| 62 | − | |
| 63 | −#define LOG2 0.3010299957f | |
| 64 | −#define INV_LOG2 3.321928095f | |
| 65 | − | |
| 66 | −#define SOS_M 343.0f | |
| 67 | −#define TWO_TO_5 32.0f | |
| 68 | −#define INV_TWO_TO_5 0.03125f | |
| 69 | −#define TWO_TO_7 128.f | |
| 70 | −#define INV_TWO_TO_7 0.0078125f | |
| 71 | −#define TWO_TO_8 256.f | |
| 72 | −#define INV_TWO_TO_8 0.00390625f | |
| 73 | −#define TWO_TO_9 512.f | |
| 74 | −#define INV_TWO_TO_9 0.001953125f | |
| 75 | −#define TWO_TO_10 1024.f | |
| 76 | −#define INV_TWO_TO_10 0.0009765625f | |
| 77 | −#define TWO_TO_11 2048.f | |
| 78 | −#define INV_TWO_TO_11 0.00048828125f | |
| 79 | −#define TWO_TO_12 4096.f | |
| 80 | −#define INV_TWO_TO_12 0.00024414062f | |
| 81 | −#define TWO_TO_15 32768.f | |
| 82 | −#define TWO_TO_16 65536.f | |
| 83 | −#define INV_TWO_TO_15 0.00003051757f | |
| 84 | −#define INV_TWO_TO_16 0.00001525878f | |
| 85 | −#define TWO_TO_16_MINUS_ONE 65535.0f | |
| 86 | −#define TWO_TO_23 8388608.0f | |
| 87 | −#define INV_TWO_TO_23 0.00000011920929f | |
| 88 | −#define TWO_TO_31 2147483648.0f | |
| 89 | −#define INV_TWO_TO_31 0.000000000465661f | |
| 90 | −#define TWO_TO_32 4294967296.0f | |
| 91 | −#define INV_TWO_TO_32 0.000000000232831f | |
| 92 | − | |
| 93 | − | |
| 94 | −#define LOGTEN 2.302585092994 | |
| 95 | − | |
| 96 | − // Jones shaper | |
| 97 | − float LEAF_shaper (float input, float m_drive); | |
| 98 | − float LEAF_reedTable (float input, float offset, float slope); | |
| 99 | − | |
| 100 | − float LEAF_reduct (float input, float ratio); | |
| 101 | − float LEAF_round (float input, float rnd); | |
| 102 | − float LEAF_bitwise_xor(float input, uint32_t op); | |
| 103 | − | |
| 104 | − float LEAF_reduct (float input, float ratio); | |
| 105 | − float LEAF_round (float input, float rnd); | |
| 106 | − float LEAF_bitwise_xor(float input, uint32_t op); | |
| 107 | − | |
| 108 | − float LEAF_clip (float min, float val, float max); | |
| 109 | − int LEAF_clipInt (int min, int val, int max); | |
| 110 | − float LEAF_softClip (float val, float thresh); | |
| 111 | − oBool LEAF_isPrime (uint64_t number ); | |
| 112 | − | |
| 113 | − float LEAF_midiToFrequency (float f); | |
| 114 | − float LEAF_frequencyToMidi(float f); | |
| 115 | − | |
| 116 | − void LEAF_generate_sine (float* buffer, int size); | |
| 117 | − void LEAF_generate_sawtooth (float* buffer, float basefreq, int size); | |
| 118 | − void LEAF_generate_triangle (float* buffer, float basefreq, int size); | |
| 119 | − void LEAF_generate_square (float* buffer, float basefreq, int size); | |
| 120 | − | |
| 121 | − // dope af | |
| 122 | − float LEAF_chebyshevT(float in, int n); | |
| 123 | − float LEAF_CompoundChebyshevT(float in, int n, float* amps); | |
| 124 | − | |
| 125 | − // Hermite interpolation | |
| 126 | − float LEAF_interpolate_hermite (float A, float B, float C, float D, float t); | |
| 127 | − float LEAF_interpolate_hermite_x(float yy0, float yy1, float yy2, float yy3, float xx); | |
| 128 | − float LEAF_interpolation_linear (float A, float B, float t); | |
| 129 | − | |
| 130 | − float interpolate3max(float *buf, const int peakindex); | |
| 131 | − float interpolate3phase(float *buf, const int peakindex); | |
| 132 | − | |
| 133 | − // alternative implementation for abs() | |
| 134 | − // REQUIRES: 32 bit integers | |
| 135 | − int fastabs_int(int in); | |
| 136 | − | |
| 137 | − // alternative implementation for abs() | |
| 138 | − // REQUIRES: 32 bit floats | |
| 139 | − float fastabsf(float f); | |
| 140 | − | |
| 141 | − float fastexp2f(float f); | |
| 142 | − | |
| 143 | − | |
| 144 | − void LEAF_crossfade(float fade, float* volumes); | |
| 145 | − | |
| 146 | − | |
| 147 | − | |
| 148 | − float fast_mtof(float f); | |
| 149 | − | |
| 150 | − float fastexpf(float x); | |
| 151 | − | |
| 152 | − float fasterexpf(float x); | |
| 153 | − | |
| 154 | − float mtof(float f); | |
| 155 | − | |
| 156 | − float fast_mtof(float f); | |
| 157 | − | |
| 158 | − float faster_mtof(float f); | |
| 159 | − | |
| 160 | − float ftom(float f); | |
| 161 | − | |
| 162 | − float powtodb(float f); | |
| 163 | − | |
| 164 | − float rmstodb(float f); | |
| 165 | − | |
| 166 | − float dbtopow(float f); | |
| 167 | − | |
| 168 | − float dbtorms(float f); | |
| 169 | − | |
| 170 | − //============================================================================== | |
| 171 | − | |
| 172 | −#ifdef __cplusplus | |
| 173 | −} | |
| 174 | −#endif | |
| 175 | − | |
| 176 | −#endif // LEAF_MATH_H_INCLUDED | |
| 177 | − | |
| 178 | −//============================================================================== | |
| 179 | − | |
| @@ -1,127 +0,0 @@ | ||
| 1 | −/*============================================================================== | |
| 2 | − | |
| 3 | − In short, mpool is distributed under so called "BSD license", | |
| 4 | − | |
| 5 | − Copyright (c) 2009-2010 Tatsuhiko Kubo <cubicdaiya@gmail.com> | |
| 6 | − All rights reserved. | |
| 7 | − | |
| 8 | − Redistribution and use in source and binary forms, with or without modification, | |
| 9 | − are permitted provided that the following conditions are met: | |
| 10 | − | |
| 11 | − * Redistributions of source code must retain the above copyright notice, | |
| 12 | − this list of conditions and the following disclaimer. | |
| 13 | − | |
| 14 | − * Redistributions in binary form must reproduce the above copyright notice, | |
| 15 | − this list of conditions and the following disclaimer in the documentation | |
| 16 | − and/or other materials provided with the distribution. | |
| 17 | − | |
| 18 | − * Neither the name of the authors nor the names of its contributors | |
| 19 | − may be used to endorse or promote products derived from this software | |
| 20 | − without specific prior written permission. | |
| 21 | − | |
| 22 | − THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
| 23 | − "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
| 24 | − LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
| 25 | − A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
| 26 | − OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
| 27 | − SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED | |
| 28 | − TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | |
| 29 | − PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | |
| 30 | − LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | |
| 31 | − NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | |
| 32 | − SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
| 33 | − | |
| 34 | − written by C99 style | |
| 35 | − ==============================================================================*/ | |
| 36 | − | |
| 37 | −#ifndef LEAF_MPOOL_H_INCLUDED | |
| 38 | −#define LEAF_MPOOL_H_INCLUDED | |
| 39 | − | |
| 40 | −#ifdef __cplusplus | |
| 41 | −extern "C" { | |
| 42 | −#endif | |
| 43 | − | |
| 44 | − //============================================================================== | |
| 45 | − | |
| 46 | −#include <stdio.h> | |
| 47 | −#include <stdlib.h> | |
| 48 | −#include <string.h> | |
| 49 | −#include <stdbool.h> | |
| 50 | − | |
| 51 | − //============================================================================== | |
| 52 | − | |
| 53 | −#define MPOOL_ALIGN_SIZE (8) | |
| 54 | − | |
| 55 | − //#define size_t unsigned long | |
| 56 | − | |
| 57 | − /** | |
| 58 | − * memory pool structure | |
| 59 | − */ | |
| 60 | − | |
| 61 | − // node of free list | |
| 62 | − typedef struct mpool_node_t { | |
| 63 | − void *pool; // memory pool field | |
| 64 | − struct mpool_node_t *next; // next node pointer | |
| 65 | − struct mpool_node_t *prev; // prev node pointer | |
| 66 | − size_t size; | |
| 67 | − } mpool_node_t; | |
| 68 | − | |
| 69 | − typedef struct mpool_t { | |
| 70 | − void* mpool; // start of the mpool | |
| 71 | − size_t usize; // used size of the pool | |
| 72 | − size_t msize; // max size of the pool | |
| 73 | − mpool_node_t* head; // first node of memory pool free list | |
| 74 | − } mpool_t; | |
| 75 | − | |
| 76 | − void mpool_create (char* memory, size_t size, mpool_t* pool); | |
| 77 | − | |
| 78 | − void* mpool_alloc(size_t size, mpool_t* pool); | |
| 79 | − void* mpool_calloc(size_t asize, mpool_t* pool); | |
| 80 | − | |
| 81 | − void mpool_free(void* ptr, mpool_t* pool); | |
| 82 | − | |
| 83 | − size_t mpool_get_size(mpool_t* pool); | |
| 84 | − size_t mpool_get_used(mpool_t* pool); | |
| 85 | − | |
| 86 | − void leaf_pool_init(char* memory, size_t size); | |
| 87 | − | |
| 88 | − void* leaf_alloc(size_t size); | |
| 89 | − void* leaf_calloc(size_t size); | |
| 90 | − | |
| 91 | − void leaf_free(void* ptr); | |
| 92 | − | |
| 93 | − size_t leaf_pool_get_size(void); | |
| 94 | − size_t leaf_pool_get_used(void); | |
| 95 | − | |
| 96 | − void* leaf_pool_get_pool(void); | |
| 97 | − | |
| 98 | − void leaf_mempool_overrun(void); | |
| 99 | − | |
| 100 | − // User object for creating additional mempools | |
| 101 | − | |
| 102 | − typedef struct _tMempool | |
| 103 | − { | |
| 104 | − mpool_t pool; | |
| 105 | − } _tMempool; | |
| 106 | − | |
| 107 | − typedef _tMempool* tMempool; | |
| 108 | − | |
| 109 | − void tMempool_init (tMempool* const, char* memory, size_t size); | |
| 110 | − void tMempool_free (tMempool* const); | |
| 111 | − void tMempool_initToPool (tMempool* const, char* memory, size_t size, tMempool* const); | |
| 112 | − void tMempool_freeFromPool (tMempool* const, tMempool* const); | |
| 113 | − | |
| 114 | − //============================================================================== | |
| 115 | − | |
| 116 | − extern tMempool leaf_mempool; | |
| 117 | − | |
| 118 | −#ifdef __cplusplus | |
| 119 | −} | |
| 120 | −#endif | |
| 121 | − | |
| 122 | −#endif // LEAF_MPOOL_H | |
| 123 | − | |
| 124 | −//============================================================================== | |
| 125 | − | |
| 126 | − | |
| 127 | − | |
| @@ -1,133 +0,0 @@ | ||
| 1 | −/*============================================================================== | |
| 2 | − | |
| 3 | − leaf-midi.h | |
| 4 | − Created: 30 Nov 2018 11:29:26am | |
| 5 | − Author: airship | |
| 6 | − | |
| 7 | − ==============================================================================*/ | |
| 8 | − | |
| 9 | −#ifndef LEAF_MIDI_H_INCLUDED | |
| 10 | −#define LEAF_MIDI_H_INCLUDED | |
| 11 | − | |
| 12 | −#ifdef __cplusplus | |
| 13 | −extern "C" { | |
| 14 | −#endif | |
| 15 | − | |
| 16 | − //============================================================================== | |
| 17 | − | |
| 18 | −#include "leaf-global.h" | |
| 19 | −#include "leaf-mempool.h" | |
| 20 | −#include "leaf-math.h" | |
| 21 | −#include "leaf-envelopes.h" | |
| 22 | − | |
| 23 | − //============================================================================== | |
| 24 | − | |
| 25 | − // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | |
| 26 | − | |
| 27 | − // STACK implementation (fixed size) | |
| 28 | −#define STACK_SIZE 128 | |
| 29 | − typedef struct _tStack | |
| 30 | − { | |
| 31 | − int data[STACK_SIZE]; | |
| 32 | − uint16_t pos; | |
| 33 | − uint16_t size; | |
| 34 | − uint16_t capacity; | |
| 35 | − oBool ordered; | |
| 36 | − | |
| 37 | − } _tStack; | |
| 38 | − | |
| 39 | − typedef _tStack* tStack; | |
| 40 | − | |
| 41 | − void tStack_init (tStack* const); | |
| 42 | − void tStack_free (tStack* const); | |
| 43 | − void tStack_initToPool (tStack* const, tMempool* const); | |
| 44 | − void tStack_freeFromPool (tStack* const, tMempool* const); | |
| 45 | − | |
| 46 | − void tStack_setCapacity (tStack* const, uint16_t cap); | |
| 47 | − int tStack_addIfNotAlreadyThere (tStack* const, uint16_t item); | |
| 48 | − void tStack_add (tStack* const, uint16_t item); | |
| 49 | − int tStack_remove (tStack* const, uint16_t item); | |
| 50 | − void tStack_clear (tStack* const); | |
| 51 | − int tStack_first (tStack* const); | |
| 52 | − int tStack_getSize (tStack* const); | |
| 53 | − int tStack_contains (tStack* const, uint16_t item); | |
| 54 | − int tStack_next (tStack* const); | |
| 55 | − int tStack_get (tStack* const, int which); | |
| 56 | − | |
| 57 | − /* tPoly */ | |
| 58 | − typedef struct _tPoly | |
| 59 | − { | |
| 60 | − tStack stack; | |
| 61 | − tStack orderStack; | |
| 62 | − | |
| 63 | − tRamp* ramps; | |
| 64 | − float* rampVals; | |
| 65 | − oBool* firstReceived; | |
| 66 | − float glideTime; | |
| 67 | − oBool pitchGlideIsActive; | |
| 68 | − | |
| 69 | − int numVoices; | |
| 70 | − int maxNumVoices; | |
| 71 | − | |
| 72 | − //int voices[POLY_NUM_MAX_VOICES][2]; | |
| 73 | − int** voices; | |
| 74 | − | |
| 75 | − int notes[128][2]; | |
| 76 | − | |
| 77 | − int CCs[128]; | |
| 78 | − | |
| 79 | − uint8_t CCsRaw[128]; | |
| 80 | − | |
| 81 | − int lastVoiceToChange; | |
| 82 | − | |
| 83 | − float pitchBend; | |
| 84 | − tRamp pitchBendRamp; | |
| 85 | − | |
| 86 | − int currentNote; | |
| 87 | − int currentVoice; | |
| 88 | − int currentVelocity; | |
| 89 | − int maxLength; | |
| 90 | − | |
| 91 | − } _tPoly; | |
| 92 | − | |
| 93 | − typedef _tPoly* tPoly; | |
| 94 | − | |
| 95 | − /* MPoly*/ | |
| 96 | − void tPoly_init (tPoly* const, int maxNumVoices); | |
| 97 | − void tPoly_free (tPoly* const); | |
| 98 | − void tPoly_initToPool (tPoly* const, int maxNumVoices, tMempool* const); | |
| 99 | − void tPoly_freeFromPool (tPoly* const, tMempool* const); | |
| 100 | − | |
| 101 | − //ADDING A NOTE | |
| 102 | − int tPoly_noteOn (tPoly* const, int note, uint8_t vel); | |
| 103 | − int tPoly_noteOff (tPoly* const, uint8_t note); | |
| 104 | − void tPoly_orderedAddToStack (tPoly* const, uint8_t noteVal); | |
| 105 | − void tPoly_setNumVoices (tPoly* const, uint8_t numVoices); | |
| 106 | − | |
| 107 | − void tPoly_setPitchBend (tPoly* const, float pitchBend); | |
| 108 | − void tPoly_setPitchGlideActive (tPoly* const, oBool isActive); | |
| 109 | − void tPoly_setPitchGlideTime (tPoly* const, float t); | |
| 110 | − void tPoly_setBendGlideTime (tPoly* const polyh, float t); | |
| 111 | − void tPoly_setBendSamplesPerTick (tPoly* const polyh, float t); | |
| 112 | − void tPoly_tickPitch (tPoly* const); | |
| 113 | − void tPoly_tickPitchGlide (tPoly* const); | |
| 114 | − void tPoly_tickPitchBend (tPoly* const); | |
| 115 | − | |
| 116 | − int tPoly_getNumVoices (tPoly* const); | |
| 117 | − int tPoly_getNumActiveVoices (tPoly* const); | |
| 118 | − float tPoly_getPitch (tPoly* const, uint8_t voice); | |
| 119 | − int tPoly_getKey (tPoly* const, uint8_t voice); | |
| 120 | − int tPoly_getVelocity (tPoly* const, uint8_t voice); | |
| 121 | − int tPoly_isOn (tPoly* const, uint8_t voice); | |
| 122 | − | |
| 123 | − //============================================================================== | |
| 124 | − | |
| 125 | −#ifdef __cplusplus | |
| 126 | −} | |
| 127 | −#endif | |
| 128 | − | |
| 129 | −#endif // LEAF_MIDI_H_INCLUDED | |
| 130 | − | |
| 131 | −//============================================================================== | |
| 132 | − | |
| 133 | − | |
| @@ -1,208 +0,0 @@ | ||
| 1 | −/*============================================================================== | |
| 2 | − leaf-oscillators.h | |
| 3 | − Created: 20 Jan 2017 12:00:58pm | |
| 4 | − Author: Michael R Mulshine | |
| 5 | − ==============================================================================*/ | |
| 6 | − | |
| 7 | −#ifndef LEAF_OSCILLATORS_H_INCLUDED | |
| 8 | −#define LEAF_OSCILLATORS_H_INCLUDED | |
| 9 | − | |
| 10 | −#ifdef __cplusplus | |
| 11 | −extern "C" { | |
| 12 | −#endif | |
| 13 | − | |
| 14 | − //============================================================================== | |
| 15 | − | |
| 16 | −#include "leaf-math.h" | |
| 17 | −#include "leaf-mempool.h" | |
| 18 | −#include "leaf-filters.h" | |
| 19 | − | |
| 20 | − //============================================================================== | |
| 21 | − | |
| 22 | − /* tCycle: Cycle/Sine waveform. Wavetable synthesis.*/ | |
| 23 | − typedef struct _tCycle | |
| 24 | − { | |
| 25 | − // Underlying phasor | |
| 26 | − float phase; | |
| 27 | − float inc,freq; | |
| 28 | − | |
| 29 | − } _tCycle; | |
| 30 | − | |
| 31 | − typedef _tCycle* tCycle; | |
| 32 | − | |
| 33 | − void tCycle_init (tCycle* const); | |
| 34 | − void tCycle_free (tCycle* const); | |
| 35 | − void tCycle_initToPool (tCycle* const, tMempool* const); | |
| 36 | − void tCycle_freeFromPool (tCycle* const, tMempool* const); | |
| 37 | − | |
| 38 | − float tCycle_tick (tCycle* const); | |
| 39 | − int tCycle_setFreq (tCycle* const, float freq); | |
| 40 | − | |
| 41 | − //============================================================================== | |
| 42 | − | |
| 43 | − /* tTriangle: Anti-aliased Triangle waveform using wavetable interpolation. Wavetables constructed from sine components. */ | |
| 44 | − typedef struct _tTriangle | |
| 45 | − { | |
| 46 | − // Underlying phasor | |
| 47 | − float phase; | |
| 48 | − float inc,freq; | |
| 49 | − | |
| 50 | − } _tTriangle; | |
| 51 | − | |
| 52 | − typedef _tTriangle* tTriangle; | |
| 53 | − | |
| 54 | − void tTriangle_init (tTriangle* const); | |
| 55 | − void tTriangle_free (tTriangle* const); | |
| 56 | − void tTriangle_initToPool (tTriangle* const, tMempool* const); | |
| 57 | − void tTriangle_freeFromPool (tTriangle* const, tMempool* const); | |
| 58 | − | |
| 59 | − float tTriangle_tick (tTriangle* const); | |
| 60 | − int tTriangle_setFreq (tTriangle* const, float freq); | |
| 61 | − | |
| 62 | − //============================================================================== | |
| 63 | − | |
| 64 | − /* tSquare: Anti-aliased Square waveform using wavetable interpolation. Wavetables constructed from sine components. */ | |
| 65 | − typedef struct _tSquare | |
| 66 | − { | |
| 67 | − // Underlying phasor | |
| 68 | − float phase; | |
| 69 | − float inc,freq; | |
| 70 | − | |
| 71 | − } _tSquare; | |
| 72 | − | |
| 73 | − typedef _tSquare* tSquare; | |
| 74 | − | |
| 75 | − void tSquare_init (tSquare* const); | |
| 76 | − void tSquare_free (tSquare* const); | |
| 77 | − void tSquare_initToPool (tSquare* const, tMempool* const); | |
| 78 | − void tSquare_freeFromPool(tSquare* const, tMempool* const); | |
| 79 | − | |
| 80 | − float tSquare_tick (tSquare* const); | |
| 81 | − int tSquare_setFreq (tSquare* const, float freq); | |
| 82 | − | |
| 83 | − //============================================================================== | |
| 84 | − | |
| 85 | − /* tSawtooth: Anti-aliased Sawtooth waveform using wavetable interpolation. Wavetables constructed from sine components. */ | |
| 86 | − typedef struct _tSawtooth | |
| 87 | − { | |
| 88 | − // Underlying phasor | |
| 89 | − float phase; | |
| 90 | − float inc,freq; | |
| 91 | − | |
| 92 | − } _tSawtooth; | |
| 93 | − | |
| 94 | − typedef _tSawtooth* tSawtooth; | |
| 95 | − | |
| 96 | − void tSawtooth_init (tSawtooth* const); | |
| 97 | − void tSawtooth_free (tSawtooth* const); | |
| 98 | − void tSawtooth_initToPool (tSawtooth* const, tMempool* const); | |
| 99 | − void tSawtooth_freeFromPool (tSawtooth* const, tMempool* const); | |
| 100 | − | |
| 101 | − float tSawtooth_tick (tSawtooth* const); | |
| 102 | − int tSawtooth_setFreq (tSawtooth* const, float freq); | |
| 103 | − | |
| 104 | − //============================================================================== | |
| 105 | − | |
| 106 | − /* tPhasor: Aliasing phasor [0.0, 1.0) */ | |
| 107 | − typedef struct _tPhasor | |
| 108 | − { | |
| 109 | − float phase; | |
| 110 | − float inc,freq; | |
| 111 | − | |
| 112 | − } _tPhasor; | |
| 113 | − | |
| 114 | − typedef _tPhasor* tPhasor; | |
| 115 | − | |
| 116 | − void tPhasor_init (tPhasor* const); | |
| 117 | − void tPhasor_free (tPhasor* const); | |
| 118 | − void tPhasor_initToPool (tPhasor* const, tMempool* const); | |
| 119 | − void tPhasor_freeFromPool(tPhasor* const, tMempool* const); | |
| 120 | − | |
| 121 | − float tPhasor_tick (tPhasor* const); | |
| 122 | − int tPhasor_setFreq (tPhasor* const, float freq); | |
| 123 | − | |
| 124 | − //============================================================================== | |
| 125 | − | |
| 126 | − /* tNoise. WhiteNoise, PinkNoise. */ | |
| 127 | − typedef enum NoiseType | |
| 128 | − { | |
| 129 | − WhiteNoise=0, | |
| 130 | − PinkNoise, | |
| 131 | − NoiseTypeNil, | |
| 132 | − } NoiseType; | |
| 133 | − | |
| 134 | − typedef struct _tNoise | |
| 135 | − { | |
| 136 | − NoiseType type; | |
| 137 | − float pinkb0, pinkb1, pinkb2; | |
| 138 | − float(*rand)(void); | |
| 139 | − | |
| 140 | − } _tNoise; | |
| 141 | − | |
| 142 | − typedef _tNoise* tNoise; | |
| 143 | − | |
| 144 | − void tNoise_init (tNoise* const, NoiseType type); | |
| 145 | − void tNoise_free (tNoise* const); | |
| 146 | − void tNoise_initToPool (tNoise* const, NoiseType type, tMempool* const); | |
| 147 | − void tNoise_freeFromPool (tNoise* const, tMempool* const); | |
| 148 | − | |
| 149 | − float tNoise_tick (tNoise* const); | |
| 150 | − | |
| 151 | − //============================================================================== | |
| 152 | − | |
| 153 | − /* tNeuron */ | |
| 154 | − typedef enum NeuronMode | |
| 155 | − { | |
| 156 | − NeuronNormal = 0, | |
| 157 | − NeuronTanh, | |
| 158 | − NeuronAaltoShaper, | |
| 159 | − NeuronModeNil | |
| 160 | − } NeuronMode; | |
| 161 | − | |
| 162 | − typedef struct _tNeuron | |
| 163 | − { | |
| 164 | − tPoleZero f; | |
| 165 | − | |
| 166 | − NeuronMode mode; | |
| 167 | − | |
| 168 | − float voltage, current; | |
| 169 | − float timeStep; | |
| 170 | − | |
| 171 | − float alpha[3]; | |
| 172 | − float beta[3]; | |
| 173 | − float rate[3]; | |
| 174 | − float V[3]; | |
| 175 | − float P[3]; | |
| 176 | − float gK, gN, gL, C; | |
| 177 | − } _tNeuron; | |
| 178 | − | |
| 179 | − typedef _tNeuron* tNeuron; | |
| 180 | − | |
| 181 | − void tNeuron_init (tNeuron* const); | |
| 182 | − void tNeuron_free (tNeuron* const); | |
| 183 | − void tNeuron_initToPool (tNeuron* const, tMempool* const); | |
| 184 | − void tNeuron_freeFromPool(tNeuron* const, tMempool* const); | |
| 185 | − | |
| 186 | − void tNeuron_reset (tNeuron* const); | |
| 187 | − float tNeuron_tick (tNeuron* const); | |
| 188 | − void tNeuron_setMode (tNeuron* const, NeuronMode mode); | |
| 189 | − void tNeuron_setCurrent (tNeuron* const, float current); | |
| 190 | − void tNeuron_setK (tNeuron* const, float K); | |
| 191 | − void tNeuron_setL (tNeuron* const, float L); | |
| 192 | − void tNeuron_setN (tNeuron* const, float N); | |
| 193 | − void tNeuron_setC (tNeuron* const, float C); | |
| 194 | − void tNeuron_setV1 (tNeuron* const, float V1); | |
| 195 | − void tNeuron_setV2 (tNeuron* const, float V2); | |
| 196 | − void tNeuron_setV3 (tNeuron* const, float V3); | |
| 197 | − void tNeuron_setTimeStep (tNeuron* const, float timestep); | |
| 198 | − | |
| 199 | − //============================================================================== | |
| 200 | − | |
| 201 | −#ifdef __cplusplus | |
| 202 | −} | |
| 203 | −#endif | |
| 204 | − | |
| 205 | −#endif // LEAF_OSCILLATORS_H_INCLUDED | |
| 206 | − | |
| 207 | −//============================================================================== | |
| 208 | − | |
| @@ -1,251 +0,0 @@ | ||
| 1 | −/* | |
| 2 | − ============================================================================== | |
| 3 | − | |
| 4 | − leaf-physical.h | |
| 5 | − Created: 30 Nov 2018 10:41:55am | |
| 6 | − Author: airship | |
| 7 | − | |
| 8 | − ============================================================================== | |
| 9 | − */ | |
| 10 | − | |
| 11 | −#ifndef LEAF_PHYSICAL_H_INCLUDED | |
| 12 | −#define LEAF_PHYSICAL_H_INCLUDED | |
| 13 | − | |
| 14 | −#ifdef __cplusplus | |
| 15 | −extern "C" { | |
| 16 | −#endif | |
| 17 | − | |
| 18 | − //============================================================================== | |
| 19 | − | |
| 20 | −#include "leaf-global.h" | |
| 21 | −#include "leaf-math.h" | |
| 22 | −#include "leaf-mempool.h" | |
| 23 | −#include "leaf-delay.h" | |
| 24 | −#include "leaf-filters.h" | |
| 25 | −#include "leaf-oscillators.h" | |
| 26 | −#include "leaf-envelopes.h" | |
| 27 | −#include "leaf-dynamics.h" | |
| 28 | − | |
| 29 | − //============================================================================== | |
| 30 | − | |
| 31 | − /* Karplus Strong model */ | |
| 32 | − typedef struct _tPluck | |
| 33 | − { | |
| 34 | − tAllpassDelay delayLine; // Allpass or Linear?? big difference... | |
| 35 | − tOneZero loopFilter; | |
| 36 | − tOnePole pickFilter; | |
| 37 | − tNoise noise; | |
| 38 | − | |
| 39 | − float lastOut; | |
| 40 | − float loopGain; | |
| 41 | − float lastFreq; | |
| 42 | − | |
| 43 | − float sr; | |
| 44 | − | |
| 45 | − } _tPluck; | |
| 46 | − | |
| 47 | − typedef _tPluck* tPluck; | |
| 48 | − | |
| 49 | − void tPluck_init (tPluck* const, float lowestFrequency); //float delayBuff[DELAY_LENGTH]); | |
| 50 | − void tPluck_free (tPluck* const); | |
| 51 | − void tPluck_initToPool (tPluck* const, float lowestFrequency, tMempool* const); | |
| 52 | − void tPluck_freeFromPool (tPluck* const, tMempool* const); | |
| 53 | − | |
| 54 | − float tPluck_tick (tPluck* const); | |
| 55 | − | |
| 56 | − // Pluck the string. | |
| 57 | − void tPluck_pluck (tPluck* const, float amplitude); | |
| 58 | − | |
| 59 | − // Start a note with the given frequency and amplitude.; | |
| 60 | − void tPluck_noteOn (tPluck* const, float frequency, float amplitude ); | |
| 61 | − | |
| 62 | − // Stop a note with the given amplitude (speed of decay). | |
| 63 | − void tPluck_noteOff (tPluck* const, float amplitude ); | |
| 64 | − | |
| 65 | − // Set instrument parameters for a particular frequency. | |
| 66 | − void tPluck_setFrequency (tPluck* const, float frequency ); | |
| 67 | − | |
| 68 | − // Perform the control change specified by \e number and \e value (0.0 - 128.0). | |
| 69 | − void tPluck_controlChange (tPluck* const, int number, float value); | |
| 70 | − | |
| 71 | − // tPluck Utilities. | |
| 72 | − float tPluck_getLastOut (tPluck* const); | |
| 73 | − | |
| 74 | − //============================================================================== | |
| 75 | − | |
| 76 | − typedef enum SKControlType | |
| 77 | − { | |
| 78 | − SKPickPosition = 0, | |
| 79 | − SKStringDamping, | |
| 80 | − SKDetune, | |
| 81 | − SKControlTypeNil | |
| 82 | − } SKControlType; | |
| 83 | − | |
| 84 | − /* Stif Karplus Strong model */ | |
| 85 | − typedef struct _tKarplusStrong | |
| 86 | − { | |
| 87 | − tAllpassDelay delayLine; | |
| 88 | − tLinearDelay combDelay; | |
| 89 | − tOneZero filter; | |
| 90 | − tNoise noise; | |
| 91 | − tBiQuad biquad[4]; | |
| 92 | − | |
| 93 | − uint32_t length; | |
| 94 | − float loopGain; | |
| 95 | − float baseLoopGain; | |
| 96 | − float lastFrequency; | |
| 97 | − float lastLength; | |
| 98 | − float stretching; | |
| 99 | − float pluckAmplitude; | |
| 100 | − float pickupPosition; | |
| 101 | − | |
| 102 | − float lastOut; | |
| 103 | − | |
| 104 | − } _tKarplusStrong; | |
| 105 | − | |
| 106 | − typedef _tKarplusStrong* tKarplusStrong; | |
| 107 | − | |
| 108 | − void tKarplusStrong_init (tKarplusStrong* const, float lowestFrequency); // float delayBuff[2][DELAY_LENGTH]); | |
| 109 | − void tKarplusStrong_free (tKarplusStrong* const); | |
| 110 | − void tKarplusStrong_initToPool (tKarplusStrong* const, float lowestFrequency, tMempool* const); | |
| 111 | − void tKarplusStrong_freeFromPool (tKarplusStrong* const, tMempool* const); | |
| 112 | − | |
| 113 | − float tKarplusStrong_tick (tKarplusStrong* const); | |
| 114 | − | |
| 115 | − // Pluck the string. | |
| 116 | − void tKarplusStrong_pluck (tKarplusStrong* const, float amplitude); | |
| 117 | − | |
| 118 | − // Start a note with the given frequency and amplitude.; | |
| 119 | − void tKarplusStrong_noteOn (tKarplusStrong* const, float frequency, float amplitude ); | |
| 120 | − | |
| 121 | − // Stop a note with the given amplitude (speed of decay). | |
| 122 | − void tKarplusStrong_noteOff (tKarplusStrong* const, float amplitude ); | |
| 123 | − | |
| 124 | − // Set instrument parameters for a particular frequency. | |
| 125 | − void tKarplusStrong_setFrequency (tKarplusStrong* const, float frequency ); | |
| 126 | − | |
| 127 | − // Perform the control change specified by \e number and \e value (0.0 - 128.0). | |
| 128 | − // Use SKPickPosition, SKStringDamping, or SKDetune for type. | |
| 129 | − void tKarplusStrong_controlChange (tKarplusStrong* const, SKControlType type, float value); | |
| 130 | − | |
| 131 | − // Set the stretch "factor" of the string (0.0 - 1.0). | |
| 132 | − void tKarplusStrong_setStretch (tKarplusStrong* const, float stretch ); | |
| 133 | − | |
| 134 | − // Set the pluck or "excitation" position along the string (0.0 - 1.0). | |
| 135 | − void tKarplusStrong_setPickupPosition (tKarplusStrong* const, float position ); | |
| 136 | − | |
| 137 | − // Set the base loop gain. | |
| 138 | − void tKarplusStrong_setBaseLoopGain (tKarplusStrong* const, float aGain ); | |
| 139 | − | |
| 140 | − // tKarplusStrong utilities. | |
| 141 | − float tKarplusStrong_getLastOut (tKarplusStrong* const); | |
| 142 | − | |
| 143 | − // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | |
| 144 | − | |
| 145 | − /* Simple Living String */ | |
| 146 | − typedef struct _tSimpleLivingString { | |
| 147 | − float freq, waveLengthInSamples; // the frequency of the string, determining delay length | |
| 148 | − float dampFreq; // frequency for the bridge LP filter, in Hz | |
| 149 | − float decay; // amplitude damping factor for the string (only active in mode 0) | |
| 150 | − float levMode; | |
| 151 | − float curr; | |
| 152 | − tLinearDelay delayLine; | |
| 153 | − tOnePole bridgeFilter; | |
| 154 | − tHighpass DCblocker; | |
| 155 | − tFeedbackLeveler fbLev; | |
| 156 | − tExpSmooth wlSmooth; | |
| 157 | − } _tSimpleLivingString; | |
| 158 | − | |
| 159 | − typedef _tSimpleLivingString* tSimpleLivingString; | |
| 160 | − | |
| 161 | − void tSimpleLivingString_init (tSimpleLivingString* const, float freq, float dampFreq, | |
| 162 | − float decay, float targetLev, float levSmoothFactor, | |
| 163 | − float levStrength, int levMode); | |
| 164 | − void tSimpleLivingString_free (tSimpleLivingString* const); | |
| 165 | − void tSimpleLivingString_initToPool (tSimpleLivingString* const, float freq, float dampFreq, | |
| 166 | − float decay, float targetLev, float levSmoothFactor, | |
| 167 | − float levStrength, int levMode, tMempool* const); | |
| 168 | − void tSimpleLivingString_freeFromPool (tSimpleLivingString* const, tMempool* const); | |
| 169 | − | |
| 170 | − float tSimpleLivingString_tick (tSimpleLivingString* const, float input); | |
| 171 | − float tSimpleLivingString_sample (tSimpleLivingString* const); | |
| 172 | − void tSimpleLivingString_setFreq (tSimpleLivingString* const, float freq); | |
| 173 | − void tSimpleLivingString_setWaveLength (tSimpleLivingString* const, float waveLength); // in samples | |
| 174 | − void tSimpleLivingString_setDampFreq (tSimpleLivingString* const, float dampFreq); | |
| 175 | − void tSimpleLivingString_setDecay (tSimpleLivingString* const, float decay); // should be near 1.0 | |
| 176 | − void tSimpleLivingString_setTargetLev (tSimpleLivingString* const, float targetLev); | |
| 177 | − void tSimpleLivingString_setLevSmoothFactor (tSimpleLivingString* const, float levSmoothFactor); | |
| 178 | − void tSimpleLivingString_setLevStrength (tSimpleLivingString* const, float levStrength); | |
| 179 | − void tSimpleLivingString_setLevMode (tSimpleLivingString* const, int levMode); | |
| 180 | − | |
| 181 | − // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | |
| 182 | − | |
| 183 | − /* Living String */ | |
| 184 | − typedef struct _tLivingString { | |
| 185 | − float freq, waveLengthInSamples; // the frequency of the whole string, determining delay length | |
| 186 | − float pickPos; // the pick position, dividing the string in two, in ratio | |
| 187 | − float prepIndex; // the amount of pressure on the pickpoint of the string (near 0=soft obj, near 1=hard obj) | |
| 188 | − float dampFreq; // frequency for the bridge LP filter, in Hz | |
| 189 | − float decay; // amplitude damping factor for the string (only active in mode 0) | |
| 190 | − float levMode; | |
| 191 | − float curr; | |
| 192 | − tLinearDelay delLF,delUF,delUB,delLB; // delay for lower/upper/forward/backward part of the waveguide model | |
| 193 | − tOnePole bridgeFilter, nutFilter, prepFilterU, prepFilterL; | |
| 194 | − tHighpass DCblockerL, DCblockerU; | |
| 195 | − tFeedbackLeveler fbLevU, fbLevL; | |
| 196 | − tExpSmooth wlSmooth, ppSmooth; | |
| 197 | − } _tLivingString; | |
| 198 | − | |
| 199 | − typedef _tLivingString* tLivingString; | |
| 200 | − | |
| 201 | − void tLivingString_init (tLivingString* const, float freq, float pickPos, float prepIndex, | |
| 202 | − float dampFreq, float decay, float targetLev, float levSmoothFactor, | |
| 203 | − float levStrength, int levMode); | |
| 204 | − void tLivingString_free (tLivingString* const); | |
| 205 | − void tLivingString_initToPool (tLivingString* const, float freq, float pickPos, float prepIndex, | |
| 206 | − float dampFreq, float decay, float targetLev, float levSmoothFactor, | |
| 207 | − float levStrength, int levMode, tMempool* const); | |
| 208 | − void tLivingString_freeFromPool (tLivingString* const, tMempool* const); | |
| 209 | − | |
| 210 | − float tLivingString_tick (tLivingString* const, float input); | |
| 211 | − float tLivingString_sample (tLivingString* const); | |
| 212 | − void tLivingString_setFreq (tLivingString* const, float freq); | |
| 213 | − void tLivingString_setWaveLength (tLivingString* const, float waveLength); // in samples | |
| 214 | − void tLivingString_setPickPos (tLivingString* const, float pickPos); | |
| 215 | − void tLivingString_setPrepIndex (tLivingString* const, float prepIndex); | |
| 216 | − void tLivingString_setDampFreq (tLivingString* const, float dampFreq); | |
| 217 | − void tLivingString_setDecay (tLivingString* const, float decay); // should be near 1.0 | |
| 218 | − void tLivingString_setTargetLev (tLivingString* const, float targetLev); | |
| 219 | − void tLivingString_setLevSmoothFactor (tLivingString* const, float levSmoothFactor); | |
| 220 | − void tLivingString_setLevStrength (tLivingString* const, float levStrength); | |
| 221 | − void tLivingString_setLevMode (tLivingString* const, int levMode); | |
| 222 | − | |
| 223 | − // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | |
| 224 | − | |
| 225 | − //Reed Table - borrowed from STK | |
| 226 | − typedef struct _tReedTable { | |
| 227 | − float offset, slope; | |
| 228 | − } _tReedTable; | |
| 229 | − | |
| 230 | − typedef _tReedTable* tReedTable; | |
| 231 | − | |
| 232 | − void tReedTable_init (tReedTable* const, float offset, float slope); | |
| 233 | − void tReedTable_free (tReedTable* const); | |
| 234 | − void tReedTable_initToPool (tReedTable* const, float offset, float slope, tMempool* const); | |
| 235 | − void tReedTable_freeFromPool (tReedTable* const, tMempool* const); | |
| 236 | − | |
| 237 | − float tReedTable_tick (tReedTable* const, float input); | |
| 238 | − float tReedTable_tanh_tick (tReedTable* const, float input); //tanh softclip version of reed table - replacing the hard clip in original stk code | |
| 239 | − void tReedTable_setOffset (tReedTable* const, float offset); | |
| 240 | − void tReedTable_setSlope (tReedTable* const, float slope); | |
| 241 | − | |
| 242 | − //============================================================================== | |
| 243 | − | |
| 244 | −#ifdef __cplusplus | |
| 245 | −} | |
| 246 | −#endif | |
| 247 | − | |
| 248 | −#endif // LEAF_PHYSICAL_H_INCLUDED | |
| 249 | − | |
| 250 | −//============================================================================== | |
| 251 | − | |
| @@ -1,167 +0,0 @@ | ||
| 1 | −/*============================================================================== | |
| 2 | − | |
| 3 | − leaf-reverb.h | |
| 4 | − Created: 20 Jan 2017 12:02:04pm | |
| 5 | − Author: Michael R Mulshine | |
| 6 | − | |
| 7 | − ==============================================================================*/ | |
| 8 | − | |
| 9 | −#ifndef LEAF_REVERB_H_INCLUDED | |
| 10 | −#define LEAF_REVERB_H_INCLUDED | |
| 11 | − | |
| 12 | −#ifdef __cplusplus | |
| 13 | −extern "C" { | |
| 14 | −#endif | |
| 15 | − | |
| 16 | − //============================================================================== | |
| 17 | − | |
| 18 | −#include "leaf-global.h" | |
| 19 | −#include "leaf-math.h" | |
| 20 | −#include "leaf-mempool.h" | |
| 21 | −#include "leaf-delay.h" | |
| 22 | −#include "leaf-filters.h" | |
| 23 | −#include "leaf-oscillators.h" | |
| 24 | − | |
| 25 | − //============================================================================== | |
| 26 | − | |
| 27 | − /* PRCReverb: Reverb, reimplemented from STK (Cook and Scavone). */ | |
| 28 | − typedef struct _tPRCReverb | |
| 29 | − { | |
| 30 | − float mix, t60; | |
| 31 | − | |
| 32 | − float inv_441; | |
| 33 | − | |
| 34 | − tDelay allpassDelays[2]; | |
| 35 | − tDelay combDelay; | |
| 36 | − float allpassCoeff; | |
| 37 | − float combCoeff; | |
| 38 | − | |
| 39 | − float lastIn, lastOut; | |
| 40 | − | |
| 41 | − } _tPRCReverb; | |
| 42 | − | |
| 43 | − typedef _tPRCReverb* tPRCReverb; | |
| 44 | − | |
| 45 | − void tPRCReverb_init (tPRCReverb* const, float t60); | |
| 46 | − void tPRCReverb_free (tPRCReverb* const); | |
| 47 | − void tPRCReverb_initToPool (tPRCReverb* const, float t60, tMempool* const); | |
| 48 | − void tPRCReverb_freeFromPool (tPRCReverb* const, tMempool* const); | |
| 49 | − | |
| 50 | − void tPRCReverb_clear (tPRCReverb* const); | |
| 51 | − float tPRCReverb_tick (tPRCReverb* const, float input); | |
| 52 | − | |
| 53 | − // Set reverb time in seconds. | |
| 54 | − void tPRCReverb_setT60 (tPRCReverb* const, float t60); | |
| 55 | − | |
| 56 | − // Set mix between dry input and wet output signal. | |
| 57 | − void tPRCReverb_setMix (tPRCReverb* const, float mix); | |
| 58 | − | |
| 59 | − //============================================================================== | |
| 60 | − | |
| 61 | − /* NReverb: Reverb, reimplemented from STK (Cook and Scavone). */ | |
| 62 | − typedef struct _tNReverb | |
| 63 | − { | |
| 64 | − float mix, t60; | |
| 65 | − | |
| 66 | − float inv_sr, inv_441; | |
| 67 | − | |
| 68 | − tLinearDelay allpassDelays[8]; | |
| 69 | − tLinearDelay combDelays[6]; | |
| 70 | − float allpassCoeff; | |
| 71 | − float combCoeffs[6]; | |
| 72 | − float lowpassState; | |
| 73 | − | |
| 74 | − float lastIn, lastOut; | |
| 75 | − | |
| 76 | − } _tNReverb; | |
| 77 | − | |
| 78 | − typedef _tNReverb* tNReverb; | |
| 79 | − | |
| 80 | − void tNReverb_init (tNReverb* const, float t60); | |
| 81 | − void tNReverb_free (tNReverb* const); | |
| 82 | − void tNReverb_initToPool (tNReverb* const, float t60, tMempool* const); | |
| 83 | − void tNReverb_freeFromPool (tNReverb* const, tMempool* const); | |
| 84 | − | |
| 85 | − void tNReverb_clear (tNReverb* const); | |
| 86 | − float tNReverb_tick (tNReverb* const, float input); | |
| 87 | − void tNReverb_tickStereo (tNReverb* const rev, float input, float* output); | |
| 88 | − | |
| 89 | − // Set reverb time in seconds. | |
| 90 | − void tNReverb_setT60 (tNReverb* const, float t60); | |
| 91 | − | |
| 92 | − // Set mix between dry input and wet output signal. | |
| 93 | − void tNReverb_setMix (tNReverb* const, float mix); | |
| 94 | − | |
| 95 | − //============================================================================== | |
| 96 | − | |
| 97 | − typedef struct _tDattorroReverb | |
| 98 | − { | |
| 99 | − float predelay; | |
| 100 | − float input_filter; | |
| 101 | − float feedback_filter; | |
| 102 | − float feedback_gain; | |
| 103 | − float mix; | |
| 104 | − uint32_t frozen; | |
| 105 | − | |
| 106 | − float size, size_max, t; | |
| 107 | − | |
| 108 | − float f1_delay_2_last, | |
| 109 | − f2_delay_2_last; | |
| 110 | − | |
| 111 | − float f1_last, | |
| 112 | − f2_last; | |
| 113 | − | |
| 114 | − // INPUT | |
| 115 | − tTapeDelay in_delay; | |
| 116 | − tOnePole in_filter; | |
| 117 | − tAllpass in_allpass[4]; | |
| 118 | − | |
| 119 | − // FEEDBACK 1 | |
| 120 | − tAllpass f1_allpass; | |
| 121 | − tTapeDelay f1_delay_1; | |
| 122 | − tOnePole f1_filter; | |
| 123 | − tTapeDelay f1_delay_2; | |
| 124 | − tTapeDelay f1_delay_3; | |
| 125 | − tHighpass f1_hp; | |
| 126 | − | |
| 127 | − tCycle f1_lfo; | |
| 128 | − | |
| 129 | − // FEEDBACK 2 | |
| 130 | − tAllpass f2_allpass; | |
| 131 | − tTapeDelay f2_delay_1; | |
| 132 | − tOnePole f2_filter; | |
| 133 | − tTapeDelay f2_delay_2; | |
| 134 | − tTapeDelay f2_delay_3; | |
| 135 | − tHighpass f2_hp; | |
| 136 | − | |
| 137 | − tCycle f2_lfo; | |
| 138 | − | |
| 139 | − } _tDattorroReverb; | |
| 140 | − | |
| 141 | − typedef _tDattorroReverb* tDattorroReverb; | |
| 142 | − | |
| 143 | − void tDattorroReverb_init (tDattorroReverb* const); | |
| 144 | − void tDattorroReverb_free (tDattorroReverb* const); | |
| 145 | − void tDattorroReverb_initToPool (tDattorroReverb* const, tMempool* const); | |
| 146 | − void tDattorroReverb_freeFromPool (tDattorroReverb* const, tMempool* const); | |
| 147 | − | |
| 148 | − void tDattorroReverb_clear (tDattorroReverb* const); | |
| 149 | − float tDattorroReverb_tick (tDattorroReverb* const, float input); | |
| 150 | − void tDattorroReverb_tickStereo (tDattorroReverb* const rev, float input, float* output); | |
| 151 | − void tDattorroReverb_setMix (tDattorroReverb* const, float mix); | |
| 152 | − void tDattorroReverb_setFreeze (tDattorroReverb* const rev, uint32_t freeze); | |
| 153 | − void tDattorroReverb_setHP (tDattorroReverb* const, float freq); | |
| 154 | − void tDattorroReverb_setSize (tDattorroReverb* const, float size); | |
| 155 | − void tDattorroReverb_setInputDelay (tDattorroReverb* const, float preDelay); | |
| 156 | − void tDattorroReverb_setInputFilter (tDattorroReverb* const, float freq); | |
| 157 | − void tDattorroReverb_setFeedbackFilter (tDattorroReverb* const, float freq); | |
| 158 | − void tDattorroReverb_setFeedbackGain (tDattorroReverb* const, float gain); | |
| 159 | − | |
| 160 | −#ifdef __cplusplus | |
| 161 | −} | |
| 162 | −#endif | |
| 163 | − | |
| 164 | −#endif // LEAF_REVERB_H_INCLUDED | |
| 165 | − | |
| 166 | −//============================================================================== | |
| 167 | − | |
| @@ -1,176 +0,0 @@ | ||
| 1 | −/*============================================================================== | |
| 2 | − | |
| 3 | − leaf-sampling.h | |
| 4 | − Created: 23 Jan 2019 11:22:09am | |
| 5 | − Author: Mike Mulshine | |
| 6 | − | |
| 7 | − ==============================================================================*/ | |
| 8 | − | |
| 9 | − | |
| 10 | −#ifndef LEAF_SAMPLING_H_INCLUDED | |
| 11 | −#define LEAF_SAMPLING_H_INCLUDED | |
| 12 | − | |
| 13 | −#ifdef __cplusplus | |
| 14 | −extern "C" { | |
| 15 | −#endif | |
| 16 | − | |
| 17 | − //============================================================================== | |
| 18 | − | |
| 19 | −#include "leaf-global.h" | |
| 20 | −#include "leaf-math.h" | |
| 21 | −#include "leaf-mempool.h" | |
| 22 | −#include "leaf-envelopes.h" | |
| 23 | −#include "leaf-mempool.h" | |
| 24 | −#include "leaf-analysis.h" | |
| 25 | − | |
| 26 | − //============================================================================== | |
| 27 | − | |
| 28 | − typedef enum RecordMode | |
| 29 | − { | |
| 30 | − RecordOneShot = 0, | |
| 31 | − RecordLoop, | |
| 32 | − RecordModeNil | |
| 33 | − } RecordMode; | |
| 34 | − | |
| 35 | − typedef struct _tBuffer | |
| 36 | − { | |
| 37 | − float* buff; | |
| 38 | − | |
| 39 | − uint32_t idx; | |
| 40 | − uint32_t bufferLength; | |
| 41 | − uint32_t recordedLength; | |
| 42 | − RecordMode mode; | |
| 43 | − | |
| 44 | − int active; | |
| 45 | − | |
| 46 | − } _tBuffer; | |
| 47 | − | |
| 48 | − typedef _tBuffer* tBuffer; | |
| 49 | − | |
| 50 | − void tBuffer_init (tBuffer* const, uint32_t length); | |
| 51 | − void tBuffer_free (tBuffer* const); | |
| 52 | − void tBuffer_initToPool (tBuffer* const, uint32_t length, tMempool* const); | |
| 53 | − void tBuffer_freeFromPool (tBuffer* const, tMempool* const); | |
| 54 | − | |
| 55 | − void tBuffer_tick (tBuffer* const, float sample); | |
| 56 | − | |
| 57 | − void tBuffer_read (tBuffer* const, float* buff, uint32_t len); | |
| 58 | − | |
| 59 | − float tBuffer_get (tBuffer* const, int idx); | |
| 60 | − | |
| 61 | − void tBuffer_record (tBuffer* const); | |
| 62 | − void tBuffer_stop (tBuffer* const); | |
| 63 | − int tBuffer_getRecordPosition (tBuffer* const); | |
| 64 | − | |
| 65 | − void tBuffer_setRecordMode (tBuffer* const, RecordMode mode); | |
| 66 | − | |
| 67 | − void tBuffer_clear (tBuffer* const); | |
| 68 | − | |
| 69 | − uint32_t tBuffer_getBufferLength (tBuffer* const); | |
| 70 | − uint32_t tBuffer_getRecordedLength (tBuffer* const sb); | |
| 71 | − | |
| 72 | − //============================================================================== | |
| 73 | − | |
| 74 | − typedef enum PlayMode | |
| 75 | − { | |
| 76 | − PlayNormal, | |
| 77 | − PlayLoop, | |
| 78 | − PlayBackAndForth, | |
| 79 | − PlayModeNil | |
| 80 | − } PlayMode; | |
| 81 | − | |
| 82 | − typedef struct _tSampler | |
| 83 | − { | |
| 84 | − tBuffer samp; | |
| 85 | − | |
| 86 | − tRamp gain; | |
| 87 | − | |
| 88 | − float idx; | |
| 89 | − float inc; | |
| 90 | − float last; | |
| 91 | − float iinc; | |
| 92 | − int8_t dir; | |
| 93 | − int8_t flip; | |
| 94 | − int8_t bnf; | |
| 95 | − | |
| 96 | − int32_t start, targetstart; | |
| 97 | − int32_t end, targetend; | |
| 98 | − | |
| 99 | − uint32_t len; | |
| 100 | − uint32_t cfxlen; | |
| 101 | − float numticks; | |
| 102 | − PlayMode mode; | |
| 103 | − int retrigger; | |
| 104 | − | |
| 105 | − int active; | |
| 106 | − | |
| 107 | − } _tSampler; | |
| 108 | − | |
| 109 | − typedef _tSampler* tSampler; | |
| 110 | − | |
| 111 | − void tSampler_init (tSampler* const, tBuffer* const); | |
| 112 | − void tSampler_free (tSampler* const); | |
| 113 | − void tSampler_initToPool (tSampler* const, tBuffer* const, tMempool* const); | |
| 114 | − void tSampler_freeFromPool (tSampler* const, tMempool* const); | |
| 115 | − | |
| 116 | − float tSampler_tick (tSampler* const); | |
| 117 | − | |
| 118 | − void tSampler_setSample (tSampler* const, tBuffer* const); | |
| 119 | − | |
| 120 | − void tSampler_setMode (tSampler* const, PlayMode mode); | |
| 121 | − | |
| 122 | − void tSampler_play (tSampler* const); | |
| 123 | − void tSampler_stop (tSampler* const); | |
| 124 | − | |
| 125 | − void tSampler_setStart (tSampler* const, int32_t start); | |
| 126 | − void tSampler_setEnd (tSampler* const, int32_t end); | |
| 127 | − | |
| 128 | − static void handleStartEndChange (tSampler* const sp); | |
| 129 | − | |
| 130 | − void tSampler_setCrossfadeLength (tSampler* const sp, uint32_t length); | |
| 131 | − | |
| 132 | − void tSampler_setRate (tSampler* const, float rate); | |
| 133 | − | |
| 134 | − //============================================================================== | |
| 135 | − | |
| 136 | − typedef struct _tAutoSampler | |
| 137 | − { | |
| 138 | − tSampler sampler; | |
| 139 | − tEnvelopeFollower ef; | |
| 140 | − uint32_t windowSize; | |
| 141 | − float threshold; | |
| 142 | − float previousPower; | |
| 143 | − uint32_t sampleCounter; | |
| 144 | − uint32_t powerCounter; | |
| 145 | − uint8_t sampleTriggered; | |
| 146 | − } _tAutoSampler; | |
| 147 | − | |
| 148 | − typedef _tAutoSampler* tAutoSampler; | |
| 149 | − | |
| 150 | − void tAutoSampler_init (tAutoSampler* const, tBuffer* const); | |
| 151 | − void tAutoSampler_free (tAutoSampler* const); | |
| 152 | − void tAutoSampler_initToPool (tAutoSampler* const, tBuffer* const, tMempool* const); | |
| 153 | − void tAutoSampler_freeFromPool (tAutoSampler* const, tMempool* const); | |
| 154 | − | |
| 155 | − float tAutoSampler_tick (tAutoSampler* const, float input); | |
| 156 | − | |
| 157 | − void tAutoSampler_setBuffer (tAutoSampler* const, tBuffer* const); | |
| 158 | − | |
| 159 | − void tAutoSampler_setMode (tAutoSampler* const, PlayMode mode); | |
| 160 | − | |
| 161 | − void tAutoSampler_play (tAutoSampler* const); | |
| 162 | − void tAutoSampler_stop (tAutoSampler* const); | |
| 163 | − | |
| 164 | − void tAutoSampler_setThreshold (tAutoSampler* const, float thresh); | |
| 165 | − void tAutoSampler_setWindowSize (tAutoSampler* const, uint32_t size); | |
| 166 | − void tAutoSampler_setCrossfadeLength (tAutoSampler* const, uint32_t length); | |
| 167 | − | |
| 168 | − void tAutoSampler_setRate (tAutoSampler* const, float rate); | |
| 169 | − | |
| 170 | −#ifdef __cplusplus | |
| 171 | −} | |
| 172 | −#endif | |
| 173 | − | |
| 174 | −#endif // LEAF_SAMPLING_H_INCLUDED | |
| 175 | − | |
| 176 | −//============================================================================== | |
| @@ -1,100 +0,0 @@ | ||
| 1 | −/*============================================================================== | |
| 2 | − | |
| 3 | − leaf-tables.h | |
| 4 | − Created: 4 Dec 2016 9:42:41pm | |
| 5 | − Author: Michael R Mulshine | |
| 6 | − | |
| 7 | −==============================================================================*/ | |
| 8 | − | |
| 9 | −#ifndef LEAF_TABLES_H_INCLUDED | |
| 10 | −#define LEAF_TABLES_H_INCLUDED | |
| 11 | − | |
| 12 | −#ifdef __cplusplus | |
| 13 | −extern "C" { | |
| 14 | −#endif | |
| 15 | − | |
| 16 | −//============================================================================== | |
| 17 | − | |
| 18 | −#include "leaf-math.h" | |
| 19 | − | |
| 20 | −//============================================================================== | |
| 21 | − | |
| 22 | − | |
| 23 | −#define SINE_TABLE_SIZE 2048 | |
| 24 | −#define SAW_TABLE_SIZE 2048 | |
| 25 | −#define SQR_TABLE_SIZE 2048 | |
| 26 | −#define TRI_TABLE_SIZE 2048 | |
| 27 | −#define EXP_DECAY_TABLE_SIZE 65536 | |
| 28 | −#define ATTACK_DECAY_INC_TABLE_SIZE 65536 | |
| 29 | −#define TANH1_TABLE_SIZE 65536 | |
| 30 | −#define DECAY_COEFF_TABLE_SIZE 4096 | |
| 31 | −#define MTOF1_TABLE_SIZE 4096 | |
| 32 | −#define FILTERTAN_TABLE_SIZE 4096 | |
| 33 | − | |
| 34 | −#define SHAPER1_TABLE_SIZE 65536 | |
| 35 | −extern const float shaper1[SHAPER1_TABLE_SIZE]; | |
| 36 | − | |
| 37 | −#define COEFFS_SIZE 32 | |
| 38 | −extern const float* firCoeffs[COEFFS_SIZE]; | |
| 39 | −extern const float firNumTaps[COEFFS_SIZE]; | |
| 40 | −extern const float fir2XLow[32]; | |
| 41 | −extern const float fir4XLow[64]; | |
| 42 | −extern const float fir8XLow[64]; | |
| 43 | −extern const float fir16XLow[128]; | |
| 44 | −extern const float fir32XLow[256]; | |
| 45 | −extern const float fir64XLow[256]; | |
| 46 | −extern const float fir2XHigh[128]; | |
| 47 | −extern const float fir4XHigh[256]; | |
| 48 | −extern const float fir8XHigh[256]; | |
| 49 | −extern const float fir16XHigh[512]; | |
| 50 | −extern const float fir32XHigh[512]; | |
| 51 | −extern const float fir64XHigh[1024]; | |
| 52 | − | |
| 53 | −typedef enum TableName | |
| 54 | −{ | |
| 55 | − T20 = 0, | |
| 56 | − T40, | |
| 57 | − T80, | |
| 58 | − T160, | |
| 59 | − T320, | |
| 60 | − T640, | |
| 61 | − T1280, | |
| 62 | − T2560, | |
| 63 | − T5120, | |
| 64 | − T10240, | |
| 65 | − T20480, | |
| 66 | − TableNameNil | |
| 67 | −} TableName; | |
| 68 | − | |
| 69 | −// mtof lookup table based on input range [0.0,1.0) in 4096 increments - midi frequency values scaled between m25 and m134 (from the Snyderphonics DrumBox code) | |
| 70 | − | |
| 71 | −extern const float exp_decay[EXP_DECAY_TABLE_SIZE]; | |
| 72 | −extern const float attack_decay_inc[ATTACK_DECAY_INC_TABLE_SIZE]; | |
| 73 | − | |
| 74 | −extern const float filtertan[FILTERTAN_TABLE_SIZE]; | |
| 75 | − | |
| 76 | −extern const float mtof1[MTOF1_TABLE_SIZE]; | |
| 77 | −extern const float decayCoeffTable[DECAY_COEFF_TABLE_SIZE]; | |
| 78 | − | |
| 79 | −extern const float tanh1[TANH1_TABLE_SIZE]; | |
| 80 | − | |
| 81 | −//============================================================================== | |
| 82 | − | |
| 83 | −/* Sine wave table ripped from http://aquaticus.info/pwm-sine-wave. */ | |
| 84 | −extern const float sinewave[SINE_TABLE_SIZE]; | |
| 85 | − | |
| 86 | −extern const float sawtooth[11][SAW_TABLE_SIZE]; | |
| 87 | − | |
| 88 | −extern const float triangle[11][TRI_TABLE_SIZE]; | |
| 89 | − | |
| 90 | −extern const float squarewave[11][SQR_TABLE_SIZE]; | |
| 91 | − | |
| 92 | −//============================================================================== | |
| 93 | − | |
| 94 | −#ifdef __cplusplus | |
| 95 | −} | |
| 96 | −#endif | |
| 97 | − | |
| 98 | −#endif // LEAF_TABLES_H_INCLUDED | |
| 99 | − | |
| 100 | −//============================================================================== | |
| @@ -0,0 +1,81 @@ | ||
| 1 | +/* USER CODE BEGIN Header */ | |
| 2 | +/** | |
| 3 | + ****************************************************************************** | |
| 4 | + * @file : main.h | |
| 5 | + * @brief : Header for main.c file. | |
| 6 | + * This file contains the common defines of the application. | |
| 7 | + ****************************************************************************** | |
| 8 | + * @attention | |
| 9 | + * | |
| 10 | + * <h2><center>© Copyright (c) 2019 STMicroelectronics. | |
| 11 | + * All rights reserved.</center></h2> | |
| 12 | + * | |
| 13 | + * This software component is licensed by ST under Ultimate Liberty license | |
| 14 | + * SLA0044, the "License"; You may not use this file except in compliance with | |
| 15 | + * the License. You may obtain a copy of the License at: | |
| 16 | + * www.st.com/SLA0044 | |
| 17 | + * | |
| 18 | + ****************************************************************************** | |
| 19 | + */ | |
| 20 | +/* USER CODE END Header */ | |
| 21 | + | |
| 22 | +/* Define to prevent recursive inclusion -------------------------------------*/ | |
| 23 | +#ifndef __MAIN_H | |
| 24 | +#define __MAIN_H | |
| 25 | + | |
| 26 | +#ifdef __cplusplus | |
| 27 | +extern "C" { | |
| 28 | +#endif | |
| 29 | + | |
| 30 | +/* Includes ------------------------------------------------------------------*/ | |
| 31 | +#include "stm32h7xx_hal.h" | |
| 32 | +#include "stm32h7xx_hal.h" | |
| 33 | + | |
| 34 | +/* Private includes ----------------------------------------------------------*/ | |
| 35 | +/* USER CODE BEGIN Includes */ | |
| 36 | + | |
| 37 | +/* USER CODE END Includes */ | |
| 38 | + | |
| 39 | +/* Exported types ------------------------------------------------------------*/ | |
| 40 | +/* USER CODE BEGIN ET */ | |
| 41 | + | |
| 42 | +/* USER CODE END ET */ | |
| 43 | + | |
| 44 | +/* Exported constants --------------------------------------------------------*/ | |
| 45 | +/* USER CODE BEGIN EC */ | |
| 46 | + | |
| 47 | +/* USER CODE END EC */ | |
| 48 | + | |
| 49 | +/* Exported macro ------------------------------------------------------------*/ | |
| 50 | +/* USER CODE BEGIN EM */ | |
| 51 | +#define __ATTR_RAM_D1 __attribute__ ((section(".RAM_D1"))) __attribute__ ((aligned (32))) | |
| 52 | +#define __ATTR_RAM_D2 __attribute__ ((section(".RAM_D2"))) __attribute__ ((aligned (32))) | |
| 53 | +#define __ATTR_RAM_D3 __attribute__ ((section(".RAM_D3"))) __attribute__ ((aligned (32))) | |
| 54 | +#define __ATTR_SDRAM __attribute__ ((section(".SDRAM"))) __attribute__ ((aligned (32))) | |
| 55 | + | |
| 56 | +#define STM32 // define this so that LEAF knows you are building for STM32 | |
| 57 | +/* USER CODE END EM */ | |
| 58 | + | |
| 59 | +/* Exported functions prototypes ---------------------------------------------*/ | |
| 60 | +void Error_Handler(void); | |
| 61 | + | |
| 62 | +/* USER CODE BEGIN EFP */ | |
| 63 | +float randomNumber(void); | |
| 64 | +static void HardFault_Handler(void) __attribute__ ((naked)); | |
| 65 | +void prvGetRegistersFromStack( uint32_t *pulFaultStackAddress ); | |
| 66 | +void writeIntToFlash(uint32_t data, uint32_t location); | |
| 67 | +uint32_t readIntFromFlash (uint32_t location); | |
| 68 | +/* USER CODE END EFP */ | |
| 69 | + | |
| 70 | +/* Private defines -----------------------------------------------------------*/ | |
| 71 | +/* USER CODE BEGIN Private defines */ | |
| 72 | + | |
| 73 | +/* USER CODE END Private defines */ | |
| 74 | + | |
| 75 | +#ifdef __cplusplus | |
| 76 | +} | |
| 77 | +#endif | |
| 78 | + | |
| 79 | +#endif /* __MAIN_H */ | |
| 80 | + | |
| 81 | +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |
| @@ -0,0 +1,90 @@ | ||
| 1 | +/* | |
| 2 | + * oled.h | |
| 3 | + * | |
| 4 | + * Created on: Feb 05, 2020 | |
| 5 | + * Author: Matthew Wang | |
| 6 | + */ | |
| 7 | + | |
| 8 | +#ifndef OLED_H_ | |
| 9 | +#define OLED_H_ | |
| 10 | + | |
| 11 | +extern char oled_buffer[32]; | |
| 12 | + | |
| 13 | +typedef enum _OLEDLine | |
| 14 | +{ | |
| 15 | + FirstLine = 0, | |
| 16 | + SecondLine, | |
| 17 | + BothLines, | |
| 18 | + NilLine | |
| 19 | +} OLEDLine; | |
| 20 | + | |
| 21 | +void OLED_init(I2C_HandleTypeDef* hi2c); | |
| 22 | + | |
| 23 | +void initUIFunctionPointers(void); | |
| 24 | + | |
| 25 | +void setLED_Edit(uint8_t onOff); | |
| 26 | + | |
| 27 | +void setLED_USB(uint8_t onOff); | |
| 28 | + | |
| 29 | +void setLED_1(uint8_t onOff); | |
| 30 | + | |
| 31 | +void setLED_2(uint8_t onOff); | |
| 32 | + | |
| 33 | +void setLED_A(uint8_t onOff); | |
| 34 | + | |
| 35 | +void setLED_B(uint8_t onOff); | |
| 36 | + | |
| 37 | +void setLED_C(uint8_t onOff); | |
| 38 | + | |
| 39 | +void setLED_leftout_clip(uint8_t onOff); | |
| 40 | + | |
| 41 | +void setLED_rightout_clip(uint8_t onOff); | |
| 42 | + | |
| 43 | +void setLED_leftin_clip(uint8_t onOff); | |
| 44 | + | |
| 45 | +void setLED_rightin_clip(uint8_t onOff); | |
| 46 | + | |
| 47 | +int getCursorX(void); | |
| 48 | + | |
| 49 | +void OLED_process(void); | |
| 50 | + | |
| 51 | +void OLED_writePreset(void); | |
| 52 | + | |
| 53 | +void OLED_writeEditScreen(void); | |
| 54 | + | |
| 55 | +void OLED_writeKnobParameter(uint8_t whichParam); | |
| 56 | + | |
| 57 | +void OLED_writeButtonAction(uint8_t whichButton, uint8_t whichAction); | |
| 58 | + | |
| 59 | +void OLED_writeTuning(void); | |
| 60 | + | |
| 61 | +void OLED_draw(void); | |
| 62 | + | |
| 63 | +void OLEDclear(void); | |
| 64 | + | |
| 65 | +void OLEDclearLine(OLEDLine line); | |
| 66 | + | |
| 67 | +void OLEDwriteString(char* myCharArray, uint8_t arrayLength, uint8_t startCursor, OLEDLine line); | |
| 68 | + | |
| 69 | +void OLEDwriteLine(char* myCharArray, uint8_t arrayLength, OLEDLine line); | |
| 70 | + | |
| 71 | +void OLEDwriteInt(uint32_t myNumber, uint8_t numDigits, uint8_t startCursor, OLEDLine line); | |
| 72 | + | |
| 73 | +void OLEDwriteIntLine(uint32_t myNumber, uint8_t numDigits, OLEDLine line); | |
| 74 | + | |
| 75 | +void OLEDwritePitch(float midi, uint8_t startCursor, OLEDLine line); | |
| 76 | + | |
| 77 | +void OLEDwritePitchClass(float midi, uint8_t startCursor, OLEDLine line); | |
| 78 | + | |
| 79 | +void OLEDwritePitchLine(float midi, OLEDLine line); | |
| 80 | + | |
| 81 | +void OLEDwriteFixedFloat(float input, uint8_t numDigits, uint8_t numDecimal, uint8_t startCursor, OLEDLine line); | |
| 82 | + | |
| 83 | +void OLEDwriteFixedFloatLine(float input, uint8_t numDigits, uint8_t numDecimal, OLEDLine line); | |
| 84 | + | |
| 85 | +void OLEDwriteFloat(float input, uint8_t startCursor, OLEDLine line); | |
| 86 | + | |
| 87 | +void OLEDdrawFloatArray(float* input, float min, float max, uint8_t size, uint8_t offset, uint8_t startCursor, OLEDLine line); | |
| 88 | + | |
| 89 | +#endif /* OLED_H_ */ | |
| 90 | + | |
| @@ -0,0 +1,58 @@ | ||
| 1 | +/** | |
| 2 | + ****************************************************************************** | |
| 3 | + * File Name : RNG.h | |
| 4 | + * Description : This file provides code for the configuration | |
| 5 | + * of the RNG instances. | |
| 6 | + ****************************************************************************** | |
| 7 | + * @attention | |
| 8 | + * | |
| 9 | + * <h2><center>© Copyright (c) 2020 STMicroelectronics. | |
| 10 | + * All rights reserved.</center></h2> | |
| 11 | + * | |
| 12 | + * This software component is licensed by ST under Ultimate Liberty license | |
| 13 | + * SLA0044, the "License"; You may not use this file except in compliance with | |
| 14 | + * the License. You may obtain a copy of the License at: | |
| 15 | + * www.st.com/SLA0044 | |
| 16 | + * | |
| 17 | + ****************************************************************************** | |
| 18 | + */ | |
| 19 | +/* Define to prevent recursive inclusion -------------------------------------*/ | |
| 20 | +#ifndef __rng_H | |
| 21 | +#define __rng_H | |
| 22 | +#ifdef __cplusplus | |
| 23 | + extern "C" { | |
| 24 | +#endif | |
| 25 | + | |
| 26 | +/* Includes ------------------------------------------------------------------*/ | |
| 27 | +#include "main.h" | |
| 28 | + | |
| 29 | +/* USER CODE BEGIN Includes */ | |
| 30 | + | |
| 31 | +/* USER CODE END Includes */ | |
| 32 | + | |
| 33 | +extern RNG_HandleTypeDef hrng; | |
| 34 | + | |
| 35 | +/* USER CODE BEGIN Private defines */ | |
| 36 | + | |
| 37 | +/* USER CODE END Private defines */ | |
| 38 | + | |
| 39 | +void MX_RNG_Init(void); | |
| 40 | + | |
| 41 | +/* USER CODE BEGIN Prototypes */ | |
| 42 | + | |
| 43 | +/* USER CODE END Prototypes */ | |
| 44 | + | |
| 45 | +#ifdef __cplusplus | |
| 46 | +} | |
| 47 | +#endif | |
| 48 | +#endif /*__ rng_H */ | |
| 49 | + | |
| 50 | +/** | |
| 51 | + * @} | |
| 52 | + */ | |
| 53 | + | |
| 54 | +/** | |
| 55 | + * @} | |
| 56 | + */ | |
| 57 | + | |
| 58 | +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |
| @@ -0,0 +1,59 @@ | ||
| 1 | +/** | |
| 2 | + ****************************************************************************** | |
| 3 | + * File Name : SAI.h | |
| 4 | + * Description : This file provides code for the configuration | |
| 5 | + * of the SAI instances. | |
| 6 | + ****************************************************************************** | |
| 7 | + * @attention | |
| 8 | + * | |
| 9 | + * <h2><center>© Copyright (c) 2020 STMicroelectronics. | |
| 10 | + * All rights reserved.</center></h2> | |
| 11 | + * | |
| 12 | + * This software component is licensed by ST under Ultimate Liberty license | |
| 13 | + * SLA0044, the "License"; You may not use this file except in compliance with | |
| 14 | + * the License. You may obtain a copy of the License at: | |
| 15 | + * www.st.com/SLA0044 | |
| 16 | + * | |
| 17 | + ****************************************************************************** | |
| 18 | + */ | |
| 19 | +/* Define to prevent recursive inclusion -------------------------------------*/ | |
| 20 | +#ifndef __sai_H | |
| 21 | +#define __sai_H | |
| 22 | +#ifdef __cplusplus | |
| 23 | + extern "C" { | |
| 24 | +#endif | |
| 25 | + | |
| 26 | +/* Includes ------------------------------------------------------------------*/ | |
| 27 | +#include "main.h" | |
| 28 | + | |
| 29 | +/* USER CODE BEGIN Includes */ | |
| 30 | + | |
| 31 | +/* USER CODE END Includes */ | |
| 32 | + | |
| 33 | +extern SAI_HandleTypeDef hsai_BlockA1; | |
| 34 | +extern SAI_HandleTypeDef hsai_BlockB1; | |
| 35 | + | |
| 36 | +/* USER CODE BEGIN Private defines */ | |
| 37 | + | |
| 38 | +/* USER CODE END Private defines */ | |
| 39 | + | |
| 40 | +void MX_SAI1_Init(void); | |
| 41 | + | |
| 42 | +/* USER CODE BEGIN Prototypes */ | |
| 43 | + | |
| 44 | +/* USER CODE END Prototypes */ | |
| 45 | + | |
| 46 | +#ifdef __cplusplus | |
| 47 | +} | |
| 48 | +#endif | |
| 49 | +#endif /*__ sai_H */ | |
| 50 | + | |
| 51 | +/** | |
| 52 | + * @} | |
| 53 | + */ | |
| 54 | + | |
| 55 | +/** | |
| 56 | + * @} | |
| 57 | + */ | |
| 58 | + | |
| 59 | +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |
| @@ -0,0 +1,45 @@ | ||
| 1 | +/* USER CODE BEGIN Header */ | |
| 2 | +/** | |
| 3 | + ****************************************************************************** | |
| 4 | + * @file sd_diskio.h | |
| 5 | + * @brief Header for sd_diskio.c module | |
| 6 | + ****************************************************************************** | |
| 7 | + * @attention | |
| 8 | + * | |
| 9 | + * <h2><center>© Copyright (c) 2019 STMicroelectronics. | |
| 10 | + * All rights reserved.</center></h2> | |
| 11 | + * | |
| 12 | + * This software component is licensed by ST under Ultimate Liberty license | |
| 13 | + * SLA0044, the "License"; You may not use this file except in compliance with | |
| 14 | + * the License. You may obtain a copy of the License at: | |
| 15 | + * www.st.com/SLA0044 | |
| 16 | + * | |
| 17 | + ****************************************************************************** | |
| 18 | + */ | |
| 19 | +/* USER CODE END Header */ | |
| 20 | + | |
| 21 | +/* Note: code generation based on sd_diskio_template.h */ | |
| 22 | + | |
| 23 | +/* Define to prevent recursive inclusion -------------------------------------*/ | |
| 24 | +#ifndef __SD_DISKIO_H | |
| 25 | +#define __SD_DISKIO_H | |
| 26 | + | |
| 27 | +/* USER CODE BEGIN firstSection */ | |
| 28 | +/* can be used to modify / undefine following code or add new definitions */ | |
| 29 | +/* USER CODE END firstSection */ | |
| 30 | + | |
| 31 | +/* Includes ------------------------------------------------------------------*/ | |
| 32 | +#include "bsp_driver_sd.h" | |
| 33 | +/* Exported types ------------------------------------------------------------*/ | |
| 34 | +/* Exported constants --------------------------------------------------------*/ | |
| 35 | +/* Exported functions ------------------------------------------------------- */ | |
| 36 | +extern const Diskio_drvTypeDef SD_Driver; | |
| 37 | + | |
| 38 | +/* USER CODE BEGIN lastSection */ | |
| 39 | +/* can be used to modify / undefine previous code or add new definitions */ | |
| 40 | +/* USER CODE END lastSection */ | |
| 41 | + | |
| 42 | +#endif /* __SD_DISKIO_H */ | |
| 43 | + | |
| 44 | +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |
| 45 | + | |
| @@ -0,0 +1,58 @@ | ||
| 1 | +/** | |
| 2 | + ****************************************************************************** | |
| 3 | + * File Name : SDMMC.h | |
| 4 | + * Description : This file provides code for the configuration | |
| 5 | + * of the SDMMC instances. | |
| 6 | + ****************************************************************************** | |
| 7 | + * @attention | |
| 8 | + * | |
| 9 | + * <h2><center>© Copyright (c) 2020 STMicroelectronics. | |
| 10 | + * All rights reserved.</center></h2> | |
| 11 | + * | |
| 12 | + * This software component is licensed by ST under Ultimate Liberty license | |
| 13 | + * SLA0044, the "License"; You may not use this file except in compliance with | |
| 14 | + * the License. You may obtain a copy of the License at: | |
| 15 | + * www.st.com/SLA0044 | |
| 16 | + * | |
| 17 | + ****************************************************************************** | |
| 18 | + */ | |
| 19 | +/* Define to prevent recursive inclusion -------------------------------------*/ | |
| 20 | +#ifndef __sdmmc_H | |
| 21 | +#define __sdmmc_H | |
| 22 | +#ifdef __cplusplus | |
| 23 | + extern "C" { | |
| 24 | +#endif | |
| 25 | + | |
| 26 | +/* Includes ------------------------------------------------------------------*/ | |
| 27 | +#include "main.h" | |
| 28 | + | |
| 29 | +/* USER CODE BEGIN Includes */ | |
| 30 | + | |
| 31 | +/* USER CODE END Includes */ | |
| 32 | + | |
| 33 | +extern SD_HandleTypeDef hsd1; | |
| 34 | + | |
| 35 | +/* USER CODE BEGIN Private defines */ | |
| 36 | + | |
| 37 | +/* USER CODE END Private defines */ | |
| 38 | + | |
| 39 | +void MX_SDMMC1_SD_Init(void); | |
| 40 | + | |
| 41 | +/* USER CODE BEGIN Prototypes */ | |
| 42 | + | |
| 43 | +/* USER CODE END Prototypes */ | |
| 44 | + | |
| 45 | +#ifdef __cplusplus | |
| 46 | +} | |
| 47 | +#endif | |
| 48 | +#endif /*__ sdmmc_H */ | |
| 49 | + | |
| 50 | +/** | |
| 51 | + * @} | |
| 52 | + */ | |
| 53 | + | |
| 54 | +/** | |
| 55 | + * @} | |
| 56 | + */ | |
| 57 | + | |
| 58 | +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |
| @@ -0,0 +1,177 @@ | ||
| 1 | +/* | |
| 2 | + * sfx.h | |
| 3 | + * | |
| 4 | + * Created on: Dec 23, 2019 | |
| 5 | + * Author: josnyder | |
| 6 | + */ | |
| 7 | +#ifndef SFX_H_ | |
| 8 | +#define SFX_H_ | |
| 9 | + | |
| 10 | +#include "audiostream.h" | |
| 11 | +#include "ui.h" | |
| 12 | + | |
| 13 | +#define NUM_VOC_VOICES 8 | |
| 14 | +#define NUM_OSC_PER_VOICE 3 | |
| 15 | +#define NUM_VOC_OSC 1 | |
| 16 | +#define INV_NUM_VOC_VOICES 0.125 | |
| 17 | +#define INV_NUM_VOC_OSC 1 | |
| 18 | +#define NUM_AUTOTUNE 2 | |
| 19 | +#define NUM_RETUNE 1 | |
| 20 | +#define OVERSAMPLER_RATIO 8 | |
| 21 | +#define OVERSAMPLER_HQ FALSE | |
| 22 | + | |
| 23 | +extern float presetKnobValues[PresetNil][NUM_ADC_CHANNELS]; | |
| 24 | +extern uint8_t knobActive[NUM_ADC_CHANNELS]; | |
| 25 | + | |
| 26 | +extern tPoly poly; | |
| 27 | +extern tRamp polyRamp[NUM_VOC_VOICES]; | |
| 28 | +extern tSawtooth osc[NUM_VOC_VOICES * NUM_OSC_PER_VOICE]; | |
| 29 | + | |
| 30 | +extern PlayMode samplerMode; | |
| 31 | +extern float sampleLength; | |
| 32 | + | |
| 33 | +extern uint32_t freeze; | |
| 34 | + | |
| 35 | +void initGlobalSFXObjects(); | |
| 36 | + | |
| 37 | +//1 vocoder internal poly | |
| 38 | +extern uint8_t numVoices; | |
| 39 | +extern uint8_t internalExternal; | |
| 40 | + | |
| 41 | +void SFXVocoderAlloc(); | |
| 42 | +void SFXVocoderFrame(); | |
| 43 | +void SFXVocoderTick(float audioIn); | |
| 44 | +void SFXVocoderFree(void); | |
| 45 | + | |
| 46 | +//4 pitch shift | |
| 47 | +void SFXPitchShiftAlloc(); | |
| 48 | +void SFXPitchShiftFrame(); | |
| 49 | +void SFXPitchShiftTick(float audioIn); | |
| 50 | +void SFXPitchShiftFree(void); | |
| 51 | + | |
| 52 | +//5 neartune | |
| 53 | +extern uint8_t autotuneChromatic; | |
| 54 | + | |
| 55 | +void SFXNeartuneAlloc(); | |
| 56 | +void SFXNeartuneFrame(); | |
| 57 | +void SFXNeartuneTick(float audioIn); | |
| 58 | +void SFXNeartuneFree(void); | |
| 59 | + | |
| 60 | +//6 autotune | |
| 61 | +void SFXAutotuneAlloc(); | |
| 62 | +void SFXAutotuneFrame(); | |
| 63 | +void SFXAutotuneTick(float audioIn); | |
| 64 | +void SFXAutotuneFree(void); | |
| 65 | + | |
| 66 | +//7 sampler - button press | |
| 67 | +extern uint8_t samplePlaying; | |
| 68 | + | |
| 69 | +void SFXSamplerBPAlloc(); | |
| 70 | +void SFXSamplerBPFrame(); | |
| 71 | +void SFXSamplerBPTick(float audioIn); | |
| 72 | +void SFXSamplerBPFree(void); | |
| 73 | + | |
| 74 | + | |
| 75 | +//8 sampler - auto ch1 | |
| 76 | +extern uint8_t triggerChannel; | |
| 77 | + | |
| 78 | +void SFXSamplerAutoAlloc(); | |
| 79 | +void SFXSamplerAutoFrame(); | |
| 80 | +void SFXSamplerAutoTick(float audioIn); | |
| 81 | +void SFXSamplerAutoFree(void); | |
| 82 | + | |
| 83 | +//10 distortion tanh | |
| 84 | +extern uint8_t distortionMode; | |
| 85 | + | |
| 86 | +void SFXDistortionAlloc(); | |
| 87 | +void SFXDistortionFrame(); | |
| 88 | +void SFXDistortionTick(float audioIn); | |
| 89 | +void SFXDistortionFree(void); | |
| 90 | + | |
| 91 | +//12 distortion wave folder | |
| 92 | +void SFXWaveFolderAlloc(); | |
| 93 | +void SFXWaveFolderFrame(); | |
| 94 | +void SFXWaveFolderTick(float audioIn); | |
| 95 | +void SFXWaveFolderFree(void); | |
| 96 | + | |
| 97 | + | |
| 98 | +//13 bitcrusher | |
| 99 | +void SFXBitcrusherAlloc(); | |
| 100 | +void SFXBitcrusherFrame(); | |
| 101 | +void SFXBitcrusherTick(float audioIn); | |
| 102 | +void SFXBitcrusherFree(void); | |
| 103 | + | |
| 104 | + | |
| 105 | +//14 delay | |
| 106 | +extern int delayShaper; | |
| 107 | + | |
| 108 | +void SFXDelayAlloc(); | |
| 109 | +void SFXDelayFrame(); | |
| 110 | +void SFXDelayTick(float audioIn); | |
| 111 | +void SFXDelayFree(void); | |
| 112 | + | |
| 113 | + | |
| 114 | +//15 reverb | |
| 115 | +void SFXReverbAlloc(); | |
| 116 | +void SFXReverbFrame(); | |
| 117 | +void SFXReverbTick(float audioIn); | |
| 118 | +void SFXReverbFree(void); | |
| 119 | + | |
| 120 | +//16 reverb2 | |
| 121 | +void SFXReverb2Alloc(); | |
| 122 | +void SFXReverb2Frame(); | |
| 123 | +void SFXReverb2Tick(float audioIn); | |
| 124 | +void SFXReverb2Free(void); | |
| 125 | + | |
| 126 | +//17 living string | |
| 127 | +void SFXLivingStringAlloc(); | |
| 128 | +void SFXLivingStringFrame(); | |
| 129 | +void SFXLivingStringTick(float audioIn); | |
| 130 | +void SFXLivingStringFree(void); | |
| 131 | + | |
| 132 | +//17 living string | |
| 133 | +void SFXLivingStringSynthAlloc(); | |
| 134 | +void SFXLivingStringSynthFrame(); | |
| 135 | +void SFXLivingStringSynthTick(float audioIn); | |
| 136 | +void SFXLivingStringSynthFree(void); | |
| 137 | + | |
| 138 | + | |
| 139 | +//17 living string | |
| 140 | +void SFXClassicSynthAlloc(); | |
| 141 | +void SFXClassicSynthFrame(); | |
| 142 | +void SFXClassicSynthTick(float audioIn); | |
| 143 | +void SFXClassicSynthFree(void); | |
| 144 | + | |
| 145 | + | |
| 146 | +//17 living string | |
| 147 | +void SFXRhodesAlloc(); | |
| 148 | +void SFXRhodesFrame(); | |
| 149 | +void SFXRhodesTick(float audioIn); | |
| 150 | +void SFXRhodesFree(void); | |
| 151 | + | |
| 152 | + | |
| 153 | +// MIDI FUNCTIONS | |
| 154 | +void noteOn(int key, int velocity); | |
| 155 | +void noteOff(int key, int velocity); | |
| 156 | +void pitchBend(int data); | |
| 157 | +void sustainOn(void); | |
| 158 | +void sustainOff(void); | |
| 159 | +void toggleBypass(void); | |
| 160 | +void toggleSustain(void); | |
| 161 | + | |
| 162 | +void calculateFreq(int voice); | |
| 163 | + | |
| 164 | +float calculateTunedMidiNote(float tempNote); | |
| 165 | + | |
| 166 | + | |
| 167 | +void calculateNoteArray(void); | |
| 168 | +//void calculatePeriodArray(void); | |
| 169 | +float nearestNote(float period); | |
| 170 | +//float nearestPeriod(float period); | |
| 171 | + | |
| 172 | +void clearNotes(void); | |
| 173 | + | |
| 174 | +void ctrlInput(int ctrl, int value); | |
| 175 | + | |
| 176 | + | |
| 177 | +#endif /* SFX_H_ */ | |
| @@ -0,0 +1,127 @@ | ||
| 1 | + | |
| 2 | +/* | |
| 3 | + * ssd1306.h | |
| 4 | + * | |
| 5 | + * Created on: Jul 6, 2018 | |
| 6 | + * Author: jeffsnyder | |
| 7 | + */ | |
| 8 | +#include "stm32h7xx_hal.h" | |
| 9 | +#include "main.h" | |
| 10 | + | |
| 11 | +#ifndef SSD1306_H_ | |
| 12 | +#define SSD1306_H_ | |
| 13 | + | |
| 14 | +#define pgm_read_byte(addr) (*(const unsigned char *)(addr)) | |
| 15 | + | |
| 16 | +#define BLACK 0 | |
| 17 | +#define WHITE 1 | |
| 18 | +#define INVERSE 2 | |
| 19 | + | |
| 20 | +#define SSD1306_I2C_ADDRESS (0x3C<<1) // 011110+SA0+RW - 0x3C or 0x3D | |
| 21 | +// Address for 128x32 is 0x3C | |
| 22 | +// Address for 128x64 is 0x3D (default) or 0x3C (if SA0 is grounded) | |
| 23 | + | |
| 24 | +/*========================================================================= | |
| 25 | + SSD1306 Displays | |
| 26 | + ----------------------------------------------------------------------- | |
| 27 | + The driver is used in multiple displays (128x64, 128x32, etc.). | |
| 28 | + Select the appropriate display below to create an appropriately | |
| 29 | + sized framebuffer, etc. | |
| 30 | + | |
| 31 | + SSD1306_128_64 128x64 pixel display | |
| 32 | + | |
| 33 | + SSD1306_128_32 128x32 pixel display | |
| 34 | + | |
| 35 | + SSD1306_96_16 | |
| 36 | + | |
| 37 | + -----------------------------------------------------------------------*/ | |
| 38 | +// #define SSD1306_128_64 | |
| 39 | + #define SSD1306_128_32 | |
| 40 | +// #define SSD1306_96_16 | |
| 41 | +/*=========================================================================*/ | |
| 42 | + | |
| 43 | +#if defined SSD1306_128_64 && defined SSD1306_128_32 | |
| 44 | + #error "Only one SSD1306 display can be specified at once in SSD1306.h" | |
| 45 | +#endif | |
| 46 | +#if !defined SSD1306_128_64 && !defined SSD1306_128_32 && !defined SSD1306_96_16 | |
| 47 | + #error "At least one SSD1306 display must be specified in SSD1306.h" | |
| 48 | +#endif | |
| 49 | + | |
| 50 | +#if defined SSD1306_128_64 | |
| 51 | + #define SSD1306_LCDWIDTH 128 | |
| 52 | + #define SSD1306_LCDHEIGHT 64 | |
| 53 | +#endif | |
| 54 | +#if defined SSD1306_128_32 | |
| 55 | + #define SSD1306_LCDWIDTH 128 | |
| 56 | + #define SSD1306_LCDHEIGHT 32 | |
| 57 | +#endif | |
| 58 | +#if defined SSD1306_96_16 | |
| 59 | + #define SSD1306_LCDWIDTH 96 | |
| 60 | + #define SSD1306_LCDHEIGHT 16 | |
| 61 | +#endif | |
| 62 | + | |
| 63 | +#define SSD1306_SETCONTRAST 0x81 | |
| 64 | +#define SSD1306_DISPLAYALLON_RESUME 0xA4 | |
| 65 | +#define SSD1306_DISPLAYALLON 0xA5 | |
| 66 | +#define SSD1306_NORMALDISPLAY 0xA6 | |
| 67 | +#define SSD1306_INVERTDISPLAY 0xA7 | |
| 68 | +#define SSD1306_DISPLAYOFF 0xAE | |
| 69 | +#define SSD1306_DISPLAYON 0xAF | |
| 70 | + | |
| 71 | +#define SSD1306_SETDISPLAYOFFSET 0xD3 | |
| 72 | +#define SSD1306_SETCOMPINS 0xDA | |
| 73 | + | |
| 74 | +#define SSD1306_SETVCOMDETECT 0xDB | |
| 75 | + | |
| 76 | +#define SSD1306_SETDISPLAYCLOCKDIV 0xD5 | |
| 77 | +#define SSD1306_SETPRECHARGE 0xD9 | |
| 78 | + | |
| 79 | +#define SSD1306_SETMULTIPLEX 0xA8 | |
| 80 | + | |
| 81 | +#define SSD1306_SETLOWCOLUMN 0x00 | |
| 82 | +#define SSD1306_SETHIGHCOLUMN 0x10 | |
| 83 | + | |
| 84 | +#define SSD1306_SETSTARTLINE 0x40 | |
| 85 | + | |
| 86 | +#define SSD1306_MEMORYMODE 0x20 | |
| 87 | +#define SSD1306_COLUMNADDR 0x21 | |
| 88 | +#define SSD1306_PAGEADDR 0x22 | |
| 89 | + | |
| 90 | +#define SSD1306_COMSCANINC 0xC0 | |
| 91 | +#define SSD1306_COMSCANDEC 0xC8 | |
| 92 | + | |
| 93 | +#define SSD1306_SEGREMAP 0xA0 | |
| 94 | + | |
| 95 | +#define SSD1306_CHARGEPUMP 0x8D | |
| 96 | + | |
| 97 | +#define SSD1306_EXTERNALVCC 0x1 | |
| 98 | +#define SSD1306_SWITCHCAPVCC 0x2 | |
| 99 | + | |
| 100 | +// Scrolling #defines | |
| 101 | +#define SSD1306_ACTIVATE_SCROLL 0x2F | |
| 102 | +#define SSD1306_DEACTIVATE_SCROLL 0x2E | |
| 103 | +#define SSD1306_SET_VERTICAL_SCROLL_AREA 0xA3 | |
| 104 | +#define SSD1306_RIGHT_HORIZONTAL_SCROLL 0x26 | |
| 105 | +#define SSD1306_LEFT_HORIZONTAL_SCROLL 0x27 | |
| 106 | +#define SSD1306_VERTICAL_AND_RIGHT_HORIZONTAL_SCROLL 0x29 | |
| 107 | +#define SSD1306_VERTICAL_AND_LEFT_HORIZONTAL_SCROLL 0x2A | |
| 108 | + | |
| 109 | +extern unsigned char buffer []; | |
| 110 | + | |
| 111 | +void ssd1306_begin(I2C_HandleTypeDef* hi2c, uint8_t vccstate, uint8_t i2caddr); | |
| 112 | +void ssd1306_drawPixel(int16_t x, int16_t y, uint16_t color); | |
| 113 | +void sdd1306_invertDisplay(uint8_t i); | |
| 114 | +void ssd1306_command(uint8_t c); | |
| 115 | +void ssd1306_dim(uint8_t dim); | |
| 116 | +void ssd1306_display_full_buffer(void); | |
| 117 | +void ssd1306_display(void); | |
| 118 | +void ssd1306_write(uint8_t* data, uint16_t numBytes); | |
| 119 | +void ssd1306_move(uint8_t row, uint8_t column); | |
| 120 | +void ssd1306_move_raw(uint8_t row, uint8_t column); | |
| 121 | +void ssd1306_home(void); | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | +#endif /* SSD1306_H_ */ | |
| @@ -0,0 +1,493 @@ | ||
| 1 | +/** | |
| 2 | + ****************************************************************************** | |
| 3 | + * @file stm32h7xx_hal_conf.h | |
| 4 | + * @author MCD Application Team | |
| 5 | + * @brief HAL configuration file. | |
| 6 | + ****************************************************************************** | |
| 7 | + * @attention | |
| 8 | + * | |
| 9 | + * <h2><center>© Copyright (c) 2017 STMicroelectronics. | |
| 10 | + * All rights reserved.</center></h2> | |
| 11 | + * | |
| 12 | + * This software component is licensed by ST under BSD 3-Clause license, | |
| 13 | + * the "License"; You may not use this file except in compliance with the | |
| 14 | + * License. You may obtain a copy of the License at: | |
| 15 | + * opensource.org/licenses/BSD-3-Clause | |
| 16 | + * | |
| 17 | + ****************************************************************************** | |
| 18 | + */ | |
| 19 | + | |
| 20 | +/* Define to prevent recursive inclusion -------------------------------------*/ | |
| 21 | +#ifndef __STM32H7xx_HAL_CONF_H | |
| 22 | +#define __STM32H7xx_HAL_CONF_H | |
| 23 | + | |
| 24 | +#ifdef __cplusplus | |
| 25 | + extern "C" { | |
| 26 | +#endif | |
| 27 | + | |
| 28 | +/* Exported types ------------------------------------------------------------*/ | |
| 29 | +/* Exported constants --------------------------------------------------------*/ | |
| 30 | + | |
| 31 | +/* ########################## Module Selection ############################## */ | |
| 32 | +/** | |
| 33 | + * @brief This is the list of modules to be used in the HAL driver | |
| 34 | + */ | |
| 35 | +#define HAL_MODULE_ENABLED | |
| 36 | + | |
| 37 | + #define HAL_ADC_MODULE_ENABLED | |
| 38 | +/* #define HAL_FDCAN_MODULE_ENABLED */ | |
| 39 | +/* #define HAL_CEC_MODULE_ENABLED */ | |
| 40 | +/* #define HAL_COMP_MODULE_ENABLED */ | |
| 41 | +/* #define HAL_CRC_MODULE_ENABLED */ | |
| 42 | +/* #define HAL_CRYP_MODULE_ENABLED */ | |
| 43 | +/* #define HAL_DAC_MODULE_ENABLED */ | |
| 44 | +/* #define HAL_DCMI_MODULE_ENABLED */ | |
| 45 | +/* #define HAL_DMA2D_MODULE_ENABLED */ | |
| 46 | +/* #define HAL_ETH_MODULE_ENABLED */ | |
| 47 | +/* #define HAL_NAND_MODULE_ENABLED */ | |
| 48 | +/* #define HAL_NOR_MODULE_ENABLED */ | |
| 49 | +/* #define HAL_OTFDEC_MODULE_ENABLED */ | |
| 50 | +/* #define HAL_SRAM_MODULE_ENABLED */ | |
| 51 | +#define HAL_SDRAM_MODULE_ENABLED | |
| 52 | +/* #define HAL_HASH_MODULE_ENABLED */ | |
| 53 | +/* #define HAL_HRTIM_MODULE_ENABLED */ | |
| 54 | +/* #define HAL_HSEM_MODULE_ENABLED */ | |
| 55 | +/* #define HAL_GFXMMU_MODULE_ENABLED */ | |
| 56 | +/* #define HAL_JPEG_MODULE_ENABLED */ | |
| 57 | +/* #define HAL_OPAMP_MODULE_ENABLED */ | |
| 58 | +/* #define HAL_OSPI_MODULE_ENABLED */ | |
| 59 | +/* #define HAL_OSPI_MODULE_ENABLED */ | |
| 60 | +/* #define HAL_I2S_MODULE_ENABLED */ | |
| 61 | +/* #define HAL_SMBUS_MODULE_ENABLED */ | |
| 62 | +/* #define HAL_IWDG_MODULE_ENABLED */ | |
| 63 | +/* #define HAL_LPTIM_MODULE_ENABLED */ | |
| 64 | +/* #define HAL_LTDC_MODULE_ENABLED */ | |
| 65 | +/* #define HAL_QSPI_MODULE_ENABLED */ | |
| 66 | +#define HAL_RNG_MODULE_ENABLED | |
| 67 | +/* #define HAL_RTC_MODULE_ENABLED */ | |
| 68 | +#define HAL_SAI_MODULE_ENABLED | |
| 69 | +#define HAL_SD_MODULE_ENABLED | |
| 70 | +/* #define HAL_MMC_MODULE_ENABLED */ | |
| 71 | +/* #define HAL_SPDIFRX_MODULE_ENABLED */ | |
| 72 | +/* #define HAL_SPI_MODULE_ENABLED */ | |
| 73 | +/* #define HAL_SWPMI_MODULE_ENABLED */ | |
| 74 | +#define HAL_TIM_MODULE_ENABLED | |
| 75 | +/* #define HAL_UART_MODULE_ENABLED */ | |
| 76 | +/* #define HAL_USART_MODULE_ENABLED */ | |
| 77 | +/* #define HAL_IRDA_MODULE_ENABLED */ | |
| 78 | +/* #define HAL_SMARTCARD_MODULE_ENABLED */ | |
| 79 | +/* #define HAL_WWDG_MODULE_ENABLED */ | |
| 80 | +/* #define HAL_PCD_MODULE_ENABLED */ | |
| 81 | +#define HAL_HCD_MODULE_ENABLED | |
| 82 | +/* #define HAL_DFSDM_MODULE_ENABLED */ | |
| 83 | +/* #define HAL_DSI_MODULE_ENABLED */ | |
| 84 | +/* #define HAL_JPEG_MODULE_ENABLED */ | |
| 85 | +/* #define HAL_MDIOS_MODULE_ENABLED */ | |
| 86 | +/* #define HAL_PSSI_MODULE_ENABLED */ | |
| 87 | +/* #define HAL_DTS_MODULE_ENABLED */ | |
| 88 | +#define HAL_GPIO_MODULE_ENABLED | |
| 89 | +#define HAL_DMA_MODULE_ENABLED | |
| 90 | +#define HAL_MDMA_MODULE_ENABLED | |
| 91 | +#define HAL_RCC_MODULE_ENABLED | |
| 92 | +#define HAL_FLASH_MODULE_ENABLED | |
| 93 | +#define HAL_EXTI_MODULE_ENABLED | |
| 94 | +#define HAL_PWR_MODULE_ENABLED | |
| 95 | +#define HAL_I2C_MODULE_ENABLED | |
| 96 | +#define HAL_CORTEX_MODULE_ENABLED | |
| 97 | +#define HAL_HSEM_MODULE_ENABLED | |
| 98 | + | |
| 99 | +/* ########################## Oscillator Values adaptation ####################*/ | |
| 100 | +/** | |
| 101 | + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. | |
| 102 | + * This value is used by the RCC HAL module to compute the system frequency | |
| 103 | + * (when HSE is used as system clock source, directly or through the PLL). | |
| 104 | + */ | |
| 105 | +#if !defined (HSE_VALUE) | |
| 106 | +#define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz : FPGA case fixed to 60MHZ */ | |
| 107 | +#endif /* HSE_VALUE */ | |
| 108 | + | |
| 109 | +#if !defined (HSE_STARTUP_TIMEOUT) | |
| 110 | + #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ | |
| 111 | +#endif /* HSE_STARTUP_TIMEOUT */ | |
| 112 | + | |
| 113 | +/** | |
| 114 | + * @brief Internal oscillator (CSI) default value. | |
| 115 | + * This value is the default CSI value after Reset. | |
| 116 | + */ | |
| 117 | +#if !defined (CSI_VALUE) | |
| 118 | + #define CSI_VALUE ((uint32_t)4000000) /*!< Value of the Internal oscillator in Hz*/ | |
| 119 | +#endif /* CSI_VALUE */ | |
| 120 | + | |
| 121 | +/** | |
| 122 | + * @brief Internal High Speed oscillator (HSI) value. | |
| 123 | + * This value is used by the RCC HAL module to compute the system frequency | |
| 124 | + * (when HSI is used as system clock source, directly or through the PLL). | |
| 125 | + */ | |
| 126 | +#if !defined (HSI_VALUE) | |
| 127 | + #define HSI_VALUE ((uint32_t)64000000) /*!< Value of the Internal oscillator in Hz*/ | |
| 128 | +#endif /* HSI_VALUE */ | |
| 129 | + | |
| 130 | +/** | |
| 131 | + * @brief External Low Speed oscillator (LSE) value. | |
| 132 | + * This value is used by the UART, RTC HAL module to compute the system frequency | |
| 133 | + */ | |
| 134 | +#if !defined (LSE_VALUE) | |
| 135 | + #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External oscillator in Hz*/ | |
| 136 | +#endif /* LSE_VALUE */ | |
| 137 | + | |
| 138 | +#if !defined (LSE_STARTUP_TIMEOUT) | |
| 139 | + #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ | |
| 140 | +#endif /* LSE_STARTUP_TIMEOUT */ | |
| 141 | + | |
| 142 | +/** | |
| 143 | + * @brief External clock source for I2S peripheral | |
| 144 | + * This value is used by the I2S HAL module to compute the I2S clock source | |
| 145 | + * frequency, this source is inserted directly through I2S_CKIN pad. | |
| 146 | + */ | |
| 147 | +#if !defined (EXTERNAL_CLOCK_VALUE) | |
| 148 | + #define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the External clock in Hz*/ | |
| 149 | +#endif /* EXTERNAL_CLOCK_VALUE */ | |
| 150 | + | |
| 151 | +/* Tip: To avoid modifying this file each time you need to use different HSE, | |
| 152 | + === you can define the HSE value in your toolchain compiler preprocessor. */ | |
| 153 | + | |
| 154 | +/* ########################### System Configuration ######################### */ | |
| 155 | +/** | |
| 156 | + * @brief This is the HAL system configuration section | |
| 157 | + */ | |
| 158 | +#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ | |
| 159 | +#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ | |
| 160 | +#define USE_RTOS 0U | |
| 161 | +#define USE_SD_TRANSCEIVER 1U /*!< use uSD Transceiver */ | |
| 162 | + | |
| 163 | +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ | |
| 164 | +#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ | |
| 165 | +#define USE_HAL_COMP_REGISTER_CALLBACKS 0U /* COMP register callback disabled */ | |
| 166 | +#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */ | |
| 167 | +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ | |
| 168 | +#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */ | |
| 169 | +#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */ | |
| 170 | +#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */ | |
| 171 | +#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */ | |
| 172 | +#define USE_HAL_DTS_REGISTER_CALLBACKS 0U /* DTS register callback disabled */ | |
| 173 | +#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */ | |
| 174 | +#define USE_HAL_FDCAN_REGISTER_CALLBACKS 0U /* FDCAN register callback disabled */ | |
| 175 | +#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */ | |
| 176 | +#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */ | |
| 177 | +#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */ | |
| 178 | +#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */ | |
| 179 | +#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */ | |
| 180 | +#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */ | |
| 181 | +#define USE_HAL_GFXMMU_REGISTER_CALLBACKS 0U /* GFXMMU register callback disabled */ | |
| 182 | +#define USE_HAL_HRTIM_REGISTER_CALLBACKS 0U /* HRTIM register callback disabled */ | |
| 183 | +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ | |
| 184 | +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ | |
| 185 | +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ | |
| 186 | +#define USE_HAL_JPEG_REGISTER_CALLBACKS 0U /* JPEG register callback disabled */ | |
| 187 | +#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */ | |
| 188 | +#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */ | |
| 189 | +#define USE_HAL_MDIOS_REGISTER_CALLBACKS 0U /* MDIO register callback disabled */ | |
| 190 | +#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */ | |
| 191 | +#define USE_HAL_OPAMP_REGISTER_CALLBACKS 0U /* MDIO register callback disabled */ | |
| 192 | +#define USE_HAL_OSPI_REGISTER_CALLBACKS 0U /* OSPI register callback disabled */ | |
| 193 | +#define USE_HAL_OTFDEC_REGISTER_CALLBACKS 0U /* OTFDEC register callback disabled */ | |
| 194 | +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ | |
| 195 | +#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */ | |
| 196 | +#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */ | |
| 197 | +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ | |
| 198 | +#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */ | |
| 199 | +#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */ | |
| 200 | +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ | |
| 201 | +#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */ | |
| 202 | +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */ | |
| 203 | +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ | |
| 204 | +#define USE_HAL_SWPMI_REGISTER_CALLBACKS 0U /* SWPMI register callback disabled */ | |
| 205 | +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ | |
| 206 | +#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ | |
| 207 | +#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ | |
| 208 | +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ | |
| 209 | + | |
| 210 | +/* ########################### Ethernet Configuration ######################### */ | |
| 211 | +#define ETH_TX_DESC_CNT 4 /* number of Ethernet Tx DMA descriptors */ | |
| 212 | +#define ETH_RX_DESC_CNT 4 /* number of Ethernet Rx DMA descriptors */ | |
| 213 | + | |
| 214 | +#define ETH_MAC_ADDR0 ((uint8_t)0x02) | |
| 215 | +#define ETH_MAC_ADDR1 ((uint8_t)0x00) | |
| 216 | +#define ETH_MAC_ADDR2 ((uint8_t)0x00) | |
| 217 | +#define ETH_MAC_ADDR3 ((uint8_t)0x00) | |
| 218 | +#define ETH_MAC_ADDR4 ((uint8_t)0x00) | |
| 219 | +#define ETH_MAC_ADDR5 ((uint8_t)0x00) | |
| 220 | + | |
| 221 | +/* ########################## Assert Selection ############################## */ | |
| 222 | +/** | |
| 223 | + * @brief Uncomment the line below to expanse the "assert_param" macro in the | |
| 224 | + * HAL drivers code | |
| 225 | + */ | |
| 226 | +/* #define USE_FULL_ASSERT 1U */ | |
| 227 | + | |
| 228 | +/* Includes ------------------------------------------------------------------*/ | |
| 229 | +/** | |
| 230 | + * @brief Include module's header file | |
| 231 | + */ | |
| 232 | + | |
| 233 | +#ifdef HAL_RCC_MODULE_ENABLED | |
| 234 | + #include "stm32h7xx_hal_rcc.h" | |
| 235 | +#endif /* HAL_RCC_MODULE_ENABLED */ | |
| 236 | + | |
| 237 | +#ifdef HAL_GPIO_MODULE_ENABLED | |
| 238 | + #include "stm32h7xx_hal_gpio.h" | |
| 239 | +#endif /* HAL_GPIO_MODULE_ENABLED */ | |
| 240 | + | |
| 241 | +#ifdef HAL_DMA_MODULE_ENABLED | |
| 242 | + #include "stm32h7xx_hal_dma.h" | |
| 243 | +#endif /* HAL_DMA_MODULE_ENABLED */ | |
| 244 | + | |
| 245 | +#ifdef HAL_MDMA_MODULE_ENABLED | |
| 246 | + #include "stm32h7xx_hal_mdma.h" | |
| 247 | +#endif /* HAL_MDMA_MODULE_ENABLED */ | |
| 248 | + | |
| 249 | +#ifdef HAL_HASH_MODULE_ENABLED | |
| 250 | + #include "stm32h7xx_hal_hash.h" | |
| 251 | +#endif /* HAL_HASH_MODULE_ENABLED */ | |
| 252 | + | |
| 253 | +#ifdef HAL_DCMI_MODULE_ENABLED | |
| 254 | + #include "stm32h7xx_hal_dcmi.h" | |
| 255 | +#endif /* HAL_DCMI_MODULE_ENABLED */ | |
| 256 | + | |
| 257 | +#ifdef HAL_DMA2D_MODULE_ENABLED | |
| 258 | + #include "stm32h7xx_hal_dma2d.h" | |
| 259 | +#endif /* HAL_DMA2D_MODULE_ENABLED */ | |
| 260 | + | |
| 261 | +#ifdef HAL_DSI_MODULE_ENABLED | |
| 262 | + #include "stm32h7xx_hal_dsi.h" | |
| 263 | +#endif /* HAL_DSI_MODULE_ENABLED */ | |
| 264 | + | |
| 265 | +#ifdef HAL_DFSDM_MODULE_ENABLED | |
| 266 | + #include "stm32h7xx_hal_dfsdm.h" | |
| 267 | +#endif /* HAL_DFSDM_MODULE_ENABLED */ | |
| 268 | + | |
| 269 | +#ifdef HAL_ETH_MODULE_ENABLED | |
| 270 | + #include "stm32h7xx_hal_eth.h" | |
| 271 | +#endif /* HAL_ETH_MODULE_ENABLED */ | |
| 272 | + | |
| 273 | +#ifdef HAL_EXTI_MODULE_ENABLED | |
| 274 | + #include "stm32h7xx_hal_exti.h" | |
| 275 | +#endif /* HAL_EXTI_MODULE_ENABLED */ | |
| 276 | + | |
| 277 | +#ifdef HAL_CORTEX_MODULE_ENABLED | |
| 278 | + #include "stm32h7xx_hal_cortex.h" | |
| 279 | +#endif /* HAL_CORTEX_MODULE_ENABLED */ | |
| 280 | + | |
| 281 | +#ifdef HAL_ADC_MODULE_ENABLED | |
| 282 | + #include "stm32h7xx_hal_adc.h" | |
| 283 | +#endif /* HAL_ADC_MODULE_ENABLED */ | |
| 284 | + | |
| 285 | +#ifdef HAL_FDCAN_MODULE_ENABLED | |
| 286 | + #include "stm32h7xx_hal_fdcan.h" | |
| 287 | +#endif /* HAL_FDCAN_MODULE_ENABLED */ | |
| 288 | + | |
| 289 | +#ifdef HAL_CEC_MODULE_ENABLED | |
| 290 | + #include "stm32h7xx_hal_cec.h" | |
| 291 | +#endif /* HAL_CEC_MODULE_ENABLED */ | |
| 292 | + | |
| 293 | +#ifdef HAL_COMP_MODULE_ENABLED | |
| 294 | + #include "stm32h7xx_hal_comp.h" | |
| 295 | +#endif /* HAL_COMP_MODULE_ENABLED */ | |
| 296 | + | |
| 297 | +#ifdef HAL_CRC_MODULE_ENABLED | |
| 298 | + #include "stm32h7xx_hal_crc.h" | |
| 299 | +#endif /* HAL_CRC_MODULE_ENABLED */ | |
| 300 | + | |
| 301 | +#ifdef HAL_CRYP_MODULE_ENABLED | |
| 302 | + #include "stm32h7xx_hal_cryp.h" | |
| 303 | +#endif /* HAL_CRYP_MODULE_ENABLED */ | |
| 304 | + | |
| 305 | +#ifdef HAL_DAC_MODULE_ENABLED | |
| 306 | + #include "stm32h7xx_hal_dac.h" | |
| 307 | +#endif /* HAL_DAC_MODULE_ENABLED */ | |
| 308 | + | |
| 309 | +#ifdef HAL_FLASH_MODULE_ENABLED | |
| 310 | + #include "stm32h7xx_hal_flash.h" | |
| 311 | +#endif /* HAL_FLASH_MODULE_ENABLED */ | |
| 312 | + | |
| 313 | +#ifdef HAL_GFXMMU_MODULE_ENABLED | |
| 314 | + #include "stm32h7xx_hal_gfxmmu.h" | |
| 315 | +#endif /* HAL_GFXMMU_MODULE_ENABLED */ | |
| 316 | + | |
| 317 | +#ifdef HAL_HRTIM_MODULE_ENABLED | |
| 318 | + #include "stm32h7xx_hal_hrtim.h" | |
| 319 | +#endif /* HAL_HRTIM_MODULE_ENABLED */ | |
| 320 | + | |
| 321 | +#ifdef HAL_HSEM_MODULE_ENABLED | |
| 322 | + #include "stm32h7xx_hal_hsem.h" | |
| 323 | +#endif /* HAL_HSEM_MODULE_ENABLED */ | |
| 324 | + | |
| 325 | +#ifdef HAL_SRAM_MODULE_ENABLED | |
| 326 | + #include "stm32h7xx_hal_sram.h" | |
| 327 | +#endif /* HAL_SRAM_MODULE_ENABLED */ | |
| 328 | + | |
| 329 | +#ifdef HAL_NOR_MODULE_ENABLED | |
| 330 | + #include "stm32h7xx_hal_nor.h" | |
| 331 | +#endif /* HAL_NOR_MODULE_ENABLED */ | |
| 332 | + | |
| 333 | +#ifdef HAL_NAND_MODULE_ENABLED | |
| 334 | + #include "stm32h7xx_hal_nand.h" | |
| 335 | +#endif /* HAL_NAND_MODULE_ENABLED */ | |
| 336 | + | |
| 337 | +#ifdef HAL_I2C_MODULE_ENABLED | |
| 338 | + #include "stm32h7xx_hal_i2c.h" | |
| 339 | +#endif /* HAL_I2C_MODULE_ENABLED */ | |
| 340 | + | |
| 341 | +#ifdef HAL_I2S_MODULE_ENABLED | |
| 342 | + #include "stm32h7xx_hal_i2s.h" | |
| 343 | +#endif /* HAL_I2S_MODULE_ENABLED */ | |
| 344 | + | |
| 345 | +#ifdef HAL_IWDG_MODULE_ENABLED | |
| 346 | + #include "stm32h7xx_hal_iwdg.h" | |
| 347 | +#endif /* HAL_IWDG_MODULE_ENABLED */ | |
| 348 | + | |
| 349 | +#ifdef HAL_JPEG_MODULE_ENABLED | |
| 350 | + #include "stm32h7xx_hal_jpeg.h" | |
| 351 | +#endif /* HAL_JPEG_MODULE_ENABLED */ | |
| 352 | + | |
| 353 | +#ifdef HAL_MDIOS_MODULE_ENABLED | |
| 354 | + #include "stm32h7xx_hal_mdios.h" | |
| 355 | +#endif /* HAL_MDIOS_MODULE_ENABLED */ | |
| 356 | + | |
| 357 | +#ifdef HAL_MMC_MODULE_ENABLED | |
| 358 | + #include "stm32h7xx_hal_mmc.h" | |
| 359 | +#endif /* HAL_MMC_MODULE_ENABLED */ | |
| 360 | + | |
| 361 | +#ifdef HAL_LPTIM_MODULE_ENABLED | |
| 362 | +#include "stm32h7xx_hal_lptim.h" | |
| 363 | +#endif /* HAL_LPTIM_MODULE_ENABLED */ | |
| 364 | + | |
| 365 | +#ifdef HAL_LTDC_MODULE_ENABLED | |
| 366 | +#include "stm32h7xx_hal_ltdc.h" | |
| 367 | +#endif /* HAL_LTDC_MODULE_ENABLED */ | |
| 368 | + | |
| 369 | +#ifdef HAL_OPAMP_MODULE_ENABLED | |
| 370 | +#include "stm32h7xx_hal_opamp.h" | |
| 371 | +#endif /* HAL_OPAMP_MODULE_ENABLED */ | |
| 372 | + | |
| 373 | +#ifdef HAL_OSPI_MODULE_ENABLED | |
| 374 | + #include "stm32h7xx_hal_ospi.h" | |
| 375 | +#endif /* HAL_OSPI_MODULE_ENABLED */ | |
| 376 | + | |
| 377 | +#ifdef HAL_OTFDEC_MODULE_ENABLED | |
| 378 | +#include "stm32h7xx_hal_otfdec.h" | |
| 379 | +#endif /* HAL_OTFDEC_MODULE_ENABLED */ | |
| 380 | + | |
| 381 | +#ifdef HAL_PWR_MODULE_ENABLED | |
| 382 | + #include "stm32h7xx_hal_pwr.h" | |
| 383 | +#endif /* HAL_PWR_MODULE_ENABLED */ | |
| 384 | + | |
| 385 | +#ifdef HAL_QSPI_MODULE_ENABLED | |
| 386 | + #include "stm32h7xx_hal_qspi.h" | |
| 387 | +#endif /* HAL_QSPI_MODULE_ENABLED */ | |
| 388 | + | |
| 389 | +#ifdef HAL_RAMECC_MODULE_ENABLED | |
| 390 | + #include "stm32h7xx_hal_ramecc.h" | |
| 391 | +#endif /* HAL_HCD_MODULE_ENABLED */ | |
| 392 | + | |
| 393 | +#ifdef HAL_RNG_MODULE_ENABLED | |
| 394 | + #include "stm32h7xx_hal_rng.h" | |
| 395 | +#endif /* HAL_RNG_MODULE_ENABLED */ | |
| 396 | + | |
| 397 | +#ifdef HAL_RTC_MODULE_ENABLED | |
| 398 | + #include "stm32h7xx_hal_rtc.h" | |
| 399 | +#endif /* HAL_RTC_MODULE_ENABLED */ | |
| 400 | + | |
| 401 | +#ifdef HAL_SAI_MODULE_ENABLED | |
| 402 | + #include "stm32h7xx_hal_sai.h" | |
| 403 | +#endif /* HAL_SAI_MODULE_ENABLED */ | |
| 404 | + | |
| 405 | +#ifdef HAL_SD_MODULE_ENABLED | |
| 406 | + #include "stm32h7xx_hal_sd.h" | |
| 407 | +#endif /* HAL_SD_MODULE_ENABLED */ | |
| 408 | + | |
| 409 | +#ifdef HAL_SDRAM_MODULE_ENABLED | |
| 410 | + #include "stm32h7xx_hal_sdram.h" | |
| 411 | +#endif /* HAL_SDRAM_MODULE_ENABLED */ | |
| 412 | + | |
| 413 | +#ifdef HAL_SPI_MODULE_ENABLED | |
| 414 | + #include "stm32h7xx_hal_spi.h" | |
| 415 | +#endif /* HAL_SPI_MODULE_ENABLED */ | |
| 416 | + | |
| 417 | +#ifdef HAL_SPDIFRX_MODULE_ENABLED | |
| 418 | + #include "stm32h7xx_hal_spdifrx.h" | |
| 419 | +#endif /* HAL_SPDIFRX_MODULE_ENABLED */ | |
| 420 | + | |
| 421 | +#ifdef HAL_SWPMI_MODULE_ENABLED | |
| 422 | + #include "stm32h7xx_hal_swpmi.h" | |
| 423 | +#endif /* HAL_SWPMI_MODULE_ENABLED */ | |
| 424 | + | |
| 425 | +#ifdef HAL_TIM_MODULE_ENABLED | |
| 426 | + #include "stm32h7xx_hal_tim.h" | |
| 427 | +#endif /* HAL_TIM_MODULE_ENABLED */ | |
| 428 | + | |
| 429 | +#ifdef HAL_UART_MODULE_ENABLED | |
| 430 | + #include "stm32h7xx_hal_uart.h" | |
| 431 | +#endif /* HAL_UART_MODULE_ENABLED */ | |
| 432 | + | |
| 433 | +#ifdef HAL_USART_MODULE_ENABLED | |
| 434 | + #include "stm32h7xx_hal_usart.h" | |
| 435 | +#endif /* HAL_USART_MODULE_ENABLED */ | |
| 436 | + | |
| 437 | +#ifdef HAL_IRDA_MODULE_ENABLED | |
| 438 | + #include "stm32h7xx_hal_irda.h" | |
| 439 | +#endif /* HAL_IRDA_MODULE_ENABLED */ | |
| 440 | + | |
| 441 | +#ifdef HAL_SMARTCARD_MODULE_ENABLED | |
| 442 | + #include "stm32h7xx_hal_smartcard.h" | |
| 443 | +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ | |
| 444 | + | |
| 445 | +#ifdef HAL_SMBUS_MODULE_ENABLED | |
| 446 | + #include "stm32h7xx_hal_smbus.h" | |
| 447 | +#endif /* HAL_SMBUS_MODULE_ENABLED */ | |
| 448 | + | |
| 449 | +#ifdef HAL_WWDG_MODULE_ENABLED | |
| 450 | + #include "stm32h7xx_hal_wwdg.h" | |
| 451 | +#endif /* HAL_WWDG_MODULE_ENABLED */ | |
| 452 | + | |
| 453 | +#ifdef HAL_PCD_MODULE_ENABLED | |
| 454 | + #include "stm32h7xx_hal_pcd.h" | |
| 455 | +#endif /* HAL_PCD_MODULE_ENABLED */ | |
| 456 | + | |
| 457 | +#ifdef HAL_HCD_MODULE_ENABLED | |
| 458 | + #include "stm32h7xx_hal_hcd.h" | |
| 459 | +#endif /* HAL_HCD_MODULE_ENABLED */ | |
| 460 | + | |
| 461 | +#ifdef HAL_PSSI_MODULE_ENABLED | |
| 462 | + #include "stm32h7xx_hal_pssi.h" | |
| 463 | +#endif /* HAL_PSSI_MODULE_ENABLED */ | |
| 464 | + | |
| 465 | +#ifdef HAL_DTS_MODULE_ENABLED | |
| 466 | + #include "stm32h7xx_hal_dts.h" | |
| 467 | +#endif /* HAL_DTS_MODULE_ENABLED */ | |
| 468 | + | |
| 469 | +/* Exported macro ------------------------------------------------------------*/ | |
| 470 | +#ifdef USE_FULL_ASSERT | |
| 471 | +/** | |
| 472 | + * @brief The assert_param macro is used for function's parameters check. | |
| 473 | + * @param expr: If expr is false, it calls assert_failed function | |
| 474 | + * which reports the name of the source file and the source | |
| 475 | + * line number of the call that failed. | |
| 476 | + * If expr is true, it returns no value. | |
| 477 | + * @retval None | |
| 478 | + */ | |
| 479 | + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) | |
| 480 | +/* Exported functions ------------------------------------------------------- */ | |
| 481 | + void assert_failed(uint8_t* file, uint32_t line); | |
| 482 | +#else | |
| 483 | + #define assert_param(expr) ((void)0U) | |
| 484 | +#endif /* USE_FULL_ASSERT */ | |
| 485 | + | |
| 486 | +#ifdef __cplusplus | |
| 487 | +} | |
| 488 | +#endif | |
| 489 | + | |
| 490 | +#endif /* __STM32H7xx_HAL_CONF_H */ | |
| 491 | + | |
| 492 | + | |
| 493 | +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |
| @@ -0,0 +1,81 @@ | ||
| 1 | +/* USER CODE BEGIN Header */ | |
| 2 | +/** | |
| 3 | + ****************************************************************************** | |
| 4 | + * @file stm32h7xx_it.h | |
| 5 | + * @brief This file contains the headers of the interrupt handlers. | |
| 6 | + ****************************************************************************** | |
| 7 | + * @attention | |
| 8 | + * | |
| 9 | + * <h2><center>© Copyright (c) 2019 STMicroelectronics. | |
| 10 | + * All rights reserved.</center></h2> | |
| 11 | + * | |
| 12 | + * This software component is licensed by ST under Ultimate Liberty license | |
| 13 | + * SLA0044, the "License"; You may not use this file except in compliance with | |
| 14 | + * the License. You may obtain a copy of the License at: | |
| 15 | + * www.st.com/SLA0044 | |
| 16 | + * | |
| 17 | + ****************************************************************************** | |
| 18 | + */ | |
| 19 | +/* USER CODE END Header */ | |
| 20 | + | |
| 21 | +/* Define to prevent recursive inclusion -------------------------------------*/ | |
| 22 | +#ifndef __STM32H7xx_IT_H | |
| 23 | +#define __STM32H7xx_IT_H | |
| 24 | + | |
| 25 | +#ifdef __cplusplus | |
| 26 | + extern "C" { | |
| 27 | +#endif | |
| 28 | + | |
| 29 | +/* Private includes ----------------------------------------------------------*/ | |
| 30 | +/* USER CODE BEGIN Includes */ | |
| 31 | + | |
| 32 | +/* USER CODE END Includes */ | |
| 33 | + | |
| 34 | +/* Exported types ------------------------------------------------------------*/ | |
| 35 | +/* USER CODE BEGIN ET */ | |
| 36 | + | |
| 37 | +/* USER CODE END ET */ | |
| 38 | + | |
| 39 | +/* Exported constants --------------------------------------------------------*/ | |
| 40 | +/* USER CODE BEGIN EC */ | |
| 41 | + | |
| 42 | +/* USER CODE END EC */ | |
| 43 | + | |
| 44 | +/* Exported macro ------------------------------------------------------------*/ | |
| 45 | +/* USER CODE BEGIN EM */ | |
| 46 | + | |
| 47 | +/* USER CODE END EM */ | |
| 48 | + | |
| 49 | +/* Exported functions prototypes ---------------------------------------------*/ | |
| 50 | +void NMI_Handler(void); | |
| 51 | +void HardFault_Handler(void); | |
| 52 | +void MemManage_Handler(void); | |
| 53 | +void BusFault_Handler(void); | |
| 54 | +void UsageFault_Handler(void); | |
| 55 | +void SVC_Handler(void); | |
| 56 | +void DebugMon_Handler(void); | |
| 57 | +void PendSV_Handler(void); | |
| 58 | +void SysTick_Handler(void); | |
| 59 | +void DMA1_Stream0_IRQHandler(void); | |
| 60 | +void DMA1_Stream1_IRQHandler(void); | |
| 61 | +void DMA1_Stream2_IRQHandler(void); | |
| 62 | +void ADC_IRQHandler(void); | |
| 63 | +void I2C4_EV_IRQHandler(void); | |
| 64 | +void I2C4_ER_IRQHandler(void); | |
| 65 | +void OTG_FS_EP1_OUT_IRQHandler(void); | |
| 66 | +void OTG_FS_EP1_IN_IRQHandler(void); | |
| 67 | +void OTG_FS_IRQHandler(void); | |
| 68 | +void DMAMUX1_OVR_IRQHandler(void); | |
| 69 | +void BDMA_Channel0_IRQHandler(void); | |
| 70 | +void BDMA_Channel1_IRQHandler(void); | |
| 71 | +/* USER CODE BEGIN EFP */ | |
| 72 | + | |
| 73 | +/* USER CODE END EFP */ | |
| 74 | + | |
| 75 | +#ifdef __cplusplus | |
| 76 | +} | |
| 77 | +#endif | |
| 78 | + | |
| 79 | +#endif /* __STM32H7xx_IT_H */ | |
| 80 | + | |
| 81 | +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |
| @@ -0,0 +1,56 @@ | ||
| 1 | +/** | |
| 2 | + ****************************************************************************** | |
| 3 | + * File Name : SYS.h | |
| 4 | + * Description : This file provides code for the configuration | |
| 5 | + * of the SYS instances. | |
| 6 | + ****************************************************************************** | |
| 7 | + * @attention | |
| 8 | + * | |
| 9 | + * <h2><center>© Copyright (c) 2020 STMicroelectronics. | |
| 10 | + * All rights reserved.</center></h2> | |
| 11 | + * | |
| 12 | + * This software component is licensed by ST under Ultimate Liberty license | |
| 13 | + * SLA0044, the "License"; You may not use this file except in compliance with | |
| 14 | + * the License. You may obtain a copy of the License at: | |
| 15 | + * www.st.com/SLA0044 | |
| 16 | + * | |
| 17 | + ****************************************************************************** | |
| 18 | + */ | |
| 19 | +/* Define to prevent recursive inclusion -------------------------------------*/ | |
| 20 | +#ifndef __sys_H | |
| 21 | +#define __sys_H | |
| 22 | +#ifdef __cplusplus | |
| 23 | + extern "C" { | |
| 24 | +#endif | |
| 25 | + | |
| 26 | +/* Includes ------------------------------------------------------------------*/ | |
| 27 | +#include "main.h" | |
| 28 | + | |
| 29 | +/* USER CODE BEGIN Includes */ | |
| 30 | + | |
| 31 | +/* USER CODE END Includes */ | |
| 32 | + | |
| 33 | +/* USER CODE BEGIN Private defines */ | |
| 34 | + | |
| 35 | +/* USER CODE END Private defines */ | |
| 36 | + | |
| 37 | +void MX_SYS_Init(void); | |
| 38 | + | |
| 39 | +/* USER CODE BEGIN Prototypes */ | |
| 40 | + | |
| 41 | +/* USER CODE END Prototypes */ | |
| 42 | + | |
| 43 | +#ifdef __cplusplus | |
| 44 | +} | |
| 45 | +#endif | |
| 46 | +#endif /*__ sys_H */ | |
| 47 | + | |
| 48 | +/** | |
| 49 | + * @} | |
| 50 | + */ | |
| 51 | + | |
| 52 | +/** | |
| 53 | + * @} | |
| 54 | + */ | |
| 55 | + | |
| 56 | +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |
| @@ -0,0 +1,62 @@ | ||
| 1 | +/** | |
| 2 | + ****************************************************************************** | |
| 3 | + * File Name : TIM.h | |
| 4 | + * Description : This file provides code for the configuration | |
| 5 | + * of the TIM instances. | |
| 6 | + ****************************************************************************** | |
| 7 | + * @attention | |
| 8 | + * | |
| 9 | + * <h2><center>© Copyright (c) 2020 STMicroelectronics. | |
| 10 | + * All rights reserved.</center></h2> | |
| 11 | + * | |
| 12 | + * This software component is licensed by ST under Ultimate Liberty license | |
| 13 | + * SLA0044, the "License"; You may not use this file except in compliance with | |
| 14 | + * the License. You may obtain a copy of the License at: | |
| 15 | + * www.st.com/SLA0044 | |
| 16 | + * | |
| 17 | + ****************************************************************************** | |
| 18 | + */ | |
| 19 | +/* Define to prevent recursive inclusion -------------------------------------*/ | |
| 20 | +#ifndef __tim_H | |
| 21 | +#define __tim_H | |
| 22 | +#ifdef __cplusplus | |
| 23 | + extern "C" { | |
| 24 | +#endif | |
| 25 | + | |
| 26 | +/* Includes ------------------------------------------------------------------*/ | |
| 27 | +#include "main.h" | |
| 28 | + | |
| 29 | +/* USER CODE BEGIN Includes */ | |
| 30 | + | |
| 31 | +/* USER CODE END Includes */ | |
| 32 | + | |
| 33 | +extern TIM_HandleTypeDef htim3; | |
| 34 | +extern TIM_HandleTypeDef htim4; | |
| 35 | + | |
| 36 | +/* USER CODE BEGIN Private defines */ | |
| 37 | + | |
| 38 | +/* USER CODE END Private defines */ | |
| 39 | + | |
| 40 | +void MX_TIM3_Init(void); | |
| 41 | +void MX_TIM4_Init(void); | |
| 42 | + | |
| 43 | +void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim); | |
| 44 | + | |
| 45 | +/* USER CODE BEGIN Prototypes */ | |
| 46 | + | |
| 47 | +/* USER CODE END Prototypes */ | |
| 48 | + | |
| 49 | +#ifdef __cplusplus | |
| 50 | +} | |
| 51 | +#endif | |
| 52 | +#endif /*__ tim_H */ | |
| 53 | + | |
| 54 | +/** | |
| 55 | + * @} | |
| 56 | + */ | |
| 57 | + | |
| 58 | +/** | |
| 59 | + * @} | |
| 60 | + */ | |
| 61 | + | |
| 62 | +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |
| @@ -0,0 +1,20 @@ | ||
| 1 | +/* | |
| 2 | + * tunings.h | |
| 3 | + * | |
| 4 | + * Created on: Dec 18, 2019 | |
| 5 | + * Author: josnyder | |
| 6 | + */ | |
| 7 | + | |
| 8 | +#ifndef TUNINGS_H_ | |
| 9 | +#define TUNINGS_H_ | |
| 10 | + | |
| 11 | +#define NUM_TUNINGS 66 | |
| 12 | + | |
| 13 | +extern float centsDeviation[12]; | |
| 14 | +extern float tuningPresets[NUM_TUNINGS][12]; | |
| 15 | +extern uint32_t currentTuning; | |
| 16 | +extern uint8_t keyCenter; | |
| 17 | +extern char tuningNames[NUM_TUNINGS][6]; | |
| 18 | + | |
| 19 | + | |
| 20 | +#endif /* TUNINGS_H_ */ | |
| @@ -0,0 +1,116 @@ | ||
| 1 | +/* | |
| 2 | + * ui.h | |
| 3 | + * | |
| 4 | + * Created on: Aug 30, 2019 | |
| 5 | + * Author: jeffsnyder | |
| 6 | + */ | |
| 7 | +#ifndef UI_H_ | |
| 8 | +#define UI_H_ | |
| 9 | + | |
| 10 | +#define NUM_ADC_CHANNELS 6 | |
| 11 | +#define NUM_BUTTONS 10 | |
| 12 | + | |
| 13 | +//PresetNil is used as a counter for the size of the enum | |
| 14 | +typedef enum _VocodecPresetType | |
| 15 | +{ | |
| 16 | + Vocoder = 0, | |
| 17 | + Pitchshift, | |
| 18 | + AutotuneMono, | |
| 19 | + AutotunePoly, | |
| 20 | + SamplerButtonPress, | |
| 21 | + SamplerAutoGrab, | |
| 22 | + Distortion, | |
| 23 | + Wavefolder, | |
| 24 | + BitCrusher, | |
| 25 | + Delay, | |
| 26 | + Reverb, | |
| 27 | + Reverb2, | |
| 28 | + LivingString, | |
| 29 | + LivingStringSynth, | |
| 30 | + ClassicSynth, | |
| 31 | + Rhodes, | |
| 32 | + PresetNil | |
| 33 | +} VocodecPresetType; | |
| 34 | + | |
| 35 | +typedef enum _VocodecButton | |
| 36 | +{ | |
| 37 | + ButtonEdit = 0, | |
| 38 | + ButtonLeft, | |
| 39 | + ButtonRight, | |
| 40 | + ButtonDown, | |
| 41 | + ButtonUp, | |
| 42 | + ButtonA, | |
| 43 | + ButtonB, | |
| 44 | + ButtonC, | |
| 45 | + ButtonD, | |
| 46 | + ButtonE, | |
| 47 | + ButtonNil | |
| 48 | +} VocodecButton; | |
| 49 | + | |
| 50 | +typedef enum _ButtonAction | |
| 51 | +{ | |
| 52 | + ActionPress = 0, | |
| 53 | + ActionRelease, | |
| 54 | + ActionHoldInstant, | |
| 55 | + ActionHoldContinuous, | |
| 56 | + ActionNil | |
| 57 | +} ButtonAction; | |
| 58 | + | |
| 59 | +extern uint16_t ADC_values[NUM_ADC_CHANNELS]; | |
| 60 | + | |
| 61 | +extern uint8_t buttonValues[NUM_BUTTONS]; | |
| 62 | +//extern uint8_t buttonPressed[NUM_BUTTONS]; | |
| 63 | +//extern uint8_t buttonReleased[NUM_BUTTONS]; | |
| 64 | + | |
| 65 | +extern int8_t writeKnobFlag; | |
| 66 | +extern int8_t writeButtonFlag; | |
| 67 | +extern int8_t writeActionFlag; | |
| 68 | + | |
| 69 | +extern float floatADCUI[NUM_ADC_CHANNELS]; | |
| 70 | + | |
| 71 | +extern uint8_t currentPreset; | |
| 72 | +extern uint8_t previousPreset; | |
| 73 | +extern uint8_t loadingPreset; | |
| 74 | +// Display values | |
| 75 | +extern char* modeNames[PresetNil]; | |
| 76 | +extern char* modeNamesDetails[PresetNil]; | |
| 77 | +extern char* shortModeNames[PresetNil]; | |
| 78 | +extern char* paramNames[PresetNil][NUM_ADC_CHANNELS + NUM_BUTTONS]; | |
| 79 | +extern float knobParams[NUM_ADC_CHANNELS]; | |
| 80 | +extern int8_t cvAddParam; | |
| 81 | +extern uint8_t buttonActionsSFX[NUM_BUTTONS][ActionNil]; | |
| 82 | +extern char* (*buttonActionFunctions[PresetNil])(VocodecButton, ButtonAction); | |
| 83 | + | |
| 84 | +void initModeNames(void); | |
| 85 | + | |
| 86 | +void buttonCheck(void); | |
| 87 | + | |
| 88 | +void adcCheck(void); | |
| 89 | + | |
| 90 | +void clearButtonActions(void); | |
| 91 | + | |
| 92 | +void changeTuning(void); | |
| 93 | + | |
| 94 | +void writeCurrentPresetToFlash(void); | |
| 95 | + | |
| 96 | +char* UIVocoderButtons(VocodecButton button, ButtonAction action); | |
| 97 | +char* UIPitchShiftButtons(VocodecButton button, ButtonAction action); | |
| 98 | +char* UINeartuneButtons(VocodecButton button, ButtonAction action); | |
| 99 | +char* UIAutotuneButtons(VocodecButton button, ButtonAction action); | |
| 100 | +char* UISamplerBPButtons(VocodecButton button, ButtonAction action); | |
| 101 | +char* UISamplerAutoButtons(VocodecButton button, ButtonAction action); | |
| 102 | +char* UIDistortionButtons(VocodecButton button, ButtonAction action); | |
| 103 | +char* UIWaveFolderButtons(VocodecButton button, ButtonAction action); | |
| 104 | +char* UIBitcrusherButtons(VocodecButton button, ButtonAction action); | |
| 105 | +char* UIDelayButtons(VocodecButton button, ButtonAction action); | |
| 106 | +char* UIReverbButtons(VocodecButton button, ButtonAction action); | |
| 107 | +char* UIReverb2Buttons(VocodecButton button, ButtonAction action); | |
| 108 | +char* UILivingStringButtons(VocodecButton button, ButtonAction action); | |
| 109 | +char* UILivingStringSynthButtons(VocodecButton button, ButtonAction action); | |
| 110 | +char* UIClassicSynthButtons(VocodecButton button, ButtonAction action); | |
| 111 | +char* UIRhodesButtons(VocodecButton button, ButtonAction action); | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | +#endif /* UI_H_ */ | |
| 116 | + | |
| @@ -0,0 +1,94 @@ | ||
| 1 | +/* USER CODE BEGIN Header */ | |
| 2 | +/** | |
| 3 | + ****************************************************************************** | |
| 4 | + * @file : usb_host.h | |
| 5 | + * @version : v1.0_Cube | |
| 6 | + * @brief : Header for usb_host.c file. | |
| 7 | + ****************************************************************************** | |
| 8 | + * @attention | |
| 9 | + * | |
| 10 | + * <h2><center>© Copyright (c) 2019 STMicroelectronics. | |
| 11 | + * All rights reserved.</center></h2> | |
| 12 | + * | |
| 13 | + * This software component is licensed by ST under Ultimate Liberty license | |
| 14 | + * SLA0044, the "License"; You may not use this file except in compliance with | |
| 15 | + * the License. You may obtain a copy of the License at: | |
| 16 | + * www.st.com/SLA0044 | |
| 17 | + * | |
| 18 | + ****************************************************************************** | |
| 19 | + */ | |
| 20 | +/* USER CODE END Header */ | |
| 21 | + | |
| 22 | +/* Define to prevent recursive inclusion -------------------------------------*/ | |
| 23 | +#ifndef __USB_HOST__H__ | |
| 24 | +#define __USB_HOST__H__ | |
| 25 | + | |
| 26 | +#ifdef __cplusplus | |
| 27 | + extern "C" { | |
| 28 | +#endif | |
| 29 | + | |
| 30 | +/* Includes ------------------------------------------------------------------*/ | |
| 31 | +#include "stm32h7xx.h" | |
| 32 | +#include "stm32h7xx_hal.h" | |
| 33 | + | |
| 34 | +/* USER CODE BEGIN INCLUDE */ | |
| 35 | + | |
| 36 | +/* USER CODE END INCLUDE */ | |
| 37 | + | |
| 38 | +/** @addtogroup USBH_OTG_DRIVER | |
| 39 | + * @{ | |
| 40 | + */ | |
| 41 | + | |
| 42 | +/** @defgroup USBH_HOST USBH_HOST | |
| 43 | + * @brief Host file for Usb otg low level driver. | |
| 44 | + * @{ | |
| 45 | + */ | |
| 46 | + | |
| 47 | +/** @defgroup USBH_HOST_Exported_Variables USBH_HOST_Exported_Variables | |
| 48 | + * @brief Public variables. | |
| 49 | + * @{ | |
| 50 | + */ | |
| 51 | + | |
| 52 | +/** | |
| 53 | + * @} | |
| 54 | + */ | |
| 55 | + | |
| 56 | +/** Status of the application. */ | |
| 57 | +typedef enum { | |
| 58 | + APPLICATION_IDLE = 0, | |
| 59 | + APPLICATION_START, | |
| 60 | + APPLICATION_READY, | |
| 61 | + APPLICATION_DISCONNECT | |
| 62 | +}ApplicationTypeDef; | |
| 63 | + | |
| 64 | +/** @defgroup USBH_HOST_Exported_FunctionsPrototype USBH_HOST_Exported_FunctionsPrototype | |
| 65 | + * @brief Declaration of public functions for Usb host. | |
| 66 | + * @{ | |
| 67 | + */ | |
| 68 | + | |
| 69 | +/* Exported functions -------------------------------------------------------*/ | |
| 70 | + | |
| 71 | +/** @brief USB Host initialization function. */ | |
| 72 | +void MX_USB_HOST_Init(void); | |
| 73 | + | |
| 74 | +void MX_USB_HOST_Process(void); | |
| 75 | + | |
| 76 | +/** | |
| 77 | + * @} | |
| 78 | + */ | |
| 79 | + | |
| 80 | +/** | |
| 81 | + * @} | |
| 82 | + */ | |
| 83 | + | |
| 84 | +/** | |
| 85 | + * @} | |
| 86 | + */ | |
| 87 | + | |
| 88 | +#ifdef __cplusplus | |
| 89 | +} | |
| 90 | +#endif | |
| 91 | + | |
| 92 | +#endif /* __USB_HOST__H__ */ | |
| 93 | + | |
| 94 | +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |
| @@ -0,0 +1,211 @@ | ||
| 1 | +/** | |
| 2 | + ****************************************************************************** | |
| 3 | + * @file usbh_MIDI.h | |
| 4 | + * @author Xavier Halgand | |
| 5 | + * @version | |
| 6 | + * @date | |
| 7 | + * @brief This file contains all the prototypes for the usbh_MIDI.c | |
| 8 | + ****************************************************************************** | |
| 9 | + */ | |
| 10 | +/* | |
| 11 | + * This program is free software; you can redistribute it and/or modify | |
| 12 | + * it under the terms of the GNU General Public License as published by | |
| 13 | + * the Free Software Foundation; either version 2 of the License, or | |
| 14 | + * (at your option) any later version. | |
| 15 | + * | |
| 16 | + * This program is distributed in the hope that it will be useful, | |
| 17 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 18 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 19 | + * GNU General Public License for more details. | |
| 20 | + * | |
| 21 | + * You should have received a copy of the GNU General Public License | |
| 22 | + * along with this program; if not, write to the Free Software | |
| 23 | + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 24 | + * | |
| 25 | + */ | |
| 26 | + | |
| 27 | +/* Define to prevent recursive ----------------------------------------------*/ | |
| 28 | +#ifndef __USBH_MIDI_CORE_H | |
| 29 | +#define __USBH_MIDI_CORE_H | |
| 30 | + | |
| 31 | +#ifdef __cplusplus | |
| 32 | + extern "C" { | |
| 33 | +#endif | |
| 34 | + | |
| 35 | +/* Includes ------------------------------------------------------------------*/ | |
| 36 | +#include "usbh_core.h" | |
| 37 | +//#include "stm32f7xx_nucleo_144.h" | |
| 38 | + | |
| 39 | +/*-------------------------------------------------------------------------------*/ | |
| 40 | +// buffer size (should be at least >= MIOS32_USB_MIDI_DESC_DATA_*_SIZE/4) | |
| 41 | +#define USB_MIDI_RX_BUFFER_SIZE 64 // packages | |
| 42 | +#define USB_MIDI_TX_BUFFER_SIZE 64 // packages | |
| 43 | + | |
| 44 | +// size of IN/OUT pipe | |
| 45 | +#define USB_MIDI_DATA_IN_SIZE 64 | |
| 46 | +#define USB_MIDI_DATA_OUT_SIZE 64 | |
| 47 | + | |
| 48 | +// endpoint assignments (don't change!) | |
| 49 | +#define USB_MIDI_DATA_OUT_EP 0x02 | |
| 50 | +#define USB_MIDI_DATA_IN_EP 0x81 | |
| 51 | +/** @defgroup USBH_MIDI_CORE_Exported_Defines | |
| 52 | + * @{ | |
| 53 | + */ | |
| 54 | +#define USB_AUDIO_CLASS 0x01 | |
| 55 | +#define USB_MIDISTREAMING_SubCLASS 0x03 | |
| 56 | +#define USB_MIDI_DESC_SIZE 9 | |
| 57 | +#define USBH_MIDI_CLASS &MIDI_Class | |
| 58 | + | |
| 59 | +/*-------------------------------------------------------------------------------*/ | |
| 60 | + | |
| 61 | +extern USBH_ClassTypeDef MIDI_Class; | |
| 62 | + | |
| 63 | +/* -------------------- Exported_Types ------------------------------------------*/ | |
| 64 | + | |
| 65 | +typedef enum { | |
| 66 | + NoteOff = 0x8, | |
| 67 | + NoteOn = 0x9, | |
| 68 | + PolyPressure = 0xa, | |
| 69 | + CC = 0xb, | |
| 70 | + ProgramChange = 0xc, | |
| 71 | + Aftertouch = 0xd, | |
| 72 | + PitchBend = 0xe | |
| 73 | +} midi_event_t; | |
| 74 | + | |
| 75 | + | |
| 76 | +typedef enum { | |
| 77 | + Chn1, | |
| 78 | + Chn2, | |
| 79 | + Chn3, | |
| 80 | + Chn4, | |
| 81 | + Chn5, | |
| 82 | + Chn6, | |
| 83 | + Chn7, | |
| 84 | + Chn8, | |
| 85 | + Chn9, | |
| 86 | + Chn10, | |
| 87 | + Chn11, | |
| 88 | + Chn12, | |
| 89 | + Chn13, | |
| 90 | + Chn14, | |
| 91 | + Chn15, | |
| 92 | + Chn16 | |
| 93 | +} midi_chn_t; | |
| 94 | + | |
| 95 | +#pragma anon_unions | |
| 96 | + | |
| 97 | +typedef union { | |
| 98 | + struct { | |
| 99 | + uint32_t ALL; | |
| 100 | + }; | |
| 101 | + struct { | |
| 102 | + uint8_t cin_cable; | |
| 103 | + uint8_t evnt0; | |
| 104 | + uint8_t evnt1; | |
| 105 | + uint8_t evnt2; | |
| 106 | + }; | |
| 107 | + struct { | |
| 108 | + uint8_t type:4; | |
| 109 | + uint8_t cable:4; | |
| 110 | + uint8_t chn:4; // mios32_midi_chn_t | |
| 111 | + uint8_t event:4; // mios32_midi_event_t | |
| 112 | + uint8_t value1; | |
| 113 | + uint8_t value2; | |
| 114 | + }; | |
| 115 | + | |
| 116 | + // C++ doesn't allow to redefine names in anonymous unions | |
| 117 | + // as a simple workaround, we rename these redundant names | |
| 118 | + struct { | |
| 119 | + uint8_t cin:4; | |
| 120 | + uint8_t dummy1_cable:4; | |
| 121 | + uint8_t dummy1_chn:4; // mios32_midi_chn_t | |
| 122 | + uint8_t dummy1_event:4; // mios32_midi_event_t | |
| 123 | + uint8_t note:8; | |
| 124 | + uint8_t velocity:8; | |
| 125 | + }; | |
| 126 | + struct { | |
| 127 | + uint8_t dummy2_cin:4; | |
| 128 | + uint8_t dummy2_cable:4; | |
| 129 | + uint8_t dummy2_chn:4; // mios32_midi_chn_t | |
| 130 | + uint8_t dummy2_event:4; // mios32_midi_event_t | |
| 131 | + uint8_t cc_number:8; | |
| 132 | + uint8_t value:8; | |
| 133 | + }; | |
| 134 | + struct { | |
| 135 | + uint8_t dummy3_cin:4; | |
| 136 | + uint8_t dummy3_cable:4; | |
| 137 | + uint8_t dummy3_chn:4; // mios32_midi_chn_t | |
| 138 | + uint8_t dummy3_event:4; // mios32_midi_event_t | |
| 139 | + uint8_t program_change:8; | |
| 140 | + uint8_t dummy3:8; | |
| 141 | + }; | |
| 142 | +} midi_package_t; | |
| 143 | + | |
| 144 | +/* States for MIDI State Machine */ | |
| 145 | +typedef enum | |
| 146 | +{ | |
| 147 | + MIDI_IDLE= 0, | |
| 148 | + MIDI_SEND_DATA, | |
| 149 | + MIDI_SEND_DATA_WAIT, | |
| 150 | + MIDI_RECEIVE_DATA, | |
| 151 | + MIDI_RECEIVE_DATA_WAIT, | |
| 152 | +} | |
| 153 | +MIDI_DataStateTypeDef; | |
| 154 | + | |
| 155 | +typedef enum | |
| 156 | +{ | |
| 157 | + MIDI_IDLE_STATE= 0, | |
| 158 | + MIDI_TRANSFER_DATA, | |
| 159 | + MIDI_ERROR_STATE, | |
| 160 | +} | |
| 161 | +MIDI_StateTypeDef; | |
| 162 | + | |
| 163 | +/* Structure for MIDI process */ | |
| 164 | +typedef struct _MIDI_Process | |
| 165 | +{ | |
| 166 | + MIDI_StateTypeDef state; | |
| 167 | + uint8_t InPipe; | |
| 168 | + uint8_t OutPipe; | |
| 169 | + uint8_t OutEp; | |
| 170 | + uint8_t InEp; | |
| 171 | + uint16_t OutEpSize; | |
| 172 | + uint16_t InEpSize; | |
| 173 | + | |
| 174 | + uint8_t *pTxData; | |
| 175 | + uint8_t *pRxData; | |
| 176 | + uint16_t TxDataLength; | |
| 177 | + uint16_t RxDataLength; | |
| 178 | + MIDI_DataStateTypeDef data_tx_state; | |
| 179 | + MIDI_DataStateTypeDef data_rx_state; | |
| 180 | + uint8_t Rx_Poll; | |
| 181 | + //uint8_t buff[8]; | |
| 182 | + //MIDI_DataItfTypedef DataItf; | |
| 183 | + //CDC_InterfaceDesc_Typedef CDC_Desc; | |
| 184 | +} | |
| 185 | +MIDI_HandleTypeDef; | |
| 186 | + | |
| 187 | +/*---------------------------Exported_FunctionsPrototype-------------------------------------*/ | |
| 188 | + | |
| 189 | +USBH_StatusTypeDef USBH_MIDI_Transmit(USBH_HandleTypeDef *phost, | |
| 190 | + uint8_t *pbuff, | |
| 191 | + uint16_t length); | |
| 192 | + | |
| 193 | +USBH_StatusTypeDef USBH_MIDI_Receive(USBH_HandleTypeDef *phost, | |
| 194 | + uint8_t *pbuff, | |
| 195 | + uint16_t length); | |
| 196 | + | |
| 197 | + | |
| 198 | +uint32_t USBH_MIDI_GetLastReceivedDataSize(USBH_HandleTypeDef *phost); | |
| 199 | + | |
| 200 | +USBH_StatusTypeDef USBH_MIDI_Stop(USBH_HandleTypeDef *phost); | |
| 201 | + | |
| 202 | +void USBH_MIDI_TransmitCallback(USBH_HandleTypeDef *phost); | |
| 203 | + | |
| 204 | +void USBH_MIDI_ReceiveCallback(USBH_HandleTypeDef *phost, uint32_t myLength); | |
| 205 | + | |
| 206 | +/*-------------------------------------------------------------------------------------------*/ | |
| 207 | +#endif /* __USBH_MIDI_CORE_H */ | |
| 208 | + | |
| 209 | + | |
| 210 | +/*****************************END OF FILE*************************************************************/ | |
| 211 | + | |
| @@ -0,0 +1,199 @@ | ||
| 1 | +/* USER CODE BEGIN Header */ | |
| 2 | +/** | |
| 3 | + ****************************************************************************** | |
| 4 | + * @file : usbh_conf.h | |
| 5 | + * @version : v1.0_Cube | |
| 6 | + * @brief : Header for usbh_conf.c file. | |
| 7 | + ****************************************************************************** | |
| 8 | + * @attention | |
| 9 | + * | |
| 10 | + * <h2><center>© Copyright (c) 2019 STMicroelectronics. | |
| 11 | + * All rights reserved.</center></h2> | |
| 12 | + * | |
| 13 | + * This software component is licensed by ST under Ultimate Liberty license | |
| 14 | + * SLA0044, the "License"; You may not use this file except in compliance with | |
| 15 | + * the License. You may obtain a copy of the License at: | |
| 16 | + * www.st.com/SLA0044 | |
| 17 | + * | |
| 18 | + ****************************************************************************** | |
| 19 | + */ | |
| 20 | +/* USER CODE END Header */ | |
| 21 | + | |
| 22 | +/* Define to prevent recursive inclusion -------------------------------------*/ | |
| 23 | +#ifndef __USBH_CONF__H__ | |
| 24 | +#define __USBH_CONF__H__ | |
| 25 | +#ifdef __cplusplus | |
| 26 | + extern "C" { | |
| 27 | +#endif | |
| 28 | +/* Includes ------------------------------------------------------------------*/ | |
| 29 | + | |
| 30 | +#include <stdio.h> | |
| 31 | +#include <stdlib.h> | |
| 32 | +#include <string.h> | |
| 33 | +#include "main.h" | |
| 34 | + | |
| 35 | +#include "stm32h7xx.h" | |
| 36 | +#include "stm32h7xx_hal.h" | |
| 37 | + | |
| 38 | +/* USER CODE BEGIN INCLUDE */ | |
| 39 | + | |
| 40 | +/* USER CODE END INCLUDE */ | |
| 41 | + | |
| 42 | +/** @addtogroup STM32_USB_HOST_LIBRARY | |
| 43 | + * @{ | |
| 44 | + */ | |
| 45 | + | |
| 46 | +/** @defgroup USBH_CONF | |
| 47 | + * @brief usb host low level driver configuration file | |
| 48 | + * @{ | |
| 49 | + */ | |
| 50 | + | |
| 51 | +/** @defgroup USBH_CONF_Exported_Variables USBH_CONF_Exported_Variables | |
| 52 | + * @brief Public variables. | |
| 53 | + * @{ | |
| 54 | + */ | |
| 55 | + | |
| 56 | +/** | |
| 57 | + * @} | |
| 58 | + */ | |
| 59 | + | |
| 60 | +/** @defgroup USBH_CONF_Exported_Defines USBH_CONF_Exported_Defines | |
| 61 | + * @brief Defines for configuration of the Usb host. | |
| 62 | + * @{ | |
| 63 | + */ | |
| 64 | + | |
| 65 | +/*---------- -----------*/ | |
| 66 | +#define USBH_MAX_NUM_ENDPOINTS 2U | |
| 67 | + | |
| 68 | +/*---------- -----------*/ | |
| 69 | +#define USBH_MAX_NUM_INTERFACES 10U | |
| 70 | + | |
| 71 | +/*---------- -----------*/ | |
| 72 | +#define USBH_MAX_NUM_CONFIGURATION 10U | |
| 73 | + | |
| 74 | +/*---------- -----------*/ | |
| 75 | +#define USBH_KEEP_CFG_DESCRIPTOR 1U | |
| 76 | + | |
| 77 | +/*---------- -----------*/ | |
| 78 | +#define USBH_MAX_NUM_SUPPORTED_CLASS 1U | |
| 79 | + | |
| 80 | +/*---------- -----------*/ | |
| 81 | +#define USBH_MAX_SIZE_CONFIGURATION 256U | |
| 82 | + | |
| 83 | +/*---------- -----------*/ | |
| 84 | +#define USBH_MAX_DATA_BUFFER 512U | |
| 85 | + | |
| 86 | +/*---------- -----------*/ | |
| 87 | +#define USBH_DEBUG_LEVEL 0U | |
| 88 | + | |
| 89 | +/*---------- -----------*/ | |
| 90 | +#define USBH_USE_OS 0U | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | +/****************************************/ | |
| 96 | +/* #define for FS and HS identification */ | |
| 97 | +#define HOST_HS 0 | |
| 98 | +#define HOST_FS 1 | |
| 99 | + | |
| 100 | +#if (USBH_USE_OS == 1) | |
| 101 | + #include "cmsis_os.h" | |
| 102 | + #define USBH_PROCESS_PRIO osPriorityNormal | |
| 103 | + #define USBH_PROCESS_STACK_SIZE ((uint16_t)0) | |
| 104 | +#endif /* (USBH_USE_OS == 1) */ | |
| 105 | + | |
| 106 | +/** | |
| 107 | + * @} | |
| 108 | + */ | |
| 109 | + | |
| 110 | +/** @defgroup USBH_CONF_Exported_Macros USBH_CONF_Exported_Macros | |
| 111 | + * @brief Aliases. | |
| 112 | + * @{ | |
| 113 | + */ | |
| 114 | + | |
| 115 | +/* Memory management macros */ | |
| 116 | + | |
| 117 | +/** Alias for memory allocation. */ | |
| 118 | +#define USBH_malloc malloc | |
| 119 | + | |
| 120 | +/** Alias for memory release. */ | |
| 121 | +#define USBH_free free | |
| 122 | + | |
| 123 | +/** Alias for memory set. */ | |
| 124 | +#define USBH_memset memset | |
| 125 | + | |
| 126 | +/** Alias for memory copy. */ | |
| 127 | +#define USBH_memcpy memcpy | |
| 128 | + | |
| 129 | +/* DEBUG macros */ | |
| 130 | + | |
| 131 | +#if (USBH_DEBUG_LEVEL > 0U) | |
| 132 | +#define USBH_UsrLog(...) do { \ | |
| 133 | + printf(__VA_ARGS__); \ | |
| 134 | + printf("\n"); \ | |
| 135 | +} while (0) | |
| 136 | +#else | |
| 137 | +#define USBH_UsrLog(...) do {} while (0) | |
| 138 | +#endif | |
| 139 | + | |
| 140 | +#if (USBH_DEBUG_LEVEL > 1U) | |
| 141 | + | |
| 142 | +#define USBH_ErrLog(...) do { \ | |
| 143 | + printf("ERROR: ") ; \ | |
| 144 | + printf(__VA_ARGS__); \ | |
| 145 | + printf("\n"); \ | |
| 146 | +} while (0) | |
| 147 | +#else | |
| 148 | +#define USBH_ErrLog(...) do {} while (0) | |
| 149 | +#endif | |
| 150 | + | |
| 151 | +#if (USBH_DEBUG_LEVEL > 2U) | |
| 152 | +#define USBH_DbgLog(...) do { \ | |
| 153 | + printf("DEBUG : ") ; \ | |
| 154 | + printf(__VA_ARGS__); \ | |
| 155 | + printf("\n"); \ | |
| 156 | +} while (0) | |
| 157 | +#else | |
| 158 | +#define USBH_DbgLog(...) do {} while (0) | |
| 159 | +#endif | |
| 160 | + | |
| 161 | +/** | |
| 162 | + * @} | |
| 163 | + */ | |
| 164 | + | |
| 165 | +/** @defgroup USBH_CONF_Exported_Types USBH_CONF_Exported_Types | |
| 166 | + * @brief Types. | |
| 167 | + * @{ | |
| 168 | + */ | |
| 169 | + | |
| 170 | +/** | |
| 171 | + * @} | |
| 172 | + */ | |
| 173 | + | |
| 174 | +/** @defgroup USBH_CONF_Exported_FunctionsPrototype USBH_CONF_Exported_FunctionsPrototype | |
| 175 | + * @brief Declaration of public functions for Usb host. | |
| 176 | + * @{ | |
| 177 | + */ | |
| 178 | + | |
| 179 | +/* Exported functions -------------------------------------------------------*/ | |
| 180 | + | |
| 181 | +/** | |
| 182 | + * @} | |
| 183 | + */ | |
| 184 | + | |
| 185 | +/** | |
| 186 | + * @} | |
| 187 | + */ | |
| 188 | + | |
| 189 | +/** | |
| 190 | + * @} | |
| 191 | + */ | |
| 192 | + | |
| 193 | +#ifdef __cplusplus | |
| 194 | +} | |
| 195 | +#endif | |
| 196 | + | |
| 197 | +#endif /* __USBH_CONF__H__ */ | |
| 198 | + | |
| 199 | +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |
| @@ -0,0 +1,44 @@ | ||
| 1 | +/* USER CODE BEGIN Header */ | |
| 2 | +/** | |
| 3 | + ****************************************************************************** | |
| 4 | + * @file : usbh_platform.h | |
| 5 | + * @brief : Header for usbh_platform.c file. | |
| 6 | + ****************************************************************************** | |
| 7 | + * @attention | |
| 8 | + * | |
| 9 | + * <h2><center>© Copyright (c) 2019 STMicroelectronics. | |
| 10 | + * All rights reserved.</center></h2> | |
| 11 | + * | |
| 12 | + * This software component is licensed by ST under Ultimate Liberty license | |
| 13 | + * SLA0044, the "License"; You may not use this file except in compliance with | |
| 14 | + * the License. You may obtain a copy of the License at: | |
| 15 | + * www.st.com/SLA0044 | |
| 16 | + * | |
| 17 | + ****************************************************************************** | |
| 18 | + */ | |
| 19 | +/* USER CODE END Header */ | |
| 20 | + | |
| 21 | +/* Define to prevent recursive inclusion -------------------------------------*/ | |
| 22 | +#ifndef __USBH_PLATFORM_H__ | |
| 23 | +#define __USBH_PLATFORM_H__ | |
| 24 | + | |
| 25 | +#ifdef __cplusplus | |
| 26 | + extern "C" { | |
| 27 | +#endif | |
| 28 | + | |
| 29 | +/* Includes ------------------------------------------------------------------*/ | |
| 30 | +#include "usb_host.h" | |
| 31 | + | |
| 32 | +/* USER CODE BEGIN INCLUDE */ | |
| 33 | + | |
| 34 | +/* USER CODE END INCLUDE */ | |
| 35 | + | |
| 36 | +void MX_DriverVbusFS(uint8_t state); | |
| 37 | + | |
| 38 | +#ifdef __cplusplus | |
| 39 | +} | |
| 40 | +#endif | |
| 41 | + | |
| 42 | +#endif /* __USBH_PLATFORM_H__ */ | |
| 43 | + | |
| 44 | +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |
Binary file not shown.
| @@ -0,0 +1,192 @@ | ||
| 1 | +/* | |
| 2 | + * MIDI_application.c | |
| 3 | + * | |
| 4 | + * Created on: 6 d�c. 2014 | |
| 5 | + * Author: Xavier Halgand | |
| 6 | + * | |
| 7 | + * Modified on: 9/12/16 by C.P. to handle the MIDI_IDLE state properly, and | |
| 8 | + * added required code to be compatible with "NucleoSynth" | |
| 9 | + * | |
| 10 | + * 11/8/17 by C.P.: Version 0.7.7 - Use for Casio CTK-6200 Keyboard | |
| 11 | + */ | |
| 12 | + | |
| 13 | +/* Includes ------------------------------------------------------------------*/ | |
| 14 | +#include "audiostream.h" | |
| 15 | +#include "MIDI_application.h" | |
| 16 | +#include "usbh_core.h" | |
| 17 | +#include "usbh_MIDI.h" | |
| 18 | +#include "usb_host.h" | |
| 19 | +#include "sfx.h" | |
| 20 | + | |
| 21 | +MIDI_ApplicationTypeDef MIDI_Appli_state = MIDI_APPLICATION_READY; | |
| 22 | +extern ApplicationTypeDef Appli_state; | |
| 23 | +extern USBH_HandleTypeDef hUsbHostFS; | |
| 24 | +uint8_t MIDI_RX_Buffer[RX_BUFF_SIZE]__ATTR_RAM_D2; // MIDI reception buffer | |
| 25 | + | |
| 26 | +uint8_t key, velocity, ctrl, data, sustainInverted; | |
| 27 | + | |
| 28 | +uint8_t CCs[128]; | |
| 29 | +/* Private define ------------------------------------------------------------*/ | |
| 30 | + | |
| 31 | +/* Private function prototypes -----------------------------------------------*/ | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | +/*-----------------------------------------------------------------------------*/ | |
| 37 | +/** | |
| 38 | + * @brief Main routine for MIDI application, looped in main.c | |
| 39 | + * @param None | |
| 40 | + * @retval none | |
| 41 | + */ | |
| 42 | +void MIDI_Application(void) | |
| 43 | +{ | |
| 44 | + if(Appli_state == APPLICATION_READY) | |
| 45 | + { | |
| 46 | + if(MIDI_Appli_state == MIDI_APPLICATION_READY) | |
| 47 | + { | |
| 48 | + | |
| 49 | + USBH_MIDI_Receive(&hUsbHostFS, MIDI_RX_Buffer, RX_BUFF_SIZE); // just once at the beginning, start the first reception | |
| 50 | + MIDI_Appli_state = MIDI_APPLICATION_RUNNING; | |
| 51 | + } | |
| 52 | + } | |
| 53 | + if(Appli_state == APPLICATION_DISCONNECT) | |
| 54 | + { | |
| 55 | + MIDI_Appli_state = MIDI_APPLICATION_READY; | |
| 56 | + USBH_MIDI_Stop(&hUsbHostFS); | |
| 57 | + } | |
| 58 | +} | |
| 59 | + | |
| 60 | +/*-----------------------------------------------------------------------------*/ | |
| 61 | +void ProcessReceivedMidiDatas(uint32_t myLength) | |
| 62 | +{ | |
| 63 | + uint16_t numberOfPackets; | |
| 64 | + uint8_t *ptr = MIDI_RX_Buffer; | |
| 65 | + midi_package_t pack; | |
| 66 | + | |
| 67 | + numberOfPackets = myLength >> 2; //each USB midi package is 4 bytes long | |
| 68 | + | |
| 69 | + if (numberOfPackets != 0) | |
| 70 | + { | |
| 71 | + while(numberOfPackets--) | |
| 72 | + { | |
| 73 | + pack.cin_cable = *ptr ; ptr++ ; | |
| 74 | + pack.evnt0 = *ptr ; ptr++ ; | |
| 75 | + pack.evnt1 = *ptr ; ptr++ ; | |
| 76 | + pack.evnt2 = *ptr ; ptr++ ; | |
| 77 | + | |
| 78 | + // Handle MIDI messages | |
| 79 | + switch(pack.evnt0) | |
| 80 | + { | |
| 81 | + case (0x80): // Note Off | |
| 82 | + key = pack.evnt1; | |
| 83 | + velocity = pack.evnt2; | |
| 84 | + | |
| 85 | + noteOff(key, velocity); | |
| 86 | + | |
| 87 | + break; | |
| 88 | + case (0x90): // Note On | |
| 89 | + key = pack.evnt1; | |
| 90 | + velocity = pack.evnt2; | |
| 91 | + | |
| 92 | + noteOn(key, velocity); | |
| 93 | + | |
| 94 | + break; | |
| 95 | + case (0xA0): | |
| 96 | + break; | |
| 97 | + case (0xB0): | |
| 98 | + ctrl = pack.evnt1; | |
| 99 | + data = pack.evnt2; | |
| 100 | + CCs[ctrl] = data; | |
| 101 | + switch(ctrl) | |
| 102 | + { | |
| 103 | + case (0x01): | |
| 104 | + break; | |
| 105 | + case (0x02): | |
| 106 | + break; | |
| 107 | + case (0x03): | |
| 108 | + break; | |
| 109 | + case (0x04): | |
| 110 | + break; | |
| 111 | + case (0x0D): | |
| 112 | + break; | |
| 113 | + case (0x4B): | |
| 114 | + break; | |
| 115 | + case (0x4C): | |
| 116 | + break; | |
| 117 | + case (0x5C): | |
| 118 | + break; | |
| 119 | + case (0x5F): | |
| 120 | + break; | |
| 121 | + case (0x49): | |
| 122 | + break; | |
| 123 | + case (0x48): | |
| 124 | + break; | |
| 125 | + case (0x5B): | |
| 126 | + break; | |
| 127 | + case (0x5D): | |
| 128 | + break; | |
| 129 | + case (0x4A): | |
| 130 | + break; | |
| 131 | + case (0x47): | |
| 132 | + break; | |
| 133 | + case (0x05): | |
| 134 | + break; | |
| 135 | + case (0x54): | |
| 136 | + break; | |
| 137 | + case (0x10): | |
| 138 | + break; | |
| 139 | + case (0x11): | |
| 140 | + break; | |
| 141 | + case (0x12): | |
| 142 | + break; | |
| 143 | + case (0x07): | |
| 144 | + break; | |
| 145 | + case (0x13): | |
| 146 | + break; | |
| 147 | + case (0x14): | |
| 148 | + break; | |
| 149 | + case (64): // sustain | |
| 150 | + if (data) | |
| 151 | + { | |
| 152 | + if (sustainInverted) sustainOff(); | |
| 153 | + else sustainOn(); | |
| 154 | + } | |
| 155 | + else | |
| 156 | + { | |
| 157 | + if (sustainInverted) sustainOn(); | |
| 158 | + else sustainOff(); | |
| 159 | + } | |
| 160 | + break; | |
| 161 | + } | |
| 162 | + | |
| 163 | + | |
| 164 | + break; | |
| 165 | + case (0xC0): // Program Change | |
| 166 | + break; | |
| 167 | + case (0xD0): // Mono Aftertouch | |
| 168 | + break; | |
| 169 | + case (0xE0): // Pitch Bend | |
| 170 | + pitchBend((pack.evnt1) + (pack.evnt2 << 7)); | |
| 171 | + break; | |
| 172 | + case (0xF0): | |
| 173 | + break; | |
| 174 | + } | |
| 175 | + } | |
| 176 | + } | |
| 177 | +} | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | +/*-----------------------------------------------------------------------------*/ | |
| 182 | +/** | |
| 183 | + * @brief MIDI data receive callback. | |
| 184 | + * @param phost: Host handle | |
| 185 | + * @retval None | |
| 186 | + */ | |
| 187 | +void USBH_MIDI_ReceiveCallback(USBH_HandleTypeDef *phost, uint32_t myLength) | |
| 188 | +{ | |
| 189 | + ProcessReceivedMidiDatas(myLength); | |
| 190 | + USBH_MIDI_Receive(&hUsbHostFS, MIDI_RX_Buffer, RX_BUFF_SIZE); // start a new reception | |
| 191 | +} | |
| 192 | + | |
| @@ -0,0 +1,239 @@ | ||
| 1 | +/** | |
| 2 | + ****************************************************************************** | |
| 3 | + * File Name : ADC.c | |
| 4 | + * Description : This file provides code for the configuration | |
| 5 | + * of the ADC instances. | |
| 6 | + ****************************************************************************** | |
| 7 | + * @attention | |
| 8 | + * | |
| 9 | + * <h2><center>© Copyright (c) 2020 STMicroelectronics. | |
| 10 | + * All rights reserved.</center></h2> | |
| 11 | + * | |
| 12 | + * This software component is licensed by ST under Ultimate Liberty license | |
| 13 | + * SLA0044, the "License"; You may not use this file except in compliance with | |
| 14 | + * the License. You may obtain a copy of the License at: | |
| 15 | + * www.st.com/SLA0044 | |
| 16 | + * | |
| 17 | + ****************************************************************************** | |
| 18 | + */ | |
| 19 | + | |
| 20 | +/* Includes ------------------------------------------------------------------*/ | |
| 21 | +#include "adc.h" | |
| 22 | + | |
| 23 | +/* USER CODE BEGIN 0 */ | |
| 24 | + | |
| 25 | +/* USER CODE END 0 */ | |
| 26 | + | |
| 27 | +ADC_HandleTypeDef hadc1; | |
| 28 | +DMA_HandleTypeDef hdma_adc1; | |
| 29 | + | |
| 30 | +/* ADC1 init function */ | |
| 31 | +void MX_ADC1_Init(void) | |
| 32 | +{ | |
| 33 | + ADC_MultiModeTypeDef multimode = {0}; | |
| 34 | + ADC_ChannelConfTypeDef sConfig = {0}; | |
| 35 | + | |
| 36 | + /** Common config | |
| 37 | + */ | |
| 38 | + hadc1.Instance = ADC1; | |
| 39 | + hadc1.Init.ClockPrescaler = ADC_CLOCK_ASYNC_DIV4; | |
| 40 | + hadc1.Init.Resolution = ADC_RESOLUTION_16B; | |
| 41 | + hadc1.Init.ScanConvMode = ADC_SCAN_ENABLE; | |
| 42 | + hadc1.Init.EOCSelection = ADC_EOC_SEQ_CONV; | |
| 43 | + hadc1.Init.LowPowerAutoWait = DISABLE; | |
| 44 | + hadc1.Init.ContinuousConvMode = ENABLE; | |
| 45 | + hadc1.Init.NbrOfConversion = 6; | |
| 46 | + hadc1.Init.DiscontinuousConvMode = DISABLE; | |
| 47 | + hadc1.Init.ExternalTrigConv = ADC_SOFTWARE_START; | |
| 48 | + hadc1.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE; | |
| 49 | + hadc1.Init.ConversionDataManagement = ADC_CONVERSIONDATA_DMA_CIRCULAR; | |
| 50 | + hadc1.Init.Overrun = ADC_OVR_DATA_PRESERVED; | |
| 51 | + hadc1.Init.LeftBitShift = ADC_LEFTBITSHIFT_NONE; | |
| 52 | + hadc1.Init.OversamplingMode = ENABLE; | |
| 53 | + hadc1.Init.Oversampling.Ratio = 64; | |
| 54 | + hadc1.Init.Oversampling.RightBitShift = ADC_RIGHTBITSHIFT_6; | |
| 55 | + hadc1.Init.Oversampling.TriggeredMode = ADC_TRIGGEREDMODE_SINGLE_TRIGGER; | |
| 56 | + hadc1.Init.Oversampling.OversamplingStopReset = ADC_REGOVERSAMPLING_CONTINUED_MODE; | |
| 57 | + if (HAL_ADC_Init(&hadc1) != HAL_OK) | |
| 58 | + { | |
| 59 | + Error_Handler(); | |
| 60 | + } | |
| 61 | + /** Configure the ADC multi-mode | |
| 62 | + */ | |
| 63 | + multimode.Mode = ADC_MODE_INDEPENDENT; | |
| 64 | + if (HAL_ADCEx_MultiModeConfigChannel(&hadc1, &multimode) != HAL_OK) | |
| 65 | + { | |
| 66 | + Error_Handler(); | |
| 67 | + } | |
| 68 | + /** Configure Regular Channel | |
| 69 | + */ | |
| 70 | + sConfig.Channel = ADC_CHANNEL_7; | |
| 71 | + sConfig.Rank = ADC_REGULAR_RANK_1; | |
| 72 | + sConfig.SamplingTime = ADC_SAMPLETIME_64CYCLES_5; | |
| 73 | + sConfig.SingleDiff = ADC_SINGLE_ENDED; | |
| 74 | + sConfig.OffsetNumber = ADC_OFFSET_NONE; | |
| 75 | + sConfig.Offset = 0; | |
| 76 | + if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK) | |
| 77 | + { | |
| 78 | + Error_Handler(); | |
| 79 | + } | |
| 80 | + /** Configure Regular Channel | |
| 81 | + */ | |
| 82 | + sConfig.Channel = ADC_CHANNEL_19; | |
| 83 | + sConfig.Rank = ADC_REGULAR_RANK_2; | |
| 84 | + if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK) | |
| 85 | + { | |
| 86 | + Error_Handler(); | |
| 87 | + } | |
| 88 | + /** Configure Regular Channel | |
| 89 | + */ | |
| 90 | + sConfig.Channel = ADC_CHANNEL_14; | |
| 91 | + sConfig.Rank = ADC_REGULAR_RANK_3; | |
| 92 | + if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK) | |
| 93 | + { | |
| 94 | + Error_Handler(); | |
| 95 | + } | |
| 96 | + /** Configure Regular Channel | |
| 97 | + */ | |
| 98 | + sConfig.Channel = ADC_CHANNEL_16; | |
| 99 | + sConfig.Rank = ADC_REGULAR_RANK_4; | |
| 100 | + if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK) | |
| 101 | + { | |
| 102 | + Error_Handler(); | |
| 103 | + } | |
| 104 | + /** Configure Regular Channel | |
| 105 | + */ | |
| 106 | + sConfig.Channel = ADC_CHANNEL_15; | |
| 107 | + sConfig.Rank = ADC_REGULAR_RANK_5; | |
| 108 | + if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK) | |
| 109 | + { | |
| 110 | + Error_Handler(); | |
| 111 | + } | |
| 112 | + /** Configure Regular Channel | |
| 113 | + */ | |
| 114 | + sConfig.Channel = ADC_CHANNEL_8; | |
| 115 | + sConfig.Rank = ADC_REGULAR_RANK_6; | |
| 116 | + if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK) | |
| 117 | + { | |
| 118 | + Error_Handler(); | |
| 119 | + } | |
| 120 | + | |
| 121 | +} | |
| 122 | + | |
| 123 | +void HAL_ADC_MspInit(ADC_HandleTypeDef* adcHandle) | |
| 124 | +{ | |
| 125 | + | |
| 126 | + GPIO_InitTypeDef GPIO_InitStruct = {0}; | |
| 127 | + HAL_DMA_MuxSyncConfigTypeDef pSyncConfig= {0}; | |
| 128 | + if(adcHandle->Instance==ADC1) | |
| 129 | + { | |
| 130 | + /* USER CODE BEGIN ADC1_MspInit 0 */ | |
| 131 | + | |
| 132 | + /* USER CODE END ADC1_MspInit 0 */ | |
| 133 | + /* ADC1 clock enable */ | |
| 134 | + __HAL_RCC_ADC12_CLK_ENABLE(); | |
| 135 | + | |
| 136 | + __HAL_RCC_GPIOC_CLK_ENABLE(); | |
| 137 | + __HAL_RCC_GPIOA_CLK_ENABLE(); | |
| 138 | + /**ADC1 GPIO Configuration | |
| 139 | + PC1 ------> ADC1_INP11 | |
| 140 | + PA0 ------> ADC1_INP16 | |
| 141 | + PA2 ------> ADC1_INP14 | |
| 142 | + PA3 ------> ADC1_INP15 | |
| 143 | + PA5 ------> ADC1_INP19 | |
| 144 | + PA7 ------> ADC1_INP7 | |
| 145 | + PC5 ------> ADC1_INP8 | |
| 146 | + */ | |
| 147 | + GPIO_InitStruct.Pin = GPIO_PIN_1|GPIO_PIN_5; | |
| 148 | + GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; | |
| 149 | + GPIO_InitStruct.Pull = GPIO_NOPULL; | |
| 150 | + HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); | |
| 151 | + | |
| 152 | + GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_2|GPIO_PIN_3|GPIO_PIN_5 | |
| 153 | + |GPIO_PIN_7; | |
| 154 | + GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; | |
| 155 | + GPIO_InitStruct.Pull = GPIO_NOPULL; | |
| 156 | + HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); | |
| 157 | + | |
| 158 | + /* ADC1 DMA Init */ | |
| 159 | + /* ADC1 Init */ | |
| 160 | + hdma_adc1.Instance = DMA1_Stream0; | |
| 161 | + hdma_adc1.Init.Request = DMA_REQUEST_ADC1; | |
| 162 | + hdma_adc1.Init.Direction = DMA_PERIPH_TO_MEMORY; | |
| 163 | + hdma_adc1.Init.PeriphInc = DMA_PINC_DISABLE; | |
| 164 | + hdma_adc1.Init.MemInc = DMA_MINC_ENABLE; | |
| 165 | + hdma_adc1.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD; | |
| 166 | + hdma_adc1.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD; | |
| 167 | + hdma_adc1.Init.Mode = DMA_CIRCULAR; | |
| 168 | + hdma_adc1.Init.Priority = DMA_PRIORITY_HIGH; | |
| 169 | + hdma_adc1.Init.FIFOMode = DMA_FIFOMODE_ENABLE; | |
| 170 | + hdma_adc1.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_1QUARTERFULL; | |
| 171 | + hdma_adc1.Init.MemBurst = DMA_MBURST_SINGLE; | |
| 172 | + hdma_adc1.Init.PeriphBurst = DMA_PBURST_SINGLE; | |
| 173 | + if (HAL_DMA_Init(&hdma_adc1) != HAL_OK) | |
| 174 | + { | |
| 175 | + Error_Handler(); | |
| 176 | + } | |
| 177 | + | |
| 178 | + pSyncConfig.SyncSignalID = HAL_DMAMUX1_SYNC_EXTI0; | |
| 179 | + pSyncConfig.SyncPolarity = HAL_DMAMUX_SYNC_RISING; | |
| 180 | + pSyncConfig.SyncEnable = DISABLE; | |
| 181 | + pSyncConfig.EventEnable = ENABLE; | |
| 182 | + pSyncConfig.RequestNumber = 1; | |
| 183 | + if (HAL_DMAEx_ConfigMuxSync(&hdma_adc1, &pSyncConfig) != HAL_OK) | |
| 184 | + { | |
| 185 | + Error_Handler(); | |
| 186 | + } | |
| 187 | + | |
| 188 | + __HAL_LINKDMA(adcHandle,DMA_Handle,hdma_adc1); | |
| 189 | + | |
| 190 | + /* ADC1 interrupt Init */ | |
| 191 | + HAL_NVIC_SetPriority(ADC_IRQn, 0, 0); | |
| 192 | + HAL_NVIC_EnableIRQ(ADC_IRQn); | |
| 193 | + /* USER CODE BEGIN ADC1_MspInit 1 */ | |
| 194 | + | |
| 195 | + /* USER CODE END ADC1_MspInit 1 */ | |
| 196 | + } | |
| 197 | +} | |
| 198 | + | |
| 199 | +void HAL_ADC_MspDeInit(ADC_HandleTypeDef* adcHandle) | |
| 200 | +{ | |
| 201 | + | |
| 202 | + if(adcHandle->Instance==ADC1) | |
| 203 | + { | |
| 204 | + /* USER CODE BEGIN ADC1_MspDeInit 0 */ | |
| 205 | + | |
| 206 | + /* USER CODE END ADC1_MspDeInit 0 */ | |
| 207 | + /* Peripheral clock disable */ | |
| 208 | + __HAL_RCC_ADC12_CLK_DISABLE(); | |
| 209 | + | |
| 210 | + /**ADC1 GPIO Configuration | |
| 211 | + PC1 ------> ADC1_INP11 | |
| 212 | + PA0 ------> ADC1_INP16 | |
| 213 | + PA2 ------> ADC1_INP14 | |
| 214 | + PA3 ------> ADC1_INP15 | |
| 215 | + PA5 ------> ADC1_INP19 | |
| 216 | + PA7 ------> ADC1_INP7 | |
| 217 | + PC5 ------> ADC1_INP8 | |
| 218 | + */ | |
| 219 | + HAL_GPIO_DeInit(GPIOC, GPIO_PIN_1|GPIO_PIN_5); | |
| 220 | + | |
| 221 | + HAL_GPIO_DeInit(GPIOA, GPIO_PIN_0|GPIO_PIN_2|GPIO_PIN_3|GPIO_PIN_5 | |
| 222 | + |GPIO_PIN_7); | |
| 223 | + | |
| 224 | + /* ADC1 DMA DeInit */ | |
| 225 | + HAL_DMA_DeInit(adcHandle->DMA_Handle); | |
| 226 | + | |
| 227 | + /* ADC1 interrupt Deinit */ | |
| 228 | + HAL_NVIC_DisableIRQ(ADC_IRQn); | |
| 229 | + /* USER CODE BEGIN ADC1_MspDeInit 1 */ | |
| 230 | + | |
| 231 | + /* USER CODE END ADC1_MspDeInit 1 */ | |
| 232 | + } | |
| 233 | +} | |
| 234 | + | |
| 235 | +/* USER CODE BEGIN 1 */ | |
| 236 | + | |
| 237 | +/* USER CODE END 1 */ | |
| 238 | + | |
| 239 | +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |
| @@ -0,0 +1,518 @@ | ||
| 1 | +/* | |
| 2 | + * audiostream.c | |
| 3 | + * | |
| 4 | + * Created on: Aug 30, 2019 | |
| 5 | + * Author: jeffsnyder | |
| 6 | + */ | |
| 7 | + | |
| 8 | + | |
| 9 | +/* Includes ------------------------------------------------------------------*/ | |
| 10 | +#include "audiostream.h" | |
| 11 | +#include "main.h" | |
| 12 | +#include "leaf.h" | |
| 13 | +#include "codec.h" | |
| 14 | +#include "ui.h" | |
| 15 | +#include "oled.h" | |
| 16 | +#include "tunings.h" | |
| 17 | +#include "i2c.h" | |
| 18 | +#include "gpio.h" | |
| 19 | +#include "sfx.h" | |
| 20 | +#include "tim.h" | |
| 21 | + | |
| 22 | +//the audio buffers are put in the D2 RAM area because that is a memory location that the DMA has access to. | |
| 23 | +int32_t audioOutBuffer[AUDIO_BUFFER_SIZE] __ATTR_RAM_D2; | |
| 24 | +int32_t audioInBuffer[AUDIO_BUFFER_SIZE] __ATTR_RAM_D2; | |
| 25 | + | |
| 26 | +#define SMALL_MEM_SIZE 8192 | |
| 27 | +#define MED_MEM_SIZE 500000 | |
| 28 | +#define LARGE_MEM_SIZE 33554432 //32 MBytes - size of SDRAM IC | |
| 29 | +char small_memory[SMALL_MEM_SIZE]; | |
| 30 | +char medium_memory[MED_MEM_SIZE]__ATTR_RAM_D1; | |
| 31 | +char large_memory[LARGE_MEM_SIZE] __ATTR_SDRAM; | |
| 32 | + | |
| 33 | +#define DISPLAY_BLOCK_SIZE 512 | |
| 34 | +float audioDisplayBuffer[128]; | |
| 35 | +uint8_t displayBufferIndex = 0; | |
| 36 | +float displayBlockVal = 0.0f; | |
| 37 | +uint32_t displayBlockCount = 0; | |
| 38 | + | |
| 39 | + | |
| 40 | +void audioFrame(uint16_t buffer_offset); | |
| 41 | +float audioTickL(float audioIn); | |
| 42 | +float audioTickR(float audioIn); | |
| 43 | +void buttonCheck(void); | |
| 44 | + | |
| 45 | +HAL_StatusTypeDef transmit_status; | |
| 46 | +HAL_StatusTypeDef receive_status; | |
| 47 | + | |
| 48 | +uint8_t codecReady = 0; | |
| 49 | + | |
| 50 | +uint16_t frameCounter = 0; | |
| 51 | + | |
| 52 | +tMempool smallPool; | |
| 53 | +tMempool largePool; | |
| 54 | + | |
| 55 | +tRamp adc[6]; | |
| 56 | + | |
| 57 | +tNoise myNoise; | |
| 58 | +tCycle mySine[2]; | |
| 59 | +float smoothedADC[6]; | |
| 60 | +tEnvelopeFollower LED_envelope[4]; | |
| 61 | + | |
| 62 | +uint32_t clipCounter[4] = {0,0,0,0}; | |
| 63 | +uint8_t clipped[4] = {0,0,0,0}; | |
| 64 | + | |
| 65 | + | |
| 66 | +float rightIn = 0.0f; | |
| 67 | +float rightOut = 0.0f; | |
| 68 | +float sample = 0.0f; | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | +// Vocoder | |
| 73 | +float glideTimeVoc = 5.0f; | |
| 74 | + | |
| 75 | +// Formant | |
| 76 | +float formantShiftFactor = -1.0f; | |
| 77 | +float formantKnob = 0.0f; | |
| 78 | + | |
| 79 | +// PitchShift | |
| 80 | +float pitchFactor = 2.0f; | |
| 81 | +float formantWarp = 1.0f; | |
| 82 | +float formantIntensity = 1.0f; | |
| 83 | + | |
| 84 | +// Autotune1 | |
| 85 | + | |
| 86 | +// Autotune2 | |
| 87 | +float glideTimeAuto = 5.0f; | |
| 88 | + | |
| 89 | +// Sampler Button Press | |
| 90 | + | |
| 91 | + | |
| 92 | +// Sampler Auto Grab | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | +BOOL frameCompleted = TRUE; | |
| 100 | + | |
| 101 | +BOOL bufferCleared = TRUE; | |
| 102 | + | |
| 103 | +int numBuffersToClearOnLoad = 2; | |
| 104 | +int numBuffersCleared = 0; | |
| 105 | + | |
| 106 | +/**********************************************/ | |
| 107 | + | |
| 108 | +void (*allocFunctions[PresetNil])(void); | |
| 109 | +void (*frameFunctions[PresetNil])(void); | |
| 110 | +void (*tickFunctions[PresetNil])(float); | |
| 111 | +void (*freeFunctions[PresetNil])(void); | |
| 112 | + | |
| 113 | +void audioInit(I2C_HandleTypeDef* hi2c, SAI_HandleTypeDef* hsaiOut, SAI_HandleTypeDef* hsaiIn) | |
| 114 | +{ | |
| 115 | + // Initialize LEAF. | |
| 116 | + | |
| 117 | + LEAF_init(SAMPLE_RATE, AUDIO_FRAME_SIZE, medium_memory, MED_MEM_SIZE, &randomNumber); | |
| 118 | + | |
| 119 | + tMempool_init (&smallPool, small_memory, SMALL_MEM_SIZE); | |
| 120 | + tMempool_init (&largePool, large_memory, LARGE_MEM_SIZE); | |
| 121 | + | |
| 122 | + initFunctionPointers(); | |
| 123 | + | |
| 124 | + //ramps to smooth the knobs | |
| 125 | + for (int i = 0; i < 6; i++) | |
| 126 | + { | |
| 127 | + tRamp_init(&adc[i],19.0f, 1); //set all ramps for knobs to be 9ms ramp time and let the init function know they will be ticked every sample | |
| 128 | + } | |
| 129 | + | |
| 130 | + for (int i = 0; i < 4; i++) | |
| 131 | + { | |
| 132 | + tEnvelopeFollower_init(&LED_envelope[i], 0.02f, .9995f); | |
| 133 | + } | |
| 134 | + | |
| 135 | + initGlobalSFXObjects(); | |
| 136 | + | |
| 137 | +// allocFunctions[currentPreset](); | |
| 138 | + | |
| 139 | + loadingPreset = 1; | |
| 140 | + previousPreset = PresetNil; | |
| 141 | + | |
| 142 | + HAL_Delay(10); | |
| 143 | + | |
| 144 | + for (int i = 0; i < AUDIO_BUFFER_SIZE; i++) | |
| 145 | + { | |
| 146 | + audioOutBuffer[i] = 0; | |
| 147 | + } | |
| 148 | + | |
| 149 | + HAL_Delay(1); | |
| 150 | + | |
| 151 | + // set up the I2S driver to send audio data to the codec (and retrieve input as well) | |
| 152 | + transmit_status = HAL_SAI_Transmit_DMA(hsaiOut, (uint8_t *)&audioOutBuffer[0], AUDIO_BUFFER_SIZE); | |
| 153 | + receive_status = HAL_SAI_Receive_DMA(hsaiIn, (uint8_t *)&audioInBuffer[0], AUDIO_BUFFER_SIZE); | |
| 154 | + | |
| 155 | + // with the CS4271 codec IC, the SAI Transmit and Receive must be happening before the chip will respond to | |
| 156 | + // I2C setup messages (it seems to use the masterclock input as it's own internal clock for i2c data, etc) | |
| 157 | + // so while we used to set up codec before starting SAI, now we need to set up codec afterwards, and set a flag to make sure it's ready | |
| 158 | + | |
| 159 | + //now to send all the necessary messages to the codec | |
| 160 | + AudioCodec_init(hi2c); | |
| 161 | + HAL_Delay(1); | |
| 162 | + | |
| 163 | + //now reconfigue so buttons C and E can be used (they were also connected to I2C for codec setup) | |
| 164 | + HAL_I2C_MspDeInit(hi2c); | |
| 165 | + | |
| 166 | + GPIO_InitTypeDef GPIO_InitStruct = {0}; | |
| 167 | + | |
| 168 | + //PB10, PB11 ------> buttons C and E | |
| 169 | + GPIO_InitStruct.Pin = GPIO_PIN_10|GPIO_PIN_11; | |
| 170 | + GPIO_InitStruct.Mode = GPIO_MODE_INPUT; | |
| 171 | + GPIO_InitStruct.Pull = GPIO_PULLUP; | |
| 172 | + HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); | |
| 173 | +} | |
| 174 | + | |
| 175 | +void audioFrame(uint16_t buffer_offset) | |
| 176 | +{ | |
| 177 | + frameCompleted = FALSE; | |
| 178 | + | |
| 179 | + int i; | |
| 180 | + int32_t current_sample; | |
| 181 | + | |
| 182 | + buttonCheck(); | |
| 183 | + adcCheck(); | |
| 184 | + | |
| 185 | + if (!loadingPreset) | |
| 186 | + { | |
| 187 | + frameFunctions[currentPreset](); | |
| 188 | + } | |
| 189 | + | |
| 190 | + //if the codec isn't ready, keep the buffer as all zeros | |
| 191 | + //otherwise, start computing audio! | |
| 192 | + | |
| 193 | + bufferCleared = TRUE; | |
| 194 | + | |
| 195 | + if (codecReady) | |
| 196 | + { | |
| 197 | + for (i = 0; i < (HALF_BUFFER_SIZE); i++) | |
| 198 | + { | |
| 199 | + if ((i & 1) == 0) | |
| 200 | + { | |
| 201 | + current_sample = (int32_t)(audioTickR((float) (audioInBuffer[buffer_offset + i] << 8) * INV_TWO_TO_31) * TWO_TO_23); | |
| 202 | + } | |
| 203 | + else | |
| 204 | + { | |
| 205 | + current_sample = (int32_t)(audioTickL((float) (audioInBuffer[buffer_offset + i] << 8) * INV_TWO_TO_31) * TWO_TO_23); | |
| 206 | + } | |
| 207 | + | |
| 208 | + audioOutBuffer[buffer_offset + i] = current_sample; | |
| 209 | + } | |
| 210 | + | |
| 211 | + } | |
| 212 | + | |
| 213 | + if (bufferCleared) | |
| 214 | + { | |
| 215 | + numBuffersCleared++; | |
| 216 | + if (numBuffersCleared >= numBuffersToClearOnLoad) | |
| 217 | + { | |
| 218 | + numBuffersCleared = numBuffersToClearOnLoad; | |
| 219 | + if (loadingPreset) | |
| 220 | + { | |
| 221 | + if (previousPreset != PresetNil) | |
| 222 | + { | |
| 223 | + // do this if you want to save knob values when changing off a preset | |
| 224 | +// for (int i = 0; i < NUM_ADC_CHANNELS; i++) | |
| 225 | +// { | |
| 226 | +// presetKnobValues[previousPreset][i] = smoothedADC[i]; | |
| 227 | +// } | |
| 228 | + freeFunctions[previousPreset](); | |
| 229 | + } | |
| 230 | + else | |
| 231 | + { | |
| 232 | + leaf.clearOnAllocation = 1; | |
| 233 | + } | |
| 234 | + setLED_A(0); | |
| 235 | + setLED_B(0); | |
| 236 | + setLED_1(0); | |
| 237 | + allocFunctions[currentPreset](); | |
| 238 | + for (int i = 0; i < NUM_ADC_CHANNELS; i++) | |
| 239 | + { | |
| 240 | + knobActive[i] = 0; | |
| 241 | + floatADCUI[i] = -1.0f; | |
| 242 | + tRamp_setVal(&adc[i], presetKnobValues[currentPreset][i]); | |
| 243 | + tRamp_setDest(&adc[i], presetKnobValues[currentPreset][i]); | |
| 244 | + smoothedADC[i] = presetKnobValues[currentPreset][i]; | |
| 245 | + } | |
| 246 | + leaf.clearOnAllocation = 0; | |
| 247 | + loadingPreset = 0; | |
| 248 | + } | |
| 249 | + } | |
| 250 | + } | |
| 251 | + else numBuffersCleared = 0; | |
| 252 | + | |
| 253 | + frameCompleted = TRUE; | |
| 254 | + | |
| 255 | + OLED_process(); // process what to write to the screen but don't actually draw | |
| 256 | +} | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | +float audioTickL(float audioIn) | |
| 262 | +{ | |
| 263 | + sample = 0.0f; | |
| 264 | + | |
| 265 | + for (int i = 0; i < NUM_ADC_CHANNELS; i++) | |
| 266 | + { | |
| 267 | + smoothedADC[i] = tRamp_tick(&adc[i]); | |
| 268 | + } | |
| 269 | + | |
| 270 | + if (loadingPreset) return sample; | |
| 271 | + | |
| 272 | + bufferCleared = FALSE; | |
| 273 | + | |
| 274 | + tickFunctions[currentPreset](audioIn); | |
| 275 | +/* | |
| 276 | + displayBlockVal += fabsf(sample); | |
| 277 | + displayBlockCount++; | |
| 278 | + if (displayBlockCount >= DISPLAY_BLOCK_SIZE) | |
| 279 | + { | |
| 280 | + displayBlockVal *= INV_TWO_TO_9; | |
| 281 | + audioDisplayBuffer[displayBufferIndex] = displayBlockVal; | |
| 282 | + displayBlockVal = 0.0f; | |
| 283 | + displayBlockCount = 0; | |
| 284 | + displayBufferIndex++; | |
| 285 | + if (displayBufferIndex >= 128) displayBufferIndex = 0; | |
| 286 | + } | |
| 287 | + */ | |
| 288 | + | |
| 289 | + if ((audioIn >= 0.999999f) || (audioIn <= -0.999999f)) | |
| 290 | + { | |
| 291 | + setLED_leftin_clip(1); | |
| 292 | + clipCounter[0] = 10000; | |
| 293 | + clipped[0] = 1; | |
| 294 | + } | |
| 295 | + if ((clipCounter[0] > 0) && (clipped[0] == 1)) | |
| 296 | + { | |
| 297 | + clipCounter[0]--; | |
| 298 | + } | |
| 299 | + else if ((clipCounter[0] == 0) && (clipped[0] == 1)) | |
| 300 | + { | |
| 301 | + setLED_leftin_clip(0); | |
| 302 | + clipped[0] = 0; | |
| 303 | + } | |
| 304 | + | |
| 305 | + float current_env = tEnvelopeFollower_tick(&LED_envelope[0], audioIn); | |
| 306 | + uint16_t audioLEDLevel = LEAF_clip(0, (current_env * 32.0f), 16); | |
| 307 | + __HAL_TIM_SET_COMPARE(&htim3, TIM_CHANNEL_2, audioLEDLevel); | |
| 308 | + | |
| 309 | + | |
| 310 | + current_env = tEnvelopeFollower_tick(&LED_envelope[1], sample); | |
| 311 | + audioLEDLevel = LEAF_clip(0, (current_env * 32.0f), 15); | |
| 312 | + __HAL_TIM_SET_COMPARE(&htim4, TIM_CHANNEL_3, audioLEDLevel); | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + if ((sample >= 0.999999f) || (sample <= -0.999999f)) | |
| 317 | + { | |
| 318 | + setLED_leftout_clip(1); | |
| 319 | + clipCounter[2] = 10000; | |
| 320 | + clipped[2] = 1; | |
| 321 | + } | |
| 322 | + if ((clipCounter[2] > 0) && (clipped[2] == 1)) | |
| 323 | + { | |
| 324 | + clipCounter[2]--; | |
| 325 | + } | |
| 326 | + else if ((clipCounter[2] == 0) && (clipped[2] == 1)) | |
| 327 | + { | |
| 328 | + setLED_leftout_clip(0); | |
| 329 | + clipped[2] = 0; | |
| 330 | + } | |
| 331 | + | |
| 332 | + return sample; | |
| 333 | +} | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | +float audioTickR(float audioIn) | |
| 338 | +{ | |
| 339 | + rightIn = audioIn; | |
| 340 | + | |
| 341 | + | |
| 342 | + if ((rightIn >= 0.999999f) || (rightIn <= -0.999999f)) | |
| 343 | + { | |
| 344 | + setLED_rightin_clip(1); | |
| 345 | + clipCounter[1] = 10000; | |
| 346 | + clipped[1] = 1; | |
| 347 | + } | |
| 348 | + if ((clipCounter[1] > 0) && (clipped[1] == 1)) | |
| 349 | + { | |
| 350 | + clipCounter[1]--; | |
| 351 | + } | |
| 352 | + else if ((clipCounter[1] == 0) && (clipped[1] == 1)) | |
| 353 | + { | |
| 354 | + setLED_rightin_clip(0); | |
| 355 | + clipped[1] = 0; | |
| 356 | + } | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + if ((rightOut >= 0.999999f) || (rightOut <= -0.999999f)) | |
| 361 | + { | |
| 362 | + setLED_rightout_clip(1); | |
| 363 | + clipCounter[3] = 10000; | |
| 364 | + clipped[3] = 1; | |
| 365 | + } | |
| 366 | + if ((clipCounter[3] > 0) && (clipped[3] == 1)) | |
| 367 | + { | |
| 368 | + clipCounter[3]--; | |
| 369 | + } | |
| 370 | + else if ((clipCounter[3] == 0) && (clipped[3] == 1)) | |
| 371 | + { | |
| 372 | + setLED_rightout_clip(0); | |
| 373 | + clipped[3] = 0; | |
| 374 | + } | |
| 375 | + | |
| 376 | + | |
| 377 | + float current_env = tEnvelopeFollower_tick(&LED_envelope[2], rightIn); | |
| 378 | + uint16_t audioLEDLevel = LEAF_clip(0, (current_env * 32.0f), 16); | |
| 379 | + __HAL_TIM_SET_COMPARE(&htim4, TIM_CHANNEL_2, audioLEDLevel); | |
| 380 | + | |
| 381 | + | |
| 382 | + current_env = tEnvelopeFollower_tick(&LED_envelope[3], rightOut); | |
| 383 | + audioLEDLevel = LEAF_clip(0, (current_env * 32.0f), 16); | |
| 384 | + __HAL_TIM_SET_COMPARE(&htim4, TIM_CHANNEL_1, audioLEDLevel); | |
| 385 | + | |
| 386 | + | |
| 387 | + return rightOut; | |
| 388 | +} | |
| 389 | + | |
| 390 | +void initFunctionPointers(void) | |
| 391 | +{ | |
| 392 | + allocFunctions[Vocoder] = SFXVocoderAlloc; | |
| 393 | + frameFunctions[Vocoder] = SFXVocoderFrame; | |
| 394 | + tickFunctions[Vocoder] = SFXVocoderTick; | |
| 395 | + freeFunctions[Vocoder] = SFXVocoderFree; | |
| 396 | + | |
| 397 | + allocFunctions[Pitchshift] = SFXPitchShiftAlloc; | |
| 398 | + frameFunctions[Pitchshift] = SFXPitchShiftFrame; | |
| 399 | + tickFunctions[Pitchshift] = SFXPitchShiftTick; | |
| 400 | + freeFunctions[Pitchshift] = SFXPitchShiftFree; | |
| 401 | + | |
| 402 | + allocFunctions[AutotuneMono] = SFXNeartuneAlloc; | |
| 403 | + frameFunctions[AutotuneMono] = SFXNeartuneFrame; | |
| 404 | + tickFunctions[AutotuneMono] = SFXNeartuneTick; | |
| 405 | + freeFunctions[AutotuneMono] = SFXNeartuneFree; | |
| 406 | + | |
| 407 | + allocFunctions[AutotunePoly] = SFXAutotuneAlloc; | |
| 408 | + frameFunctions[AutotunePoly] = SFXAutotuneFrame; | |
| 409 | + tickFunctions[AutotunePoly] = SFXAutotuneTick; | |
| 410 | + freeFunctions[AutotunePoly] = SFXAutotuneFree; | |
| 411 | + | |
| 412 | + allocFunctions[SamplerButtonPress] = SFXSamplerBPAlloc; | |
| 413 | + frameFunctions[SamplerButtonPress] = SFXSamplerBPFrame; | |
| 414 | + tickFunctions[SamplerButtonPress] = SFXSamplerBPTick; | |
| 415 | + freeFunctions[SamplerButtonPress] = SFXSamplerBPFree; | |
| 416 | + | |
| 417 | + allocFunctions[SamplerAutoGrab] = SFXSamplerAutoAlloc; | |
| 418 | + frameFunctions[SamplerAutoGrab] = SFXSamplerAutoFrame; | |
| 419 | + tickFunctions[SamplerAutoGrab] = SFXSamplerAutoTick; | |
| 420 | + freeFunctions[SamplerAutoGrab] = SFXSamplerAutoFree; | |
| 421 | + | |
| 422 | + allocFunctions[Distortion] = SFXDistortionAlloc; | |
| 423 | + frameFunctions[Distortion] = SFXDistortionFrame; | |
| 424 | + tickFunctions[Distortion] = SFXDistortionTick; | |
| 425 | + freeFunctions[Distortion] = SFXDistortionFree; | |
| 426 | + | |
| 427 | + allocFunctions[Wavefolder] = SFXWaveFolderAlloc; | |
| 428 | + frameFunctions[Wavefolder] = SFXWaveFolderFrame; | |
| 429 | + tickFunctions[Wavefolder] = SFXWaveFolderTick; | |
| 430 | + freeFunctions[Wavefolder] = SFXWaveFolderFree; | |
| 431 | + | |
| 432 | + allocFunctions[BitCrusher] = SFXBitcrusherAlloc; | |
| 433 | + frameFunctions[BitCrusher] = SFXBitcrusherFrame; | |
| 434 | + tickFunctions[BitCrusher] = SFXBitcrusherTick; | |
| 435 | + freeFunctions[BitCrusher] = SFXBitcrusherFree; | |
| 436 | + | |
| 437 | + allocFunctions[Delay] = SFXDelayAlloc; | |
| 438 | + frameFunctions[Delay] = SFXDelayFrame; | |
| 439 | + tickFunctions[Delay] = SFXDelayTick; | |
| 440 | + freeFunctions[Delay] = SFXDelayFree; | |
| 441 | + | |
| 442 | + allocFunctions[Reverb] = SFXReverbAlloc; | |
| 443 | + frameFunctions[Reverb] = SFXReverbFrame; | |
| 444 | + tickFunctions[Reverb] = SFXReverbTick; | |
| 445 | + freeFunctions[Reverb] = SFXReverbFree; | |
| 446 | + | |
| 447 | + allocFunctions[Reverb2] = SFXReverb2Alloc; | |
| 448 | + frameFunctions[Reverb2] = SFXReverb2Frame; | |
| 449 | + tickFunctions[Reverb2] = SFXReverb2Tick; | |
| 450 | + freeFunctions[Reverb2] = SFXReverb2Free; | |
| 451 | + | |
| 452 | + allocFunctions[LivingString] = SFXLivingStringAlloc; | |
| 453 | + frameFunctions[LivingString] = SFXLivingStringFrame; | |
| 454 | + tickFunctions[LivingString] = SFXLivingStringTick; | |
| 455 | + freeFunctions[LivingString] = SFXLivingStringFree; | |
| 456 | + | |
| 457 | + allocFunctions[LivingStringSynth] = SFXLivingStringSynthAlloc; | |
| 458 | + frameFunctions[LivingStringSynth] = SFXLivingStringSynthFrame; | |
| 459 | + tickFunctions[LivingStringSynth] = SFXLivingStringSynthTick; | |
| 460 | + freeFunctions[LivingStringSynth] = SFXLivingStringSynthFree; | |
| 461 | + | |
| 462 | + allocFunctions[ClassicSynth] = SFXClassicSynthAlloc; | |
| 463 | + frameFunctions[ClassicSynth] = SFXClassicSynthFrame; | |
| 464 | + tickFunctions[ClassicSynth] = SFXClassicSynthTick; | |
| 465 | + freeFunctions[ClassicSynth] = SFXClassicSynthFree; | |
| 466 | + | |
| 467 | + allocFunctions[Rhodes] = SFXRhodesAlloc; | |
| 468 | + frameFunctions[Rhodes] = SFXRhodesFrame; | |
| 469 | + tickFunctions[Rhodes] = SFXRhodesTick; | |
| 470 | + freeFunctions[Rhodes] = SFXRhodesFree; | |
| 471 | +} | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | +void HAL_SAI_ErrorCallback(SAI_HandleTypeDef *hsai) | |
| 476 | +{ | |
| 477 | + if (!frameCompleted) | |
| 478 | + { | |
| 479 | + setLED_C(1); | |
| 480 | + } | |
| 481 | +} | |
| 482 | + | |
| 483 | +void HAL_SAI_TxCpltCallback(SAI_HandleTypeDef *hsai) | |
| 484 | +{ | |
| 485 | + if (!frameCompleted) | |
| 486 | + { | |
| 487 | + setLED_C(1); | |
| 488 | + } | |
| 489 | +} | |
| 490 | + | |
| 491 | +void HAL_SAI_TxHalfCpltCallback(SAI_HandleTypeDef *hsai) | |
| 492 | +{ | |
| 493 | + if (!frameCompleted) | |
| 494 | + { | |
| 495 | + setLED_C(1); | |
| 496 | + } | |
| 497 | +} | |
| 498 | + | |
| 499 | + | |
| 500 | +void HAL_SAI_RxCpltCallback(SAI_HandleTypeDef *hsai) | |
| 501 | +{ | |
| 502 | + if (!frameCompleted) | |
| 503 | + { | |
| 504 | + setLED_C(1); | |
| 505 | + } | |
| 506 | + | |
| 507 | + audioFrame(HALF_BUFFER_SIZE); | |
| 508 | +} | |
| 509 | + | |
| 510 | +void HAL_SAI_RxHalfCpltCallback(SAI_HandleTypeDef *hsai) | |
| 511 | +{ | |
| 512 | + if (!frameCompleted) | |
| 513 | + { | |
| 514 | + setLED_C(1); | |
| 515 | + } | |
| 516 | + | |
| 517 | + audioFrame(0); | |
| 518 | +} | |
| @@ -0,0 +1,66 @@ | ||
| 1 | +/** | |
| 2 | + ****************************************************************************** | |
| 3 | + * File Name : dma.c | |
| 4 | + * Description : This file provides code for the configuration | |
| 5 | + * of all the requested memory to memory DMA transfers. | |
| 6 | + ****************************************************************************** | |
| 7 | + * @attention | |
| 8 | + * | |
| 9 | + * <h2><center>© Copyright (c) 2020 STMicroelectronics. | |
| 10 | + * All rights reserved.</center></h2> | |
| 11 | + * | |
| 12 | + * This software component is licensed by ST under Ultimate Liberty license | |
| 13 | + * SLA0044, the "License"; You may not use this file except in compliance with | |
| 14 | + * the License. You may obtain a copy of the License at: | |
| 15 | + * www.st.com/SLA0044 | |
| 16 | + * | |
| 17 | + ****************************************************************************** | |
| 18 | + */ | |
| 19 | + | |
| 20 | +/* Includes ------------------------------------------------------------------*/ | |
| 21 | +#include "bdma.h" | |
| 22 | + | |
| 23 | +/* USER CODE BEGIN 0 */ | |
| 24 | + | |
| 25 | +/* USER CODE END 0 */ | |
| 26 | + | |
| 27 | +/*----------------------------------------------------------------------------*/ | |
| 28 | +/* Configure DMA */ | |
| 29 | +/*----------------------------------------------------------------------------*/ | |
| 30 | + | |
| 31 | +/* USER CODE BEGIN 1 */ | |
| 32 | + | |
| 33 | +/* USER CODE END 1 */ | |
| 34 | + | |
| 35 | +/** | |
| 36 | + * Enable DMA controller clock | |
| 37 | + */ | |
| 38 | +void MX_BDMA_Init(void) | |
| 39 | +{ | |
| 40 | + | |
| 41 | + /* DMA controller clock enable */ | |
| 42 | + __HAL_RCC_BDMA_CLK_ENABLE(); | |
| 43 | + | |
| 44 | + /* DMA interrupt init */ | |
| 45 | + /* BDMA_Channel0_IRQn interrupt configuration */ | |
| 46 | + HAL_NVIC_SetPriority(BDMA_Channel0_IRQn, 0, 0); | |
| 47 | + HAL_NVIC_EnableIRQ(BDMA_Channel0_IRQn); | |
| 48 | + /* BDMA_Channel1_IRQn interrupt configuration */ | |
| 49 | + HAL_NVIC_SetPriority(BDMA_Channel1_IRQn, 0, 0); | |
| 50 | + HAL_NVIC_EnableIRQ(BDMA_Channel1_IRQn); | |
| 51 | + | |
| 52 | +} | |
| 53 | + | |
| 54 | +/* USER CODE BEGIN 2 */ | |
| 55 | + | |
| 56 | +/* USER CODE END 2 */ | |
| 57 | + | |
| 58 | +/** | |
| 59 | + * @} | |
| 60 | + */ | |
| 61 | + | |
| 62 | +/** | |
| 63 | + * @} | |
| 64 | + */ | |
| 65 | + | |
| 66 | +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |
| @@ -0,0 +1,307 @@ | ||
| 1 | +/* USER CODE BEGIN Header */ | |
| 2 | +/** | |
| 3 | + ****************************************************************************** | |
| 4 | + * @file bsp_driver_sd.c for H7 (based on stm32h743i_eval_sd.c) | |
| 5 | + * @brief This file includes a generic uSD card driver. | |
| 6 | + * To be completed by the user according to the board used for the project. | |
| 7 | + * @note Functions generated as weak: they can be overriden by | |
| 8 | + * - code in user files | |
| 9 | + * - or BSP code from the FW pack files | |
| 10 | + * if such files are added to the generated project (by the user). | |
| 11 | + ****************************************************************************** | |
| 12 | + * @attention | |
| 13 | + * | |
| 14 | + * <h2><center>© Copyright (c) 2020 STMicroelectronics. | |
| 15 | + * All rights reserved.</center></h2> | |
| 16 | + * | |
| 17 | + * This software component is licensed by ST under Ultimate Liberty license | |
| 18 | + * SLA0044, the "License"; You may not use this file except in compliance with | |
| 19 | + * the License. You may obtain a copy of the License at: | |
| 20 | + * www.st.com/SLA0044 | |
| 21 | + * | |
| 22 | + ****************************************************************************** | |
| 23 | + */ | |
| 24 | +/* USER CODE END Header */ | |
| 25 | + | |
| 26 | +/* USER CODE BEGIN FirstSection */ | |
| 27 | +/* can be used to modify / undefine following code or add new definitions */ | |
| 28 | +/* USER CODE END FirstSection */ | |
| 29 | +/* Includes ------------------------------------------------------------------*/ | |
| 30 | +#include "bsp_driver_sd.h" | |
| 31 | + | |
| 32 | +/* Extern variables ---------------------------------------------------------*/ | |
| 33 | + | |
| 34 | +extern SD_HandleTypeDef hsd1; | |
| 35 | + | |
| 36 | +/* USER CODE BEGIN BeforeInitSection */ | |
| 37 | +/* can be used to modify / undefine following code or add code */ | |
| 38 | +/* USER CODE END BeforeInitSection */ | |
| 39 | +/** | |
| 40 | + * @brief Initializes the SD card device. | |
| 41 | + * @retval SD status | |
| 42 | + */ | |
| 43 | +__weak uint8_t BSP_SD_Init(void) | |
| 44 | +{ | |
| 45 | + uint8_t sd_state = MSD_OK; | |
| 46 | + /* Check if the SD card is plugged in the slot */ | |
| 47 | + if (BSP_SD_IsDetected() != SD_PRESENT) | |
| 48 | + { | |
| 49 | + return MSD_ERROR_SD_NOT_PRESENT; | |
| 50 | + } | |
| 51 | + /* HAL SD initialization */ | |
| 52 | + sd_state = HAL_SD_Init(&hsd1); | |
| 53 | + /* Configure SD Bus width (4 bits mode selected) */ | |
| 54 | + if (sd_state == MSD_OK) | |
| 55 | + { | |
| 56 | + /* Enable wide operation */ | |
| 57 | + if (HAL_SD_ConfigWideBusOperation(&hsd1, SDMMC_BUS_WIDE_4B) != HAL_OK) | |
| 58 | + { | |
| 59 | + sd_state = MSD_ERROR; | |
| 60 | + } | |
| 61 | + } | |
| 62 | + | |
| 63 | + return sd_state; | |
| 64 | +} | |
| 65 | +/* USER CODE BEGIN AfterInitSection */ | |
| 66 | +/* can be used to modify previous code / undefine following code / add code */ | |
| 67 | +/* USER CODE END AfterInitSection */ | |
| 68 | + | |
| 69 | +/* USER CODE BEGIN InterruptMode */ | |
| 70 | +/** | |
| 71 | + * @brief Configures Interrupt mode for SD detection pin. | |
| 72 | + * @retval Returns 0 | |
| 73 | + */ | |
| 74 | +__weak uint8_t BSP_SD_ITConfig(void) | |
| 75 | +{ | |
| 76 | + /* Code to be updated by the user or replaced by one from the FW pack (in a stmxxxx_sd.c file) */ | |
| 77 | + | |
| 78 | + return (uint8_t)0; | |
| 79 | +} | |
| 80 | + | |
| 81 | +/* USER CODE END InterruptMode */ | |
| 82 | + | |
| 83 | +/* USER CODE BEGIN BeforeReadBlocksSection */ | |
| 84 | +/* can be used to modify previous code / undefine following code / add code */ | |
| 85 | +/* USER CODE END BeforeReadBlocksSection */ | |
| 86 | +/** | |
| 87 | + * @brief Reads block(s) from a specified address in an SD card, in polling mode. | |
| 88 | + * @param pData: Pointer to the buffer that will contain the data to transmit | |
| 89 | + * @param ReadAddr: Address from where data is to be read | |
| 90 | + * @param NumOfBlocks: Number of SD blocks to read | |
| 91 | + * @param Timeout: Timeout for read operation | |
| 92 | + * @retval SD status | |
| 93 | + */ | |
| 94 | +__weak uint8_t BSP_SD_ReadBlocks(uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks, uint32_t Timeout) | |
| 95 | +{ | |
| 96 | + uint8_t sd_state = MSD_OK; | |
| 97 | + | |
| 98 | + if (HAL_SD_ReadBlocks(&hsd1, (uint8_t *)pData, ReadAddr, NumOfBlocks, Timeout) != HAL_OK) | |
| 99 | + { | |
| 100 | + sd_state = MSD_ERROR; | |
| 101 | + } | |
| 102 | + | |
| 103 | + return sd_state; | |
| 104 | +} | |
| 105 | + | |
| 106 | +/* USER CODE BEGIN BeforeWriteBlocksSection */ | |
| 107 | +/* can be used to modify previous code / undefine following code / add code */ | |
| 108 | +/* USER CODE END BeforeWriteBlocksSection */ | |
| 109 | +/** | |
| 110 | + * @brief Writes block(s) to a specified address in an SD card, in polling mode. | |
| 111 | + * @param pData: Pointer to the buffer that will contain the data to transmit | |
| 112 | + * @param WriteAddr: Address from where data is to be written | |
| 113 | + * @param NumOfBlocks: Number of SD blocks to write | |
| 114 | + * @param Timeout: Timeout for write operation | |
| 115 | + * @retval SD status | |
| 116 | + */ | |
| 117 | +__weak uint8_t BSP_SD_WriteBlocks(uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks, uint32_t Timeout) | |
| 118 | +{ | |
| 119 | + uint8_t sd_state = MSD_OK; | |
| 120 | + | |
| 121 | + if (HAL_SD_WriteBlocks(&hsd1, (uint8_t *)pData, WriteAddr, NumOfBlocks, Timeout) != HAL_OK) | |
| 122 | + { | |
| 123 | + sd_state = MSD_ERROR; | |
| 124 | + } | |
| 125 | + | |
| 126 | + return sd_state; | |
| 127 | +} | |
| 128 | + | |
| 129 | +/* USER CODE BEGIN BeforeReadDMABlocksSection */ | |
| 130 | +/* can be used to modify previous code / undefine following code / add code */ | |
| 131 | +/* USER CODE END BeforeReadDMABlocksSection */ | |
| 132 | +/** | |
| 133 | + * @brief Reads block(s) from a specified address in an SD card, in DMA mode. | |
| 134 | + * @param pData: Pointer to the buffer that will contain the data to transmit | |
| 135 | + * @param ReadAddr: Address from where data is to be read | |
| 136 | + * @param NumOfBlocks: Number of SD blocks to read | |
| 137 | + * @retval SD status | |
| 138 | + */ | |
| 139 | +__weak uint8_t BSP_SD_ReadBlocks_DMA(uint32_t *pData, uint32_t ReadAddr, uint32_t NumOfBlocks) | |
| 140 | +{ | |
| 141 | + uint8_t sd_state = MSD_OK; | |
| 142 | + | |
| 143 | + /* Read block(s) in DMA transfer mode */ | |
| 144 | + if (HAL_SD_ReadBlocks_DMA(&hsd1, (uint8_t *)pData, ReadAddr, NumOfBlocks) != HAL_OK) | |
| 145 | + { | |
| 146 | + sd_state = MSD_ERROR; | |
| 147 | + } | |
| 148 | + | |
| 149 | + return sd_state; | |
| 150 | +} | |
| 151 | + | |
| 152 | +/* USER CODE BEGIN BeforeWriteDMABlocksSection */ | |
| 153 | +/* can be used to modify previous code / undefine following code / add code */ | |
| 154 | +/* USER CODE END BeforeWriteDMABlocksSection */ | |
| 155 | +/** | |
| 156 | + * @brief Writes block(s) to a specified address in an SD card, in DMA mode. | |
| 157 | + * @param pData: Pointer to the buffer that will contain the data to transmit | |
| 158 | + * @param WriteAddr: Address from where data is to be written | |
| 159 | + * @param NumOfBlocks: Number of SD blocks to write | |
| 160 | + * @retval SD status | |
| 161 | + */ | |
| 162 | +__weak uint8_t BSP_SD_WriteBlocks_DMA(uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks) | |
| 163 | +{ | |
| 164 | + uint8_t sd_state = MSD_OK; | |
| 165 | + | |
| 166 | + /* Write block(s) in DMA transfer mode */ | |
| 167 | + if (HAL_SD_WriteBlocks_DMA(&hsd1, (uint8_t *)pData, WriteAddr, NumOfBlocks) != HAL_OK) | |
| 168 | + { | |
| 169 | + sd_state = MSD_ERROR; | |
| 170 | + } | |
| 171 | + | |
| 172 | + return sd_state; | |
| 173 | +} | |
| 174 | + | |
| 175 | +/* USER CODE BEGIN BeforeEraseSection */ | |
| 176 | +/* can be used to modify previous code / undefine following code / add code */ | |
| 177 | +/* USER CODE END BeforeEraseSection */ | |
| 178 | +/** | |
| 179 | + * @brief Erases the specified memory area of the given SD card. | |
| 180 | + * @param StartAddr: Start byte address | |
| 181 | + * @param EndAddr: End byte address | |
| 182 | + * @retval SD status | |
| 183 | + */ | |
| 184 | +__weak uint8_t BSP_SD_Erase(uint32_t StartAddr, uint32_t EndAddr) | |
| 185 | +{ | |
| 186 | + uint8_t sd_state = MSD_OK; | |
| 187 | + | |
| 188 | + if (HAL_SD_Erase(&hsd1, StartAddr, EndAddr) != HAL_OK) | |
| 189 | + { | |
| 190 | + sd_state = MSD_ERROR; | |
| 191 | + } | |
| 192 | + | |
| 193 | + return sd_state; | |
| 194 | +} | |
| 195 | + | |
| 196 | +/* USER CODE BEGIN BeforeGetCardStateSection */ | |
| 197 | +/* can be used to modify previous code / undefine following code / add code */ | |
| 198 | +/* USER CODE END BeforeGetCardStateSection */ | |
| 199 | + | |
| 200 | +/** | |
| 201 | + * @brief Gets the current SD card data status. | |
| 202 | + * @param None | |
| 203 | + * @retval Data transfer state. | |
| 204 | + * This value can be one of the following values: | |
| 205 | + * @arg SD_TRANSFER_OK: No data transfer is acting | |
| 206 | + * @arg SD_TRANSFER_BUSY: Data transfer is acting | |
| 207 | + */ | |
| 208 | +__weak uint8_t BSP_SD_GetCardState(void) | |
| 209 | +{ | |
| 210 | + return ((HAL_SD_GetCardState(&hsd1) == HAL_SD_CARD_TRANSFER ) ? SD_TRANSFER_OK : SD_TRANSFER_BUSY); | |
| 211 | +} | |
| 212 | + | |
| 213 | +/** | |
| 214 | + * @brief Get SD information about specific SD card. | |
| 215 | + * @param CardInfo: Pointer to HAL_SD_CardInfoTypedef structure | |
| 216 | + * @retval None | |
| 217 | + */ | |
| 218 | +__weak void BSP_SD_GetCardInfo(HAL_SD_CardInfoTypeDef *CardInfo) | |
| 219 | +{ | |
| 220 | + /* Get SD card Information */ | |
| 221 | + HAL_SD_GetCardInfo(&hsd1, CardInfo); | |
| 222 | +} | |
| 223 | + | |
| 224 | +/* USER CODE BEGIN BeforeCallBacksSection */ | |
| 225 | +/* can be used to modify previous code / undefine following code / add code */ | |
| 226 | +/* USER CODE END BeforeCallBacksSection */ | |
| 227 | +/** | |
| 228 | + * @brief SD Abort callbacks | |
| 229 | + * @param hsd: SD handle | |
| 230 | + * @retval None | |
| 231 | + */ | |
| 232 | +__weak void HAL_SD_AbortCallback(SD_HandleTypeDef *hsd) | |
| 233 | +{ | |
| 234 | + BSP_SD_AbortCallback(); | |
| 235 | +} | |
| 236 | + | |
| 237 | +/** | |
| 238 | + * @brief Tx Transfer completed callback | |
| 239 | + * @param hsd: SD handle | |
| 240 | + * @retval None | |
| 241 | + */ | |
| 242 | +__weak void HAL_SD_TxCpltCallback(SD_HandleTypeDef *hsd) | |
| 243 | +{ | |
| 244 | + BSP_SD_WriteCpltCallback(); | |
| 245 | +} | |
| 246 | + | |
| 247 | +/** | |
| 248 | + * @brief Rx Transfer completed callback | |
| 249 | + * @param hsd: SD handle | |
| 250 | + * @retval None | |
| 251 | + */ | |
| 252 | +__weak void HAL_SD_RxCpltCallback(SD_HandleTypeDef *hsd) | |
| 253 | +{ | |
| 254 | + BSP_SD_ReadCpltCallback(); | |
| 255 | +} | |
| 256 | + | |
| 257 | +/* USER CODE BEGIN CallBacksSection_C */ | |
| 258 | +/** | |
| 259 | + * @brief BSP SD Abort callback | |
| 260 | + * @retval None | |
| 261 | + */ | |
| 262 | +__weak void BSP_SD_AbortCallback(void) | |
| 263 | +{ | |
| 264 | + | |
| 265 | +} | |
| 266 | + | |
| 267 | +/** | |
| 268 | + * @brief BSP Tx Transfer completed callback | |
| 269 | + * @retval None | |
| 270 | + */ | |
| 271 | +__weak void BSP_SD_WriteCpltCallback(void) | |
| 272 | +{ | |
| 273 | + | |
| 274 | +} | |
| 275 | + | |
| 276 | +/** | |
| 277 | + * @brief BSP Rx Transfer completed callback | |
| 278 | + * @retval None | |
| 279 | + */ | |
| 280 | +__weak void BSP_SD_ReadCpltCallback(void) | |
| 281 | +{ | |
| 282 | + | |
| 283 | +} | |
| 284 | +/* USER CODE END CallBacksSection_C */ | |
| 285 | + | |
| 286 | +/** | |
| 287 | + * @brief Detects if SD card is correctly plugged in the memory slot or not. | |
| 288 | + * @param None | |
| 289 | + * @retval Returns if SD is detected or not | |
| 290 | + */ | |
| 291 | +__weak uint8_t BSP_SD_IsDetected(void) | |
| 292 | +{ | |
| 293 | + __IO uint8_t status = SD_PRESENT; | |
| 294 | + | |
| 295 | + if (BSP_PlatformIsDetected() == 0x0) | |
| 296 | + { | |
| 297 | + status = SD_NOT_PRESENT; | |
| 298 | + } | |
| 299 | + | |
| 300 | + return status; | |
| 301 | +} | |
| 302 | + | |
| 303 | +/* USER CODE BEGIN AdditionalCode */ | |
| 304 | +/* user code can be inserted here */ | |
| 305 | +/* USER CODE END AdditionalCode */ | |
| 306 | + | |
| 307 | +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |
| @@ -0,0 +1,125 @@ | ||
| 1 | +#include "codec.h" | |
| 2 | +#include "main.h" | |
| 3 | +#include "gpio.h" | |
| 4 | +#include "audiostream.h" | |
| 5 | + | |
| 6 | +uint16_t i2cDataSize = 2; | |
| 7 | +uint8_t myI2cData[2] = {0,0}; | |
| 8 | +uint32_t I2Ctimeout = 2000; | |
| 9 | + | |
| 10 | +//Settings for CS4271 | |
| 11 | +// translated from the datasheet by JS | |
| 12 | + | |
| 13 | +// 01h mode control 1 | |
| 14 | +// | |
| 15 | +// M1 M0 ratio1 ratio0 m/s dac_dif2 dac_dif1 dac_dif0 // unsure if setting bit selects master means 1 | |
| 16 | +// for 48k == 0 1 0 0 0 0 0 1 ( ratio bit chosen as 0 0 based on assumption of 256X master clock) | |
| 17 | +// == 0x41 | |
| 18 | +// for 96k == 1 0 0 0 0 0 0 1 ( ratio bit chosen as 0 0 based on assumption of <= 256X master clock) | |
| 19 | +// == 0x81 | |
| 20 | +// for 192k == 1 1 1 0 0 0 0 1 ( ratio bit chosen as 1 0 based on assumption of 256X master clock, choose 0 0 (full word would be 0xc1 instead of 0xe1) instead if using something like 64X) | |
| 21 | +// == 0xe1 | |
| 22 | + | |
| 23 | +// 02h DAC control | |
| 24 | +// AMUTE, FILT_SEL, DEM1, DEM0, RMP_UP, RMP_DN, INV_A, INV_B | |
| 25 | +// 0 0 0 0 1 1 0 0 | |
| 26 | +// == 0x0c if you want a slow ramp up when the part turns on | |
| 27 | +// == 0x00 if you want quick start up (which may click) | |
| 28 | + | |
| 29 | +// 03h dac volume and mixing | |
| 30 | +// (NA) B=A soft zerocross ATAPI3 ATAPI2 ATAPI1 ATAPI0 (B=A makes channel volumes not independent) | |
| 31 | +// 0 1 1 1 1 0 0 1 (the last four bits set channel L to go to output A and channel R to go to output B, but this is easily changed with mixing or reversal) | |
| 32 | +// == 0x79 | |
| 33 | +//or without soft ramp for any programmed volume changes // == 0x39 | |
| 34 | + | |
| 35 | +// 04h Volume A | |
| 36 | +// MUTE vol6 vol5 vol4 vol3 vol2 vol1 vol0 | |
| 37 | +// 0 0 0 0 0 0 0 0 | |
| 38 | +// == 0x00 | |
| 39 | +//or 0x14 for -20db | |
| 40 | + | |
| 41 | +// 05h Volume B | |
| 42 | +// MUTE vol6 vol5 vol4 vol3 vol2 vol1 vol0 | |
| 43 | +// 0 0 0 0 0 0 0 0 | |
| 44 | +// == 0x00 | |
| 45 | +//or 0x14 for -20db | |
| 46 | + | |
| 47 | +// 06h ADC control | |
| 48 | +// (NA) (NA) Dither16 ADC_DIF MUTEA MUTEB HPFDisableA HPFDisableB | |
| 49 | +// 0 0 0 1 0 0 0 0 | |
| 50 | +// ==0x10 | |
| 51 | + | |
| 52 | +// 07h mode control 2 | |
| 53 | +// (NA) (NA) (NA) LOOP MUTECA=B FREEZE CPEN PDN | |
| 54 | +// for power down version == 0 0 0 0 0 0 1 1 | |
| 55 | +// == 0x03 | |
| 56 | +// to send dry ADC input into DAC (it seems this will mute the normal DAC output) == 0 0 0 1 0 0 1 0 | |
| 57 | +// == 0x12 | |
| 58 | +// for normal operation == 0 0 0 0 0 0 1 0 | |
| 59 | +// == 0x02 | |
| 60 | + | |
| 61 | +HAL_StatusTypeDef testVal; | |
| 62 | + | |
| 63 | + | |
| 64 | +volatile int blankCount = 0; | |
| 65 | +uint16_t addressCounter = 0; | |
| 66 | + | |
| 67 | + | |
| 68 | +void AudioCodec_init(I2C_HandleTypeDef* hi2c) { | |
| 69 | + | |
| 70 | + //pull codec reset pin high to start codec working | |
| 71 | + HAL_GPIO_WritePin(GPIOC, GPIO_PIN_14, GPIO_PIN_SET); | |
| 72 | + | |
| 73 | + HAL_Delay(2); | |
| 74 | + //enable control port and put part in power-down mode while loading registers | |
| 75 | + myI2cData[0] = 0x07; | |
| 76 | + myI2cData[1] = 0x03; | |
| 77 | + testVal = HAL_I2C_Master_Transmit(hi2c, CODEC_I2C_ADDRESS, myI2cData, i2cDataSize, I2Ctimeout); | |
| 78 | + //HAL_Delay(2); | |
| 79 | + | |
| 80 | + myI2cData[0] = 0x01; | |
| 81 | + myI2cData[1] = 0x41; | |
| 82 | + testVal = HAL_I2C_Master_Transmit(hi2c, CODEC_I2C_ADDRESS, myI2cData, i2cDataSize, I2Ctimeout); | |
| 83 | + | |
| 84 | + //HAL_Delay(1); // might not be necessary | |
| 85 | + | |
| 86 | + myI2cData[0] = 0x02; | |
| 87 | + myI2cData[1] = 0x00; | |
| 88 | + testVal = HAL_I2C_Master_Transmit(hi2c, CODEC_I2C_ADDRESS, myI2cData, i2cDataSize, I2Ctimeout); | |
| 89 | + | |
| 90 | + //HAL_Delay(1); // might not be necessary | |
| 91 | + | |
| 92 | + myI2cData[0] = 0x03; | |
| 93 | + myI2cData[1] = 0x79; | |
| 94 | + testVal = HAL_I2C_Master_Transmit(hi2c, CODEC_I2C_ADDRESS, myI2cData, i2cDataSize, I2Ctimeout); | |
| 95 | + | |
| 96 | + //HAL_Delay(1); // might not be necessary | |
| 97 | + | |
| 98 | + myI2cData[0] = 0x04; | |
| 99 | + myI2cData[1] = 0x01; | |
| 100 | + testVal = HAL_I2C_Master_Transmit(hi2c, CODEC_I2C_ADDRESS, myI2cData, i2cDataSize, I2Ctimeout); | |
| 101 | + | |
| 102 | + //HAL_Delay(1); // might not be necessary | |
| 103 | + | |
| 104 | + myI2cData[0] = 0x05; | |
| 105 | + myI2cData[1] = 0x01; | |
| 106 | + testVal = HAL_I2C_Master_Transmit(hi2c, CODEC_I2C_ADDRESS, myI2cData, i2cDataSize, I2Ctimeout); | |
| 107 | + | |
| 108 | + //HAL_Delay(1); // might not be necessary | |
| 109 | + | |
| 110 | + myI2cData[0] = 0x06; | |
| 111 | + myI2cData[1] = 0x10; | |
| 112 | + testVal = HAL_I2C_Master_Transmit(hi2c, CODEC_I2C_ADDRESS, myI2cData, i2cDataSize, I2Ctimeout); | |
| 113 | + | |
| 114 | + //HAL_Delay(1); // might not be necessary | |
| 115 | + | |
| 116 | + //turn off power down bit to start things cookin' | |
| 117 | + myI2cData[0] = 0x07; | |
| 118 | + myI2cData[1] = 0x02; | |
| 119 | + HAL_I2C_Master_Transmit(hi2c, CODEC_I2C_ADDRESS, myI2cData, i2cDataSize, I2Ctimeout); | |
| 120 | + | |
| 121 | + | |
| 122 | + //HAL_Delay(1); // might not be necessary | |
| 123 | + codecReady = 1; | |
| 124 | + | |
| 125 | +} | |
| @@ -0,0 +1,37 @@ | ||
| 1 | +/** | |
| 2 | + ****************************************************************************** | |
| 3 | + * File Name : DEBUG.c | |
| 4 | + * Description : This file provides code for the configuration | |
| 5 | + * of the DEBUG instances. | |
| 6 | + ****************************************************************************** | |
| 7 | + * @attention | |
| 8 | + * | |
| 9 | + * <h2><center>© Copyright (c) 2020 STMicroelectronics. | |
| 10 | + * All rights reserved.</center></h2> | |
| 11 | + * | |
| 12 | + * This software component is licensed by ST under Ultimate Liberty license | |
| 13 | + * SLA0044, the "License"; You may not use this file except in compliance with | |
| 14 | + * the License. You may obtain a copy of the License at: | |
| 15 | + * www.st.com/SLA0044 | |
| 16 | + * | |
| 17 | + ****************************************************************************** | |
| 18 | + */ | |
| 19 | + | |
| 20 | +/* Includes ------------------------------------------------------------------*/ | |
| 21 | +#include "debug.h" | |
| 22 | + | |
| 23 | +/* USER CODE BEGIN 0 */ | |
| 24 | + | |
| 25 | +/* USER CODE END 0 */ | |
| 26 | + | |
| 27 | +/* DEBUG init function */ | |
| 28 | +void MX_DEBUG_Init(void) | |
| 29 | +{ | |
| 30 | + | |
| 31 | +} | |
| 32 | + | |
| 33 | +/* USER CODE BEGIN 1 */ | |
| 34 | + | |
| 35 | +/* USER CODE END 1 */ | |
| 36 | + | |
| 37 | +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |
| @@ -0,0 +1,72 @@ | ||
| 1 | +/** | |
| 2 | + ****************************************************************************** | |
| 3 | + * File Name : dma.c | |
| 4 | + * Description : This file provides code for the configuration | |
| 5 | + * of all the requested memory to memory DMA transfers. | |
| 6 | + ****************************************************************************** | |
| 7 | + * @attention | |
| 8 | + * | |
| 9 | + * <h2><center>© Copyright (c) 2020 STMicroelectronics. | |
| 10 | + * All rights reserved.</center></h2> | |
| 11 | + * | |
| 12 | + * This software component is licensed by ST under Ultimate Liberty license | |
| 13 | + * SLA0044, the "License"; You may not use this file except in compliance with | |
| 14 | + * the License. You may obtain a copy of the License at: | |
| 15 | + * www.st.com/SLA0044 | |
| 16 | + * | |
| 17 | + ****************************************************************************** | |
| 18 | + */ | |
| 19 | + | |
| 20 | +/* Includes ------------------------------------------------------------------*/ | |
| 21 | +#include "dma.h" | |
| 22 | + | |
| 23 | +/* USER CODE BEGIN 0 */ | |
| 24 | + | |
| 25 | +/* USER CODE END 0 */ | |
| 26 | + | |
| 27 | +/*----------------------------------------------------------------------------*/ | |
| 28 | +/* Configure DMA */ | |
| 29 | +/*----------------------------------------------------------------------------*/ | |
| 30 | + | |
| 31 | +/* USER CODE BEGIN 1 */ | |
| 32 | + | |
| 33 | +/* USER CODE END 1 */ | |
| 34 | + | |
| 35 | +/** | |
| 36 | + * Enable DMA controller clock | |
| 37 | + */ | |
| 38 | +void MX_DMA_Init(void) | |
| 39 | +{ | |
| 40 | + | |
| 41 | + /* DMA controller clock enable */ | |
| 42 | + __HAL_RCC_DMA1_CLK_ENABLE(); | |
| 43 | + | |
| 44 | + /* DMA interrupt init */ | |
| 45 | + /* DMA1_Stream0_IRQn interrupt configuration */ | |
| 46 | + HAL_NVIC_SetPriority(DMA1_Stream0_IRQn, 5, 0); | |
| 47 | + HAL_NVIC_EnableIRQ(DMA1_Stream0_IRQn); | |
| 48 | + /* DMA1_Stream1_IRQn interrupt configuration */ | |
| 49 | + HAL_NVIC_SetPriority(DMA1_Stream1_IRQn, 2, 0); | |
| 50 | + HAL_NVIC_EnableIRQ(DMA1_Stream1_IRQn); | |
| 51 | + /* DMA1_Stream2_IRQn interrupt configuration */ | |
| 52 | + HAL_NVIC_SetPriority(DMA1_Stream2_IRQn, 2, 0); | |
| 53 | + HAL_NVIC_EnableIRQ(DMA1_Stream2_IRQn); | |
| 54 | + /* DMAMUX1_OVR_IRQn interrupt configuration */ | |
| 55 | + HAL_NVIC_SetPriority(DMAMUX1_OVR_IRQn, 0, 0); | |
| 56 | + HAL_NVIC_EnableIRQ(DMAMUX1_OVR_IRQn); | |
| 57 | + | |
| 58 | +} | |
| 59 | + | |
| 60 | +/* USER CODE BEGIN 2 */ | |
| 61 | + | |
| 62 | +/* USER CODE END 2 */ | |
| 63 | + | |
| 64 | +/** | |
| 65 | + * @} | |
| 66 | + */ | |
| 67 | + | |
| 68 | +/** | |
| 69 | + * @} | |
| 70 | + */ | |
| 71 | + | |
| 72 | +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |
| @@ -0,0 +1,718 @@ | ||
| 1 | + | |
| 2 | + | |
| 3 | +/** @addtogroup EEPROM_Emulation | |
| 4 | + * @{ | |
| 5 | + */ | |
| 6 | + | |
| 7 | +/* Includes ------------------------------------------------------------------*/ | |
| 8 | +#include "eeprom.h" | |
| 9 | + | |
| 10 | +/* Private typedef -----------------------------------------------------------*/ | |
| 11 | +/* Private define ------------------------------------------------------------*/ | |
| 12 | +/* Private macro -------------------------------------------------------------*/ | |
| 13 | +/* Private variables ---------------------------------------------------------*/ | |
| 14 | + | |
| 15 | +/* Global variable used to store variable value in read sequence */ | |
| 16 | +uint16_t DataVar = 0; | |
| 17 | + | |
| 18 | +/* Virtual address defined by the user: 0xFFFF value is prohibited */ | |
| 19 | + | |
| 20 | +uint16_t VirtAddVarTab[NB_OF_VAR] = {0x5555, 0x6666, 0x7777}; | |
| 21 | +uint32_t Address = 0; | |
| 22 | +/* Private function prototypes -----------------------------------------------*/ | |
| 23 | +/* Private functions ---------------------------------------------------------*/ | |
| 24 | +static HAL_StatusTypeDef EE_Format(void); | |
| 25 | +static uint16_t EE_FindValidPage(uint8_t Operation); | |
| 26 | +static uint16_t EE_VerifyPageFullWriteVariable(uint16_t VirtAddress, uint16_t Data); | |
| 27 | +static uint16_t EE_PageTransfer(uint16_t VirtAddress, uint16_t Data); | |
| 28 | +static uint16_t EE_VerifyPageFullyErased(uint32_t Address); | |
| 29 | + | |
| 30 | +/** | |
| 31 | + * @brief Restore the pages to a known good state in case of page's status | |
| 32 | + * corruption after a power loss. | |
| 33 | + * @param None. | |
| 34 | + * @retval - Flash error code: on write Flash error | |
| 35 | + * - FLASH_COMPLETE: on success | |
| 36 | + */ | |
| 37 | + | |
| 38 | +uint16_t EE_Init(void) | |
| 39 | +{ | |
| 40 | + uint16_t PageStatus0 = 6, PageStatus1 = 6; | |
| 41 | + uint16_t VarIdx = 0; | |
| 42 | + uint16_t EepromStatus = 0, ReadStatus = 0; | |
| 43 | + int16_t x = -1; | |
| 44 | + HAL_StatusTypeDef FlashStatus; | |
| 45 | + uint32_t SectorError = 0; | |
| 46 | + FLASH_EraseInitTypeDef pEraseInit; | |
| 47 | + uint32_t valid[8] = {0x0000}; | |
| 48 | + | |
| 49 | + /* Get Page0 status */ | |
| 50 | + PageStatus0 = (*(__IO uint16_t*)PAGE0_BASE_ADDRESS); | |
| 51 | + /* Get Page1 status */ | |
| 52 | + PageStatus1 = (*(__IO uint16_t*)PAGE1_BASE_ADDRESS); | |
| 53 | + | |
| 54 | + pEraseInit.TypeErase = TYPEERASE_SECTORS; | |
| 55 | + pEraseInit.Banks = FLASH_BANK_2 ; | |
| 56 | + pEraseInit.Sector = PAGE0_ID; | |
| 57 | + pEraseInit.NbSectors = 1; | |
| 58 | + pEraseInit.VoltageRange = VOLTAGE_RANGE; | |
| 59 | + | |
| 60 | + /* Check for invalid header states and repair if necessary */ | |
| 61 | + switch (PageStatus0) | |
| 62 | + { | |
| 63 | + case ERASED: | |
| 64 | + if (PageStatus1 == VALID_PAGE) /* Page0 erased, Page1 valid */ | |
| 65 | + { | |
| 66 | + /* Erase Page0 */ | |
| 67 | + if(!EE_VerifyPageFullyErased(PAGE0_BASE_ADDRESS)) | |
| 68 | + { | |
| 69 | + FlashStatus = HAL_FLASHEx_Erase(&pEraseInit, &SectorError); | |
| 70 | + /* If erase operation was failed, a Flash error code is returned */ | |
| 71 | + if (FlashStatus != HAL_OK) | |
| 72 | + { | |
| 73 | + return FlashStatus; | |
| 74 | + } | |
| 75 | + } | |
| 76 | + } | |
| 77 | + else if (PageStatus1 == RECEIVE_DATA) /* Page0 erased, Page1 receive */ | |
| 78 | + { | |
| 79 | + /* Erase Page0 */ | |
| 80 | + if(!EE_VerifyPageFullyErased(PAGE0_BASE_ADDRESS)) | |
| 81 | + { | |
| 82 | + FlashStatus = HAL_FLASHEx_Erase(&pEraseInit, &SectorError); | |
| 83 | + /* If erase operation was failed, a Flash error code is returned */ | |
| 84 | + if (FlashStatus != HAL_OK) | |
| 85 | + { | |
| 86 | + return FlashStatus; | |
| 87 | + } | |
| 88 | + } | |
| 89 | + /* Mark Page1 as valid */ | |
| 90 | + FlashStatus = HAL_FLASH_Program(FLASH_TYPEPROGRAM_FLASHWORD, PAGE1_BASE_ADDRESS, ((uint32_t)valid)); | |
| 91 | + | |
| 92 | + /* If program operation was failed, a Flash error code is returned */ | |
| 93 | + if (FlashStatus != HAL_OK) | |
| 94 | + { | |
| 95 | + return FlashStatus; | |
| 96 | + } | |
| 97 | + } | |
| 98 | + else /* First EEPROM access (Page0&1 are erased) or invalid state -> format EEPROM */ | |
| 99 | + { | |
| 100 | + /* Erase both Page0 and Page1 and set Page0 as valid page */ | |
| 101 | + FlashStatus = EE_Format(); | |
| 102 | + /* If erase/program operation was failed, a Flash error code is returned */ | |
| 103 | + if (FlashStatus != HAL_OK) | |
| 104 | + { | |
| 105 | + return FlashStatus; | |
| 106 | + } | |
| 107 | + } | |
| 108 | + break; | |
| 109 | + | |
| 110 | + case RECEIVE_DATA: | |
| 111 | + if (PageStatus1 == VALID_PAGE) /* Page0 receive, Page1 valid */ | |
| 112 | + { | |
| 113 | + /* Transfer data from Page1 to Page0 */ | |
| 114 | + for (VarIdx = 0; VarIdx < NB_OF_VAR; VarIdx++) | |
| 115 | + { | |
| 116 | + if (( *(__IO uint16_t*)(PAGE0_BASE_ADDRESS + 6)) == VirtAddVarTab[VarIdx]) | |
| 117 | + { | |
| 118 | + x = VarIdx; | |
| 119 | + } | |
| 120 | + if (VarIdx != x) | |
| 121 | + { | |
| 122 | + /* Read the last variables' updates */ | |
| 123 | + ReadStatus = EE_ReadVariable(VirtAddVarTab[VarIdx], &DataVar); | |
| 124 | + /* In case variable corresponding to the virtual address was found */ | |
| 125 | + if (ReadStatus != 0x1) | |
| 126 | + { | |
| 127 | + /* Transfer the variable to the Page0 */ | |
| 128 | + EepromStatus = EE_VerifyPageFullWriteVariable(VirtAddVarTab[VarIdx], DataVar); | |
| 129 | + /* If program operation was failed, a Flash error code is returned */ | |
| 130 | + if (EepromStatus != HAL_OK) | |
| 131 | + { | |
| 132 | + return EepromStatus; | |
| 133 | + } | |
| 134 | + } | |
| 135 | + } | |
| 136 | + } | |
| 137 | + /* Mark Page0 as valid */ | |
| 138 | + FlashStatus = HAL_FLASH_Program(FLASH_TYPEPROGRAM_FLASHWORD, PAGE0_BASE_ADDRESS, ((uint32_t)valid)); | |
| 139 | + | |
| 140 | + /* If program operation was failed, a Flash error code is returned */ | |
| 141 | + if (FlashStatus != HAL_OK) | |
| 142 | + { | |
| 143 | + return FlashStatus; | |
| 144 | + } | |
| 145 | + pEraseInit.Sector = PAGE1_ID; | |
| 146 | + pEraseInit.Banks = FLASH_BANK_2 ; | |
| 147 | + pEraseInit.NbSectors = 1; | |
| 148 | + pEraseInit.VoltageRange = VOLTAGE_RANGE; | |
| 149 | + /* Erase Page1 */ | |
| 150 | + if(!EE_VerifyPageFullyErased(PAGE1_BASE_ADDRESS)) | |
| 151 | + { | |
| 152 | + FlashStatus = HAL_FLASHEx_Erase(&pEraseInit, &SectorError); | |
| 153 | + /* If erase operation was failed, a Flash error code is returned */ | |
| 154 | + if (FlashStatus != HAL_OK) | |
| 155 | + { | |
| 156 | + return FlashStatus; | |
| 157 | + } | |
| 158 | + } | |
| 159 | + } | |
| 160 | + else if (PageStatus1 == ERASED) /* Page0 receive, Page1 erased */ | |
| 161 | + { | |
| 162 | + pEraseInit.Sector = PAGE1_ID; | |
| 163 | + pEraseInit.Banks = FLASH_BANK_1 ; | |
| 164 | + pEraseInit.NbSectors = 1; | |
| 165 | + pEraseInit.VoltageRange = VOLTAGE_RANGE; | |
| 166 | + /* Erase Page1 */ | |
| 167 | + if(!EE_VerifyPageFullyErased(PAGE1_BASE_ADDRESS)) | |
| 168 | + { | |
| 169 | + FlashStatus = HAL_FLASHEx_Erase(&pEraseInit, &SectorError); | |
| 170 | + /* If erase operation was failed, a Flash error code is returned */ | |
| 171 | + if (FlashStatus != HAL_OK) | |
| 172 | + { | |
| 173 | + return FlashStatus; | |
| 174 | + } | |
| 175 | + } | |
| 176 | + /* Mark Page0 as valid */ | |
| 177 | + FlashStatus = HAL_FLASH_Program(FLASH_TYPEPROGRAM_FLASHWORD, PAGE0_BASE_ADDRESS, ((uint32_t)valid)); | |
| 178 | + /* If program operation was failed, a Flash error code is returned */ | |
| 179 | + if (FlashStatus != HAL_OK) | |
| 180 | + { | |
| 181 | + return FlashStatus; | |
| 182 | + } | |
| 183 | + } | |
| 184 | + else /* Invalid state -> format eeprom */ | |
| 185 | + { | |
| 186 | + /* Erase both Page0 and Page1 and set Page0 as valid page */ | |
| 187 | + FlashStatus = EE_Format(); | |
| 188 | + /* If erase/program operation was failed, a Flash error code is returned */ | |
| 189 | + if (FlashStatus != HAL_OK) | |
| 190 | + { | |
| 191 | + return FlashStatus; | |
| 192 | + } | |
| 193 | + } | |
| 194 | + break; | |
| 195 | + | |
| 196 | + case VALID_PAGE: | |
| 197 | + if (PageStatus1 == VALID_PAGE) /* Invalid state -> format eeprom */ | |
| 198 | + { | |
| 199 | + /* Erase both Page0 and Page1 and set Page0 as valid page */ | |
| 200 | + FlashStatus = EE_Format(); | |
| 201 | + /* If erase/program operation was failed, a Flash error code is returned */ | |
| 202 | + if (FlashStatus != HAL_OK) | |
| 203 | + { | |
| 204 | + return FlashStatus; | |
| 205 | + } | |
| 206 | + } | |
| 207 | + else if (PageStatus1 == ERASED) /* Page0 valid, Page1 erased */ | |
| 208 | + { | |
| 209 | + pEraseInit.Sector = PAGE1_ID; | |
| 210 | + pEraseInit.Banks = FLASH_BANK_2 ; | |
| 211 | + pEraseInit.NbSectors = 1; | |
| 212 | + pEraseInit.VoltageRange = VOLTAGE_RANGE; | |
| 213 | + /* Erase Page1 */ | |
| 214 | + if(!EE_VerifyPageFullyErased(PAGE1_BASE_ADDRESS)) | |
| 215 | + { | |
| 216 | + FlashStatus = HAL_FLASHEx_Erase(&pEraseInit, &SectorError); | |
| 217 | + /* If erase operation was failed, a Flash error code is returned */ | |
| 218 | + if (FlashStatus != HAL_OK) | |
| 219 | + { | |
| 220 | + return FlashStatus; | |
| 221 | + } | |
| 222 | + } | |
| 223 | + } | |
| 224 | + else /* Page0 valid, Page1 receive */ | |
| 225 | + { | |
| 226 | + /* Transfer data from Page0 to Page1 */ | |
| 227 | + for (VarIdx = 0; VarIdx < NB_OF_VAR; VarIdx++) | |
| 228 | + { | |
| 229 | + if ((*(__IO uint16_t*)(PAGE1_BASE_ADDRESS + 6)) == VirtAddVarTab[VarIdx]) | |
| 230 | + { | |
| 231 | + x = VarIdx; | |
| 232 | + } | |
| 233 | + if (VarIdx != x) | |
| 234 | + { | |
| 235 | + /* Read the last variables' updates */ | |
| 236 | + ReadStatus = EE_ReadVariable(VirtAddVarTab[VarIdx], &DataVar); | |
| 237 | + /* In case variable corresponding to the virtual address was found */ | |
| 238 | + if (ReadStatus != 0x1) | |
| 239 | + { | |
| 240 | + /* Transfer the variable to the Page1 */ | |
| 241 | + EepromStatus = EE_VerifyPageFullWriteVariable(VirtAddVarTab[VarIdx], DataVar); | |
| 242 | + /* If program operation was failed, a Flash error code is returned */ | |
| 243 | + if (EepromStatus != HAL_OK) | |
| 244 | + { | |
| 245 | + return EepromStatus; | |
| 246 | + } | |
| 247 | + } | |
| 248 | + } | |
| 249 | + } | |
| 250 | + /* Mark Page1 as valid */ | |
| 251 | + FlashStatus = HAL_FLASH_Program(FLASH_TYPEPROGRAM_FLASHWORD, PAGE1_BASE_ADDRESS, ((uint32_t)valid)); | |
| 252 | + | |
| 253 | + /* If program operation was failed, a Flash error code is returned */ | |
| 254 | + if (FlashStatus != HAL_OK) | |
| 255 | + { | |
| 256 | + return FlashStatus; | |
| 257 | + } | |
| 258 | + pEraseInit.Sector = PAGE0_ID; | |
| 259 | + pEraseInit.Banks = FLASH_BANK_2 ; | |
| 260 | + pEraseInit.NbSectors = 1; | |
| 261 | + pEraseInit.VoltageRange = VOLTAGE_RANGE; | |
| 262 | + /* Erase Page0 */ | |
| 263 | + if(!EE_VerifyPageFullyErased(PAGE0_BASE_ADDRESS)) | |
| 264 | + { | |
| 265 | + FlashStatus = HAL_FLASHEx_Erase(&pEraseInit, &SectorError); | |
| 266 | + /* If erase operation was failed, a Flash error code is returned */ | |
| 267 | + if (FlashStatus != HAL_OK) | |
| 268 | + { | |
| 269 | + return FlashStatus; | |
| 270 | + } | |
| 271 | + } | |
| 272 | + } | |
| 273 | + break; | |
| 274 | + | |
| 275 | + default: /* Any other state -> format eeprom */ | |
| 276 | + /* Erase both Page0 and Page1 and set Page0 as valid page */ | |
| 277 | + FlashStatus = EE_Format(); | |
| 278 | + /* If erase/program operation was failed, a Flash error code is returned */ | |
| 279 | + if (FlashStatus != HAL_OK) | |
| 280 | + { | |
| 281 | + return FlashStatus; | |
| 282 | + } | |
| 283 | + break; | |
| 284 | + } | |
| 285 | + | |
| 286 | + return HAL_OK; | |
| 287 | +} | |
| 288 | + | |
| 289 | +/** | |
| 290 | + * @brief Verify if specified page is fully erased. | |
| 291 | + * @param Address: page address | |
| 292 | + * This parameter can be one of the following values: | |
| 293 | + * @arg PAGE0_BASE_ADDRESS: Page0 base address | |
| 294 | + * @arg PAGE1_BASE_ADDRESS: Page1 base address | |
| 295 | + * @retval page fully erased status: | |
| 296 | + * - 0: if Page not erased | |
| 297 | + * - 1: if Page erased | |
| 298 | + */ | |
| 299 | +uint16_t EE_VerifyPageFullyErased(uint32_t Address) | |
| 300 | +{ | |
| 301 | + uint32_t ReadStatus = 1; | |
| 302 | + uint16_t AddressValue = 0x5555; | |
| 303 | + | |
| 304 | + /* Check each active page address starting from end */ | |
| 305 | + while (Address <= PAGE0_END_ADDRESS) | |
| 306 | + { | |
| 307 | + /* Get the current location content to be compared with virtual address */ | |
| 308 | + AddressValue = (*(__IO uint16_t*)Address); | |
| 309 | + | |
| 310 | + /* Compare the read address with the virtual address */ | |
| 311 | + if (AddressValue != ERASED) | |
| 312 | + { | |
| 313 | + | |
| 314 | + /* In case variable value is read, reset ReadStatus flag */ | |
| 315 | + ReadStatus = 0; | |
| 316 | + | |
| 317 | + break; | |
| 318 | + } | |
| 319 | + /* Next address location */ | |
| 320 | + Address = Address + 4; | |
| 321 | + } | |
| 322 | + | |
| 323 | + /* Return ReadStatus value: (0: Page not erased, 1: Sector erased) */ | |
| 324 | + return ReadStatus; | |
| 325 | +} | |
| 326 | + | |
| 327 | +/** | |
| 328 | + * @brief Returns the last stored variable data, if found, which correspond to | |
| 329 | + * the passed virtual address | |
| 330 | + * @param VirtAddress: Variable virtual address | |
| 331 | + * @param Data: Global variable contains the read variable value | |
| 332 | + * @retval Success or error status: | |
| 333 | + * - 0: if variable was found | |
| 334 | + * - 1: if the variable was not found | |
| 335 | + * - NO_VALID_PAGE: if no valid page was found. | |
| 336 | + */ | |
| 337 | +uint16_t EE_ReadVariable(uint16_t VirtAddress, uint16_t* Data) | |
| 338 | +{ | |
| 339 | + uint16_t ValidPage = PAGE0; | |
| 340 | + uint16_t AddressValue = 0x5555, ReadStatus = 1; | |
| 341 | + uint32_t Address = EEPROM_START_ADDRESS, PageStartAddress = EEPROM_START_ADDRESS; | |
| 342 | + | |
| 343 | + /* Get active Page for read operation */ | |
| 344 | + ValidPage = EE_FindValidPage(READ_FROM_VALID_PAGE); | |
| 345 | + | |
| 346 | + /* Check if there is no valid page */ | |
| 347 | + if (ValidPage == NO_VALID_PAGE) | |
| 348 | + { | |
| 349 | + return NO_VALID_PAGE; | |
| 350 | + } | |
| 351 | + | |
| 352 | + /* Get the valid Page start Address */ | |
| 353 | + PageStartAddress = (uint32_t)(EEPROM_START_ADDRESS + (uint32_t)(ValidPage * PAGE_SIZE)); | |
| 354 | + | |
| 355 | + /* Get the valid Page end Address */ | |
| 356 | + Address = (uint32_t)((EEPROM_START_ADDRESS - 32) + (uint32_t)((1 + ValidPage) * PAGE_SIZE)); | |
| 357 | + | |
| 358 | + /* Check each active page address starting from end */ | |
| 359 | + while (Address > (PageStartAddress + 32)) | |
| 360 | + { | |
| 361 | + /* Get the current location content to be compared with virtual address */ | |
| 362 | + AddressValue = (*(__IO uint16_t*)Address); | |
| 363 | + | |
| 364 | + /* Compare the read address with the virtual address */ | |
| 365 | + if (AddressValue == VirtAddress) | |
| 366 | + { | |
| 367 | + /* Get content of Address-2 which is variable value */ | |
| 368 | + *Data = (*(__IO uint16_t*)(Address - 32)); | |
| 369 | + | |
| 370 | + /* In case variable value is read, reset ReadStatus flag */ | |
| 371 | + ReadStatus = 0; | |
| 372 | + | |
| 373 | + break; | |
| 374 | + } | |
| 375 | + else | |
| 376 | + { | |
| 377 | + /* Next address location */ | |
| 378 | + Address = Address - 32; | |
| 379 | + } | |
| 380 | + } | |
| 381 | + | |
| 382 | + /* Return ReadStatus value: (0: variable exist, 1: variable doesn't exist) */ | |
| 383 | + return ReadStatus; | |
| 384 | +} | |
| 385 | + | |
| 386 | +/** | |
| 387 | + * @brief Writes/upadtes variable data in EEPROM. | |
| 388 | + * @param VirtAddress: Variable virtual address | |
| 389 | + * @param Data: 16 bit data to be written | |
| 390 | + * @retval Success or error status: | |
| 391 | + * - FLASH_COMPLETE: on success | |
| 392 | + * - PAGE_FULL: if valid page is full | |
| 393 | + * - NO_VALID_PAGE: if no valid page was found | |
| 394 | + * - Flash error code: on write Flash error | |
| 395 | + */ | |
| 396 | +uint16_t EE_WriteVariable(uint16_t VirtAddress, uint16_t Data) | |
| 397 | +{ | |
| 398 | + uint16_t Status = 0; | |
| 399 | + | |
| 400 | + /* Write the variable virtual address and value in the EEPROM */ | |
| 401 | + Status = EE_VerifyPageFullWriteVariable(VirtAddress, Data); | |
| 402 | + | |
| 403 | + /* In case the EEPROM active page is full */ | |
| 404 | + if (Status == PAGE_FULL) | |
| 405 | + { | |
| 406 | + /* Perform Page transfer */ | |
| 407 | + Status = EE_PageTransfer(VirtAddress, Data); | |
| 408 | + } | |
| 409 | + | |
| 410 | + /* Return last operation status */ | |
| 411 | + return Status; | |
| 412 | +} | |
| 413 | + | |
| 414 | +/** | |
| 415 | + * @brief Erases PAGE and PAGE1 and writes VALID_PAGE header to PAGE | |
| 416 | + * @param None | |
| 417 | + * @retval Status of the last operation (Flash write or erase) done during | |
| 418 | + * EEPROM formating | |
| 419 | + */ | |
| 420 | +static HAL_StatusTypeDef EE_Format(void) | |
| 421 | +{ | |
| 422 | + HAL_StatusTypeDef FlashStatus = HAL_OK; | |
| 423 | + uint32_t SectorError = 0; | |
| 424 | + FLASH_EraseInitTypeDef pEraseInit; | |
| 425 | + uint32_t valid[8] = {0x0000}; | |
| 426 | + | |
| 427 | + pEraseInit.TypeErase = FLASH_TYPEERASE_SECTORS; | |
| 428 | + pEraseInit.Banks = FLASH_BANK_2 ; | |
| 429 | + pEraseInit.Sector = PAGE0_ID; | |
| 430 | + pEraseInit.NbSectors = 1; | |
| 431 | + pEraseInit.VoltageRange = VOLTAGE_RANGE; | |
| 432 | + | |
| 433 | + /* Erase Page0 */ | |
| 434 | + if(!EE_VerifyPageFullyErased(PAGE0_BASE_ADDRESS)) | |
| 435 | + { | |
| 436 | + FlashStatus = HAL_FLASHEx_Erase(&pEraseInit, &SectorError); | |
| 437 | + /* If erase operation was failed, a Flash error code is returned */ | |
| 438 | + if (FlashStatus != HAL_OK) | |
| 439 | + { | |
| 440 | + return FlashStatus; | |
| 441 | + } | |
| 442 | + } | |
| 443 | + | |
| 444 | + /* Set Page0 as valid page: Write VALID_PAGE at Page0 base address */ | |
| 445 | + FlashStatus = HAL_FLASH_Program(FLASH_TYPEPROGRAM_FLASHWORD, PAGE0_BASE_ADDRESS,((uint32_t)valid)); | |
| 446 | + | |
| 447 | + /* If program operation was failed, a Flash error code is returned */ | |
| 448 | + if (FlashStatus != HAL_OK) | |
| 449 | + { | |
| 450 | + return FlashStatus; | |
| 451 | + } | |
| 452 | + | |
| 453 | + pEraseInit.Sector = PAGE1_ID; | |
| 454 | + /* Erase Page1 */ | |
| 455 | + if(!EE_VerifyPageFullyErased(PAGE1_BASE_ADDRESS)) | |
| 456 | + { | |
| 457 | + FlashStatus = HAL_FLASHEx_Erase(&pEraseInit, &SectorError); | |
| 458 | + /* If erase operation was failed, a Flash error code is returned */ | |
| 459 | + if (FlashStatus != HAL_OK) | |
| 460 | + { | |
| 461 | + return FlashStatus; | |
| 462 | + } | |
| 463 | + } | |
| 464 | + | |
| 465 | + return HAL_OK; | |
| 466 | +} | |
| 467 | + | |
| 468 | +/** | |
| 469 | + * @brief Find valid Page for write or read operation | |
| 470 | + * @param Operation: operation to achieve on the valid page. | |
| 471 | + * This parameter can be one of the following values: | |
| 472 | + * @arg READ_FROM_VALID_PAGE: read operation from valid page | |
| 473 | + * @arg WRITE_IN_VALID_PAGE: write operation from valid page | |
| 474 | + * @retval Valid page number (PAGE or PAGE1) or NO_VALID_PAGE in case | |
| 475 | + * of no valid page was found | |
| 476 | + */ | |
| 477 | +static uint16_t EE_FindValidPage(uint8_t Operation) | |
| 478 | +{ | |
| 479 | + uint16_t PageStatus0 = 6, PageStatus1 = 6; | |
| 480 | + | |
| 481 | + /* Get Page0 actual status */ | |
| 482 | + PageStatus0 = (*(__IO uint16_t*)PAGE0_BASE_ADDRESS); | |
| 483 | + | |
| 484 | + /* Get Page1 actual status */ | |
| 485 | + PageStatus1 = (*(__IO uint16_t*)PAGE1_BASE_ADDRESS); | |
| 486 | + | |
| 487 | + /* Write or read operation */ | |
| 488 | + switch (Operation) | |
| 489 | + { | |
| 490 | + case WRITE_IN_VALID_PAGE: /* ---- Write operation ---- */ | |
| 491 | + if (PageStatus1 == VALID_PAGE) | |
| 492 | + { | |
| 493 | + /* Page0 receiving data */ | |
| 494 | + if (PageStatus0 == RECEIVE_DATA) | |
| 495 | + { | |
| 496 | + return PAGE0; /* Page0 valid */ | |
| 497 | + } | |
| 498 | + else | |
| 499 | + { | |
| 500 | + return PAGE1; /* Page1 valid */ | |
| 501 | + } | |
| 502 | + } | |
| 503 | + else if (PageStatus0 == VALID_PAGE) | |
| 504 | + { | |
| 505 | + /* Page1 receiving data */ | |
| 506 | + if (PageStatus1 == RECEIVE_DATA) | |
| 507 | + { | |
| 508 | + return PAGE1; /* Page1 valid */ | |
| 509 | + } | |
| 510 | + else | |
| 511 | + { | |
| 512 | + return PAGE0; /* Page0 valid */ | |
| 513 | + } | |
| 514 | + } | |
| 515 | + else | |
| 516 | + { | |
| 517 | + return NO_VALID_PAGE; /* No valid Page */ | |
| 518 | + } | |
| 519 | + | |
| 520 | + case READ_FROM_VALID_PAGE: /* ---- Read operation ---- */ | |
| 521 | + if (PageStatus0 == VALID_PAGE) | |
| 522 | + { | |
| 523 | + return PAGE0; /* Page0 valid */ | |
| 524 | + } | |
| 525 | + else if (PageStatus1 == VALID_PAGE) | |
| 526 | + { | |
| 527 | + return PAGE1; /* Page1 valid */ | |
| 528 | + } | |
| 529 | + else | |
| 530 | + { | |
| 531 | + return NO_VALID_PAGE ; /* No valid Page */ | |
| 532 | + } | |
| 533 | + | |
| 534 | + default: | |
| 535 | + return PAGE0; /* Page0 valid */ | |
| 536 | + } | |
| 537 | +} | |
| 538 | + | |
| 539 | +/** | |
| 540 | + * @brief Verify if active page is full and Writes variable in EEPROM. | |
| 541 | + * @param VirtAddress: 16 bit virtual address of the variable | |
| 542 | + * @param Data: 16 bit data to be written as variable value | |
| 543 | + * @retval Success or error status: | |
| 544 | + * - FLASH_COMPLETE: on success | |
| 545 | + * - PAGE_FULL: if valid page is full | |
| 546 | + * - NO_VALID_PAGE: if no valid page was found | |
| 547 | + * - Flash error code: on write Flash error | |
| 548 | + */ | |
| 549 | +static uint16_t EE_VerifyPageFullWriteVariable(uint16_t VirtAddress, uint16_t Data) | |
| 550 | +{ | |
| 551 | + HAL_StatusTypeDef FlashStatus = HAL_OK; | |
| 552 | + uint16_t ValidPage = PAGE0; | |
| 553 | + uint32_t Address = EEPROM_START_ADDRESS, PageEndAddress = EEPROM_START_ADDRESS+PAGE_SIZE; | |
| 554 | + | |
| 555 | + uint32_t data32[8] = {Data}; | |
| 556 | + uint32_t VirtAddress1[8] = {VirtAddress}; | |
| 557 | + /* Get valid Page for write operation */ | |
| 558 | + ValidPage = EE_FindValidPage(WRITE_IN_VALID_PAGE); | |
| 559 | + | |
| 560 | + /* Check if there is no valid page */ | |
| 561 | + if (ValidPage == NO_VALID_PAGE) | |
| 562 | + { | |
| 563 | + return NO_VALID_PAGE; | |
| 564 | + } | |
| 565 | + | |
| 566 | + /* Get the valid Page start Address */ | |
| 567 | + Address = (uint32_t)(EEPROM_START_ADDRESS + (uint32_t)(ValidPage * PAGE_SIZE)); | |
| 568 | + | |
| 569 | + /* Get the valid Page end Address */ | |
| 570 | + PageEndAddress = (uint32_t)((EEPROM_START_ADDRESS - 1) + (uint32_t)((ValidPage + 1) * PAGE_SIZE)); | |
| 571 | + | |
| 572 | + /* Check each active page address starting from begining */ | |
| 573 | + while (Address < PageEndAddress) | |
| 574 | + { | |
| 575 | + /* Verify if Address and Address+2 contents are 0xFFFFFFFF */ | |
| 576 | + if ((*(__IO uint32_t*)Address) == 0xFFFFFFFF) | |
| 577 | + { | |
| 578 | + /* Set variable data */ | |
| 579 | + FlashStatus = HAL_FLASH_Program(FLASH_TYPEPROGRAM_FLASHWORD, Address, ((uint32_t)data32)); | |
| 580 | + | |
| 581 | + /* If program operation was failed, a Flash error code is returned */ | |
| 582 | + if (FlashStatus != HAL_OK) | |
| 583 | + { | |
| 584 | + return FlashStatus; | |
| 585 | + } | |
| 586 | + /* Set variable virtual address */ | |
| 587 | + FlashStatus = HAL_FLASH_Program(FLASH_TYPEPROGRAM_FLASHWORD, Address + 32, ((uint32_t)VirtAddress1)); | |
| 588 | + | |
| 589 | + /* Return program operation status */ | |
| 590 | + return FlashStatus; | |
| 591 | + } | |
| 592 | + else | |
| 593 | + { | |
| 594 | + /* Next address location */ | |
| 595 | + Address = Address + 64; | |
| 596 | + } | |
| 597 | + } | |
| 598 | + | |
| 599 | + /* Return PAGE_FULL in case the valid page is full */ | |
| 600 | + return PAGE_FULL; | |
| 601 | +} | |
| 602 | + | |
| 603 | +/** | |
| 604 | + * @brief Transfers last updated variables data from the full Page to | |
| 605 | + * an empty one. | |
| 606 | + * @param VirtAddress: 16 bit virtual address of the variable | |
| 607 | + * @param Data: 16 bit data to be written as variable value | |
| 608 | + * @retval Success or error status: | |
| 609 | + * - FLASH_COMPLETE: on success | |
| 610 | + * - PAGE_FULL: if valid page is full | |
| 611 | + * - NO_VALID_PAGE: if no valid page was found | |
| 612 | + * - Flash error code: on write Flash error | |
| 613 | + */ | |
| 614 | +static uint16_t EE_PageTransfer(uint16_t VirtAddress, uint16_t Data) | |
| 615 | +{ | |
| 616 | + HAL_StatusTypeDef FlashStatus = HAL_OK; | |
| 617 | + uint32_t NewPageAddress = EEPROM_START_ADDRESS; | |
| 618 | + uint16_t OldPageId=0; | |
| 619 | + uint16_t ValidPage = PAGE0, VarIdx = 0; | |
| 620 | + uint16_t EepromStatus = 0, ReadStatus = 0; | |
| 621 | + uint32_t SectorError = 0; | |
| 622 | + FLASH_EraseInitTypeDef pEraseInit; | |
| 623 | + uint32_t valid[8] = {0x0000}; | |
| 624 | + uint32_t receive[8] = {0xEEEE}; | |
| 625 | + /* Get active Page for read operation */ | |
| 626 | + ValidPage = EE_FindValidPage(READ_FROM_VALID_PAGE); | |
| 627 | + | |
| 628 | + if (ValidPage == PAGE1) /* Page1 valid */ | |
| 629 | + { | |
| 630 | + /* New page address where variable will be moved to */ | |
| 631 | + NewPageAddress = PAGE0_BASE_ADDRESS; | |
| 632 | + | |
| 633 | + /* Old page ID where variable will be taken from */ | |
| 634 | + OldPageId = PAGE1_ID; | |
| 635 | + } | |
| 636 | + else if (ValidPage == PAGE0) /* Page0 valid */ | |
| 637 | + { | |
| 638 | + /* New page address where variable will be moved to */ | |
| 639 | + NewPageAddress = PAGE1_BASE_ADDRESS; | |
| 640 | + | |
| 641 | + /* Old page ID where variable will be taken from */ | |
| 642 | + OldPageId = PAGE0_ID; | |
| 643 | + } | |
| 644 | + else | |
| 645 | + { | |
| 646 | + return NO_VALID_PAGE; /* No valid Page */ | |
| 647 | + } | |
| 648 | + | |
| 649 | + /* Set the new Page status to RECEIVE_DATA status */ | |
| 650 | + | |
| 651 | + FlashStatus = HAL_FLASH_Program(FLASH_TYPEPROGRAM_FLASHWORD, NewPageAddress, ((uint32_t)receive)); | |
| 652 | + | |
| 653 | + /* If program operation was failed, a Flash error code is returned */ | |
| 654 | + if (FlashStatus != HAL_OK) | |
| 655 | + { | |
| 656 | + return FlashStatus; | |
| 657 | + } | |
| 658 | + | |
| 659 | + /* Write the variable passed as parameter in the new active page */ | |
| 660 | + EepromStatus = EE_VerifyPageFullWriteVariable(VirtAddress, Data); | |
| 661 | + /* If program operation was failed, a Flash error code is returned */ | |
| 662 | + if (EepromStatus != HAL_OK) | |
| 663 | + { | |
| 664 | + return EepromStatus; | |
| 665 | + } | |
| 666 | + | |
| 667 | + /* Transfer process: transfer variables from old to the new active page */ | |
| 668 | + for (VarIdx = 0; VarIdx < NB_OF_VAR; VarIdx++) | |
| 669 | + { | |
| 670 | + if (VirtAddVarTab[VarIdx] != VirtAddress) /* Check each variable except the one passed as parameter */ | |
| 671 | + { | |
| 672 | + /* Read the other last variable updates */ | |
| 673 | + ReadStatus = EE_ReadVariable(VirtAddVarTab[VarIdx], &DataVar); | |
| 674 | + /* In case variable corresponding to the virtual address was found */ | |
| 675 | + if (ReadStatus != 0x1) | |
| 676 | + { | |
| 677 | + /* Transfer the variable to the new active page */ | |
| 678 | + EepromStatus = EE_VerifyPageFullWriteVariable(VirtAddVarTab[VarIdx], DataVar); | |
| 679 | + /* If program operation was failed, a Flash error code is returned */ | |
| 680 | + if (EepromStatus != HAL_OK) | |
| 681 | + { | |
| 682 | + return EepromStatus; | |
| 683 | + } | |
| 684 | + } | |
| 685 | + } | |
| 686 | + } | |
| 687 | + | |
| 688 | + HAL_FLASH_Unlock(); | |
| 689 | + | |
| 690 | + /* Clear pending flags (if any) */ | |
| 691 | + __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR | | |
| 692 | + FLASH_FLAG_PGSERR | FLASH_FLAG_WRPERR); | |
| 693 | + | |
| 694 | + pEraseInit.TypeErase = TYPEERASE_SECTORS; | |
| 695 | + pEraseInit.Banks = FLASH_BANK_2 ; | |
| 696 | + pEraseInit.Sector = OldPageId; | |
| 697 | + pEraseInit.NbSectors = 1; | |
| 698 | + pEraseInit.VoltageRange = VOLTAGE_RANGE; | |
| 699 | + | |
| 700 | + /* Erase the old Page: Set old Page status to ERASED status */ | |
| 701 | + FlashStatus = HAL_FLASHEx_Erase(&pEraseInit, &SectorError); | |
| 702 | + /* If erase operation was failed, a Flash error code is returned */ | |
| 703 | + if (FlashStatus != HAL_OK) | |
| 704 | + { | |
| 705 | + return FlashStatus; | |
| 706 | + } | |
| 707 | + | |
| 708 | + /* Set new Page status to VALID_PAGE status */ | |
| 709 | + FlashStatus = HAL_FLASH_Program(FLASH_TYPEPROGRAM_FLASHWORD, NewPageAddress, ((uint32_t)valid)); | |
| 710 | + /* If program operation was failed, a Flash error code is returned */ | |
| 711 | + if (FlashStatus != HAL_OK) | |
| 712 | + { | |
| 713 | + return FlashStatus; | |
| 714 | + } | |
| 715 | + | |
| 716 | + /* Return last operation flash status */ | |
| 717 | + return FlashStatus; | |
| 718 | +} | |
| @@ -0,0 +1,56 @@ | ||
| 1 | +/** | |
| 2 | + ****************************************************************************** | |
| 3 | + * @file fatfs.c | |
| 4 | + * @brief Code for fatfs applications | |
| 5 | + ****************************************************************************** | |
| 6 | + * @attention | |
| 7 | + * | |
| 8 | + * <h2><center>© Copyright (c) 2020 STMicroelectronics. | |
| 9 | + * All rights reserved.</center></h2> | |
| 10 | + * | |
| 11 | + * This software component is licensed by ST under Ultimate Liberty license | |
| 12 | + * SLA0044, the "License"; You may not use this file except in compliance with | |
| 13 | + * the License. You may obtain a copy of the License at: | |
| 14 | + * www.st.com/SLA0044 | |
| 15 | + * | |
| 16 | + ****************************************************************************** | |
| 17 | + */ | |
| 18 | + | |
| 19 | +#include "fatfs.h" | |
| 20 | + | |
| 21 | +uint8_t retSD; /* Return value for SD */ | |
| 22 | +char SDPath[4]; /* SD logical drive path */ | |
| 23 | +FATFS SDFatFS; /* File system object for SD logical drive */ | |
| 24 | +FIL SDFile; /* File object for SD */ | |
| 25 | + | |
| 26 | +/* USER CODE BEGIN Variables */ | |
| 27 | + | |
| 28 | +/* USER CODE END Variables */ | |
| 29 | + | |
| 30 | +void MX_FATFS_Init(void) | |
| 31 | +{ | |
| 32 | + /*## FatFS: Link the SD driver ###########################*/ | |
| 33 | + retSD = FATFS_LinkDriver(&SD_Driver, SDPath); | |
| 34 | + | |
| 35 | + /* USER CODE BEGIN Init */ | |
| 36 | + /* additional user code for init */ | |
| 37 | + /* USER CODE END Init */ | |
| 38 | +} | |
| 39 | + | |
| 40 | +/** | |
| 41 | + * @brief Gets Time from RTC | |
| 42 | + * @param None | |
| 43 | + * @retval Time in DWORD | |
| 44 | + */ | |
| 45 | +DWORD get_fattime(void) | |
| 46 | +{ | |
| 47 | + /* USER CODE BEGIN get_fattime */ | |
| 48 | + return 0; | |
| 49 | + /* USER CODE END get_fattime */ | |
| 50 | +} | |
| 51 | + | |
| 52 | +/* USER CODE BEGIN Application */ | |
| 53 | + | |
| 54 | +/* USER CODE END Application */ | |
| 55 | + | |
| 56 | +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |
| @@ -0,0 +1,31 @@ | ||
| 1 | +/** | |
| 2 | + ****************************************************************************** | |
| 3 | + * @file : fatfs_platform.c | |
| 4 | + * @brief : fatfs_platform source file | |
| 5 | + ****************************************************************************** | |
| 6 | + * @attention | |
| 7 | + * | |
| 8 | + * <h2><center>© Copyright (c) 2020 STMicroelectronics. | |
| 9 | + * All rights reserved.</center></h2> | |
| 10 | + * | |
| 11 | + * This software component is licensed by ST under Ultimate Liberty license | |
| 12 | + * SLA0044, the "License"; You may not use this file except in compliance with | |
| 13 | + * the License. You may obtain a copy of the License at: | |
| 14 | + * www.st.com/SLA0044 | |
| 15 | + * | |
| 16 | + ****************************************************************************** | |
| 17 | +*/ | |
| 18 | +#include "fatfs_platform.h" | |
| 19 | + | |
| 20 | +uint8_t BSP_PlatformIsDetected(void) { | |
| 21 | + uint8_t status = SD_PRESENT; | |
| 22 | + /* Check SD card detect pin */ | |
| 23 | + if(HAL_GPIO_ReadPin(SD_DETECT_GPIO_PORT, SD_DETECT_PIN) != GPIO_PIN_RESET) | |
| 24 | + { | |
| 25 | + status = SD_NOT_PRESENT; | |
| 26 | + } | |
| 27 | + /* USER CODE BEGIN 1 */ | |
| 28 | + /* user code can be inserted here */ | |
| 29 | + /* USER CODE END 1 */ | |
| 30 | + return status; | |
| 31 | +} | |
| @@ -0,0 +1,281 @@ | ||
| 1 | +/** | |
| 2 | + ****************************************************************************** | |
| 3 | + * File Name : FMC.c | |
| 4 | + * Description : This file provides code for the configuration | |
| 5 | + * of the FMC peripheral. | |
| 6 | + ****************************************************************************** | |
| 7 | + * @attention | |
| 8 | + * | |
| 9 | + * <h2><center>© Copyright (c) 2020 STMicroelectronics. | |
| 10 | + * All rights reserved.</center></h2> | |
| 11 | + * | |
| 12 | + * This software component is licensed by ST under Ultimate Liberty license | |
| 13 | + * SLA0044, the "License"; You may not use this file except in compliance with | |
| 14 | + * the License. You may obtain a copy of the License at: | |
| 15 | + * www.st.com/SLA0044 | |
| 16 | + * | |
| 17 | + ****************************************************************************** | |
| 18 | + */ | |
| 19 | + | |
| 20 | +/* Includes ------------------------------------------------------------------*/ | |
| 21 | +#include "fmc.h" | |
| 22 | + | |
| 23 | +/* USER CODE BEGIN 0 */ | |
| 24 | + | |
| 25 | +/* USER CODE END 0 */ | |
| 26 | + | |
| 27 | +SDRAM_HandleTypeDef hsdram1; | |
| 28 | + | |
| 29 | +/* FMC initialization function */ | |
| 30 | +void MX_FMC_Init(void) | |
| 31 | +{ | |
| 32 | + FMC_SDRAM_TimingTypeDef SdramTiming = {0}; | |
| 33 | + | |
| 34 | + /** Perform the SDRAM1 memory initialization sequence | |
| 35 | + */ | |
| 36 | + hsdram1.Instance = FMC_SDRAM_DEVICE; | |
| 37 | + /* hsdram1.Init */ | |
| 38 | + hsdram1.Init.SDBank = FMC_SDRAM_BANK1; | |
| 39 | + hsdram1.Init.ColumnBitsNumber = FMC_SDRAM_COLUMN_BITS_NUM_9; | |
| 40 | + hsdram1.Init.RowBitsNumber = FMC_SDRAM_ROW_BITS_NUM_13; | |
| 41 | + hsdram1.Init.MemoryDataWidth = FMC_SDRAM_MEM_BUS_WIDTH_16; | |
| 42 | + hsdram1.Init.InternalBankNumber = FMC_SDRAM_INTERN_BANKS_NUM_4; | |
| 43 | + hsdram1.Init.CASLatency = FMC_SDRAM_CAS_LATENCY_2; | |
| 44 | + hsdram1.Init.WriteProtection = FMC_SDRAM_WRITE_PROTECTION_DISABLE; | |
| 45 | + hsdram1.Init.SDClockPeriod = FMC_SDRAM_CLOCK_PERIOD_3; | |
| 46 | + hsdram1.Init.ReadBurst = FMC_SDRAM_RBURST_ENABLE; | |
| 47 | + hsdram1.Init.ReadPipeDelay = FMC_SDRAM_RPIPE_DELAY_0; | |
| 48 | + /* SdramTiming */ | |
| 49 | + SdramTiming.LoadToActiveDelay = 2; | |
| 50 | + SdramTiming.ExitSelfRefreshDelay = 6; | |
| 51 | + SdramTiming.SelfRefreshTime = 4; | |
| 52 | + SdramTiming.RowCycleDelay = 6; | |
| 53 | + SdramTiming.WriteRecoveryTime = 2; | |
| 54 | + SdramTiming.RPDelay = 2; | |
| 55 | + SdramTiming.RCDDelay = 2; | |
| 56 | + | |
| 57 | + if (HAL_SDRAM_Init(&hsdram1, &SdramTiming) != HAL_OK) | |
| 58 | + { | |
| 59 | + Error_Handler( ); | |
| 60 | + } | |
| 61 | + | |
| 62 | + HAL_SetFMCMemorySwappingConfig(FMC_SWAPBMAP_SDRAM_SRAM); | |
| 63 | + | |
| 64 | +} | |
| 65 | + | |
| 66 | +static uint32_t FMC_Initialized = 0; | |
| 67 | + | |
| 68 | +static void HAL_FMC_MspInit(void){ | |
| 69 | + /* USER CODE BEGIN FMC_MspInit 0 */ | |
| 70 | + | |
| 71 | + /* USER CODE END FMC_MspInit 0 */ | |
| 72 | + GPIO_InitTypeDef GPIO_InitStruct = {0}; | |
| 73 | + if (FMC_Initialized) { | |
| 74 | + return; | |
| 75 | + } | |
| 76 | + FMC_Initialized = 1; | |
| 77 | + | |
| 78 | + /* Peripheral clock enable */ | |
| 79 | + __HAL_RCC_FMC_CLK_ENABLE(); | |
| 80 | + | |
| 81 | + /** FMC GPIO Configuration | |
| 82 | + PF0 ------> FMC_A0 | |
| 83 | + PF1 ------> FMC_A1 | |
| 84 | + PF2 ------> FMC_A2 | |
| 85 | + PF3 ------> FMC_A3 | |
| 86 | + PF4 ------> FMC_A4 | |
| 87 | + PF5 ------> FMC_A5 | |
| 88 | + PC0 ------> FMC_SDNWE | |
| 89 | + PC2_C ------> FMC_SDNE0 | |
| 90 | + PC3_C ------> FMC_SDCKE0 | |
| 91 | + PF11 ------> FMC_SDNRAS | |
| 92 | + PF12 ------> FMC_A6 | |
| 93 | + PF13 ------> FMC_A7 | |
| 94 | + PF14 ------> FMC_A8 | |
| 95 | + PF15 ------> FMC_A9 | |
| 96 | + PG0 ------> FMC_A10 | |
| 97 | + PG1 ------> FMC_A11 | |
| 98 | + PE7 ------> FMC_D4 | |
| 99 | + PE8 ------> FMC_D5 | |
| 100 | + PE9 ------> FMC_D6 | |
| 101 | + PE10 ------> FMC_D7 | |
| 102 | + PE11 ------> FMC_D8 | |
| 103 | + PE12 ------> FMC_D9 | |
| 104 | + PE13 ------> FMC_D10 | |
| 105 | + PE14 ------> FMC_D11 | |
| 106 | + PE15 ------> FMC_D12 | |
| 107 | + PD8 ------> FMC_D13 | |
| 108 | + PD9 ------> FMC_D14 | |
| 109 | + PD10 ------> FMC_D15 | |
| 110 | + PD14 ------> FMC_D0 | |
| 111 | + PD15 ------> FMC_D1 | |
| 112 | + PG2 ------> FMC_A12 | |
| 113 | + PG4 ------> FMC_BA0 | |
| 114 | + PG5 ------> FMC_BA1 | |
| 115 | + PG8 ------> FMC_SDCLK | |
| 116 | + PD0 ------> FMC_D2 | |
| 117 | + PD1 ------> FMC_D3 | |
| 118 | + PG15 ------> FMC_SDNCAS | |
| 119 | + PE0 ------> FMC_NBL0 | |
| 120 | + PE1 ------> FMC_NBL1 | |
| 121 | + */ | |
| 122 | + /* GPIO_InitStruct */ | |
| 123 | + GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3 | |
| 124 | + |GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_11|GPIO_PIN_12 | |
| 125 | + |GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15; | |
| 126 | + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; | |
| 127 | + GPIO_InitStruct.Pull = GPIO_NOPULL; | |
| 128 | + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; | |
| 129 | + GPIO_InitStruct.Alternate = GPIO_AF12_FMC; | |
| 130 | + | |
| 131 | + HAL_GPIO_Init(GPIOF, &GPIO_InitStruct); | |
| 132 | + | |
| 133 | + /* GPIO_InitStruct */ | |
| 134 | + GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_2|GPIO_PIN_3; | |
| 135 | + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; | |
| 136 | + GPIO_InitStruct.Pull = GPIO_NOPULL; | |
| 137 | + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; | |
| 138 | + GPIO_InitStruct.Alternate = GPIO_AF12_FMC; | |
| 139 | + | |
| 140 | + HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); | |
| 141 | + | |
| 142 | + /* GPIO_InitStruct */ | |
| 143 | + GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_4 | |
| 144 | + |GPIO_PIN_5|GPIO_PIN_8|GPIO_PIN_15; | |
| 145 | + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; | |
| 146 | + GPIO_InitStruct.Pull = GPIO_NOPULL; | |
| 147 | + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; | |
| 148 | + GPIO_InitStruct.Alternate = GPIO_AF12_FMC; | |
| 149 | + | |
| 150 | + HAL_GPIO_Init(GPIOG, &GPIO_InitStruct); | |
| 151 | + | |
| 152 | + /* GPIO_InitStruct */ | |
| 153 | + GPIO_InitStruct.Pin = GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10 | |
| 154 | + |GPIO_PIN_11|GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14 | |
| 155 | + |GPIO_PIN_15|GPIO_PIN_0|GPIO_PIN_1; | |
| 156 | + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; | |
| 157 | + GPIO_InitStruct.Pull = GPIO_NOPULL; | |
| 158 | + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; | |
| 159 | + GPIO_InitStruct.Alternate = GPIO_AF12_FMC; | |
| 160 | + | |
| 161 | + HAL_GPIO_Init(GPIOE, &GPIO_InitStruct); | |
| 162 | + | |
| 163 | + /* GPIO_InitStruct */ | |
| 164 | + GPIO_InitStruct.Pin = GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_14 | |
| 165 | + |GPIO_PIN_15|GPIO_PIN_0|GPIO_PIN_1; | |
| 166 | + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; | |
| 167 | + GPIO_InitStruct.Pull = GPIO_NOPULL; | |
| 168 | + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; | |
| 169 | + GPIO_InitStruct.Alternate = GPIO_AF12_FMC; | |
| 170 | + | |
| 171 | + HAL_GPIO_Init(GPIOD, &GPIO_InitStruct); | |
| 172 | + | |
| 173 | + /* USER CODE BEGIN FMC_MspInit 1 */ | |
| 174 | + | |
| 175 | + /* USER CODE END FMC_MspInit 1 */ | |
| 176 | +} | |
| 177 | + | |
| 178 | +void HAL_SDRAM_MspInit(SDRAM_HandleTypeDef* sdramHandle){ | |
| 179 | + /* USER CODE BEGIN SDRAM_MspInit 0 */ | |
| 180 | + | |
| 181 | + /* USER CODE END SDRAM_MspInit 0 */ | |
| 182 | + HAL_FMC_MspInit(); | |
| 183 | + /* USER CODE BEGIN SDRAM_MspInit 1 */ | |
| 184 | + | |
| 185 | + /* USER CODE END SDRAM_MspInit 1 */ | |
| 186 | +} | |
| 187 | + | |
| 188 | +static uint32_t FMC_DeInitialized = 0; | |
| 189 | + | |
| 190 | +static void HAL_FMC_MspDeInit(void){ | |
| 191 | + /* USER CODE BEGIN FMC_MspDeInit 0 */ | |
| 192 | + | |
| 193 | + /* USER CODE END FMC_MspDeInit 0 */ | |
| 194 | + if (FMC_DeInitialized) { | |
| 195 | + return; | |
| 196 | + } | |
| 197 | + FMC_DeInitialized = 1; | |
| 198 | + /* Peripheral clock enable */ | |
| 199 | + __HAL_RCC_FMC_CLK_DISABLE(); | |
| 200 | + | |
| 201 | + /** FMC GPIO Configuration | |
| 202 | + PF0 ------> FMC_A0 | |
| 203 | + PF1 ------> FMC_A1 | |
| 204 | + PF2 ------> FMC_A2 | |
| 205 | + PF3 ------> FMC_A3 | |
| 206 | + PF4 ------> FMC_A4 | |
| 207 | + PF5 ------> FMC_A5 | |
| 208 | + PC0 ------> FMC_SDNWE | |
| 209 | + PC2_C ------> FMC_SDNE0 | |
| 210 | + PC3_C ------> FMC_SDCKE0 | |
| 211 | + PF11 ------> FMC_SDNRAS | |
| 212 | + PF12 ------> FMC_A6 | |
| 213 | + PF13 ------> FMC_A7 | |
| 214 | + PF14 ------> FMC_A8 | |
| 215 | + PF15 ------> FMC_A9 | |
| 216 | + PG0 ------> FMC_A10 | |
| 217 | + PG1 ------> FMC_A11 | |
| 218 | + PE7 ------> FMC_D4 | |
| 219 | + PE8 ------> FMC_D5 | |
| 220 | + PE9 ------> FMC_D6 | |
| 221 | + PE10 ------> FMC_D7 | |
| 222 | + PE11 ------> FMC_D8 | |
| 223 | + PE12 ------> FMC_D9 | |
| 224 | + PE13 ------> FMC_D10 | |
| 225 | + PE14 ------> FMC_D11 | |
| 226 | + PE15 ------> FMC_D12 | |
| 227 | + PD8 ------> FMC_D13 | |
| 228 | + PD9 ------> FMC_D14 | |
| 229 | + PD10 ------> FMC_D15 | |
| 230 | + PD14 ------> FMC_D0 | |
| 231 | + PD15 ------> FMC_D1 | |
| 232 | + PG2 ------> FMC_A12 | |
| 233 | + PG4 ------> FMC_BA0 | |
| 234 | + PG5 ------> FMC_BA1 | |
| 235 | + PG8 ------> FMC_SDCLK | |
| 236 | + PD0 ------> FMC_D2 | |
| 237 | + PD1 ------> FMC_D3 | |
| 238 | + PG15 ------> FMC_SDNCAS | |
| 239 | + PE0 ------> FMC_NBL0 | |
| 240 | + PE1 ------> FMC_NBL1 | |
| 241 | + */ | |
| 242 | + | |
| 243 | + HAL_GPIO_DeInit(GPIOF, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3 | |
| 244 | + |GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_11|GPIO_PIN_12 | |
| 245 | + |GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15); | |
| 246 | + | |
| 247 | + HAL_GPIO_DeInit(GPIOC, GPIO_PIN_0|GPIO_PIN_2|GPIO_PIN_3); | |
| 248 | + | |
| 249 | + HAL_GPIO_DeInit(GPIOG, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_4 | |
| 250 | + |GPIO_PIN_5|GPIO_PIN_8|GPIO_PIN_15); | |
| 251 | + | |
| 252 | + HAL_GPIO_DeInit(GPIOE, GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10 | |
| 253 | + |GPIO_PIN_11|GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14 | |
| 254 | + |GPIO_PIN_15|GPIO_PIN_0|GPIO_PIN_1); | |
| 255 | + | |
| 256 | + HAL_GPIO_DeInit(GPIOD, GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_14 | |
| 257 | + |GPIO_PIN_15|GPIO_PIN_0|GPIO_PIN_1); | |
| 258 | + | |
| 259 | + /* USER CODE BEGIN FMC_MspDeInit 1 */ | |
| 260 | + | |
| 261 | + /* USER CODE END FMC_MspDeInit 1 */ | |
| 262 | +} | |
| 263 | + | |
| 264 | +void HAL_SDRAM_MspDeInit(SDRAM_HandleTypeDef* sdramHandle){ | |
| 265 | + /* USER CODE BEGIN SDRAM_MspDeInit 0 */ | |
| 266 | + | |
| 267 | + /* USER CODE END SDRAM_MspDeInit 0 */ | |
| 268 | + HAL_FMC_MspDeInit(); | |
| 269 | + /* USER CODE BEGIN SDRAM_MspDeInit 1 */ | |
| 270 | + | |
| 271 | + /* USER CODE END SDRAM_MspDeInit 1 */ | |
| 272 | +} | |
| 273 | +/** | |
| 274 | + * @} | |
| 275 | + */ | |
| 276 | + | |
| 277 | +/** | |
| 278 | + * @} | |
| 279 | + */ | |
| 280 | + | |
| 281 | +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |
| @@ -0,0 +1,983 @@ | ||
| 1 | +/* | |
| 2 | + * gfx.c | |
| 3 | + * a C port of the Adafruit GFX library | |
| 4 | + * Created on: Jul 8, 2018 | |
| 5 | + * Author: jeffsnyder | |
| 6 | + */ | |
| 7 | + | |
| 8 | + | |
| 9 | +/* | |
| 10 | +This is the core graphics library for all our displays, providing a common | |
| 11 | +set of graphics primitives (points, lines, circles, etc.). It needs to be | |
| 12 | +paired with a hardware-specific library for each display device we carry | |
| 13 | +(to handle the lower-level functions). | |
| 14 | + | |
| 15 | +Adafruit invests time and resources providing this open source code, please | |
| 16 | +support Adafruit & open-source hardware by purchasing products from Adafruit! | |
| 17 | + | |
| 18 | +Copyright (c) 2013 Adafruit Industries. All rights reserved. | |
| 19 | + | |
| 20 | +Redistribution and use in source and binary forms, with or without | |
| 21 | +modification, are permitted provided that the following conditions are met: | |
| 22 | + | |
| 23 | +- Redistributions of source code must retain the above copyright notice, | |
| 24 | + this list of conditions and the following disclaimer. | |
| 25 | +- Redistributions in binary form must reproduce the above copyright notice, | |
| 26 | + this list of conditions and the following disclaimer in the documentation | |
| 27 | + and/or other materials provided with the distribution. | |
| 28 | + | |
| 29 | +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |
| 30 | +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
| 31 | +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
| 32 | +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE | |
| 33 | +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
| 34 | +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
| 35 | +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
| 36 | +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
| 37 | +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
| 38 | +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
| 39 | +POSSIBILITY OF SUCH DAMAGE. | |
| 40 | + */ | |
| 41 | +#include "stm32h7xx_hal.h" | |
| 42 | +#include "gfx.h" | |
| 43 | +#include "gfx_font.c" | |
| 44 | +#include "main.h" | |
| 45 | + | |
| 46 | +// Many (but maybe not all) non-AVR board installs define macros | |
| 47 | +// for compatibility with existing PROGMEM-reading AVR code. | |
| 48 | +// Do our own checks and defines here for good measure... | |
| 49 | + | |
| 50 | +#ifndef pgm_read_byte | |
| 51 | + #define pgm_read_byte(addr) (*(const unsigned char *)(addr)) | |
| 52 | +#endif | |
| 53 | +#ifndef pgm_read_word | |
| 54 | + #define pgm_read_word(addr) (*(const unsigned short *)(addr)) | |
| 55 | +#endif | |
| 56 | +#ifndef pgm_read_dword | |
| 57 | + #define pgm_read_dword(addr) (*(const unsigned long *)(addr)) | |
| 58 | +#endif | |
| 59 | + | |
| 60 | +// Pointers are a peculiar case...typically 16-bit on AVR boards, | |
| 61 | +// 32 bits elsewhere. Try to accommodate both... | |
| 62 | + | |
| 63 | + | |
| 64 | + #define pgm_read_pointer(addr) ((void *)pgm_read_dword(addr)) | |
| 65 | + | |
| 66 | + | |
| 67 | +#ifndef min | |
| 68 | +#define min(a,b) (((a) < (b)) ? (a) : (b)) | |
| 69 | +#endif | |
| 70 | + | |
| 71 | +#ifndef _swap_int16_t | |
| 72 | +#define _swap_int16_t(a, b) { int16_t t = a; a = b; b = t; } | |
| 73 | +#endif | |
| 74 | + | |
| 75 | +void GFXinit(GFX* myGfx, int16_t w, int16_t h) | |
| 76 | +{ | |
| 77 | + myGfx->WIDTH = w; | |
| 78 | + myGfx->HEIGHT = h; | |
| 79 | + myGfx->_width = w; | |
| 80 | + myGfx->_height = h; | |
| 81 | + myGfx->rotation = 0; | |
| 82 | + myGfx->cursor_y = 0; | |
| 83 | + myGfx->cursor_x = 0; | |
| 84 | + myGfx->textsize = 1; | |
| 85 | + myGfx->textcolor = 0xFFFF; | |
| 86 | + myGfx->textbgcolor = 0xFFFF; | |
| 87 | + myGfx->wrap = 1; | |
| 88 | + myGfx->_cp437 = 0; | |
| 89 | + myGfx->gfxFont = NULL; | |
| 90 | +} | |
| 91 | + | |
| 92 | +// Bresenham's algorithm - thx wikpedia | |
| 93 | +void GFXwriteLine(GFX* myGFX, int16_t x0, int16_t y0, int16_t x1, int16_t y1, | |
| 94 | + uint16_t color) { | |
| 95 | + int16_t steep = abs(y1 - y0) > abs(x1 - x0); | |
| 96 | + if (steep) { | |
| 97 | + _swap_int16_t(x0, y0); | |
| 98 | + _swap_int16_t(x1, y1); | |
| 99 | + } | |
| 100 | + | |
| 101 | + if (x0 > x1) { | |
| 102 | + _swap_int16_t(x0, x1); | |
| 103 | + _swap_int16_t(y0, y1); | |
| 104 | + } | |
| 105 | + | |
| 106 | + int16_t dx, dy; | |
| 107 | + dx = x1 - x0; | |
| 108 | + dy = abs(y1 - y0); | |
| 109 | + | |
| 110 | + int16_t err = dx / 2; | |
| 111 | + int16_t ystep; | |
| 112 | + | |
| 113 | + if (y0 < y1) { | |
| 114 | + ystep = 1; | |
| 115 | + } else { | |
| 116 | + ystep = -1; | |
| 117 | + } | |
| 118 | + | |
| 119 | + for (; x0<=x1; x0++) { | |
| 120 | + if (steep) { | |
| 121 | + GFXwritePixel(myGFX, y0, x0, color); | |
| 122 | + } else { | |
| 123 | + GFXwritePixel(myGFX, x0, y0, color); | |
| 124 | + } | |
| 125 | + err -= dy; | |
| 126 | + if (err < 0) { | |
| 127 | + y0 += ystep; | |
| 128 | + err += dx; | |
| 129 | + } | |
| 130 | + } | |
| 131 | +} | |
| 132 | + | |
| 133 | +void GFXstartWrite(GFX* myGFX){ | |
| 134 | + // Overwrite in subclasses if desired! | |
| 135 | +} | |
| 136 | + | |
| 137 | +// the most basic function, set a single pixel | |
| 138 | +void GFXdrawPixel(GFX* myGFX, int16_t x, int16_t y, uint16_t color) { | |
| 139 | + if ((x < 0) || (x >= myGFX->_width) || (y < 0) || (y >= myGFX->_height)) | |
| 140 | + return; | |
| 141 | + | |
| 142 | + // check rotation, move pixel around if necessary | |
| 143 | + switch (GFXgetRotation(myGFX)) { | |
| 144 | + case 1: | |
| 145 | + _swap_int16_t(x, y); | |
| 146 | + x = myGFX->WIDTH - x - 1; | |
| 147 | + break; | |
| 148 | + case 2: | |
| 149 | + x = myGFX->WIDTH - x - 1; | |
| 150 | + y = myGFX->HEIGHT - y - 1; | |
| 151 | + break; | |
| 152 | + case 3: | |
| 153 | + _swap_int16_t(x, y); | |
| 154 | + y = myGFX->HEIGHT - y - 1; | |
| 155 | + break; | |
| 156 | + } | |
| 157 | + | |
| 158 | + // x is which column | |
| 159 | + switch (color) | |
| 160 | + { | |
| 161 | + case WHITE: buffer[x+ (y/8)*myGFX->WIDTH] |= (1 << (y&7)); break; | |
| 162 | + case BLACK: buffer[x+ (y/8)*myGFX->WIDTH] &= ~(1 << (y&7)); break; | |
| 163 | + case INVERSE: buffer[x+ (y/8)*myGFX->WIDTH] ^= (1 << (y&7)); break; | |
| 164 | + } | |
| 165 | + | |
| 166 | +} | |
| 167 | + | |
| 168 | +void GFXwritePixel(GFX* myGFX,int16_t x, int16_t y, uint16_t color){ | |
| 169 | + // Overwrite in subclasses if startWrite is defined! | |
| 170 | + GFXdrawPixel(myGFX, x, y, color); | |
| 171 | +} | |
| 172 | + | |
| 173 | +// (x,y) is topmost point; if unsure, calling function | |
| 174 | +// should sort endpoints or call writeLine() instead | |
| 175 | +void GFXwriteFastVLine(GFX* myGFX,int16_t x, int16_t y, | |
| 176 | + int16_t h, uint16_t color) { | |
| 177 | + // Overwrite in subclasses if startWrite is defined! | |
| 178 | + // Can be just writeLine(x, y, x, y+h-1, color); | |
| 179 | + // or writeFillRect(x, y, 1, h, color); | |
| 180 | + GFXdrawFastVLine(myGFX, x, y, h, color); | |
| 181 | +} | |
| 182 | + | |
| 183 | +// (x,y) is leftmost point; if unsure, calling function | |
| 184 | +// should sort endpoints or call writeLine() instead | |
| 185 | +void GFXwriteFastHLine(GFX* myGFX, int16_t x, int16_t y, | |
| 186 | + int16_t w, uint16_t color) { | |
| 187 | + // Overwrite in subclasses if startWrite is defined! | |
| 188 | + // Example: writeLine(x, y, x+w-1, y, color); | |
| 189 | + // or writeFillRect(x, y, w, 1, color); | |
| 190 | + GFXdrawFastHLine(myGFX,x, y, w, color); | |
| 191 | +} | |
| 192 | + | |
| 193 | +void GFXwriteFillRect(GFX* myGFX,int16_t x, int16_t y, int16_t w, int16_t h, | |
| 194 | + uint16_t color) { | |
| 195 | + // Overwrite in subclasses if desired! | |
| 196 | + GFXfillRect(myGFX,x,y,w,h,color); | |
| 197 | +} | |
| 198 | + | |
| 199 | +void GFXendWrite(GFX* myGFX){ | |
| 200 | + // Overwrite in subclasses if startWrite is defined! | |
| 201 | +} | |
| 202 | + | |
| 203 | +// (x,y) is topmost point; if unsure, calling function | |
| 204 | +// should sort endpoints or call drawLine() instead | |
| 205 | +void GFXdrawFastVLine(GFX* myGFX,int16_t x, int16_t y, | |
| 206 | + int16_t h, uint16_t color) { | |
| 207 | + // Update in subclasses if desired! | |
| 208 | + GFXwriteLine(myGFX,x, y, x, y+h-1, color); | |
| 209 | +} | |
| 210 | + | |
| 211 | +// (x,y) is leftmost point; if unsure, calling function | |
| 212 | +// should sort endpoints or call drawLine() instead | |
| 213 | +void GFXdrawFastHLine(GFX* myGFX,int16_t x, int16_t y, | |
| 214 | + int16_t w, uint16_t color) { | |
| 215 | + // Update in subclasses if desired! | |
| 216 | + GFXwriteLine(myGFX,x, y, x+w-1, y, color); | |
| 217 | +} | |
| 218 | + | |
| 219 | +void GFXfillRect(GFX* myGFX,int16_t x, int16_t y, int16_t w, int16_t h, | |
| 220 | + uint16_t color) { | |
| 221 | + // Update in subclasses if desired! | |
| 222 | + for (int16_t i=x; i<x+w; i++) { | |
| 223 | + GFXwriteFastVLine(myGFX,i, y, h, color); | |
| 224 | + } | |
| 225 | +} | |
| 226 | + | |
| 227 | +void GFXfillScreen(GFX* myGFX,uint16_t color) { | |
| 228 | + // Update in subclasses if desired! | |
| 229 | + GFXfillRect(myGFX,0, 0, myGFX->_width, myGFX->_height, color); | |
| 230 | +} | |
| 231 | + | |
| 232 | +void GFXdrawLine(GFX* myGFX,int16_t x0, int16_t y0, int16_t x1, int16_t y1, | |
| 233 | + uint16_t color) { | |
| 234 | + // Update in subclasses if desired! | |
| 235 | + if(x0 == x1){ | |
| 236 | + if(y0 > y1) _swap_int16_t(y0, y1); | |
| 237 | + GFXdrawFastVLine(myGFX,x0, y0, y1 - y0 + 1, color); | |
| 238 | + } else if(y0 == y1){ | |
| 239 | + if(x0 > x1) _swap_int16_t(x0, x1); | |
| 240 | + GFXdrawFastHLine(myGFX,x0, y0, x1 - x0 + 1, color); | |
| 241 | + } else { | |
| 242 | + GFXwriteLine(myGFX,x0, y0, x1, y1, color); | |
| 243 | + } | |
| 244 | +} | |
| 245 | + | |
| 246 | +// Draw a circle outline | |
| 247 | +void GFXdrawCircle(GFX* myGFX,int16_t x0, int16_t y0, int16_t r, | |
| 248 | + uint16_t color) { | |
| 249 | + int16_t f = 1 - r; | |
| 250 | + int16_t ddF_x = 1; | |
| 251 | + int16_t ddF_y = -2 * r; | |
| 252 | + int16_t x = 0; | |
| 253 | + int16_t y = r; | |
| 254 | + | |
| 255 | + GFXwritePixel(myGFX,x0 , y0+r, color); | |
| 256 | + GFXwritePixel(myGFX,x0 , y0-r, color); | |
| 257 | + GFXwritePixel(myGFX,x0+r, y0 , color); | |
| 258 | + GFXwritePixel(myGFX,x0-r, y0 , color); | |
| 259 | + | |
| 260 | + while (x<y) { | |
| 261 | + if (f >= 0) { | |
| 262 | + y--; | |
| 263 | + ddF_y += 2; | |
| 264 | + f += ddF_y; | |
| 265 | + } | |
| 266 | + x++; | |
| 267 | + ddF_x += 2; | |
| 268 | + f += ddF_x; | |
| 269 | + | |
| 270 | + GFXwritePixel(myGFX,x0 + x, y0 + y, color); | |
| 271 | + GFXwritePixel(myGFX,x0 - x, y0 + y, color); | |
| 272 | + GFXwritePixel(myGFX,x0 + x, y0 - y, color); | |
| 273 | + GFXwritePixel(myGFX,x0 - x, y0 - y, color); | |
| 274 | + GFXwritePixel(myGFX,x0 + y, y0 + x, color); | |
| 275 | + GFXwritePixel(myGFX,x0 - y, y0 + x, color); | |
| 276 | + GFXwritePixel(myGFX,x0 + y, y0 - x, color); | |
| 277 | + GFXwritePixel(myGFX,x0 - y, y0 - x, color); | |
| 278 | + } | |
| 279 | + | |
| 280 | +} | |
| 281 | + | |
| 282 | +void GFXdrawCircleHelper(GFX* myGFX,int16_t x0, int16_t y0, | |
| 283 | + int16_t r, uint8_t cornername, uint16_t color) { | |
| 284 | + int16_t f = 1 - r; | |
| 285 | + int16_t ddF_x = 1; | |
| 286 | + int16_t ddF_y = -2 * r; | |
| 287 | + int16_t x = 0; | |
| 288 | + int16_t y = r; | |
| 289 | + | |
| 290 | + while (x<y) { | |
| 291 | + if (f >= 0) { | |
| 292 | + y--; | |
| 293 | + ddF_y += 2; | |
| 294 | + f += ddF_y; | |
| 295 | + } | |
| 296 | + x++; | |
| 297 | + ddF_x += 2; | |
| 298 | + f += ddF_x; | |
| 299 | + if (cornername & 0x4) { | |
| 300 | + GFXwritePixel(myGFX, x0 + x, y0 + y, color); | |
| 301 | + GFXwritePixel(myGFX, x0 + y, y0 + x, color); | |
| 302 | + } | |
| 303 | + if (cornername & 0x2) { | |
| 304 | + GFXwritePixel(myGFX, x0 + x, y0 - y, color); | |
| 305 | + GFXwritePixel(myGFX, x0 + y, y0 - x, color); | |
| 306 | + } | |
| 307 | + if (cornername & 0x8) { | |
| 308 | + GFXwritePixel(myGFX, x0 - y, y0 + x, color); | |
| 309 | + GFXwritePixel(myGFX, x0 - x, y0 + y, color); | |
| 310 | + } | |
| 311 | + if (cornername & 0x1) { | |
| 312 | + GFXwritePixel(myGFX, x0 - y, y0 - x, color); | |
| 313 | + GFXwritePixel(myGFX, x0 - x, y0 - y, color); | |
| 314 | + } | |
| 315 | + } | |
| 316 | +} | |
| 317 | + | |
| 318 | +void GFXfillCircle(GFX* myGFX, int16_t x0, int16_t y0, int16_t r, | |
| 319 | + uint16_t color) { | |
| 320 | + | |
| 321 | + GFXwriteFastVLine(myGFX, x0, y0-r, 2*r+1, color); | |
| 322 | + GFXfillCircleHelper(myGFX, x0, y0, r, 3, 0, color); | |
| 323 | + | |
| 324 | +} | |
| 325 | + | |
| 326 | +// Used to do circles and roundrects | |
| 327 | +void GFXfillCircleHelper(GFX* myGFX, int16_t x0, int16_t y0, int16_t r, | |
| 328 | + uint8_t cornername, int16_t delta, uint16_t color) { | |
| 329 | + | |
| 330 | + int16_t f = 1 - r; | |
| 331 | + int16_t ddF_x = 1; | |
| 332 | + int16_t ddF_y = -2 * r; | |
| 333 | + int16_t x = 0; | |
| 334 | + int16_t y = r; | |
| 335 | + | |
| 336 | + while (x<y) { | |
| 337 | + if (f >= 0) { | |
| 338 | + y--; | |
| 339 | + ddF_y += 2; | |
| 340 | + f += ddF_y; | |
| 341 | + } | |
| 342 | + x++; | |
| 343 | + ddF_x += 2; | |
| 344 | + f += ddF_x; | |
| 345 | + | |
| 346 | + if (cornername & 0x1) { | |
| 347 | + GFXwriteFastVLine(myGFX, x0+x, y0-y, 2*y+1+delta, color); | |
| 348 | + GFXwriteFastVLine(myGFX, x0+y, y0-x, 2*x+1+delta, color); | |
| 349 | + } | |
| 350 | + if (cornername & 0x2) { | |
| 351 | + GFXwriteFastVLine(myGFX, x0-x, y0-y, 2*y+1+delta, color); | |
| 352 | + GFXwriteFastVLine(myGFX, x0-y, y0-x, 2*x+1+delta, color); | |
| 353 | + } | |
| 354 | + } | |
| 355 | +} | |
| 356 | + | |
| 357 | +// Draw a rectangle | |
| 358 | +void GFXdrawRect(GFX* myGFX, int16_t x, int16_t y, int16_t w, int16_t h, | |
| 359 | + uint16_t color) { | |
| 360 | + | |
| 361 | + GFXwriteFastHLine(myGFX, x, y, w, color); | |
| 362 | + GFXwriteFastHLine(myGFX, x, y+h-1, w, color); | |
| 363 | + GFXwriteFastVLine(myGFX, x, y, h, color); | |
| 364 | + GFXwriteFastVLine(myGFX, x+w-1, y, h, color); | |
| 365 | + | |
| 366 | +} | |
| 367 | + | |
| 368 | +// Draw a rounded rectangle | |
| 369 | +void GFXdrawRoundRect(GFX* myGFX, int16_t x, int16_t y, int16_t w, | |
| 370 | + int16_t h, int16_t r, uint16_t color) { | |
| 371 | + // smarter version | |
| 372 | + GFXwriteFastHLine(myGFX, x+r , y , w-2*r, color); // Top | |
| 373 | + GFXwriteFastHLine(myGFX, x+r , y+h-1, w-2*r, color); // Bottom | |
| 374 | + GFXwriteFastVLine(myGFX, x , y+r , h-2*r, color); // Left | |
| 375 | + GFXwriteFastVLine(myGFX, x+w-1, y+r , h-2*r, color); // Right | |
| 376 | + // draw four corners | |
| 377 | + GFXdrawCircleHelper(myGFX, x+r , y+r , r, 1, color); | |
| 378 | + GFXdrawCircleHelper(myGFX, x+w-r-1, y+r , r, 2, color); | |
| 379 | + GFXdrawCircleHelper(myGFX, x+w-r-1, y+h-r-1, r, 4, color); | |
| 380 | + GFXdrawCircleHelper(myGFX, x+r , y+h-r-1, r, 8, color); | |
| 381 | + | |
| 382 | +} | |
| 383 | + | |
| 384 | +// Fill a rounded rectangle | |
| 385 | +void GFXfillRoundRect(GFX* myGFX, int16_t x, int16_t y, int16_t w, | |
| 386 | + int16_t h, int16_t r, uint16_t color) { | |
| 387 | + // smarter version | |
| 388 | + GFXwriteFillRect(myGFX, x+r, y, w-2*r, h, color); | |
| 389 | + // draw four corners | |
| 390 | + GFXfillCircleHelper(myGFX, x+w-r-1, y+r, r, 1, h-2*r-1, color); | |
| 391 | + GFXfillCircleHelper(myGFX, x+r , y+r, r, 2, h-2*r-1, color); | |
| 392 | + | |
| 393 | +} | |
| 394 | + | |
| 395 | +// Draw a triangle | |
| 396 | +void GFXdrawTriangle(GFX* myGFX, int16_t x0, int16_t y0, | |
| 397 | + int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color) { | |
| 398 | + GFXdrawLine(myGFX, x0, y0, x1, y1, color); | |
| 399 | + GFXdrawLine(myGFX, x1, y1, x2, y2, color); | |
| 400 | + GFXdrawLine(myGFX, x2, y2, x0, y0, color); | |
| 401 | +} | |
| 402 | + | |
| 403 | +// Fill a triangle | |
| 404 | +void GFXfillTriangle(GFX* myGFX, int16_t x0, int16_t y0, | |
| 405 | + int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color) { | |
| 406 | + | |
| 407 | + int16_t a, b, y, last; | |
| 408 | + | |
| 409 | + // Sort coordinates by Y order (y2 >= y1 >= y0) | |
| 410 | + if (y0 > y1) { | |
| 411 | + _swap_int16_t(y0, y1); _swap_int16_t(x0, x1); | |
| 412 | + } | |
| 413 | + if (y1 > y2) { | |
| 414 | + _swap_int16_t(y2, y1); _swap_int16_t(x2, x1); | |
| 415 | + } | |
| 416 | + if (y0 > y1) { | |
| 417 | + _swap_int16_t(y0, y1); _swap_int16_t(x0, x1); | |
| 418 | + } | |
| 419 | + | |
| 420 | + | |
| 421 | + if(y0 == y2) { // Handle awkward all-on-same-line case as its own thing | |
| 422 | + a = b = x0; | |
| 423 | + if(x1 < a) a = x1; | |
| 424 | + else if(x1 > b) b = x1; | |
| 425 | + if(x2 < a) a = x2; | |
| 426 | + else if(x2 > b) b = x2; | |
| 427 | + GFXwriteFastHLine(myGFX, a, y0, b-a+1, color); | |
| 428 | + | |
| 429 | + return; | |
| 430 | + } | |
| 431 | + | |
| 432 | + int16_t | |
| 433 | + dx01 = x1 - x0, | |
| 434 | + dy01 = y1 - y0, | |
| 435 | + dx02 = x2 - x0, | |
| 436 | + dy02 = y2 - y0, | |
| 437 | + dx12 = x2 - x1, | |
| 438 | + dy12 = y2 - y1; | |
| 439 | + int32_t | |
| 440 | + sa = 0, | |
| 441 | + sb = 0; | |
| 442 | + | |
| 443 | + // For upper part of triangle, find scanline crossings for segments | |
| 444 | + // 0-1 and 0-2. If y1=y2 (flat-bottomed triangle), the scanline y1 | |
| 445 | + // is included here (and second loop will be skipped, avoiding a /0 | |
| 446 | + // error there), otherwise scanline y1 is skipped here and handled | |
| 447 | + // in the second loop...which also avoids a /0 error here if y0=y1 | |
| 448 | + // (flat-topped triangle). | |
| 449 | + if(y1 == y2) last = y1; // Include y1 scanline | |
| 450 | + else last = y1-1; // Skip it | |
| 451 | + | |
| 452 | + for(y=y0; y<=last; y++) { | |
| 453 | + a = x0 + sa / dy01; | |
| 454 | + b = x0 + sb / dy02; | |
| 455 | + sa += dx01; | |
| 456 | + sb += dx02; | |
| 457 | + /* longhand: | |
| 458 | + a = x0 + (x1 - x0) * (y - y0) / (y1 - y0); | |
| 459 | + b = x0 + (x2 - x0) * (y - y0) / (y2 - y0); | |
| 460 | + */ | |
| 461 | + if(a > b) _swap_int16_t(a,b); | |
| 462 | + GFXwriteFastHLine(myGFX,a, y, b-a+1, color); | |
| 463 | + } | |
| 464 | + | |
| 465 | + // For lower part of triangle, find scanline crossings for segments | |
| 466 | + // 0-2 and 1-2. This loop is skipped if y1=y2. | |
| 467 | + sa = dx12 * (y - y1); | |
| 468 | + sb = dx02 * (y - y0); | |
| 469 | + for(; y<=y2; y++) { | |
| 470 | + a = x1 + sa / dy12; | |
| 471 | + b = x0 + sb / dy02; | |
| 472 | + sa += dx12; | |
| 473 | + sb += dx02; | |
| 474 | + /* longhand: | |
| 475 | + a = x1 + (x2 - x1) * (y - y1) / (y2 - y1); | |
| 476 | + b = x0 + (x2 - x0) * (y - y0) / (y2 - y0); | |
| 477 | + */ | |
| 478 | + if(a > b) _swap_int16_t(a,b); | |
| 479 | + GFXwriteFastHLine(myGFX, a, y, b-a+1, color); | |
| 480 | + } | |
| 481 | + | |
| 482 | +} | |
| 483 | + | |
| 484 | +// BITMAP / XBITMAP / GRAYSCALE / RGB BITMAP FUNCTIONS --------------------- | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | +// Draw a RAM-resident 1-bit image at the specified (x,y) position, | |
| 489 | +// using the specified foreground (for set bits) and background (unset | |
| 490 | +// bits) colors. | |
| 491 | +void GFXdrawBitmap(GFX* myGFX, int16_t x, int16_t y, | |
| 492 | + uint8_t *bitmap, int16_t w, int16_t h, uint16_t color, uint16_t bg) { | |
| 493 | + | |
| 494 | + int16_t byteWidth = (w + 7) / 8; // Bitmap scanline pad = whole byte | |
| 495 | + uint8_t byte = 0; | |
| 496 | + | |
| 497 | + startWrite(); | |
| 498 | + for(int16_t j=0; j<h; j++, y++) { | |
| 499 | + for(int16_t i=0; i<w; i++ ) { | |
| 500 | + if(i & 7) byte <<= 1; | |
| 501 | + else byte = bitmap[j * byteWidth + i / 8]; | |
| 502 | + GFXwritePixel(myGFX, x+i, y, (byte & 0x80) ? color : bg); | |
| 503 | + } | |
| 504 | + } | |
| 505 | + endWrite(); | |
| 506 | +} | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | +// TEXT- AND CHARACTER-HANDLING FUNCTIONS ---------------------------------- | |
| 511 | + | |
| 512 | +// Draw a character | |
| 513 | +void GFXdrawChar(GFX* myGFX, int16_t x, int16_t y, unsigned char c, | |
| 514 | + uint16_t color, uint16_t bg, uint8_t size) { | |
| 515 | + | |
| 516 | + if(!myGFX->gfxFont) { // 'Classic' built-in font | |
| 517 | + | |
| 518 | + if((x >= myGFX->_width) || // Clip right | |
| 519 | + (y >= myGFX->_height) || // Clip bottom | |
| 520 | + ((x + 6 * size - 1) < 0) || // Clip left | |
| 521 | + ((y + 8 * size - 1) < 0)) // Clip top | |
| 522 | + return; | |
| 523 | + | |
| 524 | + if(!myGFX->_cp437 && (c >= 176)) c++; // Handle 'classic' charset behavior | |
| 525 | + | |
| 526 | + | |
| 527 | + for(int8_t i=0; i<5; i++ ) { // Char bitmap = 5 columns | |
| 528 | + uint8_t line = pgm_read_byte(&standardGFXfont[c * 5 + i]); | |
| 529 | + for(int8_t j=0; j<8; j++, line >>= 1) { | |
| 530 | + if(line & 1) { | |
| 531 | + if(size == 1) | |
| 532 | + GFXwritePixel(myGFX, x+i, y+j, color); | |
| 533 | + else | |
| 534 | + GFXwriteFillRect(myGFX, x+i*size, y+j*size, size, size, color); | |
| 535 | + } else if(bg != color) { | |
| 536 | + if(size == 1) | |
| 537 | + GFXwritePixel(myGFX, x+i, y+j, bg); | |
| 538 | + else | |
| 539 | + GFXwriteFillRect(myGFX, x+i*size, y+j*size, size, size, bg); | |
| 540 | + } | |
| 541 | + } | |
| 542 | + } | |
| 543 | + if(bg != color) { // If opaque, draw vertical line for last column | |
| 544 | + if(size == 1) GFXwriteFastVLine(myGFX, x+5, y, 8, bg); | |
| 545 | + else GFXwriteFillRect(myGFX, x+5*size, y, size, 8*size, bg); | |
| 546 | + } | |
| 547 | + | |
| 548 | + | |
| 549 | + } else { // Custom font | |
| 550 | + | |
| 551 | + // Character is assumed previously filtered by write() to eliminate | |
| 552 | + // newlines, returns, non-printable characters, etc. Calling | |
| 553 | + // drawChar() directly with 'bad' characters of font may cause mayhem! | |
| 554 | + | |
| 555 | + c -= (uint8_t)pgm_read_byte(&myGFX->gfxFont->first); | |
| 556 | + GFXglyph *glyph = &(((GFXglyph *)pgm_read_pointer(&myGFX->gfxFont->glyph))[c]); | |
| 557 | + uint8_t *bitmap = (uint8_t *)pgm_read_pointer(&myGFX->gfxFont->bitmap); | |
| 558 | + | |
| 559 | + uint16_t bo = pgm_read_word(&glyph->bitmapOffset); | |
| 560 | + uint8_t w = pgm_read_byte(&glyph->width), | |
| 561 | + h = pgm_read_byte(&glyph->height); | |
| 562 | + int8_t xo = pgm_read_byte(&glyph->xOffset), | |
| 563 | + yo = pgm_read_byte(&glyph->yOffset); | |
| 564 | + uint8_t xx, yy, bits = 0, bit = 0; | |
| 565 | + int16_t xo16 = 0, yo16 = 0; | |
| 566 | + | |
| 567 | + if(size > 1) { | |
| 568 | + xo16 = xo; | |
| 569 | + yo16 = yo; | |
| 570 | + } | |
| 571 | + | |
| 572 | + // Todo: Add character clipping here | |
| 573 | + | |
| 574 | + // NOTE: THERE IS NO 'BACKGROUND' COLOR OPTION ON CUSTOM FONTS. | |
| 575 | + // THIS IS ON PURPOSE AND BY DESIGN. The background color feature | |
| 576 | + // has typically been used with the 'classic' font to overwrite old | |
| 577 | + // screen contents with new data. This ONLY works because the | |
| 578 | + // characters are a uniform size; it's not a sensible thing to do with | |
| 579 | + // proportionally-spaced fonts with glyphs of varying sizes (and that | |
| 580 | + // may overlap). To replace previously-drawn text when using a custom | |
| 581 | + // font, use the getTextBounds() function to determine the smallest | |
| 582 | + // rectangle encompassing a string, erase the area with fillRect(), | |
| 583 | + // then draw new text. This WILL infortunately 'blink' the text, but | |
| 584 | + // is unavoidable. Drawing 'background' pixels will NOT fix this, | |
| 585 | + // only creates a new set of problems. Have an idea to work around | |
| 586 | + // this (a canvas object type for MCUs that can afford the RAM and | |
| 587 | + // displays supporting setAddrWindow() and pushColors()), but haven't | |
| 588 | + // implemented this yet. | |
| 589 | + | |
| 590 | + | |
| 591 | + for(yy=0; yy<h; yy++) { | |
| 592 | + for(xx=0; xx<w; xx++) { | |
| 593 | + if(!(bit++ & 7)) { | |
| 594 | + bits = pgm_read_byte(&bitmap[bo++]); | |
| 595 | + } | |
| 596 | + if(bits & 0x80) { | |
| 597 | + if(size == 1) { | |
| 598 | + GFXwritePixel(myGFX, x+xo+xx, y+yo+yy, color); | |
| 599 | + } else { | |
| 600 | + GFXwriteFillRect(myGFX, x+(xo16+xx)*size, y+(yo16+yy)*size, | |
| 601 | + size, size, color); | |
| 602 | + } | |
| 603 | + } | |
| 604 | + bits <<= 1; | |
| 605 | + } | |
| 606 | + } | |
| 607 | + | |
| 608 | + | |
| 609 | + } // End classic vs custom font | |
| 610 | +} | |
| 611 | + | |
| 612 | + | |
| 613 | +void GFXwrite(GFX* myGFX, uint8_t c) { | |
| 614 | + | |
| 615 | + if(!myGFX->gfxFont) { // 'Classic' built-in font | |
| 616 | + | |
| 617 | + if(c == '\n') { // Newline? | |
| 618 | + myGFX->cursor_x = 0; // Reset x to zero, | |
| 619 | + myGFX->cursor_y += myGFX->textsize * 8; // advance y one line | |
| 620 | + } else if(c != '\r') { // Ignore carriage returns | |
| 621 | + if(myGFX->wrap && ((myGFX->cursor_x + myGFX->textsize * 6) > myGFX->_width)) { // Off right? | |
| 622 | + myGFX->cursor_x = 0; // Reset x to zero, | |
| 623 | + myGFX->cursor_y += myGFX->textsize * 8; // advance y one line | |
| 624 | + } | |
| 625 | + GFXdrawChar(myGFX, myGFX->cursor_x, myGFX->cursor_y, c, myGFX->textcolor, myGFX->textbgcolor, myGFX->textsize); | |
| 626 | + myGFX->cursor_x += myGFX->textsize * 6; // Advance x one char | |
| 627 | + } | |
| 628 | + | |
| 629 | + } else { // Custom font | |
| 630 | + | |
| 631 | + if(c == '\n') { | |
| 632 | + myGFX->cursor_x = 0; | |
| 633 | + myGFX->cursor_y += (int16_t)myGFX->textsize * | |
| 634 | + (uint8_t)pgm_read_byte(&myGFX->gfxFont->yAdvance); | |
| 635 | + } else if(c != '\r') { | |
| 636 | + uint8_t first = pgm_read_byte(&myGFX->gfxFont->first); | |
| 637 | + if((c >= first) && (c <= (uint8_t)pgm_read_byte(&myGFX->gfxFont->last))) { | |
| 638 | + GFXglyph *glyph = &(((GFXglyph *)pgm_read_pointer( | |
| 639 | + &myGFX->gfxFont->glyph))[c - first]); | |
| 640 | + uint8_t w = pgm_read_byte(&glyph->width), | |
| 641 | + h = pgm_read_byte(&glyph->height); | |
| 642 | + if((w > 0) && (h > 0)) { // Is there an associated bitmap? | |
| 643 | + int16_t xo = (int8_t)pgm_read_byte(&glyph->xOffset); // sic | |
| 644 | + if(myGFX->wrap && ((myGFX->cursor_x + myGFX->textsize * (xo + w)) > myGFX->_width)) { | |
| 645 | + myGFX->cursor_x = 0; | |
| 646 | + myGFX->cursor_y += (int16_t)myGFX->textsize * | |
| 647 | + (uint8_t)pgm_read_byte(&myGFX->gfxFont->yAdvance); | |
| 648 | + } | |
| 649 | + GFXdrawChar(myGFX, myGFX->cursor_x, myGFX->cursor_y, c, myGFX->textcolor, myGFX->textbgcolor, myGFX->textsize); | |
| 650 | + } | |
| 651 | + myGFX->cursor_x += (uint8_t)pgm_read_byte(&glyph->xAdvance) * (int16_t)myGFX->textsize; | |
| 652 | + } | |
| 653 | + } | |
| 654 | + | |
| 655 | + } | |
| 656 | + | |
| 657 | +} | |
| 658 | + | |
| 659 | +void GFXsetCursor(GFX* myGFX, int16_t x, int16_t y) { | |
| 660 | + myGFX->cursor_x = x; | |
| 661 | + myGFX->cursor_y = y; | |
| 662 | +} | |
| 663 | + | |
| 664 | +int16_t GFXgetCursorX(GFX* myGFX) | |
| 665 | +{ | |
| 666 | + return myGFX->cursor_x; | |
| 667 | +} | |
| 668 | + | |
| 669 | +int16_t GFXgetCursorY(GFX* myGFX) | |
| 670 | +{ | |
| 671 | + return myGFX->cursor_y; | |
| 672 | +} | |
| 673 | + | |
| 674 | +void GFXsetTextSize(GFX* myGFX, uint8_t s) { | |
| 675 | + myGFX->textsize = (s > 0) ? s : 1; | |
| 676 | +} | |
| 677 | + | |
| 678 | +void GFXsetTextColor(GFX* myGFX, uint16_t c, uint16_t b) { | |
| 679 | + myGFX->textcolor = c; | |
| 680 | + myGFX->textbgcolor = b; | |
| 681 | +} | |
| 682 | + | |
| 683 | +void GFXsetTextWrap(GFX* myGFX, uint8_t w) { | |
| 684 | + myGFX->wrap = w; | |
| 685 | +} | |
| 686 | + | |
| 687 | +uint8_t GFXgetRotation(GFX* myGFX) { | |
| 688 | + return myGFX->rotation; | |
| 689 | +} | |
| 690 | + | |
| 691 | +void GFXsetRotation(GFX* myGFX, uint8_t x) { | |
| 692 | + myGFX->rotation = (x & 3); | |
| 693 | + switch(myGFX->rotation) { | |
| 694 | + case 0: | |
| 695 | + case 2: | |
| 696 | + myGFX->_width = myGFX->WIDTH; | |
| 697 | + myGFX->_height = myGFX->HEIGHT; | |
| 698 | + break; | |
| 699 | + case 1: | |
| 700 | + case 3: | |
| 701 | + myGFX->_width = myGFX->HEIGHT; | |
| 702 | + myGFX->_height = myGFX->WIDTH; | |
| 703 | + break; | |
| 704 | + } | |
| 705 | +} | |
| 706 | + | |
| 707 | +// Enable (or disable) Code Page 437-compatible charset. | |
| 708 | +// There was an error in glcdfont.c for the longest time -- one character | |
| 709 | +// (#176, the 'light shade' block) was missing -- this threw off the index | |
| 710 | +// of every character that followed it. But a TON of code has been written | |
| 711 | +// with the erroneous character indices. By default, the library uses the | |
| 712 | +// original 'wrong' behavior and old sketches will still work. Pass 'true' | |
| 713 | +// to this function to use correct CP437 character values in your code. | |
| 714 | +void GFXcp437(GFX* myGFX, uint8_t x) { | |
| 715 | + myGFX->_cp437 = x; | |
| 716 | +} | |
| 717 | + | |
| 718 | +void GFXsetFont(GFX* myGFX, const GFXfont *f) { | |
| 719 | + if(f) { // Font struct pointer passed in? | |
| 720 | + if(!myGFX->gfxFont) { // And no current font struct? | |
| 721 | + // Switching from classic to new font behavior. | |
| 722 | + // Move cursor pos down 6 pixels so it's on baseline. | |
| 723 | + myGFX->cursor_y += 6; | |
| 724 | + } | |
| 725 | + } else if(myGFX->gfxFont) { // NULL passed. Current font struct defined? | |
| 726 | + // Switching from new to classic font behavior. | |
| 727 | + // Move cursor pos up 6 pixels so it's at top-left of char. | |
| 728 | + myGFX->cursor_y -= 6; | |
| 729 | + } | |
| 730 | + myGFX->gfxFont = (GFXfont *)f; | |
| 731 | +} | |
| 732 | + | |
| 733 | +// Broke this out as it's used by both the PROGMEM- and RAM-resident | |
| 734 | +// getTextBounds() functions. | |
| 735 | +void GFXcharBounds(GFX* myGFX, char c, int16_t *x, int16_t *y, | |
| 736 | + int16_t *minx, int16_t *miny, int16_t *maxx, int16_t *maxy) { | |
| 737 | + | |
| 738 | + if(myGFX->gfxFont) { | |
| 739 | + | |
| 740 | + if(c == '\n') { // Newline? | |
| 741 | + *x = 0; // Reset x to zero, advance y by one line | |
| 742 | + *y += myGFX->textsize * (uint8_t)pgm_read_byte(&myGFX->gfxFont->yAdvance); | |
| 743 | + } else if(c != '\r') { // Not a carriage return; is normal char | |
| 744 | + uint8_t first = pgm_read_byte(&myGFX->gfxFont->first), | |
| 745 | + last = pgm_read_byte(&myGFX->gfxFont->last); | |
| 746 | + if((c >= first) && (c <= last)) { // Char present in this font? | |
| 747 | + GFXglyph *glyph = &(((GFXglyph *)pgm_read_pointer( | |
| 748 | + &myGFX->gfxFont->glyph))[c - first]); | |
| 749 | + uint8_t gw = pgm_read_byte(&glyph->width), | |
| 750 | + gh = pgm_read_byte(&glyph->height), | |
| 751 | + xa = pgm_read_byte(&glyph->xAdvance); | |
| 752 | + int8_t xo = pgm_read_byte(&glyph->xOffset), | |
| 753 | + yo = pgm_read_byte(&glyph->yOffset); | |
| 754 | + if(myGFX->wrap && ((*x+(((int16_t)xo+gw)*myGFX->textsize)) > myGFX->_width)) { | |
| 755 | + *x = 0; // Reset x to zero, advance y by one line | |
| 756 | + *y += myGFX->textsize * (uint8_t)pgm_read_byte(&myGFX->gfxFont->yAdvance); | |
| 757 | + } | |
| 758 | + int16_t ts = (int16_t)myGFX->textsize, | |
| 759 | + x1 = *x + xo * ts, | |
| 760 | + y1 = *y + yo * ts, | |
| 761 | + x2 = x1 + gw * ts - 1, | |
| 762 | + y2 = y1 + gh * ts - 1; | |
| 763 | + if(x1 < *minx) *minx = x1; | |
| 764 | + if(y1 < *miny) *miny = y1; | |
| 765 | + if(x2 > *maxx) *maxx = x2; | |
| 766 | + if(y2 > *maxy) *maxy = y2; | |
| 767 | + *x += xa * ts; | |
| 768 | + } | |
| 769 | + } | |
| 770 | + | |
| 771 | + } else { // Default font | |
| 772 | + | |
| 773 | + if(c == '\n') { // Newline? | |
| 774 | + *x = 0; // Reset x to zero, | |
| 775 | + *y += myGFX->textsize * 8; // advance y one line | |
| 776 | + // min/max x/y unchaged -- that waits for next 'normal' character | |
| 777 | + } else if(c != '\r') { // Normal char; ignore carriage returns | |
| 778 | + if(myGFX->wrap && ((*x + myGFX->textsize * 6) > myGFX->_width)) { // Off right? | |
| 779 | + *x = 0; // Reset x to zero, | |
| 780 | + *y += myGFX->textsize * 8; // advance y one line | |
| 781 | + } | |
| 782 | + int x2 = *x + myGFX->textsize * 6 - 1, // Lower-right pixel of char | |
| 783 | + y2 = *y + myGFX->textsize * 8 - 1; | |
| 784 | + if(x2 > *maxx) *maxx = x2; // Track max x, y | |
| 785 | + if(y2 > *maxy) *maxy = y2; | |
| 786 | + if(*x < *minx) *minx = *x; // Track min x, y | |
| 787 | + if(*y < *miny) *miny = *y; | |
| 788 | + *x += myGFX->textsize * 6; // Advance x one char | |
| 789 | + } | |
| 790 | + } | |
| 791 | +} | |
| 792 | + | |
| 793 | +// Pass string and a cursor position, returns UL corner and W,H. | |
| 794 | +void GFXgetTextBounds(GFX* myGFX, char *str, int16_t x, int16_t y, | |
| 795 | + int16_t *x1, int16_t *y1, uint16_t *w, uint16_t *h) { | |
| 796 | + uint8_t c; // Current character | |
| 797 | + | |
| 798 | + *x1 = x; | |
| 799 | + *y1 = y; | |
| 800 | + *w = *h = 0; | |
| 801 | + | |
| 802 | + int16_t minx = myGFX->_width, miny = myGFX->_height, maxx = -1, maxy = -1; | |
| 803 | + | |
| 804 | + while((c = *str++)) | |
| 805 | + GFXcharBounds(myGFX, c, &x, &y, &minx, &miny, &maxx, &maxy); | |
| 806 | + | |
| 807 | + if(maxx >= minx) { | |
| 808 | + *x1 = minx; | |
| 809 | + *w = maxx - minx + 1; | |
| 810 | + } | |
| 811 | + if(maxy >= miny) { | |
| 812 | + *y1 = miny; | |
| 813 | + *h = maxy - miny + 1; | |
| 814 | + } | |
| 815 | +} | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | +// Return the size of the display (per current rotation) | |
| 820 | +int16_t GFXwidth(GFX* myGFX ) { | |
| 821 | + return myGFX->_width; | |
| 822 | +} | |
| 823 | + | |
| 824 | +int16_t GFXheight(GFX* myGFX) { | |
| 825 | + return myGFX->_height; | |
| 826 | +} | |
| 827 | + | |
| 828 | +void GFXinvertDisplay(GFX* myGFX, uint8_t i) { | |
| 829 | + // Do nothing, must be subclassed if supported by hardware | |
| 830 | +} | |
| 831 | + | |
| 832 | +uint8_t pitches[24] = | |
| 833 | +{ | |
| 834 | + 'C', ' ', | |
| 835 | + 'C', '#', | |
| 836 | + 'D', ' ', | |
| 837 | + 'D', '#', | |
| 838 | + 'E', ' ', | |
| 839 | + 'F', ' ', | |
| 840 | + 'F', '#', | |
| 841 | + 'G', ' ', | |
| 842 | + 'G', '#', | |
| 843 | + 'A', ' ', | |
| 844 | + 'A', '#', | |
| 845 | + 'B', ' ' | |
| 846 | +}; | |
| 847 | + | |
| 848 | +int OLEDparseInt(char* buffer, uint32_t myNumber, uint8_t numDigits) | |
| 849 | +{ | |
| 850 | + for (int i = 0; i < numDigits; i++) | |
| 851 | + { | |
| 852 | + int whichPlace = (uint32_t)(powf(10.0f,(numDigits - 1) - i)); | |
| 853 | + int thisDigit = (myNumber / whichPlace); | |
| 854 | + buffer[i] = thisDigit + 48; | |
| 855 | + myNumber -= thisDigit * whichPlace; | |
| 856 | + } | |
| 857 | + | |
| 858 | + return numDigits; | |
| 859 | +} | |
| 860 | + | |
| 861 | +int OLEDparsePitch(char* buffer, float midi) | |
| 862 | +{ | |
| 863 | + int pclass, octave, note, neg = 0; float offset; | |
| 864 | + | |
| 865 | + note = (int)midi; | |
| 866 | + offset = midi - note; | |
| 867 | + | |
| 868 | + if ((midi + 0.5f) > (note+1)) | |
| 869 | + { | |
| 870 | + note += 1; | |
| 871 | + offset = (1.0f - offset) + 0.01f; | |
| 872 | + neg = 1; | |
| 873 | + } | |
| 874 | + | |
| 875 | + pclass = (note % 12); | |
| 876 | + octave = (int)(note / 12) - 1; | |
| 877 | + | |
| 878 | + int idx = 0; | |
| 879 | + | |
| 880 | + buffer[idx++] = pitches[pclass*2]; | |
| 881 | + buffer[idx++] = pitches[pclass*2+1]; | |
| 882 | + | |
| 883 | + OLEDparseInt(&buffer[idx++], octave, 1); | |
| 884 | + | |
| 885 | + buffer[idx++] = ' '; | |
| 886 | + | |
| 887 | + if (neg == 1) | |
| 888 | + buffer[idx++] = '-'; | |
| 889 | + else | |
| 890 | + buffer[idx++] = '+'; | |
| 891 | + | |
| 892 | + OLEDparseInt(&buffer[idx], (uint32_t) (offset * 100.0f), 2); | |
| 893 | + | |
| 894 | + return idx+2; | |
| 895 | +} | |
| 896 | + | |
| 897 | +int OLEDparsePitchClass(char* buffer, float midi) | |
| 898 | +{ | |
| 899 | + int pclass, note; | |
| 900 | + float offset; | |
| 901 | + | |
| 902 | + note = (int)midi; | |
| 903 | + offset = midi - note; | |
| 904 | + | |
| 905 | + if ((midi + 0.5f) > (note+1)) | |
| 906 | + { | |
| 907 | + note += 1; | |
| 908 | + offset = (1.0f - offset) + 0.01f; | |
| 909 | + } | |
| 910 | + | |
| 911 | + pclass = (note % 12); | |
| 912 | + | |
| 913 | + int idx = 0; | |
| 914 | + | |
| 915 | + buffer[idx++] = pitches[pclass*2]; | |
| 916 | + buffer[idx++] = pitches[pclass*2+1]; | |
| 917 | + | |
| 918 | + return idx; | |
| 919 | +} | |
| 920 | + | |
| 921 | +int OLEDparseFixedFloat(char* buffer, float input, uint8_t numDigits, uint8_t numDecimal) | |
| 922 | +{ | |
| 923 | + float power = powf(10.0f, numDecimal); | |
| 924 | + float f = ((float)(int)(input * power + 0.5f)) / power; | |
| 925 | + | |
| 926 | + int nonzeroHasHappened = 0, decimalHasHappened = 0; | |
| 927 | + | |
| 928 | + int myNumber = (int)(f * power); | |
| 929 | + | |
| 930 | + int idx = 0, i = 0; | |
| 931 | + | |
| 932 | + if (myNumber < 0) | |
| 933 | + { | |
| 934 | + myNumber *= -1; | |
| 935 | + buffer[idx++] = '-'; | |
| 936 | + i++; | |
| 937 | + } | |
| 938 | + | |
| 939 | + while (i < numDigits) | |
| 940 | + { | |
| 941 | + if ((decimalHasHappened == 0) && ((numDigits-i) == numDecimal)) | |
| 942 | + { | |
| 943 | + if (nonzeroHasHappened == 0) | |
| 944 | + { | |
| 945 | + idx++; //get past the negative if there is one - this is hacky should figure out how to do it right | |
| 946 | + buffer[idx-1] = '0'; | |
| 947 | + nonzeroHasHappened = 1; | |
| 948 | + } | |
| 949 | + | |
| 950 | + buffer[idx++] = '.'; | |
| 951 | + decimalHasHappened = 1; | |
| 952 | + } | |
| 953 | + else | |
| 954 | + { | |
| 955 | + | |
| 956 | + int whichPlace = (uint32_t) powf(10.0f,(numDigits - 1 - i)); | |
| 957 | + int thisDigit = (myNumber / whichPlace); | |
| 958 | + | |
| 959 | + if (nonzeroHasHappened == 0) | |
| 960 | + { | |
| 961 | + if (thisDigit > 0) | |
| 962 | + { | |
| 963 | + buffer[idx++] = thisDigit + 48; | |
| 964 | + nonzeroHasHappened = 1; | |
| 965 | + } | |
| 966 | + else | |
| 967 | + { | |
| 968 | + buffer[idx++] = ' '; | |
| 969 | + } | |
| 970 | + } | |
| 971 | + else | |
| 972 | + { | |
| 973 | + buffer[idx++] = thisDigit + 48; | |
| 974 | + } | |
| 975 | + | |
| 976 | + myNumber -= thisDigit * whichPlace; | |
| 977 | + | |
| 978 | + i++; | |
| 979 | + } | |
| 980 | + } | |
| 981 | + | |
| 982 | + return idx; | |
| 983 | +} | |
| @@ -0,0 +1,281 @@ | ||
| 1 | +/* | |
| 2 | + * gfx_font.c | |
| 3 | + * | |
| 4 | + * Created on: Jul 8, 2018 | |
| 5 | + * Author: jeffsnyder | |
| 6 | + */ | |
| 7 | + | |
| 8 | + | |
| 9 | +// This is the 'classic' fixed-space bitmap font for Adafruit_GFX since 1.0. | |
| 10 | +// See gfxfont.h for newer custom bitmap font info. | |
| 11 | + | |
| 12 | +#ifndef FONT5X7_H | |
| 13 | +#define FONT5X7_H | |
| 14 | + | |
| 15 | + | |
| 16 | + #define PROGMEM | |
| 17 | + | |
| 18 | + | |
| 19 | +// Standard ASCII 5x7 font | |
| 20 | + | |
| 21 | +static const unsigned char standardGFXfont[] = { | |
| 22 | + 0x00, 0x00, 0x00, 0x00, 0x00, | |
| 23 | + 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, | |
| 24 | + 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, | |
| 25 | + 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, | |
| 26 | + 0x18, 0x3C, 0x7E, 0x3C, 0x18, | |
| 27 | + 0x1C, 0x57, 0x7D, 0x57, 0x1C, | |
| 28 | + 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, | |
| 29 | + 0x00, 0x18, 0x3C, 0x18, 0x00, | |
| 30 | + 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, | |
| 31 | + 0x00, 0x18, 0x24, 0x18, 0x00, | |
| 32 | + 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, | |
| 33 | + 0x30, 0x48, 0x3A, 0x06, 0x0E, | |
| 34 | + 0x26, 0x29, 0x79, 0x29, 0x26, | |
| 35 | + 0x40, 0x7F, 0x05, 0x05, 0x07, | |
| 36 | + 0x40, 0x7F, 0x05, 0x25, 0x3F, | |
| 37 | + 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, | |
| 38 | + 0x7F, 0x3E, 0x1C, 0x1C, 0x08, | |
| 39 | + 0x08, 0x1C, 0x1C, 0x3E, 0x7F, | |
| 40 | + 0x14, 0x22, 0x7F, 0x22, 0x14, | |
| 41 | + 0x5F, 0x5F, 0x00, 0x5F, 0x5F, | |
| 42 | + 0x06, 0x09, 0x7F, 0x01, 0x7F, | |
| 43 | + 0x00, 0x66, 0x89, 0x95, 0x6A, | |
| 44 | + 0x60, 0x60, 0x60, 0x60, 0x60, | |
| 45 | + 0x94, 0xA2, 0xFF, 0xA2, 0x94, | |
| 46 | + 0x08, 0x04, 0x7E, 0x04, 0x08, | |
| 47 | + 0x10, 0x20, 0x7E, 0x20, 0x10, | |
| 48 | + 0x08, 0x08, 0x2A, 0x1C, 0x08, | |
| 49 | + 0x08, 0x1C, 0x2A, 0x08, 0x08, | |
| 50 | + 0x1E, 0x10, 0x10, 0x10, 0x10, | |
| 51 | + 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, | |
| 52 | + 0x30, 0x38, 0x3E, 0x38, 0x30, | |
| 53 | + 0x06, 0x0E, 0x3E, 0x0E, 0x06, | |
| 54 | + 0x00, 0x00, 0x00, 0x00, 0x00, | |
| 55 | + 0x00, 0x00, 0x5F, 0x00, 0x00, | |
| 56 | + 0x00, 0x07, 0x00, 0x07, 0x00, | |
| 57 | + 0x14, 0x7F, 0x14, 0x7F, 0x14, | |
| 58 | + 0x24, 0x2A, 0x7F, 0x2A, 0x12, | |
| 59 | + 0x23, 0x13, 0x08, 0x64, 0x62, | |
| 60 | + 0x36, 0x49, 0x56, 0x20, 0x50, | |
| 61 | + 0x00, 0x08, 0x07, 0x03, 0x00, | |
| 62 | + 0x00, 0x1C, 0x22, 0x41, 0x00, | |
| 63 | + 0x00, 0x41, 0x22, 0x1C, 0x00, | |
| 64 | + 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, | |
| 65 | + 0x08, 0x08, 0x3E, 0x08, 0x08, | |
| 66 | + 0x00, 0x80, 0x70, 0x30, 0x00, | |
| 67 | + 0x08, 0x08, 0x08, 0x08, 0x08, | |
| 68 | + 0x00, 0x00, 0x60, 0x60, 0x00, | |
| 69 | + 0x20, 0x10, 0x08, 0x04, 0x02, | |
| 70 | + 0x3E, 0x51, 0x49, 0x45, 0x3E, | |
| 71 | + 0x00, 0x42, 0x7F, 0x40, 0x00, | |
| 72 | + 0x72, 0x49, 0x49, 0x49, 0x46, | |
| 73 | + 0x21, 0x41, 0x49, 0x4D, 0x33, | |
| 74 | + 0x18, 0x14, 0x12, 0x7F, 0x10, | |
| 75 | + 0x27, 0x45, 0x45, 0x45, 0x39, | |
| 76 | + 0x3C, 0x4A, 0x49, 0x49, 0x31, | |
| 77 | + 0x41, 0x21, 0x11, 0x09, 0x07, | |
| 78 | + 0x36, 0x49, 0x49, 0x49, 0x36, | |
| 79 | + 0x46, 0x49, 0x49, 0x29, 0x1E, | |
| 80 | + 0x00, 0x00, 0x14, 0x00, 0x00, | |
| 81 | + 0x00, 0x40, 0x34, 0x00, 0x00, | |
| 82 | + 0x00, 0x08, 0x14, 0x22, 0x41, | |
| 83 | + 0x14, 0x14, 0x14, 0x14, 0x14, | |
| 84 | + 0x00, 0x41, 0x22, 0x14, 0x08, | |
| 85 | + 0x02, 0x01, 0x59, 0x09, 0x06, | |
| 86 | + 0x3E, 0x41, 0x5D, 0x59, 0x4E, | |
| 87 | + 0x7C, 0x12, 0x11, 0x12, 0x7C, | |
| 88 | + 0x7F, 0x49, 0x49, 0x49, 0x36, | |
| 89 | + 0x3E, 0x41, 0x41, 0x41, 0x22, | |
| 90 | + 0x7F, 0x41, 0x41, 0x41, 0x3E, | |
| 91 | + 0x7F, 0x49, 0x49, 0x49, 0x41, | |
| 92 | + 0x7F, 0x09, 0x09, 0x09, 0x01, | |
| 93 | + 0x3E, 0x41, 0x41, 0x51, 0x73, | |
| 94 | + 0x7F, 0x08, 0x08, 0x08, 0x7F, | |
| 95 | + 0x00, 0x41, 0x7F, 0x41, 0x00, | |
| 96 | + 0x20, 0x40, 0x41, 0x3F, 0x01, | |
| 97 | + 0x7F, 0x08, 0x14, 0x22, 0x41, | |
| 98 | + 0x7F, 0x40, 0x40, 0x40, 0x40, | |
| 99 | + 0x7F, 0x02, 0x1C, 0x02, 0x7F, | |
| 100 | + 0x7F, 0x04, 0x08, 0x10, 0x7F, | |
| 101 | + 0x3E, 0x41, 0x41, 0x41, 0x3E, | |
| 102 | + 0x7F, 0x09, 0x09, 0x09, 0x06, | |
| 103 | + 0x3E, 0x41, 0x51, 0x21, 0x5E, | |
| 104 | + 0x7F, 0x09, 0x19, 0x29, 0x46, | |
| 105 | + 0x26, 0x49, 0x49, 0x49, 0x32, | |
| 106 | + 0x03, 0x01, 0x7F, 0x01, 0x03, | |
| 107 | + 0x3F, 0x40, 0x40, 0x40, 0x3F, | |
| 108 | + 0x1F, 0x20, 0x40, 0x20, 0x1F, | |
| 109 | + 0x3F, 0x40, 0x38, 0x40, 0x3F, | |
| 110 | + 0x63, 0x14, 0x08, 0x14, 0x63, | |
| 111 | + 0x03, 0x04, 0x78, 0x04, 0x03, | |
| 112 | + 0x61, 0x59, 0x49, 0x4D, 0x43, | |
| 113 | + 0x00, 0x7F, 0x41, 0x41, 0x41, | |
| 114 | + 0x02, 0x04, 0x08, 0x10, 0x20, | |
| 115 | + 0x00, 0x41, 0x41, 0x41, 0x7F, | |
| 116 | + 0x04, 0x02, 0x01, 0x02, 0x04, | |
| 117 | + 0x40, 0x40, 0x40, 0x40, 0x40, | |
| 118 | + 0x00, 0x03, 0x07, 0x08, 0x00, | |
| 119 | + 0x20, 0x54, 0x54, 0x78, 0x40, | |
| 120 | + 0x7F, 0x28, 0x44, 0x44, 0x38, | |
| 121 | + 0x38, 0x44, 0x44, 0x44, 0x28, | |
| 122 | + 0x38, 0x44, 0x44, 0x28, 0x7F, | |
| 123 | + 0x38, 0x54, 0x54, 0x54, 0x18, | |
| 124 | + 0x00, 0x08, 0x7E, 0x09, 0x02, | |
| 125 | + 0x18, 0xA4, 0xA4, 0x9C, 0x78, | |
| 126 | + 0x7F, 0x08, 0x04, 0x04, 0x78, | |
| 127 | + 0x00, 0x44, 0x7D, 0x40, 0x00, | |
| 128 | + 0x20, 0x40, 0x40, 0x3D, 0x00, | |
| 129 | + 0x7F, 0x10, 0x28, 0x44, 0x00, | |
| 130 | + 0x00, 0x41, 0x7F, 0x40, 0x00, | |
| 131 | + 0x7C, 0x04, 0x78, 0x04, 0x78, | |
| 132 | + 0x7C, 0x08, 0x04, 0x04, 0x78, | |
| 133 | + 0x38, 0x44, 0x44, 0x44, 0x38, | |
| 134 | + 0xFC, 0x18, 0x24, 0x24, 0x18, | |
| 135 | + 0x18, 0x24, 0x24, 0x18, 0xFC, | |
| 136 | + 0x7C, 0x08, 0x04, 0x04, 0x08, | |
| 137 | + 0x48, 0x54, 0x54, 0x54, 0x24, | |
| 138 | + 0x04, 0x04, 0x3F, 0x44, 0x24, | |
| 139 | + 0x3C, 0x40, 0x40, 0x20, 0x7C, | |
| 140 | + 0x1C, 0x20, 0x40, 0x20, 0x1C, | |
| 141 | + 0x3C, 0x40, 0x30, 0x40, 0x3C, | |
| 142 | + 0x44, 0x28, 0x10, 0x28, 0x44, | |
| 143 | + 0x4C, 0x90, 0x90, 0x90, 0x7C, | |
| 144 | + 0x44, 0x64, 0x54, 0x4C, 0x44, | |
| 145 | + 0x00, 0x08, 0x36, 0x41, 0x00, | |
| 146 | + 0x00, 0x00, 0x77, 0x00, 0x00, | |
| 147 | + 0x00, 0x41, 0x36, 0x08, 0x00, | |
| 148 | + 0x02, 0x01, 0x02, 0x04, 0x02, | |
| 149 | + 0x3C, 0x26, 0x23, 0x26, 0x3C, | |
| 150 | + 0x1E, 0xA1, 0xA1, 0x61, 0x12, | |
| 151 | + 0x3A, 0x40, 0x40, 0x20, 0x7A, | |
| 152 | + 0x38, 0x54, 0x54, 0x55, 0x59, | |
| 153 | + 0x21, 0x55, 0x55, 0x79, 0x41, | |
| 154 | + 0x22, 0x54, 0x54, 0x78, 0x42, // a-umlaut | |
| 155 | + 0x21, 0x55, 0x54, 0x78, 0x40, | |
| 156 | + 0x20, 0x54, 0x55, 0x79, 0x40, | |
| 157 | + 0x0C, 0x1E, 0x52, 0x72, 0x12, | |
| 158 | + 0x39, 0x55, 0x55, 0x55, 0x59, | |
| 159 | + 0x39, 0x54, 0x54, 0x54, 0x59, | |
| 160 | + 0x39, 0x55, 0x54, 0x54, 0x58, | |
| 161 | + 0x00, 0x00, 0x45, 0x7C, 0x41, | |
| 162 | + 0x00, 0x02, 0x45, 0x7D, 0x42, | |
| 163 | + 0x00, 0x01, 0x45, 0x7C, 0x40, | |
| 164 | + 0x7D, 0x12, 0x11, 0x12, 0x7D, // A-umlaut | |
| 165 | + 0xF0, 0x28, 0x25, 0x28, 0xF0, | |
| 166 | + 0x7C, 0x54, 0x55, 0x45, 0x00, | |
| 167 | + 0x20, 0x54, 0x54, 0x7C, 0x54, | |
| 168 | + 0x7C, 0x0A, 0x09, 0x7F, 0x49, | |
| 169 | + 0x32, 0x49, 0x49, 0x49, 0x32, | |
| 170 | + 0x3A, 0x44, 0x44, 0x44, 0x3A, // o-umlaut | |
| 171 | + 0x32, 0x4A, 0x48, 0x48, 0x30, | |
| 172 | + 0x3A, 0x41, 0x41, 0x21, 0x7A, | |
| 173 | + 0x3A, 0x42, 0x40, 0x20, 0x78, | |
| 174 | + 0x00, 0x9D, 0xA0, 0xA0, 0x7D, | |
| 175 | + 0x3D, 0x42, 0x42, 0x42, 0x3D, // O-umlaut | |
| 176 | + 0x3D, 0x40, 0x40, 0x40, 0x3D, | |
| 177 | + 0x3C, 0x24, 0xFF, 0x24, 0x24, | |
| 178 | + 0x48, 0x7E, 0x49, 0x43, 0x66, | |
| 179 | + 0x2B, 0x2F, 0xFC, 0x2F, 0x2B, | |
| 180 | + 0xFF, 0x09, 0x29, 0xF6, 0x20, | |
| 181 | + 0xC0, 0x88, 0x7E, 0x09, 0x03, | |
| 182 | + 0x20, 0x54, 0x54, 0x79, 0x41, | |
| 183 | + 0x00, 0x00, 0x44, 0x7D, 0x41, | |
| 184 | + 0x30, 0x48, 0x48, 0x4A, 0x32, | |
| 185 | + 0x38, 0x40, 0x40, 0x22, 0x7A, | |
| 186 | + 0x00, 0x7A, 0x0A, 0x0A, 0x72, | |
| 187 | + 0x7D, 0x0D, 0x19, 0x31, 0x7D, | |
| 188 | + 0x26, 0x29, 0x29, 0x2F, 0x28, | |
| 189 | + 0x26, 0x29, 0x29, 0x29, 0x26, | |
| 190 | + 0x30, 0x48, 0x4D, 0x40, 0x20, | |
| 191 | + 0x38, 0x08, 0x08, 0x08, 0x08, | |
| 192 | + 0x08, 0x08, 0x08, 0x08, 0x38, | |
| 193 | + 0x2F, 0x10, 0xC8, 0xAC, 0xBA, | |
| 194 | + 0x2F, 0x10, 0x28, 0x34, 0xFA, | |
| 195 | + 0x00, 0x00, 0x7B, 0x00, 0x00, | |
| 196 | + 0x08, 0x14, 0x2A, 0x14, 0x22, | |
| 197 | + 0x22, 0x14, 0x2A, 0x14, 0x08, | |
| 198 | + 0x55, 0x00, 0x55, 0x00, 0x55, // #176 (25% block) missing in old code | |
| 199 | + 0xAA, 0x55, 0xAA, 0x55, 0xAA, // 50% block | |
| 200 | + 0xFF, 0x55, 0xFF, 0x55, 0xFF, // 75% block | |
| 201 | + 0x00, 0x00, 0x00, 0xFF, 0x00, | |
| 202 | + 0x10, 0x10, 0x10, 0xFF, 0x00, | |
| 203 | + 0x14, 0x14, 0x14, 0xFF, 0x00, | |
| 204 | + 0x10, 0x10, 0xFF, 0x00, 0xFF, | |
| 205 | + 0x10, 0x10, 0xF0, 0x10, 0xF0, | |
| 206 | + 0x14, 0x14, 0x14, 0xFC, 0x00, | |
| 207 | + 0x14, 0x14, 0xF7, 0x00, 0xFF, | |
| 208 | + 0x00, 0x00, 0xFF, 0x00, 0xFF, | |
| 209 | + 0x14, 0x14, 0xF4, 0x04, 0xFC, | |
| 210 | + 0x14, 0x14, 0x17, 0x10, 0x1F, | |
| 211 | + 0x10, 0x10, 0x1F, 0x10, 0x1F, | |
| 212 | + 0x14, 0x14, 0x14, 0x1F, 0x00, | |
| 213 | + 0x10, 0x10, 0x10, 0xF0, 0x00, | |
| 214 | + 0x00, 0x00, 0x00, 0x1F, 0x10, | |
| 215 | + 0x10, 0x10, 0x10, 0x1F, 0x10, | |
| 216 | + 0x10, 0x10, 0x10, 0xF0, 0x10, | |
| 217 | + 0x00, 0x00, 0x00, 0xFF, 0x10, | |
| 218 | + 0x10, 0x10, 0x10, 0x10, 0x10, | |
| 219 | + 0x10, 0x10, 0x10, 0xFF, 0x10, | |
| 220 | + 0x00, 0x00, 0x00, 0xFF, 0x14, | |
| 221 | + 0x00, 0x00, 0xFF, 0x00, 0xFF, | |
| 222 | + 0x00, 0x00, 0x1F, 0x10, 0x17, | |
| 223 | + 0x00, 0x00, 0xFC, 0x04, 0xF4, | |
| 224 | + 0x14, 0x14, 0x17, 0x10, 0x17, | |
| 225 | + 0x14, 0x14, 0xF4, 0x04, 0xF4, | |
| 226 | + 0x00, 0x00, 0xFF, 0x00, 0xF7, | |
| 227 | + 0x14, 0x14, 0x14, 0x14, 0x14, | |
| 228 | + 0x14, 0x14, 0xF7, 0x00, 0xF7, | |
| 229 | + 0x14, 0x14, 0x14, 0x17, 0x14, | |
| 230 | + 0x10, 0x10, 0x1F, 0x10, 0x1F, | |
| 231 | + 0x14, 0x14, 0x14, 0xF4, 0x14, | |
| 232 | + 0x10, 0x10, 0xF0, 0x10, 0xF0, | |
| 233 | + 0x00, 0x00, 0x1F, 0x10, 0x1F, | |
| 234 | + 0x00, 0x00, 0x00, 0x1F, 0x14, | |
| 235 | + 0x00, 0x00, 0x00, 0xFC, 0x14, | |
| 236 | + 0x00, 0x00, 0xF0, 0x10, 0xF0, | |
| 237 | + 0x10, 0x10, 0xFF, 0x10, 0xFF, | |
| 238 | + 0x14, 0x14, 0x14, 0xFF, 0x14, | |
| 239 | + 0x10, 0x10, 0x10, 0x1F, 0x00, | |
| 240 | + 0x00, 0x00, 0x00, 0xF0, 0x10, | |
| 241 | + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, | |
| 242 | + 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, | |
| 243 | + 0xFF, 0xFF, 0xFF, 0x00, 0x00, | |
| 244 | + 0x00, 0x00, 0x00, 0xFF, 0xFF, | |
| 245 | + 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, | |
| 246 | + 0x38, 0x44, 0x44, 0x38, 0x44, | |
| 247 | + 0xFC, 0x4A, 0x4A, 0x4A, 0x34, // sharp-s or beta | |
| 248 | + 0x7E, 0x02, 0x02, 0x06, 0x06, | |
| 249 | + 0x02, 0x7E, 0x02, 0x7E, 0x02, | |
| 250 | + 0x63, 0x55, 0x49, 0x41, 0x63, | |
| 251 | + 0x38, 0x44, 0x44, 0x3C, 0x04, | |
| 252 | + 0x40, 0x7E, 0x20, 0x1E, 0x20, | |
| 253 | + 0x06, 0x02, 0x7E, 0x02, 0x02, | |
| 254 | + 0x99, 0xA5, 0xE7, 0xA5, 0x99, | |
| 255 | + 0x1C, 0x2A, 0x49, 0x2A, 0x1C, | |
| 256 | + 0x4C, 0x72, 0x01, 0x72, 0x4C, | |
| 257 | + 0x30, 0x4A, 0x4D, 0x4D, 0x30, | |
| 258 | + 0x30, 0x48, 0x78, 0x48, 0x30, | |
| 259 | + 0xBC, 0x62, 0x5A, 0x46, 0x3D, | |
| 260 | + 0x3E, 0x49, 0x49, 0x49, 0x00, | |
| 261 | + 0x7E, 0x01, 0x01, 0x01, 0x7E, | |
| 262 | + 0x2A, 0x2A, 0x2A, 0x2A, 0x2A, | |
| 263 | + 0x44, 0x44, 0x5F, 0x44, 0x44, | |
| 264 | + 0x40, 0x51, 0x4A, 0x44, 0x40, | |
| 265 | + 0x40, 0x44, 0x4A, 0x51, 0x40, | |
| 266 | + 0x00, 0x00, 0xFF, 0x01, 0x03, | |
| 267 | + 0xE0, 0x80, 0xFF, 0x00, 0x00, | |
| 268 | + 0x08, 0x08, 0x6B, 0x6B, 0x08, | |
| 269 | + 0x36, 0x12, 0x36, 0x24, 0x36, | |
| 270 | + 0x06, 0x0F, 0x09, 0x0F, 0x06, | |
| 271 | + 0x00, 0x00, 0x18, 0x18, 0x00, | |
| 272 | + 0x00, 0x00, 0x10, 0x10, 0x00, | |
| 273 | + 0x30, 0x40, 0xFF, 0x01, 0x01, | |
| 274 | + 0x00, 0x1F, 0x01, 0x01, 0x1E, | |
| 275 | + 0x00, 0x19, 0x1D, 0x17, 0x12, | |
| 276 | + 0x00, 0x3C, 0x3C, 0x3C, 0x3C, | |
| 277 | + 0x00, 0x00, 0x00, 0x00, 0x00 // #255 NBSP | |
| 278 | +}; | |
| 279 | + | |
| 280 | + | |
| 281 | +#endif // FONT5X7_H | |
| @@ -0,0 +1,176 @@ | ||
| 1 | +/** | |
| 2 | + ****************************************************************************** | |
| 3 | + * File Name : gpio.c | |
| 4 | + * Description : This file provides code for the configuration | |
| 5 | + * of all used GPIO pins. | |
| 6 | + ****************************************************************************** | |
| 7 | + * @attention | |
| 8 | + * | |
| 9 | + * <h2><center>© Copyright (c) 2020 STMicroelectronics. | |
| 10 | + * All rights reserved.</center></h2> | |
| 11 | + * | |
| 12 | + * This software component is licensed by ST under Ultimate Liberty license | |
| 13 | + * SLA0044, the "License"; You may not use this file except in compliance with | |
| 14 | + * the License. You may obtain a copy of the License at: | |
| 15 | + * www.st.com/SLA0044 | |
| 16 | + * | |
| 17 | + ****************************************************************************** | |
| 18 | + */ | |
| 19 | + | |
| 20 | +/* Includes ------------------------------------------------------------------*/ | |
| 21 | +#include "gpio.h" | |
| 22 | +/* USER CODE BEGIN 0 */ | |
| 23 | + | |
| 24 | +/* USER CODE END 0 */ | |
| 25 | + | |
| 26 | +/*----------------------------------------------------------------------------*/ | |
| 27 | +/* Configure GPIO */ | |
| 28 | +/*----------------------------------------------------------------------------*/ | |
| 29 | +/* USER CODE BEGIN 1 */ | |
| 30 | + | |
| 31 | +/* USER CODE END 1 */ | |
| 32 | + | |
| 33 | +/** Configure pins | |
| 34 | + PH0-OSC_IN (PH0) ------> RCC_OSC_IN | |
| 35 | + PH1-OSC_OUT (PH1) ------> RCC_OSC_OUT | |
| 36 | + PA13 (JTMS/SWDIO) ------> DEBUG_JTMS-SWDIO | |
| 37 | + PA14 (JTCK/SWCLK) ------> DEBUG_JTCK-SWCLK | |
| 38 | + PB3 (JTDO/TRACESWO) ------> DEBUG_JTDO-SWO | |
| 39 | +*/ | |
| 40 | +void MX_GPIO_Init(void) | |
| 41 | +{ | |
| 42 | + | |
| 43 | + GPIO_InitTypeDef GPIO_InitStruct = {0}; | |
| 44 | + | |
| 45 | + /* GPIO Ports Clock Enable */ | |
| 46 | + __HAL_RCC_GPIOE_CLK_ENABLE(); | |
| 47 | + __HAL_RCC_GPIOC_CLK_ENABLE(); | |
| 48 | + __HAL_RCC_GPIOF_CLK_ENABLE(); | |
| 49 | + __HAL_RCC_GPIOH_CLK_ENABLE(); | |
| 50 | + __HAL_RCC_GPIOA_CLK_ENABLE(); | |
| 51 | + __HAL_RCC_GPIOB_CLK_ENABLE(); | |
| 52 | + __HAL_RCC_GPIOG_CLK_ENABLE(); | |
| 53 | + __HAL_RCC_GPIOD_CLK_ENABLE(); | |
| 54 | + | |
| 55 | + /*Configure GPIO pin Output Level */ | |
| 56 | + HAL_GPIO_WritePin(GPIOC, GPIO_PIN_14|GPIO_PIN_4|GPIO_PIN_6|GPIO_PIN_7, GPIO_PIN_RESET); | |
| 57 | + | |
| 58 | + /*Configure GPIO pin Output Level */ | |
| 59 | + HAL_GPIO_WritePin(GPIOF, GPIO_PIN_6, GPIO_PIN_RESET); | |
| 60 | + | |
| 61 | + /*Configure GPIO pin Output Level */ | |
| 62 | + HAL_GPIO_WritePin(GPIOA, GPIO_PIN_4|GPIO_PIN_6|GPIO_PIN_8|GPIO_PIN_9 | |
| 63 | + |GPIO_PIN_10, GPIO_PIN_RESET); | |
| 64 | + | |
| 65 | + /*Configure GPIO pin Output Level */ | |
| 66 | + HAL_GPIO_WritePin(GPIOB, GPIO_PIN_0|GPIO_PIN_4, GPIO_PIN_RESET); | |
| 67 | + | |
| 68 | + /*Configure GPIO pin Output Level */ | |
| 69 | + HAL_GPIO_WritePin(GPIOG, GPIO_PIN_6|GPIO_PIN_7|GPIO_PIN_10, GPIO_PIN_RESET); | |
| 70 | + | |
| 71 | + /*Configure GPIO pin : PC13 */ | |
| 72 | + GPIO_InitStruct.Pin = GPIO_PIN_13; | |
| 73 | + GPIO_InitStruct.Mode = GPIO_MODE_INPUT; | |
| 74 | + GPIO_InitStruct.Pull = GPIO_NOPULL; | |
| 75 | + HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); | |
| 76 | + | |
| 77 | + /*Configure GPIO pins : PC14 PC4 PC6 PC7 */ | |
| 78 | + GPIO_InitStruct.Pin = GPIO_PIN_14|GPIO_PIN_4|GPIO_PIN_6|GPIO_PIN_7; | |
| 79 | + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; | |
| 80 | + GPIO_InitStruct.Pull = GPIO_NOPULL; | |
| 81 | + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; | |
| 82 | + HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); | |
| 83 | + | |
| 84 | + /*Configure GPIO pin : PC15 */ | |
| 85 | + GPIO_InitStruct.Pin = GPIO_PIN_15; | |
| 86 | + GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING; | |
| 87 | + GPIO_InitStruct.Pull = GPIO_NOPULL; | |
| 88 | + HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); | |
| 89 | + | |
| 90 | + /*Configure GPIO pin : PF6 */ | |
| 91 | + GPIO_InitStruct.Pin = GPIO_PIN_6; | |
| 92 | + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; | |
| 93 | + GPIO_InitStruct.Pull = GPIO_NOPULL; | |
| 94 | + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; | |
| 95 | + HAL_GPIO_Init(GPIOF, &GPIO_InitStruct); | |
| 96 | + | |
| 97 | + /*Configure GPIO pins : PF7 PF8 PF9 PF10 */ | |
| 98 | + GPIO_InitStruct.Pin = GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10; | |
| 99 | + GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; | |
| 100 | + GPIO_InitStruct.Pull = GPIO_NOPULL; | |
| 101 | + HAL_GPIO_Init(GPIOF, &GPIO_InitStruct); | |
| 102 | + | |
| 103 | + /*Configure GPIO pins : PA1 PA15 */ | |
| 104 | + GPIO_InitStruct.Pin = GPIO_PIN_1|GPIO_PIN_15; | |
| 105 | + GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; | |
| 106 | + GPIO_InitStruct.Pull = GPIO_NOPULL; | |
| 107 | + HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); | |
| 108 | + | |
| 109 | + /*Configure GPIO pins : PA4 PA6 PA8 PA9 | |
| 110 | + PA10 */ | |
| 111 | + GPIO_InitStruct.Pin = GPIO_PIN_4|GPIO_PIN_6|GPIO_PIN_8|GPIO_PIN_9 | |
| 112 | + |GPIO_PIN_10; | |
| 113 | + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; | |
| 114 | + GPIO_InitStruct.Pull = GPIO_NOPULL; | |
| 115 | + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; | |
| 116 | + HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); | |
| 117 | + | |
| 118 | + /*Configure GPIO pins : PB0 PB4 */ | |
| 119 | + GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_4; | |
| 120 | + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; | |
| 121 | + GPIO_InitStruct.Pull = GPIO_NOPULL; | |
| 122 | + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; | |
| 123 | + HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); | |
| 124 | + | |
| 125 | + /*Configure GPIO pins : PB1 PB12 PB13 PB14 | |
| 126 | + PB15 */ | |
| 127 | + GPIO_InitStruct.Pin = GPIO_PIN_1|GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14 | |
| 128 | + |GPIO_PIN_15; | |
| 129 | + GPIO_InitStruct.Mode = GPIO_MODE_INPUT; | |
| 130 | + GPIO_InitStruct.Pull = GPIO_PULLUP; | |
| 131 | + HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); | |
| 132 | + | |
| 133 | + /*Configure GPIO pins : PB2 PB9 */ | |
| 134 | + GPIO_InitStruct.Pin = GPIO_PIN_2|GPIO_PIN_9; | |
| 135 | + GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; | |
| 136 | + GPIO_InitStruct.Pull = GPIO_NOPULL; | |
| 137 | + HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); | |
| 138 | + | |
| 139 | + /*Configure GPIO pins : PD11 PD7 */ | |
| 140 | + GPIO_InitStruct.Pin = GPIO_PIN_11|GPIO_PIN_7; | |
| 141 | + GPIO_InitStruct.Mode = GPIO_MODE_INPUT; | |
| 142 | + GPIO_InitStruct.Pull = GPIO_PULLUP; | |
| 143 | + HAL_GPIO_Init(GPIOD, &GPIO_InitStruct); | |
| 144 | + | |
| 145 | + /*Configure GPIO pins : PG3 PG9 PG13 PG14 */ | |
| 146 | + GPIO_InitStruct.Pin = GPIO_PIN_3|GPIO_PIN_9|GPIO_PIN_13|GPIO_PIN_14; | |
| 147 | + GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; | |
| 148 | + GPIO_InitStruct.Pull = GPIO_NOPULL; | |
| 149 | + HAL_GPIO_Init(GPIOG, &GPIO_InitStruct); | |
| 150 | + | |
| 151 | + /*Configure GPIO pins : PG6 PG7 PG10 */ | |
| 152 | + GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7|GPIO_PIN_10; | |
| 153 | + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; | |
| 154 | + GPIO_InitStruct.Pull = GPIO_NOPULL; | |
| 155 | + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; | |
| 156 | + HAL_GPIO_Init(GPIOG, &GPIO_InitStruct); | |
| 157 | + | |
| 158 | + /*Configure GPIO pins : PD3 PD4 PD5 PD6 */ | |
| 159 | + GPIO_InitStruct.Pin = GPIO_PIN_3|GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6; | |
| 160 | + GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; | |
| 161 | + GPIO_InitStruct.Pull = GPIO_NOPULL; | |
| 162 | + HAL_GPIO_Init(GPIOD, &GPIO_InitStruct); | |
| 163 | + | |
| 164 | + /*Configure GPIO pins : PG11 PG12 */ | |
| 165 | + GPIO_InitStruct.Pin = GPIO_PIN_11|GPIO_PIN_12; | |
| 166 | + GPIO_InitStruct.Mode = GPIO_MODE_INPUT; | |
| 167 | + GPIO_InitStruct.Pull = GPIO_PULLUP; | |
| 168 | + HAL_GPIO_Init(GPIOG, &GPIO_InitStruct); | |
| 169 | + | |
| 170 | +} | |
| 171 | + | |
| 172 | +/* USER CODE BEGIN 2 */ | |
| 173 | + | |
| 174 | +/* USER CODE END 2 */ | |
| 175 | + | |
| 176 | +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |
| @@ -0,0 +1,242 @@ | ||
| 1 | +/** | |
| 2 | + ****************************************************************************** | |
| 3 | + * File Name : I2C.c | |
| 4 | + * Description : This file provides code for the configuration | |
| 5 | + * of the I2C instances. | |
| 6 | + ****************************************************************************** | |
| 7 | + * @attention | |
| 8 | + * | |
| 9 | + * <h2><center>© Copyright (c) 2020 STMicroelectronics. | |
| 10 | + * All rights reserved.</center></h2> | |
| 11 | + * | |
| 12 | + * This software component is licensed by ST under Ultimate Liberty license | |
| 13 | + * SLA0044, the "License"; You may not use this file except in compliance with | |
| 14 | + * the License. You may obtain a copy of the License at: | |
| 15 | + * www.st.com/SLA0044 | |
| 16 | + * | |
| 17 | + ****************************************************************************** | |
| 18 | + */ | |
| 19 | + | |
| 20 | +/* Includes ------------------------------------------------------------------*/ | |
| 21 | +#include "i2c.h" | |
| 22 | + | |
| 23 | +/* USER CODE BEGIN 0 */ | |
| 24 | + | |
| 25 | +/* USER CODE END 0 */ | |
| 26 | + | |
| 27 | +I2C_HandleTypeDef hi2c2; | |
| 28 | +I2C_HandleTypeDef hi2c4; | |
| 29 | +DMA_HandleTypeDef hdma_i2c4_rx; | |
| 30 | +DMA_HandleTypeDef hdma_i2c4_tx; | |
| 31 | + | |
| 32 | +/* I2C2 init function */ | |
| 33 | +void MX_I2C2_Init(void) | |
| 34 | +{ | |
| 35 | + | |
| 36 | + hi2c2.Instance = I2C2; | |
| 37 | + hi2c2.Init.Timing = 0x505097F4; | |
| 38 | + hi2c2.Init.OwnAddress1 = 0; | |
| 39 | + hi2c2.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT; | |
| 40 | + hi2c2.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE; | |
| 41 | + hi2c2.Init.OwnAddress2 = 0; | |
| 42 | + hi2c2.Init.OwnAddress2Masks = I2C_OA2_NOMASK; | |
| 43 | + hi2c2.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE; | |
| 44 | + hi2c2.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE; | |
| 45 | + if (HAL_I2C_Init(&hi2c2) != HAL_OK) | |
| 46 | + { | |
| 47 | + Error_Handler(); | |
| 48 | + } | |
| 49 | + /** Configure Analogue filter | |
| 50 | + */ | |
| 51 | + if (HAL_I2CEx_ConfigAnalogFilter(&hi2c2, I2C_ANALOGFILTER_ENABLE) != HAL_OK) | |
| 52 | + { | |
| 53 | + Error_Handler(); | |
| 54 | + } | |
| 55 | + /** Configure Digital filter | |
| 56 | + */ | |
| 57 | + if (HAL_I2CEx_ConfigDigitalFilter(&hi2c2, 0) != HAL_OK) | |
| 58 | + { | |
| 59 | + Error_Handler(); | |
| 60 | + } | |
| 61 | + | |
| 62 | +} | |
| 63 | +/* I2C4 init function */ | |
| 64 | +void MX_I2C4_Init(void) | |
| 65 | +{ | |
| 66 | + | |
| 67 | + hi2c4.Instance = I2C4; | |
| 68 | + hi2c4.Init.Timing = 0x307075B1; | |
| 69 | + hi2c4.Init.OwnAddress1 = 0; | |
| 70 | + hi2c4.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT; | |
| 71 | + hi2c4.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE; | |
| 72 | + hi2c4.Init.OwnAddress2 = 0; | |
| 73 | + hi2c4.Init.OwnAddress2Masks = I2C_OA2_NOMASK; | |
| 74 | + hi2c4.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE; | |
| 75 | + hi2c4.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE; | |
| 76 | + if (HAL_I2C_Init(&hi2c4) != HAL_OK) | |
| 77 | + { | |
| 78 | + Error_Handler(); | |
| 79 | + } | |
| 80 | + /** Configure Analogue filter | |
| 81 | + */ | |
| 82 | + if (HAL_I2CEx_ConfigAnalogFilter(&hi2c4, I2C_ANALOGFILTER_ENABLE) != HAL_OK) | |
| 83 | + { | |
| 84 | + Error_Handler(); | |
| 85 | + } | |
| 86 | + /** Configure Digital filter | |
| 87 | + */ | |
| 88 | + if (HAL_I2CEx_ConfigDigitalFilter(&hi2c4, 0) != HAL_OK) | |
| 89 | + { | |
| 90 | + Error_Handler(); | |
| 91 | + } | |
| 92 | + | |
| 93 | +} | |
| 94 | + | |
| 95 | +void HAL_I2C_MspInit(I2C_HandleTypeDef* i2cHandle) | |
| 96 | +{ | |
| 97 | + | |
| 98 | + GPIO_InitTypeDef GPIO_InitStruct = {0}; | |
| 99 | + if(i2cHandle->Instance==I2C2) | |
| 100 | + { | |
| 101 | + /* USER CODE BEGIN I2C2_MspInit 0 */ | |
| 102 | + | |
| 103 | + /* USER CODE END I2C2_MspInit 0 */ | |
| 104 | + | |
| 105 | + __HAL_RCC_GPIOB_CLK_ENABLE(); | |
| 106 | + /**I2C2 GPIO Configuration | |
| 107 | + PB10 ------> I2C2_SCL | |
| 108 | + PB11 ------> I2C2_SDA | |
| 109 | + */ | |
| 110 | + GPIO_InitStruct.Pin = GPIO_PIN_10|GPIO_PIN_11; | |
| 111 | + GPIO_InitStruct.Mode = GPIO_MODE_AF_OD; | |
| 112 | + GPIO_InitStruct.Pull = GPIO_NOPULL; | |
| 113 | + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; | |
| 114 | + GPIO_InitStruct.Alternate = GPIO_AF4_I2C2; | |
| 115 | + HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); | |
| 116 | + | |
| 117 | + /* I2C2 clock enable */ | |
| 118 | + __HAL_RCC_I2C2_CLK_ENABLE(); | |
| 119 | + /* USER CODE BEGIN I2C2_MspInit 1 */ | |
| 120 | + | |
| 121 | + /* USER CODE END I2C2_MspInit 1 */ | |
| 122 | + } | |
| 123 | + else if(i2cHandle->Instance==I2C4) | |
| 124 | + { | |
| 125 | + /* USER CODE BEGIN I2C4_MspInit 0 */ | |
| 126 | + | |
| 127 | + /* USER CODE END I2C4_MspInit 0 */ | |
| 128 | + | |
| 129 | + __HAL_RCC_GPIOD_CLK_ENABLE(); | |
| 130 | + /**I2C4 GPIO Configuration | |
| 131 | + PD12 ------> I2C4_SCL | |
| 132 | + PD13 ------> I2C4_SDA | |
| 133 | + */ | |
| 134 | + GPIO_InitStruct.Pin = GPIO_PIN_12|GPIO_PIN_13; | |
| 135 | + GPIO_InitStruct.Mode = GPIO_MODE_AF_OD; | |
| 136 | + GPIO_InitStruct.Pull = GPIO_NOPULL; | |
| 137 | + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_MEDIUM; | |
| 138 | + GPIO_InitStruct.Alternate = GPIO_AF4_I2C4; | |
| 139 | + HAL_GPIO_Init(GPIOD, &GPIO_InitStruct); | |
| 140 | + | |
| 141 | + /* I2C4 clock enable */ | |
| 142 | + __HAL_RCC_I2C4_CLK_ENABLE(); | |
| 143 | + | |
| 144 | + /* I2C4 DMA Init */ | |
| 145 | + /* I2C4_RX Init */ | |
| 146 | + hdma_i2c4_rx.Instance = BDMA_Channel0; | |
| 147 | + hdma_i2c4_rx.Init.Request = BDMA_REQUEST_I2C4_RX; | |
| 148 | + hdma_i2c4_rx.Init.Direction = DMA_PERIPH_TO_MEMORY; | |
| 149 | + hdma_i2c4_rx.Init.PeriphInc = DMA_PINC_DISABLE; | |
| 150 | + hdma_i2c4_rx.Init.MemInc = DMA_MINC_ENABLE; | |
| 151 | + hdma_i2c4_rx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE; | |
| 152 | + hdma_i2c4_rx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE; | |
| 153 | + hdma_i2c4_rx.Init.Mode = DMA_NORMAL; | |
| 154 | + hdma_i2c4_rx.Init.Priority = DMA_PRIORITY_LOW; | |
| 155 | + if (HAL_DMA_Init(&hdma_i2c4_rx) != HAL_OK) | |
| 156 | + { | |
| 157 | + Error_Handler(); | |
| 158 | + } | |
| 159 | + | |
| 160 | + __HAL_LINKDMA(i2cHandle,hdmarx,hdma_i2c4_rx); | |
| 161 | + | |
| 162 | + /* I2C4_TX Init */ | |
| 163 | + hdma_i2c4_tx.Instance = BDMA_Channel1; | |
| 164 | + hdma_i2c4_tx.Init.Request = BDMA_REQUEST_I2C4_TX; | |
| 165 | + hdma_i2c4_tx.Init.Direction = DMA_MEMORY_TO_PERIPH; | |
| 166 | + hdma_i2c4_tx.Init.PeriphInc = DMA_PINC_DISABLE; | |
| 167 | + hdma_i2c4_tx.Init.MemInc = DMA_MINC_ENABLE; | |
| 168 | + hdma_i2c4_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE; | |
| 169 | + hdma_i2c4_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE; | |
| 170 | + hdma_i2c4_tx.Init.Mode = DMA_NORMAL; | |
| 171 | + hdma_i2c4_tx.Init.Priority = DMA_PRIORITY_LOW; | |
| 172 | + if (HAL_DMA_Init(&hdma_i2c4_tx) != HAL_OK) | |
| 173 | + { | |
| 174 | + Error_Handler(); | |
| 175 | + } | |
| 176 | + | |
| 177 | + __HAL_LINKDMA(i2cHandle,hdmatx,hdma_i2c4_tx); | |
| 178 | + | |
| 179 | + /* I2C4 interrupt Init */ | |
| 180 | + HAL_NVIC_SetPriority(I2C4_EV_IRQn, 6, 0); | |
| 181 | + HAL_NVIC_EnableIRQ(I2C4_EV_IRQn); | |
| 182 | + HAL_NVIC_SetPriority(I2C4_ER_IRQn, 6, 0); | |
| 183 | + HAL_NVIC_EnableIRQ(I2C4_ER_IRQn); | |
| 184 | + /* USER CODE BEGIN I2C4_MspInit 1 */ | |
| 185 | + | |
| 186 | + /* USER CODE END I2C4_MspInit 1 */ | |
| 187 | + } | |
| 188 | +} | |
| 189 | + | |
| 190 | +void HAL_I2C_MspDeInit(I2C_HandleTypeDef* i2cHandle) | |
| 191 | +{ | |
| 192 | + | |
| 193 | + if(i2cHandle->Instance==I2C2) | |
| 194 | + { | |
| 195 | + /* USER CODE BEGIN I2C2_MspDeInit 0 */ | |
| 196 | + | |
| 197 | + /* USER CODE END I2C2_MspDeInit 0 */ | |
| 198 | + /* Peripheral clock disable */ | |
| 199 | + __HAL_RCC_I2C2_CLK_DISABLE(); | |
| 200 | + | |
| 201 | + /**I2C2 GPIO Configuration | |
| 202 | + PB10 ------> I2C2_SCL | |
| 203 | + PB11 ------> I2C2_SDA | |
| 204 | + */ | |
| 205 | + HAL_GPIO_DeInit(GPIOB, GPIO_PIN_10|GPIO_PIN_11); | |
| 206 | + | |
| 207 | + /* USER CODE BEGIN I2C2_MspDeInit 1 */ | |
| 208 | + | |
| 209 | + /* USER CODE END I2C2_MspDeInit 1 */ | |
| 210 | + } | |
| 211 | + else if(i2cHandle->Instance==I2C4) | |
| 212 | + { | |
| 213 | + /* USER CODE BEGIN I2C4_MspDeInit 0 */ | |
| 214 | + | |
| 215 | + /* USER CODE END I2C4_MspDeInit 0 */ | |
| 216 | + /* Peripheral clock disable */ | |
| 217 | + __HAL_RCC_I2C4_CLK_DISABLE(); | |
| 218 | + | |
| 219 | + /**I2C4 GPIO Configuration | |
| 220 | + PD12 ------> I2C4_SCL | |
| 221 | + PD13 ------> I2C4_SDA | |
| 222 | + */ | |
| 223 | + HAL_GPIO_DeInit(GPIOD, GPIO_PIN_12|GPIO_PIN_13); | |
| 224 | + | |
| 225 | + /* I2C4 DMA DeInit */ | |
| 226 | + HAL_DMA_DeInit(i2cHandle->hdmarx); | |
| 227 | + HAL_DMA_DeInit(i2cHandle->hdmatx); | |
| 228 | + | |
| 229 | + /* I2C4 interrupt Deinit */ | |
| 230 | + HAL_NVIC_DisableIRQ(I2C4_EV_IRQn); | |
| 231 | + HAL_NVIC_DisableIRQ(I2C4_ER_IRQn); | |
| 232 | + /* USER CODE BEGIN I2C4_MspDeInit 1 */ | |
| 233 | + | |
| 234 | + /* USER CODE END I2C4_MspDeInit 1 */ | |
| 235 | + } | |
| 236 | +} | |
| 237 | + | |
| 238 | +/* USER CODE BEGIN 1 */ | |
| 239 | + | |
| 240 | +/* USER CODE END 1 */ | |
| 241 | + | |
| 242 | +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |
| @@ -1,946 +0,0 @@ | ||
| 1 | −/*============================================================================== | |
| 2 | − | |
| 3 | − leaf-analysis.c | |
| 4 | − Created: 30 Nov 2018 11:56:49am | |
| 5 | − Author: airship | |
| 6 | − | |
| 7 | −==============================================================================*/ | |
| 8 | − | |
| 9 | −#if _WIN32 || _WIN64 | |
| 10 | − | |
| 11 | −#include "..\Inc\leaf-analysis.h" | |
| 12 | −#include "..\Externals\d_fft_mayer.h" | |
| 13 | − | |
| 14 | −#else | |
| 15 | − | |
| 16 | −#include "../Inc/leaf-analysis.h" | |
| 17 | −#include "../Externals/d_fft_mayer.h" | |
| 18 | − | |
| 19 | −#endif | |
| 20 | − | |
| 21 | −//=========================================================================== | |
| 22 | −/* Envelope Follower */ | |
| 23 | −//=========================================================================== | |
| 24 | − | |
| 25 | −void tEnvelopeFollower_init(tEnvelopeFollower* const ef, float attackThreshold, float decayCoeff) | |
| 26 | −{ | |
| 27 | − _tEnvelopeFollower* e = *ef = (_tEnvelopeFollower*) leaf_alloc(sizeof(_tEnvelopeFollower)); | |
| 28 | − | |
| 29 | − e->y = 0.0f; | |
| 30 | − e->a_thresh = attackThreshold; | |
| 31 | − e->d_coeff = decayCoeff; | |
| 32 | −} | |
| 33 | − | |
| 34 | −void tEnvelopeFollower_free(tEnvelopeFollower* const ef) | |
| 35 | −{ | |
| 36 | − _tEnvelopeFollower* e = *ef; | |
| 37 | − | |
| 38 | − leaf_free(e); | |
| 39 | −} | |
| 40 | − | |
| 41 | −void tEnvelopeFollower_initToPool (tEnvelopeFollower* const ef, float attackThreshold, float decayCoeff, tMempool* const mp) | |
| 42 | −{ | |
| 43 | − _tMempool* m = *mp; | |
| 44 | − _tEnvelopeFollower* e = *ef = (_tEnvelopeFollower*) mpool_alloc(sizeof(_tEnvelopeFollower), &m->pool); | |
| 45 | − | |
| 46 | − e->y = 0.0f; | |
| 47 | − e->a_thresh = attackThreshold; | |
| 48 | − e->d_coeff = decayCoeff; | |
| 49 | −} | |
| 50 | − | |
| 51 | −void tEnvelopeFollower_freeFromPool (tEnvelopeFollower* const ef, tMempool* const mp) | |
| 52 | −{ | |
| 53 | − _tMempool* m = *mp; | |
| 54 | − _tEnvelopeFollower* e = *ef; | |
| 55 | − | |
| 56 | − mpool_free(e, &m->pool); | |
| 57 | −} | |
| 58 | − | |
| 59 | −float tEnvelopeFollower_tick(tEnvelopeFollower* const ef, float x) | |
| 60 | −{ | |
| 61 | − _tEnvelopeFollower* e = *ef; | |
| 62 | − | |
| 63 | − if (x < 0.0f ) x = -x; /* Absolute value. */ | |
| 64 | − | |
| 65 | − if ((x >= e->y) && (x > e->a_thresh)) e->y = x; /* If we hit a peak, ride the peak to the top. */ | |
| 66 | − else e->y = e->y * e->d_coeff; /* Else, exponential decay of output. */ | |
| 67 | − | |
| 68 | − //ef->y = envelope_pow[(uint16_t)(ef->y * (float)UINT16_MAX)] * ef->d_coeff; //not quite the right behavior - too much loss of precision? | |
| 69 | − //ef->y = powf(ef->y, 1.000009f) * ef->d_coeff; // too expensive | |
| 70 | − | |
| 71 | − if( e->y < VSF) e->y = 0.0f; | |
| 72 | − | |
| 73 | − return e->y; | |
| 74 | −} | |
| 75 | − | |
| 76 | −int tEnvelopeFollower_decayCoeff(tEnvelopeFollower* const ef, float decayCoeff) | |
| 77 | −{ | |
| 78 | − _tEnvelopeFollower* e = *ef; | |
| 79 | − return e->d_coeff = decayCoeff; | |
| 80 | −} | |
| 81 | − | |
| 82 | −int tEnvelopeFollower_attackThresh(tEnvelopeFollower* const ef, float attackThresh) | |
| 83 | −{ | |
| 84 | − _tEnvelopeFollower* e = *ef; | |
| 85 | − return e->a_thresh = attackThresh; | |
| 86 | −} | |
| 87 | − | |
| 88 | − | |
| 89 | −//=========================================================================== | |
| 90 | −/* Power Follower */ | |
| 91 | −//=========================================================================== | |
| 92 | −void tPowerFollower_init(tPowerFollower* const pf, float factor) | |
| 93 | −{ | |
| 94 | − _tPowerFollower* p = *pf = (_tPowerFollower*) leaf_alloc(sizeof(_tPowerFollower)); | |
| 95 | − | |
| 96 | − p->curr=0.0f; | |
| 97 | − p->factor=factor; | |
| 98 | − p->oneminusfactor=1.0f-factor; | |
| 99 | −} | |
| 100 | − | |
| 101 | −void tPowerFollower_free(tPowerFollower* const pf) | |
| 102 | −{ | |
| 103 | − _tPowerFollower* p = *pf; | |
| 104 | − | |
| 105 | − leaf_free(p); | |
| 106 | −} | |
| 107 | − | |
| 108 | −void tPowerFollower_initToPool (tPowerFollower* const pf, float factor, tMempool* const mp) | |
| 109 | −{ | |
| 110 | − _tMempool* m = *mp; | |
| 111 | − _tPowerFollower* p = *pf = (_tPowerFollower*) mpool_alloc(sizeof(_tPowerFollower), &m->pool); | |
| 112 | − | |
| 113 | − p->curr=0.0f; | |
| 114 | − p->factor=factor; | |
| 115 | − p->oneminusfactor=1.0f-factor; | |
| 116 | −} | |
| 117 | − | |
| 118 | −void tPowerFollower_freeFromPool (tPowerFollower* const pf, tMempool* const mp) | |
| 119 | −{ | |
| 120 | − _tMempool* m = *mp; | |
| 121 | − _tPowerFollower* p = *pf; | |
| 122 | − | |
| 123 | − mpool_free(p, &m->pool); | |
| 124 | −} | |
| 125 | − | |
| 126 | −int tPowerFollower_setFactor(tPowerFollower* const pf, float factor) | |
| 127 | −{ | |
| 128 | − _tPowerFollower* p = *pf; | |
| 129 | − | |
| 130 | − if (factor<0) factor=0; | |
| 131 | − if (factor>1) factor=1; | |
| 132 | − p->factor=factor; | |
| 133 | − p->oneminusfactor=1.0f-factor; | |
| 134 | − return 0; | |
| 135 | −} | |
| 136 | − | |
| 137 | −float tPowerFollower_tick(tPowerFollower* const pf, float input) | |
| 138 | −{ | |
| 139 | − _tPowerFollower* p = *pf; | |
| 140 | − p->curr = p->factor*input*input+p->oneminusfactor*p->curr; | |
| 141 | − return p->curr; | |
| 142 | −} | |
| 143 | − | |
| 144 | −float tPowerFollower_sample(tPowerFollower* const pf) | |
| 145 | −{ | |
| 146 | − _tPowerFollower* p = *pf; | |
| 147 | − return p->curr; | |
| 148 | −} | |
| 149 | − | |
| 150 | − | |
| 151 | − | |
| 152 | − | |
| 153 | −//=========================================================================== | |
| 154 | −/* ---------------- env~ - simple envelope follower. ----------------- */ | |
| 155 | −//=========================================================================== | |
| 156 | − | |
| 157 | −void tEnvPD_init(tEnvPD* const xpd, int ws, int hs, int bs) | |
| 158 | −{ | |
| 159 | − _tEnvPD* x = *xpd = (_tEnvPD*) leaf_calloc(sizeof(_tEnvPD)); | |
| 160 | − | |
| 161 | − int period = hs, npoints = ws; | |
| 162 | − | |
| 163 | − int i; | |
| 164 | − | |
| 165 | − if (npoints < 1) npoints = 1024; | |
| 166 | − if (period < 1) period = npoints/2; | |
| 167 | − if (period < npoints / MAXOVERLAP + 1) | |
| 168 | − period = npoints / MAXOVERLAP + 1; | |
| 169 | − | |
| 170 | − x->x_npoints = npoints; | |
| 171 | − x->x_phase = 0; | |
| 172 | − x->x_period = period; | |
| 173 | − | |
| 174 | − x->windowSize = npoints; | |
| 175 | − x->hopSize = period; | |
| 176 | − x->blockSize = bs; | |
| 177 | − | |
| 178 | − for (i = 0; i < MAXOVERLAP; i++) x->x_sumbuf[i] = 0.0f; | |
| 179 | − for (i = 0; i < npoints; i++) | |
| 180 | − x->buf[i] = (1.0f - cosf((TWO_PI * i) / npoints))/npoints; | |
| 181 | − for (; i < npoints+INITVSTAKEN; i++) x->buf[i] = 0.0f; | |
| 182 | − | |
| 183 | − x->x_f = 0.0f; | |
| 184 | − | |
| 185 | − x->x_allocforvs = INITVSTAKEN; | |
| 186 | − | |
| 187 | − // ~ ~ ~ dsp ~ ~ ~ | |
| 188 | − if (x->x_period % x->blockSize) | |
| 189 | − { | |
| 190 | − x->x_realperiod = x->x_period + x->blockSize - (x->x_period % x->blockSize); | |
| 191 | − } | |
| 192 | − else | |
| 193 | − { | |
| 194 | − x->x_realperiod = x->x_period; | |
| 195 | − } | |
| 196 | − // ~ ~ ~ ~ ~ ~ ~ ~ | |
| 197 | −} | |
| 198 | − | |
| 199 | −void tEnvPD_free (tEnvPD* const xpd) | |
| 200 | −{ | |
| 201 | − _tEnvPD* x = *xpd; | |
| 202 | − | |
| 203 | − leaf_free(x); | |
| 204 | −} | |
| 205 | − | |
| 206 | −void tEnvPD_initToPool (tEnvPD* const xpd, int ws, int hs, int bs, tMempool* const mp) | |
| 207 | −{ | |
| 208 | − _tMempool* m = *mp; | |
| 209 | − _tEnvPD* x = *xpd = (_tEnvPD*) mpool_calloc(sizeof(_tEnvPD), &m->pool); | |
| 210 | − | |
| 211 | − int period = hs, npoints = ws; | |
| 212 | − | |
| 213 | − int i; | |
| 214 | − | |
| 215 | − if (npoints < 1) npoints = 1024; | |
| 216 | − if (period < 1) period = npoints/2; | |
| 217 | − if (period < npoints / MAXOVERLAP + 1) | |
| 218 | − period = npoints / MAXOVERLAP + 1; | |
| 219 | − | |
| 220 | − x->x_npoints = npoints; | |
| 221 | − x->x_phase = 0; | |
| 222 | − x->x_period = period; | |
| 223 | − | |
| 224 | − x->windowSize = npoints; | |
| 225 | − x->hopSize = period; | |
| 226 | − x->blockSize = bs; | |
| 227 | − | |
| 228 | − for (i = 0; i < MAXOVERLAP; i++) x->x_sumbuf[i] = 0; | |
| 229 | − for (i = 0; i < npoints; i++) | |
| 230 | − x->buf[i] = (1.0f - cosf((2 * PI * i) / npoints))/npoints; | |
| 231 | − for (; i < npoints+INITVSTAKEN; i++) x->buf[i] = 0; | |
| 232 | − | |
| 233 | − x->x_f = 0; | |
| 234 | − | |
| 235 | − x->x_allocforvs = INITVSTAKEN; | |
| 236 | − | |
| 237 | − // ~ ~ ~ dsp ~ ~ ~ | |
| 238 | − if (x->x_period % x->blockSize) | |
| 239 | − { | |
| 240 | − x->x_realperiod = x->x_period + x->blockSize - (x->x_period % x->blockSize); | |
| 241 | − } | |
| 242 | − else | |
| 243 | − { | |
| 244 | − x->x_realperiod = x->x_period; | |
| 245 | − } | |
| 246 | − // ~ ~ ~ ~ ~ ~ ~ ~ | |
| 247 | −} | |
| 248 | − | |
| 249 | −void tEnvPD_freeFromPool (tEnvPD* const xpd, tMempool* const mp) | |
| 250 | −{ | |
| 251 | − _tMempool* m = *mp; | |
| 252 | − _tEnvPD* x = *xpd; | |
| 253 | − | |
| 254 | − mpool_free(x, &m->pool); | |
| 255 | −} | |
| 256 | − | |
| 257 | −float tEnvPD_tick (tEnvPD* const xpd) | |
| 258 | −{ | |
| 259 | − _tEnvPD* x = *xpd; | |
| 260 | − return powtodb(x->x_result); | |
| 261 | −} | |
| 262 | − | |
| 263 | −void tEnvPD_processBlock(tEnvPD* const xpd, float* in) | |
| 264 | −{ | |
| 265 | − _tEnvPD* x = *xpd; | |
| 266 | − | |
| 267 | − int n = x->blockSize; | |
| 268 | − | |
| 269 | − int count; | |
| 270 | − t_sample *sump; | |
| 271 | − in += n; | |
| 272 | − for (count = x->x_phase, sump = x->x_sumbuf; | |
| 273 | − count < x->x_npoints; count += x->x_realperiod, sump++) | |
| 274 | − { | |
| 275 | − t_sample *hp = x->buf + count; | |
| 276 | − t_sample *fp = in; | |
| 277 | − t_sample sum = *sump; | |
| 278 | − int i; | |
| 279 | − | |
| 280 | − for (i = 0; i < n; i++) | |
| 281 | − { | |
| 282 | − fp--; | |
| 283 | − sum += *hp++ * (*fp * *fp); | |
| 284 | − } | |
| 285 | − *sump = sum; | |
| 286 | − } | |
| 287 | − sump[0] = 0; | |
| 288 | − x->x_phase -= n; | |
| 289 | − if (x->x_phase < 0) | |
| 290 | − { | |
| 291 | − x->x_result = x->x_sumbuf[0]; | |
| 292 | − for (count = x->x_realperiod, sump = x->x_sumbuf; | |
| 293 | − count < x->x_npoints; count += x->x_realperiod, sump++) | |
| 294 | − sump[0] = sump[1]; | |
| 295 | − sump[0] = 0; | |
| 296 | − x->x_phase = x->x_realperiod - n; | |
| 297 | − } | |
| 298 | −} | |
| 299 | − | |
| 300 | −//=========================================================================== | |
| 301 | −// ATTACKDETECTION | |
| 302 | −//=========================================================================== | |
| 303 | −/********Private function prototypes**********/ | |
| 304 | −static void atkdtk_init(tAttackDetection* const a, int blocksize, int atk, int rel); | |
| 305 | −static void atkdtk_envelope(tAttackDetection* const a, float *in); | |
| 306 | − | |
| 307 | −/********Constructor/Destructor***************/ | |
| 308 | − | |
| 309 | −void tAttackDetection_init(tAttackDetection* const ad, int blocksize, int atk, int rel) | |
| 310 | −{ | |
| 311 | − *ad = (_tAttackDetection*) leaf_alloc(sizeof(_tAttackDetection)); | |
| 312 | − | |
| 313 | − atkdtk_init(ad, blocksize, atk, rel); | |
| 314 | −} | |
| 315 | − | |
| 316 | −void tAttackDetection_free(tAttackDetection* const ad) | |
| 317 | −{ | |
| 318 | − _tAttackDetection* a = *ad; | |
| 319 | − | |
| 320 | − leaf_free(a); | |
| 321 | −} | |
| 322 | − | |
| 323 | −void tAttackDetection_initToPool (tAttackDetection* const ad, int blocksize, int atk, int rel, tMempool* const mp) | |
| 324 | −{ | |
| 325 | − _tMempool* m = *mp; | |
| 326 | − *ad = (_tAttackDetection*) mpool_alloc(sizeof(_tAttackDetection), &m->pool); | |
| 327 | − | |
| 328 | − atkdtk_init(ad, blocksize, atk, rel); | |
| 329 | −} | |
| 330 | − | |
| 331 | −void tAttackDetection_freeFromPool (tAttackDetection* const ad, tMempool* const mp) | |
| 332 | −{ | |
| 333 | − _tMempool* m = *mp; | |
| 334 | − _tAttackDetection* a = *ad; | |
| 335 | − | |
| 336 | − mpool_free(a, &m->pool); | |
| 337 | −} | |
| 338 | − | |
| 339 | −/*******Public Functions***********/ | |
| 340 | − | |
| 341 | − | |
| 342 | −void tAttackDetection_setBlocksize(tAttackDetection* const ad, int size) | |
| 343 | −{ | |
| 344 | − _tAttackDetection* a = *ad; | |
| 345 | − | |
| 346 | − if(!((size==64)|(size==128)|(size==256)|(size==512)|(size==1024)|(size==2048))) | |
| 347 | − size = DEFBLOCKSIZE; | |
| 348 | − a->blocksize = size; | |
| 349 | − | |
| 350 | − return; | |
| 351 | − | |
| 352 | −} | |
| 353 | − | |
| 354 | −void tAttackDetection_setSamplerate(tAttackDetection* const ad, int inRate) | |
| 355 | −{ | |
| 356 | − _tAttackDetection* a = *ad; | |
| 357 | − | |
| 358 | − a->samplerate = inRate; | |
| 359 | − | |
| 360 | − //Reset atk and rel to recalculate coeff | |
| 361 | − tAttackDetection_setAttack(ad, a->atk); | |
| 362 | − tAttackDetection_setRelease(ad, a->rel); | |
| 363 | −} | |
| 364 | − | |
| 365 | −void tAttackDetection_setThreshold(tAttackDetection* const ad, float thres) | |
| 366 | −{ | |
| 367 | − _tAttackDetection* a = *ad; | |
| 368 | − a->threshold = thres; | |
| 369 | −} | |
| 370 | − | |
| 371 | −void tAttackDetection_setAttack(tAttackDetection* const ad, int inAtk) | |
| 372 | −{ | |
| 373 | − _tAttackDetection* a = *ad; | |
| 374 | − a->atk = inAtk; | |
| 375 | − a->atk_coeff = pow(0.01, 1.0/(a->atk * a->samplerate * 0.001)); | |
| 376 | −} | |
| 377 | − | |
| 378 | −void tAttackDetection_setRelease(tAttackDetection* const ad, int inRel) | |
| 379 | −{ | |
| 380 | − _tAttackDetection* a = *ad; | |
| 381 | − a->rel = inRel; | |
| 382 | − a->rel_coeff = pow(0.01, 1.0/(a->rel * a->samplerate * 0.001)); | |
| 383 | −} | |
| 384 | − | |
| 385 | − | |
| 386 | −int tAttackDetection_detect(tAttackDetection* const ad, float *in) | |
| 387 | −{ | |
| 388 | − _tAttackDetection* a = *ad; | |
| 389 | − | |
| 390 | − int result; | |
| 391 | − | |
| 392 | − atkdtk_envelope(ad, in); | |
| 393 | − | |
| 394 | − if(a->env >= a->prevAmp*2) //2 times greater = 6dB increase | |
| 395 | − result = 1; | |
| 396 | − else | |
| 397 | − result = 0; | |
| 398 | − | |
| 399 | − a->prevAmp = a->env; | |
| 400 | − | |
| 401 | − return result; | |
| 402 | −} | |
| 403 | − | |
| 404 | −/*******Private Functions**********/ | |
| 405 | − | |
| 406 | −static void atkdtk_init(tAttackDetection* const ad, int blocksize, int atk, int rel) | |
| 407 | −{ | |
| 408 | − _tAttackDetection* a = *ad; | |
| 409 | − | |
| 410 | − a->env = 0; | |
| 411 | − a->blocksize = blocksize; | |
| 412 | − a->threshold = DEFTHRESHOLD; | |
| 413 | − a->samplerate = leaf.sampleRate; | |
| 414 | − a->prevAmp = 0; | |
| 415 | − | |
| 416 | − a->env = 0; | |
| 417 | − | |
| 418 | − tAttackDetection_setAttack(ad, atk); | |
| 419 | − tAttackDetection_setRelease(ad, rel); | |
| 420 | −} | |
| 421 | − | |
| 422 | −static void atkdtk_envelope(tAttackDetection* const ad, float *in) | |
| 423 | −{ | |
| 424 | − _tAttackDetection* a = *ad; | |
| 425 | − | |
| 426 | − int i = 0; | |
| 427 | − float tmp; | |
| 428 | − for(i = 0; i < a->blocksize; ++i){ | |
| 429 | − tmp = fastabsf(in[i]); | |
| 430 | − | |
| 431 | − if(tmp > a->env) | |
| 432 | − a->env = a->atk_coeff * (a->env - tmp) + tmp; | |
| 433 | − else | |
| 434 | − a->env = a->rel_coeff * (a->env - tmp) + tmp; | |
| 435 | − } | |
| 436 | − | |
| 437 | −} | |
| 438 | − | |
| 439 | −//=========================================================================== | |
| 440 | −// SNAC | |
| 441 | −//=========================================================================== | |
| 442 | −/******************************************************************************/ | |
| 443 | −/***************************** private procedures *****************************/ | |
| 444 | −/******************************************************************************/ | |
| 445 | − | |
| 446 | −#define REALFFT mayer_realfft | |
| 447 | −#define REALIFFT mayer_realifft | |
| 448 | − | |
| 449 | −static void snac_analyzeframe(tSNAC* const s); | |
| 450 | −static void snac_autocorrelation(tSNAC* const s); | |
| 451 | −static void snac_normalize(tSNAC* const s); | |
| 452 | −static void snac_pickpeak(tSNAC* const s); | |
| 453 | −static void snac_periodandfidelity(tSNAC* const s); | |
| 454 | −static void snac_biasbuf(tSNAC* const s); | |
| 455 | −static float snac_spectralpeak(tSNAC* const s, float periodlength); | |
| 456 | − | |
| 457 | − | |
| 458 | −/******************************************************************************/ | |
| 459 | −/******************************** constructor, destructor *********************/ | |
| 460 | −/******************************************************************************/ | |
| 461 | − | |
| 462 | − | |
| 463 | −void tSNAC_init(tSNAC* const snac, int overlaparg) | |
| 464 | −{ | |
| 465 | − _tSNAC* s = *snac = (_tSNAC*) leaf_calloc(sizeof(_tSNAC)); | |
| 466 | − | |
| 467 | − s->biasfactor = DEFBIAS; | |
| 468 | − s->timeindex = 0; | |
| 469 | − s->periodindex = 0; | |
| 470 | − s->periodlength = 0.; | |
| 471 | − s->fidelity = 0.; | |
| 472 | − s->minrms = DEFMINRMS; | |
| 473 | − s->framesize = SNAC_FRAME_SIZE; | |
| 474 | − | |
| 475 | − s->inputbuf = (float*) leaf_calloc(sizeof(float) * SNAC_FRAME_SIZE); | |
| 476 | − s->processbuf = (float*) leaf_calloc(sizeof(float) * (SNAC_FRAME_SIZE * 2)); | |
| 477 | − s->spectrumbuf = (float*) leaf_calloc(sizeof(float) * (SNAC_FRAME_SIZE / 2)); | |
| 478 | − s->biasbuf = (float*) leaf_calloc(sizeof(float) * SNAC_FRAME_SIZE); | |
| 479 | − | |
| 480 | − snac_biasbuf(snac); | |
| 481 | − tSNAC_setOverlap(snac, overlaparg); | |
| 482 | −} | |
| 483 | − | |
| 484 | −void tSNAC_free(tSNAC* const snac) | |
| 485 | −{ | |
| 486 | − _tSNAC* s = *snac; | |
| 487 | − | |
| 488 | − leaf_free(s->inputbuf); | |
| 489 | − leaf_free(s->processbuf); | |
| 490 | − leaf_free(s->spectrumbuf); | |
| 491 | − leaf_free(s->biasbuf); | |
| 492 | − leaf_free(s); | |
| 493 | −} | |
| 494 | − | |
| 495 | −void tSNAC_initToPool (tSNAC* const snac, int overlaparg, tMempool* const mp) | |
| 496 | −{ | |
| 497 | − _tMempool* m = *mp; | |
| 498 | − _tSNAC* s = *snac = (_tSNAC*) mpool_alloc(sizeof(_tSNAC), &m->pool); | |
| 499 | − | |
| 500 | − s->biasfactor = DEFBIAS; | |
| 501 | − s->timeindex = 0; | |
| 502 | − s->periodindex = 0; | |
| 503 | − s->periodlength = 0.; | |
| 504 | − s->fidelity = 0.; | |
| 505 | − s->minrms = DEFMINRMS; | |
| 506 | − s->framesize = SNAC_FRAME_SIZE; | |
| 507 | − | |
| 508 | − s->inputbuf = (float*) mpool_calloc(sizeof(float) * SNAC_FRAME_SIZE, &m->pool); | |
| 509 | − s->processbuf = (float*) mpool_calloc(sizeof(float) * (SNAC_FRAME_SIZE * 2), &m->pool); | |
| 510 | − s->spectrumbuf = (float*) mpool_calloc(sizeof(float) * (SNAC_FRAME_SIZE / 2), &m->pool); | |
| 511 | − s->biasbuf = (float*) mpool_calloc(sizeof(float) * SNAC_FRAME_SIZE, &m->pool); | |
| 512 | − | |
| 513 | − snac_biasbuf(snac); | |
| 514 | − tSNAC_setOverlap(snac, overlaparg); | |
| 515 | −} | |
| 516 | − | |
| 517 | −void tSNAC_freeFromPool (tSNAC* const snac, tMempool* const mp) | |
| 518 | −{ | |
| 519 | − _tMempool* m = *mp; | |
| 520 | − _tSNAC* s = *snac; | |
| 521 | − | |
| 522 | − mpool_free(s->inputbuf, &m->pool); | |
| 523 | − mpool_free(s->processbuf, &m->pool); | |
| 524 | − mpool_free(s->spectrumbuf, &m->pool); | |
| 525 | − mpool_free(s->biasbuf, &m->pool); | |
| 526 | − mpool_free(s, &m->pool); | |
| 527 | −} | |
| 528 | − | |
| 529 | −/******************************************************************************/ | |
| 530 | −/************************** public access functions****************************/ | |
| 531 | −/******************************************************************************/ | |
| 532 | − | |
| 533 | − | |
| 534 | −void tSNAC_ioSamples(tSNAC* const snac, float *in, float *out, int size) | |
| 535 | −{ | |
| 536 | − _tSNAC* s = *snac; | |
| 537 | − | |
| 538 | − int timeindex = s->timeindex; | |
| 539 | − int mask = s->framesize - 1; | |
| 540 | − int outindex = 0; | |
| 541 | − float *inputbuf = s->inputbuf; | |
| 542 | − float *processbuf = s->processbuf; | |
| 543 | − | |
| 544 | − // call analysis function when it is time | |
| 545 | − if(!(timeindex & (s->framesize / s->overlap - 1))) snac_analyzeframe(snac); | |
| 546 | − | |
| 547 | − while(size--) | |
| 548 | − { | |
| 549 | − inputbuf[timeindex] = *in++; | |
| 550 | − out[outindex++] = processbuf[timeindex++]; | |
| 551 | − timeindex &= mask; | |
| 552 | − } | |
| 553 | − s->timeindex = timeindex; | |
| 554 | −} | |
| 555 | − | |
| 556 | −void tSNAC_setOverlap(tSNAC* const snac, int lap) | |
| 557 | −{ | |
| 558 | − _tSNAC* s = *snac; | |
| 559 | − if(!((lap==1)|(lap==2)|(lap==4)|(lap==8))) lap = DEFOVERLAP; | |
| 560 | − s->overlap = lap; | |
| 561 | −} | |
| 562 | − | |
| 563 | − | |
| 564 | −void tSNAC_setBias(tSNAC* const snac, float bias) | |
| 565 | −{ | |
| 566 | − _tSNAC* s = *snac; | |
| 567 | − if(bias > 1.) bias = 1.; | |
| 568 | − if(bias < 0.) bias = 0.; | |
| 569 | − s->biasfactor = bias; | |
| 570 | − snac_biasbuf(snac); | |
| 571 | − return; | |
| 572 | −} | |
| 573 | − | |
| 574 | − | |
| 575 | −void tSNAC_setMinRMS(tSNAC* const snac, float rms) | |
| 576 | −{ | |
| 577 | − _tSNAC* s = *snac; | |
| 578 | − if(rms > 1.) rms = 1.; | |
| 579 | − if(rms < 0.) rms = 0.; | |
| 580 | − s->minrms = rms; | |
| 581 | − return; | |
| 582 | −} | |
| 583 | − | |
| 584 | − | |
| 585 | −float tSNAC_getPeriod(tSNAC* const snac) | |
| 586 | −{ | |
| 587 | − _tSNAC* s = *snac; | |
| 588 | − return(s->periodlength); | |
| 589 | −} | |
| 590 | − | |
| 591 | − | |
| 592 | −float tSNAC_getFidelity(tSNAC* const snac) | |
| 593 | −{ | |
| 594 | − _tSNAC* s = *snac; | |
| 595 | − return(s->fidelity); | |
| 596 | −} | |
| 597 | − | |
| 598 | − | |
| 599 | −/******************************************************************************/ | |
| 600 | −/***************************** private procedures *****************************/ | |
| 601 | −/******************************************************************************/ | |
| 602 | − | |
| 603 | − | |
| 604 | −// main analysis function | |
| 605 | −static void snac_analyzeframe(tSNAC* const snac) | |
| 606 | −{ | |
| 607 | − _tSNAC* s = *snac; | |
| 608 | − | |
| 609 | − int n, tindex = s->timeindex; | |
| 610 | − int framesize = s->framesize; | |
| 611 | − int mask = framesize - 1; | |
| 612 | − float norm = 1. / sqrt((float)(framesize * 2)); | |
| 613 | − | |
| 614 | − float *inputbuf = s->inputbuf; | |
| 615 | − float *processbuf = s->processbuf; | |
| 616 | − | |
| 617 | − // copy input to processing buffers | |
| 618 | − for(n=0; n<framesize; n++) | |
| 619 | − { | |
| 620 | − processbuf[n] = inputbuf[tindex] * norm; | |
| 621 | − tindex++; | |
| 622 | − tindex &= mask; | |
| 623 | − } | |
| 624 | − | |
| 625 | − // zeropadding | |
| 626 | − for(n=framesize; n<(framesize<<1); n++) processbuf[n] = 0.; | |
| 627 | − | |
| 628 | − // call analysis procedures | |
| 629 | − snac_autocorrelation(snac); | |
| 630 | − snac_normalize(snac); | |
| 631 | − snac_pickpeak(snac); | |
| 632 | − snac_periodandfidelity(snac); | |
| 633 | −} | |
| 634 | − | |
| 635 | − | |
| 636 | −static void snac_autocorrelation(tSNAC* const snac) | |
| 637 | −{ | |
| 638 | − _tSNAC* s = *snac; | |
| 639 | − | |
| 640 | − int n, m; | |
| 641 | − int framesize = s->framesize; | |
| 642 | − int fftsize = framesize * 2; | |
| 643 | − float *processbuf = s->processbuf; | |
| 644 | − float *spectrumbuf = s->spectrumbuf; | |
| 645 | − | |
| 646 | − REALFFT(fftsize, processbuf); | |
| 647 | − | |
| 648 | − // compute power spectrum | |
| 649 | − processbuf[0] *= processbuf[0]; // DC | |
| 650 | − processbuf[framesize] *= processbuf[framesize]; // Nyquist | |
| 651 | − | |
| 652 | − for(n=1; n<framesize; n++) | |
| 653 | − { | |
| 654 | − processbuf[n] = processbuf[n] * processbuf[n] | |
| 655 | − + processbuf[fftsize-n] * processbuf[fftsize-n]; // imag coefficients appear reversed | |
| 656 | − processbuf[fftsize-n] = 0.; | |
| 657 | − } | |
| 658 | − | |
| 659 | − // store power spectrum up to SR/4 for possible later use | |
| 660 | − for(m=0; m<(framesize>>1); m++) | |
| 661 | − { | |
| 662 | − spectrumbuf[m] = processbuf[m]; | |
| 663 | − } | |
| 664 | − | |
| 665 | − // transform power spectrum to autocorrelation function | |
| 666 | − REALIFFT(fftsize, processbuf); | |
| 667 | − return; | |
| 668 | −} | |
| 669 | − | |
| 670 | − | |
| 671 | −static void snac_normalize(tSNAC* const snac) | |
| 672 | −{ | |
| 673 | − _tSNAC* s = *snac; | |
| 674 | − | |
| 675 | − int framesize = s->framesize; | |
| 676 | − int framesizeplustimeindex = s->framesize + s->timeindex; | |
| 677 | − int timeindexminusone = s->timeindex - 1; | |
| 678 | − int n, m; | |
| 679 | − int mask = framesize - 1; | |
| 680 | − int seek = framesize * SEEK; | |
| 681 | − float *inputbuf = s->inputbuf; | |
| 682 | − float *processbuf= s->processbuf; | |
| 683 | − float signal1, signal2; | |
| 684 | − | |
| 685 | − // minimum RMS implemented as minimum autocorrelation at index 0 | |
| 686 | − // functionally equivalent to white noise floor | |
| 687 | − float rms = s->minrms / sqrt(1.0f / (float)framesize); | |
| 688 | − float minrzero = rms * rms; | |
| 689 | − float rzero = processbuf[0]; | |
| 690 | − if(rzero < minrzero) rzero = minrzero; | |
| 691 | − double normintegral = (double)rzero * 2.; | |
| 692 | − | |
| 693 | − // normalize biased autocorrelation function | |
| 694 | − // inputbuf is circular buffer: timeindex may be non-zero when overlap > 1 | |
| 695 | − processbuf[0] = 1; | |
| 696 | − for(n=1, m=s->timeindex+1; n<seek; n++, m++) | |
| 697 | − { | |
| 698 | − signal1 = inputbuf[(n + timeindexminusone)&mask]; | |
| 699 | − signal2 = inputbuf[(framesizeplustimeindex - n)&mask]; | |
| 700 | − normintegral -= (double)(signal1 * signal1 + signal2 * signal2); | |
| 701 | − processbuf[n] /= (float)normintegral * 0.5f; | |
| 702 | − } | |
| 703 | − | |
| 704 | − // flush instable function tail | |
| 705 | − for(n = seek; n<framesize; n++) processbuf[n] = 0.; | |
| 706 | − return; | |
| 707 | −} | |
| 708 | − | |
| 709 | − | |
| 710 | −static void snac_periodandfidelity(tSNAC* const snac) | |
| 711 | −{ | |
| 712 | − _tSNAC* s = *snac; | |
| 713 | − | |
| 714 | − float periodlength; | |
| 715 | − | |
| 716 | − if(s->periodindex) | |
| 717 | − { | |
| 718 | − periodlength = (float)s->periodindex + | |
| 719 | − interpolate3phase(s->processbuf, s->periodindex); | |
| 720 | − if(periodlength < 8) periodlength = snac_spectralpeak(snac, periodlength); | |
| 721 | − s->periodlength = periodlength; | |
| 722 | − s->fidelity = interpolate3max(s->processbuf, s->periodindex); | |
| 723 | − } | |
| 724 | − return; | |
| 725 | −} | |
| 726 | − | |
| 727 | −// select the peak which most probably represents period length | |
| 728 | −static void snac_pickpeak(tSNAC* const snac) | |
| 729 | −{ | |
| 730 | − _tSNAC* s = *snac; | |
| 731 | − | |
| 732 | − int n, peakindex=0; | |
| 733 | − int seek = s->framesize * SEEK; | |
| 734 | − float *processbuf= s->processbuf; | |
| 735 | − float maxvalue = 0.; | |
| 736 | − float biasedpeak; | |
| 737 | − float *biasbuf = s->biasbuf; | |
| 738 | − | |
| 739 | − // skip main lobe | |
| 740 | − for(n=1; n<seek; n++) | |
| 741 | − { | |
| 742 | − if(processbuf[n] < 0.) break; | |
| 743 | − } | |
| 744 | − | |
| 745 | − // find interpolated / biased maximum in SNAC function | |
| 746 | − // interpolation finds the 'real maximum' | |
| 747 | − // biasing favours the first candidate | |
| 748 | − for(; n<seek-1; n++) | |
| 749 | − { | |
| 750 | − if(processbuf[n] >= processbuf[n-1]) | |
| 751 | − { | |
| 752 | − if(processbuf[n] > processbuf[n+1]) // we have a local peak | |
| 753 | − { | |
| 754 | − biasedpeak = interpolate3max(processbuf, n) * biasbuf[n]; | |
| 755 | − | |
| 756 | − if(biasedpeak > maxvalue) | |
| 757 | − { | |
| 758 | − maxvalue = biasedpeak; | |
| 759 | − peakindex = n; | |
| 760 | − } | |
| 761 | − } | |
| 762 | − } | |
| 763 | − } | |
| 764 | − s->periodindex = peakindex; | |
| 765 | − return; | |
| 766 | −} | |
| 767 | − | |
| 768 | − | |
| 769 | −// verify period length via frequency domain (up till SR/4) | |
| 770 | −// frequency domain is more precise than lag domain for period lengths < 8 | |
| 771 | −// argument 'periodlength' is initial estimation from autocorrelation | |
| 772 | −static float snac_spectralpeak(tSNAC* const snac, float periodlength) | |
| 773 | −{ | |
| 774 | − _tSNAC* s = *snac; | |
| 775 | − | |
| 776 | − if(periodlength < 4.0f) return periodlength; | |
| 777 | − | |
| 778 | − float max = 0.; | |
| 779 | − int n, startbin, stopbin, peakbin = 0; | |
| 780 | − int spectrumsize = s->framesize>>1; | |
| 781 | − float *spectrumbuf = s->spectrumbuf; | |
| 782 | − float peaklocation = (float)(s->framesize * 2.0f) / periodlength; | |
| 783 | − | |
| 784 | − startbin = (int)(peaklocation * 0.8f + 0.5f); | |
| 785 | − if(startbin < 1) startbin = 1; | |
| 786 | − stopbin = (int)(peaklocation * 1.25f + 0.5f); | |
| 787 | − if(stopbin >= spectrumsize - 1) stopbin = spectrumsize - 1; | |
| 788 | − | |
| 789 | − for(n=startbin; n<stopbin; n++) | |
| 790 | − { | |
| 791 | − if(spectrumbuf[n] >= spectrumbuf[n-1]) | |
| 792 | − { | |
| 793 | − if(spectrumbuf[n] > spectrumbuf[n+1]) | |
| 794 | − { | |
| 795 | − if(spectrumbuf[n] > max) | |
| 796 | − { | |
| 797 | − max = spectrumbuf[n]; | |
| 798 | − peakbin = n; | |
| 799 | − } | |
| 800 | − } | |
| 801 | − } | |
| 802 | − } | |
| 803 | − | |
| 804 | − // calculate amplitudes in peak region | |
| 805 | − for(n=(peakbin-1); n<(peakbin+2); n++) | |
| 806 | − { | |
| 807 | − spectrumbuf[n] = sqrtf(spectrumbuf[n]); | |
| 808 | − } | |
| 809 | − | |
| 810 | − peaklocation = (float)peakbin + interpolate3phase(spectrumbuf, peakbin); | |
| 811 | − periodlength = (float)(s->framesize * 2.0f) / peaklocation; | |
| 812 | − | |
| 813 | − return periodlength; | |
| 814 | −} | |
| 815 | − | |
| 816 | − | |
| 817 | −// modified logarithmic bias function | |
| 818 | −static void snac_biasbuf(tSNAC* const snac) | |
| 819 | −{ | |
| 820 | − _tSNAC* s = *snac; | |
| 821 | − | |
| 822 | − int n; | |
| 823 | − int maxperiod = (int)(s->framesize * (float)SEEK); | |
| 824 | − float bias = s->biasfactor / logf((float)(maxperiod - 4)); | |
| 825 | − float *biasbuf = s->biasbuf; | |
| 826 | − | |
| 827 | − for(n=0; n<5; n++) // periods < 5 samples can't be tracked | |
| 828 | − { | |
| 829 | − biasbuf[n] = 0.0f; | |
| 830 | − } | |
| 831 | − | |
| 832 | − for(n=5; n<maxperiod; n++) | |
| 833 | − { | |
| 834 | − biasbuf[n] = 1.0f - (float)logf(n - 4) * bias; | |
| 835 | − } | |
| 836 | −} | |
| 837 | − | |
| 838 | −//=========================================================================== | |
| 839 | −// PERIODDETECTION | |
| 840 | −//=========================================================================== | |
| 841 | −void tPeriodDetection_init (tPeriodDetection* const pd, float* in, float* out, int bufSize, int frameSize) | |
| 842 | −{ | |
| 843 | − tPeriodDetection_initToPool(pd, in, out, bufSize, frameSize, &leaf_mempool); | |
| 844 | −} | |
| 845 | − | |
| 846 | −void tPeriodDetection_free (tPeriodDetection* const pd) | |
| 847 | −{ | |
| 848 | − tPeriodDetection_freeFromPool(pd, &leaf_mempool); | |
| 849 | −} | |
| 850 | − | |
| 851 | −void tPeriodDetection_initToPool (tPeriodDetection* const pd, float* in, float* out, int bufSize, int frameSize, tMempool* const mp) | |
| 852 | −{ | |
| 853 | − _tMempool* m = *mp; | |
| 854 | − _tPeriodDetection* p = *pd = (_tPeriodDetection*) mpool_calloc(sizeof(_tPeriodDetection), &m->pool); | |
| 855 | − | |
| 856 | − p->inBuffer = in; | |
| 857 | − p->outBuffer = out; | |
| 858 | − p->bufSize = bufSize; | |
| 859 | − p->frameSize = frameSize; | |
| 860 | − p->framesPerBuffer = p->bufSize / p->frameSize; | |
| 861 | − p->curBlock = 1; | |
| 862 | − p->lastBlock = 0; | |
| 863 | − p->index = 0; | |
| 864 | − | |
| 865 | − p->hopSize = DEFHOPSIZE; | |
| 866 | − p->windowSize = DEFWINDOWSIZE; | |
| 867 | − p->fba = FBA; | |
| 868 | − | |
| 869 | − tEnvPD_initToPool(&p->env, p->windowSize, p->hopSize, p->frameSize, mp); | |
| 870 | − | |
| 871 | − tSNAC_initToPool(&p->snac, DEFOVERLAP, mp); | |
| 872 | − | |
| 873 | − p->timeConstant = DEFTIMECONSTANT; | |
| 874 | − p->radius = expf(-1000.0f * p->hopSize * leaf.invSampleRate / p->timeConstant); | |
| 875 | − p->fidelityThreshold = 0.95; | |
| 876 | −} | |
| 877 | − | |
| 878 | −void tPeriodDetection_freeFromPool (tPeriodDetection* const pd, tMempool* const mp) | |
| 879 | −{ | |
| 880 | − _tMempool* m = *mp; | |
| 881 | − _tPeriodDetection* p = *pd; | |
| 882 | − | |
| 883 | − tEnvPD_freeFromPool(&p->env, mp); | |
| 884 | − tSNAC_freeFromPool(&p->snac, mp); | |
| 885 | − mpool_free(p, &m->pool); | |
| 886 | −} | |
| 887 | − | |
| 888 | −float tPeriodDetection_tick (tPeriodDetection* pd, float sample) | |
| 889 | −{ | |
| 890 | − _tPeriodDetection* p = *pd; | |
| 891 | − | |
| 892 | − int i, iLast; | |
| 893 | − | |
| 894 | − i = (p->curBlock*p->frameSize); | |
| 895 | − iLast = (p->lastBlock*p->frameSize)+p->index; | |
| 896 | − | |
| 897 | − p->i = i; | |
| 898 | − p->iLast = iLast; | |
| 899 | − | |
| 900 | − p->inBuffer[i+p->index] = sample; | |
| 901 | − | |
| 902 | − p->index++; | |
| 903 | − p->indexstore = p->index; | |
| 904 | − if (p->index >= p->frameSize) | |
| 905 | − { | |
| 906 | − p->index = 0; | |
| 907 | − | |
| 908 | − tEnvPD_processBlock(&p->env, &(p->inBuffer[i])); | |
| 909 | − | |
| 910 | − tSNAC_ioSamples(&p->snac, &(p->inBuffer[i]), &(p->outBuffer[i]), p->frameSize); | |
| 911 | − float fidelity = tSNAC_getFidelity(&p->snac); | |
| 912 | − // Fidelity threshold recommended by Katja Vetters is 0.95 for most instruments/voices http://www.katjaas.nl/helmholtz/helmholtz.html | |
| 913 | − if (fidelity > p->fidelityThreshold) p->period = tSNAC_getPeriod(&p->snac); | |
| 914 | − | |
| 915 | − p->curBlock++; | |
| 916 | − if (p->curBlock >= p->framesPerBuffer) p->curBlock = 0; | |
| 917 | − p->lastBlock++; | |
| 918 | − if (p->lastBlock >= p->framesPerBuffer) p->lastBlock = 0; | |
| 919 | − } | |
| 920 | − | |
| 921 | − return p->period; | |
| 922 | −} | |
| 923 | − | |
| 924 | −float tPeriodDetection_getPeriod(tPeriodDetection* pd) | |
| 925 | −{ | |
| 926 | − _tPeriodDetection* p = *pd; | |
| 927 | − return p->period; | |
| 928 | −} | |
| 929 | − | |
| 930 | −void tPeriodDetection_setHopSize(tPeriodDetection* pd, int hs) | |
| 931 | −{ | |
| 932 | − _tPeriodDetection* p = *pd; | |
| 933 | − p->hopSize = hs; | |
| 934 | −} | |
| 935 | − | |
| 936 | −void tPeriodDetection_setWindowSize(tPeriodDetection* pd, int ws) | |
| 937 | −{ | |
| 938 | − _tPeriodDetection* p = *pd; | |
| 939 | − p->windowSize = ws; | |
| 940 | −} | |
| 941 | − | |
| 942 | −void tPeriodDetection_setFidelityThreshold(tPeriodDetection* pd, float threshold) | |
| 943 | −{ | |
| 944 | − _tPeriodDetection* p = *pd; | |
| 945 | − p->fidelityThreshold = threshold; | |
| 946 | −} | |
| @@ -1,928 +0,0 @@ | ||
| 1 | −/*============================================================================== | |
| 2 | − | |
| 3 | − leaf-delay.c | |
| 4 | − Created: 20 Jan 2017 12:01:24pm | |
| 5 | − Author: Michael R Mulshine | |
| 6 | − | |
| 7 | −==============================================================================*/ | |
| 8 | − | |
| 9 | −#if _WIN32 || _WIN64 | |
| 10 | − | |
| 11 | −#include "..\Inc\leaf-delay.h" | |
| 12 | −#include "..\leaf.h" | |
| 13 | − | |
| 14 | −#else | |
| 15 | − | |
| 16 | −#include "../Inc/leaf-delay.h" | |
| 17 | −#include "../leaf.h" | |
| 18 | − | |
| 19 | −#endif | |
| 20 | − | |
| 21 | −// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Delay ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ // | |
| 22 | −void tDelay_init (tDelay* const dl, uint32_t delay, uint32_t maxDelay) | |
| 23 | −{ | |
| 24 | − tDelay_initToPool(dl, delay, maxDelay, &leaf_mempool); | |
| 25 | −} | |
| 26 | − | |
| 27 | −void tDelay_free(tDelay* const dl) | |
| 28 | −{ | |
| 29 | − tDelay_freeFromPool(dl, &leaf_mempool); | |
| 30 | −} | |
| 31 | − | |
| 32 | −void tDelay_initToPool (tDelay* const dl, uint32_t delay, uint32_t maxDelay, tMempool* const mp) | |
| 33 | −{ | |
| 34 | − _tMempool* m = *mp; | |
| 35 | − _tDelay* d = *dl = (_tDelay*) mpool_alloc(sizeof(_tDelay), &m->pool); | |
| 36 | − | |
| 37 | − d->maxDelay = maxDelay; | |
| 38 | − | |
| 39 | − d->delay = delay; | |
| 40 | − | |
| 41 | − d->buff = (float*) mpool_alloc(sizeof(float) * maxDelay, &m->pool); | |
| 42 | − | |
| 43 | − d->inPoint = 0; | |
| 44 | − d->outPoint = 0; | |
| 45 | − | |
| 46 | − d->lastIn = 0.0f; | |
| 47 | − d->lastOut = 0.0f; | |
| 48 | − | |
| 49 | − d->gain = 1.0f; | |
| 50 | − | |
| 51 | − tDelay_setDelay(dl, d->delay); | |
| 52 | −} | |
| 53 | − | |
| 54 | −void tDelay_freeFromPool (tDelay* const dl, tMempool* const mp) | |
| 55 | −{ | |
| 56 | − _tMempool* m = *mp; | |
| 57 | − _tDelay* d = *dl; | |
| 58 | − | |
| 59 | − mpool_free(d->buff, &m->pool); | |
| 60 | − mpool_free(d, &m->pool); | |
| 61 | −} | |
| 62 | − | |
| 63 | −void tDelay_clear(tDelay* const dl) | |
| 64 | −{ | |
| 65 | − _tDelay* d = *dl; | |
| 66 | − for (int i = 0; i < d->maxDelay; i++) | |
| 67 | − { | |
| 68 | − d->buff[i] = 0; | |
| 69 | − } | |
| 70 | −} | |
| 71 | − | |
| 72 | −float tDelay_tick (tDelay* const dl, float input) | |
| 73 | −{ | |
| 74 | − _tDelay* d = *dl; | |
| 75 | − | |
| 76 | − // Input | |
| 77 | − d->lastIn = input; | |
| 78 | − d->buff[d->inPoint] = input * d->gain; | |
| 79 | − if (++(d->inPoint) == d->maxDelay) d->inPoint = 0; | |
| 80 | − | |
| 81 | − // Output | |
| 82 | − d->lastOut = d->buff[d->outPoint]; | |
| 83 | − if (++(d->outPoint) == d->maxDelay) d->outPoint = 0; | |
| 84 | − | |
| 85 | − return d->lastOut; | |
| 86 | −} | |
| 87 | − | |
| 88 | −int tDelay_setDelay (tDelay* const dl, uint32_t delay) | |
| 89 | −{ | |
| 90 | − _tDelay* d = *dl; | |
| 91 | − | |
| 92 | − d->delay = LEAF_clip(0.0f, delay, d->maxDelay); | |
| 93 | − | |
| 94 | − // read chases write | |
| 95 | − if ( d->inPoint >= delay ) d->outPoint = d->inPoint - d->delay; | |
| 96 | − else d->outPoint = d->maxDelay + d->inPoint - d->delay; | |
| 97 | − | |
| 98 | − return 0; | |
| 99 | −} | |
| 100 | − | |
| 101 | −float tDelay_tapOut (tDelay* const dl, uint32_t tapDelay) | |
| 102 | −{ | |
| 103 | − _tDelay* d = *dl; | |
| 104 | − | |
| 105 | − int32_t tap = d->inPoint - tapDelay - 1; | |
| 106 | − | |
| 107 | − // Check for wraparound. | |
| 108 | − while ( tap < 0 ) tap += d->maxDelay; | |
| 109 | − | |
| 110 | − return d->buff[tap]; | |
| 111 | − | |
| 112 | −} | |
| 113 | − | |
| 114 | −void tDelay_tapIn (tDelay* const dl, float value, uint32_t tapDelay) | |
| 115 | −{ | |
| 116 | − _tDelay* d = *dl; | |
| 117 | − | |
| 118 | − int32_t tap = d->inPoint - tapDelay - 1; | |
| 119 | − | |
| 120 | − // Check for wraparound. | |
| 121 | − while ( tap < 0 ) tap += d->maxDelay; | |
| 122 | − | |
| 123 | − d->buff[tap] = value; | |
| 124 | −} | |
| 125 | − | |
| 126 | −float tDelay_addTo (tDelay* const dl, float value, uint32_t tapDelay) | |
| 127 | −{ | |
| 128 | − _tDelay* d = *dl; | |
| 129 | − | |
| 130 | − int32_t tap = d->inPoint - tapDelay - 1; | |
| 131 | − | |
| 132 | − // Check for wraparound. | |
| 133 | − while ( tap < 0 ) tap += d->maxDelay; | |
| 134 | − | |
| 135 | − return (d->buff[tap] += value); | |
| 136 | −} | |
| 137 | − | |
| 138 | −uint32_t tDelay_getDelay (tDelay* const dl) | |
| 139 | −{ | |
| 140 | − _tDelay* d = *dl; | |
| 141 | − return d->delay; | |
| 142 | −} | |
| 143 | − | |
| 144 | −float tDelay_getLastOut (tDelay* const dl) | |
| 145 | −{ | |
| 146 | − _tDelay* d = *dl; | |
| 147 | − return d->lastOut; | |
| 148 | −} | |
| 149 | − | |
| 150 | −float tDelay_getLastIn (tDelay* const dl) | |
| 151 | −{ | |
| 152 | − _tDelay* d = *dl; | |
| 153 | − return d->lastIn; | |
| 154 | −} | |
| 155 | − | |
| 156 | −void tDelay_setGain (tDelay* const dl, float gain) | |
| 157 | −{ | |
| 158 | − _tDelay* d = *dl; | |
| 159 | − if (gain < 0.0f) d->gain = 0.0f; | |
| 160 | − else d->gain = gain; | |
| 161 | −} | |
| 162 | − | |
| 163 | −float tDelay_getGain (tDelay* const dl) | |
| 164 | −{ | |
| 165 | − _tDelay* d = *dl; | |
| 166 | − return d->gain; | |
| 167 | −} | |
| 168 | − | |
| 169 | −// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ LinearDelay ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ // | |
| 170 | −void tLinearDelay_init (tLinearDelay* const dl, float delay, uint32_t maxDelay) | |
| 171 | −{ | |
| 172 | − tLinearDelay_initToPool(dl, delay, maxDelay, &leaf_mempool); | |
| 173 | −} | |
| 174 | − | |
| 175 | −void tLinearDelay_free(tLinearDelay* const dl) | |
| 176 | −{ | |
| 177 | − tLinearDelay_freeFromPool(dl, &leaf_mempool); | |
| 178 | −} | |
| 179 | − | |
| 180 | −void tLinearDelay_initToPool (tLinearDelay* const dl, float delay, uint32_t maxDelay, tMempool* const mp) | |
| 181 | −{ | |
| 182 | − _tMempool* m = *mp; | |
| 183 | − _tLinearDelay* d = *dl = (_tLinearDelay*) mpool_alloc(sizeof(_tLinearDelay), &m->pool); | |
| 184 | − | |
| 185 | − d->maxDelay = maxDelay; | |
| 186 | − | |
| 187 | − if (delay > maxDelay) d->delay = maxDelay; | |
| 188 | − else if (delay < 0.0f) d->delay = 0.0f; | |
| 189 | − else d->delay = delay; | |
| 190 | − | |
| 191 | − d->buff = (float*) mpool_alloc(sizeof(float) * maxDelay, &m->pool); | |
| 192 | − | |
| 193 | − d->gain = 1.0f; | |
| 194 | − | |
| 195 | − d->lastIn = 0.0f; | |
| 196 | − d->lastOut = 0.0f; | |
| 197 | − | |
| 198 | − d->inPoint = 0; | |
| 199 | − d->outPoint = 0; | |
| 200 | − | |
| 201 | − tLinearDelay_setDelay(dl, d->delay); | |
| 202 | −} | |
| 203 | − | |
| 204 | −void tLinearDelay_freeFromPool(tLinearDelay* const dl, tMempool* const mp) | |
| 205 | −{ | |
| 206 | − _tMempool* m = *mp; | |
| 207 | − _tLinearDelay* d = *dl; | |
| 208 | − | |
| 209 | − mpool_free(d->buff, &m->pool); | |
| 210 | − mpool_free(d, &m->pool); | |
| 211 | −} | |
| 212 | − | |
| 213 | −void tLinearDelay_clear(tLinearDelay* const dl) | |
| 214 | −{ | |
| 215 | − _tLinearDelay* d = *dl; | |
| 216 | − for (int i = 0; i < d->maxDelay; i++) | |
| 217 | − { | |
| 218 | − d->buff[i] = 0; | |
| 219 | − } | |
| 220 | −} | |
| 221 | − | |
| 222 | −float tLinearDelay_tick (tLinearDelay* const dl, float input) | |
| 223 | −{ | |
| 224 | − _tLinearDelay* d = *dl; | |
| 225 | − | |
| 226 | − d->buff[d->inPoint] = input * d->gain; | |
| 227 | − | |
| 228 | − // Increment input pointer modulo length. | |
| 229 | − if (++(d->inPoint) == d->maxDelay ) d->inPoint = 0; | |
| 230 | − | |
| 231 | − uint32_t idx = (uint32_t) d->outPoint; | |
| 232 | − // First 1/2 of interpolation | |
| 233 | − d->lastOut = d->buff[idx] * d->omAlpha; | |
| 234 | − // Second 1/2 of interpolation | |
| 235 | − if ((idx + 1) < d->maxDelay) | |
| 236 | − d->lastOut += d->buff[idx+1] * d->alpha; | |
| 237 | − else | |
| 238 | − d->lastOut += d->buff[0] * d->alpha; | |
| 239 | − | |
| 240 | − // Increment output pointer modulo length | |
| 241 | − if ( (++d->outPoint) >= d->maxDelay ) d->outPoint = 0; | |
| 242 | − | |
| 243 | − return d->lastOut; | |
| 244 | −} | |
| 245 | − | |
| 246 | −void tLinearDelay_tickIn (tLinearDelay* const dl, float input) | |
| 247 | −{ | |
| 248 | − _tLinearDelay* d = *dl; | |
| 249 | − | |
| 250 | − d->buff[d->inPoint] = input * d->gain; | |
| 251 | − | |
| 252 | − // Increment input pointer modulo length. | |
| 253 | − if (++(d->inPoint) == d->maxDelay ) d->inPoint = 0; | |
| 254 | −} | |
| 255 | − | |
| 256 | −float tLinearDelay_tickOut (tLinearDelay* const dl) | |
| 257 | −{ | |
| 258 | − _tLinearDelay* d = *dl; | |
| 259 | − | |
| 260 | − uint32_t idx = (uint32_t) d->outPoint; | |
| 261 | − // First 1/2 of interpolation | |
| 262 | − d->lastOut = d->buff[idx] * d->omAlpha; | |
| 263 | − // Second 1/2 of interpolation | |
| 264 | − if ((idx + 1) < d->maxDelay) | |
| 265 | − d->lastOut += d->buff[idx+1] * d->alpha; | |
| 266 | − else | |
| 267 | − d->lastOut += d->buff[0] * d->alpha; | |
| 268 | − | |
| 269 | − // Increment output pointer modulo length | |
| 270 | − if ( (++d->outPoint) >= d->maxDelay ) d->outPoint = 0; | |
| 271 | − | |
| 272 | − return d->lastOut; | |
| 273 | −} | |
| 274 | − | |
| 275 | −int tLinearDelay_setDelay (tLinearDelay* const dl, float delay) | |
| 276 | −{ | |
| 277 | − _tLinearDelay* d = *dl; | |
| 278 | − | |
| 279 | − d->delay = LEAF_clip(0.0f, delay, d->maxDelay); | |
| 280 | − | |
| 281 | − float outPointer = d->inPoint - d->delay; | |
| 282 | − | |
| 283 | − while ( outPointer < 0 ) | |
| 284 | − outPointer += d->maxDelay; // modulo maximum length | |
| 285 | − | |
| 286 | − d->outPoint = (uint32_t) outPointer; // integer part | |
| 287 | − | |
| 288 | − d->alpha = outPointer - d->outPoint; // fractional part | |
| 289 | − d->omAlpha = 1.0f - d->alpha; | |
| 290 | − | |
| 291 | − if ( d->outPoint == d->maxDelay ) d->outPoint = 0; | |
| 292 | − | |
| 293 | − return 0; | |
| 294 | −} | |
| 295 | − | |
| 296 | −float tLinearDelay_tapOut (tLinearDelay* const dl, uint32_t tapDelay) | |
| 297 | −{ | |
| 298 | − _tLinearDelay* d = *dl; | |
| 299 | − | |
| 300 | − uint32_t tap = d->inPoint - tapDelay - 1; | |
| 301 | − // Check for wraparound. | |
| 302 | − while ( tap < 0 ) tap += d->maxDelay; | |
| 303 | − | |
| 304 | − return d->buff[tap]; | |
| 305 | −} | |
| 306 | − | |
| 307 | −void tLinearDelay_tapIn (tLinearDelay* const dl, float value, uint32_t tapDelay) | |
| 308 | −{ | |
| 309 | − _tLinearDelay* d = *dl; | |
| 310 | − | |
| 311 | − uint32_t tap = d->inPoint - tapDelay - 1; | |
| 312 | − | |
| 313 | − // Check for wraparound. | |
| 314 | − while ( tap < 0 ) tap += d->maxDelay; | |
| 315 | − | |
| 316 | − d->buff[tap] = value; | |
| 317 | −} | |
| 318 | − | |
| 319 | −float tLinearDelay_addTo (tLinearDelay* const dl, float value, uint32_t tapDelay) | |
| 320 | −{ | |
| 321 | − _tLinearDelay* d = *dl; | |
| 322 | − | |
| 323 | − int32_t tap = d->inPoint - tapDelay - 1; | |
| 324 | − | |
| 325 | − // Check for wraparound. | |
| 326 | − while ( tap < 0 ) tap += d->maxDelay; | |
| 327 | − | |
| 328 | − return (d->buff[tap] += value); | |
| 329 | −} | |
| 330 | − | |
| 331 | −float tLinearDelay_getDelay (tLinearDelay* const dl) | |
| 332 | −{ | |
| 333 | − _tLinearDelay* d = *dl; | |
| 334 | − return d->delay; | |
| 335 | −} | |
| 336 | − | |
| 337 | −float tLinearDelay_getLastOut (tLinearDelay* const dl) | |
| 338 | −{ | |
| 339 | − _tLinearDelay* d = *dl; | |
| 340 | − return d->lastOut; | |
| 341 | −} | |
| 342 | − | |
| 343 | −float tLinearDelay_getLastIn (tLinearDelay* const dl) | |
| 344 | −{ | |
| 345 | − _tLinearDelay* d = *dl; | |
| 346 | − return d->lastIn; | |
| 347 | −} | |
| 348 | − | |
| 349 | −void tLinearDelay_setGain (tLinearDelay* const dl, float gain) | |
| 350 | −{ | |
| 351 | − _tLinearDelay* d = *dl; | |
| 352 | − if (gain < 0.0f) d->gain = 0.0f; | |
| 353 | − else d->gain = gain; | |
| 354 | −} | |
| 355 | − | |
| 356 | −float tLinearDelay_getGain (tLinearDelay* const dl) | |
| 357 | −{ | |
| 358 | − _tLinearDelay* d = *dl; | |
| 359 | − return d->gain; | |
| 360 | −} | |
| 361 | − | |
| 362 | − | |
| 363 | − | |
| 364 | − | |
| 365 | − | |
| 366 | −/// Hermite Interpolated Delay | |
| 367 | −// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ LinearDelay ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ // | |
| 368 | −void tHermiteDelay_init (tHermiteDelay* const dl, float delay, uint32_t maxDelay) | |
| 369 | −{ | |
| 370 | − tHermiteDelay_initToPool(dl, delay, maxDelay, &leaf_mempool); | |
| 371 | −} | |
| 372 | − | |
| 373 | −void tHermiteDelay_free(tHermiteDelay* const dl) | |
| 374 | −{ | |
| 375 | − tHermiteDelay_freeFromPool(dl, &leaf_mempool); | |
| 376 | −} | |
| 377 | − | |
| 378 | −void tHermiteDelay_initToPool (tHermiteDelay* const dl, float delay, uint32_t maxDelay, tMempool* const mp) | |
| 379 | −{ | |
| 380 | − _tMempool* m = *mp; | |
| 381 | − _tHermiteDelay* d = *dl = (_tHermiteDelay*) mpool_alloc(sizeof(_tHermiteDelay), &m->pool); | |
| 382 | − | |
| 383 | − d->maxDelay = maxDelay; | |
| 384 | − | |
| 385 | − if (delay > maxDelay) d->delay = maxDelay; | |
| 386 | − else if (delay < 0.0f) d->delay = 0.0f; | |
| 387 | − else d->delay = delay; | |
| 388 | − | |
| 389 | − d->buff = (float*) mpool_alloc(sizeof(float) * maxDelay, &m->pool); | |
| 390 | − | |
| 391 | − d->gain = 1.0f; | |
| 392 | − | |
| 393 | − d->lastIn = 0.0f; | |
| 394 | − d->lastOut = 0.0f; | |
| 395 | − | |
| 396 | − d->inPoint = 0; | |
| 397 | − d->outPoint = 0; | |
| 398 | − | |
| 399 | − tHermiteDelay_setDelay(dl, d->delay); | |
| 400 | −} | |
| 401 | − | |
| 402 | −void tHermiteDelay_freeFromPool(tHermiteDelay* const dl, tMempool* const mp) | |
| 403 | −{ | |
| 404 | − _tMempool* m = *mp; | |
| 405 | − _tHermiteDelay* d = *dl; | |
| 406 | − | |
| 407 | − mpool_free(d->buff, &m->pool); | |
| 408 | − mpool_free(d, &m->pool); | |
| 409 | −} | |
| 410 | − | |
| 411 | − | |
| 412 | −void tHermiteDelay_clear(tHermiteDelay* const dl) | |
| 413 | −{ | |
| 414 | − _tHermiteDelay* d = *dl; | |
| 415 | − for (int i = 0; i < d->maxDelay; i++) | |
| 416 | − { | |
| 417 | − d->buff[i] = 0; | |
| 418 | − } | |
| 419 | −} | |
| 420 | − | |
| 421 | −float tHermiteDelay_tick (tHermiteDelay* const dl, float input) | |
| 422 | −{ | |
| 423 | − _tHermiteDelay* d = *dl; | |
| 424 | − | |
| 425 | − d->buff[d->inPoint] = input * d->gain; | |
| 426 | − | |
| 427 | − // Increment input pointer modulo length. | |
| 428 | − if (++(d->inPoint) == d->maxDelay ) d->inPoint = 0; | |
| 429 | − | |
| 430 | − | |
| 431 | − uint32_t idx = (uint32_t) d->outPoint; | |
| 432 | − d->lastOut = LEAF_interpolate_hermite (d->buff[((idx - 1) + d->maxDelay) % d->maxDelay], | |
| 433 | − d->buff[idx], | |
| 434 | − d->buff[(idx + 1) % d->maxDelay], | |
| 435 | − d->buff[(idx + 2) % d->maxDelay], | |
| 436 | − d->alpha); | |
| 437 | − | |
| 438 | − // Increment output pointer modulo length | |
| 439 | − if ( (++d->outPoint) >= d->maxDelay ) d->outPoint = 0; | |
| 440 | − | |
| 441 | − return d->lastOut; | |
| 442 | −} | |
| 443 | − | |
| 444 | −void tHermiteDelay_tickIn (tHermiteDelay* const dl, float input) | |
| 445 | −{ | |
| 446 | − _tHermiteDelay* d = *dl; | |
| 447 | − | |
| 448 | − d->buff[d->inPoint] = input * d->gain; | |
| 449 | − | |
| 450 | − // Increment input pointer modulo length. | |
| 451 | − if (++(d->inPoint) == d->maxDelay ) d->inPoint = 0; | |
| 452 | −} | |
| 453 | − | |
| 454 | −float tHermiteDelay_tickOut (tHermiteDelay* const dl) | |
| 455 | −{ | |
| 456 | − _tHermiteDelay* d = *dl; | |
| 457 | − | |
| 458 | − uint32_t idx = (uint32_t) d->outPoint; | |
| 459 | − | |
| 460 | − | |
| 461 | − | |
| 462 | − d->lastOut = LEAF_interpolate_hermite (d->buff[((idx - 1) + d->maxDelay) % d->maxDelay], | |
| 463 | − d->buff[idx], | |
| 464 | − d->buff[(idx + 1) % d->maxDelay], | |
| 465 | − d->buff[(idx + 2) % d->maxDelay], | |
| 466 | − d->alpha); | |
| 467 | − | |
| 468 | − // Increment output pointer modulo length | |
| 469 | − if ( (++d->outPoint) >= d->maxDelay ) d->outPoint = 0; | |
| 470 | − | |
| 471 | − return d->lastOut; | |
| 472 | −} | |
| 473 | − | |
| 474 | −int tHermiteDelay_setDelay (tHermiteDelay* const dl, float delay) | |
| 475 | −{ | |
| 476 | − _tHermiteDelay* d = *dl; | |
| 477 | − | |
| 478 | − d->delay = LEAF_clip(0.0f, delay, d->maxDelay); | |
| 479 | − | |
| 480 | − float outPointer = d->inPoint - d->delay; | |
| 481 | − | |
| 482 | − while ( outPointer < 0 ) | |
| 483 | − outPointer += d->maxDelay; // modulo maximum length | |
| 484 | − | |
| 485 | − d->outPoint = (uint32_t) outPointer; // integer part | |
| 486 | − | |
| 487 | − d->alpha = outPointer - d->outPoint; // fractional part | |
| 488 | − d->omAlpha = 1.0f - d->alpha; | |
| 489 | − | |
| 490 | − if ( d->outPoint == d->maxDelay ) d->outPoint = 0; | |
| 491 | − | |
| 492 | − return 0; | |
| 493 | −} | |
| 494 | − | |
| 495 | −float tHermiteDelay_tapOut (tHermiteDelay* const dl, uint32_t tapDelay) | |
| 496 | −{ | |
| 497 | − _tHermiteDelay* d = *dl; | |
| 498 | − | |
| 499 | − uint32_t tap = d->inPoint - tapDelay - 1; | |
| 500 | − | |
| 501 | − // Check for wraparound. | |
| 502 | − while ( tap < 0 ) tap += d->maxDelay; | |
| 503 | − | |
| 504 | − return d->buff[tap]; | |
| 505 | − | |
| 506 | −} | |
| 507 | − | |
| 508 | −void tHermiteDelay_tapIn (tHermiteDelay* const dl, float value, uint32_t tapDelay) | |
| 509 | −{ | |
| 510 | − _tHermiteDelay* d = *dl; | |
| 511 | − | |
| 512 | − int32_t tap = d->inPoint - tapDelay - 1; | |
| 513 | − | |
| 514 | − // Check for wraparound. | |
| 515 | − while ( tap < 0 ) tap += d->maxDelay; | |
| 516 | − | |
| 517 | − d->buff[tap] = value; | |
| 518 | −} | |
| 519 | − | |
| 520 | −float tHermiteDelay_addTo (tHermiteDelay* const dl, float value, uint32_t tapDelay) | |
| 521 | −{ | |
| 522 | − _tHermiteDelay* d = *dl; | |
| 523 | − | |
| 524 | − int32_t tap = d->inPoint - tapDelay - 1; | |
| 525 | − | |
| 526 | − // Check for wraparound. | |
| 527 | − while ( tap < 0 ) tap += d->maxDelay; | |
| 528 | − | |
| 529 | − return (d->buff[tap] += value); | |
| 530 | −} | |
| 531 | − | |
| 532 | −float tHermiteDelay_getDelay (tHermiteDelay* const dl) | |
| 533 | −{ | |
| 534 | − _tHermiteDelay* d = *dl; | |
| 535 | − return d->delay; | |
| 536 | −} | |
| 537 | − | |
| 538 | −float tHermiteDelay_getLastOut (tHermiteDelay* const dl) | |
| 539 | −{ | |
| 540 | − _tHermiteDelay* d = *dl; | |
| 541 | − return d->lastOut; | |
| 542 | −} | |
| 543 | − | |
| 544 | −float tHermiteDelay_getLastIn (tHermiteDelay* const dl) | |
| 545 | −{ | |
| 546 | − _tHermiteDelay* d = *dl; | |
| 547 | − return d->lastIn; | |
| 548 | −} | |
| 549 | − | |
| 550 | −void tHermiteDelay_setGain (tHermiteDelay* const dl, float gain) | |
| 551 | −{ | |
| 552 | − _tHermiteDelay* d = *dl; | |
| 553 | − if (gain < 0.0f) d->gain = 0.0f; | |
| 554 | − else d->gain = gain; | |
| 555 | −} | |
| 556 | − | |
| 557 | −float tHermiteDelay_getGain (tHermiteDelay* const dl) | |
| 558 | −{ | |
| 559 | − _tHermiteDelay* d = *dl; | |
| 560 | − return d->gain; | |
| 561 | −} | |
| 562 | − | |
| 563 | − | |
| 564 | − | |
| 565 | − | |
| 566 | − | |
| 567 | −// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ AllpassDelay ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ // | |
| 568 | −void tAllpassDelay_init (tAllpassDelay* const dl, float delay, uint32_t maxDelay) | |
| 569 | −{ | |
| 570 | − tAllpassDelay_initToPool(dl, delay, maxDelay, &leaf_mempool); | |
| 571 | −} | |
| 572 | − | |
| 573 | −void tAllpassDelay_free(tAllpassDelay* const dl) | |
| 574 | −{ | |
| 575 | − tAllpassDelay_freeFromPool(dl, &leaf_mempool); | |
| 576 | −} | |
| 577 | − | |
| 578 | −void tAllpassDelay_initToPool (tAllpassDelay* const dl, float delay, uint32_t maxDelay, tMempool* const mp) | |
| 579 | −{ | |
| 580 | − _tMempool* m = *mp; | |
| 581 | − _tAllpassDelay* d = *dl = (_tAllpassDelay*) mpool_alloc(sizeof(_tAllpassDelay), &m->pool); | |
| 582 | − | |
| 583 | − d->maxDelay = maxDelay; | |
| 584 | − | |
| 585 | − if (delay > maxDelay) d->delay = maxDelay; | |
| 586 | − else if (delay < 0.0f) d->delay = 0.0f; | |
| 587 | − else d->delay = delay; | |
| 588 | − | |
| 589 | − d->buff = (float*) mpool_alloc(sizeof(float) * maxDelay, &m->pool); | |
| 590 | − | |
| 591 | − d->gain = 1.0f; | |
| 592 | − | |
| 593 | − d->lastIn = 0.0f; | |
| 594 | − d->lastOut = 0.0f; | |
| 595 | − | |
| 596 | − d->inPoint = 0; | |
| 597 | − d->outPoint = 0; | |
| 598 | − | |
| 599 | − tAllpassDelay_setDelay(dl, d->delay); | |
| 600 | − | |
| 601 | − d->apInput = 0.0f; | |
| 602 | −} | |
| 603 | − | |
| 604 | −void tAllpassDelay_freeFromPool(tAllpassDelay* const dl, tMempool* const mp) | |
| 605 | −{ | |
| 606 | − _tMempool* m = *mp; | |
| 607 | − _tAllpassDelay* d = *dl; | |
| 608 | − | |
| 609 | − mpool_free(d->buff, &m->pool); | |
| 610 | − mpool_free(d, &m->pool); | |
| 611 | −} | |
| 612 | − | |
| 613 | −void tAllpassDelay_clear(tAllpassDelay* const dl) | |
| 614 | −{ | |
| 615 | − _tAllpassDelay* d = *dl; | |
| 616 | − for (int i = 0; i < d->maxDelay; i++) | |
| 617 | − { | |
| 618 | − d->buff[i] = 0; | |
| 619 | − } | |
| 620 | −} | |
| 621 | − | |
| 622 | −float tAllpassDelay_tick (tAllpassDelay* const dl, float input) | |
| 623 | −{ | |
| 624 | − _tAllpassDelay* d = *dl; | |
| 625 | − | |
| 626 | − d->buff[d->inPoint] = input * d->gain; | |
| 627 | − | |
| 628 | − // Increment input pointer modulo length. | |
| 629 | − if ( ++(d->inPoint) >= d->maxDelay ) d->inPoint = 0; | |
| 630 | − | |
| 631 | − // Do allpass interpolation delay. | |
| 632 | − float out = d->lastOut * -d->coeff; | |
| 633 | − out += d->apInput + ( d->coeff * d->buff[d->outPoint] ); | |
| 634 | − d->lastOut = out; | |
| 635 | − | |
| 636 | − // Save allpass input | |
| 637 | − d->apInput = d->buff[d->outPoint]; | |
| 638 | − | |
| 639 | − // Increment output pointer modulo length. | |
| 640 | − if (++(d->outPoint) >= d->maxDelay ) d->outPoint = 0; | |
| 641 | − | |
| 642 | − return d->lastOut; | |
| 643 | −} | |
| 644 | − | |
| 645 | −int tAllpassDelay_setDelay (tAllpassDelay* const dl, float delay) | |
| 646 | −{ | |
| 647 | − _tAllpassDelay* d = *dl; | |
| 648 | − | |
| 649 | − d->delay = LEAF_clip(0.5f, delay, d->maxDelay); | |
| 650 | − | |
| 651 | − // outPoint chases inPoint | |
| 652 | − float outPointer = (float)d->inPoint - d->delay + 1.0f; | |
| 653 | − | |
| 654 | − while ( outPointer < 0 ) outPointer += d->maxDelay; // mod max length | |
| 655 | − | |
| 656 | − d->outPoint = (uint32_t) outPointer; // integer part | |
| 657 | − | |
| 658 | − if ( d->outPoint >= d->maxDelay ) d->outPoint = 0; | |
| 659 | − | |
| 660 | − d->alpha = 1.0f + (float)d->outPoint - outPointer; // fractional part | |
| 661 | − | |
| 662 | − if ( d->alpha < 0.5f ) | |
| 663 | − { | |
| 664 | − // The optimal range for alpha is about 0.5 - 1.5 in order to | |
| 665 | − // achieve the flattest phase delay response. | |
| 666 | − | |
| 667 | − d->outPoint += 1; | |
| 668 | − | |
| 669 | − if ( d->outPoint >= d->maxDelay ) d->outPoint -= d->maxDelay; | |
| 670 | − | |
| 671 | − d->alpha += 1.0f; | |
| 672 | − } | |
| 673 | − | |
| 674 | − d->coeff = (1.0f - d->alpha) / (1.0f + d->alpha); // coefficient for allpass | |
| 675 | − | |
| 676 | − return 0; | |
| 677 | −} | |
| 678 | − | |
| 679 | −float tAllpassDelay_tapOut (tAllpassDelay* const dl, uint32_t tapDelay) | |
| 680 | −{ | |
| 681 | − _tAllpassDelay* d = *dl; | |
| 682 | − | |
| 683 | − int32_t tap = d->inPoint - tapDelay - 1; | |
| 684 | − | |
| 685 | − // Check for wraparound. | |
| 686 | − while ( tap < 0 ) tap += d->maxDelay; | |
| 687 | − | |
| 688 | − return d->buff[tap]; | |
| 689 | − | |
| 690 | −} | |
| 691 | − | |
| 692 | −void tAllpassDelay_tapIn (tAllpassDelay* const dl, float value, uint32_t tapDelay) | |
| 693 | −{ | |
| 694 | − _tAllpassDelay* d = *dl; | |
| 695 | − | |
| 696 | − int32_t tap = d->inPoint - tapDelay - 1; | |
| 697 | − | |
| 698 | − // Check for wraparound. | |
| 699 | − while ( tap < 0 ) tap += d->maxDelay; | |
| 700 | − | |
| 701 | − d->buff[tap] = value; | |
| 702 | −} | |
| 703 | − | |
| 704 | −float tAllpassDelay_addTo (tAllpassDelay* const dl, float value, uint32_t tapDelay) | |
| 705 | −{ | |
| 706 | − _tAllpassDelay* d = *dl; | |
| 707 | − | |
| 708 | − int32_t tap = d->inPoint - tapDelay - 1; | |
| 709 | − | |
| 710 | − // Check for wraparound. | |
| 711 | − while ( tap < 0 ) tap += d->maxDelay; | |
| 712 | − | |
| 713 | − return (d->buff[tap] += value); | |
| 714 | −} | |
| 715 | − | |
| 716 | −float tAllpassDelay_getDelay (tAllpassDelay* const dl) | |
| 717 | −{ | |
| 718 | − _tAllpassDelay* d = *dl; | |
| 719 | − return d->delay; | |
| 720 | −} | |
| 721 | − | |
| 722 | −float tAllpassDelay_getLastOut (tAllpassDelay* const dl) | |
| 723 | −{ | |
| 724 | − _tAllpassDelay* d = *dl; | |
| 725 | − return d->lastOut; | |
| 726 | −} | |
| 727 | − | |
| 728 | −float tAllpassDelay_getLastIn (tAllpassDelay* const dl) | |
| 729 | −{ | |
| 730 | − _tAllpassDelay* d = *dl; | |
| 731 | − return d->lastIn; | |
| 732 | −} | |
| 733 | − | |
| 734 | −void tAllpassDelay_setGain (tAllpassDelay* const dl, float gain) | |
| 735 | −{ | |
| 736 | − _tAllpassDelay* d = *dl; | |
| 737 | − if (gain < 0.0f) d->gain = 0.0f; | |
| 738 | − else d->gain = gain; | |
| 739 | −} | |
| 740 | − | |
| 741 | −float tAllpassDelay_getGain (tAllpassDelay* const dl) | |
| 742 | −{ | |
| 743 | − _tAllpassDelay* d = *dl; | |
| 744 | − return d->gain; | |
| 745 | −} | |
| 746 | − | |
| 747 | −// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ TapeDelay ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ // | |
| 748 | −void tTapeDelay_init (tTapeDelay* const dl, float delay, uint32_t maxDelay) | |
| 749 | −{ | |
| 750 | − tTapeDelay_initToPool(dl, delay, maxDelay, &leaf_mempool); | |
| 751 | −} | |
| 752 | − | |
| 753 | −void tTapeDelay_free(tTapeDelay* const dl) | |
| 754 | −{ | |
| 755 | − tTapeDelay_freeFromPool(dl, &leaf_mempool); | |
| 756 | −} | |
| 757 | − | |
| 758 | −void tTapeDelay_initToPool (tTapeDelay* const dl, float delay, uint32_t maxDelay, tMempool* const mp) | |
| 759 | −{ | |
| 760 | − _tMempool* m = *mp; | |
| 761 | − _tTapeDelay* d = *dl = (_tTapeDelay*) mpool_alloc(sizeof(_tTapeDelay), &m->pool); | |
| 762 | − | |
| 763 | − d->maxDelay = maxDelay; | |
| 764 | − | |
| 765 | − d->buff = (float*) mpool_alloc(sizeof(float) * maxDelay, &m->pool); | |
| 766 | − | |
| 767 | − d->gain = 1.0f; | |
| 768 | − | |
| 769 | − d->lastIn = 0.0f; | |
| 770 | − d->lastOut = 0.0f; | |
| 771 | − | |
| 772 | − d->idx = 0.0f; | |
| 773 | − d->inc = 1.0f; | |
| 774 | − d->inPoint = 0; | |
| 775 | − | |
| 776 | − tTapeDelay_setDelay(dl, delay); | |
| 777 | −} | |
| 778 | − | |
| 779 | −void tTapeDelay_freeFromPool(tTapeDelay* const dl, tMempool* const mp) | |
| 780 | −{ | |
| 781 | − _tMempool* m = *mp; | |
| 782 | − _tTapeDelay* d = *dl; | |
| 783 | − | |
| 784 | − mpool_free(d->buff, &m->pool); | |
| 785 | − mpool_free(d, &m->pool); | |
| 786 | −} | |
| 787 | − | |
| 788 | −void tTapeDelay_clear(tTapeDelay* const dl) | |
| 789 | −{ | |
| 790 | − _tTapeDelay* d = *dl; | |
| 791 | − for (int i = 0; i < d->maxDelay; i++) | |
| 792 | − { | |
| 793 | − d->buff[i] = 0; | |
| 794 | − } | |
| 795 | −} | |
| 796 | − | |
| 797 | −//#define SMOOTH_FACTOR 10.f | |
| 798 | − | |
| 799 | −float tTapeDelay_tick (tTapeDelay* const dl, float input) | |
| 800 | −{ | |
| 801 | − _tTapeDelay* d = *dl; | |
| 802 | − | |
| 803 | − d->buff[d->inPoint] = input * d->gain; | |
| 804 | − | |
| 805 | − // Increment input pointer modulo length. | |
| 806 | − if (++(d->inPoint) == d->maxDelay ) d->inPoint = 0; | |
| 807 | − | |
| 808 | − int idx = (int) d->idx; | |
| 809 | − float alpha = d->idx - idx; | |
| 810 | − | |
| 811 | − d->lastOut = LEAF_interpolate_hermite_x (d->buff[((idx - 1) + d->maxDelay) % d->maxDelay], | |
| 812 | − d->buff[idx], | |
| 813 | − d->buff[(idx + 1) % d->maxDelay], | |
| 814 | − d->buff[(idx + 2) % d->maxDelay], | |
| 815 | − alpha); | |
| 816 | − | |
| 817 | − float diff = (d->inPoint - d->idx); | |
| 818 | − while (diff < 0.f) diff += d->maxDelay; | |
| 819 | − | |
| 820 | − d->inc = 1.0f + (diff - d->delay) / d->delay; //* SMOOTH_FACTOR; | |
| 821 | − | |
| 822 | − d->idx += d->inc; | |
| 823 | − | |
| 824 | − if (d->idx >= d->maxDelay) d->idx = 0.0f; | |
| 825 | − | |
| 826 | − if (d->lastOut) | |
| 827 | − return d->lastOut; | |
| 828 | − return 0.0f; | |
| 829 | −} | |
| 830 | − | |
| 831 | −void tTapeDelay_incrementInPoint(tTapeDelay* const dl) | |
| 832 | −{ | |
| 833 | − _tTapeDelay* d = *dl; | |
| 834 | − // Increment input pointer modulo length. | |
| 835 | − if (++(d->inPoint) == d->maxDelay ) d->inPoint = 0; | |
| 836 | −} | |
| 837 | − | |
| 838 | − | |
| 839 | −void tTapeDelay_setRate(tTapeDelay* const dl, float rate) | |
| 840 | −{ | |
| 841 | − _tTapeDelay* d = *dl; | |
| 842 | − d->inc = rate; | |
| 843 | −} | |
| 844 | − | |
| 845 | −void tTapeDelay_setDelay (tTapeDelay* const dl, float delay) | |
| 846 | −{ | |
| 847 | − _tTapeDelay* d = *dl; | |
| 848 | − d->delay = LEAF_clip(1.f, delay, d->maxDelay); | |
| 849 | −} | |
| 850 | − | |
| 851 | −float tTapeDelay_tapOut (tTapeDelay* const dl, float tapDelay) | |
| 852 | −{ | |
| 853 | − _tTapeDelay* d = *dl; | |
| 854 | − | |
| 855 | − float tap = (float) d->inPoint - tapDelay - 1.f; | |
| 856 | − | |
| 857 | − // Check for wraparound. | |
| 858 | − while ( tap < 0.f ) tap += (float)d->maxDelay; | |
| 859 | − | |
| 860 | − int idx = (int) tap; | |
| 861 | − | |
| 862 | − float alpha = tap - idx; | |
| 863 | − | |
| 864 | − float samp = LEAF_interpolate_hermite_x (d->buff[((idx - 1) + d->maxDelay) % d->maxDelay], | |
| 865 | − d->buff[idx], | |
| 866 | − d->buff[(idx + 1) % d->maxDelay], | |
| 867 | − d->buff[(idx + 2) % d->maxDelay], | |
| 868 | − alpha); | |
| 869 | − | |
| 870 | − return samp; | |
| 871 | − | |
| 872 | −} | |
| 873 | − | |
| 874 | −void tTapeDelay_tapIn (tTapeDelay* const dl, float value, uint32_t tapDelay) | |
| 875 | −{ | |
| 876 | − _tTapeDelay* d = *dl; | |
| 877 | − | |
| 878 | − int32_t tap = d->inPoint - tapDelay - 1; | |
| 879 | − | |
| 880 | − // Check for wraparound. | |
| 881 | − while ( tap < 0 ) tap += d->maxDelay; | |
| 882 | − | |
| 883 | − d->buff[tap] = value; | |
| 884 | −} | |
| 885 | − | |
| 886 | −float tTapeDelay_addTo (tTapeDelay* const dl, float value, uint32_t tapDelay) | |
| 887 | −{ | |
| 888 | − _tTapeDelay* d = *dl; | |
| 889 | − | |
| 890 | − int32_t tap = d->inPoint - tapDelay - 1; | |
| 891 | − | |
| 892 | − // Check for wraparound. | |
| 893 | − while ( tap < 0 ) tap += d->maxDelay; | |
| 894 | − | |
| 895 | − return (d->buff[tap] += value); | |
| 896 | −} | |
| 897 | − | |
| 898 | −float tTapeDelay_getDelay (tTapeDelay *dl) | |
| 899 | −{ | |
| 900 | − _tTapeDelay* d = *dl; | |
| 901 | − return d->delay; | |
| 902 | −} | |
| 903 | − | |
| 904 | −float tTapeDelay_getLastOut (tTapeDelay* const dl) | |
| 905 | −{ | |
| 906 | − _tTapeDelay* d = *dl; | |
| 907 | − return d->lastOut; | |
| 908 | −} | |
| 909 | − | |
| 910 | −float tTapeDelay_getLastIn (tTapeDelay* const dl) | |
| 911 | −{ | |
| 912 | − _tTapeDelay* d = *dl; | |
| 913 | − return d->lastIn; | |
| 914 | −} | |
| 915 | − | |
| 916 | −void tTapeDelay_setGain (tTapeDelay* const dl, float gain) | |
| 917 | −{ | |
| 918 | − _tTapeDelay* d = *dl; | |
| 919 | − if (gain < 0.0f) d->gain = 0.0f; | |
| 920 | − else d->gain = gain; | |
| 921 | −} | |
| 922 | − | |
| 923 | −float tTapeDelay_getGain (tTapeDelay* const dl) | |
| 924 | −{ | |
| 925 | − _tTapeDelay* d = *dl; | |
| 926 | − return d->gain; | |
| 927 | −} | |
| 928 | − | |
| @@ -1,587 +0,0 @@ | ||
| 1 | −// | |
| 2 | −// leaf-distortion.c | |
| 3 | −// LEAF | |
| 4 | −// | |
| 5 | −// Created by Jeff Snyder, Matthew Wang, Michael Mulshine, and Joshua Becker | |
| 6 | −// Copyright © 2019 Princeton University. All rights reserved. | |
| 7 | −// | |
| 8 | − | |
| 9 | −#if _WIN32 || _WIN64 | |
| 10 | − | |
| 11 | −#include "..\Inc\leaf-distortion.h" | |
| 12 | −#include "..\Inc\leaf-tables.h" | |
| 13 | −#else | |
| 14 | − | |
| 15 | − | |
| 16 | −#include "../Inc/leaf-distortion.h" | |
| 17 | −#include "../Inc/leaf-tables.h" | |
| 18 | − | |
| 19 | −//testing | |
| 20 | −//#include "gpio.h" | |
| 21 | − | |
| 22 | −#endif | |
| 23 | − | |
| 24 | −//============================================================================================================ | |
| 25 | −// Sample-Rate reducer | |
| 26 | −//============================================================================================================ | |
| 27 | − | |
| 28 | − | |
| 29 | −void tSampleReducer_init(tSampleReducer* const sr) | |
| 30 | −{ | |
| 31 | − _tSampleReducer* s = *sr = (_tSampleReducer*) leaf_alloc(sizeof(_tSampleReducer)); | |
| 32 | − | |
| 33 | − s->invRatio = 1.0f; | |
| 34 | − s->hold = 0.0f; | |
| 35 | − s->count = 0; | |
| 36 | −} | |
| 37 | − | |
| 38 | −void tSampleReducer_free (tSampleReducer* const sr) | |
| 39 | −{ | |
| 40 | − _tSampleReducer* s = *sr; | |
| 41 | − | |
| 42 | − leaf_free(s); | |
| 43 | −} | |
| 44 | − | |
| 45 | −void tSampleReducer_initToPool (tSampleReducer* const sr, tMempool* const mp) | |
| 46 | −{ | |
| 47 | − _tMempool* m = *mp; | |
| 48 | − _tSampleReducer* s = *sr = (_tSampleReducer*) mpool_alloc(sizeof(_tSampleReducer), &m->pool); | |
| 49 | − | |
| 50 | − s->invRatio = 1.0f; | |
| 51 | − s->hold = 0.0f; | |
| 52 | − s->count = 0; | |
| 53 | −} | |
| 54 | − | |
| 55 | −void tSampleReducer_freeFromPool (tSampleReducer* const sr, tMempool* const mp) | |
| 56 | −{ | |
| 57 | − _tMempool* m = *mp; | |
| 58 | − _tSampleReducer* s = *sr; | |
| 59 | − | |
| 60 | − mpool_free(s, &m->pool); | |
| 61 | −} | |
| 62 | − | |
| 63 | −float tSampleReducer_tick(tSampleReducer* const sr, float input) | |
| 64 | −{ | |
| 65 | − _tSampleReducer* s = *sr; | |
| 66 | − if (s->count > s->invRatio) | |
| 67 | − { | |
| 68 | − s->hold = input; | |
| 69 | − s->count = 0; | |
| 70 | − } | |
| 71 | − | |
| 72 | − s->count++; | |
| 73 | − return s->hold; | |
| 74 | −} | |
| 75 | − | |
| 76 | − | |
| 77 | −void tSampleReducer_setRatio(tSampleReducer* const sr, float ratio) | |
| 78 | −{ | |
| 79 | − _tSampleReducer* s = *sr; | |
| 80 | − if ((ratio <= 1.0f) && (ratio >= 0.0f)) | |
| 81 | − s->invRatio = 1.0f / ratio; | |
| 82 | − | |
| 83 | −} | |
| 84 | − | |
| 85 | −//============================================================================================================ | |
| 86 | −// Oversampler | |
| 87 | −//============================================================================================================ | |
| 88 | −// Latency is equal to the phase length (numTaps / ratio) | |
| 89 | −void tOversampler_init(tOversampler* const osr, int ratio, oBool extraQuality) | |
| 90 | −{ | |
| 91 | − _tOversampler* os = *osr = (_tOversampler*) leaf_alloc(sizeof(_tOversampler)); | |
| 92 | − | |
| 93 | − uint8_t offset = 0; | |
| 94 | − if (extraQuality) offset = 6; | |
| 95 | − if (ratio == 2 || ratio == 4 || | |
| 96 | − ratio == 8 || ratio == 16 || | |
| 97 | − ratio == 32 || ratio == 64) { | |
| 98 | − os->ratio = ratio; | |
| 99 | − int idx = (int)(log2f(os->ratio))-1+offset; | |
| 100 | − os->numTaps = firNumTaps[idx]; | |
| 101 | − os->phaseLength = os->numTaps / os->ratio; | |
| 102 | − os->pCoeffs = (float*) firCoeffs[idx]; | |
| 103 | − os->upState = leaf_alloc(sizeof(float) * os->numTaps * 2); | |
| 104 | − os->downState = leaf_alloc(sizeof(float) * os->numTaps * 2); | |
| 105 | − } | |
| 106 | −} | |
| 107 | − | |
| 108 | −void tOversampler_free(tOversampler* const osr) | |
| 109 | −{ | |
| 110 | − _tOversampler* os = *osr; | |
| 111 | − | |
| 112 | − leaf_free(os->upState); | |
| 113 | − leaf_free(os->downState); | |
| 114 | − leaf_free(os); | |
| 115 | −} | |
| 116 | − | |
| 117 | −void tOversampler_initToPool (tOversampler* const osr, int ratio, oBool extraQuality, tMempool* const mp) | |
| 118 | −{ | |
| 119 | − _tMempool* m = *mp; | |
| 120 | − _tOversampler* os = *osr = (_tOversampler*) mpool_alloc(sizeof(_tOversampler), &m->pool); | |
| 121 | − | |
| 122 | − uint8_t offset = 0; | |
| 123 | − if (extraQuality) offset = 6; | |
| 124 | − if (ratio == 2 || ratio == 4 || | |
| 125 | − ratio == 8 || ratio == 16 || | |
| 126 | − ratio == 32 || ratio == 64) { | |
| 127 | − os->ratio = ratio; | |
| 128 | − int idx = (int)(log2f(os->ratio))-1+offset; | |
| 129 | − os->numTaps = firNumTaps[idx]; | |
| 130 | − os->phaseLength = os->numTaps / os->ratio; | |
| 131 | − os->pCoeffs = (float*) firCoeffs[idx]; | |
| 132 | − os->upState = mpool_alloc(sizeof(float) * os->numTaps * 2, &m->pool); | |
| 133 | − os->downState = mpool_alloc(sizeof(float) * os->numTaps * 2, &m->pool); | |
| 134 | − } | |
| 135 | −} | |
| 136 | − | |
| 137 | −void tOversampler_freeFromPool (tOversampler* const osr, tMempool* const mp) | |
| 138 | −{ | |
| 139 | − _tMempool* m = *mp; | |
| 140 | − _tOversampler* os = *osr; | |
| 141 | − | |
| 142 | − mpool_free(os->upState, &m->pool); | |
| 143 | − mpool_free(os->downState, &m->pool); | |
| 144 | − mpool_free(os, &m->pool); | |
| 145 | −} | |
| 146 | − | |
| 147 | −float tOversampler_tick(tOversampler* const osr, float input, float (*effectTick)(float)) | |
| 148 | −{ | |
| 149 | − _tOversampler* os = *osr; | |
| 150 | − | |
| 151 | − float buf[os->ratio]; | |
| 152 | − | |
| 153 | − tOversampler_upsample(osr, input, buf); | |
| 154 | − | |
| 155 | − for (int i = 0; i < os->ratio; ++i) { | |
| 156 | − buf[i] = effectTick(buf[i]); | |
| 157 | − } | |
| 158 | − | |
| 159 | − return tOversampler_downsample(osr, buf); | |
| 160 | −} | |
| 161 | − | |
| 162 | −// From CMSIS DSP Library | |
| 163 | −void tOversampler_upsample(tOversampler* const osr, float input, float* output) | |
| 164 | −{ | |
| 165 | − _tOversampler* os = *osr; | |
| 166 | − | |
| 167 | − float *pState = os->upState; /* State pointer */ | |
| 168 | − float *pCoeffs = os->pCoeffs; /* Coefficient pointer */ | |
| 169 | − float *pStateCur; | |
| 170 | − float *ptr1; /* Temporary pointer for state buffer */ | |
| 171 | − float *ptr2; /* Temporary pointer for coefficient buffer */ | |
| 172 | − float sum0; /* Accumulators */ | |
| 173 | − uint32_t i, tapCnt; /* Loop counters */ | |
| 174 | − uint32_t phaseLen = os->phaseLength; /* Length of each polyphase filter component */ | |
| 175 | − uint32_t j; | |
| 176 | − | |
| 177 | − /* os->pState buffer contains previous frame (phaseLen - 1) samples */ | |
| 178 | − /* pStateCur points to the location where the new input data should be written */ | |
| 179 | − pStateCur = os->upState + (phaseLen - 1U); | |
| 180 | − | |
| 181 | − /* Copy new input sample into the state buffer */ | |
| 182 | − *pStateCur = input; | |
| 183 | − | |
| 184 | − /* Address modifier index of coefficient buffer */ | |
| 185 | − j = 1U; | |
| 186 | − | |
| 187 | − /* Loop over the Interpolation factor. */ | |
| 188 | − i = os->ratio; | |
| 189 | − | |
| 190 | − while (i > 0U) | |
| 191 | − { | |
| 192 | − /* Set accumulator to zero */ | |
| 193 | − sum0 = 0.0f; | |
| 194 | − | |
| 195 | − /* Initialize state pointer */ | |
| 196 | − ptr1 = pState; | |
| 197 | − | |
| 198 | − /* Initialize coefficient pointer */ | |
| 199 | − ptr2 = pCoeffs + (os->ratio - j); | |
| 200 | − | |
| 201 | − /* Loop over the polyPhase length. | |
| 202 | − Repeat until we've computed numTaps-(4*os->L) coefficients. */ | |
| 203 | − | |
| 204 | − /* Initialize tapCnt with number of samples */ | |
| 205 | − tapCnt = phaseLen; | |
| 206 | − | |
| 207 | − while (tapCnt > 0U) | |
| 208 | − { | |
| 209 | − /* Perform the multiply-accumulate */ | |
| 210 | − sum0 += *ptr1++ * *ptr2; | |
| 211 | − | |
| 212 | − /* Upsampling is done by stuffing L-1 zeros between each sample. | |
| 213 | − * So instead of multiplying zeros with coefficients, | |
| 214 | − * Increment the coefficient pointer by interpolation factor times. */ | |
| 215 | − ptr2 += os->ratio; | |
| 216 | − | |
| 217 | − /* Decrement loop counter */ | |
| 218 | − tapCnt--; | |
| 219 | − } | |
| 220 | − | |
| 221 | − /* The result is in the accumulator, store in the destination buffer. */ | |
| 222 | − *output++ = sum0 * os->ratio; | |
| 223 | − | |
| 224 | − /* Increment the address modifier index of coefficient buffer */ | |
| 225 | − j++; | |
| 226 | − | |
| 227 | − /* Decrement the loop counter */ | |
| 228 | − i--; | |
| 229 | − } | |
| 230 | − | |
| 231 | − /* Advance the state pointer by 1 | |
| 232 | − * to process the next group of interpolation factor number samples */ | |
| 233 | − pState = pState + 1; | |
| 234 | − | |
| 235 | − /* Processing is complete. | |
| 236 | − Now copy the last phaseLen - 1 samples to the satrt of the state buffer. | |
| 237 | − This prepares the state buffer for the next function call. */ | |
| 238 | − | |
| 239 | − /* Points to the start of the state buffer */ | |
| 240 | − pStateCur = os->upState; | |
| 241 | − | |
| 242 | − /* Initialize tapCnt with number of samples */ | |
| 243 | − tapCnt = (phaseLen - 1U); | |
| 244 | − | |
| 245 | − /* Copy data */ | |
| 246 | − while (tapCnt > 0U) | |
| 247 | − { | |
| 248 | − *pStateCur++ = *pState++; | |
| 249 | − | |
| 250 | − /* Decrement loop counter */ | |
| 251 | − tapCnt--; | |
| 252 | − } | |
| 253 | −} | |
| 254 | − | |
| 255 | −// From CMSIS DSP Library | |
| 256 | −float tOversampler_downsample(tOversampler *const osr, float* input) | |
| 257 | −{ | |
| 258 | − _tOversampler* os = *osr; | |
| 259 | − | |
| 260 | − float *pState = os->downState; /* State pointer */ | |
| 261 | − float *pCoeffs = os->pCoeffs; /* Coefficient pointer */ | |
| 262 | − float *pStateCur; /* Points to the current sample of the state */ | |
| 263 | − float *px0; /* Temporary pointer for state buffer */ | |
| 264 | − float *pb; /* Temporary pointer for coefficient buffer */ | |
| 265 | − float x0, c0; /* Temporary variables to hold state and coefficient values */ | |
| 266 | − float acc0; /* Accumulator */ | |
| 267 | − uint32_t numTaps = os->numTaps; /* Number of filter coefficients in the filter */ | |
| 268 | − uint32_t i, tapCnt; | |
| 269 | − float output; | |
| 270 | − | |
| 271 | − /* os->pState buffer contains previous frame (numTaps - 1) samples */ | |
| 272 | − /* pStateCur points to the location where the new input data should be written */ | |
| 273 | − pStateCur = os->downState + (numTaps - 1U); | |
| 274 | − | |
| 275 | − /* Copy decimation factor number of new input samples into the state buffer */ | |
| 276 | − i = os->ratio; | |
| 277 | − | |
| 278 | − do | |
| 279 | − { | |
| 280 | − *pStateCur++ = *input++; | |
| 281 | − | |
| 282 | − } while (--i); | |
| 283 | − | |
| 284 | − /* Set accumulator to zero */ | |
| 285 | − acc0 = 0.0f; | |
| 286 | − | |
| 287 | − /* Initialize state pointer */ | |
| 288 | − px0 = pState; | |
| 289 | − | |
| 290 | − /* Initialize coeff pointer */ | |
| 291 | − pb = pCoeffs; | |
| 292 | − | |
| 293 | − /* Initialize tapCnt with number of taps */ | |
| 294 | − tapCnt = numTaps; | |
| 295 | − | |
| 296 | − while (tapCnt > 0U) | |
| 297 | − { | |
| 298 | − /* Read coefficients */ | |
| 299 | − c0 = *pb++; | |
| 300 | − | |
| 301 | − /* Fetch 1 state variable */ | |
| 302 | − x0 = *px0++; | |
| 303 | − | |
| 304 | − /* Perform the multiply-accumulate */ | |
| 305 | − acc0 += x0 * c0; | |
| 306 | − | |
| 307 | − /* Decrement loop counter */ | |
| 308 | − tapCnt--; | |
| 309 | − } | |
| 310 | − | |
| 311 | − /* Advance the state pointer by the decimation factor | |
| 312 | − * to process the next group of decimation factor number samples */ | |
| 313 | − pState = pState + os->ratio; | |
| 314 | − | |
| 315 | − /* The result is in the accumulator, store in the destination buffer. */ | |
| 316 | − output = acc0; | |
| 317 | − | |
| 318 | − /* Processing is complete. | |
| 319 | − Now copy the last numTaps - 1 samples to the start of the state buffer. | |
| 320 | − This prepares the state buffer for the next function call. */ | |
| 321 | − | |
| 322 | − /* Points to the start of the state buffer */ | |
| 323 | − pStateCur = os->downState; | |
| 324 | − | |
| 325 | − /* Initialize tapCnt with number of taps */ | |
| 326 | − tapCnt = (numTaps - 1U); | |
| 327 | − | |
| 328 | − /* Copy data */ | |
| 329 | − while (tapCnt > 0U) | |
| 330 | − { | |
| 331 | − *pStateCur++ = *pState++; | |
| 332 | − | |
| 333 | − /* Decrement loop counter */ | |
| 334 | − tapCnt--; | |
| 335 | − } | |
| 336 | − | |
| 337 | − return output; | |
| 338 | −} | |
| 339 | − | |
| 340 | −int tOversampler_getLatency(tOversampler* const osr) | |
| 341 | −{ | |
| 342 | − _tOversampler* os = *osr; | |
| 343 | − return os->phaseLength; | |
| 344 | −} | |
| 345 | − | |
| 346 | −//============================================================================================================ | |
| 347 | −// WAVEFOLDER | |
| 348 | −//============================================================================================================ | |
| 349 | − | |
| 350 | − | |
| 351 | −//from the paper: Virtual Analog Model of the Lockhart Wavefolder | |
| 352 | −//by Fabián Esqueda, Henri Pöntynen, Julian D. Parker and Stefan Bilbao | |
| 353 | − | |
| 354 | −void tLockhartWavefolder_init(tLockhartWavefolder* const wf) | |
| 355 | −{ | |
| 356 | − _tLockhartWavefolder* w = *wf = (_tLockhartWavefolder*) leaf_alloc(sizeof(_tLockhartWavefolder)); | |
| 357 | − | |
| 358 | − w->Ln1 = 0.0; | |
| 359 | − w->Fn1 = 0.0; | |
| 360 | − w->xn1 = 0.0f; | |
| 361 | − | |
| 362 | − w->RL = 7.5e3; | |
| 363 | − w->R = 15e3; | |
| 364 | − w->VT = 26e-3; | |
| 365 | − w->Is = 10e-16; | |
| 366 | − | |
| 367 | − w->a = 2.0*w->RL/w->R; | |
| 368 | − w->b = (w->R+2.0*w->RL)/(w->VT*w->R); | |
| 369 | − w->d = (w->RL*w->Is)/w->VT; | |
| 370 | − w->half_a = 0.5 * w->a; | |
| 371 | − w->longthing = (0.5*w->VT/w->b); | |
| 372 | − | |
| 373 | − | |
| 374 | − // Antialiasing error threshold | |
| 375 | − w->thresh = 10e-10; | |
| 376 | −} | |
| 377 | − | |
| 378 | −void tLockhartWavefolder_free(tLockhartWavefolder* const wf) | |
| 379 | −{ | |
| 380 | − _tLockhartWavefolder* w = *wf; | |
| 381 | − | |
| 382 | − leaf_free(w); | |
| 383 | −} | |
| 384 | − | |
| 385 | −void tLockhartWavefolder_initToPool (tLockhartWavefolder* const wf, tMempool* const mp) | |
| 386 | −{ | |
| 387 | − _tMempool* m = *mp; | |
| 388 | − _tLockhartWavefolder* w = *wf = (_tLockhartWavefolder*) mpool_alloc(sizeof(_tLockhartWavefolder), &m->pool); | |
| 389 | − | |
| 390 | − w->Ln1 = 0.0; | |
| 391 | − w->Fn1 = 0.0; | |
| 392 | − w->xn1 = 0.0f; | |
| 393 | − | |
| 394 | − w->RL = 7.5e3; | |
| 395 | − w->R = 15e3; | |
| 396 | − w->VT = 26e-3; | |
| 397 | − w->Is = 10e-16; | |
| 398 | − | |
| 399 | − w->a = 2.0*w->RL/w->R; | |
| 400 | − w->b = (w->R+2.0*w->RL)/(w->VT*w->R); | |
| 401 | − w->d = (w->RL*w->Is)/w->VT; | |
| 402 | − w->half_a = 0.5 * w->a; | |
| 403 | − w->longthing = (0.5*w->VT/w->b); | |
| 404 | − | |
| 405 | − | |
| 406 | − // Antialiasing error threshold | |
| 407 | − w->thresh = 10e-10; | |
| 408 | −} | |
| 409 | − | |
| 410 | −void tLockhartWavefolder_freeFromPool (tLockhartWavefolder* const wf, tMempool* const mp) | |
| 411 | −{ | |
| 412 | − _tMempool* m = *mp; | |
| 413 | − _tLockhartWavefolder* w = *wf; | |
| 414 | − | |
| 415 | − mpool_free(w, &m->pool); | |
| 416 | −} | |
| 417 | − | |
| 418 | −double tLockhartWavefolderLambert(double x, double ln) | |
| 419 | −{ | |
| 420 | − double thresh, w, expw, p, r, s, err; | |
| 421 | − // Error threshold | |
| 422 | − thresh = 10e-12; | |
| 423 | − // Initial guess (use previous value) | |
| 424 | − w = ln; | |
| 425 | − | |
| 426 | − // Haley's method (Sec. 4.2 of the paper) | |
| 427 | − for(int i=0; i<1000; i+=1) { | |
| 428 | − | |
| 429 | − expw = exp(w); | |
| 430 | − | |
| 431 | − p = w*expw - x; | |
| 432 | − r = (w+1.0)*expw; | |
| 433 | − s = (w+2.0)/(2.0*(w+1.0)); | |
| 434 | − err = (p/(r-(p*s))); | |
| 435 | − | |
| 436 | − if (fabs(err)<thresh) { | |
| 437 | − | |
| 438 | − break; | |
| 439 | − } | |
| 440 | − | |
| 441 | − w = w - err; | |
| 442 | − if (i == 999) | |
| 443 | − { | |
| 444 | − //HAL_GPIO_WritePin(GPIOG, GPIO_PIN_7, GPIO_PIN_SET); | |
| 445 | − } | |
| 446 | − | |
| 447 | − } | |
| 448 | − return w; | |
| 449 | −} | |
| 450 | − | |
| 451 | −float tLockhartWavefolder_tick(tLockhartWavefolder* const wf, float samp) | |
| 452 | −{ | |
| 453 | − _tLockhartWavefolder* w = *wf; | |
| 454 | − | |
| 455 | − float out = 0.0f; | |
| 456 | − | |
| 457 | − // Compute Antiderivative | |
| 458 | − int l = (samp > 0.0f) - (samp < 0.0f); | |
| 459 | − double u = w->d*exp(l*w->b*samp); | |
| 460 | − double Ln = tLockhartWavefolderLambert(u,w->Ln1); | |
| 461 | − double Fn = w->longthing*(Ln*(Ln + 2.0)) - w->half_a*samp*samp; | |
| 462 | − | |
| 463 | − // Check for ill-conditioning | |
| 464 | − if (fabs(samp-w->xn1)<w->thresh) { | |
| 465 | − | |
| 466 | − // Compute Averaged Wavefolder Output | |
| 467 | − float xn = 0.5f*(samp+w->xn1); | |
| 468 | − u = w->d*exp(l*w->b*xn); | |
| 469 | − Ln = tLockhartWavefolderLambert(u,w->Ln1); | |
| 470 | − out = (float) (l*w->VT*Ln - w->a*xn); | |
| 471 | − | |
| 472 | − } | |
| 473 | − else { | |
| 474 | − | |
| 475 | − // Apply AA Form | |
| 476 | − out = (float) ((Fn-w->Fn1)/(samp-w->xn1)); | |
| 477 | − } | |
| 478 | − | |
| 479 | − // Update States | |
| 480 | − w->Ln1 = Ln; | |
| 481 | − w->Fn1 = Fn; | |
| 482 | − w->xn1 = samp; | |
| 483 | − | |
| 484 | − return out; | |
| 485 | −} | |
| 486 | − | |
| 487 | −//============================================================================================================ | |
| 488 | −// CRUSHER | |
| 489 | −//============================================================================================================ | |
| 490 | −#define SCALAR 5000.f | |
| 491 | − | |
| 492 | −void tCrusher_init (tCrusher* const cr) | |
| 493 | −{ | |
| 494 | − _tCrusher* c = *cr = (_tCrusher*) leaf_alloc(sizeof(_tCrusher)); | |
| 495 | − | |
| 496 | − c->op = 4; | |
| 497 | − c->div = SCALAR; | |
| 498 | − c->rnd = 0.25f; | |
| 499 | − c->srr = 0.25f; | |
| 500 | − tSampleReducer_init(&c->sReducer); | |
| 501 | − c->gain = (c->div / SCALAR) * 0.7f + 0.3f; | |
| 502 | −} | |
| 503 | − | |
| 504 | −void tCrusher_free (tCrusher* const cr) | |
| 505 | −{ | |
| 506 | − _tCrusher* c = *cr; | |
| 507 | − tSampleReducer_free(&c->sReducer); | |
| 508 | − leaf_free(c); | |
| 509 | −} | |
| 510 | − | |
| 511 | −void tCrusher_initToPool (tCrusher* const cr, tMempool* const mp) | |
| 512 | −{ | |
| 513 | − _tMempool* m = *mp; | |
| 514 | − _tCrusher* c = *cr = (_tCrusher*) mpool_alloc(sizeof(_tCrusher), &m->pool); | |
| 515 | − | |
| 516 | − c->op = 4; | |
| 517 | − c->div = SCALAR; | |
| 518 | − c->rnd = 0.25f; | |
| 519 | − c->srr = 0.25f; | |
| 520 | − tSampleReducer_initToPool(&c->sReducer, mp); | |
| 521 | − c->gain = (c->div / SCALAR) * 0.7f + 0.3f; | |
| 522 | −} | |
| 523 | − | |
| 524 | −void tCrusher_freeFromPool (tCrusher* const cr, tMempool* const mp) | |
| 525 | −{ | |
| 526 | − _tMempool* m = *mp; | |
| 527 | − _tCrusher* c = *cr; | |
| 528 | − tSampleReducer_freeFromPool(&c->sReducer, mp); | |
| 529 | − mpool_free(c, &m->pool); | |
| 530 | −} | |
| 531 | − | |
| 532 | −float tCrusher_tick (tCrusher* const cr, float input) | |
| 533 | −{ | |
| 534 | − _tCrusher* c = *cr; | |
| 535 | − | |
| 536 | − float sample = input; | |
| 537 | − | |
| 538 | − sample *= SCALAR; // SCALAR is 5000 by default | |
| 539 | − | |
| 540 | − sample = (int32_t) sample; | |
| 541 | − | |
| 542 | − sample /= c->div; | |
| 543 | − | |
| 544 | − sample = LEAF_bitwise_xor(sample, c->op << 23); | |
| 545 | − | |
| 546 | − sample = LEAF_clip(-1.f, sample, 1.f); | |
| 547 | − | |
| 548 | − sample = LEAF_round(sample, c->rnd); | |
| 549 | − | |
| 550 | − sample = tSampleReducer_tick(&c->sReducer, sample); | |
| 551 | − | |
| 552 | − return sample * c->gain; | |
| 553 | − | |
| 554 | −} | |
| 555 | − | |
| 556 | −void tCrusher_setOperation (tCrusher* const cr, float op) | |
| 557 | −{ | |
| 558 | − _tCrusher* c = *cr; | |
| 559 | − c->op = (uint32_t) (op * 8.0f); | |
| 560 | −} | |
| 561 | − | |
| 562 | −// 0.0 - 1.0 | |
| 563 | −void tCrusher_setQuality (tCrusher* const cr, float val) | |
| 564 | −{ | |
| 565 | − _tCrusher* c = *cr; | |
| 566 | − | |
| 567 | − val = LEAF_clip(0.0f, val, 1.0f); | |
| 568 | − | |
| 569 | − c->div = 0.01f + val * SCALAR; | |
| 570 | − | |
| 571 | − c->gain = (c->div / SCALAR) * 0.7f + 0.3f; | |
| 572 | −} | |
| 573 | − | |
| 574 | −// what decimal to round to | |
| 575 | −void tCrusher_setRound (tCrusher* const cr, float rnd) | |
| 576 | −{ | |
| 577 | − _tCrusher* c = *cr; | |
| 578 | − c->rnd = fabsf(rnd); | |
| 579 | −} | |
| 580 | − | |
| 581 | −void tCrusher_setSamplingRatio (tCrusher* const cr, float ratio) | |
| 582 | −{ | |
| 583 | − _tCrusher* c = *cr; | |
| 584 | − c->srr = ratio; | |
| 585 | − tSampleReducer_setRatio(&c->sReducer, ratio); | |
| 586 | − | |
| 587 | −} | |
| @@ -1,221 +0,0 @@ | ||
| 1 | −/*============================================================================== | |
| 2 | − | |
| 3 | − leaf-dynamics.c | |
| 4 | − Created: 30 Nov 2018 11:56:49am | |
| 5 | − Author: airship | |
| 6 | − | |
| 7 | −==============================================================================*/ | |
| 8 | − | |
| 9 | −#if _WIN32 || _WIN64 | |
| 10 | − | |
| 11 | −#include "..\Inc\leaf-dynamics.h" | |
| 12 | − | |
| 13 | −#else | |
| 14 | − | |
| 15 | −#include "../Inc/leaf-dynamics.h" | |
| 16 | − | |
| 17 | −#endif | |
| 18 | − | |
| 19 | −//============================================================================== | |
| 20 | − | |
| 21 | −// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Compressor ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ // | |
| 22 | − | |
| 23 | −/* | |
| 24 | − tCompressor* tCompressorInit(int tauAttack, int tauRelease) | |
| 25 | − { | |
| 26 | − tCompressor* c = &leaf.tCompressorRegistry[leaf.registryIndex[T_COMPRESSOR]++]; | |
| 27 | − | |
| 28 | − c->tauAttack = tauAttack; | |
| 29 | − c->tauRelease = tauRelease; | |
| 30 | − | |
| 31 | − c->x_G[0] = 0.0f, c->x_G[1] = 0.0f, | |
| 32 | − c->y_G[0] = 0.0f, c->y_G[1] = 0.0f, | |
| 33 | − c->x_T[0] = 0.0f, c->x_T[1] = 0.0f, | |
| 34 | − c->y_T[0] = 0.0f, c->y_T[1] = 0.0f; | |
| 35 | − | |
| 36 | − c->T = 0.0f; // Threshold | |
| 37 | − c->R = 1.0f; // compression Ratio | |
| 38 | − c->M = 0.0f; // decibel Make-up gain | |
| 39 | − c->W = 0.0f; // decibel Width of knee transition | |
| 40 | − | |
| 41 | − return c; | |
| 42 | − } | |
| 43 | − */ | |
| 44 | −void tCompressor_init(tCompressor* const comp) | |
| 45 | −{ | |
| 46 | − _tCompressor* c = *comp = (_tCompressor*) leaf_alloc(sizeof(_tCompressor)); | |
| 47 | − | |
| 48 | − c->tauAttack = 100; | |
| 49 | − c->tauRelease = 100; | |
| 50 | − | |
| 51 | − c->isActive = OFALSE; | |
| 52 | − | |
| 53 | − c->T = 0.0f; // Threshold | |
| 54 | − c->R = 0.5f; // compression Ratio | |
| 55 | − c->M = 3.0f; // decibel Width of knee transition | |
| 56 | − c->W = 1.0f; // decibel Make-up gain | |
| 57 | −} | |
| 58 | − | |
| 59 | −void tCompressor_free(tCompressor* const comp) | |
| 60 | −{ | |
| 61 | − _tCompressor* c = *comp; | |
| 62 | − | |
| 63 | − leaf_free(c); | |
| 64 | −} | |
| 65 | − | |
| 66 | −void tCompressor_initToPool (tCompressor* const comp, tMempool* const mp) | |
| 67 | −{ | |
| 68 | − _tMempool* m = *mp; | |
| 69 | − _tCompressor* c = *comp = (_tCompressor*) mpool_alloc(sizeof(_tCompressor), &m->pool); | |
| 70 | − | |
| 71 | − c->tauAttack = 100; | |
| 72 | − c->tauRelease = 100; | |
| 73 | − | |
| 74 | − c->isActive = OFALSE; | |
| 75 | − | |
| 76 | − c->T = 0.0f; // Threshold | |
| 77 | − c->R = 0.5f; // compression Ratio | |
| 78 | − c->M = 3.0f; // decibel Width of knee transition | |
| 79 | − c->W = 1.0f; // decibel Make-up gain | |
| 80 | −} | |
| 81 | − | |
| 82 | −void tCompressor_freeFromPool(tCompressor* const comp, tMempool* const mp) | |
| 83 | −{ | |
| 84 | − _tMempool* m = *mp; | |
| 85 | − _tCompressor* c = *comp; | |
| 86 | − | |
| 87 | − mpool_free(c, &m->pool); | |
| 88 | −} | |
| 89 | − | |
| 90 | −float tCompressor_tick(tCompressor* const comp, float in) | |
| 91 | −{ | |
| 92 | − _tCompressor* c = *comp; | |
| 93 | − | |
| 94 | − float slope, overshoot; | |
| 95 | − float alphaAtt, alphaRel; | |
| 96 | − | |
| 97 | − float in_db = 20.0f * log10f( fmaxf( fabsf( in), 0.000001f)), out_db = 0.0f; | |
| 98 | − | |
| 99 | − c->y_T[1] = c->y_T[0]; | |
| 100 | − | |
| 101 | − slope = c->R - 1.0f; // feed-forward topology; was 1/C->R - 1 | |
| 102 | − | |
| 103 | − overshoot = in_db - c->T; | |
| 104 | − | |
| 105 | − | |
| 106 | − if (overshoot <= -(c->W * 0.5f)) | |
| 107 | − { | |
| 108 | − out_db = in_db; | |
| 109 | − c->isActive = OFALSE; | |
| 110 | − } | |
| 111 | − else if ((overshoot > -(c->W * 0.5f)) && (overshoot < (c->W * 0.5f))) | |
| 112 | − { | |
| 113 | − out_db = in_db + slope * (powf((overshoot + c->W*0.5f),2) / (2.0f * c->W)); // .^ 2 ??? | |
| 114 | − c->isActive = OTRUE; | |
| 115 | − } | |
| 116 | − else if (overshoot >= (c->W * 0.5f)) | |
| 117 | − { | |
| 118 | − out_db = in_db + slope * overshoot; | |
| 119 | − c->isActive = OTRUE; | |
| 120 | − } | |
| 121 | − | |
| 122 | − | |
| 123 | − | |
| 124 | − c->x_T[0] = out_db - in_db; | |
| 125 | − | |
| 126 | − alphaAtt = expf(-1.0f/(0.001f * c->tauAttack * leaf.sampleRate)); | |
| 127 | − alphaRel = expf(-1.0f/(0.001f * c->tauRelease * leaf.sampleRate)); | |
| 128 | − | |
| 129 | − if (c->x_T[0] > c->y_T[1]) | |
| 130 | − c->y_T[0] = alphaAtt * c->y_T[1] + (1-alphaAtt) * c->x_T[0]; | |
| 131 | − else | |
| 132 | − c->y_T[0] = alphaRel * c->y_T[1] + (1-alphaRel) * c->x_T[0]; | |
| 133 | − | |
| 134 | − float attenuation = powf(10.0f, ((c->M - c->y_T[0])/20.0f)); | |
| 135 | − | |
| 136 | − return attenuation * in; | |
| 137 | −} | |
| 138 | − | |
| 139 | −/* Feedback Leveler */ | |
| 140 | − | |
| 141 | −void tFeedbackLeveler_init(tFeedbackLeveler* const fb, float targetLevel, float factor, float strength, int mode) | |
| 142 | −{ | |
| 143 | − _tFeedbackLeveler* p = *fb = (_tFeedbackLeveler*) leaf_alloc(sizeof(_tFeedbackLeveler)); | |
| 144 | − | |
| 145 | − p->curr=0.0f; | |
| 146 | − p->targetLevel=targetLevel; | |
| 147 | − tPowerFollower_init(&p->pwrFlw,factor); | |
| 148 | − p->mode=mode; | |
| 149 | − p->strength=strength; | |
| 150 | −} | |
| 151 | − | |
| 152 | −void tFeedbackLeveler_free(tFeedbackLeveler* const fb) | |
| 153 | −{ | |
| 154 | − _tFeedbackLeveler* p = *fb; | |
| 155 | − | |
| 156 | − tPowerFollower_free(&p->pwrFlw); | |
| 157 | − leaf_free(p); | |
| 158 | −} | |
| 159 | − | |
| 160 | −void tFeedbackLeveler_initToPool (tFeedbackLeveler* const fb, float targetLevel, float factor, float strength, int mode, tMempool* const mp) | |
| 161 | −{ | |
| 162 | − _tMempool* m = *mp; | |
| 163 | − _tFeedbackLeveler* p = *fb = (_tFeedbackLeveler*) mpool_alloc(sizeof(_tFeedbackLeveler), &m->pool); | |
| 164 | − | |
| 165 | − p->curr=0.0f; | |
| 166 | − p->targetLevel=targetLevel; | |
| 167 | − tPowerFollower_initToPool(&p->pwrFlw,factor, mp); | |
| 168 | − p->mode=mode; | |
| 169 | − p->strength=strength; | |
| 170 | −} | |
| 171 | − | |
| 172 | −void tFeedbackLeveler_freeFromPool (tFeedbackLeveler* const fb, tMempool* const mp) | |
| 173 | −{ | |
| 174 | − _tMempool* m = *mp; | |
| 175 | − _tFeedbackLeveler* p = *fb; | |
| 176 | − | |
| 177 | − tPowerFollower_freeFromPool(&p->pwrFlw, mp); | |
| 178 | − mpool_free(p, &m->pool); | |
| 179 | −} | |
| 180 | − | |
| 181 | −void tFeedbackLeveler_setStrength(tFeedbackLeveler* const fb, float strength) | |
| 182 | −{ // strength is how strongly level diff is affecting the amp ratio | |
| 183 | − // try 0.125 for a start | |
| 184 | − _tFeedbackLeveler* p = *fb; | |
| 185 | − p->strength=strength; | |
| 186 | −} | |
| 187 | − | |
| 188 | −void tFeedbackLeveler_setFactor(tFeedbackLeveler* const fb, float factor) | |
| 189 | −{ | |
| 190 | − _tFeedbackLeveler* p = *fb; | |
| 191 | − tPowerFollower_setFactor(&p->pwrFlw,factor); | |
| 192 | −} | |
| 193 | − | |
| 194 | −void tFeedbackLeveler_setMode(tFeedbackLeveler* const fb, int mode) | |
| 195 | −{ // 0 for decaying with upwards lev limiting, 1 for constrained absolute level (also downwards limiting) | |
| 196 | − _tFeedbackLeveler* p = *fb; | |
| 197 | − p->mode=mode; | |
| 198 | −} | |
| 199 | − | |
| 200 | −float tFeedbackLeveler_tick(tFeedbackLeveler* const fb, float input) | |
| 201 | −{ | |
| 202 | − _tFeedbackLeveler* p = *fb; | |
| 203 | − float levdiff=(tPowerFollower_tick(&p->pwrFlw, input)-p->targetLevel); | |
| 204 | − if (p->mode==0 && levdiff<0.0f) levdiff=0.0f; | |
| 205 | − p->curr=input*(1.0f-p->strength*levdiff); | |
| 206 | − return p->curr; | |
| 207 | −} | |
| 208 | − | |
| 209 | −float tFeedbackLeveler_sample(tFeedbackLeveler* const fb) | |
| 210 | −{ | |
| 211 | − _tFeedbackLeveler* p = *fb; | |
| 212 | − return p->curr; | |
| 213 | −} | |
| 214 | − | |
| 215 | − | |
| 216 | −void tFeedbackLeveler_setTargetLevel (tFeedbackLeveler* const fb, float TargetLevel) | |
| 217 | −{ | |
| 218 | − _tFeedbackLeveler* p = *fb; | |
| 219 | − p->targetLevel=TargetLevel; | |
| 220 | −} | |
| 221 | − | |
| @@ -1,1676 +0,0 @@ | ||
| 1 | −/*============================================================================== | |
| 2 | − | |
| 3 | − leaf-vocoder.c | |
| 4 | − Created: 20 Jan 2017 12:01:54pm | |
| 5 | − Author: Michael R Mulshine | |
| 6 | − | |
| 7 | − ==============================================================================*/ | |
| 8 | − | |
| 9 | −#if _WIN32 || _WIN64 | |
| 10 | − | |
| 11 | −#include "..\Inc\leaf-effects.c" | |
| 12 | −#include "..\leaf.h" | |
| 13 | − | |
| 14 | −#else | |
| 15 | − | |
| 16 | −#include "../Inc/leaf-effects.h" | |
| 17 | −#include "../leaf.h" | |
| 18 | − | |
| 19 | −#endif | |
| 20 | − | |
| 21 | − | |
| 22 | − | |
| 23 | −//============================================================================================================ | |
| 24 | −// TALKBOX | |
| 25 | −//============================================================================================================ | |
| 26 | − | |
| 27 | −void tTalkbox_init(tTalkbox* const voc, int bufsize) | |
| 28 | −{ | |
| 29 | − | |
| 30 | − _tTalkbox* v = *voc = (_tTalkbox*) leaf_alloc(sizeof(_tTalkbox)); | |
| 31 | − | |
| 32 | − v->param[0] = 0.5f; //wet | |
| 33 | − v->param[1] = 0.0f; //dry | |
| 34 | − v->param[2] = 0; // Swap | |
| 35 | − v->param[3] = 1.0f; //quality | |
| 36 | − | |
| 37 | − v->bufsize = bufsize; | |
| 38 | − | |
| 39 | − v->car0 = (float*) leaf_alloc(sizeof(float) * v->bufsize); | |
| 40 | − v->car1 = (float*) leaf_alloc(sizeof(float) * v->bufsize); | |
| 41 | − v->window = (float*) leaf_alloc(sizeof(float) * v->bufsize); | |
| 42 | − v->buf0 = (float*) leaf_alloc(sizeof(float) * v->bufsize); | |
| 43 | − v->buf1 = (float*) leaf_alloc(sizeof(float) * v->bufsize); | |
| 44 | − | |
| 45 | − tTalkbox_update(voc); | |
| 46 | − tTalkbox_suspend(voc); | |
| 47 | −} | |
| 48 | − | |
| 49 | −void tTalkbox_free(tTalkbox* const voc) | |
| 50 | −{ | |
| 51 | − _tTalkbox* v = *voc; | |
| 52 | − | |
| 53 | − leaf_free(v->buf1); | |
| 54 | − leaf_free(v->buf0); | |
| 55 | − leaf_free(v->window); | |
| 56 | − leaf_free(v->car1); | |
| 57 | − leaf_free(v->car0); | |
| 58 | − | |
| 59 | − leaf_free(v); | |
| 60 | −} | |
| 61 | − | |
| 62 | −void tTalkbox_initToPool (tTalkbox* const voc, int bufsize, tMempool* const mp) | |
| 63 | −{ | |
| 64 | − _tMempool* m = *mp; | |
| 65 | − _tTalkbox* v = *voc = (_tTalkbox*) mpool_alloc(sizeof(_tTalkbox), &m->pool); | |
| 66 | − | |
| 67 | − v->param[0] = 0.5f; //wet | |
| 68 | − v->param[1] = 0.0f; //dry | |
| 69 | − v->param[2] = 0; // Swap | |
| 70 | − v->param[3] = 1.0f; //quality | |
| 71 | − | |
| 72 | − v->bufsize = bufsize; | |
| 73 | − | |
| 74 | − v->car0 = (float*) mpool_alloc(sizeof(float) * v->bufsize, &m->pool); | |
| 75 | − v->car1 = (float*) mpool_alloc(sizeof(float) * v->bufsize, &m->pool); | |
| 76 | − v->window = (float*) mpool_alloc(sizeof(float) * v->bufsize, &m->pool); | |
| 77 | − v->buf0 = (float*) mpool_alloc(sizeof(float) * v->bufsize, &m->pool); | |
| 78 | − v->buf1 = (float*) mpool_alloc(sizeof(float) * v->bufsize, &m->pool); | |
| 79 | − | |
| 80 | − tTalkbox_update(voc); | |
| 81 | − tTalkbox_suspend(voc); | |
| 82 | −} | |
| 83 | − | |
| 84 | −void tTalkbox_freeFromPool (tTalkbox* const voc, tMempool* const mp) | |
| 85 | −{ | |
| 86 | − _tMempool* m = *mp; | |
| 87 | − _tTalkbox* v = *voc; | |
| 88 | − | |
| 89 | − mpool_free(v->buf1, &m->pool); | |
| 90 | − mpool_free(v->buf0, &m->pool); | |
| 91 | − mpool_free(v->window, &m->pool); | |
| 92 | − mpool_free(v->car1, &m->pool); | |
| 93 | − mpool_free(v->car0, &m->pool); | |
| 94 | − | |
| 95 | − mpool_free(v, &m->pool); | |
| 96 | −} | |
| 97 | − | |
| 98 | −void tTalkbox_update(tTalkbox* const voc) ///update internal parameters... | |
| 99 | −{ | |
| 100 | − _tTalkbox* v = *voc; | |
| 101 | − | |
| 102 | − float fs = leaf.sampleRate; | |
| 103 | − if(fs < 8000.0f) fs = 8000.0f; | |
| 104 | − if(fs > 96000.0f) fs = 96000.0f; | |
| 105 | − | |
| 106 | − int32_t n = (int32_t)(0.01633f * fs); | |
| 107 | − if(n > v->bufsize) n = v->bufsize; | |
| 108 | − | |
| 109 | − //O = (VstInt32)(0.0005f * fs); | |
| 110 | − v->O = (int32_t)((0.0001f + 0.0004f * v->param[3]) * fs); | |
| 111 | − | |
| 112 | − if(n != v->N) //recalc hanning window | |
| 113 | − { | |
| 114 | − v->N = n; | |
| 115 | − float dp = TWO_PI / v->N; | |
| 116 | − float p = 0.0f; | |
| 117 | − for(n=0; n<v->N; n++) | |
| 118 | − { | |
| 119 | − v->window[n] = 0.5f - 0.5f * cosf(p); | |
| 120 | − p += dp; | |
| 121 | − } | |
| 122 | − } | |
| 123 | − v->wet = 0.5f * v->param[0] * v->param[0]; | |
| 124 | − v->dry = 2.0f * v->param[1] * v->param[1]; | |
| 125 | −} | |
| 126 | − | |
| 127 | −void tTalkbox_suspend(tTalkbox* const voc) ///clear any buffers... | |
| 128 | −{ | |
| 129 | − _tTalkbox* v = *voc; | |
| 130 | − | |
| 131 | − v->pos = v->K = 0; | |
| 132 | − v->emphasis = 0.0f; | |
| 133 | − v->FX = 0; | |
| 134 | − | |
| 135 | − v->u0 = v->u1 = v->u2 = v->u3 = v->u4 = 0.0f; | |
| 136 | − v->d0 = v->d1 = v->d2 = v->d3 = v->d4 = 0.0f; | |
| 137 | − | |
| 138 | − for (int32_t i = 0; i < v->bufsize; i++) | |
| 139 | − { | |
| 140 | − v->buf0[i] = 0; | |
| 141 | − v->buf1[i] = 0; | |
| 142 | − v->car0[i] = 0; | |
| 143 | − v->car1[i] = 0; | |
| 144 | − } | |
| 145 | −} | |
| 146 | − | |
| 147 | − | |
| 148 | −#define ORD_MAX 100 // Was 50. Increasing this gets rid of glitchiness, lowering it breaks it; not sure how it affects performance | |
| 149 | −void tTalkbox_lpc(float *buf, float *car, int32_t n, int32_t o) | |
| 150 | −{ | |
| 151 | − float z[ORD_MAX], r[ORD_MAX], k[ORD_MAX], G, x; | |
| 152 | − int32_t i, j, nn=n; | |
| 153 | − | |
| 154 | − for(j=0; j<=o; j++, nn--) //buf[] is already emphasized and windowed | |
| 155 | − { | |
| 156 | − z[j] = r[j] = 0.0f; | |
| 157 | − for(i=0; i<nn; i++) r[j] += buf[i] * buf[i+j]; //autocorrelation | |
| 158 | − } | |
| 159 | − r[0] *= 1.001f; //stability fix | |
| 160 | − | |
| 161 | − float min = 0.00001f; | |
| 162 | − if(r[0] < min) { for(i=0; i<n; i++) buf[i] = 0.0f; return; } | |
| 163 | − | |
| 164 | − tTalkbox_lpcDurbin(r, o, k, &G); //calc reflection coeffs | |
| 165 | − | |
| 166 | − for(i=0; i<=o; i++) | |
| 167 | − { | |
| 168 | − if(k[i] > 0.995f) k[i] = 0.995f; else if(k[i] < -0.995f) k[i] = -.995f; | |
| 169 | − } | |
| 170 | − | |
| 171 | − for(i=0; i<n; i++) | |
| 172 | − { | |
| 173 | − x = G * car[i]; | |
| 174 | − for(j=o; j>0; j--) //lattice filter | |
| 175 | − { | |
| 176 | − x -= k[j] * z[j-1]; | |
| 177 | − z[j] = z[j-1] + k[j] * x; | |
| 178 | − } | |
| 179 | − buf[i] = z[0] = x; //output buf[] will be windowed elsewhere | |
| 180 | − } | |
| 181 | −} | |
| 182 | − | |
| 183 | − | |
| 184 | −void tTalkbox_lpcDurbin(float *r, int p, float *k, float *g) | |
| 185 | −{ | |
| 186 | − int i, j; | |
| 187 | − float a[ORD_MAX], at[ORD_MAX], e=r[0]; | |
| 188 | − | |
| 189 | − for(i=0; i<=p; i++) a[i] = at[i] = 0.0f; //probably don't need to clear at[] or k[] | |
| 190 | − | |
| 191 | − for(i=1; i<=p; i++) | |
| 192 | − { | |
| 193 | − k[i] = -r[i]; | |
| 194 | − | |
| 195 | − for(j=1; j<i; j++) | |
| 196 | − { | |
| 197 | − at[j] = a[j]; | |
| 198 | − k[i] -= a[j] * r[i-j]; | |
| 199 | − } | |
| 200 | − if(fabs(e) < 1.0e-20f) { e = 0.0f; break; } | |
| 201 | − k[i] /= e; // This might be costing us | |
| 202 | − | |
| 203 | − a[i] = k[i]; | |
| 204 | − for(j=1; j<i; j++) a[j] = at[j] + k[i] * at[i-j]; | |
| 205 | − | |
| 206 | − e *= 1.0f - k[i] * k[i]; | |
| 207 | − } | |
| 208 | − | |
| 209 | − if(e < 1.0e-20f) e = 0.0f; | |
| 210 | − *g = sqrtf(e); | |
| 211 | −} | |
| 212 | − | |
| 213 | −float tTalkbox_tick(tTalkbox* const voc, float synth, float voice) | |
| 214 | −{ | |
| 215 | − _tTalkbox* v = *voc; | |
| 216 | − | |
| 217 | − int32_t p0=v->pos, p1 = (v->pos + v->N/2) % v->N; | |
| 218 | − float e=v->emphasis, w, o, x, dr, fx=v->FX; | |
| 219 | − float p, q, h0=0.3f, h1=0.77f; | |
| 220 | − | |
| 221 | − o = voice; | |
| 222 | − x = synth; | |
| 223 | − | |
| 224 | − dr = o; | |
| 225 | − | |
| 226 | − p = v->d0 + h0 * x; v->d0 = v->d1; v->d1 = x - h0 * p; | |
| 227 | − q = v->d2 + h1 * v->d4; v->d2 = v->d3; v->d3 = v->d4 - h1 * q; | |
| 228 | − v->d4 = x; | |
| 229 | − x = p + q; | |
| 230 | − | |
| 231 | − if(v->K++) | |
| 232 | − { | |
| 233 | − v->K = 0; | |
| 234 | − | |
| 235 | − v->car0[p0] = v->car1[p1] = x; //carrier input | |
| 236 | − | |
| 237 | − x = o - e; e = o; //6dB/oct pre-emphasis | |
| 238 | − | |
| 239 | − w = v->window[p0]; fx = v->buf0[p0] * w; v->buf0[p0] = x * w; //50% overlapping hanning windows | |
| 240 | − if(++p0 >= v->N) { tTalkbox_lpc(v->buf0, v->car0, v->N, v->O); p0 = 0; } | |
| 241 | − | |
| 242 | − w = 1.0f - w; fx += v->buf1[p1] * w; v->buf1[p1] = x * w; | |
| 243 | − if(++p1 >= v->N) { tTalkbox_lpc(v->buf1, v->car1, v->N, v->O); p1 = 0; } | |
| 244 | − } | |
| 245 | − | |
| 246 | − p = v->u0 + h0 * fx; v->u0 = v->u1; v->u1 = fx - h0 * p; | |
| 247 | − q = v->u2 + h1 * v->u4; v->u2 = v->u3; v->u3 = v->u4 - h1 * q; | |
| 248 | − v->u4 = fx; | |
| 249 | − x = p + q; | |
| 250 | − | |
| 251 | − o = x; | |
| 252 | − | |
| 253 | − v->emphasis = e; | |
| 254 | − v->pos = p0; | |
| 255 | − v->FX = fx; | |
| 256 | − | |
| 257 | − | |
| 258 | − return o; | |
| 259 | −} | |
| 260 | − | |
| 261 | −void tTalkbox_setQuality(tTalkbox* const voc, float quality) | |
| 262 | −{ | |
| 263 | − _tTalkbox* v = *voc; | |
| 264 | − | |
| 265 | − v->param[3] = quality; | |
| 266 | − v->O = (int32_t)((0.0001f + 0.0004f * v->param[3]) * leaf.sampleRate); | |
| 267 | −} | |
| 268 | − | |
| 269 | − | |
| 270 | −//============================================================================================================ | |
| 271 | −// VOCODER | |
| 272 | −//============================================================================================================ | |
| 273 | − | |
| 274 | −void tVocoder_init (tVocoder* const voc) | |
| 275 | −{ | |
| 276 | − _tVocoder* v = *voc = (_tVocoder*) leaf_alloc(sizeof(_tVocoder)); | |
| 277 | − | |
| 278 | − v->param[0] = 0.33f; //input select | |
| 279 | − v->param[1] = 0.50f; //output dB | |
| 280 | − v->param[2] = 0.40f; //hi thru | |
| 281 | − v->param[3] = 0.40f; //hi band | |
| 282 | − v->param[4] = 0.16f; //envelope | |
| 283 | − v->param[5] = 0.55f; //filter q | |
| 284 | − v->param[6] = 0.6667f;//freq range | |
| 285 | − v->param[7] = 0.33f; //num bands | |
| 286 | − | |
| 287 | − tVocoder_update(voc); | |
| 288 | −} | |
| 289 | − | |
| 290 | −void tVocoder_free (tVocoder* const voc) | |
| 291 | −{ | |
| 292 | − _tVocoder* v = *voc; | |
| 293 | − | |
| 294 | − leaf_free(v); | |
| 295 | −} | |
| 296 | − | |
| 297 | −void tVocoder_initToPool (tVocoder* const voc, tMempool* const mp) | |
| 298 | −{ | |
| 299 | − _tMempool* m = *mp; | |
| 300 | − _tVocoder* v = *voc = (_tVocoder*) mpool_alloc(sizeof(_tVocoder), &m->pool); | |
| 301 | − | |
| 302 | − v->param[0] = 0.33f; //input select | |
| 303 | − v->param[1] = 0.50f; //output dB | |
| 304 | − v->param[2] = 0.40f; //hi thru | |
| 305 | − v->param[3] = 0.40f; //hi band | |
| 306 | − v->param[4] = 0.16f; //envelope | |
| 307 | − v->param[5] = 0.55f; //filter q | |
| 308 | − v->param[6] = 0.6667f;//freq range | |
| 309 | − v->param[7] = 0.33f; //num bands | |
| 310 | − | |
| 311 | − tVocoder_update(voc); | |
| 312 | −} | |
| 313 | − | |
| 314 | −void tVocoder_freeFromPool (tVocoder* const voc, tMempool* const mp) | |
| 315 | −{ | |
| 316 | − _tMempool* m = *mp; | |
| 317 | − _tVocoder* v = *voc; | |
| 318 | − | |
| 319 | − mpool_free(v, &m->pool); | |
| 320 | −} | |
| 321 | − | |
| 322 | −void tVocoder_update (tVocoder* const voc) | |
| 323 | −{ | |
| 324 | − _tVocoder* v = *voc; | |
| 325 | − | |
| 326 | − float tpofs = 6.2831853f * leaf.invSampleRate; | |
| 327 | − | |
| 328 | − float rr, th, re; | |
| 329 | − | |
| 330 | − float sh; | |
| 331 | − | |
| 332 | − int32_t i; | |
| 333 | − | |
| 334 | − v->gain = (float)pow(10.0f, 2.0f * v->param[1] - 3.0f * v->param[5] - 2.0f); | |
| 335 | − | |
| 336 | − v->thru = (float)pow(10.0f, 0.5f + 2.0f * v->param[1]); | |
| 337 | − v->high = v->param[3] * v->param[3] * v->param[3] * v->thru; | |
| 338 | − v->thru *= v->param[2] * v->param[2] * v->param[2]; | |
| 339 | − | |
| 340 | − if(v->param[7]<0.5f) | |
| 341 | − { | |
| 342 | − v->nbnd=8; | |
| 343 | − re=0.003f; | |
| 344 | − v->f[1][2] = 3000.0f; | |
| 345 | − v->f[2][2] = 2200.0f; | |
| 346 | − v->f[3][2] = 1500.0f; | |
| 347 | − v->f[4][2] = 1080.0f; | |
| 348 | − v->f[5][2] = 700.0f; | |
| 349 | − v->f[6][2] = 390.0f; | |
| 350 | − v->f[7][2] = 190.0f; | |
| 351 | − } | |
| 352 | − else | |
| 353 | − { | |
| 354 | − v->nbnd=16; | |
| 355 | − re=0.0015f; | |
| 356 | − v->f[ 1][2] = 5000.0f; //+1000 | |
| 357 | − v->f[ 2][2] = 4000.0f; //+750 | |
| 358 | − v->f[ 3][2] = 3250.0f; //+500 | |
| 359 | − v->f[ 4][2] = 2750.0f; //+450 | |
| 360 | − v->f[ 5][2] = 2300.0f; //+300 | |
| 361 | − v->f[ 6][2] = 2000.0f; //+250 | |
| 362 | − v->f[ 7][2] = 1750.0f; //+250 | |
| 363 | − v->f[ 8][2] = 1500.0f; //+250 | |
| 364 | − v->f[ 9][2] = 1250.0f; //+250 | |
| 365 | − v->f[10][2] = 1000.0f; //+250 | |
| 366 | − v->f[11][2] = 750.0f; //+210 | |
| 367 | − v->f[12][2] = 540.0f; //+190 | |
| 368 | − v->f[13][2] = 350.0f; //+155 | |
| 369 | − v->f[14][2] = 195.0f; //+100 | |
| 370 | − v->f[15][2] = 95.0f; | |
| 371 | − } | |
| 372 | − | |
| 373 | − if(v->param[4]<0.05f) //freeze | |
| 374 | − { | |
| 375 | − for(i=0;i<v->nbnd;i++) v->f[i][12]=0.0f; | |
| 376 | − } | |
| 377 | − else | |
| 378 | − { | |
| 379 | − v->f[0][12] = (float)pow(10.0, -1.7 - 2.7f * v->param[4]); //envelope speed | |
| 380 | − | |
| 381 | − rr = 0.022f / (float)v->nbnd; //minimum proportional to frequency to stop distortion | |
| 382 | − for(i=1;i<v->nbnd;i++) | |
| 383 | − { | |
| 384 | − v->f[i][12] = (float)(0.025 - rr * (double)i); | |
| 385 | − if(v->f[0][12] < v->f[i][12]) v->f[i][12] = v->f[0][12]; | |
| 386 | − } | |
| 387 | − v->f[0][12] = 0.5f * v->f[0][12]; //only top band is at full rate | |
| 388 | − } | |
| 389 | − | |
| 390 | − rr = 1.0 - pow(10.0f, -1.0f - 1.2f * v->param[5]); | |
| 391 | − sh = (float)pow(2.0f, 3.0f * v->param[6] - 1.0f); //filter bank range shift | |
| 392 | − | |
| 393 | − for(i=1;i<v->nbnd;i++) | |
| 394 | − { | |
| 395 | − v->f[i][2] *= sh; | |
| 396 | − th = acos((2.0 * rr * cos(tpofs * v->f[i][2])) / (1.0 + rr * rr)); | |
| 397 | − v->f[i][0] = (float)(2.0 * rr * cos(th)); //a0 | |
| 398 | − v->f[i][1] = (float)(-rr * rr); //a1 | |
| 399 | − //was .98 | |
| 400 | − v->f[i][2] *= 0.96f; //shift 2nd stage slightly to stop high resonance peaks | |
| 401 | − th = acos((2.0 * rr * cos(tpofs * v->f[i][2])) / (1.0 + rr * rr)); | |
| 402 | − v->f[i][2] = (float)(2.0 * rr * cos(th)); | |
| 403 | − } | |
| 404 | −} | |
| 405 | − | |
| 406 | −float tVocoder_tick (tVocoder* const voc, float synth, float voice) | |
| 407 | −{ | |
| 408 | − _tVocoder* v = *voc; | |
| 409 | − | |
| 410 | − float a, b, o=0.0f, aa, bb, oo = v->kout, g = v->gain, ht = v->thru, hh = v->high, tmp; | |
| 411 | − uint32_t i, k = v->kval, nb = v->nbnd; | |
| 412 | − | |
| 413 | − a = voice; //speech | |
| 414 | − b = synth; //synth | |
| 415 | − | |
| 416 | − tmp = a - v->f[0][7]; //integrate modulator for HF band and filter bank pre-emphasis | |
| 417 | − v->f[0][7] = a; | |
| 418 | − a = tmp; | |
| 419 | − | |
| 420 | − if(tmp<0.0f) tmp = -tmp; | |
| 421 | − v->f[0][11] -= v->f[0][12] * (v->f[0][11] - tmp); //high band envelope | |
| 422 | − o = v->f[0][11] * (ht * a + hh * (b - v->f[0][3])); //high band + high thru | |
| 423 | − | |
| 424 | − v->f[0][3] = b; //integrate carrier for HF band | |
| 425 | − | |
| 426 | − if(++k & 0x1) //this block runs at half sample rate | |
| 427 | − { | |
| 428 | − oo = 0.0f; | |
| 429 | − aa = a + v->f[0][9] - v->f[0][8] - v->f[0][8]; //apply zeros here instead of in each reson | |
| 430 | − v->f[0][9] = v->f[0][8]; v->f[0][8] = a; | |
| 431 | − bb = b + v->f[0][5] - v->f[0][4] - v->f[0][4]; | |
| 432 | − v->f[0][5] = v->f[0][4]; v->f[0][4] = b; | |
| 433 | − | |
| 434 | − for(i=1; i<nb; i++) //filter bank: 4th-order band pass | |
| 435 | − { | |
| 436 | − tmp = v->f[i][0] * v->f[i][3] + v->f[i][1] * v->f[i][4] + bb; | |
| 437 | − v->f[i][4] = v->f[i][3]; | |
| 438 | − v->f[i][3] = tmp; | |
| 439 | − tmp += v->f[i][2] * v->f[i][5] + v->f[i][1] * v->f[i][6]; | |
| 440 | − v->f[i][6] = v->f[i][5]; | |
| 441 | − v->f[i][5] = tmp; | |
| 442 | − | |
| 443 | − tmp = v->f[i][0] * v->f[i][7] + v->f[i][1] * v->f[i][8] + aa; | |
| 444 | − v->f[i][8] = v->f[i][7]; | |
| 445 | − v->f[i][7] = tmp; | |
| 446 | − tmp += v->f[i][2] * v->f[i][9] + v->f[i][1] * v->f[i][10]; | |
| 447 | − v->f[i][10] = v->f[i][9]; | |
| 448 | − v->f[i][9] = tmp; | |
| 449 | − | |
| 450 | − if(tmp<0.0f) tmp = -tmp; | |
| 451 | − v->f[i][11] -= v->f[i][12] * (v->f[i][11] - tmp); | |
| 452 | − oo += v->f[i][5] * v->f[i][11]; | |
| 453 | − } | |
| 454 | − } | |
| 455 | − o += oo * g; //effect of interpolating back up to Fs would be minimal (aliasing >16kHz) | |
| 456 | − | |
| 457 | − v->kout = oo; | |
| 458 | − v->kval = k & 0x1; | |
| 459 | − if(fabs(v->f[0][11])<1.0e-10) v->f[0][11] = 0.0f; //catch HF envelope denormal | |
| 460 | − | |
| 461 | − for(i=1;i<nb;i++) | |
| 462 | − if(fabs(v->f[i][3])<1.0e-10 || fabs(v->f[i][7])<1.0e-10) | |
| 463 | − for(k=3; k<12; k++) v->f[i][k] = 0.0f; //catch reson & envelope denormals | |
| 464 | − | |
| 465 | − if(fabs(o)>10.0f) tVocoder_suspend(voc); //catch instability | |
| 466 | − | |
| 467 | − return o; | |
| 468 | − | |
| 469 | −} | |
| 470 | − | |
| 471 | −void tVocoder_suspend (tVocoder* const voc) | |
| 472 | −{ | |
| 473 | − _tVocoder* v = *voc; | |
| 474 | − | |
| 475 | − int32_t i, j; | |
| 476 | − | |
| 477 | − for(i=0; i<v->nbnd; i++) for(j=3; j<12; j++) v->f[i][j] = 0.0f; //zero band filters and envelopes | |
| 478 | − v->kout = 0.0f; | |
| 479 | − v->kval = 0; | |
| 480 | −} | |
| 481 | − | |
| 482 | −//============================================================================================================ | |
| 483 | −// SOLAD | |
| 484 | −//============================================================================================================ | |
| 485 | −/******************************************************************************/ | |
| 486 | −/***************** static function declarations *******************************/ | |
| 487 | −/******************************************************************************/ | |
| 488 | − | |
| 489 | −static void solad_init(_tSOLAD *w); | |
| 490 | −static inline float read_sample(_tSOLAD *w, float floatindex); | |
| 491 | −static void pitchdown(_tSOLAD *w, float *out); | |
| 492 | −static void pitchup(_tSOLAD *w, float *out); | |
| 493 | − | |
| 494 | −/******************************************************************************/ | |
| 495 | −/***************** public access functions ************************************/ | |
| 496 | −/******************************************************************************/ | |
| 497 | − | |
| 498 | −// init | |
| 499 | −void tSOLAD_init(tSOLAD* const wp) | |
| 500 | −{ | |
| 501 | − _tSOLAD* w = *wp = (_tSOLAD*) leaf_calloc(sizeof(_tSOLAD)); | |
| 502 | − | |
| 503 | − w->pitchfactor = 1.; | |
| 504 | − w->delaybuf = (float*) leaf_calloc(sizeof(float) * (LOOPSIZE+16)); | |
| 505 | − | |
| 506 | − solad_init(w); | |
| 507 | −} | |
| 508 | − | |
| 509 | −void tSOLAD_free(tSOLAD* const wp) | |
| 510 | −{ | |
| 511 | − _tSOLAD* w = *wp; | |
| 512 | − | |
| 513 | − leaf_free(w->delaybuf); | |
| 514 | − leaf_free(w); | |
| 515 | −} | |
| 516 | − | |
| 517 | −void tSOLAD_initToPool (tSOLAD* const wp, tMempool* const mp) | |
| 518 | −{ | |
| 519 | − _tMempool* m = *mp; | |
| 520 | − | |
| 521 | − _tSOLAD* w = *wp = (_tSOLAD*) mpool_calloc(sizeof(_tSOLAD), &m->pool); | |
| 522 | − | |
| 523 | − w->pitchfactor = 1.; | |
| 524 | − w->delaybuf = (float*) mpool_calloc(sizeof(float) * (LOOPSIZE+16), &m->pool); | |
| 525 | − | |
| 526 | − solad_init(w); | |
| 527 | −} | |
| 528 | − | |
| 529 | −void tSOLAD_freeFromPool (tSOLAD* const wp, tMempool* const mp) | |
| 530 | −{ | |
| 531 | − _tMempool* m = *mp; | |
| 532 | − _tSOLAD* w = *wp; | |
| 533 | − | |
| 534 | − mpool_free(w->delaybuf, &m->pool); | |
| 535 | − mpool_free(w, &m->pool); | |
| 536 | −} | |
| 537 | − | |
| 538 | −// send one block of input samples, receive one block of output samples | |
| 539 | −void tSOLAD_ioSamples(tSOLAD* const wp, float* in, float* out, int blocksize) | |
| 540 | −{ | |
| 541 | − _tSOLAD* w = *wp; | |
| 542 | − | |
| 543 | − int i = w->timeindex; | |
| 544 | − int n = w->blocksize = blocksize; | |
| 545 | − | |
| 546 | − if(!i) w->delaybuf[LOOPSIZE] = in[0]; // copy one sample for interpolation | |
| 547 | − while(n--) w->delaybuf[i++] = *in++; // copy one input block to delay buffer | |
| 548 | − | |
| 549 | − if(w->pitchfactor > 1) pitchup(w, out); | |
| 550 | − else pitchdown(w, out); | |
| 551 | − | |
| 552 | − w->timeindex += blocksize; | |
| 553 | − w->timeindex &= LOOPMASK; | |
| 554 | −} | |
| 555 | − | |
| 556 | −// set periodicity analysis data | |
| 557 | −void tSOLAD_setPeriod(tSOLAD* const wp, float period) | |
| 558 | −{ | |
| 559 | − _tSOLAD* w = *wp; | |
| 560 | − | |
| 561 | − if(period > MAXPERIOD) period = MAXPERIOD; | |
| 562 | − if(period > MINPERIOD) w->period = period; // ignore period when too small | |
| 563 | −} | |
| 564 | − | |
| 565 | −// set pitch factor between 0.25 and 4 | |
| 566 | −void tSOLAD_setPitchFactor(tSOLAD* const wp, float pitchfactor) | |
| 567 | −{ | |
| 568 | − _tSOLAD* w = *wp; | |
| 569 | − | |
| 570 | − if (pitchfactor <= 0.0f) return; | |
| 571 | − w->pitchfactor = pitchfactor; | |
| 572 | −} | |
| 573 | − | |
| 574 | −// force readpointer lag | |
| 575 | −void tSOLAD_setReadLag(tSOLAD* const wp, float readlag) | |
| 576 | −{ | |
| 577 | − _tSOLAD* w = *wp; | |
| 578 | − | |
| 579 | − if(readlag < 0) readlag = 0; | |
| 580 | − if(readlag < w->readlag) // do not jump backward, only forward | |
| 581 | − { | |
| 582 | − w->jump = w->readlag - readlag; | |
| 583 | − w->readlag = readlag; | |
| 584 | − w->xfadelength = readlag; | |
| 585 | − w->xfadevalue = 1; | |
| 586 | − } | |
| 587 | −} | |
| 588 | − | |
| 589 | −// reset state variables | |
| 590 | −void tSOLAD_resetState(tSOLAD* const wp) | |
| 591 | −{ | |
| 592 | − _tSOLAD* w = *wp; | |
| 593 | − | |
| 594 | − int n = LOOPSIZE + 1; | |
| 595 | − float *buf = w->delaybuf; | |
| 596 | − | |
| 597 | − while(n--) *buf++ = 0; | |
| 598 | − solad_init(w); | |
| 599 | −} | |
| 600 | − | |
| 601 | −/******************************************************************************/ | |
| 602 | −/******************** private procedures **************************************/ | |
| 603 | −/******************************************************************************/ | |
| 604 | − | |
| 605 | −/* | |
| 606 | − Function pitchdown() is called to read samples from the delay buffer when pitch | |
| 607 | − factor is between 0.25 and 1. The read pointer lags behind because of the slowed | |
| 608 | − down speed, and it must jump forward towards the write pointer soon as there is | |
| 609 | − sufficient space to jump. That is, if there is at least one period of the input | |
| 610 | − signal between read pointer and write pointer. When short periods follow up on | |
| 611 | − long periods, the read pointer may have space to jump over more than one period | |
| 612 | − lenghts. Jump length must be [periodlength ^ 2] in any case. | |
| 613 | − | |
| 614 | − A linear crossfade function joins the jump-from point with the jump-to point. | |
| 615 | − The crossfade must be completed before another read pointer jump is allowed. | |
| 616 | − Length of the crossfade function is stored as a number of samples in terms of | |
| 617 | − the input sample rate. This length is dynamically translated | |
| 618 | − to a crossfade length expressed in output reading rate, according to pitch | |
| 619 | − factor which can change before the crossfade is completed. Crossfade length does | |
| 620 | − not cover an invariable length in periods for all pitch transposition factors. | |
| 621 | − For pitch factors from 0.5 till 1, crossfade length is stretched in the | |
| 622 | − output just as much as the signal itself, as crossfade speed is set to equal | |
| 623 | − pitch factor. For pitch factors below 0.5, the read pointer wants to jump | |
| 624 | − forward before one period is read, therefore the crossfade length as expressed | |
| 625 | − in output periods must be shorter. Crossfade speed is set to [1 - pitchfactor] | |
| 626 | − for those cases. Pitch factor 0.5 is the natural switch point between crossfade | |
| 627 | − speeds [pitchfactor] and [1 - pitchfactor] because 0.5 == 1 - 0.5. The crossfade | |
| 628 | − speed modification for pitch factors below 0.5 also means that much of the | |
| 629 | − original signal content will be skipped. | |
| 630 | − */ | |
| 631 | − | |
| 632 | − | |
| 633 | −static void pitchdown(_tSOLAD* const w, float *out) | |
| 634 | −{ | |
| 635 | − int n = w->blocksize; | |
| 636 | − float refindex = (float)(w->timeindex + LOOPSIZE); // no negative values! | |
| 637 | − float pitchfactor = w->pitchfactor; | |
| 638 | − float period = w->period; | |
| 639 | − float readlag = w->readlag; | |
| 640 | − float readlagstep = 1 - pitchfactor; | |
| 641 | − float jump = w->jump; | |
| 642 | − float xfadevalue = w->xfadevalue; | |
| 643 | − float xfadelength = w->xfadelength; | |
| 644 | − float xfadespeed, xfadestep, readindex, outputsample; | |
| 645 | − | |
| 646 | − if(pitchfactor > 0.5) xfadespeed = pitchfactor; | |
| 647 | − else xfadespeed = 1 - pitchfactor; | |
| 648 | − xfadestep = xfadespeed / xfadelength; | |
| 649 | − | |
| 650 | − while(n--) | |
| 651 | − { | |
| 652 | − if(readlag > period) // check if read pointer may jump forward... | |
| 653 | − { | |
| 654 | − if(xfadevalue <= 0) // ...but do not interrupt crossfade | |
| 655 | − { | |
| 656 | − jump = period; // jump forward | |
| 657 | − while((jump * 2) < readlag) jump *= 2; // use available space | |
| 658 | − readlag -= jump; // reduce read pointer lag | |
| 659 | − xfadevalue = 1; // start crossfade | |
| 660 | − xfadelength = period - 1; | |
| 661 | − xfadestep = xfadespeed / xfadelength; | |
| 662 | − } | |
| 663 | − } | |
| 664 | − | |
| 665 | − readindex = refindex - readlag; | |
| 666 | − outputsample = read_sample(w, readindex); | |
| 667 | − | |
| 668 | − if(xfadevalue > 0) | |
| 669 | − { | |
| 670 | − outputsample *= (1 - xfadevalue); // fadein | |
| 671 | − outputsample += read_sample(w, readindex - jump) * xfadevalue; // fadeout | |
| 672 | − xfadevalue -= xfadestep; | |
| 673 | − } | |
| 674 | − | |
| 675 | − *out++ = outputsample; | |
| 676 | − refindex += 1; | |
| 677 | − readlag += readlagstep; | |
| 678 | − } | |
| 679 | − | |
| 680 | − w->jump = jump; // state variables | |
| 681 | − w->readlag = readlag; | |
| 682 | − w->xfadevalue = xfadevalue; | |
| 683 | − w->xfadelength = xfadelength; | |
| 684 | −} | |
| 685 | − | |
| 686 | − | |
| 687 | −/* | |
| 688 | − Function pitchup() for pitch factors above 1 is more complicated than | |
| 689 | − pitchdown(). The read pointer increments faster than the write pointer and a | |
| 690 | − backward jump must happen in time, reckoning with the crossfade region. The read | |
| 691 | − pointer backward jump length is always one period. In order to minimize the area | |
| 692 | − of signal duplicates, crossfade length is aimed at [period / pitchfactor]. | |
| 693 | − This leads to a crossfade speed of [pitchfactor * pitchfactor]. | |
| 694 | − | |
| 695 | − Some samples for the fade out (but not all of them) must already be in the | |
| 696 | − buffer, otherwise we will run out of input samples before the crossfade is | |
| 697 | − completed. The ratio of past samples and future samples for a crossfade of any | |
| 698 | − length is as follows: | |
| 699 | − | |
| 700 | − past samples: xfadelength * (1 - 1 / pitchfactor) | |
| 701 | − future samples: xfadelength * (1 / pitchfactor) | |
| 702 | − | |
| 703 | − For example in the case of pitch factor 1.5 this would be: | |
| 704 | − | |
| 705 | − past samples: xfadelength * (1 - 1 / 1.5) = xfadelength * 1 / 3 | |
| 706 | − future samples: xfadelength * (1 / 1.5) = xfadelength * 2 / 3 | |
| 707 | − | |
| 708 | − In the case of pitch factor 4 this would be: | |
| 709 | − | |
| 710 | − past samples: xfadelength * (1 - 1 / 4) = xfadelength * 3 / 4 | |
| 711 | − future samples: xfadelength * (1 / 4) = xfadelength * 1 / 4 | |
| 712 | − | |
| 713 | − The read pointer lag must therefore preserve a minimum dependent on pitch | |
| 714 | − factor. The minimum is called 'limit' here: | |
| 715 | − | |
| 716 | − limit = period * (pitchfactor - 1) / pitchfactor * pitchfactor | |
| 717 | − | |
| 718 | − Components of this expression are combined to reuse them in operations, while | |
| 719 | − (pitchfactor - 1) is changed to (pitchfactor - 0.99) to avoid numerical | |
| 720 | − resolution issues for pitch factors slightly above 1: | |
| 721 | − | |
| 722 | − xfadespeed = pitchfactor * pitchfactor | |
| 723 | − limitfactor = (pitchfactor - 0.99) / xfadespeed | |
| 724 | − limit = period * limitfactor | |
| 725 | − | |
| 726 | − When read lag is smaller than this limit, the read pointer must preferably | |
| 727 | − jump backward, unless a previous crossfade is not yet completed. Crossfades must | |
| 728 | − preferably be completed, unless the read pointer lag becomes smaller than zero. | |
| 729 | − With fluctuating period lengths and pitch factors, the readpointer lag limit may | |
| 730 | − change from one input block to the next in such a way that the actual lag is | |
| 731 | − suddenly much smaller than the limit, and the intended crossfade length can not | |
| 732 | − be applied. Therefore the crossfade length is simply calculated from the | |
| 733 | − available amount of samples for all cases, like so: | |
| 734 | − | |
| 735 | − xfadelength = readlag / limitfactor | |
| 736 | − | |
| 737 | − For most occurrences, this will amount to a crossfade length reduced to | |
| 738 | − [period / pitchfactor] in the output for pitch factors above 1, while in some | |
| 739 | − cases it will be considerably shorter. Fortunately, an incidental aberration of | |
| 740 | − the intended crossfade length hardly ever creates an audible artifact. The | |
| 741 | − reason to specify preferred crossfade length according to pitch factor is to | |
| 742 | − minimize the impression of echoes without sacrificing too much of the signal | |
| 743 | − content. The readpointer jump length remains one period in any case. | |
| 744 | − | |
| 745 | − Sometimes, the input signal periodicity may decrease substantially between one | |
| 746 | − signal block and the next. In such cases it may be possible for the read pointer | |
| 747 | − to jump forward and reduce latency. For every signal block, a check on this | |
| 748 | − possibility is done. A previous crossfade must be completed before a forward | |
| 749 | − jump is allowed. | |
| 750 | − */ | |
| 751 | −static void pitchup(_tSOLAD* const w, float *out) | |
| 752 | −{ | |
| 753 | − int n = w->blocksize; | |
| 754 | − float refindex = (float)(w->timeindex + LOOPSIZE); // no negative values | |
| 755 | − float pitchfactor = w->pitchfactor; | |
| 756 | − float period = w->period; | |
| 757 | − float readlag = w->readlag; | |
| 758 | − float jump = w->jump; | |
| 759 | − float xfadevalue = w->xfadevalue; | |
| 760 | − float xfadelength = w->xfadelength; | |
| 761 | − | |
| 762 | − float readlagstep = pitchfactor - 1; | |
| 763 | − float xfadespeed = pitchfactor * pitchfactor; | |
| 764 | − float xfadestep = xfadespeed / xfadelength; | |
| 765 | − float limitfactor = (pitchfactor - (float)0.99) / xfadespeed; | |
| 766 | − float limit = period * limitfactor; | |
| 767 | − float readindex, outputsample; | |
| 768 | − | |
| 769 | − if((readlag > (period + 2 * limit)) & (xfadevalue < 0)) | |
| 770 | − { | |
| 771 | − jump = period; // jump forward | |
| 772 | − while((jump * 2) < (readlag - 2 * limit)) jump *= 2; // use available space | |
| 773 | − readlag -= jump; // reduce read pointer lag | |
| 774 | − xfadevalue = 1; // start crossfade | |
| 775 | − xfadelength = period - 1; | |
| 776 | − xfadestep = xfadespeed / xfadelength; | |
| 777 | − } | |
| 778 | − | |
| 779 | − while(n--) | |
| 780 | − { | |
| 781 | − if(readlag < limit) // check if read pointer should jump backward... | |
| 782 | − { | |
| 783 | − if((xfadevalue < 0) | (readlag < 0)) // ...but try not to interrupt crossfade | |
| 784 | − { | |
| 785 | − xfadelength = readlag / limitfactor; | |
| 786 | − if(xfadelength < 1) xfadelength = 1; | |
| 787 | − xfadestep = xfadespeed / xfadelength; | |
| 788 | − | |
| 789 | − jump = -period; // jump backward | |
| 790 | − readlag += period; // increase read pointer lag | |
| 791 | − xfadevalue = 1; // start crossfade | |
| 792 | − } | |
| 793 | − } | |
| 794 | − | |
| 795 | − readindex = refindex - readlag; | |
| 796 | − outputsample = read_sample(w, readindex); | |
| 797 | − | |
| 798 | − if(xfadevalue > 0) | |
| 799 | − { | |
| 800 | − outputsample *= (1 - xfadevalue); | |
| 801 | − outputsample += read_sample(w, readindex - jump) * xfadevalue; | |
| 802 | − xfadevalue -= xfadestep; | |
| 803 | − } | |
| 804 | − | |
| 805 | − *out++ = outputsample; | |
| 806 | − refindex += 1; | |
| 807 | − readlag -= readlagstep; | |
| 808 | − } | |
| 809 | − | |
| 810 | − w->readlag = readlag; // state variables | |
| 811 | − w->jump = jump; | |
| 812 | − w->xfadelength = xfadelength; | |
| 813 | − w->xfadevalue = xfadevalue; | |
| 814 | −} | |
| 815 | − | |
| 816 | −// read one sample from delay buffer, with linear interpolation | |
| 817 | −static inline float read_sample(_tSOLAD* const w, float floatindex) | |
| 818 | −{ | |
| 819 | − int index = (int)floatindex; | |
| 820 | − float fraction = floatindex - (float)index; | |
| 821 | − float *buf = w->delaybuf; | |
| 822 | − index &= LOOPMASK; | |
| 823 | − | |
| 824 | − return (buf[index] + (fraction * (buf[index+1] - buf[index]))); | |
| 825 | −} | |
| 826 | − | |
| 827 | −static void solad_init(_tSOLAD* const w) | |
| 828 | −{ | |
| 829 | − w->timeindex = 0; | |
| 830 | − w->xfadevalue = -1; | |
| 831 | − w->period = INITPERIOD; | |
| 832 | − w->readlag = INITPERIOD; | |
| 833 | − w->blocksize = INITPERIOD; | |
| 834 | −} | |
| 835 | − | |
| 836 | −//============================================================================================================ | |
| 837 | −// PITCHSHIFT | |
| 838 | −//============================================================================================================ | |
| 839 | − | |
| 840 | −static int pitchshift_attackdetect(_tPitchShift* ps) | |
| 841 | −{ | |
| 842 | − float envout; | |
| 843 | − | |
| 844 | − _tPeriodDetection* p = *ps->p; | |
| 845 | − | |
| 846 | − envout = tEnvPD_tick(&p->env); | |
| 847 | − | |
| 848 | − if (envout >= 1.0f) | |
| 849 | − { | |
| 850 | − p->lastmax = p->max; | |
| 851 | − if (envout > p->max) | |
| 852 | − { | |
| 853 | − p->max = envout; | |
| 854 | − } | |
| 855 | − else | |
| 856 | − { | |
| 857 | − p->deltamax = envout - p->max; | |
| 858 | − p->max = p->max * ps->radius; | |
| 859 | − } | |
| 860 | − p->deltamax = p->max - p->lastmax; | |
| 861 | − } | |
| 862 | − | |
| 863 | − p->fba = p->fba ? (p->fba - 1) : 0; | |
| 864 | − | |
| 865 | − return (p->fba == 0 && (p->max > 60 && p->deltamax > 6)) ? 1 : 0; | |
| 866 | −} | |
| 867 | − | |
| 868 | −void tPitchShift_init (tPitchShift* const psr, tPeriodDetection* pd, float* out, int bufSize) | |
| 869 | −{ | |
| 870 | − _tPitchShift* ps = *psr = (_tPitchShift*) leaf_calloc(sizeof(_tPitchShift)); | |
| 871 | − _tPeriodDetection* p = *pd; | |
| 872 | − | |
| 873 | − ps->p = pd; | |
| 874 | − | |
| 875 | − ps->outBuffer = out; | |
| 876 | − ps->bufSize = bufSize; | |
| 877 | − ps->frameSize = p->frameSize; | |
| 878 | − ps->framesPerBuffer = ps->bufSize / ps->frameSize; | |
| 879 | − ps->curBlock = 1; | |
| 880 | − ps->lastBlock = 0; | |
| 881 | − ps->index = 0; | |
| 882 | − ps->pitchFactor = 1.0f; | |
| 883 | − | |
| 884 | − tSOLAD_init(&ps->sola); | |
| 885 | − | |
| 886 | − tHighpass_init(&ps->hp, HPFREQ); | |
| 887 | − | |
| 888 | − tSOLAD_setPitchFactor(&ps->sola, DEFPITCHRATIO); | |
| 889 | −} | |
| 890 | − | |
| 891 | −void tPitchShift_free(tPitchShift* const psr) | |
| 892 | −{ | |
| 893 | − _tPitchShift* ps = *psr; | |
| 894 | − | |
| 895 | − tSOLAD_free(&ps->sola); | |
| 896 | − tHighpass_free(&ps->hp); | |
| 897 | − leaf_free(ps); | |
| 898 | −} | |
| 899 | − | |
| 900 | −void tPitchShift_initToPool (tPitchShift* const psr, tPeriodDetection* const pd, float* out, int bufSize, tMempool* const mp) | |
| 901 | −{ | |
| 902 | − _tMempool* m = *mp; | |
| 903 | − | |
| 904 | − _tPitchShift* ps = *psr = (_tPitchShift*) mpool_calloc(sizeof(_tPitchShift), &m->pool); | |
| 905 | − | |
| 906 | − _tPeriodDetection* p = *pd; | |
| 907 | − | |
| 908 | − ps->p = pd; | |
| 909 | − | |
| 910 | − ps->outBuffer = out; | |
| 911 | − ps->bufSize = bufSize; | |
| 912 | − ps->frameSize = p->frameSize; | |
| 913 | − ps->framesPerBuffer = ps->bufSize / ps->frameSize; | |
| 914 | − ps->curBlock = 1; | |
| 915 | − ps->lastBlock = 0; | |
| 916 | − ps->index = 0; | |
| 917 | − ps->pitchFactor = 1.0f; | |
| 918 | − | |
| 919 | − tSOLAD_initToPool(&ps->sola, mp); | |
| 920 | − | |
| 921 | − tHighpass_initToPool(&ps->hp, HPFREQ, mp); | |
| 922 | − | |
| 923 | − tSOLAD_setPitchFactor(&ps->sola, DEFPITCHRATIO); | |
| 924 | −} | |
| 925 | − | |
| 926 | −void tPitchShift_freeFromPool (tPitchShift* const psr, tMempool* const mp) | |
| 927 | −{ | |
| 928 | − _tMempool* m = *mp; | |
| 929 | − _tPitchShift* ps = *psr; | |
| 930 | − | |
| 931 | − tSOLAD_freeFromPool(&ps->sola, mp); | |
| 932 | − tHighpass_freeFromPool(&ps->hp, mp); | |
| 933 | − mpool_free(ps, &m->pool); | |
| 934 | −} | |
| 935 | − | |
| 936 | −void tPitchShift_setPitchFactor(tPitchShift* psr, float pf) | |
| 937 | −{ | |
| 938 | − _tPitchShift* ps = *psr; | |
| 939 | − | |
| 940 | − ps->pitchFactor = pf; | |
| 941 | −} | |
| 942 | − | |
| 943 | −float tPitchShift_shift (tPitchShift* psr) | |
| 944 | −{ | |
| 945 | − _tPitchShift* ps = *psr; | |
| 946 | − _tPeriodDetection* p = *ps->p; | |
| 947 | − | |
| 948 | − float period, out; | |
| 949 | − int i, iLast; | |
| 950 | − | |
| 951 | − i = p->i; | |
| 952 | − iLast = p->iLast; | |
| 953 | − | |
| 954 | − out = tHighpass_tick(&ps->hp, ps->outBuffer[iLast]); | |
| 955 | − | |
| 956 | − if (p->indexstore >= ps->frameSize) | |
| 957 | − { | |
| 958 | − period = tPeriodDetection_getPeriod(&p); | |
| 959 | − | |
| 960 | − if(pitchshift_attackdetect(ps) == 1) | |
| 961 | − { | |
| 962 | − p->fba = 5; | |
| 963 | − tSOLAD_setReadLag(&ps->sola, p->windowSize); | |
| 964 | − } | |
| 965 | − | |
| 966 | − tSOLAD_setPeriod(&ps->sola, period); | |
| 967 | − tSOLAD_setPitchFactor(&ps->sola, ps->pitchFactor); | |
| 968 | − | |
| 969 | − tSOLAD_ioSamples(&ps->sola, &(p->inBuffer[i]), &(ps->outBuffer[i]), ps->frameSize); | |
| 970 | − } | |
| 971 | − | |
| 972 | − return out; | |
| 973 | −} | |
| 974 | − | |
| 975 | −float tPitchShift_shiftToFreq (tPitchShift* psr, float freq) | |
| 976 | −{ | |
| 977 | − _tPitchShift* ps = *psr; | |
| 978 | − _tPeriodDetection* p = *ps->p; | |
| 979 | − | |
| 980 | − float period, out; | |
| 981 | − int i, iLast; | |
| 982 | − | |
| 983 | − i = p->i; | |
| 984 | − iLast = p->iLast; | |
| 985 | − | |
| 986 | − out = tHighpass_tick(&ps->hp, ps->outBuffer[iLast]); | |
| 987 | − | |
| 988 | − if (p->indexstore >= ps->frameSize) | |
| 989 | − { | |
| 990 | − period = tPeriodDetection_getPeriod(&p); | |
| 991 | − | |
| 992 | − if(pitchshift_attackdetect(ps) == 1) | |
| 993 | − { | |
| 994 | − p->fba = 5; | |
| 995 | − tSOLAD_setReadLag(&ps->sola, p->windowSize); | |
| 996 | − } | |
| 997 | − | |
| 998 | − tSOLAD_setPeriod(&ps->sola, period); | |
| 999 | − | |
| 1000 | − if (period != 0) ps->pitchFactor = period*freq*leaf.invSampleRate; | |
| 1001 | − else ps->pitchFactor = 1.0f; | |
| 1002 | − | |
| 1003 | − tSOLAD_setPitchFactor(&ps->sola, ps->pitchFactor); | |
| 1004 | − | |
| 1005 | − tSOLAD_ioSamples(&ps->sola, &(p->inBuffer[i]), &(ps->outBuffer[i]), ps->frameSize); | |
| 1006 | − } | |
| 1007 | − return out; | |
| 1008 | −} | |
| 1009 | − | |
| 1010 | −float tPitchShift_shiftToFunc (tPitchShift* psr, float (*fun)(float)) | |
| 1011 | −{ | |
| 1012 | − _tPitchShift* ps = *psr; | |
| 1013 | − _tPeriodDetection* p = *ps->p; | |
| 1014 | − | |
| 1015 | − float period, out; | |
| 1016 | − int i, iLast; | |
| 1017 | − | |
| 1018 | − i = p->i; | |
| 1019 | − iLast = p->iLast; | |
| 1020 | − | |
| 1021 | − out = tHighpass_tick(&ps->hp, ps->outBuffer[iLast]); | |
| 1022 | − | |
| 1023 | − if (p->indexstore >= ps->frameSize) | |
| 1024 | − { | |
| 1025 | − period = tPeriodDetection_getPeriod(&p); | |
| 1026 | − | |
| 1027 | − if(pitchshift_attackdetect(ps) == 1) | |
| 1028 | − { | |
| 1029 | − p->fba = 5; | |
| 1030 | − tSOLAD_setReadLag(&ps->sola, p->windowSize); | |
| 1031 | − } | |
| 1032 | − | |
| 1033 | − tSOLAD_setPeriod(&ps->sola, period); | |
| 1034 | − | |
| 1035 | − ps->pitchFactor = period/fun(period); | |
| 1036 | − tSOLAD_setPitchFactor(&ps->sola, ps->pitchFactor); | |
| 1037 | − | |
| 1038 | − tSOLAD_ioSamples(&ps->sola, &(p->inBuffer[i]), &(ps->outBuffer[i]), ps->frameSize); | |
| 1039 | − | |
| 1040 | − ps->curBlock++; | |
| 1041 | − if (ps->curBlock >= p->framesPerBuffer) ps->curBlock = 0; | |
| 1042 | − ps->lastBlock++; | |
| 1043 | − if (ps->lastBlock >= ps->framesPerBuffer) ps->lastBlock = 0; | |
| 1044 | − } | |
| 1045 | − | |
| 1046 | − return out; | |
| 1047 | −} | |
| 1048 | − | |
| 1049 | −//============================================================================================================ | |
| 1050 | −// RETUNE | |
| 1051 | −//============================================================================================================ | |
| 1052 | − | |
| 1053 | −void tRetune_init(tRetune* const rt, int numVoices, int bufSize, int frameSize) | |
| 1054 | −{ | |
| 1055 | − tRetune_initToPool(rt, numVoices, bufSize, frameSize, &leaf_mempool); | |
| 1056 | −} | |
| 1057 | − | |
| 1058 | −void tRetune_free(tRetune* const rt) | |
| 1059 | −{ | |
| 1060 | − tRetune_freeFromPool(rt, &leaf_mempool); | |
| 1061 | −} | |
| 1062 | − | |
| 1063 | −void tRetune_initToPool (tRetune* const rt, int numVoices, int bufSize, int frameSize, tMempool* const mp) | |
| 1064 | −{ | |
| 1065 | − _tMempool* m = *mp; | |
| 1066 | − _tRetune* r = *rt = (_tRetune*) mpool_alloc(sizeof(_tRetune), &m->pool); | |
| 1067 | − | |
| 1068 | − r->bufSize = bufSize; | |
| 1069 | − r->frameSize = frameSize; | |
| 1070 | − r->numVoices = numVoices; | |
| 1071 | − | |
| 1072 | − r->inBuffer = (float*) mpool_calloc(sizeof(float) * r->bufSize, &m->pool); | |
| 1073 | − r->outBuffers = (float**) mpool_calloc(sizeof(float*) * r->numVoices, &m->pool); | |
| 1074 | − | |
| 1075 | − r->hopSize = DEFHOPSIZE; | |
| 1076 | − r->windowSize = DEFWINDOWSIZE; | |
| 1077 | − r->fba = FBA; | |
| 1078 | − tRetune_setTimeConstant(rt, DEFTIMECONSTANT); | |
| 1079 | − | |
| 1080 | − r->inputPeriod = 0.0f; | |
| 1081 | − | |
| 1082 | − r->ps = (tPitchShift*) mpool_calloc(sizeof(tPitchShift) * r->numVoices, &m->pool); | |
| 1083 | − r->pitchFactor = (float*) mpool_calloc(sizeof(float) * r->numVoices, &m->pool); | |
| 1084 | − r->tickOutput = (float*) mpool_calloc(sizeof(float) * r->numVoices, &m->pool); | |
| 1085 | − for (int i = 0; i < r->numVoices; ++i) | |
| 1086 | − { | |
| 1087 | − r->outBuffers[i] = (float*) mpool_calloc(sizeof(float) * r->bufSize, &m->pool); | |
| 1088 | − } | |
| 1089 | − | |
| 1090 | − tPeriodDetection_initToPool(&r->pd, r->inBuffer, r->outBuffers[0], r->bufSize, r->frameSize, mp); | |
| 1091 | − | |
| 1092 | − for (int i = 0; i < r->numVoices; ++i) | |
| 1093 | − { | |
| 1094 | − tPitchShift_initToPool(&r->ps[i], &r->pd, r->outBuffers[i], r->bufSize, mp); | |
| 1095 | − } | |
| 1096 | −} | |
| 1097 | − | |
| 1098 | −void tRetune_freeFromPool (tRetune* const rt, tMempool* const mp) | |
| 1099 | −{ | |
| 1100 | − _tMempool* m = *mp; | |
| 1101 | − _tRetune* r = *rt; | |
| 1102 | − | |
| 1103 | − tPeriodDetection_freeFromPool(&r->pd, mp); | |
| 1104 | − for (int i = 0; i < r->numVoices; ++i) | |
| 1105 | − { | |
| 1106 | − tPitchShift_freeFromPool(&r->ps[i], mp); | |
| 1107 | − mpool_free(r->outBuffers[i], &m->pool); | |
| 1108 | − } | |
| 1109 | − mpool_free(r->tickOutput, &m->pool); | |
| 1110 | − mpool_free(r->pitchFactor, &m->pool); | |
| 1111 | − mpool_free(r->ps, &m->pool); | |
| 1112 | − mpool_free(r->inBuffer, &m->pool); | |
| 1113 | − mpool_free(r->outBuffers, &m->pool); | |
| 1114 | − mpool_free(r, &m->pool); | |
| 1115 | −} | |
| 1116 | − | |
| 1117 | −float* tRetune_tick(tRetune* const rt, float sample) | |
| 1118 | −{ | |
| 1119 | − _tRetune* r = *rt; | |
| 1120 | − | |
| 1121 | − r->inputPeriod = tPeriodDetection_tick(&r->pd, sample); | |
| 1122 | − | |
| 1123 | − for (int v = 0; v < r->numVoices; ++v) | |
| 1124 | − { | |
| 1125 | − r->tickOutput[v] = tPitchShift_shift(&r->ps[v]); | |
| 1126 | − } | |
| 1127 | − | |
| 1128 | − return r->tickOutput; | |
| 1129 | −} | |
| 1130 | − | |
| 1131 | −void tRetune_setNumVoices(tRetune* const rt, int numVoices) | |
| 1132 | −{ | |
| 1133 | − _tRetune* r = *rt; | |
| 1134 | − | |
| 1135 | − for (int i = 0; i < r->numVoices; ++i) | |
| 1136 | − { | |
| 1137 | − tPitchShift_free(&r->ps[i]); | |
| 1138 | − leaf_free(r->outBuffers[i]); | |
| 1139 | − } | |
| 1140 | − leaf_free(r->tickOutput); | |
| 1141 | − leaf_free(r->pitchFactor); | |
| 1142 | − leaf_free(r->ps); | |
| 1143 | − leaf_free(r->outBuffers); | |
| 1144 | − | |
| 1145 | − r->numVoices = numVoices; | |
| 1146 | − | |
| 1147 | − r->outBuffers = (float**) leaf_alloc(sizeof(float*) * r->numVoices); | |
| 1148 | − r->ps = (tPitchShift*) leaf_alloc(sizeof(tPitchShift) * r->numVoices); | |
| 1149 | − r->pitchFactor = (float*) leaf_alloc(sizeof(float) * r->numVoices); | |
| 1150 | − r->tickOutput = (float*) leaf_alloc(sizeof(float) * r->numVoices); | |
| 1151 | − for (int i = 0; i < r->numVoices; ++i) | |
| 1152 | − { | |
| 1153 | − r->outBuffers[i] = (float*) leaf_alloc(sizeof(float) * r->bufSize); | |
| 1154 | − tPitchShift_init(&r->ps[i], &r->pd, r->outBuffers[i], r->bufSize); | |
| 1155 | − } | |
| 1156 | −} | |
| 1157 | − | |
| 1158 | −void tRetune_setPitchFactors(tRetune* const rt, float pf) | |
| 1159 | −{ | |
| 1160 | − _tRetune* r = *rt; | |
| 1161 | − | |
| 1162 | − for (int i = 0; i < r->numVoices; ++i) | |
| 1163 | − { | |
| 1164 | − r->pitchFactor[i] = pf; | |
| 1165 | − tPitchShift_setPitchFactor(&r->ps[i], r->pitchFactor[i]); | |
| 1166 | − } | |
| 1167 | −} | |
| 1168 | − | |
| 1169 | −void tRetune_setPitchFactor(tRetune* const rt, float pf, int voice) | |
| 1170 | −{ | |
| 1171 | − _tRetune* r = *rt; | |
| 1172 | − | |
| 1173 | − r->pitchFactor[voice] = pf; | |
| 1174 | − tPitchShift_setPitchFactor(&r->ps[voice], r->pitchFactor[voice]); | |
| 1175 | −} | |
| 1176 | − | |
| 1177 | −void tRetune_setTimeConstant(tRetune* const rt, float tc) | |
| 1178 | −{ | |
| 1179 | − _tRetune* r = *rt; | |
| 1180 | − | |
| 1181 | − r->timeConstant = tc; | |
| 1182 | − r->radius = expf(-1000.0f * r->hopSize * leaf.invSampleRate / r->timeConstant); | |
| 1183 | −} | |
| 1184 | − | |
| 1185 | −void tRetune_setHopSize(tRetune* const rt, int hs) | |
| 1186 | −{ | |
| 1187 | − _tRetune* r = *rt; | |
| 1188 | − | |
| 1189 | − r->hopSize = hs; | |
| 1190 | − tPeriodDetection_setHopSize(&r->pd, r->hopSize); | |
| 1191 | −} | |
| 1192 | − | |
| 1193 | −void tRetune_setWindowSize(tRetune* const rt, int ws) | |
| 1194 | −{ | |
| 1195 | − _tRetune* r = *rt; | |
| 1196 | − | |
| 1197 | − r->windowSize = ws; | |
| 1198 | − tPeriodDetection_setWindowSize(&r->pd, r->windowSize); | |
| 1199 | −} | |
| 1200 | − | |
| 1201 | −void tRetune_setFidelityThreshold(tRetune* const rt, float threshold) | |
| 1202 | −{ | |
| 1203 | − _tRetune* r = *rt; | |
| 1204 | − | |
| 1205 | − tPeriodDetection_setFidelityThreshold(&r->pd, threshold); | |
| 1206 | −} | |
| 1207 | − | |
| 1208 | −float tRetune_getInputPeriod(tRetune* const rt) | |
| 1209 | −{ | |
| 1210 | − _tRetune* r = *rt; | |
| 1211 | − | |
| 1212 | − return r->inputPeriod; | |
| 1213 | −} | |
| 1214 | − | |
| 1215 | −float tRetune_getInputFreq(tRetune* const rt) | |
| 1216 | −{ | |
| 1217 | − _tRetune* r = *rt; | |
| 1218 | − | |
| 1219 | − return 1.0f/r->inputPeriod; | |
| 1220 | −} | |
| 1221 | − | |
| 1222 | −//============================================================================================================ | |
| 1223 | −// AUTOTUNE | |
453 more lines aren’t shown here.
This diff is large: its 552 lines aren’t shown here.
This diff is large: its 761 lines aren’t shown here.
This diff is large: its 1244 lines aren’t shown here.
This diff is large: its 707 lines aren’t shown here.
This diff is large: its 486 lines aren’t shown here.
This diff is large: its 398 lines aren’t shown here.
This diff is large: its 682 lines aren’t shown here.
This diff is large: its 864 lines aren’t shown here.
This diff is large: its 748 lines aren’t shown here.
This diff is large: its 926 lines aren’t shown here.
This diff is large: its 835 lines aren’t shown here.
This diff is large: its 14043 lines aren’t shown here.
This diff is large: its 55 lines aren’t shown here.
This diff is large: its 604 lines aren’t shown here.
This diff is large: its 506 lines aren’t shown here.
This diff is large: its 79 lines aren’t shown here.
This diff is large: its 228 lines aren’t shown here.
This diff is large: its 262 lines aren’t shown here.
This diff is large: its 128 lines aren’t shown here.
This diff is large: its 1630 lines aren’t shown here.
This diff is large: its 300 lines aren’t shown here.
This diff is large: its 84 lines aren’t shown here.
This diff is large: its 379 lines aren’t shown here.
This diff is large: its 38 lines aren’t shown here.
This diff is large: its 205 lines aren’t shown here.
This diff is large: its 366 lines aren’t shown here.
This diff is large: its 233 lines aren’t shown here.
This diff is large: its 230 lines aren’t shown here.
This diff is large: its 680 lines aren’t shown here.
This diff is large: its 179 lines aren’t shown here.
This diff is large: its 543 lines aren’t shown here.
This diff is large: its 549 lines aren’t shown here.
This diff is large: its 55 lines aren’t shown here.