1
0
forked from me/IronOS

Poking I2C

This commit is contained in:
Ben V. Brown
2022-04-02 21:36:34 +11:00
parent 4cacc063d3
commit bf4e57f7a3
240 changed files with 91264 additions and 45415 deletions

View File

@@ -9,7 +9,10 @@
#include "Debug.h"
#include "FreeRTOSConfig.h"
#include "Pins.h"
extern "C" {
#include "bflb_platform.h"
#include "bl702_i2c.h"
}
#include "history.hpp"
#include <string.h>
#define ADC_NORM_SAMPLES 16
@@ -20,6 +23,10 @@ uint16_t ADCReadings[ADC_NORM_SAMPLES]; // room for 32 lots of the pair of readi
void hardware_init() {
// #TODO
gpio_set_mode(OLED_RESET_Pin, GPIO_OUTPUT_MODE);
gpio_set_mode(KEY_A_Pin, GPIO_INPUT_PD_MODE);
gpio_set_mode(KEY_B_Pin, GPIO_INPUT_PD_MODE);
I2C_SetPrd(I2C0_ID, 15);
}
uint16_t getADCHandleTemp(uint8_t sample) {