CryptoAuthLib
Microchip CryptoAuthentication Library
hal_pic32mx695f512h_i2c.h
Go to the documentation of this file.
1 
33 #ifndef HAL_PIC32MX695F512H_I2C_ASF_H_
34 #define HAL_PIC32MX695F512H_I2C_ASF_H_
35 
36 
45 // Clock Constants
46 #define GetSystemClock() (80000000ul)
47 #define GetPeripheralClock() (GetSystemClock() / (1 << OSCCONbits.PBDIV))
48 #define GetInstructionClock() (GetSystemClock())
49 
50 #define MAX_I2C_BUSES 4 // PIC32MX695F512H has 4 TWI
51 
55 typedef struct atcaI2Cmaster
56 {
57  I2C_MODULE id;
58  int ref_ct;
59  // for conveniences during interface release phase
60  int bus_index;
62 
63 void i2c_write(I2C_MODULE i2c_id, uint8_t address, uint8_t *data, int len);
64 ATCA_STATUS i2c_read(I2C_MODULE i2c_id, uint8_t address, uint8_t *data, uint16_t len);
65 
66 void change_i2c_speed(ATCAIface iface, uint32_t speed);
67 
70 #endif /* HAL_PIC32MX695F512H_I2C_ASF_H_ */
ATCA_STATUS
Definition: atca_status.h:41
void i2c_write(I2C_MODULE i2c_id, uint8_t address, uint8_t *data, int len)
Definition: hal_pic32mx695f512h_i2c.c:188
int ref_ct
Definition: hal_at90usb1287_i2c_asf.h:52
void change_i2c_speed(ATCAIface iface, uint32_t speed)
method to change the bus speed of I2C
Definition: hal_at90usb1287_i2c_asf.c:374
int speed
Definition: hal_linux_kit_cdc.c:61
int bus_index
for conveniences during interface release phase
Definition: hal_at90usb1287_i2c_asf.h:53
I2C_MODULE id
Definition: hal_pic32mx695f512h_i2c.h:57
atca_iface is the C object backing ATCAIface. See the atca_iface.h file for details on the ATCAIface ...
Definition: atca_iface.h:129
ATCA_STATUS i2c_read(I2C_MODULE i2c_id, uint8_t address, uint8_t *data, uint16_t len)
Definition: hal_pic32mx695f512h_i2c.c:211
this is the hal_data for ATCA HAL created using ASF
Definition: hal_at90usb1287_i2c_asf.h:49
struct atcaI2Cmaster ATCAI2CMaster_t
this is the hal_data for ATCA HAL