Skip to content
Snippets Groups Projects
Commit 90a92182 authored by Pascal Koch's avatar Pascal Koch
Browse files

test

parent bfff827d
No related branches found
No related tags found
No related merge requests found
......@@ -16,9 +16,10 @@ unsigned* resetdone = (void*) (RESETS_BASE + RESETS_RESET_DONE_IO_BANK0_BITS);
unsigned* SDApinctrl = (void*)(IO_BANK0_BASE + IO_BANK0_GPIO0_CTRL_OFFSET);
unsigned* SCLpinctrl = (void*)(IO_BANK0_BASE + IO_BANK0_GPIO1_CTRL_OFFSET);
//unsigned* SDApinctrl = (void*)(IO_BANK0_BASE + IO_BANK0_GPIO0_CTRL_OFFSET);
//unsigned* SCLpinctrl = (void*)(IO_BANK0_BASE + IO_BANK0_GPIO1_CTRL_OFFSET);
unsigned* SDApinctrl = (void *)PICO_DEFAULT_I2C_SDA_PIN;
unsigned* SCLpinctrl = (void *)PICO_DEFAULT_I2C_SCL_PIN;
......@@ -29,15 +30,33 @@ int main() {
//*SDApinctrl = IO_BANK0_GPIO0_CTRL_FUNCSEL_VALUE_I2C0_SDA;
//*SCLpinctrl = IO_BANK0_GPIO1_CTRL_FUNCSEL_VALUE_I2C0_SCL;
//gpio_set_function_masked(1 | 2, GPIO_FUNC_I2C); //
gpio_pull_up(*SDApinctrl);
gpio_pull_up(*SCLpinctrl);
gpio_set_function_masked(*SDApinctrl , IO_BANK0_GPIO0_CTRL_FUNCSEL_VALUE_I2C0_SDA); //
gpio_set_function_masked(*SCLpinctrl , IO_BANK0_GPIO1_CTRL_FUNCSEL_VALUE_I2C0_SCL); //
i2c_init(i2c_default, 100000);
i2c_write_blocking(i2c_default, 0x70 , 0x21, 1 ,false);
gpio_pull_up(SDApinctrl);
gpio_pull_up(*SDApinctrl);
gpio_pull_up(*SCLpinctrl);
//uint8_t* lampe [2] = {0x01,0xff};
i2c_write_blocking(i2c_default, 0x70 ,(const uint8_t *) 0x21, 1 ,false);
i2c_write_blocking(i2c_default, 0x70 ,(const uint8_t *) 0xa0, 1 ,false);
i2c_write_blocking(i2c_default, 0x70 ,(const uint8_t *) 0xe1, 1 ,false);
i2c_write_blocking(i2c_default, 0x70 ,(const uint8_t *) 0x81, 1 ,false);
i2c_write_blocking(i2c_default, 0x70 ,(const uint8_t *) 0x0055, 2 ,false);
//i2c_write_blocking(i2c_default, 0x70 ,(const uint8_t *) 0x81, 1 ,false);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment