Subversion Repositories Projects

Rev

Rev 728 | Rev 762 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 728 Rev 761
Line 20... Line 20...
20
 
20
 
21
/*
21
/*
22
 * structs 'n union for easy SPI transfer
22
 * structs 'n union for easy SPI transfer
23
 */
23
 */
24
typedef struct {
24
typedef struct {
25
        int16_t ampere;
25
    int16_t ampere;
26
        int32_t mah;
26
    int32_t mah;
27
        int16_t volt;
27
    int16_t volt;
28
} __attribute__((packed)) SPI_strom_data_t;
28
} __attribute__((packed)) SPI_strom_data_t;
29
 
29
 
30
typedef struct {
30
typedef struct {
31
        uint8_t c[10];
31
    uint8_t c[10];
32
        uint8_t chk;
32
    uint8_t chk;
33
} __attribute__((packed)) SPI_char_buffer_t;
33
} __attribute__((packed)) SPI_char_buffer_t;
34
 
34
 
35
union SPI_buffer_t {
35
union SPI_buffer_t {
36
  SPI_strom_data_t data;
36
    SPI_strom_data_t data;
37
  SPI_char_buffer_t buffer;
37
    SPI_char_buffer_t buffer;
38
};
38
};
39
 
39
 
40
volatile union SPI_buffer_t SPI_buffer;
40
volatile union SPI_buffer_t SPI_buffer;
41
 
41
 
42
/**
42
/**