ccNOos  v0.0.0
Build Portable Microcontroller Applications!
Data Structures | Enumerations | Functions
io_device.h File Reference

IMS: ccNOos, Declarations for straight C and C++ More...

#include "version_config.h"
Include dependency graph for io_device.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

union  devicebufferunion
 char/byte ambiguous container for io data More...
 
struct  devicedatastruct
 the common data struct of io devices More...
 
struct  SPIDeviceStruct
 
struct  SerialDeviceStruct
 
struct  ioDeviceStruct
 

Enumerations

enum  devicestateenum {
  devstate_init = 0, devstate_opening = 1, devstate_open = 2, devstate_reading = 3,
  devstate_readdone = 4, devstate_writing = 5, devstate_writedone = 6
}
 Generic IO Device. More...
 
enum  SPITypes { SPIType_one, SPIType_two, SPIType_three, SPIType_four }
 SPI IO Device. More...
 
enum  portStopBitsEnum { stop_none = 0, stop_one = 1, stop_two = 2, stop_onepointfive = 3 }
 Serial UART IO Device. More...
 
enum  portParityEnum {
  parity_none = 0, parity_even = 1, parity_odd = 2, parity_mark = 3,
  parity_space = 4
}
 
enum  portHandshakeEnum { handshake_none = 0, handshake_requesttosend = 1, handshake_requesttosendxonxoff = 2, handshake_xonxoff = 3 }
 

Functions

struct devicedatastruct createDeviceStruct ()
 

Detailed Description

IMS: ccNOos, Declarations for straight C and C++

Copyright 2021 InMechaSol, Inc

Licensed under the Apache License, Version 2.0(the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Notes: (.c includes .h) - for straight C or (.cpp includes .c which includes .h) - for C++ wrapped straight C Always compiled to a single compilation unit, either C or CPP, not both

Definition in file io_device.h.

Enumeration Type Documentation

◆ devicestateenum

Generic IO Device.

enumerates states of the io device

Enumerator
devstate_init 
devstate_opening 
devstate_open 
devstate_reading 
devstate_readdone 
devstate_writing 
devstate_writedone 

Definition at line 40 of file io_device.h.

41 {
42  devstate_init = 0,
43  devstate_opening = 1,
44  devstate_open = 2,
45  devstate_reading = 3,
47  devstate_writing = 5,
49 };

◆ portHandshakeEnum

Enumerator
handshake_none 
handshake_requesttosend 
handshake_requesttosendxonxoff 
handshake_xonxoff 

Definition at line 107 of file io_device.h.

108 {
109  handshake_none = 0,
113 };

◆ portParityEnum

Enumerator
parity_none 
parity_even 
parity_odd 
parity_mark 
parity_space 

Definition at line 99 of file io_device.h.

100 {
101  parity_none = 0,
102  parity_even = 1,
103  parity_odd = 2,
104  parity_mark = 3,
105  parity_space = 4
106 };

◆ portStopBitsEnum

Serial UART IO Device.

Enumerator
stop_none 
stop_one 
stop_two 
stop_onepointfive 

Definition at line 92 of file io_device.h.

93 {
94  stop_none = 0,
95  stop_one = 1,
96  stop_two = 2,
98 };

◆ SPITypes

enum SPITypes

SPI IO Device.

Enumerator
SPIType_one 
SPIType_two 
SPIType_three 
SPIType_four 

Definition at line 74 of file io_device.h.

75 {
80 };

Function Documentation

◆ createDeviceStruct()

struct devicedatastruct createDeviceStruct ( )

Definition at line 1 of file io_device.c.

32 {
33  struct devicedatastruct outstruct;
34  outstruct.devstate = devstate_init;
35  outstruct.newDataReadIn = ui8FALSE;
36  outstruct.triggerWriteOperation = ui8FALSE;
37  outstruct.inbuff.charbuff[0] = 0x00;
38  outstruct.outbuff.charbuff[0] = 0x00;
39  return outstruct;
40 }
devstate_readdone
@ devstate_readdone
Definition: io_device.h:46
handshake_none
@ handshake_none
Definition: io_device.h:109
devstate_writing
@ devstate_writing
Definition: io_device.h:47
handshake_xonxoff
@ handshake_xonxoff
Definition: io_device.h:112
SPIType_three
@ SPIType_three
Definition: io_device.h:78
stop_onepointfive
@ stop_onepointfive
Definition: io_device.h:97
handshake_requesttosendxonxoff
@ handshake_requesttosendxonxoff
Definition: io_device.h:111
handshake_requesttosend
@ handshake_requesttosend
Definition: io_device.h:110
ui8FALSE
#define ui8FALSE
Definition: version_config.h:190
devstate_opening
@ devstate_opening
Definition: io_device.h:43
parity_space
@ parity_space
Definition: io_device.h:105
devicedatastruct::devstate
enum devicestateenum devstate
Definition: io_device.h:65
devstate_reading
@ devstate_reading
Definition: io_device.h:45
devstate_init
@ devstate_init
Definition: io_device.h:42
parity_mark
@ parity_mark
Definition: io_device.h:104
SPIType_one
@ SPIType_one
Definition: io_device.h:76
parity_none
@ parity_none
Definition: io_device.h:101
devstate_writedone
@ devstate_writedone
Definition: io_device.h:48
SPIType_two
@ SPIType_two
Definition: io_device.h:77
stop_none
@ stop_none
Definition: io_device.h:94
stop_one
@ stop_one
Definition: io_device.h:95
stop_two
@ stop_two
Definition: io_device.h:96
parity_even
@ parity_even
Definition: io_device.h:102
SPIType_four
@ SPIType_four
Definition: io_device.h:79
devicedatastruct
the common data struct of io devices
Definition: io_device.h:62
devstate_open
@ devstate_open
Definition: io_device.h:44
parity_odd
@ parity_odd
Definition: io_device.h:103