#include <errno.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include "no_os_alloc.h"
#include "oa_tc6.h"
Functions | |
int | oa_rx_chunk_to_frame (struct oa_tc6_desc *desc, uint8_t *chunks, uint32_t len) |
int | oa_tc6_reg_read (struct oa_tc6_desc *desc, uint32_t addr, uint32_t *val) |
Read a register value. | |
int | oa_tc6_reg_write (struct oa_tc6_desc *desc, uint32_t addr, uint32_t val) |
Write a register value. | |
int | oa_tc6_reg_update (struct oa_tc6_desc *desc, uint32_t addr, uint32_t val, uint32_t mask) |
Update a field inside a register. | |
int | oa_tc6_get_tx_frame (struct oa_tc6_desc *desc, struct oa_tc6_frame_buffer **buffer) |
Get a frame buffer that can be filled by user. | |
int | oa_tc6_put_tx_frame (struct oa_tc6_desc *desc, struct oa_tc6_frame_buffer *buffer) |
Mark a frame buffer as ready to be transmitted. | |
int | oa_tc6_get_rx_frame_match_vs (struct oa_tc6_desc *desc, struct oa_tc6_frame_buffer **buffer, uint8_t vs, uint8_t mask) |
Get a frame buffer that is ready to be read by the user. The VS field in the chunk footer fields should match what is provided. | |
int | oa_tc6_get_rx_frame (struct oa_tc6_desc *desc, struct oa_tc6_frame_buffer **buffer) |
Get a frame buffer that is ready to be read by the user. | |
int | oa_tc6_put_rx_frame (struct oa_tc6_desc *desc, struct oa_tc6_frame_buffer *buffer) |
Mark a frame buffer as used and ready to be rewritten. | |
int | oa_tc6_thread (struct oa_tc6_desc *desc) |
Transmit all the frames in the OA_BUFF_TX_READY state and receive the frames in the OA_BUFF_RX_COMPLETE state. | |
int | oa_tc6_init (struct oa_tc6_desc **desc, struct oa_tc6_init_param *param) |
Allocate resources for the OA TC6 driver. | |
int | oa_tc6_remove (struct oa_tc6_desc *desc) |
Free a device descriptor. | |
int oa_rx_chunk_to_frame | ( | struct oa_tc6_desc * | desc, |
uint8_t * | chunks, | ||
uint32_t | len ) |
int oa_tc6_get_rx_frame | ( | struct oa_tc6_desc * | desc, |
struct oa_tc6_frame_buffer ** | buffer ) |
Get a frame buffer that is ready to be read by the user.
desc | - the OA TC6 descriptor. |
buffer | - buffer containing the frame received. |
int oa_tc6_get_rx_frame_match_vs | ( | struct oa_tc6_desc * | desc, |
struct oa_tc6_frame_buffer ** | buffer, | ||
uint8_t | vs, | ||
uint8_t | mask ) |
Get a frame buffer that is ready to be read by the user. The VS field in the chunk footer fields should match what is provided.
desc | - the OA TC6 descriptor. |
buffer | - buffer containing the frame received. |
vs | - the value of the VS field to match. |
mask | - the mask to apply to the VS field. |
int oa_tc6_get_tx_frame | ( | struct oa_tc6_desc * | desc, |
struct oa_tc6_frame_buffer ** | buffer ) |
Get a frame buffer that can be filled by user.
desc | - the OA TC6 descriptor. |
buffer | - buffer containing the frame to be transmitted. |
int oa_tc6_init | ( | struct oa_tc6_desc ** | desc, |
struct oa_tc6_init_param * | param ) |
Allocate resources for the OA TC6 driver.
desc | - the device descriptor to be initialized |
param | - the device's parameter |
int oa_tc6_put_rx_frame | ( | struct oa_tc6_desc * | desc, |
struct oa_tc6_frame_buffer * | buffer ) |
Mark a frame buffer as used and ready to be rewritten.
desc | - the OA TC6 descriptor. |
buffer | - buffer containing the frame read by the user. |
int oa_tc6_put_tx_frame | ( | struct oa_tc6_desc * | desc, |
struct oa_tc6_frame_buffer * | buffer ) |
Mark a frame buffer as ready to be transmitted.
desc | - the OA TC6 descriptor. |
buffer | - buffer containing the frame to be transmitted. |
int oa_tc6_reg_read | ( | struct oa_tc6_desc * | desc, |
uint32_t | addr, | ||
uint32_t * | val ) |
Read a register value.
desc | - the OA TC6 descriptor. |
addr | - Register address. |
val | - Register value. |
int oa_tc6_reg_update | ( | struct oa_tc6_desc * | desc, |
uint32_t | addr, | ||
uint32_t | val, | ||
uint32_t | mask ) |
Update a field inside a register.
desc | - the OA TC6 descriptor. |
addr | - Register address. |
val | - Field value. |
mask | - Bit mask corresponding to the register field. |
int oa_tc6_reg_write | ( | struct oa_tc6_desc * | desc, |
uint32_t | addr, | ||
uint32_t | val ) |
Write a register value.
desc | - the OA TC6 descriptor. |
addr | - Register address. |
val | - Register value. |
int oa_tc6_remove | ( | struct oa_tc6_desc * | desc | ) |
Free a device descriptor.
desc | - the device descriptor to be removed. |
int oa_tc6_thread | ( | struct oa_tc6_desc * | desc | ) |
Transmit all the frames in the OA_BUFF_TX_READY state and receive the frames in the OA_BUFF_RX_COMPLETE state.
desc | - the OA TC6 descriptor |