pros/apix.h file

PROS Extended API header

Contains additional declarations for use by advaned users of PROS. These functions do not typically have as much error handling or require deeper knowledge of real time operating systems.

This file should not be modified by users, since it gets replaced whenever a kernel upgrade occurs.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Namespaces

namespace pros
LLEMU Conditional Include
namespace pros::c

RTOS Facilities

using queue_t = void*
Unblocks a task in the Blocked state (e.g.
using sem_t = void*
Unblocks a task in the Blocked state (e.g.
bool task_abort_delay(task_t task)
Unblocks a task in the Blocked state (e.g.
void task_notify_when_deleting(task_t target_task, task_t task_to_notify, uint32_t value, notify_action_e_t notify_action)
Notify a task when a target task is being deleted.
mutex_t mutex_recursive_create(void)
Creates a recursive mutex which can be locked recursively by the owner.
bool mutex_recursive_take(mutex_t mutex, uint32_t timeout)
Takes a recursive mutex.
bool mutex_recursive_give(mutex_t mutex)
Gives a recursive mutex.
task_t mutex_get_owner(mutex_t mutex)
Returns a handle to the current owner of a mutex.
sem_t sem_create(uint32_t max_count, uint32_t init_count)
Creates a counting sempahore.
void sem_delete(sem_t sem)
Deletes a semaphore (or binary semaphore)
sem_t sem_binary_create(void)
Creates a binary semaphore.
bool sem_wait(sem_t sem, uint32_t timeout)
Waits for the semaphore's value to be greater than 0.
bool sem_post(sem_t sem)
Increments a semaphore's value.
uint32_t sem_get_count(sem_t sem)
Returns the current value of the semaphore.
queue_t queue_create(uint32_t length, uint32_t item_size)
Creates a queue.
bool queue_append(queue_t queue, const void* item, uint32_t timeout)
Posts an item to the front of a queue.
bool queue_peek(queue_t queue, void*const buffer, uint32_t timeout)
Receive an item from a queue without removing the item from the queue.
bool queue_recv(queue_t queue, void*const buffer, uint32_t timeout)
Receive an item from the queue.
uint32_t queue_get_waiting(const queue_t queue)
Return the number of messages stored in a queue.
uint32_t queue_get_available(const queue_t queue)
Return the number of spaces left in a queue.
void queue_delete(queue_t queue)
Delete a queue.
void queue_reset(queue_t queue)
Resets a queue to an empty state.

Device Registration

int registry_bind_port(uint8_t port, v5_device_e_t device_type)
Registers a device in the given zero-indexed port.
int registry_unbind_port(uint8_t port)
Deregisters a devices from the given zero-indexed port.
v5_device_e_t registry_get_bound_type(uint8_t port)
Returns the type of device registered to the zero-indexed port.
v5_device_e_t registry_get_plugged_type(uint8_t port)
Returns the type of the device plugged into the zero-indexed port.

Filesystem

#define SERCTL_ACTIVATE
Action macro to pass into serctl or fdctl that activates the stream identifier.
#define SERCTL_DEACTIVATE
Action macro to pass into serctl or fdctl that deactivates the stream identifier.
#define SERCTL_BLKWRITE
Action macro to pass into fdctl that enables blocking writes for the file.
#define SERCTL_NOBLKWRITE
Action macro to pass into fdctl that makes writes non-blocking for the file.
#define SERCTL_ENABLE_COBS
Action macro to pass into serctl that enables advanced stream multiplexing capabilities.
#define SERCTL_DISABLE_COBS
Action macro to pass into serctl that disables advanced stream multiplexing capabilities.
#define DEVCTL_FIONREAD
Action macro to check if there is data available from the Generic Serial Device.
#define DEVCTL_FIONWRITE
Action macro to check if there is space available in the Generic Serial Device's output buffer.
#define DEVCTL_SET_BAUDRATE
Action macro to set the Generic Serial Device's baudrate.
int32_t fdctl(int file, const uint32_t action, void*const extra_arg)
Control settings of the serial driver.
int32_t motor_set_reversed(int8_t port, const bool reverse)
Sets the reverse flag for the motor.
int32_t motor_is_reversed(int8_t port)
Gets the operation direction of the motor as set by the user.