Contiki-NG
Files
cc2538 Coffee port module

Module for the cc2538 Coffee port. More...

Files

file  cfs-coffee-arch.c
 Module for the cc2538 Coffee port.
 
file  cfs-coffee-arch.h
 Header file for the cc2538 Coffee port module.
 

Coffee port constants

#define COFFEE_SECTOR_SIZE   FLASH_PAGE_SIZE
 Logical sector size.
 
#define COFFEE_PAGE_SIZE   (COFFEE_SECTOR_SIZE / 8)
 Logical page size.
 
#define COFFEE_START   CC2538_DEV_FLASH_ADDR
 Start offset of the file system.
 
#define COFFEE_SIZE   0
 Total size in bytes of the file system.
 
#define COFFEE_NAME_LENGTH   40
 Maximal filename length.
 
#define COFFEE_MAX_OPEN_FILES   5
 Number of file cache entries.
 
#define COFFEE_FD_SET_SIZE   5
 Number of file descriptor entries.
 
#define COFFEE_LOG_TABLE_LIMIT   16
 Maximal amount of log table entries read in one batch.
 
#define COFFEE_DYN_SIZE   (COFFEE_SECTOR_SIZE - 50)
 Default reserved file size.
 
#define COFFEE_LOG_SIZE   (4 * COFFEE_PAGE_SIZE)
 Default micro-log size.
 
#define COFFEE_MICRO_LOGS   0
 Whether Coffee will use micro logs.
 
#define COFFEE_APPEND_ONLY   1
 Whether files are expected to be appended to only.
 

Coffee port macros

#define COFFEE_ERASE(sector)   cfs_coffee_arch_erase(sector)
 Erase.
 
#define COFFEE_WRITE(buf, size, offset)   cfs_coffee_arch_write((buf), (size), (offset))
 Write.
 
#define COFFEE_READ(buf, size, offset)   cfs_coffee_arch_read((buf), (size), (offset))
 Read.
 

Coffee port types

typedef int16_t coffee_page_t
 Page.
 

Coffee port functions

void cfs_coffee_arch_erase (uint16_t sector)
 Erases a device sector. More...
 
void cfs_coffee_arch_write (const void *buf, unsigned int size, cfs_offset_t offset)
 Writes a buffer to the device. More...
 
void cfs_coffee_arch_read (void *buf, unsigned int size, cfs_offset_t offset)
 Reads from the device to a buffer. More...
 

Detailed Description

Module for the cc2538 Coffee port.

Function Documentation

◆ cfs_coffee_arch_erase()

void cfs_coffee_arch_erase ( uint16_t  sector)

Erases a device sector.

Parameters
sectorSector to erase

Definition at line 76 of file cfs-coffee-arch.c.

References INTERRUPTS_DISABLE, and watchdog_periodic().

◆ cfs_coffee_arch_read()

void cfs_coffee_arch_read ( void *  buf,
unsigned int  size,
cfs_offset_t  offset 
)

Reads from the device to a buffer.

Parameters
bufPointer to the buffer
sizeByte size of the buffer
offsetDevice offset to read from

Definition at line 131 of file cfs-coffee-arch.c.

◆ cfs_coffee_arch_write()

void cfs_coffee_arch_write ( const void *  buf,
unsigned int  size,
cfs_offset_t  offset 
)

Writes a buffer to the device.

Parameters
bufPointer to the buffer
sizeByte size of the buffer
offsetDevice offset to write to

Definition at line 86 of file cfs-coffee-arch.c.