OpenCores
URL https://opencores.org/ocsvn/hf-risc/hf-risc/trunk

Subversion Repositories hf-risc

[/] [hf-risc/] [trunk/] [software/] [app/] [exp_io.c] - Blame information for rev 13

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 13 serginhofr
#include <hf-risc.h>
2
#include <mcp23s17.h>
3
 
4
int main(void){
5
        uint8_t a, b;
6
 
7
        mcp23s17_init(0, ALL_OUTPUTS, ALL_OUTPUTS);
8
        mcp23s17_dir(0, 0, ALL_INPUTS);
9
        mcp23s17_dir(0, 1, ALL_INPUTS);
10
        a = mcp23s17_read(0, 0);
11
        b = mcp23s17_read(0, 1);
12
        mcp23s17_dir(0, 0, ALL_OUTPUTS);
13
        mcp23s17_dir(0, 1, ALL_OUTPUTS);
14
        mcp23s17_write(0, 0, 0xff);
15
        mcp23s17_write(0, 1, 0xff);
16
 
17
        return 0;
18
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.