Serial Wombat 18AB Firmware
Classes | Typedefs | Functions
i2cController.c File Reference
#include "serialWombat.h"
#include <stdint.h>
#include "pic24fj256ga702/mcc_generated_files/mcc.h"
#include "pic24fj256ga702/mcc_generated_files/i2c2Controller.h"

Classes

struct  i2cController_n
 

Typedefs

typedef struct i2cController_n i2cController_t
 

Functions

void initi2cController (void)
 
void updatei2cController ()
 The function that updates I2CController. More...
 

Typedef Documentation

◆ i2cController_t

Function Documentation

◆ initi2cController()

void initi2cController ( void  )
\brief Initialization routine for High Speed Clock

CONFIGURE_CHANNEL_MODE_0:

Initialize High Speed Clock Output

BYTE 0 BYTE 1 BYTE 2 BYTE 3 BYTE 4 BYTE 5 BYTE 6 BYTE 7
0xC0 Pin To Set (TO HS Clock) 0x1D (HS Clock ) Frequency LSB Frequency MidLB Frequency MidHB Frequency MSB 0x55

Frequency : Desired output frequency

Response:

Command is returned with frequency set to the hardware (due to integer round off error). Actual output may vary up to an additional 2% due to internal oscillator variation.

Examples:

Set pin 19 to HS Clock, 1 MHz (0x000F4240)

0xC0 0x13 0x1D 0x40 0x42 0x0F 0x00 0x55


CONFIGURE_CHANNEL_MODE_19:

Disable High Speed Clock Output. Turns off Clock generation output, and makes the pin Digital out low.

BYTE 0 BYTE 1 BYTE 2 BYTE 3 BYTE 4 BYTE 5 BYTE 6 BYTE 7
0xC0 Pin To Set (TO HS Clock) 0x1D (HS Clock ) 0x55 0x55 0x55 0x55 0x55

Response:

Echoed back

Examples:

Disable pin 19 HS Clock

0xDB 0x13 0x1D 0x55 0x55 0x55 0x55 0x55


◆ updatei2cController()

void updatei2cController ( )

The function that updates I2CController.