37#define APB_MISC_BASE 0x70000000
38#define MISC 0x00100000
39#define APB_MISC_GP_HIDREV_0 0x804
40#define MISCREG_HIDREV_0 0x4
44#define base_CNF 0x6000d000
45#define base_PINMUX 0x70003000
46#define base_CFG 0x70000000
50#define base_PWM 0x7000a000
57#define CLK_RST_CONTROLLER_CLK_OUT_ENB_L_0 0x10
58#define CLK_RST_CONTROLLER_CLK_OUT_ENB_H_0 0x14
59#define CLK_RST_CONTROLLER_RST_DEVICES_H_0 0x8
60#define CLK_RST_CONTROLLER_CLK_SOURCE_SPI2_0 0x118
61#define CLK_RST_CONTROLLER_CLK_SOURCE_SPI1_0 0x134
62#define CLK_RST_CONTROLLER_CLK_ENB_L_SET_0 0x320
66#define base_PMC 0x7000e000
67#define APBDEV_PMC_PWR_DET_VAL_0 0xe4
68#define APBDEV_PMC_PWR_DET_0 0x48
69#define APBDEV_PMC_PWR_DET_LATCH_0 0x4c
104#define PINMUX_3 0x0c8
105#define PINMUX_5 0x0c4
106#define PINMUX_7 0x180
107#define PINMUX_8 0x0f4
108#define PINMUX_10 0x0f8
109#define PINMUX_11 0x0fc
110#define PINMUX_12 0x150
111#define PINMUX_13 0x06c
112#define PINMUX_15 0x1f8
113#define PINMUX_16 0x074
114#define PINMUX_18 0x070
115#define PINMUX_19 0x050
116#define PINMUX_21 0x054
117#define PINMUX_22 0x068
118#define PINMUX_23 0x058
119#define PINMUX_24 0x05c
120#define PINMUX_26 0x060
121#define PINMUX_27 0x0c0
122#define PINMUX_28 0x0bc
123#define PINMUX_29 0x1e4
124#define PINMUX_31 0x27c
125#define PINMUX_32 0x1fc
126#define PINMUX_33 0x248
127#define PINMUX_35 0x144
128#define PINMUX_36 0x100
129#define PINMUX_37 0x064
130#define PINMUX_38 0x148
131#define PINMUX_40 0x14c
166#define PINMUX_IN 0x00000040
167#define PINMUX_OUT 0x00000440
168#define PINMUX_OUT1 0x0000e240
169#define CFG_IN 0x00000000
170#define CFG_OUT 0x01F1F000
171#define CFG_OUT1 0xF0000000
175#define base_CNF_AON 0x0c2f1000
176#define base_CNF_NAON 0x02210000
177#define Pinmux_AON 0x0c302000
178#define Pinmux_AONHV 0x0c303000
179#define Pinmux_G7 0x02448000
180#define Pinmux_G3 0x02430000
181#define Pinmux_EDP 0x02440000
182#define Pinmux_G4 0x02434000
183#define Pinmux_G2 0x0243d000
187#define base_PWM1 0x03280000
188#define base_PWM5 0x032c0000
189#define base_PWM7 0x032e0000
190#define base_PWM8 0x032f0000
196#define CNFO_7 0x002c0
197#define CNFO_8 0x02840
198#define CNFO_10 0x02860
199#define CNFO_11 0x02880
200#define CNFO_12 0x042e0
201#define CNFO_13 0x01200
202#define CNFO_15 0x02220
203#define CNFO_16 0x01280
204#define CNFO_18 0x01260
205#define CNFO_19 0x014a0
206#define CNFO_21 0x01480
207#define CNFO_22 0x01220
208#define CNFO_23 0x01460
209#define CNFO_24 0x014c0
210#define CNFO_26 0x014e0
211#define CNFO_27 0x0600
212#define CNFO_28 0x04e0
213#define CNFO_29 0x026a0
214#define CNFO_31 0x026c0
215#define CNFO_32 0x040c0
216#define CNFO_33 0x04200
217#define CNFO_35 0x04440
218#define CNFO_36 0x028a0
219#define CNFO_37 0x01240
220#define CNFO_38 0x04420
221#define CNFO_40 0x04400
225#define PINMUXO_3 0x18
226#define PINMUXO_5 0x20
227#define PINMUXO_7 0x30
228#define PINMUXO_8 0xa8
229#define PINMUXO_10 0xa0
230#define PINMUXO_11 0x98
231#define PINMUXO_12 0x88
232#define PINMUXO_13 0x30
233#define PINMUXO_15 0x20
234#define PINMUXO_16 0x20
235#define PINMUXO_18 0x10
236#define PINMUXO_19 0x40
237#define PINMUXO_21 0x18
238#define PINMUXO_22 0x0
239#define PINMUXO_23 0x28
240#define PINMUXO_24 0x8
241#define PINMUXO_26 0x38
242#define PINMUXO_27 0x40
243#define PINMUXO_28 0x30
244#define PINMUXO_29 0x68
245#define PINMUXO_31 0x70
246#define PINMUXO_32 0x80
247#define PINMUXO_33 0X40
248#define PINMUXO_35 0xa0
249#define PINMUXO_36 0x90
250#define PINMUXO_37 0x48
251#define PINMUXO_38 0x98
252#define PINMUXO_40 0x90
287#define CNFOX_7 0x026c0
288#define CNFOX_13 0x02800
289#define CNFOX_16 0x0a20
290#define CNFOX_18 0x04200
291#define CNFOX_22 0x02480
292#define CNFOX_29 0x0820
293#define CNFOX_31 0x0800
294#define CNFOX_32 0x0a00
295#define CNFOX_33 0x0840
296#define CNFOX_37 0x0860
300#define PINMUXOX_7 0x70
301#define PINMUXOX_13 0x80
302#define PINMUXOX_16 0x48
303#define PINMUXOX_18 0x40
304#define PINMUXOX_22 0x20
305#define PINMUXOX_29 0x18
306#define PINMUXOX_31 0x10
307#define PINMUXOX_32 0x40
308#define PINMUXOX_33 0X0
309#define PINMUXOX_37 0x8
326#define CNFO_IN 0x00000001
327#define CNFO_OUT 0x00000003
328#define PINMUXO_IN 0x00000040
329#define PINMUXO_IN1 0x00000041
330#define PINMUXO_OUT 0x00000040
331#define PINMUXO_OUT1 0x00000060
332#define CFGO_IN 0x00000000
333#define CFGO_OUT 0x01f1f000
337#define base_CNF_xavier_AON 0x0c2f1000
338#define base_CNF_xavier_NAON 0x02210000
339#define Pinmux_xavier_AON 0x0c302000
340#define Pinmux_xavier_Audio 0x02431000
341#define Pinmux_xavier_CAM 0x02430000
342#define Pinmux_xavier_UART 0x0243d000
343#define Pinmux_xavier_EDP 0x02440000
347#define base_xavier_PWM1 0x03280000
348#define base_xavier_PWM8 0x032f0000
352#define CNFX_7 0x03680
353#define CNFX_8 0x02e40
354#define CNFX_10 0x02e60
355#define CNFX_11 0x02e80
356#define CNFX_12 0x038a0
357#define CNFX_13 0x02200
358#define CNFX_15 0x00280
359#define CNFX_16 0x02280
360#define CNFX_18 0x02260
361#define CNFX_19 0x024a0
362#define CNFX_21 0x02480
363#define CNFX_22 0x02220
364#define CNFX_23 0x02460
365#define CNFX_24 0x024c0
366#define CNFX_26 0x024e0
367#define CNFX_27 0x00400
368#define CNFX_28 0x002e0
369#define CNFX_29 0x02ca0
370#define CNFX_31 0x02cc0
371#define CNFX_32 0x02e00
372#define CNFX_33 0x02820
373#define CNFX_35 0x03a00
374#define CNFX_36 0x02ea0
375#define CNFX_37 0x02240
376#define CNFX_38 0x038e0
377#define CNFX_40 0x038c0
381#define PINMUXX_3 0x18
382#define PINMUXX_5 0x20
383#define PINMUXX_7 0x20
384#define PINMUXX_8 0xa8
385#define PINMUXX_10 0xa0
386#define PINMUXX_11 0x98
387#define PINMUXX_12 0x80
388#define PINMUXX_13 0x48
389#define PINMUXX_15 0x00
390#define PINMUXX_16 0x28
391#define PINMUXX_18 0x18
392#define PINMUXX_19 0x58
393#define PINMUXX_21 0x20
394#define PINMUXX_22 0x08
395#define PINMUXX_23 0x40
396#define PINMUXX_24 0x10
397#define PINMUXX_26 0x50
398#define PINMUXX_27 0x40
399#define PINMUXX_28 0x30
400#define PINMUXX_29 0x28
401#define PINMUXX_31 0x30
402#define PINMUXX_32 0x40
403#define PINMUXX_33 0X20
404#define PINMUXX_35 0x68
405#define PINMUXX_36 0x90
406#define PINMUXX_37 0x60
407#define PINMUXX_38 0x70
408#define PINMUXX_40 0x78
456#define FALLING_EDGE 2
462#define I2C_RESERVED 1
468#define SPI_RESERVED 1
538 uint32_t gpio_offset;
544typedef ISRFunc *PISRFunc;
622int gpioWrite(
unsigned gpio,
unsigned level);
633int gpioSetISRFunc(
unsigned gpio,
unsigned edge,
unsigned debounce,
unsigned long *timestamp,
void (*f)());
659int gpioPWM(
unsigned gpio,
unsigned dutycycle);
671int i2cOpen(
unsigned i2cBus,
unsigned i2cFlags);
695int i2cWriteByteData(
unsigned handle,
unsigned i2cAddr,
unsigned i2cReg,
unsigned bVal);
708int i2cReadByteData(
unsigned handle,
unsigned i2cAddr,
unsigned i2cReg);
719int i2cWriteWordData(
unsigned handle,
unsigned i2cAddr,
unsigned i2cReg,
unsigned wVal);
732int i2cReadWordData(
unsigned handle,
unsigned i2cAddr,
unsigned i2cReg);
743int spiOpen(
unsigned spiChan,
unsigned speed,
unsigned mode,
unsigned cs_delay,
unsigned bits_word,
unsigned lsb_first,
unsigned cs_change);
784int spiXfer(
unsigned handle,
char *txBuf,
char *rxBuf,
unsigned len);
int gpioWrite(unsigned gpio, unsigned level)
Sets the GPIO level, on or off. Arduino style: digitalWrite.
Definition: nano.c:1521
int spiOpen(unsigned spiChan, unsigned speed, unsigned mode, unsigned cs_delay, unsigned bits_word, unsigned lsb_first, unsigned cs_change)
This function returns a handle for the SPI device on the channel. Data will be transferred at baud bi...
Definition: nano.c:2389
void gpioTerminate(void)
Terminates the library. This function restores the used registers to their previous state and release...
Definition: nano.c:701
int i2cReadWordData(unsigned handle, unsigned i2cAddr, unsigned i2cReg)
This reads two bytes from the specified consecutive register(s) of the device associated with handle.
Definition: nano.c:2344
int extPeripheralDisable(unsigned clk_name)
Orin family only. This functions disables one of the external peripheral clocks. There are 2 (pins 29...
Definition: orin.c:2837
int i2cWriteByteData(unsigned handle, unsigned i2cAddr, unsigned i2cReg, unsigned bVal)
This writes a single byte to the specified register of the device associated with handle.
Definition: nano.c:2199
int extPeripheralRate(unsigned clk_name, unsigned rate)
Orin family only. This functions changes the rate of one of the external peripheral clocks....
Definition: orin.c:2768
int gpioRead(unsigned gpio)
Reads the GPIO level, on or off, 0 or 1. Arduino style: digitalRead. Wheter a pin has been set as inp...
Definition: nano.c:1424
int gpioInitialise(void)
Initialises the library. gpioInitialise must be called before using the other library functions,...
Definition: nano.c:185
int gpioPWM(unsigned gpio, unsigned dutycycle)
Starts PWM on the GPIO, dutycycle between 0 (off) and range (fully on). Arduino style: analogWrite.
Definition: nano.c:2048
int spiXfer(unsigned handle, char *txBuf, char *rxBuf, unsigned len)
This function transfers len bytes of data from txBuf to the SPI device associated with the handle....
Definition: nano.c:2569
int gpioSetPWMfrequency(unsigned gpio, unsigned frequency)
Sets the frequency in hertz to be used for the GPIO.
Definition: nano.c:2022
int i2cWriteWordData(unsigned handle, unsigned i2cAddr, unsigned i2cReg, unsigned wVal)
This writes two bytes to the specified consecutive register(s) of the device associated with handle.
Definition: nano.c:2294
int spiClose(unsigned handle)
This functions closes the SPI device identified by the handle.
Definition: nano.c:2547
int i2cClose(unsigned handle)
This closes the I2C device associated with the handle.
Definition: nano.c:2172
int i2cOpen(unsigned i2cBus, unsigned i2cFlags)
This returns a handle for the device at the address on the I2C bus.
Definition: nano.c:2091
int gpioSetMode(unsigned gpio, unsigned mode)
Sets the GPIO mode, typically input or output.
Definition: nano.c:1004
int gpioSetISRFunc(unsigned gpio, unsigned edge, unsigned debounce, unsigned long *timestamp, void(*f)())
Registers a function to be called (a callback) whenever the specified.
Definition: nano.c:1778
int extPeripheralEnable(unsigned clk_name)
Orin family only. This functions enables one of the external peripheral clocks. There are 2 (pins 29 ...
Definition: orin.c:2802
int i2cReadByteData(unsigned handle, unsigned i2cAddr, unsigned i2cReg)
This reads a single byte from the specified register of the device associated with handle.
Definition: nano.c:2249