Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
W5100 ethernet chip I/O. More...
#include "mcu_periph/sys_time.h"
#include "modules/datalink/w5100.h"
#include "mcu_periph/spi.h"
#include "mcu_periph/gpio.h"
Go to the source code of this file.
Macros | |
#define | TXBUF_BASE 0x4000 |
#define | RXBUF_BASE 0x6000 |
#define | SOCKETS 4 |
#define | CMD_SOCKET 1 |
#define | TELEM_SOCKET 0 |
#define | SOCK_OPEN 0x01 |
#define | SOCK_CLOSE 0x10 |
#define | SOCK_SEND 0x20 |
#define | SOCK_RECV 0x40 |
#define | SNMR_UDP 0x02 |
#define | SNMR_MULTI 0x80 |
#define | SNIR_SEND_OK 0x10 |
#define | SNIR_TIMEOUT 0x08 |
#define | CH_BASE 0x0400 |
#define | CH_SIZE 0x0100 |
#define | SMASK 0x07FF |
#define | RMASK 0x07FF |
#define | REG_MR 0x0000 |
#define | REG_RX_MEM 0x001A |
#define | REG_TX_MEM 0x001B |
#define | REG_GAR 0x0001 |
#define | REG_SUBR 0x0005 |
#define | REG_SHAR 0x0009 |
#define | REG_SIPR 0x000F |
#define | SOCK_MR 0x0000 |
#define | SOCK_CR 0x0001 |
#define | SOCK_IR 0x0002 |
#define | SOCK_PORT 0x0004 |
#define | SOCK_DHAR 0x0006 |
#define | SOCK_DIPR 0x000C |
#define | SOCK_DPORT 0x0010 |
#define | SOCK_TX_WR 0x0024 |
#define | SOCK_RSR 0x0026 |
#define | SOCK_RXRD 0x0028 |
#define | W5100_SPI_DEV spi1 |
#define | W5100_SLAVE_IDX SPI_SLAVE1 |
#define | W5100_DRDY_GPIO GPIOB |
#define | W5100_DRDY_GPIO_PIN GPIO1 |
Variables | |
struct w5100_periph | chip0 |
uint8_t | ck_a |
uint8_t | ck_b |
uint8_t | w5100_rx_buf [W5100_RX_BUFFER_SIZE] |
static uint8_t | mac [] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED } |
static uint8_t | ip [] = { W5100_IP } |
static uint8_t | dest [] = { W5100_MULTICAST_IP } |
static uint8_t | subnet [] = { W5100_SUBNET } |
static uint16_t | dport = W5100_MULTICAST_PORT |
static const uint8_t | RST = 7 |
uint16_t | SBASE [SOCKETS] |
uint16_t | RBASE [SOCKETS] |
static const uint16_t | SSIZE = 2048 |
static const uint16_t | RSIZE = 2048 |
struct spi_transaction | w5100_spi |
W5100 ethernet chip I/O.
Definition in file w5100.c.
#define W5100_SLAVE_IDX SPI_SLAVE1 |
|
static |
Definition at line 352 of file w5100.c.
References CH_BASE, CH_SIZE, SNMR_UDP, SOCK_CR, SOCK_DHAR, SOCK_DIPR, SOCK_DPORT, SOCK_MR, SOCK_OPEN, SOCK_PORT, w5100_close_socket(), w5100_set_buffer(), and w5100_sock_set().
Referenced by w5100_init().
|
static |
Definition at line 177 of file w5100.c.
References w5100_ch_available().
Referenced by w5100_init().
|
static |
Definition at line 178 of file w5100.c.
References w5100_receive().
Referenced by w5100_init().
|
static |
Definition at line 176 of file w5100.c.
References w5100_send().
Referenced by w5100_init().
|
static |
Definition at line 174 of file w5100.c.
References w5100_transmit().
Referenced by w5100_init().
|
static |
Definition at line 175 of file w5100.c.
References w5100_transmit_buffer().
Referenced by w5100_init().
|
static |
Definition at line 173 of file w5100.c.
Referenced by w5100_init().
bool w5100_ch_available | ( | void | ) |
Definition at line 378 of file w5100.c.
References CMD_SOCKET, and w5100_rx_size().
Referenced by dev_char_available(), and w5100_read_buffer().
|
static |
Definition at line 344 of file w5100.c.
References SOCK_CLOSE, SOCK_CR, SOCK_IR, and w5100_sock_set().
Referenced by configure_socket().
Definition at line 130 of file w5100.c.
References spi_transaction::input_buf, spi_transaction::output_buf, spi_submit(), SPITransSuccess, spi_transaction::status, w5100_spi, and W5100_SPI_DEV.
Referenced by w5100_read(), and w5100_sock_get().
void w5100_init | ( | void | ) |
Definition at line 185 of file w5100.c.
References spi_transaction::bitorder, spi_transaction::cdiv, chip0, CMD_SOCKET, configure_socket(), spi_transaction::cpha, spi_transaction::cpol, w5100_periph::curbuf, dest, dev_char_available(), dev_getch(), dev_send(), dev_transmit(), dev_transmit_buffer(), w5100_periph::device, dport, spi_transaction::dss, gpio_clear(), gpio_set(), gpio_setup_output(), spi_transaction::input_buf, spi_transaction::input_length, ip, mac, spi_transaction::output_buf, spi_transaction::output_length, RBASE, REG_GAR, REG_MR, REG_RX_MEM, REG_SHAR, REG_SIPR, REG_SUBR, REG_TX_MEM, RSIZE, RST, RXBUF_BASE, SBASE, spi_transaction::select, spi_transaction::slave_idx, SNMR_MULTI, SOCKETS, SPICphaEdge1, SPICpolIdleLow, SPIDiv64, SPIDss8bit, SPIMSBFirst, SPISelectUnselect, SSIZE, w5100_periph::status, subnet, sys_time_usleep(), TELEM_SOCKET, true_function(), TXBUF_BASE, W5100_DRDY_GPIO, W5100_DRDY_GPIO_PIN, w5100_set(), w5100_set_buffer(), W5100_SLAVE_IDX, w5100_spi, W5100StatusUninit, w5100_periph::work_rx, and w5100_periph::work_tx.
Definition at line 432 of file w5100.c.
References w5100_get().
Referenced by w5100_read_data().
|
static |
Definition at line 412 of file w5100.c.
References CMD_SOCKET, RBASE, RMASK, RSIZE, and w5100_read().
Referenced by w5100_receive().
Definition at line 386 of file w5100.c.
References CMD_SOCKET, SOCK_CR, SOCK_RECV, SOCK_RXRD, w5100_read_data(), w5100_sock_get16(), and w5100_sock_set().
Referenced by dev_getch(), and w5100_read_buffer().
Definition at line 331 of file w5100.c.
References SOCK_RSR, val, and w5100_sock_get16().
Referenced by w5100_ch_available().
void w5100_send | ( | void | ) |
Definition at line 289 of file w5100.c.
References chip0, w5100_periph::curbuf, offset, SBASE, SMASK, SOCK_CR, SOCK_SEND, SOCK_TX_WR, SSIZE, TELEM_SOCKET, w5100_periph::tx_buf, w5100_periph::tx_extract_idx, w5100_periph::tx_insert_idx, W5100_BUFFER_NUM, w5100_set_buffer(), w5100_sock_get(), w5100_sock_get16(), and w5100_sock_set().
Referenced by dev_send().
Definition at line 117 of file w5100.c.
References spi_transaction::output_buf, spi_submit(), SPITransSuccess, spi_transaction::status, w5100_spi, and W5100_SPI_DEV.
Referenced by w5100_init(), w5100_set_buffer(), and w5100_sock_set().
Definition at line 144 of file w5100.c.
References w5100_set().
Referenced by configure_socket(), w5100_init(), and w5100_send().
Definition at line 157 of file w5100.c.
References CH_BASE, CH_SIZE, and w5100_get().
Referenced by w5100_send(), and w5100_sock_get16().
Definition at line 162 of file w5100.c.
References w5100_sock_get().
Referenced by w5100_receive(), w5100_rx_size(), and w5100_send().
Definition at line 152 of file w5100.c.
References CH_BASE, CH_SIZE, and w5100_set().
Referenced by configure_socket(), w5100_close_socket(), w5100_receive(), and w5100_send().
void w5100_transmit | ( | uint8_t | data | ) |
Definition at line 266 of file w5100.c.
References chip0, w5100_periph::curbuf, w5100_periph::tx_buf, w5100_periph::tx_extract_idx, w5100_periph::tx_insert_idx, and W5100_TX_BUFFER_SIZE.
Referenced by dev_transmit(), and w5100_transmit_buffer().
Definition at line 281 of file w5100.c.
References w5100_transmit().
Referenced by dev_transmit_buffer().
struct w5100_periph chip0 |
Definition at line 1 of file w5100.c.
Referenced by w5100_init(), w5100_send(), and w5100_transmit().
|
static |
Definition at line 99 of file w5100.c.
Referenced by image_convolution_3x3(), image_to_grayscale(), image_yuv422_colorfilt(), image_yuv422_downsample(), undistort_image_func(), and w5100_init().
|
static |
Definition at line 101 of file w5100.c.
Referenced by w5100_init().
|
static |
Definition at line 98 of file w5100.c.
Referenced by w5100_init().
|
static |
Definition at line 95 of file w5100.c.
Referenced by w5100_init().
Definition at line 106 of file w5100.c.
Referenced by w5100_init(), and w5100_read_data().
|
static |
Definition at line 108 of file w5100.c.
Referenced by w5100_init(), and w5100_read_data().
|
static |
Definition at line 103 of file w5100.c.
Referenced by w5100_init().
Definition at line 105 of file w5100.c.
Referenced by w5100_init(), and w5100_send().
|
static |
Definition at line 107 of file w5100.c.
Referenced by w5100_init(), and w5100_send().
|
static |
Definition at line 100 of file w5100.c.
Referenced by w5100_init().
uint8_t w5100_rx_buf[W5100_RX_BUFFER_SIZE] |
Definition at line 92 of file w5100.c.
Referenced by w5100_read_buffer().
struct spi_transaction w5100_spi |
Definition at line 108 of file w5100.c.
Referenced by w5100_get(), w5100_init(), and w5100_set().