How to read conversion result from external ADC to stm32f777 microcontroller?
I want to use ADS112U04 to read temperature (by enabling temperature sensor mode) and send this result to STM32F777VI via UART interface. How can I achieve this? I'm new to STM32. I have seen an example which does same with MSP430 microcontrollers, but I don't see such example with STM32f7 which reads external ADC. I have generated code from STM32CubeMX . How to initialize this adc, how to put or get any data to/from UART? Is it good to use HAL_UART_Trasnmit/HAL_UART_Receive for communication.?
I have started writing program to read ADC and it looks like:
static void ads112_write_reg(char reg, char data){
uart5_putc(SYNC); // send sync via uart
uart5_putc(CMD_WREG|(reg<<1));
uart5_putc(data);
}
static char ads112_read_reg(char reg){
uart5_putc(SYNC);
uart5_putc(CMD_RREG|(reg<<1));
while(!uart5_data_available());
return uart5_getc();
}
Now, I'm not sure what to write inside APIs name starting with uart5_ . Any suggestion would be great.
Regards,
Heli
