add Relazione falsa e inizio file

This commit is contained in:
PanSi21 2026-01-08 14:52:33 +01:00
parent 2775cc2108
commit 3de21f2577
Signed by untrusted user who does not match committer: PanSi21
GPG key ID: 198E46F625BADD13
33 changed files with 5944 additions and 2868 deletions

View file

@ -0,0 +1,67 @@
#include "myADC.h"
#include "pansi.h"
#include <stdint.h>
// #include "stm32h743xx.h"
// #include <stdint.h>
/**
* Temperature Sensor Characteristics
* uint16_t perché la grandezza è di 2 byte da datasheet
| Table 93. Temperature sensor calibration values |
| Symbol | Parameter | Memory address
=====================================================================
|TS_CAL1 | Temperature sensor raw data | 0x1FF1E820 - 0x1FF1E821
acquired value at 30 °C,
VDDA =3.3 V
---------------------------------------------------------------------
/TS_CAL2 / Temperature sensor raw data | 0x1FF1E840 - 0x1FF1E841
acquired value at 110 °C,
VDDA = 3.3 V
=====================================================================
*/
#define TS_CAL1 *(uint16_t *)0x1FF1E820
#define TS_CAL2 *(uint16_t *)0x1FF1E840
#define TCAL_30C *(uint16_t *)0x1FF1E820
#define TCAL_110C *(uint16_t *)0x1FF1E840
static volatile uint16_t *tsc_cal1 = (uint16_t *)0x1FF1E820;
static volatile uint16_t *tsc_cal2 = (uint16_t *)0x1FF1E840;
#define VREFINT_C *(uint16_t *)(0x1FF1E860)
// Internal Referance Voltage 30
static volatile uint16_t *VRefInCal = (uint16_t *)0x1FF1E860;
/**
* @brief Funzione per la calibrazione dell'ADC
* 3 step. (1). controllo se ad è spenta e in caso spengo io
* (2). Avvio la calibrazione degli offset e quela lineare
* (3). Aspetto la fine della calibrazione
*/
void myADC3_calibration(void) {
// (1) check if the ADC is disable after start calibration
if (ADC3->CR & ADC_CR_ADEN) {
ADC3->CR |= ADC_CR_ADDIS; // disable
while (ADC3->CR & ADC_CR_ADEN) {
// aspettando che si spenga la periferica
// blink RED led TODO
}
}
// (2)
// configure for a linear calibration.
ADC3->CR |= ADC_CR_ADCALLIN;
// start calibration. reset by hardware when the calibration complete
ADC3->CR |= ADC_CR_ADCAL;
// (3)
while (ADC3->CR & ADC_CR_ADCAL) {
// blink GREEN led
}
}

View file

@ -0,0 +1,15 @@
#include "myTIM.h"
#include "stm32h743xx.h"
void myTIM6_configure(void){
// update interrupt ivent
TIM7->DIER |= TIM_DIER_UIE;
}
void myTIM6_start();

View file

@ -0,0 +1,10 @@
#include "myUSART.h"
void myUSART3_init() {
// abilita rx/tx su USART3
USART3->CR1 |= USART_CR1_RE; // enable RX flag
USART3->CR1 |= USART_CR1_TE; // enable TX flag
// abilita rx/tx interrupts su USART3
USART3->CR1 |= USART_CR1_RXNEIE;
}