void f3s_close (f3s_socket_t *socket, uint32_t flags)
This function is called to close the socket. If you need to, you can disable the flash device and remove any programming voltage, etc.
The following flags are defined for the flags parameter in the socket functions:
The socket parameter is used for passing arguments and returning results from the socket services and for storing information about each socket. To handle complex interfaces such as PCMCIA, the structure has been defined so that there can be more than one socket; each socket can have more than one window. A simple linear flash array would have a single socket and no windows.
The socket structure is defined as:
typedef struct f3s_socket_s { /* * these fields are initialized by the flash file system * and later validated and set by the socket services */ uint16_t struct_size; /* size of this structure */ uint16_t status; /* status of this structure */ uint8_t *option; /* option string from flashio */ uint16_t socket_index; /* index of socket */ uint16_t window_index; /* index of window */ /* * these fields are initialized by the socket services and later * referenced by the flash file system */ uint8_t *name; /* name of driver */ _Paddr64t address; /* physical address 0 for allocated */ uint32_t window_size; /* size of window power of 2 mandatory */ uint32_t array_offset; /* offset of array 0 for based */ uint32_t array_size; /* size of array 0 for window_size */ uint32_t unit_size; /* size of unit 0 for probed */ uint32_t flags; /* flags for capabilities */ uint16_t bus_width; /* width of bus */ uint16_t window_num; /* number of windows 0 for not windowed */ /* * these fields are initialized by the socket services and later * referenced by the socket services */ uint8_t* memory; /* access pointer for window memory */ void *socket_handle; /* socket handle pointer for external library */ void *window_handle; /* window handle pointer for external library */ /* * this field is modified by the socket services as different window * pages are selected */ uint32_t window_offset; /* offset of window */ } f3s_socket_t;
Here's a description of the fields: