blob: 05ce19ac3d0684f74a7385e9fa6825a427a17167 [file] [log] [blame]
Sylvain Munautbc9f5c42020-09-14 10:22:29 +02001/*
2 * e1.h
3 *
4 * Copyright (C) 2019-2020 Sylvain Munaut <tnt@246tNt.com>
5 * SPDX-License-Identifier: GPL-3.0-or-later
6 */
7
8#pragma once
9
10void e1_init(bool clk_mode);
11void e1_poll(void);
12void e1_debug_print(bool data);
13
Harald Welte6add0aa2020-12-16 00:02:11 +010014void e1_tx_config(uint16_t cr);
15void e1_rx_config(uint16_t cr);
16
Sylvain Munautbc9f5c42020-09-14 10:22:29 +020017volatile uint8_t *e1_data_ptr(int mf, int frame, int ts);
18unsigned int e1_data_ofs(int mf, int frame, int ts);
Harald Welte52765672020-12-15 18:35:42 +010019
20enum e1_platform_led {
21 E1P_LED_GREEN = 0,
22 E1P_LED_YELLOW = 1,
23};
24
25enum e1_platform_led_state {
26 E1P_LED_ST_OFF = 0,
27 E1P_LED_ST_ON = 1,
28 E1P_LED_ST_BLINK = 2,
29 E1P_LED_ST_BLINK_FAST = 3
30};
31
32/* external function provided by the platform; used by E1 driver to control LEDs */
33extern void e1_platform_led_set(uint8_t port, enum e1_platform_led led,
34 enum e1_platform_led_state state);