I2Cwrapper v0.4.0
Generic framework for Arduino I2C target devices
PinI2C_firmware.h File Reference

Firmware module for the I2Cwrapper firmare. More...

Detailed Description

Firmware module for the I2Cwrapper firmare.

Provides access to the target's analog and digital input and output pins. Mimicks the standard Arduino functions like pinMode(), digitalRead(), etc.

Author

Copyright (c) 2022 juh

License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.

Functions

 log ("PinI2C module enabled.\n")
 
bufferIn read (pin)
 
bufferIn read (mode)
 
 log ("pinMode(")
 
 log (pin)
 
 log (", ")
 
 log (mode)
 
 log (")\n\n")
 
 pinMode (pin, mode)
 
bufferOut write ((int16_t) digitalRead(pin))
 
bufferIn read (value)
 
 digitalWrite (pin, value)
 
bufferOut write ((int16_t) analogRead(pin))
 
 analogWrite (pin, value)
 
 for (uint8_t i=0;i< numUsedPins;i++)
 

Variables

uint8_t usedPins [NUM_DIGITAL_PINS] = pin
 
uint8_t numUsedPins = 0
 
case pinPinModeCmd
 
uint8_t mode
 
 break
 
case pinDigitalReadCmd
 
case pinDigitalWriteCmd
 
uint8_t value = 0
 
case pinAnalogReadCmd
 
case pinAnalogWriteCmd
 

Function Documentation

◆ analogWrite()

analogWrite ( pin  ,
value   
)

◆ digitalWrite()

digitalWrite ( pin  ,
value   
)

◆ for()

for ( )

◆ log() [1/6]

log ( )

◆ log() [2/6]

log ( ,
 
)

◆ log() [3/6]

log ( "PinI2C module enabled.\n"  )

◆ log() [4/6]

log ( )

◆ log() [5/6]

log ( mode  )

◆ log() [6/6]

log ( pin  )

◆ pinMode()

pinMode ( pin  ,
mode   
)

◆ read() [1/3]

bufferIn read ( mode  )

◆ read() [2/3]

bufferIn read ( pin  )

◆ read() [3/3]

bufferIn read ( value  )

◆ write() [1/2]

bufferOut write ( (int16_t) analogRead(pin)  )

◆ write() [2/2]

bufferOut write ( (int16_t) digitalRead(pin)  )

Variable Documentation

◆ break

break

◆ mode

uint8_t mode

◆ numUsedPins

numUsedPins = 0

◆ pinAnalogReadCmd

case pinAnalogReadCmd

◆ pinAnalogWriteCmd

case pinAnalogWriteCmd

◆ pinDigitalReadCmd

case pinDigitalReadCmd

◆ pinDigitalWriteCmd

case pinDigitalWriteCmd

◆ pinPinModeCmd

case pinPinModeCmd

◆ usedPins

usedPins[numUsedPins++] = pin

◆ value

int16_t value = 0