Skip to content

Example of writing to eeprom #9

Description

@IndiaMike

Library does not fully support writing operation.
It is important to remember about switching WP (Write Protection) pin before call write function.

        _Bool status = false;
	status = EE24_Init(&eeprom24, &hi2c1, EE24_ADDRESS_DEFAULT);

	uint8_t data[4] = {0xBE, 0xEF, 0xAB, 0xCD};

	HAL_GPIO_WritePin(EEPROM_WP_GPIO_Port, EEPROM_WP_Pin, GPIO_PIN_RESET);
        status = EE24_Write(&eeprom24, 0u, &data, 4, 1000);
	HAL_GPIO_WritePin(EEPROM_WP_GPIO_Port, EEPROM_WP_Pin, GPIO_PIN_SET);

	memset(&data, 0u, sizeof(data));
	status = EE24_Read(&eeprom24, 0u, &data, 4, 1000);

The rest of library is ok. Simple and working library.
Thanks :D

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions