MLX90640: got registers, start to write image reading process

This commit is contained in:
Edward Emelianov
2022-05-19 01:38:06 +03:00
parent 247d1b2ed5
commit bc11cee187
13 changed files with 819 additions and 43 deletions

View File

@@ -20,14 +20,16 @@
static inline void gpio_setup(){
// Enable clocks to the GPIO subsystems (PB for ADC), turn on AFIO clocking to disable SWD/JTAG
RCC->APB2ENR |= RCC_APB2ENR_IOPAEN | RCC_APB2ENR_IOPCEN | RCC_APB2ENR_AFIOEN;
RCC->APB2ENR |= RCC_APB2ENR_IOPAEN | RCC_APB2ENR_IOPBEN | RCC_APB2ENR_IOPCEN | RCC_APB2ENR_AFIOEN;
// turn off SWJ/JTAG
// AFIO->MAPR = AFIO_MAPR_SWJ_CFG_DISABLE;
AFIO->MAPR = AFIO_MAPR_SWJ_CFG_JTAGDISABLE; // for PA15
// Set led as opendrain output
GPIOC->CRH |= CRH(13, CNF_ODOUTPUT|MODE_SLOW);
GPIOC->CRH |= CRH(13, CNF_ODOUTPUT | MODE_SLOW);
// USB pullup (PA15) - pushpull output
GPIOA->CRH = CRH(15, CNF_PPOUTPUT|MODE_SLOW);
GPIOA->CRH = CRH(15, CNF_PPOUTPUT | MODE_SLOW);
// PB5 is powered MLX sensor (less than 23mA) - pushpull output
GPIOB->CRL = CRL(5, CNF_PPOUTPUT | MODE_SLOW);
}
void hw_setup(){