コード例 #1
0
ファイル: flash.c プロジェクト: doceme/libopencm3
void flash_program_half_word(u32 address, u16 data, u32 program_size)
{
	flash_wait_for_last_operation();
	flash_set_program_size(program_size);

	FLASH_CR |= FLASH_PG;

	MMIO16(address) = data;

	flash_wait_for_last_operation();

	FLASH_CR &= ~FLASH_PG;		/* Disable the PG bit. */
}
コード例 #2
0
void flash_program_half_word(uint32_t address, uint16_t data)
{
	flash_wait_for_last_operation();
	flash_set_program_size(FLASH_CR_PROGRAM_X16);

	FLASH_CR |= FLASH_CR_PG;

	MMIO16(address) = data;

	flash_wait_for_last_operation();

	FLASH_CR &= ~FLASH_CR_PG;		/* Disable the PG bit. */
}
コード例 #3
0
ファイル: flash_common_f01.c プロジェクト: esden/libopencm3
void flash_program_option_bytes(uint32_t address, uint16_t data)
{
	flash_wait_for_last_operation();

	if ((FLASH_CR & FLASH_CR_OPTWRE) == 0) {
		flash_unlock_option_bytes();
	}

	FLASH_CR |= FLASH_CR_OPTPG;	/* Enable option byte programming. */
	MMIO16(address) = data;
	flash_wait_for_last_operation();
	FLASH_CR &= ~FLASH_CR_OPTPG;	/* Disable option byte programming. */
}
コード例 #4
0
ファイル: flash.c プロジェクト: Aghosh993/TARS_codebase
void flash_program_half_word(uint32_t address, uint16_t data)
{
	flash_wait_for_last_operation();

	if ((MEMORY_SIZE_REG > 512) && (address >= FLASH_BASE+0x00080000))
		FLASH_CR2 |= FLASH_CR_PG;
	else FLASH_CR |= FLASH_CR_PG;

	MMIO16(address) = data;

	flash_wait_for_last_operation();

	if ((MEMORY_SIZE_REG > 512) && (address >= FLASH_BASE+0x00080000))
		FLASH_CR2 &= ~FLASH_CR_PG;
	else FLASH_CR &= ~FLASH_CR_PG;
}
コード例 #5
0
void flash_program_half_word(uint32_t address, uint16_t data)
{
	flash_wait_for_last_operation();

	if ((DESIG_FLASH_SIZE > 512) && (address >= FLASH_BASE+0x00080000)) {
		FLASH_CR2 |= FLASH_CR_PG;
	} else {
		FLASH_CR |= FLASH_CR_PG;
	}

	MMIO16(address) = data;

	flash_wait_for_last_operation();

	if ((DESIG_FLASH_SIZE > 512) && (address >= FLASH_BASE+0x00080000)) {
		FLASH_CR2 &= ~FLASH_CR_PG;
	} else {
		FLASH_CR &= ~FLASH_CR_PG;
	}
}