Skip to content

Commit

Permalink
Moving macros to source files, linking to PDU implemnetation
Browse files Browse the repository at this point in the history
  • Loading branch information
nwdepatie committed Nov 23, 2023
1 parent c2ea04a commit 9a31269
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
13 changes: 0 additions & 13 deletions general/include/pi4ioe.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,6 @@
#include "stm32f4xx_hal.h"
#include "stm32f4xx_hal_i2c.h"

// all of these addresses are complete bullshit and wrong plz fix when know :) and remove this comment
// the values should be correct though, just the order is wrong

#define PI4IOE_I2C_ADDR 0x20 //? @hamza does HAL driver handle shifting for read/write bit automatically? if not should be added here

#define IO_CONFIG_REG 0x06
#define IO_CONFIG_BUF 0x10 /* = 0001 0000, bit 4 = TSMS = input */
#define INPUT0_REG 0x00
#define INPUT1_REG 0x01
#define OUTPUT0_REG 0x02
#define OUTPUT1_REG 0x03


typedef struct
{
I2C_HandleTypeDef *i2c_handle;
Expand Down
12 changes: 12 additions & 0 deletions general/src/pi4ioe.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@
*/
#include "pi4ioe.h"

// all of these addresses are complete bullshit and wrong plz fix when know :) and remove this comment
// the values should be correct though, just the order is wrong

#define PI4IOE_I2C_ADDR 0x20 //? @hamza does HAL driver handle shifting for read/write bit automatically? if not should be added here

#define IO_CONFIG_REG 0x06
#define IO_CONFIG_BUF 0x10 /* = 0001 0000, bit 4 = TSMS = input */
#define INPUT0_REG 0x00
#define INPUT1_REG 0x01
#define OUTPUT0_REG 0x02
#define OUTPUT1_REG 0x03

uint8_t oreg_1_data;
uint8_t oreg_2_data;

Expand Down

0 comments on commit 9a31269

Please sign in to comment.