Macros | Variables
ctrl_access.c File Reference
#include "compiler.h"
#include "preprocessor.h"
#include "ctrl_access.h"
#include "fat.h"
Include dependency graph for ctrl_access.c:

Go to the source code of this file.

Macros

#define Lun_usb_get_lun()   host_get_lun()
 
LUN Access Protection Macros
#define Ctrl_access_lock()   true
 Locks accesses to LUNs. More...
 
#define Ctrl_access_unlock()
 Unlocks accesses to LUNs. More...
 

Functions

Control Interface
U8 get_nb_lun (void)
 Returns the number of LUNs. More...
 
U8 get_cur_lun (void)
 Returns the current LUN. More...
 
Ctrl_status mem_test_unit_ready (U8 lun)
 Tests the memory state and initializes the memory if required. More...
 
Ctrl_status mem_read_capacity (U8 lun, U32 *u32_nb_sector)
 Returns the address of the last valid sector (512 bytes) in the memory. More...
 
U8 mem_sector_size (U8 lun)
 Returns the size of the physical sector. More...
 
bool mem_unload (U8 lun, bool unload)
 Unload/load the medium. More...
 
bool mem_wr_protect (U8 lun)
 Returns the write-protection state of the memory. More...
 
bool mem_removal (U8 lun)
 Tells whether the memory is removable. More...
 
const char * mem_name (U8 lun)
 Returns a pointer to the LUN name. More...
 
MEM <-> USB Interface
Ctrl_status memory_2_usb (U8 lun, U32 addr, U16 nb_sector)
 Transfers data from the memory to USB. More...
 
Ctrl_status usb_2_memory (U8 lun, U32 addr, U16 nb_sector)
 Transfers data from USB to the memory. More...
 
MEM <-> RAM Interface
Ctrl_status memory_2_ram (U8 lun, U32 addr, void *ram)
 Copies 1 data sector from the memory to RAM. More...
 
Ctrl_status ram_2_memory (U8 lun, U32 addr, const void *ram)
 Copies 1 data sector from RAM to the memory. More...
 
Streaming MEM <-> MEM Interface
Ctrl_status stream_mem_to_mem (U8 src_lun, U32 src_addr, U8 dest_lun, U32 dest_addr, U16 nb_sector)
 Copies data from one memory to another. More...
 
Ctrl_status stream_state (U8 id)
 Returns the state of a streaming data transfer. More...
 
U16 stream_stop (U8 id)
 Stops a streaming data transfer. More...
 

Variables

bool g_wr_protect
 Write protect. More...
 

Macro Definition Documentation

◆ Ctrl_access_lock

#define Ctrl_access_lock ( )    true

Locks accesses to LUNs.

Returns
true if the access was successfully locked, else false.

Definition at line 94 of file ctrl_access.c.

◆ Ctrl_access_unlock

#define Ctrl_access_unlock ( )

Unlocks accesses to LUNs.

Definition at line 98 of file ctrl_access.c.

◆ Lun_usb_get_lun

#define Lun_usb_get_lun ( )    host_get_lun()


inertial_sense_ros
Author(s):
autogenerated on Sat Sep 19 2020 03:19:05