mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
* MHP30 move to I2C Bit Banging * Fixup Accelerometer drivers so all can use I2CBB * No STM32 I2C driver anymore * TS100 on I2CBB * Miniware on BB * Fixup S60 build * format format
23 lines
867 B
C++
23 lines
867 B
C++
#include "configuration.h"
|
|
#ifdef POW_PD
|
|
#include "BSP.h"
|
|
#include "I2CBB1.hpp"
|
|
#include "Pins.h"
|
|
#include "Setup.h"
|
|
#include "USBPD.h"
|
|
bool fusb_read_buf(const uint8_t deviceAddr, const uint8_t registerAdd, const uint8_t size, uint8_t *buf) { return I2CBB1::Mem_Read(deviceAddr, registerAdd, buf, size); }
|
|
|
|
bool fusb_write_buf(const uint8_t deviceAddr, const uint8_t registerAdd, const uint8_t size, uint8_t *buf) { return I2CBB1::Mem_Write(deviceAddr, registerAdd, (uint8_t *)buf, size); }
|
|
|
|
void setupFUSBIRQ() {
|
|
GPIO_InitTypeDef GPIO_InitStruct;
|
|
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
|
|
GPIO_InitStruct.Pin = INT_PD_Pin;
|
|
GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING;
|
|
GPIO_InitStruct.Pull = GPIO_PULLUP;
|
|
HAL_GPIO_Init(INT_PD_GPIO_Port, &GPIO_InitStruct);
|
|
HAL_NVIC_SetPriority(EXTI9_5_IRQn, 10, 0);
|
|
HAL_NVIC_EnableIRQ(EXTI9_5_IRQn);
|
|
}
|
|
#endif
|