コード例 #1
0
void sst25vf_share_write_status(const devfs_handle_t * handle, uint8_t status){
    sst25vf_share_write_enable(handle);
    sst25vf_share_assert_cs(handle);
    mcu_spi_swap(handle, (void*)(ssize_t)SST25VF_INS_WR_STATUS);
    mcu_spi_swap(handle, (void*)(ssize_t)status);
    sst25vf_share_deassert_cs(handle);
}
コード例 #2
0
void sst25vf_share_write_byte(const device_cfg_t * cfg, uint32_t addr, char byte){
	sst25vf_share_write_enable(cfg);
	sst25vf_share_assert_cs(cfg);
	sst25vf_share_write_opcode_addr(cfg, SST25VF_INS_PROGRAM, addr);
	hwpl_spi_swap(cfg->periph.port, (void*)(ssize_t)byte);
	sst25vf_share_deassert_cs(cfg);
}
コード例 #3
0
void sst25vf_share_write_status(const device_cfg_t * cfg, uint8_t status){
	sst25vf_share_write_enable(cfg);
	sst25vf_share_assert_cs(cfg);
	hwpl_spi_swap(cfg->periph.port, (void*)(ssize_t)SST25VF_INS_WR_STATUS);
	hwpl_spi_swap(cfg->periph.port, (void*)(ssize_t)status);
	sst25vf_share_deassert_cs(cfg);
}
コード例 #4
0
void sst25vf_share_write_byte(const devfs_handle_t * handle, uint32_t addr, char byte){
    sst25vf_share_write_enable(handle);
    sst25vf_share_assert_cs(handle);
    sst25vf_share_write_opcode_addr(handle, SST25VF_INS_PROGRAM, addr);
    mcu_spi_swap(handle, (void*)(ssize_t)byte);
    sst25vf_share_deassert_cs(handle);
}
コード例 #5
0
uint8_t sst25vf_share_read_status(const device_cfg_t * cfg){
	uint8_t status;
	sst25vf_share_assert_cs(cfg);
	hwpl_spi_swap(cfg->periph.port, (void*)SST25VF_INS_RD_STATUS);
	status = hwpl_spi_swap(cfg->periph.port, (void*)(ssize_t)0xFF);
	sst25vf_share_deassert_cs(cfg);
	return status;
}
コード例 #6
0
uint8_t sst25vf_share_read_status(const devfs_handle_t * handle){
    uint8_t status;
    sst25vf_share_assert_cs(handle);
    mcu_spi_swap(handle, (void*)SST25VF_INS_RD_STATUS);
    status = mcu_spi_swap(handle, (void*)(ssize_t)0xFF);
    sst25vf_share_deassert_cs(handle);
    return status;
}
コード例 #7
0
char sst25vf_share_read_byte(const device_cfg_t * cfg, uint32_t addr){
	char byte;
	sst25vf_share_assert_cs(cfg);
	sst25vf_share_write_opcode_addr(cfg, SST25VF_INS_RD_HS, addr);
	hwpl_spi_swap(cfg->periph.port, 0); //dummy byte output
	byte = hwpl_spi_swap(cfg->periph.port, (void*)(ssize_t)0xFF);
	sst25vf_share_deassert_cs(cfg);
	return byte;
}
コード例 #8
0
void sst25vf_share_read_id(const device_cfg_t * cfg, char * dest){
	int i;
	sst25vf_share_assert_cs(cfg);
	hwpl_spi_swap(cfg->periph.port, (void*)(ssize_t)SST25VF_INS_RD_ID);
	for(i=0; i < 4; i++){
		dest[i] = hwpl_spi_swap(cfg->periph.port, (void*)(ssize_t)0xFF);
	}
	sst25vf_share_deassert_cs(cfg);
}
コード例 #9
0
void sst25vf_share_read_id(const devfs_handle_t * handle, char * dest){
    int i;
    sst25vf_share_assert_cs(handle);
    mcu_spi_swap(handle, (void*)(ssize_t)SST25VF_INS_RD_ID);
    for(i=0; i < 4; i++){
        dest[i] = mcu_spi_swap(handle, (void*)(ssize_t)0xFF);
    }
    sst25vf_share_deassert_cs(handle);
}
コード例 #10
0
char sst25vf_share_read_byte(const devfs_handle_t * handle, uint32_t addr){
    char byte;
    sst25vf_share_assert_cs(handle);
    sst25vf_share_write_opcode_addr(handle, SST25VF_INS_RD_HS, addr);
    mcu_spi_swap(handle, 0); //dummy byte output
    byte = mcu_spi_swap(handle, (void*)(ssize_t)0xFF);
    sst25vf_share_deassert_cs(handle);
    return byte;
}
コード例 #11
0
void sst25vf_share_block_erase_64kb(const device_cfg_t * cfg, uint32_t addr /*! Any address in the 64KB block */){
	sst25vf_share_write_enable(cfg);
	sst25vf_share_assert_cs(cfg);
	sst25vf_share_write_opcode_addr(cfg, SST25VF_INS_BLOCK_ERASE_64KB, addr);
	sst25vf_share_deassert_cs(cfg);
}
コード例 #12
0
void sst25vf_share_write_quick_opcode(const device_cfg_t * cfg, uint8_t opcode){
	sst25vf_share_assert_cs(cfg);
	hwpl_spi_swap(cfg->periph.port, (void*)(ssize_t)opcode);
	sst25vf_share_deassert_cs(cfg);
}
コード例 #13
0
void sst25vf_share_block_erase_64kb(const devfs_handle_t * handle, uint32_t addr /*! Any address in the 64KB block */){
    sst25vf_share_write_enable(handle);
    sst25vf_share_assert_cs(handle);
    sst25vf_share_write_opcode_addr(handle, SST25VF_INS_BLOCK_ERASE_64KB, addr);
    sst25vf_share_deassert_cs(handle);
}
コード例 #14
0
void sst25vf_share_write_quick_opcode(const devfs_handle_t * handle, uint8_t opcode){
    sst25vf_share_assert_cs(handle);
    mcu_spi_swap(handle, (void*)(ssize_t)opcode);
    sst25vf_share_deassert_cs(handle);
}