atMETEO
An ATmega based weather station
wiznet.h
1 /*
2  * atMETEO - An ATmega based weather station
3  * Copyright (C) 2014-2015 Christian Fetzer
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #pragma once
21 
22 #include <inttypes.h> // AVR toolchain doesn't offer cinttypes header
23 
24 #include "lib/utils.h"
25 
26 #include "pin.h"
27 #include "spi.h"
28 #include "ethernet.h"
29 
30 namespace Avr
31 {
32 
42 class Wiznet
43 {
44 protected:
45  Wiznet(MacAddress mac, IpAddress ip, IpAddress subnet);
46 
47  bool internalSendUdpMessage(IpAddress dest, uint16_t port,
48  const char *message);
49 
50 private:
51  static void chipselect()
52  {
54  }
55 
56  static void chipdeselect()
57  {
59  }
60 
61  static uint8_t read()
62  {
64  }
65 
66  static void write(uint8_t byte)
67  {
69  }
70 };
71 
72 } // namespace Avr
void transmit(uint8_t value)
Sends the byte value over SPI.
Definition: spi.h:116
static Spi & instance()
Returns the Avr::Spi instance.
Definition: spi.h:79
void select()
Signals chip select to slave.
Definition: spi.h:87
Represents an Ethernet MAC address.
Definition: ethernet.h:53
uint8_t receive()
Receives a byte over SPI.
Definition: spi.h:125
Bit manipulation utilities.
Wrapper for accessing built-in SPI communication interface.
Namespace containing all symbols of the AVR C++ utilities library.
Definition: adc.h:48
Utilities for Ethernet communication interfaces.
Avr::Ethernet driver for WIZnet Ethernet modules (W5100, W5200, W5300, W5500).
Definition: wiznet.h:42
void deselect()
Signals chip deselect to slave.
Definition: spi.h:95
Represents an IPv4 address.
Definition: ethernet.h:88
Wrapper for accessing digital I/O ports.