Files
OpenCellular/chip_interface/flash.h
Louis Yung-Chieh Lo 91daca6939 Add ec_keyboard_test.c
This CL also includes 4 pieces:
  1. main files: environment-independent (main.c) and
                            -dependent (ec_keyboard_test.c).
  2. stub files: chip_stub/keyboard.c simulates the real hardware.
                 chip_stub/keyboard.h is the header of testing functions.
  3. initial keyboard lib code: ec_keyboard.h
  4. rename Cr* function name to Ec* under chip_interface/.

BUG=None
TEST=make && make runtests
Expect seeing the output debug message from cros_ec/lib/ec_keyboard.c.

Change-Id: Ia7e8022060eb0a5d0a11abcbdb3f524942f5c68d
2011-10-26 22:12:19 +08:00

33 lines
972 B
C

/* Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
* flash.h - flash interface
*/
#ifndef __CHIP_INTERFACE_FLASH_H
#define __CHIP_INTERFACE_FLASH_H
/* returns the flash size and erase clock structure. */
EcError EcFlashQuery(*size, *erase_block) {
EcError EcFlashRead(addr_t offset, length, uint8_t *data);
EcError EcFlashWrite(addr_t offset, length, uint8_t *data);
EcError EcFlashErase(addr_t offset, length);
EcError EcFlashSetWriteProtectRange(addr_t offset, length);
/* TODO: change to Randall's new model */
/* Set lock bit (the SRP bit in SPI) */
EcError EcFlashEnableWriteProtect(void);
/* TODO: change to Randall's new model */
/* Always return FAILED because FMPPEn cannot be reset to 1
* until a power-on reset or after committed (see p. 577).
*/
int EcFlashDisableWriteProtect(void);
#endif /* __CHIP_INTERFACE_FLASH_H */