Beispiel #1
0
void sst25vf_share_global_protect(const device_cfg_t * cfg){
	//maninpulate the status registers
	uint8_t status;
	status = (1<<SST25VF_STATUS_SWPL_BIT) |
			(1<<SST25VF_STATUS_SWP_BIT0) |
			(1<<SST25VF_STATUS_SWP_BIT1) |
			(1<<SST25VF_STATUS_SWP_BIT2) |
			(1<<SST25VF_STATUS_SWP_BIT3);
	sst25vf_share_write_quick_opcode(cfg, SST25VF_INS_WR_STATUS_ENABLE);
	sst25vf_share_write_status(cfg, status); //global protect and set SWPL
}
Beispiel #2
0
void sst25vf_share_chip_erase(const device_cfg_t * cfg){
	sst25vf_share_write_enable(cfg);
	sst25vf_share_write_quick_opcode(cfg, SST25VF_INS_CHIP_ERASE);
	sst25vf_share_read_status(cfg);
}
Beispiel #3
0
void sst25vf_share_write_dbsy(const device_cfg_t * cfg){
	sst25vf_share_write_quick_opcode(cfg, SST25VF_INS_DBSY);
}
Beispiel #4
0
void sst25vf_share_write_disable(const device_cfg_t * cfg){
	sst25vf_share_write_quick_opcode(cfg, SST25VF_INS_WRITE_DISABLE);
}
Beispiel #5
0
int sst25vf_share_global_unprotect(const device_cfg_t * cfg){
	//manipulate the status registers
	sst25vf_share_write_quick_opcode(cfg, SST25VF_INS_WR_STATUS_ENABLE);
	sst25vf_share_write_status(cfg, (1<<SST25VF_STATUS_SWPL_BIT)); //global unprotect and set SPRL
	return 0;
}
Beispiel #6
0
void sst25vf_share_power_up(const device_cfg_t * cfg){
	sst25vf_share_write_quick_opcode(cfg, SST25VF_INS_POWER_UP);
}
void sst25vf_share_write_dbsy(const devfs_handle_t * handle){
    sst25vf_share_write_quick_opcode(handle, SST25VF_INS_DBSY);
}
void sst25vf_share_write_disable(const devfs_handle_t * handle){
    sst25vf_share_write_quick_opcode(handle, SST25VF_INS_WRITE_DISABLE);
}
void sst25vf_share_power_up(const devfs_handle_t * handle){
    sst25vf_share_write_quick_opcode(handle, SST25VF_INS_POWER_UP);
}
Beispiel #10
0
void sst25vf_share_chip_erase(const devfs_handle_t * handle){
    sst25vf_share_write_enable(handle);
    sst25vf_share_write_quick_opcode(handle, SST25VF_INS_CHIP_ERASE);
    sst25vf_share_read_status(handle);
}