Go to the source code of this file.
Functions | |
void | kio_GetFWVersion (knet_dev_t *dev, unsigned int *version) |
int | kio_ReadAnalog (knet_dev_t *dev, unsigned int an, uint16_t *value, uint32_t *time) |
int | kio_ReadCAN (knet_dev_t *dev, uint32_t *id, char *len, uint32_t *can_data1, uint32_t *can_data2, char *can_status, uint32_t *time) |
int | kio_SendCAN (knet_dev_t *dev, uint32_t id, uint32_t can_data1, uint32_t can_data2, char len, char can_status) |
int | kio_SetANValue (knet_dev_t *dev, unsigned int an, unsigned int value) |
int | kio_ConfigIO (knet_dev_t *dev, unsigned io, unsigned config) |
int | kio_ReadIO (knet_dev_t *dev, unsigned int io) |
int | kio_SetIO (knet_dev_t *dev, unsigned int io) |
int | kio_ChangeLed (knet_dev_t *dev, unsigned state) |
int | kio_ChangeIO (knet_dev_t *dev, unsigned int io) |
int | kio_ClearIO (knet_dev_t *dev, unsigned int io) |
int | kio_ChangePWM_ratio (knet_dev_t *dev, unsigned int io, unsigned int ratio) |
int | kio_ChangePWM_freq (knet_dev_t *dev, uint16_t freq) |
int | kio_ChangePW (knet_dev_t *dev, unsigned int io) |
int | kio_SetPW (knet_dev_t *dev, unsigned int io) |
int | kio_ClearPW (knet_dev_t *dev, unsigned int io) |
int | kio_Timer (knet_dev_t *dev, unsigned action) |
void | kio_i2c_StartScan (knet_dev_t *dev) |
int | kio_i2c_ListScan (knet_dev_t *dev, char *list) |
void | kio_i2c_StartRead (knet_dev_t *dev, char device, char reg, char n_read) |
int | kio_i2c_ReturnRead (knet_dev_t *dev, char n_read, uint32_t *values) |
int | kio_i2c_Write (knet_dev_t *dev, char device, char reg, char txdata) |
Support for the KoreIO board.
Definition in file koreio.c.
int kio_ChangeIO | ( | knet_dev_t * | dev, | |
unsigned int | io | |||
) |
Change the state of a digital IO
dev | K-Net Device Descriptor to the KoreIO | |
io | the io to reset (0-15) |
Definition at line 406 of file koreio.c.
References KIO_IOChgBase, and knet_write8().
Referenced by changeio(), and main().
int kio_ChangeLed | ( | knet_dev_t * | dev, | |
unsigned | state | |||
) |
Change the state of the LED
dev | K-Net Device Descriptor to the KoreIO | |
state | The LED state is 0 to switch it off 1 to switch it on 2 to changed it |
Definition at line 381 of file koreio.c.
References KIO_IOChgLed, and knet_write8().
Referenced by changeled().
int kio_ChangePW | ( | knet_dev_t * | dev, | |
unsigned int | io | |||
) |
Change the state of a power output
dev | K-Net Device Descriptor to the KoreIO | |
io | the power output to set (0-6) |
Definition at line 501 of file koreio.c.
References KIO_PWChgBase, and knet_write8().
Referenced by changepw().
int kio_ChangePWM_freq | ( | knet_dev_t * | dev, | |
uint16_t | freq | |||
) |
Change PWM frequency
dev | K-Net Device Descriptor to the KoreIo | |
freq | Frequency of the PWM |
Definition at line 473 of file koreio.c.
References KIO_FreqBase, and knet_write8().
Referenced by main(), and setfreq().
int kio_ChangePWM_ratio | ( | knet_dev_t * | dev, | |
unsigned int | io, | |||
unsigned int | ratio | |||
) |
Change PWM channel ratio
dev | K-Net Device Descriptor to the KoreIo | |
io | the io to modify PWM ratio ratio the ratio value |
Definition at line 449 of file koreio.c.
References KIO_PWMRatio, and knet_write8().
Referenced by elbow(), finger(), gripper(), main(), motor(), rotate(), sequence(), setratio(), shoulder(), and wrist().
int kio_ClearIO | ( | knet_dev_t * | dev, | |
unsigned int | io | |||
) |
Set a digital IO state to 0
dev | K-Net Device Descriptor to the KoreIO | |
io | the io to reset (0-15) |
Definition at line 427 of file koreio.c.
References KIO_IOClearBase, and knet_write8().
Referenced by main(), and resetio().
int kio_ClearPW | ( | knet_dev_t * | dev, | |
unsigned int | io | |||
) |
Set a power output state to 0
dev | K-Net Device Descriptor to the KoreIO | |
io | the power output to reset (0-6) |
Definition at line 543 of file koreio.c.
References KIO_PWClearBase, and knet_write8().
Referenced by main(), and resetpw().
int kio_ConfigIO | ( | knet_dev_t * | dev, | |
unsigned | io, | |||
unsigned | config | |||
) |
Configure a digital IO to be used as an input, output or PWM ouput
dev | K-Net Device Descriptor to the KoreIO | |
io | the io to set (0-15) | |
config | the mode to set (0: input) (1: ouput) (2: pwm) |
Definition at line 296 of file koreio.c.
References KIO_IOConfigIn, KIO_IOConfigOut, KIO_IOConfigPwm, and knet_write8().
Referenced by configio(), and main().
void kio_GetFWVersion | ( | knet_dev_t * | dev, | |
unsigned int * | version | |||
) |
This function get the firmware version and revision number.
dev | K-Net Device Descriptor to the KoreIO | |
version | A pointer to a variable that will receive the firmware version number. |
Definition at line 41 of file koreio.c.
References KIO_FWVersion, and knet_read8().
Referenced by main().
int kio_i2c_ListScan | ( | knet_dev_t * | dev, | |
char * | list | |||
) |
Return the list of answering devices from a scan on the secondary I2C bus. The scan must be started using kio_i2c_StartScan.
dev | K-Net Device Descriptor to the KoreIO | |
list | A pointer to an array of characters to store the list. The array must be large enough to store all the addesses (up to 128bytes). |
Definition at line 602 of file koreio.c.
References KIO_I2C_ScanRead, KIO_I2CList, knet_lltransfer(), and knet_read8().
Referenced by listscan().
int kio_i2c_ReturnRead | ( | knet_dev_t * | dev, | |
char | n_read, | |||
uint32_t * | values | |||
) |
return the values of the previous I2C Read bus.
dev | K-Net Device Descriptor to the KoreIO | |
n_read | Number of returned values (max 4) | |
values | Pointer to store the returned values |
Definition at line 661 of file koreio.c.
References buf, KIO_I2CReturnRead, and knet_lltransfer().
Referenced by readi2c().
void kio_i2c_StartRead | ( | knet_dev_t * | dev, | |
char | device, | |||
char | reg, | |||
char | n_read | |||
) |
Start an register read on the secondary I2C bus.
dev | K-Net Device Descriptor to the KoreIO | |
device | Device address | |
reg | Device register address | |
n_read | Number of read (max 4) |
Definition at line 632 of file koreio.c.
References KIO_I2CReadBase, and knet_write8().
Referenced by readi2c().
void kio_i2c_StartScan | ( | knet_dev_t * | dev | ) |
Start an address scan on the secondary I2C bus.
dev | K-Net Device Descriptor to the KoreIO |
Definition at line 583 of file koreio.c.
References KIO_I2CScan, and knet_write8().
Referenced by startscan().
int kio_i2c_Write | ( | knet_dev_t * | dev, | |
char | device, | |||
char | reg, | |||
char | txdata | |||
) |
Write on the secondary I2C bus.
dev | K-Net Device Descriptor to the KoreIO | |
device | Device address | |
reg | Device register address | |
txdata | Data to write on device |
Definition at line 699 of file koreio.c.
References KIO_I2CWriteAddr, KIO_I2CWriteBase, and knet_write8().
Referenced by writei2c().
int kio_ReadAnalog | ( | knet_dev_t * | dev, | |
unsigned int | an, | |||
uint16_t * | value, | |||
uint32_t * | time | |||
) |
Read an Analog input level. The 10 bit value, as well as the corresponding timestamp are returned. The timestamp is given is mS since the last reset of the timer.
dev | K-Net Device Descriptor to the KoreIO | |
an | The analog input to read | |
value | Pointer to store the 10bit value from the A/D | |
time | Pointer to store the 32bit value of the timestamp |
Definition at line 67 of file koreio.c.
References buf, KIO_ANReadBase, and knet_read8().
Referenced by main(), and readad().
int kio_ReadCAN | ( | knet_dev_t * | dev, | |
uint32_t * | id, | |||
char * | len, | |||
uint32_t * | can_data1, | |||
uint32_t * | can_data2, | |||
char * | can_status, | |||
uint32_t * | time | |||
) |
Read the Can message and erase it. Return the number of other Can messages available.
dev | K-Net Device Descriptor to the KoreIO | |
id | Pointer to store the 32bit value of the identifier | |
len | Pointer to store the Data length of the message | |
can_data1 | Pointer to store the 4 Bytes high of Data | |
can_data2 | Pointer to store the 4 Bytes low of Data | |
status | Pointer to store the Status bits of the message | |
time | Pointer to store the 4 Bytes of the message timing |
Definition at line 123 of file koreio.c.
References buf, KIO_CANReadBase, KIO_ClearCAN, knet_lltransfer(), and knet_write8().
Referenced by readcan().
int kio_ReadIO | ( | knet_dev_t * | dev, | |
unsigned int | io | |||
) |
Read a digital IO state
dev | K-Net Device Descriptor to the KoreIO | |
io | the io to read (0-15) |
Definition at line 331 of file koreio.c.
References KIO_IOReadBase, and knet_read8().
Referenced by readio().
int kio_SendCAN | ( | knet_dev_t * | dev, | |
uint32_t | id, | |||
uint32_t | can_data1, | |||
uint32_t | can_data2, | |||
char | len, | |||
char | can_status | |||
) |
Send a CAN message on the CAN bus
dev | K-Net Device Descriptor to the KoreIO | |
id | Can identifier on 32 Bits | |
can_data1 | 4 Data high | |
can_data2 | 4 Data low | |
len | Number of Bytes to send on the Bus | |
status | Set the CAN control bits |
Definition at line 195 of file koreio.c.
References KIO_CANWriteBase, KIO_Status, knet_read8(), and knet_write8().
Referenced by can7seg(), and canled().
int kio_SetANValue | ( | knet_dev_t * | dev, | |
unsigned int | an, | |||
unsigned int | value | |||
) |
Change a analog output value
dev | K-Net Device Descriptor to the KoreIO | |
an | the output to set (0-7) | |
value | the analog value (0-255) |
Definition at line 265 of file koreio.c.
References KIO_ANWriteBase, and knet_write8().
Referenced by setad().
int kio_SetIO | ( | knet_dev_t * | dev, | |
unsigned int | io | |||
) |
Set a digital IO state to 1
dev | K-Net Device Descriptor to the KoreIO | |
io | the io to set (0-15) |
Definition at line 358 of file koreio.c.
References KIO_IOSetBase, and knet_write8().
Referenced by main(), and setio().
int kio_SetPW | ( | knet_dev_t * | dev, | |
unsigned int | io | |||
) |
Set a power output state to 1
dev | K-Net Device Descriptor to the KoreIO | |
io | the power output to set (0-6) |
Definition at line 522 of file koreio.c.
References KIO_PWSetBase, and knet_write8().
Referenced by main(), and setpw().
int kio_Timer | ( | knet_dev_t * | dev, | |
unsigned | action | |||
) |
Handle the koreio timer for analog measurements timestamp.
dev | K-Net Device Descriptor to the KoreIO | |
action | The action to perform with the timer 0: Reset the timer 1: Stop the timer 2: Launch the timer |
Definition at line 567 of file koreio.c.
References KIO_TimerBase, and knet_write8().
Referenced by timer().