TELOSb External Flash
[Device Drivers]


Defines

#define TELOSB_RAMFUNC   __attribute__((section (".data")))
 this attribute causes the function to be mirrored in RAM, allowing the function to be called even if the program flash has been erased.
#define dev_open_DEV_TELOS_FLASH(void)   mos_mutex_lock(&telos_flash_mutex)
 gain an exclusive lock on the External Flash. Any other threads calling dev_open_DEV_TELOS_FLASH() will block until the owner calls dev_close_DEV_TELOS_FLASH().
#define dev_close_DEV_TELOS_FLASH(void)   mos_mutex_unlock(&telos_flash_mutex)
 release exclusive lock on the External Flash. Any other thread blocking on dev_open_DEV_TELOS_FLASH() will now unblock.

Functions

uint8_t TELOSB_RAMFUNC dev_read_DEV_TELOS_FLASH (void *buf, uint16_t count)
 Read count number of bytes from the flash and store it in buf. Note: This function is mirrored in RAM and can be called even after the program flash has been erased.
uint8_t dev_write_DEV_TELOS_FLASH (const void *buf, uint16_t count)
 Write count bytes from buf to the external flash.
uint8_t dev_mode_DEV_TELOS_FLASH (uint8_t md)
 turn the flash on or off. Accepted parameters are:
  1. DEV_MODE_OFF: Turn the device off.
  2. DEV_MODE_ON: Turn the device on.

uint8_t TELOSB_RAMFUNC dev_ioctl_DEV_TELOS_FLASH (int8_t request,...)
 send an IO Control command to the flash driver. Accepted parameters are:
  1. DEV_SEEK, [uint32_t address]
  2. TELOS_FLASH_BULK_ERASE
  3. TELOS_FLASH_SECT_ERASE, [uint32_t address] Note: This function is mirrored in RAM and can be called even after the program flash has been erased.


Variables

mos_mutex_t telos_flash_mutex

Detailed Description

This group contains functions associated with the TELOSb External Flash (ST M25P80)

Function Documentation

uint8_t TELOSB_RAMFUNC dev_ioctl_DEV_TELOS_FLASH int8_t  request,
  ...
 

Parameters:
request the specified ioctl.
... any data associated with the requested ioctl.
Returns:
DEV_OK or DEV_BAD_IOCTL

uint8_t dev_mode_DEV_TELOS_FLASH uint8_t  md  ) 
 

Parameters:
md the new mode
Returns:
DEV_OK or DEV_UNSUPPORTED

uint8_t TELOSB_RAMFUNC dev_read_DEV_TELOS_FLASH void *  buf,
uint16_t  count
 

Parameters:
count the number of bytes to read.
buf the buffer used to store the read data.
Returns:
the number of bytes read.

uint8_t dev_write_DEV_TELOS_FLASH const void *  buf,
uint16_t  count
 

Parameters:
count the number of bytes to write. The maximum number of bytes That can be written at once is 256.
buf a pointer to the data to be written.
Returns:
the number of bytes written.


Variable Documentation

mos_mutex_t telos_flash_mutex
 

For internal use only.

used by the dev_open and dev_close functions.


Generated on Sun Nov 22 06:26:00 2009 for MANTIS by  doxygen 1.4.6