Documentation of kernel API
This commit is contained in:
parent
1ee41a489d
commit
f414286a2f
|
@ -150,12 +150,14 @@ Return Values:
|
||||||
This call fills in the specified buffer with the current date,
|
This call fills in the specified buffer with the current date,
|
||||||
in the following format:
|
in the following format:
|
||||||
|
|
||||||
|
```
|
||||||
struct {
|
struct {
|
||||||
uint16_t year // Current year
|
uint16_t year // Current year
|
||||||
uint8_t month; // 1 = January..12 = December
|
uint8_t month; // 1 = January..12 = December
|
||||||
uint8_t day; // 1..31
|
uint8_t day; // 1..31
|
||||||
uint8_t weekday; // 0 = Sunday..6=Saturday
|
uint8_t weekday; // 0 = Sunday..6=Saturday
|
||||||
}
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## 0x0A: Set Date
|
## 0x0A: Set Date
|
||||||
|
|
||||||
|
@ -169,12 +171,14 @@ Return Values:
|
||||||
|
|
||||||
Argument Structure:
|
Argument Structure:
|
||||||
|
|
||||||
|
```
|
||||||
struct {
|
struct {
|
||||||
uint16_t year // Current year
|
uint16_t year // Current year
|
||||||
uint8_t month; // 1 = January..12 = December
|
uint8_t month; // 1 = January..12 = December
|
||||||
uint8_t day; // 1..31
|
uint8_t day; // 1..31
|
||||||
uint8_t weekday; // 0 = Sunday..6=Saturday
|
uint8_t weekday; // 0 = Sunday..6=Saturday
|
||||||
};
|
};
|
||||||
|
```
|
||||||
|
|
||||||
This call sets the system date from the data in the argument structure.
|
This call sets the system date from the data in the argument structure.
|
||||||
|
|
||||||
|
@ -190,11 +194,13 @@ Return Values:
|
||||||
|
|
||||||
Argument Structure:
|
Argument Structure:
|
||||||
|
|
||||||
|
```
|
||||||
struct {
|
struct {
|
||||||
uint8_t hour; // 0..23
|
uint8_t hour; // 0..23
|
||||||
uint8_t minute; // 0..59
|
uint8_t minute; // 0..59
|
||||||
uint8_t second; // 0..59
|
uint8_t second; // 0..59
|
||||||
};
|
};
|
||||||
|
```
|
||||||
|
|
||||||
This call fills in the specified argument structure with the current time.
|
This call fills in the specified argument structure with the current time.
|
||||||
|
|
||||||
|
@ -279,14 +285,15 @@ Return Values:
|
||||||
- C: Status code
|
- C: Status code
|
||||||
- X: Number of bytes actually read
|
- X: Number of bytes actually read
|
||||||
|
|
||||||
Argument block structure:
|
Argument Structure:
|
||||||
|
|
||||||
|
```
|
||||||
struct {
|
struct {
|
||||||
void *dest; // Pointer to the buffer to use.
|
void *dest; // Pointer to the buffer to use.
|
||||||
uint16_t file; // File handle.
|
uint16_t file; // File handle.
|
||||||
size_t length; // Maximum number of bytes to read.
|
size_t length; // Maximum number of bytes to read.
|
||||||
};
|
};
|
||||||
|
```
|
||||||
|
|
||||||
This call attempts to read up to `length` bytes from the file handle `file`, into
|
This call attempts to read up to `length` bytes from the file handle `file`, into
|
||||||
the buffer pointed to by `dest`. On success, the C accumulator will contain STATUS_OK,
|
the buffer pointed to by `dest`. On success, the C accumulator will contain STATUS_OK,
|
||||||
|
@ -305,14 +312,15 @@ Return Values:
|
||||||
- C: Status code
|
- C: Status code
|
||||||
- X: Number of bytes actually written
|
- X: Number of bytes actually written
|
||||||
|
|
||||||
Argument block structure:
|
Argument Structure:
|
||||||
|
|
||||||
|
```
|
||||||
struct {
|
struct {
|
||||||
void *src; // Pointer to the buffer to use.
|
void *src; // Pointer to the buffer to use.
|
||||||
uint16_t file; // File handle.
|
uint16_t file; // File handle.
|
||||||
size_t length; // Maximum number of bytes to write.
|
size_t length; // Maximum number of bytes to write.
|
||||||
};
|
};
|
||||||
|
```
|
||||||
|
|
||||||
This call attempts to write up to `length` bytes to the file handle `file`, from
|
This call attempts to write up to `length` bytes to the file handle `file`, from
|
||||||
the buffer pointed to by `src`. On success, the C accumulator will contain STATUS_OK,
|
the buffer pointed to by `src`. On success, the C accumulator will contain STATUS_OK,
|
||||||
|
@ -371,10 +379,12 @@ Return Values:
|
||||||
|
|
||||||
Argument Structure:
|
Argument Structure:
|
||||||
|
|
||||||
|
```
|
||||||
struct {
|
struct {
|
||||||
char *src; // Fully-qualified source pathname.
|
char *src; // Fully-qualified source pathname.
|
||||||
char *dest; // Fully-qualified destination pathname.
|
char *dest; // Fully-qualified destination pathname.
|
||||||
};
|
};
|
||||||
|
```
|
||||||
|
|
||||||
This call attempts to move or rename the specified `source` file to `dest`. On success,
|
This call attempts to move or rename the specified `source` file to `dest`. On success,
|
||||||
C will contain STATUS_OK. On error, C will contain a negative value indicating the
|
C will contain STATUS_OK. On error, C will contain a negative value indicating the
|
||||||
|
|
Loading…
Reference in New Issue