mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-17 05:38:33 +03:00
WIP: bit-banging I2C support for EEPROM access on QMOD
for now, it just continuously reads the EEPROM bytes and dumps them to the serial console for testing.
This commit is contained in:
@@ -97,6 +97,7 @@ void USART0_IrqHandler(void)
|
||||
config_func_ptrs[simtrace_config].usart0_irq();
|
||||
}
|
||||
|
||||
#include "i2c.h"
|
||||
/*------------------------------------------------------------------------------
|
||||
* Main
|
||||
*------------------------------------------------------------------------------*/
|
||||
@@ -131,6 +132,18 @@ extern int main(void)
|
||||
g_unique_id[0], g_unique_id[1],
|
||||
g_unique_id[2], g_unique_id[3]);
|
||||
|
||||
#if 1
|
||||
static const Pin pin_hub_rst = {PIO_PA13, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT};
|
||||
PIO_Configure(&pin_hub_rst, 1);
|
||||
i2c_pin_init();
|
||||
while (1) {
|
||||
for (i = 0; i < 256; i ++) {
|
||||
int byte = eeprom_read_byte(0x50, i);
|
||||
TRACE_INFO("0x%02x: %02x\r\n", i, byte);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
TRACE_INFO("USB init...\r\n");
|
||||
while (USBD_GetState() < USBD_STATE_CONFIGURED) {
|
||||
if (i >= MAX_USB_ITER * 3) {
|
||||
|
||||
Reference in New Issue
Block a user