#include "dev.h"
Go to the source code of this file.
Defines | |
| #define | RLY1 23 |
| address all replays | |
| #define | RLY2 22 |
| #define | RLY3 21 |
| #define | RLY4 20 |
| #define | RLY5 19 |
| #define | RLY_NC3 18 |
| #define | RLY_NC2 17 |
| #define | RLY_NC1 16 |
| #define | LD5_A 15 |
| address all LEDS | |
| #define | LD5_B 14 |
| #define | LD6_A 13 |
| #define | LD6_B 12 |
| #define | LD7_A 11 |
| #define | LD7_B 10 |
| #define | LD8_A 9 |
| #define | LD8_B 8 |
| #define | LD1_A 7 |
| #define | LD1_B 6 |
| #define | LD2_A 5 |
| #define | LD2_B 4 |
| #define | LD3_A 3 |
| #define | LD3_B 2 |
| #define | LD4_A 1 |
| #define | LD4_B 0 |
| #define | LED_PWR LD1_A |
| #define | I2C_RTC 0x68 |
| address of the real time clock | |
Typedefs | |
| typedef byte(* | t_portb_handler )(byte) |
| A Handler function. | |
Functions | |
| void | IOR_Update (void) |
| Update the IOR board. | |
| void | LED_On (unsigned nbr) |
| Turn an led on. | |
| void | LED_Off (unsigned nbr) |
| Turn an led off. | |
| void | Set_LEDS (unsigned p) |
| set all leds. | |
| void | Relay_On (unsigned nbr) |
| Turn a realy on. | |
| void | Relay_Off (unsigned nbr) |
| Turn a relay off. | |
| void | get_time (byte *h, byte *m, byte *s) |
| get the current time from the real time clock. | |
| void | get_date (byte *y, byte *m, byte *d) |
| get the date | |
Variables | |
| t_portb_handler | portb_interrupt |
| __code t_dev | output_handler |
| device handler for output hardware like led's and relays. | |
| __code t_dev | portb_handler |
| device handler for the input port | |
The IO borad provides 16 LED's, 5 relays, digital io's and analog inputs and an onboard realtime clock with backup battery.
LED Array IO Ports
1 2 3 4 5 6 7 9 Analog in Relay
B X X X X X X X X 1 2 3 4 5 1 2 3 4
A X X X X X X X X \---------/ \-------/
X5 X1
The relays are addressed by the definitions RLYx where x=1,2,3,4.
The board is self is connected via the I2C bus and the port A, B, C to the main board. LED's and relays are controlled via a shift register which is connected to port C.
Bit 0 1 2 3 4 5 6 7
X5 3 4 5 6 8 7
\----------------/
Analog in
Port B:
Bit 0 1 2 3 4 5 6 7
SDA SCL 5/6 7/8 9/10 11/12 LED RST
\------/ \------------------/ \-------/
I2C IOR5e X2 connector SBC44UC
Input Outp/Inp.
Port C is used ot control the 74HC595 shitf register which is used to control the Relays and the LED's. There components are controlled via a shift register. Port C is used to generate the input for the shift registers.
Port C:
Bit 0 1 2 3 4 5 6 7
DS SH_CP ST_CP NOT_OE
The ior5e module maintains an internal view of the status for each bit in the shift register, which means calling the method LED_On sets only the bit in the internal view. Only the Update_IOR method does the actual transmission to the IOR5e board.
LDx_B 1 2 3 4 5 6 7 8
X X X X X X X X <-- used by application
PWR IDL ERR N N N N N <-- used by kernel
PWR (Power) - Power on reset done
IDL (Alive) - Flashing activity indication of the idle task
ERR (Process_Error) - Watchdog reset occured.
Definition in file ior5e.h.
|
||||||||||||||||
|
get the current time from the real time clock.
|
|
|
Update the IOR board. This message updates all LED and Relay bits according the the latest status. |
|
|
Turn an led off.
|
|
|
Turn an led on.
|
|
|
Turn a relay off. IOR_Update needs to be called in order to update the hardware.
|
|
|
Turn a realy on. IOR Update is needed to update the hardware.
|
1.4.6