Program Listing for File si8900.h

Return to documentation for file (mainboard/Inc/peripherals/si8900.h)

#ifndef SI8902_H
#define SI8902_H

#include "main.h"

#include <inttypes.h>
#include <stdbool.h>

static const uint8_t si8900_cnfg_0 = 0b11001011;

typedef enum { SI8900_AIN0 = 0, SI8900_AIN1 = 1, SI8900_AIN2 = 2 } SI8900_CHANNEL;

bool si8900_init(UART_HandleTypeDef *huart, GPIO_TypeDef *reset_gpio, uint16_t reset_pin);

bool si8900_read_channel(UART_HandleTypeDef *huart, SI8900_CHANNEL ch, uint16_t *voltage);

uint16_t si8900_convert_voltage(uint8_t adc_hl[2]);

#endif